@ukic/web-components 2.15.0 → 2.16.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/helpers-3d0705ed.js.map +1 -1
- package/dist/cjs/ic-link.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-button.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-group.cjs.entry.js +15 -12
- package/dist/cjs/ic-navigation-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-item.cjs.entry.js +27 -31
- package/dist/cjs/ic-navigation-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-side-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-text-field.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-top-navigation.cjs.entry.js +45 -59
- package/dist/cjs/ic-top-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/types-dc22e301.js.map +1 -1
- package/dist/collection/components/ic-link/ic-link.js.map +1 -1
- package/dist/collection/components/ic-navigation-button/ic-navigation-button.js.map +1 -1
- package/dist/collection/components/ic-navigation-group/ic-navigation-group.css +1 -0
- package/dist/collection/components/ic-navigation-group/ic-navigation-group.js +14 -11
- package/dist/collection/components/ic-navigation-group/ic-navigation-group.js.map +1 -1
- package/dist/collection/components/ic-navigation-item/ic-navigation-item.js +28 -32
- package/dist/collection/components/ic-navigation-item/ic-navigation-item.js.map +1 -1
- package/dist/collection/components/ic-side-navigation/ic-side-navigation.js.map +1 -1
- package/dist/collection/components/ic-text-field/ic-text-field.js.map +1 -1
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.css +21 -24
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.js +68 -59
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.js.map +1 -1
- package/dist/collection/utils/helpers.js.map +1 -1
- package/dist/collection/utils/types.js.map +1 -1
- package/dist/components/helpers.js.map +1 -1
- package/dist/components/ic-link2.js.map +1 -1
- package/dist/components/ic-navigation-button.js.map +1 -1
- package/dist/components/ic-navigation-group.js +15 -12
- package/dist/components/ic-navigation-group.js.map +1 -1
- package/dist/components/ic-navigation-item.js +28 -32
- package/dist/components/ic-navigation-item.js.map +1 -1
- package/dist/components/ic-side-navigation.js.map +1 -1
- package/dist/components/ic-text-field2.js.map +1 -1
- package/dist/components/ic-top-navigation.js +47 -61
- package/dist/components/ic-top-navigation.js.map +1 -1
- package/dist/components/types.js.map +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/p-2436d4bd.entry.js +2 -0
- package/dist/core/p-2436d4bd.entry.js.map +1 -0
- package/dist/core/p-268355c1.js.map +1 -1
- package/dist/core/p-26b7b18f.js.map +1 -1
- package/dist/core/p-2ed0232c.entry.js +2 -0
- package/dist/core/p-2ed0232c.entry.js.map +1 -0
- package/dist/core/p-8eb0e85f.entry.js +2 -0
- package/dist/core/p-8eb0e85f.entry.js.map +1 -0
- package/dist/core/p-a222554a.entry.js.map +1 -1
- package/dist/core/p-c2173562.entry.js.map +1 -1
- package/dist/core/p-f24084fa.entry.js.map +1 -1
- package/dist/core/p-fc91292d.entry.js.map +1 -1
- package/dist/esm/core.js +1 -1
- package/dist/esm/helpers-4262def4.js.map +1 -1
- package/dist/esm/ic-link.entry.js.map +1 -1
- package/dist/esm/ic-navigation-button.entry.js.map +1 -1
- package/dist/esm/ic-navigation-group.entry.js +15 -12
- package/dist/esm/ic-navigation-group.entry.js.map +1 -1
- package/dist/esm/ic-navigation-item.entry.js +28 -32
- package/dist/esm/ic-navigation-item.entry.js.map +1 -1
- package/dist/esm/ic-side-navigation.entry.js.map +1 -1
- package/dist/esm/ic-text-field.entry.js.map +1 -1
- package/dist/esm/ic-top-navigation.entry.js +46 -60
- package/dist/esm/ic-top-navigation.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/types-6f6b41a5.js.map +1 -1
- package/dist/types/components/ic-navigation-item/ic-navigation-item.d.ts +2 -2
- package/dist/types/components/ic-top-navigation/ic-top-navigation.d.ts +10 -5
- package/dist/types/components.d.ts +10 -2
- package/dist/types/utils/helpers.d.ts +6 -6
- package/dist/types/utils/types.d.ts +1 -0
- package/hydrate/index.js +88 -103
- package/package.json +2 -2
- package/vscode-data.json +4 -0
- package/dist/collection/components/ic-page-header/test/a11y/ic-page-header.test.a11y.js +0 -13
- package/dist/collection/components/ic-page-header/test/a11y/ic-page-header.test.a11y.js.map +0 -1
- package/dist/collection/components/ic-page-header/test/basic/ic-page-header.e2e.js +0 -177
- package/dist/collection/components/ic-page-header/test/basic/ic-page-header.e2e.js.map +0 -1
- package/dist/collection/components/ic-pagination/test/a11y/ic-pagination.test.a11y.js +0 -18
- package/dist/collection/components/ic-pagination/test/a11y/ic-pagination.test.a11y.js.map +0 -1
- package/dist/collection/components/ic-pagination/test/basic/ic-pagination.e2e.js +0 -128
- package/dist/collection/components/ic-pagination/test/basic/ic-pagination.e2e.js.map +0 -1
- package/dist/core/p-7cdea5bf.entry.js +0 -2
- package/dist/core/p-7cdea5bf.entry.js.map +0 -1
- package/dist/core/p-f58da6ae.entry.js +0 -2
- package/dist/core/p-f58da6ae.entry.js.map +0 -1
- package/dist/core/p-f7019830.entry.js +0 -2
- package/dist/core/p-f7019830.entry.js.map +0 -1
- package/dist/types/components/ic-page-header/test/a11y/ic-page-header.test.a11y.d.ts +0 -1
- package/dist/types/components/ic-pagination/test/a11y/ic-pagination.test.a11y.d.ts +0 -1
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import { newE2EPage } from "@stencil/core/testing";
|
|
2
|
-
describe("ic-page-header component", () => {
|
|
3
|
-
it("shouldn't render tooltips on the navigation items in the page header", async () => {
|
|
4
|
-
const page = await newE2EPage();
|
|
5
|
-
await page.setContent(`<ic-page-header
|
|
6
|
-
heading="Coffee recipes"
|
|
7
|
-
sub-heading="This is a page header component with additional functionality and this is the text."
|
|
8
|
-
>
|
|
9
|
-
<ic-status-tag slot="heading-adornment" label="Beta"></ic-status-tag>
|
|
10
|
-
<ic-navigation-item
|
|
11
|
-
slot="tabs"
|
|
12
|
-
label="All recipes"
|
|
13
|
-
href="?path=/story/web-components-page-header--with-tabs"
|
|
14
|
-
selected
|
|
15
|
-
></ic-navigation-item>
|
|
16
|
-
<ic-navigation-item
|
|
17
|
-
slot="tabs"
|
|
18
|
-
label="Favourites"
|
|
19
|
-
href="?path=/story/web-components-page-header--with-tabs"
|
|
20
|
-
></ic-navigation-item>
|
|
21
|
-
</ic-page-header>`);
|
|
22
|
-
await page.waitForChanges();
|
|
23
|
-
await page.keyboard.press("Tab");
|
|
24
|
-
await page.waitForChanges();
|
|
25
|
-
const tooltipDisplay = await page.evaluate(() => {
|
|
26
|
-
const tooltip = document
|
|
27
|
-
.querySelectorAll("ic-navigation-item")[0]
|
|
28
|
-
.shadowRoot.querySelector("ic-tooltip")
|
|
29
|
-
.shadowRoot.querySelector(".ic-tooltip-container");
|
|
30
|
-
return window.getComputedStyle(tooltip).display;
|
|
31
|
-
});
|
|
32
|
-
expect(tooltipDisplay).toBe("none");
|
|
33
|
-
});
|
|
34
|
-
it("should stay at the top of the page if the sticky variant is used", async () => {
|
|
35
|
-
const page = await newE2EPage();
|
|
36
|
-
await page.setContent(`<ic-top-navigation app-title="ApplicationName">
|
|
37
|
-
<svg
|
|
38
|
-
slot="app-icon"
|
|
39
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
40
|
-
height="24px"
|
|
41
|
-
viewBox="0 0 24 24"
|
|
42
|
-
width="24px"
|
|
43
|
-
fill="#000000"
|
|
44
|
-
>
|
|
45
|
-
<path d="M0 0h24v24H0V0z" fill="none" />
|
|
46
|
-
<path
|
|
47
|
-
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"
|
|
48
|
-
/>
|
|
49
|
-
</svg>
|
|
50
|
-
</ic-top-navigation>
|
|
51
|
-
<ic-page-header
|
|
52
|
-
sticky
|
|
53
|
-
heading="Page header"
|
|
54
|
-
sub-heading="This is a simple page header component and this is the text."
|
|
55
|
-
>
|
|
56
|
-
<ic-status-tag slot="heading-adornment" label="Beta"></ic-status-tag>
|
|
57
|
-
</ic-page-header>
|
|
58
|
-
<ic-section-container style="height:800px">
|
|
59
|
-
This is an example of how the sticky variant of the page header would
|
|
60
|
-
work with some content and the footer.
|
|
61
|
-
</ic-section-container>
|
|
62
|
-
<ic-footer
|
|
63
|
-
description="The ICDS is maintained by the Design Practice Team. If you've got a question or want to feedback,
|
|
64
|
-
please get in touch."
|
|
65
|
-
caption="All content is available under the Open Government Licence v3.0, except source code and code examples which are available under the MIT Licence."
|
|
66
|
-
>
|
|
67
|
-
<ic-footer-link slot="link" href="/">Get Started</ic-footer-link>
|
|
68
|
-
<ic-footer-link slot="link" href="/">Accessibility</ic-footer-link>
|
|
69
|
-
<ic-footer-link slot="link" href="/">Styles</ic-footer-link>
|
|
70
|
-
<ic-footer-link slot="link" href="/">Components</ic-footer-link>
|
|
71
|
-
<ic-footer-link slot="link" href="/">Patterns</ic-footer-link>
|
|
72
|
-
<ic-footer-link slot="link" href="/">Design toolkit</ic-footer-link>
|
|
73
|
-
<div
|
|
74
|
-
slot="logo"
|
|
75
|
-
style="width:100px;height:100px;display:flex;align-items:center;justify-content:center;
|
|
76
|
-
background-color:var(--ic-personality-primary);color:var(--ic-personality-text);"
|
|
77
|
-
>
|
|
78
|
-
Logo
|
|
79
|
-
</div>
|
|
80
|
-
</ic-footer>`);
|
|
81
|
-
await page.waitForChanges();
|
|
82
|
-
const pageHeaderPosition = await page.evaluate(() => {
|
|
83
|
-
const pageHeader = document.querySelector("ic-page-header");
|
|
84
|
-
return window.getComputedStyle(pageHeader).position;
|
|
85
|
-
});
|
|
86
|
-
expect(pageHeaderPosition).toBe("sticky");
|
|
87
|
-
const pageHeaderTopValue = await page.evaluate(() => {
|
|
88
|
-
const pageHeader = document.querySelector("ic-page-header");
|
|
89
|
-
window.scrollTo({ top: 700 });
|
|
90
|
-
return pageHeader.offsetTop;
|
|
91
|
-
});
|
|
92
|
-
expect(pageHeaderTopValue).toEqual(700);
|
|
93
|
-
});
|
|
94
|
-
it("should not stay at the top of the page on extra small to medium device sizes if the sticky-desktop-only variant is used", async () => {
|
|
95
|
-
const page = await newE2EPage();
|
|
96
|
-
await page.setViewport({
|
|
97
|
-
width: 375,
|
|
98
|
-
height: 667,
|
|
99
|
-
isMobile: true,
|
|
100
|
-
hasTouch: true,
|
|
101
|
-
});
|
|
102
|
-
await page.waitForChanges();
|
|
103
|
-
await page.setContent(`<ic-top-navigation app-title="ApplicationName">
|
|
104
|
-
<svg
|
|
105
|
-
slot="app-icon"
|
|
106
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
107
|
-
height="24px"
|
|
108
|
-
viewBox="0 0 24 24"
|
|
109
|
-
width="24px"
|
|
110
|
-
fill="#000000"
|
|
111
|
-
>
|
|
112
|
-
<path d="M0 0h24v24H0V0z" fill="none" />
|
|
113
|
-
<path
|
|
114
|
-
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"
|
|
115
|
-
/>
|
|
116
|
-
</svg>
|
|
117
|
-
</ic-top-navigation>
|
|
118
|
-
<ic-page-header
|
|
119
|
-
sticky-desktop-only
|
|
120
|
-
heading="Page header"
|
|
121
|
-
sub-heading="This is a simple page header component and this is the text. This page header is only sticky for viewport widths of 992px and above."
|
|
122
|
-
>
|
|
123
|
-
<ic-status-tag slot="heading-adornment" label="Beta"></ic-status-tag>
|
|
124
|
-
</ic-page-header>
|
|
125
|
-
<ic-section-container style="height:1000px">
|
|
126
|
-
This is an example of how the sticky-desktop-only variant of the page
|
|
127
|
-
header would work with some content and the footer.
|
|
128
|
-
</ic-section-container>
|
|
129
|
-
<ic-footer
|
|
130
|
-
description="The ICDS is maintained by the Design Practice Team. If you've got a question or want to feedback,
|
|
131
|
-
please get in touch."
|
|
132
|
-
caption="All content is available under the Open Government Licence v3.0, except source code and code examples which are available under the MIT Licence."
|
|
133
|
-
>
|
|
134
|
-
<ic-footer-link slot="link" href="/">Get Started</ic-footer-link>
|
|
135
|
-
<ic-footer-link slot="link" href="/">Accessibility</ic-footer-link>
|
|
136
|
-
<ic-footer-link slot="link" href="/">Styles</ic-footer-link>
|
|
137
|
-
<ic-footer-link slot="link" href="/">Components</ic-footer-link>
|
|
138
|
-
<ic-footer-link slot="link" href="/">Patterns</ic-footer-link>
|
|
139
|
-
<ic-footer-link slot="link" href="/">Design toolkit</ic-footer-link>
|
|
140
|
-
<div
|
|
141
|
-
slot="logo"
|
|
142
|
-
style="width:100px;height:100px;display:flex;align-items:center;justify-content:center;
|
|
143
|
-
background-color:var(--ic-personality-primary);color:var(--ic-personality-text);"
|
|
144
|
-
>
|
|
145
|
-
Logo
|
|
146
|
-
</div>
|
|
147
|
-
</ic-footer>`);
|
|
148
|
-
await page.waitForChanges();
|
|
149
|
-
let pageHeaderPosition = await page.evaluate(() => {
|
|
150
|
-
const pageHeader = document.querySelector("ic-page-header");
|
|
151
|
-
return window.getComputedStyle(pageHeader).position;
|
|
152
|
-
});
|
|
153
|
-
expect(pageHeaderPosition).toBe("static");
|
|
154
|
-
await page.evaluate(() => {
|
|
155
|
-
window.scrollBy({ top: -700 });
|
|
156
|
-
});
|
|
157
|
-
await page.waitForChanges();
|
|
158
|
-
await page.setViewport({
|
|
159
|
-
width: 1920,
|
|
160
|
-
height: 800,
|
|
161
|
-
});
|
|
162
|
-
await page.waitForChanges();
|
|
163
|
-
pageHeaderPosition = await page.evaluate(() => {
|
|
164
|
-
const pageHeader = document.querySelector("ic-page-header");
|
|
165
|
-
return window.getComputedStyle(pageHeader).position;
|
|
166
|
-
});
|
|
167
|
-
await page.waitForChanges();
|
|
168
|
-
expect(pageHeaderPosition).toBe("sticky");
|
|
169
|
-
const pageHeaderTopValueOnLargeDesktops = await page.evaluate(() => {
|
|
170
|
-
const pageHeader = document.querySelector("ic-page-header");
|
|
171
|
-
window.scrollBy({ top: 700 });
|
|
172
|
-
return pageHeader.offsetTop;
|
|
173
|
-
});
|
|
174
|
-
expect(pageHeaderTopValueOnLargeDesktops).toEqual(700);
|
|
175
|
-
});
|
|
176
|
-
});
|
|
177
|
-
//# sourceMappingURL=ic-page-header.e2e.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ic-page-header.e2e.js","sourceRoot":"","sources":["../../../../../src/components/ic-page-header/test/basic/ic-page-header.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,sEAAsE,EAAE,KAAK,IAAI,EAAE;QACpF,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;QAEhC,MAAM,IAAI,CAAC,UAAU,CACnB;;;;;;;;;;;;;;;;wBAgBkB,CACnB,CAAC;QAEF,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAE5B,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAEjC,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAE5B,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GA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AM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;YAC5D,OAAO,MAAM,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC;QACtD,CAAC,CAAC,CAAC;QAEH,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAE5B,MAAM,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAE1C,MAAM,iCAAiC,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE;YACjE,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;YAC5D,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;YAE9B,OAAO,UAAU,CAAC,SAAS,CAAC;QAC9B,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,iCAAiC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from \"@stencil/core/testing\";\n\ndescribe(\"ic-page-header component\", () => {\n it(\"shouldn't render tooltips on the navigation items in the page header\", async () => {\n const page = await newE2EPage();\n\n await page.setContent(\n `<ic-page-header\n heading=\"Coffee recipes\"\n sub-heading=\"This is a page header component with additional functionality and this is the text.\"\n >\n <ic-status-tag slot=\"heading-adornment\" label=\"Beta\"></ic-status-tag>\n <ic-navigation-item\n slot=\"tabs\"\n label=\"All recipes\"\n href=\"?path=/story/web-components-page-header--with-tabs\"\n selected\n ></ic-navigation-item>\n <ic-navigation-item\n slot=\"tabs\"\n label=\"Favourites\"\n href=\"?path=/story/web-components-page-header--with-tabs\"\n ></ic-navigation-item>\n </ic-page-header>`\n );\n\n await page.waitForChanges();\n\n await page.keyboard.press(\"Tab\");\n\n await page.waitForChanges();\n\n const tooltipDisplay = await page.evaluate(() => {\n const tooltip = document\n .querySelectorAll(\"ic-navigation-item\")[0]\n .shadowRoot.querySelector(\"ic-tooltip\")\n .shadowRoot.querySelector(\".ic-tooltip-container\");\n\n return window.getComputedStyle(tooltip).display;\n });\n\n expect(tooltipDisplay).toBe(\"none\");\n });\n\n it(\"should stay at the top of the page if the sticky variant is used\", async () => {\n const page = await newE2EPage();\n\n await page.setContent(\n `<ic-top-navigation app-title=\"ApplicationName\">\n <svg\n slot=\"app-icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"#000000\"\n >\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path\n d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z\"\n />\n </svg>\n </ic-top-navigation>\n <ic-page-header\n sticky\n heading=\"Page header\"\n sub-heading=\"This is a simple page header component and this is the text.\"\n >\n <ic-status-tag slot=\"heading-adornment\" label=\"Beta\"></ic-status-tag>\n </ic-page-header>\n <ic-section-container style=\"height:800px\">\n This is an example of how the sticky variant of the page header would\n work with some content and the footer.\n </ic-section-container>\n <ic-footer\n description=\"The ICDS is maintained by the Design Practice Team. If you've got a question or want to feedback, \n please get in touch.\"\n caption=\"All content is available under the Open Government Licence v3.0, except source code and code examples which are available under the MIT Licence.\"\n >\n <ic-footer-link slot=\"link\" href=\"/\">Get Started</ic-footer-link>\n <ic-footer-link slot=\"link\" href=\"/\">Accessibility</ic-footer-link>\n <ic-footer-link slot=\"link\" href=\"/\">Styles</ic-footer-link>\n <ic-footer-link slot=\"link\" href=\"/\">Components</ic-footer-link>\n <ic-footer-link slot=\"link\" href=\"/\">Patterns</ic-footer-link>\n <ic-footer-link slot=\"link\" href=\"/\">Design toolkit</ic-footer-link>\n <div\n slot=\"logo\"\n style=\"width:100px;height:100px;display:flex;align-items:center;justify-content:center;\n background-color:var(--ic-personality-primary);color:var(--ic-personality-text);\"\n >\n Logo\n </div>\n </ic-footer>`\n );\n\n await page.waitForChanges();\n\n const pageHeaderPosition = await page.evaluate(() => {\n const pageHeader = document.querySelector(\"ic-page-header\");\n\n return window.getComputedStyle(pageHeader).position;\n });\n\n expect(pageHeaderPosition).toBe(\"sticky\");\n\n const pageHeaderTopValue = await page.evaluate(() => {\n const pageHeader = document.querySelector(\"ic-page-header\");\n window.scrollTo({ top: 700 });\n\n return pageHeader.offsetTop;\n });\n\n expect(pageHeaderTopValue).toEqual(700);\n });\n\n it(\"should not stay at the top of the page on extra small to medium device sizes if the sticky-desktop-only variant is used\", async () => {\n const page = await newE2EPage();\n\n await page.setViewport({\n width: 375,\n height: 667,\n isMobile: true,\n hasTouch: true,\n });\n\n await page.waitForChanges();\n\n await page.setContent(\n `<ic-top-navigation app-title=\"ApplicationName\">\n <svg\n slot=\"app-icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"#000000\"\n >\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path\n d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z\"\n />\n </svg>\n </ic-top-navigation>\n <ic-page-header\n sticky-desktop-only\n heading=\"Page header\"\n sub-heading=\"This is a simple page header component and this is the text. This page header is only sticky for viewport widths of 992px and above.\"\n >\n <ic-status-tag slot=\"heading-adornment\" label=\"Beta\"></ic-status-tag>\n </ic-page-header>\n <ic-section-container style=\"height:1000px\">\n This is an example of how the sticky-desktop-only variant of the page\n header would work with some content and the footer.\n </ic-section-container>\n <ic-footer\n description=\"The ICDS is maintained by the Design Practice Team. If you've got a question or want to feedback, \n please get in touch.\"\n caption=\"All content is available under the Open Government Licence v3.0, except source code and code examples which are available under the MIT Licence.\"\n >\n <ic-footer-link slot=\"link\" href=\"/\">Get Started</ic-footer-link>\n <ic-footer-link slot=\"link\" href=\"/\">Accessibility</ic-footer-link>\n <ic-footer-link slot=\"link\" href=\"/\">Styles</ic-footer-link>\n <ic-footer-link slot=\"link\" href=\"/\">Components</ic-footer-link>\n <ic-footer-link slot=\"link\" href=\"/\">Patterns</ic-footer-link>\n <ic-footer-link slot=\"link\" href=\"/\">Design toolkit</ic-footer-link>\n <div\n slot=\"logo\"\n style=\"width:100px;height:100px;display:flex;align-items:center;justify-content:center;\n background-color:var(--ic-personality-primary);color:var(--ic-personality-text);\"\n >\n Logo\n </div>\n </ic-footer>`\n );\n\n await page.waitForChanges();\n\n let pageHeaderPosition = await page.evaluate(() => {\n const pageHeader = document.querySelector(\"ic-page-header\");\n return window.getComputedStyle(pageHeader).position;\n });\n\n expect(pageHeaderPosition).toBe(\"static\");\n\n await page.evaluate(() => {\n window.scrollBy({ top: -700 });\n });\n\n await page.waitForChanges();\n\n await page.setViewport({\n width: 1920,\n height: 800,\n });\n\n await page.waitForChanges();\n\n pageHeaderPosition = await page.evaluate(() => {\n const pageHeader = document.querySelector(\"ic-page-header\");\n return window.getComputedStyle(pageHeader).position;\n });\n\n await page.waitForChanges();\n\n expect(pageHeaderPosition).toBe(\"sticky\");\n\n const pageHeaderTopValueOnLargeDesktops = await page.evaluate(() => {\n const pageHeader = document.querySelector(\"ic-page-header\");\n window.scrollBy({ top: 700 });\n\n return pageHeader.offsetTop;\n });\n\n expect(pageHeaderTopValueOnLargeDesktops).toEqual(700);\n });\n});\n"]}
|
|
@@ -1,18 +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("pagination component", () => {
|
|
5
|
-
it("passes accessibility", async () => {
|
|
6
|
-
const el = await fixture(`<ic-pagination pages="3" />`);
|
|
7
|
-
checkShadowElementRendersCorrectly(el);
|
|
8
|
-
expect(await axe(el, {
|
|
9
|
-
// Tested in Cypress and this error doesn't occur, not sure what's causing it in this test
|
|
10
|
-
rules: {
|
|
11
|
-
"aria-valid-attr-value": {
|
|
12
|
-
enabled: false,
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
})).toHaveNoViolations();
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
//# sourceMappingURL=ic-pagination.test.a11y.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ic-pagination.test.a11y.js","sourceRoot":"","sources":["../../../../../src/components/ic-pagination/test/a11y/ic-pagination.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,sBAAsB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,6BAA6B,CAAC,CAAC;QACxD,kCAAkC,CAAC,EAAE,CAAC,CAAC;QACvC,MAAM,CACJ,MAAM,GAAG,CAAC,EAAE,EAAE;YACZ,0FAA0F;YAC1F,KAAK,EAAE;gBACL,uBAAuB,EAAE;oBACvB,OAAO,EAAE,KAAK;iBACf;aACF;SACF,CAAC,CACH,CAAC,kBAAkB,EAAE,CAAC;IACzB,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(\"pagination component\", () => {\n it(\"passes accessibility\", async () => {\n const el = await fixture(`<ic-pagination pages=\"3\" />`);\n checkShadowElementRendersCorrectly(el);\n expect(\n await axe(el, {\n // Tested in Cypress and this error doesn't occur, not sure what's causing it in this test\n rules: {\n \"aria-valid-attr-value\": {\n enabled: false,\n },\n },\n })\n ).toHaveNoViolations();\n });\n});\n"]}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { newE2EPage } from "@stencil/core/testing";
|
|
2
|
-
describe("ic-pagination", () => {
|
|
3
|
-
it("should emit the correct page value when `page 2` is clicked", async () => {
|
|
4
|
-
const page = await newE2EPage();
|
|
5
|
-
await page.setContent(`<ic-pagination pages="15"
|
|
6
|
-
type="complex"
|
|
7
|
-
adjacent-count="1"
|
|
8
|
-
boundary-count="1" />`);
|
|
9
|
-
const pagItem = await page.find("ic-pagination >>> #pagination-item-2");
|
|
10
|
-
const icPageChange = await page.spyOnEvent("icPageChange");
|
|
11
|
-
await page.waitForChanges();
|
|
12
|
-
await pagItem.click();
|
|
13
|
-
await page.waitForChanges();
|
|
14
|
-
expect(icPageChange).toHaveReceivedEventDetail({ value: 2 });
|
|
15
|
-
});
|
|
16
|
-
it("should emit the correct page value when `next page` is clicked", async () => {
|
|
17
|
-
const page = await newE2EPage();
|
|
18
|
-
await page.setContent(`<ic-pagination pages="15"
|
|
19
|
-
type="complex"
|
|
20
|
-
adjacent-count="1"
|
|
21
|
-
boundary-count="1" />`);
|
|
22
|
-
const nextPage = await page.find("ic-pagination >>> #next-page-button");
|
|
23
|
-
const icPageChange = await page.spyOnEvent("icPageChange");
|
|
24
|
-
await page.waitForChanges();
|
|
25
|
-
await nextPage.click();
|
|
26
|
-
await page.waitForChanges();
|
|
27
|
-
expect(icPageChange).toHaveReceivedEventDetail({ value: 2 });
|
|
28
|
-
});
|
|
29
|
-
it("should emit the correct page value when `page 13` is clicked", async () => {
|
|
30
|
-
const page = await newE2EPage();
|
|
31
|
-
await page.setContent(`<ic-pagination pages="15"
|
|
32
|
-
type="complex"
|
|
33
|
-
adjacent-count="1"
|
|
34
|
-
boundary-count="1" />`);
|
|
35
|
-
const lastPage = await page.find("ic-pagination >>> #last-page-button");
|
|
36
|
-
const icPageChange = await page.spyOnEvent("icPageChange");
|
|
37
|
-
await page.waitForChanges();
|
|
38
|
-
await lastPage.click();
|
|
39
|
-
await page.waitForChanges();
|
|
40
|
-
const pagItem = await page.find("ic-pagination >>> #pagination-item-13");
|
|
41
|
-
await page.waitForChanges();
|
|
42
|
-
await pagItem.click();
|
|
43
|
-
await page.waitForChanges();
|
|
44
|
-
expect(icPageChange).toHaveReceivedEventDetail({ value: 13 });
|
|
45
|
-
});
|
|
46
|
-
it("should emit the correct page value when the `previous page` button is clicked", async () => {
|
|
47
|
-
const page = await newE2EPage();
|
|
48
|
-
await page.setContent(`<ic-pagination pages="15"
|
|
49
|
-
type="complex"
|
|
50
|
-
adjacent-count="1"
|
|
51
|
-
boundary-count="1" />`);
|
|
52
|
-
const lastPage = await page.find("ic-pagination >>> #last-page-button");
|
|
53
|
-
const icPageChange = await page.spyOnEvent("icPageChange");
|
|
54
|
-
await page.waitForChanges();
|
|
55
|
-
await lastPage.click();
|
|
56
|
-
await page.waitForChanges();
|
|
57
|
-
const previousPage = await page.find("ic-pagination >>> #previous-page-button");
|
|
58
|
-
await page.waitForChanges();
|
|
59
|
-
await previousPage.click();
|
|
60
|
-
await page.waitForChanges();
|
|
61
|
-
expect(icPageChange).toHaveReceivedEventDetail({ value: 14 });
|
|
62
|
-
});
|
|
63
|
-
it("should emit the correct page value when the `first page` button is clicked", async () => {
|
|
64
|
-
const page = await newE2EPage();
|
|
65
|
-
await page.setContent(`<ic-pagination pages="15"
|
|
66
|
-
type="complex"
|
|
67
|
-
adjacent-count="1"
|
|
68
|
-
boundary-count="1" />`);
|
|
69
|
-
const lastPage = await page.find("ic-pagination >>> #last-page-button");
|
|
70
|
-
const icPageChange = await page.spyOnEvent("icPageChange");
|
|
71
|
-
await page.waitForChanges();
|
|
72
|
-
await lastPage.click();
|
|
73
|
-
await page.waitForChanges();
|
|
74
|
-
const previousPage = await page.find("ic-pagination >>> #first-page-button");
|
|
75
|
-
await page.waitForChanges();
|
|
76
|
-
await previousPage.click();
|
|
77
|
-
await page.waitForChanges();
|
|
78
|
-
expect(icPageChange).toHaveReceivedEventDetail({ value: 1 });
|
|
79
|
-
});
|
|
80
|
-
it("should emit the correct page value when the midddle state is reached and the adjacent-count `page 7` button is clicked", async () => {
|
|
81
|
-
const page = await newE2EPage();
|
|
82
|
-
await page.setContent(`<ic-pagination pages="15"
|
|
83
|
-
type="complex"
|
|
84
|
-
adjacent-count="1"
|
|
85
|
-
boundary-count="1" />`);
|
|
86
|
-
const nextPage = await page.find("ic-pagination >>> #next-page-button");
|
|
87
|
-
const icPageChange = await page.spyOnEvent("icPageChange");
|
|
88
|
-
await page.waitForChanges();
|
|
89
|
-
await nextPage.click();
|
|
90
|
-
await page.waitForChanges();
|
|
91
|
-
await nextPage.click();
|
|
92
|
-
await page.waitForChanges();
|
|
93
|
-
await nextPage.click();
|
|
94
|
-
await page.waitForChanges();
|
|
95
|
-
await nextPage.click();
|
|
96
|
-
await page.waitForChanges();
|
|
97
|
-
await nextPage.click();
|
|
98
|
-
await page.waitForChanges();
|
|
99
|
-
const pagItem = await page.find("ic-pagination >>> #pagination-item-7");
|
|
100
|
-
await page.waitForChanges();
|
|
101
|
-
await pagItem.click();
|
|
102
|
-
await page.waitForChanges();
|
|
103
|
-
expect(icPageChange).toHaveReceivedEventDetail({ value: 7 });
|
|
104
|
-
});
|
|
105
|
-
it("should return false when the midddle state is reached and the adjacent-count `page 8` (out of bounds) button is clicked", async () => {
|
|
106
|
-
const page = await newE2EPage();
|
|
107
|
-
await page.setContent(`<ic-pagination pages="15"
|
|
108
|
-
type="complex"
|
|
109
|
-
adjacent-count="1"
|
|
110
|
-
boundary-count="1" />`);
|
|
111
|
-
const nextPage = await page.find("ic-pagination >>> #next-page-button");
|
|
112
|
-
await page.waitForChanges();
|
|
113
|
-
await nextPage.click();
|
|
114
|
-
await page.waitForChanges();
|
|
115
|
-
await nextPage.click();
|
|
116
|
-
await page.waitForChanges();
|
|
117
|
-
await nextPage.click();
|
|
118
|
-
await page.waitForChanges();
|
|
119
|
-
await nextPage.click();
|
|
120
|
-
await page.waitForChanges();
|
|
121
|
-
await nextPage.click();
|
|
122
|
-
await page.waitForChanges();
|
|
123
|
-
const pagItem = await page.find("ic-pagination >>> #pagination-item-8");
|
|
124
|
-
await page.waitForChanges();
|
|
125
|
-
expect(pagItem).toBe(null);
|
|
126
|
-
});
|
|
127
|
-
});
|
|
128
|
-
//# sourceMappingURL=ic-pagination.e2e.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ic-pagination.e2e.js","sourceRoot":"","sources":["../../../../../src/components/ic-pagination/test/basic/ic-pagination.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,6DAA6D,EAAE,KAAK,IAAI,EAAE;QAC3E,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;QAEhC,MAAM,IAAI,CAAC,UAAU,CAAC;;;0BAGA,CAAC,CAAC;QAExB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;QAExE,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;QAE3D,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAE5B,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;QAEtB,MAAM,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,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from \"@stencil/core/testing\";\n\ndescribe(\"ic-pagination\", () => {\n it(\"should emit the correct page value when `page 2` is clicked\", async () => {\n const page = await newE2EPage();\n\n await page.setContent(`<ic-pagination pages=\"15\"\n type=\"complex\"\n adjacent-count=\"1\"\n boundary-count=\"1\" />`);\n\n const pagItem = await page.find(\"ic-pagination >>> #pagination-item-2\");\n\n const icPageChange = await page.spyOnEvent(\"icPageChange\");\n\n await page.waitForChanges();\n\n await pagItem.click();\n\n await page.waitForChanges();\n\n expect(icPageChange).toHaveReceivedEventDetail({ value: 2 });\n });\n it(\"should emit the correct page value when `next page` is clicked\", async () => {\n const page = await newE2EPage();\n\n await page.setContent(`<ic-pagination pages=\"15\"\n type=\"complex\"\n adjacent-count=\"1\"\n boundary-count=\"1\" />`);\n\n const nextPage = await page.find(\"ic-pagination >>> #next-page-button\");\n\n const icPageChange = await page.spyOnEvent(\"icPageChange\");\n\n await page.waitForChanges();\n\n await nextPage.click();\n\n await page.waitForChanges();\n\n expect(icPageChange).toHaveReceivedEventDetail({ value: 2 });\n });\n it(\"should emit the correct page value when `page 13` is clicked\", async () => {\n const page = await newE2EPage();\n\n await page.setContent(`<ic-pagination pages=\"15\"\n type=\"complex\"\n adjacent-count=\"1\"\n boundary-count=\"1\" />`);\n\n const lastPage = await page.find(\"ic-pagination >>> #last-page-button\");\n\n const icPageChange = await page.spyOnEvent(\"icPageChange\");\n\n await page.waitForChanges();\n\n await lastPage.click();\n\n await page.waitForChanges();\n\n const pagItem = await page.find(\"ic-pagination >>> #pagination-item-13\");\n\n await page.waitForChanges();\n\n await pagItem.click();\n\n await page.waitForChanges();\n\n expect(icPageChange).toHaveReceivedEventDetail({ value: 13 });\n });\n it(\"should emit the correct page value when the `previous page` button is clicked\", async () => {\n const page = await newE2EPage();\n\n await page.setContent(`<ic-pagination pages=\"15\"\n type=\"complex\"\n adjacent-count=\"1\"\n boundary-count=\"1\" />`);\n\n const lastPage = await page.find(\"ic-pagination >>> #last-page-button\");\n\n const icPageChange = await page.spyOnEvent(\"icPageChange\");\n\n await page.waitForChanges();\n\n await lastPage.click();\n\n await page.waitForChanges();\n\n const previousPage = await page.find(\n \"ic-pagination >>> #previous-page-button\"\n );\n\n await page.waitForChanges();\n\n await previousPage.click();\n\n await page.waitForChanges();\n\n expect(icPageChange).toHaveReceivedEventDetail({ value: 14 });\n });\n it(\"should emit the correct page value when the `first page` button is clicked\", async () => {\n const page = await newE2EPage();\n\n await page.setContent(`<ic-pagination pages=\"15\"\n type=\"complex\"\n adjacent-count=\"1\"\n boundary-count=\"1\" />`);\n\n const lastPage = await page.find(\"ic-pagination >>> #last-page-button\");\n\n const icPageChange = await page.spyOnEvent(\"icPageChange\");\n\n await page.waitForChanges();\n\n await lastPage.click();\n\n await page.waitForChanges();\n\n const previousPage = await page.find(\n \"ic-pagination >>> #first-page-button\"\n );\n\n await page.waitForChanges();\n\n await previousPage.click();\n\n await page.waitForChanges();\n\n expect(icPageChange).toHaveReceivedEventDetail({ value: 1 });\n });\n it(\"should emit the correct page value when the midddle state is reached and the adjacent-count `page 7` button is clicked\", async () => {\n const page = await newE2EPage();\n\n await page.setContent(`<ic-pagination pages=\"15\"\n type=\"complex\"\n adjacent-count=\"1\"\n boundary-count=\"1\" />`);\n\n const nextPage = await page.find(\"ic-pagination >>> #next-page-button\");\n\n const icPageChange = await page.spyOnEvent(\"icPageChange\");\n\n await page.waitForChanges();\n await nextPage.click();\n await page.waitForChanges();\n await nextPage.click();\n await page.waitForChanges();\n await nextPage.click();\n await page.waitForChanges();\n await nextPage.click();\n await page.waitForChanges();\n await nextPage.click();\n await page.waitForChanges();\n\n const pagItem = await page.find(\"ic-pagination >>> #pagination-item-7\");\n\n await page.waitForChanges();\n\n await pagItem.click();\n\n await page.waitForChanges();\n\n expect(icPageChange).toHaveReceivedEventDetail({ value: 7 });\n });\n it(\"should return false when the midddle state is reached and the adjacent-count `page 8` (out of bounds) button is clicked\", async () => {\n const page = await newE2EPage();\n\n await page.setContent(`<ic-pagination pages=\"15\"\n type=\"complex\"\n adjacent-count=\"1\"\n boundary-count=\"1\" />`);\n\n const nextPage = await page.find(\"ic-pagination >>> #next-page-button\");\n\n await page.waitForChanges();\n await nextPage.click();\n await page.waitForChanges();\n await nextPage.click();\n await page.waitForChanges();\n await nextPage.click();\n await page.waitForChanges();\n await nextPage.click();\n await page.waitForChanges();\n await nextPage.click();\n await page.waitForChanges();\n\n const pagItem = await page.find(\"ic-pagination >>> #pagination-item-8\");\n\n await page.waitForChanges();\n\n expect(pagItem).toBe(null);\n });\n});\n"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,H as a,g as s}from"./p-6b5e91e2.js";import{I as n}from"./p-26b7b18f.js";import{L as o,D as r,e as l,u as h,o as c,i as d,f as p,a as m,G as u,d as g}from"./p-268355c1.js";const b='/*! 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;color:var(--ic-theme-text);width:100%;position:relative}:host .top-navigation{background-color:var(--ic-theme-primary);height:-moz-max-content;height:max-content}:host(.fullwidth-searchbar) slot[name="search"]::slotted(form){width:100%}:host .title-link{display:inline-flex;align-items:center;text-decoration:none;padding:var(--ic-space-xxs);transition:var(--ic-easing-transition-fast)}:host .title-link,:host .title-link:visited,:host .title-link:active,:host .title-link ::slotted(a),:host .title-link:visited ::slotted(a),:host .title-link:active ::slotted(a){color:var(--ic-theme-text);text-decoration:none;outline:none}:host .title-link:hover:not(:focus){background-color:var(--ic-theme-hover)}:host .title-link:active:not(:focus){background-color:var(--ic-theme-active)}:host .title-link:hover{border-radius:var(--ic-border-radius)}:host .title-link:focus,:host .title-link:focus-within{border-radius:var(--ic-border-radius);box-shadow:var(--ic-border-focus);outline:var(--ic-hc-focus-outline)}:host .title-link ic-typography{font-weight:600}:host .nav-panel-container{border-top:var(--ic-keyline-lighten);padding:0 var(--ic-space-lg);margin-left:calc(-1 * var(--section-container-margin));margin-right:calc(-1 * var(--section-container-margin));display:flex}:host(.dark) .nav-panel-container{border-top:var(--ic-keyline-darken)}.top-panel-container{display:flex;padding-top:0.5rem;padding-bottom:0.5rem}.navigation-tabs{margin-top:calc(-1 * var(--ic-space-1px))}.app-details-container{display:flex;align-items:center;flex:1 1 auto;margin-right:var(--ic-space-md)}.app-icon-container{display:flex;padding-right:var(--ic-space-xs)}.icon-buttons-container{display:flex;margin-left:var(--ic-space-md)}.icon-buttons-container ::slotted(nav){display:flex}.title-wrap{overflow-wrap:break-word;word-wrap:break-word;-ms-word-break:break-all;word-break:break-word;-webkit-hyphens:auto;hyphens:auto}:host .app-status{border-radius:var(--ic-space-md);background-color:var(--ic-architectural-white);color:var(--ic-color-primary-text);padding:var(--ic-space-xxs) var(--ic-space-lg);margin-left:var(--ic-space-md);flex:1 1 0;max-width:-moz-fit-content;max-width:fit-content}:host(.dark) .app-status{background-color:var(--ic-theme-text);color:var(--ic-color-white-text)}:host .app-version{border-radius:var(--ic-space-md);background-color:var(--ic-theme-active);padding:var(--ic-space-xxs) var(--ic-space-sm);margin-left:var(--ic-space-xs);flex:1 1 0;max-width:-moz-fit-content;max-width:fit-content}slot[name="app-icon"]::slotted(*){fill:var(--ic-theme-text);width:2em;height:2em}slot[name="toggle-icon"] svg{fill:var(--ic-theme-text)}.search-menu-container{justify-content:right;display:flex;align-items:center}.menu-button-container{margin-left:var(--ic-space-md)}.menu-button-container .navigation-landmark-button-text{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}.search-actions-container{display:flex}.menu-buttons-slot{display:flex;flex-direction:column}.navigation-landmark-text{position:absolute;width:var(--ic-space-1px);height:var(--ic-space-1px);padding:0;margin:calc(-1 * var(--ic-space-1px));overflow:hidden}.navigation-item-list{display:flex;list-style:none;height:2.75rem}.navigation-item-list::-webkit-scrollbar{display:none}:host ic-section-container{padding-bottom:0 !important;padding-top:0 !important}@media screen and (min-width: 993px){.app-details-container{margin-right:var(--ic-space-lg)}}@media screen and (max-width: 1200px){:host .nav-panel-container{padding:0 var(--ic-space-md)}}@media screen and (max-width: 992px){:host .nav-panel-container,:host .app-status,:host .app-version{display:none}:host .title-link{margin-right:var(--ic-space-xs)}.search-menu-container{max-width:10rem}.search-bar-container{display:flex;justify-content:center;align-items:center;border-top:var(--ic-keyline-darken);height:4rem;padding-left:var(--ic-space-md);padding-right:var(--ic-space-md);margin-left:calc(-1 * var(--section-container-margin));margin-right:calc(-1 * var(--section-container-margin))}}@media screen and (max-width: 576px){:host .title-link{margin-right:var(--ic-space-xxxs);word-break:break-word;-webkit-hyphens:none;hyphens:none}.top-panel-container{min-height:2.5rem}.search-bar-container{margin-top:0;height:3.5rem;padding-left:var(--ic-space-xs);padding-right:var(--ic-space-xs)}.menu-button-container{margin-left:var(--ic-space-sm)}slot[name="app-icon"]::slotted(*){width:1.5em;height:1.5em}slot[name="toggle-icon"] svg{width:1.5em;height:1.5em}}@media (forced-colors: active){:host .top-navigation{border-bottom:var(--ic-hc-border)}.app-status,.app-version{border:var(--ic-hc-border)}slot[name="app-icon"]::slotted(*){fill:currentcolor}}';const v=class{constructor(e){t(this,e);this.icNavigationMenuClosed=i(this,"icNavigationMenuClosed",7);this.icNavigationMenuOpened=i(this,"icNavigationMenuOpened",7);this.topNavResized=i(this,"topNavResized",7);this.hasAppIcon=false;this.hasIconButtons=false;this.hasNavigation=false;this.hasSearchSlotContent=false;this.resizeObserver=null;this.searchBar=null;this.initialiseSearchBar=()=>{if(this.hasSearchSlotContent){const t=o(this.el,"search");if(t&&t.tagName==="IC-SEARCH-BAR"){this.searchBar=t}else if(t&&t.tagName==="FORM"){this.searchBar=t.querySelector("ic-search-bar")}if(this.searchBar!==null){this.searchBar.hideLabel=true}}};this.menuButtonClick=()=>{this.showNavMenu(true)};this.searchButtonMouseDownHandler=()=>{this.searchButtonClick=true};this.searchButtonClickHandler=()=>{this.toggleSearchBar();this.searchButtonClick=false};this.resizeObserverCallback=t=>{if(t!==this.deviceSize){this.deviceSize=t;if(t>r.L){this.showNavMenu(false);if(this.mobileSearchBarVisible){this.toggleSearchBar()}}this.topNavResized.emit({size:t});if(document.activeElement!==null&&document.activeElement!==undefined&&document.activeElement.tagName==="IC-SEARCH-BAR"){this.searchBar.setAttribute("hidden","true");this.searchBar.removeAttribute("hidden");setTimeout((()=>{this.searchBar.focus()}),100)}}};this.runResizeObserver=()=>{this.resizeObserver=new ResizeObserver((()=>{const t=l();this.resizeObserverCallback(t)}));this.resizeObserver.observe(this.el)};this.deviceSize=r.XL;this.foregroundColor=h();this.hasFullWidthSearchBar=false;this.menuOpen=false;this.mobileSearchBarVisible=false;this.mobileSearchHiddenOnBlur=false;this.navMenuVisible=false;this.searchButtonClick=false;this.searchValue="";this.contentAligned="full-width";this.href="/";this.inline=false;this.shortAppTitle="";this.status="";this.version="";this.appTitle=undefined}watchPropHandler(t,i){c(i,t,this.initialiseSearchBar)}disconnectedCallback(){if(this.resizeObserver!==null){this.resizeObserver.disconnect()}}componentWillLoad(){this.hasAppIcon=d(this.el,"app-icon");this.hasNavigation=d(this.el,"navigation");this.hasIconButtons=d(this.el,"buttons");this.hasSearchSlotContent=d(this.el,"search");this.deviceSize=l();this.initialiseSearchBar()}componentDidLoad(){p(this.runResizeObserver);!d(this.el,"app-title")&&m([{prop:this.appTitle,propName:"app-title"}],"Top Navigation")}componentWillRender(){this.hasNavigation=d(this.el,"navigation");this.hasSearchSlotContent=d(this.el,"search");this.hasIconButtons=d(this.el,"buttons");this.hasAppIcon=d(this.el,"app-icon")}navBarMenuCloseHandler(){this.showNavMenu(false);const t=this.el.shadowRoot.querySelector("#menu-button");t.focus()}searchInputBlurHandler(t){if(t.detail!==null){if(this.mobileSearchBarVisible&&!this.searchButtonClick){this.toggleSearchBar()}this.searchValue=t.detail.value}}searchValueChangeHandler(t){this.searchValue=t.detail.value}themeChangeHandler(t){const i=t.detail;this.foregroundColor=i.mode}toggleSearchBar(){this.mobileSearchBarVisible=!this.mobileSearchBarVisible;if(this.searchBar!==null){if(this.mobileSearchBarVisible){this.mobileSearchButtonEl.setAttribute("aria-label","Hide search");this.hasFullWidthSearchBar=true;this.searchBar.fullWidth=true;setTimeout((()=>{this.searchBar.focus()}),100)}else{this.mobileSearchButtonEl.setAttribute("aria-label","Show search");this.hasFullWidthSearchBar=false;this.searchBar.fullWidth=false}}}showNavMenu(t){this.navMenuVisible=t;if(t){this.icNavigationMenuOpened.emit();document.body.style.height="100%";document.body.style.overflow="hidden"}else{this.icNavigationMenuClosed.emit();document.body.style.height="auto";document.body.style.overflow="auto"}}render(){const t=this.hasNavigation||this.hasIconButtons||this.status!==""||this.version!=="";const i=this.deviceSize<=r.S?"default":"large";let s="h3";const o=this.appTitle!==""&&g(this.appTitle);if(this.deviceSize<=r.L){s="h4";if(this.deviceSize<=r.S){s="subtitle-small"}}const l=this.mobileSearchBarVisible?"Hide search":"Show search";const h=this.deviceSize<=r.S?"small":"default";const c=d(this.el,"app-title")?"div":"a";const p=c=="a"&&{href:this.href};const m=d(this.el,"short-app-title");return e(a,{class:{["fullwidth-searchbar"]:this.hasFullWidthSearchBar,[n.Dark]:this.foregroundColor===n.Dark}},e("div",{class:"top-navigation"},e("ic-section-container",{aligned:this.contentAligned,"full-height":true},e("header",{role:"banner"},e("div",{class:"top-panel-container"},e("div",{class:"app-details-container"},(o||d(this.el,"app-title"))&&e(c,Object.assign({class:"title-link"},p),this.hasAppIcon&&e("div",{class:"app-icon-container"},e("slot",{name:"app-icon"})),this.deviceSize<=r.S&&(!u(this.shortAppTitle)||m)?e("ic-typography",{variant:"subtitle-small","aria-label":(!d(this.el,"app-title")||!m)&&`${this.appTitle} (${this.shortAppTitle})`},e("h1",null,m?e("slot",{name:"short-app-title"}):this.shortAppTitle)):e("ic-typography",{variant:s},e("h1",{class:"title-wrap"},d(this.el,"app-title")?e("slot",{name:"app-title"}):this.appTitle))),this.status!==""&&e("div",{class:"app-status"},e("ic-typography",{"aria-label":"app tag",variant:"label-uppercase",class:"app-status-text"},this.status)),this.version!==""&&e("div",{class:"app-version"},e("ic-typography",{variant:"label",class:"app-version-text","aria-label":"app version"},this.version))),(this.hasSearchSlotContent||t)&&e("div",{class:"search-menu-container"},e("div",{class:"search-actions-container"},this.deviceSize>r.L&&e("slot",{name:"search"}),this.hasSearchSlotContent&&this.deviceSize<=r.L&&e("ic-button",{id:"search-toggle-button",ref:t=>this.mobileSearchButtonEl=t,onMouseDown:this.searchButtonMouseDownHandler,variant:"icon",size:i,"aria-label":l,appearance:this.foregroundColor,onClick:this.searchButtonClickHandler},e("slot",{name:"toggle-icon"},e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#ffffff"},e("path",{d:"M0 0h24v24H0V0z",fill:"none"}),e("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})))),this.hasIconButtons&&this.deviceSize>r.L&&e("div",{class:"icon-buttons-container"},e("slot",{name:"buttons"})),t&&this.deviceSize<=r.L&&e("div",{class:"menu-button-container"},e("span",{id:"navigation-landmark-button-text",class:"navigation-landmark-button-text","aria-hidden":"true"},"Main navigation button"),e("nav",{"aria-labelledby":"navigation-landmark-button-text","aria-hidden":this.navMenuVisible?"true":"false"},e("ic-button",{id:"menu-button",appearance:this.foregroundColor,variant:"secondary","aria-expanded":this.menuOpen?"true":"false","aria-haspopup":"true","aria-label":`Open ${this.hasNavigation?"navigation":"app"} menu`,size:h,onClick:this.menuButtonClick},"Menu",e("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#ffffff",slot:"icon"},e("path",{d:"M0 0h24v24H0V0z",fill:"none"}),e("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"})))))))),this.mobileSearchBarVisible&&e("div",{class:"search-bar-container"},e("slot",{name:"search"})),this.hasNavigation&&this.deviceSize>r.L&&e("div",{class:"navigation-tabs"},e("span",{id:"navigation-landmark-text",class:"navigation-landmark-text","aria-hidden":"true"},"Main pages"),e("nav",{"aria-labelledby":"navigation-landmark-text",class:"nav-panel-container"},e("ic-horizontal-scroll",{appearance:this.foregroundColor},e("ul",{class:"navigation-item-list",tabindex:"-1"},e("slot",{name:"navigation"})))))))),this.navMenuVisible&&e("ic-navigation-menu",{version:this.version,status:this.status,class:{["inline"]:this.inline}},this.hasIconButtons&&e("div",{class:"menu-buttons-slot",slot:"buttons"},e("slot",{name:"buttons"})),e("ul",{slot:"navigation"},e("slot",{name:"navigation"}))))}get el(){return s(this)}static get watchers(){return{appTitle:["watchPropHandler"]}}};v.style=b;export{v as ic_top_navigation};
|
|
2
|
-
//# sourceMappingURL=p-7cdea5bf.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["icTopNavigationCss","TopNavigation","this","hasAppIcon","hasIconButtons","hasNavigation","hasSearchSlotContent","resizeObserver","searchBar","initialiseSearchBar","slot","getSlot","el","tagName","querySelector","hideLabel","menuButtonClick","showNavMenu","searchButtonMouseDownHandler","searchButtonClick","searchButtonClickHandler","toggleSearchBar","resizeObserverCallback","currSize","deviceSize","DEVICE_SIZES","L","mobileSearchBarVisible","topNavResized","emit","size","document","activeElement","undefined","setAttribute","removeAttribute","setTimeout","focus","runResizeObserver","ResizeObserver","getCurrentDeviceSize","observe","XL","getThemeForegroundColor","watchPropHandler","newValue","oldValue","onComponentPropUndefinedChange","disconnectedCallback","disconnect","componentWillLoad","isSlotUsed","componentDidLoad","checkResizeObserver","onComponentRequiredPropUndefined","prop","appTitle","propName","componentWillRender","navBarMenuCloseHandler","menuBtn","shadowRoot","searchInputBlurHandler","ev","detail","searchValue","value","searchValueChangeHandler","themeChangeHandler","theme","foregroundColor","mode","mobileSearchButtonEl","hasFullWidthSearchBar","fullWidth","show","navMenuVisible","icNavigationMenuOpened","body","style","height","overflow","icNavigationMenuClosed","render","hasMenuContent","status","version","searchButtonSize","S","appTitleVariant","hasTitle","isPropDefined","mobileSearchButtonTitle","menuSize","Component","attrs","href","shortAppTitleSlot","h","Host","class","IcThemeForegroundEnum","Dark","aligned","contentAligned","role","Object","assign","name","isEmptyString","shortAppTitle","variant","id","ref","onMouseDown","appearance","onClick","xmlns","viewBox","fill","d","menuOpen","width","tabindex","inline"],"sources":["src/components/ic-top-navigation/ic-top-navigation.css?tag=ic-top-navigation&encapsulation=shadow","src/components/ic-top-navigation/ic-top-navigation.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: block;\n color: var(--ic-theme-text);\n width: 100%;\n position: relative;\n}\n\n:host .top-navigation {\n background-color: var(--ic-theme-primary);\n height: max-content;\n}\n\n:host(.fullwidth-searchbar) slot[name=\"search\"]::slotted(form) {\n width: 100%;\n}\n\n:host .title-link {\n display: inline-flex;\n align-items: center;\n text-decoration: none;\n padding: var(--ic-space-xxs);\n transition: var(--ic-easing-transition-fast);\n}\n\n:host .title-link,\n:host .title-link:visited,\n:host .title-link:active,\n:host .title-link ::slotted(a),\n:host .title-link:visited ::slotted(a),\n:host .title-link:active ::slotted(a) {\n color: var(--ic-theme-text);\n text-decoration: none;\n outline: none;\n}\n\n:host .title-link:hover:not(:focus) {\n background-color: var(--ic-theme-hover);\n}\n\n:host .title-link:active:not(:focus) {\n background-color: var(--ic-theme-active);\n}\n\n:host .title-link:hover {\n border-radius: var(--ic-border-radius);\n}\n\n:host .title-link:focus,\n:host .title-link:focus-within {\n border-radius: var(--ic-border-radius);\n box-shadow: var(--ic-border-focus);\n outline: var(--ic-hc-focus-outline);\n}\n\n:host .title-link ic-typography {\n font-weight: 600;\n}\n\n:host .nav-panel-container {\n border-top: var(--ic-keyline-lighten);\n padding: 0 var(--ic-space-lg);\n margin-left: calc(-1 * var(--section-container-margin));\n margin-right: calc(-1 * var(--section-container-margin));\n display: flex;\n}\n\n:host(.dark) .nav-panel-container {\n border-top: var(--ic-keyline-darken);\n}\n\n.top-panel-container {\n display: flex;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n\n.navigation-tabs {\n margin-top: calc(-1 * var(--ic-space-1px));\n}\n\n.app-details-container {\n display: flex;\n align-items: center;\n flex: 1 1 auto;\n margin-right: var(--ic-space-md);\n}\n\n.app-icon-container {\n display: flex;\n padding-right: var(--ic-space-xs);\n}\n\n.icon-buttons-container {\n display: flex;\n margin-left: var(--ic-space-md);\n}\n\n.icon-buttons-container ::slotted(nav) {\n display: flex;\n}\n\n.title-wrap {\n overflow-wrap: break-word;\n word-wrap: break-word;\n -ms-word-break: break-all;\n word-break: break-word;\n hyphens: auto;\n}\n\n:host .app-status {\n border-radius: var(--ic-space-md);\n background-color: var(--ic-architectural-white);\n color: var(--ic-color-primary-text);\n padding: var(--ic-space-xxs) var(--ic-space-lg);\n margin-left: var(--ic-space-md);\n flex: 1 1 0;\n max-width: fit-content;\n}\n\n:host(.dark) .app-status {\n background-color: var(--ic-theme-text);\n color: var(--ic-color-white-text);\n}\n\n:host .app-version {\n border-radius: var(--ic-space-md);\n background-color: var(--ic-theme-active);\n padding: var(--ic-space-xxs) var(--ic-space-sm);\n margin-left: var(--ic-space-xs);\n flex: 1 1 0;\n max-width: fit-content;\n}\n\nslot[name=\"app-icon\"]::slotted(*) {\n fill: var(--ic-theme-text);\n width: 2em;\n height: 2em;\n}\n\nslot[name=\"toggle-icon\"] svg {\n fill: var(--ic-theme-text);\n}\n\n.search-menu-container {\n justify-content: right;\n display: flex;\n align-items: center;\n}\n\n.menu-button-container {\n margin-left: var(--ic-space-md);\n}\n\n.menu-button-container .navigation-landmark-button-text {\n position: absolute;\n left: -10000px;\n top: auto;\n width: 1px;\n height: 1px;\n overflow: hidden;\n}\n\n.search-actions-container {\n display: flex;\n}\n\n.menu-buttons-slot {\n display: flex;\n flex-direction: column;\n}\n\n.navigation-landmark-text {\n position: absolute;\n width: var(--ic-space-1px);\n height: var(--ic-space-1px);\n padding: 0;\n margin: calc(-1 * var(--ic-space-1px));\n overflow: hidden;\n}\n\n.navigation-item-list {\n display: flex;\n list-style: none;\n height: 2.75rem;\n}\n\n.navigation-item-list::-webkit-scrollbar {\n display: none;\n}\n\n:host ic-section-container {\n padding-bottom: 0 !important;\n padding-top: 0 !important;\n}\n\n@media screen and (min-width: 993px) {\n .app-details-container {\n margin-right: var(--ic-space-lg);\n }\n}\n\n/* large */\n@media screen and (max-width: 1200px) {\n :host .nav-panel-container {\n padding: 0 var(--ic-space-md);\n }\n}\n\n/* medium */\n@media screen and (max-width: 992px) {\n :host .nav-panel-container,\n :host .app-status,\n :host .app-version {\n display: none;\n }\n\n :host .title-link {\n margin-right: var(--ic-space-xs);\n }\n\n .search-menu-container {\n max-width: 10rem;\n }\n\n .search-bar-container {\n display: flex;\n justify-content: center;\n align-items: center;\n border-top: var(--ic-keyline-darken);\n height: 4rem;\n padding-left: var(--ic-space-md);\n padding-right: var(--ic-space-md);\n margin-left: calc(-1 * var(--section-container-margin));\n margin-right: calc(-1 * var(--section-container-margin));\n }\n}\n\n/* x small */\n@media screen and (max-width: 576px) {\n :host .title-link {\n margin-right: var(--ic-space-xxxs);\n word-break: break-word;\n hyphens: none;\n }\n\n .top-panel-container {\n min-height: 2.5rem;\n }\n\n .search-bar-container {\n margin-top: 0;\n height: 3.5rem;\n padding-left: var(--ic-space-xs);\n padding-right: var(--ic-space-xs);\n }\n\n .menu-button-container {\n margin-left: var(--ic-space-sm);\n }\n\n slot[name=\"app-icon\"]::slotted(*) {\n width: 1.5em;\n height: 1.5em;\n }\n\n slot[name=\"toggle-icon\"] svg {\n width: 1.5em;\n height: 1.5em;\n }\n}\n\n@media (forced-colors: active) {\n :host .top-navigation {\n border-bottom: var(--ic-hc-border);\n }\n\n .app-status,\n .app-version {\n border: var(--ic-hc-border);\n }\n\n slot[name=\"app-icon\"]::slotted(*) {\n fill: currentcolor;\n }\n}\n","import {\n Component,\n Element,\n Host,\n Prop,\n h,\n State,\n Listen,\n Event,\n EventEmitter,\n Watch,\n} from \"@stencil/core\";\n\nimport {\n IcTypographyVariants,\n IcAlignment,\n IcThemeForeground,\n IcThemeForegroundEnum,\n IcTheme,\n} from \"../../utils/types\";\nimport {\n checkResizeObserver,\n DEVICE_SIZES,\n getCurrentDeviceSize,\n getThemeForegroundColor,\n getSlot,\n onComponentPropUndefinedChange,\n onComponentRequiredPropUndefined,\n isSlotUsed,\n isEmptyString,\n isPropDefined,\n} from \"../../utils/helpers\";\n\n/**\n * @slot app-icon - Content will be rendered to left of app title.\n * @slot app-title - Handle routing by nesting a route in the app title.\n * @slot short-app-title - Handle routing by nesting a route in the short app title (to be displayed in place of app title on small screen sizes).\n * @slot search - Content will be rendered in search area to left of buttons.\n * @slot toggle-icon - Icon to be displayed on the button to toggle search slot content on smaller devices\n * @slot navigation - Content will be rendered in navigation panel.\n * @slot buttons - Content will be rendered to right of search bar.\n */\n@Component({\n tag: \"ic-top-navigation\",\n styleUrl: \"ic-top-navigation.css\",\n shadow: true,\n})\nexport class TopNavigation {\n private hasAppIcon: boolean = false;\n private hasIconButtons: boolean = false;\n private hasNavigation: boolean = false;\n private hasSearchSlotContent: boolean = false;\n private mobileSearchButtonEl: HTMLIcButtonElement;\n private resizeObserver: ResizeObserver = null;\n private searchBar: HTMLIcSearchBarElement = null;\n\n @Element() el: HTMLIcTopNavigationElement;\n\n @State() deviceSize: number = DEVICE_SIZES.XL;\n @State() foregroundColor: IcThemeForeground = getThemeForegroundColor();\n @State() hasFullWidthSearchBar: boolean = false;\n @State() menuOpen: boolean = false;\n @State() mobileSearchBarVisible: boolean = false;\n @State() mobileSearchHiddenOnBlur: boolean = false;\n @State() navMenuVisible: boolean = false;\n @State() searchButtonClick: boolean = false;\n @State() searchValue: string = \"\";\n\n /**\n * The alignment of the top navigation content.\n */\n @Prop() contentAligned: IcAlignment = \"full-width\";\n /**\n * The URL to navigate to when the app title is clicked.\n */\n @Prop() href: string = \"/\";\n\n /**\n * If `true`, the flyout navigation menu on small devices will be contained by the parent element.\n */\n @Prop() inline: boolean = false;\n\n /**\n * The short title of the app to be displayed at small screen sizes in place of the app title.\n */\n @Prop() shortAppTitle: string = \"\";\n\n /**\n * The status info to be displayed.\n */\n @Prop() status: string = \"\";\n\n /**\n * The version info to be displayed.\n */\n @Prop() version: string = \"\";\n\n /**\n * The app title to be displayed. This is required, unless a slotted app title link is used.\n */\n @Prop() appTitle: string;\n @Watch(\"appTitle\")\n watchPropHandler(newValue: string, oldValue: string): void {\n //added for gatsby rehydration issue where prop is initially undefined but then changes to actual value\n //this watch can be removed once gatbsy hydration issue is resolved\n onComponentPropUndefinedChange(\n oldValue,\n newValue,\n this.initialiseSearchBar\n );\n }\n\n /**\n * @internal - Emitted when the menu is closed.\n */\n @Event() icNavigationMenuClosed: EventEmitter<void>;\n\n /**\n * @internal - Emitted when the menu is opened.\n */\n @Event() icNavigationMenuOpened: EventEmitter<void>;\n\n /**\n * Emitted when the top navigation is resized.\n */\n @Event() topNavResized: EventEmitter<{ size: number }>;\n\n disconnectedCallback(): void {\n if (this.resizeObserver !== null) {\n this.resizeObserver.disconnect();\n }\n }\n\n componentWillLoad(): void {\n this.hasAppIcon = isSlotUsed(this.el, \"app-icon\");\n this.hasNavigation = isSlotUsed(this.el, \"navigation\");\n this.hasIconButtons = isSlotUsed(this.el, \"buttons\");\n this.hasSearchSlotContent = isSlotUsed(this.el, \"search\");\n this.deviceSize = getCurrentDeviceSize();\n this.initialiseSearchBar();\n }\n\n componentDidLoad(): void {\n checkResizeObserver(this.runResizeObserver);\n !isSlotUsed(this.el, \"app-title\") &&\n onComponentRequiredPropUndefined(\n [{ prop: this.appTitle, propName: \"app-title\" }],\n \"Top Navigation\"\n );\n }\n\n componentWillRender(): void {\n this.hasNavigation = isSlotUsed(this.el, \"navigation\");\n this.hasSearchSlotContent = isSlotUsed(this.el, \"search\");\n this.hasIconButtons = isSlotUsed(this.el, \"buttons\");\n this.hasAppIcon = isSlotUsed(this.el, \"app-icon\");\n }\n\n @Listen(\"icNavigationMenuClose\", {})\n navBarMenuCloseHandler(): void {\n this.showNavMenu(false);\n const menuBtn = this.el.shadowRoot.querySelector(\n \"#menu-button\"\n ) as HTMLElement;\n menuBtn.focus();\n }\n\n @Listen(\"icSearchBarBlur\", {})\n searchInputBlurHandler(ev: CustomEvent): void {\n if (ev.detail !== null) {\n if (this.mobileSearchBarVisible && !this.searchButtonClick) {\n //don't hide if blur was triggered by click on search button - let the click handler toggle the state\n this.toggleSearchBar();\n }\n this.searchValue = ev.detail.value;\n }\n }\n\n @Listen(\"icChange\", {})\n searchValueChangeHandler(ev: CustomEvent): void {\n this.searchValue = ev.detail.value;\n }\n\n @Listen(\"themeChange\", { target: \"document\" })\n themeChangeHandler(ev: CustomEvent): void {\n const theme: IcTheme = ev.detail;\n this.foregroundColor = theme.mode;\n }\n\n private initialiseSearchBar = () => {\n if (this.hasSearchSlotContent) {\n const slot = getSlot(this.el, \"search\");\n if (slot && slot.tagName === \"IC-SEARCH-BAR\") {\n this.searchBar = slot as HTMLIcSearchBarElement;\n } else if (slot && slot.tagName === \"FORM\") {\n this.searchBar = slot.querySelector(\n \"ic-search-bar\"\n ) as HTMLIcSearchBarElement;\n }\n\n if (this.searchBar !== null) {\n this.searchBar.hideLabel = true;\n }\n }\n };\n\n private toggleSearchBar(): void {\n this.mobileSearchBarVisible = !this.mobileSearchBarVisible;\n\n if (this.searchBar !== null) {\n if (this.mobileSearchBarVisible) {\n this.mobileSearchButtonEl.setAttribute(\"aria-label\", \"Hide search\");\n this.hasFullWidthSearchBar = true;\n this.searchBar.fullWidth = true;\n setTimeout(() => {\n this.searchBar.focus();\n }, 100);\n } else {\n this.mobileSearchButtonEl.setAttribute(\"aria-label\", \"Show search\");\n this.hasFullWidthSearchBar = false;\n this.searchBar.fullWidth = false;\n }\n }\n }\n\n private menuButtonClick = () => {\n this.showNavMenu(true);\n };\n\n private showNavMenu(show: boolean): void {\n this.navMenuVisible = show;\n if (show) {\n this.icNavigationMenuOpened.emit();\n document.body.style.height = \"100%\";\n document.body.style.overflow = \"hidden\";\n } else {\n this.icNavigationMenuClosed.emit();\n document.body.style.height = \"auto\";\n document.body.style.overflow = \"auto\";\n }\n }\n\n private searchButtonMouseDownHandler = () => {\n this.searchButtonClick = true;\n };\n\n private searchButtonClickHandler = () => {\n this.toggleSearchBar();\n this.searchButtonClick = false;\n };\n\n private resizeObserverCallback = (currSize: number) => {\n if (currSize !== this.deviceSize) {\n this.deviceSize = currSize;\n if (currSize > DEVICE_SIZES.L) {\n this.showNavMenu(false);\n if (this.mobileSearchBarVisible) {\n this.toggleSearchBar();\n }\n }\n this.topNavResized.emit({\n size: currSize,\n });\n if (\n document.activeElement !== null &&\n document.activeElement !== undefined &&\n document.activeElement.tagName === \"IC-SEARCH-BAR\"\n ) {\n this.searchBar.setAttribute(\"hidden\", \"true\");\n //remove attribute again as this trigger a redraw & applies css\n this.searchBar.removeAttribute(\"hidden\");\n setTimeout(() => {\n this.searchBar.focus();\n }, 100);\n }\n }\n };\n\n private runResizeObserver = () => {\n this.resizeObserver = new ResizeObserver(() => {\n const currSize = getCurrentDeviceSize();\n this.resizeObserverCallback(currSize);\n });\n\n this.resizeObserver.observe(this.el);\n };\n\n render() {\n const hasMenuContent =\n this.hasNavigation ||\n this.hasIconButtons ||\n this.status !== \"\" ||\n this.version !== \"\";\n\n const searchButtonSize =\n this.deviceSize <= DEVICE_SIZES.S ? \"default\" : \"large\";\n\n let appTitleVariant: IcTypographyVariants = \"h3\";\n\n const hasTitle = this.appTitle !== \"\" && isPropDefined(this.appTitle);\n\n if (this.deviceSize <= DEVICE_SIZES.L) {\n appTitleVariant = \"h4\";\n if (this.deviceSize <= DEVICE_SIZES.S) {\n appTitleVariant = \"subtitle-small\";\n }\n }\n\n const mobileSearchButtonTitle = this.mobileSearchBarVisible\n ? \"Hide search\"\n : \"Show search\";\n const menuSize = this.deviceSize <= DEVICE_SIZES.S ? \"small\" : \"default\";\n\n const Component = isSlotUsed(this.el, \"app-title\") ? \"div\" : \"a\";\n\n const attrs = Component == \"a\" && {\n href: this.href,\n };\n\n const shortAppTitleSlot = isSlotUsed(this.el, \"short-app-title\");\n\n return (\n <Host\n class={{\n [\"fullwidth-searchbar\"]: this.hasFullWidthSearchBar,\n [IcThemeForegroundEnum.Dark]:\n this.foregroundColor === IcThemeForegroundEnum.Dark,\n }}\n >\n <div class=\"top-navigation\">\n <ic-section-container aligned={this.contentAligned} full-height>\n <header role=\"banner\">\n <div class=\"top-panel-container\">\n <div class=\"app-details-container\">\n {(hasTitle || isSlotUsed(this.el, \"app-title\")) && (\n <Component class=\"title-link\" {...attrs}>\n {this.hasAppIcon && (\n <div class=\"app-icon-container\">\n <slot name=\"app-icon\" />\n </div>\n )}\n {this.deviceSize <= DEVICE_SIZES.S &&\n (!isEmptyString(this.shortAppTitle) ||\n shortAppTitleSlot) ? (\n <ic-typography\n variant=\"subtitle-small\"\n aria-label={\n (!isSlotUsed(this.el, \"app-title\") ||\n !shortAppTitleSlot) &&\n `${this.appTitle} (${this.shortAppTitle})`\n }\n >\n <h1>\n {shortAppTitleSlot ? (\n <slot name=\"short-app-title\"></slot>\n ) : (\n this.shortAppTitle\n )}\n </h1>\n </ic-typography>\n ) : (\n <ic-typography variant={appTitleVariant}>\n <h1 class=\"title-wrap\">\n {isSlotUsed(this.el, \"app-title\") ? (\n <slot name=\"app-title\"></slot>\n ) : (\n this.appTitle\n )}\n </h1>\n </ic-typography>\n )}\n </Component>\n )}\n {this.status !== \"\" && (\n <div class=\"app-status\">\n <ic-typography\n aria-label=\"app tag\"\n variant=\"label-uppercase\"\n class=\"app-status-text\"\n >\n {this.status}\n </ic-typography>\n </div>\n )}\n {this.version !== \"\" && (\n <div class=\"app-version\">\n <ic-typography\n variant=\"label\"\n class=\"app-version-text\"\n aria-label=\"app version\"\n >\n {this.version}\n </ic-typography>\n </div>\n )}\n </div>\n\n {(this.hasSearchSlotContent || hasMenuContent) && (\n <div class=\"search-menu-container\">\n <div class=\"search-actions-container\">\n {this.deviceSize > DEVICE_SIZES.L && (\n <slot name=\"search\"></slot>\n )}\n\n {this.hasSearchSlotContent &&\n this.deviceSize <= DEVICE_SIZES.L && (\n <ic-button\n id=\"search-toggle-button\"\n ref={(el) => (this.mobileSearchButtonEl = el)}\n onMouseDown={this.searchButtonMouseDownHandler}\n variant=\"icon\"\n size={searchButtonSize}\n aria-label={mobileSearchButtonTitle}\n appearance={this.foregroundColor}\n onClick={this.searchButtonClickHandler}\n >\n <slot name=\"toggle-icon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"#ffffff\"\n >\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path d=\"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\" />\n </svg>\n </slot>\n </ic-button>\n )}\n\n {this.hasIconButtons &&\n this.deviceSize > DEVICE_SIZES.L && (\n <div class=\"icon-buttons-container\">\n <slot name=\"buttons\"></slot>\n </div>\n )}\n {hasMenuContent && this.deviceSize <= DEVICE_SIZES.L && (\n <div class=\"menu-button-container\">\n <span\n id=\"navigation-landmark-button-text\"\n class=\"navigation-landmark-button-text\"\n aria-hidden=\"true\"\n >\n Main navigation button\n </span>\n <nav\n aria-labelledby=\"navigation-landmark-button-text\"\n aria-hidden={this.navMenuVisible ? \"true\" : \"false\"}\n >\n <ic-button\n id=\"menu-button\"\n appearance={this.foregroundColor}\n variant=\"secondary\"\n aria-expanded={this.menuOpen ? \"true\" : \"false\"}\n aria-haspopup=\"true\"\n aria-label={`Open ${\n this.hasNavigation ? \"navigation\" : \"app\"\n } menu`}\n size={menuSize}\n onClick={this.menuButtonClick}\n >\n Menu\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"#ffffff\"\n slot=\"icon\"\n >\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path d=\"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z\" />\n </svg>\n </ic-button>\n </nav>\n </div>\n )}\n </div>\n </div>\n )}\n </div>\n\n {this.mobileSearchBarVisible && (\n <div class=\"search-bar-container\">\n <slot name=\"search\"></slot>\n </div>\n )}\n\n {this.hasNavigation && this.deviceSize > DEVICE_SIZES.L && (\n <div class=\"navigation-tabs\">\n <span\n id=\"navigation-landmark-text\"\n class=\"navigation-landmark-text\"\n aria-hidden=\"true\"\n >\n Main pages\n </span>\n <nav\n aria-labelledby=\"navigation-landmark-text\"\n class=\"nav-panel-container\"\n >\n <ic-horizontal-scroll appearance={this.foregroundColor}>\n <ul class=\"navigation-item-list\" tabindex=\"-1\">\n <slot name=\"navigation\"></slot>\n </ul>\n </ic-horizontal-scroll>\n </nav>\n </div>\n )}\n </header>\n </ic-section-container>\n </div>\n {this.navMenuVisible && (\n <ic-navigation-menu\n version={this.version}\n status={this.status}\n class={{\n [\"inline\"]: this.inline,\n }}\n >\n {this.hasIconButtons && (\n <div class=\"menu-buttons-slot\" slot=\"buttons\">\n <slot name=\"buttons\"></slot>\n </div>\n )}\n <ul slot=\"navigation\">\n <slot name=\"navigation\"></slot>\n </ul>\n </ic-navigation-menu>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"uMAAA,MAAMA,EAAqB,k9N,MC+CdC,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AKG,eAAiBH,KAAKsB,WAAaC,EAAaC,GACpDwE,EAAA,OAAKE,MAAM,mBACTF,EAAA,QACEc,GAAG,2BACHZ,MAAM,2BAA0B,cACpB,QAAM,cAIpBF,EAAA,yBACkB,2BAChBE,MAAM,uBAENF,EAAA,wBAAsBiB,WAAYjH,KAAKoE,iBACrC4B,EAAA,MAAIE,MAAM,uBAAuBuB,SAAS,MACxCzB,EAAA,QAAMU,KAAK,sBAS1B1G,KAAK0E,gBACJsB,EAAA,sBACEZ,QAASpF,KAAKoF,QACdD,OAAQnF,KAAKmF,OACbe,MAAO,CACL,CAAC,UAAWlG,KAAK0H,SAGlB1H,KAAKE,gBACJ8F,EAAA,OAAKE,MAAM,oBAAoB1F,KAAK,WAClCwF,EAAA,QAAMU,KAAK,aAGfV,EAAA,MAAIxF,KAAK,cACPwF,EAAA,QAAMU,KAAK,iB"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as i,c as t,h as e,H as a,g as o}from"./p-6b5e91e2.js";import{i as n,D as s,u as r,c as d,e as c,y as l}from"./p-268355c1.js";import{C as v}from"./p-3b185c32.js";import{O as h}from"./p-426ec638.js";import"./p-26b7b18f.js";const m='/*! 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}:host(:focus-within){z-index:var(--ic-z-index-navigation-item)}svg{width:var(--ic-space-xl);fill:var(--ic-theme-text)}.svg{margin-left:auto}.chevron-container svg,.chevron-container .svg{width:var(--ic-space-lg);height:var(--ic-space-lg)}.chevron-container{flex-grow:1}:host(.expandable.navigation-item) .link,:host(.expandable.navigation-item) ::slotted(a){padding-right:0}:host(.navigation-item) .link,:host(.navigation-item) ::slotted(a){height:calc(100% - var(--ic-space-xxs));width:-moz-fit-content;width:fit-content;color:var(--ic-theme-text);display:flex;align-items:center;justify-content:center;padding:0 var(--ic-space-md) var(--ic-space-xxs);text-decoration:none;transition:var(--ic-easing-transition-fast);position:relative;white-space:nowrap}:host(.navigation-item) ::slotted(a){height:100%;font:var(--ic-font-label) !important;letter-spacing:var(--ic-font-letter-spacing-0pt025) !important;padding:0 var(--ic-space-md) !important}:host(.navigation-item-selected) .link::after,:host(.navigation-item-selected) ::slotted(a.active)::after,:host(.navigation-item-top-nav) ::slotted(a.active)::after{content:"";height:0.25rem;width:100%;position:absolute;bottom:0;background-color:var(--ic-theme-text)}:host(.navigation-item-selected.navigation-item-page-header) ::slotted(a.active)::after,:host(.navigation-item-selected.navigation-item-page-header) .link::after,:host(.navigation-item.navigation-item-page-header) ::slotted(a.active)::after,:host(.navigation-item-top-nav-child) ::slotted(a.active)::after{content:none}:host(.navigation-item-side-menu-selected) .link,:host(.navigation-item-side-menu) ::slotted(a.active),:host(.navigation-item-top-nav-child) ::slotted(a.active){box-shadow:none}:host(.navigation-item) .link:hover:not(:focus){background-color:var(--ic-theme-hover);cursor:pointer}:host(.navigation-item:not(.navigation-item-page-header,.navigation-item-side-menu)) ::slotted(a:hover:not(:focus)){background-color:var(--ic-theme-hover) !important}:host(.navigation-item:not(.navigation-item-top-nav-child,.navigation-item-side-menu,.navigation-item-top-nav-child-selected .navigation-item-side-menu-selected)) .focus-indicator:focus-within{box-shadow:var(--ic-border-focus);border-radius:var(--ic-border-radius)}:host(.navigation-item) .link:focus,:host(.navigation-item) ::slotted(a:focus){box-shadow:var(--ic-border-focus);border-radius:var(--ic-border-radius);outline:var(--ic-hc-focus-outline)}:host(.navigation-item-selected) .link:focus,:host(.navigation-item) ::slotted(a.active:focus){box-shadow:var(--ic-border-focus);border-radius:var(--ic-border-radius);outline:var(--ic-hc-focus-outline)}:host(.navigation-item-selected.dark) .link:focus,:host(.navigation-item.dark) ::slotted(a.active:focus){box-shadow:var(--ic-border-focus);border-radius:var(--ic-border-radius);outline:var(--ic-hc-focus-outline)}:host(.navigation-item) .link:active:not(:focus),:host(.navigation-item) ::slotted(a:active:not(:focus)){background-color:var(--ic-theme-active)}:host(.navigation-item-side-menu) .link,:host(.navigation-item-side-menu) ::slotted(a){min-height:2.5rem;width:100%;box-sizing:border-box;color:var(--ic-color-primary-text);display:flex;align-items:center;justify-content:flex-start;text-decoration:none;text-wrap:wrap;white-space:normal;transition:box-shadow var(--ic-transition-duration-fast),\n border-radius var(--ic-transition-duration-fast)}:host(.navigation-item-side-menu) ::slotted(a){font:var(--ic-font-body) !important;letter-spacing:var(--ic-font-letter-spacing-0pt005) !important;transition:box-shadow var(--ic-easing-transition-fast),\n background-color var(--ic-easing-transition-fast)}:host(.navigation-item-side-menu) .link:hover:not(:focus){background-color:var(--ic-action-dark-bg-hover)}:host(.navigation-item-side-menu) ::slotted(a:hover:not(:focus)){background-color:var(--ic-action-dark-bg-hover) !important}:host(.navigation-item-side-menu) .focus-indicator:focus-within{box-shadow:none}:host(.navigation-item-side-menu) .link:focus,:host(.navigation-item-side-menu) ::slotted(a:focus){box-shadow:var(--ic-border-focus-inset) !important;width:auto;border-radius:var(--ic-border-radius-inset) !important}:host(.navigation-item-side-menu-selected) .link,:host(.navigation-item-side-menu-selected) ::slotted(a){transition:box-shadow var(--ic-easing-transition-slow),\n background-color var(--ic-easing-transition-slow)}:host(.navigation-item-side-menu-selected) .link:focus,:host(.navigation-item-side-menu) ::slotted(a.active:focus),:host(.navigation-item-top-nav-child) ::slotted(a.active:focus){margin-left:var(--ic-space-xs) !important;padding-left:var(--ic-space-xs) !important}:host(.navigation-item-top-nav-child) .link,:host(.navigation-item-top-nav-child) ::slotted(a){height:2.5rem;width:-moz-fit-content;width:fit-content;min-width:9.063rem;color:var(--ic-color-primary-text);display:flex;align-items:center;justify-content:flex-start;padding:0 var(--ic-space-md) !important;text-decoration:none;position:relative;transition:box-shadow var(--ic-transition-duration-fast),\n border-radius var(--ic-transition-duration-slow)}:host(.navigation-item-top-nav-child) ::slotted(a){font:var(--ic-font-body) !important;letter-spacing:var(--ic-font-letter-spacing-0pt005) !important}:host(.navigation-item-top-nav-child) .link:hover:not(:focus){background-color:var(--ic-action-dark-bg-hover) !important}:host(.navigation-item-top-nav-child) ::slotted(a:hover):not(:focus){background-color:var(--ic-action-dark-bg-hover) !important}:host(.navigation-item-top-nav-child) .link:focus,:host(.navigation-item-top-nav-child) ::slotted(a:focus){z-index:1;outline:var(--ic-hc-focus-outline);border-radius:var(--ic-border-radius-inset);box-shadow:var(--ic-border-focus-inset);transition:border-radius 0s, box-shadow var(--ic-transition-duration-fast)}:host(.navigation-item-top-nav-child) ::slotted(a.active:focus){box-shadow:var(--ic-border-focus-inset);border-radius:var(--ic-border-radius-inset)}:host(.navigation-item-side-menu) .link:active:not(:focus){background-color:var(--ic-action-dark-bg-active)}:host(.navigation-item-top-nav-child) .link:active:not(:focus),:host(.navigation-item-top-nav-child) ::slotted(a:active):not(:focus){outline:var(--ic-hc-focus-outline);background-color:var(--ic-action-dark-bg-active)}:host(.navigation-item-top-nav-child) ::slotted(a:active):not(:focus),:host(.navigation-item-side-menu) ::slotted(a:active):not(:focus){background-color:var(--ic-action-dark-bg-active) !important}:host(.navigation-item-side-menu-selected) *,:host(.navigation-item-top-nav-child-selected) *,:host(.navigation-item-side-menu) ::slotted(a.active),:host(.navigation-item-top-nav-child) ::slotted(a.active){font-weight:700 !important}:host(.navigation-item-top-nav-child) ::slotted(a.active)::before,:host(.navigation-item-top-nav-child-selected) .link::before,:host(.navigation-item-side-menu-selected) .link::before,:host(.navigation-item-side-menu) ::slotted(a.active)::before,:host(.navigation-item-side-menu-selected) .link:focus::before,:host(.navigation-item-side-menu) ::slotted(a.active:focus)::before{content:"";position:absolute;left:0;width:var(--ic-space-xs);height:inherit;min-height:2.5rem;background-color:var(--ic-action-default);transition:left 0s}:host(.navigation-item-top-nav-child-selected) .link::before,:host(.navigation-item-side-menu-selected) .link::before,:host(.navigation-item-side-menu-selected) .link:focus::before{margin-top:0.25rem}:host(.navigation-item-top-nav-child-selected) .link:focus{margin-left:var(--ic-space-xs);margin-right:calc(-1 * var(--ic-space-xs));padding-left:var(--ic-space-xs) !important}:host(.navigation-item-top-nav-child-selected) .link:focus::before{left:calc(-1 * var(--ic-space-xs));z-index:1}:host(.navigation-item-side-menu-selected) .link::before,:host(.navigation-item-side-menu) ::slotted(a.active)::before,:host(.navigation-item-side-menu-selected) .link:focus::before,:host(.navigation-item-side-menu) ::slotted(a.active:focus)::before{z-index:1}:host(.navigation-item-side-menu-selected) .link:focus::before,:host(.navigation-item-side-menu) ::slotted(a.active:focus)::before,:host(.navigation-item-top-nav-child) ::slotted(a.active:focus)::before{left:calc(-1 * var(--ic-space-xs))}:host(.navigation-item-side-menu-selected) .link::after{display:none}:host(.navigation-item-side-nav-collapsed) .link{height:100%}:host(.navigation-item-side-nav-collapsed) ::slotted(svg),:host(.navigation-item-side-nav-collapsed-with-label) ::slotted(svg){margin:auto;pointer-events:none}:host(.navigation-item-side-nav-collapsed) .icon,:host(.navigation-item-side-nav-collapsed-with-label) .icon,:host(.navigation-item-side-nav-collapsed-with-label) ic-typography{align-items:center;padding:0;margin:auto 0;width:-moz-fit-content;width:fit-content;pointer-events:none}:host(.navigation-item-side-nav-collapsed-with-label) ic-typography{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%;text-align:center}:host(.navigation-item-side-nav-collapsed-with-label) .link,:host(.navigation-item-side-nav-collapsed-with-label) ::slotted(a){display:flex;flex-direction:column;height:-moz-fit-content;height:fit-content;padding:var(--ic-space-xs) !important;gap:var(--ic-space-xxs)}:host(.navigation-item-side-nav.navigation-item-side-nav-collapsed-with-label) .link,:host(.navigation-item-side-nav.navigation-item-side-nav-collapsed-with-label) ::slotted(a){height:auto !important;gap:0;width:auto;padding:var(--ic-space-xs) !important}:host(.navigation-item-side-nav.navigation-item-side-nav-collapsed-with-label) ::slotted(a){display:block;text-align:center}:host(.navigation-item-side-nav.navigation-item-side-nav-collapsed-with-label) .link ic-typography{opacity:1;min-width:-moz-min-content;min-width:min-content}:host(.navigation-item-side-nav-collapsed) svg,:host(.navigation-item-side-nav-collapsed-with-label) svg{display:none}::slotted(svg){fill:var(--ic-theme-text);width:var(--ic-space-lg);margin-left:var(--ic-space-md)}.icon{height:var(--ic-space-lg);width:var(--ic-space-xxl);margin-left:calc(-1 * var(--ic-space-md));flex:0 1 0%;position:relative}.icon>::slotted(*){margin-left:var(--ic-space-md) !important}:host(.navigation-item-side-nav-collapsed) .icon>::slotted(*){margin:auto !important}:host(.navigation-item-side-nav) .link,:host(.navigation-item-side-nav) ::slotted(a){height:var(--navigation-item-height, 56px);min-height:var(--navigation-item-min-height);width:var(--navigation-item-width, auto);justify-content:var(--navigation-item-justify-content);display:flex;gap:var(--ic-space-xs);box-sizing:border-box;color:var(--navigation-item-child-color) !important;text-decoration:none !important;white-space:nowrap;padding-top:var(--ic-space-md) !important;padding-bottom:var(--ic-space-md) !important;text-wrap:wrap}:host(.navigation-item-side-nav.navigation-item-top-nav-child) .link,:host(.navigation-item-side-nav.navigation-item-top-nav-child) ::slotted(a){height:var(--navigation-item-child-height);width:var(--navigation-group-width);color:var(--navigation-item-child-color) !important;display:flex;gap:0.625rem;box-sizing:border-box;min-width:0;transition:box-shadow var(--ic-easing-transition-fast);text-decoration:none !important;white-space:nowrap}:host(.navigation-item-side-nav.navigation-item-top-nav-child) .link:focus,:host(.navigation-item-side-nav.navigation-item-top-nav-child) ::slotted(a:focus){box-shadow:var(--ic-border-focus-dark)}:host(.navigation-item-side-nav.navigation-item-side-menu) .link:active{background-color:var(--navigation-item-child-active)}:host(.navigation-item-side-nav.navigation-item-top-nav-child) .link:active,:host(.navigation-item-side-nav.navigation-item-top-nav-child) ::slotted(a:active){background-color:var(--navigation-item-child-active)}:host(.navigation-item-side-nav) a.link ic-typography,:host(.navigation-item-side-nav.navigation-item-top-nav-child) a.link ic-typography,:host(.navigation-item-side-nav) div.link ic-typography,:host(.navigation-item-side-nav.navigation-item-top-nav-child) div.link ic-typography,.navigation-item-side-nav-slotted-text{opacity:var(--navigation-item-label-opacity);transition:opacity var(--ic-easing-transition-slow);white-space:wrap;text-overflow:ellipsis;overflow:hidden}:host(.navigation-item-side-nav.navigation-item-selected) .link,:host(.navigation-item-side-nav.navigation-item) ::slotted(a.active){box-shadow:inset 0.313rem 0 0 var(--ic-theme-text)}:host(.navigation-item-side-nav.navigation-item-selected) .link::before,:host(.navigation-item-side-nav) ::slotted(a.active)::before{content:"";display:block;position:absolute;inset:0 0 0 0.313rem;border-radius:0.688rem !important;transition:var(--ic-easing-transition-slow)}:host(.navigation-item-side-nav.navigation-item-selected) .link:focus::before,:host(.navigation-item-side-nav) ::slotted(a.active:focus)::before{box-shadow:var(--ic-border-focus-inset)}:host(:not(.navigation-item-side-nav-collapsed).navigation-item-side-nav.navigation-item-side-nav-collapsed-with-label) .link{opacity:var(--navigation-item-label-opacity);height:auto}:host(.navigation-item-top-nav-child.navigation-item-side-nav-collapsed-with-label) .link,:host(.navigation-item-top-nav-child.navigation-item-side-nav-collapsed-with-label) ::slotted(a){min-width:var(--navigation-group-item-min-width);padding:var(--ic-space-xs) !important;height:auto;gap:0}:host(.navigation-item-top-nav-child.navigation-item-side-nav-collapsed-with-label) ::slotted(a){display:block}:host(.navigation-item-side-nav.navigation-item-selected) .link::after,:host(.navigation-item-side-nav) ::slotted(a.active)::after{display:none}:host(.navigation-item-side-nav.navigation-item) .link:focus,:host(.navigation-item-side-nav.navigation-item) ::slotted(a:focus){box-shadow:var(--ic-border-focus-inset);border-radius:var(--ic-border-radius-inset);background-color:transparent}:host(.navigation-item-side-nav.navigation-item-selected) .link:focus,:host(.navigation-item-side-nav) ::slotted(a.active:focus){margin:0 auto;box-shadow:inset 0.313rem 0 0 var(--ic-theme-text);border-radius:0}:host(.navigation-item-side-nav.navigation-item) .link:hover:not(:focus){background-color:var(--ic-theme-hover) !important}:host(.navigation-item-page-header).link,:host(.navigation-item-page-header) a,:host(.navigation-item-page-header) ::slotted(a){height:2.5rem !important;color:var(--ic-color-primary-text) !important;transition:all var(--ic-easing-transition-fast) !important;box-shadow:rgba(23 89 188 / 0%) !important}:host(.navigation-item-page-header.navigation-item-selected) .link::after,:host(.navigation-item-page-header) ::slotted(a.active)::after{content:" " !important;position:absolute;bottom:0;left:0;right:0;height:var(--ic-space-xxs);background-color:var(--ic-action-default) !important}:host(.navigation-item-page-header) .link:hover,:host(.navigation-item-page-header) ::slotted(.link:hover),:host(.navigation-item-page-header) ::slotted(a:hover),:host(.navigation-item-page-header) .link:hover:not(:focus){background-color:var(--ic-action-default-bg-hover) !important;cursor:pointer}:host(.navigation-item-page-header) .link:focus,:host(.navigation-item-page-header) ::slotted(a:focus){box-shadow:var(--ic-border-focus)}:host(.navigation-item-page-header) .link:active,:host(.navigation-item-page-header) ::slotted(a:active){background-color:var(--ic-action-default-bg-active) !important}:host(.navigation-item-page-header.navigation-item-selected) .link:focus::after,:host(.navigation-item-page-header) ::slotted(a.active:focus)::after{border-bottom-left-radius:var(--ic-border-radius);border-bottom-right-radius:var(--ic-border-radius)}:host(.navigation-item-page-header.navigation-item-selected.with-transition) .link,:host(.navigation-item-page-header.navigation-item-selected.with-transition) ::slotted(a.active){transition:all var(--ic-easing-transition-fast),\n border-color var(--ic-transition-duration-fast)}:host(.navigation-item-page-header) ::slotted(a.active)::before,:host(.navigation-item-page-header) ::slotted(a.active:focus)::before,:host(.navigation-item-page-header.navigation-item-selected) .link:focus::before{display:none}.open-in-new-icon{flex:1}.open-in-new-icon svg{margin-top:var(--ic-space-xxs);padding-left:var(--ic-space-xxs)}:host(.navigation-item-side-nav) .open-in-new-icon{margin-left:calc(-1 * var(--ic-space-xs))}:host(.navigation-item-top-nav) .open-in-new-icon svg,:host(.navigation-item-page-header) .open-in-new-icon svg,:host(.navigation-item-side-nav) .open-in-new-icon svg{height:0.875rem;width:0.875rem}:host(.navigation-item-side-menu) .open-in-new-icon svg,:host(.navigation-item-top-nav-child) .open-in-new-icon svg{height:var(--ic-space-md);width:var(--ic-space-md)}:host(.navigation-item-page-header) .open-in-new-icon svg,:host(.navigation-item-top-nav-child) .open-in-new-icon svg,:host(.navigation-item-side-menu) .open-in-new-icon svg{fill:var(--ic-color-primary-text)}';const g=class{constructor(a){i(this,a);this.childBlur=t(this,"childBlur",7);this.navItemClicked=t(this,"navItemClicked",7);this.isInitialRender=true;this.displayDefaultNavigationItem=(i,t,a,o,s,r,d)=>{const c=this.isTopNavChild||this.inTopNavSideMenu?"body":"label";const l=this.expandable&&e("div",{class:{svg:true},innerHTML:v});const m=this.el.querySelector('[slot="icon"]')&&e("div",{class:"icon"},e("slot",{name:"icon"}),n(this.el,"badge")&&e("slot",{name:"badge"}));if(i!==""){return e("a",{href:i,target:a,rel:o,hreflang:t,referrerPolicy:s,download:r!==false?r:null,class:"link",ref:i=>this.itemEl=i,part:"link"},m,e("ic-typography",{variant:c},d),e("div",{class:"chevron-container"},l),a==="_blank"&&e("span",{class:"open-in-new-icon",innerHTML:h}))}return e("div",{tabindex:"0",class:"link",ref:i=>this.itemEl=i},m,e("ic-typography",{variant:c},d),l)};this.topNavResizedHandler=i=>{const t=i.detail.size;if(t!==this.deviceSize){this.deviceSize=t;this.inTopNavSideMenu=t<=s.L}};this.sideNavExpandHandler=i=>{const{sideNavExpanded:t,sideNavMobile:e}=i.detail;this.sideNavExpanded=t;this.isSideNavMobile=e};this.handleBlur=i=>{if(i.relatedTarget!==null){const t=i.relatedTarget;if(t.tagName==="IC-NAVIGATION-ITEM"){return}}this.childBlur.emit()};this.handleClick=()=>{this.navItemClicked.emit()};this.generateTooltipLabel=()=>{if(this.label){return this.label}if(this.navigationSlot){return this.navigationSlot.textContent}if(this.el.children[0]){return this.el.children[0].textContent}return""};this.renderNavigationItemContent=()=>{if(this.label){return this.displayDefaultNavigationItem(this.href,this.hreflang,this.target,this.rel,this.referrerpolicy,this.download,this.label)}if(this.navigationSlot){return e("slot",{name:"navigation-item"})}return e("slot",null)};this.deviceSize=s.XL;this.focusStyle=r();this.inTopNavSideMenu=false;this.isSideNavMobile=false;this.isTopNavChild=false;this.navigationType=undefined;this.parentEl=undefined;this.sideNavExpanded=false;this.collapsedIconLabel=false;this.displayNavigationTooltip=false;this.download=false;this.expandable=false;this.href="";this.hreflang=undefined;this.label=undefined;this.rel=undefined;this.referrerpolicy=undefined;this.selected=false;this.target=undefined}disconnectedCallback(){if(this.navigationType==="side"){this.parentEl.removeEventListener("sideNavExpanded",this.sideNavExpandHandler)}else if(this.navigationType==="top"){this.parentEl.removeEventListener("topNavResized",this.topNavResizedHandler)}}componentWillLoad(){const i=l(this.el);this.navigationType=i.navType;this.parentEl=i.parent;if(this.navigationType==="side"){this.parentEl.addEventListener("sideNavExpanded",this.sideNavExpandHandler)}else if(this.navigationType==="top"){this.parentEl.addEventListener("topNavResized",this.topNavResizedHandler)}if(d(this.el)==="IC-NAVIGATION-GROUP"&&this.navigationType==="top"){this.isTopNavChild=true}this.deviceSize=c();if(this.deviceSize<=s.L&&this.navigationType==="top"){this.inTopNavSideMenu=true}this.navigationSlot=this.el.querySelector('[slot="navigation-item"]');if(this.navigationSlot){this.navigationSlot.ariaLabel=this.navigationSlot.textContent.trim()}}componentDidUpdate(){this.isInitialRender=false}themeChangeHandler(i){const t=i.detail;this.focusStyle=t.mode}async setFocus(){if(this.itemEl){this.itemEl.focus()}}render(){const{inTopNavSideMenu:i,isTopNavChild:t,selected:o}=this;return e(a,{class:{["navigation-item"]:true,["navigation-item-top-nav"]:!i&&this.navigationType==="top",["navigation-item-top-nav-child-selected"]:t&&!i&&o,[this.focusStyle]:!i&&!t||this.navigationType==="side"&&t,["navigation-item-selected"]:!t&&o,["navigation-item-side-menu"]:i,["navigation-item-side-menu-selected"]:i&&o,["navigation-item-top-nav-child"]:t&&!i,["navigation-item-page-header"]:this.navigationType==="page-header",["with-transition"]:!this.isInitialRender,["navigation-item-side-nav"]:this.navigationType==="side",["navigation-item-side-nav-collapsed"]:(!this.sideNavExpanded||this.displayNavigationTooltip)&&this.navigationType==="side",["navigation-item-side-nav-collapsed-with-label"]:!this.sideNavExpanded&&this.navigationType==="side"&&this.collapsedIconLabel&&!this.isSideNavMobile,["expandable"]:this.expandable},onBlur:t&&!i?this.handleBlur:null,onClick:this.handleClick,"aria-current":o?"page":null,role:"listitem"},e("ic-tooltip",{label:this.generateTooltipLabel(),target:"navigation-item",placement:"right",class:{["tooltip-navigation-item"]:true,["tooltip-navigation-item-side-nav-collapsed"]:(!this.sideNavExpanded||this.displayNavigationTooltip)&&this.navigationType==="side",["tooltip-long-label-navigation-item-side-nav-expanded"]:this.el.hasAttribute("[display-navigation-tooltip = 'true']")}},this.renderNavigationItemContent()))}static get delegatesFocus(){return true}get el(){return o(this)}};g.style=m;export{g as ic_navigation_item};
|
|
2
|
-
//# sourceMappingURL=p-f58da6ae.entry.js.map
|