@rededor/cura 1.4.0-alpha.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/cura-accordion_12.cjs.entry.js +12 -16
- package/dist/cjs/cura-accordion_12.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-alert.cjs.entry.js +1 -1
- package/dist/cjs/cura-avatar.cjs.entry.js +1 -1
- package/dist/cjs/cura-badge-counter.cjs.entry.js +63 -0
- package/dist/cjs/cura-badge-counter.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-badge-distance.cjs.entry.js +1 -1
- package/dist/cjs/cura-badge-pill.cjs.entry.js +83 -0
- package/dist/cjs/cura-badge-pill.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-button-outline.cjs.entry.js +1 -1
- package/dist/cjs/cura-button-select.cjs.entry.js +2 -11
- package/dist/cjs/cura-button-select.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-button-transparent.cjs.entry.js +1 -1
- package/dist/cjs/cura-calendar.cjs.entry.js +1 -1
- package/dist/cjs/cura-card.cjs.entry.js +1 -1
- package/dist/cjs/cura-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/cura-display.cjs.entry.js +1 -1
- package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js +1 -1
- package/dist/cjs/cura-dropdown-search-option.cjs.entry.js +2 -2
- package/dist/cjs/cura-dropdown-search.cjs.entry.js +24 -15
- package/dist/cjs/cura-dropdown-search.cjs.entry.js.map +1 -1
- package/dist/cjs/{cura-icon.definitions-8d714f6a.js → cura-icon.definitions-5223028b.js} +2 -4
- package/dist/cjs/cura-icon.definitions-5223028b.js.map +1 -0
- package/dist/cjs/cura-icons-view.cjs.entry.js +2 -5
- package/dist/cjs/cura-icons-view.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-input-date.cjs.entry.js +1 -1
- package/dist/cjs/cura-loader-bar.cjs.entry.js +1 -1
- package/dist/cjs/cura-modal.cjs.entry.js +28 -7
- package/dist/cjs/cura-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-radio.cjs.entry.js +1 -1
- package/dist/cjs/cura-switch.cjs.entry.js +1 -1
- package/dist/cjs/cura-toast.cjs.entry.js +1 -1
- package/dist/cjs/cura-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/cura.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/badges/cura-badge-counter/cura-badge-counter.css +51 -0
- package/dist/collection/components/badges/cura-badge-counter/cura-badge-counter.js +149 -0
- package/dist/collection/components/badges/cura-badge-counter/cura-badge-counter.js.map +1 -0
- package/dist/collection/components/badges/{cura-badge-number/cura-badge-number.stories.js → cura-badge-counter/cura-badge-counter.stories.js} +33 -13
- package/dist/collection/components/badges/cura-badge-counter/cura-badge-counter.stories.js.map +1 -0
- package/dist/collection/components/badges/cura-badge-distance/cura-badge-distance.js +1 -1
- package/dist/collection/components/badges/cura-badge-pill/cura-badge-pill.css +73 -0
- package/dist/collection/components/badges/cura-badge-pill/cura-badge-pill.js +219 -0
- package/dist/collection/components/badges/cura-badge-pill/cura-badge-pill.js.map +1 -0
- package/dist/collection/components/badges/cura-badge-pill/cura-badge-pill.stories.js +126 -0
- package/dist/collection/components/badges/cura-badge-pill/cura-badge-pill.stories.js.map +1 -0
- package/dist/collection/components/buttons/cura-button/cura-button.js +1 -1
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js +1 -1
- package/dist/collection/components/buttons/cura-button-select/cura-button-select.js +5 -14
- package/dist/collection/components/buttons/cura-button-select/cura-button-select.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js +1 -1
- package/dist/collection/components/cura-alert/cura-alert.js +1 -1
- package/dist/collection/components/cura-avatar/cura-avatar.js +1 -1
- package/dist/collection/components/cura-calendar/cura-calendar.js +1 -1
- package/dist/collection/components/cura-card/cura-card.js +1 -1
- package/dist/collection/components/cura-icon/cura-icon.definitions.js +1 -2
- package/dist/collection/components/cura-icon/cura-icon.definitions.js.map +1 -1
- package/dist/collection/components/cura-icon/cura-icon.js +2 -6
- package/dist/collection/components/cura-icon/cura-icon.js.map +1 -1
- package/dist/collection/components/cura-icon/cura-icon.stories.js +1 -3
- package/dist/collection/components/cura-icon/cura-icon.stories.js.map +1 -1
- package/dist/collection/components/cura-icons-view/cura-icons-view.js +2 -5
- package/dist/collection/components/cura-icons-view/cura-icons-view.js.map +1 -1
- package/dist/collection/components/cura-modal/cura-modal.css +4 -2
- package/dist/collection/components/cura-modal/cura-modal.js +91 -10
- package/dist/collection/components/cura-modal/cura-modal.js.map +1 -1
- package/dist/collection/components/cura-modal/cura-modal.stories.js +54 -18
- package/dist/collection/components/cura-modal/cura-modal.stories.js.map +1 -1
- package/dist/collection/components/cura-page-template/cura-page-template.js +1 -1
- package/dist/collection/components/cura-toast/cura-toast.js +1 -1
- package/dist/collection/components/cura-tooltip/cura-tooltip.js +1 -1
- package/dist/collection/components/forms/cura-checkbox/cura-checkbox.js +1 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js +2 -2
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.js +1 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js +26 -16
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js.map +1 -1
- package/dist/collection/components/forms/cura-input-date/cura-input-date.js +1 -1
- package/dist/collection/components/forms/cura-label/cura-label.js +1 -1
- package/dist/collection/components/forms/cura-radio/cura-radio.js +1 -1
- package/dist/collection/components/forms/cura-select/cura-select.js +3 -3
- package/dist/collection/components/forms/cura-select-options/cura-select-option.js +1 -1
- package/dist/collection/components/forms/cura-switch/cura-switch.js +1 -1
- package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.js +1 -1
- package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.js +1 -1
- package/dist/collection/components/text/cura-display/cura-display.js +1 -1
- package/dist/collection/components/text/cura-heading/cura-heading.js +1 -1
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +1 -1
- package/dist/collection/utils/utils.js +1 -0
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/cura-alert.js +1 -1
- package/dist/components/cura-avatar.js +1 -1
- package/dist/components/cura-badge-counter.d.ts +11 -0
- package/dist/components/cura-badge-counter.js +8 -0
- package/dist/components/cura-badge-counter.js.map +1 -0
- package/dist/components/cura-badge-counter2.js +90 -0
- package/dist/components/cura-badge-counter2.js.map +1 -0
- package/dist/components/cura-badge-distance.js +1 -1
- package/dist/components/{cura-badge-number.d.ts → cura-badge-pill.d.ts} +4 -4
- package/dist/components/cura-badge-pill.js +120 -0
- package/dist/components/cura-badge-pill.js.map +1 -0
- package/dist/components/cura-button-outline.js +1 -1
- package/dist/components/cura-button-select.js +6 -15
- package/dist/components/cura-button-select.js.map +1 -1
- package/dist/components/cura-button-transparent2.js +1 -1
- package/dist/components/cura-button.js +1 -1
- package/dist/components/cura-calendar2.js +1 -1
- package/dist/components/cura-card.js +1 -1
- package/dist/components/cura-checkbox.js +1 -1
- package/dist/components/cura-display.js +1 -1
- package/dist/components/cura-dropdown-search-option-title.js +1 -1
- package/dist/components/cura-dropdown-search-option.js +2 -2
- package/dist/components/cura-dropdown-search.js +26 -16
- package/dist/components/cura-dropdown-search.js.map +1 -1
- package/dist/components/cura-heading2.js +1 -1
- package/dist/components/cura-icon2.js +3 -8
- package/dist/components/cura-icon2.js.map +1 -1
- package/dist/components/cura-icons-view.js +7 -16
- package/dist/components/cura-icons-view.js.map +1 -1
- package/dist/components/cura-input-date.js +1 -1
- package/dist/components/cura-label2.js +1 -1
- package/dist/components/cura-loader-bar2.js +1 -1
- package/dist/components/cura-loader-circle2.js +1 -1
- package/dist/components/cura-modal.js +36 -9
- package/dist/components/cura-modal.js.map +1 -1
- package/dist/components/cura-page-template.js +1 -1
- package/dist/components/cura-paragraph2.js +1 -1
- package/dist/components/cura-radio.js +1 -1
- package/dist/components/cura-select-option2.js +1 -1
- package/dist/components/cura-select2.js +3 -3
- package/dist/components/cura-switch.js +1 -1
- package/dist/components/cura-toast.js +1 -1
- package/dist/components/cura-tooltip.js +1 -1
- package/dist/components/index.js +4 -2
- package/dist/components/index.js.map +1 -1
- package/dist/cura/cura.esm.js +1 -1
- package/dist/cura/cura.esm.js.map +1 -1
- package/dist/cura/{p-01e301d4.entry.js → p-116a1cd6.entry.js} +2 -2
- package/dist/cura/{p-5bb8302c.entry.js → p-19f28fa8.entry.js} +2 -2
- package/dist/cura/p-19f28fa8.entry.js.map +1 -0
- package/dist/cura/{p-eda28278.entry.js → p-2545cfc7.entry.js} +2 -2
- package/dist/cura/p-35920ac0.entry.js +2 -0
- package/dist/cura/p-35920ac0.entry.js.map +1 -0
- package/dist/cura/{p-eea093b2.entry.js → p-36dbec98.entry.js} +2 -2
- package/dist/cura/{p-ed839f1e.entry.js → p-3d958d45.entry.js} +2 -2
- package/dist/cura/{p-3536c96b.entry.js → p-3e4ca7e7.entry.js} +2 -2
- package/dist/cura/{p-e5b0dd74.entry.js → p-3eca0f0c.entry.js} +2 -2
- package/dist/cura/{p-1f53580a.entry.js → p-42258230.entry.js} +2 -2
- package/dist/cura/p-48f9289b.js +2 -0
- package/dist/cura/p-48f9289b.js.map +1 -0
- package/dist/cura/{p-dbd9eab3.entry.js → p-4b496c51.entry.js} +2 -2
- package/dist/cura/p-52f854e0.entry.js +2 -0
- package/dist/cura/p-52f854e0.entry.js.map +1 -0
- package/dist/cura/{p-81c66f2b.entry.js → p-576c65b4.entry.js} +2 -2
- package/dist/cura/{p-bfb5e9e1.entry.js → p-6e4f4fbf.entry.js} +2 -2
- package/dist/cura/{p-0e28f1c8.entry.js → p-818c581f.entry.js} +2 -2
- package/dist/cura/{p-b0451cb3.entry.js → p-a91d451f.entry.js} +2 -2
- package/dist/cura/p-aa65cb50.entry.js +2 -0
- package/dist/cura/p-aa65cb50.entry.js.map +1 -0
- package/dist/cura/{p-075b02de.entry.js → p-b1a51e81.entry.js} +2 -2
- package/dist/cura/{p-f375a612.entry.js → p-bdb1a0c5.entry.js} +2 -2
- package/dist/cura/p-c4da4c44.entry.js +2 -0
- package/dist/cura/p-c4da4c44.entry.js.map +1 -0
- package/dist/cura/{p-a7ecea4a.entry.js → p-dcd2e5bb.entry.js} +2 -2
- package/dist/cura/{p-7853ab16.entry.js → p-e1a41792.entry.js} +2 -2
- package/dist/cura/p-ef593f12.entry.js +2 -0
- package/dist/cura/p-ef593f12.entry.js.map +1 -0
- package/dist/cura/p-f23c4ed8.entry.js +2 -0
- package/dist/cura/p-f23c4ed8.entry.js.map +1 -0
- package/dist/cura/p-f5d45776.entry.js +2 -0
- package/dist/esm/cura-accordion_12.entry.js +12 -16
- package/dist/esm/cura-accordion_12.entry.js.map +1 -1
- package/dist/esm/cura-alert.entry.js +1 -1
- package/dist/esm/cura-avatar.entry.js +1 -1
- package/dist/esm/cura-badge-counter.entry.js +59 -0
- package/dist/esm/cura-badge-counter.entry.js.map +1 -0
- package/dist/esm/cura-badge-distance.entry.js +1 -1
- package/dist/esm/cura-badge-pill.entry.js +79 -0
- package/dist/esm/cura-badge-pill.entry.js.map +1 -0
- package/dist/esm/cura-button-outline.entry.js +1 -1
- package/dist/esm/cura-button-select.entry.js +2 -11
- package/dist/esm/cura-button-select.entry.js.map +1 -1
- package/dist/esm/cura-button-transparent.entry.js +1 -1
- package/dist/esm/cura-calendar.entry.js +1 -1
- package/dist/esm/cura-card.entry.js +1 -1
- package/dist/esm/cura-checkbox.entry.js +1 -1
- package/dist/esm/cura-display.entry.js +1 -1
- package/dist/esm/cura-dropdown-search-option-title.entry.js +1 -1
- package/dist/esm/cura-dropdown-search-option.entry.js +2 -2
- package/dist/esm/cura-dropdown-search.entry.js +24 -15
- package/dist/esm/cura-dropdown-search.entry.js.map +1 -1
- package/dist/esm/cura-icon.definitions-a892c0e2.js +17 -0
- package/dist/esm/cura-icon.definitions-a892c0e2.js.map +1 -0
- package/dist/esm/cura-icons-view.entry.js +2 -5
- package/dist/esm/cura-icons-view.entry.js.map +1 -1
- package/dist/esm/cura-input-date.entry.js +1 -1
- package/dist/esm/cura-loader-bar.entry.js +1 -1
- package/dist/esm/cura-modal.entry.js +28 -7
- package/dist/esm/cura-modal.entry.js.map +1 -1
- package/dist/esm/cura-radio.entry.js +1 -1
- package/dist/esm/cura-switch.entry.js +1 -1
- package/dist/esm/cura-toast.entry.js +1 -1
- package/dist/esm/cura-tooltip.entry.js +1 -1
- package/dist/esm/cura.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/badges/cura-badge-counter/cura-badge-counter.d.ts +30 -0
- package/dist/types/components/badges/{cura-badge-number/cura-badge-number.stories.d.ts → cura-badge-counter/cura-badge-counter.stories.d.ts} +26 -1
- package/dist/types/components/badges/cura-badge-pill/cura-badge-pill.d.ts +44 -0
- package/dist/types/components/badges/cura-badge-pill/cura-badge-pill.stories.d.ts +119 -0
- package/dist/types/components/buttons/cura-button-select/cura-button-select.d.ts +1 -2
- package/dist/types/components/cura-icon/cura-icon.definitions.d.ts +0 -1
- package/dist/types/components/cura-modal/cura-modal.d.ts +22 -3
- package/dist/types/components/cura-modal/cura-modal.stories.d.ts +42 -3
- package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.d.ts +8 -0
- package/dist/types/components.d.ts +140 -19
- package/dist/types/utils/utils.d.ts +1 -0
- package/package.json +2 -2
- package/dist/cjs/cura-badge-number.cjs.entry.js +0 -29
- package/dist/cjs/cura-badge-number.cjs.entry.js.map +0 -1
- package/dist/cjs/cura-icon.definitions-8d714f6a.js.map +0 -1
- package/dist/collection/components/badges/cura-badge-number/cura-badge-number.css +0 -28
- package/dist/collection/components/badges/cura-badge-number/cura-badge-number.js +0 -66
- package/dist/collection/components/badges/cura-badge-number/cura-badge-number.js.map +0 -1
- package/dist/collection/components/badges/cura-badge-number/cura-badge-number.stories.js.map +0 -1
- package/dist/components/cura-badge-number.js +0 -8
- package/dist/components/cura-badge-number.js.map +0 -1
- package/dist/components/cura-badge-number2.js +0 -49
- package/dist/components/cura-badge-number2.js.map +0 -1
- package/dist/cura/p-0308cf6b.entry.js +0 -2
- package/dist/cura/p-0308cf6b.entry.js.map +0 -1
- package/dist/cura/p-5bb8302c.entry.js.map +0 -1
- package/dist/cura/p-7090d4a7.entry.js +0 -2
- package/dist/cura/p-7090d4a7.entry.js.map +0 -1
- package/dist/cura/p-71a2dcef.entry.js +0 -2
- package/dist/cura/p-71a2dcef.entry.js.map +0 -1
- package/dist/cura/p-9a7e3f48.entry.js +0 -2
- package/dist/cura/p-9a7e3f48.entry.js.map +0 -1
- package/dist/cura/p-a7221f0c.js +0 -2
- package/dist/cura/p-a7221f0c.js.map +0 -1
- package/dist/cura/p-d635501a.entry.js +0 -2
- package/dist/cura/p-d635501a.entry.js.map +0 -1
- package/dist/cura/p-ebed83d1.entry.js +0 -2
- package/dist/esm/cura-badge-number.entry.js +0 -25
- package/dist/esm/cura-badge-number.entry.js.map +0 -1
- package/dist/esm/cura-icon.definitions-aaa4e80f.js +0 -18
- package/dist/esm/cura-icon.definitions-aaa4e80f.js.map +0 -1
- package/dist/types/components/badges/cura-badge-number/cura-badge-number.d.ts +0 -8
- /package/dist/cura/{p-01e301d4.entry.js.map → p-116a1cd6.entry.js.map} +0 -0
- /package/dist/cura/{p-eda28278.entry.js.map → p-2545cfc7.entry.js.map} +0 -0
- /package/dist/cura/{p-eea093b2.entry.js.map → p-36dbec98.entry.js.map} +0 -0
- /package/dist/cura/{p-ed839f1e.entry.js.map → p-3d958d45.entry.js.map} +0 -0
- /package/dist/cura/{p-3536c96b.entry.js.map → p-3e4ca7e7.entry.js.map} +0 -0
- /package/dist/cura/{p-e5b0dd74.entry.js.map → p-3eca0f0c.entry.js.map} +0 -0
- /package/dist/cura/{p-1f53580a.entry.js.map → p-42258230.entry.js.map} +0 -0
- /package/dist/cura/{p-dbd9eab3.entry.js.map → p-4b496c51.entry.js.map} +0 -0
- /package/dist/cura/{p-81c66f2b.entry.js.map → p-576c65b4.entry.js.map} +0 -0
- /package/dist/cura/{p-bfb5e9e1.entry.js.map → p-6e4f4fbf.entry.js.map} +0 -0
- /package/dist/cura/{p-0e28f1c8.entry.js.map → p-818c581f.entry.js.map} +0 -0
- /package/dist/cura/{p-b0451cb3.entry.js.map → p-a91d451f.entry.js.map} +0 -0
- /package/dist/cura/{p-075b02de.entry.js.map → p-b1a51e81.entry.js.map} +0 -0
- /package/dist/cura/{p-f375a612.entry.js.map → p-bdb1a0c5.entry.js.map} +0 -0
- /package/dist/cura/{p-a7ecea4a.entry.js.map → p-dcd2e5bb.entry.js.map} +0 -0
- /package/dist/cura/{p-7853ab16.entry.js.map → p-e1a41792.entry.js.map} +0 -0
- /package/dist/cura/{p-ebed83d1.entry.js.map → p-f5d45776.entry.js.map} +0 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$3 } from './cura-icon2.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './cura-label2.js';
|
|
4
|
+
|
|
5
|
+
const curaBadgePillCss = ".badge-container{display:flex;align-items:center;justify-content:center;gap:calc(var(--base-spacing) * 1px);padding:calc(var(--base-spacing) * 1px);border-radius:var(--border-radius);font-family:var(--font-family);font-size:var(--font-size);position:relative;box-sizing:border-box;width:fit-content;height:calc(var(--base-spacing) * 5px);min-width:calc(var(--base-spacing) * 5px);background-color:var(--color-background)}.badge-container::before{content:\"\";width:100%;height:100%;position:absolute;left:0px;top:0px;box-sizing:border-box;border:1px solid transparent;border-radius:var(--border-radius);pointer-events:none}.badge-container.icon-only cura-label{display:none !important}.badge-container.disabled{background-color:var(--color-background-disabled)}.badge-container.outline{background-color:transparent}.badge-container.outline::before{border:1px solid var(--color-base)}.badge-container.outline.disabled::before{border:1px solid var(--color-outline-disabled)}.badge-container.transparent{background-color:transparent}.badge-container.transparent::before{border:1px solid transparent}.badge-container.transparent.disabled{background-color:transparent}.badge-container cura-icon{display:flex}";
|
|
6
|
+
const CuraBadgePillStyle0 = curaBadgePillCss;
|
|
7
|
+
|
|
8
|
+
const CuraBadgePill$1 = /*@__PURE__*/ proxyCustomElement(class CuraBadgePill extends HTMLElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
this.__registerHost();
|
|
12
|
+
this.__attachShadow();
|
|
13
|
+
this.theme = window.CuraAPI.theme;
|
|
14
|
+
this.type = 'solid';
|
|
15
|
+
this.color = 'primary';
|
|
16
|
+
this.iconName = undefined;
|
|
17
|
+
this.iconset = 'default';
|
|
18
|
+
this.disabled = false;
|
|
19
|
+
this.iconOnly = false;
|
|
20
|
+
this.borderRadius = "2px";
|
|
21
|
+
this.styles = {};
|
|
22
|
+
}
|
|
23
|
+
handleColorChange() {
|
|
24
|
+
this.setColors();
|
|
25
|
+
}
|
|
26
|
+
connectedCallback() {
|
|
27
|
+
this.setBaseStyles();
|
|
28
|
+
this.setColors();
|
|
29
|
+
}
|
|
30
|
+
setBaseStyles() {
|
|
31
|
+
this.styles['--base-spacing'] = this.theme.spacing.getSpacing();
|
|
32
|
+
this.styles['--font-family'] = this.theme.fonts.getFamily();
|
|
33
|
+
this.styles['--font-size'] = this.theme.fonts.getSize();
|
|
34
|
+
this.styles = Object.assign({}, this.styles);
|
|
35
|
+
}
|
|
36
|
+
setColors() {
|
|
37
|
+
const colors = [
|
|
38
|
+
{ name: '--color-background', theme: `${this.color}-lighter` },
|
|
39
|
+
{ name: '--color-base', theme: `${this.color}-dark` },
|
|
40
|
+
{ name: '--color-background-disabled', theme: 'neutral-pale' },
|
|
41
|
+
{ name: '--color-outline-disabled', theme: 'neutral-medium' },
|
|
42
|
+
];
|
|
43
|
+
colors.forEach(color => {
|
|
44
|
+
this.styles[color.name] = this.theme.colors.getColor(color.theme);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
hostCSSProperties() {
|
|
48
|
+
return {
|
|
49
|
+
'--border-radius': this.borderRadius || '2px',
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
getClasses() {
|
|
53
|
+
const classes = {};
|
|
54
|
+
classes['badge-container'] = true;
|
|
55
|
+
classes[`icon-only`] = this.iconOnly;
|
|
56
|
+
classes['disabled'] = this.disabled;
|
|
57
|
+
classes[`${this.type}`] = true;
|
|
58
|
+
return classes;
|
|
59
|
+
}
|
|
60
|
+
getSymbolColor() {
|
|
61
|
+
return this.disabled
|
|
62
|
+
? 'neutral-medium'
|
|
63
|
+
: `${this.color}-dark`;
|
|
64
|
+
}
|
|
65
|
+
getIcon() {
|
|
66
|
+
if (!this.iconName)
|
|
67
|
+
return '';
|
|
68
|
+
return h("cura-icon", { name: this.iconName, iconset: this.iconset, size: 'micro', color: this.getSymbolColor() });
|
|
69
|
+
}
|
|
70
|
+
render() {
|
|
71
|
+
const symbolColor = this.getSymbolColor();
|
|
72
|
+
return (h(Host, { key: 'b6870052543347fdc83a75629b30251ddab35e12', style: this.hostCSSProperties() }, h("div", { key: 'ae8b14c1c9c323b8387e7ed4e3a97bade9c712f4', class: this.getClasses(), style: this.styles }, this.getIcon(), h("cura-label", { key: 'd14ab9efd48f33c7b8153cf85699b2fc96ecd7af', size: 'xsmall', "line-height": "117%", color: symbolColor }, h("slot", { key: 'b684ca1b248d04700a2b8a7245c455fb9bdef474' })))));
|
|
73
|
+
}
|
|
74
|
+
get host() { return this; }
|
|
75
|
+
static get watchers() { return {
|
|
76
|
+
"color": ["handleColorChange"]
|
|
77
|
+
}; }
|
|
78
|
+
static get style() { return CuraBadgePillStyle0; }
|
|
79
|
+
}, [1, "cura-badge-pill", {
|
|
80
|
+
"type": [513],
|
|
81
|
+
"color": [1],
|
|
82
|
+
"iconName": [513, "icon-name"],
|
|
83
|
+
"iconset": [513],
|
|
84
|
+
"disabled": [516],
|
|
85
|
+
"iconOnly": [516, "icon-only"],
|
|
86
|
+
"borderRadius": [513, "border-radius"],
|
|
87
|
+
"styles": [32]
|
|
88
|
+
}, undefined, {
|
|
89
|
+
"color": ["handleColorChange"]
|
|
90
|
+
}]);
|
|
91
|
+
function defineCustomElement$1() {
|
|
92
|
+
if (typeof customElements === "undefined") {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const components = ["cura-badge-pill", "cura-icon", "cura-label"];
|
|
96
|
+
components.forEach(tagName => { switch (tagName) {
|
|
97
|
+
case "cura-badge-pill":
|
|
98
|
+
if (!customElements.get(tagName)) {
|
|
99
|
+
customElements.define(tagName, CuraBadgePill$1);
|
|
100
|
+
}
|
|
101
|
+
break;
|
|
102
|
+
case "cura-icon":
|
|
103
|
+
if (!customElements.get(tagName)) {
|
|
104
|
+
defineCustomElement$3();
|
|
105
|
+
}
|
|
106
|
+
break;
|
|
107
|
+
case "cura-label":
|
|
108
|
+
if (!customElements.get(tagName)) {
|
|
109
|
+
defineCustomElement$2();
|
|
110
|
+
}
|
|
111
|
+
break;
|
|
112
|
+
} });
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const CuraBadgePill = CuraBadgePill$1;
|
|
116
|
+
const defineCustomElement = defineCustomElement$1;
|
|
117
|
+
|
|
118
|
+
export { CuraBadgePill, defineCustomElement };
|
|
119
|
+
|
|
120
|
+
//# sourceMappingURL=cura-badge-pill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"cura-badge-pill.js","mappings":";;;;AAAA,MAAM,gBAAgB,GAAG,qrCAAqrC,CAAC;AAC/sC,4BAAe,gBAAgB;;MCMlBA,eAAa;;;;;QAwCxB,UAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;oBAlCwC,OAAO;qBAK+B,SAAS;;uBAUjF,SAAS;wBAKR,KAAK;wBAKL,KAAK;4BAKO,KAAK;sBAEnC,EAAE;;IAKpB,iBAAiB;QACf,IAAI,CAAC,SAAS,EAAE,CAAC;KAClB;IAED,iBAAiB;QACf,IAAI,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I,CAAC,QAAQ,CAAC;QACrC,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;QACpC,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;QAC/B,OAAO,OAAO,CAAC;KAChB;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,QAAQ;cAChB,gBAAgB;cAChB,GAAG,IAAI,CAAC,KAAK,OAAO,CAAC;KAC1B;IAED,OAAO;QACL,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE,OAAO,EAAE,CAAC;QAC9B,OAAO,iBACL,IAAI,EAAE,IAAI,CAAC,QAAQ,EACnB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,GAC5B,CAAC;KACJ;IAED,MAAM;QACJ,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QAC1C,QACE,EAAC,IAAI,qDAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,IACnC,4DAAK,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,IAC9C,IAAI,CAAC,OAAO,EAAE,EACf,mEAAY,IAAI,EAAC,QAAQ,iBAAa,MAAM,EAAC,KAAK,EAAE,WAAW,IAC7D,8DAAa,CACF,CACT,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CuraBadgePill"],"sources":["src/components/badges/cura-badge-pill/cura-badge-pill.scss?tag=cura-badge-pill&encapsulation=shadow","src/components/badges/cura-badge-pill/cura-badge-pill.tsx"],"sourcesContent":["@import \"../../../scss/mixins/spacing.scss\";\n\n.badge-container {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: #{$spacing-tiny};\n padding: #{$spacing-tiny};\n border-radius: var(--border-radius);\n font-family: var(--font-family);\n font-size: var(--font-size);\n position: relative;\n box-sizing: border-box;\n width: fit-content;\n height: #{$spacing-xs};\n min-width: #{$spacing-xs};\n\n background-color: var(--color-background);\n\n &::before {\n content: \"\";\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0px;\n top: 0px;\n box-sizing: border-box;\n border: 1px solid transparent;\n border-radius: var(--border-radius);\n pointer-events: none;\n }\n\n &.icon-only {\n cura-label {\n display: none !important;\n }\n }\n\n &.disabled {\n background-color: var(--color-background-disabled);\n }\n\n &.outline {\n background-color: transparent;\n\n &::before {\n border: 1px solid var(--color-base);\n }\n\n &.disabled::before {\n border: 1px solid var(--color-outline-disabled);\n }\n }\n\n &.transparent {\n background-color: transparent;\n\n &::before {\n border: 1px solid transparent;\n }\n\n &.disabled {\n background-color: transparent;\n }\n }\n\n cura-icon {\n display: flex;\n }\n}\n","import { Component, Host, Prop, State, h, Watch, Element } from '@stencil/core';\n\n@Component({\n tag: 'cura-badge-pill',\n styleUrl: 'cura-badge-pill.scss',\n shadow: true,\n})\nexport class CuraBadgePill {\n @Element() host: HTMLElement;\n\n /**\n * Badge type: solid | outline | transparent\n */\n @Prop({ reflect: true }) type: 'solid' | 'outline' | 'transparent' = 'solid';\n\n /**\n * Color base from color scheme. Default: primary\n */\n @Prop() color: 'primary' | 'secondary' | 'accent' | 'neutral' | 'info' | 'success' | 'warning' | 'error' = 'primary';\n\n /**\n * Name of the icon to be used from iconset\n */\n @Prop({ reflect: true }) iconName: string;\n\n /**\n * Custom iconset if needed\n */\n @Prop({ reflect: true }) iconset = 'default';\n\n /**\n * Disabled state. Boolean\n */\n @Prop({ reflect: true }) disabled = false;\n\n /**\n * Set badge to icon only. Boolean\n */\n @Prop({ reflect: true }) iconOnly = false;\n\n /**\n * Set border-radius.\n */\n @Prop({ reflect: true }) borderRadius: string = \"2px\";\n\n @State() styles = {};\n\n theme = window.CuraAPI.theme;\n\n @Watch('color')\n handleColorChange() {\n this.setColors();\n }\n\n connectedCallback() {\n this.setBaseStyles();\n this.setColors();\n }\n\n private setBaseStyles() {\n this.styles['--base-spacing'] = this.theme.spacing.getSpacing();\n this.styles['--font-family'] = this.theme.fonts.getFamily();\n this.styles['--font-size'] = this.theme.fonts.getSize();\n this.styles = { ...this.styles };\n }\n\n private setColors() {\n const colors = [\n { name: '--color-background', theme: `${this.color}-lighter` },\n { name: '--color-base', theme: `${this.color}-dark` },\n { name: '--color-background-disabled', theme: 'neutral-pale' },\n { name: '--color-outline-disabled', theme: 'neutral-medium' },\n ];\n\n colors.forEach(color => {\n this.styles[color.name] = this.theme.colors.getColor(color.theme);\n });\n }\n\n hostCSSProperties() {\n return {\n '--border-radius': this.borderRadius || '2px',\n };\n }\n\n getClasses() {\n const classes = {};\n classes['badge-container'] = true;\n classes[`icon-only`] = this.iconOnly;\n classes['disabled'] = this.disabled;\n classes[`${this.type}`] = true;\n return classes;\n }\n\n getSymbolColor() {\n return this.disabled\n ? 'neutral-medium'\n : `${this.color}-dark`;\n }\n\n getIcon() {\n if (!this.iconName) return '';\n return <cura-icon\n name={this.iconName}\n iconset={this.iconset}\n size={'micro'}\n color={this.getSymbolColor()}\n />;\n }\n\n render() {\n const symbolColor = this.getSymbolColor();\n return (\n <Host style={this.hostCSSProperties()}>\n <div class={this.getClasses()} style={this.styles}>\n {this.getIcon()}\n <cura-label size='xsmall' line-height=\"117%\" color={symbolColor}>\n <slot></slot>\n </cura-label>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -98,7 +98,7 @@ const CuraButtonOutline$1 = /*@__PURE__*/ proxyCustomElement(class CuraButtonOut
|
|
|
98
98
|
render() {
|
|
99
99
|
const symbolColor = this.getSymbolColor();
|
|
100
100
|
const labelSize = labelSizes[this.size] || labelSizes["default"];
|
|
101
|
-
return (h(Host, { key: '
|
|
101
|
+
return (h(Host, { key: '8c7adeaec50deaf3829295d2231b390992064735' }, this.href ? (h("a", { href: this.disabled ? '' : this.href, target: this.target, class: this.getClasses(), style: this.styles, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { size: labelSize, lineHeight: '105%', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor }))) : (h("button", { class: this.getClasses(), style: this.styles, disabled: this.disabled || null, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave(), type: this.type }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { size: labelSize, lineHeight: '105%', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor })))));
|
|
102
102
|
}
|
|
103
103
|
static get formAssociated() { return true; }
|
|
104
104
|
static get watchers() { return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { l as labelSizes } from './cura-button.definitions.js';
|
|
3
|
-
import { d as defineCustomElement$4 } from './cura-badge-
|
|
3
|
+
import { d as defineCustomElement$4 } from './cura-badge-counter2.js';
|
|
4
4
|
import { d as defineCustomElement$3 } from './cura-icon2.js';
|
|
5
5
|
import { d as defineCustomElement$2 } from './cura-label2.js';
|
|
6
6
|
|
|
@@ -68,15 +68,6 @@ const CuraButtonSelect$1 = /*@__PURE__*/ proxyCustomElement(class CuraButtonSele
|
|
|
68
68
|
return this.selected ? 'neutral-white' : 'neutral-black';
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
getColorCounter() {
|
|
72
|
-
if (this.background === 'dark' && this.disabled) {
|
|
73
|
-
return !this.selected ? 'neutral-black' : 'neutral-dark';
|
|
74
|
-
}
|
|
75
|
-
if (this.background === 'light' && this.disabled) {
|
|
76
|
-
return 'neutral-pale';
|
|
77
|
-
}
|
|
78
|
-
return `${this.color}-lighter`;
|
|
79
|
-
}
|
|
80
71
|
getColorBagdeNumber() {
|
|
81
72
|
if (this.background === 'dark' && this.disabled) {
|
|
82
73
|
return this.selected ? 'neutral-black' : 'neutral-dark';
|
|
@@ -94,7 +85,7 @@ const CuraButtonSelect$1 = /*@__PURE__*/ proxyCustomElement(class CuraButtonSele
|
|
|
94
85
|
return h("cura-icon", { name: this.iconName, size: iconSize, color: this.getLabelFontColor() });
|
|
95
86
|
}
|
|
96
87
|
getCounter() {
|
|
97
|
-
return (h("cura-badge-
|
|
88
|
+
return (h("cura-badge-counter", { number: this.counter, color: this.color, disabled: this.disabled || null, class: "badge-number" }));
|
|
98
89
|
}
|
|
99
90
|
getCheckIconRight() {
|
|
100
91
|
const iconSize = this.size === 'large' ? 20 : 16;
|
|
@@ -116,7 +107,7 @@ const CuraButtonSelect$1 = /*@__PURE__*/ proxyCustomElement(class CuraButtonSele
|
|
|
116
107
|
}
|
|
117
108
|
render() {
|
|
118
109
|
const labelSize = labelSizes[this.size] || labelSizes['default'];
|
|
119
|
-
return (h(Host, { key: '
|
|
110
|
+
return (h(Host, { key: '54bf5dc64b99128f839fdc22ff56dd709971fc8e' }, h("button", { key: '422e4d80d321fb9e4cddd165700220071012bea8', class: this.getClasses(), style: this.styles, disabled: this.disabled, onClick: e => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, h("div", { key: '6c40080d1b8746e394539cf717d658e4d834c500', class: "button-container" }, this.iconName ? this.getIcon() : null, h("cura-label", { key: 'f2f9b54cbcd2c7a571d966ba20f344384ecaadc0', class: "label", size: labelSize, lineHeight: "0%", color: this.getLabelFontColor(), weight: "regular" }, h("slot", { key: 'f5c471e0771c6c19685aa591461a73b1aaa83c47' })), this.counter ? this.getCounter() : null, this.iconPosition === 'right' && this.selected ? this.getCheckIconRight() : null))));
|
|
120
111
|
}
|
|
121
112
|
get host() { return this; }
|
|
122
113
|
static get watchers() { return {
|
|
@@ -128,7 +119,7 @@ const CuraButtonSelect$1 = /*@__PURE__*/ proxyCustomElement(class CuraButtonSele
|
|
|
128
119
|
"selected": [1540],
|
|
129
120
|
"iconName": [1537, "icon-name"],
|
|
130
121
|
"size": [513],
|
|
131
|
-
"counter": [
|
|
122
|
+
"counter": [1538],
|
|
132
123
|
"disabled": [516],
|
|
133
124
|
"background": [1],
|
|
134
125
|
"color": [1],
|
|
@@ -143,14 +134,14 @@ function defineCustomElement$1() {
|
|
|
143
134
|
if (typeof customElements === "undefined") {
|
|
144
135
|
return;
|
|
145
136
|
}
|
|
146
|
-
const components = ["cura-button-select", "cura-badge-
|
|
137
|
+
const components = ["cura-button-select", "cura-badge-counter", "cura-icon", "cura-label"];
|
|
147
138
|
components.forEach(tagName => { switch (tagName) {
|
|
148
139
|
case "cura-button-select":
|
|
149
140
|
if (!customElements.get(tagName)) {
|
|
150
141
|
customElements.define(tagName, CuraButtonSelect$1);
|
|
151
142
|
}
|
|
152
143
|
break;
|
|
153
|
-
case "cura-badge-
|
|
144
|
+
case "cura-badge-counter":
|
|
154
145
|
if (!customElements.get(tagName)) {
|
|
155
146
|
defineCustomElement$4();
|
|
156
147
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"cura-button-select.js","mappings":";;;;;;AAAA,MAAM,mBAAmB,GAAG,usGAAusG,CAAC;AACpuG,+BAAe,mBAAmB;;MCOrBA,kBAAgB;;;;;;QAiB3B,UAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;wBAdsB,KAAK;;oBAEM,QAAQ;;;0BAG/B,OAAO;qBACtB,SAAS;;uBAGd,KAAK;sBACN,EAAE;;IAUpB,SAAS;QACP,MAAM,MAAM,GAAG;YACb,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,KAAK,OAAO,GAAG,GAAG,IAAI,CAAC,KAAK,SAAS,GAAG,eAAe,EAAE;YACzG,EAAE,IAAI,EAAE,8BAA8B,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,KAAK,OAAO,GAAG,GAAG,IAAI,CAAC,KAAK,OAAO,GAAG,GAAG,IAAI,C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AC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAC,IAAI,EAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,EAAE,MAAM,EAAC,SAAS,IAC1G,8DAAa,CACF,EACZ,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,GAAG,IAAI,EACvC,IAAI,CAAC,YAAY,KAAK,OAAO,IAAI,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,iBAAiB,EAAE,GAAG,IAAI,CAC7E,CACC,CACJ,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CuraButtonSelect"],"sources":["src/components/buttons/cura-button-select/cura-button-select.scss?tag=cura-button-select&encapsulation=shadow","src/components/buttons/cura-button-select/cura-button-select.tsx"],"sourcesContent":["@import '../../../scss/mixins/buttons.scss';\n\n:host {\n @include button-host();\n\n button,\n a {\n @include button-element() {\n background-color: var(--neutral-purewhite);\n box-sizing: border-box;\n border: none;\n\n &::before {\n content: '';\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0px;\n top: 0px;\n box-sizing: border-box;\n border: 2px solid var(--color-border);\n border-radius: var(--border-radius);\n }\n\n &:not(.disabled):hover {\n background-color: var(--color-background-hover);\n border-color: var(--color-border-hover-pressed);\n }\n\n &:focus {\n border-color: var(--color-border) !important;\n }\n }\n\n @include button-sizes();\n\n @include button-label();\n\n // Children Elements\n @include button-container() {\n flex-direction: row !important;\n\n .badge-number {\n margin-left: 10px;\n }\n }\n\n @include button-icon();\n\n // selected state\n @include button-selected() {\n background-color: var(--color-select);\n border-color: var(--color-select);\n\n &:not(.disabled):hover {\n background-color: var(--color-border-hover-pressed);\n border-color: var(--color-border-hover-pressed);\n }\n\n &:focus {\n border-color: var(--color-select-focus) !important;\n }\n\n &.disabled {\n background-color: var(--color-disable-select);\n border-color: var(--color-disable-select);\n }\n }\n\n // Disabled state\n @include button-disabled() {\n background-color: var(--neutral-white-primary-darker);\n border-color: var(--color-border-disable-unselect);\n }\n }\n}\n","import { Component, Element, Event, EventEmitter, Host, Prop, State, Watch, h } from '@stencil/core';\nimport { labelSizes } from '../cura-button.definitions';\n\n@Component({\n tag: 'cura-button-select',\n styleUrl: 'cura-button-select.scss',\n shadow: true,\n})\nexport class CuraButtonSelect {\n @Element() host: HTMLElement;\n\n @Prop({ reflect: true, mutable: true }) selected = false;\n @Prop({ reflect: true, mutable: true }) iconName: string;\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n @Prop({ reflect: true, mutable: true }) counter: string | number | null;\n @Prop({ reflect: true }) disabled: boolean;\n @Prop() background: 'dark' | 'light' = 'light';\n @Prop() color: string = 'primary';\n @Prop({ reflect: true }) iconPosition: 'left' | 'right';\n\n @State() hovered = false;\n @State() styles = {};\n\n @Event({ eventName: 'onclick' }) onclick: EventEmitter<{ selected: boolean }>;\n\n theme = window.CuraAPI.theme;\n\n weights;\n\n @Watch('background')\n @Watch('color')\n setColors() {\n const colors = [\n { name: '--color-border', thema: this.background === 'light' ? `${this.color}-darker` : 'neutral-white' },\n { name: '--color-border-hover-pressed', thema: this.background === 'light' ? `${this.color}-dark` : `${this.color}-light` },\n { name: '--color-background-hover', thema: this.background === 'light' ? `${this.color}-light` : `${this.color}-dark` },\n { name: '--color-select', thema: this.background === 'light' ? `${this.color}-base` : 'neutral-white' },\n { name: '--color-select-hover-pressed', thema: this.background === 'light' ? `${this.color}-dark` : `${this.color}-lighter` },\n { name: '--color-select-focus', thema: this.background === 'light' ? `${this.color}-base` : `${this.color}-lighter` },\n { name: '--color-disable-select', thema: this.background === 'light' ? 'neutral-white' : 'neutral-black' },\n { name: '--color-border-disable-unselect', thema: 'neutral-dark' },\n { name: '--color-counter-disabled', thema: this.background === 'light' ? 'neutral-pale' : 'neutral-black' },\n { name: '--color-counter', thema: !this.disabled && 'primary-lighter' },\n ];\n\n colors.forEach(color => (this.styles[color.name] = window.CuraAPI.theme.colors.getColor(color.thema)));\n this.styles = { ...this.styles };\n }\n\n getClasses() {\n const classes = {};\n classes[`${this.size?.toLowerCase()}`] = true;\n classes[`icon-${this.iconPosition.toLowerCase()}`] = true;\n classes['disabled'] = this.disabled;\n classes['selected'] = this.selected;\n return classes;\n }\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-weight-medium'] = this.weights.medium;\n this.setColors();\n }\n\n getLabelFontColor() {\n if (this.disabled) return 'neutral-dark';\n\n if (this.background === 'dark') {\n return this.selected ? 'neutral-black' : 'neutral-white';\n }\n if (this.background === 'light') {\n return this.selected ? 'neutral-white' : 'neutral-black';\n }\n }\n\n getColorCounter() {\n if (this.background === 'dark' && this.disabled) {\n return !this.selected ? 'neutral-black' : 'neutral-dark';\n }\n\n if (this.background === 'light' && this.disabled) {\n return 'neutral-pale';\n }\n return `${this.color}-lighter`;\n }\n\n getColorBagdeNumber() {\n if (this.background === 'dark' && this.disabled) {\n return this.selected ? 'neutral-black' : 'neutral-dark';\n }\n\n if (this.background === 'light' && this.disabled) {\n return 'neutral-medium';\n }\n\n return `${this.color}-darker`;\n }\n\n getIcon() {\n const iconSize = this.size === 'large' ? 20 : 16;\n if (this.iconPosition === 'right') {\n return;\n }\n\n return <cura-icon name={this.iconName} size={iconSize} color={this.getLabelFontColor()} />;\n }\n\n getCounter() {\n return (\n <cura-badge-number color={this.getColorCounter()} class=\"badge-number\">\n <cura-label color={this.getColorBagdeNumber()} size=\"small\">\n {this.counter}\n </cura-label>\n </cura-badge-number>\n );\n }\n\n getCheckIconRight() {\n const iconSize = this.size === 'large' ? 20 : 16;\n return <cura-icon name=\"check\" size={iconSize} color={this.getLabelFontColor()}></cura-icon>;\n }\n\n handleMouseEnter() {\n if (this.disabled) return;\n this.hovered = true;\n }\n\n handleMouseLeave() {\n this.hovered = false;\n }\n\n handleClick(e: Event) {\n if (this.disabled) e.preventDefault();\n this.selected = !this.selected;\n this.onclick.emit({ selected: this.selected });\n }\n\n render() {\n const labelSize = labelSizes[this.size] || labelSizes['default'];\n return (\n <Host>\n <button\n class={this.getClasses()}\n style={this.styles}\n disabled={this.disabled}\n onClick={e => this.handleClick(e)}\n onMouseEnter={() => this.handleMouseEnter()}\n onMouseLeave={() => this.handleMouseLeave()}\n >\n <div class=\"button-container\">\n {this.iconName ? this.getIcon() : null}\n <cura-label class=\"label\" size={labelSize} lineHeight=\"0%\" color={this.getLabelFontColor()} weight=\"regular\">\n <slot></slot>\n </cura-label>\n {this.counter ? this.getCounter() : null}\n {this.iconPosition === 'right' && this.selected ? this.getCheckIconRight() : null}\n </div>\n </button>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"cura-button-select.js","mappings":";;;;;;AAAA,MAAM,mBAAmB,GAAG,usGAAusG,CAAC;AACpuG,+BAAe,mBAAmB;;MCOrBA,kBAAgB;;;;;;QAiB3B,UAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;wBAdsB,KAAK;;oBAEM,QAAQ;;;0BAG/B,OAAO;qBACtB,SAAS;;uBAGd,KAAK;sBACN,EAAE;;IAUpB,SAAS;QACP,MAAM,MAAM,GAAG;YACb,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,KAAK,OAAO,GAAG,GAAG,IAAI,CAAC,KAAK,SAAS,GAAG,eAAe,EAAE;YACzG,EAAE,IAAI,EAAE,8BAA8B,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,KAAK,OAAO,GAAG,GAAG,IAAI,CAAC,KAAK,OAAO,GAAG,GAAG,IAAI,CAAC,KAAK,QAAQ,EAAE;YAC3H,EAAE,IAAI,EAAE,0BAA0B,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,KAAK,OAAO,GAAG,GAAG,IAAI,CA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encapsulation=shadow","src/components/buttons/cura-button-select/cura-button-select.tsx"],"sourcesContent":["@import '../../../scss/mixins/buttons.scss';\n\n:host {\n @include button-host();\n\n button,\n a {\n @include button-element() {\n background-color: var(--neutral-purewhite);\n box-sizing: border-box;\n border: none;\n\n &::before {\n content: '';\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0px;\n top: 0px;\n box-sizing: border-box;\n border: 2px solid var(--color-border);\n border-radius: var(--border-radius);\n }\n\n &:not(.disabled):hover {\n background-color: var(--color-background-hover);\n border-color: var(--color-border-hover-pressed);\n }\n\n &:focus {\n border-color: var(--color-border) !important;\n }\n }\n\n @include button-sizes();\n\n @include button-label();\n\n // Children Elements\n @include button-container() {\n flex-direction: row !important;\n\n .badge-number {\n margin-left: 10px;\n }\n }\n\n @include button-icon();\n\n // selected state\n @include button-selected() {\n background-color: var(--color-select);\n border-color: var(--color-select);\n\n &:not(.disabled):hover {\n background-color: var(--color-border-hover-pressed);\n border-color: var(--color-border-hover-pressed);\n }\n\n &:focus {\n border-color: var(--color-select-focus) !important;\n }\n\n &.disabled {\n background-color: var(--color-disable-select);\n border-color: var(--color-disable-select);\n }\n }\n\n // Disabled state\n @include button-disabled() {\n background-color: var(--neutral-white-primary-darker);\n border-color: var(--color-border-disable-unselect);\n }\n }\n}\n","import { Component, Element, Event, EventEmitter, Host, Prop, State, Watch, h } from '@stencil/core';\nimport { labelSizes } from '../cura-button.definitions';\n\n@Component({\n tag: 'cura-button-select',\n styleUrl: 'cura-button-select.scss',\n shadow: true,\n})\nexport class CuraButtonSelect {\n @Element() host: HTMLElement;\n\n @Prop({ reflect: true, mutable: true }) selected = false;\n @Prop({ reflect: true, mutable: true }) iconName: string;\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n @Prop({ reflect: true, mutable: true }) counter: number | null;\n @Prop({ reflect: true }) disabled: boolean;\n @Prop() background: 'dark' | 'light' = 'light';\n @Prop() color: string = 'primary';\n @Prop({ reflect: true }) iconPosition: 'left' | 'right';\n\n @State() hovered = false;\n @State() styles = {};\n\n @Event({ eventName: 'onclick' }) onclick: EventEmitter<{ selected: boolean }>;\n\n theme = window.CuraAPI.theme;\n\n weights;\n\n @Watch('background')\n @Watch('color')\n setColors() {\n const colors = [\n { name: '--color-border', thema: this.background === 'light' ? `${this.color}-darker` : 'neutral-white' },\n { name: '--color-border-hover-pressed', thema: this.background === 'light' ? `${this.color}-dark` : `${this.color}-light` },\n { name: '--color-background-hover', thema: this.background === 'light' ? `${this.color}-light` : `${this.color}-dark` },\n { name: '--color-select', thema: this.background === 'light' ? `${this.color}-base` : 'neutral-white' },\n { name: '--color-select-hover-pressed', thema: this.background === 'light' ? `${this.color}-dark` : `${this.color}-lighter` },\n { name: '--color-select-focus', thema: this.background === 'light' ? `${this.color}-base` : `${this.color}-lighter` },\n { name: '--color-disable-select', thema: this.background === 'light' ? 'neutral-white' : 'neutral-black' },\n { name: '--color-border-disable-unselect', thema: 'neutral-dark' },\n { name: '--color-counter-disabled', thema: this.background === 'light' ? 'neutral-pale' : 'neutral-black' },\n { name: '--color-counter', thema: !this.disabled && 'primary-lighter' },\n ];\n\n colors.forEach(color => (this.styles[color.name] = window.CuraAPI.theme.colors.getColor(color.thema)));\n this.styles = { ...this.styles };\n }\n\n getClasses() {\n const classes = {};\n classes[`${this.size?.toLowerCase()}`] = true;\n classes[`icon-${this.iconPosition.toLowerCase()}`] = true;\n classes['disabled'] = this.disabled;\n classes['selected'] = this.selected;\n return classes;\n }\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-weight-medium'] = this.weights.medium;\n this.setColors();\n }\n\n getLabelFontColor() {\n if (this.disabled) return 'neutral-dark';\n\n if (this.background === 'dark') {\n return this.selected ? 'neutral-black' : 'neutral-white';\n }\n if (this.background === 'light') {\n return this.selected ? 'neutral-white' : 'neutral-black';\n }\n }\n\n getColorBagdeNumber() {\n if (this.background === 'dark' && this.disabled) {\n return this.selected ? 'neutral-black' : 'neutral-dark';\n }\n\n if (this.background === 'light' && this.disabled) {\n return 'neutral-medium';\n }\n\n return `${this.color}-darker`;\n }\n\n getIcon() {\n const iconSize = this.size === 'large' ? 20 : 16;\n if (this.iconPosition === 'right') {\n return;\n }\n\n return <cura-icon name={this.iconName} size={iconSize} color={this.getLabelFontColor()} />;\n }\n\n getCounter() {\n return (\n <cura-badge-counter\n number={this.counter}\n color={this.color}\n disabled={this.disabled || null}\n class=\"badge-number\">\n </cura-badge-counter>\n );\n }\n\n getCheckIconRight() {\n const iconSize = this.size === 'large' ? 20 : 16;\n return <cura-icon name=\"check\" size={iconSize} color={this.getLabelFontColor()}></cura-icon>;\n }\n\n handleMouseEnter() {\n if (this.disabled) return;\n this.hovered = true;\n }\n\n handleMouseLeave() {\n this.hovered = false;\n }\n\n handleClick(e: Event) {\n if (this.disabled) e.preventDefault();\n this.selected = !this.selected;\n this.onclick.emit({ selected: this.selected });\n }\n\n render() {\n const labelSize = labelSizes[this.size] || labelSizes['default'];\n return (\n <Host>\n <button\n class={this.getClasses()}\n style={this.styles}\n disabled={this.disabled}\n onClick={e => this.handleClick(e)}\n onMouseEnter={() => this.handleMouseEnter()}\n onMouseLeave={() => this.handleMouseLeave()}\n >\n <div class=\"button-container\">\n {this.iconName ? this.getIcon() : null}\n <cura-label class=\"label\" size={labelSize} lineHeight=\"0%\" color={this.getLabelFontColor()} weight=\"regular\">\n <slot></slot>\n </cura-label>\n {this.counter ? this.getCounter() : null}\n {this.iconPosition === 'right' && this.selected ? this.getCheckIconRight() : null}\n </div>\n </button>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -87,7 +87,7 @@ const CuraButtonTransparent = /*@__PURE__*/ proxyCustomElement(class CuraButtonT
|
|
|
87
87
|
render() {
|
|
88
88
|
const symbolColor = this.getSymbolColor();
|
|
89
89
|
const labelSize = labelSizes[this.size] || labelSizes["default"];
|
|
90
|
-
return (h(Host, { key: '
|
|
90
|
+
return (h(Host, { key: '5cdc491f0c3e80910e76c5bef2e26ce468ffda1f' }, this.href ? (h("a", { href: this.disabled ? '' : this.href, target: this.target, class: this.getClasses(), style: this.styles, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { size: labelSize, lineHeight: '105%', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor }))) : (h("button", { class: this.getClasses(), style: this.styles, disabled: this.disabled || null, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave(), type: this.type }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { size: labelSize, lineHeight: '105%', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor })))));
|
|
91
91
|
}
|
|
92
92
|
static get formAssociated() { return true; }
|
|
93
93
|
static get watchers() { return {
|
|
@@ -99,7 +99,7 @@ const CuraButton$1 = /*@__PURE__*/ proxyCustomElement(class CuraButton extends H
|
|
|
99
99
|
render() {
|
|
100
100
|
const symbolColor = this.getSymbolColor();
|
|
101
101
|
const labelSize = labelSizes[this.size] || labelSizes["default"];
|
|
102
|
-
return (h(Host, { key: '
|
|
102
|
+
return (h(Host, { key: '27ce2e8e003caac05d652a9a25054f689d9e3841' }, this.href ? (h("a", { href: this.disabled ? '' : this.href, target: this.target, class: this.getClasses(), style: this.styles, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { class: "label", size: labelSize, lineHeight: '105%', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor }))) : (h("button", { class: this.getClasses(), style: this.styles, disabled: this.disabled || null, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave(), type: this.type }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { class: "label", size: labelSize, lineHeight: '105%', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor })))));
|
|
103
103
|
}
|
|
104
104
|
static get formAssociated() { return true; }
|
|
105
105
|
static get watchers() { return {
|
|
@@ -4026,7 +4026,7 @@ const CuraCalendar = /*@__PURE__*/ proxyCustomElement(class CuraCalendar extends
|
|
|
4026
4026
|
}
|
|
4027
4027
|
render() {
|
|
4028
4028
|
const { months } = this.fetchMonthNames();
|
|
4029
|
-
return (h(Host, { key: '
|
|
4029
|
+
return (h(Host, { key: 'fcea88a384ceebadccb6059ef59cea945f875a72', style: this.getHostCSSProperties() }, h("div", { key: '82c5271ba6b073439fb58471920f73b68b8f1320', class: `calendar ${this.floating ? 'floating' : ''} ${this.embedded ? 'embedded' : ''}`, style: this.styles }, h("header", { key: '3921fb57f3d526b9f33c59f998ad422806505bc1', class: "header" }, h("div", { key: '1f852f0f29ff927d3940c670f5b25206837cc331', class: `month-year ${this.type === 'dropdown' && 'dropdown'}` }, h("cura-icon", { key: '697fda3903f24611628fe24a7f669ab87474aeab', class: `icon ${this.type === 'dropdown' && 'dropdown'}`, name: "left", color: this.determinePrevButtonColor(), onClick: !this.collapsed ? () => this.updateCurrentMonth('prev') : () => this.updateCurrentWeek('prev') }), this.type === 'dropdown' ? (h("div", { class: "select" }, h("cura-select", { size: "small", class: "drop-month", mode: "transparent", value: months[getMonth(this.currentDate)], onSelected: e => this.onMonthDropdownChange(e) }, months.map((month, index) => (h("cura-select-option", { size: "xsmall", key: index, value: month }, month)))), h("cura-select", { size: "small", class: "drop-year", mode: "transparent", value: getYear(this.currentDate).toString(), onSelected: e => this.onYearDropdownChange(e) }, this.fetchYearList().map((year, index) => (h("cura-select-option", { key: index, value: year.toString() }, year.toString())))))) : (h("cura-label", { color: "neutral-black", size: "large" }, months[getMonth(this.currentDate)].slice(0, 3), ", ", getYear(this.currentDate))), h("cura-icon", { key: '6b7f0694e978b0807c4e54629cda68f2fde27c8a', class: `icon ${this.type === 'dropdown' && 'dropdown'}`, name: "right", color: "primary-base", onClick: !this.collapsed ? () => this.updateCurrentMonth('next') : () => this.updateCurrentWeek('next') }))), h("span", { key: '5a151331c2c9872cf3b50bbaea7c9b92b1476297', class: "days-of-week" }, this.fetchWeekDays().map((day, index) => (h("cura-label", { class: "day", size: "xsmall", color: "neutral-black", weight: "bold", key: index }, day === 'sab' ? 'SÁB' : day.toLocaleUpperCase())))), h("div", { key: '7eeb57ed5dc104c953343697a205a922a1b2b912', class: "dates" }, !this.collapsed
|
|
4030
4030
|
? this.fetchDaysOfMonth().map((day, index) => (h("div", { key: index, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : '')))
|
|
4031
4031
|
: this.fetchDaysOfWeek().map((day, index) => (h("div", { key: index, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : '')))), this.collapsed !== null ? (this.collapsed ? (h("div", { class: "collapsed-container" }, h("cura-button-transparent", { onClick: () => this.showNotColapsedCalendar(), size: "small", color: "primary", fontColor: "dark", iconName: "plusCircle" }, "Veja mais datas"))) : (h("div", { class: "collapsed-container" }, h("cura-button-transparent", { onClick: () => this.showColapsedCalendar(), size: "small", color: "primary", fontColor: "dark", iconName: "minusCircle" }, "Veja menos datas")))) : null)));
|
|
4032
4032
|
}
|
|
@@ -41,7 +41,7 @@ const CuraCard$1 = /*@__PURE__*/ proxyCustomElement(class CuraCard extends HTMLE
|
|
|
41
41
|
return classes;
|
|
42
42
|
}
|
|
43
43
|
render() {
|
|
44
|
-
return (h(Host, { key: '
|
|
44
|
+
return (h(Host, { key: 'db1a13cfe3bb925300e65641e1d45fade5a03f52', role: this.href ? 'link' : 'div' }, this.href ? (h("a", { class: this.getClasses(), target: this.target, style: this.styles, href: this.href }, h("slot", null))) : (h("div", { class: this.getClasses(), style: this.styles }, h("slot", null)))));
|
|
45
45
|
}
|
|
46
46
|
static get style() { return CuraCardStyle0; }
|
|
47
47
|
}, [1, "cura-card", {
|
|
@@ -159,7 +159,7 @@ const CuraCheckbox$1 = /*@__PURE__*/ proxyCustomElement(class CuraCheckbox exten
|
|
|
159
159
|
return h("cura-icon", { class: "icon", name: iconName, size: iconSize, color: iconColor });
|
|
160
160
|
}
|
|
161
161
|
render() {
|
|
162
|
-
return (h(Host, { key: '
|
|
162
|
+
return (h(Host, { key: '29437631c4078574a1123fcd27f471efd6738a2c' }, h("div", { key: '3821e17c78c011a7ab1fb4ab148258fe85be7d19', class: this.getClasses(), style: this.styles, onClick: this.handleClick }, h("div", { key: '0f868dfa5f35c3cd11d870eca977bb2a9c67a7d7', class: "info" }, h("div", { key: '05cf807789ad779bf90946926176a2a17b1c4704', class: "label-wrapper" }, h("cura-label", { key: '979497d243d7296f2c8bb5347ab01d2e12568c01', class: "label", weight: 'bold', size: this.size === 'large' ? 'medium' : 'xsmall', color: this.assignColor('label') }, this.label), this.required && h("cura-paragraph", { key: 'a8e3a3b6a891bb4c2ade3271fe8d11674770c160', lineHeight: '0%', marginBlock: '0', color: "error-base" }, "* ")), h("cura-label", { key: 'afcd5016c3f232e05684b38e8ec97d6e604b8f12', color: this.assignColor('message'), size: "xsmall", class: "message" }, h("slot", { key: 'af27633296d454363d71d5b27227c40a26a4e119' }))), h("div", { key: 'd357e30a36326de76d1cd91332a32e3befeb03a9', class: 'checkbox', tabIndex: this.ontabindex }, h("input", { key: '0ef63518fced76e52746b79cd598f96065f83a60', type: "checkbox", name: this.name, value: this.value, disabled: this.disabled, required: this.required, checked: this.checked, indeterminate: this.indeterminate }), this.getIcon()))));
|
|
163
163
|
}
|
|
164
164
|
static get formAssociated() { return true; }
|
|
165
165
|
get host() { return this; }
|
|
@@ -67,7 +67,7 @@ const CuraDisplay$1 = /*@__PURE__*/ proxyCustomElement(class CuraDisplay extends
|
|
|
67
67
|
return tags[`${this.level}`] || tags['default'];
|
|
68
68
|
}
|
|
69
69
|
render() {
|
|
70
|
-
return (h(Host, { key: '
|
|
70
|
+
return (h(Host, { key: '32758f666bb547d7cd3646694e8cc132a795bc44', style: this.hostCSSProperties() }, this.getHeadingTag()));
|
|
71
71
|
}
|
|
72
72
|
get host() { return this; }
|
|
73
73
|
static get watchers() { return {
|
|
@@ -11,7 +11,7 @@ const CuraDropdownSearchOptionTitle$1 = /*@__PURE__*/ proxyCustomElement(class C
|
|
|
11
11
|
this.__attachShadow();
|
|
12
12
|
}
|
|
13
13
|
render() {
|
|
14
|
-
return (h(Host, { key: '
|
|
14
|
+
return (h(Host, { key: 'ff083af27d3250e4722c6f238b80b33f739cb64c', slot: "dropdown-search-option" }, h("cura-label", { key: '62e9b2a758e000eb1ce5e5a76c1e9e555b5a4c8c', color: "neutral-dark", size: "xsmall", lineHeight: "16px", marginBlock: "0" }, h("slot", { key: 'e96fd0daa9b210bdea256d88c17b6cc9c425c5bc' }))));
|
|
15
15
|
}
|
|
16
16
|
static get style() { return CuraDropdownSearchOptionTitleStyle0; }
|
|
17
17
|
}, [1, "cura-dropdown-search-option-title"]);
|
|
@@ -45,12 +45,12 @@ const CuraDropdownSearchOption$1 = /*@__PURE__*/ proxyCustomElement(class CuraDr
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
render() {
|
|
48
|
-
return (h(Host, { key: '
|
|
48
|
+
return (h(Host, { key: '333293644b47d0b7b8e288cf6a81e3e8916a82bd', slot: "dropdown-search-option" }, h("div", { key: '5a7f789204607805d65c3b0a586ffdeb54c10a02', style: this.styles, class: {
|
|
49
49
|
"option-container": true,
|
|
50
50
|
hovered: this.selectable ? this.hovered : false,
|
|
51
51
|
selected: this.selected,
|
|
52
52
|
disabled: !this.selectable
|
|
53
|
-
} }, h("div", { key: '
|
|
53
|
+
} }, h("div", { key: '7ba5fd8f0f35fe0b5856fdaeedf09c7cb8d4fd24', class: "content-container" }, h("div", { key: '6618b6f7248e43be1f6915800662d48bf3a08f7c', class: "option-info", onClick: (e) => this.handleOptionClick(e) }, h("slot", { key: 'c8c6d3a059d221ae3871f2cb048cb6145bec3546', name: "image" }), h("cura-heading", { key: '4678a347d5211c38c9e05dded43ab68840cebca2', size: "xsmall", lineHeight: "16px", marginBlock: "0px", weight: "bold", color: "neutral-black" }, h("slot", { key: '97a34c9bb70e3aaf34fb3ead81ef5e6a0cd05782' }))), h("slot", { key: 'fecb411b2de2c169f01cf1a8c1ca2ed14ee049e9', name: "action" })))));
|
|
54
54
|
}
|
|
55
55
|
get hostElement() { return this; }
|
|
56
56
|
static get watchers() { return {
|
|
@@ -22,20 +22,10 @@ const CuraDropdownSearch$1 = /*@__PURE__*/ proxyCustomElement(class CuraDropdown
|
|
|
22
22
|
const isKeyboardOpen = window.innerHeight < window.screen.height * 0.8;
|
|
23
23
|
const dropdown = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.dropdown-mobile');
|
|
24
24
|
if (dropdown) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
dropdown.style.position = 'fixed';
|
|
31
|
-
dropdown.style.bottom = '0';
|
|
32
|
-
}
|
|
25
|
+
dropdown.style.position = isKeyboardOpen ? 'absolute' : 'fixed';
|
|
26
|
+
dropdown.style.bottom = isKeyboardOpen ? `${window.screen.height - window.innerHeight}px` : '0';
|
|
27
|
+
window.scroll({ top: 0, left: 0, behavior: 'smooth' });
|
|
33
28
|
}
|
|
34
|
-
window.scroll({
|
|
35
|
-
top: 0,
|
|
36
|
-
left: 0,
|
|
37
|
-
behavior: 'smooth',
|
|
38
|
-
});
|
|
39
29
|
});
|
|
40
30
|
};
|
|
41
31
|
this.handleSlotChange = () => {
|
|
@@ -73,6 +63,7 @@ const CuraDropdownSearch$1 = /*@__PURE__*/ proxyCustomElement(class CuraDropdown
|
|
|
73
63
|
this.showOverlay();
|
|
74
64
|
}
|
|
75
65
|
else {
|
|
66
|
+
this.resetDropdownStyles();
|
|
76
67
|
this.removeOverlay();
|
|
77
68
|
}
|
|
78
69
|
}
|
|
@@ -97,6 +88,7 @@ const CuraDropdownSearch$1 = /*@__PURE__*/ proxyCustomElement(class CuraDropdown
|
|
|
97
88
|
this.isOnBlurInput = true;
|
|
98
89
|
this.hoveredIndex = -1;
|
|
99
90
|
this.options = [];
|
|
91
|
+
this.originalOverflow = '';
|
|
100
92
|
}
|
|
101
93
|
connectedCallback() {
|
|
102
94
|
this.weights = window.CuraAPI.theme.fonts.getWeights();
|
|
@@ -148,12 +140,15 @@ const CuraDropdownSearch$1 = /*@__PURE__*/ proxyCustomElement(class CuraDropdown
|
|
|
148
140
|
this.overlayElement.style.zIndex = '9999';
|
|
149
141
|
this.overlayElement.style.backgroundColor = 'white';
|
|
150
142
|
document.body.appendChild(this.overlayElement);
|
|
143
|
+
this.originalOverflow = document.body.style.overflow;
|
|
144
|
+
document.body.style.overflow = 'hidden';
|
|
151
145
|
}
|
|
152
146
|
}
|
|
153
147
|
removeOverlay() {
|
|
154
148
|
if (this.overlayElement && this.overlayElement.parentNode === document.body) {
|
|
155
149
|
document.body.removeChild(this.overlayElement);
|
|
156
150
|
this.overlayElement = null;
|
|
151
|
+
document.body.style.overflow = this.originalOverflow;
|
|
157
152
|
}
|
|
158
153
|
}
|
|
159
154
|
addClickListenersToOptions() {
|
|
@@ -177,6 +172,7 @@ const CuraDropdownSearch$1 = /*@__PURE__*/ proxyCustomElement(class CuraDropdown
|
|
|
177
172
|
this.updateSelectedOption(this.value);
|
|
178
173
|
this.isDropdownOpen = false;
|
|
179
174
|
this.isOnBlurInput = true;
|
|
175
|
+
this.resetDropdownStyles();
|
|
180
176
|
this.removeOverlay();
|
|
181
177
|
}
|
|
182
178
|
}
|
|
@@ -216,6 +212,7 @@ const CuraDropdownSearch$1 = /*@__PURE__*/ proxyCustomElement(class CuraDropdown
|
|
|
216
212
|
if (this.isOnBlurInput === true) {
|
|
217
213
|
setTimeout(() => {
|
|
218
214
|
this.isDropdownOpen = false;
|
|
215
|
+
this.resetDropdownStyles();
|
|
219
216
|
this.removeOverlay();
|
|
220
217
|
}, 200);
|
|
221
218
|
}
|
|
@@ -249,11 +246,23 @@ const CuraDropdownSearch$1 = /*@__PURE__*/ proxyCustomElement(class CuraDropdown
|
|
|
249
246
|
this.host.style.setProperty('--dynamic-input-search-height', `${dropdownInputSearchElement.offsetHeight}px`);
|
|
250
247
|
}
|
|
251
248
|
}
|
|
249
|
+
handleGoBack() {
|
|
250
|
+
this.resetDropdownStyles();
|
|
251
|
+
this.isMobile = false;
|
|
252
|
+
}
|
|
253
|
+
resetDropdownStyles() {
|
|
254
|
+
var _a;
|
|
255
|
+
const dropdown = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.dropdown-mobile');
|
|
256
|
+
if (dropdown && dropdown.style.position === 'fixed') {
|
|
257
|
+
dropdown.style.position = 'relative';
|
|
258
|
+
dropdown.style.removeProperty('bottom');
|
|
259
|
+
}
|
|
260
|
+
}
|
|
252
261
|
render() {
|
|
253
262
|
const isMobileDropdown = this.isMobile && this.isDropdownOpen;
|
|
254
|
-
return (h(Host, { key: '
|
|
263
|
+
return (h(Host, { key: '5acd835c67558501ac74915597423754c1d412ea', style: this.hostCSSProperties(), class: "dropdown-overlay" }, h("div", { key: 'cb0ca2ec4f574f95897163726f81b75b18a4505e', class: `dropdown ${isMobileDropdown ? 'dropdown-mobile' : ''}`, style: this.styles }, h("div", { key: 'c6eac11c0c3420e35b7432af8748976f32814851', class: this.getClasses() }, this.isMobile && this.isDropdownOpen && (h("cura-button-transparent", { key: 'd1cd468c497877ad7f4f22a5dd1bc5bc662bfa6e', fontColor: "dark", onClick: () => this.handleGoBack(), iconName: "arrowLeft", size: "medium", iconOnly: true, color: "primary" })), h("cura-input-text", { key: '35f3943ecd4966a1d27ed9e4fba4de08376dd767', disabled: this.disabled, label: this.label, part: "cura-input-field", mode: isMobileDropdown ? 'transparent' : 'default', required: this.required, hideErrorIcon: this.status === 'error', iconName: this.iconName || 'search', value: this.value, status: this.status, onValueChange: e => this.onValueChange(e.target.value), onInput: e => this.handleInputChange(e), onFocus: () => this.handleOnFocus(), onClick: () => (window.innerWidth < 768 ? (this.isMobile = true) : null), onBlur: () => {
|
|
255
264
|
this.handleOnBlur();
|
|
256
|
-
}, placeholder: this.placeholder, size: this.size, onKeyDown: this.handleKeyDown }, h("slot", { key: '
|
|
265
|
+
}, placeholder: this.placeholder, size: this.size, onKeyDown: this.handleKeyDown }, h("slot", { key: '13cffd23e80ec86b266c5b109b2e8ecb89f28944', name: "helperText" }))), h("div", { key: 'f0047c0b74057fbf21893f3c92fcaf97db59e544', id: "dropdown-search-list", class: this.getDropdownClasses() }, h("slot", { key: '386584475924a3a621308e50697c49bcbe5f1bae', name: "dropdown-search-option", onSlotchange: this.handleSlotChange })))));
|
|
257
266
|
}
|
|
258
267
|
get host() { return this; }
|
|
259
268
|
static get watchers() { return {
|
|
@@ -280,7 +289,8 @@ const CuraDropdownSearch$1 = /*@__PURE__*/ proxyCustomElement(class CuraDropdown
|
|
|
280
289
|
"inputTextRef": [32],
|
|
281
290
|
"isOnBlurInput": [32],
|
|
282
291
|
"hoveredIndex": [32],
|
|
283
|
-
"options": [32]
|
|
292
|
+
"options": [32],
|
|
293
|
+
"originalOverflow": [32]
|
|
284
294
|
}, undefined, {
|
|
285
295
|
"value": ["onValueChange"]
|
|
286
296
|
}]);
|