@aquera/nile-elements 0.1.33-beta-1.0 → 0.1.33

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 (121) hide show
  1. package/README.md +6 -10
  2. package/demo/index.html +27 -262
  3. package/dist/{fixture-d5b55278.cjs.js → fixture-161dee0b.cjs.js} +3 -3
  4. package/dist/fixture-161dee0b.cjs.js.map +1 -0
  5. package/dist/{fixture-df8b52d7.esm.js → fixture-372df3b0.esm.js} +1 -1
  6. package/dist/index.cjs.js +1 -1
  7. package/dist/index.esm.js +1 -1
  8. package/dist/internal/animate.cjs.js +1 -1
  9. package/dist/internal/animate.cjs.js.map +1 -1
  10. package/dist/internal/animate.esm.js +1 -1
  11. package/dist/nile-accordion/nile-accordian.test.cjs.js +1 -1
  12. package/dist/nile-accordion/nile-accordian.test.esm.js +1 -1
  13. package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +1 -1
  14. package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +1 -1
  15. package/dist/nile-avatar/nile-avatar.test.cjs.js +1 -1
  16. package/dist/nile-avatar/nile-avatar.test.esm.js +1 -1
  17. package/dist/nile-badge/nile-badge.test.cjs.js +1 -1
  18. package/dist/nile-badge/nile-badge.test.esm.js +1 -1
  19. package/dist/nile-button/nile-button.test.cjs.js +1 -1
  20. package/dist/nile-button/nile-button.test.esm.js +1 -1
  21. package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js +1 -1
  22. package/dist/nile-button-toggle-group/nile-button-toggle-group.test.esm.js +1 -1
  23. package/dist/nile-calendar/nile-calendar.test.cjs.js +1 -1
  24. package/dist/nile-calendar/nile-calendar.test.esm.js +1 -1
  25. package/dist/nile-card/nile-card.test.cjs.js +1 -1
  26. package/dist/nile-card/nile-card.test.esm.js +1 -1
  27. package/dist/nile-checkbox/nile-checkbox.test.cjs.js +1 -1
  28. package/dist/nile-checkbox/nile-checkbox.test.esm.js +1 -1
  29. package/dist/nile-chip/nile-chip.test.cjs.js +1 -1
  30. package/dist/nile-chip/nile-chip.test.esm.js +1 -1
  31. package/dist/nile-dialog/nile-dialog.test.cjs.js +1 -1
  32. package/dist/nile-dialog/nile-dialog.test.esm.js +1 -1
  33. package/dist/nile-drawer/nile-drawer.test.cjs.js +1 -1
  34. package/dist/nile-drawer/nile-drawer.test.esm.js +1 -1
  35. package/dist/nile-dropdown/nile-dropdown.test.cjs.js +1 -1
  36. package/dist/nile-dropdown/nile-dropdown.test.esm.js +1 -1
  37. package/dist/nile-empty-state/nile-empty-state.test.cjs.js +1 -1
  38. package/dist/nile-empty-state/nile-empty-state.test.esm.js +1 -1
  39. package/dist/nile-error-message/nile-error-message.test.cjs.js +1 -1
  40. package/dist/nile-error-message/nile-error-message.test.esm.js +1 -1
  41. package/dist/nile-form-group/nile-form-group.test.cjs.js +1 -1
  42. package/dist/nile-form-group/nile-form-group.test.esm.js +1 -1
  43. package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js +1 -1
  44. package/dist/nile-form-help-text/nile-form-help-text.test.esm.js +1 -1
  45. package/dist/nile-hero/nile-hero.test.cjs.js +1 -1
  46. package/dist/nile-hero/nile-hero.test.esm.js +1 -1
  47. package/dist/nile-icon/nile-icon.test.cjs.js +1 -1
  48. package/dist/nile-icon/nile-icon.test.esm.js +1 -1
  49. package/dist/nile-input/nile-input.css.cjs.js +1 -1
  50. package/dist/nile-input/nile-input.css.cjs.js.map +1 -1
  51. package/dist/nile-input/nile-input.css.esm.js +0 -8
  52. package/dist/nile-input/nile-input.test.cjs.js +1 -1
  53. package/dist/nile-input/nile-input.test.esm.js +1 -1
  54. package/dist/nile-link/nile-link.test.cjs.js +1 -1
  55. package/dist/nile-link/nile-link.test.esm.js +1 -1
  56. package/dist/nile-loader/nile-loader.test.cjs.js +1 -1
  57. package/dist/nile-loader/nile-loader.test.esm.js +1 -1
  58. package/dist/nile-menu/nile-menu.cjs.js +1 -1
  59. package/dist/nile-menu/nile-menu.cjs.js.map +1 -1
  60. package/dist/nile-menu/nile-menu.esm.js +2 -2
  61. package/dist/nile-popover/nile-popover.test.cjs.js +1 -1
  62. package/dist/nile-popover/nile-popover.test.esm.js +1 -1
  63. package/dist/nile-popup/nile-popup.test.cjs.js +1 -1
  64. package/dist/nile-popup/nile-popup.test.esm.js +1 -1
  65. package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js +1 -1
  66. package/dist/nile-progress-bar/nile-progress-bar.test.esm.js +1 -1
  67. package/dist/nile-radio/nile-radio.test.cjs.js +1 -1
  68. package/dist/nile-radio/nile-radio.test.esm.js +1 -1
  69. package/dist/nile-radio-group/nile-radio-group.test.cjs.js +1 -1
  70. package/dist/nile-radio-group/nile-radio-group.test.esm.js +1 -1
  71. package/dist/nile-select/nile-select.test.cjs.js +1 -1
  72. package/dist/nile-select/nile-select.test.esm.js +1 -1
  73. package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +1 -1
  74. package/dist/nile-slide-toggle/nile-slide-toggle.test.esm.js +1 -1
  75. package/dist/nile-tab-group/nile-tab-group.test.cjs.js +1 -1
  76. package/dist/nile-tab-group/nile-tab-group.test.esm.js +1 -1
  77. package/dist/nile-table/nile-table.cjs.js.map +1 -1
  78. package/dist/nile-textarea/nile-textarea.test.cjs.js +1 -1
  79. package/dist/nile-textarea/nile-textarea.test.esm.js +1 -1
  80. package/dist/nile-tooltip/index.cjs.js +1 -1
  81. package/dist/nile-tooltip/index.esm.js +1 -1
  82. package/dist/nile-tooltip/nile-tooltip.cjs.js +1 -1
  83. package/dist/nile-tooltip/nile-tooltip.cjs.js.map +1 -1
  84. package/dist/nile-tooltip/nile-tooltip.css.cjs.js +1 -1
  85. package/dist/nile-tooltip/nile-tooltip.css.cjs.js.map +1 -1
  86. package/dist/nile-tooltip/nile-tooltip.css.esm.js +56 -59
  87. package/dist/nile-tooltip/nile-tooltip.esm.js +28 -23
  88. package/dist/src/nile-input/nile-input.css.js +0 -8
  89. package/dist/src/nile-input/nile-input.css.js.map +1 -1
  90. package/dist/src/nile-menu/nile-menu.d.ts +1 -0
  91. package/dist/src/nile-menu/nile-menu.js +5 -6
  92. package/dist/src/nile-menu/nile-menu.js.map +1 -1
  93. package/dist/src/nile-table/nile-table.js.map +1 -1
  94. package/dist/src/nile-tooltip/nile-tooltip.css.js +45 -48
  95. package/dist/src/nile-tooltip/nile-tooltip.css.js.map +1 -1
  96. package/dist/src/nile-tooltip/nile-tooltip.d.ts +44 -23
  97. package/dist/src/nile-tooltip/nile-tooltip.js +227 -157
  98. package/dist/src/nile-tooltip/nile-tooltip.js.map +1 -1
  99. package/dist/tsconfig.tsbuildinfo +1 -1
  100. package/package.json +1 -1
  101. package/src/nile-input/nile-input.css.ts +0 -8
  102. package/src/nile-menu/nile-menu.ts +4 -8
  103. package/src/nile-table/nile-table.ts +2 -2
  104. package/src/nile-tooltip/nile-tooltip.css.ts +46 -49
  105. package/src/nile-tooltip/nile-tooltip.ts +237 -155
  106. package/vscode-html-custom-data.json +87 -82
  107. package/dist/fixture-d5b55278.cjs.js.map +0 -1
  108. package/dist/nile-tooltip/nile-tooltip-utils.cjs.js +0 -2
  109. package/dist/nile-tooltip/nile-tooltip-utils.cjs.js.map +0 -1
  110. package/dist/nile-tooltip/nile-tooltip-utils.esm.js +0 -1
  111. package/dist/nile-tooltip/nile-tooltip.test.cjs.js +0 -2
  112. package/dist/nile-tooltip/nile-tooltip.test.cjs.js.map +0 -1
  113. package/dist/nile-tooltip/nile-tooltip.test.esm.js +0 -51
  114. package/dist/src/nile-tooltip/nile-tooltip-utils.d.ts +0 -18
  115. package/dist/src/nile-tooltip/nile-tooltip-utils.js +0 -151
  116. package/dist/src/nile-tooltip/nile-tooltip-utils.js.map +0 -1
  117. package/dist/src/nile-tooltip/nile-tooltip.test.d.ts +0 -1
  118. package/dist/src/nile-tooltip/nile-tooltip.test.js +0 -158
  119. package/dist/src/nile-tooltip/nile-tooltip.test.js.map +0 -1
  120. package/src/nile-tooltip/nile-tooltip-utils.ts +0 -190
  121. package/src/nile-tooltip/nile-tooltip.test.ts +0 -178
