@paperless/core 2.2.16 → 2.3.0

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.
Files changed (180) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/build/p-0b3af128.entry.js +2 -0
  3. package/dist/build/p-0b3af128.entry.js.map +1 -0
  4. package/dist/build/p-27b62457.entry.js +2 -0
  5. package/dist/build/p-27b62457.entry.js.map +1 -0
  6. package/dist/build/{p-d499bb0c.js → p-33a18d80.js} +1 -1
  7. package/dist/build/{p-982c05d5.entry.js → p-43216955.entry.js} +2 -2
  8. package/dist/build/p-43216955.entry.js.map +1 -0
  9. package/dist/build/p-8a116c31.entry.js +2 -0
  10. package/dist/build/p-8a116c31.entry.js.map +1 -0
  11. package/dist/build/p-93520e8e.entry.js +2 -0
  12. package/dist/build/p-93520e8e.entry.js.map +1 -0
  13. package/dist/build/p-button.p-icon.p-loader.entry.esm.js.map +1 -1
  14. package/dist/build/p-card-container.entry.esm.js.map +1 -1
  15. package/dist/build/p-checkbox.p-dropdown.p-dropdown-menu-container.p-dropdown-menu-item.entry.esm.js.map +1 -1
  16. package/dist/build/p-datepicker.entry.esm.js.map +1 -1
  17. package/dist/build/p-edffb5d1.entry.js +2 -0
  18. package/dist/build/p-edffb5d1.entry.js.map +1 -0
  19. package/dist/build/p-field.p-field-container.entry.esm.js.map +1 -1
  20. package/dist/build/p-radio.entry.esm.js.map +1 -1
  21. package/dist/build/paperless.esm.js +1 -1
  22. package/dist/cjs/loader.cjs.js +1 -1
  23. package/dist/cjs/p-button.p-icon.p-loader.entry.cjs.js.map +1 -1
  24. package/dist/cjs/p-button_3.cjs.entry.js +6 -6
  25. package/dist/cjs/p-button_3.cjs.entry.js.map +1 -1
  26. package/dist/cjs/p-card-container.cjs.entry.js +4 -4
  27. package/dist/cjs/p-card-container.cjs.entry.js.map +1 -1
  28. package/dist/cjs/p-card-container.entry.cjs.js.map +1 -1
  29. package/dist/cjs/p-checkbox.p-dropdown.p-dropdown-menu-container.p-dropdown-menu-item.entry.cjs.js.map +1 -1
  30. package/dist/cjs/p-checkbox_4.cjs.entry.js +11 -11
  31. package/dist/cjs/p-checkbox_4.cjs.entry.js.map +1 -1
  32. package/dist/cjs/p-datepicker.cjs.entry.js +1 -1
  33. package/dist/cjs/p-datepicker.cjs.entry.js.map +1 -1
  34. package/dist/cjs/p-datepicker.entry.cjs.js.map +1 -1
  35. package/dist/cjs/p-field.p-field-container.entry.cjs.js.map +1 -1
  36. package/dist/cjs/p-field_2.cjs.entry.js +10 -5
  37. package/dist/cjs/p-field_2.cjs.entry.js.map +1 -1
  38. package/dist/cjs/p-radio.cjs.entry.js +5 -5
  39. package/dist/cjs/p-radio.cjs.entry.js.map +1 -1
  40. package/dist/cjs/p-radio.entry.cjs.js.map +1 -1
  41. package/dist/cjs/paperless.cjs.js +1 -1
  42. package/dist/collection/components/atoms/card/container/card-container.component.css +1 -1
  43. package/dist/collection/components/atoms/card/container/card-container.component.js +3 -3
  44. package/dist/collection/components/atoms/card/container/card-container.component.js.map +1 -1
  45. package/dist/collection/components/atoms/checkbox/checkbox.component.css +1 -1
  46. package/dist/collection/components/atoms/checkbox/checkbox.component.js +5 -5
  47. package/dist/collection/components/atoms/checkbox/checkbox.component.js.map +1 -1
  48. package/dist/collection/components/atoms/dropdown-menu/item/dropdown-menu-item.component.css +1 -1
  49. package/dist/collection/components/atoms/dropdown-menu/item/dropdown-menu-item.component.js +4 -4
  50. package/dist/collection/components/atoms/dropdown-menu/item/dropdown-menu-item.component.js.map +1 -1
  51. package/dist/collection/components/atoms/radio/radio.component.css +1 -1
  52. package/dist/collection/components/atoms/radio/radio.component.js +4 -4
  53. package/dist/collection/components/atoms/radio/radio.component.js.map +1 -1
  54. package/dist/collection/components/molecules/button/button.component.css +1 -1
  55. package/dist/collection/components/molecules/button/button.component.js +5 -5
  56. package/dist/collection/components/molecules/button/button.component.js.map +1 -1
  57. package/dist/collection/components/molecules/datepicker/datepicker.component.js +1 -1
  58. package/dist/collection/components/molecules/datepicker/datepicker.component.js.map +1 -1
  59. package/dist/collection/components/molecules/field/container/field-container.component.js +2 -2
  60. package/dist/collection/components/molecules/field/container/field-container.component.js.map +1 -1
  61. package/dist/collection/components/molecules/field/field/field.component.js +28 -3
  62. package/dist/collection/components/molecules/field/field/field.component.js.map +1 -1
  63. package/dist/components/{p-BhTjLQdF.js → p-ARBBg7l1.js} +8 -8
  64. package/dist/components/{p-BhTjLQdF.js.map → p-ARBBg7l1.js.map} +1 -1
  65. package/dist/components/{p-DLARy46p.js → p-CH8aHCfo.js} +6 -6
  66. package/dist/components/{p-DLARy46p.js.map → p-CH8aHCfo.js.map} +1 -1
  67. package/dist/components/{p-3TP-UX-Y.js → p-CSjAUB6T.js} +5 -5
  68. package/dist/components/{p-3TP-UX-Y.js.map → p-CSjAUB6T.js.map} +1 -1
  69. package/dist/components/{p-CuGtA-02.js → p-CdPwzRXe.js} +8 -8
  70. package/dist/components/{p-CuGtA-02.js.map → p-CdPwzRXe.js.map} +1 -1
  71. package/dist/components/{p-DBwmAZb5.js → p-DCTZIgFT.js} +3 -3
  72. package/dist/components/{p-DBwmAZb5.js.map → p-DCTZIgFT.js.map} +1 -1
  73. package/dist/components/{p-BfSo1qPy.js → p-DIAX9-r9.js} +8 -8
  74. package/dist/components/{p-BfSo1qPy.js.map → p-DIAX9-r9.js.map} +1 -1
  75. package/dist/components/{p-DzLUScwc.js → p-DIUA732y.js} +4 -4
  76. package/dist/components/{p-DzLUScwc.js.map → p-DIUA732y.js.map} +1 -1
  77. package/dist/components/{p-CKy64zac.js → p-Di_xEiDn.js} +5 -5
  78. package/dist/components/{p-CKy64zac.js.map → p-Di_xEiDn.js.map} +1 -1
  79. package/dist/components/{p-Bs_mDdx4.js → p-Dm9wDTbM.js} +4 -4
  80. package/dist/components/p-Dm9wDTbM.js.map +1 -0
  81. package/dist/components/{p-CY_6PTTc.js → p-HJQA2u2S.js} +13 -7
  82. package/dist/components/p-HJQA2u2S.js.map +1 -0
  83. package/dist/components/{p-B4qiEiNB.js → p-PqgdU5A2.js} +3 -3
  84. package/dist/components/{p-B4qiEiNB.js.map → p-PqgdU5A2.js.map} +1 -1
  85. package/dist/components/{p-Be4WHASj.js → p-TDGXG5Qi.js} +3 -3
  86. package/dist/components/{p-Be4WHASj.js.map → p-TDGXG5Qi.js.map} +1 -1
  87. package/dist/components/p-attachment.js +2 -2
  88. package/dist/components/p-button.js +1 -1
  89. package/dist/components/p-calendar.js +1 -1
  90. package/dist/components/p-card-container.js +4 -4
  91. package/dist/components/p-card-container.js.map +1 -1
  92. package/dist/components/p-checkbox.js +1 -1
  93. package/dist/components/p-datepicker.js +5 -5
  94. package/dist/components/p-datepicker.js.map +1 -1
  95. package/dist/components/p-drawer-header.js +1 -1
  96. package/dist/components/p-drawer.js +2 -2
  97. package/dist/components/p-dropdown-menu-item.js +1 -1
  98. package/dist/components/p-empty-state.js +1 -1
  99. package/dist/components/p-field-container.js +1 -1
  100. package/dist/components/p-field.js +1 -1
  101. package/dist/components/p-modal-header.js +1 -1
  102. package/dist/components/p-modal.js +2 -2
  103. package/dist/components/p-navbar.js +1 -1
  104. package/dist/components/p-pagination-size.js +1 -1
  105. package/dist/components/p-pagination.js +1 -1
  106. package/dist/components/p-profile.js +1 -1
  107. package/dist/components/p-radio.js +5 -5
  108. package/dist/components/p-radio.js.map +1 -1
  109. package/dist/components/p-select.js +5 -5
  110. package/dist/components/{p-giTrVMAJ.js → p-t49-Fgzo.js} +3 -3
  111. package/dist/components/{p-giTrVMAJ.js.map → p-t49-Fgzo.js.map} +1 -1
  112. package/dist/components/p-table-footer.js +1 -1
  113. package/dist/components/p-table-header.js +1 -1
  114. package/dist/components/p-table.js +10 -10
  115. package/dist/esm/loader.js +1 -1
  116. package/dist/esm/p-button.p-icon.p-loader.entry.js.map +1 -1
  117. package/dist/esm/p-button_3.entry.js +6 -6
  118. package/dist/esm/p-button_3.entry.js.map +1 -1
  119. package/dist/esm/p-card-container.entry.js +4 -4
  120. package/dist/esm/p-card-container.entry.js.map +1 -1
  121. package/dist/esm/p-checkbox.p-dropdown.p-dropdown-menu-container.p-dropdown-menu-item.entry.js.map +1 -1
  122. package/dist/esm/p-checkbox_4.entry.js +11 -11
  123. package/dist/esm/p-checkbox_4.entry.js.map +1 -1
  124. package/dist/esm/p-datepicker.entry.js +1 -1
  125. package/dist/esm/p-datepicker.entry.js.map +1 -1
  126. package/dist/esm/p-field.p-field-container.entry.js.map +1 -1
  127. package/dist/esm/p-field_2.entry.js +10 -5
  128. package/dist/esm/p-field_2.entry.js.map +1 -1
  129. package/dist/esm/p-radio.entry.js +5 -5
  130. package/dist/esm/p-radio.entry.js.map +1 -1
  131. package/dist/esm/paperless.js +1 -1
  132. package/dist/index.html +1 -1
  133. package/dist/paperless/p-0b3af128.entry.js +2 -0
  134. package/dist/paperless/p-0b3af128.entry.js.map +1 -0
  135. package/dist/paperless/p-27b62457.entry.js +2 -0
  136. package/dist/paperless/p-27b62457.entry.js.map +1 -0
  137. package/dist/paperless/{p-982c05d5.entry.js → p-43216955.entry.js} +2 -2
  138. package/dist/paperless/p-43216955.entry.js.map +1 -0
  139. package/dist/paperless/p-8a116c31.entry.js +2 -0
  140. package/dist/paperless/p-8a116c31.entry.js.map +1 -0
  141. package/dist/paperless/p-93520e8e.entry.js +2 -0
  142. package/dist/paperless/p-93520e8e.entry.js.map +1 -0
  143. package/dist/paperless/p-button.p-icon.p-loader.entry.esm.js.map +1 -1
  144. package/dist/paperless/p-card-container.entry.esm.js.map +1 -1
  145. package/dist/paperless/p-checkbox.p-dropdown.p-dropdown-menu-container.p-dropdown-menu-item.entry.esm.js.map +1 -1
  146. package/dist/paperless/p-datepicker.entry.esm.js.map +1 -1
  147. package/dist/paperless/p-edffb5d1.entry.js +2 -0
  148. package/dist/paperless/p-edffb5d1.entry.js.map +1 -0
  149. package/dist/paperless/p-field.p-field-container.entry.esm.js.map +1 -1
  150. package/dist/paperless/p-radio.entry.esm.js.map +1 -1
  151. package/dist/paperless/paperless.esm.js +1 -1
  152. package/dist/sw.js +1 -1
  153. package/dist/sw.js.map +1 -1
  154. package/dist/types/components/molecules/field/field/field.component.d.ts +4 -0
  155. package/dist/types/components.d.ts +8 -0
  156. package/package.json +1 -1
  157. package/dist/build/p-60a19708.entry.js +0 -2
  158. package/dist/build/p-60a19708.entry.js.map +0 -1
  159. package/dist/build/p-8a634916.entry.js +0 -2
  160. package/dist/build/p-8a634916.entry.js.map +0 -1
  161. package/dist/build/p-982c05d5.entry.js.map +0 -1
  162. package/dist/build/p-dc8b0ad9.entry.js +0 -2
  163. package/dist/build/p-dc8b0ad9.entry.js.map +0 -1
  164. package/dist/build/p-f13b147d.entry.js +0 -2
  165. package/dist/build/p-f13b147d.entry.js.map +0 -1
  166. package/dist/build/p-fcb0901e.entry.js +0 -2
  167. package/dist/build/p-fcb0901e.entry.js.map +0 -1
  168. package/dist/components/p-Bs_mDdx4.js.map +0 -1
  169. package/dist/components/p-CY_6PTTc.js.map +0 -1
  170. package/dist/paperless/p-60a19708.entry.js +0 -2
  171. package/dist/paperless/p-60a19708.entry.js.map +0 -1
  172. package/dist/paperless/p-8a634916.entry.js +0 -2
  173. package/dist/paperless/p-8a634916.entry.js.map +0 -1
  174. package/dist/paperless/p-982c05d5.entry.js.map +0 -1
  175. package/dist/paperless/p-dc8b0ad9.entry.js +0 -2
  176. package/dist/paperless/p-dc8b0ad9.entry.js.map +0 -1
  177. package/dist/paperless/p-f13b147d.entry.js +0 -2
  178. package/dist/paperless/p-f13b147d.entry.js.map +0 -1
  179. package/dist/paperless/p-fcb0901e.entry.js +0 -2
  180. package/dist/paperless/p-fcb0901e.entry.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"radio.component.js","sourceRoot":"","sources":["../../../../src/components/atoms/radio/radio.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,SAAS,EACT,KAAK,EAEL,IAAI,EACJ,KAAK,EACL,CAAC,GACD,MAAM,eAA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YACpB,OAAO;QACR,CAAC;QAED,MAAM,OAAO,GAAI,EAAE,CAAC,MAA2B,CAAC,OAAO,CAAC;QACxD,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IAEO,SAAS,CAAC,OAAgB;QACjC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACtD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {\n\tAttachInternals,\n\tComponent,\n\tEvent,\n\tEventEmitter,\n\tProp,\n\tState,\n\th,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { asBoolean } from '../../../utils/as-boolean';\nimport { nonce } from '../../../utils/nonce';\n\nconst radio = cva(\n\t[\n\t\t'peer appearance-none m-0 outline-none flex-shrink-0',\n\t\t'rounded-full border border-inset border-solid ',\n\t\t'w-4 h-4',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tdisabled: {\n\t\t\t\tfalse: [\n\t\t\t\t\t'cursor-pointer shadow-1',\n\t\t\t\t\t'bg-white border-storm-100',\n\t\t\t\t\t'hover:bg-indigo-100 hover:border-storm-500/20',\n\t\t\t\t\t'group-hover/radio-label:bg-indigo-100 group-hover/radio-label:border-storm-500/20',\n\t\t\t\t\t'checked:cursor-auto',\n\t\t\t\t\t'checked:bg-indigo-600 checked:border-storm-500/20',\n\t\t\t\t\t'checked:ring-2 checked:ring-indigo-100',\n\t\t\t\t\t'checked:hover:bg-indigo-700 checked:hover:border-storm-500/20',\n\t\t\t\t\t'checked:group-hover/radio-label:bg-indigo-700 checked:group-hover/radio-label:border-storm-500/20',\n\t\t\t\t],\n\t\t\t\ttrue: 'bg-white-600 border-storm-500 cursor-not-allowed ',\n\t\t\t},\n\t\t},\n\t\tcompoundVariants: [\n\t\t\t{\n\t\t\t\tdisabled: false,\n\t\t\t\tclass: [\n\t\t\t\t\t'cursor-pointer shadow-1',\n\t\t\t\t\t'bg-white border-storm-100',\n\t\t\t\t\t'hover:bg-indigo-100 hover:border-storm-500/20',\n\t\t\t\t\t'group-hover/radio-label:bg-indigo-100 group-hover/radio-label:border-storm-500/20',\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t}\n);\n\nconst circle = cva(\n\t[\n\t\t'block',\n\t\t'rounded-full bg-transparent',\n\t\t'absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 pointer-events-none',\n\t\t'w-2 h-2',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tdisabled: {\n\t\t\t\tfalse:\n\t\t\t\t\t'peer-checked:bg-white peer-checked:ring-1 peer-checked:ring-storm-500/10',\n\t\t\t\ttrue: 'peer-checked:bg-storm-200',\n\t\t\t},\n\t\t},\n\t}\n);\n\n@Component({\n\ttag: 'p-radio',\n\tstyleUrl: 'radio.component.css',\n\tformAssociated: true,\n})\nexport class Radio {\n\t/**\n\t * The value of the radio button\n\t */\n\t@Prop() value: string;\n\n\t/**\n\t * Wether the radio is disabled\n\t */\n\t@Prop({ reflect: true }) disabled: boolean = false;\n\n\t/**\n\t * Wether the radio is required\n\t */\n\t@Prop({ reflect: true }) required: boolean = true;\n\n\t/**\n\t * The id of the radio button\n\t */\n\t@Prop({ reflect: true }) id: string;\n\n\t/**\n\t * The name of the radio button\n\t */\n\t@Prop({ reflect: true }) name: string;\n\n\t/**\n\t * Wether the radio is checked\n\t */\n\t@Prop({ reflect: true }) checked: boolean = false;\n\n\t/**\n\t * Event whenever the checked changes\n\t */\n\t@Event() checkedChange: EventEmitter<boolean>;\n\n\t@State() private _nonce = nonce(5);\n\n\t@AttachInternals() _internals: ElementInternals;\n\n\tformResetCallback() {\n\t\tthis._setValue(false);\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 id = this.id?.length ? this.id : this._nonce;\n\n\t\treturn (\n\t\t\t<label\n\t\t\t\thtmlFor={id}\n\t\t\t\tclass='flex items-center justify-start gap-2'\n\t\t\t>\n\t\t\t\t<div class='relative flex flex-shrink-0 items-center'>\n\t\t\t\t\t<input\n\t\t\t\t\t\tclass={radio({\n\t\t\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\t\t})}\n\t\t\t\t\t\ttype='radio'\n\t\t\t\t\t\tid={id}\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\tchecked={this.checked}\n\t\t\t\t\t\tdisabled={asBoolean(this.disabled)}\n\t\t\t\t\t\tonChange={ev => this._onChange(ev)}\n\t\t\t\t\t/>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass={circle({\n\t\t\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\t\t})}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div class='flex-1 overflow-hidden text-ellipsis'>\n\t\t\t\t\t<slot />\n\t\t\t\t</div>\n\t\t\t</label>\n\t\t);\n\t}\n\n\tprivate _onChange(ev: Event) {\n\t\tif (asBoolean(this.disabled)) {\n\t\t\tev.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tconst checked = (ev.target as HTMLInputElement).checked;\n\t\tthis._setValue(checked);\n\t}\n\n\tprivate _setValue(checked: boolean) {\n\t\tthis.checked = checked;\n\t\tthis.checkedChange.emit(checked);\n\t\tthis._internals.setFormValue(checked ? 'on' : 'off');\n\t}\n}\n"]}
