@ukic/web-components 3.12.0 → 3.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/helpers-478d1107.js.map +1 -1
  3. package/dist/cjs/ic-alert.cjs.entry.js +3 -3
  4. package/dist/cjs/ic-alert.cjs.entry.js.map +1 -1
  5. package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
  6. package/dist/cjs/ic-checkbox-group.cjs.entry.js +8 -4
  7. package/dist/cjs/ic-checkbox-group.cjs.entry.js.map +1 -1
  8. package/dist/cjs/ic-dialog.cjs.entry.js +35 -10
  9. package/dist/cjs/ic-dialog.cjs.entry.js.map +1 -1
  10. package/dist/cjs/ic-input-component-container_3.cjs.entry.js +12 -9
  11. package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
  12. package/dist/cjs/ic-navigation-item.cjs.entry.js +1 -1
  13. package/dist/cjs/ic-navigation-item.cjs.entry.js.map +1 -1
  14. package/dist/cjs/ic-page-header.cjs.entry.js +1 -1
  15. package/dist/cjs/ic-page-header.cjs.entry.js.map +1 -1
  16. package/dist/cjs/ic-status-tag.cjs.entry.js +1 -1
  17. package/dist/cjs/ic-status-tag.cjs.entry.js.map +1 -1
  18. package/dist/cjs/ic-step.cjs.entry.js +14 -13
  19. package/dist/cjs/ic-step.cjs.entry.js.map +1 -1
  20. package/dist/cjs/ic-stepper.cjs.entry.js +3 -2
  21. package/dist/cjs/ic-stepper.cjs.entry.js.map +1 -1
  22. package/dist/cjs/ic-top-navigation.cjs.entry.js +1 -1
  23. package/dist/cjs/ic-top-navigation.cjs.entry.js.map +1 -1
  24. package/dist/cjs/loader.cjs.js +1 -1
  25. package/dist/collection/components/ic-alert/ic-alert.css +13 -23
  26. package/dist/collection/components/ic-alert/ic-alert.js +2 -2
  27. package/dist/collection/components/ic-alert/ic-alert.js.map +1 -1
  28. package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.js +34 -4
  29. package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.js.map +1 -1
  30. package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.stories.js +163 -0
  31. package/dist/collection/components/ic-dialog/ic-dialog.js +36 -11
  32. package/dist/collection/components/ic-dialog/ic-dialog.js.map +1 -1
  33. package/dist/collection/components/ic-menu/ic-menu.js +12 -9
  34. package/dist/collection/components/ic-menu/ic-menu.js.map +1 -1
  35. package/dist/collection/components/ic-navigation-item/ic-navigation-item.css +9 -0
  36. package/dist/collection/components/ic-page-header/ic-page-header.css +4 -0
  37. package/dist/collection/components/ic-select/ic-select_(single).stories.js +74 -1
  38. package/dist/collection/components/ic-status-tag/ic-status-tag.css +1 -4
  39. package/dist/collection/components/ic-step/ic-step.js +16 -15
  40. package/dist/collection/components/ic-step/ic-step.js.map +1 -1
  41. package/dist/collection/components/ic-step/ic-step.types.js.map +1 -1
  42. package/dist/collection/components/ic-stepper/ic-stepper.js +5 -4
  43. package/dist/collection/components/ic-stepper/ic-stepper.js.map +1 -1
  44. package/dist/collection/components/ic-stepper/ic-stepper.stories.js +2 -1
  45. package/dist/collection/components/ic-top-navigation/ic-top-navigation.css +13 -10
  46. package/dist/collection/utils/types.js.map +1 -1
  47. package/dist/components/helpers.js.map +1 -1
  48. package/dist/components/ic-alert.js +3 -3
  49. package/dist/components/ic-alert.js.map +1 -1
  50. package/dist/components/ic-checkbox-group.js +9 -4
  51. package/dist/components/ic-checkbox-group.js.map +1 -1
  52. package/dist/components/ic-dialog.js +35 -10
  53. package/dist/components/ic-dialog.js.map +1 -1
  54. package/dist/components/ic-menu2.js +12 -9
  55. package/dist/components/ic-menu2.js.map +1 -1
  56. package/dist/components/ic-navigation-item.js +1 -1
  57. package/dist/components/ic-navigation-item.js.map +1 -1
  58. package/dist/components/ic-page-header.js +1 -1
  59. package/dist/components/ic-page-header.js.map +1 -1
  60. package/dist/components/ic-popover-menu.js.map +1 -1
  61. package/dist/components/ic-radio-option.js.map +1 -1
  62. package/dist/components/ic-status-tag.js +1 -1
  63. package/dist/components/ic-status-tag.js.map +1 -1
  64. package/dist/components/ic-step.js +14 -13
  65. package/dist/components/ic-step.js.map +1 -1
  66. package/dist/components/ic-stepper.js +3 -2
  67. package/dist/components/ic-stepper.js.map +1 -1
  68. package/dist/components/ic-top-navigation.js +1 -1
  69. package/dist/components/ic-top-navigation.js.map +1 -1
  70. package/dist/core/core.css +6 -6
  71. package/dist/core/core.esm.js +1 -1
  72. package/dist/core/core.esm.js.map +1 -1
  73. package/dist/core/p-0123dde7.entry.js.map +1 -1
  74. package/dist/core/p-19f9d292.entry.js +2 -0
  75. package/dist/core/p-19f9d292.entry.js.map +1 -0
  76. package/dist/core/p-45f743e4.entry.js +2 -0
  77. package/dist/core/p-45f743e4.entry.js.map +1 -0
  78. package/dist/core/{p-cf868a24.entry.js → p-511aa329.entry.js} +2 -2
  79. package/dist/core/p-511aa329.entry.js.map +1 -0
  80. package/dist/core/p-621b0770.entry.js +2 -0
  81. package/dist/core/p-621b0770.entry.js.map +1 -0
  82. package/dist/core/p-6f50d2e0.entry.js +2 -0
  83. package/dist/core/p-6f50d2e0.entry.js.map +1 -0
  84. package/dist/core/p-71c86e71.entry.js +2 -0
  85. package/dist/core/p-71c86e71.entry.js.map +1 -0
  86. package/dist/core/{p-d58ad080.entry.js → p-96a6cff2.entry.js} +2 -2
  87. package/dist/core/p-96a6cff2.entry.js.map +1 -0
  88. package/dist/core/{p-b1838ad8.entry.js → p-9f12b20c.entry.js} +2 -2
  89. package/dist/core/p-9f12b20c.entry.js.map +1 -0
  90. package/dist/core/p-a08c360b.entry.js +2 -0
  91. package/dist/core/p-a08c360b.entry.js.map +1 -0
  92. package/dist/core/{p-33789b23.entry.js → p-a97b8082.entry.js} +3 -3
  93. package/dist/core/p-a97b8082.entry.js.map +1 -0
  94. package/dist/core/p-b57e59b7.js.map +1 -1
  95. package/dist/esm/core.js +1 -1
  96. package/dist/esm/helpers-4ddac6ed.js.map +1 -1
  97. package/dist/esm/ic-alert.entry.js +3 -3
  98. package/dist/esm/ic-alert.entry.js.map +1 -1
  99. package/dist/esm/ic-button_3.entry.js.map +1 -1
  100. package/dist/esm/ic-checkbox-group.entry.js +8 -4
  101. package/dist/esm/ic-checkbox-group.entry.js.map +1 -1
  102. package/dist/esm/ic-dialog.entry.js +35 -10
  103. package/dist/esm/ic-dialog.entry.js.map +1 -1
  104. package/dist/esm/ic-input-component-container_3.entry.js +12 -9
  105. package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
  106. package/dist/esm/ic-navigation-item.entry.js +1 -1
  107. package/dist/esm/ic-navigation-item.entry.js.map +1 -1
  108. package/dist/esm/ic-page-header.entry.js +1 -1
  109. package/dist/esm/ic-page-header.entry.js.map +1 -1
  110. package/dist/esm/ic-status-tag.entry.js +1 -1
  111. package/dist/esm/ic-status-tag.entry.js.map +1 -1
  112. package/dist/esm/ic-step.entry.js +14 -13
  113. package/dist/esm/ic-step.entry.js.map +1 -1
  114. package/dist/esm/ic-stepper.entry.js +3 -2
  115. package/dist/esm/ic-stepper.entry.js.map +1 -1
  116. package/dist/esm/ic-top-navigation.entry.js +1 -1
  117. package/dist/esm/ic-top-navigation.entry.js.map +1 -1
  118. package/dist/esm/loader.js +1 -1
  119. package/dist/types/components/ic-checkbox-group/ic-checkbox-group.d.ts +5 -1
  120. package/dist/types/components/ic-dialog/ic-dialog.d.ts +2 -1
  121. package/dist/types/components/ic-step/ic-step.types.d.ts +1 -0
  122. package/dist/types/components.d.ts +9 -1
  123. package/dist/types/utils/types.d.ts +6 -2
  124. package/hydrate/index.js +80 -45
  125. package/hydrate/index.mjs +80 -45
  126. package/package.json +2 -2
  127. package/vscode-data.json +15 -0
  128. package/dist/core/p-33789b23.entry.js.map +0 -1
  129. package/dist/core/p-3e36f281.entry.js +0 -2
  130. package/dist/core/p-3e36f281.entry.js.map +0 -1
  131. package/dist/core/p-80e0f66e.entry.js +0 -2
  132. package/dist/core/p-80e0f66e.entry.js.map +0 -1
  133. package/dist/core/p-a1e2e029.entry.js +0 -2
  134. package/dist/core/p-a1e2e029.entry.js.map +0 -1
  135. package/dist/core/p-b1838ad8.entry.js.map +0 -1
  136. package/dist/core/p-c2d5e301.entry.js +0 -2
  137. package/dist/core/p-c2d5e301.entry.js.map +0 -1
  138. package/dist/core/p-cf868a24.entry.js.map +0 -1
  139. package/dist/core/p-d58ad080.entry.js.map +0 -1
  140. package/dist/core/p-e9d28e02.entry.js +0 -2
  141. package/dist/core/p-e9d28e02.entry.js.map +0 -1
  142. package/dist/core/p-fb69fbc0.entry.js +0 -2
  143. package/dist/core/p-fb69fbc0.entry.js.map +0 -1
@@ -34,6 +34,10 @@ const CheckboxGroup = class {
34
34
  * Sets the theme color to the dark or light theme color. "inherit" will set the color based on the system settings or ic-theme component.
35
35
  */
36
36
  this.theme = "inherit";
37
+ /**
38
+ * The value of the `aria-live` attribute on the validation message.
39
+ */
40
+ this.validationAriaLive = "polite";
37
41
  /**
38
42
  * The validation status - e.g. 'error' | 'warning' | 'success'.
39
43
  */
@@ -93,17 +97,17 @@ const CheckboxGroup = class {
93
97
  });
94
98
  }
