q2-tecton-elements 1.45.1 → 1.45.3
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 +36 -4
- package/dist/cjs/click-elsewhere_2.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q2-calendar.cjs.entry.js +2 -1
- package/dist/cjs/q2-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-dropdown.cjs.entry.js +2 -1
- package/dist/cjs/q2-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-icon.cjs.entry.js +5 -3
- package/dist/cjs/q2-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-message.cjs.entry.js +1 -1
- package/dist/cjs/q2-message.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-select.cjs.entry.js +4 -3
- package/dist/cjs/q2-select.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js +1 -1
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-stepper.cjs.entry.js +1 -1
- package/dist/cjs/q2-stepper.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
- package/dist/collection/components/q2-calendar/q2-calendar.js +23 -1
- package/dist/collection/components/q2-calendar/q2-calendar.js.map +1 -1
- package/dist/collection/components/q2-dropdown/q2-dropdown.js +23 -1
- package/dist/collection/components/q2-dropdown/q2-dropdown.js.map +1 -1
- package/dist/collection/components/q2-icon/q2-icon.js +6 -4
- package/dist/collection/components/q2-icon/q2-icon.js.map +1 -1
- package/dist/collection/components/q2-message/q2-message.css +3 -3
- package/dist/collection/components/q2-popover/q2-popover.css +3 -0
- package/dist/collection/components/q2-popover/q2-popover.js +53 -3
- package/dist/collection/components/q2-popover/q2-popover.js.map +1 -1
- package/dist/collection/components/q2-select/q2-select.js +25 -3
- package/dist/collection/components/q2-select/q2-select.js.map +1 -1
- package/dist/collection/components/q2-stepper/q2-stepper.css +4 -2
- package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.css +5 -16
- package/dist/components/q2-calendar.js +3 -1
- package/dist/components/q2-calendar.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-icon2.js +6 -4
- package/dist/components/q2-icon2.js.map +1 -1
- package/dist/components/q2-message2.js +1 -1
- package/dist/components/q2-message2.js.map +1 -1
- package/dist/components/q2-popover2.js +37 -4
- package/dist/components/q2-popover2.js.map +1 -1
- package/dist/components/q2-select.js +5 -3
- package/dist/components/q2-select.js.map +1 -1
- package/dist/components/q2-stepper-vertical.js +1 -1
- package/dist/components/q2-stepper-vertical.js.map +1 -1
- package/dist/components/q2-stepper.js +1 -1
- package/dist/components/q2-stepper.js.map +1 -1
- package/dist/esm/click-elsewhere_2.entry.js +36 -4
- package/dist/esm/click-elsewhere_2.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q2-calendar.entry.js +2 -1
- package/dist/esm/q2-calendar.entry.js.map +1 -1
- package/dist/esm/q2-dropdown.entry.js +2 -1
- package/dist/esm/q2-dropdown.entry.js.map +1 -1
- package/dist/esm/q2-icon.entry.js +6 -4
- package/dist/esm/q2-icon.entry.js.map +1 -1
- package/dist/esm/q2-message.entry.js +1 -1
- package/dist/esm/q2-message.entry.js.map +1 -1
- package/dist/esm/q2-select.entry.js +4 -3
- package/dist/esm/q2-select.entry.js.map +1 -1
- package/dist/esm/q2-stepper-vertical.entry.js +1 -1
- package/dist/esm/q2-stepper-vertical.entry.js.map +1 -1
- package/dist/esm/q2-stepper.entry.js +1 -1
- package/dist/esm/q2-stepper.entry.js.map +1 -1
- package/dist/esm/q2-tecton-elements.js +1 -1
- package/dist/q2-tecton-elements/p-445990a8.entry.js +2 -0
- package/dist/q2-tecton-elements/p-445990a8.entry.js.map +1 -0
- package/dist/q2-tecton-elements/p-68556733.entry.js +2 -0
- package/dist/q2-tecton-elements/p-68556733.entry.js.map +1 -0
- package/dist/q2-tecton-elements/p-a977e723.entry.js +2 -0
- package/dist/q2-tecton-elements/p-a977e723.entry.js.map +1 -0
- package/dist/q2-tecton-elements/p-bfe9d688.entry.js +2 -0
- package/dist/q2-tecton-elements/p-bfe9d688.entry.js.map +1 -0
- package/dist/q2-tecton-elements/{p-f1281e3f.entry.js → p-bffda54d.entry.js} +2 -2
- package/dist/q2-tecton-elements/p-bffda54d.entry.js.map +1 -0
- package/dist/q2-tecton-elements/p-c016bd18.entry.js +2 -0
- package/dist/q2-tecton-elements/p-c016bd18.entry.js.map +1 -0
- package/dist/q2-tecton-elements/p-cadceb00.entry.js +2 -0
- package/dist/q2-tecton-elements/p-cadceb00.entry.js.map +1 -0
- package/dist/q2-tecton-elements/p-f0813fb4.entry.js +2 -0
- package/dist/q2-tecton-elements/p-f0813fb4.entry.js.map +1 -0
- 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/test/elements/q2-action-sheet-test.e2e.js +5 -1
- package/dist/test/elements/q2-action-sheet-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-avatar-test.e2e.js +2 -3
- package/dist/test/elements/q2-avatar-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-badge-test.e2e.js +5 -1
- package/dist/test/elements/q2-badge-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-btn-test.e2e.js +5 -1
- package/dist/test/elements/q2-btn-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-calendar-test.e2e.js +25 -1
- package/dist/test/elements/q2-calendar-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-card-test.e2e.js +5 -1
- package/dist/test/elements/q2-card-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-chart-area-test.e2e.js +5 -1
- package/dist/test/elements/q2-chart-area-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-chart-bar-test.e2e.js +5 -1
- package/dist/test/elements/q2-chart-bar-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-chart-donut-test.e2e.js +5 -1
- package/dist/test/elements/q2-chart-donut-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-checkbox-group-test.e2e.js +5 -1
- package/dist/test/elements/q2-checkbox-group-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-checkbox-test.e2e.js +5 -1
- package/dist/test/elements/q2-checkbox-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-currency-test.e2e.js +5 -1
- package/dist/test/elements/q2-currency-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-data-table-test.e2e.js +5 -1
- package/dist/test/elements/q2-data-table-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-dropdown-item-test.e2e.js +5 -1
- package/dist/test/elements/q2-dropdown-item-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-dropdown-test.e2e.js +35 -1
- package/dist/test/elements/q2-dropdown-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-editable-field-test.e2e.js +5 -1
- package/dist/test/elements/q2-editable-field-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-icon-test.e2e.js +22 -1
- package/dist/test/elements/q2-icon-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-input-test.e2e.js +5 -1
- package/dist/test/elements/q2-input-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-loading-test.e2e.js +5 -1
- package/dist/test/elements/q2-loading-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-loc-test.e2e.js +5 -1
- package/dist/test/elements/q2-loc-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-message-test.e2e.js +5 -1
- package/dist/test/elements/q2-message-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-optgroup-test.e2e.js +5 -1
- package/dist/test/elements/q2-optgroup-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-option-list-test.e2e.js +5 -1
- package/dist/test/elements/q2-option-list-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-option-test.e2e.js +5 -1
- package/dist/test/elements/q2-option-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-pagination-test.e2e.js +5 -1
- package/dist/test/elements/q2-pagination-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-pill-test.e2e.js +2 -3
- package/dist/test/elements/q2-pill-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-popover-test.e2e.js +6 -2
- package/dist/test/elements/q2-popover-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-popover-test.spec.js +99 -13
- package/dist/test/elements/q2-popover-test.spec.js.map +1 -1
- package/dist/test/elements/q2-radio-group-test.e2e.js +5 -1
- package/dist/test/elements/q2-radio-group-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-radio-test.e2e.js +5 -1
- package/dist/test/elements/q2-radio-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-relative-time-test.e2e.js +8 -4
- package/dist/test/elements/q2-relative-time-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-section-test.e2e.js +5 -1
- package/dist/test/elements/q2-section-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-select-test.e2e.js +29 -1
- package/dist/test/elements/q2-select-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-stepper-pane-test.e2e.js +5 -1
- package/dist/test/elements/q2-stepper-pane-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-stepper-test.e2e.js +5 -1
- package/dist/test/elements/q2-stepper-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-stepper-vertical-test.e2e.js +5 -1
- package/dist/test/elements/q2-stepper-vertical-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-tab-container-test.e2e.js +5 -1
- package/dist/test/elements/q2-tab-container-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-tab-pane-test.e2e.js +5 -1
- package/dist/test/elements/q2-tab-pane-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-tag-test.e2e.js +2 -3
- package/dist/test/elements/q2-tag-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-textarea-test.e2e.js +5 -1
- package/dist/test/elements/q2-textarea-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-tooltip-test.e2e.js +5 -1
- package/dist/test/elements/q2-tooltip-test.e2e.js.map +1 -1
- package/dist/test/elements/tecton-tab-pane-test.e2e.js +5 -1
- package/dist/test/elements/tecton-tab-pane-test.e2e.js.map +1 -1
- package/dist/test/helpers.js +1 -1
- package/dist/test/helpers.js.map +1 -1
- package/dist/types/components/q2-icon/q2-icon.d.ts +1 -0
- package/dist/types/components/q2-popover/q2-popover.d.ts +3 -1
- package/dist/types/components.d.ts +32 -0
- package/dist/types/workspace/workspace/tecton-production_release_1.45.x/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +1 -1
- package/package.json +3 -3
- package/dist/q2-tecton-elements/p-4a332c2a.entry.js +0 -2
- package/dist/q2-tecton-elements/p-4a332c2a.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-4f7e2c8a.entry.js +0 -2
- package/dist/q2-tecton-elements/p-4f7e2c8a.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-7f663376.entry.js +0 -2
- package/dist/q2-tecton-elements/p-7f663376.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-bf125cdf.entry.js +0 -2
- package/dist/q2-tecton-elements/p-bf125cdf.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-c4c458b7.entry.js +0 -2
- package/dist/q2-tecton-elements/p-c4c458b7.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-f1281e3f.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-f162c670.entry.js +0 -2
- package/dist/q2-tecton-elements/p-f162c670.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-f418967b.entry.js +0 -2
- package/dist/q2-tecton-elements/p-f418967b.entry.js.map +0 -1
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { setup } from "../helpers";
|
|
1
|
+
import { getListOfStyleCompilationIssues, setup } from "../helpers";
|
|
2
2
|
describe('q2-tooltip', () => {
|
|
3
3
|
const tooltipText = 'Good tooltip text';
|
|
4
4
|
let page;
|
|
5
5
|
let tooltip;
|
|
6
6
|
let container;
|
|
7
|
+
it('properly compiles CSS vars and functions', async () => {
|
|
8
|
+
const page = await setup({ html: '<q2-tooltip></q2-tooltip>' });
|
|
9
|
+
expect(await getListOfStyleCompilationIssues(page, 'q2-tooltip')).toHaveLength(0);
|
|
10
|
+
});
|
|
7
11
|
it('renders tooltip on hover', async () => {
|
|
8
12
|
page = await setup({
|
|
9
13
|
html: `<q2-tooltip label="${tooltipText}">Hover me</q2-tooltip>`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"q2-tooltip-test.e2e.js","sourceRoot":"","sources":["../../../test/elements/q2-tooltip-test.e2e.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IACxB,MAAM,WAAW,GAAG,mBAAmB,CAAC;IACxC,IAAI,IAAa,CAAC;IAClB,IAAI,OAAmB,CAAC;IACxB,IAAI,SAAqB,CAAC;IAE1B,EAAE,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;QACtC,IAAI,GAAG,MAAM,KAAK,CAAC;YACf,IAAI,EAAE,sBAAsB,WAAW,yBAAyB;SACnE,CAAC,CAAC;QACH,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAC5B,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACxC,SAAS,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;QACvD,MAAM,CAAC,OAAO,CAAC,CAAC,gBAAgB,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;QAClD,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAElE,IAAI,qBAAqB,GA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C;oBAE5B,MAAM,CAAC,MAAM,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;gBACtE,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { E2EElement, E2EPage } from '@stencil/core/testing';\nimport { setup } from '../helpers';\n\ndescribe('q2-tooltip', () => {\n const tooltipText = 'Good tooltip text';\n let page: E2EPage;\n let tooltip: E2EElement;\n let container: E2EElement;\n\n it('renders tooltip on hover', async () => {\n page = await setup({\n html: `<q2-tooltip label=\"${tooltipText}\">Hover me</q2-tooltip>`,\n });\n await page.waitForChanges();\n tooltip = await page.find('q2-tooltip');\n container = await page.find('q2-tooltip >>> .tooltip');\n expect(tooltip).toEqualAttribute('position', 'n');\n expect(container.getAttribute('aria-label')).toEqual(tooltipText);\n\n let containerPseudoStyles = await container.getComputedStyle(':after');\n expect(containerPseudoStyles.visibility).toEqual('hidden');\n expect(containerPseudoStyles.opacity).toEqual('0');\n\n await tooltip.hover();\n await container.waitForEvent('transitionend');\n await page.waitForChanges();\n\n containerPseudoStyles = await container.getComputedStyle(':after');\n expect(containerPseudoStyles.visibility).toEqual('visible');\n expect(containerPseudoStyles.opacity).toEqual('1');\n });\n\n describe('Focus', () => {\n describe('when content is focused', () => {\n async function testFocusType(type: 'focus' | 'click') {\n page = await setup({\n html: `\n <q2-tooltip label=\"${tooltipText}\">\n <button id=\"in\">Focus me</button>\n </q2-tooltip>\n <button id=\"out\">Focus me</button> `,\n });\n const inButton = await page.find('button#in');\n const outButton = await page.find('button#out');\n container = await page.find('q2-tooltip >>> .tooltip');\n const typeClassName = type === 'focus' ? 'has-keyboard-focus' : 'has-generic-focus';\n expect(container).not.toHaveClass(typeClassName);\n\n await inButton[type]();\n await page.waitForChanges();\n\n expect(container).toHaveClass(typeClassName);\n\n await outButton[type]();\n await page.waitForChanges();\n expect(container).not.toHaveClass(typeClassName);\n }\n\n it('adds the keyboard class when focused', async () => {\n await testFocusType('focus');\n });\n\n it('adds the generic class when clicked', async () => {\n await testFocusType('click');\n });\n\n it('closes the tooltip on Escape', async () => {\n page = await setup({\n html: `\n <q2-tooltip label=\"${tooltipText}\">\n <button>Focus me</button>\n </q2-tooltip>\n `,\n });\n const button = await page.find('button');\n container = await page.find('q2-tooltip >>> .tooltip');\n expect(container).not.toHaveClass('has-generic-focus');\n\n await button.click();\n await page.waitForChanges();\n\n expect(container).toHaveClass('has-generic-focus');\n\n await button.press('Escape');\n await page.waitForChanges();\n\n expect(container).not.toHaveClass('has-generic-focus');\n });\n });\n });\n\n describe('Props', () => {\n describe('label', () => {\n describe('when not provided', () => {\n it('does not wrap the slot in a tooltip', async () => {\n page = await setup({\n html: `<q2-tooltip>Hover me</q2-tooltip>`,\n });\n await page.waitForChanges();\n container = await page.find('q2-tooltip >>> .tooltip');\n expect(container).toBeNull();\n });\n });\n\n describe('when provided', () => {\n it('wraps the slot in a tooltip', async () => {\n page = await setup({\n html: `<q2-tooltip label=\"${tooltipText}\" multiline>Hover me</q2-tooltip>`,\n });\n await page.waitForChanges();\n container = await page.find('q2-tooltip >>> .tooltip');\n expect(container).toBeTruthy();\n expect(container).toEqualAttribute('aria-label', tooltipText);\n });\n });\n });\n\n describe('block', () => {\n describe('when not provided', () => {\n it('does not apply block styles', async () => {\n page = await setup({\n html: `<q2-tooltip label=\"${tooltipText}\">Hover me</q2-tooltip>`,\n });\n await page.waitForChanges();\n tooltip = await page.find('q2-tooltip');\n const tooltipPseudoStyles = await tooltip.getComputedStyle();\n expect(tooltipPseudoStyles.display).toEqual('inline-block');\n\n container = await page.find('q2-tooltip >>> .tooltip');\n const containerPseudoStyles = await container.getComputedStyle();\n expect(containerPseudoStyles.display).toEqual('inline-block');\n });\n });\n\n describe('when provided', () => {\n it('applies block styles', async () => {\n page = await setup({\n html: `<q2-tooltip label=\"${tooltipText}\" block>Hover me</q2-tooltip>`,\n });\n await page.waitForChanges();\n tooltip = await page.find('q2-tooltip');\n const tooltipPseudoStyles = await tooltip.getComputedStyle();\n expect(tooltipPseudoStyles.display).toEqual('block');\n\n container = await page.find('q2-tooltip >>> .tooltip');\n const containerPseudoStyles = await container.getComputedStyle();\n expect(containerPseudoStyles.display).toEqual('block');\n });\n });\n });\n\n describe('multiline', () => {\n describe('when not provided', () => {\n it('does not apply multiline styles', async () => {\n page = await setup({\n html: `<q2-tooltip label=\"${tooltipText}\">Hover me</q2-tooltip>`,\n });\n await page.waitForChanges();\n container = await page.find('q2-tooltip >>> .tooltip');\n const containerPseudoStyles = await container.getComputedStyle(':after');\n expect(containerPseudoStyles.wordBreak).toEqual('normal');\n });\n });\n\n describe('when provided', () => {\n it('applies multiline styles', async () => {\n page = await setup({\n html: `<q2-tooltip label=\"${tooltipText}\" multiline>Hover me</q2-tooltip>`,\n });\n await page.waitForChanges();\n container = await page.find('q2-tooltip >>> .tooltip');\n const containerPseudoStyles = await container.getComputedStyle(':after');\n expect(containerPseudoStyles.wordBreak).toEqual('break-word');\n });\n });\n });\n\n describe('persistent', () => {\n describe('when not provided', () => {\n it('does not show the tooltip by default', async () => {\n page = await setup({\n html: `<q2-tooltip label=\"${tooltipText}\">Hover me</q2-tooltip>`,\n });\n await page.waitForChanges();\n container = await page.find('q2-tooltip >>> .tooltip');\n const containerPseudoStyles = await container.getComputedStyle(':after');\n expect(containerPseudoStyles.visibility).toEqual('hidden');\n expect(containerPseudoStyles.opacity).toEqual('0');\n });\n });\n\n describe('when provided', () => {\n it('shows the tooltip by default', async () => {\n page = await setup({\n html: `<q2-tooltip label=\"${tooltipText}\" persistent>Hover me</q2-tooltip>`,\n });\n await page.waitForChanges();\n container = await page.find('q2-tooltip >>> .tooltip');\n const containerPseudoStyles = await container.getComputedStyle(':after');\n expect(containerPseudoStyles.visibility).toEqual('visible');\n expect(containerPseudoStyles.opacity).toEqual('1');\n });\n });\n });\n\n describe('focusable', () => {\n const innerActiveTestId = async (page: E2EPage) => {\n return page.$eval('q2-tooltip', el => el.shadowRoot.activeElement?.getAttribute('test-id'));\n };\n describe('when not provided', () => {\n beforeEach(async () => {\n page = await setup({\n html: `<q2-tooltip label=\"${tooltipText}\">Hover me</q2-tooltip>`,\n });\n await page.waitForChanges();\n tooltip = await page.find('q2-tooltip');\n container = await page.find('q2-tooltip >>> .tooltip');\n });\n\n it('tabindex should be undefined', async () => {\n expect(container.getAttribute('tabindex')).toBeNull();\n });\n\n it('focuses inner button when focus event is dispatched', async () => {\n await tooltip.triggerEvent('focus');\n await page.waitForChanges();\n\n expect(await innerActiveTestId(page)).toBeUndefined();\n });\n\n it('focuses inner button when element.focus() is called', async () => {\n await tooltip.focus();\n await page.waitForChanges();\n\n expect(await innerActiveTestId(page)).toBeUndefined();\n });\n });\n\n describe('when provided', () => {\n beforeEach(async () => {\n page = await setup({\n html: `<q2-tooltip label=\"${tooltipText}\" focusable>Hover me</q2-tooltip>`,\n });\n await page.waitForChanges();\n tooltip = await page.find('q2-tooltip');\n container = await page.find('q2-tooltip >>> .tooltip');\n });\n\n it('tabindex should be 0', async () => {\n expect(container.getAttribute('tabindex')).toEqual('0');\n });\n\n it('focuses inner button when focus event is dispatched', async () => {\n await tooltip.triggerEvent('focus');\n await page.waitForChanges();\n\n expect(await innerActiveTestId(page)).toEqual('tooltipContainer');\n });\n\n it('focuses inner button when element.focus() is called', async () => {\n await tooltip.focus();\n await page.waitForChanges();\n\n expect(await innerActiveTestId(page)).toEqual('tooltipContainer');\n });\n });\n });\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"q2-tooltip-test.e2e.js","sourceRoot":"","sources":["../../../test/elements/q2-tooltip-test.e2e.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEpE,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IACxB,MAAM,WAAW,GAAG,mBAAmB,CAAC;IACxC,IAAI,IAAa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AAI,EAAE,sBAAsB,WAAW,mCAAmC;qBAC7E,CAAC,CAAC;oBACH,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;oBAC5B,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;oBACxC,SAAS,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;gBAC3D,CAAC,CAAC,CAAC;gBAEH,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;oBAClC,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;gBAC5D,CAAC,CAAC,CAAC;gBAEH,EAAE,CAAC,qDAAqD,EAAE,KAAK,IAAI,EAAE;oBACjE,MAAM,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;oBACpC,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;oBAE5B,MAAM,CAAC,MAAM,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;gBACtE,CAAC,CAAC,CAAC;gBAEH,EAAE,CAAC,qDAAqD,EAAE,KAAK,IAAI,EAAE;oBACjE,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;oBACtB,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;oBAE5B,MAAM,CAAC,MAAM,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;gBACtE,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { E2EElement, E2EPage } from '@stencil/core/testing';\nimport { getListOfStyleCompilationIssues, setup } from '../helpers';\n\ndescribe('q2-tooltip', () => {\n const tooltipText = 'Good tooltip text';\n let page: E2EPage;\n let tooltip: E2EElement;\n let container: E2EElement;\n\n it('properly compiles CSS vars and functions', async () => {\n const page = await setup({ html: '<q2-tooltip></q2-tooltip>' });\n expect(await getListOfStyleCompilationIssues(page, 'q2-tooltip')).toHaveLength(0);\n });\n\n it('renders tooltip on hover', async () => {\n page = await setup({\n html: `<q2-tooltip label=\"${tooltipText}\">Hover me</q2-tooltip>`,\n });\n await page.waitForChanges();\n tooltip = await page.find('q2-tooltip');\n container = await page.find('q2-tooltip >>> .tooltip');\n expect(tooltip).toEqualAttribute('position', 'n');\n expect(container.getAttribute('aria-label')).toEqual(tooltipText);\n\n let containerPseudoStyles = await container.getComputedStyle(':after');\n expect(containerPseudoStyles.visibility).toEqual('hidden');\n expect(containerPseudoStyles.opacity).toEqual('0');\n\n await tooltip.hover();\n await container.waitForEvent('transitionend');\n await page.waitForChanges();\n\n containerPseudoStyles = await container.getComputedStyle(':after');\n expect(containerPseudoStyles.visibility).toEqual('visible');\n expect(containerPseudoStyles.opacity).toEqual('1');\n });\n\n describe('Focus', () => {\n describe('when content is focused', () => {\n async function testFocusType(type: 'focus' | 'click') {\n page = await setup({\n html: `\n <q2-tooltip label=\"${tooltipText}\">\n <button id=\"in\">Focus me</button>\n </q2-tooltip>\n <button id=\"out\">Focus me</button> `,\n });\n const inButton = await page.find('button#in');\n const outButton = await page.find('button#out');\n container = await page.find('q2-tooltip >>> .tooltip');\n const typeClassName = type === 'focus' ? 'has-keyboard-focus' : 'has-generic-focus';\n expect(container).not.toHaveClass(typeClassName);\n\n await inButton[type]();\n await page.waitForChanges();\n\n expect(container).toHaveClass(typeClassName);\n\n await outButton[type]();\n await page.waitForChanges();\n expect(container).not.toHaveClass(typeClassName);\n }\n\n it('adds the keyboard class when focused', async () => {\n await testFocusType('focus');\n });\n\n it('adds the generic class when clicked', async () => {\n await testFocusType('click');\n });\n\n it('closes the tooltip on Escape', async () => {\n page = await setup({\n html: `\n <q2-tooltip label=\"${tooltipText}\">\n <button>Focus me</button>\n </q2-tooltip>\n `,\n });\n const button = await page.find('button');\n container = await page.find('q2-tooltip >>> .tooltip');\n expect(container).not.toHaveClass('has-generic-focus');\n\n await button.click();\n await page.waitForChanges();\n\n expect(container).toHaveClass('has-generic-focus');\n\n await button.press('Escape');\n await page.waitForChanges();\n\n expect(container).not.toHaveClass('has-generic-focus');\n });\n });\n });\n\n describe('Props', () => {\n describe('label', () => {\n describe('when not provided', () => {\n it('does not wrap the slot in a tooltip', async () => {\n page = await setup({\n html: `<q2-tooltip>Hover me</q2-tooltip>`,\n });\n await page.waitForChanges();\n container = await page.find('q2-tooltip >>> .tooltip');\n expect(container).toBeNull();\n });\n });\n\n describe('when provided', () => {\n it('wraps the slot in a tooltip', async () => {\n page = await setup({\n html: `<q2-tooltip label=\"${tooltipText}\" multiline>Hover me</q2-tooltip>`,\n });\n await page.waitForChanges();\n container = await page.find('q2-tooltip >>> .tooltip');\n expect(container).toBeTruthy();\n expect(container).toEqualAttribute('aria-label', tooltipText);\n });\n });\n });\n\n describe('block', () => {\n describe('when not provided', () => {\n it('does not apply block styles', async () => {\n page = await setup({\n html: `<q2-tooltip label=\"${tooltipText}\">Hover me</q2-tooltip>`,\n });\n await page.waitForChanges();\n tooltip = await page.find('q2-tooltip');\n const tooltipPseudoStyles = await tooltip.getComputedStyle();\n expect(tooltipPseudoStyles.display).toEqual('inline-block');\n\n container = await page.find('q2-tooltip >>> .tooltip');\n const containerPseudoStyles = await container.getComputedStyle();\n expect(containerPseudoStyles.display).toEqual('inline-block');\n });\n });\n\n describe('when provided', () => {\n it('applies block styles', async () => {\n page = await setup({\n html: `<q2-tooltip label=\"${tooltipText}\" block>Hover me</q2-tooltip>`,\n });\n await page.waitForChanges();\n tooltip = await page.find('q2-tooltip');\n const tooltipPseudoStyles = await tooltip.getComputedStyle();\n expect(tooltipPseudoStyles.display).toEqual('block');\n\n container = await page.find('q2-tooltip >>> .tooltip');\n const containerPseudoStyles = await container.getComputedStyle();\n expect(containerPseudoStyles.display).toEqual('block');\n });\n });\n });\n\n describe('multiline', () => {\n describe('when not provided', () => {\n it('does not apply multiline styles', async () => {\n page = await setup({\n html: `<q2-tooltip label=\"${tooltipText}\">Hover me</q2-tooltip>`,\n });\n await page.waitForChanges();\n container = await page.find('q2-tooltip >>> .tooltip');\n const containerPseudoStyles = await container.getComputedStyle(':after');\n expect(containerPseudoStyles.wordBreak).toEqual('normal');\n });\n });\n\n describe('when provided', () => {\n it('applies multiline styles', async () => {\n page = await setup({\n html: `<q2-tooltip label=\"${tooltipText}\" multiline>Hover me</q2-tooltip>`,\n });\n await page.waitForChanges();\n container = await page.find('q2-tooltip >>> .tooltip');\n const containerPseudoStyles = await container.getComputedStyle(':after');\n expect(containerPseudoStyles.wordBreak).toEqual('break-word');\n });\n });\n });\n\n describe('persistent', () => {\n describe('when not provided', () => {\n it('does not show the tooltip by default', async () => {\n page = await setup({\n html: `<q2-tooltip label=\"${tooltipText}\">Hover me</q2-tooltip>`,\n });\n await page.waitForChanges();\n container = await page.find('q2-tooltip >>> .tooltip');\n const containerPseudoStyles = await container.getComputedStyle(':after');\n expect(containerPseudoStyles.visibility).toEqual('hidden');\n expect(containerPseudoStyles.opacity).toEqual('0');\n });\n });\n\n describe('when provided', () => {\n it('shows the tooltip by default', async () => {\n page = await setup({\n html: `<q2-tooltip label=\"${tooltipText}\" persistent>Hover me</q2-tooltip>`,\n });\n await page.waitForChanges();\n container = await page.find('q2-tooltip >>> .tooltip');\n const containerPseudoStyles = await container.getComputedStyle(':after');\n expect(containerPseudoStyles.visibility).toEqual('visible');\n expect(containerPseudoStyles.opacity).toEqual('1');\n });\n });\n });\n\n describe('focusable', () => {\n const innerActiveTestId = async (page: E2EPage) => {\n return page.$eval('q2-tooltip', el => el.shadowRoot.activeElement?.getAttribute('test-id'));\n };\n describe('when not provided', () => {\n beforeEach(async () => {\n page = await setup({\n html: `<q2-tooltip label=\"${tooltipText}\">Hover me</q2-tooltip>`,\n });\n await page.waitForChanges();\n tooltip = await page.find('q2-tooltip');\n container = await page.find('q2-tooltip >>> .tooltip');\n });\n\n it('tabindex should be undefined', async () => {\n expect(container.getAttribute('tabindex')).toBeNull();\n });\n\n it('focuses inner button when focus event is dispatched', async () => {\n await tooltip.triggerEvent('focus');\n await page.waitForChanges();\n\n expect(await innerActiveTestId(page)).toBeUndefined();\n });\n\n it('focuses inner button when element.focus() is called', async () => {\n await tooltip.focus();\n await page.waitForChanges();\n\n expect(await innerActiveTestId(page)).toBeUndefined();\n });\n });\n\n describe('when provided', () => {\n beforeEach(async () => {\n page = await setup({\n html: `<q2-tooltip label=\"${tooltipText}\" focusable>Hover me</q2-tooltip>`,\n });\n await page.waitForChanges();\n tooltip = await page.find('q2-tooltip');\n container = await page.find('q2-tooltip >>> .tooltip');\n });\n\n it('tabindex should be 0', async () => {\n expect(container.getAttribute('tabindex')).toEqual('0');\n });\n\n it('focuses inner button when focus event is dispatched', async () => {\n await tooltip.triggerEvent('focus');\n await page.waitForChanges();\n\n expect(await innerActiveTestId(page)).toEqual('tooltipContainer');\n });\n\n it('focuses inner button when element.focus() is called', async () => {\n await tooltip.focus();\n await page.waitForChanges();\n\n expect(await innerActiveTestId(page)).toEqual('tooltipContainer');\n });\n });\n });\n });\n});\n"]}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { setup, dispatchEvent } from "../helpers";
|
|
1
|
+
import { setup, dispatchEvent, getListOfStyleCompilationIssues } from "../helpers";
|
|
2
2
|
describe('tecton-tab-pane', () => {
|
|
3
|
+
it('properly compiles CSS vars and functions', async () => {
|
|
4
|
+
const page = await setup({ html: '<tecton-tab-pane></tecton-tab-pane>' });
|
|
5
|
+
expect(await getListOfStyleCompilationIssues(page, 'tecton-tab-pane')).toHaveLength(0);
|
|
6
|
+
});
|
|
3
7
|
it('correctly renders shadow DOM elements', async function () {
|
|
4
8
|
const page = await setup({
|
|
5
9
|
html: `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tecton-tab-pane-test.e2e.js","sourceRoot":"","sources":["../../../test/elements/tecton-tab-pane-test.e2e.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,CAAC,iBAAiB,EAAE,OAAO,CAAC,EAAE;YAC1C,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YAC1D,MAAM,CAAC,aAAa,CAAC,WAAW,GAAG,WAAW,CAAC;QACnD,CAAC,CAAC,CAAC;QAEH,MAAM,aAAa,CAAC,IAAI,EAAE,CAAC,iBAAiB,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;QAEjE,MAAM,CAAC,WAAW,CAAC,CAAC,UAAU,EAAE,CAAC;QACjC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { setup, dispatchEvent, getListOfStyleCompilationIssues } from '../helpers';\n\ndescribe('tecton-tab-pane', () => {\n it('properly compiles CSS vars and functions', async () => {\n const page = await setup({ html: '<tecton-tab-pane></tecton-tab-pane>' });\n expect(await getListOfStyleCompilationIssues(page, 'tecton-tab-pane')).toHaveLength(0);\n });\n it('correctly renders shadow DOM elements', async function (): Promise<void> {\n const page = await setup({\n html: `\n <tecton-tab-pane\n label=\"Tab 1\"\n value=\"tab1\"\n module-id=\"moduleId\"\n url=\"tectontabpanetest/url\"\n min-height=\"200px\"></tecton-tab-pane>\n `,\n });\n\n const tabPane = await page.find('tecton-tab-pane');\n tabPane.setProperty('index', 0);\n tabPane.setProperty('guid', 1000);\n tabPane.setProperty('provided', false);\n await page.waitForChanges();\n\n const innerTabPane = await page.find('tecton-tab-pane >>> .tab-pane');\n\n expect(innerTabPane.id).toEqual('tab-pane-1000-0');\n expect(innerTabPane).toEqualAttribute('role', 'tabpanel');\n expect(innerTabPane).toEqualAttribute('tabindex', '-1');\n expect(innerTabPane).toEqualAttribute('aria-labelledby', 'tab-1000-0');\n expect(innerTabPane).toHaveClass('hidden');\n expect(innerTabPane).not.toHaveAttribute('aria-expanded');\n expect(innerTabPane).toEqualAttribute('aria-hidden', 'true');\n\n tabPane.setProperty('selected', true);\n await page.waitForChanges();\n\n expect(innerTabPane).not.toHaveClass('hidden');\n expect(innerTabPane).not.toHaveAttribute('aria-expanded');\n expect(innerTabPane).toEqualAttribute('aria-hidden', 'false');\n\n let iframe = await page.find('tecton-tab-pane >>> iframe');\n expect(iframe).toEqualAttribute('src', 'tectontabpanetest/url');\n expect(iframe).toHaveAttribute('hidden');\n expect(iframe).toEqualAttribute('data-module-id', 'moduleId');\n expect(iframe).toEqualAttribute('scrolling', 'no');\n expect(iframe).toEqualAttribute('allow', 'geolocation; camera');\n\n const slot = await page.find('tecton-tab-pane >>> slot');\n expect(slot).not.toBeNull();\n\n let slotWrapper = await page.find('tecton-tab-pane >>> .slot-wrapper');\n expect(await slotWrapper.getProperty('hidden')).toEqual(true);\n\n tabPane.setProperty('provided', true);\n await page.waitForChanges();\n\n slotWrapper = await page.find('tecton-tab-pane >>> .slot-wrapper');\n expect(await slotWrapper.getProperty('hidden')).toEqual(false);\n\n iframe = await page.find('tecton-tab-pane >>> iframe');\n expect(iframe).toBeNull();\n });\n\n it.skip('initializes legacy iframeResizer', async function (): Promise<void> {\n // seems to be causing puppeteer error\n const page = await setup({\n html: `\n <tecton-tab-pane\n label=\"Tab 1\"\n value=\"tab1\"\n selected\n module-id=\"moduleId\"\n url=\"tectontabpanetest/url\"\n min-height=\"200px\"></tecton-tab-pane>\n `,\n });\n const tabPane = await page.find('tecton-tab-pane');\n tabPane.setProperty('provided', false);\n await page.waitForChanges();\n\n const postMessage = jest.fn();\n await page.exposeFunction('postMessage', postMessage);\n await page.$eval('tecton-tab-pane', element => {\n const iframe = element.shadowRoot.querySelector('iframe');\n iframe.contentWindow.postMessage = postMessage;\n });\n\n await dispatchEvent(page, ['tecton-tab-pane', 'iframe'], 'load');\n\n expect(postMessage).toBeCalled();\n expect(postMessage.mock.calls[0][0].includes('moduleId')).toBe(true);\n });\n});\n"]}
|
package/dist/test/helpers.js
CHANGED
|
@@ -137,7 +137,7 @@ export const testDeprecatedAriaLabel = async (element, label = 'My Label') => {
|
|
|
137
137
|
expect(element).toHaveAttribute('hide-label');
|
|
138
138
|
expect(await element.getProperty('ariaLabel')).toBeUndefined();
|
|
139
139
|
};
|
|
140
|
-
export const
|
|
140
|
+
export const getListOfStyleCompilationIssues = async (page, selector) => {
|
|
141
141
|
return page.$eval(selector, el => {
|
|
142
142
|
const adoptedStyleSheets = el.shadowRoot.adoptedStyleSheets;
|
|
143
143
|
const result = adoptedStyleSheets.reduce((accum, styleSheet) => {
|
package/dist/test/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../test/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAW,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAcnD,MAAM,CAAC,KAAK,UAAU,aAAa,CAC/B,IAAa,EACb,SAA4B,EAC5B,SAAiB,EACjB,SAAyB;IAEzB,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;QAChC,SAAS,GAAG,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;IAED,MAAM,IAAI,CAAC,QAAQ,CACf,CAAC,eAAyB,EAAE,eAAuB,EAAE,eAA8B,EAAE,EAAE;QACnF,MAAM,aAAa,GAAG;YAClB,MAAM,EAAE,WAAW;YACnB,KAAK,EAAE,WAAW;YAClB,OAAO,EAAE,aAAa;YACtB,KAAK,EAAE,aAAa;YACpB,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,UAAU;YACjB,SAAS,EAAE,UAAU;YACrB,cAAc,EAAE,cAAc;YA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C,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;wBACrC,aAAa,CAAC,cAAc,GAAG,OAAO,CAAC;wBACvC,aAAa,CAAC,IAAI,GAAG,IAAI,CAAC;wBAE1B,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC;oBAC9C,CAAC,CAAC,CAAC;oBAEH,OAAO,WAAW,CAAC;YAC3B,CAAC;QACL,CAAC;;YAAM,OAAO,KAAK,CAAC;IACxB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,yDAAyD,KAAK,EAAE,CAAC,CAAC;IACpF,CAAC;AACL,CAAC,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,UAAmB,EAAE,EAAE;IACjD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,MAAM,YAAY,GAAG,IAAI,QAAQ,CAAC,QAAQ,UAAU,QAAQ,EAAE;QAC1D,MAAM,EAAE,GAAG;QACX,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,IAAI,OAAO,EAAE;KACzB,CAAC,CAAC;IACH,GAAG,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;IACpC,OAAO,GAAG,CAAC;AACf,CAAC,CAAC","sourcesContent":["import { newE2EPage, E2EPage } from '@stencil/core/testing';\nimport { IDict } from '../src/util';\nimport { E2EElement, NewE2EPageOptions } from '@stencil/core/testing/puppeteer/puppeteer-declarations';\nimport { removeTimezoneOffset } from '../src/components/q2-calendar/q2-calendar-helpers';\nimport { AxePuppeteer } from '@axe-core/puppeteer';\n\ninterface PasteInit extends EventInit {\n pastedValue: string;\n}\n\ntype EventInitType =\n | EventInit\n | KeyboardEventInit\n | MouseEventInit\n | FocusEventInit\n | CustomEventInit\n | PasteInit\n | ClipboardEventInit;\nexport async function dispatchEvent(\n page: E2EPage,\n selectors: string | string[],\n eventType: string,\n eventInit?: EventInitType\n) {\n if (typeof selectors === 'string') {\n selectors = [selectors];\n }\n\n await page.evaluate(\n (passedSelectors: string[], passedEventType: string, passedEventInit: EventInitType) => {\n const eventTypeDict = {\n change: CustomEvent,\n input: CustomEvent,\n keydown: KeyboardEvent,\n keyup: KeyboardEvent,\n focus: FocusEvent,\n blur: FocusEvent,\n click: MouseEvent,\n mousedown: MouseEvent,\n animationStart: AnimationEvent,\n animationEnd: AnimationEvent,\n slotchange: Event,\n load: Event,\n paste: ClipboardEvent,\n };\n\n let eventInit = passedEventInit;\n if (passedEventType === 'paste' && 'pastedValue' in passedEventInit) {\n const clipboardData = new DataTransfer();\n clipboardData.getData = () => (passedEventInit as PasteInit).pastedValue;\n eventInit = {\n bubbles: true,\n clipboardData,\n };\n }\n\n const EventTypeInit = eventTypeDict[passedEventType] || Event;\n const [first, ...rest] = passedSelectors;\n let itemElement = document.querySelector(first);\n const rootElement = itemElement;\n if (rest.length) {\n itemElement = rest.reduce((acc, selector) => acc.shadowRoot.querySelector(selector), itemElement);\n }\n\n itemElement?.dispatchEvent(new EventTypeInit(passedEventType, eventInit));\n\n if (passedEventType === 'paste' && 'pastedValue' in passedEventInit) {\n if (rootElement.getAttribute('type') !== 'currency') {\n (itemElement as HTMLInputElement).value =\n (itemElement as HTMLInputElement).value + passedEventInit.pastedValue;\n itemElement && itemElement.dispatchEvent(new InputEvent('input'));\n }\n }\n },\n selectors,\n eventType,\n eventInit\n );\n\n await page.waitForChanges();\n}\n\nexport async function setTestStrings(page: E2EPage, strings: IDict<string>) {\n await page.evaluate(function (strings) {\n this.TEST_STRINGS = strings;\n }, strings);\n}\n\nexport async function promiseMap<T>(arr: T[], fn: (...args: any[]) => any) {\n const promises = arr.map(fn);\n\n return Promise.all(promises);\n}\n\n/**\n * Waits for a specified amount of time.\n *\n * Please use this function sparingly, as it can slow down tests.\n */\nexport async function waitForTimeout(timeout: number) {\n return new Promise(resolve => setTimeout(resolve, timeout));\n}\n\nexport function offsetTimezone(date: string) {\n return removeTimezoneOffset(new Date(date)).toISOString();\n}\n\nexport async function setup(pageOptions?: NewE2EPageOptions) {\n const page = await newE2EPage(pageOptions);\n\n await page.evaluate(function () {\n this.TectonElements = this.TectonElements || {};\n this.TectonElements.loc = (key: string, subs?: string[] | IDict<string>) => {\n const string = (this.TEST_STRINGS && this.TEST_STRINGS[key]) || key;\n\n if (Array.isArray(subs)) {\n const regex = /({[0-9]})/g;\n return string.replace(regex, match => {\n return subs[parseInt(match[1])];\n });\n } else if (typeof subs === 'object') {\n return Object.entries(subs).reduce((accum, [key, value]) => accum.replace(`{${key}}`, value), string);\n }\n\n return string;\n };\n });\n\n await page.waitForChanges();\n\n return page;\n}\n\nexport function setWindowHeight(height: number) {\n Object.defineProperty(window, 'innerHeight', {\n writable: true,\n configurable: true,\n value: height,\n });\n\n window.dispatchEvent(new Event('resize'));\n\n expect(window.innerHeight).toBe(height);\n}\n\nexport function makeDomRect(customAttributes) {\n const defaults = {\n bottom: 0,\n height: 50,\n width: 50,\n left: 40,\n right: 0,\n top: 0,\n x: 0,\n y: 0,\n toJSON: () => ({}),\n };\n return { ...defaults, ...customAttributes };\n}\nexport const base64Image =\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=';\n\nexport async function getActiveElementTestId(page: E2EPage) {\n return page.$eval(\n 'body',\n () =>\n (document.activeElement.shadowRoot?.activeElement ?? document.activeElement).getAttribute('test-id') ?? null\n );\n}\n\nexport const getFocusedOptionValue = async (page: E2EPage) => {\n await page.waitForSelector('q2-option:focus');\n return page.$eval('body', () => document.activeElement.getAttribute('value'));\n};\n\nexport const getFocusedTagName = async (page: E2EPage) => {\n return page.$eval('body', () => document.activeElement?.tagName);\n};\n\nexport async function getFocusedAttribute(page: E2EPage, attribute: string) {\n return page.$eval(\n 'body',\n (_, attribute: string) => {\n const activeElement = document.activeElement.shadowRoot?.activeElement ?? document.activeElement;\n return activeElement?.getAttribute(attribute) ?? null;\n },\n attribute\n );\n}\n\nexport const testDeprecatedAriaLabel = async (element: E2EElement, label: string = 'My Label') => {\n expect(element).toEqualAttribute('label', label);\n const hasHideLabelProp = typeof (await element.getProperty('hideLabel')) !== 'undefined';\n if (hasHideLabelProp) expect(element).toHaveAttribute('hide-label');\n expect(await element.getProperty('ariaLabel')).toBeUndefined();\n};\n\nexport const checkStylesForCompilationIssues = async (page: E2EPage, selector: string) => {\n return page.$eval(selector, el => {\n interface ShadowRootShim extends ShadowRoot {\n adoptedStyleSheets: CSSStyleSheet[];\n }\n const adoptedStyleSheets = (el.shadowRoot as ShadowRootShim).adoptedStyleSheets;\n const result = adoptedStyleSheets.reduce((accum, styleSheet) => {\n Array.from(styleSheet.cssRules).forEach(rule => {\n const hasVarList = rule.cssText.includes('var-list(');\n const hasVarPrefixer = rule.cssText.includes('var-prefixer(');\n if (hasVarList || hasVarPrefixer) accum.push((rule as any).selectorText);\n });\n return accum;\n }, []);\n\n if (!!result.length) {\n // eslint-disable-next-line no-console\n console.log(`The following selectors have compilation issues: ${result.join(', ')}`);\n }\n\n return result;\n });\n};\n\nexport const getNestedElementProperty = async (page: E2EPage, selectors: string | string[], prop: string) => {\n if (typeof selectors === 'string') {\n selectors = [selectors];\n }\n return page.evaluate(\n (selectors: string[], prop: string) => {\n const [first, ...rest] = selectors;\n let element = document.querySelector(first);\n if (rest.length) {\n element = rest.reduce((acc, selector) => acc.shadowRoot.querySelector(selector), element);\n }\n return element[prop];\n },\n selectors,\n prop\n );\n};\n\nexport const getNestedElementAttribute = async (page: E2EPage, selectors: string | string[], attribute: string) => {\n if (typeof selectors === 'string') {\n selectors = [selectors];\n }\n return page.$eval(\n 'body',\n (element, selectors: string[], attribute: string) => {\n const [first, ...rest] = selectors;\n element = document.querySelector(first);\n element = rest.reduce((acc, selector) => acc.shadowRoot.querySelector(selector), element);\n return element.getAttribute(attribute);\n },\n selectors,\n attribute\n );\n};\n\nexport const getNestedElementStyle = async (page: E2EPage, selectors: string | string[], attribute: string) => {\n if (typeof selectors === 'string') {\n selectors = [selectors];\n }\n return page.$eval(\n 'body',\n (element, selectors: string[], attribute: string) => {\n const [first, ...rest] = selectors;\n element = document.querySelector(first);\n element = rest.reduce((acc, selector) => acc.shadowRoot.querySelector(selector), element);\n const elementStyle = window.getComputedStyle(element);\n return elementStyle[attribute];\n },\n selectors,\n attribute\n );\n};\n\nexport const getNestedAssignedElementLength = async (page: E2EPage, selectors: string | string[]) => {\n if (typeof selectors === 'string') {\n selectors = [selectors];\n }\n return page.$eval(\n 'body',\n (element: HTMLElement, selectors: string[]) => {\n const [first, ...rest] = selectors;\n element = document.querySelector(first);\n element = rest.reduce((acc, selector) => acc.shadowRoot.querySelector(selector), element);\n return (element as HTMLSlotElement)?.assignedElements?.().length ?? undefined;\n },\n selectors\n );\n};\n\ntype ViolationsObject = {\n help?: string;\n helpUrl?: string;\n rulesViolated?: { [key: string]: string };\n failureSummary?: string;\n html?: string;\n};\n\nexport const evaluateA11y = async (page: any, ...args: string[]) => {\n const disabledIDsForComponents = [\n 'document-title',\n 'html-has-lang',\n 'landmark-one-main',\n 'page-has-heading-one',\n 'region',\n ];\n const detailLevel = args.includes('verbose') ? 'verbose' : 'default';\n const testType = args.includes('webpage') ? 'webpage' : 'component';\n // until we want to test actual web pages, we omit specific rules for component testing\n const rules = testType === 'webpage' ? [] : disabledIDsForComponents;\n\n try {\n const analysisResults = await new AxePuppeteer(page).disableRules(rules).analyze();\n const violations = analysisResults.violations;\n const responseObj = {};\n\n if (violations.length) {\n switch (detailLevel) {\n case 'verbose':\n return violations;\n\n default:\n violations.forEach(violation => {\n const violationInfo: ViolationsObject = {};\n violationInfo.help = violation.help;\n violationInfo.helpUrl = violation.helpUrl;\n\n const rulesInfo = {};\n const rulesViolated = violation.nodes[0].any;\n if (rulesViolated.length) {\n rulesViolated.forEach(rule => {\n rulesInfo[rule.id] = rule.message;\n });\n\n violationInfo.rulesViolated = rulesInfo;\n }\n const summary = violation.nodes[0].failureSummary;\n const html = violation.nodes[0].html;\n violationInfo.failureSummary = summary;\n violationInfo.html = html;\n\n responseObj[violation.id] = violationInfo;\n });\n\n return responseObj;\n }\n } else return false;\n } catch (error) {\n console.error(`There was an error with AxePuppeteer analysis. ERROR: ${error}`);\n }\n};\n\n/**\n * This function mocks the fetch API to return a resolved promise with the given icon markup.\n * You can optionally provide a <symbol> element, but it is not required.\n *\n * This is meant to be used to prevent errors on Unit/Spec tests with <q2-icon> because we are unable to provide a valid\n * URL for the fetch call in that context.\n *\n * @note This function should be called before the component is rendered.\n * @note Be sure to call `jest.restoreAllMocks()` after the test to restore the original fetch function.\n */\nexport const mockIconFetch = (iconMarkup?: string) => {\n const spy = jest.spyOn(global, 'fetch');\n const mockResponse = new Response(`<svg>${iconMarkup}</svg>`, {\n status: 200,\n statusText: 'OK',\n headers: new Headers(),\n });\n spy.mockResolvedValue(mockResponse);\n return spy;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../test/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAW,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAcnD,MAAM,CAAC,KAAK,UAAU,aAAa,CAC/B,IAAa,EACb,SAA4B,EAC5B,SAAiB,EACjB,SAAyB;IAEzB,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;QAChC,SAAS,GAAG,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;IAED,MAAM,IAAI,CAAC,QAAQ,CACf,CAAC,eAAyB,EAAE,eAAuB,EAAE,eAA8B,EAAE,EAAE;QACnF,MAAM,aAAa,GAAG;YAClB,MAAM,EAAE,WAAW;YACnB,KAAK,EAAE,WAAW;YAClB,OAAO,EAAE,aAAa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a,GAAG,SAAS,CAAC;wBAC5C,CAAC;wBACD,MAAM,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC;wBAClD,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;wBACrC,aAAa,CAAC,cAAc,GAAG,OAAO,CAAC;wBACvC,aAAa,CAAC,IAAI,GAAG,IAAI,CAAC;wBAE1B,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC;oBAC9C,CAAC,CAAC,CAAC;oBAEH,OAAO,WAAW,CAAC;YAC3B,CAAC;QACL,CAAC;;YAAM,OAAO,KAAK,CAAC;IACxB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,yDAAyD,KAAK,EAAE,CAAC,CAAC;IACpF,CAAC;AACL,CAAC,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,UAAmB,EAAE,EAAE;IACjD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,MAAM,YAAY,GAAG,IAAI,QAAQ,CAAC,QAAQ,UAAU,QAAQ,EAAE;QAC1D,MAAM,EAAE,GAAG;QACX,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,IAAI,OAAO,EAAE;KACzB,CAAC,CAAC;IACH,GAAG,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;IACpC,OAAO,GAAG,CAAC;AACf,CAAC,CAAC","sourcesContent":["import { newE2EPage, E2EPage } from '@stencil/core/testing';\nimport { IDict } from '../src/util';\nimport { E2EElement, NewE2EPageOptions } from '@stencil/core/testing/puppeteer/puppeteer-declarations';\nimport { removeTimezoneOffset } from '../src/components/q2-calendar/q2-calendar-helpers';\nimport { AxePuppeteer } from '@axe-core/puppeteer';\n\ninterface PasteInit extends EventInit {\n pastedValue: string;\n}\n\ntype EventInitType =\n | EventInit\n | KeyboardEventInit\n | MouseEventInit\n | FocusEventInit\n | CustomEventInit\n | PasteInit\n | ClipboardEventInit;\nexport async function dispatchEvent(\n page: E2EPage,\n selectors: string | string[],\n eventType: string,\n eventInit?: EventInitType\n) {\n if (typeof selectors === 'string') {\n selectors = [selectors];\n }\n\n await page.evaluate(\n (passedSelectors: string[], passedEventType: string, passedEventInit: EventInitType) => {\n const eventTypeDict = {\n change: CustomEvent,\n input: CustomEvent,\n keydown: KeyboardEvent,\n keyup: KeyboardEvent,\n focus: FocusEvent,\n blur: FocusEvent,\n click: MouseEvent,\n mousedown: MouseEvent,\n animationStart: AnimationEvent,\n animationEnd: AnimationEvent,\n slotchange: Event,\n load: Event,\n paste: ClipboardEvent,\n };\n\n let eventInit = passedEventInit;\n if (passedEventType === 'paste' && 'pastedValue' in passedEventInit) {\n const clipboardData = new DataTransfer();\n clipboardData.getData = () => (passedEventInit as PasteInit).pastedValue;\n eventInit = {\n bubbles: true,\n clipboardData,\n };\n }\n\n const EventTypeInit = eventTypeDict[passedEventType] || Event;\n const [first, ...rest] = passedSelectors;\n let itemElement = document.querySelector(first);\n const rootElement = itemElement;\n if (rest.length) {\n itemElement = rest.reduce((acc, selector) => acc.shadowRoot.querySelector(selector), itemElement);\n }\n\n itemElement?.dispatchEvent(new EventTypeInit(passedEventType, eventInit));\n\n if (passedEventType === 'paste' && 'pastedValue' in passedEventInit) {\n if (rootElement.getAttribute('type') !== 'currency') {\n (itemElement as HTMLInputElement).value =\n (itemElement as HTMLInputElement).value + passedEventInit.pastedValue;\n itemElement && itemElement.dispatchEvent(new InputEvent('input'));\n }\n }\n },\n selectors,\n eventType,\n eventInit\n );\n\n await page.waitForChanges();\n}\n\nexport async function setTestStrings(page: E2EPage, strings: IDict<string>) {\n await page.evaluate(function (strings) {\n this.TEST_STRINGS = strings;\n }, strings);\n}\n\nexport async function promiseMap<T>(arr: T[], fn: (...args: any[]) => any) {\n const promises = arr.map(fn);\n\n return Promise.all(promises);\n}\n\n/**\n * Waits for a specified amount of time.\n *\n * Please use this function sparingly, as it can slow down tests.\n */\nexport async function waitForTimeout(timeout: number) {\n return new Promise(resolve => setTimeout(resolve, timeout));\n}\n\nexport function offsetTimezone(date: string) {\n return removeTimezoneOffset(new Date(date)).toISOString();\n}\n\nexport async function setup(pageOptions?: NewE2EPageOptions) {\n const page = await newE2EPage(pageOptions);\n\n await page.evaluate(function () {\n this.TectonElements = this.TectonElements || {};\n this.TectonElements.loc = (key: string, subs?: string[] | IDict<string>) => {\n const string = (this.TEST_STRINGS && this.TEST_STRINGS[key]) || key;\n\n if (Array.isArray(subs)) {\n const regex = /({[0-9]})/g;\n return string.replace(regex, match => {\n return subs[parseInt(match[1])];\n });\n } else if (typeof subs === 'object') {\n return Object.entries(subs).reduce((accum, [key, value]) => accum.replace(`{${key}}`, value), string);\n }\n\n return string;\n };\n });\n\n await page.waitForChanges();\n\n return page;\n}\n\nexport function setWindowHeight(height: number) {\n Object.defineProperty(window, 'innerHeight', {\n writable: true,\n configurable: true,\n value: height,\n });\n\n window.dispatchEvent(new Event('resize'));\n\n expect(window.innerHeight).toBe(height);\n}\n\nexport function makeDomRect(customAttributes) {\n const defaults = {\n bottom: 0,\n height: 50,\n width: 50,\n left: 40,\n right: 0,\n top: 0,\n x: 0,\n y: 0,\n toJSON: () => ({}),\n };\n return { ...defaults, ...customAttributes };\n}\nexport const base64Image =\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=';\n\nexport async function getActiveElementTestId(page: E2EPage) {\n return page.$eval(\n 'body',\n () =>\n (document.activeElement.shadowRoot?.activeElement ?? document.activeElement).getAttribute('test-id') ?? null\n );\n}\n\nexport const getFocusedOptionValue = async (page: E2EPage) => {\n await page.waitForSelector('q2-option:focus');\n return page.$eval('body', () => document.activeElement.getAttribute('value'));\n};\n\nexport const getFocusedTagName = async (page: E2EPage) => {\n return page.$eval('body', () => document.activeElement?.tagName);\n};\n\nexport async function getFocusedAttribute(page: E2EPage, attribute: string) {\n return page.$eval(\n 'body',\n (_, attribute: string) => {\n const activeElement = document.activeElement.shadowRoot?.activeElement ?? document.activeElement;\n return activeElement?.getAttribute(attribute) ?? null;\n },\n attribute\n );\n}\n\nexport const testDeprecatedAriaLabel = async (element: E2EElement, label: string = 'My Label') => {\n expect(element).toEqualAttribute('label', label);\n const hasHideLabelProp = typeof (await element.getProperty('hideLabel')) !== 'undefined';\n if (hasHideLabelProp) expect(element).toHaveAttribute('hide-label');\n expect(await element.getProperty('ariaLabel')).toBeUndefined();\n};\n\nexport const getListOfStyleCompilationIssues = async (page: E2EPage, selector: string) => {\n return page.$eval(selector, el => {\n interface ShadowRootShim extends ShadowRoot {\n adoptedStyleSheets: CSSStyleSheet[];\n }\n const adoptedStyleSheets = (el.shadowRoot as ShadowRootShim).adoptedStyleSheets;\n const result = adoptedStyleSheets.reduce((accum, styleSheet) => {\n Array.from(styleSheet.cssRules).forEach(rule => {\n const hasVarList = rule.cssText.includes('var-list(');\n const hasVarPrefixer = rule.cssText.includes('var-prefixer(');\n if (hasVarList || hasVarPrefixer) accum.push((rule as any).selectorText);\n });\n return accum;\n }, []);\n\n if (!!result.length) {\n // eslint-disable-next-line no-console\n console.log(`The following selectors have compilation issues: ${result.join(', ')}`);\n }\n\n return result;\n });\n};\n\nexport const getNestedElementProperty = async (page: E2EPage, selectors: string | string[], prop: string) => {\n if (typeof selectors === 'string') {\n selectors = [selectors];\n }\n return page.evaluate(\n (selectors: string[], prop: string) => {\n const [first, ...rest] = selectors;\n let element = document.querySelector(first);\n if (rest.length) {\n element = rest.reduce((acc, selector) => acc.shadowRoot.querySelector(selector), element);\n }\n return element[prop];\n },\n selectors,\n prop\n );\n};\n\nexport const getNestedElementAttribute = async (page: E2EPage, selectors: string | string[], attribute: string) => {\n if (typeof selectors === 'string') {\n selectors = [selectors];\n }\n return page.$eval(\n 'body',\n (element, selectors: string[], attribute: string) => {\n const [first, ...rest] = selectors;\n element = document.querySelector(first);\n element = rest.reduce((acc, selector) => acc.shadowRoot.querySelector(selector), element);\n return element.getAttribute(attribute);\n },\n selectors,\n attribute\n );\n};\n\nexport const getNestedElementStyle = async (page: E2EPage, selectors: string | string[], attribute: string) => {\n if (typeof selectors === 'string') {\n selectors = [selectors];\n }\n return page.$eval(\n 'body',\n (element, selectors: string[], attribute: string) => {\n const [first, ...rest] = selectors;\n element = document.querySelector(first);\n element = rest.reduce((acc, selector) => acc.shadowRoot.querySelector(selector), element);\n const elementStyle = window.getComputedStyle(element);\n return elementStyle[attribute];\n },\n selectors,\n attribute\n );\n};\n\nexport const getNestedAssignedElementLength = async (page: E2EPage, selectors: string | string[]) => {\n if (typeof selectors === 'string') {\n selectors = [selectors];\n }\n return page.$eval(\n 'body',\n (element: HTMLElement, selectors: string[]) => {\n const [first, ...rest] = selectors;\n element = document.querySelector(first);\n element = rest.reduce((acc, selector) => acc.shadowRoot.querySelector(selector), element);\n return (element as HTMLSlotElement)?.assignedElements?.().length ?? undefined;\n },\n selectors\n );\n};\n\ntype ViolationsObject = {\n help?: string;\n helpUrl?: string;\n rulesViolated?: { [key: string]: string };\n failureSummary?: string;\n html?: string;\n};\n\nexport const evaluateA11y = async (page: any, ...args: string[]) => {\n const disabledIDsForComponents = [\n 'document-title',\n 'html-has-lang',\n 'landmark-one-main',\n 'page-has-heading-one',\n 'region',\n ];\n const detailLevel = args.includes('verbose') ? 'verbose' : 'default';\n const testType = args.includes('webpage') ? 'webpage' : 'component';\n // until we want to test actual web pages, we omit specific rules for component testing\n const rules = testType === 'webpage' ? [] : disabledIDsForComponents;\n\n try {\n const analysisResults = await new AxePuppeteer(page).disableRules(rules).analyze();\n const violations = analysisResults.violations;\n const responseObj = {};\n\n if (violations.length) {\n switch (detailLevel) {\n case 'verbose':\n return violations;\n\n default:\n violations.forEach(violation => {\n const violationInfo: ViolationsObject = {};\n violationInfo.help = violation.help;\n violationInfo.helpUrl = violation.helpUrl;\n\n const rulesInfo = {};\n const rulesViolated = violation.nodes[0].any;\n if (rulesViolated.length) {\n rulesViolated.forEach(rule => {\n rulesInfo[rule.id] = rule.message;\n });\n\n violationInfo.rulesViolated = rulesInfo;\n }\n const summary = violation.nodes[0].failureSummary;\n const html = violation.nodes[0].html;\n violationInfo.failureSummary = summary;\n violationInfo.html = html;\n\n responseObj[violation.id] = violationInfo;\n });\n\n return responseObj;\n }\n } else return false;\n } catch (error) {\n console.error(`There was an error with AxePuppeteer analysis. ERROR: ${error}`);\n }\n};\n\n/**\n * This function mocks the fetch API to return a resolved promise with the given icon markup.\n * You can optionally provide a <symbol> element, but it is not required.\n *\n * This is meant to be used to prevent errors on Unit/Spec tests with <q2-icon> because we are unable to provide a valid\n * URL for the fetch call in that context.\n *\n * @note This function should be called before the component is rendered.\n * @note Be sure to call `jest.restoreAllMocks()` after the test to restore the original fetch function.\n */\nexport const mockIconFetch = (iconMarkup?: string) => {\n const spy = jest.spyOn(global, 'fetch');\n const mockResponse = new Response(`<svg>${iconMarkup}</svg>`, {\n status: 200,\n statusText: 'OK',\n headers: new Headers(),\n });\n spy.mockResolvedValue(mockResponse);\n return spy;\n};\n"]}
|
|
@@ -13,6 +13,7 @@ export declare class Q2Popover implements ComponentInterface {
|
|
|
13
13
|
block: boolean;
|
|
14
14
|
/** The element that controls the popover's behavior. */
|
|
15
15
|
controlElement: HTMLElement;
|
|
16
|
+
mode: 'legacy';
|
|
16
17
|
/** @deprecated */
|
|
17
18
|
minHeight: number;
|
|
18
19
|
hostElement: HTMLElement;
|
|
@@ -48,7 +49,8 @@ export declare class Q2Popover implements ComponentInterface {
|
|
|
48
49
|
viewPortOrientationChanged: () => void;
|
|
49
50
|
addViewportListeners(): void;
|
|
50
51
|
removeViewportListeners(): void;
|
|
51
|
-
|
|
52
|
+
setFixedCSSProperties: () => Promise<void>;
|
|
53
|
+
setAbsoluteCSSProperties: () => Promise<void>;
|
|
52
54
|
clearCSSProperties(): void;
|
|
53
55
|
setDirectionAndShow(direction: 'up' | 'down'): void;
|
|
54
56
|
determinePopDirection(): Promise<void>;
|
|
@@ -271,6 +271,11 @@ export namespace Components {
|
|
|
271
271
|
* @deprecated
|
|
272
272
|
*/
|
|
273
273
|
"popoverMinHeight": number;
|
|
274
|
+
/**
|
|
275
|
+
* Determines the display mode of the popover. Providing a value of `legacy` instructs the popover to use absolute positioning instead of fixed positioning.
|
|
276
|
+
* @info This is a temporary solution to work around styling issues related to using fixed positioning for the popover when nested inside of elements with transform properties. This will be removed once the popover API is available for use.
|
|
277
|
+
*/
|
|
278
|
+
"popoverMode": 'legacy';
|
|
274
279
|
/**
|
|
275
280
|
* The field's content is not editable, but the field remains focusable. Appends "(readonly)" to the field label. Supersedes `optional` if both are `true`.
|
|
276
281
|
*/
|
|
@@ -932,6 +937,11 @@ export namespace Components {
|
|
|
932
937
|
* @deprecated
|
|
933
938
|
*/
|
|
934
939
|
"popoverMinHeight": number;
|
|
940
|
+
/**
|
|
941
|
+
* Determines the display mode of the popover. Providing a value of `legacy` instructs the popover to use absolute positioning instead of fixed positioning.
|
|
942
|
+
* @info This is a temporary solution to work around styling issues related to using fixed positioning for the popover when nested inside of elements with transform properties. This will be removed once the popover API is available for use.
|
|
943
|
+
*/
|
|
944
|
+
"popoverMode": 'legacy';
|
|
935
945
|
/**
|
|
936
946
|
* Use with `context` to tell the outlet where it appears. It will be matched with the appropriately configured module for that context.
|
|
937
947
|
* @info Only applicable when using `<q2-dropdown>` for outlets.
|
|
@@ -1523,6 +1533,7 @@ export namespace Components {
|
|
|
1523
1533
|
* @deprecated
|
|
1524
1534
|
*/
|
|
1525
1535
|
"minHeight": number;
|
|
1536
|
+
"mode": 'legacy';
|
|
1526
1537
|
/**
|
|
1527
1538
|
* Controls whether the popover is open or closed.
|
|
1528
1539
|
*/
|
|
@@ -1768,6 +1779,11 @@ export namespace Components {
|
|
|
1768
1779
|
* @deprecated
|
|
1769
1780
|
*/
|
|
1770
1781
|
"popDirection": 'up' | 'down';
|
|
1782
|
+
/**
|
|
1783
|
+
* Determines the display mode of the popover. Providing a value of `legacy` instructs the popover to use absolute positioning instead of fixed positioning.
|
|
1784
|
+
* @info This is a temporary solution to work around styling issues related to using fixed positioning for the popover when nested inside of elements with transform properties. This will be removed once the popover API is available for use.
|
|
1785
|
+
*/
|
|
1786
|
+
"popoverMode": 'legacy';
|
|
1771
1787
|
/**
|
|
1772
1788
|
* Appends "(read only)" to the field label, and field becomes unusable, but remains focusable. Takes priority over `optional` if both are `true`.
|
|
1773
1789
|
*/
|
|
@@ -3201,6 +3217,11 @@ declare namespace LocalJSX {
|
|
|
3201
3217
|
* @deprecated
|
|
3202
3218
|
*/
|
|
3203
3219
|
"popoverMinHeight"?: number;
|
|
3220
|
+
/**
|
|
3221
|
+
* Determines the display mode of the popover. Providing a value of `legacy` instructs the popover to use absolute positioning instead of fixed positioning.
|
|
3222
|
+
* @info This is a temporary solution to work around styling issues related to using fixed positioning for the popover when nested inside of elements with transform properties. This will be removed once the popover API is available for use.
|
|
3223
|
+
*/
|
|
3224
|
+
"popoverMode"?: 'legacy';
|
|
3204
3225
|
/**
|
|
3205
3226
|
* The field's content is not editable, but the field remains focusable. Appends "(readonly)" to the field label. Supersedes `optional` if both are `true`.
|
|
3206
3227
|
*/
|
|
@@ -3886,6 +3907,11 @@ declare namespace LocalJSX {
|
|
|
3886
3907
|
* @deprecated
|
|
3887
3908
|
*/
|
|
3888
3909
|
"popoverMinHeight"?: number;
|
|
3910
|
+
/**
|
|
3911
|
+
* Determines the display mode of the popover. Providing a value of `legacy` instructs the popover to use absolute positioning instead of fixed positioning.
|
|
3912
|
+
* @info This is a temporary solution to work around styling issues related to using fixed positioning for the popover when nested inside of elements with transform properties. This will be removed once the popover API is available for use.
|
|
3913
|
+
*/
|
|
3914
|
+
"popoverMode"?: 'legacy';
|
|
3889
3915
|
/**
|
|
3890
3916
|
* Use with `context` to tell the outlet where it appears. It will be matched with the appropriately configured module for that context.
|
|
3891
3917
|
* @info Only applicable when using `<q2-dropdown>` for outlets.
|
|
@@ -4499,6 +4525,7 @@ declare namespace LocalJSX {
|
|
|
4499
4525
|
* @deprecated
|
|
4500
4526
|
*/
|
|
4501
4527
|
"minHeight"?: number;
|
|
4528
|
+
"mode"?: 'legacy';
|
|
4502
4529
|
/**
|
|
4503
4530
|
* Emitted when the popover is opened or closed.
|
|
4504
4531
|
*/
|
|
@@ -4750,6 +4777,11 @@ declare namespace LocalJSX {
|
|
|
4750
4777
|
* @deprecated
|
|
4751
4778
|
*/
|
|
4752
4779
|
"popDirection"?: 'up' | 'down';
|
|
4780
|
+
/**
|
|
4781
|
+
* Determines the display mode of the popover. Providing a value of `legacy` instructs the popover to use absolute positioning instead of fixed positioning.
|
|
4782
|
+
* @info This is a temporary solution to work around styling issues related to using fixed positioning for the popover when nested inside of elements with transform properties. This will be removed once the popover API is available for use.
|
|
4783
|
+
*/
|
|
4784
|
+
"popoverMode"?: 'legacy';
|
|
4753
4785
|
/**
|
|
4754
4786
|
* Appends "(read only)" to the field label, and field becomes unusable, but remains focusable. Takes priority over `optional` if both are `true`.
|
|
4755
4787
|
*/
|
|
@@ -25,7 +25,7 @@ export declare const getFocusedOptionValue: (page: E2EPage) => Promise<string>;
|
|
|
25
25
|
export declare const getFocusedTagName: (page: E2EPage) => Promise<string>;
|
|
26
26
|
export declare function getFocusedAttribute(page: E2EPage, attribute: string): Promise<string>;
|
|
27
27
|
export declare const testDeprecatedAriaLabel: (element: E2EElement, label?: string) => Promise<void>;
|
|
28
|
-
export declare const
|
|
28
|
+
export declare const getListOfStyleCompilationIssues: (page: E2EPage, selector: string) => Promise<any[]>;
|
|
29
29
|
export declare const getNestedElementProperty: (page: E2EPage, selectors: string | string[], prop: string) => Promise<any>;
|
|
30
30
|
export declare const getNestedElementAttribute: (page: E2EPage, selectors: string | string[], attribute: string) => Promise<string>;
|
|
31
31
|
export declare const getNestedElementStyle: (page: E2EPage, selectors: string | string[], attribute: string) => Promise<any>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "q2-tecton-elements",
|
|
3
|
-
"version": "1.45.
|
|
3
|
+
"version": "1.45.3",
|
|
4
4
|
"description": "Q2 Tecton Custom Elements",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Q2 Tecton Team",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@stencil/core": "4.18.0",
|
|
36
|
-
"q2-tecton-common": "1.45.
|
|
36
|
+
"q2-tecton-common": "1.45.3",
|
|
37
37
|
"swiper": "8.4.4"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"typescript": "5.4.5",
|
|
55
55
|
"typescript-eslint": "^7.11.0"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "321dc27427d9dd6fe9a699591671c729027c2bd1"
|
|
58
58
|
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,c as o,g as i,h as r}from"./p-a5f18e27.js";import{t as e,w as s}from"./p-42302f6f.js";const n=class{constructor(i){t(this,i);this.change=o(this,"change",7);this.mouseEventList=["mousedown","dragstart","touchstart"];this.isCurrentlyFocused=false;this.mouseHandler=t=>{const o=this.shadowContains(this.findActiveElement());const i=this.shadowContains(this.shadowEventTarget(t))||this.originatesInSlots(t.target);if(!i&&(this.isCurrentlyFocused||o)){this.isCurrentlyFocused=false;this.change.emit();return}this.isCurrentlyFocused=i||o};this.windowBlurHandler=()=>{const t=this.findActiveElement();if(t===document.body&&this.isCurrentlyFocused||t!==document.body&&(t===null||t===void 0?void 0:t.tagName)==="IFRAME"){this.isCurrentlyFocused=false;this.change.emit();return}}}componentWillLoad(){}connectedCallback(){this.mouseEventList.forEach((t=>{document.addEventListener(t,this.mouseHandler)}));window.addEventListener("blur",this.windowBlurHandler)}disconnectedCallback(){this.mouseEventList.forEach((t=>{document.removeEventListener(t,this.mouseHandler)}));window.removeEventListener("blur",this.windowBlurHandler)}findActiveElement(){let t=document.activeElement;while(true){if(!t||!t.shadowRoot){return t}t=t.shadowRoot.activeElement}}shadowEventTarget(t){return t.composedPath()[0]||t.target}shadowContains(t){while(true){if(t===this.hostElement){return true}if(!t){return false}t=t.parentNode||t.host}}originatesInSlots(t){const o=this.hostElement.querySelectorAll("slot");for(const i of Array.from(o)){const o=i&&i.assignedNodes&&i.assignedNodes()||this.hostElement.childNodes;for(const i of Array.from(o)){if(i.contains(t)){return true}}}return false}get hostElement(){return i(this)}};const a="*{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}.container{display:none}.show{display:block;position:fixed;z-index:var(--tct-popover-z-index, 50);margin:0;padding:0;overflow:auto;background:var(--tct-popover-background, var(--app-white, #ffffff));color:var(--tct-popover-font-color, var(--t-text, #4d4d4d));min-width:var(--tct-popover-min-width, 135px);margin-block:var(--tct-popover-margin-block, 0);box-shadow:var(--tct-popover-box-shadow, var(--app-shadow-1, 0 2px 4px rgba(0, 0, 0, 0.3)));border-width:var(--tct-popover-border-width, 0);border-style:solid;border-color:var(--tct-popover-border-color, transparent);border-radius:var(--tct-popover-border-radius, 0);max-height:var(--comp-pop-max-height);left:var(--comp-pop-left);opacity:var(--comp-pop-opacity, 0);--comp-scrollbar-size:var(--tct-scrollbar-size, var(--t-scrollbar-size, var(--app-scale-1x, 5px)));--comp-scrollbar-border-radius:var(--tct-scrollbar-border-radius, var(--t-scrollbar-border-radius, var(--app-border-radius-1, 3px)));--comp-scrollbar-color:var(--tct-scrollbar-color, var(--t-scrollbar-color, var(--t-a11y-gray-color, #747474)));scrollbar-width:thin;scrollbar-color:var(--comp-scrollbar-color) transparent}:host([block]) .show{right:unset;width:var(--comp-pop-width);min-width:var(--tct-popover-min-width, unset)}:host([align=left]) .show{left:var(--comp-pop-left);right:unset}:host([align=right]) .show{right:var(--comp-pop-right);left:unset}.show.down{top:var(--tct-popover-top, var(--comp-pop-top));bottom:unset}.show.up{top:unset;bottom:var(--comp-pop-bottom)}.show::-webkit-scrollbar{width:var(--comp-scrollbar-size);height:var(--comp-scrollbar-size);margin:5px}.show::-webkit-scrollbar-thumb{background:var(--comp-scrollbar-color);border-radius:var(--comp-scrollbar-border-radius)}.show::-webkit-scrollbar-track{background:transparent;border-radius:var(--comp-scrollbar-border-radius)}click-elsewhere{position:relative;display:block}";const c=a;const h=class{constructor(i){t(this,i);this.popoverStateChanged=o(this,"popoverStateChanged",7);this.displayBuffer=10;this.orientationChanged=false;this.handleMinHeight=()=>{if(this.minHeight){e(this,"minHeight","prop")}};this.viewPortChanged=()=>{if(!this.open)return;this.determinePopDirection()};this.viewPortOrientationChanged=()=>{this.orientationChanged=true;this.viewPortChanged()};this.setCSSProperties=async()=>{var t,o;const{controlElement:i,containerElement:r,currentDirection:e}=this;const{top:n,bottom:a,left:c,right:h}=(o=(t=i===null||i===void 0?void 0:i.getBoundingClientRect)===null||t===void 0?void 0:t.call(i))!==null&&o!==void 0?o:{top:0,bottom:0,left:0,right:0};const p=c;const d=window.visualViewport.width-h;if(this.block)r.style.setProperty("--comp-pop-width",`${i.offsetWidth||0}px`);r.style.setProperty("--comp-pop-left",`${p}px`);r.style.setProperty("--comp-pop-right",`${d}px`);if(e==="up"){r.style.setProperty("--comp-pop-bottom",`${window.visualViewport.height-n}px`)}if(e==="down"){r.style.setProperty("--comp-pop-top",`${a}px`)}await s();r.style.setProperty("--comp-pop-opacity","1")};this.direction=undefined;this.align=undefined;this.open=undefined;this.block=undefined;this.controlElement=undefined;this.minHeight=undefined;this.currentDirection=undefined;this.show=false}componentDidLoad(){this.handleMinHeight();if(this.open)this.determinePopDirection()}disconnectedCallback(){this.removeViewportListeners()}async toggle(){this.open=!this.open}async scrollContainerTo(t){this.containerElement.scrollTo(t)}async openChanged(t){this.popoverStateChanged.emit({open:t});if(t){this.addViewportListeners();this.determinePopDirection()}else{this.removeViewportListeners();this.currentDirection=undefined;this.show=false;await s();this.clearCSSProperties()}}minHeightProvided(){this.handleMinHeight()}popoverStateHandler(t){const{detail:{open:o}}=t;if(o===this.open)return;this.open=o;t.stopPropagation()}get actualDirection(){const{direction:t}=this;switch(t){case"up":case"down":return t;default:return undefined}}get isModule(){var t,o;const i=window!==window.top;const r=Object.keys((o=(t=window.Tecton)===null||t===void 0?void 0:t.platformDimensions)!==null&&o!==void 0?o:{}).length>0;return i&&r}addViewportListeners(){var t;window.addEventListener("resize",this.viewPortOrientationChanged);window.addEventListener("scroll",this.viewPortChanged,{passive:true,capture:true});(t=screen===null||screen===void 0?void 0:screen.orientation)===null||t===void 0?void 0:t.addEventListener("change",this.viewPortOrientationChanged);window.addEventListener("orientationchange",this.viewPortOrientationChanged)}removeViewportListeners(){var t;window.removeEventListener("resize",this.viewPortOrientationChanged);window.removeEventListener("scroll",this.viewPortChanged);(t=screen===null||screen===void 0?void 0:screen.orientation)===null||t===void 0?void 0:t.removeEventListener("orientationchange",this.viewPortOrientationChanged);window.removeEventListener("orientationchange",this.viewPortOrientationChanged)}clearCSSProperties(){this.containerElement.style.removeProperty("--comp-pop-max-height");this.containerElement.style.removeProperty("--comp-pop-top");this.containerElement.style.removeProperty("--comp-pop-bottom");this.containerElement.style.removeProperty("--comp-pop-left");this.containerElement.style.removeProperty("--comp-pop-right");this.containerElement.style.removeProperty("--comp-pop-width");this.containerElement.style.removeProperty("--comp-pop-opacity")}setDirectionAndShow(t){const o=this.open;if(!o)return;this.currentDirection=t;this.show=true;this.setCSSProperties()}async determinePopDirection(){var t,o,i;const{containerElement:r,controlElement:e,actualDirection:n,displayBuffer:a}=this;if(r)r.style.maxHeight=null;await s();const{isModule:c}=this;const{top:h,bottom:p}=(o=(t=e===null||e===void 0?void 0:e.getBoundingClientRect)===null||t===void 0?void 0:t.call(e))!==null&&o!==void 0?o:{top:0,bottom:0};let d;let l;let u;if(c){const t=(i=window.Tecton)===null||i===void 0?void 0:i.platformDimensions;const o=window.visualViewport.height-p;const r=t.innerHeight-(t.outletOffset+p);const e=o<r;d=t.innerHeight;l=(t.outletOffset>0?h:h+t.outletOffset)-a;u=e?o-a:r-a}else{d=window.visualViewport.height;l=h-a;u=d-p-a}const v=l>u?"up":"down";const f=!r.style.getPropertyValue("--comp-pop-max-height")||this.orientationChanged;this.orientationChanged=false;const w=this.currentDirection||n||v;switch(w){case"up":if(f){r.style.setProperty("--comp-pop-max-height",`${l}px`)}this.setDirectionAndShow("up");break;case"down":if(f){r.style.setProperty("--comp-pop-max-height",`${u}px`)}this.setDirectionAndShow("down");break}}render(){const t=["container",this.currentDirection];if(this.show)t.push("show");return r("div",{key:"a1cf82457aa65ddc1d51ae0fb62a9985d0956852",ref:t=>this.containerElement=t,class:t.join(" "),"test-id":"outerContainer"},r("div",{key:"d85db61212993787938f9fc404f9473d26246e15",ref:t=>this.contentElement=t,class:"content"},r("slot",{key:"ca70454f8fcf378c0535b799810e5e69e7f67c5d"})))}get hostElement(){return i(this)}static get watchers(){return{open:["openChanged"],minHeight:["minHeightProvided"]}}};h.style=c;export{n as click_elsewhere,h as q2_popover};
|
|
2
|
-
//# sourceMappingURL=p-4a332c2a.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ClickElsewhere","constructor","hostRef","this","mouseEventList","isCurrentlyFocused","mouseHandler","event","shadowContains","findActiveElement","aboutToBeFocused","shadowEventTarget","originatesInSlots","target","change","emit","windowBlurHandler","activeElement","document","body","tagName","componentWillLoad","connectedCallback","forEach","eventName","addEventListener","window","disconnectedCallback","removeEventListener","workingElement","shadowRoot","composedPath","child","hostElement","parentNode","host","slots","querySelectorAll","currentSlot","Array","from","lightNodes","assignedNodes","childNodes","currentNode","contains","q2PopoverCss","Q2PopoverStyle0","Q2Popover","displayBuffer","orientationChanged","handleMinHeight","minHeight","handleDeprecationWarning","viewPortChanged","open","determinePopDirection","viewPortOrientationChanged","setCSSProperties","async","controlElement","containerElement","currentDirection","top","controlTop","bottom","controlBottom","left","controlLeft","right","controlRight","_b","_a","getBoundingClientRect","call","popoverLeft","popoverRight","visualViewport","width","block","style","setProperty","offsetWidth","height","waitForNextPaint","undefined","componentDidLoad","removeViewportListeners","toggle","scrollContainerTo","options","scrollTo","openChanged","popoverStateChanged","addViewportListeners","show","clearCSSProperties","minHeightProvided","popoverStateHandler","detail","stopPropagation","actualDirection","direction","isModule","isIframe","hasPlatformDimensions","Object","keys","Tecton","platformDimensions","length","passive","capture","screen","orientation","removeProperty","setDirectionAndShow","isOpen","maxHeight","windowHeight","maxSpaceAbove","maxSpaceBelow","_c","distanceToIframeBottom","viewableSpaceBelow","innerHeight","outletOffset","isIframeShorterThanWindow","directionWithMostSpace","shouldUpdateMaxHeight","getPropertyValue","currentOrDetermineDirection","render","containerClasses","push","h","key","ref","el","class","join","contentElement"],"sources":["src/components/click-elsewhere/click-elsewhere.tsx","src/components/q2-popover/q2-popover.scss?tag=q2-popover&encapsulation=shadow","src/components/q2-popover/q2-popover.tsx"],"sourcesContent":["import { Component, ComponentInterface, Element, Event, EventEmitter } from '@stencil/core';\n\n@Component({\n tag: 'click-elsewhere',\n shadow: false,\n})\nexport class ClickElsewhere implements ComponentInterface {\n /**\n * Listens for mouse and window events that happen outside this click-elsewhere element so we can close popovers when users click outside them\n */\n mouseEventList: string[] = ['mousedown', 'dragstart', 'touchstart'];\n isCurrentlyFocused: boolean = false;\n\n @Element() hostElement: HTMLElement;\n\n /**\n * Emitted when the user clicks outside the element\n */\n @Event() change: EventEmitter;\n\n /* TODO: Stencil/Rollup is having issues compiling without this here. Will try to remove in future Stencil upgrade. */\n /* tslint:disable:no-empty */\n componentWillLoad() {}\n /* tslint:enable:no-empty */\n\n connectedCallback() {\n this.mouseEventList.forEach((eventName: string) => {\n document.addEventListener(eventName, this.mouseHandler);\n });\n window.addEventListener('blur', this.windowBlurHandler);\n }\n\n disconnectedCallback() {\n this.mouseEventList.forEach((eventName: string) => {\n document.removeEventListener(eventName, this.mouseHandler);\n });\n window.removeEventListener('blur', this.windowBlurHandler);\n }\n\n findActiveElement(): Element | null {\n let workingElement = document.activeElement!;\n while (true) {\n if (!workingElement || !workingElement.shadowRoot) {\n return workingElement;\n }\n workingElement = workingElement.shadowRoot.activeElement;\n }\n }\n\n shadowEventTarget(event: any): Element {\n return event.composedPath()[0] || event.target;\n }\n\n shadowContains(child: any): boolean {\n /**\n * shadow-dom enabled version of Node.contains()\n */\n\n while (true) {\n if (child === this.hostElement) {\n return true;\n }\n if (!child) {\n return false;\n }\n\n child = child.parentNode || child.host;\n }\n }\n\n originatesInSlots(target: Element): boolean {\n const slots = this.hostElement.querySelectorAll('slot');\n\n for (const currentSlot of Array.from(slots)) {\n const lightNodes =\n (currentSlot && currentSlot.assignedNodes && currentSlot.assignedNodes()) ||\n this.hostElement.childNodes;\n\n for (const currentNode of Array.from(lightNodes)) {\n if (currentNode.contains(target)) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n mouseHandler = (event: Event): void => {\n const isCurrentlyFocused = this.shadowContains(this.findActiveElement());\n const aboutToBeFocused =\n this.shadowContains(this.shadowEventTarget(event)) || this.originatesInSlots(event.target as Element);\n\n if (!aboutToBeFocused && (this.isCurrentlyFocused || isCurrentlyFocused)) {\n this.isCurrentlyFocused = false;\n this.change.emit();\n return;\n }\n this.isCurrentlyFocused = aboutToBeFocused || isCurrentlyFocused;\n };\n\n windowBlurHandler = (): void => {\n const activeElement = this.findActiveElement();\n if (\n (activeElement === document.body && this.isCurrentlyFocused) || // clicked parent frame\n (activeElement !== document.body && activeElement?.tagName === 'IFRAME') // clicked child frame\n ) {\n this.isCurrentlyFocused = false;\n this.change.emit();\n return;\n }\n };\n}\n","@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n.container {\n display: none;\n}\n\n.show {\n display: block;\n position: fixed;\n z-index: var-list(--tct-popover-z-index, 50);\n margin: 0;\n padding: 0;\n overflow: auto;\n background: var-list(--tct-popover-background, --app-white, #ffffff);\n color: var-list(--tct-popover-font-color, --t-text, #4d4d4d);\n min-width: var-list(--tct-popover-min-width, 135px);\n margin-block: var-list(--tct-popover-margin-block, 0);\n box-shadow: var-list(--tct-popover-box-shadow, --app-shadow-1, unquote('0 2px 4px rgba(0, 0, 0, 0.3)'));\n border-width: var-list(--tct-popover-border-width, 0);\n border-style: solid;\n border-color: var-list(--tct-popover-border-color, transparent);\n border-radius: var-list(--tct-popover-border-radius, 0);\n // the following --comp variables are set via JS\n max-height: var(--comp-pop-max-height);\n left: var(--comp-pop-left);\n opacity: var(--comp-pop-opacity, 0);\n\n :host([block]) & {\n right: unset;\n width: var(--comp-pop-width);\n min-width: var-list(--tct-popover-min-width, unset);\n }\n\n :host([align='left']) & {\n left: var(--comp-pop-left);\n right: unset;\n }\n\n :host([align='right']) & {\n right: var(--comp-pop-right);\n left: unset;\n }\n\n &.down {\n top: var-list(--tct-popover-top, --comp-pop-top);\n bottom: unset;\n }\n\n &.up {\n top: unset;\n bottom: var(--comp-pop-bottom);\n }\n\n @include tiny-scrollbar();\n}\n\nclick-elsewhere {\n position: relative;\n display: block;\n}\n","import {\n Component,\n Prop,\n h,\n ComponentInterface,\n Element,\n Watch,\n Method,\n Listen,\n EventEmitter,\n Event,\n State,\n} from '@stencil/core';\nimport { handleDeprecationWarning, waitForNextPaint } from '../../utils';\n\n@Component({ tag: 'q2-popover', shadow: true, styleUrl: 'q2-popover.scss' })\nexport class Q2Popover implements ComponentInterface {\n /**\n * Force the direction of the popover when it opens.\n * If no value is passed, the component will auto-detect the direction based on available space.\n */\n @Prop({ reflect: true }) direction: 'up' | 'down';\n\n /** Aligns the popover to the left or right side of the control element. */\n @Prop({ reflect: true }) align: 'left' | 'right';\n\n /** Controls whether the popover is open or closed. */\n @Prop({ reflect: true, mutable: true }) open: boolean;\n\n /** Indicates the popover will match the width of its parent element. */\n @Prop({ reflect: true }) block: boolean;\n\n /** The element that controls the popover's behavior. */\n @Prop() controlElement: HTMLElement;\n\n /** @deprecated */\n @Prop() minHeight: number;\n\n @Element() hostElement: HTMLElement;\n\n /**\n * Emitted when the popover is opened or closed.\n */\n @Event() popoverStateChanged: EventEmitter<{ open: boolean }>;\n\n @State() currentDirection: 'down' | 'up' = undefined;\n // remove `show` when Popover API is supported in iOS\n @State() show: boolean = false;\n\n containerElement: HTMLDivElement;\n contentElement: HTMLDivElement;\n\n /**\n * The number of pixels to leave between the popover and the edge of the viewport\n */\n displayBuffer = 10;\n\n /** remove when Popover API is supported in iOS */\n orientationChanged: boolean = false;\n\n /// Lifecycle hooks ///\n componentDidLoad() {\n this.handleMinHeight();\n if (this.open) this.determinePopDirection();\n }\n\n disconnectedCallback() {\n this.removeViewportListeners();\n }\n\n /// Methods ///\n @Method()\n async toggle() {\n this.open = !this.open;\n }\n\n @Method()\n async scrollContainerTo(options: ScrollToOptions) {\n this.containerElement.scrollTo(options);\n }\n\n /// Watchers ///\n @Watch('open')\n async openChanged(open: boolean) {\n this.popoverStateChanged.emit({ open });\n\n if (open) {\n this.addViewportListeners();\n this.determinePopDirection();\n } else {\n this.removeViewportListeners();\n this.currentDirection = undefined;\n this.show = false;\n await waitForNextPaint();\n this.clearCSSProperties();\n }\n }\n\n @Watch('minHeight')\n minHeightProvided() {\n this.handleMinHeight();\n }\n\n /// Listeners ///\n @Listen('popoverState')\n popoverStateHandler(event: CustomEvent<{ open: boolean }>) {\n const {\n detail: { open },\n } = event;\n if (open === this.open) return;\n\n this.open = open;\n event.stopPropagation();\n }\n\n /// Getters ///\n get actualDirection(): 'up' | 'down' | undefined {\n const { direction } = this;\n switch (direction) {\n case 'up':\n case 'down':\n return direction;\n default:\n return undefined;\n }\n }\n\n get isModule() {\n const isIframe = window !== window.top;\n const hasPlatformDimensions = Object.keys(window.Tecton?.platformDimensions ?? {}).length > 0;\n return isIframe && hasPlatformDimensions;\n }\n\n /// Helpers ///\n handleMinHeight = () => {\n if (this.minHeight) {\n handleDeprecationWarning(this, 'minHeight', 'prop');\n }\n };\n\n viewPortChanged = () => {\n if (!this.open) return;\n this.determinePopDirection();\n };\n\n viewPortOrientationChanged = () => {\n this.orientationChanged = true;\n this.viewPortChanged();\n };\n\n addViewportListeners() {\n window.addEventListener('resize', this.viewPortOrientationChanged);\n // #region remove when Popover API is supported in iOS\n window.addEventListener('scroll', this.viewPortChanged, { passive: true, capture: true });\n screen?.orientation?.addEventListener('change', this.viewPortOrientationChanged);\n window.addEventListener('orientationchange', this.viewPortOrientationChanged);\n // #endregion\n }\n\n removeViewportListeners() {\n window.removeEventListener('resize', this.viewPortOrientationChanged);\n // #region remove when Popover API is supported in iOS\n window.removeEventListener('scroll', this.viewPortChanged);\n screen?.orientation?.removeEventListener('orientationchange', this.viewPortOrientationChanged);\n window.removeEventListener('orientationchange', this.viewPortOrientationChanged);\n // #endregion\n }\n\n setCSSProperties = async () => {\n const { controlElement, containerElement, currentDirection } = this;\n const {\n top: controlTop,\n bottom: controlBottom,\n left: controlLeft,\n right: controlRight,\n } = controlElement?.getBoundingClientRect?.() ?? {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n };\n const popoverLeft: number = controlLeft;\n const popoverRight: number = window.visualViewport.width - controlRight;\n\n if (this.block) containerElement.style.setProperty('--comp-pop-width', `${controlElement.offsetWidth || 0}px`);\n containerElement.style.setProperty('--comp-pop-left', `${popoverLeft}px`);\n containerElement.style.setProperty('--comp-pop-right', `${popoverRight}px`);\n\n if (currentDirection === 'up') {\n containerElement.style.setProperty('--comp-pop-bottom', `${window.visualViewport.height - controlTop}px`);\n }\n if (currentDirection === 'down') {\n containerElement.style.setProperty('--comp-pop-top', `${controlBottom}px`);\n }\n\n // Wait for one paint to prevent layout thrashing\n await waitForNextPaint();\n containerElement.style.setProperty('--comp-pop-opacity', '1');\n };\n\n clearCSSProperties() {\n this.containerElement.style.removeProperty('--comp-pop-max-height');\n this.containerElement.style.removeProperty('--comp-pop-top');\n this.containerElement.style.removeProperty('--comp-pop-bottom');\n this.containerElement.style.removeProperty('--comp-pop-left');\n this.containerElement.style.removeProperty('--comp-pop-right');\n this.containerElement.style.removeProperty('--comp-pop-width');\n this.containerElement.style.removeProperty('--comp-pop-opacity');\n }\n\n setDirectionAndShow(direction: 'up' | 'down') {\n // Due to some runtime inconsistency across devices/browsers we need to add one more check here because the\n // popover can be closed between the time the popover is opened and the time the direction is determined\n const isOpen = this.open;\n if (!isOpen) return;\n\n this.currentDirection = direction;\n this.show = true;\n this.setCSSProperties();\n }\n\n async determinePopDirection() {\n const { containerElement, controlElement, actualDirection, displayBuffer } = this;\n if (containerElement) containerElement.style.maxHeight = null;\n\n await waitForNextPaint();\n\n const { isModule } = this;\n const { top: controlTop, bottom: controlBottom } = controlElement?.getBoundingClientRect?.() ?? {\n top: 0,\n bottom: 0,\n };\n\n let windowHeight: number;\n let maxSpaceAbove: number;\n let maxSpaceBelow: number;\n\n if (isModule) {\n const platformDimensions = window.Tecton?.platformDimensions;\n const distanceToIframeBottom = window.visualViewport.height - controlBottom;\n const viewableSpaceBelow =\n platformDimensions.innerHeight - (platformDimensions.outletOffset + controlBottom);\n const isIframeShorterThanWindow = distanceToIframeBottom < viewableSpaceBelow;\n windowHeight = platformDimensions.innerHeight;\n // If the top of the module is below the top of the window we just use the controlTop\n // Otherwise we need to add the outletOffset to the controlTop\n maxSpaceAbove =\n (platformDimensions.outletOffset > 0 ? controlTop : controlTop + platformDimensions.outletOffset) -\n displayBuffer;\n maxSpaceBelow = isIframeShorterThanWindow\n ? distanceToIframeBottom - displayBuffer\n : viewableSpaceBelow - displayBuffer;\n } else {\n windowHeight = window.visualViewport.height;\n maxSpaceAbove = controlTop - displayBuffer;\n maxSpaceBelow = windowHeight - controlBottom - displayBuffer;\n }\n\n const directionWithMostSpace: 'up' | 'down' = maxSpaceAbove > maxSpaceBelow ? 'up' : 'down';\n\n // We do not want to update the max height once the popover is open unless the page orientation shifts (resize or mobile use cases)\n const shouldUpdateMaxHeight =\n !containerElement.style.getPropertyValue('--comp-pop-max-height') || this.orientationChanged;\n // we do not want to constantly update the max-height after an orientation change, so we switch this back to false\n this.orientationChanged = false;\n const currentOrDetermineDirection = this.currentDirection || actualDirection || directionWithMostSpace;\n\n switch (currentOrDetermineDirection) {\n case 'up':\n if (shouldUpdateMaxHeight) {\n containerElement.style.setProperty('--comp-pop-max-height', `${maxSpaceAbove}px`);\n }\n this.setDirectionAndShow('up');\n break;\n case 'down':\n if (shouldUpdateMaxHeight) {\n containerElement.style.setProperty('--comp-pop-max-height', `${maxSpaceBelow}px`);\n }\n this.setDirectionAndShow('down');\n break;\n default:\n break;\n }\n }\n\n /// DOM ///\n render() {\n const containerClasses = ['container', this.currentDirection];\n if (this.show) containerClasses.push('show');\n\n return (\n <div\n ref={el => (this.containerElement = el)}\n class={containerClasses.join(' ')}\n test-id=\"outerContainer\"\n >\n <div\n ref={el => (this.contentElement = el)}\n class=\"content\"\n >\n <slot />\n </div>\n </div>\n );\n }\n}\n"],"mappings":"0GAMaA,EAAc,MAJ3B,WAAAC,CAAAC,G,yCAQIC,KAAAC,eAA2B,CAAC,YAAa,YAAa,cACtDD,KAAAE,mBAA8B,MA6E9BF,KAAAG,aAAgBC,IACZ,MAAMF,EAAqBF,KAAKK,eAAeL,KAAKM,qBACpD,MAAMC,EACFP,KAAKK,eAAeL,KAAKQ,kBAAkBJ,KAAWJ,KAAKS,kBAAkBL,EAAMM,QAEvF,IAAKH,IAAqBP,KAAKE,oBAAsBA,GAAqB,CACtEF,KAAKE,mBAAqB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
-
import{r as t,c as e,h as r,F as a,g as i}from"./p-a5f18e27.js";import{o as c,c as n,i as s,l as o}from"./p-42302f6f.js";const l='*{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:grid;grid-template-columns:var(--tct-stepper-vertical-list-width, var(--tct-advanced-stepper-list-width, var(--t-advanced-stepper-list-width, 180px))) 1fr;gap:var(--tct-stepper-vertical-layout-gap, var(--tct-advanced-stepper-layout-gap, var(--t-advanced-stepper-layout-gap, 120px)))}.step-label,.step-child-label{color:var(--comp-btn-label-color);font-size:var(--comp-btn-label-font-size);font-weight:var(--comp-label-font-weight, 400);min-height:1.5em}.step-label{text-overflow:ellipsis;overflow:hidden;display:-webkit-box;-webkit-line-clamp:var(--tct-stepper-label-line-count, var(--tct-advanced-stepper-label-line-count, var(--t-advanced-stepper-label-line-count, 2)));-webkit-box-orient:vertical}[aria-selected=true] .step-label{font-weight:var(--tct-stepper-vertical-btn-active-font-weight, var(--tct-advanced-stepper-btn-active-font-weight, var(--t-advanced-stepper-btn-active-font-weight, 600)))}[aria-describedby] .step-label{text-overflow:ellipsis;overflow:hidden;display:-webkit-box;-webkit-line-clamp:var(--tct-stepper-label-line-count, var(--tct-advanced-stepper-label-line-count, var(--t-advanced-stepper-label-line-count, 1)));-webkit-box-orient:vertical}.step-child-label{grid-area:content;color:var(--comp-btn-label-color)}.step-description{color:var(--tct-stepper-vertical-description-color, var(--tct-advanced-stepper-description-color, var(--t-advanced-stepper-description-color, var(--t-textA, rgba(77, 77, 77, 0.77)))));font-size:var(--tct-stepper-vertical-description-font-size, var(--tct-advanced-stepper-description-font-size, var(--t-advanced-stepper-description-font-size, var(--app-font-size-small, 12px))));padding-bottom:0.2em}ul{--comp-top-btn-icon-size:var(--tct-stepper-vertical-btn-icon-size, var(--tct-advanced-stepper-btn-icon-size, var(--t-advanced-stepper-btn-icon-size, 24px)));--comp-btn-icon-size:var(--comp-top-btn-icon-size);--comp-btn-content-gap:var(--tct-stepper-vertical-btn-gap, var(--tct-advanced-stepper-btn-gap, var(--t-advanced-stepper-btn-gap, var(--app-scale-3x, 15px))));--comp-btn-label-font-size:var-list(\n --tct-stepper-vertical-btn-label-font-size,\n var-prefixer(advanced-stepper-btn-label-font-size),\n 16px\n );--comp-btn-label-color:var(--tct-stepper-vertical-label-color, var(--tct-advanced-stepper-label-color, var(--t-advanced-stepper-label-color, var(--t-text, #4d4d4d))));--comp-tween:var(--tct-stepper-vertical-tween, var(--tct-advanced-stepper-tween, var(--t-advanced-stepper-tween, var(--app-tween-1, 0.2s ease))));--comp-bullet-bg:var(--tct-stepper-vertical-bullet-active-background, var(--tct-advanced-stepper-bullet-active-bg, var(--t-advanced-stepper-bullet-active-bg, var(--t-primary, #0079c1))));list-style:none;margin:0;padding:0}ul ul{--comp-btn-icon-size:var(--tct-stepper-vertical-child-btn-icon-size, var(--tct-advanced-stepper-child-btn-icon-size, var(--t-advanced-stepper-child-btn-icon-size, 12px)));--comp-btn-content-gap:var(--tct-stepper-vertical-btn-gap, var(--tct-advanced-stepper-btn-gap, var(--t-advanced-stepper-btn-gap, var(--app-scale-2x, 10px))));--comp-btn-label-font-size:var-list(\n --tct-stepper-vertical-child-btn-label-font-size,\n var-prefixer(advanced-stepper-child-btn-label-font-size),\n --app-font-size-small,\n 12px\n )}ul ul[aria-hidden=true]{display:none}.step-btn,.step-child-btn{display:grid;grid-template-columns:var(--comp-btn-icon-size) 1fr;gap:var(--comp-btn-content-gap);text-align:var(--tct-stepper-vertical-btn-text-align, var(--tct-advanced-stepper-btn-text-align, var(--t-advanced-stepper-btn-text-align, start)));grid-template-areas:"icon content";align-items:center;width:100%;position:relative;background:transparent;border:0;cursor:pointer;padding:0;transition-property:box-shadow;outline:none}.step-btn[aria-disabled],.step-child-btn[aria-disabled]{cursor:default;--comp-label-font-weight:300;--comp-btn-label-color:var(--tct-stepper-vertical-btn-locked-color, var(--tct-advanced-stepper-btn-locked-color, var(--t-advanced-stepper-btn-locked-color, var(--t-textA, rgba(77, 77, 77, 0.77)))))}.step-btn[aria-selected=true],.step-child-btn[aria-selected=true]{--comp-label-font-weight:600}.step-btn{min-height:var(--tct-stepper-vertical-btn-height, var(--tct-advanced-stepper-btn-height, var(--t-advanced-stepper-btn-height, 40px)));font-size:var(--tct-stepper-vertical-btn-font-size, var(--tct-advanced-stepper-btn-font-size, var(--t-advanced-stepper-btn-font-size, 16px)));--comp-active-color:var(--comp-bullet-bg)}.step-btn.status-complete{--comp-active-color:var(--const-stoplight-success, #0e8a00)}.step-btn.status-error{--comp-active-color:var(--const-stoplight-alert, #d20a0a)}.step-btn.status-locked{cursor:not-allowed}.step-child-btn{--comp-active-color:var(--comp-bullet-bg);min-height:var(--tct-stepper-vertical-child-btn-height, var(--tct-advanced-stepper-child-btn-height, var(--t-advanced-stepper-child-btn-height, 30px)));padding-left:var(--tct-stepper-vertical-child-btn-left-padding, var(--tct-advanced-stepper-child-btn-left-padding, var(--t-advanced-stepper-child-btn-left-padding, var(--app-scale-2x, 10px))));font-size:var(--tct-stepper-vertical-child-btn-font-size, var(--tct-advanced-stepper-child-btn-font-size, var(--t-advanced-stepper-child-btn-font-size, 12px)));border-left-width:var(--tct-stepper-vertical-child-btn-left-border-width, var(--tct-advanced-stepper-child-btn-left-border-width, var(--t-advanced-stepper-child-btn-left-border-width, 3px)));border-left-style:var(--tct-stepper-vertical-child-btn-left-border-style, var(--tct-advanced-stepper-child-btn-left-border-style, var(--t-advanced-stepper-child-btn-left-border-style, solid)));border-left-color:transparent}.step-child-btn[aria-selected=true]{--comp-btn-label-color:var(--comp-active-color);border-left-color:var(--comp-active-color)}.step-child-btn.status-error{--comp-btn-label-color:var(--const-stoplight-alert, #d20a0a);--comp-active-color:var(--const-stoplight-alert, #d20a0a)}.step-child-btn.status-locked{cursor:not-allowed}.step-content{grid-area:content}.step-icon,.step-bubble,.step-child-icon{grid-area:icon;width:var(--comp-btn-icon-size);height:var(--comp-btn-icon-size);line-height:0}.step-icon q2-icon,.step-bubble q2-icon,.step-child-icon q2-icon{width:var(--comp-btn-icon-size);height:var(--comp-btn-icon-size);--tct-icon-fill:var(--comp-active-color)}.step-icon,.step-bubble{background:var(--comp-active-color);color:var(--t-base, #ffffff);border-radius:50%}.status-complete .step-icon,.status-error .step-icon,.status-complete .step-bubble,.status-error .step-bubble{background:var(--comp-active-color)}.step-icon q2-icon,.step-bubble q2-icon{--tct-icon-fill:var(--comp-active-color)}.step-icon q2-icon:before,.step-bubble q2-icon:before{content:"";display:block;background:var(--t-base, #ffffff);position:absolute;width:80%;height:80%;left:11%;top:11%;border-radius:50%}.status-locked .step-icon,.status-locked .step-bubble{background:var(--t-gray-12, #d9d9d9);color:var(--t-text, #4d4d4d)}[aria-selected=true] .step-icon,[aria-selected=true] .step-bubble{box-shadow:0 0 0 2px var(--t-base, #ffffff), 0 0 0 4px var(--comp-active-color)}.step-bubble{display:flex;justify-content:center;align-items:center;line-height:0}.step-child-icon q2-icon{--tct-icon-stroke-primary:var(--comp-active-color);--tct-icon-stroke-secondary:var(--comp-active-color)}[aria-selected=true] .step-child-icon q2-icon{fill:var(--comp-active-color);--tct-icon-stroke-secondary:var(--t-base, #ffffff)}.spacer{height:0;border-left-width:var(--tct-stepper-vertical-child-border-width, var(--tct-advanced-stepaer-child-border-width, var(--t-advanced-stepaer-child-border-width, 1px)));border-left-style:var(--tct-stepper-vertical-child-border-style, var(--tct-advanced-stepper-child-border-style, var(--t-advanced-stepper-child-border-style, solid)));border-left-color:var(--tct-stepper-vertical-child-border-color, var(--tct-advanced-stepper-child-border-color, var(--t-advanced-stepper-child-border-color, var(--t-gray-12, #d9d9d9))));overflow:hidden;margin-left:calc(var(--comp-top-btn-icon-size) / 2);transition:height var(--comp-tween)}.spacer.has-sibling{height:var(--tct-stepper-vertical-spacer-height, var(--tct-advanced-stepper-spacer-height, var(--t-advanced-stepper-spacer-height, var(--app-scale-6x, 30px))))}.spacer ul{opacity:0;transition:opacity var(--comp-tween)}.spacer.is-opening ul,.spacer.is-open ul{display:block;opacity:1 !important}.spacer.is-open{overflow:visible}';const p=l;const d=class{constructor(r){t(this,r);this.change=e(this,"change",7);this.scheduledAfterRender=[];this.determinePaneChanges=t=>{t.forEach((t=>{var e,r;if(t.type!=="childList")return;if(!t.addedNodes.length&&!t.removedNodes.length)return;if(((e=t.addedNodes[0])===null||e===void 0?void 0:e.nodeType)!==Node.ELEMENT_NODE&&((r=t.removedNodes[0])===null||r===void 0?void 0:r.nodeType)!==Node.ELEMENT_NODE)return;this.buildPaneList()}))};this.buildPaneList=()=>{const{allRootPanes:t}=this;if(!t.length)return;this.structuredPanes=Array.from(t).reduce(((t,e)=>{var r,a;const i=Array.from((a=(r=e.querySelector("[slot=children]"))===null||r===void 0?void 0:r.children)!==null&&a!==void 0?a:[]).filter((({tagName:t})=>t==="Q2-STEPPER-PANE")).map(this.extractDetails);t.push(Object.assign(Object.assign({},this.extractDetails(e)),{children:i}));return t}),[])};this.onStepClick=(t,e)=>{t.stopPropagation();const{currentStepId:r}=this;if(e===r)return;const a=this.allPanes.find((t=>t.id===e));this.change.emit({selectedStep:a,selectedStepId:e,currentStepId:r})};this.onStepKeyDown=(t,e)=>{const{key:r}=t;let a;switch(r){case"ArrowUp":case"ArrowLeft":t.preventDefault();a=this.getStepId(e,"prev");break;case"ArrowDown":case"ArrowRight":t.preventDefault();a=this.getStepId(e,"next");break;case"Home":t.preventDefault();a=this.getStepId(e,"first");break;case"End":t.preventDefault();a=this.getStepId(e,"last");break}if(!a)return;this.focusStepBtn(a,true)};this.currentStepId=undefined;this.structuredPanes=[]}componentWillLoad(){this.setDefaultPane();this.buildPaneList();const t=new MutationObserver(this.determinePaneChanges);const e={childList:true};t.observe(this.hostElement,e);this.allRootPanes.forEach((r=>{const a=r.querySelector("[slot=children]");if(a)t.observe(a,e)}));this.mutationObserver=t}componentDidLoad(){c(this.hostElement);setTimeout((()=>this.showStep(this.currentStepId)),0)}componentWillUpdate(){this.expandedStepChildrenList=null}componentDidRender(){this.scheduledAfterRender.forEach((t=>t()));this.scheduledAfterRender=[];this.openCurrentStepChildren()}disconnectedCallback(){this.mutationObserver.disconnect();this.mutationObserver=null}get allRootPanes(){return Array.from(this.hostElement.querySelectorAll(":scope > q2-stepper-pane"))}get allPanes(){return Array.from(this.hostElement.querySelectorAll("q2-stepper-pane"))}setDefaultPane(){if(this.currentStepId)return;const t=this.hostElement.querySelector("q2-stepper-pane");if(!t)return;if(!t.id)t.id=`step-${n()}`;this.currentStepId=t.id}getStepId(t,e){const r=Array.from(this.hostElement.shadowRoot.querySelectorAll('ul:not([aria-hidden="true"]) > li > button:not([aria-disabled="true"])'));const a=r.findIndex((e=>e.getAttribute("aria-controls")===t));let i;switch(e){case"prev":i=Math.max(a-1,0);break;case"next":i=Math.min(a+1,r.length-1);break;case"first":i=0;break;case"last":i=r.length-1;break}return r[i].getAttribute("aria-controls")}showStep(t){this.scheduledAfterRender.push(this.resizeIframe);this.showStepPane(t);this.focusStepBtn(t)}extractDetails(t){const{label:e,description:r,status:a}=t;if(!t.id)t.id=`step-${n()}`;return{id:t.id,label:e,description:r,status:a}}resizeIframe(){var t,e;return(e=(t=window===null||window===void 0?void 0:window.TectonElements)===null||t===void 0?void 0:t.resizeIframe)===null||e===void 0?void 0:e.call(t)}openCurrentStepChildren(){const{expandedStepChildrenList:t}=this;const e=this.hostElement.shadowRoot.querySelectorAll(".spacer");e.forEach((e=>{if(t&&e.contains(t)){e.style.height=`${t.clientHeight}px`;if(e.classList.contains("is-open"))return;e.classList.add("is-opening");e.addEventListener("transitionend",(()=>{e.classList.remove("is-opening");e.classList.add("is-open");this.resizeIframe()}),{once:true})}else{e.removeAttribute("style");e.classList.remove("is-open","is-opening")}}))}showStepPane(t){this.allPanes.forEach((e=>{if(e.isActive||e.id===t){e.isActive=t===e.id}}))}focusStepBtn(t,e){const r=this.hostElement.shadowRoot.querySelector(`button[aria-controls="${t}"]`);const a=document.activeElement===this.hostElement;if(!r)return;if(a||e){r.focus()}}defaultChangeHandler(t){const{hostElement:e}=this;if(t.target===e&&!e.getAttribute("onchange")&&!!t.detail){this.currentStepId=t.detail.selectedStepId}}delegateFocus(t){if(!s(t,this.hostElement))return;this.focusStepBtn(this.currentStepId,true)}statusChangeHandler(){this.buildPaneList()}currentStepChanged(t){this.showStep(t)}renderStepBtn(t,e){const{currentStepId:a,structuredPanes:i}=this;const c=e===i.length-1;const{id:n,label:s,description:l,status:p}=t;const d=e+1;const b=n===a;const v=s&&`label-${n}`;const h=p==="locked";const u=s&&o(s);const f=s&&l&&`description-${n}`;const g=!s&&o("tecton.element.advancedStepper.number",[`${d}`,`${i.length}`]);let m;if(p==="complete")m="success-filled";else if(p==="error")m="warning-filled";const w=["step-btn"];if(p)w.push(`status-${p}`);const x=t.children.map((t=>t.id));const y=b||x.includes(a);return r("li",{role:"presentation"},r("button",{class:w.join(" "),type:"button","aria-labelledby":v,"aria-describedBy":f,"aria-label":g,"aria-selected":`${b}`,"aria-expanded":!!t.children.length?`${y}`:null,"aria-controls":n,"aria-disabled":h?"true":null,role:"tab",tabIndex:b?0:-1,onKeyDown:t=>!h&&this.onStepKeyDown(t,n),onClick:t=>!h&&this.onStepClick(t,n)},m?r("div",{class:"step-icon"},r("q2-icon",{type:m})):r("div",{class:"step-bubble"},d),s&&r("div",null,r("div",{class:"step-label",id:v},u),l&&r("div",{class:"step-description",id:f},o(l)))),this.renderSpacer(t,u,y,c))}renderSpacer(t,e,a,i){const c=i&&!!t.children.length||!i;const n=["spacer"];if(!i)n.push("has-sibling");return c&&r("div",{class:n.join(" ")},!!t.children.length&&r("ul",{ref:t=>a&&(this.expandedStepChildrenList=t),"aria-hidden":`${!a}`},t.children.map(((t,r,a)=>this.renderChildStepBtn(t,r,a.length,e)))))}renderChildStepBtn(t,e,a,i){const{currentStepId:c}=this;const{id:n,label:s,status:l}=t;const p=e+1;const d=s&&`label-${n}`;const b=n===c;const v=l==="locked";const h=!s&&o("tecton.element.advancedStepper.childNumber",[`${p}`,`${a}`,i]);let u;if(l==="error")u="warning-filled";const f=["step-child-btn"];if(l)f.push(`status-${l}`);return r("li",{role:"presentation"},r("button",{class:f.join(" "),type:"button","aria-labelledby":d,"aria-label":h,"aria-selected":`${b}`,"aria-controls":n,"aria-disabled":v?"true":null,role:"tab",tabIndex:b?0:-1,onKeyDown:t=>!v&&this.onStepKeyDown(t,n),onClick:t=>!v&&this.onStepClick(t,n)},u&&r("div",{class:"step-child-icon"},r("q2-icon",{type:u})),s&&r("div",{class:"step-child-label",id:d},o(s))))}render(){return r(a,{key:"111b2d1fde499840f0bfc3bc7e15aa031ca48352"},r("ul",{key:"cb06c9ee1ce93cc160b07819062cf4f4010be2a7",role:"tablist"},this.structuredPanes.map(((t,e)=>this.renderStepBtn(t,e)))),r("div",{key:"993998a6cc4bedb69065f318c59c729896671947"},r("slot",{key:"12527fc15e44c8ca0c189e797a9e3694143789d0"})))}get hostElement(){return i(this)}static get watchers(){return{currentStepId:["currentStepChanged"]}}};d.style=p;export{d as q2_stepper_vertical};
|
|
2
|
-
//# sourceMappingURL=p-4f7e2c8a.entry.js.map
|