1
+ {"version":3,"file":"radio.component.js","sourceRoot":"","sources":["../../../../src/components/atoms/radio/radio.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,SAAS,EACT,KAAK,EAEL,IAAI,EACJ,KAAK,EACL,CAAC,GACD,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,MAAM,KAAK,GAAG,GAAG,CAChB;IACC,qDAAqD;IACrD,gDAAgD;IAChD,SAAS;CACT,EACD;IACC,QAAQ,EAAE;QACT,QAAQ,EAAE;YACT,KAAK,EAAE;gBACN,yBAAyB;gBACzB,2BAA2B;gBAC3B,+CAA+C;gBAC/C,mFAAmF;gBACnF,qBAAqB;gBACrB,mDAAmD;gBACnD,wCAAwC;gBACxC,+DAA+D;gBAC/D,mGAAmG;aACnG;YACD,IAAI,EAAE,kDAAkD;SACxD;KACD;IACD,gBAAgB,EAAE;QACjB;YACC,QAAQ,EAAE,KAAK;YACf,KAAK,EAAE;gBACN,yBAAyB;gBACzB,2BAA2B;gBAC3B,+CAA+C;gBAC/C,mFAAmF;aACnF;SACD;KACD;CACD,CACD,CAAC;AAEF,MAAM,MAAM,GAAG,GAAG,CACjB;IACC,OAAO;IACP,6BAA6B;IAC7B,2FAA2F;IAC3F,SAAS;CACT,EACD;IACC,QAAQ,EAAE;QACT,QAAQ,EAAE;YACT,KAAK,EACJ,0EAA0E;YAC3E,IAAI,EAAE,2BAA2B;SACjC;KACD;CACD,CACD,CAAC;AAOF,MAAM,OAAO,KAAK;IACjB;;OAEG;IACK,KAAK,CAAS;IAEtB;;OAEG;IACsB,QAAQ,GAAY,KAAK,CAAC;IAEnD;;OAEG;IACsB,QAAQ,GAAY,IAAI,CAAC;IAElD;;OAEG;IACsB,EAAE,CAAS;IAEpC;;OAEG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,sCAAsC;gBAChD,8DAAQ,CACH,CACC,CACR,CAAC;IACH,CAAC;IAEO,SAAS,CAAC,EAAS;QAC1B,IAAI,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC9B,EAAE,CAAC,cAAc,EAAE,CAAC;YACpB,OAAO;QACR,CAAC;QAED,MAAM,OAAO,GAAI,EAAE,CAAC,MAA2B,CAAC,OAAO,CAAC;QACxD,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IAEO,SAAS,CAAC,OAAgB;QACjC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACtD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {\n\tAttachInternals,\n\tComponent,\n\tEvent,\n\tEventEmitter,\n\tProp,\n\tState,\n\th,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { asBoolean } from '../../../utils/as-boolean';\nimport { nonce } from '../../../utils/nonce';\n\nconst radio = cva(\n\t[\n\t\t'peer appearance-none m-0 outline-none flex-shrink-0',\n\t\t'rounded-full border border-inset border-solid ',\n\t\t'w-4 h-4',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tdisabled: {\n\t\t\t\tfalse: [\n\t\t\t\t\t'cursor-pointer shadow-1',\n\t\t\t\t\t'bg-white border-storm-100',\n\t\t\t\t\t'hover:bg-indigo-100 hover:border-storm-500/20',\n\t\t\t\t\t'group-hover/radio-label:bg-indigo-100 group-hover/radio-label:border-storm-500/20',\n\t\t\t\t\t'checked:cursor-auto',\n\t\t\t\t\t'checked:bg-indigo-600 checked:border-storm-500/20',\n\t\t\t\t\t'checked:ring-2 checked:ring-indigo-100',\n\t\t\t\t\t'checked:hover:bg-indigo-700 checked:hover:border-storm-500/20',\n\t\t\t\t\t'checked:group-hover/radio-label:bg-indigo-700 checked:group-hover/radio-label:border-storm-500/20',\n\t\t\t\t],\n\t\t\t\ttrue: 'bg-white-600 border-storm-50 cursor-not-allowed ',\n\t\t\t},\n\t\t},\n\t\tcompoundVariants: [\n\t\t\t{\n\t\t\t\tdisabled: false,\n\t\t\t\tclass: [\n\t\t\t\t\t'cursor-pointer shadow-1',\n\t\t\t\t\t'bg-white border-storm-100',\n\t\t\t\t\t'hover:bg-indigo-100 hover:border-storm-500/20',\n\t\t\t\t\t'group-hover/radio-label:bg-indigo-100 group-hover/radio-label:border-storm-500/20',\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t}\n);\n\nconst circle = cva(\n\t[\n\t\t'block',\n\t\t'rounded-full bg-transparent',\n\t\t'absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 pointer-events-none',\n\t\t'w-2 h-2',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tdisabled: {\n\t\t\t\tfalse:\n\t\t\t\t\t'peer-checked:bg-white peer-checked:ring-1 peer-checked:ring-storm-500/10',\n\t\t\t\ttrue: 'peer-checked:bg-storm-200',\n\t\t\t},\n\t\t},\n\t}\n);\n\n@Component({\n\ttag: 'p-radio',\n\tstyleUrl: 'radio.component.css',\n\tformAssociated: true,\n})\nexport class Radio {\n\t/**\n\t * The value of the radio button\n\t */\n\t@Prop() value: string;\n\n\t/**\n\t * Wether the radio is disabled\n\t */\n\t@Prop({ reflect: true }) disabled: boolean = false;\n\n\t/**\n\t * Wether the radio is required\n\t */\n\t@Prop({ reflect: true }) required: boolean = true;\n\n\t/**\n\t * The id of the radio button\n\t */\n\t@Prop({ reflect: true }) id: string;\n\n\t/**\n\t * The name of the radio button\n\t */\n\t@Prop({ reflect: true }) name: string;\n\n\t/**\n\t * Wether the radio is checked\n\t */\n\t@Prop({ reflect: true }) checked: boolean = false;\n\n\t/**\n\t * Event whenever the checked changes\n\t */\n\t@Event() checkedChange: EventEmitter<boolean>;\n\n\t@State() private _nonce = nonce(5);\n\n\t@AttachInternals() _internals: ElementInternals;\n\n\tformResetCallback() {\n\t\tthis._setValue(false);\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 id = this.id?.length ? this.id : this._nonce;\n\n\t\treturn (\n\t\t\t<label\n\t\t\t\thtmlFor={id}\n\t\t\t\tclass='flex items-center justify-start gap-2'\n\t\t\t>\n\t\t\t\t<div class='relative flex flex-shrink-0 items-center'>\n\t\t\t\t\t<input\n\t\t\t\t\t\tclass={radio({\n\t\t\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\t\t})}\n\t\t\t\t\t\ttype='radio'\n\t\t\t\t\t\tid={id}\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\tchecked={this.checked}\n\t\t\t\t\t\tdisabled={asBoolean(this.disabled)}\n\t\t\t\t\t\tonChange={ev => this._onChange(ev)}\n\t\t\t\t\t/>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass={circle({\n\t\t\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\t\t})}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div class='flex-1 overflow-hidden text-ellipsis'>\n\t\t\t\t\t<slot />\n\t\t\t\t</div>\n\t\t\t</label>\n\t\t);\n\t}\n\n\tprivate _onChange(ev: Event) {\n\t\tif (asBoolean(this.disabled)) {\n\t\t\tev.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tconst checked = (ev.target as HTMLInputElement).checked;\n\t\tthis._setValue(checked);\n\t}\n\n\tprivate _setValue(checked: boolean) {\n\t\tthis.checked = checked;\n\t\tthis.checkedChange.emit(checked);\n\t\tthis._internals.setFormValue(checked ? 'on' : 'off');\n\t}\n}\n"]}
@@ -1 +1 @@
1
- *{box-sizing:border-box}.static{position:static!important}.inline-block{display:inline-block!important}.flex{display:flex!important}.h-10{height:2.5rem!important}.h-6{height:1.5rem!important}.h-8{height:2rem!important}.w-10{width:2.5rem!important}.w-6{width:1.5rem!important}.w-8{width:2rem!important}.w-inherit{width:inherit!important}.cursor-not-allowed{cursor:not-allowed!important}.cursor-pointer{cursor:pointer!important}.cursor-wait{cursor:wait!important}.items-center{align-items:center!important}.justify-center{justify-content:center!important}.gap-1{gap:.25rem!important}.gap-2{gap:.5rem!important}.rounded-lg{border-radius:.5rem!important}.rounded-e-lg{border-end-end-radius:.5rem!important;border-start-end-radius:.5rem!important}.rounded-s-lg{border-end-start-radius:.5rem!important;border-start-start-radius:.5rem!important}.border{border-width:1px!important}.border-indigo-600{--tw-border-opacity:1!important;border-color:rgb(82 138 250/var(--tw-border-opacity,1))!important}.border-storm-500\/20{border-color:rgba(24,30,41,.2)!important}.border-transparent{border-color:transparent!important}.bg-indigo-200{--tw-bg-opacity:1!important;background-color:rgb(199 217 253/var(--tw-bg-opacity,1))!important}.bg-indigo-600{--tw-bg-opacity:1!important;background-color:rgb(82 138 250/var(--tw-bg-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-2{padding:.5rem!important}.px-2{padding-left:.5rem!important;padding-right:.5rem!important}.px-3{padding-left:.75rem!important;padding-right:.75rem!important}.py-1{padding-bottom:.25rem!important;padding-top:.25rem!important}.text-base{font-size:1rem!important;line-height:1.5rem!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-xs{font-size:.75rem!important;line-height:1rem!important}.font-semibold{font-weight:600!important}.leading-4{line-height:1rem!important}.text-indigo-300{--tw-text-opacity:1!important;color:rgb(187 209 253/var(--tw-text-opacity,1))!important}.text-indigo-500{--tw-text-opacity:1!important;color:rgb(142 179 251/var(--tw-text-opacity,1))!important}.text-indigo-700{--tw-text-opacity:1!important;color:rgb(47 111 240/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}.text-storm-500\/60{color:rgba(24,30,41,.6)!important}.text-white{--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}.text-white\/60{color:hsla(0,0%,100%,.6)!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}.ring,.ring-2{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)!important}.ring-2{--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(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)!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}.drop-shadow-1{--tw-drop-shadow:drop-shadow(0 1px 1px rgba(0,2,2,.08))!important}.drop-shadow-1,.drop-shadow-primary-button{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.drop-shadow-primary-button{--tw-drop-shadow:drop-shadow(0px 1px 1px 0px rgba(24,30 41,0.08))!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}}.hover\:bg-indigo-700:hover{--tw-bg-opacity:1!important;background-color:rgb(47 111 240/var(--tw-bg-opacity,1))!important}.hover\:bg-white-600:hover{--tw-bg-opacity:1!important;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))!important}.hover\:text-indigo-800:hover{--tw-text-opacity:1!important;color:rgb(27 88 210/var(--tw-text-opacity,1))!important}.hover\:drop-shadow-1:hover{--tw-drop-shadow:drop-shadow(0 1px 1px rgba(0,2,2,.08))!important}.hover\:drop-shadow-1:hover,.hover\:drop-shadow-2:hover{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.hover\:drop-shadow-2:hover{--tw-drop-shadow:drop-shadow(0 1px 1px rgba(0,2,2,.04)) drop-shadow(0 2px 2px rgba(0,2,2,.04)) drop-shadow(0 4px 4px rgba(0,2,2,.04))!important}.active\:border-indigo-600:active{--tw-border-opacity:1!important;border-color:rgb(82 138 250/var(--tw-border-opacity,1))!important}.active\:border-storm-500\/10:active{border-color:rgba(24,30,41,.1)!important}.active\:text-indigo-800:active{--tw-text-opacity:1!important;color:rgb(27 88 210/var(--tw-text-opacity,1))!important}.active\:text-negative-red-800:active{--tw-text-opacity:1!important;color:rgb(141 16 16/var(--tw-text-opacity,1))!important}.active\:text-storm-500\/60:active{color:rgba(24,30,41,.6)!important}.active\:text-white\/60:active{color:hsla(0,0%,100%,.6)!important}.active\:ring:active{--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}.active\:ring-2:active,.active\:ring:active{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)!important}.active\:ring-2:active{--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(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)!important}.active\:ring-indigo-100:active{--tw-ring-opacity:1!important;--tw-ring-color:rgb(227 236 254/var(--tw-ring-opacity,1))!important}.group:hover .group-hover\:text-indigo-700{--tw-text-opacity:1!important;color:rgb(47 111 240/var(--tw-text-opacity,1))!important}.group:hover .group-hover\:text-storm-500{--tw-text-opacity:1!important;color:rgb(24 30 41/var(--tw-text-opacity,1))!important}.group:hover .group-hover\:text-white{--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}.group:active .group-active\:text-indigo-800{--tw-text-opacity:1!important;color:rgb(27 88 210/var(--tw-text-opacity,1))!important}.group:active .group-active\:text-storm-500\/60{color:rgba(24,30,41,.6)!important}.group:active .group-active\:text-white\/60{color:hsla(0,0%,100%,.6)!important}
1
+ *{box-sizing:border-box}.static{position:static!important}.inline-block{display:inline-block!important}.flex{display:flex!important}.h-10{height:2.5rem!important}.h-6{height:1.5rem!important}.h-8{height:2rem!important}.w-10{width:2.5rem!important}.w-6{width:1.5rem!important}.w-8{width:2rem!important}.w-inherit{width:inherit!important}.cursor-not-allowed{cursor:not-allowed!important}.cursor-pointer{cursor:pointer!important}.cursor-wait{cursor:wait!important}.items-center{align-items:center!important}.justify-center{justify-content:center!important}.gap-1{gap:.25rem!important}.gap-2{gap:.5rem!important}.rounded-lg{border-radius:.5rem!important}.rounded-e-lg{border-end-end-radius:.5rem!important;border-start-end-radius:.5rem!important}.rounded-s-lg{border-end-start-radius:.5rem!important;border-start-start-radius:.5rem!important}.border{border-width:1px!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-500\/20{border-color:rgba(24,30,41,.2)!important}.border-transparent{border-color:transparent!important}.bg-indigo-200{--tw-bg-opacity:1!important;background-color:rgb(199 217 253/var(--tw-bg-opacity,1))!important}.bg-indigo-600{--tw-bg-opacity:1!important;background-color:rgb(82 138 250/var(--tw-bg-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-2{padding:.5rem!important}.px-2{padding-left:.5rem!important;padding-right:.5rem!important}.px-3{padding-left:.75rem!important;padding-right:.75rem!important}.py-1{padding-bottom:.25rem!important;padding-top:.25rem!important}.text-base{font-size:1rem!important;line-height:1.5rem!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-xs{font-size:.75rem!important;line-height:1rem!important}.font-semibold{font-weight:600!important}.leading-4{line-height:1rem!important}.text-indigo-300{--tw-text-opacity:1!important;color:rgb(187 209 253/var(--tw-text-opacity,1))!important}.text-indigo-500{--tw-text-opacity:1!important;color:rgb(142 179 251/var(--tw-text-opacity,1))!important}.text-indigo-700{--tw-text-opacity:1!important;color:rgb(47 111 240/var(--tw-text-opacity,1))!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}.text-storm-500\/60{color:rgba(24,30,41,.6)!important}.text-white{--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}.text-white\/60{color:hsla(0,0%,100%,.6)!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}.ring,.ring-2{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)!important}.ring-2{--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(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)!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}.drop-shadow-1{--tw-drop-shadow:drop-shadow(0 1px 1px rgba(0,2,2,.08))!important}.drop-shadow-1,.drop-shadow-primary-button{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.drop-shadow-primary-button{--tw-drop-shadow:drop-shadow(0px 1px 1px 0px rgba(24,30 41,0.08))!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}}.hover\:bg-indigo-700:hover{--tw-bg-opacity:1!important;background-color:rgb(47 111 240/var(--tw-bg-opacity,1))!important}.hover\:bg-white-600:hover{--tw-bg-opacity:1!important;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))!important}.hover\:text-indigo-800:hover{--tw-text-opacity:1!important;color:rgb(27 88 210/var(--tw-text-opacity,1))!important}.hover\:drop-shadow-1:hover{--tw-drop-shadow:drop-shadow(0 1px 1px rgba(0,2,2,.08))!important}.hover\:drop-shadow-1:hover,.hover\:drop-shadow-2:hover{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.hover\:drop-shadow-2:hover{--tw-drop-shadow:drop-shadow(0 1px 1px rgba(0,2,2,.04)) drop-shadow(0 2px 2px rgba(0,2,2,.04)) drop-shadow(0 4px 4px rgba(0,2,2,.04))!important}.active\:border-indigo-600:active{--tw-border-opacity:1!important;border-color:rgb(82 138 250/var(--tw-border-opacity,1))!important}.active\:border-storm-500\/10:active{border-color:rgba(24,30,41,.1)!important}.active\:text-indigo-800:active{--tw-text-opacity:1!important;color:rgb(27 88 210/var(--tw-text-opacity,1))!important}.active\:text-negative-red-800:active{--tw-text-opacity:1!important;color:rgb(141 16 16/var(--tw-text-opacity,1))!important}.active\:text-storm-500\/60:active{color:rgba(24,30,41,.6)!important}.active\:text-white\/60:active{color:hsla(0,0%,100%,.6)!important}.active\:ring:active{--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}.active\:ring-2:active,.active\:ring:active{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)!important}.active\:ring-2:active{--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(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)!important}.active\:ring-indigo-100:active{--tw-ring-opacity:1!important;--tw-ring-color:rgb(227 236 254/var(--tw-ring-opacity,1))!important}.group:hover .group-hover\:text-indigo-700{--tw-text-opacity:1!important;color:rgb(47 111 240/var(--tw-text-opacity,1))!important}.group:hover .group-hover\:text-negative-red-800{--tw-text-opacity:1!important;color:rgb(141 16 16/var(--tw-text-opacity,1))!important}.group:hover .group-hover\:text-storm-500{--tw-text-opacity:1!important;color:rgb(24 30 41/var(--tw-text-opacity,1))!important}.group:hover .group-hover\:text-white{--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}.group:active .group-active\:text-indigo-800{--tw-text-opacity:1!important;color:rgb(27 88 210/var(--tw-text-opacity,1))!important}.group:active .group-active\:text-storm-500\/60{color:rgba(24,30,41,.6)!important}.group:active .group-active\:text-white\/60{color:hsla(0,0%,100%,.6)!important}
@@ -153,7 +153,7 @@ const button = cva([
153
153
  {
154
154
  variant: ['secondary', 'dropdown'],
155
155
  error: true,
156
- class: 'border border-negative-red-500text-negative-red-800 ring ring-2 ring-negative-red-50 active:text-negative-red-800',
156
+ class: 'border border-negative-red-500 text-negative-red-800 ring ring-2 ring-negative-red-50 active:text-negative-red-800',
157
157
  },
158
158
  {
159
159
  variant: ['text', 'transparent'],
@@ -275,7 +275,7 @@ const icon = cva([], {
275
275
  variant: ['secondary', 'dropdown'],
276
276
  active: false,
277
277
  error: true,
278
- class: 'text-negative-red-500group-hover:text-negative-red-800',
278
+ class: 'text-negative-red-500 group-hover:text-negative-red-800',
279
279
  },
280
280
  {
281
281
  variant: ['secondary', 'dropdown'],
@@ -391,7 +391,7 @@ export class Button {
391
391
  : 'button';
392
392
  const hostClass = cn('p-button inline-block', this.class);
393
393
  const active = asBoolean(this.active) || hostClass?.includes('active');
394
- return (h(Host, { key: '88cd69c8ea40beba6702dff174c98ba201c3e7ec', class: hostClass }, h(VariableTag, { key: '5371123e9e4f71e353bb3b9142c369c72f935478', disabled: asBoolean(this.disabled), href: this.href, type: this.variant !== 'text' ? this.type : undefined, target: this.target, class: button({
394
+ return (h(Host, { key: '2c93e8cdffee26715bd8960ebd62d3aa2a449145', class: hostClass }, h(VariableTag, { key: 'de3431ad362c507e5c8bfdd14fea0a6da965ab5b', disabled: asBoolean(this.disabled), href: this.href, type: this.variant !== 'text' ? this.type : undefined, target: this.target, class: button({
395
395
  variant: this.variant,
396
396
  size: this.size,
397
397
  loading: asBoolean(this.loading),
@@ -400,14 +400,14 @@ export class Button {
400
400
  iconOnly: asBoolean(this.iconOnly),
401
401
  active,
402
402
  error: asBoolean(this.error),
403
- }) }, this.chevron && this.chevronPosition === 'start' && (h("p-icon", { key: '6d83d27c2f41694d899b5581b307da94c431b13a', variant: 'caret', rotate: this.chevron === 'up' ? 180 : 0 })), this.icon &&
403
+ }) }, this.chevron && this.chevronPosition === 'start' && (h("p-icon", { key: '369844e17d906be99864f4c5c75597606cd885e3', variant: 'caret', rotate: this.chevron === 'up' ? 180 : 0 })), this.icon &&
404
404
  this.iconPosition === 'start' &&
405
405
  !(this.iconOnly && this.loading) &&
406
406
  this._getIcon(), this.label ? this.label : h("slot", null), this.icon &&
407
407
  this.iconPosition === 'end' &&
408
408
  !this.loading &&
409
409
  !this.chevron &&
410
- this._getIcon(), this.chevron && !this.loading && this.chevronPosition === 'end' && (h("p-icon", { key: 'ffa0a52ebc38c50f25245f8f75e78f93a5a0333b', variant: 'caret', rotate: this.chevron === 'up' ? 180 : 0 })), this.loading && h("p-loader", { key: '2357a43b1dbb8297200ad3d1261d746af2108629', color: loaderColor }))));
410
+ this._getIcon(), this.chevron && !this.loading && this.chevronPosition === 'end' && (h("p-icon", { key: 'eac0ca9ed5fad8cc19f9ef0f33bbde937808dfef', variant: 'caret', rotate: this.chevron === 'up' ? 180 : 0 })), this.loading && h("p-loader", { key: '2a9c181dcd798a1f89556817b103c475bb5d1497', color: loaderColor }))));
411
411
  }
412
412
  handleClick(ev) {
413
413
  if (this.loading || this.disabled) {
@@ -1 +1 @@
1
- {"version":3,"file":"button.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/button/button.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,GACJ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAG/C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAEvC,MAAM,MAAM,GAAG,GAAG,CACjB;IACC,OAAO;IACP,yBAAyB;IACzB,kCAAkC;IAClC,gBAAgB;CAChB,EACD;IACC,QAAQ,EAAE;QACT,OAAO,EAAE;YACR,OAAO,EAAE,CAAC,qB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {\n\tComponent,\n\tEvent,\n\tEventEmitter,\n\th,\n\tHost,\n\tListen,\n\tProp,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { RotateOptions } from '../../../types/tailwind';\nimport { IconFlipOptions, IconVariant } from '../../atoms/icon/icon.component';\nimport { asBoolean } from '../../../utils/as-boolean';\nimport { cn } from '../../../utils/cn';\n\nconst button = cva(\n\t[\n\t\t'group',\n\t\t'font-semibold leading-4',\n\t\t'flex items-center justify-center',\n\t\t'cursor-pointer',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tprimary: ['border-storm-500/20', 'text-white'],\n\t\t\t\tsecondary: null,\n\t\t\t\ttext: null,\n\t\t\t\ttransparent: 'bg-transparent border-transparent',\n\t\t\t\tdropdown: null,\n\t\t\t},\n\t\t\tactive: {\n\t\t\t\ttrue: null,\n\t\t\t\tfalse: null,\n\t\t\t},\n\t\t\terror: {\n\t\t\t\ttrue: null,\n\t\t\t\tfalse: null,\n\t\t\t},\n\t\t\tloading: {\n\t\t\t\ttrue: 'cursor-wait',\n\t\t\t\tfalse: null,\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\tsm: ['text-xs h-6 gap-1'],\n\t\t\t\tbase: ['text-sm h-8 gap-2'],\n\t\t\t\tlg: ['text-base h-10 gap-2'],\n\t\t\t},\n\t\t\tdisabled: {\n\t\t\t\ttrue: 'cursor-not-allowed',\n\t\t\t\tfalse: null,\n\t\t\t},\n\t\t\tbuttonGroupPosition: {\n\t\t\t\tnone: null,\n\t\t\t\tstart: null,\n\t\t\t\tcenter: null,\n\t\t\t\tend: null,\n\t\t\t},\n\t\t\ticonOnly: {\n\t\t\t\ttrue: 'justify-center',\n\t\t\t\tfalse: 'w-inherit py-1',\n\t\t\t},\n\t\t},\n\t\tcompoundVariants: [\n\t\t\t// variants\n\t\t\t{\n\t\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\t\tclass: 'bg-white',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['primary', 'secondary', 'dropdown'],\n\t\t\t\tdisabled: false,\n\t\t\t\tclass: 'border',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['primary', 'secondary', 'transparent', 'dropdown'],\n\t\t\t\tbuttonGroupPosition: 'none',\n\t\t\t\tclass: 'rounded-lg',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['primary', 'secondary', 'transparent', 'dropdown'],\n\t\t\t\tbuttonGroupPosition: 'start',\n\t\t\t\tclass: 'rounded-s-lg',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['primary', 'secondary', 'transparent', 'dropdown'],\n\t\t\t\tbuttonGroupPosition: 'end',\n\t\t\t\tclass: 'rounded-e-lg',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\t\tdisabled: false,\n\t\t\t\terror: false,\n\t\t\t\tclass: 'text-storm-500',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: 'primary',\n\t\t\t\tdisabled: true,\n\t\t\t\tclass: 'bg-indigo-200',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: 'primary',\n\t\t\t\tdisabled: false,\n\t\t\t\tclass: 'bg-indigo-600',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: 'primary',\n\t\t\t\tdisabled: false,\n\t\t\t\tloading: false,\n\t\t\t\tclass: [\n\t\t\t\t\t'active:border-storm-500/10 active:ring active:ring-2 active:text-white/60',\n\t\t\t\t\t'drop-shadow-primary-button hover:drop-shadow-2 hover:bg-indigo-700 active:ring-indigo-100',\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: 'primary',\n\t\t\t\tdisabled: false,\n\t\t\t\tloading: false,\n\t\t\t\tactive: true,\n\t\t\t\tclass: 'ring ring-2',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: 'primary',\n\t\t\t\tdisabled: false,\n\t\t\t\tloading: false,\n\t\t\t\tactive: true,\n\t\t\t\tclass: 'ring-indigo-100',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\t\tdisabled: true,\n\t\t\t\tclass: 'border bg-white-600 text-storm-100',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\t\tdisabled: false,\n\t\t\t\tclass: 'text-storm-500',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\t\tdisabled: false,\n\t\t\t\tloading: false,\n\t\t\t\tclass:\n\t\t\t\t\t'drop-shadow-1 hover:drop-shadow-1 hover:bg-white-600 active:ring-indigo-100 active:text-storm-500/60',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\t\tdisabled: false,\n\t\t\t\tloading: false,\n\t\t\t\terror: false,\n\t\t\t\tclass: 'active:border-indigo-600 active:ring active:ring-2',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\t\tdisabled: false,\n\t\t\t\tloading: false,\n\t\t\t\tactive: true,\n\t\t\t\terror: false,\n\t\t\t\tclass: 'border-indigo-600 ring ring-2 ring-indigo-100',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\t\terror: false,\n\t\t\t\tactive: false,\n\t\t\t\tclass: ['border-storm-500/20'],\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\t\terror: true,\n\t\t\t\tclass:\n\t\t\t\t\t'border border-negative-red-500text-negative-red-800 ring ring-2 ring-negative-red-50 active:text-negative-red-800',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tvariant: ['text', 'transparent'],\n\t\t\t\tdisabled: false,\n\t\t\t\tclass: 'text-indigo-700 hover:text-indigo-800',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['text', 'transparent'],\n\t\t\t\tdisabled: true,\n\t\t\t\tclass: 'text-indigo-300',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['text', 'transparent'],\n\t\t\t\tdisabled: false,\n\t\t\t\tloading: false,\n\t\t\t\tclass: 'active:text-indigo-800',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tvariant: ['primary', 'secondary', 'transparent'],\n\t\t\t\tsize: ['base', 'sm'],\n\t\t\t\ticonOnly: false,\n\t\t\t\tclass: 'px-2',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['primary', 'secondary', 'transparent'],\n\t\t\t\tsize: 'lg',\n\t\t\t\ticonOnly: false,\n\t\t\t\tclass: 'px-3',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: 'dropdown',\n\t\t\t\ticonOnly: false,\n\t\t\t\tclass: 'p-2',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tvariant: ['primary', 'secondary', 'transparent', 'text'],\n\t\t\t\ticonOnly: false,\n\t\t\t\tclass: 'py-1',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tsize: 'sm',\n\t\t\t\ticonOnly: true,\n\t\t\t\tclass: 'w-6',\n\t\t\t},\n\t\t\t{\n\t\t\t\tsize: 'base',\n\t\t\t\ticonOnly: true,\n\t\t\t\tclass: 'w-8',\n\t\t\t},\n\t\t\t{\n\t\t\t\tsize: 'lg',\n\t\t\t\ticonOnly: true,\n\t\t\t\tclass: 'w-10',\n\t\t\t},\n\t\t],\n\t}\n);\n\nconst icon = cva([], {\n\tvariants: {\n\t\tsize: {\n\t\t\tsm: 'text-xs',\n\t\t\tbase: 'text-base',\n\t\t\tlg: 'text-base',\n\t\t},\n\t\tvariant: {\n\t\t\tprimary: null,\n\t\t\tsecondary: null,\n\t\t\ttext: null,\n\t\t\ttransparent: null,\n\t\t\tdropdown: null,\n\t\t},\n\t\tdisabled: {\n\t\t\ttrue: null,\n\t\t\tfalse: null,\n\t\t},\n\t\tactive: {\n\t\t\ttrue: null,\n\t\t\tfalse: null,\n\t\t},\n\t\terror: {\n\t\t\ttrue: null,\n\t\t\tfalse: null,\n\t\t},\n\t},\n\tcompoundVariants: [\n\t\t{\n\t\t\tvariant: 'primary',\n\t\t\tdisabled: false,\n\t\t\tactive: false,\n\t\t\terror: false,\n\t\t\tclass:\n\t\t\t\t'text-indigo-300 group-hover:text-white group-active:text-white/60',\n\t\t},\n\t\t{\n\t\t\tvariant: 'primary',\n\t\t\tdisabled: false,\n\t\t\tactive: true,\n\t\t\tclass: 'text-white/60',\n\t\t},\n\t\t{\n\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\tdisabled: false,\n\t\t\tactive: false,\n\t\t\terror: false,\n\t\t\tclass:\n\t\t\t\t'text-storm-300 group-hover:text-storm-500 group-active:text-storm-500/60',\n\t\t},\n\t\t{\n\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\tdisabled: false,\n\t\t\tactive: true,\n\t\t\terror: false,\n\t\t\tclass: 'text-storm-500/60',\n\t\t},\n\t\t{\n\t\t\tvariant: ['transparent', 'text'],\n\t\t\tdisabled: false,\n\t\t\tactive: false,\n\t\t\tclass:\n\t\t\t\t'text-indigo-500 group-hover:text-indigo-700 group-active:text-indigo-800',\n\t\t},\n\t\t{\n\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\tactive: false,\n\t\t\terror: true,\n\t\t\tclass: 'text-negative-red-500group-hover:text-negative-red-800',\n\t\t},\n\t\t{\n\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\tactive: true,\n\t\t\terror: true,\n\t\t\tclass: 'text-negative-red-800',\n\t\t},\n\t],\n});\n\nexport type ButtonVariant =\n\t| 'primary'\n\t| 'secondary'\n\t| 'transparent'\n\t| 'text'\n\t| 'dropdown';\n\n@Component({\n\ttag: 'p-button',\n\tstyleUrl: 'button.component.css',\n})\nexport class Button {\n\t/**\n\t * The label of the button (Can use slot)\n\t */\n\t@Prop() label?: string;\n\n\t/**\n\t * The type of the button\n\t */\n\t@Prop() as?: 'a' | 'button' = 'button';\n\n\t/**\n\t * The variant of the button\n\t */\n\t@Prop() variant?: ButtonVariant = 'primary';\n\n\t/**\n\t * Wether to force an active state\n\t */\n\t@Prop() active?: boolean = false;\n\n\t/**\n\t * Wether to show a error state\n\t */\n\t@Prop() error?: boolean = false;\n\n\t/**\n\t * Href in case of \"text\" version\n\t */\n\t@Prop() href?: string;\n\n\t/**\n\t * Target in case of \"text\" version\n\t */\n\t@Prop() target?: string;\n\n\t/**\n\t * The size of the button\n\t */\n\t@Prop() size?: 'sm' | 'base' | 'lg' = 'base';\n\n\t/**\n\t * The type of the button\n\t */\n\t@Prop() type?: 'button' | 'submit' = 'button';\n\n\t/**\n\t * Wether to show a loader or not\n\t */\n\t@Prop() loading?: boolean = false;\n\n\t/**\n\t * Wether to show a chevron or not\n\t */\n\t@Prop() chevron?: boolean | 'up' | 'down' = false;\n\n\t/**\n\t * Chevron position\n\t */\n\t@Prop() chevronPosition?: 'start' | 'end' = 'end';\n\n\t/**\n\t * Wether the button is disabled\n\t */\n\t@Prop() disabled?: boolean = false;\n\n\t/**\n\t * Icon to show on the button\n\t */\n\t@Prop() icon?: IconVariant;\n\n\t/**\n\t * Wether the button is icon only\n\t */\n\t@Prop() iconOnly?: boolean = false;\n\n\t/**\n\t * Icon position\n\t */\n\t@Prop() iconPosition?: 'start' | 'end' = 'start';\n\n\t/**\n\t * Icon flip\n\t */\n\t@Prop() iconFlip?: IconFlipOptions;\n\n\t/**\n\t * Icon rotate\n\t */\n\t@Prop() iconRotate?: RotateOptions;\n\n\t/**\n\t * Wether the button should inherit text styles\n\t */\n\t@Prop() inheritText?: boolean = false;\n\n\t/**\n\t * Position of the button in the button group, mostly un-used if not in a group\n\t */\n\t@Prop() buttonGroupPosition?: 'start' | 'center' | 'end' | 'none' = 'none';\n\n\t/**\n\t * The class of the container passed by parent\n\t */\n\t@Prop() class?: string;\n\n\t/**\n\t * Button click event\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tonClick: EventEmitter<MouseEvent>;\n\n\trender() {\n\t\tlet loaderColor: 'white' | 'off-white' | 'indigo' | 'storm' = 'white';\n\t\tswitch (this.variant) {\n\t\t\tcase 'secondary':\n\t\t\tcase 'dropdown':\n\t\t\tcase 'transparent':\n\t\t\t\tloaderColor = 'off-white';\n\t\t\t\tbreak;\n\t\t\tcase 'text':\n\t\t\t\tloaderColor = 'storm';\n\t\t\t\tbreak;\n\t\t}\n\n\t\tconst VariableTag =\n\t\t\tthis.variant === 'text' || this.href?.length || this.as === 'a'\n\t\t\t\t? 'a'\n\t\t\t\t: 'button';\n\n\t\tconst hostClass = cn('p-button inline-block', this.class);\n\t\tconst active = asBoolean(this.active) || hostClass?.includes('active');\n\n\t\treturn (\n\t\t\t<Host class={hostClass}>\n\t\t\t\t<VariableTag\n\t\t\t\t\tdisabled={asBoolean(this.disabled)}\n\t\t\t\t\thref={this.href}\n\t\t\t\t\ttype={this.variant !== 'text' ? this.type : undefined}\n\t\t\t\t\ttarget={this.target}\n\t\t\t\t\tclass={button({\n\t\t\t\t\t\tvariant: this.variant,\n\t\t\t\t\t\tsize: this.size,\n\t\t\t\t\t\tloading: asBoolean(this.loading),\n\t\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\t\tbuttonGroupPosition: this.buttonGroupPosition,\n\t\t\t\t\t\ticonOnly: asBoolean(this.iconOnly),\n\t\t\t\t\t\tactive,\n\t\t\t\t\t\terror: asBoolean(this.error),\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t{this.chevron && this.chevronPosition === 'start' && (\n\t\t\t\t\t\t<p-icon\n\t\t\t\t\t\t\tvariant='caret'\n\t\t\t\t\t\t\trotate={this.chevron === 'up' ? 180 : 0}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{this.icon &&\n\t\t\t\t\t\tthis.iconPosition === 'start' &&\n\t\t\t\t\t\t!(this.iconOnly && this.loading) &&\n\t\t\t\t\t\tthis._getIcon()}\n\n\t\t\t\t\t{this.label ? this.label : <slot />}\n\n\t\t\t\t\t{this.icon &&\n\t\t\t\t\t\tthis.iconPosition === 'end' &&\n\t\t\t\t\t\t!this.loading &&\n\t\t\t\t\t\t!this.chevron &&\n\t\t\t\t\t\tthis._getIcon()}\n\n\t\t\t\t\t{this.chevron && !this.loading && this.chevronPosition === 'end' && (\n\t\t\t\t\t\t<p-icon\n\t\t\t\t\t\t\tvariant='caret'\n\t\t\t\t\t\t\trotate={this.chevron === 'up' ? 180 : 0}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{this.loading && <p-loader color={loaderColor} />}\n\t\t\t\t</VariableTag>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Listen('click', { capture: true })\n\thandleClick(ev: MouseEvent) {\n\t\tif (this.loading || this.disabled) {\n\t\t\tev.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.onClick.emit(ev);\n\t}\n\n\tprivate _getIcon() {\n\t\tif (!this.icon) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn (\n\t\t\t<p-icon\n\t\t\t\tclass={icon({\n\t\t\t\t\tsize: this.size,\n\t\t\t\t\tvariant: this.variant,\n\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\tactive: asBoolean(this.active),\n\t\t\t\t\terror: asBoolean(this.error),\n\t\t\t\t})}\n\t\t\t\tvariant={this.icon}\n\t\t\t\tflip={this.iconFlip}\n\t\t\t\trotate={this.iconRotate}\n\t\t\t/>\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"file":"button.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/button/button.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,GACJ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAG/C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAEvC,MAAM,MAAM,GAAG,GAAG,CACjB;IACC,OAAO;IACP,yBAAyB;IACzB,kCAAkC;IAClC,gBAAgB;CAChB,EACD;IACC,QAAQ,EAAE;QACT,OAAO,EAAE;YACR,OAAO,EAAE,CAAC,qBAAqB,EAAE,YAAY,CAAC;YAC9C,SAAS,EAAE,IAAI;YACf,IAAI,EAAE,IAAI;YACV,WAAW,EAAE,mCAAmC;YAChD,QAAQ,EAAE,IAAI;SACd;QACD,MAAM,EAAE;YACP,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,IAAI;SACX;QACD,KAAK,EAAE;YACN,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,IAAI;SACX;QACD,OAAO,EAAE;YACR,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,IAAI;SACX;QACD,IAAI,EAAE;YACL,EAAE,EAAE,CAAC,mBAAmB,CAAC;YACzB,IAAI,EAAE,CAAC,mBAAmB,CAAC;YAC3B,EAAE,EAAE,CAAC,sBAAsB,CAAC;SAC5B;QACD,QAAQ,EAAE;YACT,IAAI,EAAE,oBAAoB;YAC1B,KAAK,EAAE,IAAI;SACX;QACD,mBAAmB,EAAE;YACpB,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,IAAI;YACZ,GAAG,EAAE,IAAI;SACT;QACD,QAAQ,EAAE;YACT,IAAI,EAAE,gBAAgB;YACtB,KAAK,EAAE,gBAAgB;SACvB;KACD;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AE,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;aAC5B,CAAC,EACF,OAAO,EAAE,IAAI,CAAC,IAAI,EAClB,IAAI,EAAE,IAAI,CAAC,QAAQ,EACnB,MAAM,EAAE,IAAI,CAAC,UAAU,GACtB,CACF,CAAC;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {\n\tComponent,\n\tEvent,\n\tEventEmitter,\n\th,\n\tHost,\n\tListen,\n\tProp,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { RotateOptions } from '../../../types/tailwind';\nimport { IconFlipOptions, IconVariant } from '../../atoms/icon/icon.component';\nimport { asBoolean } from '../../../utils/as-boolean';\nimport { cn } from '../../../utils/cn';\n\nconst button = cva(\n\t[\n\t\t'group',\n\t\t'font-semibold leading-4',\n\t\t'flex items-center justify-center',\n\t\t'cursor-pointer',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tprimary: ['border-storm-500/20', 'text-white'],\n\t\t\t\tsecondary: null,\n\t\t\t\ttext: null,\n\t\t\t\ttransparent: 'bg-transparent border-transparent',\n\t\t\t\tdropdown: null,\n\t\t\t},\n\t\t\tactive: {\n\t\t\t\ttrue: null,\n\t\t\t\tfalse: null,\n\t\t\t},\n\t\t\terror: {\n\t\t\t\ttrue: null,\n\t\t\t\tfalse: null,\n\t\t\t},\n\t\t\tloading: {\n\t\t\t\ttrue: 'cursor-wait',\n\t\t\t\tfalse: null,\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\tsm: ['text-xs h-6 gap-1'],\n\t\t\t\tbase: ['text-sm h-8 gap-2'],\n\t\t\t\tlg: ['text-base h-10 gap-2'],\n\t\t\t},\n\t\t\tdisabled: {\n\t\t\t\ttrue: 'cursor-not-allowed',\n\t\t\t\tfalse: null,\n\t\t\t},\n\t\t\tbuttonGroupPosition: {\n\t\t\t\tnone: null,\n\t\t\t\tstart: null,\n\t\t\t\tcenter: null,\n\t\t\t\tend: null,\n\t\t\t},\n\t\t\ticonOnly: {\n\t\t\t\ttrue: 'justify-center',\n\t\t\t\tfalse: 'w-inherit py-1',\n\t\t\t},\n\t\t},\n\t\tcompoundVariants: [\n\t\t\t// variants\n\t\t\t{\n\t\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\t\tclass: 'bg-white',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['primary', 'secondary', 'dropdown'],\n\t\t\t\tdisabled: false,\n\t\t\t\tclass: 'border',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['primary', 'secondary', 'transparent', 'dropdown'],\n\t\t\t\tbuttonGroupPosition: 'none',\n\t\t\t\tclass: 'rounded-lg',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['primary', 'secondary', 'transparent', 'dropdown'],\n\t\t\t\tbuttonGroupPosition: 'start',\n\t\t\t\tclass: 'rounded-s-lg',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['primary', 'secondary', 'transparent', 'dropdown'],\n\t\t\t\tbuttonGroupPosition: 'end',\n\t\t\t\tclass: 'rounded-e-lg',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\t\tdisabled: false,\n\t\t\t\terror: false,\n\t\t\t\tclass: 'text-storm-500',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: 'primary',\n\t\t\t\tdisabled: true,\n\t\t\t\tclass: 'bg-indigo-200',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: 'primary',\n\t\t\t\tdisabled: false,\n\t\t\t\tclass: 'bg-indigo-600',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: 'primary',\n\t\t\t\tdisabled: false,\n\t\t\t\tloading: false,\n\t\t\t\tclass: [\n\t\t\t\t\t'active:border-storm-500/10 active:ring active:ring-2 active:text-white/60',\n\t\t\t\t\t'drop-shadow-primary-button hover:drop-shadow-2 hover:bg-indigo-700 active:ring-indigo-100',\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: 'primary',\n\t\t\t\tdisabled: false,\n\t\t\t\tloading: false,\n\t\t\t\tactive: true,\n\t\t\t\tclass: 'ring ring-2',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: 'primary',\n\t\t\t\tdisabled: false,\n\t\t\t\tloading: false,\n\t\t\t\tactive: true,\n\t\t\t\tclass: 'ring-indigo-100',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\t\tdisabled: true,\n\t\t\t\tclass: 'border bg-white-600 text-storm-100',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\t\tdisabled: false,\n\t\t\t\tclass: 'text-storm-500',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\t\tdisabled: false,\n\t\t\t\tloading: false,\n\t\t\t\tclass:\n\t\t\t\t\t'drop-shadow-1 hover:drop-shadow-1 hover:bg-white-600 active:ring-indigo-100 active:text-storm-500/60',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\t\tdisabled: false,\n\t\t\t\tloading: false,\n\t\t\t\terror: false,\n\t\t\t\tclass: 'active:border-indigo-600 active:ring active:ring-2',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\t\tdisabled: false,\n\t\t\t\tloading: false,\n\t\t\t\tactive: true,\n\t\t\t\terror: false,\n\t\t\t\tclass: 'border-indigo-600 ring ring-2 ring-indigo-100',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\t\terror: false,\n\t\t\t\tactive: false,\n\t\t\t\tclass: ['border-storm-500/20'],\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\t\terror: true,\n\t\t\t\tclass:\n\t\t\t\t\t'border border-negative-red-500 text-negative-red-800 ring ring-2 ring-negative-red-50 active:text-negative-red-800',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tvariant: ['text', 'transparent'],\n\t\t\t\tdisabled: false,\n\t\t\t\tclass: 'text-indigo-700 hover:text-indigo-800',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['text', 'transparent'],\n\t\t\t\tdisabled: true,\n\t\t\t\tclass: 'text-indigo-300',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['text', 'transparent'],\n\t\t\t\tdisabled: false,\n\t\t\t\tloading: false,\n\t\t\t\tclass: 'active:text-indigo-800',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tvariant: ['primary', 'secondary', 'transparent'],\n\t\t\t\tsize: ['base', 'sm'],\n\t\t\t\ticonOnly: false,\n\t\t\t\tclass: 'px-2',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: ['primary', 'secondary', 'transparent'],\n\t\t\t\tsize: 'lg',\n\t\t\t\ticonOnly: false,\n\t\t\t\tclass: 'px-3',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: 'dropdown',\n\t\t\t\ticonOnly: false,\n\t\t\t\tclass: 'p-2',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tvariant: ['primary', 'secondary', 'transparent', 'text'],\n\t\t\t\ticonOnly: false,\n\t\t\t\tclass: 'py-1',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tsize: 'sm',\n\t\t\t\ticonOnly: true,\n\t\t\t\tclass: 'w-6',\n\t\t\t},\n\t\t\t{\n\t\t\t\tsize: 'base',\n\t\t\t\ticonOnly: true,\n\t\t\t\tclass: 'w-8',\n\t\t\t},\n\t\t\t{\n\t\t\t\tsize: 'lg',\n\t\t\t\ticonOnly: true,\n\t\t\t\tclass: 'w-10',\n\t\t\t},\n\t\t],\n\t}\n);\n\nconst icon = cva([], {\n\tvariants: {\n\t\tsize: {\n\t\t\tsm: 'text-xs',\n\t\t\tbase: 'text-base',\n\t\t\tlg: 'text-base',\n\t\t},\n\t\tvariant: {\n\t\t\tprimary: null,\n\t\t\tsecondary: null,\n\t\t\ttext: null,\n\t\t\ttransparent: null,\n\t\t\tdropdown: null,\n\t\t},\n\t\tdisabled: {\n\t\t\ttrue: null,\n\t\t\tfalse: null,\n\t\t},\n\t\tactive: {\n\t\t\ttrue: null,\n\t\t\tfalse: null,\n\t\t},\n\t\terror: {\n\t\t\ttrue: null,\n\t\t\tfalse: null,\n\t\t},\n\t},\n\tcompoundVariants: [\n\t\t{\n\t\t\tvariant: 'primary',\n\t\t\tdisabled: false,\n\t\t\tactive: false,\n\t\t\terror: false,\n\t\t\tclass:\n\t\t\t\t'text-indigo-300 group-hover:text-white group-active:text-white/60',\n\t\t},\n\t\t{\n\t\t\tvariant: 'primary',\n\t\t\tdisabled: false,\n\t\t\tactive: true,\n\t\t\tclass: 'text-white/60',\n\t\t},\n\t\t{\n\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\tdisabled: false,\n\t\t\tactive: false,\n\t\t\terror: false,\n\t\t\tclass:\n\t\t\t\t'text-storm-300 group-hover:text-storm-500 group-active:text-storm-500/60',\n\t\t},\n\t\t{\n\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\tdisabled: false,\n\t\t\tactive: true,\n\t\t\terror: false,\n\t\t\tclass: 'text-storm-500/60',\n\t\t},\n\t\t{\n\t\t\tvariant: ['transparent', 'text'],\n\t\t\tdisabled: false,\n\t\t\tactive: false,\n\t\t\tclass:\n\t\t\t\t'text-indigo-500 group-hover:text-indigo-700 group-active:text-indigo-800',\n\t\t},\n\t\t{\n\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\tactive: false,\n\t\t\terror: true,\n\t\t\tclass: 'text-negative-red-500 group-hover:text-negative-red-800',\n\t\t},\n\t\t{\n\t\t\tvariant: ['secondary', 'dropdown'],\n\t\t\tactive: true,\n\t\t\terror: true,\n\t\t\tclass: 'text-negative-red-800',\n\t\t},\n\t],\n});\n\nexport type ButtonVariant =\n\t| 'primary'\n\t| 'secondary'\n\t| 'transparent'\n\t| 'text'\n\t| 'dropdown';\n\n@Component({\n\ttag: 'p-button',\n\tstyleUrl: 'button.component.css',\n})\nexport class Button {\n\t/**\n\t * The label of the button (Can use slot)\n\t */\n\t@Prop() label?: string;\n\n\t/**\n\t * The type of the button\n\t */\n\t@Prop() as?: 'a' | 'button' = 'button';\n\n\t/**\n\t * The variant of the button\n\t */\n\t@Prop() variant?: ButtonVariant = 'primary';\n\n\t/**\n\t * Wether to force an active state\n\t */\n\t@Prop() active?: boolean = false;\n\n\t/**\n\t * Wether to show a error state\n\t */\n\t@Prop() error?: boolean = false;\n\n\t/**\n\t * Href in case of \"text\" version\n\t */\n\t@Prop() href?: string;\n\n\t/**\n\t * Target in case of \"text\" version\n\t */\n\t@Prop() target?: string;\n\n\t/**\n\t * The size of the button\n\t */\n\t@Prop() size?: 'sm' | 'base' | 'lg' = 'base';\n\n\t/**\n\t * The type of the button\n\t */\n\t@Prop() type?: 'button' | 'submit' = 'button';\n\n\t/**\n\t * Wether to show a loader or not\n\t */\n\t@Prop() loading?: boolean = false;\n\n\t/**\n\t * Wether to show a chevron or not\n\t */\n\t@Prop() chevron?: boolean | 'up' | 'down' = false;\n\n\t/**\n\t * Chevron position\n\t */\n\t@Prop() chevronPosition?: 'start' | 'end' = 'end';\n\n\t/**\n\t * Wether the button is disabled\n\t */\n\t@Prop() disabled?: boolean = false;\n\n\t/**\n\t * Icon to show on the button\n\t */\n\t@Prop() icon?: IconVariant;\n\n\t/**\n\t * Wether the button is icon only\n\t */\n\t@Prop() iconOnly?: boolean = false;\n\n\t/**\n\t * Icon position\n\t */\n\t@Prop() iconPosition?: 'start' | 'end' = 'start';\n\n\t/**\n\t * Icon flip\n\t */\n\t@Prop() iconFlip?: IconFlipOptions;\n\n\t/**\n\t * Icon rotate\n\t */\n\t@Prop() iconRotate?: RotateOptions;\n\n\t/**\n\t * Wether the button should inherit text styles\n\t */\n\t@Prop() inheritText?: boolean = false;\n\n\t/**\n\t * Position of the button in the button group, mostly un-used if not in a group\n\t */\n\t@Prop() buttonGroupPosition?: 'start' | 'center' | 'end' | 'none' = 'none';\n\n\t/**\n\t * The class of the container passed by parent\n\t */\n\t@Prop() class?: string;\n\n\t/**\n\t * Button click event\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tonClick: EventEmitter<MouseEvent>;\n\n\trender() {\n\t\tlet loaderColor: 'white' | 'off-white' | 'indigo' | 'storm' = 'white';\n\t\tswitch (this.variant) {\n\t\t\tcase 'secondary':\n\t\t\tcase 'dropdown':\n\t\t\tcase 'transparent':\n\t\t\t\tloaderColor = 'off-white';\n\t\t\t\tbreak;\n\t\t\tcase 'text':\n\t\t\t\tloaderColor = 'storm';\n\t\t\t\tbreak;\n\t\t}\n\n\t\tconst VariableTag =\n\t\t\tthis.variant === 'text' || this.href?.length || this.as === 'a'\n\t\t\t\t? 'a'\n\t\t\t\t: 'button';\n\n\t\tconst hostClass = cn('p-button inline-block', this.class);\n\t\tconst active = asBoolean(this.active) || hostClass?.includes('active');\n\n\t\treturn (\n\t\t\t<Host class={hostClass}>\n\t\t\t\t<VariableTag\n\t\t\t\t\tdisabled={asBoolean(this.disabled)}\n\t\t\t\t\thref={this.href}\n\t\t\t\t\ttype={this.variant !== 'text' ? this.type : undefined}\n\t\t\t\t\ttarget={this.target}\n\t\t\t\t\tclass={button({\n\t\t\t\t\t\tvariant: this.variant,\n\t\t\t\t\t\tsize: this.size,\n\t\t\t\t\t\tloading: asBoolean(this.loading),\n\t\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\t\tbuttonGroupPosition: this.buttonGroupPosition,\n\t\t\t\t\t\ticonOnly: asBoolean(this.iconOnly),\n\t\t\t\t\t\tactive,\n\t\t\t\t\t\terror: asBoolean(this.error),\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t{this.chevron && this.chevronPosition === 'start' && (\n\t\t\t\t\t\t<p-icon\n\t\t\t\t\t\t\tvariant='caret'\n\t\t\t\t\t\t\trotate={this.chevron === 'up' ? 180 : 0}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{this.icon &&\n\t\t\t\t\t\tthis.iconPosition === 'start' &&\n\t\t\t\t\t\t!(this.iconOnly && this.loading) &&\n\t\t\t\t\t\tthis._getIcon()}\n\n\t\t\t\t\t{this.label ? this.label : <slot />}\n\n\t\t\t\t\t{this.icon &&\n\t\t\t\t\t\tthis.iconPosition === 'end' &&\n\t\t\t\t\t\t!this.loading &&\n\t\t\t\t\t\t!this.chevron &&\n\t\t\t\t\t\tthis._getIcon()}\n\n\t\t\t\t\t{this.chevron && !this.loading && this.chevronPosition === 'end' && (\n\t\t\t\t\t\t<p-icon\n\t\t\t\t\t\t\tvariant='caret'\n\t\t\t\t\t\t\trotate={this.chevron === 'up' ? 180 : 0}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{this.loading && <p-loader color={loaderColor} />}\n\t\t\t\t</VariableTag>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Listen('click', { capture: true })\n\thandleClick(ev: MouseEvent) {\n\t\tif (this.loading || this.disabled) {\n\t\t\tev.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.onClick.emit(ev);\n\t}\n\n\tprivate _getIcon() {\n\t\tif (!this.icon) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn (\n\t\t\t<p-icon\n\t\t\t\tclass={icon({\n\t\t\t\t\tsize: this.size,\n\t\t\t\t\tvariant: this.variant,\n\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\tactive: asBoolean(this.active),\n\t\t\t\t\terror: asBoolean(this.error),\n\t\t\t\t})}\n\t\t\t\tvariant={this.icon}\n\t\t\t\tflip={this.iconFlip}\n\t\t\t\trotate={this.iconRotate}\n\t\t\t/>\n\t\t);\n\t}\n}\n"]}
@@ -202,7 +202,7 @@ export class Datepicker {
202
202
  this.parseValue(this.value);
203
203
  }
204
204
  render() {
205
- return (h("p-dropdown", { key: '54a35d8bda73faf87404ee0b87f83300b5f305d8', allowOverflow: true, strategy: this.strategy, placement: this.placement, disableTriggerClick: true, applyMaxWidth: false, applyFullWidth: false, insideClick: true, show: this._showDropdown }, h("p-field", { key: '021f621ef81f909333c98f267547fa71a2e87454', slot: 'trigger', icon: this.hideIconWhenFilled && !!this._value ? null : 'calendar-multi', iconPosition: 'start', size: this.size, prefix: this.prefix, label: this.label, loading: this.loading, helper: this.helper, required: asBoolean(this.required), showOptional: asBoolean(this.showOptional), error: this.error, forceShowTooltip: !!this.error?.length && !this._showDropdown, disabled: asBoolean(this.disabled), focused: this._showDropdown, value: this._getFormattedDate(), placeholder: this.placeholder, onFocus: () => this._onFocus(), onBlur: () => this._onBlur(), onValueChange: ev => this._onValueChange(ev.detail), onInputRefChange: ev => (this._inputRef = ev.detail) }), this.enableNativePicker && this._isMobileBrowser && (h("input", { key: 'e7ee09df2d76b1d9655976d5d1aa263a2196f2e9', slot: 'trigger', type: this.mode === 'day' ? 'date' : 'month', class: 'pointer-events-none absolute left-0 top-0 z-[-10] overflow-hidden opacity-0', onInput: ev => this._onNativeInput(ev), ref: ref => (this._dateInputRef = ref), value: this._value && format(this._value, 'yyyy-MM-dd'), min: this.minDate && format(new Date(this.minDate), 'yyyy-MM-dd'), max: this.maxDate && format(new Date(this.maxDate), 'yyyy-MM-dd') })), h("div", { key: '337118c7bacf3ecf92e52c312d607be2a4d83886', slot: 'items' }, h("p-calendar", { key: 'a6bbf68d3527d303eebfd71145310c7009cceb8f', variant: 'embedded', value: this._value, onValueChange: ({ detail }) => (this.value = detail), preselectToday: this.preselectToday, disabledDates: this.disabledDates, minDate: this.minDate, maxDate: this.maxDate, disableWeekends: this.disableWeekends, enableToday: this.enableToday, todayText: this.todayText, mode: this.mode }))));
205
+ return (h("p-dropdown", { key: '54a35d8bda73faf87404ee0b87f83300b5f305d8', allowOverflow: true, strategy: this.strategy, placement: this.placement, disableTriggerClick: true, applyMaxWidth: false, applyFullWidth: false, insideClick: true, show: this._showDropdown }, h("p-field", { key: 'a6fc03db14b583980b0c572754d899660fc4605e', slot: 'trigger', icon: this.hideIconWhenFilled && !!this._value ? null : 'calendar-multi', iconPosition: 'start', size: this.size, prefix: this.prefix, label: this.label, loading: this.loading, helper: this.helper, required: asBoolean(this.required), showOptional: asBoolean(this.showOptional), error: this.error, forceShowTooltip: !!this.error?.length && !this._showDropdown, autoShowError: false, disabled: asBoolean(this.disabled), focused: this._showDropdown, value: this._getFormattedDate(), placeholder: this.placeholder, onFocus: () => this._onFocus(), onBlur: () => this._onBlur(), onValueChange: ev => this._onValueChange(ev.detail), onInputRefChange: ev => (this._inputRef = ev.detail) }), this.enableNativePicker && this._isMobileBrowser && (h("input", { key: '95697b3388b5e6544d68053880431f82555b20dd', slot: 'trigger', type: this.mode === 'day' ? 'date' : 'month', class: 'pointer-events-none absolute left-0 top-0 z-[-10] overflow-hidden opacity-0', onInput: ev => this._onNativeInput(ev), ref: ref => (this._dateInputRef = ref), value: this._value && format(this._value, 'yyyy-MM-dd'), min: this.minDate && format(new Date(this.minDate), 'yyyy-MM-dd'), max: this.maxDate && format(new Date(this.maxDate), 'yyyy-MM-dd') })), h("div", { key: 'd947ce85476dd585b3c8ab09645848c4672ae863', slot: 'items' }, h("p-calendar", { key: '7ab3704f928147b8f4f6dd9c19e4b50c61b1437b', variant: 'embedded', value: this._value, onValueChange: ({ detail }) => (this.value = detail), preselectToday: this.preselectToday, disabledDates: this.disabledDates, minDate: this.minDate, maxDate: this.maxDate, disableWeekends: this.disableWeekends, enableToday: this.enableToday, todayText: this.todayText, mode: this.mode }))));
206
206
  }
207
207
  documentClickHandler({ target }) {
208
208
  if (!this._showDropdown || childOf(target, this._el)) {
@@ -1 +1 @@
1
- {"version":3,"file":"datepicker.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/datepicker/datepicker.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,EACN,MAAM,EACN,OAAO,EACP,QAAQ,EACR,SAAS,EACT,OAAO,EACP,SAAS,EACT,KAAK,EACL,UAAU,EACV,YAAY,EACZ,WAAW,GACX,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAQtD,MAAM,OAAO,UAAU;IACtB;;OAEG;IACK,WAAW,CAAS;IAE5B;;OAEG;IACK,KAAK,CAAmC;IAEhD;;OAEG;IACK,cAAc,GAAY,KAAK,CAAC;IAExC;;OAEG;IACK,kBAAkB,GAAY,IAAI,CAAC;IAE3C;;OAEG;IACK,aAAa,CAAiC;IAEtD;;OAEG;IACK,OAAO,CAAiB;IAEhC;;OAEG;IACK,OAAO,CAAiB;IAEhC;;OAEG;IACK,eAAe,GAAY,KAAK,CAAC;IAEzC;;OAEG;IACK,WAAW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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Placement, Strategy } 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 {\n\tformat,\n\tisAfter,\n\tisBefore,\n\tisSameDay,\n\tisValid,\n\tisWeekend,\n\tparse,\n\tstartOfDay,\n\tstartOfMonth,\n\tstartOfYear,\n} from 'date-fns';\nimport { childOf, isMobileBrowser } from '../../../utils';\nimport { asBoolean } from '../../../utils/as-boolean';\n\n@Component({\n\ttag: 'p-datepicker',\n\tstyleUrl: 'datepicker.component.css',\n\tshadow: false,\n\tformAssociated: true,\n})\nexport class Datepicker {\n\t/**\n\t * The placeholder of the input\n\t */\n\t@Prop() placeholder: string;\n\n\t/**\n\t * The current value\n\t */\n\t@Prop() value: Date | string | null | undefined;\n\n\t/**\n\t * Wethter to automatically preselect today\n\t */\n\t@Prop() preselectToday: boolean = false;\n\n\t/**\n\t * Enable native picker for mobile devices\n\t */\n\t@Prop() enableNativePicker: boolean = true;\n\n\t/**\n\t * Disabled dates\n\t */\n\t@Prop() disabledDates?: Array<Date | string> | string;\n\n\t/**\n\t * Min date\n\t */\n\t@Prop() minDate?: Date | string;\n\n\t/**\n\t * Max date\n\t */\n\t@Prop() maxDate?: Date | string;\n\n\t/**\n\t * Wether to disable the weekends\n\t */\n\t@Prop() disableWeekends: boolean = false;\n\n\t/**\n\t * Wether to enable the today button\n\t */\n\t@Prop() enableToday: boolean = true;\n\n\t/**\n\t * The text to display on the today tooltip\n\t */\n\t@Prop() todayText: string = 'today';\n\n\t/**\n\t * The mode of the datepicker\n\t */\n\t@Prop() mode: 'year' | 'month' | 'day' = 'day';\n\n\t/**\n\t * Event when the value changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tvalueChange: EventEmitter<any>;\n\n\t/**\n\t * The display & parse format to use\n\t */\n\t@Prop() format: string = 'dd-MM-yyyy';\n\n\t/**\n\t * Hides the icon when filled\n\t */\n\t@Prop() hideIconWhenFilled: boolean = false;\n\n\t/**\n\t * The size of the input group used by the datepicker\n\t */\n\t@Prop() size: 'sm' | 'base' = 'base';\n\n\t/**\n\t * The prefix of the input group used by the datepicker\n\t */\n\t@Prop() prefix: string;\n\n\t/**\n\t * The label of the input group used by the datepicker\n\t */\n\t@Prop() label: string;\n\n\t/**\n\t * Wether the field is loading\n\t */\n\t@Prop() loading: boolean = false;\n\n\t/**\n\t * The helper of the input group used by the datepicker\n\t */\n\t@Prop() helper: string;\n\n\t/**\n\t * Wether the field is required\n\t */\n\t@Prop({ reflect: true }) required: boolean;\n\n\t/**\n\t * Wether to show optional when not required\n\t */\n\t@Prop({ reflect: true }) showOptional: boolean = true;\n\n\t/**\n\t * The helper of the input group used by the datepicker\n\t */\n\t@Prop({ reflect: true }) error: string;\n\n\t/**\n\t * Wether the input group is disabled used by the datepicker\n\t */\n\t@Prop({ reflect: true }) disabled: boolean = false;\n\n\t/**\n\t * The strategy of the dropdown placement\n\t */\n\t@Prop() strategy: Strategy = 'absolute';\n\n\t/**\n\t * The placement of the dropdown\n\t */\n\t@Prop({ reflect: true }) placement: Placement = 'bottom-start';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _showDropdown: any = false;\n\t@State() private _value: Date;\n\t@State() private _minDate: Date;\n\t@State() private _maxDate: Date;\n\t@State() private _disabledDates: Date[] = [];\n\t@State() private _isMobileBrowser: boolean = false;\n\n\t@AttachInternals() _internals: ElementInternals;\n\n\tprivate _onInputTimeout: NodeJS.Timeout;\n\tprivate _inputRef: HTMLInputElement | HTMLTextAreaElement;\n\tprivate _dateInputRef: HTMLInputElement;\n\n\tprivate _defaultFormats = {\n\t\tyear: 'yyyy',\n\t\tmonth: 'LLLL, yyyy',\n\t\tday: 'dd-MM-yyyy',\n\t\tdayNoDashes: 'ddMMyyyy',\n\t};\n\n\t@Watch('value')\n\tprotected parseValue(value: string | Date) {\n\t\tif (!value && this.preselectToday) {\n\t\t\tvalue = new Date();\n\t\t}\n\n\t\tif (typeof value === 'string') {\n\t\t\tvalue = new Date(value);\n\t\t}\n\n\t\tthis._setValue(value);\n\t}\n\n\t@Watch('minDate')\n\tprotected parseMinDate(minDate: string | Date) {\n\t\tif (typeof minDate === 'string') {\n\t\t\tminDate = new Date(minDate);\n\t\t}\n\n\t\tif (!isValid(minDate)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._minDate = minDate;\n\n\t\tif (isBefore(this._value, this._minDate)) {\n\t\t\tthis._setValue(null);\n\t\t}\n\t}\n\n\t@Watch('maxDate')\n\tprotected parseMaxDate(maxDate: string | Date) {\n\t\tif (typeof maxDate === 'string') {\n\t\t\tmaxDate = new Date(maxDate);\n\t\t}\n\n\t\tif (!isValid(maxDate)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._maxDate = maxDate;\n\n\t\tif (isAfter(this._value, this._maxDate)) {\n\t\t\tthis._setValue(null);\n\t\t}\n\t}\n\n\t@Watch('disabledDates')\n\tprotected parseDisabledDates(disabledDates: Array<string | Date> | string) {\n\t\tif (typeof disabledDates === 'string') {\n\t\t\tdisabledDates = JSON.parse(disabledDates);\n\t\t}\n\n\t\tif (!disabledDates || !Array.isArray(disabledDates)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// normalize all to date\n\t\tthis._disabledDates = disabledDates\n\t\t\t.map(date => {\n\t\t\t\tif (typeof date === 'string') {\n\t\t\t\t\treturn new Date(date);\n\t\t\t\t}\n\n\t\t\t\treturn date;\n\t\t\t})\n\t\t\t.filter(date => isValid(date));\n\n\t\tif (this._isDisabledDay(this._value)) {\n\t\t\tthis._setValue(null);\n\t\t}\n\t}\n\n\tformResetCallback() {\n\t\tthis._setValue(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\tcomponentWillLoad() {\n\t\tif (this.disabledDates) {\n\t\t\tthis.parseDisabledDates(this.disabledDates);\n\t\t}\n\n\t\tif (this.minDate) {\n\t\t\tthis.parseMinDate(this.minDate);\n\t\t}\n\n\t\tif (this.maxDate) {\n\t\t\tthis.parseMaxDate(this.maxDate);\n\t\t}\n\n\t\tif (this.mode !== 'day' && this.format === this._defaultFormats['day']) {\n\t\t\tthis.format = this._defaultFormats[this.mode];\n\t\t}\n\n\t\tthis._isMobileBrowser = isMobileBrowser();\n\n\t\tthis.parseValue(this.value);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<p-dropdown\n\t\t\t\tallowOverflow={true}\n\t\t\t\tstrategy={this.strategy}\n\t\t\t\tplacement={this.placement}\n\t\t\t\tdisableTriggerClick={true}\n\t\t\t\tapplyMaxWidth={false}\n\t\t\t\tapplyFullWidth={false}\n\t\t\t\tinsideClick={true}\n\t\t\t\tshow={this._showDropdown}\n\t\t\t>\n\t\t\t\t<p-field\n\t\t\t\t\tslot='trigger'\n\t\t\t\t\ticon={\n\t\t\t\t\t\tthis.hideIconWhenFilled && !!this._value ? null : 'calendar-multi'\n\t\t\t\t\t}\n\t\t\t\t\ticonPosition='start'\n\t\t\t\t\tsize={this.size}\n\t\t\t\t\tprefix={this.prefix}\n\t\t\t\t\tlabel={this.label}\n\t\t\t\t\tloading={this.loading}\n\t\t\t\t\thelper={this.helper}\n\t\t\t\t\trequired={asBoolean(this.required)}\n\t\t\t\t\tshowOptional={asBoolean(this.showOptional)}\n\t\t\t\t\terror={this.error}\n\t\t\t\t\tforceShowTooltip={!!this.error?.length && !this._showDropdown}\n\t\t\t\t\tdisabled={asBoolean(this.disabled)}\n\t\t\t\t\tfocused={this._showDropdown}\n\t\t\t\t\tvalue={this._getFormattedDate()}\n\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\tonFocus={() => this._onFocus()}\n\t\t\t\t\tonBlur={() => this._onBlur()}\n\t\t\t\t\tonValueChange={ev => this._onValueChange(ev.detail as string)}\n\t\t\t\t\tonInputRefChange={ev => (this._inputRef = ev.detail)}\n\t\t\t\t></p-field>\n\n\t\t\t\t{this.enableNativePicker && this._isMobileBrowser && (\n\t\t\t\t\t<input\n\t\t\t\t\t\tslot='trigger'\n\t\t\t\t\t\ttype={this.mode === 'day' ? 'date' : 'month'}\n\t\t\t\t\t\tclass='pointer-events-none absolute left-0 top-0 z-[-10] overflow-hidden opacity-0'\n\t\t\t\t\t\tonInput={ev => this._onNativeInput(ev)}\n\t\t\t\t\t\tref={ref => (this._dateInputRef = ref)}\n\t\t\t\t\t\tvalue={this._value && format(this._value, 'yyyy-MM-dd')}\n\t\t\t\t\t\tmin={this.minDate && format(new Date(this.minDate), 'yyyy-MM-dd')}\n\t\t\t\t\t\tmax={this.maxDate && format(new Date(this.maxDate), 'yyyy-MM-dd')}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<div slot='items'>\n\t\t\t\t\t<p-calendar\n\t\t\t\t\t\tvariant='embedded'\n\t\t\t\t\t\tvalue={this._value}\n\t\t\t\t\t\tonValueChange={({ detail }) => (this.value = detail)}\n\t\t\t\t\t\tpreselectToday={this.preselectToday}\n\t\t\t\t\t\tdisabledDates={this.disabledDates}\n\t\t\t\t\t\tminDate={this.minDate}\n\t\t\t\t\t\tmaxDate={this.maxDate}\n\t\t\t\t\t\tdisableWeekends={this.disableWeekends}\n\t\t\t\t\t\tenableToday={this.enableToday}\n\t\t\t\t\t\ttodayText={this.todayText}\n\t\t\t\t\t\tmode={this.mode}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</p-dropdown>\n\t\t);\n\t}\n\n\t@Listen('click', { target: 'document', capture: true })\n\tprotected documentClickHandler({ target }) {\n\t\tif (!this._showDropdown || childOf(target, this._el)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = false;\n\t}\n\n\tprivate _onFocus() {\n\t\tif (this._isMobileBrowser && this._dateInputRef) {\n\t\t\tthis._dateInputRef.focus();\n\t\t\tthis._dateInputRef.showPicker();\n\t\t\tthis._inputRef.blur();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = true;\n\t}\n\n\tprivate _onBlur(parseFormat = this.format) {\n\t\tif (this._isMobileBrowser && this._dateInputRef) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst target = this._inputRef;\n\n\t\tif (target.value === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst value = parse(target.value, parseFormat, new Date());\n\n\t\tif (value === this._value) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst valid = isValid(value);\n\t\tif (!valid && parseFormat === this.format && this.mode === 'day') {\n\t\t\treturn this._onBlur(this._defaultFormats['dayNoDashes']);\n\t\t}\n\n\t\tif (!valid || this._isDisabledDay(value)) {\n\t\t\ttarget.value = this._getFormattedDate();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._setValue(value, false);\n\t}\n\n\tprivate _onValueChange(value: string, parseFormat = this.format) {\n\t\tif (this._onInputTimeout) {\n\t\t\tclearTimeout(this._onInputTimeout);\n\t\t\tthis._onInputTimeout = null;\n\t\t}\n\n\t\tthis._onInputTimeout = setTimeout(() => {\n\t\t\tconst parsedValue = parse(value, parseFormat, new Date());\n\n\t\t\tif (!isValid(parsedValue) || format(parsedValue, parseFormat) !== value) {\n\t\t\t\tif (this.mode === 'day') {\n\t\t\t\t\tthis._onValueChange(value, this._defaultFormats['dayNoDashes']);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._setValue(parsedValue, false);\n\t\t}, 300);\n\t}\n\n\tprivate _onNativeInput(ev) {\n\t\tif (!ev.target) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._onInputTimeout) {\n\t\t\tclearTimeout(this._onInputTimeout);\n\t\t\tthis._onInputTimeout = null;\n\t\t}\n\n\t\tthis._onInputTimeout = setTimeout(() => {\n\t\t\tthis._setValue(\n\t\t\t\tev.target.value === '' ? null : new Date(ev.target.value),\n\t\t\t\tfalse\n\t\t\t);\n\t\t});\n\t}\n\n\tprivate _setValue(value: Date | null, hideDropdown = true) {\n\t\tif (value === null) {\n\t\t\tthis._value = null;\n\t\t\tthis.valueChange.emit(null);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!isValid(value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._isDisabledDay(value)) {\n\t\t\tif (!!this._dateInputRef?.value) {\n\t\t\t\tthis._dateInputRef.value = this._value\n\t\t\t\t\t? format(this._value, 'yyyy-MM-dd')\n\t\t\t\t\t: null;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tvalue =\n\t\t\tthis.mode === 'day'\n\t\t\t\t? startOfDay(value)\n\t\t\t\t: this.mode === 'month'\n\t\t\t\t? startOfMonth(value)\n\t\t\t\t: startOfYear(value);\n\t\tconst isSameValue = isSameDay(value, this._value);\n\n\t\tif (isSameValue) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (hideDropdown) {\n\t\t\tthis._showDropdown = false;\n\t\t}\n\n\t\tthis._value = value;\n\t\tthis.valueChange.emit(value);\n\t}\n\n\tprivate _isDisabledDay(day: Date) {\n\t\treturn (\n\t\t\t(this.disableWeekends && isWeekend(day)) ||\n\t\t\t(isBefore(day, this._minDate) && !isSameDay(day, this._minDate)) ||\n\t\t\t(isAfter(day, this._maxDate) && !isSameDay(day, this._maxDate)) ||\n\t\t\tthis._disabledDates.findIndex(date => isSameDay(date, day)) >= 0\n\t\t);\n\t}\n\n\tprivate _getFormattedDate() {\n\t\tif (!this._value) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn format(this._value, this.format);\n\t}\n}\n"]}
1
+ {"version":3,"file":"datepicker.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/datepicker/datepicker.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,EACN,MAAM,EACN,OAAO,EACP,QAAQ,EACR,SAAS,EACT,OAAO,EACP,SAAS,EACT,KAAK,EACL,UAAU,EACV,YAAY,EACZ,WAAW,GACX,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAQtD,MAAM,OAAO,UAAU;IACtB;;OAEG;IACK,WAAW,CAAS;IAE5B;;OAEG;IACK,KAAK,CAAmC;IAEhD;;OAEG;IACK,cAAc,GAAY,KAAK,CAAC;IAExC;;OAEG;IACK,kBAAkB,GAAY,IAAI,CAAC;IAE3C;;OAEG;IACK,aAAa,CAAiC;IAEtD;;OAEG;IACK,OAAO,CAAiB;IAEhC;;OAEG;IACK,OAAO,CAAiB;IAEhC;;OAEG;IACK,eAAe,GAAY,KAAK,CAAC;IAEzC;;OAEG;IACK,WAAW,GAAY,IAAI,CAAC;IAEpC;;O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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Placement, Strategy } 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 {\n\tformat,\n\tisAfter,\n\tisBefore,\n\tisSameDay,\n\tisValid,\n\tisWeekend,\n\tparse,\n\tstartOfDay,\n\tstartOfMonth,\n\tstartOfYear,\n} from 'date-fns';\nimport { childOf, isMobileBrowser } from '../../../utils';\nimport { asBoolean } from '../../../utils/as-boolean';\n\n@Component({\n\ttag: 'p-datepicker',\n\tstyleUrl: 'datepicker.component.css',\n\tshadow: false,\n\tformAssociated: true,\n})\nexport class Datepicker {\n\t/**\n\t * The placeholder of the input\n\t */\n\t@Prop() placeholder: string;\n\n\t/**\n\t * The current value\n\t */\n\t@Prop() value: Date | string | null | undefined;\n\n\t/**\n\t * Wethter to automatically preselect today\n\t */\n\t@Prop() preselectToday: boolean = false;\n\n\t/**\n\t * Enable native picker for mobile devices\n\t */\n\t@Prop() enableNativePicker: boolean = true;\n\n\t/**\n\t * Disabled dates\n\t */\n\t@Prop() disabledDates?: Array<Date | string> | string;\n\n\t/**\n\t * Min date\n\t */\n\t@Prop() minDate?: Date | string;\n\n\t/**\n\t * Max date\n\t */\n\t@Prop() maxDate?: Date | string;\n\n\t/**\n\t * Wether to disable the weekends\n\t */\n\t@Prop() disableWeekends: boolean = false;\n\n\t/**\n\t * Wether to enable the today button\n\t */\n\t@Prop() enableToday: boolean = true;\n\n\t/**\n\t * The text to display on the today tooltip\n\t */\n\t@Prop() todayText: string = 'today';\n\n\t/**\n\t * The mode of the datepicker\n\t */\n\t@Prop() mode: 'year' | 'month' | 'day' = 'day';\n\n\t/**\n\t * Event when the value changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tvalueChange: EventEmitter<any>;\n\n\t/**\n\t * The display & parse format to use\n\t */\n\t@Prop() format: string = 'dd-MM-yyyy';\n\n\t/**\n\t * Hides the icon when filled\n\t */\n\t@Prop() hideIconWhenFilled: boolean = false;\n\n\t/**\n\t * The size of the input group used by the datepicker\n\t */\n\t@Prop() size: 'sm' | 'base' = 'base';\n\n\t/**\n\t * The prefix of the input group used by the datepicker\n\t */\n\t@Prop() prefix: string;\n\n\t/**\n\t * The label of the input group used by the datepicker\n\t */\n\t@Prop() label: string;\n\n\t/**\n\t * Wether the field is loading\n\t */\n\t@Prop() loading: boolean = false;\n\n\t/**\n\t * The helper of the input group used by the datepicker\n\t */\n\t@Prop() helper: string;\n\n\t/**\n\t * Wether the field is required\n\t */\n\t@Prop({ reflect: true }) required: boolean;\n\n\t/**\n\t * Wether to show optional when not required\n\t */\n\t@Prop({ reflect: true }) showOptional: boolean = true;\n\n\t/**\n\t * The helper of the input group used by the datepicker\n\t */\n\t@Prop({ reflect: true }) error: string;\n\n\t/**\n\t * Wether the input group is disabled used by the datepicker\n\t */\n\t@Prop({ reflect: true }) disabled: boolean = false;\n\n\t/**\n\t * The strategy of the dropdown placement\n\t */\n\t@Prop() strategy: Strategy = 'absolute';\n\n\t/**\n\t * The placement of the dropdown\n\t */\n\t@Prop({ reflect: true }) placement: Placement = 'bottom-start';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _showDropdown: any = false;\n\t@State() private _value: Date;\n\t@State() private _minDate: Date;\n\t@State() private _maxDate: Date;\n\t@State() private _disabledDates: Date[] = [];\n\t@State() private _isMobileBrowser: boolean = false;\n\n\t@AttachInternals() _internals: ElementInternals;\n\n\tprivate _onInputTimeout: NodeJS.Timeout;\n\tprivate _inputRef: HTMLInputElement | HTMLTextAreaElement;\n\tprivate _dateInputRef: HTMLInputElement;\n\n\tprivate _defaultFormats = {\n\t\tyear: 'yyyy',\n\t\tmonth: 'LLLL, yyyy',\n\t\tday: 'dd-MM-yyyy',\n\t\tdayNoDashes: 'ddMMyyyy',\n\t};\n\n\t@Watch('value')\n\tprotected parseValue(value: string | Date) {\n\t\tif (!value && this.preselectToday) {\n\t\t\tvalue = new Date();\n\t\t}\n\n\t\tif (typeof value === 'string') {\n\t\t\tvalue = new Date(value);\n\t\t}\n\n\t\tthis._setValue(value);\n\t}\n\n\t@Watch('minDate')\n\tprotected parseMinDate(minDate: string | Date) {\n\t\tif (typeof minDate === 'string') {\n\t\t\tminDate = new Date(minDate);\n\t\t}\n\n\t\tif (!isValid(minDate)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._minDate = minDate;\n\n\t\tif (isBefore(this._value, this._minDate)) {\n\t\t\tthis._setValue(null);\n\t\t}\n\t}\n\n\t@Watch('maxDate')\n\tprotected parseMaxDate(maxDate: string | Date) {\n\t\tif (typeof maxDate === 'string') {\n\t\t\tmaxDate = new Date(maxDate);\n\t\t}\n\n\t\tif (!isValid(maxDate)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._maxDate = maxDate;\n\n\t\tif (isAfter(this._value, this._maxDate)) {\n\t\t\tthis._setValue(null);\n\t\t}\n\t}\n\n\t@Watch('disabledDates')\n\tprotected parseDisabledDates(disabledDates: Array<string | Date> | string) {\n\t\tif (typeof disabledDates === 'string') {\n\t\t\tdisabledDates = JSON.parse(disabledDates);\n\t\t}\n\n\t\tif (!disabledDates || !Array.isArray(disabledDates)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// normalize all to date\n\t\tthis._disabledDates = disabledDates\n\t\t\t.map(date => {\n\t\t\t\tif (typeof date === 'string') {\n\t\t\t\t\treturn new Date(date);\n\t\t\t\t}\n\n\t\t\t\treturn date;\n\t\t\t})\n\t\t\t.filter(date => isValid(date));\n\n\t\tif (this._isDisabledDay(this._value)) {\n\t\t\tthis._setValue(null);\n\t\t}\n\t}\n\n\tformResetCallback() {\n\t\tthis._setValue(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\tcomponentWillLoad() {\n\t\tif (this.disabledDates) {\n\t\t\tthis.parseDisabledDates(this.disabledDates);\n\t\t}\n\n\t\tif (this.minDate) {\n\t\t\tthis.parseMinDate(this.minDate);\n\t\t}\n\n\t\tif (this.maxDate) {\n\t\t\tthis.parseMaxDate(this.maxDate);\n\t\t}\n\n\t\tif (this.mode !== 'day' && this.format === this._defaultFormats['day']) {\n\t\t\tthis.format = this._defaultFormats[this.mode];\n\t\t}\n\n\t\tthis._isMobileBrowser = isMobileBrowser();\n\n\t\tthis.parseValue(this.value);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<p-dropdown\n\t\t\t\tallowOverflow={true}\n\t\t\t\tstrategy={this.strategy}\n\t\t\t\tplacement={this.placement}\n\t\t\t\tdisableTriggerClick={true}\n\t\t\t\tapplyMaxWidth={false}\n\t\t\t\tapplyFullWidth={false}\n\t\t\t\tinsideClick={true}\n\t\t\t\tshow={this._showDropdown}\n\t\t\t>\n\t\t\t\t<p-field\n\t\t\t\t\tslot='trigger'\n\t\t\t\t\ticon={\n\t\t\t\t\t\tthis.hideIconWhenFilled && !!this._value ? null : 'calendar-multi'\n\t\t\t\t\t}\n\t\t\t\t\ticonPosition='start'\n\t\t\t\t\tsize={this.size}\n\t\t\t\t\tprefix={this.prefix}\n\t\t\t\t\tlabel={this.label}\n\t\t\t\t\tloading={this.loading}\n\t\t\t\t\thelper={this.helper}\n\t\t\t\t\trequired={asBoolean(this.required)}\n\t\t\t\t\tshowOptional={asBoolean(this.showOptional)}\n\t\t\t\t\terror={this.error}\n\t\t\t\t\tforceShowTooltip={!!this.error?.length && !this._showDropdown}\n\t\t\t\t\tautoShowError={false}\n\t\t\t\t\tdisabled={asBoolean(this.disabled)}\n\t\t\t\t\tfocused={this._showDropdown}\n\t\t\t\t\tvalue={this._getFormattedDate()}\n\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\tonFocus={() => this._onFocus()}\n\t\t\t\t\tonBlur={() => this._onBlur()}\n\t\t\t\t\tonValueChange={ev => this._onValueChange(ev.detail as string)}\n\t\t\t\t\tonInputRefChange={ev => (this._inputRef = ev.detail)}\n\t\t\t\t></p-field>\n\n\t\t\t\t{this.enableNativePicker && this._isMobileBrowser && (\n\t\t\t\t\t<input\n\t\t\t\t\t\tslot='trigger'\n\t\t\t\t\t\ttype={this.mode === 'day' ? 'date' : 'month'}\n\t\t\t\t\t\tclass='pointer-events-none absolute left-0 top-0 z-[-10] overflow-hidden opacity-0'\n\t\t\t\t\t\tonInput={ev => this._onNativeInput(ev)}\n\t\t\t\t\t\tref={ref => (this._dateInputRef = ref)}\n\t\t\t\t\t\tvalue={this._value && format(this._value, 'yyyy-MM-dd')}\n\t\t\t\t\t\tmin={this.minDate && format(new Date(this.minDate), 'yyyy-MM-dd')}\n\t\t\t\t\t\tmax={this.maxDate && format(new Date(this.maxDate), 'yyyy-MM-dd')}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<div slot='items'>\n\t\t\t\t\t<p-calendar\n\t\t\t\t\t\tvariant='embedded'\n\t\t\t\t\t\tvalue={this._value}\n\t\t\t\t\t\tonValueChange={({ detail }) => (this.value = detail)}\n\t\t\t\t\t\tpreselectToday={this.preselectToday}\n\t\t\t\t\t\tdisabledDates={this.disabledDates}\n\t\t\t\t\t\tminDate={this.minDate}\n\t\t\t\t\t\tmaxDate={this.maxDate}\n\t\t\t\t\t\tdisableWeekends={this.disableWeekends}\n\t\t\t\t\t\tenableToday={this.enableToday}\n\t\t\t\t\t\ttodayText={this.todayText}\n\t\t\t\t\t\tmode={this.mode}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</p-dropdown>\n\t\t);\n\t}\n\n\t@Listen('click', { target: 'document', capture: true })\n\tprotected documentClickHandler({ target }) {\n\t\tif (!this._showDropdown || childOf(target, this._el)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = false;\n\t}\n\n\tprivate _onFocus() {\n\t\tif (this._isMobileBrowser && this._dateInputRef) {\n\t\t\tthis._dateInputRef.focus();\n\t\t\tthis._dateInputRef.showPicker();\n\t\t\tthis._inputRef.blur();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = true;\n\t}\n\n\tprivate _onBlur(parseFormat = this.format) {\n\t\tif (this._isMobileBrowser && this._dateInputRef) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst target = this._inputRef;\n\n\t\tif (target.value === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst value = parse(target.value, parseFormat, new Date());\n\n\t\tif (value === this._value) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst valid = isValid(value);\n\t\tif (!valid && parseFormat === this.format && this.mode === 'day') {\n\t\t\treturn this._onBlur(this._defaultFormats['dayNoDashes']);\n\t\t}\n\n\t\tif (!valid || this._isDisabledDay(value)) {\n\t\t\ttarget.value = this._getFormattedDate();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._setValue(value, false);\n\t}\n\n\tprivate _onValueChange(value: string, parseFormat = this.format) {\n\t\tif (this._onInputTimeout) {\n\t\t\tclearTimeout(this._onInputTimeout);\n\t\t\tthis._onInputTimeout = null;\n\t\t}\n\n\t\tthis._onInputTimeout = setTimeout(() => {\n\t\t\tconst parsedValue = parse(value, parseFormat, new Date());\n\n\t\t\tif (!isValid(parsedValue) || format(parsedValue, parseFormat) !== value) {\n\t\t\t\tif (this.mode === 'day') {\n\t\t\t\t\tthis._onValueChange(value, this._defaultFormats['dayNoDashes']);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._setValue(parsedValue, false);\n\t\t}, 300);\n\t}\n\n\tprivate _onNativeInput(ev) {\n\t\tif (!ev.target) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._onInputTimeout) {\n\t\t\tclearTimeout(this._onInputTimeout);\n\t\t\tthis._onInputTimeout = null;\n\t\t}\n\n\t\tthis._onInputTimeout = setTimeout(() => {\n\t\t\tthis._setValue(\n\t\t\t\tev.target.value === '' ? null : new Date(ev.target.value),\n\t\t\t\tfalse\n\t\t\t);\n\t\t});\n\t}\n\n\tprivate _setValue(value: Date | null, hideDropdown = true) {\n\t\tif (value === null) {\n\t\t\tthis._value = null;\n\t\t\tthis.valueChange.emit(null);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!isValid(value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._isDisabledDay(value)) {\n\t\t\tif (!!this._dateInputRef?.value) {\n\t\t\t\tthis._dateInputRef.value = this._value\n\t\t\t\t\t? format(this._value, 'yyyy-MM-dd')\n\t\t\t\t\t: null;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tvalue =\n\t\t\tthis.mode === 'day'\n\t\t\t\t? startOfDay(value)\n\t\t\t\t: this.mode === 'month'\n\t\t\t\t? startOfMonth(value)\n\t\t\t\t: startOfYear(value);\n\t\tconst isSameValue = isSameDay(value, this._value);\n\n\t\tif (isSameValue) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (hideDropdown) {\n\t\t\tthis._showDropdown = false;\n\t\t}\n\n\t\tthis._value = value;\n\t\tthis.valueChange.emit(value);\n\t}\n\n\tprivate _isDisabledDay(day: Date) {\n\t\treturn (\n\t\t\t(this.disableWeekends && isWeekend(day)) ||\n\t\t\t(isBefore(day, this._minDate) && !isSameDay(day, this._minDate)) ||\n\t\t\t(isAfter(day, this._maxDate) && !isSameDay(day, this._maxDate)) ||\n\t\t\tthis._disabledDates.findIndex(date => isSameDay(date, day)) >= 0\n\t\t);\n\t}\n\n\tprivate _getFormattedDate() {\n\t\tif (!this._value) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn format(this._value, this.format);\n\t}\n}\n"]}
@@ -114,11 +114,11 @@ export class FieldContainer {
114
114
  helper ||
115
115
  hasHeaderSlot) && (h("div", { key: '4984899018fc50a1f5269020a8ce07d105ad1c36', class: 'flex items-center gap-1' }, !asBoolean(this.required) &&
116
116
  asBoolean(this.showOptional) &&
117
- this.variant === 'write' && (h("span", { key: '807acddda0fa0b0e8cd5052877b986e6efbd7377', class: 'text-xs font-medium text-storm-200' }, this.optionalTemplate())), (helper || hasHeaderSlot) && (h(Fragment, { key: '52d9011a86330a2ee7ecfcc8cf5b1c9c90797dce' }, hasHeaderSlot && h("slot", { key: '4a98ae2a5c8bd4bd488f2b42370b65bbb573950a', name: 'header' }), helper && (h("p-helper", { key: '4b51360054d7dc2173ffdf669cf657a237d99580', class: `flex ${hasHeaderSlot ? 'ml-2' : ''}`, placement: 'top-end' }, helper))))))), h("p-tooltip", { key: '3db574ea5b32a34887803e5547f64b727b9bcaf6', class: cn({
117
+ this.variant === 'write' && (h("span", { key: '807acddda0fa0b0e8cd5052877b986e6efbd7377', class: 'text-xs font-medium text-storm-200' }, this.optionalTemplate())), (helper || hasHeaderSlot) && (h(Fragment, { key: '52d9011a86330a2ee7ecfcc8cf5b1c9c90797dce' }, hasHeaderSlot && h("slot", { key: '4a98ae2a5c8bd4bd488f2b42370b65bbb573950a', name: 'header' }), helper && (h("p-helper", { key: '4b51360054d7dc2173ffdf669cf657a237d99580', class: `flex ${hasHeaderSlot ? 'ml-2' : ''}`, placement: 'top-end' }, helper))))))), h("p-tooltip", { key: 'ebc67a9108f679e14593e5e5d40f4e686e2a1fee', class: cn({
118
118
  'w-full': this.variant === 'write' || this.loading,
119
119
  'ml-auto': this.align === 'end',
120
120
  'font-normal': this.variant === 'read',
121
- }), variant: 'error', content: this.error, show: errorAndErrorIsNotBoolean && asBoolean(this.forceShowTooltip), enableUserInput: false, placement: this.errorPlacement }, hasErrorSlot && (h("slot", { key: '770fbeffd9f7d929c4ad6ecad8b096d595160f65', name: 'error', slot: 'content' })), contentSlot)));
121
+ }), variant: 'error', content: this.error, show: errorAndErrorIsNotBoolean && asBoolean(this.forceShowTooltip, false), enableUserInput: false, placement: this.errorPlacement }, hasErrorSlot && (h("slot", { key: 'ee09127908a48f2947d9a76c3f0358ab64163937', name: 'error', slot: 'content' })), contentSlot)));
122
122
  }
123
123
  async _setLocales() {
124
124
  this._locales = await getLocaleComponentStrings(this._el);
@@ -1 +1 @@
1
- {"version":3,"file":"field-container.component.js","sourceRoot":"","sources":["../../../../../src/components/molecules/field/container/field-container.component.tsx"],"names":[],"mappings":"AACA,OAAO,EACN,SAAS,EACT,OAAO,EACP,KAAK,EAEL,QAAQ,EACR,CAAC,EACD,MAAM,EACN,IAAI,EACJ,KAAK,GACL,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EACN,EAAE,EACF,iBAAiB,EACjB,yBAAyB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,mBAAmB,CAAC,EAAE;IACzC,QAAQ,EAAE;QACT,OAAO,EAAE;YACR,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,IAAI;SACX;QACD,IAAI,EAAE;YACL,IAAI,EAAE,IAAI;YACV,EAAE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AI,CAAC,GAAG,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;QAEzE,MAAM,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,YAAM,IAAI,EAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;QACpE,MAAM,KAAK,GAAG,YAAY,CAAC,CAAC,CAAC,YAAM,IAAI,EAAC,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;QAEhE,MAAM,yBAAyB,GAC9B,YAAY;YACZ,CAAC,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC;QAEzE,OAAO;YACN,aAAa;YACb,YAAY;YACZ,aAAa;YACb,YAAY;YACZ,MAAM;YACN,KAAK;YACL,yBAAyB;SACzB,CAAC;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Placement } from '@floating-ui/dom';\nimport {\n\tComponent,\n\tElement,\n\tEvent,\n\tEventEmitter,\n\tFragment,\n\th,\n\tListen,\n\tProp,\n\tState,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport {\n\tcn,\n\tformatTranslation,\n\tgetLocaleComponentStrings,\n} from '../../../../utils';\nimport { asBoolean } from '../../../../utils/as-boolean';\n\nconst loader = cva(['rounded-lg w-full'], {\n\tvariants: {\n\t\tvariant: {\n\t\t\tread: null,\n\t\t\twrite: null,\n\t\t},\n\t\tsize: {\n\t\t\tbase: null,\n\t\t\tsm: null,\n\t\t},\n\t},\n\tcompoundVariants: [\n\t\t{\n\t\t\tvariant: 'read',\n\t\t\tsize: 'base',\n\t\t\tclass: 'h-5',\n\t\t},\n\t\t{\n\t\t\tvariant: 'read',\n\t\t\tsize: 'sm',\n\t\t\tclass: 'h-4',\n\t\t},\n\n\t\t{\n\t\t\tvariant: 'write',\n\t\t\tsize: 'base',\n\t\t\tclass: 'h-8',\n\t\t},\n\t\t{\n\t\t\tvariant: 'write',\n\t\t\tsize: 'sm',\n\t\t\tclass: 'h-6',\n\t\t},\n\t],\n});\n\nexport type templateFunc = () => string;\n\n@Component({\n\ttag: 'p-field-container',\n\tstyleUrl: 'field-container.component.css',\n\tshadow: true,\n})\nexport class FieldContainer {\n\tprivate _defaultOptionalTemplate: templateFunc = () =>\n\t\tformatTranslation(this._locales.optional);\n\t/**\n\t * The id for the label\n\t */\n\t@Prop() id: string;\n\n\t/**\n\t * Align content to the start or end\n\t */\n\t@Prop() align: 'start' | 'end' = 'start';\n\n\t/**\n\t * The label of the input group\n\t */\n\t@Prop() label: string | HTMLSlotElement;\n\n\t/**\n\t * Wether the field container is in loading state\n\t */\n\t@Prop() loading: boolean = false;\n\n\t/**\n\t * The size of the loader\n\t */\n\t@Prop() loadingSize: 'base' | 'sm' = 'base';\n\n\t/**\n\t * The variant of the field container\n\t */\n\t@Prop() variant: 'read' | 'write';\n\n\t/**\n\t * The helper of the input group\n\t */\n\t@Prop() helper: string | HTMLSlotElement;\n\n\t/**\n\t * Wether the field is required\n\t */\n\t@Prop({ reflect: true }) required: boolean;\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 * The helper of the input group\n\t */\n\t@Prop({ reflect: true }) error: string;\n\n\t/**\n\t * The placement of the error popover\n\t */\n\t@Prop() errorPlacement: Placement;\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 * The template for the optional text\n\t */\n\t@Prop() optionalTemplate: templateFunc = this._defaultOptionalTemplate;\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@Event() focus: EventEmitter<void>;\n\n\t/**\n\t * Locales used for this component\n\t */\n\t@State() private _locales: any = {};\n\n\tcomponentWillLoad() {\n\t\tthis._setLocales();\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\thasHeaderSlot,\n\t\t\thasErrorSlot,\n\t\t\thelper,\n\t\t\tlabel,\n\t\t\terrorAndErrorIsNotBoolean,\n\t\t} = this._getSlotInfo();\n\n\t\tlet contentSlot = (\n\t\t\t<slot\n\t\t\t\tslot='trigger'\n\t\t\t\tname='content'\n\t\t\t/>\n\t\t);\n\n\t\tif (this.loading) {\n\t\t\tcontentSlot = (\n\t\t\t\t<p-loader\n\t\t\t\t\tvariant='ghost'\n\t\t\t\t\tclass={loader({ variant: this.variant, size: this.loadingSize })}\n\t\t\t\t\tslot='trigger'\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<label\n\t\t\t\thtmlFor={this.id}\n\t\t\t\tclass='flex w-inherit flex-col gap-1'\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclass={cn('flex items-end justify-between gap-1 empty:hidden', {\n\t\t\t\t\t\t'flex-row-reverse': this.align === 'end',\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t{!!label?.length && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclass='text-xs font-medium text-storm-300'\n\t\t\t\t\t\t\tonClick={() => this.focus.emit()}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{((!asBoolean(this.required) && asBoolean(this.showOptional)) ||\n\t\t\t\t\t\thelper ||\n\t\t\t\t\t\thasHeaderSlot) && (\n\t\t\t\t\t\t<div class='flex items-center gap-1'>\n\t\t\t\t\t\t\t{!asBoolean(this.required) &&\n\t\t\t\t\t\t\t\tasBoolean(this.showOptional) &&\n\t\t\t\t\t\t\t\tthis.variant === 'write' && (\n\t\t\t\t\t\t\t\t\t<span class='text-xs font-medium text-storm-200'>\n\t\t\t\t\t\t\t\t\t\t{this.optionalTemplate()}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t\t{(helper || hasHeaderSlot) && (\n\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t{hasHeaderSlot && <slot name='header' />}\n\t\t\t\t\t\t\t\t\t{helper && (\n\t\t\t\t\t\t\t\t\t\t<p-helper\n\t\t\t\t\t\t\t\t\t\t\tclass={`flex ${hasHeaderSlot ? 'ml-2' : ''}`}\n\t\t\t\t\t\t\t\t\t\t\tplacement='top-end'\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{helper}\n\t\t\t\t\t\t\t\t\t\t</p-helper>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<p-tooltip\n\t\t\t\t\tclass={cn({\n\t\t\t\t\t\t'w-full': this.variant === 'write' || this.loading,\n\t\t\t\t\t\t'ml-auto': this.align === 'end',\n\t\t\t\t\t\t'font-normal': this.variant === 'read',\n\t\t\t\t\t})}\n\t\t\t\t\tvariant='error'\n\t\t\t\t\tcontent={this.error}\n\t\t\t\t\tshow={errorAndErrorIsNotBoolean && asBoolean(this.forceShowTooltip)}\n\t\t\t\t\tenableUserInput={false}\n\t\t\t\t\tplacement={this.errorPlacement}\n\t\t\t\t>\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='content'\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{contentSlot}\n\t\t\t\t</p-tooltip>\n\t\t\t</label>\n\t\t);\n\t}\n\n\t@Listen('localeChanged', { target: 'body' })\n\tprivate async _setLocales(): Promise<void> {\n\t\tthis._locales = await getLocaleComponentStrings(this._el);\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 hasHeaderSlot = !!this._el.querySelector(':scope > [slot=\"header\"]');\n\t\tconst hasErrorSlot = !!this._el.querySelector(':scope > [slot=\"error\"]');\n\n\t\tconst helper = hasHelperSlot ? <slot name='helper' /> : this.helper;\n\t\tconst label = hasLabelSlot ? <slot name='label' /> : this.label;\n\n\t\tconst errorAndErrorIsNotBoolean =\n\t\t\thasErrorSlot ||\n\t\t\t(this.error && typeof this.error === 'string' && this.error !== 'true');\n\n\t\treturn {\n\t\t\thasHelperSlot,\n\t\t\thasLabelSlot,\n\t\t\thasHeaderSlot,\n\t\t\thasErrorSlot,\n\t\t\thelper,\n\t\t\tlabel,\n\t\t\terrorAndErrorIsNotBoolean,\n\t\t};\n\t}\n}\n"]}
1
+ {"version":3,"file":"field-container.component.js","sourceRoot":"","sources":["../../../../../src/components/molecules/field/container/field-container.component.tsx"],"names":[],"mappings":"AACA,OAAO,EACN,SAAS,EACT,OAAO,EACP,KAAK,EAEL,QAAQ,EACR,CAAC,EACD,MAAM,EACN,IAAI,EACJ,KAAK,GACL,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EACN,EAAE,EACF,iBAAiB,EACjB,yBAAyB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC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ventEmitter,\n\tFragment,\n\th,\n\tListen,\n\tProp,\n\tState,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport {\n\tcn,\n\tformatTranslation,\n\tgetLocaleComponentStrings,\n} from '../../../../utils';\nimport { asBoolean } from '../../../../utils/as-boolean';\n\nconst loader = cva(['rounded-lg w-full'], {\n\tvariants: {\n\t\tvariant: {\n\t\t\tread: null,\n\t\t\twrite: null,\n\t\t},\n\t\tsize: {\n\t\t\tbase: null,\n\t\t\tsm: null,\n\t\t},\n\t},\n\tcompoundVariants: [\n\t\t{\n\t\t\tvariant: 'read',\n\t\t\tsize: 'base',\n\t\t\tclass: 'h-5',\n\t\t},\n\t\t{\n\t\t\tvariant: 'read',\n\t\t\tsize: 'sm',\n\t\t\tclass: 'h-4',\n\t\t},\n\n\t\t{\n\t\t\tvariant: 'write',\n\t\t\tsize: 'base',\n\t\t\tclass: 'h-8',\n\t\t},\n\t\t{\n\t\t\tvariant: 'write',\n\t\t\tsize: 'sm',\n\t\t\tclass: 'h-6',\n\t\t},\n\t],\n});\n\nexport type templateFunc = () => string;\n\n@Component({\n\ttag: 'p-field-container',\n\tstyleUrl: 'field-container.component.css',\n\tshadow: true,\n})\nexport class FieldContainer {\n\tprivate _defaultOptionalTemplate: templateFunc = () =>\n\t\tformatTranslation(this._locales.optional);\n\t/**\n\t * The id for the label\n\t */\n\t@Prop() id: string;\n\n\t/**\n\t * Align content to the start or end\n\t */\n\t@Prop() align: 'start' | 'end' = 'start';\n\n\t/**\n\t * The label of the input group\n\t */\n\t@Prop() label: string | HTMLSlotElement;\n\n\t/**\n\t * Wether the field container is in loading state\n\t */\n\t@Prop() loading: boolean = false;\n\n\t/**\n\t * The size of the loader\n\t */\n\t@Prop() loadingSize: 'base' | 'sm' = 'base';\n\n\t/**\n\t * The variant of the field container\n\t */\n\t@Prop() variant: 'read' | 'write';\n\n\t/**\n\t * The helper of the input group\n\t */\n\t@Prop() helper: string | HTMLSlotElement;\n\n\t/**\n\t * Wether the field is required\n\t */\n\t@Prop({ reflect: true }) required: boolean;\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 * The helper of the input group\n\t */\n\t@Prop({ reflect: true }) error: string;\n\n\t/**\n\t * The placement of the error popover\n\t */\n\t@Prop() errorPlacement: Placement;\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 * The template for the optional text\n\t */\n\t@Prop() optionalTemplate: templateFunc = this._defaultOptionalTemplate;\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@Event() focus: EventEmitter<void>;\n\n\t/**\n\t * Locales used for this component\n\t */\n\t@State() private _locales: any = {};\n\n\tcomponentWillLoad() {\n\t\tthis._setLocales();\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\thasHeaderSlot,\n\t\t\thasErrorSlot,\n\t\t\thelper,\n\t\t\tlabel,\n\t\t\terrorAndErrorIsNotBoolean,\n\t\t} = this._getSlotInfo();\n\n\t\tlet contentSlot = (\n\t\t\t<slot\n\t\t\t\tslot='trigger'\n\t\t\t\tname='content'\n\t\t\t/>\n\t\t);\n\n\t\tif (this.loading) {\n\t\t\tcontentSlot = (\n\t\t\t\t<p-loader\n\t\t\t\t\tvariant='ghost'\n\t\t\t\t\tclass={loader({ variant: this.variant, size: this.loadingSize })}\n\t\t\t\t\tslot='trigger'\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<label\n\t\t\t\thtmlFor={this.id}\n\t\t\t\tclass='flex w-inherit flex-col gap-1'\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclass={cn('flex items-end justify-between gap-1 empty:hidden', {\n\t\t\t\t\t\t'flex-row-reverse': this.align === 'end',\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t{!!label?.length && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclass='text-xs font-medium text-storm-300'\n\t\t\t\t\t\t\tonClick={() => this.focus.emit()}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{((!asBoolean(this.required) && asBoolean(this.showOptional)) ||\n\t\t\t\t\t\thelper ||\n\t\t\t\t\t\thasHeaderSlot) && (\n\t\t\t\t\t\t<div class='flex items-center gap-1'>\n\t\t\t\t\t\t\t{!asBoolean(this.required) &&\n\t\t\t\t\t\t\t\tasBoolean(this.showOptional) &&\n\t\t\t\t\t\t\t\tthis.variant === 'write' && (\n\t\t\t\t\t\t\t\t\t<span class='text-xs font-medium text-storm-200'>\n\t\t\t\t\t\t\t\t\t\t{this.optionalTemplate()}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t\t{(helper || hasHeaderSlot) && (\n\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t{hasHeaderSlot && <slot name='header' />}\n\t\t\t\t\t\t\t\t\t{helper && (\n\t\t\t\t\t\t\t\t\t\t<p-helper\n\t\t\t\t\t\t\t\t\t\t\tclass={`flex ${hasHeaderSlot ? 'ml-2' : ''}`}\n\t\t\t\t\t\t\t\t\t\t\tplacement='top-end'\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{helper}\n\t\t\t\t\t\t\t\t\t\t</p-helper>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<p-tooltip\n\t\t\t\t\tclass={cn({\n\t\t\t\t\t\t'w-full': this.variant === 'write' || this.loading,\n\t\t\t\t\t\t'ml-auto': this.align === 'end',\n\t\t\t\t\t\t'font-normal': this.variant === 'read',\n\t\t\t\t\t})}\n\t\t\t\t\tvariant='error'\n\t\t\t\t\tcontent={this.error}\n\t\t\t\t\tshow={\n\t\t\t\t\t\terrorAndErrorIsNotBoolean && asBoolean(this.forceShowTooltip, false)\n\t\t\t\t\t}\n\t\t\t\t\tenableUserInput={false}\n\t\t\t\t\tplacement={this.errorPlacement}\n\t\t\t\t>\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='content'\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{contentSlot}\n\t\t\t\t</p-tooltip>\n\t\t\t</label>\n\t\t);\n\t}\n\n\t@Listen('localeChanged', { target: 'body' })\n\tprivate async _setLocales(): Promise<void> {\n\t\tthis._locales = await getLocaleComponentStrings(this._el);\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 hasHeaderSlot = !!this._el.querySelector(':scope > [slot=\"header\"]');\n\t\tconst hasErrorSlot = !!this._el.querySelector(':scope > [slot=\"error\"]');\n\n\t\tconst helper = hasHelperSlot ? <slot name='helper' /> : this.helper;\n\t\tconst label = hasLabelSlot ? <slot name='label' /> : this.label;\n\n\t\tconst errorAndErrorIsNotBoolean =\n\t\t\thasErrorSlot ||\n\t\t\t(this.error && typeof this.error === 'string' && this.error !== 'true');\n\n\t\treturn {\n\t\t\thasHelperSlot,\n\t\t\thasLabelSlot,\n\t\t\thasHeaderSlot,\n\t\t\thasErrorSlot,\n\t\t\thelper,\n\t\t\tlabel,\n\t\t\terrorAndErrorIsNotBoolean,\n\t\t};\n\t}\n}\n"]}
@@ -252,6 +252,10 @@ export class Field {
252
252
  * The error to display
253
253
  */
254
254
  error;
255
+ /**
256
+ * Wether this component handles showing the error tooltip
257
+ */
258
+ autoShowError = true;
255
259
  /**
256
260
  * The placement of the error popover
257
261
  */
@@ -316,7 +320,8 @@ export class Field {
316
320
  }
317
321
  render() {
318
322
  const { id, prefix, suffix, hasHeaderSlot, hasLabelSlot, hasHelperSlot, hasErrorSlot, hasValueSlot, } = this._getSlotInfo();
319
- return (h("p-field-container", { key: 'edf29e9fd23f168988fceb00accec076f90a3166', forceShowTooltip: this.forceShowTooltip || this._focused || !!this.error?.length, 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: '952ba2a1dfd9bb57e65f3b992e54a521bb634048', name: 'label', slot: 'label' })), hasHeaderSlot && (h("slot", { key: '345e234c0a3b8a08ecfb8ec968495fe573ce0ea4', name: 'header', slot: 'header' })), hasHelperSlot && (h("slot", { key: '3edf0e8d7a6f2a5d6fa23bea4779f7791eb394f6', name: 'helper', slot: 'helper' })), hasErrorSlot && (h("slot", { key: 'f57448223003723d34f31834992d7e57ea1fa651', name: 'error', slot: 'error' })), h("div", { key: 'a83f383b6d9d3785899fad499399fc6517fc7fb5', class: field({
323
+ return (h("p-field-container", { key: 'f1d4c4009a0d8e5752fc2bac976368b104452f1d', forceShowTooltip: (!!this.error?.length && !this._focused && this.autoShowError) ||
324
+ (!!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: '7456a6d32410fb4b815f0e0c6d9cf0d5a7181f07', name: 'label', slot: 'label' })), hasHeaderSlot && (h("slot", { key: 'fb9d7ce730ee32d851f7316b6a5bd9c6832030a9', name: 'header', slot: 'header' })), hasHelperSlot && (h("slot", { key: '2678aa150fc000fd0f5e9e226c1e0534516e1b33', name: 'helper', slot: 'helper' })), hasErrorSlot && (h("slot", { key: '0718442d94dc655551cce640685d3708f00a9501', name: 'error', slot: 'error' })), h("div", { key: '2f479dcd9c41b0516967d5d451d54bc5b708d23f', class: field({
320
325
  error: !!this.error?.length,
321
326
  disabled: asBoolean(this.disabled),
322
327
  focused: asBoolean(this.focused) || this._focused,
@@ -327,7 +332,7 @@ export class Field {
327
332
  ? `${this.value}`
328
333
  : undefined, slot: 'content' }, (this.error?.length ||
329
334
  prefix ||
330
- (this.icon && this.iconPosition === 'start')) && (h("div", { key: '4162ebc0e667a4a4995ae8171cda44a268c67b18', class: prefixAndSuffix({
335
+ (this.icon && this.iconPosition === 'start')) && (h("div", { key: '293a93912c668dfa04062824a9f08bdc1cc8c24c', class: prefixAndSuffix({
331
336
  variant: this.variant,
332
337
  error: !!this.error?.length,
333
338
  disabled: asBoolean(this.disabled),
@@ -337,7 +342,7 @@ export class Field {
337
342
  }), onClick: () => this._focusInput() }, (this.icon && this.iconPosition === 'start') ||
338
343
  this.error?.length ? (h("p-icon", { class: cn('flex', {
339
344
  'mt-1': this.variant === 'read' && this.size === 'base',
340
- }), 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: '8e74b26866c95479e7aefa2cf19a15166514e335', class: prefixAndSuffix({
345
+ }), 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: '1b0cd7d732d22e103eb226cf6ae6ba83e9165e2b', class: prefixAndSuffix({
341
346
  variant: this.variant,
342
347
  error: !!this.error?.length,
343
348
  disabled: asBoolean(this.disabled),
@@ -962,6 +967,26 @@ export class Field {
962
967
  "setter": false,
963
968
  "reflect": true
964
969
  },
970
+ "autoShowError": {
971
+ "type": "boolean",
972
+ "attribute": "auto-show-error",
973
+ "mutable": false,
974
+ "complexType": {
975
+ "original": "boolean",
976
+ "resolved": "boolean",
977
+ "references": {}
978
+ },
979
+ "required": false,
980
+ "optional": false,
981
+ "docs": {
982
+ "tags": [],
983
+ "text": "Wether this component handles showing the error tooltip"
984
+ },
985
+ "getter": false,
986
+ "setter": false,
987
+ "reflect": true,
988
+ "defaultValue": "true"
989
+ },
965
990
  "errorPlacement": {
966
991
  "type": "string",
967
992
  "attribute": "error-placement",