95
99
  render() {
96
- const { disabled, helperText, hideLabel, label, name, required, size, theme, validationStatus, validationText, } = this;
100
+ const { disabled, helperText, hideLabel, label, name, required, size, theme, validationAriaLive, validationStatus, validationText, } = this;
97
101
  const describedBy = getInputDescribedByText(this.el, name, helperText !== "", validationStatus !== "");
98
102
  const renderSRText = validationStatus === "error" || required || hideLabel;
99
103
  const showValidation = hasValidationStatus(validationStatus, disabled);
100
- return (h(Host, { key: '6d5ed4db589400cd64aeed3bccd46087858d2902', class: {
104
+ return (h(Host, { key: 'ee4fc914d346b2f35dd8d44ff73a44b479caee95', class: {
101
105
  "ic-checkbox-group-disabled": !!disabled,
102
106
  [`ic-checkbox-group-${size}`]: true,
103
107
  [`ic-theme-${theme}`]: theme !== "inherit",
104
- } }, renderSRText && (h("span", { key: '2fc368a571755ad3125067498b17b52ce8933e8f', id: "screenReaderOnlyText", class: "screen-reader-only-text", "aria-hidden": "true" }, label, " ", validationStatus === "error" ? "invalid data " : null, " ", required ? "required" : null)), h("fieldset", { key: '6b7d3155fa0479fbd51c5e5100945ee4995dfadf', id: name, "aria-labelledby": `${renderSRText ? "screenReaderOnlyText" : ""} ${describedBy}`.trim(), disabled: disabled }, !hideLabel && (h("legend", { key: '469a466275aa307d6ca876ec18a79bb5d29167b8' }, h("ic-input-label", { key: '4cd2e89ab463ea9c7438fb1759faddf6df8750d1', class: { [`${validationStatus}`]: true }, label: label, helperText: helperText, required: required, disabled: disabled, useLabelTag: false }, h("slot", { key: '0b0b0a5028039ef6d487d441ebd28f47f32200b7', name: "helper-text", slot: "helper-text" })))), h("div", { key: '747fea859cd5a3bbd474454b408f648169b5fe45', class: "checkboxes-container" }, h("slot", { key: '200a6c033ff1243e8778aec3c91a22213f5082f5' }))), showValidation && (h("ic-input-validation", { key: 'df907eeb4348050b37357f27405b3ef548990163', class: {
108
+ } }, renderSRText && (h("span", { key: '3718d5e6fce1597c836d01050ed17bcd01c97e6e', id: "screenReaderOnlyText", class: "screen-reader-only-text", "aria-hidden": "true" }, label, " ", validationStatus === "error" ? "invalid data " : null, " ", required ? "required" : null)), h("fieldset", { key: '318e6c61787f136916d39acdd2823fa644c8d865', id: name, "aria-labelledby": `${renderSRText ? "screenReaderOnlyText" : ""} ${describedBy}`.trim(), disabled: disabled }, !hideLabel && (h("legend", { key: '6348eb25d5a2de666033441d694b407f72ae834b' }, h("ic-input-label", { key: '96ef66ab6b4e3a02a2385eb9b8f5936c1fc57ad0', class: { [`${validationStatus}`]: true }, label: label, helperText: helperText, required: required, disabled: disabled, useLabelTag: false }, h("slot", { key: 'f9f0532834d50a57dbc2f075a9f94788071cceb6', name: "helper-text", slot: "helper-text" })))), h("div", { key: '9b72caba2adb5951814689ef5c8b1fa5d7ea11ed', class: "checkboxes-container" }, h("slot", { key: '5cf045069c87416b7889e7b29b44e6f137ca0b4f' }))), h("ic-input-validation", { key: '4b9680fcb5468fbf6e9c2e1eb6d45f929b2b09dc', class: {
105
109
  "show-validation": showValidation,
106
- }, for: name, ariaLiveMode: "polite", status: validationStatus, message: validationText }))));
110
+ }, for: name, ariaLiveMode: validationAriaLive, status: showValidation ? validationStatus : "", message: showValidation ? validationText : "" })));
107
111
  }
108
112
  get el() { return getElement(this); }
