@aquera/nile-elements 0.1.32-beta-1.5 → 0.1.32

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 (166) hide show
  1. package/README.md +2 -8
  2. package/demo/index.html +27 -262
  3. package/demo/variables.css +0 -17
  4. package/demo/variables_v2.css +0 -17
  5. package/dist/{fixture-d5b55278.cjs.js → fixture-161dee0b.cjs.js} +3 -3
  6. package/dist/fixture-161dee0b.cjs.js.map +1 -0
  7. package/dist/{fixture-df8b52d7.esm.js → fixture-372df3b0.esm.js} +1 -1
  8. package/dist/index.cjs.js +1 -1
  9. package/dist/index.esm.js +1 -1
  10. package/dist/internal/animate.cjs.js +1 -1
  11. package/dist/internal/animate.cjs.js.map +1 -1
  12. package/dist/internal/animate.esm.js +1 -1
  13. package/dist/nile-accordion/nile-accordian.test.cjs.js +1 -1
  14. package/dist/nile-accordion/nile-accordian.test.esm.js +1 -1
  15. package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +1 -1
  16. package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +1 -1
  17. package/dist/nile-avatar/nile-avatar.test.cjs.js +1 -1
  18. package/dist/nile-avatar/nile-avatar.test.esm.js +1 -1
  19. package/dist/nile-badge/nile-badge.test.cjs.js +1 -1
  20. package/dist/nile-badge/nile-badge.test.esm.js +1 -1
  21. package/dist/nile-button/nile-button.test.cjs.js +1 -1
  22. package/dist/nile-button/nile-button.test.esm.js +1 -1
  23. package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js +1 -1
  24. package/dist/nile-button-toggle-group/nile-button-toggle-group.test.esm.js +1 -1
  25. package/dist/nile-calendar/nile-calendar.test.cjs.js +1 -1
  26. package/dist/nile-calendar/nile-calendar.test.esm.js +1 -1
  27. package/dist/nile-card/nile-card.test.cjs.js +1 -1
  28. package/dist/nile-card/nile-card.test.esm.js +1 -1
  29. package/dist/nile-checkbox/nile-checkbox.test.cjs.js +1 -1
  30. package/dist/nile-checkbox/nile-checkbox.test.esm.js +1 -1
  31. package/dist/nile-chip/nile-chip.test.cjs.js +1 -1
  32. package/dist/nile-chip/nile-chip.test.esm.js +1 -1
  33. package/dist/nile-dialog/nile-dialog.test.cjs.js +1 -1
  34. package/dist/nile-dialog/nile-dialog.test.esm.js +1 -1
  35. package/dist/nile-drawer/nile-drawer.test.cjs.js +1 -1
  36. package/dist/nile-drawer/nile-drawer.test.esm.js +1 -1
  37. package/dist/nile-dropdown/nile-dropdown.test.cjs.js +1 -1
  38. package/dist/nile-dropdown/nile-dropdown.test.esm.js +1 -1
  39. package/dist/nile-empty-state/nile-empty-state.test.cjs.js +1 -1
  40. package/dist/nile-empty-state/nile-empty-state.test.esm.js +1 -1
  41. package/dist/nile-error-message/nile-error-message.test.cjs.js +1 -1
  42. package/dist/nile-error-message/nile-error-message.test.esm.js +1 -1
  43. package/dist/nile-form-group/nile-form-group.test.cjs.js +1 -1
  44. package/dist/nile-form-group/nile-form-group.test.esm.js +1 -1
  45. package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js +1 -1
  46. package/dist/nile-form-help-text/nile-form-help-text.test.esm.js +1 -1
  47. package/dist/nile-hero/nile-hero.test.cjs.js +1 -1
  48. package/dist/nile-hero/nile-hero.test.esm.js +1 -1
  49. package/dist/nile-icon/nile-icon.test.cjs.js +1 -1
  50. package/dist/nile-icon/nile-icon.test.esm.js +1 -1
  51. package/dist/nile-input/nile-input.css.cjs.js +1 -1
  52. package/dist/nile-input/nile-input.css.cjs.js.map +1 -1
  53. package/dist/nile-input/nile-input.css.esm.js +0 -8
  54. package/dist/nile-input/nile-input.test.cjs.js +1 -1
  55. package/dist/nile-input/nile-input.test.esm.js +1 -1
  56. package/dist/nile-link/nile-link.test.cjs.js +1 -1
  57. package/dist/nile-link/nile-link.test.esm.js +1 -1
  58. package/dist/nile-loader/nile-loader.test.cjs.js +1 -1
  59. package/dist/nile-loader/nile-loader.test.esm.js +1 -1
  60. package/dist/nile-popover/nile-popover.test.cjs.js +1 -1
  61. package/dist/nile-popover/nile-popover.test.esm.js +1 -1
  62. package/dist/nile-popup/nile-popup.test.cjs.js +1 -1
  63. package/dist/nile-popup/nile-popup.test.esm.js +1 -1
  64. package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js +1 -1
  65. package/dist/nile-progress-bar/nile-progress-bar.test.esm.js +1 -1
  66. package/dist/nile-radio/nile-radio.test.cjs.js +1 -1
  67. package/dist/nile-radio/nile-radio.test.esm.js +1 -1
  68. package/dist/nile-radio-group/nile-radio-group.test.cjs.js +1 -1
  69. package/dist/nile-radio-group/nile-radio-group.test.esm.js +1 -1
  70. package/dist/nile-select/nile-select.test.cjs.js +1 -1
  71. package/dist/nile-select/nile-select.test.esm.js +1 -1
  72. package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +1 -1
  73. package/dist/nile-slide-toggle/nile-slide-toggle.test.esm.js +1 -1
  74. package/dist/nile-tab-group/nile-tab-group.test.cjs.js +1 -1
  75. package/dist/nile-tab-group/nile-tab-group.test.esm.js +1 -1
  76. package/dist/nile-table/index.cjs.js +2 -0
  77. package/dist/nile-table/index.cjs.js.map +1 -0
  78. package/dist/nile-table/index.esm.js +1 -0
  79. package/dist/nile-table/nile-table.cjs.js +2 -0
  80. package/dist/nile-table/nile-table.cjs.js.map +1 -0
  81. package/dist/nile-table/nile-table.css.cjs.js +2 -0
  82. package/dist/nile-table/nile-table.css.cjs.js.map +1 -0
  83. package/dist/nile-table/nile-table.css.esm.js +6 -0
  84. package/dist/nile-table/nile-table.esm.js +3 -0
  85. package/dist/nile-table-body/nile-table-body.cjs.js +1 -1
  86. package/dist/nile-table-body/nile-table-body.cjs.js.map +1 -1
  87. package/dist/nile-table-body/nile-table-body.esm.js +2 -2
  88. package/dist/nile-table-cell-item/nile-table-cell-item.css.cjs.js +1 -1
  89. package/dist/nile-table-cell-item/nile-table-cell-item.css.cjs.js.map +1 -1
  90. package/dist/nile-table-cell-item/nile-table-cell-item.css.esm.js +8 -4
  91. package/dist/nile-table-header-item/nile-table-header-item.cjs.js +1 -1
  92. package/dist/nile-table-header-item/nile-table-header-item.cjs.js.map +1 -1
  93. package/dist/nile-table-header-item/nile-table-header-item.css.cjs.js +1 -1
  94. package/dist/nile-table-header-item/nile-table-header-item.css.cjs.js.map +1 -1
  95. package/dist/nile-table-header-item/nile-table-header-item.css.esm.js +5 -0
  96. package/dist/nile-table-header-item/nile-table-header-item.esm.js +9 -9
  97. package/dist/nile-table-row/nile-table-row.cjs.js.map +1 -1
  98. package/dist/nile-textarea/nile-textarea.test.cjs.js +1 -1
  99. package/dist/nile-textarea/nile-textarea.test.esm.js +1 -1
  100. package/dist/nile-tooltip/index.cjs.js +1 -1
  101. package/dist/nile-tooltip/index.esm.js +1 -1
  102. package/dist/nile-tooltip/nile-tooltip.cjs.js +1 -1
  103. package/dist/nile-tooltip/nile-tooltip.cjs.js.map +1 -1
  104. package/dist/nile-tooltip/nile-tooltip.css.cjs.js +1 -1
  105. package/dist/nile-tooltip/nile-tooltip.css.cjs.js.map +1 -1
  106. package/dist/nile-tooltip/nile-tooltip.css.esm.js +56 -59
  107. package/dist/nile-tooltip/nile-tooltip.esm.js +28 -23
  108. package/dist/src/index.d.ts +1 -0
  109. package/dist/src/index.js +1 -0
  110. package/dist/src/index.js.map +1 -1
  111. package/dist/src/nile-input/nile-input.css.js +0 -8
  112. package/dist/src/nile-input/nile-input.css.js.map +1 -1
  113. package/dist/src/nile-table/index.d.ts +1 -0
  114. package/dist/src/nile-table/index.js +2 -0
  115. package/dist/src/nile-table/index.js.map +1 -0
  116. package/dist/src/nile-table/nile-table.css.d.ts +12 -0
  117. package/dist/src/nile-table/nile-table.css.js +18 -0
  118. package/dist/src/nile-table/nile-table.css.js.map +1 -0
  119. package/dist/src/nile-table/nile-table.d.ts +48 -0
  120. package/dist/src/nile-table/nile-table.js +143 -0
  121. package/dist/src/nile-table/nile-table.js.map +1 -0
  122. package/dist/src/nile-table-body/nile-table-body.d.ts +3 -1
  123. package/dist/src/nile-table-body/nile-table-body.js +8 -1
  124. package/dist/src/nile-table-body/nile-table-body.js.map +1 -1
  125. package/dist/src/nile-table-cell-item/nile-table-cell-item.css.js +6 -2
  126. package/dist/src/nile-table-cell-item/nile-table-cell-item.css.js.map +1 -1
  127. package/dist/src/nile-table-header-item/nile-table-header-item.css.js +5 -0
  128. package/dist/src/nile-table-header-item/nile-table-header-item.css.js.map +1 -1
  129. package/dist/src/nile-table-header-item/nile-table-header-item.js +1 -1
  130. package/dist/src/nile-table-header-item/nile-table-header-item.js.map +1 -1
  131. package/dist/src/nile-table-row/nile-table-row.js.map +1 -1
  132. package/dist/src/nile-tooltip/nile-tooltip.css.js +45 -48
  133. package/dist/src/nile-tooltip/nile-tooltip.css.js.map +1 -1
  134. package/dist/src/nile-tooltip/nile-tooltip.d.ts +44 -23
  135. package/dist/src/nile-tooltip/nile-tooltip.js +227 -157
  136. package/dist/src/nile-tooltip/nile-tooltip.js.map +1 -1
  137. package/dist/tsconfig.tsbuildinfo +1 -1
  138. package/package.json +4 -3
  139. package/src/index.ts +2 -1
  140. package/src/nile-input/nile-input.css.ts +0 -8
  141. package/src/nile-table/index.ts +1 -0
  142. package/src/nile-table/nile-table.css.ts +20 -0
  143. package/src/nile-table/nile-table.ts +161 -0
  144. package/src/nile-table-body/nile-table-body.ts +7 -2
  145. package/src/nile-table-cell-item/nile-table-cell-item.css.ts +6 -2
  146. package/src/nile-table-header-item/nile-table-header-item.css.ts +5 -0
  147. package/src/nile-table-header-item/nile-table-header-item.ts +1 -1
  148. package/src/nile-table-row/nile-table-row.ts +1 -2
  149. package/src/nile-tooltip/nile-tooltip.css.ts +46 -49
  150. package/src/nile-tooltip/nile-tooltip.ts +237 -155
  151. package/vscode-html-custom-data.json +101 -83
  152. package/dist/fixture-d5b55278.cjs.js.map +0 -1
  153. package/dist/nile-tooltip/nile-tooltip-utils.cjs.js +0 -2
  154. package/dist/nile-tooltip/nile-tooltip-utils.cjs.js.map +0 -1
  155. package/dist/nile-tooltip/nile-tooltip-utils.esm.js +0 -1
  156. package/dist/nile-tooltip/nile-tooltip.test.cjs.js +0 -2
  157. package/dist/nile-tooltip/nile-tooltip.test.cjs.js.map +0 -1
  158. package/dist/nile-tooltip/nile-tooltip.test.esm.js +0 -51
  159. package/dist/src/nile-tooltip/nile-tooltip-utils.d.ts +0 -18
  160. package/dist/src/nile-tooltip/nile-tooltip-utils.js +0 -151
  161. package/dist/src/nile-tooltip/nile-tooltip-utils.js.map +0 -1
  162. package/dist/src/nile-tooltip/nile-tooltip.test.d.ts +0 -1
  163. package/dist/src/nile-tooltip/nile-tooltip.test.js +0 -158
  164. package/dist/src/nile-tooltip/nile-tooltip.test.js.map +0 -1
  165. package/src/nile-tooltip/nile-tooltip-utils.ts +0 -190
  166. package/src/nile-tooltip/nile-tooltip.test.ts +0 -178
