@aquera/nile-elements 0.0.30 → 0.0.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 (222) hide show
  1. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.d.ts +2 -0
  2. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js +2 -0
  3. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js.map +1 -1
  4. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button/nile-button.css.js +2 -2
  5. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button/nile-button.css.js.map +1 -1
  6. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/nile-button-toggle.css.js +12 -0
  7. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/nile-button-toggle.css.js.map +1 -1
  8. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.js +1 -3
  9. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.js.map +1 -1
  10. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/extensionSetup.d.ts +33 -0
  11. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/extensionSetup.js +63 -0
  12. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/extensionSetup.js.map +1 -0
  13. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/index.d.ts +1 -0
  14. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/index.js +2 -0
  15. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/index.js.map +1 -0
  16. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.css.d.ts +12 -0
  17. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.css.js +42 -0
  18. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.css.js.map +1 -0
  19. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.d.ts +43 -0
  20. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.js +114 -0
  21. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.js.map +1 -0
  22. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-dialog/nile-dialog.js +0 -6
  23. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-dialog/nile-dialog.js.map +1 -1
  24. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.css.js +5 -0
  25. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.css.js.map +1 -1
  26. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.js +5 -2
  27. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.js.map +1 -1
  28. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon-button/nile-icon-button.d.ts +4 -0
  29. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon-button/nile-icon-button.js +16 -2
  30. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon-button/nile-icon-button.js.map +1 -1
  31. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.css.js +4 -0
  32. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.css.js.map +1 -1
  33. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.js +4 -4
  34. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.js.map +1 -1
  35. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.d.ts +1 -0
  36. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js +9 -0
  37. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js.map +1 -1
  38. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js +11 -0
  39. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
  40. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.d.ts +11 -5
  41. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js +55 -7
  42. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js.map +1 -1
  43. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab/nile-tab.css.js +1 -0
  44. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab/nile-tab.css.js.map +1 -1
  45. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab/nile-tab.js +1 -0
  46. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab/nile-tab.js.map +1 -1
  47. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.css.js +4 -1
  48. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.css.js.map +1 -1
  49. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.js +5 -0
  50. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.js.map +1 -1
  51. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/index.d.ts +1 -0
  52. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/index.js +2 -0
  53. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/index.js.map +1 -0
  54. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/nile-toast.css.d.ts +12 -0
  55. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/nile-toast.css.js +174 -0
  56. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/nile-toast.css.js.map +1 -0
  57. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/nile-toast.d.ts +88 -0
  58. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/nile-toast.js +350 -0
  59. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/nile-toast.js.map +1 -0
  60. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
  61. package/dist/index.cjs.js +1 -1
  62. package/dist/index.esm.js +1 -1
  63. package/dist/index.iife.js +672 -351
  64. package/dist/nile-button/nile-button.css.cjs.js +1 -1
  65. package/dist/nile-button/nile-button.css.cjs.js.map +1 -1
  66. package/dist/nile-button/nile-button.css.esm.js +2 -2
  67. package/dist/nile-button-toggle/nile-button-toggle.css.cjs.js +1 -1
  68. package/dist/nile-button-toggle/nile-button-toggle.css.cjs.js.map +1 -1
  69. package/dist/nile-button-toggle/nile-button-toggle.css.esm.js +12 -0
  70. package/dist/nile-calendar/index.cjs.js +1 -1
  71. package/dist/nile-calendar/index.esm.js +1 -1
  72. package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
  73. package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
  74. package/dist/nile-calendar/nile-calendar.esm.js +4 -6
  75. package/dist/nile-calendar/timezones.cjs.js +1 -1
  76. package/dist/nile-calendar/timezones.cjs.js.map +1 -1
  77. package/dist/nile-calendar/timezones.esm.js +1 -1
  78. package/dist/nile-code-editor/extensionSetup.cjs.js +7 -0
  79. package/dist/nile-code-editor/extensionSetup.cjs.js.map +1 -0
  80. package/dist/nile-code-editor/extensionSetup.esm.js +1 -0
  81. package/dist/nile-code-editor/index.cjs.js +2 -0
  82. package/dist/nile-code-editor/index.cjs.js.map +1 -0
  83. package/dist/nile-code-editor/index.esm.js +1 -0
  84. package/dist/nile-code-editor/nile-code-editor.cjs.js +3 -0
  85. package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -0
  86. package/dist/nile-code-editor/nile-code-editor.css.cjs.js +2 -0
  87. package/dist/nile-code-editor/nile-code-editor.css.cjs.js.map +1 -0
  88. package/dist/nile-code-editor/nile-code-editor.css.esm.js +30 -0
  89. package/dist/nile-code-editor/nile-code-editor.esm.js +9 -0
  90. package/dist/nile-dialog/nile-dialog.cjs.js.map +1 -1
  91. package/dist/nile-error-message/nile-error-message.cjs.js +1 -1
  92. package/dist/nile-error-message/nile-error-message.cjs.js.map +1 -1
  93. package/dist/nile-error-message/nile-error-message.css.cjs.js +1 -1
  94. package/dist/nile-error-message/nile-error-message.css.cjs.js.map +1 -1
  95. package/dist/nile-error-message/nile-error-message.css.esm.js +5 -0
  96. package/dist/nile-error-message/nile-error-message.esm.js +6 -4
  97. package/dist/nile-icon-button/nile-icon-button.cjs.js +1 -1
  98. package/dist/nile-icon-button/nile-icon-button.cjs.js.map +1 -1
  99. package/dist/nile-icon-button/nile-icon-button.esm.js +5 -2
  100. package/dist/nile-input/nile-input.cjs.js +1 -1
  101. package/dist/nile-input/nile-input.cjs.js.map +1 -1
  102. package/dist/nile-input/nile-input.css.cjs.js +1 -1
  103. package/dist/nile-input/nile-input.css.cjs.js.map +1 -1
  104. package/dist/nile-input/nile-input.css.esm.js +4 -0
  105. package/dist/nile-input/nile-input.esm.js +2 -2
  106. package/dist/nile-select/nile-select.cjs.js +1 -1
  107. package/dist/nile-select/nile-select.cjs.js.map +1 -1
  108. package/dist/nile-select/nile-select.esm.js +2 -2
  109. package/dist/nile-switcher/index.cjs.js +1 -1
  110. package/dist/nile-switcher/index.esm.js +1 -1
  111. package/dist/nile-switcher/nile-switcher.cjs.js +1 -1
  112. package/dist/nile-switcher/nile-switcher.cjs.js.map +1 -1
  113. package/dist/nile-switcher/nile-switcher.css.cjs.js +1 -1
  114. package/dist/nile-switcher/nile-switcher.css.cjs.js.map +1 -1
  115. package/dist/nile-switcher/nile-switcher.css.esm.js +13 -2
  116. package/dist/nile-switcher/nile-switcher.esm.js +38 -30
  117. package/dist/nile-tab/nile-tab.cjs.js +1 -1
  118. package/dist/nile-tab/nile-tab.cjs.js.map +1 -1
  119. package/dist/nile-tab/nile-tab.css.cjs.js +1 -1
  120. package/dist/nile-tab/nile-tab.css.cjs.js.map +1 -1
  121. package/dist/nile-tab/nile-tab.css.esm.js +1 -0
  122. package/dist/nile-tab/nile-tab.esm.js +1 -0
  123. package/dist/nile-textarea/nile-textarea.cjs.js +1 -1
  124. package/dist/nile-textarea/nile-textarea.cjs.js.map +1 -1
  125. package/dist/nile-textarea/nile-textarea.css.cjs.js +1 -1
  126. package/dist/nile-textarea/nile-textarea.css.cjs.js.map +1 -1
  127. package/dist/nile-textarea/nile-textarea.css.esm.js +4 -1
  128. package/dist/nile-textarea/nile-textarea.esm.js +3 -1
  129. package/dist/nile-toast/index.cjs.js +2 -0
  130. package/dist/nile-toast/index.cjs.js.map +1 -0
  131. package/dist/nile-toast/index.esm.js +1 -0
  132. package/dist/nile-toast/nile-toast.cjs.js +2 -0
  133. package/dist/nile-toast/nile-toast.cjs.js.map +1 -0
  134. package/dist/nile-toast/nile-toast.css.cjs.js +2 -0
  135. package/dist/nile-toast/nile-toast.css.cjs.js.map +1 -0
  136. package/dist/nile-toast/nile-toast.css.esm.js +162 -0
  137. package/dist/nile-toast/nile-toast.esm.js +74 -0
  138. package/dist/src/index.d.ts +2 -0
  139. package/dist/src/index.js +2 -0
  140. package/dist/src/index.js.map +1 -1
  141. package/dist/src/nile-button/nile-button.css.js +2 -2
  142. package/dist/src/nile-button/nile-button.css.js.map +1 -1
  143. package/dist/src/nile-button-toggle/nile-button-toggle.css.js +12 -0
  144. package/dist/src/nile-button-toggle/nile-button-toggle.css.js.map +1 -1
  145. package/dist/src/nile-calendar/nile-calendar.js +1 -3
  146. package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
  147. package/dist/src/nile-code-editor/extensionSetup.d.ts +33 -0
  148. package/dist/src/nile-code-editor/extensionSetup.js +63 -0
  149. package/dist/src/nile-code-editor/extensionSetup.js.map +1 -0
  150. package/dist/src/nile-code-editor/index.d.ts +1 -0
  151. package/dist/src/nile-code-editor/index.js +2 -0
  152. package/dist/src/nile-code-editor/index.js.map +1 -0
  153. package/dist/src/nile-code-editor/nile-code-editor.css.d.ts +12 -0
  154. package/dist/src/nile-code-editor/nile-code-editor.css.js +42 -0
  155. package/dist/src/nile-code-editor/nile-code-editor.css.js.map +1 -0
  156. package/dist/src/nile-code-editor/nile-code-editor.d.ts +43 -0
  157. package/dist/src/nile-code-editor/nile-code-editor.js +114 -0
  158. package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -0
  159. package/dist/src/nile-dialog/nile-dialog.js +0 -6
  160. package/dist/src/nile-dialog/nile-dialog.js.map +1 -1
  161. package/dist/src/nile-error-message/nile-error-message.css.js +5 -0
  162. package/dist/src/nile-error-message/nile-error-message.css.js.map +1 -1
  163. package/dist/src/nile-error-message/nile-error-message.js +5 -2
  164. package/dist/src/nile-error-message/nile-error-message.js.map +1 -1
  165. package/dist/src/nile-icon-button/nile-icon-button.d.ts +4 -0
  166. package/dist/src/nile-icon-button/nile-icon-button.js +16 -2
  167. package/dist/src/nile-icon-button/nile-icon-button.js.map +1 -1
  168. package/dist/src/nile-input/nile-input.css.js +4 -0
  169. package/dist/src/nile-input/nile-input.css.js.map +1 -1
  170. package/dist/src/nile-input/nile-input.js +4 -4
  171. package/dist/src/nile-input/nile-input.js.map +1 -1
  172. package/dist/src/nile-select/nile-select.d.ts +1 -0
  173. package/dist/src/nile-select/nile-select.js +9 -0
  174. package/dist/src/nile-select/nile-select.js.map +1 -1
  175. package/dist/src/nile-switcher/nile-switcher.css.js +11 -0
  176. package/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
  177. package/dist/src/nile-switcher/nile-switcher.d.ts +11 -5
  178. package/dist/src/nile-switcher/nile-switcher.js +55 -7
  179. package/dist/src/nile-switcher/nile-switcher.js.map +1 -1
  180. package/dist/src/nile-tab/nile-tab.css.js +1 -0
  181. package/dist/src/nile-tab/nile-tab.css.js.map +1 -1
  182. package/dist/src/nile-tab/nile-tab.js +1 -0
  183. package/dist/src/nile-tab/nile-tab.js.map +1 -1
  184. package/dist/src/nile-textarea/nile-textarea.css.js +4 -1
  185. package/dist/src/nile-textarea/nile-textarea.css.js.map +1 -1
  186. package/dist/src/nile-textarea/nile-textarea.js +5 -0
  187. package/dist/src/nile-textarea/nile-textarea.js.map +1 -1
  188. package/dist/src/nile-toast/index.d.ts +1 -0
  189. package/dist/src/nile-toast/index.js +2 -0
  190. package/dist/src/nile-toast/index.js.map +1 -0
  191. package/dist/src/nile-toast/nile-toast.css.d.ts +12 -0
  192. package/dist/src/nile-toast/nile-toast.css.js +174 -0
  193. package/dist/src/nile-toast/nile-toast.css.js.map +1 -0
  194. package/dist/src/nile-toast/nile-toast.d.ts +88 -0
  195. package/dist/src/nile-toast/nile-toast.js +350 -0
  196. package/dist/src/nile-toast/nile-toast.js.map +1 -0
  197. package/dist/tsconfig.tsbuildinfo +1 -1
  198. package/package.json +1 -1
  199. package/src/index.ts +3 -1
  200. package/src/nile-button/nile-button.css.ts +2 -2
  201. package/src/nile-button-toggle/nile-button-toggle.css.ts +12 -0
  202. package/src/nile-calendar/nile-calendar.ts +1 -5
  203. package/src/nile-code-editor/extensionSetup.ts +125 -0
  204. package/src/nile-code-editor/index.ts +1 -0
  205. package/src/nile-code-editor/nile-code-editor.css.ts +44 -0
  206. package/src/nile-code-editor/nile-code-editor.ts +127 -0
  207. package/src/nile-dialog/nile-dialog.ts +0 -6
  208. package/src/nile-error-message/nile-error-message.css.ts +5 -0
  209. package/src/nile-error-message/nile-error-message.ts +6 -2
  210. package/src/nile-icon-button/nile-icon-button.ts +24 -5
  211. package/src/nile-input/nile-input.css.ts +4 -0
  212. package/src/nile-input/nile-input.ts +6 -6
  213. package/src/nile-select/nile-select.ts +9 -0
  214. package/src/nile-switcher/nile-switcher.css.ts +11 -0
  215. package/src/nile-switcher/nile-switcher.ts +70 -10
  216. package/src/nile-tab/nile-tab.css.ts +1 -0
  217. package/src/nile-tab/nile-tab.ts +1 -0
  218. package/src/nile-textarea/nile-textarea.css.ts +4 -1
  219. package/src/nile-textarea/nile-textarea.ts +6 -1
  220. package/src/nile-toast/index.ts +1 -0
  221. package/src/nile-toast/nile-toast.css.ts +176 -0
  222. package/src/nile-toast/nile-toast.ts +381 -0
