@ukic/web-components 2.9.0 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/ic-button_3.cjs.entry.js +27 -6
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js +14 -22
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-page-header.cjs.entry.js +4 -1
- package/dist/cjs/ic-page-header.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-popover-menu.cjs.entry.js +2 -0
- package/dist/cjs/ic-popover-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-select.cjs.entry.js +1 -1
- package/dist/cjs/ic-select.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-text-field.cjs.entry.js +2 -2
- package/dist/cjs/ic-text-field.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-top-navigation.cjs.entry.js +1 -1
- package/dist/cjs/ic-top-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/assets/arrow-dropdown.svg +3 -0
- package/dist/collection/components/ic-button/ic-button.css +20 -1
- package/dist/collection/components/ic-button/ic-button.js +53 -2
- package/dist/collection/components/ic-button/ic-button.js.map +1 -1
- package/dist/collection/components/ic-menu/ic-menu.js +14 -22
- package/dist/collection/components/ic-menu/ic-menu.js.map +1 -1
- package/dist/collection/components/ic-menu/test/basic/ic-menu.spec.js +60 -2
- package/dist/collection/components/ic-menu/test/basic/ic-menu.spec.js.map +1 -1
- package/dist/collection/components/ic-page-header/ic-page-header.js +4 -1
- package/dist/collection/components/ic-page-header/ic-page-header.js.map +1 -1
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.js +19 -0
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.js.map +1 -1
- package/dist/collection/components/ic-select/ic-select.css +1 -0
- package/dist/collection/components/ic-text-field/ic-text-field.js +2 -2
- package/dist/collection/components/ic-text-field/ic-text-field.js.map +1 -1
- package/dist/collection/components/ic-tooltip/ic-tooltip.js +27 -3
- package/dist/collection/components/ic-tooltip/ic-tooltip.js.map +1 -1
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.js +1 -1
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.js.map +1 -1
- package/dist/components/ic-button2.js +23 -3
- package/dist/components/ic-button2.js.map +1 -1
- package/dist/components/ic-menu2.js +14 -22
- package/dist/components/ic-menu2.js.map +1 -1
- package/dist/components/ic-page-header.js +4 -1
- package/dist/components/ic-page-header.js.map +1 -1
- package/dist/components/ic-popover-menu.js +3 -1
- package/dist/components/ic-popover-menu.js.map +1 -1
- package/dist/components/ic-select.js +1 -1
- package/dist/components/ic-select.js.map +1 -1
- package/dist/components/ic-text-field2.js +2 -2
- package/dist/components/ic-text-field2.js.map +1 -1
- package/dist/components/ic-tooltip2.js +7 -3
- package/dist/components/ic-tooltip2.js.map +1 -1
- package/dist/components/ic-top-navigation.js +1 -1
- package/dist/components/ic-top-navigation.js.map +1 -1
- package/dist/core/core.css +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-ee97e2a5.entry.js → p-1338c9df.entry.js} +2 -2
- package/dist/core/p-1338c9df.entry.js.map +1 -0
- package/dist/core/{p-7f887c1e.entry.js → p-4d413a72.entry.js} +2 -2
- package/dist/core/p-4d413a72.entry.js.map +1 -0
- package/dist/core/{p-e278242f.entry.js → p-592c783e.entry.js} +2 -2
- package/dist/core/p-592c783e.entry.js.map +1 -0
- package/dist/core/p-776232f4.entry.js +2 -0
- package/dist/core/p-776232f4.entry.js.map +1 -0
- package/dist/core/p-85026377.entry.js +2 -0
- package/dist/core/p-85026377.entry.js.map +1 -0
- package/dist/core/{p-02159742.entry.js → p-a46130c8.entry.js} +2 -2
- package/dist/core/{p-02159742.entry.js.map → p-a46130c8.entry.js.map} +1 -1
- package/dist/core/p-a908e7a9.entry.js +2 -0
- package/dist/core/p-a908e7a9.entry.js.map +1 -0
- package/dist/esm/core.js +1 -1
- package/dist/esm/ic-button_3.entry.js +27 -6
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-input-component-container_3.entry.js +14 -22
- package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
- package/dist/esm/ic-page-header.entry.js +4 -1
- package/dist/esm/ic-page-header.entry.js.map +1 -1
- package/dist/esm/ic-popover-menu.entry.js +3 -1
- package/dist/esm/ic-popover-menu.entry.js.map +1 -1
- package/dist/esm/ic-select.entry.js +1 -1
- package/dist/esm/ic-select.entry.js.map +1 -1
- package/dist/esm/ic-text-field.entry.js +2 -2
- package/dist/esm/ic-text-field.entry.js.map +1 -1
- package/dist/esm/ic-top-navigation.entry.js +1 -1
- package/dist/esm/ic-top-navigation.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ic-button/ic-button.d.ts +8 -0
- package/dist/types/components/ic-menu/ic-menu.d.ts +1 -0
- package/dist/types/components/ic-popover-menu/ic-popover-menu.d.ts +5 -0
- package/dist/types/components/ic-tooltip/ic-tooltip.d.ts +4 -0
- package/dist/types/components.d.ts +36 -0
- package/dist/types/interface.d.ts +3 -0
- package/hydrate/index.js +55 -34
- package/package.json +6 -4
- package/vscode-data.json +8 -0
- package/dist/collection/components/ic-accordion/test/basic/ic-accordion.e2e.js +0 -57
- package/dist/collection/components/ic-accordion/test/basic/ic-accordion.e2e.js.map +0 -1
- package/dist/collection/components/ic-accordion-group/test/a11y/ic-accordion-group.test.a11y.js +0 -31
- package/dist/collection/components/ic-accordion-group/test/a11y/ic-accordion-group.test.a11y.js.map +0 -1
- package/dist/collection/components/ic-accordion-group/test/basic/ic-accordion-group.e2e.js +0 -117
- package/dist/collection/components/ic-accordion-group/test/basic/ic-accordion-group.e2e.js.map +0 -1
- package/dist/collection/components/ic-alert/test/a11y/ic-alert.test.a11y.js +0 -11
- package/dist/collection/components/ic-alert/test/a11y/ic-alert.test.a11y.js.map +0 -1
- package/dist/collection/components/ic-alert/test/basic/ic-alert.e2e.js +0 -16
- package/dist/collection/components/ic-alert/test/basic/ic-alert.e2e.js.map +0 -1
- package/dist/collection/components/ic-back-to-top/test/a11y/ic-back-to-top.test.a11y.js +0 -28
- package/dist/collection/components/ic-back-to-top/test/a11y/ic-back-to-top.test.a11y.js.map +0 -1
- package/dist/collection/components/ic-back-to-top/test/basic/ic-back-to-top.e2e.js +0 -68
- package/dist/collection/components/ic-back-to-top/test/basic/ic-back-to-top.e2e.js.map +0 -1
- package/dist/collection/components/ic-badge/test/a11y/ic-badge.test.a11y.js +0 -16
- package/dist/collection/components/ic-badge/test/a11y/ic-badge.test.a11y.js.map +0 -1
- package/dist/collection/components/ic-classification-banner/test/a11y/ic-classification-banner.test.a11y.js +0 -11
- package/dist/collection/components/ic-classification-banner/test/a11y/ic-classification-banner.test.a11y.js.map +0 -1
- package/dist/collection/components/ic-toast/test/a11y/ic-toast.test.a11y.js +0 -16
- package/dist/collection/components/ic-toast/test/a11y/ic-toast.test.a11y.js.map +0 -1
- package/dist/collection/components/ic-toast/test/basic/ic-toast.e2e.js +0 -82
- package/dist/collection/components/ic-toast/test/basic/ic-toast.e2e.js.map +0 -1
- package/dist/core/p-6bc431b2.entry.js +0 -2
- package/dist/core/p-6bc431b2.entry.js.map +0 -1
- package/dist/core/p-7f887c1e.entry.js.map +0 -1
- package/dist/core/p-988991d3.entry.js +0 -2
- package/dist/core/p-988991d3.entry.js.map +0 -1
- package/dist/core/p-ca178add.entry.js +0 -2
- package/dist/core/p-ca178add.entry.js.map +0 -1
- package/dist/core/p-e278242f.entry.js.map +0 -1
- package/dist/core/p-ee97e2a5.entry.js.map +0 -1
- package/dist/types/components/ic-accordion-group/test/a11y/ic-accordion-group.test.a11y.d.ts +0 -1
- package/dist/types/components/ic-alert/test/a11y/ic-alert.test.a11y.d.ts +0 -1
- package/dist/types/components/ic-back-to-top/test/a11y/ic-back-to-top.test.a11y.d.ts +0 -1
- package/dist/types/components/ic-badge/test/a11y/ic-badge.test.a11y.d.ts +0 -1
- package/dist/types/components/ic-classification-banner/test/a11y/ic-classification-banner.test.a11y.d.ts +0 -1
- package/dist/types/components/ic-toast/test/a11y/ic-toast.test.a11y.d.ts +0 -1
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { newE2EPage } from "@stencil/core/testing";
|
|
2
|
-
beforeAll(() => {
|
|
3
|
-
jest.spyOn(console, "warn").mockImplementation(jest.fn());
|
|
4
|
-
});
|
|
5
|
-
describe("ic-accordion-group", () => {
|
|
6
|
-
it("button text should change to 'See all' when expanded accordion clicked", async () => {
|
|
7
|
-
const page = await newE2EPage();
|
|
8
|
-
await page.setContent(`<ic-accordion-group>
|
|
9
|
-
<ic-accordion expanded heading="Accordion 1"></ic-accordion>
|
|
10
|
-
</ic-accordion-group>`);
|
|
11
|
-
const seeAllBtn = await page.find("ic-accordion-group >>> ic-button");
|
|
12
|
-
let text = await seeAllBtn.innerText;
|
|
13
|
-
expect(text).toBe("Hide all");
|
|
14
|
-
await seeAllBtn.click();
|
|
15
|
-
await page.waitForChanges();
|
|
16
|
-
text = await seeAllBtn.innerText;
|
|
17
|
-
expect(text).toBe("See all");
|
|
18
|
-
});
|
|
19
|
-
it("should open accordion when 'See all' clicked", async () => {
|
|
20
|
-
const page = await newE2EPage();
|
|
21
|
-
await page.setContent(`<ic-accordion-group>
|
|
22
|
-
<ic-accordion></ic-accordion>
|
|
23
|
-
</ic-accordion-group>`);
|
|
24
|
-
const seeAllBtn = await page.find("ic-accordion-group >>> ic-button");
|
|
25
|
-
await seeAllBtn.click();
|
|
26
|
-
await page.waitForChanges();
|
|
27
|
-
const accordionExpanded = await page.find("ic-accordion >>> .section-button-open");
|
|
28
|
-
expect(accordionExpanded).not.toBeNull();
|
|
29
|
-
});
|
|
30
|
-
it("should test the See all/ Hide all function", async () => {
|
|
31
|
-
const page = await newE2EPage();
|
|
32
|
-
await page.setContent(`
|
|
33
|
-
<ic-accordion-group group-title="Test heading">
|
|
34
|
-
<ic-accordion heading="Accordion 1">
|
|
35
|
-
<ic-typography variant="body">
|
|
36
|
-
This is an example of the main body text.
|
|
37
|
-
</ic-typography>
|
|
38
|
-
</ic-accordion>
|
|
39
|
-
<ic-accordion heading="Accordion 2" expanded>
|
|
40
|
-
<ic-typography variant="body">
|
|
41
|
-
This is an example of the main body text.
|
|
42
|
-
</ic-typography>
|
|
43
|
-
</ic-accordion>
|
|
44
|
-
</ic-accordion-group>
|
|
45
|
-
`);
|
|
46
|
-
const accordions = await page.findAll("ic-accordion");
|
|
47
|
-
const accordion1 = accordions[0];
|
|
48
|
-
const accordion2 = accordions[1];
|
|
49
|
-
const accordionButton = await page.find("ic-accordion-group >>> ic-button");
|
|
50
|
-
expect(await accordion1.getProperty("expanded")).toBe(false);
|
|
51
|
-
expect(await accordion2.getProperty("expanded")).toBe(true);
|
|
52
|
-
expect((await accordionButton).innerText).toBe("See all");
|
|
53
|
-
await accordionButton.click();
|
|
54
|
-
await page.waitForChanges();
|
|
55
|
-
expect(await accordion1.getProperty("expanded")).toBe(true);
|
|
56
|
-
expect(await accordion2.getProperty("expanded")).toBe(true);
|
|
57
|
-
expect((await accordionButton).innerText).toBe("Hide all");
|
|
58
|
-
await accordionButton.click();
|
|
59
|
-
await page.waitForChanges();
|
|
60
|
-
expect(await accordion1.getProperty("expanded")).toBe(false);
|
|
61
|
-
expect(await accordion2.getProperty("expanded")).toBe(false);
|
|
62
|
-
expect((await accordionButton).innerText).toBe("See all");
|
|
63
|
-
});
|
|
64
|
-
it("should open second accordion and close first accordion on single expansion", async () => {
|
|
65
|
-
const page = await newE2EPage();
|
|
66
|
-
await page.setContent(`
|
|
67
|
-
<ic-accordion-group single-expansion="true" group-title="Test heading">
|
|
68
|
-
<ic-accordion expanded heading="Accordion 1">
|
|
69
|
-
<ic-typography variant="body">
|
|
70
|
-
This is an example of the main body text.
|
|
71
|
-
</ic-typography>
|
|
72
|
-
</ic-accordion>
|
|
73
|
-
<ic-accordion heading="Accordion 2">
|
|
74
|
-
<ic-typography variant="body">
|
|
75
|
-
This is an example of the main body text.
|
|
76
|
-
</ic-typography>
|
|
77
|
-
</ic-accordion>
|
|
78
|
-
</ic-accordion-group>
|
|
79
|
-
`);
|
|
80
|
-
const accordions = await page.findAll("ic-accordion");
|
|
81
|
-
const accordion1 = accordions[0];
|
|
82
|
-
const accordion2 = accordions[1];
|
|
83
|
-
expect(await accordion1.getProperty("expanded")).toBe(true);
|
|
84
|
-
expect(await accordion2.getProperty("expanded")).toBe(false);
|
|
85
|
-
await accordion2.click();
|
|
86
|
-
await page.waitForChanges();
|
|
87
|
-
expect(await accordion1.getProperty("expanded")).toBe(false);
|
|
88
|
-
expect(await accordion2.getProperty("expanded")).toBe(true);
|
|
89
|
-
});
|
|
90
|
-
it("both accordions should open when single expansion is false", async () => {
|
|
91
|
-
const page = await newE2EPage();
|
|
92
|
-
await page.setContent(`
|
|
93
|
-
<ic-accordion-group group-title="Test heading">
|
|
94
|
-
<ic-accordion expanded heading="Accordion 1">
|
|
95
|
-
<ic-typography variant="body">
|
|
96
|
-
This is an example of the main body text.
|
|
97
|
-
</ic-typography>
|
|
98
|
-
</ic-accordion>
|
|
99
|
-
<ic-accordion heading="Accordion 2">
|
|
100
|
-
<ic-typography variant="body">
|
|
101
|
-
This is an example of the main body text.
|
|
102
|
-
</ic-typography>
|
|
103
|
-
</ic-accordion>
|
|
104
|
-
</ic-accordion-group>
|
|
105
|
-
`);
|
|
106
|
-
const accordions = await page.findAll("ic-accordion");
|
|
107
|
-
const accordion1 = accordions[0];
|
|
108
|
-
const accordion2 = accordions[1];
|
|
109
|
-
expect(await accordion1.getProperty("expanded")).toBe(true);
|
|
110
|
-
expect(await accordion2.getProperty("expanded")).toBe(false);
|
|
111
|
-
await accordion2.click();
|
|
112
|
-
await page.waitForChanges();
|
|
113
|
-
expect(await accordion1.getProperty("expanded")).toBe(true);
|
|
114
|
-
expect(await accordion2.getProperty("expanded")).toBe(true);
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
//# sourceMappingURL=ic-accordion-group.e2e.js.map
|
package/dist/collection/components/ic-accordion-group/test/basic/ic-accordion-group.e2e.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ic-accordion-group.e2e.js","sourceRoot":"","sources":["../../../../../src/components/ic-accordion-group/test/basic/ic-accordion-group.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,SAAS,CAAC,GAAG,EAAE;IACb,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;AAC5D,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,wEAAwE,EAAE,KAAK,IAAI,EAAE;QACtF,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,CAAC,UAAU,CACnB;;4BAEsB,CACvB,CAAC;QACF,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;QACtE,IAAI,IAAI,GAAG,MAAM,SAAS,CAAC,SAAS,CAAC;QAErC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC9B,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;QACxB,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAC5B,IAAI,GAAG,MAAM,SAAS,CAAC,SAAS,CAAC;QACjC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8CAA8C,EAAE,KAAK,IAAI,EAAE;QAC5D,MAAM,IAAI,GAAG,MAAM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AAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from \"@stencil/core/testing\";\n\nbeforeAll(() => {\n jest.spyOn(console, \"warn\").mockImplementation(jest.fn());\n});\n\ndescribe(\"ic-accordion-group\", () => {\n it(\"button text should change to 'See all' when expanded accordion clicked\", async () => {\n const page = await newE2EPage();\n await page.setContent(\n `<ic-accordion-group>\n <ic-accordion expanded heading=\"Accordion 1\"></ic-accordion>\n </ic-accordion-group>`\n );\n const seeAllBtn = await page.find(\"ic-accordion-group >>> ic-button\");\n let text = await seeAllBtn.innerText;\n\n expect(text).toBe(\"Hide all\");\n await seeAllBtn.click();\n await page.waitForChanges();\n text = await seeAllBtn.innerText;\n expect(text).toBe(\"See all\");\n });\n\n it(\"should open accordion when 'See all' clicked\", async () => {\n const page = await newE2EPage();\n await page.setContent(\n `<ic-accordion-group>\n <ic-accordion></ic-accordion>\n </ic-accordion-group>`\n );\n\n const seeAllBtn = await page.find(\"ic-accordion-group >>> ic-button\");\n\n await seeAllBtn.click();\n await page.waitForChanges();\n\n const accordionExpanded = await page.find(\n \"ic-accordion >>> .section-button-open\"\n );\n\n expect(accordionExpanded).not.toBeNull();\n });\n\n it(\"should test the See all/ Hide all function\", async () => {\n const page = await newE2EPage();\n await page.setContent(`\n <ic-accordion-group group-title=\"Test heading\">\n <ic-accordion heading=\"Accordion 1\">\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>\n <ic-accordion heading=\"Accordion 2\" expanded>\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>\n </ic-accordion-group> \n `);\n\n const accordions = await page.findAll(\"ic-accordion\");\n const accordion1 = accordions[0];\n const accordion2 = accordions[1];\n const accordionButton = await page.find(\"ic-accordion-group >>> ic-button\");\n\n expect(await accordion1.getProperty(\"expanded\")).toBe(false);\n expect(await accordion2.getProperty(\"expanded\")).toBe(true);\n expect((await accordionButton).innerText).toBe(\"See all\");\n\n await accordionButton.click();\n await page.waitForChanges();\n\n expect(await accordion1.getProperty(\"expanded\")).toBe(true);\n expect(await accordion2.getProperty(\"expanded\")).toBe(true);\n expect((await accordionButton).innerText).toBe(\"Hide all\");\n\n await accordionButton.click();\n await page.waitForChanges();\n\n expect(await accordion1.getProperty(\"expanded\")).toBe(false);\n expect(await accordion2.getProperty(\"expanded\")).toBe(false);\n expect((await accordionButton).innerText).toBe(\"See all\");\n });\n\n it(\"should open second accordion and close first accordion on single expansion\", async () => {\n const page = await newE2EPage();\n await page.setContent(`\n <ic-accordion-group single-expansion=\"true\" group-title=\"Test heading\">\n <ic-accordion expanded heading=\"Accordion 1\">\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>\n <ic-accordion heading=\"Accordion 2\">\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>\n </ic-accordion-group> \n `);\n const accordions = await page.findAll(\"ic-accordion\");\n const accordion1 = accordions[0];\n const accordion2 = accordions[1];\n\n expect(await accordion1.getProperty(\"expanded\")).toBe(true);\n expect(await accordion2.getProperty(\"expanded\")).toBe(false);\n\n await accordion2.click();\n await page.waitForChanges();\n\n expect(await accordion1.getProperty(\"expanded\")).toBe(false);\n expect(await accordion2.getProperty(\"expanded\")).toBe(true);\n });\n\n it(\"both accordions should open when single expansion is false\", async () => {\n const page = await newE2EPage();\n await page.setContent(`\n <ic-accordion-group group-title=\"Test heading\">\n <ic-accordion expanded heading=\"Accordion 1\">\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>\n <ic-accordion heading=\"Accordion 2\">\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>\n </ic-accordion-group> \n `);\n const accordions = await page.findAll(\"ic-accordion\");\n const accordion1 = accordions[0];\n const accordion2 = accordions[1];\n\n expect(await accordion1.getProperty(\"expanded\")).toBe(true);\n expect(await accordion2.getProperty(\"expanded\")).toBe(false);\n\n await accordion2.click();\n await page.waitForChanges();\n\n expect(await accordion1.getProperty(\"expanded\")).toBe(true);\n expect(await accordion2.getProperty(\"expanded\")).toBe(true);\n });\n});\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { fixture } from "@open-wc/testing-helpers";
|
|
2
|
-
import { axe } from "jest-axe";
|
|
3
|
-
import { checkShadowElementRendersCorrectly } from "../../../../utils/testa11y.helpers";
|
|
4
|
-
describe("ic-alert", () => {
|
|
5
|
-
it("passes accessibility", async () => {
|
|
6
|
-
const el = await fixture(`<ic-alert heading="Test" message="Test message"/>`);
|
|
7
|
-
checkShadowElementRendersCorrectly(el);
|
|
8
|
-
expect(await axe(el)).toHaveNoViolations();
|
|
9
|
-
});
|
|
10
|
-
});
|
|
11
|
-
//# sourceMappingURL=ic-alert.test.a11y.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ic-alert.test.a11y.js","sourceRoot":"","sources":["../../../../../src/components/ic-alert/test/a11y/ic-alert.test.a11y.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,kCAAkC,EAAE,MAAM,oCAAoC,CAAC;AAExF,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,EAAE,GAAG,MAAM,OAAO,CACtB,mDAAmD,CACpD,CAAC;QACF,kCAAkC,CAAC,EAAE,CAAC,CAAC;QACvC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { fixture } from \"@open-wc/testing-helpers\";\nimport { axe } from \"jest-axe\";\nimport { checkShadowElementRendersCorrectly } from \"../../../../utils/testa11y.helpers\";\n\ndescribe(\"ic-alert\", () => {\n it(\"passes accessibility\", async () => {\n const el = await fixture(\n `<ic-alert heading=\"Test\" message=\"Test message\"/>`\n );\n checkShadowElementRendersCorrectly(el);\n expect(await axe(el)).toHaveNoViolations();\n });\n});\n"]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { newE2EPage } from "@stencil/core/testing";
|
|
2
|
-
describe("ic-alert component", () => {
|
|
3
|
-
it("should close on dismiss icon click", async () => {
|
|
4
|
-
const page = await newE2EPage();
|
|
5
|
-
await page.setContent(`<ic-alert dismissible=true></ic-alert>`);
|
|
6
|
-
await page.waitForChanges();
|
|
7
|
-
let alert = await page.find("ic-alert >>> .container");
|
|
8
|
-
const dismissButton = await page.find("ic-alert >>> .dismiss-icon");
|
|
9
|
-
expect(alert).not.toBeNull();
|
|
10
|
-
expect(dismissButton).not.toBeNull();
|
|
11
|
-
await dismissButton.click();
|
|
12
|
-
alert = await page.find("ic-alert >>> .container");
|
|
13
|
-
expect(alert).toBeNull();
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
//# sourceMappingURL=ic-alert.e2e.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ic-alert.e2e.js","sourceRoot":"","sources":["../../../../../src/components/ic-alert/test/basic/ic-alert.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,oCAAoC,EAAE,KAAK,IAAI,EAAE;QAClD,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,CAAC,UAAU,CAAC,wCAAwC,CAAC,CAAC;QAChE,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAE5B,IAAI,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;QACvD,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;QAEpE,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QAC7B,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QAErC,MAAM,aAAa,CAAC,KAAK,EAAE,CAAC;QAE5B,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;QAEnD,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from \"@stencil/core/testing\";\n\ndescribe(\"ic-alert component\", () => {\n it(\"should close on dismiss icon click\", async () => {\n const page = await newE2EPage();\n await page.setContent(`<ic-alert dismissible=true></ic-alert>`);\n await page.waitForChanges();\n\n let alert = await page.find(\"ic-alert >>> .container\");\n const dismissButton = await page.find(\"ic-alert >>> .dismiss-icon\");\n\n expect(alert).not.toBeNull();\n expect(dismissButton).not.toBeNull();\n\n await dismissButton.click();\n\n alert = await page.find(\"ic-alert >>> .container\");\n\n expect(alert).toBeNull();\n });\n});\n"]}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { fixture } from "@open-wc/testing-helpers";
|
|
2
|
-
import { axe } from "jest-axe";
|
|
3
|
-
beforeEach(() => {
|
|
4
|
-
// IntersectionObserver isn't available in test environment
|
|
5
|
-
const mockIntersectionObserver = jest.fn();
|
|
6
|
-
mockIntersectionObserver.mockReturnValue({
|
|
7
|
-
observe: jest.fn().mockReturnValue(null),
|
|
8
|
-
unobserve: jest.fn().mockReturnValue(null),
|
|
9
|
-
disconnect: jest.fn().mockReturnValue(null),
|
|
10
|
-
});
|
|
11
|
-
window.IntersectionObserver = mockIntersectionObserver;
|
|
12
|
-
});
|
|
13
|
-
describe("ic-back-to-top", () => {
|
|
14
|
-
it("passes accessibility", async () => {
|
|
15
|
-
const el = await fixture(`
|
|
16
|
-
<div>
|
|
17
|
-
<div id="topEl" style="margin-top:-20px;">
|
|
18
|
-
<ic-typography variant="h2">Top of the page</ic-typography>
|
|
19
|
-
</div>
|
|
20
|
-
<div style="height:1000px;"></div>
|
|
21
|
-
<ic-back-to-top target="topEl"></ic-back-to-top>
|
|
22
|
-
</div>`);
|
|
23
|
-
const backToTop = el.lastElementChild;
|
|
24
|
-
expect(backToTop.shadowRoot.innerHTML).not.toBe("");
|
|
25
|
-
expect(await axe(backToTop)).toHaveNoViolations();
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
//# sourceMappingURL=ic-back-to-top.test.a11y.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ic-back-to-top.test.a11y.js","sourceRoot":"","sources":["../../../../../src/components/ic-back-to-top/test/a11y/ic-back-to-top.test.a11y.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,UAAU,CAAC,GAAG,EAAE;IACd,2DAA2D;IAC3D,MAAM,wBAAwB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAC3C,wBAAwB,CAAC,eAAe,CAAC;QACvC,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC;QACxC,SAAS,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC;QAC1C,UAAU,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC;KAC5C,CAAC,CAAC;IACH,MAAM,CAAC,oBAAoB,GAAG,wBAAwB,CAAC;AACzD,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC;;;;;;;aAOhB,CAAC,CAAC;QACX,MAAM,SAAS,GAAG,EAAE,CAAC,gBAA2B,CAAC;QACjD,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpD,MAAM,CAAC,MAAM,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC;IACpD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { fixture } from \"@open-wc/testing-helpers\";\nimport { axe } from \"jest-axe\";\n\nbeforeEach(() => {\n // IntersectionObserver isn't available in test environment\n const mockIntersectionObserver = jest.fn();\n mockIntersectionObserver.mockReturnValue({\n observe: jest.fn().mockReturnValue(null),\n unobserve: jest.fn().mockReturnValue(null),\n disconnect: jest.fn().mockReturnValue(null),\n });\n window.IntersectionObserver = mockIntersectionObserver;\n});\n\ndescribe(\"ic-back-to-top\", () => {\n it(\"passes accessibility\", async () => {\n const el = await fixture(`\n <div>\n <div id=\"topEl\" style=\"margin-top:-20px;\">\n <ic-typography variant=\"h2\">Top of the page</ic-typography>\n </div>\n <div style=\"height:1000px;\"></div>\n <ic-back-to-top target=\"topEl\"></ic-back-to-top>\n </div>`);\n const backToTop = el.lastElementChild as Element;\n expect(backToTop.shadowRoot.innerHTML).not.toBe(\"\");\n expect(await axe(backToTop)).toHaveNoViolations();\n });\n});\n"]}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { newE2EPage } from "@stencil/core/testing";
|
|
2
|
-
describe("ic-back-to-top", () => {
|
|
3
|
-
it("should be hidden", async () => {
|
|
4
|
-
const page = await newE2EPage();
|
|
5
|
-
await page.setContent(`<div id="topEl" style="height:1200px"></div>
|
|
6
|
-
<ic-back-to-top target="topEl"></ic-back-to-top>
|
|
7
|
-
`);
|
|
8
|
-
await page.waitForChanges();
|
|
9
|
-
const backToTop = await page.find("ic-back-to-top >>> .ic-back-to-top-link");
|
|
10
|
-
expect(await backToTop.isVisible()).toBe(false);
|
|
11
|
-
});
|
|
12
|
-
it("should have correct text", async () => {
|
|
13
|
-
const page = await newE2EPage();
|
|
14
|
-
await page.setContent(`<div id="topEl"></div>
|
|
15
|
-
<ic-back-to-top target="topEl"></ic-back-to-top>
|
|
16
|
-
`);
|
|
17
|
-
await page.waitForChanges();
|
|
18
|
-
const backToTop = await page.find("ic-back-to-top >>> ic-typography");
|
|
19
|
-
const text = await backToTop.innerText;
|
|
20
|
-
expect(text).toBe("Back to top");
|
|
21
|
-
});
|
|
22
|
-
it("should appear when top is off screen", async () => {
|
|
23
|
-
const page = await newE2EPage();
|
|
24
|
-
await page.setContent(`<div id="topEl" style="margin-top:-20px;">
|
|
25
|
-
<ic-typography variant="h2">Top of the page</ic-typography>
|
|
26
|
-
</div>
|
|
27
|
-
<div style="height:1200px;"></div>
|
|
28
|
-
<ic-back-to-top target="topEl"></ic-back-to-top>
|
|
29
|
-
`);
|
|
30
|
-
await page.waitForChanges();
|
|
31
|
-
const backToTop = await page.find("ic-back-to-top >>> .ic-back-to-top-link");
|
|
32
|
-
expect(await backToTop.isVisible()).toBe(true);
|
|
33
|
-
});
|
|
34
|
-
it("should appear when page scrolled", async () => {
|
|
35
|
-
const page = await newE2EPage();
|
|
36
|
-
await page.setContent(`<div id="topEl">
|
|
37
|
-
<ic-typography variant="h2">Top of the page</ic-typography>
|
|
38
|
-
</div>
|
|
39
|
-
<div style="height:1200px;"></div>
|
|
40
|
-
<button style="bottom:0px; left:0px">Test Button</button>
|
|
41
|
-
<ic-back-to-top target="topEl"></ic-back-to-top>
|
|
42
|
-
`);
|
|
43
|
-
await page.waitForChanges();
|
|
44
|
-
const backToTop = await page.find("ic-back-to-top >>> .ic-back-to-top-link");
|
|
45
|
-
const button = await page.find("button");
|
|
46
|
-
expect(await backToTop.isVisible()).toBe(false);
|
|
47
|
-
await button.focus();
|
|
48
|
-
expect(await backToTop.isVisible()).toBe(true);
|
|
49
|
-
});
|
|
50
|
-
it("should hide and scroll page to top when clicked", async () => {
|
|
51
|
-
const page = await newE2EPage();
|
|
52
|
-
await page.setContent(`<div id="topEl">
|
|
53
|
-
<ic-typography variant="h2">Top of the page</ic-typography>
|
|
54
|
-
</div>
|
|
55
|
-
<div style="height:1200px;"></div>
|
|
56
|
-
<button style="bottom:0px; left:0px">Test Button</button>
|
|
57
|
-
<ic-back-to-top target="topEl"></ic-back-to-top>
|
|
58
|
-
`);
|
|
59
|
-
await page.waitForChanges();
|
|
60
|
-
const backToTop = await page.find("ic-back-to-top >>> .ic-back-to-top-link");
|
|
61
|
-
const button = await page.find("button");
|
|
62
|
-
await button.focus();
|
|
63
|
-
await backToTop.click();
|
|
64
|
-
await page.waitForTimeout(300);
|
|
65
|
-
expect(await backToTop.isVisible()).toBe(false);
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
//# sourceMappingURL=ic-back-to-top.e2e.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ic-back-to-top.e2e.js","sourceRoot":"","sources":["../../../../../src/components/ic-back-to-top/test/basic/ic-back-to-top.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,kBAAkB,EAAE,KAAK,IAAI,EAAE;QAChC,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,CAAC,UAAU,CACnB;;OAEC,CACF,CAAC;QACF,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAC5B,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,IAAI,CAC/B,yCAAyC,CAC1C,CAAC;QAEF,MAAM,CAAC,MAAM,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0BAA0B,EAAE,KA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AC,KAAK,EAAE,CAAC;QAErB,MAAM,CAAC,MAAM,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iDAAiD,EAAE,KAAK,IAAI,EAAE;QAC/D,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,CAAC,UAAU,CACnB;;;;;;KAMD,CACA,CAAC;QACF,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAE5B,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,IAAI,CAC/B,yCAAyC,CAC1C,CAAC;QACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAEzC,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACrB,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;QACxB,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;QAE/B,MAAM,CAAC,MAAM,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from \"@stencil/core/testing\";\n\ndescribe(\"ic-back-to-top\", () => {\n it(\"should be hidden\", async () => {\n const page = await newE2EPage();\n await page.setContent(\n `<div id=\"topEl\" style=\"height:1200px\"></div>\n <ic-back-to-top target=\"topEl\"></ic-back-to-top>\n `\n );\n await page.waitForChanges();\n const backToTop = await page.find(\n \"ic-back-to-top >>> .ic-back-to-top-link\"\n );\n\n expect(await backToTop.isVisible()).toBe(false);\n });\n\n it(\"should have correct text\", async () => {\n const page = await newE2EPage();\n await page.setContent(\n `<div id=\"topEl\"></div>\n <ic-back-to-top target=\"topEl\"></ic-back-to-top>\n `\n );\n await page.waitForChanges();\n const backToTop = await page.find(\"ic-back-to-top >>> ic-typography\");\n const text = await backToTop.innerText;\n\n expect(text).toBe(\"Back to top\");\n });\n\n it(\"should appear when top is off screen\", async () => {\n const page = await newE2EPage();\n await page.setContent(\n `<div id=\"topEl\" style=\"margin-top:-20px;\">\n <ic-typography variant=\"h2\">Top of the page</ic-typography>\n </div>\n <div style=\"height:1200px;\"></div>\n <ic-back-to-top target=\"topEl\"></ic-back-to-top>\n `\n );\n await page.waitForChanges();\n const backToTop = await page.find(\n \"ic-back-to-top >>> .ic-back-to-top-link\"\n );\n\n expect(await backToTop.isVisible()).toBe(true);\n });\n\n it(\"should appear when page scrolled\", async () => {\n const page = await newE2EPage();\n await page.setContent(\n `<div id=\"topEl\">\n <ic-typography variant=\"h2\">Top of the page</ic-typography>\n </div>\n <div style=\"height:1200px;\"></div>\n <button style=\"bottom:0px; left:0px\">Test Button</button>\n <ic-back-to-top target=\"topEl\"></ic-back-to-top>\n `\n );\n await page.waitForChanges();\n\n const backToTop = await page.find(\n \"ic-back-to-top >>> .ic-back-to-top-link\"\n );\n const button = await page.find(\"button\");\n\n expect(await backToTop.isVisible()).toBe(false);\n\n await button.focus();\n\n expect(await backToTop.isVisible()).toBe(true);\n });\n\n it(\"should hide and scroll page to top when clicked\", async () => {\n const page = await newE2EPage();\n await page.setContent(\n `<div id=\"topEl\">\n <ic-typography variant=\"h2\">Top of the page</ic-typography>\n </div>\n <div style=\"height:1200px;\"></div>\n <button style=\"bottom:0px; left:0px\">Test Button</button>\n <ic-back-to-top target=\"topEl\"></ic-back-to-top>\n `\n );\n await page.waitForChanges();\n\n const backToTop = await page.find(\n \"ic-back-to-top >>> .ic-back-to-top-link\"\n );\n const button = await page.find(\"button\");\n\n await button.focus();\n await backToTop.click();\n await page.waitForTimeout(300);\n\n expect(await backToTop.isVisible()).toBe(false);\n });\n});\n"]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { fixture } from "@open-wc/testing-helpers";
|
|
2
|
-
import { axe } from "jest-axe";
|
|
3
|
-
import { checkShadowElementRendersCorrectly } from "../../../../utils/testa11y.helpers";
|
|
4
|
-
describe("badge component", () => {
|
|
5
|
-
it("passes accessibility", async () => {
|
|
6
|
-
const el = await fixture("<ic-button>Button<ic-badge slot='badge' text-label='1'/></ic-button>");
|
|
7
|
-
checkShadowElementRendersCorrectly(el);
|
|
8
|
-
expect(await axe(el)).toHaveNoViolations();
|
|
9
|
-
});
|
|
10
|
-
it("passes accessibility with accessible label prop set", async () => {
|
|
11
|
-
const el = await fixture("<ic-button>Button<ic-badge slot='badge' text-label='1' accessible-label='1 notification found'/></ic-button>");
|
|
12
|
-
checkShadowElementRendersCorrectly(el);
|
|
13
|
-
expect(await axe(el)).toHaveNoViolations();
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
//# sourceMappingURL=ic-badge.test.a11y.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ic-badge.test.a11y.js","sourceRoot":"","sources":["../../../../../src/components/ic-badge/test/a11y/ic-badge.test.a11y.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,kCAAkC,EAAE,MAAM,oCAAoC,CAAC;AAExF,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,EAAE,GAAG,MAAM,OAAO,CACtB,sEAAsE,CACvE,CAAC;QACF,kCAAkC,CAAC,EAAE,CAAC,CAAC;QACvC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qDAAqD,EAAE,KAAK,IAAI,EAAE;QACnE,MAAM,EAAE,GAAG,MAAM,OAAO,CACtB,8GAA8G,CAC/G,CAAC;QACF,kCAAkC,CAAC,EAAE,CAAC,CAAC;QACvC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { fixture } from \"@open-wc/testing-helpers\";\nimport { axe } from \"jest-axe\";\nimport { checkShadowElementRendersCorrectly } from \"../../../../utils/testa11y.helpers\";\n\ndescribe(\"badge component\", () => {\n it(\"passes accessibility\", async () => {\n const el = await fixture(\n \"<ic-button>Button<ic-badge slot='badge' text-label='1'/></ic-button>\"\n );\n checkShadowElementRendersCorrectly(el);\n expect(await axe(el)).toHaveNoViolations();\n });\n\n it(\"passes accessibility with accessible label prop set\", async () => {\n const el = await fixture(\n \"<ic-button>Button<ic-badge slot='badge' text-label='1' accessible-label='1 notification found'/></ic-button>\"\n );\n checkShadowElementRendersCorrectly(el);\n expect(await axe(el)).toHaveNoViolations();\n });\n});\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { fixture } from "@open-wc/testing-helpers";
|
|
2
|
-
import { axe } from "jest-axe";
|
|
3
|
-
import { checkShadowElementRendersCorrectly } from "../../../../utils/testa11y.helpers";
|
|
4
|
-
describe("ic-classification-banner", () => {
|
|
5
|
-
it("passes accessibility", async () => {
|
|
6
|
-
const el = await fixture(`<ic-classification-banner />`);
|
|
7
|
-
checkShadowElementRendersCorrectly(el);
|
|
8
|
-
expect(await axe(el)).toHaveNoViolations();
|
|
9
|
-
});
|
|
10
|
-
});
|
|
11
|
-
//# sourceMappingURL=ic-classification-banner.test.a11y.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ic-classification-banner.test.a11y.js","sourceRoot":"","sources":["../../../../../src/components/ic-classification-banner/test/a11y/ic-classification-banner.test.a11y.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,kCAAkC,EAAE,MAAM,oCAAoC,CAAC;AAExF,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,8BAA8B,CAAC,CAAC;QACzD,kCAAkC,CAAC,EAAE,CAAC,CAAC;QACvC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { fixture } from \"@open-wc/testing-helpers\";\nimport { axe } from \"jest-axe\";\nimport { checkShadowElementRendersCorrectly } from \"../../../../utils/testa11y.helpers\";\n\ndescribe(\"ic-classification-banner\", () => {\n it(\"passes accessibility\", async () => {\n const el = await fixture(`<ic-classification-banner />`);\n checkShadowElementRendersCorrectly(el);\n expect(await axe(el)).toHaveNoViolations();\n });\n});\n"]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { fixture } from "@open-wc/testing-helpers";
|
|
2
|
-
import { axe } from "jest-axe";
|
|
3
|
-
import { checkShadowElementRendersCorrectly } from "../../../../utils/testa11y.helpers";
|
|
4
|
-
describe("ic-toast", () => {
|
|
5
|
-
it("passes accessibility check for manual dismiss", async () => {
|
|
6
|
-
const el = await fixture(`<ic-toast heading="Heading"></ic-toast>`);
|
|
7
|
-
checkShadowElementRendersCorrectly(el);
|
|
8
|
-
expect(await axe(el)).toHaveNoViolations();
|
|
9
|
-
});
|
|
10
|
-
it("passes accessibility check for auto dismiss", async () => {
|
|
11
|
-
const el = await fixture(`<ic-toast heading="Heading" dismiss-mode="automatic"></ic-toast>`);
|
|
12
|
-
checkShadowElementRendersCorrectly(el);
|
|
13
|
-
expect(await axe(el)).toHaveNoViolations();
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
//# sourceMappingURL=ic-toast.test.a11y.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ic-toast.test.a11y.js","sourceRoot":"","sources":["../../../../../src/components/ic-toast/test/a11y/ic-toast.test.a11y.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,kCAAkC,EAAE,MAAM,oCAAoC,CAAC;AAExF,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,EAAE,CAAC,+CAA+C,EAAE,KAAK,IAAI,EAAE;QAC7D,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,yCAAyC,CAAC,CAAC;QACpE,kCAAkC,CAAC,EAAE,CAAC,CAAC;QACvC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,KAAK,IAAI,EAAE;QAC3D,MAAM,EAAE,GAAG,MAAM,OAAO,CACtB,kEAAkE,CACnE,CAAC;QACF,kCAAkC,CAAC,EAAE,CAAC,CAAC;QACvC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { fixture } from \"@open-wc/testing-helpers\";\nimport { axe } from \"jest-axe\";\nimport { checkShadowElementRendersCorrectly } from \"../../../../utils/testa11y.helpers\";\n\ndescribe(\"ic-toast\", () => {\n it(\"passes accessibility check for manual dismiss\", async () => {\n const el = await fixture(`<ic-toast heading=\"Heading\"></ic-toast>`);\n checkShadowElementRendersCorrectly(el);\n expect(await axe(el)).toHaveNoViolations();\n });\n\n it(\"passes accessibility check for auto dismiss\", async () => {\n const el = await fixture(\n `<ic-toast heading=\"Heading\" dismiss-mode=\"automatic\"></ic-toast>`\n );\n checkShadowElementRendersCorrectly(el);\n expect(await axe(el)).toHaveNoViolations();\n });\n});\n"]}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { newE2EPage } from "@stencil/core/testing";
|
|
2
|
-
describe("ic-toast component", () => {
|
|
3
|
-
it("should close on dismiss icon click", async () => {
|
|
4
|
-
const page = await newE2EPage();
|
|
5
|
-
await page.setContent(`<ic-toast heading="Heading"></ic-toast>`);
|
|
6
|
-
await page.waitForChanges();
|
|
7
|
-
let toast = await page.find("ic-toast");
|
|
8
|
-
await toast.callMethod("setVisible");
|
|
9
|
-
await page.waitForChanges();
|
|
10
|
-
expect(toast).not.toHaveClass("hidden");
|
|
11
|
-
const dismissButton = await page.find("ic-toast >>> ic-button");
|
|
12
|
-
expect(dismissButton).not.toBeNull();
|
|
13
|
-
await dismissButton.click();
|
|
14
|
-
toast = await page.find("ic-toast");
|
|
15
|
-
expect(toast).toHaveClass("hidden");
|
|
16
|
-
});
|
|
17
|
-
it("should focus slotted action element when opened if an action is provided", async () => {
|
|
18
|
-
const page = await newE2EPage();
|
|
19
|
-
await page.setContent(`<ic-toast heading="Heading"><ic-button id="button1" slot="action">Button</ic-button></ic-toast>`);
|
|
20
|
-
await page.waitForChanges();
|
|
21
|
-
const toast = await page.find("ic-toast");
|
|
22
|
-
await toast.callMethod("setVisible");
|
|
23
|
-
await page.waitForChanges();
|
|
24
|
-
await page.waitForTimeout(300);
|
|
25
|
-
const slottedButton = await page.find("ic-button");
|
|
26
|
-
expect(slottedButton).not.toBeNull;
|
|
27
|
-
const activeElement = await page.evaluate(() => document.activeElement.id);
|
|
28
|
-
expect(activeElement).toBe("button1");
|
|
29
|
-
});
|
|
30
|
-
it("should focus the dismiss button when opened if no action is provided", async () => {
|
|
31
|
-
const page = await newE2EPage();
|
|
32
|
-
await page.setContent(`<ic-toast heading="Heading"></ic-toast>`);
|
|
33
|
-
await page.waitForChanges();
|
|
34
|
-
const toast = await page.find("ic-toast");
|
|
35
|
-
await toast.callMethod("setVisible");
|
|
36
|
-
await page.waitForChanges();
|
|
37
|
-
await page.waitForTimeout(300);
|
|
38
|
-
const activeElement = await page.$eval("ic-toast", (el) => el.shadowRoot.activeElement.id);
|
|
39
|
-
expect(activeElement).toBe("dismiss-button");
|
|
40
|
-
});
|
|
41
|
-
it("should set the dimissMode to manual if the action slot is used on an autoDismiss toast", async () => {
|
|
42
|
-
const page = await newE2EPage();
|
|
43
|
-
await page.setContent(`<ic-toast heading="Heading" dismiss-mode="automatic"><ic-button slot="action">Button</ic-button></ic-toast>`);
|
|
44
|
-
await page.waitForChanges();
|
|
45
|
-
const dismissMode = await page.$eval("ic-toast", (el) => el.dismissMode);
|
|
46
|
-
expect(dismissMode).toBe("manual");
|
|
47
|
-
});
|
|
48
|
-
it("should set the variant to neutral if the neutral-icon slot is used when the variant isn't set", async () => {
|
|
49
|
-
const page = await newE2EPage();
|
|
50
|
-
await page.setContent(`<ic-toast heading="Heading">
|
|
51
|
-
<svg
|
|
52
|
-
slot="neutral-icon"
|
|
53
|
-
width="24"
|
|
54
|
-
height="24"
|
|
55
|
-
viewBox="0 0 24 24"
|
|
56
|
-
fill="none"
|
|
57
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
58
|
-
>
|
|
59
|
-
<path
|
|
60
|
-
d="M8.79502 15.875L4.62502 11.705L3.20502 13.115L8.79502 18.705L20.795 6.70501L19.385 5.29501L8.79502 15.875Z"
|
|
61
|
-
/>
|
|
62
|
-
</svg></ic-toast>`);
|
|
63
|
-
await page.waitForChanges();
|
|
64
|
-
const variant = await page.$eval("ic-toast", (el) => el.variant);
|
|
65
|
-
expect(variant).toBe("neutral");
|
|
66
|
-
});
|
|
67
|
-
it("should set the autoDismissTimeout to 5000ms if the prop provided is below", async () => {
|
|
68
|
-
const page = await newE2EPage();
|
|
69
|
-
await page.setContent(`<ic-toast heading="Heading" auto-dismiss-timeout="100"></ic-toast>`);
|
|
70
|
-
await page.waitForChanges();
|
|
71
|
-
const variant = await page.$eval("ic-toast", (el) => el.autoDismissTimeout);
|
|
72
|
-
expect(variant).toBe(5000);
|
|
73
|
-
});
|
|
74
|
-
it("should not render an icon if the variant is neutral and the neutral-icon slot is not used", async () => {
|
|
75
|
-
const page = await newE2EPage();
|
|
76
|
-
await page.setContent(`<ic-toast heading="Heading" variant="neutral"></ic-toast>`);
|
|
77
|
-
await page.waitForChanges();
|
|
78
|
-
const icon = await page.find("ic-toast >>> span");
|
|
79
|
-
expect(icon).toBeNull();
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
//# sourceMappingURL=ic-toast.e2e.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ic-toast.e2e.js","sourceRoot":"","sources":["../../../../../src/components/ic-toast/test/basic/ic-toast.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,oCAAoC,EAAE,KAAK,IAAI,EAAE;QAClD,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,CAAC,UAAU,CAAC,yCAAyC,CAAC,CAAC;QACjE,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAE5B,IAAI,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACxC,MAAM,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;QAErC,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAC5B,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAExC,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAChE,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QAErC,MAAM,aAAa,CAAC,KAAK,EAAE,CAAC;QAE5B,K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AAK,IAAI,EAAE;QACzF,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,CAAC,UAAU,CACnB,oEAAoE,CACrE,CAAC;QACF,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAE5B,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK,CAC9B,UAAU,EACV,CAAC,EAAE,EAAE,EAAE,CAAE,EAAyB,CAAC,kBAAkB,CACtD,CAAC;QACF,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2FAA2F,EAAE,KAAK,IAAI,EAAE;QACzG,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,CAAC,UAAU,CACnB,2DAA2D,CAC5D,CAAC;QACF,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAE5B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAClD,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from \"@stencil/core/testing\";\n\ndescribe(\"ic-toast component\", () => {\n it(\"should close on dismiss icon click\", async () => {\n const page = await newE2EPage();\n await page.setContent(`<ic-toast heading=\"Heading\"></ic-toast>`);\n await page.waitForChanges();\n\n let toast = await page.find(\"ic-toast\");\n await toast.callMethod(\"setVisible\");\n\n await page.waitForChanges();\n expect(toast).not.toHaveClass(\"hidden\");\n\n const dismissButton = await page.find(\"ic-toast >>> ic-button\");\n expect(dismissButton).not.toBeNull();\n\n await dismissButton.click();\n\n toast = await page.find(\"ic-toast\");\n expect(toast).toHaveClass(\"hidden\");\n });\n\n it(\"should focus slotted action element when opened if an action is provided\", async () => {\n const page = await newE2EPage();\n await page.setContent(\n `<ic-toast heading=\"Heading\"><ic-button id=\"button1\" slot=\"action\">Button</ic-button></ic-toast>`\n );\n await page.waitForChanges();\n\n const toast = await page.find(\"ic-toast\");\n await toast.callMethod(\"setVisible\");\n\n await page.waitForChanges();\n await page.waitForTimeout(300);\n\n const slottedButton = await page.find(\"ic-button\");\n expect(slottedButton).not.toBeNull;\n\n const activeElement = await page.evaluate(() => document.activeElement.id);\n expect(activeElement).toBe(\"button1\");\n });\n\n it(\"should focus the dismiss button when opened if no action is provided\", async () => {\n const page = await newE2EPage();\n await page.setContent(`<ic-toast heading=\"Heading\"></ic-toast>`);\n await page.waitForChanges();\n\n const toast = await page.find(\"ic-toast\");\n await toast.callMethod(\"setVisible\");\n\n await page.waitForChanges();\n await page.waitForTimeout(300);\n\n const activeElement = await page.$eval(\n \"ic-toast\",\n (el) => el.shadowRoot.activeElement.id\n );\n expect(activeElement).toBe(\"dismiss-button\");\n });\n\n it(\"should set the dimissMode to manual if the action slot is used on an autoDismiss toast\", async () => {\n const page = await newE2EPage();\n await page.setContent(\n `<ic-toast heading=\"Heading\" dismiss-mode=\"automatic\"><ic-button slot=\"action\">Button</ic-button></ic-toast>`\n );\n await page.waitForChanges();\n\n const dismissMode = await page.$eval(\n \"ic-toast\",\n (el) => (el as HTMLIcToastElement).dismissMode\n );\n expect(dismissMode).toBe(\"manual\");\n });\n\n it(\"should set the variant to neutral if the neutral-icon slot is used when the variant isn't set\", async () => {\n const page = await newE2EPage();\n await page.setContent(`<ic-toast heading=\"Heading\">\n <svg\n slot=\"neutral-icon\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M8.79502 15.875L4.62502 11.705L3.20502 13.115L8.79502 18.705L20.795 6.70501L19.385 5.29501L8.79502 15.875Z\"\n />\n </svg></ic-toast>`);\n await page.waitForChanges();\n\n const variant = await page.$eval(\n \"ic-toast\",\n (el) => (el as HTMLIcToastElement).variant\n );\n expect(variant).toBe(\"neutral\");\n });\n\n it(\"should set the autoDismissTimeout to 5000ms if the prop provided is below\", async () => {\n const page = await newE2EPage();\n await page.setContent(\n `<ic-toast heading=\"Heading\" auto-dismiss-timeout=\"100\"></ic-toast>`\n );\n await page.waitForChanges();\n\n const variant = await page.$eval(\n \"ic-toast\",\n (el) => (el as HTMLIcToastElement).autoDismissTimeout\n );\n expect(variant).toBe(5000);\n });\n\n it(\"should not render an icon if the variant is neutral and the neutral-icon slot is not used\", async () => {\n const page = await newE2EPage();\n await page.setContent(\n `<ic-toast heading=\"Heading\" variant=\"neutral\"></ic-toast>`\n );\n await page.waitForChanges();\n\n const icon = await page.find(\"ic-toast >>> span\");\n expect(icon).toBeNull();\n });\n});\n"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as i,c as t,h as s,H as e,g as h}from"./p-52e063d3.js";import{E as a,B as n,m as o,w as l,j as r,l as c,a as d,n as u,q as p,s as f,F as b,x as v}from"./p-95a864bf.js";import{I as m,a as g}from"./p-26b7b18f.js";const w=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n<path d="M7 9.5L12 14.5L17 9.5H7Z" fill="currentColor" />\n</svg>\n`;const x=`<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">\n<path d="M12.6666 4.27334L11.7266 3.33334L7.99998 7.06001L4.27331 3.33334L3.33331 4.27334L7.05998 8.00001L3.33331 11.7267L4.27331 12.6667L7.99998 8.94001L11.7266 12.6667L12.6666 11.7267L8.93998 8.00001L12.6666 4.27334Z" fill="currentColor" />\n</svg>\n`;const y='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:block;position:relative}:host(.full-width){width:100%}ic-input-component-container:hover{--border-color:var(--ic-action-dark-hover)}ic-input-component-container:active{--border-color:var(--ic-action-dark-active);color:var(--ic-action-dark-active)}ic-input-component-container.menu-open{--border-color:var(--ic-architectural-400);color:var(--ic-action-dark)}ic-input-validation .status-icon,ic-input-validation .statustext{visibility:visible}ic-input-validation.menu-open .status-icon,ic-input-validation.menu-open .statustext{visibility:hidden;transition:visibility 0s}ic-input-label{margin-bottom:var(--ic-space-xs) !important}select{border:0;border-radius:var(--ic-border-radius);background-color:var(--ic-architectural-white);color:var(--ic-color-primary-text);line-height:1.5rem;letter-spacing:0.005rem;width:100%;height:100%;padding-left:0.375rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-repeat:no-repeat;background-position:right 0.375rem center;background-image:url("data:image/svg+xml;utf8,<svg fill=\'black\' height=\'24\' viewBox=\'0 0 24 24\' width=\'24\' xmlns=\'http://www.w3.org/2000/svg\'><path d=\'M7 10l5 5 5-5z\'/><path d=\'M0 0h24v24H0z\' fill=\'none\'/></svg>")}select option,.select-option-selected{color:var(--ic-color-primary-text)}select:disabled{color:var(--ic-architectural-200);background-image:url("data:image/svg+xml;utf8,<svg fill=\'grey\' height=\'24\' viewBox=\'0 0 24 24\' width=\'24\' xmlns=\'http://www.w3.org/2000/svg\'><path d=\'M7 10l5 5 5-5z\'/><path d=\'M0 0h24v24H0z\' fill=\'none\'/></svg>")}select:focus{border:0;outline:0}select:not([disabled]){cursor:pointer}.select-container{width:100%;display:flex;align-items:center;position:relative}.select-input{width:100%;height:100%;padding:0 0.375rem;display:flex;cursor:pointer;align-items:center;justify-content:space-between;background:none;border:none}.select-input:focus{outline:var(--ic-hc-focus-outline)}:host(:not(.disabled)) ic-input-component-container:hover .select-input{background-color:var(--ic-architectural-white)}.select-input[disabled]{pointer-events:none}:host(.searchable) .select-input{cursor:auto}.searchable-select-container{align-items:center;display:flex;width:100%;position:relative}.expand-icon{height:var(--ic-space-lg);padding-left:var(--ic-space-xs);color:var(--ic-action-dark)}.expand-icon>svg{display:inline-block;width:var(--ic-space-lg);height:var(--ic-space-lg)}:host(.disabled) .expand-icon,:host(.disabled) .expand-icon>svg>path{color:var(--ic-architectural-200)}:host(.searchable) .expand-icon{padding-left:var(--ic-space-xxs);height:2.25rem}:host(.searchable) .expand-icon>svg{height:2.25rem;padding:0 0.375rem}:host(.searchable:not(.disabled)) .expand-icon>svg{cursor:pointer}.expand-icon-open{color:var(--ic-action-dark)}.expand-icon-filled{color:var(--ic-action-dark)}.expand-icon-open,:host(.searchable) .expand-icon-open{transform:rotateX(180deg)}:host(.disabled) .value-text,.placeholder{color:var(--ic-color-tertiary-text)}.select-input-end{display:flex;align-items:center}.clear-button-container{display:flex;gap:var(--ic-space-xxs);padding-left:2.375rem}:host(.small) .clear-button-container{padding-left:1.875rem}.divider{width:var(--ic-border-width);background-color:var(--ic-architectural-400);margin:var(--ic-space-xxs) 0;border-radius:var(--ic-space-1px);height:var(--ic-space-lg)}:host(.small) .divider{height:var(--ic-space-md)}.clear-button{position:absolute;right:2.75rem;border-radius:var(--ic-border-radius);transition:box-shadow var(--ic-easing-transition),\n border-radius var(--ic-easing-transition)}.clear-button:focus{background-color:var(--ic-focus-blue);box-shadow:inset 0 0 0 0.125rem var(--ic-focus-glow);border-radius:0.25rem}.clear-button:focus *{fill:white}.searchable-select-results-status{border:0;clip:rect(0, 0, 0, 0, 0);height:var(--ic-space-1px);overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:var(--ic-space-1px)}';let k=0;const z=class{constructor(s){i(this,s);this.icBlur=t(this,"icBlur",7);this.icChange=t(this,"icChange",7);this.icClear=t(this,"icClear",7);this.icFocus=t(this,"icFocus",7);this.icInput=t(this,"icInput",7);this.icOptionSelect=t(this,"icOptionSelect",7);this.icRetryLoad=t(this,"icRetryLoad",7);this.hasSetDefaultValue=false;this.inheritedAttributes={};this.initialOptionsEmpty=false;this.inputId=`ic-select-input-${k++}`;this.menuId=`${this.inputId}-menu`;this.searchableMenuItemSelected=false;this.ungroupedOptions=[];this.handleRetry=i=>{var t;if(i.detail.keyPressed)(t=this.searchableSelectElement)===null||t===void 0?void 0:t.focus();this.blurredBecauseButtonPressed=true;this.retryButtonClick=true;this.hasSetDefaultValue=true;this.icRetryLoad.emit({value:this.hiddenInputValue})};this.emitIcChange=i=>{if(!this.searchable){this.value=i}clearTimeout(this.debounceIcChange);this.debounceIcChange=window.setTimeout((()=>{this.icChange.emit({value:i})}),this.currDebounce)};this.emitImmediateIcChange=i=>{this.value=i;clearTimeout(this.debounceIcChange);this.icChange.emit({value:i})};this.deduplicateOptions=i=>{const t=[];const s=[];let e;i.forEach((i=>{if(i.children){e=[];i.children.forEach((i=>{if(t.includes(i.value)){console.warn(`ic-select with label ${this.label} was populated with duplicate option (value: ${i.value}) which has been removed.`)}else{t.push(i.value);e.push(i)}}));const h=Object.assign(Object.assign({},i),{children:e});s.push(h)}else{if(t.includes(i.value)){console.warn(`ic-select with label ${this.label} was populated with duplicate option (value: ${i.value}) which has been removed.`)}else{t.push(i.value);s.push(i)}}}));return s};this.setOptionsValuesFromLabels=()=>{if(this.options.length>0&&this.options.map){this.options.map((i=>{if(!i.value){i.value=i.label}}))}};this.setUngroupedOptions=i=>{this.ungroupedOptions=i.detail.options};this.setTextColor=()=>{if(this.nativeSelectElement.selectedIndex===0){this.nativeSelectElement.className="placeholder"}else{this.nativeSelectElement.className="select-option-selected"}};this.setMenuChange=i=>{if(this.open!==i){this.open=i}};this.getLabelFromValue=i=>a(i,this.uniqueOptions);this.getFilteredChildMenuOptions=i=>{let t=i.children;if(this.searchable){t=n(i.children,this.includeDescriptionsInSearch,this.searchableSelectInputValue,this.searchMatchPosition)}else{t=n(i.children,false,this.pressedCharacters,"start")}const s=Object.assign({},i);s.children=t;return s};this.handleNativeSelectChange=()=>{this.icOptionSelect.emit({value:this.nativeSelectElement.value});this.emitImmediateIcChange(this.nativeSelectElement.value);this.setTextColor()};this.handleCustomSelectChange=i=>{if(this.searchable&&i.detail.label===this.emptyOptionListText){this.searchableSelectElement.focus();return}if(this.searchable){this.value=i.detail.value;this.searchableMenuItemSelected=true;if(this.value===this.currValue){this.searchableSelectInputValue=this.getLabelFromValue(this.value)}this.inputValueToFilter=null;this.hiddenInputValue=this.getValueFromLabel(this.searchableSelectInputValue)}this.ariaActiveDescendant=i.detail.optionId;this.icOptionSelect.emit({value:i.detail.value});this.emitIcChange(i.detail.value)};this.handleMenuChange=i=>{this.open=i.detail.open;this.pressedCharacters="";this.searchable&&this.handleFocusIndicatorDisplay()};this.handleMenuKeyPress=i=>{i.cancelBubble=true;this.handleCharacterKeyDown(i.detail.key)};this.handleMenuValueChange=i=>{this.value=i.detail.value};this.handleFocusIndicatorDisplay=()=>{const i=this.el.shadowRoot.querySelector(".focus-indicator");if(this.open){i.classList.add("focus-indicator-enabled")}else{i.classList.remove("focus-indicator-enabled")}};this.handleMouseDown=i=>{if(!this.open){i.preventDefault()}};this.isExternalFiltering=()=>this.searchable&&this.disableFilter;this.handleClick=i=>{var t;if(!this.open){if(this.isExternalFiltering()){this.menu.options=this.filteredOptions}else if(!this.hasTimedOut&&!this.loading&&!((t=this.noOptions)===null||t===void 0?void 0:t.length)&&(!this.searchable||this.searchableMenuItemSelected)){this.noOptions=null;this.menu.options=this.uniqueOptions}}if(i.detail!==0){this.menu.handleClickOpen()}};this.handleExpandIconMouseDown=i=>{if(!this.disabled){i.preventDefault();this.searchableSelectElement.focus();this.handleClick(i)}};this.handleClear=i=>{i.stopPropagation();this.hasTimedOut=false;clearTimeout(this.timeoutTimer);this.noOptions=null;this.emitImmediateIcChange(null);this.icClear.emit();if(this.searchable){this.searchableSelectElement.value=null;this.searchableSelectInputValue=null;this.filteredOptions=this.uniqueOptions;this.hiddenInputValue=null;this.searchableSelectElement.focus()}else{this.customSelectElement.focus()}};this.handleCharacterKeyDown=i=>{if(this.open&&i===" "&&this.pressedCharacters.length===0&&!this.hasTimedOut&&!this.loading){this.setMenuChange(false)}if(i.length===1&&!this.searchable){window.clearTimeout(this.characterKeyPressTimer);this.characterKeyPressTimer=window.setTimeout((()=>this.pressedCharacters=""),1e3);this.pressedCharacters+=i;this.handleFilter();if(!this.noOptions){this.emitImmediateIcChange(this.filteredOptions[0].value)}}else{this.pressedCharacters=""}};this.handleNativeSelectKeyDown=i=>{if(i.key!=="Escape"&&i.key!=="Tab"||this.open){i.cancelBubble=true}this.handleCharacterKeyDown(i.key)};this.handleKeyDown=i=>{if(i.key!=="Escape"&&i.key!=="Tab"||this.open){i.cancelBubble=true}const t=i.key==="ArrowDown"||i.key==="ArrowUp";if(!this.open){if(this.isExternalFiltering()&&(i.key==="Enter"||t)){this.menu.options=this.filteredOptions}else{if(!this.hasTimedOut){this.noOptions=null;this.menu.options=this.uniqueOptions}}}if(this.open&&i.key==="Enter"){this.setMenuChange(false)}else{if(!(t&&this.noOptions!==null)){if(!(i.key===" "&&this.pressedCharacters.length>0)){this.menu.handleKeyboardOpen(i)}this.handleCharacterKeyDown(i.key)}}};this.handleClearButtonFocus=()=>{this.clearButtonFocused=true};this.handleClearButtonBlur=i=>{var t;const s=(t=this.menu)===null||t===void 0?void 0:t.querySelector("#retry-button");if(!(this.searchableSelectElement&&i.relatedTarget===this.searchableSelectElement)&&!(s&&i.relatedTarget===s)){this.setMenuChange(false);this.handleFocusIndicatorDisplay()}this.clearButtonFocused=false};this.handleFilter=()=>{var i;const t=this.deduplicateOptions(this.searchable?[...this.uniqueOptions]:this.ungroupedOptions);let s=false;let e=[];t.map((i=>{if(i.children)s=true}));let h;if(this.searchable){h=n(t,this.includeDescriptionsInSearch,this.inputValueToFilter,this.searchMatchPosition);this.searchableMenuItemSelected=false}else{h=n(t,false,this.pressedCharacters,"start")}if(!s&&((i=h[0])===null||i===void 0?void 0:i.label)!==this.emptyOptionListText){e=h}else if(s){t.map((i=>{if(this.includeGroupTitlesInSearch){if(h.indexOf(i)!==-1){e.push(i)}else{e.push(this.getFilteredChildMenuOptions(i))}}else{e.push(this.getFilteredChildMenuOptions(i))}}))}let a=false;if(s){a=true;e.map((i=>{if(i.children.length>0){a=false}}))}if(e.length>0&&!a){this.noOptions=null;this.filteredOptions=e}else{this.noOptions=[{label:this.emptyOptionListText,value:""}];this.filteredOptions=this.noOptions}};this.triggerLoading=()=>{this.hasTimedOut=false;this.noOptions=[{label:this.loadingLabel,value:"",loading:true}];if(this.filteredOptions!==this.noOptions&&this.searchable){this.filteredOptions=this.noOptions}else if(this.uniqueOptions!==this.noOptions&&!this.searchable){this.uniqueOptions=this.noOptions}if(this.timeout){this.timeoutTimer=window.setTimeout((()=>{this.loading=false;this.hasTimedOut=true;this.noOptions=[{label:this.loadingErrorLabel,value:"",timedOut:true}];this.filteredOptions=this.noOptions;if(!this.searchable)this.uniqueOptions=this.noOptions}),this.timeout)}};this.getValueFromLabel=i=>{var t;return(t=this.uniqueOptions.find((t=>t.label===i)))===null||t===void 0?void 0:t.value};this.handleSearchableSelectInput=i=>{this.searchableSelectInputValue=i.target.value;this.icInput.emit({value:this.searchableSelectInputValue});this.emitIcChange(this.searchableSelectInputValue);this.hiddenInputValue=this.searchableSelectInputValue;this.inputValueToFilter=this.searchableSelectInputValue;this.setMenuChange(true);if(!this.disableFilter){this.handleFilter();this.debounceAriaLiveUpdate()}};this.updateSearchableSelectResultAriaLive=()=>{const i=this.el.shadowRoot.querySelector(".searchable-select-results-status");if(i){if(this.noOptions!==null){i.innerText=this.emptyOptionListText}else{i.innerText=""}}};this.getDefaultValue=i=>this.getLabelFromValue(i)||i||null;this.onFocus=()=>{this.icFocus.emit()};this.onBlur=i=>{var t;const s=i.relatedTarget;if(s!==null&&s.tagName==="UL"&&s.className.includes("menu")){return}const e=(t=this.menu)===null||t===void 0?void 0:t.querySelector("#retry-button");const h=this.searchable&&i.relatedTarget!==this.menu&&!Array.from(this.menu.querySelectorAll("[role='option']")).includes(i.relatedTarget)&&!(this.clearButton&&i.relatedTarget===this.clearButton)&&!(e&&i.relatedTarget===e);if(h){if(!this.retryButtonClick){this.setMenuChange(false)}this.handleFocusIndicatorDisplay()}this.retryButtonClick=false;this.icBlur.emit()};this.onTimeoutBlur=i=>{if(i.detail.ev.relatedTarget!==this.searchableSelectElement&&!this.blurredBecauseButtonPressed){this.setMenuChange(false);this.handleFocusIndicatorDisplay();this.icBlur.emit()}this.blurredBecauseButtonPressed=false};this.handleFormReset=()=>{this.value=this.initialValue;if(this.searchable){this.searchableSelectInputValue=this.getDefaultValue(this.value);this.hiddenInputValue=this.value}};this.ariaActiveDescendant=undefined;this.clearButtonFocused=false;this.debounceIcChange=undefined;this.hiddenInputValue=undefined;this.noOptions=null;this.open=false;this.pressedCharacters="";this.searchableSelectInputValue=null;this.charactersUntilSuggestions=0;this.disabled=false;this.disableFilter=false;this.emptyOptionListText="No results found";this.form=undefined;this.formaction=undefined;this.formenctype=undefined;this.formmethod=undefined;this.formnovalidate=undefined;this.formtarget=undefined;this.fullWidth=false;this.helperText="";this.hideLabel=false;this.includeDescriptionsInSearch=false;this.includeGroupTitlesInSearch=false;this.label=undefined;this.loadingErrorLabel="Loading Error";this.loadingLabel="Loading...";this.name=this.inputId;this.placeholder="Select an option";this.readonly=false;this.required=false;this.searchable=false;this.searchMatchPosition="anywhere";this.selectOnEnter=false;this.showClearButton=false;this.size="default";this.small=false;this.timeout=undefined;this.validationStatus="";this.validationText="";this.loading=false;this.options=[];this.filteredOptions=this.options;this.uniqueOptions=this.options;this.debounce=0;this.currDebounce=this.debounce;this.value=undefined;this.initialValue=this.value;this.inputValueToFilter=this.value;this.currValue=this.value}loadingHandler(i){i&&this.triggerLoading()}watchOptionsHandler(){if(!this.hasTimedOut){this.loading=false;clearTimeout(this.timeoutTimer);if(this.isExternalFiltering()){if(this.options.length>0){this.setOptionsValuesFromLabels();this.noOptions=null;this.uniqueOptions=this.deduplicateOptions(this.options);this.filteredOptions=this.uniqueOptions}else{this.noOptions=[{label:this.emptyOptionListText,value:""}];this.uniqueOptions=this.noOptions;this.filteredOptions=this.noOptions}this.updateSearchableSelectResultAriaLive();this.setDefaultValue()}else{this.setOptionsValuesFromLabels();this.uniqueOptions=this.deduplicateOptions(this.options);this.filteredOptions=this.uniqueOptions;if(this.initialOptionsEmpty){this.setDefaultValue();this.initialOptionsEmpty=false}}}else{if(!this.searchable)this.options=this.noOptions}}debounceChangedHandler(i){this.updateOnChangeDebounce(i)}valueChangedHandler(){if(this.value!==this.currValue){this.currValue=this.value}if(this.searchable){this.searchableSelectInputValue=this.getLabelFromValue(this.currValue)||this.currValue}}disconnectedCallback(){o(this.el,this.handleFormReset)}componentWillLoad(){this.inheritedAttributes=l(this.el,[...v,"tabindex","title"]);r(this.disabled,this.el);this.setOptionsValuesFromLabels();c(this.el,this.handleFormReset);if(!this.options.length){this.initialOptionsEmpty=true;this.noOptions=[{label:this.emptyOptionListText,value:""}];this.uniqueOptions=this.noOptions;this.filteredOptions=this.noOptions}else{this.setDefaultValue();this.uniqueOptions=this.deduplicateOptions(this.options)}}componentDidLoad(){d([{prop:this.label,propName:"label"}],"Select");if(this.loading){this.triggerLoading()}this.hiddenInputValue=this.searchable&&this.currValue}componentDidRender(){if(this.nativeSelectElement&&!this.disabled){this.setTextColor()}}async setFocus(){if(this.nativeSelectElement){this.nativeSelectElement.focus()}else if(this.customSelectElement){this.customSelectElement.focus()}else if(this.searchableSelectElement){this.searchableSelectElement.focus()}}updateOnChangeDebounce(i){if(this.currDebounce!==i){this.currDebounce=i}}debounceAriaLiveUpdate(){clearTimeout(this.debounceAria);window.setTimeout((()=>{this.updateSearchableSelectResultAriaLive()}),800)}setDefaultValue(){if(!this.hasSetDefaultValue&&this.currValue){this.searchableSelectInputValue=this.getDefaultValue(this.currValue);this.initialValue=this.currValue;this.hasSetDefaultValue=true}}render(){const{small:i,size:t,disabled:h,fullWidth:a,helperText:n,hideLabel:o,label:l,menuId:r,name:c,options:d,placeholder:v,readonly:y,required:k,searchable:z,showClearButton:L,validationStatus:C,validationText:M,currValue:T}=this;u(true,this.el,c,this.searchable?this.hiddenInputValue:T,h);const B=C===g.Error?"true":"false";const H=p(this.inputId,n!=="",f(this.validationStatus,this.disabled)).trim();return s(e,{class:{disabled:h,searchable:z,small:i||t==="small","full-width":a},onBlur:this.onBlur},s("ic-input-container",{readonly:y},!o&&s("ic-input-label",{for:this.inputId,label:l,helperText:n,required:k,disabled:h,readonly:y}),s("ic-input-component-container",{ref:i=>this.anchorEl=i,class:{"menu-open":this.open},small:i||t==="small",fullWidth:a,disabled:h,readonly:y,validationStatus:C},y?s("ic-typography",null,s("p",null,this.getLabelFromValue(T))):b()?s("select",Object.assign({ref:i=>this.nativeSelectElement=i,disabled:h,onChange:this.handleNativeSelectChange,required:k,id:this.inputId,"aria-label":l,"aria-describedby":H,"aria-invalid":B,onBlur:this.onBlur,onFocus:this.onFocus,onKeyDown:this.handleNativeSelectKeyDown,form:this.form},this.inheritedAttributes),s("option",{value:"",selected:true,disabled:!L},v),d.map((i=>{if(i.children){return s("optgroup",{label:i.label},i.children.map((i=>s("option",{value:i.value,disabled:i.disabled,selected:i.value===T},i.label))))}else{return s("option",{value:i.value,disabled:i.disabled,selected:i.value===T},i.label)}}))):z?s("div",{class:"searchable-select-container"},s("input",{class:"select-input",role:"combobox",autocomplete:"off","aria-label":l,"aria-describedby":H,"aria-activedescendant":this.ariaActiveDescendant,"aria-autocomplete":"list","aria-expanded":this.open?"true":"false","aria-invalid":B,"aria-required":k?"true":"false","aria-controls":r,ref:i=>this.searchableSelectElement=i,id:this.inputId,value:this.searchableSelectInputValue,placeholder:v,disabled:h,onInput:this.handleSearchableSelectInput,onClick:this.handleClick,onKeyDown:this.handleKeyDown,onFocus:this.onFocus,onBlur:this.onBlur,form:this.form,formaction:this.formaction,formenctype:this.formenctype,formmethod:this.formmethod,formnovalidate:this.formnovalidate,formtarget:this.formtarget}),this.searchableSelectInputValue&&(L||z)&&s("div",{class:"clear-button-container"},s("ic-button",{id:"clear-button",ref:i=>this.clearButton=i,"aria-label":this.searchableSelectInputValue&&T===null?"Clear input":"Clear selection",class:"clear-button",innerHTML:x,onClick:this.handleClear,onFocus:this.handleClearButtonFocus,onBlur:this.handleClearButtonBlur,size:t,variant:"icon",appearance:this.clearButtonFocused?m.Light:m.Dark}),s("div",{class:"divider"})),s("span",{onMouseDown:this.handleExpandIconMouseDown,class:{"expand-icon":true,"expand-icon-open":this.open,"expand-icon-filled":!(T==null||T==="")},innerHTML:w,"aria-hidden":"true"}),s("div",{"aria-live":"polite",role:"status",class:"searchable-select-results-status"})):s("div",{class:"select-container"},s("button",{class:"select-input",ref:i=>this.customSelectElement=i,id:this.inputId,"aria-label":`${l}, ${this.getLabelFromValue(T)||v}${k?", required":""}`,"aria-describedby":H,"aria-invalid":B,"aria-haspopup":"listbox","aria-expanded":this.open?"true":"false","aria-owns":r,"aria-controls":r,disabled:h,onBlur:this.onBlur,onFocus:this.onFocus,onClick:this.handleClick,onMouseDown:this.handleMouseDown,onKeyDown:this.handleKeyDown},s("ic-typography",{variant:"body",class:{"value-text":true,placeholder:this.getLabelFromValue(T)===undefined}},s("p",null,this.getLabelFromValue(T)||v)),s("div",{class:"select-input-end"},T&&L&&s("div",{class:"divider"}),s("span",{class:{"expand-icon":true,"expand-icon-open":this.open,"expand-icon-filled":!(T==null||T==="")},innerHTML:w,"aria-hidden":"true"}))),T&&L&&s("ic-button",{id:"clear-button","aria-label":"Clear selection",class:"clear-button",innerHTML:x,onClick:this.handleClear,onFocus:this.handleClearButtonFocus,onBlur:this.handleClearButtonBlur,size:t,variant:"icon",appearance:this.clearButtonFocused?m.Light:m.Dark}))),!b()&&s("ic-menu",{class:{"no-results":this.loading||this.hasTimedOut||this.noOptions!==null&&this.noOptions[0]&&this.noOptions[0].label===this.emptyOptionListText},ref:i=>this.menu=i,inputEl:z?this.searchableSelectElement:this.customSelectElement,inputLabel:l,anchorEl:this.anchorEl,small:i||t==="small",menuId:r,open:this.open,options:z?this.filteredOptions:this.uniqueOptions,value:T,fullWidth:a,selectOnEnter:this.selectOnEnter,onMenuStateChange:this.handleMenuChange,onMenuOptionSelect:this.handleCustomSelectChange,onMenuKeyPress:this.handleMenuKeyPress,onMenuValueChange:this.handleMenuValueChange,onUngroupedOptionsSet:this.setUngroupedOptions,onRetryButtonClicked:this.handleRetry,parentEl:this.el,onTimeoutBlur:this.onTimeoutBlur,activationType:this.searchable||this.selectOnEnter?"manual":"automatic"}),f(this.validationStatus,this.disabled)&&s("ic-input-validation",{class:{"menu-open":this.open},ariaLiveMode:"polite",status:C,message:M,for:this.inputId})))}static get delegatesFocus(){return true}get el(){return h(this)}static get watchers(){return{loading:["loadingHandler"],options:["watchOptionsHandler"],debounce:["debounceChangedHandler"],value:["valueChangedHandler"]}}};z.style=y;export{z as ic_select};
|
|
2
|
-
//# sourceMappingURL=p-6bc431b2.entry.js.map
|