@paperless/core 1.67.8 → 1.67.10
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/CHANGELOG.md +23 -0
- package/dist/build/p-3e3a79b1.entry.js +2 -0
- package/dist/build/p-3e3a79b1.entry.js.map +1 -0
- package/dist/build/p-59014c4c.entry.js +2 -0
- package/dist/build/{p-ac60e1f8.entry.js.map → p-59014c4c.entry.js.map} +1 -1
- package/dist/build/p-af33bb24.entry.js +2 -0
- package/dist/build/p-af33bb24.entry.js.map +1 -0
- package/dist/build/paperless.esm.js +1 -1
- package/dist/cjs/p-dropdown_2.cjs.entry.js +3 -3
- package/dist/cjs/p-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/p-profile.cjs.entry.js +2 -2
- package/dist/cjs/p-profile.cjs.entry.js.map +1 -1
- package/dist/cjs/p-select.cjs.entry.js +31 -24
- package/dist/cjs/p-select.cjs.entry.js.map +1 -1
- package/dist/collection/components/molecules/dropdown/dropdown.component.css +1 -1
- package/dist/collection/components/molecules/dropdown/dropdown.component.js +2 -2
- package/dist/collection/components/molecules/dropdown/dropdown.component.js.map +1 -1
- package/dist/collection/components/molecules/profile/profile.component.css +1 -1
- package/dist/collection/components/molecules/profile/profile.component.js +1 -1
- package/dist/collection/components/molecules/profile/profile.component.js.map +1 -1
- package/dist/collection/components/molecules/select/select.component.js +31 -24
- package/dist/collection/components/molecules/select/select.component.js.map +1 -1
- package/dist/components/dropdown.component.js +3 -3
- package/dist/components/dropdown.component.js.map +1 -1
- package/dist/components/p-profile.js +2 -2
- package/dist/components/p-profile.js.map +1 -1
- package/dist/components/p-select.js +31 -24
- package/dist/components/p-select.js.map +1 -1
- package/dist/esm/p-dropdown_2.entry.js +3 -3
- package/dist/esm/p-dropdown_2.entry.js.map +1 -1
- package/dist/esm/p-profile.entry.js +2 -2
- package/dist/esm/p-profile.entry.js.map +1 -1
- package/dist/esm/p-select.entry.js +31 -24
- package/dist/esm/p-select.entry.js.map +1 -1
- package/dist/index.html +1 -1
- package/dist/paperless/p-3e3a79b1.entry.js +2 -0
- package/dist/paperless/p-3e3a79b1.entry.js.map +1 -0
- package/dist/paperless/p-59014c4c.entry.js +2 -0
- package/dist/paperless/{p-ac60e1f8.entry.js.map → p-59014c4c.entry.js.map} +1 -1
- package/dist/paperless/p-af33bb24.entry.js +2 -0
- package/dist/paperless/p-af33bb24.entry.js.map +1 -0
- package/dist/paperless/paperless.esm.js +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/dist/types/components/molecules/select/select.component.d.ts +1 -0
- package/hydrate/index.js +36 -29
- package/package.json +1 -1
- package/dist/build/p-1a725037.entry.js +0 -2
- package/dist/build/p-1a725037.entry.js.map +0 -1
- package/dist/build/p-1dbb398d.entry.js +0 -2
- package/dist/build/p-1dbb398d.entry.js.map +0 -1
- package/dist/build/p-ac60e1f8.entry.js +0 -2
- package/dist/paperless/p-1a725037.entry.js +0 -2
- package/dist/paperless/p-1a725037.entry.js.map +0 -1
- package/dist/paperless/p-1dbb398d.entry.js +0 -2
- package/dist/paperless/p-1dbb398d.entry.js.map +0 -1
- package/dist/paperless/p-ac60e1f8.entry.js +0 -2
|
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement
|
|
|
2
2
|
import { a as autoUpdate, c as computePosition, o as offset, f as flip, s as shift } from './floating-ui.dom.esm-314a52b2.js';
|
|
3
3
|
import { c as childOf } from './child-of-fec6ab3a.js';
|
|
4
4
|
|
|
5
|
-
const dropdownComponentCss = ".relative{position:relative!important}.block{display:block!important}.h-auto{height:auto!important}*{box-sizing:border-box}p-dropdown,p-dropdown .trigger{display:block;position:relative}p-dropdown .trigger{height:auto;width:auto}.visible{visibility:visible!important}.static{position:static!important}.fixed{position:fixed!important}.absolute{position:absolute!important}.z-dropdown{z-index:200!important}.
|
|
5
|
+
const dropdownComponentCss = ".relative{position:relative!important}.block{display:block!important}.h-auto{height:auto!important}*{box-sizing:border-box}p-dropdown,p-dropdown .trigger{display:block;position:relative}p-dropdown .trigger{height:auto;width:auto}.visible{visibility:visible!important}.static{position:static!important}.fixed{position:fixed!important}.absolute{position:absolute!important}.z-dropdown{z-index:200!important}.hidden{display:none!important}";
|
|
6
6
|
|
|
7
7
|
const Dropdown = class {
|
|
8
8
|
constructor(hostRef) {
|
|
@@ -125,7 +125,7 @@ const Dropdown = class {
|
|
|
125
125
|
this._cleanup = autoUpdate(this._el, this._menu, () => this._update());
|
|
126
126
|
this._menu.setAttribute('data-show', '');
|
|
127
127
|
this._menu.classList.remove('hidden');
|
|
128
|
-
this._menu.classList.add('
|
|
128
|
+
this._menu.classList.add('block');
|
|
129
129
|
this.isOpen.emit(true);
|
|
130
130
|
this._update();
|
|
131
131
|
}
|
|
@@ -139,7 +139,7 @@ const Dropdown = class {
|
|
|
139
139
|
}
|
|
140
140
|
// Hide the popover
|
|
141
141
|
this._menu.removeAttribute('data-show');
|
|
142
|
-
this._menu.classList.remove('
|
|
142
|
+
this._menu.classList.remove('block');
|
|
143
143
|
this._menu.classList.add('hidden');
|
|
144
144
|
this.isOpen.emit(false);
|
|
145
145
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-dropdown.p-dropdown-menu-item.entry.js","mappings":";;;;AAAA,MAAM,oBAAoB,GAAG,mdAAmd;;MC0Bne,QAAQ;;;;IAyFZ,YAAO,GAAG,KAAK,CAAC;qBArFwB,cAAc;kBAKrC,CAAC;oBAKG,UAAU;gBAKf,KAAK;qBAKA,KAAK;0BAKA,KAAK;yBAKN,IAAI;0BAKH,IAAI;yBAKL,KAAK;sBAKc,KAAK;uBAK1B,KAAK;+BAKG,KAAK;wBAKZ,IAAI;2BAKO,KAAK;;;EAyBhD,qBAAqB;IACpB,IAAI,CAAC,OAAO,EAAE,CAAC;GACf;EAED,oBAAoB;IACnB,IAAI,IAAI,CAAC,QAAQ,EAAE;MAClB,IAAI,CAAC,QAAQ,EAAE,CAAC;MACh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KpB,IAAI;;wBAUZ,IAAI;;EAE3B,MAAM;IACL,QACC,EAAC,IAAI,IACJ,KAAK,EAAE,wBAAwB,IAAI,CAAC,MAAM,IAAI,QAAQ,IACrD,IAAI,CAAC,WAAW,IAAI,OACrB,EAAE,IAED,IAAI,CAAC,IAAI,IAAI,cAAQ,OAAO,EAAE,IAAI,CAAC,IAAI,GAAI,EAE3C,IAAI,CAAC,OAAO,KAAK,UAAU,KAC3B,aACC,IAAI,EAAC,UAAU,EACf,KAAK,EAAC,kCAAkC,EACxC,OAAO,EAAE,IAAI,CAAC,MAAM,GACnB,CACF,EAEA,IAAI,CAAC,YAAY,IACjB,WAAK,KAAK,EAAC,gBAAgB,IAC1B,eAAQ,CACH,KAEN,eAAQ,CACR,CACK,EACN;GACF;;;;;;","names":[],"sources":["src/components/molecules/dropdown/dropdown.component.scss?tag=p-dropdown","src/components/molecules/dropdown/dropdown.component.tsx","src/components/atoms/dropdown-menu-item/dropdown-menu-item.component.scss?tag=p-dropdown-menu-item&encapsulation=shadow","src/components/atoms/dropdown-menu-item/dropdown-menu-item.component.tsx"],"sourcesContent":["p-dropdown {\n\t@apply relative block;\n\n\t.trigger {\n\t\t@apply relative block h-auto w-auto;\n\t}\n}\n","import {\n\tautoUpdate,\n\tcomputePosition,\n\tflip,\n\toffset,\n\tPlacement,\n\tshift,\n\tStrategy,\n} from '@floating-ui/dom';\nimport {\n\tComponent,\n\tElement,\n\tEvent,\n\tEventEmitter,\n\th,\n\tHost,\n\tListen,\n\tProp,\n\tWatch,\n} from '@stencil/core';\nimport { childOf } from '../../../utils/child-of';\n\n@Component({\n\ttag: 'p-dropdown',\n\tstyleUrl: 'dropdown.component.scss',\n})\nexport class Dropdown {\n\t/**\n\t * The content of the dropdown menu\n\t */\n\t@Prop({ reflect: true }) placement: Placement = 'bottom-start';\n\n\t/**\n\t * The offset of the dropdown menu\n\t */\n\t@Prop() offset: number = 8;\n\n\t/**\n\t * The strategy of the dropdown placement\n\t */\n\t@Prop() strategy: Strategy = 'absolute';\n\n\t/**\n\t * Wether to show the dropdown menu\n\t */\n\t@Prop() show: boolean = false;\n\n\t/**\n\t * Wether to use a portal for the dropdown container\n\t */\n\t@Prop() usePortal: boolean = false;\n\n\t/**\n\t * Wether to automatically calculate the width of the menu based on the trigger\n\t */\n\t@Prop() calculateWidth: boolean = false;\n\n\t/**\n\t * Wether to apply the max width\n\t */\n\t@Prop() applyMaxWidth: boolean = true;\n\n\t/**\n\t * Wether to apply the full width\n\t */\n\t@Prop() applyFullWidth: boolean = true;\n\n\t/**\n\t * Wether to allow overflow in the container\n\t */\n\t@Prop() allowOverflow: boolean = false;\n\n\t/**\n\t * Wether the dropdown container should be scrollable when the threshold is met.\n\t */\n\t@Prop() scrollable: boolean | 'default' | 'large' = false;\n\n\t/**\n\t * Wether to automatically close the dropdown menu after clicking inside\n\t */\n\t@Prop() insideClick: boolean = false;\n\n\t/**\n\t * Wether to automatically close the dropdown menu after clicking inside\n\t */\n\t@Prop() disableTriggerClick: boolean = false;\n\n\t/**\n\t * Wether to apply chevron automatically\n\t */\n\t@Prop() applyChevron: boolean = true;\n\n\t/**\n\t * Chevron position\n\t */\n\t@Prop() chevronPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * Chevron direction\n\t */\n\t@Prop() chevronDirection: 'up' | 'down';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t/**\n\t * Open change event\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tisOpen: EventEmitter<boolean>;\n\n\tprivate _loaded = false;\n\tprivate _trigger: HTMLElement;\n\tprivate _menu: HTMLElement;\n\tprivate _cleanup: () => void;\n\n\tcomponentShouldUpdate() {\n\t\tthis._update();\n\t}\n\n\tdisconnectedCallback() {\n\t\tif (this._cleanup) {\n\t\t\tthis._cleanup();\n\t\t\tthis._cleanup = null;\n\t\t}\n\n\t\tthis._menu.remove();\n\t}\n\n\tcomponentDidRender() {\n\t\tthis._checkButtons();\n\t}\n\n\trender() {\n\t\tconst dropdownContainerProps = {\n\t\t\tclass: `z-dropdown hidden ${\n\t\t\t\tthis.strategy === 'fixed' ? 'fixed' : 'absolute'\n\t\t\t}`,\n\t\t\tref: el => this._load(el),\n\t\t\tonClick: () => this._containerClickHandler(),\n\t\t\trole: 'popover',\n\t\t\t'data-placement': this.placement,\n\t\t\t'data-strategy': this.strategy,\n\t\t};\n\n\t\tlet dropdownContainer: HTMLElement;\n\n\t\tif (this.usePortal) {\n\t\t\tdropdownContainer = (\n\t\t\t\t<p-portal {...dropdownContainerProps}>\n\t\t\t\t\t<p-dropdown-menu-container\n\t\t\t\t\t\tmaxWidth={!this.calculateWidth && this.applyMaxWidth}\n\t\t\t\t\t\tfullWidth={this.applyFullWidth && !this.applyMaxWidth}\n\t\t\t\t\t\tallowOverflow={this.allowOverflow}\n\t\t\t\t\t\tscrollable={this.scrollable}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot name='items' />\n\t\t\t\t\t</p-dropdown-menu-container>\n\t\t\t\t</p-portal>\n\t\t\t);\n\t\t} else {\n\t\t\tdropdownContainer = (\n\t\t\t\t<p-dropdown-menu-container\n\t\t\t\t\tmaxWidth={!this.calculateWidth && this.applyMaxWidth}\n\t\t\t\t\tfullWidth={this.applyFullWidth && !this.applyMaxWidth}\n\t\t\t\t\tallowOverflow={this.allowOverflow}\n\t\t\t\t\tscrollable={this.scrollable}\n\t\t\t\t\t{...dropdownContainerProps}\n\t\t\t\t>\n\t\t\t\t\t<slot name='items' />\n\t\t\t\t</p-dropdown-menu-container>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<Host class='p-dropdown'>\n\t\t\t\t<div\n\t\t\t\t\tclass='trigger'\n\t\t\t\t\tref={ref => (this._trigger = ref)}\n\t\t\t\t\tonClick={() => this._triggerClickHandler()}\n\t\t\t\t>\n\t\t\t\t\t<slot name='trigger' />\n\t\t\t\t</div>\n\t\t\t\t{dropdownContainer}\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _checkButtons() {\n\t\tif (!this.applyChevron) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst children = this._el.querySelectorAll('p-button[slot=\"trigger\"]');\n\n\t\tfor (let child of [...children]) {\n\t\t\t(child as any).chevronPosition = this.chevronPosition;\n\t\t\t(child as any).chevron = this.chevronDirection\n\t\t\t\t? this.chevronDirection\n\t\t\t\t: this.placement.indexOf('top') >= 0\n\t\t\t\t? 'up'\n\t\t\t\t: 'down';\n\t\t}\n\t}\n\n\t@Watch('show')\n\tprotected onShowChange(show) {\n\t\tif (!this._loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!show) {\n\t\t\tthis._hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._show();\n\t}\n\n\t@Listen('click', { target: 'document', capture: true })\n\tprotected documentClickHandler({ target }) {\n\t\tif (!this._menu.hasAttribute('data-show') || childOf(target, this._menu)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._hide();\n\t}\n\n\tprivate _containerClickHandler() {\n\t\tif (this.insideClick) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._menu.hasAttribute('data-show')) {\n\t\t\tthis._hide();\n\t\t}\n\t}\n\n\tprivate _triggerClickHandler() {\n\t\tif (this.disableTriggerClick) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._menu.hasAttribute('data-show')) {\n\t\t\tthis._hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._show();\n\t}\n\n\tprivate _load(popover: HTMLElement) {\n\t\tthis._menu = popover;\n\t\tif (popover) {\n\t\t\tthis._update();\n\t\t\tthis._loaded = true;\n\n\t\t\tif (this.show) {\n\t\t\t\tsetTimeout(() => this._show(), 100);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _show() {\n\t\tif (!this._loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make the popover visible\n\t\tif (this.calculateWidth) {\n\t\t\tthis._menu.style.width = `${this._trigger.clientWidth}px`;\n\t\t}\n\n\t\tthis._cleanup = autoUpdate(this._el, this._menu, () => this._update());\n\n\t\tthis._menu.setAttribute('data-show', '');\n\t\tthis._menu.classList.remove('hidden');\n\t\tthis._menu.classList.add('flex');\n\n\t\tthis.isOpen.emit(true);\n\n\t\tthis._update();\n\t}\n\n\tprivate _hide() {\n\t\tif (!this._loaded || this.show) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._cleanup) {\n\t\t\tthis._cleanup();\n\t\t\tthis._cleanup = null;\n\t\t}\n\n\t\t// Hide the popover\n\t\tthis._menu.removeAttribute('data-show');\n\t\tthis._menu.classList.remove('flex');\n\t\tthis._menu.classList.add('hidden');\n\n\t\tthis.isOpen.emit(false);\n\t}\n\n\tprivate _update() {\n\t\tif (!this._menu) {\n\t\t\treturn;\n\t\t}\n\n\t\tcomputePosition(this._el, this._menu, {\n\t\t\tplacement: this.placement,\n\t\t\tstrategy: this.strategy,\n\t\t\tmiddleware: [offset(this.offset), flip(), shift()],\n\t\t}).then(({ x, y, placement }) => {\n\t\t\tthis._menu.dataset.placement = placement;\n\t\t\tObject.assign(this._menu.style, {\n\t\t\t\ttop: `${y}px`,\n\t\t\t\tleft: `${x}px`,\n\t\t\t});\n\t\t});\n\t}\n}\n",":host {\n\t@import '../../../style/form/checkbox';\n\n\t@apply flex h-8 w-full items-center justify-start gap-2 rounded px-2;\n\t@apply text-sm font-semibold text-storm;\n\t@apply cursor-pointer;\n\n\t.text-container {\n\t\t@apply block w-full overflow-hidden text-ellipsis whitespace-nowrap text-start;\n\t}\n}\n\n:host(.hover:hover) {\n\t@apply bg-indigo-light text-storm;\n}\n\n:host(.active) {\n\t@apply bg-indigo-light text-indigo;\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\nimport { IconVariant } from '../icon/icon.component';\n\n@Component({\n\ttag: 'p-dropdown-menu-item',\n\tstyleUrl: 'dropdown-menu-item.component.scss',\n\tshadow: true,\n})\nexport class DropdownMenuItem {\n\t/**\n\t * Wether the dropdown menu item is active\n\t */\n\t@Prop() active: boolean = false;\n\n\t/**\n\t * The variant of the item\n\t */\n\t@Prop() variant: 'default' | 'checkbox' = 'default';\n\n\t/**\n\t * Wether to enable the hover state\n\t */\n\t@Prop() enableHover: boolean = true;\n\n\t/**\n\t * Icon of the navigation item\n\t */\n\t@Prop() icon: IconVariant;\n\n\t/**\n\t * wether to use the container for text\n\t */\n\t@Prop() useContainer = true;\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={`p-dropdown-menu-item ${this.active && 'active'} ${\n\t\t\t\t\tthis.enableHover && 'hover'\n\t\t\t\t}`}\n\t\t\t>\n\t\t\t\t{this.icon && <p-icon variant={this.icon} />}\n\n\t\t\t\t{this.variant === 'checkbox' && (\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype='checkbox'\n\t\t\t\t\t\tclass='p-input size-small flex-shrink-0'\n\t\t\t\t\t\tchecked={this.active}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{this.useContainer ? (\n\t\t\t\t\t<div class='text-container'>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<slot />\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t);\n\t}\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-dropdown.p-dropdown-menu-item.entry.js","mappings":";;;;AAAA,MAAM,oBAAoB,GAAG,sbAAsb;;MC0Btc,QAAQ;;;;IAyFZ,YAAO,GAAG,KAAK,CAAC;qBArFwB,cAAc;kBAKrC,CAAC;oBAKG,UAAU;gBAKf,KAAK;qBAKA,KAAK;0BAKA,KAAK;yBAKN,IAAI;0BAKH,IAAI;yBAKL,KAAK;sBAKc,KAAK;uBAK1B,KAAK;+BAKG,KAAK;wBAKZ,IAAI;2BAKO,KAAK;;;EAyBhD,qBAAqB;IACpB,IAAI,CAAC,OAAO,EAAE,CAAC;GACf;EAED,oBAAoB;IACnB,IAAI,IAAI,CAAC,QAAQ,EAAE;MAClB,IAAI,CAAC,QA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K;mBAKW,SAAS;uBAKpB,IAAI;;wBAUZ,IAAI;;EAE3B,MAAM;IACL,QACC,EAAC,IAAI,IACJ,KAAK,EAAE,wBAAwB,IAAI,CAAC,MAAM,IAAI,QAAQ,IACrD,IAAI,CAAC,WAAW,IAAI,OACrB,EAAE,IAED,IAAI,CAAC,IAAI,IAAI,cAAQ,OAAO,EAAE,IAAI,CAAC,IAAI,GAAI,EAE3C,IAAI,CAAC,OAAO,KAAK,UAAU,KAC3B,aACC,IAAI,EAAC,UAAU,EACf,KAAK,EAAC,kCAAkC,EACxC,OAAO,EAAE,IAAI,CAAC,MAAM,GACnB,CACF,EAEA,IAAI,CAAC,YAAY,IACjB,WAAK,KAAK,EAAC,gBAAgB,IAC1B,eAAQ,CACH,KAEN,eAAQ,CACR,CACK,EACN;GACF;;;;;;","names":[],"sources":["src/components/molecules/dropdown/dropdown.component.scss?tag=p-dropdown","src/components/molecules/dropdown/dropdown.component.tsx","src/components/atoms/dropdown-menu-item/dropdown-menu-item.component.scss?tag=p-dropdown-menu-item&encapsulation=shadow","src/components/atoms/dropdown-menu-item/dropdown-menu-item.component.tsx"],"sourcesContent":["p-dropdown {\n\t@apply relative block;\n\n\t.trigger {\n\t\t@apply relative block h-auto w-auto;\n\t}\n}\n","import {\n\tautoUpdate,\n\tcomputePosition,\n\tflip,\n\toffset,\n\tPlacement,\n\tshift,\n\tStrategy,\n} from '@floating-ui/dom';\nimport {\n\tComponent,\n\tElement,\n\tEvent,\n\tEventEmitter,\n\th,\n\tHost,\n\tListen,\n\tProp,\n\tWatch,\n} from '@stencil/core';\nimport { childOf } from '../../../utils/child-of';\n\n@Component({\n\ttag: 'p-dropdown',\n\tstyleUrl: 'dropdown.component.scss',\n})\nexport class Dropdown {\n\t/**\n\t * The content of the dropdown menu\n\t */\n\t@Prop({ reflect: true }) placement: Placement = 'bottom-start';\n\n\t/**\n\t * The offset of the dropdown menu\n\t */\n\t@Prop() offset: number = 8;\n\n\t/**\n\t * The strategy of the dropdown placement\n\t */\n\t@Prop() strategy: Strategy = 'absolute';\n\n\t/**\n\t * Wether to show the dropdown menu\n\t */\n\t@Prop() show: boolean = false;\n\n\t/**\n\t * Wether to use a portal for the dropdown container\n\t */\n\t@Prop() usePortal: boolean = false;\n\n\t/**\n\t * Wether to automatically calculate the width of the menu based on the trigger\n\t */\n\t@Prop() calculateWidth: boolean = false;\n\n\t/**\n\t * Wether to apply the max width\n\t */\n\t@Prop() applyMaxWidth: boolean = true;\n\n\t/**\n\t * Wether to apply the full width\n\t */\n\t@Prop() applyFullWidth: boolean = true;\n\n\t/**\n\t * Wether to allow overflow in the container\n\t */\n\t@Prop() allowOverflow: boolean = false;\n\n\t/**\n\t * Wether the dropdown container should be scrollable when the threshold is met.\n\t */\n\t@Prop() scrollable: boolean | 'default' | 'large' = false;\n\n\t/**\n\t * Wether to automatically close the dropdown menu after clicking inside\n\t */\n\t@Prop() insideClick: boolean = false;\n\n\t/**\n\t * Wether to automatically close the dropdown menu after clicking inside\n\t */\n\t@Prop() disableTriggerClick: boolean = false;\n\n\t/**\n\t * Wether to apply chevron automatically\n\t */\n\t@Prop() applyChevron: boolean = true;\n\n\t/**\n\t * Chevron position\n\t */\n\t@Prop() chevronPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * Chevron direction\n\t */\n\t@Prop() chevronDirection: 'up' | 'down';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t/**\n\t * Open change event\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tisOpen: EventEmitter<boolean>;\n\n\tprivate _loaded = false;\n\tprivate _trigger: HTMLElement;\n\tprivate _menu: HTMLElement;\n\tprivate _cleanup: () => void;\n\n\tcomponentShouldUpdate() {\n\t\tthis._update();\n\t}\n\n\tdisconnectedCallback() {\n\t\tif (this._cleanup) {\n\t\t\tthis._cleanup();\n\t\t\tthis._cleanup = null;\n\t\t}\n\n\t\tthis._menu.remove();\n\t}\n\n\tcomponentDidRender() {\n\t\tthis._checkButtons();\n\t}\n\n\trender() {\n\t\tconst dropdownContainerProps = {\n\t\t\tclass: `z-dropdown hidden ${\n\t\t\t\tthis.strategy === 'fixed' ? 'fixed' : 'absolute'\n\t\t\t}`,\n\t\t\tref: el => this._load(el),\n\t\t\tonClick: () => this._containerClickHandler(),\n\t\t\trole: 'popover',\n\t\t\t'data-placement': this.placement,\n\t\t\t'data-strategy': this.strategy,\n\t\t};\n\n\t\tlet dropdownContainer: HTMLElement;\n\n\t\tif (this.usePortal) {\n\t\t\tdropdownContainer = (\n\t\t\t\t<p-portal {...dropdownContainerProps}>\n\t\t\t\t\t<p-dropdown-menu-container\n\t\t\t\t\t\tmaxWidth={!this.calculateWidth && this.applyMaxWidth}\n\t\t\t\t\t\tfullWidth={this.applyFullWidth && !this.applyMaxWidth}\n\t\t\t\t\t\tallowOverflow={this.allowOverflow}\n\t\t\t\t\t\tscrollable={this.scrollable}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot name='items' />\n\t\t\t\t\t</p-dropdown-menu-container>\n\t\t\t\t</p-portal>\n\t\t\t);\n\t\t} else {\n\t\t\tdropdownContainer = (\n\t\t\t\t<p-dropdown-menu-container\n\t\t\t\t\tmaxWidth={!this.calculateWidth && this.applyMaxWidth}\n\t\t\t\t\tfullWidth={this.applyFullWidth && !this.applyMaxWidth}\n\t\t\t\t\tallowOverflow={this.allowOverflow}\n\t\t\t\t\tscrollable={this.scrollable}\n\t\t\t\t\t{...dropdownContainerProps}\n\t\t\t\t>\n\t\t\t\t\t<slot name='items' />\n\t\t\t\t</p-dropdown-menu-container>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<Host class='p-dropdown'>\n\t\t\t\t<div\n\t\t\t\t\tclass='trigger'\n\t\t\t\t\tref={ref => (this._trigger = ref)}\n\t\t\t\t\tonClick={() => this._triggerClickHandler()}\n\t\t\t\t>\n\t\t\t\t\t<slot name='trigger' />\n\t\t\t\t</div>\n\t\t\t\t{dropdownContainer}\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _checkButtons() {\n\t\tif (!this.applyChevron) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst children = this._el.querySelectorAll('p-button[slot=\"trigger\"]');\n\n\t\tfor (let child of [...children]) {\n\t\t\t(child as any).chevronPosition = this.chevronPosition;\n\t\t\t(child as any).chevron = this.chevronDirection\n\t\t\t\t? this.chevronDirection\n\t\t\t\t: this.placement.indexOf('top') >= 0\n\t\t\t\t? 'up'\n\t\t\t\t: 'down';\n\t\t}\n\t}\n\n\t@Watch('show')\n\tprotected onShowChange(show) {\n\t\tif (!this._loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!show) {\n\t\t\tthis._hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._show();\n\t}\n\n\t@Listen('click', { target: 'document', capture: true })\n\tprotected documentClickHandler({ target }) {\n\t\tif (!this._menu.hasAttribute('data-show') || childOf(target, this._menu)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._hide();\n\t}\n\n\tprivate _containerClickHandler() {\n\t\tif (this.insideClick) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._menu.hasAttribute('data-show')) {\n\t\t\tthis._hide();\n\t\t}\n\t}\n\n\tprivate _triggerClickHandler() {\n\t\tif (this.disableTriggerClick) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._menu.hasAttribute('data-show')) {\n\t\t\tthis._hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._show();\n\t}\n\n\tprivate _load(popover: HTMLElement) {\n\t\tthis._menu = popover;\n\t\tif (popover) {\n\t\t\tthis._update();\n\t\t\tthis._loaded = true;\n\n\t\t\tif (this.show) {\n\t\t\t\tsetTimeout(() => this._show(), 100);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _show() {\n\t\tif (!this._loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make the popover visible\n\t\tif (this.calculateWidth) {\n\t\t\tthis._menu.style.width = `${this._trigger.clientWidth}px`;\n\t\t}\n\n\t\tthis._cleanup = autoUpdate(this._el, this._menu, () => this._update());\n\n\t\tthis._menu.setAttribute('data-show', '');\n\t\tthis._menu.classList.remove('hidden');\n\t\tthis._menu.classList.add('block');\n\n\t\tthis.isOpen.emit(true);\n\n\t\tthis._update();\n\t}\n\n\tprivate _hide() {\n\t\tif (!this._loaded || this.show) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._cleanup) {\n\t\t\tthis._cleanup();\n\t\t\tthis._cleanup = null;\n\t\t}\n\n\t\t// Hide the popover\n\t\tthis._menu.removeAttribute('data-show');\n\t\tthis._menu.classList.remove('block');\n\t\tthis._menu.classList.add('hidden');\n\n\t\tthis.isOpen.emit(false);\n\t}\n\n\tprivate _update() {\n\t\tif (!this._menu) {\n\t\t\treturn;\n\t\t}\n\n\t\tcomputePosition(this._el, this._menu, {\n\t\t\tplacement: this.placement,\n\t\t\tstrategy: this.strategy,\n\t\t\tmiddleware: [offset(this.offset), flip(), shift()],\n\t\t}).then(({ x, y, placement }) => {\n\t\t\tthis._menu.dataset.placement = placement;\n\t\t\tObject.assign(this._menu.style, {\n\t\t\t\ttop: `${y}px`,\n\t\t\t\tleft: `${x}px`,\n\t\t\t});\n\t\t});\n\t}\n}\n",":host {\n\t@import '../../../style/form/checkbox';\n\n\t@apply flex h-8 w-full items-center justify-start gap-2 rounded px-2;\n\t@apply text-sm font-semibold text-storm;\n\t@apply cursor-pointer;\n\n\t.text-container {\n\t\t@apply block w-full overflow-hidden text-ellipsis whitespace-nowrap text-start;\n\t}\n}\n\n:host(.hover:hover) {\n\t@apply bg-indigo-light text-storm;\n}\n\n:host(.active) {\n\t@apply bg-indigo-light text-indigo;\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\nimport { IconVariant } from '../icon/icon.component';\n\n@Component({\n\ttag: 'p-dropdown-menu-item',\n\tstyleUrl: 'dropdown-menu-item.component.scss',\n\tshadow: true,\n})\nexport class DropdownMenuItem {\n\t/**\n\t * Wether the dropdown menu item is active\n\t */\n\t@Prop() active: boolean = false;\n\n\t/**\n\t * The variant of the item\n\t */\n\t@Prop() variant: 'default' | 'checkbox' = 'default';\n\n\t/**\n\t * Wether to enable the hover state\n\t */\n\t@Prop() enableHover: boolean = true;\n\n\t/**\n\t * Icon of the navigation item\n\t */\n\t@Prop() icon: IconVariant;\n\n\t/**\n\t * wether to use the container for text\n\t */\n\t@Prop() useContainer = true;\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={`p-dropdown-menu-item ${this.active && 'active'} ${\n\t\t\t\t\tthis.enableHover && 'hover'\n\t\t\t\t}`}\n\t\t\t>\n\t\t\t\t{this.icon && <p-icon variant={this.icon} />}\n\n\t\t\t\t{this.variant === 'checkbox' && (\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype='checkbox'\n\t\t\t\t\t\tclass='p-input size-small flex-shrink-0'\n\t\t\t\t\t\tchecked={this.active}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{this.useContainer ? (\n\t\t\t\t\t<div class='text-container'>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<slot />\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t);\n\t}\n}\n"],"version":3}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-f1f0954a.js';
|
|
2
2
|
|
|
3
|
-
const profileComponentCss = ".flex{display:flex!important}.table{display:table!important}.h-\\[3\\.125rem\\]{height:3.125rem!important}.h-\\[4\\.125rem\\]{height:4.125rem!important}.h-\\[6\\.5rem\\]{height:6.5rem!important}.w-full{width:100%!important}.flex-col{flex-direction:column!important}.items-center{align-items:center!important}.justify-center{justify-content:center!important}.overflow-hidden{overflow:hidden!important}.text-ellipsis{text-overflow:ellipsis!important}.rounded{border-radius:.25rem!important}.border{border-width:1px!important}.border-solid{border-style:solid!important}.border-mystic-dark{--tw-border-opacity:1!important;border-color:rgb(218 230 240/var(--tw-border-opacity))!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}*{box-sizing:border-box}:host{display:flex}:host .content{align-items:center;display:flex;gap:.75rem;width:100%}:host .content .name{display:flex;flex-direction:column;justify-content:center;overflow:hidden}:host .content .name>:first-child{--tw-text-opacity:1;color:rgb(39 40 56/var(--tw-text-opacity));font-size:.875rem;font-weight:600;line-height:1.25rem}:host .content .name>:nth-child(2){--tw-text-opacity:1;color:rgb(152 154 183/var(--tw-text-opacity));font-size:.875rem;line-height:1.25rem}:host .content .name ::slotted(*){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([size=xsmall]){height:1.5rem}:host([size=small]){height:2rem}:host([size=table]){height:2.5rem}:host([size=medium]){height:3.125rem}:host([size=large]){height:4rem}:host([size=xlarge]){height:6.5rem}:host(.has-dropdown){cursor:pointer}:host(.has-dropdown) .content{--tw-border-opacity:1!important;border-color:rgb(218 230 240/var(--tw-border-opacity))!important;border-radius:.25rem;border-style:solid!important;border-width:1px!important;padding:.5rem}:host(.has-dropdown[size=small]){height:3rem}:host(.has-dropdown[size=medium]){height:4.125rem}:host(.has-dropdown[size=large]){height:5rem}:host(.active) .content,:host(.has-dropdown:hover) .content{--tw-shadow:0px 0.3125rem 1rem rgba(0,24,98,.08),0px 0.0625rem 0.1875rem rgba(0,24,98,.13);--tw-shadow-colored:0px 0.3125rem 1rem var(--tw-shadow-color),0px 0.0625rem 0.1875rem var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}:host(.active) .content p-icon{--tw-text-opacity:1;color:rgb(82 138 250/var(--tw-text-opacity))}.static{position:static!important}.absolute{position:absolute!important}.ml-auto{margin-left:auto!important}.min-w-0{min-width:0!important}";
|
|
3
|
+
const profileComponentCss = ".flex{display:flex!important}.table{display:table!important}.h-\\[3\\.125rem\\]{height:3.125rem!important}.h-\\[4\\.125rem\\]{height:4.125rem!important}.h-\\[6\\.5rem\\]{height:6.5rem!important}.w-full{width:100%!important}.flex-col{flex-direction:column!important}.items-center{align-items:center!important}.justify-center{justify-content:center!important}.overflow-hidden{overflow:hidden!important}.text-ellipsis{text-overflow:ellipsis!important}.rounded{border-radius:.25rem!important}.border{border-width:1px!important}.border-solid{border-style:solid!important}.border-mystic-dark{--tw-border-opacity:1!important;border-color:rgb(218 230 240/var(--tw-border-opacity))!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}*{box-sizing:border-box}:host{display:flex}:host .profile-content{align-items:center;display:flex;gap:.75rem;width:100%}:host .profile-content .name{display:flex;flex-direction:column;justify-content:center;overflow:hidden}:host .profile-content .name>:first-child{--tw-text-opacity:1;color:rgb(39 40 56/var(--tw-text-opacity));font-size:.875rem;font-weight:600;line-height:1.25rem}:host .profile-content .name>:nth-child(2){--tw-text-opacity:1;color:rgb(152 154 183/var(--tw-text-opacity));font-size:.875rem;line-height:1.25rem}:host .profile-content .name ::slotted(*){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([size=xsmall]){height:1.5rem}:host([size=small]){height:2rem}:host([size=table]){height:2.5rem}:host([size=medium]){height:3.125rem}:host([size=large]){height:4rem}:host([size=xlarge]){height:6.5rem}:host(.has-dropdown){cursor:pointer}:host(.has-dropdown) .profile-content{--tw-border-opacity:1!important;border-color:rgb(218 230 240/var(--tw-border-opacity))!important;border-radius:.25rem;border-style:solid!important;border-width:1px!important;padding:.5rem}:host(.has-dropdown[size=small]){height:3rem}:host(.has-dropdown[size=medium]){height:4.125rem}:host(.has-dropdown[size=large]){height:5rem}:host(.active) .profile-content,:host(.has-dropdown:hover) .profile-content{--tw-shadow:0px 0.3125rem 1rem rgba(0,24,98,.08),0px 0.0625rem 0.1875rem rgba(0,24,98,.13);--tw-shadow-colored:0px 0.3125rem 1rem var(--tw-shadow-color),0px 0.0625rem 0.1875rem var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}:host(.active) .profile-content p-icon{--tw-text-opacity:1;color:rgb(82 138 250/var(--tw-text-opacity))}.static{position:static!important}.absolute{position:absolute!important}.ml-auto{margin-left:auto!important}.min-w-0{min-width:0!important}";
|
|
4
4
|
|
|
5
5
|
const Profile = class {
|
|
6
6
|
constructor(hostRef) {
|
|
@@ -19,7 +19,7 @@ const Profile = class {
|
|
|
19
19
|
return (h(Host, { class: `p-profile ${hasDropdownSlot && 'has-dropdown'} ${this._dropdownOpen && 'active'}` }, hasDropdownSlot ? (h("p-dropdown", { class: 'w-full min-w-0', strategy: 'absolute', placement: this.variant === 'user' ? 'top-end' : 'bottom-end', applyFullWidth: true, applyMaxWidth: false, onIsOpen: ev => (this._dropdownOpen = ev.detail) }, content, h("div", { slot: 'items' }, dropdownItems))) : (content)));
|
|
20
20
|
}
|
|
21
21
|
_getContent(hasDropdownSlot) {
|
|
22
|
-
return (h("div", { class: 'content', slot: 'trigger' }, h("slot", { name: 'avatar' }), h("div", { class: 'name' }, h("slot", { name: 'title' }), h("slot", { name: 'subtitle' })), hasDropdownSlot && this._getIcon()));
|
|
22
|
+
return (h("div", { class: 'profile-content', slot: 'trigger' }, h("slot", { name: 'avatar' }), h("div", { class: 'name' }, h("slot", { name: 'title' }), h("slot", { name: 'subtitle' })), hasDropdownSlot && this._getIcon()));
|
|
23
23
|
}
|
|
24
24
|
_updateAvatar() {
|
|
25
25
|
var _a, _b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-profile.entry.js","mappings":";;AAAA,MAAM,mBAAmB,GAAG,
|
|
1
|
+
{"file":"p-profile.entry.js","mappings":";;AAAA,MAAM,mBAAmB,GAAG,8iFAA8iF;;MCO7jF,OAAO;;;mBAImB,MAAM;gBAW9B,OAAO;yBAOY,KAAK;;EAEtC,mBAAmB;IAClB,IAAI,CAAC,aAAa,EAAE,CAAC;GACrB;EAED,MAAM;IACL,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CA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M,uBAAN,MAAM,CAAE,IAAI,CAAC;GACxC;EAEO,QAAQ;IACf,QACC,cACC,KAAK,EAAC,SAAS,EACf,OAAO,EAAE,IAAI,CAAC,OAAO,KAAK,SAAS,GAAG,SAAS,GAAG,MAAM,GACvD,EACD;GACF;;;;;;;","names":[],"sources":["src/components/molecules/profile/profile.component.scss?tag=p-profile&encapsulation=shadow","src/components/molecules/profile/profile.component.tsx"],"sourcesContent":[":host {\n\t@apply flex;\n\n\t.profile-content {\n\t\t@apply flex w-full items-center gap-3;\n\n\t\t.name {\n\t\t\t@apply flex flex-col justify-center overflow-hidden;\n\n\t\t\t> *:nth-child(1) {\n\t\t\t\t@apply text-sm text-storm-dark;\n\t\t\t\t@apply font-semibold;\n\t\t\t}\n\n\t\t\t> *:nth-child(2) {\n\t\t\t\t@apply text-sm text-storm-vague;\n\t\t\t}\n\n\t\t\t::slotted(*) {\n\t\t\t\t@apply overflow-hidden text-ellipsis whitespace-nowrap;\n\t\t\t}\n\t\t}\n\t}\n}\n\n:host([size='xsmall']) {\n\t@apply h-6;\n}\n\n:host([size='small']) {\n\t@apply h-8;\n}\n\n:host([size='table']) {\n\t@apply h-10;\n}\n\n:host([size='medium']) {\n\t@apply h-[3.125rem];\n}\n\n:host([size='large']) {\n\t@apply h-16;\n}\n\n:host([size='xlarge']) {\n\t@apply h-[6.5rem];\n}\n\n:host(.has-dropdown) {\n\t@apply cursor-pointer;\n\n\t.profile-content {\n\t\t@apply rounded p-2;\n\t\t@apply border border-solid border-mystic-dark #{!important};\n\t}\n}\n\n:host(.has-dropdown[size='small']) {\n\t@apply h-12;\n}\n\n:host(.has-dropdown[size='medium']) {\n\t@apply h-[4.125rem];\n}\n\n:host(.has-dropdown[size='large']) {\n\t@apply h-20;\n}\n\n:host(.has-dropdown:hover),\n:host(.active) {\n\t.profile-content {\n\t\t@apply shadow-4;\n\t}\n}\n\n:host(.active) {\n\t.profile-content {\n\t\tp-icon {\n\t\t\t@apply text-indigo;\n\t\t}\n\t}\n}\n","import { Component, Element, h, Host, Prop, State } from '@stencil/core';\n\n@Component({\n\ttag: 'p-profile',\n\tstyleUrl: 'profile.component.scss',\n\tshadow: true,\n})\nexport class Profile {\n\t/**\n\t * The variant of the profile\n\t */\n\t@Prop() variant: 'company' | 'user' = 'user';\n\n\t/**\n\t * The size of the profile avatar\n\t */\n\t@Prop({ reflect: true }) size:\n\t\t| 'xsmall'\n\t\t| 'small'\n\t\t| 'table'\n\t\t| 'medium'\n\t\t| 'large'\n\t\t| 'xlarge' = 'small';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _dropdownOpen = false;\n\n\tcomponentWillRender() {\n\t\tthis._updateAvatar();\n\t}\n\n\trender() {\n\t\tconst hasDropdownSlot = !!this._el.querySelector(\n\t\t\t':scope > [slot=\"dropdown\"]'\n\t\t);\n\t\tconst content = this._getContent(hasDropdownSlot);\n\t\tconst dropdownItems = <slot name='dropdown' />;\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={`p-profile ${hasDropdownSlot && 'has-dropdown'} ${\n\t\t\t\t\tthis._dropdownOpen && 'active'\n\t\t\t\t}`}\n\t\t\t>\n\t\t\t\t{hasDropdownSlot ? (\n\t\t\t\t\t<p-dropdown\n\t\t\t\t\t\tclass='w-full min-w-0'\n\t\t\t\t\t\tstrategy='absolute'\n\t\t\t\t\t\tplacement={this.variant === 'user' ? 'top-end' : 'bottom-end'}\n\t\t\t\t\t\tapplyFullWidth={true}\n\t\t\t\t\t\tapplyMaxWidth={false}\n\t\t\t\t\t\tonIsOpen={ev => (this._dropdownOpen = ev.detail)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{content}\n\t\t\t\t\t\t<div slot='items'>{dropdownItems}</div>\n\t\t\t\t\t</p-dropdown>\n\t\t\t\t) : (\n\t\t\t\t\tcontent\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _getContent(hasDropdownSlot: boolean) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclass='profile-content'\n\t\t\t\tslot='trigger'\n\t\t\t>\n\t\t\t\t<slot name='avatar' />\n\t\t\t\t<div class='name'>\n\t\t\t\t\t<slot name='title' />\n\t\t\t\t\t<slot name='subtitle' />\n\t\t\t\t</div>\n\n\t\t\t\t{hasDropdownSlot && this._getIcon()}\n\t\t\t</div>\n\t\t);\n\t}\n\n\tprivate _updateAvatar() {\n\t\tconst avatar = this._el.querySelector(\n\t\t\t'p-avatar[slot=\"avatar\"]'\n\t\t) as HTMLPAvatarElement;\n\n\t\tif (!avatar) {\n\t\t\treturn;\n\t\t}\n\n\t\tavatar.variant = this.variant ?? avatar.variant;\n\t\tavatar.size = this.size ?? avatar?.size;\n\t}\n\n\tprivate _getIcon() {\n\t\treturn (\n\t\t\t<p-icon\n\t\t\t\tclass='ml-auto'\n\t\t\t\tvariant={this.variant === 'company' ? 'chevron' : 'more'}\n\t\t\t/>\n\t\t);\n\t}\n}\n"],"version":3}
|
|
@@ -55,29 +55,7 @@ const Select = class {
|
|
|
55
55
|
this._amountHidden = 0;
|
|
56
56
|
}
|
|
57
57
|
get _items() {
|
|
58
|
-
|
|
59
|
-
if (!this.items || this.loading) {
|
|
60
|
-
return [];
|
|
61
|
-
}
|
|
62
|
-
let items = typeof this.items === 'string' ? JSON.parse(this.items) : this.items;
|
|
63
|
-
if (typeof (items === null || items === void 0 ? void 0 : items[0]) === 'string') {
|
|
64
|
-
this.displayKey = 'text';
|
|
65
|
-
this.valueKey = 'value';
|
|
66
|
-
items = items.map(str => ({
|
|
67
|
-
value: str,
|
|
68
|
-
text: str,
|
|
69
|
-
}));
|
|
70
|
-
}
|
|
71
|
-
if (((_a = this.query) === null || _a === void 0 ? void 0 : _a.length) && !this.asyncFilter) {
|
|
72
|
-
items = items.filter(item => {
|
|
73
|
-
if (this.queryKey) {
|
|
74
|
-
return this._checkvalue(this.queryKey, item);
|
|
75
|
-
}
|
|
76
|
-
return (this._checkvalue(this._identifierKey, item) ||
|
|
77
|
-
this._checkvalue(this.displayKey, item));
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
return items === null || items === void 0 ? void 0 : items.slice(0, this.maxDisplayedItems);
|
|
58
|
+
return this._getParsedItems();
|
|
81
59
|
}
|
|
82
60
|
get _displayValue() {
|
|
83
61
|
var _a;
|
|
@@ -207,7 +185,8 @@ const Select = class {
|
|
|
207
185
|
this._selectValue(value, false);
|
|
208
186
|
return;
|
|
209
187
|
}
|
|
210
|
-
const
|
|
188
|
+
const items = this._getParsedItems(false);
|
|
189
|
+
const item = items.find(i => {
|
|
211
190
|
const itemIdentifier = i === null || i === void 0 ? void 0 : i[this._identifierKey];
|
|
212
191
|
const parsedItemIdentifier = typeof itemIdentifier === 'string' || typeof itemIdentifier === 'number'
|
|
213
192
|
? itemIdentifier
|
|
@@ -381,6 +360,34 @@ const Select = class {
|
|
|
381
360
|
? `max-w-full ${item === null || item === void 0 ? void 0 : item.class}`
|
|
382
361
|
: 'max-w-full' }, content));
|
|
383
362
|
}
|
|
363
|
+
_getParsedItems(applyPagination = false) {
|
|
364
|
+
var _a;
|
|
365
|
+
if (!this.items || this.loading) {
|
|
366
|
+
return [];
|
|
367
|
+
}
|
|
368
|
+
let items = typeof this.items === 'string' ? JSON.parse(this.items) : this.items;
|
|
369
|
+
if (typeof (items === null || items === void 0 ? void 0 : items[0]) === 'string') {
|
|
370
|
+
this.displayKey = 'text';
|
|
371
|
+
this.valueKey = 'value';
|
|
372
|
+
items = items.map(str => ({
|
|
373
|
+
value: str,
|
|
374
|
+
text: str,
|
|
375
|
+
}));
|
|
376
|
+
}
|
|
377
|
+
if (((_a = this.query) === null || _a === void 0 ? void 0 : _a.length) && !this.asyncFilter) {
|
|
378
|
+
items = items.filter(item => {
|
|
379
|
+
if (this.queryKey) {
|
|
380
|
+
return this._checkvalue(this.queryKey, item);
|
|
381
|
+
}
|
|
382
|
+
return (this._checkvalue(this._identifierKey, item) ||
|
|
383
|
+
this._checkvalue(this.displayKey, item));
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
if (!applyPagination) {
|
|
387
|
+
return items;
|
|
388
|
+
}
|
|
389
|
+
return items === null || items === void 0 ? void 0 : items.slice(0, this.maxDisplayedItems);
|
|
390
|
+
}
|
|
384
391
|
get _el() { return getElement(this); }
|
|
385
392
|
static get watchers() { return {
|
|
386
393
|
"value": ["_valueChange"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-select.entry.js","mappings":";;;AAAA,MAAM,kBAAkB,GAAG,w+KAAw+K;;MCmBt/K,MAAM;;;;;;;;;;;;;mCA6BwB,WAAW;;sBAUxB,MAAM;;;;;;;oBAmCR,OAAO;;;;;2BAyBC,IAAI;uBAKR,IAAI;6BAKC,EAAE;8BAKA,IAAI;uBAKX,KAAK;mBAKT,KAAK;2BAKG,KAAK;yBAKR,YAAY;;gBA0CT,QAAQ;;;;;;oBA8BE,KAAK;uBAKnB,KAAK;uBAKN,UAAU;0BAaP,oBAAoB;yBAOf,KAAK;yBACL,IAAI;wBAED,KAAK;yBAEb,CAAC;;EASlC,IAAI,MAAM;;IACT,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,OAAO,EAAE;MAChC,OAAO,EAAE,CAAC;KACV;IAED,IAAI,KAAK,GACR,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;IAEtE,IAAI,QAAO,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,CAAC,CAAC,CAAA,KAAK,QAAQ,EAAE;MACnC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;MACzB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;MAExB,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK;QACzB,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,GAAG;OACT,CAAC,CAAC,CAAC;KACJ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,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;GAC7C;EAEO,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,KAAK;;IAC5C,IAAI,OAAO,IACV,WAAK,KAAK,EAAC,gBAAgB,IAEzB,IAAI,CACH,WAAW;QACR,MAAA,IAAI,CAAC,mBAAmB,mCAAI,IAAI,CAAC,UAAU;QAC3C,IAAI,CAAC,UAAU,CAClB,CAEG,CACN,CAAC;IAEF,IAAI,IAAI,CAAC,SAAS,EAAE;MACnB,OAAO,IACN,YAAM,KAAK,EAAC,yBAAyB,IACpC,gBACC,IAAI,EAAC,QAAQ,EACb,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EACzB,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,GACzB,EACZ,WAAK,KAAK,EAAC,gBAAgB,IACzB,IAAI,CAAC,MAAA,IAAI,CAAC,kBAAkB,mCAAI,IAAI,CAAC,UAAU,CAAC,CAC5C,CACA,CACP,CAAC;KACF;IAED,IAAI,IAAI,CAAC,OAAO,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC,sBAAsB,CAAC,EAAE;MAClE,OAAO,IACN,YAAM,KAAK,EAAC,yBAAyB,IACpC,cAAQ,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAgB,GAAI,EACtD,WAAK,KAAK,EAAC,gBAAgB,IACzB,IAAI,CAAC,MAAA,IAAI,CAAC,kBAAkB,mCAAI,IAAI,CAAC,UAAU,CAAC,CAC5C,CACA,CACP,CAAC;KACF;IAED,QACC,WACC,KAAK,EACJ,CAAC,WAAW,IAAI,IAAI,CAAC,wBAAwB;UAC1C,cAAc,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,EAAE;UAC3B,YAAY,IAGf,OAAO,CACH,EACL;GACF;;;;;;;;;;;;;","names":[],"sources":["src/components/molecules/select/select.component.scss?tag=p-select","src/components/molecules/select/select.component.tsx"],"sourcesContent":["@import '../../../style/form/mixins';\n\np-select {\n\t@apply relative flex w-full flex-col text-ellipsis;\n\n\t.p-input {\n\t\t@include inputDefaultState();\n\t\t@apply text-base font-semibold;\n\n\t\t&.size-small {\n\t\t\t@apply text-sm font-medium;\n\t\t}\n\t}\n\n\t.text-container {\n\t\t@apply block w-full overflow-hidden text-ellipsis whitespace-nowrap text-start;\n\t}\n\n\t.multi-container {\n\t\t@apply pointer-events-none absolute bottom-0 left-0 flex h-10 w-full items-center gap-2 overflow-hidden px-2 py-4;\n\n\t\t&.size-small {\n\t\t\t@apply h-8 px-1 py-2;\n\t\t}\n\n\t\t.item {\n\t\t\t@apply pointer-events-auto flex h-[1.625rem] cursor-pointer items-center gap-2 whitespace-nowrap rounded bg-indigo-light px-2 text-sm font-semibold text-indigo-dark;\n\n\t\t\tp-icon {\n\t\t\t\t@apply text-xs text-indigo;\n\t\t\t}\n\t\t}\n\n\t\t.extra {\n\t\t\t@apply pointer-events-none text-sm text-storm-medium;\n\t\t}\n\t}\n}\n","import {\n\tComponent,\n\tElement,\n\tEvent,\n\tEventEmitter,\n\th,\n\tHost,\n\tListen,\n\tProp,\n\tState,\n\tWatch,\n} from '@stencil/core';\nimport { childOf } from '../../../utils';\nimport { IconVariant } from '../../atoms/icon/icon.component';\n\n@Component({\n\ttag: 'p-select',\n\tstyleUrl: 'select.component.scss',\n})\nexport class Select {\n\t/**\n\t * The items to show in the dropdown\n\t */\n\t@Prop() items: string | any[];\n\n\t/**\n\t * Wether to enable multi select\n\t */\n\t@Prop({ reflect: true }) multi: boolean;\n\n\t/**\n\t * Icon of the select box\n\t */\n\t@Prop() icon: IconVariant;\n\n\t/**\n\t * The current query\n\t */\n\t@Prop() query: string;\n\n\t/**\n\t * The placeholder of the input\n\t */\n\t@Prop() placeholder: string;\n\n\t/**\n\t * The placeholder of the input used for auto complete\n\t */\n\t@Prop() autocompletePlaceholder: string = 'Search...';\n\n\t/**\n\t * The current value\n\t */\n\t@Prop() value: any;\n\n\t/**\n\t * The key of the object to display\n\t */\n\t@Prop() displayKey: string = 'text';\n\n\t/**\n\t * The key of the object to display in the dropdown (overwrites displayKey)\n\t */\n\t@Prop() dropdownDisplayKey: string | undefined;\n\n\t/**\n\t * The key of the object to display in the input (overwrites displayKey)\n\t */\n\t@Prop() selectionDisplayKey: string | undefined;\n\n\t/**\n\t * The key of the object to return\n\t */\n\t@Prop() valueKey: string;\n\n\t/**\n\t * The key of avatar within an item to show\n\t */\n\t@Prop() avatarKey: string;\n\n\t/**\n\t * The key of icon variant within an item to show\n\t */\n\t@Prop() iconKey: string;\n\n\t/**\n\t * Wether to show the icon also on the selected Item\n\t */\n\t@Prop() showIconInSelectedItem: string;\n\n\t/**\n\t * The key of a class in an item to apply\n\t */\n\t@Prop() classKey: string = 'class';\n\n\t/**\n\t * Wether to apply the item's class also on the selected item\n\t */\n\t@Prop() applyClassOnSelectedItem: string;\n\n\t/**\n\t * The key of avatar letters within an item to show when the avatar url doesn't work\n\t */\n\t@Prop() avatarLettersKey: string;\n\n\t/**\n\t * The key to identify an object\n\t */\n\t@Prop() identifierKey: string;\n\n\t/**\n\t * The key of the object to display\n\t */\n\t@Prop() queryKey?: string;\n\n\t/**\n\t * Wether to automatically select the first item\n\t */\n\t@Prop() autoSelectFirst: boolean = true;\n\n\t/**\n\t * Wether to show the chevron or not\n\t */\n\t@Prop() showChevron: boolean = true;\n\n\t/**\n\t * The maximum amount of items to display\n\t */\n\t@Prop() maxDisplayedItems: number = 10;\n\n\t/**\n\t * Wether to enable autocomplete\n\t */\n\t@Prop() enableAutocomplete: boolean = true;\n\n\t/**\n\t * Wether the input uses async filtering\n\t */\n\t@Prop() asyncFilter: boolean = false;\n\n\t/**\n\t * Wether to show loading items\n\t */\n\t@Prop() loading: boolean = false;\n\n\t/**\n\t * Wether to show the select all item with multi select\n\t */\n\t@Prop() enableSelectAll: boolean = false;\n\n\t/**\n\t * The text of the select all item\n\t */\n\t@Prop() selectAllText: string = 'Select all';\n\n\t/**\n\t * The icon to prefix for select all\n\t */\n\t@Prop() selectAllIcon: IconVariant | undefined;\n\n\t/**\n\t * Event when the query of the autocomplete changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tqueryChange: EventEmitter<string>;\n\n\t/**\n\t * Event when the value changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tvalueChange: EventEmitter<any>;\n\n\t/**\n\t * Event when the select all item has been selected or not\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tselectAllChange: EventEmitter<any>;\n\n\t/**\n\t * Event when the dropdown shows\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tdropdownShown: EventEmitter<any>;\n\n\t/**\n\t * The size of the input group used by the select\n\t */\n\t@Prop() size: 'small' | 'medium' = 'medium';\n\n\t/**\n\t * The prefix of the input group used by the select\n\t */\n\t@Prop() prefix: string;\n\n\t/**\n\t * The label of the input group used by the select\n\t */\n\t@Prop() label: string;\n\n\t/**\n\t * The helper of the input group used by the select\n\t */\n\t@Prop() helper: string;\n\n\t/**\n\t * Wether the field is required\n\t */\n\t@Prop({ reflect: true }) required: boolean;\n\n\t/**\n\t * The helper of the input group used by the select\n\t */\n\t@Prop({ reflect: true }) error: string;\n\n\t/**\n\t * Wether the input group is disabled used by the select\n\t */\n\t@Prop({ reflect: true }) disabled: boolean = false;\n\n\t/**\n\t * Wether to show a \"add\" item\n\t */\n\t@Prop() showAddItem: boolean = false;\n\n\t/**\n\t * The text to show when add item is being shown\n\t */\n\t@Prop() addItemText: string = 'Add item';\n\n\t/**\n\t * Event when the add item is clicked\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tadd: EventEmitter;\n\n\t/**\n\t * The text to show when items is empty\n\t */\n\t@Prop() emptyStateText: string = 'No items available';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _showDropdown: any = false;\n\t@State() private _selectedItem: any = null;\n\n\t@State() private _allSelected: boolean = false;\n\n\t@State() private _amountHidden = 0;\n\n\tprivate _inputRef: HTMLDivElement;\n\tprivate autocompleteInputRef: HTMLInputElement;\n\tprivate _multiContainerRef: HTMLElement;\n\n\tprivate _resizeObserver: ResizeObserver;\n\tprivate _resizeDebounceTimer: NodeJS.Timer;\n\n\tget _items() {\n\t\tif (!this.items || this.loading) {\n\t\t\treturn [];\n\t\t}\n\n\t\tlet items =\n\t\t\ttypeof this.items === 'string' ? JSON.parse(this.items) : this.items;\n\n\t\tif (typeof items?.[0] === 'string') {\n\t\t\tthis.displayKey = 'text';\n\t\t\tthis.valueKey = 'value';\n\n\t\t\titems = items.map(str => ({\n\t\t\t\tvalue: str,\n\t\t\t\ttext: str,\n\t\t\t}));\n\t\t}\n\n\t\tif (this.query?.length && !this.asyncFilter) {\n\t\t\titems = items.filter(item => {\n\t\t\t\tif (this.queryKey) {\n\t\t\t\t\treturn this._checkvalue(this.queryKey, item);\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tthis._checkvalue(this._identifierKey, item) ||\n\t\t\t\t\tthis._checkvalue(this.displayKey, item)\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\n\t\treturn items?.slice(0, this.maxDisplayedItems);\n\t}\n\n\tget _displayValue() {\n\t\tif (!this._selectedItem) {\n\t\t\treturn this.placeholder;\n\t\t}\n\n\t\tif (this.multi) {\n\t\t\tif (this._selectedItem?.length === 0) {\n\t\t\t\treturn this.placeholder;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tclass={`multi-container size-${this.size}`}\n\t\t\t\t\tref={ref => (this._multiContainerRef = ref)}\n\t\t\t\t>\n\t\t\t\t\t{this._selectedItem.map(item => (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclass='item'\n\t\t\t\t\t\t\tonClick={() => this._selectValue(item)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{item[this.selectionDisplayKey ?? this.displayKey]}\n\t\t\t\t\t\t\t<p-icon variant='negative' />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t))}\n\n\t\t\t\t\t<div class='extra hidden'>+{this._amountHidden}</div>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn this._getDisplay(this._selectedItem, true);\n\t}\n\n\tget _identifierKey() {\n\t\treturn this.identifierKey ?? this.valueKey ?? 'value';\n\t}\n\n\tcomponentDidLoad() {\n\t\tif (!this.valueKey && !this.identifierKey) {\n\t\t\tthrow new Error('You must provide a valueKey or identifierKey');\n\t\t}\n\n\t\tif (this.multi) {\n\t\t\tthis._setMultiContainerMaxWidth();\n\n\t\t\tthis._resizeObserver = new ResizeObserver(() => {\n\t\t\t\tif (this._resizeDebounceTimer) {\n\t\t\t\t\tclearTimeout(this._resizeDebounceTimer);\n\t\t\t\t\tthis._resizeDebounceTimer = null;\n\t\t\t\t}\n\n\t\t\t\tthis._resizeDebounceTimer = setTimeout(() => {\n\t\t\t\t\tthis._setMultiContainerMaxWidth();\n\t\t\t\t\tthis._checkSelectedItems();\n\t\t\t\t}, 200);\n\t\t\t});\n\t\t\tthis._resizeObserver.observe(this._el);\n\t\t}\n\n\t\tif (this.value) {\n\t\t\tthis._valueChange();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.itemChanges();\n\t}\n\n\tcomponentDidRender() {\n\t\tif (this.multi) {\n\t\t\tthis._setMultiContainerMaxWidth();\n\t\t\tthis._checkSelectedItems();\n\t\t}\n\t}\n\n\tdisconnectedCallback() {\n\t\tif (this.multi) {\n\t\t\tthis._resizeObserver.disconnect();\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class='p-select'>\n\t\t\t\t<p-dropdown\n\t\t\t\t\tdisableTriggerClick={true}\n\t\t\t\t\tcalculateWidth={true}\n\t\t\t\t\tinsideClick={true}\n\t\t\t\t\tscrollable={this.enableAutocomplete ? 'large' : true}\n\t\t\t\t\tshow={this._showDropdown}\n\t\t\t\t\tonIsOpen={ev => this._onDropdownOpen(ev)}\n\t\t\t\t>\n\t\t\t\t\t<p-input-group\n\t\t\t\t\t\tslot='trigger'\n\t\t\t\t\t\ticon={this.icon}\n\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\tprefix={this.prefix}\n\t\t\t\t\t\tlabel={this.label}\n\t\t\t\t\t\thelper={this.helper}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\terror={this.error}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tfocused={this._showDropdown}\n\t\t\t\t\t\tforceShowTooltip={this.error?.length && this._showDropdown}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tslot='input'\n\t\t\t\t\t\t\tclass={`p-input read-only cursor-pointer ${\n\t\t\t\t\t\t\t\tthis.showChevron ? 'max-w-[calc(100%-3rem)]' : 'w-full'\n\t\t\t\t\t\t\t} size-${this.size} ${\n\t\t\t\t\t\t\t\tthis._displayValue === this.placeholder\n\t\t\t\t\t\t\t\t\t? 'font-medium text-storm-medium'\n\t\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t\t}`}\n\t\t\t\t\t\t\tcontenteditable\n\t\t\t\t\t\t\tonFocus={ev => this._onFocus(ev)}\n\t\t\t\t\t\t\tonMouseDown={ev => this._onMouseDown(ev)}\n\t\t\t\t\t\t\tonClick={() => this._onClick()}\n\t\t\t\t\t\t\tref={ref => (this._inputRef = ref)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{this._displayValue}\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t{this.showChevron && (\n\t\t\t\t\t\t\t<p-icon\n\t\t\t\t\t\t\t\tvariant='chevron'\n\t\t\t\t\t\t\t\tslot='suffix'\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</p-input-group>\n\t\t\t\t\t<div slot='items'>\n\t\t\t\t\t\t{this.loading ? this._getLoadingItems() : this._getItems()}\n\t\t\t\t\t\t{this.showAddItem && this._getAddItem()}\n\t\t\t\t\t</div>\n\t\t\t\t</p-dropdown>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Listen('click', { target: 'document', capture: true })\n\tprotected documentClickHandler({ target }) {\n\t\tif (!this._showDropdown || childOf(target, this._el)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = false;\n\t}\n\n\t@Watch('value')\n\tprivate _valueChange() {\n\t\tsetTimeout(() => this._preselectItem());\n\t}\n\n\t@Watch('items')\n\tpublic itemChanges() {\n\t\tsetTimeout(() => this._preselectItem());\n\t}\n\n\t@Watch('_showDropdown')\n\tpublic _showDropdownChanges() {\n\t\tthis.dropdownShown.emit({\n\t\t\tvalue: this._showDropdown,\n\t\t\tquery: this.query,\n\t\t});\n\t}\n\n\t@Watch('multi')\n\tpublic multiChanges() {\n\t\tif (this._selectedItem && !Array.isArray(this._selectedItem)) {\n\t\t\tthis._selectedItem = [];\n\t\t}\n\t}\n\n\tprivate _preselectItem() {\n\t\tlet value =\n\t\t\ttypeof this.value === 'string' && this.multi\n\t\t\t\t? JSON.parse(this.value)\n\t\t\t\t: this.value;\n\n\t\tif (this.multi) {\n\t\t\tif (!Array.isArray(value)) {\n\t\t\t\tthis.value = [];\n\t\t\t\tthis.valueChange.emit(this.value);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.value = value;\n\t\t\tif (!value.length) {\n\t\t\t\tthis._selectedItem = [];\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._selectedItem =\n\t\t\t\t!!this.valueKey && this.valueKey !== 'false'\n\t\t\t\t\t? this._items.filter(i => value.includes(i?.[this.valueKey]))\n\t\t\t\t\t: [...value];\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._selectedItem && !value && this.autoSelectFirst) {\n\t\t\tvalue = this._items[0];\n\t\t}\n\n\t\tconst identifier =\n\t\t\ttypeof value === 'object' && value !== null\n\t\t\t\t? value[this._identifierKey]\n\t\t\t\t: value;\n\t\tconst parsedValue =\n\t\t\ttypeof identifier === 'string' || typeof identifier === 'number'\n\t\t\t\t? identifier\n\t\t\t\t: JSON.stringify(identifier);\n\n\t\tconst currentValue = this._selectedItem\n\t\t\t? this._selectedItem?.[this._identifierKey]\n\t\t\t: null;\n\t\tconst currentParsedValue =\n\t\t\ttypeof currentValue === 'string' || typeof currentValue === 'number'\n\t\t\t\t? currentValue\n\t\t\t\t: JSON.stringify(currentValue);\n\n\t\tif (this._selectedItem && currentParsedValue === parsedValue) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._items?.length && value) {\n\t\t\tthis._selectValue(value, false);\n\t\t\treturn;\n\t\t}\n\n\t\tconst item = this._items.find(i => {\n\t\t\tconst itemIdentifier = i?.[this._identifierKey];\n\t\t\tconst parsedItemIdentifier =\n\t\t\t\ttypeof itemIdentifier === 'string' || typeof itemIdentifier === 'number'\n\t\t\t\t\t? itemIdentifier\n\t\t\t\t\t: JSON.stringify(itemIdentifier);\n\n\t\t\treturn parsedItemIdentifier === parsedValue;\n\t\t});\n\n\t\tthis._selectValue(!!item ? item : value, false);\n\t}\n\n\tprivate _selectValue(item, forceBlur = true) {\n\t\tlet value =\n\t\t\t!!this.valueKey && this.valueKey !== 'false' && item !== null\n\t\t\t\t? item?.[this.valueKey]\n\t\t\t\t: item;\n\n\t\tif (this.multi) {\n\t\t\tif (!this._selectedItem || !Array.isArray(this._selectedItem)) {\n\t\t\t\tthis._selectedItem = [];\n\t\t\t}\n\n\t\t\tif (!this.value || !Array.isArray(this.value)) {\n\t\t\t\tthis.value = [];\n\t\t\t}\n\n\t\t\tconst selectedItem = [...this._selectedItem];\n\t\t\tconst valueArray = [...this.value];\n\n\t\t\tconst includesIndex = selectedItem.findIndex(\n\t\t\t\ti => i[this._identifierKey] === item[this._identifierKey]\n\t\t\t);\n\t\t\tif (includesIndex === -1) {\n\t\t\t\tselectedItem.push(item);\n\t\t\t\tvalueArray.push(value);\n\t\t\t} else {\n\t\t\t\tselectedItem.splice(includesIndex, 1);\n\t\t\t\tvalueArray.splice(includesIndex, 1);\n\t\t\t}\n\n\t\t\tthis._selectedItem = selectedItem;\n\t\t\tthis.value = valueArray;\n\t\t\tthis.valueChange.emit(valueArray);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._selectedItem = item;\n\t\tthis.value = value;\n\t\tthis.valueChange.emit(value);\n\n\t\tthis._onBlur(forceBlur);\n\t}\n\n\tprivate _onFocus(ev) {\n\t\tev.preventDefault();\n\t\tthis._inputRef.blur();\n\n\t\tif (!this._showDropdown) {\n\t\t\tthis._showDropdown = true;\n\t\t}\n\n\t\treturn;\n\t}\n\n\tprivate _onMouseDown(ev) {\n\t\tif (this.enableAutocomplete) {\n\t\t\treturn;\n\t\t}\n\n\t\tev.preventDefault();\n\t}\n\n\tprivate _onClick() {\n\t\tif (this.enableAutocomplete) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = !this._showDropdown;\n\t}\n\n\tprivate _onBlur(force = false) {\n\t\tif (this.enableAutocomplete && !force) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = false;\n\t}\n\n\tprivate _onAutoComplete(ev) {\n\t\tif (!this.enableAutocomplete) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = true;\n\n\t\tthis.query = ev.target.value;\n\t\tthis.queryChange.emit(ev.target.value);\n\t}\n\n\tprivate _checkvalue(key, item) {\n\t\treturn (\n\t\t\titem?.[key]\n\t\t\t\t?.toString()\n\t\t\t\t?.toLowerCase()\n\t\t\t\t.indexOf(this.query?.toLowerCase()) >= 0\n\t\t);\n\t}\n\n\tprivate _getItems() {\n\t\tlet items = this._items.map(item => (\n\t\t\t<p-dropdown-menu-item\n\t\t\t\tuseContainer={false}\n\t\t\t\tonClick={() => this._selectValue(item)}\n\t\t\t\tactive={\n\t\t\t\t\tthis.multi &&\n\t\t\t\t\t!!this._selectedItem &&\n\t\t\t\t\tArray.isArray(this._selectedItem)\n\t\t\t\t\t\t? this._selectedItem.findIndex(\n\t\t\t\t\t\t\t\ti => i[this._identifierKey] === item[this._identifierKey]\n\t\t\t\t\t\t ) >= 0\n\t\t\t\t\t\t: item[this._identifierKey] ===\n\t\t\t\t\t\t this._selectedItem?.[this._identifierKey]\n\t\t\t\t}\n\t\t\t\tvariant={this.multi ? 'checkbox' : 'default'}\n\t\t\t\tclass='justify-start'\n\t\t\t>\n\t\t\t\t{this._getDisplay(item)}\n\t\t\t</p-dropdown-menu-item>\n\t\t));\n\n\t\tif (!this._items.length) {\n\t\t\titems = [\n\t\t\t\t<p class='w-full p-2 text-center text-sm text-storm-medium'>\n\t\t\t\t\t{this.emptyStateText}\n\t\t\t\t</p>,\n\t\t\t];\n\t\t}\n\n\t\tif (this.enableSelectAll && this._items.length) {\n\t\t\titems.unshift(\n\t\t\t\t<p-dropdown-menu-item\n\t\t\t\t\tuseContainer={false}\n\t\t\t\t\tvariant='checkbox'\n\t\t\t\t\tonClick={() => this._selectAllChange()}\n\t\t\t\t\tactive={this._allSelected}\n\t\t\t\t>\n\t\t\t\t\t{this.selectAllIcon?.length ? (\n\t\t\t\t\t\t<span class='flex items-center gap-2'>\n\t\t\t\t\t\t\t<div class='flex w-6 justify-center text-lg'>\n\t\t\t\t\t\t\t\t<p-icon variant={this.selectAllIcon} />\n\t\t\t\t\t\t\t</div>{' '}\n\t\t\t\t\t\t\t{this.selectAllText}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tthis.selectAllText\n\t\t\t\t\t)}\n\t\t\t\t</p-dropdown-menu-item>\n\t\t\t);\n\t\t}\n\n\t\tif (this.enableAutocomplete) {\n\t\t\titems.unshift(this._getAutoCompleteItem());\n\t\t}\n\n\t\treturn items;\n\t}\n\n\tprivate _getAddItem() {\n\t\treturn (\n\t\t\t<p-dropdown-menu-item\n\t\t\t\tonClick={() => this.add.emit()}\n\t\t\t\tuseContainer={false}\n\t\t\t>\n\t\t\t\t<span class='flex items-center gap-1 font-semibold text-indigo'>\n\t\t\t\t\t{this.addItemText}\n\t\t\t\t\t<p-icon variant='plus' />\n\t\t\t\t</span>\n\t\t\t</p-dropdown-menu-item>\n\t\t);\n\t}\n\n\tprivate _getLoadingItems() {\n\t\tconst items = [0, 0, 0].map(() => (\n\t\t\t<p-dropdown-menu-item enableHover={false}>\n\t\t\t\t<p-loader\n\t\t\t\t\tvariant='ghost'\n\t\t\t\t\tclass='h-6 w-full rounded'\n\t\t\t\t/>\n\t\t\t</p-dropdown-menu-item>\n\t\t));\n\n\t\tif (this.enableAutocomplete) {\n\t\t\titems.unshift(this._getAutoCompleteItem());\n\t\t}\n\n\t\treturn items;\n\t}\n\n\tprivate _getAutoCompleteItem() {\n\t\treturn (\n\t\t\t<div class='sticky top-0 -mt-2 bg-white pt-2'>\n\t\t\t\t<input\n\t\t\t\t\tclass='p-input size-small sticky top-2 mb-2'\n\t\t\t\t\tplaceholder={this.autocompletePlaceholder}\n\t\t\t\t\tonInput={ev => this._onAutoComplete(ev)}\n\t\t\t\t\tref={ref => (this.autocompleteInputRef = ref)}\n\t\t\t\t\tvalue={this.query}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tprivate _setMultiContainerMaxWidth() {\n\t\tif (!this._inputRef || !this._multiContainerRef) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._multiContainerRef.style.maxWidth = `${\n\t\t\tthis._inputRef.clientWidth - 16\n\t\t}px`;\n\t}\n\n\tprivate _checkSelectedItems() {\n\t\tif (!this._multiContainerRef) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst containerRect = this._multiContainerRef.getBoundingClientRect();\n\t\tconst items = Array.from(\n\t\t\tthis._multiContainerRef.querySelectorAll('.item')\n\t\t) as HTMLElement[];\n\n\t\tlet amountHidden = 0;\n\n\t\tfor (const child of items) {\n\t\t\tchild.classList.remove('hidden');\n\n\t\t\tconst childRect = child.getBoundingClientRect();\n\t\t\tif (childRect.right > containerRect.right) {\n\t\t\t\tchild.classList.add('hidden');\n\t\t\t\tamountHidden++;\n\t\t\t}\n\t\t}\n\n\t\tthis._amountHidden = amountHidden;\n\t\tconst extra = this._multiContainerRef.querySelector('.extra');\n\t\tif (!extra) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!extra.classList.contains('hidden')) {\n\t\t\textra.classList.add('hidden');\n\t\t}\n\n\t\tif (amountHidden > 0) {\n\t\t\textra.classList.remove('hidden');\n\t\t}\n\t}\n\n\tprivate _onDropdownOpen(ev) {\n\t\tif (!ev.detail || !this.autocompleteInputRef) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.autocompleteInputRef.focus();\n\t}\n\n\tprivate _selectAllChange() {\n\t\tthis._allSelected = !this._allSelected;\n\t\tthis.selectAllChange.emit(this._allSelected);\n\t}\n\n\tprivate _getDisplay(item, isSelection = false) {\n\t\tlet content = (\n\t\t\t<div class='text-container'>\n\t\t\t\t{\n\t\t\t\t\titem[\n\t\t\t\t\t\tisSelection\n\t\t\t\t\t\t\t? this.selectionDisplayKey ?? this.displayKey\n\t\t\t\t\t\t\t: this.displayKey\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t</div>\n\t\t);\n\n\t\tif (this.avatarKey) {\n\t\t\tcontent = (\n\t\t\t\t<span class='flex items-center gap-2'>\n\t\t\t\t\t<p-avatar\n\t\t\t\t\t\tsize='xsmall'\n\t\t\t\t\t\tsrc={item[this.avatarKey]}\n\t\t\t\t\t\tletters={item[this.avatarLettersKey]}\n\t\t\t\t\t></p-avatar>\n\t\t\t\t\t<div class='text-container'>\n\t\t\t\t\t\t{item[this.dropdownDisplayKey ?? this.displayKey]}\n\t\t\t\t\t</div>\n\t\t\t\t</span>\n\t\t\t);\n\t\t}\n\n\t\tif (this.iconKey && (!isSelection || this.showIconInSelectedItem)) {\n\t\t\tcontent = (\n\t\t\t\t<span class='flex items-center gap-2'>\n\t\t\t\t\t<p-icon variant={item[this.iconKey] as IconVariant} />\n\t\t\t\t\t<div class='text-container'>\n\t\t\t\t\t\t{item[this.dropdownDisplayKey ?? this.displayKey]}\n\t\t\t\t\t</div>\n\t\t\t\t</span>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclass={\n\t\t\t\t\t!isSelection || this.applyClassOnSelectedItem\n\t\t\t\t\t\t? `max-w-full ${item?.class}`\n\t\t\t\t\t\t: 'max-w-full'\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t{content}\n\t\t\t</div>\n\t\t);\n\t}\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-select.entry.js","mappings":";;;AAAA,MAAM,kBAAkB,GAAG,w+KAAw+K;;MCmBt/K,MAAM;;;;;;;;;;;;;mCA6BwB,WAAW;;sBAUxB,MAAM;;;;;;;oBAmCR,OAAO;;;;;2BAyBC,IAAI;uBAKR,IAAI;6BAKC,EAAE;8BAKA,IAAI;uBAKX,KAAK;mBAKT,KAAK;2BAKG,KAAK;yBAKR,YAAY;;gBA0CT,QAAQ;;;;;;oBA8BE,KAAK;uBAKnB,KAAK;uBAKN,UAAU;0BAaP,oBAAoB;yBAOf,KAAK;yBACL,IAAI;wBAED,KAAK;yBAEb,CAAC;;EASlC,IAAI,MAAM;IACT,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC;GAC9B;EAED,IAAI,aAAa;;IAChB,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;MACxB,OAAO,IAAI,CAAC,WAAW,CAAC;KACxB;IAED,IAAI,IAAI,CAAC,KAAK,EAAE;MACf,IAAI,CAAA,MAAA,IAAI,CAAC,aAAa,0CAAE,MAAM,MAAK,CAAC,EAAE;QACrC,OAAO,IAAI,CAAC,WAAW,CAAC;OACxB;MAED,QACC,WACC,KAAK,EAAE,wBAAwB,IAAI,CAAC,IAAI,EAAE,EAC1C,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC,kBAAkB,GAAG,GAAG,CAAC,IAE1C,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI;;QAAI,QAC/B,WACC,KAAK,EAAC,MAAM,EACZ,OAAO,EAAE,MAAM,IAAI,CAAC,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,CAAC;KACb;IAED,OAAO,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;GAC/C;;;;;;;;;;;;;","names":[],"sources":["src/components/molecules/select/select.component.scss?tag=p-select","src/components/molecules/select/select.component.tsx"],"sourcesContent":["@import '../../../style/form/mixins';\n\np-select {\n\t@apply relative flex w-full flex-col text-ellipsis;\n\n\t.p-input {\n\t\t@include inputDefaultState();\n\t\t@apply text-base font-semibold;\n\n\t\t&.size-small {\n\t\t\t@apply text-sm font-medium;\n\t\t}\n\t}\n\n\t.text-container {\n\t\t@apply block w-full overflow-hidden text-ellipsis whitespace-nowrap text-start;\n\t}\n\n\t.multi-container {\n\t\t@apply pointer-events-none absolute bottom-0 left-0 flex h-10 w-full items-center gap-2 overflow-hidden px-2 py-4;\n\n\t\t&.size-small {\n\t\t\t@apply h-8 px-1 py-2;\n\t\t}\n\n\t\t.item {\n\t\t\t@apply pointer-events-auto flex h-[1.625rem] cursor-pointer items-center gap-2 whitespace-nowrap rounded bg-indigo-light px-2 text-sm font-semibold text-indigo-dark;\n\n\t\t\tp-icon {\n\t\t\t\t@apply text-xs text-indigo;\n\t\t\t}\n\t\t}\n\n\t\t.extra {\n\t\t\t@apply pointer-events-none text-sm text-storm-medium;\n\t\t}\n\t}\n}\n","import {\n\tComponent,\n\tElement,\n\tEvent,\n\tEventEmitter,\n\th,\n\tHost,\n\tListen,\n\tProp,\n\tState,\n\tWatch,\n} from '@stencil/core';\nimport { childOf } from '../../../utils';\nimport { IconVariant } from '../../atoms/icon/icon.component';\n\n@Component({\n\ttag: 'p-select',\n\tstyleUrl: 'select.component.scss',\n})\nexport class Select {\n\t/**\n\t * The items to show in the dropdown\n\t */\n\t@Prop() items: string | any[];\n\n\t/**\n\t * Wether to enable multi select\n\t */\n\t@Prop({ reflect: true }) multi: boolean;\n\n\t/**\n\t * Icon of the select box\n\t */\n\t@Prop() icon: IconVariant;\n\n\t/**\n\t * The current query\n\t */\n\t@Prop() query: string;\n\n\t/**\n\t * The placeholder of the input\n\t */\n\t@Prop() placeholder: string;\n\n\t/**\n\t * The placeholder of the input used for auto complete\n\t */\n\t@Prop() autocompletePlaceholder: string = 'Search...';\n\n\t/**\n\t * The current value\n\t */\n\t@Prop() value: any;\n\n\t/**\n\t * The key of the object to display\n\t */\n\t@Prop() displayKey: string = 'text';\n\n\t/**\n\t * The key of the object to display in the dropdown (overwrites displayKey)\n\t */\n\t@Prop() dropdownDisplayKey: string | undefined;\n\n\t/**\n\t * The key of the object to display in the input (overwrites displayKey)\n\t */\n\t@Prop() selectionDisplayKey: string | undefined;\n\n\t/**\n\t * The key of the object to return\n\t */\n\t@Prop() valueKey: string;\n\n\t/**\n\t * The key of avatar within an item to show\n\t */\n\t@Prop() avatarKey: string;\n\n\t/**\n\t * The key of icon variant within an item to show\n\t */\n\t@Prop() iconKey: string;\n\n\t/**\n\t * Wether to show the icon also on the selected Item\n\t */\n\t@Prop() showIconInSelectedItem: string;\n\n\t/**\n\t * The key of a class in an item to apply\n\t */\n\t@Prop() classKey: string = 'class';\n\n\t/**\n\t * Wether to apply the item's class also on the selected item\n\t */\n\t@Prop() applyClassOnSelectedItem: string;\n\n\t/**\n\t * The key of avatar letters within an item to show when the avatar url doesn't work\n\t */\n\t@Prop() avatarLettersKey: string;\n\n\t/**\n\t * The key to identify an object\n\t */\n\t@Prop() identifierKey: string;\n\n\t/**\n\t * The key of the object to display\n\t */\n\t@Prop() queryKey?: string;\n\n\t/**\n\t * Wether to automatically select the first item\n\t */\n\t@Prop() autoSelectFirst: boolean = true;\n\n\t/**\n\t * Wether to show the chevron or not\n\t */\n\t@Prop() showChevron: boolean = true;\n\n\t/**\n\t * The maximum amount of items to display\n\t */\n\t@Prop() maxDisplayedItems: number = 10;\n\n\t/**\n\t * Wether to enable autocomplete\n\t */\n\t@Prop() enableAutocomplete: boolean = true;\n\n\t/**\n\t * Wether the input uses async filtering\n\t */\n\t@Prop() asyncFilter: boolean = false;\n\n\t/**\n\t * Wether to show loading items\n\t */\n\t@Prop() loading: boolean = false;\n\n\t/**\n\t * Wether to show the select all item with multi select\n\t */\n\t@Prop() enableSelectAll: boolean = false;\n\n\t/**\n\t * The text of the select all item\n\t */\n\t@Prop() selectAllText: string = 'Select all';\n\n\t/**\n\t * The icon to prefix for select all\n\t */\n\t@Prop() selectAllIcon: IconVariant | undefined;\n\n\t/**\n\t * Event when the query of the autocomplete changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tqueryChange: EventEmitter<string>;\n\n\t/**\n\t * Event when the value changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tvalueChange: EventEmitter<any>;\n\n\t/**\n\t * Event when the select all item has been selected or not\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tselectAllChange: EventEmitter<any>;\n\n\t/**\n\t * Event when the dropdown shows\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tdropdownShown: EventEmitter<any>;\n\n\t/**\n\t * The size of the input group used by the select\n\t */\n\t@Prop() size: 'small' | 'medium' = 'medium';\n\n\t/**\n\t * The prefix of the input group used by the select\n\t */\n\t@Prop() prefix: string;\n\n\t/**\n\t * The label of the input group used by the select\n\t */\n\t@Prop() label: string;\n\n\t/**\n\t * The helper of the input group used by the select\n\t */\n\t@Prop() helper: string;\n\n\t/**\n\t * Wether the field is required\n\t */\n\t@Prop({ reflect: true }) required: boolean;\n\n\t/**\n\t * The helper of the input group used by the select\n\t */\n\t@Prop({ reflect: true }) error: string;\n\n\t/**\n\t * Wether the input group is disabled used by the select\n\t */\n\t@Prop({ reflect: true }) disabled: boolean = false;\n\n\t/**\n\t * Wether to show a \"add\" item\n\t */\n\t@Prop() showAddItem: boolean = false;\n\n\t/**\n\t * The text to show when add item is being shown\n\t */\n\t@Prop() addItemText: string = 'Add item';\n\n\t/**\n\t * Event when the add item is clicked\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tadd: EventEmitter;\n\n\t/**\n\t * The text to show when items is empty\n\t */\n\t@Prop() emptyStateText: string = 'No items available';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _showDropdown: any = false;\n\t@State() private _selectedItem: any = null;\n\n\t@State() private _allSelected: boolean = false;\n\n\t@State() private _amountHidden = 0;\n\n\tprivate _inputRef: HTMLDivElement;\n\tprivate autocompleteInputRef: HTMLInputElement;\n\tprivate _multiContainerRef: HTMLElement;\n\n\tprivate _resizeObserver: ResizeObserver;\n\tprivate _resizeDebounceTimer: NodeJS.Timer;\n\n\tget _items() {\n\t\treturn this._getParsedItems();\n\t}\n\n\tget _displayValue() {\n\t\tif (!this._selectedItem) {\n\t\t\treturn this.placeholder;\n\t\t}\n\n\t\tif (this.multi) {\n\t\t\tif (this._selectedItem?.length === 0) {\n\t\t\t\treturn this.placeholder;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tclass={`multi-container size-${this.size}`}\n\t\t\t\t\tref={ref => (this._multiContainerRef = ref)}\n\t\t\t\t>\n\t\t\t\t\t{this._selectedItem.map(item => (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclass='item'\n\t\t\t\t\t\t\tonClick={() => this._selectValue(item)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{item[this.selectionDisplayKey ?? this.displayKey]}\n\t\t\t\t\t\t\t<p-icon variant='negative' />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t))}\n\n\t\t\t\t\t<div class='extra hidden'>+{this._amountHidden}</div>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn this._getDisplay(this._selectedItem, true);\n\t}\n\n\tget _identifierKey() {\n\t\treturn this.identifierKey ?? this.valueKey ?? 'value';\n\t}\n\n\tcomponentDidLoad() {\n\t\tif (!this.valueKey && !this.identifierKey) {\n\t\t\tthrow new Error('You must provide a valueKey or identifierKey');\n\t\t}\n\n\t\tif (this.multi) {\n\t\t\tthis._setMultiContainerMaxWidth();\n\n\t\t\tthis._resizeObserver = new ResizeObserver(() => {\n\t\t\t\tif (this._resizeDebounceTimer) {\n\t\t\t\t\tclearTimeout(this._resizeDebounceTimer);\n\t\t\t\t\tthis._resizeDebounceTimer = null;\n\t\t\t\t}\n\n\t\t\t\tthis._resizeDebounceTimer = setTimeout(() => {\n\t\t\t\t\tthis._setMultiContainerMaxWidth();\n\t\t\t\t\tthis._checkSelectedItems();\n\t\t\t\t}, 200);\n\t\t\t});\n\t\t\tthis._resizeObserver.observe(this._el);\n\t\t}\n\n\t\tif (this.value) {\n\t\t\tthis._valueChange();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.itemChanges();\n\t}\n\n\tcomponentDidRender() {\n\t\tif (this.multi) {\n\t\t\tthis._setMultiContainerMaxWidth();\n\t\t\tthis._checkSelectedItems();\n\t\t}\n\t}\n\n\tdisconnectedCallback() {\n\t\tif (this.multi) {\n\t\t\tthis._resizeObserver.disconnect();\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class='p-select'>\n\t\t\t\t<p-dropdown\n\t\t\t\t\tdisableTriggerClick={true}\n\t\t\t\t\tcalculateWidth={true}\n\t\t\t\t\tinsideClick={true}\n\t\t\t\t\tscrollable={this.enableAutocomplete ? 'large' : true}\n\t\t\t\t\tshow={this._showDropdown}\n\t\t\t\t\tonIsOpen={ev => this._onDropdownOpen(ev)}\n\t\t\t\t>\n\t\t\t\t\t<p-input-group\n\t\t\t\t\t\tslot='trigger'\n\t\t\t\t\t\ticon={this.icon}\n\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\tprefix={this.prefix}\n\t\t\t\t\t\tlabel={this.label}\n\t\t\t\t\t\thelper={this.helper}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\terror={this.error}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tfocused={this._showDropdown}\n\t\t\t\t\t\tforceShowTooltip={this.error?.length && this._showDropdown}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tslot='input'\n\t\t\t\t\t\t\tclass={`p-input read-only cursor-pointer ${\n\t\t\t\t\t\t\t\tthis.showChevron ? 'max-w-[calc(100%-3rem)]' : 'w-full'\n\t\t\t\t\t\t\t} size-${this.size} ${\n\t\t\t\t\t\t\t\tthis._displayValue === this.placeholder\n\t\t\t\t\t\t\t\t\t? 'font-medium text-storm-medium'\n\t\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t\t}`}\n\t\t\t\t\t\t\tcontenteditable\n\t\t\t\t\t\t\tonFocus={ev => this._onFocus(ev)}\n\t\t\t\t\t\t\tonMouseDown={ev => this._onMouseDown(ev)}\n\t\t\t\t\t\t\tonClick={() => this._onClick()}\n\t\t\t\t\t\t\tref={ref => (this._inputRef = ref)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{this._displayValue}\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t{this.showChevron && (\n\t\t\t\t\t\t\t<p-icon\n\t\t\t\t\t\t\t\tvariant='chevron'\n\t\t\t\t\t\t\t\tslot='suffix'\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</p-input-group>\n\t\t\t\t\t<div slot='items'>\n\t\t\t\t\t\t{this.loading ? this._getLoadingItems() : this._getItems()}\n\t\t\t\t\t\t{this.showAddItem && this._getAddItem()}\n\t\t\t\t\t</div>\n\t\t\t\t</p-dropdown>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Listen('click', { target: 'document', capture: true })\n\tprotected documentClickHandler({ target }) {\n\t\tif (!this._showDropdown || childOf(target, this._el)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = false;\n\t}\n\n\t@Watch('value')\n\tprivate _valueChange() {\n\t\tsetTimeout(() => this._preselectItem());\n\t}\n\n\t@Watch('items')\n\tpublic itemChanges() {\n\t\tsetTimeout(() => this._preselectItem());\n\t}\n\n\t@Watch('_showDropdown')\n\tpublic _showDropdownChanges() {\n\t\tthis.dropdownShown.emit({\n\t\t\tvalue: this._showDropdown,\n\t\t\tquery: this.query,\n\t\t});\n\t}\n\n\t@Watch('multi')\n\tpublic multiChanges() {\n\t\tif (this._selectedItem && !Array.isArray(this._selectedItem)) {\n\t\t\tthis._selectedItem = [];\n\t\t}\n\t}\n\n\tprivate _preselectItem() {\n\t\tlet value =\n\t\t\ttypeof this.value === 'string' && this.multi\n\t\t\t\t? JSON.parse(this.value)\n\t\t\t\t: this.value;\n\n\t\tif (this.multi) {\n\t\t\tif (!Array.isArray(value)) {\n\t\t\t\tthis.value = [];\n\t\t\t\tthis.valueChange.emit(this.value);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.value = value;\n\t\t\tif (!value.length) {\n\t\t\t\tthis._selectedItem = [];\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._selectedItem =\n\t\t\t\t!!this.valueKey && this.valueKey !== 'false'\n\t\t\t\t\t? this._items.filter(i => value.includes(i?.[this.valueKey]))\n\t\t\t\t\t: [...value];\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._selectedItem && !value && this.autoSelectFirst) {\n\t\t\tvalue = this._items[0];\n\t\t}\n\n\t\tconst identifier =\n\t\t\ttypeof value === 'object' && value !== null\n\t\t\t\t? value[this._identifierKey]\n\t\t\t\t: value;\n\t\tconst parsedValue =\n\t\t\ttypeof identifier === 'string' || typeof identifier === 'number'\n\t\t\t\t? identifier\n\t\t\t\t: JSON.stringify(identifier);\n\n\t\tconst currentValue = this._selectedItem\n\t\t\t? this._selectedItem?.[this._identifierKey]\n\t\t\t: null;\n\t\tconst currentParsedValue =\n\t\t\ttypeof currentValue === 'string' || typeof currentValue === 'number'\n\t\t\t\t? currentValue\n\t\t\t\t: JSON.stringify(currentValue);\n\n\t\tif (this._selectedItem && currentParsedValue === parsedValue) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._items?.length && value) {\n\t\t\tthis._selectValue(value, false);\n\t\t\treturn;\n\t\t}\n\n\t\tconst items = this._getParsedItems(false);\n\t\tconst item = items.find(i => {\n\t\t\tconst itemIdentifier = i?.[this._identifierKey];\n\t\t\tconst parsedItemIdentifier =\n\t\t\t\ttypeof itemIdentifier === 'string' || typeof itemIdentifier === 'number'\n\t\t\t\t\t? itemIdentifier\n\t\t\t\t\t: JSON.stringify(itemIdentifier);\n\n\t\t\treturn parsedItemIdentifier === parsedValue;\n\t\t});\n\n\t\tthis._selectValue(!!item ? item : value, false);\n\t}\n\n\tprivate _selectValue(item, forceBlur = true) {\n\t\tlet value =\n\t\t\t!!this.valueKey && this.valueKey !== 'false' && item !== null\n\t\t\t\t? item?.[this.valueKey]\n\t\t\t\t: item;\n\n\t\tif (this.multi) {\n\t\t\tif (!this._selectedItem || !Array.isArray(this._selectedItem)) {\n\t\t\t\tthis._selectedItem = [];\n\t\t\t}\n\n\t\t\tif (!this.value || !Array.isArray(this.value)) {\n\t\t\t\tthis.value = [];\n\t\t\t}\n\n\t\t\tconst selectedItem = [...this._selectedItem];\n\t\t\tconst valueArray = [...this.value];\n\n\t\t\tconst includesIndex = selectedItem.findIndex(\n\t\t\t\ti => i[this._identifierKey] === item[this._identifierKey]\n\t\t\t);\n\t\t\tif (includesIndex === -1) {\n\t\t\t\tselectedItem.push(item);\n\t\t\t\tvalueArray.push(value);\n\t\t\t} else {\n\t\t\t\tselectedItem.splice(includesIndex, 1);\n\t\t\t\tvalueArray.splice(includesIndex, 1);\n\t\t\t}\n\n\t\t\tthis._selectedItem = selectedItem;\n\t\t\tthis.value = valueArray;\n\t\t\tthis.valueChange.emit(valueArray);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._selectedItem = item;\n\t\tthis.value = value;\n\t\tthis.valueChange.emit(value);\n\n\t\tthis._onBlur(forceBlur);\n\t}\n\n\tprivate _onFocus(ev) {\n\t\tev.preventDefault();\n\t\tthis._inputRef.blur();\n\n\t\tif (!this._showDropdown) {\n\t\t\tthis._showDropdown = true;\n\t\t}\n\n\t\treturn;\n\t}\n\n\tprivate _onMouseDown(ev) {\n\t\tif (this.enableAutocomplete) {\n\t\t\treturn;\n\t\t}\n\n\t\tev.preventDefault();\n\t}\n\n\tprivate _onClick() {\n\t\tif (this.enableAutocomplete) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = !this._showDropdown;\n\t}\n\n\tprivate _onBlur(force = false) {\n\t\tif (this.enableAutocomplete && !force) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = false;\n\t}\n\n\tprivate _onAutoComplete(ev) {\n\t\tif (!this.enableAutocomplete) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = true;\n\n\t\tthis.query = ev.target.value;\n\t\tthis.queryChange.emit(ev.target.value);\n\t}\n\n\tprivate _checkvalue(key, item) {\n\t\treturn (\n\t\t\titem?.[key]\n\t\t\t\t?.toString()\n\t\t\t\t?.toLowerCase()\n\t\t\t\t.indexOf(this.query?.toLowerCase()) >= 0\n\t\t);\n\t}\n\n\tprivate _getItems() {\n\t\tlet items = this._items.map(item => (\n\t\t\t<p-dropdown-menu-item\n\t\t\t\tuseContainer={false}\n\t\t\t\tonClick={() => this._selectValue(item)}\n\t\t\t\tactive={\n\t\t\t\t\tthis.multi &&\n\t\t\t\t\t!!this._selectedItem &&\n\t\t\t\t\tArray.isArray(this._selectedItem)\n\t\t\t\t\t\t? this._selectedItem.findIndex(\n\t\t\t\t\t\t\t\ti => i[this._identifierKey] === item[this._identifierKey]\n\t\t\t\t\t\t ) >= 0\n\t\t\t\t\t\t: item[this._identifierKey] ===\n\t\t\t\t\t\t this._selectedItem?.[this._identifierKey]\n\t\t\t\t}\n\t\t\t\tvariant={this.multi ? 'checkbox' : 'default'}\n\t\t\t\tclass='justify-start'\n\t\t\t>\n\t\t\t\t{this._getDisplay(item)}\n\t\t\t</p-dropdown-menu-item>\n\t\t));\n\n\t\tif (!this._items.length) {\n\t\t\titems = [\n\t\t\t\t<p class='w-full p-2 text-center text-sm text-storm-medium'>\n\t\t\t\t\t{this.emptyStateText}\n\t\t\t\t</p>,\n\t\t\t];\n\t\t}\n\n\t\tif (this.enableSelectAll && this._items.length) {\n\t\t\titems.unshift(\n\t\t\t\t<p-dropdown-menu-item\n\t\t\t\t\tuseContainer={false}\n\t\t\t\t\tvariant='checkbox'\n\t\t\t\t\tonClick={() => this._selectAllChange()}\n\t\t\t\t\tactive={this._allSelected}\n\t\t\t\t>\n\t\t\t\t\t{this.selectAllIcon?.length ? (\n\t\t\t\t\t\t<span class='flex items-center gap-2'>\n\t\t\t\t\t\t\t<div class='flex w-6 justify-center text-lg'>\n\t\t\t\t\t\t\t\t<p-icon variant={this.selectAllIcon} />\n\t\t\t\t\t\t\t</div>{' '}\n\t\t\t\t\t\t\t{this.selectAllText}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tthis.selectAllText\n\t\t\t\t\t)}\n\t\t\t\t</p-dropdown-menu-item>\n\t\t\t);\n\t\t}\n\n\t\tif (this.enableAutocomplete) {\n\t\t\titems.unshift(this._getAutoCompleteItem());\n\t\t}\n\n\t\treturn items;\n\t}\n\n\tprivate _getAddItem() {\n\t\treturn (\n\t\t\t<p-dropdown-menu-item\n\t\t\t\tonClick={() => this.add.emit()}\n\t\t\t\tuseContainer={false}\n\t\t\t>\n\t\t\t\t<span class='flex items-center gap-1 font-semibold text-indigo'>\n\t\t\t\t\t{this.addItemText}\n\t\t\t\t\t<p-icon variant='plus' />\n\t\t\t\t</span>\n\t\t\t</p-dropdown-menu-item>\n\t\t);\n\t}\n\n\tprivate _getLoadingItems() {\n\t\tconst items = [0, 0, 0].map(() => (\n\t\t\t<p-dropdown-menu-item enableHover={false}>\n\t\t\t\t<p-loader\n\t\t\t\t\tvariant='ghost'\n\t\t\t\t\tclass='h-6 w-full rounded'\n\t\t\t\t/>\n\t\t\t</p-dropdown-menu-item>\n\t\t));\n\n\t\tif (this.enableAutocomplete) {\n\t\t\titems.unshift(this._getAutoCompleteItem());\n\t\t}\n\n\t\treturn items;\n\t}\n\n\tprivate _getAutoCompleteItem() {\n\t\treturn (\n\t\t\t<div class='sticky top-0 -mt-2 bg-white pt-2'>\n\t\t\t\t<input\n\t\t\t\t\tclass='p-input size-small sticky top-2 mb-2'\n\t\t\t\t\tplaceholder={this.autocompletePlaceholder}\n\t\t\t\t\tonInput={ev => this._onAutoComplete(ev)}\n\t\t\t\t\tref={ref => (this.autocompleteInputRef = ref)}\n\t\t\t\t\tvalue={this.query}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tprivate _setMultiContainerMaxWidth() {\n\t\tif (!this._inputRef || !this._multiContainerRef) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._multiContainerRef.style.maxWidth = `${\n\t\t\tthis._inputRef.clientWidth - 16\n\t\t}px`;\n\t}\n\n\tprivate _checkSelectedItems() {\n\t\tif (!this._multiContainerRef) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst containerRect = this._multiContainerRef.getBoundingClientRect();\n\t\tconst items = Array.from(\n\t\t\tthis._multiContainerRef.querySelectorAll('.item')\n\t\t) as HTMLElement[];\n\n\t\tlet amountHidden = 0;\n\n\t\tfor (const child of items) {\n\t\t\tchild.classList.remove('hidden');\n\n\t\t\tconst childRect = child.getBoundingClientRect();\n\t\t\tif (childRect.right > containerRect.right) {\n\t\t\t\tchild.classList.add('hidden');\n\t\t\t\tamountHidden++;\n\t\t\t}\n\t\t}\n\n\t\tthis._amountHidden = amountHidden;\n\t\tconst extra = this._multiContainerRef.querySelector('.extra');\n\t\tif (!extra) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!extra.classList.contains('hidden')) {\n\t\t\textra.classList.add('hidden');\n\t\t}\n\n\t\tif (amountHidden > 0) {\n\t\t\textra.classList.remove('hidden');\n\t\t}\n\t}\n\n\tprivate _onDropdownOpen(ev) {\n\t\tif (!ev.detail || !this.autocompleteInputRef) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.autocompleteInputRef.focus();\n\t}\n\n\tprivate _selectAllChange() {\n\t\tthis._allSelected = !this._allSelected;\n\t\tthis.selectAllChange.emit(this._allSelected);\n\t}\n\n\tprivate _getDisplay(item, isSelection = false) {\n\t\tlet content = (\n\t\t\t<div class='text-container'>\n\t\t\t\t{\n\t\t\t\t\titem[\n\t\t\t\t\t\tisSelection\n\t\t\t\t\t\t\t? this.selectionDisplayKey ?? this.displayKey\n\t\t\t\t\t\t\t: this.displayKey\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t</div>\n\t\t);\n\n\t\tif (this.avatarKey) {\n\t\t\tcontent = (\n\t\t\t\t<span class='flex items-center gap-2'>\n\t\t\t\t\t<p-avatar\n\t\t\t\t\t\tsize='xsmall'\n\t\t\t\t\t\tsrc={item[this.avatarKey]}\n\t\t\t\t\t\tletters={item[this.avatarLettersKey]}\n\t\t\t\t\t></p-avatar>\n\t\t\t\t\t<div class='text-container'>\n\t\t\t\t\t\t{item[this.dropdownDisplayKey ?? this.displayKey]}\n\t\t\t\t\t</div>\n\t\t\t\t</span>\n\t\t\t);\n\t\t}\n\n\t\tif (this.iconKey && (!isSelection || this.showIconInSelectedItem)) {\n\t\t\tcontent = (\n\t\t\t\t<span class='flex items-center gap-2'>\n\t\t\t\t\t<p-icon variant={item[this.iconKey] as IconVariant} />\n\t\t\t\t\t<div class='text-container'>\n\t\t\t\t\t\t{item[this.dropdownDisplayKey ?? this.displayKey]}\n\t\t\t\t\t</div>\n\t\t\t\t</span>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclass={\n\t\t\t\t\t!isSelection || this.applyClassOnSelectedItem\n\t\t\t\t\t\t? `max-w-full ${item?.class}`\n\t\t\t\t\t\t: 'max-w-full'\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t{content}\n\t\t\t</div>\n\t\t);\n\t}\n\n\tprivate _getParsedItems(applyPagination = false) {\n\t\tif (!this.items || this.loading) {\n\t\t\treturn [];\n\t\t}\n\n\t\tlet items =\n\t\t\ttypeof this.items === 'string' ? JSON.parse(this.items) : this.items;\n\n\t\tif (typeof items?.[0] === 'string') {\n\t\t\tthis.displayKey = 'text';\n\t\t\tthis.valueKey = 'value';\n\n\t\t\titems = items.map(str => ({\n\t\t\t\tvalue: str,\n\t\t\t\ttext: str,\n\t\t\t}));\n\t\t}\n\n\t\tif (this.query?.length && !this.asyncFilter) {\n\t\t\titems = items.filter(item => {\n\t\t\t\tif (this.queryKey) {\n\t\t\t\t\treturn this._checkvalue(this.queryKey, item);\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tthis._checkvalue(this._identifierKey, item) ||\n\t\t\t\t\tthis._checkvalue(this.displayKey, item)\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\n\t\tif (!applyPagination) {\n\t\t\treturn items;\n\t\t}\n\n\t\treturn items?.slice(0, this.maxDisplayedItems);\n\t}\n}\n"],"version":3}
|
package/dist/index.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!doctype html><html dir="ltr" lang="en"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0"> <title>Stencil Component Starter</title> <script type="module" src="/build/paperless.esm.js" data-stencil data-resources-url="/build/" data-stencil-namespace="paperless"></script> <script nomodule="" src="/build/paperless.js" data-stencil></script> </head> <body> <p-button>Buttono</p-button> <script data-build="2025-
|
|
1
|
+
<!doctype html><html dir="ltr" lang="en"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0"> <title>Stencil Component Starter</title> <script type="module" src="/build/paperless.esm.js" data-stencil data-resources-url="/build/" data-stencil-namespace="paperless"></script> <script nomodule="" src="/build/paperless.js" data-stencil></script> </head> <body> <p-button>Buttono</p-button> <script data-build="2025-04-03T11:39:18">
|
|
2
2
|
if ('serviceWorker' in navigator && location.protocol !== 'file:') {
|
|
3
3
|
window.addEventListener('load', function() {
|
|
4
4
|
navigator.serviceWorker.register('/sw.js')
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,h as e,H as o,g as r}from"./p-0c2cc6c4.js";const i=".flex{display:flex!important}.table{display:table!important}.h-\\[3\\.125rem\\]{height:3.125rem!important}.h-\\[4\\.125rem\\]{height:4.125rem!important}.h-\\[6\\.5rem\\]{height:6.5rem!important}.w-full{width:100%!important}.flex-col{flex-direction:column!important}.items-center{align-items:center!important}.justify-center{justify-content:center!important}.overflow-hidden{overflow:hidden!important}.text-ellipsis{text-overflow:ellipsis!important}.rounded{border-radius:.25rem!important}.border{border-width:1px!important}.border-solid{border-style:solid!important}.border-mystic-dark{--tw-border-opacity:1!important;border-color:rgb(218 230 240/var(--tw-border-opacity))!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}*{box-sizing:border-box}:host{display:flex}:host .profile-content{align-items:center;display:flex;gap:.75rem;width:100%}:host .profile-content .name{display:flex;flex-direction:column;justify-content:center;overflow:hidden}:host .profile-content .name>:first-child{--tw-text-opacity:1;color:rgb(39 40 56/var(--tw-text-opacity));font-size:.875rem;font-weight:600;line-height:1.25rem}:host .profile-content .name>:nth-child(2){--tw-text-opacity:1;color:rgb(152 154 183/var(--tw-text-opacity));font-size:.875rem;line-height:1.25rem}:host .profile-content .name ::slotted(*){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([size=xsmall]){height:1.5rem}:host([size=small]){height:2rem}:host([size=table]){height:2.5rem}:host([size=medium]){height:3.125rem}:host([size=large]){height:4rem}:host([size=xlarge]){height:6.5rem}:host(.has-dropdown){cursor:pointer}:host(.has-dropdown) .profile-content{--tw-border-opacity:1!important;border-color:rgb(218 230 240/var(--tw-border-opacity))!important;border-radius:.25rem;border-style:solid!important;border-width:1px!important;padding:.5rem}:host(.has-dropdown[size=small]){height:3rem}:host(.has-dropdown[size=medium]){height:4.125rem}:host(.has-dropdown[size=large]){height:5rem}:host(.active) .profile-content,:host(.has-dropdown:hover) .profile-content{--tw-shadow:0px 0.3125rem 1rem rgba(0,24,98,.08),0px 0.0625rem 0.1875rem rgba(0,24,98,.13);--tw-shadow-colored:0px 0.3125rem 1rem var(--tw-shadow-color),0px 0.0625rem 0.1875rem var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}:host(.active) .profile-content p-icon{--tw-text-opacity:1;color:rgb(82 138 250/var(--tw-text-opacity))}.static{position:static!important}.absolute{position:absolute!important}.ml-auto{margin-left:auto!important}.min-w-0{min-width:0!important}";const s=class{constructor(e){t(this,e);this.variant="user";this.size="small";this._dropdownOpen=false}componentWillRender(){this._updateAvatar()}render(){const t=!!this._el.querySelector(':scope > [slot="dropdown"]');const r=this._getContent(t);const i=e("slot",{name:"dropdown"});return e(o,{class:`p-profile ${t&&"has-dropdown"} ${this._dropdownOpen&&"active"}`},t?e("p-dropdown",{class:"w-full min-w-0",strategy:"absolute",placement:this.variant==="user"?"top-end":"bottom-end",applyFullWidth:true,applyMaxWidth:false,onIsOpen:t=>this._dropdownOpen=t.detail},r,e("div",{slot:"items"},i)):r)}_getContent(t){return e("div",{class:"profile-content",slot:"trigger"},e("slot",{name:"avatar"}),e("div",{class:"name"},e("slot",{name:"title"}),e("slot",{name:"subtitle"})),t&&this._getIcon())}_updateAvatar(){var t,e;const o=this._el.querySelector('p-avatar[slot="avatar"]');if(!o){return}o.variant=(t=this.variant)!==null&&t!==void 0?t:o.variant;o.size=(e=this.size)!==null&&e!==void 0?e:o===null||o===void 0?void 0:o.size}_getIcon(){return e("p-icon",{class:"ml-auto",variant:this.variant==="company"?"chevron":"more"})}get _el(){return r(this)}};s.style=i;export{s as p_profile};
|
|
2
|
+
//# sourceMappingURL=p-3e3a79b1.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["profileComponentCss","Profile","componentWillRender","this","_updateAvatar","render","hasDropdownSlot","_el","querySelector","content","_getContent","dropdownItems","h","name","Host","class","_dropdownOpen","strategy","placement","variant","applyFullWidth","applyMaxWidth","onIsOpen","ev","detail","slot","_getIcon","avatar","_a","size","_b"],"sources":["src/components/molecules/profile/profile.component.scss?tag=p-profile&encapsulation=shadow","src/components/molecules/profile/profile.component.tsx"],"sourcesContent":[":host {\n\t@apply flex;\n\n\t.profile-content {\n\t\t@apply flex w-full items-center gap-3;\n\n\t\t.name {\n\t\t\t@apply flex flex-col justify-center overflow-hidden;\n\n\t\t\t> *:nth-child(1) {\n\t\t\t\t@apply text-sm text-storm-dark;\n\t\t\t\t@apply font-semibold;\n\t\t\t}\n\n\t\t\t> *:nth-child(2) {\n\t\t\t\t@apply text-sm text-storm-vague;\n\t\t\t}\n\n\t\t\t::slotted(*) {\n\t\t\t\t@apply overflow-hidden text-ellipsis whitespace-nowrap;\n\t\t\t}\n\t\t}\n\t}\n}\n\n:host([size='xsmall']) {\n\t@apply h-6;\n}\n\n:host([size='small']) {\n\t@apply h-8;\n}\n\n:host([size='table']) {\n\t@apply h-10;\n}\n\n:host([size='medium']) {\n\t@apply h-[3.125rem];\n}\n\n:host([size='large']) {\n\t@apply h-16;\n}\n\n:host([size='xlarge']) {\n\t@apply h-[6.5rem];\n}\n\n:host(.has-dropdown) {\n\t@apply cursor-pointer;\n\n\t.profile-content {\n\t\t@apply rounded p-2;\n\t\t@apply border border-solid border-mystic-dark #{!important};\n\t}\n}\n\n:host(.has-dropdown[size='small']) {\n\t@apply h-12;\n}\n\n:host(.has-dropdown[size='medium']) {\n\t@apply h-[4.125rem];\n}\n\n:host(.has-dropdown[size='large']) {\n\t@apply h-20;\n}\n\n:host(.has-dropdown:hover),\n:host(.active) {\n\t.profile-content {\n\t\t@apply shadow-4;\n\t}\n}\n\n:host(.active) {\n\t.profile-content {\n\t\tp-icon {\n\t\t\t@apply text-indigo;\n\t\t}\n\t}\n}\n","import { Component, Element, h, Host, Prop, State } from '@stencil/core';\n\n@Component({\n\ttag: 'p-profile',\n\tstyleUrl: 'profile.component.scss',\n\tshadow: true,\n})\nexport class Profile {\n\t/**\n\t * The variant of the profile\n\t */\n\t@Prop() variant: 'company' | 'user' = 'user';\n\n\t/**\n\t * The size of the profile avatar\n\t */\n\t@Prop({ reflect: true }) size:\n\t\t| 'xsmall'\n\t\t| 'small'\n\t\t| 'table'\n\t\t| 'medium'\n\t\t| 'large'\n\t\t| 'xlarge' = 'small';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _dropdownOpen = false;\n\n\tcomponentWillRender() {\n\t\tthis._updateAvatar();\n\t}\n\n\trender() {\n\t\tconst hasDropdownSlot = !!this._el.querySelector(\n\t\t\t':scope > [slot=\"dropdown\"]'\n\t\t);\n\t\tconst content = this._getContent(hasDropdownSlot);\n\t\tconst dropdownItems = <slot name='dropdown' />;\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={`p-profile ${hasDropdownSlot && 'has-dropdown'} ${\n\t\t\t\t\tthis._dropdownOpen && 'active'\n\t\t\t\t}`}\n\t\t\t>\n\t\t\t\t{hasDropdownSlot ? (\n\t\t\t\t\t<p-dropdown\n\t\t\t\t\t\tclass='w-full min-w-0'\n\t\t\t\t\t\tstrategy='absolute'\n\t\t\t\t\t\tplacement={this.variant === 'user' ? 'top-end' : 'bottom-end'}\n\t\t\t\t\t\tapplyFullWidth={true}\n\t\t\t\t\t\tapplyMaxWidth={false}\n\t\t\t\t\t\tonIsOpen={ev => (this._dropdownOpen = ev.detail)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{content}\n\t\t\t\t\t\t<div slot='items'>{dropdownItems}</div>\n\t\t\t\t\t</p-dropdown>\n\t\t\t\t) : (\n\t\t\t\t\tcontent\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _getContent(hasDropdownSlot: boolean) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclass='profile-content'\n\t\t\t\tslot='trigger'\n\t\t\t>\n\t\t\t\t<slot name='avatar' />\n\t\t\t\t<div class='name'>\n\t\t\t\t\t<slot name='title' />\n\t\t\t\t\t<slot name='subtitle' />\n\t\t\t\t</div>\n\n\t\t\t\t{hasDropdownSlot && this._getIcon()}\n\t\t\t</div>\n\t\t);\n\t}\n\n\tprivate _updateAvatar() {\n\t\tconst avatar = this._el.querySelector(\n\t\t\t'p-avatar[slot=\"avatar\"]'\n\t\t) as HTMLPAvatarElement;\n\n\t\tif (!avatar) {\n\t\t\treturn;\n\t\t}\n\n\t\tavatar.variant = this.variant ?? avatar.variant;\n\t\tavatar.size = this.size ?? avatar?.size;\n\t}\n\n\tprivate _getIcon() {\n\t\treturn (\n\t\t\t<p-icon\n\t\t\t\tclass='ml-auto'\n\t\t\t\tvariant={this.variant === 'company' ? 'chevron' : 'more'}\n\t\t\t/>\n\t\t);\n\t}\n}\n"],"mappings":"yDAAA,MAAMA,EAAsB,+iF,MCOfC,EAAO,M,sCAImB,O,UAWxB,Q,mBAOmB,K,CAEjC,mBAAAC,GACCC,KAAKC,e,CAGN,MAAAC,GACC,MAAMC,IAAoBH,KAAKI,IAAIC,cAClC,8BAED,MAAMC,EAAUN,KAAKO,YAAYJ,GACjC,MAAMK,EAAgBC,EAAA,QAAMC,KAAK,aACjC,OACCD,EAACE,EAAI,CACJC,MAAO,aAAaT,GAAmB,kBACtCH,KAAKa,eAAiB,YAGtBV,EACAM,EAAA,cACCG,MAAM,iBACNE,SAAS,WACTC,UAAWf,KAAKgB,UAAY,OAAS,UAAY,aACjDC,eAAgB,KAChBC,cAAe,MACfC,SAAUC,GAAOpB,KAAKa,cAAgBO,EAAGC,QAExCf,EACDG,EAAA,OAAKa,KAAK,SAASd,IACP,E,CAQT,WAAAD,CAAYJ,GACnB,OACCM,EAAA,OACCG,MAAM,kBACNU,KAAK,WAELb,EAAA,QAAMC,KAAK,WACXD,EAAA,OAAKG,MAAM,QACVH,EAAA,QAAMC,KAAK,UACXD,EAAA,QAAMC,KAAK,cAGXP,GAAmBH,KAAKuB,W,CAKpB,aAAAtB,G,QACP,MAAMuB,EAASxB,KAAKI,IAAIC,cACvB,2BAGD,IAAKmB,EAAQ,CACZ,M,CAGDA,EAAOR,SAAUS,EAAAzB,KAAKgB,WAAO,MAAAS,SAAA,EAAAA,EAAID,EAAOR,QACxCQ,EAAOE,MAAOC,EAAA3B,KAAK0B,QAAI,MAAAC,SAAA,EAAAA,EAAIH,IAAM,MAANA,SAAM,SAANA,EAAQE,I,CAG5B,QAAAH,GACP,OACCd,EAAA,UACCG,MAAM,UACNI,QAAShB,KAAKgB,UAAY,UAAY,UAAY,Q"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,c as e,h as o,H as r,g as i}from"./p-0c2cc6c4.js";import{a,c as p,o as n,f as s,s as c}from"./p-fef32402.js";import{c as h}from"./p-4d330cfc.js";const l=".relative{position:relative!important}.block{display:block!important}.h-auto{height:auto!important}*{box-sizing:border-box}p-dropdown,p-dropdown .trigger{display:block;position:relative}p-dropdown .trigger{height:auto;width:auto}.visible{visibility:visible!important}.static{position:static!important}.fixed{position:fixed!important}.absolute{position:absolute!important}.z-dropdown{z-index:200!important}.hidden{display:none!important}";const d=class{constructor(o){t(this,o);this.isOpen=e(this,"isOpen",3);this._loaded=false;this.placement="bottom-start";this.offset=8;this.strategy="absolute";this.show=false;this.usePortal=false;this.calculateWidth=false;this.applyMaxWidth=true;this.applyFullWidth=true;this.allowOverflow=false;this.scrollable=false;this.insideClick=false;this.disableTriggerClick=false;this.applyChevron=true;this.chevronPosition="end";this.chevronDirection=undefined}componentShouldUpdate(){this._update()}disconnectedCallback(){if(this._cleanup){this._cleanup();this._cleanup=null}this._menu.remove()}componentDidRender(){this._checkButtons()}render(){const t={class:`z-dropdown hidden ${this.strategy==="fixed"?"fixed":"absolute"}`,ref:t=>this._load(t),onClick:()=>this._containerClickHandler(),role:"popover","data-placement":this.placement,"data-strategy":this.strategy};let e;if(this.usePortal){e=o("p-portal",Object.assign({},t),o("p-dropdown-menu-container",{maxWidth:!this.calculateWidth&&this.applyMaxWidth,fullWidth:this.applyFullWidth&&!this.applyMaxWidth,allowOverflow:this.allowOverflow,scrollable:this.scrollable},o("slot",{name:"items"})))}else{e=o("p-dropdown-menu-container",Object.assign({maxWidth:!this.calculateWidth&&this.applyMaxWidth,fullWidth:this.applyFullWidth&&!this.applyMaxWidth,allowOverflow:this.allowOverflow,scrollable:this.scrollable},t),o("slot",{name:"items"}))}return o(r,{class:"p-dropdown"},o("div",{class:"trigger",ref:t=>this._trigger=t,onClick:()=>this._triggerClickHandler()},o("slot",{name:"trigger"})),e)}_checkButtons(){if(!this.applyChevron){return}const t=this._el.querySelectorAll('p-button[slot="trigger"]');for(let e of[...t]){e.chevronPosition=this.chevronPosition;e.chevron=this.chevronDirection?this.chevronDirection:this.placement.indexOf("top")>=0?"up":"down"}}onShowChange(t){if(!this._loaded){return}if(!t){this._hide();return}this._show()}documentClickHandler({target:t}){if(!this._menu.hasAttribute("data-show")||h(t,this._menu)){return}this._hide()}_containerClickHandler(){if(this.insideClick){return}if(this._menu.hasAttribute("data-show")){this._hide()}}_triggerClickHandler(){if(this.disableTriggerClick){return}if(this._menu.hasAttribute("data-show")){this._hide();return}this._show()}_load(t){this._menu=t;if(t){this._update();this._loaded=true;if(this.show){setTimeout((()=>this._show()),100)}}}_show(){if(!this._loaded){return}if(this.calculateWidth){this._menu.style.width=`${this._trigger.clientWidth}px`}this._cleanup=a(this._el,this._menu,(()=>this._update()));this._menu.setAttribute("data-show","");this._menu.classList.remove("hidden");this._menu.classList.add("block");this.isOpen.emit(true);this._update()}_hide(){if(!this._loaded||this.show){return}if(this._cleanup){this._cleanup();this._cleanup=null}this._menu.removeAttribute("data-show");this._menu.classList.remove("block");this._menu.classList.add("hidden");this.isOpen.emit(false)}_update(){if(!this._menu){return}p(this._el,this._menu,{placement:this.placement,strategy:this.strategy,middleware:[n(this.offset),s(),c()]}).then((({x:t,y:e,placement:o})=>{this._menu.dataset.placement=o;Object.assign(this._menu.style,{top:`${e}px`,left:`${t}px`})}))}get _el(){return i(this)}static get watchers(){return{show:["onShowChange"]}}};d.style=l;const b=".block{display:block!important}.flex{display:flex!important}.h-4{height:1rem!important}.h-6{height:1.5rem!important}.h-8{height:2rem!important}.w-4{width:1rem!important}.w-6{width:1.5rem!important}.w-\\[2\\.375rem\\]{width:2.375rem!important}.w-full{width:100%!important}.translate-x-0{--tw-translate-x:0px!important}.translate-x-0,.translate-x-3{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.translate-x-3{--tw-translate-x:0.75rem!important}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.appearance-none{appearance:none!important}.items-center{align-items:center!important}.justify-start{justify-content:flex-start!important}.gap-2{gap:.5rem!important}.overflow-hidden{overflow:hidden!important}.text-ellipsis{text-overflow:ellipsis!important}.whitespace-nowrap{white-space:nowrap!important}.rounded{border-radius:.25rem!important}.border{border-width:1px!important}.border-solid{border-style:solid!important}.border-indigo{--tw-border-opacity:1!important;border-color:rgb(82 138 250/var(--tw-border-opacity))!important}.border-negative{--tw-border-opacity:1!important;border-color:rgb(185 30 40/var(--tw-border-opacity))!important}.bg-indigo-light{--tw-bg-opacity:1!important;background-color:rgb(241 246 255/var(--tw-bg-opacity))!important}.bg-mystic-dark{background-color:rgb(218 230 240/var(--tw-bg-opacity))!important}.bg-mystic-dark,.bg-white{--tw-bg-opacity:1!important}.bg-white{background-color:rgb(255 255 255/var(--tw-bg-opacity))!important}.bg-center{background-position:50%!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.font-semibold{font-weight:600!important}.outline-none{outline:2px solid transparent!important;outline-offset:2px!important}.transition-transform{transition-duration:.15s!important;transition-property:transform!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important}*{box-sizing:border-box}:host{--tw-text-opacity:1;align-items:center;border-radius:.25rem;color:rgb(81 83 107/var(--tw-text-opacity));cursor:pointer;display:flex;font-size:.875rem;font-weight:600;gap:.5rem;height:2rem;justify-content:flex-start;line-height:1.25rem;padding-left:.5rem;padding-right:.5rem;width:100%}:host input[type=checkbox].p-input{--tw-bg-opacity:1;--tw-border-opacity:1;appearance:none;background-color:rgb(255 255 255/var(--tw-bg-opacity));background-position:50%;background-repeat:no-repeat;background-size:1rem;border-color:rgb(218 230 240/var(--tw-border-opacity));border-radius:.25rem;border-style:solid;border-width:1px;height:1.5rem;outline:2px solid transparent!important;outline-offset:2px!important;width:1.5rem}:host input[type=checkbox].p-input+label{margin-left:.2rem;margin-top:.05rem}:host input[type=checkbox].p-input:hover:not(:disabled):not([disabled]):not(.disabled){cursor:pointer}:host input[type=checkbox].p-input:hover:not(:disabled):not([disabled]):not(.disabled):not(:checked):not([checked]):not(.checked):not(:indeterminate):not([indeterminate]):not(.indeterminate){--tw-border-opacity:1;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='1em' height='1em' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.965 11.487 13.53 1.53c.435-.572 1.22-.7 1.8-.292l.108.077c.294.206.492.53.546.895.054.365-.04.737-.26 1.026L7.26 14.38a1.34 1.34 0 0 1-.642.463 1.302 1.302 0 0 1-1.575-.263L.362 9.6a1.356 1.356 0 0 1-.36-.99c.017-.37.181-.713.452-.95l.1-.088a1.302 1.302 0 0 1 1.82.093l3.592 3.82h-.001Z' fill='%23dae6f0' fill-rule='evenodd'/%3E%3C/svg%3E\");border-color:rgb(82 138 250/var(--tw-border-opacity))}:host input[type=checkbox].p-input.checked,:host input[type=checkbox].p-input.indeterminate,:host input[type=checkbox].p-input:checked,:host input[type=checkbox].p-input:indeterminate,:host input[type=checkbox].p-input[checked],:host input[type=checkbox].p-input[indeterminate]{--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(82 138 250/var(--tw-bg-opacity));border-color:rgb(82 138 250/var(--tw-border-opacity))}:host input[type=checkbox].p-input.checked,:host input[type=checkbox].p-input:checked,:host input[type=checkbox].p-input[checked]{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='1em' height='1em' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.965 11.487 13.53 1.53c.435-.572 1.22-.7 1.8-.292l.108.077c.294.206.492.53.546.895.054.365-.04.737-.26 1.026L7.26 14.38a1.34 1.34 0 0 1-.642.463 1.302 1.302 0 0 1-1.575-.263L.362 9.6a1.356 1.356 0 0 1-.36-.99c.017-.37.181-.713.452-.95l.1-.088a1.302 1.302 0 0 1 1.82.093l3.592 3.82h-.001Z' fill='%23fff' fill-rule='evenodd'/%3E%3C/svg%3E\")}:host input[type=checkbox].p-input.indeterminate,:host input[type=checkbox].p-input:indeterminate,:host input[type=checkbox].p-input[indeterminate]{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='1em' height='1em' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 7h8a1 1 0 0 1 0 2H4a1 1 0 1 1 0-2Z' fill='%23fff' fill-rule='evenodd'/%3E%3C/svg%3E\")}:host input[type=checkbox].p-input.disabled,:host input[type=checkbox].p-input:disabled,:host input[type=checkbox].p-input[disabled]{opacity:.4}:host input[type=checkbox].p-input.error,:host input[type=checkbox].p-input[error]{--tw-text-opacity:1;--tw-border-opacity:1!important;border-color:rgb(185 30 40/var(--tw-border-opacity))!important;color:rgb(138 15 29/var(--tw-text-opacity))}:host input[type=checkbox].p-input.error::-moz-placeholder,:host input[type=checkbox].p-input[error]::-moz-placeholder{--tw-text-opacity:1;color:rgb(255 204 211/var(--tw-text-opacity))}:host input[type=checkbox].p-input.error::placeholder,:host input[type=checkbox].p-input[error]::placeholder{--tw-text-opacity:1;color:rgb(255 204 211/var(--tw-text-opacity))}:host input[type=checkbox].p-input.error.checked,:host input[type=checkbox].p-input.error:checked,:host input[type=checkbox].p-input.error[checked],:host input[type=checkbox].p-input[error].checked,:host input[type=checkbox].p-input[error]:checked,:host input[type=checkbox].p-input[error][checked]{--tw-bg-opacity:1;background-color:rgb(185 30 40/var(--tw-bg-opacity))}:host input[type=checkbox].p-input.size-small{height:1rem;width:1rem}:host input[type=checkbox].p-input.size-small:hover:not(:disabled):not([disabled]):not(.disabled):not(:checked):not([checked]):not(.checked):not(:indeterminate):not([indeterminate]):not(.indeterminate){background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cpath d='M2.667 2.667h10.667v10.667H2.667z'/%3E%3Cpath fill='%23DAE6F0' d='m6.644 10.325 5.044-6.638a.87.87 0 0 1 1.2-.194l.072.05a.91.91 0 0 1 .19 1.28l-5.644 7.43a.89.89 0 0 1-.427.31.868.868 0 0 1-1.05-.176l-3.12-3.32a.904.904 0 0 1-.241-.66.897.897 0 0 1 .302-.633l.067-.058a.868.868 0 0 1 1.213.062l2.394 2.547Z'/%3E%3C/g%3E%3C/svg%3E\")}:host input[type=checkbox].p-input.size-small.checked,:host input[type=checkbox].p-input.size-small:checked,:host input[type=checkbox].p-input.size-small[checked]{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cpath d='M2.667 2.667h10.667v10.667H2.667z'/%3E%3Cpath fill='%23FFF' d='m6.644 10.325 5.044-6.638a.87.87 0 0 1 1.2-.194l.072.05a.91.91 0 0 1 .19 1.28l-5.644 7.43a.89.89 0 0 1-.427.31.868.868 0 0 1-1.05-.176l-3.12-3.32a.904.904 0 0 1-.241-.66.897.897 0 0 1 .302-.633l.067-.058a.868.868 0 0 1 1.213.062l2.394 2.547Z'/%3E%3C/g%3E%3C/svg%3E\")}:host input[type=checkbox].p-toggle{--tw-bg-opacity:1;--tw-border-opacity:1;align-items:center;appearance:none;background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(218 230 240/var(--tw-border-opacity));border-radius:1.5625rem;border-style:solid;border-width:1px;display:flex;height:1.5rem;justify-content:flex-start;padding:.25rem;width:2.375rem}:host input[type=checkbox].p-toggle:after{--tw-translate-x:0px;--tw-bg-opacity:1;background-color:rgb(218 230 240/var(--tw-bg-opacity));border-radius:100%;content:\"\";display:block;height:1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transition-duration:.1s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);width:1rem}:host input[type=checkbox].p-toggle.checked,:host input[type=checkbox].p-toggle:checked,:host input[type=checkbox].p-toggle[checked]{--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(82 138 250/var(--tw-bg-opacity));border-color:rgb(82 138 250/var(--tw-border-opacity))}:host input[type=checkbox].p-toggle.checked:after,:host input[type=checkbox].p-toggle:checked:after,:host input[type=checkbox].p-toggle[checked]:after{--tw-translate-x:0.75rem;--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:host input[type=checkbox].p-toggle.disabled,:host input[type=checkbox].p-toggle:disabled,:host input[type=checkbox].p-toggle[disabled]{opacity:.4}:host input[type=checkbox].p-toggle:hover:not(:disabled):not([disabled]):not(.disabled){cursor:pointer}:host input[type=checkbox].p-toggle:hover:not(:disabled):not([disabled]):not(.disabled):not(:checked):not([checked]):not(.checked){--tw-border-opacity:1;border-color:rgb(82 138 250/var(--tw-border-opacity))}:host input[type=checkbox].p-toggle.error,:host input[type=checkbox].p-toggle[error]{--tw-text-opacity:1;--tw-border-opacity:1!important;border-color:rgb(185 30 40/var(--tw-border-opacity))!important;color:rgb(138 15 29/var(--tw-text-opacity))}:host input[type=checkbox].p-toggle.error::-moz-placeholder,:host input[type=checkbox].p-toggle[error]::-moz-placeholder{--tw-text-opacity:1;color:rgb(255 204 211/var(--tw-text-opacity))}:host input[type=checkbox].p-toggle.error::placeholder,:host input[type=checkbox].p-toggle[error]::placeholder{--tw-text-opacity:1;color:rgb(255 204 211/var(--tw-text-opacity))}:host input[type=checkbox].p-toggle.error.checked,:host input[type=checkbox].p-toggle.error:checked,:host input[type=checkbox].p-toggle.error[checked],:host input[type=checkbox].p-toggle[error].checked,:host input[type=checkbox].p-toggle[error]:checked,:host input[type=checkbox].p-toggle[error][checked]{--tw-bg-opacity:1;background-color:rgb(185 30 40/var(--tw-bg-opacity))}:host .text-container{display:block;overflow:hidden;text-align:start;text-overflow:ellipsis;white-space:nowrap;width:100%}:host(.hover:hover){--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(241 246 255/var(--tw-bg-opacity));color:rgb(81 83 107/var(--tw-text-opacity))}:host(.active){--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(241 246 255/var(--tw-bg-opacity));color:rgb(82 138 250/var(--tw-text-opacity))}.static{position:static!important}.flex-shrink-0{flex-shrink:0!important}";const g=class{constructor(e){t(this,e);this.active=false;this.variant="default";this.enableHover=true;this.icon=undefined;this.useContainer=true}render(){return o(r,{class:`p-dropdown-menu-item ${this.active&&"active"} ${this.enableHover&&"hover"}`},this.icon&&o("p-icon",{variant:this.icon}),this.variant==="checkbox"&&o("input",{type:"checkbox",class:"p-input size-small flex-shrink-0",checked:this.active}),this.useContainer?o("div",{class:"text-container"},o("slot",null)):o("slot",null))}};g.style=b;export{d as p_dropdown,g as p_dropdown_menu_item};
|
|
2
|
+
//# sourceMappingURL=p-59014c4c.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["dropdownComponentCss","Dropdown","this","_loaded","componentShouldUpdate","_update","disconnectedCallback","_cleanup","_menu","remove","componentDidRender","_checkButtons","render","dropdownContainerProps","class","strategy","ref","el","_load","onClick","_containerClickHandler","role","placement","dropdownContainer","usePortal","h","Object","assign","maxWidth","calculateWidth","applyMaxWidth","fullWidth","applyFullWidth","allowOverflow","scrollable","name","Host","_trigger","_triggerClickHandler","applyChevron","children","_el","querySelectorAll","child","chevronPosition","chevron","chevronDirection","indexOf","onShowChange","show","_hide","_show","documentClickHandler","target","hasAttribute","childOf","insideClick","disableTriggerClick","popover","setTimeout","style","width","clientWidth","autoUpdate","setAttribute","classList","add","isOpen","emit","removeAttribute","computePosition","middleware","offset","flip","shift","then","x","y","dataset","top","left","dropdownMenuItemComponentCss","DropdownMenuItem","active","enableHover","icon","variant","type","checked","useContainer"],"sources":["src/components/molecules/dropdown/dropdown.component.scss?tag=p-dropdown","src/components/molecules/dropdown/dropdown.component.tsx","src/components/atoms/dropdown-menu-item/dropdown-menu-item.component.scss?tag=p-dropdown-menu-item&encapsulation=shadow","src/components/atoms/dropdown-menu-item/dropdown-menu-item.component.tsx"],"sourcesContent":["p-dropdown {\n\t@apply relative block;\n\n\t.trigger {\n\t\t@apply relative block h-auto w-auto;\n\t}\n}\n","import {\n\tautoUpdate,\n\tcomputePosition,\n\tflip,\n\toffset,\n\tPlacement,\n\tshift,\n\tStrategy,\n} from '@floating-ui/dom';\nimport {\n\tComponent,\n\tElement,\n\tEvent,\n\tEventEmitter,\n\th,\n\tHost,\n\tListen,\n\tProp,\n\tWatch,\n} from '@stencil/core';\nimport { childOf } from '../../../utils/child-of';\n\n@Component({\n\ttag: 'p-dropdown',\n\tstyleUrl: 'dropdown.component.scss',\n})\nexport class Dropdown {\n\t/**\n\t * The content of the dropdown menu\n\t */\n\t@Prop({ reflect: true }) placement: Placement = 'bottom-start';\n\n\t/**\n\t * The offset of the dropdown menu\n\t */\n\t@Prop() offset: number = 8;\n\n\t/**\n\t * The strategy of the dropdown placement\n\t */\n\t@Prop() strategy: Strategy = 'absolute';\n\n\t/**\n\t * Wether to show the dropdown menu\n\t */\n\t@Prop() show: boolean = false;\n\n\t/**\n\t * Wether to use a portal for the dropdown container\n\t */\n\t@Prop() usePortal: boolean = false;\n\n\t/**\n\t * Wether to automatically calculate the width of the menu based on the trigger\n\t */\n\t@Prop() calculateWidth: boolean = false;\n\n\t/**\n\t * Wether to apply the max width\n\t */\n\t@Prop() applyMaxWidth: boolean = true;\n\n\t/**\n\t * Wether to apply the full width\n\t */\n\t@Prop() applyFullWidth: boolean = true;\n\n\t/**\n\t * Wether to allow overflow in the container\n\t */\n\t@Prop() allowOverflow: boolean = false;\n\n\t/**\n\t * Wether the dropdown container should be scrollable when the threshold is met.\n\t */\n\t@Prop() scrollable: boolean | 'default' | 'large' = false;\n\n\t/**\n\t * Wether to automatically close the dropdown menu after clicking inside\n\t */\n\t@Prop() insideClick: boolean = false;\n\n\t/**\n\t * Wether to automatically close the dropdown menu after clicking inside\n\t */\n\t@Prop() disableTriggerClick: boolean = false;\n\n\t/**\n\t * Wether to apply chevron automatically\n\t */\n\t@Prop() applyChevron: boolean = true;\n\n\t/**\n\t * Chevron position\n\t */\n\t@Prop() chevronPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * Chevron direction\n\t */\n\t@Prop() chevronDirection: 'up' | 'down';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t/**\n\t * Open change event\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tisOpen: EventEmitter<boolean>;\n\n\tprivate _loaded = false;\n\tprivate _trigger: HTMLElement;\n\tprivate _menu: HTMLElement;\n\tprivate _cleanup: () => void;\n\n\tcomponentShouldUpdate() {\n\t\tthis._update();\n\t}\n\n\tdisconnectedCallback() {\n\t\tif (this._cleanup) {\n\t\t\tthis._cleanup();\n\t\t\tthis._cleanup = null;\n\t\t}\n\n\t\tthis._menu.remove();\n\t}\n\n\tcomponentDidRender() {\n\t\tthis._checkButtons();\n\t}\n\n\trender() {\n\t\tconst dropdownContainerProps = {\n\t\t\tclass: `z-dropdown hidden ${\n\t\t\t\tthis.strategy === 'fixed' ? 'fixed' : 'absolute'\n\t\t\t}`,\n\t\t\tref: el => this._load(el),\n\t\t\tonClick: () => this._containerClickHandler(),\n\t\t\trole: 'popover',\n\t\t\t'data-placement': this.placement,\n\t\t\t'data-strategy': this.strategy,\n\t\t};\n\n\t\tlet dropdownContainer: HTMLElement;\n\n\t\tif (this.usePortal) {\n\t\t\tdropdownContainer = (\n\t\t\t\t<p-portal {...dropdownContainerProps}>\n\t\t\t\t\t<p-dropdown-menu-container\n\t\t\t\t\t\tmaxWidth={!this.calculateWidth && this.applyMaxWidth}\n\t\t\t\t\t\tfullWidth={this.applyFullWidth && !this.applyMaxWidth}\n\t\t\t\t\t\tallowOverflow={this.allowOverflow}\n\t\t\t\t\t\tscrollable={this.scrollable}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot name='items' />\n\t\t\t\t\t</p-dropdown-menu-container>\n\t\t\t\t</p-portal>\n\t\t\t);\n\t\t} else {\n\t\t\tdropdownContainer = (\n\t\t\t\t<p-dropdown-menu-container\n\t\t\t\t\tmaxWidth={!this.calculateWidth && this.applyMaxWidth}\n\t\t\t\t\tfullWidth={this.applyFullWidth && !this.applyMaxWidth}\n\t\t\t\t\tallowOverflow={this.allowOverflow}\n\t\t\t\t\tscrollable={this.scrollable}\n\t\t\t\t\t{...dropdownContainerProps}\n\t\t\t\t>\n\t\t\t\t\t<slot name='items' />\n\t\t\t\t</p-dropdown-menu-container>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<Host class='p-dropdown'>\n\t\t\t\t<div\n\t\t\t\t\tclass='trigger'\n\t\t\t\t\tref={ref => (this._trigger = ref)}\n\t\t\t\t\tonClick={() => this._triggerClickHandler()}\n\t\t\t\t>\n\t\t\t\t\t<slot name='trigger' />\n\t\t\t\t</div>\n\t\t\t\t{dropdownContainer}\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _checkButtons() {\n\t\tif (!this.applyChevron) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst children = this._el.querySelectorAll('p-button[slot=\"trigger\"]');\n\n\t\tfor (let child of [...children]) {\n\t\t\t(child as any).chevronPosition = this.chevronPosition;\n\t\t\t(child as any).chevron = this.chevronDirection\n\t\t\t\t? this.chevronDirection\n\t\t\t\t: this.placement.indexOf('top') >= 0\n\t\t\t\t? 'up'\n\t\t\t\t: 'down';\n\t\t}\n\t}\n\n\t@Watch('show')\n\tprotected onShowChange(show) {\n\t\tif (!this._loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!show) {\n\t\t\tthis._hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._show();\n\t}\n\n\t@Listen('click', { target: 'document', capture: true })\n\tprotected documentClickHandler({ target }) {\n\t\tif (!this._menu.hasAttribute('data-show') || childOf(target, this._menu)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._hide();\n\t}\n\n\tprivate _containerClickHandler() {\n\t\tif (this.insideClick) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._menu.hasAttribute('data-show')) {\n\t\t\tthis._hide();\n\t\t}\n\t}\n\n\tprivate _triggerClickHandler() {\n\t\tif (this.disableTriggerClick) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._menu.hasAttribute('data-show')) {\n\t\t\tthis._hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._show();\n\t}\n\n\tprivate _load(popover: HTMLElement) {\n\t\tthis._menu = popover;\n\t\tif (popover) {\n\t\t\tthis._update();\n\t\t\tthis._loaded = true;\n\n\t\t\tif (this.show) {\n\t\t\t\tsetTimeout(() => this._show(), 100);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _show() {\n\t\tif (!this._loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make the popover visible\n\t\tif (this.calculateWidth) {\n\t\t\tthis._menu.style.width = `${this._trigger.clientWidth}px`;\n\t\t}\n\n\t\tthis._cleanup = autoUpdate(this._el, this._menu, () => this._update());\n\n\t\tthis._menu.setAttribute('data-show', '');\n\t\tthis._menu.classList.remove('hidden');\n\t\tthis._menu.classList.add('flex');\n\n\t\tthis.isOpen.emit(true);\n\n\t\tthis._update();\n\t}\n\n\tprivate _hide() {\n\t\tif (!this._loaded || this.show) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._cleanup) {\n\t\t\tthis._cleanup();\n\t\t\tthis._cleanup = null;\n\t\t}\n\n\t\t// Hide the popover\n\t\tthis._menu.removeAttribute('data-show');\n\t\tthis._menu.classList.remove('flex');\n\t\tthis._menu.classList.add('hidden');\n\n\t\tthis.isOpen.emit(false);\n\t}\n\n\tprivate _update() {\n\t\tif (!this._menu) {\n\t\t\treturn;\n\t\t}\n\n\t\tcomputePosition(this._el, this._menu, {\n\t\t\tplacement: this.placement,\n\t\t\tstrategy: this.strategy,\n\t\t\tmiddleware: [offset(this.offset), flip(), shift()],\n\t\t}).then(({ x, y, placement }) => {\n\t\t\tthis._menu.dataset.placement = placement;\n\t\t\tObject.assign(this._menu.style, {\n\t\t\t\ttop: `${y}px`,\n\t\t\t\tleft: `${x}px`,\n\t\t\t});\n\t\t});\n\t}\n}\n",":host {\n\t@import '../../../style/form/checkbox';\n\n\t@apply flex h-8 w-full items-center justify-start gap-2 rounded px-2;\n\t@apply text-sm font-semibold text-storm;\n\t@apply cursor-pointer;\n\n\t.text-container {\n\t\t@apply block w-full overflow-hidden text-ellipsis whitespace-nowrap text-start;\n\t}\n}\n\n:host(.hover:hover) {\n\t@apply bg-indigo-light text-storm;\n}\n\n:host(.active) {\n\t@apply bg-indigo-light text-indigo;\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\nimport { IconVariant } from '../icon/icon.component';\n\n@Component({\n\ttag: 'p-dropdown-menu-item',\n\tstyleUrl: 'dropdown-menu-item.component.scss',\n\tshadow: true,\n})\nexport class DropdownMenuItem {\n\t/**\n\t * Wether the dropdown menu item is active\n\t */\n\t@Prop() active: boolean = false;\n\n\t/**\n\t * The variant of the item\n\t */\n\t@Prop() variant: 'default' | 'checkbox' = 'default';\n\n\t/**\n\t * Wether to enable the hover state\n\t */\n\t@Prop() enableHover: boolean = true;\n\n\t/**\n\t * Icon of the navigation item\n\t */\n\t@Prop() icon: IconVariant;\n\n\t/**\n\t * wether to use the container for text\n\t */\n\t@Prop() useContainer = true;\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={`p-dropdown-menu-item ${this.active && 'active'} ${\n\t\t\t\t\tthis.enableHover && 'hover'\n\t\t\t\t}`}\n\t\t\t>\n\t\t\t\t{this.icon && <p-icon variant={this.icon} />}\n\n\t\t\t\t{this.variant === 'checkbox' && (\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype='checkbox'\n\t\t\t\t\t\tclass='p-input size-small flex-shrink-0'\n\t\t\t\t\t\tchecked={this.active}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{this.useContainer ? (\n\t\t\t\t\t<div class='text-container'>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<slot />\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t);\n\t}\n}\n"],"mappings":"+JAAA,MAAMA,EAAuB,od,MC0BhBC,EAAQ,M,wDAyFZC,KAAAC,QAAU,M,eArF8B,e,YAKvB,E,cAKI,W,UAKL,M,eAKK,M,oBAKK,M,mBAKD,K,oBAKC,K,mBAKD,M,gBAKmB,M,iBAKrB,M,yBAKQ,M,kBAKP,K,qBAKW,M,gCAyB3C,qBAAAC,GACCF,KAAKG,S,CAGN,oBAAAC,GACC,GAAIJ,KAAKK,SAAU,CAClBL,KAAKK,WACLL,KAAKK,SAAW,I,CAGjBL,KAAKM,MAAMC,Q,CAGZ,kBAAAC,GACCR,KAAKS,e,CAGN,MAAAC,GACC,MAA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KAAKM,MAAO,CAChB,M,CAGD8D,EAAgBpE,KAAKuC,IAAKvC,KAAKM,MAAO,CACrCc,UAAWpB,KAAKoB,UAChBP,SAAUb,KAAKa,SACfwD,WAAY,CAACC,EAAOtE,KAAKsE,QAASC,IAAQC,OACxCC,MAAK,EAAGC,IAAGC,IAAGvD,gBAChBpB,KAAKM,MAAMsE,QAAQxD,UAAYA,EAC/BI,OAAOC,OAAOzB,KAAKM,MAAMoD,MAAO,CAC/BmB,IAAK,GAAGF,MACRG,KAAM,GAAGJ,OACR,G,0FChUL,MAAMK,EAA+B,uoW,MCQxBC,EAAgB,M,qCAIF,M,aAKgB,U,iBAKX,K,sCAUR,I,CAEvB,MAAAtE,GACC,OACCa,EAACW,EAAI,CACJtB,MAAO,wBAAwBZ,KAAKiF,QAAU,YAC7CjF,KAAKkF,aAAe,WAGpBlF,KAAKmF,MAAQ5D,EAAA,UAAQ6D,QAASpF,KAAKmF,OAEnCnF,KAAKoF,UAAY,YACjB7D,EAAA,SACC8D,KAAK,WACLzE,MAAM,mCACN0E,QAAStF,KAAKiF,SAIfjF,KAAKuF,aACLhE,EAAA,OAAKX,MAAM,kBACVW,EAAA,cAGDA,EAAA,a"}
|
|
1
|
+
{"version":3,"names":["dropdownComponentCss","Dropdown","this","_loaded","componentShouldUpdate","_update","disconnectedCallback","_cleanup","_menu","remove","componentDidRender","_checkButtons","render","dropdownContainerProps","class","strategy","ref","el","_load","onClick","_containerClickHandler","role","placement","dropdownContainer","usePortal","h","Object","assign","maxWidth","calculateWidth","applyMaxWidth","fullWidth","applyFullWidth","allowOverflow","scrollable","name","Host","_trigger","_triggerClickHandler","applyChevron","children","_el","querySelectorAll","child","chevronPosition","chevron","chevronDirection","indexOf","onShowChange","show","_hide","_show","documentClickHandler","target","hasAttribute","childOf","insideClick","disableTriggerClick","popover","setTimeout","style","width","clientWidth","autoUpdate","setAttribute","classList","add","isOpen","emit","removeAttribute","computePosition","middleware","offset","flip","shift","then","x","y","dataset","top","left","dropdownMenuItemComponentCss","DropdownMenuItem","active","enableHover","icon","variant","type","checked","useContainer"],"sources":["src/components/molecules/dropdown/dropdown.component.scss?tag=p-dropdown","src/components/molecules/dropdown/dropdown.component.tsx","src/components/atoms/dropdown-menu-item/dropdown-menu-item.component.scss?tag=p-dropdown-menu-item&encapsulation=shadow","src/components/atoms/dropdown-menu-item/dropdown-menu-item.component.tsx"],"sourcesContent":["p-dropdown {\n\t@apply relative block;\n\n\t.trigger {\n\t\t@apply relative block h-auto w-auto;\n\t}\n}\n","import {\n\tautoUpdate,\n\tcomputePosition,\n\tflip,\n\toffset,\n\tPlacement,\n\tshift,\n\tStrategy,\n} from '@floating-ui/dom';\nimport {\n\tComponent,\n\tElement,\n\tEvent,\n\tEventEmitter,\n\th,\n\tHost,\n\tListen,\n\tProp,\n\tWatch,\n} from '@stencil/core';\nimport { childOf } from '../../../utils/child-of';\n\n@Component({\n\ttag: 'p-dropdown',\n\tstyleUrl: 'dropdown.component.scss',\n})\nexport class Dropdown {\n\t/**\n\t * The content of the dropdown menu\n\t */\n\t@Prop({ reflect: true }) placement: Placement = 'bottom-start';\n\n\t/**\n\t * The offset of the dropdown menu\n\t */\n\t@Prop() offset: number = 8;\n\n\t/**\n\t * The strategy of the dropdown placement\n\t */\n\t@Prop() strategy: Strategy = 'absolute';\n\n\t/**\n\t * Wether to show the dropdown menu\n\t */\n\t@Prop() show: boolean = false;\n\n\t/**\n\t * Wether to use a portal for the dropdown container\n\t */\n\t@Prop() usePortal: boolean = false;\n\n\t/**\n\t * Wether to automatically calculate the width of the menu based on the trigger\n\t */\n\t@Prop() calculateWidth: boolean = false;\n\n\t/**\n\t * Wether to apply the max width\n\t */\n\t@Prop() applyMaxWidth: boolean = true;\n\n\t/**\n\t * Wether to apply the full width\n\t */\n\t@Prop() applyFullWidth: boolean = true;\n\n\t/**\n\t * Wether to allow overflow in the container\n\t */\n\t@Prop() allowOverflow: boolean = false;\n\n\t/**\n\t * Wether the dropdown container should be scrollable when the threshold is met.\n\t */\n\t@Prop() scrollable: boolean | 'default' | 'large' = false;\n\n\t/**\n\t * Wether to automatically close the dropdown menu after clicking inside\n\t */\n\t@Prop() insideClick: boolean = false;\n\n\t/**\n\t * Wether to automatically close the dropdown menu after clicking inside\n\t */\n\t@Prop() disableTriggerClick: boolean = false;\n\n\t/**\n\t * Wether to apply chevron automatically\n\t */\n\t@Prop() applyChevron: boolean = true;\n\n\t/**\n\t * Chevron position\n\t */\n\t@Prop() chevronPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * Chevron direction\n\t */\n\t@Prop() chevronDirection: 'up' | 'down';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t/**\n\t * Open change event\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tisOpen: EventEmitter<boolean>;\n\n\tprivate _loaded = false;\n\tprivate _trigger: HTMLElement;\n\tprivate _menu: HTMLElement;\n\tprivate _cleanup: () => void;\n\n\tcomponentShouldUpdate() {\n\t\tthis._update();\n\t}\n\n\tdisconnectedCallback() {\n\t\tif (this._cleanup) {\n\t\t\tthis._cleanup();\n\t\t\tthis._cleanup = null;\n\t\t}\n\n\t\tthis._menu.remove();\n\t}\n\n\tcomponentDidRender() {\n\t\tthis._checkButtons();\n\t}\n\n\trender() {\n\t\tconst dropdownContainerProps = {\n\t\t\tclass: `z-dropdown hidden ${\n\t\t\t\tthis.strategy === 'fixed' ? 'fixed' : 'absolute'\n\t\t\t}`,\n\t\t\tref: el => this._load(el),\n\t\t\tonClick: () => this._containerClickHandler(),\n\t\t\trole: 'popover',\n\t\t\t'data-placement': this.placement,\n\t\t\t'data-strategy': this.strategy,\n\t\t};\n\n\t\tlet dropdownContainer: HTMLElement;\n\n\t\tif (this.usePortal) {\n\t\t\tdropdownContainer = (\n\t\t\t\t<p-portal {...dropdownContainerProps}>\n\t\t\t\t\t<p-dropdown-menu-container\n\t\t\t\t\t\tmaxWidth={!this.calculateWidth && this.applyMaxWidth}\n\t\t\t\t\t\tfullWidth={this.applyFullWidth && !this.applyMaxWidth}\n\t\t\t\t\t\tallowOverflow={this.allowOverflow}\n\t\t\t\t\t\tscrollable={this.scrollable}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot name='items' />\n\t\t\t\t\t</p-dropdown-menu-container>\n\t\t\t\t</p-portal>\n\t\t\t);\n\t\t} else {\n\t\t\tdropdownContainer = (\n\t\t\t\t<p-dropdown-menu-container\n\t\t\t\t\tmaxWidth={!this.calculateWidth && this.applyMaxWidth}\n\t\t\t\t\tfullWidth={this.applyFullWidth && !this.applyMaxWidth}\n\t\t\t\t\tallowOverflow={this.allowOverflow}\n\t\t\t\t\tscrollable={this.scrollable}\n\t\t\t\t\t{...dropdownContainerProps}\n\t\t\t\t>\n\t\t\t\t\t<slot name='items' />\n\t\t\t\t</p-dropdown-menu-container>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<Host class='p-dropdown'>\n\t\t\t\t<div\n\t\t\t\t\tclass='trigger'\n\t\t\t\t\tref={ref => (this._trigger = ref)}\n\t\t\t\t\tonClick={() => this._triggerClickHandler()}\n\t\t\t\t>\n\t\t\t\t\t<slot name='trigger' />\n\t\t\t\t</div>\n\t\t\t\t{dropdownContainer}\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _checkButtons() {\n\t\tif (!this.applyChevron) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst children = this._el.querySelectorAll('p-button[slot=\"trigger\"]');\n\n\t\tfor (let child of [...children]) {\n\t\t\t(child as any).chevronPosition = this.chevronPosition;\n\t\t\t(child as any).chevron = this.chevronDirection\n\t\t\t\t? this.chevronDirection\n\t\t\t\t: this.placement.indexOf('top') >= 0\n\t\t\t\t? 'up'\n\t\t\t\t: 'down';\n\t\t}\n\t}\n\n\t@Watch('show')\n\tprotected onShowChange(show) {\n\t\tif (!this._loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!show) {\n\t\t\tthis._hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._show();\n\t}\n\n\t@Listen('click', { target: 'document', capture: true })\n\tprotected documentClickHandler({ target }) {\n\t\tif (!this._menu.hasAttribute('data-show') || childOf(target, this._menu)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._hide();\n\t}\n\n\tprivate _containerClickHandler() {\n\t\tif (this.insideClick) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._menu.hasAttribute('data-show')) {\n\t\t\tthis._hide();\n\t\t}\n\t}\n\n\tprivate _triggerClickHandler() {\n\t\tif (this.disableTriggerClick) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._menu.hasAttribute('data-show')) {\n\t\t\tthis._hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._show();\n\t}\n\n\tprivate _load(popover: HTMLElement) {\n\t\tthis._menu = popover;\n\t\tif (popover) {\n\t\t\tthis._update();\n\t\t\tthis._loaded = true;\n\n\t\t\tif (this.show) {\n\t\t\t\tsetTimeout(() => this._show(), 100);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _show() {\n\t\tif (!this._loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make the popover visible\n\t\tif (this.calculateWidth) {\n\t\t\tthis._menu.style.width = `${this._trigger.clientWidth}px`;\n\t\t}\n\n\t\tthis._cleanup = autoUpdate(this._el, this._menu, () => this._update());\n\n\t\tthis._menu.setAttribute('data-show', '');\n\t\tthis._menu.classList.remove('hidden');\n\t\tthis._menu.classList.add('block');\n\n\t\tthis.isOpen.emit(true);\n\n\t\tthis._update();\n\t}\n\n\tprivate _hide() {\n\t\tif (!this._loaded || this.show) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._cleanup) {\n\t\t\tthis._cleanup();\n\t\t\tthis._cleanup = null;\n\t\t}\n\n\t\t// Hide the popover\n\t\tthis._menu.removeAttribute('data-show');\n\t\tthis._menu.classList.remove('block');\n\t\tthis._menu.classList.add('hidden');\n\n\t\tthis.isOpen.emit(false);\n\t}\n\n\tprivate _update() {\n\t\tif (!this._menu) {\n\t\t\treturn;\n\t\t}\n\n\t\tcomputePosition(this._el, this._menu, {\n\t\t\tplacement: this.placement,\n\t\t\tstrategy: this.strategy,\n\t\t\tmiddleware: [offset(this.offset), flip(), shift()],\n\t\t}).then(({ x, y, placement }) => {\n\t\t\tthis._menu.dataset.placement = placement;\n\t\t\tObject.assign(this._menu.style, {\n\t\t\t\ttop: `${y}px`,\n\t\t\t\tleft: `${x}px`,\n\t\t\t});\n\t\t});\n\t}\n}\n",":host {\n\t@import '../../../style/form/checkbox';\n\n\t@apply flex h-8 w-full items-center justify-start gap-2 rounded px-2;\n\t@apply text-sm font-semibold text-storm;\n\t@apply cursor-pointer;\n\n\t.text-container {\n\t\t@apply block w-full overflow-hidden text-ellipsis whitespace-nowrap text-start;\n\t}\n}\n\n:host(.hover:hover) {\n\t@apply bg-indigo-light text-storm;\n}\n\n:host(.active) {\n\t@apply bg-indigo-light text-indigo;\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\nimport { IconVariant } from '../icon/icon.component';\n\n@Component({\n\ttag: 'p-dropdown-menu-item',\n\tstyleUrl: 'dropdown-menu-item.component.scss',\n\tshadow: true,\n})\nexport class DropdownMenuItem {\n\t/**\n\t * Wether the dropdown menu item is active\n\t */\n\t@Prop() active: boolean = false;\n\n\t/**\n\t * The variant of the item\n\t */\n\t@Prop() variant: 'default' | 'checkbox' = 'default';\n\n\t/**\n\t * Wether to enable the hover state\n\t */\n\t@Prop() enableHover: boolean = true;\n\n\t/**\n\t * Icon of the navigation item\n\t */\n\t@Prop() icon: IconVariant;\n\n\t/**\n\t * wether to use the container for text\n\t */\n\t@Prop() useContainer = true;\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={`p-dropdown-menu-item ${this.active && 'active'} ${\n\t\t\t\t\tthis.enableHover && 'hover'\n\t\t\t\t}`}\n\t\t\t>\n\t\t\t\t{this.icon && <p-icon variant={this.icon} />}\n\n\t\t\t\t{this.variant === 'checkbox' && (\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype='checkbox'\n\t\t\t\t\t\tclass='p-input size-small flex-shrink-0'\n\t\t\t\t\t\tchecked={this.active}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{this.useContainer ? (\n\t\t\t\t\t<div class='text-container'>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<slot />\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t);\n\t}\n}\n"],"mappings":"+JAAA,MAAMA,EAAuB,ub,MC0BhBC,EAAQ,M,wDAyFZC,KAAAC,QAAU,M,eArF8B,e,YAKvB,E,cAKI,W,UAKL,M,eAKK,M,oBAKK,M,mBAKD,K,oBAKC,K,mBAKD,M,gBAKmB,M,iBAKrB,M,yBAKQ,M,kBAKP,K,qBAKW,M,gCAyB3C,qBAAAC,GACCF,KAAKG,S,CAGN,oBAAAC,GACC,GAAIJ,KAAKK,SAAU,CAClBL,KAAKK,WACLL,KAAKK,SAAW,I,CAGjBL,KAAKM,MAAMC,Q,CAGZ,kBAAAC,GACCR,KAAKS,e,CAGN,MAAAC,GACC,MAAMC,EAAyB,CAC9BC,MAAO,qBACNZ,KAAKa,WAAa,QAAU,QAAU,aAEvCC,IAAKC,GAAMf,KAAKgB,MAAMD,GACtBE,QAAS,IAAMjB,KAAKkB,yBACpBC,KAAM,UACN,iBAAkBnB,KAAKoB,UACvB,gBAAiBpB,KAAKa,UAGvB,IAAIQ,EAEJ,GAAIrB,KAAKsB,UAAW,CACnBD,EACCE,EAAA,WAAAC,OAAAC,OAAA,GAAcd,GACbY,EAAA,6BACCG,UAAW1B,KAAK2B,gBAAkB3B,KAAK4B,cACvCC,UAAW7B,KAAK8B,iBAAmB9B,KAAK4B,cACxCG,cAAe/B,KAAK+B,cACpBC,WAAYhC,KAAKgC,YAEjBT,EAAA,QAAMU,KAAK,W,KAIR,CACNZ,EACCE,EAAA,4BAAAC,OAAAC,OAAA,CACCC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