@@ -1 +1 @@
1
- {"version":3,"file":"nile-switcher.css.js","sourceRoot":"","sources":["../../../src/nile-switcher/nile-switcher.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgExB,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-element';\n\n/**\n * FieldGenerator CSS\n */\nexport const styles = css`\n :host {\n width: 100%;\n box-sizing: border-box;\n }\n\n .switcher-icon-container {\n cursor: pointer;\n justify-content: center;\n display: flex;\n align-items: center;\n margin-bottom: 6px;\n height: 28px;\n width: 28px;\n border-radius: 4px;\n }\n\n .switcher-icon-container.current {\n background: var(--nile-colors-blue-400);\n }\n\n .switcher-input-container {\n display: flex;\n }\n\n .switcher-inline {\n gap: 0.5rem;\n }\n\n .switcher-block {\n flex-direction: column;\n }\n\n .switcher-block > :first-child {\n align-self: end;\n }\n\n .switcher-inline > :nth-child(2) {\n flex: 1;\n }\n\n .switcher-input-container > :first-child {\n display: flex;\n gap: 0.5rem;\n max-height: 38px;\n align-items: center;\n }\n\n nile-radio {\n display: inline-block;\n padding-right: 10px;\n }\n\n .switcher-object-mapper::part(input) {\n color: var(--nile-colors-primary-600);\n cursor: pointer;\n }\n\n .switcher-input--noborder::part(base) {\n border: none;\n }\n .switcher-object-mapper--noborder::part(base) {\n border: none;\n }\n`;\n\nexport default [styles];\n"]}
1
+ {"version":3,"file":"nile-switcher.css.js","sourceRoot":"","sources":["../../../src/nile-switcher/nile-switcher.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2ExB,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-element';\n\n/**\n * FieldGenerator CSS\n */\nexport const styles = css`\n :host {\n width: 100%;\n box-sizing: border-box;\n }\n\n .switcher-icon-container {\n cursor: pointer;\n justify-content: center;\n display: flex;\n align-items: center;\n margin-bottom: 6px;\n height: 28px;\n width: 28px;\n border-radius: 4px;\n }\n\n .switcher-icon-container.current {\n background: var(--nile-colors-blue-400);\n }\n\n .switcher-input-container {\n display: flex;\n }\n\n .switcher-inline {\n gap: 0.5rem;\n }\n\n .switcher-block {\n flex-direction: column;\n }\n\n .switcher-block > :first-child {\n align-self: end;\n }\n\n .switcher-inline > :nth-child(2) {\n flex: 1;\n }\n\n .switcher-input-container > :first-child {\n display: flex;\n gap: 0.5rem;\n max-height: 38px;\n align-items: center;\n }\n\n nile-radio {\n display: inline-block;\n padding-right: 10px;\n }\n\n nile-code-editor {\n overflow: hidden;\n padding-top: 2px;\n border-radius: 5px;\n border: 1px solid rgb(204, 204, 204);\n }\n\n .code-editor__no-border {\n border: none;\n }\n\n .switcher-object-mapper::part(input) {\n color: var(--nile-colors-primary-600);\n cursor: pointer;\n }\n\n .switcher-input--noborder::part(base) {\n border: none;\n }\n .switcher-object-mapper--noborder::part(base) {\n border: none;\n }\n`;\n\nexport default [styles];\n"]}
@@ -24,16 +24,14 @@ export interface switchconfig {
24
24
  toggleSwitch: boolean;
25
25
  disable?: boolean;
26
26
  confirmation?: boolean;
27
- current: number;
28
27
  align: 'block' | 'inline';
29
28
  inputs: switchInputType[];
30
29
  }