@@ -1,10 +1,14 @@
1
1
  import{css as i}from"lit";const e=i`
2
2
  :host {
3
+ --cell-min-width: auto;
4
+ --cell-width: auto;
3
5
  display: table-cell;
4
6
  box-sizing: border-box;
5
7
  }
6
8
 
7
9
  .header__item__wrapper{
10
+ min-width:var(--cell-min-width);
11
+ width:var(--cell-width);
8
12
  display:flex;
9
13
  align-items:center;
10
14
  box-sizing: border-box;
@@ -14,6 +18,7 @@ import{css as i}from"lit";const e=i`
14
18
  }
15
19
 
16
20
  .headers {
21
+ overflow:hidden;
17
22
  display: flex;
18
23
  align-items: center;
19
24
  height: auto;
@@ -1,25 +1,25 @@
1
- import{__decorate as e}from"tslib";import{html as i}from"lit";import{property as t,state as s,customElement as l}from"lit/decorators.js";import{s as n}from"./nile-table-header-item.css.esm.js";import{N as r}from"../internal/nile-element.esm.js";import{H as o}from"../internal/slot.esm.js";let a=class extends r{constructor(){super(...arguments),this.hasSlotController=new o(this,"[default]"),this.havesort=!1,this.havefilter=!1,this.iconName="",this.sorting_ct=0}static get styles(){return[n]}handleSort(e){this.sorting_ct++;let i=this.hasSlotController.host.innerHTML;this.emit("nile-click-sort",{value:{curr_sort_string:i,order:["normal","asc","des"][this.sorting_ct%3]}})}handleSearch(e){this.emit("nile-search",{value:e.detail.value})}render(){return i` ${this.hasSlotController.test("[default]")?i`
2
- <div class="header__item__wrapper">
1
+ import{__decorate as e}from"tslib";import{html as t}from"lit";import{property as i,state as l,customElement as s}from"lit/decorators.js";import{s as n}from"./nile-table-header-item.css.esm.js";import{N as r}from"../internal/nile-element.esm.js";import{H as o}from"../internal/slot.esm.js";let a=class extends r{constructor(){super(...arguments),this.hasSlotController=new o(this,"[default]"),this.havesort=!1,this.havefilter=!1,this.iconName="",this.sorting_ct=0}static get styles(){return[n]}handleSort(e){this.sorting_ct++;let t=this.hasSlotController.host.innerHTML;this.emit("nile-click-sort",{value:{curr_sort_string:t,order:["normal","asc","des"][this.sorting_ct%3]}})}handleSearch(e){this.emit("nile-search",{value:e.detail.value})}render(){return t` ${this.hasSlotController.test("[default]")?t`
2
+ <div class="header__item__wrapper" part="nile__table-header-cell">
3
3
  <div class="headers">
4
4
  <slot> </slot>
5
- ${this.havesort&&this.sorting_ct%3==0?i`<nile-icon
5
+ ${this.havesort&&this.sorting_ct%3==0?t`<nile-icon
6
6
  name="sortdown"
7
7
  size="16"
8
8
  @click=${this.handleSort}
9
9
  class="hover__arrow"
10
10
  ></nile-icon>`:null}
11
- ${this.havesort&&this.sorting_ct%3==1?i`<nile-icon
11
+ ${this.havesort&&this.sorting_ct%3==1?t`<nile-icon
12
12
  name="sortdown"
13
13
  size="16"
14
14
  @click=${this.handleSort}
15
15
  ></nile-icon>`:null}
16
- ${this.havesort&&this.sorting_ct%3==2?i`<nile-icon
16
+ ${this.havesort&&this.sorting_ct%3==2?t`<nile-icon
17
17
  name="sortup"
18
18
  size="16"
19
19
  @click=${this.handleSort}
20
20
  ></nile-icon>`:null}
21
- ${this.iconName?i` <nile-icon name="${this.iconName}" size="16"></nile-icon>`:i``}
22
- ${this.havefilter?i` <nile-popover title="Filter" placement="bottom">
21
+ ${this.iconName?t` <nile-icon name="${this.iconName}" size="16"></nile-icon>`:t``}
22
+ ${this.havefilter?t` <nile-popover title="Filter" placement="bottom">
23
23
  <nile-icon name="filter" size="16" slot="anchor"></nile-icon>
24
24
  <nile-input
25
25
  placeholder="Search"
@@ -27,6 +27,6 @@ import{__decorate as e}from"tslib";import{html as i}from"lit";import{property as
27
27
  part="filter__search"
28
28
  ></nile-input>
29
29
  <slot name="filter__content" part="filter__content"></slot>
30
- </nile-popover>`:i``}
30
+ </nile-popover>`:t``}
31
31
  </div>
32
- </div>`:null}`}};e([t({type:Boolean,reflect:!0})],a.prototype,"havesort",void 0),e([t({type:Boolean,reflect:!0})],a.prototype,"havefilter",void 0),e([t({type:String,reflect:!0,attribute:"icon-name"})],a.prototype,"iconName",void 0),e([s()],a.prototype,"sorting_ct",void 0),a=e([l("nile-table-header-item")],a);export{a as N};
32
+ </div>`:null}`}};e([i({type:Boolean,reflect:!0})],a.prototype,"havesort",void 0),e([i({type:Boolean,reflect:!0})],a.prototype,"havefilter",void 0),e([i({type:String,reflect:!0,attribute:"icon-name"})],a.prototype,"iconName",void 0),e([l()],a.prototype,"sorting_ct",void 0),a=e([s("nile-table-header-item")],a);export{a as N};
@@ -1 +1 @@
1
- {"version":3,"file":"nile-table-row.cjs.js","sources":["../../../src/nile-table-row/nile-table-row.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 {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n} from 'lit';\nimport { customElement, query, property } from 'lit/decorators.js';\nimport { styles } from './nile-table-row.css';\nimport NileElement from '../internal/nile-element';\n\n/**\n *nile-table-row component.\n *\n * @tag nile-table-row\n *\n */\n@customElement('nile-table-row')\nexport class NileTableRow extends NileElement {\n /**\n * The styles for TableRow\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n\n private handleSortingAlter(event: CustomEvent) {\n const header_items: any = [\n ...this.querySelectorAll('nile-table-header-item'),\n ];\n for (let i = 0; i < header_items.length; i++) {\n const header = header_items[i];\n const haveIcon =\n header.textContent == event.detail.value.curr_sort_string;\n if (!haveIcon) {\n header.sorting_ct = 0;\n }\n }\n }\n\n public render(): TemplateResult {\n return html`\n <slot\n part=\"nile-row\"\n @nile-click-sort=\"${this.handleSortingAlter}\"\n ></slot>\n `;\n }\n\n /* #endregion */\n}\n\nexport default NileTableRow;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-table-row': NileTableRow;\n }\n}\n"],"names":["NileTableRow","_l","o","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","handleSortingAlter","event","header_items","_toConsumableArray","this","querySelectorAll","i","length","header","textContent","detail","curr_sort_string","sorting_ct","render","html","_templateObject","_taggedTemplateLiteral","get","styles","NileElement","__decorate","customElement"],"mappings":"2jIAwBaA,CAAN,uBAAAC,EAAA,WAAAC,EAAA,EAAAC,eAAA,MAAAD,CAAA,SAAAE,UAAA,MAAAF,CAAA,CAAAG,SAAA,GAAAC,SAAA,CAAAJ,CAAA,CAAAD,EAAA,SAAAM,YAAA,CAAAL,CAAA,GAAAM,GAAA,sBAAAC,KAAA,CAmBG,SAAAC,kBAAAA,CAAmBC,CACzB,CAAA,CAAA,GAAMC,CAAAA,CAAoB,CAAAC,kBAAA,CACrBC,IAAKC,CAAAA,gBAAAA,CAAiB,2BAE3B,IAAK,GAAIC,CAAAA,EAAI,CAAA,CAAA,CAAGA,EAAIJ,CAAAA,CAAAA,CAAaK,MAAQD,CAAAA,EAAAA,EAAAA,CAAK,CAC5C,GAAME,CAAAA,EAASN,CAAAA,CAAAA,CAAaI,EAE1BE,CAAAA,CAAAA,EAAAA,CAAOC,aAAeR,CAAMS,CAAAA,MAAAA,CAAOX,KAAMY,CAAAA,gBAAAA,GAEzCH,EAAOI,CAAAA,UAAAA,CAAa,CAEvB,CAAA,EACF,CAEM,GAAAd,GAAA,UAAAC,KAAA,UAAAc,MAAAA,CAAAA,CACL,CAAA,MAAOC,CAAAA,CAAI,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,wGAGaZ,IAAKJ,CAAAA,kBAAAA,EAG9B,CAAA,KAAAF,GAAA,UAAAmB,GAAA,CAlCM,SAAAA,IAAA,CAAWC,CAChB,MAAO,CAACA,CACT,CAAA,EAWO,MAnBwBC,IAArB7B,OAAAA,KAAAA,CAAY8B,CAAAA,CAAAA,CAAA,CADxBC,CAAAA,CAAc,mBACF/B"}
1
+ {"version":3,"file":"nile-table-row.cjs.js","sources":["../../../src/nile-table-row/nile-table-row.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 {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n} from 'lit';\nimport { customElement, query, property } from 'lit/decorators.js';\nimport { styles } from './nile-table-row.css';\nimport NileElement from '../internal/nile-element';\n\n/**\n *nile-table-row component.\n *\n * @tag nile-table-row\n *\n */\n@customElement('nile-table-row')\nexport class NileTableRow extends NileElement {\n /**\n * The styles for TableRow\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n\n private handleSortingAlter(event: CustomEvent) {\n const header_items: any = [\n ...this.querySelectorAll('nile-table-header-item'),\n ];\n for (let i = 0; i < header_items.length; i++) {\n const header = header_items[i];\n const haveIcon = header.textContent == event.detail.value.curr_sort_string;\n if (!haveIcon) {\n header.sorting_ct = 0;\n }\n }\n }\n\n public render(): TemplateResult {\n return html`\n <slot\n part=\"nile-row\"\n @nile-click-sort=\"${this.handleSortingAlter}\"\n ></slot>\n `;\n }\n\n /* #endregion */\n}\n\nexport default NileTableRow;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-table-row': NileTableRow;\n }\n}\n"],"names":["NileTableRow","_l","o","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","handleSortingAlter","event","header_items","_toConsumableArray","this","querySelectorAll","i","length","header","textContent","detail","curr_sort_string","sorting_ct","render","html","_templateObject","_taggedTemplateLiteral","get","styles","NileElement","__decorate","customElement"],"mappings":"2jIAwBaA,CAAN,uBAAAC,EAAA,WAAAC,EAAA,EAAAC,eAAA,MAAAD,CAAA,SAAAE,UAAA,MAAAF,CAAA,CAAAG,SAAA,GAAAC,SAAA,CAAAJ,CAAA,CAAAD,EAAA,SAAAM,YAAA,CAAAL,CAAA,GAAAM,GAAA,sBAAAC,KAAA,CAmBG,SAAAC,kBAAAA,CAAmBC,CACzB,CAAA,CAAA,GAAMC,CAAAA,CAAoB,CAAAC,kBAAA,CACrBC,IAAKC,CAAAA,gBAAAA,CAAiB,2BAE3B,IAAK,GAAIC,CAAAA,EAAI,CAAA,CAAA,CAAGA,EAAIJ,CAAAA,CAAAA,CAAaK,MAAQD,CAAAA,EAAAA,EAAAA,CAAK,CAC5C,GAAME,CAAAA,EAASN,CAAAA,CAAAA,CAAaI,EACXE,CAAAA,CAAAA,EAAAA,CAAOC,aAAeR,CAAMS,CAAAA,MAAAA,CAAOX,KAAMY,CAAAA,gBAAAA,GAExDH,EAAOI,CAAAA,UAAAA,CAAa,CAEvB,CAAA,EACF,CAEM,GAAAd,GAAA,UAAAC,KAAA,UAAAc,MAAAA,CAAAA,CACL,CAAA,MAAOC,CAAAA,CAAI,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,wGAGaZ,IAAKJ,CAAAA,kBAAAA,EAG9B,CAAA,KAAAF,GAAA,UAAAmB,GAAA,CAjCM,SAAAA,IAAA,CAAWC,CAChB,MAAO,CAACA,CACT,CAAA,EAWO,MAnBwBC,IAArB7B,OAAAA,KAAAA,CAAY8B,CAAAA,CAAAA,CAAA,CADxBC,CAAAA,CAAc,mBACF/B"}
@@ -1,2 +1,2 @@
1
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["../fixture-d5b55278.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-textarea.cjs.js","tslib","lit/decorators.js","./nile-textarea.css.cjs.js","lit/directives/class-map.js","../internal/default-value.cjs.js","../internal/slot.cjs.js","lit/directives/if-defined.js","lit/directives/live.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var e,t,a,i,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture001CjsJs){e=_fixture001CjsJs.f;t=_fixture001CjsJs.a;a=_fixture001CjsJs.o;},function(_litStaticHtmlJs){i=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileTextareaCjsJs){},function(_tslib){},function(_litDecoratorsJs){},function(_nileTextareaCssCjsJs){},function(_litDirectivesClassMapJs){},function(_internalDefaultValueCjsJs){},function(_internalSlotCjsJs){},function(_litDirectivesIfDefinedJs){},function(_litDirectivesLiveJs){},function(_internalWatchCjsJs){},function(_internalNileElementCjsJs){}],execute:function execute(){describe("<nile-textarea>",function(){it("should render the default properties correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var a;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return e(i(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-textarea></nile-textarea>"]))));case 2:a=_context2.sent;t(a.value).to.equal(""),t(a.size).to.equal("medium"),t(a.filled).to.be["false"],t(a.disabled).to.be["false"],t(a.readonly).to.be["false"],t(a.required).to.be["false"];case 4:case"end":return _context2.stop();}},_callee);}))),it("should reflect properties to attributes",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var a;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return e(i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-textarea disabled readonly required></nile-textarea>"]))));case 2:a=_context3.sent;t(a.getAttribute("disabled")).to.equal(""),t(a.getAttribute("readonly")).to.equal(""),t(a.getAttribute("required")).to.equal("");case 4:case"end":return _context3.stop();}},_callee2);}))),it("should emit events correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _r$shadowRoot$querySe,_r$shadowRoot;var r,s,_yield$a,n,_yield$a2,l,_yield$a3,o,_yield$a4,c;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return e(i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-textarea></nile-textarea>"]))));case 2:r=_context4.sent;s=(_r$shadowRoot$querySe=(_r$shadowRoot=r.shadowRoot)===null||_r$shadowRoot===void 0?void 0:_r$shadowRoot.querySelector("textarea"))!==null&&_r$shadowRoot$querySe!==void 0?_r$shadowRoot$querySe:{};setTimeout(function(){return s.dispatchEvent(new Event("focus"));});_context4.next=7;return a(r,"nile-focus");case 7:_yield$a=_context4.sent;n=_yield$a.detail;t(n.value).to.equal(""),s.value="test",setTimeout(function(){return s.dispatchEvent(new Event("input"));});_context4.next=12;return a(r,"nile-input");case 12:_yield$a2=_context4.sent;l=_yield$a2.detail;t(l.value).to.equal("test"),setTimeout(function(){return s.dispatchEvent(new Event("change"));});_context4.next=17;return a(r,"nile-change");case 17:_yield$a3=_context4.sent;o=_yield$a3.detail;t(o.value).to.equal("test"),setTimeout(function(){return s.dispatchEvent(new Event("blur"));});_context4.next=22;return a(r,"nile-blur");case 22:_yield$a4=_context4.sent;c=_yield$a4.detail;t(c.value).to.equal("test");case 25:case"end":return _context4.stop();}},_callee3);}))),it("should update value property on input event",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var _a$shadowRoot$querySe,_a$shadowRoot;var a,r;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return e(i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-textarea></nile-textarea>"]))));case 2:a=_context5.sent;r=(_a$shadowRoot$querySe=(_a$shadowRoot=a.shadowRoot)===null||_a$shadowRoot===void 0?void 0:_a$shadowRoot.querySelector("textarea"))!==null&&_a$shadowRoot$querySe!==void 0?_a$shadowRoot$querySe:{};r.value="new value",r.dispatchEvent(new Event("input")),t(a.value).to.equal("new value");case 5:case"end":return _context5.stop();}},_callee4);}))),it('should handle the "rows" property correctly',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var _a$shadowRoot$querySe2,_a$shadowRoot2;var a,r;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return e(i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-textarea rows=\"10\"></nile-textarea>"]))));case 2:a=_context6.sent;r=(_a$shadowRoot$querySe2=(_a$shadowRoot2=a.shadowRoot)===null||_a$shadowRoot2===void 0?void 0:_a$shadowRoot2.querySelector("textarea"))!==null&&_a$shadowRoot$querySe2!==void 0?_a$shadowRoot$querySe2:{};t(r.rows).to.equal(10);case 5:case"end":return _context6.stop();}},_callee5);}))),it('should handle the "resize" property correctly',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var _a$shadowRoot$querySe3,_a$shadowRoot3;var a,r;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return e(i(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-textarea resize=\"none\"></nile-textarea>"]))));case 2:a=_context7.sent;r=(_a$shadowRoot$querySe3=(_a$shadowRoot3=a.shadowRoot)===null||_a$shadowRoot3===void 0?void 0:_a$shadowRoot3.querySelector(".textarea"))!==null&&_a$shadowRoot$querySe3!==void 0?_a$shadowRoot$querySe3:{};t(r.classList.contains("textarea--resize-none")).to.be["true"];case 5:case"end":return _context7.stop();}},_callee6);}))),it("should select all text when select() is called",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _a$shadowRoot$querySe4,_a$shadowRoot4;var a,r;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return e(i(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-textarea value=\"test value\"></nile-textarea>"]))));case 2:a=_context8.sent;a.select();r=(_a$shadowRoot$querySe4=(_a$shadowRoot4=a.shadowRoot)===null||_a$shadowRoot4===void 0?void 0:_a$shadowRoot4.querySelector("textarea"))!==null&&_a$shadowRoot$querySe4!==void 0?_a$shadowRoot$querySe4:{};t(r.selectionStart).to.equal(0),t(r.selectionEnd).to.equal(a.value.length);case 6:case"end":return _context8.stop();}},_callee7);}))),it("should set selection range correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var _a$shadowRoot$querySe5,_a$shadowRoot5;var a,r;return _regeneratorRuntime().wrap(function _callee8$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.next=2;return e(i(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["<nile-textarea value=\"test value\"></nile-textarea>"]))));case 2:a=_context9.sent;a.setSelectionRange(0,4);r=(_a$shadowRoot$querySe5=(_a$shadowRoot5=a.shadowRoot)===null||_a$shadowRoot5===void 0?void 0:_a$shadowRoot5.querySelector("textarea"))!==null&&_a$shadowRoot$querySe5!==void 0?_a$shadowRoot$querySe5:{};t(r.selectionStart).to.equal(0),t(r.selectionEnd).to.equal(4);case 6:case"end":return _context9.stop();}},_callee8);}))),it("should handle non-printable characters",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(){var a,r;return _regeneratorRuntime().wrap(function _callee9$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:_context10.next=2;return e(i(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["<nile-textarea checkNonPrintableChar></nile-textarea>"]))));case 2:a=_context10.sent;a.value="test乇乂丅尺卂";a.handleValueChange();_context10.next=7;return a.updateComplete;case 7:t(a.hasPrintableCharacters).to.be["true"];r=String("乇乂丅尺卂").split("").some(function(e){return-1!=a.markedValue.indexOf(e);});t(r).to.be["true"];case 10:case"end":return _context10.stop();}},_callee9);}))),it("should remove non-printable characters correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(){var a;return _regeneratorRuntime().wrap(function _callee10$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:_context11.next=2;return e(i(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["<nile-textarea></nile-textarea>"]))));case 2:a=_context11.sent;a.value="test乇乂丅尺卂",a.removeAllNonPrintableCharacters(),t(a.value).to.equal("test");case 4:case"end":return _context11.stop();}},_callee10);})));});}};});
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["../fixture-161dee0b.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-textarea.cjs.js","tslib","lit/decorators.js","./nile-textarea.css.cjs.js","lit/directives/class-map.js","../internal/default-value.cjs.js","../internal/slot.cjs.js","lit/directives/if-defined.js","lit/directives/live.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var e,t,a,i,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture001CjsJs){e=_fixture001CjsJs.f;t=_fixture001CjsJs.a;a=_fixture001CjsJs.o;},function(_litStaticHtmlJs){i=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileTextareaCjsJs){},function(_tslib){},function(_litDecoratorsJs){},function(_nileTextareaCssCjsJs){},function(_litDirectivesClassMapJs){},function(_internalDefaultValueCjsJs){},function(_internalSlotCjsJs){},function(_litDirectivesIfDefinedJs){},function(_litDirectivesLiveJs){},function(_internalWatchCjsJs){},function(_internalNileElementCjsJs){}],execute:function execute(){describe("<nile-textarea>",function(){it("should render the default properties correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var a;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return e(i(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-textarea></nile-textarea>"]))));case 2:a=_context2.sent;t(a.value).to.equal(""),t(a.size).to.equal("medium"),t(a.filled).to.be["false"],t(a.disabled).to.be["false"],t(a.readonly).to.be["false"],t(a.required).to.be["false"];case 4:case"end":return _context2.stop();}},_callee);}))),it("should reflect properties to attributes",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var a;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return e(i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-textarea disabled readonly required></nile-textarea>"]))));case 2:a=_context3.sent;t(a.getAttribute("disabled")).to.equal(""),t(a.getAttribute("readonly")).to.equal(""),t(a.getAttribute("required")).to.equal("");case 4:case"end":return _context3.stop();}},_callee2);}))),it("should emit events correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _r$shadowRoot$querySe,_r$shadowRoot;var r,s,_yield$a,n,_yield$a2,l,_yield$a3,o,_yield$a4,c;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return e(i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-textarea></nile-textarea>"]))));case 2:r=_context4.sent;s=(_r$shadowRoot$querySe=(_r$shadowRoot=r.shadowRoot)===null||_r$shadowRoot===void 0?void 0:_r$shadowRoot.querySelector("textarea"))!==null&&_r$shadowRoot$querySe!==void 0?_r$shadowRoot$querySe:{};setTimeout(function(){return s.dispatchEvent(new Event("focus"));});_context4.next=7;return a(r,"nile-focus");case 7:_yield$a=_context4.sent;n=_yield$a.detail;t(n.value).to.equal(""),s.value="test",setTimeout(function(){return s.dispatchEvent(new Event("input"));});_context4.next=12;return a(r,"nile-input");case 12:_yield$a2=_context4.sent;l=_yield$a2.detail;t(l.value).to.equal("test"),setTimeout(function(){return s.dispatchEvent(new Event("change"));});_context4.next=17;return a(r,"nile-change");case 17:_yield$a3=_context4.sent;o=_yield$a3.detail;t(o.value).to.equal("test"),setTimeout(function(){return s.dispatchEvent(new Event("blur"));});_context4.next=22;return a(r,"nile-blur");case 22:_yield$a4=_context4.sent;c=_yield$a4.detail;t(c.value).to.equal("test");case 25:case"end":return _context4.stop();}},_callee3);}))),it("should update value property on input event",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var _a$shadowRoot$querySe,_a$shadowRoot;var a,r;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return e(i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-textarea></nile-textarea>"]))));case 2:a=_context5.sent;r=(_a$shadowRoot$querySe=(_a$shadowRoot=a.shadowRoot)===null||_a$shadowRoot===void 0?void 0:_a$shadowRoot.querySelector("textarea"))!==null&&_a$shadowRoot$querySe!==void 0?_a$shadowRoot$querySe:{};r.value="new value",r.dispatchEvent(new Event("input")),t(a.value).to.equal("new value");case 5:case"end":return _context5.stop();}},_callee4);}))),it('should handle the "rows" property correctly',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var _a$shadowRoot$querySe2,_a$shadowRoot2;var a,r;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return e(i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-textarea rows=\"10\"></nile-textarea>"]))));case 2:a=_context6.sent;r=(_a$shadowRoot$querySe2=(_a$shadowRoot2=a.shadowRoot)===null||_a$shadowRoot2===void 0?void 0:_a$shadowRoot2.querySelector("textarea"))!==null&&_a$shadowRoot$querySe2!==void 0?_a$shadowRoot$querySe2:{};t(r.rows).to.equal(10);case 5:case"end":return _context6.stop();}},_callee5);}))),it('should handle the "resize" property correctly',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var _a$shadowRoot$querySe3,_a$shadowRoot3;var a,r;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return e(i(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-textarea resize=\"none\"></nile-textarea>"]))));case 2:a=_context7.sent;r=(_a$shadowRoot$querySe3=(_a$shadowRoot3=a.shadowRoot)===null||_a$shadowRoot3===void 0?void 0:_a$shadowRoot3.querySelector(".textarea"))!==null&&_a$shadowRoot$querySe3!==void 0?_a$shadowRoot$querySe3:{};t(r.classList.contains("textarea--resize-none")).to.be["true"];case 5:case"end":return _context7.stop();}},_callee6);}))),it("should select all text when select() is called",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _a$shadowRoot$querySe4,_a$shadowRoot4;var a,r;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return e(i(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-textarea value=\"test value\"></nile-textarea>"]))));case 2:a=_context8.sent;a.select();r=(_a$shadowRoot$querySe4=(_a$shadowRoot4=a.shadowRoot)===null||_a$shadowRoot4===void 0?void 0:_a$shadowRoot4.querySelector("textarea"))!==null&&_a$shadowRoot$querySe4!==void 0?_a$shadowRoot$querySe4:{};t(r.selectionStart).to.equal(0),t(r.selectionEnd).to.equal(a.value.length);case 6:case"end":return _context8.stop();}},_callee7);}))),it("should set selection range correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var _a$shadowRoot$querySe5,_a$shadowRoot5;var a,r;return _regeneratorRuntime().wrap(function _callee8$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.next=2;return e(i(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["<nile-textarea value=\"test value\"></nile-textarea>"]))));case 2:a=_context9.sent;a.setSelectionRange(0,4);r=(_a$shadowRoot$querySe5=(_a$shadowRoot5=a.shadowRoot)===null||_a$shadowRoot5===void 0?void 0:_a$shadowRoot5.querySelector("textarea"))!==null&&_a$shadowRoot$querySe5!==void 0?_a$shadowRoot$querySe5:{};t(r.selectionStart).to.equal(0),t(r.selectionEnd).to.equal(4);case 6:case"end":return _context9.stop();}},_callee8);}))),it("should handle non-printable characters",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(){var a,r;return _regeneratorRuntime().wrap(function _callee9$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:_context10.next=2;return e(i(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["<nile-textarea checkNonPrintableChar></nile-textarea>"]))));case 2:a=_context10.sent;a.value="test乇乂丅尺卂";a.handleValueChange();_context10.next=7;return a.updateComplete;case 7:t(a.hasPrintableCharacters).to.be["true"];r=String("乇乂丅尺卂").split("").some(function(e){return-1!=a.markedValue.indexOf(e);});t(r).to.be["true"];case 10:case"end":return _context10.stop();}},_callee9);}))),it("should remove non-printable characters correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(){var a;return _regeneratorRuntime().wrap(function _callee10$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:_context11.next=2;return e(i(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["<nile-textarea></nile-textarea>"]))));case 2:a=_context11.sent;a.value="test乇乂丅尺卂",a.removeAllNonPrintableCharacters(),t(a.value).to.equal("test");case 4:case"end":return _context11.stop();}},_callee10);})));});}};});
2
2
  //# sourceMappingURL=nile-textarea.test.cjs.js.map
@@ -1 +1 @@
1
- import{f as e,a as t,o as a}from"../fixture-df8b52d7.esm.js";import{html as i}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import"./nile-textarea.esm.js";import"tslib";import"lit/decorators.js";import"./nile-textarea.css.esm.js";import"lit/directives/class-map.js";import"../internal/default-value.esm.js";import"../internal/slot.esm.js";import"lit/directives/if-defined.js";import"lit/directives/live.js";import"../internal/watch.esm.js";import"../internal/nile-element.esm.js";describe("<nile-textarea>",(()=>{it("should render the default properties correctly",(async()=>{const a=await e(i`<nile-textarea></nile-textarea>`);t(a.value).to.equal(""),t(a.size).to.equal("medium"),t(a.filled).to.be.false,t(a.disabled).to.be.false,t(a.readonly).to.be.false,t(a.required).to.be.false})),it("should reflect properties to attributes",(async()=>{const a=await e(i`<nile-textarea disabled readonly required></nile-textarea>`);t(a.getAttribute("disabled")).to.equal(""),t(a.getAttribute("readonly")).to.equal(""),t(a.getAttribute("required")).to.equal("")})),it("should emit events correctly",(async()=>{const r=await e(i`<nile-textarea></nile-textarea>`),s=r.shadowRoot?.querySelector("textarea")??{};setTimeout((()=>s.dispatchEvent(new Event("focus"))));const{detail:n}=await a(r,"nile-focus");t(n.value).to.equal(""),s.value="test",setTimeout((()=>s.dispatchEvent(new Event("input"))));const{detail:l}=await a(r,"nile-input");t(l.value).to.equal("test"),setTimeout((()=>s.dispatchEvent(new Event("change"))));const{detail:o}=await a(r,"nile-change");t(o.value).to.equal("test"),setTimeout((()=>s.dispatchEvent(new Event("blur"))));const{detail:c}=await a(r,"nile-blur");t(c.value).to.equal("test")})),it("should update value property on input event",(async()=>{const a=await e(i`<nile-textarea></nile-textarea>`),r=a.shadowRoot?.querySelector("textarea")??{};r.value="new value",r.dispatchEvent(new Event("input")),t(a.value).to.equal("new value")})),it('should handle the "rows" property correctly',(async()=>{const a=await e(i`<nile-textarea rows="10"></nile-textarea>`),r=a.shadowRoot?.querySelector("textarea")??{};t(r.rows).to.equal(10)})),it('should handle the "resize" property correctly',(async()=>{const a=await e(i`<nile-textarea resize="none"></nile-textarea>`),r=a.shadowRoot?.querySelector(".textarea")??{};t(r.classList.contains("textarea--resize-none")).to.be.true})),it("should select all text when select() is called",(async()=>{const a=await e(i`<nile-textarea value="test value"></nile-textarea>`);a.select();const r=a.shadowRoot?.querySelector("textarea")??{};t(r.selectionStart).to.equal(0),t(r.selectionEnd).to.equal(a.value.length)})),it("should set selection range correctly",(async()=>{const a=await e(i`<nile-textarea value="test value"></nile-textarea>`);a.setSelectionRange(0,4);const r=a.shadowRoot?.querySelector("textarea")??{};t(r.selectionStart).to.equal(0),t(r.selectionEnd).to.equal(4)})),it("should handle non-printable characters",(async()=>{const a=await e(i`<nile-textarea checkNonPrintableChar></nile-textarea>`);a.value="test乇乂丅尺卂",a.handleValueChange(),await a.updateComplete,t(a.hasPrintableCharacters).to.be.true;const r=String("乇乂丅尺卂").split("").some((e=>-1!=a.markedValue.indexOf(e)));t(r).to.be.true})),it("should remove non-printable characters correctly",(async()=>{const a=await e(i`<nile-textarea></nile-textarea>`);a.value="test乇乂丅尺卂",a.removeAllNonPrintableCharacters(),t(a.value).to.equal("test")}))}));
1
+ import{f as e,a as t,o as a}from"../fixture-372df3b0.esm.js";import{html as i}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import"./nile-textarea.esm.js";import"tslib";import"lit/decorators.js";import"./nile-textarea.css.esm.js";import"lit/directives/class-map.js";import"../internal/default-value.esm.js";import"../internal/slot.esm.js";import"lit/directives/if-defined.js";import"lit/directives/live.js";import"../internal/watch.esm.js";import"../internal/nile-element.esm.js";describe("<nile-textarea>",(()=>{it("should render the default properties correctly",(async()=>{const a=await e(i`<nile-textarea></nile-textarea>`);t(a.value).to.equal(""),t(a.size).to.equal("medium"),t(a.filled).to.be.false,t(a.disabled).to.be.false,t(a.readonly).to.be.false,t(a.required).to.be.false})),it("should reflect properties to attributes",(async()=>{const a=await e(i`<nile-textarea disabled readonly required></nile-textarea>`);t(a.getAttribute("disabled")).to.equal(""),t(a.getAttribute("readonly")).to.equal(""),t(a.getAttribute("required")).to.equal("")})),it("should emit events correctly",(async()=>{const r=await e(i`<nile-textarea></nile-textarea>`),s=r.shadowRoot?.querySelector("textarea")??{};setTimeout((()=>s.dispatchEvent(new Event("focus"))));const{detail:n}=await a(r,"nile-focus");t(n.value).to.equal(""),s.value="test",setTimeout((()=>s.dispatchEvent(new Event("input"))));const{detail:l}=await a(r,"nile-input");t(l.value).to.equal("test"),setTimeout((()=>s.dispatchEvent(new Event("change"))));const{detail:o}=await a(r,"nile-change");t(o.value).to.equal("test"),setTimeout((()=>s.dispatchEvent(new Event("blur"))));const{detail:c}=await a(r,"nile-blur");t(c.value).to.equal("test")})),it("should update value property on input event",(async()=>{const a=await e(i`<nile-textarea></nile-textarea>`),r=a.shadowRoot?.querySelector("textarea")??{};r.value="new value",r.dispatchEvent(new Event("input")),t(a.value).to.equal("new value")})),it('should handle the "rows" property correctly',(async()=>{const a=await e(i`<nile-textarea rows="10"></nile-textarea>`),r=a.shadowRoot?.querySelector("textarea")??{};t(r.rows).to.equal(10)})),it('should handle the "resize" property correctly',(async()=>{const a=await e(i`<nile-textarea resize="none"></nile-textarea>`),r=a.shadowRoot?.querySelector(".textarea")??{};t(r.classList.contains("textarea--resize-none")).to.be.true})),it("should select all text when select() is called",(async()=>{const a=await e(i`<nile-textarea value="test value"></nile-textarea>`);a.select();const r=a.shadowRoot?.querySelector("textarea")??{};t(r.selectionStart).to.equal(0),t(r.selectionEnd).to.equal(a.value.length)})),it("should set selection range correctly",(async()=>{const a=await e(i`<nile-textarea value="test value"></nile-textarea>`);a.setSelectionRange(0,4);const r=a.shadowRoot?.querySelector("textarea")??{};t(r.selectionStart).to.equal(0),t(r.selectionEnd).to.equal(4)})),it("should handle non-printable characters",(async()=>{const a=await e(i`<nile-textarea checkNonPrintableChar></nile-textarea>`);a.value="test乇乂丅尺卂",a.handleValueChange(),await a.updateComplete,t(a.hasPrintableCharacters).to.be.true;const r=String("乇乂丅尺卂").split("").some((e=>-1!=a.markedValue.indexOf(e)));t(r).to.be.true})),it("should remove non-printable characters correctly",(async()=>{const a=await e(i`<nile-textarea></nile-textarea>`);a.value="test乇乂丅尺卂",a.removeAllNonPrintableCharacters(),t(a.value).to.equal("test")}))}));
@@ -1,2 +1,2 @@
1
- System.register(["./nile-tooltip.cjs.js","tslib","lit","lit/decorators.js","lit/directives/class-map.js","./nile-tooltip.css.cjs.js","../internal/nile-element.cjs.js","./nile-tooltip-utils.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileTooltipCjsJs){_export("NileTooltip",_nileTooltipCjsJs.N);},function(_tslib){},function(_lit){},function(_litDecoratorsJs){},function(_litDirectivesClassMapJs){},function(_nileTooltipCssCjsJs){},function(_internalNileElementCjsJs){},function(_nileTooltipUtilsCjsJs){}],execute:function execute(){}};});
1
+ System.register(["./nile-tooltip.cjs.js","tslib","./nile-tooltip.css.cjs.js","lit","../nile-popup/nile-popup.cjs.js","lit/directives/class-map.js","lit/decorators.js","../internal/nile-element.cjs.js","../nile-popup/nile-popup.css.cjs.js","../internal/animate.cjs.js","../utilities/animation-registry.cjs.js","../internal/event.cjs.js","../internal/watch.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileTooltipCjsJs){_export("NileTooltip",_nileTooltipCjsJs.N);},function(_tslib){},function(_nileTooltipCssCjsJs){},function(_lit){},function(_nilePopupNilePopupCjsJs){},function(_litDirectivesClassMapJs){},function(_litDecoratorsJs){},function(_internalNileElementCjsJs){},function(_nilePopupNilePopupCssCjsJs){},function(_internalAnimateCjsJs){},function(_utilitiesAnimationRegistryCjsJs){},function(_internalEventCjsJs){},function(_internalWatchCjsJs){}],execute:function execute(){}};});
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- export{N as NileTooltip}from"./nile-tooltip.esm.js";import"tslib";import"lit";import"lit/decorators.js";import"lit/directives/class-map.js";import"./nile-tooltip.css.esm.js";import"../internal/nile-element.esm.js";import"./nile-tooltip-utils.esm.js";
1
+ export{N as NileTooltip}from"./nile-tooltip.esm.js";import"tslib";import"./nile-tooltip.css.esm.js";import"lit";import"../nile-popup/nile-popup.esm.js";import"lit/directives/class-map.js";import"lit/decorators.js";import"../internal/nile-element.esm.js";import"../nile-popup/nile-popup.css.esm.js";import"../internal/animate.esm.js";import"../utilities/animation-registry.esm.js";import"../internal/event.esm.js";import"../internal/watch.esm.js";
@@ -1,2 +1,2 @@
1
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","lit/directives/class-map.js","./nile-tooltip.css.cjs.js","../internal/nile-element.cjs.js","./nile-tooltip-utils.cjs.js"],function(_export,_context){"use strict";var t,i,s,o,e,h,l,r,n,c,a,_templateObject,_templateObject2,d;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.html;},function(_litDecoratorsJs){s=_litDecoratorsJs.property;o=_litDecoratorsJs.query;e=_litDecoratorsJs.customElement;},function(_litDirectivesClassMapJs){h=_litDirectivesClassMapJs.classMap;},function(_nileTooltipCssCjsJs){l=_nileTooltipCssCjsJs.s;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_nileTooltipUtilsCjsJs){n=_nileTooltipUtilsCjsJs.i;c=_nileTooltipUtilsCjsJs.g;a=_nileTooltipUtilsCjsJs.a;}],execute:function execute(){_export("N",d=/*#__PURE__*/function(_r){function d(){var _this;_classCallCheck(this,d);_this=_callSuper(this,d,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=function(){if(!n(_this.triggerContainer))return void(_this.open=!1);var t=_this.triggerContainer.getBoundingClientRect(),i=_this.tooltip.getBoundingClientRect(),s=window.innerWidth,o=window.innerHeight,_c=c(t,i,_this.originalPlacement,_this.distance,_this.skidding,_this.caretSize,s,o),e=_c.top,h=_c.left,l=_c.placement;_this.setAttribute("placement",l),_this.tooltip.style.top="".concat(e,"px"),_this.tooltip.style.left="".concat(h,"px");var _a=a({placement:l,tooltipRect:i,triggerRect:t,caretSize:_this.caretSize,left:h,top:e}),r=_a.caretLeft,_d=_a.caretTop;_this.caret.style.left="".concat(r,"px"),_this.caret.style.top="".concat(_d,"px");},_this.showTooltip=function(){(_this.content.trim()||_this.hasTooltipSlot)&&(!_this.disabled&&n(_this.triggerContainer)?(_this.emit("nile-show"),_this.open=!0,_this.updateComplete.then(function(){_this.updateTooltipPosition(),_this.emit("nile-after-show");})):_this.open=!1);},_this.hideTooltip=function(){_this.emit("nile-hide"),_this.open=!1,setTimeout(function(){_this.emit("nile-after-hide");},200);},_this.handleMouseOver=function(){_this.trigger.includes("hover")&&(clearTimeout(_this.hoverTimeout),_this.hoverTimeout=window.setTimeout(function(){return _this.showTooltip();},150));},_this.handleMouseOut=function(){_this.trigger.includes("hover")&&(clearTimeout(_this.hoverTimeout),_this.hoverTimeout=window.setTimeout(function(){return _this.hideTooltip();},0));},_this.handleClick=function(){_this.trigger.includes("click")&&(!_this.open&&n(_this.triggerContainer)?_this.showTooltip():_this.hideTooltip());},_this.handleFocus=function(){_this.trigger.includes("focus")&&_this.showTooltip();},_this.handleBlur=function(){_this.trigger.includes("focus")&&_this.hideTooltip();};return _this;}_inherits(d,_r);return _createClass(d,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(d,"connectedCallback",this,3)([]),this.originalPlacement=this.placement,window.addEventListener("resize",this.updateTooltipPosition),window.addEventListener("scroll",this.updateTooltipPosition,!0);}},{key:"updated",value:function updated(t){var _superPropGet2;(_superPropGet2=_superPropGet(d,"updated",this,3))===null||_superPropGet2===void 0||_superPropGet2([t]);var 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 \"".concat(this.placement,"\", defaulting to \"bottom\".")),this.placement="bottom"),i.includes(this.originalPlacement)||(this.originalPlacement="bottom");}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(d,"disconnectedCallback",this,3)([]),window.removeEventListener("resize",this.updateTooltipPosition),window.removeEventListener("scroll",this.updateTooltipPosition,!0);}},{key:"handleTooltipSlotChange",value:function handleTooltipSlotChange(){var t=this.tooltipSlot.assignedNodes({flatten:!0});this.hasTooltipSlot=t.length>0,this.requestUpdate();}},{key:"render",value:function render(){return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n class=","\n id=\"tooltip\"\n >\n <div class=\"tooltip-content\" part=\"content\">\n <slot name=\"content\" @slotchange=","></slot>\n ","\n </div>\n <div class=\"tooltip-caret\" style=\"--caret-size: ","px;\"></div>\n </div>\n\n <div\n class=\"trigger-container\"\n tabindex=\"0\"\n @mouseover=","\n @mouseout=","\n @click=","\n @focusin=","\n @focusout=","\n aria-describedby=\"tooltip\"\n >\n <slot></slot>\n </div>\n "])),h({tooltip:!0,"tooltip__body--large":"large"===this.size}),this.handleTooltipSlotChange,this.hasTooltipSlot?null:i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["",""])),this.content),this.caretSize,this.handleMouseOver,this.handleMouseOut,this.handleClick,this.handleFocus,this.handleBlur);}}],[{key:"styles",get:function get(){return[l];}}]);}(r));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),_export("N",d=t([e("nile-tooltip")],d));}};});
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","./nile-tooltip.css.cjs.js","../nile-popup/nile-popup.cjs.js","../internal/animate.cjs.js","lit/directives/class-map.js","lit/decorators.js","../utilities/animation-registry.cjs.js","lit","../internal/event.cjs.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","../nile-popup/nile-popup.css.cjs.js"],function(_export,_context){"use strict";var t,i,s,e,o,h,a,l,n,r,p,d,c,u,m,_templateObject,f;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_nileTooltipCssCjsJs){i=_nileTooltipCssCjsJs.s;},function(_nilePopupNilePopupCjsJs){},function(_internalAnimateCjsJs){s=_internalAnimateCjsJs.p;e=_internalAnimateCjsJs.s;o=_internalAnimateCjsJs.a;},function(_litDirectivesClassMapJs){h=_litDirectivesClassMapJs.classMap;},function(_litDecoratorsJs){a=_litDecoratorsJs.query;l=_litDecoratorsJs.property;n=_litDecoratorsJs.customElement;},function(_utilitiesAnimationRegistryCjsJs){r=_utilitiesAnimationRegistryCjsJs.s;p=_utilitiesAnimationRegistryCjsJs.g;},function(_lit){d=_lit.html;},function(_internalEventCjsJs){c=_internalEventCjsJs.w;},function(_internalWatchCjsJs){u=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){m=_internalNileElementCjsJs.N;},function(_nilePopupNilePopupCssCjsJs){}],execute:function execute(){_export("N",f=/*#__PURE__*/function(_m){function f(){var _this;_classCallCheck(this,f);_this=_callSuper(this,f,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;return _this;}_inherits(f,_m);return _createClass(f,[{key:"connectedCallback",value:function connectedCallback(){var _this2=this;_superPropGet(f,"connectedCallback",this,3)([]),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(function(){_this2.addEventListener("blur",_this2.handleBlur,!0),_this2.addEventListener("focus",_this2.handleFocus,!0),_this2.addEventListener("click",_this2.handleClick),_this2.addEventListener("keydown",_this2.handleKeyDown),_this2.addEventListener("mouseover",_this2.handleMouseOver),_this2.addEventListener("mouseout",_this2.handleMouseOut);});}},{key:"firstUpdated",value:function firstUpdated(){this.body.hidden=!this.open,this.open&&(this.popup.active=!0,this.popup.reposition());}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(f,"disconnectedCallback",this,3)([]),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);}},{key:"handleBlur",value:function handleBlur(){this.hasTrigger("focus")&&this.hide();}},{key:"handleClick",value:function handleClick(){this.hasTrigger("click")&&(this.open?this.hide():this.show());}},{key:"handleFocus",value:function handleFocus(){this.hasTrigger("focus")&&this.show();}},{key:"handleKeyDown",value:function handleKeyDown(t){this.open&&"Escape"===t.key&&(t.stopPropagation(),this.hide());}},{key:"handleMouseOver",value:function handleMouseOver(){var _this3=this;if(this.hasTrigger("hover")){var _t=s(getComputedStyle(this).getPropertyValue("--show-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(function(){return _this3.show();},_t);}}},{key:"handleMouseOut",value:function handleMouseOut(){var _this4=this;if(this.hasTrigger("hover")){var _t2=s(getComputedStyle(this).getPropertyValue("--hide-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(function(){return _this4.hide();},_t2);}}},{key:"hasTrigger",value:function hasTrigger(t){return this.trigger.split(" ").includes(t);}},{key:"handleOpenChange",value:function(){var _handleOpenChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var _p,_t3,_i,_p2,_t4,_i2;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(!this.open){_context2.next=14;break;}if(!this.disabled){_context2.next=3;break;}return _context2.abrupt("return");case 3:this.emit("nile-show");_context2.next=6;return e(this.body);case 6:this.body.hidden=!1;this.popup.active=!0;_p=p(this,"tooltip.show",{dir:""}),_t3=_p.keyframes,_i=_p.options;_context2.next=11;return o(this.popup.popup,_t3,_i);case 11:this.emit("nile-after-show");_context2.next=23;break;case 14:this.emit("nile-hide");_context2.next=17;return e(this.body);case 17:_p2=p(this,"tooltip.hide",{dir:""}),_t4=_p2.keyframes,_i2=_p2.options;_context2.next=20;return o(this.popup.popup,_t4,_i2);case 20:this.popup.active=!1;this.body.hidden=!0;this.emit("nile-after-hide");case 23:case"end":return _context2.stop();}},_callee,this);}));function handleOpenChange(){return _handleOpenChange.apply(this,arguments);}return handleOpenChange;}()},{key:"handleOptionsChange",value:function(){var _handleOptionsChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.t0=this.hasUpdated;if(!_context3.t0){_context3.next=5;break;}_context3.next=4;return this.updateComplete;case 4:this.popup.reposition();case 5:case"end":return _context3.stop();}},_callee2,this);}));function handleOptionsChange(){return _handleOptionsChange.apply(this,arguments);}return handleOptionsChange;}()},{key:"handleDisabledChange",value:function handleDisabledChange(){this.disabled&&this.open&&this.hide();}},{key:"show",value:function(){var _show=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _this$content;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:if(!(!this.open&&(_this$content=this.content)!==null&&_this$content!==void 0&&_this$content.trim().length)){_context4.next=2;break;}return _context4.abrupt("return",(this.open=!0,c(this,"nile-after-show")));case 2:case"end":return _context4.stop();}},_callee3,this);}));function show(){return _show.apply(this,arguments);}return show;}()},{key:"hide",value:function(){var _hide=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:if(!this.open){_context5.next=2;break;}return _context5.abrupt("return",(this.open=!1,c(this,"nile-after-hide")));case 2:case"end":return _context5.stop();}},_callee4,this);}));function hide(){return _hide.apply(this,arguments);}return hide;}()},{key:"render",value:function render(){return d(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-popup\n part=\"base\"\n exportparts=\"\n popup:base__popup,\n arrow:base__arrow\n \"\n class=","\n placement=","\n distance=","\n skidding=","\n strategy=","\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=","\n role=\"tooltip\"\n aria-live=","\n >\n ","\n </slot>\n </nile-popup>\n "])),h({tooltip:!0,"tooltip--open":this.open}),this.placement,this.distance,this.skidding,this.hoist?"fixed":"absolute",h({tooltip__body:!0,"tooltip__body--large":"large"===this.size}),this.open?"polite":"off",this.content);}}],[{key:"styles",get:function get(){return[i];}}]);}(m));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([u("open",{waitUntilFirstUpdate:!0})],f.prototype,"handleOpenChange",null),t([u(["content","distance","hoist","placement","skidding"])],f.prototype,"handleOptionsChange",null),t([u("disabled")],f.prototype,"handleDisabledChange",null),_export("N",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"}});}};});
2
2
  //# sourceMappingURL=nile-tooltip.cjs.js.map
@@ -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,CAAKG,UA6CjCH,KAAAA,CAAqBe,qBAAAA,CAAG,WAC9B,GAAKC,CAAAA,CAAAA,CAAahB,KAAAA,CAAKiB,gBAErB,CAAA,CAAA,MAAA,MADAjB,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D-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,CAAKnB,IACvCA,CAAAA,CAAAA,IAAAA,CAAKoB,WAAcpB,CAAAA,IAAAA,CAAKoB,YAAYD,IAAKnB,CAAAA,IAAAA,CAAAA,CACzCA,IAAKqB,CAAA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A,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};