@paperless/core 2.12.3 → 2.12.5
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-574bc9bb.entry.js +2 -0
- package/dist/build/{p-57b7a986.entry.js.map → p-574bc9bb.entry.js.map} +1 -1
- package/dist/build/{p-a6ca6e5e.js → p-7f8f63b5.js} +1 -1
- package/dist/build/p-8130400b.entry.js +2 -0
- package/dist/build/p-8130400b.entry.js.map +1 -0
- package/dist/build/p-8fb06c75.entry.js +2 -0
- package/dist/build/p-8fb06c75.entry.js.map +1 -0
- package/dist/build/p-card-header.entry.esm.js.map +1 -1
- package/dist/build/p-checkbox.p-dropdown.p-dropdown-menu-container.p-dropdown-menu-item.entry.esm.js.map +1 -1
- package/dist/build/p-field.p-field-container.entry.esm.js.map +1 -1
- package/dist/build/paperless.esm.js +1 -1
- package/dist/cjs/p-card-header.cjs.entry.js +2 -2
- package/dist/cjs/p-card-header.cjs.entry.js.map +1 -1
- package/dist/cjs/p-card-header.entry.cjs.js.map +1 -1
- package/dist/cjs/p-checkbox.p-dropdown.p-dropdown-menu-container.p-dropdown-menu-item.entry.cjs.js.map +1 -1
- package/dist/cjs/p-checkbox_4.cjs.entry.js +3 -3
- package/dist/cjs/p-checkbox_4.cjs.entry.js.map +1 -1
- package/dist/cjs/p-field.p-field-container.entry.cjs.js.map +1 -1
- package/dist/cjs/p-field_2.cjs.entry.js +6 -6
- package/dist/cjs/p-field_2.cjs.entry.js.map +1 -1
- package/dist/collection/components/atoms/card/header/card-header.component.css +1 -1
- package/dist/collection/components/atoms/card/header/card-header.component.js +1 -1
- package/dist/collection/components/atoms/card/header/card-header.component.js.map +1 -1
- package/dist/collection/components/molecules/dropdown/dropdown.component.js +3 -3
- package/dist/collection/components/molecules/dropdown/dropdown.component.js.map +1 -1
- package/dist/collection/components/molecules/field/field/field.component.css +1 -1
- package/dist/collection/components/molecules/field/field/field.component.js +5 -5
- package/dist/collection/components/molecules/field/field/field.component.js.map +1 -1
- package/dist/components/{p-CoSnDHGb.js → p-9uCNIhdB.js} +4 -4
- package/dist/components/{p-CoSnDHGb.js.map → p-9uCNIhdB.js.map} +1 -1
- package/dist/components/{p-Cr3fKigp.js → p-B8HPSlC1.js} +8 -8
- package/dist/components/p-B8HPSlC1.js.map +1 -0
- package/dist/components/{p-BqJMPQj6.js → p-Bc76zCz0.js} +5 -5
- package/dist/components/{p-BqJMPQj6.js.map → p-Bc76zCz0.js.map} +1 -1
- package/dist/components/{p-Dr7FpF5o.js → p-DiYvS6UA.js} +3 -3
- package/dist/components/{p-Dr7FpF5o.js.map → p-DiYvS6UA.js.map} +1 -1
- package/dist/components/{p-CpHwL9XE.js → p-DkFi_kvY.js} +3 -3
- package/dist/components/{p-CpHwL9XE.js.map → p-DkFi_kvY.js.map} +1 -1
- package/dist/components/p-card-header.js +2 -2
- package/dist/components/p-card-header.js.map +1 -1
- package/dist/components/p-datepicker.js +2 -2
- package/dist/components/p-dropdown.js +1 -1
- package/dist/components/p-field.js +1 -1
- package/dist/components/{p-CpzpSwUF.js → p-fr51xGM-.js} +5 -5
- package/dist/components/{p-CpzpSwUF.js.map → p-fr51xGM-.js.map} +1 -1
- package/dist/components/p-pagination-size.js +1 -1
- package/dist/components/p-pagination.js +1 -1
- package/dist/components/p-profile.js +1 -1
- package/dist/components/p-select.js +2 -2
- package/dist/components/p-table-footer.js +1 -1
- package/dist/components/p-table-header.js +1 -1
- package/dist/components/p-table.js +6 -6
- package/dist/esm/p-card-header.entry.js +2 -2
- package/dist/esm/p-card-header.entry.js.map +1 -1
- package/dist/esm/p-checkbox.p-dropdown.p-dropdown-menu-container.p-dropdown-menu-item.entry.js.map +1 -1
- package/dist/esm/p-checkbox_4.entry.js +3 -3
- package/dist/esm/p-checkbox_4.entry.js.map +1 -1
- package/dist/esm/p-field.p-field-container.entry.js.map +1 -1
- package/dist/esm/p-field_2.entry.js +6 -6
- package/dist/esm/p-field_2.entry.js.map +1 -1
- package/dist/index.html +1 -1
- package/dist/paperless/p-574bc9bb.entry.js +2 -0
- package/dist/paperless/{p-57b7a986.entry.js.map → p-574bc9bb.entry.js.map} +1 -1
- package/dist/paperless/p-8130400b.entry.js +2 -0
- package/dist/paperless/p-8130400b.entry.js.map +1 -0
- package/dist/paperless/p-8fb06c75.entry.js +2 -0
- package/dist/paperless/p-8fb06c75.entry.js.map +1 -0
- package/dist/paperless/p-card-header.entry.esm.js.map +1 -1
- package/dist/paperless/p-checkbox.p-dropdown.p-dropdown-menu-container.p-dropdown-menu-item.entry.esm.js.map +1 -1
- package/dist/paperless/p-field.p-field-container.entry.esm.js.map +1 -1
- package/dist/paperless/paperless.esm.js +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/package.json +1 -1
- package/dist/build/p-57b7a986.entry.js +0 -2
- package/dist/build/p-835a50f3.entry.js +0 -2
- package/dist/build/p-835a50f3.entry.js.map +0 -1
- package/dist/build/p-83ed458a.entry.js +0 -2
- package/dist/build/p-83ed458a.entry.js.map +0 -1
- package/dist/components/p-Cr3fKigp.js.map +0 -1
- package/dist/paperless/p-57b7a986.entry.js +0 -2
- package/dist/paperless/p-835a50f3.entry.js +0 -2
- package/dist/paperless/p-835a50f3.entry.js.map +0 -1
- package/dist/paperless/p-83ed458a.entry.js +0 -2
- package/dist/paperless/p-83ed458a.entry.js.map +0 -1
|
@@ -108,18 +108,18 @@ export class Dropdown {
|
|
|
108
108
|
this._cleanup();
|
|
109
109
|
this._cleanup = null;
|
|
110
110
|
}
|
|
111
|
-
this._menu
|
|
111
|
+
this._menu?.remove();
|
|
112
112
|
}
|
|
113
113
|
componentDidRender() {
|
|
114
114
|
this._checkButtons();
|
|
115
115
|
this._checkItems();
|
|
116
116
|
}
|
|
117
117
|
render() {
|
|
118
|
-
return (h(Host, { key: '
|
|
118
|
+
return (h(Host, { key: 'ed870d44153eab4d7b3dbb6e3e424aa459d39acf', class: 'relative' }, h("div", { key: '4966a1141bbb0c52ea0cce7a3d4fe4993f60c953', class: 'trigger', onClick: () => this._triggerClickHandler() }, h("slot", { key: 'd782fc6e0ed8c575d56cf1e170c88ad5ce384713', name: 'trigger' })), h("div", { key: '72a3c18133657d18c98ebcdad2f376aa1d1f493f', class: 'relative w-full' }, h("p-dropdown-menu-container", { key: 'f573b7446cb5fec75e31fc1659a7c44165f74ed8', variant: this.variant, maxWidth: this.applyMaxWidth, fullWidth: this.applyFullWidth && !this.applyMaxWidth, allowOverflow: this.allowOverflow, scrollable: this.scrollable, class: dropdownContainerClass({
|
|
119
119
|
strategy: this.strategy,
|
|
120
120
|
maxWidth: this.applyMaxWidth,
|
|
121
121
|
fullWidth: this.applyFullWidth && !this.applyMaxWidth,
|
|
122
|
-
}), ref: el => this._load(el), onClick: () => this._containerClickHandler(), role: 'popover', "data-placement": this.placement, "data-strategy": this.strategy }, h("slot", { key: '
|
|
122
|
+
}), ref: el => this._load(el), onClick: () => this._containerClickHandler(), role: 'popover', "data-placement": this.placement, "data-strategy": this.strategy }, h("slot", { key: 'cf458650189cc97441506649cc5dbb3cad9b2304', name: 'items' })))));
|
|
123
123
|
}
|
|
124
124
|
_checkButtons(active = false) {
|
|
125
125
|
if (!this.applyChevron) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/dropdown/dropdown.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,UAAU,EACV,eAAe,EACf,IAAI,EACJ,MAAM,EAEN,KAAK,GAEL,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,GACL,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,sBAA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rategy,\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 { cva } from 'class-variance-authority';\nimport { childOfComposed } from '../../../utils/child-of';\n\nconst dropdownContainerClass = cva(['z-dropdown hidden'], {\n\tvariants: {\n\t\tstrategy: {\n\t\t\tabsolute: 'absolute',\n\t\t\tfixed: 'fixed',\n\t\t},\n\t\tfullWidth: {\n\t\t\tfalse: null,\n\t\t\ttrue: 'w-full',\n\t\t},\n\t\tmaxWidth: {\n\t\t\tfalse: null,\n\t\t\ttrue: 'max-w-[13.875rem]',\n\t\t},\n\t},\n\tcompoundVariants: [\n\t\t{\n\t\t\tfullWidth: false,\n\t\t\tmaxWidth: true,\n\t\t\tclass: 'w-auto',\n\t\t},\n\t],\n});\n\n@Component({\n\ttag: 'p-dropdown',\n\tstyleUrl: 'dropdown.component.css',\n\tshadow: true,\n})\nexport class Dropdown {\n\t/**\n\t * The variant of the dropdown\n\t */\n\t@Prop() variant: 'default' | 'storm' = 'default';\n\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 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 open the dropdown manually\n\t */\n\t@Prop() manual: 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 _menu: HTMLElement;\n\tprivate _cleanup: () => void;\n\n\tcomponentShouldUpdate() {\n\t\tthis._update();\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis._checkButtons();\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\tthis._checkItems();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class='relative'>\n\t\t\t\t<div\n\t\t\t\t\tclass='trigger'\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<div class='relative w-full'>\n\t\t\t\t\t<p-dropdown-menu-container\n\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\tmaxWidth={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\tclass={dropdownContainerClass({\n\t\t\t\t\t\t\tstrategy: this.strategy,\n\t\t\t\t\t\t\tmaxWidth: this.applyMaxWidth,\n\t\t\t\t\t\t\tfullWidth: this.applyFullWidth && !this.applyMaxWidth,\n\t\t\t\t\t\t})}\n\t\t\t\t\t\tref={el => this._load(el)}\n\t\t\t\t\t\tonClick={() => this._containerClickHandler()}\n\t\t\t\t\t\trole='popover'\n\t\t\t\t\t\tdata-placement={this.placement}\n\t\t\t\t\t\tdata-strategy={this.strategy}\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</div>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _checkButtons(active: boolean = false) {\n\t\tif (!this.applyChevron) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst buttons = this._el.querySelectorAll<HTMLPButtonElement>(\n\t\t\t'p-button[slot=\"trigger\"]'\n\t\t);\n\n\t\tconst isOpen = this._menu.getAttribute('data-show') !== null;\n\n\t\tfor (let button of [...buttons]) {\n\t\t\tbutton.disabled = this.disableTriggerClick;\n\t\t\tbutton.active = active;\n\n\t\t\tif (button.iconOnly) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tbutton.chevronPosition = this.chevronPosition;\n\t\t\tbutton.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? isOpen\n\t\t\t\t\t? 'down'\n\t\t\t\t\t: 'up'\n\t\t\t\t: isOpen\n\t\t\t\t? 'up'\n\t\t\t\t: 'down';\n\t\t}\n\t}\n\n\tprivate _checkItems() {\n\t\tconst items = this._el.querySelectorAll<HTMLPDropdownMenuItemElement>(\n\t\t\t'p-dropdown-menu-item'\n\t\t);\n\n\t\tfor (let item of [...items]) {\n\t\t\titem.variant = this.variant;\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(event) {\n\t\tif (\n\t\t\t!this._menu.hasAttribute('data-show') ||\n\t\t\tchildOfComposed(event, this._menu)\n\t\t) {\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.manual) {\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\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\t\tthis._checkButtons(true);\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\tthis._checkButtons(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"]}
|
|
1
|
+
{"version":3,"file":"dropdown.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/dropdown/dropdown.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,UAAU,EACV,eAAe,EACf,IAAI,EACJ,MAAM,EAEN,KAAK,GAEL,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,GACL,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,sBAAsB,GAAG,GAAG,CAAC,CAAC,mBAAmB,CAAC,EAAE;IACzD,QAAQ,EAAE;QACT,QAAQ,EAAE;YACT,QAAQ,EAAE,UAAU;YACpB,KAAK,EAAE,OAAO;SACd;QACD,SAAS,EAAE;YACV,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,QAAQ;SACd;QACD,QAAQ,EAAE;YACT,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,mBAAmB;SACzB;KACD;IACD,gBAAgB,EAAE;QACjB;YACC,SAAS,EAAE,KAAK;YAChB,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,QAAQ;SACf;KACD;C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,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;YAC/B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;YACzC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;gBAC/B,GAAG,EAAE,GAAG,CAAC,IAAI;gBACb,IAAI,EAAE,GAAG,CAAC,IAAI;aACd,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["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 { cva } from 'class-variance-authority';\nimport { childOfComposed } from '../../../utils/child-of';\n\nconst dropdownContainerClass = cva(['z-dropdown hidden'], {\n\tvariants: {\n\t\tstrategy: {\n\t\t\tabsolute: 'absolute',\n\t\t\tfixed: 'fixed',\n\t\t},\n\t\tfullWidth: {\n\t\t\tfalse: null,\n\t\t\ttrue: 'w-full',\n\t\t},\n\t\tmaxWidth: {\n\t\t\tfalse: null,\n\t\t\ttrue: 'max-w-[13.875rem]',\n\t\t},\n\t},\n\tcompoundVariants: [\n\t\t{\n\t\t\tfullWidth: false,\n\t\t\tmaxWidth: true,\n\t\t\tclass: 'w-auto',\n\t\t},\n\t],\n});\n\n@Component({\n\ttag: 'p-dropdown',\n\tstyleUrl: 'dropdown.component.css',\n\tshadow: true,\n})\nexport class Dropdown {\n\t/**\n\t * The variant of the dropdown\n\t */\n\t@Prop() variant: 'default' | 'storm' = 'default';\n\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 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 open the dropdown manually\n\t */\n\t@Prop() manual: 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 _menu: HTMLElement;\n\tprivate _cleanup: () => void;\n\n\tcomponentShouldUpdate() {\n\t\tthis._update();\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis._checkButtons();\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\tthis._checkItems();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class='relative'>\n\t\t\t\t<div\n\t\t\t\t\tclass='trigger'\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<div class='relative w-full'>\n\t\t\t\t\t<p-dropdown-menu-container\n\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\tmaxWidth={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\tclass={dropdownContainerClass({\n\t\t\t\t\t\t\tstrategy: this.strategy,\n\t\t\t\t\t\t\tmaxWidth: this.applyMaxWidth,\n\t\t\t\t\t\t\tfullWidth: this.applyFullWidth && !this.applyMaxWidth,\n\t\t\t\t\t\t})}\n\t\t\t\t\t\tref={el => this._load(el)}\n\t\t\t\t\t\tonClick={() => this._containerClickHandler()}\n\t\t\t\t\t\trole='popover'\n\t\t\t\t\t\tdata-placement={this.placement}\n\t\t\t\t\t\tdata-strategy={this.strategy}\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</div>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _checkButtons(active: boolean = false) {\n\t\tif (!this.applyChevron) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst buttons = this._el.querySelectorAll<HTMLPButtonElement>(\n\t\t\t'p-button[slot=\"trigger\"]'\n\t\t);\n\n\t\tconst isOpen = this._menu.getAttribute('data-show') !== null;\n\n\t\tfor (let button of [...buttons]) {\n\t\t\tbutton.disabled = this.disableTriggerClick;\n\t\t\tbutton.active = active;\n\n\t\t\tif (button.iconOnly) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tbutton.chevronPosition = this.chevronPosition;\n\t\t\tbutton.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? isOpen\n\t\t\t\t\t? 'down'\n\t\t\t\t\t: 'up'\n\t\t\t\t: isOpen\n\t\t\t\t? 'up'\n\t\t\t\t: 'down';\n\t\t}\n\t}\n\n\tprivate _checkItems() {\n\t\tconst items = this._el.querySelectorAll<HTMLPDropdownMenuItemElement>(\n\t\t\t'p-dropdown-menu-item'\n\t\t);\n\n\t\tfor (let item of [...items]) {\n\t\t\titem.variant = this.variant;\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(event) {\n\t\tif (\n\t\t\t!this._menu.hasAttribute('data-show') ||\n\t\t\tchildOfComposed(event, this._menu)\n\t\t) {\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.manual) {\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\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\t\tthis._checkButtons(true);\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\tthis._checkButtons(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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
*{box-sizing:border-box}:host{input[type=number]{-moz-appearance:textfield}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;display:none}}.static{position:static!important}.mt-1{margin-top:.25rem!important}.mt-2{margin-top:.5rem!important}.flex{display:flex!important}.h-6{height:1.5rem!important}.h-8{height:2rem!important}.h-full{height:100%!important}.min-h-4{min-height:1rem!important}.min-h-5{min-height:1.25rem!important}.w-inherit{width:inherit!important}.min-w-0{min-width:0!important}.flex-1{flex:1 1 0%!important}.flex-shrink-0{flex-shrink:0!important}.cursor-not-allowed{cursor:not-allowed!important}.flex-wrap{flex-wrap:wrap!important}.items-start{align-items:flex-start!important}.items-center{align-items:center!important}.justify-center{justify-content:center!important}.gap-2{gap:.5rem!important}.break-
|
|
1
|
+
*{box-sizing:border-box}:host{input[type=number]{-moz-appearance:textfield}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;display:none}}.static{position:static!important}.mt-1{margin-top:.25rem!important}.mt-2{margin-top:.5rem!important}.flex{display:flex!important}.h-6{height:1.5rem!important}.h-8{height:2rem!important}.h-full{height:100%!important}.min-h-4{min-height:1rem!important}.min-h-5{min-height:1.25rem!important}.w-inherit{width:inherit!important}.min-w-0{min-width:0!important}.flex-1{flex:1 1 0%!important}.flex-shrink-0{flex-shrink:0!important}.cursor-not-allowed{cursor:not-allowed!important}.flex-wrap{flex-wrap:wrap!important}.items-start{align-items:flex-start!important}.items-center{align-items:center!important}.justify-center{justify-content:center!important}.gap-2{gap:.5rem!important}.hyphens-auto{hyphens:auto!important}.break-normal{overflow-wrap:normal!important;word-break:normal!important}.rounded-lg{border-radius:.5rem!important}.border{border-width:1px!important}.border-0{border-width:0!important}.border-solid{border-style:solid!important}.border-none{border-style:none!important}.border-indigo-600{--tw-border-opacity:1!important;border-color:rgb(82 138 250/var(--tw-border-opacity,1))!important}.border-negative-red-500{--tw-border-opacity:1!important;border-color:rgb(230 30 30/var(--tw-border-opacity,1))!important}.border-storm-100{--tw-border-opacity:1!important;border-color:rgb(209 210 212/var(--tw-border-opacity,1))!important}.bg-transparent{background-color:transparent!important}.bg-white{background-color:rgb(255 255 255/var(--tw-bg-opacity,1))!important}.bg-white,.bg-white-600{--tw-bg-opacity:1!important}.bg-white-600{background-color:rgb(250 250 250/var(--tw-bg-opacity,1))!important}.p-0{padding:0!important}.px-2{padding-left:.5rem!important;padding-right:.5rem!important}.text-center{text-align:center!important}.font-geist{font-family:Geist,serif!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-xs{font-size:.75rem!important;line-height:1rem!important}.leading-6{line-height:1.5rem!important}.text-negative-red-500{--tw-text-opacity:1!important;color:rgb(230 30 30/var(--tw-text-opacity,1))!important}.text-negative-red-800{--tw-text-opacity:1!important;color:rgb(141 16 16/var(--tw-text-opacity,1))!important}.text-storm-100{--tw-text-opacity:1!important;color:rgb(209 210 212/var(--tw-text-opacity,1))!important}.text-storm-300{--tw-text-opacity:1!important;color:rgb(116 120 127/var(--tw-text-opacity,1))!important}.text-storm-500{--tw-text-opacity:1!important;color:rgb(24 30 41/var(--tw-text-opacity,1))!important}.outline-none{outline:2px solid transparent!important;outline-offset:2px!important}.ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)!important;--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color)!important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)!important}.ring-indigo-100{--tw-ring-opacity:1!important;--tw-ring-color:rgb(227 236 254/var(--tw-ring-opacity,1))!important}.ring-negative-red-50{--tw-ring-opacity:1!important;--tw-ring-color:rgb(253 237 237/var(--tw-ring-opacity,1))!important}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:85.375rem){.container{max-width:85.375rem}}@media (min-width:90rem){.container{max-width:90rem}}@media (min-width:96rem){.container{max-width:96rem}}@media (min-width:105rem){.container{max-width:105rem}}@media (min-width:120rem){.container{max-width:120rem}}@media (min-width:160rem){.container{max-width:160rem}}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.selection\:bg-indigo-500 ::selection{--tw-bg-opacity:1!important;background-color:rgb(142 179 251/var(--tw-bg-opacity,1))!important}.selection\:bg-negative-red-50 ::selection{--tw-bg-opacity:1!important;background-color:rgb(253 237 237/var(--tw-bg-opacity,1))!important}.selection\:bg-indigo-500::selection{--tw-bg-opacity:1!important;background-color:rgb(142 179 251/var(--tw-bg-opacity,1))!important}.selection\:bg-negative-red-50::selection{--tw-bg-opacity:1!important;background-color:rgb(253 237 237/var(--tw-bg-opacity,1))!important}.placeholder\:text-sm::placeholder{font-size:.875rem!important;line-height:1.25rem!important}.placeholder\:text-storm-500\/40::placeholder{color:rgba(24,30,41,.4)!important}.focus\:outline-none:focus{outline:2px solid transparent!important;outline-offset:2px!important}.dark\:border-hurricane-400:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-border-opacity:1!important;border-color:rgb(70 75 84/var(--tw-border-opacity,1))!important}.dark\:border-hurricane-500:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-border-opacity:1!important;border-color:rgb(54 60 70/var(--tw-border-opacity,1))!important}.dark\:bg-hurricane-500:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1!important;background-color:rgb(54 60 70/var(--tw-bg-opacity,1))!important}.dark\:bg-hurricane-600:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1!important;background-color:rgb(46 52 62/var(--tw-bg-opacity,1))!important}.dark\:text-hurricane-300:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1!important;color:rgb(116 120 127/var(--tw-text-opacity,1))!important}.dark\:text-hurricane-400:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1!important;color:rgb(70 75 84/var(--tw-text-opacity,1))!important}.dark\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}.dark\:ring-0:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)!important;--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color)!important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)!important}.dark\:placeholder\:text-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *)::placeholder{--tw-text-opacity:1!important;color:rgb(163 165 169/var(--tw-text-opacity,1))!important}.dark\:border-hurricane-400:where([data-theme=dark],[data-theme=dark] *){--tw-border-opacity:1!important;border-color:rgb(70 75 84/var(--tw-border-opacity,1))!important}.dark\:border-hurricane-500:where([data-theme=dark],[data-theme=dark] *){--tw-border-opacity:1!important;border-color:rgb(54 60 70/var(--tw-border-opacity,1))!important}.dark\:bg-hurricane-500:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1!important;background-color:rgb(54 60 70/var(--tw-bg-opacity,1))!important}.dark\:bg-hurricane-600:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1!important;background-color:rgb(46 52 62/var(--tw-bg-opacity,1))!important}.dark\:text-hurricane-300:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1!important;color:rgb(116 120 127/var(--tw-text-opacity,1))!important}.dark\:text-hurricane-400:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1!important;color:rgb(70 75 84/var(--tw-text-opacity,1))!important}.dark\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}.dark\:ring-0:where([data-theme=dark],[data-theme=dark] *){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)!important;--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color)!important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)!important}.dark\:placeholder\:text-hurricane-200:where([data-theme=dark],[data-theme=dark] *)::placeholder{--tw-text-opacity:1!important;color:rgb(163 165 169/var(--tw-text-opacity,1))!important}
|
|
@@ -7,7 +7,7 @@ import { ThemedHost } from "../../../../internal/themed-host.component";
|
|
|
7
7
|
const field = cva(['flex gap-2', 'w-inherit', 'border-solid rounded-lg'], {
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
10
|
-
read: 'border-0 items-start flex-wrap break-
|
|
10
|
+
read: 'border-0 items-start flex-wrap hyphens-auto break-normal leading-6',
|
|
11
11
|
write: 'border px-2',
|
|
12
12
|
},
|
|
13
13
|
size: {
|
|
@@ -325,8 +325,8 @@ export class Field {
|
|
|
325
325
|
}
|
|
326
326
|
render() {
|
|
327
327
|
const { id, prefix, suffix, hasHeaderSlot, hasLabelSlot, hasHelperSlot, hasErrorSlot, hasValueSlot, } = this._getSlotInfo();
|
|
328
|
-
return (h(ThemedHost, { key: '
|
|
329
|
-
(!!this.error?.length && this.forceShowTooltip), id: id, label: this.label, align: this.align, loading: this.loading, loadingSize: this.size, helper: this.helper, error: this.error, required: this.required, showOptional: this.showOptional, variant: this.variant }, hasLabelSlot && (h("slot", { key: '
|
|
328
|
+
return (h(ThemedHost, { key: '6070034039c7877d3e1de5ded93f60159fccfa04' }, h("p-field-container", { key: '68c3638db87c41fd5665547f45e8f2d51ee63b53', forceShowTooltip: (!!this.error?.length && !this._focused && this.autoShowError) ||
|
|
329
|
+
(!!this.error?.length && this.forceShowTooltip), id: id, label: this.label, align: this.align, loading: this.loading, loadingSize: this.size, helper: this.helper, error: this.error, required: this.required, showOptional: this.showOptional, variant: this.variant }, hasLabelSlot && (h("slot", { key: '8affa6f6debb6251390e13e1faeccf96a31bd648', name: 'label', slot: 'label' })), hasHeaderSlot && (h("slot", { key: 'dee6f4e518607c82d6e524e3da8121e257865977', name: 'header', slot: 'header' })), hasHelperSlot && (h("slot", { key: '4484e7e481039570af17f6d95c8658bac05e583e', name: 'helper', slot: 'helper' })), hasErrorSlot && (h("slot", { key: '3301e280c6fe2be0353a9b83e1b898f88f69a2cd', name: 'error', slot: 'error' })), h("div", { key: '2f8830adf236fe127ce9f0c55c1781a50e5529b0', class: field({
|
|
330
330
|
error: !!this.error?.length,
|
|
331
331
|
disabled: asBoolean(this.disabled),
|
|
332
332
|
focused: asBoolean(this.focused) || this._focused,
|
|
@@ -337,7 +337,7 @@ export class Field {
|
|
|
337
337
|
? `${this.value}`
|
|
338
338
|
: undefined, slot: 'content' }, (this.error?.length ||
|
|
339
339
|
prefix ||
|
|
340
|
-
(this.icon && this.iconPosition === 'start')) && (h("div", { key: '
|
|
340
|
+
(this.icon && this.iconPosition === 'start')) && (h("div", { key: '6be4f7969b64a3e1a5df732205d9b290eb9c23b5', class: prefixAndSuffix({
|
|
341
341
|
variant: this.variant,
|
|
342
342
|
error: !!this.error?.length,
|
|
343
343
|
disabled: asBoolean(this.disabled),
|
|
@@ -347,7 +347,7 @@ export class Field {
|
|
|
347
347
|
}), onClick: () => this._focusInput() }, (this.icon && this.iconPosition === 'start') ||
|
|
348
348
|
this.error?.length ? (h("p-icon", { class: cn('flex', {
|
|
349
349
|
'mt-1': this.variant === 'read' && this.size === 'base',
|
|
350
|
-
}), variant: this.error?.length ? 'warning' : this.icon, rotate: this.iconRotate, flip: this.iconFlip })) : (prefix))), this._getContent(hasValueSlot, id), (suffix || (this.icon && this.iconPosition === 'end')) && (h("div", { key: '
|
|
350
|
+
}), variant: this.error?.length ? 'warning' : this.icon, rotate: this.iconRotate, flip: this.iconFlip })) : (prefix))), this._getContent(hasValueSlot, id), (suffix || (this.icon && this.iconPosition === 'end')) && (h("div", { key: 'c276c5883ee1eafdeda0d4db0b5e2ab30d02396d', class: prefixAndSuffix({
|
|
351
351
|
variant: this.variant,
|
|
352
352
|
error: !!this.error?.length,
|
|
353
353
|
disabled: asBoolean(this.disabled),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.component.js","sourceRoot":"","sources":["../../../../../src/components/molecules/field/field/field.component.tsx"],"names":[],"mappings":"AACA,OAAO,EACN,eAAe,EACf,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,GACL,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAG/C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,EAAE,EAAE,MAAM,sBAAsB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAMhD,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAExE,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,YAAY,EAAE,WAAW,EAAE,yBAAyB,CAAC,EAAE;IACzE,QAAQ,EAAE;QACT,OAAO,EAAE;YACR,IAAI,EAAE,oDAAoD;YAC1D,KAAK,EAAE,aAAa;SACpB;QACD,IAAI,EAAE;YACL,EAAE,EAAE,IAAI;YACR,IAAI,EAAE,IAAI;SACV;QACD,QAAQ,EAAE;YACT,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,IAAI;SACV;QACD,OAAO,EAAE;YACR,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,IAAI;SACV;QACD,KAAK,EAAE;YACN,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,IAAI;SACV;QACD,U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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Placement } from '@floating-ui/dom';\nimport {\n\tAttachInternals,\n\tComponent,\n\tElement,\n\tEvent,\n\tEventEmitter,\n\th,\n\tListen,\n\tProp,\n\tState,\n\tWatch,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { HTMLInputTypeAttribute } from 'react';\nimport { RotateOptions } from '../../../../types/tailwind';\nimport { asBoolean } from '../../../../utils/as-boolean';\nimport { cn } from '../../../../utils/cn';\nimport { nonce } from '../../../../utils/nonce';\nimport {\n\tIconFlipOptions,\n\tIconVariant,\n} from '../../../atoms/icon/icon.component';\nimport { templateFunc } from '../container/field-container.component';\nimport { ThemedHost } from '../../../../internal/themed-host.component';\n\nconst field = cva(['flex gap-2', 'w-inherit', 'border-solid rounded-lg'], {\n\tvariants: {\n\t\tvariant: {\n\t\t\tread: 'border-0 items-start flex-wrap break-all leading-6',\n\t\t\twrite: 'border px-2',\n\t\t},\n\t\tsize: {\n\t\t\tsm: null,\n\t\t\tbase: null,\n\t\t},\n\t\tdisabled: {\n\t\t\tfalse: null,\n\t\t\ttrue: null,\n\t\t},\n\t\tfocused: {\n\t\t\tfalse: null,\n\t\t\ttrue: null,\n\t\t},\n\t\terror: {\n\t\t\tfalse: null,\n\t\t\ttrue: null,\n\t\t},\n\t\tisTextarea: {\n\t\t\tfalse: null,\n\t\t\ttrue: 'items-start',\n\t\t},\n\t},\n\tcompoundVariants: [\n\t\t{\n\t\t\tsize: 'sm',\n\t\t\tvariant: 'write',\n\t\t\tisTextarea: false,\n\t\t\tclass: 'h-6',\n\t\t},\n\t\t{\n\t\t\tsize: 'base',\n\t\t\tvariant: 'write',\n\t\t\tisTextarea: false,\n\t\t\tclass: 'h-8',\n\t\t},\n\n\t\t{\n\t\t\tsize: 'sm',\n\t\t\tvariant: 'read',\n\t\t\tclass: 'min-h-4 text-xs',\n\t\t},\n\t\t{\n\t\t\tsize: 'base',\n\t\t\tvariant: 'read',\n\t\t\tclass: 'min-h-5 text-sm',\n\t\t},\n\n\t\t{\n\t\t\tvariant: 'write',\n\t\t\tfocused: false,\n\t\t\terror: false,\n\t\t\tclass: 'border-storm-100 dark:border-hurricane-400',\n\t\t},\n\t\t{\n\t\t\tvariant: 'write',\n\t\t\tdisabled: false,\n\t\t\tfocused: true,\n\t\t\terror: false,\n\t\t\tclass:\n\t\t\t\t'border-indigo-600 ring dark:ring-0 ring-indigo-100 selection:bg-indigo-500',\n\t\t},\n\n\t\t{\n\t\t\tvariant: 'write',\n\t\t\tdisabled: false,\n\t\t\tclass: 'bg-white dark:bg-hurricane-500',\n\t\t},\n\t\t{\n\t\t\tvariant: 'write',\n\t\t\tdisabled: true,\n\t\t\tclass:\n\t\t\t\t'bg-white-600 dark:bg-hurricane-600 dark:border-hurricane-500 cursor-not-allowed',\n\t\t},\n\n\t\t{\n\t\t\tdisabled: false,\n\t\t\terror: true,\n\t\t\tclass: 'border-negative-red-500',\n\t\t},\n\t\t{\n\t\t\tdisabled: false,\n\t\t\tfocused: true,\n\t\t\terror: true,\n\t\t\tclass:\n\t\t\t\t'ring ring-negative-red-50 selection:bg-negative-red-50 dark:ring-0',\n\t\t},\n\t],\n});\n\nconst input = cva(\n\t[\n\t\t'text-sm placeholder:text-sm placeholder:text-storm-500/40 dark:placeholder:text-hurricane-200',\n\t\t'border-none bg-transparent flex-1 min-w-0 p-0',\n\t\t'outline-none focus:outline-none',\n\t\t'font-geist',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tisTextarea: {\n\t\t\t\tfalse: 'h-full',\n\t\t\t\ttrue: 'mt-1',\n\t\t\t},\n\t\t\tdisabled: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: 'cursor-not-allowed',\n\t\t\t},\n\t\t\terror: {\n\t\t\t\tfalse: 'text-storm-500 dark:text-white',\n\t\t\t\ttrue: 'text-negative-red-500',\n\t\t\t},\n\t\t},\n\t}\n);\n\nconst prefixAndSuffix = cva(\n\t['flex flex-shrink-0 justify-center items-center text-center'],\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tread: 'leading-6',\n\t\t\t\twrite: null,\n\t\t\t},\n\t\t\tdisabled: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: 'text-storm-100 dark:text-hurricane-400',\n\t\t\t},\n\t\t\tfocused: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: null,\n\t\t\t},\n\t\t\terror: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: null,\n\t\t\t},\n\t\t\tisText: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: 'text-sm',\n\t\t\t},\n\t\t\tisTextarea: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: 'mt-2',\n\t\t\t},\n\t\t},\n\t\tcompoundVariants: [\n\t\t\t{\n\t\t\t\tdisabled: false,\n\t\t\t\tfocused: false,\n\t\t\t\terror: false,\n\t\t\t\tclass: 'text-storm-300 dark:text-hurricane-300',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tdisabled: false,\n\t\t\t\tfocused: true,\n\t\t\t\terror: false,\n\t\t\t\tclass: 'text-storm-500 dark:text-white',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tdisabled: false,\n\t\t\t\tfocused: false,\n\t\t\t\terror: true,\n\t\t\t\tclass: 'text-negative-red-500',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tdisabled: false,\n\t\t\t\tfocused: true,\n\t\t\t\terror: true,\n\t\t\t\tclass: 'text-negative-red-800',\n\t\t\t},\n\t\t],\n\t}\n);\n\n@Component({\n\ttag: 'p-field',\n\tstyleUrl: './field.component.css',\n\tshadow: true,\n\tformAssociated: true,\n})\nexport class Field {\n\t/**\n\t * The alignment of the container\n\t */\n\t@Prop() align: 'start' | 'end' = 'start';\n\n\t/**\n\t * The variant of the field\n\t */\n\t@Prop() variant: 'read' | 'write' = 'write';\n\n\t/**\n\t * The id of the field\n\t */\n\t@Prop() id: string;\n\n\t/**\n\t * The size of the field\n\t */\n\t@Prop() size: 'sm' | 'base' = 'base';\n\n\t/**\n\t * The type of the field\n\t */\n\t@Prop() type: HTMLInputTypeAttribute | 'textarea' | 'slot' = 'text';\n\n\t/**\n\t * The size of the field\n\t */\n\t@Prop() properties: any | string = {};\n\n\t/**\n\t * The prefix of the field\n\t */\n\t@Prop() prefix: string;\n\n\t/**\n\t * The suffix of the field\n\t */\n\t@Prop() suffix: string;\n\n\t/**\n\t * Icon of the field\n\t */\n\t@Prop() icon: IconVariant;\n\n\t/**\n\t * Icon flip */\n\t@Prop() iconFlip: IconFlipOptions;\n\n\t/**\n\t * Icon rotate\n\t */\n\t@Prop() iconRotate: RotateOptions;\n\n\t/**\n\t * Icon position\n\t */\n\t@Prop() iconPosition: 'start' | 'end' = 'start';\n\n\t/**\n\t * The value of the input\n\t */\n\t@Prop() value: string | number;\n\n\t/**\n\t * The label of the field\n\t */\n\t@Prop() label: string;\n\n\t/**\n\t * Wether the field is in loading state\n\t */\n\t@Prop() loading: boolean = false;\n\n\t/**\n\t * The placeholder of the input\n\t */\n\t@Prop() placeholder: string;\n\n\t/**\n\t * The helper of the field\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 = true;\n\n\t/**\n\t * Wether to show optional when not required\n\t */\n\t@Prop({ reflect: true }) showOptional: boolean = true;\n\n\t/**\n\t * Wether to show an add button when empty\n\t */\n\t@Prop({ reflect: true }) showAddOnEmpty: boolean = false;\n\n\t/**\n\t * The text to show on the add button\n\t */\n\t@Prop({ reflect: true }) addText: string = 'Add';\n\n\t/**\n\t * Wether to autofocus the field\n\t */\n\t@Prop({ reflect: true }) autofocus: boolean = false;\n\n\t/**\n\t * The error to display\n\t */\n\t@Prop({ reflect: true }) error: string;\n\n\t/**\n\t * Wether this component handles showing the error tooltip\n\t */\n\t@Prop({ reflect: true }) autoShowError = true;\n\n\t/**\n\t * The placement of the error popover\n\t */\n\t@Prop() errorPlacement: Placement;\n\n\t/**\n\t * Wether the field is disabled\n\t */\n\t@Prop({ reflect: true }) disabled: boolean = false;\n\n\t/**\n\t * Wether the field is focused\n\t */\n\t@Prop({ reflect: true }) focused: boolean = false;\n\n\t/**\n\t * Force show the error tooltip\n\t */\n\t@Prop({ reflect: true }) forceShowTooltip: boolean = false;\n\n\t/**\n\t * Wether to select all text on focus\n\t */\n\t@Prop({ reflect: true }) selectAllOnFocus: boolean = true;\n\n\t/**\n\t * The method to use when focusing the input\n\t */\n\t@Prop() focusMethod: 'focus' | 'click' = 'focus';\n\n\t/**\n\t * The template for the optional text\n\t */\n\t@Prop() optionalTemplate: templateFunc;\n\n\t/**\n\t * Event whenever the value changes\n\t */\n\t@Event({ bubbles: false }) valueChange: EventEmitter<string | number>;\n\n\t/**\n\t * Event whenever the input ref changes\n\t */\n\t@Event() inputRefChange: EventEmitter<HTMLInputElement | HTMLTextAreaElement>;\n\n\t/**\n\t * Event whenever the value changes\n\t */\n\t@Event({ bubbles: false }) add: EventEmitter<void>;\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _focused = false;\n\t@State() private _nonce = nonce(5);\n\n\t@AttachInternals() _internals: ElementInternals;\n\n\tprivate _inputRef: HTMLInputElement | HTMLTextAreaElement;\n\tprivate _lastValue: string | number | null;\n\n\tcomponentDidLoad() {\n\t\tthis._checkAutoFocus();\n\t}\n\n\tformResetCallback() {\n\t\tthis.value = null;\n\t\tthis.valueChange.emit(null);\n\t}\n\n\tformDisabledCallback(disabled: boolean) {\n\t\tif (!this._internals.form) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.disabled = disabled;\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tid,\n\t\t\tprefix,\n\t\t\tsuffix,\n\t\t\thasHeaderSlot,\n\t\t\thasLabelSlot,\n\t\t\thasHelperSlot,\n\t\t\thasErrorSlot,\n\t\t\thasValueSlot,\n\t\t} = this._getSlotInfo();\n\n\t\treturn (\n\t\t\t<ThemedHost>\n\t\t\t\t<p-field-container\n\t\t\t\t\tforceShowTooltip={\n\t\t\t\t\t\t(!!this.error?.length && !this._focused && this.autoShowError) ||\n\t\t\t\t\t\t(!!this.error?.length && this.forceShowTooltip)\n\t\t\t\t\t}\n\t\t\t\t\tid={id}\n\t\t\t\t\tlabel={this.label}\n\t\t\t\t\talign={this.align}\n\t\t\t\t\tloading={this.loading}\n\t\t\t\t\tloadingSize={this.size}\n\t\t\t\t\thelper={this.helper}\n\t\t\t\t\terror={this.error}\n\t\t\t\t\trequired={this.required}\n\t\t\t\t\tshowOptional={this.showOptional}\n\t\t\t\t\tvariant={this.variant}\n\t\t\t\t>\n\t\t\t\t\t{hasLabelSlot && (\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\tname='label'\n\t\t\t\t\t\t\tslot='label'\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{hasHeaderSlot && (\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\tname='header'\n\t\t\t\t\t\t\tslot='header'\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{hasHelperSlot && (\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\tname='helper'\n\t\t\t\t\t\t\tslot='helper'\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{hasErrorSlot && (\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\tname='error'\n\t\t\t\t\t\t\tslot='error'\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass={field({\n\t\t\t\t\t\t\terror: !!this.error?.length,\n\t\t\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\t\t\tfocused: asBoolean(this.focused) || this._focused,\n\t\t\t\t\t\t\tsize: this.size,\n\t\t\t\t\t\t\tvariant: this.variant,\n\t\t\t\t\t\t\tisTextarea: this.type === 'textarea',\n\t\t\t\t\t\t})}\n\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\tthis.variant === 'read' && !hasValueSlot\n\t\t\t\t\t\t\t\t? `${this.value}`\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tslot='content'\n\t\t\t\t\t>\n\t\t\t\t\t\t{(this.error?.length ||\n\t\t\t\t\t\t\tprefix ||\n\t\t\t\t\t\t\t(this.icon && this.iconPosition === 'start')) && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclass={prefixAndSuffix({\n\t\t\t\t\t\t\t\t\tvariant: this.variant,\n\t\t\t\t\t\t\t\t\terror: !!this.error?.length,\n\t\t\t\t\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\t\t\t\t\tfocused: asBoolean(this.focused) || this._focused,\n\t\t\t\t\t\t\t\t\tisText: typeof suffix === 'string',\n\t\t\t\t\t\t\t\t\tisTextarea: this.type === 'textarea',\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\tonClick={() => this._focusInput()}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{(this.icon && this.iconPosition === 'start') ||\n\t\t\t\t\t\t\t\tthis.error?.length ? (\n\t\t\t\t\t\t\t\t\t<p-icon\n\t\t\t\t\t\t\t\t\t\tclass={cn('flex', {\n\t\t\t\t\t\t\t\t\t\t\t'mt-1': this.variant === 'read' && this.size === 'base',\n\t\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t\t\tvariant={this.error?.length ? 'warning' : this.icon}\n\t\t\t\t\t\t\t\t\t\trotate={this.iconRotate}\n\t\t\t\t\t\t\t\t\t\tflip={this.iconFlip}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\tprefix\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{this._getContent(hasValueSlot, id)}\n\n\t\t\t\t\t\t{(suffix || (this.icon && this.iconPosition === 'end')) && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclass={prefixAndSuffix({\n\t\t\t\t\t\t\t\t\tvariant: this.variant,\n\t\t\t\t\t\t\t\t\terror: !!this.error?.length,\n\t\t\t\t\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\t\t\t\t\tfocused: asBoolean(this.focused) || this._focused,\n\t\t\t\t\t\t\t\t\tisText: typeof suffix === 'string',\n\t\t\t\t\t\t\t\t\tisTextarea: this.type === 'textarea',\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\tonClick={() => this._focusInput()}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{this.icon && this.iconPosition === 'end' ? (\n\t\t\t\t\t\t\t\t\t<p-icon\n\t\t\t\t\t\t\t\t\t\tclass={cn('flex', {\n\t\t\t\t\t\t\t\t\t\t\t'mt-1': this.variant === 'read' && this.size === 'base',\n\t\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t\t\tvariant={this.icon}\n\t\t\t\t\t\t\t\t\t\trotate={this.iconRotate}\n\t\t\t\t\t\t\t\t\t\tflip={this.iconFlip}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\tsuffix\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</p-field-container>\n\t\t\t</ThemedHost>\n\t\t);\n\t}\n\n\t@Watch('value')\n\twatchvalue(value: string | null) {\n\t\tif (!this._inputRef) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (value === this._lastValue) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._lastValue = value;\n\t\tthis._inputRef.value = value;\n\t}\n\n\t@Listen('focusin')\n\thandleFocusIn() {\n\t\tif (this.disabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._focused = true;\n\t\tthis._selectAll();\n\t}\n\n\t@Listen('focusout')\n\thandleFocusOut() {\n\t\tif (this.disabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._focused = false;\n\t}\n\n\t@Listen('keyup', { capture: true })\n\thandleKeyup(ev: KeyboardEvent) {\n\t\tif (this.disabled) {\n\t\t\tev.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._internals?.form) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.type === 'textarea' || ev.key !== 'Enter') {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._internals.form.requestSubmit();\n\t}\n\n\tprivate _getSlotInfo() {\n\t\tconst hasHelperSlot = !!this._el.querySelector(':scope > [slot=\"helper\"]');\n\t\tconst hasLabelSlot = !!this._el.querySelector(':scope > [slot=\"label\"]');\n\t\tconst hasPrefixSlot = !!this._el.querySelector(':scope > [slot=\"prefix\"]');\n\t\tconst hasSuffixSlot = !!this._el.querySelector(':scope > [slot=\"suffix\"]');\n\t\tconst hasHeaderSlot = !!this._el.querySelector(':scope > [slot=\"header\"]');\n\t\tconst hasErrorSlot = !!this._el.querySelector(':scope > [slot=\"error\"]');\n\t\tconst hasValueSlot = !!this._el.querySelector(':scope > [slot=\"value\"]');\n\n\t\tconst prefix = hasPrefixSlot ? <slot name='prefix' /> : this.prefix;\n\t\tconst suffix = hasSuffixSlot ? <slot name='suffix' /> : this.suffix;\n\n\t\tconst errorAndErrorIsNotBoolean =\n\t\t\tthis.error && typeof this.error === 'string' && this.error !== 'true';\n\n\t\tconst id = this.id?.length ? this.id : this._nonce;\n\n\t\treturn {\n\t\t\tid,\n\t\t\thasHelperSlot,\n\t\t\thasLabelSlot,\n\t\t\thasPrefixSlot,\n\t\t\thasSuffixSlot,\n\t\t\thasHeaderSlot,\n\t\t\thasErrorSlot,\n\t\t\thasValueSlot,\n\t\t\tprefix,\n\t\t\tsuffix,\n\t\t\terrorAndErrorIsNotBoolean,\n\t\t};\n\t}\n\n\tprivate _getContent(hasValueSlot = false, id: string) {\n\t\tif (this.variant === 'read') {\n\t\t\treturn hasValueSlot ? (\n\t\t\t\t<slot name='value' />\n\t\t\t) : !!this.value && `${this.value}`.length > 0 ? (\n\t\t\t\tthis.value\n\t\t\t) : this.showAddOnEmpty ? (\n\t\t\t\t<p-button\n\t\t\t\t\tvariant='text'\n\t\t\t\t\ticon='plus'\n\t\t\t\t\tsize='sm'\n\t\t\t\t\tonClick={() => this.add.emit()}\n\t\t\t\t>\n\t\t\t\t\t{this.addText}\n\t\t\t\t</p-button>\n\t\t\t) : (\n\t\t\t\t'—'\n\t\t\t);\n\t\t}\n\n\t\tif (this.type === 'slot') {\n\t\t\treturn <slot name='input' />;\n\t\t}\n\n\t\tconst props = {\n\t\t\tid,\n\t\t\tclass: input({\n\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\tisTextarea: this.type === 'textarea',\n\t\t\t\terror: !!this.error?.length,\n\t\t\t}),\n\t\t\tvalue: this.value,\n\t\t\tplaceholder: this.placeholder,\n\t\t\tdisabled: this.disabled,\n\t\t\tonInput: (ev: InputEvent) => this._valueChange(ev),\n\t\t};\n\n\t\tlet properties = this.properties ?? {};\n\t\tif (typeof properties === 'string') {\n\t\t\tproperties = JSON.parse(this.properties);\n\t\t}\n\n\t\tif (this.type === 'textarea') {\n\t\t\treturn (\n\t\t\t\t<textarea\n\t\t\t\t\tref={ref => this._setInputRef(ref)}\n\t\t\t\t\t{...props}\n\t\t\t\t\t{...properties}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<input\n\t\t\t\ttype={this.type}\n\t\t\t\tref={ref => this._setInputRef(ref)}\n\t\t\t\t{...props}\n\t\t\t\t{...properties}\n\t\t\t/>\n\t\t);\n\t}\n\n\tprivate _setInputRef(ref: HTMLInputElement | HTMLTextAreaElement) {\n\t\tthis._inputRef = ref;\n\t\tthis.inputRefChange.emit(ref);\n\t}\n\n\tprivate _focusInput() {\n\t\tif (this._inputRef) {\n\t\t\tthis._inputRef.focus();\n\t\t\treturn;\n\t\t}\n\n\t\tconst input = this._el.querySelector(':scope > [slot=\"input\"]');\n\t\t(input as HTMLElement)[this.focusMethod]();\n\t}\n\n\tprivate _selectAll() {\n\t\tif (!this._inputRef || !this.selectAllOnFocus) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._inputRef.select();\n\t}\n\n\tprivate _valueChange(ev) {\n\t\tev.stopPropagation();\n\t\tconst target = (ev.originalTarget ?? ev.target) as\n\t\t\t| HTMLTextAreaElement\n\t\t\t| HTMLInputElement;\n\n\t\tconst value = target.value;\n\n\t\tthis._lastValue = value;\n\t\tthis.value = value;\n\t\tthis.valueChange.emit(value);\n\t\tthis._internals.setFormValue(target.value);\n\t}\n\n\tprivate _checkAutoFocus() {\n\t\tif (!this.autofocus) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._inputRef) {\n\t\t\tsetTimeout(() => this._checkAutoFocus(), 100);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._focusInput();\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"field.component.js","sourceRoot":"","sources":["../../../../../src/components/molecules/field/field/field.component.tsx"],"names":[],"mappings":"AACA,OAAO,EACN,eAAe,EACf,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,GACL,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAG/C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,EAAE,EAAE,MAAM,sBAAsB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAMhD,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAExE,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,YAAY,EAAE,WAAW,EAAE,yBAAyB,CAAC,EAAE;IACzE,QAAQ,EAAE;QACT,OAAO,EAAE;YACR,IAAI,EAAE,oEAAoE;YAC1E,KAAK,EAAE,aAAa;SACpB;QACD,IAAI,EAAE;YACL,EAAE,EAAE,IAAI;YACR,IAAI,EAAE,IAAI;SACV;QACD,QAAQ,EAAE;YACT,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,IAAI;SACV;QACD,OAAO,EAAE;YACR,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,IAAI;SACV;QACD,KAAK,EAAE;YACN,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,IAAI;SACV;QACD,UAAU,EAAE;YACX,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,aAAa;SACnB;KACD;IACD,gBAAgB,EAAE;QACjB;YACC,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,OAAO;YAChB,UAAU,EAAE,KAAK;YACjB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Placement } from '@floating-ui/dom';\nimport {\n\tAttachInternals,\n\tComponent,\n\tElement,\n\tEvent,\n\tEventEmitter,\n\th,\n\tListen,\n\tProp,\n\tState,\n\tWatch,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { HTMLInputTypeAttribute } from 'react';\nimport { RotateOptions } from '../../../../types/tailwind';\nimport { asBoolean } from '../../../../utils/as-boolean';\nimport { cn } from '../../../../utils/cn';\nimport { nonce } from '../../../../utils/nonce';\nimport {\n\tIconFlipOptions,\n\tIconVariant,\n} from '../../../atoms/icon/icon.component';\nimport { templateFunc } from '../container/field-container.component';\nimport { ThemedHost } from '../../../../internal/themed-host.component';\n\nconst field = cva(['flex gap-2', 'w-inherit', 'border-solid rounded-lg'], {\n\tvariants: {\n\t\tvariant: {\n\t\t\tread: 'border-0 items-start flex-wrap hyphens-auto break-normal leading-6',\n\t\t\twrite: 'border px-2',\n\t\t},\n\t\tsize: {\n\t\t\tsm: null,\n\t\t\tbase: null,\n\t\t},\n\t\tdisabled: {\n\t\t\tfalse: null,\n\t\t\ttrue: null,\n\t\t},\n\t\tfocused: {\n\t\t\tfalse: null,\n\t\t\ttrue: null,\n\t\t},\n\t\terror: {\n\t\t\tfalse: null,\n\t\t\ttrue: null,\n\t\t},\n\t\tisTextarea: {\n\t\t\tfalse: null,\n\t\t\ttrue: 'items-start',\n\t\t},\n\t},\n\tcompoundVariants: [\n\t\t{\n\t\t\tsize: 'sm',\n\t\t\tvariant: 'write',\n\t\t\tisTextarea: false,\n\t\t\tclass: 'h-6',\n\t\t},\n\t\t{\n\t\t\tsize: 'base',\n\t\t\tvariant: 'write',\n\t\t\tisTextarea: false,\n\t\t\tclass: 'h-8',\n\t\t},\n\n\t\t{\n\t\t\tsize: 'sm',\n\t\t\tvariant: 'read',\n\t\t\tclass: 'min-h-4 text-xs',\n\t\t},\n\t\t{\n\t\t\tsize: 'base',\n\t\t\tvariant: 'read',\n\t\t\tclass: 'min-h-5 text-sm',\n\t\t},\n\n\t\t{\n\t\t\tvariant: 'write',\n\t\t\tfocused: false,\n\t\t\terror: false,\n\t\t\tclass: 'border-storm-100 dark:border-hurricane-400',\n\t\t},\n\t\t{\n\t\t\tvariant: 'write',\n\t\t\tdisabled: false,\n\t\t\tfocused: true,\n\t\t\terror: false,\n\t\t\tclass:\n\t\t\t\t'border-indigo-600 ring dark:ring-0 ring-indigo-100 selection:bg-indigo-500',\n\t\t},\n\n\t\t{\n\t\t\tvariant: 'write',\n\t\t\tdisabled: false,\n\t\t\tclass: 'bg-white dark:bg-hurricane-500',\n\t\t},\n\t\t{\n\t\t\tvariant: 'write',\n\t\t\tdisabled: true,\n\t\t\tclass:\n\t\t\t\t'bg-white-600 dark:bg-hurricane-600 dark:border-hurricane-500 cursor-not-allowed',\n\t\t},\n\n\t\t{\n\t\t\tdisabled: false,\n\t\t\terror: true,\n\t\t\tclass: 'border-negative-red-500',\n\t\t},\n\t\t{\n\t\t\tdisabled: false,\n\t\t\tfocused: true,\n\t\t\terror: true,\n\t\t\tclass:\n\t\t\t\t'ring ring-negative-red-50 selection:bg-negative-red-50 dark:ring-0',\n\t\t},\n\t],\n});\n\nconst input = cva(\n\t[\n\t\t'text-sm placeholder:text-sm placeholder:text-storm-500/40 dark:placeholder:text-hurricane-200',\n\t\t'border-none bg-transparent flex-1 min-w-0 p-0',\n\t\t'outline-none focus:outline-none',\n\t\t'font-geist',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tisTextarea: {\n\t\t\t\tfalse: 'h-full',\n\t\t\t\ttrue: 'mt-1',\n\t\t\t},\n\t\t\tdisabled: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: 'cursor-not-allowed',\n\t\t\t},\n\t\t\terror: {\n\t\t\t\tfalse: 'text-storm-500 dark:text-white',\n\t\t\t\ttrue: 'text-negative-red-500',\n\t\t\t},\n\t\t},\n\t}\n);\n\nconst prefixAndSuffix = cva(\n\t['flex flex-shrink-0 justify-center items-center text-center'],\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tread: 'leading-6',\n\t\t\t\twrite: null,\n\t\t\t},\n\t\t\tdisabled: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: 'text-storm-100 dark:text-hurricane-400',\n\t\t\t},\n\t\t\tfocused: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: null,\n\t\t\t},\n\t\t\terror: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: null,\n\t\t\t},\n\t\t\tisText: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: 'text-sm',\n\t\t\t},\n\t\t\tisTextarea: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: 'mt-2',\n\t\t\t},\n\t\t},\n\t\tcompoundVariants: [\n\t\t\t{\n\t\t\t\tdisabled: false,\n\t\t\t\tfocused: false,\n\t\t\t\terror: false,\n\t\t\t\tclass: 'text-storm-300 dark:text-hurricane-300',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tdisabled: false,\n\t\t\t\tfocused: true,\n\t\t\t\terror: false,\n\t\t\t\tclass: 'text-storm-500 dark:text-white',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tdisabled: false,\n\t\t\t\tfocused: false,\n\t\t\t\terror: true,\n\t\t\t\tclass: 'text-negative-red-500',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tdisabled: false,\n\t\t\t\tfocused: true,\n\t\t\t\terror: true,\n\t\t\t\tclass: 'text-negative-red-800',\n\t\t\t},\n\t\t],\n\t}\n);\n\n@Component({\n\ttag: 'p-field',\n\tstyleUrl: './field.component.css',\n\tshadow: true,\n\tformAssociated: true,\n})\nexport class Field {\n\t/**\n\t * The alignment of the container\n\t */\n\t@Prop() align: 'start' | 'end' = 'start';\n\n\t/**\n\t * The variant of the field\n\t */\n\t@Prop() variant: 'read' | 'write' = 'write';\n\n\t/**\n\t * The id of the field\n\t */\n\t@Prop() id: string;\n\n\t/**\n\t * The size of the field\n\t */\n\t@Prop() size: 'sm' | 'base' = 'base';\n\n\t/**\n\t * The type of the field\n\t */\n\t@Prop() type: HTMLInputTypeAttribute | 'textarea' | 'slot' = 'text';\n\n\t/**\n\t * The size of the field\n\t */\n\t@Prop() properties: any | string = {};\n\n\t/**\n\t * The prefix of the field\n\t */\n\t@Prop() prefix: string;\n\n\t/**\n\t * The suffix of the field\n\t */\n\t@Prop() suffix: string;\n\n\t/**\n\t * Icon of the field\n\t */\n\t@Prop() icon: IconVariant;\n\n\t/**\n\t * Icon flip */\n\t@Prop() iconFlip: IconFlipOptions;\n\n\t/**\n\t * Icon rotate\n\t */\n\t@Prop() iconRotate: RotateOptions;\n\n\t/**\n\t * Icon position\n\t */\n\t@Prop() iconPosition: 'start' | 'end' = 'start';\n\n\t/**\n\t * The value of the input\n\t */\n\t@Prop() value: string | number;\n\n\t/**\n\t * The label of the field\n\t */\n\t@Prop() label: string;\n\n\t/**\n\t * Wether the field is in loading state\n\t */\n\t@Prop() loading: boolean = false;\n\n\t/**\n\t * The placeholder of the input\n\t */\n\t@Prop() placeholder: string;\n\n\t/**\n\t * The helper of the field\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 = true;\n\n\t/**\n\t * Wether to show optional when not required\n\t */\n\t@Prop({ reflect: true }) showOptional: boolean = true;\n\n\t/**\n\t * Wether to show an add button when empty\n\t */\n\t@Prop({ reflect: true }) showAddOnEmpty: boolean = false;\n\n\t/**\n\t * The text to show on the add button\n\t */\n\t@Prop({ reflect: true }) addText: string = 'Add';\n\n\t/**\n\t * Wether to autofocus the field\n\t */\n\t@Prop({ reflect: true }) autofocus: boolean = false;\n\n\t/**\n\t * The error to display\n\t */\n\t@Prop({ reflect: true }) error: string;\n\n\t/**\n\t * Wether this component handles showing the error tooltip\n\t */\n\t@Prop({ reflect: true }) autoShowError = true;\n\n\t/**\n\t * The placement of the error popover\n\t */\n\t@Prop() errorPlacement: Placement;\n\n\t/**\n\t * Wether the field is disabled\n\t */\n\t@Prop({ reflect: true }) disabled: boolean = false;\n\n\t/**\n\t * Wether the field is focused\n\t */\n\t@Prop({ reflect: true }) focused: boolean = false;\n\n\t/**\n\t * Force show the error tooltip\n\t */\n\t@Prop({ reflect: true }) forceShowTooltip: boolean = false;\n\n\t/**\n\t * Wether to select all text on focus\n\t */\n\t@Prop({ reflect: true }) selectAllOnFocus: boolean = true;\n\n\t/**\n\t * The method to use when focusing the input\n\t */\n\t@Prop() focusMethod: 'focus' | 'click' = 'focus';\n\n\t/**\n\t * The template for the optional text\n\t */\n\t@Prop() optionalTemplate: templateFunc;\n\n\t/**\n\t * Event whenever the value changes\n\t */\n\t@Event({ bubbles: false }) valueChange: EventEmitter<string | number>;\n\n\t/**\n\t * Event whenever the input ref changes\n\t */\n\t@Event() inputRefChange: EventEmitter<HTMLInputElement | HTMLTextAreaElement>;\n\n\t/**\n\t * Event whenever the value changes\n\t */\n\t@Event({ bubbles: false }) add: EventEmitter<void>;\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _focused = false;\n\t@State() private _nonce = nonce(5);\n\n\t@AttachInternals() _internals: ElementInternals;\n\n\tprivate _inputRef: HTMLInputElement | HTMLTextAreaElement;\n\tprivate _lastValue: string | number | null;\n\n\tcomponentDidLoad() {\n\t\tthis._checkAutoFocus();\n\t}\n\n\tformResetCallback() {\n\t\tthis.value = null;\n\t\tthis.valueChange.emit(null);\n\t}\n\n\tformDisabledCallback(disabled: boolean) {\n\t\tif (!this._internals.form) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.disabled = disabled;\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tid,\n\t\t\tprefix,\n\t\t\tsuffix,\n\t\t\thasHeaderSlot,\n\t\t\thasLabelSlot,\n\t\t\thasHelperSlot,\n\t\t\thasErrorSlot,\n\t\t\thasValueSlot,\n\t\t} = this._getSlotInfo();\n\n\t\treturn (\n\t\t\t<ThemedHost>\n\t\t\t\t<p-field-container\n\t\t\t\t\tforceShowTooltip={\n\t\t\t\t\t\t(!!this.error?.length && !this._focused && this.autoShowError) ||\n\t\t\t\t\t\t(!!this.error?.length && this.forceShowTooltip)\n\t\t\t\t\t}\n\t\t\t\t\tid={id}\n\t\t\t\t\tlabel={this.label}\n\t\t\t\t\talign={this.align}\n\t\t\t\t\tloading={this.loading}\n\t\t\t\t\tloadingSize={this.size}\n\t\t\t\t\thelper={this.helper}\n\t\t\t\t\terror={this.error}\n\t\t\t\t\trequired={this.required}\n\t\t\t\t\tshowOptional={this.showOptional}\n\t\t\t\t\tvariant={this.variant}\n\t\t\t\t>\n\t\t\t\t\t{hasLabelSlot && (\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\tname='label'\n\t\t\t\t\t\t\tslot='label'\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{hasHeaderSlot && (\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\tname='header'\n\t\t\t\t\t\t\tslot='header'\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{hasHelperSlot && (\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\tname='helper'\n\t\t\t\t\t\t\tslot='helper'\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{hasErrorSlot && (\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\tname='error'\n\t\t\t\t\t\t\tslot='error'\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass={field({\n\t\t\t\t\t\t\terror: !!this.error?.length,\n\t\t\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\t\t\tfocused: asBoolean(this.focused) || this._focused,\n\t\t\t\t\t\t\tsize: this.size,\n\t\t\t\t\t\t\tvariant: this.variant,\n\t\t\t\t\t\t\tisTextarea: this.type === 'textarea',\n\t\t\t\t\t\t})}\n\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\tthis.variant === 'read' && !hasValueSlot\n\t\t\t\t\t\t\t\t? `${this.value}`\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tslot='content'\n\t\t\t\t\t>\n\t\t\t\t\t\t{(this.error?.length ||\n\t\t\t\t\t\t\tprefix ||\n\t\t\t\t\t\t\t(this.icon && this.iconPosition === 'start')) && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclass={prefixAndSuffix({\n\t\t\t\t\t\t\t\t\tvariant: this.variant,\n\t\t\t\t\t\t\t\t\terror: !!this.error?.length,\n\t\t\t\t\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\t\t\t\t\tfocused: asBoolean(this.focused) || this._focused,\n\t\t\t\t\t\t\t\t\tisText: typeof suffix === 'string',\n\t\t\t\t\t\t\t\t\tisTextarea: this.type === 'textarea',\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\tonClick={() => this._focusInput()}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{(this.icon && this.iconPosition === 'start') ||\n\t\t\t\t\t\t\t\tthis.error?.length ? (\n\t\t\t\t\t\t\t\t\t<p-icon\n\t\t\t\t\t\t\t\t\t\tclass={cn('flex', {\n\t\t\t\t\t\t\t\t\t\t\t'mt-1': this.variant === 'read' && this.size === 'base',\n\t\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t\t\tvariant={this.error?.length ? 'warning' : this.icon}\n\t\t\t\t\t\t\t\t\t\trotate={this.iconRotate}\n\t\t\t\t\t\t\t\t\t\tflip={this.iconFlip}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\tprefix\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{this._getContent(hasValueSlot, id)}\n\n\t\t\t\t\t\t{(suffix || (this.icon && this.iconPosition === 'end')) && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclass={prefixAndSuffix({\n\t\t\t\t\t\t\t\t\tvariant: this.variant,\n\t\t\t\t\t\t\t\t\terror: !!this.error?.length,\n\t\t\t\t\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\t\t\t\t\tfocused: asBoolean(this.focused) || this._focused,\n\t\t\t\t\t\t\t\t\tisText: typeof suffix === 'string',\n\t\t\t\t\t\t\t\t\tisTextarea: this.type === 'textarea',\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\tonClick={() => this._focusInput()}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{this.icon && this.iconPosition === 'end' ? (\n\t\t\t\t\t\t\t\t\t<p-icon\n\t\t\t\t\t\t\t\t\t\tclass={cn('flex', {\n\t\t\t\t\t\t\t\t\t\t\t'mt-1': this.variant === 'read' && this.size === 'base',\n\t\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t\t\tvariant={this.icon}\n\t\t\t\t\t\t\t\t\t\trotate={this.iconRotate}\n\t\t\t\t\t\t\t\t\t\tflip={this.iconFlip}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\tsuffix\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</p-field-container>\n\t\t\t</ThemedHost>\n\t\t);\n\t}\n\n\t@Watch('value')\n\twatchvalue(value: string | null) {\n\t\tif (!this._inputRef) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (value === this._lastValue) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._lastValue = value;\n\t\tthis._inputRef.value = value;\n\t}\n\n\t@Listen('focusin')\n\thandleFocusIn() {\n\t\tif (this.disabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._focused = true;\n\t\tthis._selectAll();\n\t}\n\n\t@Listen('focusout')\n\thandleFocusOut() {\n\t\tif (this.disabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._focused = false;\n\t}\n\n\t@Listen('keyup', { capture: true })\n\thandleKeyup(ev: KeyboardEvent) {\n\t\tif (this.disabled) {\n\t\t\tev.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._internals?.form) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.type === 'textarea' || ev.key !== 'Enter') {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._internals.form.requestSubmit();\n\t}\n\n\tprivate _getSlotInfo() {\n\t\tconst hasHelperSlot = !!this._el.querySelector(':scope > [slot=\"helper\"]');\n\t\tconst hasLabelSlot = !!this._el.querySelector(':scope > [slot=\"label\"]');\n\t\tconst hasPrefixSlot = !!this._el.querySelector(':scope > [slot=\"prefix\"]');\n\t\tconst hasSuffixSlot = !!this._el.querySelector(':scope > [slot=\"suffix\"]');\n\t\tconst hasHeaderSlot = !!this._el.querySelector(':scope > [slot=\"header\"]');\n\t\tconst hasErrorSlot = !!this._el.querySelector(':scope > [slot=\"error\"]');\n\t\tconst hasValueSlot = !!this._el.querySelector(':scope > [slot=\"value\"]');\n\n\t\tconst prefix = hasPrefixSlot ? <slot name='prefix' /> : this.prefix;\n\t\tconst suffix = hasSuffixSlot ? <slot name='suffix' /> : this.suffix;\n\n\t\tconst errorAndErrorIsNotBoolean =\n\t\t\tthis.error && typeof this.error === 'string' && this.error !== 'true';\n\n\t\tconst id = this.id?.length ? this.id : this._nonce;\n\n\t\treturn {\n\t\t\tid,\n\t\t\thasHelperSlot,\n\t\t\thasLabelSlot,\n\t\t\thasPrefixSlot,\n\t\t\thasSuffixSlot,\n\t\t\thasHeaderSlot,\n\t\t\thasErrorSlot,\n\t\t\thasValueSlot,\n\t\t\tprefix,\n\t\t\tsuffix,\n\t\t\terrorAndErrorIsNotBoolean,\n\t\t};\n\t}\n\n\tprivate _getContent(hasValueSlot = false, id: string) {\n\t\tif (this.variant === 'read') {\n\t\t\treturn hasValueSlot ? (\n\t\t\t\t<slot name='value' />\n\t\t\t) : !!this.value && `${this.value}`.length > 0 ? (\n\t\t\t\tthis.value\n\t\t\t) : this.showAddOnEmpty ? (\n\t\t\t\t<p-button\n\t\t\t\t\tvariant='text'\n\t\t\t\t\ticon='plus'\n\t\t\t\t\tsize='sm'\n\t\t\t\t\tonClick={() => this.add.emit()}\n\t\t\t\t>\n\t\t\t\t\t{this.addText}\n\t\t\t\t</p-button>\n\t\t\t) : (\n\t\t\t\t'—'\n\t\t\t);\n\t\t}\n\n\t\tif (this.type === 'slot') {\n\t\t\treturn <slot name='input' />;\n\t\t}\n\n\t\tconst props = {\n\t\t\tid,\n\t\t\tclass: input({\n\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\tisTextarea: this.type === 'textarea',\n\t\t\t\terror: !!this.error?.length,\n\t\t\t}),\n\t\t\tvalue: this.value,\n\t\t\tplaceholder: this.placeholder,\n\t\t\tdisabled: this.disabled,\n\t\t\tonInput: (ev: InputEvent) => this._valueChange(ev),\n\t\t};\n\n\t\tlet properties = this.properties ?? {};\n\t\tif (typeof properties === 'string') {\n\t\t\tproperties = JSON.parse(this.properties);\n\t\t}\n\n\t\tif (this.type === 'textarea') {\n\t\t\treturn (\n\t\t\t\t<textarea\n\t\t\t\t\tref={ref => this._setInputRef(ref)}\n\t\t\t\t\t{...props}\n\t\t\t\t\t{...properties}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<input\n\t\t\t\ttype={this.type}\n\t\t\t\tref={ref => this._setInputRef(ref)}\n\t\t\t\t{...props}\n\t\t\t\t{...properties}\n\t\t\t/>\n\t\t);\n\t}\n\n\tprivate _setInputRef(ref: HTMLInputElement | HTMLTextAreaElement) {\n\t\tthis._inputRef = ref;\n\t\tthis.inputRefChange.emit(ref);\n\t}\n\n\tprivate _focusInput() {\n\t\tif (this._inputRef) {\n\t\t\tthis._inputRef.focus();\n\t\t\treturn;\n\t\t}\n\n\t\tconst input = this._el.querySelector(':scope > [slot=\"input\"]');\n\t\t(input as HTMLElement)[this.focusMethod]();\n\t}\n\n\tprivate _selectAll() {\n\t\tif (!this._inputRef || !this.selectAllOnFocus) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._inputRef.select();\n\t}\n\n\tprivate _valueChange(ev) {\n\t\tev.stopPropagation();\n\t\tconst target = (ev.originalTarget ?? ev.target) as\n\t\t\t| HTMLTextAreaElement\n\t\t\t| HTMLInputElement;\n\n\t\tconst value = target.value;\n\n\t\tthis._lastValue = value;\n\t\tthis.value = value;\n\t\tthis.valueChange.emit(value);\n\t\tthis._internals.setFormValue(target.value);\n\t}\n\n\tprivate _checkAutoFocus() {\n\t\tif (!this.autofocus) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._inputRef) {\n\t\t\tsetTimeout(() => this._checkAutoFocus(), 100);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._focusInput();\n\t}\n}\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, F as Fragment } from './p-Dgl2kvBS.js';
|
|
2
2
|
import { c as cva } from './p-CBWjHURv.js';
|
|
3
|
-
import { d as defineCustomElement$1, a as defaultSize, b as defaultSizeOptions } from './p-
|
|
3
|
+
import { d as defineCustomElement$1, a as defaultSize, b as defaultSizeOptions } from './p-DkFi_kvY.js';
|
|
4
4
|
import { T as ThemedHost } from './p-7QA93RrV.js';
|
|
5
5
|
import { d as defineCustomElement$9 } from './p-D1ZRTCkT.js';
|
|
6
6
|
import { d as defineCustomElement$8 } from './p-DzWmipVp.js';
|
|
7
|
-
import { d as defineCustomElement$7 } from './p-
|
|
7
|
+
import { d as defineCustomElement$7 } from './p-Bc76zCz0.js';
|
|
8
8
|
import { d as defineCustomElement$6 } from './p-D2igmK5l.js';
|
|
9
9
|
import { d as defineCustomElement$5 } from './p-CQAvP_Ox.js';
|
|
10
10
|
import { d as defineCustomElement$4 } from './p-BHphGfv6.js';
|
|
@@ -169,6 +169,6 @@ function defineCustomElement() {
|
|
|
169
169
|
defineCustomElement();
|
|
170
170
|
|
|
171
171
|
export { Pagination as P, defineCustomElement as d };
|
|
172
|
-
//# sourceMappingURL=p-
|
|
172
|
+
//# sourceMappingURL=p-9uCNIhdB.js.map
|
|
173
173
|
|
|
174
|
-
//# sourceMappingURL=p-
|
|
174
|
+
//# sourceMappingURL=p-9uCNIhdB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-
|
|
1
|
+
{"file":"p-9uCNIhdB.js","mappings":";;;;;;;;;;;;;AAAA,MAAM,sBAAsB,GAAG,2vDAA2vD;;ACa1xD,MAAM,UAAU,GAAG,GAAG,CACrB;IACC,cAAc;IACd,oBAAoB;IACpB,cAAc;IACd,2DAA2D;IAC3D,iDAAiD;IACjD,KAAK;CACL,EACD;AACC,IAAA,QAAQ,EAAE;AACT,QAAA,MAAM,EAAE;AACP,YAAA,KAAK,EAAE,MAAM;AACb,YAAA,IAAI,EAA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EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,EACzD,CAAA,EAED,CAAC,kBAAkB;AACnB,YAAA,IAAI,CAAC,gBAAgB;AACrB,YAAA,IAAI,CAAC,mBAAmB,KACvB,kEACC,OAAO,EAAC,UAAU,EAClB,KAAK,EAAC,qDAAqD,EAC1D,CAAA,CACF,CACQ,CACX,EAEA,IAAI,CAAC,qBAAqB,KAC1B,CAAA,CAAA,oBAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EACvC,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAC1D,aAAa,EAAE,CAAC,EAAE,MAAM,EAAE,KAAI;AAC7B,gBAAA,IAAI,CAAC,mBAAmB,GAAG,MAAM,GAAG,CAAC;AACrC,gBAAA,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC;AAC9B,aAAC,EACA,CAAA,CACF,CACI,CACM;;AAIP,IAAA,eAAe,CAAC,CAAU,EAAA;QACjC,IAAI,CAAC,CAAC,EAAE;YACP;;AAGD,QAAA,IAAI,CAAC,QAAQ,GAAG,CAAC;QACjB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/molecules/pagination/pagination/pagination.component.css?tag=p-pagination&encapsulation=shadow","src/components/molecules/pagination/pagination/pagination.component.tsx"],"sourcesContent":["","import {\n\tComponent,\n\tEvent,\n\tEventEmitter,\n\tFragment,\n\th,\n\tProp,\n\tState,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { defaultSize, defaultSizeOptions } from '../size/constants';\nimport { ThemedHost } from '../../../../internal/themed-host.component';\n\nconst pagination = cva(\n\t[\n\t\t'p-pagination',\n\t\t'items-center gap-2',\n\t\t'rounded-full',\n\t\t'bg-off-white-300 border border-solid border-off-white-700',\n\t\t'dark:bg-hurricane-500 dark:border-hurricane-400',\n\t\t'p-1',\n\t],\n\t{\n\t\tvariants: {\n\t\t\thidden: {\n\t\t\t\tfalse: 'flex',\n\t\t\t\ttrue: 'hidden',\n\t\t\t},\n\t\t},\n\t}\n);\n\n@Component({\n\ttag: 'p-pagination',\n\tstyleUrl: 'pagination.component.css',\n\tshadow: true,\n})\nexport class Pagination {\n\t/**\n\t * Wether to hide when there is only 1 page available\n\t */\n\t@Prop() hideOnSinglePage: boolean = true;\n\n\t/**\n\t * Wether to enable pagination size select\n\t */\n\t@Prop() enablePaginationSize: boolean = true;\n\n\t/**\n\t * Wether to enable pagination pages\n\t */\n\t@Prop() enablePaginationPages: boolean = true;\n\n\t/**\n\t * The current page\n\t */\n\t@Prop({ mutable: true, reflect: true }) page: number = 1;\n\n\t/**\n\t * The total amount of items\n\t */\n\t@Prop() total!: number;\n\n\t/**\n\t * The amount of items per page\n\t */\n\t@Prop() pageSize: number = defaultSize;\n\n\t/**\n\t * The options for the page size\n\t */\n\t@Prop() pageSizeOptions: number[] = defaultSizeOptions;\n\n\t/**\n\t * Event whenever the page changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tpageChange: EventEmitter<number>;\n\n\t/**\n\t * Event whenever the page changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tpageSizeChange: EventEmitter<number>;\n\n\t/**\n\t * The pages that were generated\n\t */\n\t@Event({ bubbles: false }) pagesChange: EventEmitter<number>;\n\n\t@State() private _hasPaginationPages = true;\n\n\trender() {\n\t\tconst hidePageSizeSelect =\n\t\t\tthis.hideOnSinglePage && this.total <= this.pageSizeOptions?.[0];\n\n\t\treturn (\n\t\t\t<ThemedHost>\n\t\t\t\t<div\n\t\t\t\t\tclass={pagination({\n\t\t\t\t\t\thidden:\n\t\t\t\t\t\t\t(hidePageSizeSelect && !this._hasPaginationPages) ||\n\t\t\t\t\t\t\t(!this.enablePaginationSize && !this.enablePaginationPages),\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t{this.enablePaginationPages && this.enablePaginationSize && (\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t<p-pagination-size\n\t\t\t\t\t\t\t\thidden={hidePageSizeSelect}\n\t\t\t\t\t\t\t\tsize={this.pageSize}\n\t\t\t\t\t\t\t\tsizeOptions={this.pageSizeOptions}\n\t\t\t\t\t\t\t\tonSizeChange={({ detail }) => this._changePageSize(detail)}\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t{!hidePageSizeSelect &&\n\t\t\t\t\t\t\t\tthis.hideOnSinglePage &&\n\t\t\t\t\t\t\t\tthis._hasPaginationPages && (\n\t\t\t\t\t\t\t\t\t<p-divider\n\t\t\t\t\t\t\t\t\t\tvariant='vertical'\n\t\t\t\t\t\t\t\t\t\tclass='mx-0 h-4 text-off-white-700 dark:text-hurricane-400'\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{this.enablePaginationPages && (\n\t\t\t\t\t\t<p-pagination-pages\n\t\t\t\t\t\t\tpageSize={this.pageSize}\n\t\t\t\t\t\t\ttotal={this.total}\n\t\t\t\t\t\t\tpage={this.page}\n\t\t\t\t\t\t\thideOnSinglePage={this.hideOnSinglePage}\n\t\t\t\t\t\t\tonPageChange={({ detail }) => this.pageChange.emit(detail)}\n\t\t\t\t\t\t\tonPagesChange={({ detail }) => {\n\t\t\t\t\t\t\t\tthis._hasPaginationPages = detail > 1;\n\t\t\t\t\t\t\t\tthis.pagesChange.emit(detail);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</ThemedHost>\n\t\t);\n\t}\n\n\tprivate _changePageSize(s?: number) {\n\t\tif (!s) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.pageSize = s;\n\t\tthis.pageSizeChange.emit(this.pageSize);\n\t}\n}\n"],"version":3}
|
|
@@ -11,12 +11,12 @@ import { d as defineCustomElement$3 } from './p-BHphGfv6.js';
|
|
|
11
11
|
import { d as defineCustomElement$2 } from './p-BFbLqg3-.js';
|
|
12
12
|
import { d as defineCustomElement$1 } from './p-BUzthIe4.js';
|
|
13
13
|
|
|
14
|
-
const fieldComponentCss = "*{box-sizing:border-box}:host{input[type=number]{-moz-appearance:textfield}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;display:none}}.static{position:static!important}.mt-1{margin-top:.25rem!important}.mt-2{margin-top:.5rem!important}.flex{display:flex!important}.h-6{height:1.5rem!important}.h-8{height:2rem!important}.h-full{height:100%!important}.min-h-4{min-height:1rem!important}.min-h-5{min-height:1.25rem!important}.w-inherit{width:inherit!important}.min-w-0{min-width:0!important}.flex-1{flex:1 1 0%!important}.flex-shrink-0{flex-shrink:0!important}.cursor-not-allowed{cursor:not-allowed!important}.flex-wrap{flex-wrap:wrap!important}.items-start{align-items:flex-start!important}.items-center{align-items:center!important}.justify-center{justify-content:center!important}.gap-2{gap:.5rem!important}.break-
|
|
14
|
+
const fieldComponentCss = "*{box-sizing:border-box}:host{input[type=number]{-moz-appearance:textfield}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;display:none}}.static{position:static!important}.mt-1{margin-top:.25rem!important}.mt-2{margin-top:.5rem!important}.flex{display:flex!important}.h-6{height:1.5rem!important}.h-8{height:2rem!important}.h-full{height:100%!important}.min-h-4{min-height:1rem!important}.min-h-5{min-height:1.25rem!important}.w-inherit{width:inherit!important}.min-w-0{min-width:0!important}.flex-1{flex:1 1 0%!important}.flex-shrink-0{flex-shrink:0!important}.cursor-not-allowed{cursor:not-allowed!important}.flex-wrap{flex-wrap:wrap!important}.items-start{align-items:flex-start!important}.items-center{align-items:center!important}.justify-center{justify-content:center!important}.gap-2{gap:.5rem!important}.hyphens-auto{hyphens:auto!important}.break-normal{overflow-wrap:normal!important;word-break:normal!important}.rounded-lg{border-radius:.5rem!important}.border{border-width:1px!important}.border-0{border-width:0!important}.border-solid{border-style:solid!important}.border-none{border-style:none!important}.border-indigo-600{--tw-border-opacity:1!important;border-color:rgb(82 138 250/var(--tw-border-opacity,1))!important}.border-negative-red-500{--tw-border-opacity:1!important;border-color:rgb(230 30 30/var(--tw-border-opacity,1))!important}.border-storm-100{--tw-border-opacity:1!important;border-color:rgb(209 210 212/var(--tw-border-opacity,1))!important}.bg-transparent{background-color:transparent!important}.bg-white{background-color:rgb(255 255 255/var(--tw-bg-opacity,1))!important}.bg-white,.bg-white-600{--tw-bg-opacity:1!important}.bg-white-600{background-color:rgb(250 250 250/var(--tw-bg-opacity,1))!important}.p-0{padding:0!important}.px-2{padding-left:.5rem!important;padding-right:.5rem!important}.text-center{text-align:center!important}.font-geist{font-family:Geist,serif!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-xs{font-size:.75rem!important;line-height:1rem!important}.leading-6{line-height:1.5rem!important}.text-negative-red-500{--tw-text-opacity:1!important;color:rgb(230 30 30/var(--tw-text-opacity,1))!important}.text-negative-red-800{--tw-text-opacity:1!important;color:rgb(141 16 16/var(--tw-text-opacity,1))!important}.text-storm-100{--tw-text-opacity:1!important;color:rgb(209 210 212/var(--tw-text-opacity,1))!important}.text-storm-300{--tw-text-opacity:1!important;color:rgb(116 120 127/var(--tw-text-opacity,1))!important}.text-storm-500{--tw-text-opacity:1!important;color:rgb(24 30 41/var(--tw-text-opacity,1))!important}.outline-none{outline:2px solid transparent!important;outline-offset:2px!important}.ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)!important;--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color)!important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)!important}.ring-indigo-100{--tw-ring-opacity:1!important;--tw-ring-color:rgb(227 236 254/var(--tw-ring-opacity,1))!important}.ring-negative-red-50{--tw-ring-opacity:1!important;--tw-ring-color:rgb(253 237 237/var(--tw-ring-opacity,1))!important}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:85.375rem){.container{max-width:85.375rem}}@media (min-width:90rem){.container{max-width:90rem}}@media (min-width:96rem){.container{max-width:96rem}}@media (min-width:105rem){.container{max-width:105rem}}@media (min-width:120rem){.container{max-width:120rem}}@media (min-width:160rem){.container{max-width:160rem}}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.selection\\:bg-indigo-500 ::selection{--tw-bg-opacity:1!important;background-color:rgb(142 179 251/var(--tw-bg-opacity,1))!important}.selection\\:bg-negative-red-50 ::selection{--tw-bg-opacity:1!important;background-color:rgb(253 237 237/var(--tw-bg-opacity,1))!important}.selection\\:bg-indigo-500::selection{--tw-bg-opacity:1!important;background-color:rgb(142 179 251/var(--tw-bg-opacity,1))!important}.selection\\:bg-negative-red-50::selection{--tw-bg-opacity:1!important;background-color:rgb(253 237 237/var(--tw-bg-opacity,1))!important}.placeholder\\:text-sm::placeholder{font-size:.875rem!important;line-height:1.25rem!important}.placeholder\\:text-storm-500\\/40::placeholder{color:rgba(24,30,41,.4)!important}.focus\\:outline-none:focus{outline:2px solid transparent!important;outline-offset:2px!important}.dark\\:border-hurricane-400:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-border-opacity:1!important;border-color:rgb(70 75 84/var(--tw-border-opacity,1))!important}.dark\\:border-hurricane-500:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-border-opacity:1!important;border-color:rgb(54 60 70/var(--tw-border-opacity,1))!important}.dark\\:bg-hurricane-500:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1!important;background-color:rgb(54 60 70/var(--tw-bg-opacity,1))!important}.dark\\:bg-hurricane-600:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1!important;background-color:rgb(46 52 62/var(--tw-bg-opacity,1))!important}.dark\\:text-hurricane-300:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1!important;color:rgb(116 120 127/var(--tw-text-opacity,1))!important}.dark\\:text-hurricane-400:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1!important;color:rgb(70 75 84/var(--tw-text-opacity,1))!important}.dark\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}.dark\\:ring-0:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)!important;--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color)!important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)!important}.dark\\:placeholder\\:text-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *)::placeholder{--tw-text-opacity:1!important;color:rgb(163 165 169/var(--tw-text-opacity,1))!important}.dark\\:border-hurricane-400:where([data-theme=dark],[data-theme=dark] *){--tw-border-opacity:1!important;border-color:rgb(70 75 84/var(--tw-border-opacity,1))!important}.dark\\:border-hurricane-500:where([data-theme=dark],[data-theme=dark] *){--tw-border-opacity:1!important;border-color:rgb(54 60 70/var(--tw-border-opacity,1))!important}.dark\\:bg-hurricane-500:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1!important;background-color:rgb(54 60 70/var(--tw-bg-opacity,1))!important}.dark\\:bg-hurricane-600:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1!important;background-color:rgb(46 52 62/var(--tw-bg-opacity,1))!important}.dark\\:text-hurricane-300:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1!important;color:rgb(116 120 127/var(--tw-text-opacity,1))!important}.dark\\:text-hurricane-400:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1!important;color:rgb(70 75 84/var(--tw-text-opacity,1))!important}.dark\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}.dark\\:ring-0:where([data-theme=dark],[data-theme=dark] *){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)!important;--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color)!important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)!important}.dark\\:placeholder\\:text-hurricane-200:where([data-theme=dark],[data-theme=dark] *)::placeholder{--tw-text-opacity:1!important;color:rgb(163 165 169/var(--tw-text-opacity,1))!important}";
|
|
15
15
|
|
|
16
16
|
const field = cva(['flex gap-2', 'w-inherit', 'border-solid rounded-lg'], {
|
|
17
17
|
variants: {
|
|
18
18
|
variant: {
|
|
19
|
-
read: 'border-0 items-start flex-wrap break-
|
|
19
|
+
read: 'border-0 items-start flex-wrap hyphens-auto break-normal leading-6',
|
|
20
20
|
write: 'border px-2',
|
|
21
21
|
},
|
|
22
22
|
size: {
|
|
@@ -340,8 +340,8 @@ const Field = /*@__PURE__*/ proxyCustomElement(class Field extends H {
|
|
|
340
340
|
}
|
|
341
341
|
render() {
|
|
342
342
|
const { id, prefix, suffix, hasHeaderSlot, hasLabelSlot, hasHelperSlot, hasErrorSlot, hasValueSlot, } = this._getSlotInfo();
|
|
343
|
-
return (h(ThemedHost, { key: '
|
|
344
|
-
(!!this.error?.length && this.forceShowTooltip), id: id, label: this.label, align: this.align, loading: this.loading, loadingSize: this.size, helper: this.helper, error: this.error, required: this.required, showOptional: this.showOptional, variant: this.variant }, hasLabelSlot && (h("slot", { key: '
|
|
343
|
+
return (h(ThemedHost, { key: '6070034039c7877d3e1de5ded93f60159fccfa04' }, h("p-field-container", { key: '68c3638db87c41fd5665547f45e8f2d51ee63b53', forceShowTooltip: (!!this.error?.length && !this._focused && this.autoShowError) ||
|
|
344
|
+
(!!this.error?.length && this.forceShowTooltip), id: id, label: this.label, align: this.align, loading: this.loading, loadingSize: this.size, helper: this.helper, error: this.error, required: this.required, showOptional: this.showOptional, variant: this.variant }, hasLabelSlot && (h("slot", { key: '8affa6f6debb6251390e13e1faeccf96a31bd648', name: 'label', slot: 'label' })), hasHeaderSlot && (h("slot", { key: 'dee6f4e518607c82d6e524e3da8121e257865977', name: 'header', slot: 'header' })), hasHelperSlot && (h("slot", { key: '4484e7e481039570af17f6d95c8658bac05e583e', name: 'helper', slot: 'helper' })), hasErrorSlot && (h("slot", { key: '3301e280c6fe2be0353a9b83e1b898f88f69a2cd', name: 'error', slot: 'error' })), h("div", { key: '2f8830adf236fe127ce9f0c55c1781a50e5529b0', class: field({
|
|
345
345
|
error: !!this.error?.length,
|
|
346
346
|
disabled: asBoolean(this.disabled),
|
|
347
347
|
focused: asBoolean(this.focused) || this._focused,
|
|
@@ -352,7 +352,7 @@ const Field = /*@__PURE__*/ proxyCustomElement(class Field extends H {
|
|
|
352
352
|
? `${this.value}`
|
|
353
353
|
: undefined, slot: 'content' }, (this.error?.length ||
|
|
354
354
|
prefix ||
|
|
355
|
-
(this.icon && this.iconPosition === 'start')) && (h("div", { key: '
|
|
355
|
+
(this.icon && this.iconPosition === 'start')) && (h("div", { key: '6be4f7969b64a3e1a5df732205d9b290eb9c23b5', class: prefixAndSuffix({
|
|
356
356
|
variant: this.variant,
|
|
357
357
|
error: !!this.error?.length,
|
|
358
358
|
disabled: asBoolean(this.disabled),
|
|
@@ -362,7 +362,7 @@ const Field = /*@__PURE__*/ proxyCustomElement(class Field extends H {
|
|
|
362
362
|
}), onClick: () => this._focusInput() }, (this.icon && this.iconPosition === 'start') ||
|
|
363
363
|
this.error?.length ? (h("p-icon", { class: cn('flex', {
|
|
364
364
|
'mt-1': this.variant === 'read' && this.size === 'base',
|
|
365
|
-
}), variant: this.error?.length ? 'warning' : this.icon, rotate: this.iconRotate, flip: this.iconFlip })) : (prefix))), this._getContent(hasValueSlot, id), (suffix || (this.icon && this.iconPosition === 'end')) && (h("div", { key: '
|
|
365
|
+
}), variant: this.error?.length ? 'warning' : this.icon, rotate: this.iconRotate, flip: this.iconFlip })) : (prefix))), this._getContent(hasValueSlot, id), (suffix || (this.icon && this.iconPosition === 'end')) && (h("div", { key: 'c276c5883ee1eafdeda0d4db0b5e2ab30d02396d', class: prefixAndSuffix({
|
|
366
366
|
variant: this.variant,
|
|
367
367
|
error: !!this.error?.length,
|
|
368
368
|
disabled: asBoolean(this.disabled),
|
|
@@ -588,6 +588,6 @@ function defineCustomElement() {
|
|
|
588
588
|
defineCustomElement();
|
|
589
589
|
|
|
590
590
|
export { Field as F, defineCustomElement as d };
|
|
591
|
-
//# sourceMappingURL=p-
|
|
591
|
+
//# sourceMappingURL=p-B8HPSlC1.js.map
|
|
592
592
|
|
|
593
|
-
//# sourceMappingURL=p-
|
|
593
|
+
//# sourceMappingURL=p-B8HPSlC1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-B8HPSlC1.js","mappings":";;;;;;;;;;;;;AAAA,MAAM,iBAAiB,GAAG,gwQAAgwQ;;AC0B1xQ,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,YAAY,EAAE,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AG,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC9D,QAAA,KAAqB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;;IAGnC,UAAU,GAAA;QACjB,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;YAC9C;;AAGD,QAAA,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE;;AAGhB,IAAA,YAAY,CAAC,EAAE,EAAA;QACtB,EAAE,CAAC,eAAe,EAAE;QACpB,MAAM,MAAM,IAAI,EAAE,CAAC,cAAc,IAAI,EAAE,CAAC,MAAM,CAE3B;AAEnB,QAAA,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK;AAE1B,QAAA,IAAI,CAAC,UAAU,GAAG,KAAK;AACvB,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK;AAClB,QAAA,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC;QAC5B,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC;;IAGnC,eAAe,GAAA;AACtB,QAAA,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACpB;;AAGD,QAAA,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACpB,UAAU,CAAC,MAAM,IAAI,CAAC,eAAe,EAAE,EAAE,GAAG,CAAC;YAC7C;;QAGD,IAAI,CAAC,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/molecules/field/field/field.component.css?tag=p-field&encapsulation=shadow","src/components/molecules/field/field/field.component.tsx"],"sourcesContent":[":host {\n\tinput[type='number'] {\n\t\t-moz-appearance: textfield; /* Firefox */\n\t}\n\n\tinput::-webkit-outer-spin-button,\n\tinput::-webkit-inner-spin-button {\n\t\tdisplay: none;\n\t\t-webkit-appearance: none;\n\t}\n}\n","import { Placement } from '@floating-ui/dom';\nimport {\n\tAttachInternals,\n\tComponent,\n\tElement,\n\tEvent,\n\tEventEmitter,\n\th,\n\tListen,\n\tProp,\n\tState,\n\tWatch,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { HTMLInputTypeAttribute } from 'react';\nimport { RotateOptions } from '../../../../types/tailwind';\nimport { asBoolean } from '../../../../utils/as-boolean';\nimport { cn } from '../../../../utils/cn';\nimport { nonce } from '../../../../utils/nonce';\nimport {\n\tIconFlipOptions,\n\tIconVariant,\n} from '../../../atoms/icon/icon.component';\nimport { templateFunc } from '../container/field-container.component';\nimport { ThemedHost } from '../../../../internal/themed-host.component';\n\nconst field = cva(['flex gap-2', 'w-inherit', 'border-solid rounded-lg'], {\n\tvariants: {\n\t\tvariant: {\n\t\t\tread: 'border-0 items-start flex-wrap hyphens-auto break-normal leading-6',\n\t\t\twrite: 'border px-2',\n\t\t},\n\t\tsize: {\n\t\t\tsm: null,\n\t\t\tbase: null,\n\t\t},\n\t\tdisabled: {\n\t\t\tfalse: null,\n\t\t\ttrue: null,\n\t\t},\n\t\tfocused: {\n\t\t\tfalse: null,\n\t\t\ttrue: null,\n\t\t},\n\t\terror: {\n\t\t\tfalse: null,\n\t\t\ttrue: null,\n\t\t},\n\t\tisTextarea: {\n\t\t\tfalse: null,\n\t\t\ttrue: 'items-start',\n\t\t},\n\t},\n\tcompoundVariants: [\n\t\t{\n\t\t\tsize: 'sm',\n\t\t\tvariant: 'write',\n\t\t\tisTextarea: false,\n\t\t\tclass: 'h-6',\n\t\t},\n\t\t{\n\t\t\tsize: 'base',\n\t\t\tvariant: 'write',\n\t\t\tisTextarea: false,\n\t\t\tclass: 'h-8',\n\t\t},\n\n\t\t{\n\t\t\tsize: 'sm',\n\t\t\tvariant: 'read',\n\t\t\tclass: 'min-h-4 text-xs',\n\t\t},\n\t\t{\n\t\t\tsize: 'base',\n\t\t\tvariant: 'read',\n\t\t\tclass: 'min-h-5 text-sm',\n\t\t},\n\n\t\t{\n\t\t\tvariant: 'write',\n\t\t\tfocused: false,\n\t\t\terror: false,\n\t\t\tclass: 'border-storm-100 dark:border-hurricane-400',\n\t\t},\n\t\t{\n\t\t\tvariant: 'write',\n\t\t\tdisabled: false,\n\t\t\tfocused: true,\n\t\t\terror: false,\n\t\t\tclass:\n\t\t\t\t'border-indigo-600 ring dark:ring-0 ring-indigo-100 selection:bg-indigo-500',\n\t\t},\n\n\t\t{\n\t\t\tvariant: 'write',\n\t\t\tdisabled: false,\n\t\t\tclass: 'bg-white dark:bg-hurricane-500',\n\t\t},\n\t\t{\n\t\t\tvariant: 'write',\n\t\t\tdisabled: true,\n\t\t\tclass:\n\t\t\t\t'bg-white-600 dark:bg-hurricane-600 dark:border-hurricane-500 cursor-not-allowed',\n\t\t},\n\n\t\t{\n\t\t\tdisabled: false,\n\t\t\terror: true,\n\t\t\tclass: 'border-negative-red-500',\n\t\t},\n\t\t{\n\t\t\tdisabled: false,\n\t\t\tfocused: true,\n\t\t\terror: true,\n\t\t\tclass:\n\t\t\t\t'ring ring-negative-red-50 selection:bg-negative-red-50 dark:ring-0',\n\t\t},\n\t],\n});\n\nconst input = cva(\n\t[\n\t\t'text-sm placeholder:text-sm placeholder:text-storm-500/40 dark:placeholder:text-hurricane-200',\n\t\t'border-none bg-transparent flex-1 min-w-0 p-0',\n\t\t'outline-none focus:outline-none',\n\t\t'font-geist',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tisTextarea: {\n\t\t\t\tfalse: 'h-full',\n\t\t\t\ttrue: 'mt-1',\n\t\t\t},\n\t\t\tdisabled: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: 'cursor-not-allowed',\n\t\t\t},\n\t\t\terror: {\n\t\t\t\tfalse: 'text-storm-500 dark:text-white',\n\t\t\t\ttrue: 'text-negative-red-500',\n\t\t\t},\n\t\t},\n\t}\n);\n\nconst prefixAndSuffix = cva(\n\t['flex flex-shrink-0 justify-center items-center text-center'],\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tread: 'leading-6',\n\t\t\t\twrite: null,\n\t\t\t},\n\t\t\tdisabled: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: 'text-storm-100 dark:text-hurricane-400',\n\t\t\t},\n\t\t\tfocused: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: null,\n\t\t\t},\n\t\t\terror: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: null,\n\t\t\t},\n\t\t\tisText: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: 'text-sm',\n\t\t\t},\n\t\t\tisTextarea: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: 'mt-2',\n\t\t\t},\n\t\t},\n\t\tcompoundVariants: [\n\t\t\t{\n\t\t\t\tdisabled: false,\n\t\t\t\tfocused: false,\n\t\t\t\terror: false,\n\t\t\t\tclass: 'text-storm-300 dark:text-hurricane-300',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tdisabled: false,\n\t\t\t\tfocused: true,\n\t\t\t\terror: false,\n\t\t\t\tclass: 'text-storm-500 dark:text-white',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tdisabled: false,\n\t\t\t\tfocused: false,\n\t\t\t\terror: true,\n\t\t\t\tclass: 'text-negative-red-500',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tdisabled: false,\n\t\t\t\tfocused: true,\n\t\t\t\terror: true,\n\t\t\t\tclass: 'text-negative-red-800',\n\t\t\t},\n\t\t],\n\t}\n);\n\n@Component({\n\ttag: 'p-field',\n\tstyleUrl: './field.component.css',\n\tshadow: true,\n\tformAssociated: true,\n})\nexport class Field {\n\t/**\n\t * The alignment of the container\n\t */\n\t@Prop() align: 'start' | 'end' = 'start';\n\n\t/**\n\t * The variant of the field\n\t */\n\t@Prop() variant: 'read' | 'write' = 'write';\n\n\t/**\n\t * The id of the field\n\t */\n\t@Prop() id: string;\n\n\t/**\n\t * The size of the field\n\t */\n\t@Prop() size: 'sm' | 'base' = 'base';\n\n\t/**\n\t * The type of the field\n\t */\n\t@Prop() type: HTMLInputTypeAttribute | 'textarea' | 'slot' = 'text';\n\n\t/**\n\t * The size of the field\n\t */\n\t@Prop() properties: any | string = {};\n\n\t/**\n\t * The prefix of the field\n\t */\n\t@Prop() prefix: string;\n\n\t/**\n\t * The suffix of the field\n\t */\n\t@Prop() suffix: string;\n\n\t/**\n\t * Icon of the field\n\t */\n\t@Prop() icon: IconVariant;\n\n\t/**\n\t * Icon flip */\n\t@Prop() iconFlip: IconFlipOptions;\n\n\t/**\n\t * Icon rotate\n\t */\n\t@Prop() iconRotate: RotateOptions;\n\n\t/**\n\t * Icon position\n\t */\n\t@Prop() iconPosition: 'start' | 'end' = 'start';\n\n\t/**\n\t * The value of the input\n\t */\n\t@Prop() value: string | number;\n\n\t/**\n\t * The label of the field\n\t */\n\t@Prop() label: string;\n\n\t/**\n\t * Wether the field is in loading state\n\t */\n\t@Prop() loading: boolean = false;\n\n\t/**\n\t * The placeholder of the input\n\t */\n\t@Prop() placeholder: string;\n\n\t/**\n\t * The helper of the field\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 = true;\n\n\t/**\n\t * Wether to show optional when not required\n\t */\n\t@Prop({ reflect: true }) showOptional: boolean = true;\n\n\t/**\n\t * Wether to show an add button when empty\n\t */\n\t@Prop({ reflect: true }) showAddOnEmpty: boolean = false;\n\n\t/**\n\t * The text to show on the add button\n\t */\n\t@Prop({ reflect: true }) addText: string = 'Add';\n\n\t/**\n\t * Wether to autofocus the field\n\t */\n\t@Prop({ reflect: true }) autofocus: boolean = false;\n\n\t/**\n\t * The error to display\n\t */\n\t@Prop({ reflect: true }) error: string;\n\n\t/**\n\t * Wether this component handles showing the error tooltip\n\t */\n\t@Prop({ reflect: true }) autoShowError = true;\n\n\t/**\n\t * The placement of the error popover\n\t */\n\t@Prop() errorPlacement: Placement;\n\n\t/**\n\t * Wether the field is disabled\n\t */\n\t@Prop({ reflect: true }) disabled: boolean = false;\n\n\t/**\n\t * Wether the field is focused\n\t */\n\t@Prop({ reflect: true }) focused: boolean = false;\n\n\t/**\n\t * Force show the error tooltip\n\t */\n\t@Prop({ reflect: true }) forceShowTooltip: boolean = false;\n\n\t/**\n\t * Wether to select all text on focus\n\t */\n\t@Prop({ reflect: true }) selectAllOnFocus: boolean = true;\n\n\t/**\n\t * The method to use when focusing the input\n\t */\n\t@Prop() focusMethod: 'focus' | 'click' = 'focus';\n\n\t/**\n\t * The template for the optional text\n\t */\n\t@Prop() optionalTemplate: templateFunc;\n\n\t/**\n\t * Event whenever the value changes\n\t */\n\t@Event({ bubbles: false }) valueChange: EventEmitter<string | number>;\n\n\t/**\n\t * Event whenever the input ref changes\n\t */\n\t@Event() inputRefChange: EventEmitter<HTMLInputElement | HTMLTextAreaElement>;\n\n\t/**\n\t * Event whenever the value changes\n\t */\n\t@Event({ bubbles: false }) add: EventEmitter<void>;\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _focused = false;\n\t@State() private _nonce = nonce(5);\n\n\t@AttachInternals() _internals: ElementInternals;\n\n\tprivate _inputRef: HTMLInputElement | HTMLTextAreaElement;\n\tprivate _lastValue: string | number | null;\n\n\tcomponentDidLoad() {\n\t\tthis._checkAutoFocus();\n\t}\n\n\tformResetCallback() {\n\t\tthis.value = null;\n\t\tthis.valueChange.emit(null);\n\t}\n\n\tformDisabledCallback(disabled: boolean) {\n\t\tif (!this._internals.form) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.disabled = disabled;\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tid,\n\t\t\tprefix,\n\t\t\tsuffix,\n\t\t\thasHeaderSlot,\n\t\t\thasLabelSlot,\n\t\t\thasHelperSlot,\n\t\t\thasErrorSlot,\n\t\t\thasValueSlot,\n\t\t} = this._getSlotInfo();\n\n\t\treturn (\n\t\t\t<ThemedHost>\n\t\t\t\t<p-field-container\n\t\t\t\t\tforceShowTooltip={\n\t\t\t\t\t\t(!!this.error?.length && !this._focused && this.autoShowError) ||\n\t\t\t\t\t\t(!!this.error?.length && this.forceShowTooltip)\n\t\t\t\t\t}\n\t\t\t\t\tid={id}\n\t\t\t\t\tlabel={this.label}\n\t\t\t\t\talign={this.align}\n\t\t\t\t\tloading={this.loading}\n\t\t\t\t\tloadingSize={this.size}\n\t\t\t\t\thelper={this.helper}\n\t\t\t\t\terror={this.error}\n\t\t\t\t\trequired={this.required}\n\t\t\t\t\tshowOptional={this.showOptional}\n\t\t\t\t\tvariant={this.variant}\n\t\t\t\t>\n\t\t\t\t\t{hasLabelSlot && (\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\tname='label'\n\t\t\t\t\t\t\tslot='label'\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{hasHeaderSlot && (\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\tname='header'\n\t\t\t\t\t\t\tslot='header'\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{hasHelperSlot && (\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\tname='helper'\n\t\t\t\t\t\t\tslot='helper'\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{hasErrorSlot && (\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\tname='error'\n\t\t\t\t\t\t\tslot='error'\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass={field({\n\t\t\t\t\t\t\terror: !!this.error?.length,\n\t\t\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\t\t\tfocused: asBoolean(this.focused) || this._focused,\n\t\t\t\t\t\t\tsize: this.size,\n\t\t\t\t\t\t\tvariant: this.variant,\n\t\t\t\t\t\t\tisTextarea: this.type === 'textarea',\n\t\t\t\t\t\t})}\n\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\tthis.variant === 'read' && !hasValueSlot\n\t\t\t\t\t\t\t\t? `${this.value}`\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tslot='content'\n\t\t\t\t\t>\n\t\t\t\t\t\t{(this.error?.length ||\n\t\t\t\t\t\t\tprefix ||\n\t\t\t\t\t\t\t(this.icon && this.iconPosition === 'start')) && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclass={prefixAndSuffix({\n\t\t\t\t\t\t\t\t\tvariant: this.variant,\n\t\t\t\t\t\t\t\t\terror: !!this.error?.length,\n\t\t\t\t\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\t\t\t\t\tfocused: asBoolean(this.focused) || this._focused,\n\t\t\t\t\t\t\t\t\tisText: typeof suffix === 'string',\n\t\t\t\t\t\t\t\t\tisTextarea: this.type === 'textarea',\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\tonClick={() => this._focusInput()}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{(this.icon && this.iconPosition === 'start') ||\n\t\t\t\t\t\t\t\tthis.error?.length ? (\n\t\t\t\t\t\t\t\t\t<p-icon\n\t\t\t\t\t\t\t\t\t\tclass={cn('flex', {\n\t\t\t\t\t\t\t\t\t\t\t'mt-1': this.variant === 'read' && this.size === 'base',\n\t\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t\t\tvariant={this.error?.length ? 'warning' : this.icon}\n\t\t\t\t\t\t\t\t\t\trotate={this.iconRotate}\n\t\t\t\t\t\t\t\t\t\tflip={this.iconFlip}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\tprefix\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{this._getContent(hasValueSlot, id)}\n\n\t\t\t\t\t\t{(suffix || (this.icon && this.iconPosition === 'end')) && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclass={prefixAndSuffix({\n\t\t\t\t\t\t\t\t\tvariant: this.variant,\n\t\t\t\t\t\t\t\t\terror: !!this.error?.length,\n\t\t\t\t\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\t\t\t\t\tfocused: asBoolean(this.focused) || this._focused,\n\t\t\t\t\t\t\t\t\tisText: typeof suffix === 'string',\n\t\t\t\t\t\t\t\t\tisTextarea: this.type === 'textarea',\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\tonClick={() => this._focusInput()}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{this.icon && this.iconPosition === 'end' ? (\n\t\t\t\t\t\t\t\t\t<p-icon\n\t\t\t\t\t\t\t\t\t\tclass={cn('flex', {\n\t\t\t\t\t\t\t\t\t\t\t'mt-1': this.variant === 'read' && this.size === 'base',\n\t\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t\t\tvariant={this.icon}\n\t\t\t\t\t\t\t\t\t\trotate={this.iconRotate}\n\t\t\t\t\t\t\t\t\t\tflip={this.iconFlip}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\tsuffix\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</p-field-container>\n\t\t\t</ThemedHost>\n\t\t);\n\t}\n\n\t@Watch('value')\n\twatchvalue(value: string | null) {\n\t\tif (!this._inputRef) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (value === this._lastValue) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._lastValue = value;\n\t\tthis._inputRef.value = value;\n\t}\n\n\t@Listen('focusin')\n\thandleFocusIn() {\n\t\tif (this.disabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._focused = true;\n\t\tthis._selectAll();\n\t}\n\n\t@Listen('focusout')\n\thandleFocusOut() {\n\t\tif (this.disabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._focused = false;\n\t}\n\n\t@Listen('keyup', { capture: true })\n\thandleKeyup(ev: KeyboardEvent) {\n\t\tif (this.disabled) {\n\t\t\tev.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._internals?.form) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.type === 'textarea' || ev.key !== 'Enter') {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._internals.form.requestSubmit();\n\t}\n\n\tprivate _getSlotInfo() {\n\t\tconst hasHelperSlot = !!this._el.querySelector(':scope > [slot=\"helper\"]');\n\t\tconst hasLabelSlot = !!this._el.querySelector(':scope > [slot=\"label\"]');\n\t\tconst hasPrefixSlot = !!this._el.querySelector(':scope > [slot=\"prefix\"]');\n\t\tconst hasSuffixSlot = !!this._el.querySelector(':scope > [slot=\"suffix\"]');\n\t\tconst hasHeaderSlot = !!this._el.querySelector(':scope > [slot=\"header\"]');\n\t\tconst hasErrorSlot = !!this._el.querySelector(':scope > [slot=\"error\"]');\n\t\tconst hasValueSlot = !!this._el.querySelector(':scope > [slot=\"value\"]');\n\n\t\tconst prefix = hasPrefixSlot ? <slot name='prefix' /> : this.prefix;\n\t\tconst suffix = hasSuffixSlot ? <slot name='suffix' /> : this.suffix;\n\n\t\tconst errorAndErrorIsNotBoolean =\n\t\t\tthis.error && typeof this.error === 'string' && this.error !== 'true';\n\n\t\tconst id = this.id?.length ? this.id : this._nonce;\n\n\t\treturn {\n\t\t\tid,\n\t\t\thasHelperSlot,\n\t\t\thasLabelSlot,\n\t\t\thasPrefixSlot,\n\t\t\thasSuffixSlot,\n\t\t\thasHeaderSlot,\n\t\t\thasErrorSlot,\n\t\t\thasValueSlot,\n\t\t\tprefix,\n\t\t\tsuffix,\n\t\t\terrorAndErrorIsNotBoolean,\n\t\t};\n\t}\n\n\tprivate _getContent(hasValueSlot = false, id: string) {\n\t\tif (this.variant === 'read') {\n\t\t\treturn hasValueSlot ? (\n\t\t\t\t<slot name='value' />\n\t\t\t) : !!this.value && `${this.value}`.length > 0 ? (\n\t\t\t\tthis.value\n\t\t\t) : this.showAddOnEmpty ? (\n\t\t\t\t<p-button\n\t\t\t\t\tvariant='text'\n\t\t\t\t\ticon='plus'\n\t\t\t\t\tsize='sm'\n\t\t\t\t\tonClick={() => this.add.emit()}\n\t\t\t\t>\n\t\t\t\t\t{this.addText}\n\t\t\t\t</p-button>\n\t\t\t) : (\n\t\t\t\t'—'\n\t\t\t);\n\t\t}\n\n\t\tif (this.type === 'slot') {\n\t\t\treturn <slot name='input' />;\n\t\t}\n\n\t\tconst props = {\n\t\t\tid,\n\t\t\tclass: input({\n\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\tisTextarea: this.type === 'textarea',\n\t\t\t\terror: !!this.error?.length,\n\t\t\t}),\n\t\t\tvalue: this.value,\n\t\t\tplaceholder: this.placeholder,\n\t\t\tdisabled: this.disabled,\n\t\t\tonInput: (ev: InputEvent) => this._valueChange(ev),\n\t\t};\n\n\t\tlet properties = this.properties ?? {};\n\t\tif (typeof properties === 'string') {\n\t\t\tproperties = JSON.parse(this.properties);\n\t\t}\n\n\t\tif (this.type === 'textarea') {\n\t\t\treturn (\n\t\t\t\t<textarea\n\t\t\t\t\tref={ref => this._setInputRef(ref)}\n\t\t\t\t\t{...props}\n\t\t\t\t\t{...properties}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<input\n\t\t\t\ttype={this.type}\n\t\t\t\tref={ref => this._setInputRef(ref)}\n\t\t\t\t{...props}\n\t\t\t\t{...properties}\n\t\t\t/>\n\t\t);\n\t}\n\n\tprivate _setInputRef(ref: HTMLInputElement | HTMLTextAreaElement) {\n\t\tthis._inputRef = ref;\n\t\tthis.inputRefChange.emit(ref);\n\t}\n\n\tprivate _focusInput() {\n\t\tif (this._inputRef) {\n\t\t\tthis._inputRef.focus();\n\t\t\treturn;\n\t\t}\n\n\t\tconst input = this._el.querySelector(':scope > [slot=\"input\"]');\n\t\t(input as HTMLElement)[this.focusMethod]();\n\t}\n\n\tprivate _selectAll() {\n\t\tif (!this._inputRef || !this.selectAllOnFocus) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._inputRef.select();\n\t}\n\n\tprivate _valueChange(ev) {\n\t\tev.stopPropagation();\n\t\tconst target = (ev.originalTarget ?? ev.target) as\n\t\t\t| HTMLTextAreaElement\n\t\t\t| HTMLInputElement;\n\n\t\tconst value = target.value;\n\n\t\tthis._lastValue = value;\n\t\tthis.value = value;\n\t\tthis.valueChange.emit(value);\n\t\tthis._internals.setFormValue(target.value);\n\t}\n\n\tprivate _checkAutoFocus() {\n\t\tif (!this.autofocus) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._inputRef) {\n\t\t\tsetTimeout(() => this._checkAutoFocus(), 100);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._focusInput();\n\t}\n}\n"],"version":3}
|