@paperless/core 2.2.12 → 2.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/build/index.esm.js +1 -1
- package/dist/build/index.esm.js.map +1 -1
- package/dist/build/p-116fe39b.entry.js +2 -0
- package/dist/{paperless/p-6b4e7631.entry.js.map → build/p-116fe39b.entry.js.map} +1 -1
- package/dist/build/p-17c82f7c.entry.js +2 -0
- package/dist/build/{p-cfa138a1.entry.js.map → p-17c82f7c.entry.js.map} +1 -1
- package/dist/build/p-30c5b71b.entry.js +2 -0
- package/dist/build/p-30c5b71b.entry.js.map +1 -0
- package/dist/build/p-3d174b05.entry.js +2 -0
- package/dist/build/{p-699db32c.entry.js.map → p-3d174b05.entry.js.map} +1 -1
- package/dist/build/p-720963cf.entry.js +2 -0
- package/dist/{paperless/p-6916ad9d.entry.js.map → build/p-720963cf.entry.js.map} +1 -1
- package/dist/build/{p-af3ffe40.entry.js → p-85402959.entry.js} +2 -2
- package/dist/{paperless/p-af3ffe40.entry.js.map → build/p-85402959.entry.js.map} +1 -1
- package/dist/build/{p-a7ea8b65.entry.js → p-875faa3e.entry.js} +2 -2
- package/dist/build/{p-a7ea8b65.entry.js.map → p-875faa3e.entry.js.map} +1 -1
- package/dist/{paperless/p-d620c128.entry.js → build/p-8fc3da2f.entry.js} +2 -2
- package/dist/{paperless/p-d620c128.entry.js.map → build/p-8fc3da2f.entry.js.map} +1 -1
- package/dist/build/p-96be5968.entry.js +2 -0
- package/dist/build/{p-23169a44.entry.js.map → p-96be5968.entry.js.map} +1 -1
- package/dist/build/p-attachment.entry.esm.js.map +1 -1
- package/dist/build/p-avatar.entry.esm.js.map +1 -1
- package/dist/build/p-b588b2ca.entry.js +2 -0
- package/dist/build/{p-978e217e.entry.js.map → p-b588b2ca.entry.js.map} +1 -1
- package/dist/build/p-button.p-icon.p-loader.entry.esm.js.map +1 -1
- package/dist/build/{p-fe3e8997.js → p-c16685f1.js} +1 -1
- package/dist/build/p-card-container.entry.esm.js.map +1 -1
- package/dist/build/p-checkbox.p-dropdown.p-dropdown-menu-container.p-dropdown-menu-item.entry.esm.js.map +1 -1
- package/dist/build/p-content-slider.entry.esm.js.map +1 -1
- package/dist/build/p-e74def55.entry.js +2 -0
- package/dist/build/p-e74def55.entry.js.map +1 -0
- package/dist/build/p-empty-state.p-floating-menu-container.p-table-cell.p-table-container.p-table-footer.p-table-header.p-table-row.p-table-row-actions-container.entry.esm.js.map +1 -1
- package/dist/build/p-f866e7de.entry.js +2 -0
- package/dist/{paperless/p-7682e7f2.entry.js.map → build/p-f866e7de.entry.js.map} +1 -1
- package/dist/build/p-field.p-field-container.entry.esm.js.map +1 -1
- package/dist/build/p-helper.p-tooltip.entry.esm.js.map +1 -1
- package/dist/build/p-navigation-item.entry.esm.js.map +1 -1
- package/dist/build/p-select.entry.esm.js.map +1 -1
- package/dist/build/p-stepper-item.p-stepper-line.entry.esm.js.map +1 -1
- package/dist/build/paperless.esm.js +1 -1
- package/dist/cjs/index.cjs.js +1 -42
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/p-attachment.cjs.entry.js +1 -1
- package/dist/cjs/p-attachment.cjs.entry.js.map +1 -1
- package/dist/cjs/p-attachment.entry.cjs.js.map +1 -1
- package/dist/cjs/p-avatar.cjs.entry.js +1 -1
- package/dist/cjs/p-avatar.cjs.entry.js.map +1 -1
- package/dist/cjs/p-avatar.entry.cjs.js.map +1 -1
- package/dist/cjs/p-button.p-icon.p-loader.entry.cjs.js.map +1 -1
- package/dist/cjs/p-button_3.cjs.entry.js +1 -1
- package/dist/cjs/p-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/p-card-container.cjs.entry.js +1 -1
- package/dist/cjs/p-card-container.cjs.entry.js.map +1 -1
- package/dist/cjs/p-card-container.entry.cjs.js.map +1 -1
- package/dist/cjs/p-checkbox.p-dropdown.p-dropdown-menu-container.p-dropdown-menu-item.entry.cjs.js.map +1 -1
- package/dist/cjs/p-checkbox_4.cjs.entry.js +1 -1
- package/dist/cjs/p-checkbox_4.cjs.entry.js.map +1 -1
- package/dist/cjs/p-content-slider.cjs.entry.js +3 -3
- package/dist/cjs/p-content-slider.cjs.entry.js.map +1 -1
- package/dist/cjs/p-content-slider.entry.cjs.js.map +1 -1
- package/dist/cjs/p-empty-state.p-floating-menu-container.p-table-cell.p-table-container.p-table-footer.p-table-header.p-table-row.p-table-row-actions-container.entry.cjs.js.map +1 -1
- package/dist/cjs/p-empty-state_8.cjs.entry.js +2 -2
- package/dist/cjs/p-empty-state_8.cjs.entry.js.map +1 -1
- package/dist/cjs/p-field.p-field-container.entry.cjs.js.map +1 -1
- package/dist/cjs/p-field_2.cjs.entry.js +1 -1
- package/dist/cjs/p-field_2.cjs.entry.js.map +1 -1
- package/dist/cjs/p-helper.p-tooltip.entry.cjs.js.map +1 -1
- package/dist/cjs/p-helper_2.cjs.entry.js +1 -1
- package/dist/cjs/p-helper_2.cjs.entry.js.map +1 -1
- package/dist/cjs/p-navigation-item.cjs.entry.js +1 -1
- package/dist/cjs/p-navigation-item.cjs.entry.js.map +1 -1
- package/dist/cjs/p-navigation-item.entry.cjs.js.map +1 -1
- package/dist/cjs/p-select.cjs.entry.js +3 -3
- package/dist/cjs/p-select.cjs.entry.js.map +1 -1
- package/dist/cjs/p-select.entry.cjs.js.map +1 -1
- package/dist/cjs/p-stepper-item.p-stepper-line.entry.cjs.js.map +1 -1
- package/dist/cjs/p-stepper-item_2.cjs.entry.js +1 -1
- package/dist/cjs/p-stepper-item_2.cjs.entry.js.map +1 -1
- package/dist/collection/components/atoms/avatar/avatar/avatar.component.css +1 -1
- package/dist/collection/components/atoms/card/container/card-container.component.css +1 -1
- package/dist/collection/components/atoms/dropdown-menu/item/dropdown-menu-item.component.css +1 -1
- package/dist/collection/components/atoms/stepper/line/stepper-line.component.css +1 -1
- package/dist/collection/components/atoms/tooltip/tooltip.component.css +1 -1
- package/dist/collection/components/molecules/attachment/attachment.component.css +1 -1
- package/dist/collection/components/molecules/button/button.component.css +1 -1
- package/dist/collection/components/molecules/content-slider/content-slider.component.css +1 -1
- package/dist/collection/components/molecules/content-slider/content-slider.component.js +2 -2
- package/dist/collection/components/molecules/content-slider/content-slider.component.js.map +1 -1
- package/dist/collection/components/molecules/empty-state/empty-state.component.css +1 -1
- package/dist/collection/components/molecules/empty-state/empty-state.component.js +1 -1
- package/dist/collection/components/molecules/empty-state/empty-state.component.js.map +1 -1
- package/dist/collection/components/molecules/field/field/field.component.css +1 -1
- package/dist/collection/components/molecules/navigation/item/navigation-item.component.css +1 -1
- package/dist/collection/components/molecules/select/select.component.css +1 -1
- package/dist/collection/components/molecules/select/select.component.js +2 -2
- package/dist/collection/components/molecules/select/select.component.js.map +1 -1
- package/dist/collection/tailwind/theme/colors.js +1 -42
- package/dist/collection/tailwind/theme/colors.js.map +1 -1
- package/dist/components/index.js +1 -42
- package/dist/components/index.js.map +1 -1
- package/dist/components/{p-BusAjANB.js → p-8nSHGIIM.js} +3 -3
- package/dist/components/{p-BusAjANB.js.map → p-8nSHGIIM.js.map} +1 -1
- package/dist/components/{p-CgLTJDD-.js → p-BDOjPhMD.js} +7 -7
- package/dist/components/{p-CgLTJDD-.js.map → p-BDOjPhMD.js.map} +1 -1
- package/dist/components/{p-b3rSkcGt.js → p-BKMU86hK.js} +3 -3
- package/dist/components/{p-b3rSkcGt.js.map → p-BKMU86hK.js.map} +1 -1
- package/dist/components/{p-CiciRExf.js → p-BwKRsGs6.js} +3 -3
- package/dist/components/{p-CiciRExf.js.map → p-BwKRsGs6.js.map} +1 -1
- package/dist/components/{p-HV-e66iQ.js → p-C72s8DWi.js} +3 -3
- package/dist/components/{p-HV-e66iQ.js.map → p-C72s8DWi.js.map} +1 -1
- package/dist/components/{p-ddPhcRIf.js → p-CK9srR2x.js} +3 -3
- package/dist/components/{p-ddPhcRIf.js.map → p-CK9srR2x.js.map} +1 -1
- package/dist/components/{p-BvptV8CQ.js → p-CShZDkon.js} +5 -5
- package/dist/components/{p-BvptV8CQ.js.map → p-CShZDkon.js.map} +1 -1
- package/dist/components/{p-yY_48RFJ.js → p-CUoNtUST.js} +7 -7
- package/dist/components/{p-yY_48RFJ.js.map → p-CUoNtUST.js.map} +1 -1
- package/dist/components/{p-CvdTkdj3.js → p-CZqRXeXV.js} +3 -3
- package/dist/components/{p-CvdTkdj3.js.map → p-CZqRXeXV.js.map} +1 -1
- package/dist/components/{p-77UcQXtn.js → p-CavnvGs9.js} +5 -5
- package/dist/components/{p-77UcQXtn.js.map → p-CavnvGs9.js.map} +1 -1
- package/dist/components/{p-DN6scyTT.js → p-DHG4q2rF.js} +4 -4
- package/dist/components/{p-DN6scyTT.js.map → p-DHG4q2rF.js.map} +1 -1
- package/dist/components/{p-m6MLhFiO.js → p-XX6wJEoM.js} +3 -3
- package/dist/components/{p-m6MLhFiO.js.map → p-XX6wJEoM.js.map} +1 -1
- package/dist/components/p-attachment.js +5 -5
- package/dist/components/p-attachment.js.map +1 -1
- package/dist/components/p-avatar.js +1 -1
- package/dist/components/p-button.js +1 -1
- package/dist/components/p-calendar.js +1 -1
- package/dist/components/p-card-container.js +1 -1
- package/dist/components/p-card-container.js.map +1 -1
- package/dist/components/p-content-slider.js +3 -3
- package/dist/components/p-content-slider.js.map +1 -1
- package/dist/components/p-datepicker.js +6 -6
- package/dist/components/p-drawer-header.js +1 -1
- package/dist/components/p-drawer.js +2 -2
- package/dist/components/p-dropdown-menu-item.js +1 -1
- package/dist/components/p-empty-state.js +1 -1
- package/dist/components/{p-QJn8YEh5.js → p-fbONfJmY.js} +3 -3
- package/dist/components/{p-QJn8YEh5.js.map → p-fbONfJmY.js.map} +1 -1
- package/dist/components/p-field-container.js +1 -1
- package/dist/components/p-field.js +1 -1
- package/dist/components/p-helper.js +1 -1
- package/dist/components/{p-BjaBV6wd.js → p-iZJBhVLg.js} +3 -3
- package/dist/components/{p-BjaBV6wd.js.map → p-iZJBhVLg.js.map} +1 -1
- package/dist/components/{p-CEK29GCc.js → p-jeMjHYNm.js} +4 -4
- package/dist/components/{p-CEK29GCc.js.map → p-jeMjHYNm.js.map} +1 -1
- package/dist/components/p-modal-header.js +1 -1
- package/dist/components/p-modal.js +2 -2
- package/dist/components/p-navbar.js +1 -1
- package/dist/components/p-navigation-item.js +1 -1
- package/dist/components/p-navigation-item.js.map +1 -1
- package/dist/components/p-pagination-size.js +1 -1
- package/dist/components/p-pagination.js +1 -1
- package/dist/components/p-profile.js +1 -1
- package/dist/components/p-select.js +10 -10
- package/dist/components/p-select.js.map +1 -1
- package/dist/components/p-stepper-line.js +1 -1
- package/dist/components/p-stepper.js +1 -1
- package/dist/components/p-table-footer.js +1 -1
- package/dist/components/p-table-header.js +1 -1
- package/dist/components/p-table.js +11 -11
- package/dist/components/p-tooltip.js +1 -1
- package/dist/components/{p-BdYH3tmI.js → p-xL5NUFmL.js} +4 -4
- package/dist/components/{p-BdYH3tmI.js.map → p-xL5NUFmL.js.map} +1 -1
- package/dist/esm/index.js +1 -42
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/p-attachment.entry.js +1 -1
- package/dist/esm/p-attachment.entry.js.map +1 -1
- package/dist/esm/p-avatar.entry.js +1 -1
- package/dist/esm/p-avatar.entry.js.map +1 -1
- package/dist/esm/p-button.p-icon.p-loader.entry.js.map +1 -1
- package/dist/esm/p-button_3.entry.js +1 -1
- package/dist/esm/p-button_3.entry.js.map +1 -1
- package/dist/esm/p-card-container.entry.js +1 -1
- package/dist/esm/p-card-container.entry.js.map +1 -1
- package/dist/esm/p-checkbox.p-dropdown.p-dropdown-menu-container.p-dropdown-menu-item.entry.js.map +1 -1
- package/dist/esm/p-checkbox_4.entry.js +1 -1
- package/dist/esm/p-checkbox_4.entry.js.map +1 -1
- package/dist/esm/p-content-slider.entry.js +3 -3
- package/dist/esm/p-content-slider.entry.js.map +1 -1
- package/dist/esm/p-empty-state.p-floating-menu-container.p-table-cell.p-table-container.p-table-footer.p-table-header.p-table-row.p-table-row-actions-container.entry.js.map +1 -1
- package/dist/esm/p-empty-state_8.entry.js +2 -2
- package/dist/esm/p-empty-state_8.entry.js.map +1 -1
- package/dist/esm/p-field.p-field-container.entry.js.map +1 -1
- package/dist/esm/p-field_2.entry.js +1 -1
- package/dist/esm/p-field_2.entry.js.map +1 -1
- package/dist/esm/p-helper.p-tooltip.entry.js.map +1 -1
- package/dist/esm/p-helper_2.entry.js +1 -1
- package/dist/esm/p-helper_2.entry.js.map +1 -1
- package/dist/esm/p-navigation-item.entry.js +1 -1
- package/dist/esm/p-navigation-item.entry.js.map +1 -1
- package/dist/esm/p-select.entry.js +3 -3
- package/dist/esm/p-select.entry.js.map +1 -1
- package/dist/esm/p-stepper-item.p-stepper-line.entry.js.map +1 -1
- package/dist/esm/p-stepper-item_2.entry.js +1 -1
- package/dist/esm/p-stepper-item_2.entry.js.map +1 -1
- package/dist/index.html +1 -1
- package/dist/paperless/index.esm.js +1 -1
- package/dist/paperless/index.esm.js.map +1 -1
- package/dist/paperless/p-116fe39b.entry.js +2 -0
- package/dist/{build/p-6b4e7631.entry.js.map → paperless/p-116fe39b.entry.js.map} +1 -1
- package/dist/paperless/p-17c82f7c.entry.js +2 -0
- package/dist/paperless/{p-cfa138a1.entry.js.map → p-17c82f7c.entry.js.map} +1 -1
- package/dist/paperless/p-30c5b71b.entry.js +2 -0
- package/dist/paperless/p-30c5b71b.entry.js.map +1 -0
- package/dist/paperless/p-3d174b05.entry.js +2 -0
- package/dist/paperless/{p-699db32c.entry.js.map → p-3d174b05.entry.js.map} +1 -1
- package/dist/paperless/p-720963cf.entry.js +2 -0
- package/dist/{build/p-6916ad9d.entry.js.map → paperless/p-720963cf.entry.js.map} +1 -1
- package/dist/paperless/{p-af3ffe40.entry.js → p-85402959.entry.js} +2 -2
- package/dist/{build/p-af3ffe40.entry.js.map → paperless/p-85402959.entry.js.map} +1 -1
- package/dist/paperless/{p-a7ea8b65.entry.js → p-875faa3e.entry.js} +2 -2
- package/dist/paperless/{p-a7ea8b65.entry.js.map → p-875faa3e.entry.js.map} +1 -1
- package/dist/{build/p-d620c128.entry.js → paperless/p-8fc3da2f.entry.js} +2 -2
- package/dist/{build/p-d620c128.entry.js.map → paperless/p-8fc3da2f.entry.js.map} +1 -1
- package/dist/paperless/p-96be5968.entry.js +2 -0
- package/dist/paperless/{p-23169a44.entry.js.map → p-96be5968.entry.js.map} +1 -1
- package/dist/paperless/p-attachment.entry.esm.js.map +1 -1
- package/dist/paperless/p-avatar.entry.esm.js.map +1 -1
- package/dist/paperless/p-b588b2ca.entry.js +2 -0
- package/dist/paperless/{p-978e217e.entry.js.map → p-b588b2ca.entry.js.map} +1 -1
- package/dist/paperless/p-button.p-icon.p-loader.entry.esm.js.map +1 -1
- package/dist/paperless/p-card-container.entry.esm.js.map +1 -1
- package/dist/paperless/p-checkbox.p-dropdown.p-dropdown-menu-container.p-dropdown-menu-item.entry.esm.js.map +1 -1
- package/dist/paperless/p-content-slider.entry.esm.js.map +1 -1
- package/dist/paperless/p-e74def55.entry.js +2 -0
- package/dist/paperless/p-e74def55.entry.js.map +1 -0
- package/dist/paperless/p-empty-state.p-floating-menu-container.p-table-cell.p-table-container.p-table-footer.p-table-header.p-table-row.p-table-row-actions-container.entry.esm.js.map +1 -1
- package/dist/paperless/p-f866e7de.entry.js +2 -0
- package/dist/{build/p-7682e7f2.entry.js.map → paperless/p-f866e7de.entry.js.map} +1 -1
- package/dist/paperless/p-field.p-field-container.entry.esm.js.map +1 -1
- package/dist/paperless/p-helper.p-tooltip.entry.esm.js.map +1 -1
- package/dist/paperless/p-navigation-item.entry.esm.js.map +1 -1
- package/dist/paperless/p-select.entry.esm.js.map +1 -1
- package/dist/paperless/p-stepper-item.p-stepper-line.entry.esm.js.map +1 -1
- package/dist/paperless/paperless.esm.js +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/dist/tailwind/theme/colors.ts +1 -43
- package/dist/types/tailwind/theme/colors.d.ts +1 -42
- package/package.json +1 -1
- package/dist/build/p-23169a44.entry.js +0 -2
- package/dist/build/p-6916ad9d.entry.js +0 -2
- package/dist/build/p-699db32c.entry.js +0 -2
- package/dist/build/p-6b4e7631.entry.js +0 -2
- package/dist/build/p-7682e7f2.entry.js +0 -2
- package/dist/build/p-922d3fb4.entry.js +0 -2
- package/dist/build/p-922d3fb4.entry.js.map +0 -1
- package/dist/build/p-978e217e.entry.js +0 -2
- package/dist/build/p-a8394124.entry.js +0 -2
- package/dist/build/p-a8394124.entry.js.map +0 -1
- package/dist/build/p-cfa138a1.entry.js +0 -2
- package/dist/paperless/p-23169a44.entry.js +0 -2
- package/dist/paperless/p-6916ad9d.entry.js +0 -2
- package/dist/paperless/p-699db32c.entry.js +0 -2
- package/dist/paperless/p-6b4e7631.entry.js +0 -2
- package/dist/paperless/p-7682e7f2.entry.js +0 -2
- package/dist/paperless/p-922d3fb4.entry.js +0 -2
- package/dist/paperless/p-922d3fb4.entry.js.map +0 -1
- package/dist/paperless/p-978e217e.entry.js +0 -2
- package/dist/paperless/p-a8394124.entry.js +0 -2
- package/dist/paperless/p-a8394124.entry.js.map +0 -1
- package/dist/paperless/p-cfa138a1.entry.js +0 -2
|
@@ -3,10 +3,10 @@ import { c as cva } from './p-CBWjHURv.js';
|
|
|
3
3
|
import { f as formatTranslation, g as getLocaleComponentStrings } from './p-DiJj8rmO.js';
|
|
4
4
|
import { c as cn } from './p-CT54OXR2.js';
|
|
5
5
|
import { a as asBoolean } from './p-C5CTp9IA.js';
|
|
6
|
-
import { d as defineCustomElement$4 } from './p-
|
|
6
|
+
import { d as defineCustomElement$4 } from './p-CZqRXeXV.js';
|
|
7
7
|
import { d as defineCustomElement$3 } from './p-BNz_LoMA.js';
|
|
8
8
|
import { d as defineCustomElement$2 } from './p-CvfOjT_y.js';
|
|
9
|
-
import { d as defineCustomElement$1 } from './p-
|
|
9
|
+
import { d as defineCustomElement$1 } from './p-C72s8DWi.js';
|
|
10
10
|
|
|
11
11
|
const fieldContainerComponentCss = "*{box-sizing:border-box}.ml-2{margin-left:.5rem!important}.ml-auto{margin-left:auto!important}.flex{display:flex!important}.h-4{height:1rem!important}.h-5{height:1.25rem!important}.h-6{height:1.5rem!important}.h-8{height:2rem!important}.w-full{width:100%!important}.w-inherit{width:inherit!important}.flex-row-reverse{flex-direction:row-reverse!important}.flex-col{flex-direction:column!important}.items-end{align-items:flex-end!important}.items-center{align-items:center!important}.justify-between{justify-content:space-between!important}.gap-1{gap:.25rem!important}.rounded-lg{border-radius:.5rem!important}.text-xs{font-size:.75rem!important;line-height:1rem!important}.font-medium{font-weight:500!important}.font-normal{font-weight:400!important}.text-storm-200{--tw-text-opacity:1!important;color:rgb(163 165 169/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}.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}}.empty\\:hidden:empty{display:none!important}";
|
|
12
12
|
|
|
@@ -206,6 +206,6 @@ function defineCustomElement() {
|
|
|
206
206
|
defineCustomElement();
|
|
207
207
|
|
|
208
208
|
export { FieldContainer as F, defineCustomElement as d };
|
|
209
|
-
//# sourceMappingURL=p-
|
|
209
|
+
//# sourceMappingURL=p-DHG4q2rF.js.map
|
|
210
210
|
|
|
211
|
-
//# sourceMappingURL=p-
|
|
211
|
+
//# sourceMappingURL=p-DHG4q2rF.js.map
|
|
@@ -1 +1 @@
|
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D,MAAM,yBAAyB,GAC9B,YAAY;AACZ,aAAC,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,KAAK,KAAK,MAAM,CAAC;QAExE,OAAO;YACN,aAAa;YACb,YAAY;YACZ,aAAa;YACb,YAAY;YACZ,MAAM;YACN,KAAK;YACL,yBAAyB;SACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/molecules/field/container/field-container.component.css?tag=p-field-container&encapsulation=shadow","src/components/molecules/field/container/field-container.component.tsx"],"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"],"version":3}
|
|
1
|
+
{"file":"p-DHG4q2rF.js","mappings":";;;;;;;;;;AAAA,MAAM,0BAA0B,GAAG,6vDAA6vD;;ACoBhyD,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,mBAAmB,CAAC,EAAE;AACzC,IAAA,QAAQ,EAAE;AACT,QAAA,OAAO,EAAE;AACR,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,KAAK,EAAE,IAAI;AACX,SAAA;AACD,QAAA,IAAI,EAAE;AACL,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,EAAE,EAAE,IAAI;AACR,SAAA;AACD,KAAA;AACD,IAAA,gBAAgB,EAAE;AACjB,QAAA;AACC,YAAA,OAAO,EAAE,MAAM;AACf,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,KAAK,EAAE,KAAK;AACZ,SAAA;AACD,QAAA;AACC,YAAA,OAAO,EAAE,MAAM;AACf,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,KAAK,EAAE,KAAK;AACZ,SAAA;AAED,QAAA;AACC,YAAA,OAAO,EAAE,OAAO;AAChB,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,KAAK,EAAE,KAAK;AACZ,SAAA;AACD,QAAA;AACC,YAAA,OAAO,EAAE,OAAO;AAChB,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,KAAK,EAAE,KAAK;AACZ,SAAA;AACD,KAAA;AACD,CAAA,CAAC;MASW,cAAc,iBAAAA,kBAAA,CAAA,MAAA,cA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QAAA,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,yBAAyB,CAAC;QAExE,MAAM,MAAM,GAAG,aAAa,GAAG,CAAM,CAAA,MAAA,EAAA,EAAA,IAAI,EAAC,QAAQ,GAAG,GAAG,IAAI,CAAC,MAAM;QACnE,MAAM,KAAK,GAAG,YAAY,GAAG,CAAM,CAAA,MAAA,EAAA,EAAA,IAAI,EAAC,OAAO,GAAG,GAAG,IAAI,CAAC,KAAK;QAE/D,MAAM,yBAAyB,GAC9B,YAAY;AACZ,aAAC,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,KAAK,KAAK,MAAM,CAAC;QAExE,OAAO;YACN,aAAa;YACb,YAAY;YACZ,aAAa;YACb,YAAY;YACZ,MAAM;YACN,KAAK;YACL,yBAAyB;SACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/molecules/field/container/field-container.component.css?tag=p-field-container&encapsulation=shadow","src/components/molecules/field/container/field-container.component.tsx"],"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"],"version":3}
|
|
@@ -5,7 +5,7 @@ import { c as cn } from './p-CT54OXR2.js';
|
|
|
5
5
|
import { d as defineCustomElement$2 } from './p-BNz_LoMA.js';
|
|
6
6
|
import { d as defineCustomElement$1 } from './p-CvfOjT_y.js';
|
|
7
7
|
|
|
8
|
-
const buttonComponentCss = "*{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-
|
|
8
|
+
const buttonComponentCss = "*{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-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}";
|
|
9
9
|
|
|
10
10
|
const button = cva([
|
|
11
11
|
'group',
|
|
@@ -488,6 +488,6 @@ function defineCustomElement() {
|
|
|
488
488
|
defineCustomElement();
|
|
489
489
|
|
|
490
490
|
export { Button as B, defineCustomElement as d };
|
|
491
|
-
//# sourceMappingURL=p-
|
|
491
|
+
//# sourceMappingURL=p-XX6wJEoM.js.map
|
|
492
492
|
|
|
493
|
-
//# sourceMappingURL=p-
|
|
493
|
+
//# sourceMappingURL=p-XX6wJEoM.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-m6MLhFiO.js","mappings":";;;;;;;AAAA,MAAM,kBAAkB,GAAG,yqQAAyqQ;;ACepsQ,MAAM,MAAM,GAAG,GAAG,CACjB;IACC,OAAO;IACP,yBAAyB;IACzB,kCAAkC;IAClC,gBAAgB;CAChB,EACD;AACC,IAAA,QAAQ,EAAE;AACT,QAAA,OAAO,EAAE;AACR,YAAA,OAAO,EAAE,CAAC,qBAAqB,EAAE,YAAY,CAAC;AAC9C,YAAA,SAAS,EAAE,IAAI;AACf,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,WAAW,EAAE,mCAAmC;AAChD,YAAA,QAAQ,EAAE,IAAI;AACd,SAAA;AACD,QAAA,MAAM,EAAE;AACP,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,KAAK,EAAE,IAAI;AACX,SAAA;AACD,QAAA,KAAK,EAAE;AACN,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,KAAK,EAAE,IAAI;AACX,SAAA;AACD,QAAA,OAAO,EAAE;AACR,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,KAAK,EAAE,IAAI;AACX,SAAA;AACD,QAAA,IAAI,EAAE;YACL,EAAE,EAAE,CAAC,mBAAmB,CAAC;YACzB,IAAI,EAAE,CAAC,mBAAmB,CAAC;YAC3B,E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AI,IAAI,CAAC,QAAQ,EAAE;YAClC,EAAE,CAAC,cAAc,EAAE;YACnB;;AAGD,QAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;;IAGd,QAAQ,GAAA;AACf,QAAA,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACf;;QAGD,QACC,CAAA,CAAA,QAAA,EAAA,EACC,KAAK,EAAE,IAAI,CAAC;gBACX,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,OAAO,EAAE,IAAI,CAAC,OAAO;AACrB,gBAAA,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;AAClC,gBAAA,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;AAC9B,gBAAA,KAAK,EAAE,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,EAAA,CACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/molecules/button/button.component.css?tag=p-button","src/components/molecules/button/button.component.tsx"],"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 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 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"],"version":3}
|
|
1
|
+
{"file":"p-XX6wJEoM.js","mappings":";;;;;;;AAAA,MAAM,kBAAkB,GAAG,08PAA08P;;ACer+P,MAAM,MAAM,GAAG,GAAG,CACjB;IACC,OAAO;IACP,yBAAyB;IACzB,kCAAkC;IAClC,gBAAgB;CAChB,EACD;AACC,IAAA,QAAQ,EAAE;AACT,QAAA,OAAO,EAAE;AACR,YAAA,OAAO,EAAE,CAAC,qBAAqB,EAAE,YAAY,CAAC;AAC9C,YAAA,SAAS,EAAE,IAAI;AACf,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,WAAW,EAAE,mCAAmC;AAChD,YAAA,QAAQ,EAAE,IAAI;AACd,SAAA;AACD,QAAA,MAAM,EAAE;AACP,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,KAAK,EAAE,IAAI;AACX,SAAA;AACD,QAAA,KAAK,EAAE;AACN,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,KAAK,EAAE,IAAI;AACX,SAAA;AACD,QAAA,OAAO,EAAE;AACR,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,KAAK,EAAE,IAAI;AACX,SAAA;AACD,QAAA,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AW,EAAI,CAAA,CACpC,CACR;;AAKT,IAAA,WAAW,CAAC,EAAc,EAAA;QACzB,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE;YAClC,EAAE,CAAC,cAAc,EAAE;YACnB;;AAGD,QAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;;IAGd,QAAQ,GAAA;AACf,QAAA,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACf;;QAGD,QACC,CAAA,CAAA,QAAA,EAAA,EACC,KAAK,EAAE,IAAI,CAAC;gBACX,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,OAAO,EAAE,IAAI,CAAC,OAAO;AACrB,gBAAA,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;AAClC,gBAAA,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;AAC9B,gBAAA,KAAK,EAAE,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,EAAA,CACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/molecules/button/button.component.css?tag=p-button","src/components/molecules/button/button.component.tsx"],"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 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 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"],"version":3}
|
|
@@ -2,14 +2,14 @@ import { p as proxyCustomElement, H, c as createEvent, h, F as Fragment } from '
|
|
|
2
2
|
import { c as cva } from './p-CBWjHURv.js';
|
|
3
3
|
import { h as isTablet, f as isMobile } from './p-B3sNjfzc.js';
|
|
4
4
|
import { c as cn } from './p-CT54OXR2.js';
|
|
5
|
-
import { d as defineCustomElement$7 } from './p-
|
|
6
|
-
import { d as defineCustomElement$6 } from './p-
|
|
7
|
-
import { d as defineCustomElement$5 } from './p-
|
|
5
|
+
import { d as defineCustomElement$7 } from './p-XX6wJEoM.js';
|
|
6
|
+
import { d as defineCustomElement$6 } from './p-DHG4q2rF.js';
|
|
7
|
+
import { d as defineCustomElement$5 } from './p-CZqRXeXV.js';
|
|
8
8
|
import { d as defineCustomElement$4 } from './p-BNz_LoMA.js';
|
|
9
9
|
import { d as defineCustomElement$3 } from './p-CvfOjT_y.js';
|
|
10
|
-
import { d as defineCustomElement$2 } from './p-
|
|
10
|
+
import { d as defineCustomElement$2 } from './p-C72s8DWi.js';
|
|
11
11
|
|
|
12
|
-
const attachmentComponentCss = ".block{display:block!important}*{box-sizing:border-box}:host{display:block;width:100%}.static{position:static!important}.flex{display:flex!important}.hidden{display:none!important}.h-8{height:2rem!important}.w-8{width:2rem!important}.w-full{width:100%!important}.min-w-0{min-width:0!important}.flex-1{flex:1 1 0%!important}.cursor-pointer{cursor:pointer!important}.items-start{align-items:flex-start!important}.items-center{align-items:center!important}.justify-start{justify-content:flex-start!important}.gap-2{gap:.5rem!important}.overflow-hidden{overflow:hidden!important}.text-ellipsis{text-overflow:ellipsis!important}.whitespace-nowrap{white-space:nowrap!important}.rounded-lg{border-radius:.5rem!important}.border{border-width:1px!important}.border-solid{border-style:solid!important}.border-
|
|
12
|
+
const attachmentComponentCss = ".block{display:block!important}*{box-sizing:border-box}:host{display:block;width:100%}.static{position:static!important}.flex{display:flex!important}.hidden{display:none!important}.h-8{height:2rem!important}.w-8{width:2rem!important}.w-full{width:100%!important}.min-w-0{min-width:0!important}.flex-1{flex:1 1 0%!important}.cursor-pointer{cursor:pointer!important}.items-start{align-items:flex-start!important}.items-center{align-items:center!important}.justify-start{justify-content:flex-start!important}.gap-2{gap:.5rem!important}.overflow-hidden{overflow:hidden!important}.text-ellipsis{text-overflow:ellipsis!important}.whitespace-nowrap{white-space:nowrap!important}.rounded-lg{border-radius:.5rem!important}.border{border-width:1px!important}.border-solid{border-style:solid!important}.border-storm-100{--tw-border-opacity:1!important;border-color:rgb(209 210 212/var(--tw-border-opacity,1))!important}.bg-white-600{--tw-bg-opacity:1!important;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))!important}.px-2{padding-left:.5rem!important;padding-right:.5rem!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-storm-200{--tw-text-opacity:1!important;color:rgb(163 165 169/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}.empty\\:hidden:empty{display:none!important}.peer:empty~.peer-empty\\:block{display:block!important}@media (min-width:64rem){.desktop-xs\\:hidden{display:none!important}}";
|
|
13
13
|
|
|
14
14
|
const attachment = cva([
|
|
15
15
|
'flex flex-1 items-center justify-start gap-2',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-attachment.js","mappings":";;;;;;;;;;;AAAA,MAAM,sBAAsB,GAAG,ytDAAytD;;ACWxvD,MAAM,UAAU,GAAG,GAAG,CACrB;IACC,8CAA8C;IAC9C,6BAA6B;IAC7B,kCAAkC;CAClC,EACD;AACC,IAAA,QAAQ,EAAE;AACT,QAAA,KAAK,EAAE;AACN,YAAA,KAAK,EAAE,IAAI;AACX,YAAA,IAAI,EAAE,gBAAgB;AACtB,SAAA;AACD,QAAA,KAAK,EAAE;AACN,YAAA,KAAK,EAAE,8CAA8C;AACrD,YAAA,IAAI,EAAE,qBAAqB;AAC3B,SAAA;AACD,KAAA;AACD,CAAA,CACD;MAOY,UAAU,iBAAAA,kBAAA,CAAA,MAAA,UAAA,SAAAC,CAAA,CAAA;;;;;;;;;AACtB;;AAEG;IACK,oBAAoB,GAAG,KAAK;AAEpC;;AAEG;AACK,IAAA,KAAK;AAEb;;AAEG;AACK,IAAA,MAAM;AAEd;;AAEG;IACK,MAAM,GAAsB,IAAI;AAExC;;AAEG;AACK,IAAA,KAAK;AAEb;;AAEG;AACK,IAAA,MAAM;AAEd;;AAEG;IACsB,QAAQ,GAAG,IAAI;AAExC;;AAEG;IACK,IAAI,GAAqB,MAAM;AAEvC;;AAEG;IACK,WAAW,GAAW,kBAAkB;AAEhD;;AAEG;IACK,aAAa,GAAW,QAAQ;AAExC;;AAEG;IACK,eAAe,GAAW,UAAU;AAE5C;;AAEG;IACK,aAAa,GAAW,QAAQ;AAExC;;AAEG;IACK,aAAa,GAAW,QAAQ;AAExC;;AAEG;IACK,OAAO,GAAG,KAAK;AAEvB;;AAEG;AACK,IAAA,KAAK;AAEb;;AAEG;AAIH,IAAA,MAAM;AAMN;;AAEG;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omElement","HTMLElement"],"sources":["src/components/molecules/attachment/attachment.component.css?tag=p-attachment&encapsulation=shadow","src/components/molecules/attachment/attachment.component.tsx"],"sourcesContent":[":host {\n\t@apply block w-full;\n}\n","import {\n\tComponent,\n\tEvent,\n\tEventEmitter,\n\tFragment,\n\th,\n\tProp,\n} from '@stencil/core';\nimport { cn, isMobile, isTablet } from '../../../utils';\nimport { cva } from 'class-variance-authority';\n\nconst attachment = cva(\n\t[\n\t\t'flex flex-1 items-center justify-start gap-2',\n\t\t'h-8 min-w-0 px-2 rounded-lg',\n\t\t'border border-solid bg-white-600',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tclick: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: 'cursor-pointer',\n\t\t\t},\n\t\t\terror: {\n\t\t\t\tfalse: 'bg-white-600 border-storm-100 text-storm-200',\n\t\t\t\ttrue: 'border-negative-red',\n\t\t\t},\n\t\t},\n\t}\n);\n\n@Component({\n\ttag: 'p-attachment',\n\tstyleUrl: 'attachment.component.css',\n\tshadow: true,\n})\nexport class Attachment {\n\t/**\n\t * Wether to enable the camera button on mobile\n\t */\n\t@Prop() enableCameraOnMobile = false;\n\n\t/**\n\t * The value of the attachment (usually the file name)\n\t */\n\t@Prop() value: string;\n\n\t/**\n\t * The fileID to use to track the file\n\t */\n\t@Prop() fileId: string;\n\n\t/**\n\t * The type of files to accept\n\t */\n\t@Prop() accept: string[] | string = null;\n\n\t/**\n\t * The label of the attachment\n\t */\n\t@Prop() label: string | HTMLSlotElement;\n\n\t/**\n\t * The helper of the attachment\n\t */\n\t@Prop() helper: string | HTMLSlotElement;\n\n\t/**\n\t * Wether the attachment is required\n\t */\n\t@Prop({ reflect: true }) required = true;\n\n\t/**\n\t * The variant of the attachment\n\t */\n\t@Prop() mode: 'read' | 'write' = 'read';\n\n\t/**\n\t * The placeholder of the attachment\n\t */\n\t@Prop() placeholder: string = 'Upload a file...';\n\n\t/**\n\t * The text for the camera tooltip\n\t */\n\t@Prop() cameraTooltip: string = 'Camera';\n\n\t/**\n\t * The text for the download tooltip\n\t */\n\t@Prop() downloadTooltip: string = 'Download';\n\n\t/**\n\t * The text for the upload tooltip\n\t */\n\t@Prop() uploadTooltip: string = 'Upload';\n\n\t/**\n\t * The text for the delete tooltip\n\t */\n\t@Prop() deleteTooltip: string = 'Delete';\n\n\t/**\n\t * Wether the attachment is loading\n\t */\n\t@Prop() loading = false;\n\n\t/**\n\t * The error to show\n\t */\n\t@Prop() error: string;\n\n\t/**\n\t * Event when upload is pressed\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tupload: EventEmitter<{\n\t\tfile: File;\n\t\tfileId: string;\n\t\tresult: string;\n\t}>;\n\n\t/**\n\t * Event when download is pressed\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tdownload: EventEmitter<void>;\n\n\t/**\n\t * Event when delete is pressed\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tdelete: EventEmitter<void>;\n\n\tprivate _fileRef: HTMLInputElement;\n\tprivate _cameraFileRef: HTMLInputElement;\n\n\trender() {\n\t\tlet prefix = (\n\t\t\t<p-icon\n\t\t\t\tclass='text-storm-300'\n\t\t\t\tvariant='attachment'\n\t\t\t/>\n\t\t);\n\n\t\tif (this.error) {\n\t\t\tprefix = (\n\t\t\t\t<p-icon\n\t\t\t\t\tvariant='warning'\n\t\t\t\t\tclass='text-negative-red'\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\t// const isMobileDevice = isMobile();\n\t\tconst isMobileDevice = isTablet();\n\n\t\tconst baseText =\n\t\t\t'min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-sm';\n\t\treturn (\n\t\t\t<Fragment>\n\t\t\t\t<p-field-container\n\t\t\t\t\tvariant='write'\n\t\t\t\t\tlabel={this.label}\n\t\t\t\t\thelper={this.helper}\n\t\t\t\t\terror={this.error}\n\t\t\t\t\trequired={this.required}\n\t\t\t\t\tforceShowTooltip={!!this.error?.length}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tslot='content'\n\t\t\t\t\t\tclass='flex w-full items-start gap-2'\n\t\t\t\t\t>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclass={attachment({\n\t\t\t\t\t\t\t\tclick: this.mode === 'write' && !this.value?.length,\n\t\t\t\t\t\t\t\terror: !!this.error?.length,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tonClick={() => this._uploadClick()}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{prefix}\n\n\t\t\t\t\t\t\t<span class={cn(baseText, 'peer empty:hidden')}>\n\t\t\t\t\t\t\t\t{this.value}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span class={cn(baseText, 'hidden peer-empty:block')}>\n\t\t\t\t\t\t\t\t{this.placeholder}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<p-tooltip\n\t\t\t\t\t\t\tclass='w-8'\n\t\t\t\t\t\t\tcontent={\n\t\t\t\t\t\t\t\tthis.mode === 'read'\n\t\t\t\t\t\t\t\t\t? this.downloadTooltip\n\t\t\t\t\t\t\t\t\t: this.value?.length\n\t\t\t\t\t\t\t\t\t? this.deleteTooltip\n\t\t\t\t\t\t\t\t\t: this.uploadTooltip\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\t\tslot='trigger'\n\t\t\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\t\t\ticonOnly={true}\n\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\tthis.mode === 'read'\n\t\t\t\t\t\t\t\t\t\t? 'download'\n\t\t\t\t\t\t\t\t\t\t: this.value?.length\n\t\t\t\t\t\t\t\t\t\t? 'trash'\n\t\t\t\t\t\t\t\t\t\t: 'upload'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={this.loading}\n\t\t\t\t\t\t\t\tloading={this.loading}\n\t\t\t\t\t\t\t\tonOnClick={() =>\n\t\t\t\t\t\t\t\t\tthis.mode === 'write' && !this.value?.length\n\t\t\t\t\t\t\t\t\t\t? this._uploadClick()\n\t\t\t\t\t\t\t\t\t\t: (this.mode === 'read'\n\t\t\t\t\t\t\t\t\t\t\t\t? this.download\n\t\t\t\t\t\t\t\t\t\t\t\t: this.delete\n\t\t\t\t\t\t\t\t\t\t ).emit()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</p-tooltip>\n\n\t\t\t\t\t\t{this.enableCameraOnMobile &&\n\t\t\t\t\t\t\tthis.mode === 'write' &&\n\t\t\t\t\t\t\tisMobileDevice &&\n\t\t\t\t\t\t\t!this.value?.length && (\n\t\t\t\t\t\t\t\t<p-tooltip\n\t\t\t\t\t\t\t\t\tcontent={this.cameraTooltip}\n\t\t\t\t\t\t\t\t\tclass='w-8 desktop-xs:hidden'\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\t\t\t\tslot='trigger'\n\t\t\t\t\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\t\t\t\t\ticonOnly={true}\n\t\t\t\t\t\t\t\t\t\ticon='camera'\n\t\t\t\t\t\t\t\t\t\tonOnClick={() => this._cameraClick()}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</p-tooltip>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</p-field-container>\n\n\t\t\t\t<input\n\t\t\t\t\tclass='hidden'\n\t\t\t\t\ttype='file'\n\t\t\t\t\taccept={\n\t\t\t\t\t\tArray.isArray(this.accept) ? this.accept?.join(',') : this.accept\n\t\t\t\t\t}\n\t\t\t\t\tref={el => (this._fileRef = el)}\n\t\t\t\t\tonChange={ev => this._onFileChange(ev)}\n\t\t\t\t/>\n\n\t\t\t\t<input\n\t\t\t\t\tclass='hidden'\n\t\t\t\t\ttype='file'\n\t\t\t\t\taccept='image/*'\n\t\t\t\t\tcapture='true'\n\t\t\t\t\tref={el => (this._cameraFileRef = el)}\n\t\t\t\t\tonChange={ev => this._onFileChange(ev)}\n\t\t\t\t/>\n\t\t\t</Fragment>\n\t\t);\n\t}\n\n\tprivate _uploadClick() {\n\t\tif (!this._fileRef || this.mode !== 'write' || this.value?.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._fileRef.click();\n\t}\n\n\tprivate _cameraClick() {\n\t\tif (!this.enableCameraOnMobile || isMobile()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._cameraFileRef || this.mode !== 'write') {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._cameraFileRef?.click();\n\t}\n\n\tprivate _onFileChange(ev: Event) {\n\t\tconst target = ev.target as HTMLInputElement;\n\t\tconst file = target.files?.[0];\n\n\t\tif (file) {\n\t\t\tthis.loading = true;\n\n\t\t\tconst reader = new FileReader();\n\t\t\treader.onload = (e: any) => this._onLoad(file, e?.currentTarget?.result);\n\t\t\treader.readAsDataURL(file);\n\t\t}\n\t}\n\n\tprivate _onLoad(file: File, result: string) {\n\t\tthis.upload.emit({\n\t\t\tfileId: this.fileId,\n\t\t\tresult,\n\t\t\tfile,\n\t\t});\n\n\t\tif (this._fileRef) {\n\t\t\tthis._fileRef.value = '';\n\t\t}\n\n\t\tif (this._cameraFileRef) {\n\t\t\tthis._cameraFileRef.value = '';\n\t\t}\n\n\t\tthis.loading = false;\n\t}\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-attachment.js","mappings":";;;;;;;;;;;AAAA,MAAM,sBAAsB,GAAG,0/CAA0/C;;ACWzhD,MAAM,UAAU,GAAG,GAAG,CACrB;IACC,8CAA8C;IAC9C,6BAA6B;IAC7B,kCAAkC;CAClC,EACD;AACC,IAAA,QAAQ,EAAE;AACT,QAAA,KAAK,EAAE;AACN,YAAA,KAAK,EAAE,IAAI;AACX,YAAA,IAAI,EAAE,gBAAgB;AACt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IAAI,EAAE;AACT,YAAA,IAAI,CAAC,OAAO,GAAG,IAAI;AAEnB,YAAA,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE;YAC/B,MAAM,CAAC,MAAM,GAAG,CAAC,CAAM,KAAK,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE,aAAa,EAAE,MAAM,CAAC;AACxE,YAAA,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC;;;IAIpB,OAAO,CAAC,IAAU,EAAE,MAAc,EAAA;AACzC,QAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YAChB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM;YACN,IAAI;AACJ,SAAA,CAAC;AAEF,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;AAClB,YAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,EAAE;;AAGzB,QAAA,IAAI,IAAI,CAAC,cAAc,EAAE;AACxB,YAAA,IAAI,CAAC,cAAc,CAAC,KAAK,GAAG,EAAE;;AAG/B,QAAA,IAAI,CAAC,OAAO,GAAG,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/molecules/attachment/attachment.component.css?tag=p-attachment&encapsulation=shadow","src/components/molecules/attachment/attachment.component.tsx"],"sourcesContent":[":host {\n\t@apply block w-full;\n}\n","import {\n\tComponent,\n\tEvent,\n\tEventEmitter,\n\tFragment,\n\th,\n\tProp,\n} from '@stencil/core';\nimport { cn, isMobile, isTablet } from '../../../utils';\nimport { cva } from 'class-variance-authority';\n\nconst attachment = cva(\n\t[\n\t\t'flex flex-1 items-center justify-start gap-2',\n\t\t'h-8 min-w-0 px-2 rounded-lg',\n\t\t'border border-solid bg-white-600',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tclick: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: 'cursor-pointer',\n\t\t\t},\n\t\t\terror: {\n\t\t\t\tfalse: 'bg-white-600 border-storm-100 text-storm-200',\n\t\t\t\ttrue: 'border-negative-red',\n\t\t\t},\n\t\t},\n\t}\n);\n\n@Component({\n\ttag: 'p-attachment',\n\tstyleUrl: 'attachment.component.css',\n\tshadow: true,\n})\nexport class Attachment {\n\t/**\n\t * Wether to enable the camera button on mobile\n\t */\n\t@Prop() enableCameraOnMobile = false;\n\n\t/**\n\t * The value of the attachment (usually the file name)\n\t */\n\t@Prop() value: string;\n\n\t/**\n\t * The fileID to use to track the file\n\t */\n\t@Prop() fileId: string;\n\n\t/**\n\t * The type of files to accept\n\t */\n\t@Prop() accept: string[] | string = null;\n\n\t/**\n\t * The label of the attachment\n\t */\n\t@Prop() label: string | HTMLSlotElement;\n\n\t/**\n\t * The helper of the attachment\n\t */\n\t@Prop() helper: string | HTMLSlotElement;\n\n\t/**\n\t * Wether the attachment is required\n\t */\n\t@Prop({ reflect: true }) required = true;\n\n\t/**\n\t * The variant of the attachment\n\t */\n\t@Prop() mode: 'read' | 'write' = 'read';\n\n\t/**\n\t * The placeholder of the attachment\n\t */\n\t@Prop() placeholder: string = 'Upload a file...';\n\n\t/**\n\t * The text for the camera tooltip\n\t */\n\t@Prop() cameraTooltip: string = 'Camera';\n\n\t/**\n\t * The text for the download tooltip\n\t */\n\t@Prop() downloadTooltip: string = 'Download';\n\n\t/**\n\t * The text for the upload tooltip\n\t */\n\t@Prop() uploadTooltip: string = 'Upload';\n\n\t/**\n\t * The text for the delete tooltip\n\t */\n\t@Prop() deleteTooltip: string = 'Delete';\n\n\t/**\n\t * Wether the attachment is loading\n\t */\n\t@Prop() loading = false;\n\n\t/**\n\t * The error to show\n\t */\n\t@Prop() error: string;\n\n\t/**\n\t * Event when upload is pressed\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tupload: EventEmitter<{\n\t\tfile: File;\n\t\tfileId: string;\n\t\tresult: string;\n\t}>;\n\n\t/**\n\t * Event when download is pressed\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tdownload: EventEmitter<void>;\n\n\t/**\n\t * Event when delete is pressed\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tdelete: EventEmitter<void>;\n\n\tprivate _fileRef: HTMLInputElement;\n\tprivate _cameraFileRef: HTMLInputElement;\n\n\trender() {\n\t\tlet prefix = (\n\t\t\t<p-icon\n\t\t\t\tclass='text-storm-300'\n\t\t\t\tvariant='attachment'\n\t\t\t/>\n\t\t);\n\n\t\tif (this.error) {\n\t\t\tprefix = (\n\t\t\t\t<p-icon\n\t\t\t\t\tvariant='warning'\n\t\t\t\t\tclass='text-negative-red'\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\t// const isMobileDevice = isMobile();\n\t\tconst isMobileDevice = isTablet();\n\n\t\tconst baseText =\n\t\t\t'min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-sm';\n\t\treturn (\n\t\t\t<Fragment>\n\t\t\t\t<p-field-container\n\t\t\t\t\tvariant='write'\n\t\t\t\t\tlabel={this.label}\n\t\t\t\t\thelper={this.helper}\n\t\t\t\t\terror={this.error}\n\t\t\t\t\trequired={this.required}\n\t\t\t\t\tforceShowTooltip={!!this.error?.length}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tslot='content'\n\t\t\t\t\t\tclass='flex w-full items-start gap-2'\n\t\t\t\t\t>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclass={attachment({\n\t\t\t\t\t\t\t\tclick: this.mode === 'write' && !this.value?.length,\n\t\t\t\t\t\t\t\terror: !!this.error?.length,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tonClick={() => this._uploadClick()}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{prefix}\n\n\t\t\t\t\t\t\t<span class={cn(baseText, 'peer empty:hidden')}>\n\t\t\t\t\t\t\t\t{this.value}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span class={cn(baseText, 'hidden peer-empty:block')}>\n\t\t\t\t\t\t\t\t{this.placeholder}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<p-tooltip\n\t\t\t\t\t\t\tclass='w-8'\n\t\t\t\t\t\t\tcontent={\n\t\t\t\t\t\t\t\tthis.mode === 'read'\n\t\t\t\t\t\t\t\t\t? this.downloadTooltip\n\t\t\t\t\t\t\t\t\t: this.value?.length\n\t\t\t\t\t\t\t\t\t? this.deleteTooltip\n\t\t\t\t\t\t\t\t\t: this.uploadTooltip\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\t\tslot='trigger'\n\t\t\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\t\t\ticonOnly={true}\n\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\tthis.mode === 'read'\n\t\t\t\t\t\t\t\t\t\t? 'download'\n\t\t\t\t\t\t\t\t\t\t: this.value?.length\n\t\t\t\t\t\t\t\t\t\t? 'trash'\n\t\t\t\t\t\t\t\t\t\t: 'upload'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={this.loading}\n\t\t\t\t\t\t\t\tloading={this.loading}\n\t\t\t\t\t\t\t\tonOnClick={() =>\n\t\t\t\t\t\t\t\t\tthis.mode === 'write' && !this.value?.length\n\t\t\t\t\t\t\t\t\t\t? this._uploadClick()\n\t\t\t\t\t\t\t\t\t\t: (this.mode === 'read'\n\t\t\t\t\t\t\t\t\t\t\t\t? this.download\n\t\t\t\t\t\t\t\t\t\t\t\t: this.delete\n\t\t\t\t\t\t\t\t\t\t ).emit()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</p-tooltip>\n\n\t\t\t\t\t\t{this.enableCameraOnMobile &&\n\t\t\t\t\t\t\tthis.mode === 'write' &&\n\t\t\t\t\t\t\tisMobileDevice &&\n\t\t\t\t\t\t\t!this.value?.length && (\n\t\t\t\t\t\t\t\t<p-tooltip\n\t\t\t\t\t\t\t\t\tcontent={this.cameraTooltip}\n\t\t\t\t\t\t\t\t\tclass='w-8 desktop-xs:hidden'\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\t\t\t\tslot='trigger'\n\t\t\t\t\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\t\t\t\t\ticonOnly={true}\n\t\t\t\t\t\t\t\t\t\ticon='camera'\n\t\t\t\t\t\t\t\t\t\tonOnClick={() => this._cameraClick()}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</p-tooltip>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</p-field-container>\n\n\t\t\t\t<input\n\t\t\t\t\tclass='hidden'\n\t\t\t\t\ttype='file'\n\t\t\t\t\taccept={\n\t\t\t\t\t\tArray.isArray(this.accept) ? this.accept?.join(',') : this.accept\n\t\t\t\t\t}\n\t\t\t\t\tref={el => (this._fileRef = el)}\n\t\t\t\t\tonChange={ev => this._onFileChange(ev)}\n\t\t\t\t/>\n\n\t\t\t\t<input\n\t\t\t\t\tclass='hidden'\n\t\t\t\t\ttype='file'\n\t\t\t\t\taccept='image/*'\n\t\t\t\t\tcapture='true'\n\t\t\t\t\tref={el => (this._cameraFileRef = el)}\n\t\t\t\t\tonChange={ev => this._onFileChange(ev)}\n\t\t\t\t/>\n\t\t\t</Fragment>\n\t\t);\n\t}\n\n\tprivate _uploadClick() {\n\t\tif (!this._fileRef || this.mode !== 'write' || this.value?.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._fileRef.click();\n\t}\n\n\tprivate _cameraClick() {\n\t\tif (!this.enableCameraOnMobile || isMobile()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._cameraFileRef || this.mode !== 'write') {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._cameraFileRef?.click();\n\t}\n\n\tprivate _onFileChange(ev: Event) {\n\t\tconst target = ev.target as HTMLInputElement;\n\t\tconst file = target.files?.[0];\n\n\t\tif (file) {\n\t\t\tthis.loading = true;\n\n\t\t\tconst reader = new FileReader();\n\t\t\treader.onload = (e: any) => this._onLoad(file, e?.currentTarget?.result);\n\t\t\treader.readAsDataURL(file);\n\t\t}\n\t}\n\n\tprivate _onLoad(file: File, result: string) {\n\t\tthis.upload.emit({\n\t\t\tfileId: this.fileId,\n\t\t\tresult,\n\t\t\tfile,\n\t\t});\n\n\t\tif (this._fileRef) {\n\t\t\tthis._fileRef.value = '';\n\t\t}\n\n\t\tif (this._cameraFileRef) {\n\t\t\tthis._cameraFileRef.value = '';\n\t\t}\n\n\t\tthis.loading = false;\n\t}\n}\n"],"version":3}
|
|
@@ -3,7 +3,7 @@ import { c as cva } from './p-CBWjHURv.js';
|
|
|
3
3
|
import { c as cn } from './p-CT54OXR2.js';
|
|
4
4
|
import { a as asBoolean } from './p-C5CTp9IA.js';
|
|
5
5
|
|
|
6
|
-
const cardContainerComponentCss = ".inline-block{display:inline-block!important}*{box-sizing:border-box}:host{display:inline-block;width:100%}.static{position:static!important}.flex{display:flex!important}.h-inherit{height:inherit!important}.w-inherit{width:inherit!important}.cursor-pointer{cursor:pointer!important}.flex-col{flex-direction:column!important}.rounded-2xl{border-radius:1rem!important}.border{border-width:1px!important}.border-0{border-width:0!important}.border-solid{border-style:solid!important}.border-
|
|
6
|
+
const cardContainerComponentCss = ".inline-block{display:inline-block!important}*{box-sizing:border-box}:host{display:inline-block;width:100%}.static{position:static!important}.flex{display:flex!important}.h-inherit{height:inherit!important}.w-inherit{width:inherit!important}.cursor-pointer{cursor:pointer!important}.flex-col{flex-direction:column!important}.rounded-2xl{border-radius:1rem!important}.border{border-width:1px!important}.border-0{border-width:0!important}.border-solid{border-style:solid!important}.border-off-white-700{--tw-border-opacity:1!important;border-color:rgb(222 219 213/var(--tw-border-opacity,1))!important}.bg-amber-100{background-color:rgb(255 246 194/var(--tw-bg-opacity,1))!important}.bg-amber-100,.bg-amber-50{--tw-bg-opacity:1!important}.bg-amber-50{background-color:rgb(255 250 224/var(--tw-bg-opacity,1))!important}.bg-amber-500{--tw-bg-opacity:1!important;background-color:rgb(225 159 35/var(--tw-bg-opacity,1))!important}.bg-amber-800{background-color:rgb(148 77 11/var(--tw-bg-opacity,1))!important}.bg-amber-800,.bg-black{--tw-bg-opacity:1!important}.bg-black{background-color:rgb(0 0 0/var(--tw-bg-opacity,1))!important}.bg-current{background-color:currentColor!important}.bg-indigo-100{--tw-bg-opacity:1!important;background-color:rgb(227 236 254/var(--tw-bg-opacity,1))!important}.bg-indigo-200{--tw-bg-opacity:1!important;background-color:rgb(199 217 253/var(--tw-bg-opacity,1))!important}.bg-indigo-300{--tw-bg-opacity:1!important;background-color:rgb(187 209 253/var(--tw-bg-opacity,1))!important}.bg-indigo-400{--tw-bg-opacity:1!important;background-color:rgb(165 194 252/var(--tw-bg-opacity,1))!important}.bg-indigo-50{--tw-bg-opacity:1!important;background-color:rgb(241 246 255/var(--tw-bg-opacity,1))!important}.bg-indigo-500{--tw-bg-opacity:1!important;background-color:rgb(142 179 251/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-indigo-700{--tw-bg-opacity:1!important;background-color:rgb(47 111 240/var(--tw-bg-opacity,1))!important}.bg-indigo-800{--tw-bg-opacity:1!important;background-color:rgb(27 88 210/var(--tw-bg-opacity,1))!important}.bg-indigo-900{--tw-bg-opacity:1!important;background-color:rgb(19 73 182/var(--tw-bg-opacity,1))!important}.bg-inherit{background-color:inherit!important}.bg-negative-red-100{--tw-bg-opacity:1!important;background-color:rgb(255 221 221/var(--tw-bg-opacity,1))!important}.bg-negative-red-50{--tw-bg-opacity:1!important;background-color:rgb(253 237 237/var(--tw-bg-opacity,1))!important}.bg-negative-red-500{--tw-bg-opacity:1!important;background-color:rgb(230 30 30/var(--tw-bg-opacity,1))!important}.bg-negative-red-800{--tw-bg-opacity:1!important;background-color:rgb(141 16 16/var(--tw-bg-opacity,1))!important}.bg-off-white-100{--tw-bg-opacity:1!important;background-color:rgb(253 252 251/var(--tw-bg-opacity,1))!important}.bg-off-white-200{--tw-bg-opacity:1!important;background-color:rgb(250 249 248/var(--tw-bg-opacity,1))!important}.bg-off-white-300{--tw-bg-opacity:1!important;background-color:rgb(248 247 244/var(--tw-bg-opacity,1))!important}.bg-off-white-400{--tw-bg-opacity:1!important;background-color:rgb(245 244 241/var(--tw-bg-opacity,1))!important}.bg-off-white-50{--tw-bg-opacity:1!important;background-color:rgb(254 254 253/var(--tw-bg-opacity,1))!important}.bg-off-white-500{--tw-bg-opacity:1!important;background-color:rgb(243 241 237/var(--tw-bg-opacity,1))!important}.bg-off-white-600{--tw-bg-opacity:1!important;background-color:rgb(236 234 229/var(--tw-bg-opacity,1))!important}.bg-off-white-700{--tw-bg-opacity:1!important;background-color:rgb(222 219 213/var(--tw-bg-opacity,1))!important}.bg-off-white-800{--tw-bg-opacity:1!important;background-color:rgb(213 208 195/var(--tw-bg-opacity,1))!important}.bg-positive-green-100{--tw-bg-opacity:1!important;background-color:rgb(213 251 199/var(--tw-bg-opacity,1))!important}.bg-positive-green-50{--tw-bg-opacity:1!important;background-color:rgb(234 253 227/var(--tw-bg-opacity,1))!important}.bg-positive-green-500{--tw-bg-opacity:1!important;background-color:rgb(92 195 14/var(--tw-bg-opacity,1))!important}.bg-positive-green-800{--tw-bg-opacity:1!important;background-color:rgb(47 100 7/var(--tw-bg-opacity,1))!important}.bg-storm-100{--tw-bg-opacity:1!important;background-color:rgb(209 210 212/var(--tw-bg-opacity,1))!important}.bg-storm-200{--tw-bg-opacity:1!important;background-color:rgb(163 165 169/var(--tw-bg-opacity,1))!important}.bg-storm-300{--tw-bg-opacity:1!important;background-color:rgb(116 120 127/var(--tw-bg-opacity,1))!important}.bg-storm-400{background-color:rgb(70 75 84/var(--tw-bg-opacity,1))!important}.bg-storm-400,.bg-storm-50{--tw-bg-opacity:1!important}.bg-storm-50{background-color:rgb(232 232 234/var(--tw-bg-opacity,1))!important}.bg-storm-500{--tw-bg-opacity:1!important;background-color:rgb(24 30 41/var(--tw-bg-opacity,1))!important}.bg-storm-600{--tw-bg-opacity:1!important;background-color:rgb(15 22 34/var(--tw-bg-opacity,1))!important}.bg-storm-700{--tw-bg-opacity:1!important;background-color:rgb(8 15 28/var(--tw-bg-opacity,1))!important}.bg-storm-800{--tw-bg-opacity:1!important;background-color:rgb(2 8 21/var(--tw-bg-opacity,1))!important}.bg-transparent{background-color:transparent!important}.bg-white,.bg-white-500{--tw-bg-opacity:1!important;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))!important}.bg-white-600{--tw-bg-opacity:1!important;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))!important}.bg-white-700{--tw-bg-opacity:1!important;background-color:rgb(242 242 242/var(--tw-bg-opacity,1))!important}.bg-white-800{--tw-bg-opacity:1!important;background-color:rgb(228 227 227/var(--tw-bg-opacity,1))!important}.shadow-1{--tw-shadow:0 1px 1px rgba(0,2,2,.08)!important;--tw-shadow-colored:0 1px 1px var(--tw-shadow-color)!important}.shadow-1,.shadow-2{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)!important}.shadow-2{--tw-shadow:0 1px 1px rgba(0,2,2,.04),0 2px 2px rgba(0,2,2,.04),0 4px 4px rgba(0,2,2,.04)!important;--tw-shadow-colored:0 1px 1px var(--tw-shadow-color),0 2px 2px var(--tw-shadow-color),0 4px 4px var(--tw-shadow-color)!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;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)!important}.ring-negative-red-50{--tw-ring-opacity:1!important;--tw-ring-color:rgb(253 237 237/var(--tw-ring-opacity,1))!important}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:85.375rem){.container{max-width:85.375rem}}@media (min-width:90rem){.container{max-width:90rem}}@media (min-width:96rem){.container{max-width:96rem}}@media (min-width:105rem){.container{max-width:105rem}}@media (min-width:120rem){.container{max-width:120rem}}@media (min-width:160rem){.container{max-width:160rem}}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.hover\\:bg-off-white-200:hover{--tw-bg-opacity:1!important;background-color:rgb(250 249 248/var(--tw-bg-opacity,1))!important}";
|
|
7
7
|
|
|
8
8
|
// bg-inherit bg-transparent bg-current bg-black
|
|
9
9
|
// bg-white-500 bg-white-600 bg-white-700 bg-white-800 bg-white
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-card-container.js","mappings":";;;;;AAAA,MAAM,yBAAyB,GAAG,
|
|
1
|
+
{"file":"p-card-container.js","mappings":";;;;;AAAA,MAAM,yBAAyB,GAAG,85OAA85O;;ACKh8O;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,SAAS,GAAG,GAAG,CAAC,CAAC,mCAAmC,EAAE,aAAa,CAAC,EAAE;AAC3E,IAAA,QAAQ,EAAE;AACT,QAAA,OAAO,EAAE;AACR,YAAA,OAAO,EAAE,sBAAsB;AAC/B,YAAA,KAAK,EAAE,iDAAiD;AACxD,SAAA;AACD,QAAA,SAAS,EAAE;AACV,YAAA,IAAI,EAAE,uCAAuC;AAC7C,YAAA,KAAK,EAAE,IAAI;AACX,SAAA;AACD,QAAA,MAAM,EAAE;AACP,YAAA,KAAK,EAAE,IAAI;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;AACpC,gBAAA,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;AAC9B,aAAA,CAAC,EACF,IAAI,CAAC,OAAO,CACZ,EAAA,EAED,CAAQ,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/atoms/card/container/card-container.component.css?tag=p-card-container&encapsulation=shadow","src/components/atoms/card/container/card-container.component.tsx"],"sourcesContent":[":host {\n\t@apply inline-block w-full;\n}\n","import { Component, h, Prop } from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../../../utils';\nimport { asBoolean } from '../../../../utils/as-boolean';\n\n// bg-inherit bg-transparent bg-current bg-black\n// bg-white-500 bg-white-600 bg-white-700 bg-white-800 bg-white\n// bg-negative-red-50 bg-negative-red-100 bg-negative-red-500 bg-negative-red-800 bg-negative-red\n// bg-positive-green-50 bg-positive-green-100 bg-positive-green-500 bg-positive-green-800 bg-positive-green\n// bg-amber-50 bg-amber-100 bg-amber-500 bg-amber-800 bg-amber\n// bg-off-white-50 bg-off-white-100 bg-off-white-200 bg-off-white-300 bg-off-white-400 bg-off-white-500 bg-off-white-600 bg-off-white-700 bg-off-white-800 bg-off-white\n// bg-indigo-50 bg-indigo-100 bg-indigo-200 bg-indigo-300 bg-indigo-400 bg-indigo-500 bg-indigo-600 bg-indigo-700 bg-indigo-800 bg-indigo-900 bg-indigo\n// bg-storm-50 bg-storm-100 bg-storm-200 bg-storm-300 bg-storm-400 bg-storm-500 bg-storm-600 bg-storm-700 bg-storm-800 bg-storm\n\nconst container = cva(['flex flex-col w-inherit h-inherit', 'rounded-2xl'], {\n\tvariants: {\n\t\tvariant: {\n\t\t\tdefault: 'border-off-white-700',\n\t\t\terror: 'border-negative-red ring-2 ring-negative-red-50',\n\t\t},\n\t\thoverable: {\n\t\t\ttrue: 'cursor-pointer hover:bg-off-white-200',\n\t\t\tfalse: null,\n\t\t},\n\t\tshadow: {\n\t\t\tfalse: null,\n\t\t\ttrue: null,\n\t\t},\n\t\tactive: {\n\t\t\tfalse: null,\n\t\t\ttrue: null,\n\t\t},\n\t\tborder: {\n\t\t\ttrue: 'border border-solid',\n\t\t\tfalse: 'border-0',\n\t\t},\n\t},\n\tcompoundVariants: [\n\t\t{\n\t\t\tshadow: true,\n\t\t\tactive: false,\n\t\t\tvariant: 'default',\n\t\t\tclass: 'shadow-1',\n\t\t},\n\t\t{\n\t\t\tshadow: true,\n\t\t\tactive: true,\n\t\t\tvariant: 'default',\n\t\t\tclass: 'shadow-2',\n\t\t},\n\t],\n});\n\n@Component({\n\ttag: 'p-card-container',\n\tstyleUrl: 'card-container.component.css',\n\tshadow: true,\n})\nexport class CardContainer {\n\t/**\n\t * The variant of the container\n\t */\n\t@Prop() variant: 'default' | 'error' = 'default';\n\n\t/**\n\t * A bg class to apply to the container\n\t */\n\t@Prop() bgClass: string = 'bg-white';\n\n\t/**\n\t * Wether the card should be hoverable\n\t */\n\t@Prop() active: boolean = false;\n\n\t/**\n\t * Wether the card should be hoverable\n\t */\n\t@Prop() hoverable: boolean = false;\n\n\t/**\n\t * Wether the card should have shadow\n\t */\n\t@Prop() shadow: boolean = true;\n\n\t/**\n\t * Wether the card should have a border\n\t */\n\t@Prop() border: boolean = true;\n\n\trender() {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclass={cn(\n\t\t\t\t\tcontainer({\n\t\t\t\t\t\tvariant: this.variant,\n\t\t\t\t\t\tactive: asBoolean(this.active, false),\n\t\t\t\t\t\thoverable: asBoolean(this.hoverable, false),\n\t\t\t\t\t\tshadow: asBoolean(this.shadow, true),\n\t\t\t\t\t\tborder: asBoolean(this.border),\n\t\t\t\t\t}),\n\t\t\t\t\tthis.bgClass\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<slot />\n\t\t\t</div>\n\t\t);\n\t}\n}\n"],"version":3}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, d as Host } from './p-tdjn65Lz.js';
|
|
2
2
|
import { c as cn } from './p-CT54OXR2.js';
|
|
3
3
|
|
|
4
|
-
const contentSliderComponentCss = ".absolute{position:absolute!important}.relative{position:relative!important}.mt-3{margin-top:.75rem!important}.flex{display:flex!important}.w-0{width:0!important}.w-full{width:100%!important}.flex-shrink-0{flex-shrink:0!important}.transform-gpu{transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.cursor-grab{cursor:grab!important}.cursor-grabbing{cursor:grabbing!important}.flex-col{flex-direction:column!important}.flex-nowrap{flex-wrap:nowrap!important}.items-center{align-items:center!important}.items-stretch{align-items:stretch!important}.justify-center{justify-content:center!important}.overflow-visible{overflow:visible!important}.p-16{padding:4rem!important}.pt-1{padding-top:.25rem!important}.will-change-transform{will-change:transform!important}*{box-sizing:border-box}:host{display:flex;flex-direction:column;margin:-4rem;overflow:hidden;padding:4rem}:host .slider{box-sizing:content-box;overflow:visible;position:relative}:host .slider.draggable{cursor:grab}@media (min-width:64rem){:host .slider.draggable{cursor:auto}}:host .slider.draggable.dragging{cursor:grabbing}@media (min-width:64rem){:host .slider.draggable.dragging{cursor:auto}}:host .slider.draggable.dragging .inner-slider{transition-property:none}:host .slider .inner-slider{--tw-translate-x:0px;align-items:stretch;display:flex;flex-wrap:nowrap;gap:.5rem;position:absolute;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transition-duration:.15s;transition-duration:.5s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);width:100%;will-change:transform}@media (min-width:64rem){:host .slider .inner-slider{flex-wrap:wrap;gap:1rem}}:host .slider .inner-slider>::slotted(*){flex-shrink:0;position:relative;width:100%;z-index:10}@media (min-width:40rem){:host .slider .inner-slider>::slotted(*){width:calc(50% - .5rem)}}@media (min-width:64rem){:host .slider .inner-slider>::slotted(*){flex:1 1 0%;width:0}}:host .indicator{align-items:center;display:flex;justify-content:center}@media (min-width:64rem){:host .indicator{display:none}}:host .indicator .item{margin-top:.75rem;padding-left:.25rem;padding-right:.25rem;padding-top:.25rem}@media (min-width:64rem){.desktop-xs\\:hidden{display:none!important}.desktop-xs\\:gap-4{gap:1rem!important}}.visible{visibility:visible!important}.static{position:static!important}.block{display:block!important}.hidden{display:none!important}.h-2{height:.5rem!important}.w-2{width:.5rem!important}.cursor-pointer{cursor:pointer!important}.resize{resize:both!important}.rounded-full{border-radius:9999px!important}.bg-
|
|
4
|
+
const contentSliderComponentCss = ".absolute{position:absolute!important}.relative{position:relative!important}.mt-3{margin-top:.75rem!important}.flex{display:flex!important}.w-0{width:0!important}.w-full{width:100%!important}.flex-shrink-0{flex-shrink:0!important}.transform-gpu{transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.cursor-grab{cursor:grab!important}.cursor-grabbing{cursor:grabbing!important}.flex-col{flex-direction:column!important}.flex-nowrap{flex-wrap:nowrap!important}.items-center{align-items:center!important}.items-stretch{align-items:stretch!important}.justify-center{justify-content:center!important}.overflow-visible{overflow:visible!important}.p-16{padding:4rem!important}.pt-1{padding-top:.25rem!important}.will-change-transform{will-change:transform!important}*{box-sizing:border-box}:host{display:flex;flex-direction:column;margin:-4rem;overflow:hidden;padding:4rem}:host .slider{box-sizing:content-box;overflow:visible;position:relative}:host .slider.draggable{cursor:grab}@media (min-width:64rem){:host .slider.draggable{cursor:auto}}:host .slider.draggable.dragging{cursor:grabbing}@media (min-width:64rem){:host .slider.draggable.dragging{cursor:auto}}:host .slider.draggable.dragging .inner-slider{transition-property:none}:host .slider .inner-slider{--tw-translate-x:0px;align-items:stretch;display:flex;flex-wrap:nowrap;gap:.5rem;position:absolute;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transition-duration:.15s;transition-duration:.5s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);width:100%;will-change:transform}@media (min-width:64rem){:host .slider .inner-slider{flex-wrap:wrap;gap:1rem}}:host .slider .inner-slider>::slotted(*){flex-shrink:0;position:relative;width:100%;z-index:10}@media (min-width:40rem){:host .slider .inner-slider>::slotted(*){width:calc(50% - .5rem)}}@media (min-width:64rem){:host .slider .inner-slider>::slotted(*){flex:1 1 0%;width:0}}:host .indicator{align-items:center;display:flex;justify-content:center}@media (min-width:64rem){:host .indicator{display:none}}:host .indicator .item{margin-top:.75rem;padding-left:.25rem;padding-right:.25rem;padding-top:.25rem}@media (min-width:64rem){.desktop-xs\\:hidden{display:none!important}.desktop-xs\\:gap-4{gap:1rem!important}}.visible{visibility:visible!important}.static{position:static!important}.block{display:block!important}.hidden{display:none!important}.h-2{height:.5rem!important}.w-2{width:.5rem!important}.cursor-pointer{cursor:pointer!important}.resize{resize:both!important}.rounded-full{border-radius:9999px!important}.bg-indigo-300{--tw-bg-opacity:1!important;background-color:rgb(187 209 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}.filter{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}";
|
|
5
5
|
|
|
6
6
|
const ContentSlider = /*@__PURE__*/ proxyCustomElement(class ContentSlider extends H {
|
|
7
7
|
constructor() {
|
|
@@ -55,8 +55,8 @@ const ContentSlider = /*@__PURE__*/ proxyCustomElement(class ContentSlider exten
|
|
|
55
55
|
return (h(Host, { key: '6eea2b73b46872eb45a2531728894d08b7eb3001', class: 'p-content-slider' }, h("div", { key: '2b1659afb662e00e07e5927ea06dc5e6bbb7aa2b', class: `slider ${!this.disableDrag && 'draggable'} ${this._dragging && 'dragging'}`, style: {
|
|
56
56
|
height: `${this._outerHeight}px`,
|
|
57
57
|
}, ref: el => (this._sliderRef = el), onMouseDown: e => this._mouseDownHandler(e), onTouchStart: e => this._mouseDownHandler(e), onMouseMove: e => this._mouseMoveHandler(e), onTouchMove: e => this._mouseMoveHandler(e) }, h("div", { key: 'dd8752cc0d7382f579bea7e53a75034be2847b9e', class: 'inner-slider', ref: ref => this._setInnerSliderReft(ref), onTransitionEnd: () => this._transitionEndHandler() }, h("slot", { key: '8fd288d09975c86b4b2f6afe75d7dfeb158d35a8', onSlotchange: () => this._slotChange() }))), h("div", { key: 'f95e232a1c0b6713559343fe5710a641bcb32f4c', class: `indicator ${this.hideMobileIndicator && 'hidden'}` }, this._filteredItems.map((_, i) => (h("div", { onClick: () => this._scrollTo(i, true), class: `item ${!this.disableIndicatorClick && 'cursor-pointer'}` }, h("div", { class: cn('block h-2 w-2 rounded-full', {
|
|
58
|
-
'bg-
|
|
59
|
-
'bg-
|
|
58
|
+
'bg-indigo-600': i === this._visibleIndex,
|
|
59
|
+
'bg-indigo-300': i !== this._visibleIndex,
|
|
60
60
|
}) })))))));
|
|
61
61
|
}
|
|
62
62
|
_mouseDownHandler(e) {
|
|
@@ -1 +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EAAE;QACzC,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,qBAAqB,EAAE;QAE1D,OAAO,UAAU,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/molecules/content-slider/content-slider.component.scss?tag=p-content-slider&encapsulation=shadow","src/components/molecules/content-slider/content-slider.component.tsx"],"sourcesContent":[":host {\n\t@apply flex flex-col overflow-hidden;\n\n\t@apply p-16 -m-16;\n\n\t.slider {\n\t\t@apply overflow-visible relative box-content;\n\n\t\t&.draggable {\n\t\t\t@apply cursor-grab desktop-xs:cursor-auto;\n\n\t\t\t&.dragging {\n\t\t\t\t@apply cursor-grabbing desktop-xs:cursor-auto;\n\n\t\t\t\t.inner-slider {\n\t\t\t\t\t@apply transition-none;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t.inner-slider {\n\t\t\t@apply absolute flex flex-nowrap items-stretch w-full gap-2;\n\n\t\t\t@apply will-change-transform transform-gpu translate-x-0;\n\n\t\t\t@apply desktop-xs:gap-4 desktop-xs:flex-wrap;\n\n\t\t\t@apply transition-all;\n\t\t\ttransition-duration: 0.5s;\n\n\t\t\t> ::slotted(*) {\n\t\t\t\t@apply w-full;\n\t\t\t\t@apply flex-shrink-0 z-10;\n\n\t\t\t\t@screen tablet {\n\t\t\t\t\twidth: calc(50% - 0.5rem);\n\t\t\t\t}\n\n\t\t\t\t@screen desktop-xs {\n\t\t\t\t\t@apply w-0 flex-1;\n\t\t\t\t}\n\n\t\t\t\tposition: relative;\n\t\t\t}\n\t\t}\n\t}\n\n\t.indicator {\n\t\t@apply flex justify-center items-center desktop-xs:hidden;\n\n\t\t.item {\n\t\t\t@apply mt-3 pt-1 px-1;\n\t\t}\n\t}\n}\n","import {\n\tComponent,\n\tElement,\n\th,\n\tHost,\n\tListen,\n\tProp,\n\tState,\n} from '@stencil/core';\nimport { cn } from '../../../utils';\n\n@Component({\n\ttag: 'p-content-slider',\n\tstyleUrl: 'content-slider.component.scss',\n\tshadow: true,\n})\nexport class ContentSlider {\n\t/**\n\t * Wether to hide the indicator on mobile\n\t */\n\t@Prop() hideMobileIndicator: boolean = false;\n\n\t/**\n\t * Wether to disable dragging the content\n\t */\n\t@Prop() disableDrag: boolean = false;\n\n\t/**\n\t * Wether to disable auto centering the content\n\t */\n\t@Prop() disableAutoCenter: boolean = false;\n\n\t/**\n\t * Wether to disable clicking the indicator scrolls content\n\t */\n\t@Prop() disableIndicatorClick: boolean = false;\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _visibleIndex: number;\n\t@State() private _outerHeight = 0;\n\t@State() private _totalWidth = 0;\n\tprivate _sliderRef: HTMLElement;\n\tprivate _innerSliderRef: HTMLElement;\n\tprivate _items: HTMLElement[] = [];\n\tprivate _innerSliderResizeObserver: ResizeObserver;\n\n\t// mouse movement stuff\n\tprivate _startX: number;\n\tprivate _startMouseX: number;\n\tprivate _lastMouseX: number;\n\tprivate _lastIndex: number;\n\tprivate _shouldCheckLocation = false;\n\t@State() private _dragging = false;\n\n\tget _filteredItems() {\n\t\treturn this._items.filter(item => item.checkVisibility());\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis._innerSliderRef.style.setProperty('--tw-translate-x', `0px`);\n\t}\n\n\tdisconnectedCallback() {\n\t\tif (this._innerSliderResizeObserver) {\n\t\t\tthis._innerSliderResizeObserver.disconnect();\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class='p-content-slider'>\n\t\t\t\t<div\n\t\t\t\t\tclass={`slider ${!this.disableDrag && 'draggable'} ${\n\t\t\t\t\t\tthis._dragging && 'dragging'\n\t\t\t\t\t}`}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\theight: `${this._outerHeight}px`,\n\t\t\t\t\t}}\n\t\t\t\t\tref={el => (this._sliderRef = el)}\n\t\t\t\t\tonMouseDown={e => this._mouseDownHandler(e)}\n\t\t\t\t\tonTouchStart={e => this._mouseDownHandler(e)}\n\t\t\t\t\tonMouseMove={e => this._mouseMoveHandler(e)}\n\t\t\t\t\tonTouchMove={e => this._mouseMoveHandler(e)}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass='inner-slider'\n\t\t\t\t\t\tref={ref => this._setInnerSliderReft(ref)}\n\t\t\t\t\t\tonTransitionEnd={() => this._transitionEndHandler()}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot onSlotchange={() => this._slotChange()} />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class={`indicator ${this.hideMobileIndicator && 'hidden'}`}>\n\t\t\t\t\t{this._filteredItems.map((_, i) => (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tonClick={() => this._scrollTo(i, true)}\n\t\t\t\t\t\t\tclass={`item ${!this.disableIndicatorClick && 'cursor-pointer'}`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclass={cn('block h-2 w-2 rounded-full', {\n\t\t\t\t\t\t\t\t\t'bg-dark-teal-600': i === this._visibleIndex,\n\t\t\t\t\t\t\t\t\t'bg-dark-teal-400': i !== this._visibleIndex,\n\t\t\t\t\t\t\t\t})}\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\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _mouseDownHandler(e) {\n\t\tif (this.disableDrag || this._dragging) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst innerSliderStyle = getComputedStyle(this._innerSliderRef);\n\t\tif (innerSliderStyle.flexWrap === 'wrap') {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._startMouseX = e.x;\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\t\tif (e.type === 'touchstart') {\n\t\t\tthis._startMouseX = e.touches?.[0].clientX;\n\t\t}\n\n\t\tconst innerSliderRect = this._innerSliderRef.getBoundingClientRect();\n\t\tconst offsetLeft = innerSliderRect.x - sliderRect.x;\n\n\t\tthis._startX = this._startMouseX - sliderRect.x - offsetLeft;\n\t\tthis._lastIndex = this._visibleIndex;\n\t\tthis._dragging = true;\n\t}\n\n\tprivate _mouseMoveHandler(e) {\n\t\tif (!e || !this._dragging || this.disableDrag) {\n\t\t\treturn;\n\t\t}\n\n\t\te.preventDefault();\n\n\t\tthis._shouldCheckLocation = true;\n\n\t\tif (this._innerSliderRef.style.getPropertyValue('pointer-events') === '') {\n\t\t\tthis._innerSliderRef.style.pointerEvents = 'none';\n\t\t}\n\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\t\tlet x = e.clientX - sliderRect.left;\n\t\tthis._lastMouseX = e.x;\n\t\tif (e.type === 'touchmove') {\n\t\t\tx = e.touches?.[0].clientX - sliderRect.left;\n\t\t\tthis._lastMouseX = e.touches?.[0].clientX;\n\t\t}\n\n\t\tthis._innerSliderRef.style.setProperty(\n\t\t\t'--tw-translate-x',\n\t\t\t`${x - this._startX}px`\n\t\t);\n\n\t\tthis._checkBoundary();\n\t\tthis._calculateIndicator();\n\t}\n\n\tprivate _transitionEndHandler() {\n\t\tthis._calculateIndicator();\n\t}\n\n\tprivate _slotChange() {\n\t\tconst items = this._el.querySelectorAll(':scope > *');\n\t\tthis._items = Array.from(items) as HTMLElement[];\n\n\t\tsetTimeout(() => {\n\t\t\tthis._innerSliderRef.style.setProperty('--tw-translate-x', '0px');\n\t\t\tthis._calculateWidth();\n\t\t\tthis._calculateIndicator();\n\t\t}, 100);\n\t}\n\n\t@Listen('mouseup', { target: 'window' })\n\t@Listen('touchend', { target: 'window' })\n\tmouseUpHandler() {\n\t\tthis._dragging = false;\n\t\tthis._innerSliderRef.style.removeProperty('pointer-events');\n\n\t\tthis._checkLocation();\n\t}\n\n\t@Listen('resize', { target: 'window' })\n\tresizeHandler() {\n\t\tif (this._innerSliderRef) {\n\t\t\tthis._innerSliderRef.style.setProperty('--tw-translate-x', '0px');\n\t\t\tthis._calculateWidth();\n\t\t\tthis._calculateIndicator();\n\t\t}\n\t}\n\n\tprivate _setInnerSliderReft(ref) {\n\t\tthis._innerSliderRef = ref;\n\t\tthis._innerSliderResizeObserver = new ResizeObserver(() =>\n\t\t\tthis._calculateHeight()\n\t\t);\n\t\tthis._innerSliderResizeObserver.observe(this._innerSliderRef);\n\t}\n\n\tprivate _scrollTo(i: number, manual = false) {\n\t\tif (this.disableIndicatorClick && manual) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst el = this._items[i];\n\n\t\tif (i === 0) {\n\t\t\tthis._innerSliderRef.style.setProperty('--tw-translate-x', `0px`);\n\t\t\treturn;\n\t\t}\n\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\t\tconst innerSliderRect = this._innerSliderRef.getBoundingClientRect();\n\t\tconst elRect = el.getBoundingClientRect();\n\n\t\tconst offsetLeft = elRect.x - innerSliderRect.x;\n\n\t\tconst centerOffset = offsetLeft + elRect.width / 2 - sliderRect.width / 2;\n\n\t\tthis._innerSliderRef.style.setProperty(\n\t\t\t'--tw-translate-x',\n\t\t\t`-${centerOffset}px`\n\t\t);\n\n\t\tthis._checkBoundary();\n\t\tthis._calculateIndicator();\n\t}\n\n\tprivate _checkBoundary() {\n\t\tlet outer = this._sliderRef.getBoundingClientRect();\n\n\t\tconst left = parseInt(\n\t\t\tthis._innerSliderRef.style.getPropertyValue('--tw-translate-x')\n\t\t);\n\t\tif (left > 0) {\n\t\t\tthis._innerSliderRef.style.setProperty('--tw-translate-x', `0px`);\n\t\t}\n\n\t\tconst maxLeft = (this._totalWidth - outer.width) * -1;\n\t\tif (left < maxLeft) {\n\t\t\tthis._innerSliderRef.style.setProperty(\n\t\t\t\t'--tw-translate-x',\n\t\t\t\t`${maxLeft}px`\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate _calculateIndicator() {\n\t\tfor (let i = 0; i < this._filteredItems.length; i++) {\n\t\t\tconst item = this._filteredItems[i];\n\t\t\tconst visible = this._isVisible(item);\n\n\t\t\tif (visible) {\n\t\t\t\tthis._visibleIndex = i;\n\t\t\t}\n\n\t\t\tif (i === 0 && visible) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _checkLocation() {\n\t\tif (!this._shouldCheckLocation) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet scrollToIndex = null;\n\t\tif (this._lastIndex !== this._visibleIndex) {\n\t\t\tscrollToIndex = this._visibleIndex;\n\t\t}\n\n\t\tif (this._lastIndex === this._visibleIndex) {\n\t\t\tif (this._lastMouseX > this._startMouseX && this._lastIndex !== 0) {\n\t\t\t\tscrollToIndex = this._lastIndex - 1;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tthis._lastMouseX < this._startMouseX &&\n\t\t\t\tthis._lastIndex !== this._items?.length - 1\n\t\t\t) {\n\t\t\t\tscrollToIndex = this._lastIndex + 1;\n\t\t\t}\n\t\t}\n\n\t\tif (scrollToIndex !== null) {\n\t\t\tthis._shouldCheckLocation = false;\n\t\t\tsetTimeout(() => this._scrollTo(scrollToIndex), 100);\n\t\t}\n\t}\n\n\tprivate _isVisible(el: HTMLElement) {\n\t\tif (!this._el || !el) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst elRect = el.getBoundingClientRect();\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\n\t\treturn (\n\t\t\t(elRect.left >= sliderRect.left && elRect.right <= sliderRect.right) ||\n\t\t\t(this._isMobile(el) &&\n\t\t\t\telRect.left + elRect.width / 2 >= sliderRect.left &&\n\t\t\t\telRect.left + elRect.width / 2 <= sliderRect.right)\n\t\t);\n\t}\n\n\tprivate _calculateWidth() {\n\t\tlet totalWidth = 0;\n\n\t\tfor (let item of this._filteredItems) {\n\t\t\tconst rect = item.getBoundingClientRect();\n\t\t\ttotalWidth += rect.width;\n\t\t}\n\n\t\tconst sliderStyle = getComputedStyle(this._sliderRef);\n\t\tconst padding = parseInt(sliderStyle.padding) * 2;\n\n\t\tconst innerSliderStyle = getComputedStyle(this._innerSliderRef);\n\t\tconst gap =\n\t\t\tparseInt(innerSliderStyle.gap) * (this._filteredItems.length - 1);\n\n\t\ttotalWidth += padding + gap;\n\n\t\tthis._totalWidth = totalWidth;\n\t}\n\n\tprivate _calculateHeight() {\n\t\tconst items = this._filteredItems;\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst outerHeight = this._filteredItems\n\t\t\t.at(0)\n\t\t\t.getBoundingClientRect().height;\n\t\tif (outerHeight != this._outerHeight) {\n\t\t\tthis._outerHeight = outerHeight;\n\t\t}\n\t}\n\n\tprivate _isMobile(el?: HTMLElement) {\n\t\tif (!el) {\n\t\t\tel = this._filteredItems.at(0);\n\t\t}\n\n\t\tconst elRect = el.getBoundingClientRect();\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\n\t\treturn sliderRect.width - elRect.width < 10;\n\t}\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-content-slider.js","mappings":";;;AAAA,MAAM,yBAAyB,GAAG,i4GAAi4G;;MCgBt5G,aAAa,iBAAAA,kBAAA,CAAA,MAAA,aAAA,SAAAC,CAAA,CAAA;;;;;;AACzB;;AAEG;IACK,mBAAmB,GAAY,KAAK;AAE5C;;AAEG;IACK,WAAW,GAAY,KAAK;AAEpC;;AAEG;IACK,iBAAiB,GAAY,KAAK;AAE1C;;AAEG;IACK,qBAAqB,GAAY,KAAK;;AAO7B,IAAA,aAAa;IACb,YAAY,GAAG,CAAC;IAChB,WAAW,GAAG,CAAC;AACxB,IAAA,UAAU;AACV,IAAA,eAAe;IACf,MAAM,GAAkB,EAAE;AAC1B,IAAA,0BAA0B;;AAG1B,IAAA,OAAO;AACP,IAAA,YAAY;AACZ,IAAA,WAAW;AACX,IAAA,UAAU;IACV,oBAAoB,GAAG,KAAK;IACnB,SAAS,GAAG,KAAK;AAElC,IAAA,IAAI,cAAc,GAAA;AACjB,QAAA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AAC;AAElE,QAAA,UAAU,IAAI,OAAO,GAAG,GAAG;AAE3B,QAAA,IAAI,CAAC,WAAW,GAAG,UAAU;;IAGtB,gBAAgB,GAAA;AACvB,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,cAAc;AACjC,QAAA,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;YAClB;;AAGD,QAAA,MAAM,WAAW,GAAG,IAAI,CAAC;aACvB,EAAE,CAAC,CAAC;aACJ,qBAAqB,EAAE,CAAC,MAAM;AAChC,QAAA,IAAI,WAAW,IAAI,IAAI,CAAC,YAAY,EAAE;AACrC,YAAA,IAAI,CAAC,YAAY,GAAG,WAAW;;;AAIzB,IAAA,SAAS,CAAC,EAAgB,EAAA;QACjC,IAAI,CAAC,EAAE,EAAE;YACR,EAAE,GAAG,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC;;AAG/B,QAAA,MAAM,MAAM,GAAG,EAAE,CAAC,qBAAqB,EAAE;QACzC,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,qBAAqB,EAAE;QAE1D,OAAO,UAAU,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/molecules/content-slider/content-slider.component.scss?tag=p-content-slider&encapsulation=shadow","src/components/molecules/content-slider/content-slider.component.tsx"],"sourcesContent":[":host {\n\t@apply flex flex-col overflow-hidden;\n\n\t@apply p-16 -m-16;\n\n\t.slider {\n\t\t@apply overflow-visible relative box-content;\n\n\t\t&.draggable {\n\t\t\t@apply cursor-grab desktop-xs:cursor-auto;\n\n\t\t\t&.dragging {\n\t\t\t\t@apply cursor-grabbing desktop-xs:cursor-auto;\n\n\t\t\t\t.inner-slider {\n\t\t\t\t\t@apply transition-none;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t.inner-slider {\n\t\t\t@apply absolute flex flex-nowrap items-stretch w-full gap-2;\n\n\t\t\t@apply will-change-transform transform-gpu translate-x-0;\n\n\t\t\t@apply desktop-xs:gap-4 desktop-xs:flex-wrap;\n\n\t\t\t@apply transition-all;\n\t\t\ttransition-duration: 0.5s;\n\n\t\t\t> ::slotted(*) {\n\t\t\t\t@apply w-full;\n\t\t\t\t@apply flex-shrink-0 z-10;\n\n\t\t\t\t@screen tablet {\n\t\t\t\t\twidth: calc(50% - 0.5rem);\n\t\t\t\t}\n\n\t\t\t\t@screen desktop-xs {\n\t\t\t\t\t@apply w-0 flex-1;\n\t\t\t\t}\n\n\t\t\t\tposition: relative;\n\t\t\t}\n\t\t}\n\t}\n\n\t.indicator {\n\t\t@apply flex justify-center items-center desktop-xs:hidden;\n\n\t\t.item {\n\t\t\t@apply mt-3 pt-1 px-1;\n\t\t}\n\t}\n}\n","import {\n\tComponent,\n\tElement,\n\th,\n\tHost,\n\tListen,\n\tProp,\n\tState,\n} from '@stencil/core';\nimport { cn } from '../../../utils';\n\n@Component({\n\ttag: 'p-content-slider',\n\tstyleUrl: 'content-slider.component.scss',\n\tshadow: true,\n})\nexport class ContentSlider {\n\t/**\n\t * Wether to hide the indicator on mobile\n\t */\n\t@Prop() hideMobileIndicator: boolean = false;\n\n\t/**\n\t * Wether to disable dragging the content\n\t */\n\t@Prop() disableDrag: boolean = false;\n\n\t/**\n\t * Wether to disable auto centering the content\n\t */\n\t@Prop() disableAutoCenter: boolean = false;\n\n\t/**\n\t * Wether to disable clicking the indicator scrolls content\n\t */\n\t@Prop() disableIndicatorClick: boolean = false;\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _visibleIndex: number;\n\t@State() private _outerHeight = 0;\n\t@State() private _totalWidth = 0;\n\tprivate _sliderRef: HTMLElement;\n\tprivate _innerSliderRef: HTMLElement;\n\tprivate _items: HTMLElement[] = [];\n\tprivate _innerSliderResizeObserver: ResizeObserver;\n\n\t// mouse movement stuff\n\tprivate _startX: number;\n\tprivate _startMouseX: number;\n\tprivate _lastMouseX: number;\n\tprivate _lastIndex: number;\n\tprivate _shouldCheckLocation = false;\n\t@State() private _dragging = false;\n\n\tget _filteredItems() {\n\t\treturn this._items.filter(item => item.checkVisibility());\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis._innerSliderRef.style.setProperty('--tw-translate-x', `0px`);\n\t}\n\n\tdisconnectedCallback() {\n\t\tif (this._innerSliderResizeObserver) {\n\t\t\tthis._innerSliderResizeObserver.disconnect();\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class='p-content-slider'>\n\t\t\t\t<div\n\t\t\t\t\tclass={`slider ${!this.disableDrag && 'draggable'} ${\n\t\t\t\t\t\tthis._dragging && 'dragging'\n\t\t\t\t\t}`}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\theight: `${this._outerHeight}px`,\n\t\t\t\t\t}}\n\t\t\t\t\tref={el => (this._sliderRef = el)}\n\t\t\t\t\tonMouseDown={e => this._mouseDownHandler(e)}\n\t\t\t\t\tonTouchStart={e => this._mouseDownHandler(e)}\n\t\t\t\t\tonMouseMove={e => this._mouseMoveHandler(e)}\n\t\t\t\t\tonTouchMove={e => this._mouseMoveHandler(e)}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass='inner-slider'\n\t\t\t\t\t\tref={ref => this._setInnerSliderReft(ref)}\n\t\t\t\t\t\tonTransitionEnd={() => this._transitionEndHandler()}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot onSlotchange={() => this._slotChange()} />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class={`indicator ${this.hideMobileIndicator && 'hidden'}`}>\n\t\t\t\t\t{this._filteredItems.map((_, i) => (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tonClick={() => this._scrollTo(i, true)}\n\t\t\t\t\t\t\tclass={`item ${!this.disableIndicatorClick && 'cursor-pointer'}`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclass={cn('block h-2 w-2 rounded-full', {\n\t\t\t\t\t\t\t\t\t'bg-indigo-600': i === this._visibleIndex,\n\t\t\t\t\t\t\t\t\t'bg-indigo-300': i !== this._visibleIndex,\n\t\t\t\t\t\t\t\t})}\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\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _mouseDownHandler(e) {\n\t\tif (this.disableDrag || this._dragging) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst innerSliderStyle = getComputedStyle(this._innerSliderRef);\n\t\tif (innerSliderStyle.flexWrap === 'wrap') {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._startMouseX = e.x;\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\t\tif (e.type === 'touchstart') {\n\t\t\tthis._startMouseX = e.touches?.[0].clientX;\n\t\t}\n\n\t\tconst innerSliderRect = this._innerSliderRef.getBoundingClientRect();\n\t\tconst offsetLeft = innerSliderRect.x - sliderRect.x;\n\n\t\tthis._startX = this._startMouseX - sliderRect.x - offsetLeft;\n\t\tthis._lastIndex = this._visibleIndex;\n\t\tthis._dragging = true;\n\t}\n\n\tprivate _mouseMoveHandler(e) {\n\t\tif (!e || !this._dragging || this.disableDrag) {\n\t\t\treturn;\n\t\t}\n\n\t\te.preventDefault();\n\n\t\tthis._shouldCheckLocation = true;\n\n\t\tif (this._innerSliderRef.style.getPropertyValue('pointer-events') === '') {\n\t\t\tthis._innerSliderRef.style.pointerEvents = 'none';\n\t\t}\n\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\t\tlet x = e.clientX - sliderRect.left;\n\t\tthis._lastMouseX = e.x;\n\t\tif (e.type === 'touchmove') {\n\t\t\tx = e.touches?.[0].clientX - sliderRect.left;\n\t\t\tthis._lastMouseX = e.touches?.[0].clientX;\n\t\t}\n\n\t\tthis._innerSliderRef.style.setProperty(\n\t\t\t'--tw-translate-x',\n\t\t\t`${x - this._startX}px`\n\t\t);\n\n\t\tthis._checkBoundary();\n\t\tthis._calculateIndicator();\n\t}\n\n\tprivate _transitionEndHandler() {\n\t\tthis._calculateIndicator();\n\t}\n\n\tprivate _slotChange() {\n\t\tconst items = this._el.querySelectorAll(':scope > *');\n\t\tthis._items = Array.from(items) as HTMLElement[];\n\n\t\tsetTimeout(() => {\n\t\t\tthis._innerSliderRef.style.setProperty('--tw-translate-x', '0px');\n\t\t\tthis._calculateWidth();\n\t\t\tthis._calculateIndicator();\n\t\t}, 100);\n\t}\n\n\t@Listen('mouseup', { target: 'window' })\n\t@Listen('touchend', { target: 'window' })\n\tmouseUpHandler() {\n\t\tthis._dragging = false;\n\t\tthis._innerSliderRef.style.removeProperty('pointer-events');\n\n\t\tthis._checkLocation();\n\t}\n\n\t@Listen('resize', { target: 'window' })\n\tresizeHandler() {\n\t\tif (this._innerSliderRef) {\n\t\t\tthis._innerSliderRef.style.setProperty('--tw-translate-x', '0px');\n\t\t\tthis._calculateWidth();\n\t\t\tthis._calculateIndicator();\n\t\t}\n\t}\n\n\tprivate _setInnerSliderReft(ref) {\n\t\tthis._innerSliderRef = ref;\n\t\tthis._innerSliderResizeObserver = new ResizeObserver(() =>\n\t\t\tthis._calculateHeight()\n\t\t);\n\t\tthis._innerSliderResizeObserver.observe(this._innerSliderRef);\n\t}\n\n\tprivate _scrollTo(i: number, manual = false) {\n\t\tif (this.disableIndicatorClick && manual) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst el = this._items[i];\n\n\t\tif (i === 0) {\n\t\t\tthis._innerSliderRef.style.setProperty('--tw-translate-x', `0px`);\n\t\t\treturn;\n\t\t}\n\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\t\tconst innerSliderRect = this._innerSliderRef.getBoundingClientRect();\n\t\tconst elRect = el.getBoundingClientRect();\n\n\t\tconst offsetLeft = elRect.x - innerSliderRect.x;\n\n\t\tconst centerOffset = offsetLeft + elRect.width / 2 - sliderRect.width / 2;\n\n\t\tthis._innerSliderRef.style.setProperty(\n\t\t\t'--tw-translate-x',\n\t\t\t`-${centerOffset}px`\n\t\t);\n\n\t\tthis._checkBoundary();\n\t\tthis._calculateIndicator();\n\t}\n\n\tprivate _checkBoundary() {\n\t\tlet outer = this._sliderRef.getBoundingClientRect();\n\n\t\tconst left = parseInt(\n\t\t\tthis._innerSliderRef.style.getPropertyValue('--tw-translate-x')\n\t\t);\n\t\tif (left > 0) {\n\t\t\tthis._innerSliderRef.style.setProperty('--tw-translate-x', `0px`);\n\t\t}\n\n\t\tconst maxLeft = (this._totalWidth - outer.width) * -1;\n\t\tif (left < maxLeft) {\n\t\t\tthis._innerSliderRef.style.setProperty(\n\t\t\t\t'--tw-translate-x',\n\t\t\t\t`${maxLeft}px`\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate _calculateIndicator() {\n\t\tfor (let i = 0; i < this._filteredItems.length; i++) {\n\t\t\tconst item = this._filteredItems[i];\n\t\t\tconst visible = this._isVisible(item);\n\n\t\t\tif (visible) {\n\t\t\t\tthis._visibleIndex = i;\n\t\t\t}\n\n\t\t\tif (i === 0 && visible) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _checkLocation() {\n\t\tif (!this._shouldCheckLocation) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet scrollToIndex = null;\n\t\tif (this._lastIndex !== this._visibleIndex) {\n\t\t\tscrollToIndex = this._visibleIndex;\n\t\t}\n\n\t\tif (this._lastIndex === this._visibleIndex) {\n\t\t\tif (this._lastMouseX > this._startMouseX && this._lastIndex !== 0) {\n\t\t\t\tscrollToIndex = this._lastIndex - 1;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tthis._lastMouseX < this._startMouseX &&\n\t\t\t\tthis._lastIndex !== this._items?.length - 1\n\t\t\t) {\n\t\t\t\tscrollToIndex = this._lastIndex + 1;\n\t\t\t}\n\t\t}\n\n\t\tif (scrollToIndex !== null) {\n\t\t\tthis._shouldCheckLocation = false;\n\t\t\tsetTimeout(() => this._scrollTo(scrollToIndex), 100);\n\t\t}\n\t}\n\n\tprivate _isVisible(el: HTMLElement) {\n\t\tif (!this._el || !el) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst elRect = el.getBoundingClientRect();\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\n\t\treturn (\n\t\t\t(elRect.left >= sliderRect.left && elRect.right <= sliderRect.right) ||\n\t\t\t(this._isMobile(el) &&\n\t\t\t\telRect.left + elRect.width / 2 >= sliderRect.left &&\n\t\t\t\telRect.left + elRect.width / 2 <= sliderRect.right)\n\t\t);\n\t}\n\n\tprivate _calculateWidth() {\n\t\tlet totalWidth = 0;\n\n\t\tfor (let item of this._filteredItems) {\n\t\t\tconst rect = item.getBoundingClientRect();\n\t\t\ttotalWidth += rect.width;\n\t\t}\n\n\t\tconst sliderStyle = getComputedStyle(this._sliderRef);\n\t\tconst padding = parseInt(sliderStyle.padding) * 2;\n\n\t\tconst innerSliderStyle = getComputedStyle(this._innerSliderRef);\n\t\tconst gap =\n\t\t\tparseInt(innerSliderStyle.gap) * (this._filteredItems.length - 1);\n\n\t\ttotalWidth += padding + gap;\n\n\t\tthis._totalWidth = totalWidth;\n\t}\n\n\tprivate _calculateHeight() {\n\t\tconst items = this._filteredItems;\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst outerHeight = this._filteredItems\n\t\t\t.at(0)\n\t\t\t.getBoundingClientRect().height;\n\t\tif (outerHeight != this._outerHeight) {\n\t\t\tthis._outerHeight = outerHeight;\n\t\t}\n\t}\n\n\tprivate _isMobile(el?: HTMLElement) {\n\t\tif (!el) {\n\t\t\tel = this._filteredItems.at(0);\n\t\t}\n\n\t\tconst elRect = el.getBoundingClientRect();\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\n\t\treturn sliderRect.width - elRect.width < 10;\n\t}\n}\n"],"version":3}
|