@rededor/cura 1.6.0-alpha.4 → 1.6.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_18.cjs.entry.js +49 -48
- package/dist/cjs/cura-accordion_18.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-alert.cjs.entry.js +1 -1
- package/dist/cjs/cura-badge-counter.cjs.entry.js +1 -1
- package/dist/cjs/cura-badge-dot.cjs.entry.js +1 -1
- package/dist/cjs/cura-badge-pill.cjs.entry.js +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-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 +2 -2
- package/dist/cjs/cura-dropdown-search-not-found.cjs.entry.js +1 -1
- package/dist/cjs/cura-dropdown-search-not-found.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 +2 -2
- package/dist/cjs/cura-loader-bar.cjs.entry.js +2 -2
- package/dist/cjs/cura-modal.cjs.entry.js +1 -1
- package/dist/cjs/cura-progress-bar_2.cjs.entry.js +1 -1
- package/dist/cjs/cura-radio.cjs.entry.js +2 -2
- package/dist/cjs/cura-stepper.cjs.entry.js +1 -1
- package/dist/cjs/cura-switch.cjs.entry.js +2 -2
- 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 +2 -2
- package/dist/cjs/{index-12d54921.js → index-60783089.js} +2 -5
- package/dist/cjs/index-60783089.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +4 -7
- package/dist/collection/components/cura-dropdown-search/cura-dropdown-search-category/cura-dropdown-search-category.js.map +1 -0
- package/dist/collection/components/{cura-dropdown-search-new → cura-dropdown-search}/cura-dropdown-search-category/cura-dropdown-search-category.stories.js +1 -1
- package/dist/collection/components/cura-dropdown-search/cura-dropdown-search-category/cura-dropdown-search-category.stories.js.map +1 -0
- package/dist/collection/components/cura-dropdown-search/cura-dropdown-search-not-found/cura-dropdown-search-not-found.js.map +1 -0
- package/dist/collection/components/{cura-dropdown-search-new → cura-dropdown-search}/cura-dropdown-search-not-found/cura-dropdown-search-not-found.stories.js +2 -2
- package/dist/collection/components/cura-dropdown-search/cura-dropdown-search-not-found/cura-dropdown-search-not-found.stories.js.map +1 -0
- package/dist/collection/components/{cura-dropdown-search-new/cura-dropdown-search-option-new/cura-dropdown-search-option-new.css → cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.css} +2 -0
- package/dist/collection/components/{cura-dropdown-search-new/cura-dropdown-search-option-new/cura-dropdown-search-option-new.js → cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js} +6 -6
- package/dist/collection/components/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js.map +1 -0
- package/dist/collection/components/{cura-dropdown-search-new/cura-dropdown-search-option-new/cura-dropdown-search-option-new.stories.js → cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.js} +5 -5
- package/dist/collection/components/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.js.map +1 -0
- package/dist/collection/components/{cura-dropdown-search-new/cura-dropdown-search-new.js → cura-dropdown-search/cura-dropdown-search.js} +11 -10
- package/dist/collection/components/cura-dropdown-search/cura-dropdown-search.js.map +1 -0
- package/dist/collection/components/{cura-dropdown-search-new/cura-dropdown-search-new.stories.js → cura-dropdown-search/cura-dropdown-search.stories.js} +25 -25
- package/dist/collection/components/cura-dropdown-search/cura-dropdown-search.stories.js.map +1 -0
- package/dist/collection/components/forms/cura-input-date/cura-input-date.js +1 -1
- package/dist/collection/components/forms/cura-label/cura-label.css +1 -0
- 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.css +1 -0
- package/dist/collection/components/text/cura-heading/cura-heading.js +1 -1
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.css +3 -0
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +1 -1
- package/dist/components/cura-display.js +1 -1
- package/dist/components/cura-dropdown-search-category.js.map +1 -1
- package/dist/components/cura-dropdown-search-not-found.js.map +1 -1
- package/dist/components/cura-dropdown-search-option.js +40 -52
- package/dist/components/cura-dropdown-search-option.js.map +1 -1
- package/dist/components/cura-dropdown-search.js +283 -236
- package/dist/components/cura-dropdown-search.js.map +1 -1
- package/dist/components/cura-heading2.js +2 -2
- package/dist/components/cura-heading2.js.map +1 -1
- package/dist/components/cura-input-date.js +1 -1
- package/dist/components/cura-input-text2.js +38 -38
- package/dist/components/cura-input-text2.js.map +1 -1
- package/dist/components/cura-label2.js +2 -2
- package/dist/components/cura-label2.js.map +1 -1
- package/dist/components/cura-loader-bar2.js +1 -1
- package/dist/components/cura-loader-circle2.js +1 -1
- package/dist/components/cura-paragraph2.js +2 -2
- package/dist/components/cura-paragraph2.js.map +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/index.js +0 -6
- 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-5afb630e.entry.js → p-07817634.entry.js} +2 -2
- package/dist/cura/{p-24cd591e.entry.js → p-1016108a.entry.js} +2 -2
- package/dist/cura/{p-fc9584dd.entry.js → p-174d220e.entry.js} +2 -2
- package/dist/cura/{p-d227469a.entry.js → p-186392b7.entry.js} +2 -2
- package/dist/cura/{p-d25142cd.entry.js → p-197213c0.entry.js} +2 -2
- package/dist/cura/{p-bf69b32f.entry.js → p-25932952.entry.js} +2 -2
- package/dist/cura/{p-89671cd4.entry.js → p-3519d0ba.entry.js} +2 -2
- package/dist/cura/{p-02c2b948.entry.js → p-38777561.entry.js} +2 -2
- package/dist/cura/{p-6243742a.entry.js → p-3c305dbd.entry.js} +2 -2
- package/dist/cura/{p-f1098b41.entry.js → p-405a50de.entry.js} +2 -2
- package/dist/cura/{p-af3ac476.js → p-4ee8efca.js} +3 -3
- package/dist/cura/p-4ee8efca.js.map +1 -0
- package/dist/cura/{p-bfaf9964.entry.js → p-53d68d72.entry.js} +2 -2
- package/dist/cura/p-5b928e46.entry.js +2 -0
- package/dist/cura/p-5b928e46.entry.js.map +1 -0
- package/dist/cura/{p-506747fb.entry.js → p-62c1b0f4.entry.js} +2 -2
- package/dist/cura/{p-0a391c03.entry.js → p-6f7f157e.entry.js} +2 -2
- package/dist/cura/{p-635c0f4d.entry.js → p-777decf9.entry.js} +2 -2
- package/dist/cura/{p-8fb3bede.entry.js → p-a1782f0e.entry.js} +2 -2
- package/dist/cura/{p-d2da92d9.entry.js → p-ac0c90af.entry.js} +2 -2
- package/dist/cura/{p-86d317f3.entry.js → p-b254bbe4.entry.js} +2 -2
- package/dist/cura/p-b254bbe4.entry.js.map +1 -0
- package/dist/cura/{p-9214ee88.entry.js → p-d77df3f0.entry.js} +2 -2
- package/dist/cura/{p-18af52e4.entry.js → p-d7f46266.entry.js} +2 -2
- package/dist/cura/{p-02717e7d.entry.js → p-e1916252.entry.js} +2 -2
- package/dist/cura/{p-500f1256.entry.js → p-fc1fd622.entry.js} +2 -2
- package/dist/esm/cura-accordion_18.entry.js +48 -47
- package/dist/esm/cura-accordion_18.entry.js.map +1 -1
- package/dist/esm/cura-alert.entry.js +1 -1
- package/dist/esm/cura-badge-counter.entry.js +1 -1
- package/dist/esm/cura-badge-dot.entry.js +1 -1
- package/dist/esm/cura-badge-pill.entry.js +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-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 +2 -2
- package/dist/esm/cura-dropdown-search-not-found.entry.js +1 -1
- package/dist/esm/cura-dropdown-search-not-found.entry.js.map +1 -1
- package/dist/esm/cura-icons-view.entry.js +1 -1
- package/dist/esm/cura-input-date.entry.js +2 -2
- package/dist/esm/cura-loader-bar.entry.js +2 -2
- package/dist/esm/cura-modal.entry.js +1 -1
- package/dist/esm/cura-progress-bar_2.entry.js +1 -1
- package/dist/esm/cura-radio.entry.js +2 -2
- package/dist/esm/cura-stepper.entry.js +1 -1
- package/dist/esm/cura-switch.entry.js +2 -2
- package/dist/esm/cura-toast.entry.js +1 -1
- package/dist/esm/cura-tooltip.entry.js +1 -1
- package/dist/esm/cura.js +3 -3
- package/dist/esm/{index-717b36df.js → index-21683715.js} +2 -5
- package/dist/esm/index-21683715.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/{cura-dropdown-search-new/cura-dropdown-search-option-new/cura-dropdown-search-option-new.d.ts → cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.d.ts} +1 -1
- package/dist/types/components/{cura-dropdown-search-new/cura-dropdown-search-option-new/cura-dropdown-search-option-new.stories.d.ts → cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.d.ts} +1 -1
- package/dist/types/components/{cura-dropdown-search-new/cura-dropdown-search-new.d.ts → cura-dropdown-search/cura-dropdown-search.d.ts} +1 -1
- package/dist/types/components.d.ts +12 -211
- package/package.json +2 -2
- package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js +0 -22
- package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js.map +0 -1
- package/dist/cjs/cura-dropdown-search-option.cjs.entry.js +0 -65
- package/dist/cjs/cura-dropdown-search-option.cjs.entry.js.map +0 -1
- package/dist/cjs/cura-dropdown-search.cjs.entry.js +0 -285
- package/dist/cjs/cura-dropdown-search.cjs.entry.js.map +0 -1
- package/dist/cjs/index-12d54921.js.map +0 -1
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-category/cura-dropdown-search-category.js.map +0 -1
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-category/cura-dropdown-search-category.stories.js.map +0 -1
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-new.js.map +0 -1
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-new.stories.js.map +0 -1
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-not-found/cura-dropdown-search-not-found.js.map +0 -1
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-not-found/cura-dropdown-search-not-found.stories.js.map +0 -1
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-option-new/cura-dropdown-search-option-new.js.map +0 -1
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-option-new/cura-dropdown-search-option-new.stories.js.map +0 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.css +0 -76
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js +0 -164
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js.map +0 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.js +0 -65
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.js.map +0 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.css +0 -10
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.js +0 -19
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.js.map +0 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.css +0 -158
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js +0 -534
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js.map +0 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.stories.js +0 -218
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.stories.js.map +0 -1
- package/dist/components/cura-dropdown-search-new.d.ts +0 -11
- package/dist/components/cura-dropdown-search-new.js +0 -400
- package/dist/components/cura-dropdown-search-new.js.map +0 -1
- package/dist/components/cura-dropdown-search-option-new.d.ts +0 -11
- package/dist/components/cura-dropdown-search-option-new.js +0 -81
- package/dist/components/cura-dropdown-search-option-new.js.map +0 -1
- package/dist/components/cura-dropdown-search-option-title.d.ts +0 -11
- package/dist/components/cura-dropdown-search-option-title.js +0 -42
- package/dist/components/cura-dropdown-search-option-title.js.map +0 -1
- package/dist/cura/p-46994182.entry.js +0 -2
- package/dist/cura/p-46994182.entry.js.map +0 -1
- package/dist/cura/p-86d317f3.entry.js.map +0 -1
- package/dist/cura/p-af3ac476.js.map +0 -1
- package/dist/cura/p-b1d6ee8d.entry.js +0 -2
- package/dist/cura/p-b1d6ee8d.entry.js.map +0 -1
- package/dist/cura/p-b3582389.entry.js +0 -2
- package/dist/cura/p-b3582389.entry.js.map +0 -1
- package/dist/cura/p-ee7328a5.entry.js +0 -2
- package/dist/cura/p-ee7328a5.entry.js.map +0 -1
- package/dist/esm/cura-dropdown-search-option-title.entry.js +0 -18
- package/dist/esm/cura-dropdown-search-option-title.entry.js.map +0 -1
- package/dist/esm/cura-dropdown-search-option.entry.js +0 -61
- package/dist/esm/cura-dropdown-search-option.entry.js.map +0 -1
- package/dist/esm/cura-dropdown-search.entry.js +0 -281
- package/dist/esm/cura-dropdown-search.entry.js.map +0 -1
- package/dist/esm/index-717b36df.js.map +0 -1
- package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.d.ts +0 -31
- package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.d.ts +0 -55
- package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.d.ts +0 -3
- package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.d.ts +0 -142
- package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.stories.d.ts +0 -157
- /package/dist/collection/components/{cura-dropdown-search-new → cura-dropdown-search}/cura-dropdown-search-category/cura-dropdown-search-category.css +0 -0
- /package/dist/collection/components/{cura-dropdown-search-new → cura-dropdown-search}/cura-dropdown-search-category/cura-dropdown-search-category.js +0 -0
- /package/dist/collection/components/{cura-dropdown-search-new → cura-dropdown-search}/cura-dropdown-search-not-found/cura-dropdown-search-not-found.css +0 -0
- /package/dist/collection/components/{cura-dropdown-search-new → cura-dropdown-search}/cura-dropdown-search-not-found/cura-dropdown-search-not-found.js +0 -0
- /package/dist/collection/components/{cura-dropdown-search-new/cura-dropdown-search-new.css → cura-dropdown-search/cura-dropdown-search.css} +0 -0
- /package/dist/cura/{p-5afb630e.entry.js.map → p-07817634.entry.js.map} +0 -0
- /package/dist/cura/{p-24cd591e.entry.js.map → p-1016108a.entry.js.map} +0 -0
- /package/dist/cura/{p-fc9584dd.entry.js.map → p-174d220e.entry.js.map} +0 -0
- /package/dist/cura/{p-d227469a.entry.js.map → p-186392b7.entry.js.map} +0 -0
- /package/dist/cura/{p-d25142cd.entry.js.map → p-197213c0.entry.js.map} +0 -0
- /package/dist/cura/{p-bf69b32f.entry.js.map → p-25932952.entry.js.map} +0 -0
- /package/dist/cura/{p-89671cd4.entry.js.map → p-3519d0ba.entry.js.map} +0 -0
- /package/dist/cura/{p-02c2b948.entry.js.map → p-38777561.entry.js.map} +0 -0
- /package/dist/cura/{p-6243742a.entry.js.map → p-3c305dbd.entry.js.map} +0 -0
- /package/dist/cura/{p-f1098b41.entry.js.map → p-405a50de.entry.js.map} +0 -0
- /package/dist/cura/{p-bfaf9964.entry.js.map → p-53d68d72.entry.js.map} +0 -0
- /package/dist/cura/{p-506747fb.entry.js.map → p-62c1b0f4.entry.js.map} +0 -0
- /package/dist/cura/{p-0a391c03.entry.js.map → p-6f7f157e.entry.js.map} +0 -0
- /package/dist/cura/{p-635c0f4d.entry.js.map → p-777decf9.entry.js.map} +0 -0
- /package/dist/cura/{p-8fb3bede.entry.js.map → p-a1782f0e.entry.js.map} +0 -0
- /package/dist/cura/{p-d2da92d9.entry.js.map → p-ac0c90af.entry.js.map} +0 -0
- /package/dist/cura/{p-9214ee88.entry.js.map → p-d77df3f0.entry.js.map} +0 -0
- /package/dist/cura/{p-18af52e4.entry.js.map → p-d7f46266.entry.js.map} +0 -0
- /package/dist/cura/{p-02717e7d.entry.js.map → p-e1916252.entry.js.map} +0 -0
- /package/dist/cura/{p-500f1256.entry.js.map → p-fc1fd622.entry.js.map} +0 -0
- /package/dist/types/components/{cura-dropdown-search-new → cura-dropdown-search}/cura-dropdown-search-category/cura-dropdown-search-category.d.ts +0 -0
- /package/dist/types/components/{cura-dropdown-search-new → cura-dropdown-search}/cura-dropdown-search-category/cura-dropdown-search-category.stories.d.ts +0 -0
- /package/dist/types/components/{cura-dropdown-search-new → cura-dropdown-search}/cura-dropdown-search-not-found/cura-dropdown-search-not-found.d.ts +0 -0
- /package/dist/types/components/{cura-dropdown-search-new → cura-dropdown-search}/cura-dropdown-search-not-found/cura-dropdown-search-not-found.stories.d.ts +0 -0
- /package/dist/types/components/{cura-dropdown-search-new/cura-dropdown-search-new.stories.d.ts → cura-dropdown-search/cura-dropdown-search.stories.d.ts} +0 -0
|
@@ -1,11 +1,64 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { a as addBodyScrollLockClass, r as removeBodyScrollLockClass, c as checkMobile, d as defineCustomElement$4, b as checkIOS } from './cura-input-text2.js';
|
|
2
3
|
import { d as defineCustomElement$6 } from './cura-button-transparent2.js';
|
|
3
4
|
import { d as defineCustomElement$5 } from './cura-icon2.js';
|
|
4
|
-
import { d as defineCustomElement$4 } from './cura-input-text2.js';
|
|
5
5
|
import { d as defineCustomElement$3 } from './cura-label2.js';
|
|
6
6
|
import { d as defineCustomElement$2 } from './cura-loader-circle2.js';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
class FixedElementScrollBehavior {
|
|
9
|
+
constructor(hostElement, scrollableElement) {
|
|
10
|
+
this._stopPropagationEvent = (e) => {
|
|
11
|
+
if (this.scrollableElement.scrollHeight <= this.scrollableElement.clientHeight) {
|
|
12
|
+
e.preventDefault();
|
|
13
|
+
}
|
|
14
|
+
e.stopPropagation();
|
|
15
|
+
};
|
|
16
|
+
this._preventEvent = (ev) => {
|
|
17
|
+
ev.preventDefault();
|
|
18
|
+
ev.stopPropagation();
|
|
19
|
+
};
|
|
20
|
+
if (!hostElement || !scrollableElement) {
|
|
21
|
+
console.error("Componentes host ou scrollable não foram informados corretamente ou não existem.");
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
this.hostElement = hostElement;
|
|
25
|
+
this.scrollableElement = scrollableElement;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
disableScroll() {
|
|
29
|
+
this.scrollPosition = window.scrollY;
|
|
30
|
+
window.scrollTo({ top: 0, behavior: 'instant' });
|
|
31
|
+
addBodyScrollLockClass();
|
|
32
|
+
this._addEvents();
|
|
33
|
+
}
|
|
34
|
+
enableScroll() {
|
|
35
|
+
removeBodyScrollLockClass();
|
|
36
|
+
window.scrollTo({ top: this.scrollPosition, behavior: 'instant' });
|
|
37
|
+
this._removeEvents();
|
|
38
|
+
}
|
|
39
|
+
_addEvents() {
|
|
40
|
+
this.hostElement.addEventListener('wheel', this._preventEvent, { passive: false });
|
|
41
|
+
this.hostElement.addEventListener('mousewheel', this._preventEvent, { passive: false });
|
|
42
|
+
this.hostElement.addEventListener('touchmove', this._preventEvent, { passive: false });
|
|
43
|
+
this.hostElement.addEventListener('scroll', this._preventEvent, { passive: false });
|
|
44
|
+
this.scrollableElement.addEventListener('wheel', this._stopPropagationEvent, { passive: false });
|
|
45
|
+
this.scrollableElement.addEventListener('mousewheel', this._stopPropagationEvent, { passive: false });
|
|
46
|
+
this.scrollableElement.addEventListener('touchmove', this._stopPropagationEvent, { passive: false });
|
|
47
|
+
this.scrollableElement.addEventListener('scroll', this._stopPropagationEvent, { passive: false });
|
|
48
|
+
}
|
|
49
|
+
_removeEvents() {
|
|
50
|
+
this.hostElement.removeEventListener('wheel', this._preventEvent);
|
|
51
|
+
this.hostElement.removeEventListener('mousewheel', this._preventEvent);
|
|
52
|
+
this.hostElement.removeEventListener('touchmove', this._preventEvent);
|
|
53
|
+
this.hostElement.removeEventListener('scroll', this._preventEvent);
|
|
54
|
+
this.scrollableElement.removeEventListener('wheel', this._stopPropagationEvent);
|
|
55
|
+
this.scrollableElement.removeEventListener('mousewheel', this._stopPropagationEvent);
|
|
56
|
+
this.scrollableElement.removeEventListener('touchmove', this._stopPropagationEvent);
|
|
57
|
+
this.scrollableElement.removeEventListener('scroll', this._stopPropagationEvent);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const curaDropdownSearchCss = ":host{display:block;box-sizing:border-box;position:relative}:host .component-controls{display:flex;align-items:center;justify-content:center;gap:calc(var(--cura-spacing-base) * 1px)}:host .component-controls #button-back{padding:0 0 0 calc(var(--cura-spacing-base) * 3px);width:max-content}:host .component-container{box-sizing:border-box;width:100%;position:relative;display:grid;grid-template-columns:1fr;grid-template-rows:min-content 1fr}:host .component-container.zoom{position:fixed;top:0;left:0;width:100vw;background:var(--purewhite);height:var(--height);z-index:9999;overscroll-behavior:contain}:host .component-container.zoom .component-controls{border-bottom:2px solid var(--primary);padding:calc(var(--cura-spacing-base) * 3px) 0}:host .component-container.zoom.error .component-controls{border-bottom:2px solid var(--error-dark);background-color:var(--error-lighter)}:host .component-container .dropdown-container{box-sizing:border-box;width:100%;overflow-y:auto;overflow-x:hidden;display:flex;flex-direction:column;padding:calc(var(--cura-spacing-base) * 3px);overscroll-behavior:contain}:host .component-container:not(.zoom) .dropdown-container{box-shadow:0px 4px 8px 0px var(--neutral-black-shadow, rgba(38, 38, 38, 0.16));position:absolute;bottom:0;left:0;transform:translateY(100%);max-height:var(--max-height);background-color:var(--purewhite);border-radius:0px 0px calc(var(--cura-spacing-base) * 1px) calc(var(--cura-spacing-base) * 1px);border-bottom:2px solid var(--neutral-light);border-left:2px solid var(--neutral-light);border-right:2px solid var(--neutral-light);display:none;z-index:9997}:host .component-container:not(.zoom).dropdown-visible ::part(cura-input-field){border-radius:4px 4px 0px 0px}:host .component-container:not(.zoom).dropdown-visible ::part(cura-input-text-helper){height:0px;overflow:hidden;margin-top:0px}:host .component-container:not(.zoom).dropdown-visible .dropdown-container{display:block}";
|
|
9
62
|
const CuraDropdownSearchStyle0 = curaDropdownSearchCss;
|
|
10
63
|
|
|
11
64
|
const CuraDropdownSearch$1 = /*@__PURE__*/ proxyCustomElement(class CuraDropdownSearch extends HTMLElement {
|
|
@@ -13,299 +66,293 @@ const CuraDropdownSearch$1 = /*@__PURE__*/ proxyCustomElement(class CuraDropdown
|
|
|
13
66
|
super();
|
|
14
67
|
this.__registerHost();
|
|
15
68
|
this.__attachShadow();
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
18
|
-
this.
|
|
19
|
-
this.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
69
|
+
this.termchange = createEvent(this, "termchange", 7);
|
|
70
|
+
this.optionselect = createEvent(this, "optionselect", 7);
|
|
71
|
+
this.resizeTimeoutMs = 66;
|
|
72
|
+
this.focusTimeoutMs = 300;
|
|
73
|
+
this.blurTimeoutMs = 300;
|
|
74
|
+
this.highlightedIndex = -1;
|
|
75
|
+
this.dropdownSelectableItems = [];
|
|
76
|
+
this.handleSlotChange = () => { this.getSlotElements(); };
|
|
77
|
+
this.handleWindowResize = () => {
|
|
78
|
+
if (this.resizeTimeout)
|
|
79
|
+
clearTimeout(this.resizeTimeout);
|
|
80
|
+
this.resizeTimeout = setTimeout(() => {
|
|
81
|
+
this.isMobile = checkMobile();
|
|
82
|
+
this.setZoomHeight();
|
|
83
|
+
}, this.resizeTimeoutMs);
|
|
84
|
+
};
|
|
85
|
+
this.handleFocus = () => {
|
|
86
|
+
if (this.focusTimeout)
|
|
87
|
+
clearTimeout(this.focusTimeout);
|
|
88
|
+
this.focusTimeout = setTimeout(() => {
|
|
89
|
+
this.isOnFocus = true;
|
|
90
|
+
this.clearHighlight();
|
|
91
|
+
if (this.isMobile && !this.zoomState)
|
|
92
|
+
this.enterZoom();
|
|
93
|
+
if (this.zoomState)
|
|
94
|
+
this.setZoomHeight();
|
|
95
|
+
setTimeout(() => {
|
|
96
|
+
var _a;
|
|
97
|
+
(_a = this.selectedOptionElement) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ behavior: 'instant', block: 'nearest', inline: 'nearest' });
|
|
98
|
+
}, 10);
|
|
99
|
+
}, this.focusTimeoutMs);
|
|
100
|
+
};
|
|
101
|
+
this.handleBlur = () => {
|
|
102
|
+
if (this.blurTimeout)
|
|
103
|
+
clearTimeout(this.blurTimeout);
|
|
104
|
+
this.blurTimeout = setTimeout(() => {
|
|
105
|
+
if (this.zoomState) {
|
|
106
|
+
const delay = checkIOS ? 500 : 100;
|
|
107
|
+
setTimeout(() => this.setZoomHeight(), delay);
|
|
28
108
|
}
|
|
29
|
-
|
|
109
|
+
this.isOnFocus = false;
|
|
110
|
+
}, this.blurTimeoutMs);
|
|
30
111
|
};
|
|
31
|
-
this.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
this.updateHoveredIndex();
|
|
112
|
+
this.handleFocusout = () => {
|
|
113
|
+
if (this.zoomState)
|
|
114
|
+
this.setZoomHeight();
|
|
35
115
|
};
|
|
36
|
-
this.
|
|
37
|
-
|
|
38
|
-
this.
|
|
39
|
-
this.
|
|
116
|
+
this.handleBackClick = () => { this.exitZoom(); };
|
|
117
|
+
this.handleOptionActionClick = (ev) => {
|
|
118
|
+
this.getInputElement().setFocus();
|
|
119
|
+
this._preventEvent(ev);
|
|
40
120
|
};
|
|
41
|
-
this.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
else if (event.key === 'ArrowUp') {
|
|
47
|
-
event.preventDefault();
|
|
48
|
-
this.moveHighlight(-1);
|
|
49
|
-
}
|
|
50
|
-
else if (event.key === 'Enter') {
|
|
51
|
-
event.preventDefault();
|
|
52
|
-
if (this.hoveredIndex > -1) {
|
|
53
|
-
this.handleOnBlur();
|
|
54
|
-
this.onSelectedOption(this.hoveredIndex);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
121
|
+
this.handleInputClear = (ev) => {
|
|
122
|
+
this.setValue('');
|
|
123
|
+
this.clearSelectedOptions();
|
|
124
|
+
this._preventEvent(ev);
|
|
57
125
|
};
|
|
58
|
-
this.
|
|
59
|
-
this.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
this.removeOverlay();
|
|
67
|
-
}
|
|
126
|
+
this.handleSelectOption = (ev) => {
|
|
127
|
+
this._selectOption(ev.detail);
|
|
128
|
+
this._preventEvent(ev);
|
|
129
|
+
};
|
|
130
|
+
this.handleInputValueChange = (ev) => {
|
|
131
|
+
this.setValue(ev.detail);
|
|
132
|
+
if (this.selectedOptionElement && ev.detail !== this.selectedOptionElement.value) {
|
|
133
|
+
this.clearSelectedOptions();
|
|
68
134
|
}
|
|
135
|
+
this._preventEvent(ev);
|
|
136
|
+
};
|
|
137
|
+
this.handleDropdownMouseOver = () => {
|
|
138
|
+
if (this.highlightedElement || this.highlightedIndex >= 0)
|
|
139
|
+
this.clearHighlight();
|
|
69
140
|
};
|
|
70
|
-
this.
|
|
71
|
-
|
|
72
|
-
|
|
141
|
+
this.handleKeyDown = (ev) => {
|
|
142
|
+
if (ev.key === 'ArrowDown')
|
|
143
|
+
this.moveHighlight('next');
|
|
144
|
+
if (ev.key === 'ArrowUp')
|
|
145
|
+
this.moveHighlight('prev');
|
|
146
|
+
if (ev.key === 'Enter')
|
|
147
|
+
this.selectHighlight();
|
|
73
148
|
};
|
|
149
|
+
this.getInputElement = () => { var _a; return (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('cura-input-text'); };
|
|
150
|
+
this._preventEvent = (ev) => {
|
|
151
|
+
ev.preventDefault();
|
|
152
|
+
ev.stopPropagation();
|
|
153
|
+
};
|
|
154
|
+
this.name = undefined;
|
|
74
155
|
this.size = 'large';
|
|
75
156
|
this.status = 'default';
|
|
76
157
|
this.disabled = false;
|
|
77
|
-
this.name = undefined;
|
|
78
158
|
this.required = false;
|
|
79
|
-
this.selected = false;
|
|
80
|
-
this.value = '';
|
|
81
159
|
this.placeholder = '';
|
|
82
160
|
this.label = '';
|
|
83
|
-
this.
|
|
84
|
-
this.
|
|
85
|
-
this.
|
|
86
|
-
this.
|
|
161
|
+
this.icon = 'search';
|
|
162
|
+
this.maxheight = '400px';
|
|
163
|
+
this.value = '';
|
|
164
|
+
this.searchdelay = 400;
|
|
165
|
+
this.searchminchars = 3;
|
|
87
166
|
this.styles = {};
|
|
88
|
-
this.
|
|
89
|
-
this.
|
|
90
|
-
this.
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
167
|
+
this.zoomState = false;
|
|
168
|
+
this.isOnFocus = false;
|
|
169
|
+
this.dropdownItems = [];
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Set focus to input field.
|
|
173
|
+
*/
|
|
174
|
+
async setFocus() {
|
|
175
|
+
this.getInputElement().setFocus();
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Select by optionid property of a selectable option component.
|
|
179
|
+
*/
|
|
180
|
+
async selectOption(optionid) {
|
|
181
|
+
this._selectOption(optionid);
|
|
96
182
|
}
|
|
97
183
|
connectedCallback() {
|
|
98
184
|
this.weights = window.CuraAPI.theme.fonts.getWeights();
|
|
99
|
-
this.
|
|
100
|
-
this.styles['--
|
|
185
|
+
this.breakpoints = window.CuraAPI.theme.breakpoints.get();
|
|
186
|
+
this.styles['--info'] = window.CuraAPI.theme.colors.getColor('info-base');
|
|
187
|
+
this.styles['--purewhite'] = window.CuraAPI.theme.colors.getColor('neutral-purewhite');
|
|
101
188
|
this.styles['--neutral-light'] = window.CuraAPI.theme.colors.getColor('neutral-light');
|
|
102
189
|
this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor('neutral-dark');
|
|
103
190
|
this.styles['--neutral-black-shadow'] = window.CuraAPI.theme.colors.getColor(`neutral-black`, 0.16);
|
|
104
191
|
this.styles['--error-dark'] = window.CuraAPI.theme.colors.getColor('error-dark');
|
|
105
192
|
this.styles['--error-lighter'] = window.CuraAPI.theme.colors.getColor('error-lighter');
|
|
106
|
-
this.styles['--
|
|
193
|
+
this.styles['--primary'] = window.CuraAPI.theme.colors.getColor('primary');
|
|
107
194
|
this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();
|
|
108
195
|
this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();
|
|
109
196
|
this.styles['--font-weight-medium'] = this.weights.medium;
|
|
197
|
+
window === null || window === void 0 ? void 0 : window.addEventListener('resize', this.handleWindowResize);
|
|
198
|
+
window === null || window === void 0 ? void 0 : window.addEventListener('orientationchange', this.handleWindowResize);
|
|
199
|
+
this.isMobile = checkMobile();
|
|
110
200
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
this.
|
|
114
|
-
this.
|
|
201
|
+
componentDidLoad() {
|
|
202
|
+
var _a;
|
|
203
|
+
this.dropdownElement = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.dropdown-container');
|
|
204
|
+
this.host.addEventListener('actionclick', this.handleOptionActionClick);
|
|
205
|
+
this.host.addEventListener('selectoption', this.handleSelectOption);
|
|
206
|
+
this.scrollBehavior = new FixedElementScrollBehavior(this.host, this.dropdownElement);
|
|
207
|
+
setTimeout(() => this.getSlotElements(), 10);
|
|
115
208
|
}
|
|
116
|
-
|
|
117
|
-
|
|
209
|
+
disconnectedCallback() {
|
|
210
|
+
window === null || window === void 0 ? void 0 : window.removeEventListener('resize', this.handleWindowResize);
|
|
211
|
+
window === null || window === void 0 ? void 0 : window.removeEventListener('orientationchange', this.handleWindowResize);
|
|
118
212
|
}
|
|
119
|
-
|
|
120
|
-
if (this.
|
|
121
|
-
|
|
122
|
-
|
|
213
|
+
moveHighlight(direction) {
|
|
214
|
+
if (!this.dropdownSelectableItems.length)
|
|
215
|
+
return;
|
|
216
|
+
let position = direction === 'next' ? this.highlightedIndex + 1 : this.highlightedIndex - 1;
|
|
217
|
+
if (position < 0) {
|
|
218
|
+
this.clearHighlight();
|
|
219
|
+
return;
|
|
123
220
|
}
|
|
124
|
-
|
|
125
|
-
|
|
221
|
+
const selectableItemsLastPosition = this.dropdownSelectableItems.length - 1;
|
|
222
|
+
if (position > selectableItemsLastPosition)
|
|
223
|
+
position = selectableItemsLastPosition;
|
|
224
|
+
if (this.highlightedElement)
|
|
225
|
+
this.highlightedElement.highlighted = false;
|
|
226
|
+
this.highlightedIndex = position;
|
|
227
|
+
this.highlightedElement = this.dropdownSelectableItems[position];
|
|
228
|
+
if (this.highlightedElement.selected) {
|
|
229
|
+
this.moveHighlight(direction);
|
|
230
|
+
return;
|
|
126
231
|
}
|
|
232
|
+
this.highlightedElement.highlighted = true;
|
|
233
|
+
this.highlightedElement.scrollIntoView({ behavior: 'instant', block: 'nearest', inline: 'nearest' });
|
|
127
234
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
235
|
+
clearHighlight() {
|
|
236
|
+
if (this.highlightedElement) {
|
|
237
|
+
this.highlightedElement.highlighted = false;
|
|
238
|
+
this.highlightedElement = null;
|
|
239
|
+
}
|
|
240
|
+
this.highlightedIndex = -1;
|
|
133
241
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
242
|
+
selectHighlight() {
|
|
243
|
+
if (this.highlightedElement) {
|
|
244
|
+
this._selectOption(this.highlightedElement.optionid);
|
|
245
|
+
this.clearHighlight();
|
|
246
|
+
this.getInputElement().blur();
|
|
247
|
+
}
|
|
138
248
|
}
|
|
139
|
-
|
|
140
|
-
if (
|
|
141
|
-
this.
|
|
142
|
-
this.
|
|
143
|
-
|
|
144
|
-
this.
|
|
145
|
-
|
|
146
|
-
this.
|
|
147
|
-
this.overlayElement.style.height = '100%';
|
|
148
|
-
this.overlayElement.style.zIndex = '9999';
|
|
149
|
-
this.overlayElement.style.backgroundColor = 'white';
|
|
150
|
-
document.body.appendChild(this.overlayElement);
|
|
151
|
-
this.originalOverflow = document.body.style.overflow;
|
|
152
|
-
document.body.style.overflow = 'hidden';
|
|
249
|
+
setValue(value) {
|
|
250
|
+
if (this.value !== value) {
|
|
251
|
+
this.value = value;
|
|
252
|
+
if (this.valueTimeout)
|
|
253
|
+
clearTimeout(this.valueTimeout);
|
|
254
|
+
this.valueTimeout = setTimeout(() => {
|
|
255
|
+
this.termchange.emit(this.value === '' || this.value.length < this.searchminchars ? '' : this.value);
|
|
256
|
+
}, this.searchdelay || 300);
|
|
153
257
|
}
|
|
154
258
|
}
|
|
155
|
-
|
|
156
|
-
if (
|
|
157
|
-
|
|
158
|
-
this.
|
|
159
|
-
|
|
259
|
+
_selectOption(optionid) {
|
|
260
|
+
if (!optionid) {
|
|
261
|
+
this.clearSelectedOptions();
|
|
262
|
+
this.setValue('');
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
const optionElement = this.dropdownSelectableItems.find(option => option.optionid === optionid);
|
|
266
|
+
if (optionElement && !optionElement.selected) {
|
|
267
|
+
this.clearSelectedOptions();
|
|
268
|
+
this.selectedOptionElement = optionElement;
|
|
269
|
+
this.selectedOptionElement.selected = true;
|
|
270
|
+
this.setValue(this.selectedOptionElement.value);
|
|
271
|
+
this.optionselect.emit(this.selectedOptionElement.optionid);
|
|
272
|
+
if (this.zoomState)
|
|
273
|
+
setTimeout(() => this.exitZoom(), this.blurTimeoutMs);
|
|
160
274
|
}
|
|
161
275
|
}
|
|
162
|
-
|
|
163
|
-
this.
|
|
164
|
-
|
|
276
|
+
clearSelectedOptions() {
|
|
277
|
+
this.dropdownSelectableItems.forEach(option => {
|
|
278
|
+
if (option.selected)
|
|
279
|
+
option.selected = false;
|
|
165
280
|
});
|
|
281
|
+
this.selectedOptionElement = null;
|
|
166
282
|
}
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
187
|
-
}, 200);
|
|
188
|
-
}
|
|
189
|
-
moveHighlight(direction) {
|
|
190
|
-
const visibleOptions = this.options;
|
|
191
|
-
const newIndex = (this.hoveredIndex + direction + visibleOptions.length) % visibleOptions.length;
|
|
192
|
-
this.hoveredIndex = newIndex;
|
|
193
|
-
this.updateOptionAttribute('hovered', this.hoveredIndex);
|
|
194
|
-
this.scrollHoveredOptionIntoView();
|
|
283
|
+
getSlotElements() {
|
|
284
|
+
const elements = [];
|
|
285
|
+
const selectable = [];
|
|
286
|
+
let hasNotFound = false;
|
|
287
|
+
if (this.dropdownElement) {
|
|
288
|
+
this.dropdownElement
|
|
289
|
+
.querySelector('slot')
|
|
290
|
+
.assignedElements()
|
|
291
|
+
.forEach(item => {
|
|
292
|
+
elements.push(item);
|
|
293
|
+
if (item.localName === 'cura-dropdown-search-option' && item["selectable"])
|
|
294
|
+
selectable.push(item);
|
|
295
|
+
if (item.localName === 'cura-dropdown-search-not-found')
|
|
296
|
+
hasNotFound = true;
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
this.dropdownSelectableItems = selectable;
|
|
300
|
+
this.dropdownItems = elements;
|
|
301
|
+
this.status = hasNotFound ? 'error' : 'default';
|
|
195
302
|
}
|
|
196
|
-
|
|
197
|
-
this.
|
|
198
|
-
|
|
199
|
-
|
|
303
|
+
enterZoom() {
|
|
304
|
+
this.scrollBehavior.disableScroll();
|
|
305
|
+
this.setZoomHeight();
|
|
306
|
+
this.zoomState = true;
|
|
200
307
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
this.
|
|
308
|
+
exitZoom() {
|
|
309
|
+
this.scrollBehavior.enableScroll();
|
|
310
|
+
this.setZoomHeight();
|
|
311
|
+
setTimeout(() => { this.zoomState = false; }, 300);
|
|
205
312
|
}
|
|
206
|
-
|
|
313
|
+
setZoomHeight() {
|
|
207
314
|
var _a;
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
if (container && hoveredOption) {
|
|
211
|
-
const optionRect = hoveredOption.getBoundingClientRect();
|
|
212
|
-
const containerRect = container.getBoundingClientRect();
|
|
213
|
-
if (optionRect.bottom > containerRect.bottom) {
|
|
214
|
-
container.scrollTop += optionRect.bottom - containerRect.bottom;
|
|
215
|
-
}
|
|
216
|
-
if (optionRect.top < containerRect.top) {
|
|
217
|
-
container.scrollTop -= containerRect.top - optionRect.top;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
handleOnBlur() {
|
|
222
|
-
if (this.isOnBlurInput === true) {
|
|
223
|
-
setTimeout(() => {
|
|
224
|
-
this.isDropdownOpen = false;
|
|
225
|
-
this.resetDropdownStyles();
|
|
226
|
-
this.removeOverlay();
|
|
227
|
-
}, 200);
|
|
228
|
-
}
|
|
315
|
+
const h = window ? `${((_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.height) || window.innerHeight}px` : '100vh';
|
|
316
|
+
this.styles = Object.assign(Object.assign({}, this.styles), { '--height': h });
|
|
229
317
|
}
|
|
230
318
|
getClasses() {
|
|
231
319
|
return {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
320
|
+
"component-container": true,
|
|
321
|
+
"mobile": this.isMobile,
|
|
322
|
+
"zoom": this.zoomState,
|
|
323
|
+
"dropdown-visible": this.isOnFocus && (this.dropdownItems.length > 0 && !this.zoomState),
|
|
324
|
+
"error": this.status === 'error'
|
|
236
325
|
};
|
|
237
326
|
}
|
|
238
|
-
|
|
327
|
+
getHostCSSProperties() {
|
|
239
328
|
return {
|
|
240
|
-
'
|
|
241
|
-
'visible': this.options.length && this.isDropdownOpen ? true : false,
|
|
329
|
+
'--max-height': this.maxheight || '400px'
|
|
242
330
|
};
|
|
243
331
|
}
|
|
244
|
-
hostCSSProperties() {
|
|
245
|
-
return {
|
|
246
|
-
'--dropdown-max-height': this.dropdownMaxHeight,
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
handleOnFocus() {
|
|
250
|
-
this.isDropdownOpen = true;
|
|
251
|
-
}
|
|
252
|
-
getDropdownSearchListHeight() {
|
|
253
|
-
setTimeout(() => {
|
|
254
|
-
var _a;
|
|
255
|
-
const dropdownInputSearchElement = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.dropdown-input-search');
|
|
256
|
-
if (dropdownInputSearchElement) {
|
|
257
|
-
this.host.style.setProperty('--dynamic-input-search-height', `${dropdownInputSearchElement.offsetHeight}px`);
|
|
258
|
-
}
|
|
259
|
-
}, 310);
|
|
260
|
-
}
|
|
261
|
-
handleGoBack() {
|
|
262
|
-
this.resetDropdownStyles();
|
|
263
|
-
this.isMobile = false;
|
|
264
|
-
}
|
|
265
|
-
resetDropdownStyles() {
|
|
266
|
-
var _a;
|
|
267
|
-
const dropdown = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.dropdown-mobile');
|
|
268
|
-
if (dropdown && dropdown.style.position === 'fixed') {
|
|
269
|
-
dropdown.style.position = 'relative';
|
|
270
|
-
dropdown.style.removeProperty('bottom');
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
332
|
render() {
|
|
274
|
-
|
|
275
|
-
return (h(Host, { key: '8e47b4652a5f7143b9f9d8704105624debd5ab86', style: this.hostCSSProperties(), class: "dropdown-overlay" }, h("div", { key: 'a5c9a6878be61268fb2a6fe5f42c3811aaa25e92', class: `dropdown ${isMobileDropdown ? 'dropdown-mobile' : ''}`, style: this.styles }, h("div", { key: 'c10d5a2793e7961370f63b124eb8538c0fe161a2', class: this.getClasses() }, this.isMobile && this.isDropdownOpen && (h("cura-button-transparent", { key: 'a5d8233857277aa56c7d4d8048c8d8199635f117', fontColor: "dark", onClick: () => this.handleGoBack(), iconName: "arrowLeft", size: "medium", iconOnly: true, color: "primary" })), h("cura-input-text", { key: '1f780e794a2e42fa4771f9f6f5cb04f44d5d17d3', 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: () => {
|
|
276
|
-
this.handleOnBlur();
|
|
277
|
-
}, placeholder: this.placeholder, size: this.size, onKeyDown: this.handleKeyDown }, h("slot", { key: '87882a490816c64d8780ce4a02b975034e111473', name: "helperText" }))), h("div", { key: 'b0120ab7c2db1a5dcc071e4b79f9aac7d50ae998', id: "dropdown-search-list", class: this.getDropdownClasses() }, h("slot", { key: 'b780c4b317c6aa557a6be5fe3d4c957d943b92c8', name: "dropdown-search-option", onSlotchange: this.handleSlotChange })))));
|
|
333
|
+
return (h(Host, { key: '936c26e5c23d95d8e905f66d8bcf7c636781351e', style: this.getHostCSSProperties() }, h("div", { key: '6bd541e66e07d4db99af875886fbfaba5915fd48', class: this.getClasses(), style: this.styles }, h("div", { key: '4b5036b41878c317bc3b6716bf8590f1d672d21e', class: "component-controls" }, this.isMobile && this.zoomState ? (h("cura-button-transparent", { fontColor: "dark", onClick: () => this.handleBackClick(), iconName: "arrowLeft", size: "large", iconOnly: true, color: "primary", id: "button-back" })) : '', h("cura-input-text", { key: '7d0d8f3090389570d51612ad89cedda9c452527f', disabled: this.disabled, label: this.label, part: "cura-input-field", mode: this.zoomState ? 'transparent' : 'default', required: this.required, iconName: this.icon || 'search', value: this.value, status: this.status, onValueChange: (ev) => this.handleInputValueChange(ev), onInput: (ev) => this._preventEvent(ev), onFocus: () => this.handleFocus(), onClick: (ev) => this._preventEvent(ev), onBlur: () => this.handleBlur(), onFocusout: () => this.handleFocusout(), onInputClear: (ev) => this.handleInputClear(ev), placeholder: this.placeholder, size: this.size, onKeyDown: (ev) => this.handleKeyDown(ev) }, h("slot", { key: 'e9cbf139d9b16a50bf0ca547246a66132e722add', name: "helperText" }))), h("div", { key: 'd8d83a726ef6e87740240b9fb637742bc52151e2', class: "dropdown-container", onMouseOver: () => this.handleDropdownMouseOver() }, h("slot", { key: '7cf5efd8ca64c1f07a19bf0ae6dfcdaeb057c04b', onSlotchange: () => this.handleSlotChange() })))));
|
|
278
334
|
}
|
|
279
335
|
get host() { return this; }
|
|
280
|
-
static get watchers() { return {
|
|
281
|
-
"value": ["onValueChange"]
|
|
282
|
-
}; }
|
|
283
336
|
static get style() { return CuraDropdownSearchStyle0; }
|
|
284
337
|
}, [1, "cura-dropdown-search", {
|
|
285
|
-
"size": [1537],
|
|
286
|
-
"status": [513],
|
|
287
|
-
"disabled": [516],
|
|
288
338
|
"name": [513],
|
|
289
|
-
"
|
|
290
|
-
"
|
|
291
|
-
"
|
|
292
|
-
"
|
|
293
|
-
"
|
|
294
|
-
"
|
|
295
|
-
"
|
|
296
|
-
"
|
|
297
|
-
"
|
|
339
|
+
"size": [513],
|
|
340
|
+
"status": [1537],
|
|
341
|
+
"disabled": [516],
|
|
342
|
+
"required": [516],
|
|
343
|
+
"placeholder": [513],
|
|
344
|
+
"label": [513],
|
|
345
|
+
"icon": [513],
|
|
346
|
+
"maxheight": [513],
|
|
347
|
+
"value": [1025],
|
|
348
|
+
"searchdelay": [514],
|
|
349
|
+
"searchminchars": [514],
|
|
298
350
|
"styles": [32],
|
|
299
|
-
"
|
|
300
|
-
"
|
|
301
|
-
"
|
|
302
|
-
"
|
|
303
|
-
"
|
|
304
|
-
"options": [32],
|
|
305
|
-
"originalOverflow": [32],
|
|
306
|
-
"screenDefaultHeight": [32]
|
|
307
|
-
}, undefined, {
|
|
308
|
-
"value": ["onValueChange"]
|
|
351
|
+
"zoomState": [32],
|
|
352
|
+
"isOnFocus": [32],
|
|
353
|
+
"dropdownItems": [32],
|
|
354
|
+
"setFocus": [64],
|
|
355
|
+
"selectOption": [64]
|
|
309
356
|
}]);
|
|
310
357
|
function defineCustomElement$1() {
|
|
311
358
|
if (typeof customElements === "undefined") {
|