@aquera/nile-elements 0.1.36-beta-1.3 → 0.1.36-beta-1.4

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 (453) hide show
  1. package/README.md +12 -75
  2. package/demo/index.css +4 -7
  3. package/demo/index.html +38 -20
  4. package/demo/variables.css +0 -13
  5. package/demo/variables_v2.css +0 -13
  6. package/dist/{fixture-76051ef1.esm.js → fixture-178ed8d2.esm.js} +1 -1
  7. package/dist/{fixture-948ae33c.cjs.js → fixture-bb486165.cjs.js} +2 -2
  8. package/dist/{fixture-948ae33c.cjs.js.map → fixture-bb486165.cjs.js.map} +1 -1
  9. package/dist/{fixture-e6fdfbfa.esm.js → fixture-c4e75e04.esm.js} +1 -1
  10. package/dist/{fixture-7bfb866e.cjs.js → fixture-d7bf42eb.cjs.js} +2 -2
  11. package/dist/{fixture-7bfb866e.cjs.js.map → fixture-d7bf42eb.cjs.js.map} +1 -1
  12. package/dist/index.cjs.js +1 -1
  13. package/dist/index.esm.js +1 -1
  14. package/dist/internal/animate.cjs.js +1 -1
  15. package/dist/internal/animate.cjs.js.map +1 -1
  16. package/dist/internal/animate.esm.js +1 -1
  17. package/dist/nile-accordion/nile-accordian.test.cjs.js +1 -1
  18. package/dist/nile-accordion/nile-accordian.test.esm.js +1 -1
  19. package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +1 -1
  20. package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +1 -1
  21. package/dist/nile-avatar/nile-avatar.test.cjs.js +1 -1
  22. package/dist/nile-avatar/nile-avatar.test.esm.js +1 -1
  23. package/dist/nile-badge/nile-badge.test.cjs.js +1 -1
  24. package/dist/nile-badge/nile-badge.test.esm.js +1 -1
  25. package/dist/nile-button/nile-button.test.cjs.js +1 -1
  26. package/dist/nile-button/nile-button.test.esm.js +1 -1
  27. package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js +1 -1
  28. package/dist/nile-button-toggle-group/nile-button-toggle-group.test.esm.js +1 -1
  29. package/dist/nile-calendar/nile-calendar.test.cjs.js +1 -1
  30. package/dist/nile-calendar/nile-calendar.test.esm.js +1 -1
  31. package/dist/nile-card/nile-card.test.cjs.js +1 -1
  32. package/dist/nile-card/nile-card.test.esm.js +1 -1
  33. package/dist/nile-checkbox/nile-checkbox.test.cjs.js +1 -1
  34. package/dist/nile-checkbox/nile-checkbox.test.esm.js +1 -1
  35. package/dist/nile-chip/nile-chip.cjs.js +1 -1
  36. package/dist/nile-chip/nile-chip.cjs.js.map +1 -1
  37. package/dist/nile-chip/nile-chip.esm.js +8 -17
  38. package/dist/nile-chip/nile-chip.test.cjs.js +1 -1
  39. package/dist/nile-chip/nile-chip.test.esm.js +1 -1
  40. package/dist/nile-dialog/nile-dialog.test.cjs.js +1 -1
  41. package/dist/nile-dialog/nile-dialog.test.esm.js +1 -1
  42. package/dist/nile-drawer/nile-drawer.test.cjs.js +1 -1
  43. package/dist/nile-drawer/nile-drawer.test.esm.js +1 -1
  44. package/dist/nile-dropdown/nile-dropdown.test.cjs.js +1 -1
  45. package/dist/nile-dropdown/nile-dropdown.test.esm.js +1 -1
  46. package/dist/nile-empty-state/nile-empty-state.test.cjs.js +1 -1
  47. package/dist/nile-empty-state/nile-empty-state.test.esm.js +1 -1
  48. package/dist/nile-error-message/nile-error-message.cjs.js +1 -1
  49. package/dist/nile-error-message/nile-error-message.cjs.js.map +1 -1
  50. package/dist/nile-error-message/nile-error-message.css.cjs.js +1 -1
  51. package/dist/nile-error-message/nile-error-message.css.cjs.js.map +1 -1
  52. package/dist/nile-error-message/nile-error-message.css.esm.js +4 -6
  53. package/dist/nile-error-message/nile-error-message.esm.js +4 -4
  54. package/dist/nile-error-message/nile-error-message.test.cjs.js +1 -1
  55. package/dist/nile-error-message/nile-error-message.test.esm.js +1 -1
  56. package/dist/nile-error-notification/nile-error-notification.css.cjs.js +1 -1
  57. package/dist/nile-error-notification/nile-error-notification.css.cjs.js.map +1 -1
  58. package/dist/nile-error-notification/nile-error-notification.css.esm.js +1 -1
  59. package/dist/nile-filter-chip/nile-filter-chip.cjs.js +1 -1
  60. package/dist/nile-filter-chip/nile-filter-chip.cjs.js.map +1 -1
  61. package/dist/nile-filter-chip/nile-filter-chip.css.cjs.js +1 -1
  62. package/dist/nile-filter-chip/nile-filter-chip.css.cjs.js.map +1 -1
  63. package/dist/nile-filter-chip/nile-filter-chip.css.esm.js +17 -40
  64. package/dist/nile-filter-chip/nile-filter-chip.esm.js +15 -24
  65. package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js +1 -1
  66. package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js.map +1 -1
  67. package/dist/nile-filter-chip/nile-filter-chip.test.esm.js +16 -16
  68. package/dist/nile-form-group/nile-form-group.test.cjs.js +1 -1
  69. package/dist/nile-form-group/nile-form-group.test.esm.js +1 -1
  70. package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js +1 -1
  71. package/dist/nile-form-help-text/nile-form-help-text.test.esm.js +1 -1
  72. package/dist/nile-hero/nile-hero.test.cjs.js +1 -1
  73. package/dist/nile-hero/nile-hero.test.esm.js +1 -1
  74. package/dist/nile-icon/icons/svg/accessreview.cjs.js +1 -1
  75. package/dist/nile-icon/icons/svg/accessreview.cjs.js.map +1 -1
  76. package/dist/nile-icon/icons/svg/accessreview.esm.js +1 -1
  77. package/dist/nile-icon/nile-icon.test.cjs.js +1 -1
  78. package/dist/nile-icon/nile-icon.test.esm.js +1 -1
  79. package/dist/nile-input/nile-input.test.cjs.js +1 -1
  80. package/dist/nile-input/nile-input.test.esm.js +1 -1
  81. package/dist/nile-link/nile-link.test.cjs.js +1 -1
  82. package/dist/nile-link/nile-link.test.esm.js +1 -1
  83. package/dist/nile-loader/nile-loader.test.cjs.js +1 -1
  84. package/dist/nile-loader/nile-loader.test.esm.js +1 -1
  85. package/dist/nile-popover/nile-popover.test.cjs.js +1 -1
  86. package/dist/nile-popover/nile-popover.test.esm.js +1 -1
  87. package/dist/nile-popup/nile-popup.test.cjs.js +1 -1
  88. package/dist/nile-popup/nile-popup.test.esm.js +1 -1
  89. package/dist/nile-progress-bar/nile-progress-bar.css.cjs.js +1 -1
  90. package/dist/nile-progress-bar/nile-progress-bar.css.cjs.js.map +1 -1
  91. package/dist/nile-progress-bar/nile-progress-bar.css.esm.js +0 -1
  92. package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js +1 -1
  93. package/dist/nile-progress-bar/nile-progress-bar.test.esm.js +1 -1
  94. package/dist/nile-radio/nile-radio.test.cjs.js +1 -1
  95. package/dist/nile-radio/nile-radio.test.esm.js +1 -1
  96. package/dist/nile-radio-group/nile-radio-group.test.cjs.js +1 -1
  97. package/dist/nile-radio-group/nile-radio-group.test.esm.js +1 -1
  98. package/dist/nile-select/nile-select.cjs.js +1 -1
  99. package/dist/nile-select/nile-select.cjs.js.map +1 -1
  100. package/dist/nile-select/nile-select.esm.js +1 -1
  101. package/dist/nile-select/nile-select.test.cjs.js +1 -1
  102. package/dist/nile-select/nile-select.test.esm.js +1 -1
  103. package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +1 -1
  104. package/dist/nile-slide-toggle/nile-slide-toggle.test.esm.js +1 -1
  105. package/dist/nile-tab-group/nile-tab-group.test.cjs.js +1 -1
  106. package/dist/nile-tab-group/nile-tab-group.test.esm.js +1 -1
  107. package/dist/nile-table/nile-table.cjs.js.map +1 -1
  108. package/dist/nile-textarea/nile-textarea.test.cjs.js +1 -1
  109. package/dist/nile-textarea/nile-textarea.test.esm.js +1 -1
  110. package/dist/nile-tooltip/index.cjs.js +1 -1
  111. package/dist/nile-tooltip/index.esm.js +1 -1
  112. package/dist/nile-tooltip/nile-tooltip.cjs.js +1 -1
  113. package/dist/nile-tooltip/nile-tooltip.cjs.js.map +1 -1
  114. package/dist/nile-tooltip/nile-tooltip.css.cjs.js +1 -1
  115. package/dist/nile-tooltip/nile-tooltip.css.cjs.js.map +1 -1
  116. package/dist/nile-tooltip/nile-tooltip.css.esm.js +45 -78
  117. package/dist/nile-tooltip/nile-tooltip.esm.js +28 -23
  118. package/dist/nile-tooltip/nile-tooltip.test.cjs.js +1 -1
  119. package/dist/nile-tooltip/nile-tooltip.test.esm.js +1 -1
  120. package/dist/src/index.d.ts +0 -1
  121. package/dist/src/index.js +0 -1
  122. package/dist/src/index.js.map +1 -1
  123. package/dist/src/nile-chip/nile-chip.js +0 -9
  124. package/dist/src/nile-chip/nile-chip.js.map +1 -1
  125. package/dist/src/nile-error-message/nile-error-message.css.js +4 -6
  126. package/dist/src/nile-error-message/nile-error-message.css.js.map +1 -1
  127. package/dist/src/nile-error-message/nile-error-message.d.ts +0 -4
  128. package/dist/src/nile-error-message/nile-error-message.js +0 -20
  129. package/dist/src/nile-error-message/nile-error-message.js.map +1 -1
  130. package/dist/src/nile-error-notification/nile-error-notification.css.js +1 -1
  131. package/dist/src/nile-error-notification/nile-error-notification.css.js.map +1 -1
  132. package/dist/src/nile-filter-chip/nile-filter-chip.css.js +17 -40
  133. package/dist/src/nile-filter-chip/nile-filter-chip.css.js.map +1 -1
  134. package/dist/src/nile-filter-chip/nile-filter-chip.d.ts +3 -4
  135. package/dist/src/nile-filter-chip/nile-filter-chip.js +12 -25
  136. package/dist/src/nile-filter-chip/nile-filter-chip.js.map +1 -1
  137. package/dist/src/nile-filter-chip/nile-filter-chip.test.js +12 -12
  138. package/dist/src/nile-filter-chip/nile-filter-chip.test.js.map +1 -1
  139. package/dist/src/nile-icon/icons/svg/accessreview.d.ts +1 -1
  140. package/dist/src/nile-icon/icons/svg/accessreview.js +1 -1
  141. package/dist/src/nile-icon/icons/svg/accessreview.js.map +1 -1
  142. package/dist/src/nile-new-error/index.d.ts +1 -0
  143. package/dist/src/nile-new-error/index.js +2 -0
  144. package/dist/src/nile-new-error/index.js.map +1 -0
  145. package/dist/src/{nile-file-preview/nile-file-preview.css.d.ts → nile-new-error/nile-new-error.css.d.ts} +1 -1
  146. package/dist/src/nile-new-error/nile-new-error.css.js +38 -0
  147. package/dist/src/nile-new-error/nile-new-error.css.js.map +1 -0
  148. package/dist/src/nile-new-error/nile-new-error.d.ts +36 -0
  149. package/dist/src/nile-new-error/nile-new-error.js +74 -0
  150. package/dist/src/nile-new-error/nile-new-error.js.map +1 -0
  151. package/dist/src/nile-progress-bar/nile-progress-bar.css.js +0 -1
  152. package/dist/src/nile-progress-bar/nile-progress-bar.css.js.map +1 -1
  153. package/dist/src/nile-select/nile-select.js +1 -1
  154. package/dist/src/nile-select/nile-select.js.map +1 -1
  155. package/dist/src/nile-table/nile-table.js.map +1 -1
  156. package/dist/src/nile-tooltip/nile-tooltip.css.js +43 -76
  157. package/dist/src/nile-tooltip/nile-tooltip.css.js.map +1 -1
  158. package/dist/src/nile-tooltip/nile-tooltip.d.ts +46 -24
  159. package/dist/src/nile-tooltip/nile-tooltip.js +232 -235
  160. package/dist/src/nile-tooltip/nile-tooltip.js.map +1 -1
  161. package/dist/src/nile-virtual-list/index.d.ts +1 -0
  162. package/dist/src/nile-virtual-list/index.js +2 -0
  163. package/dist/src/{nile-file-preview → nile-virtual-list}/index.js.map +1 -1
  164. package/dist/src/{nile-file-upload/nile-file-upload.css.d.ts → nile-virtual-list/nile-virtual-list.css.d.ts} +1 -1
  165. package/dist/src/nile-virtual-list/nile-virtual-list.css.js +25 -0
  166. package/dist/src/nile-virtual-list/nile-virtual-list.css.js.map +1 -0
  167. package/dist/src/nile-virtual-list/nile-virtual-list.d.ts +28 -0
  168. package/dist/src/nile-virtual-list/nile-virtual-list.js +69 -0
  169. package/dist/src/nile-virtual-list/nile-virtual-list.js.map +1 -0
  170. package/dist/src/nile-virtual-scroll/index.d.ts +1 -0
  171. package/dist/src/nile-virtual-scroll/index.js +2 -0
  172. package/dist/src/nile-virtual-scroll/index.js.map +1 -0
  173. package/dist/src/{nile-pagination/nile-pagination.css.d.ts → nile-virtual-scroll/nile-virtual-scroll.css.d.ts} +2 -2
  174. package/dist/src/{nile-rich-text-editor/nile-rich-text-editor.css.js → nile-virtual-scroll/nile-virtual-scroll.css.js} +3 -3
  175. package/dist/src/nile-virtual-scroll/nile-virtual-scroll.css.js.map +1 -0
  176. package/dist/src/nile-virtual-scroll/nile-virtual-scroll.d.ts +54 -0
  177. package/dist/src/nile-virtual-scroll/nile-virtual-scroll.js +196 -0
  178. package/dist/src/nile-virtual-scroll/nile-virtual-scroll.js.map +1 -0
  179. package/dist/src/nile-virtual-scroll/nile-virtual-scroll.utils.d.ts +23 -0
  180. package/dist/src/nile-virtual-scroll/nile-virtual-scroll.utils.js +48 -0
  181. package/dist/src/nile-virtual-scroll/nile-virtual-scroll.utils.js.map +1 -0
  182. package/dist/src/nile-virtual-select/event-handlers.d.ts +19 -0
  183. package/dist/src/nile-virtual-select/event-handlers.js +153 -0
  184. package/dist/src/nile-virtual-select/event-handlers.js.map +1 -0
  185. package/dist/src/nile-virtual-select/index.d.ts +1 -0
  186. package/dist/src/nile-virtual-select/index.js +2 -0
  187. package/dist/src/nile-virtual-select/index.js.map +1 -0
  188. package/dist/src/nile-virtual-select/models.d.ts +33 -0
  189. package/dist/src/nile-virtual-select/models.js +5 -0
  190. package/dist/src/nile-virtual-select/models.js.map +1 -0
  191. package/dist/src/nile-virtual-select/nile-virtual-select.css.d.ts +12 -0
  192. package/dist/src/nile-virtual-select/nile-virtual-select.css.js +463 -0
  193. package/dist/src/nile-virtual-select/nile-virtual-select.css.js.map +1 -0
  194. package/dist/src/nile-virtual-select/nile-virtual-select.d.ts +239 -0
  195. package/dist/src/nile-virtual-select/nile-virtual-select.js +1287 -0
  196. package/dist/src/nile-virtual-select/nile-virtual-select.js.map +1 -0
  197. package/dist/src/nile-virtual-select/nile-virtual-select.test.js +2 -0
  198. package/dist/src/nile-virtual-select/nile-virtual-select.test.js.map +1 -0
  199. package/dist/src/nile-virtual-select/nile-virtual-select.utils.js +2 -0
  200. package/dist/src/nile-virtual-select/nile-virtual-select.utils.js.map +1 -0
  201. package/dist/src/nile-virtual-select/option-utils.d.ts +15 -0
  202. package/dist/src/nile-virtual-select/option-utils.js +59 -0
  203. package/dist/src/nile-virtual-select/option-utils.js.map +1 -0
  204. package/dist/tsconfig.tsbuildinfo +1 -1
  205. package/package.json +2 -2
  206. package/plop-templates/lit/index.ts.hbs +1 -1
  207. package/plop-templates/lit/lit.css.ts.hbs +1 -1
  208. package/plop-templates/lit/lit.ts.hbs +3 -7
  209. package/plopfile.js +1 -32
  210. package/src/index.ts +1 -2
  211. package/src/nile-chip/nile-chip.ts +0 -9
  212. package/src/nile-error-message/nile-error-message.css.ts +4 -6
  213. package/src/nile-error-message/nile-error-message.ts +0 -18
  214. package/src/nile-error-notification/nile-error-notification.css.ts +1 -1
  215. package/src/nile-icon/icons/svg/accessreview.ts +1 -1
  216. package/src/nile-progress-bar/nile-progress-bar.css.ts +0 -1
  217. package/src/nile-select/nile-select.ts +1 -1
  218. package/src/nile-table/nile-table.ts +2 -2
  219. package/src/nile-tooltip/nile-tooltip.css.ts +44 -77
  220. package/src/nile-tooltip/nile-tooltip.ts +230 -268
  221. package/vscode-html-custom-data.json +95 -144
  222. package/dist/_commonjsHelpers-e8f8776f.cjs.js +0 -2
  223. package/dist/_commonjsHelpers-e8f8776f.cjs.js.map +0 -1
  224. package/dist/_commonjsHelpers-f94d783e.esm.js +0 -1
  225. package/dist/axe.min-61450170.cjs.js +0 -12
  226. package/dist/axe.min-61450170.cjs.js.map +0 -1
  227. package/dist/axe.min-640ded4a.esm.js +0 -12
  228. package/dist/fixture-205f11fa.cjs.js +0 -395
  229. package/dist/fixture-205f11fa.cjs.js.map +0 -1
  230. package/dist/fixture-2b5b3aba.esm.js +0 -569
  231. package/dist/lit-html-39a6718c.esm.js +0 -6
  232. package/dist/lit-html-9b3af046.cjs.js +0 -6
  233. package/dist/lit-html-9b3af046.cjs.js.map +0 -1
  234. package/dist/nile-file-preview/index.cjs.js +0 -2
  235. package/dist/nile-file-preview/index.cjs.js.map +0 -1
  236. package/dist/nile-file-preview/index.esm.js +0 -1
  237. package/dist/nile-file-preview/nile-file-preview.cjs.js +0 -2
  238. package/dist/nile-file-preview/nile-file-preview.cjs.js.map +0 -1
  239. package/dist/nile-file-preview/nile-file-preview.css.cjs.js +0 -2
  240. package/dist/nile-file-preview/nile-file-preview.css.cjs.js.map +0 -1
  241. package/dist/nile-file-preview/nile-file-preview.css.esm.js +0 -521
  242. package/dist/nile-file-preview/nile-file-preview.esm.js +0 -3
  243. package/dist/nile-file-preview/nile-file-preview.template.cjs.js +0 -2
  244. package/dist/nile-file-preview/nile-file-preview.template.cjs.js.map +0 -1
  245. package/dist/nile-file-preview/nile-file-preview.template.esm.js +0 -117
  246. package/dist/nile-file-preview/nile-file-preview.test.cjs.js +0 -2
  247. package/dist/nile-file-preview/nile-file-preview.test.cjs.js.map +0 -1
  248. package/dist/nile-file-preview/nile-file-preview.test.esm.js +0 -1
  249. package/dist/nile-file-preview/types/file-preview.enums.cjs.js +0 -2
  250. package/dist/nile-file-preview/types/file-preview.enums.cjs.js.map +0 -1
  251. package/dist/nile-file-preview/types/file-preview.enums.esm.js +0 -1
  252. package/dist/nile-file-preview/types/file-preview.interface.cjs.js +0 -2
  253. package/dist/nile-file-preview/types/file-preview.interface.cjs.js.map +0 -1
  254. package/dist/nile-file-preview/types/file-preview.interface.esm.js +0 -1
  255. package/dist/nile-file-preview/types/index.cjs.js +0 -2
  256. package/dist/nile-file-preview/types/index.cjs.js.map +0 -1
  257. package/dist/nile-file-preview/types/index.esm.js +0 -1
  258. package/dist/nile-file-preview/utils/file-preview.util.cjs.js +0 -2
  259. package/dist/nile-file-preview/utils/file-preview.util.cjs.js.map +0 -1
  260. package/dist/nile-file-preview/utils/file-preview.util.esm.js +0 -1
  261. package/dist/nile-file-preview/utils/index.cjs.js +0 -2
  262. package/dist/nile-file-preview/utils/index.cjs.js.map +0 -1
  263. package/dist/nile-file-preview/utils/index.esm.js +0 -1
  264. package/dist/nile-file-upload/index.cjs.js +0 -2
  265. package/dist/nile-file-upload/index.cjs.js.map +0 -1
  266. package/dist/nile-file-upload/index.esm.js +0 -1
  267. package/dist/nile-file-upload/nile-file-upload.cjs.js +0 -2
  268. package/dist/nile-file-upload/nile-file-upload.cjs.js.map +0 -1
  269. package/dist/nile-file-upload/nile-file-upload.css.cjs.js +0 -2
  270. package/dist/nile-file-upload/nile-file-upload.css.cjs.js.map +0 -1
  271. package/dist/nile-file-upload/nile-file-upload.css.esm.js +0 -535
  272. package/dist/nile-file-upload/nile-file-upload.esm.js +0 -3
  273. package/dist/nile-file-upload/nile-file-upload.template.cjs.js +0 -10
  274. package/dist/nile-file-upload/nile-file-upload.template.cjs.js.map +0 -1
  275. package/dist/nile-file-upload/nile-file-upload.template.esm.js +0 -155
  276. package/dist/nile-file-upload/nile-file-upload.test.cjs.js +0 -2
  277. package/dist/nile-file-upload/nile-file-upload.test.cjs.js.map +0 -1
  278. package/dist/nile-file-upload/nile-file-upload.test.esm.js +0 -1
  279. package/dist/nile-file-upload/types/file-upload.enums.cjs.js +0 -2
  280. package/dist/nile-file-upload/types/file-upload.enums.cjs.js.map +0 -1
  281. package/dist/nile-file-upload/types/file-upload.enums.esm.js +0 -1
  282. package/dist/nile-file-upload/types/file-upload.type.cjs.js +0 -2
  283. package/dist/nile-file-upload/types/file-upload.type.cjs.js.map +0 -1
  284. package/dist/nile-file-upload/types/file-upload.type.esm.js +0 -1
  285. package/dist/nile-file-upload/types/index.cjs.js +0 -2
  286. package/dist/nile-file-upload/types/index.cjs.js.map +0 -1
  287. package/dist/nile-file-upload/types/index.esm.js +0 -1
  288. package/dist/nile-file-upload/utils/drag-drop.util.cjs.js +0 -2
  289. package/dist/nile-file-upload/utils/drag-drop.util.cjs.js.map +0 -1
  290. package/dist/nile-file-upload/utils/drag-drop.util.esm.js +0 -1
  291. package/dist/nile-file-upload/utils/file-validation.util.cjs.js +0 -2
  292. package/dist/nile-file-upload/utils/file-validation.util.cjs.js.map +0 -1
  293. package/dist/nile-file-upload/utils/file-validation.util.esm.js +0 -1
  294. package/dist/nile-rich-text-editor/index.cjs.js +0 -2
  295. package/dist/nile-rich-text-editor/index.cjs.js.map +0 -1
  296. package/dist/nile-rich-text-editor/index.esm.js +0 -1
  297. package/dist/nile-rich-text-editor/nile-rich-text-editor.cjs.js +0 -10
  298. package/dist/nile-rich-text-editor/nile-rich-text-editor.cjs.js.map +0 -1
  299. package/dist/nile-rich-text-editor/nile-rich-text-editor.css.cjs.js +0 -2
  300. package/dist/nile-rich-text-editor/nile-rich-text-editor.css.cjs.js.map +0 -1
  301. package/dist/nile-rich-text-editor/nile-rich-text-editor.css.esm.js +0 -5
  302. package/dist/nile-rich-text-editor/nile-rich-text-editor.esm.js +0 -28
  303. package/dist/nile-rich-text-editor/nile-rich-text-editor.template.cjs.js +0 -2
  304. package/dist/nile-rich-text-editor/nile-rich-text-editor.template.cjs.js.map +0 -1
  305. package/dist/nile-rich-text-editor/nile-rich-text-editor.template.esm.js +0 -1
  306. package/dist/nile-rich-text-editor/nile-rich-text-editor.test.cjs.js +0 -2
  307. package/dist/nile-rich-text-editor/nile-rich-text-editor.test.cjs.js.map +0 -1
  308. package/dist/nile-rich-text-editor/nile-rich-text-editor.test.esm.js +0 -1
  309. package/dist/nile-rich-text-editor/sub-components/nile-rich-text-editor.cjs.js +0 -2
  310. package/dist/nile-rich-text-editor/sub-components/nile-rich-text-editor.cjs.js.map +0 -1
  311. package/dist/nile-rich-text-editor/sub-components/nile-rich-text-editor.esm.js +0 -1
  312. package/dist/nile-rich-text-editor/types/index.cjs.js +0 -2
  313. package/dist/nile-rich-text-editor/types/index.cjs.js.map +0 -1
  314. package/dist/nile-rich-text-editor/types/index.esm.js +0 -1
  315. package/dist/nile-rich-text-editor/types/rich-text-editor.type.cjs.js +0 -2
  316. package/dist/nile-rich-text-editor/types/rich-text-editor.type.cjs.js.map +0 -1
  317. package/dist/nile-rich-text-editor/types/rich-text-editor.type.esm.js +0 -1
  318. package/dist/nile-rich-text-editor/utils/nile-rich-text-editor.utils.cjs.js +0 -2
  319. package/dist/nile-rich-text-editor/utils/nile-rich-text-editor.utils.cjs.js.map +0 -1
  320. package/dist/nile-rich-text-editor/utils/nile-rich-text-editor.utils.esm.js +0 -1
  321. package/dist/src/nile-file-preview/index.d.ts +0 -1
  322. package/dist/src/nile-file-preview/index.js +0 -2
  323. package/dist/src/nile-file-preview/nile-file-preview.css.js +0 -533
  324. package/dist/src/nile-file-preview/nile-file-preview.css.js.map +0 -1
  325. package/dist/src/nile-file-preview/nile-file-preview.d.ts +0 -48
  326. package/dist/src/nile-file-preview/nile-file-preview.js +0 -149
  327. package/dist/src/nile-file-preview/nile-file-preview.js.map +0 -1
  328. package/dist/src/nile-file-preview/nile-file-preview.template.d.ts +0 -11
  329. package/dist/src/nile-file-preview/nile-file-preview.template.js +0 -144
  330. package/dist/src/nile-file-preview/nile-file-preview.template.js.map +0 -1
  331. package/dist/src/nile-file-preview/nile-file-preview.test.d.ts +0 -7
  332. package/dist/src/nile-file-preview/nile-file-preview.test.js +0 -30
  333. package/dist/src/nile-file-preview/nile-file-preview.test.js.map +0 -1
  334. package/dist/src/nile-file-preview/types/file-preview.enums.d.ts +0 -23
  335. package/dist/src/nile-file-preview/types/file-preview.enums.js +0 -28
  336. package/dist/src/nile-file-preview/types/file-preview.enums.js.map +0 -1
  337. package/dist/src/nile-file-preview/types/file-preview.interface.d.ts +0 -4
  338. package/dist/src/nile-file-preview/types/file-preview.interface.js +0 -2
  339. package/dist/src/nile-file-preview/types/file-preview.interface.js.map +0 -1
  340. package/dist/src/nile-file-preview/types/index.d.ts +0 -2
  341. package/dist/src/nile-file-preview/types/index.js +0 -3
  342. package/dist/src/nile-file-preview/types/index.js.map +0 -1
  343. package/dist/src/nile-file-preview/types/nile-file-preview.enums.d.ts +0 -26
  344. package/dist/src/nile-file-preview/types/nile-file-preview.enums.js +0 -31
  345. package/dist/src/nile-file-preview/types/nile-file-preview.enums.js.map +0 -1
  346. package/dist/src/nile-file-preview/types/nile-file-preview.interface.d.ts +0 -4
  347. package/dist/src/nile-file-preview/types/nile-file-preview.interface.js +0 -2
  348. package/dist/src/nile-file-preview/types/nile-file-preview.interface.js.map +0 -1
  349. package/dist/src/nile-file-preview/utils/file-preview.util.d.ts +0 -3
  350. package/dist/src/nile-file-preview/utils/file-preview.util.js +0 -29
  351. package/dist/src/nile-file-preview/utils/file-preview.util.js.map +0 -1
  352. package/dist/src/nile-file-preview/utils/index.d.ts +0 -1
  353. package/dist/src/nile-file-preview/utils/index.js +0 -2
  354. package/dist/src/nile-file-preview/utils/index.js.map +0 -1
  355. package/dist/src/nile-file-preview/utils/nile-file-preview.util.d.ts +0 -4
  356. package/dist/src/nile-file-preview/utils/nile-file-preview.util.js +0 -45
  357. package/dist/src/nile-file-preview/utils/nile-file-preview.util.js.map +0 -1
  358. package/dist/src/nile-file-upload/index.d.ts +0 -1
  359. package/dist/src/nile-file-upload/index.js +0 -2
  360. package/dist/src/nile-file-upload/index.js.map +0 -1
  361. package/dist/src/nile-file-upload/nile-file-upload.css.js +0 -547
  362. package/dist/src/nile-file-upload/nile-file-upload.css.js.map +0 -1
  363. package/dist/src/nile-file-upload/nile-file-upload.d.ts +0 -45
  364. package/dist/src/nile-file-upload/nile-file-upload.js +0 -148
  365. package/dist/src/nile-file-upload/nile-file-upload.js.map +0 -1
  366. package/dist/src/nile-file-upload/nile-file-upload.template.d.ts +0 -11
  367. package/dist/src/nile-file-upload/nile-file-upload.template.js +0 -163
  368. package/dist/src/nile-file-upload/nile-file-upload.template.js.map +0 -1
  369. package/dist/src/nile-file-upload/nile-file-upload.test.d.ts +0 -7
  370. package/dist/src/nile-file-upload/nile-file-upload.test.js +0 -30
  371. package/dist/src/nile-file-upload/nile-file-upload.test.js.map +0 -1
  372. package/dist/src/nile-file-upload/types/file-upload.enums.d.ts +0 -28
  373. package/dist/src/nile-file-upload/types/file-upload.enums.js +0 -35
  374. package/dist/src/nile-file-upload/types/file-upload.enums.js.map +0 -1
  375. package/dist/src/nile-file-upload/types/file-upload.type.d.ts +0 -4
  376. package/dist/src/nile-file-upload/types/file-upload.type.js +0 -2
  377. package/dist/src/nile-file-upload/types/file-upload.type.js.map +0 -1
  378. package/dist/src/nile-file-upload/types/index.d.ts +0 -2
  379. package/dist/src/nile-file-upload/types/index.js +0 -3
  380. package/dist/src/nile-file-upload/types/index.js.map +0 -1
  381. package/dist/src/nile-file-upload/utils/drag-drop.util.d.ts +0 -19
  382. package/dist/src/nile-file-upload/utils/drag-drop.util.js +0 -77
  383. package/dist/src/nile-file-upload/utils/drag-drop.util.js.map +0 -1
  384. package/dist/src/nile-file-upload/utils/file-validation.util.d.ts +0 -9
  385. package/dist/src/nile-file-upload/utils/file-validation.util.js +0 -58
  386. package/dist/src/nile-file-upload/utils/file-validation.util.js.map +0 -1
  387. package/dist/src/nile-pagination/index.d.ts +0 -1
  388. package/dist/src/nile-pagination/index.js +0 -2
  389. package/dist/src/nile-pagination/index.js.map +0 -1
  390. package/dist/src/nile-pagination/nile-pagination.css.js +0 -156
  391. package/dist/src/nile-pagination/nile-pagination.css.js.map +0 -1
  392. package/dist/src/nile-pagination/nile-pagination.d.ts +0 -36
  393. package/dist/src/nile-pagination/nile-pagination.js +0 -170
  394. package/dist/src/nile-pagination/nile-pagination.js.map +0 -1
  395. package/dist/src/nile-pagination/nile-pagination.template.d.ts +0 -3
  396. package/dist/src/nile-pagination/nile-pagination.template.js +0 -5
  397. package/dist/src/nile-pagination/nile-pagination.template.js.map +0 -1
  398. package/dist/src/nile-pagination/nile-pagination.test.d.ts +0 -7
  399. package/dist/src/nile-pagination/nile-pagination.test.js +0 -30
  400. package/dist/src/nile-pagination/nile-pagination.test.js.map +0 -1
  401. package/dist/src/nile-pagination/sub-components/nile-pagination.js +0 -2
  402. package/dist/src/nile-pagination/sub-components/nile-pagination.js.map +0 -1
  403. package/dist/src/nile-pagination/types/index.js +0 -2
  404. package/dist/src/nile-pagination/types/index.js.map +0 -1
  405. package/dist/src/nile-pagination/types/pagination.type.d.ts +0 -3
  406. package/dist/src/nile-pagination/types/pagination.type.js +0 -5
  407. package/dist/src/nile-pagination/types/pagination.type.js.map +0 -1
  408. package/dist/src/nile-pagination/utils/nile-pagination.utils.d.ts +0 -0
  409. package/dist/src/nile-pagination/utils/nile-pagination.utils.js +0 -2
  410. package/dist/src/nile-pagination/utils/nile-pagination.utils.js.map +0 -1
  411. package/dist/src/nile-rich-text-editor/index.d.ts +0 -1
  412. package/dist/src/nile-rich-text-editor/index.js +0 -2
  413. package/dist/src/nile-rich-text-editor/index.js.map +0 -1
  414. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.css.d.ts +0 -12
  415. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.css.js.map +0 -1
  416. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.d.ts +0 -10
  417. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.js +0 -62
  418. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.js.map +0 -1
  419. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.template.d.ts +0 -3
  420. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.template.js +0 -5
  421. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.template.js.map +0 -1
  422. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.test.d.ts +0 -7
  423. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.test.js +0 -30
  424. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.test.js.map +0 -1
  425. package/dist/src/nile-rich-text-editor/quill/quill.d.ts +0 -8
  426. package/dist/src/nile-rich-text-editor/quill/quill.js +0 -19
  427. package/dist/src/nile-rich-text-editor/quill/quill.js.map +0 -1
  428. package/dist/src/nile-rich-text-editor/sub-components/nile-rich-text-editor.d.ts +0 -0
  429. package/dist/src/nile-rich-text-editor/sub-components/nile-rich-text-editor.js +0 -2
  430. package/dist/src/nile-rich-text-editor/sub-components/nile-rich-text-editor.js.map +0 -1
  431. package/dist/src/nile-rich-text-editor/types/index.d.ts +0 -0
  432. package/dist/src/nile-rich-text-editor/types/index.js +0 -2
  433. package/dist/src/nile-rich-text-editor/types/index.js.map +0 -1
  434. package/dist/src/nile-rich-text-editor/types/rich-text-editor.type.d.ts +0 -3
  435. package/dist/src/nile-rich-text-editor/types/rich-text-editor.type.js +0 -5
  436. package/dist/src/nile-rich-text-editor/types/rich-text-editor.type.js.map +0 -1
  437. package/dist/src/nile-rich-text-editor/utils/nile-rich-text-editor.utils.d.ts +0 -0
  438. package/dist/src/nile-rich-text-editor/utils/nile-rich-text-editor.utils.js +0 -2
  439. package/dist/src/nile-rich-text-editor/utils/nile-rich-text-editor.utils.js.map +0 -1
  440. package/plop-templates/lit/lit.template.ts.hbs +0 -3
  441. package/plop-templates/lit/lit.test.ts.hbs +0 -38
  442. package/plop-templates/lit/sub-components/index.ts.hbs +0 -4
  443. package/plop-templates/lit/types/index.ts.hbs +0 -0
  444. package/plop-templates/lit/types/type.ts.hbs +0 -3
  445. package/plop-templates/lit/utils/lit.utils.ts.hbs +0 -4
  446. package/src/nile-filter-chip/index.ts +0 -1
  447. package/src/nile-filter-chip/nile-filter-chip.css.ts +0 -138
  448. package/src/nile-filter-chip/nile-filter-chip.test.ts +0 -92
  449. package/src/nile-filter-chip/nile-filter-chip.ts +0 -136
  450. package/src/nile-tooltip/nile-tooltip-utils.ts +0 -271
  451. package/src/nile-tooltip/nile-tooltip.test.ts +0 -168
  452. /package/dist/src/{nile-pagination/sub-components/nile-pagination.d.ts → nile-virtual-select/nile-virtual-select.test.d.ts} +0 -0
  453. /package/dist/src/{nile-pagination/types/index.d.ts → nile-virtual-select/nile-virtual-select.utils.d.ts} +0 -0
