@ukic/web-components 2.15.0 → 2.17.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/helpers-3d0705ed.js.map +1 -1
- package/dist/cjs/ic-badge.cjs.entry.js +15 -7
- package/dist/cjs/ic-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-dialog.cjs.entry.js +2 -1
- package/dist/cjs/ic-dialog.cjs.entry.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-badge/ic-badge.js +15 -7
- package/dist/collection/components/ic-badge/ic-badge.js.map +1 -1
- package/dist/collection/components/ic-badge/test/basic/ic-badge.spec.js +2 -2
- package/dist/collection/components/ic-badge/test/basic/ic-badge.spec.js.map +1 -1
- package/dist/collection/components/ic-dialog/ic-dialog.js +2 -1
- package/dist/collection/components/ic-dialog/ic-dialog.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 +14 -0
- 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-badge.js +16 -8
- package/dist/components/ic-badge.js.map +1 -1
- package/dist/components/ic-dialog.js +2 -1
- package/dist/components/ic-dialog.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-aac0195e.entry.js → p-01da2341.entry.js} +2 -2
- package/dist/core/{p-c2173562.entry.js → p-034723b0.entry.js} +2 -2
- package/dist/core/p-034723b0.entry.js.map +1 -0
- package/dist/core/{p-04d2f198.entry.js → p-0c679975.entry.js} +2 -2
- package/dist/core/{p-8cbbe579.entry.js → p-14a0c9a9.entry.js} +2 -2
- package/dist/core/{p-f026466e.entry.js → p-19247a5a.entry.js} +2 -2
- package/dist/core/{p-563c2522.entry.js → p-196511f4.entry.js} +2 -2
- package/dist/core/{p-2edbdbaf.entry.js → p-1cca9f24.entry.js} +2 -2
- package/dist/core/p-227761a5.entry.js +2 -0
- package/dist/core/p-227761a5.entry.js.map +1 -0
- package/dist/core/{p-fc91292d.entry.js → p-2499416a.entry.js} +2 -2
- package/dist/core/p-2499416a.entry.js.map +1 -0
- package/dist/core/p-26b7b18f.js.map +1 -1
- package/dist/core/{p-cc0ab439.entry.js → p-2f973f6a.entry.js} +2 -2
- package/dist/core/{p-ab14339d.entry.js → p-389d8200.entry.js} +2 -2
- package/dist/core/{p-fc83d8d7.entry.js → p-3aa1b3c7.entry.js} +2 -2
- package/dist/core/p-40a59fd5.entry.js +2 -0
- package/dist/core/p-40a59fd5.entry.js.map +1 -0
- package/dist/core/p-47b1ec8a.entry.js +2 -0
- package/dist/core/p-47b1ec8a.entry.js.map +1 -0
- package/dist/core/{p-5479d3e5.entry.js → p-4c992683.entry.js} +2 -2
- package/dist/core/{p-268355c1.js → p-4cefa844.js} +2 -2
- package/dist/core/p-4cefa844.js.map +1 -0
- package/dist/core/{p-cd2d2141.entry.js → p-55f7eecc.entry.js} +2 -2
- package/dist/core/{p-880bcf91.entry.js → p-573186d7.entry.js} +2 -2
- package/dist/core/{p-ba31ee69.entry.js → p-625a06af.entry.js} +2 -2
- package/dist/core/{p-65d3c0f1.entry.js → p-63d6ce35.entry.js} +2 -2
- package/dist/core/p-67f670b2.entry.js +2 -0
- package/dist/core/{p-9b4fd843.entry.js.map → p-67f670b2.entry.js.map} +1 -1
- package/dist/core/{p-8841668b.entry.js → p-6d623125.entry.js} +2 -2
- package/dist/core/{p-4e3d46f2.entry.js → p-72621de7.entry.js} +2 -2
- package/dist/core/{p-dfef57d3.entry.js → p-76d82d3c.entry.js} +2 -2
- package/dist/core/{p-5421ceb4.entry.js → p-7e636a51.entry.js} +2 -2
- package/dist/core/{p-e7483ee5.entry.js → p-83d1a0e1.entry.js} +2 -2
- package/dist/core/p-87ec0cef.entry.js +2 -0
- package/dist/core/{p-ba8d968c.entry.js.map → p-87ec0cef.entry.js.map} +1 -1
- package/dist/core/{p-9c157974.entry.js → p-901eacb8.entry.js} +2 -2
- package/dist/core/{p-c43946b0.entry.js → p-91527032.entry.js} +2 -2
- package/dist/core/{p-04dd9fe8.entry.js → p-917abbfa.entry.js} +2 -2
- package/dist/core/{p-14ea9cc7.entry.js → p-91dd1555.entry.js} +2 -2
- package/dist/core/{p-e47f887a.entry.js → p-9870bc1a.entry.js} +2 -2
- package/dist/core/{p-2e3845be.entry.js → p-99db319c.entry.js} +2 -2
- package/dist/core/{p-a222554a.entry.js → p-a14b672a.entry.js} +2 -2
- package/dist/core/p-a14b672a.entry.js.map +1 -0
- package/dist/core/p-a98506a6.entry.js +2 -0
- package/dist/core/p-a98506a6.entry.js.map +1 -0
- package/dist/core/{p-934c2a94.entry.js → p-af5931f4.entry.js} +2 -2
- package/dist/core/{p-e7b676fc.entry.js → p-b0892084.entry.js} +2 -2
- package/dist/core/{p-1e84a765.entry.js → p-b8a82735.entry.js} +2 -2
- package/dist/core/{p-8352d752.entry.js → p-c37bf1c6.entry.js} +2 -2
- package/dist/core/{p-8a77a417.entry.js → p-c4ff9e66.entry.js} +2 -2
- package/dist/core/{p-c1bb5018.entry.js → p-c8538a01.entry.js} +2 -2
- package/dist/core/{p-b7bf772b.entry.js → p-d192a1e4.entry.js} +2 -2
- package/dist/core/p-d93267e0.entry.js +2 -0
- package/dist/core/p-d93267e0.entry.js.map +1 -0
- package/dist/core/{p-77503f4f.entry.js → p-dd8861c0.entry.js} +2 -2
- package/dist/core/{p-cdb51adf.entry.js → p-e21263d5.entry.js} +2 -2
- package/dist/core/{p-c0525936.entry.js → p-e6eafc88.entry.js} +2 -2
- package/dist/core/{p-917b15da.entry.js → p-eacc562b.entry.js} +2 -2
- package/dist/core/{p-f926174d.entry.js → p-ec1c7ecd.entry.js} +2 -2
- package/dist/core/{p-18137908.entry.js → p-edbb9e9d.entry.js} +2 -2
- package/dist/core/{p-d5cadfa1.entry.js → p-ef21f737.entry.js} +2 -2
- package/dist/core/{p-77a00075.entry.js → p-fc20178a.entry.js} +2 -2
- package/dist/core/{p-f24084fa.entry.js → p-fcf42a0a.entry.js} +2 -2
- package/dist/core/p-fcf42a0a.entry.js.map +1 -0
- package/dist/esm/core.js +1 -1
- package/dist/esm/{helpers-4262def4.js → helpers-8cc07380.js} +2 -2
- package/dist/esm/helpers-8cc07380.js.map +1 -0
- package/dist/esm/ic-accordion.entry.js +1 -1
- package/dist/esm/ic-alert.entry.js +1 -1
- package/dist/esm/ic-back-to-top.entry.js +1 -1
- package/dist/esm/ic-badge.entry.js +16 -8
- package/dist/esm/ic-badge.entry.js.map +1 -1
- package/dist/esm/ic-breadcrumb-group.entry.js +1 -1
- package/dist/esm/ic-breadcrumb.entry.js +1 -1
- package/dist/esm/ic-button_3.entry.js +1 -1
- package/dist/esm/ic-card.entry.js +1 -1
- package/dist/esm/ic-checkbox-group.entry.js +1 -1
- package/dist/esm/ic-checkbox.entry.js +1 -1
- package/dist/esm/ic-chip.entry.js +1 -1
- package/dist/esm/ic-data-row.entry.js +1 -1
- package/dist/esm/ic-dialog.entry.js +3 -2
- package/dist/esm/ic-dialog.entry.js.map +1 -1
- package/dist/esm/ic-divider.entry.js +1 -1
- package/dist/esm/ic-empty-state.entry.js +1 -1
- package/dist/esm/ic-footer-link-group.entry.js +1 -1
- package/dist/esm/ic-footer-link.entry.js +1 -1
- package/dist/esm/ic-footer.entry.js +1 -1
- package/dist/esm/ic-hero.entry.js +1 -1
- package/dist/esm/ic-horizontal-scroll.entry.js +1 -1
- package/dist/esm/ic-input-component-container_3.entry.js +1 -1
- package/dist/esm/ic-input-label_2.entry.js +1 -1
- package/dist/esm/ic-link.entry.js +1 -1
- package/dist/esm/ic-link.entry.js.map +1 -1
- package/dist/esm/ic-menu-group.entry.js +1 -1
- package/dist/esm/ic-menu-item.entry.js +1 -1
- package/dist/esm/ic-navigation-button.entry.js +1 -1
- package/dist/esm/ic-navigation-button.entry.js.map +1 -1
- package/dist/esm/ic-navigation-group.entry.js +16 -13
- 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-navigation-menu.entry.js +1 -1
- package/dist/esm/ic-page-header.entry.js +1 -1
- package/dist/esm/ic-pagination-item.entry.js +1 -1
- package/dist/esm/ic-pagination.entry.js +1 -1
- package/dist/esm/ic-popover-menu.entry.js +1 -1
- package/dist/esm/ic-radio-group.entry.js +1 -1
- package/dist/esm/ic-radio-option.entry.js +1 -1
- package/dist/esm/ic-search-bar.entry.js +1 -1
- package/dist/esm/ic-select.entry.js +1 -1
- package/dist/esm/ic-side-navigation.entry.js +1 -1
- package/dist/esm/ic-side-navigation.entry.js.map +1 -1
- package/dist/esm/ic-status-tag.entry.js +1 -1
- package/dist/esm/ic-step.entry.js +1 -1
- package/dist/esm/ic-stepper.entry.js +1 -1
- package/dist/esm/ic-switch.entry.js +1 -1
- package/dist/esm/ic-tab-group.entry.js +1 -1
- package/dist/esm/ic-tab-panel.entry.js +1 -1
- package/dist/esm/ic-tab.entry.js +1 -1
- package/dist/esm/ic-text-field.entry.js +1 -1
- package/dist/esm/ic-text-field.entry.js.map +1 -1
- package/dist/esm/ic-theme.entry.js +1 -1
- package/dist/esm/ic-toast.entry.js +1 -1
- package/dist/esm/ic-toggle-button.entry.js +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/ic-typography.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/types-6f6b41a5.js.map +1 -1
- package/dist/types/components/ic-badge/ic-badge.d.ts +1 -0
- 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 +7 -6
- package/dist/types/utils/types.d.ts +1 -0
- package/hydrate/index.js +105 -111
- 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-22cbe39b.entry.js +0 -2
- package/dist/core/p-22cbe39b.entry.js.map +0 -1
- package/dist/core/p-268355c1.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-9b4fd843.entry.js +0 -2
- package/dist/core/p-a222554a.entry.js.map +0 -1
- package/dist/core/p-b1e74a89.entry.js +0 -2
- package/dist/core/p-b1e74a89.entry.js.map +0 -1
- package/dist/core/p-ba8d968c.entry.js +0 -2
- package/dist/core/p-c2173562.entry.js.map +0 -1
- package/dist/core/p-f24084fa.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/core/p-fc91292d.entry.js.map +0 -1
- package/dist/esm/helpers-4262def4.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
- /package/dist/core/{p-aac0195e.entry.js.map → p-01da2341.entry.js.map} +0 -0
- /package/dist/core/{p-04d2f198.entry.js.map → p-0c679975.entry.js.map} +0 -0
- /package/dist/core/{p-8cbbe579.entry.js.map → p-14a0c9a9.entry.js.map} +0 -0
- /package/dist/core/{p-f026466e.entry.js.map → p-19247a5a.entry.js.map} +0 -0
- /package/dist/core/{p-563c2522.entry.js.map → p-196511f4.entry.js.map} +0 -0
- /package/dist/core/{p-2edbdbaf.entry.js.map → p-1cca9f24.entry.js.map} +0 -0
- /package/dist/core/{p-cc0ab439.entry.js.map → p-2f973f6a.entry.js.map} +0 -0
- /package/dist/core/{p-ab14339d.entry.js.map → p-389d8200.entry.js.map} +0 -0
- /package/dist/core/{p-fc83d8d7.entry.js.map → p-3aa1b3c7.entry.js.map} +0 -0
- /package/dist/core/{p-5479d3e5.entry.js.map → p-4c992683.entry.js.map} +0 -0
- /package/dist/core/{p-cd2d2141.entry.js.map → p-55f7eecc.entry.js.map} +0 -0
- /package/dist/core/{p-880bcf91.entry.js.map → p-573186d7.entry.js.map} +0 -0
- /package/dist/core/{p-ba31ee69.entry.js.map → p-625a06af.entry.js.map} +0 -0
- /package/dist/core/{p-65d3c0f1.entry.js.map → p-63d6ce35.entry.js.map} +0 -0
- /package/dist/core/{p-8841668b.entry.js.map → p-6d623125.entry.js.map} +0 -0
- /package/dist/core/{p-4e3d46f2.entry.js.map → p-72621de7.entry.js.map} +0 -0
- /package/dist/core/{p-dfef57d3.entry.js.map → p-76d82d3c.entry.js.map} +0 -0
- /package/dist/core/{p-5421ceb4.entry.js.map → p-7e636a51.entry.js.map} +0 -0
- /package/dist/core/{p-e7483ee5.entry.js.map → p-83d1a0e1.entry.js.map} +0 -0
- /package/dist/core/{p-9c157974.entry.js.map → p-901eacb8.entry.js.map} +0 -0
- /package/dist/core/{p-c43946b0.entry.js.map → p-91527032.entry.js.map} +0 -0
- /package/dist/core/{p-04dd9fe8.entry.js.map → p-917abbfa.entry.js.map} +0 -0
- /package/dist/core/{p-14ea9cc7.entry.js.map → p-91dd1555.entry.js.map} +0 -0
- /package/dist/core/{p-e47f887a.entry.js.map → p-9870bc1a.entry.js.map} +0 -0
- /package/dist/core/{p-2e3845be.entry.js.map → p-99db319c.entry.js.map} +0 -0
- /package/dist/core/{p-934c2a94.entry.js.map → p-af5931f4.entry.js.map} +0 -0
- /package/dist/core/{p-e7b676fc.entry.js.map → p-b0892084.entry.js.map} +0 -0
- /package/dist/core/{p-1e84a765.entry.js.map → p-b8a82735.entry.js.map} +0 -0
- /package/dist/core/{p-8352d752.entry.js.map → p-c37bf1c6.entry.js.map} +0 -0
- /package/dist/core/{p-8a77a417.entry.js.map → p-c4ff9e66.entry.js.map} +0 -0
- /package/dist/core/{p-c1bb5018.entry.js.map → p-c8538a01.entry.js.map} +0 -0
- /package/dist/core/{p-b7bf772b.entry.js.map → p-d192a1e4.entry.js.map} +0 -0
- /package/dist/core/{p-77503f4f.entry.js.map → p-dd8861c0.entry.js.map} +0 -0
- /package/dist/core/{p-cdb51adf.entry.js.map → p-e21263d5.entry.js.map} +0 -0
- /package/dist/core/{p-c0525936.entry.js.map → p-e6eafc88.entry.js.map} +0 -0
- /package/dist/core/{p-917b15da.entry.js.map → p-eacc562b.entry.js.map} +0 -0
- /package/dist/core/{p-f926174d.entry.js.map → p-ec1c7ecd.entry.js.map} +0 -0
- /package/dist/core/{p-18137908.entry.js.map → p-edbb9e9d.entry.js.map} +0 -0
- /package/dist/core/{p-d5cadfa1.entry.js.map → p-ef21f737.entry.js.map} +0 -0
- /package/dist/core/{p-77a00075.entry.js.map → p-fc20178a.entry.js.map} +0 -0
@@ -1,13 +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("page-header", () => {
|
5
|
-
it("passes accessibility", async () => {
|
6
|
-
const el = await fixture(`
|
7
|
-
<ic-page-header heading="Test"></ic-page-header>
|
8
|
-
`);
|
9
|
-
checkShadowElementRendersCorrectly(el);
|
10
|
-
expect(await axe(el)).toHaveNoViolations();
|
11
|
-
});
|
12
|
-
});
|
13
|
-
//# sourceMappingURL=ic-page-header.test.a11y.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ic-page-header.test.a11y.js","sourceRoot":"","sources":["../../../../../src/components/ic-page-header/test/a11y/ic-page-header.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,aAAa,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC;;OAEtB,CAAC,CAAC;QACL,kCAAkC,CAAC,EAAE,CAAC,CAAC;QACvC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { fixture } from \"@open-wc/testing-helpers\";\nimport { axe } from \"jest-axe\";\nimport { checkShadowElementRendersCorrectly } from \"../../../../utils/testa11y.helpers\";\n\ndescribe(\"page-header\", () => {\n it(\"passes accessibility\", async () => {\n const el = await fixture(`\n <ic-page-header heading=\"Test\"></ic-page-header>\n `);\n checkShadowElementRendersCorrectly(el);\n expect(await axe(el)).toHaveNoViolations();\n });\n});\n"]}
|
@@ -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,GAAG,EAAE;YAC9C,MAAM,OAAO,GAAG,QAAQ;iBACrB,gBAAgB,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;iBACzC,UAAU,CAAC,aAAa,CAAC,YAAY,CAAC;iBACtC,UAAU,CAAC,aAAa,CAAC,uBAAuB,CAAC,CAAC;YAErD,OAAO,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;QAClD,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kEAAkE,EAAE,KAAK,IAAI,EA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M,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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,EAAE,CAAC;QACvB,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAC5B,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAC;QACvB,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAC5B,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAC;QACvB,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAC5B,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAC;QACvB,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAE5B,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;QAExE,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAE5B,MAAM,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 s,h as a,H as t,g as i}from"./p-6b5e91e2.js";import{I as c}from"./p-26b7b18f.js";import{h as r,r as e,g as o,b as h,c as n,d as l,a as p}from"./p-268355c1.js";const d="@media (prefers-reduced-motion: no-preference){:host(.show){animation:expand var(--ic-transition-duration-slow)}:host(.hide){animation:shrink var(--ic-transition-duration-slow)}}:host{display:flex;height:var(--ic-space-md);min-width:var(--ic-space-md);width:-moz-fit-content;width:fit-content;border-radius:calc(2 * var(--ic-space-xxl));position:absolute}:host(.neutral){background-color:var(--ic-architectural-500)}:host(.light){background-color:var(--ic-architectural-40)}:host(.info){background-color:var(--ic-status-info)}:host(.warning){background-color:var(--ic-status-warning-mid)}:host(.error){background-color:var(--ic-status-error)}:host(.success){background-color:var(--ic-status-success)}:host(.small){height:var(--ic-space-sm);min-width:var(--ic-space-sm)}:host(.large){height:calc(var(--ic-space-md) + var(--ic-space-xxs));min-width:calc(var(--ic-space-md) + var(--ic-space-xxs))}:host(.dot.default){height:var(--ic-space-xs);width:var(--ic-space-xs);min-width:var(--ic-space-xs)}:host(.dot.small){height:calc(var(--ic-space-xxs) + var(--ic-space-xxxs));width:calc(var(--ic-space-xxs) + var(--ic-space-xxxs));min-width:calc(var(--ic-space-xxs) + var(--ic-space-xxxs))}:host(.dot.large){height:var(--ic-space-sm);width:var(--ic-space-sm);min-width:var(--ic-space-sm)}:host(.foreground-dark) ::slotted(*){fill:var(--ic-color-primary-text)}:host(.foreground-light) ::slotted(*){fill:white}:host(.foreground-dark) ic-typography{color:var(--ic-color-primary-text)}:host(.foreground-light) ic-typography{color:white}:host(.text) ic-typography{align-self:center;padding:0 calc((var(--ic-space-xs) + var(--ic-space-1px)) / 2)\n var(--ic-space-1px)}:host(.text.small) ic-typography{padding:0 0.2132rem}:host(.text.large) ic-typography{padding:0 calc((var(--ic-space-sm) + var(--ic-space-1px)) / 2)\n var(--ic-space-1px)}:host(.icon) ::slotted(svg){width:var(--ic-space-sm);height:var(--ic-space-sm);padding:var(--ic-space-xxxs)}:host(.icon.small) ::slotted(svg){width:var(--ic-space-xs);height:var(--ic-space-xs)}:host(.icon.large) ::slotted(svg){width:calc(var(--ic-space-sm) + var(--ic-space-xxxs));height:calc(var(--ic-space-sm) + var(--ic-space-xxxs));padding:calc(var(--ic-space-xxxs) + var(--ic-space-1px))}:host(.far){top:calc(-1 * var(--ic-space-xs));right:calc(-1 * var(--ic-space-xs))}:host(.far.small),:host(.dot.far.large){top:calc(-1 * var(--ic-space-xxs));right:calc(-1 * var(--ic-space-xxs))}:host(.dot.far),:host(.dot.far.small){top:calc(-1 * var(--ic-space-xxxs));right:calc(-1 * var(--ic-space-xxxs))}:host(.near){top:calc(-1 * calc(var(--ic-space-xxs) + var(--ic-space-1px)));right:calc(-1 * calc(var(--ic-space-xxs) + var(--ic-space-1px)))}:host(.dot.near){top:calc(-1 * var(--ic-space-1px));right:calc(-1 * var(--ic-space-1px))}:host(.inline){position:static}:host(.hide){visibility:hidden !important;transition:visibility var(--ic-transition-duration-slow)}@keyframes expand{from{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@keyframes shrink{from{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(0)}}";const g=class{constructor(a){s(this,a);this.setBadgeColour=()=>{let s=null;if(this.customColor!==null){const a=this.customColor.slice(0,1);if(a==="#"){s=r(this.customColor)}else if(a.toLowerCase()==="r"){s=e(this.customColor)}this.customColorRGBA=s;this.el.style.backgroundColor=`rgba(${s.r.toString()}, ${s.g.toString()}, ${s.b.toString()}, ${s.a.toString()})`}};this.getBadgeForeground=()=>{let s;let a;let t;switch(this.variant){case"custom":s=this.customColorRGBA.r;a=this.customColorRGBA.g;t=this.customColorRGBA.b;break;case"error":s=parseInt(o("--ic-status-error-r"));a=parseInt(o("--ic-status-error-g"));t=parseInt(o("--ic-status-error-b"));break;case"success":s=parseInt(o("--ic-status-success-r"));a=parseInt(o("--ic-status-success-g"));t=parseInt(o("--ic-status-success-b"));break;case"warning":s=parseInt(o("--ic-status-warning-r"));a=parseInt(o("--ic-status-warning-g"));t=parseInt(o("--ic-status-warning-b"));break;case"info":{const i=r(o("--ic-status-info"));s=i.r;a=i.g;t=i.b;break}case"neutral":{const i=r(o("--ic-architectural-500"));s=i.r;a=i.g;t=i.b;break}case"light":{const i=r(o("--ic-architectural-40"));s=i.r;a=i.g;t=i.b;break}}const i=(s*299+a*587+t*114)/1e3;this.foregroundColour=i>133.3505?c.Dark:c.Light};this.getTextLabel=()=>{let s;if(this.textLabel!==null){if(this.maxNumber!==null){s=Number(this.textLabel)>this.maxNumber?`${this.maxNumber}+`:this.textLabel}else{s=this.textLabel}}return s};this.setAccessibleLabel=()=>{if(h(this.el)!==null){if(n(this.el)==="IC-TAB"){h(this.el).setAttribute("aria-describedby","badge")}else{h(this.el).ariaLabel=`badge displaying ${this.accessibleLabel}`}}};this.isAccessibleLabelDefined=()=>l(this.accessibleLabel)&&this.accessibleLabel!==null;this.accessibleLabel=undefined;this.customColor=null;this.maxNumber=undefined;this.position="far";this.size="default";this.textLabel=undefined;this.type="text";this.variant="neutral";this.visible=true}componentWillLoad(){this.variant==="custom"&&this.setBadgeColour();this.getBadgeForeground();this.isAccessibleLabelDefined()&&this.setAccessibleLabel()}componentDidLoad(){this.type==="text"&&p([{prop:this.textLabel,propName:"text-label"}],"Badge")}async showBadge(){this.visible=true}async hideBadge(){this.visible=false}render(){const{position:s,size:i,type:c,variant:r,foregroundColour:e,visible:o}=this;return a(t,{class:{[`${s}`]:true,[`${i}`]:true,[`${r}`]:true,[`${c}`]:true,[`foreground-${e}`]:e!==null,["show"]:o,["hide"]:!o},id:this.el.id||null,"aria-label":this.isAccessibleLabelDefined()?`badge displaying ${this.accessibleLabel}`:"badge being displayed",role:"status"},c==="icon"&&a("slot",{name:"badge-icon"}),c==="text"&&a("ic-typography",{variant:i==="small"?"badge-small":"badge"},this.getTextLabel()))}static get delegatesFocus(){return true}get el(){return i(this)}};g.style=d;export{g as ic_badge};
|
2
|
-
//# sourceMappingURL=p-22cbe39b.entry.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["icBadgeCss","Badge","this","setBadgeColour","colorRGBA","customColor","firstChar","slice","hexToRgba","toLowerCase","rgbaStrToObj","customColorRGBA","el","style","backgroundColor","r","toString","g","b","a","getBadgeForeground","red","green","blue","variant","parseInt","getCssProperty","info","neutral","light","brightness","foregroundColour","IcThemeForegroundEnum","Dark","Light","getTextLabel","label","textLabel","maxNumber","Number","setAccessibleLabel","getParentElement","getParentElementType","setAttribute","ariaLabel","accessibleLabel","isAccessibleLabelDefined","isPropDefined","componentWillLoad","componentDidLoad","type","onComponentRequiredPropUndefined","prop","propName","showBadge","visible","hideBadge","render","position","size","h","Host","class","id","role","name"],"sources":["src/components/ic-badge/ic-badge.css?tag=ic-badge&encapsulation=shadow","src/components/ic-badge/ic-badge.tsx"],"sourcesContent":["@media (prefers-reduced-motion: no-preference) {\n :host(.show) {\n animation: expand var(--ic-transition-duration-slow);\n }\n\n :host(.hide) {\n animation: shrink var(--ic-transition-duration-slow);\n }\n}\n\n:host {\n display: flex;\n height: var(--ic-space-md);\n min-width: var(--ic-space-md);\n width: fit-content;\n border-radius: calc(2 * var(--ic-space-xxl));\n position: absolute;\n}\n\n:host(.neutral) {\n background-color: var(--ic-architectural-500);\n}\n\n:host(.light) {\n background-color: var(--ic-architectural-40);\n}\n\n:host(.info) {\n background-color: var(--ic-status-info);\n}\n\n:host(.warning) {\n background-color: var(--ic-status-warning-mid);\n}\n\n:host(.error) {\n background-color: var(--ic-status-error);\n}\n\n:host(.success) {\n background-color: var(--ic-status-success);\n}\n\n:host(.small) {\n height: var(--ic-space-sm);\n min-width: var(--ic-space-sm);\n}\n\n:host(.large) {\n height: calc(var(--ic-space-md) + var(--ic-space-xxs));\n min-width: calc(var(--ic-space-md) + var(--ic-space-xxs));\n}\n\n:host(.dot.default) {\n height: var(--ic-space-xs);\n width: var(--ic-space-xs);\n min-width: var(--ic-space-xs);\n}\n\n:host(.dot.small) {\n height: calc(var(--ic-space-xxs) + var(--ic-space-xxxs));\n width: calc(var(--ic-space-xxs) + var(--ic-space-xxxs));\n min-width: calc(var(--ic-space-xxs) + var(--ic-space-xxxs));\n}\n\n:host(.dot.large) {\n height: var(--ic-space-sm);\n width: var(--ic-space-sm);\n min-width: var(--ic-space-sm);\n}\n\n:host(.foreground-dark) ::slotted(*) {\n fill: var(--ic-color-primary-text);\n}\n\n:host(.foreground-light) ::slotted(*) {\n fill: white;\n}\n\n:host(.foreground-dark) ic-typography {\n color: var(--ic-color-primary-text);\n}\n\n:host(.foreground-light) ic-typography {\n color: white;\n}\n\n:host(.text) ic-typography {\n align-self: center;\n padding: 0 calc((var(--ic-space-xs) + var(--ic-space-1px)) / 2)\n var(--ic-space-1px);\n}\n\n:host(.text.small) ic-typography {\n padding: 0 0.2132rem;\n}\n\n:host(.text.large) ic-typography {\n padding: 0 calc((var(--ic-space-sm) + var(--ic-space-1px)) / 2)\n var(--ic-space-1px);\n}\n\n:host(.icon) ::slotted(svg) {\n width: var(--ic-space-sm);\n height: var(--ic-space-sm);\n padding: var(--ic-space-xxxs);\n}\n\n:host(.icon.small) ::slotted(svg) {\n width: var(--ic-space-xs);\n height: var(--ic-space-xs);\n}\n\n:host(.icon.large) ::slotted(svg) {\n width: calc(var(--ic-space-sm) + var(--ic-space-xxxs));\n height: calc(var(--ic-space-sm) + var(--ic-space-xxxs));\n padding: calc(var(--ic-space-xxxs) + var(--ic-space-1px));\n}\n\n:host(.far) {\n top: calc(-1 * var(--ic-space-xs));\n right: calc(-1 * var(--ic-space-xs));\n}\n\n:host(.far.small),\n:host(.dot.far.large) {\n top: calc(-1 * var(--ic-space-xxs));\n right: calc(-1 * var(--ic-space-xxs));\n}\n\n:host(.dot.far),\n:host(.dot.far.small) {\n top: calc(-1 * var(--ic-space-xxxs));\n right: calc(-1 * var(--ic-space-xxxs));\n}\n\n:host(.near) {\n top: calc(-1 * calc(var(--ic-space-xxs) + var(--ic-space-1px)));\n right: calc(-1 * calc(var(--ic-space-xxs) + var(--ic-space-1px)));\n}\n\n:host(.dot.near) {\n top: calc(-1 * var(--ic-space-1px));\n right: calc(-1 * var(--ic-space-1px));\n}\n\n:host(.inline) {\n position: static;\n}\n\n:host(.hide) {\n visibility: hidden !important;\n transition: visibility var(--ic-transition-duration-slow);\n}\n\n@keyframes expand {\n from {\n opacity: 0;\n transform: scale(0);\n }\n\n to {\n opacity: 1;\n transform: scale(1);\n }\n}\n\n@keyframes shrink {\n from {\n opacity: 1;\n transform: scale(1);\n }\n\n to {\n opacity: 0;\n transform: scale(0);\n }\n}\n","import { Component, Element, Host, Method, Prop, h } from \"@stencil/core\";\nimport {\n IcBadgePositions,\n IcBadgeTypes,\n IcBadgeVariants,\n IcColor,\n} from \"./ic-badge.types\";\nimport {\n IcColorRGBA,\n IcSizes,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\nimport {\n getCssProperty,\n getParentElement,\n getParentElementType,\n hexToRgba,\n isPropDefined,\n onComponentRequiredPropUndefined,\n rgbaStrToObj,\n} from \"../../utils/helpers\";\n\n/**\n * @slot badge-icon - Icon will be rendered inside the badge if type is set to icon.\n */\n@Component({\n tag: \"ic-badge\",\n styleUrl: \"ic-badge.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class Badge {\n private customColorRGBA: IcColorRGBA;\n private foregroundColour: IcThemeForeground;\n\n @Element() el: HTMLIcBadgeElement;\n\n /**\n * The accessible label of the badge component to provide context for screen reader users.\n */\n @Prop() accessibleLabel?: string;\n\n /**\n * The custom badge colour. This will only style the badge component if variant=\"custom\".\n * Can be a hex value e.g. \"#ff0000\", RGB e.g. \"rgb(255, 0, 0)\", or RGBA e.g. \"rgba(255, 0, 0, 1)\".\n */\n @Prop() customColor?: IcColor = null;\n\n /**\n * The maximum number shown on the badge appended with a +.\n * This will only be displayed if type=\"text\" and textLabel is not empty.\n */\n @Prop() maxNumber?: number;\n\n /**\n * The positioning of the badge in reference to the parent element.\n */\n @Prop() position?: IcBadgePositions = \"far\";\n\n /**\n * The size of the badge to be displayed.\n */\n @Prop() size?: IcSizes = \"default\";\n\n /**\n * The text displayed in the badge. This will only be displayed if type=\"text\".\n */\n @Prop() textLabel?: string;\n\n /**\n * The type of badge to be displayed.\n */\n @Prop() type?: IcBadgeTypes = \"text\";\n\n /**\n * The variant of the badge to be displayed.\n */\n @Prop() variant?: IcBadgeVariants = \"neutral\";\n\n /**\n * If `true`, the badge will be displayed.\n */\n @Prop({ mutable: true }) visible: boolean = true;\n\n componentWillLoad(): void {\n this.variant === \"custom\" && this.setBadgeColour();\n\n this.getBadgeForeground();\n\n this.isAccessibleLabelDefined() && this.setAccessibleLabel();\n }\n\n componentDidLoad(): void {\n this.type === \"text\" &&\n onComponentRequiredPropUndefined(\n [{ prop: this.textLabel, propName: \"text-label\" }],\n \"Badge\"\n );\n }\n\n /**\n * @deprecated This method should not be used anymore. Use visible prop to set badge visibility.\n */\n @Method()\n async showBadge(): Promise<void> {\n this.visible = true;\n }\n\n /**\n * @deprecated This method should not be used anymore. Use visible prop to set badge visibility.\n */\n @Method()\n async hideBadge(): Promise<void> {\n this.visible = false;\n }\n\n private setBadgeColour = () => {\n let colorRGBA = null;\n if (this.customColor !== null) {\n const firstChar = this.customColor.slice(0, 1);\n if (firstChar === \"#\") {\n colorRGBA = hexToRgba(this.customColor);\n } else if (firstChar.toLowerCase() === \"r\") {\n colorRGBA = rgbaStrToObj(this.customColor);\n }\n this.customColorRGBA = colorRGBA;\n this.el.style.backgroundColor = `rgba(${colorRGBA.r.toString()}, ${colorRGBA.g.toString()}, ${colorRGBA.b.toString()}, ${colorRGBA.a.toString()})`;\n }\n };\n\n private getBadgeForeground = () => {\n let red: number;\n let green: number;\n let blue: number;\n\n switch (this.variant) {\n case \"custom\":\n red = this.customColorRGBA.r;\n green = this.customColorRGBA.g;\n blue = this.customColorRGBA.b;\n break;\n case \"error\":\n red = parseInt(getCssProperty(\"--ic-status-error-r\"));\n green = parseInt(getCssProperty(\"--ic-status-error-g\"));\n blue = parseInt(getCssProperty(\"--ic-status-error-b\"));\n break;\n case \"success\":\n red = parseInt(getCssProperty(\"--ic-status-success-r\"));\n green = parseInt(getCssProperty(\"--ic-status-success-g\"));\n blue = parseInt(getCssProperty(\"--ic-status-success-b\"));\n break;\n case \"warning\":\n red = parseInt(getCssProperty(\"--ic-status-warning-r\"));\n green = parseInt(getCssProperty(\"--ic-status-warning-g\"));\n blue = parseInt(getCssProperty(\"--ic-status-warning-b\"));\n break;\n case \"info\": {\n const info = hexToRgba(getCssProperty(\"--ic-status-info\"));\n red = info.r;\n green = info.g;\n blue = info.b;\n break;\n }\n case \"neutral\": {\n const neutral = hexToRgba(getCssProperty(\"--ic-architectural-500\"));\n red = neutral.r;\n green = neutral.g;\n blue = neutral.b;\n break;\n }\n case \"light\": {\n const light = hexToRgba(getCssProperty(\"--ic-architectural-40\"));\n red = light.r;\n green = light.g;\n blue = light.b;\n break;\n }\n }\n\n const brightness = (red * 299 + green * 587 + blue * 114) / 1000;\n this.foregroundColour =\n brightness > 133.3505\n ? IcThemeForegroundEnum.Dark\n : IcThemeForegroundEnum.Light;\n };\n\n private getTextLabel = () => {\n let label;\n if (this.textLabel !== null) {\n if (this.maxNumber !== null) {\n label =\n Number(this.textLabel) > this.maxNumber\n ? `${this.maxNumber}+`\n : this.textLabel;\n } else {\n label = this.textLabel;\n }\n }\n return label;\n };\n\n private setAccessibleLabel = () => {\n if (getParentElement(this.el) !== null) {\n if (getParentElementType(this.el) === \"IC-TAB\") {\n getParentElement(this.el).setAttribute(\"aria-describedby\", \"badge\");\n } else {\n getParentElement(\n this.el\n ).ariaLabel = `badge displaying ${this.accessibleLabel}`;\n }\n }\n };\n\n private isAccessibleLabelDefined = () => {\n return isPropDefined(this.accessibleLabel) && this.accessibleLabel !== null;\n };\n\n render() {\n const { position, size, type, variant, foregroundColour, visible } = this;\n\n return (\n <Host\n class={{\n [`${position}`]: true,\n [`${size}`]: true,\n [`${variant}`]: true,\n [`${type}`]: true,\n [`foreground-${foregroundColour}`]: foregroundColour !== null,\n [\"show\"]: visible,\n [\"hide\"]: !visible,\n }}\n id={this.el.id || null}\n aria-label={\n this.isAccessibleLabelDefined()\n ? `badge displaying ${this.accessibleLabel}`\n : \"badge being displayed\"\n }\n role=\"status\"\n >\n {type === \"icon\" && <slot name=\"badge-icon\"></slot>}\n {type === \"text\" && (\n <ic-typography variant={size === \"small\" ? \"badge-small\" : \"badge\"}>\n {this.getT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QC,KAAEA,EAAIT,KAAEA,EAAI1B,QAAEA,EAAOO,iBAAEA,EAAgBwB,QAAEA,GAAYrD,KAErE,OACE0D,EAACC,EAAI,CACHC,MAAO,CACL,CAAC,GAAGJ,KAAa,KACjB,CAAC,GAAGC,KAAS,KACb,CAAC,GAAGnC,KAAY,KAChB,CAAC,GAAG0B,KAAS,KACb,CAAC,cAAcnB,KAAqBA,IAAqB,KACzD,CAAC,QAASwB,EACV,CAAC,SAAUA,GAEbQ,GAAI7D,KAAKU,GAAGmD,IAAM,KAAI,aAEpB7D,KAAK4C,2BACD,oBAAoB5C,KAAK2C,kBACzB,wBAENmB,KAAK,UAEJd,IAAS,QAAUU,EAAA,QAAMK,KAAK,eAC9Bf,IAAS,QACRU,EAAA,iBAAepC,QAASmC,IAAS,QAAU,cAAgB,SACxDzD,KAAKiC,gB"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["VARIANT_ICONS","neutral","icon","neutralIcon","ariaLabel","info","infoIcon","warning","warningIcon","error","errorIcon","success","successIcon","IC_INHERITED_ARIA","IC_DEVICE_SIZES","XS","S","M","L","XL","IC_BLOCK_COLOR_COMPONENTS","IC_FIXED_COLOR_COMPONENTS","IC_BLOCK_COLOR_EXCEPTIONS","BLACK_MIN_COLOR_BRIGHTNESS","WHITE_MAX_COLOR_BRIGHTNESS","DARK_MODE_THRESHOLD","icInput","linkIcInput","inheritAttributes","element","attributes","attributeObject","forEach","attr","hasAttribute","value","getAttribute","removeAttribute","debounceEvent","event","wait","original","_original","emit","debounce","bind","func","timer","args","clearTimeout","setTimeout","renderHiddenInput","always","container","name","disabled","undefined","hasShadowDom","inputs","querySelectorAll","inputEls","Array","from","filtered","filter","el","parentElement","input","ownerDocument","createElement","type","classList","add","appendChild","Date","toISOString","renderFileHiddenInput","multiple","accept","hidden","files","onchange","click","removeHiddenInput","remove","shadowRoot","attachShadow","getInputHelperTextID","id","getInputValidationTextID","getInputDescribedByText","inputId","helperText","validationText","trim","getThemeFromContext","themeFromEvent","getRootNode","host","blockColorParent","closest","join","parentTag","tagName","toLowerCase","currentTag","_a","includes","IcThemeForegroundEnum","Default","contains","Dark","Light","isMobileOrTablet","navigator","maxTouchPoints","handleHiddenFormButtonClick","form","button","hiddenFormButton","document","setAttribute","style","display","isEmptyString","length","isPropDefined","prop","getLabelFromValue","options","valueField","labelField","ungroupedOptions","map","option","children","push","matchingValue","find","getFilteredMenuOptions","includeDescriptions","searchString","position","label","description","lowerSearchString","startsWith","deviceSizeMatches","size","window","matchMedia","matches","getCurrentDeviceSize","DEVICE_SIZES","UNDEFINED","getCssProperty","cssVar","getComputedStyle","documentElement","getPropertyValue","getThemeColorBrightness","themeRed","themeGreen","themeBlue","parseInt","getThemeForegroundColor","getSlot","querySelector","slotHasContent","getSlotContent","slot","getSlotElements","slotContent","firstElementChild","elements","assignedElements","childNodes","getNavItemParentDetails","navType","parent","getParentElementType","getParentElement","Number","replace","hasValidationStatus","status","isSlotUsed","slotName","some","child","onComponentPropUndefinedChange","oldValue","newValue","callback","onComponentRequiredPropUndefined","props","component","i","propName","console","kebabToCamelCase","kebabCase","individualWords","split","camelCase","substring","toUpperCase","checkResizeObserver","callbackFn","ResizeObserver","hex2dec","v","hexToRgba","hex","c","r","g","b","a","slice","rgbaStrToObj","rgbaStr","fourthChar","colorRGBA","rgba","rgb","elementOverflowsX","scrollWidth","clientWidth","hasClassificationBanner","getForm","addFormResetListener","addEventListener","removeFormResetListener","removeEventListener","pxToRem","px","base","removeDisabledFalse"],"sources":["src/utils/constants.ts","src/utils/helpers.ts"],"sourcesContent":["import errorIcon from \"../assets/error-icon.svg\";\nimport infoIcon from \"../assets/info-icon.svg\";\nimport neutralIcon from \"../assets/neutral-icon.svg\";\nimport successIcon from \"../assets/success-icon.svg\";\nimport warningIcon from \"../assets/warning-icon.svg\";\n\n// Global status icons\nexport const VARIANT_ICONS = {\n neutral: {\n icon: neutralIcon,\n ariaLabel: \"Neutral\",\n },\n info: {\n icon: infoIcon,\n ariaLabel: \"For your information\",\n },\n warning: {\n icon: warningIcon,\n ariaLabel: \"Warning\",\n },\n error: {\n icon: errorIcon,\n ariaLabel: \"Error\",\n },\n success: {\n icon: successIcon,\n ariaLabel: \"Success\",\n },\n};\n\n// Global ARIA attributes\nexport const IC_INHERITED_ARIA = [\n \"aria-atomic\",\n \"aria-autocomplete\",\n \"aria-busy\",\n \"aria-controls\",\n \"aria-current\",\n \"aria-describedby\",\n \"aria-description\",\n \"aria-details\",\n \"aria-disabled\",\n \"aria-dropeffect\",\n \"aria-errormessage\",\n \"aria-expanded\",\n \"aria-flowto\",\n \"aria-grabbed\",\n \"aria-haspopup\",\n \"aria-hidden\",\n \"aria-invalid\",\n \"aria-keyshortcuts\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-live\",\n \"aria-owns\",\n \"aria-relevant\",\n \"aria-roledescription\",\n];\n\nexport const IC_DEVICE_SIZES = {\n XS: 576,\n S: 768,\n M: 992,\n L: 1200,\n XL: 99999,\n};\n\nexport const IC_BLOCK_COLOR_COMPONENTS = [\n \"ic-hero\",\n \"ic-top-navigation\",\n \"ic-footer\",\n \"ic-side-navigation\",\n \"ic-alert\",\n];\n\nexport const IC_FIXED_COLOR_COMPONENTS = [\"ic-alert\"];\n\nexport interface IcColorExceptions {\n [details: string]: string[];\n}\n\nexport const IC_BLOCK_COLOR_EXCEPTIONS: IcColorExceptions = {\n \"ic-alert\": [\"ic-link\"],\n};\n\n/* Range within which the chosen theme colour would not have a sufficient brightness difference with either of the black or white foreground colours\n * The brightness difference must be greater than 125 to provide good colour visibility\n * Calculated by:\n * - Using the brightness formula for both colours: https://www.w3.org/TR/AERT/#color-contrast\n * - Adding 125 to the brightness of the black foreground colour - RGB(11, 12, 12)\n * - Subtracting 125 from the brightness of the white foreground colour - RGB(255, 255, 255)\n */\nexport const BLACK_MIN_COLOR_BRIGHTNESS = 136.701;\nexport const WHITE_MAX_COLOR_BRIGHTNESS = 130;\n","import { EventEmitter } from \"@stencil/core\";\nimport {\n IcCallbackFunctionNoReturn,\n IcInformationStatusOrEmpty,\n IcNavParentDetails,\n IcPropObject,\n IcSearchMatchPositions,\n IcColorRGBA,\n} from \"./types\";\n\nimport {\n IcMenuOption,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../utils/types\";\nimport {\n IC_BLOCK_COLOR_COMPONENTS,\n IC_BLOCK_COLOR_EXCEPTIONS,\n IC_FIXED_COLOR_COMPONENTS,\n} from \"./constants\";\n\nconst DARK_MODE_THRESHOLD = 133.3505;\nconst icInput = \"ic-input\";\nconst linkIcInput = \"input.ic-input\";\n\n/**\n * converts an enum of strings into an array of strings\n */\nexport const stringEnumToArray = (\n theEnum: Record<string, string | number>\n): string[] => {\n const arr: string[] = [];\n Object.values(theEnum).forEach((val) => {\n if (isNaN(Number(val))) {\n const str = val as string;\n arr.push(str);\n }\n });\n return arr;\n};\n\n/**\n * Used to inherit global attributes set on the host. Called in componentWillLoad and assigned\n * to a variable that is later used in the render function.\n *\n * This does not need to be reactive as changing attributes on the host element\n * does not trigger a re-render.\n */\nexport const inheritAttributes = (\n element: HTMLElement,\n attributes: string[] = []\n): { [key: string]: string } => {\n const attributeObject: { [key: string]: string } = {};\n\n attributes.forEach((attr) => {\n if (element.hasAttribute(attr)) {\n const value = element.getAttribute(attr);\n if (value !== null) {\n attributeObject[attr] = value;\n }\n element.removeAttribute(attr);\n }\n });\n\n return attributeObject;\n};\n\nexport const debounceEvent = (\n event: EventEmitter,\n wait: number\n): EventEmitter => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const original = (event as any)._original || event;\n return {\n _original: event,\n emit: debounce(original.emit.bind(original), wait),\n } as EventEmitter;\n};\n\nexport const debounce = (\n func: (...args: unknown[]) => void,\n wait = 0\n): unknown => {\n let timer: ReturnType<typeof setTimeout>;\n return (...args: unknown[]) => {\n clearTimeout(timer);\n timer = setTimeout(func, wait, ...args);\n };\n};\n\n/**\n * This method is used to add a hidden input to a host element that contains\n * a Shadow DOM. It does not add the input inside of the Shadow root which\n * allows it to be picked up inside of forms. It should contain the same\n * values as the host element.\n *\n * @param always Add a hidden input even if the container does not use Shadow\n * @param container The element where the input will be added\n * @param name The name of the input\n * @param value The value of the input\n * @param disabled If true, the input is disabled\n */\nexport const renderHiddenInput = (\n always: boolean,\n container: HTMLElement,\n name: string,\n value: string | Date | undefined | null,\n disabled: boolean\n): void => {\n if (name !== undefined && (always || hasShadowDom(container))) {\n const inputs = container.querySelectorAll(linkIcInput);\n const inputEls = Array.from(inputs);\n const filtered = inputEls.filter((el) => container === el.parentElement);\n\n let input = filtered[0] as HTMLInputElement;\n if (input === null || input === undefined) {\n input = container.ownerDocument.createElement(\"input\");\n input.type = \"hidden\";\n input.classList.add(icInput);\n container.appendChild(input);\n }\n input.disabled = disabled;\n input.name = name;\n\n if (value instanceof Date) {\n input.value = value ? value.toISOString() : null;\n } else {\n input.value = value || \"\";\n }\n }\n};\n\n/**\n * This method is used to add a hidden file input to a host element that contains\n * a Shadow DOM. It does not add the input inside of the Shadow root which\n * allows it to be picked up inside of forms. It should contain the same\n * values as the host element.\n *\n * @param event: The event that is emitted once a file is selected.\n * @param container The element where the input will be added\n * @param multiple If true, multiple files can be selected\n * @param name The name of the input\n * @param value The value of the input\n * @param disabled If true, the input is disabled\n * @param accept A string of the accepted files\n */\nexport const renderFileHiddenInput = (\n event: EventEmitter,\n container: HTMLElement,\n multiple: boolean,\n name: string,\n value: FileList | undefined | null,\n disabled: boolean,\n accept: string\n): void => {\n if (name !== undefined && hasShadowDom(container)) {\n const inputs = container.querySelectorAll(linkIcInput);\n const inputEls = Array.from(inputs);\n const filtered = inputEls.filter((el) => container === el.parentElement);\n\n let input = filtered[0] as HTMLInputElement;\n if (input === null || input === undefined) {\n input = container.ownerDocument.createElement(\"input\");\n input.classList.add(icInput);\n container.appendChild(input);\n }\n input.type = \"file\";\n input.hidden = true;\n input.multiple = multiple;\n input.name = name;\n input.files = value;\n input.disabled = disabled;\n input.accept = accept;\n input.onchange = () => {\n event.emit(input.files);\n };\n input.click();\n }\n};\n\nexport const removeHiddenInput = (container: HTMLElement): void => {\n const inputs = container.querySelectorAll(\"input.ic-input\");\n const inputEls = Array.from(inputs);\n const filtered = inputEls.filter((el) => container === el.parentElement);\n const input = filtered[0] as HTMLInputElement;\n input?.remove();\n};\n\nexport const hasShadowDom = (el: HTMLElement): boolean =>\n !!el.shadowRoot && !!el.attachShadow;\n\nexport const getInputHelperTextID = (id: string): string => id + \"-helper-text\";\n\nexport const getInputValidationTextID = (id: string): string =>\n id + \"-validation-text\";\n\nexport const getInputDescribedByText = (\n inputId: string,\n helperText: boolean,\n validationText: boolean\n): string =>\n `${helperText ? getInputHelperTextID(inputId) : \"\"} ${\n validationText ? getInputValidationTextID(inputId) : \"\"\n }`.trim();\n\n/**\n * This method helps to understand the context in which a component exists,\n * to assist with choosing appropriate foreground colours to use. For example,\n * this method will help you use the 'white' version of a button if it's within\n * a block colour element using white foreground text.\n *\n * This only works for components/elements passed via <slot> and not if they\n * are part of an IC component.\n *\n * \"\"\n * @returns IcThemeForeground depending on the context\n */\nexport const getThemeFromContext = (\n el: Element,\n themeFromEvent: IcThemeForeground = null\n): IcThemeForeground => {\n const parentElement =\n el.parentElement || (<ShadowRoot>el.getRootNode()).host.parentElement;\n const blockColorParent = parentElement.closest(\n IC_BLOCK_COLOR_COMPONENTS.join(\",\")\n );\n\n // If within a block color component\n if (blockColorParent !== null) {\n const parentTag = blockColorParent.tagName.toLowerCase();\n const currentTag = el.tagName.toLowerCase();\n\n if (IC_BLOCK_COLOR_EXCEPTIONS[parentTag]?.includes(currentTag)) {\n return IcThemeForegroundEnum.Default;\n } else if (\n themeFromEvent !== null &&\n !IC_FIXED_COLOR_COMPONENTS.includes(parentTag)\n ) {\n return themeFromEvent;\n } else if (\n blockColorParent.classList.contains(IcThemeForegroundEnum.Dark)\n ) {\n return IcThemeForegroundEnum.Dark;\n }\n\n return IcThemeForegroundEnum.Light;\n }\n\n return IcThemeForegroundEnum.Default;\n};\n\nexport const isMobileOrTablet = (): boolean =>\n \"maxTouchPoints\" in navigator ? navigator.maxTouchPoints > 0 : false;\n\n/**\n * Will create a button within the lightDOM which interacts with the parent form.\n * This is required as buttons within the shadowDOM will not invoke a submit or reset\n *\n * @param form - parent form element which contains shadowDom button\n * @param button - shadowDOM button\n */\nexport const handleHiddenFormButtonClick = (\n form: HTMLFormElement,\n button: HTMLIcButtonElement | HTMLButtonElement\n): void => {\n const hiddenFormButton = document.createElement(\"button\");\n\n hiddenFormButton.setAttribute(\"type\", button.type);\n hiddenFormButton.style.display = \"none\";\n\n form.appendChild(hiddenFormButton);\n\n hiddenFormButton.click();\n hiddenFormButton.remove();\n};\n\nexport const isEmptyString = (value: string): boolean =>\n value ? value.trim().length === 0 : true;\n\n// A helper function that checks if a prop has been defined\nexport const isPropDefined = (prop: string): string | null =>\n prop !== undefined ? prop : null;\n\n/**\n * Extracts the label using the value from an object. Requires the object to have a label and value property.\n * @param value - value from object\n * @param options - list of menu items\n * @returns - label corresponding to value\n */\nexport const getLabelFromValue = (\n value: string,\n options: IcMenuOption[],\n valueField = \"value\",\n labelField = \"label\"\n): string | undefined => {\n const ungroupedOptions: IcMenuOption[] = [];\n if (options.length > 0 && options.map) {\n options.map((option) => {\n if (option.children) {\n option.children.map((option: IcMenuOption) =>\n ungroupedOptions.push(option)\n );\n } else {\n ungroupedOptions.push(option);\n }\n });\n const matchingValue = ungroupedOptions.find(\n (option) => option[valueField] === value\n );\n if (matchingValue !== undefined) return matchingValue[labelField];\n }\n\n return undefined;\n};\n\n/**\n * Filters the options based on the search string.\n * @param options - array of options\n * @param includeDescriptions - determines whether option descriptions are included when filtering options\n * @param searchString - string used to filter the options\n * @param position - whether the search string matches the start of or anywhere in the options\n * @returns filtered array of options\n */\nexport const getFilteredMenuOptions = (\n options: IcMenuOption[],\n includeDescriptions: boolean,\n searchString: string,\n position: IcSearchMatchPositions,\n labelField = \"label\"\n): IcMenuOption[] =>\n options.filter((option) => {\n const label: string = option[labelField].toLowerCase();\n const description = option.description?.toLowerCase();\n const lowerSearchString = searchString.toLowerCase();\n\n return position === \"anywhere\"\n ? includeDescriptions\n ? label.includes(lowerSearchString) ||\n description?.includes(lowerSearchString)\n : label.includes(lowerSearchString)\n : includeDescriptions\n ? label.startsWith(lowerSearchString) ||\n description?.startsWith(lowerSearchString)\n : label.startsWith(lowerSearchString);\n });\n\nexport const deviceSizeMatches = (size: number): boolean =>\n window.matchMedia(`(max-width: ${size}px)`).matches;\n\nexport const getCurrentDeviceSize = (): number => {\n if (deviceSizeMatches(DEVICE_SIZES.S)) {\n return DEVICE_SIZES.S;\n }\n if (deviceSizeMatches(DEVICE_SIZES.M)) {\n return DEVICE_SIZES.M;\n }\n if (deviceSizeMatches(DEVICE_SIZES.L)) {\n return DEVICE_SIZES.L;\n }\n if (deviceSizeMatches(DEVICE_SIZES.XL)) {\n return DEVICE_SIZES.XL;\n }\n //fallback needed as all of above get initialised to 0 in jest tests\n return DEVICE_SIZES.UNDEFINED;\n};\n\nexport const getCssProperty = (cssVar: string): string =>\n getComputedStyle(document.documentElement).getPropertyValue(cssVar);\n\n/**\n * Returns the brightness of the theme colour, calculated by using the theme RGB CSS values by:\n * - Multiplying each RGB value by a set number: https://www.w3.org/TR/AERT/#color-contrast\n * - Adding them together and dividing by 1000\n * This is a similar calculation to its CSS counterpart: \"--ic-theme-text\"\n * @returns number representing the brightness of the theme colour\n */\nexport const getThemeColorBrightness = (): number => {\n const themeRed = getCssProperty(\"--ic-theme-primary-r\");\n const themeGreen = getCssProperty(\"--ic-theme-primary-g\");\n const themeBlue = getCssProperty(\"--ic-theme-primary-b\");\n return (\n (parseInt(themeRed) * 299 +\n parseInt(themeGreen) * 587 +\n parseInt(themeBlue) * 114) /\n 1000\n );\n};\n\n/**\n * Returns if dark or light foreground colors should be used for color contrast reasons\n * @returns \"dark\" or \"light\"\n */\nexport const getThemeForegroundColor = (): IcThemeForeground =>\n getThemeColorBrightness() > DARK_MODE_THRESHOLD\n ? IcThemeForegroundEnum.Dark\n : IcThemeForegroundEnum.Light;\n\nexport const getSlot = (element: HTMLElement, name: string): Element | null => {\n if (element && element.querySelector) {\n return element.querySelector(`[slot=\"${name}\"]`);\n }\n return null;\n};\n\nexport const slotHasContent = (element: HTMLElement, name: string): boolean =>\n getSlot(element, name) !== null;\n\nexport const getSlotContent = (\n element: HTMLElement,\n name: string\n): Element[] | NodeListOf<ChildNode> | null => {\n const slot = getSlot(element, name);\n if (slot) {\n return getSlotElements(slot);\n }\n\n return null;\n};\n\nexport const getSlotElements = (\n slot: Element\n): NodeListOf<ChildNode> | Element[] => {\n const slotContent = slot.firstElementChild as HTMLSlotElement;\n\n if (slotContent !== null) {\n const elements = slotContent.assignedElements\n ? slotContent.assignedElements()\n : slotContent.childNodes;\n return elements.length ? elements : null;\n } else {\n //check for single element\n return slot === null ? null : [slot];\n }\n};\n\nexport const getNavItemParentDetails = (\n el: HTMLElement\n): IcNavParentDetails => {\n let navType: IcNavParentDetails = { navType: \"\", parent: null };\n switch (getParentElementType(el)) {\n case \"IC-NAVIGATION-GROUP\":\n navType = getNavItemParentDetails(el.parentElement);\n break;\n case \"IC-TOP-NAVIGATION\":\n navType = { navType: \"top\", parent: getParentElement(el) };\n break;\n case \"IC-SIDE-NAVIGATION\":\n navType = { navType: \"side\", parent: getParentElement(el) };\n break;\n case \"IC-PAGE-HEADER\":\n navType = { navType: \"page-header\", parent: null };\n break;\n }\n return navType;\n};\n\nexport const DEVICE_SIZES = {\n XS: Number(getCssProperty(\"--ic-breakpoint-xs\").replace(\"px\", \"\")), // 0\n S: Number(getCssProperty(\"--ic-breakpoint-sm\").replace(\"px\", \"\")), // 576\n M: Number(getCssProperty(\"--ic-breakpoint-md\").replace(\"px\", \"\")), // 768\n L: Number(getCssProperty(\"--ic-breakpoint-lg\").replace(\"px\", \"\")), // 992\n XL: Number(getCssProperty(\"--ic-breakpoint-xl\").replace(\"px\", \"\")), // 1200\n UNDEFINED: 1200,\n};\n\nexport const hasValidationStatus = (\n status: IcInformationStatusOrEmpty,\n disabled: boolean\n): boolean => {\n return status !== \"\" && !disabled;\n};\n\nexport const isSlotUsed = (element: HTMLElement, slotName: string): boolean =>\n Array.from(element.children).some(\n (child) => child.getAttribute(\"slot\") === slotName\n );\n\n// added as a common method to allow detection of gatsby hydration issue, where (camelCase) props are initially undefined & then update\n// with a value. Allows a callback function to be executed when this is the case\nexport const onComponentPropUndefinedChange = (\n oldValue: string | undefined,\n newValue: string | undefined,\n callback: IcCallbackFunctionNoReturn\n): void => {\n if (oldValue === undefined && newValue !== oldValue) {\n callback();\n }\n};\n\nexport const onComponentRequiredPropUndefined = (\n props: IcPropObject[],\n component: string\n): void => {\n for (let i = 0; i < props.length; i++) {\n const { prop, propName } = props[i];\n if (prop === null || prop === undefined) {\n console.error(\n `No ${propName} specified for ${component} component - prop '${propName}' (web components) / '${kebabToCamelCase(\n propName\n )}' (react) required`\n );\n }\n }\n};\n\nexport const kebabToCamelCase = (kebabCase: string): string => {\n kebabCase = kebabCase.toLowerCase();\n const individualWords: string[] = kebabCase.split(\"-\");\n let camelCase = individualWords[0];\n for (let i = 1; i < individualWords.length; i++) {\n camelCase +=\n individualWords[i].substring(0, 1).toUpperCase() +\n individualWords[i].substring(1);\n }\n return camelCase;\n};\n\nexport const checkResizeObserver = (\n callbackFn: IcCallbackFunctionNoReturn\n): void => {\n if (\n typeof window !== \"undefined\" &&\n typeof window.ResizeObserver !== \"undefined\"\n ) {\n callbackFn();\n }\n};\n\nconst hex2dec = function (v: string) {\n return parseInt(v, 16);\n};\n\nexport const hexToRgba = (hex: string): IcColorRGBA => {\n let c;\n if (hex.length === 4) {\n c = hex.replace(\"#\", \"\").split(\"\");\n return {\n r: hex2dec(c[0] + c[0]),\n g: hex2dec(c[1] + c[1]),\n b: hex2dec(c[2] + c[2]),\n a: 1,\n };\n } else {\n return {\n r: hex2dec(hex.slice(1, 3)),\n g: hex2dec(hex.slice(3, 5)),\n b: hex2dec(hex.slice(5)),\n a: 1,\n };\n }\n};\n\nexport const rgbaStrToObj = (rgbaStr: string): IcColorRGBA => {\n const fourthChar = rgbaStr.slice(3, 4);\n let colorRGBA: IcColorRGBA;\n if (fourthChar.toLowerCase() === \"a\") {\n colorRGBA = { r: null, g: null, b: null, a: null };\n const rgba = rgbaStr\n .substring(5, rgbaStr.length - 1)\n .replace(/ /g, \"\")\n .split(\",\");\n colorRGBA.r = Number(rgba[0]);\n colorRGBA.g = Number(rgba[1]);\n colorRGBA.b = Number(rgba[2]);\n colorRGBA.a = Number(rgba[3]);\n } else {\n colorRGBA = { r: null, g: null, b: null, a: 1 };\n const rgb = rgbaStr\n .substring(4, rgbaStr.length - 1)\n .replace(/ /g, \"\")\n .split(\",\");\n colorRGBA.r = Number(rgb[0]);\n colorRGBA.g = Number(rgb[1]);\n colorRGBA.b = Number(rgb[2]);\n }\n\n return colorRGBA;\n};\n\nexport const elementOverflowsX = (element: HTMLElement): boolean =>\n element.scrollWidth > element.clientWidth;\n\n/**\n *\n * @param child - The child element\n * @returns string\n */\nexport const getParentElementType = (child: HTMLElement): string =>\n child.parentElement.tagName;\n\nexport const getParentElement = (child: HTMLElement): HTMLElement =>\n child.parentElement;\n\nexport const hasClassificationBanner = (): boolean =>\n !!document.querySelector(\"ic-classification-banner:not([inline='true'])\");\n\nexport const getForm = (el: HTMLElement): HTMLFormElement => el.closest(\"FORM\");\n\nexport const addFormResetListener = (\n el: HTMLElement,\n callbackFn: IcCallbackFunctionNoReturn\n): void => {\n const form = getForm(el);\n if (form !== null) {\n form.addEventListener(\"reset\", callbackFn);\n }\n};\n\nexport const removeFormResetListener = (\n el: HTMLElement,\n callbackFn: IcCallbackFunctionNoReturn\n): void => {\n const form = getForm(el);\n if (form !== null) {\n form.removeEventListener(\"reset\", callbackFn);\n }\n};\n\nexport const pxToRem = (px: string, base = 16): string =>\n `${(1 / base) * parseInt(px)}rem`;\n\nexport const removeDisabledFalse = (\n disabled: boolean,\n element: HTMLElement\n): void => {\n if (!disabled) {\n element.removeAttribute(\"disabled\");\n }\n};\n\nexport const isMacDevice = (): boolean => {\n return window.navigator.userAgent.toUpperCase().indexOf(\"MAC\") >= 0;\n};\n\nexport const isNumeric = (value: string) => {\n return /^-?\\d+$/.test(value);\n};\n"],"mappings":"k+FAOaA,EAAgB,CAC3BC,QAAS,CACPC,KAAMC,EACNC,UAAW,WAEbC,KAAM,CACJH,KAAMI,EACNF,UAAW,wBAEbG,QAAS,CACPL,KAAMM,EACNJ,UAAW,WAEbK,MAAO,CACLP,KAAMQ,EACNN,UAAW,SAEbO,QAAS,CACPT,KAAMU,EACNR,UAAW,Y,MAKFS,EAAoB,CAC/B,cACA,oBACA,YACA,gBACA,eACA,mBACA,mBACA,eACA,gBACA,kBACA,oBACA,gBACA,cACA,eACA,gBACA,cACA,eACA,oBACA,aACA,kBACA,YACA,YACA,gBACA,wB,MAGWC,EAAkB,CAC7BC,GAAI,IACJC,EAAG,IACHC,EAAG,IACHC,EAAG,KACHC,GAAI,OAGC,MAAMC,EAA4B,CACvC,UACA,oBACA,YACA,qBACA,YAGK,MAAMC,EAA4B,CAAC,YAMnC,MAAMC,EAA+C,CAC1D,WAAY,CAAC,Y,MAUFC,EAA6B,Q,MAC7BC,EAA6B,ICvE1C,MAAMC,EAAsB,SAC5B,MAAMC,EAAU,WAChB,MAAMC,EAAc,iB,MAyBPC,EAAoB,CAC/BC,EACAC,EAAuB,MAEvB,MAAMC,EAA6C,GAEnDD,EAAWE,SAASC,IAClB,GAAIJ,EAAQK,aAAaD,GAAO,CAC9B,MAAME,EAAQN,EAAQO,aAAaH,GACnC,GAAIE,IAAU,KAAM,CAClBJ,EAAgBE,GAAQE,C,CAE1BN,EAAQQ,gBAAgBJ,E,KAI5B,OAAOF,CAAe,E,MAGXO,EAAgB,CAC3BC,EACAC,KAGA,MAAMC,EAAYF,EAAcG,WAAaH,EAC7C,MAAO,CACLG,UAAWH,EACXI,KAAMC,EAASH,EAASE,KAAKE,KAAKJ,GAAWD,GAC9B,EAG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zBF,EAAUP,EAAIlC,OAAO2C,EAAI,IACzBF,EAAUN,EAAInC,OAAO2C,EAAI,G,CAG3B,OAAOF,CAAS,E,MAGLG,GAAqBrM,GAChCA,EAAQsM,YAActM,EAAQuM,Y,MAOnBhD,GAAwBS,GACnCA,EAAM3H,cAAcqC,Q,MAET8E,GAAoBQ,GAC/BA,EAAM3H,c,MAEKmK,GAA0B,MACnC7G,SAAS+C,cAAc,iDAEpB,MAAM+D,GAAWrK,GAAqCA,EAAGmC,QAAQ,Q,MAE3DmI,GAAuB,CAClCtK,EACA+I,KAEA,MAAM3F,EAAOiH,GAAQrK,GACrB,GAAIoD,IAAS,KAAM,CACjBA,EAAKmH,iBAAiB,QAASxB,E,SAItByB,GAA0B,CACrCxK,EACA+I,KAEA,MAAM3F,EAAOiH,GAAQrK,GACrB,GAAIoD,IAAS,KAAM,CACjBA,EAAKqH,oBAAoB,QAAS1B,E,SAIzB2B,GAAU,CAACC,EAAYC,EAAO,KACzC,GAAI,EAAIA,EAAQzE,SAASwE,Q,MAEdE,GAAsB,CACjCvL,EACA1B,KAEA,IAAK0B,EAAU,CACb1B,EAAQQ,gBAAgB,W"}
|
@@ -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
|