@aquera/nile-elements 0.1.35-beta-1.0 → 0.1.35-beta-1.3

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 (209) hide show
  1. package/README.md +10 -21
  2. package/demo/index.css +4 -7
  3. package/demo/index.html +39 -20
  4. package/demo/variables.css +13 -0
  5. package/demo/variables_v2.css +13 -0
  6. package/dist/{fixture-df8b52d7.esm.js → fixture-2b5b3aba.esm.js} +1 -1
  7. package/dist/{fixture-d5b55278.cjs.js → fixture-7bfb866e.cjs.js} +3 -3
  8. package/dist/fixture-7bfb866e.cjs.js.map +1 -0
  9. package/dist/index.cjs.js +1 -1
  10. package/dist/index.esm.js +1 -1
  11. package/dist/internal/animate.cjs.js +1 -1
  12. package/dist/internal/animate.cjs.js.map +1 -1
  13. package/dist/internal/animate.esm.js +1 -1
  14. package/dist/nile-accordion/nile-accordian.test.cjs.js +1 -1
  15. package/dist/nile-accordion/nile-accordian.test.esm.js +1 -1
  16. package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +1 -1
  17. package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +1 -1
  18. package/dist/nile-avatar/nile-avatar.test.cjs.js +1 -1
  19. package/dist/nile-avatar/nile-avatar.test.esm.js +1 -1
  20. package/dist/nile-badge/nile-badge.test.cjs.js +1 -1
  21. package/dist/nile-badge/nile-badge.test.esm.js +1 -1
  22. package/dist/nile-button/nile-button.test.cjs.js +1 -1
  23. package/dist/nile-button/nile-button.test.esm.js +1 -1
  24. package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js +1 -1
  25. package/dist/nile-button-toggle-group/nile-button-toggle-group.test.esm.js +1 -1
  26. package/dist/nile-calendar/nile-calendar.test.cjs.js +1 -1
  27. package/dist/nile-calendar/nile-calendar.test.esm.js +1 -1
  28. package/dist/nile-card/nile-card.test.cjs.js +1 -1
  29. package/dist/nile-card/nile-card.test.esm.js +1 -1
  30. package/dist/nile-checkbox/nile-checkbox.test.cjs.js +1 -1
  31. package/dist/nile-checkbox/nile-checkbox.test.esm.js +1 -1
  32. package/dist/nile-chip/nile-chip.test.cjs.js +1 -1
  33. package/dist/nile-chip/nile-chip.test.esm.js +1 -1
  34. package/dist/nile-dialog/nile-dialog.test.cjs.js +1 -1
  35. package/dist/nile-dialog/nile-dialog.test.esm.js +1 -1
  36. package/dist/nile-drawer/nile-drawer.test.cjs.js +1 -1
  37. package/dist/nile-drawer/nile-drawer.test.esm.js +1 -1
  38. package/dist/nile-dropdown/nile-dropdown.test.cjs.js +1 -1
  39. package/dist/nile-dropdown/nile-dropdown.test.esm.js +1 -1
  40. package/dist/nile-empty-state/nile-empty-state.test.cjs.js +1 -1
  41. package/dist/nile-empty-state/nile-empty-state.test.esm.js +1 -1
  42. package/dist/nile-error-message/nile-error-message.cjs.js +1 -1
  43. package/dist/nile-error-message/nile-error-message.cjs.js.map +1 -1
  44. package/dist/nile-error-message/nile-error-message.css.cjs.js +1 -1
  45. package/dist/nile-error-message/nile-error-message.css.cjs.js.map +1 -1
  46. package/dist/nile-error-message/nile-error-message.css.esm.js +4 -6
  47. package/dist/nile-error-message/nile-error-message.esm.js +4 -4
  48. package/dist/nile-error-message/nile-error-message.test.cjs.js +1 -1
  49. package/dist/nile-error-message/nile-error-message.test.esm.js +1 -1
  50. package/dist/nile-error-notification/nile-error-notification.css.cjs.js +1 -1
  51. package/dist/nile-error-notification/nile-error-notification.css.cjs.js.map +1 -1
  52. package/dist/nile-error-notification/nile-error-notification.css.esm.js +1 -1
  53. package/dist/nile-filter-chip/index.cjs.js +2 -0
  54. package/dist/nile-filter-chip/index.cjs.js.map +1 -0
  55. package/dist/nile-filter-chip/index.esm.js +1 -0
  56. package/dist/nile-filter-chip/nile-filter-chip.cjs.js +2 -0
  57. package/dist/nile-filter-chip/nile-filter-chip.cjs.js.map +1 -0
  58. package/dist/nile-filter-chip/nile-filter-chip.css.cjs.js +2 -0
  59. package/dist/nile-filter-chip/nile-filter-chip.css.cjs.js.map +1 -0
  60. package/dist/nile-filter-chip/nile-filter-chip.css.esm.js +98 -0
  61. package/dist/nile-filter-chip/nile-filter-chip.esm.js +34 -0
  62. package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js +2 -0
  63. package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js.map +1 -0
  64. package/dist/nile-filter-chip/nile-filter-chip.test.esm.js +20 -0
  65. package/dist/nile-form-group/nile-form-group.test.cjs.js +1 -1
  66. package/dist/nile-form-group/nile-form-group.test.esm.js +1 -1
  67. package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js +1 -1
  68. package/dist/nile-form-help-text/nile-form-help-text.test.esm.js +1 -1
  69. package/dist/nile-hero/nile-hero.test.cjs.js +1 -1
  70. package/dist/nile-hero/nile-hero.test.esm.js +1 -1
  71. package/dist/nile-icon/nile-icon.test.cjs.js +1 -1
  72. package/dist/nile-icon/nile-icon.test.esm.js +1 -1
  73. package/dist/nile-input/nile-input.test.cjs.js +1 -1
  74. package/dist/nile-input/nile-input.test.esm.js +1 -1
  75. package/dist/nile-link/nile-link.test.cjs.js +1 -1
  76. package/dist/nile-link/nile-link.test.esm.js +1 -1
  77. package/dist/nile-loader/nile-loader.test.cjs.js +1 -1
  78. package/dist/nile-loader/nile-loader.test.esm.js +1 -1
  79. package/dist/nile-popover/nile-popover.test.cjs.js +1 -1
  80. package/dist/nile-popover/nile-popover.test.esm.js +1 -1
  81. package/dist/nile-popup/nile-popup.test.cjs.js +1 -1
  82. package/dist/nile-popup/nile-popup.test.esm.js +1 -1
  83. package/dist/nile-progress-bar/nile-progress-bar.css.cjs.js +1 -1
  84. package/dist/nile-progress-bar/nile-progress-bar.css.cjs.js.map +1 -1
  85. package/dist/nile-progress-bar/nile-progress-bar.css.esm.js +0 -1
  86. package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js +1 -1
  87. package/dist/nile-progress-bar/nile-progress-bar.test.esm.js +1 -1
  88. package/dist/nile-radio/nile-radio.test.cjs.js +1 -1
  89. package/dist/nile-radio/nile-radio.test.esm.js +1 -1
  90. package/dist/nile-radio-group/nile-radio-group.test.cjs.js +1 -1
  91. package/dist/nile-radio-group/nile-radio-group.test.esm.js +1 -1
  92. package/dist/nile-select/nile-select.test.cjs.js +1 -1
  93. package/dist/nile-select/nile-select.test.esm.js +1 -1
  94. package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +1 -1
  95. package/dist/nile-slide-toggle/nile-slide-toggle.test.esm.js +1 -1
  96. package/dist/nile-tab-group/nile-tab-group.test.cjs.js +1 -1
  97. package/dist/nile-tab-group/nile-tab-group.test.esm.js +1 -1
  98. package/dist/nile-table/nile-table.cjs.js.map +1 -1
  99. package/dist/nile-textarea/nile-textarea.test.cjs.js +1 -1
  100. package/dist/nile-textarea/nile-textarea.test.esm.js +1 -1
  101. package/dist/nile-tooltip/index.cjs.js +1 -1
  102. package/dist/nile-tooltip/index.esm.js +1 -1
  103. package/dist/nile-tooltip/nile-tooltip.cjs.js +1 -1
  104. package/dist/nile-tooltip/nile-tooltip.cjs.js.map +1 -1
  105. package/dist/nile-tooltip/nile-tooltip.css.cjs.js +1 -1
  106. package/dist/nile-tooltip/nile-tooltip.css.cjs.js.map +1 -1
  107. package/dist/nile-tooltip/nile-tooltip.css.esm.js +45 -78
  108. package/dist/nile-tooltip/nile-tooltip.esm.js +28 -23
  109. package/dist/src/index.d.ts +1 -0
  110. package/dist/src/index.js +1 -0
  111. package/dist/src/index.js.map +1 -1
  112. package/dist/src/nile-badge/__snapshots__/nile-badge.test.snap.js +17 -0
  113. package/dist/src/nile-bob/index.d.ts +1 -0
  114. package/dist/src/nile-bob/index.js +2 -0
  115. package/dist/src/nile-bob/index.js.map +1 -0
  116. package/dist/src/nile-bob/nile-bob.css.d.ts +12 -0
  117. package/dist/src/nile-bob/nile-bob.css.js +17 -0
  118. package/dist/src/nile-bob/nile-bob.css.js.map +1 -0
  119. package/dist/src/nile-bob/nile-bob.d.ts +32 -0
  120. package/dist/src/nile-bob/nile-bob.js +43 -0
  121. package/dist/src/nile-bob/nile-bob.js.map +1 -0
  122. package/dist/src/nile-calendar/__snapshots__/nile-calendar.test.snap.js +275 -0
  123. package/dist/src/nile-card/__snapshots__/nile-card.test.snap.js +34 -0
  124. package/dist/src/nile-checkbox/__snapshots__/nile-checkbox.test.snap.js +31 -0
  125. package/dist/src/nile-error-message/nile-error-message.css.js +4 -6
  126. package/dist/src/nile-error-message/nile-error-message.css.js.map +1 -1
  127. package/dist/src/nile-error-message/nile-error-message.d.ts +0 -4
  128. package/dist/src/nile-error-message/nile-error-message.js +0 -20
  129. package/dist/src/nile-error-message/nile-error-message.js.map +1 -1
  130. package/dist/src/nile-error-notification/nile-error-notification.css.js +1 -1
  131. package/dist/src/nile-error-notification/nile-error-notification.css.js.map +1 -1
  132. package/dist/src/nile-fileupload/index.d.ts +1 -0
  133. package/dist/src/nile-fileupload/index.js +2 -0
  134. package/dist/src/nile-fileupload/index.js.map +1 -0
  135. package/dist/src/nile-fileupload/nile-fileupload.css.d.ts +12 -0
  136. package/dist/src/nile-fileupload/nile-fileupload.css.js +17 -0
  137. package/dist/src/nile-fileupload/nile-fileupload.css.js.map +1 -0
  138. package/dist/src/nile-fileupload/nile-fileupload.d.ts +32 -0
  139. package/dist/src/nile-fileupload/nile-fileupload.js +43 -0
  140. package/dist/src/nile-fileupload/nile-fileupload.js.map +1 -0
  141. package/dist/src/nile-filter-chip/index.d.ts +1 -0
  142. package/dist/src/nile-filter-chip/index.js +2 -0
  143. package/dist/src/nile-filter-chip/index.js.map +1 -0
  144. package/dist/src/nile-filter-chip/nile-filter-chip.css.d.ts +12 -0
  145. package/dist/src/nile-filter-chip/nile-filter-chip.css.js +110 -0
  146. package/dist/src/nile-filter-chip/nile-filter-chip.css.js.map +1 -0
  147. package/dist/src/nile-filter-chip/nile-filter-chip.d.ts +35 -0
  148. package/dist/src/nile-filter-chip/nile-filter-chip.js +128 -0
  149. package/dist/src/nile-filter-chip/nile-filter-chip.js.map +1 -0
  150. package/dist/src/nile-filter-chip/nile-filter-chip.test.d.ts +1 -0
  151. package/dist/src/nile-filter-chip/nile-filter-chip.test.js +80 -0
  152. package/dist/src/nile-filter-chip/nile-filter-chip.test.js.map +1 -0
  153. package/dist/src/nile-hero/__snapshots__/nile-hero.test.snap.js +47 -0
  154. package/dist/src/nile-icon/__snapshots__/nile-icon.test.snap.js +16 -0
  155. package/dist/src/nile-icon/icons/svg/new-calendar.d.ts +5 -0
  156. package/dist/src/nile-icon/icons/svg/new-calendar.js +5 -0
  157. package/dist/src/nile-icon/icons/svg/new-calendar.js.map +1 -0
  158. package/dist/src/nile-input/__snapshots__/nile-input.test.snap.js +75 -0
  159. package/dist/src/nile-popover/__snapshots__/nile-popover.test.snap.js +22 -0
  160. package/dist/src/nile-progress-bar/nile-progress-bar.css.js +0 -1
  161. package/dist/src/nile-progress-bar/nile-progress-bar.css.js.map +1 -1
  162. package/dist/src/nile-revan/index.d.ts +1 -0
  163. package/dist/src/nile-revan/index.js +2 -0
  164. package/dist/src/nile-revan/index.js.map +1 -0
  165. package/dist/src/nile-revan/nile-revan.css.d.ts +12 -0
  166. package/dist/src/nile-revan/nile-revan.css.js +17 -0
  167. package/dist/src/nile-revan/nile-revan.css.js.map +1 -0
  168. package/dist/src/nile-revan/nile-revan.d.ts +32 -0
  169. package/dist/src/nile-revan/nile-revan.js +43 -0
  170. package/dist/src/nile-revan/nile-revan.js.map +1 -0
  171. package/dist/src/nile-table/nile-table.js.map +1 -1
  172. package/dist/src/nile-test/index.d.ts +1 -0
  173. package/dist/src/nile-test/index.js +2 -0
  174. package/dist/src/nile-test/index.js.map +1 -0
  175. package/dist/src/nile-test/nile-test.css.d.ts +12 -0
  176. package/dist/src/nile-test/nile-test.css.js +17 -0
  177. package/dist/src/nile-test/nile-test.css.js.map +1 -0
  178. package/dist/src/nile-test/nile-test.d.ts +34 -0
  179. package/dist/src/nile-test/nile-test.js +179 -0
  180. package/dist/src/nile-test/nile-test.js.map +1 -0
  181. package/dist/src/nile-tooltip/nile-tooltip.css.js +43 -76
  182. package/dist/src/nile-tooltip/nile-tooltip.css.js.map +1 -1
  183. package/dist/src/nile-tooltip/nile-tooltip.d.ts +46 -24
  184. package/dist/src/nile-tooltip/nile-tooltip.js +232 -235
  185. package/dist/src/nile-tooltip/nile-tooltip.js.map +1 -1
  186. package/dist/tsconfig.tsbuildinfo +1 -1
  187. package/package.json +4 -3
  188. package/src/index.ts +2 -1
  189. package/src/nile-error-message/nile-error-message.css.ts +4 -6
  190. package/src/nile-error-message/nile-error-message.ts +0 -18
  191. package/src/nile-error-notification/nile-error-notification.css.ts +1 -1
  192. package/src/nile-filter-chip/index.ts +1 -0
  193. package/src/nile-filter-chip/nile-filter-chip.css.ts +115 -0
  194. package/src/nile-filter-chip/nile-filter-chip.test.ts +92 -0
  195. package/src/nile-filter-chip/nile-filter-chip.ts +125 -0
  196. package/src/nile-progress-bar/nile-progress-bar.css.ts +0 -1
  197. package/src/nile-table/nile-table.ts +2 -2
  198. package/src/nile-tooltip/nile-tooltip.css.ts +44 -77
  199. package/src/nile-tooltip/nile-tooltip.ts +230 -268
  200. package/vscode-html-custom-data.json +136 -92
  201. package/dist/fixture-d5b55278.cjs.js.map +0 -1
  202. package/dist/nile-tooltip/nile-tooltip-utils.cjs.js +0 -2
  203. package/dist/nile-tooltip/nile-tooltip-utils.cjs.js.map +0 -1
  204. package/dist/nile-tooltip/nile-tooltip-utils.esm.js +0 -1
  205. package/dist/nile-tooltip/nile-tooltip.test.cjs.js +0 -2
  206. package/dist/nile-tooltip/nile-tooltip.test.cjs.js.map +0 -1
  207. package/dist/nile-tooltip/nile-tooltip.test.esm.js +0 -47
  208. package/src/nile-tooltip/nile-tooltip-utils.ts +0 -271
  209. package/src/nile-tooltip/nile-tooltip.test.ts +0 -168
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Copyright Aquera Inc 2023
3
+ *
4
+ * This source code is licensed under the BSD-3-Clause license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { CSSResultArray, TemplateResult } from 'lit';
8
+ import NileElement from '../internal/nile-element';
9
+ /**
10
+ * Nile revan component.
11
+ *
12
+ * @tag nile-revan
13
+ *
14
+ */
15
+ export declare class NileRevan extends NileElement {
16
+ /**
17
+ * The styles for nile-revan
18
+ * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
19
+ */
20
+ static get styles(): CSSResultArray;
21
+ /**
22
+ * Render method
23
+ * @slot This is a slot test
24
+ */
25
+ render(): TemplateResult;
26
+ }
27
+ export default NileRevan;
28
+ declare global {
29
+ interface HTMLElementTagNameMap {
30
+ 'nile-revan': NileRevan;
31
+ }
32
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Copyright Aquera Inc 2023
3
+ *
4
+ * This source code is licensed under the BSD-3-Clause license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { __decorate } from "tslib";
8
+ import { html } from 'lit';
9
+ import { customElement } from 'lit/decorators.js';
10
+ import { styles } from './nile-revan.css';
11
+ import NileElement from '../internal/nile-element';
12
+ /**
13
+ * Nile revan component.
14
+ *
15
+ * @tag nile-revan
16
+ *
17
+ */
18
+ let NileRevan = class NileRevan extends NileElement {
19
+ /**
20
+ * The styles for nile-revan
21
+ * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
22
+ */
23
+ static get styles() {
24
+ return [styles];
25
+ }
26
+ /* #endregion */
27
+ /* #region Methods */
28
+ /**
29
+ * Render method
30
+ * @slot This is a slot test
31
+ */
32
+ render() {
33
+ return html `
34
+ <h1>Hi</h1>
35
+ `;
36
+ }
37
+ };
38
+ NileRevan = __decorate([
39
+ customElement('nile-revan')
40
+ ], NileRevan);
41
+ export { NileRevan };
42
+ export default NileRevan;
43
+ //# sourceMappingURL=nile-revan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nile-revan.js","sourceRoot":"","sources":["../../../src/nile-revan/nile-revan.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAa,IAAI,EAAiC,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,aAAa,EAAW,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AACxC,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAGnD;;;;;GAKG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,WAAW;IAEzC;;;OAGG;IACI,MAAM,KAAK,MAAM;QACvB,OAAO,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC;IAED,gBAAgB;IAEhB,qBAAqB;IAErB;;;OAGG;IACI,MAAM;QACZ,OAAO,IAAI,CAAA;;IAET,CAAC;IACJ,CAAC;CAGD,CAAA;AAzBY,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAyBrB;;AAED,eAAe,SAAS,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {LitElement, html, CSSResultArray, TemplateResult} from 'lit';\nimport { customElement, property} from 'lit/decorators.js';\nimport {styles} from './nile-revan.css';\nimport NileElement from '../internal/nile-element';\n\n\n/**\n * Nile revan component.\n *\n * @tag nile-revan\n *\n */\n@customElement('nile-revan')\nexport class NileRevan extends NileElement {\n\n\t/**\n\t * The styles for nile-revan\n\t * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n\t */\n\tpublic static get styles(): CSSResultArray {\n\t\treturn [styles];\n\t}\n\n\t/* #endregion */\n\n\t/* #region Methods */\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n\tpublic render(): TemplateResult {\n\t\treturn html`\n<h1>Hi</h1>\n\t\t\t`;\n\t}\n\n\t/* #endregion */\n}\n\nexport default NileRevan;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-revan': NileRevan;\n }\n}"]}
@@ -1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AAC,CAAA;QACH,CAAC,CAAC,CAAA;IACH,CAAC;IAED,sBAAsB,CAAC,GAAiB;QACvC,OAAO,GAAG,EAAE,UAAU,EAAE;YACvB,aAAa,CAAkB,kBAAkB,CAAC,EAAE;YACpD,gBAAgB,EAAE,CAAC,CAAC,CAAC;aACpB,UAAU,EAAE,aAAa,CAAkB,MAAM,CAAC,EAAE;YACrD,gBAAgB,EAAG,CAAA;IACrB,CAAC;IAED,oBAAoB;QACnB,MAAM,QAAQ,GAAG,CAAC,OAA6B,EAAO,EAAE;YACvD,KAAK,IAAI,KAAK,IAAI,OAAO,EAAE,CAAC;gBAC3B,IAAG,IAAI,CAAC,eAAe,EAAC,CAAC;oBACxB,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;gBACpC,CAAC;gBACD,IAAI,CAAC,eAAe,GAAC,UAAU,CAAC,GAAG,EAAE;oBACpC,IAAI,CAAC,gBAAgB,EAAE,CAAC;oBACxB,IAAI,CAAC,eAAe,GAAC,IAAI,CAAC;gBAC3B,CAAC,EAAE,EAAE,CAAC,CAAC;YACR,CAAC;QACF,CAAC,CAAC;QACF,IAAI,CAAC,cAAc,GAAC,IAAI,cAAc,CAAC,QAAQ,CAAC,CAAA;QAChD,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,oBAAoB;QACnB,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAA;QAChC,KAAK,CAAC,oBAAoB,EAAE,CAAA;IAC7B,CAAC;CAED,CAAA;AAhIgB;IAAd,KAAK,CAAC,MAAM,CAAC;8CAA8B;AADjC,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAiIrB;;AAED,eAAe,SAAS,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {LitElement, html, CSSResultArray, TemplateResult, PropertyValues} from 'lit';\nimport { customElement, property, query, state} from 'lit/decorators.js';\nimport {styles} from './nile-table.css';\nimport NileElement from '../internal/nile-element';\nimport { NileTableBody } from '../nile-table-body';\nimport { NileTableCellItem } from '../nile-table-cell-item';\nimport { NileTableHeaderItem } from '../nile-table-header-item';\n\n\n/**\n * Nile table component.\n *\n * @tag nile-table\n *\n */\n@customElement('nile-table')\nexport class NileTable extends NileElement {\n @query('slot') defaultSlot: HTMLSlotElement;\n\tprivate rows:Array<NileTableBody>=[];\n\tprivate primaryRowWidths:Array<number>=[]\n\tprivate resizeObserver:ResizeObserver ;\n\tprivate debounceTimeout:any\n\n\n\t/**\n\t * The styles for nile-table\n\t * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n\t */\n\tpublic static get styles(): CSSResultArray {\n\t\treturn [styles];\n\t}\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tthis.addEventListener('nile-body-load',this.handleRows)\n\t}\n\n\tprotected firstUpdated(_changedProperties: PropertyValues): void {\n\t\tthis.updateComplete.then(()=>{\n\t\t\tthis.handleResizeObserver();\n\t\t})\n\t}\n\n\n\t/* #endregion */\n\n\t/* #region Methods */\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n\tpublic render(): TemplateResult {\n\t\treturn html`\n\t\t\t<slot @slotchange=\"${this.repaintTable}\"></slot>\n\t\t\t`;\n\t}\n\n\trepaintTable(){\n\t\tthis.realignStructure();\n\t\tthis.handleBodyCssUpdate();\n\t}\n\n\thandleRows(e:CustomEvent){\n\t\tthis.rows=[...this.rows,e.detail.comp]\n\t}\n\n\thandleBodyCssUpdate(){\n if (this.rows.length<2) return;\n const tableBodies = this.rows;\n\t\tconst firstEl=tableBodies[0].shadowRoot?.querySelector<HTMLDivElement>('div.base');\n\t\tif(firstEl) {\n\t\t\tfirstEl.style.borderTopRightRadius=\"var(--nile-radius-radius-xl)\";\n\t\t\tfirstEl.style.borderTopLeftRadius = 'var(--nile-radius-radius-xl)';\n\t\t\tfirstEl.style.borderBottomRightRadius=\"0px\";\n\t\t\tfirstEl.style.borderBottomLeftRadius = '0px';\n\t\t\tfirstEl.style.borderBottom = 'none';\n\t\t}\n\t\ttableBodies.forEach((tb,i)=>{\n\t\t\tif(i>0 && i<tableBodies.length-1){\n\t\t\t\tconst el=tb.shadowRoot?.querySelector<HTMLDivElement>('div.base');\n\t\t\t\tif(el) {\n\t\t\t\t\tel.style.borderTopRightRadius=\"0px\";\n\t\t\t\t\tel.style.borderTopLeftRadius = \"0px\";\n\t\t\t\t\tel.style.borderBottomRightRadius=\"0px\";\n\t\t\t\t\tel.style.borderBottomLeftRadius = \"0px\";\n\t\t\t\t\tel.style.borderBottom = 'none';\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\tconst lastEl=tableBodies[tableBodies.length - 1].shadowRoot?.querySelector<HTMLDivElement>('div.base')\n\t\tif(lastEl){\n\t\t\tlastEl.style.borderTopRightRadius=\"0px\";\n\t\t\tlastEl.style.borderTopLeftRadius = '0px';\n\t\t\tlastEl.style.borderBottomRightRadius=\"var(--nile-radius-radius-xl)\";\n\t\t\tlastEl.style.borderBottomLeftRadius = 'var(--nile-radius-radius-xl)';\n\t\t}\n\t}\n\n\tgetPrimaryColumnWidths(){\n\t\tconst primaryTb=this.rows.find(tb=>tb.type=='primary')!;\n\t\tconst widthArray=this.getTableCellFetchQuery(primaryTb).map((e:LitElement)=>e.clientWidth) as Array<number>\n\t\treturn widthArray;\n\t}\n\t\n\trealignStructure(){\n if (this.rows.length<2) return;\n\t\tconst primaryRowWidths=this.getPrimaryColumnWidths();\n\t\tconst secondaryRows=this.rows.filter(tb=>tb.type!='primary');\n\t\tsecondaryRows.forEach((row)=>{\n\t\t\tlet elements=this.getTableCellFetchQuery(row)\n\t\t\telements?.forEach((el:NileTableCellItem|NileTableHeaderItem,ind)=>{\n\t\t\t\tel.style.setProperty('--cell-width',primaryRowWidths.at(ind)+'px')\n\t\t\t})\n\t\t})\n\t}\n\n\tgetTableCellFetchQuery(row:NileTableBody):Array<Element>{\n\t\treturn row?.shadowRoot?.\n\t\t\tquerySelector<HTMLSlotElement>('slot:not([name])')?.\n\t\t\tassignedElements()[0]\n\t\t\t.shadowRoot?.querySelector<HTMLSlotElement>('slot')?.\n\t\t\tassignedElements()!\n\t}\n\n\thandleResizeObserver(){\n\t\tconst onResize = (entries:ResizeObserverEntry[]): void=> {\n\t\t\tfor (let entry of entries) {\n\t\t\t\tif(this.debounceTimeout){\n\t\t\t\t\tclearTimeout(this.debounceTimeout);\n\t\t\t\t}\n\t\t\t\tthis.debounceTimeout=setTimeout(() => {\n\t\t\t\t\tthis.realignStructure();\n\t\t\t\t\tthis.debounceTimeout=null;\n\t\t\t\t}, 50);\n\t\t\t}\n\t\t};\n\t\tthis.resizeObserver=new ResizeObserver(onResize)\n\t\tthis.resizeObserver.observe(this);\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tthis.resizeObserver.disconnect()\n\t\tsuper.disconnectedCallback()\n\t}\n\t/* #endregion */\n}\n\nexport default NileTable;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-table': NileTable;\n }\n}"]}
1
+ {"version":3,"file":"nile-table.js","sourceRoot":"","sources":["../../../src/nile-table/nile-table.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAa,IAAI,EAAiD,MAAM,KAAK,CAAC;AACrF,OAAO,EAAE,aAAa,EAAY,KAAK,EAAQ,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AACxC,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAMnD;;;;;GAKG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,WAAW;IAAnC;;QAEE,SAAI,GAAsB,EAAE,CAAC;QAC7B,qBAAgB,GAAe,EAAE,CAAA;QA6HzC,gBAAgB;IACjB,CAAC;IAzHA;;;OAGG;IACI,MAAM,KAAK,MAAM;QACvB,OAAO,CAAC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AAC,GAAG,EAAE;oBACpC,IAAI,CAAC,gBAAgB,EAAE,CAAC;oBACxB,IAAI,CAAC,eAAe,GAAC,IAAI,CAAC;gBAC3B,CAAC,EAAE,EAAE,CAAC,CAAC;YACR,CAAC;QACF,CAAC,CAAC;QACF,IAAI,CAAC,cAAc,GAAC,IAAI,cAAc,CAAC,QAAQ,CAAC,CAAA;QAChD,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,oBAAoB;QACnB,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAA;QAChC,KAAK,CAAC,oBAAoB,EAAE,CAAA;IAC7B,CAAC;CAED,CAAA;AAhIgB;IAAd,KAAK,CAAC,MAAM,CAAC;8CAA8B;AADjC,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAiIrB;;AAED,eAAe,SAAS,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {LitElement, html, CSSResultArray, TemplateResult, PropertyValues} from 'lit';\nimport { customElement, property, query, state} from 'lit/decorators.js';\nimport {styles} from './nile-table.css';\nimport NileElement from '../internal/nile-element';\nimport { NileTableBody } from '../nile-table-body';\nimport { NileTableCellItem } from '../nile-table-cell-item';\nimport { NileTableHeaderItem } from '../nile-table-header-item';\n\n\n/**\n * Nile table component.\n *\n * @tag nile-table\n *\n */\n@customElement('nile-table')\nexport class NileTable extends NileElement {\n @query('slot') defaultSlot: HTMLSlotElement;\n\tprivate rows:Array<NileTableBody>=[];\n\tprivate primaryRowWidths:Array<number>=[]\n\tprivate resizeObserver:ResizeObserver ;\n\tprivate debounceTimeout:any\n\n\n\t/**\n\t * The styles for nile-table\n\t * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n\t */\n\tpublic static get styles(): CSSResultArray {\n\t\treturn [styles];\n\t}\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tthis.addEventListener('nile-body-load',this.handleRows)\n\t}\n\n\tprotected firstUpdated(_changedProperties: PropertyValues): void {\n\t\tthis.updateComplete.then(()=>{\n\t\t\tthis.handleResizeObserver();\n\t\t})\n\t}\n\n\n\t/* #endregion */\n\n\t/* #region Methods */\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n\tpublic render(): TemplateResult {\n\t\treturn html`\n\t\t\t<slot @slotchange=\"${this.repaintTable}\"></slot>\n\t\t\t`;\n\t}\n\n\trepaintTable(){\n\t\tthis.realignStructure();\n\t\tthis.handleBodyCssUpdate();\n\t}\n\n\thandleRows(e:CustomEvent){\n\t\tthis.rows=[...this.rows,e.detail.comp]\n\t}\n\n\thandleBodyCssUpdate(){\n if (this.rows.length<2) return;\n const tableBodies = this.rows;\n\t\tconst firstEl=tableBodies[0].shadowRoot?.querySelector<HTMLDivElement>('div.base')\n\t\tif(firstEl) {\n\t\t\tfirstEl.style.borderTopRightRadius=\"var(--nile-radius-radius-xl)\";\n\t\t\tfirstEl.style.borderTopLeftRadius = 'var(--nile-radius-radius-xl)';\n\t\t\tfirstEl.style.borderBottomRightRadius=\"0px\";\n\t\t\tfirstEl.style.borderBottomLeftRadius = '0px';\n\t\t\tfirstEl.style.borderBottom = 'none';\n\t\t}\n\t\ttableBodies.forEach((tb,i)=>{\n\t\t\tif(i>0 && i<tableBodies.length-1){\n\t\t\t\tconst el=tb.shadowRoot?.querySelector<HTMLDivElement>('div.base')\n\t\t\t\tif(el) {\n\t\t\t\t\tel.style.borderTopRightRadius=\"0px\";\n\t\t\t\t\tel.style.borderTopLeftRadius = \"0px\";\n\t\t\t\t\tel.style.borderBottomRightRadius=\"0px\";\n\t\t\t\t\tel.style.borderBottomLeftRadius = \"0px\";\n\t\t\t\t\tel.style.borderBottom = 'none';\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\tconst lastEl=tableBodies[tableBodies.length - 1].shadowRoot?.querySelector<HTMLDivElement>('div.base')\n\t\tif(lastEl){\n\t\t\tlastEl.style.borderTopRightRadius=\"0px\";\n\t\t\tlastEl.style.borderTopLeftRadius = '0px';\n\t\t\tlastEl.style.borderBottomRightRadius=\"var(--nile-radius-radius-xl)\";\n\t\t\tlastEl.style.borderBottomLeftRadius = 'var(--nile-radius-radius-xl)';\n\t\t}\n\t}\n\n\tgetPrimaryColumnWidths(){\n\t\tconst primaryTb=this.rows.find(tb=>tb.type=='primary')!;\n\t\tconst widthArray=this.getTableCellFetchQuery(primaryTb).map((e:LitElement)=>e.clientWidth) as Array<number>\n\t\treturn widthArray;\n\t}\n\t\n\trealignStructure(){\n if (this.rows.length<2) return;\n\t\tconst primaryRowWidths=this.getPrimaryColumnWidths();\n\t\tconst secondaryRows=this.rows.filter(tb=>tb.type!='primary');\n\t\tsecondaryRows.forEach((row)=>{\n\t\t\tlet elements=this.getTableCellFetchQuery(row)\n\t\t\telements?.forEach((el:NileTableCellItem|NileTableHeaderItem,ind)=>{\n\t\t\t\tel.style.setProperty('--cell-width',primaryRowWidths.at(ind)+'px')\n\t\t\t})\n\t\t})\n\t}\n\n\tgetTableCellFetchQuery(row:NileTableBody):Array<Element>{\n\t\treturn row?.shadowRoot?.\n\t\t\tquerySelector<HTMLSlotElement>('slot:not([name])')?.\n\t\t\tassignedElements()[0]\n\t\t\t.shadowRoot?.querySelector<HTMLSlotElement>('slot')?.\n\t\t\tassignedElements()!\n\t}\n\n\thandleResizeObserver(){\n\t\tconst onResize = (entries:ResizeObserverEntry[]): void=> {\n\t\t\tfor (let entry of entries) {\n\t\t\t\tif(this.debounceTimeout){\n\t\t\t\t\tclearTimeout(this.debounceTimeout);\n\t\t\t\t}\n\t\t\t\tthis.debounceTimeout=setTimeout(() => {\n\t\t\t\t\tthis.realignStructure();\n\t\t\t\t\tthis.debounceTimeout=null;\n\t\t\t\t}, 50);\n\t\t\t}\n\t\t};\n\t\tthis.resizeObserver=new ResizeObserver(onResize)\n\t\tthis.resizeObserver.observe(this);\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tthis.resizeObserver.disconnect()\n\t\tsuper.disconnectedCallback()\n\t}\n\t/* #endregion */\n}\n\nexport default NileTable;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-table': NileTable;\n }\n}"]}
@@ -0,0 +1 @@
1
+ export { NileTest } from './nile-test';
@@ -0,0 +1,2 @@
1
+ export { NileTest } from './nile-test';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nile-test/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export { NileTest } from './nile-test';"]}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright Aquera Inc 2023
3
+ *
4
+ * This source code is licensed under the BSD-3-Clause license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ /**
8
+ * Test CSS
9
+ */
10
+ export declare const styles: import("lit").CSSResult;
11
+ declare const _default: import("lit").CSSResult[];
12
+ export default _default;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright Aquera Inc 2023
3
+ *
4
+ * This source code is licensed under the BSD-3-Clause license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { css } from 'lit';
8
+ /**
9
+ * Test CSS
10
+ */
11
+ export const styles = css `
12
+ :host {
13
+
14
+ }
15
+ `;
16
+ export default [styles];
17
+ //# sourceMappingURL=nile-test.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nile-test.css.js","sourceRoot":"","sources":["../../../src/nile-test/nile-test.css.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAEF,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;CAIxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n* Copyright Aquera Inc 2023\n*\n* This source code is licensed under the BSD-3-Clause license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nimport {css} from 'lit';\n\n/**\n * Test CSS\n */\nexport const styles = css`\n\t:host {\n\n\t}\n`;\n\nexport default [styles];"]}
@@ -0,0 +1,34 @@
1
+ import { CSSResultArray, TemplateResult } from 'lit';
2
+ import NileElement from '../internal/nile-element';
3
+ /**
4
+ * Nile test component.
5
+ *
6
+ * @tag nile-test
7
+ *
8
+ */
9
+ export declare class NileTest extends NileElement {
10
+ /**
11
+ * The styles for nile-test
12
+ */
13
+ static get styles(): CSSResultArray;
14
+ label: string;
15
+ value: any;
16
+ editable: boolean;
17
+ closable: boolean;
18
+ icon: string;
19
+ removeIcon: string;
20
+ calendarOpen: boolean;
21
+ private handleChipClick;
22
+ private handleChipClose;
23
+ private handleDateSelect;
24
+ /**
25
+ * Render method
26
+ */
27
+ render(): TemplateResult;
28
+ }
29
+ export default NileTest;
30
+ declare global {
31
+ interface HTMLElementTagNameMap {
32
+ 'nile-test': NileTest;
33
+ }
34
+ }
@@ -0,0 +1,179 @@
1
+ import { __decorate } from "tslib";
2
+ import { html, css } from 'lit';
3
+ import { customElement, property, state } from 'lit/decorators.js';
4
+ import { styles } from './nile-test.css';
5
+ import NileElement from '../internal/nile-element';
6
+ /**
7
+ * Nile test component.
8
+ *
9
+ * @tag nile-test
10
+ *
11
+ */
12
+ let NileTest = class NileTest extends NileElement {
13
+ constructor() {
14
+ super(...arguments);
15
+ this.label = 'Default Label';
16
+ this.value = { text: 'Default Value', extraCount: 6, dates: [] };
17
+ this.editable = false;
18
+ this.closable = true;
19
+ this.icon = '';
20
+ this.removeIcon = '';
21
+ // This state will control whether the calendar is shown.
22
+ this.calendarOpen = false;
23
+ }
24
+ /**
25
+ * The styles for nile-test
26
+ */
27
+ static get styles() {
28
+ return [
29
+ styles,
30
+ css `
31
+ .chip-calendar-container {
32
+ position: relative;
33
+ display: inline-block;
34
+ }
35
+ .calendar {
36
+ position: absolute;
37
+ top: 100%;
38
+ left: 0;
39
+ margin-top: 4px;
40
+ background: #fff;
41
+ border: 1px solid #ccc;
42
+ padding: 8px;
43
+ z-index: 10;
44
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
45
+ }
46
+ `,
47
+ ];
48
+ }
49
+ /* #region Methods */
50
+ handleChipClick(e) {
51
+ console.log('Chip clicked:', e.detail);
52
+ // Instead of toggling, always open the calendar when the chip is clicked.
53
+ this.calendarOpen = true;
54
+ }
55
+ handleChipClose(e) {
56
+ console.log('Chip closed:', e.detail);
57
+ }
58
+ // Handle date selection from the calendar input
59
+ handleDateSelect(e) {
60
+ const input = e.target;
61
+ const selectedDate = input.value;
62
+ console.log('Date selected:', selectedDate);
63
+ // Update the chip's value by adding the selected date to the dates array
64
+ if (!this.value.dates) {
65
+ this.value = { ...this.value, dates: [] };
66
+ }
67
+ this.value.dates.push(selectedDate);
68
+ // Optionally update extraCount if needed
69
+ this.value.extraCount = this.value.dates.length - 1;
70
+ // Hide the calendar after selection
71
+ this.calendarOpen = false;
72
+ this.requestUpdate();
73
+ }
74
+ /**
75
+ * Render method
76
+ */
77
+ render() {
78
+ return html `
79
+ <div class="chip-calendar-container">
80
+ <nile-filter-chip
81
+ .label="${this.label}"
82
+ .value="${this.value}"
83
+ .editable="${this.editable}"
84
+ .closable="${this.closable}"
85
+ .icon="${this.icon}"
86
+ @nile-click="${this.handleChipClick}"
87
+ @nile-close="${this.handleChipClose}"
88
+ >
89
+ <span slot="icon">
90
+ <nile-icon name="calendar" size="10"></nile-icon>
91
+ </span>
92
+ </nile-filter-chip>
93
+ <nile-filter-chip
94
+ .label="${this.label}"
95
+ .value="${this.value}"
96
+ .editable="${this.editable}"
97
+ .closable="${this.closable}"
98
+ .icon="${this.icon}"
99
+ @nile-click="${this.handleChipClick}"
100
+ @nile-close="${this.handleChipClose}"
101
+ >
102
+ <span slot="icon">
103
+ <nile-icon name="calendar" size="10"></nile-icon>
104
+ </span>
105
+ </nile-filter-chip>
106
+
107
+ ${this.calendarOpen
108
+ ? html `
109
+ <div class="calendar">
110
+
111
+ <input type="date" @change="${this.handleDateSelect}" />
112
+ </div>
113
+ `
114
+ : ''}
115
+ </div>
116
+
117
+ <nile-input
118
+ .value="${this.label}"
119
+ label="Label"
120
+ @nile-change="${(e) => (this.label = e.detail.value)}"
121
+ ></nile-input>
122
+
123
+ <nile-input
124
+ .value="${this.value.text}"
125
+ label="Value"
126
+ @nile-change="${(e) => (this.value = { ...this.value, text: e.detail.value })}"
127
+ ></nile-input>
128
+
129
+ <nile-input
130
+ .value="${this.value.extraCount}"
131
+ label="Extra Count"
132
+ type="number"
133
+ @nile-change="${(e) => (this.value = {
134
+ ...this.value,
135
+ extraCount: parseInt(e.detail.value, 10) || 0,
136
+ })}"
137
+ ></nile-input>
138
+
139
+ <nile-checkbox
140
+ .checked="${this.editable}"
141
+ label="Editable"
142
+ @nile-change="${(e) => (this.editable = e.detail.checked)}"
143
+ ></nile-checkbox>
144
+
145
+ <nile-checkbox
146
+ .checked="${this.closable}"
147
+ label="Closable"
148
+ @nile-change="${(e) => (this.closable = e.detail.checked)}"
149
+ ></nile-checkbox>
150
+ `;
151
+ }
152
+ };
153
+ __decorate([
154
+ state()
155
+ ], NileTest.prototype, "label", void 0);
156
+ __decorate([
157
+ state()
158
+ ], NileTest.prototype, "value", void 0);
159
+ __decorate([
160
+ state()
161
+ ], NileTest.prototype, "editable", void 0);
162
+ __decorate([
163
+ state()
164
+ ], NileTest.prototype, "closable", void 0);
165
+ __decorate([
166
+ state()
167
+ ], NileTest.prototype, "icon", void 0);
168
+ __decorate([
169
+ property({ type: String })
170
+ ], NileTest.prototype, "removeIcon", void 0);
171
+ __decorate([
172
+ state()
173
+ ], NileTest.prototype, "calendarOpen", void 0);
174
+ NileTest = __decorate([
175
+ customElement('nile-test')
176
+ ], NileTest);
177
+ export { NileTest };
178
+ export default NileTest;
179
+ //# sourceMappingURL=nile-test.js.map
@@ -0,0 +1 @@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;;;kBAIvD,IAAI,CAAC,KAAK,CAAC,IAAI;;wBAET,CAAC,CAAc,EAAE,EAAE,CACjC,CAAC,IAAI,CAAC,KAAK,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;;;;kBAI9C,IAAI,CAAC,KAAK,CAAC,UAAU;;;wBAGf,CAAC,CAAc,EAAE,EAAE,CACjC,CAAC,IAAI,CAAC,KAAK,GAAG;YACZ,GAAG,IAAI,CAAC,KAAK;YACb,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC;SAC9C,CAAC;;;;oBAIQ,IAAI,CAAC,QAAQ;;wBAET,CAAC,CAAc,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;;;;oBAI1D,IAAI,CAAC,QAAQ;;wBAET,CAAC,CAAc,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;;KAEzE,CAAC;IACJ,CAAC;CACF,CAAA;AAzHU;IAAR,KAAK,EAAE;uCAAiC;AAChC;IAAR,KAAK,EAAE;uCAAkE;AACjE;IAAR,KAAK,EAAE;0CAA2B;AAC1B;IAAR,KAAK,EAAE;0CAA0B;AACzB;IAAR,KAAK,EAAE;sCAAmB;AACC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAiB;AAGnC;IAAR,KAAK,EAAE;8CAA+B;AAnC5B,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAoJpB;;AAED,eAAe,QAAQ,CAAC","sourcesContent":["import { LitElement, html, css, CSSResultArray, TemplateResult } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { styles } from './nile-test.css';\nimport NileElement from '../internal/nile-element';\n\n/**\n * Nile test component.\n *\n * @tag nile-test\n *\n */\n@customElement('nile-test')\nexport class NileTest extends NileElement {\n /**\n * The styles for nile-test\n */\n public static get styles(): CSSResultArray {\n return [\n styles,\n css`\n .chip-calendar-container {\n position: relative;\n display: inline-block;\n }\n .calendar {\n position: absolute;\n top: 100%;\n left: 0;\n margin-top: 4px;\n background: #fff;\n border: 1px solid #ccc;\n padding: 8px;\n z-index: 10;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n }\n `,\n ];\n }\n\n @state() label: string = 'Default Label';\n @state() value: any = { text: 'Default Value', extraCount: 6, dates: [] };\n @state() editable: boolean = false;\n @state() closable: boolean = true;\n @state() icon: string = '';\n @property({ type: String }) removeIcon = '';\n \n // This state will control whether the calendar is shown.\n @state() calendarOpen: boolean = false;\n\n /* #region Methods */\n\n private handleChipClick(e: CustomEvent) {\n console.log('Chip clicked:', e.detail);\n // Instead of toggling, always open the calendar when the chip is clicked.\n this.calendarOpen = true;\n }\n\n private handleChipClose(e: CustomEvent) {\n console.log('Chip closed:', e.detail);\n }\n\n // Handle date selection from the calendar input\n private handleDateSelect(e: Event) {\n const input = e.target as HTMLInputElement;\n const selectedDate = input.value;\n console.log('Date selected:', selectedDate);\n\n // Update the chip's value by adding the selected date to the dates array\n if (!this.value.dates) {\n this.value = { ...this.value, dates: [] };\n }\n this.value.dates.push(selectedDate);\n // Optionally update extraCount if needed\n this.value.extraCount = this.value.dates.length - 1;\n \n // Hide the calendar after selection\n this.calendarOpen = false;\n this.requestUpdate();\n }\n\n /**\n * Render method\n */\n public render(): TemplateResult {\n return html`\n <div class=\"chip-calendar-container\">\n <nile-filter-chip\n .label=\"${this.label}\"\n .value=\"${this.value}\"\n .editable=\"${this.editable}\"\n .closable=\"${this.closable}\"\n .icon=\"${this.icon}\"\n @nile-click=\"${this.handleChipClick}\"\n @nile-close=\"${this.handleChipClose}\"\n >\n <span slot=\"icon\">\n <nile-icon name=\"calendar\" size=\"10\"></nile-icon>\n </span>\n </nile-filter-chip>\n <nile-filter-chip\n .label=\"${this.label}\"\n .value=\"${this.value}\"\n .editable=\"${this.editable}\"\n .closable=\"${this.closable}\"\n .icon=\"${this.icon}\"\n @nile-click=\"${this.handleChipClick}\"\n @nile-close=\"${this.handleChipClose}\"\n >\n <span slot=\"icon\">\n <nile-icon name=\"calendar\" size=\"10\"></nile-icon>\n </span>\n </nile-filter-chip>\n\n ${this.calendarOpen\n ? html`\n <div class=\"calendar\">\n \n <input type=\"date\" @change=\"${this.handleDateSelect}\" />\n </div>\n `\n : ''}\n </div>\n\n <nile-input\n .value=\"${this.label}\"\n label=\"Label\"\n @nile-change=\"${(e: CustomEvent) => (this.label = e.detail.value)}\"\n ></nile-input>\n\n <nile-input\n .value=\"${this.value.text}\"\n label=\"Value\"\n @nile-change=\"${(e: CustomEvent) =>\n (this.value = { ...this.value, text: e.detail.value })}\"\n ></nile-input>\n\n <nile-input\n .value=\"${this.value.extraCount}\"\n label=\"Extra Count\"\n type=\"number\"\n @nile-change=\"${(e: CustomEvent) =>\n (this.value = {\n ...this.value,\n extraCount: parseInt(e.detail.value, 10) || 0,\n })}\"\n ></nile-input>\n\n <nile-checkbox\n .checked=\"${this.editable}\"\n label=\"Editable\"\n @nile-change=\"${(e: CustomEvent) => (this.editable = e.detail.checked)}\"\n ></nile-checkbox>\n\n <nile-checkbox\n .checked=\"${this.closable}\"\n label=\"Closable\"\n @nile-change=\"${(e: CustomEvent) => (this.closable = e.detail.checked)}\"\n ></nile-checkbox>\n `;\n }\n}\n\nexport default NileTest;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-test': NileTest;\n }\n}\n"]}
@@ -9,93 +9,60 @@ import { css } from 'lit';
9
9
  * Tooltip CSS
10
10
  */
11
11
  export const styles = css `
12
+ :host {
13
+ --max-width: 20rem;
14
+ --hide-delay: 0ms;
15
+ --show-delay: 150ms;
12
16
 
13
-
14
- :host {
15
- position: relative;
16
- display: inline-block;
17
- }
18
- .tooltip {
19
- position: fixed;
20
- z-index: 1000;
21
- background-color: var(--nile-tooltip-color-background, #333);
22
- color: var(--nile-colors-white-base, #fff);
23
- padding: 6px 10px;
24
- border-radius: 4px;
25
- font-size: var(--nile-tooltip-font-size-sm, 14px);
26
- line-height: var(--nile-tooltip-line-height-sm, 1.5);
27
- opacity: 0;
28
- transition: opacity 0.2s, transform 0.2s;
29
- pointer-events: none;
30
- white-space: normal;
31
- visibility: hidden;
32
- overflow: visible;
33
-
34
- }
35
- :host([open]) .tooltip {
36
- opacity: 1;
37
- visibility: visible;
38
- pointer-events: auto;
39
- }
40
- .tooltip-content {
41
- overflow: auto;
42
- max-width: 250px;
43
- max-height: 116px;
44
- }
45
- .tooltip-caret {
46
- position: absolute;
47
- width: calc(2 * var(--caret-size, 6px));
48
- height: calc(2 * var(--caret-size, 6px));
49
- background-color: inherit;
50
- transform: rotate(45deg);
51
- z-index: -1;
52
- }
53
- .trigger-container {
54
- display: inline-block;
55
- }
56
-
57
-
58
- :host([open]) .tooltip {
59
- visibility: visible;
60
- pointer-events: auto;
61
- animation: fadeIn 150ms forwards;
62
- }
63
-
64
-
65
- .tooltip.hide {
66
- animation: fadeOut 100ms forwards;
67
- }
68
-
69
-
70
- @keyframes fadeIn {
71
- from {
72
- opacity: 0;
73
- transform: translateY(5px);
17
+ display: contents;
74
18
  }
75
- to {
76
- opacity: 1;
77
- transform: translateY(0);
78
- }
79
- }
80
19
 
81
-
82
- @keyframes fadeOut {
83
- from {
84
- opacity: 1;
85
- transform: translateY(0);
20
+ .tooltip {
21
+ --arrow-size: 6px;
22
+ --arrow-color: var(--nile-tooltip-color-background);
86
23
  }
87
- to {
88
- opacity: 0;
89
- transform: translateY(5px);
24
+
25
+ .tooltip::part(popup) {
26
+ pointer-events: none;
27
+ z-index: 1000;
90
28
  }
91
- }
92
29
 
30
+ .tooltip[placement^='top']::part(popup) {
31
+ transform-origin: bottom;
32
+ }
93
33
 
34
+ .tooltip[placement^='bottom']::part(popup) {
35
+ transform-origin: top;
36
+ }
94
37
 
38
+ .tooltip[placement^='left']::part(popup) {
39
+ transform-origin: right;
40
+ }
95
41
 
42
+ .tooltip[placement^='right']::part(popup) {
43
+ transform-origin: left;
44
+ }
96
45
 
46
+ .tooltip__body {
47
+ display: block;
48
+ width: max-content;
49
+ max-width: var(--max-width);
50
+ border-radius: 4px;
51
+ background-color: var(--nile-tooltip-color-background);
52
+ font-size: var(--nile-tooltip-font-size-sm);
53
+ font-weight: var(--nile-tooltip-font-weight-sm);
54
+ line-height: var(--nile-tooltip-line-height-sm);
55
+ padding: var(--nile-tooltip-padding-y) var(--nile-tooltip-padding-x);
56
+ color: var(--nile-colors-white-base);
57
+ pointer-events: none;
58
+ word-break: break-word;
59
+ }
97
60
 
98
-
61
+ .tooltip__body--large {
62
+ font-size: var(--nile-tooltip-font-size-lg);
63
+ line-height: var(--nile-tooltip-line-height-lg);
64
+ font-weight: var(--nile-tooltip-font-weight-lg);
65
+ }
99
66
  `;
100
67
  export default [styles];
101
68
  //# sourceMappingURL=nile-tooltip.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-tooltip.css.js","sourceRoot":"","sources":["../../../src/nile-tooltip/nile-tooltip.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwFxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\n/**\n * 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-content {\n overflow: auto;\n max-width: 250px;\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:host([open]) .tooltip {\n visibility: visible;\n pointer-events: auto;\n animation: fadeIn 150ms forwards;\n}\n\n \n.tooltip.hide {\n animation: fadeOut 100ms forwards;\n}\n\n \n@keyframes fadeIn {\n from {\n opacity: 0;\n transform: translateY(5px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n \n@keyframes fadeOut {\n from {\n opacity: 1;\n transform: translateY(0);\n }\n to {\n opacity: 0;\n transform: translateY(5px);\n }\n}\n\n\n\n\n\n\n \n`;\n\nexport default [styles];"]}
1
+ {"version":3,"file":"nile-tooltip.css.js","sourceRoot":"","sources":["../../../src/nile-tooltip/nile-tooltip.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\n/**\n * 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"]}
@@ -4,53 +4,75 @@
4
4
  * This source code is licensed under the BSD-3-Clause license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import { CSSResultArray } from 'lit';
7
+ import { CSSResultArray, TemplateResult } from 'lit';
8
+ import '../nile-popup/nile-popup';
8
9
  import NileElement from '../internal/nile-element';
10
+ import type NilePopup from '../nile-popup/nile-popup';
9
11
  /**
10
- * Nile tooltip component.
12
+ * Nile icon component.
11
13
  *
12
14
  * @tag nile-tooltip
13
15
  *
14
16
  */
15
17
  export declare class NileTooltip extends NileElement {
18
+ /**
19
+ * The styles for Tooltip
20
+ * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
21
+ */
22
+ static get styles(): CSSResultArray;
23
+ private hoverTimeout;
24
+ defaultSlot: HTMLSlotElement;
25
+ body: HTMLElement;
26
+ popup: NilePopup;
27
+ /** The tooltip's content. If you need to display HTML, use the `content` slot instead. */
16
28
  content: string;
29
+ /** Size Property to decide the tool tip size */
30
+ size: 'small' | 'large';
31
+ /**
32
+ * The preferred placement of the tooltip. Note that the actual placement may vary as needed to keep the tooltip
33
+ * inside of the viewport.
34
+ */
17
35
  placement: 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
36
+ /** Disables the tooltip so it won't show when triggered. */
18
37
  disabled: boolean;
38
+ /** The distance in pixels from which to offset the tooltip away from its target. */
39
+ distance: number;
40
+ /** Indicates whether or not the tooltip is open. You can use this in lieu of the show/hide methods. */
19
41
  open: boolean;
42
+ /** The distance in pixels from which to offset the tooltip along its target. */
43
+ skidding: number;
20
44
  /**
21
45
  * Controls how the tooltip is activated. Possible options include `click`, `hover`, `focus`, and `manual`. Multiple
22
46
  * options can be passed by separating them with a space. When manual is used, the tooltip must be activated
23
47
  * programmatically.
24
48
  */
25
49
  trigger: string;
26
- distance: number;
27
- private readonly SHIFT_OFFSET;
28
- /** The distance in pixels from which to offset the tooltip along its target. */
29
- skidding: number;
50
+ /**
51
+ * Enable this option to prevent the tooltip from being clipped when the component is placed inside a container with
52
+ * `overflow: auto|hidden|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all,
53
+ * scenarios.
54
+ */
30
55
  hoist: boolean;
31
- tooltip: HTMLElement;
32
- triggerContainer: HTMLElement;
33
- caret: HTMLElement;
34
- tooltipSlot: HTMLSlotElement;
35
- private hasTooltipSlot;
36
- private hoverTimeout;
37
- private caretSize;
38
- private originalPlacement;
39
- static get styles(): CSSResultArray;
40
56
  connectedCallback(): void;
41
- updated(changedProps: Map<string, unknown>): void;
57
+ firstUpdated(): void;
42
58
  disconnectedCallback(): void;
43
- private handleTooltipSlotChange;
44
- private updateTooltipPosition;
45
- private showTooltip;
46
- private hideTooltip;
47
- private handleMouseOver;
48
- private handleMouseOut;
59
+ private handleBlur;
49
60
  private handleClick;
50
61
  private handleFocus;
51
- private handleBlur;
52
- render(): import("lit-html").TemplateResult<1>;
62
+ private handleKeyDown;
63
+ private handleMouseOver;
64
+ private handleMouseOut;
65
+ private hasTrigger;
66
+ handleOpenChange(): Promise<void>;
67
+ handleOptionsChange(): Promise<void>;
68
+ handleDisabledChange(): void;
69
+ /** Shows the tooltip. */
70
+ show(): Promise<void>;
71
+ /** Hides the tooltip */
72
+ hide(): Promise<void>;
73
+ render(): TemplateResult<1>;
53
74
  }
75
+ export default NileTooltip;
54
76
  declare global {
55
77
  interface HTMLElementTagNameMap {
56
78
  'nile-tooltip': NileTooltip;