31
30
  export interface switchInputType {
32
- inputType: INPUT_TYPE_NAMES.DROPDOWN | INPUT_TYPE_NAMES.TEXT | INPUT_TYPE_NAMES.CHECKBOX | INPUT_TYPE_NAMES.TEXTAREA | INPUT_TYPE_NAMES.RADIO | INPUT_TYPE_NAMES.CONTENTEDITOR | INPUT_TYPE_NAMES.OBJECT_MAPPER;
31
+ inputType: INPUT_TYPE_NAMES.DROPDOWN | INPUT_TYPE_NAMES.TEXT | INPUT_TYPE_NAMES.CHECKBOX | INPUT_TYPE_NAMES.TEXTAREA | INPUT_TYPE_NAMES.RADIO | INPUT_TYPE_NAMES.CONTENTEDITOR | INPUT_TYPE_NAMES.OBJECT_MAPPER | INPUT_TYPE_NAMES.CODE_EDITOR;
33
32
  value?: String | boolean;
34
33
  label?: String;
35
34
  readonly?: boolean;
36
- order: number;
37
35
  type?: string;
38
36
  icon: string;
39
37
  mode?: string;
@@ -46,6 +44,8 @@ export interface switchInputType {
46
44
  helperText?: string;
47
45
  multiple?: boolean;
48
46
  noborder?: boolean;
47
+ multiLine?: boolean;
48
+ expand?: boolean;
49
49
  }
50
50
  export declare enum POSITIONS {
51
51
  INLINE = "inline",
@@ -62,7 +62,8 @@ export declare enum INPUT_TYPE_NAMES {
62
62
  TEXTAREA = "text-area",
63
63
  RADIO = "radio",
64
64
  CONTENTEDITOR = "content-editor",
65
- OBJECT_MAPPER = "object-mapper"
65
+ OBJECT_MAPPER = "object-mapper",
66
+ CODE_EDITOR = "code-editor"
66
67
  }
67
68
  export declare enum MODE {
68
69
  CREATE = "create",
@@ -75,8 +76,11 @@ export declare class NileSwitcher extends NileElement {
75
76
  */
76
77
  static styles: CSSResultGroup;
77
78
  nileSwitchConfig: switchconfig;
79
+ current: Number;
78
80
  currentInput: switchInputType;
79
81
  connectedCallback(): void;
82
+ handleSwitcherChange(): void;
83
+ setCurrentInput(): void;
80
84
  disconnectedCallback(): void;
81
85
  renderNileText(Input: switchInputType): TemplateResult<1>;
82
86
  renderDropdown(Input: switchInputType): TemplateResult<1>;
@@ -86,9 +90,11 @@ export declare class NileSwitcher extends NileElement {
86
90
  renderErrorMessage(errorMessage: string): TemplateResult<1>;
87
91
  renderContentEditor(Input: switchInputType): TemplateResult<1>;
88
92
  renderObjectMapper(): TemplateResult<1>;
93
+ renderCodeEditor(Input: switchInputType): TemplateResult<1>;
94
+ handleExpand(event: CustomEvent, inputType: string): void;
89
95
  handleChange(event: CustomEvent, inputType: string): void;
90
96
  renderIcon(): TemplateResult<1>;
91
- toggleField(currentInput: switchInputType): void;
97
+ toggleField(currentInput: switchInputType, index: Number): void;
92
98
  singleFieldSwitcher(): TemplateResult<1>;
93
99
  render(): TemplateResult;
94
100
  }
@@ -12,6 +12,7 @@ import NileElement from '../internal/nile-element';
12
12
  import { choose } from 'lit/directives/choose.js';
13
13
  import { classMap } from 'lit/directives/class-map.js';
14
14
  import { repeat } from 'lit/directives/repeat.js';
15
+ import { watch } from '../internal/watch';
15
16
  export var POSITIONS;
16
17
  (function (POSITIONS) {
17
18
  POSITIONS["INLINE"] = "inline";
@@ -31,6 +32,7 @@ export var INPUT_TYPE_NAMES;
31
32
  INPUT_TYPE_NAMES["RADIO"] = "radio";
32
33
  INPUT_TYPE_NAMES["CONTENTEDITOR"] = "content-editor";
33
34
  INPUT_TYPE_NAMES["OBJECT_MAPPER"] = "object-mapper";
35
+ INPUT_TYPE_NAMES["CODE_EDITOR"] = "code-editor";
34
36
  })(INPUT_TYPE_NAMES || (INPUT_TYPE_NAMES = {}));
35
37
  export var MODE;
36
38
  (function (MODE) {
@@ -38,11 +40,25 @@ export var MODE;
38
40
  MODE["EDIT"] = "edit";
39
41
  })(MODE || (MODE = {}));
40
42
  let NileSwitcher = class NileSwitcher extends NileElement {
43
+ constructor() {
44
+ super(...arguments);
45
+ this.current = 0;
46
+ }
41
47
  connectedCallback() {
42
- this.currentInput = this.nileSwitchConfig.inputs[0];
43
48
  super.connectedCallback();
49
+ this.setCurrentInput();
44
50
  this.emit('nile-init');
45
51
  }
52
+ handleSwitcherChange() {
53
+ this.setCurrentInput();
54
+ }
55
+ setCurrentInput() {
56
+ if (this.nileSwitchConfig?.inputs) {
57
+ this.currentInput = this.nileSwitchConfig.inputs.filter((input, index) => {
58
+ return index === this.current;
59
+ })[0];
60
+ }
61
+ }
46
62
  disconnectedCallback() {
47
63
  super.disconnectedCallback();
48
64
  this.emit('nile-destroy');
@@ -176,6 +192,25 @@ let NileSwitcher = class NileSwitcher extends NileElement {
176
192
  </nile-icon>
177
193
  </nile-input>`;
178
194
  }
195
+ renderCodeEditor(Input) {
196
+ const { value, multiLine, options, disabled, readonly, errorMessage, error, inputType, noborder, } = Input;
197
+ return html `<nile-code-editor
198
+ class=${classMap({
199
+ 'code-editor': true,
200
+ 'code-editor__no-border': !!noborder,
201
+ })}
202
+ @nile-expand="${(e) => this.handleExpand(e, INPUT_TYPE_NAMES.CODE_EDITOR)}"
203
+ @nile-change="${(e) => this.handleChange(e, INPUT_TYPE_NAMES.CODE_EDITOR)}"
204
+ .multiline="${multiLine}"
205
+ .value="${value}"
206
+ .customOptions="${options}"
207
+ .showLineNumbers="false"
208
+ ></nile-code-editor> `;
209
+ }
210
+ handleExpand(event, inputType) {
211
+ this.currentInput.expand = event.detail.expand;
212
+ this.emit('nile-change', { input: this.currentInput });
213
+ }
179
214
  handleChange(event, inputType) {
180
215
  switch (inputType) {
181
216
  case INPUT_TYPE_NAMES.OBJECT_MAPPER:
@@ -184,6 +219,9 @@ let NileSwitcher = class NileSwitcher extends NileElement {
184
219
  case INPUT_TYPE_NAMES.CHECKBOX:
185
220
  this.currentInput.value = event.detail.checked;
186
221
  break;
222
+ case INPUT_TYPE_NAMES.CODE_EDITOR:
223
+ this.currentInput.value = event.detail.value;
224
+ break;
187
225
  default:
188
226
  this.currentInput.value = event.detail.value;
189
227
  }
@@ -195,7 +233,7 @@ let NileSwitcher = class NileSwitcher extends NileElement {
195
233
  const toolTipPosition = this.nileSwitchConfig.align === POSITIONS.BLOCK ? 'top' : 'bottom';
196
234
  return html `
197
235
  <div class="switcher-icons-container">
198
- ${repeat(inputs, input => html ` <nile-tooltip
236
+ ${repeat(inputs, (input, index) => html ` <nile-tooltip
199
237
  class=${classMap({
200
238
  'switcher-tooltip-container': true,
201
239
  })}
@@ -204,7 +242,7 @@ let NileSwitcher = class NileSwitcher extends NileElement {
204
242
  >
205
243
  <div class=${classMap({
206
244
  'switcher-icon-container': true,
207
- current: input.order === this.currentInput.order,
245
+ current: index === this.current,
208
246
  })}>
209
247
  <nile-icon
210
248
  size="16"
@@ -213,7 +251,7 @@ let NileSwitcher = class NileSwitcher extends NileElement {
213
251
  })}
214
252
  .name=${input.icon}
215
253
  color="#000000"
216
- @click=${() => this.toggleField(input)}
254
+ @click=${() => this.toggleField(input, index)}
217
255
  ></nile-icon>
218
256
  <div>
219
257
 
@@ -221,8 +259,8 @@ let NileSwitcher = class NileSwitcher extends NileElement {
221
259
  </div>
222
260
  `;
223
261
  }
224
- toggleField(currentInput) {
225
- this.currentInput = currentInput;
262
+ toggleField(currentInput, index) {
263
+ this.current = index;
226
264
  this.emit('nile-switch', { input: this.currentInput });
227
265
  }
228
266
  singleFieldSwitcher() {
@@ -250,6 +288,10 @@ let NileSwitcher = class NileSwitcher extends NileElement {
250
288
  () => this.renderContentEditor(this.currentInput),
251
289
  ],
252
290
  [INPUT_TYPE_NAMES.OBJECT_MAPPER, () => this.renderObjectMapper()],
291
+ [
292
+ INPUT_TYPE_NAMES.CODE_EDITOR,
293
+ () => this.renderCodeEditor(this.currentInput),
294
+ ],
253
295
  ], () => this.renderNileText(this.currentInput))}
254
296
  `;
255
297
  }
@@ -275,8 +317,14 @@ __decorate([
275
317
  property({ type: Object })
276
318
  ], NileSwitcher.prototype, "nileSwitchConfig", void 0);
277
319
  __decorate([
278
- property()
320
+ property({ type: Number })
321
+ ], NileSwitcher.prototype, "current", void 0);
322
+ __decorate([
323
+ property({ type: Object })
279
324
  ], NileSwitcher.prototype, "currentInput", void 0);
325
+ __decorate([
326
+ watch(['current'], { waitUntilFirstUpdate: true })
327
+ ], NileSwitcher.prototype, "handleSwitcherChange", null);
280
328
  NileSwitcher = __decorate([
281
329
  customElement('nile-switcher')
282
330
  ], NileSwitcher);
@@ -1 +1 @@
1
- {"version":3,"file":"nile-switcher.js","sourceRoot":"","sources":["../../../src/nile-switcher/nile-switcher.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAkB,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAoDlD,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,8BAAiB,CAAA;IACjB,4BAAe,CAAA;AACjB,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAED,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,sCAAwB,CAAA;IACxB,oCAAsB,CAAA;AACxB,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAED,MAAM,CAAN,IAAY,gBAQX;AARD,WAAY,gBAAgB;IAC1B,yCAAqB,CAAA;IACrB,iCAAa,CAAA;IACb,yCAAqB,CAAA;IACrB,0CAAsB,CAAA;IACtB,mCAAe,CAAA;IACf,oDAAgC,CAAA;IAChC,mDAA+B,CAAA;AACjC,CAAC,EARW,gBAAgB,KAAhB,gBAAgB,QAQ3B;AAED,MAAM,CAAN,IAAY,IAGX;AAHD,WAAY,IAAI;IACd,yBAAiB,CAAA;IACjB,qBAAa,CAAA;AACf,CAAC,EAHW,IAAI,KAAJ,IAAI,QAGf;AAGM,IAAM,YAAY,GAAlB,MAAM,YAA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B,EAAE,KAAK,KAAK,SAAS,CAAC,MAAM;YAC7C,0BAA0B,EAAE,IAAI;SACjC,CAAC;;QAEA,IAAI,CAAC,UAAU,EAAE,IAAI,IAAI,CAAC,mBAAmB,EAAE;WAC5C,CAAC;IACV,CAAC;;AA9RD;;;GAGG;AACI,mBAAM,GAAmB,MAAM,CAAC;AAEX;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDAAgC;AAC/C;IAAX,QAAQ,EAAE;kDAA+B;AAR/B,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAgSxB;SAhSY,YAAY;AAkSzB,eAAe,YAAY,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 { html, property, TemplateResult } from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-switcher.css';\nimport NileElement from '../internal/nile-element';\nimport { CSSResultGroup } from 'lit';\nimport { choose } from 'lit/directives/choose.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { repeat } from 'lit/directives/repeat.js';\n\n/**\n * @summary Allows you to switch between nile elements\n *\n * @dependency nile-icon\n * @dependency nile-input\n * @dependency nile-checkbox\n * @dependency nile-dropdown\n * @dependency nile-textarea\n *\n * @event nile-change - Emitted when the control's value changes.\n * @event nile-switch - Emitted when the nile component is being switched.\n */\n\nexport interface switchconfig {\n [key: string]: any;\n toggleSwitch: boolean;\n disable?: boolean;\n confirmation?: boolean;\n current: number;\n align: 'block' | 'inline';\n inputs: switchInputType[];\n}\n\nexport interface switchInputType {\n inputType:\n | INPUT_TYPE_NAMES.DROPDOWN\n | INPUT_TYPE_NAMES.TEXT\n | INPUT_TYPE_NAMES.CHECKBOX\n | INPUT_TYPE_NAMES.TEXTAREA\n | INPUT_TYPE_NAMES.RADIO\n | INPUT_TYPE_NAMES.CONTENTEDITOR\n | INPUT_TYPE_NAMES.OBJECT_MAPPER;\n value?: String | boolean;\n label?: String;\n readonly?: boolean;\n order: number;\n type?: string;\n icon: string;\n mode?: string;\n placeholder?: string;\n disabled?: boolean;\n required?: boolean;\n error?: boolean;\n errorMessage?: string;\n options?: Array<any>;\n helperText?: string;\n multiple?: boolean;\n noborder?: boolean;\n}\n\nexport enum POSITIONS {\n INLINE = 'inline',\n BLOCK = 'block',\n}\n\nexport enum INPUT_TYPE {\n DEFAULT = 'defaultInput',\n SWITCH = 'switchInput',\n}\n\nexport enum INPUT_TYPE_NAMES {\n DROPDOWN = 'dropdown',\n TEXT = 'text',\n CHECKBOX = 'checkbox',\n TEXTAREA = 'text-area',\n RADIO = 'radio',\n CONTENTEDITOR = 'content-editor',\n OBJECT_MAPPER = 'object-mapper',\n}\n\nexport enum MODE {\n CREATE = 'create',\n EDIT = 'edit',\n}\n\n@customElement('nile-switcher')\nexport class NileSwitcher extends NileElement {\n /**\n * The styles for nile switcher\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n static styles: CSSResultGroup = styles;\n\n @property({ type: Object }) nileSwitchConfig: switchconfig;\n @property() currentInput: switchInputType;\n\n connectedCallback() {\n this.currentInput = this.nileSwitchConfig.inputs[0];\n super.connectedCallback();\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n }\n\n renderNileText(Input: switchInputType) {\n const {\n value,\n label,\n placeholder,\n disabled,\n required,\n error,\n errorMessage,\n inputType,\n noborder,\n } = Input;\n return html`<nile-input\n class=${classMap({\n 'switcher-input': true,\n 'switcher-input--noborder': !!noborder,\n })}\n .value=${value}\n .label=${label}\n .disabled=${disabled}\n .required=${required}\n .errorMessage=${errorMessage}\n .placeholder=${placeholder}\n .error=${error}\n @nile-input=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n ></nile-input>`;\n }\n\n renderDropdown(Input: switchInputType) {\n const {\n options,\n multiple,\n placeholder,\n disabled,\n value,\n error,\n errorMessage,\n inputType,\n } = Input;\n\n return html`<nile-select\n class=\"switcher-dropdown\"\n .placeholder=${placeholder}\n .disabled=\"${disabled}\"\n .multiple=\"${multiple}\"\n .value=\"${value}\"\n .error=\"${error}\"\n .errorMessage=\"${errorMessage}\"\n @nile-change=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n >\n ${options?.map((option: any) => {\n return html`<nile-option .value=\"${option}\">${option} </nile-option>`;\n })}\n </nile-select>`;\n }\n\n renderNileTextArea(Input: switchInputType) {\n const { value, disabled, readonly, errorMessage, error, inputType } = Input;\n\n return html`<nile-textarea\n class=\"switcher-textarea\"\n .value=${value}\n .disabled=${disabled}\n ?readonly=${readonly}\n .error=${error}\n .errorMessage=${errorMessage}\n @nile-input=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n ></nile-textarea>`;\n }\n\n renderNileCheckBox(Input: switchInputType) {\n const { value, label, disabled, inputType } = Input;\n\n return html`<nile-checkbox\n class=\"switcher-checkbox\"\n .checked=${value}\n .label=${label}\n .disabled=${disabled}\n @valueChange=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n ></nile-checkbox\n >; `;\n }\n\n renderNileRadio(Input: switchInputType) {\n const { options, value, disabled, errorMessage, inputType } = Input;\n\n const haserrorMessage = !!errorMessage;\n\n return html`<nile-radio-group\n class=\"switcher-radio-group\"\n .value=${value}\n .disabled=${disabled}\n @change=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n >\n ${options &&\n options.map((option: any) => {\n return html`<nile-radio .value=\"${option}\">${option} </nile-radio>`;\n })}\n ${haserrorMessage ? this.renderErrorMessage(errorMessage) : ''}\n </nile-radio-group> `;\n }\n\n renderErrorMessage(errorMessage: string) {\n return html`\n <nile-form-error-message>${errorMessage}</nile-form-error-message>\n `;\n }\n\n renderContentEditor(Input: switchInputType) {\n let { options, inputType, errorMessage, type, readonly, noborder, value } =\n Input;\n return html`<nile-content-editor\n class=\"switcher-content-editor\"\n .value=${value}\n .options=${options}\n .type=${type}\n .readonly=${readonly}\n .noborder=${noborder}\n .errorMessage=${errorMessage}\n @nile-change=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n >\n </nile-content-editor>`;\n }\n\n renderObjectMapper() {\n const noborder = this.currentInput.noborder;\n const mode = this.currentInput.mode;\n const value =\n this.currentInput.mode === MODE.CREATE\n ? 'Click to Create - Not Mapped'\n : '';\n\n return html`<nile-input\n class=${classMap({\n 'switcher-object-mapper': true,\n 'switcher-object-mapper--noborder': !!noborder,\n })}\n .value=${value}\n readonly=\"true\"\n @click=\"${(e: CustomEvent) =>\n this.handleChange(e, INPUT_TYPE_NAMES.OBJECT_MAPPER)}\"\n >\n <nile-icon\n class=\"pointer-cursor switcher-object-mapper-icon\"\n slot=\"suffix\"\n name=\"collapse\"\n color=\"#005EA6\"\n size=\"16\"\n >\n </nile-icon>\n </nile-input>`;\n }\n\n handleChange(event: CustomEvent, inputType: string) {\n switch (inputType) {\n case INPUT_TYPE_NAMES.OBJECT_MAPPER:\n this.currentInput.value = 'clicked';\n break;\n case INPUT_TYPE_NAMES.CHECKBOX:\n this.currentInput.value = event.detail.checked;\n break;\n default:\n this.currentInput.value = event.detail.value;\n }\n event.stopPropagation();\n this.emit('nile-change', { input: this.currentInput });\n }\n\n renderIcon() {\n const inputs = this.nileSwitchConfig.inputs;\n const toolTipPosition =\n this.nileSwitchConfig.align === POSITIONS.BLOCK ? 'top' : 'bottom';\n\n return html`\n <div class=\"switcher-icons-container\">\n ${repeat(\n inputs,\n input => html` <nile-tooltip\n class=${classMap({\n 'switcher-tooltip-container': true,\n })}\n content=${input.helperText}\n placement=${toolTipPosition}\n >\n <div class=${classMap({\n 'switcher-icon-container': true,\n current: input.order === this.currentInput.order,\n })}>\n <nile-icon\n size=\"16\"\n class=${classMap({\n 'pointer-cursor': true,\n })}\n .name=${input.icon}\n color=\"#000000\"\n @click=${() => this.toggleField(input)}\n ></nile-icon>\n <div>\n \n </nile-tooltip>`\n )}\n </div>\n `;\n }\n\n toggleField(currentInput: switchInputType) {\n this.currentInput = currentInput;\n this.emit('nile-switch', { input: this.currentInput });\n }\n\n singleFieldSwitcher() {\n return html`\n ${choose(\n this.currentInput.inputType,\n [\n [INPUT_TYPE_NAMES.TEXT, () => this.renderNileText(this.currentInput)],\n [\n INPUT_TYPE_NAMES.CHECKBOX,\n () => this.renderNileCheckBox(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.TEXTAREA,\n () => this.renderNileTextArea(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.RADIO,\n () => this.renderNileRadio(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.DROPDOWN,\n () => this.renderDropdown(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.CONTENTEDITOR,\n () => this.renderContentEditor(this.currentInput),\n ],\n [INPUT_TYPE_NAMES.OBJECT_MAPPER, () => this.renderObjectMapper()],\n ],\n () => this.renderNileText(this.currentInput)\n )}\n `;\n }\n\n public render(): TemplateResult {\n const align = this.nileSwitchConfig.align;\n return html`<div\n class=${classMap({\n 'switcher-block': align === POSITIONS.BLOCK,\n 'switcher-inline': align === POSITIONS.INLINE,\n 'switcher-input-container': true,\n })}\n >\n ${this.renderIcon()} ${this.singleFieldSwitcher()}\n </div>`;\n }\n}\n\nexport default NileSwitcher;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-switcher': NileSwitcher;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-switcher.js","sourceRoot":"","sources":["../../../src/nile-switcher/nile-switcher.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAkB,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,MAAM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IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDAAgC;AAE/B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAqB;AAEpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAA+B;AAS1D;IADC,KAAK,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;wDAGlD;AAtBU,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAyVxB;SAzVY,YAAY;AA2VzB,eAAe,YAAY,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 { html, property, TemplateResult } from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-switcher.css';\nimport NileElement from '../internal/nile-element';\nimport { CSSResultGroup } from 'lit';\nimport { choose } from 'lit/directives/choose.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { watch } from '../internal/watch';\n\n/**\n * @summary Allows you to switch between nile elements\n *\n * @dependency nile-icon\n * @dependency nile-input\n * @dependency nile-checkbox\n * @dependency nile-dropdown\n * @dependency nile-textarea\n *\n * @event nile-change - Emitted when the control's value changes.\n * @event nile-switch - Emitted when the nile component is being switched.\n */\n\nexport interface switchconfig {\n [key: string]: any;\n toggleSwitch: boolean;\n disable?: boolean;\n confirmation?: boolean;\n align: 'block' | 'inline';\n inputs: switchInputType[];\n}\n\nexport interface switchInputType {\n inputType:\n | INPUT_TYPE_NAMES.DROPDOWN\n | INPUT_TYPE_NAMES.TEXT\n | INPUT_TYPE_NAMES.CHECKBOX\n | INPUT_TYPE_NAMES.TEXTAREA\n | INPUT_TYPE_NAMES.RADIO\n | INPUT_TYPE_NAMES.CONTENTEDITOR\n | INPUT_TYPE_NAMES.OBJECT_MAPPER\n | INPUT_TYPE_NAMES.CODE_EDITOR;\n value?: String | boolean;\n label?: String;\n readonly?: boolean;\n type?: string;\n icon: string;\n mode?: string;\n placeholder?: string;\n disabled?: boolean;\n required?: boolean;\n error?: boolean;\n errorMessage?: string;\n options?: Array<any>;\n helperText?: string;\n multiple?: boolean;\n noborder?: boolean;\n multiLine?: boolean;\n expand?: boolean;\n}\n\nexport enum POSITIONS {\n INLINE = 'inline',\n BLOCK = 'block',\n}\n\nexport enum INPUT_TYPE {\n DEFAULT = 'defaultInput',\n SWITCH = 'switchInput',\n}\n\nexport enum INPUT_TYPE_NAMES {\n DROPDOWN = 'dropdown',\n TEXT = 'text',\n CHECKBOX = 'checkbox',\n TEXTAREA = 'text-area',\n RADIO = 'radio',\n CONTENTEDITOR = 'content-editor',\n OBJECT_MAPPER = 'object-mapper',\n CODE_EDITOR = 'code-editor',\n}\n\nexport enum MODE {\n CREATE = 'create',\n EDIT = 'edit',\n}\n\n@customElement('nile-switcher')\nexport class NileSwitcher extends NileElement {\n /**\n * The styles for nile switcher\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n static styles: CSSResultGroup = styles;\n\n @property({ type: Object }) nileSwitchConfig: switchconfig;\n\n @property({ type: Number }) current: Number = 0;\n\n @property({ type: Object }) currentInput: switchInputType;\n\n connectedCallback() {\n super.connectedCallback();\n this.setCurrentInput();\n this.emit('nile-init');\n }\n\n @watch(['current'], { waitUntilFirstUpdate: true })\n handleSwitcherChange() {\n this.setCurrentInput();\n }\n\n setCurrentInput() {\n if (this.nileSwitchConfig?.inputs) {\n this.currentInput = this.nileSwitchConfig.inputs.filter(\n (input: switchInputType, index: Number) => {\n return index === this.current;\n }\n )[0];\n }\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n }\n\n renderNileText(Input: switchInputType) {\n const {\n value,\n label,\n placeholder,\n disabled,\n required,\n error,\n errorMessage,\n inputType,\n noborder,\n } = Input;\n return html`<nile-input\n class=${classMap({\n 'switcher-input': true,\n 'switcher-input--noborder': !!noborder,\n })}\n .value=${value}\n .label=${label}\n .disabled=${disabled}\n .required=${required}\n .errorMessage=${errorMessage}\n .placeholder=${placeholder}\n .error=${error}\n @nile-input=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n ></nile-input>`;\n }\n\n renderDropdown(Input: switchInputType) {\n const {\n options,\n multiple,\n placeholder,\n disabled,\n value,\n error,\n errorMessage,\n inputType,\n } = Input;\n\n return html`<nile-select\n class=\"switcher-dropdown\"\n .placeholder=${placeholder}\n .disabled=\"${disabled}\"\n .multiple=\"${multiple}\"\n .value=\"${value}\"\n .error=\"${error}\"\n .errorMessage=\"${errorMessage}\"\n @nile-change=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n >\n ${options?.map((option: any) => {\n return html`<nile-option .value=\"${option}\">${option} </nile-option>`;\n })}\n </nile-select>`;\n }\n\n renderNileTextArea(Input: switchInputType) {\n const { value, disabled, readonly, errorMessage, error, inputType } = Input;\n\n return html`<nile-textarea\n class=\"switcher-textarea\"\n .value=${value}\n .disabled=${disabled}\n ?readonly=${readonly}\n .error=${error}\n .errorMessage=${errorMessage}\n @nile-input=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n ></nile-textarea>`;\n }\n\n renderNileCheckBox(Input: switchInputType) {\n const { value, label, disabled, inputType } = Input;\n\n return html`<nile-checkbox\n class=\"switcher-checkbox\"\n .checked=${value}\n .label=${label}\n .disabled=${disabled}\n @valueChange=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n ></nile-checkbox\n >; `;\n }\n\n renderNileRadio(Input: switchInputType) {\n const { options, value, disabled, errorMessage, inputType } = Input;\n\n const haserrorMessage = !!errorMessage;\n\n return html`<nile-radio-group\n class=\"switcher-radio-group\"\n .value=${value}\n .disabled=${disabled}\n @change=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n >\n ${options &&\n options.map((option: any) => {\n return html`<nile-radio .value=\"${option}\">${option} </nile-radio>`;\n })}\n ${haserrorMessage ? this.renderErrorMessage(errorMessage) : ''}\n </nile-radio-group> `;\n }\n\n renderErrorMessage(errorMessage: string) {\n return html`\n <nile-form-error-message>${errorMessage}</nile-form-error-message>\n `;\n }\n\n renderContentEditor(Input: switchInputType) {\n let { options, inputType, errorMessage, type, readonly, noborder, value } =\n Input;\n return html`<nile-content-editor\n class=\"switcher-content-editor\"\n .value=${value}\n .options=${options}\n .type=${type}\n .readonly=${readonly}\n .noborder=${noborder}\n .errorMessage=${errorMessage}\n @nile-change=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n >\n </nile-content-editor>`;\n }\n\n renderObjectMapper() {\n const noborder = this.currentInput.noborder;\n const mode = this.currentInput.mode;\n const value =\n this.currentInput.mode === MODE.CREATE\n ? 'Click to Create - Not Mapped'\n : '';\n\n return html`<nile-input\n class=${classMap({\n 'switcher-object-mapper': true,\n 'switcher-object-mapper--noborder': !!noborder,\n })}\n .value=${value}\n readonly=\"true\"\n @click=\"${(e: CustomEvent) =>\n this.handleChange(e, INPUT_TYPE_NAMES.OBJECT_MAPPER)}\"\n >\n <nile-icon\n class=\"pointer-cursor switcher-object-mapper-icon\"\n slot=\"suffix\"\n name=\"collapse\"\n color=\"#005EA6\"\n size=\"16\"\n >\n </nile-icon>\n </nile-input>`;\n }\n\n renderCodeEditor(Input: switchInputType) {\n const {\n value,\n multiLine,\n options,\n disabled,\n readonly,\n errorMessage,\n error,\n inputType,\n noborder,\n } = Input;\n return html`<nile-code-editor\n class=${classMap({\n 'code-editor': true,\n 'code-editor__no-border': !!noborder,\n })}\n @nile-expand=\"${(e: CustomEvent) =>\n this.handleExpand(e, INPUT_TYPE_NAMES.CODE_EDITOR)}\"\n @nile-change=\"${(e: CustomEvent) =>\n this.handleChange(e, INPUT_TYPE_NAMES.CODE_EDITOR)}\"\n .multiline=\"${multiLine}\"\n .value=\"${value}\"\n .customOptions=\"${options}\"\n .showLineNumbers=\"false\"\n ></nile-code-editor> `;\n }\n\n handleExpand(event: CustomEvent, inputType: string) {\n this.currentInput.expand = event.detail.expand;\n this.emit('nile-change', { input: this.currentInput });\n }\n\n handleChange(event: CustomEvent, inputType: string) {\n switch (inputType) {\n case INPUT_TYPE_NAMES.OBJECT_MAPPER:\n this.currentInput.value = 'clicked';\n break;\n case INPUT_TYPE_NAMES.CHECKBOX:\n this.currentInput.value = event.detail.checked;\n break;\n case INPUT_TYPE_NAMES.CODE_EDITOR:\n this.currentInput.value = event.detail.value;\n break;\n default:\n this.currentInput.value = event.detail.value;\n }\n event.stopPropagation();\n this.emit('nile-change', { input: this.currentInput });\n }\n\n renderIcon() {\n const inputs = this.nileSwitchConfig.inputs;\n const toolTipPosition =\n this.nileSwitchConfig.align === POSITIONS.BLOCK ? 'top' : 'bottom';\n\n return html`\n <div class=\"switcher-icons-container\">\n ${repeat(\n inputs,\n (input: any, index: number) => html` <nile-tooltip\n class=${classMap({\n 'switcher-tooltip-container': true,\n })}\n content=${input.helperText}\n placement=${toolTipPosition}\n >\n <div class=${classMap({\n 'switcher-icon-container': true,\n current: index === this.current,\n })}>\n <nile-icon\n size=\"16\"\n class=${classMap({\n 'pointer-cursor': true,\n })}\n .name=${input.icon}\n color=\"#000000\"\n @click=${() => this.toggleField(input, index)}\n ></nile-icon>\n <div>\n \n </nile-tooltip>`\n )}\n </div>\n `;\n }\n\n toggleField(currentInput: switchInputType, index: Number) {\n this.current = index;\n this.emit('nile-switch', { input: this.currentInput });\n }\n\n singleFieldSwitcher() {\n return html`\n ${choose(\n this.currentInput.inputType,\n [\n [INPUT_TYPE_NAMES.TEXT, () => this.renderNileText(this.currentInput)],\n [\n INPUT_TYPE_NAMES.CHECKBOX,\n () => this.renderNileCheckBox(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.TEXTAREA,\n () => this.renderNileTextArea(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.RADIO,\n () => this.renderNileRadio(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.DROPDOWN,\n () => this.renderDropdown(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.CONTENTEDITOR,\n () => this.renderContentEditor(this.currentInput),\n ],\n [INPUT_TYPE_NAMES.OBJECT_MAPPER, () => this.renderObjectMapper()],\n [\n INPUT_TYPE_NAMES.CODE_EDITOR,\n () => this.renderCodeEditor(this.currentInput),\n ],\n ],\n () => this.renderNileText(this.currentInput)\n )}\n `;\n }\n\n public render(): TemplateResult {\n const align = this.nileSwitchConfig.align;\n return html`<div\n class=${classMap({\n 'switcher-block': align === POSITIONS.BLOCK,\n 'switcher-inline': align === POSITIONS.INLINE,\n 'switcher-input-container': true,\n })}\n >\n ${this.renderIcon()} ${this.singleFieldSwitcher()}\n </div>`;\n }\n}\n\nexport default NileSwitcher;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-switcher': NileSwitcher;\n }\n}\n"]}
@@ -33,6 +33,7 @@ export const styles = css `
33
33
  font-weight: 500;
34
34
  line-height: 16px;
35
35
  letter-spacing: 0.2px;
36
+ gap: 4px;
36
37
  }
37
38
 
38
39
  .tab:hover:not(.tab--disabled) {
@@ -1 +1 @@
1
- {"version":3,"file":"nile-tab.css.js","sourceRoot":"","sources":["../../../src/nile-tab/nile-tab.css.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAEF,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAEhC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmExB,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-element';\n\n/**\n * Tab CSS\n */\nexport const styles = css`\n [hidden] {\n display: none !important;\n }\n\n :host {\n display: inline-block;\n }\n\n .tab {\n display: inline-flex;\n align-items: center;\n border-radius: 8px;\n color: var(--nile-colors-dark-500);\n padding: 4px 4px 12px 4px;\n white-space: nowrap;\n user-select: none;\n cursor: pointer;\n transition: 0.2s box-shadow, 0.2s color;\n font-family: Colfax-regular;\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 16px;\n letter-spacing: 0.2px;\n }\n\n .tab:hover:not(.tab--disabled) {\n color: var(--nile-colors-dark-900);\n }\n\n .tab:focus {\n outline: none;\n }\n\n .tab:focus-visible:not(.tab--disabled) {\n color: var(--nile-colors-primary-600);\n }\n\n .tab.tab--active:not(.tab--disabled) {\n color: var(--nile-colors-primary-600);\n }\n\n .tab.tab--closable {\n padding-inline-end: 4px;\n }\n\n .tab.tab--disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .tab__close-button {\n font-size: 14px;\n margin-inline-start: 4px;\n }\n\n .tab__close-button::part(base) {\n padding: 3px;\n }\n\n @media (forced-colors: active) {\n .tab.tab--active:not(.tab--disabled) {\n outline: solid 1px transparent;\n outline-offset: -3px;\n }\n }\n`;\n\nexport default [styles];\n"]}
1
+ {"version":3,"file":"nile-tab.css.js","sourceRoot":"","sources":["../../../src/nile-tab/nile-tab.css.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAEF,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAEhC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoExB,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-element';\n\n/**\n * Tab CSS\n */\nexport const styles = css`\n [hidden] {\n display: none !important;\n }\n\n :host {\n display: inline-block;\n }\n\n .tab {\n display: inline-flex;\n align-items: center;\n border-radius: 8px;\n color: var(--nile-colors-dark-500);\n padding: 4px 4px 12px 4px;\n white-space: nowrap;\n user-select: none;\n cursor: pointer;\n transition: 0.2s box-shadow, 0.2s color;\n font-family: Colfax-regular;\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 16px;\n letter-spacing: 0.2px;\n gap: 4px;\n }\n\n .tab:hover:not(.tab--disabled) {\n color: var(--nile-colors-dark-900);\n }\n\n .tab:focus {\n outline: none;\n }\n\n .tab:focus-visible:not(.tab--disabled) {\n color: var(--nile-colors-primary-600);\n }\n\n .tab.tab--active:not(.tab--disabled) {\n color: var(--nile-colors-primary-600);\n }\n\n .tab.tab--closable {\n padding-inline-end: 4px;\n }\n\n .tab.tab--disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .tab__close-button {\n font-size: 14px;\n margin-inline-start: 4px;\n }\n\n .tab__close-button::part(base) {\n padding: 3px;\n }\n\n @media (forced-colors: active) {\n .tab.tab--active:not(.tab--disabled) {\n outline: solid 1px transparent;\n outline-offset: -3px;\n }\n }\n`;\n\nexport default [styles];\n"]}
@@ -80,6 +80,7 @@ let NileTab = class NileTab extends NileElement {
80
80
  })}
81
81
  tabindex=${this.disabled ? '-1' : '0'}
82
82
  >
83
+ <slot name="prefix"></slot>
83
84
  <slot></slot>
84
85
  ${this.closable
85
86
  ? html `
@@ -1 +1 @@
1
- {"version":3,"file":"nile-tab.js","sourceRoot":"","sources":["../../../src/nile-tab/nile-tab.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAa,IAAI,EAAE,QAAQ,EAAiC,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAEtC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,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UAAU,CAAC;GACb,OAAO,CAmFnB;SAnFY,OAAO;AAqFpB,eAAe,OAAO,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, property, CSSResultArray, TemplateResult} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport {styles} from './nile-tab.css';\n\nimport '../nile-icon-button/nile-icon-button';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query } from 'lit/decorators.js';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\n\nlet id = 0;\n\n/**\n * Nile icon component.\n *\n * @tag nile-tab\n *\n *\n * @dependency nile-icon-button\n *\n * @slot - The tab's label.\n *\n * @event nile-close - Emitted when the tab is closable and the close button is activated.\n *\n * @csspart base - The component's base wrapper.\n * @csspart close-button - The close button, an `<nile-icon-button>`.\n * @csspart close-button__base - The close button's exported `base` part.\n */\n@customElement('nile-tab')\nexport class NileTab extends NileElement {\n static styles: CSSResultGroup = styles;\n\n private readonly attrId = ++id;\n private readonly componentId = `nile-tab-${this.attrId}`;\n\n @query('.tab') tab: HTMLElement;\n\n /** The name of the tab panel this tab is associated with. The panel must be located in the same tab group. */\n @property({ reflect: true }) panel = '';\n\n /** Draws the tab in an active state. */\n @property({ type: Boolean, reflect: true }) active = false;\n\n /** Makes the tab closable and shows a close button. */\n @property({ type: Boolean }) closable = false;\n\n /** Disables the tab and prevents selection. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute('role', 'tab');\n }\n\n private handleCloseClick(event: Event) {\n event.stopPropagation();\n this.emit('nile-close');\n }\n\n @watch('active')\n handleActiveChange() {\n this.setAttribute('aria-selected', this.active ? 'true' : 'false');\n }\n\n @watch('disabled')\n handleDisabledChange() {\n this.setAttribute('aria-disabled', this.disabled ? 'true' : 'false');\n }\n\n /** Sets focus to the tab. */\n focus(options?: FocusOptions) {\n this.tab.focus(options);\n }\n\n /** Removes focus from the tab. */\n blur() {\n this.tab.blur();\n }\n\n render() {\n // If the user didn't provide an ID, we'll set one so we can link tabs and tab panels with aria labels\n this.id = this.id.length > 0 ? this.id : this.componentId;\n\n return html`\n <div\n part=\"base\"\n class=${classMap({\n tab: true,\n 'tab--active': this.active,\n 'tab--closable': this.closable,\n 'tab--disabled': this.disabled\n })}\n tabindex=${this.disabled ? '-1' : '0'}\n >\n <slot></slot>\n ${this.closable\n ? html`\n <nile-icon-button\n part=\"close-button\"\n exportparts=\"base:close-button__base\"\n name=\"x-lg\"\n library=\"system\"\n label=\"close\"\n class=\"tab__close-button\"\n @click=${this.handleCloseClick}\n tabindex=\"-1\"\n ></nile-icon-button>\n `\n : ''}\n </div>\n `;\n }\n}\n\nexport default NileTab;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-tab': NileTab;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-tab.js","sourceRoot":"","sources":["../../../src/nile-tab/nile-tab.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAa,IAAI,EAAE,QAAQ,EAAiC,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAEtC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAGnD,IAAI,EAAE,GAAG,CAAC,CAAC;AAEX;;;;;;;;;;;;;;;GAeG;AAEI,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,WAAW;IAAjC;;QAGY,WAAM,GAAG,EAAE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YACf,GAAG,EAAE,IAAI;YACT,aAAa,EAAE,IAAI,CAAC,MAAM;YAC1B,eAAe,EAAE,IAAI,CAAC,QAAQ;YAC9B,eAAe,EAAE,IAAI,CAAC,QAAQ;SAC/B,CAAC;mBACS,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG;;;;UAInC,IAAI,CAAC,QAAQ;YACb,CAAC,CAAC,IAAI,CAAA;;;;;;;;yBAQS,IAAI,CAAC,gBAAgB;;;aAGjC;YACH,CAAC,CAAC,EAAE;;KAET,CAAC;IACJ,CAAC;;AAlFM,cAAM,GAAmB,MAAM,CAAC;AAKxB;IAAd,KAAK,CAAC,MAAM,CAAC;oCAAkB;AAGH;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sCAAY;AAGI;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCAAgB;AAG9B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yCAAkB;AAGF;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAAkB;AAa7D;IADC,KAAK,CAAC,QAAQ,CAAC;iDAGf;AAGD;IADC,KAAK,CAAC,UAAU,CAAC;mDAGjB;AAtCU,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CAoFnB;SApFY,OAAO;AAsFpB,eAAe,OAAO,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, property, CSSResultArray, TemplateResult} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport {styles} from './nile-tab.css';\n\nimport '../nile-icon-button/nile-icon-button';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query } from 'lit/decorators.js';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\n\nlet id = 0;\n\n/**\n * Nile icon component.\n *\n * @tag nile-tab\n *\n *\n * @dependency nile-icon-button\n *\n * @slot - The tab's label.\n *\n * @event nile-close - Emitted when the tab is closable and the close button is activated.\n *\n * @csspart base - The component's base wrapper.\n * @csspart close-button - The close button, an `<nile-icon-button>`.\n * @csspart close-button__base - The close button's exported `base` part.\n */\n@customElement('nile-tab')\nexport class NileTab extends NileElement {\n static styles: CSSResultGroup = styles;\n\n private readonly attrId = ++id;\n private readonly componentId = `nile-tab-${this.attrId}`;\n\n @query('.tab') tab: HTMLElement;\n\n /** The name of the tab panel this tab is associated with. The panel must be located in the same tab group. */\n @property({ reflect: true }) panel = '';\n\n /** Draws the tab in an active state. */\n @property({ type: Boolean, reflect: true }) active = false;\n\n /** Makes the tab closable and shows a close button. */\n @property({ type: Boolean }) closable = false;\n\n /** Disables the tab and prevents selection. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute('role', 'tab');\n }\n\n private handleCloseClick(event: Event) {\n event.stopPropagation();\n this.emit('nile-close');\n }\n\n @watch('active')\n handleActiveChange() {\n this.setAttribute('aria-selected', this.active ? 'true' : 'false');\n }\n\n @watch('disabled')\n handleDisabledChange() {\n this.setAttribute('aria-disabled', this.disabled ? 'true' : 'false');\n }\n\n /** Sets focus to the tab. */\n focus(options?: FocusOptions) {\n this.tab.focus(options);\n }\n\n /** Removes focus from the tab. */\n blur() {\n this.tab.blur();\n }\n\n render() {\n // If the user didn't provide an ID, we'll set one so we can link tabs and tab panels with aria labels\n this.id = this.id.length > 0 ? this.id : this.componentId;\n\n return html`\n <div\n part=\"base\"\n class=${classMap({\n tab: true,\n 'tab--active': this.active,\n 'tab--closable': this.closable,\n 'tab--disabled': this.disabled\n })}\n tabindex=${this.disabled ? '-1' : '0'}\n >\n <slot name=\"prefix\"></slot>\n <slot></slot>\n ${this.closable\n ? html`\n <nile-icon-button\n part=\"close-button\"\n exportparts=\"base:close-button__base\"\n name=\"x-lg\"\n library=\"system\"\n label=\"close\"\n class=\"tab__close-button\"\n @click=${this.handleCloseClick}\n tabindex=\"-1\"\n ></nile-icon-button>\n `\n : ''}\n </div>\n `;\n }\n}\n\nexport default NileTab;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-tab': NileTab;\n }\n}\n"]}
@@ -78,6 +78,7 @@ export const styles = css `
78
78
  border-radius: var(--nile-radius-base-standard);
79
79
  transition: 0.3s color, 0.3s border, 0.3s box-shadow, 0.3s background-color;
80
80
  cursor: text;
81
+ min-height:12px;
81
82
  }
82
83
 
83
84
  /* Standard textareas */
@@ -179,16 +180,18 @@ export const styles = css `
179
180
  /* Resize types */
180
181
  .textarea--resize-none .textarea__control {
181
182
  resize: none;
183
+ min-height:12px;
182
184
  }
183
185
 
184
186
  .textarea--resize-vertical .textarea__control {
185
187
  resize: vertical;
188
+ min-height:12px;
186
189
  }
187
190
 
188
191
  .textarea--resize-auto .textarea__control {
189
- height: auto;
190
192
  resize: none;
191
193
  overflow-y: hidden;
194
+ min-height:12px;
192
195
  }
193
196
 
194
197
  .textarea--standard.textarea--warning {
@@ -1 +1 @@
1
- {"version":3,"file":"nile-textarea.css.js","sourceRoot":"","sources":["../../../src/nile-textarea/nile-textarea.css.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAEF,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAEhC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkMxB,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-element';\n\n/**\n * TextArea CSS\n */\nexport const styles = css`\n .form-control .form-control__label {\n display: none;\n }\n\n .form-control .form-control__help-text {\n display: none;\n }\n\n /* Label */\n .form-control--has-label .form-control__label {\n display: inline-block;\n margin-bottom: 12px;\n color: var(--nile-colors-dark-900);\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n .form-control--has-label.form-control--medium .form-control__label {\n font-size: var(--nile-font-size-base);\n }\n\n :host([required]) .form-control--has-label .form-control__label::after {\n content: '*';\n margin-inline-start: -2px;\n color: #A4121C;\n }\n\n /* Help text */\n .form-control--has-help-text .form-control__help-text {\n display: block;\n color: var(--nile-colors-dark-500);\n margin-top: 6px;\n }\n\n /* Error message */\n .form-control__error-message {\n display: block;\n color: var(--nile-colors-red-700);\n margin-top: 12px;\n font-size: 12px;\n font-style: normal;\n line-height: 12px;\n letter-spacing: 0.2px;\n }\n\n .form-control--has-help-text.form-control--medium .form-control__help-text {\n font-size: 10.24px;\n }\n\n /* Host styles */\n :host {\n display: block;\n }\n\n /* Textarea styles */\n .textarea {\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n letter-spacing: 0.5px;\n vertical-align: middle;\n border-radius: var(--nile-radius-base-standard);\n transition: 0.3s color, 0.3s border, 0.3s box-shadow, 0.3s background-color;\n cursor: text;\n }\n\n /* Standard textareas */\n .textarea--standard {\n background-color: var(\n --nile-colors-white-base\n );\n border: solid 1px var(--nile-colors-neutral-500);\n }\n\n .textarea--standard:hover:not(.textarea--disabled) {\n background-color: var(\n --nile-colors-white-base\n );\n border-color: var(\n --nile-colors-dark-900\n );\n border-radius: var(--nile-radius-base-standard);\n }\n\n .textarea--standard:hover:not(.textarea--disabled) .textarea__control {\n border-color: var(--nile-colors-dark-900);\n border-radius: var(--nile-radius-base-standard);\n }\n\n .textarea--standard.textarea--focused:not(.textarea--disabled) {\n background-color: var(\n --nile-colors-white-base\n );\n border-color: var(\n --nile-colors-primary-600\n );\n }\n\n .textarea--standard.textarea--focused:not(.textarea--disabled)\n .textarea__control {\n color: #000000;\n }\n\n .textarea--standard.textarea--disabled {\n border-color: var(\n --nile-colors-neutral-500\n );\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .textarea--standard.textarea--disabled .textarea__control {\n color: var(\n --nile-colors-neutral-500\n );\n }\n\n .textarea--standard.textarea--disabled .textarea__control::placeholder {\n color: var(\n --nile-colors-neutral-500\n );\n }\n\n /* Textarea control styles */\n .textarea__control {\n flex: 1 1 auto;\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px; /* 100% */\n letter-spacing: 0.2px;\n color: var(--nile-colors-dark-900);\n border: none;\n background: none;\n box-shadow: none;\n cursor: inherit;\n -webkit-appearance: none;\n }\n\n .textarea__control::-webkit-search-decoration,\n .textarea__control::-webkit-search-cancel-button,\n .textarea__control::-webkit-search-results-button,\n .textarea__control::-webkit-search-results-decoration {\n -webkit-appearance: none;\n }\n\n .textarea__control::placeholder {\n color: var(\n --nile-colors-dark-500\n );\n user-select: none;\n }\n\n .textarea__control:focus {\n outline: none;\n }\n\n .textarea--medium .textarea__control {\n padding: 0.5em 10px;\n }\n\n /* Resize types */\n .textarea--resize-none .textarea__control {\n resize: none;\n }\n\n .textarea--resize-vertical .textarea__control {\n resize: vertical;\n }\n\n .textarea--resize-auto .textarea__control {\n height: auto;\n resize: none;\n overflow-y: hidden;\n }\n\n .textarea--standard.textarea--warning {\n border-color: var(--nile-colors-yellow-500);\n }\n\n .textarea--standard.textarea--error {\n border-color: var(--nile-colors-red-500);\n }\n\n .textarea--standard.textarea--success {\n border-color: var(--nile-colors-green-500);\n }\n`;\n\nexport default [styles];\n"]}
1
+ {"version":3,"file":"nile-textarea.css.js","sourceRoot":"","sources":["../../../src/nile-textarea/nile-textarea.css.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAEF,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAEhC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqMxB,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-element';\n\n/**\n * TextArea CSS\n */\nexport const styles = css`\n .form-control .form-control__label {\n display: none;\n }\n\n .form-control .form-control__help-text {\n display: none;\n }\n\n /* Label */\n .form-control--has-label .form-control__label {\n display: inline-block;\n margin-bottom: 12px;\n color: var(--nile-colors-dark-900);\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n .form-control--has-label.form-control--medium .form-control__label {\n font-size: var(--nile-font-size-base);\n }\n\n :host([required]) .form-control--has-label .form-control__label::after {\n content: '*';\n margin-inline-start: -2px;\n color: #A4121C;\n }\n\n /* Help text */\n .form-control--has-help-text .form-control__help-text {\n display: block;\n color: var(--nile-colors-dark-500);\n margin-top: 6px;\n }\n\n /* Error message */\n .form-control__error-message {\n display: block;\n color: var(--nile-colors-red-700);\n margin-top: 12px;\n font-size: 12px;\n font-style: normal;\n line-height: 12px;\n letter-spacing: 0.2px;\n }\n\n .form-control--has-help-text.form-control--medium .form-control__help-text {\n font-size: 10.24px;\n }\n\n /* Host styles */\n :host {\n display: block;\n }\n\n /* Textarea styles */\n .textarea {\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n letter-spacing: 0.5px;\n vertical-align: middle;\n border-radius: var(--nile-radius-base-standard);\n transition: 0.3s color, 0.3s border, 0.3s box-shadow, 0.3s background-color;\n cursor: text;\n min-height:12px;\n }\n\n /* Standard textareas */\n .textarea--standard {\n background-color: var(\n --nile-colors-white-base\n );\n border: solid 1px var(--nile-colors-neutral-500);\n }\n\n .textarea--standard:hover:not(.textarea--disabled) {\n background-color: var(\n --nile-colors-white-base\n );\n border-color: var(\n --nile-colors-dark-900\n );\n border-radius: var(--nile-radius-base-standard);\n }\n\n .textarea--standard:hover:not(.textarea--disabled) .textarea__control {\n border-color: var(--nile-colors-dark-900);\n border-radius: var(--nile-radius-base-standard);\n }\n\n .textarea--standard.textarea--focused:not(.textarea--disabled) {\n background-color: var(\n --nile-colors-white-base\n );\n border-color: var(\n --nile-colors-primary-600\n );\n }\n\n .textarea--standard.textarea--focused:not(.textarea--disabled)\n .textarea__control {\n color: #000000;\n }\n\n .textarea--standard.textarea--disabled {\n border-color: var(\n --nile-colors-neutral-500\n );\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .textarea--standard.textarea--disabled .textarea__control {\n color: var(\n --nile-colors-neutral-500\n );\n }\n\n .textarea--standard.textarea--disabled .textarea__control::placeholder {\n color: var(\n --nile-colors-neutral-500\n );\n }\n\n /* Textarea control styles */\n .textarea__control {\n flex: 1 1 auto;\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px; /* 100% */\n letter-spacing: 0.2px;\n color: var(--nile-colors-dark-900);\n border: none;\n background: none;\n box-shadow: none;\n cursor: inherit;\n -webkit-appearance: none;\n }\n\n .textarea__control::-webkit-search-decoration,\n .textarea__control::-webkit-search-cancel-button,\n .textarea__control::-webkit-search-results-button,\n .textarea__control::-webkit-search-results-decoration {\n -webkit-appearance: none;\n }\n\n .textarea__control::placeholder {\n color: var(\n --nile-colors-dark-500\n );\n user-select: none;\n }\n\n .textarea__control:focus {\n outline: none;\n }\n\n .textarea--medium .textarea__control {\n padding: 0.5em 10px;\n }\n\n /* Resize types */\n .textarea--resize-none .textarea__control {\n resize: none;\n min-height:12px;\n }\n\n .textarea--resize-vertical .textarea__control {\n resize: vertical;\n min-height:12px;\n }\n\n .textarea--resize-auto .textarea__control {\n resize: none;\n overflow-y: hidden;\n min-height:12px;\n }\n\n .textarea--standard.textarea--warning {\n border-color: var(--nile-colors-yellow-500);\n }\n\n .textarea--standard.textarea--error {\n border-color: var(--nile-colors-red-500);\n }\n\n .textarea--standard.textarea--success {\n border-color: var(--nile-colors-green-500);\n }\n`;\n\nexport default [styles];\n"]}
@@ -98,6 +98,9 @@ let NileTextarea = class NileTextarea extends NileElement {
98
98
  let parentHeight = this.parentElement?.getBoundingClientRect().height;
99
99
  if (parentHeight) {
100
100
  parentHeight = parentHeight - 65;
101
+ if (parentHeight < 12) {
102
+ parentHeight = 12;
103
+ }
101
104
  this.shadowRoot?.querySelector('textarea')?.style.setProperty('height', `${parentHeight}px`);
102
105
  }
103
106
  });
@@ -254,6 +257,8 @@ let NileTextarea = class NileTextarea extends NileElement {
254
257
  @input=${this.handleInput}
255
258
  @focus=${this.handleFocus}
256
259
  @blur=${this.handleBlur}
260
+
261
+
257
262
  ></textarea>
258
263
  </div>
259
264
  </div>
@@ -1 +1 @@
1
- {"version":3,"file":"nile-textarea.js","sourceRoot":"","sources":["../../../src/nile-textarea/nile-textarea.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAa,IAAI,EAAE,QAAQ,EAAiC,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,QAAQ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,EAAE,CAAC;qDAI9C;AApLU,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CA8UxB;SA9UY,YAAY;AAgVzB,eAAe,YAAY,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, property, CSSResultArray, TemplateResult} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport {styles} from './nile-textarea.css';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query, state } from 'lit/decorators.js';\nimport { defaultValue } from '../internal/default-value';\nimport { FormControlController } from '../internal/form';\nimport { HasSlotController } from '../internal/slot';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * @summary Textareas collect data from the user and allow multiple lines of text.\n * @tag nile-text-area\n\n *\n * @slot label - The textarea's label. Alternatively, you can use the `label` attribute.\n * @slot help-text - Text that describes how to use the input. Alternatively, you can use the `help-text` attribute.\n *\n * @event nile-blur - Emitted when the control loses focus.\n * @event nile-change - Emitted when an alteration to the control's value is committed by the user.\n * @event nile-focus - Emitted when the control gains focus.\n * @event nile-input - Emitted when the control receives input.\n *\n * @csspart form-control - The form control that wraps the label, input, and help text.\n * @csspart form-control-label - The label's wrapper.\n * @csspart form-control-input - The input's wrapper.\n * @csspart form-control-help-text - The help text's wrapper.\n * @csspart base - The component's base wrapper.\n * @csspart textarea - The internal `<textarea>` control.\n */\n\n@customElement('nile-textarea')\nexport class NileTextarea extends NileElement {\n static styles: CSSResultGroup = styles;\n\n private readonly hasSlotController = new HasSlotController(this, 'help-text', 'label');\n private resizeObserver: ResizeObserver;\n\n @query('.textarea__control') input: HTMLTextAreaElement;\n\n @state() private hasFocus = false;\n @property() title = ''; // make reactive to pass through\n\n /** The name of the textarea, submitted as a name/value pair with form data. */\n @property() name = '';\n\n /** The current value of the textarea, submitted as a name/value pair with form data. */\n @property() value = '';\n\n /** The textarea's size. */\n @property({ reflect: true }) size = 'medium';\n\n /** Draws a filled textarea. */\n @property({ type: Boolean, reflect: true }) filled = false;\n\n /** The textarea's label. If you need to display HTML, use the `label` slot instead. */\n @property() label = '';\n\n /** The textarea's help text. If you need to display HTML, use the `help-text` slot instead. */\n @property({ attribute: 'help-text' }) helpText = '';\n\n /** The input's error message. If you need to display HTML, use the `error-message` slot instead. */\n @property({ attribute: 'error-message' }) errorMessage = '';\n\n /** Placeholder text to show as a hint when the input is empty. */\n @property() placeholder = '';\n\n /** The number of rows to display by default. */\n @property({ type: Number }) rows = 4;\n\n /** Controls how the textarea can be resized. */\n @property() resize: 'none' | 'vertical' | 'auto' = 'vertical';\n\n /** Disables the textarea. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Makes the textarea readonly. */\n @property({ type: Boolean, reflect: true }) readonly = false;\n\n /**\n * By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you\n * to place the form control outside of a form and associate it with the form that has this `id`. The form must be in\n * the same document or shadow root for this to work.\n */\n @property({ reflect: true }) form = '';\n\n /** Makes the textarea a required field. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n @property({ type: Number }) minlength: number;\n\n @property({ type: Number }) maxlength: number;\n\n /** Sets the input to a warning state, changing its visual appearance. */\n @property({ type: Boolean }) warning = false;\n\n /** Sets the input to an error state, changing its visual appearance. */\n @property({ type: Boolean }) error = false;\n\n /** Sets the input to a success state, changing its visual appearance. */\n @property({ type: Boolean }) success = false;\n\n /** Controls whether and how text input is automatically capitalized as it is entered by the user. */\n @property() autocapitalize: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters';\n\n /** Indicates whether the browser's autocorrect feature is on or off. */\n @property() autocorrect: string;\n\n /**\n * Specifies what permission the browser has to provide assistance in filling out form field values. Refer to\n * [this page on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for available values.\n */\n @property() autocomplete: string;\n\n /** Indicates that the input should receive focus on page load. */\n @property({ type: Boolean }) autofocus: boolean;\n\n /** Used to customize the label or icon of the Enter key on virtual keyboards. */\n @property() enterkeyhint: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';\n\n /** Enables spell checking on the textarea. */\n @property({\n type: Boolean,\n converter: {\n // Allow \"true|false\" attribute values but keep the property boolean\n fromAttribute: value => (!value || value === 'false' ? false : true),\n toAttribute: value => (value ? 'true' : 'false')\n }\n })\n spellcheck = true;\n\n /**\n * Tells the browser what type of data will be entered by the user, allowing it to display the appropriate virtual\n * keyboard on supportive devices.\n */\n @property() inputmode: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n\n /** The default value of the form control. Primarily used for resetting the form control. */\n @defaultValue() defaultValue = '';\n\n @property({ type: Boolean, reflect: true }) fullHeight = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.resizeObserver = new ResizeObserver(() => this.setTextareaHeight());\n\n this.updateComplete.then(() => {\n this.setTextareaHeight();\n this.resizeObserver.observe(this.input);\n });\n\n if(this.fullHeight){\n requestAnimationFrame(() => {\n let parentHeight = this.parentElement?.getBoundingClientRect().height;\n\n if (parentHeight) {\n parentHeight = parentHeight - 65;\n this.shadowRoot?.querySelector('textarea')?.style.setProperty('height', `${parentHeight}px`);\n }\n });\n }\n\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n if(this.input) {\n this.resizeObserver.unobserve(this.input);\n }\n this.emit('nile-destroy');\n }\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('nile-blur', { value: this.value });\n }\n\n private handleChange() {\n this.value = this.input.value;\n this.setTextareaHeight();\n this.emit('nile-change', { value: this.value });\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.emit('nile-focus', { value: this.value });\n }\n\n private handleInput() {\n this.value = this.input.value;\n this.emit('nile-input', { value: this.value });\n }\n\n private setTextareaHeight() {\n if (this.resize === 'auto') {\n this.input.style.height = 'auto';\n this.input.style.height = `${this.input.scrollHeight}px`;\n } else {\n (this.input.style.height as string | undefined) = undefined;\n }\n }\n\n @watch('rows', { waitUntilFirstUpdate: true })\n handleRowsChange() {\n this.setTextareaHeight();\n }\n\n @watch('value', { waitUntilFirstUpdate: true })\n async handleValueChange() {\n await this.updateComplete;\n this.setTextareaHeight();\n }\n\n /** Sets focus on the textarea. */\n focus(options?: FocusOptions) {\n this.input.focus(options);\n }\n\n /** Removes focus from the textarea. */\n blur() {\n this.input.blur();\n }\n\n /** Selects all the text in the textarea. */\n select() {\n this.input.select();\n }\n\n /** Gets or sets the textarea's scroll position. */\n scrollPosition(position?: { top?: number; left?: number }): { top: number; left: number } | undefined {\n if (position) {\n if (typeof position.top === 'number') this.input.scrollTop = position.top;\n if (typeof position.left === 'number') this.input.scrollLeft = position.left;\n return undefined;\n }\n\n return {\n top: this.input.scrollTop,\n left: this.input.scrollTop\n };\n }\n\n /** Sets the start and end positions of the text selection (0-based). */\n setSelectionRange(\n selectionStart: number,\n selectionEnd: number,\n selectionDirection: 'forward' | 'backward' | 'none' = 'none'\n ) {\n this.input.setSelectionRange(selectionStart, selectionEnd, selectionDirection);\n }\n\n /** Replaces a range of text with a new string. */\n setRangeText(\n replacement: string,\n start?: number,\n end?: number,\n selectMode?: 'select' | 'start' | 'end' | 'preserve'\n ) {\n // @ts-expect-error - start, end, and selectMode are optional\n this.input.setRangeText(replacement, start, end, selectMode);\n\n if (this.value !== this.input.value) {\n this.value = this.input.value;\n }\n\n if (this.value !== this.input.value) {\n this.value = this.input.value;\n this.setTextareaHeight();\n }\n }\n\n render() {\n const hasLabelSlot = this.hasSlotController.test('label');\n const hasHelpTextSlot = this.hasSlotController.test('help-text');\n const hasLabel = this.label ? true : !!hasLabelSlot;\n\n const hasHelpText = this.helpText ? true : false;\n const hasErrorMessage = this.errorMessage ? true : false;\n\n return html`\n <div\n part=\"form-control\"\n class=${classMap({\n 'form-control': true,\n 'form-control--medium': this.size === 'medium',\n 'form-control--has-label': hasLabel,\n 'form-control--has-help-text': hasHelpText\n })}\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=${hasLabel ? 'false' : 'true'}\n >\n <slot name=\"label\">${this.label}</slot>\n </label>\n\n <div part=\"form-control-input\" class=\"form-control-input\">\n <div\n part=\"base\"\n class=${classMap({\n textarea: true,\n 'textarea--medium': this.size === 'medium',\n 'textarea--warning': this.warning,\n 'textarea--error': this.error,\n 'textarea--success': this.success,\n 'textarea--standard': !this.filled,\n 'textarea--disabled': this.disabled,\n 'textarea--focused': this.hasFocus,\n 'textarea--empty': !this.value,\n 'textarea--resize-none': this.resize === 'none',\n 'textarea--resize-vertical': this.resize === 'vertical',\n 'textarea--resize-auto': this.resize === 'auto'\n })}\n >\n <textarea\n part=\"textarea\"\n id=\"input\"\n class=\"textarea__control\"\n title=${this.title /* An empty title prevents browser validation tooltips from appearing on hover */}\n name=${ifDefined(this.name)}\n .value=${live(this.value)}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n placeholder=${ifDefined(this.placeholder)}\n rows=${ifDefined(this.rows)}\n minlength=${ifDefined(this.minlength)}\n maxlength=${ifDefined(this.maxlength)}\n autocapitalize=${ifDefined(this.autocapitalize)}\n autocorrect=${ifDefined(this.autocorrect)}\n ?autofocus=${this.autofocus}\n spellcheck=${ifDefined(this.spellcheck)}\n enterkeyhint=${ifDefined(this.enterkeyhint)}\n inputmode=${ifDefined(this.inputmode)}\n aria-describedby=\"help-text\"\n @change=${this.handleChange}\n @input=${this.handleInput}\n @focus=${this.handleFocus}\n @blur=${this.handleBlur}\n ></textarea>\n </div>\n </div>\n\n ${\n hasHelpText\n ? html`\n <nile-form-help-text>${this.helpText}</nile-form-help-text>\n `\n : ``\n }\n\n ${\n hasErrorMessage\n ? html`\n <nile-form-error-message\n >${this.errorMessage}</nile-form-error-message\n >\n `\n : ``\n }\n </div>\n `;\n }\n}\n\nexport default NileTextarea;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-textarea': NileTextarea;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-textarea.js","sourceRoot":"","sources":["../../../src/nile-textarea/nile-textarea.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAa,IAAI,EAAE,QAAQ,EAAiC,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAGnD;;;;;;;;;;;;;;;;;;;GAmBG;AAGI,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,WAAW;IAAtC;;QAGY,sBAAiB,GAAG,IAAI,iBAAiB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;QAKtE,aAAQ,GAAG,KAAK,CAAC;QACtB,UAAK,GAAG,EAAE,CAAC,CAAC,gCAAgC;QAExD,+EAA+E;QACnE,SAAI,GAAG,EAAE,CAAC;QAEtB,wFAAwF;QAC5E,UAAK,GAAG,EAAE,CAAC;QAEvB,2BAA2B;QACE,SAAI,GAAG,QAAQ,CAAC;QAE7C,+BAA+B;QACa,WAAM,GAAG,KAAK,CAAC;QAE3D,uFAAuF;QAC3E,UA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CAAC,IAAI,CAAC;YACpE,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;SACjD;KACF,CAAC;gDACgB;AAMN;IAAX,QAAQ,EAAE;+CAAyF;AAGpF;IAAf,YAAY,EAAE;kDAAmB;AAEU;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAoB;AAmE/D;IADC,KAAK,CAAC,MAAM,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;oDAG7C;AAGK;IADL,KAAK,CAAC,OAAO,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;qDAI9C;AAvLU,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAmVxB;SAnVY,YAAY;AAqVzB,eAAe,YAAY,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, property, CSSResultArray, TemplateResult} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport {styles} from './nile-textarea.css';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query, state } from 'lit/decorators.js';\nimport { defaultValue } from '../internal/default-value';\nimport { FormControlController } from '../internal/form';\nimport { HasSlotController } from '../internal/slot';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * @summary Textareas collect data from the user and allow multiple lines of text.\n * @tag nile-text-area\n\n *\n * @slot label - The textarea's label. Alternatively, you can use the `label` attribute.\n * @slot help-text - Text that describes how to use the input. Alternatively, you can use the `help-text` attribute.\n *\n * @event nile-blur - Emitted when the control loses focus.\n * @event nile-change - Emitted when an alteration to the control's value is committed by the user.\n * @event nile-focus - Emitted when the control gains focus.\n * @event nile-input - Emitted when the control receives input.\n *\n * @csspart form-control - The form control that wraps the label, input, and help text.\n * @csspart form-control-label - The label's wrapper.\n * @csspart form-control-input - The input's wrapper.\n * @csspart form-control-help-text - The help text's wrapper.\n * @csspart base - The component's base wrapper.\n * @csspart textarea - The internal `<textarea>` control.\n */\n\n@customElement('nile-textarea')\nexport class NileTextarea extends NileElement {\n static styles: CSSResultGroup = styles;\n\n private readonly hasSlotController = new HasSlotController(this, 'help-text', 'label');\n private resizeObserver: ResizeObserver;\n\n @query('.textarea__control') input: HTMLTextAreaElement;\n\n @state() private hasFocus = false;\n @property() title = ''; // make reactive to pass through\n\n /** The name of the textarea, submitted as a name/value pair with form data. */\n @property() name = '';\n\n /** The current value of the textarea, submitted as a name/value pair with form data. */\n @property() value = '';\n\n /** The textarea's size. */\n @property({ reflect: true }) size = 'medium';\n\n /** Draws a filled textarea. */\n @property({ type: Boolean, reflect: true }) filled = false;\n\n /** The textarea's label. If you need to display HTML, use the `label` slot instead. */\n @property() label = '';\n\n /** The textarea's help text. If you need to display HTML, use the `help-text` slot instead. */\n @property({ attribute: 'help-text' }) helpText = '';\n\n /** The input's error message. If you need to display HTML, use the `error-message` slot instead. */\n @property({ attribute: 'error-message' }) errorMessage = '';\n\n /** Placeholder text to show as a hint when the input is empty. */\n @property() placeholder = '';\n\n /** The number of rows to display by default. */\n @property({ type: Number }) rows = 4;\n\n /** Controls how the textarea can be resized. */\n @property() resize: 'none' | 'vertical' | 'auto' = 'vertical';\n\n /** Disables the textarea. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Makes the textarea readonly. */\n @property({ type: Boolean, reflect: true }) readonly = false;\n\n /**\n * By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you\n * to place the form control outside of a form and associate it with the form that has this `id`. The form must be in\n * the same document or shadow root for this to work.\n */\n @property({ reflect: true }) form = '';\n\n /** Makes the textarea a required field. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n @property({ type: Number }) minlength: number;\n\n @property({ type: Number }) maxlength: number;\n\n /** Sets the input to a warning state, changing its visual appearance. */\n @property({ type: Boolean }) warning = false;\n\n /** Sets the input to an error state, changing its visual appearance. */\n @property({ type: Boolean }) error = false;\n\n /** Sets the input to a success state, changing its visual appearance. */\n @property({ type: Boolean }) success = false;\n\n /** Controls whether and how text input is automatically capitalized as it is entered by the user. */\n @property() autocapitalize: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters';\n\n /** Indicates whether the browser's autocorrect feature is on or off. */\n @property() autocorrect: string;\n\n /**\n * Specifies what permission the browser has to provide assistance in filling out form field values. Refer to\n * [this page on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for available values.\n */\n @property() autocomplete: string;\n\n /** Indicates that the input should receive focus on page load. */\n @property({ type: Boolean }) autofocus: boolean;\n\n /** Used to customize the label or icon of the Enter key on virtual keyboards. */\n @property() enterkeyhint: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';\n\n /** Enables spell checking on the textarea. */\n @property({\n type: Boolean,\n converter: {\n // Allow \"true|false\" attribute values but keep the property boolean\n fromAttribute: value => (!value || value === 'false' ? false : true),\n toAttribute: value => (value ? 'true' : 'false')\n }\n })\n spellcheck = true;\n\n /**\n * Tells the browser what type of data will be entered by the user, allowing it to display the appropriate virtual\n * keyboard on supportive devices.\n */\n @property() inputmode: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n\n /** The default value of the form control. Primarily used for resetting the form control. */\n @defaultValue() defaultValue = '';\n\n @property({ type: Boolean, reflect: true }) fullHeight = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.resizeObserver = new ResizeObserver(() => this.setTextareaHeight());\n\n this.updateComplete.then(() => {\n this.setTextareaHeight();\n this.resizeObserver.observe(this.input);\n });\n\n\n if(this.fullHeight){\n requestAnimationFrame(() => {\n let parentHeight = this.parentElement?.getBoundingClientRect().height;\n if (parentHeight) {\n parentHeight = parentHeight - 65;\n if (parentHeight<12) {\n parentHeight=12;\n }\n this.shadowRoot?.querySelector('textarea')?.style.setProperty('height', `${parentHeight}px`);\n }\n });\n }\n\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n if(this.input) {\n this.resizeObserver.unobserve(this.input);\n }\n this.emit('nile-destroy');\n }\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('nile-blur', { value: this.value });\n }\n\n private handleChange() {\n this.value = this.input.value;\n this.setTextareaHeight();\n this.emit('nile-change', { value: this.value });\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.emit('nile-focus', { value: this.value });\n }\n\n private handleInput() {\n this.value = this.input.value;\n this.emit('nile-input', { value: this.value });\n }\n\n private setTextareaHeight() {\n if (this.resize === 'auto') {\n this.input.style.height = 'auto';\n this.input.style.height = `${this.input.scrollHeight}px`;\n } else {\n (this.input.style.height as string | undefined) = undefined;\n }\n }\n\n @watch('rows', { waitUntilFirstUpdate: true })\n handleRowsChange() {\n this.setTextareaHeight();\n }\n\n @watch('value', { waitUntilFirstUpdate: true })\n async handleValueChange() {\n await this.updateComplete;\n this.setTextareaHeight();\n }\n\n /** Sets focus on the textarea. */\n focus(options?: FocusOptions) {\n this.input.focus(options);\n }\n\n /** Removes focus from the textarea. */\n blur() {\n this.input.blur();\n }\n\n /** Selects all the text in the textarea. */\n select() {\n this.input.select();\n }\n\n /** Gets or sets the textarea's scroll position. */\n scrollPosition(position?: { top?: number; left?: number }): { top: number; left: number } | undefined {\n if (position) {\n if (typeof position.top === 'number') this.input.scrollTop = position.top;\n if (typeof position.left === 'number') this.input.scrollLeft = position.left;\n return undefined;\n }\n\n return {\n top: this.input.scrollTop,\n left: this.input.scrollTop\n };\n }\n\n /** Sets the start and end positions of the text selection (0-based). */\n setSelectionRange(\n selectionStart: number,\n selectionEnd: number,\n selectionDirection: 'forward' | 'backward' | 'none' = 'none'\n ) {\n this.input.setSelectionRange(selectionStart, selectionEnd, selectionDirection);\n }\n\n /** Replaces a range of text with a new string. */\n setRangeText(\n replacement: string,\n start?: number,\n end?: number,\n selectMode?: 'select' | 'start' | 'end' | 'preserve'\n ) {\n // @ts-expect-error - start, end, and selectMode are optional\n this.input.setRangeText(replacement, start, end, selectMode);\n\n if (this.value !== this.input.value) {\n this.value = this.input.value;\n }\n\n if (this.value !== this.input.value) {\n this.value = this.input.value;\n this.setTextareaHeight();\n }\n }\n\n render() {\n const hasLabelSlot = this.hasSlotController.test('label');\n const hasHelpTextSlot = this.hasSlotController.test('help-text');\n const hasLabel = this.label ? true : !!hasLabelSlot;\n\n const hasHelpText = this.helpText ? true : false;\n const hasErrorMessage = this.errorMessage ? true : false;\n\n return html`\n <div\n part=\"form-control\"\n class=${classMap({\n 'form-control': true,\n 'form-control--medium': this.size === 'medium',\n 'form-control--has-label': hasLabel,\n 'form-control--has-help-text': hasHelpText\n })}\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=${hasLabel ? 'false' : 'true'}\n >\n <slot name=\"label\">${this.label}</slot>\n </label>\n\n <div part=\"form-control-input\" class=\"form-control-input\">\n <div\n part=\"base\"\n class=${classMap({\n textarea: true,\n 'textarea--medium': this.size === 'medium',\n 'textarea--warning': this.warning,\n 'textarea--error': this.error,\n 'textarea--success': this.success,\n 'textarea--standard': !this.filled,\n 'textarea--disabled': this.disabled,\n 'textarea--focused': this.hasFocus,\n 'textarea--empty': !this.value,\n 'textarea--resize-none': this.resize === 'none',\n 'textarea--resize-vertical': this.resize === 'vertical',\n 'textarea--resize-auto': this.resize === 'auto'\n })}\n >\n <textarea\n part=\"textarea\"\n id=\"input\"\n class=\"textarea__control\"\n title=${this.title /* An empty title prevents browser validation tooltips from appearing on hover */}\n name=${ifDefined(this.name)}\n .value=${live(this.value)}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n placeholder=${ifDefined(this.placeholder)}\n rows=${ifDefined(this.rows)}\n minlength=${ifDefined(this.minlength)}\n maxlength=${ifDefined(this.maxlength)}\n autocapitalize=${ifDefined(this.autocapitalize)}\n autocorrect=${ifDefined(this.autocorrect)}\n ?autofocus=${this.autofocus}\n spellcheck=${ifDefined(this.spellcheck)}\n enterkeyhint=${ifDefined(this.enterkeyhint)}\n inputmode=${ifDefined(this.inputmode)}\n aria-describedby=\"help-text\"\n @change=${this.handleChange}\n @input=${this.handleInput}\n @focus=${this.handleFocus}\n @blur=${this.handleBlur}\n\n \n ></textarea>\n </div>\n </div>\n\n ${\n hasHelpText\n ? html`\n <nile-form-help-text>${this.helpText}</nile-form-help-text>\n `\n : ``\n }\n\n ${\n hasErrorMessage\n ? html`\n <nile-form-error-message\n >${this.errorMessage}</nile-form-error-message\n >\n `\n : ``\n }\n </div>\n `;\n }\n}\n\nexport default NileTextarea;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-textarea': NileTextarea;\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ export { NileToast } from './nile-toast';
@@ -0,0 +1,2 @@
1
+ export { NileToast } from './nile-toast';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nile-toast/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { NileToast } from './nile-toast';\n"]}
@@ -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
+ * Toast CSS
9
+ */
10
+ export declare const styles: import("lit-element").CSSResult;
11
+ declare const _default: import("lit-element").CSSResult[];
12
+ export default _default;