@ukic/web-components 2.1.0-beta.5 → 2.1.0-beta.6
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/ic-card.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-chip.cjs.entry.js +2 -0
- package/dist/cjs/ic-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-radio-group.cjs.entry.js +1 -2
- package/dist/cjs/ic-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ic-card/ic-card.js +1 -1
- package/dist/collection/components/ic-card/ic-card.js.map +1 -1
- package/dist/collection/components/ic-chip/ic-chip.js +20 -1
- package/dist/collection/components/ic-chip/ic-chip.js.map +1 -1
- package/dist/collection/components/ic-radio-group/ic-radio-group.js +1 -2
- package/dist/collection/components/ic-radio-group/ic-radio-group.js.map +1 -1
- package/dist/components/ic-card.js.map +1 -1
- package/dist/components/ic-chip.js +3 -1
- package/dist/components/ic-chip.js.map +1 -1
- package/dist/components/ic-radio-group.js +1 -2
- package/dist/components/ic-radio-group.js.map +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-a5948fc3.entry.js → p-01e8bd4a.entry.js} +2 -2
- package/dist/core/p-01e8bd4a.entry.js.map +1 -0
- package/dist/core/{p-2ca96f69.entry.js → p-6cb276c6.entry.js} +2 -2
- package/dist/core/p-6cb276c6.entry.js.map +1 -0
- package/dist/core/p-d599cf4f.entry.js.map +1 -1
- package/dist/esm/core.js +1 -1
- package/dist/esm/ic-card.entry.js.map +1 -1
- package/dist/esm/ic-chip.entry.js +2 -0
- package/dist/esm/ic-chip.entry.js.map +1 -1
- package/dist/esm/ic-radio-group.entry.js +1 -2
- package/dist/esm/ic-radio-group.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ic-card/ic-card.d.ts +1 -1
- package/dist/types/components/ic-chip/ic-chip.d.ts +5 -1
- package/dist/types/components.d.ts +7 -3
- package/hydrate/index.js +4 -3
- package/package.json +3 -3
- package/dist/core/p-2ca96f69.entry.js.map +0 -1
- package/dist/core/p-a5948fc3.entry.js.map +0 -1
@@ -81,9 +81,8 @@ export class RadioGroup {
|
|
81
81
|
], "Radio Group");
|
82
82
|
}
|
83
83
|
render() {
|
84
|
-
const hadValidationStatus = hasValidationStatus(this.validationStatus, this.disabled);
|
85
84
|
renderHiddenInput(true, this.host, this.name, this.checkedValue, this.disabled);
|
86
|
-
return (h(Host, { onKeyDown: this.handleKeyDown }, h("div", { role: "radiogroup", "aria-label": `${this.label}${this.required ? ", required" : ""}` }, !this.hideLabel && (h("ic-input-label", { class: { [`${this.validationStatus}`]: true }, label: this.label, helperText: this.helperText, required: this.required, disabled: this.disabled })), h("slot", null)), h("ic-input-validation", { ariaLiveMode: "polite", status:
|
85
|
+
return (h(Host, { onKeyDown: this.handleKeyDown }, h("div", { role: "radiogroup", "aria-label": `${this.label}${this.required ? ", required" : ""}` }, !this.hideLabel && (h("ic-input-label", { class: { [`${this.validationStatus}`]: true }, label: this.label, helperText: this.helperText, required: this.required, disabled: this.disabled })), h("slot", null)), hasValidationStatus(this.validationStatus, this.disabled) && (h("ic-input-validation", { ariaLiveMode: "polite", status: this.validationStatus, message: this.validationText }))));
|
87
86
|
}
|
88
87
|
static get is() { return "ic-radio-group"; }
|
89
88
|
static get encapsulation() { return "shadow"; }
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ic-radio-group.js","sourceRoot":"","sources":["../../../src/components/ic-radio-group/ic-radio-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EACD,IAAI,EACJ,KAAK,EACL,MAAM,EACN,OAAO,EACP,KAAK,GAEN,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,EACnB,gCAAgC,EAChC,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAS7B,MAAM,OAAO,UAAU;;IA2Eb,kBA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n h,\n Prop,\n State,\n Listen,\n Element,\n Event,\n EventEmitter,\n} from \"@stencil/core\";\nimport {\n hasValidationStatus,\n onComponentRequiredPropUndefined,\n renderHiddenInput,\n} from \"../../utils/helpers\";\nimport { IcInformationStatusOrEmpty } from \"../../utils/types\";\nimport { IcValueEventDetail } from \"../../interface\";\n\n@Component({\n tag: \"ic-radio-group\",\n styleUrl: \"ic-radio-group.css\",\n shadow: true,\n})\nexport class RadioGroup {\n private radioOptions: HTMLIcRadioOptionElement[];\n\n @Element() host: HTMLIcRadioGroupElement;\n\n /**\n * The label for the radio group to be displayed.\n */\n @Prop() label!: string;\n\n /**\n * The name for the radio group to differentiate from other groups.\n */\n @Prop() name!: string;\n\n /**\n * If `true`, the radio group will require a value.\n */\n @Prop() required: boolean = false;\n\n /**\n * If `true`, the label will be hidden and the required label value will be applied as an aria-label.\n */\n @Prop() hideLabel: boolean = false;\n\n /**\n * If `true`, the disabled state will be set.\n */\n @Prop() disabled: boolean = false;\n\n /**\n * The helper text that will be displayed for additional field guidance.\n */\n @Prop() helperText: string;\n\n /**\n * If `true`, the small styling will be applied to the radio group.\n */\n @Prop() small: boolean = false;\n /**\n * The validation status - e.g. 'error' | 'warning' | 'success'.\n */\n @Prop() validationStatus: IcInformationStatusOrEmpty = \"\";\n /**\n * The validation text - e.g. 'error' | 'warning' | 'success'.\n */\n @Prop() validationText: string = \"\";\n /**\n * The checked state.\n */\n @State() checkedValue: string = \"\";\n @State() selectedChild: number = -1;\n\n /**\n * Emitted when a user selects a radio.\n */\n @Event() icChange: EventEmitter<IcValueEventDetail>;\n\n @Listen(\"icCheck\")\n selectHandler(event: CustomEvent<IcValueEventDetail>): void {\n this.checkedValue = event.detail.value;\n this.icChange.emit({ value: this.checkedValue });\n\n if (this.radioOptions !== undefined) {\n this.radioOptions.forEach((radioOption, index) => {\n radioOption.selected = this.checkedValue === radioOption.value;\n if (radioOption.selected) {\n this.selectedChild = index;\n }\n });\n this.radioOptions[0].shadowRoot.querySelector(\"input\").tabIndex =\n this.selectedChild > 0 ? -1 : 0;\n }\n }\n\n private handleKeyDown = (event: KeyboardEvent): void => {\n switch (event.key) {\n case \"ArrowDown\":\n case \"ArrowRight\":\n this.radioOptions[\n this.getNextItemToSelect(this.selectedChild, true)\n ].selected = true;\n event.preventDefault();\n break;\n case \"ArrowUp\":\n case \"ArrowLeft\":\n this.radioOptions[\n this.getNextItemToSelect(this.selectedChild, false)\n ].selected = true;\n event.preventDefault();\n }\n };\n\n private getNextItemToSelect = (\n currentItem: number,\n movingDown: boolean\n ): number => {\n const numRadios = this.radioOptions.length - 1;\n\n if (currentItem < 1) {\n currentItem = 0;\n }\n\n let nextItem = movingDown ? currentItem + 1 : currentItem - 1;\n\n //check if wrap around necessary\n if (nextItem < 0) {\n nextItem = numRadios;\n } else if (nextItem > numRadios) {\n nextItem = 0;\n }\n\n //if next item is disabled then find next\n if (this.radioOptions[nextItem].disabled) {\n nextItem = this.getNextItemToSelect(nextItem, movingDown);\n }\n\n return nextItem;\n };\n\n componentDidLoad(): void {\n this.radioOptions = Array.from(\n this.host.querySelectorAll(\"ic-radio-option\")\n );\n\n this.radioOptions.forEach((radioOption, index) => {\n if (!radioOption.selected) {\n radioOption.selected = this.checkedValue === radioOption.value;\n }\n radioOption.name = this.name;\n radioOption.groupLabel = this.label;\n if (radioOption.selected) {\n this.selectedChild = index;\n this.checkedValue = radioOption.value;\n }\n });\n this.radioOptions[0].shadowRoot.querySelector(\"input\").tabIndex =\n this.selectedChild > 0 ? -1 : 0;\n\n onComponentRequiredPropUndefined(\n [\n { prop: this.label, propName: \"label\" },\n { prop: this.name, propName: \"name\" },\n ],\n \"Radio Group\"\n );\n }\n\n render() {\n renderHiddenInput(\n true,\n this.host,\n this.name,\n this.checkedValue,\n this.disabled\n );\n\n return (\n <Host onKeyDown={this.handleKeyDown}>\n <div\n role=\"radiogroup\"\n aria-label={`${this.label}${this.required ? \", required\" : \"\"}`}\n >\n {!this.hideLabel && (\n <ic-input-label\n class={{ [`${this.validationStatus}`]: true }}\n label={this.label}\n helperText={this.helperText}\n required={this.required}\n disabled={this.disabled}\n ></ic-input-label>\n )}\n <slot></slot>\n </div>\n {hasValidationStatus(this.validationStatus, this.disabled) && (\n <ic-input-validation\n ariaLiveMode=\"polite\"\n status={this.validationStatus}\n message={this.validationText}\n ></ic-input-validation>\n )}\n </Host>\n );\n }\n}\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"ic-card.js","mappings":";;;;;;;;;AAAA,MAAM,SAAS,GAAG,muJAAmuJ;;MC8BxuJ,IAAI;;;;;IA2EP,mBAAc,GAAG;MACvB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;KACxB,CAAC;IAEM,kBAAa,GAAG;MACtB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;KACzB,CAAC;IAUM,mBAAc,GAAG;MACvB,IAAI,CAAC,YAAY,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC;KACxC,CAAC;qBAvF6C,KAAK;;oBAQxB,EAAE;;;;;;mBAwBH,EAAE;oBAIA,KAAK;qBAIJ,KAAK;sBAIJ,KAAK;6BAEE,KAAK;sBAEZ,KAAK;oBAEI,IAAI;sBAEF,SAAS;wBAElB,KAAK;;EAGtC,eAAe,CAAC,KAAY;IAC1B,IAAI,IAAI,CAAC,QAAQ,EAAE;MACjB,KAAK,CAAC,wBAAwB,EAAE,CAAC;KAClC;GACF;EAGD,kBAAkB,CAAC,EAAe;IAChC,MAAM,KAAK,GAAY,EAAE,CAAC,MAAM,CAAC;IACjC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,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,YAAY;OAC9C,EACD,OAAO,EAAC,MAAM,EACd,cAAc,sBACH,wBAAwB,mBACpB,IAAI,CAAC,YAAY,mBAClB,uBAAuB,EACrC,OAAO,EAAE,IAAI,CAAC,cAAc,EAC5B,SAAS,EAAE,WAAW,GACX,CACd,CACG,CACP,EACA,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,kBAAkB,CAAC,IAAI,IAAI,CAAC,YAAY,KAC3D,WAAK,KAAK,EAAC,kBAAkB,EAAC,EAAE,EAAC,uBAAuB,IACtD,YAAM,IAAI,EAAC,kBAAkB,GAAQ,CACjC,CACP,CACS,EACZ;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/ic-card/ic-card.css?tag=ic-card&encapsulation=shadow","./src/components/ic-card/ic-card.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: flex;\n}\n\na {\n text-decoration: none !important;\n color: var(--ic-architechtural-black) !important;\n}\n\nbutton {\n border: none;\n background-color: transparent;\n outline: var(--ic-hc-focus-outline);\n}\n\n.card,\n.card.clickable {\n border: 1px solid var(--ic-architectural-300);\n border-radius: var(--ic-border-radius);\n box-sizing: border-box;\n padding: var(--ic-space-md);\n text-align: left;\n color: var(--ic-architechtural-black);\n transition: var(--ic-easing-transition-fast);\n}\n\n.dark.card,\n.dark.card.clickable {\n border: 1px solid var(--ic-architectural-700);\n}\n\n.card.clickable:hover {\n background-color: var(--ic-action-default-bg-hover);\n border-color: var(--ic-action-default-hover);\n cursor: pointer;\n}\n\n.card.clickable:focus,\n.card.clickable.focussed {\n background-color: var(--ic-action-default-bg-hover);\n box-shadow: var(--ic-border-focus);\n outline: var(--ic-hc-focus-outline);\n}\n\n.card.clickable:active {\n background-color: var(--ic-action-default-bg-active);\n box-shadow: var(--ic-border-focus);\n}\n\n.card.disabled {\n border: var(--ic-border-disabled);\n}\n\n.card.fullwidth,\n:host([full-width=\"true\"]) {\n width: 100%;\n}\n\n.card-header {\n display: flex;\n align-items: center;\n}\n\n.icon {\n display: flex;\n align-items: center;\n padding-right: var(--ic-space-xs);\n}\n\n.card.disabled ::slotted(svg) {\n fill: var(--ic-color-tertiary-text);\n}\n\n.card.clickable .card-title {\n color: var(--ic-hyperlink);\n text-decoration: underline;\n text-decoration-thickness: 1px;\n}\n\n.card.clickable:hover .card-title,\n.card.clickable:focus .card-title,\n.card.clickable.focussed .card-title {\n text-decoration-thickness: 25%;\n text-underline-offset: 25%;\n}\n\n.card.clickable:active .card-title {\n text-decoration: none;\n}\n\n.card.disabled .card-title {\n text-decoration: underline;\n text-decoration-thickness: 1px;\n text-decoration-color: var(--ic-color-tertiary-text);\n color: var(--ic-color-tertiary-text);\n}\n\n.subheading {\n margin-top: var(--ic-space-xxs);\n}\n\n.adornment {\n margin-top: var(--ic-space-xxs);\n}\n\n.card-message {\n margin-top: var(--ic-space-md);\n align-items: left;\n}\n\n.card.disabled .card-message,\n.card.disabled .subheading {\n color: var(--ic-color-tertiary-text);\n}\n\n.interaction-button {\n margin-left: auto;\n}\n\n.image-top {\n margin-bottom: var(--ic-space-md);\n display: flex;\n justify-content: center;\n}\n\n.image-mid {\n margin-top: var(--ic-space-md);\n display: flex;\n justify-content: center;\n}\n\n.interaction-controls {\n margin-top: var(--ic-space-md);\n display: flex;\n align-items: center;\n}\n\n.toggle-button {\n margin-left: auto;\n}\n\n.toggle-button-closed svg {\n transform: rotate(90deg);\n}\n\n.toggle-button-expanded svg {\n transform: rotate(-90deg);\n}\n\n.expanded-content {\n margin-top: var(--ic-space-md);\n}\n","import { Component, Element, Listen, Prop, State, h } from \"@stencil/core\";\nimport {\n onComponentRequiredPropUndefined,\n isSlotUsed,\n getThemeFromContext,\n} from \"../../utils/helpers\";\nimport {\n IcTheme,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\nimport chevronIcon from \"../../assets/chevron-icon.svg\";\n\n/**\n * @slot heading - Content will be placed at the top of the card to the right of the icon.\n * @slot message - Content will be placed in the main body of the card.\n * @slot subheading - Content will be placed below the card heading.\n * @slot adornment - Content will be placed below the card subheading.\n * @slot image-top - Content will be placed at the top of the card above all other content.\n * @slot image-mid - Content will be placed below the card heading section.\n * @slot icon - Content will be placed to the left of the card heading.\n * @slot interaction-button - Content will be placed in the top right corner of the heading section.\n * @slot interaction-controls - Content will be placed below the card message.\n * @slot expanded-content - Content will be placed below the interaction controls but will not initially be rendered.\n */\n@Component({\n tag: \"ic-card\",\n styleUrl: \"ic-card.css\",\n shadow: true,\n})\nexport class Card {\n @Element() el: HTMLIcCardElement;\n\n /**\n * If `true`, the card will be a clickable variant, instead of static.\n */\n @Prop({ mutable: true }) clickable?: boolean = false;\n /**\n * The URL that the clickable card link points to.\n */\n @Prop() href?: string | undefined;\n /**\n * The human language of the linked URL.\n */\n @Prop() hreflang?: string = \"\";\n /**\n * How much of the referrer to send when following the link.\n */\n @Prop() referrerpolicy?: ReferrerPolicy;\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n @Prop() rel?: string;\n /**\n * The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe).\n */\n @Prop() target?: string;\n /**\n * The heading for the card.\n */\n @Prop() heading!: string;\n /**\n * The subheading for the card.\n */\n @Prop() subheading?: string;\n /**\n * The main body message of the card.\n */\n @Prop() message?: string = \"\";\n /**\n * If `true`, the card will be disabled if it is clickable.\n */\n @Prop() disabled?: boolean = false;\n /**\n * If `true`, the card will fill the width of the container.\n */\n @Prop() fullWidth?: boolean = false;\n /**\n * If `true`, the card will have an expandable area and expansion toggle button.\n */\n @Prop() expandable?: boolean = false;\n\n @State() parentIsAnchorTag: boolean = false;\n\n @State() isFocussed: boolean = false;\n\n @State() parentEl: HTMLElement | null = null;\n\n @State() appearance?: IcThemeForeground = \"default\";\n\n @State() areaExpanded: boolean = false;\n\n @Listen(\"click\", { capture: true })\n handleHostClick(event: Event): void {\n if (this.disabled) {\n event.stopImmediatePropagation();\n }\n }\n\n @Listen(\"themeChange\", { target: \"document\" })\n themeChangeHandler(ev: CustomEvent): void {\n const theme: IcTheme = ev.detail;\n this.updateTheme(theme.mode);\n }\n\n private parentFocussed = (): void => {\n this.isFocussed = true;\n };\n\n private parentBlurred = (): void => {\n this.isFocussed = false;\n };\n\n private updateTheme(newTheme: IcThemeForeground = null): void {\n const foregroundColor = getThemeFromContext(this.el, newTheme || null);\n\n if (foregroundColor !== IcThemeForegroundEnum.Default) {\n this.appearance = foregroundColor;\n }\n }\n\n private toggleExpanded = (): void => {\n this.areaExpanded = !this.areaExpanded;\n };\n\n componentWillLoad(): void {\n this.parentEl = this.el.parentElement;\n\n if (this.parentEl.tagName === \"A\") {\n this.clickable = true;\n this.parentIsAnchorTag = true;\n this.parentEl.classList.add(\"ic-card-wrapper-link\");\n this.parentEl.addEventListener(\"focus\", this.parentFocussed);\n this.parentEl.addEventListener(\"blur\", this.parentBlurred);\n }\n }\n\n disconnectedCallback(): void {\n if (this.parentIsAnchorTag) {\n this.parentEl.removeEventListener(\"focus\", this.parentFocussed);\n this.parentEl.removeEventListener(\"blur\", this.parentBlurred);\n }\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.heading, propName: \"heading\" }],\n \"Card\"\n );\n this.updateTheme();\n }\n\n render() {\n const {\n clickable,\n disabled,\n expandable,\n heading,\n message,\n href,\n hreflang,\n referrerpolicy,\n rel,\n subheading,\n target,\n fullWidth,\n parentIsAnchorTag,\n isFocussed,\n } = this;\n\n const Component = parentIsAnchorTag\n ? \"div\"\n : clickable\n ? this.href === undefined\n ? \"button\"\n : \"a\"\n : \"div\";\n\n const attrs = Component == \"a\" && {\n href: href,\n hrefLang: hreflang,\n referrerPolicy: referrerpolicy,\n rel: rel,\n target: target,\n };\n\n return (\n <Component\n class={{\n [\"card\"]: true,\n [\"clickable\"]: clickable && !disabled,\n [\"disabled\"]: disabled,\n [\"fullwidth\"]: fullWidth,\n [\"focussed\"]: isFocussed,\n [\"dark\"]: this.appearance === IcThemeForegroundEnum.Dark,\n }}\n tabindex={clickable && !parentIsAnchorTag ? 0 : null}\n aria-disabled={disabled ? \"true\" : null}\n disabled={disabled ? true : null}\n {...attrs}\n >\n {isSlotUsed(this.el, \"image-top\") && (\n <div class=\"image-top\">\n <slot name=\"image-top\"></slot>\n </div>\n )}\n <div class=\"card-header\">\n {isSlotUsed(this.el, \"icon\") && (\n <div class=\"icon\">\n <slot name=\"icon\" />\n </div>\n )}\n <div class=\"card-title\">\n <slot name=\"heading\">\n <ic-typography variant=\"h4\">\n <p>{heading}</p>\n </ic-typography>\n </slot>\n </div>\n {isSlotUsed(this.el, \"interaction-button\") && (\n <div class=\"interaction-button\">\n <slot name=\"interaction-button\"></slot>\n </div>\n )}\n </div>\n {(subheading || isSlotUsed(this.el, \"subheading\")) && (\n <div class=\"subheading\">\n <slot name=\"subheading\">\n <ic-typography variant=\"subtitle-small\">\n {subheading}\n </ic-typography>\n </slot>\n </div>\n )}\n {isSlotUsed(this.el, \"adornment\") && (\n <div class=\"adornment\">\n <slot name=\"adornment\"></slot>\n </div>\n )}\n {isSlotUsed(this.el, \"image-mid\") && (\n <div class=\"image-mid\">\n <slot name=\"image-mid\"></slot>\n </div>\n )}\n {(message || isSlotUsed(this.el, \"message\")) && (\n <div\n class={{\n [\"card-message\"]: true,\n }}\n >\n <slot name=\"message\">\n <ic-typography variant=\"body\">{message}</ic-typography>\n </slot>\n </div>\n )}\n {(isSlotUsed(this.el, \"interaction-controls\") || expandable) && (\n <div class=\"interaction-controls\">\n <slot name=\"interaction-controls\"></slot>\n {expandable && (\n <ic-button\n class={{\n [\"toggle-button\"]: true,\n [\"toggle-button-closed\"]: !this.areaExpanded,\n [\"toggle-button-expanded\"]: this.areaExpanded,\n }}\n variant=\"icon\"\n disableTooltip\n aria-label=\"Toggle expandable area\"\n aria-expanded={this.areaExpanded}\n aria-controls=\"expanded-content-area\"\n onClick={this.toggleExpanded}\n innerHTML={chevronIcon}\n ></ic-button>\n )}\n </div>\n )}\n {isSlotUsed(this.el, \"expanded-content\") && this.areaExpanded && (\n <div class=\"expanded-content\" id=\"expanded-content-area\">\n <slot name=\"expanded-content\"></slot>\n </div>\n )}\n </Component>\n );\n }\n}\n"],"version":3}
|
1
|
+
{"file":"ic-card.js","mappings":";;;;;;;;;AAAA,MAAM,SAAS,GAAG,muJAAmuJ;;MC8BxuJ,IAAI;;;;;IA2EP,mBAAc,GAAG;MACvB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;KACxB,CAAC;IAEM,kBAAa,GAAG;MACtB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;KACzB,CAAC;IAUM,mBAAc,GAAG;MACvB,IAAI,CAAC,YAAY,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC;KACxC,CAAC;qBAvF6C,KAAK;;oBAQxB,EAAE;;;;;;mBAwBH,EAAE;oBAIA,KAAK;qBAIJ,KAAK;sBAIJ,KAAK;6BAEE,KAAK;sBAEZ,KAAK;oBAEI,IAAI;sBAEF,SAAS;wBAElB,KAAK;;EAGtC,eAAe,CAAC,KAAY;IAC1B,IAAI,IAAI,CAAC,QAAQ,EAAE;MACjB,KAAK,CAAC,wBAAwB,EAAE,CAAC;KAClC;GACF;EAGD,kBAAkB,CAAC,EAAe;IAChC,MAAM,KAAK,GAAY,EAAE,CAAC,MAAM,CAAC;IACjC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;GAC9B;EAUO,WAAW,CAAC,WAA8B,IAAI;IACpD,MAAM,eAAe,GAAG,mBAAmB,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,IAAI,IAAI,CAAC,CAAC;IAEvE,IAAI,eAAe,KAAK,qBAAqB,CAAC,OAAO,EAAE;MACrD,IAAI,CAAC,UAAU,GAAG,eAAe,CAAC;KACnC;GACF;EAMD,iBAAiB;IACf,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC;IAEtC,IAAI,I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AAkB,GAAQ,CACjC,CACP,CACS,EACZ;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/ic-card/ic-card.css?tag=ic-card&encapsulation=shadow","./src/components/ic-card/ic-card.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: flex;\n}\n\na {\n text-decoration: none !important;\n color: var(--ic-architechtural-black) !important;\n}\n\nbutton {\n border: none;\n background-color: transparent;\n outline: var(--ic-hc-focus-outline);\n}\n\n.card,\n.card.clickable {\n border: 1px solid var(--ic-architectural-300);\n border-radius: var(--ic-border-radius);\n box-sizing: border-box;\n padding: var(--ic-space-md);\n text-align: left;\n color: var(--ic-architechtural-black);\n transition: var(--ic-easing-transition-fast);\n}\n\n.dark.card,\n.dark.card.clickable {\n border: 1px solid var(--ic-architectural-700);\n}\n\n.card.clickable:hover {\n background-color: var(--ic-action-default-bg-hover);\n border-color: var(--ic-action-default-hover);\n cursor: pointer;\n}\n\n.card.clickable:focus,\n.card.clickable.focussed {\n background-color: var(--ic-action-default-bg-hover);\n box-shadow: var(--ic-border-focus);\n outline: var(--ic-hc-focus-outline);\n}\n\n.card.clickable:active {\n background-color: var(--ic-action-default-bg-active);\n box-shadow: var(--ic-border-focus);\n}\n\n.card.disabled {\n border: var(--ic-border-disabled);\n}\n\n.card.fullwidth,\n:host([full-width=\"true\"]) {\n width: 100%;\n}\n\n.card-header {\n display: flex;\n align-items: center;\n}\n\n.icon {\n display: flex;\n align-items: center;\n padding-right: var(--ic-space-xs);\n}\n\n.card.disabled ::slotted(svg) {\n fill: var(--ic-color-tertiary-text);\n}\n\n.card.clickable .card-title {\n color: var(--ic-hyperlink);\n text-decoration: underline;\n text-decoration-thickness: 1px;\n}\n\n.card.clickable:hover .card-title,\n.card.clickable:focus .card-title,\n.card.clickable.focussed .card-title {\n text-decoration-thickness: 25%;\n text-underline-offset: 25%;\n}\n\n.card.clickable:active .card-title {\n text-decoration: none;\n}\n\n.card.disabled .card-title {\n text-decoration: underline;\n text-decoration-thickness: 1px;\n text-decoration-color: var(--ic-color-tertiary-text);\n color: var(--ic-color-tertiary-text);\n}\n\n.subheading {\n margin-top: var(--ic-space-xxs);\n}\n\n.adornment {\n margin-top: var(--ic-space-xxs);\n}\n\n.card-message {\n margin-top: var(--ic-space-md);\n align-items: left;\n}\n\n.card.disabled .card-message,\n.card.disabled .subheading {\n color: var(--ic-color-tertiary-text);\n}\n\n.interaction-button {\n margin-left: auto;\n}\n\n.image-top {\n margin-bottom: var(--ic-space-md);\n display: flex;\n justify-content: center;\n}\n\n.image-mid {\n margin-top: var(--ic-space-md);\n display: flex;\n justify-content: center;\n}\n\n.interaction-controls {\n margin-top: var(--ic-space-md);\n display: flex;\n align-items: center;\n}\n\n.toggle-button {\n margin-left: auto;\n}\n\n.toggle-button-closed svg {\n transform: rotate(90deg);\n}\n\n.toggle-button-expanded svg {\n transform: rotate(-90deg);\n}\n\n.expanded-content {\n margin-top: var(--ic-space-md);\n}\n","import { Component, Element, Listen, Prop, State, h } from \"@stencil/core\";\nimport {\n onComponentRequiredPropUndefined,\n isSlotUsed,\n getThemeFromContext,\n} from \"../../utils/helpers\";\nimport {\n IcTheme,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\nimport chevronIcon from \"../../assets/chevron-icon.svg\";\n\n/**\n * @slot heading - Content will be placed at the top of the card to the right of the icon.\n * @slot message - Content will be placed in the main body of the card.\n * @slot subheading - Content will be placed below the card heading.\n * @slot adornment - Content will be placed below the card subheading.\n * @slot image-top - Content will be placed at the top of the card above all other content.\n * @slot image-mid - Content will be placed below the card heading section.\n * @slot icon - Content will be placed to the left of the card heading.\n * @slot interaction-button - Content will be placed in the top right corner of the heading section.\n * @slot interaction-controls - Content will be placed below the card message.\n * @slot expanded-content - Content will be placed below the interaction controls but will not initially be rendered.\n */\n@Component({\n tag: \"ic-card\",\n styleUrl: \"ic-card.css\",\n shadow: true,\n})\nexport class Card {\n @Element() el: HTMLIcCardElement;\n\n /**\n * If `true`, the card will be a clickable variant, instead of static.\n */\n @Prop({ mutable: true }) clickable?: boolean = false;\n /**\n * The URL that the clickable card link points to. If set, the clickable card will render as an \"a\" tag, otherwise it will render as a button.\n */\n @Prop() href?: string | undefined;\n /**\n * The human language of the linked URL.\n */\n @Prop() hreflang?: string = \"\";\n /**\n * How much of the referrer to send when following the link.\n */\n @Prop() referrerpolicy?: ReferrerPolicy;\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n @Prop() rel?: string;\n /**\n * The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe).\n */\n @Prop() target?: string;\n /**\n * The heading for the card.\n */\n @Prop() heading!: string;\n /**\n * The subheading for the card.\n */\n @Prop() subheading?: string;\n /**\n * The main body message of the card.\n */\n @Prop() message?: string = \"\";\n /**\n * If `true`, the card will be disabled if it is clickable.\n */\n @Prop() disabled?: boolean = false;\n /**\n * If `true`, the card will fill the width of the container.\n */\n @Prop() fullWidth?: boolean = false;\n /**\n * If `true`, the card will have an expandable area and expansion toggle button.\n */\n @Prop() expandable?: boolean = false;\n\n @State() parentIsAnchorTag: boolean = false;\n\n @State() isFocussed: boolean = false;\n\n @State() parentEl: HTMLElement | null = null;\n\n @State() appearance?: IcThemeForeground = \"default\";\n\n @State() areaExpanded: boolean = false;\n\n @Listen(\"click\", { capture: true })\n handleHostClick(event: Event): void {\n if (this.disabled) {\n event.stopImmediatePropagation();\n }\n }\n\n @Listen(\"themeChange\", { target: \"document\" })\n themeChangeHandler(ev: CustomEvent): void {\n const theme: IcTheme = ev.detail;\n this.updateTheme(theme.mode);\n }\n\n private parentFocussed = (): void => {\n this.isFocussed = true;\n };\n\n private parentBlurred = (): void => {\n this.isFocussed = false;\n };\n\n private updateTheme(newTheme: IcThemeForeground = null): void {\n const foregroundColor = getThemeFromContext(this.el, newTheme || null);\n\n if (foregroundColor !== IcThemeForegroundEnum.Default) {\n this.appearance = foregroundColor;\n }\n }\n\n private toggleExpanded = (): void => {\n this.areaExpanded = !this.areaExpanded;\n };\n\n componentWillLoad(): void {\n this.parentEl = this.el.parentElement;\n\n if (this.parentEl.tagName === \"A\") {\n this.clickable = true;\n this.parentIsAnchorTag = true;\n this.parentEl.classList.add(\"ic-card-wrapper-link\");\n this.parentEl.addEventListener(\"focus\", this.parentFocussed);\n this.parentEl.addEventListener(\"blur\", this.parentBlurred);\n }\n }\n\n disconnectedCallback(): void {\n if (this.parentIsAnchorTag) {\n this.parentEl.removeEventListener(\"focus\", this.parentFocussed);\n this.parentEl.removeEventListener(\"blur\", this.parentBlurred);\n }\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.heading, propName: \"heading\" }],\n \"Card\"\n );\n this.updateTheme();\n }\n\n render() {\n const {\n clickable,\n disabled,\n expandable,\n heading,\n message,\n href,\n hreflang,\n referrerpolicy,\n rel,\n subheading,\n target,\n fullWidth,\n parentIsAnchorTag,\n isFocussed,\n } = this;\n\n const Component = parentIsAnchorTag\n ? \"div\"\n : clickable\n ? this.href === undefined\n ? \"button\"\n : \"a\"\n : \"div\";\n\n const attrs = Component == \"a\" && {\n href: href,\n hrefLang: hreflang,\n referrerPolicy: referrerpolicy,\n rel: rel,\n target: target,\n };\n\n return (\n <Component\n class={{\n [\"card\"]: true,\n [\"clickable\"]: clickable && !disabled,\n [\"disabled\"]: disabled,\n [\"fullwidth\"]: fullWidth,\n [\"focussed\"]: isFocussed,\n [\"dark\"]: this.appearance === IcThemeForegroundEnum.Dark,\n }}\n tabindex={clickable && !parentIsAnchorTag ? 0 : null}\n aria-disabled={disabled ? \"true\" : null}\n disabled={disabled ? true : null}\n {...attrs}\n >\n {isSlotUsed(this.el, \"image-top\") && (\n <div class=\"image-top\">\n <slot name=\"image-top\"></slot>\n </div>\n )}\n <div class=\"card-header\">\n {isSlotUsed(this.el, \"icon\") && (\n <div class=\"icon\">\n <slot name=\"icon\" />\n </div>\n )}\n <div class=\"card-title\">\n <slot name=\"heading\">\n <ic-typography variant=\"h4\">\n <p>{heading}</p>\n </ic-typography>\n </slot>\n </div>\n {isSlotUsed(this.el, \"interaction-button\") && (\n <div class=\"interaction-button\">\n <slot name=\"interaction-button\"></slot>\n </div>\n )}\n </div>\n {(subheading || isSlotUsed(this.el, \"subheading\")) && (\n <div class=\"subheading\">\n <slot name=\"subheading\">\n <ic-typography variant=\"subtitle-small\">\n {subheading}\n </ic-typography>\n </slot>\n </div>\n )}\n {isSlotUsed(this.el, \"adornment\") && (\n <div class=\"adornment\">\n <slot name=\"adornment\"></slot>\n </div>\n )}\n {isSlotUsed(this.el, \"image-mid\") && (\n <div class=\"image-mid\">\n <slot name=\"image-mid\"></slot>\n </div>\n )}\n {(message || isSlotUsed(this.el, \"message\")) && (\n <div\n class={{\n [\"card-message\"]: true,\n }}\n >\n <slot name=\"message\">\n <ic-typography variant=\"body\">{message}</ic-typography>\n </slot>\n </div>\n )}\n {(isSlotUsed(this.el, \"interaction-controls\") || expandable) && (\n <div class=\"interaction-controls\">\n <slot name=\"interaction-controls\"></slot>\n {expandable && (\n <ic-button\n class={{\n [\"toggle-button\"]: true,\n [\"toggle-button-closed\"]: !this.areaExpanded,\n [\"toggle-button-expanded\"]: this.areaExpanded,\n }}\n variant=\"icon\"\n disableTooltip\n aria-label=\"Toggle expandable area\"\n aria-expanded={this.areaExpanded}\n aria-controls=\"expanded-content-area\"\n onClick={this.toggleExpanded}\n innerHTML={chevronIcon}\n ></ic-button>\n )}\n </div>\n )}\n {isSlotUsed(this.el, \"expanded-content\") && this.areaExpanded && (\n <div class=\"expanded-content\" id=\"expanded-content-area\">\n <slot name=\"expanded-content\"></slot>\n </div>\n )}\n </Component>\n );\n }\n}\n"],"version":3}
|
@@ -16,8 +16,10 @@ const Chip = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
16
16
|
this.__registerHost();
|
17
17
|
this.__attachShadow();
|
18
18
|
this.dismiss = createEvent(this, "dismiss", 7);
|
19
|
+
this.icDismiss = createEvent(this, "icDismiss", 7);
|
19
20
|
this.dismissAction = () => {
|
20
21
|
this.dismiss.emit();
|
22
|
+
this.icDismiss.emit();
|
21
23
|
};
|
22
24
|
this.mouseEnterHandler = () => {
|
23
25
|
this.isHovered = true;
|
@@ -66,7 +68,7 @@ const Chip = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
66
68
|
"disabled": [4],
|
67
69
|
"visible": [32],
|
68
70
|
"isHovered": [32]
|
69
|
-
}, [[2, "
|
71
|
+
}, [[2, "icDismiss", "handleClick"]]]);
|
70
72
|
function defineCustomElement$1() {
|
71
73
|
if (typeof customElements === "undefined") {
|
72
74
|
return;
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"ic-chip.js","mappings":";;;;;;;;;;AAAA,MAAM,SAAS,GAAG,o7IAAo7I;;MCyBz7I,IAAI
|
1
|
+
{"file":"ic-chip.js","mappings":";;;;;;;;;;AAAA,MAAM,SAAS,GAAG,o7IAAo7I;;MCyBz7I,IAAI;;;;;;;IA2CP,kBAAa,GAAG;MACtB,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;MACpB,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;KACvB,CAAC;IAEM,sBAAiB,GAAG;MAC1B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;KACvB,CAAC;IAEM,sBAAiB,GAAG;MAC1B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;KACxB,CAAC;;sBA5CsC,QAAQ;gBAInB,SAAS;uBAIN,KAAK;oBAIR,KAAK;mBAEN,IAAI;qBAEF,KAAK;;EAGnC,WAAW;IACT,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;GAC9B;EAyBD,gBAAgB;;IACd,IAAI,CAAC,WAAW;OACd,MAAA,IAAI,CAAC,EAAE,CAAC,UAAU;SACf,aAAa,CAAC,uBAAuB,CAAC,0CACrC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/ic-chip/ic-chip.css?tag=ic-chip&encapsulation=shadow","./src/components/ic-chip/ic-chip.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: inline-block;\n}\n\n.chip {\n display: flex;\n padding: var(--ic-space-xxs);\n font-size: 14px;\n border-radius: 80px;\n text-align: center;\n align-items: center;\n text-decoration: none;\n transition: var(--ic-easing-transition-fast);\n position: relative;\n}\n\n.chip.small {\n padding: var(--ic-space-xxxs);\n}\n\n.chip.large {\n padding: var(--ic-space-xs);\n}\n\n.label {\n padding: 0 var(--ic-space-xs);\n}\n\n.chip.hovered:not(:focus-within) {\n background-color: var(--ic-architectural-300);\n}\n\n.chip:focus-within {\n box-shadow: var(--ic-border-focus);\n outline: var(--ic-hc-focus-outline);\n z-index: 1;\n}\n\n.chip.outline.hovered:not(:focus-within) {\n background-color: var(--ic-action-dark-bg-hover);\n}\n\nic-tooltip:focus-within {\n z-index: 1;\n}\n\n.filled {\n background-color: var(--ic-architectural-200);\n color: black;\n border: none;\n}\n\n.filled.disabled {\n background-color: var(--ic-architectural-100);\n}\n\n.outline {\n color: var(--ic-architectural-900);\n border: 1px solid var(--ic-architectural-900);\n padding: calc(var(--ic-space-xxs) - 1px);\n}\n\n.outline.small {\n padding: calc(var(--ic-space-xxxs) - 1px);\n}\n\n.outline.large {\n padding: calc(var(--ic-space-xs) - 1px);\n}\n\n.outline.disabled {\n border: var(--ic-border-disabled);\n background: none;\n}\n\n.chip.disabled ic-typography {\n color: var(--ic-architectural-200);\n}\n\n.dismiss-icon {\n border: none;\n border-radius: 50%;\n padding: 0;\n background: none;\n cursor: pointer;\n margin: var(--ic-space-xxxs);\n height: 20px;\n}\n\n.dismiss-icon:focus {\n outline: var(--ic-hc-focus-outline);\n}\n\n.dismiss-icon[disabled] {\n pointer-events: none;\n color: var(--ic-architectural-200);\n}\n\n.icon {\n padding: var(--ic-space-xxxs);\n box-sizing: border-box;\n}\n\n.icon,\nic-tooltip {\n width: var(--ic-space-lg);\n height: var(--ic-space-lg);\n}\n\n.chip.disabled path,\n.chip.disabled ::slotted(svg) {\n fill: var(--ic-architectural-200);\n}\n\n@media (forced-colors: active) {\n .chip {\n border: var(--ic-hc-border);\n }\n\n .filled.small {\n padding: calc(var(--ic-space-xxxs) - 1px);\n }\n\n .filled {\n padding: calc(var(--ic-space-xxxs) + 1px);\n }\n\n .filled.large {\n padding: calc(var(--ic-space-xs) - 1px);\n }\n\n .chip.disabled {\n appearance: none;\n border-color: GrayText;\n }\n\n .chip.disabled ic-typography {\n color: GrayText;\n }\n\n .chip.disabled path,\n .chip.disabled ::slotted(svg) {\n fill: GrayText;\n }\n\n .chip:focus-within {\n outline: none;\n border-color: Highlight;\n }\n}\n","import {\n Component,\n h,\n Prop,\n State,\n Listen,\n Event,\n EventEmitter,\n Element,\n} from \"@stencil/core\";\nimport {\n onComponentRequiredPropUndefined,\n isSlotUsed,\n} from \"../../utils/helpers\";\nimport { IcChipAppearance, IcChipSizes } from \"./ic-chip.types\";\nimport dismissIcon from \"../../assets/dismiss-icon.svg\";\n\n/**\n * @slot icon - Content will be rendered at the start of the chip.\n */\n@Component({\n tag: \"ic-chip\",\n styleUrl: \"ic-chip.css\",\n shadow: true,\n})\nexport class Chip {\n @Element() el: HTMLIcChipElement;\n\n /**\n * The text rendered within the chip.\n */\n @Prop() label!: string;\n /**\n * The emphasis of the chip.\n */\n @Prop() appearance?: IcChipAppearance = \"filled\";\n /**\n * The size of the chip.\n */\n @Prop() size?: IcChipSizes = \"default\";\n /**\n * If `true`, the chip will have a close button at the end to dismiss it.\n */\n @Prop() dismissible?: boolean = false;\n /**\n * If `true`, the chip will appear disabled.\n */\n @Prop() disabled?: boolean = false;\n\n @State() visible: boolean = true;\n\n @State() isHovered: boolean = false;\n\n @Listen(\"icDismiss\", { capture: true })\n handleClick(): void {\n this.visible = !this.visible;\n }\n\n /**\n * @deprecated This event should not be used anymore. Use icDismiss instead.\n */\n @Event() dismiss: EventEmitter<void>;\n\n /**\n * Is emitted when the user dismisses the chip.\n */\n @Event() icDismiss: EventEmitter<void>;\n\n private dismissAction = (): void => {\n this.dismiss.emit();\n this.icDismiss.emit();\n };\n\n private mouseEnterHandler = (): void => {\n this.isHovered = true;\n };\n\n private mouseLeaveHandler = (): void => {\n this.isHovered = false;\n };\n\n componentDidLoad(): void {\n this.dismissible &&\n this.el.shadowRoot\n .querySelector(\"span.ic-tooltip-label\")\n ?.setAttribute(\"aria-hidden\", \"true\");\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Chip\"\n );\n }\n\n render() {\n const {\n label,\n appearance,\n size,\n dismissible,\n visible,\n disabled,\n isHovered,\n } = this;\n\n return (\n visible && (\n <div\n class={{\n [\"chip\"]: true,\n [`${appearance}`]: true,\n [`${size}`]: true,\n [\"disabled\"]: disabled,\n [\"dismissible\"]: dismissible,\n [\"hovered\"]: isHovered,\n }}\n >\n {isSlotUsed(this.el, \"icon\") && (\n <div class=\"icon\">\n <slot name=\"icon\" />\n </div>\n )}\n <ic-typography\n variant=\"label\"\n apply-vertical-margins={false}\n class=\"label\"\n >\n <span>{label}</span>\n </ic-typography>\n {dismissible && (\n <ic-tooltip\n label=\"Dismiss\"\n target=\"dismiss-icon\"\n class={{ [\"tooltip-disabled\"]: disabled }}\n >\n <button\n id=\"dismiss-icon\"\n class={{\n [\"dismiss-icon\"]: true,\n }}\n aria-label={`Dismiss ${label} chip`}\n disabled={disabled}\n tabindex={disabled ? -1 : 0}\n onClick={this.dismissAction}\n onMouseEnter={this.mouseEnterHandler}\n onMouseLeave={this.mouseLeaveHandler}\n innerHTML={dismissIcon}\n ></button>\n </ic-tooltip>\n )}\n </div>\n )\n );\n }\n}\n"],"version":3}
|
@@ -91,9 +91,8 @@ const RadioGroup = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
91
91
|
], "Radio Group");
|
92
92
|
}
|
93
93
|
render() {
|
94
|
-
const hadValidationStatus = hasValidationStatus(this.validationStatus, this.disabled);
|
95
94
|
renderHiddenInput(true, this.host, this.name, this.checkedValue, this.disabled);
|
96
|
-
return (h(Host, { onKeyDown: this.handleKeyDown }, h("div", { role: "radiogroup", "aria-label": `${this.label}${this.required ? ", required" : ""}` }, !this.hideLabel && (h("ic-input-label", { class: { [`${this.validationStatus}`]: true }, label: this.label, helperText: this.helperText, required: this.required, disabled: this.disabled })), h("slot", null)), h("ic-input-validation", { ariaLiveMode: "polite", status:
|
95
|
+
return (h(Host, { onKeyDown: this.handleKeyDown }, h("div", { role: "radiogroup", "aria-label": `${this.label}${this.required ? ", required" : ""}` }, !this.hideLabel && (h("ic-input-label", { class: { [`${this.validationStatus}`]: true }, label: this.label, helperText: this.helperText, required: this.required, disabled: this.disabled })), h("slot", null)), hasValidationStatus(this.validationStatus, this.disabled) && (h("ic-input-validation", { ariaLiveMode: "polite", status: this.validationStatus, message: this.validationText }))));
|
97
96
|
}
|
98
97
|
get host() { return this; }
|
99
98
|
static get style() { return icRadioGroupCss; }
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"ic-radio-group.js","mappings":";;;;;;AAAA,MAAM,eAAe,GAAG,qgFAAqgF;;MCwBhhF,UAAU;;;;;;IA2Eb,kBAAa,GAAG,CAAC,KAAoB;MAC3C,QAAQ,KAAK,CAAC,GAAG;QACf,KAAK,WAAW,CAAC;QACjB,KAAK,YAAY;UACf,IAAI,CAAC,YAAY,CACf,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CACnD,CAAC,QAAQ,GAAG,IAAI,CAAC;UAClB,KAAK,CAAC,cAAc,EAAE,CAAC;UACvB,MAAM;QACR,KAAK,SAAS,CAAC;QACf,KAAK,WAAW;UACd,IAAI,CAAC,YAAY,CACf,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,CACpD,CAAC,QAAQ,GAAG,IAAI,CAAC;UA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E,IAAI,CAAC,gBAAgB,EAC7B,OAAO,EAAE,IAAI,CAAC,cAAc,GACP,CACxB,CACI,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/ic-radio-group/ic-radio-group.css?tag=ic-radio-group&encapsulation=shadow","./src/components/ic-radio-group/ic-radio-group.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: block;\n}\n\nic-input-label.error {\n color: var(--ic-status-error);\n}\n\nic-input-label ic-typography {\n margin-bottom: var(--ic-space-sm);\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n State,\n Listen,\n Element,\n Event,\n EventEmitter,\n} from \"@stencil/core\";\nimport {\n hasValidationStatus,\n onComponentRequiredPropUndefined,\n renderHiddenInput,\n} from \"../../utils/helpers\";\nimport { IcInformationStatusOrEmpty } from \"../../utils/types\";\nimport { IcValueEventDetail } from \"../../interface\";\n\n@Component({\n tag: \"ic-radio-group\",\n styleUrl: \"ic-radio-group.css\",\n shadow: true,\n})\nexport class RadioGroup {\n private radioOptions: HTMLIcRadioOptionElement[];\n\n @Element() host: HTMLIcRadioGroupElement;\n\n /**\n * The label for the radio group to be displayed.\n */\n @Prop() label!: string;\n\n /**\n * The name for the radio group to differentiate from other groups.\n */\n @Prop() name!: string;\n\n /**\n * If `true`, the radio group will require a value.\n */\n @Prop() required: boolean = false;\n\n /**\n * If `true`, the label will be hidden and the required label value will be applied as an aria-label.\n */\n @Prop() hideLabel: boolean = false;\n\n /**\n * If `true`, the disabled state will be set.\n */\n @Prop() disabled: boolean = false;\n\n /**\n * The helper text that will be displayed for additional field guidance.\n */\n @Prop() helperText: string;\n\n /**\n * If `true`, the small styling will be applied to the radio group.\n */\n @Prop() small: boolean = false;\n /**\n * The validation status - e.g. 'error' | 'warning' | 'success'.\n */\n @Prop() validationStatus: IcInformationStatusOrEmpty = \"\";\n /**\n * The validation text - e.g. 'error' | 'warning' | 'success'.\n */\n @Prop() validationText: string = \"\";\n /**\n * The checked state.\n */\n @State() checkedValue: string = \"\";\n @State() selectedChild: number = -1;\n\n /**\n * Emitted when a user selects a radio.\n */\n @Event() icChange: EventEmitter<IcValueEventDetail>;\n\n @Listen(\"icCheck\")\n selectHandler(event: CustomEvent<IcValueEventDetail>): void {\n this.checkedValue = event.detail.value;\n this.icChange.emit({ value: this.checkedValue });\n\n if (this.radioOptions !== undefined) {\n this.radioOptions.forEach((radioOption, index) => {\n radioOption.selected = this.checkedValue === radioOption.value;\n if (radioOption.selected) {\n this.selectedChild = index;\n }\n });\n this.radioOptions[0].shadowRoot.querySelector(\"input\").tabIndex =\n this.selectedChild > 0 ? -1 : 0;\n }\n }\n\n private handleKeyDown = (event: KeyboardEvent): void => {\n switch (event.key) {\n case \"ArrowDown\":\n case \"ArrowRight\":\n this.radioOptions[\n this.getNextItemToSelect(this.selectedChild, true)\n ].selected = true;\n event.preventDefault();\n break;\n case \"ArrowUp\":\n case \"ArrowLeft\":\n this.radioOptions[\n this.getNextItemToSelect(this.selectedChild, false)\n ].selected = true;\n event.preventDefault();\n }\n };\n\n private getNextItemToSelect = (\n currentItem: number,\n movingDown: boolean\n ): number => {\n const numRadios = this.radioOptions.length - 1;\n\n if (currentItem < 1) {\n currentItem = 0;\n }\n\n let nextItem = movingDown ? currentItem + 1 : currentItem - 1;\n\n //check if wrap around necessary\n if (nextItem < 0) {\n nextItem = numRadios;\n } else if (nextItem > numRadios) {\n nextItem = 0;\n }\n\n //if next item is disabled then find next\n if (this.radioOptions[nextItem].disabled) {\n nextItem = this.getNextItemToSelect(nextItem, movingDown);\n }\n\n return nextItem;\n };\n\n componentDidLoad(): void {\n this.radioOptions = Array.from(\n this.host.querySelectorAll(\"ic-radio-option\")\n );\n\n this.radioOptions.forEach((radioOption, index) => {\n if (!radioOption.selected) {\n radioOption.selected = this.checkedValue === radioOption.value;\n }\n radioOption.name = this.name;\n radioOption.groupLabel = this.label;\n if (radioOption.selected) {\n this.selectedChild = index;\n this.checkedValue = radioOption.value;\n }\n });\n this.radioOptions[0].shadowRoot.querySelector(\"input\").tabIndex =\n this.selectedChild > 0 ? -1 : 0;\n\n onComponentRequiredPropUndefined(\n [\n { prop: this.label, propName: \"label\" },\n { prop: this.name, propName: \"name\" },\n ],\n \"Radio Group\"\n );\n }\n\n render() {\n renderHiddenInput(\n true,\n this.host,\n this.name,\n this.checkedValue,\n this.disabled\n );\n\n return (\n <Host onKeyDown={this.handleKeyDown}>\n <div\n role=\"radiogroup\"\n aria-label={`${this.label}${this.required ? \", required\" : \"\"}`}\n >\n {!this.hideLabel && (\n <ic-input-label\n class={{ [`${this.validationStatus}`]: true }}\n label={this.label}\n helperText={this.helperText}\n required={this.required}\n disabled={this.disabled}\n ></ic-input-label>\n )}\n <slot></slot>\n </div>\n {hasValidationStatus(this.validationStatus, this.disabled) && (\n <ic-input-validation\n ariaLiveMode=\"polite\"\n status={this.validationStatus}\n message={this.validationText}\n ></ic-input-validation>\n )}\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-a5948fc3",[[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-2ca96f69",[[1,"ic-chip",{"label":[1],"appearance":[1],"size":[1],"dismissible":[4],"disabled":[4],"visible":[32],"isHovered":[32]},[[2,"dismiss","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-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)));
|
2
2
|
//# sourceMappingURL=core.esm.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"names":["patchBrowser","importMeta","import","meta","url","opts","resourcesUrl","URL","href","promiseResolve","then","options","bootstrapLazy","JSON","parse"],"mappings":"2CAMA,MAAMA,EAAe,KA6BjB,MAAMC,EAAaC,OAAOC,KAAKC,IAC/B,MAAMC,EAA6D,GAenE,GAAuBJ,IAAe,GAAI,CACtCI,EAAKC,aAAe,IAAIC,IAAI,IAAKN,GAAYO,KAajD,OAAOC,EAAeJ,IC9D1BL,IAAeU,MAAKC,GAEXC,EAAcC,KAAAC,MAAA,
|
1
|
+
{"version":3,"sources":["node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"names":["patchBrowser","importMeta","import","meta","url","opts","resourcesUrl","URL","href","promiseResolve","then","options","bootstrapLazy","JSON","parse"],"mappings":"2CAMA,MAAMA,EAAe,KA6BjB,MAAMC,EAAaC,OAAOC,KAAKC,IAC/B,MAAMC,EAA6D,GAenE,GAAuBJ,IAAe,GAAI,CACtCI,EAAKC,aAAe,IAAIC,IAAI,IAAKN,GAAYO,KAajD,OAAOC,EAAeJ,IC9D1BL,IAAeU,MAAKC,GAEXC,EAAcC,KAAAC,MAAA,24aAAuCH","sourcesContent":["/*\n Stencil Client Patch Browser v2.20.0 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, plt, win, doc, promiseResolve, H } from '@stencil/core';\nconst getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\\s|-/g, '_')}`;\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n if (BUILD.cssVarShim) {\n // shim css vars\n plt.$cssShim$ = win.__cssshim;\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n if (BUILD.profile && !performance.mark) {\n // not all browsers support performance.mark/measure (Safari 10)\n // because the mark/measure APIs are designed to write entries to a buffer in the browser that does not exist,\n // simply stub the implementations out.\n // TODO(STENCIL-323): Remove this patch when support for older browsers is removed (breaking)\n // @ts-ignore\n performance.mark = performance.measure = () => {\n /*noop*/\n };\n performance.getEntriesByName = () => [];\n }\n // @ts-ignore\n const scriptElm = BUILD.scriptDataOpts || BUILD.safari10 || BUILD.dynamicImportShim\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? scriptElm['data-opts'] || {} : {};\n if (BUILD.safari10 && 'onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) {\n // Safari < v11 support: This IF is true if it's Safari below v11.\n // This fn cannot use async/await since Safari didn't support it until v11,\n // however, Safari 10 did support modules. Safari 10 also didn't support \"nomodule\",\n // so both the ESM file and nomodule file would get downloaded. Only Safari\n // has 'onbeforeload' in the script, and \"history.scrollRestoration\" was added\n // to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue.\n // IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds.\n return {\n then() {\n /* promise noop */\n },\n };\n }\n if (!BUILD.safari10 && importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n }\n else if (BUILD.dynamicImportShim || BUILD.safari10) {\n opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href;\n if (BUILD.dynamicImportShim) {\n patchDynamicImport(opts.resourcesUrl, scriptElm);\n }\n if (BUILD.dynamicImportShim && !win.customElements) {\n // module support, but no custom elements support (Old Edge)\n // @ts-ignore\n return import(/* webpackChunkName: \"polyfills-dom\" */ './dom.js').then(() => opts);\n }\n }\n return promiseResolve(opts);\n};\nconst patchDynamicImport = (base, orgScriptElm) => {\n const importFunctionName = getDynamicImportFunction(NAMESPACE);\n try {\n // test if this browser supports dynamic imports\n // There is a caching issue in V8, that breaks using import() in Function\n // By generating a random string, we can workaround it\n // Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info\n win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`);\n }\n catch (e) {\n // this shim is specifically for browsers that do support \"esm\" imports\n // however, they do NOT support \"dynamic\" imports\n // basically this code is for old Edge, v18 and below\n const moduleMap = new Map();\n win[importFunctionName] = (src) => {\n const url = new URL(src, base).href;\n let mod = moduleMap.get(url);\n if (!mod) {\n const script = doc.createElement('script');\n script.type = 'module';\n script.crossOrigin = orgScriptElm.crossOrigin;\n script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], {\n type: 'application/javascript',\n }));\n mod = new Promise((resolve) => {\n script.onload = () => {\n resolve(win[importFunctionName].m);\n script.remove();\n };\n });\n moduleMap.set(url, mod);\n doc.head.appendChild(script);\n }\n return mod;\n };\n }\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","import { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as t,c as e,h as i,H as s,g as o}from"./p-f9370be6.js";import{a as n,e as a,j 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}ic-input-label.error{color:var(--ic-status-error)}ic-input-label ic-typography{margin-bottom:var(--ic-space-sm)}';const h=class{constructor(i){t(this,i);this.icChange=e(this,"icChange",7);this.handleKeyDown=t=>{switch(t.key){case"ArrowDown":case"ArrowRight":this.radioOptions[this.getNextItemToSelect(this.selectedChild,true)].selected=true;t.preventDefault();break;case"ArrowUp":case"ArrowLeft":this.radioOptions[this.getNextItemToSelect(this.selectedChild,false)].selected=true;t.preventDefault()}};this.getNextItemToSelect=(t,e)=>{const i=this.radioOptions.length-1;if(t<1){t=0}let s=e?t+1:t-1;if(s<0){s=i}else if(s>i){s=0}if(this.radioOptions[s].disabled){s=this.getNextItemToSelect(s,e)}return s};this.label=undefined;this.name=undefined;this.required=false;this.hideLabel=false;this.disabled=false;this.helperText=undefined;this.small=false;this.validationStatus="";this.validationText="";this.checkedValue="";this.selectedChild=-1}selectHandler(t){this.checkedValue=t.detail.value;this.icChange.emit({value:this.checkedValue});if(this.radioOptions!==undefined){this.radioOptions.forEach(((t,e)=>{t.selected=this.checkedValue===t.value;if(t.selected){this.selectedChild=e}}));this.radioOptions[0].shadowRoot.querySelector("input").tabIndex=this.selectedChild>0?-1:0}}componentDidLoad(){this.radioOptions=Array.from(this.host.querySelectorAll("ic-radio-option"));this.radioOptions.forEach(((t,e)=>{if(!t.selected){t.selected=this.checkedValue===t.value}t.name=this.name;t.groupLabel=this.label;if(t.selected){this.selectedChild=e;this.checkedValue=t.value}}));this.radioOptions[0].shadowRoot.querySelector("input").tabIndex=this.selectedChild>0?-1:0;n([{prop:this.label,propName:"label"},{prop:this.name,propName:"name"}],"Radio Group")}render(){
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as t,c as e,h as i,H as s,g as o}from"./p-f9370be6.js";import{a as n,e as a,j 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}ic-input-label.error{color:var(--ic-status-error)}ic-input-label ic-typography{margin-bottom:var(--ic-space-sm)}';const h=class{constructor(i){t(this,i);this.icChange=e(this,"icChange",7);this.handleKeyDown=t=>{switch(t.key){case"ArrowDown":case"ArrowRight":this.radioOptions[this.getNextItemToSelect(this.selectedChild,true)].selected=true;t.preventDefault();break;case"ArrowUp":case"ArrowLeft":this.radioOptions[this.getNextItemToSelect(this.selectedChild,false)].selected=true;t.preventDefault()}};this.getNextItemToSelect=(t,e)=>{const i=this.radioOptions.length-1;if(t<1){t=0}let s=e?t+1:t-1;if(s<0){s=i}else if(s>i){s=0}if(this.radioOptions[s].disabled){s=this.getNextItemToSelect(s,e)}return s};this.label=undefined;this.name=undefined;this.required=false;this.hideLabel=false;this.disabled=false;this.helperText=undefined;this.small=false;this.validationStatus="";this.validationText="";this.checkedValue="";this.selectedChild=-1}selectHandler(t){this.checkedValue=t.detail.value;this.icChange.emit({value:this.checkedValue});if(this.radioOptions!==undefined){this.radioOptions.forEach(((t,e)=>{t.selected=this.checkedValue===t.value;if(t.selected){this.selectedChild=e}}));this.radioOptions[0].shadowRoot.querySelector("input").tabIndex=this.selectedChild>0?-1:0}}componentDidLoad(){this.radioOptions=Array.from(this.host.querySelectorAll("ic-radio-option"));this.radioOptions.forEach(((t,e)=>{if(!t.selected){t.selected=this.checkedValue===t.value}t.name=this.name;t.groupLabel=this.label;if(t.selected){this.selectedChild=e;this.checkedValue=t.value}}));this.radioOptions[0].shadowRoot.querySelector("input").tabIndex=this.selectedChild>0?-1:0;n([{prop:this.label,propName:"label"},{prop:this.name,propName:"name"}],"Radio Group")}render(){a(true,this.host,this.name,this.checkedValue,this.disabled);return i(s,{onKeyDown:this.handleKeyDown},i("div",{role:"radiogroup","aria-label":`${this.label}${this.required?", required":""}`},!this.hideLabel&&i("ic-input-label",{class:{[`${this.validationStatus}`]:true},label:this.label,helperText:this.helperText,required:this.required,disabled:this.disabled}),i("slot",null)),r(this.validationStatus,this.disabled)&&i("ic-input-validation",{ariaLiveMode:"polite",status:this.validationStatus,message:this.validationText}))}get host(){return o(this)}};h.style=l;export{h as ic_radio_group};
|
2
|
+
//# sourceMappingURL=p-01e8bd4a.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["src/components/ic-radio-group/ic-radio-group.css?tag=ic-radio-group&encapsulation=shadow","src/components/ic-radio-group/ic-radio-group.tsx"],"names":["icRadioGroupCss","RadioGroup","this","handleKeyDown","event","key","radioOptions","getNextItemToSelect","selectedChild","selected","preventDefault","currentItem","movingDown","numRadios","length","nextItem","disabled","[object Object]","checkedValue","detail","value","icChange","emit","undefined","forEach","radioOption","index","shadowRoot","querySelector","tabIndex","Array","from","host","querySelectorAll","name","groupLabel","label","onComponentRequiredPropUndefined","prop","propName","renderHiddenInput","h","Host","onKeyDown","role","aria-label","required","hideLabel","class","validationStatus","helperText","hasValidationStatus","ariaLiveMode","status","message","validationText"],"mappings":"0IAAA,MAAMA,EAAkB,8+ECwBXC,EAAU,kEA2EbC,KAAAC,cAAiBC,IACvB,OAAQA,EAAMC,KACZ,IAAK,YACL,IAAK,aACHH,KAAKI,aACHJ,KAAKK,oBAAoBL,KAAKM,cAAe,OAC7CC,SAAW,KACbL,EAAMM,iBACN,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AGqB,WAAWC,cAAc,SAASC,SACrD3B,KAAKM,cAAgB,GAAK,EAAI,EAEhC6B,EACE,CACE,CAAEC,KAAMpC,KAAKkC,MAAOG,SAAU,SAC9B,CAAED,KAAMpC,KAAKgC,KAAMK,SAAU,SAE/B,eAIJtB,SACEuB,EACE,KACAtC,KAAK8B,KACL9B,KAAKgC,KACLhC,KAAKgB,aACLhB,KAAKc,UAGP,OACEyB,EAACC,EAAI,CAACC,UAAWzC,KAAKC,eACpBsC,EAAA,MAAA,CACEG,KAAK,aAAYC,aACL,GAAG3C,KAAKkC,QAAQlC,KAAK4C,SAAW,aAAe,OAEzD5C,KAAK6C,WACLN,EAAA,iBAAA,CACEO,MAAO,CAAE/B,CAAC,GAAGf,KAAK+C,oBAAqB,MACvCb,MAAOlC,KAAKkC,MACZc,WAAYhD,KAAKgD,WACjBJ,SAAU5C,KAAK4C,SACf9B,SAAUd,KAAKc,WAGnByB,EAAA,OAAA,OAEDU,EAAoBjD,KAAK+C,iBAAkB/C,KAAKc,WAC/CyB,EAAA,sBAAA,CACEW,aAAa,SACbC,OAAQnD,KAAK+C,iBACbK,QAASpD,KAAKqD","sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: block;\n}\n\nic-input-label.error {\n color: var(--ic-status-error);\n}\n\nic-input-label ic-typography {\n margin-bottom: var(--ic-space-sm);\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n State,\n Listen,\n Element,\n Event,\n EventEmitter,\n} from \"@stencil/core\";\nimport {\n hasValidationStatus,\n onComponentRequiredPropUndefined,\n renderHiddenInput,\n} from \"../../utils/helpers\";\nimport { IcInformationStatusOrEmpty } from \"../../utils/types\";\nimport { IcValueEventDetail } from \"../../interface\";\n\n@Component({\n tag: \"ic-radio-group\",\n styleUrl: \"ic-radio-group.css\",\n shadow: true,\n})\nexport class RadioGroup {\n private radioOptions: HTMLIcRadioOptionElement[];\n\n @Element() host: HTMLIcRadioGroupElement;\n\n /**\n * The label for the radio group to be displayed.\n */\n @Prop() label!: string;\n\n /**\n * The name for the radio group to differentiate from other groups.\n */\n @Prop() name!: string;\n\n /**\n * If `true`, the radio group will require a value.\n */\n @Prop() required: boolean = false;\n\n /**\n * If `true`, the label will be hidden and the required label value will be applied as an aria-label.\n */\n @Prop() hideLabel: boolean = false;\n\n /**\n * If `true`, the disabled state will be set.\n */\n @Prop() disabled: boolean = false;\n\n /**\n * The helper text that will be displayed for additional field guidance.\n */\n @Prop() helperText: string;\n\n /**\n * If `true`, the small styling will be applied to the radio group.\n */\n @Prop() small: boolean = false;\n /**\n * The validation status - e.g. 'error' | 'warning' | 'success'.\n */\n @Prop() validationStatus: IcInformationStatusOrEmpty = \"\";\n /**\n * The validation text - e.g. 'error' | 'warning' | 'success'.\n */\n @Prop() validationText: string = \"\";\n /**\n * The checked state.\n */\n @State() checkedValue: string = \"\";\n @State() selectedChild: number = -1;\n\n /**\n * Emitted when a user selects a radio.\n */\n @Event() icChange: EventEmitter<IcValueEventDetail>;\n\n @Listen(\"icCheck\")\n selectHandler(event: CustomEvent<IcValueEventDetail>): void {\n this.checkedValue = event.detail.value;\n this.icChange.emit({ value: this.checkedValue });\n\n if (this.radioOptions !== undefined) {\n this.radioOptions.forEach((radioOption, index) => {\n radioOption.selected = this.checkedValue === radioOption.value;\n if (radioOption.selected) {\n this.selectedChild = index;\n }\n });\n this.radioOptions[0].shadowRoot.querySelector(\"input\").tabIndex =\n this.selectedChild > 0 ? -1 : 0;\n }\n }\n\n private handleKeyDown = (event: KeyboardEvent): void => {\n switch (event.key) {\n case \"ArrowDown\":\n case \"ArrowRight\":\n this.radioOptions[\n this.getNextItemToSelect(this.selectedChild, true)\n ].selected = true;\n event.preventDefault();\n break;\n case \"ArrowUp\":\n case \"ArrowLeft\":\n this.radioOptions[\n this.getNextItemToSelect(this.selectedChild, false)\n ].selected = true;\n event.preventDefault();\n }\n };\n\n private getNextItemToSelect = (\n currentItem: number,\n movingDown: boolean\n ): number => {\n const numRadios = this.radioOptions.length - 1;\n\n if (currentItem < 1) {\n currentItem = 0;\n }\n\n let nextItem = movingDown ? currentItem + 1 : currentItem - 1;\n\n //check if wrap around necessary\n if (nextItem < 0) {\n nextItem = numRadios;\n } else if (nextItem > numRadios) {\n nextItem = 0;\n }\n\n //if next item is disabled then find next\n if (this.radioOptions[nextItem].disabled) {\n nextItem = this.getNextItemToSelect(nextItem, movingDown);\n }\n\n return nextItem;\n };\n\n componentDidLoad(): void {\n this.radioOptions = Array.from(\n this.host.querySelectorAll(\"ic-radio-option\")\n );\n\n this.radioOptions.forEach((radioOption, index) => {\n if (!radioOption.selected) {\n radioOption.selected = this.checkedValue === radioOption.value;\n }\n radioOption.name = this.name;\n radioOption.groupLabel = this.label;\n if (radioOption.selected) {\n this.selectedChild = index;\n this.checkedValue = radioOption.value;\n }\n });\n this.radioOptions[0].shadowRoot.querySelector(\"input\").tabIndex =\n this.selectedChild > 0 ? -1 : 0;\n\n onComponentRequiredPropUndefined(\n [\n { prop: this.label, propName: \"label\" },\n { prop: this.name, propName: \"name\" },\n ],\n \"Radio Group\"\n );\n }\n\n render() {\n renderHiddenInput(\n true,\n this.host,\n this.name,\n this.checkedValue,\n this.disabled\n );\n\n return (\n <Host onKeyDown={this.handleKeyDown}>\n <div\n role=\"radiogroup\"\n aria-label={`${this.label}${this.required ? \", required\" : \"\"}`}\n >\n {!this.hideLabel && (\n <ic-input-label\n class={{ [`${this.validationStatus}`]: true }}\n label={this.label}\n helperText={this.helperText}\n required={this.required}\n disabled={this.disabled}\n ></ic-input-label>\n )}\n <slot></slot>\n </div>\n {hasValidationStatus(this.validationStatus, this.disabled) && (\n <ic-input-validation\n ariaLiveMode=\"polite\"\n status={this.validationStatus}\n message={this.validationText}\n ></ic-input-validation>\n )}\n </Host>\n );\n }\n}\n"]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as i,c as e,h as t,g as o}from"./p-f9370be6.js";import{a,i as s}from"./p-a8ac8f72.js";import"./p-6f57b13c.js";const n=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M10 0C4.47 0 0 4.47 0 10C0 15.53 4.47 20 10 20C15.53 20 20 15.53 20 10C20 4.47 15.53 0 10 0ZM15 13.59L13.59 15L10 11.41L6.41 15L5 13.59L8.59 10L5 6.41L6.41 5L10 8.59L13.59 5L15 6.41L11.41 10L15 13.59Z" fill="currentColor"/>\n</svg>\n`;const r='/*! 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:inline-block}.chip{display:flex;padding:var(--ic-space-xxs);font-size:14px;border-radius:80px;text-align:center;align-items:center;text-decoration:none;transition:var(--ic-easing-transition-fast);position:relative}.chip.small{padding:var(--ic-space-xxxs)}.chip.large{padding:var(--ic-space-xs)}.label{padding:0 var(--ic-space-xs)}.chip.hovered:not(:focus-within){background-color:var(--ic-architectural-300)}.chip:focus-within{box-shadow:var(--ic-border-focus);outline:var(--ic-hc-focus-outline);z-index:1}.chip.outline.hovered:not(:focus-within){background-color:var(--ic-action-dark-bg-hover)}ic-tooltip:focus-within{z-index:1}.filled{background-color:var(--ic-architectural-200);color:black;border:none}.filled.disabled{background-color:var(--ic-architectural-100)}.outline{color:var(--ic-architectural-900);border:1px solid var(--ic-architectural-900);padding:calc(var(--ic-space-xxs) - 1px)}.outline.small{padding:calc(var(--ic-space-xxxs) - 1px)}.outline.large{padding:calc(var(--ic-space-xs) - 1px)}.outline.disabled{border:var(--ic-border-disabled);background:none}.chip.disabled ic-typography{color:var(--ic-architectural-200)}.dismiss-icon{border:none;border-radius:50%;padding:0;background:none;cursor:pointer;margin:var(--ic-space-xxxs);height:20px}.dismiss-icon:focus{outline:var(--ic-hc-focus-outline)}.dismiss-icon[disabled]{pointer-events:none;color:var(--ic-architectural-200)}.icon{padding:var(--ic-space-xxxs);box-sizing:border-box}.icon,ic-tooltip{width:var(--ic-space-lg);height:var(--ic-space-lg)}.chip.disabled path,.chip.disabled ::slotted(svg){fill:var(--ic-architectural-200)}@media (forced-colors: active){.chip{border:var(--ic-hc-border)}.filled.small{padding:calc(var(--ic-space-xxxs) - 1px)}.filled{padding:calc(var(--ic-space-xxxs) + 1px)}.filled.large{padding:calc(var(--ic-space-xs) - 1px)}.chip.disabled{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-color:GrayText}.chip.disabled ic-typography{color:GrayText}.chip.disabled path,.chip.disabled ::slotted(svg){fill:GrayText}.chip:focus-within{outline:none;border-color:Highlight}}';const c=class{constructor(t){i(this,t);this.dismiss=e(this,"dismiss",7);this.dismissAction=()=>{this.dismiss.emit()};this.mouseEnterHandler=()=>{this.isHovered=true};this.mouseLeaveHandler=()=>{this.isHovered=false};this.label=undefined;this.appearance="filled";this.size="default";this.dismissible=false;this.disabled=false;this.visible=true;this.isHovered=false}handleClick(){this.visible=!this.visible}componentDidLoad(){var i;this.dismissible&&((i=this.el.shadowRoot.querySelector("span.ic-tooltip-label"))===null||i===void 0?void 0:i.setAttribute("aria-hidden","true"));a([{prop:this.label,propName:"label"}],"Chip")}render(){const{label:i,appearance:e,size:o,dismissible:a,visible:r,disabled:c,isHovered:l}=this;return r&&t("div",{class:{["chip"]:true,[`${e}`]:true,[`${o}`]:true,["disabled"]:c,["dismissible"]:a,["hovered"]:l}},s(this.el,"icon")&&t("div",{class:"icon"},t("slot",{name:"icon"})),t("ic-typography",{variant:"label","apply-vertical-margins":false,class:"label"},t("span",null,i)),a&&t("ic-tooltip",{label:"Dismiss",target:"dismiss-icon",class:{["tooltip-disabled"]:c}},t("button",{id:"dismiss-icon",class:{["dismiss-icon"]:true},"aria-label":`Dismiss ${i} chip`,disabled:c,tabindex:c?-1:0,onClick:this.dismissAction,onMouseEnter:this.mouseEnterHandler,onMouseLeave:this.mouseLeaveHandler,innerHTML:n})))}get el(){return o(this)}};c.style=r;export{c as ic_chip};
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as i,c as e,h as t,g as o}from"./p-f9370be6.js";import{a,i as s}from"./p-a8ac8f72.js";import"./p-6f57b13c.js";const n=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M10 0C4.47 0 0 4.47 0 10C0 15.53 4.47 20 10 20C15.53 20 20 15.53 20 10C20 4.47 15.53 0 10 0ZM15 13.59L13.59 15L10 11.41L6.41 15L5 13.59L8.59 10L5 6.41L6.41 5L10 8.59L13.59 5L15 6.41L11.41 10L15 13.59Z" fill="currentColor"/>\n</svg>\n`;const r='/*! 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:inline-block}.chip{display:flex;padding:var(--ic-space-xxs);font-size:14px;border-radius:80px;text-align:center;align-items:center;text-decoration:none;transition:var(--ic-easing-transition-fast);position:relative}.chip.small{padding:var(--ic-space-xxxs)}.chip.large{padding:var(--ic-space-xs)}.label{padding:0 var(--ic-space-xs)}.chip.hovered:not(:focus-within){background-color:var(--ic-architectural-300)}.chip:focus-within{box-shadow:var(--ic-border-focus);outline:var(--ic-hc-focus-outline);z-index:1}.chip.outline.hovered:not(:focus-within){background-color:var(--ic-action-dark-bg-hover)}ic-tooltip:focus-within{z-index:1}.filled{background-color:var(--ic-architectural-200);color:black;border:none}.filled.disabled{background-color:var(--ic-architectural-100)}.outline{color:var(--ic-architectural-900);border:1px solid var(--ic-architectural-900);padding:calc(var(--ic-space-xxs) - 1px)}.outline.small{padding:calc(var(--ic-space-xxxs) - 1px)}.outline.large{padding:calc(var(--ic-space-xs) - 1px)}.outline.disabled{border:var(--ic-border-disabled);background:none}.chip.disabled ic-typography{color:var(--ic-architectural-200)}.dismiss-icon{border:none;border-radius:50%;padding:0;background:none;cursor:pointer;margin:var(--ic-space-xxxs);height:20px}.dismiss-icon:focus{outline:var(--ic-hc-focus-outline)}.dismiss-icon[disabled]{pointer-events:none;color:var(--ic-architectural-200)}.icon{padding:var(--ic-space-xxxs);box-sizing:border-box}.icon,ic-tooltip{width:var(--ic-space-lg);height:var(--ic-space-lg)}.chip.disabled path,.chip.disabled ::slotted(svg){fill:var(--ic-architectural-200)}@media (forced-colors: active){.chip{border:var(--ic-hc-border)}.filled.small{padding:calc(var(--ic-space-xxxs) - 1px)}.filled{padding:calc(var(--ic-space-xxxs) + 1px)}.filled.large{padding:calc(var(--ic-space-xs) - 1px)}.chip.disabled{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-color:GrayText}.chip.disabled ic-typography{color:GrayText}.chip.disabled path,.chip.disabled ::slotted(svg){fill:GrayText}.chip:focus-within{outline:none;border-color:Highlight}}';const c=class{constructor(t){i(this,t);this.dismiss=e(this,"dismiss",7);this.icDismiss=e(this,"icDismiss",7);this.dismissAction=()=>{this.dismiss.emit();this.icDismiss.emit()};this.mouseEnterHandler=()=>{this.isHovered=true};this.mouseLeaveHandler=()=>{this.isHovered=false};this.label=undefined;this.appearance="filled";this.size="default";this.dismissible=false;this.disabled=false;this.visible=true;this.isHovered=false}handleClick(){this.visible=!this.visible}componentDidLoad(){var i;this.dismissible&&((i=this.el.shadowRoot.querySelector("span.ic-tooltip-label"))===null||i===void 0?void 0:i.setAttribute("aria-hidden","true"));a([{prop:this.label,propName:"label"}],"Chip")}render(){const{label:i,appearance:e,size:o,dismissible:a,visible:r,disabled:c,isHovered:l}=this;return r&&t("div",{class:{["chip"]:true,[`${e}`]:true,[`${o}`]:true,["disabled"]:c,["dismissible"]:a,["hovered"]:l}},s(this.el,"icon")&&t("div",{class:"icon"},t("slot",{name:"icon"})),t("ic-typography",{variant:"label","apply-vertical-margins":false,class:"label"},t("span",null,i)),a&&t("ic-tooltip",{label:"Dismiss",target:"dismiss-icon",class:{["tooltip-disabled"]:c}},t("button",{id:"dismiss-icon",class:{["dismiss-icon"]:true},"aria-label":`Dismiss ${i} chip`,disabled:c,tabindex:c?-1:0,onClick:this.dismissAction,onMouseEnter:this.mouseEnterHandler,onMouseLeave:this.mouseLeaveHandler,innerHTML:n})))}get el(){return o(this)}};c.style=r;export{c as ic_chip};
|
2
|
+
//# sourceMappingURL=p-6cb276c6.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["src/components/ic-chip/ic-chip.css?tag=ic-chip&encapsulation=shadow","src/components/ic-chip/ic-chip.tsx"],"names":["icChipCss","Chip","this","dismissAction","dismiss","emit","icDismiss","mouseEnterHandler","isHovered","mouseLeaveHandler","[object Object]","visible","dismissible","_a","el","shadowRoot","querySelector","setAttribute","onComponentRequiredPropUndefined","prop","label","propName","appearance","size","disabled","h","class","isSlotUsed","name","variant","apply-vertical-margins","target","id","aria-label","tabindex","onClick","onMouseEnter","onMouseLeave","innerHTML","dismissIcon"],"mappings":"qdAAA,MAAMA,EAAY,65ICyBLC,EAAI,qGA2CPC,KAAAC,cAAgB,KACtBD,KAAKE,QAAQC,OACbH,KAAKI,UAAUD,QAGTH,KAAAK,kBAAoB,KAC1BL,KAAKM,UAAY,MAGXN,KAAAO,kBAAoB,KAC1BP,KAAKM,UAAY,4CA3CqB,mBAIX,2BAIG,oBAIH,mBAED,oBAEE,MAG9BE,cACER,KAAKS,SAAWT,KAAKS,QA0BvBD,yBACER,KAAKU,eACHC,EAAAX,KAAKY,GAAGC,WACLC,cAAc,4BAAwB,MAAAH,SAAA,OAAA,EAAAA,EACrCI,aAAa,cAAe,SAClCC,EACE,CAAC,CAAEC,KAAMjB,KAAKkB,MAAOC,SAAU,UAC/B,QAIJX,SACE,MAAMU,MACJA,EAAKE,WACLA,EAAUC,KACVA,EAAIX,YACJA,EAAWD,QACXA,EAAOa,SACPA,EAAQhB,UACRA,GACEN,KAEJ,OACES,GACEc,EAAA,MAAA,CACEC,MAAO,CACLhB,CAAC,QAAS,KACVA,CAAC,GAAGY,KAAe,KACnBZ,CAAC,GAAGa,KAAS,KACbb,CAAC,YAAac,EACdd,CAAC,eAAgBE,EACjBF,CAAC,WAAYF,IAGdmB,EAAWzB,KAAKY,GAAI,SACnBW,EAAA,MAAA,CAAKC,MAAM,QACTD,EAAA,OAAA,CAAMG,KAAK,UAGfH,EAAA,gBAAA,CACEI,QAAQ,QAAOC,yBACS,MACxBJ,MAAM,SAEND,EAAA,OAAA,KAAOL,IAERR,GACCa,EAAA,aAAA,CACEL,MAAM,UACNW,OAAO,eACPL,MAAO,CAAEhB,CAAC,oBAAqBc,IAE/BC,EAAA,SAAA,CACEO,GAAG,eACHN,MAAO,CACLhB,CAAC,gBAAiB,MACnBuB,aACW,WAAWb,SACvBI,SAAUA,EACVU,SAAUV,GAAY,EAAI,EAC1BW,QAASjC,KAAKC,cACdiC,aAAclC,KAAKK,kBACnB8B,aAAcnC,KAAKO,kBACnB6B,UAAWC","sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: inline-block;\n}\n\n.chip {\n display: flex;\n padding: var(--ic-space-xxs);\n font-size: 14px;\n border-radius: 80px;\n text-align: center;\n align-items: center;\n text-decoration: none;\n transition: var(--ic-easing-transition-fast);\n position: relative;\n}\n\n.chip.small {\n padding: var(--ic-space-xxxs);\n}\n\n.chip.large {\n padding: var(--ic-space-xs);\n}\n\n.label {\n padding: 0 var(--ic-space-xs);\n}\n\n.chip.hovered:not(:focus-within) {\n background-color: var(--ic-architectural-300);\n}\n\n.chip:focus-within {\n box-shadow: var(--ic-border-focus);\n outline: var(--ic-hc-focus-outline);\n z-index: 1;\n}\n\n.chip.outline.hovered:not(:focus-within) {\n background-color: var(--ic-action-dark-bg-hover);\n}\n\nic-tooltip:focus-within {\n z-index: 1;\n}\n\n.filled {\n background-color: var(--ic-architectural-200);\n color: black;\n border: none;\n}\n\n.filled.disabled {\n background-color: var(--ic-architectural-100);\n}\n\n.outline {\n color: var(--ic-architectural-900);\n border: 1px solid var(--ic-architectural-900);\n padding: calc(var(--ic-space-xxs) - 1px);\n}\n\n.outline.small {\n padding: calc(var(--ic-space-xxxs) - 1px);\n}\n\n.outline.large {\n padding: calc(var(--ic-space-xs) - 1px);\n}\n\n.outline.disabled {\n border: var(--ic-border-disabled);\n background: none;\n}\n\n.chip.disabled ic-typography {\n color: var(--ic-architectural-200);\n}\n\n.dismiss-icon {\n border: none;\n border-radius: 50%;\n padding: 0;\n background: none;\n cursor: pointer;\n margin: var(--ic-space-xxxs);\n height: 20px;\n}\n\n.dismiss-icon:focus {\n outline: var(--ic-hc-focus-outline);\n}\n\n.dismiss-icon[disabled] {\n pointer-events: none;\n color: var(--ic-architectural-200);\n}\n\n.icon {\n padding: var(--ic-space-xxxs);\n box-sizing: border-box;\n}\n\n.icon,\nic-tooltip {\n width: var(--ic-space-lg);\n height: var(--ic-space-lg);\n}\n\n.chip.disabled path,\n.chip.disabled ::slotted(svg) {\n fill: var(--ic-architectural-200);\n}\n\n@media (forced-colors: active) {\n .chip {\n border: var(--ic-hc-border);\n }\n\n .filled.small {\n padding: calc(var(--ic-space-xxxs) - 1px);\n }\n\n .filled {\n padding: calc(var(--ic-space-xxxs) + 1px);\n }\n\n .filled.large {\n padding: calc(var(--ic-space-xs) - 1px);\n }\n\n .chip.disabled {\n appearance: none;\n border-color: GrayText;\n }\n\n .chip.disabled ic-typography {\n color: GrayText;\n }\n\n .chip.disabled path,\n .chip.disabled ::slotted(svg) {\n fill: GrayText;\n }\n\n .chip:focus-within {\n outline: none;\n border-color: Highlight;\n }\n}\n","import {\n Component,\n h,\n Prop,\n State,\n Listen,\n Event,\n EventEmitter,\n Element,\n} from \"@stencil/core\";\nimport {\n onComponentRequiredPropUndefined,\n isSlotUsed,\n} from \"../../utils/helpers\";\nimport { IcChipAppearance, IcChipSizes } from \"./ic-chip.types\";\nimport dismissIcon from \"../../assets/dismiss-icon.svg\";\n\n/**\n * @slot icon - Content will be rendered at the start of the chip.\n */\n@Component({\n tag: \"ic-chip\",\n styleUrl: \"ic-chip.css\",\n shadow: true,\n})\nexport class Chip {\n @Element() el: HTMLIcChipElement;\n\n /**\n * The text rendered within the chip.\n */\n @Prop() label!: string;\n /**\n * The emphasis of the chip.\n */\n @Prop() appearance?: IcChipAppearance = \"filled\";\n /**\n * The size of the chip.\n */\n @Prop() size?: IcChipSizes = \"default\";\n /**\n * If `true`, the chip will have a close button at the end to dismiss it.\n */\n @Prop() dismissible?: boolean = false;\n /**\n * If `true`, the chip will appear disabled.\n */\n @Prop() disabled?: boolean = false;\n\n @State() visible: boolean = true;\n\n @State() isHovered: boolean = false;\n\n @Listen(\"icDismiss\", { capture: true })\n handleClick(): void {\n this.visible = !this.visible;\n }\n\n /**\n * @deprecated This event should not be used anymore. Use icDismiss instead.\n */\n @Event() dismiss: EventEmitter<void>;\n\n /**\n * Is emitted when the user dismisses the chip.\n */\n @Event() icDismiss: EventEmitter<void>;\n\n private dismissAction = (): void => {\n this.dismiss.emit();\n this.icDismiss.emit();\n };\n\n private mouseEnterHandler = (): void => {\n this.isHovered = true;\n };\n\n private mouseLeaveHandler = (): void => {\n this.isHovered = false;\n };\n\n componentDidLoad(): void {\n this.dismissible &&\n this.el.shadowRoot\n .querySelector(\"span.ic-tooltip-label\")\n ?.setAttribute(\"aria-hidden\", \"true\");\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Chip\"\n );\n }\n\n render() {\n const {\n label,\n appearance,\n size,\n dismissible,\n visible,\n disabled,\n isHovered,\n } = this;\n\n return (\n visible && (\n <div\n class={{\n [\"chip\"]: true,\n [`${appearance}`]: true,\n [`${size}`]: true,\n [\"disabled\"]: disabled,\n [\"dismissible\"]: dismissible,\n [\"hovered\"]: isHovered,\n }}\n >\n {isSlotUsed(this.el, \"icon\") && (\n <div class=\"icon\">\n <slot name=\"icon\" />\n </div>\n )}\n <ic-typography\n variant=\"label\"\n apply-vertical-margins={false}\n class=\"label\"\n >\n <span>{label}</span>\n </ic-typography>\n {dismissible && (\n <ic-tooltip\n label=\"Dismiss\"\n target=\"dismiss-icon\"\n class={{ [\"tooltip-disabled\"]: disabled }}\n >\n <button\n id=\"dismiss-icon\"\n class={{\n [\"dismiss-icon\"]: true,\n }}\n aria-label={`Dismiss ${label} chip`}\n disabled={disabled}\n tabindex={disabled ? -1 : 0}\n onClick={this.dismissAction}\n onMouseEnter={this.mouseEnterHandler}\n onMouseLeave={this.mouseLeaveHandler}\n innerHTML={dismissIcon}\n ></button>\n </ic-tooltip>\n )}\n </div>\n )\n );\n }\n}\n"]}
|