109
113
  static get watchers() { return {
@@ -1 +1 @@
1
- {"file":"ic-checkbox-group.entry.js","mappings":";;;;AAAA,MAAM,kBAAkB,GAAG,qpIAAqpI,CAAC;AACjrI,8BAAe,kBAAkB;;ACuBjC,MAAM,iBAAiB,GAAG,aAAa,CAAC;MAW3B,aAAa;IAN1B;;;;;;QAYU,aAAQ,GAAY,KAAK,CAAC;;;;QAS1B,eAAU,GAAW,EAAE,CAAC;;;;QAKxB,cAAS,GAAY,KAAK,CAAC;;;;QAiC3B,aAAQ,GAAY,KAAK,CAAC;;;;QAK1B,SAAI,GAAY,QAAQ,CAAC;;;;QAKzB,UAAK,GAAgB,SAAS,CAAC;;;;QAa/B,qBAAgB,GAA+B,EAAE,CAAC;;;;QAKlD,mBAAc,GAAW,EAAE,CAAC;KAgIrC;IAzMC,oBAAoB;QAClB,mBAAmB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;KAC7C;IAwBD,gBAAgB,CACd,QAAgB,EAChB,QAAgB,EAChB,QAA0B;QAE1B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC,CAAC,OAAO,CAC7D,CAAC,QAAQ;YACP,IAAI,QAAQ,KAAK,OAAO;gBAAE,QAAQ,CAAC,UAAU,GAAG,QAAQ,CAAC;iBACpD,IAAI,QAAQ,CAAC,IAAI,KAAK,QAAQ,EAAE;;gBAEnC,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC;aAC1B;SACF,CACF,CAAC;KACH;IAiBD,iBAAiB,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AQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,KAAK,IAElB,6DAAM,IAAI,EAAC,aAAa,EAAC,IAAI,EAAC,aAAa,GAAQ,CACpC,CACV,CACV,EACD,4DAAK,KAAK,EAAC,sBAAsB,IAC/B,8DAAa,CACT,CACG,EACV,cAAc,KACb,4EACE,KAAK,EAAE;gBACL,iBAAiB,EAAE,cAAc;aAClC,EACD,GAAG,EAAE,IAAI,EACT,YAAY,EAAC,QAAQ,EACrB,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,cAAc,GACF,CACxB,CACI,EACP;KACH;;;;;;;;;;;;;","names":[],"sources":["src/components/ic-checkbox-group/ic-checkbox-group.css?tag=ic-checkbox-group&encapsulation=shadow","src/components/ic-checkbox-group/ic-checkbox-group.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: block;\n\n --ic-input-label-text-color: var(--ic-checkbox-group-label);\n --ic-input-label-helper-text-color: var(--ic-checkbox-group-subtitle);\n --ic-input-validation-error: var(--ic-checkbox-state-icon-error);\n --ic-input-validation-status-text-color: var(--ic-checkbox-state-text);\n}\n\n:host(.ic-checkbox-group-disabled) {\n --ic-input-label-text-color: var(--ic-checkbox-group-label-disabled);\n --ic-input-label-helper-text-color: var(\n --ic-checkbox-group-subtitle-disabled\n );\n}\n\nic-input-label.error {\n color: var(--ic-checkbox-group-label-error);\n\n --ic-typography-color: var(--ic-checkbox-group-label-error);\n --ic-input-label-helper-text-color: var(--ic-checkbox-group-subtitle-error);\n}\n\nic-input-label:not(.with-helper) .ic-typography-label,\nic-input-label .helpertext {\n margin-bottom: var(--ic-space-sm);\n}\n\n:host(.ic-checkbox-group-small)\n ic-input-label:not(.with-helper)\n .ic-typography-label,\n:host(.ic-checkbox-group-small) ic-input-label .helpertext {\n margin-bottom: calc(var(--ic-space-sm) / 2);\n}\n\n:host(.ic-checkbox-group-large)\n ic-input-label:not(.with-helper)\n .ic-typography-label,\n:host(.ic-checkbox-group-large) ic-input-label .helpertext {\n margin-bottom: calc(var(--ic-space-sm) * 1.5);\n}\n\nic-input-label .helpertext {\n display: block;\n}\n\nic-input-validation.show-validation {\n margin-top: var(--ic-space-sm);\n}\n\n:host(.ic-checkbox-group-small) ic-input-validation.show-validation {\n margin-top: calc(var(--ic-space-sm) / 2);\n}\n\n:host(.ic-checkbox-group-large) ic-input-validation.show-validation {\n margin-top: calc(var(--ic-space-sm) * 1.5);\n}\n\n.checkboxes-container {\n margin-bottom: calc(-1 * var(--ic-space-xxs));\n}\n\n:host(.ic-checkbox-group-small) .checkboxes-container {\n margin-bottom: calc(-1 * var(--ic-space-xxxs));\n}\n\n.screen-reader-only-text {\n position: absolute;\n left: -9999px;\n background-color: #fff;\n color: #000;\n text-transform: none;\n}\n\n.screen-reader-only-text:dir(rtl) {\n right: -9999px;\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Listen,\n Element,\n Event,\n EventEmitter,\n Watch,\n} from \"@stencil/core\";\nimport {\n getInputDescribedByText,\n hasValidationStatus,\n onComponentRequiredPropUndefined,\n removeDisabledFalse,\n} from \"../../utils/helpers\";\nimport {\n IcInformationStatusOrEmpty,\n IcSizes,\n IcThemeMode,\n} from \"../../utils/types\";\nimport { IcChangeEventDetail } from \"./ic-checkbox-group.types\";\n\nconst CHECKBOX_SELECTOR = \"ic-checkbox\";\n\n/**\n * @slot helper-text - Content is set as the helper text for the checkbox group.\n */\n@Component({\n tag: \"ic-checkbox-group\",\n styleUrl: \"ic-checkbox-group.css\",\n shadow: true,\n})\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport class CheckboxGroup {\n @Element() el: HTMLIcCheckboxGroupElement;\n\n /**\n * If `true`, the checkbox group will be set to the disabled state.\n */\n @Prop() disabled: boolean = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\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 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 * The label for the checkbox group to be displayed.\n */\n @Prop() label!: string;\n\n /**\n * The name for the checkbox group to differentiate from other groups.\n */\n @Prop() name!: string;\n\n @Watch(\"label\")\n @Watch(\"name\")\n labelNameHandler(\n newValue: string,\n oldValue: string,\n propName: \"label\" | \"name\"\n ): void {\n Array.from(this.el.querySelectorAll(CHECKBOX_SELECTOR)).forEach(\n (checkbox) => {\n if (propName === \"label\") checkbox.groupLabel = newValue;\n else if (checkbox.name === oldValue) {\n // If the checkbox name has been set by the parent, then override it\n checkbox.name = newValue;\n }\n }\n );\n }\n\n /**\n * If `true`, the checkbox group will require a value.\n */\n @Prop() required: boolean = false;\n\n /**\n * The size of the checkboxes to be displayed. This does not affect the font size of the label.\n */\n @Prop() size: IcSizes = \"medium\";\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop() theme: IcThemeMode = \"inherit\";\n @Watch(\"theme\")\n watchThemeHandler(newValue: IcThemeMode): void {\n Array.from(this.el.querySelectorAll(CHECKBOX_SELECTOR)).forEach(\n (checkbox) => {\n checkbox.theme = newValue;\n }\n );\n }\n\n /**\n * The validation status - e.g. 'error' | 'warning' | 'success'.\n */\n @Prop() validationStatus: IcInformationStatusOrEmpty = \"\";\n\n /**\n * The text to display as the validation message.\n */\n @Prop() validationText: string = \"\";\n\n /**\n * Emitted when a checkbox is checked.\n */\n @Event() icChange: EventEmitter<IcChangeEventDetail>;\n\n @Listen(\"icChange\")\n handleChange(ev: CustomEvent): void {\n //don't pass on the event if it has come from slotted text field\n //otherwise any icChange handler bound to the checkbox group will also run\n if ((ev.target as HTMLElement).tagName === \"IC-TEXT-FIELD\") {\n ev.stopImmediatePropagation();\n }\n }\n\n componentWillLoad(): void {\n removeDisabledFalse(this.disabled, this.el);\n this.watchThemeHandler(this.theme);\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [\n { prop: this.label, propName: \"label\" },\n { prop: this.name, propName: \"name\" },\n ],\n \"Checkbox Group\"\n );\n }\n\n @Listen(\"icCheck\")\n selectHandler({ target }: CustomEvent): void {\n const checkedOptions = Array.from(\n this.el.querySelectorAll(CHECKBOX_SELECTOR)\n ).filter(({ checked, disabled }) => checked && !disabled);\n this.icChange.emit({\n value: checkedOptions.map(({ value }) => value),\n checkedOptions: checkedOptions.map((opt) => ({\n checkbox: opt,\n textFieldValue: opt.querySelector(\"ic-text-field\")?.value,\n })),\n selectedOption: target as HTMLIcCheckboxElement,\n });\n }\n\n render() {\n const {\n disabled,\n helperText,\n hideLabel,\n label,\n name,\n required,\n size,\n theme,\n validationStatus,\n validationText,\n } = this;\n\n const describedBy = getInputDescribedByText(\n this.el,\n name,\n helperText !== \"\",\n validationStatus !== \"\"\n );\n\n const renderSRText = validationStatus === \"error\" || required || hideLabel;\n\n const showValidation = hasValidationStatus(validationStatus, disabled);\n\n return (\n <Host\n class={{\n \"ic-checkbox-group-disabled\": !!disabled,\n [`ic-checkbox-group-${size}`]: true,\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n }}\n >\n {renderSRText && (\n <span\n id=\"screenReaderOnlyText\"\n class=\"screen-reader-only-text\"\n aria-hidden=\"true\"\n >\n {label} {validationStatus === \"error\" ? \"invalid data \" : null}{\" \"}\n {required ? \"required\" : null}\n </span>\n )}\n <fieldset\n id={name}\n aria-labelledby={`${\n renderSRText ? \"screenReaderOnlyText\" : \"\"\n } ${describedBy}`.trim()}\n disabled={disabled}\n >\n {!hideLabel && (\n <legend>\n <ic-input-label\n class={{ [`${validationStatus}`]: true }}\n label={label}\n helperText={helperText}\n required={required}\n disabled={disabled}\n useLabelTag={false}\n >\n <slot name=\"helper-text\" slot=\"helper-text\"></slot>\n </ic-input-label>\n </legend>\n )}\n <div class=\"checkboxes-container\">\n <slot></slot>\n </div>\n </fieldset>\n {showValidation && (\n <ic-input-validation\n class={{\n \"show-validation\": showValidation,\n }}\n for={name}\n ariaLiveMode=\"polite\"\n status={validationStatus}\n message={validationText}\n ></ic-input-validation>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"ic-checkbox-group.entry.js","mappings":";;;;AAAA,MAAM,kBAAkB,GAAG,qpIAAqpI,CAAC;AACjrI,8BAAe,kBAAkB;;ACwBjC,MAAM,iBAAiB,GAAG,aAAa,CAAC;MAW3B,aAAa;IAN1B;;;;;;QAYU,aAAQ,GAAY,KAAK,CAAC;;;;QAS1B,eAAU,GAAW,EAAE,CAAC;;;;QAKxB,cAAS,GAAY,KAAK,CAAC;;;;QAiC3B,aAAQ,GAAY,KAAK,CAAC;;;;QAK1B,SAAI,GAAY,QAAQ,CAAC;;;;QAKzB,UAAK,GAAgB,SAAS,CAAC;;;;QAa/B,uBAAkB,GAAe,QAAQ,CAAC;;;;QAK1C,qBAAgB,GAA+B,EAAE,CAAC;;;;QAKlD,mBAAc,GAAW,EAAE,CAAC;KA+HrC;IA7MC,oBAAoB;QAClB,mBAAmB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;KAC7C;IAwBD,gBAAgB,CACd,QAAgB,EAChB,QAAgB,EAChB,QAA0B;QAE1B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC,CAAC,OAAO,CAC7D,CAAC,QAAQ;YACP,IAAI,QAAQ,KAAK,OAAO;gBAAE,QAAQ,CAAC,UAAU,GAAG,QAAQ,CAAC;iBACpD,IAAI,QAAQ,CAAC,IAAI,KAAK,QAAQ,EAAE;;gBAEnC,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC;aAC1B;SACF,CACF,CAAC;KACH;IAiBD,iBAAiB,CAAC,QAAqB;QACrC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC,CAAC,OAAO,CAC7D,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AAI,EAAC,aAAa,GAAQ,CACpC,CACV,CACV,EACD,4DAAK,KAAK,EAAC,sBAAsB,IAC/B,8DAAa,CACT,CACG,EACX,4EACE,KAAK,EAAE;gBACL,iBAAiB,EAAE,cAAc;aAClC,EACD,GAAG,EAAE,IAAI,EACT,YAAY,EAAE,kBAAkB,EAChC,MAAM,EAAE,cAAc,GAAG,gBAAgB,GAAG,EAAE,EAC9C,OAAO,EAAE,cAAc,GAAG,cAAc,GAAG,EAAE,GACxB,CAClB,EACP;KACH;;;;;;;;;;;;;","names":[],"sources":["src/components/ic-checkbox-group/ic-checkbox-group.css?tag=ic-checkbox-group&encapsulation=shadow","src/components/ic-checkbox-group/ic-checkbox-group.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: block;\n\n --ic-input-label-text-color: var(--ic-checkbox-group-label);\n --ic-input-label-helper-text-color: var(--ic-checkbox-group-subtitle);\n --ic-input-validation-error: var(--ic-checkbox-state-icon-error);\n --ic-input-validation-status-text-color: var(--ic-checkbox-state-text);\n}\n\n:host(.ic-checkbox-group-disabled) {\n --ic-input-label-text-color: var(--ic-checkbox-group-label-disabled);\n --ic-input-label-helper-text-color: var(\n --ic-checkbox-group-subtitle-disabled\n );\n}\n\nic-input-label.error {\n color: var(--ic-checkbox-group-label-error);\n\n --ic-typography-color: var(--ic-checkbox-group-label-error);\n --ic-input-label-helper-text-color: var(--ic-checkbox-group-subtitle-error);\n}\n\nic-input-label:not(.with-helper) .ic-typography-label,\nic-input-label .helpertext {\n margin-bottom: var(--ic-space-sm);\n}\n\n:host(.ic-checkbox-group-small)\n ic-input-label:not(.with-helper)\n .ic-typography-label,\n:host(.ic-checkbox-group-small) ic-input-label .helpertext {\n margin-bottom: calc(var(--ic-space-sm) / 2);\n}\n\n:host(.ic-checkbox-group-large)\n ic-input-label:not(.with-helper)\n .ic-typography-label,\n:host(.ic-checkbox-group-large) ic-input-label .helpertext {\n margin-bottom: calc(var(--ic-space-sm) * 1.5);\n}\n\nic-input-label .helpertext {\n display: block;\n}\n\nic-input-validation.show-validation {\n margin-top: var(--ic-space-sm);\n}\n\n:host(.ic-checkbox-group-small) ic-input-validation.show-validation {\n margin-top: calc(var(--ic-space-sm) / 2);\n}\n\n:host(.ic-checkbox-group-large) ic-input-validation.show-validation {\n margin-top: calc(var(--ic-space-sm) * 1.5);\n}\n\n.checkboxes-container {\n margin-bottom: calc(-1 * var(--ic-space-xxs));\n}\n\n:host(.ic-checkbox-group-small) .checkboxes-container {\n margin-bottom: calc(-1 * var(--ic-space-xxxs));\n}\n\n.screen-reader-only-text {\n position: absolute;\n left: -9999px;\n background-color: #fff;\n color: #000;\n text-transform: none;\n}\n\n.screen-reader-only-text:dir(rtl) {\n right: -9999px;\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Listen,\n Element,\n Event,\n EventEmitter,\n Watch,\n} from \"@stencil/core\";\nimport {\n getInputDescribedByText,\n hasValidationStatus,\n onComponentRequiredPropUndefined,\n removeDisabledFalse,\n} from \"../../utils/helpers\";\nimport {\n IcAriaLive,\n IcInformationStatusOrEmpty,\n IcSizes,\n IcThemeMode,\n} from \"../../utils/types\";\nimport { IcChangeEventDetail } from \"./ic-checkbox-group.types\";\n\nconst CHECKBOX_SELECTOR = \"ic-checkbox\";\n\n/**\n * @slot helper-text - Content is set as the helper text for the checkbox group.\n */\n@Component({\n tag: \"ic-checkbox-group\",\n styleUrl: \"ic-checkbox-group.css\",\n shadow: true,\n})\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport class CheckboxGroup {\n @Element() el: HTMLIcCheckboxGroupElement;\n\n /**\n * If `true`, the checkbox group will be set to the disabled state.\n */\n @Prop() disabled: boolean = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\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 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 * The label for the checkbox group to be displayed.\n */\n @Prop() label!: string;\n\n /**\n * The name for the checkbox group to differentiate from other groups.\n */\n @Prop() name!: string;\n\n @Watch(\"label\")\n @Watch(\"name\")\n labelNameHandler(\n newValue: string,\n oldValue: string,\n propName: \"label\" | \"name\"\n ): void {\n Array.from(this.el.querySelectorAll(CHECKBOX_SELECTOR)).forEach(\n (checkbox) => {\n if (propName === \"label\") checkbox.groupLabel = newValue;\n else if (checkbox.name === oldValue) {\n // If the checkbox name has been set by the parent, then override it\n checkbox.name = newValue;\n }\n }\n );\n }\n\n /**\n * If `true`, the checkbox group will require a value.\n */\n @Prop() required: boolean = false;\n\n /**\n * The size of the checkboxes to be displayed. This does not affect the font size of the label.\n */\n @Prop() size: IcSizes = \"medium\";\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop() theme: IcThemeMode = \"inherit\";\n @Watch(\"theme\")\n watchThemeHandler(newValue: IcThemeMode): void {\n Array.from(this.el.querySelectorAll(CHECKBOX_SELECTOR)).forEach(\n (checkbox) => {\n checkbox.theme = newValue;\n }\n );\n }\n\n /**\n * The value of the `aria-live` attribute on the validation message.\n */\n @Prop() validationAriaLive: IcAriaLive = \"polite\";\n\n /**\n * The validation status - e.g. 'error' | 'warning' | 'success'.\n */\n @Prop() validationStatus: IcInformationStatusOrEmpty = \"\";\n\n /**\n * The text to display as the validation message.\n */\n @Prop() validationText: string = \"\";\n\n /**\n * Emitted when a checkbox is checked.\n */\n @Event() icChange: EventEmitter<IcChangeEventDetail>;\n\n @Listen(\"icChange\")\n handleChange(ev: CustomEvent): void {\n //don't pass on the event if it has come from slotted text field\n //otherwise any icChange handler bound to the checkbox group will also run\n if ((ev.target as HTMLElement).tagName === \"IC-TEXT-FIELD\") {\n ev.stopImmediatePropagation();\n }\n }\n\n componentWillLoad(): void {\n removeDisabledFalse(this.disabled, this.el);\n this.watchThemeHandler(this.theme);\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [\n { prop: this.label, propName: \"label\" },\n { prop: this.name, propName: \"name\" },\n ],\n \"Checkbox Group\"\n );\n }\n\n @Listen(\"icCheck\")\n selectHandler({ target }: CustomEvent): void {\n const checkedOptions = Array.from(\n this.el.querySelectorAll(CHECKBOX_SELECTOR)\n ).filter(({ checked, disabled }) => checked && !disabled);\n this.icChange.emit({\n value: checkedOptions.map(({ value }) => value),\n checkedOptions: checkedOptions.map((opt) => ({\n checkbox: opt,\n textFieldValue: opt.querySelector(\"ic-text-field\")?.value,\n })),\n selectedOption: target as HTMLIcCheckboxElement,\n });\n }\n\n render() {\n const {\n disabled,\n helperText,\n hideLabel,\n label,\n name,\n required,\n size,\n theme,\n validationAriaLive,\n validationStatus,\n validationText,\n } = this;\n\n const describedBy = getInputDescribedByText(\n this.el,\n name,\n helperText !== \"\",\n validationStatus !== \"\"\n );\n\n const renderSRText = validationStatus === \"error\" || required || hideLabel;\n\n const showValidation = hasValidationStatus(validationStatus, disabled);\n\n return (\n <Host\n class={{\n \"ic-checkbox-group-disabled\": !!disabled,\n [`ic-checkbox-group-${size}`]: true,\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n }}\n >\n {renderSRText && (\n <span\n id=\"screenReaderOnlyText\"\n class=\"screen-reader-only-text\"\n aria-hidden=\"true\"\n >\n {label} {validationStatus === \"error\" ? \"invalid data \" : null}{\" \"}\n {required ? \"required\" : null}\n </span>\n )}\n <fieldset\n id={name}\n aria-labelledby={`${\n renderSRText ? \"screenReaderOnlyText\" : \"\"\n } ${describedBy}`.trim()}\n disabled={disabled}\n >\n {!hideLabel && (\n <legend>\n <ic-input-label\n class={{ [`${validationStatus}`]: true }}\n label={label}\n helperText={helperText}\n required={required}\n disabled={disabled}\n useLabelTag={false}\n >\n <slot name=\"helper-text\" slot=\"helper-text\"></slot>\n </ic-input-label>\n </legend>\n )}\n <div class=\"checkboxes-container\">\n <slot></slot>\n </div>\n </fieldset>\n <ic-input-validation\n class={{\n \"show-validation\": showValidation,\n }}\n for={name}\n ariaLiveMode={validationAriaLive}\n status={showValidation ? validationStatus : \"\"}\n message={showValidation ? validationText : \"\"}\n ></ic-input-validation>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -24,7 +24,9 @@ const Dialog = class {
24
24
  this.IC_CHECKBOX = "IC-CHECKBOX";
25
25
  this.IC_SEARCH_BAR = "IC-SEARCH-BAR";
26
26
  this.IC_TAB_CONTEXT = "IC-TAB-CONTEXT";
27
+ this.interactiveElementList = [];
27
28
  this.resizeObserver = null;
29
+ this.focusAttemptCount = 0;
28
30
  this.dialogRendered = false;
29
31
  this.fadeIn = false;
30
32
  /**
@@ -93,6 +95,7 @@ const Dialog = class {
93
95
  }
94
96
  }, 10);
95
97
  setTimeout(() => {
98
+ this.getInteractiveElements();
96
99
  this.setInitialFocus();
97
100
  checkResizeObserver(this.runResizeObserver);
98
101
  }, 75);
@@ -143,10 +146,24 @@ const Dialog = class {
143
146
  };
144
147
  this.setInitialFocus = () => {
145
148
  this.sourceElement = document.activeElement;
146
- this.focusedElementIndex = this.interactiveElementList
147
- ? this.interactiveElementList.findIndex((element) => element.hasAttribute(this.DATA_GETS_FOCUS))
148
- : 0;
149
- this.focusElement(this.interactiveElementList[this.focusedElementIndex]);
149
+ if (!this.interactiveElementList.length) {
150
+ // No interactive elements yet, retry shortly
151
+ setTimeout(() => {
152
+ this.getInteractiveElements();
153
+ if (this.interactiveElementList.length) {
154
+ this.setInitialFocus();
155
+ }
156
+ }, 10);
157
+ return;
158
+ }
159
+ this.focusedElementIndex = this.interactiveElementList.findIndex((element) => element.hasAttribute(this.DATA_GETS_FOCUS));
160
+ if (this.focusedElementIndex === -1) {
161
+ this.focusedElementIndex = 0;
162
+ }
163
+ const elToFocus = this.interactiveElementList[this.focusedElementIndex];
164
+ if (elToFocus) {
165
+ this.focusElement(elToFocus);
166
+ }
150
167
  };
151
168
  this.getFocusedElementIndex = () => {
152
169
  var _a;
@@ -181,17 +198,22 @@ const Dialog = class {
181
198
  };
182
199
  this.getNextFocusEl = (focusedElementIndex) => this.interactiveElementList[focusedElementIndex];
183
200
  this.onTabKeyPress = (shiftKey) => {
201
+ var _a;
184
202
  this.getFocusedElementIndex();
185
- if (this.interactiveElementList[this.focusedElementIndex].tagName ===
203
+ if (((_a = this.interactiveElementList[this.focusedElementIndex]) === null || _a === void 0 ? void 0 : _a.tagName) ===
186
204
  this.IC_SEARCH_BAR) {
187
205
  return false;
188
206
  }
189
207
  this.setFocusIndexBasedOnShiftKey(shiftKey);
190
208
  this.loopNextFocusIndexIfLastElement();
209
+ this.focusAttemptCount = 0;
191
210
  this.focusElement(this.getNextFocusEl(this.focusedElementIndex), shiftKey);
192
211
  return true;
193
212
  };
194
213
  this.shouldSkipElement = (element) => {
214
+ if (!element) {
215
+ return true;
216
+ }
195
217
  const isHidden = getComputedStyle(element).visibility === "hidden" ||
196
218
  element.offsetHeight === 0 ||
197
219
  element.hasAttribute("disabled") ||
@@ -204,12 +226,16 @@ const Dialog = class {
204
226
  !(radioEl.hasAttribute("selected") || element.tabIndex === 0)));
205
227
  };
206
228
  this.focusElement = (element, shiftKey = false) => {
207
- let nextFocusEl = element;
229
+ if (!element) {
230
+ return;
231
+ }
232
+ if (this.focusAttemptCount++ > this.interactiveElementList.length) {
233
+ return;
234
+ }
208
235
  if (this.shouldSkipElement(element)) {
209
236
  this.setFocusIndexBasedOnShiftKey(shiftKey);
210
237
  this.loopNextFocusIndexIfLastElement();
211
- nextFocusEl = this.getNextFocusEl(this.focusedElementIndex);
212
- this.focusElement(nextFocusEl, shiftKey);
238
+ this.focusElement(this.getNextFocusEl(this.focusedElementIndex), shiftKey);
213
239
  }
214
240
  else {
215
241
  switch (element.tagName) {
@@ -264,7 +290,6 @@ const Dialog = class {
264
290
  this.removeSlotChangeListener();
265
291
  }
266
292
  componentDidLoad() {
267
- this.getInteractiveElements();
268
293
  this.refreshInteractiveElementsOnSlotChange();
269
294
  if (this.open) {
270
295
  this.dialogOpened();
@@ -340,7 +365,7 @@ const Dialog = class {
340
365
  }
341
366
  render() {
342
367
  const { dialogRendered, disableHeightConstraint, fadeIn, theme } = this;
343
- return (h(Host, { key: '6de63d3d94afa349dc9bb5b30296837bbf89f810', class: {
368
+ return (h(Host, { key: '90bdbe0ef1a88e61db6395c4f63bea39573a757b', class: {
344
369
  "ic-dialog-hidden": !dialogRendered,
345
370
  "ic-dialog-fade-in": fadeIn,
346
371
  "disable-height-constraint": !!disableHeightConstraint,
@@ -1 +1 @@
1
- {"file":"ic-dialog.entry.js","mappings":";;;;;AAAA,MAAM,WAAW,GAAG,6/JAA6/J,CAAC;AAClhK,uBAAe,WAAW;;MCiCb,MAAM;IALnB;;;;;;QAQU,gCAA2B,GAA4B,IAAI,CAAC;QAC5D,oBAAe,GAAW,iBAAiB,CAAC;QAC5C,oBAAe,GAAW,iBAAiB,CAAC;QAE5C,iBAAY,GAAW,CAAC,CAAC;QACzB,wBAAmB,GAAG,CAAC,CAAC;QACxB,kBAAa,GAAW,eAAe,CAAC;QACxC,iBAAY,GAAW,cAAc,CAAC;QACtC,uBAAkB,GAAW,oBAAoB,CAAC;QAClD,gBAAW,GAAG,aAAa,CAAC;QAC5B,kBAAa,GAAW,eAAe,CAAC;QACxC,mBAAc,GAAW,gBAAgB,CAAC;QAE1C,mBAAc,GAA0B,IAAI,CAAC;QAM5C,mBAAc,GAAY,KAAK,CAAC;QAChC,WAAM,GAAY,KAAK,CAAC;;;;QAKzB,yBAAoB,GAAa,IAAI,CAAC;;;;QAKtC,gBAAW,GAAa,KAAK,CAAC;;;;QAK9B,iBAAY,GAAY,SAAS,CAAC;;;;;QAMlC,4BAAuB,GAAa,KAAK,CAAC;;;;QAK1C,2BAAsB,GAAa,KAAK,CAAC;;;;QAKzC,oBAAe,GAAa,KAAK,CAAC;;;;QAKlC,wBAAmB,GAAY,KAAK,CAAC;;;;QAeL,SAAI,GAAa,KAAK,CAAC;;;;QAwBvD,SAAI,GAAkC,OAAO,CAAC;;;;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ialog.css?tag=ic-dialog&encapsulation=shadow","src/components/ic-dialog/ic-dialog.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n/**\n * @prop --ic-z-index-dialog: z-index of dialog \n */\n\n:host {\n position: fixed;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100% !important;\n background: rgb(0 0 0 / 60%);\n z-index: var(--ic-z-index-dialog);\n opacity: 0;\n}\n\n:host(.ic-dialog-fade-in) {\n opacity: 1;\n}\n\n:host(.disable-height-constraint) {\n background: none;\n justify-content: unset;\n align-items: unset;\n}\n\n.dialog.disable-height-constraint {\n max-height: none;\n position: relative;\n}\n\n.dialog.disable-height-constraint .content-area {\n overflow-y: visible;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n :host {\n transition: opacity var(--ic-easing-transition-slow);\n }\n\n .dialog {\n transform: translateY(-3rem);\n transition: transform 1000s;\n }\n\n :host(.ic-dialog-fade-in) .dialog {\n transform: translateY(0);\n transition: transform var(--ic-easing-transition-slow);\n }\n}\n\n:host(.ic-dialog-hidden) {\n display: none;\n}\n\n.dialog {\n background-color: var(--ic-dialog-background);\n color: var(--ic-dialog-text-primary);\n\n --ic-typography-color: var(--ic-dialog-text-primary);\n\n border: var(--ic-space-1px) solid var(--ic-dialog-border);\n border-radius: var(--ic-border-radius);\n padding: var(--ic-space-xs) 0 var(--ic-space-md);\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n overflow-x: visible;\n}\n\n.small {\n width: 50%;\n max-width: 25rem;\n min-height: 11rem;\n max-height: 70vh;\n}\n\n.medium {\n width: 70vw;\n max-width: 44rem;\n min-height: 12.5rem;\n max-height: 70vh;\n}\n\n.large {\n width: 90vw;\n max-width: 62.5rem;\n min-height: 12.5rem;\n max-height: 90vh;\n}\n\n.heading-area {\n display: flex;\n margin-bottom: var(--ic-space-xs);\n padding: 0 var(--ic-space-md);\n}\n\n.heading {\n overflow-wrap: break-word;\n}\n\n.close-icon {\n margin-left: auto;\n}\n\n.close-icon > svg {\n color: var(--ic-dialog-clear-button);\n}\n\n.content-area {\n padding: 0 var(--ic-space-md);\n margin: 0;\n overflow-y: auto;\n}\n\n#dialog-content {\n margin-bottom: var(--ic-space-sm);\n}\n\n#dialog-content ::slotted(ic-typography) {\n overflow-wrap: break-word;\n}\n\n#dialog-content ::slotted(*) {\n position: relative;\n}\n\n.dialog-controls {\n margin-top: auto;\n padding: var(--ic-space-xs) var(--ic-space-md) 0;\n display: flex;\n justify-content: flex-end;\n gap: var(--ic-space-md);\n}\n\n.dialog-control-button {\n width: fit-content;\n}\n\n.backdrop {\n overflow-y: auto;\n position: fixed;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgb(0 0 0 / 60%);\n z-index: var(--ic-z-index-dialog);\n padding-top: 16px;\n padding-bottom: 16px;\n}\n\n.heading ic-typography {\n --ic-typography-color: var(--ic-dialog-text-primary);\n}\n\n.label ic-typography {\n --ic-typography-color: var(--ic-dialog-label);\n}\n\n@media (min-width: 800px) {\n :host([size=\"large\"]) .dialog:not(.disable-width-constraint) > .content-area {\n width: 75%;\n }\n}\n\n@media (max-width: 576px) {\n .dialog {\n width: 100vw;\n height: 100vh;\n max-width: none;\n max-height: none;\n box-sizing: border-box;\n }\n\n .backdrop {\n padding: 0;\n }\n\n .dialog.disable-height-constraint {\n height: auto;\n min-height: 100vh;\n }\n}\n\n@media (max-width: 364px) {\n .dialog-control-button {\n width: unset;\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Prop,\n State,\n Method,\n Listen,\n Watch,\n h,\n Fragment,\n} from \"@stencil/core\";\nimport closeIcon from \"../../assets/close-icon.svg\";\nimport {\n isSlotUsed,\n checkResizeObserver,\n onComponentRequiredPropUndefined,\n getSlotElements,\n} from \"../../utils/helpers\";\nimport { IcFocusableComponents, IcThemeMode } from \"../../utils/types\";\n\n/**\n * @slot dialog-controls - Content will be place at the bottom of the dialog.\n * @slot heading - Content will be placed at the top of the dialog.\n * @slot label - Content will be placed above the dialog heading.\n * @slot alert - Content will be placed at the top of the content area of the dialog.\n */\n@Component({\n tag: \"ic-dialog\",\n styleUrl: \"ic-dialog.css\",\n shadow: true,\n})\nexport class Dialog {\n private backdropEl?: HTMLDivElement;\n private contentArea: HTMLSlotElement | null;\n private contentAreaMutationObserver: MutationObserver | null = null;\n private DATA_GETS_FOCUS: string = \"data-gets-focus\";\n private DIALOG_CONTROLS: string = \"dialog-controls\";\n private dialogEl?: HTMLDialogElement;\n private dialogHeight: number = 0;\n private focusedElementIndex = 0;\n private IC_TEXT_FIELD: string = \"IC-TEXT-FIELD\";\n private IC_ACCORDION: string = \"IC-ACCORDION\";\n private IC_ACCORDION_GROUP: string = \"IC-ACCORDION-GROUP\";\n private IC_CHECKBOX = \"IC-CHECKBOX\";\n private IC_SEARCH_BAR: string = \"IC-SEARCH-BAR\";\n private IC_TAB_CONTEXT: string = \"IC-TAB-CONTEXT\";\n private interactiveElementList: HTMLElement[];\n private resizeObserver: ResizeObserver | null = null;\n private resizeTimeout: number;\n private sourceElement: HTMLElement;\n\n @Element() el: HTMLIcDialogElement;\n\n @State() dialogRendered: boolean = false;\n @State() fadeIn: boolean = false;\n\n /**\n * If set to `false`, the dialog will not close when the backdrop is clicked.\n */\n @Prop() closeOnBackdropClick?: boolean = true;\n\n /**\n * If 'true', sets the 'primary' or rightmost button to the destructive variant. Stops initial focus being set on the 'primary' or rightmost default or slotted button.\n */\n @Prop() destructive?: boolean = false;\n\n /**\n * Sets the dismiss label tooltip and aria label.\n */\n @Prop() dismissLabel?: string = \"Dismiss\";\n\n /**\n * If set to `true`, the content area max height and overflow properties are removed allowing the dialog to stretch below the fold.\n * This prop also prevents popover elements from being cut off within the content area.\n */\n @Prop() disableHeightConstraint?: boolean = false;\n\n /**\n * If set to `true`, the content area width property is removed, allowing content to take the full width of the dialog when using the large variant.\n */\n @Prop() disableWidthConstraint?: boolean = false;\n\n /**\n * If `true`, the close button will not be displayed.\n */\n @Prop() hideCloseButton?: boolean = false;\n\n /**\n * If set to `true`, default button controls will not be shown, but slotted dialog controls will still be displayed.\n */\n @Prop() hideDefaultControls: boolean = false;\n\n /**\n * Sets the heading for the dialog.\n */\n @Prop() heading?: string;\n\n /**\n * Sets the optional label for the dialog which appears above the heading.\n */\n @Prop() label?: string;\n\n /**\n * If `true`, the dialog will be displayed.\n */\n @Prop({ reflect: true, mutable: true }) open?: boolean = false;\n\n @Watch(\"open\")\n watchOpenHandler(): void {\n if (this.open) {\n this.dialogOpened();\n } else {\n this.fadeIn = false;\n if (this.resizeObserver !== null) {\n this.resizeObserver.disconnect();\n }\n setTimeout(() => {\n this.dialogRendered = false;\n this.dialogEl?.close();\n this.sourceElement?.focus();\n this.dialogHeight = 0;\n this.icDialogClosed.emit();\n }, 80);\n }\n }\n\n /**\n * Sets the maximum and minimum height and width for the dialog.\n */\n @Prop() size?: \"small\" | \"medium\" | \"large\" = \"small\";\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop() theme?: IcThemeMode = \"inherit\";\n\n /**\n * Cancelation event emitted when default 'Cancel' button clicked or 'cancelDialog' method is called.\n */\n @Event() icDialogCancelled: EventEmitter<void>;\n\n /**\n * Emitted when dialog has closed.\n */\n @Event() icDialogClosed: EventEmitter<void>;\n\n /**\n * Confirmation event emitted when default 'Confirm' primary button clicked or 'confirmDialog' method is called.\n */\n @Event() icDialogConfirmed: EventEmitter<void>;\n\n /**\n * Emitted when dialog has opened.\n */\n @Event() icDialogOpened: EventEmitter<void>;\n\n disconnectedCallback(): void {\n this.removeSlotChangeListener();\n }\n\n componentDidLoad(): void {\n this.getInteractiveElements();\n\n this.refreshInteractiveElementsOnSlotChange();\n\n if (this.open) {\n this.dialogOpened();\n }\n\n !isSlotUsed(this.el, \"heading\") &&\n onComponentRequiredPropUndefined(\n [{ prop: this.heading, propName: \"heading\" }],\n \"Dialog\"\n );\n }\n\n componentDidRender(): void {\n document.body.style.overflow =\n getComputedStyle(this.el).display !== \"none\" &&\n this.disableHeightConstraint\n ? \"hidden\"\n : \"auto\";\n }\n\n @Listen(\"keydown\", { target: \"document\" })\n handleKeyboard(ev: KeyboardEvent): void {\n if (this.dialogRendered) {\n switch (ev.key) {\n case \"Tab\":\n if (this.onTabKeyPress(ev.shiftKey)) {\n ev.preventDefault();\n }\n break;\n case \"Escape\":\n if (!ev.repeat) {\n this.open = false;\n }\n ev.stopImmediatePropagation();\n break;\n }\n }\n }\n\n @Listen(\"click\", {})\n handleClick(ev: MouseEvent): void {\n if (\n this.dialogEl &&\n this.closeOnBackdropClick &&\n ev.composedPath().indexOf(this.dialogEl) <= 0\n ) {\n const { top, height, left, width } =\n this.dialogEl.getBoundingClientRect();\n const isInDialog =\n top <= ev.clientY &&\n ev.clientY <= top + height &&\n left <= ev.clientX &&\n ev.clientX <= left + width;\n if (!isInDialog) {\n this.open = false;\n }\n }\n }\n\n /**\n * Cancels the dialog. Used by the default 'Cancel' button or can be called manually to trigger cancelling of dialog.\n */\n @Method()\n async cancelDialog(): Promise<void> {\n this.icDialogCancelled.emit();\n this.open = false;\n }\n\n /**\n * Confirms the dialog. Used by the default 'Confirm' button or can be called manually to trigger confirming of dialog.\n */\n @Method()\n async confirmDialog(): Promise<void> {\n this.icDialogConfirmed.emit();\n }\n\n private dialogOpened = () => {\n this.dialogRendered = true;\n\n if (this.disableHeightConstraint) {\n this.dialogEl?.show();\n } else {\n this.dialogEl?.showModal();\n }\n\n setTimeout(() => {\n this.fadeIn = true;\n\n /**\n * This is required to set scroll back to top if:\n * - dialog content goes below the fold\n * - is closed using cancel or confirm and reopened.\n *\n * Without this, the scroll bar will start from the dialog's last scroll-x coordinate.\n */\n if (\n this.backdropEl &&\n this.disableHeightConstraint &&\n this.backdropEl.scrollTop !== 0\n ) {\n this.backdropEl.scrollTop = 0;\n }\n }, 10);\n\n setTimeout(() => {\n this.setInitialFocus();\n checkResizeObserver(this.runResizeObserver);\n }, 75);\n\n setTimeout(() => {\n this.icDialogOpened.emit();\n }, 80);\n };\n\n private runResizeObserver = () => {\n if (this.dialogEl) {\n this.resizeObserver = new ResizeObserver(() => {\n clearTimeout(this.resizeTimeout);\n this.resizeTimeout = window.setTimeout(this.resizeObserverCallback, 80);\n });\n this.resizeObserver.observe(this.dialogEl);\n }\n };\n\n private resizeObserverCallback = () => {\n if (this.dialogEl && this.dialogEl.clientHeight !== this.dialogHeight) {\n this.dialogHeight = this.dialogEl.clientHeight;\n }\n };\n\n private refreshInteractiveElementsOnSlotChange = () => {\n const contentWrapper = this.el.shadowRoot?.querySelector(\"#dialog-content\");\n\n if (contentWrapper) {\n this.contentArea = contentWrapper.querySelector(\"slot\");\n\n // Detect changes to slotted elements\n this.contentArea?.addEventListener(\n \"slotchange\",\n this.getInteractiveElements\n );\n\n this.contentAreaMutationObserver = new MutationObserver(() => {\n this.getInteractiveElements();\n });\n\n // Detect changes to children of slotted elements\n getSlotElements(contentWrapper)?.forEach((el) => {\n this.contentAreaMutationObserver?.observe(el, {\n childList: true,\n subtree: true,\n });\n });\n }\n };\n\n private removeSlotChangeListener = () => {\n if (this.contentArea) {\n this.contentArea.removeEventListener(\n \"slotchange\",\n this.getInteractiveElements\n );\n\n this.contentAreaMutationObserver?.disconnect();\n }\n };\n\n private setInitialFocus = () => {\n this.sourceElement = document.activeElement as HTMLElement;\n this.focusedElementIndex = this.interactiveElementList\n ? this.interactiveElementList.findIndex((element) =>\n element.hasAttribute(this.DATA_GETS_FOCUS)\n )\n : 0;\n this.focusElement(this.interactiveElementList[this.focusedElementIndex]);\n };\n\n private getFocusedElementIndex = () => {\n for (let i = 0; i < this.interactiveElementList.length; i++) {\n if (\n (this.interactiveElementList[i] as HTMLElement) ===\n (this.el.shadowRoot?.activeElement || document.activeElement)\n ) {\n this.focusedElementIndex = i;\n }\n }\n };\n\n private closeIconClick = () => {\n this.open = false;\n };\n\n private getInteractiveElements = () => {\n this.interactiveElementList = Array.from(\n this.el.shadowRoot?.querySelectorAll(\"ic-button\") || []\n );\n const slottedInteractiveElements = Array.from(\n this.el.querySelectorAll(\n `a[href], button, input:not(.ic-input), textarea, select, details, [tabindex]:not([tabindex=\"-1\"]),\n ic-button, ic-checkbox, ic-select, ic-search-bar, ic-tab-context,\n ic-back-to-top, ic-breadcrumb, ic-chip[dismissible=\"true\"], ic-footer-link, ic-link, ic-navigation-button,\n ic-navigation-item, ic-switch, ic-text-field, ic-accordion-group, ic-accordion, ic-date-input, ic-date-picker`\n )\n );\n if (slottedInteractiveElements.length > 0) {\n if (slottedInteractiveElements[0].slot !== this.DIALOG_CONTROLS) {\n slottedInteractiveElements[0].setAttribute(this.DATA_GETS_FOCUS, \"\");\n } else if (!this.destructive) {\n slottedInteractiveElements[\n slottedInteractiveElements.length - 1\n ].setAttribute(this.DATA_GETS_FOCUS, \"\");\n }\n }\n for (let i = 0; i < slottedInteractiveElements.length; i++) {\n this.interactiveElementList.splice(\n 1 + i,\n 0,\n slottedInteractiveElements[i] as HTMLElement\n );\n }\n };\n\n private getNextFocusEl = (focusedElementIndex: number) =>\n this.interactiveElementList[focusedElementIndex];\n\n private onTabKeyPress = (shiftKey: boolean): boolean => {\n this.getFocusedElementIndex();\n\n if (\n this.interactiveElementList[this.focusedElementIndex].tagName ===\n this.IC_SEARCH_BAR\n ) {\n return false;\n }\n\n this.setFocusIndexBasedOnShiftKey(shiftKey);\n this.loopNextFocusIndexIfLastElement();\n\n this.focusElement(this.getNextFocusEl(this.focusedElementIndex), shiftKey);\n return true;\n };\n\n private shouldSkipElement = (element: HTMLElement): boolean => {\n const isHidden =\n getComputedStyle(element).visibility === \"hidden\" ||\n element.offsetHeight === 0 ||\n element.hasAttribute(\"disabled\") ||\n (element.tagName === this.IC_ACCORDION_GROUP &&\n element.hasAttribute(\"single-expansion\"));\n\n const radioEl = element.closest(\"ic-radio-option\");\n\n return (\n isHidden ||\n (element.getAttribute(\"type\") === \"radio\" &&\n !!radioEl &&\n !(radioEl.hasAttribute(\"selected\") || element.tabIndex === 0))\n );\n };\n\n private focusElement = (element: HTMLElement, shiftKey = false) => {\n let nextFocusEl = element;\n\n if (this.shouldSkipElement(element)) {\n this.setFocusIndexBasedOnShiftKey(shiftKey);\n this.loopNextFocusIndexIfLastElement();\n\n nextFocusEl = this.getNextFocusEl(this.focusedElementIndex);\n this.focusElement(nextFocusEl, shiftKey);\n } else {\n switch (element.tagName) {\n case this.IC_ACCORDION_GROUP:\n case this.IC_ACCORDION:\n case this.IC_SEARCH_BAR:\n case this.IC_TEXT_FIELD:\n case this.IC_CHECKBOX:\n case this.IC_TAB_CONTEXT:\n (element as IcFocusableComponents).setFocus();\n break;\n default:\n (element as HTMLElement).focus();\n }\n }\n };\n\n private loopNextFocusIndexIfLastElement() {\n if (this.focusedElementIndex > this.interactiveElementList.length - 1)\n this.focusedElementIndex = 0;\n else if (this.focusedElementIndex < 0) {\n this.focusedElementIndex = this.interactiveElementList.length - 1;\n }\n }\n\n private setFocusIndexBasedOnShiftKey(shiftKey: boolean) {\n if (shiftKey) {\n this.focusedElementIndex -= 1;\n } else {\n this.focusedElementIndex += 1;\n }\n }\n\n private renderDialog = () => {\n const {\n hideDefaultControls,\n size,\n heading,\n label,\n destructive,\n dismissLabel,\n hideCloseButton,\n disableHeightConstraint,\n disableWidthConstraint,\n closeIconClick,\n DIALOG_CONTROLS,\n } = this;\n\n const controlsSlotUsed = isSlotUsed(this.el, DIALOG_CONTROLS);\n\n return (\n <dialog\n class={{\n dialog: true,\n [`${size}`]: true,\n \"disable-height-constraint\": !!disableHeightConstraint,\n \"disable-width-constraint\": !!disableWidthConstraint,\n }}\n aria-labelledby=\"dialog-label dialog-heading\"\n aria-describedby=\"dialog-alert dialog-content\"\n ref={(el) => (this.dialogEl = el)}\n >\n <div class=\"heading-area\">\n <div class=\"heading-content\">\n <div class=\"label\">\n <slot name=\"label\">\n <ic-typography variant=\"label\" id=\"dialog-label\">\n {label}\n </ic-typography>\n </slot>\n </div>\n <div class=\"heading\">\n <slot name=\"heading\">\n <ic-typography variant=\"h4\" id=\"dialog-heading\">\n {heading}\n </ic-typography>\n </slot>\n </div>\n </div>\n {!hideCloseButton && (\n <ic-button\n class=\"close-icon\"\n variant=\"icon-tertiary\"\n innerHTML={closeIcon}\n aria-label={dismissLabel}\n onClick={closeIconClick}\n data-gets-focus={\n destructive || (hideDefaultControls && !controlsSlotUsed)\n ? \"\"\n : null\n }\n ></ic-button>\n )}\n </div>\n <div class=\"content-area\">\n {isSlotUsed(this.el, \"alert\") && <slot name=\"alert\" />}\n <div id=\"dialog-content\">\n <slot />\n </div>\n </div>\n {(controlsSlotUsed || !hideDefaultControls) && (\n <div\n class={{\n [DIALOG_CONTROLS]: true,\n }}\n >\n {controlsSlotUsed ? (\n <slot name={DIALOG_CONTROLS} />\n ) : (\n <Fragment>\n <ic-button\n variant=\"tertiary\"\n onClick={() => this.cancelDialog()}\n class=\"dialog-control-button\"\n data-gets-focus={null}\n >\n Cancel\n </ic-button>\n <ic-button\n variant={destructive ? \"destructive\" : \"primary\"}\n onClick={() => this.confirmDialog()}\n class=\"dialog-control-button\"\n data-gets-focus=\"\"\n >\n Confirm\n </ic-button>\n </Fragment>\n )}\n </div>\n )}\n </dialog>\n );\n };\n\n render() {\n const { dialogRendered, disableHeightConstraint, fadeIn, theme } = this;\n\n return (\n <Host\n class={{\n \"ic-dialog-hidden\": !dialogRendered,\n \"ic-dialog-fade-in\": fadeIn,\n \"disable-height-constraint\": !!disableHeightConstraint,\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n }}\n >\n {disableHeightConstraint ? (\n <div class=\"backdrop\" ref={(el) => (this.backdropEl = el)}>\n {this.renderDialog()}\n </div>\n ) : (\n this.renderDialog()\n )}\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"ic-dialog.entry.js","mappings":";;;;;AAAA,MAAM,WAAW,GAAG,6/JAA6/J,CAAC;AAClhK,uBAAe,WAAW;;MCiCb,MAAM;IALnB;;;;;;QAQU,gCAA2B,GAA4B,IAAI,CAAC;QAC5D,oBAAe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,MAAM,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC,IACtD,IAAI,CAAC,YAAY,EAAE,CAChB,KAEN,IAAI,CAAC,YAAY,EAAE,CACpB,CACI,EACP;KACH;;;;;;;;;;","names":[],"sources":["src/components/ic-dialog/ic-dialog.css?tag=ic-dialog&encapsulation=shadow","src/components/ic-dialog/ic-dialog.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n/**\n * @prop --ic-z-index-dialog: z-index of dialog \n */\n\n:host {\n position: fixed;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100% !important;\n background: rgb(0 0 0 / 60%);\n z-index: var(--ic-z-index-dialog);\n opacity: 0;\n}\n\n:host(.ic-dialog-fade-in) {\n opacity: 1;\n}\n\n:host(.disable-height-constraint) {\n background: none;\n justify-content: unset;\n align-items: unset;\n}\n\n.dialog.disable-height-constraint {\n max-height: none;\n position: relative;\n}\n\n.dialog.disable-height-constraint .content-area {\n overflow-y: visible;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n :host {\n transition: opacity var(--ic-easing-transition-slow);\n }\n\n .dialog {\n transform: translateY(-3rem);\n transition: transform 1000s;\n }\n\n :host(.ic-dialog-fade-in) .dialog {\n transform: translateY(0);\n transition: transform var(--ic-easing-transition-slow);\n }\n}\n\n:host(.ic-dialog-hidden) {\n display: none;\n}\n\n.dialog {\n background-color: var(--ic-dialog-background);\n color: var(--ic-dialog-text-primary);\n\n --ic-typography-color: var(--ic-dialog-text-primary);\n\n border: var(--ic-space-1px) solid var(--ic-dialog-border);\n border-radius: var(--ic-border-radius);\n padding: var(--ic-space-xs) 0 var(--ic-space-md);\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n overflow-x: visible;\n}\n\n.small {\n width: 50%;\n max-width: 25rem;\n min-height: 11rem;\n max-height: 70vh;\n}\n\n.medium {\n width: 70vw;\n max-width: 44rem;\n min-height: 12.5rem;\n max-height: 70vh;\n}\n\n.large {\n width: 90vw;\n max-width: 62.5rem;\n min-height: 12.5rem;\n max-height: 90vh;\n}\n\n.heading-area {\n display: flex;\n margin-bottom: var(--ic-space-xs);\n padding: 0 var(--ic-space-md);\n}\n\n.heading {\n overflow-wrap: break-word;\n}\n\n.close-icon {\n margin-left: auto;\n}\n\n.close-icon > svg {\n color: var(--ic-dialog-clear-button);\n}\n\n.content-area {\n padding: 0 var(--ic-space-md);\n margin: 0;\n overflow-y: auto;\n}\n\n#dialog-content {\n margin-bottom: var(--ic-space-sm);\n}\n\n#dialog-content ::slotted(ic-typography) {\n overflow-wrap: break-word;\n}\n\n#dialog-content ::slotted(*) {\n position: relative;\n}\n\n.dialog-controls {\n margin-top: auto;\n padding: var(--ic-space-xs) var(--ic-space-md) 0;\n display: flex;\n justify-content: flex-end;\n gap: var(--ic-space-md);\n}\n\n.dialog-control-button {\n width: fit-content;\n}\n\n.backdrop {\n overflow-y: auto;\n position: fixed;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgb(0 0 0 / 60%);\n z-index: var(--ic-z-index-dialog);\n padding-top: 16px;\n padding-bottom: 16px;\n}\n\n.heading ic-typography {\n --ic-typography-color: var(--ic-dialog-text-primary);\n}\n\n.label ic-typography {\n --ic-typography-color: var(--ic-dialog-label);\n}\n\n@media (min-width: 800px) {\n :host([size=\"large\"]) .dialog:not(.disable-width-constraint) > .content-area {\n width: 75%;\n }\n}\n\n@media (max-width: 576px) {\n .dialog {\n width: 100vw;\n height: 100vh;\n max-width: none;\n max-height: none;\n box-sizing: border-box;\n }\n\n .backdrop {\n padding: 0;\n }\n\n .dialog.disable-height-constraint {\n height: auto;\n min-height: 100vh;\n }\n}\n\n@media (max-width: 364px) {\n .dialog-control-button {\n width: unset;\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Prop,\n State,\n Method,\n Listen,\n Watch,\n h,\n Fragment,\n} from \"@stencil/core\";\nimport closeIcon from \"../../assets/close-icon.svg\";\nimport {\n isSlotUsed,\n checkResizeObserver,\n onComponentRequiredPropUndefined,\n getSlotElements,\n} from \"../../utils/helpers\";\nimport { IcFocusableComponents, IcThemeMode } from \"../../utils/types\";\n\n/**\n * @slot dialog-controls - Content will be place at the bottom of the dialog.\n * @slot heading - Content will be placed at the top of the dialog.\n * @slot label - Content will be placed above the dialog heading.\n * @slot alert - Content will be placed at the top of the content area of the dialog.\n */\n@Component({\n tag: \"ic-dialog\",\n styleUrl: \"ic-dialog.css\",\n shadow: true,\n})\nexport class Dialog {\n private backdropEl?: HTMLDivElement;\n private contentArea: HTMLSlotElement | null;\n private contentAreaMutationObserver: MutationObserver | null = null;\n private DATA_GETS_FOCUS: string = \"data-gets-focus\";\n private DIALOG_CONTROLS: string = \"dialog-controls\";\n private dialogEl?: HTMLDialogElement;\n private dialogHeight: number = 0;\n private focusedElementIndex = 0;\n private IC_TEXT_FIELD: string = \"IC-TEXT-FIELD\";\n private IC_ACCORDION: string = \"IC-ACCORDION\";\n private IC_ACCORDION_GROUP: string = \"IC-ACCORDION-GROUP\";\n private IC_CHECKBOX = \"IC-CHECKBOX\";\n private IC_SEARCH_BAR: string = \"IC-SEARCH-BAR\";\n private IC_TAB_CONTEXT: string = \"IC-TAB-CONTEXT\";\n private interactiveElementList: HTMLElement[] = [];\n private resizeObserver: ResizeObserver | null = null;\n private resizeTimeout: number;\n private sourceElement: HTMLElement;\n private focusAttemptCount = 0;\n\n @Element() el: HTMLIcDialogElement;\n\n @State() dialogRendered: boolean = false;\n @State() fadeIn: boolean = false;\n\n /**\n * If set to `false`, the dialog will not close when the backdrop is clicked.\n */\n @Prop() closeOnBackdropClick?: boolean = true;\n\n /**\n * If 'true', sets the 'primary' or rightmost button to the destructive variant. Stops initial focus being set on the 'primary' or rightmost default or slotted button.\n */\n @Prop() destructive?: boolean = false;\n\n /**\n * Sets the dismiss label tooltip and aria label.\n */\n @Prop() dismissLabel?: string = \"Dismiss\";\n\n /**\n * If set to `true`, the content area max height and overflow properties are removed allowing the dialog to stretch below the fold.\n * This prop also prevents popover elements from being cut off within the content area.\n */\n @Prop() disableHeightConstraint?: boolean = false;\n\n /**\n * If set to `true`, the content area width property is removed, allowing content to take the full width of the dialog when using the large variant.\n */\n @Prop() disableWidthConstraint?: boolean = false;\n\n /**\n * If `true`, the close button will not be displayed.\n */\n @Prop() hideCloseButton?: boolean = false;\n\n /**\n * If set to `true`, default button controls will not be shown, but slotted dialog controls will still be displayed.\n */\n @Prop() hideDefaultControls: boolean = false;\n\n /**\n * Sets the heading for the dialog.\n */\n @Prop() heading?: string;\n\n /**\n * Sets the optional label for the dialog which appears above the heading.\n */\n @Prop() label?: string;\n\n /**\n * If `true`, the dialog will be displayed.\n */\n @Prop({ reflect: true, mutable: true }) open?: boolean = false;\n\n @Watch(\"open\")\n watchOpenHandler(): void {\n if (this.open) {\n this.dialogOpened();\n } else {\n this.fadeIn = false;\n if (this.resizeObserver !== null) {\n this.resizeObserver.disconnect();\n }\n setTimeout(() => {\n this.dialogRendered = false;\n this.dialogEl?.close();\n this.sourceElement?.focus();\n this.dialogHeight = 0;\n this.icDialogClosed.emit();\n }, 80);\n }\n }\n\n /**\n * Sets the maximum and minimum height and width for the dialog.\n */\n @Prop() size?: \"small\" | \"medium\" | \"large\" = \"small\";\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop() theme?: IcThemeMode = \"inherit\";\n\n /**\n * Cancellation event emitted when default 'Cancel' button clicked or 'cancelDialog' method is called.\n */\n @Event() icDialogCancelled: EventEmitter<void>;\n\n /**\n * Emitted when dialog has closed.\n */\n @Event() icDialogClosed: EventEmitter<void>;\n\n /**\n * Confirmation event emitted when default 'Confirm' primary button clicked or 'confirmDialog' method is called.\n */\n @Event() icDialogConfirmed: EventEmitter<void>;\n\n /**\n * Emitted when dialog has opened.\n */\n @Event() icDialogOpened: EventEmitter<void>;\n\n disconnectedCallback(): void {\n this.removeSlotChangeListener();\n }\n\n componentDidLoad(): void {\n this.refreshInteractiveElementsOnSlotChange();\n\n if (this.open) {\n this.dialogOpened();\n }\n\n !isSlotUsed(this.el, \"heading\") &&\n onComponentRequiredPropUndefined(\n [{ prop: this.heading, propName: \"heading\" }],\n \"Dialog\"\n );\n }\n\n componentDidRender(): void {\n document.body.style.overflow =\n getComputedStyle(this.el).display !== \"none\" &&\n this.disableHeightConstraint\n ? \"hidden\"\n : \"auto\";\n }\n\n @Listen(\"keydown\", { target: \"document\" })\n handleKeyboard(ev: KeyboardEvent): void {\n if (this.dialogRendered) {\n switch (ev.key) {\n case \"Tab\":\n if (this.onTabKeyPress(ev.shiftKey)) {\n ev.preventDefault();\n }\n break;\n case \"Escape\":\n if (!ev.repeat) {\n this.open = false;\n }\n ev.stopImmediatePropagation();\n break;\n }\n }\n }\n\n @Listen(\"click\", {})\n handleClick(ev: MouseEvent): void {\n if (\n this.dialogEl &&\n this.closeOnBackdropClick &&\n ev.composedPath().indexOf(this.dialogEl) <= 0\n ) {\n const { top, height, left, width } =\n this.dialogEl.getBoundingClientRect();\n const isInDialog =\n top <= ev.clientY &&\n ev.clientY <= top + height &&\n left <= ev.clientX &&\n ev.clientX <= left + width;\n if (!isInDialog) {\n this.open = false;\n }\n }\n }\n\n /**\n * Cancels the dialog. Used by the default 'Cancel' button or can be called manually to trigger cancelling of dialog.\n */\n @Method()\n async cancelDialog(): Promise<void> {\n this.icDialogCancelled.emit();\n this.open = false;\n }\n\n /**\n * Confirms the dialog. Used by the default 'Confirm' button or can be called manually to trigger confirming of dialog.\n */\n @Method()\n async confirmDialog(): Promise<void> {\n this.icDialogConfirmed.emit();\n }\n\n private dialogOpened = () => {\n this.dialogRendered = true;\n\n if (this.disableHeightConstraint) {\n this.dialogEl?.show();\n } else {\n this.dialogEl?.showModal();\n }\n\n setTimeout(() => {\n this.fadeIn = true;\n\n /**\n * This is required to set scroll back to top if:\n * - dialog content goes below the fold\n * - is closed using cancel or confirm and reopened.\n *\n * Without this, the scroll bar will start from the dialog's last scroll-x coordinate.\n */\n if (\n this.backdropEl &&\n this.disableHeightConstraint &&\n this.backdropEl.scrollTop !== 0\n ) {\n this.backdropEl.scrollTop = 0;\n }\n }, 10);\n\n setTimeout(() => {\n this.getInteractiveElements();\n this.setInitialFocus();\n checkResizeObserver(this.runResizeObserver);\n }, 75);\n\n setTimeout(() => {\n this.icDialogOpened.emit();\n }, 80);\n };\n\n private runResizeObserver = () => {\n if (this.dialogEl) {\n this.resizeObserver = new ResizeObserver(() => {\n clearTimeout(this.resizeTimeout);\n this.resizeTimeout = window.setTimeout(this.resizeObserverCallback, 80);\n });\n this.resizeObserver.observe(this.dialogEl);\n }\n };\n\n private resizeObserverCallback = () => {\n if (this.dialogEl && this.dialogEl.clientHeight !== this.dialogHeight) {\n this.dialogHeight = this.dialogEl.clientHeight;\n }\n };\n\n private refreshInteractiveElementsOnSlotChange = () => {\n const contentWrapper = this.el.shadowRoot?.querySelector(\"#dialog-content\");\n\n if (contentWrapper) {\n this.contentArea = contentWrapper.querySelector(\"slot\");\n\n // Detect changes to slotted elements\n this.contentArea?.addEventListener(\n \"slotchange\",\n this.getInteractiveElements\n );\n\n this.contentAreaMutationObserver = new MutationObserver(() => {\n this.getInteractiveElements();\n });\n\n // Detect changes to children of slotted elements\n getSlotElements(contentWrapper)?.forEach((el) => {\n this.contentAreaMutationObserver?.observe(el, {\n childList: true,\n subtree: true,\n });\n });\n }\n };\n\n private removeSlotChangeListener = () => {\n if (this.contentArea) {\n this.contentArea.removeEventListener(\n \"slotchange\",\n this.getInteractiveElements\n );\n\n this.contentAreaMutationObserver?.disconnect();\n }\n };\n\n private setInitialFocus = () => {\n this.sourceElement = document.activeElement as HTMLElement;\n\n if (!this.interactiveElementList.length) {\n // No interactive elements yet, retry shortly\n setTimeout(() => {\n this.getInteractiveElements();\n if (this.interactiveElementList.length) {\n this.setInitialFocus();\n }\n }, 10);\n return;\n }\n\n this.focusedElementIndex = this.interactiveElementList.findIndex(\n (element) => element.hasAttribute(this.DATA_GETS_FOCUS)\n );\n\n if (this.focusedElementIndex === -1) {\n this.focusedElementIndex = 0;\n }\n\n const elToFocus = this.interactiveElementList[this.focusedElementIndex];\n if (elToFocus) {\n this.focusElement(elToFocus);\n }\n };\n\n private getFocusedElementIndex = () => {\n for (let i = 0; i < this.interactiveElementList.length; i++) {\n if (\n (this.interactiveElementList[i] as HTMLElement) ===\n (this.el.shadowRoot?.activeElement || document.activeElement)\n ) {\n this.focusedElementIndex = i;\n }\n }\n };\n\n private closeIconClick = () => {\n this.open = false;\n };\n\n private getInteractiveElements = () => {\n this.interactiveElementList = Array.from(\n this.el.shadowRoot?.querySelectorAll(\"ic-button\") || []\n );\n\n const slottedInteractiveElements = Array.from(\n this.el.querySelectorAll(\n `a[href], button, input:not(.ic-input), textarea, select, details, [tabindex]:not([tabindex=\"-1\"]),\n ic-button, ic-checkbox, ic-select, ic-search-bar, ic-tab-context,\n ic-back-to-top, ic-breadcrumb, ic-chip[dismissible=\"true\"], ic-footer-link, ic-link, ic-navigation-button,\n ic-navigation-item, ic-switch, ic-text-field, ic-accordion-group, ic-accordion, ic-date-input, ic-date-picker`\n )\n );\n\n if (slottedInteractiveElements.length > 0) {\n if (slottedInteractiveElements[0].slot !== this.DIALOG_CONTROLS) {\n slottedInteractiveElements[0].setAttribute(this.DATA_GETS_FOCUS, \"\");\n } else if (!this.destructive) {\n slottedInteractiveElements[\n slottedInteractiveElements.length - 1\n ].setAttribute(this.DATA_GETS_FOCUS, \"\");\n }\n }\n\n for (let i = 0; i < slottedInteractiveElements.length; i++) {\n this.interactiveElementList.splice(\n 1 + i,\n 0,\n slottedInteractiveElements[i] as HTMLElement\n );\n }\n };\n\n private getNextFocusEl = (focusedElementIndex: number) =>\n this.interactiveElementList[focusedElementIndex];\n\n private onTabKeyPress = (shiftKey: boolean): boolean => {\n this.getFocusedElementIndex();\n\n if (\n this.interactiveElementList[this.focusedElementIndex]?.tagName ===\n this.IC_SEARCH_BAR\n ) {\n return false;\n }\n\n this.setFocusIndexBasedOnShiftKey(shiftKey);\n this.loopNextFocusIndexIfLastElement();\n\n this.focusAttemptCount = 0;\n this.focusElement(this.getNextFocusEl(this.focusedElementIndex), shiftKey);\n return true;\n };\n\n private shouldSkipElement = (element: HTMLElement): boolean => {\n if (!element) {\n return true;\n }\n\n const isHidden =\n getComputedStyle(element).visibility === \"hidden\" ||\n element.offsetHeight === 0 ||\n element.hasAttribute(\"disabled\") ||\n (element.tagName === this.IC_ACCORDION_GROUP &&\n element.hasAttribute(\"single-expansion\"));\n\n const radioEl = element.closest(\"ic-radio-option\");\n\n return (\n isHidden ||\n (element.getAttribute(\"type\") === \"radio\" &&\n !!radioEl &&\n !(radioEl.hasAttribute(\"selected\") || element.tabIndex === 0))\n );\n };\n\n private focusElement = (\n element: HTMLElement | undefined,\n shiftKey = false\n ) => {\n if (!element) {\n return;\n }\n\n if (this.focusAttemptCount++ > this.interactiveElementList.length) {\n return;\n }\n\n if (this.shouldSkipElement(element)) {\n this.setFocusIndexBasedOnShiftKey(shiftKey);\n this.loopNextFocusIndexIfLastElement();\n this.focusElement(\n this.getNextFocusEl(this.focusedElementIndex),\n shiftKey\n );\n } else {\n switch (element.tagName) {\n case this.IC_ACCORDION_GROUP:\n case this.IC_ACCORDION:\n case this.IC_SEARCH_BAR:\n case this.IC_TEXT_FIELD:\n case this.IC_CHECKBOX:\n case this.IC_TAB_CONTEXT:\n (element as IcFocusableComponents).setFocus();\n break;\n default:\n element.focus();\n }\n }\n };\n\n private loopNextFocusIndexIfLastElement() {\n if (this.focusedElementIndex > this.interactiveElementList.length - 1)\n this.focusedElementIndex = 0;\n else if (this.focusedElementIndex < 0) {\n this.focusedElementIndex = this.interactiveElementList.length - 1;\n }\n }\n\n private setFocusIndexBasedOnShiftKey(shiftKey: boolean) {\n if (shiftKey) {\n this.focusedElementIndex -= 1;\n } else {\n this.focusedElementIndex += 1;\n }\n }\n\n private renderDialog = () => {\n const {\n hideDefaultControls,\n size,\n heading,\n label,\n destructive,\n dismissLabel,\n hideCloseButton,\n disableHeightConstraint,\n disableWidthConstraint,\n closeIconClick,\n DIALOG_CONTROLS,\n } = this;\n\n const controlsSlotUsed = isSlotUsed(this.el, DIALOG_CONTROLS);\n\n return (\n <dialog\n class={{\n dialog: true,\n [`${size}`]: true,\n \"disable-height-constraint\": !!disableHeightConstraint,\n \"disable-width-constraint\": !!disableWidthConstraint,\n }}\n aria-labelledby=\"dialog-label dialog-heading\"\n aria-describedby=\"dialog-alert dialog-content\"\n ref={(el) => (this.dialogEl = el)}\n >\n <div class=\"heading-area\">\n <div class=\"heading-content\">\n <div class=\"label\">\n <slot name=\"label\">\n <ic-typography variant=\"label\" id=\"dialog-label\">\n {label}\n </ic-typography>\n </slot>\n </div>\n <div class=\"heading\">\n <slot name=\"heading\">\n <ic-typography variant=\"h4\" id=\"dialog-heading\">\n {heading}\n </ic-typography>\n </slot>\n </div>\n </div>\n {!hideCloseButton && (\n <ic-button\n class=\"close-icon\"\n variant=\"icon-tertiary\"\n innerHTML={closeIcon}\n aria-label={dismissLabel}\n onClick={closeIconClick}\n data-gets-focus={\n destructive || (hideDefaultControls && !controlsSlotUsed)\n ? \"\"\n : null\n }\n ></ic-button>\n )}\n </div>\n <div class=\"content-area\">\n {isSlotUsed(this.el, \"alert\") && <slot name=\"alert\" />}\n <div id=\"dialog-content\">\n <slot />\n </div>\n </div>\n {(controlsSlotUsed || !hideDefaultControls) && (\n <div\n class={{\n [DIALOG_CONTROLS]: true,\n }}\n >\n {controlsSlotUsed ? (\n <slot name={DIALOG_CONTROLS} />\n ) : (\n <Fragment>\n <ic-button\n variant=\"tertiary\"\n onClick={() => this.cancelDialog()}\n class=\"dialog-control-button\"\n data-gets-focus={null}\n >\n Cancel\n </ic-button>\n <ic-button\n variant={destructive ? \"destructive\" : \"primary\"}\n onClick={() => this.confirmDialog()}\n class=\"dialog-control-button\"\n data-gets-focus=\"\"\n >\n Confirm\n </ic-button>\n </Fragment>\n )}\n </div>\n )}\n </dialog>\n );\n };\n\n render() {\n const { dialogRendered, disableHeightConstraint, fadeIn, theme } = this;\n\n return (\n <Host\n class={{\n \"ic-dialog-hidden\": !dialogRendered,\n \"ic-dialog-fade-in\": fadeIn,\n \"disable-height-constraint\": !!disableHeightConstraint,\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n }}\n >\n {disableHeightConstraint ? (\n <div class=\"backdrop\" ref={(el) => (this.backdropEl = el)}>\n {this.renderDialog()}\n </div>\n ) : (\n this.renderDialog()\n )}\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1896,7 +1896,7 @@ const Menu = class {
1896
1896
  const { value, label } = event.target.dataset;
1897
1897
  if (this.multiSelect) {
1898
1898
  const menuOptions = this.getMenuOptions();
1899
- const selectedOptionIndex = menuOptions.findIndex((option) => option.value === value);
1899
+ const selectedOptionIndex = menuOptions.findIndex((option) => option[this.valueField] === value);
1900
1900
  this.handleOptionSelect(event, selectedOptionIndex, true);
1901
1901
  this.multiOptionClicked = value || null;
1902
1902
  }
@@ -2201,11 +2201,14 @@ const Menu = class {
2201
2201
  return (h(Fragment, null, option.loading && h("ic-loading-indicator", { size: "icon" }), h("div", { class: {
2202
2202
  "option-text-container": true,
2203
2203
  "show-check-icon": showCheckIcon,
2204
- } }, h("div", { class: "option-label" }, option.icon && (h("div", { class: "option-icon", innerHTML: sanitizeHTMLIconString(option.icon), "aria-hidden": "true" })), h("ic-typography", { variant: "body", "aria-hidden": "true" }, option[this.labelField])), option.description && (h("ic-typography", { id: `${this.getOptionId(option[this.valueField])}-description`, class: "option-description", variant: "caption", "aria-hidden": "true" }, h("p", null, option.description))), option.element && (h("div", { class: "option-element", innerHTML: sanitizeHTMLString(option.element.component), "aria-hidden": "true" }))), showCheckIcon && h("span", { class: "check-icon", innerHTML: Check })));
2204
+ } }, (option.icon || !option.hideLabel) && (h("div", { class: "option-label" }, option.icon && (h("div", { class: "option-icon", innerHTML: sanitizeHTMLIconString(option.icon), "aria-hidden": "true" })), !option.hideLabel && (h("ic-typography", { variant: "body", "aria-hidden": "true" }, option[this.labelField])))), option.description && (h("ic-typography", { id: `${this.getOptionId(option[this.valueField])}-description`, class: "option-description", variant: "caption", "aria-hidden": "true" }, h("p", null, option.description))), option.element && (h("div", { class: {
2205
+ "option-element": option.icon || !option.hideLabel || option.description,
2206
+ }, innerHTML: sanitizeHTMLString(option.element.component), "aria-hidden": "true" }))), showCheckIcon && h("span", { class: "check-icon", innerHTML: Check })));
2205
2207
  };