@@ -1,48 +0,0 @@
1
- /**
2
- * Copyright Aquera Inc 2025
3
- *
4
- * This source code is licensed under the BSD-3-Clause license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
- import NileElement from '../internal/nile-element';
8
- import { FilePreviewState, FilePreviewVariant } from './types';
9
- import { CSSResultArray, TemplateResult, PropertyValues } from 'lit';
10
- /**
11
- * Nile preview component.
12
- *
13
- * @tag nile-preview
14
- *
15
- */
16
- export declare class NileFilePreview extends NileElement {
17
- /**
18
- * The styles for nile-preview
19
- * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
20
- */
21
- static get styles(): CSSResultArray;
22
- errorMessage: string;
23
- inputFile: File;
24
- fileUrl: string;
25
- uploadStatus: number;
26
- allowedTypes: string[];
27
- state: FilePreviewState;
28
- variant: FilePreviewVariant;
29
- inputFileName: string;
30
- private inputFileHtml;
31
- private originalUrl;
32
- /**
33
- * Render method
34
- * @slot This is a slot test
35
- */
36
- connectedCallback(): void;
37
- protected updated(changedProperties: PropertyValues): void;
38
- private handleFileUrl;
39
- createState(file: File): Promise<void>;
40
- render(): TemplateResult;
41
- disconnectedCallback(): void;
42
- }
43
- export default NileFilePreview;
44
- declare global {
45
- interface HTMLElementTagNameMap {
46
- 'nile-preview': NileFilePreview;
47
- }
48
- }
@@ -1,149 +0,0 @@
1
- /**
2
- * Copyright Aquera Inc 2025
3
- *
4
- * This source code is licensed under the BSD-3-Clause license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
- import { __decorate } from "tslib";
8
- import { styles } from './nile-file-preview.css';
9
- import NileElement from '../internal/nile-element';
10
- import { customElement, property } from 'lit/decorators.js';
11
- import { generatePreviewUrl } from './utils';
12
- import { FilePreviewState, FilePreviewVariant, FilePreviewErrorMessages, FilePreviewEvent } from './types';
13
- import { html } from 'lit';
14
- import { getHorizontalErrorState, getHorizontalNoPreviewState, getHorizontalPreviewState, getVerticalErrorState, getVerticalNoPreviewState, getVerticalPreviewState } from './nile-file-preview.template';
15
- /**
16
- * Nile preview component.
17
- *
18
- * @tag nile-preview
19
- *
20
- */
21
- let NileFilePreview = class NileFilePreview extends NileElement {
22
- constructor() {
23
- super(...arguments);
24
- this.errorMessage = "";
25
- this.fileUrl = "";
26
- this.uploadStatus = 0;
27
- this.allowedTypes = [];
28
- this.state = FilePreviewState.DEFAULT;
29
- this.variant = FilePreviewVariant.HORIZONTAL;
30
- this.inputFileName = "";
31
- this.inputFileHtml = null;
32
- this.originalUrl = "";
33
- /* #endregion */
34
- }
35
- /**
36
- * The styles for nile-preview
37
- * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
38
- */
39
- static get styles() {
40
- return [styles];
41
- }
42
- /**
43
- * Render method
44
- * @slot This is a slot test
45
- */
46
- connectedCallback() {
47
- super.connectedCallback();
48
- this.emit(FilePreviewEvent.NILE_INIT);
49
- }
50
- updated(changedProperties) {
51
- if (changedProperties.has('inputFile') && this.inputFile) {
52
- this.createState(this.inputFile);
53
- this.emit(FilePreviewEvent.NILE_RECEIVE);
54
- }
55
- else if (changedProperties.has('fileUrl') && this.fileUrl) {
56
- this.handleFileUrl(this.fileUrl);
57
- this.emit(FilePreviewEvent.NILE_RECEIVE);
58
- }
59
- }
60
- async handleFileUrl(url) {
61
- this.originalUrl = url;
62
- try {
63
- const response = await fetch(url);
64
- const blob = await response.blob();
65
- const fileName = this.inputFileName || url.split('/').pop() || FilePreviewErrorMessages.UNKNOWN_FILE_NAME;
66
- const file = new File([blob], fileName, { type: blob.type });
67
- this.createState(file);
68
- }
69
- catch (error) {
70
- const dummyFile = new File([], this.inputFileName || FilePreviewErrorMessages.UNKNOWN_FILE_NAME, { type: 'application/octet-stream' });
71
- this.errorMessage = FilePreviewErrorMessages.FAILED_TO_LOAD;
72
- this.inputFileHtml = this.variant === FilePreviewVariant.HORIZONTAL
73
- ? getHorizontalErrorState(dummyFile, this.errorMessage, this.originalUrl)
74
- : getVerticalErrorState(dummyFile, this.errorMessage, this.originalUrl);
75
- this.requestUpdate();
76
- }
77
- }
78
- async createState(file) {
79
- const isHorizontal = this.variant === FilePreviewVariant.HORIZONTAL;
80
- if (this.allowedTypes.includes(file.type)) {
81
- if (file.type.startsWith('image/')) {
82
- try {
83
- const url = await generatePreviewUrl(file);
84
- this.inputFileHtml = isHorizontal
85
- ? getHorizontalPreviewState(url, file, this.originalUrl)
86
- : getVerticalPreviewState(url, file, this.originalUrl);
87
- }
88
- catch (error) {
89
- this.inputFileHtml = isHorizontal
90
- ? getHorizontalNoPreviewState(file, this.originalUrl)
91
- : getVerticalNoPreviewState(file, this.originalUrl);
92
- }
93
- }
94
- else {
95
- this.inputFileHtml = isHorizontal
96
- ? getHorizontalNoPreviewState(file, this.originalUrl)
97
- : getVerticalNoPreviewState(file, this.originalUrl);
98
- }
99
- }
100
- else {
101
- this.errorMessage = FilePreviewErrorMessages.INVALID_FORMAT;
102
- this.inputFileHtml = isHorizontal
103
- ? getHorizontalErrorState(file, this.errorMessage, this.originalUrl)
104
- : getVerticalErrorState(file, this.errorMessage, this.originalUrl);
105
- }
106
- this.requestUpdate();
107
- }
108
- render() {
109
- return html `
110
- ${this.inputFileHtml ?
111
- this.inputFileHtml :
112
- html ``}
113
- `;
114
- }
115
- disconnectedCallback() {
116
- super.disconnectedCallback();
117
- this.emit(FilePreviewEvent.NILE_DESTROY);
118
- }
119
- };
120
- __decorate([
121
- property({ type: String })
122
- ], NileFilePreview.prototype, "errorMessage", void 0);
123
- __decorate([
124
- property({ type: Object })
125
- ], NileFilePreview.prototype, "inputFile", void 0);
126
- __decorate([
127
- property({ type: String })
128
- ], NileFilePreview.prototype, "fileUrl", void 0);
129
- __decorate([
130
- property({ type: Number })
131
- ], NileFilePreview.prototype, "uploadStatus", void 0);
132
- __decorate([
133
- property({ type: Array })
134
- ], NileFilePreview.prototype, "allowedTypes", void 0);
135
- __decorate([
136
- property({ type: String })
137
- ], NileFilePreview.prototype, "state", void 0);
138
- __decorate([
139
- property({ type: String })
140
- ], NileFilePreview.prototype, "variant", void 0);
141
- __decorate([
142
- property({ type: String })
143
- ], NileFilePreview.prototype, "inputFileName", void 0);
144
- NileFilePreview = __decorate([
145
- customElement('nile-preview')
146
- ], NileFilePreview);
147
- export { NileFilePreview };
148
- export default NileFilePreview;
149
- //# sourceMappingURL=nile-file-preview.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nile-file-preview.js","sourceRoot":"","s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,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAA6D;AAC3D;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDAA4B;AAhB5C,eAAe;IAD3B,aAAa,CAAC,cAAc,CAAC;GACjB,eAAe,CA2G3B;;AAED,eAAe,eAAe,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2025\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 {styles} from './nile-file-preview.css';\nimport NileElement from '../internal/nile-element';\nimport { customElement, property } from 'lit/decorators.js';\nimport { generatePreviewUrl } from './utils';\nimport { FilePreviewState, FilePreviewVariant, FilePreviewErrorMessages, FilePreviewEvent } from './types';\nimport { LitElement, html, CSSResultArray, TemplateResult, PropertyValues } from 'lit';\nimport {\n getHorizontalErrorState,\n getHorizontalNoPreviewState,\n getHorizontalPreviewState,\n getVerticalErrorState,\n getVerticalNoPreviewState,\n getVerticalPreviewState\n} from './nile-file-preview.template';\n\n\n/**\n * Nile preview component.\n *\n * @tag nile-preview\n *\n */\n@customElement('nile-preview')\nexport class NileFilePreview extends NileElement {\n /**\n * The styles for nile-preview\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ type: String }) errorMessage: string = \"\";\n\t@property({ type: Object }) inputFile: File; \n\t@property({ type: String }) fileUrl: string = \"\";\n\t@property({ type: Number }) uploadStatus: number = 0;\n @property({ type: Array }) allowedTypes: string[] = [];\n\t@property({ type: String }) state: FilePreviewState = FilePreviewState.DEFAULT;\n\t@property({ type: String }) variant: FilePreviewVariant = FilePreviewVariant.HORIZONTAL;\n @property({ type: String }) inputFileName: string = \"\";\n\tprivate inputFileHtml: TemplateResult | null = null;\n private originalUrl: string = \"\";\n\n /**\n * Render method\n * @slot This is a slot test\n */\n\n connectedCallback(): void {\n super.connectedCallback();\n this.emit(FilePreviewEvent.NILE_INIT);\n }\n\n protected updated(changedProperties: PropertyValues): void {\n\n if (changedProperties.has('inputFile') && this.inputFile) {\n this.createState(this.inputFile);\n this.emit(FilePreviewEvent.NILE_RECEIVE);\n\n } else if (changedProperties.has('fileUrl') && this.fileUrl) {\n this.handleFileUrl(this.fileUrl);\n this.emit(FilePreviewEvent.NILE_RECEIVE);\n }\n }\n\n private async handleFileUrl(url: string): Promise<void> {\n this.originalUrl = url;\n try {\n const response = await fetch(url);\n const blob = await response.blob();\n const fileName = this.inputFileName || url.split('/').pop() || FilePreviewErrorMessages.UNKNOWN_FILE_NAME;\n const file = new File([blob], fileName, { type: blob.type });\n\n this.createState(file);\n } catch (error) {\n const dummyFile = new File([], this.inputFileName || FilePreviewErrorMessages.UNKNOWN_FILE_NAME, { type: 'application/octet-stream' });\n this.errorMessage = FilePreviewErrorMessages.FAILED_TO_LOAD;\n\n this.inputFileHtml = this.variant === FilePreviewVariant.HORIZONTAL\n ? getHorizontalErrorState(dummyFile, this.errorMessage, this.originalUrl)\n : getVerticalErrorState(dummyFile, this.errorMessage, this.originalUrl);\n this.requestUpdate();\n }\n }\n\n\tpublic async createState(file: File): Promise<void> {\n const isHorizontal = this.variant === FilePreviewVariant.HORIZONTAL;\n\n if (this.allowedTypes.includes(file.type)) { \n if (file.type.startsWith('image/')) {\n try {\n const url = await generatePreviewUrl(file);\n this.inputFileHtml = isHorizontal\n ? getHorizontalPreviewState(url, file, this.originalUrl)\n : getVerticalPreviewState(url, file, this.originalUrl);\n } catch (error) {\n this.inputFileHtml = isHorizontal\n ? getHorizontalNoPreviewState(file, this.originalUrl)\n : getVerticalNoPreviewState(file, this.originalUrl); \n }\n } else {\n this.inputFileHtml = isHorizontal\n ? getHorizontalNoPreviewState(file, this.originalUrl)\n : getVerticalNoPreviewState(file, this.originalUrl);\n }\n } else {\n this.errorMessage = FilePreviewErrorMessages.INVALID_FORMAT;\n\n this.inputFileHtml = isHorizontal\n ? getHorizontalErrorState(file, this.errorMessage, this.originalUrl)\n : getVerticalErrorState(file, this.errorMessage, this.originalUrl);\n }\n this.requestUpdate();\n }\n\n public render(): TemplateResult {\n return html`\n\t\t\t${this.inputFileHtml ?\n\t\t\t\tthis.inputFileHtml :\n\t\t\t\thtml``\n\t\t\t}\n `;\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.emit(FilePreviewEvent.NILE_DESTROY);\n }\n\n /* #endregion */\n}\n\nexport default NileFilePreview;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-preview': NileFilePreview;\n }\n}"]}
@@ -1,11 +0,0 @@
1
- /**
2
- * Template File for nile-preview component
3
- */
4
- import './nile-file-preview.css';
5
- import { TemplateResult } from 'lit';
6
- export declare function getHorizontalPreviewState(url: string, file: File, originalUrl: string): TemplateResult;
7
- export declare function getHorizontalNoPreviewState(file: File, originalUrl: string): TemplateResult;
8
- export declare function getHorizontalErrorState(file: File, errorMessage: string, originalUrl: string): TemplateResult;
9
- export declare function getVerticalPreviewState(url: string, file: File, originalUrl: string): TemplateResult;
10
- export declare function getVerticalNoPreviewState(file: File, originalUrl: string): TemplateResult;
11
- export declare function getVerticalErrorState(file: File, errorMessage: string, originalUrl: string): TemplateResult;
@@ -1,144 +0,0 @@
1
- /**
2
- * Template File for nile-preview component
3
- */
4
- import './nile-file-preview.css';
5
- import { html } from 'lit';
6
- import { removeFile } from './utils';
7
- export function getHorizontalPreviewState(url, file, originalUrl) {
8
- return html `
9
- <div class="preview horizontal-div">
10
- <div class="preview-inner">
11
- <div class="preview-image-container">
12
- ${file.type.startsWith('image/')
13
- ? html `<img src="${url}" alt="Image Preview" />`
14
- : html `<iframe src="${url}" type="${file.type}" width="40px" height="40px" />`}
15
- </div>
16
- <div class="preview-file-info">
17
- <p>${file.name}</p>
18
- <p>${(file.type.split('/')[1]).toUpperCase()} &#8226; ${(Number(file.size) / 1000).toFixed(0)}KB</p>
19
- </div>
20
- </div>
21
- <nile-icon
22
- @click=${(e) => removeFile(file, e, originalUrl)}
23
- name="trash"
24
- size="14"
25
- class="icon"
26
- ></nile-icon>
27
- </div>
28
- `;
29
- }
30
- export function getHorizontalNoPreviewState(file, originalUrl) {
31
- return html `
32
- <div class="no-preview horizontal-div">
33
- <div class="no-preview-container">
34
- <div class="document-icon">
35
- <nile-icon name="general" size="20" color="var(--nile-colors-blue-500)"></nile-icon>
36
- </div>
37
- <div class="preview-file-info">
38
- <p>${file.name}</p>
39
- <p>${(file.type.split('/')[1]).toUpperCase()} &#8226; ${(Number(file.size) / 1000).toFixed(0)}KB</p>
40
- </div>
41
- </div>
42
- <div>
43
- <nile-icon
44
- @click=${(e) => removeFile(file, e, originalUrl)}
45
- name="trash"
46
- size="14"
47
- class="icon"
48
- ></nile-icon>
49
- </div>
50
- </div>
51
- `;
52
- }
53
- export function getHorizontalErrorState(file, errorMessage, originalUrl) {
54
- return html `
55
- <div class="error horizontal-div">
56
- <div class="error-container">
57
- <div class="error-icon">
58
- <nile-icon name="info-icon" size="20" color="var(--nile-colors-red-700)"></nile-icon>
59
- </div>
60
- <div class="file-info">
61
- <p>${file.name}</p>
62
- <p>${errorMessage}</p>
63
- </div>
64
- </div>
65
- <nile-icon
66
- @click=${(e) => removeFile(file, e, originalUrl)}
67
- name="close"
68
- size="14"
69
- class="icon"
70
- ></nile-icon>
71
- </div>
72
- `;
73
- }
74
- // vertical states
75
- export function getVerticalPreviewState(url, file, originalUrl) {
76
- return html `
77
- <div class="vertical-div vertical-preview">
78
- <div>
79
- <img
80
- class="image-preview"
81
- src=${url}
82
- alt=${file.name}
83
- />
84
- </div>
85
-
86
- <div class="content-container">
87
- <p>${file.name}</p>
88
- <p>${(file.type.split('/')[1]).toUpperCase()} &#8226; ${(Number(file.size) / 1000).toFixed(0)}KB</p>
89
- </div>
90
-
91
- <nile-icon
92
- @click=${(e) => removeFile(file, e, originalUrl)}
93
- name="trash"
94
- size="14"
95
- class="corner-icon icon"
96
- ></nile-icon>
97
- </div>
98
- `;
99
- }
100
- export function getVerticalNoPreviewState(file, originalUrl) {
101
- return html `
102
- <div class="vertical-div vertical-no-preview">
103
- <div class="vertical-document-icon">
104
- <nile-icon name="general" size="20" color="var(--nile-colors-blue-500)"></nile-icon>
105
- </div>
106
-
107
- <div class="content-container">
108
- <p>${file.name}</p>
109
- <p>${file.type} &#8226; ${(Number(file.size) / 1000).toFixed(0)}KB</p>
110
- </div>
111
-
112
- <nile-icon
113
- @click=${(e) => removeFile(file, e, originalUrl)}
114
- name="trash"
115
- size="14"
116
- class="corner-icon icon"
117
- ></nile-icon>
118
- </div>
119
- `;
120
- }
121
- export function getVerticalErrorState(file, errorMessage, originalUrl) {
122
- return html `
123
- <div class="vertical-div vertical-error">
124
- <div class="vertical-document-icon error-bg">
125
- <nile-icon name="info-icon" size="20" color="var(--nile-colors-red-700)"></nile-icon>
126
- </div>
127
-
128
- <div class="error-message">
129
- <p>${file.name}</p>
130
- <div class="error-p">
131
- <p>${errorMessage}</p>
132
- </div>
133
- </div>
134
-
135
- <nile-icon
136
- @click=${(e) => removeFile(file, e, originalUrl)}
137
- name="close"
138
- size="14"
139
- class="corner-icon icon"
140
- ></nile-icon>
141
- </div>
142
- `;
143
- }
144
- //# sourceMappingURL=nile-file-preview.template.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nile-file-preview.template.js","sourceRoot":"","sources":["../../../src/nile-file-preview/nile-file-preview.template.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,yBAAyB,CAAC;AACjC,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,UAAU,yBAAyB,CACvC,GAAW,EACX,IAAU,EACV,WAAmB;IAEnB,OAAO,IAAI,CAAA;;;;YAID,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;QAC9B,CAAC,CAAC,IAAI,CAAA,aAAa,GAAG,0BAA0B;QAChD,CAAC,CAAC,IAAI,CAAA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,CAAC,IAAI;cACR,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;;;;iBAIrF,CAAC,CAAgC,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,WAAW,CAAC;;;;;;GAMpF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,IAAU,EACV,WAAmB;IAEnB,OAAO,IAAI,CAAA;;;;;;;aAOA,IAAI,CAAC,IAAI;aACT,IAAI,CAAC,IAAI,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;;;;iBAItD,CAAC,CAAgC,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,WAAW,CAAC;;;;;;GAMpF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,IAAU,EACV,YAAoB,EACpB,WAAmB;IAEnB,OAAO,IAAI,CAAA;;;;;;;aAOA,IAAI,CAAC,IAAI;;eAEP,YAAY;;;;;iBAKV,CAAC,CAAgC,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,WAAW,CAAC;;;;;;GAMpF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Template File for nile-preview component\n */\n\nimport './nile-file-preview.css';\nimport { html, TemplateResult } from 'lit';\nimport { RemoveFileDetail } from './types';\nimport { removeFile } from './utils';\n\nexport function getHorizontalPreviewState(\n url: string,\n file: File,\n originalUrl: string\n): TemplateResult {\n return html`\n <div class=\"preview horizontal-div\">\n <div class=\"preview-inner\">\n <div class=\"preview-image-container\">\n ${file.type.startsWith('image/')\n ? html`<img src=\"${url}\" alt=\"Image Preview\" />`\n : html`<iframe src=\"${url}\" type=\"${file.type}\" width=\"40px\" height=\"40px\" />`\n }\n </div>\n <div class=\"preview-file-info\">\n <p>${file.name}</p>\n <p>${(file.type.split('/')[1]).toUpperCase()} &#8226; ${(Number(file.size) / 1000).toFixed(0)}KB</p>\n </div>\n </div>\n <nile-icon \n @click=${(e: CustomEvent<RemoveFileDetail>) => removeFile(file, e, originalUrl)}\n name=\"trash\" \n size=\"14\" \n class=\"icon\"\n ></nile-icon>\n </div>\n `;\n}\n\nexport function getHorizontalNoPreviewState(\n file: File,\n originalUrl: string\n): TemplateResult {\n return html`\n <div class=\"no-preview horizontal-div\">\n <div class=\"no-preview-container\">\n <div class=\"document-icon\">\n <nile-icon name=\"general\" size=\"20\" color=\"var(--nile-colors-blue-500)\"></nile-icon>\n </div>\n <div class=\"preview-file-info\">\n <p>${file.name}</p>\n <p>${(file.type.split('/')[1]).toUpperCase()} &#8226; ${(Number(file.size) / 1000).toFixed(0)}KB</p>\n </div>\n </div>\n <div>\n <nile-icon\n @click=${(e: CustomEvent<RemoveFileDetail>) => removeFile(file, e, originalUrl)}\n name=\"trash\"\n size=\"14\"\n class=\"icon\"\n ></nile-icon>\n </div>\n </div>\n `;\n}\n\nexport function getHorizontalErrorState(\n file: File,\n errorMessage: string,\n originalUrl: string\n): TemplateResult {\n return html`\n <div class=\"error horizontal-div\">\n <div class=\"error-container\">\n <div class=\"error-icon\">\n <nile-icon name=\"info-icon\" size=\"20\" color=\"var(--nile-colors-red-700)\"></nile-icon>\n </div>\n <div class=\"file-info\">\n <p>${file.name}</p>\n <p>${errorMessage}</p>\n </div>\n </div>\n <nile-icon \n @click=${(e: CustomEvent<RemoveFileDetail>) => removeFile(file, e, originalUrl)} \n name=\"close\" \n size=\"14\" \n class=\"icon\"\n ></nile-icon>\n </div>\n `;\n}\n\n// vertical states\nexport function getVerticalPreviewState(\n url: string,\n file: File,\n originalUrl: string\n): TemplateResult {\n return html`\n <div class=\"vertical-div vertical-preview\">\n <div>\n <img\n class=\"image-preview\"\n src=${url}\n alt=${file.name}\n />\n </div>\n\n <div class=\"content-container\">\n <p>${file.name}</p>\n <p>${(file.type.split('/')[1]).toUpperCase()} &#8226; ${(Number(file.size) / 1000).toFixed(0)}KB</p>\n </div>\n\n <nile-icon \n @click=${(e: CustomEvent<RemoveFileDetail>) => removeFile(file, e, originalUrl)}\n name=\"trash\" \n size=\"14\" \n class=\"corner-icon icon\"\n ></nile-icon>\n </div>\n `;\n}\n\nexport function getVerticalNoPreviewState(\n file: File,\n originalUrl: string\n): TemplateResult {\n return html`\n <div class=\"vertical-div vertical-no-preview\">\n <div class=\"vertical-document-icon\">\n <nile-icon name=\"general\" size=\"20\" color=\"var(--nile-colors-blue-500)\"></nile-icon>\n </div>\n\n <div class=\"content-container\">\n <p>${file.name}</p>\n <p>${file.type} &#8226; ${(Number(file.size) / 1000).toFixed(0)}KB</p>\n </div>\n\n <nile-icon\n @click=${(e: CustomEvent<RemoveFileDetail>) => removeFile(file, e, originalUrl)}\n name=\"trash\"\n size=\"14\"\n class=\"corner-icon icon\"\n ></nile-icon>\n </div>\n `;\n}\n\nexport function getVerticalErrorState(\n file: File,\n errorMessage: string,\n originalUrl: string\n): TemplateResult {\n return html`\n <div class=\"vertical-div vertical-error\">\n <div class=\"vertical-document-icon error-bg\">\n <nile-icon name=\"info-icon\" size=\"20\" color=\"var(--nile-colors-red-700)\"></nile-icon>\n </div>\n\n <div class=\"error-message\">\n <p>${file.name}</p>\n <div class=\"error-p\">\n <p>${errorMessage}</p>\n </div>\n </div>\n\n <nile-icon \n @click=${(e: CustomEvent<RemoveFileDetail>) => removeFile(file, e, originalUrl)}\n name=\"close\" \n size=\"14\" \n class=\"corner-icon icon\"\n ></nile-icon>\n </div>\n `;\n}"]}
@@ -1,7 +0,0 @@
1
- /**
2
- * Copyright Aquera Inc 2025
3
- *
4
- * This source code is licensed under the BSD-3-Clause license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
- import './nile-file-preview';
@@ -1,30 +0,0 @@
1
- /**
2
- * Copyright Aquera Inc 2025
3
- *
4
- * This source code is licensed under the BSD-3-Clause license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
- import { fixture, assert, expect, html } from '@open-wc/testing';
8
- import './nile-file-preview'; // Just import to register the element
9
- describe('<nile-preview>', () => {
10
- let element;
11
- beforeEach(async () => {
12
- element = await fixture(html `<nile-file-preview></nile-file-preview>`);
13
- });
14
- it('passes accessibility test', async () => {
15
- await expect(element).to.be.accessible();
16
- });
17
- it('renders with the correct tag name', () => {
18
- expect(element.tagName.toLowerCase()).to.equal('nile-preview');
19
- });
20
- it('renders with slot content when provided', async () => {
21
- const testContent = 'Test Content';
22
- element = await fixture(html `<nile-file-preview>${testContent}</nile-file-preview>`);
23
- const slot = element.shadowRoot.querySelector('slot');
24
- assert.exists(slot, 'Slot should exist');
25
- const assignedNodes = slot.assignedNodes({ flatten: true });
26
- expect(assignedNodes.length).to.be.greaterThan(0);
27
- expect(assignedNodes[0].textContent?.trim()).to.equal(testContent);
28
- });
29
- });
30
- //# sourceMappingURL=nile-file-preview.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nile-file-preview.test.js","sourceRoot":"","sources":["../../../src/nile-file-preview/nile-file-preview.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,qBAAqB,CAAC,CAAC,sCAAsC;AAEpE,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,IAAI,OAAoB,CAAC;IAEzB,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,CAAA,yCAAyC,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2BAA2B,EAAE,KAAK,IAAI,EAAE;QACzC,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC3C,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yCAAyC,EAAE,KAAK,IAAI,EAAE;QACvD,MAAM,WAAW,GAAG,cAAc,CAAC;QACnC,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,CAAA,sBAAsB,WAAW,sBAAsB,CAAC,CAAC;QAErF,MAAM,IAAI,GAAI,OAAO,CAAC,UAAW,CAAC,aAAa,CAAC,MAAM,CAAqB,CAAC;QAC5E,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;QAEzC,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5D,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAClD,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2025\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\n \nimport { fixture, assert, expect, html } from '@open-wc/testing';\nimport './nile-file-preview'; // Just import to register the element\n\ndescribe('<nile-preview>', () => {\n let element: HTMLElement;\n\n beforeEach(async () => {\n element = await fixture(html`<nile-file-preview></nile-file-preview>`);\n });\n\n it('passes accessibility test', async () => {\n await expect(element).to.be.accessible();\n });\n\n it('renders with the correct tag name', () => {\n expect(element.tagName.toLowerCase()).to.equal('nile-preview');\n });\n\n it('renders with slot content when provided', async () => {\n const testContent = 'Test Content';\n element = await fixture(html`<nile-file-preview>${testContent}</nile-file-preview>`);\n \n const slot = (element.shadowRoot!.querySelector('slot') as HTMLSlotElement);\n assert.exists(slot, 'Slot should exist');\n\n const assignedNodes = slot.assignedNodes({ flatten: true });\n expect(assignedNodes.length).to.be.greaterThan(0);\n expect(assignedNodes[0].textContent?.trim()).to.equal(testContent);\n });\n});"]}
@@ -1,23 +0,0 @@
1
- export declare enum FilePreviewState {
2
- DEFAULT = "default",
3
- UPLOADING = "uploading",
4
- PREVIEW = "preview",
5
- NO_PREVIEW = "no-preview",
6
- ERROR = "error"
7
- }
8
- export declare enum FilePreviewVariant {
9
- HORIZONTAL = "horizontal",
10
- VERTICAL = "vertical"
11
- }
12
- export declare enum FilePreviewErrorMessages {
13
- INVALID_FORMAT = "Invalid File Format. Please try again.",
14
- SIZE_LIMIT = "Size limit exceeded",
15
- FAILED_TO_LOAD = "Failed to load file from URL",
16
- UNKNOWN_FILE_NAME = "unknown-file"
17
- }
18
- export declare enum FilePreviewEvent {
19
- NILE_INIT = "nile-init",
20
- NILE_RECEIVE = "nile-receive",
21
- NILE_REMOVE = "nile-remove",
22
- NILE_DESTROY = "nile-destroy"
23
- }
@@ -1,28 +0,0 @@
1
- export var FilePreviewState;
2
- (function (FilePreviewState) {
3
- FilePreviewState["DEFAULT"] = "default";
4
- FilePreviewState["UPLOADING"] = "uploading";
5
- FilePreviewState["PREVIEW"] = "preview";
6
- FilePreviewState["NO_PREVIEW"] = "no-preview";
7
- FilePreviewState["ERROR"] = "error";
8
- })(FilePreviewState || (FilePreviewState = {}));
9
- export var FilePreviewVariant;
10
- (function (FilePreviewVariant) {
11
- FilePreviewVariant["HORIZONTAL"] = "horizontal";
12
- FilePreviewVariant["VERTICAL"] = "vertical";
13
- })(FilePreviewVariant || (FilePreviewVariant = {}));
14
- export var FilePreviewErrorMessages;
15
- (function (FilePreviewErrorMessages) {
16
- FilePreviewErrorMessages["INVALID_FORMAT"] = "Invalid File Format. Please try again.";
17
- FilePreviewErrorMessages["SIZE_LIMIT"] = "Size limit exceeded";
18
- FilePreviewErrorMessages["FAILED_TO_LOAD"] = "Failed to load file from URL";
19
- FilePreviewErrorMessages["UNKNOWN_FILE_NAME"] = "unknown-file";
20
- })(FilePreviewErrorMessages || (FilePreviewErrorMessages = {}));
21
- export var FilePreviewEvent;
22
- (function (FilePreviewEvent) {
23
- FilePreviewEvent["NILE_INIT"] = "nile-init";
24
- FilePreviewEvent["NILE_RECEIVE"] = "nile-receive";
25
- FilePreviewEvent["NILE_REMOVE"] = "nile-remove";
26
- FilePreviewEvent["NILE_DESTROY"] = "nile-destroy";
27
- })(FilePreviewEvent || (FilePreviewEvent = {}));
28
- //# sourceMappingURL=file-preview.enums.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-preview.enums.js","sourceRoot":"","sources":["../../../../src/nile-file-preview/types/file-preview.enums.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,gBAMX;AAND,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,2CAAuB,CAAA;IACvB,uCAAmB,CAAA;IACnB,6CAAyB,CAAA;IACzB,mCAAe,CAAA;AACjB,CAAC,EANW,gBAAgB,KAAhB,gBAAgB,QAM3B;AAED,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,+CAAyB,CAAA;IACzB,2CAAqB,CAAA;AACvB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAN,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAClC,qFAAyD,CAAA;IACzD,8DAAkC,CAAA;IAClC,2EAA+C,CAAA;IAC/C,8DAAkC,CAAA;AACpC,CAAC,EALW,wBAAwB,KAAxB,wBAAwB,QAKnC;AAED,MAAM,CAAN,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,2CAAuB,CAAA;IACvB,iDAA6B,CAAA;IAC7B,+CAA2B,CAAA;IAC3B,iDAA6B,CAAA;AAC/B,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,QAK3B","sourcesContent":["export enum FilePreviewState {\n DEFAULT = 'default',\n UPLOADING = 'uploading',\n PREVIEW = 'preview',\n NO_PREVIEW = 'no-preview',\n ERROR = 'error'\n}\n\nexport enum FilePreviewVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical'\n}\n\nexport enum FilePreviewErrorMessages {\n INVALID_FORMAT = \"Invalid File Format. Please try again.\",\n SIZE_LIMIT = \"Size limit exceeded\",\n FAILED_TO_LOAD = \"Failed to load file from URL\",\n UNKNOWN_FILE_NAME = 'unknown-file'\n}\n\nexport enum FilePreviewEvent {\n NILE_INIT = \"nile-init\",\n NILE_RECEIVE = \"nile-receive\",\n NILE_REMOVE = \"nile-remove\",\n NILE_DESTROY = \"nile-destroy\"\n}"]}
@@ -1,4 +0,0 @@
1
- export type RemoveFileDetail = {
2
- value: File;
3
- url: string;
4
- };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=file-preview.interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-preview.interface.js","sourceRoot":"","sources":["../../../../src/nile-file-preview/types/file-preview.interface.ts"],"names":[],"mappings":"","sourcesContent":["export type RemoveFileDetail = {\n value: File;\n url: string;\n};\n"]}
@@ -1,2 +0,0 @@
1
- export * from './file-preview.enums';
2
- export * from './file-preview.interface';
@@ -1,3 +0,0 @@
1
- export * from './file-preview.enums';
2
- export * from './file-preview.interface';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/nile-file-preview/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC","sourcesContent":["export * from './file-preview.enums';\nexport * from './file-preview.interface';"]}
@@ -1,26 +0,0 @@
1
- export declare enum FilePreviewState {
2
- DEFAULT = "default",
3
- UPLOADING = "uploading",
4
- PREVIEW = "preview",
5
- NO_PREVIEW = "no-preview",
6
- ERROR = "error"
7
- }
8
- export declare enum FilePreviewVariant {
9
- HORIZONTAL = "horizontal",
10
- VERTICAL = "vertical"
11
- }
12
- export declare enum FilePreviewErrorMessages {
13
- INVALID_FORMAT = "Invalid File Format. Please try again.",
14
- SIZE_LIMIT = "Size limit exceeded",
15
- FAILED_TO_LOAD = "Failed to load file from URL",
16
- UNKNOWN_FILE_NAME = "unknown-file",
17
- UPLOAD_CANCEL = "Cancelled Uploading."
18
- }
19
- export declare enum FilePreviewEvent {
20
- NILE_INIT = "nile-init",
21
- NILE_RECEIVE = "nile-receive",
22
- NILE_UPLOADING = "nile-uploding",
23
- NILE_REMOVE = "nile-remove",
24
- NILE_CANCEL_UPLOAD = "nile-cancel-upload",
25
- NILE_DESTROY = "nile-destroy"
26
- }
@@ -1,31 +0,0 @@
1
- export var FilePreviewState;
2
- (function (FilePreviewState) {
3
- FilePreviewState["DEFAULT"] = "default";
4
- FilePreviewState["UPLOADING"] = "uploading";
5
- FilePreviewState["PREVIEW"] = "preview";
6
- FilePreviewState["NO_PREVIEW"] = "no-preview";
7
- FilePreviewState["ERROR"] = "error";
8
- })(FilePreviewState || (FilePreviewState = {}));
9
- export var FilePreviewVariant;
10
- (function (FilePreviewVariant) {
11
- FilePreviewVariant["HORIZONTAL"] = "horizontal";
12
- FilePreviewVariant["VERTICAL"] = "vertical";
13
- })(FilePreviewVariant || (FilePreviewVariant = {}));
14
- export var FilePreviewErrorMessages;
15
- (function (FilePreviewErrorMessages) {
16
- FilePreviewErrorMessages["INVALID_FORMAT"] = "Invalid File Format. Please try again.";
17
- FilePreviewErrorMessages["SIZE_LIMIT"] = "Size limit exceeded";
18
- FilePreviewErrorMessages["FAILED_TO_LOAD"] = "Failed to load file from URL";
19
- FilePreviewErrorMessages["UNKNOWN_FILE_NAME"] = "unknown-file";
20
- FilePreviewErrorMessages["UPLOAD_CANCEL"] = "Cancelled Uploading.";
21
- })(FilePreviewErrorMessages || (FilePreviewErrorMessages = {}));
22
- export var FilePreviewEvent;
23
- (function (FilePreviewEvent) {
24
- FilePreviewEvent["NILE_INIT"] = "nile-init";
25
- FilePreviewEvent["NILE_RECEIVE"] = "nile-receive";
26
- FilePreviewEvent["NILE_UPLOADING"] = "nile-uploding";
27
- FilePreviewEvent["NILE_REMOVE"] = "nile-remove";
28
- FilePreviewEvent["NILE_CANCEL_UPLOAD"] = "nile-cancel-upload";
29
- FilePreviewEvent["NILE_DESTROY"] = "nile-destroy";
30
- })(FilePreviewEvent || (FilePreviewEvent = {}));
31
- //# sourceMappingURL=nile-file-preview.enums.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nile-file-preview.enums.js","sourceRoot":"","sources":["../../../../src/nile-file-preview/types/nile-file-preview.enums.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,gBAMX;AAND,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,2CAAuB,CAAA;IACvB,uCAAmB,CAAA;IACnB,6CAAyB,CAAA;IACzB,mCAAe,CAAA;AACjB,CAAC,EANW,gBAAgB,KAAhB,gBAAgB,QAM3B;AAED,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,+CAAyB,CAAA;IACzB,2CAAqB,CAAA;AACvB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAN,IAAY,wBAMX;AAND,WAAY,wBAAwB;IAClC,qFAAyD,CAAA;IACzD,8DAAkC,CAAA;IAClC,2EAA+C,CAAA;IAC/C,8DAAkC,CAAA;IAClC,kEAAsC,CAAA;AACxC,CAAC,EANW,wBAAwB,KAAxB,wBAAwB,QAMnC;AAED,MAAM,CAAN,IAAY,gBAOX;AAPD,WAAY,gBAAgB;IAC1B,2CAAuB,CAAA;IACvB,iDAA6B,CAAA;IAC7B,oDAAgC,CAAA;IAChC,+CAA2B,CAAA;IAC3B,6DAAyC,CAAA;IACzC,iDAA6B,CAAA;AAC/B,CAAC,EAPW,gBAAgB,KAAhB,gBAAgB,QAO3B","sourcesContent":["export enum FilePreviewState {\n DEFAULT = 'default',\n UPLOADING = 'uploading',\n PREVIEW = 'preview',\n NO_PREVIEW = 'no-preview',\n ERROR = 'error'\n}\n\nexport enum FilePreviewVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical'\n}\n\nexport enum FilePreviewErrorMessages {\n INVALID_FORMAT = \"Invalid File Format. Please try again.\",\n SIZE_LIMIT = \"Size limit exceeded\",\n FAILED_TO_LOAD = \"Failed to load file from URL\",\n UNKNOWN_FILE_NAME = 'unknown-file',\n UPLOAD_CANCEL = \"Cancelled Uploading.\"\n}\n\nexport enum FilePreviewEvent {\n NILE_INIT = \"nile-init\",\n NILE_RECEIVE = \"nile-receive\",\n NILE_UPLOADING = \"nile-uploding\",\n NILE_REMOVE = \"nile-remove\",\n NILE_CANCEL_UPLOAD = \"nile-cancel-upload\",\n NILE_DESTROY = \"nile-destroy\"\n}"]}
@@ -1,4 +0,0 @@
1
- export type RemoveFileDetail = {
2
- value: File;
3
- url: string;
4
- };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=nile-file-preview.interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nile-file-preview.interface.js","sourceRoot":"","sources":["../../../../src/nile-file-preview/types/nile-file-preview.interface.ts"],"names":[],"mappings":"","sourcesContent":["export type RemoveFileDetail = {\n value: File;\n url: string;\n};\n"]}
@@ -1,3 +0,0 @@
1
- import { RemoveFileDetail } from "../types";
2
- export declare const generatePreviewUrl: (file: File) => Promise<string>;
3
- export declare const removeFile: (removeFile: File, e: CustomEvent<RemoveFileDetail>, originalUrl: string) => void;
@@ -1,29 +0,0 @@
1
- import { FilePreviewEvent } from "../types";
2
- export const generatePreviewUrl = (file) => {
3
- return new Promise((resolve, reject) => {
4
- const reader = new FileReader();
5
- if (file) {
6
- reader.readAsDataURL(file);
7
- }
8
- else {
9
- reject('No file selected');
10
- }
11
- reader.onload = () => {
12
- const previewUrl = reader.result;
13
- resolve(previewUrl);
14
- };
15
- reader.onerror = (error) => {
16
- reject("Unable to generate the url");
17
- };
18
- });
19
- };
20
- export const removeFile = (removeFile, e, originalUrl) => {
21
- if (e.target) {
22
- e.target.dispatchEvent(new CustomEvent(FilePreviewEvent.NILE_REMOVE, {
23
- detail: { value: removeFile, url: originalUrl },
24
- bubbles: true,
25
- composed: true,
26
- }));
27
- }
28
- };
29
- //# sourceMappingURL=file-preview.util.js.map