@carbon/web-components 2.11.0-rc.0 → 2.11.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 (171) hide show
  1. package/dist/16-486ace1a.js +4 -4
  2. package/dist/16-51a594ce.js +4 -4
  3. package/dist/16-656090c0.js +4 -4
  4. package/dist/16-71872213.js +4 -4
  5. package/dist/16-730a41a2.js +4 -4
  6. package/dist/16-83a1cd89.js +4 -4
  7. package/dist/16-b73c677b.js +4 -4
  8. package/dist/16-d1c73001.js +4 -4
  9. package/dist/20-d069d8da.js +4 -4
  10. package/dist/accordion.min.js +17 -11
  11. package/dist/ai-skeleton.min.js +4 -4
  12. package/dist/breadcrumb.min.js +4 -4
  13. package/dist/button-21c75bab.js +4 -4
  14. package/dist/button-set-69863a24.js +4 -4
  15. package/dist/button-skeleton-1abc1fd8.js +4 -4
  16. package/dist/button.min.js +4 -4
  17. package/dist/carbon-element-4ca9803f.js +4 -4
  18. package/dist/chat-button.min.js +7 -7
  19. package/dist/checkbox-d0a3a79f.js +4 -4
  20. package/dist/checkbox.min.js +4 -4
  21. package/dist/class-map-5edb95da.js +4 -4
  22. package/dist/code-snippet.min.js +5 -5
  23. package/dist/collection-helpers-4e32fe16.js +4 -4
  24. package/dist/combo-box.min.js +4 -4
  25. package/dist/content-switcher-item-5b8dd42f.js +4 -4
  26. package/dist/content-switcher.min.js +4 -4
  27. package/dist/{copy-button-0cfa83bd.js → copy-button-d673538b.js} +7 -7
  28. package/dist/copy-button.min.js +5 -5
  29. package/dist/data-table.min.js +22 -22
  30. package/dist/date-picker.min.js +5 -5
  31. package/dist/defineProperty-e448b551.js +4 -4
  32. package/dist/directive-e2d48b9c.js +4 -4
  33. package/dist/dropdown-item-91b3dc95.js +4 -4
  34. package/dist/dropdown.min.js +4 -4
  35. package/dist/file-uploader.min.js +12 -12
  36. package/dist/floating-menu-46199beb.js +4 -4
  37. package/dist/floating-menu.min.js +4 -4
  38. package/dist/focus-e70d1cbe.js +4 -4
  39. package/dist/form-group.min.js +5 -5
  40. package/dist/form.min.js +4 -4
  41. package/dist/get-52a048b1.js +4 -4
  42. package/dist/host-listener-b6a3d690.js +4 -4
  43. package/dist/{icon-button-37322eeb.js → icon-button-09275c70.js} +6 -6
  44. package/dist/icon-button.min.js +5 -5
  45. package/dist/if-defined-2e09d22b.js +4 -4
  46. package/dist/if-non-empty-20ce3c96.js +4 -4
  47. package/dist/inline-loading.min.js +4 -4
  48. package/dist/{layer-0633200a.js → layer-5f257c4a.js} +5 -5
  49. package/dist/layer.min.js +5 -5
  50. package/dist/link-dc6f9b4e.js +4 -4
  51. package/dist/link.min.js +4 -4
  52. package/dist/list.min.js +4 -4
  53. package/dist/loading-2604f4ad.js +4 -4
  54. package/dist/loading-icon-85b7e502.js +4 -4
  55. package/dist/loading.min.js +4 -4
  56. package/dist/modal-label-d53c98de.js +4 -4
  57. package/dist/modal.min.js +4 -4
  58. package/dist/multi-select.min.js +4 -4
  59. package/dist/notification.min.js +13 -13
  60. package/dist/number-input.min.js +5 -5
  61. package/dist/objectSpread2-46e4de7a.js +4 -4
  62. package/dist/on-6c264d49.js +4 -4
  63. package/dist/overflow-menu.min.js +5 -5
  64. package/dist/pagination.min.js +4 -4
  65. package/dist/{popover-content-11101167.js → popover-content-08cf10b0.js} +6 -6
  66. package/dist/popover-controller-cc6ccb74.js +4 -4
  67. package/dist/popover.min.js +5 -5
  68. package/dist/progress-bar.min.js +6 -6
  69. package/dist/progress-indicator.min.js +4 -4
  70. package/dist/query-5f833318.js +4 -4
  71. package/dist/query-assigned-elements-73bd2544.js +4 -4
  72. package/dist/radio-button.min.js +4 -4
  73. package/dist/radio-group-manager-de7f9ab3.js +4 -4
  74. package/dist/{search-1b5a2d87.js → search-23232b04.js} +5 -5
  75. package/dist/search.min.js +5 -5
  76. package/dist/select-item-4ebf72a0.js +4 -4
  77. package/dist/select.min.js +17 -17
  78. package/dist/settings-97cd1c3a.js +4 -4
  79. package/dist/shared-enums-c6fe8c39.js +4 -4
  80. package/dist/side-panel.min.js +5 -5
  81. package/dist/skeleton-icon-bfc7d5c8.js +4 -4
  82. package/dist/skeleton-icon.min.js +4 -4
  83. package/dist/skeleton-placeholder-403f26a3.js +4 -4
  84. package/dist/skeleton-placeholder.min.js +4 -4
  85. package/dist/skeleton-text-9d02604f.js +4 -4
  86. package/dist/skeleton-text.min.js +4 -4
  87. package/dist/skip-to-content.min.js +4 -4
  88. package/dist/slider.min.js +4 -4
  89. package/dist/slug.min.js +5 -5
  90. package/dist/spread-d515f3f1.js +4 -4
  91. package/dist/stack.min.js +6 -6
  92. package/dist/state-ddd29b9d.js +4 -4
  93. package/dist/structured-list.min.js +4 -4
  94. package/dist/tabs.min.js +4 -4
  95. package/dist/tag.min.js +4 -4
  96. package/dist/tearsheet.min.js +5 -5
  97. package/dist/{text-input-672028f4.js → text-input-ead65188.js} +6 -6
  98. package/dist/text-input.min.js +6 -6
  99. package/dist/textarea.min.js +9 -9
  100. package/dist/tile.min.js +4 -4
  101. package/dist/toggle-tip.min.js +5 -5
  102. package/dist/toggle.min.js +4 -4
  103. package/dist/{toggletip-b1b58c28.js → toggletip-f95c53b0.js} +7 -7
  104. package/dist/{tooltip-content-51c6ffbc.js → tooltip-content-d784ae2b.js} +5 -5
  105. package/dist/tooltip.min.js +5 -5
  106. package/dist/ui-shell.min.js +18 -18
  107. package/dist/validity-d86ffa4f.js +4 -4
  108. package/es/components/chat-button/chat-button.js +2 -1
  109. package/es/components/chat-button/chat-button.js.map +1 -1
  110. package/es/components/copy/copy.d.ts +1 -1
  111. package/es/components/copy/copy.js +3 -2
  112. package/es/components/copy/copy.js.map +1 -1
  113. package/es/components/copy-button/copy-button.d.ts +1 -1
  114. package/es/components/copy-button/copy-button.js +3 -2
  115. package/es/components/copy-button/copy-button.js.map +1 -1
  116. package/es/components/data-table/table-skeleton.d.ts +1 -1
  117. package/es/components/data-table/table-skeleton.js +3 -2
  118. package/es/components/data-table/table-skeleton.js.map +1 -1
  119. package/es/components/file-uploader/demo-file-uploader.d.ts +1 -1
  120. package/es/components/file-uploader/demo-file-uploader.js +3 -2
  121. package/es/components/file-uploader/demo-file-uploader.js.map +1 -1
  122. package/es/components/file-uploader/file-uploader-button.d.ts +1 -1
  123. package/es/components/file-uploader/file-uploader-button.js +3 -2
  124. package/es/components/file-uploader/file-uploader-button.js.map +1 -1
  125. package/es/components/form-group/form-group.d.ts +1 -1
  126. package/es/components/form-group/form-group.js +3 -2
  127. package/es/components/form-group/form-group.js.map +1 -1
  128. package/es/components/icon-button/icon-button.js +2 -1
  129. package/es/components/icon-button/icon-button.js.map +1 -1
  130. package/es/components/layer/layer.d.ts +1 -1
  131. package/es/components/layer/layer.js +3 -2
  132. package/es/components/layer/layer.js.map +1 -1
  133. package/es/components/notification/actionable-notification.js +4 -3
  134. package/es/components/notification/actionable-notification.js.map +1 -1
  135. package/es/components/popover/popover-content.js +2 -1
  136. package/es/components/popover/popover-content.js.map +1 -1
  137. package/es/components/popover/popover.js +2 -1
  138. package/es/components/popover/popover.js.map +1 -1
  139. package/es/components/progress-bar/progress-bar.d.ts +1 -1
  140. package/es/components/progress-bar/progress-bar.js +3 -2
  141. package/es/components/progress-bar/progress-bar.js.map +1 -1
  142. package/es/components/select/select-skeleton.d.ts +1 -1
  143. package/es/components/select/select-skeleton.js +3 -2
  144. package/es/components/select/select-skeleton.js.map +1 -1
  145. package/es/components/stack/stack.d.ts +1 -1
  146. package/es/components/stack/stack.js +3 -2
  147. package/es/components/stack/stack.js.map +1 -1
  148. package/es/components/text-input/text-input-skeleton.d.ts +1 -1
  149. package/es/components/text-input/text-input-skeleton.js +3 -2
  150. package/es/components/text-input/text-input-skeleton.js.map +1 -1
  151. package/es/components/text-input/text-input.js +2 -1
  152. package/es/components/text-input/text-input.js.map +1 -1
  153. package/es/components/toggle-tip/toggletip.js +2 -1
  154. package/es/components/toggle-tip/toggletip.js.map +1 -1
  155. package/es/components/ui-shell/header-global-action.d.ts +1 -1
  156. package/es/components/ui-shell/header-global-action.js +3 -2
  157. package/es/components/ui-shell/header-global-action.js.map +1 -1
  158. package/es/components/ui-shell/header-panel.d.ts +1 -1
  159. package/es/components/ui-shell/header-panel.js +3 -2
  160. package/es/components/ui-shell/header-panel.js.map +1 -1
  161. package/es/components/ui-shell/header-side-nav-items.d.ts +1 -1
  162. package/es/components/ui-shell/header-side-nav-items.js +3 -2
  163. package/es/components/ui-shell/header-side-nav-items.js.map +1 -1
  164. package/es/components/ui-shell/switcher-item.d.ts +1 -1
  165. package/es/components/ui-shell/switcher-item.js +3 -2
  166. package/es/components/ui-shell/switcher-item.js.map +1 -1
  167. package/es/components/ui-shell/switcher.d.ts +1 -1
  168. package/es/components/ui-shell/switcher.js +3 -2
  169. package/es/components/ui-shell/switcher.js.map +1 -1
  170. package/package.json +2 -2
  171. package/dist/custom-element-975be15f.js +0 -78
