@rededor/cura 1.4.0 → 1.5.0-alpha.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 → cura-accordion_13.cjs.entry.js} +77 -12
- package/dist/cjs/cura-accordion_13.cjs.entry.js.map +1 -0
- 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 +2 -2
- package/dist/cjs/cura-badge-counter.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-badge-dot.cjs.entry.js +44 -0
- package/dist/cjs/cura-badge-dot.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-badge-pill.cjs.entry.js +2 -1
- package/dist/cjs/cura-badge-pill.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-button-outline.cjs.entry.js +1 -1
- package/dist/cjs/cura-button-select.cjs.entry.js +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 +27 -21
- package/dist/cjs/cura-dropdown-search.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-icons-view.cjs.entry.js +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-progress-bar_2.cjs.entry.js +98 -0
- package/dist/cjs/cura-progress-bar_2.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-radio.cjs.entry.js +1 -1
- package/dist/cjs/cura-stepper.cjs.entry.js +123 -0
- package/dist/cjs/cura-stepper.cjs.entry.js.map +1 -0
- 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 +9 -8
- package/dist/cjs/cura-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/cura.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +4 -0
- package/dist/collection/components/badges/cura-badge-counter/cura-badge-counter.js +2 -2
- package/dist/collection/components/badges/cura-badge-counter/cura-badge-counter.js.map +1 -1
- package/dist/collection/components/badges/cura-badge-dot/cura-badge-dot.css +61 -0
- package/dist/collection/components/badges/cura-badge-dot/cura-badge-dot.js +108 -0
- package/dist/collection/components/badges/cura-badge-dot/cura-badge-dot.js.map +1 -0
- package/dist/collection/components/badges/cura-badge-dot/cura-badge-dot.stories.js +65 -0
- package/dist/collection/components/badges/cura-badge-dot/cura-badge-dot.stories.js.map +1 -0
- package/dist/collection/components/badges/cura-badge-pill/cura-badge-pill.js +2 -1
- package/dist/collection/components/badges/cura-badge-pill/cura-badge-pill.js.map +1 -1
- 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 +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.js +1 -1
- package/dist/collection/components/cura-icons-view/cura-icons-view.js +1 -1
- package/dist/collection/components/cura-modal/cura-modal.css +3 -3
- package/dist/collection/components/cura-modal/cura-modal.js +39 -1
- package/dist/collection/components/cura-modal/cura-modal.js.map +1 -1
- package/dist/collection/components/cura-modal/cura-modal.stories.js +18 -0
- 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-stepper/cura-progress-bar/cura-progress-bar.css +15 -0
- package/dist/collection/components/cura-stepper/cura-progress-bar/cura-progress-bar.js +121 -0
- package/dist/collection/components/cura-stepper/cura-progress-bar/cura-progress-bar.js.map +1 -0
- package/dist/collection/components/cura-stepper/cura-stepper-item/cura-stepper-item.css +10 -0
- package/dist/collection/components/cura-stepper/cura-stepper-item/cura-stepper-item.js +153 -0
- package/dist/collection/components/cura-stepper/cura-stepper-item/cura-stepper-item.js.map +1 -0
- package/dist/collection/components/cura-stepper/cura-stepper.css +72 -0
- package/dist/collection/components/cura-stepper/cura-stepper.js +227 -0
- package/dist/collection/components/cura-stepper/cura-stepper.js.map +1 -0
- package/dist/collection/components/cura-stepper/cura-stepper.stories.js +97 -0
- package/dist/collection/components/cura-stepper/cura-stepper.stories.js.map +1 -0
- package/dist/collection/components/cura-stepper/stepper.type.js +2 -0
- package/dist/collection/components/cura-stepper/stepper.type.js.map +1 -0
- package/dist/collection/components/cura-toast/cura-toast.js +1 -1
- package/dist/collection/components/cura-tooltip/cura-tooltip.js +9 -8
- package/dist/collection/components/cura-tooltip/cura-tooltip.js.map +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.css +4 -2
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js +28 -21
- 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/cura-select.stories.js +1 -1
- package/dist/collection/components/forms/cura-select/cura-select.stories.js.map +1 -1
- 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/components/cura-alert.js +1 -1
- package/dist/components/cura-avatar.js +1 -1
- package/dist/components/cura-badge-counter2.js +2 -2
- package/dist/components/cura-badge-counter2.js.map +1 -1
- package/dist/components/cura-badge-dot.d.ts +11 -0
- package/dist/components/cura-badge-dot.js +63 -0
- package/dist/components/cura-badge-dot.js.map +1 -0
- package/dist/components/cura-badge-pill.js +1 -113
- package/dist/components/cura-badge-pill.js.map +1 -1
- package/dist/components/cura-badge-pill2.js +118 -0
- package/dist/components/cura-badge-pill2.js.map +1 -0
- package/dist/components/cura-button-outline.js +1 -1
- package/dist/components/cura-button-select.js +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 +29 -22
- package/dist/components/cura-dropdown-search.js.map +1 -1
- package/dist/components/cura-heading2.js +1 -1
- package/dist/components/cura-icon2.js +1 -1
- package/dist/components/cura-icons-view.js +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 +6 -2
- 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-progress-bar.d.ts +11 -0
- package/dist/components/cura-progress-bar.js +8 -0
- package/dist/components/cura-progress-bar.js.map +1 -0
- package/dist/components/cura-progress-bar2.js +48 -0
- package/dist/components/cura-progress-bar2.js.map +1 -0
- 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-stepper-item.d.ts +11 -0
- package/dist/components/cura-stepper-item.js +8 -0
- package/dist/components/cura-stepper-item.js.map +1 -0
- package/dist/components/cura-stepper-item2.js +116 -0
- package/dist/components/cura-stepper-item2.js.map +1 -0
- package/dist/components/cura-stepper.d.ts +11 -0
- package/dist/components/cura-stepper.js +187 -0
- package/dist/components/cura-stepper.js.map +1 -0
- package/dist/components/cura-switch.js +1 -1
- package/dist/components/cura-toast.js +1 -1
- package/dist/components/cura-tooltip.js +9 -8
- package/dist/components/cura-tooltip.js.map +1 -1
- package/dist/components/index.js +8 -0
- 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-a91d451f.entry.js → p-04006a3e.entry.js} +2 -2
- package/dist/cura/{p-576c65b4.entry.js → p-0a133399.entry.js} +2 -2
- package/dist/cura/{p-116a1cd6.entry.js → p-164ddb46.entry.js} +2 -2
- package/dist/cura/{p-36dbec98.entry.js → p-235ac0b4.entry.js} +2 -2
- package/dist/cura/p-23fa2246.entry.js +2 -0
- package/dist/cura/p-23fa2246.entry.js.map +1 -0
- package/dist/cura/{p-c4da4c44.entry.js → p-2af6216a.entry.js} +2 -2
- package/dist/cura/{p-3d958d45.entry.js → p-3c0931d3.entry.js} +2 -2
- package/dist/cura/{p-3eca0f0c.entry.js → p-46b21329.entry.js} +2 -2
- package/dist/cura/{p-bdb1a0c5.entry.js → p-4aefe237.entry.js} +2 -2
- package/dist/cura/{p-aa65cb50.entry.js → p-529332d3.entry.js} +2 -2
- package/dist/cura/{p-aa65cb50.entry.js.map → p-529332d3.entry.js.map} +1 -1
- package/dist/cura/{p-19f28fa8.entry.js → p-545e8e55.entry.js} +2 -2
- package/dist/cura/p-557b90c4.entry.js +2 -0
- package/dist/cura/p-557b90c4.entry.js.map +1 -0
- package/dist/cura/p-6624108e.entry.js +2 -0
- package/dist/cura/p-6b627841.entry.js +2 -0
- package/dist/cura/p-6b627841.entry.js.map +1 -0
- package/dist/cura/{p-ef593f12.entry.js → p-6f1a3fe5.entry.js} +2 -2
- package/dist/cura/p-6f1a3fe5.entry.js.map +1 -0
- package/dist/cura/{p-52f854e0.entry.js → p-7ba80d78.entry.js} +2 -2
- package/dist/cura/{p-52f854e0.entry.js.map → p-7ba80d78.entry.js.map} +1 -1
- package/dist/cura/p-8622c492.entry.js +2 -0
- package/dist/cura/p-8622c492.entry.js.map +1 -0
- package/dist/cura/{p-42258230.entry.js → p-a5af4225.entry.js} +2 -2
- package/dist/cura/{p-b1a51e81.entry.js → p-a7c60a4e.entry.js} +2 -2
- package/dist/cura/{p-2545cfc7.entry.js → p-b3e93e74.entry.js} +2 -2
- package/dist/cura/{p-dcd2e5bb.entry.js → p-bce10f9b.entry.js} +2 -2
- package/dist/cura/p-cfbe2bce.entry.js +2 -0
- package/dist/cura/p-cfbe2bce.entry.js.map +1 -0
- package/dist/cura/{p-818c581f.entry.js → p-d13e3295.entry.js} +2 -2
- package/dist/cura/{p-e1a41792.entry.js → p-ec7876d3.entry.js} +2 -2
- package/dist/cura/{p-4b496c51.entry.js → p-f96b0923.entry.js} +2 -2
- package/dist/esm/{cura-accordion_12.entry.js → cura-accordion_13.entry.js} +77 -13
- package/dist/esm/cura-accordion_13.entry.js.map +1 -0
- 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 +2 -2
- package/dist/esm/cura-badge-counter.entry.js.map +1 -1
- package/dist/esm/cura-badge-dot.entry.js +40 -0
- package/dist/esm/cura-badge-dot.entry.js.map +1 -0
- package/dist/esm/cura-badge-pill.entry.js +2 -1
- package/dist/esm/cura-badge-pill.entry.js.map +1 -1
- package/dist/esm/cura-button-outline.entry.js +1 -1
- package/dist/esm/cura-button-select.entry.js +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 +27 -21
- package/dist/esm/cura-dropdown-search.entry.js.map +1 -1
- package/dist/esm/cura-icons-view.entry.js +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-progress-bar_2.entry.js +93 -0
- package/dist/esm/cura-progress-bar_2.entry.js.map +1 -0
- package/dist/esm/cura-radio.entry.js +1 -1
- package/dist/esm/cura-stepper.entry.js +119 -0
- package/dist/esm/cura-stepper.entry.js.map +1 -0
- 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 +9 -8
- package/dist/esm/cura-tooltip.entry.js.map +1 -1
- package/dist/esm/cura.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/badges/cura-badge-dot/cura-badge-dot.d.ts +24 -0
- package/dist/types/components/badges/cura-badge-dot/cura-badge-dot.stories.d.ts +53 -0
- package/dist/types/components/cura-modal/cura-modal.d.ts +10 -0
- package/dist/types/components/cura-modal/cura-modal.stories.d.ts +20 -0
- package/dist/types/components/cura-stepper/cura-progress-bar/cura-progress-bar.d.ts +23 -0
- package/dist/types/components/cura-stepper/cura-stepper-item/cura-stepper-item.d.ts +60 -0
- package/dist/types/components/cura-stepper/cura-stepper.d.ts +62 -0
- package/dist/types/components/cura-stepper/cura-stepper.stories.d.ts +77 -0
- package/dist/types/components/cura-stepper/stepper.type.d.ts +4 -0
- package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.d.ts +3 -1
- package/dist/types/components/forms/cura-select/cura-select.stories.d.ts +1 -1
- package/dist/types/components.d.ts +206 -0
- package/package.json +2 -2
- package/dist/cjs/cura-accordion_12.cjs.entry.js.map +0 -1
- package/dist/cjs/cura-modal.cjs.entry.js +0 -71
- package/dist/cjs/cura-modal.cjs.entry.js.map +0 -1
- package/dist/cura/p-35920ac0.entry.js +0 -2
- package/dist/cura/p-35920ac0.entry.js.map +0 -1
- package/dist/cura/p-3e4ca7e7.entry.js +0 -2
- package/dist/cura/p-3e4ca7e7.entry.js.map +0 -1
- package/dist/cura/p-ef593f12.entry.js.map +0 -1
- package/dist/cura/p-f23c4ed8.entry.js +0 -2
- package/dist/cura/p-f23c4ed8.entry.js.map +0 -1
- package/dist/cura/p-f5d45776.entry.js +0 -2
- package/dist/esm/cura-accordion_12.entry.js.map +0 -1
- package/dist/esm/cura-modal.entry.js +0 -67
- package/dist/esm/cura-modal.entry.js.map +0 -1
- /package/dist/cura/{p-a91d451f.entry.js.map → p-04006a3e.entry.js.map} +0 -0
- /package/dist/cura/{p-576c65b4.entry.js.map → p-0a133399.entry.js.map} +0 -0
- /package/dist/cura/{p-116a1cd6.entry.js.map → p-164ddb46.entry.js.map} +0 -0
- /package/dist/cura/{p-36dbec98.entry.js.map → p-235ac0b4.entry.js.map} +0 -0
- /package/dist/cura/{p-c4da4c44.entry.js.map → p-2af6216a.entry.js.map} +0 -0
- /package/dist/cura/{p-3d958d45.entry.js.map → p-3c0931d3.entry.js.map} +0 -0
- /package/dist/cura/{p-3eca0f0c.entry.js.map → p-46b21329.entry.js.map} +0 -0
- /package/dist/cura/{p-bdb1a0c5.entry.js.map → p-4aefe237.entry.js.map} +0 -0
- /package/dist/cura/{p-19f28fa8.entry.js.map → p-545e8e55.entry.js.map} +0 -0
- /package/dist/cura/{p-f5d45776.entry.js.map → p-6624108e.entry.js.map} +0 -0
- /package/dist/cura/{p-42258230.entry.js.map → p-a5af4225.entry.js.map} +0 -0
- /package/dist/cura/{p-b1a51e81.entry.js.map → p-a7c60a4e.entry.js.map} +0 -0
- /package/dist/cura/{p-2545cfc7.entry.js.map → p-b3e93e74.entry.js.map} +0 -0
- /package/dist/cura/{p-dcd2e5bb.entry.js.map → p-bce10f9b.entry.js.map} +0 -0
- /package/dist/cura/{p-818c581f.entry.js.map → p-d13e3295.entry.js.map} +0 -0
- /package/dist/cura/{p-e1a41792.entry.js.map → p-ec7876d3.entry.js.map} +0 -0
- /package/dist/cura/{p-4b496c51.entry.js.map → p-f96b0923.entry.js.map} +0 -0
|
@@ -24,7 +24,7 @@ const CuraIconsView = class {
|
|
|
24
24
|
this.sizes.unshift(this.sizes.pop());
|
|
25
25
|
}
|
|
26
26
|
render() {
|
|
27
|
-
return (index.h(index.Host, { key: '
|
|
27
|
+
return (index.h(index.Host, { key: '4918bc5d13f24f3133af45ce5991b3f3f43e99cf' }, index.h("div", { key: '837d47976a39702b13ceb5a7c5ac8ae097d34988', class: "iconDetail" }, index.h("cura-heading", { key: 'de4c75c4652b464991aa173cf7243db65f9ba2ba', size: "small", "margin-block": "0 24px" }, "Icon: ", index.h("b", { key: '77591ce199e5140ddcde3d7b956586d27fe6bc05' }, this.selected)), index.h("div", { key: '6da36b174603d48ab3b11a8490c424f164855147', class: "iconSizes" }, this.sizes.map(size => index.h("div", { class: "size" }, index.h("cura-icon", { name: this.selected, size: size }), index.h("span", null, size)))), index.h("div", { key: '4920c8010e0a55f80bb557f4ba0e537b7861ae36', class: "iconSizes invert" }, this.sizes.map(size => index.h("div", { class: "size" }, index.h("cura-icon", { name: this.selected, size: size, color: "neutral-white" }), index.h("span", null, size))))), index.h("div", { key: '99739b351fb25036efd4b55774c0f077058be8fc', class: "icons" }, iconsetdefaulticons.map(icon => index.h("div", { class: { icon: true, selected: icon === this.selected }, onClick: () => this.setSelected(icon) }, index.h("cura-icon", { name: icon, size: "32", color: icon === this.selected ? 'accent-dark' : 'neutral-dark' }), index.h("cura-label", { size: "xsmall", weight: icon === this.selected ? 'bold' : 'regular', color: icon === this.selected ? 'accent-dark' : 'neutral-dark' }, icon))))));
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
CuraIconsView.style = CuraIconsViewStyle0;
|
|
@@ -173,7 +173,7 @@ const CuraInputDate = class {
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
render() {
|
|
176
|
-
return (index.h(index.Host, { key: '
|
|
176
|
+
return (index.h(index.Host, { key: '1395108764c1957abb9371b82ab983d076aaf61e' }, index.h("div", { key: 'e3134a1cfbf6f07b83f148b3e1b9c699e273a098', class: "container", style: this.styles }, index.h("cura-input-text", { key: '507ce8cedd5a169832579ae3ea313d3b3d6813d2', label: this.label, name: this.name, status: this.status, value: this.value, onFocus: () => this.showCalendar(), size: this.size, "icon-name": this.iconName, placeholder: this.dateSettings.placeholder, "mask-preset": this.dateSettings.mask, "enable-selection-mode": true, onKeyUp: event => this.handleInputDates(event), autocomplete: "off", onValueChange: event => this.handleChangeDates(event) }, this.renderCalendarOrHelperText()))));
|
|
177
177
|
}
|
|
178
178
|
static get formAssociated() { return true; }
|
|
179
179
|
get el() { return index.getElement(this); }
|
|
@@ -25,7 +25,7 @@ const CuraLoaderBar = class {
|
|
|
25
25
|
this.setProgress();
|
|
26
26
|
}
|
|
27
27
|
render() {
|
|
28
|
-
return (index.h(index.Host, { key: '
|
|
28
|
+
return (index.h(index.Host, { key: 'ae36cc67cb0b22bf0156ee1cc41472ea74cee0a9' }, index.h("div", { key: 'd3cc5382d1b4967ab7622f4b71dfb51d2e913ddb', id: "progress-bar", class: "progress-bar", style: this.styles }, index.h("span", { key: '9a34c97d65e4cb4692371b876304175610770098', class: "progress-bar-fill" }))));
|
|
29
29
|
}
|
|
30
30
|
setColor() {
|
|
31
31
|
this.styles = Object.assign(Object.assign({}, this.styles), { '--neutral-base': window.CuraAPI.theme.colors.getColor(`neutral-base`, 0.2), '--color-base': window.CuraAPI.theme.colors.getColor(this.color) });
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-e6d728ec.js');
|
|
6
|
+
|
|
7
|
+
const curaProgressBarCss = ":host{display:block;box-sizing:border-box}.progress-bar{position:relative;display:flex;align-items:center;justify-content:center}.progress-bar span{position:absolute;display:flex}";
|
|
8
|
+
const CuraProgressBarStyle0 = curaProgressBarCss;
|
|
9
|
+
|
|
10
|
+
const CuraProgressBar = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
this.progressColor = undefined;
|
|
14
|
+
this.progress = undefined;
|
|
15
|
+
this.size = 40;
|
|
16
|
+
this.strokeWidth = 3.25;
|
|
17
|
+
this.active = undefined;
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
const radius = (this.size - this.strokeWidth) / 2;
|
|
21
|
+
const circumference = radius * Math.PI * 2;
|
|
22
|
+
const dash = (this.progress * circumference) / 100;
|
|
23
|
+
const viewBox = `0 0 ${this.size} ${this.size}`;
|
|
24
|
+
return (index.h(index.Host, { key: 'e0da7ede087161c67c9dd0371d15030dd5107a19' }, index.h("div", { key: 'ebe68fb426b46e94b7d03ded4e8aaed852337f30', class: "progress-bar" }, index.h("svg", { key: 'ace46878d45bfbe51dae29c3020d74f43c2f5147', width: this.size, height: this.size, viewBox: viewBox }, index.h("circle", { key: 'dbbde61a95a7f13dc14a72fe538da43953852d7b', fill: "none", stroke: "#ccc", cx: this.size / 2, cy: this.size / 2, r: radius, "stroke-width": `${this.strokeWidth}px` }), this.active && (index.h("circle", { key: '272c197451a47c73cfa91d7f7578a50b26958732', fill: "none", stroke: this.progressColor, cx: this.size / 2, cy: this.size / 2, r: radius, "stroke-width": `${this.strokeWidth}px`, transform: `rotate(-90 ${this.size / 2} ${this.size / 2})`, "stroke-dasharray": `${dash}px ${circumference - dash}px`, "stroke-linecap": "round", style: { transition: 'all 0.5s' } }))), index.h("span", { key: 'a80f024e09fb54218fe97039459472855226c063' }, index.h("slot", { key: '5683f5edd5b54bd852fc1036b284656bfda066c4' })))));
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
CuraProgressBar.style = CuraProgressBarStyle0;
|
|
28
|
+
|
|
29
|
+
const curaStepperItemCss = ":host{display:block;box-sizing:border-box}.item-container{display:flex;gap:4px;align-items:center}";
|
|
30
|
+
const CuraStepperItemStyle0 = curaStepperItemCss;
|
|
31
|
+
|
|
32
|
+
const CuraStepperItem = class {
|
|
33
|
+
constructor(hostRef) {
|
|
34
|
+
index.registerInstance(this, hostRef);
|
|
35
|
+
this.statusMap = {
|
|
36
|
+
active: {
|
|
37
|
+
badgeColor: 'info',
|
|
38
|
+
textColor: 'info-dark',
|
|
39
|
+
icon: '',
|
|
40
|
+
iconOnly: false,
|
|
41
|
+
},
|
|
42
|
+
stop: {
|
|
43
|
+
badgeColor: 'error',
|
|
44
|
+
textColor: 'error-darker',
|
|
45
|
+
icon: 'alertCircle',
|
|
46
|
+
iconOnly: true,
|
|
47
|
+
},
|
|
48
|
+
done: {
|
|
49
|
+
badgeColor: 'success',
|
|
50
|
+
textColor: 'success-darker',
|
|
51
|
+
icon: 'checkCircle',
|
|
52
|
+
iconOnly: true,
|
|
53
|
+
},
|
|
54
|
+
default: {
|
|
55
|
+
badgeColor: 'neutral',
|
|
56
|
+
textColor: 'neutral',
|
|
57
|
+
icon: '',
|
|
58
|
+
iconOnly: false,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
this.displayHeading = false;
|
|
62
|
+
this.heading = undefined;
|
|
63
|
+
this.label = undefined;
|
|
64
|
+
this.status = 'default';
|
|
65
|
+
this.styles = {};
|
|
66
|
+
}
|
|
67
|
+
connectedCallback() {
|
|
68
|
+
this.updateStyles();
|
|
69
|
+
}
|
|
70
|
+
getStatusProperties() {
|
|
71
|
+
return this.statusMap[this.status] || this.statusMap.default;
|
|
72
|
+
}
|
|
73
|
+
updateStyles() {
|
|
74
|
+
const { fonts, colors, spacing } = window.CuraAPI.theme;
|
|
75
|
+
const weights = fonts.getWeights();
|
|
76
|
+
this.styles = {
|
|
77
|
+
'--base-spacing': spacing.getSpacing(),
|
|
78
|
+
'--neutral-purewhite': colors.getColor('neutral-purewhite'),
|
|
79
|
+
'--neutral-lighter': colors.getColor('neutral-lighter'),
|
|
80
|
+
'--neutral-base': colors.getColor('neutral-base'),
|
|
81
|
+
'--font-size': fonts.getSize(),
|
|
82
|
+
'--font-color': fonts.getColor(),
|
|
83
|
+
'--font-family': fonts.getFamily(),
|
|
84
|
+
'--font-weight-regular': weights.regular,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
render() {
|
|
88
|
+
const { badgeColor, textColor, icon, iconOnly } = this.getStatusProperties();
|
|
89
|
+
return (index.h(index.Host, { key: 'c226daf451d9c861d5303474ef0fc31c1602371b' }, index.h("div", { key: '7aece988946e4bef02c597a80ea1a505c201e188', class: "item-container", style: this.styles }, index.h("cura-badge-pill", { key: 'd0362b4a4ee3c047173399ea5f7c912a5a0f7810', type: "solid", color: badgeColor, "icon-name": icon, "icon-only": iconOnly, "border-radius": "50%" }, this.label), this.displayHeading && this.heading && (index.h("cura-paragraph", { key: '015effecdb26be22386363e77bd5a0e671701d60', marginBlock: "0", size: "xsmall", color: textColor }, this.heading)))));
|
|
90
|
+
}
|
|
91
|
+
get hostElement() { return index.getElement(this); }
|
|
92
|
+
};
|
|
93
|
+
CuraStepperItem.style = CuraStepperItemStyle0;
|
|
94
|
+
|
|
95
|
+
exports.cura_progress_bar = CuraProgressBar;
|
|
96
|
+
exports.cura_stepper_item = CuraStepperItem;
|
|
97
|
+
|
|
98
|
+
//# sourceMappingURL=cura-progress-bar_2.cjs.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"cura-progress-bar.cura-stepper-item.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,kBAAkB,GAAG,qLAAqL,CAAC;AACjN,8BAAe,kBAAkB;;MCMpB,eAAe;;;;;oBAcc,EAAE;2BAKK,IAAI;;;IAOnD,MAAM;QACJ,MAAM,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC;QAClD,MAAM,aAAa,GAAG,MAAM,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QAC3C,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,GAAG,aAAa,IAAI,GAAG,CAAC;QAEnD,MAAM,OAAO,GAAG,OAAO,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QAEhD,QACEA,QAACC,UAAI,uDACHD,kEAAK,KAAK,EAAC,cAAc,IACvBA,kEAAK,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,IACxDA,qEAAQ,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,EAAE,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC,EAAE,MAAM,kBAAgB,GAAG,IAAI,CAAC,WAAW,IAAI,GAAI,EAC3H,IAAI,CAAC,MAAM,KACVA,qEACE,IAAI,EAAC,MAAM,EACX,MAAM,EAAE,IAAI,CAAC,aAAa,EAC1B,EAAE,EAAE,I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,CAAC;KAC9D;IAED,YAAY;QACV,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;QACxD,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC;QAEnC,IAAI,CAAC,MAAM,GAAG;YACZ,gBAAgB,EAAE,OAAO,CAAC,UAAU,EAAE;YACtC,qBAAqB,EAAE,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAC;YAC3D,mBAAmB,EAAE,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAC;YACvD,gBAAgB,EAAE,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC;YACjD,aAAa,EAAE,KAAK,CAAC,OAAO,EAAE;YAC9B,cAAc,EAAE,KAAK,CAAC,QAAQ,EAAE;YAChC,eAAe,EAAE,KAAK,CAAC,SAAS,EAAE;YAClC,uBAAuB,EAAE,OAAO,CAAC,OAAO;SACzC,CAAC;KACH;IAED,MAAM;QACJ,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC7E,QACEA,QAACC,UAAI,uDACHD,kEAAK,KAAK,EAAC,gBAAgB,EAAC,KAAK,EAAE,IAAI,CAAC,MAAM,IAC5CA,8EACE,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,UAAuG,eACnG,IAAI,eACJ,QAAQ,mBACL,KAAK,IAElB,IAAI,CAAC,KAAK,CACK,EACjB,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,OAAO,KAClCA,6EAAgB,WAAW,EAAC,GAAG,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,SAAS,IAC3D,IAAI,CAAC,OAAO,CACE,CAClB,CACG,CACD,EACP;KACH;;;;;;;;","names":["h","Host"],"sources":["src/components/cura-stepper/cura-progress-bar/cura-progress-bar.scss?tag=cura-progress-bar&encapsulation=shadow","src/components/cura-stepper/cura-progress-bar/cura-progress-bar.tsx","src/components/cura-stepper/cura-stepper-item/cura-stepper-item.scss?tag=cura-stepper-item&encapsulation=shadow","src/components/cura-stepper/cura-stepper-item/cura-stepper-item.tsx"],"sourcesContent":[":host {\n display: block;\n box-sizing: border-box;\n}\n\n.progress-bar {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n\n & span {\n position: absolute;\n display: flex;\n }\n}","import { Component, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'cura-progress-bar',\n styleUrl: 'cura-progress-bar.scss',\n shadow: true,\n})\nexport class CuraProgressBar {\n /**\n * Defines the color of the progress bar\n */\n @Prop({ reflect: true }) progressColor: string;\n\n /**\n * Defines the percentage of progress\n */\n @Prop({ reflect: true }) progress: number;\n\n /**\n * Defines the size of the progress bar\n */\n @Prop({ reflect: true }) size: number = 40;\n\n /**\n * Defines the width of the stroke (outline) of the progress circle\n */\n @Prop({ reflect: true }) strokeWidth: number = 3.25;\n\n /**\n * Defines whether the progress bar is active\n */\n @Prop({ reflect: true }) active: boolean;\n\n render() {\n const radius = (this.size - this.strokeWidth) / 2;\n const circumference = radius * Math.PI * 2;\n const dash = (this.progress * circumference) / 100;\n\n const viewBox = `0 0 ${this.size} ${this.size}`;\n\n return (\n <Host>\n <div class=\"progress-bar\">\n <svg width={this.size} height={this.size} viewBox={viewBox}>\n <circle fill=\"none\" stroke=\"#ccc\" cx={this.size / 2} cy={this.size / 2} r={radius} stroke-width={`${this.strokeWidth}px`} />\n {this.active && (\n <circle\n fill=\"none\"\n stroke={this.progressColor}\n cx={this.size / 2}\n cy={this.size / 2}\n r={radius}\n stroke-width={`${this.strokeWidth}px`}\n transform={`rotate(-90 ${this.size / 2} ${this.size / 2})`}\n stroke-dasharray={`${dash}px ${circumference - dash}px`}\n stroke-linecap=\"round\"\n style={{ transition: 'all 0.5s' }}\n />\n )}\n </svg>\n <span>\n <slot></slot>\n </span>\n </div>\n </Host>\n );\n }\n}\n",":host {\n display: block;\n box-sizing: border-box;\n}\n\n.item-container{\n display: flex;\n gap: 4px;\n align-items: center;\n}\n","import { Component, Element, Host, Prop, State, h } from '@stencil/core';\n\n@Component({\n tag: 'cura-stepper-item',\n styleUrl: 'cura-stepper-item.scss',\n shadow: true,\n})\nexport class CuraStepperItem {\n /**\n * Determines if the step title is displayed (default: false)\n */\n @Prop({ reflect: true }) displayHeading: boolean = false;\n\n /**\n * The title of the step (displayed if `displayHeading` is true)\n */\n @Prop({ reflect: true }) heading: string;\n\n /**\n * The label displayed inside the badge\n */\n @Prop({ reflect: true }) label: string;\n\n /**\n * The current status of the step\n * Can be:\n * - 'done' for completed steps\n * - 'stop' for failed steps\n * - 'active' for the current active step\n * - 'default' for steps that are neither done, active nor stopped.\n */\n @Prop({ reflect: true }) status: 'done' | 'stop' | 'active' | 'default' = 'default';\n\n @State() styles = {};\n\n @Element() hostElement: HTMLElement;\n\n connectedCallback() {\n this.updateStyles();\n }\n\n statusMap = {\n active: {\n badgeColor: 'info',\n textColor: 'info-dark',\n icon: '',\n iconOnly: false,\n },\n stop: {\n badgeColor: 'error',\n textColor: 'error-darker',\n icon: 'alertCircle',\n iconOnly: true,\n },\n done: {\n badgeColor: 'success',\n textColor: 'success-darker',\n icon: 'checkCircle',\n iconOnly: true,\n },\n default: {\n badgeColor: 'neutral',\n textColor: 'neutral',\n icon: '',\n iconOnly: false,\n },\n };\n\n getStatusProperties() {\n return this.statusMap[this.status] || this.statusMap.default;\n }\n\n updateStyles() {\n const { fonts, colors, spacing } = window.CuraAPI.theme;\n const weights = fonts.getWeights();\n\n this.styles = {\n '--base-spacing': spacing.getSpacing(),\n '--neutral-purewhite': colors.getColor('neutral-purewhite'),\n '--neutral-lighter': colors.getColor('neutral-lighter'),\n '--neutral-base': colors.getColor('neutral-base'),\n '--font-size': fonts.getSize(),\n '--font-color': fonts.getColor(),\n '--font-family': fonts.getFamily(),\n '--font-weight-regular': weights.regular,\n };\n }\n\n render() {\n const { badgeColor, textColor, icon, iconOnly } = this.getStatusProperties();\n return (\n <Host>\n <div class=\"item-container\" style={this.styles}>\n <cura-badge-pill\n type=\"solid\"\n color={badgeColor as 'info' | 'error' | 'success' | 'neutral' | 'primary' | 'secondary' | 'accent' | 'warning'}\n icon-name={icon}\n icon-only={iconOnly}\n border-radius=\"50%\"\n >\n {this.label}\n </cura-badge-pill>\n {this.displayHeading && this.heading && (\n <cura-paragraph marginBlock=\"0\" size=\"xsmall\" color={textColor}>\n {this.heading}\n </cura-paragraph>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -137,7 +137,7 @@ const CuraRadio = class {
|
|
|
137
137
|
return statusColors[this.status][type];
|
|
138
138
|
}
|
|
139
139
|
render() {
|
|
140
|
-
return (index.h(index.Host, { key: '
|
|
140
|
+
return (index.h(index.Host, { key: 'eecc279b05da57162acf41d62bac48a00cc9d985' }, index.h("div", { key: '279b6922349bf02b7e65065bcb98b9c824073516', class: this.getClasses(), style: this.styles }, index.h("div", { key: 'a6a2de8f8d7e6efbca3aee079255451e448903a2', class: "info" }, index.h("div", { key: '6d2733ca86d087031e1ec4fdea26d5906f695479', class: "label-wrapper" }, index.h("cura-label", { key: '2c0c878411bb846ff7bcf24c385895f1d86b3022', class: "label", size: this.size === 'large' ? 'medium' : 'xsmall', color: this.assignColor('label') }, this.label), this.required && index.h("cura-paragraph", { key: '07abc53858276dc6429381a0c658c562e1d05933', lineHeight: '0%', marginBlock: '0', color: "error-base" }, "* ")), index.h("cura-label", { key: 'ab5c0451842242ee584f2d3b430b803498190118', color: this.assignColor('message'), size: "xsmall", class: "message" }, index.h("slot", { key: '3673a0a1ecc7f9dfa6975bdddaf708ed8ad1b72d' }))), index.h("input", { key: 'db602c601168ada1a5a375d3ef122d4f315fa256', type: "radio", class: `radio ${this.size.toLocaleLowerCase()}`, name: this.name, value: this.value, required: this.required, tabIndex: this.ontabindex, disabled: this.disabled, checked: this.checked, onClick: this.handleClick }))));
|
|
141
141
|
}
|
|
142
142
|
static get formAssociated() { return true; }
|
|
143
143
|
get host() { return index.getElement(this); }
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-e6d728ec.js');
|
|
6
|
+
|
|
7
|
+
const curaStepperCss = ":host{display:block;box-sizing:border-box;width:100%}cura-heading{--margin-block:0 !important}.container{display:flex}.compact{display:flex;padding:0px;justify-content:space-between;align-items:center}.compact .heading{text-align:right}.stepper-list{gap:4px;display:flex;flex-shrink:0;align-items:center;padding:0;flex:1;width:100%;justify-content:space-between}.step{display:flex;align-items:center;flex-direction:row;flex:1;gap:4px}.step .wrapper{flex:1;position:relative}.step .divider{background-color:var(--neutral-light);height:2px;flex:1;transition:all 1s}.step .animation{position:absolute;top:0;left:0;right:0;width:var(--progress-width)}.step .done{background-color:var(--success-light)}.step .stop{background-color:var(--error-light)}.step .active{background-color:var(--info-light)}.last{flex:0}";
|
|
8
|
+
const CuraStepperStyle0 = curaStepperCss;
|
|
9
|
+
|
|
10
|
+
const CuraStepper = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
this.activeStepIndex = undefined;
|
|
14
|
+
this.errorInCurrentStep = false;
|
|
15
|
+
this.displayHeading = false;
|
|
16
|
+
this.variant = 'default';
|
|
17
|
+
this.steps = [];
|
|
18
|
+
this.styles = {};
|
|
19
|
+
this.stepList = [];
|
|
20
|
+
}
|
|
21
|
+
connectedCallback() {
|
|
22
|
+
this.initializeSteps();
|
|
23
|
+
const { fonts, colors, spacing } = window.CuraAPI.theme;
|
|
24
|
+
const weights = fonts.getWeights();
|
|
25
|
+
this.styles = this.generateStyles(colors, fonts, spacing, weights);
|
|
26
|
+
}
|
|
27
|
+
generateStyles(colors, fonts, spacing, weights) {
|
|
28
|
+
return {
|
|
29
|
+
'--base-spacing': spacing.getSpacing(),
|
|
30
|
+
'--neutral-purewhite': colors.getColor('neutral-purewhite'),
|
|
31
|
+
'--neutral-lighter': colors.getColor('neutral-lighter'),
|
|
32
|
+
'--neutral-base': colors.getColor('neutral-base'),
|
|
33
|
+
'--neutral-light': colors.getColor('neutral-light'),
|
|
34
|
+
'--success-light': colors.getColor('success-light'),
|
|
35
|
+
'--info-light': colors.getColor('info-light'),
|
|
36
|
+
'--error-light': colors.getColor('error-light'),
|
|
37
|
+
'--font-size': fonts.getSize(),
|
|
38
|
+
'--font-color': fonts.getColor(),
|
|
39
|
+
'--font-family': fonts.getFamily(),
|
|
40
|
+
'--font-weight-regular': weights.regular,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
initializeSteps() {
|
|
44
|
+
if (typeof this.steps === 'string') {
|
|
45
|
+
this.stepList = JSON.parse(this.steps || '[]');
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
this.stepList = this.steps;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
getStepStatus(step) {
|
|
52
|
+
if (this.activeStepIndex === step && this.errorInCurrentStep)
|
|
53
|
+
return 'stop';
|
|
54
|
+
if (this.activeStepIndex === step && this.stepList.length !== step)
|
|
55
|
+
return 'active';
|
|
56
|
+
if (this.activeStepIndex >= step)
|
|
57
|
+
return 'done';
|
|
58
|
+
return 'default';
|
|
59
|
+
}
|
|
60
|
+
getProgressStyles() {
|
|
61
|
+
const progressStyles = {
|
|
62
|
+
default: {
|
|
63
|
+
progressColor: 'var(--info-light)',
|
|
64
|
+
activeStepTextColor: 'info-darker',
|
|
65
|
+
nextStepTextColor: 'info-dark',
|
|
66
|
+
},
|
|
67
|
+
firstStep: {
|
|
68
|
+
progressColor: 'var(--info-light)',
|
|
69
|
+
activeStepTextColor: 'neutral-dark',
|
|
70
|
+
nextStepTextColor: 'neutral-medium',
|
|
71
|
+
},
|
|
72
|
+
completed: {
|
|
73
|
+
progressColor: 'var(--success-light)',
|
|
74
|
+
activeStepTextColor: 'success-darker',
|
|
75
|
+
nextStepTextColor: 'success-dark',
|
|
76
|
+
},
|
|
77
|
+
error: {
|
|
78
|
+
progressColor: 'var(--error-light)',
|
|
79
|
+
activeStepTextColor: 'error-darker',
|
|
80
|
+
nextStepTextColor: 'error-dark',
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
if (this.errorInCurrentStep) {
|
|
84
|
+
return progressStyles.error;
|
|
85
|
+
}
|
|
86
|
+
if (this.activeStepIndex === 0) {
|
|
87
|
+
return progressStyles.firstStep;
|
|
88
|
+
}
|
|
89
|
+
if (this.activeStepIndex === this.stepList.length) {
|
|
90
|
+
return progressStyles.completed;
|
|
91
|
+
}
|
|
92
|
+
return progressStyles.default;
|
|
93
|
+
}
|
|
94
|
+
renderCompactStepper() {
|
|
95
|
+
var _a;
|
|
96
|
+
const title = this.activeStepIndex === 0 ? this.stepList[this.activeStepIndex].title : this.stepList[this.activeStepIndex - 1].title;
|
|
97
|
+
const subtitle = this.activeStepIndex === 0 ? this.stepList[this.activeStepIndex + 1].title : (_a = this.stepList[this.activeStepIndex]) === null || _a === void 0 ? void 0 : _a.title;
|
|
98
|
+
const completed = this.activeStepIndex === this.stepList.length;
|
|
99
|
+
const inProgress = !(completed || this.errorInCurrentStep);
|
|
100
|
+
const { progressColor, activeStepTextColor, nextStepTextColor } = this.getProgressStyles();
|
|
101
|
+
// Representa a porcentagem de progresso (step atual / quantidade de steps;)
|
|
102
|
+
const progress = (this.activeStepIndex * 100) / this.stepList.length;
|
|
103
|
+
return (index.h("div", { class: "container compact", style: this.styles }, index.h("cura-progress-bar", { progress: progress, progressColor: progressColor, active: this.activeStepIndex !== 0 }, !inProgress ? (index.h("cura-icon", { name: this.errorInCurrentStep ? 'alertCircle' : 'checkCircle', color: this.errorInCurrentStep ? 'error-dark' : 'success-dark', size: "16" })) : (index.h("cura-heading", { color: "neutral-dark", size: "xsmall" }, this.activeStepIndex, "/", this.stepList.length))), this.displayHeading && (index.h("div", { class: "heading" }, index.h("cura-heading", { size: "small", weight: "bold", color: activeStepTextColor }, title), !completed && (index.h("cura-heading", { size: "xsmall", weight: "regular", color: nextStepTextColor }, "Pr\u00F3ximo: ", subtitle))))));
|
|
104
|
+
}
|
|
105
|
+
renderStep(step, stepIndex) {
|
|
106
|
+
const stepStatus = this.getStepStatus(stepIndex + 1);
|
|
107
|
+
const lastStep = stepIndex === this.stepList.length - 1;
|
|
108
|
+
const progressWidth = stepStatus !== 'default' ? '100%' : '0';
|
|
109
|
+
return (index.h("div", { class: `step ${lastStep ? 'last' : ''}`, key: step.title }, index.h("cura-stepper-item", { heading: step.title, label: step.label, displayHeading: this.displayHeading, status: stepStatus }), stepIndex < this.stepList.length - 1 && (index.h("div", { class: "wrapper" }, index.h("div", { class: "divider" }), index.h("div", { class: `divider ${stepStatus} animation`, style: { '--progress-width': progressWidth } })))));
|
|
110
|
+
}
|
|
111
|
+
renderStepper() {
|
|
112
|
+
return (index.h("div", { class: "container", style: this.styles }, index.h("div", { class: "stepper-list" }, this.stepList.map((step, stepIndex) => this.renderStep(step, stepIndex)))));
|
|
113
|
+
}
|
|
114
|
+
render() {
|
|
115
|
+
return index.h(index.Host, { key: 'a3c23a43dc82cba74b777a7e28ae7de1632ec95d' }, this.variant === 'default' ? this.renderStepper() : this.renderCompactStepper());
|
|
116
|
+
}
|
|
117
|
+
get host() { return index.getElement(this); }
|
|
118
|
+
};
|
|
119
|
+
CuraStepper.style = CuraStepperStyle0;
|
|
120
|
+
|
|
121
|
+
exports.cura_stepper = CuraStepper;
|
|
122
|
+
|
|
123
|
+
//# sourceMappingURL=cura-stepper.cjs.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"cura-stepper.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,cAAc,GAAG,yyBAAyyB,CAAC;AACj0B,0BAAe,cAAc;;MCOhB,WAAW;;;;kCAUiC,KAAK;8BAKT,KAAK;uBAKE,SAAS;qBAKlC,EAAE;sBAMjB,EAAE;wBAQQ,EAAE;;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E,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAO,CACtG,EACN;KACH;IAED,MAAM;QACJ,OAAOA,QAACC,UAAI,uDAAE,IAAI,CAAC,OAAO,KAAK,SAAS,GAAG,IAAI,CAAC,aAAa,EAAE,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAQ,CAAC;KACvG;;;;;;;","names":["h","Host"],"sources":["src/components/cura-stepper/cura-stepper.scss?tag=cura-stepper&encapsulation=shadow","src/components/cura-stepper/cura-stepper.tsx"],"sourcesContent":[":host {\n display: block;\n box-sizing: border-box;\n width: 100%;\n}\n\ncura-heading { \n --margin-block: 0 !important;\n}\n\n.container {\n display: flex;\n}\n\n.compact {\n display: flex;\n padding: 0px;\n justify-content: space-between;\n align-items: center;\n\n .heading{\n text-align: right;\n }\n}\n\n.stepper-list {\n gap: 4px;\n display: flex;\n flex-shrink: 0;\n align-items: center;\n padding: 0;\n flex: 1;\n width: 100%;\n justify-content: space-between;\n}\n\n.step{\n display: flex;\n align-items: center;\n flex-direction: row;\n flex: 1;\n gap: 4px;\n\n .wrapper {\n flex: 1;\n position: relative;\n }\n\n .divider{\n background-color: var(--neutral-light);\n height: 2px;\n flex: 1;\n\n transition: all 1s;\n }\n\n .animation {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n width: var(--progress-width);\n }\n\n .done{\n background-color: var(--success-light);\n }\n\n .stop{\n background-color: var(--error-light);\n }\n\n .active{\n background-color: var(--info-light);\n }\n}\n\n.last{\n flex: 0;\n}\n","import { Component, Host, State, h, Element, Prop } from '@stencil/core';\nimport { Step } from './stepper.type';\n\n@Component({\n tag: 'cura-stepper',\n styleUrl: 'cura-stepper.scss',\n shadow: true,\n})\nexport class CuraStepper {\n /**\n * The current active step index\n */\n @Prop({ reflect: true }) activeStepIndex: number;\n\n /**\n * Indicates if a step has encountered an error\n * If `true`, the current step will be marked as 'stop'\n */\n @Prop({ reflect: true }) errorInCurrentStep: boolean = false;\n\n /**\n * Whether to display the title (default: false)\n */\n @Prop({ reflect: true }) displayHeading: boolean = false;\n\n /**\n * Allows you to set the appearance of the component (default: default)\n */\n @Prop({ reflect: true }) variant: 'compact' | 'default' = 'default';\n\n /**\n * List of steps in the stepper.\n */\n @Prop() steps: Step[] | string = [];\n /**\n * Reference to the host element.\n */\n @Element() host: HTMLElement;\n\n @State() styles = {};\n\n /**\n * Array of steps in the stepper.\n *\n * @type {Date[]}\n * @default []\n */\n @State() stepList: Step[] = [];\n\n connectedCallback() {\n this.initializeSteps();\n\n const { fonts, colors, spacing } = window.CuraAPI.theme;\n const weights = fonts.getWeights();\n\n this.styles = this.generateStyles(colors, fonts, spacing, weights);\n }\n\n generateStyles(colors, fonts, spacing, weights) {\n return {\n '--base-spacing': spacing.getSpacing(),\n '--neutral-purewhite': colors.getColor('neutral-purewhite'),\n '--neutral-lighter': colors.getColor('neutral-lighter'),\n '--neutral-base': colors.getColor('neutral-base'),\n '--neutral-light': colors.getColor('neutral-light'),\n '--success-light': colors.getColor('success-light'),\n '--info-light': colors.getColor('info-light'),\n '--error-light': colors.getColor('error-light'),\n '--font-size': fonts.getSize(),\n '--font-color': fonts.getColor(),\n '--font-family': fonts.getFamily(),\n '--font-weight-regular': weights.regular,\n };\n }\n\n initializeSteps() {\n if (typeof this.steps === 'string') {\n this.stepList = JSON.parse(this.steps || '[]');\n } else {\n this.stepList = this.steps;\n }\n }\n\n getStepStatus(step: number): 'done' | 'stop' | 'active' | 'default' {\n if (this.activeStepIndex === step && this.errorInCurrentStep) return 'stop';\n if (this.activeStepIndex === step && this.stepList.length !== step) return 'active';\n if (this.activeStepIndex >= step) return 'done';\n\n return 'default';\n }\n\n getProgressStyles() {\n const progressStyles = {\n default: {\n progressColor: 'var(--info-light)',\n activeStepTextColor: 'info-darker',\n nextStepTextColor: 'info-dark',\n },\n firstStep: {\n progressColor: 'var(--info-light)',\n activeStepTextColor: 'neutral-dark',\n nextStepTextColor: 'neutral-medium',\n },\n completed: {\n progressColor: 'var(--success-light)',\n activeStepTextColor: 'success-darker',\n nextStepTextColor: 'success-dark',\n },\n error: {\n progressColor: 'var(--error-light)',\n activeStepTextColor: 'error-darker',\n nextStepTextColor: 'error-dark',\n },\n };\n\n if (this.errorInCurrentStep) {\n return progressStyles.error;\n }\n\n if (this.activeStepIndex === 0) {\n return progressStyles.firstStep;\n }\n\n if (this.activeStepIndex === this.stepList.length) {\n return progressStyles.completed;\n }\n\n return progressStyles.default;\n }\n\n renderCompactStepper() {\n const title = this.activeStepIndex === 0 ? this.stepList[this.activeStepIndex].title : this.stepList[this.activeStepIndex - 1].title;\n const subtitle = this.activeStepIndex === 0 ? this.stepList[this.activeStepIndex + 1].title : this.stepList[this.activeStepIndex]?.title;\n const completed = this.activeStepIndex === this.stepList.length;\n const inProgress = !(completed || this.errorInCurrentStep);\n const { progressColor, activeStepTextColor, nextStepTextColor } = this.getProgressStyles();\n\n // Representa a porcentagem de progresso (step atual / quantidade de steps;)\n const progress = (this.activeStepIndex * 100) / this.stepList.length;\n\n return (\n <div class=\"container compact\" style={this.styles}>\n <cura-progress-bar progress={progress} progressColor={progressColor} active={this.activeStepIndex !== 0}>\n {!inProgress ? (\n <cura-icon name={this.errorInCurrentStep ? 'alertCircle' : 'checkCircle'} color={this.errorInCurrentStep ? 'error-dark' : 'success-dark'} size=\"16\"></cura-icon>\n ) : (\n <cura-heading color=\"neutral-dark\" size=\"xsmall\">\n {this.activeStepIndex}/{this.stepList.length}\n </cura-heading>\n )}\n </cura-progress-bar>\n {this.displayHeading && (\n <div class=\"heading\">\n <cura-heading size=\"small\" weight=\"bold\" color={activeStepTextColor}>\n {title}\n </cura-heading>\n {!completed && (\n <cura-heading size=\"xsmall\" weight=\"regular\" color={nextStepTextColor}>\n Próximo: {subtitle}\n </cura-heading>\n )}\n </div>\n )}\n </div>\n );\n }\n\n renderStep(step: Step, stepIndex: number) {\n const stepStatus = this.getStepStatus(stepIndex + 1);\n const lastStep = stepIndex === this.stepList.length - 1;\n const progressWidth = stepStatus !== 'default' ? '100%' : '0';\n\n return (\n <div class={`step ${lastStep ? 'last' : ''}`} key={step.title}>\n <cura-stepper-item heading={step.title} label={step.label} displayHeading={this.displayHeading} status={stepStatus} />\n {stepIndex < this.stepList.length - 1 && (\n <div class=\"wrapper\">\n <div class=\"divider\" />\n <div class={`divider ${stepStatus} animation`} style={{ '--progress-width': progressWidth }} />\n </div>\n )}\n </div>\n );\n }\n renderStepper() {\n return (\n <div class=\"container\" style={this.styles}>\n <div class=\"stepper-list\">{this.stepList.map((step, stepIndex) => this.renderStep(step, stepIndex))}</div>\n </div>\n );\n }\n\n render() {\n return <Host>{this.variant === 'default' ? this.renderStepper() : this.renderCompactStepper()}</Host>;\n }\n}\n"],"version":3}
|
|
@@ -109,7 +109,7 @@ const CuraSwitch = class {
|
|
|
109
109
|
return classes;
|
|
110
110
|
}
|
|
111
111
|
render() {
|
|
112
|
-
return (index.h(index.Host, { key: '
|
|
112
|
+
return (index.h(index.Host, { key: '46860420ccaabb21c57129a108db5f1ae9f6d9ce' }, index.h("div", { key: '4a9979890a90783a546d97f73c3562c22a72ad9e', class: this.getClasses(), style: this.styles }, index.h("div", { key: '77c09cbe03694ad36776073cd34d7d8f06c55b85', class: "info" }, index.h("cura-label", { key: '34fb44a104954c8540bc2f4a87a3efd8f1db789f', style: { textAlign: this.position === 'right' ? 'right' : 'left' }, class: "label", weight: "bold", size: this.size === 'large' ? 'medium' : 'xsmall', lineHeight: "125%", color: this.assignColor('neutral-white', 'neutral-black') }, this.label), index.h("cura-label", { key: '5af93372fafedc89f32f393a45cd37416c7f092c', style: { textAlign: this.position === 'right' ? 'right' : 'left' }, color: this.assignColor('primary-lighter', 'neutral-dark'), size: "xsmall", class: "message" }, index.h("slot", { key: '72b3bbbf88821623ffab554423aa8c2ed90c2e9c' }))), index.h("div", { key: '76fb47dcc44e5c59aa29dc911bbc764b63f4cc4b', onClick: this.toggleSwitch, class: "control" }, index.h("div", { key: 'a3155acd634dbf8cef95115ed107b975cd085b11', class: `track ${this.size.toLowerCase()}` }, index.h("div", { key: 'd0692eed52590930a528b339527f16870959c450', class: `thumb ${this.size.toLowerCase()}`, tabIndex: this.ontabindex }))))));
|
|
113
113
|
}
|
|
114
114
|
static get formAssociated() { return true; }
|
|
115
115
|
static get watchers() { return {
|
|
@@ -31,7 +31,7 @@ const CuraToast = class {
|
|
|
31
31
|
this.setStyle();
|
|
32
32
|
}
|
|
33
33
|
render() {
|
|
34
|
-
return (index.h(index.Host, { key: '
|
|
34
|
+
return (index.h(index.Host, { key: '4dc290042792d96f31c2e63936d70a77bc37917d' }, index.h("div", { key: '668c102d3a31d0a0e39c390546fcf5422e954246', class: this.getClasses(), style: this.styles }, index.h("cura-icon", { key: '502b24915e1000877ccd4ae25806b152b4a72948', class: "default-icon", name: this.getNameIcon(), size: 16, color: `${this.type}-dark` }), index.h("div", { key: 'd7afe4d1a9740d3bd1bce04858f6e71e0c857da2', class: "content" }, index.h("cura-heading", { key: '419e0d64e12e828efa2fecebe0eb86c74ff86dda', level: 4, size: "xsmall", color: `${this.type}-dark`, weight: "bold", "margin-block": "0" }, this.label), index.h("cura-paragraph", { key: 'bc6f5c120f0b32858cbda9ebf16c5d79366452bb', color: `${this.type}-darker`, size: "xsmall", marginBlock: "0", lineHeight: "133.33%" }, index.h("slot", { key: '9cc8ba28b3e5ee5d8137351cfbb5dc07b417b7e9' })), index.h("slot", { key: 'f260ca44fa6cc515a1bda3ecb94dd1ac90f880d7', name: "actions" })), this.closeButton && index.h("cura-icon", { key: '7db6c2e5c3c66ab0b12822fc8099e17b77ed2c39', class: "close-icon", name: "close", size: 16, color: "error-dark", onClick: this.handleClose }), this.loader && !!this.autoCloseDelay && index.h("cura-loader-bar", { key: 'd0a6f1e838ec98f6dac5773214e1e5cf501e3e2e', color: `${this.type}-base`, progress: this.progress }))));
|
|
35
35
|
}
|
|
36
36
|
componentDidLoad() {
|
|
37
37
|
this.openContainer();
|
|
@@ -35,9 +35,10 @@ const CuraTooltip = class {
|
|
|
35
35
|
this.setStyle();
|
|
36
36
|
}
|
|
37
37
|
render() {
|
|
38
|
-
return (index.h(index.Host, { key: '
|
|
38
|
+
return (index.h(index.Host, { key: '3fe89da4d5b3a2830d4ab6a88e705b4cf2433289', role: "tooltip", id: this.elementId }, index.h("div", { key: '6cece3dcbf275a851e0d53cb154b9dcf50a76948', class: "container", style: this.styles }, index.h("div", { key: '802840b89feb6c4d89303da156f6f130e552a83b', class: "content" }, index.h("cura-heading", { key: 'ea98692d4fc34f05dcf8fcd5c325b8a1cd408226', level: 4, size: "xsmall", color: "neutral-black", weight: "bold", "margin-block": "0" }, this.label), index.h("cura-paragraph", { key: '38bb7bf9f0a837813b490062ba5645f7148ac74b', color: "neutral-dark", "spot-color": "secondary-darker", size: "xsmall", marginBlock: "0", lineHeight: "133.33%" }, index.h("slot", { key: '960b6b6d8ee4636a31c2058aa4779050973e143e' }))), this.closeButton && !this.isMobile && index.h("cura-icon", { key: 'd0bf72702fa8d24d1f5fac6fa473747bdaadcdaf', class: "close-icon", name: "close", size: 16, color: "error-dark", onClick: this.handleClose }), this.isMobile && index.h("cura-button-transparent", { key: '2213a6353b3d326ecde2e9eefe84811bd3161727', class: "close-button", size: "small", type: "button", color: "error", "icon-name": "close", "icon-position": "right", onClick: this.handleClose }, "OK, entendi."))));
|
|
39
39
|
}
|
|
40
40
|
componentDidLoad() {
|
|
41
|
+
var _a, _b, _c, _d, _e;
|
|
41
42
|
this.targetElement = document.querySelector(`[aria-labelledby="${this.elementId}"]`);
|
|
42
43
|
if (!this.interactive) {
|
|
43
44
|
this.host.style.visibility = 'visible';
|
|
@@ -46,28 +47,28 @@ const CuraTooltip = class {
|
|
|
46
47
|
this.host.style.visibility = 'hidden';
|
|
47
48
|
let openTimeoutID = null;
|
|
48
49
|
let closeTimeoutID = null;
|
|
49
|
-
this.targetElement.addEventListener('mouseenter', () => {
|
|
50
|
+
(_a = this.targetElement) === null || _a === void 0 ? void 0 : _a.addEventListener('mouseenter', () => {
|
|
50
51
|
clearTimeout(closeTimeoutID);
|
|
51
52
|
openTimeoutID = setTimeout(() => {
|
|
52
53
|
this.host.style.visibility = 'visible';
|
|
53
54
|
}, typeof this.delay === 'number' && this.delay > 250 ? this.delay : 250);
|
|
54
55
|
});
|
|
55
|
-
this.targetElement.addEventListener('mouseleave', () => {
|
|
56
|
+
(_b = this.targetElement) === null || _b === void 0 ? void 0 : _b.addEventListener('mouseleave', () => {
|
|
56
57
|
clearTimeout(openTimeoutID);
|
|
57
58
|
closeTimeoutID = setTimeout(() => {
|
|
58
59
|
this.handleClose();
|
|
59
60
|
}, typeof this.delay === 'number' && this.delay > 250 ? this.delay : 250);
|
|
60
61
|
});
|
|
61
|
-
this.host.addEventListener('mouseenter', () => {
|
|
62
|
+
(_c = this.host) === null || _c === void 0 ? void 0 : _c.addEventListener('mouseenter', () => {
|
|
62
63
|
if (window.getComputedStyle(this.host).visibility === 'visible') {
|
|
63
64
|
clearTimeout(closeTimeoutID);
|
|
64
65
|
}
|
|
65
66
|
});
|
|
66
|
-
this.host.addEventListener('mouseleave', () => {
|
|
67
|
+
(_d = this.host) === null || _d === void 0 ? void 0 : _d.addEventListener('mouseleave', () => {
|
|
67
68
|
clearTimeout(openTimeoutID);
|
|
68
69
|
this.handleClose();
|
|
69
70
|
});
|
|
70
|
-
this.targetElement.addEventListener('click', () => {
|
|
71
|
+
(_e = this.targetElement) === null || _e === void 0 ? void 0 : _e.addEventListener('click', () => {
|
|
71
72
|
if (window.getComputedStyle(this.host).visibility === 'hidden') {
|
|
72
73
|
openTimeoutID = setTimeout(() => {
|
|
73
74
|
this.host.style.visibility = 'visible';
|
|
@@ -78,7 +79,7 @@ const CuraTooltip = class {
|
|
|
78
79
|
this.handleClose();
|
|
79
80
|
}
|
|
80
81
|
});
|
|
81
|
-
document.addEventListener('click', (event) => {
|
|
82
|
+
document === null || document === void 0 ? void 0 : document.addEventListener('click', (event) => {
|
|
82
83
|
if (!this.targetElement.contains(event.target) && !this.host.contains(event.target)) {
|
|
83
84
|
clearTimeout(openTimeoutID);
|
|
84
85
|
this.handleClose();
|
|
@@ -113,7 +114,7 @@ const CuraTooltip = class {
|
|
|
113
114
|
this.host.style.bottom = this.isMobile ? '0' : 'unset';
|
|
114
115
|
container.style.flexDirection = this.isMobile ? 'column' : 'row';
|
|
115
116
|
if (this.isMobile) {
|
|
116
|
-
this.host.style.left = '
|
|
117
|
+
this.host.style.left = '0';
|
|
117
118
|
this.host.style.top = 'unset';
|
|
118
119
|
return;
|
|
119
120
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"cura-tooltip.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,cAAc,GAAG,irDAAirD,CAAC;AACzsD,0BAAe,cAAc;;ACC7B,MAAM,oBAAoB,GAAG,GAAG,CAAC;MAOpB,WAAW;;;;QAiBtB,WAAM,GAAG,EAAE,CAAC;QAuQZ,gBAAW,GAAG;YACZ,IAAI,CAAC,cAAc,EAAE,CAAC;SACvB,CAAC;yBAvRkB,EAAE;2BACA,IAAI;qBACV,GAAG;wBACA,OAAO;wBACmK,KAAK;;2BAE3J,KAAK;wBAExB,KAAK;;IASzB,cAAc;QACZ,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;KACtC;IAGD,cAAc;QACZ,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;KACtC;IAED,iBAAiB;QACf,IAAI,CAAC,QAAQ,EAAE,CAAC;KACjB;IAED,MAAM;QACJ,QACEA,QAACC,UAAI,qDAAC,IAAI,EAAC,SAAS,EAAC,EAAE,EAAE,IAAI,CAAC,SAAS,IACrCD,kEAAK,KAAK,EAAC,WAAW,EAAC,KAAK,EAAE,IAAI,CAAC,MAAM,IACvCA,kEAAK,KAAK,EAAC,SAAS,IAClBA,2EAAc,KAAK,EAAE,CAAC,EAAE,IA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AAI,GAAG,GAAG,YAAY,EAAE;oBACtB,GAAG,GAAG,WAAW,CAAC,GAAG,GAAG,WAAW,CAAC,MAAM,GAAG,yBAAyB,CAAC;oBACvE,kBAAkB,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;iBAC1C;aACF;YAED,IAAI,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;gBAC7B,GAAG,GAAG,WAAW,CAAC,GAAG,GAAG,WAAW,CAAC,MAAM,GAAG,yBAAyB,CAAC;gBACvE,kBAAkB,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;gBAEzC,IAAI,GAAG,GAAG,WAAW,CAAC,MAAM,GAAG,YAAY,GAAG,YAAY,EAAE;oBAC1D,GAAG,GAAG,WAAW,CAAC,GAAG,GAAG,WAAW,CAAC,MAAM,GAAG,yBAAyB,CAAC;oBACvE,kBAAkB,CAAC,EAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAC,CAAC;iBACvD;aACF;SACF;QAED,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,IAAI,IAAI,CAAC;QACnC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;KAClC;IAED,cAAc;QACZ,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC;QACtC,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;KAC3B;;;;;;;","names":["h","Host"],"sources":["src/components/cura-tooltip/cura-tooltip.scss?tag=cura-tooltip&encapsulation=shadow","src/components/cura-tooltip/cura-tooltip.tsx"],"sourcesContent":["@import '../../../src/scss/mixins/responsive.scss';\n@import '../../../src/scss/mixins/shadows.scss';\n@import '../../../src/scss/mixins/spacing.scss';\n\n:host {\n position: absolute;\n z-index: 99999;\n display: block;\n width: fit-content;\n height: fit-content;\n box-sizing: border-box;\n\n @include mobile-only() {\n width: 100%;\n }\n\n .container {\n display: flex;\n box-sizing: border-box;\n max-width: var(--max-width);\n height: auto;\n padding: calc(#{$base-spacing} * 2px);\n border: 1px solid var(--neutral-light);\n border-radius: calc(#{$base-spacing} * 1px);\n background-color: var(--neutral-purewhite);\n @include shadow-level3(--neutral-black-shadow);\n\n @include mobile-only() {\n max-width: 90%;\n height: fit-content;\n padding: calc(#{$base-spacing} * 4px) calc(#{$base-spacing} * 4px) 0 calc(#{$base-spacing} * 4px);\n margin: 0 auto;\n border: 2px solid;\n border-radius: calc(#{$base-spacing} * 3px) calc(#{$base-spacing} * 3px) 0 0;\n border-color: var(--neutral-light) var(--neutral-light) transparent var(--neutral-light);\n }\n\n &::after {\n content: '';\n position: absolute;\n z-index: 99999;\n width: calc(#{$base-spacing} * 2.5px);\n height: calc(#{$base-spacing} * 2.5px);\n border: 1px solid;\n border-radius: 2px;\n background-color: var(--neutral-purewhite);\n \n left: var(--arrow-left);\n top: var(--arrow-top);\n border-color: var(--arrow-border-color);\n transform: var(--arrow-translate) rotate(45deg);\n\n @include mobile-only() {\n display: none;\n }\n }\n\n .content {\n flex: 1 1 0;\n display: flex;\n flex-direction: column;\n gap: calc(#{$base-spacing} * 1px);\n\n @include mobile-only() {\n padding-bottom: calc(#{$base-spacing} * 4px);\n border-bottom: 1px dashed var(--neutral-light);\n }\n }\n\n .close-icon {\n margin-left: calc(#{$base-spacing} * 3px);\n cursor: pointer;\n }\n\n .close-button {\n padding: calc(#{$base-spacing} * 2px) 0;\n }\n }\n}","import { Component, Element, EventEmitter, Host, Prop, State, h, Event, Listen } from '@stencil/core';\n\nconst BREAKPOINT_SMALL_MAX = 768;\n\n@Component({\n tag: 'cura-tooltip',\n styleUrl: 'cura-tooltip.scss',\n shadow: true,\n})\nexport class CuraTooltip {\n @Element() host: HTMLElement;\n\n @Prop() elementId = '';\n @Prop() interactive = true;\n @Prop() delay = 250;\n @Prop() maxWidth = '280px';\n @Prop({ reflect: true }) position: 'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-start' | 'bottom' | 'bottom-end' | 'left-start' | 'left' | 'left-end' = 'top';\n @Prop({ reflect: true }) label: string;\n @Prop({ reflect: true }) closeButton = false;\n\n @State() isMobile = false;\n\n @Event({ eventName: 'tooltipClosed' }) tooltipClosed: EventEmitter<void>;\n\n targetElement: HTMLElement;\n\n styles = {};\n\n @Listen('resize', { target: 'window' })\n onWindowResize() {\n this.setPosition(this.targetElement);\n }\n\n @Listen('scroll', { target: 'window' })\n onWindowScroll() {\n this.setPosition(this.targetElement);\n }\n\n connectedCallback() {\n this.setStyle();\n }\n\n render() {\n return (\n <Host role=\"tooltip\" id={this.elementId}>\n <div class=\"container\" style={this.styles}>\n <div class=\"content\">\n <cura-heading level={4} size=\"xsmall\" color=\"neutral-black\" weight=\"bold\" margin-block=\"0\">\n {this.label}\n </cura-heading>\n <cura-paragraph color=\"neutral-dark\" spot-color=\"secondary-darker\" size=\"xsmall\" marginBlock=\"0\" lineHeight=\"133.33%\">\n <slot></slot>\n </cura-paragraph>\n </div>\n {this.closeButton && !this.isMobile && <cura-icon class=\"close-icon\" name=\"close\" size={16} color=\"error-dark\" onClick={this.handleClose}></cura-icon>}\n {this.isMobile && <cura-button-transparent class=\"close-button\" size=\"small\" type=\"button\" color=\"error\" icon-name=\"close\" icon-position=\"right\" onClick={this.handleClose}>OK, entendi.</cura-button-transparent>}\n </div>\n </Host>\n );\n }\n\n componentDidLoad() {\n this.targetElement = document.querySelector(`[aria-labelledby=\"${this.elementId}\"]`) as HTMLElement;\n\n if (!this.interactive) {\n this.host.style.visibility = 'visible';\n } else {\n this.host.style.visibility = 'hidden';\n\n let openTimeoutID = null;\n let closeTimeoutID = null;\n\n this.targetElement.addEventListener('mouseenter', () => {\n clearTimeout(closeTimeoutID);\n openTimeoutID = setTimeout(() => {\n this.host.style.visibility = 'visible';\n }, typeof this.delay === 'number' && this.delay > 250 ? this.delay : 250);\n });\n \n this.targetElement.addEventListener('mouseleave', () => {\n clearTimeout(openTimeoutID);\n closeTimeoutID = setTimeout(() => {\n this.handleClose();\n }, typeof this.delay === 'number' && this.delay > 250 ? this.delay : 250);\n });\n\n this.host.addEventListener('mouseenter', () => {\n if (window.getComputedStyle(this.host).visibility === 'visible') {\n clearTimeout(closeTimeoutID);\n }\n });\n\n this.host.addEventListener('mouseleave', () => {\n clearTimeout(openTimeoutID);\n this.handleClose();\n });\n\n this.targetElement.addEventListener('click', () => {\n if (window.getComputedStyle(this.host).visibility === 'hidden') {\n openTimeoutID = setTimeout(() => {\n this.host.style.visibility = 'visible';\n }, typeof this.delay === 'number' && this.delay > 250 ? this.delay : 250);\n } else {\n clearTimeout(openTimeoutID);\n this.handleClose();\n }\n });\n \n document.addEventListener('click', (event: MouseEvent) => {\n if(!this.targetElement.contains(event.target as HTMLElement) && !this.host.contains(event.target as HTMLElement)) {\n clearTimeout(openTimeoutID);\n this.handleClose();\n }\n });\n }\n\n setTimeout(() => {\n this.setPosition(this.targetElement);\n }, 100);\n }\n\n setStyle() {\n this.styles = {\n ...this.styles,\n '--max-width': this.maxWidth,\n '--base-spacing': window.CuraAPI.theme.spacing.getSpacing(),\n '--neutral-purewhite': window.CuraAPI.theme.colors.getColor(`neutral-purewhite`),\n '--neutral-light': window.CuraAPI.theme.colors.getColor(`neutral-light`),\n '--neutral-black-shadow': window.CuraAPI.theme.colors.getColor(`neutral-black`, 0.16),\n }\n }\n\n getClasses() {\n const [firstPosition, secondPosition] = this.position.split('-');\n const classes = {};\n\n classes['container'] = true;\n if (firstPosition) { classes[firstPosition] = true; }\n if (secondPosition) { classes[secondPosition] = true; }\n\n return classes;\n }\n\n setPosition(element: HTMLElement) {\n const windowWidth = window.innerWidth;\n const windowHeight = window.innerHeight;\n const container = this.host.shadowRoot.querySelector('.container') as HTMLElement;\n\n this.isMobile = windowWidth <= BREAKPOINT_SMALL_MAX;\n\n this.host.style.position = this.isMobile ? 'fixed' : 'absolute';\n this.host.style.bottom = this.isMobile ? '0' : 'unset';\n container.style.flexDirection = this.isMobile ? 'column' : 'row';\n\n if (this.isMobile) {\n this.host.style.left = 'unset';\n this.host.style.top = 'unset';\n return;\n }\n\n const elementRect = { \n top: element.offsetTop, \n left: element.offsetLeft, \n width: element.offsetWidth, \n height: element.offsetHeight\n };\n const tooltipRect = this.host.getBoundingClientRect();\n\n const SCREEN_LIMIT = 10;\n const SPACE_TO_ELEMENT = 10;\n const ARROW_HORIZONTAL_ADJUSTMENT = (elementRect.width * 0.5) + 18;\n const ARROW_VERTICAL_ADJUSTMENT = (elementRect.height * 0.5) + 18;\n const BORDER_COLOR = this.styles['--neutral-light'];\n\n let left = 0;\n let top = 0;\n\n const positions = Object.keys(this.getClasses()).filter((p) => ['top', 'left', 'bottom', 'right', 'start', 'end'].includes(p));\n\n const setArrowProperties = ({ arrowTop = '', arrowLeft = '', translate = '', borderColor = '' }) => {\n if (arrowLeft) this.host.style.setProperty('--arrow-left', arrowLeft);\n if (arrowTop) this.host.style.setProperty('--arrow-top', arrowTop);\n if (translate) this.host.style.setProperty('--arrow-translate', translate);\n if (borderColor) this.host.style.setProperty('--arrow-border-color', borderColor);\n };\n\n //Posicionamento vertical\n if (positions.includes('top') || positions.includes('bottom')) {\n setArrowProperties({ arrowLeft: '50%', translate: 'translateX(-50%)' });\n\n if (positions.includes('top')) {\n top = elementRect.top - tooltipRect.height - SPACE_TO_ELEMENT;\n setArrowProperties({ arrowTop: 'calc(100% - 6px)', borderColor: `transparent ${BORDER_COLOR} ${BORDER_COLOR} transparent` });\n\n if (top < SCREEN_LIMIT) {\n top = elementRect.top + elementRect.height + SPACE_TO_ELEMENT;\n setArrowProperties({ arrowTop: '-6px', borderColor: `${BORDER_COLOR} transparent transparent ${BORDER_COLOR}` });\n }\n }\n\n if (positions.includes('bottom')) {\n top = elementRect.top + elementRect.height + SPACE_TO_ELEMENT;\n setArrowProperties({ arrowTop: '-6px', borderColor: `${BORDER_COLOR} transparent transparent ${BORDER_COLOR}` });\n\n if (top + tooltipRect.height > windowHeight - SCREEN_LIMIT) {\n top = elementRect.top - tooltipRect.height - SPACE_TO_ELEMENT;\n setArrowProperties({ arrowTop: 'calc(100% - 6px)', borderColor: `transparent ${BORDER_COLOR} ${BORDER_COLOR} transparent` });\n }\n }\n\n left = elementRect.left + (elementRect.width - tooltipRect.width)/2;\n \n if (positions.includes('start')) {\n left = elementRect.left - tooltipRect.width + ARROW_HORIZONTAL_ADJUSTMENT;\n setArrowProperties({ arrowLeft: 'calc(100% - 18px)' });\n\n if (left < SCREEN_LIMIT) {\n left = elementRect.left + elementRect.width - ARROW_HORIZONTAL_ADJUSTMENT;\n setArrowProperties({ arrowLeft: '18px' });\n }\n }\n\n if (positions.includes('end')) {\n left = elementRect.left + elementRect.width - ARROW_HORIZONTAL_ADJUSTMENT;\n setArrowProperties({ arrowLeft: '18px' });\n\n if (left + tooltipRect.width > windowWidth - SCREEN_LIMIT) {\n left = elementRect.left - tooltipRect.width + ARROW_HORIZONTAL_ADJUSTMENT;\n setArrowProperties({ arrowLeft: 'calc(100% - 18px)' });\n }\n }\n }\n\n //Posicionamento horizontal\n if (positions.includes('right') || positions.includes('left')) {\n setArrowProperties({ arrowTop: '50%', translate: 'translateY(-50%)' });\n\n if (positions.includes('right')) {\n left = elementRect.left + elementRect.width + SPACE_TO_ELEMENT;\n setArrowProperties({ arrowLeft: '-6px', borderColor: `transparent transparent ${BORDER_COLOR} ${BORDER_COLOR}` });\n\n if (left + tooltipRect.width > windowWidth - SCREEN_LIMIT) {\n left = elementRect.left - tooltipRect.width - SPACE_TO_ELEMENT;\n setArrowProperties({ arrowLeft: 'calc(100% - 6px)', borderColor: `${BORDER_COLOR} ${BORDER_COLOR} transparent transparent` });\n }\n }\n\n if (positions.includes('left')) {\n left = elementRect.left - tooltipRect.width - SPACE_TO_ELEMENT;\n setArrowProperties({ arrowLeft: 'calc(100% - 6px)', borderColor: `${BORDER_COLOR} ${BORDER_COLOR} transparent transparent` });\n \n if (left < SCREEN_LIMIT) {\n left = elementRect.left + elementRect.width + SPACE_TO_ELEMENT;\n setArrowProperties({ arrowLeft: '-6px', borderColor: `transparent transparent ${BORDER_COLOR} ${BORDER_COLOR}` });\n }\n }\n \n top = elementRect.top + (elementRect.height - tooltipRect.height)/2;\n\n if (positions.includes('start')) {\n top = elementRect.top - tooltipRect.height + ARROW_VERTICAL_ADJUSTMENT;\n setArrowProperties({ arrowTop: 'calc(100% - 18px)' });\n\n if (top < SCREEN_LIMIT) {\n top = elementRect.top + elementRect.height - ARROW_VERTICAL_ADJUSTMENT;\n setArrowProperties({ arrowTop: '18px' });\n }\n }\n\n if (positions.includes('end')) {\n top = elementRect.top + elementRect.height - ARROW_VERTICAL_ADJUSTMENT;\n setArrowProperties({ arrowTop: '18px' });\n\n if (top + tooltipRect.height > windowHeight - SCREEN_LIMIT) {\n top = elementRect.top - tooltipRect.height + ARROW_VERTICAL_ADJUSTMENT;\n setArrowProperties({ arrowTop: 'calc(100% - 18px)' });\n }\n }\n }\n\n this.host.style.left = `${left}px`;\n this.host.style.top = `${top}px`;\n }\n\n closeContainer() {\n this.host.style.visibility = 'hidden';\n this.tooltipClosed.emit();\n }\n\n handleClose = () => {\n this.closeContainer();\n };\n}\n"],"version":3}
|
|
1
|
+
{"file":"cura-tooltip.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,cAAc,GAAG,irDAAirD,CAAC;AACzsD,0BAAe,cAAc;;ACC7B,MAAM,oBAAoB,GAAG,GAAG,CAAC;MAOpB,WAAW;;;;QAiBtB,WAAM,GAAG,EAAE,CAAC;QAuQZ,gBAAW,GAAG;YACZ,IAAI,CAAC,cAAc,EAAE,CAAC;SACvB,CAAC;yBAvRkB,EAAE;2BACA,IAAI;qBACV,GAAG;wBACA,OAAO;wBACmK,KAAK;;2BAE3J,KAAK;wBAExB,KAAK;;IASzB,cAAc;QACZ,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;KACtC;IAGD,cAAc;QACZ,IAAI,CAAC,WAAW,CAAC,IA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,CAAC,UAAU,GAAG,QAAQ,CAAC;QACtC,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;KAC3B;;;;;;;","names":["h","Host"],"sources":["src/components/cura-tooltip/cura-tooltip.scss?tag=cura-tooltip&encapsulation=shadow","src/components/cura-tooltip/cura-tooltip.tsx"],"sourcesContent":["@import '../../../src/scss/mixins/responsive.scss';\n@import '../../../src/scss/mixins/shadows.scss';\n@import '../../../src/scss/mixins/spacing.scss';\n\n:host {\n position: absolute;\n z-index: 99999;\n display: block;\n width: fit-content;\n height: fit-content;\n box-sizing: border-box;\n\n @include mobile-only() {\n width: 100%;\n }\n\n .container {\n display: flex;\n box-sizing: border-box;\n max-width: var(--max-width);\n height: auto;\n padding: calc(#{$base-spacing} * 2px);\n border: 1px solid var(--neutral-light);\n border-radius: calc(#{$base-spacing} * 1px);\n background-color: var(--neutral-purewhite);\n @include shadow-level3(--neutral-black-shadow);\n\n @include mobile-only() {\n max-width: 90%;\n height: fit-content;\n padding: calc(#{$base-spacing} * 4px) calc(#{$base-spacing} * 4px) 0 calc(#{$base-spacing} * 4px);\n margin: 0 auto;\n border: 2px solid;\n border-radius: calc(#{$base-spacing} * 3px) calc(#{$base-spacing} * 3px) 0 0;\n border-color: var(--neutral-light) var(--neutral-light) transparent var(--neutral-light);\n }\n\n &::after {\n content: '';\n position: absolute;\n z-index: 99999;\n width: calc(#{$base-spacing} * 2.5px);\n height: calc(#{$base-spacing} * 2.5px);\n border: 1px solid;\n border-radius: 2px;\n background-color: var(--neutral-purewhite);\n \n left: var(--arrow-left);\n top: var(--arrow-top);\n border-color: var(--arrow-border-color);\n transform: var(--arrow-translate) rotate(45deg);\n\n @include mobile-only() {\n display: none;\n }\n }\n\n .content {\n flex: 1 1 0;\n display: flex;\n flex-direction: column;\n gap: calc(#{$base-spacing} * 1px);\n\n @include mobile-only() {\n padding-bottom: calc(#{$base-spacing} * 4px);\n border-bottom: 1px dashed var(--neutral-light);\n }\n }\n\n .close-icon {\n margin-left: calc(#{$base-spacing} * 3px);\n cursor: pointer;\n }\n\n .close-button {\n padding: calc(#{$base-spacing} * 2px) 0;\n }\n }\n}","import { Component, Element, EventEmitter, Host, Prop, State, h, Event, Listen } from '@stencil/core';\n\nconst BREAKPOINT_SMALL_MAX = 768;\n\n@Component({\n tag: 'cura-tooltip',\n styleUrl: 'cura-tooltip.scss',\n shadow: true,\n})\nexport class CuraTooltip {\n @Element() host: HTMLElement;\n\n @Prop() elementId = '';\n @Prop() interactive = true;\n @Prop() delay = 250;\n @Prop() maxWidth = '280px';\n @Prop({ reflect: true }) position: 'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-start' | 'bottom' | 'bottom-end' | 'left-start' | 'left' | 'left-end' = 'top';\n @Prop({ reflect: true }) label: string;\n @Prop({ reflect: true }) closeButton = false;\n\n @State() isMobile = false;\n\n @Event({ eventName: 'tooltipClosed' }) tooltipClosed: EventEmitter<void>;\n\n targetElement: HTMLElement;\n\n styles = {};\n\n @Listen('resize', { target: 'window' })\n onWindowResize() {\n this.setPosition(this.targetElement);\n }\n\n @Listen('scroll', { target: 'window' })\n onWindowScroll() {\n this.setPosition(this.targetElement);\n }\n\n connectedCallback() {\n this.setStyle();\n }\n\n render() {\n return (\n <Host role=\"tooltip\" id={this.elementId}>\n <div class=\"container\" style={this.styles}>\n <div class=\"content\">\n <cura-heading level={4} size=\"xsmall\" color=\"neutral-black\" weight=\"bold\" margin-block=\"0\">\n {this.label}\n </cura-heading>\n <cura-paragraph color=\"neutral-dark\" spot-color=\"secondary-darker\" size=\"xsmall\" marginBlock=\"0\" lineHeight=\"133.33%\">\n <slot></slot>\n </cura-paragraph>\n </div>\n {this.closeButton && !this.isMobile && <cura-icon class=\"close-icon\" name=\"close\" size={16} color=\"error-dark\" onClick={this.handleClose}></cura-icon>}\n {this.isMobile && <cura-button-transparent class=\"close-button\" size=\"small\" type=\"button\" color=\"error\" icon-name=\"close\" icon-position=\"right\" onClick={this.handleClose}>OK, entendi.</cura-button-transparent>}\n </div>\n </Host>\n );\n }\n\n componentDidLoad() {\n this.targetElement = document.querySelector(`[aria-labelledby=\"${this.elementId}\"]`) as HTMLElement;\n\n if (!this.interactive) {\n this.host.style.visibility = 'visible';\n } else {\n this.host.style.visibility = 'hidden';\n\n let openTimeoutID = null;\n let closeTimeoutID = null;\n\n this.targetElement?.addEventListener('mouseenter', () => {\n clearTimeout(closeTimeoutID);\n openTimeoutID = setTimeout(() => {\n this.host.style.visibility = 'visible';\n }, typeof this.delay === 'number' && this.delay > 250 ? this.delay : 250);\n });\n \n this.targetElement?.addEventListener('mouseleave', () => {\n clearTimeout(openTimeoutID);\n closeTimeoutID = setTimeout(() => {\n this.handleClose();\n }, typeof this.delay === 'number' && this.delay > 250 ? this.delay : 250);\n });\n\n this.host?.addEventListener('mouseenter', () => {\n if (window.getComputedStyle(this.host).visibility === 'visible') {\n clearTimeout(closeTimeoutID);\n }\n });\n\n this.host?.addEventListener('mouseleave', () => {\n clearTimeout(openTimeoutID);\n this.handleClose();\n });\n\n this.targetElement?.addEventListener('click', () => {\n if (window.getComputedStyle(this.host).visibility === 'hidden') {\n openTimeoutID = setTimeout(() => {\n this.host.style.visibility = 'visible';\n }, typeof this.delay === 'number' && this.delay > 250 ? this.delay : 250);\n } else {\n clearTimeout(openTimeoutID);\n this.handleClose();\n }\n });\n \n document?.addEventListener('click', (event: MouseEvent) => {\n if(!this.targetElement.contains(event.target as HTMLElement) && !this.host.contains(event.target as HTMLElement)) {\n clearTimeout(openTimeoutID);\n this.handleClose();\n }\n });\n }\n\n setTimeout(() => {\n this.setPosition(this.targetElement);\n }, 100);\n }\n\n setStyle() {\n this.styles = {\n ...this.styles,\n '--max-width': this.maxWidth,\n '--base-spacing': window.CuraAPI.theme.spacing.getSpacing(),\n '--neutral-purewhite': window.CuraAPI.theme.colors.getColor(`neutral-purewhite`),\n '--neutral-light': window.CuraAPI.theme.colors.getColor(`neutral-light`),\n '--neutral-black-shadow': window.CuraAPI.theme.colors.getColor(`neutral-black`, 0.16),\n }\n }\n\n getClasses() {\n const [firstPosition, secondPosition] = this.position.split('-');\n const classes = {};\n\n classes['container'] = true;\n if (firstPosition) { classes[firstPosition] = true; }\n if (secondPosition) { classes[secondPosition] = true; }\n\n return classes;\n }\n\n setPosition(element: HTMLElement) {\n const windowWidth = window.innerWidth;\n const windowHeight = window.innerHeight;\n const container = this.host.shadowRoot.querySelector('.container') as HTMLElement;\n\n this.isMobile = windowWidth <= BREAKPOINT_SMALL_MAX;\n\n this.host.style.position = this.isMobile ? 'fixed' : 'absolute';\n this.host.style.bottom = this.isMobile ? '0' : 'unset';\n container.style.flexDirection = this.isMobile ? 'column' : 'row';\n\n if (this.isMobile) {\n this.host.style.left = '0';\n this.host.style.top = 'unset';\n return;\n }\n\n const elementRect = { \n top: element.offsetTop, \n left: element.offsetLeft, \n width: element.offsetWidth, \n height: element.offsetHeight\n };\n const tooltipRect = this.host.getBoundingClientRect();\n\n const SCREEN_LIMIT = 10;\n const SPACE_TO_ELEMENT = 10;\n const ARROW_HORIZONTAL_ADJUSTMENT = (elementRect.width * 0.5) + 18;\n const ARROW_VERTICAL_ADJUSTMENT = (elementRect.height * 0.5) + 18;\n const BORDER_COLOR = this.styles['--neutral-light'];\n\n let left = 0;\n let top = 0;\n\n const positions = Object.keys(this.getClasses()).filter((p) => ['top', 'left', 'bottom', 'right', 'start', 'end'].includes(p));\n\n const setArrowProperties = ({ arrowTop = '', arrowLeft = '', translate = '', borderColor = '' }) => {\n if (arrowLeft) this.host.style.setProperty('--arrow-left', arrowLeft);\n if (arrowTop) this.host.style.setProperty('--arrow-top', arrowTop);\n if (translate) this.host.style.setProperty('--arrow-translate', translate);\n if (borderColor) this.host.style.setProperty('--arrow-border-color', borderColor);\n };\n\n //Posicionamento vertical\n if (positions.includes('top') || positions.includes('bottom')) {\n setArrowProperties({ arrowLeft: '50%', translate: 'translateX(-50%)' });\n\n if (positions.includes('top')) {\n top = elementRect.top - tooltipRect.height - SPACE_TO_ELEMENT;\n setArrowProperties({ arrowTop: 'calc(100% - 6px)', borderColor: `transparent ${BORDER_COLOR} ${BORDER_COLOR} transparent` });\n\n if (top < SCREEN_LIMIT) {\n top = elementRect.top + elementRect.height + SPACE_TO_ELEMENT;\n setArrowProperties({ arrowTop: '-6px', borderColor: `${BORDER_COLOR} transparent transparent ${BORDER_COLOR}` });\n }\n }\n\n if (positions.includes('bottom')) {\n top = elementRect.top + elementRect.height + SPACE_TO_ELEMENT;\n setArrowProperties({ arrowTop: '-6px', borderColor: `${BORDER_COLOR} transparent transparent ${BORDER_COLOR}` });\n\n if (top + tooltipRect.height > windowHeight - SCREEN_LIMIT) {\n top = elementRect.top - tooltipRect.height - SPACE_TO_ELEMENT;\n setArrowProperties({ arrowTop: 'calc(100% - 6px)', borderColor: `transparent ${BORDER_COLOR} ${BORDER_COLOR} transparent` });\n }\n }\n\n left = elementRect.left + (elementRect.width - tooltipRect.width)/2;\n \n if (positions.includes('start')) {\n left = elementRect.left - tooltipRect.width + ARROW_HORIZONTAL_ADJUSTMENT;\n setArrowProperties({ arrowLeft: 'calc(100% - 18px)' });\n\n if (left < SCREEN_LIMIT) {\n left = elementRect.left + elementRect.width - ARROW_HORIZONTAL_ADJUSTMENT;\n setArrowProperties({ arrowLeft: '18px' });\n }\n }\n\n if (positions.includes('end')) {\n left = elementRect.left + elementRect.width - ARROW_HORIZONTAL_ADJUSTMENT;\n setArrowProperties({ arrowLeft: '18px' });\n\n if (left + tooltipRect.width > windowWidth - SCREEN_LIMIT) {\n left = elementRect.left - tooltipRect.width + ARROW_HORIZONTAL_ADJUSTMENT;\n setArrowProperties({ arrowLeft: 'calc(100% - 18px)' });\n }\n }\n }\n\n //Posicionamento horizontal\n if (positions.includes('right') || positions.includes('left')) {\n setArrowProperties({ arrowTop: '50%', translate: 'translateY(-50%)' });\n\n if (positions.includes('right')) {\n left = elementRect.left + elementRect.width + SPACE_TO_ELEMENT;\n setArrowProperties({ arrowLeft: '-6px', borderColor: `transparent transparent ${BORDER_COLOR} ${BORDER_COLOR}` });\n\n if (left + tooltipRect.width > windowWidth - SCREEN_LIMIT) {\n left = elementRect.left - tooltipRect.width - SPACE_TO_ELEMENT;\n setArrowProperties({ arrowLeft: 'calc(100% - 6px)', borderColor: `${BORDER_COLOR} ${BORDER_COLOR} transparent transparent` });\n }\n }\n\n if (positions.includes('left')) {\n left = elementRect.left - tooltipRect.width - SPACE_TO_ELEMENT;\n setArrowProperties({ arrowLeft: 'calc(100% - 6px)', borderColor: `${BORDER_COLOR} ${BORDER_COLOR} transparent transparent` });\n \n if (left < SCREEN_LIMIT) {\n left = elementRect.left + elementRect.width + SPACE_TO_ELEMENT;\n setArrowProperties({ arrowLeft: '-6px', borderColor: `transparent transparent ${BORDER_COLOR} ${BORDER_COLOR}` });\n }\n }\n \n top = elementRect.top + (elementRect.height - tooltipRect.height)/2;\n\n if (positions.includes('start')) {\n top = elementRect.top - tooltipRect.height + ARROW_VERTICAL_ADJUSTMENT;\n setArrowProperties({ arrowTop: 'calc(100% - 18px)' });\n\n if (top < SCREEN_LIMIT) {\n top = elementRect.top + elementRect.height - ARROW_VERTICAL_ADJUSTMENT;\n setArrowProperties({ arrowTop: '18px' });\n }\n }\n\n if (positions.includes('end')) {\n top = elementRect.top + elementRect.height - ARROW_VERTICAL_ADJUSTMENT;\n setArrowProperties({ arrowTop: '18px' });\n\n if (top + tooltipRect.height > windowHeight - SCREEN_LIMIT) {\n top = elementRect.top - tooltipRect.height + ARROW_VERTICAL_ADJUSTMENT;\n setArrowProperties({ arrowTop: 'calc(100% - 18px)' });\n }\n }\n }\n\n this.host.style.left = `${left}px`;\n this.host.style.top = `${top}px`;\n }\n\n closeContainer() {\n this.host.style.visibility = 'hidden';\n this.tooltipClosed.emit();\n }\n\n handleClose = () => {\n this.closeContainer();\n };\n}\n"],"version":3}
|