2206
2208
  this.displayOption = (option, selected, index, parentOption) => {
2209
+ var _a;
2207
2210
  const { open, keyboardNav, isManualMode, initialOptionsListRender, optionHighlighted, options, } = this;
2208
- return (h("li", { id: this.getOptionId(option[this.valueField]), class: {
2211
+ return (h("li", Object.assign({ id: this.getOptionId(option[this.valueField]), class: {
2209
2212
  option: true,
2210
2213
  "focused-option": isManualMode
2211
2214
  ? (keyboardNav || initialOptionsListRender) &&
@@ -2223,7 +2226,7 @@ const Menu = class {
2223
2226
  ? "0"
2224
2227
  : "-1", "aria-label": this.getOptionAriaLabel(option, parentOption), "aria-selected": selected ? "true" : "false", "aria-disabled": option.disabled ? "true" : "false", onClick: !option.timedOut && !option.loading
2225
2228
  ? this.handleOptionClick
2226
- : undefined, onBlur: this.handleBlur, onMouseDown: this.handleMouseDown, "data-value": option[this.valueField], "data-label": option[this.labelField] }, option.timedOut ? (h(Fragment, null, h("div", { class: "loading-error-info" }, h("svg", { class: "error-icon-svg", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "#000000" }, h("title", null, "Error"), h("g", null, h("path", { d: "M8.77 3L3.5 8.27V15.73L8.77 21H16.23L21.5 15.73V8.27L16.23 3M8.91 7L12.5 10.59L16.09 7L17.5 8.41L13.91 12L17.5 15.59L16.09 17L12.5 13.41L8.91 17L7.5 15.59L11.09 12L7.5 8.41" }))), h("ic-typography", { variant: "label" }, option[this.labelField])), h("ic-button", { size: "small", variant: "tertiary", onClick: this.handleRetry, onKeyDown: this.handleRetryKeyDown, onBlur: this.handleTimeoutBlur, id: "retry-button" }, "Retry"))) : (this.optionContent(option, selected))));
2229
+ : undefined, onBlur: this.handleBlur, onMouseDown: this.handleMouseDown, "data-value": option[this.valueField], "data-label": option[this.labelField] }, ((_a = option.htmlProps) !== null && _a !== void 0 ? _a : {})), option.timedOut ? (h(Fragment, null, h("div", { class: "loading-error-info" }, h("svg", { class: "error-icon-svg", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "#000000" }, h("title", null, "Error"), h("g", null, h("path", { d: "M8.77 3L3.5 8.27V15.73L8.77 21H16.23L21.5 15.73V8.27L16.23 3M8.91 7L12.5 10.59L16.09 7L17.5 8.41L13.91 12L17.5 15.59L16.09 17L12.5 13.41L8.91 17L7.5 15.59L11.09 12L7.5 8.41" }))), h("ic-typography", { variant: "label" }, option[this.labelField])), h("ic-button", { size: "small", variant: "tertiary", onClick: this.handleRetry, onKeyDown: this.handleRetryKeyDown, onBlur: this.handleTimeoutBlur, id: "retry-button" }, "Retry"))) : (this.optionContent(option, selected))));
2227
2230
  };
2228
2231
  }
2229
2232
  watchOpenHandler() {
@@ -2390,7 +2393,7 @@ const Menu = class {
2390
2393
  const { inputLabel, options, menuId, value, fullWidth, hasTimedOut, isLoading, size, open, inputEl, keyboardNav, parentEl, SEARCH_BAR_TAG, multiSelect, } = this;
2391
2394
  const selectAllButtonText = `${(value === null || value === void 0 ? void 0 : value.length) === this.ungroupedOptions.length ? "Clear" : "Select"} all`;
2392
2395
  const hasNoResults = this.host.classList.contains("no-results");
2393
- return (h(Host, { key: 'e17a70bcf59709dd5b9d0cc7b404520ff06bcf35', class: {
2396
+ return (h(Host, { key: '3e49d54ba714dfa55e9695bd24fa5d2b87077232', class: {
2394
2397
  "ic-menu-full-width": !!fullWidth,
2395
2398
  "ic-menu-no-focus": ((inputEl === null || inputEl === void 0 ? void 0 : inputEl.tagName) === "INPUT" &&
2396
2399
  (parentEl === null || parentEl === void 0 ? void 0 : parentEl.tagName) !== SEARCH_BAR_TAG) ||
@@ -2399,7 +2402,7 @@ const Menu = class {
2399
2402
  [`ic-menu-${size}`]: true,
2400
2403
  "ic-menu-open": open && options.length !== 0,
2401
2404
  "ic-menu-multiple": multiSelect,
2402
- } }, options.length !== 0 && (h("ul", { key: '438cd6126c1296a14e216edc0a5d790a4705b143', id: menuId, class: "menu", role: "listbox", "aria-label": `${inputLabel} pop-up`, "aria-multiselectable": multiSelect ? "true" : "false", tabindex: open &&
2405
+ } }, options.length !== 0 && (h("ul", { key: '23fc717879b9c8bac93158984ccd81f0b0227ab9', id: menuId, class: "menu", role: "listbox", "aria-label": `${inputLabel} pop-up`, "aria-multiselectable": multiSelect ? "true" : "false", tabindex: open &&
2403
2406
  !keyboardNav &&
2404
2407
  ((inputEl === null || inputEl === void 0 ? void 0 : inputEl.tagName) !== "INPUT" ||
2405
2408
  (parentEl === null || parentEl === void 0 ? void 0 : parentEl.tagName) === SEARCH_BAR_TAG)
@@ -2407,7 +2410,7 @@ const Menu = class {
2407
2410
  : "-1", ref: (el) => (this.menu = el), onKeyDown: this.handleMenuKeyDown, onKeyUp: this.handleMenuKeyUp, onBlur: this.handleBlur }, this.getSortedOptions(options).map((option, index) => {
2408
2411
  if (option.children) {
2409
2412
  if (option.children.length > 0) {
2410
- return (h("div", null, h("ic-typography", { class: "option-group-title", role: "presentation", variant: "subtitle-small" }, h("p", null, option[this.labelField])), option.children.map((childOption) => childOption.label &&
2413
+ return (h("div", null, h("ic-typography", { class: "option-group-title", role: "presentation", variant: "subtitle-small" }, h("p", null, option[this.labelField])), option.children.map((childOption) => childOption[this.labelField] &&
2411
2414
  this.displayOption(childOption, multiSelect
2412
2415
  ? value === null || value === void 0 ? void 0 : value.includes(childOption[this.valueField])
2413
2416
  : childOption[this.valueField] === value, index, option))));
@@ -2418,7 +2421,7 @@ const Menu = class {
2418
2421
  }
2419
2422
  else {
2420
2423
  // Display option only if it has a label (rather than displaying an empty space)
2421
- return (option.label &&
2424
+ return (option[this.labelField] &&
2422
2425
  this.displayOption(option, multiSelect
2423
2426
  ? value === null || value === void 0 ? void 0 : value.includes(option[this.valueField])
2424
2427
  : option[this.valueField] === value, index));
@@ -2427,7 +2430,7 @@ const Menu = class {
2427
2430
  multiSelect &&
2428
2431
  !isLoading &&
2429
2432
  !hasTimedOut &&
2430
- !hasNoResults && (h("div", { key: '5732c5ac4fa70ff249a7851d61aee8ccf46082d1', class: "option-bar" }, h("ic-typography", { key: '48ce8543a189cad706804715a077575b3774e490' }, h("p", { key: '63537752e580815f650c3d9bbf38b23267c5229c' }, `${value ? value.length : 0}/${getOptionsWithoutGroupTitlesCount(this.options)} selected`)), h("ic-button", { key: '60c446e5303a3939494284b9ce7772feb1fe547c', class: "select-all-button", "aria-label": `${selectAllButtonText} options for ${inputLabel}`, ref: (el) => (this.selectAllButton = el), variant: "tertiary", onClick: this.handleSelectAllClick, onMouseDown: this.handleSelectAllMouseDown, onBlur: this.handleSelectAllBlur, onFocus: this.handleSelectAllFocus, size: size === "small" ? "small" : "medium" }, selectAllButtonText)))));
2433
+ !hasNoResults && (h("div", { key: '997b84a875c8ab4cc763b6047ece029a51e03165', class: "option-bar" }, h("ic-typography", { key: 'ff3ef41753cebd248a6d59169ef68ae12f0563ca' }, h("p", { key: '3fe3ae4ca8f766216e5258eea8dbb71d1efd2169' }, `${value ? value.length : 0}/${getOptionsWithoutGroupTitlesCount(this.options)} selected`)), h("ic-button", { key: 'f269fc5554327fd11a8093857f0f9208a3b1ca62', class: "select-all-button", "aria-label": `${selectAllButtonText} options for ${inputLabel}`, ref: (el) => (this.selectAllButton = el), variant: "tertiary", onClick: this.handleSelectAllClick, onMouseDown: this.handleSelectAllMouseDown, onBlur: this.handleSelectAllBlur, onFocus: this.handleSelectAllFocus, size: size === "small" ? "small" : "medium" }, selectAllButtonText)))));
2431
2434
  }
2432
2435
  get host() { return getElement(this); }
2433
2436
  static get watchers() { return {