q2-tecton-elements 1.51.3 → 1.51.5
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/click-elsewhere_2.cjs.entry.js +19 -14
- package/dist/cjs/click-elsewhere_2.cjs.entry.js.map +1 -1
- package/dist/cjs/{index-c4a56631.js → index-23b54092.js} +68 -1
- package/dist/cjs/index-23b54092.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q2-action-sheet.cjs.entry.js +1 -1
- package/dist/cjs/q2-badge_7.cjs.entry.js +1 -1
- package/dist/cjs/q2-calendar.cjs.entry.js +1 -1
- package/dist/cjs/q2-card.cjs.entry.js +1 -1
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-area.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-bar.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-donut.cjs.entry.js +1 -1
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/q2-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/q2-data-table.cjs.entry.js +1 -1
- package/dist/cjs/q2-detail.cjs.entry.js +1 -1
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
- package/dist/cjs/q2-dropdown.cjs.entry.js +4 -2
- package/dist/cjs/q2-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
- package/dist/cjs/q2-item.cjs.entry.js +1 -1
- package/dist/cjs/q2-list.cjs.entry.js +1 -1
- package/dist/cjs/q2-loc.cjs.entry.js +1 -1
- package/dist/cjs/q2-message.cjs.entry.js +1 -1
- package/dist/cjs/q2-month-picker.cjs.entry.js +1 -1
- package/dist/cjs/q2-optgroup.cjs.entry.js +1 -1
- package/dist/cjs/q2-option-list.cjs.entry.js +1 -1
- package/dist/cjs/q2-pagination.cjs.entry.js +1 -1
- package/dist/cjs/q2-pill.cjs.entry.js +1 -1
- package/dist/cjs/q2-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/q2-radio.cjs.entry.js +1 -1
- package/dist/cjs/q2-relative-time.cjs.entry.js +1 -1
- package/dist/cjs/q2-section.cjs.entry.js +1 -1
- package/dist/cjs/q2-select.cjs.entry.js +51 -3
- package/dist/cjs/q2-select.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js +1 -1
- package/dist/cjs/q2-stepper.cjs.entry.js +1 -1
- package/dist/cjs/q2-tag.cjs.entry.js +1 -1
- package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
- package/dist/cjs/q2-textarea.cjs.entry.js +1 -1
- package/dist/cjs/q2-tooltip.cjs.entry.js +1 -1
- package/dist/collection/components/q2-dropdown/q2-dropdown.js +3 -1
- package/dist/collection/components/q2-dropdown/q2-dropdown.js.map +1 -1
- package/dist/collection/components/q2-popover/q2-popover.js +19 -14
- package/dist/collection/components/q2-popover/q2-popover.js.map +1 -1
- package/dist/collection/components/q2-popover/test/q2-popover-test.spec.js +230 -147
- package/dist/collection/components/q2-popover/test/q2-popover-test.spec.js.map +1 -1
- package/dist/collection/components/q2-select/q2-select.js +57 -3
- package/dist/collection/components/q2-select/q2-select.js.map +1 -1
- package/dist/collection/components/q2-select/test/q2-select-test.spec.js +146 -6
- package/dist/collection/components/q2-select/test/q2-select-test.spec.js.map +1 -1
- package/dist/collection/utils/index.js +71 -0
- package/dist/collection/utils/index.js.map +1 -1
- package/dist/components/index2.js +66 -1
- package/dist/components/index2.js.map +1 -1
- package/dist/components/q2-dropdown.js +3 -1
- package/dist/components/q2-dropdown.js.map +1 -1
- package/dist/components/q2-popover2.js +19 -14
- package/dist/components/q2-popover2.js.map +1 -1
- package/dist/components/q2-select2.js +52 -4
- package/dist/components/q2-select2.js.map +1 -1
- package/dist/esm/click-elsewhere_2.entry.js +19 -14
- package/dist/esm/click-elsewhere_2.entry.js.map +1 -1
- package/dist/esm/{index-a185b189.js → index-acb0dbf8.js} +67 -2
- package/dist/esm/index-acb0dbf8.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q2-action-sheet.entry.js +1 -1
- package/dist/esm/q2-badge_7.entry.js +1 -1
- package/dist/esm/q2-calendar.entry.js +1 -1
- package/dist/esm/q2-card.entry.js +1 -1
- package/dist/esm/q2-carousel-pane.entry.js +1 -1
- package/dist/esm/q2-carousel.entry.js +1 -1
- package/dist/esm/q2-chart-area.entry.js +1 -1
- package/dist/esm/q2-chart-bar.entry.js +1 -1
- package/dist/esm/q2-chart-donut.entry.js +1 -1
- package/dist/esm/q2-checkbox-group.entry.js +1 -1
- package/dist/esm/q2-checkbox.entry.js +1 -1
- package/dist/esm/q2-data-table.entry.js +1 -1
- package/dist/esm/q2-detail.entry.js +1 -1
- package/dist/esm/q2-dropdown-item.entry.js +1 -1
- package/dist/esm/q2-dropdown.entry.js +4 -2
- package/dist/esm/q2-dropdown.entry.js.map +1 -1
- package/dist/esm/q2-editable-field.entry.js +1 -1
- package/dist/esm/q2-item.entry.js +1 -1
- package/dist/esm/q2-list.entry.js +1 -1
- package/dist/esm/q2-loc.entry.js +1 -1
- package/dist/esm/q2-message.entry.js +1 -1
- package/dist/esm/q2-month-picker.entry.js +1 -1
- package/dist/esm/q2-optgroup.entry.js +1 -1
- package/dist/esm/q2-option-list.entry.js +1 -1
- package/dist/esm/q2-pagination.entry.js +1 -1
- package/dist/esm/q2-pill.entry.js +1 -1
- package/dist/esm/q2-radio-group.entry.js +1 -1
- package/dist/esm/q2-radio.entry.js +1 -1
- package/dist/esm/q2-relative-time.entry.js +1 -1
- package/dist/esm/q2-section.entry.js +1 -1
- package/dist/esm/q2-select.entry.js +51 -3
- package/dist/esm/q2-select.entry.js.map +1 -1
- package/dist/esm/q2-stepper-pane.entry.js +1 -1
- package/dist/esm/q2-stepper-vertical.entry.js +1 -1
- package/dist/esm/q2-stepper.entry.js +1 -1
- package/dist/esm/q2-tag.entry.js +1 -1
- package/dist/esm/q2-tecton-elements.js +1 -1
- package/dist/esm/q2-textarea.entry.js +1 -1
- package/dist/esm/q2-tooltip.entry.js +1 -1
- package/dist/jest.setup.js +11 -0
- package/dist/jest.setup.js.map +1 -1
- package/dist/q2-tecton-elements/{p-e9dfbb78.entry.js → p-00032703.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-7e87cbdf.entry.js → p-1929710e.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-cfcec7f4.entry.js → p-22233aea.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-a2793557.entry.js → p-262441ff.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-53224667.entry.js → p-2fa879a6.entry.js} +2 -2
- package/dist/q2-tecton-elements/p-312d4cc7.js +2 -0
- package/dist/q2-tecton-elements/p-312d4cc7.js.map +1 -0
- package/dist/q2-tecton-elements/{p-dc80c2ed.entry.js → p-34533781.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-fa68a890.entry.js → p-3998068d.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-1f7e9ab9.entry.js → p-3d70719a.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-089801c6.entry.js → p-4aa80dc9.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-65f60a00.entry.js → p-4e5a0413.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-432869d3.entry.js → p-60724c29.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-8a75584e.entry.js → p-624d74ea.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-f8710843.entry.js → p-694a135f.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-aad42723.entry.js → p-6ca1242b.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-c3566e7a.entry.js → p-6ce925c8.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-fbd6cb9a.entry.js → p-6da30918.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-d312f179.entry.js → p-6f5bcb8e.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-50f6e95a.entry.js → p-82855aba.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-ac7a3bc1.entry.js → p-82c78d1d.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-3b075b65.entry.js → p-96b3be3d.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-bbe24257.entry.js → p-9c0895ad.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-b17e9798.entry.js → p-a4bc2902.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-cca5af1f.entry.js → p-a6f65d00.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-18209f3b.entry.js → p-a88750fc.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-29f1f2df.entry.js → p-b4615847.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-f51426b0.entry.js → p-b7c19289.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-f043a9f1.entry.js → p-bac92e99.entry.js} +2 -2
- package/dist/q2-tecton-elements/p-bdaa8e41.entry.js +2 -0
- package/dist/q2-tecton-elements/p-bdaa8e41.entry.js.map +1 -0
- package/dist/q2-tecton-elements/p-c110383a.entry.js +2 -0
- package/dist/q2-tecton-elements/p-c110383a.entry.js.map +1 -0
- package/dist/q2-tecton-elements/{p-bc530c75.entry.js → p-c656594b.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-c6fb83ff.entry.js → p-ce21db52.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-4a399340.entry.js → p-d7bf2c37.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-4cabd4a3.entry.js → p-d8d4b389.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-a64e521d.entry.js → p-f01ffdeb.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-e940ccfb.entry.js → p-f428fc2e.entry.js} +2 -2
- package/dist/q2-tecton-elements/p-fdffb1db.entry.js +2 -0
- package/dist/q2-tecton-elements/{p-5df24439.entry.js.map → p-fdffb1db.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/{p-2a296347.entry.js → p-ff5e700e.entry.js} +2 -2
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js.map +1 -1
- package/dist/types/builds/q2e/development/tecton/tecton/packages/q2-tecton-elements/.stencil/jest.setup.d.ts +9 -0
- package/dist/types/components/q2-select/q2-select.d.ts +10 -0
- package/dist/types/utils/index.d.ts +7 -0
- package/package.json +3 -3
- package/dist/cjs/index-c4a56631.js.map +0 -1
- package/dist/esm/index-a185b189.js.map +0 -1
- package/dist/q2-tecton-elements/p-0e63312a.entry.js +0 -2
- package/dist/q2-tecton-elements/p-0e63312a.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-5df24439.entry.js +0 -2
- package/dist/q2-tecton-elements/p-85c46278.entry.js +0 -2
- package/dist/q2-tecton-elements/p-85c46278.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-c5445b5e.js +0 -2
- package/dist/q2-tecton-elements/p-c5445b5e.js.map +0 -1
- /package/dist/q2-tecton-elements/{p-e9dfbb78.entry.js.map → p-00032703.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-7e87cbdf.entry.js.map → p-1929710e.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-cfcec7f4.entry.js.map → p-22233aea.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-a2793557.entry.js.map → p-262441ff.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-53224667.entry.js.map → p-2fa879a6.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-dc80c2ed.entry.js.map → p-34533781.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-fa68a890.entry.js.map → p-3998068d.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-1f7e9ab9.entry.js.map → p-3d70719a.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-089801c6.entry.js.map → p-4aa80dc9.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-65f60a00.entry.js.map → p-4e5a0413.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-432869d3.entry.js.map → p-60724c29.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-8a75584e.entry.js.map → p-624d74ea.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-f8710843.entry.js.map → p-694a135f.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-aad42723.entry.js.map → p-6ca1242b.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-c3566e7a.entry.js.map → p-6ce925c8.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-fbd6cb9a.entry.js.map → p-6da30918.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-d312f179.entry.js.map → p-6f5bcb8e.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-50f6e95a.entry.js.map → p-82855aba.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-ac7a3bc1.entry.js.map → p-82c78d1d.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-3b075b65.entry.js.map → p-96b3be3d.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-bbe24257.entry.js.map → p-9c0895ad.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-b17e9798.entry.js.map → p-a4bc2902.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-cca5af1f.entry.js.map → p-a6f65d00.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-18209f3b.entry.js.map → p-a88750fc.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-29f1f2df.entry.js.map → p-b4615847.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-f51426b0.entry.js.map → p-b7c19289.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-f043a9f1.entry.js.map → p-bac92e99.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-bc530c75.entry.js.map → p-c656594b.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-c6fb83ff.entry.js.map → p-ce21db52.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-4a399340.entry.js.map → p-d7bf2c37.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-4cabd4a3.entry.js.map → p-d8d4b389.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-a64e521d.entry.js.map → p-f01ffdeb.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-e940ccfb.entry.js.map → p-f428fc2e.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-2a296347.entry.js.map → p-ff5e700e.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,g as o}from"./p-a5f18e27.js";import{m as r,o as n,i as a,w as s,l as c}from"./p-c5445b5e.js";import{s as l,a as d}from"./p-b7554a79.js";const p="*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:inline-block;position:relative;line-height:0}:host(:not(:last-child)){margin-inline-end:var(--tct-pill-margin, var(--t-pill-margin, var(--app-scale-2x, 10px)))}q2-popover,.btn-wrapper{--comp-pill-min-height:var(--tct-pill-min-height, var(--t-pill-min-height, 44px));--comp-pill-btn-height:var(--tct-pill-btn-height, var(--t-pill-btn-height, 30px))}.popover-top-container{position:sticky;top:0;z-index:5}.popover-bottom-container{position:sticky;bottom:0;z-index:5}.btn-wrapper{--comp-pill-btn-border-width:var(--tct-pill-btn-border-width, var(--t-pill-btn-border-width, 2px));--comp-close-size:0px;--comp-btn-background:var(--tct-pill-btn-background, var(--t-pill-btn-background, var(--t-base, #ffffff)));--comp-hover-btn-background:var(--tct-pill-hover-btn-background, var(--t-pill-hover-btn-background, var(--t-gray-13, #e6e6e6)));--comp-btn-padding:var(--tct-pill-btn-padding-inline, var(--t-pill-btn-padding-inline, var(--app-scale-3x, 15px)));--comp-btn-color:var(--tct-pill-btn-color, var(--t-pill-btn-color, var(--t-gray-3, #262626)));--comp-active-btn-color:var(--comp-btn-background);--comp-active-btn-background:var(--tct-pill-active-btn-background, var(--t-pill-active-btn-background, var(--t-gray-7, #666666)));--comp-active-btn-border-color:var(--tct-pill-active-btn-border-color, var(--t-pill-active-btn-border-color, var(--t-gray-7, #666666)));--comp-hover-active-btn-background:var(--tct-pill-active-btn-background, var(--t-pill-active-btn-background, var(--t-gray-6, #4d4d4d)));--comp-hover-active-btn-border-color:var(--tct-pill-active-btn-background, var(--t-pill-active-btn-background, var(--t-gray-6, #4d4d4d)));position:relative}.btn-wrapper.has-options,.btn-wrapper.has-icon{--comp-close-size:var(--comp-pill-btn-height)}:host([active]) .btn-wrapper{--comp-btn-color:var(--tct-pill-active-btn-color, var(--t-pill-active-btn-color, var(--t-base, #ffffff)))}:host([theme=primary]) .btn-wrapper{--comp-active-btn-background:var(--tct-pill-primary-active-background, var(--t-primary, #0079c1));--comp-active-btn-color:var(--tct-pill-primary-active-font-color, var(--t-primary-text, #ffffff));--comp-active-btn-border-color:var(--tct-pill-primary-active-border-color, var(--t-primary, #0079c1));--comp-hover-active-btn-background:var(--tct-pill-primary-active-hover-background, var(--t-primary-l3, #21acff));--comp-hover-active-btn-border-color:var(--tct-pill-primary-active-hover-border-color, var(--t-primary-l3, #21acff))}:host([theme=secondary]) .btn-wrapper{--comp-active-btn-background:var(--tct-pill-secondary-active-background, var(--t-secondary, #b3c2cc));--comp-active-btn-color:var(--tct-pill-secondary-active-font-color, var(--t-secondary-text, #141414));--comp-active-btn-border-color:var(--tct-pill-secondary-active-border-color, var(--t-secondary, #b3c2cc));--comp-hover-active-btn-background:var(--tct-pill-secondary-active-hover-background, var(--t-secondary-l3, #c9d5db));--comp-hover-active-btn-border-color:var(--tct-pill-secondary-active-hover-border-color, var(--t-secondary-l3, #c9d5db))}:host([theme=tertiary]) .btn-wrapper{--comp-active-btn-background:var(--tct-pill-tertiary-active-background, var(--t-tertiary, #e8f5fc));--comp-active-btn-color:var(--tct-pill-tertiary-active-font-color, var(--t-tertiary-text, #141414));--comp-active-btn-border-color:var(--tct-pill-tertiary-active-border-color, var(--t-tertiary, #e8f5fc));--comp-hover-active-btn-background:var(--tct-pill-tertiary-active-hover-background, var(--t-tertiary-l3, #eff8fd));--comp-hover-active-btn-border-color:var(--tct-pill-tertiary-active-hover-border-color, var(--t-tertiary-l3, #eff8fd))}.btn-height-wrapper{height:var(--comp-pill-min-height);display:flex;align-items:center;cursor:pointer}.btn-height-wrapper:focus{box-shadow:none}:host([disabled]) .btn-height-wrapper{cursor:not-allowed}.btn-close,.btn-primary{cursor:pointer;height:var(--comp-pill-btn-height);border-style:solid;border-radius:var(--tct-pill-btn-border-radius, var(--t-pill-btn-border-radius, 30px));transition-property:background, color, padding, width, opacity;transition:var(--tct-pill-btn-tween, var(--t-pill-btn-tween, var(--app-tween-1, 0.2s ease)))}:host([disabled]) .btn-close,:host([disabled]) .btn-primary,:host([disabled]) q2-icon{opacity:var(--tct-pill-disabled-opacity, var(--t-pill-disabled-opacity, var(--tct-disabled-opacity, var(--app-disabled-opacity, 0.4))));cursor:not-allowed}.btn-primary{background:var(--comp-btn-background);border-width:var(--comp-pill-btn-border-width);border-color:var(--tct-pill-btn-border-color, var(--t-pill-btn-border-color, var(--t-a11y-gray-color-AA, #949494)));padding-inline:var(--comp-btn-padding);padding-right:calc(var(--comp-btn-padding) + var(--comp-close-size));font-size:var(--tct-pill-btn-font-size, var(--t-pill-btn-font-size, var(--app-font-size, 14px)));color:var(--comp-btn-color);display:block;width:100%;text-align:start}.btn-primary:focus,.btn-primary:hover{background:var(--comp-hover-btn-background)}.has-options .btn-primary,.has-icon .btn-primary{padding-right:calc(var(--tct-pill-icon-gap, var(--t-pill-icon-gap, var(--app-scale-1x, 5px))) + var(--comp-close-size))}.has-options .btn-primary{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:var(--tct-pill-max-width, var(--t-pill-max-width, 200px))}:host([active]) .btn-primary{background:var(--comp-active-btn-background);border-color:var(--comp-active-btn-border-color);color:var(--comp-active-btn-color)}:host([active]) .btn-primary:focus,:host([active]) .btn-primary:hover{background:var(--comp-hover-active-btn-background);border-color:var(--comp-hover-active-btn-border-color)}.btn-close{background:transparent;border-color:transparent;border-width:var(--comp-pill-btn-border-width);width:var(--comp-close-size);height:var(--comp-close-size);padding:0;border:0;display:inline-flex;justify-content:center;align-items:center;position:absolute;right:0;top:50%;transform:translateY(-50%);opacity:0}:host([active]) .btn-close{color:var(--comp-active-btn-color)}.has-options .btn-close,.has-icon .btn-close{opacity:1}q2-icon{--t-icon-stroke-primary:currentcolor;width:var(--tct-pill-icon-size, var(--t-pill-icon-size, 14px));height:var(--tct-pill-icon-size, var(--t-pill-icon-size, 14px));transition-property:transform;transition:var(--tct-pill-btn-tween, var(--t-pill-btn-tween, var(--app-tween-1, 0.2s ease)))}div.btn-close{pointer-events:none}:host([open]) div.btn-close q2-icon{transform:rotate(180deg)}:host([active]) button.btn-close:focus,:host([active]) button.btn-close:hover{background:var(--tct-pill-hover-close-btn-background, var(--t-pill-hover-close-btn-background, var(--t-top-a1, rgba(13, 13, 13, 0.35))));border-color:var(--tct-pill-hover-close-btn-border-color, var(--t-pill-hover-close-btn-border-color, var(--t-top-a1, rgba(13, 13, 13, 0.35))))}q2-popover{top:calc(var(--comp-pill-min-height) - (var(--comp-pill-min-height) - var(--comp-pill-btn-height)) / 2)}:host([borderless]:not([borderless=false])) button{border-style:none}";const h=p;const v=class{constructor(e){t(this,e);this.change=i(this,"change",7);var o;this.scheduledAfterRender=[];this.clearSelectedOptions=()=>{this.selectedOptions=[];this.value=null;this.active=false;this.open=false;this.primaryBtn.focus();this.change.emit({value:null,values:[],active:false});this.scheduledAfterRender.push(r)};this.determineOptionCount=async()=>{if(this.optionList){const t=await this.optionList.getOptions();this.optionCount=t.length}else{const t=this.hostElement.querySelectorAll("q2-option").length;this.optionCount=t}};this.executeActionSheet=async t=>{const i=await l(this,t);this.handleSelectionChanges(i)};this.getOption=async t=>{if(this.optionList){const i=await this.optionList.getOptions();return i.find((i=>i.value===t))}else{return this.hostElement.querySelector(`q2-option[value="${t}"]`)}};this.handleButtonFocusout=async t=>{const i=t.relatedTarget;if((i===null||i===void 0?void 0:i.tagName)==="Q2-OPTION")return;this.open=false};this.handleChange=t=>{t.stopPropagation();if(!this.optionCount)return;this.handleSelectionChanges(t.detail)};this.handleClick=async t=>{t.stopPropagation();if(this.disabled)return;if(this.optionCount){if(d(this)){this.executeActionSheet(t)}else{await this.popoverElement.toggle()}}else{const{value:t,label:i}=this;const e=this.active=!this.active;const o=e?[{value:t,display:i}]:[];this.selectedOptions=o;this.change.emit({value:t,values:o,active:e})}};this.handleKeydown=async t=>{const i=t.metaKey||t.ctrlKey||t.key==="Tab";if(!this.optionCount||this.disabled||i)return;t.preventDefault();const e=this.hasPopoverTop||this.hasPopoverBottom;if(d(this,t)&&!e){this.executeActionSheet(t)}else{this.optionList.handleExternalKeydown(t)}};this.handleSelectionChanges=async t=>{const{multiple:i}=this;const{value:e="",values:o=[]}=t;const r=i?!!o.length:!!e;if(!this.hostElement.onchange){if(i){this.selectedOptions=o;this.value=undefined}else{const t=await this.getOption(e);this.selectedOptions=t?[{value:t.value,display:t.display}]:[];this.value=(t===null||t===void 0?void 0:t.value)||undefined}}this.change.emit({value:i?undefined:e,values:o,active:r})};this.handleWrapperClick=()=>{this.primaryBtn.focus();this.primaryBtn.click()};this.onClickElsewhere=t=>{const i=t.target;if(i.localName==="click-elsewhere"){t.stopPropagation();const{popoverElement:i}=this;if(!i)return;i.open=false}};this.onMutationObserved=()=>{this.updateSlotState();this.determineOptionCount();this.updateSelectedOptionElements()};this.updateSlotState=()=>{const{hostElement:t,hasPopoverTop:i,hasPopoverBottom:e}=this;const o=t.shadowRoot.querySelector('slot[name="popover-top"]');const r=t.shadowRoot.querySelector('slot[name="popover-bottom"]');const n=(o===null||o===void 0?void 0:o.assignedNodes().length)>0;const a=(r===null||r===void 0?void 0:r.assignedNodes().length)>0;if(i!==n)this.hasPopoverTop=n;if(e!==a)this.hasPopoverBottom=a};this.syncValueProperties=()=>{const{value:t,selectedOptions:i}=this;if(!!(i===null||i===void 0?void 0:i.length))this.selectedOptionsChanged(i);else if(t)this.valueChanged(t)};this.updateSelectedOptionElements=async()=>{var t;const{selectedOptions:i=[]}=this;const e=i.map((t=>t.value));const o=await((t=this.optionList)===null||t===void 0?void 0:t.getOptions());if(this.optionCount)this.active=!!e.length;this.selectedOptionElements=(o===null||o===void 0?void 0:o.filter((t=>e.includes(t.value))))||[]};this.hasPopoverTop=false;this.hasPopoverBottom=false;this.optionCount=undefined;this.selectedOptionElements=[];this.active=undefined;this.borderless=undefined;this.disabled=undefined;this.hoist=!!((o=window.Tecton)===null||o===void 0?void 0:o.useActionSheets);this.label=undefined;this.maxLength=undefined;this.multiple=undefined;this.open=undefined;this.optionListLabel=undefined;this.popoverAlignment="right";this.popoverDirection=undefined;this.popoverMaxHeight=undefined;this.popoverMinHeight=150;this.selectedOptions=[];this.theme=undefined;this.value=undefined}disconnectedCallback(){this.mutationObserver.disconnect();this.mutationObserver=null}componentWillLoad(){const t=new MutationObserver(this.onMutationObserved);t.observe(this.hostElement,{childList:true,attributes:true});this.mutationObserver=t}componentDidLoad(){n(this.hostElement);this.syncValueProperties()}componentDidRender(){this.scheduledAfterRender.forEach((t=>t()));this.scheduledAfterRender=[]}handleSelectedDisplay(){if(this.multiple)return;this.updateSelectedOptionElements()}delegateFocus(t){if(!a(t,this.hostElement))return;this.primaryBtn.focus()}popoverStateHandler({detail:{open:t}}){if(this.open!==t)this.open=t;if(t)return;this.optionList.setActiveElement(null)}async closePopover(){if(!this.open||this.disabled)return;this._togglePopover()}async openPopover(){if(this.open||this.disabled)return;this._togglePopover()}async setValue(t,i={closePopover:true}){var e;const o=new Set(Array.isArray(t)?t:[t]);const r=await((e=this.optionList)===null||e===void 0?void 0:e.getOptions());if(!this.open){await this.openPopover();await s()}o.forEach((t=>{var i;(i=r.find((i=>i.value===t)))===null||i===void 0?void 0:i.click()}));if(i.closePopover){await this.closePopover();await s()}}selectedOptionsChanged(t){var i,e;const{multiple:o}=this;const r=(e=(i=t===null||t===void 0?void 0:t[0])===null||i===void 0?void 0:i.value)!==null&&e!==void 0?e:null;if(o){if(this.value)this.value=null;this.updateSelectedOptionElements()}else if(this.value===r){this.updateSelectedOptionElements()}else{this.value=r}}async valueChanged(t){var i,e;const{multiple:o,selectedOptions:r}=this;if(o)return;const n=(e=(i=r===null||r===void 0?void 0:r[0])===null||i===void 0?void 0:i.value)!==null&&e!==void 0?e:null;if(t===n)this.updateSelectedOptionElements();else{const i=await this.getOption(t);const{value:e,display:o}=i||{value:t,display:null};this.selectedOptions=e?[{value:e,display:o}]:[]}}get buttonContent(){const{label:t,selectedOptions:i,selectedOptionElements:e,optionCount:o}=this;if(!o||e.length===0)return c(t);else if(e.length===1)return c(e[0].display);return c("tecton.element.pill.activeCount",{count:i.length})}get truncatedButtonContent(){const{maxLength:t,buttonContent:i}=this;if(t)return i.length>t?`${i.substring(0,t)}…`:i;else return i}_togglePopover(){const{primaryBtn:t}=this;t===null||t===void 0?void 0:t.click();t===null||t===void 0?void 0:t.focus();t.dispatchEvent(new FocusEvent("focus"))}renderHiddenElement(){return e("div",{id:"option-description",class:"sr","aria-hidden":"true"},c("tecton.element.optionList.optionCount",[this.optionCount]))}renderIcon(){const{optionCount:t,active:i}=this;const o=t&&i;const r=o?"button":"div";const n=o||!t?"close":"chevron-down";return e(r,{class:"btn-close",onClick:o&&this.clearSelectedOptions||undefined,disabled:o&&this.disabled||undefined,"aria-label":o&&c("tecton.element.pill.clearSelection")||undefined,type:o&&"button"||undefined},e("q2-icon",{type:n}))}render(){const{optionCount:t,active:i,open:o}=this;const r=["btn-wrapper"];if(t||i)r.push("has-icon");if(t)r.push("has-options");return e("click-elsewhere",{key:"bf12787a839b5ec97a14a2638b83534a3ccf610b",onChange:this.onClickElsewhere},e("div",{key:"b3c02f4d5400e6637e2848ff70ea0548469ce156",class:r.join(" ")},e("div",{key:"a99df01a6e69f73fe9f21b4ed51113ae2a2ecfcc",class:"btn-height-wrapper",ref:t=>this.primaryBtnWrapper=t,onClick:this.handleWrapperClick,tabIndex:-1},e("button",{key:"2759471703efb53fe6132c36797e5f4d016b0108",class:"btn-primary","test-id":"btn-control",type:"button",role:t&&"combobox"||undefined,ref:t=>this.primaryBtn=t,onClick:this.handleClick,onKeyDown:this.handleKeydown,onFocusout:this.handleButtonFocusout,disabled:this.disabled,"aria-roledescription":!t&&"filter","aria-controls":t&&"option-list"||undefined,"aria-expanded":t&&`${!!o}`||undefined,"aria-label":this.buttonContent,"aria-describedby":t&&"option-description"||undefined},this.truncatedButtonContent,!t&&i&&e("span",{key:"8c0733bf2bae45288dbdf13801305043d0b7cd67",class:"sr"},"(",c("tecton.element.pill.active"),")"))),this.renderIcon(),!!t&&this.renderHiddenElement()),this.optionCount>0&&e("q2-popover",{key:"65af1d895e52ebec3000172ed59713190ec1c4cd",ref:t=>this.popoverElement=t,controlElement:this.primaryBtn,open:this.open,"max-height":this.popoverMaxHeight,minHeight:this.popoverMinHeight,direction:this.popoverDirection,align:this.popoverAlignment},e("div",{key:"8cfde66d75fee798ee956921ba04aa9ed5643651",class:"popover-content"},e("div",{key:"688cf13032c09f0f63fb39c58a0182e77f98ddeb",ref:t=>this.popoverTopContainer=t,class:"popover-top-container",tabindex:"-1",hidden:!this.hasPopoverTop,onKeyDown:this.handleKeydown},e("slot",{key:"af6a97d9bba21ed908c876da0ad8851b9fcb286a",name:"popover-top"})),e("q2-option-list",{key:"fb4c49c8b3936faabe1533973680bcf33e5d13da",type:"listbox",ref:t=>this.optionList=t,id:"option-list",onChange:this.handleChange,multiple:this.multiple,selectedOptions:this.selectedOptions,onReady:()=>this.updateSelectedOptionElements(),label:c("tecton.element.optionList.label",[this.optionListLabel])},e("slot",{key:"ce059f109de1eab4b3129916d14a365fd54f9802"})),e("div",{key:"2f388ecb604db14d4e419128703980e02dda3598",ref:t=>this.popoverBottomContainer=t,class:"popover-bottom-container",tabindex:"-1",hidden:!this.hasPopoverBottom,onKeyDown:this.handleKeydown},e("slot",{key:"2881980ed3c258ccbd58509fb4b348d5dba0d978",name:"popover-bottom"})))))}get hostElement(){return o(this)}static get watchers(){return{selectedOptions:["selectedOptionsChanged"],value:["valueChanged"]}}};v.style=h;export{v as q2_pill};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as i,h as e,g as o}from"./p-a5f18e27.js";import{m as r,o as n,i as a,w as s,l as c}from"./p-312d4cc7.js";import{s as l,a as d}from"./p-b7554a79.js";const p="*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:inline-block;position:relative;line-height:0}:host(:not(:last-child)){margin-inline-end:var(--tct-pill-margin, var(--t-pill-margin, var(--app-scale-2x, 10px)))}q2-popover,.btn-wrapper{--comp-pill-min-height:var(--tct-pill-min-height, var(--t-pill-min-height, 44px));--comp-pill-btn-height:var(--tct-pill-btn-height, var(--t-pill-btn-height, 30px))}.popover-top-container{position:sticky;top:0;z-index:5}.popover-bottom-container{position:sticky;bottom:0;z-index:5}.btn-wrapper{--comp-pill-btn-border-width:var(--tct-pill-btn-border-width, var(--t-pill-btn-border-width, 2px));--comp-close-size:0px;--comp-btn-background:var(--tct-pill-btn-background, var(--t-pill-btn-background, var(--t-base, #ffffff)));--comp-hover-btn-background:var(--tct-pill-hover-btn-background, var(--t-pill-hover-btn-background, var(--t-gray-13, #e6e6e6)));--comp-btn-padding:var(--tct-pill-btn-padding-inline, var(--t-pill-btn-padding-inline, var(--app-scale-3x, 15px)));--comp-btn-color:var(--tct-pill-btn-color, var(--t-pill-btn-color, var(--t-gray-3, #262626)));--comp-active-btn-color:var(--comp-btn-background);--comp-active-btn-background:var(--tct-pill-active-btn-background, var(--t-pill-active-btn-background, var(--t-gray-7, #666666)));--comp-active-btn-border-color:var(--tct-pill-active-btn-border-color, var(--t-pill-active-btn-border-color, var(--t-gray-7, #666666)));--comp-hover-active-btn-background:var(--tct-pill-active-btn-background, var(--t-pill-active-btn-background, var(--t-gray-6, #4d4d4d)));--comp-hover-active-btn-border-color:var(--tct-pill-active-btn-background, var(--t-pill-active-btn-background, var(--t-gray-6, #4d4d4d)));position:relative}.btn-wrapper.has-options,.btn-wrapper.has-icon{--comp-close-size:var(--comp-pill-btn-height)}:host([active]) .btn-wrapper{--comp-btn-color:var(--tct-pill-active-btn-color, var(--t-pill-active-btn-color, var(--t-base, #ffffff)))}:host([theme=primary]) .btn-wrapper{--comp-active-btn-background:var(--tct-pill-primary-active-background, var(--t-primary, #0079c1));--comp-active-btn-color:var(--tct-pill-primary-active-font-color, var(--t-primary-text, #ffffff));--comp-active-btn-border-color:var(--tct-pill-primary-active-border-color, var(--t-primary, #0079c1));--comp-hover-active-btn-background:var(--tct-pill-primary-active-hover-background, var(--t-primary-l3, #21acff));--comp-hover-active-btn-border-color:var(--tct-pill-primary-active-hover-border-color, var(--t-primary-l3, #21acff))}:host([theme=secondary]) .btn-wrapper{--comp-active-btn-background:var(--tct-pill-secondary-active-background, var(--t-secondary, #b3c2cc));--comp-active-btn-color:var(--tct-pill-secondary-active-font-color, var(--t-secondary-text, #141414));--comp-active-btn-border-color:var(--tct-pill-secondary-active-border-color, var(--t-secondary, #b3c2cc));--comp-hover-active-btn-background:var(--tct-pill-secondary-active-hover-background, var(--t-secondary-l3, #c9d5db));--comp-hover-active-btn-border-color:var(--tct-pill-secondary-active-hover-border-color, var(--t-secondary-l3, #c9d5db))}:host([theme=tertiary]) .btn-wrapper{--comp-active-btn-background:var(--tct-pill-tertiary-active-background, var(--t-tertiary, #e8f5fc));--comp-active-btn-color:var(--tct-pill-tertiary-active-font-color, var(--t-tertiary-text, #141414));--comp-active-btn-border-color:var(--tct-pill-tertiary-active-border-color, var(--t-tertiary, #e8f5fc));--comp-hover-active-btn-background:var(--tct-pill-tertiary-active-hover-background, var(--t-tertiary-l3, #eff8fd));--comp-hover-active-btn-border-color:var(--tct-pill-tertiary-active-hover-border-color, var(--t-tertiary-l3, #eff8fd))}.btn-height-wrapper{height:var(--comp-pill-min-height);display:flex;align-items:center;cursor:pointer}.btn-height-wrapper:focus{box-shadow:none}:host([disabled]) .btn-height-wrapper{cursor:not-allowed}.btn-close,.btn-primary{cursor:pointer;height:var(--comp-pill-btn-height);border-style:solid;border-radius:var(--tct-pill-btn-border-radius, var(--t-pill-btn-border-radius, 30px));transition-property:background, color, padding, width, opacity;transition:var(--tct-pill-btn-tween, var(--t-pill-btn-tween, var(--app-tween-1, 0.2s ease)))}:host([disabled]) .btn-close,:host([disabled]) .btn-primary,:host([disabled]) q2-icon{opacity:var(--tct-pill-disabled-opacity, var(--t-pill-disabled-opacity, var(--tct-disabled-opacity, var(--app-disabled-opacity, 0.4))));cursor:not-allowed}.btn-primary{background:var(--comp-btn-background);border-width:var(--comp-pill-btn-border-width);border-color:var(--tct-pill-btn-border-color, var(--t-pill-btn-border-color, var(--t-a11y-gray-color-AA, #949494)));padding-inline:var(--comp-btn-padding);padding-right:calc(var(--comp-btn-padding) + var(--comp-close-size));font-size:var(--tct-pill-btn-font-size, var(--t-pill-btn-font-size, var(--app-font-size, 14px)));color:var(--comp-btn-color);display:block;width:100%;text-align:start}.btn-primary:focus,.btn-primary:hover{background:var(--comp-hover-btn-background)}.has-options .btn-primary,.has-icon .btn-primary{padding-right:calc(var(--tct-pill-icon-gap, var(--t-pill-icon-gap, var(--app-scale-1x, 5px))) + var(--comp-close-size))}.has-options .btn-primary{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:var(--tct-pill-max-width, var(--t-pill-max-width, 200px))}:host([active]) .btn-primary{background:var(--comp-active-btn-background);border-color:var(--comp-active-btn-border-color);color:var(--comp-active-btn-color)}:host([active]) .btn-primary:focus,:host([active]) .btn-primary:hover{background:var(--comp-hover-active-btn-background);border-color:var(--comp-hover-active-btn-border-color)}.btn-close{background:transparent;border-color:transparent;border-width:var(--comp-pill-btn-border-width);width:var(--comp-close-size);height:var(--comp-close-size);padding:0;border:0;display:inline-flex;justify-content:center;align-items:center;position:absolute;right:0;top:50%;transform:translateY(-50%);opacity:0}:host([active]) .btn-close{color:var(--comp-active-btn-color)}.has-options .btn-close,.has-icon .btn-close{opacity:1}q2-icon{--t-icon-stroke-primary:currentcolor;width:var(--tct-pill-icon-size, var(--t-pill-icon-size, 14px));height:var(--tct-pill-icon-size, var(--t-pill-icon-size, 14px));transition-property:transform;transition:var(--tct-pill-btn-tween, var(--t-pill-btn-tween, var(--app-tween-1, 0.2s ease)))}div.btn-close{pointer-events:none}:host([open]) div.btn-close q2-icon{transform:rotate(180deg)}:host([active]) button.btn-close:focus,:host([active]) button.btn-close:hover{background:var(--tct-pill-hover-close-btn-background, var(--t-pill-hover-close-btn-background, var(--t-top-a1, rgba(13, 13, 13, 0.35))));border-color:var(--tct-pill-hover-close-btn-border-color, var(--t-pill-hover-close-btn-border-color, var(--t-top-a1, rgba(13, 13, 13, 0.35))))}q2-popover{top:calc(var(--comp-pill-min-height) - (var(--comp-pill-min-height) - var(--comp-pill-btn-height)) / 2)}:host([borderless]:not([borderless=false])) button{border-style:none}";const h=p;const v=class{constructor(e){t(this,e);this.change=i(this,"change",7);var o;this.scheduledAfterRender=[];this.clearSelectedOptions=()=>{this.selectedOptions=[];this.value=null;this.active=false;this.open=false;this.primaryBtn.focus();this.change.emit({value:null,values:[],active:false});this.scheduledAfterRender.push(r)};this.determineOptionCount=async()=>{if(this.optionList){const t=await this.optionList.getOptions();this.optionCount=t.length}else{const t=this.hostElement.querySelectorAll("q2-option").length;this.optionCount=t}};this.executeActionSheet=async t=>{const i=await l(this,t);this.handleSelectionChanges(i)};this.getOption=async t=>{if(this.optionList){const i=await this.optionList.getOptions();return i.find((i=>i.value===t))}else{return this.hostElement.querySelector(`q2-option[value="${t}"]`)}};this.handleButtonFocusout=async t=>{const i=t.relatedTarget;if((i===null||i===void 0?void 0:i.tagName)==="Q2-OPTION")return;this.open=false};this.handleChange=t=>{t.stopPropagation();if(!this.optionCount)return;this.handleSelectionChanges(t.detail)};this.handleClick=async t=>{t.stopPropagation();if(this.disabled)return;if(this.optionCount){if(d(this)){this.executeActionSheet(t)}else{await this.popoverElement.toggle()}}else{const{value:t,label:i}=this;const e=this.active=!this.active;const o=e?[{value:t,display:i}]:[];this.selectedOptions=o;this.change.emit({value:t,values:o,active:e})}};this.handleKeydown=async t=>{const i=t.metaKey||t.ctrlKey||t.key==="Tab";if(!this.optionCount||this.disabled||i)return;t.preventDefault();const e=this.hasPopoverTop||this.hasPopoverBottom;if(d(this,t)&&!e){this.executeActionSheet(t)}else{this.optionList.handleExternalKeydown(t)}};this.handleSelectionChanges=async t=>{const{multiple:i}=this;const{value:e="",values:o=[]}=t;const r=i?!!o.length:!!e;if(!this.hostElement.onchange){if(i){this.selectedOptions=o;this.value=undefined}else{const t=await this.getOption(e);this.selectedOptions=t?[{value:t.value,display:t.display}]:[];this.value=(t===null||t===void 0?void 0:t.value)||undefined}}this.change.emit({value:i?undefined:e,values:o,active:r})};this.handleWrapperClick=()=>{this.primaryBtn.focus();this.primaryBtn.click()};this.onClickElsewhere=t=>{const i=t.target;if(i.localName==="click-elsewhere"){t.stopPropagation();const{popoverElement:i}=this;if(!i)return;i.open=false}};this.onMutationObserved=()=>{this.updateSlotState();this.determineOptionCount();this.updateSelectedOptionElements()};this.updateSlotState=()=>{const{hostElement:t,hasPopoverTop:i,hasPopoverBottom:e}=this;const o=t.shadowRoot.querySelector('slot[name="popover-top"]');const r=t.shadowRoot.querySelector('slot[name="popover-bottom"]');const n=(o===null||o===void 0?void 0:o.assignedNodes().length)>0;const a=(r===null||r===void 0?void 0:r.assignedNodes().length)>0;if(i!==n)this.hasPopoverTop=n;if(e!==a)this.hasPopoverBottom=a};this.syncValueProperties=()=>{const{value:t,selectedOptions:i}=this;if(!!(i===null||i===void 0?void 0:i.length))this.selectedOptionsChanged(i);else if(t)this.valueChanged(t)};this.updateSelectedOptionElements=async()=>{var t;const{selectedOptions:i=[]}=this;const e=i.map((t=>t.value));const o=await((t=this.optionList)===null||t===void 0?void 0:t.getOptions());if(this.optionCount)this.active=!!e.length;this.selectedOptionElements=(o===null||o===void 0?void 0:o.filter((t=>e.includes(t.value))))||[]};this.hasPopoverTop=false;this.hasPopoverBottom=false;this.optionCount=undefined;this.selectedOptionElements=[];this.active=undefined;this.borderless=undefined;this.disabled=undefined;this.hoist=!!((o=window.Tecton)===null||o===void 0?void 0:o.useActionSheets);this.label=undefined;this.maxLength=undefined;this.multiple=undefined;this.open=undefined;this.optionListLabel=undefined;this.popoverAlignment="right";this.popoverDirection=undefined;this.popoverMaxHeight=undefined;this.popoverMinHeight=150;this.selectedOptions=[];this.theme=undefined;this.value=undefined}disconnectedCallback(){this.mutationObserver.disconnect();this.mutationObserver=null}componentWillLoad(){const t=new MutationObserver(this.onMutationObserved);t.observe(this.hostElement,{childList:true,attributes:true});this.mutationObserver=t}componentDidLoad(){n(this.hostElement);this.syncValueProperties()}componentDidRender(){this.scheduledAfterRender.forEach((t=>t()));this.scheduledAfterRender=[]}handleSelectedDisplay(){if(this.multiple)return;this.updateSelectedOptionElements()}delegateFocus(t){if(!a(t,this.hostElement))return;this.primaryBtn.focus()}popoverStateHandler({detail:{open:t}}){if(this.open!==t)this.open=t;if(t)return;this.optionList.setActiveElement(null)}async closePopover(){if(!this.open||this.disabled)return;this._togglePopover()}async openPopover(){if(this.open||this.disabled)return;this._togglePopover()}async setValue(t,i={closePopover:true}){var e;const o=new Set(Array.isArray(t)?t:[t]);const r=await((e=this.optionList)===null||e===void 0?void 0:e.getOptions());if(!this.open){await this.openPopover();await s()}o.forEach((t=>{var i;(i=r.find((i=>i.value===t)))===null||i===void 0?void 0:i.click()}));if(i.closePopover){await this.closePopover();await s()}}selectedOptionsChanged(t){var i,e;const{multiple:o}=this;const r=(e=(i=t===null||t===void 0?void 0:t[0])===null||i===void 0?void 0:i.value)!==null&&e!==void 0?e:null;if(o){if(this.value)this.value=null;this.updateSelectedOptionElements()}else if(this.value===r){this.updateSelectedOptionElements()}else{this.value=r}}async valueChanged(t){var i,e;const{multiple:o,selectedOptions:r}=this;if(o)return;const n=(e=(i=r===null||r===void 0?void 0:r[0])===null||i===void 0?void 0:i.value)!==null&&e!==void 0?e:null;if(t===n)this.updateSelectedOptionElements();else{const i=await this.getOption(t);const{value:e,display:o}=i||{value:t,display:null};this.selectedOptions=e?[{value:e,display:o}]:[]}}get buttonContent(){const{label:t,selectedOptions:i,selectedOptionElements:e,optionCount:o}=this;if(!o||e.length===0)return c(t);else if(e.length===1)return c(e[0].display);return c("tecton.element.pill.activeCount",{count:i.length})}get truncatedButtonContent(){const{maxLength:t,buttonContent:i}=this;if(t)return i.length>t?`${i.substring(0,t)}…`:i;else return i}_togglePopover(){const{primaryBtn:t}=this;t===null||t===void 0?void 0:t.click();t===null||t===void 0?void 0:t.focus();t.dispatchEvent(new FocusEvent("focus"))}renderHiddenElement(){return e("div",{id:"option-description",class:"sr","aria-hidden":"true"},c("tecton.element.optionList.optionCount",[this.optionCount]))}renderIcon(){const{optionCount:t,active:i}=this;const o=t&&i;const r=o?"button":"div";const n=o||!t?"close":"chevron-down";return e(r,{class:"btn-close",onClick:o&&this.clearSelectedOptions||undefined,disabled:o&&this.disabled||undefined,"aria-label":o&&c("tecton.element.pill.clearSelection")||undefined,type:o&&"button"||undefined},e("q2-icon",{type:n}))}render(){const{optionCount:t,active:i,open:o}=this;const r=["btn-wrapper"];if(t||i)r.push("has-icon");if(t)r.push("has-options");return e("click-elsewhere",{key:"bf12787a839b5ec97a14a2638b83534a3ccf610b",onChange:this.onClickElsewhere},e("div",{key:"b3c02f4d5400e6637e2848ff70ea0548469ce156",class:r.join(" ")},e("div",{key:"a99df01a6e69f73fe9f21b4ed51113ae2a2ecfcc",class:"btn-height-wrapper",ref:t=>this.primaryBtnWrapper=t,onClick:this.handleWrapperClick,tabIndex:-1},e("button",{key:"2759471703efb53fe6132c36797e5f4d016b0108",class:"btn-primary","test-id":"btn-control",type:"button",role:t&&"combobox"||undefined,ref:t=>this.primaryBtn=t,onClick:this.handleClick,onKeyDown:this.handleKeydown,onFocusout:this.handleButtonFocusout,disabled:this.disabled,"aria-roledescription":!t&&"filter","aria-controls":t&&"option-list"||undefined,"aria-expanded":t&&`${!!o}`||undefined,"aria-label":this.buttonContent,"aria-describedby":t&&"option-description"||undefined},this.truncatedButtonContent,!t&&i&&e("span",{key:"8c0733bf2bae45288dbdf13801305043d0b7cd67",class:"sr"},"(",c("tecton.element.pill.active"),")"))),this.renderIcon(),!!t&&this.renderHiddenElement()),this.optionCount>0&&e("q2-popover",{key:"65af1d895e52ebec3000172ed59713190ec1c4cd",ref:t=>this.popoverElement=t,controlElement:this.primaryBtn,open:this.open,"max-height":this.popoverMaxHeight,minHeight:this.popoverMinHeight,direction:this.popoverDirection,align:this.popoverAlignment},e("div",{key:"8cfde66d75fee798ee956921ba04aa9ed5643651",class:"popover-content"},e("div",{key:"688cf13032c09f0f63fb39c58a0182e77f98ddeb",ref:t=>this.popoverTopContainer=t,class:"popover-top-container",tabindex:"-1",hidden:!this.hasPopoverTop,onKeyDown:this.handleKeydown},e("slot",{key:"af6a97d9bba21ed908c876da0ad8851b9fcb286a",name:"popover-top"})),e("q2-option-list",{key:"fb4c49c8b3936faabe1533973680bcf33e5d13da",type:"listbox",ref:t=>this.optionList=t,id:"option-list",onChange:this.handleChange,multiple:this.multiple,selectedOptions:this.selectedOptions,onReady:()=>this.updateSelectedOptionElements(),label:c("tecton.element.optionList.label",[this.optionListLabel])},e("slot",{key:"ce059f109de1eab4b3129916d14a365fd54f9802"})),e("div",{key:"2f388ecb604db14d4e419128703980e02dda3598",ref:t=>this.popoverBottomContainer=t,class:"popover-bottom-container",tabindex:"-1",hidden:!this.hasPopoverBottom,onKeyDown:this.handleKeydown},e("slot",{key:"2881980ed3c258ccbd58509fb4b348d5dba0d978",name:"popover-bottom"})))))}get hostElement(){return o(this)}static get watchers(){return{selectedOptions:["selectedOptionsChanged"],value:["valueChanged"]}}};v.style=h;export{v as q2_pill};
|
|
2
|
+
//# sourceMappingURL=p-d8d4b389.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,h as t,F as i,g as s}from"./p-a5f18e27.js";import{d as n}from"./p-f1e887f5.js";import{l as a}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,h as t,F as i,g as s}from"./p-a5f18e27.js";import{d as n}from"./p-f1e887f5.js";import{l as a}from"./p-312d4cc7.js";const r="*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:inline}";const o=r;const d=class{constructor(t){e(this,t);this.syncTimer=null;this.trimSuffix=false;this.displayedMessage=undefined;this.baseDate=undefined;this.date=undefined;this.locale=document.documentElement.lang||"en-US";this.messageFormat="short";this.numeric="auto";this.sync=true;this.unit=undefined}connectedCallback(){this.syncUpdated()}disconnectedCallback(){window.clearInterval(this.syncTimer);this.syncTimer=null}componentWillLoad(){this.updateMessage()}async displayedMessageValue(){return this.displayedMessage}async validBaseDateProp(){return this.isValidBaseDate}async validDateProp(){return this.isValidDate}updateMessage(){const{isValidDate:e,isBaseDateProvided:t,isValidBaseDate:i,dateObject:s,baseDateObject:r,locale:o,handleNumeric:d,messageFormat:h,isValidUnit:l,unit:u,trimSuffix:c}=this;if(!e||t&&!i){this.sync=false;this.displayedMessage=a("tecton.element.relativeTime.invalidDate");return}const p=n.intlFormatDistance(new Date(s),new Date(r),{locale:o,localeMatcher:"best fit",numeric:d,style:h,unit:l?u:null});if(c){this.displayedMessage=this.trimMessage(p)}else{this.displayedMessage=p}}syncUpdated(){if(this.sync){this.syncTimer=window.setInterval((()=>{this.updateMessage()}),1e3)}else{window.clearInterval(this.syncTimer);this.syncTimer=null}}get baseDateObject(){if(this.isBaseDateProvided&&this.isValidBaseDate){this.trimSuffix=true;this.sync=false;return new Date(this.baseDate)}else{this.trimSuffix=false;this.sync=true;return new Date}}get dateObject(){return new Date(this.date)}get handleNumeric(){if(this.isValidBaseDate)return"always";return this.numeric}get isBaseDateProvided(){return this.baseDate!==undefined}get isValidBaseDate(){const e=new Date(this.baseDate);const t=n.isValid(e);if(!t&&this.isBaseDateProvided){console.warn("Error: Invalid baseDate provided to q2-relative-time.")}return t}get isValidDate(){const e=new Date(this.date);const t=n.isValid(e);if(!t)console.warn("Error: Invalid date provided to q2-relative-time.");return t}get isValidUnit(){if(["second","minute","hour","day","month","quarter","year"].includes(this.unit))return true;return false}get shouldShow(){return!!this.displayedMessage}trimMessage(e){return e.replace(/^in\s?/,"").replace(/\sago$/,"")}render(){const{shouldShow:e,displayedMessage:s}=this;return t(i,{key:"ed93ac75ce8c58e36ac28a11b735c1f27bb9f36b"},e?t("time",{dateTime:s},s):null)}get hostElement(){return s(this)}static get watchers(){return{messageFormat:["updateMessage"],locale:["updateMessage"],date:["updateMessage"],baseDate:["updateMessage"],numeric:["updateMessage"],unit:["updateMessage"],sync:["syncUpdated"]}}};d.style=o;export{d as q2_relative_time};
|
|
2
|
+
//# sourceMappingURL=p-f01ffdeb.entry.js.map
|