@@ -1 +1 @@
1
- {"version":3,"file":"text-input.js","names":["LitElement","html","property","customElement","query","classMap","prefix","View16","ViewOff16","WarningFilled16","WarningAltFilled16","ifNonEmpty","FormMixin","ValidityMixin","INPUT_COLOR_SCHEME","INPUT_SIZE","INPUT_TOOLTIP_ALIGNMENT","INPUT_TOOLTIP_DIRECTION","INPUT_TYPE","styles","CDSTextInput","_decorate","_initialize","_ValidityMixin","constructor","args","F","d","kind","key","value","_handleSlotChange","target","hasContent","assignedNodes","filter","elem","matches","undefined","slugItem","_hasSlug","Boolean","setAttribute","requestUpdate","decorators","_handleInput","_handleFormdata","event","formData","disabled","name","append","type","reflect","attribute","Number","MEDIUM","CENTER","BOTTOM","TEXT","_input","_value","oldValue","handleTogglePasswordVisibility","PASSWORD","render","enableCounter","helperText","hideLabel","inline","invalid","invalidText","label","maxCount","readonly","required","size","warn","warnText","handleInput","hasSlug","handleSlotChange","invalidIcon","class","warnIcon","normalizedProps","icon","counterClasses","inputWrapperClasses","inputClasses","fieldOuterWrapperClasses","fieldWrapperClasses","labelClasses","helperTextClasses","passwordIsVisible","passwordVisibilityIcon","passwordVisibilityToggleClasses","tooltipDirection","tooltipAlignment","passwordButtonLabel","_t","_","hidePasswordLabel","showPasswordLabel","passwordVisibilityButton","_t2","textCount","length","counter","_t3","labelText","_t4","labelWrapper","_t5","helper","_t6","_t7","_t8","autocomplete","autofocus","pattern","placeholder","showPasswordVisibilityToggle","updated","_this$shadowRoot","_this$querySelector","shadowRoot","querySelector","classList","toggle","hasAttribute","static","_objectSpread","shadowRootOptions","delegatesFocus"],"sources":["components/text-input/text-input.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property, customElement, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { prefix } from '../../globals/settings';\nimport View16 from '@carbon/icons/lib/view/16';\nimport ViewOff16 from '@carbon/icons/lib/view--off/16';\nimport WarningFilled16 from '@carbon/icons/lib/warning--filled/16';\nimport WarningAltFilled16 from '@carbon/icons/lib/warning--alt--filled/16';\nimport ifNonEmpty from '../../globals/directives/if-non-empty';\nimport FormMixin from '../../globals/mixins/form';\nimport ValidityMixin from '../../globals/mixins/validity';\nimport {\n INPUT_COLOR_SCHEME,\n INPUT_SIZE,\n INPUT_TOOLTIP_ALIGNMENT,\n INPUT_TOOLTIP_DIRECTION,\n INPUT_TYPE,\n} from './defs';\nimport styles from './text-input.scss';\n\nexport {\n INPUT_COLOR_SCHEME,\n INPUT_SIZE,\n INPUT_TOOLTIP_ALIGNMENT,\n INPUT_TOOLTIP_DIRECTION,\n INPUT_TYPE,\n};\n\n/**\n * Text Input element. Supports all the usual attributes for textual input types\n *\n * @element cds-text-input\n * @slot helper-text - The helper text.\n * @slot label-text - The label text.\n * @slot validity-message - The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n@customElement(`${prefix}-text-input`)\nclass CDSTextInput extends ValidityMixin(FormMixin(LitElement)) {\n /**\n * `true` if there is a slug.\n */\n protected _hasSlug = false;\n\n /**\n * Handles `slotchange` event.\n */\n protected _handleSlotChange({ target }: Event) {\n const hasContent = (target as HTMLSlotElement)\n .assignedNodes()\n .filter((elem) =>\n (elem as HTMLElement).matches !== undefined\n ? (elem as HTMLElement).matches(\n (this.constructor as typeof CDSTextInput).slugItem\n )\n : false\n );\n\n this._hasSlug = Boolean(hasContent);\n (hasContent[0] as HTMLElement).setAttribute('size', 'mini');\n this.requestUpdate();\n }\n /**\n * The underlying input element\n */\n @query('input')\n protected _input!: HTMLInputElement;\n\n /**\n * The internal value.\n */\n protected _value = '';\n\n /**\n * Handles `oninput` event on the `<input>`.\n *\n * @param event The event.\n * @param event.target The event target.\n */\n protected _handleInput({ target }: Event) {\n this.value = (target as HTMLInputElement).value;\n }\n\n _handleFormdata(event: Event) {\n const { formData } = event as any; // TODO: Wait for `FormDataEvent` being available in `lib.dom.d.ts`\n const { disabled, name, value } = this;\n if (!disabled) {\n formData.append(name, value);\n }\n }\n\n /**\n * May be any of the standard HTML autocomplete options\n */\n @property()\n autocomplete = '';\n\n /**\n * Sets the input to be focussed automatically on page load. Defaults to false\n */\n @property({ type: Boolean })\n autofocus = false;\n\n /**\n * Controls the disabled state of the input\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Specify whether to display the character counter\n */\n @property({ type: Boolean, attribute: 'enable-counter', reflect: true })\n enableCounter = false;\n\n /**\n * The helper text.\n */\n @property({ attribute: 'helper-text' })\n helperText = '';\n\n /**\n * Specify if the currently value is invalid.\n */\n @property({ type: Boolean, reflect: true })\n invalid = false;\n\n /**\n * Message which is displayed if the value is invalid.\n */\n @property({ attribute: 'invalid-text' })\n invalidText = '';\n\n /**\n * Max character count allowed for input. This is needed in order for enableCounter to display\n */\n @property({ type: Number, attribute: 'max-count', reflect: true })\n maxCount;\n\n /**\n * Specify whether the control is currently in warning state\n */\n @property({ type: Boolean, reflect: true })\n warn = false;\n\n /**\n * Provide the text that is displayed when the control is in warning state\n */\n @property({ attribute: 'warn-text' })\n warnText = '';\n\n /**\n * Specify whether you want the underlying label to be visually hidden\n */\n @property({ attribute: 'hide-label', type: Boolean, reflect: true })\n hideLabel = false;\n\n /**\n * Generic label that will be used as the textual representation of what this field is for\n */\n @property({ attribute: 'label' })\n label = '';\n\n /**\n * Name for the input in the `FormData`\n */\n @property()\n name = '';\n\n /**\n * Pattern to validate the input against for HTML validity checking\n */\n @property()\n pattern = '';\n\n /**\n * Value to display when the input has an empty `value`\n */\n @property({ reflect: true })\n placeholder = '';\n\n /**\n * Specify if the component should be read-only\n */\n @property({ type: Boolean, reflect: true })\n readonly = false;\n\n /**\n * Boolean property to set the required status\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * The special validity message for `required`.\n */\n @property({ attribute: 'required-validity-message' })\n requiredValidityMessage = 'Please fill out this field.';\n\n /**\n * \"Hide password\" tooltip text on password visibility toggle\n */\n @property()\n hidePasswordLabel = 'Hide password';\n\n /**\n * \"Show password\" tooltip text on password visibility toggle\n */\n @property()\n showPasswordLabel = 'Show password';\n\n /**\n * Boolean property to render password visibility toggle\n */\n @property({\n type: Boolean,\n attribute: 'show-password-visibility-toggle',\n reflect: true,\n })\n showPasswordVisibilityToggle = false;\n\n /**\n * The input box size.\n */\n @property({ reflect: true })\n size = INPUT_SIZE.MEDIUM;\n\n /**\n * true to use the inline version.\n */\n @property({ type: Boolean, reflect: true })\n inline = false;\n\n /**\n * Specify the alignment of the tooltip to the icon-only button.\n * Can be one of: start, center, or end.\n */\n @property()\n tooltipAlignment = INPUT_TOOLTIP_ALIGNMENT.CENTER;\n\n /**\n * Specify the direction of the tooltip for icon-only buttons.\n * Can be either top, right, bottom, or left.\n */\n @property()\n tooltipDirection = INPUT_TOOLTIP_DIRECTION.BOTTOM;\n\n /**\n * The type of the input. Can be one of the types listed in the INPUT_TYPE enum\n */\n @property({ reflect: true })\n type = INPUT_TYPE.TEXT;\n\n /**\n * The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n @property({ attribute: 'validity-message' })\n validityMessage = '';\n\n /**\n * The value of the input.\n */\n @property({ reflect: true })\n get value() {\n // FIXME: Figure out how to deal with TS2611\n // once we have the input we can directly query for the value\n if (this._input) {\n return this._input.value;\n }\n // but before then _value will work fine\n return this._value;\n }\n\n set value(value) {\n const oldValue = this._value;\n this._value = value;\n // make sure that lit-element updates the right properties\n this.requestUpdate('value', oldValue);\n // we set the value directly on the input (when available)\n // so that programatic manipulation updates the UI correctly\n if (this._input) {\n this._input.value = value;\n }\n }\n\n /**\n * Handles password visibility toggle button click\n */\n private handleTogglePasswordVisibility() {\n this.type =\n this.type === INPUT_TYPE.PASSWORD ? INPUT_TYPE.TEXT : INPUT_TYPE.PASSWORD;\n }\n\n render() {\n const {\n disabled,\n enableCounter,\n helperText,\n hideLabel,\n inline,\n invalid,\n invalidText,\n label,\n maxCount,\n readonly,\n required,\n size,\n type,\n warn,\n warnText,\n value,\n _handleInput: handleInput,\n _hasSlug: hasSlug,\n _handleSlotChange: handleSlotChange,\n } = this;\n\n const invalidIcon = WarningFilled16({\n class: `${prefix}--text-input__invalid-icon`,\n });\n\n const warnIcon = WarningAltFilled16({\n class: `${prefix}--text-input__invalid-icon ${prefix}--text-input__invalid-icon--warning`,\n });\n\n const normalizedProps = {\n disabled: !readonly && disabled,\n invalid: !readonly && invalid,\n warn: !readonly && !invalid && warn,\n 'slot-name': '',\n 'slot-text': '',\n icon: null,\n };\n\n if (normalizedProps.invalid) {\n normalizedProps.icon = invalidIcon;\n normalizedProps['slot-name'] = 'invalid-text';\n normalizedProps['slot-text'] = invalidText;\n } else if (normalizedProps.warn) {\n normalizedProps.icon = warnIcon;\n normalizedProps['slot-name'] = 'warn-text';\n normalizedProps['slot-text'] = warnText;\n }\n\n const counterClasses = classMap({\n [`${prefix}--label`]: true,\n [`${prefix}--text-input__label-counter`]: true,\n [`${prefix}--label--disabled`]: disabled,\n });\n\n const inputWrapperClasses = classMap({\n [`${prefix}--form-item`]: true,\n [`${prefix}--text-input-wrapper`]: true,\n [`${prefix}--text-input-wrapper--inline`]: inline,\n [`${prefix}--text-input-wrapper--readonly`]: readonly,\n [`${prefix}--text-input-wrapper--inline--invalid`]:\n inline && normalizedProps.invalid,\n });\n\n const inputClasses = classMap({\n [`${prefix}--text-input`]: true,\n [`${prefix}--text-input--invalid`]: normalizedProps.invalid,\n [`${prefix}--text-input--warning`]: normalizedProps.warn,\n [`${prefix}--text-input--${size}`]: size,\n [`${prefix}--layout--size-${size}`]: size,\n [`${prefix}--password-input`]: type === INPUT_TYPE.PASSWORD,\n });\n\n const fieldOuterWrapperClasses = classMap({\n [`${prefix}--text-input__field-outer-wrapper`]: true,\n [`${prefix}--text-input__field-outer-wrapper--inline`]: inline,\n });\n\n const fieldWrapperClasses = classMap({\n [`${prefix}--text-input__field-wrapper`]: true,\n [`${prefix}--text-input__field-wrapper--warning`]: normalizedProps.warn,\n [`${prefix}--text-input__field-wrapper--slug`]: hasSlug,\n });\n\n const labelClasses = classMap({\n [`${prefix}--label`]: true,\n [`${prefix}--visually-hidden`]: hideLabel,\n [`${prefix}--label--disabled`]: normalizedProps.disabled,\n });\n\n const helperTextClasses = classMap({\n [`${prefix}--form__helper-text`]: true,\n [`${prefix}--form__helper-text--disabled`]: normalizedProps.disabled,\n });\n\n const passwordIsVisible = type !== INPUT_TYPE.PASSWORD;\n const passwordVisibilityIcon = passwordIsVisible\n ? ViewOff16({ class: `${prefix}--icon-visibility-off` })\n : View16({ class: `${prefix}--icon-visibility-on` });\n\n const passwordVisibilityToggleClasses = classMap({\n [`${prefix}--text-input--password__visibility__toggle`]: true,\n [`${prefix}--btn`]: true,\n [`${prefix}--btn--icon-only`]: true,\n [`${prefix}--tooltip__trigger`]: true,\n [`${prefix}--tooltip--a11y`]: true,\n [`${prefix}--btn--disabled`]: normalizedProps.disabled,\n [`${prefix}--tooltip--${this.tooltipDirection}`]: this.tooltipDirection,\n [`${prefix}--tooltip--align-${this.tooltipAlignment}`]:\n this.tooltipAlignment,\n });\n\n const passwordButtonLabel = html`\n <span class=\"${prefix}--assistive-text\">\n ${passwordIsVisible ? this.hidePasswordLabel : this.showPasswordLabel}\n </span>\n `;\n\n const passwordVisibilityButton = () => html`\n <button\n type=\"button\"\n class=\"${passwordVisibilityToggleClasses}\"\n ?disabled=\"${normalizedProps.disabled}\"\n @click=\"${this.handleTogglePasswordVisibility}\">\n ${!normalizedProps.disabled ? passwordButtonLabel : null}\n ${passwordVisibilityIcon}\n </button>\n `;\n\n const textCount = value?.length;\n\n const counter =\n enableCounter && maxCount\n ? html` <label class=\"${counterClasses}\">\n <slot name=\"label-text\">${textCount}/${maxCount}</slot>\n </label>`\n : null;\n\n const labelText =\n label && !hideLabel\n ? html`<label class=\"${labelClasses}\"> ${label} </label>`\n : null;\n\n const labelWrapper = html`<div class=\"${prefix}--text-input__label-wrapper\">\n ${labelText} ${counter}\n </div>`;\n\n const helper = helperText\n ? html`<div\n class=\"${helperTextClasses}\"\n id=\"helper-text\"\n ?hidden=\"${normalizedProps.invalid || normalizedProps.warn}\">\n <slot name=\"helper-text\"> ${helperText} </slot>\n </div>`\n : null;\n\n return html`\n <div class=\"${inputWrapperClasses}\">\n ${!inline\n ? labelWrapper\n : html`<div class=\"${prefix}--text-input__label-helper-wrapper\">\n ${labelWrapper} ${helper}\n </div>`}\n <div class=\"${fieldOuterWrapperClasses}\">\n <div class=\"${fieldWrapperClasses}\" ?data-invalid=\"${invalid}\">\n ${normalizedProps.icon}\n <input\n autocomplete=\"${this.autocomplete}\"\n ?autofocus=\"${this.autofocus}\"\n class=\"${inputClasses}\"\n ?data-invalid=\"${invalid}\"\n ?disabled=\"${disabled}\"\n aria-describedby=\"helper-text\"\n id=\"input\"\n name=\"${ifNonEmpty(this.name)}\"\n pattern=\"${ifNonEmpty(this.pattern)}\"\n placeholder=\"${ifNonEmpty(this.placeholder)}\"\n ?readonly=\"${readonly}\"\n ?required=\"${required}\"\n type=\"${ifNonEmpty(type)}\"\n .value=\"${this._value}\"\n maxlength=\"${ifNonEmpty(maxCount)}\"\n @input=\"${handleInput}\" />\n <slot name=\"slug\" @slotchange=\"${handleSlotChange}\"></slot>\n ${this.showPasswordVisibilityToggle &&\n (type === INPUT_TYPE.PASSWORD || type === INPUT_TYPE.TEXT)\n ? passwordVisibilityButton()\n : null}\n </div>\n ${!inline ? helper : null}\n <div\n class=\"${prefix}--form-requirement\"\n ?hidden=\"${!normalizedProps.invalid && !normalizedProps.warn}\">\n <slot name=\"${normalizedProps['slot-name']}\">\n ${normalizedProps['slot-text']}\n </slot>\n </div>\n </div>\n </div>\n `;\n }\n\n updated() {\n this.shadowRoot\n ?.querySelector(\"slot[name='slug']\")\n ?.classList.toggle(\n `${prefix}--slug--revert`,\n this.querySelector(`${prefix}-slug`)?.hasAttribute('revert-active')\n );\n }\n\n /**\n * A selector that will return the slug item.\n */\n static get slugItem() {\n return `${prefix}-slug`;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default CDSTextInput;\n"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,IAAI,QAAQ,KAAK;AACtC,SAASC,QAAQ,EAAEC,aAAa,EAAEC,KAAK,QAAQ,mBAAmB;AAClE,SAASC,QAAQ,QAAQ,6BAA6B;AACtD,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,OAAOC,MAAM,MAAM,qBAA2B;AAC9C,OAAOC,SAAS,MAAM,0BAAgC;AACtD,OAAOC,eAAe,MAAM,gCAAsC;AAClE,OAAOC,kBAAkB,MAAM,qCAA2C;AAC1E,OAAOC,UAAU,MAAM,uCAAuC;AAC9D,OAAOC,SAAS,MAAM,2BAA2B;AACjD,OAAOC,aAAa,MAAM,+BAA+B;AACzD,SACEC,kBAAkB,EAClBC,UAAU,EACVC,uBAAuB,EACvBC,uB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,WAAW,CAAC;MAM1C;IAAC;MAAAzD,IAAA;MAAAC,GAAA;MAAAC,KAAA,EAED,SAAA6F,QAAA,EAAU;QAAA,IAAAC,gBAAA,EAAAC,mBAAA;QACR,CAAAD,gBAAA,OAAI,CAACE,UAAU,cAAAF,gBAAA,gBAAAA,gBAAA,GAAfA,gBAAA,CACIG,aAAa,CAAC,mBAAmB,CAAC,cAAAH,gBAAA,eADtCA,gBAAA,CAEII,SAAS,CAACC,MAAM,CAChB,GAAG3H,MAAM,gBAAgB,GAAAuH,mBAAA,GACzB,IAAI,CAACE,aAAa,CAAC,GAAGzH,MAAM,OAAO,CAAC,cAAAuH,mBAAA,uBAApCA,mBAAA,CAAsCK,YAAY,CAAC,eAAe,CACpE,CAAC;MACL;;MAEA;AACF;AACA;IAFE;MAAAtG,IAAA;MAAAuG,MAAA;MAAAtG,GAAA;MAAAC,KAAA,EAGA,SAAAS,SAAA,EAAsB;QACpB,OAAO,GAAGjC,MAAM,OAAO;MACzB;IAAC;MAAAsB,IAAA;MAAAuG,MAAA;MAAAtG,GAAA;MAAAC,MAAA;QAAA,OAAAsG,aAAA,CAAAA,aAAA,KAGIpI,UAAU,CAACqI,iBAAiB;UAC/BC,cAAc,EAAE;QAAI;MAAA;IAAA;MAAA1G,IAAA;MAAAuG,MAAA;MAAAtG,GAAA;MAAAC,MAAA;QAAA,OAENX,MAAM;MAAA;IAAA;EAAA;AAAA,GA9dGN,aAAa,CAACD,SAAS,CAACZ,UAAU,CAAC,CAAC;AAie/D,eAAeoB,YAAY","ignoreList":[]}
1
+ {"version":3,"file":"text-input.js","names":["LitElement","html","property","query","carbonElement","customElement","classMap","prefix","View16","ViewOff16","WarningFilled16","WarningAltFilled16","ifNonEmpty","FormMixin","ValidityMixin","INPUT_COLOR_SCHEME","INPUT_SIZE","INPUT_TOOLTIP_ALIGNMENT","INPUT_TOOLTIP_DIRECTION","INPUT_TYPE","styles","CDSTextInput","_decorate","_initialize","_ValidityMixin","constructor","args","F","d","kind","key","value","_handleSlotChange","target","hasContent","assignedNodes","filter","elem","matches","undefined","slugItem","_hasSlug","Boolean","setAttribute","requestUpdate","decorators","_handleInput","_handleFormdata","event","formData","disabled","name","append","type","reflect","attribute","Number","MEDIUM","CENTER","BOTTOM","TEXT","_input","_value","oldValue","handleTogglePasswordVisibility","PASSWORD","render","enableCounter","helperText","hideLabel","inline","invalid","invalidText","label","maxCount","readonly","required","size","warn","warnText","handleInput","hasSlug","handleSlotChange","invalidIcon","class","warnIcon","normalizedProps","icon","counterClasses","inputWrapperClasses","inputClasses","fieldOuterWrapperClasses","fieldWrapperClasses","labelClasses","helperTextClasses","passwordIsVisible","passwordVisibilityIcon","passwordVisibilityToggleClasses","tooltipDirection","tooltipAlignment","passwordButtonLabel","_t","_","hidePasswordLabel","showPasswordLabel","passwordVisibilityButton","_t2","textCount","length","counter","_t3","labelText","_t4","labelWrapper","_t5","helper","_t6","_t7","_t8","autocomplete","autofocus","pattern","placeholder","showPasswordVisibilityToggle","updated","_this$shadowRoot","_this$querySelector","shadowRoot","querySelector","classList","toggle","hasAttribute","static","_objectSpread","shadowRootOptions","delegatesFocus"],"sources":["components/text-input/text-input.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { prefix } from '../../globals/settings';\nimport View16 from '@carbon/icons/lib/view/16';\nimport ViewOff16 from '@carbon/icons/lib/view--off/16';\nimport WarningFilled16 from '@carbon/icons/lib/warning--filled/16';\nimport WarningAltFilled16 from '@carbon/icons/lib/warning--alt--filled/16';\nimport ifNonEmpty from '../../globals/directives/if-non-empty';\nimport FormMixin from '../../globals/mixins/form';\nimport ValidityMixin from '../../globals/mixins/validity';\nimport {\n INPUT_COLOR_SCHEME,\n INPUT_SIZE,\n INPUT_TOOLTIP_ALIGNMENT,\n INPUT_TOOLTIP_DIRECTION,\n INPUT_TYPE,\n} from './defs';\nimport styles from './text-input.scss';\n\nexport {\n INPUT_COLOR_SCHEME,\n INPUT_SIZE,\n INPUT_TOOLTIP_ALIGNMENT,\n INPUT_TOOLTIP_DIRECTION,\n INPUT_TYPE,\n};\n\n/**\n * Text Input element. Supports all the usual attributes for textual input types\n *\n * @element cds-text-input\n * @slot helper-text - The helper text.\n * @slot label-text - The label text.\n * @slot validity-message - The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n@customElement(`${prefix}-text-input`)\nclass CDSTextInput extends ValidityMixin(FormMixin(LitElement)) {\n /**\n * `true` if there is a slug.\n */\n protected _hasSlug = false;\n\n /**\n * Handles `slotchange` event.\n */\n protected _handleSlotChange({ target }: Event) {\n const hasContent = (target as HTMLSlotElement)\n .assignedNodes()\n .filter((elem) =>\n (elem as HTMLElement).matches !== undefined\n ? (elem as HTMLElement).matches(\n (this.constructor as typeof CDSTextInput).slugItem\n )\n : false\n );\n\n this._hasSlug = Boolean(hasContent);\n (hasContent[0] as HTMLElement).setAttribute('size', 'mini');\n this.requestUpdate();\n }\n /**\n * The underlying input element\n */\n @query('input')\n protected _input!: HTMLInputElement;\n\n /**\n * The internal value.\n */\n protected _value = '';\n\n /**\n * Handles `oninput` event on the `<input>`.\n *\n * @param event The event.\n * @param event.target The event target.\n */\n protected _handleInput({ target }: Event) {\n this.value = (target as HTMLInputElement).value;\n }\n\n _handleFormdata(event: Event) {\n const { formData } = event as any; // TODO: Wait for `FormDataEvent` being available in `lib.dom.d.ts`\n const { disabled, name, value } = this;\n if (!disabled) {\n formData.append(name, value);\n }\n }\n\n /**\n * May be any of the standard HTML autocomplete options\n */\n @property()\n autocomplete = '';\n\n /**\n * Sets the input to be focussed automatically on page load. Defaults to false\n */\n @property({ type: Boolean })\n autofocus = false;\n\n /**\n * Controls the disabled state of the input\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Specify whether to display the character counter\n */\n @property({ type: Boolean, attribute: 'enable-counter', reflect: true })\n enableCounter = false;\n\n /**\n * The helper text.\n */\n @property({ attribute: 'helper-text' })\n helperText = '';\n\n /**\n * Specify if the currently value is invalid.\n */\n @property({ type: Boolean, reflect: true })\n invalid = false;\n\n /**\n * Message which is displayed if the value is invalid.\n */\n @property({ attribute: 'invalid-text' })\n invalidText = '';\n\n /**\n * Max character count allowed for input. This is needed in order for enableCounter to display\n */\n @property({ type: Number, attribute: 'max-count', reflect: true })\n maxCount;\n\n /**\n * Specify whether the control is currently in warning state\n */\n @property({ type: Boolean, reflect: true })\n warn = false;\n\n /**\n * Provide the text that is displayed when the control is in warning state\n */\n @property({ attribute: 'warn-text' })\n warnText = '';\n\n /**\n * Specify whether you want the underlying label to be visually hidden\n */\n @property({ attribute: 'hide-label', type: Boolean, reflect: true })\n hideLabel = false;\n\n /**\n * Generic label that will be used as the textual representation of what this field is for\n */\n @property({ attribute: 'label' })\n label = '';\n\n /**\n * Name for the input in the `FormData`\n */\n @property()\n name = '';\n\n /**\n * Pattern to validate the input against for HTML validity checking\n */\n @property()\n pattern = '';\n\n /**\n * Value to display when the input has an empty `value`\n */\n @property({ reflect: true })\n placeholder = '';\n\n /**\n * Specify if the component should be read-only\n */\n @property({ type: Boolean, reflect: true })\n readonly = false;\n\n /**\n * Boolean property to set the required status\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * The special validity message for `required`.\n */\n @property({ attribute: 'required-validity-message' })\n requiredValidityMessage = 'Please fill out this field.';\n\n /**\n * \"Hide password\" tooltip text on password visibility toggle\n */\n @property()\n hidePasswordLabel = 'Hide password';\n\n /**\n * \"Show password\" tooltip text on password visibility toggle\n */\n @property()\n showPasswordLabel = 'Show password';\n\n /**\n * Boolean property to render password visibility toggle\n */\n @property({\n type: Boolean,\n attribute: 'show-password-visibility-toggle',\n reflect: true,\n })\n showPasswordVisibilityToggle = false;\n\n /**\n * The input box size.\n */\n @property({ reflect: true })\n size = INPUT_SIZE.MEDIUM;\n\n /**\n * true to use the inline version.\n */\n @property({ type: Boolean, reflect: true })\n inline = false;\n\n /**\n * Specify the alignment of the tooltip to the icon-only button.\n * Can be one of: start, center, or end.\n */\n @property()\n tooltipAlignment = INPUT_TOOLTIP_ALIGNMENT.CENTER;\n\n /**\n * Specify the direction of the tooltip for icon-only buttons.\n * Can be either top, right, bottom, or left.\n */\n @property()\n tooltipDirection = INPUT_TOOLTIP_DIRECTION.BOTTOM;\n\n /**\n * The type of the input. Can be one of the types listed in the INPUT_TYPE enum\n */\n @property({ reflect: true })\n type = INPUT_TYPE.TEXT;\n\n /**\n * The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n @property({ attribute: 'validity-message' })\n validityMessage = '';\n\n /**\n * The value of the input.\n */\n @property({ reflect: true })\n get value() {\n // FIXME: Figure out how to deal with TS2611\n // once we have the input we can directly query for the value\n if (this._input) {\n return this._input.value;\n }\n // but before then _value will work fine\n return this._value;\n }\n\n set value(value) {\n const oldValue = this._value;\n this._value = value;\n // make sure that lit-element updates the right properties\n this.requestUpdate('value', oldValue);\n // we set the value directly on the input (when available)\n // so that programatic manipulation updates the UI correctly\n if (this._input) {\n this._input.value = value;\n }\n }\n\n /**\n * Handles password visibility toggle button click\n */\n private handleTogglePasswordVisibility() {\n this.type =\n this.type === INPUT_TYPE.PASSWORD ? INPUT_TYPE.TEXT : INPUT_TYPE.PASSWORD;\n }\n\n render() {\n const {\n disabled,\n enableCounter,\n helperText,\n hideLabel,\n inline,\n invalid,\n invalidText,\n label,\n maxCount,\n readonly,\n required,\n size,\n type,\n warn,\n warnText,\n value,\n _handleInput: handleInput,\n _hasSlug: hasSlug,\n _handleSlotChange: handleSlotChange,\n } = this;\n\n const invalidIcon = WarningFilled16({\n class: `${prefix}--text-input__invalid-icon`,\n });\n\n const warnIcon = WarningAltFilled16({\n class: `${prefix}--text-input__invalid-icon ${prefix}--text-input__invalid-icon--warning`,\n });\n\n const normalizedProps = {\n disabled: !readonly && disabled,\n invalid: !readonly && invalid,\n warn: !readonly && !invalid && warn,\n 'slot-name': '',\n 'slot-text': '',\n icon: null,\n };\n\n if (normalizedProps.invalid) {\n normalizedProps.icon = invalidIcon;\n normalizedProps['slot-name'] = 'invalid-text';\n normalizedProps['slot-text'] = invalidText;\n } else if (normalizedProps.warn) {\n normalizedProps.icon = warnIcon;\n normalizedProps['slot-name'] = 'warn-text';\n normalizedProps['slot-text'] = warnText;\n }\n\n const counterClasses = classMap({\n [`${prefix}--label`]: true,\n [`${prefix}--text-input__label-counter`]: true,\n [`${prefix}--label--disabled`]: disabled,\n });\n\n const inputWrapperClasses = classMap({\n [`${prefix}--form-item`]: true,\n [`${prefix}--text-input-wrapper`]: true,\n [`${prefix}--text-input-wrapper--inline`]: inline,\n [`${prefix}--text-input-wrapper--readonly`]: readonly,\n [`${prefix}--text-input-wrapper--inline--invalid`]:\n inline && normalizedProps.invalid,\n });\n\n const inputClasses = classMap({\n [`${prefix}--text-input`]: true,\n [`${prefix}--text-input--invalid`]: normalizedProps.invalid,\n [`${prefix}--text-input--warning`]: normalizedProps.warn,\n [`${prefix}--text-input--${size}`]: size,\n [`${prefix}--layout--size-${size}`]: size,\n [`${prefix}--password-input`]: type === INPUT_TYPE.PASSWORD,\n });\n\n const fieldOuterWrapperClasses = classMap({\n [`${prefix}--text-input__field-outer-wrapper`]: true,\n [`${prefix}--text-input__field-outer-wrapper--inline`]: inline,\n });\n\n const fieldWrapperClasses = classMap({\n [`${prefix}--text-input__field-wrapper`]: true,\n [`${prefix}--text-input__field-wrapper--warning`]: normalizedProps.warn,\n [`${prefix}--text-input__field-wrapper--slug`]: hasSlug,\n });\n\n const labelClasses = classMap({\n [`${prefix}--label`]: true,\n [`${prefix}--visually-hidden`]: hideLabel,\n [`${prefix}--label--disabled`]: normalizedProps.disabled,\n });\n\n const helperTextClasses = classMap({\n [`${prefix}--form__helper-text`]: true,\n [`${prefix}--form__helper-text--disabled`]: normalizedProps.disabled,\n });\n\n const passwordIsVisible = type !== INPUT_TYPE.PASSWORD;\n const passwordVisibilityIcon = passwordIsVisible\n ? ViewOff16({ class: `${prefix}--icon-visibility-off` })\n : View16({ class: `${prefix}--icon-visibility-on` });\n\n const passwordVisibilityToggleClasses = classMap({\n [`${prefix}--text-input--password__visibility__toggle`]: true,\n [`${prefix}--btn`]: true,\n [`${prefix}--btn--icon-only`]: true,\n [`${prefix}--tooltip__trigger`]: true,\n [`${prefix}--tooltip--a11y`]: true,\n [`${prefix}--btn--disabled`]: normalizedProps.disabled,\n [`${prefix}--tooltip--${this.tooltipDirection}`]: this.tooltipDirection,\n [`${prefix}--tooltip--align-${this.tooltipAlignment}`]:\n this.tooltipAlignment,\n });\n\n const passwordButtonLabel = html`\n <span class=\"${prefix}--assistive-text\">\n ${passwordIsVisible ? this.hidePasswordLabel : this.showPasswordLabel}\n </span>\n `;\n\n const passwordVisibilityButton = () => html`\n <button\n type=\"button\"\n class=\"${passwordVisibilityToggleClasses}\"\n ?disabled=\"${normalizedProps.disabled}\"\n @click=\"${this.handleTogglePasswordVisibility}\">\n ${!normalizedProps.disabled ? passwordButtonLabel : null}\n ${passwordVisibilityIcon}\n </button>\n `;\n\n const textCount = value?.length;\n\n const counter =\n enableCounter && maxCount\n ? html` <label class=\"${counterClasses}\">\n <slot name=\"label-text\">${textCount}/${maxCount}</slot>\n </label>`\n : null;\n\n const labelText =\n label && !hideLabel\n ? html`<label class=\"${labelClasses}\"> ${label} </label>`\n : null;\n\n const labelWrapper = html`<div class=\"${prefix}--text-input__label-wrapper\">\n ${labelText} ${counter}\n </div>`;\n\n const helper = helperText\n ? html`<div\n class=\"${helperTextClasses}\"\n id=\"helper-text\"\n ?hidden=\"${normalizedProps.invalid || normalizedProps.warn}\">\n <slot name=\"helper-text\"> ${helperText} </slot>\n </div>`\n : null;\n\n return html`\n <div class=\"${inputWrapperClasses}\">\n ${!inline\n ? labelWrapper\n : html`<div class=\"${prefix}--text-input__label-helper-wrapper\">\n ${labelWrapper} ${helper}\n </div>`}\n <div class=\"${fieldOuterWrapperClasses}\">\n <div class=\"${fieldWrapperClasses}\" ?data-invalid=\"${invalid}\">\n ${normalizedProps.icon}\n <input\n autocomplete=\"${this.autocomplete}\"\n ?autofocus=\"${this.autofocus}\"\n class=\"${inputClasses}\"\n ?data-invalid=\"${invalid}\"\n ?disabled=\"${disabled}\"\n aria-describedby=\"helper-text\"\n id=\"input\"\n name=\"${ifNonEmpty(this.name)}\"\n pattern=\"${ifNonEmpty(this.pattern)}\"\n placeholder=\"${ifNonEmpty(this.placeholder)}\"\n ?readonly=\"${readonly}\"\n ?required=\"${required}\"\n type=\"${ifNonEmpty(type)}\"\n .value=\"${this._value}\"\n maxlength=\"${ifNonEmpty(maxCount)}\"\n @input=\"${handleInput}\" />\n <slot name=\"slug\" @slotchange=\"${handleSlotChange}\"></slot>\n ${this.showPasswordVisibilityToggle &&\n (type === INPUT_TYPE.PASSWORD || type === INPUT_TYPE.TEXT)\n ? passwordVisibilityButton()\n : null}\n </div>\n ${!inline ? helper : null}\n <div\n class=\"${prefix}--form-requirement\"\n ?hidden=\"${!normalizedProps.invalid && !normalizedProps.warn}\">\n <slot name=\"${normalizedProps['slot-name']}\">\n ${normalizedProps['slot-text']}\n </slot>\n </div>\n </div>\n </div>\n `;\n }\n\n updated() {\n this.shadowRoot\n ?.querySelector(\"slot[name='slug']\")\n ?.classList.toggle(\n `${prefix}--slug--revert`,\n this.querySelector(`${prefix}-slug`)?.hasAttribute('revert-active')\n );\n }\n\n /**\n * A selector that will return the slug item.\n */\n static get slugItem() {\n return `${prefix}-slug`;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default CDSTextInput;\n"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC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,cAAc,EAAE;QAAI;MAAA;IAAA;MAAA1G,IAAA;MAAAuG,MAAA;MAAAtG,GAAA;MAAAC,MAAA;QAAA,OAENX,MAAM;MAAA;IAAA;EAAA;AAAA,GA9dGN,aAAa,CAACD,SAAS,CAACb,UAAU,CAAC,CAAC;AAie/D,eAAeqB,YAAY","ignoreList":[]}
@@ -18,7 +18,8 @@ let _ = t => t,
18
18
 
19
19
  import { classMap } from 'lit/directives/class-map.js';
20
20
  import { html, LitElement } from 'lit';
21
- import { customElement, property } from 'lit/decorators.js';
21
+ import { property } from 'lit/decorators.js';
22
+ import { carbonElement as customElement } from '../../globals/decorators/carbon-element';
22
23
  import Information16 from "../../icons/information/16";
23
24
  import { prefix } from '../../globals/settings';
24
25
  import HostListener from '../../globals/decorators/host-listener';
@@ -1 +1 @@
1
- {"version":3,"file":"toggletip.js","names":["classMap","html","LitElement","customElement","property","Information16","prefix","HostListener","HostListenerMixin","FocusMixin","POPOVER_ALIGNMENT","PopoverController","styles","CDSToggletip","_decorate","_initialize","_HostListenerMixin","constructor","args","F","d","kind","key","value","decorators","reflect","TOP","type","Boolean","_handleActionsSlotChange","target","hasContent","assignedNodes","setAttribute","removeAttribute","open","event","_handleFocusOut","contains","relatedTarget","_t","_","_t2","id","_handleClick","autoalign","_t3","_t4","_t5","_renderTooltipButton","_renderTooltipContent","updated","_this$shadowRoot","_this$shadowRoot2","_this$shadowRoot3","button","shadowRoot","querySelector","selectorToggletipButton","tooltip","selectorToggletipContent","arrowElement","selectorToggletipCaret","_this$popoverControll","popoverController","setPlacement","trigger","caret","flip","alignment","render","classes","_t6","_renderToggleTipLabel","_renderInnerContent","static","_objectSpread","shadowRootOptions","delegatesFocus"],"sources":["components/toggle-tip/toggletip.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { classMap } from 'lit/directives/class-map.js';\nimport { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport Information16 from '@carbon/icons/lib/information/16';\nimport { prefix } from '../../globals/settings';\nimport HostListener from '../../globals/decorators/host-listener';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\nimport FocusMixin from '../../globals/mixins/focus';\nimport { POPOVER_ALIGNMENT } from '../popover/defs';\nimport PopoverController from '../../globals/controllers/popover-controller';\nimport styles from './toggletip.scss';\n\n/**\n * Definition tooltip.\n *\n * @element cds-toggletip\n */\n@customElement(`${prefix}-toggletip`)\nclass CDSToggletip extends HostListenerMixin(FocusMixin(LitElement)) {\n /**\n * Create popover controller instance\n */\n private popoverController = new PopoverController(this);\n\n /**\n * How the tooltip is aligned to the trigger button.\n */\n @property({ reflect: true })\n alignment = POPOVER_ALIGNMENT.TOP;\n\n /**\n * Specify whether a auto align functionality should be applied\n */\n @property({ type: Boolean, reflect: true })\n autoalign = false;\n\n /**\n * Set whether toggletip is open\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /**\n * Handles `slotchange` event.\n */\n private _handleActionsSlotChange({ target }: Event) {\n const hasContent = (target as HTMLSlotElement).assignedNodes();\n hasContent\n ? this.setAttribute('has-actions', '')\n : this.removeAttribute('has-actions');\n }\n\n protected _handleClick = () => {\n this.open = !this.open;\n };\n\n /**\n * Handles `keydown` event on this element.\n */\n @HostListener('keydown')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n protected _handleKeydown = async (event) => {\n if (event.key === 'Escape') {\n this.open = false;\n }\n };\n\n /**\n * Handles `blur` event handler on the document this element is in.\n *\n * @param event The event.\n */\n @HostListener('focusout')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n protected _handleFocusOut(event: FocusEvent) {\n if (!this.contains(event.relatedTarget as Node)) {\n this.open = false;\n }\n }\n\n protected _renderToggleTipLabel = () => {\n return html`\n <span class=\"${prefix}--toggletip-label\">\n <slot></slot>\n </span>\n `;\n };\n\n protected _renderTooltipButton = () => {\n return html`\n <button\n aria-controls=\"${this.id}\"\n class=\"${prefix}--toggletip-button\"\n @click=${this._handleClick}>\n ${Information16({ id: 'trigger' })}\n </button>\n `;\n };\n\n protected _renderTooltipContent = () => {\n return this.autoalign\n ? html`\n <span class=\"${prefix}--popover-content\">\n <div class=\"${prefix}--toggletip-content\">\n <slot name=\"body-text\"></slot>\n <div class=\"${prefix}--toggletip-actions\">\n <slot\n name=\"actions\"\n @slotchange=\"${this._handleActionsSlotChange}\"></slot>\n </div>\n </div>\n <span class=\"${prefix}--popover-caret\"></span>\n </span>\n `\n : html`\n <span class=\"${prefix}--popover\">\n <span class=\"${prefix}--popover-content\">\n <div class=\"${prefix}--toggletip-content\">\n <slot name=\"body-text\"></slot>\n <div class=\"${prefix}--toggletip-actions\">\n <slot\n name=\"actions\"\n @slotchange=\"${this._handleActionsSlotChange}\"></slot>\n </div>\n </div>\n </span>\n <span class=\"${prefix}--popover-caret\"></span>\n </span>\n `;\n };\n\n protected _renderInnerContent = () => {\n return html`\n ${this._renderTooltipButton()} ${this._renderTooltipContent()}\n `;\n };\n\n updated() {\n if (this.autoalign && this.open) {\n // auto align functionality with @floating-ui/dom library\n const button = this.shadowRoot?.querySelector(\n CDSToggletip.selectorToggletipButton\n );\n\n const tooltip = this.shadowRoot?.querySelector(\n CDSToggletip.selectorToggletipContent\n );\n const arrowElement = this.shadowRoot?.querySelector(\n CDSToggletip.selectorToggletipCaret\n );\n\n if (button && tooltip) {\n this.popoverController?.setPlacement({\n trigger: button as HTMLElement,\n target: tooltip as HTMLElement,\n arrowElement: arrowElement as HTMLElement,\n caret: true,\n flip: true,\n alignment: this.alignment,\n });\n }\n }\n }\n\n render() {\n const { alignment, open } = this;\n const classes = classMap({\n [`${prefix}--popover-container`]: true,\n [`${prefix}--popover--caret`]: true,\n [`${prefix}--popover--high-contrast`]: true,\n [`${prefix}--popover--open`]: open,\n [`${prefix}--popover--${alignment}`]: alignment,\n [`${prefix}--toggletip`]: true,\n [`${prefix}--toggletip--open`]: open,\n });\n return html`\n ${this._renderToggleTipLabel()}\n <span class=\"${classes}\">\n ${this._renderInnerContent()}\n </span>\n </span>\n `;\n }\n\n /**\n * A selector that will return the toggletip content.\n */\n static get selectorToggletipContent() {\n return `.${prefix}--popover-content`;\n }\n\n /**\n * A selector that will return the toggletip caret.\n */\n static get selectorToggletipCaret() {\n return `.${prefix}--popover-caret`;\n }\n\n /**\n * A selector that will return the trigger element.\n */\n static get selectorToggletipButton() {\n return `.${prefix}--toggletip-button`;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n static styles = styles;\n}\n\nexport default CDSToggletip;\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,6BAA6B;AACtD,SAASC,IAAI,EAAEC,UAAU,QAAQ,KAAK;AACtC,SAASC,aAAa,EAAEC,QAAQ,QAAQ,mBAAmB;AAC3D,OAAOC,aAAa,MAAM,4BAAkC;AAC5D,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,OAAOC,YAAY,MAAM,wCAAwC;AACjE,OAAOC,iBAAiB,MAAM,oCAAoC;AAClE,OAAOC,UAAU,MAAM,4BAA4B;AACnD,SAASC,iBAAiB,QAAQ,iBAAiB;AACnD,OAAOC,iBAAiB,MAAM,8CAA8C;AAC5E,OAAOC,MAAM,MAAM,sBAAkB;;AAErC;AACA;AACA;AACA;AACA,GAJA;AACA;AACA;AACA;AACA;AAJA,IAMMC,YAAY,GAAAC,SAAA,EADjBX,aAAa,CAAC,GAAGG,MAAM,YAAY,CAAC,aAAAS,WAAA,EAAAC,kBAAA;EAArC,MACMH,YAAY,SAAAG,kBAAA,CAAmD;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EAiMrE;EAAC;IAAAI,CAAA,EAjMKN,YAAY;IAAAO,CAAA;MAAAC,IAAA;MAAAC,GAAA;MAAAC,MAAA;Q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MACpC;;MAEA;AACF;AACA;IAFE;MAAAe,IAAA;MAAAsD,MAAA;MAAArD,GAAA;MAAAC,KAAA,EAGA,SAAAmC,wBAAA,EAAqC;QACnC,OAAO,IAAIpD,MAAM,oBAAoB;MACvC;IAAC;MAAAe,IAAA;MAAAsD,MAAA;MAAArD,GAAA;MAAAC,MAAA;QAAA,OAAAqD,aAAA,CAAAA,aAAA,KAGI1E,UAAU,CAAC2E,iBAAiB;UAC/BC,cAAc,EAAE;QAAI;MAAA;IAAA;MAAAzD,IAAA;MAAAsD,MAAA;MAAArD,GAAA;MAAAC,MAAA;QAAA,OAGNX,MAAM;MAAA;IAAA;EAAA;AAAA,GAhMGJ,iBAAiB,CAACC,UAAU,CAACP,UAAU,CAAC,CAAC;AAmMpE,eAAeW,YAAY","ignoreList":[]}
1
+ {"version":3,"file":"toggletip.js","names":["classMap","html","LitElement","property","carbonElement","customElement","Information16","prefix","HostListener","HostListenerMixin","FocusMixin","POPOVER_ALIGNMENT","PopoverController","styles","CDSToggletip","_decorate","_initialize","_HostListenerMixin","constructor","args","F","d","kind","key","value","decorators","reflect","TOP","type","Boolean","_handleActionsSlotChange","target","hasContent","assignedNodes","setAttribute","removeAttribute","open","event","_handleFocusOut","contains","relatedTarget","_t","_","_t2","id","_handleClick","autoalign","_t3","_t4","_t5","_renderTooltipButton","_renderTooltipContent","updated","_this$shadowRoot","_this$shadowRoot2","_this$shadowRoot3","button","shadowRoot","querySelector","selectorToggletipButton","tooltip","selectorToggletipContent","arrowElement","selectorToggletipCaret","_this$popoverControll","popoverController","setPlacement","trigger","caret","flip","alignment","render","classes","_t6","_renderToggleTipLabel","_renderInnerContent","static","_objectSpread","shadowRootOptions","delegatesFocus"],"sources":["components/toggle-tip/toggletip.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { classMap } from 'lit/directives/class-map.js';\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport Information16 from '@carbon/icons/lib/information/16';\nimport { prefix } from '../../globals/settings';\nimport HostListener from '../../globals/decorators/host-listener';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\nimport FocusMixin from '../../globals/mixins/focus';\nimport { POPOVER_ALIGNMENT } from '../popover/defs';\nimport PopoverController from '../../globals/controllers/popover-controller';\nimport styles from './toggletip.scss';\n\n/**\n * Definition tooltip.\n *\n * @element cds-toggletip\n */\n@customElement(`${prefix}-toggletip`)\nclass CDSToggletip extends HostListenerMixin(FocusMixin(LitElement)) {\n /**\n * Create popover controller instance\n */\n private popoverController = new PopoverController(this);\n\n /**\n * How the tooltip is aligned to the trigger button.\n */\n @property({ reflect: true })\n alignment = POPOVER_ALIGNMENT.TOP;\n\n /**\n * Specify whether a auto align functionality should be applied\n */\n @property({ type: Boolean, reflect: true })\n autoalign = false;\n\n /**\n * Set whether toggletip is open\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /**\n * Handles `slotchange` event.\n */\n private _handleActionsSlotChange({ target }: Event) {\n const hasContent = (target as HTMLSlotElement).assignedNodes();\n hasContent\n ? this.setAttribute('has-actions', '')\n : this.removeAttribute('has-actions');\n }\n\n protected _handleClick = () => {\n this.open = !this.open;\n };\n\n /**\n * Handles `keydown` event on this element.\n */\n @HostListener('keydown')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n protected _handleKeydown = async (event) => {\n if (event.key === 'Escape') {\n this.open = false;\n }\n };\n\n /**\n * Handles `blur` event handler on the document this element is in.\n *\n * @param event The event.\n */\n @HostListener('focusout')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n protected _handleFocusOut(event: FocusEvent) {\n if (!this.contains(event.relatedTarget as Node)) {\n this.open = false;\n }\n }\n\n protected _renderToggleTipLabel = () => {\n return html`\n <span class=\"${prefix}--toggletip-label\">\n <slot></slot>\n </span>\n `;\n };\n\n protected _renderTooltipButton = () => {\n return html`\n <button\n aria-controls=\"${this.id}\"\n class=\"${prefix}--toggletip-button\"\n @click=${this._handleClick}>\n ${Information16({ id: 'trigger' })}\n </button>\n `;\n };\n\n protected _renderTooltipContent = () => {\n return this.autoalign\n ? html`\n <span class=\"${prefix}--popover-content\">\n <div class=\"${prefix}--toggletip-content\">\n <slot name=\"body-text\"></slot>\n <div class=\"${prefix}--toggletip-actions\">\n <slot\n name=\"actions\"\n @slotchange=\"${this._handleActionsSlotChange}\"></slot>\n </div>\n </div>\n <span class=\"${prefix}--popover-caret\"></span>\n </span>\n `\n : html`\n <span class=\"${prefix}--popover\">\n <span class=\"${prefix}--popover-content\">\n <div class=\"${prefix}--toggletip-content\">\n <slot name=\"body-text\"></slot>\n <div class=\"${prefix}--toggletip-actions\">\n <slot\n name=\"actions\"\n @slotchange=\"${this._handleActionsSlotChange}\"></slot>\n </div>\n </div>\n </span>\n <span class=\"${prefix}--popover-caret\"></span>\n </span>\n `;\n };\n\n protected _renderInnerContent = () => {\n return html`\n ${this._renderTooltipButton()} ${this._renderTooltipContent()}\n `;\n };\n\n updated() {\n if (this.autoalign && this.open) {\n // auto align functionality with @floating-ui/dom library\n const button = this.shadowRoot?.querySelector(\n CDSToggletip.selectorToggletipButton\n );\n\n const tooltip = this.shadowRoot?.querySelector(\n CDSToggletip.selectorToggletipContent\n );\n const arrowElement = this.shadowRoot?.querySelector(\n CDSToggletip.selectorToggletipCaret\n );\n\n if (button && tooltip) {\n this.popoverController?.setPlacement({\n trigger: button as HTMLElement,\n target: tooltip as HTMLElement,\n arrowElement: arrowElement as HTMLElement,\n caret: true,\n flip: true,\n alignment: this.alignment,\n });\n }\n }\n }\n\n render() {\n const { alignment, open } = this;\n const classes = classMap({\n [`${prefix}--popover-container`]: true,\n [`${prefix}--popover--caret`]: true,\n [`${prefix}--popover--high-contrast`]: true,\n [`${prefix}--popover--open`]: open,\n [`${prefix}--popover--${alignment}`]: alignment,\n [`${prefix}--toggletip`]: true,\n [`${prefix}--toggletip--open`]: open,\n });\n return html`\n ${this._renderToggleTipLabel()}\n <span class=\"${classes}\">\n ${this._renderInnerContent()}\n </span>\n </span>\n `;\n }\n\n /**\n * A selector that will return the toggletip content.\n */\n static get selectorToggletipContent() {\n return `.${prefix}--popover-content`;\n }\n\n /**\n * A selector that will return the toggletip caret.\n */\n static get selectorToggletipCaret() {\n return `.${prefix}--popover-caret`;\n }\n\n /**\n * A selector that will return the trigger element.\n */\n static get selectorToggletipButton() {\n return `.${prefix}--toggletip-button`;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n static styles = styles;\n}\n\nexport default CDSToggletip;\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,6BAA6B;AACtD,SAASC,IAAI,EAAEC,UAAU,QAAQ,KAAK;AACtC,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,aAAa,IAAIC,aAAa,QAAQ,yCAAyC;AACxF,OAAOC,aAAa,MAAM,4BAAkC;AAC5D,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,OAAOC,YAAY,MAAM,wCAAwC;AACjE,OAAOC,iBAAiB,MAAM,oCAAoC;AAClE,OAAOC,UAAU,MAAM,4BAA4B;AACnD,SAASC,iBAAiB,QAAQ,iBAAiB;AACnD,OAAOC,iBAAiB,MAAM,8CAA8C;AAC5E,OAAOC,MAAM,MAAM,sBAAkB;;AAErC;AACA;AACA;AACA;AACA,GAJA;AACA;AACA;AACA;AACA;AAJA,IAMMC,YAAY,GAAAC,SAAA,EADjBV,aAAa,CAAC,GAAGE,MAAM,YAAY,CAAC,aAAAS,WAAA,EAAAC,kBAAA;EAArC,MACMH,YAAY,SAAAG,kBAAA,CAAmD;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EAiMrE;EAAC;IAAAI,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AAC,KAAA,EAGA,SAAAuC,uBAAA,EAAoC;QAClC,OAAO,IAAIxD,MAAM,iBAAiB;MACpC;;MAEA;AACF;AACA;IAFE;MAAAe,IAAA;MAAAsD,MAAA;MAAArD,GAAA;MAAAC,KAAA,EAGA,SAAAmC,wBAAA,EAAqC;QACnC,OAAO,IAAIpD,MAAM,oBAAoB;MACvC;IAAC;MAAAe,IAAA;MAAAsD,MAAA;MAAArD,GAAA;MAAAC,MAAA;QAAA,OAAAqD,aAAA,CAAAA,aAAA,KAGI3E,UAAU,CAAC4E,iBAAiB;UAC/BC,cAAc,EAAE;QAAI;MAAA;IAAA;MAAAzD,IAAA;MAAAsD,MAAA;MAAArD,GAAA;MAAAC,MAAA;QAAA,OAGNX,MAAM;MAAA;IAAA;EAAA;AAAA,GAhMGJ,iBAAiB,CAACC,UAAU,CAACR,UAAU,CAAC,CAAC;AAmMpE,eAAeY,YAAY","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  *
4
- * Copyright IBM Corp. 2023
4
+ * Copyright IBM Corp. 2023, 2024
5
5
  *
6
6
  * This source code is licensed under the Apache-2.0 license found in the
7
7
  * LICENSE file in the root directory of this source tree.
@@ -5,14 +5,15 @@ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
5
5
  /**
6
6
  * @license
7
7
  *
8
- * Copyright IBM Corp. 2023
8
+ * Copyright IBM Corp. 2023, 2024
9
9
  *
10
10
  * This source code is licensed under the Apache-2.0 license found in the
11
11
  * LICENSE file in the root directory of this source tree.
12
12
  */
13
13
 
14
14
  import { LitElement } from 'lit';
15
- import { property, customElement, query } from 'lit/decorators.js';
15
+ import { property, query } from 'lit/decorators.js';
16
+ import { carbonElement as customElement } from '../../globals/decorators/carbon-element';
16
17
  import { BUTTON_TOOLTIP_POSITION } from '../button/button';
17
18
  import CDSButton from '../button/button';
18
19
  import HostListener from '../../globals/decorators/host-listener';
@@ -1 +1 @@
1
- {"version":3,"file":"header-global-action.js","names":["LitElement","property","customElement","query","BUTTON_TOOLTIP_POSITION","CDSButton","HostListener","styles","prefix","CDSHeaderGlobalAction","_decorate","_initialize","_CDSButton","constructor","args","F","d","kind","decorators","key","value","type","Boolean","reflect","String","attribute","connectedCallback","tooltipPosition","BOTTOM","_get","_getPrototypeOf","prototype","call","capture","_handleClick","event","disabled","stopPropagation","panel","document","querySelector","panelId","expanded","getAttribute","removeAttribute","setAttribute","active","updated","_buttonNode","classList","add","shouldUpdate","changedProperties","has","buttonLabelActive","tooltipText","remove","buttonLabelInactive","static","_objectSpread","shadowRootOptions","delegatesFocus"],"sources":["components/ui-shell/header-global-action.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement } from 'lit';\nimport { property, customElement, query } from 'lit/decorators.js';\nimport { BUTTON_TOOLTIP_POSITION } from '../button/button';\nimport CDSButton from '../button/button';\nimport HostListener from '../../globals/decorators/host-listener';\nimport styles from './header.scss';\nimport { prefix } from '../../globals/settings';\n\n/**\n * Header global action button\n *\n * @element cds-header-global-action\n */\n@customElement(`${prefix}-header-global-action`)\nclass CDSHeaderGlobalAction extends CDSButton {\n @query('button')\n protected _buttonNode!: HTMLButtonElement;\n\n /**\n * Specify whether the action is currently active\n */\n @property({ type: Boolean, reflect: true })\n active;\n\n /**\n * Specify which header panel the button is associated with.\n */\n @property({ type: String, attribute: 'panel-id', reflect: true })\n panelId;\n\n /**\n * The `aria-label` attribute for the button in its active state.\n */\n @property({ attribute: 'button-label-active' })\n buttonLabelActive;\n\n /**\n * The `aria-label` attribute for the button in its inactive state.\n */\n @property({ attribute: 'button-label-inactive' })\n buttonLabelInactive;\n\n connectedCallback() {\n this.tooltipPosition = BUTTON_TOOLTIP_POSITION.BOTTOM;\n super.connectedCallback();\n }\n\n @HostListener('click', { capture: true })\n // @ts-ignore\n private _handleClick(event: Event) {\n const { disabled } = this;\n if (disabled) {\n event.stopPropagation();\n } else {\n const panel = document.querySelector(`#${this.panelId}`);\n\n // see if there is related panel for header-global-action button first\n // and then set the expanded attr of it accordingly\n if (panel) {\n const expanded = panel.getAttribute('expanded');\n\n if (expanded) {\n panel.removeAttribute('expanded');\n } else {\n panel.setAttribute('expanded', 'true');\n }\n\n const active = !this.active;\n this.active = active;\n }\n }\n }\n\n updated() {\n if (this._buttonNode) {\n this._buttonNode.classList.add(`${prefix}--header__action`);\n }\n }\n\n shouldUpdate(changedProperties) {\n if (changedProperties.has('active')) {\n if (this.active) {\n this._buttonNode.classList.add(`${prefix}--header__action--active`);\n\n if (this.buttonLabelActive) {\n this.tooltipText = this.buttonLabelActive;\n }\n } else {\n this._buttonNode.classList.remove(`${prefix}--header__action--active`);\n\n if (this.buttonLabelInactive) {\n this.tooltipText = this.buttonLabelInactive;\n }\n }\n }\n return true;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default CDSHeaderGlobalAction;\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,QAAQ,KAAK;AAChC,SAASC,QAAQ,EAAEC,aAAa,EAAEC,KAAK,QAAQ,mBAAmB;AAClE,SAASC,uBAAuB,QAAQ,kBAAkB;AAC1D,OAAOC,SAAS,MAAM,kBAAkB;AACxC,OAAOC,YAAY,MAAM,wCAAwC;AACjE,OAAOC,MAAM,MAAM,mBAAe;AAClC,SAASC,MAAM,QAAQ,wBAAwB;;AAE/C;AACA;AACA;AACA;AACA;AAJA,IAMMC,qBAAqB,GAAAC,SAAA,EAD1BR,aAAa,CAAC,GAAGM,MAAM,uBAAuB,CAAC,aAAAG,WAAA,EAAAC,UAAA;EAAhD,MACMH,qBAAqB,SAAAG,UAAA,CAAmB;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;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AAI,CAACE,mBAAmB;YAC7C;UACF;QACF;QACA,OAAO,IAAI;MACb;IAAC;MAAAxC,IAAA;MAAAyC,MAAA;MAAAvC,GAAA;MAAAC,MAAA;QAAA,OAAAuC,aAAA,CAAAA,aAAA,KAGI3D,UAAU,CAAC4D,iBAAiB;UAC/BC,cAAc,EAAE;QAAI;MAAA;IAAA;MAAA5C,IAAA;MAAAyC,MAAA;MAAAvC,GAAA;MAAAC,MAAA;QAAA,OAGNb,MAAM;MAAA;IAAA;EAAA;AAAA,GAzFYF,SAAS;AA4F7C,eAAeI,qBAAqB","ignoreList":[]}
1
+ {"version":3,"file":"header-global-action.js","names":["LitElement","property","query","carbonElement","customElement","BUTTON_TOOLTIP_POSITION","CDSButton","HostListener","styles","prefix","CDSHeaderGlobalAction","_decorate","_initialize","_CDSButton","constructor","args","F","d","kind","decorators","key","value","type","Boolean","reflect","String","attribute","connectedCallback","tooltipPosition","BOTTOM","_get","_getPrototypeOf","prototype","call","capture","_handleClick","event","disabled","stopPropagation","panel","document","querySelector","panelId","expanded","getAttribute","removeAttribute","setAttribute","active","updated","_buttonNode","classList","add","shouldUpdate","changedProperties","has","buttonLabelActive","tooltipText","remove","buttonLabelInactive","static","_objectSpread","shadowRootOptions","delegatesFocus"],"sources":["components/ui-shell/header-global-action.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2023, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { BUTTON_TOOLTIP_POSITION } from '../button/button';\nimport CDSButton from '../button/button';\nimport HostListener from '../../globals/decorators/host-listener';\nimport styles from './header.scss';\nimport { prefix } from '../../globals/settings';\n\n/**\n * Header global action button\n *\n * @element cds-header-global-action\n */\n@customElement(`${prefix}-header-global-action`)\nclass CDSHeaderGlobalAction extends CDSButton {\n @query('button')\n protected _buttonNode!: HTMLButtonElement;\n\n /**\n * Specify whether the action is currently active\n */\n @property({ type: Boolean, reflect: true })\n active;\n\n /**\n * Specify which header panel the button is associated with.\n */\n @property({ type: String, attribute: 'panel-id', reflect: true })\n panelId;\n\n /**\n * The `aria-label` attribute for the button in its active state.\n */\n @property({ attribute: 'button-label-active' })\n buttonLabelActive;\n\n /**\n * The `aria-label` attribute for the button in its inactive state.\n */\n @property({ attribute: 'button-label-inactive' })\n buttonLabelInactive;\n\n connectedCallback() {\n this.tooltipPosition = BUTTON_TOOLTIP_POSITION.BOTTOM;\n super.connectedCallback();\n }\n\n @HostListener('click', { capture: true })\n // @ts-ignore\n private _handleClick(event: Event) {\n const { disabled } = this;\n if (disabled) {\n event.stopPropagation();\n } else {\n const panel = document.querySelector(`#${this.panelId}`);\n\n // see if there is related panel for header-global-action button first\n // and then set the expanded attr of it accordingly\n if (panel) {\n const expanded = panel.getAttribute('expanded');\n\n if (expanded) {\n panel.removeAttribute('expanded');\n } else {\n panel.setAttribute('expanded', 'true');\n }\n\n const active = !this.active;\n this.active = active;\n }\n }\n }\n\n updated() {\n if (this._buttonNode) {\n this._buttonNode.classList.add(`${prefix}--header__action`);\n }\n }\n\n shouldUpdate(changedProperties) {\n if (changedProperties.has('active')) {\n if (this.active) {\n this._buttonNode.classList.add(`${prefix}--header__action--active`);\n\n if (this.buttonLabelActive) {\n this.tooltipText = this.buttonLabelActive;\n }\n } else {\n this._buttonNode.classList.remove(`${prefix}--header__action--active`);\n\n if (this.buttonLabelInactive) {\n this.tooltipText = this.buttonLabelInactive;\n }\n }\n }\n return true;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default CDSHeaderGlobalAction;\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,QAAQ,KAAK;AAChC,SAASC,QAAQ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aAAaC,iBAAiB,EAAE;QAC9B,IAAIA,iBAAiB,CAACC,GAAG,CAAC,QAAQ,CAAC,EAAE;UACnC,IAAI,IAAI,CAACP,MAAM,EAAE;YACf,IAAI,CAACE,WAAW,CAACC,SAAS,CAACC,GAAG,CAAC,GAAG1C,MAAM,0BAA0B,CAAC;YAEnE,IAAI,IAAI,CAAC8C,iBAAiB,EAAE;cAC1B,IAAI,CAACC,WAAW,GAAG,IAAI,CAACD,iBAAiB;YAC3C;UACF,CAAC,MAAM;YACL,IAAI,CAACN,WAAW,CAACC,SAAS,CAACO,MAAM,CAAC,GAAGhD,MAAM,0BAA0B,CAAC;YAEtE,IAAI,IAAI,CAACiD,mBAAmB,EAAE;cAC5B,IAAI,CAACF,WAAW,GAAG,IAAI,CAACE,mBAAmB;YAC7C;UACF;QACF;QACA,OAAO,IAAI;MACb;IAAC;MAAAxC,IAAA;MAAAyC,MAAA;MAAAvC,GAAA;MAAAC,MAAA;QAAA,OAAAuC,aAAA,CAAAA,aAAA,KAGI5D,UAAU,CAAC6D,iBAAiB;UAC/BC,cAAc,EAAE;QAAI;MAAA;IAAA;MAAA5C,IAAA;MAAAyC,MAAA;MAAAvC,GAAA;MAAAC,MAAA;QAAA,OAGNb,MAAM;MAAA;IAAA;EAAA;AAAA,GAzFYF,SAAS;AA4F7C,eAAeI,qBAAqB","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  *
4
- * Copyright IBM Corp. 2023
4
+ * Copyright IBM Corp. 2023, 2024
5
5
  *
6
6
  * This source code is licensed under the Apache-2.0 license found in the
7
7
  * LICENSE file in the root directory of this source tree.
@@ -5,14 +5,15 @@ let _ = t => t,
5
5
  /**
6
6
  * @license
7
7
  *
8
- * Copyright IBM Corp. 2023
8
+ * Copyright IBM Corp. 2023, 2024
9
9
  *
10
10
  * This source code is licensed under the Apache-2.0 license found in the
11
11
  * LICENSE file in the root directory of this source tree.
12
12
  */
13
13
 
14
14
  import { LitElement, html } from 'lit';
15
- import { property, customElement } from 'lit/decorators.js';
15
+ import { property } from 'lit/decorators.js';
16
+ import { carbonElement as customElement } from '../../globals/decorators/carbon-element';
16
17
  import styles from "././header.css.js";
17
18
  import { prefix } from '../../globals/settings';
18
19
 
@@ -1 +1 @@
1
- {"version":3,"file":"header-panel.js","names":["LitElement","html","property","customElement","styles","prefix","CDSHeaderPanel","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","decorators","type","Boolean","reflect","key","value","render","_t","_","static","_objectSpread","shadowRootOptions","delegatesFocus"],"sources":["components/ui-shell/header-panel.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property, customElement } from 'lit/decorators.js';\nimport styles from './header.scss';\nimport { prefix } from '../../globals/settings';\n\n/**\n * Header panel\n *\n * @element cds-header-panel\n */\n@customElement(`${prefix}-header-panel`)\nclass CDSHeaderPanel extends LitElement {\n /**\n * Specify whether the panel is expanded\n */\n @property({ type: Boolean, reflect: true })\n expanded;\n\n render() {\n return html`<slot></slot>`;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default CDSHeaderPanel;\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,IAAI,QAAQ,KAAK;AACtC,SAASC,QAAQ,EAAEC,aAAa,QAAQ,mBAAmB;AAC3D,OAAOC,MAAM,MAAM,mBAAe;AAClC,SAASC,MAAM,QAAQ,wBAAwB;;AAE/C;AACA;AACA;AACA;AACA;AAJA,IAMMC,cAAc,GAAAC,SAAA,EADnBJ,aAAa,CAAC,GAAGE,MAAM,eAAe,CAAC,aAAAG,WAAA,EAAAC,WAAA;EAAxC,MACMH,cAAc,SAAAG,WAAA,CAAoB;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EAiBxC;EAAC;IAAAI,CAAA,EAjBKN,cAAc;IAAAO,CAAA;MAAAC,IAAA;MAAAC,UAAA,GAIjBb,QAAQ,CAAC;QAAEc,IAAI,EAAEC,OAAO;QAAEC,OAAO,EAAE;MAAK,CAAC,CAAC;MAAAC,GAAA;MAAAC,KAAA;IAAA;MAAAN,IAAA;MAAAK,GAAA;MAAAC,KAAA;MAH3C;AACF;AACA;;MAIE,SAAAC,OAAA,EAAS;QACP,OAAOpB,IAAI,CAAAqB,EAAA,KAAAA,EAAA,GAAAC,CAAA;MACb;IAAC;MAAAT,IAAA;MAAAU,MAAA;MAAAL,GAAA;MAAAC,MAAA;QAAA,OAAAK,aAAA,CAAAA,aAAA,KAGIzB,UAAU,CAAC0B,iBAAiB;UAC/BC,cAAc,EAAE;QAAI;MAAA;IAAA;MAAAb,IAAA;MAAAU,MAAA;MAAAL,GAAA;MAAAC,MAAA;QAAA,OAGNhB,MAAM;MAAA;IAAA;EAAA;AAAA,GAhBKJ,UAAU;AAmBvC,eAAeM,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"header-panel.js","names":["LitElement","html","property","carbonElement","customElement","styles","prefix","CDSHeaderPanel","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","decorators","type","Boolean","reflect","key","value","render","_t","_","static","_objectSpread","shadowRootOptions","delegatesFocus"],"sources":["components/ui-shell/header-panel.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2023, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport styles from './header.scss';\nimport { prefix } from '../../globals/settings';\n\n/**\n * Header panel\n *\n * @element cds-header-panel\n */\n@customElement(`${prefix}-header-panel`)\nclass CDSHeaderPanel extends LitElement {\n /**\n * Specify whether the panel is expanded\n */\n @property({ type: Boolean, reflect: true })\n expanded;\n\n render() {\n return html`<slot></slot>`;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default CDSHeaderPanel;\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,IAAI,QAAQ,KAAK;AACtC,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,aAAa,IAAIC,aAAa,QAAQ,yCAAyC;AACxF,OAAOC,MAAM,MAAM,mBAAe;AAClC,SAASC,MAAM,QAAQ,wBAAwB;;AAE/C;AACA;AACA;AACA;AACA;AAJA,IAMMC,cAAc,GAAAC,SAAA,EADnBJ,aAAa,CAAC,GAAGE,MAAM,eAAe,CAAC,aAAAG,WAAA,EAAAC,WAAA;EAAxC,MACMH,cAAc,SAAAG,WAAA,CAAoB;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EAiBxC;EAAC;IAAAI,CAAA,EAjBKN,cAAc;IAAAO,CAAA;MAAAC,IAAA;MAAAC,UAAA,GAIjBd,QAAQ,CAAC;QAAEe,IAAI,EAAEC,OAAO;QAAEC,OAAO,EAAE;MAAK,CAAC,CAAC;MAAAC,GAAA;MAAAC,KAAA;IAAA;MAAAN,IAAA;MAAAK,GAAA;MAAAC,KAAA;MAH3C;AACF;AACA;;MAIE,SAAAC,OAAA,EAAS;QACP,OAAOrB,IAAI,CAAAsB,EAAA,KAAAA,EAAA,GAAAC,CAAA;MACb;IAAC;MAAAT,IAAA;MAAAU,MAAA;MAAAL,GAAA;MAAAC,MAAA;QAAA,OAAAK,aAAA,CAAAA,aAAA,KAGI1B,UAAU,CAAC2B,iBAAiB;UAC/BC,cAAc,EAAE;QAAI;MAAA;IAAA;MAAAb,IAAA;MAAAU,MAAA;MAAAL,GAAA;MAAAC,MAAA;QAAA,OAGNhB,MAAM;MAAA;IAAA;EAAA;AAAA,GAhBKL,UAAU;AAmBvC,eAAeO,cAAc","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  *
4
- * Copyright IBM Corp. 2023
4
+ * Copyright IBM Corp. 2023, 2024
5
5
  *
6
6
  * This source code is licensed under the Apache-2.0 license found in the
7
7
  * LICENSE file in the root directory of this source tree.
@@ -6,14 +6,15 @@ let _ = t => t,
6
6
  /**
7
7
  * @license
8
8
  *
9
- * Copyright IBM Corp. 2023
9
+ * Copyright IBM Corp. 2023, 2024
10
10
  *
11
11
  * This source code is licensed under the Apache-2.0 license found in the
12
12
  * LICENSE file in the root directory of this source tree.
13
13
  */
14
14
 
15
15
  import { LitElement, html } from 'lit';
16
- import { property, customElement } from 'lit/decorators.js';
16
+ import { property } from 'lit/decorators.js';
17
+ import { carbonElement as customElement } from '../../globals/decorators/carbon-element';
17
18
  import { prefix } from '../../globals/settings';
18
19
  import styles from "././side-nav.css.js";
19
20
 
@@ -1 +1 @@
1
- {"version":3,"file":"header-side-nav-items.js","names":["LitElement","html","property","customElement","prefix","styles","CDSHeaderSideNavItems","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","decorators","type","Boolean","attribute","key","value","connectedCallback","hasAttribute","setAttribute","_get","_getPrototypeOf","prototype","call","render","_t","_","static"],"sources":["components/ui-shell/header-side-nav-items.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property, customElement } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport styles from './side-nav.scss';\n\n/**\n * Header Side Nav Items section\n *\n * @element cds-header-side-nav-items\n */\n@customElement(`${prefix}-header-side-nav-items`)\nclass CDSHeaderSideNavItems extends LitElement {\n /**\n * Optionally specify if container will have a bottom divider to differentiate\n * between original sidenav items and header menu items. False by default.\n */\n @property({ type: Boolean, attribute: 'has-divider' })\n hasDivider = false;\n\n connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'list');\n }\n super.connectedCallback();\n }\n\n render() {\n return html`<slot></slot>`;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default CDSHeaderSideNavItems;\n"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,IAAI,QAAQ,KAAK;AACtC,SAASC,QAAQ,EAAEC,aAAa,QAAQ,mBAAmB;AAC3D,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,OAAOC,MAAM,MAAM,qBAAiB;;AAEpC;AACA;AACA;AACA;AACA,GAJA;AACA;AACA;AACA;AACA;AAJA,IAMMC,qBAAqB,GAAAC,SAAA,EAD1BJ,aAAa,CAAC,GAAGC,MAAM,wBAAwB,CAAC,aAAAI,WAAA,EAAAC,WAAA;EAAjD,MACMH,qBAAqB,SAAAG,WAAA,CAAoB;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EAoB/C;EAAC;IAAAI,CAAA,EApBKN,qBAAqB;IAAAO,CAAA;MAAAC,IAAA;MAAAC,UAAA,GAKxBb,QAAQ,CAAC;QAAEc,IAAI,EAAEC,OAAO;QAAEC,SAAS,EAAE;MAAc,CAAC,CAAC;MAAAC,GAAA;MAAAC,MAAA;QAAA,OACzC,KAAK;MAAA;IAAA;MAAAN,IAAA;MAAAK,GAAA;MAAAC,KAAA;MALlB;AACF;AACA;AACA;;MAIE,SAAAC,kBAAA,EAAoB;QAClB,IAAI,CAAC,IAAI,CAACC,YAAY,CAAC,MAAM,CAAC,EAAE;UAC9B,IAAI,CAACC,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC;QACnC;QACAC,IAAA,CAAAC,eAAA,CAZEnB,qBAAqB,CAAAoB,SAAA,8BAAAC,IAAA;MAazB;IAAC;MAAAb,IAAA;MAAAK,GAAA;MAAAC,KAAA,EAED,SAAAQ,OAAA,EAAS;QACP,OAAO3B,IAAI,CAAA4B,EAAA,KAAAA,EAAA,GAAAC,CAAA;MACb;IAAC;MAAAhB,IAAA;MAAAiB,MAAA;MAAAZ,GAAA;MAAAC,MAAA;QAAA,OAEef,MAAM;MAAA;IAAA;EAAA;AAAA,GAnBYL,UAAU;AAsB9C,eAAeM,qBAAqB","ignoreList":[]}
1
+ {"version":3,"file":"header-side-nav-items.js","names":["LitElement","html","property","carbonElement","customElement","prefix","styles","CDSHeaderSideNavItems","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","decorators","type","Boolean","attribute","key","value","connectedCallback","hasAttribute","setAttribute","_get","_getPrototypeOf","prototype","call","render","_t","_","static"],"sources":["components/ui-shell/header-side-nav-items.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2023, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { prefix } from '../../globals/settings';\nimport styles from './side-nav.scss';\n\n/**\n * Header Side Nav Items section\n *\n * @element cds-header-side-nav-items\n */\n@customElement(`${prefix}-header-side-nav-items`)\nclass CDSHeaderSideNavItems extends LitElement {\n /**\n * Optionally specify if container will have a bottom divider to differentiate\n * between original sidenav items and header menu items. False by default.\n */\n @property({ type: Boolean, attribute: 'has-divider' })\n hasDivider = false;\n\n connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'list');\n }\n super.connectedCallback();\n }\n\n render() {\n return html`<slot></slot>`;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default CDSHeaderSideNavItems;\n"],"mappings":";;;;;AAAA;AACA;AACA;AACA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AA;AAAA,GAnBYN,UAAU;AAsB9C,eAAeO,qBAAqB","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  *
4
- * Copyright IBM Corp. 2019, 2023
4
+ * Copyright IBM Corp. 2019, 2024
5
5
  *
6
6
  * This source code is licensed under the Apache-2.0 license found in the
7
7
  * LICENSE file in the root directory of this source tree.
@@ -7,7 +7,7 @@ let _ = t => t,
7
7
  /**
8
8
  * @license
9
9
  *
10
- * Copyright IBM Corp. 2019, 2023
10
+ * Copyright IBM Corp. 2019, 2024
11
11
  *
12
12
  * This source code is licensed under the Apache-2.0 license found in the
13
13
  * LICENSE file in the root directory of this source tree.
@@ -15,7 +15,8 @@ let _ = t => t,
15
15
 
16
16
  import { classMap } from 'lit/directives/class-map.js';
17
17
  import { LitElement, html } from 'lit';
18
- import { property, customElement } from 'lit/decorators.js';
18
+ import { property } from 'lit/decorators.js';
19
+ import { carbonElement as customElement } from '../../globals/decorators/carbon-element';
19
20
  import { prefix } from '../../globals/settings';
20
21
  import FocusMixin from '../../globals/mixins/focus';
21
22
  import styles from "././header.css.js";
@@ -1 +1 @@
1
- {"version":3,"file":"switcher-item.js","names":["classMap","LitElement","html","property","customElement","prefix","FocusMixin","styles","CDSSwitcherItem","_decorate","_initialize","_FocusMixin","constructor","args","F","d","kind","decorators","type","String","attribute","key","value","Boolean","reflect","Number","connectedCallback","hasAttribute","setAttribute","_get","_getPrototypeOf","prototype","call","render","href","selected","ariaLabel","ariaLabelledBy","tabIndex","classes","_t","_","static","_objectSpread","shadowRootOptions","delegatesFocus"],"sources":["components/ui-shell/switcher-item.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { classMap } from 'lit/directives/class-map.js';\nimport { LitElement, html } from 'lit';\nimport { property, customElement } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport FocusMixin from '../../globals/mixins/focus';\nimport styles from './header.scss';\n\n/**\n * Switcher menu item.\n *\n * @element cds-switcher-item\n */\n@customElement(`${prefix}-switcher-item`)\nclass CDSSwitcherItem extends FocusMixin(LitElement) {\n /**\n * Required props for accessibility label\n */\n @property({ type: String, attribute: 'aria-label' })\n ariaLabel;\n\n /**\n * Props for accessibility labelled by\n */\n @property({ type: String, attribute: 'aria-labelledby' })\n ariaLabelledBy;\n\n /**\n * Link `href`.\n */\n @property()\n href = '';\n\n /**\n * Specify if this is a large variation of the side nav link\n */\n @property({ type: Boolean, reflect: true })\n selected = false;\n\n /**\n * Specify if this is a large variation of the side nav link\n */\n @property({ type: Number, reflect: true, attribute: 'tab-index' })\n tabIndex = 0;\n\n connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'listitem');\n }\n super.connectedCallback();\n }\n\n render() {\n const { href, selected, ariaLabel, ariaLabelledBy, tabIndex } = this;\n\n const classes = classMap({\n [`${prefix}--switcher__item-link`]: true,\n [`${prefix}--switcher__item-link--selected`]: selected,\n });\n\n return html`\n <a\n part=\"link\"\n aria-label=\"${ariaLabel}\"\n aria-labelledby=\"${ariaLabelledBy}\"\n tabindex=\"${tabIndex}\"\n class=\"${classes}\"\n href=\"${href}\">\n <slot></slot>\n </a>\n `;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default CDSSwitcherItem;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,6BAA6B;AACtD,SAASC,UAAU,EAAEC,IAAI,QAAQ,KAAK;AACtC,SAASC,QAAQ,EAAEC,aAAa,QAAQ,mBAAmB;AAC3D,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,OAAOC,UAAU,MAAM,4BAA4B;AACnD,OAAOC,MAAM,MAAM,mBAAe;;AAElC;AAC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I,CAAC,IAAI,CAACC,YAAY,CAAC,MAAM,CAAC,EAAE;UAC9B,IAAI,CAACC,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC;QACvC;QACAC,IAAA,CAAAC,eAAA,CAnCEtB,eAAe,CAAAuB,SAAA,8BAAAC,IAAA;MAoCnB;IAAC;MAAAhB,IAAA;MAAAK,GAAA;MAAAC,KAAA,EAED,SAAAW,OAAA,EAAS;QACP,MAAM;UAAEC,IAAI;UAAEC,QAAQ;UAAEC,SAAS;UAAEC,cAAc;UAAEC;QAAS,CAAC,GAAG,IAAI;QAEpE,MAAMC,OAAO,GAAGvC,QAAQ,CAAC;UACvB,CAAC,GAAGK,MAAM,uBAAuB,GAAG,IAAI;UACxC,CAAC,GAAGA,MAAM,iCAAiC,GAAG8B;QAChD,CAAC,CAAC;QAEF,OAAOjC,IAAI,CAAAsC,EAAA,KAAAA,EAAA,GAAAC,CAAA;AACf;AACA;AACA,sBAHe;AACf,2BADe;AACf,oBADe;AACf,iBADe;AACf,gBADe;AACf;AACA;AACA,KAHe,GAGOL,SAAS,EACJC,cAAc,EACrBC,QAAQ,EACXC,OAAO,EACRL,IAAI;MAIlB;IAAC;MAAAlB,IAAA;MAAA0B,MAAA;MAAArB,GAAA;MAAAC,MAAA;QAAA,OAAAqB,aAAA,CAAAA,aAAA,KAGI1C,UAAU,CAAC2C,iBAAiB;UAC/BC,cAAc,EAAE;QAAI;MAAA;IAAA;MAAA7B,IAAA;MAAA0B,MAAA;MAAArB,GAAA;MAAAC,MAAA;QAAA,OAENf,MAAM;MAAA;IAAA;EAAA;AAAA,GA/DMD,UAAU,CAACL,UAAU,CAAC;AAkEpD,eAAeO,eAAe","ignoreList":[]}
1
+ {"version":3,"file":"switcher-item.js","names":["classMap","LitElement","html","property","carbonElement","customElement","prefix","FocusMixin","styles","CDSSwitcherItem","_decorate","_initialize","_FocusMixin","constructor","args","F","d","kind","decorators","type","String","attribute","key","value","Boolean","reflect","Number","connectedCallback","hasAttribute","setAttribute","_get","_getPrototypeOf","prototype","call","render","href","selected","ariaLabel","ariaLabelledBy","tabIndex","classes","_t","_","static","_objectSpread","shadowRootOptions","delegatesFocus"],"sources":["components/ui-shell/switcher-item.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { classMap } from 'lit/directives/class-map.js';\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { prefix } from '../../globals/settings';\nimport FocusMixin from '../../globals/mixins/focus';\nimport styles from './header.scss';\n\n/**\n * Switcher menu item.\n *\n * @element cds-switcher-item\n */\n@customElement(`${prefix}-switcher-item`)\nclass CDSSwitcherItem extends FocusMixin(LitElement) {\n /**\n * Required props for accessibility label\n */\n @property({ type: String, attribute: 'aria-label' })\n ariaLabel;\n\n /**\n * Props for accessibility labelled by\n */\n @property({ type: String, attribute: 'aria-labelledby' })\n ariaLabelledBy;\n\n /**\n * Link `href`.\n */\n @property()\n href = '';\n\n /**\n * Specify if this is a large variation of the side nav link\n */\n @property({ type: Boolean, reflect: true })\n selected = false;\n\n /**\n * Specify if this is a large variation of the side nav link\n */\n @property({ type: Number, reflect: true, attribute: 'tab-index' })\n tabIndex = 0;\n\n connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'listitem');\n }\n super.connectedCallback();\n }\n\n render() {\n const { href, selected, ariaLabel, ariaLabelledBy, tabIndex } = this;\n\n const classes = classMap({\n [`${prefix}--switcher__item-link`]: true,\n [`${prefix}--switcher__item-link--selected`]: selected,\n });\n\n return html`\n <a\n part=\"link\"\n aria-label=\"${ariaLabel}\"\n aria-labelledby=\"${ariaLabelledBy}\"\n tabindex=\"${tabIndex}\"\n class=\"${classes}\"\n href=\"${href}\">\n <slot></slot>\n </a>\n `;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default CDSSwitcherItem;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,6BAA6B;AACtD,SAASC,UAAU,EAAEC,IAAI,QAAQ,KAAK;AACtC,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,aAAa,IAAIC,aAAa,QAAQ,yCAAyC;AACxF,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,OAAOC,UAAU,MAAM,4BAA4B;AACnD,OAAOC,MAAM,MAAM,mBAAe;;AAElC;AACA;AACA;AACA;AACA,GAJA;AACA;AACA;AACA;AACA;AAJA,IAMMC,eAAe,GAAAC,SAAA,EADpBL,aAAa,CAAC,GAAGC,MAAM,gBAAgB,CAAC,aAAAK,WAAA,EAAAC,WAAA;EAAzC,MACMH,eAAe,SAAAG,WAAA,CAAgC;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EAgErD;EAAC;IAAAI,CAAA,EAhEKN,eAAe;IAAAO,CAAA;MAAAC,IAAA;MAAAC,UAAA,GAIlBf,QAAQ,CAAC;QAAEgB,IAAI,EAAEC,MAAM;QAAEC,SAAS,EAAE;MAAa,CAAC,CAAC;MAAAC,GAAA;MAAAC,KAAA;IAAA;MAAAN,IAAA;MAAAC,UAAA,GAMnDf,QAAQ,CAAC;QAAEgB,IAAI,EAAEC,MAAM;QAAEC,SAAS,EAAE;MAAkB,CAAC,CAAC;MAAAC,GAAA;MAAAC,KAAA;IAAA;MAAAN,IAAA;MAAAC,UAAA,GAMxDf,QAAQ,CAAC,CAAC;MAAAmB,GAAA;MAAAC,MAAA;QAAA,OACJ,EAAE;MAAA;IAAA;MAAAN,IAAA;MAAAC,UAAA,GAKRf,QAAQ,CAAC;QAAEgB,IAAI,EAAEK,OAAO;QAAEC,OAAO,EAAE;MAAK,C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AA,aAAA,KAGI3C,UAAU,CAAC4C,iBAAiB;UAC/BC,cAAc,EAAE;QAAI;MAAA;IAAA;MAAA7B,IAAA;MAAA0B,MAAA;MAAArB,GAAA;MAAAC,MAAA;QAAA,OAENf,MAAM;MAAA;IAAA;EAAA;AAAA,GA/DMD,UAAU,CAACN,UAAU,CAAC;AAkEpD,eAAeQ,eAAe","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  *
4
- * Copyright IBM Corp. 2023
4
+ * Copyright IBM Corp. 2023, 2024
5
5
  *
6
6
  * This source code is licensed under the Apache-2.0 license found in the
7
7
  * LICENSE file in the root directory of this source tree.
@@ -7,14 +7,15 @@ let _ = t => t,
7
7
  /**
8
8
  * @license
9
9
  *
10
- * Copyright IBM Corp. 2023
10
+ * Copyright IBM Corp. 2023, 2024
11
11
  *
12
12
  * This source code is licensed under the Apache-2.0 license found in the
13
13
  * LICENSE file in the root directory of this source tree.
14
14
  */
15
15
 
16
16
  import { LitElement, html } from 'lit';
17
- import { property, customElement } from 'lit/decorators.js';
17
+ import { property } from 'lit/decorators.js';
18
+ import { carbonElement as customElement } from '../../globals/decorators/carbon-element';
18
19
  import styles from "././header.css.js";
19
20
  import { prefix } from '../../globals/settings';
20
21
 
@@ -1 +1 @@
1
- {"version":3,"file":"switcher.js","names":["LitElement","html","property","customElement","styles","prefix","CDSSwitcher","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","decorators","type","String","attribute","key","value","connectedCallback","hasAttribute","setAttribute","_get","_getPrototypeOf","prototype","call","render","_t","_","static","_objectSpread","shadowRootOptions","delegatesFocus"],"sources":["components/ui-shell/switcher.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property, customElement } from 'lit/decorators.js';\nimport styles from './header.scss';\nimport { prefix } from '../../globals/settings';\n\n/**\n * Switcher\n *\n * @element cds-switcher\n */\n@customElement(`${prefix}-switcher`)\nclass CDSSwitcher extends LitElement {\n /**\n * Required props for accessibility label on the underlying menu\n */\n @property({ type: String, attribute: 'aria-label' })\n ariaLabel;\n\n /**\n * Prop for accessibility labelled by on the underlying menu\n */\n @property({ type: String, attribute: 'aria-labelledby' })\n ariaLabelledBy;\n\n connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'list');\n }\n super.connectedCallback();\n }\n\n render() {\n return html`<slot></slot>`;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default CDSSwitcher;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,IAAI,QAAQ,KAAK;AACtC,SAASC,QAAQ,EAAEC,aAAa,QAAQ,mBAAmB;AAC3D,OAAOC,MAAM,MAAM,mBAAe;AAClC,SAASC,MAAM,QAAQ,wBAAwB;;AAE/C;AACA;AACA;AACA;AACA;AAJA,IAMMC,WAAW,GAAAC,SAAA,EADhBJ,aAAa,CAAC,GAAGE,MAAM,WAAW,CAAC,aAAAG,WAAA,EAAAC,WAAA;EAApC,MACMH,WAAW,SAAAG,WAAA,CAAoB;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EA8BrC;EAAC;IAAAI,CAAA,EA9BKN,WAAW;IAAAO,CAAA;MAAAC,IAAA;MAAAC,UAAA,GAIdb,QAAQ,CAAC;QAAEc,IAAI,EAAEC,MAAM;QAAEC,SAAS,EAAE;MAAa,CAAC,CAAC;MAAAC,GAAA;MAAAC,KAAA;IAAA;MAAAN,IAAA;MAAAC,UAAA,GAMnDb,QAAQ,CAAC;QAAEc,IAAI,EAAEC,MAAM;QAAEC,SAAS,EAAE;MAAkB,CAAC,CAAC;MAAAC,GAAA;MAAAC,KAAA;IAAA;MAAAN,IAAA;MAAAK,GAAA;MAAAC,KAAA;MATzD;AACF;AACA;;MAIE;AACF;AACA;;MAIE,SAAAC,kBAAA,EAAoB;QAClB,IAAI,CAAC,IAAI,CAACC,YAAY,CAAC,MAAM,CAAC,EAAE;UAC9B,IAAI,CAACC,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC;QACnC;QACAC,IAAA,CAAAC,eAAA,CAjBEnB,WAAW,CAAAoB,SAAA,8BAAAC,IAAA;MAkBf;IAAC;MAAAb,IAAA;MAAAK,GAAA;MAAAC,KAAA,EAED,SAAAQ,OAAA,EAAS;QACP,OAAO3B,IAAI,CAAA4B,EAAA,KAAAA,EAAA,GAAAC,CAAA;MACb;IAAC;MAAAhB,IAAA;MAAAiB,MAAA;MAAAZ,GAAA;MAAAC,MAAA;QAAA,OAAAY,aAAA,CAAAA,aAAA,KAGIhC,UAAU,CAACiC,iBAAiB;UAC/BC,cAAc,EAAE;QAAI;MAAA;IAAA;MAAApB,IAAA;MAAAiB,MAAA;MAAAZ,GAAA;MAAAC,MAAA;QAAA,OAGNhB,MAAM;MAAA;IAAA;EAAA;AAAA,GA7BEJ,UAAU;AAgCpC,eAAeM,WAAW","ignoreList":[]}
1
+ {"version":3,"file":"switcher.js","names":["LitElement","html","property","carbonElement","customElement","styles","prefix","CDSSwitcher","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","decorators","type","String","attribute","key","value","connectedCallback","hasAttribute","setAttribute","_get","_getPrototypeOf","prototype","call","render","_t","_","static","_objectSpread","shadowRootOptions","delegatesFocus"],"sources":["components/ui-shell/switcher.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2023, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport styles from './header.scss';\nimport { prefix } from '../../globals/settings';\n\n/**\n * Switcher\n *\n * @element cds-switcher\n */\n@customElement(`${prefix}-switcher`)\nclass CDSSwitcher extends LitElement {\n /**\n * Required props for accessibility label on the underlying menu\n */\n @property({ type: String, attribute: 'aria-label' })\n ariaLabel;\n\n /**\n * Prop for accessibility labelled by on the underlying menu\n */\n @property({ type: String, attribute: 'aria-labelledby' })\n ariaLabelledBy;\n\n connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'list');\n }\n super.connectedCallback();\n }\n\n render() {\n return html`<slot></slot>`;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default CDSSwitcher;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,IAAI,QAAQ,KAAK;AACtC,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,aAAa,IAAIC,aAAa,QAAQ,yCAAyC;AACxF,OAAOC,MAAM,MAAM,mBAAe;AAClC,SAASC,MAAM,QAAQ,wBAAwB;;AAE/C;AACA;AACA;AACA;AACA;AAJA,IAMMC,WAAW,GAAAC,SAAA,EADhBJ,aAAa,CAAC,GAAGE,MAAM,WAAW,CAAC,aAAAG,WAAA,EAAAC,WAAA;EAApC,MACMH,WAAW,SAAAG,WAAA,CAAoB;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EA8BrC;EAAC;IAAAI,CAAA,EA9BKN,WAAW;IAAAO,CAAA;MAAAC,IAAA;MAAAC,UAAA,GAIdd,QAAQ,CAAC;QAAEe,IAAI,EAAEC,MAAM;QAAEC,SAAS,EAAE;MAAa,CAAC,CAAC;MAAAC,GAAA;MAAAC,KAAA;IAAA;MAAAN,IAAA;MAAAC,UAAA,GAMnDd,QAAQ,CAAC;QAAEe,IAAI,EAAEC,MAAM;QAAEC,SAAS,EAAE;MAAkB,CAAC,CAAC;MAAAC,GAAA;MAAAC,KAAA;IAAA;MAAAN,IAAA;MAAAK,GAAA;MAAAC,KAAA;MATzD;AACF;AACA;;MAIE;AACF;AACA;;MAIE,SAAAC,kBAAA,EAAoB;QAClB,IAAI,CAAC,IAAI,CAACC,YAAY,CAAC,MAAM,CAAC,EAAE;UAC9B,IAAI,CAACC,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC;QACnC;QACAC,IAAA,CAAAC,eAAA,CAjBEnB,WAAW,CAAAoB,SAAA,8BAAAC,IAAA;MAkBf;IAAC;MAAAb,IAAA;MAAAK,GAAA;MAAAC,KAAA,EAED,SAAAQ,OAAA,EAAS;QACP,OAAO5B,IAAI,CAAA6B,EAAA,KAAAA,EAAA,GAAAC,CAAA;MACb;IAAC;MAAAhB,IAAA;MAAAiB,MAAA;MAAAZ,GAAA;MAAAC,MAAA;QAAA,OAAAY,aAAA,CAAAA,aAAA,KAGIjC,UAAU,CAACkC,iBAAiB;UAC/BC,cAAc,EAAE;QAAI;MAAA;IAAA;MAAApB,IAAA;MAAAiB,MAAA;MAAAZ,GAAA;MAAAC,MAAA;QAAA,OAGNhB,MAAM;MAAA;IAAA;EAAA;AAAA,GA7BEL,UAAU;AAgCpC,eAAeO,WAAW","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carbon/web-components",
3
- "version": "2.11.0-rc.0",
3
+ "version": "2.11.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -211,5 +211,5 @@
211
211
  "zone.js": "~0.14.0"
212
212
  },
213
213
  "typings": "es/index.d.ts",
214
- "gitHead": "83739d48d7b0ca7dfef66ccb615787a7dade2ac2"
214
+ "gitHead": "f7bdcd995d5840f659fc282e5853bbac40f10100"
215
215
  }
@@ -1,78 +0,0 @@
1
- /**
2
- * @license
3
- *
4
- * Copyright IBM Corp. 2019, 2020
5
- *
6
- * This source code is licensed under the Apache-2.0 license found in the
7
- * LICENSE file in the root directory of this source tree.
8
- */
9
- /**
10
- * @license
11
- *
12
- * This bundle contains the following third-party dependencies:
13
- *
14
- * flatpickr:
15
- *
16
- *****************************************************************************
17
- Copyright (c) Microsoft Corporation.
18
-
19
- Permission to use, copy, modify, and/or distribute this software for any
20
- purpose with or without fee is hereby granted.
21
-
22
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
23
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
24
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
25
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
26
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
27
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
28
- PERFORMANCE OF THIS SOFTWARE.
29
- *****************************************************************************
30
- *
31
- * @carbon/motion:
32
- *
33
- * Copyright IBM Corp. 2018, 2023
34
- *
35
- * This source code is licensed under the Apache-2.0 license found in the
36
- * LICENSE file in the root directory of this source tree.
37
- *
38
- * lit-html:
39
- *
40
- * @license
41
- * Copyright 2022 Google LLC
42
- * SPDX-License-Identifier: BSD-3-Clause
43
- *
44
- * lit-element:
45
- *
46
- * @license
47
- * Copyright 2017 Google LLC
48
- * SPDX-License-Identifier: BSD-3-Clause
49
- *
50
- * @lit/reactive-element:
51
- *
52
- * @license
53
- * Copyright 2017 Google LLC
54
- * SPDX-License-Identifier: BSD-3-Clause
55
- *
56
- * @carbon/layout:
57
- *
58
- * Copyright IBM Corp. 2018, 2023
59
- *
60
- * This source code is licensed under the Apache-2.0 license found in the
61
- * LICENSE file in the root directory of this source tree.
62
- *
63
- * Also refer to the following links for the license of other third-party dependencies:
64
- *
65
- * https://www.npmjs.com/package/lit
66
- * https://www.npmjs.com/package/@carbon/icons
67
- * https://www.npmjs.com/package/lodash-es
68
- * https://www.npmjs.com/package/@floating-ui/dom
69
- * https://www.npmjs.com/package/@floating-ui/utils
70
- * https://www.npmjs.com/package/@floating-ui/core
71
- */
72
-
73
- /**
74
- * @license
75
- * Copyright 2017 Google LLC
76
- * SPDX-License-Identifier: BSD-3-Clause
77
- */
78
- const e=e=>n=>"function"==typeof n?((e,n)=>(customElements.define(e,n),n))(e,n):((e,n)=>{const{kind:t,elements:s}=n;return{kind:t,elements:s,finisher(n){customElements.define(e,n)}}})(e,n);export{e};