@ukic/web-components 2.1.0-beta.6 → 2.1.0-beta.7
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/ic-data-row.cjs.entry.js +11 -9
- package/dist/cjs/ic-data-row.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-hero.cjs.entry.js +1 -1
- package/dist/cjs/ic-hero.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-link.cjs.entry.js +0 -2
- package/dist/cjs/ic-link.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-page-header.cjs.entry.js +1 -1
- package/dist/cjs/ic-page-header.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-tab-group.cjs.entry.js.map +1 -1
- package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.test.a11y.js +1 -1
- package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.test.a11y.js.map +1 -1
- package/dist/collection/components/ic-data-row/ic-data-row.js +11 -9
- package/dist/collection/components/ic-data-row/ic-data-row.js.map +1 -1
- package/dist/collection/components/ic-footer-link-group/ic-footer-link-group.test.a11y.js +1 -1
- package/dist/collection/components/ic-footer-link-group/ic-footer-link-group.test.a11y.js.map +1 -1
- package/dist/collection/components/ic-hero/ic-hero.css +5 -0
- package/dist/collection/components/ic-link/ic-link.js +0 -2
- package/dist/collection/components/ic-link/ic-link.js.map +1 -1
- package/dist/collection/components/ic-page-header/ic-page-header.js +1 -1
- package/dist/collection/components/ic-page-header/ic-page-header.js.map +1 -1
- package/dist/collection/components/ic-radio-group/ic-radio-group.test.a11y.js +1 -1
- package/dist/collection/components/ic-radio-group/ic-radio-group.test.a11y.js.map +1 -1
- package/dist/collection/components/ic-tab-context/ic-tab-context.test.a11y.js +1 -1
- package/dist/collection/components/ic-tab-context/ic-tab-context.test.a11y.js.map +1 -1
- package/dist/collection/components/ic-tab-group/ic-tab-group.js +1 -1
- package/dist/collection/components/ic-tab-group/ic-tab-group.js.map +1 -1
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.test.a11y.js +1 -1
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.test.a11y.js.map +1 -1
- package/dist/components/ic-data-row.js +11 -9
- package/dist/components/ic-data-row.js.map +1 -1
- package/dist/components/ic-hero.js +1 -1
- package/dist/components/ic-hero.js.map +1 -1
- package/dist/components/ic-link2.js +0 -2
- package/dist/components/ic-link2.js.map +1 -1
- package/dist/components/ic-page-header.js +2 -2
- package/dist/components/ic-page-header.js.map +1 -1
- package/dist/components/ic-tab-group.js +1 -1
- package/dist/components/ic-tab-group.js.map +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/{p-c1d78a64.entry.js → p-4902b46a.entry.js} +2 -2
- package/dist/core/{p-c1d78a64.entry.js.map → p-4902b46a.entry.js.map} +1 -1
- package/dist/core/{p-9fbceeb2.entry.js → p-541918c2.entry.js} +2 -2
- package/dist/core/{p-9fbceeb2.entry.js.map → p-541918c2.entry.js.map} +1 -1
- package/dist/core/{p-217fa7de.entry.js → p-9020d1ff.entry.js} +2 -2
- package/dist/core/p-9020d1ff.entry.js.map +1 -0
- package/dist/core/{p-eaea567e.entry.js → p-a38cbb3f.entry.js} +2 -2
- package/dist/core/p-a38cbb3f.entry.js.map +1 -0
- package/dist/core/{p-23bf0b7a.entry.js → p-c5e453eb.entry.js} +2 -2
- package/dist/core/p-c5e453eb.entry.js.map +1 -0
- package/dist/esm/ic-data-row.entry.js +11 -9
- package/dist/esm/ic-data-row.entry.js.map +1 -1
- package/dist/esm/ic-hero.entry.js +1 -1
- package/dist/esm/ic-hero.entry.js.map +1 -1
- package/dist/esm/ic-link.entry.js +0 -2
- package/dist/esm/ic-link.entry.js.map +1 -1
- package/dist/esm/ic-page-header.entry.js +2 -2
- package/dist/esm/ic-page-header.entry.js.map +1 -1
- package/dist/esm/ic-tab-group.entry.js +1 -1
- package/dist/esm/ic-tab-group.entry.js.map +1 -1
- package/dist/types/components/ic-link/ic-link.d.ts +0 -1
- package/hydrate/index.js +14 -14
- package/package.json +3 -3
- package/dist/core/p-217fa7de.entry.js.map +0 -1
- package/dist/core/p-23bf0b7a.entry.js.map +0 -1
- package/dist/core/p-eaea567e.entry.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"file":"ic-page-header.js","mappings":";;;;;AAAA,MAAM,eAAe,GAAG,0kIAA0kI;;MC2BrlI,UAAU;;;;;IAyCb,mBAAc,GAAmB,IAAI,CAAC;IAEtC,2BAAsB,GAAG;MAC/B,IAAI,IAAI,CAAC,YAAY,EAAE;QACrB,IAAI,CAAC,iBAAiB,EAAE,CAAC;OAC1B;KACF,CAAC;IAEM,sBAAiB,GAAG;MAC1B,IAAI,CAAC,cAAc,GAAG,IAAI,cAAc,CAAC;QACvC,IAAI,CAAC,sBAAsB,EAAE,CAAC;OAC/B,CAAC,CAAC;MACH,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KACtC,CAAC;IAEM,sBAAiB,GAAG;MAC1B,MAAM,QAAQ,GAAG,oBAAoB,EAAE,CAAC;MACxC,IAAI,QAAQ,KAAK,IAAI,CAAC,UAAU,EAAE;QAChC,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC;OAC5B;MAED,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CACjD,iBAAiB,CACH,CAAC;MACjB,MAAM,aAAa,GAAa,EAAE,CAAC;;MAGnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAClD,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAgB,CAAC;QACpD,IAAI,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;QACvC,IAAI,YAAY,KAAK,SAAS,EAAE;UAC9B,YAAY,GAAG,CAAC,CAAC;SAClB;QACD,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;OAClC;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E,OAAO,EAAC,MAAM,EACd,KAAK,EAAE,EAAE,CAAC,YAAY,GAAG,IAAI,EAAE,CAAC,OAAO,GAAG,KAAK,EAAE,IAEhD,UAAU,CACG,CACjB,CACI,CACH,CACF,EACL,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC,KAC7B,WAAK,KAAK,EAAC,aAAa,IACtB,YAAM,IAAI,EAAC,SAAS,GAAG,CACnB,CACP,EACA,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,KAC3B,WAAK,KAAK,EAAC,YAAY,IACrB,YAAM,IAAI,EAAC,OAAO,GAAG,CACjB,CACP,CACG,EAEL,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC;MAC9B,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,MAC3B,WAAK,KAAK,EAAC,iBAAiB,IACzB,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC;MAC7B,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,YAAM,IAAI,EAAC,SAAS,GAAG,EACxD,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,KAC1B,WACE,KAAK,EAAC,WAAW,gBACN,iCAAiC,IAE5C,YAAM,IAAI,EAAC,MAAM,GAAG,CAChB,CACP,CACG,CACP,CACoB,CAChB,CACJ,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/ic-page-header/ic-page-header.css?tag=ic-page-header&encapsulation=shadow","./src/components/ic-page-header/ic-page-header.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: block;\n}\n\n:host(.sticky) {\n position: sticky;\n top: 0;\n box-shadow: var(--ic-elevation-overlay);\n}\n\nheader {\n background-color: var(--ic-architectural-40);\n}\n\nheader.border-bottom {\n border-bottom: 1px solid var(--ic-architectural-300);\n}\n\nheader.tabs {\n padding-top: var(--ic-space-md);\n}\n\n.breadcrumb-area {\n margin-bottom: var(--ic-space-md);\n}\n\n.main-content {\n display: grid;\n grid-template-columns: auto 1fr;\n grid-template-areas:\n \"title-area action-area\"\n \"input-area action-area\";\n column-gap: var(--ic-space-md);\n justify-content: space-between;\n width: 100%;\n}\n\n.title-area {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 304px;\n grid-area: title-area;\n}\n\n.header-content {\n display: flex;\n align-items: center;\n width: 100%;\n flex-wrap: wrap;\n row-gap: var(--ic-space-xs);\n column-gap: var(--ic-space-md);\n}\n\n.heading {\n display: inline-block;\n overflow-wrap: break-word;\n hyphens: auto;\n}\n\n.subheading.small {\n margin-top: var(--ic-space-xs);\n}\n\n.action-area {\n display: flex;\n gap: var(--ic-space-md);\n flex-flow: row wrap;\n justify-self: end;\n justify-content: flex-end;\n height: fit-content;\n grid-area: action-area;\n}\n\n.input-area,\n.navigation-area {\n margin-top: var(--ic-space-md);\n width: 100%;\n}\n\n.tabs-slot {\n display: flex;\n overflow-x: auto;\n padding: 8px;\n margin: -8px;\n}\n\n.input-area {\n grid-area: input-area;\n}\n\n@media screen and (max-width: 576px) {\n ::slotted(ic-text-field) {\n --input-width: 100%;\n\n max-width: 320px;\n }\n\n .main-content {\n grid-template-areas:\n \"title-area\"\n \"action-area\"\n \"input-area\";\n justify-content: flex-start;\n }\n\n .title-area {\n min-width: 0;\n }\n\n .action-area {\n min-width: 100%;\n margin-top: var(--ic-space-md);\n justify-content: start;\n }\n}\n\n@media screen and (min-width: 992px) {\n :host(.sticky-desktop) {\n position: sticky;\n top: 0;\n box-shadow: var(--ic-elevation-overlay);\n }\n}\n","import { Component, Host, h, Prop, Element, State } from \"@stencil/core\";\n\nimport { IcAlignment } from \"../../utils/types\";\n\nimport {\n isSlotUsed,\n DEVICE_SIZES,\n getCurrentDeviceSize,\n checkResizeObserver,\n} from \"../../utils/helpers\";\n\n/**\n * @slot breadcrumbs - Content will be rendered in the breadcrumb area, above the title and action areas.\n * @slot heading - Content will be rendered in the title area, in place of the heading.\n * @slot subheading - Content will be rendered in the title area, in place of the subheading.\n * @slot heading-adornment - Content will be rendered in the title area, adjacent to the heading.\n * @slot actions - Content will be rendered in the action area, adjacent to the title area.\n * @slot input - Content will be rendered in the input area, below the title area and adjacent to the action area.\n * @slot stepper - Content will be rendered in the navigation area, below the title and action areas. Note: stepper slot cannot be used when the tabs slot is being used.\n * @slot tabs - Content will be rendered in the navigation area, below the title and action areas. Note: the stepper slot cannot be used when the tabs slot is being used.\n */\n\n@Component({\n tag: \"ic-page-header\",\n styleUrl: \"ic-page-header.css\",\n shadow: true,\n})\nexport class PageHeader {\n @Element() el: HTMLIcPageHeaderElement;\n /**\n * The title to render on the page header.\n */\n @Prop() heading?: string;\n /**\n * The subtitle to render on the page header.\n */\n @Prop() subheading?: string;\n /**\n * The alignment of the page header.\n */\n @Prop() aligned?: IcAlignment = \"left\";\n /**\n * If `true`, the small styling will be applied to the page header.\n */\n @Prop() small?: boolean = false;\n /**\n * If `true`, a border will be displayed along the bottom of the page header.\n */\n @Prop() border?: boolean = true;\n /**\n * If `true`, the page header will be sticky at all breakpoints.\n */\n @Prop() sticky?: boolean = false;\n /**\n * If `true`, the page header will only be sticky for viewport widths of 992px and above.\n */\n @Prop() stickyDesktopOnly?: boolean = false;\n /**\n * If `true`, the reading pattern and tab order will change in the action area for viewport widths of above 576px and when actions have not wrapped.\n */\n @Prop() reverseOrder?: boolean = false;\n\n @State() deviceSize: number = DEVICE_SIZES.XL;\n\n @State() areButtonsReversed: boolean = false;\n\n @State() actionContent: Node[];\n\n private resizeObserver: ResizeObserver = null;\n\n private resizeObserverCallback = () => {\n if (this.reverseOrder) {\n this.applyReverseOrder();\n }\n };\n\n private runResizeObserver = () => {\n this.resizeObserver = new ResizeObserver(() => {\n this.resizeObserverCallback();\n });\n this.resizeObserver.observe(this.el);\n };\n\n private applyReverseOrder = (): void => {\n const currSize = getCurrentDeviceSize();\n if (currSize !== this.deviceSize) {\n this.deviceSize = currSize;\n }\n\n const actionArea = this.el.shadowRoot.querySelector(\n \"div.action-area\"\n ) as HTMLElement;\n const actionHeights: number[] = [];\n\n /* For each button in the actions slot, check the height of the button and push this number into the actionHeights array and then find the greatest number in this array (i.e. find the height of the tallest button) */\n for (let i = 0; i < this.actionContent.length; i++) {\n const action = this.actionContent[i] as HTMLElement;\n let actionHeight = action.offsetHeight;\n if (actionHeight === undefined) {\n actionHeight = 0;\n }\n actionHeights.push(actionHeight);\n }\n\n const max = Math.max(...actionHeights);\n\n /* The smallest breakpoint displays buttons in the same order the user has slotted them in. When the device size is larger than the small breakpoiint then the order of the button reverses due to best practice for reading patterns. If the device size is larger than the small breakpoint and the buttons have started to wrap then they follow the order the user has slotted them in. This logic is programmed based on the height of the action-area div that wraps the actions slot. If the height of the action-area div is taller than the height of the tallest button, then it is assumed that the taller height is caused by the buttons wrapping */\n let actionAreaHeight = actionArea.offsetHeight;\n\n if (actionAreaHeight === undefined) {\n actionAreaHeight = 0;\n }\n\n if (\n this.deviceSize > DEVICE_SIZES.S &&\n actionAreaHeight <= max &&\n !this.areButtonsReversed\n ) {\n this.actionContent = this.actionContent.reverse();\n this.actionContent.forEach((btn: string | Node) => {\n this.el.append(btn);\n });\n this.areButtonsReversed = !this.areButtonsReversed;\n } else if (\n ((this.deviceSize > DEVICE_SIZES.S && actionAreaHeight > max) ||\n this.deviceSize <= DEVICE_SIZES.S) &&\n this.areButtonsReversed\n ) {\n this.actionContent = this.actionContent.reverse();\n this.actionContent.forEach((btn: string | Node) => {\n this.el.append(btn);\n });\n this.areButtonsReversed = !this.areButtonsReversed;\n }\n };\n\n componentWillLoad(): void {\n this.actionContent = Array.from(\n this.el.querySelectorAll(`[slot=\"actions\"]`)\n );\n }\n\n componentDidLoad(): void {\n checkResizeObserver(this.runResizeObserver);\n }\n\n disconnectedCallback(): void {\n if (this.resizeObserver !== null) {\n this.resizeObserver.disconnect();\n }\n }\n\n render() {\n const {\n small,\n border,\n heading,\n subheading,\n aligned,\n sticky,\n stickyDesktopOnly,\n } = this;\n\n return (\n <Host\n class={{\n [\"sticky\"]: sticky,\n [\"sticky-desktop\"]: !sticky && stickyDesktopOnly,\n }}\n >\n <header\n class={{\n [\"border-bottom\"]: border,\n [\"tabs\"]: isSlotUsed(this.el, \"tabs\"),\n }}\n >\n <ic-section-container\n aligned={aligned}\n fullHeight={isSlotUsed(this.el, \"tabs\")}\n >\n {isSlotUsed(this.el, \"breadcrumbs\") && (\n <div class=\"breadcrumb-area\">\n <slot name=\"breadcrumbs\" />\n </div>\n )}\n <div class=\"main-content\">\n <div class=\"title-area\">\n <div class=\"header-content\">\n <slot name=\"heading\">\n <ic-typography\n variant={small ? \"h4\" : \"h2\"}\n class=\"heading\"\n >\n <h2>{heading}</h2>\n </ic-typography>\n </slot>\n <slot name=\"heading-adornment\" />\n </div>\n <div>\n <slot name=\"subheading\">\n {subheading && (\n <ic-typography\n variant=\"body\"\n class={{ [\"subheading\"]: true, [\"small\"]: small }}\n >\n {subheading}\n </ic-typography>\n )}\n </slot>\n </div>\n </div>\n {isSlotUsed(this.el, \"actions\") && (\n <div class=\"action-area\">\n <slot name=\"actions\" />\n </div>\n )}\n {isSlotUsed(this.el, \"input\") && (\n <div class=\"input-area\">\n <slot name=\"input\" />\n </div>\n )}\n </div>\n\n {(isSlotUsed(this.el, \"stepper\") ||\n isSlotUsed(this.el, \"tabs\")) && (\n <div class=\"navigation-area\">\n {isSlotUsed(this.el, \"stepper\") &&\n !isSlotUsed(this.el, \"tabs\") && <slot name=\"stepper\" />}\n {isSlotUsed(this.el, \"tabs\") && (\n <nav\n class=\"tabs-slot\"\n aria-label=\"navigation-landmark-page-header\"\n >\n <slot name=\"tabs\" />\n </nav>\n )}\n </div>\n )}\n </ic-section-container>\n </header>\n </Host>\n );\n }\n}\n"],"version":3}
|
1
|
+
{"file":"ic-page-header.js","mappings":";;;;;AAAA,MAAM,eAAe,GAAG,0kIAA0kI;;MC2Br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,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC,KAC7B,WAAK,KAAK,EAAC,aAAa,IACtB,YAAM,IAAI,EAAC,SAAS,GAAG,CACnB,CACP,EACA,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,KAC3B,WAAK,KAAK,EAAC,YAAY,IACrB,YAAM,IAAI,EAAC,OAAO,GAAG,CACjB,CACP,CACG,EAEL,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC;MAC9B,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,MAC3B,WAAK,KAAK,EAAC,iBAAiB,IACzB,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC;MAC7B,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,YAAM,IAAI,EAAC,SAAS,GAAG,EACxD,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,KAC1B,WACE,KAAK,EAAC,WAAW,gBACN,iCAAiC,IAE5C,YAAM,IAAI,EAAC,MAAM,GAAG,CAChB,CACP,CACG,CACP,CACoB,CAChB,CACJ,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/ic-page-header/ic-page-header.css?tag=ic-page-header&encapsulation=shadow","./src/components/ic-page-header/ic-page-header.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: block;\n}\n\n:host(.sticky) {\n position: sticky;\n top: 0;\n box-shadow: var(--ic-elevation-overlay);\n}\n\nheader {\n background-color: var(--ic-architectural-40);\n}\n\nheader.border-bottom {\n border-bottom: 1px solid var(--ic-architectural-300);\n}\n\nheader.tabs {\n padding-top: var(--ic-space-md);\n}\n\n.breadcrumb-area {\n margin-bottom: var(--ic-space-md);\n}\n\n.main-content {\n display: grid;\n grid-template-columns: auto 1fr;\n grid-template-areas:\n \"title-area action-area\"\n \"input-area action-area\";\n column-gap: var(--ic-space-md);\n justify-content: space-between;\n width: 100%;\n}\n\n.title-area {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 304px;\n grid-area: title-area;\n}\n\n.header-content {\n display: flex;\n align-items: center;\n width: 100%;\n flex-wrap: wrap;\n row-gap: var(--ic-space-xs);\n column-gap: var(--ic-space-md);\n}\n\n.heading {\n display: inline-block;\n overflow-wrap: break-word;\n hyphens: auto;\n}\n\n.subheading.small {\n margin-top: var(--ic-space-xs);\n}\n\n.action-area {\n display: flex;\n gap: var(--ic-space-md);\n flex-flow: row wrap;\n justify-self: end;\n justify-content: flex-end;\n height: fit-content;\n grid-area: action-area;\n}\n\n.input-area,\n.navigation-area {\n margin-top: var(--ic-space-md);\n width: 100%;\n}\n\n.tabs-slot {\n display: flex;\n overflow-x: auto;\n padding: 8px;\n margin: -8px;\n}\n\n.input-area {\n grid-area: input-area;\n}\n\n@media screen and (max-width: 576px) {\n ::slotted(ic-text-field) {\n --input-width: 100%;\n\n max-width: 320px;\n }\n\n .main-content {\n grid-template-areas:\n \"title-area\"\n \"action-area\"\n \"input-area\";\n justify-content: flex-start;\n }\n\n .title-area {\n min-width: 0;\n }\n\n .action-area {\n min-width: 100%;\n margin-top: var(--ic-space-md);\n justify-content: start;\n }\n}\n\n@media screen and (min-width: 992px) {\n :host(.sticky-desktop) {\n position: sticky;\n top: 0;\n box-shadow: var(--ic-elevation-overlay);\n }\n}\n","import { Component, Host, h, Prop, Element, State } from \"@stencil/core\";\n\nimport { IcAlignment } from \"../../utils/types\";\n\nimport {\n isSlotUsed,\n DEVICE_SIZES,\n getCurrentDeviceSize,\n checkResizeObserver,\n} from \"../../utils/helpers\";\n\n/**\n * @slot breadcrumbs - Content will be rendered in the breadcrumb area, above the title and action areas.\n * @slot heading - Content will be rendered in the title area, in place of the heading.\n * @slot subheading - Content will be rendered in the title area, in place of the subheading.\n * @slot heading-adornment - Content will be rendered in the title area, adjacent to the heading.\n * @slot actions - Content will be rendered in the action area, adjacent to the title area.\n * @slot input - Content will be rendered in the input area, below the title area and adjacent to the action area.\n * @slot stepper - Content will be rendered in the navigation area, below the title and action areas. Note: stepper slot cannot be used when the tabs slot is being used.\n * @slot tabs - Content will be rendered in the navigation area, below the title and action areas. Note: the stepper slot cannot be used when the tabs slot is being used.\n */\n\n@Component({\n tag: \"ic-page-header\",\n styleUrl: \"ic-page-header.css\",\n shadow: true,\n})\nexport class PageHeader {\n @Element() el: HTMLIcPageHeaderElement;\n /**\n * The title to render on the page header.\n */\n @Prop() heading?: string;\n /**\n * The subtitle to render on the page header.\n */\n @Prop() subheading?: string;\n /**\n * The alignment of the page header.\n */\n @Prop() aligned?: IcAlignment = \"left\";\n /**\n * If `true`, the small styling will be applied to the page header.\n */\n @Prop() small?: boolean = false;\n /**\n * If `true`, a border will be displayed along the bottom of the page header.\n */\n @Prop() border?: boolean = true;\n /**\n * If `true`, the page header will be sticky at all breakpoints.\n */\n @Prop() sticky?: boolean = false;\n /**\n * If `true`, the page header will only be sticky for viewport widths of 992px and above.\n */\n @Prop() stickyDesktopOnly?: boolean = false;\n /**\n * If `true`, the reading pattern and tab order will change in the action area for viewport widths of above 576px and when actions have not wrapped.\n */\n @Prop() reverseOrder?: boolean = false;\n\n @State() deviceSize: number = DEVICE_SIZES.XL;\n\n @State() areButtonsReversed: boolean = false;\n\n @State() actionContent: Node[];\n\n private resizeObserver: ResizeObserver = null;\n\n private resizeObserverCallback = () => {\n if (this.reverseOrder && isSlotUsed(this.el, \"actions\")) {\n this.applyReverseOrder();\n }\n };\n\n private runResizeObserver = () => {\n this.resizeObserver = new ResizeObserver(() => {\n this.resizeObserverCallback();\n });\n this.resizeObserver.observe(this.el);\n };\n\n private applyReverseOrder = (): void => {\n const currSize = getCurrentDeviceSize();\n if (currSize !== this.deviceSize) {\n this.deviceSize = currSize;\n }\n\n const actionArea = this.el.shadowRoot.querySelector(\n \"div.action-area\"\n ) as HTMLElement;\n const actionHeights: number[] = [];\n\n /* For each button in the actions slot, check the height of the button and push this number into the actionHeights array and then find the greatest number in this array (i.e. find the height of the tallest button) */\n for (let i = 0; i < this.actionContent.length; i++) {\n const action = this.actionContent[i] as HTMLElement;\n let actionHeight = action.offsetHeight;\n if (actionHeight === undefined) {\n actionHeight = 0;\n }\n actionHeights.push(actionHeight);\n }\n\n const max = Math.max(...actionHeights);\n\n /* The smallest breakpoint displays buttons in the same order the user has slotted them in. When the device size is larger than the small breakpoiint then the order of the button reverses due to best practice for reading patterns. If the device size is larger than the small breakpoint and the buttons have started to wrap then they follow the order the user has slotted them in. This logic is programmed based on the height of the action-area div that wraps the actions slot. If the height of the action-area div is taller than the height of the tallest button, then it is assumed that the taller height is caused by the buttons wrapping */\n let actionAreaHeight = actionArea.offsetHeight;\n\n if (actionAreaHeight === undefined) {\n actionAreaHeight = 0;\n }\n\n if (\n this.deviceSize > DEVICE_SIZES.S &&\n actionAreaHeight <= max &&\n !this.areButtonsReversed\n ) {\n this.actionContent = this.actionContent.reverse();\n this.actionContent.forEach((btn: string | Node) => {\n this.el.append(btn);\n });\n this.areButtonsReversed = !this.areButtonsReversed;\n } else if (\n ((this.deviceSize > DEVICE_SIZES.S && actionAreaHeight > max) ||\n this.deviceSize <= DEVICE_SIZES.S) &&\n this.areButtonsReversed\n ) {\n this.actionContent = this.actionContent.reverse();\n this.actionContent.forEach((btn: string | Node) => {\n this.el.append(btn);\n });\n this.areButtonsReversed = !this.areButtonsReversed;\n }\n };\n\n componentWillLoad(): void {\n this.actionContent = Array.from(\n this.el.querySelectorAll(`[slot=\"actions\"]`)\n );\n }\n\n componentDidLoad(): void {\n checkResizeObserver(this.runResizeObserver);\n }\n\n disconnectedCallback(): void {\n if (this.resizeObserver !== null) {\n this.resizeObserver.disconnect();\n }\n }\n\n render() {\n const {\n small,\n border,\n heading,\n subheading,\n aligned,\n sticky,\n stickyDesktopOnly,\n } = this;\n\n return (\n <Host\n class={{\n [\"sticky\"]: sticky,\n [\"sticky-desktop\"]: !sticky && stickyDesktopOnly,\n }}\n >\n <header\n class={{\n [\"border-bottom\"]: border,\n [\"tabs\"]: isSlotUsed(this.el, \"tabs\"),\n }}\n >\n <ic-section-container\n aligned={aligned}\n fullHeight={isSlotUsed(this.el, \"tabs\")}\n >\n {isSlotUsed(this.el, \"breadcrumbs\") && (\n <div class=\"breadcrumb-area\">\n <slot name=\"breadcrumbs\" />\n </div>\n )}\n <div class=\"main-content\">\n <div class=\"title-area\">\n <div class=\"header-content\">\n <slot name=\"heading\">\n <ic-typography\n variant={small ? \"h4\" : \"h2\"}\n class=\"heading\"\n >\n <h2>{heading}</h2>\n </ic-typography>\n </slot>\n <slot name=\"heading-adornment\" />\n </div>\n <div>\n <slot name=\"subheading\">\n {subheading && (\n <ic-typography\n variant=\"body\"\n class={{ [\"subheading\"]: true, [\"small\"]: small }}\n >\n {subheading}\n </ic-typography>\n )}\n </slot>\n </div>\n </div>\n {isSlotUsed(this.el, \"actions\") && (\n <div class=\"action-area\">\n <slot name=\"actions\" />\n </div>\n )}\n {isSlotUsed(this.el, \"input\") && (\n <div class=\"input-area\">\n <slot name=\"input\" />\n </div>\n )}\n </div>\n\n {(isSlotUsed(this.el, \"stepper\") ||\n isSlotUsed(this.el, \"tabs\")) && (\n <div class=\"navigation-area\">\n {isSlotUsed(this.el, \"stepper\") &&\n !isSlotUsed(this.el, \"tabs\") && <slot name=\"stepper\" />}\n {isSlotUsed(this.el, \"tabs\") && (\n <nav\n class=\"tabs-slot\"\n aria-label=\"navigation-landmark-page-header\"\n >\n <slot name=\"tabs\" />\n </nav>\n )}\n </div>\n )}\n </ic-section-container>\n </header>\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -114,7 +114,7 @@ const TabGroup = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
114
114
|
return runningTotal;
|
115
115
|
});
|
116
116
|
checkResizeObserver(this.runResizeObserver);
|
117
|
-
onComponentRequiredPropUndefined([{ prop: this.label, propName: "label" }], "Tab
|
117
|
+
onComponentRequiredPropUndefined([{ prop: this.label, propName: "label" }], "Tab Group");
|
118
118
|
}
|
119
119
|
disconnectedCallback() {
|
120
120
|
this.resizeObserver.disconnect();
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"ic-tab-group.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,aAAa,GAAG,siFAAsiF;;ACyB5jF,MAAM,eAAe,GAAG,GAAG,CAAC;MAOf,QAAQ;;;;;IAgCX,mBAAc,GAAY,KAAK,CAAC;IAsBhC,2BAAsB,GAAG;MAC/B,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE;QAC7D,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;OACzE;MACD,IAAI,CAAC,WAAW,GAAG,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;MACtD,IAAI,IAAI,CAAC,WAAW,EAAE;QACpB,IAAI,CAAC,cAAc;UACjB,IAAI,CAAC,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU;YACxD,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;OAC/B;KACF,CAAC;IAEM,sBAAiB,GAAG;MAC1B,IAAI,CAAC,cAAc,GAAG,IAAI,cAAc,CAAC;QACvC,IAAI,CAAC,sBAAsB,EAAE,CAAC;OAC/B,CAAC,CAAC;MACH,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;KAC9C,CAAC;IAEM,eAAU,GAAG;MACnB,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC,CAAC;KACtD,CAAC;IAEM,gBAAW,GAAG;MACpB,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC,CAAC;KACtD,CAAC;IAEM,oBAAe,GAAG;MACx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ACc,MAAM,EAClB,EAAE,EAAC,wBAAwB,EAC3B,KAAK,EAAE;QACL,CAAC,kBAAkB,GAAG,IAAI;QAC1B,CAAC,QAAQ,GAAG,CAAC,WAAW;QACxB,CAAC,UAAU,GAAG,cAAc;OAC7B,IAED,YAAM,KAAK,EAAC,uBAAuB,GAAQ,EAC3C,kBACE,SAAS,EAAC,cAAc,EACxB,KAAK,EAAC,cAAc,EACpB,MAAM,EAAC,aAAa,IAEpB,YACE,EAAE,EAAC,aAAa,EAChB,KAAK,EAAC,cAAc,EACpB,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,WAAW,EAAE,IAAI,CAAC,0BAA0B,EAC5C,SAAS,EAAE,IAAI,CAAC,mBAAmB,GAC7B,CACG,CACT,CACP,CACG,EAEN,0BACc,MAAM,EAClB,KAAK,EAAE;QACL,CAAC,iBAAiB,GAAG,IAAI;QACzB,CAAC,QAAQ,GAAG,MAAM;OACnB,EACD,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC,GAC9B,CACF,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/ic-tab-group/ic-tab-group.css?tag=ic-tab-group&encapsulation=shadow","./src/components/ic-tab-group/ic-tab-group.tsx"],"sourcesContent":[":host {\n --border-bottom-color: var(--ic-architectural-300);\n --splitter-color: var(--ic-architectural-100);\n --tab-scroll-focus: var(--ic-border-focus);\n --tab-scroll-fill: var(--ic-action-default);\n --tab-scroll-disabled-fill: var(--ic-architectural-300);\n --tab-scroll-hover: var(--ic-action-default-bg-hover);\n --tab-scroll-active: var(--ic-action-default-bg-active);\n\n display: block;\n margin-bottom: var(--ic-space-md);\n margin-left: calc(-1 * var(--ic-space-xs));\n}\n\n:host(.light) {\n --splitter-color: var(--ic-architectural-white);\n --tab-scroll-focus: var(--ic-border-focus-dark);\n --tab-scroll-fill: var(--ic-action-light);\n --tab-scroll-disabled-fill: var(--ic-architectural-500);\n --tab-scroll-hover: var(--ic-action-dark-bg-hover);\n --tab-scroll-active: var(--ic-action-dark-bg-active);\n}\n\n:host([inline]) {\n margin-bottom: 0;\n}\n\n.tabs-container {\n display: flex;\n flex-direction: row;\n overflow-y: hidden;\n overflow-x: scroll;\n height: 100%;\n align-items: center;\n padding: var(--ic-space-xs);\n scroll-behavior: smooth;\n -ms-overflow-style: none;\n scrollbar-width: none;\n margin: calc(-1 * var(--ic-space-xs)) 0;\n}\n\n.tabs-container::-webkit-scrollbar {\n display: none;\n}\n\n.ic-tab-group-container {\n display: flex;\n align-items: center;\n}\n\n:host(.light.ic-tab-group-not-inline) {\n --border-bottom-color: var(--ic-architectural-white);\n}\n\n.scroll-container {\n display: flex;\n}\n\n.scroll-container.hidden {\n display: none;\n}\n\n.scroll-container:first-child {\n margin-left: var(--ic-space-xs);\n}\n\n.scroll-arrow {\n display: flex;\n width: 36px;\n height: 36px;\n margin: var(--ic-space-xxs) var(--ic-space-xxxs);\n align-items: center;\n justify-content: center;\n fill: var(--tab-scroll-fill);\n cursor: pointer;\n}\n\n.scroll-arrow:focus {\n outline: var(--ic-hc-focus-outline);\n}\n\n.scroll-arrow:hover {\n background-color: var(--tab-scroll-hover);\n}\n\n.scroll-arrow:active {\n background-color: var(--tab-scroll-active);\n}\n\n.scroll-container.disabled .scroll-arrow {\n fill: var(--tab-scroll-disabled-fill);\n cursor: default;\n}\n\n.scroll-container.disabled .scroll-arrow:hover,\n.scroll-container.disabled .scroll-arrow:active,\n.scroll-container.disabled .scroll-arrow:focus {\n background-color: unset;\n box-shadow: none;\n}\n\n.scroll-container.disabled .ic-tooltip-container {\n display: none !important;\n}\n\n.scroll-splitter-left,\n.scroll-splitter-right {\n display: flex;\n height: var(--ic-space-lg);\n width: 1px;\n margin-top: 10px;\n background-color: var(--splitter-color);\n}\n\n.scroll-splitter-left {\n margin-left: var(--ic-space-xxxs);\n}\n\n.scroll-splitter-right {\n margin-right: var(--ic-space-xxxs);\n}\n\n.scroll-container.disabled .scroll-splitter-left,\n.scroll-container.disabled .scroll-splitter-right {\n display: none;\n}\n\n.ic-tab-splitter {\n display: block;\n background-color: var(--border-bottom-color);\n height: 1px;\n right: 0;\n left: 0;\n margin-left: var(--ic-space-xs);\n}\n\n.ic-tab-splitter.hidden {\n height: 0;\n}\n","import {\n Component,\n Element,\n Host,\n Prop,\n h,\n State,\n Method,\n Listen,\n} from \"@stencil/core\";\n\nimport LeftArrow from \"./assets/left-arrow.svg\";\nimport RightArrow from \"./assets/right-arrow.svg\";\n\nimport {\n checkResizeObserver,\n elementOverflowsX,\n onComponentRequiredPropUndefined,\n} from \"../../utils/helpers\";\nimport { IcTabClickEventDetail } from \"../ic-tab/ic-tab.types\";\nimport {\n IcThemeForegroundNoDefault,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\n\nconst SCROLL_DELAY_MS = 200;\n\n@Component({\n tag: \"ic-tab-group\",\n styleUrl: \"ic-tab-group.css\",\n shadow: true,\n})\nexport class TabGroup {\n @Element() host: HTMLIcTabGroupElement;\n\n /**\n * The unique context needed if using multiple tabs inside one another i.e. rendering another set of tabs inside a tab panel.\n */\n @Prop({ reflect: true }) contextId?: string = \"default\";\n\n /**\n * If `true`, the tabs and tab panels will be positioned separately.\n */\n @Prop({ reflect: true }) inline?: boolean = false;\n\n /**\n * The label to describe the purpose of the set of tabs to screen reader users.\n */\n @Prop() label!: string;\n\n /** @internal The appearance of the tab group, e.g dark, or light. */\n @Prop() appearance?: IcThemeForegroundNoDefault = \"dark\";\n\n @State() firstTabVisible: boolean = true;\n @State() lastTabVisible: boolean = false;\n @State() tabOverflow: boolean = false;\n\n private tabs: HTMLIcTabElement[];\n private tabOffsets: number[];\n private tabGroupEl: HTMLElement;\n private splitterEl: HTMLElement;\n private resizeObserver: ResizeObserver;\n private isScrolling: number;\n private scrollDelay: number;\n private buttonStateSet: boolean = false;\n\n /**\n * @internal if tab side scrolling enabled, scrolls the specified tab into view\n */\n @Method()\n async scrollTabIntoView(tabNumber: number): Promise<void> {\n this.firstTabVisible = tabNumber <= 0;\n const newScrollPos = tabNumber <= 0 ? 0 : this.tabOffsets[tabNumber - 1];\n this.lastTabVisible =\n this.tabGroupEl.offsetWidth + newScrollPos >= this.tabGroupEl.scrollWidth;\n this.buttonStateSet = true;\n this.tabGroupEl.scrollLeft = newScrollPos;\n }\n\n @Listen(\"tabFocus\")\n tabFocusHandler(event: CustomEvent<IcTabClickEventDetail>): void {\n if (this.tabOverflow) {\n this.scrollTabIntoView(event.detail.position);\n }\n }\n\n private resizeObserverCallback = () => {\n if (this.tabGroupEl === null || this.tabGroupEl === undefined) {\n this.tabGroupEl = this.host.shadowRoot.querySelector(\".tabs-container\");\n }\n this.tabOverflow = elementOverflowsX(this.tabGroupEl);\n if (this.tabOverflow) {\n this.lastTabVisible =\n this.tabGroupEl.offsetWidth + this.tabGroupEl.scrollLeft >=\n this.tabGroupEl.scrollWidth;\n }\n };\n\n private runResizeObserver = () => {\n this.resizeObserver = new ResizeObserver(() => {\n this.resizeObserverCallback();\n });\n this.resizeObserver.observe(this.splitterEl);\n };\n\n private scrollLeft = () => {\n this.scrollTabIntoView(this.getCurrentLeftTab() - 1);\n };\n\n private scrollRight = () => {\n this.scrollTabIntoView(this.getCurrentLeftTab() + 1);\n };\n\n private longScrollRight = () => {\n this.scrollRight();\n this.scrollDelay = window.setTimeout(this.longScrollRight, SCROLL_DELAY_MS);\n };\n\n private longScrollLeft = () => {\n this.scrollLeft();\n this.scrollDelay = window.setTimeout(this.longScrollLeft, SCROLL_DELAY_MS);\n };\n\n private leftArrowMouseDownHandler = () => {\n this.scrollDelay = window.setTimeout(this.longScrollLeft, SCROLL_DELAY_MS);\n };\n\n private rightArrowMouseDownHandler = () => {\n this.scrollDelay = window.setTimeout(this.longScrollRight, SCROLL_DELAY_MS);\n };\n\n private arrowMouseUpHandler = () => {\n window.clearTimeout(this.scrollDelay);\n };\n\n private getCurrentLeftTab = (): number => {\n const index = this.tabOffsets.findIndex(\n (el) => el > this.tabGroupEl.scrollLeft\n );\n return index < 0 ? 0 : index;\n };\n\n private scrollHandler = () => {\n window.clearTimeout(this.isScrolling);\n // Set a timeout to run after scrolling ends\n this.isScrolling = window.setTimeout(this.scrollStopped, 50);\n };\n\n private scrollStopped = () => {\n // if scrollTabIntoView has been called, the button states will already be set\n // can't just handle it here as it causes strange jumping behaviour in positioning\n if (this.buttonStateSet === false) {\n this.firstTabVisible = this.tabGroupEl.scrollLeft === 0;\n this.lastTabVisible =\n this.tabGroupEl.offsetWidth + this.tabGroupEl.scrollLeft >=\n this.tabGroupEl.scrollWidth;\n }\n this.buttonStateSet = false;\n };\n\n componentDidLoad(): void {\n this.tabs = Array.from(this.host.querySelectorAll(\"ic-tab\"));\n let runningTotal = 0;\n this.tabOffsets = this.tabs.map((tab) => {\n runningTotal += tab.offsetWidth;\n return runningTotal;\n });\n checkResizeObserver(this.runResizeObserver);\n\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Tab List\"\n );\n }\n\n disconnectedCallback(): void {\n this.resizeObserver.disconnect();\n }\n\n render() {\n const {\n inline,\n appearance,\n label,\n firstTabVisible,\n lastTabVisible,\n tabOverflow,\n } = this;\n\n return (\n <Host\n role=\"tablist\"\n aria-label={label}\n class={{\n [\"light\"]: appearance === IcThemeForegroundEnum.Light,\n [\"ic-tab-group-not-inline\"]: !inline,\n }}\n >\n <div class=\"ic-tab-group-container\">\n {this.tabOverflow && (\n <div\n aria-hidden=\"true\"\n id=\"scroll-container-left\"\n class={{\n [\"scroll-container\"]: true,\n [\"hidden\"]: !tabOverflow,\n [\"disabled\"]: firstTabVisible,\n }}\n >\n <ic-tooltip\n placement=\"bottom-start\"\n label=\"Scroll left\"\n target=\"left-arrow\"\n >\n <span\n id=\"left-arrow\"\n class=\"scroll-arrow\"\n innerHTML={LeftArrow}\n onClick={this.scrollLeft}\n onMouseDown={this.leftArrowMouseDownHandler}\n onMouseUp={this.arrowMouseUpHandler}\n ></span>\n </ic-tooltip>\n <span class=\"scroll-splitter-left\"></span>\n </div>\n )}\n <div\n class=\"tabs-container\"\n ref={(el) => (this.tabGroupEl = el)}\n onScroll={this.scrollHandler}\n >\n <slot></slot>\n </div>\n {this.tabOverflow && (\n <div\n aria-hidden=\"true\"\n id=\"scroll-container-right\"\n class={{\n [\"scroll-container\"]: true,\n [\"hidden\"]: !tabOverflow,\n [\"disabled\"]: lastTabVisible,\n }}\n >\n <span class=\"scroll-splitter-right\"></span>\n <ic-tooltip\n placement=\"bottom-start\"\n label=\"Scroll right\"\n target=\"right-arrow\"\n >\n <span\n id=\"right-arrow\"\n class=\"scroll-arrow\"\n innerHTML={RightArrow}\n onClick={this.scrollRight}\n onMouseDown={this.rightArrowMouseDownHandler}\n onMouseUp={this.arrowMouseUpHandler}\n ></span>\n </ic-tooltip>\n </div>\n )}\n </div>\n\n <div\n aria-hidden=\"true\"\n class={{\n [\"ic-tab-splitter\"]: true,\n [\"hidden\"]: inline,\n }}\n ref={(el) => (this.splitterEl = el)}\n ></div>\n </Host>\n );\n }\n}\n"],"version":3}
|
1
|
+
{"file":"ic-tab-group.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,aAAa,GAAG,siFAAsiF;;ACyB5jF,MAAM,eAAe,GAAG,GAAG,CAAC;MAOf,QAAQ;;;;;IAgCX,mBAAc,GAAY,KAAK,CAAC;IAsBhC,2BAAsB,GAAG;MAC/B,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE;QAC7D,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;OACzE;MACD,IAAI,CAAC,WAAW,GAAG,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;MACtD,IAAI,IAAI,CAAC,WAAW,EAAE;QACpB,IAAI,CAAC,cAAc;UACjB,IAAI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AC,UAAU,GAAG,EAAE,CAAC,GAC9B,CACF,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/ic-tab-group/ic-tab-group.css?tag=ic-tab-group&encapsulation=shadow","./src/components/ic-tab-group/ic-tab-group.tsx"],"sourcesContent":[":host {\n --border-bottom-color: var(--ic-architectural-300);\n --splitter-color: var(--ic-architectural-100);\n --tab-scroll-focus: var(--ic-border-focus);\n --tab-scroll-fill: var(--ic-action-default);\n --tab-scroll-disabled-fill: var(--ic-architectural-300);\n --tab-scroll-hover: var(--ic-action-default-bg-hover);\n --tab-scroll-active: var(--ic-action-default-bg-active);\n\n display: block;\n margin-bottom: var(--ic-space-md);\n margin-left: calc(-1 * var(--ic-space-xs));\n}\n\n:host(.light) {\n --splitter-color: var(--ic-architectural-white);\n --tab-scroll-focus: var(--ic-border-focus-dark);\n --tab-scroll-fill: var(--ic-action-light);\n --tab-scroll-disabled-fill: var(--ic-architectural-500);\n --tab-scroll-hover: var(--ic-action-dark-bg-hover);\n --tab-scroll-active: var(--ic-action-dark-bg-active);\n}\n\n:host([inline]) {\n margin-bottom: 0;\n}\n\n.tabs-container {\n display: flex;\n flex-direction: row;\n overflow-y: hidden;\n overflow-x: scroll;\n height: 100%;\n align-items: center;\n padding: var(--ic-space-xs);\n scroll-behavior: smooth;\n -ms-overflow-style: none;\n scrollbar-width: none;\n margin: calc(-1 * var(--ic-space-xs)) 0;\n}\n\n.tabs-container::-webkit-scrollbar {\n display: none;\n}\n\n.ic-tab-group-container {\n display: flex;\n align-items: center;\n}\n\n:host(.light.ic-tab-group-not-inline) {\n --border-bottom-color: var(--ic-architectural-white);\n}\n\n.scroll-container {\n display: flex;\n}\n\n.scroll-container.hidden {\n display: none;\n}\n\n.scroll-container:first-child {\n margin-left: var(--ic-space-xs);\n}\n\n.scroll-arrow {\n display: flex;\n width: 36px;\n height: 36px;\n margin: var(--ic-space-xxs) var(--ic-space-xxxs);\n align-items: center;\n justify-content: center;\n fill: var(--tab-scroll-fill);\n cursor: pointer;\n}\n\n.scroll-arrow:focus {\n outline: var(--ic-hc-focus-outline);\n}\n\n.scroll-arrow:hover {\n background-color: var(--tab-scroll-hover);\n}\n\n.scroll-arrow:active {\n background-color: var(--tab-scroll-active);\n}\n\n.scroll-container.disabled .scroll-arrow {\n fill: var(--tab-scroll-disabled-fill);\n cursor: default;\n}\n\n.scroll-container.disabled .scroll-arrow:hover,\n.scroll-container.disabled .scroll-arrow:active,\n.scroll-container.disabled .scroll-arrow:focus {\n background-color: unset;\n box-shadow: none;\n}\n\n.scroll-container.disabled .ic-tooltip-container {\n display: none !important;\n}\n\n.scroll-splitter-left,\n.scroll-splitter-right {\n display: flex;\n height: var(--ic-space-lg);\n width: 1px;\n margin-top: 10px;\n background-color: var(--splitter-color);\n}\n\n.scroll-splitter-left {\n margin-left: var(--ic-space-xxxs);\n}\n\n.scroll-splitter-right {\n margin-right: var(--ic-space-xxxs);\n}\n\n.scroll-container.disabled .scroll-splitter-left,\n.scroll-container.disabled .scroll-splitter-right {\n display: none;\n}\n\n.ic-tab-splitter {\n display: block;\n background-color: var(--border-bottom-color);\n height: 1px;\n right: 0;\n left: 0;\n margin-left: var(--ic-space-xs);\n}\n\n.ic-tab-splitter.hidden {\n height: 0;\n}\n","import {\n Component,\n Element,\n Host,\n Prop,\n h,\n State,\n Method,\n Listen,\n} from \"@stencil/core\";\n\nimport LeftArrow from \"./assets/left-arrow.svg\";\nimport RightArrow from \"./assets/right-arrow.svg\";\n\nimport {\n checkResizeObserver,\n elementOverflowsX,\n onComponentRequiredPropUndefined,\n} from \"../../utils/helpers\";\nimport { IcTabClickEventDetail } from \"../ic-tab/ic-tab.types\";\nimport {\n IcThemeForegroundNoDefault,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\n\nconst SCROLL_DELAY_MS = 200;\n\n@Component({\n tag: \"ic-tab-group\",\n styleUrl: \"ic-tab-group.css\",\n shadow: true,\n})\nexport class TabGroup {\n @Element() host: HTMLIcTabGroupElement;\n\n /**\n * The unique context needed if using multiple tabs inside one another i.e. rendering another set of tabs inside a tab panel.\n */\n @Prop({ reflect: true }) contextId?: string = \"default\";\n\n /**\n * If `true`, the tabs and tab panels will be positioned separately.\n */\n @Prop({ reflect: true }) inline?: boolean = false;\n\n /**\n * The label to describe the purpose of the set of tabs to screen reader users.\n */\n @Prop() label!: string;\n\n /** @internal The appearance of the tab group, e.g dark, or light. */\n @Prop() appearance?: IcThemeForegroundNoDefault = \"dark\";\n\n @State() firstTabVisible: boolean = true;\n @State() lastTabVisible: boolean = false;\n @State() tabOverflow: boolean = false;\n\n private tabs: HTMLIcTabElement[];\n private tabOffsets: number[];\n private tabGroupEl: HTMLElement;\n private splitterEl: HTMLElement;\n private resizeObserver: ResizeObserver;\n private isScrolling: number;\n private scrollDelay: number;\n private buttonStateSet: boolean = false;\n\n /**\n * @internal if tab side scrolling enabled, scrolls the specified tab into view\n */\n @Method()\n async scrollTabIntoView(tabNumber: number): Promise<void> {\n this.firstTabVisible = tabNumber <= 0;\n const newScrollPos = tabNumber <= 0 ? 0 : this.tabOffsets[tabNumber - 1];\n this.lastTabVisible =\n this.tabGroupEl.offsetWidth + newScrollPos >= this.tabGroupEl.scrollWidth;\n this.buttonStateSet = true;\n this.tabGroupEl.scrollLeft = newScrollPos;\n }\n\n @Listen(\"tabFocus\")\n tabFocusHandler(event: CustomEvent<IcTabClickEventDetail>): void {\n if (this.tabOverflow) {\n this.scrollTabIntoView(event.detail.position);\n }\n }\n\n private resizeObserverCallback = () => {\n if (this.tabGroupEl === null || this.tabGroupEl === undefined) {\n this.tabGroupEl = this.host.shadowRoot.querySelector(\".tabs-container\");\n }\n this.tabOverflow = elementOverflowsX(this.tabGroupEl);\n if (this.tabOverflow) {\n this.lastTabVisible =\n this.tabGroupEl.offsetWidth + this.tabGroupEl.scrollLeft >=\n this.tabGroupEl.scrollWidth;\n }\n };\n\n private runResizeObserver = () => {\n this.resizeObserver = new ResizeObserver(() => {\n this.resizeObserverCallback();\n });\n this.resizeObserver.observe(this.splitterEl);\n };\n\n private scrollLeft = () => {\n this.scrollTabIntoView(this.getCurrentLeftTab() - 1);\n };\n\n private scrollRight = () => {\n this.scrollTabIntoView(this.getCurrentLeftTab() + 1);\n };\n\n private longScrollRight = () => {\n this.scrollRight();\n this.scrollDelay = window.setTimeout(this.longScrollRight, SCROLL_DELAY_MS);\n };\n\n private longScrollLeft = () => {\n this.scrollLeft();\n this.scrollDelay = window.setTimeout(this.longScrollLeft, SCROLL_DELAY_MS);\n };\n\n private leftArrowMouseDownHandler = () => {\n this.scrollDelay = window.setTimeout(this.longScrollLeft, SCROLL_DELAY_MS);\n };\n\n private rightArrowMouseDownHandler = () => {\n this.scrollDelay = window.setTimeout(this.longScrollRight, SCROLL_DELAY_MS);\n };\n\n private arrowMouseUpHandler = () => {\n window.clearTimeout(this.scrollDelay);\n };\n\n private getCurrentLeftTab = (): number => {\n const index = this.tabOffsets.findIndex(\n (el) => el > this.tabGroupEl.scrollLeft\n );\n return index < 0 ? 0 : index;\n };\n\n private scrollHandler = () => {\n window.clearTimeout(this.isScrolling);\n // Set a timeout to run after scrolling ends\n this.isScrolling = window.setTimeout(this.scrollStopped, 50);\n };\n\n private scrollStopped = () => {\n // if scrollTabIntoView has been called, the button states will already be set\n // can't just handle it here as it causes strange jumping behaviour in positioning\n if (this.buttonStateSet === false) {\n this.firstTabVisible = this.tabGroupEl.scrollLeft === 0;\n this.lastTabVisible =\n this.tabGroupEl.offsetWidth + this.tabGroupEl.scrollLeft >=\n this.tabGroupEl.scrollWidth;\n }\n this.buttonStateSet = false;\n };\n\n componentDidLoad(): void {\n this.tabs = Array.from(this.host.querySelectorAll(\"ic-tab\"));\n let runningTotal = 0;\n this.tabOffsets = this.tabs.map((tab) => {\n runningTotal += tab.offsetWidth;\n return runningTotal;\n });\n checkResizeObserver(this.runResizeObserver);\n\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Tab Group\"\n );\n }\n\n disconnectedCallback(): void {\n this.resizeObserver.disconnect();\n }\n\n render() {\n const {\n inline,\n appearance,\n label,\n firstTabVisible,\n lastTabVisible,\n tabOverflow,\n } = this;\n\n return (\n <Host\n role=\"tablist\"\n aria-label={label}\n class={{\n [\"light\"]: appearance === IcThemeForegroundEnum.Light,\n [\"ic-tab-group-not-inline\"]: !inline,\n }}\n >\n <div class=\"ic-tab-group-container\">\n {this.tabOverflow && (\n <div\n aria-hidden=\"true\"\n id=\"scroll-container-left\"\n class={{\n [\"scroll-container\"]: true,\n [\"hidden\"]: !tabOverflow,\n [\"disabled\"]: firstTabVisible,\n }}\n >\n <ic-tooltip\n placement=\"bottom-start\"\n label=\"Scroll left\"\n target=\"left-arrow\"\n >\n <span\n id=\"left-arrow\"\n class=\"scroll-arrow\"\n innerHTML={LeftArrow}\n onClick={this.scrollLeft}\n onMouseDown={this.leftArrowMouseDownHandler}\n onMouseUp={this.arrowMouseUpHandler}\n ></span>\n </ic-tooltip>\n <span class=\"scroll-splitter-left\"></span>\n </div>\n )}\n <div\n class=\"tabs-container\"\n ref={(el) => (this.tabGroupEl = el)}\n onScroll={this.scrollHandler}\n >\n <slot></slot>\n </div>\n {this.tabOverflow && (\n <div\n aria-hidden=\"true\"\n id=\"scroll-container-right\"\n class={{\n [\"scroll-container\"]: true,\n [\"hidden\"]: !tabOverflow,\n [\"disabled\"]: lastTabVisible,\n }}\n >\n <span class=\"scroll-splitter-right\"></span>\n <ic-tooltip\n placement=\"bottom-start\"\n label=\"Scroll right\"\n target=\"right-arrow\"\n >\n <span\n id=\"right-arrow\"\n class=\"scroll-arrow\"\n innerHTML={RightArrow}\n onClick={this.scrollRight}\n onMouseDown={this.rightArrowMouseDownHandler}\n onMouseUp={this.arrowMouseUpHandler}\n ></span>\n </ic-tooltip>\n </div>\n )}\n </div>\n\n <div\n aria-hidden=\"true\"\n class={{\n [\"ic-tab-splitter\"]: true,\n [\"hidden\"]: inline,\n }}\n ref={(el) => (this.splitterEl = el)}\n ></div>\n </Host>\n );\n }\n}\n"],"version":3}
|
package/dist/core/core.esm.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import{p as e,b as a}from"./p-f9370be6.js";const i=()=>{const a=import.meta.url;const i={};if(a!==""){i.resourcesUrl=new URL(".",a).href}return e(i)};i().then((e=>a(JSON.parse('[["p-6d0eaaeb",[[1,"ic-typography",{"variant":[1],"applyVerticalMargins":[4,"apply-vertical-margins"]}]]],["p-16698d3e",[[1,"ic-search-bar",{"label":[1],"required":[4],"disabled":[4],"readonly":[4],"placeholder":[1],"fullWidth":[4,"full-width"],"disableFilter":[4,"disable-filter"],"hideLabel":[4,"hide-label"],"helperText":[1,"helper-text"],"small":[4],"value":[1537],"autocapitalize":[1],"autocomplete":[1],"autocorrect":[1],"autofocus":[4],"debounce":[2],"name":[1],"spellcheck":[4],"options":[16],"focusOnLoad":[4,"focus-on-load"],"hintText":[1,"hint-text"],"emptyOptionListText":[1,"empty-option-list-text"],"charactersUntilSuggestion":[2,"characters-until-suggestion"],"open":[32],"filteredOptions":[32],"ariaActiveDescendant":[32],"showClearButton":[32],"clearButtonFocused":[32],"searchSubmitFocused":[32],"prevNoOption":[32],"highlightedValue":[32],"setFocus":[64]},[[0,"icKeydown","handleKeyDown"],[0,"keyup","handleKeyUp"],[0,"icMenuStateChange","onMenuClose"],[0,"menuOptionId","onMenuOptionHighlighted"]]]]],["p-3efa7f8b",[[1,"ic-select",{"label":[1],"options":[16],"required":[4],"hideLabel":[4,"hide-label"],"disabled":[516],"readonly":[4],"placeholder":[1],"helperText":[1,"helper-text"],"small":[4],"fullWidth":[4,"full-width"],"validationStatus":[1,"validation-status"],"validationText":[1,"validation-text"],"value":[1025],"name":[1],"showClearButton":[4,"show-clear-button"],"searchable":[4],"includeDescriptionsInSearch":[4,"include-descriptions-in-search"],"includeGroupTitlesInSearch":[4,"include-group-titles-in-search"],"searchMatchPosition":[1,"search-match-position"],"charactersUntilSuggestions":[2,"characters-until-suggestions"],"emptyOptionListText":[1,"empty-option-list-text"],"open":[32],"clearButtonFocused":[32],"searchableSelectInputValue":[32],"filteredOptions":[32],"ariaActiveDescendant":[32],"noOptions":[32],"initialValue":[32],"setFocus":[64]}]]],["p-5616cfb8",[[1,"ic-top-navigation",{"appTitle":[1,"app-title"],"href":[1],"version":[1],"status":[1],"contentAligned":[1,"content-aligned"],"inline":[4],"menuOpen":[32],"deviceSize":[32],"mobileSearchBarVisible":[32],"navMenuVisible":[32],"searchValue":[32],"mobileSearchHiddenOnBlur":[32],"searchButtonClick":[32],"foregroundColor":[32],"hasFullWidthSearchBar":[32]},[[0,"icNavigationMenuClose","navBarMenuCloseHandler"],[0,"icSearchBarBlur","searchInputBlurHandler"],[0,"icChange","searchValueChangeHandler"],[4,"themeChange","themeChangeHandler"]]]]],["p-8470c255",[[1,"ic-side-navigation",{"appTitle":[1,"app-title"],"status":[1],"version":[1],"expanded":[4],"href":[1],"static":[4],"collapsedIconLabels":[4,"collapsed-icon-labels"],"inline":[4],"disableAutoParentStyling":[4,"disable-auto-parent-styling"],"foregroundColor":[32],"menuOpen":[32],"menuExpanded":[32],"deviceSize":[32],"deviceSizeAppTitle":[32],"hasSecondaryNavigation":[32]},[[4,"themeChange","themeChangeHandler"]]]]],["p-27554319",[[1,"ic-alert",{"variant":[1],"heading":[1],"message":[1],"titleAbove":[4,"title-above"],"dismissible":[4],"announced":[4],"visible":[32],"alertTitleWrap":[32]},[[2,"icDismiss","handleClick"]]]]],["p-d599cf4f",[[1,"ic-card",{"clickable":[1028],"href":[1],"hreflang":[1],"referrerpolicy":[1],"rel":[1],"target":[1],"heading":[1],"subheading":[1],"message":[1],"disabled":[4],"fullWidth":[4,"full-width"],"expandable":[4],"parentIsAnchorTag":[32],"isFocussed":[32],"parentEl":[32],"appearance":[32],"areaExpanded":[32]},[[2,"click","handleHostClick"],[4,"themeChange","themeChangeHandler"]]]]],["p-3f9cdcdd",[[1,"ic-navigation-button",{"label":[1],"href":[1],"target":[1],"rel":[1],"download":[8],"hreflang":[1],"referrerpolicy":[1],"mode":[32],"initialAppearance":[32],"setFocus":[64]},[[4,"icNavigationMenuOpened","navBarMenuOpenHandler"],[4,"icNavigationMenuClosed","navBarMenuCloseHandler"],[4,"themeChange","themeChangeHandler"]]]]],["p-e192e25d",[[1,"ic-checkbox-group",{"label":[1],"name":[1],"required":[4],"hideLabel":[4,"hide-label"],"disabled":[4],"helperText":[1,"helper-text"],"small":[4],"validationStatus":[1,"validation-status"],"validationText":[1,"validation-text"],"checkedOptions":[32]},[[0,"icCheck","selectHandler"]]]]],["p-01e8bd4a",[[1,"ic-radio-group",{"label":[1],"name":[1],"required":[4],"hideLabel":[4,"hide-label"],"disabled":[4],"helperText":[1,"helper-text"],"small":[4],"validationStatus":[1,"validation-status"],"validationText":[1,"validation-text"],"checkedValue":[32],"selectedChild":[32]},[[0,"icCheck","selectHandler"]]]]],["p-f760198e",[[1,"ic-breadcrumb-group",{"backBreadcrumbOnly":[4,"back-breadcrumb-only"],"collapsed":[4],"deviceSize":[32],"expandedBreadcrumbs":[32]}]]],["p-6cb276c6",[[1,"ic-chip",{"label":[1],"appearance":[1],"size":[1],"dismissible":[4],"disabled":[4],"visible":[32],"isHovered":[32]},[[2,"icDismiss","handleClick"]]]]],["p-fd0c6039",[[1,"ic-footer",{"description":[1],"aligned":[1],"breakpoint":[1],"groupLinks":[4,"group-links"],"caption":[1],"copyright":[4],"deviceSize":[32],"foregroundColor":[32]},[[4,"themeChange","themeChangeHandler"]]]]],["p-ae02b008",[[1,"ic-footer-link-group",{"groupTitle":[1,"group-title"],"small":[32],"expanded":[32],"dropdownIconStyle":[32],"deviceSize":[32]},[[4,"footerResized","footerResizeHandler"],[4,"themeChange","footerThemeChangeHandler"]]]]],["p-c1d78a64",[[1,"ic-hero",{"heading":[1],"subheading":[1],"secondaryHeading":[1,"secondary-heading"],"secondarySubheading":[1,"secondary-subheading"],"backgroundImage":[1,"background-image"],"disableBackgroundParallax":[4,"disable-background-parallax"],"aligned":[1],"contentAligned":[1,"content-aligned"],"small":[4],"rightContent":[32],"scrollFactor":[32],"leftContentFullWidth":[32],"foregroundColor":[32]},[[4,"themeChange","themeChangeHandler"],[5,"scroll","doScroll"]]]]],["p-0b00f848",[[1,"ic-navigation-item",{"label":[1],"href":[1],"selected":[4],"expandable":[4],"displayNavigationTooltip":[4,"display-navigation-tooltip"],"collapsedIconLabel":[4,"collapsed-icon-label"],"isTopNavChild":[32],"inTopNavSideMenu":[32],"deviceSize":[32],"focusStyle":[32],"navigationType":[32],"parentEl":[32],"sideNavExpanded":[32],"isSideNavMobile":[32],"setFocus":[64]},[[4,"themeChange","themeChangeHandler"]]]]],["p-217fa7de",[[1,"ic-page-header",{"heading":[1],"subheading":[1],"aligned":[1],"small":[4],"border":[4],"sticky":[4],"stickyDesktopOnly":[4,"sticky-desktop-only"],"reverseOrder":[4,"reverse-order"],"deviceSize":[32],"areButtonsReversed":[32],"actionContent":[32]}]]],["p-80cd0a2d",[[1,"ic-step",{"variant":[1],"stepTitle":[1,"step-title"],"stepSubtitle":[1,"step-subtitle"],"stepStatus":[1,"step-status"],"stepType":[1,"step-type"],"current":[1028],"compactStepStyling":[1,"compact-step-styling"],"stepNum":[2,"step-num"],"lastStep":[4,"last-step"],"lastStepNum":[2,"last-step-num"],"nextStepTitle":[1,"next-step-title"],"progress":[2]}]]],["p-e810f48c",[[1,"ic-switch",{"label":[1],"hideLabel":[4,"hide-label"],"helperText":[1,"helper-text"],"checked":[4],"small":[4],"disabled":[4],"name":[1],"showState":[4,"show-state"],"value":[1],"checkedState":[32],"initiallyChecked":[32]}]]],["p-9fbceeb2",[[1,"ic-tab-group",{"contextId":[513,"context-id"],"inline":[516],"label":[1],"appearance":[1],"firstTabVisible":[32],"lastTabVisible":[32],"tabOverflow":[32],"scrollTabIntoView":[64]},[[0,"tabFocus","tabFocusHandler"]]]]],["p-bbe00cb1",[[1,"ic-back-to-top",{"target":[1],"bannerOffset":[32],"targetElVisible":[32],"footerVisible":[32]}]]],["p-1da1f2f3",[[1,"ic-checkbox",{"checked":[1540],"disabled":[4],"label":[1],"value":[1],"name":[1],"groupLabel":[1,"group-label"],"dynamicText":[1,"dynamic-text"],"additionalFieldDisplay":[513,"additional-field-display"],"indeterminate":[4],"initiallyChecked":[32]}]]],["p-9b4022d7",[[1,"ic-classification-banner",{"additionalSelectors":[1,"additional-selectors"],"classification":[1],"country":[1],"inline":[4],"upTo":[4,"up-to"]}]]],["p-e93e9aa3",[[1,"ic-data-entity",{"heading":[1],"small":[4]}]]],["p-eaea567e",[[1,"ic-data-row",{"label":[1],"value":[1],"small":[4],"deviceSize":[32],"entitySize":[32]}]]],["p-930cd4cc",[[1,"ic-navigation-group",{"label":[1],"expandable":[4],"dropdownOpen":[32],"inTopNavSideMenu":[32],"deviceSize":[32],"focusStyle":[32],"navigationType":[32],"parentEl":[32],"expanded":[32],"setFocus":[64]},[[0,"childBlur","childBlurHandler"],[0,"navItemClicked","navItemClickHandler"],[4,"themeChange","themeChangeHandler"]]]]],["p-66cad84e",[[1,"ic-radio-option",{"selected":[1540],"disabled":[4],"label":[1],"value":[1025],"name":[1],"groupLabel":[1,"group-label"],"dynamicText":[1,"dynamic-text"],"additionalFieldDisplay":[513,"additional-field-display"],"initiallySelected":[32]},[[0,"icChange","textfieldValueHandler"]]]]],["p-bb106092",[[1,"ic-status-tag",{"label":[1],"status":[1],"appearance":[1],"small":[4],"announced":[4]}]]],["p-cadb531f",[[1,"ic-tab",{"contextId":[513,"context-id"],"disabled":[4],"selected":[516],"tabId":[513,"tab-id"],"tabPosition":[2,"tab-position"],"appearance":[1]}]]],["p-050e1e7b",[[1,"ic-footer-link",{"href":[1],"footerConfig":[32],"deviceSize":[32],"foregroundColor":[32]},[[4,"footerResized","footerResizeHandler"],[4,"themeChange","footerThemeChangeHandler"]]]]],["p-a2d3e955",[[1,"ic-skeleton",{"variant":[1],"light":[4],"hasChild":[32],"default":[32],"heightOnly":[32],"widthOnly":[32]}]]],["p-6f442942",[[1,"ic-stepper",{"aligned":[1],"variant":[1025],"connectorWidth":[2,"connector-width"],"hideStepInfo":[4,"hide-step-info"],"stepperWidth":[32],"lastStepWidth":[32],"stepTypes":[32],"alignedFullWidth":[32],"autoSetStepTitles":[32],"variantOverride":[32],"noOfResizes":[32]}]]],["p-9e684c58",[[4,"ic-tab-context",{"contextId":[513,"context-id"],"activationType":[1,"activation-type"],"selectedTabIndex":[2,"selected-tab-index"],"appearance":[1],"selectedTab":[32]},[[0,"tabClick","tabClickHandler"]]]]],["p-272c7abd",[[1,"ic-tab-panel",{"contextId":[513,"context-id"],"tabPosition":[514,"tab-position"],"panelId":[513,"panel-id"],"selectedTab":[1,"selected-tab"],"appearance":[1]}]]],["p-4f1a7195",[[1,"ic-theme",{"color":[1]}]]],["p-18a9beea",[[1,"ic-menu",{"open":[516],"options":[16],"small":[516],"menuId":[1,"menu-id"],"value":[1],"activationType":[1,"activation-type"],"inputEl":[16],"parentEl":[16],"inputLabel":[1,"input-label"],"anchorEl":[16],"fullWidth":[4,"full-width"],"autoFocusOnSelected":[4,"auto-focus-on-selected"],"keyboardNav":[32],"optionHighlighted":[32],"focusFromSearchKeypress":[32],"initialOptionsListRender":[32],"preventIncorrectTabOrder":[32],"handleClickOpen":[64],"handleKeyboardOpen":[64],"handleSetFirstOption":[64]},[[4,"icClear","handleClearListener"],[4,"icSubmitSearch","handleSubmitSearch"]]],[4,"ic-input-component-container",{"disabled":[4],"readonly":[4],"validationStatus":[1,"validation-status"],"small":[4],"multiLine":[4,"multi-line"],"validationInline":[4,"validation-inline"],"dark":[4],"fullWidth":[4,"full-width"]}],[4,"ic-input-container",{"disabled":[4],"readonly":[4]}]]],["p-c320fa70",[[4,"ic-input-validation",{"message":[1],"for":[1],"status":[1],"fullWidth":[4,"full-width"],"ariaLiveMode":[1,"aria-live-mode"]}],[0,"ic-input-label",{"for":[1],"required":[4],"helperText":[1,"helper-text"],"label":[1],"disabled":[4],"readonly":[4],"error":[4],"dark":[4]}]]],["p-204f6315",[[1,"ic-text-field",{"inputId":[1,"input-id"],"label":[1],"required":[4],"disabled":[4],"readonly":[516],"placeholder":[1],"fullWidth":[4,"full-width"],"hideLabel":[4,"hide-label"],"helperText":[1,"helper-text"],"rows":[2],"resize":[4],"small":[516],"value":[1537],"maxLength":[2,"max-length"],"validationStatus":[1,"validation-status"],"validationText":[1,"validation-text"],"validationInline":[4,"validation-inline"],"autocapitalize":[1],"autocomplete":[1],"autocorrect":[1],"autoFocus":[4,"auto-focus"],"debounce":[2],"type":[1],"inputmode":[1],"name":[1],"spellcheck":[4],"ariaActiveDescendant":[1,"aria-active-descendant"],"truncateValue":[4,"truncate-value"],"ariaExpanded":[1,"aria-expanded"],"ariaOwns":[1,"aria-owns"],"ariaAutocomplete":[1,"aria-autocomplete"],"role":[1],"hiddenInput":[4,"hidden-input"],"numChars":[32],"maxLengthExceeded":[32],"initialValue":[32],"setFocus":[64]},[[0,"keydown","handleKeyDown"]]]]],["p-89a925f8",[[1,"ic-button",{"disabled":[4],"loading":[4],"type":[1],"href":[1],"target":[1],"rel":[1],"download":[8],"hreflang":[1],"referrerpolicy":[1],"variant":[1],"size":[1],"fullWidth":[4,"full-width"],"disableTooltip":[4,"disable-tooltip"],"tooltipPlacement":[1,"tooltip-placement"],"appearance":[1025],"setFocus":[64],"updateAriaLabel":[64]},[[2,"click","handleHostClick"],[4,"themeChange","themeChangeHandler"]]],[1,"ic-loading-indicator",{"progress":[2],"min":[2],"max":[2],"label":[1],"description":[1],"innerLabel":[2,"inner-label"],"labelDuration":[2,"label-duration"],"size":[513],"type":[513],"fullWidth":[516,"full-width"],"appearance":[1],"indicatorLabel":[32],"indeterminate":[32],"showSecond":[32],"circularLineWidth":[32],"compactStepCircularLineWidth":[32],"circularDiameter":[32]}],[1,"ic-tooltip",{"target":[513],"placement":[1],"label":[1],"disableHover":[4,"disable-hover"]}]]],["p-3f4d632c",[[1,"ic-navigation-menu",{"version":[1],"status":[1]},[[0,"navItemClicked","navItemClickHandler"],[4,"keydown","handleKeyDown"]]]]],["p-23bf0b7a",[[1,"ic-link",{"download":[8],"href":[1],"hreflang":[1],"referrerpolicy":[1],"rel":[1],"target":[1],"showIcon":[4,"show-icon"],"appearance":[1025]},[[4,"themeChange","themeChangeHandler"]]]]],["p-7ba184da",[[1,"ic-breadcrumb",{"pageTitle":[1,"page-title"],"href":[1],"current":[4],"showBackIcon":[516,"show-back-icon"]}]]],["p-09592918",[[2,"ic-divider",{"foregroundColor":[32]},[[4,"themeChange","themeChangeHandler"]]]]],["p-6be5e06b",[[1,"ic-section-container",{"aligned":[1],"fullHeight":[4,"full-height"]}]]]]'),e)));
|
1
|
+
import{p as e,b as a}from"./p-f9370be6.js";const i=()=>{const a=import.meta.url;const i={};if(a!==""){i.resourcesUrl=new URL(".",a).href}return e(i)};i().then((e=>a(JSON.parse('[["p-6d0eaaeb",[[1,"ic-typography",{"variant":[1],"applyVerticalMargins":[4,"apply-vertical-margins"]}]]],["p-16698d3e",[[1,"ic-search-bar",{"label":[1],"required":[4],"disabled":[4],"readonly":[4],"placeholder":[1],"fullWidth":[4,"full-width"],"disableFilter":[4,"disable-filter"],"hideLabel":[4,"hide-label"],"helperText":[1,"helper-text"],"small":[4],"value":[1537],"autocapitalize":[1],"autocomplete":[1],"autocorrect":[1],"autofocus":[4],"debounce":[2],"name":[1],"spellcheck":[4],"options":[16],"focusOnLoad":[4,"focus-on-load"],"hintText":[1,"hint-text"],"emptyOptionListText":[1,"empty-option-list-text"],"charactersUntilSuggestion":[2,"characters-until-suggestion"],"open":[32],"filteredOptions":[32],"ariaActiveDescendant":[32],"showClearButton":[32],"clearButtonFocused":[32],"searchSubmitFocused":[32],"prevNoOption":[32],"highlightedValue":[32],"setFocus":[64]},[[0,"icKeydown","handleKeyDown"],[0,"keyup","handleKeyUp"],[0,"icMenuStateChange","onMenuClose"],[0,"menuOptionId","onMenuOptionHighlighted"]]]]],["p-3efa7f8b",[[1,"ic-select",{"label":[1],"options":[16],"required":[4],"hideLabel":[4,"hide-label"],"disabled":[516],"readonly":[4],"placeholder":[1],"helperText":[1,"helper-text"],"small":[4],"fullWidth":[4,"full-width"],"validationStatus":[1,"validation-status"],"validationText":[1,"validation-text"],"value":[1025],"name":[1],"showClearButton":[4,"show-clear-button"],"searchable":[4],"includeDescriptionsInSearch":[4,"include-descriptions-in-search"],"includeGroupTitlesInSearch":[4,"include-group-titles-in-search"],"searchMatchPosition":[1,"search-match-position"],"charactersUntilSuggestions":[2,"characters-until-suggestions"],"emptyOptionListText":[1,"empty-option-list-text"],"open":[32],"clearButtonFocused":[32],"searchableSelectInputValue":[32],"filteredOptions":[32],"ariaActiveDescendant":[32],"noOptions":[32],"initialValue":[32],"setFocus":[64]}]]],["p-5616cfb8",[[1,"ic-top-navigation",{"appTitle":[1,"app-title"],"href":[1],"version":[1],"status":[1],"contentAligned":[1,"content-aligned"],"inline":[4],"menuOpen":[32],"deviceSize":[32],"mobileSearchBarVisible":[32],"navMenuVisible":[32],"searchValue":[32],"mobileSearchHiddenOnBlur":[32],"searchButtonClick":[32],"foregroundColor":[32],"hasFullWidthSearchBar":[32]},[[0,"icNavigationMenuClose","navBarMenuCloseHandler"],[0,"icSearchBarBlur","searchInputBlurHandler"],[0,"icChange","searchValueChangeHandler"],[4,"themeChange","themeChangeHandler"]]]]],["p-8470c255",[[1,"ic-side-navigation",{"appTitle":[1,"app-title"],"status":[1],"version":[1],"expanded":[4],"href":[1],"static":[4],"collapsedIconLabels":[4,"collapsed-icon-labels"],"inline":[4],"disableAutoParentStyling":[4,"disable-auto-parent-styling"],"foregroundColor":[32],"menuOpen":[32],"menuExpanded":[32],"deviceSize":[32],"deviceSizeAppTitle":[32],"hasSecondaryNavigation":[32]},[[4,"themeChange","themeChangeHandler"]]]]],["p-27554319",[[1,"ic-alert",{"variant":[1],"heading":[1],"message":[1],"titleAbove":[4,"title-above"],"dismissible":[4],"announced":[4],"visible":[32],"alertTitleWrap":[32]},[[2,"icDismiss","handleClick"]]]]],["p-d599cf4f",[[1,"ic-card",{"clickable":[1028],"href":[1],"hreflang":[1],"referrerpolicy":[1],"rel":[1],"target":[1],"heading":[1],"subheading":[1],"message":[1],"disabled":[4],"fullWidth":[4,"full-width"],"expandable":[4],"parentIsAnchorTag":[32],"isFocussed":[32],"parentEl":[32],"appearance":[32],"areaExpanded":[32]},[[2,"click","handleHostClick"],[4,"themeChange","themeChangeHandler"]]]]],["p-3f9cdcdd",[[1,"ic-navigation-button",{"label":[1],"href":[1],"target":[1],"rel":[1],"download":[8],"hreflang":[1],"referrerpolicy":[1],"mode":[32],"initialAppearance":[32],"setFocus":[64]},[[4,"icNavigationMenuOpened","navBarMenuOpenHandler"],[4,"icNavigationMenuClosed","navBarMenuCloseHandler"],[4,"themeChange","themeChangeHandler"]]]]],["p-e192e25d",[[1,"ic-checkbox-group",{"label":[1],"name":[1],"required":[4],"hideLabel":[4,"hide-label"],"disabled":[4],"helperText":[1,"helper-text"],"small":[4],"validationStatus":[1,"validation-status"],"validationText":[1,"validation-text"],"checkedOptions":[32]},[[0,"icCheck","selectHandler"]]]]],["p-01e8bd4a",[[1,"ic-radio-group",{"label":[1],"name":[1],"required":[4],"hideLabel":[4,"hide-label"],"disabled":[4],"helperText":[1,"helper-text"],"small":[4],"validationStatus":[1,"validation-status"],"validationText":[1,"validation-text"],"checkedValue":[32],"selectedChild":[32]},[[0,"icCheck","selectHandler"]]]]],["p-f760198e",[[1,"ic-breadcrumb-group",{"backBreadcrumbOnly":[4,"back-breadcrumb-only"],"collapsed":[4],"deviceSize":[32],"expandedBreadcrumbs":[32]}]]],["p-6cb276c6",[[1,"ic-chip",{"label":[1],"appearance":[1],"size":[1],"dismissible":[4],"disabled":[4],"visible":[32],"isHovered":[32]},[[2,"icDismiss","handleClick"]]]]],["p-fd0c6039",[[1,"ic-footer",{"description":[1],"aligned":[1],"breakpoint":[1],"groupLinks":[4,"group-links"],"caption":[1],"copyright":[4],"deviceSize":[32],"foregroundColor":[32]},[[4,"themeChange","themeChangeHandler"]]]]],["p-ae02b008",[[1,"ic-footer-link-group",{"groupTitle":[1,"group-title"],"small":[32],"expanded":[32],"dropdownIconStyle":[32],"deviceSize":[32]},[[4,"footerResized","footerResizeHandler"],[4,"themeChange","footerThemeChangeHandler"]]]]],["p-4902b46a",[[1,"ic-hero",{"heading":[1],"subheading":[1],"secondaryHeading":[1,"secondary-heading"],"secondarySubheading":[1,"secondary-subheading"],"backgroundImage":[1,"background-image"],"disableBackgroundParallax":[4,"disable-background-parallax"],"aligned":[1],"contentAligned":[1,"content-aligned"],"small":[4],"rightContent":[32],"scrollFactor":[32],"leftContentFullWidth":[32],"foregroundColor":[32]},[[4,"themeChange","themeChangeHandler"],[5,"scroll","doScroll"]]]]],["p-0b00f848",[[1,"ic-navigation-item",{"label":[1],"href":[1],"selected":[4],"expandable":[4],"displayNavigationTooltip":[4,"display-navigation-tooltip"],"collapsedIconLabel":[4,"collapsed-icon-label"],"isTopNavChild":[32],"inTopNavSideMenu":[32],"deviceSize":[32],"focusStyle":[32],"navigationType":[32],"parentEl":[32],"sideNavExpanded":[32],"isSideNavMobile":[32],"setFocus":[64]},[[4,"themeChange","themeChangeHandler"]]]]],["p-9020d1ff",[[1,"ic-page-header",{"heading":[1],"subheading":[1],"aligned":[1],"small":[4],"border":[4],"sticky":[4],"stickyDesktopOnly":[4,"sticky-desktop-only"],"reverseOrder":[4,"reverse-order"],"deviceSize":[32],"areButtonsReversed":[32],"actionContent":[32]}]]],["p-80cd0a2d",[[1,"ic-step",{"variant":[1],"stepTitle":[1,"step-title"],"stepSubtitle":[1,"step-subtitle"],"stepStatus":[1,"step-status"],"stepType":[1,"step-type"],"current":[1028],"compactStepStyling":[1,"compact-step-styling"],"stepNum":[2,"step-num"],"lastStep":[4,"last-step"],"lastStepNum":[2,"last-step-num"],"nextStepTitle":[1,"next-step-title"],"progress":[2]}]]],["p-e810f48c",[[1,"ic-switch",{"label":[1],"hideLabel":[4,"hide-label"],"helperText":[1,"helper-text"],"checked":[4],"small":[4],"disabled":[4],"name":[1],"showState":[4,"show-state"],"value":[1],"checkedState":[32],"initiallyChecked":[32]}]]],["p-541918c2",[[1,"ic-tab-group",{"contextId":[513,"context-id"],"inline":[516],"label":[1],"appearance":[1],"firstTabVisible":[32],"lastTabVisible":[32],"tabOverflow":[32],"scrollTabIntoView":[64]},[[0,"tabFocus","tabFocusHandler"]]]]],["p-bbe00cb1",[[1,"ic-back-to-top",{"target":[1],"bannerOffset":[32],"targetElVisible":[32],"footerVisible":[32]}]]],["p-1da1f2f3",[[1,"ic-checkbox",{"checked":[1540],"disabled":[4],"label":[1],"value":[1],"name":[1],"groupLabel":[1,"group-label"],"dynamicText":[1,"dynamic-text"],"additionalFieldDisplay":[513,"additional-field-display"],"indeterminate":[4],"initiallyChecked":[32]}]]],["p-9b4022d7",[[1,"ic-classification-banner",{"additionalSelectors":[1,"additional-selectors"],"classification":[1],"country":[1],"inline":[4],"upTo":[4,"up-to"]}]]],["p-e93e9aa3",[[1,"ic-data-entity",{"heading":[1],"small":[4]}]]],["p-a38cbb3f",[[1,"ic-data-row",{"label":[1],"value":[1],"small":[4],"deviceSize":[32],"entitySize":[32]}]]],["p-930cd4cc",[[1,"ic-navigation-group",{"label":[1],"expandable":[4],"dropdownOpen":[32],"inTopNavSideMenu":[32],"deviceSize":[32],"focusStyle":[32],"navigationType":[32],"parentEl":[32],"expanded":[32],"setFocus":[64]},[[0,"childBlur","childBlurHandler"],[0,"navItemClicked","navItemClickHandler"],[4,"themeChange","themeChangeHandler"]]]]],["p-66cad84e",[[1,"ic-radio-option",{"selected":[1540],"disabled":[4],"label":[1],"value":[1025],"name":[1],"groupLabel":[1,"group-label"],"dynamicText":[1,"dynamic-text"],"additionalFieldDisplay":[513,"additional-field-display"],"initiallySelected":[32]},[[0,"icChange","textfieldValueHandler"]]]]],["p-bb106092",[[1,"ic-status-tag",{"label":[1],"status":[1],"appearance":[1],"small":[4],"announced":[4]}]]],["p-cadb531f",[[1,"ic-tab",{"contextId":[513,"context-id"],"disabled":[4],"selected":[516],"tabId":[513,"tab-id"],"tabPosition":[2,"tab-position"],"appearance":[1]}]]],["p-050e1e7b",[[1,"ic-footer-link",{"href":[1],"footerConfig":[32],"deviceSize":[32],"foregroundColor":[32]},[[4,"footerResized","footerResizeHandler"],[4,"themeChange","footerThemeChangeHandler"]]]]],["p-a2d3e955",[[1,"ic-skeleton",{"variant":[1],"light":[4],"hasChild":[32],"default":[32],"heightOnly":[32],"widthOnly":[32]}]]],["p-6f442942",[[1,"ic-stepper",{"aligned":[1],"variant":[1025],"connectorWidth":[2,"connector-width"],"hideStepInfo":[4,"hide-step-info"],"stepperWidth":[32],"lastStepWidth":[32],"stepTypes":[32],"alignedFullWidth":[32],"autoSetStepTitles":[32],"variantOverride":[32],"noOfResizes":[32]}]]],["p-9e684c58",[[4,"ic-tab-context",{"contextId":[513,"context-id"],"activationType":[1,"activation-type"],"selectedTabIndex":[2,"selected-tab-index"],"appearance":[1],"selectedTab":[32]},[[0,"tabClick","tabClickHandler"]]]]],["p-272c7abd",[[1,"ic-tab-panel",{"contextId":[513,"context-id"],"tabPosition":[514,"tab-position"],"panelId":[513,"panel-id"],"selectedTab":[1,"selected-tab"],"appearance":[1]}]]],["p-4f1a7195",[[1,"ic-theme",{"color":[1]}]]],["p-18a9beea",[[1,"ic-menu",{"open":[516],"options":[16],"small":[516],"menuId":[1,"menu-id"],"value":[1],"activationType":[1,"activation-type"],"inputEl":[16],"parentEl":[16],"inputLabel":[1,"input-label"],"anchorEl":[16],"fullWidth":[4,"full-width"],"autoFocusOnSelected":[4,"auto-focus-on-selected"],"keyboardNav":[32],"optionHighlighted":[32],"focusFromSearchKeypress":[32],"initialOptionsListRender":[32],"preventIncorrectTabOrder":[32],"handleClickOpen":[64],"handleKeyboardOpen":[64],"handleSetFirstOption":[64]},[[4,"icClear","handleClearListener"],[4,"icSubmitSearch","handleSubmitSearch"]]],[4,"ic-input-component-container",{"disabled":[4],"readonly":[4],"validationStatus":[1,"validation-status"],"small":[4],"multiLine":[4,"multi-line"],"validationInline":[4,"validation-inline"],"dark":[4],"fullWidth":[4,"full-width"]}],[4,"ic-input-container",{"disabled":[4],"readonly":[4]}]]],["p-c320fa70",[[4,"ic-input-validation",{"message":[1],"for":[1],"status":[1],"fullWidth":[4,"full-width"],"ariaLiveMode":[1,"aria-live-mode"]}],[0,"ic-input-label",{"for":[1],"required":[4],"helperText":[1,"helper-text"],"label":[1],"disabled":[4],"readonly":[4],"error":[4],"dark":[4]}]]],["p-204f6315",[[1,"ic-text-field",{"inputId":[1,"input-id"],"label":[1],"required":[4],"disabled":[4],"readonly":[516],"placeholder":[1],"fullWidth":[4,"full-width"],"hideLabel":[4,"hide-label"],"helperText":[1,"helper-text"],"rows":[2],"resize":[4],"small":[516],"value":[1537],"maxLength":[2,"max-length"],"validationStatus":[1,"validation-status"],"validationText":[1,"validation-text"],"validationInline":[4,"validation-inline"],"autocapitalize":[1],"autocomplete":[1],"autocorrect":[1],"autoFocus":[4,"auto-focus"],"debounce":[2],"type":[1],"inputmode":[1],"name":[1],"spellcheck":[4],"ariaActiveDescendant":[1,"aria-active-descendant"],"truncateValue":[4,"truncate-value"],"ariaExpanded":[1,"aria-expanded"],"ariaOwns":[1,"aria-owns"],"ariaAutocomplete":[1,"aria-autocomplete"],"role":[1],"hiddenInput":[4,"hidden-input"],"numChars":[32],"maxLengthExceeded":[32],"initialValue":[32],"setFocus":[64]},[[0,"keydown","handleKeyDown"]]]]],["p-89a925f8",[[1,"ic-button",{"disabled":[4],"loading":[4],"type":[1],"href":[1],"target":[1],"rel":[1],"download":[8],"hreflang":[1],"referrerpolicy":[1],"variant":[1],"size":[1],"fullWidth":[4,"full-width"],"disableTooltip":[4,"disable-tooltip"],"tooltipPlacement":[1,"tooltip-placement"],"appearance":[1025],"setFocus":[64],"updateAriaLabel":[64]},[[2,"click","handleHostClick"],[4,"themeChange","themeChangeHandler"]]],[1,"ic-loading-indicator",{"progress":[2],"min":[2],"max":[2],"label":[1],"description":[1],"innerLabel":[2,"inner-label"],"labelDuration":[2,"label-duration"],"size":[513],"type":[513],"fullWidth":[516,"full-width"],"appearance":[1],"indicatorLabel":[32],"indeterminate":[32],"showSecond":[32],"circularLineWidth":[32],"compactStepCircularLineWidth":[32],"circularDiameter":[32]}],[1,"ic-tooltip",{"target":[513],"placement":[1],"label":[1],"disableHover":[4,"disable-hover"]}]]],["p-3f4d632c",[[1,"ic-navigation-menu",{"version":[1],"status":[1]},[[0,"navItemClicked","navItemClickHandler"],[4,"keydown","handleKeyDown"]]]]],["p-c5e453eb",[[1,"ic-link",{"download":[8],"href":[1],"hreflang":[1],"referrerpolicy":[1],"rel":[1],"target":[1],"showIcon":[4,"show-icon"],"appearance":[1025]},[[4,"themeChange","themeChangeHandler"]]]]],["p-7ba184da",[[1,"ic-breadcrumb",{"pageTitle":[1,"page-title"],"href":[1],"current":[4],"showBackIcon":[516,"show-back-icon"]}]]],["p-09592918",[[2,"ic-divider",{"foregroundColor":[32]},[[4,"themeChange","themeChangeHandler"]]]]],["p-6be5e06b",[[1,"ic-section-container",{"aligned":[1],"fullHeight":[4,"full-height"]}]]]]'),e)));
|
2
2
|
//# sourceMappingURL=core.esm.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as e,h as t,H as n,g as i}from"./p-f9370be6.js";import{I as o}from"./p-6f57b13c.js";import{k as a,s,a as r}from"./p-a8ac8f72.js";const c='/*! 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;background-color:var(--ic-theme-tertiary);color:var(--ic-theme-text);--hero-heading-bottom-margin:var(--ic-space-md)}:host(.dark){background-color:var(--ic-theme-secondary)}:host(.has-background-image){background-repeat:no-repeat;background-position:right -100px;background-size:auto calc(100% + 100px);box-shadow:var(--ic-elevation-inset)}@media (prefers-reduced-motion){:host(.has-background-image){background-position:right -100px !important}}ic-typography.heading-bottom-spacing{margin-bottom:var(--hero-heading-bottom-margin)}.section-container{display:flex;align-items:center;height:100%}.left-container{padding:var(--ic-space-xl) 0}.left-container:not(.left-container-full-width){flex-basis:50%}.left-container-full-width{width:100%}.right-container{flex-basis:50%}.interaction-container{display:flex;gap:var(--ic-space-md);margin-top:var(--ic-space-lg)}.secondary-container{display:flex;flex-direction:column;justify-content:center;border-left:var(--ic-space-xxxs) solid var(--ic-theme-text)}.secondary-subheading{margin-top:var(--ic-space-xxs)}:host([content-aligned="left"]) .left-container,:host([content-aligned="left"]) .interaction-container{justify-content:flex-start;text-align:left}:host([content-aligned="center"]) .left-container,:host([content-aligned="center"]) .interaction-container{justify-content:center;text-align:center}@media (min-width: 992px){.left-container-full-width{width:66.6%}}@media (min-width: 1044px){:host,.section-container{min-height:208px}:host([small]),:host([small]) .section-container{min-height:173px}.left-container:not(.left-container-full-width){flex-basis:66.6%}.left-container{min-height:144px}.right-container{flex-basis:33.3%;margin-left:50px}.secondary-container{min-height:144px}.secondary-heading,.secondary-subheading{margin-left:63px}}@media (min-width: 801px) and (max-width: 1043px){:host(.has-background-image){background-image:none !important}:host,.section-container{min-height:256px}:host([small]),:host([small]) .section-container{min-height:240px}:host([secondary-heading]),:host([secondary-heading]) .section-container{min-height:224px}.left-container{min-height:160px}.secondary-container{min-height:160px}.secondary-heading,.secondary-subheading{margin-left:94.75px}.right-container{margin-left:50px}}@media (min-width: 641px) and (max-width: 800px){:host(.has-background-image){background-image:none !important}:host,.section-container{min-height:256px}:host([small]),:host([small]) .section-container{min-height:240px}:host([secondary-heading]),:host([secondary-heading]) .section-container{min-height:224px}.left-container{min-height:160px}.secondary-container{min-height:160px}.secondary-heading,.secondary-subheading{margin-left:34px}.right-container{margin-left:50px}}@media (min-width: 481px) and (max-width: 640px){:host(.has-background-image){background-image:none !important}:host,.section-container{min-height:208px}:host([small]),:host([small]) .section-container{min-height:173px}:host([secondary-heading]),:host([secondary-heading]) .section-container{min-height:280px}:host([secondary-heading]) .section-container,:host([small]) .section-container,.section-container{flex-direction:column;align-items:flex-start}.left-container{height:-moz-fit-content;height:fit-content}.secondary-container{height:-moz-fit-content;height:fit-content;border:none}.right-container{margin-bottom:40px}}@media (max-width: 480px){:host(.has-background-image){background-image:none !important}:host,.section-container{min-height:192px}:host([small]),:host([small]) .section-container{min-height:173px}:host([secondary-heading]),:host([secondary-heading]) .section-container{min-height:264px}:host([secondary-heading]) .section-container,:host([small]) .section-container,.section-container{flex-direction:column;align-items:flex-start}.left-container{height:-moz-fit-content;height:fit-content}.secondary-container{height:-moz-fit-content;height:fit-content;border:none}}';const h=class{constructor(t){e(this,t);this.heading=undefined;this.subheading=undefined;this.secondaryHeading=undefined;this.secondarySubheading=undefined;this.backgroundImage=undefined;this.disableBackgroundParallax=false;this.aligned="left";this.contentAligned="left";this.small=false;this.rightContent=false;this.scrollFactor="right -100px";this.leftContentFullWidth=!this.rightContent&&this.secondaryHeading===undefined;this.foregroundColor=a()}themeChangeHandler(e){const t=e.detail;this.foregroundColor=t.mode}doScroll(){if(this.disableBackgroundParallax){return}const e=document.scrollingElement.scrollTop;const t=.4;const n=-100+e*t;this.scrollFactor="right "+n+"px"}componentWillLoad(){this.rightContent=s(this.el,"secondary")}componentDidLoad(){r([{prop:this.heading,propName:"heading"}],"Hero")}componentWillRender(){this.rightContent=s(this.el,"secondary")}render(){const{aligned:e,small:i,heading:a,subheading:s,secondaryHeading:r,secondarySubheading:c,foregroundColor:h,backgroundImage:d,scrollFactor:l}=this;let m={};if(d!==undefined){m={"background-image":"url("+d+")","background-position":l}}return t(n,{class:{[o.Dark]:h===o.Dark,["has-background-image"]:d!==undefined},style:m},t("ic-section-container",{aligned:e,fullHeight:true,class:"section-container"},t("div",{class:{["left-container"]:true,["left-container-full-width"]:this.leftContentFullWidth}},t("div",{class:"heading"},t("slot",{name:"heading"},t("ic-typography",{variant:i?"h2":"h1",class:{["heading-bottom-spacing"]:!i}},a))),t("div",{class:"subheading"},t("slot",{name:"subheading"},t("ic-typography",{variant:"body"},s))),t("div",{class:"interaction-container"},t("slot",{name:"interaction"}))),(r!==undefined||this.rightContent)&&t("div",{class:"right-container"},t("slot",{name:"secondary"},r&&t("div",{class:"secondary-container"},t("div",{class:"secondary-heading"},t("ic-typography",{variant:"h4"},r)),t("div",{class:"secondary-subheading"},t("ic-typography",{variant:"subtitle-small"},c)))))))}get el(){return i(this)}};h.style=c;export{h as ic_hero};
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as e,h as t,H as n,g as i}from"./p-f9370be6.js";import{I as o}from"./p-6f57b13c.js";import{k as a,s,a as r}from"./p-a8ac8f72.js";const c='/*! 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;background-color:var(--ic-theme-tertiary);color:var(--ic-theme-text);--hero-heading-bottom-margin:var(--ic-space-md)}:host(.dark){background-color:var(--ic-theme-secondary)}:host(.has-background-image){background-repeat:no-repeat;background-position:right -100px;background-size:auto calc(100% + 100px);box-shadow:var(--ic-elevation-inset)}@media (prefers-reduced-motion){:host(.has-background-image){background-position:right -100px !important}}ic-typography.heading-bottom-spacing{margin-bottom:var(--hero-heading-bottom-margin)}.section-container{display:flex;align-items:center;height:100%}.left-container{padding:var(--ic-space-xl) 0}.left-container:not(.left-container-full-width){flex-basis:50%}.left-container-full-width{width:100%}.right-container{flex-basis:50%}.interaction-container{display:flex;gap:var(--ic-space-md);margin-top:var(--ic-space-lg)}.secondary-container{display:flex;flex-direction:column;justify-content:center;border-left:var(--ic-space-xxxs) solid var(--ic-theme-text)}.secondary-subheading{margin-top:var(--ic-space-xxs)}:host([content-aligned="left"]) .left-container,:host([content-aligned="left"]) .interaction-container{justify-content:flex-start;text-align:left}:host([content-aligned="center"]) .left-container,:host([content-aligned="center"]) .interaction-container{justify-content:center;text-align:center}@media (min-width: 992px){.left-container-full-width{width:66.6%}}@media (min-width: 1044px){:host,.section-container{min-height:208px}:host([small]),:host([small]) .section-container{min-height:173px}.left-container:not(.left-container-full-width){flex-basis:66.6%}.left-container{min-height:144px}.right-container{flex-basis:33.3%;margin-left:50px}.secondary-container{min-height:144px}.secondary-heading,.secondary-subheading{margin-left:63px}}@media (min-width: 801px) and (max-width: 1043px){:host(.has-background-image){background-image:none !important}:host,.section-container{min-height:256px}:host([small]),:host([small]) .section-container{min-height:240px}:host([secondary-heading]),:host([secondary-heading]) .section-container{min-height:224px}.left-container{min-height:160px}.secondary-container{min-height:160px}.secondary-heading,.secondary-subheading{margin-left:94.75px}.right-container{margin-left:50px}}@media (min-width: 641px) and (max-width: 800px){:host(.has-background-image){background-image:none !important}:host,.section-container{min-height:256px}:host([small]),:host([small]) .section-container{min-height:240px}:host([secondary-heading]),:host([secondary-heading]) .section-container{min-height:224px}.left-container{min-height:160px}.secondary-container{min-height:160px}.secondary-heading,.secondary-subheading{margin-left:34px}.right-container{margin-left:50px}}@media (min-width: 481px) and (max-width: 640px){:host(.has-background-image){background-image:none !important}:host,.section-container{min-height:208px}:host([small]),:host([small]) .section-container{min-height:173px}:host([secondary-heading]),:host([secondary-heading]) .section-container{min-height:280px}:host([secondary-heading]) .section-container,:host([small]) .section-container,.section-container{flex-direction:column;align-items:flex-start}.left-container{height:-moz-fit-content;height:fit-content}.secondary-container{height:-moz-fit-content;height:fit-content;border:none}.right-container{margin-bottom:40px}}@media (max-width: 480px){:host(.has-background-image){background-image:none !important}:host,.section-container{min-height:192px}:host,.right-container{margin-bottom:var(--ic-space-md)}:host([small]),:host([small]) .section-container{min-height:173px}:host([secondary-heading]),:host([secondary-heading]) .section-container{min-height:264px}:host([secondary-heading]) .section-container,:host([small]) .section-container,.section-container{flex-direction:column;align-items:flex-start}.left-container{height:-moz-fit-content;height:fit-content}.secondary-container{height:-moz-fit-content;height:fit-content;border:none}}';const h=class{constructor(t){e(this,t);this.heading=undefined;this.subheading=undefined;this.secondaryHeading=undefined;this.secondarySubheading=undefined;this.backgroundImage=undefined;this.disableBackgroundParallax=false;this.aligned="left";this.contentAligned="left";this.small=false;this.rightContent=false;this.scrollFactor="right -100px";this.leftContentFullWidth=!this.rightContent&&this.secondaryHeading===undefined;this.foregroundColor=a()}themeChangeHandler(e){const t=e.detail;this.foregroundColor=t.mode}doScroll(){if(this.disableBackgroundParallax){return}const e=document.scrollingElement.scrollTop;const t=.4;const n=-100+e*t;this.scrollFactor="right "+n+"px"}componentWillLoad(){this.rightContent=s(this.el,"secondary")}componentDidLoad(){r([{prop:this.heading,propName:"heading"}],"Hero")}componentWillRender(){this.rightContent=s(this.el,"secondary")}render(){const{aligned:e,small:i,heading:a,subheading:s,secondaryHeading:r,secondarySubheading:c,foregroundColor:h,backgroundImage:d,scrollFactor:l}=this;let m={};if(d!==undefined){m={"background-image":"url("+d+")","background-position":l}}return t(n,{class:{[o.Dark]:h===o.Dark,["has-background-image"]:d!==undefined},style:m},t("ic-section-container",{aligned:e,fullHeight:true,class:"section-container"},t("div",{class:{["left-container"]:true,["left-container-full-width"]:this.leftContentFullWidth}},t("div",{class:"heading"},t("slot",{name:"heading"},t("ic-typography",{variant:i?"h2":"h1",class:{["heading-bottom-spacing"]:!i}},a))),t("div",{class:"subheading"},t("slot",{name:"subheading"},t("ic-typography",{variant:"body"},s))),t("div",{class:"interaction-container"},t("slot",{name:"interaction"}))),(r!==undefined||this.rightContent)&&t("div",{class:"right-container"},t("slot",{name:"secondary"},r&&t("div",{class:"secondary-container"},t("div",{class:"secondary-heading"},t("ic-typography",{variant:"h4"},r)),t("div",{class:"secondary-subheading"},t("ic-typography",{variant:"subtitle-small"},c)))))))}get el(){return i(this)}};h.style=c;export{h as ic_hero};
|
2
|
+
//# sourceMappingURL=p-4902b46a.entry.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["src/components/ic-hero/ic-hero.css?tag=ic-hero&encapsulation=shadow","src/components/ic-hero/ic-hero.tsx"],"names":["icHeroCss","Hero","this","rightContent","secondaryHeading","undefined","getThemeForegroundColor","[object Object]","ev","theme","detail","foregroundColor","mode","disableBackgroundParallax","scrolltotop","document","scrollingElement","scrollTop","factor","y","scrollFactor","slotHasContent","el","onComponentRequiredPropUndefined","prop","heading","propName","aligned","small","subheading","secondarySubheading","backgroundImage","style","background-image","background-position","h","Host","class","IcThemeForegroundEnum","Dark","fullHeight","leftContentFullWidth","name","variant"],"mappings":"0IAAA,MAAMA,EAAY,6tMCkCLC,EAAI,iNA+B+B,mBAKf,2BAKmB,kBAKzB,wBAEQ,wBAED,0CAG7BC,KAAKC,cAAgBD,KAAKE,mBAAqBC,+BAEJC,IAG9CC,mBAAmBC,GACjB,MAAMC,EAAiBD,EAAGE,OAC1BR,KAAKS,gBAAkBF,EAAMG,KAI/BL,WACE,GAAIL,KAAKW,0BAA2B,CAClC,OAGF,MAAMC,EAAcC,SAASC,iBAAiBC,UAC9C,MAAMC,EAAS,GACf,MAAMC,GAAK,IAAML,EAAcI,EAC/BhB,KAAKkB,aAAe,SAAWD,EAAI,KAGrCZ,oBACEL,KAAKC,aAAekB,EAAenB,KAAKoB,GAAI,aAG9Cf,mBACEgB,EACE,CAAC,CAAEC,KAAMtB,KAAKuB,QAASC,SAAU,YACjC,QAIJnB,sBACEL,KAAKC,aAAekB,EAAenB,KAAKoB,GAAI,aAG9Cf,SACE,MAAMoB,QACJA,EAAOC,MACPA,EAAKH,QACLA,EAAOI,WACPA,EAAUzB,iBACVA,EAAgB0B,oBAChBA,EAAmBnB,gBACnBA,EAAeoB,gBACfA,EAAeX,aACfA,GACElB,KAEJ,IAAI8B,EAAQ,GAEZ,GAAID,IAAoB1B,UAAW,CACjC2B,EAAQ,CACNC,mBAAoB,OAASF,EAAkB,IAC/CG,sBAAuBd,GAI3B,OACEe,EAACC,EAAI,CACHC,MAAO,CACL9B,CAAC+B,EAAsBC,MACrB5B,IAAoB2B,EAAsBC,KAC5ChC,CAAC,wBAAyBwB,IAAoB1B,WAEhD2B,MAAOA,GAEPG,EAAA,uBAAA,CACER,QAASA,EACTa,WAAU,KACVH,MAAM,qBAENF,EAAA,MAAA,CACEE,MAAO,CACL9B,CAAC,kBAAmB,KACpBA,CAAC,6BAA8BL,KAAKuC,uBAGtCN,EAAA,MAAA,CAAKE,MAAM,WACTF,EAAA,OAAA,CAAMO,KAAK,WACTP,EAAA,gBAAA,CACEQ,QAASf,EAAQ,KAAO,KACxBS,MAAO,CAAE9B,CAAC,2BAA4BqB,IAErCH,KAIPU,EAAA,MAAA,CAAKE,MAAM,cACTF,EAAA,OAAA,CAAMO,KAAK,cACTP,EAAA,gBAAA,CAAeQ,QAAQ,QAAQd,KAGnCM,EAAA,MAAA,CAAKE,MAAM,yBACTF,EAAA,OAAA,CAAMO,KAAK,mBAGbtC,IAAqBC,WAAaH,KAAKC,eACvCgC,EAAA,MAAA,CAAKE,MAAM,mBACTF,EAAA,OAAA,CAAMO,KAAK,aACRtC,GACC+B,EAAA,MAAA,CAAKE,MAAM,uBACTF,EAAA,MAAA,CAAKE,MAAM,qBACTF,EAAA,gBAAA,CAAeQ,QAAQ,MACpBvC,IAGL+B,EAAA,MAAA,CAAKE,MAAM,wBACTF,EAAA,gBAAA,CAAeQ,QAAQ,kBACpBb","sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: block;\n background-color: var(--ic-theme-tertiary);\n color: var(--ic-theme-text);\n\n --hero-heading-bottom-margin: var(--ic-space-md);\n}\n\n:host(.dark) {\n background-color: var(--ic-theme-secondary);\n}\n\n:host(.has-background-image) {\n background-repeat: no-repeat;\n background-position: right -100px;\n background-size: auto calc(100% + 100px);\n box-shadow: var(--ic-elevation-inset);\n}\n\n@media (prefers-reduced-motion) {\n :host(.has-background-image) {\n background-position: right -100px !important;\n }\n}\n\nic-typography.heading-bottom-spacing {\n margin-bottom: var(--hero-heading-bottom-margin);\n}\n\n.section-container {\n display: flex;\n align-items: center;\n height: 100%;\n}\n\n.left-container {\n padding: var(--ic-space-xl) 0;\n}\n\n.left-container:not(.left-container-full-width) {\n flex-basis: 50%;\n}\n\n.left-container-full-width {\n width: 100%;\n}\n\n.right-container {\n flex-basis: 50%;\n}\n\n.interaction-container {\n display: flex;\n gap: var(--ic-space-md);\n margin-top: var(--ic-space-lg);\n}\n\n.secondary-container {\n display: flex;\n flex-direction: column;\n justify-content: center;\n border-left: var(--ic-space-xxxs) solid var(--ic-theme-text);\n}\n\n.secondary-subheading {\n margin-top: var(--ic-space-xxs);\n}\n\n:host([content-aligned=\"left\"]) .left-container,\n:host([content-aligned=\"left\"]) .interaction-container {\n justify-content: flex-start;\n text-align: left;\n}\n\n:host([content-aligned=\"center\"]) .left-container,\n:host([content-aligned=\"center\"]) .interaction-container {\n justify-content: center;\n text-align: center;\n}\n\n@media (min-width: 992px) {\n .left-container-full-width {\n width: 66.6%;\n }\n}\n\n@media (min-width: 1044px) {\n :host,\n .section-container {\n min-height: 208px;\n }\n\n :host([small]),\n :host([small]) .section-container {\n min-height: 173px;\n }\n\n .left-container:not(.left-container-full-width) {\n flex-basis: 66.6%;\n }\n\n .left-container {\n min-height: 144px;\n }\n\n .right-container {\n flex-basis: 33.3%;\n margin-left: 50px;\n }\n\n .secondary-container {\n min-height: 144px;\n }\n\n .secondary-heading,\n .secondary-subheading {\n margin-left: 63px;\n }\n}\n\n@media (min-width: 801px) and (max-width: 1043px) {\n :host(.has-background-image) {\n background-image: none !important;\n }\n\n :host,\n .section-container {\n min-height: 256px;\n }\n\n :host([small]),\n :host([small]) .section-container {\n min-height: 240px;\n }\n\n :host([secondary-heading]),\n :host([secondary-heading]) .section-container {\n min-height: 224px;\n }\n\n .left-container {\n min-height: 160px;\n }\n\n .secondary-container {\n min-height: 160px;\n }\n\n .secondary-heading,\n .secondary-subheading {\n margin-left: 94.75px;\n }\n\n .right-container {\n margin-left: 50px;\n }\n}\n\n@media (min-width: 641px) and (max-width: 800px) {\n :host(.has-background-image) {\n background-image: none !important;\n }\n\n :host,\n .section-container {\n min-height: 256px;\n }\n\n :host([small]),\n :host([small]) .section-container {\n min-height: 240px;\n }\n\n :host([secondary-heading]),\n :host([secondary-heading]) .section-container {\n min-height: 224px;\n }\n\n .left-container {\n min-height: 160px;\n }\n\n .secondary-container {\n min-height: 160px;\n }\n\n .secondary-heading,\n .secondary-subheading {\n margin-left: 34px;\n }\n\n .right-container {\n margin-left: 50px;\n }\n}\n\n@media (min-width: 481px) and (max-width: 640px) {\n :host(.has-background-image) {\n background-image: none !important;\n }\n\n :host,\n .section-container {\n min-height: 208px;\n }\n\n :host([small]),\n :host([small]) .section-container {\n min-height: 173px;\n }\n\n :host([secondary-heading]),\n :host([secondary-heading]) .section-container {\n min-height: 280px;\n }\n\n :host([secondary-heading]) .section-container,\n :host([small]) .section-container,\n .section-container {\n flex-direction: column;\n align-items: flex-start;\n }\n\n .left-container {\n height: fit-content;\n }\n\n .secondary-container {\n height: fit-content;\n border: none;\n }\n\n .right-container {\n margin-bottom: 40px;\n }\n}\n\n@media (max-width: 480px) {\n :host(.has-background-image) {\n background-image: none !important;\n }\n\n :host,\n .section-container {\n min-height: 192px;\n }\n\n :host([small]),\n :host([small]) .section-container {\n min-height: 173px;\n }\n\n :host([secondary-heading]),\n :host([secondary-heading]) .section-container {\n min-height: 264px;\n }\n\n :host([secondary-heading]) .section-container,\n :host([small]) .section-container,\n .section-container {\n flex-direction: column;\n align-items: flex-start;\n }\n\n .left-container {\n height: fit-content;\n }\n\n .secondary-container {\n height: fit-content;\n border: none;\n }\n}\n","import {\n Component,\n Element,\n Host,\n Prop,\n h,\n State,\n Listen,\n} from \"@stencil/core\";\nimport {\n IcAlignment,\n IcTheme,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\nimport {\n slotHasContent,\n getThemeForegroundColor,\n onComponentRequiredPropUndefined,\n} from \"../../utils/helpers\";\nimport { IcHeroContentAlignments } from \"./ic-hero.types\";\n\n/**\n * @slot heading - Content will be rendered in the title area, in place of the heading.\n * @slot subheading - Content will be rendered in the title area, in place of the subheading.\n * @slot interaction - Content will be rendered in the interaction area, adjacent to the title area.\n * @slot secondary - Content will be rendered in the secondary content area.\n */\n\n@Component({\n tag: \"ic-hero\",\n styleUrl: \"ic-hero.css\",\n shadow: true,\n})\nexport class Hero {\n @Element() el: HTMLIcHeroElement;\n\n /**\n * The heading of the hero.\n */\n @Prop() heading!: string;\n\n /**\n * The description for the hero.\n */\n @Prop() subheading?: string;\n\n /**\n * The optional secondary heading, replaced by slotted right content.\n */\n @Prop() secondaryHeading?: string;\n\n /**\n * The optional secondary subheading, replaced by slotted right content.\n */\n @Prop() secondarySubheading?: string;\n\n /**\n * The optional background image.\n */\n @Prop() backgroundImage?: string;\n\n /**\n * If `true`, the background image (if set) will not scroll using a parallax effect.\n */\n @Prop() disableBackgroundParallax?: boolean = false;\n\n /**\n * The alignment of the hero.\n */\n @Prop() aligned: IcAlignment = \"left\";\n\n /**\n * The alignment of the hero content.\n */\n @Prop() contentAligned: IcHeroContentAlignments = \"left\";\n\n /**\n * If `true`, the small styling will be applied to the hero.\n */\n @Prop() small: boolean = false;\n\n @State() rightContent: boolean = false;\n\n @State() scrollFactor: string = \"right -100px\";\n\n @State() leftContentFullWidth: boolean =\n !this.rightContent && this.secondaryHeading === undefined;\n\n @State() foregroundColor: IcThemeForeground = getThemeForegroundColor();\n\n @Listen(\"themeChange\", { target: \"document\" })\n themeChangeHandler(ev: CustomEvent): void {\n const theme: IcTheme = ev.detail;\n this.foregroundColor = theme.mode;\n }\n\n @Listen(\"scroll\", { target: \"document\" })\n doScroll(): void {\n if (this.disableBackgroundParallax) {\n return;\n }\n\n const scrolltotop = document.scrollingElement.scrollTop;\n const factor = 0.4;\n const y = -100 + scrolltotop * factor;\n this.scrollFactor = \"right \" + y + \"px\";\n }\n\n componentWillLoad(): void {\n this.rightContent = slotHasContent(this.el, \"secondary\");\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.heading, propName: \"heading\" }],\n \"Hero\"\n );\n }\n\n componentWillRender(): void {\n this.rightContent = slotHasContent(this.el, \"secondary\");\n }\n\n render() {\n const {\n aligned,\n small,\n heading,\n subheading,\n secondaryHeading,\n secondarySubheading,\n foregroundColor,\n backgroundImage,\n scrollFactor,\n } = this;\n\n let style = {};\n\n if (backgroundImage !== undefined) {\n style = {\n \"background-image\": \"url(\" + backgroundImage + \")\",\n \"background-position\": scrollFactor,\n };\n }\n\n return (\n <Host\n class={{\n [IcThemeForegroundEnum.Dark]:\n foregroundColor === IcThemeForegroundEnum.Dark,\n [\"has-background-image\"]: backgroundImage !== undefined,\n }}\n style={style}\n >\n <ic-section-container\n aligned={aligned}\n fullHeight\n class=\"section-container\"\n >\n <div\n class={{\n [\"left-container\"]: true,\n [\"left-container-full-width\"]: this.leftContentFullWidth,\n }}\n >\n <div class=\"heading\">\n <slot name=\"heading\">\n <ic-typography\n variant={small ? \"h2\" : \"h1\"}\n class={{ [\"heading-bottom-spacing\"]: !small }}\n >\n {heading}\n </ic-typography>\n </slot>\n </div>\n <div class=\"subheading\">\n <slot name=\"subheading\">\n <ic-typography variant=\"body\">{subheading}</ic-typography>\n </slot>\n </div>\n <div class=\"interaction-container\">\n <slot name=\"interaction\"></slot>\n </div>\n </div>\n {(secondaryHeading !== undefined || this.rightContent) && (\n <div class=\"right-container\">\n <slot name=\"secondary\">\n {secondaryHeading && (\n <div class=\"secondary-container\">\n <div class=\"secondary-heading\">\n <ic-typography variant=\"h4\">\n {secondaryHeading}\n </ic-typography>\n </div>\n <div class=\"secondary-subheading\">\n <ic-typography variant=\"subtitle-small\">\n {secondarySubheading}\n </ic-typography>\n </div>\n </div>\n )}\n </slot>\n </div>\n )}\n </ic-section-container>\n </Host>\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"sources":["src/components/ic-hero/ic-hero.css?tag=ic-hero&encapsulation=shadow","src/components/ic-hero/ic-hero.tsx"],"names":["icHeroCss","Hero","this","rightContent","secondaryHeading","undefined","getThemeForegroundColor","[object Object]","ev","theme","detail","foregroundColor","mode","disableBackgroundParallax","scrolltotop","document","scrollingElement","scrollTop","factor","y","scrollFactor","slotHasContent","el","onComponentRequiredPropUndefined","prop","heading","propName","aligned","small","subheading","secondarySubheading","backgroundImage","style","background-image","background-position","h","Host","class","IcThemeForegroundEnum","Dark","fullHeight","leftContentFullWidth","name","variant"],"mappings":"0IAAA,MAAMA,EAAY,qxMCkCLC,EAAI,iNA+B+B,mBAKf,2BAKmB,kBAKzB,wBAEQ,wBAED,0CAG7BC,KAAKC,cAAgBD,KAAKE,mBAAqBC,+BAEJC,IAG9CC,mBAAmBC,GACjB,MAAMC,EAAiBD,EAAGE,OAC1BR,KAAKS,gBAAkBF,EAAMG,KAI/BL,WACE,GAAIL,KAAKW,0BAA2B,CAClC,OAGF,MAAMC,EAAcC,SAASC,iBAAiBC,UAC9C,MAAMC,EAAS,GACf,MAAMC,GAAK,IAAML,EAAcI,EAC/BhB,KAAKkB,aAAe,SAAWD,EAAI,KAGrCZ,oBACEL,KAAKC,aAAekB,EAAenB,KAAKoB,GAAI,aAG9Cf,mBACEgB,EACE,CAAC,CAAEC,KAAMtB,KAAKuB,QAASC,SAAU,YACjC,QAIJnB,sBACEL,KAAKC,aAAekB,EAAenB,KAAKoB,GAAI,aAG9Cf,SACE,MAAMoB,QACJA,EAAOC,MACPA,EAAKH,QACLA,EAAOI,WACPA,EAAUzB,iBACVA,EAAgB0B,oBAChBA,EAAmBnB,gBACnBA,EAAeoB,gBACfA,EAAeX,aACfA,GACElB,KAEJ,IAAI8B,EAAQ,GAEZ,GAAID,IAAoB1B,UAAW,CACjC2B,EAAQ,CACNC,mBAAoB,OAASF,EAAkB,IAC/CG,sBAAuBd,GAI3B,OACEe,EAACC,EAAI,CACHC,MAAO,CACL9B,CAAC+B,EAAsBC,MACrB5B,IAAoB2B,EAAsBC,KAC5ChC,CAAC,wBAAyBwB,IAAoB1B,WAEhD2B,MAAOA,GAEPG,EAAA,uBAAA,CACER,QAASA,EACTa,WAAU,KACVH,MAAM,qBAENF,EAAA,MAAA,CACEE,MAAO,CACL9B,CAAC,kBAAmB,KACpBA,CAAC,6BAA8BL,KAAKuC,uBAGtCN,EAAA,MAAA,CAAKE,MAAM,WACTF,EAAA,OAAA,CAAMO,KAAK,WACTP,EAAA,gBAAA,CACEQ,QAASf,EAAQ,KAAO,KACxBS,MAAO,CAAE9B,CAAC,2BAA4BqB,IAErCH,KAIPU,EAAA,MAAA,CAAKE,MAAM,cACTF,EAAA,OAAA,CAAMO,KAAK,cACTP,EAAA,gBAAA,CAAeQ,QAAQ,QAAQd,KAGnCM,EAAA,MAAA,CAAKE,MAAM,yBACTF,EAAA,OAAA,CAAMO,KAAK,mBAGbtC,IAAqBC,WAAaH,KAAKC,eACvCgC,EAAA,MAAA,CAAKE,MAAM,mBACTF,EAAA,OAAA,CAAMO,KAAK,aACRtC,GACC+B,EAAA,MAAA,CAAKE,MAAM,uBACTF,EAAA,MAAA,CAAKE,MAAM,qBACTF,EAAA,gBAAA,CAAeQ,QAAQ,MACpBvC,IAGL+B,EAAA,MAAA,CAAKE,MAAM,wBACTF,EAAA,gBAAA,CAAeQ,QAAQ,kBACpBb","sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: block;\n background-color: var(--ic-theme-tertiary);\n color: var(--ic-theme-text);\n\n --hero-heading-bottom-margin: var(--ic-space-md);\n}\n\n:host(.dark) {\n background-color: var(--ic-theme-secondary);\n}\n\n:host(.has-background-image) {\n background-repeat: no-repeat;\n background-position: right -100px;\n background-size: auto calc(100% + 100px);\n box-shadow: var(--ic-elevation-inset);\n}\n\n@media (prefers-reduced-motion) {\n :host(.has-background-image) {\n background-position: right -100px !important;\n }\n}\n\nic-typography.heading-bottom-spacing {\n margin-bottom: var(--hero-heading-bottom-margin);\n}\n\n.section-container {\n display: flex;\n align-items: center;\n height: 100%;\n}\n\n.left-container {\n padding: var(--ic-space-xl) 0;\n}\n\n.left-container:not(.left-container-full-width) {\n flex-basis: 50%;\n}\n\n.left-container-full-width {\n width: 100%;\n}\n\n.right-container {\n flex-basis: 50%;\n}\n\n.interaction-container {\n display: flex;\n gap: var(--ic-space-md);\n margin-top: var(--ic-space-lg);\n}\n\n.secondary-container {\n display: flex;\n flex-direction: column;\n justify-content: center;\n border-left: var(--ic-space-xxxs) solid var(--ic-theme-text);\n}\n\n.secondary-subheading {\n margin-top: var(--ic-space-xxs);\n}\n\n:host([content-aligned=\"left\"]) .left-container,\n:host([content-aligned=\"left\"]) .interaction-container {\n justify-content: flex-start;\n text-align: left;\n}\n\n:host([content-aligned=\"center\"]) .left-container,\n:host([content-aligned=\"center\"]) .interaction-container {\n justify-content: center;\n text-align: center;\n}\n\n@media (min-width: 992px) {\n .left-container-full-width {\n width: 66.6%;\n }\n}\n\n@media (min-width: 1044px) {\n :host,\n .section-container {\n min-height: 208px;\n }\n\n :host([small]),\n :host([small]) .section-container {\n min-height: 173px;\n }\n\n .left-container:not(.left-container-full-width) {\n flex-basis: 66.6%;\n }\n\n .left-container {\n min-height: 144px;\n }\n\n .right-container {\n flex-basis: 33.3%;\n margin-left: 50px;\n }\n\n .secondary-container {\n min-height: 144px;\n }\n\n .secondary-heading,\n .secondary-subheading {\n margin-left: 63px;\n }\n}\n\n@media (min-width: 801px) and (max-width: 1043px) {\n :host(.has-background-image) {\n background-image: none !important;\n }\n\n :host,\n .section-container {\n min-height: 256px;\n }\n\n :host([small]),\n :host([small]) .section-container {\n min-height: 240px;\n }\n\n :host([secondary-heading]),\n :host([secondary-heading]) .section-container {\n min-height: 224px;\n }\n\n .left-container {\n min-height: 160px;\n }\n\n .secondary-container {\n min-height: 160px;\n }\n\n .secondary-heading,\n .secondary-subheading {\n margin-left: 94.75px;\n }\n\n .right-container {\n margin-left: 50px;\n }\n}\n\n@media (min-width: 641px) and (max-width: 800px) {\n :host(.has-background-image) {\n background-image: none !important;\n }\n\n :host,\n .section-container {\n min-height: 256px;\n }\n\n :host([small]),\n :host([small]) .section-container {\n min-height: 240px;\n }\n\n :host([secondary-heading]),\n :host([secondary-heading]) .section-container {\n min-height: 224px;\n }\n\n .left-container {\n min-height: 160px;\n }\n\n .secondary-container {\n min-height: 160px;\n }\n\n .secondary-heading,\n .secondary-subheading {\n margin-left: 34px;\n }\n\n .right-container {\n margin-left: 50px;\n }\n}\n\n@media (min-width: 481px) and (max-width: 640px) {\n :host(.has-background-image) {\n background-image: none !important;\n }\n\n :host,\n .section-container {\n min-height: 208px;\n }\n\n :host([small]),\n :host([small]) .section-container {\n min-height: 173px;\n }\n\n :host([secondary-heading]),\n :host([secondary-heading]) .section-container {\n min-height: 280px;\n }\n\n :host([secondary-heading]) .section-container,\n :host([small]) .section-container,\n .section-container {\n flex-direction: column;\n align-items: flex-start;\n }\n\n .left-container {\n height: fit-content;\n }\n\n .secondary-container {\n height: fit-content;\n border: none;\n }\n\n .right-container {\n margin-bottom: 40px;\n }\n}\n\n@media (max-width: 480px) {\n :host(.has-background-image) {\n background-image: none !important;\n }\n\n :host,\n .section-container {\n min-height: 192px;\n }\n\n :host,\n .right-container {\n margin-bottom: var(--ic-space-md);\n }\n\n :host([small]),\n :host([small]) .section-container {\n min-height: 173px;\n }\n\n :host([secondary-heading]),\n :host([secondary-heading]) .section-container {\n min-height: 264px;\n }\n\n :host([secondary-heading]) .section-container,\n :host([small]) .section-container,\n .section-container {\n flex-direction: column;\n align-items: flex-start;\n }\n\n .left-container {\n height: fit-content;\n }\n\n .secondary-container {\n height: fit-content;\n border: none;\n }\n}\n","import {\n Component,\n Element,\n Host,\n Prop,\n h,\n State,\n Listen,\n} from \"@stencil/core\";\nimport {\n IcAlignment,\n IcTheme,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\nimport {\n slotHasContent,\n getThemeForegroundColor,\n onComponentRequiredPropUndefined,\n} from \"../../utils/helpers\";\nimport { IcHeroContentAlignments } from \"./ic-hero.types\";\n\n/**\n * @slot heading - Content will be rendered in the title area, in place of the heading.\n * @slot subheading - Content will be rendered in the title area, in place of the subheading.\n * @slot interaction - Content will be rendered in the interaction area, adjacent to the title area.\n * @slot secondary - Content will be rendered in the secondary content area.\n */\n\n@Component({\n tag: \"ic-hero\",\n styleUrl: \"ic-hero.css\",\n shadow: true,\n})\nexport class Hero {\n @Element() el: HTMLIcHeroElement;\n\n /**\n * The heading of the hero.\n */\n @Prop() heading!: string;\n\n /**\n * The description for the hero.\n */\n @Prop() subheading?: string;\n\n /**\n * The optional secondary heading, replaced by slotted right content.\n */\n @Prop() secondaryHeading?: string;\n\n /**\n * The optional secondary subheading, replaced by slotted right content.\n */\n @Prop() secondarySubheading?: string;\n\n /**\n * The optional background image.\n */\n @Prop() backgroundImage?: string;\n\n /**\n * If `true`, the background image (if set) will not scroll using a parallax effect.\n */\n @Prop() disableBackgroundParallax?: boolean = false;\n\n /**\n * The alignment of the hero.\n */\n @Prop() aligned: IcAlignment = \"left\";\n\n /**\n * The alignment of the hero content.\n */\n @Prop() contentAligned: IcHeroContentAlignments = \"left\";\n\n /**\n * If `true`, the small styling will be applied to the hero.\n */\n @Prop() small: boolean = false;\n\n @State() rightContent: boolean = false;\n\n @State() scrollFactor: string = \"right -100px\";\n\n @State() leftContentFullWidth: boolean =\n !this.rightContent && this.secondaryHeading === undefined;\n\n @State() foregroundColor: IcThemeForeground = getThemeForegroundColor();\n\n @Listen(\"themeChange\", { target: \"document\" })\n themeChangeHandler(ev: CustomEvent): void {\n const theme: IcTheme = ev.detail;\n this.foregroundColor = theme.mode;\n }\n\n @Listen(\"scroll\", { target: \"document\" })\n doScroll(): void {\n if (this.disableBackgroundParallax) {\n return;\n }\n\n const scrolltotop = document.scrollingElement.scrollTop;\n const factor = 0.4;\n const y = -100 + scrolltotop * factor;\n this.scrollFactor = \"right \" + y + \"px\";\n }\n\n componentWillLoad(): void {\n this.rightContent = slotHasContent(this.el, \"secondary\");\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.heading, propName: \"heading\" }],\n \"Hero\"\n );\n }\n\n componentWillRender(): void {\n this.rightContent = slotHasContent(this.el, \"secondary\");\n }\n\n render() {\n const {\n aligned,\n small,\n heading,\n subheading,\n secondaryHeading,\n secondarySubheading,\n foregroundColor,\n backgroundImage,\n scrollFactor,\n } = this;\n\n let style = {};\n\n if (backgroundImage !== undefined) {\n style = {\n \"background-image\": \"url(\" + backgroundImage + \")\",\n \"background-position\": scrollFactor,\n };\n }\n\n return (\n <Host\n class={{\n [IcThemeForegroundEnum.Dark]:\n foregroundColor === IcThemeForegroundEnum.Dark,\n [\"has-background-image\"]: backgroundImage !== undefined,\n }}\n style={style}\n >\n <ic-section-container\n aligned={aligned}\n fullHeight\n class=\"section-container\"\n >\n <div\n class={{\n [\"left-container\"]: true,\n [\"left-container-full-width\"]: this.leftContentFullWidth,\n }}\n >\n <div class=\"heading\">\n <slot name=\"heading\">\n <ic-typography\n variant={small ? \"h2\" : \"h1\"}\n class={{ [\"heading-bottom-spacing\"]: !small }}\n >\n {heading}\n </ic-typography>\n </slot>\n </div>\n <div class=\"subheading\">\n <slot name=\"subheading\">\n <ic-typography variant=\"body\">{subheading}</ic-typography>\n </slot>\n </div>\n <div class=\"interaction-container\">\n <slot name=\"interaction\"></slot>\n </div>\n </div>\n {(secondaryHeading !== undefined || this.rightContent) && (\n <div class=\"right-container\">\n <slot name=\"secondary\">\n {secondaryHeading && (\n <div class=\"secondary-container\">\n <div class=\"secondary-heading\">\n <ic-typography variant=\"h4\">\n {secondaryHeading}\n </ic-typography>\n </div>\n <div class=\"secondary-subheading\">\n <ic-typography variant=\"subtitle-small\">\n {secondarySubheading}\n </ic-typography>\n </div>\n </div>\n )}\n </slot>\n </div>\n )}\n </ic-section-container>\n </Host>\n );\n }\n}\n"]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as t,h as i,H as s,g as r}from"./p-f9370be6.js";import{z as l,c as a,a as o}from"./p-a8ac8f72.js";import{I as e}from"./p-6f57b13c.js";const c=`<svg width="8" height="10" viewBox="0 0 8 10" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.0876 1.175L5.9126 0L0.912598 5L5.9126 10L7.0876 8.825L3.27093 5L7.0876 1.175Z"/>\n</svg>`;const n=`<svg width="8" height="10" viewBox="0 0 8 10" xmlns="http://www.w3.org/2000/svg">\n<path d="M2.0876 0L0.912598 1.175L4.72926 5L0.912598 8.825L2.0876 10L7.0876 5L2.0876 0Z"/>\n</svg>\n`;const h=":host{--border-bottom-color:var(--ic-architectural-300);--splitter-color:var(--ic-architectural-100);--tab-scroll-focus:var(--ic-border-focus);--tab-scroll-fill:var(--ic-action-default);--tab-scroll-disabled-fill:var(--ic-architectural-300);--tab-scroll-hover:var(--ic-action-default-bg-hover);--tab-scroll-active:var(--ic-action-default-bg-active);display:block;margin-bottom:var(--ic-space-md);margin-left:calc(-1 * var(--ic-space-xs))}:host(.light){--splitter-color:var(--ic-architectural-white);--tab-scroll-focus:var(--ic-border-focus-dark);--tab-scroll-fill:var(--ic-action-light);--tab-scroll-disabled-fill:var(--ic-architectural-500);--tab-scroll-hover:var(--ic-action-dark-bg-hover);--tab-scroll-active:var(--ic-action-dark-bg-active)}:host([inline]){margin-bottom:0}.tabs-container{display:flex;flex-direction:row;overflow-y:hidden;overflow-x:scroll;height:100%;align-items:center;padding:var(--ic-space-xs);scroll-behavior:smooth;-ms-overflow-style:none;scrollbar-width:none;margin:calc(-1 * var(--ic-space-xs)) 0}.tabs-container::-webkit-scrollbar{display:none}.ic-tab-group-container{display:flex;align-items:center}:host(.light.ic-tab-group-not-inline){--border-bottom-color:var(--ic-architectural-white)}.scroll-container{display:flex}.scroll-container.hidden{display:none}.scroll-container:first-child{margin-left:var(--ic-space-xs)}.scroll-arrow{display:flex;width:36px;height:36px;margin:var(--ic-space-xxs) var(--ic-space-xxxs);align-items:center;justify-content:center;fill:var(--tab-scroll-fill);cursor:pointer}.scroll-arrow:focus{outline:var(--ic-hc-focus-outline)}.scroll-arrow:hover{background-color:var(--tab-scroll-hover)}.scroll-arrow:active{background-color:var(--tab-scroll-active)}.scroll-container.disabled .scroll-arrow{fill:var(--tab-scroll-disabled-fill);cursor:default}.scroll-container.disabled .scroll-arrow:hover,.scroll-container.disabled .scroll-arrow:active,.scroll-container.disabled .scroll-arrow:focus{background-color:unset;box-shadow:none}.scroll-container.disabled .ic-tooltip-container{display:none !important}.scroll-splitter-left,.scroll-splitter-right{display:flex;height:var(--ic-space-lg);width:1px;margin-top:10px;background-color:var(--splitter-color)}.scroll-splitter-left{margin-left:var(--ic-space-xxxs)}.scroll-splitter-right{margin-right:var(--ic-space-xxxs)}.scroll-container.disabled .scroll-splitter-left,.scroll-container.disabled .scroll-splitter-right{display:none}.ic-tab-splitter{display:block;background-color:var(--border-bottom-color);height:1px;right:0;left:0;margin-left:var(--ic-space-xs)}.ic-tab-splitter.hidden{height:0}";const d=200;const b=class{constructor(i){t(this,i);this.buttonStateSet=false;this.resizeObserverCallback=()=>{if(this.tabGroupEl===null||this.tabGroupEl===undefined){this.tabGroupEl=this.host.shadowRoot.querySelector(".tabs-container")}this.tabOverflow=l(this.tabGroupEl);if(this.tabOverflow){this.lastTabVisible=this.tabGroupEl.offsetWidth+this.tabGroupEl.scrollLeft>=this.tabGroupEl.scrollWidth}};this.runResizeObserver=()=>{this.resizeObserver=new ResizeObserver((()=>{this.resizeObserverCallback()}));this.resizeObserver.observe(this.splitterEl)};this.scrollLeft=()=>{this.scrollTabIntoView(this.getCurrentLeftTab()-1)};this.scrollRight=()=>{this.scrollTabIntoView(this.getCurrentLeftTab()+1)};this.longScrollRight=()=>{this.scrollRight();this.scrollDelay=window.setTimeout(this.longScrollRight,d)};this.longScrollLeft=()=>{this.scrollLeft();this.scrollDelay=window.setTimeout(this.longScrollLeft,d)};this.leftArrowMouseDownHandler=()=>{this.scrollDelay=window.setTimeout(this.longScrollLeft,d)};this.rightArrowMouseDownHandler=()=>{this.scrollDelay=window.setTimeout(this.longScrollRight,d)};this.arrowMouseUpHandler=()=>{window.clearTimeout(this.scrollDelay)};this.getCurrentLeftTab=()=>{const t=this.tabOffsets.findIndex((t=>t>this.tabGroupEl.scrollLeft));return t<0?0:t};this.scrollHandler=()=>{window.clearTimeout(this.isScrolling);this.isScrolling=window.setTimeout(this.scrollStopped,50)};this.scrollStopped=()=>{if(this.buttonStateSet===false){this.firstTabVisible=this.tabGroupEl.scrollLeft===0;this.lastTabVisible=this.tabGroupEl.offsetWidth+this.tabGroupEl.scrollLeft>=this.tabGroupEl.scrollWidth}this.buttonStateSet=false};this.contextId="default";this.inline=false;this.label=undefined;this.appearance="dark";this.firstTabVisible=true;this.lastTabVisible=false;this.tabOverflow=false}async scrollTabIntoView(t){this.firstTabVisible=t<=0;const i=t<=0?0:this.tabOffsets[t-1];this.lastTabVisible=this.tabGroupEl.offsetWidth+i>=this.tabGroupEl.scrollWidth;this.buttonStateSet=true;this.tabGroupEl.scrollLeft=i}tabFocusHandler(t){if(this.tabOverflow){this.scrollTabIntoView(t.detail.position)}}componentDidLoad(){this.tabs=Array.from(this.host.querySelectorAll("ic-tab"));let t=0;this.tabOffsets=this.tabs.map((i=>{t+=i.offsetWidth;return t}));a(this.runResizeObserver);o([{prop:this.label,propName:"label"}],"Tab
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as t,h as i,H as s,g as r}from"./p-f9370be6.js";import{z as l,c as a,a as o}from"./p-a8ac8f72.js";import{I as e}from"./p-6f57b13c.js";const c=`<svg width="8" height="10" viewBox="0 0 8 10" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.0876 1.175L5.9126 0L0.912598 5L5.9126 10L7.0876 8.825L3.27093 5L7.0876 1.175Z"/>\n</svg>`;const n=`<svg width="8" height="10" viewBox="0 0 8 10" xmlns="http://www.w3.org/2000/svg">\n<path d="M2.0876 0L0.912598 1.175L4.72926 5L0.912598 8.825L2.0876 10L7.0876 5L2.0876 0Z"/>\n</svg>\n`;const h=":host{--border-bottom-color:var(--ic-architectural-300);--splitter-color:var(--ic-architectural-100);--tab-scroll-focus:var(--ic-border-focus);--tab-scroll-fill:var(--ic-action-default);--tab-scroll-disabled-fill:var(--ic-architectural-300);--tab-scroll-hover:var(--ic-action-default-bg-hover);--tab-scroll-active:var(--ic-action-default-bg-active);display:block;margin-bottom:var(--ic-space-md);margin-left:calc(-1 * var(--ic-space-xs))}:host(.light){--splitter-color:var(--ic-architectural-white);--tab-scroll-focus:var(--ic-border-focus-dark);--tab-scroll-fill:var(--ic-action-light);--tab-scroll-disabled-fill:var(--ic-architectural-500);--tab-scroll-hover:var(--ic-action-dark-bg-hover);--tab-scroll-active:var(--ic-action-dark-bg-active)}:host([inline]){margin-bottom:0}.tabs-container{display:flex;flex-direction:row;overflow-y:hidden;overflow-x:scroll;height:100%;align-items:center;padding:var(--ic-space-xs);scroll-behavior:smooth;-ms-overflow-style:none;scrollbar-width:none;margin:calc(-1 * var(--ic-space-xs)) 0}.tabs-container::-webkit-scrollbar{display:none}.ic-tab-group-container{display:flex;align-items:center}:host(.light.ic-tab-group-not-inline){--border-bottom-color:var(--ic-architectural-white)}.scroll-container{display:flex}.scroll-container.hidden{display:none}.scroll-container:first-child{margin-left:var(--ic-space-xs)}.scroll-arrow{display:flex;width:36px;height:36px;margin:var(--ic-space-xxs) var(--ic-space-xxxs);align-items:center;justify-content:center;fill:var(--tab-scroll-fill);cursor:pointer}.scroll-arrow:focus{outline:var(--ic-hc-focus-outline)}.scroll-arrow:hover{background-color:var(--tab-scroll-hover)}.scroll-arrow:active{background-color:var(--tab-scroll-active)}.scroll-container.disabled .scroll-arrow{fill:var(--tab-scroll-disabled-fill);cursor:default}.scroll-container.disabled .scroll-arrow:hover,.scroll-container.disabled .scroll-arrow:active,.scroll-container.disabled .scroll-arrow:focus{background-color:unset;box-shadow:none}.scroll-container.disabled .ic-tooltip-container{display:none !important}.scroll-splitter-left,.scroll-splitter-right{display:flex;height:var(--ic-space-lg);width:1px;margin-top:10px;background-color:var(--splitter-color)}.scroll-splitter-left{margin-left:var(--ic-space-xxxs)}.scroll-splitter-right{margin-right:var(--ic-space-xxxs)}.scroll-container.disabled .scroll-splitter-left,.scroll-container.disabled .scroll-splitter-right{display:none}.ic-tab-splitter{display:block;background-color:var(--border-bottom-color);height:1px;right:0;left:0;margin-left:var(--ic-space-xs)}.ic-tab-splitter.hidden{height:0}";const d=200;const b=class{constructor(i){t(this,i);this.buttonStateSet=false;this.resizeObserverCallback=()=>{if(this.tabGroupEl===null||this.tabGroupEl===undefined){this.tabGroupEl=this.host.shadowRoot.querySelector(".tabs-container")}this.tabOverflow=l(this.tabGroupEl);if(this.tabOverflow){this.lastTabVisible=this.tabGroupEl.offsetWidth+this.tabGroupEl.scrollLeft>=this.tabGroupEl.scrollWidth}};this.runResizeObserver=()=>{this.resizeObserver=new ResizeObserver((()=>{this.resizeObserverCallback()}));this.resizeObserver.observe(this.splitterEl)};this.scrollLeft=()=>{this.scrollTabIntoView(this.getCurrentLeftTab()-1)};this.scrollRight=()=>{this.scrollTabIntoView(this.getCurrentLeftTab()+1)};this.longScrollRight=()=>{this.scrollRight();this.scrollDelay=window.setTimeout(this.longScrollRight,d)};this.longScrollLeft=()=>{this.scrollLeft();this.scrollDelay=window.setTimeout(this.longScrollLeft,d)};this.leftArrowMouseDownHandler=()=>{this.scrollDelay=window.setTimeout(this.longScrollLeft,d)};this.rightArrowMouseDownHandler=()=>{this.scrollDelay=window.setTimeout(this.longScrollRight,d)};this.arrowMouseUpHandler=()=>{window.clearTimeout(this.scrollDelay)};this.getCurrentLeftTab=()=>{const t=this.tabOffsets.findIndex((t=>t>this.tabGroupEl.scrollLeft));return t<0?0:t};this.scrollHandler=()=>{window.clearTimeout(this.isScrolling);this.isScrolling=window.setTimeout(this.scrollStopped,50)};this.scrollStopped=()=>{if(this.buttonStateSet===false){this.firstTabVisible=this.tabGroupEl.scrollLeft===0;this.lastTabVisible=this.tabGroupEl.offsetWidth+this.tabGroupEl.scrollLeft>=this.tabGroupEl.scrollWidth}this.buttonStateSet=false};this.contextId="default";this.inline=false;this.label=undefined;this.appearance="dark";this.firstTabVisible=true;this.lastTabVisible=false;this.tabOverflow=false}async scrollTabIntoView(t){this.firstTabVisible=t<=0;const i=t<=0?0:this.tabOffsets[t-1];this.lastTabVisible=this.tabGroupEl.offsetWidth+i>=this.tabGroupEl.scrollWidth;this.buttonStateSet=true;this.tabGroupEl.scrollLeft=i}tabFocusHandler(t){if(this.tabOverflow){this.scrollTabIntoView(t.detail.position)}}componentDidLoad(){this.tabs=Array.from(this.host.querySelectorAll("ic-tab"));let t=0;this.tabOffsets=this.tabs.map((i=>{t+=i.offsetWidth;return t}));a(this.runResizeObserver);o([{prop:this.label,propName:"label"}],"Tab Group")}disconnectedCallback(){this.resizeObserver.disconnect()}render(){const{inline:t,appearance:r,label:l,firstTabVisible:a,lastTabVisible:o,tabOverflow:h}=this;return i(s,{role:"tablist","aria-label":l,class:{["light"]:r===e.Light,["ic-tab-group-not-inline"]:!t}},i("div",{class:"ic-tab-group-container"},this.tabOverflow&&i("div",{"aria-hidden":"true",id:"scroll-container-left",class:{["scroll-container"]:true,["hidden"]:!h,["disabled"]:a}},i("ic-tooltip",{placement:"bottom-start",label:"Scroll left",target:"left-arrow"},i("span",{id:"left-arrow",class:"scroll-arrow",innerHTML:c,onClick:this.scrollLeft,onMouseDown:this.leftArrowMouseDownHandler,onMouseUp:this.arrowMouseUpHandler})),i("span",{class:"scroll-splitter-left"})),i("div",{class:"tabs-container",ref:t=>this.tabGroupEl=t,onScroll:this.scrollHandler},i("slot",null)),this.tabOverflow&&i("div",{"aria-hidden":"true",id:"scroll-container-right",class:{["scroll-container"]:true,["hidden"]:!h,["disabled"]:o}},i("span",{class:"scroll-splitter-right"}),i("ic-tooltip",{placement:"bottom-start",label:"Scroll right",target:"right-arrow"},i("span",{id:"right-arrow",class:"scroll-arrow",innerHTML:n,onClick:this.scrollRight,onMouseDown:this.rightArrowMouseDownHandler,onMouseUp:this.arrowMouseUpHandler})))),i("div",{"aria-hidden":"true",class:{["ic-tab-splitter"]:true,["hidden"]:t},ref:t=>this.splitterEl=t}))}get host(){return r(this)}};b.style=h;export{b as ic_tab_group};
|
2
|
+
//# sourceMappingURL=p-541918c2.entry.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["src/components/ic-tab-group/ic-tab-group.css?tag=ic-tab-group&encapsulation=shadow","src/components/ic-tab-group/ic-tab-group.tsx"],"names":["icTabGroupCss","SCROLL_DELAY_MS","TabGroup","this","buttonStateSet","resizeObserverCallback","tabGroupEl","undefined","host","shadowRoot","querySelector","tabOverflow","elementOverflowsX","lastTabVisible","offsetWidth","scrollLeft","scrollWidth","runResizeObserver","resizeObserver","ResizeObserver","observe","splitterEl","scrollTabIntoView","getCurrentLeftTab","scrollRight","longScrollRight","scrollDelay","window","setTimeout","longScrollLeft","leftArrowMouseDownHandler","rightArrowMouseDownHandler","arrowMouseUpHandler","clearTimeout","index","tabOffsets","findIndex","el","scrollHandler","isScrolling","scrollStopped","firstTabVisible","[object Object]","tabNumber","newScrollPos","event","detail","position","tabs","Array","from","querySelectorAll","runningTotal","map","tab","checkResizeObserver","onComponentRequiredPropUndefined","prop","label","propName","disconnect","inline","appearance","h","Host","role","aria-label","class","IcThemeForegroundEnum","Light","aria-hidden","id","placement","target","innerHTML","LeftArrow","onClick","onMouseDown","onMouseUp","ref","onScroll","RightArrow"],"mappings":"mhBAAA,MAAMA,EAAgB,uiFCyBtB,MAAMC,EAAkB,UAOXC,EAAQ,+BAgCXC,KAAAC,eAA0B,MAsB1BD,KAAAE,uBAAyB,KAC/B,GAAIF,KAAKG,aAAe,MAAQH,KAAKG,aAAeC,UAAW,CAC7DJ,KAAKG,WAAaH,KAAKK,KAAKC,WAAWC,cAAc,mBAEvDP,KAAKQ,YAAcC,EAAkBT,KAAKG,YAC1C,GAAIH,KAAKQ,YAAa,CACpBR,KAAKU,eACHV,KAAKG,WAAWQ,YAAcX,KAAKG,WAAWS,YAC9CZ,KAAKG,WAAWU,cAIdb,KAAAc,kBAAoB,KAC1Bd,KAAKe,eAAiB,IAAIC,gBAAe,KACvChB,KAAKE,4BAEPF,KAAKe,eA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D,KAAKQ,aACJoD,EAAA,MAAA,CAAAO,cACc,OACZC,GAAG,yBACHJ,MAAO,CACLzB,CAAC,oBAAqB,KACtBA,CAAC,WAAY/B,EACb+B,CAAC,YAAa7B,IAGhBkD,EAAA,OAAA,CAAMI,MAAM,0BACZJ,EAAA,aAAA,CACES,UAAU,eACVd,MAAM,eACNe,OAAO,eAEPV,EAAA,OAAA,CACEQ,GAAG,cACHJ,MAAM,eACNO,UAAWO,EACXL,QAASzE,KAAKqB,YACdqD,YAAa1E,KAAK4B,2BAClB+C,UAAW3E,KAAK6B,yBAO1B+B,EAAA,MAAA,CAAAO,cACc,OACZH,MAAO,CACLzB,CAAC,mBAAoB,KACrBA,CAAC,UAAWmB,GAEdkB,IAAM1C,GAAQlC,KAAKkB,WAAagB","sourcesContent":[":host {\n --border-bottom-color: var(--ic-architectural-300);\n --splitter-color: var(--ic-architectural-100);\n --tab-scroll-focus: var(--ic-border-focus);\n --tab-scroll-fill: var(--ic-action-default);\n --tab-scroll-disabled-fill: var(--ic-architectural-300);\n --tab-scroll-hover: var(--ic-action-default-bg-hover);\n --tab-scroll-active: var(--ic-action-default-bg-active);\n\n display: block;\n margin-bottom: var(--ic-space-md);\n margin-left: calc(-1 * var(--ic-space-xs));\n}\n\n:host(.light) {\n --splitter-color: var(--ic-architectural-white);\n --tab-scroll-focus: var(--ic-border-focus-dark);\n --tab-scroll-fill: var(--ic-action-light);\n --tab-scroll-disabled-fill: var(--ic-architectural-500);\n --tab-scroll-hover: var(--ic-action-dark-bg-hover);\n --tab-scroll-active: var(--ic-action-dark-bg-active);\n}\n\n:host([inline]) {\n margin-bottom: 0;\n}\n\n.tabs-container {\n display: flex;\n flex-direction: row;\n overflow-y: hidden;\n overflow-x: scroll;\n height: 100%;\n align-items: center;\n padding: var(--ic-space-xs);\n scroll-behavior: smooth;\n -ms-overflow-style: none;\n scrollbar-width: none;\n margin: calc(-1 * var(--ic-space-xs)) 0;\n}\n\n.tabs-container::-webkit-scrollbar {\n display: none;\n}\n\n.ic-tab-group-container {\n display: flex;\n align-items: center;\n}\n\n:host(.light.ic-tab-group-not-inline) {\n --border-bottom-color: var(--ic-architectural-white);\n}\n\n.scroll-container {\n display: flex;\n}\n\n.scroll-container.hidden {\n display: none;\n}\n\n.scroll-container:first-child {\n margin-left: var(--ic-space-xs);\n}\n\n.scroll-arrow {\n display: flex;\n width: 36px;\n height: 36px;\n margin: var(--ic-space-xxs) var(--ic-space-xxxs);\n align-items: center;\n justify-content: center;\n fill: var(--tab-scroll-fill);\n cursor: pointer;\n}\n\n.scroll-arrow:focus {\n outline: var(--ic-hc-focus-outline);\n}\n\n.scroll-arrow:hover {\n background-color: var(--tab-scroll-hover);\n}\n\n.scroll-arrow:active {\n background-color: var(--tab-scroll-active);\n}\n\n.scroll-container.disabled .scroll-arrow {\n fill: var(--tab-scroll-disabled-fill);\n cursor: default;\n}\n\n.scroll-container.disabled .scroll-arrow:hover,\n.scroll-container.disabled .scroll-arrow:active,\n.scroll-container.disabled .scroll-arrow:focus {\n background-color: unset;\n box-shadow: none;\n}\n\n.scroll-container.disabled .ic-tooltip-container {\n display: none !important;\n}\n\n.scroll-splitter-left,\n.scroll-splitter-right {\n display: flex;\n height: var(--ic-space-lg);\n width: 1px;\n margin-top: 10px;\n background-color: var(--splitter-color);\n}\n\n.scroll-splitter-left {\n margin-left: var(--ic-space-xxxs);\n}\n\n.scroll-splitter-right {\n margin-right: var(--ic-space-xxxs);\n}\n\n.scroll-container.disabled .scroll-splitter-left,\n.scroll-container.disabled .scroll-splitter-right {\n display: none;\n}\n\n.ic-tab-splitter {\n display: block;\n background-color: var(--border-bottom-color);\n height: 1px;\n right: 0;\n left: 0;\n margin-left: var(--ic-space-xs);\n}\n\n.ic-tab-splitter.hidden {\n height: 0;\n}\n","import {\n Component,\n Element,\n Host,\n Prop,\n h,\n State,\n Method,\n Listen,\n} from \"@stencil/core\";\n\nimport LeftArrow from \"./assets/left-arrow.svg\";\nimport RightArrow from \"./assets/right-arrow.svg\";\n\nimport {\n checkResizeObserver,\n elementOverflowsX,\n onComponentRequiredPropUndefined,\n} from \"../../utils/helpers\";\nimport { IcTabClickEventDetail } from \"../ic-tab/ic-tab.types\";\nimport {\n IcThemeForegroundNoDefault,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\n\nconst SCROLL_DELAY_MS = 200;\n\n@Component({\n tag: \"ic-tab-group\",\n styleUrl: \"ic-tab-group.css\",\n shadow: true,\n})\nexport class TabGroup {\n @Element() host: HTMLIcTabGroupElement;\n\n /**\n * The unique context needed if using multiple tabs inside one another i.e. rendering another set of tabs inside a tab panel.\n */\n @Prop({ reflect: true }) contextId?: string = \"default\";\n\n /**\n * If `true`, the tabs and tab panels will be positioned separately.\n */\n @Prop({ reflect: true }) inline?: boolean = false;\n\n /**\n * The label to describe the purpose of the set of tabs to screen reader users.\n */\n @Prop() label!: string;\n\n /** @internal The appearance of the tab group, e.g dark, or light. */\n @Prop() appearance?: IcThemeForegroundNoDefault = \"dark\";\n\n @State() firstTabVisible: boolean = true;\n @State() lastTabVisible: boolean = false;\n @State() tabOverflow: boolean = false;\n\n private tabs: HTMLIcTabElement[];\n private tabOffsets: number[];\n private tabGroupEl: HTMLElement;\n private splitterEl: HTMLElement;\n private resizeObserver: ResizeObserver;\n private isScrolling: number;\n private scrollDelay: number;\n private buttonStateSet: boolean = false;\n\n /**\n * @internal if tab side scrolling enabled, scrolls the specified tab into view\n */\n @Method()\n async scrollTabIntoView(tabNumber: number): Promise<void> {\n this.firstTabVisible = tabNumber <= 0;\n const newScrollPos = tabNumber <= 0 ? 0 : this.tabOffsets[tabNumber - 1];\n this.lastTabVisible =\n this.tabGroupEl.offsetWidth + newScrollPos >= this.tabGroupEl.scrollWidth;\n this.buttonStateSet = true;\n this.tabGroupEl.scrollLeft = newScrollPos;\n }\n\n @Listen(\"tabFocus\")\n tabFocusHandler(event: CustomEvent<IcTabClickEventDetail>): void {\n if (this.tabOverflow) {\n this.scrollTabIntoView(event.detail.position);\n }\n }\n\n private resizeObserverCallback = () => {\n if (this.tabGroupEl === null || this.tabGroupEl === undefined) {\n this.tabGroupEl = this.host.shadowRoot.querySelector(\".tabs-container\");\n }\n this.tabOverflow = elementOverflowsX(this.tabGroupEl);\n if (this.tabOverflow) {\n this.lastTabVisible =\n this.tabGroupEl.offsetWidth + this.tabGroupEl.scrollLeft >=\n this.tabGroupEl.scrollWidth;\n }\n };\n\n private runResizeObserver = () => {\n this.resizeObserver = new ResizeObserver(() => {\n this.resizeObserverCallback();\n });\n this.resizeObserver.observe(this.splitterEl);\n };\n\n private scrollLeft = () => {\n this.scrollTabIntoView(this.getCurrentLeftTab() - 1);\n };\n\n private scrollRight = () => {\n this.scrollTabIntoView(this.getCurrentLeftTab() + 1);\n };\n\n private longScrollRight = () => {\n this.scrollRight();\n this.scrollDelay = window.setTimeout(this.longScrollRight, SCROLL_DELAY_MS);\n };\n\n private longScrollLeft = () => {\n this.scrollLeft();\n this.scrollDelay = window.setTimeout(this.longScrollLeft, SCROLL_DELAY_MS);\n };\n\n private leftArrowMouseDownHandler = () => {\n this.scrollDelay = window.setTimeout(this.longScrollLeft, SCROLL_DELAY_MS);\n };\n\n private rightArrowMouseDownHandler = () => {\n this.scrollDelay = window.setTimeout(this.longScrollRight, SCROLL_DELAY_MS);\n };\n\n private arrowMouseUpHandler = () => {\n window.clearTimeout(this.scrollDelay);\n };\n\n private getCurrentLeftTab = (): number => {\n const index = this.tabOffsets.findIndex(\n (el) => el > this.tabGroupEl.scrollLeft\n );\n return index < 0 ? 0 : index;\n };\n\n private scrollHandler = () => {\n window.clearTimeout(this.isScrolling);\n // Set a timeout to run after scrolling ends\n this.isScrolling = window.setTimeout(this.scrollStopped, 50);\n };\n\n private scrollStopped = () => {\n // if scrollTabIntoView has been called, the button states will already be set\n // can't just handle it here as it causes strange jumping behaviour in positioning\n if (this.buttonStateSet === false) {\n this.firstTabVisible = this.tabGroupEl.scrollLeft === 0;\n this.lastTabVisible =\n this.tabGroupEl.offsetWidth + this.tabGroupEl.scrollLeft >=\n this.tabGroupEl.scrollWidth;\n }\n this.buttonStateSet = false;\n };\n\n componentDidLoad(): void {\n this.tabs = Array.from(this.host.querySelectorAll(\"ic-tab\"));\n let runningTotal = 0;\n this.tabOffsets = this.tabs.map((tab) => {\n runningTotal += tab.offsetWidth;\n return runningTotal;\n });\n checkResizeObserver(this.runResizeObserver);\n\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Tab List\"\n );\n }\n\n disconnectedCallback(): void {\n this.resizeObserver.disconnect();\n }\n\n render() {\n const {\n inline,\n appearance,\n label,\n firstTabVisible,\n lastTabVisible,\n tabOverflow,\n } = this;\n\n return (\n <Host\n role=\"tablist\"\n aria-label={label}\n class={{\n [\"light\"]: appearance === IcThemeForegroundEnum.Light,\n [\"ic-tab-group-not-inline\"]: !inline,\n }}\n >\n <div class=\"ic-tab-group-container\">\n {this.tabOverflow && (\n <div\n aria-hidden=\"true\"\n id=\"scroll-container-left\"\n class={{\n [\"scroll-container\"]: true,\n [\"hidden\"]: !tabOverflow,\n [\"disabled\"]: firstTabVisible,\n }}\n >\n <ic-tooltip\n placement=\"bottom-start\"\n label=\"Scroll left\"\n target=\"left-arrow\"\n >\n <span\n id=\"left-arrow\"\n class=\"scroll-arrow\"\n innerHTML={LeftArrow}\n onClick={this.scrollLeft}\n onMouseDown={this.leftArrowMouseDownHandler}\n onMouseUp={this.arrowMouseUpHandler}\n ></span>\n </ic-tooltip>\n <span class=\"scroll-splitter-left\"></span>\n </div>\n )}\n <div\n class=\"tabs-container\"\n ref={(el) => (this.tabGroupEl = el)}\n onScroll={this.scrollHandler}\n >\n <slot></slot>\n </div>\n {this.tabOverflow && (\n <div\n aria-hidden=\"true\"\n id=\"scroll-container-right\"\n class={{\n [\"scroll-container\"]: true,\n [\"hidden\"]: !tabOverflow,\n [\"disabled\"]: lastTabVisible,\n }}\n >\n <span class=\"scroll-splitter-right\"></span>\n <ic-tooltip\n placement=\"bottom-start\"\n label=\"Scroll right\"\n target=\"right-arrow\"\n >\n <span\n id=\"right-arrow\"\n class=\"scroll-arrow\"\n innerHTML={RightArrow}\n onClick={this.scrollRight}\n onMouseDown={this.rightArrowMouseDownHandler}\n onMouseUp={this.arrowMouseUpHandler}\n ></span>\n </ic-tooltip>\n </div>\n )}\n </div>\n\n <div\n aria-hidden=\"true\"\n class={{\n [\"ic-tab-splitter\"]: true,\n [\"hidden\"]: inline,\n }}\n ref={(el) => (this.splitterEl = el)}\n ></div>\n </Host>\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"sources":["src/components/ic-tab-group/ic-tab-group.css?tag=ic-tab-group&encapsulation=shadow","src/components/ic-tab-group/ic-tab-group.tsx"],"names":["icTabGroupCss","SCROLL_DELAY_MS","TabGroup","this","buttonStateSet","resizeObserverCallback","tabGroupEl","undefined","host","shadowRoot","querySelector","tabOverflow","elementOverflowsX","lastTabVisible","offsetWidth","scrollLeft","scrollWidth","runResizeObserver","resizeObserver","ResizeObserver","observe","splitterEl","scrollTabIntoView","getCurrentLeftTab","scrollRight","longScrollRight","scrollDelay","window","setTimeout","longScrollLeft","leftArrowMouseDownHandler","rightArrowMouseDownHandler","arrowMouseUpHandler","clearTimeout","index","tabOffsets","findIndex","el","scrollHandler","isScrolling","scrollStopped","firstTabVisible","[object Object]","tabNumber","newScrollPos","event","detail","position","tabs","Array","from","querySelectorAll","runningTotal","map","tab","checkResizeObserver","onComponentRequiredPropUndefined","prop","label","propName","disconnect","inline","appearance","h","Host","role","aria-label","class","IcThemeForegroundEnum","Light","aria-hidden","id","placement","target","innerHTML","LeftArrow","onClick","onMouseDown","onMouseUp","ref","onScroll","RightArrow"],"mappings":"mhBAAA,MAAMA,EAAgB,uiFCyBtB,MAAMC,EAAkB,UAOXC,EAAQ,+BAgCXC,KAAAC,eAA0B,MAsB1BD,KAAAE,uBAAyB,KAC/B,GAAIF,KAAKG,aAAe,MAAQH,KAAKG,aAAeC,UAAW,CAC7DJ,KAAKG,WAAaH,K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CACEQ,GAAG,aACHJ,MAAM,eACNO,UAAWC,EACXC,QAASzE,KAAKY,WACd8D,YAAa1E,KAAK2B,0BAClBgD,UAAW3E,KAAK6B,uBAGpB+B,EAAA,OAAA,CAAMI,MAAM,0BAGhBJ,EAAA,MAAA,CACEI,MAAM,iBACNY,IAAM1C,GAAQlC,KAAKG,WAAa+B,EAChC2C,SAAU7E,KAAKmC,eAEfyB,EAAA,OAAA,OAED5D,KAAKQ,aACJoD,EAAA,MAAA,CAAAO,cACc,OACZC,GAAG,yBACHJ,MAAO,CACLzB,CAAC,oBAAqB,KACtBA,CAAC,WAAY/B,EACb+B,CAAC,YAAa7B,IAGhBkD,EAAA,OAAA,CAAMI,MAAM,0BACZJ,EAAA,aAAA,CACES,UAAU,eACVd,MAAM,eACNe,OAAO,eAEPV,EAAA,OAAA,CACEQ,GAAG,cACHJ,MAAM,eACNO,UAAWO,EACXL,QAASzE,KAAKqB,YACdqD,YAAa1E,KAAK4B,2BAClB+C,UAAW3E,KAAK6B,yBAO1B+B,EAAA,MAAA,CAAAO,cACc,OACZH,MAAO,CACLzB,CAAC,mBAAoB,KACrBA,CAAC,UAAWmB,GAEdkB,IAAM1C,GAAQlC,KAAKkB,WAAagB","sourcesContent":[":host {\n --border-bottom-color: var(--ic-architectural-300);\n --splitter-color: var(--ic-architectural-100);\n --tab-scroll-focus: var(--ic-border-focus);\n --tab-scroll-fill: var(--ic-action-default);\n --tab-scroll-disabled-fill: var(--ic-architectural-300);\n --tab-scroll-hover: var(--ic-action-default-bg-hover);\n --tab-scroll-active: var(--ic-action-default-bg-active);\n\n display: block;\n margin-bottom: var(--ic-space-md);\n margin-left: calc(-1 * var(--ic-space-xs));\n}\n\n:host(.light) {\n --splitter-color: var(--ic-architectural-white);\n --tab-scroll-focus: var(--ic-border-focus-dark);\n --tab-scroll-fill: var(--ic-action-light);\n --tab-scroll-disabled-fill: var(--ic-architectural-500);\n --tab-scroll-hover: var(--ic-action-dark-bg-hover);\n --tab-scroll-active: var(--ic-action-dark-bg-active);\n}\n\n:host([inline]) {\n margin-bottom: 0;\n}\n\n.tabs-container {\n display: flex;\n flex-direction: row;\n overflow-y: hidden;\n overflow-x: scroll;\n height: 100%;\n align-items: center;\n padding: var(--ic-space-xs);\n scroll-behavior: smooth;\n -ms-overflow-style: none;\n scrollbar-width: none;\n margin: calc(-1 * var(--ic-space-xs)) 0;\n}\n\n.tabs-container::-webkit-scrollbar {\n display: none;\n}\n\n.ic-tab-group-container {\n display: flex;\n align-items: center;\n}\n\n:host(.light.ic-tab-group-not-inline) {\n --border-bottom-color: var(--ic-architectural-white);\n}\n\n.scroll-container {\n display: flex;\n}\n\n.scroll-container.hidden {\n display: none;\n}\n\n.scroll-container:first-child {\n margin-left: var(--ic-space-xs);\n}\n\n.scroll-arrow {\n display: flex;\n width: 36px;\n height: 36px;\n margin: var(--ic-space-xxs) var(--ic-space-xxxs);\n align-items: center;\n justify-content: center;\n fill: var(--tab-scroll-fill);\n cursor: pointer;\n}\n\n.scroll-arrow:focus {\n outline: var(--ic-hc-focus-outline);\n}\n\n.scroll-arrow:hover {\n background-color: var(--tab-scroll-hover);\n}\n\n.scroll-arrow:active {\n background-color: var(--tab-scroll-active);\n}\n\n.scroll-container.disabled .scroll-arrow {\n fill: var(--tab-scroll-disabled-fill);\n cursor: default;\n}\n\n.scroll-container.disabled .scroll-arrow:hover,\n.scroll-container.disabled .scroll-arrow:active,\n.scroll-container.disabled .scroll-arrow:focus {\n background-color: unset;\n box-shadow: none;\n}\n\n.scroll-container.disabled .ic-tooltip-container {\n display: none !important;\n}\n\n.scroll-splitter-left,\n.scroll-splitter-right {\n display: flex;\n height: var(--ic-space-lg);\n width: 1px;\n margin-top: 10px;\n background-color: var(--splitter-color);\n}\n\n.scroll-splitter-left {\n margin-left: var(--ic-space-xxxs);\n}\n\n.scroll-splitter-right {\n margin-right: var(--ic-space-xxxs);\n}\n\n.scroll-container.disabled .scroll-splitter-left,\n.scroll-container.disabled .scroll-splitter-right {\n display: none;\n}\n\n.ic-tab-splitter {\n display: block;\n background-color: var(--border-bottom-color);\n height: 1px;\n right: 0;\n left: 0;\n margin-left: var(--ic-space-xs);\n}\n\n.ic-tab-splitter.hidden {\n height: 0;\n}\n","import {\n Component,\n Element,\n Host,\n Prop,\n h,\n State,\n Method,\n Listen,\n} from \"@stencil/core\";\n\nimport LeftArrow from \"./assets/left-arrow.svg\";\nimport RightArrow from \"./assets/right-arrow.svg\";\n\nimport {\n checkResizeObserver,\n elementOverflowsX,\n onComponentRequiredPropUndefined,\n} from \"../../utils/helpers\";\nimport { IcTabClickEventDetail } from \"../ic-tab/ic-tab.types\";\nimport {\n IcThemeForegroundNoDefault,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\n\nconst SCROLL_DELAY_MS = 200;\n\n@Component({\n tag: \"ic-tab-group\",\n styleUrl: \"ic-tab-group.css\",\n shadow: true,\n})\nexport class TabGroup {\n @Element() host: HTMLIcTabGroupElement;\n\n /**\n * The unique context needed if using multiple tabs inside one another i.e. rendering another set of tabs inside a tab panel.\n */\n @Prop({ reflect: true }) contextId?: string = \"default\";\n\n /**\n * If `true`, the tabs and tab panels will be positioned separately.\n */\n @Prop({ reflect: true }) inline?: boolean = false;\n\n /**\n * The label to describe the purpose of the set of tabs to screen reader users.\n */\n @Prop() label!: string;\n\n /** @internal The appearance of the tab group, e.g dark, or light. */\n @Prop() appearance?: IcThemeForegroundNoDefault = \"dark\";\n\n @State() firstTabVisible: boolean = true;\n @State() lastTabVisible: boolean = false;\n @State() tabOverflow: boolean = false;\n\n private tabs: HTMLIcTabElement[];\n private tabOffsets: number[];\n private tabGroupEl: HTMLElement;\n private splitterEl: HTMLElement;\n private resizeObserver: ResizeObserver;\n private isScrolling: number;\n private scrollDelay: number;\n private buttonStateSet: boolean = false;\n\n /**\n * @internal if tab side scrolling enabled, scrolls the specified tab into view\n */\n @Method()\n async scrollTabIntoView(tabNumber: number): Promise<void> {\n this.firstTabVisible = tabNumber <= 0;\n const newScrollPos = tabNumber <= 0 ? 0 : this.tabOffsets[tabNumber - 1];\n this.lastTabVisible =\n this.tabGroupEl.offsetWidth + newScrollPos >= this.tabGroupEl.scrollWidth;\n this.buttonStateSet = true;\n this.tabGroupEl.scrollLeft = newScrollPos;\n }\n\n @Listen(\"tabFocus\")\n tabFocusHandler(event: CustomEvent<IcTabClickEventDetail>): void {\n if (this.tabOverflow) {\n this.scrollTabIntoView(event.detail.position);\n }\n }\n\n private resizeObserverCallback = () => {\n if (this.tabGroupEl === null || this.tabGroupEl === undefined) {\n this.tabGroupEl = this.host.shadowRoot.querySelector(\".tabs-container\");\n }\n this.tabOverflow = elementOverflowsX(this.tabGroupEl);\n if (this.tabOverflow) {\n this.lastTabVisible =\n this.tabGroupEl.offsetWidth + this.tabGroupEl.scrollLeft >=\n this.tabGroupEl.scrollWidth;\n }\n };\n\n private runResizeObserver = () => {\n this.resizeObserver = new ResizeObserver(() => {\n this.resizeObserverCallback();\n });\n this.resizeObserver.observe(this.splitterEl);\n };\n\n private scrollLeft = () => {\n this.scrollTabIntoView(this.getCurrentLeftTab() - 1);\n };\n\n private scrollRight = () => {\n this.scrollTabIntoView(this.getCurrentLeftTab() + 1);\n };\n\n private longScrollRight = () => {\n this.scrollRight();\n this.scrollDelay = window.setTimeout(this.longScrollRight, SCROLL_DELAY_MS);\n };\n\n private longScrollLeft = () => {\n this.scrollLeft();\n this.scrollDelay = window.setTimeout(this.longScrollLeft, SCROLL_DELAY_MS);\n };\n\n private leftArrowMouseDownHandler = () => {\n this.scrollDelay = window.setTimeout(this.longScrollLeft, SCROLL_DELAY_MS);\n };\n\n private rightArrowMouseDownHandler = () => {\n this.scrollDelay = window.setTimeout(this.longScrollRight, SCROLL_DELAY_MS);\n };\n\n private arrowMouseUpHandler = () => {\n window.clearTimeout(this.scrollDelay);\n };\n\n private getCurrentLeftTab = (): number => {\n const index = this.tabOffsets.findIndex(\n (el) => el > this.tabGroupEl.scrollLeft\n );\n return index < 0 ? 0 : index;\n };\n\n private scrollHandler = () => {\n window.clearTimeout(this.isScrolling);\n // Set a timeout to run after scrolling ends\n this.isScrolling = window.setTimeout(this.scrollStopped, 50);\n };\n\n private scrollStopped = () => {\n // if scrollTabIntoView has been called, the button states will already be set\n // can't just handle it here as it causes strange jumping behaviour in positioning\n if (this.buttonStateSet === false) {\n this.firstTabVisible = this.tabGroupEl.scrollLeft === 0;\n this.lastTabVisible =\n this.tabGroupEl.offsetWidth + this.tabGroupEl.scrollLeft >=\n this.tabGroupEl.scrollWidth;\n }\n this.buttonStateSet = false;\n };\n\n componentDidLoad(): void {\n this.tabs = Array.from(this.host.querySelectorAll(\"ic-tab\"));\n let runningTotal = 0;\n this.tabOffsets = this.tabs.map((tab) => {\n runningTotal += tab.offsetWidth;\n return runningTotal;\n });\n checkResizeObserver(this.runResizeObserver);\n\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Tab Group\"\n );\n }\n\n disconnectedCallback(): void {\n this.resizeObserver.disconnect();\n }\n\n render() {\n const {\n inline,\n appearance,\n label,\n firstTabVisible,\n lastTabVisible,\n tabOverflow,\n } = this;\n\n return (\n <Host\n role=\"tablist\"\n aria-label={label}\n class={{\n [\"light\"]: appearance === IcThemeForegroundEnum.Light,\n [\"ic-tab-group-not-inline\"]: !inline,\n }}\n >\n <div class=\"ic-tab-group-container\">\n {this.tabOverflow && (\n <div\n aria-hidden=\"true\"\n id=\"scroll-container-left\"\n class={{\n [\"scroll-container\"]: true,\n [\"hidden\"]: !tabOverflow,\n [\"disabled\"]: firstTabVisible,\n }}\n >\n <ic-tooltip\n placement=\"bottom-start\"\n label=\"Scroll left\"\n target=\"left-arrow\"\n >\n <span\n id=\"left-arrow\"\n class=\"scroll-arrow\"\n innerHTML={LeftArrow}\n onClick={this.scrollLeft}\n onMouseDown={this.leftArrowMouseDownHandler}\n onMouseUp={this.arrowMouseUpHandler}\n ></span>\n </ic-tooltip>\n <span class=\"scroll-splitter-left\"></span>\n </div>\n )}\n <div\n class=\"tabs-container\"\n ref={(el) => (this.tabGroupEl = el)}\n onScroll={this.scrollHandler}\n >\n <slot></slot>\n </div>\n {this.tabOverflow && (\n <div\n aria-hidden=\"true\"\n id=\"scroll-container-right\"\n class={{\n [\"scroll-container\"]: true,\n [\"hidden\"]: !tabOverflow,\n [\"disabled\"]: lastTabVisible,\n }}\n >\n <span class=\"scroll-splitter-right\"></span>\n <ic-tooltip\n placement=\"bottom-start\"\n label=\"Scroll right\"\n target=\"right-arrow\"\n >\n <span\n id=\"right-arrow\"\n class=\"scroll-arrow\"\n innerHTML={RightArrow}\n onClick={this.scrollRight}\n onMouseDown={this.rightArrowMouseDownHandler}\n onMouseUp={this.arrowMouseUpHandler}\n ></span>\n </ic-tooltip>\n </div>\n )}\n </div>\n\n <div\n aria-hidden=\"true\"\n class={{\n [\"ic-tab-splitter\"]: true,\n [\"hidden\"]: inline,\n }}\n ref={(el) => (this.splitterEl = el)}\n ></div>\n </Host>\n );\n }\n}\n"]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as t,h as e,H as i,g as a}from"./p-f9370be6.js";import{
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as t,h as e,H as i,g as a}from"./p-f9370be6.js";import{i as s,g as n,D as o,c as r}from"./p-a8ac8f72.js";import"./p-6f57b13c.js";const l='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:block}:host(.sticky){position:sticky;top:0;box-shadow:var(--ic-elevation-overlay)}header{background-color:var(--ic-architectural-40)}header.border-bottom{border-bottom:1px solid var(--ic-architectural-300)}header.tabs{padding-top:var(--ic-space-md)}.breadcrumb-area{margin-bottom:var(--ic-space-md)}.main-content{display:grid;grid-template-columns:auto 1fr;grid-template-areas:"title-area action-area"\n "input-area action-area";-moz-column-gap:var(--ic-space-md);column-gap:var(--ic-space-md);justify-content:space-between;width:100%}.title-area{display:flex;flex-direction:column;flex:1;min-width:304px;grid-area:title-area}.header-content{display:flex;align-items:center;width:100%;flex-wrap:wrap;row-gap:var(--ic-space-xs);-moz-column-gap:var(--ic-space-md);column-gap:var(--ic-space-md)}.heading{display:inline-block;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto}.subheading.small{margin-top:var(--ic-space-xs)}.action-area{display:flex;gap:var(--ic-space-md);flex-flow:row wrap;justify-self:end;justify-content:flex-end;height:-moz-fit-content;height:fit-content;grid-area:action-area}.input-area,.navigation-area{margin-top:var(--ic-space-md);width:100%}.tabs-slot{display:flex;overflow-x:auto;padding:8px;margin:-8px}.input-area{grid-area:input-area}@media screen and (max-width: 576px){::slotted(ic-text-field){--input-width:100%;max-width:320px}.main-content{grid-template-areas:"title-area"\n "action-area"\n "input-area";justify-content:flex-start}.title-area{min-width:0}.action-area{min-width:100%;margin-top:var(--ic-space-md);justify-content:start}}@media screen and (min-width: 992px){:host(.sticky-desktop){position:sticky;top:0;box-shadow:var(--ic-elevation-overlay)}}';const d=class{constructor(e){t(this,e);this.resizeObserver=null;this.resizeObserverCallback=()=>{if(this.reverseOrder&&s(this.el,"actions")){this.applyReverseOrder()}};this.runResizeObserver=()=>{this.resizeObserver=new ResizeObserver((()=>{this.resizeObserverCallback()}));this.resizeObserver.observe(this.el)};this.applyReverseOrder=()=>{const t=n();if(t!==this.deviceSize){this.deviceSize=t}const e=this.el.shadowRoot.querySelector("div.action-area");const i=[];for(let t=0;t<this.actionContent.length;t++){const e=this.actionContent[t];let a=e.offsetHeight;if(a===undefined){a=0}i.push(a)}const a=Math.max(...i);let s=e.offsetHeight;if(s===undefined){s=0}if(this.deviceSize>o.S&&s<=a&&!this.areButtonsReversed){this.actionContent=this.actionContent.reverse();this.actionContent.forEach((t=>{this.el.append(t)}));this.areButtonsReversed=!this.areButtonsReversed}else if((this.deviceSize>o.S&&s>a||this.deviceSize<=o.S)&&this.areButtonsReversed){this.actionContent=this.actionContent.reverse();this.actionContent.forEach((t=>{this.el.append(t)}));this.areButtonsReversed=!this.areButtonsReversed}};this.heading=undefined;this.subheading=undefined;this.aligned="left";this.small=false;this.border=true;this.sticky=false;this.stickyDesktopOnly=false;this.reverseOrder=false;this.deviceSize=o.XL;this.areButtonsReversed=false;this.actionContent=undefined}componentWillLoad(){this.actionContent=Array.from(this.el.querySelectorAll(`[slot="actions"]`))}componentDidLoad(){r(this.runResizeObserver)}disconnectedCallback(){if(this.resizeObserver!==null){this.resizeObserver.disconnect()}}render(){const{small:t,border:a,heading:n,subheading:o,aligned:r,sticky:l,stickyDesktopOnly:d}=this;return e(i,{class:{["sticky"]:l,["sticky-desktop"]:!l&&d}},e("header",{class:{["border-bottom"]:a,["tabs"]:s(this.el,"tabs")}},e("ic-section-container",{aligned:r,fullHeight:s(this.el,"tabs")},s(this.el,"breadcrumbs")&&e("div",{class:"breadcrumb-area"},e("slot",{name:"breadcrumbs"})),e("div",{class:"main-content"},e("div",{class:"title-area"},e("div",{class:"header-content"},e("slot",{name:"heading"},e("ic-typography",{variant:t?"h4":"h2",class:"heading"},e("h2",null,n))),e("slot",{name:"heading-adornment"})),e("div",null,e("slot",{name:"subheading"},o&&e("ic-typography",{variant:"body",class:{["subheading"]:true,["small"]:t}},o)))),s(this.el,"actions")&&e("div",{class:"action-area"},e("slot",{name:"actions"})),s(this.el,"input")&&e("div",{class:"input-area"},e("slot",{name:"input"}))),(s(this.el,"stepper")||s(this.el,"tabs"))&&e("div",{class:"navigation-area"},s(this.el,"stepper")&&!s(this.el,"tabs")&&e("slot",{name:"stepper"}),s(this.el,"tabs")&&e("nav",{class:"tabs-slot","aria-label":"navigation-landmark-page-header"},e("slot",{name:"tabs"}))))))}get el(){return a(this)}};d.style=l;export{d as ic_page_header};
|
2
|
+
//# sourceMappingURL=p-9020d1ff.entry.js.map
|