@@ -1 +1 @@
1
- {"version":3,"file":"nile-tooltip.cjs.js","sources":["../../../src/nile-tooltip/nile-tooltip.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { LitElement, html, css, CSSResultArray } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styles } from './nile-tooltip.css';\nimport NileElement from '../internal/nile-element';\nimport { isInViewport, getValidTooltipPosition, getCaretPosition } from './nile-tooltip-utils';\n/**\n * Nile icon component.\n *\n * @tag nile-tooltip\n *\n */\n\n@customElement('nile-tooltip')\nexport class NileTooltip extends NileElement {\n @property({ type: String }) content = '';\n @property({ reflect: true }) size: 'small' | 'large' = 'small';\n @property({ type: String })\n placement:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end' = 'bottom';\n @property({ type: Boolean, reflect: true }) disabled = false;\n @property({ type: Boolean, reflect: true }) open = false;\n /**\n * Controls how the tooltip is activated. Possible options include `click`, `hover`, `focus`, and `manual`. Multiple\n * options can be passed by separating them with a space. When manual is used, the tooltip must be activated\n * programmatically.\n */\n @property() trigger = 'hover focus'; \n @property({ type: Number }) distance = 8;\n private readonly SHIFT_OFFSET = 16;\n/** The distance in pixels from which to offset the tooltip along its target. */\n @property({ type: Number }) skidding = 0;\n @property({ type: Boolean, reflect: true }) hoist = false;\n\n @query('.tooltip') tooltip!: HTMLElement;\n @query('.trigger-container') triggerContainer!: HTMLElement;\n @query('.tooltip-caret') caret!: HTMLElement;\n @query('slot[name=\"content\"]') tooltipSlot!: HTMLSlotElement;\n\n private hasTooltipSlot = false;\n private hoverTimeout: number = 0;\n private caretSize = 6;\n private originalPlacement: string = this.placement;\n\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.originalPlacement = this.placement;\n window.addEventListener('resize', this.updateTooltipPosition);\n window.addEventListener('scroll', this.updateTooltipPosition, true);\n }\n\n updated(changedProps: Map<string, unknown>) {\n super.updated?.(changedProps);\n\n const validPlacements = [\n 'top', 'top-start', 'top-end',\n 'right', 'right-start', 'right-end',\n 'bottom', 'bottom-start', 'bottom-end',\n 'left', 'left-start', 'left-end'\n ];\n\n if (!validPlacements.includes(this.placement)) {\n console.warn(`[nile-tooltip] Invalid placement \"${this.placement}\", defaulting to \"bottom\".`);\n this.placement = 'bottom';\n }\n\n if (!validPlacements.includes(this.originalPlacement)) {\n this.originalPlacement = 'bottom';\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n window.removeEventListener('resize', this.updateTooltipPosition);\n window.removeEventListener('scroll', this.updateTooltipPosition, true);\n }\n\n private handleTooltipSlotChange() {\n const nodes = this.tooltipSlot.assignedNodes({ flatten: true });\n this.hasTooltipSlot = nodes.length > 0;\n this.requestUpdate();\n }\n\n private updateTooltipPosition = () => {\n if (!isInViewport(this.triggerContainer)) {\n this.open = false;\n return;\n }\n\n const triggerRect = this.triggerContainer.getBoundingClientRect();\n const tooltipRect = this.tooltip.getBoundingClientRect();\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n\n const { top, left, placement } = getValidTooltipPosition(\n triggerRect,\n tooltipRect,\n this.originalPlacement,\n this.distance,\n this.skidding,\n this.caretSize,\n viewportWidth,\n viewportHeight\n );\n\n this.setAttribute('placement', placement);\n this.tooltip.style.top = `${top}px`;\n this.tooltip.style.left = `${left}px`;\n\n const { caretLeft, caretTop } = getCaretPosition({\n placement,\n tooltipRect,\n triggerRect,\n caretSize: this.caretSize,\n left,\n top\n });\n\n this.caret.style.left = `${caretLeft}px`;\n this.caret.style.top = `${caretTop}px`;\n };\n\n private showTooltip = () => {\n const trimmedContent = this.content.trim();\n if (!trimmedContent && !this.hasTooltipSlot) {\n return;\n }\n if (!this.disabled && isInViewport(this.triggerContainer)) {\n this.emit('nile-show');\n this.open = true;\n this.updateComplete.then(() => {\n this.updateTooltipPosition();\n this.emit('nile-after-show');\n });\n } else {\n this.open = false;\n }\n };\n\n private hideTooltip = () => {\n this.emit('nile-hide');\n this.open = false;\n setTimeout(() => {\n this.emit('nile-after-hide');\n }, 200);\n };\n\n private handleMouseOver = () => {\n if (this.trigger.includes('hover')) {\n clearTimeout(this.hoverTimeout);\n this.hoverTimeout = window.setTimeout(() => this.showTooltip(), 150);\n }\n };\n\n private handleMouseOut = () => {\n if (this.trigger.includes('hover')) {\n clearTimeout(this.hoverTimeout);\n this.hoverTimeout = window.setTimeout(() => this.hideTooltip(), 0);\n }\n };\n\n private handleClick = () => {\n if (this.trigger.includes('click')) {\n if (!this.open && isInViewport(this.triggerContainer)) {\n this.showTooltip();\n } else {\n this.hideTooltip();\n }\n }\n };\n\n private handleFocus = () => {\n if (this.trigger.includes('focus')) {\n this.showTooltip();\n }\n };\n\n private handleBlur = () => {\n if (this.trigger.includes('focus')) {\n this.hideTooltip();\n }\n };\n\n render() {\n return html`\n <div\n class=${classMap({\n tooltip: true,\n 'tooltip__body--large': this.size === 'large',\n })}\n id=\"tooltip\"\n >\n <div class=\"tooltip-content\" part=\"content\">\n <slot name=\"content\" @slotchange=${this.handleTooltipSlotChange}></slot>\n ${!this.hasTooltipSlot ? html`${this.content}` : null}\n </div>\n <div class=\"tooltip-caret\" style=\"--caret-size: ${this.caretSize}px;\"></div>\n </div>\n\n <div\n class=\"trigger-container\"\n tabindex=\"0\"\n @mouseover=${this.handleMouseOver}\n @mouseout=${this.handleMouseOut}\n @click=${this.handleClick}\n @focusin=${this.handleFocus}\n @focusout=${this.handleBlur}\n aria-describedby=\"tooltip\"\n >\n <slot></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-tooltip': NileTooltip;\n }\n}\n\n"],"names":["NileTooltip","d","this","content","size","placement","disabled","open","trigger","distance","SHIFT_OFFSET","skidding","hoist","hasTooltipSlot","hoverTimeout","caretSize","originalPlacement","updateTooltipPosition","isInViewport","triggerContainer","triggerRect","getBoundingClientRect","tooltipRect","tooltip","viewportWidth","window","innerWidth","viewportHeight","innerHeight","top","getValidTooltipPosition","left","setAttribute","style","concat","_a","getCaretPosition","caretLeft","caretTop","caret","showTooltip","trim","emit","updateComplete","then","hideTooltip","setTimeout","handleMouseOver","includes","clearTimeout","handleMouseOut","handleClick","handleFocus","handleBlur","_this","_inherits","_r","_createClass","key","value","connectedCallback","super","addEventListener","updated","changedProps","validPlacements","console","warn","disconnectedCallback","removeEventListener","handleTooltipSlotChange","nodes","tooltipSlot","assignedNodes","flatten","length","requestUpdate","render","html","_templateObject","_taggedTemplateLiteral","classMap","_templateObject2","get","styles","NileElement","__decorate","property","type","String","prototype","reflect","Boolean","Number","query","_export","customElement"],"mappings":"w7HAoBaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,uEACuBC,KAAAA,CAAOC,OAAG,CAAA,EAAA,CACTD,KAAAA,CAAIE,IAAsB,CAAA,OAAA,CAEvDF,KAAAA,CAASG,SAYQ,CAAA,QAAA,CAC2BH,KAAAA,CAAQI,QAAG,CAAA,CAAA,CAAA,CACXJ,KAAAA,CAAIK,IAAG,CAAA,CAAA,CAAA,CAMvCL,KAAAA,CAAOM,OAAG,CAAA,aAAA,CACMN,KAAAA,CAAQO,QAAG,CAAA,CAAA,CACtBP,KAAAA,CAAYQ,YAAG,CAAA,EAAA,CAEJR,KAAAA,CAAQS,QAAG,CAAA,CAAA,CACKT,KAAAA,CAAKU,KAAG,CAAA,CAAA,CAAA,CAO5CV,KAAAA,CAAcW,cAAG,CAAA,CAAA,CAAA,CACjBX,KAAAA,CAAYY,YAAW,CAAA,CAAA,CACvBZ,KAAAA,CAASa,SAAG,CAAA,CAAA,CACZb,KAAAA,CAAAc,iBAA4Bd,CAAAA,KAAAA,CA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hG"}
1
+ {"version":3,"file":"nile-tooltip.cjs.js","sources":["../../../src/nile-tooltip/nile-tooltip.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, CSSResultArray, TemplateResult } from 'lit';\nimport { styles } from './nile-tooltip.css';\nimport '../nile-popup/nile-popup';\nimport { animateTo, parseDuration, stopAnimations } from '../internal/animate';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport {\n getAnimation,\n setDefaultAnimation,\n} from '../utilities/animation-registry';\nimport { html } from 'lit';\n// import { LocalizeController } from '../utilities/localize';\nimport { waitForEvent } from '../internal/event';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\nimport type NilePopup from '../nile-popup/nile-popup';\n/**\n * Nile icon component.\n *\n * @tag nile-tooltip\n *\n */\n@customElement('nile-tooltip')\nexport class NileTooltip extends NileElement {\n /**\n * The styles for Tooltip\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n private hoverTimeout: number;\n // private readonly localize = new LocalizeController(this);\n\n @query('slot:not([name])') defaultSlot: HTMLSlotElement;\n @query('.tooltip__body') body: HTMLElement;\n @query('nile-popup') popup: NilePopup;\n\n /** The tooltip's content. If you need to display HTML, use the `content` slot instead. */\n @property({ type: String, reflect: true }) content = '';\n\n /** Size Property to decide the tool tip size */\n @property({ reflect: true }) size: 'small' | 'large' = 'small';\n\n /**\n * The preferred placement of the tooltip. Note that the actual placement may vary as needed to keep the tooltip\n * inside of the viewport.\n */\n @property() placement:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end' = 'top';\n\n /** Disables the tooltip so it won't show when triggered. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** The distance in pixels from which to offset the tooltip away from its target. */\n @property({ type: Number }) distance = 8;\n\n /** Indicates whether or not the tooltip is open. You can use this in lieu of the show/hide methods. */\n @property({ type: Boolean, reflect: true }) open = false;\n\n /** The distance in pixels from which to offset the tooltip along its target. */\n @property({ type: Number }) skidding = 0;\n\n /**\n * Controls how the tooltip is activated. Possible options include `click`, `hover`, `focus`, and `manual`. Multiple\n * options can be passed by separating them with a space. When manual is used, the tooltip must be activated\n * programmatically.\n */\n @property() trigger = 'hover focus';\n\n /**\n * Enable this option to prevent the tooltip from being clipped when the component is placed inside a container with\n * `overflow: auto|hidden|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all,\n * scenarios.\n */\n @property({ type: Boolean }) hoist = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.handleBlur = this.handleBlur.bind(this);\n this.handleClick = this.handleClick.bind(this);\n this.handleFocus = this.handleFocus.bind(this);\n this.handleKeyDown = this.handleKeyDown.bind(this);\n this.handleMouseOver = this.handleMouseOver.bind(this);\n this.handleMouseOut = this.handleMouseOut.bind(this);\n\n this.updateComplete.then(() => {\n this.addEventListener('blur', this.handleBlur, true);\n this.addEventListener('focus', this.handleFocus, true);\n this.addEventListener('click', this.handleClick);\n this.addEventListener('keydown', this.handleKeyDown);\n this.addEventListener('mouseover', this.handleMouseOver);\n this.addEventListener('mouseout', this.handleMouseOut);\n });\n }\n\n firstUpdated() {\n this.body.hidden = !this.open;\n\n // If the tooltip is visible on init, update its position\n if (this.open) {\n this.popup.active = true;\n this.popup.reposition();\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('blur', this.handleBlur, true);\n this.removeEventListener('focus', this.handleFocus, true);\n this.removeEventListener('click', this.handleClick);\n this.removeEventListener('keydown', this.handleKeyDown);\n this.removeEventListener('mouseover', this.handleMouseOver);\n this.removeEventListener('mouseout', this.handleMouseOut);\n }\n\n private handleBlur() {\n if (this.hasTrigger('focus')) {\n this.hide();\n }\n }\n\n private handleClick() {\n if (this.hasTrigger('click')) {\n if (this.open) {\n this.hide();\n } else {\n this.show();\n }\n }\n }\n\n private handleFocus() {\n if (this.hasTrigger('focus')) {\n this.show();\n }\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n // Pressing escape when the target element has focus should dismiss the tooltip\n if (this.open && event.key === 'Escape') {\n event.stopPropagation();\n this.hide();\n }\n }\n\n private handleMouseOver() {\n if (this.hasTrigger('hover')) {\n const delay = parseDuration(\n getComputedStyle(this).getPropertyValue('--show-delay')\n );\n clearTimeout(this.hoverTimeout);\n this.hoverTimeout = window.setTimeout(() => this.show(), delay);\n }\n }\n\n private handleMouseOut() {\n if (this.hasTrigger('hover')) {\n const delay = parseDuration(\n getComputedStyle(this).getPropertyValue('--hide-delay')\n );\n clearTimeout(this.hoverTimeout);\n this.hoverTimeout = window.setTimeout(() => this.hide(), delay);\n }\n }\n\n private hasTrigger(triggerType: string) {\n const triggers = this.trigger.split(' ');\n return triggers.includes(triggerType);\n }\n\n @watch('open', { waitUntilFirstUpdate: true })\n async handleOpenChange() {\n if (this.open) {\n if (this.disabled) {\n return;\n }\n\n // Show\n this.emit('nile-show');\n\n await stopAnimations(this.body);\n this.body.hidden = false;\n this.popup.active = true;\n const { keyframes, options } = getAnimation(this, 'tooltip.show', {\n dir: '',\n });\n await animateTo(this.popup.popup, keyframes, options);\n\n this.emit('nile-after-show');\n } else {\n // Hide\n this.emit('nile-hide');\n\n await stopAnimations(this.body);\n const { keyframes, options } = getAnimation(this, 'tooltip.hide', {\n dir: '',\n });\n await animateTo(this.popup.popup, keyframes, options);\n this.popup.active = false;\n this.body.hidden = true;\n\n this.emit('nile-after-hide');\n }\n }\n\n @watch(['content', 'distance', 'hoist', 'placement', 'skidding'])\n async handleOptionsChange() {\n if (this.hasUpdated) {\n await this.updateComplete;\n this.popup.reposition();\n }\n }\n\n @watch('disabled')\n handleDisabledChange() {\n if (this.disabled && this.open) {\n this.hide();\n }\n }\n\n /** Shows the tooltip. */\n async show() {\n if (this.open || !this.content?.trim().length) {\n return undefined;\n }\n\n this.open = true;\n return waitForEvent(this, 'nile-after-show');\n }\n\n /** Hides the tooltip */\n async hide() {\n if (!this.open) {\n return undefined;\n }\n\n this.open = false;\n return waitForEvent(this, 'nile-after-hide');\n }\n\n render() {\n return html`\n <nile-popup\n part=\"base\"\n exportparts=\"\n popup:base__popup,\n arrow:base__arrow\n \"\n class=${classMap({\n tooltip: true,\n 'tooltip--open': this.open,\n })}\n placement=${this.placement}\n distance=${this.distance}\n skidding=${this.skidding}\n strategy=${this.hoist ? 'fixed' : 'absolute'}\n flip\n shift\n arrow\n >\n <slot slot=\"anchor\" aria-describedby=\"tooltip\"></slot>\n\n <slot\n name=\"content\"\n part=\"body\"\n id=\"tooltip\"\n class=${classMap({\n tooltip__body: true,\n 'tooltip__body--large': this.size === 'large',\n })}\n role=\"tooltip\"\n aria-live=${this.open ? 'polite' : 'off'}\n >\n ${this.content}\n </slot>\n </nile-popup>\n `;\n }\n}\n\nsetDefaultAnimation('tooltip.show', {\n keyframes: [\n { opacity: 0, scale: 0.8 },\n { opacity: 1, scale: 1 },\n ],\n options: { duration: 150, easing: 'ease' },\n});\n\nsetDefaultAnimation('tooltip.hide', {\n keyframes: [\n { opacity: 1, scale: 1 },\n { opacity: 0, scale: 0.8 },\n ],\n options: { duration: 150, easing: 'ease' },\n});\n\nexport default NileTooltip;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-tooltip': NileTooltip;\n }\n}\n"],"names":["NileTooltip","f","constructor","this","content","size","placement","disabled","distance","open","skidding","trigger","hoist","_this","_inherits","_m","_createClass","key","value","connectedCallback","super","handleBlur","bind","handleClick","handleFocus","handleKeyDown","handleMouseOver","handleMouseOut","updateComplete","then","addEventListener","firstUpdated","body","hidden","popup","active","reposition","disconnectedCallback","removeEventListener","hasTrigger","hide","show","event","stopPropagation","delay","parseDuration","getComputedStyle","getPropertyValue","clearTimeout","hoverTimeout","window","setTimeout","_this4","triggerType","split","includes","_handleOpenChange","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_p","_t3","_i","_p2","_t4","_i2","wrap","_callee$","_context2","prev","next","emit","stopAnimations","getAnimation","dir","animateTo","keyframes","options","stop","handleOpenChange","_callee2","_callee2$","_context3","t0","hasUpdated","handleOptionsChange","handleDisabledChange","_show","_callee3","_this$content","_callee3$","_context4","trim","length","abrupt","waitForEvent","_callee4","_callee4$","_context5","render","html","_templateObject","_taggedTemplateLiteral","classMap","tooltip","tooltip__body","__decorate","get","styles","NileElement","query","prototype","property","type","String","reflect","Boolean","Number","watch","waitUntilFirstUpdate","customElement","setDefaultAnimation","opacity","scale","duration","easing"],"mappings":"i4YA+BaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,mCAiBsCC,EAAAA,KAAAA,CAAOC,OAAG,CAAA,EAAA,CAGxBD,KAAAA,CAAIE,IAAAA,CAAsB,QAM3CF,KAAAA,CAASG,SAAAA,CAYJ,KAG2BH,CAAAA,KAAAA,CAAQI,QAAG,CAAA,CAAA,CAAA,CAG3BJ,KAAAA,CAAQK,QAAG,CAAA,CAAA,CAGKL,KAAAA,CAAIM,IAAAA,CAAAA,CAAG,CAGvBN,CAAAA,KAAAA,CAAQO,SAAG,CAO3BP,CAAAA,KAAAA,CAAOQ,OAAG,CAAA,aAAA,CAOOR,KAAAA,CAAKS,KAAAA,CAAAA,CAAG,CA4MtC,QAAAC,KAAA,EAvQQC,SAAA,CAAAb,CAAA,CAAAc,EAAA,SAAAC,YAAA,CAAAf,CAAA,GAAAgB,GAAA,qBAAAC,KAAA,CA6DP,SAAAC,iBAAAA,CAAAA,CAAAA,KAAAA,MAAAA,MACEC,aAAAA,CAAAA,CAAAA,iCACAjB,IAAKkB,CAAAA,UAAAA,CAAalB,KAAKkB,UAAWC,CAAAA,IAAAA,CAAKn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,CAGDL,EAAA,CADCY,CAAAA,CAAM,UAKNvH,CAAAA,CAAAA,CAAAA,CAAAA,CAAAgH,SAAA,CAAA,sBAAA,CAAA,kBAhNUhH,CAAW2G,CAAAA,CAAAA,CAAA,CADvBc,CAAc,CAAA,cAAA,CAAA,CAAA,CACFzH,IA8Qb0H,CAAoB,CAAA,cAAA,CAAgB,CAClC7C,SAAW,CAAA,CACT,CAAE8C,OAAS,CAAA,CAAA,CAAGC,MAAO,EACrB,CAAA,CAAA,CAAED,QAAS,CAAGC,CAAAA,KAAAA,CAAO,CAEvB9C,CAAAA,CAAAA,CAAAA,OAAAA,CAAS,CAAE+C,QAAAA,CAAU,IAAKC,MAAQ,CAAA,MAAA,CAAA,CAAA,CAAA,CAGpCJ,EAAoB,cAAgB,CAAA,CAClC7C,UAAW,CACT,CAAE8C,QAAS,CAAGC,CAAAA,KAAAA,CAAO,GACrB,CAAED,OAAAA,CAAS,EAAGC,KAAO,CAAA,EAAA,CAAA,CAAA,CAEvB9C,QAAS,CAAE+C,QAAAA,CAAU,GAAKC,CAAAA,MAAAA,CAAQ"}
@@ -1,2 +1,2 @@
1
- System.register(["lit"],function(_export,_context){"use strict";var i,_templateObject,o;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){i=_lit.css;}],execute:function execute(){_export("s",o=i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n\n\n:host {\n position: relative;\n display: inline-block;\n }\n .tooltip {\n position: fixed;\n z-index: 1000;\n background-color: var(--nile-tooltip-color-background, #333);\n color: var(--nile-colors-white-base, #fff);\n padding: 6px 10px;\n border-radius: 4px;\n font-size: var(--nile-tooltip-font-size-sm, 14px);\n line-height: var(--nile-tooltip-line-height-sm, 1.5);\n opacity: 0;\n transition: opacity 0.2s, transform 0.2s;\n pointer-events: none;\n white-space: normal;\n visibility: hidden;\n overflow: visible;\n \n }\n :host([open]) .tooltip {\n opacity: 1;\n visibility: visible;\n pointer-events: auto;\n }\n .tooltip__body--large {\n font-size: var(--nile-tooltip-font-size-lg, 16px);\n line-height: var(--nile-tooltip-line-height-lg, 1.75);\n }\n .tooltip-content {\n overflow: auto;\n max-width: 252px;\n max-height: 116px;\n }\n .tooltip-caret {\n position: absolute;\n width: calc(2 * var(--caret-size, 6px));\n height: calc(2 * var(--caret-size, 6px));\n background-color: inherit;\n transform: rotate(45deg);\n z-index: -1;\n }\n .trigger-container {\n display: inline-block;\n }\n \n\n\n\n\n\n\n\n \n"]))));}};});
1
+ System.register(["lit"],function(_export,_context){"use strict";var o,_templateObject,t;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){o=_lit.css;}],execute:function execute(){_export("s",t=o(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n --max-width: 20rem;\n --hide-delay: 0ms;\n --show-delay: 150ms;\n\n display: contents;\n }\n\n .tooltip {\n --arrow-size: 6px;\n --arrow-color: var(--nile-tooltip-color-background);\n }\n\n .tooltip::part(popup) {\n pointer-events: none;\n z-index: 1000;\n }\n\n .tooltip[placement^='top']::part(popup) {\n transform-origin: bottom;\n }\n\n .tooltip[placement^='bottom']::part(popup) {\n transform-origin: top;\n }\n\n .tooltip[placement^='left']::part(popup) {\n transform-origin: right;\n }\n\n .tooltip[placement^='right']::part(popup) {\n transform-origin: left;\n }\n\n .tooltip__body {\n display: block;\n width: max-content;\n max-width: var(--max-width);\n border-radius: 4px;\n background-color: var(--nile-tooltip-color-background);\n font-size: var(--nile-tooltip-font-size-sm);\n font-weight: var(--nile-tooltip-font-weight-sm);\n line-height: var(--nile-tooltip-line-height-sm);\n padding: var(--nile-tooltip-padding-y) var(--nile-tooltip-padding-x);\n color: var(--nile-colors-white-base);\n pointer-events: none;\n word-break: break-word;\n }\n\n .tooltip__body--large {\n font-size: var(--nile-tooltip-font-size-lg);\n line-height: var(--nile-tooltip-line-height-lg);\n font-weight: var(--nile-tooltip-font-weight-lg);\n }\n"]))));}};});
2
2
  //# sourceMappingURL=nile-tooltip.css.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-tooltip.css.cjs.js","sources":["../../../src/nile-tooltip/nile-tooltip.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\n/**\n * Tooltip CSS\n */\nexport const styles = css`\n\n\n:host {\n position: relative;\n display: inline-block;\n }\n .tooltip {\n position: fixed;\n z-index: 1000;\n background-color: var(--nile-tooltip-color-background, #333);\n color: var(--nile-colors-white-base, #fff);\n padding: 6px 10px;\n border-radius: 4px;\n font-size: var(--nile-tooltip-font-size-sm, 14px);\n line-height: var(--nile-tooltip-line-height-sm, 1.5);\n opacity: 0;\n transition: opacity 0.2s, transform 0.2s;\n pointer-events: none;\n white-space: normal;\n visibility: hidden;\n overflow: visible;\n \n }\n :host([open]) .tooltip {\n opacity: 1;\n visibility: visible;\n pointer-events: auto;\n }\n .tooltip__body--large {\n font-size: var(--nile-tooltip-font-size-lg, 16px);\n line-height: var(--nile-tooltip-line-height-lg, 1.75);\n }\n .tooltip-content {\n overflow: auto;\n max-width: 252px;\n max-height: 116px;\n }\n .tooltip-caret {\n position: absolute;\n width: calc(2 * var(--caret-size, 6px));\n height: calc(2 * var(--caret-size, 6px));\n background-color: inherit;\n transform: rotate(45deg);\n z-index: -1;\n }\n .trigger-container {\n display: inline-block;\n }\n \n\n\n\n\n\n\n\n \n`;\n\nexport default [styles];"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
1
+ {"version":3,"file":"nile-tooltip.css.cjs.js","sources":["../../../src/nile-tooltip/nile-tooltip.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\n/**\n * Tooltip CSS\n */\nexport const styles = css`\n :host {\n --max-width: 20rem;\n --hide-delay: 0ms;\n --show-delay: 150ms;\n\n display: contents;\n }\n\n .tooltip {\n --arrow-size: 6px;\n --arrow-color: var(--nile-tooltip-color-background);\n }\n\n .tooltip::part(popup) {\n pointer-events: none;\n z-index: 1000;\n }\n\n .tooltip[placement^='top']::part(popup) {\n transform-origin: bottom;\n }\n\n .tooltip[placement^='bottom']::part(popup) {\n transform-origin: top;\n }\n\n .tooltip[placement^='left']::part(popup) {\n transform-origin: right;\n }\n\n .tooltip[placement^='right']::part(popup) {\n transform-origin: left;\n }\n\n .tooltip__body {\n display: block;\n width: max-content;\n max-width: var(--max-width);\n border-radius: 4px;\n background-color: var(--nile-tooltip-color-background);\n font-size: var(--nile-tooltip-font-size-sm);\n font-weight: var(--nile-tooltip-font-weight-sm);\n line-height: var(--nile-tooltip-line-height-sm);\n padding: var(--nile-tooltip-padding-y) var(--nile-tooltip-padding-x);\n color: var(--nile-colors-white-base);\n pointer-events: none;\n word-break: break-word;\n }\n\n .tooltip__body--large {\n font-size: var(--nile-tooltip-font-size-lg);\n line-height: var(--nile-tooltip-line-height-lg);\n font-weight: var(--nile-tooltip-font-weight-lg);\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
@@ -1,59 +1,56 @@
1
- import{css as i}from"lit";const o=i`
2
-
3
-
4
- :host {
5
- position: relative;
6
- display: inline-block;
7
- }
8
- .tooltip {
9
- position: fixed;
10
- z-index: 1000;
11
- background-color: var(--nile-tooltip-color-background, #333);
12
- color: var(--nile-colors-white-base, #fff);
13
- padding: 6px 10px;
14
- border-radius: 4px;
15
- font-size: var(--nile-tooltip-font-size-sm, 14px);
16
- line-height: var(--nile-tooltip-line-height-sm, 1.5);
17
- opacity: 0;
18
- transition: opacity 0.2s, transform 0.2s;
19
- pointer-events: none;
20
- white-space: normal;
21
- visibility: hidden;
22
- overflow: visible;
23
-
24
- }
25
- :host([open]) .tooltip {
26
- opacity: 1;
27
- visibility: visible;
28
- pointer-events: auto;
29
- }
30
- .tooltip__body--large {
31
- font-size: var(--nile-tooltip-font-size-lg, 16px);
32
- line-height: var(--nile-tooltip-line-height-lg, 1.75);
33
- }
34
- .tooltip-content {
35
- overflow: auto;
36
- max-width: 252px;
37
- max-height: 116px;
38
- }
39
- .tooltip-caret {
40
- position: absolute;
41
- width: calc(2 * var(--caret-size, 6px));
42
- height: calc(2 * var(--caret-size, 6px));
43
- background-color: inherit;
44
- transform: rotate(45deg);
45
- z-index: -1;
46
- }
47
- .trigger-container {
48
- display: inline-block;
49
- }
50
-
51
-
52
-
53
-
54
-
55
-
56
-
57
-
58
-
59
- `;export{o as s};
1
+ import{css as o}from"lit";const t=o`
2
+ :host {
3
+ --max-width: 20rem;
4
+ --hide-delay: 0ms;
5
+ --show-delay: 150ms;
6
+
7
+ display: contents;
8
+ }
9
+
10
+ .tooltip {
11
+ --arrow-size: 6px;
12
+ --arrow-color: var(--nile-tooltip-color-background);
13
+ }
14
+
15
+ .tooltip::part(popup) {
16
+ pointer-events: none;
17
+ z-index: 1000;
18
+ }
19
+
20
+ .tooltip[placement^='top']::part(popup) {
21
+ transform-origin: bottom;
22
+ }
23
+
24
+ .tooltip[placement^='bottom']::part(popup) {
25
+ transform-origin: top;
26
+ }
27
+
28
+ .tooltip[placement^='left']::part(popup) {
29
+ transform-origin: right;
30
+ }
31
+
32
+ .tooltip[placement^='right']::part(popup) {
33
+ transform-origin: left;
34
+ }
35
+
36
+ .tooltip__body {
37
+ display: block;
38
+ width: max-content;
39
+ max-width: var(--max-width);
40
+ border-radius: 4px;
41
+ background-color: var(--nile-tooltip-color-background);
42
+ font-size: var(--nile-tooltip-font-size-sm);
43
+ font-weight: var(--nile-tooltip-font-weight-sm);
44
+ line-height: var(--nile-tooltip-line-height-sm);
45
+ padding: var(--nile-tooltip-padding-y) var(--nile-tooltip-padding-x);
46
+ color: var(--nile-colors-white-base);
47
+ pointer-events: none;
48
+ word-break: break-word;
49
+ }
50
+
51
+ .tooltip__body--large {
52
+ font-size: var(--nile-tooltip-font-size-lg);
53
+ line-height: var(--nile-tooltip-line-height-lg);
54
+ font-weight: var(--nile-tooltip-font-weight-lg);
55
+ }
56
+ `;export{t as s};
@@ -1,25 +1,30 @@
1
- import{__decorate as t}from"tslib";import{html as i}from"lit";import{property as s,query as o,customElement as e}from"lit/decorators.js";import{classMap as h}from"lit/directives/class-map.js";import{s as l}from"./nile-tooltip.css.esm.js";import{N as r}from"../internal/nile-element.esm.js";import{i as n,g as a,a as c}from"./nile-tooltip-utils.esm.js";let d=class extends r{constructor(){super(...arguments),this.content="",this.size="small",this.placement="bottom",this.disabled=!1,this.open=!1,this.trigger="hover focus",this.distance=8,this.SHIFT_OFFSET=16,this.skidding=0,this.hoist=!1,this.hasTooltipSlot=!1,this.hoverTimeout=0,this.caretSize=6,this.originalPlacement=this.placement,this.updateTooltipPosition=()=>{if(!n(this.triggerContainer))return void(this.open=!1);const t=this.triggerContainer.getBoundingClientRect(),i=this.tooltip.getBoundingClientRect(),s=window.innerWidth,o=window.innerHeight,{top:e,left:h,placement:l}=a(t,i,this.originalPlacement,this.distance,this.skidding,this.caretSize,s,o);this.setAttribute("placement",l),this.tooltip.style.top=`${e}px`,this.tooltip.style.left=`${h}px`;const{caretLeft:r,caretTop:d}=c({placement:l,tooltipRect:i,triggerRect:t,caretSize:this.caretSize,left:h,top:e});this.caret.style.left=`${r}px`,this.caret.style.top=`${d}px`},this.showTooltip=()=>{(this.content.trim()||this.hasTooltipSlot)&&(!this.disabled&&n(this.triggerContainer)?(this.emit("nile-show"),this.open=!0,this.updateComplete.then((()=>{this.updateTooltipPosition(),this.emit("nile-after-show")}))):this.open=!1)},this.hideTooltip=()=>{this.emit("nile-hide"),this.open=!1,setTimeout((()=>{this.emit("nile-after-hide")}),200)},this.handleMouseOver=()=>{this.trigger.includes("hover")&&(clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.showTooltip()),150))},this.handleMouseOut=()=>{this.trigger.includes("hover")&&(clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.hideTooltip()),0))},this.handleClick=()=>{this.trigger.includes("click")&&(!this.open&&n(this.triggerContainer)?this.showTooltip():this.hideTooltip())},this.handleFocus=()=>{this.trigger.includes("focus")&&this.showTooltip()},this.handleBlur=()=>{this.trigger.includes("focus")&&this.hideTooltip()}}static get styles(){return[l]}connectedCallback(){super.connectedCallback(),this.originalPlacement=this.placement,window.addEventListener("resize",this.updateTooltipPosition),window.addEventListener("scroll",this.updateTooltipPosition,!0)}updated(t){super.updated?.(t);const i=["top","top-start","top-end","right","right-start","right-end","bottom","bottom-start","bottom-end","left","left-start","left-end"];i.includes(this.placement)||(console.warn(`[nile-tooltip] Invalid placement "${this.placement}", defaulting to "bottom".`),this.placement="bottom"),i.includes(this.originalPlacement)||(this.originalPlacement="bottom")}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this.updateTooltipPosition),window.removeEventListener("scroll",this.updateTooltipPosition,!0)}handleTooltipSlotChange(){const t=this.tooltipSlot.assignedNodes({flatten:!0});this.hasTooltipSlot=t.length>0,this.requestUpdate()}render(){return i`
2
- <div
3
- class=${h({tooltip:!0,"tooltip__body--large":"large"===this.size})}
4
- id="tooltip"
1
+ import{__decorate as t}from"tslib";import{s as i}from"./nile-tooltip.css.esm.js";import"../nile-popup/nile-popup.esm.js";import{p as s,s as e,a as o}from"../internal/animate.esm.js";import{classMap as h}from"lit/directives/class-map.js";import{query as a,property as l,customElement as n}from"lit/decorators.js";import{s as r,g as p}from"../utilities/animation-registry.esm.js";import{html as d}from"lit";import{w as c}from"../internal/event.esm.js";import{w as m}from"../internal/watch.esm.js";import{N as u}from"../internal/nile-element.esm.js";import"../nile-popup/nile-popup.css.esm.js";let f=class extends u{constructor(){super(...arguments),this.content="",this.size="small",this.placement="top",this.disabled=!1,this.distance=8,this.open=!1,this.skidding=0,this.trigger="hover focus",this.hoist=!1}static get styles(){return[i]}connectedCallback(){super.connectedCallback(),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseOver=this.handleMouseOver.bind(this),this.handleMouseOut=this.handleMouseOut.bind(this),this.updateComplete.then((()=>{this.addEventListener("blur",this.handleBlur,!0),this.addEventListener("focus",this.handleFocus,!0),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("mouseover",this.handleMouseOver),this.addEventListener("mouseout",this.handleMouseOut)}))}firstUpdated(){this.body.hidden=!this.open,this.open&&(this.popup.active=!0,this.popup.reposition())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("blur",this.handleBlur,!0),this.removeEventListener("focus",this.handleFocus,!0),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("mouseover",this.handleMouseOver),this.removeEventListener("mouseout",this.handleMouseOut)}handleBlur(){this.hasTrigger("focus")&&this.hide()}handleClick(){this.hasTrigger("click")&&(this.open?this.hide():this.show())}handleFocus(){this.hasTrigger("focus")&&this.show()}handleKeyDown(t){this.open&&"Escape"===t.key&&(t.stopPropagation(),this.hide())}handleMouseOver(){if(this.hasTrigger("hover")){const t=s(getComputedStyle(this).getPropertyValue("--show-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.show()),t)}}handleMouseOut(){if(this.hasTrigger("hover")){const t=s(getComputedStyle(this).getPropertyValue("--hide-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.hide()),t)}}hasTrigger(t){return this.trigger.split(" ").includes(t)}async handleOpenChange(){if(this.open){if(this.disabled)return;this.emit("nile-show"),await e(this.body),this.body.hidden=!1,this.popup.active=!0;const{keyframes:t,options:i}=p(this,"tooltip.show",{dir:""});await o(this.popup.popup,t,i),this.emit("nile-after-show")}else{this.emit("nile-hide"),await e(this.body);const{keyframes:t,options:i}=p(this,"tooltip.hide",{dir:""});await o(this.popup.popup,t,i),this.popup.active=!1,this.body.hidden=!0,this.emit("nile-after-hide")}}async handleOptionsChange(){this.hasUpdated&&(await this.updateComplete,this.popup.reposition())}handleDisabledChange(){this.disabled&&this.open&&this.hide()}async show(){if(!this.open&&this.content?.trim().length)return this.open=!0,c(this,"nile-after-show")}async hide(){if(this.open)return this.open=!1,c(this,"nile-after-hide")}render(){return d`
2
+ <nile-popup
3
+ part="base"
4
+ exportparts="
5
+ popup:base__popup,
6
+ arrow:base__arrow
7
+ "
8
+ class=${h({tooltip:!0,"tooltip--open":this.open})}
9
+ placement=${this.placement}
10
+ distance=${this.distance}
11
+ skidding=${this.skidding}
12
+ strategy=${this.hoist?"fixed":"absolute"}
13
+ flip
14
+ shift
15
+ arrow
5
16
  >
6
- <div class="tooltip-content" part="content">
7
- <slot name="content" @slotchange=${this.handleTooltipSlotChange}></slot>
8
- ${this.hasTooltipSlot?null:i`${this.content}`}
9
- </div>
10
- <div class="tooltip-caret" style="--caret-size: ${this.caretSize}px;"></div>
11
- </div>
17
+ <slot slot="anchor" aria-describedby="tooltip"></slot>
12
18
 
13
- <div
14
- class="trigger-container"
15
- tabindex="0"
16
- @mouseover=${this.handleMouseOver}
17
- @mouseout=${this.handleMouseOut}
18
- @click=${this.handleClick}
19
- @focusin=${this.handleFocus}
20
- @focusout=${this.handleBlur}
21
- aria-describedby="tooltip"
22
- >
23
- <slot></slot>
24
- </div>
25
- `}};t([s({type:String})],d.prototype,"content",void 0),t([s({reflect:!0})],d.prototype,"size",void 0),t([s({type:String})],d.prototype,"placement",void 0),t([s({type:Boolean,reflect:!0})],d.prototype,"disabled",void 0),t([s({type:Boolean,reflect:!0})],d.prototype,"open",void 0),t([s()],d.prototype,"trigger",void 0),t([s({type:Number})],d.prototype,"distance",void 0),t([s({type:Number})],d.prototype,"skidding",void 0),t([s({type:Boolean,reflect:!0})],d.prototype,"hoist",void 0),t([o(".tooltip")],d.prototype,"tooltip",void 0),t([o(".trigger-container")],d.prototype,"triggerContainer",void 0),t([o(".tooltip-caret")],d.prototype,"caret",void 0),t([o('slot[name="content"]')],d.prototype,"tooltipSlot",void 0),d=t([e("nile-tooltip")],d);export{d as N};
19
+ <slot
20
+ name="content"
21
+ part="body"
22
+ id="tooltip"
23
+ class=${h({tooltip__body:!0,"tooltip__body--large":"large"===this.size})}
24
+ role="tooltip"
25
+ aria-live=${this.open?"polite":"off"}
26
+ >
27
+ ${this.content}
28
+ </slot>
29
+ </nile-popup>
30
+ `}};t([a("slot:not([name])")],f.prototype,"defaultSlot",void 0),t([a(".tooltip__body")],f.prototype,"body",void 0),t([a("nile-popup")],f.prototype,"popup",void 0),t([l({type:String,reflect:!0})],f.prototype,"content",void 0),t([l({reflect:!0})],f.prototype,"size",void 0),t([l()],f.prototype,"placement",void 0),t([l({type:Boolean,reflect:!0})],f.prototype,"disabled",void 0),t([l({type:Number})],f.prototype,"distance",void 0),t([l({type:Boolean,reflect:!0})],f.prototype,"open",void 0),t([l({type:Number})],f.prototype,"skidding",void 0),t([l()],f.prototype,"trigger",void 0),t([l({type:Boolean})],f.prototype,"hoist",void 0),t([m("open",{waitUntilFirstUpdate:!0})],f.prototype,"handleOpenChange",null),t([m(["content","distance","hoist","placement","skidding"])],f.prototype,"handleOptionsChange",null),t([m("disabled")],f.prototype,"handleDisabledChange",null),f=t([n("nile-tooltip")],f),r("tooltip.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:150,easing:"ease"}}),r("tooltip.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:150,easing:"ease"}});export{f as N};
@@ -13,14 +13,6 @@ export const styles = css `
13
13
  display: block;
14
14
  }
15
15
 
16
- /* To Hide Safari's AutoFill icon */
17
- input::-webkit-contacts-auto-fill-button {
18
- visibility: hidden;
19
- width: 0;
20
- margin: 0;
21
- padding: 0;
22
- }
23
-
24
16
  .form-control .form-control__label {
25
17
  display: none;
26
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"nile-input.css.js","sourceRoot":"","sources":["../../../src/nile-input/nile-input.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyfxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\n/**\n * Input CSS\n */\nexport const styles = css`\n :host {\n display: block;\n }\n\n /* To Hide Safari's AutoFill icon */\n input::-webkit-contacts-auto-fill-button {\n visibility: hidden;\n width: 0;\n margin: 0;\n padding: 0;\n }\n\n .form-control .form-control__label {\n display: none;\n }\n\n .form-control .form-control__help-text {\n display: none;\n }\n\n /* Label */\n .form-control--has-label .form-control__label {\n display: inline-block;\n color: inherit;\n margin-bottom: 6px;\n color: var(--nile-colors-dark-900);\n font-family: var(--nile-font-family-serif);\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: 20px;\n letter-spacing: 0.2px;\n }\n\n .form-control--has-label.form-control--medium .form-control__label {\n font-size: 14px;\n }\n\n :host([required]) .form-control--has-label .form-control__label::after {\n content: '*';\n margin-inline-start: -2px;\n color: var(--nile-colors-red-700);\n }\n\n /* Help text */\n .form-control--has-help-text .form-control__help-text {\n display: block;\n color: var(--nile-colors-dark-500);\n margin-top: 6px;\n }\n\n /* Error message */\n .form-control__error-message {\n display: block;\n color: var(--nile-colors-red-700);\n margin-top: 12px;\n font-size: 12px;\n font-style: normal;\n line-height: 12px;\n letter-spacing: 0.2px;\n }\n\n .form-control--has-help-text.form-control--medium .form-control__help-text {\n font-size: 10.24px;\n }\n\n .form-control--has-help-text.form-control--radio-group\n .form-control__help-text {\n margin-top: 0.25rem;\n }\n\n .input {\n flex: 1 1 auto;\n display: inline-flex;\n align-items: stretch;\n justify-content: start;\n position: relative;\n width: 100%;\n font-weight: 400;\n vertical-align: middle;\n overflow: hidden;\n cursor: text;\n transition: 150ms color, 150ms border, 150ms box-shadow,\n 150ms background-color;\n box-sizing: border-box;\n color: var(--nile-colors-dark-900);\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n /* Standard inputs */\n .input--standard {\n background-color: var(--nile-input-standard-background-color);\n border: solid 1px var(--nile-input-standard-border-color);\n box-shadow: var(--nile-input-shadow-standard);\n }\n\n .input--standard:hover:not(.input--disabled) {\n background-color: hsl(0, 0%, 100%);\n border-color: var(--nile-colors-dark-900);\n }\n\n .input--standard.input--focused:not(.input--disabled) {\n background-color: hsl(0, 0%, 100%);\n border-color: var(--nile-colors-primary-500);\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled);\n }\n\n .input--standard.input--focused:not(.input--disabled) .input__control {\n color: hsl(240 5.3% 26.1%);\n }\n\n .input--standard.input--disabled {\n background-color: var(--nile-colors-white-base);\n border-color: var(--nile-colors-neutral-500);\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .input--standard.input--disabled .input__control {\n color: hsl(240 5.9% 10%);\n }\n\n .input--standard.input--disabled .input__control::placeholder {\n color: var(--nile-input-standard-disabled-placeholder-font-color);\n }\n\n .input--standard.input--warning {\n border-color: var(--nile-colors-yellow-500);\n }\n\n .input--standard.input--error {\n border-color: var(--nile-colors-red-500);\n }\n\n .input--standard.input--success {\n border-color: var(--nile-colors-green-500);\n }\n\n .input--standard.input--destructive {\n border-color: var(--nile-colors-red-400);\n }\n\n .input--standard.input--focused.input--destructive:not(.input--disabled) {\n border: 1px solid var(--nile-colors-red-400);\n box-shadow: var(--nile-input-shadow-destructive-active);\n }\n\n .input--destructive:active {\n border: 1px solid var(--nile-colors-red-400);\n box-shadow: var(--nile-input-shadow-destructive-active);\n }\n\n /* Filled inputs */\n .input--filled {\n border: none;\n background-color: var(--nile-colors-dark-100);\n color: hsl(240 5.3% 26.1%);\n }\n\n .input--filled:hover:not(.input--disabled) {\n background-color: var(--nile-colors-dark-100);\n }\n\n .input--filled.input--focused:not(.input--disabled) {\n background-color: var(--nile-colors-dark-100);\n outline: solid 3px hsl(200.4 98% 39.4%);\n outline-offset: 1px;\n }\n\n .input--filled.input--disabled {\n background-color: var(--nile-colors-dark-100);\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .input__control {\n flex: 1 1 auto;\n min-width: 0;\n height: 100%;\n border: none;\n background: none;\n box-shadow: none;\n padding: 0;\n margin: 0;\n cursor: inherit;\n -webkit-appearance: none;\n color: var(--nile-colors-dark-900);\n font-family: var(--nile-font-family-sans-serif);\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 16px;\n letter-spacing: 0.2px;\n }\n\n .input__control::-webkit-search-decoration,\n .input__control::-webkit-search-cancel-button,\n .input__control::-webkit-search-results-button,\n .input__control::-webkit-search-results-decoration {\n -webkit-appearance: none;\n }\n\n .input__control:-webkit-autofill {\n box-shadow: 0 0 0 3.125rem hsl(0, 0%, 100%) inset !important;\n /* -webkit-text-fill-color: hsl(198.6 88.7% 48.4%); */\n caret-color: hsl(240 5.3% 26.1%);\n }\n\n .input__control:-webkit-autofill:hover {\n box-shadow: 0 0 0 3.125rem hsl(0, 0%, 100%) inset !important;\n /* -webkit-text-fill-color: hsl(198.6 88.7% 48.4%); */\n caret-color: hsl(240 5.3% 26.1%);\n }\n\n .input__control:-webkit-autofill:focus {\n box-shadow: 0 0 0 3.125rem hsl(0, 0%, 100%) inset !important;\n /* -webkit-text-fill-color: hsl(198.6 88.7% 48.4%); */\n caret-color: hsl(240 5.3% 26.1%);\n }\n\n .input__control:-webkit-autofill:active {\n box-shadow: 0 0 0 3.125rem hsl(0, 0%, 100%) inset !important;\n /* -webkit-text-fill-color: hsl(198.6 88.7% 48.4%); */\n caret-color: hsl(240 5.3% 26.1%);\n }\n\n .input--filled .input__control:-webkit-autofill {\n box-shadow: 0 0 0 3.125rem var(--nile-colors-dark-100) inset !important;\n }\n\n .input--filled .input__control:-webkit-autofill:hover {\n box-shadow: 0 0 0 3.125rem var(--nile-colors-dark-100) inset !important;\n }\n\n .input--filled .input__control:-webkit-autofill:focus {\n box-shadow: 0 0 0 3.125rem var(--nile-colors-dark-100) inset !important;\n }\n\n .input--filled .input__control:-webkit-autofill:active {\n box-shadow: 0 0 0 3.125rem var(--nile-colors-dark-100) inset !important;\n }\n\n .input__control::placeholder {\n color: var(--nile-colors-neutral-700);\n user-select: none;\n }\n\n .input:hover:not(.input--disabled) .input__control {\n color: var(--nile-colors-dark-900);\n }\n\n .input__control:focus {\n outline: none;\n }\n\n .input__prefix,\n .input__suffix {\n display: inline-flex;\n flex: 0 0 auto;\n align-items: center;\n cursor: default;\n }\n\n .input__prefix::slotted(nile-icon) {\n color: hsl(240 3.8% 46.1%);\n }\n\n .input__suffix::slotted(nile-icon) {\n color: hsl(240 3.8% 46.1%);\n }\n\n .input--standard:focus {\n border-radius: 4px;\n border: 1px solid var(--nile-colors-primary-500);\n box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);\n }\n\n /*\n * Size modifiers\n */\n\n .input--small {\n border-radius: 0.25rem;\n font-size: var(--nile-input-font-size-small);\n height: 1.875rem;\n }\n\n .input--small .input__control {\n height: calc(1.875rem);\n padding: 0 0.75rem;\n }\n\n .input--small .input__clear {\n width: calc(1em + 0.75rem * 2);\n }\n\n .input--small .input__password-toggle {\n width: calc(1em + 0.75rem * 2);\n }\n\n .input--small .input__prefix::slotted(*) {\n margin-inline-start: 0.75rem;\n }\n\n .input--small .input__suffix::slotted(*) {\n margin-inline-end: 0.75rem;\n }\n\n .input--medium {\n border-radius: 0.25rem;\n font-size: var(--nile-input-font-size-medium);\n height: 40px;\n }\n\n .input--medium .input__control {\n height: 14px;\n padding: 12px;\n }\n\n .input--medium .input__clear {\n width: calc(1em + 1rem * 2);\n }\n\n .input--medium .input__password-toggle {\n width: calc(1em + 1rem * 2);\n }\n\n .input--medium .input__prefix::slotted(*) {\n margin-inline-start: 12px;\n }\n\n .input--medium .input__suffix::slotted(*) {\n margin-inline-end: 12px;\n }\n\n .input--large {\n border-radius: 0.25rem;\n font-size: 1.25rem;\n height: 3.125rem;\n }\n\n .input--large .input__control {\n height: calc(3.125rem - 1px * 2);\n padding: 0 1.25rem;\n }\n\n .input--large .input__clear {\n width: calc(1em + 1.25rem * 2);\n }\n\n .input--large .input__password-toggle {\n width: calc(1em + 1.25rem * 2);\n }\n\n .input--large .input__prefix::slotted(*) {\n margin-inline-start: 1.25rem;\n }\n\n .input--large .input__suffix::slotted(*) {\n margin-inline-end: 1.25rem;\n }\n\n /*\n * Pill modifier\n */\n\n .input--pill.input--small {\n border-radius: 1.875rem;\n }\n\n .input--pill.input--medium {\n border-radius: 2.5rem;\n }\n\n .input--pill.input--large {\n border-radius: 3.125rem;\n }\n\n /*\n * Clearable + Password Toggle\n */\n\n .input__clear {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: inherit;\n color: hsl(240 3.8% 46.1%);\n border: none;\n background: none;\n padding: 0;\n transition: 150ms color;\n cursor: pointer;\n }\n\n .input__password-toggle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: inherit;\n color: hsl(240 3.8% 46.1%);\n border: none;\n background: none;\n padding: 0;\n transition: 150ms color;\n cursor: pointer;\n }\n\n .input__clear:hover {\n color: hsl(240 5.2% 33.9%);\n }\n\n .input__password-toggle:hover {\n color: hsl(240 5.2% 33.9%);\n }\n\n .input__clear:focus,\n .input__password-toggle:focus {\n outline: none;\n }\n\n .input--empty .input__clear {\n visibility: hidden;\n }\n\n /* Don't show the browser's password toggle in Edge */\n ::-ms-reveal {\n display: none;\n }\n\n /* Hide the built-in number spinner */\n .input--no-spin-buttons input[type='number']::-webkit-outer-spin-button,\n .input--no-spin-buttons input[type='number']::-webkit-inner-spin-button {\n -webkit-appearance: none;\n display: none;\n }\n\n .input--no-spin-buttons input[type='number'] {\n -moz-appearance: textfield;\n }\n\n :host([no-border]) .input--standard {\n border: none;\n box-shadow: 0 0 0 0;\n }\n\n :host([no-border]) .input--standard:hover:not(.input--disabled) {\n border: none;\n box-shadow: 0 0 0 0;\n }\n\n :host([no-border]) .input--standard.input--focused:not(.input--disabled) {\n border: none;\n box-shadow: 0 0 0 0;\n }\n\n :host([no-border]) .input--standard.input--focused:not(.input--disabled) {\n border: none;\n box-shadow: 0 0 0 0;\n }\n\n .input__password {\n font-family: 'disc';\n letter-spacing: 2px;\n }\n\n .input__non-printable {\n border-radius: 4px;\n max-width: 400px;\n background-color: var(--nile-colors-white-base);\n border: 1px solid var(--nile-colors-red-500);\n color: var(--nile-colors-red-500);\n padding: 10px;\n font-size: 12px;\n max-height: 300px;\n overflow-y: scroll;\n line-height: 16px;\n }\n\n .input__remove-non-printable {\n color: var(--nile-colors-red-500);\n margin-left: 10px;\n font-size: 14px;\n color: var(--nile-colors-dark-900);\n cursor: pointer;\n }\n\n .input__srtiked-text-container {\n margin-top: 4px;\n color: var(--nile-colors-dark-900);\n word-break: break-all;\n line-height: 16px;\n }\n\n .input__srtiked-text {\n text-decoration: line-through;\n text-decoration-color: var(--nile-colors-white-base);\n color: var(--nile-colors-white-base);\n background-color: var(--nile-colors-red-500);\n }\n`;\n\nexport default [styles];\n"]}
1
+ {"version":3,"file":"nile-input.css.js","sourceRoot":"","sources":["../../../src/nile-input/nile-input.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAifxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\n/**\n * Input CSS\n */\nexport const styles = css`\n :host {\n display: block;\n }\n\n .form-control .form-control__label {\n display: none;\n }\n\n .form-control .form-control__help-text {\n display: none;\n }\n\n /* Label */\n .form-control--has-label .form-control__label {\n display: inline-block;\n color: inherit;\n margin-bottom: 6px;\n color: var(--nile-colors-dark-900);\n font-family: var(--nile-font-family-serif);\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: 20px;\n letter-spacing: 0.2px;\n }\n\n .form-control--has-label.form-control--medium .form-control__label {\n font-size: 14px;\n }\n\n :host([required]) .form-control--has-label .form-control__label::after {\n content: '*';\n margin-inline-start: -2px;\n color: var(--nile-colors-red-700);\n }\n\n /* Help text */\n .form-control--has-help-text .form-control__help-text {\n display: block;\n color: var(--nile-colors-dark-500);\n margin-top: 6px;\n }\n\n /* Error message */\n .form-control__error-message {\n display: block;\n color: var(--nile-colors-red-700);\n margin-top: 12px;\n font-size: 12px;\n font-style: normal;\n line-height: 12px;\n letter-spacing: 0.2px;\n }\n\n .form-control--has-help-text.form-control--medium .form-control__help-text {\n font-size: 10.24px;\n }\n\n .form-control--has-help-text.form-control--radio-group\n .form-control__help-text {\n margin-top: 0.25rem;\n }\n\n .input {\n flex: 1 1 auto;\n display: inline-flex;\n align-items: stretch;\n justify-content: start;\n position: relative;\n width: 100%;\n font-weight: 400;\n vertical-align: middle;\n overflow: hidden;\n cursor: text;\n transition: 150ms color, 150ms border, 150ms box-shadow,\n 150ms background-color;\n box-sizing: border-box;\n color: var(--nile-colors-dark-900);\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n /* Standard inputs */\n .input--standard {\n background-color: var(--nile-input-standard-background-color);\n border: solid 1px var(--nile-input-standard-border-color);\n box-shadow: var(--nile-input-shadow-standard);\n }\n\n .input--standard:hover:not(.input--disabled) {\n background-color: hsl(0, 0%, 100%);\n border-color: var(--nile-colors-dark-900);\n }\n\n .input--standard.input--focused:not(.input--disabled) {\n background-color: hsl(0, 0%, 100%);\n border-color: var(--nile-colors-primary-500);\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled);\n }\n\n .input--standard.input--focused:not(.input--disabled) .input__control {\n color: hsl(240 5.3% 26.1%);\n }\n\n .input--standard.input--disabled {\n background-color: var(--nile-colors-white-base);\n border-color: var(--nile-colors-neutral-500);\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .input--standard.input--disabled .input__control {\n color: hsl(240 5.9% 10%);\n }\n\n .input--standard.input--disabled .input__control::placeholder {\n color: var(--nile-input-standard-disabled-placeholder-font-color);\n }\n\n .input--standard.input--warning {\n border-color: var(--nile-colors-yellow-500);\n }\n\n .input--standard.input--error {\n border-color: var(--nile-colors-red-500);\n }\n\n .input--standard.input--success {\n border-color: var(--nile-colors-green-500);\n }\n\n .input--standard.input--destructive {\n border-color: var(--nile-colors-red-400);\n }\n\n .input--standard.input--focused.input--destructive:not(.input--disabled) {\n border: 1px solid var(--nile-colors-red-400);\n box-shadow: var(--nile-input-shadow-destructive-active);\n }\n\n .input--destructive:active {\n border: 1px solid var(--nile-colors-red-400);\n box-shadow: var(--nile-input-shadow-destructive-active);\n }\n\n /* Filled inputs */\n .input--filled {\n border: none;\n background-color: var(--nile-colors-dark-100);\n color: hsl(240 5.3% 26.1%);\n }\n\n .input--filled:hover:not(.input--disabled) {\n background-color: var(--nile-colors-dark-100);\n }\n\n .input--filled.input--focused:not(.input--disabled) {\n background-color: var(--nile-colors-dark-100);\n outline: solid 3px hsl(200.4 98% 39.4%);\n outline-offset: 1px;\n }\n\n .input--filled.input--disabled {\n background-color: var(--nile-colors-dark-100);\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .input__control {\n flex: 1 1 auto;\n min-width: 0;\n height: 100%;\n border: none;\n background: none;\n box-shadow: none;\n padding: 0;\n margin: 0;\n cursor: inherit;\n -webkit-appearance: none;\n color: var(--nile-colors-dark-900);\n font-family: var(--nile-font-family-sans-serif);\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 16px;\n letter-spacing: 0.2px;\n }\n\n .input__control::-webkit-search-decoration,\n .input__control::-webkit-search-cancel-button,\n .input__control::-webkit-search-results-button,\n .input__control::-webkit-search-results-decoration {\n -webkit-appearance: none;\n }\n\n .input__control:-webkit-autofill {\n box-shadow: 0 0 0 3.125rem hsl(0, 0%, 100%) inset !important;\n /* -webkit-text-fill-color: hsl(198.6 88.7% 48.4%); */\n caret-color: hsl(240 5.3% 26.1%);\n }\n\n .input__control:-webkit-autofill:hover {\n box-shadow: 0 0 0 3.125rem hsl(0, 0%, 100%) inset !important;\n /* -webkit-text-fill-color: hsl(198.6 88.7% 48.4%); */\n caret-color: hsl(240 5.3% 26.1%);\n }\n\n .input__control:-webkit-autofill:focus {\n box-shadow: 0 0 0 3.125rem hsl(0, 0%, 100%) inset !important;\n /* -webkit-text-fill-color: hsl(198.6 88.7% 48.4%); */\n caret-color: hsl(240 5.3% 26.1%);\n }\n\n .input__control:-webkit-autofill:active {\n box-shadow: 0 0 0 3.125rem hsl(0, 0%, 100%) inset !important;\n /* -webkit-text-fill-color: hsl(198.6 88.7% 48.4%); */\n caret-color: hsl(240 5.3% 26.1%);\n }\n\n .input--filled .input__control:-webkit-autofill {\n box-shadow: 0 0 0 3.125rem var(--nile-colors-dark-100) inset !important;\n }\n\n .input--filled .input__control:-webkit-autofill:hover {\n box-shadow: 0 0 0 3.125rem var(--nile-colors-dark-100) inset !important;\n }\n\n .input--filled .input__control:-webkit-autofill:focus {\n box-shadow: 0 0 0 3.125rem var(--nile-colors-dark-100) inset !important;\n }\n\n .input--filled .input__control:-webkit-autofill:active {\n box-shadow: 0 0 0 3.125rem var(--nile-colors-dark-100) inset !important;\n }\n\n .input__control::placeholder {\n color: var(--nile-colors-neutral-700);\n user-select: none;\n }\n\n .input:hover:not(.input--disabled) .input__control {\n color: var(--nile-colors-dark-900);\n }\n\n .input__control:focus {\n outline: none;\n }\n\n .input__prefix,\n .input__suffix {\n display: inline-flex;\n flex: 0 0 auto;\n align-items: center;\n cursor: default;\n }\n\n .input__prefix::slotted(nile-icon) {\n color: hsl(240 3.8% 46.1%);\n }\n\n .input__suffix::slotted(nile-icon) {\n color: hsl(240 3.8% 46.1%);\n }\n\n .input--standard:focus {\n border-radius: 4px;\n border: 1px solid var(--nile-colors-primary-500);\n box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);\n }\n\n /*\n * Size modifiers\n */\n\n .input--small {\n border-radius: 0.25rem;\n font-size: var(--nile-input-font-size-small);\n height: 1.875rem;\n }\n\n .input--small .input__control {\n height: calc(1.875rem);\n padding: 0 0.75rem;\n }\n\n .input--small .input__clear {\n width: calc(1em + 0.75rem * 2);\n }\n\n .input--small .input__password-toggle {\n width: calc(1em + 0.75rem * 2);\n }\n\n .input--small .input__prefix::slotted(*) {\n margin-inline-start: 0.75rem;\n }\n\n .input--small .input__suffix::slotted(*) {\n margin-inline-end: 0.75rem;\n }\n\n .input--medium {\n border-radius: 0.25rem;\n font-size: var(--nile-input-font-size-medium);\n height: 40px;\n }\n\n .input--medium .input__control {\n height: 14px;\n padding: 12px;\n }\n\n .input--medium .input__clear {\n width: calc(1em + 1rem * 2);\n }\n\n .input--medium .input__password-toggle {\n width: calc(1em + 1rem * 2);\n }\n\n .input--medium .input__prefix::slotted(*) {\n margin-inline-start: 12px;\n }\n\n .input--medium .input__suffix::slotted(*) {\n margin-inline-end: 12px;\n }\n\n .input--large {\n border-radius: 0.25rem;\n font-size: 1.25rem;\n height: 3.125rem;\n }\n\n .input--large .input__control {\n height: calc(3.125rem - 1px * 2);\n padding: 0 1.25rem;\n }\n\n .input--large .input__clear {\n width: calc(1em + 1.25rem * 2);\n }\n\n .input--large .input__password-toggle {\n width: calc(1em + 1.25rem * 2);\n }\n\n .input--large .input__prefix::slotted(*) {\n margin-inline-start: 1.25rem;\n }\n\n .input--large .input__suffix::slotted(*) {\n margin-inline-end: 1.25rem;\n }\n\n /*\n * Pill modifier\n */\n\n .input--pill.input--small {\n border-radius: 1.875rem;\n }\n\n .input--pill.input--medium {\n border-radius: 2.5rem;\n }\n\n .input--pill.input--large {\n border-radius: 3.125rem;\n }\n\n /*\n * Clearable + Password Toggle\n */\n\n .input__clear {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: inherit;\n color: hsl(240 3.8% 46.1%);\n border: none;\n background: none;\n padding: 0;\n transition: 150ms color;\n cursor: pointer;\n }\n\n .input__password-toggle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: inherit;\n color: hsl(240 3.8% 46.1%);\n border: none;\n background: none;\n padding: 0;\n transition: 150ms color;\n cursor: pointer;\n }\n\n .input__clear:hover {\n color: hsl(240 5.2% 33.9%);\n }\n\n .input__password-toggle:hover {\n color: hsl(240 5.2% 33.9%);\n }\n\n .input__clear:focus,\n .input__password-toggle:focus {\n outline: none;\n }\n\n .input--empty .input__clear {\n visibility: hidden;\n }\n\n /* Don't show the browser's password toggle in Edge */\n ::-ms-reveal {\n display: none;\n }\n\n /* Hide the built-in number spinner */\n .input--no-spin-buttons input[type='number']::-webkit-outer-spin-button,\n .input--no-spin-buttons input[type='number']::-webkit-inner-spin-button {\n -webkit-appearance: none;\n display: none;\n }\n\n .input--no-spin-buttons input[type='number'] {\n -moz-appearance: textfield;\n }\n\n :host([no-border]) .input--standard {\n border: none;\n box-shadow: 0 0 0 0;\n }\n\n :host([no-border]) .input--standard:hover:not(.input--disabled) {\n border: none;\n box-shadow: 0 0 0 0;\n }\n\n :host([no-border]) .input--standard.input--focused:not(.input--disabled) {\n border: none;\n box-shadow: 0 0 0 0;\n }\n\n :host([no-border]) .input--standard.input--focused:not(.input--disabled) {\n border: none;\n box-shadow: 0 0 0 0;\n }\n\n .input__password {\n font-family: 'disc';\n letter-spacing: 2px;\n }\n\n .input__non-printable {\n border-radius: 4px;\n max-width: 400px;\n background-color: var(--nile-colors-white-base);\n border: 1px solid var(--nile-colors-red-500);\n color: var(--nile-colors-red-500);\n padding: 10px;\n font-size: 12px;\n max-height: 300px;\n overflow-y: scroll;\n line-height: 16px;\n }\n\n .input__remove-non-printable {\n color: var(--nile-colors-red-500);\n margin-left: 10px;\n font-size: 14px;\n color: var(--nile-colors-dark-900);\n cursor: pointer;\n }\n\n .input__srtiked-text-container {\n margin-top: 4px;\n color: var(--nile-colors-dark-900);\n word-break: break-all;\n line-height: 16px;\n }\n\n .input__srtiked-text {\n text-decoration: line-through;\n text-decoration-color: var(--nile-colors-white-base);\n color: var(--nile-colors-white-base);\n background-color: var(--nile-colors-red-500);\n }\n`;\n\nexport default [styles];\n"]}
@@ -19,6 +19,7 @@ export declare class NileMenu extends NileElement {
19
19
  searchEnabled: boolean;
20
20
  customSearch: boolean;
21
21
  showNoResults: boolean;
22
+ allowSpaceKey: boolean;
22
23
  noResultsMessage: string;
23
24
  defaultSlot: HTMLSlotElement;
24
25
  private readonly hasSlotController;
@@ -24,6 +24,7 @@ let NileMenu = class NileMenu extends NileElement {
24
24
  this.searchEnabled = false;
25
25
  this.customSearch = false;
26
26
  this.showNoResults = false;
27
+ this.allowSpaceKey = false;
27
28
  this.noResultsMessage = 'No results found';
28
29
  this.hasSlotController = new HasSlotController(this, 'menu__footer', 'menu__header');
29
30
  }
@@ -47,11 +48,6 @@ let NileMenu = class NileMenu extends NileElement {
47
48
  this.emit('nile-select', { value: item.value });
48
49
  }
49
50
  handleKeyDown(event) {
50
- const target = event.target;
51
- // Only handle keyboard shortcuts if NOT inside input, textarea, or contenteditable
52
- if (target.closest('nile-input') || target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {
53
- return; // Ignore handling space, arrows, etc.
54
- }
55
51
  // Make a selection when pressing enter
56
52
  if (event.key === 'Enter') {
57
53
  const item = this.getCurrentItem();
@@ -59,7 +55,7 @@ let NileMenu = class NileMenu extends NileElement {
59
55
  item?.click();
60
56
  }
61
57
  // Prevent scrolling when space is pressed (ONLY if not typing)
62
- if (event.key === ' ') {
58
+ if (!this.allowSpaceKey && event.key === ' ') {
63
59
  event.preventDefault();
64
60
  }
65
61
  // Move selection
@@ -213,6 +209,9 @@ __decorate([
213
209
  __decorate([
214
210
  property({ type: Boolean })
215
211
  ], NileMenu.prototype, "showNoResults", void 0);
212
+ __decorate([
213
+ property({ type: Boolean })
214
+ ], NileMenu.prototype, "allowSpaceKey", void 0);
216
215
  __decorate([
217
216
  property({ type: String })
218
217
  ], NileMenu.prototype, "noResultsMessage", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"nile-menu.js","sourceRoot":"","sources":["../../../src/nile-menu/nile-menu.ts"],"names":[],"mappings":";AAAA,OAAO,EAAc,IAAI,EAAO,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAGnD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;;;;;;;GAUG;AAGI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,WAAW;IAAlC;;QAEI,gBAAW,GAAW,EAAE,CAAC;QACzB,gBAAW,GAAW,CAAC,CAAC;QAEW,kBAAa,GAAG,KAAK,CAAC;QACtB,iBAAY,GAAG,KAAK,CAAC;QAEpC,kBAAa,GAAY,KAAK,CAAC;QAEhC,qBAAgB,GAAW,kBAAkB,CAAC;QAIzD,sBAAiB,GAAG,IAAI,iBAAiB,CACxD,IAAI,EACJ,cAAc,EACd,cAAc,CACf,CAAC;IAuMJ,CAAC;IArMC,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE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I,CAAC,aAAa;YAClB,CAAC,CAAC,IAAI,CAAA,oBAAoB,IAAI,CAAC,gBAAgB,oBAAoB;YACnE,CAAC,CAAC,EAAE;;;;;mBAKK,CAAC,CAAQ,EAAE,EAAE;YACpB,CAAC,CAAC,eAAe,EAAE,CAAC;QACtB,CAAC;;;;wBAIa,IAAI,CAAC,gBAAgB;mBAC1B,IAAI,CAAC,WAAW;qBACd,IAAI,CAAC,aAAa;uBAChB,IAAI,CAAC,eAAe;;UAEjC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,cAAc,CAAC;YAC3C,CAAC,CAAC,IAAI,CAAA;;;;qBAIK;YACX,CAAC,CAAC,IAAI;;KAEX,CAAC;IACJ,CAAC;;AAvNM,eAAM,GAAmB,MAAM,AAAzB,CAA0B;AAC9B;IAAR,KAAK,EAAE;6CAA0B;AACzB;IAAR,KAAK,EAAE;6CAAyB;AAEW;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CAAuB;AACtB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAAsB;AAEpC;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CAAgC;AAEhC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAA+C;AAE/C;IAA1B,KAAK,CAAC,kBAAkB,CAAC;6CAA+B;AAZ9C,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAyNpB;;AACD,eAAe,QAAQ,CAAC","sourcesContent":["import { LitElement, html, css } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query } from 'lit/decorators.js';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\nimport type NileMenuItem from '../nile-menu-item/nile-menu-item';\nimport { styles } from './nile-menu.css';\nimport { HasSlotController } from '../internal/slot';\n\n/**\n * An nile-menu element.\n * @summary Menus provide a list of options for the user to choose from.\n *\n * @slot - The menu's content, including menu items, menu labels, and dividers.\n *\n * @event nile-select - Emitted when a menu item is selected.\n * @fires count-changed - Indicates when the count changes\n * @slot - This element has a slot\n * @csspart button - The button\n */\n\n@customElement('nile-menu')\nexport class NileMenu extends NileElement {\n static styles: CSSResultGroup = styles;\n @state() searchValue: string = '';\n @state() searchWidth: number = 0;\n\n @property({ type: Boolean, reflect: true }) searchEnabled = false;\n @property({ type: Boolean, reflect: true }) customSearch = false;\n\n @property({ type: Boolean }) showNoResults: boolean = false;\n\n @property({ type: String }) noResultsMessage: string = 'No results found';\n\n @query('slot:not([name])') defaultSlot!: HTMLSlotElement;\n\n private readonly hasSlotController = new HasSlotController(\n this,\n 'menu__footer',\n 'menu__header'\n );\n\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute('role', 'menu');\n }\n\n private handleClick(event: MouseEvent) {\n const target = event.target as HTMLElement;\n const item = target.closest('nile-menu-item');\n\n if (item?.hasSubMenu) {\n return;\n }\n\n // if (!item || item.disabled || item.inert) {\n if (!item || item.disabled) {\n return;\n }\n\n if (item.type === 'checkbox') {\n item.checked = !item.checked;\n }\n\n this.emit('nile-select', { value: item.value });\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n const target = event.target as HTMLElement;\n\n // Only handle keyboard shortcuts if NOT inside input, textarea, or contenteditable\n if (target.closest('nile-input') || target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {\n return; // Ignore handling space, arrows, etc.\n }\n\n // Make a selection when pressing enter\n if (event.key === 'Enter') {\n const item = this.getCurrentItem();\n event.preventDefault();\n item?.click();\n }\n\n // Prevent scrolling when space is pressed (ONLY if not typing)\n if (event.key === ' ') {\n event.preventDefault();\n }\n\n // Move selection\n if (['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(event.key)) {\n const items = this.getAllItems();\n const activeItem = this.getCurrentItem();\n let index = activeItem ? items.indexOf(activeItem) : 0;\n\n if (items.length > 0) {\n event.preventDefault();\n\n if (event.key === 'ArrowDown') index++;\n else if (event.key === 'ArrowUp') index--;\n else if (event.key === 'Home') index = 0;\n else if (event.key === 'End') index = items.length - 1;\n\n if (index < 0) index = items.length - 1;\n if (index > items.length - 1) index = 0;\n\n this.setCurrentItem(items[index]);\n items[index].focus();\n }\n }\n}\n\n\n private handleMouseDown(event: MouseEvent) {\n const target = event.target as HTMLElement;\n\n if (this.isMenuItem(target)) {\n this.setCurrentItem(target as NileMenuItem);\n }\n }\n\n private handleSlotChange() {\n const items = this.getAllItems();\n\n // Reset the roving tab index when the slotted items change\n if (items.length > 0) {\n this.setCurrentItem(items[0]);\n }\n }\n\n private isMenuItem(item: HTMLElement) {\n return (\n item.tagName.toLowerCase() === 'nile-menu-item' ||\n ['menuitem', 'menuitemcheckbox', 'menuitemradio'].includes(\n item.getAttribute('role') ?? ''\n )\n );\n }\n\n /** @internal Gets all slotted menu items, ignoring dividers, headers, and other elements. */\n getAllItems() {\n return [...this.defaultSlot.assignedElements({ flatten: true })].filter(\n (el: HTMLElement) => {\n if (!this.isMenuItem(el)) {\n // if (el.inert || !this.isMenuItem(el)) {\n return false;\n }\n return true;\n }\n ) as NileMenuItem[];\n }\n\n /**\n * @internal Gets the current menu item, which is the menu item that has `tabindex=\"0\"` within the roving tab index.\n * The menu item may or may not have focus, but for keyboard interaction purposes it's considered the \"active\" item.\n */\n getCurrentItem() {\n return this.getAllItems().find(i => i.getAttribute('tabindex') === '0');\n }\n\n /**\n * @internal Sets the current menu item to the specified element. This sets `tabindex=\"0\"` on the target element and\n * `tabindex=\"-1\"` to all other items. This method must be called prior to setting focus on a menu item.\n */\n setCurrentItem(item: NileMenuItem) {\n const items = this.getAllItems();\n\n // Update tab indexes\n items.forEach(i => {\n i.setAttribute('tabindex', i === item ? '0' : '-1');\n });\n }\n\n private handleSearchChange(e: any) {\n let items = this.getAllItems();\n let searchValue = e.target.value;\n if (this.customSearch) {\n this.emit('nile-search-value', { value: searchValue });\n return;\n }\n\n let counter = 0;\n items.map(curr_item => {\n this.searchWidth = Math.max(this.searchWidth, curr_item.offsetWidth);\n if (\n curr_item.innerText.toLowerCase().includes(e.target.value.toLowerCase())\n ) {\n curr_item.style.display = 'block';\n counter++;\n } else {\n curr_item.style.display = 'none';\n }\n });\n this.showNoResults = counter === 0;\n }\n\n render() {\n return html`\n ${this.searchEnabled\n ? html`<div class=\"search__wrapper\" part=\"search__wrapper\">\n <nile-input\n size=\"medium\"\n .value=${this.searchValue}\n placeholder=\"Search...\"\n @nile-input=${this.handleSearchChange}\n part=\"menu__input\"\n clearable\n >\n <nile-icon name=\"search\" slot=\"suffix\"> </nile-icon>\n </nile-input>\n </div>`\n : html``}\n <div part=\"menu__items-wrapper\" class=\"menu__items-wrapper\">\n ${this.showNoResults\n ? html` <nile-menu-item>${this.noResultsMessage}</nile-menu-item> `\n : ''}\n\n <slot\n name=\"menu__header\"\n part=\"menu__header\"\n @click=${(e: Event) => {\n e.stopPropagation();\n }}\n ></slot>\n <slot\n class=\"menu__item-wrapper\"\n @slotchange=${this.handleSlotChange}\n @click=${this.handleClick}\n @keydown=${this.handleKeyDown}\n @mousedown=${this.handleMouseDown}\n ></slot>\n ${this.hasSlotController.test('menu__footer')\n ? html` <slot\n part=\"menu__footer\"\n name=\"menu__footer\"\n class=\"menu__footer\"\n ></slot>`\n : null}\n </div>\n `;\n }\n}\nexport default NileMenu;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-menu': NileMenu;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-menu.js","sourceRoot":"","sources":["../../../src/nile-menu/nile-menu.ts"],"names":[],"mappings":";AAAA,OAAO,EAAc,IAAI,EAAO,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,KAAK,EAAE,M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E,IAAI,EAAE,OAAO,EAAE,CAAC;+CAAgC;AAEhC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAA+C;AAE/C;IAA1B,KAAK,CAAC,kBAAkB,CAAC;6CAA+B;AAd9C,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAqNpB;;AACD,eAAe,QAAQ,CAAC","sourcesContent":["import { LitElement, html, css } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query } from 'lit/decorators.js';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\nimport type NileMenuItem from '../nile-menu-item/nile-menu-item';\nimport { styles } from './nile-menu.css';\nimport { HasSlotController } from '../internal/slot';\n\n/**\n * An nile-menu element.\n * @summary Menus provide a list of options for the user to choose from.\n *\n * @slot - The menu's content, including menu items, menu labels, and dividers.\n *\n * @event nile-select - Emitted when a menu item is selected.\n * @fires count-changed - Indicates when the count changes\n * @slot - This element has a slot\n * @csspart button - The button\n */\n\n@customElement('nile-menu')\nexport class NileMenu extends NileElement {\n static styles: CSSResultGroup = styles;\n @state() searchValue: string = '';\n @state() searchWidth: number = 0;\n\n @property({ type: Boolean, reflect: true }) searchEnabled = false;\n @property({ type: Boolean, reflect: true }) customSearch = false;\n\n @property({ type: Boolean }) showNoResults: boolean = false;\n\n @property({ type: Boolean }) allowSpaceKey: boolean = false;\n\n @property({ type: String }) noResultsMessage: string = 'No results found';\n\n @query('slot:not([name])') defaultSlot!: HTMLSlotElement;\n\n private readonly hasSlotController = new HasSlotController(\n this,\n 'menu__footer',\n 'menu__header'\n );\n\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute('role', 'menu');\n }\n\n private handleClick(event: MouseEvent) {\n const target = event.target as HTMLElement;\n const item = target.closest('nile-menu-item');\n\n if (item?.hasSubMenu) {\n return;\n }\n\n // if (!item || item.disabled || item.inert) {\n if (!item || item.disabled) {\n return;\n }\n\n if (item.type === 'checkbox') {\n item.checked = !item.checked;\n }\n\n this.emit('nile-select', { value: item.value });\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n\n // Make a selection when pressing enter\n if (event.key === 'Enter') {\n const item = this.getCurrentItem();\n event.preventDefault();\n item?.click();\n }\n\n // Prevent scrolling when space is pressed (ONLY if not typing)\n if (!this.allowSpaceKey && event.key === ' ') {\n event.preventDefault();\n }\n\n // Move selection\n if (['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(event.key)) {\n const items = this.getAllItems();\n const activeItem = this.getCurrentItem();\n let index = activeItem ? items.indexOf(activeItem) : 0;\n\n if (items.length > 0) {\n event.preventDefault();\n\n if (event.key === 'ArrowDown') index++;\n else if (event.key === 'ArrowUp') index--;\n else if (event.key === 'Home') index = 0;\n else if (event.key === 'End') index = items.length - 1;\n\n if (index < 0) index = items.length - 1;\n if (index > items.length - 1) index = 0;\n\n this.setCurrentItem(items[index]);\n items[index].focus();\n }\n }\n }\n\n\n private handleMouseDown(event: MouseEvent) {\n const target = event.target as HTMLElement;\n\n if (this.isMenuItem(target)) {\n this.setCurrentItem(target as NileMenuItem);\n }\n }\n\n private handleSlotChange() {\n const items = this.getAllItems();\n\n // Reset the roving tab index when the slotted items change\n if (items.length > 0) {\n this.setCurrentItem(items[0]);\n }\n }\n\n private isMenuItem(item: HTMLElement) {\n return (\n item.tagName.toLowerCase() === 'nile-menu-item' ||\n ['menuitem', 'menuitemcheckbox', 'menuitemradio'].includes(\n item.getAttribute('role') ?? ''\n )\n );\n }\n\n /** @internal Gets all slotted menu items, ignoring dividers, headers, and other elements. */\n getAllItems() {\n return [...this.defaultSlot.assignedElements({ flatten: true })].filter(\n (el: HTMLElement) => {\n if (!this.isMenuItem(el)) {\n // if (el.inert || !this.isMenuItem(el)) {\n return false;\n }\n return true;\n }\n ) as NileMenuItem[];\n }\n\n /**\n * @internal Gets the current menu item, which is the menu item that has `tabindex=\"0\"` within the roving tab index.\n * The menu item may or may not have focus, but for keyboard interaction purposes it's considered the \"active\" item.\n */\n getCurrentItem() {\n return this.getAllItems().find(i => i.getAttribute('tabindex') === '0');\n }\n\n /**\n * @internal Sets the current menu item to the specified element. This sets `tabindex=\"0\"` on the target element and\n * `tabindex=\"-1\"` to all other items. This method must be called prior to setting focus on a menu item.\n */\n setCurrentItem(item: NileMenuItem) {\n const items = this.getAllItems();\n\n // Update tab indexes\n items.forEach(i => {\n i.setAttribute('tabindex', i === item ? '0' : '-1');\n });\n }\n\n private handleSearchChange(e: any) {\n let items = this.getAllItems();\n let searchValue = e.target.value;\n if (this.customSearch) {\n this.emit('nile-search-value', { value: searchValue });\n return;\n }\n\n let counter = 0;\n items.map(curr_item => {\n this.searchWidth = Math.max(this.searchWidth, curr_item.offsetWidth);\n if (\n curr_item.innerText.toLowerCase().includes(e.target.value.toLowerCase())\n ) {\n curr_item.style.display = 'block';\n counter++;\n } else {\n curr_item.style.display = 'none';\n }\n });\n this.showNoResults = counter === 0;\n }\n\n render() {\n return html`\n ${this.searchEnabled\n ? html`<div class=\"search__wrapper\" part=\"search__wrapper\">\n <nile-input\n size=\"medium\"\n .value=${this.searchValue}\n placeholder=\"Search...\"\n @nile-input=${this.handleSearchChange}\n part=\"menu__input\"\n clearable\n >\n <nile-icon name=\"search\" slot=\"suffix\"> </nile-icon>\n </nile-input>\n </div>`\n : html``}\n <div part=\"menu__items-wrapper\" class=\"menu__items-wrapper\">\n ${this.showNoResults\n ? html` <nile-menu-item>${this.noResultsMessage}</nile-menu-item> `\n : ''}\n\n <slot\n name=\"menu__header\"\n part=\"menu__header\"\n @click=${(e: Event) => {\n e.stopPropagation();\n }}\n ></slot>\n <slot\n class=\"menu__item-wrapper\"\n @slotchange=${this.handleSlotChange}\n @click=${this.handleClick}\n @keydown=${this.handleKeyDown}\n @mousedown=${this.handleMouseDown}\n ></slot>\n ${this.hasSlotController.test('menu__footer')\n ? html` <slot\n part=\"menu__footer\"\n name=\"menu__footer\"\n class=\"menu__footer\"\n ></slot>`\n : null}\n </div>\n `;\n }\n}\nexport default NileMenu;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-menu': NileMenu;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"nile-table.js","sourceRoot":"","sources":["../../../src/nile-table/nile-table.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAa,IAAI,EAAiD,MAAM,KAAK,CAAC;AACrF,OAAO,EAAE,aAAa,EAAY,KAAK,EAAQ,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AACxC,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAMnD;;;;;GAKG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,WAAW;IAAnC;;QAEE,SAAI,GAAsB,EAAE,CAAC;QAC7B,qBAAgB,GAAe,EAAE,CAAA;QA6HzC,gBAAgB;IACjB,CAAC;IAzHA;;;OAGG;IACI,MAAM,KAAK,MAAM;QACvB,OAAO,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC;IACD,iBAAiB;QAChB,KAAK,CAAC,iBAAiB,EAAE,CAAA;QACzB,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IACxD,CAAC;IAES,YAAY,CAAC,kBAAkC;QACxD,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAE,EAAE;YAC5B,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC7B,CAAC,CAAC,CAAA;IACH,CAAC;IAGD,gBAAgB;IAEhB,qBAAqB;IAErB;;;OAGG;IACI,MAAM;QACZ,OAAO,IAAI,CAAA;wBACW,IAAI,CAAC,YAAY;IACrC,CAAC;IACJ,CAAC;IAED,YAAY;QACX,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC5B,CAAC;IAED,UAAU,CAAC,CAAa;QACvB,IAA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inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {LitElement, html, CSSResultArray, TemplateResult, PropertyValues} from 'lit';\nimport { customElement, property, query, state} from 'lit/decorators.js';\nimport {styles} from './nile-table.css';\nimport NileElement from '../internal/nile-element';\nimport { NileTableBody } from '../nile-table-body';\nimport { NileTableCellItem } from '../nile-table-cell-item';\nimport { NileTableHeaderItem } from '../nile-table-header-item';\n\n\n/**\n * Nile table component.\n *\n * @tag nile-table\n *\n */\n@customElement('nile-table')\nexport class NileTable extends NileElement {\n @query('slot') defaultSlot: HTMLSlotElement;\n\tprivate rows:Array<NileTableBody>=[];\n\tprivate primaryRowWidths:Array<number>=[]\n\tprivate resizeObserver:ResizeObserver ;\n\tprivate debounceTimeout:any\n\n\n\t/**\n\t * The styles for nile-table\n\t * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n\t */\n\tpublic static get styles(): CSSResultArray {\n\t\treturn [styles];\n\t}\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tthis.addEventListener('nile-body-load',this.handleRows)\n\t}\n\n\tprotected firstUpdated(_changedProperties: PropertyValues): void {\n\t\tthis.updateComplete.then(()=>{\n\t\t\tthis.handleResizeObserver();\n\t\t})\n\t}\n\n\n\t/* #endregion */\n\n\t/* #region Methods */\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n\tpublic render(): TemplateResult {\n\t\treturn html`\n\t\t\t<slot @slotchange=\"${this.repaintTable}\"></slot>\n\t\t\t`;\n\t}\n\n\trepaintTable(){\n\t\tthis.realignStructure();\n\t\tthis.handleBodyCssUpdate();\n\t}\n\n\thandleRows(e:CustomEvent){\n\t\tthis.rows=[...this.rows,e.detail.comp]\n\t}\n\n\thandleBodyCssUpdate(){\n if (this.rows.length<2) return;\n const tableBodies = this.rows;\n\t\tconst firstEl=tableBodies[0].shadowRoot?.querySelector<HTMLDivElement>('div.base');\n\t\tif(firstEl) {\n\t\t\tfirstEl.style.borderTopRightRadius=\"var(--nile-radius-radius-xl)\";\n\t\t\tfirstEl.style.borderTopLeftRadius = 'var(--nile-radius-radius-xl)';\n\t\t\tfirstEl.style.borderBottomRightRadius=\"0px\";\n\t\t\tfirstEl.style.borderBottomLeftRadius = '0px';\n\t\t\tfirstEl.style.borderBottom = 'none';\n\t\t}\n\t\ttableBodies.forEach((tb,i)=>{\n\t\t\tif(i>0 && i<tableBodies.length-1){\n\t\t\t\tconst el=tb.shadowRoot?.querySelector<HTMLDivElement>('div.base');\n\t\t\t\tif(el) {\n\t\t\t\t\tel.style.borderTopRightRadius=\"0px\";\n\t\t\t\t\tel.style.borderTopLeftRadius = \"0px\";\n\t\t\t\t\tel.style.borderBottomRightRadius=\"0px\";\n\t\t\t\t\tel.style.borderBottomLeftRadius = \"0px\";\n\t\t\t\t\tel.style.borderBottom = 'none';\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\tconst lastEl=tableBodies[tableBodies.length - 1].shadowRoot?.querySelector<HTMLDivElement>('div.base')\n\t\tif(lastEl){\n\t\t\tlastEl.style.borderTopRightRadius=\"0px\";\n\t\t\tlastEl.style.borderTopLeftRadius = '0px';\n\t\t\tlastEl.style.borderBottomRightRadius=\"var(--nile-radius-radius-xl)\";\n\t\t\tlastEl.style.borderBottomLeftRadius = 'var(--nile-radius-radius-xl)';\n\t\t}\n\t}\n\n\tgetPrimaryColumnWidths(){\n\t\tconst primaryTb=this.rows.find(tb=>tb.type=='primary')!;\n\t\tconst widthArray=this.getTableCellFetchQuery(primaryTb).map((e:LitElement)=>e.clientWidth) as Array<number>\n\t\treturn widthArray;\n\t}\n\t\n\trealignStructure(){\n if (this.rows.length<2) return;\n\t\tconst primaryRowWidths=this.getPrimaryColumnWidths();\n\t\tconst secondaryRows=this.rows.filter(tb=>tb.type!='primary');\n\t\tsecondaryRows.forEach((row)=>{\n\t\t\tlet elements=this.getTableCellFetchQuery(row)\n\t\t\telements?.forEach((el:NileTableCellItem|NileTableHeaderItem,ind)=>{\n\t\t\t\tel.style.setProperty('--cell-width',primaryRowWidths.at(ind)+'px')\n\t\t\t})\n\t\t})\n\t}\n\n\tgetTableCellFetchQuery(row:NileTableBody):Array<Element>{\n\t\treturn row?.shadowRoot?.\n\t\t\tquerySelector<HTMLSlotElement>('slot:not([name])')?.\n\t\t\tassignedElements()[0]\n\t\t\t.shadowRoot?.querySelector<HTMLSlotElement>('slot')?.\n\t\t\tassignedElements()!\n\t}\n\n\thandleResizeObserver(){\n\t\tconst onResize = (entries:ResizeObserverEntry[]): void=> {\n\t\t\tfor (let entry of entries) {\n\t\t\t\tif(this.debounceTimeout){\n\t\t\t\t\tclearTimeout(this.debounceTimeout);\n\t\t\t\t}\n\t\t\t\tthis.debounceTimeout=setTimeout(() => {\n\t\t\t\t\tthis.realignStructure();\n\t\t\t\t\tthis.debounceTimeout=null;\n\t\t\t\t}, 50);\n\t\t\t}\n\t\t};\n\t\tthis.resizeObserver=new ResizeObserver(onResize)\n\t\tthis.resizeObserver.observe(this);\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tthis.resizeObserver.disconnect()\n\t\tsuper.disconnectedCallback()\n\t}\n\t/* #endregion */\n}\n\nexport default NileTable;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-table': NileTable;\n }\n}"]}
1
+ {"version":3,"file":"nile-table.js","sourceRoot":"","sources":["../../../src/nile-table/nile-table.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAa,IAAI,EAAiD,MAAM,KAAK,CAAC;AACrF,OAAO,EAAE,aAAa,EAAY,KAAK,EAAQ,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AACxC,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAMnD;;;;;GAKG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,WAAW;IAAnC;;QAEE,SAAI,GAAsB,EAAE,CAAC;QA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Ae,EAAC,CAAC;oBACxB,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;gBACpC,CAAC;gBACD,IAAI,CAAC,eAAe,GAAC,UAAU,CAAC,GAAG,EAAE;oBACpC,IAAI,CAAC,gBAAgB,EAAE,CAAC;oBACxB,IAAI,CAAC,eAAe,GAAC,IAAI,CAAC;gBAC3B,CAAC,EAAE,EAAE,CAAC,CAAC;YACR,CAAC;QACF,CAAC,CAAC;QACF,IAAI,CAAC,cAAc,GAAC,IAAI,cAAc,CAAC,QAAQ,CAAC,CAAA;QAChD,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,oBAAoB;QACnB,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAA;QAChC,KAAK,CAAC,oBAAoB,EAAE,CAAA;IAC7B,CAAC;CAED,CAAA;AAhIgB;IAAd,KAAK,CAAC,MAAM,CAAC;8CAA8B;AADjC,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAiIrB;;AAED,eAAe,SAAS,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {LitElement, html, CSSResultArray, TemplateResult, PropertyValues} from 'lit';\nimport { customElement, property, query, state} from 'lit/decorators.js';\nimport {styles} from './nile-table.css';\nimport NileElement from '../internal/nile-element';\nimport { NileTableBody } from '../nile-table-body';\nimport { NileTableCellItem } from '../nile-table-cell-item';\nimport { NileTableHeaderItem } from '../nile-table-header-item';\n\n\n/**\n * Nile table component.\n *\n * @tag nile-table\n *\n */\n@customElement('nile-table')\nexport class NileTable extends NileElement {\n @query('slot') defaultSlot: HTMLSlotElement;\n\tprivate rows:Array<NileTableBody>=[];\n\tprivate primaryRowWidths:Array<number>=[]\n\tprivate resizeObserver:ResizeObserver ;\n\tprivate debounceTimeout:any\n\n\n\t/**\n\t * The styles for nile-table\n\t * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n\t */\n\tpublic static get styles(): CSSResultArray {\n\t\treturn [styles];\n\t}\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tthis.addEventListener('nile-body-load',this.handleRows)\n\t}\n\n\tprotected firstUpdated(_changedProperties: PropertyValues): void {\n\t\tthis.updateComplete.then(()=>{\n\t\t\tthis.handleResizeObserver();\n\t\t})\n\t}\n\n\n\t/* #endregion */\n\n\t/* #region Methods */\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n\tpublic render(): TemplateResult {\n\t\treturn html`\n\t\t\t<slot @slotchange=\"${this.repaintTable}\"></slot>\n\t\t\t`;\n\t}\n\n\trepaintTable(){\n\t\tthis.realignStructure();\n\t\tthis.handleBodyCssUpdate();\n\t}\n\n\thandleRows(e:CustomEvent){\n\t\tthis.rows=[...this.rows,e.detail.comp]\n\t}\n\n\thandleBodyCssUpdate(){\n if (this.rows.length<2) return;\n const tableBodies = this.rows;\n\t\tconst firstEl=tableBodies[0].shadowRoot?.querySelector<HTMLDivElement>('div.base')\n\t\tif(firstEl) {\n\t\t\tfirstEl.style.borderTopRightRadius=\"var(--nile-radius-radius-xl)\";\n\t\t\tfirstEl.style.borderTopLeftRadius = 'var(--nile-radius-radius-xl)';\n\t\t\tfirstEl.style.borderBottomRightRadius=\"0px\";\n\t\t\tfirstEl.style.borderBottomLeftRadius = '0px';\n\t\t\tfirstEl.style.borderBottom = 'none';\n\t\t}\n\t\ttableBodies.forEach((tb,i)=>{\n\t\t\tif(i>0 && i<tableBodies.length-1){\n\t\t\t\tconst el=tb.shadowRoot?.querySelector<HTMLDivElement>('div.base')\n\t\t\t\tif(el) {\n\t\t\t\t\tel.style.borderTopRightRadius=\"0px\";\n\t\t\t\t\tel.style.borderTopLeftRadius = \"0px\";\n\t\t\t\t\tel.style.borderBottomRightRadius=\"0px\";\n\t\t\t\t\tel.style.borderBottomLeftRadius = \"0px\";\n\t\t\t\t\tel.style.borderBottom = 'none';\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\tconst lastEl=tableBodies[tableBodies.length - 1].shadowRoot?.querySelector<HTMLDivElement>('div.base')\n\t\tif(lastEl){\n\t\t\tlastEl.style.borderTopRightRadius=\"0px\";\n\t\t\tlastEl.style.borderTopLeftRadius = '0px';\n\t\t\tlastEl.style.borderBottomRightRadius=\"var(--nile-radius-radius-xl)\";\n\t\t\tlastEl.style.borderBottomLeftRadius = 'var(--nile-radius-radius-xl)';\n\t\t}\n\t}\n\n\tgetPrimaryColumnWidths(){\n\t\tconst primaryTb=this.rows.find(tb=>tb.type=='primary')!;\n\t\tconst widthArray=this.getTableCellFetchQuery(primaryTb).map((e:LitElement)=>e.clientWidth) as Array<number>\n\t\treturn widthArray;\n\t}\n\t\n\trealignStructure(){\n if (this.rows.length<2) return;\n\t\tconst primaryRowWidths=this.getPrimaryColumnWidths();\n\t\tconst secondaryRows=this.rows.filter(tb=>tb.type!='primary');\n\t\tsecondaryRows.forEach((row)=>{\n\t\t\tlet elements=this.getTableCellFetchQuery(row)\n\t\t\telements?.forEach((el:NileTableCellItem|NileTableHeaderItem,ind)=>{\n\t\t\t\tel.style.setProperty('--cell-width',primaryRowWidths.at(ind)+'px')\n\t\t\t})\n\t\t})\n\t}\n\n\tgetTableCellFetchQuery(row:NileTableBody):Array<Element>{\n\t\treturn row?.shadowRoot?.\n\t\t\tquerySelector<HTMLSlotElement>('slot:not([name])')?.\n\t\t\tassignedElements()[0]\n\t\t\t.shadowRoot?.querySelector<HTMLSlotElement>('slot')?.\n\t\t\tassignedElements()!\n\t}\n\n\thandleResizeObserver(){\n\t\tconst onResize = (entries:ResizeObserverEntry[]): void=> {\n\t\t\tfor (let entry of entries) {\n\t\t\t\tif(this.debounceTimeout){\n\t\t\t\t\tclearTimeout(this.debounceTimeout);\n\t\t\t\t}\n\t\t\t\tthis.debounceTimeout=setTimeout(() => {\n\t\t\t\t\tthis.realignStructure();\n\t\t\t\t\tthis.debounceTimeout=null;\n\t\t\t\t}, 50);\n\t\t\t}\n\t\t};\n\t\tthis.resizeObserver=new ResizeObserver(onResize)\n\t\tthis.resizeObserver.observe(this);\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tthis.resizeObserver.disconnect()\n\t\tsuper.disconnectedCallback()\n\t}\n\t/* #endregion */\n}\n\nexport default NileTable;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-table': NileTable;\n }\n}"]}