@aquera/nile-elements 1.5.4 → 1.5.6

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 (297) hide show
  1. package/README.md +10 -0
  2. package/demo/index.css +9 -0
  3. package/dist/index.cjs.js +1 -1
  4. package/dist/index.esm.js +1 -1
  5. package/dist/index.js +871 -255
  6. package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js +1 -1
  7. package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js.map +1 -1
  8. package/dist/nile-auto-complete/nile-auto-complete.css.esm.js +13 -2
  9. package/dist/nile-button/nile-button.cjs.js +1 -1
  10. package/dist/nile-button/nile-button.cjs.js.map +1 -1
  11. package/dist/nile-button/nile-button.css.cjs.js +1 -1
  12. package/dist/nile-button/nile-button.css.cjs.js.map +1 -1
  13. package/dist/nile-button/nile-button.css.esm.js +89 -33
  14. package/dist/nile-button/nile-button.esm.js +2 -2
  15. package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
  16. package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
  17. package/dist/nile-calendar/nile-calendar.css.cjs.js +1 -1
  18. package/dist/nile-calendar/nile-calendar.css.cjs.js.map +1 -1
  19. package/dist/nile-calendar/nile-calendar.css.esm.js +59 -2
  20. package/dist/nile-calendar/nile-calendar.esm.js +16 -10
  21. package/dist/nile-checkbox/nile-checkbox.css.cjs.js +1 -1
  22. package/dist/nile-checkbox/nile-checkbox.css.cjs.js.map +1 -1
  23. package/dist/nile-checkbox/nile-checkbox.css.esm.js +4 -5
  24. package/dist/nile-chip/nile-chip.css.cjs.js +1 -1
  25. package/dist/nile-chip/nile-chip.css.cjs.js.map +1 -1
  26. package/dist/nile-chip/nile-chip.css.esm.js +37 -23
  27. package/dist/nile-code-editor/nile-code-editor.cjs.js +1 -1
  28. package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
  29. package/dist/nile-code-editor/nile-code-editor.css.cjs.js +1 -1
  30. package/dist/nile-code-editor/nile-code-editor.css.cjs.js.map +1 -1
  31. package/dist/nile-code-editor/nile-code-editor.css.esm.js +7 -6
  32. package/dist/nile-code-editor/nile-code-editor.esm.js +1 -1
  33. package/dist/nile-date-picker/nile-date-picker.cjs.js +1 -1
  34. package/dist/nile-date-picker/nile-date-picker.cjs.js.map +1 -1
  35. package/dist/nile-date-picker/nile-date-picker.esm.js +4 -4
  36. package/dist/nile-detail/index.cjs.js +2 -0
  37. package/dist/nile-detail/index.cjs.js.map +1 -0
  38. package/dist/nile-detail/index.esm.js +1 -0
  39. package/dist/nile-detail/nile-detail.cjs.js +2 -0
  40. package/dist/nile-detail/nile-detail.cjs.js.map +1 -0
  41. package/dist/nile-detail/nile-detail.css.cjs.js +2 -0
  42. package/dist/nile-detail/nile-detail.css.cjs.js.map +1 -0
  43. package/dist/nile-detail/nile-detail.css.esm.js +149 -0
  44. package/dist/nile-detail/nile-detail.esm.js +45 -0
  45. package/dist/nile-detail/nile-detail.utils.cjs.js +2 -0
  46. package/dist/nile-detail/nile-detail.utils.cjs.js.map +1 -0
  47. package/dist/nile-detail/nile-detail.utils.esm.js +1 -0
  48. package/dist/nile-dropdown/nile-dropdown.cjs.js +1 -1
  49. package/dist/nile-dropdown/nile-dropdown.cjs.js.map +1 -1
  50. package/dist/nile-dropdown/nile-dropdown.esm.js +1 -1
  51. package/dist/nile-file-upload/utils/file-validation.util.cjs.js +2 -2
  52. package/dist/nile-file-upload/utils/file-validation.util.cjs.js.map +1 -1
  53. package/dist/nile-file-upload/utils/file-validation.util.esm.js +1 -1
  54. package/dist/nile-filter-chip/nile-filter-chip.cjs.js +1 -1
  55. package/dist/nile-filter-chip/nile-filter-chip.cjs.js.map +1 -1
  56. package/dist/nile-filter-chip/nile-filter-chip.css.cjs.js +1 -1
  57. package/dist/nile-filter-chip/nile-filter-chip.css.cjs.js.map +1 -1
  58. package/dist/nile-filter-chip/nile-filter-chip.css.esm.js +24 -2
  59. package/dist/nile-filter-chip/nile-filter-chip.esm.js +2 -2
  60. package/dist/nile-inline-edit/nile-inline-edit.cjs.js +1 -1
  61. package/dist/nile-inline-edit/nile-inline-edit.cjs.js.map +1 -1
  62. package/dist/nile-inline-edit/nile-inline-edit.css.cjs.js +1 -1
  63. package/dist/nile-inline-edit/nile-inline-edit.css.cjs.js.map +1 -1
  64. package/dist/nile-inline-edit/nile-inline-edit.css.esm.js +15 -6
  65. package/dist/nile-inline-edit/nile-inline-edit.esm.js +2 -2
  66. package/dist/nile-inline-sidebar/nile-inline-sidebar.cjs.js +1 -1
  67. package/dist/nile-inline-sidebar/nile-inline-sidebar.cjs.js.map +1 -1
  68. package/dist/nile-inline-sidebar/nile-inline-sidebar.css.cjs.js +1 -1
  69. package/dist/nile-inline-sidebar/nile-inline-sidebar.css.cjs.js.map +1 -1
  70. package/dist/nile-inline-sidebar/nile-inline-sidebar.css.esm.js +19 -0
  71. package/dist/nile-inline-sidebar/nile-inline-sidebar.esm.js +16 -14
  72. package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.cjs.js +1 -1
  73. package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.cjs.js.map +1 -1
  74. package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.esm.js +8 -3
  75. package/dist/nile-input/nile-input.css.cjs.js +1 -1
  76. package/dist/nile-input/nile-input.css.cjs.js.map +1 -1
  77. package/dist/nile-input/nile-input.css.esm.js +4 -4
  78. package/dist/nile-link/nile-link.cjs.js +1 -1
  79. package/dist/nile-link/nile-link.cjs.js.map +1 -1
  80. package/dist/nile-link/nile-link.css.cjs.js +1 -1
  81. package/dist/nile-link/nile-link.css.cjs.js.map +1 -1
  82. package/dist/nile-link/nile-link.css.esm.js +3 -4
  83. package/dist/nile-link/nile-link.esm.js +2 -2
  84. package/dist/nile-pagination/nile-pagination.cjs.js +1 -1
  85. package/dist/nile-pagination/nile-pagination.cjs.js.map +1 -1
  86. package/dist/nile-pagination/nile-pagination.css.cjs.js +1 -1
  87. package/dist/nile-pagination/nile-pagination.css.cjs.js.map +1 -1
  88. package/dist/nile-pagination/nile-pagination.css.esm.js +109 -5
  89. package/dist/nile-pagination/nile-pagination.esm.js +70 -3
  90. package/dist/nile-qr-code/index.cjs.js +2 -0
  91. package/dist/nile-qr-code/index.cjs.js.map +1 -0
  92. package/dist/nile-qr-code/index.esm.js +1 -0
  93. package/dist/nile-qr-code/nile-qr-code-utils.cjs.js +2 -0
  94. package/dist/nile-qr-code/nile-qr-code-utils.cjs.js.map +1 -0
  95. package/dist/nile-qr-code/nile-qr-code-utils.esm.js +1 -0
  96. package/dist/nile-qr-code/nile-qr-code.cjs.js +2 -0
  97. package/dist/nile-qr-code/nile-qr-code.cjs.js.map +1 -0
  98. package/dist/nile-qr-code/nile-qr-code.css.cjs.js +2 -0
  99. package/dist/nile-qr-code/nile-qr-code.css.cjs.js.map +1 -0
  100. package/dist/nile-qr-code/nile-qr-code.css.esm.js +12 -0
  101. package/dist/nile-qr-code/nile-qr-code.esm.js +9 -0
  102. package/dist/nile-radio/nile-radio.css.cjs.js +1 -1
  103. package/dist/nile-radio/nile-radio.css.cjs.js.map +1 -1
  104. package/dist/nile-radio/nile-radio.css.esm.js +1 -1
  105. package/dist/nile-rich-text-editor/nile-rich-text-editor.cjs.js +1 -1
  106. package/dist/nile-rich-text-editor/nile-rich-text-editor.cjs.js.map +1 -1
  107. package/dist/nile-rich-text-editor/nile-rich-text-editor.css.cjs.js +1 -1
  108. package/dist/nile-rich-text-editor/nile-rich-text-editor.css.cjs.js.map +1 -1
  109. package/dist/nile-rich-text-editor/nile-rich-text-editor.css.esm.js +25 -6
  110. package/dist/nile-rich-text-editor/nile-rich-text-editor.esm.js +1 -1
  111. package/dist/nile-rich-text-editor/nile-rte-select.cjs.js +1 -1
  112. package/dist/nile-rich-text-editor/nile-rte-select.cjs.js.map +1 -1
  113. package/dist/nile-rich-text-editor/nile-rte-select.esm.js +4 -3
  114. package/dist/nile-select/nile-select.css.cjs.js +1 -1
  115. package/dist/nile-select/nile-select.css.cjs.js.map +1 -1
  116. package/dist/nile-select/nile-select.css.esm.js +7 -4
  117. package/dist/nile-slide-toggle/nile-slide-toggle.css.cjs.js +1 -1
  118. package/dist/nile-slide-toggle/nile-slide-toggle.css.cjs.js.map +1 -1
  119. package/dist/nile-slide-toggle/nile-slide-toggle.css.esm.js +5 -1
  120. package/dist/nile-textarea/nile-textarea.css.cjs.js +1 -1
  121. package/dist/nile-textarea/nile-textarea.css.cjs.js.map +1 -1
  122. package/dist/nile-textarea/nile-textarea.css.esm.js +10 -5
  123. package/dist/nile-virtual-select/nile-virtual-select.css.cjs.js +1 -1
  124. package/dist/nile-virtual-select/nile-virtual-select.css.cjs.js.map +1 -1
  125. package/dist/nile-virtual-select/nile-virtual-select.css.esm.js +5 -3
  126. package/dist/src/index.d.ts +2 -0
  127. package/dist/src/index.js +2 -0
  128. package/dist/src/index.js.map +1 -1
  129. package/dist/src/nile-auto-complete/nile-auto-complete.css.js +11 -0
  130. package/dist/src/nile-auto-complete/nile-auto-complete.css.js.map +1 -1
  131. package/dist/src/nile-button/nile-button.css.js +89 -33
  132. package/dist/src/nile-button/nile-button.css.js.map +1 -1
  133. package/dist/src/nile-button/nile-button.js +5 -5
  134. package/dist/src/nile-button/nile-button.js.map +1 -1
  135. package/dist/src/nile-calendar/nile-calendar.css.js +57 -0
  136. package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
  137. package/dist/src/nile-calendar/nile-calendar.d.ts +1 -0
  138. package/dist/src/nile-calendar/nile-calendar.js +24 -6
  139. package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
  140. package/dist/src/nile-checkbox/nile-checkbox.css.js +4 -5
  141. package/dist/src/nile-checkbox/nile-checkbox.css.js.map +1 -1
  142. package/dist/src/nile-chip/nile-chip.css.js +35 -21
  143. package/dist/src/nile-chip/nile-chip.css.js.map +1 -1
  144. package/dist/src/nile-code-editor/nile-code-editor.css.js +7 -6
  145. package/dist/src/nile-code-editor/nile-code-editor.css.js.map +1 -1
  146. package/dist/src/nile-code-editor/nile-code-editor.d.ts +1 -1
  147. package/dist/src/nile-code-editor/nile-code-editor.js +7 -1
  148. package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
  149. package/dist/src/nile-date-picker/nile-date-picker.d.ts +3 -0
  150. package/dist/src/nile-date-picker/nile-date-picker.js +22 -2
  151. package/dist/src/nile-date-picker/nile-date-picker.js.map +1 -1
  152. package/dist/src/nile-detail/index.d.ts +1 -0
  153. package/dist/src/nile-detail/index.js +2 -0
  154. package/dist/src/nile-detail/index.js.map +1 -0
  155. package/dist/src/nile-detail/nile-detail.css.d.ts +3 -0
  156. package/dist/src/nile-detail/nile-detail.css.js +152 -0
  157. package/dist/src/nile-detail/nile-detail.css.js.map +1 -0
  158. package/dist/src/nile-detail/nile-detail.d.ts +29 -0
  159. package/dist/src/nile-detail/nile-detail.js +143 -0
  160. package/dist/src/nile-detail/nile-detail.js.map +1 -0
  161. package/dist/src/nile-detail/nile-detail.test.d.ts +1 -0
  162. package/dist/src/nile-detail/nile-detail.test.js +168 -0
  163. package/dist/src/nile-detail/nile-detail.test.js.map +1 -0
  164. package/dist/src/nile-detail/nile-detail.utils.d.ts +8 -0
  165. package/dist/src/nile-detail/nile-detail.utils.js +117 -0
  166. package/dist/src/nile-detail/nile-detail.utils.js.map +1 -0
  167. package/dist/src/nile-dropdown/nile-dropdown.d.ts +1 -0
  168. package/dist/src/nile-dropdown/nile-dropdown.js +11 -0
  169. package/dist/src/nile-dropdown/nile-dropdown.js.map +1 -1
  170. package/dist/src/nile-file-upload/utils/file-validation.util.js +11 -6
  171. package/dist/src/nile-file-upload/utils/file-validation.util.js.map +1 -1
  172. package/dist/src/nile-filter-chip/nile-filter-chip.css.js +22 -0
  173. package/dist/src/nile-filter-chip/nile-filter-chip.css.js.map +1 -1
  174. package/dist/src/nile-filter-chip/nile-filter-chip.d.ts +1 -0
  175. package/dist/src/nile-filter-chip/nile-filter-chip.js +6 -0
  176. package/dist/src/nile-filter-chip/nile-filter-chip.js.map +1 -1
  177. package/dist/src/nile-inline-edit/nile-inline-edit.css.js +15 -6
  178. package/dist/src/nile-inline-edit/nile-inline-edit.css.js.map +1 -1
  179. package/dist/src/nile-inline-edit/nile-inline-edit.d.ts +2 -0
  180. package/dist/src/nile-inline-edit/nile-inline-edit.js +7 -0
  181. package/dist/src/nile-inline-edit/nile-inline-edit.js.map +1 -1
  182. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.css.js +19 -0
  183. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.css.js.map +1 -1
  184. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.d.ts +6 -0
  185. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.js +88 -4
  186. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.js.map +1 -1
  187. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.test.d.ts +3 -0
  188. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.test.js +110 -0
  189. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.test.js.map +1 -0
  190. package/dist/src/nile-inline-sidebar-group/nile-inline-sidebar-group.test.d.ts +2 -0
  191. package/dist/src/nile-inline-sidebar-group/nile-inline-sidebar-group.test.js +109 -0
  192. package/dist/src/nile-inline-sidebar-group/nile-inline-sidebar-group.test.js.map +1 -0
  193. package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.d.ts +4 -0
  194. package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.js +30 -2
  195. package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.js.map +1 -1
  196. package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.test.d.ts +2 -0
  197. package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.test.js +109 -0
  198. package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.test.js.map +1 -0
  199. package/dist/src/nile-input/nile-input.css.js +4 -4
  200. package/dist/src/nile-input/nile-input.css.js.map +1 -1
  201. package/dist/src/nile-link/nile-link.css.js +1 -2
  202. package/dist/src/nile-link/nile-link.css.js.map +1 -1
  203. package/dist/src/nile-link/nile-link.js +1 -0
  204. package/dist/src/nile-link/nile-link.js.map +1 -1
  205. package/dist/src/nile-pagination/nile-pagination.css.js +107 -3
  206. package/dist/src/nile-pagination/nile-pagination.css.js.map +1 -1
  207. package/dist/src/nile-pagination/nile-pagination.d.ts +5 -1
  208. package/dist/src/nile-pagination/nile-pagination.js +84 -1
  209. package/dist/src/nile-pagination/nile-pagination.js.map +1 -1
  210. package/dist/src/nile-pagination/nile-pagination.test.js +1187 -103
  211. package/dist/src/nile-pagination/nile-pagination.test.js.map +1 -1
  212. package/dist/src/nile-qr-code/index.d.ts +1 -0
  213. package/dist/src/nile-qr-code/index.js +2 -0
  214. package/dist/src/nile-qr-code/index.js.map +1 -0
  215. package/dist/src/nile-qr-code/nile-qr-code-utils.d.ts +15 -0
  216. package/dist/src/nile-qr-code/nile-qr-code-utils.js +678 -0
  217. package/dist/src/nile-qr-code/nile-qr-code-utils.js.map +1 -0
  218. package/dist/src/nile-qr-code/nile-qr-code.css.d.ts +12 -0
  219. package/dist/src/nile-qr-code/nile-qr-code.css.js +24 -0
  220. package/dist/src/nile-qr-code/nile-qr-code.css.js.map +1 -0
  221. package/dist/src/nile-qr-code/nile-qr-code.d.ts +127 -0
  222. package/dist/src/nile-qr-code/nile-qr-code.js +381 -0
  223. package/dist/src/nile-qr-code/nile-qr-code.js.map +1 -0
  224. package/dist/src/nile-qr-code/nile-qr-code.test.d.ts +1 -0
  225. package/dist/src/nile-qr-code/nile-qr-code.test.js +719 -0
  226. package/dist/src/nile-qr-code/nile-qr-code.test.js.map +1 -0
  227. package/dist/src/nile-radio/nile-radio.css.js +1 -1
  228. package/dist/src/nile-radio/nile-radio.css.js.map +1 -1
  229. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.css.js +25 -6
  230. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.css.js.map +1 -1
  231. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.d.ts +1 -0
  232. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.js +17 -6
  233. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.js.map +1 -1
  234. package/dist/src/nile-rich-text-editor/nile-rte-select.d.ts +1 -0
  235. package/dist/src/nile-rich-text-editor/nile-rte-select.js +7 -2
  236. package/dist/src/nile-rich-text-editor/nile-rte-select.js.map +1 -1
  237. package/dist/src/nile-select/nile-select.css.js +7 -4
  238. package/dist/src/nile-select/nile-select.css.js.map +1 -1
  239. package/dist/src/nile-slide-toggle/nile-slide-toggle.css.js +5 -1
  240. package/dist/src/nile-slide-toggle/nile-slide-toggle.css.js.map +1 -1
  241. package/dist/src/nile-textarea/nile-textarea.css.js +10 -5
  242. package/dist/src/nile-textarea/nile-textarea.css.js.map +1 -1
  243. package/dist/src/nile-virtual-select/nile-virtual-select.css.js +5 -3
  244. package/dist/src/nile-virtual-select/nile-virtual-select.css.js.map +1 -1
  245. package/dist/src/version.js +1 -1
  246. package/dist/src/version.js.map +1 -1
  247. package/dist/tsconfig.tsbuildinfo +1 -1
  248. package/package.json +3 -2
  249. package/src/index.ts +3 -2
  250. package/src/nile-auto-complete/nile-auto-complete.css.ts +11 -0
  251. package/src/nile-button/nile-button.css.ts +89 -33
  252. package/src/nile-button/nile-button.ts +6 -5
  253. package/src/nile-calendar/nile-calendar.css.ts +57 -0
  254. package/src/nile-calendar/nile-calendar.ts +17 -6
  255. package/src/nile-checkbox/nile-checkbox.css.ts +4 -5
  256. package/src/nile-chip/nile-chip.css.ts +35 -21
  257. package/src/nile-code-editor/nile-code-editor.css.ts +7 -6
  258. package/src/nile-code-editor/nile-code-editor.ts +7 -1
  259. package/src/nile-date-picker/nile-date-picker.ts +22 -2
  260. package/src/nile-detail/index.ts +1 -0
  261. package/src/nile-detail/nile-detail.css.ts +153 -0
  262. package/src/nile-detail/nile-detail.test.ts +215 -0
  263. package/src/nile-detail/nile-detail.ts +140 -0
  264. package/src/nile-detail/nile-detail.utils.ts +133 -0
  265. package/src/nile-dropdown/nile-dropdown.ts +11 -0
  266. package/src/nile-file-upload/utils/file-validation.util.ts +10 -5
  267. package/src/nile-filter-chip/nile-filter-chip.css.ts +22 -0
  268. package/src/nile-filter-chip/nile-filter-chip.ts +2 -0
  269. package/src/nile-inline-edit/nile-inline-edit.css.ts +15 -6
  270. package/src/nile-inline-edit/nile-inline-edit.ts +4 -0
  271. package/src/nile-inline-sidebar/nile-inline-sidebar.css.ts +19 -0
  272. package/src/nile-inline-sidebar/nile-inline-sidebar.test.ts +108 -0
  273. package/src/nile-inline-sidebar/nile-inline-sidebar.ts +108 -5
  274. package/src/nile-inline-sidebar-group/nile-inline-sidebar-group.test.ts +107 -0
  275. package/src/nile-inline-sidebar-item/nile-inline-sidebar-item.test.ts +107 -0
  276. package/src/nile-inline-sidebar-item/nile-inline-sidebar-item.ts +34 -3
  277. package/src/nile-input/nile-input.css.ts +4 -4
  278. package/src/nile-link/nile-link.css.ts +1 -2
  279. package/src/nile-link/nile-link.ts +1 -0
  280. package/src/nile-pagination/nile-pagination.css.ts +107 -3
  281. package/src/nile-pagination/nile-pagination.test.ts +1388 -101
  282. package/src/nile-pagination/nile-pagination.ts +87 -2
  283. package/src/nile-qr-code/index.ts +1 -0
  284. package/src/nile-qr-code/nile-qr-code-utils.ts +733 -0
  285. package/src/nile-qr-code/nile-qr-code.css.ts +26 -0
  286. package/src/nile-qr-code/nile-qr-code.test.ts +879 -0
  287. package/src/nile-qr-code/nile-qr-code.ts +431 -0
  288. package/src/nile-radio/nile-radio.css.ts +1 -1
  289. package/src/nile-rich-text-editor/nile-rich-text-editor.css.ts +25 -6
  290. package/src/nile-rich-text-editor/nile-rich-text-editor.ts +14 -6
  291. package/src/nile-rich-text-editor/nile-rte-select.ts +5 -2
  292. package/src/nile-select/nile-select.css.ts +7 -4
  293. package/src/nile-slide-toggle/nile-slide-toggle.css.ts +5 -1
  294. package/src/nile-textarea/nile-textarea.css.ts +10 -5
  295. package/src/nile-virtual-select/nile-virtual-select.css.ts +5 -3
  296. package/vscode-html-custom-data.json +163 -10
  297. package/web-test-runner.config.mjs +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"file-validation.util.cjs.js","sources":["../../../../src/nile-file-upload/utils/file-validation.util.ts"],"sourcesContent":["import { DragHandler } from \"./drag-drop.util\";\nimport { FileUploadState, FileUploadError, FileUploadEvent, FileUploadErrorReason } from \"../types\";\nimport { NileFileUpload } from \"../nile-file-upload\";\nimport { RemoveFileDetail } from \"../../nile-file-preview/types\";\nimport { ErrorType } from \"../types\";\n\nexport const setUpDragHandler = (\n nileFileUpload: NileFileUpload,\n dragHandler: DragHandler,\n): void => {\n dragHandler.setIsDisabled(() => {\n return nileFileUpload.state === FileUploadState.DISABLED;\n });\n\n dragHandler.onStateChange((newState: FileUploadState) => {\n nileFileUpload.state = newState;\n });\n\n dragHandler.onFileDrop((files: File[]) => {\n if (nileFileUpload.state === FileUploadState.DISABLED) return;\n nileFileUpload.errorMessage = '';\n const maxSize = parseSize(nileFileUpload.size);\n const uploadedFiles = nileFileUpload.uploadedFiles;\n\n if (!nileFileUpload.allowMultiple && (uploadedFiles.length + files.length > 1)) {\n nileFileUpload.errorMessage = FileUploadError.MULTIPLE_NOT_ALLOWED;\n nileFileUpload.requestUpdate();\n return;\n }\n\n let sizeExceeded = false;\n let duplicatesFound = false;\n const newFiles: File[] = [];\n const rejectedFiles: File[] = [];\n\n for (const file of files) {\n if (file.size > maxSize) {\n sizeExceeded = true;\n rejectedFiles.push(file);\n continue;\n }\n\n if (\n !nileFileUpload.allowDuplicates &&\n uploadedFiles.some(\n (uploaded) =>\n uploaded.name === file.name &&\n uploaded.size === file.size &&\n uploaded.type === file.type\n )\n ) {\n duplicatesFound = true;\n rejectedFiles.push(file);\n continue;\n }\n\n if(!rejectedFiles.includes(file)) {\n newFiles.push(file);\n }\n }\n\n if (sizeExceeded) {\n nileFileUpload.errorMessage = FileUploadError.SIZE_LIMIT_EXCEEDED;\n const sizeExceededFiles = rejectedFiles.filter(file => file.size > maxSize);\n nileFileUpload.dispatchEvent(new CustomEvent(FileUploadEvent.NILE_ERROR, {\n detail: { \n files: sizeExceededFiles,\n type: FileUploadErrorReason.SIZE_LIMIT_EXCEEDED,\n errorType: ErrorType.VALIDATION,\n message: FileUploadError.SIZE_LIMIT_EXCEEDED,\n },\n bubbles: true,\n composed: true,\n }));\n\n nileFileUpload.dispatchEvent(new CustomEvent(FileUploadEvent.NILE_SIZE_EXCEED_FILES, {\n detail: { files: rejectedFiles }\n }));\n nileFileUpload.requestUpdate();\n }\n\n if (duplicatesFound && newFiles.length === 0) {\n nileFileUpload.errorMessage = FileUploadError.DUPLICATES_NOT_ALLOWED;\n nileFileUpload.requestUpdate();\n }\n\n let updatedFiles = [];\n for (const file of newFiles) {\n if(nileFileUpload.allowedTypes.includes(file.type)) {\n updatedFiles.push(file);\n } else {\n nileFileUpload.errorMessage = FileUploadError.INVALID_FORMAT;\n }\n }\n\n nileFileUpload.uploadedFiles = [...uploadedFiles, ...updatedFiles];\n nileFileUpload.requestUpdate();\n });\n\n\n dragHandler.setErrorMessage((errorMessage: string) => {\n nileFileUpload.errorMessage = errorMessage;\n });\n};\n\nexport const addGlobalListeners = (dragHandler: DragHandler): void => {\n document.addEventListener('dragover', dragHandler.preventDragOver, { passive: false });\n document.addEventListener('drop', dragHandler.preventDrop, { passive: false });\n}\n\nexport const addInternalListeners = (nileFileUpload: NileFileUpload, dragHandler: DragHandler, uploadRequests: any): void => {\n nileFileUpload.addEventListener('mouseenter', (e) => handleHoverIn(nileFileUpload.setState, nileFileUpload.state));\n nileFileUpload.addEventListener('mouseleave', (e) => handleHoverOut(nileFileUpload.setState, nileFileUpload.state));\n nileFileUpload.addEventListener('dragenter', (e) => dragHandler.dragEnter(e));\n nileFileUpload.addEventListener('dragleave', (e) => dragHandler.dragLeave(e));\n nileFileUpload.addEventListener('dragover', (e) => dragHandler.dragOver(e));\n nileFileUpload.addEventListener('drop', (e) => dragHandler.drop(e));\n const clickHandler = nileFileUpload.browseFiles.bind(nileFileUpload);\n\n const observer = new ResizeObserver(entries => {\n for (const entry of entries) {\n if (entry.contentRect.width < 400) {\n nileFileUpload.horizontalDiv.addEventListener('click', clickHandler);\n } else {\n nileFileUpload.horizontalDiv.removeEventListener('click', clickHandler);\n }\n }\n });\n observer.observe(nileFileUpload.horizontalDiv);\n\n cancelFileUpload(nileFileUpload, uploadRequests);\n removeFile(nileFileUpload.uploadedFiles, nileFileUpload);\n}\n\nexport function handleHoverIn(\n setState: (state: FileUploadState) => void,\n currentState: FileUploadState\n): void {\n if (currentState === FileUploadState.DEFAULT) {\n setState(FileUploadState.HOVER);\n }\n}\n\nexport function handleHoverOut(\n setState: (state: FileUploadState) => void,\n currentState: FileUploadState\n): void {\n if (currentState === FileUploadState.HOVER) {\n setState(FileUploadState.DEFAULT);\n }\n}\n\nexport function uploadFiles(nileFileUpload: NileFileUpload) {\n const { uploadedFiles, fileUploadUrl, uploadRequests } = nileFileUpload;\n if (!fileUploadUrl || !uploadedFiles?.length) return;\n\n for (const file of uploadedFiles) {\n if (uploadRequests.has(file)) continue;\n if (nileFileUpload.doNotUpload.includes(file)) continue;\n\n if((file as any).errorMessage) continue;\n\n const formData = new FormData();\n formData.append('file', file);\n\n const xhr = new XMLHttpRequest();\n uploadRequests.set(file, xhr);\n\n nileFileUpload.emit(FileUploadEvent.NILE_UPLOADING);\n\n xhr.upload.onprogress = (e) => {\n const percent = Math.floor((e.loaded / e.total) * 100);\n\n nileFileUpload.dispatchEvent(new CustomEvent(FileUploadEvent.NILE_UPLOAD_PROGRESS, {\n detail: { file, progress: percent },\n bubbles: true,\n composed: true,\n }));\n };\n\n xhr.onload = () => {\n if (xhr.status >= 200 && xhr.status < 300) {\n nileFileUpload.dispatchEvent(new CustomEvent(FileUploadEvent.NILE_UPLOAD_SUCCESS, {\n detail: { file, response: xhr.response },\n bubbles: true,\n composed: true,\n }));\n } else {\n nileFileUpload.errorMessage = FileUploadError.SERVER_SIDE_ERROR;\n nileFileUpload.dispatchEvent(new CustomEvent(FileUploadEvent.SERVER_SIDE_ERROR, {\n detail: { file, status: xhr.status, response: xhr.response }\n }));\n\n nileFileUpload.dispatchEvent(new CustomEvent(FileUploadEvent.NILE_ERROR, {\n detail: { \n type: FileUploadErrorReason.SERVER_SIDE_ERROR, \n file, \n status: xhr?.status || 0, \n response: xhr?.response,\n message: FileUploadError.SERVER_SIDE_ERROR,\n errorType: ErrorType.SERVER,\n },\n bubbles: true,\n composed: true,\n }));\n nileFileUpload.requestUpdate();\n }\n };\n\n xhr.onerror = () => {\n uploadRequests.delete(file);\n nileFileUpload.doNotUpload.push(file);\n nileFileUpload.errorMessage = FileUploadError.NETWORK_ERROR;\n nileFileUpload.dispatchEvent(new CustomEvent(FileUploadEvent.NILE_ERROR, {\n detail: { \n type: FileUploadErrorReason.NETWORK_ERROR,\n file,\n status: xhr.status,\n response: xhr.response,\n errorType: ErrorType.NETWORK,\n message: FileUploadError.NETWORK_ERROR,\n },\n bubbles: true,\n composed: true,\n }));\n\n nileFileUpload.dispatchEvent(new CustomEvent(FileUploadEvent.NILE_NETWORK_ERROR, {\n detail: { file, status: xhr.status, response: xhr.response },\n bubbles: true,\n composed: true,\n }));\n };\n\n xhr.open('POST', fileUploadUrl);\n xhr.send(formData);\n }\n}\n\nexport const cancelFileUpload = (nileFileUpload: NileFileUpload, uploadRequests: Map<File, XMLHttpRequest>) => {\n document.addEventListener(FileUploadEvent.NILE_CANCEL_UPLOAD, (e: CustomEvent) => {\n const fileToCancel = e.detail.file;\n const xhr = uploadRequests.get(fileToCancel);\n\n if (xhr) {\n xhr.abort();\n }\n uploadRequests.delete(fileToCancel);\n nileFileUpload.uploadedFiles = nileFileUpload.uploadedFiles.filter(file => file !== fileToCancel);\n\n nileFileUpload.dispatchEvent(new CustomEvent(FileUploadEvent.NILE_ERROR, {\n detail: { \n type: FileUploadErrorReason.UPLOAD_CANCELLED, \n file: fileToCancel,\n message: FileUploadError.UPLOAD_CANCELLED,\n errorType: ErrorType.UPLOAD_CANCELLED,\n },\n bubbles: true,\n composed: true,\n }));\n\n nileFileUpload.dispatchEvent(new CustomEvent(FileUploadEvent.NILE_UPLOAD_CANCELLED, {\n detail: { file: fileToCancel }\n }));\n });\n};\n\nfunction parseSize(sizeStr: string): number {\n const units = { B: 1, KB: 1024, MB: 1024 ** 2, GB: 1024 ** 3 };\n const num = parseFloat(sizeStr);\n const unit = sizeStr.replace(/[0-9.\\s]/g, '').toUpperCase();\n const multiplier = units[unit as keyof typeof units] || 1;\n return num * multiplier;\n}\n\nexport const preventDefaultAndStopPropagation = (event: Event | DragEvent): void => {\n event.preventDefault?.();\n event.stopPropagation();\n}\n\nexport const removeFile = (uploadedFiles: File[], nileFileUpload: NileFileUpload) => {\n document.addEventListener('nile-remove', (e: CustomEvent<RemoveFileDetail>) => {\n const { value } = e.detail;\n uploadedFiles = uploadedFiles.filter(file => file !== value);\n nileFileUpload.uploadedFiles = uploadedFiles;\n nileFileUpload.errorMessage = '';\n nileFileUpload.requestUpdate();\n });\n}\n\nexport const truncateString = (nileFileUpload: NileFileUpload): void => {\n if(nileFileUpload.variant === 'vertical' && nileFileUpload.errorMessage.length > 34) {\n nileFileUpload.isStringTruncated = true;\n nileFileUpload.requestUpdate();\n } else if(nileFileUpload.variant === 'horizontal' && nileFileUpload.errorMessage.length > 96) {\n nileFileUpload.isStringTruncated = true;\n nileFileUpload.requestUpdate();\n }\n}\n"],"names":["uploadFiles","nileFileUpload","uploadedFiles","fileUploadUrl","uploadRequests","length","_iterator3","_createForOfIteratorHelper","file","has","doNotUpload","includes","errorMessage","formData","FormData","append","xhr","XMLHttpRequest","set","emit","FileUploadEvent","NILE_UPLOADING","upload","onprogress","e","percent","Math","floor","loaded","total","dispatchEvent","CustomEvent","NILE_UPLOAD_PROGRESS","detail","progress","bubbles","composed","onload","status","NILE_UPLOAD_SUCCESS","response","FileUploadError","SERVER_SIDE_ERROR","NILE_ERROR","type","FileUploadErrorReason","message","errorType","ErrorType","SERVER","requestUpdate","onerror","delete","push","NETWORK_ERROR","NETWORK","NILE_NETWORK_ERROR","open","send","_ret","s","_step3","n","done","_loop2","err","f","_export","setUpDragHandler","dragHandler","setIsDisabled","state","FileUploadState","DISABLED","onStateChange","newState","onFileDrop","files","maxSize","sizeStr","units","B","KB","MB","GB","num","parseFloat","unit","replace","toUpperCase","multiplier","parseSize","size","allowMultiple","MULTIPLE_NOT_ALLOWED","sizeExceeded","duplicatesFound","newFiles","rejectedFiles","_iterator","allowDuplicates","some","uploaded","name","_step","_loop","SIZE_LIMIT_EXCEEDED","sizeExceededFiles","filter","VALIDATION","NILE_SIZE_EXCEED_FILES","DUPLICATES_NOT_ALLOWED","updatedFiles","_i","_d","allowedTypes","INVALID_FORMAT","concat","_toConsumableArray","setErrorMessage","addGlobalListeners","document","addEventListener","preventDragOver","passive","preventDrop","addInternalListeners","i","handleHoverIn","setState","DEFAULT","HOVER","handleHoverOut","dragEnter","dragLeave","dragOver","drop","clickHandler","browseFiles","bind","ResizeObserver","entries","entry","_iterator2","_step2","contentRect","width","horizontalDiv","removeEventListener","observe","cancelFileUpload","removeFile","NILE_CANCEL_UPLOAD","fileToCancel","get","abort","UPLOAD_CANCELLED","NILE_UPLOAD_CANCELLED","preventDefaultAndStopPropagation","event","preventDefault","stopPropagation","value","truncateString","variant","isStringTruncated"],"mappings":"s5DAwJM,QAAUA,CAAAA,CAAAA,CAAYC,CAC1B,CAAA,CAAA,GAAQC,CAAAA,CAAaC,CAAoCF,EAAnDC,cAAiBC,EAAkCF,EAApCE,aAAAA,CAAiBC,CAAAA,CAAmBH,EAArBG,cAAEA,CACtC,GAAKD,CAAAA,EAAkBD,UAAAA,YAAAA,EAAeG,MAEtC,MAAAC,UAAA,CAAAC,0BAAA,CAAmBL,CAAAA,EAAAA,MAAAA,SAAAA,MAAAA,UAAAA,OAAAA,CAAe,IAAvBM,CAAAA,CAAQN,CAAAA,MAAAA,CAAAA,KAAAA,C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gByI,sBAAuB,CAClF5H,MAAAA,CAAQ,CAAEzB,IAAAA,CAAMiJ,KACf,EACH,CAAA,EAAA,CAAAtF,OAAA,KAWS2F,CAAoCC,CAAAA,QAApCD,CAAAA,CAAoCC,CAAAA,CAAAA,CAAAA,KAAAA,iBAAAA,CAC/CA,CAAAA,iBAAAA,CAAAA,EAAMC,cACND,UAAAA,iBAAAA,WADAA,iBAAAA,CAAAA,IAAAA,CAAAA,CACAA,CAAAA,CAAAA,CAAAA,CAAME,iBAAiB,EAGZV,EAAAA,CAAAA,CAAa,QAAbA,CAAAA,CAAAA,CAAcrJ,CAAuBD,CAAAA,CAAAA,CAAAA,CAChDwH,SAASC,gBAAiB,CAAA,aAAA,CAAgBlG,SAAAA,GACxC,GAAQ0I,CAAAA,CAAU1I,CAAAA,CAAAA,CAAES,OAAdiI,KAAAA,CACNhK,CAAgBA,CAAAA,CAAAA,CAAc0G,OAAOpG,SAAAA,CAAQA,QAAAA,CAAAA,CAAAA,GAAS0J,KACtDjK,CAAeC,CAAAA,aAAAA,CAAgBA,EAC/BD,CAAeW,CAAAA,YAAAA,CAAe,GAC9BX,CAAeiD,CAAAA,aAAAA,CAAAA,CAAe,GAC9B,EAGSiH,CAAAA,OAAAA,KAAAA,CAAAA,CAAkBlK,QAAlBkK,CAAAA,CAAAA,CAAkBlK,IACC,UAA3BA,GAAAA,CAAAA,CAAemK,SAA0BnK,CAAeW,CAAAA,YAAAA,CAAaP,OAAS,EAG5C,EAAA,YAAA,GAA3BJ,EAAemK,OAA4BnK,EAAAA,CAAAA,CAAeW,aAAaP,MAAS,CAAA,EAAA,IAFxFJ,EAAeoK,iBAAoB,CAAA,CAAA,CAAA,CACnCpK,EAAeiD,aAIhB,CAAA,CAAA,CAAA,EAAA"}
1
+ {"version":3,"file":"file-validation.util.cjs.js","sources":["../../../../src/nile-file-upload/utils/file-validation.util.ts"],"sourcesContent":["import { DragHandler } from \"./drag-drop.util\";\nimport { FileUploadState, FileUploadError, FileUploadEvent, FileUploadErrorReason } from \"../types\";\nimport { NileFileUpload } from \"../nile-file-upload\";\nimport { RemoveFileDetail } from \"../../nile-file-preview/types\";\nimport { ErrorType } from \"../types\";\n\nexport const setUpDragHandler = (\n nileFileUpload: NileFileUpload,\n dragHandler: DragHandler,\n): void => {\n dragHandler.setIsDisabled(() => {\n return nileFileUpload.state === FileUploadState.DISABLED;\n });\n\n dragHandler.onStateChange((newState: FileUploadState) => {\n nileFileUpload.state = newState;\n });\n\n dragHandler.onFileDrop((files: File[]) => {\n if (nileFileUpload.state === FileUploadState.DISABLED) return;\n nileFileUpload.errorMessage = '';\n const maxSize = parseSize(nileFileUpload.size);\n const uploadedFiles = nileFileUpload.uploadedFiles;\n\n if (!nileFileUpload.allowMultiple && (uploadedFiles.length + files.length > 1)) {\n nileFileUpload.errorMessage = FileUploadError.MULTIPLE_NOT_ALLOWED;\n nileFileUpload.requestUpdate();\n return;\n }\n\n let sizeExceeded = false;\n let duplicatesFound = false;\n const newFiles: File[] = [];\n const rejectedFiles: File[] = [];\n\n for (const file of files) {\n if (file.size > maxSize) {\n sizeExceeded = true;\n rejectedFiles.push(file);\n continue;\n }\n\n if (\n !nileFileUpload.allowDuplicates &&\n uploadedFiles.some(\n (uploaded) =>\n uploaded.name === file.name &&\n uploaded.size === file.size &&\n uploaded.type === file.type\n )\n ) {\n duplicatesFound = true;\n rejectedFiles.push(file);\n continue;\n }\n\n if(!rejectedFiles.includes(file)) {\n newFiles.push(file);\n }\n }\n\n if (sizeExceeded) {\n nileFileUpload.errorMessage = FileUploadError.SIZE_LIMIT_EXCEEDED;\n const sizeExceededFiles = rejectedFiles.filter(file => file.size > maxSize);\n nileFileUpload.dispatchEvent(new CustomEvent(FileUploadEvent.NILE_ERROR, {\n detail: { \n files: sizeExceededFiles,\n type: FileUploadErrorReason.SIZE_LIMIT_EXCEEDED,\n errorType: ErrorType.VALIDATION,\n message: FileUploadError.SIZE_LIMIT_EXCEEDED,\n },\n bubbles: true,\n composed: true,\n }));\n\n nileFileUpload.dispatchEvent(new CustomEvent(FileUploadEvent.NILE_SIZE_EXCEED_FILES, {\n detail: { files: rejectedFiles }\n }));\n nileFileUpload.requestUpdate();\n }\n\n if (duplicatesFound && newFiles.length === 0) {\n nileFileUpload.errorMessage = FileUploadError.DUPLICATES_NOT_ALLOWED;\n nileFileUpload.requestUpdate();\n }\n\n let updatedFiles = [];\n if(nileFileUpload.allowedTypes.length > 0) {\n for (const file of newFiles) {\n if(nileFileUpload.allowedTypes.includes(file.type)) {\n updatedFiles.push(file);\n } else {\n nileFileUpload.errorMessage = FileUploadError.INVALID_FORMAT;\n }\n }\n }\n if(updatedFiles.length === 0) {\n updatedFiles = newFiles;\n }\n\n nileFileUpload.uploadedFiles = [...uploadedFiles, ...updatedFiles];\n nileFileUpload.requestUpdate();\n });\n\n\n dragHandler.setErrorMessage((errorMessage: string) => {\n nileFileUpload.errorMessage = errorMessage;\n });\n};\n\nexport const addGlobalListeners = (dragHandler: DragHandler): void => {\n document.addEventListener('dragover', dragHandler.preventDragOver, { passive: false });\n document.addEventListener('drop', dragHandler.preventDrop, { passive: false });\n}\n\nexport const addInternalListeners = (nileFileUpload: NileFileUpload, dragHandler: DragHandler, uploadRequests: any): void => {\n nileFileUpload.addEventListener('mouseenter', (e) => handleHoverIn(nileFileUpload.setState, nileFileUpload.state));\n nileFileUpload.addEventListener('mouseleave', (e) => handleHoverOut(nileFileUpload.setState, nileFileUpload.state));\n nileFileUpload.addEventListener('dragenter', (e) => dragHandler.dragEnter(e));\n nileFileUpload.addEventListener('dragleave', (e) => dragHandler.dragLeave(e));\n nileFileUpload.addEventListener('dragover', (e) => dragHandler.dragOver(e));\n nileFileUpload.addEventListener('drop', (e) => dragHandler.drop(e));\n const clickHandler = nileFileUpload.browseFiles.bind(nileFileUpload);\n\n const observer = new ResizeObserver(entries => {\n for (const entry of entries) {\n if (entry.contentRect.width < 400) {\n nileFileUpload.horizontalDiv.addEventListener('click', clickHandler);\n } else {\n nileFileUpload.horizontalDiv.removeEventListener('click', clickHandler);\n }\n }\n });\n observer.observe(nileFileUpload.horizontalDiv);\n\n cancelFileUpload(nileFileUpload, uploadRequests);\n removeFile(nileFileUpload.uploadedFiles, nileFileUpload);\n}\n\nexport function handleHoverIn(\n setState: (state: FileUploadState) => void,\n currentState: FileUploadState\n): void {\n if (currentState === FileUploadState.DEFAULT) {\n setState(FileUploadState.HOVER);\n }\n}\n\nexport function handleHoverOut(\n setState: (state: FileUploadState) => void,\n currentState: FileUploadState\n): void {\n if (currentState === FileUploadState.HOVER) {\n setState(FileUploadState.DEFAULT);\n }\n}\n\nexport function uploadFiles(nileFileUpload: NileFileUpload) {\n const { uploadedFiles, fileUploadUrl, uploadRequests } = nileFileUpload;\n if (!fileUploadUrl || !uploadedFiles?.length) return;\n\n for (const file of uploadedFiles) {\n if (uploadRequests.has(file)) continue;\n if (nileFileUpload.doNotUpload.includes(file)) continue;\n\n if((file as any).errorMessage) continue;\n\n const formData = new FormData();\n formData.append('file', file);\n\n const xhr = new XMLHttpRequest();\n uploadRequests.set(file, xhr);\n\n nileFileUpload.emit(FileUploadEvent.NILE_UPLOADING);\n\n xhr.upload.onprogress = (e) => {\n const percent = Math.floor((e.loaded / e.total) * 100);\n\n nileFileUpload.dispatchEvent(new CustomEvent(FileUploadEvent.NILE_UPLOAD_PROGRESS, {\n detail: { file, progress: percent },\n bubbles: true,\n composed: true,\n }));\n };\n\n xhr.onload = () => {\n if (xhr.status >= 200 && xhr.status < 300) {\n nileFileUpload.dispatchEvent(new CustomEvent(FileUploadEvent.NILE_UPLOAD_SUCCESS, {\n detail: { file, response: xhr.response },\n bubbles: true,\n composed: true,\n }));\n } else {\n nileFileUpload.errorMessage = FileUploadError.SERVER_SIDE_ERROR;\n nileFileUpload.dispatchEvent(new CustomEvent(FileUploadEvent.SERVER_SIDE_ERROR, {\n detail: { file, status: xhr.status, response: xhr.response }\n }));\n\n nileFileUpload.dispatchEvent(new CustomEvent(FileUploadEvent.NILE_ERROR, {\n detail: { \n type: FileUploadErrorReason.SERVER_SIDE_ERROR, \n file, \n status: xhr?.status || 0, \n response: xhr?.response,\n message: FileUploadError.SERVER_SIDE_ERROR,\n errorType: ErrorType.SERVER,\n },\n bubbles: true,\n composed: true,\n }));\n nileFileUpload.requestUpdate();\n }\n };\n\n xhr.onerror = () => {\n uploadRequests.delete(file);\n nileFileUpload.doNotUpload.push(file);\n nileFileUpload.errorMessage = FileUploadError.NETWORK_ERROR;\n nileFileUpload.dispatchEvent(new CustomEvent(FileUploadEvent.NILE_ERROR, {\n detail: { \n type: FileUploadErrorReason.NETWORK_ERROR,\n file,\n status: xhr.status,\n response: xhr.response,\n errorType: ErrorType.NETWORK,\n message: FileUploadError.NETWORK_ERROR,\n },\n bubbles: true,\n composed: true,\n }));\n\n nileFileUpload.dispatchEvent(new CustomEvent(FileUploadEvent.NILE_NETWORK_ERROR, {\n detail: { file, status: xhr.status, response: xhr.response },\n bubbles: true,\n composed: true,\n }));\n };\n\n xhr.open('POST', fileUploadUrl);\n xhr.send(formData);\n }\n}\n\nexport const cancelFileUpload = (nileFileUpload: NileFileUpload, uploadRequests: Map<File, XMLHttpRequest>) => {\n document.addEventListener(FileUploadEvent.NILE_CANCEL_UPLOAD, (e: CustomEvent) => {\n const fileToCancel = e.detail.file;\n const xhr = uploadRequests.get(fileToCancel);\n\n if (xhr) {\n xhr.abort();\n }\n uploadRequests.delete(fileToCancel);\n nileFileUpload.uploadedFiles = nileFileUpload.uploadedFiles.filter(file => file !== fileToCancel);\n\n nileFileUpload.dispatchEvent(new CustomEvent(FileUploadEvent.NILE_ERROR, {\n detail: { \n type: FileUploadErrorReason.UPLOAD_CANCELLED, \n file: fileToCancel,\n message: FileUploadError.UPLOAD_CANCELLED,\n errorType: ErrorType.UPLOAD_CANCELLED,\n },\n bubbles: true,\n composed: true,\n }));\n\n nileFileUpload.dispatchEvent(new CustomEvent(FileUploadEvent.NILE_UPLOAD_CANCELLED, {\n detail: { file: fileToCancel }\n }));\n });\n};\n\nfunction parseSize(sizeStr: string): number {\n const units = { B: 1, KB: 1024, MB: 1024 ** 2, GB: 1024 ** 3 };\n const num = parseFloat(sizeStr);\n const unit = sizeStr.replace(/[0-9.\\s]/g, '').toUpperCase();\n const multiplier = units[unit as keyof typeof units] || 1;\n return num * multiplier;\n}\n\nexport const preventDefaultAndStopPropagation = (event: Event | DragEvent): void => {\n event.preventDefault?.();\n event.stopPropagation();\n}\n\nexport const removeFile = (uploadedFiles: File[], nileFileUpload: NileFileUpload) => {\n document.addEventListener('nile-remove', (e: CustomEvent<RemoveFileDetail>) => {\n const { value } = e.detail;\n uploadedFiles = uploadedFiles.filter(file => file !== value);\n nileFileUpload.uploadedFiles = uploadedFiles;\n nileFileUpload.errorMessage = '';\n nileFileUpload.requestUpdate();\n });\n}\n\nexport const truncateString = (nileFileUpload: NileFileUpload): void => {\n if(nileFileUpload.variant === 'vertical' && nileFileUpload.errorMessage.length > 34) {\n nileFileUpload.isStringTruncated = true;\n nileFileUpload.requestUpdate();\n } else if(nileFileUpload.variant === 'horizontal' && nileFileUpload.errorMessage.length > 96) {\n nileFileUpload.isStringTruncated = true;\n nileFileUpload.requestUpdate();\n }\n}\n"],"names":["uploadFiles","nileFileUpload","uploadedFiles","fileUploadUrl","uploadRequests","length","_step4","_loop2","file","has","doNotUpload","includes","errorMessage","formData","FormData","append","xhr","XMLHttpRequest","set","emit","FileUploadEvent","NILE_UPLOADING","upload","onprogress","e","percent","Math","floor","loaded","total","dispatchEvent","CustomEvent","NILE_UPLOAD_PROGRESS","detail","progress","bubbles","composed","onload","status","NILE_UPLOAD_SUCCESS","response","FileUploadError","SERVER_SIDE_ERROR","NILE_ERROR","type","FileUploadErrorReason","message","errorType","ErrorType","SERVER","requestUpdate","onerror","delete","push","NETWORK_ERROR","NETWORK","NILE_NETWORK_ERROR","open","send","_ret","_iterator4","s","n","done","err","f","_export","setUpDragHandler","dragHandler","setIsDisabled","state","FileUploadState","DISABLED","onStateChange","newState","onFileDrop","files","maxSize","sizeStr","units","B","KB","MB","GB","num","parseFloat","unit","replace","toUpperCase","multiplier","parseSize","size","allowMultiple","MULTIPLE_NOT_ALLOWED","sizeExceeded","duplicatesFound","newFiles","rejectedFiles","_iterator","_createForOfIteratorHelper","allowDuplicates","some","uploaded","name","_step","_loop","SIZE_LIMIT_EXCEEDED","sizeExceededFiles","filter","VALIDATION","NILE_SIZE_EXCEED_FILES","DUPLICATES_NOT_ALLOWED","updatedFiles","allowedTypes","_iterator2","_step2","INVALID_FORMAT","setErrorMessage","addGlobalListeners","document","addEventListener","preventDragOver","passive","preventDrop","addInternalListeners","i","handleHoverIn","setState","DEFAULT","HOVER","handleHoverOut","dragEnter","dragLeave","dragOver","drop","clickHandler","browseFiles","bind","ResizeObserver","entries","_iterator3","_step3","entry","contentRect","width","horizontalDiv","removeEventListener","observe","cancelFileUpload","removeFile","NILE_CANCEL_UPLOAD","fileToCancel","get","abort","UPLOAD_CANCELLED","NILE_UPLOAD_CANCELLED","preventDefaultAndStopPropagation","event","preventDefault","stopPropagation","value","truncateString","variant","isStringTruncated"],"mappings":"s5DA6JM,QAAUA,CAAAA,CAAAA,CAAYC,GAC1B,GAAQC,CAAAA,EAAiDD,CAAAA,CAAnDC,aAAAA,CAAiBC,CAAAA,CAAkCF,CAAAA,CAApCE,aAAEA,CAAeC,CAAmBH,CAAAA,CAAAA,CAArBG,eACpC,GAAKD,CAAkBD,EAAAA,CAAAA,SAAAA,CAAAA,WAAAA,CAAAA,CAAeG,kDAEnBH,CAAe,EAAAI,MAAA,SAAAC,MAAA,UAAAA,OAAA,CAAA,IAAvBC,CAAAA,eACT,GAAIJ,CAAAA,CAAeK,IAAID,CAAO,CAAA;AAC9B,GAAIP,CAAeS,CAAAA,WAAAA,CAAYC,SAASH,CAAO,CAAA;AAE/C,GAAIA,CAAaI,CAAAA,YAAAA;AAEjB,GAAMC,CAAAA,CAAAA,CAAW,GAAIC,CAAAA,QACrBD,CAAAA,CAAAA,CAAAA,CAAAA,CAASE,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AAA,QAApCD,CAAAA,CAAoCC,CAAAA,CAAAA,CAAAA,KAAAA,iBAAAA,CAC/CA,CAAAA,iBAAAA,CAAAA,EAAMC,cACND,UAAAA,iBAAAA,WADAA,iBAAAA,CAAAA,IAAAA,CAAAA,CACAA,CAAAA,CAAAA,CAAAA,CAAME,iBAAiB,EAGZV,EAAAA,CAAAA,CAAa,QAAbA,CAAAA,CAAAA,CAAcnJ,CAAuBD,CAAAA,CAAAA,CAAAA,CAChDsH,SAASC,gBAAiB,CAAA,aAAA,CAAgBhG,SAAAA,GACxC,GAAQwI,CAAAA,CAAUxI,CAAAA,CAAAA,CAAES,OAAd+H,KAAAA,CACN9J,CAAgBA,CAAAA,CAAAA,CAAc0G,OAAOpG,SAAAA,CAAQA,QAAAA,CAAAA,CAAAA,GAASwJ,KACtD/J,CAAeC,CAAAA,aAAAA,CAAgBA,EAC/BD,CAAeW,CAAAA,YAAAA,CAAe,GAC9BX,CAAeiD,CAAAA,aAAAA,CAAAA,CAAe,GAC9B,EAGS+G,CAAAA,OAAAA,KAAAA,CAAAA,CAAkBhK,QAAlBgK,CAAAA,CAAAA,CAAkBhK,IACC,UAA3BA,GAAAA,CAAAA,CAAeiK,SAA0BjK,CAAeW,CAAAA,YAAAA,CAAaP,OAAS,EAG5C,EAAA,YAAA,GAA3BJ,EAAeiK,OAA4BjK,EAAAA,CAAAA,CAAeW,aAAaP,MAAS,CAAA,EAAA,IAFxFJ,EAAekK,iBAAoB,CAAA,CAAA,CAAA,CACnClK,EAAeiD,aAIhB,CAAA,CAAA,CAAA,EAAA"}
@@ -1 +1 @@
1
- import{F as e,a as s,b as t,c as o,E as n}from"../types/file-upload.enums.esm.js";const r=(r,a)=>{a.setIsDisabled((()=>r.state===e.DISABLED)),a.onStateChange((e=>{r.state=e})),a.onFileDrop((a=>{if(r.state===e.DISABLED)return;r.errorMessage="";const i=function(e){const s={B:1,KB:1024,MB:1048576,GB:1024**3},t=parseFloat(e),o=e.replace(/[0-9.\s]/g,"").toUpperCase(),n=s[o]||1;return t*n}(r.size),l=r.uploadedFiles;if(!r.allowMultiple&&l.length+a.length>1)return r.errorMessage=s.MULTIPLE_NOT_ALLOWED,void r.requestUpdate();let u=!1,c=!1;const d=[],p=[];for(const e of a)e.size>i?(u=!0,p.push(e)):r.allowDuplicates||!l.some((s=>s.name===e.name&&s.size===e.size&&s.type===e.type))?p.includes(e)||d.push(e):(c=!0,p.push(e));if(u){r.errorMessage=s.SIZE_LIMIT_EXCEEDED;const e=p.filter((e=>e.size>i));r.dispatchEvent(new CustomEvent(t.NILE_ERROR,{detail:{files:e,type:o.SIZE_LIMIT_EXCEEDED,errorType:n.VALIDATION,message:s.SIZE_LIMIT_EXCEEDED},bubbles:!0,composed:!0})),r.dispatchEvent(new CustomEvent(t.NILE_SIZE_EXCEED_FILES,{detail:{files:p}})),r.requestUpdate()}c&&0===d.length&&(r.errorMessage=s.DUPLICATES_NOT_ALLOWED,r.requestUpdate());let m=[];for(const e of d)r.allowedTypes.includes(e.type)?m.push(e):r.errorMessage=s.INVALID_FORMAT;r.uploadedFiles=[...l,...m],r.requestUpdate()})),a.setErrorMessage((e=>{r.errorMessage=e}))},a=e=>{document.addEventListener("dragover",e.preventDragOver,{passive:!1}),document.addEventListener("drop",e.preventDrop,{passive:!1})},i=(s,t,o)=>{s.addEventListener("mouseenter",(t=>{return o=s.setState,void(s.state===e.DEFAULT&&o(e.HOVER));var o})),s.addEventListener("mouseleave",(t=>{return o=s.setState,void(s.state===e.HOVER&&o(e.DEFAULT));var o})),s.addEventListener("dragenter",(e=>t.dragEnter(e))),s.addEventListener("dragleave",(e=>t.dragLeave(e))),s.addEventListener("dragover",(e=>t.dragOver(e))),s.addEventListener("drop",(e=>t.drop(e)));const n=s.browseFiles.bind(s);new ResizeObserver((e=>{for(const t of e)t.contentRect.width<400?s.horizontalDiv.addEventListener("click",n):s.horizontalDiv.removeEventListener("click",n)})).observe(s.horizontalDiv),u(s,o),d(s.uploadedFiles,s)};function l(e){const{uploadedFiles:r,fileUploadUrl:a,uploadRequests:i}=e;if(a&&r?.length)for(const l of r){if(i.has(l))continue;if(e.doNotUpload.includes(l))continue;if(l.errorMessage)continue;const r=new FormData;r.append("file",l);const u=new XMLHttpRequest;i.set(l,u),e.emit(t.NILE_UPLOADING),u.upload.onprogress=s=>{const o=Math.floor(s.loaded/s.total*100);e.dispatchEvent(new CustomEvent(t.NILE_UPLOAD_PROGRESS,{detail:{file:l,progress:o},bubbles:!0,composed:!0}))},u.onload=()=>{u.status>=200&&u.status<300?e.dispatchEvent(new CustomEvent(t.NILE_UPLOAD_SUCCESS,{detail:{file:l,response:u.response},bubbles:!0,composed:!0})):(e.errorMessage=s.SERVER_SIDE_ERROR,e.dispatchEvent(new CustomEvent(t.SERVER_SIDE_ERROR,{detail:{file:l,status:u.status,response:u.response}})),e.dispatchEvent(new CustomEvent(t.NILE_ERROR,{detail:{type:o.SERVER_SIDE_ERROR,file:l,status:u?.status||0,response:u?.response,message:s.SERVER_SIDE_ERROR,errorType:n.SERVER},bubbles:!0,composed:!0})),e.requestUpdate())},u.onerror=()=>{i.delete(l),e.doNotUpload.push(l),e.errorMessage=s.NETWORK_ERROR,e.dispatchEvent(new CustomEvent(t.NILE_ERROR,{detail:{type:o.NETWORK_ERROR,file:l,status:u.status,response:u.response,errorType:n.NETWORK,message:s.NETWORK_ERROR},bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent(t.NILE_NETWORK_ERROR,{detail:{file:l,status:u.status,response:u.response},bubbles:!0,composed:!0}))},u.open("POST",a),u.send(r)}}const u=(e,r)=>{document.addEventListener(t.NILE_CANCEL_UPLOAD,(a=>{const i=a.detail.file,l=r.get(i);l&&l.abort(),r.delete(i),e.uploadedFiles=e.uploadedFiles.filter((e=>e!==i)),e.dispatchEvent(new CustomEvent(t.NILE_ERROR,{detail:{type:o.UPLOAD_CANCELLED,file:i,message:s.UPLOAD_CANCELLED,errorType:n.UPLOAD_CANCELLED},bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent(t.NILE_UPLOAD_CANCELLED,{detail:{file:i}}))}))};const c=e=>{e.preventDefault?.(),e.stopPropagation()},d=(e,s)=>{document.addEventListener("nile-remove",(t=>{const{value:o}=t.detail;e=e.filter((e=>e!==o)),s.uploadedFiles=e,s.errorMessage="",s.requestUpdate()}))},p=e=>{("vertical"===e.variant&&e.errorMessage.length>34||"horizontal"===e.variant&&e.errorMessage.length>96)&&(e.isStringTruncated=!0,e.requestUpdate())};export{i as a,a as b,c as p,r as s,p as t,l as u};
1
+ import{F as e,a as s,b as t,c as o,E as n}from"../types/file-upload.enums.esm.js";const r=(r,a)=>{a.setIsDisabled((()=>r.state===e.DISABLED)),a.onStateChange((e=>{r.state=e})),a.onFileDrop((a=>{if(r.state===e.DISABLED)return;r.errorMessage="";const i=function(e){const s={B:1,KB:1024,MB:1048576,GB:1024**3},t=parseFloat(e),o=e.replace(/[0-9.\s]/g,"").toUpperCase(),n=s[o]||1;return t*n}(r.size),l=r.uploadedFiles;if(!r.allowMultiple&&l.length+a.length>1)return r.errorMessage=s.MULTIPLE_NOT_ALLOWED,void r.requestUpdate();let u=!1,c=!1;const d=[],p=[];for(const e of a)e.size>i?(u=!0,p.push(e)):r.allowDuplicates||!l.some((s=>s.name===e.name&&s.size===e.size&&s.type===e.type))?p.includes(e)||d.push(e):(c=!0,p.push(e));if(u){r.errorMessage=s.SIZE_LIMIT_EXCEEDED;const e=p.filter((e=>e.size>i));r.dispatchEvent(new CustomEvent(t.NILE_ERROR,{detail:{files:e,type:o.SIZE_LIMIT_EXCEEDED,errorType:n.VALIDATION,message:s.SIZE_LIMIT_EXCEEDED},bubbles:!0,composed:!0})),r.dispatchEvent(new CustomEvent(t.NILE_SIZE_EXCEED_FILES,{detail:{files:p}})),r.requestUpdate()}c&&0===d.length&&(r.errorMessage=s.DUPLICATES_NOT_ALLOWED,r.requestUpdate());let m=[];if(r.allowedTypes.length>0)for(const e of d)r.allowedTypes.includes(e.type)?m.push(e):r.errorMessage=s.INVALID_FORMAT;0===m.length&&(m=d),r.uploadedFiles=[...l,...m],r.requestUpdate()})),a.setErrorMessage((e=>{r.errorMessage=e}))},a=e=>{document.addEventListener("dragover",e.preventDragOver,{passive:!1}),document.addEventListener("drop",e.preventDrop,{passive:!1})},i=(s,t,o)=>{s.addEventListener("mouseenter",(t=>{return o=s.setState,void(s.state===e.DEFAULT&&o(e.HOVER));var o})),s.addEventListener("mouseleave",(t=>{return o=s.setState,void(s.state===e.HOVER&&o(e.DEFAULT));var o})),s.addEventListener("dragenter",(e=>t.dragEnter(e))),s.addEventListener("dragleave",(e=>t.dragLeave(e))),s.addEventListener("dragover",(e=>t.dragOver(e))),s.addEventListener("drop",(e=>t.drop(e)));const n=s.browseFiles.bind(s);new ResizeObserver((e=>{for(const t of e)t.contentRect.width<400?s.horizontalDiv.addEventListener("click",n):s.horizontalDiv.removeEventListener("click",n)})).observe(s.horizontalDiv),u(s,o),d(s.uploadedFiles,s)};function l(e){const{uploadedFiles:r,fileUploadUrl:a,uploadRequests:i}=e;if(a&&r?.length)for(const l of r){if(i.has(l))continue;if(e.doNotUpload.includes(l))continue;if(l.errorMessage)continue;const r=new FormData;r.append("file",l);const u=new XMLHttpRequest;i.set(l,u),e.emit(t.NILE_UPLOADING),u.upload.onprogress=s=>{const o=Math.floor(s.loaded/s.total*100);e.dispatchEvent(new CustomEvent(t.NILE_UPLOAD_PROGRESS,{detail:{file:l,progress:o},bubbles:!0,composed:!0}))},u.onload=()=>{u.status>=200&&u.status<300?e.dispatchEvent(new CustomEvent(t.NILE_UPLOAD_SUCCESS,{detail:{file:l,response:u.response},bubbles:!0,composed:!0})):(e.errorMessage=s.SERVER_SIDE_ERROR,e.dispatchEvent(new CustomEvent(t.SERVER_SIDE_ERROR,{detail:{file:l,status:u.status,response:u.response}})),e.dispatchEvent(new CustomEvent(t.NILE_ERROR,{detail:{type:o.SERVER_SIDE_ERROR,file:l,status:u?.status||0,response:u?.response,message:s.SERVER_SIDE_ERROR,errorType:n.SERVER},bubbles:!0,composed:!0})),e.requestUpdate())},u.onerror=()=>{i.delete(l),e.doNotUpload.push(l),e.errorMessage=s.NETWORK_ERROR,e.dispatchEvent(new CustomEvent(t.NILE_ERROR,{detail:{type:o.NETWORK_ERROR,file:l,status:u.status,response:u.response,errorType:n.NETWORK,message:s.NETWORK_ERROR},bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent(t.NILE_NETWORK_ERROR,{detail:{file:l,status:u.status,response:u.response},bubbles:!0,composed:!0}))},u.open("POST",a),u.send(r)}}const u=(e,r)=>{document.addEventListener(t.NILE_CANCEL_UPLOAD,(a=>{const i=a.detail.file,l=r.get(i);l&&l.abort(),r.delete(i),e.uploadedFiles=e.uploadedFiles.filter((e=>e!==i)),e.dispatchEvent(new CustomEvent(t.NILE_ERROR,{detail:{type:o.UPLOAD_CANCELLED,file:i,message:s.UPLOAD_CANCELLED,errorType:n.UPLOAD_CANCELLED},bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent(t.NILE_UPLOAD_CANCELLED,{detail:{file:i}}))}))};const c=e=>{e.preventDefault?.(),e.stopPropagation()},d=(e,s)=>{document.addEventListener("nile-remove",(t=>{const{value:o}=t.detail;e=e.filter((e=>e!==o)),s.uploadedFiles=e,s.errorMessage="",s.requestUpdate()}))},p=e=>{("vertical"===e.variant&&e.errorMessage.length>34||"horizontal"===e.variant&&e.errorMessage.length>96)&&(e.isStringTruncated=!0,e.requestUpdate())};export{i as a,a as b,c as p,r as s,p as t,l as u};
@@ -1,2 +1,2 @@
1
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","../internal/nile-element.cjs.js","./nile-filter-chip.css.cjs.js"],function(_export,_context){"use strict";var e,t,s,i,l,a,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11,_n,o;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){e=_tslib.__decorate;},function(_lit){t=_lit.html;},function(_litDecoratorsJs){s=_litDecoratorsJs.property;i=_litDecoratorsJs.customElement;},function(_internalNileElementCjsJs){l=_internalNileElementCjsJs.N;},function(_nileFilterChipCssCjsJs){a=_nileFilterChipCssCjsJs.s;}],execute:function execute(){_export("N",o=_n=/*#__PURE__*/function(_l){function n(){var _this;_classCallCheck(this,n);_this=_callSuper(this,n,arguments),_this.label="",_this.value="",_this.viewMoreCount=0,_this.editable=!1,_this.closable=!1,_this.icon="",_this.removeIcon="",_this.active=!1;return _this;}_inherits(n,_l);return _createClass(n,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(n,"connectedCallback",this,3)([]),this.registerChip();}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(n,"disconnectedCallback",this,3)([]),this.unregisterChip();}},{key:"registerChip",value:function registerChip(){_n.activeChips.push(this);}},{key:"unregisterChip",value:function unregisterChip(){var _this2=this;_n.activeChips=_n.activeChips.filter(function(e){return e!==_this2;});}},{key:"handleClose",value:function handleClose(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("nile-close",{detail:{value:this.value,viewMoreCount:this.viewMoreCount}})),this.remove();}},{key:"handleClick",value:function handleClick(){this.dispatchEvent(new CustomEvent("nile-click",{detail:{value:this.value,viewMoreCount:this.viewMoreCount}}));}},{key:"getLabelSlot",value:function getLabelSlot(){return t(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <span class=\"label-wrapper\">\n <slot name=\"label\">\n <span class=\"label\" part=\"label\">",":</span>\n </slot>\n </span>\n\n "])),this.label);}},{key:"getValueSlot",value:function getValueSlot(){return t(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <span class=\"value-wrapper\">\n <slot name=\"value\">\n <span class=\"value\" part=\"value\">","</span>\n </slot>\n </span>\n\n "])),this.value);}},{key:"getviewMoreCountSlot",value:function getviewMoreCountSlot(){return t(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <slot name=\"suffix\">\n ","\n </slot>\n "])),this.viewMoreCount?t(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <span class=\"badge-wrapper\">\n <nile-badge class=\"badge\" part=\"badge\" variant=\"primary\" pilltype=\"pill-color\" exportparts=\"content, base\">\n +","\n </nile-badge>\n </span>\n\n "])),this.viewMoreCount):t(_templateObject5||(_templateObject5=_taggedTemplateLiteral([""]))));}},{key:"getCloseIconSlot",value:function getCloseIconSlot(){return t(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n ","\n "])),this.closable?t(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <span class=\"close-icon\" @click=\"","\">\n <nile-icon name=\"","\" size=\"12\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\"></nile-icon>\n </span>\n "])),this.handleClose,this.removeIcon||"var(--nile-icon-close, var(--ng-icon-x-close))"):t(_templateObject8||(_templateObject8=_taggedTemplateLiteral([""]))));}},{key:"render",value:function render(){return t(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["\n <div class=\"chip\" @click=\"","\">\n <slot name=\"icon\">\n ","\n </slot>\n ","\n <slot name=\"content\"></slot>\n ","\n ","\n ","\n </div>\n "])),this.handleClick,this.icon?t(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["<span class=\"icon\">","</span>"])),this.icon):t(_templateObject11||(_templateObject11=_taggedTemplateLiteral([""]))),this.getLabelSlot(),this.getValueSlot(),this.getviewMoreCountSlot(),this.getCloseIconSlot());}}],[{key:"styles",get:function get(){return[a];}}]);}(l));o.activeChips=[],e([s({type:String})],o.prototype,"label",void 0),e([s({type:String})],o.prototype,"value",void 0),e([s({type:Number})],o.prototype,"viewMoreCount",void 0),e([s({type:Boolean})],o.prototype,"editable",void 0),e([s({type:Boolean})],o.prototype,"closable",void 0),e([s({type:String})],o.prototype,"icon",void 0),e([s({type:String})],o.prototype,"removeIcon",void 0),e([s({type:Boolean,reflect:!0})],o.prototype,"active",void 0),_export("N",o=_n=e([i("nile-filter-chip")],o));}};});
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","../internal/nile-element.cjs.js","./nile-filter-chip.css.cjs.js"],function(_export,_context){"use strict";var e,t,s,i,l,a,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11,_o,n;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){e=_tslib.__decorate;},function(_lit){t=_lit.html;},function(_litDecoratorsJs){s=_litDecoratorsJs.property;i=_litDecoratorsJs.customElement;},function(_internalNileElementCjsJs){l=_internalNileElementCjsJs.N;},function(_nileFilterChipCssCjsJs){a=_nileFilterChipCssCjsJs.s;}],execute:function execute(){_export("N",n=_o=/*#__PURE__*/function(_l){function o(){var _this;_classCallCheck(this,o);_this=_callSuper(this,o,arguments),_this.label="",_this.value="",_this.viewMoreCount=0,_this.editable=!1,_this.closable=!1,_this.icon="",_this.removeIcon="",_this.active=!1,_this.disabled=!1;return _this;}_inherits(o,_l);return _createClass(o,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(o,"connectedCallback",this,3)([]),this.registerChip();}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(o,"disconnectedCallback",this,3)([]),this.unregisterChip();}},{key:"registerChip",value:function registerChip(){_o.activeChips.push(this);}},{key:"unregisterChip",value:function unregisterChip(){var _this2=this;_o.activeChips=_o.activeChips.filter(function(e){return e!==_this2;});}},{key:"handleClose",value:function handleClose(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("nile-close",{detail:{value:this.value,viewMoreCount:this.viewMoreCount}})),this.remove();}},{key:"handleClick",value:function handleClick(){this.disabled||this.dispatchEvent(new CustomEvent("nile-click",{detail:{value:this.value,viewMoreCount:this.viewMoreCount}}));}},{key:"getLabelSlot",value:function getLabelSlot(){return t(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <span class=\"label-wrapper\">\n <slot name=\"label\">\n <span class=\"label\" part=\"label\">",":</span>\n </slot>\n </span>\n\n "])),this.label);}},{key:"getValueSlot",value:function getValueSlot(){return t(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <span class=\"value-wrapper\">\n <slot name=\"value\">\n <span class=\"value\" part=\"value\">","</span>\n </slot>\n </span>\n\n "])),this.value);}},{key:"getviewMoreCountSlot",value:function getviewMoreCountSlot(){return t(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <slot name=\"suffix\">\n ","\n </slot>\n "])),this.viewMoreCount?t(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <span class=\"badge-wrapper\">\n <nile-badge class=\"badge\" part=\"badge\" variant=\"primary\" pilltype=\"pill-color\" exportparts=\"content, base\">\n +","\n </nile-badge>\n </span>\n\n "])),this.viewMoreCount):t(_templateObject5||(_templateObject5=_taggedTemplateLiteral([""]))));}},{key:"getCloseIconSlot",value:function getCloseIconSlot(){return t(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n ","\n "])),this.closable?t(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <span class=\"close-icon\" @click=\"","\">\n <nile-icon name=\"","\" size=\"12\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\"></nile-icon>\n </span>\n "])),this.handleClose,this.removeIcon||"var(--nile-icon-close, var(--ng-icon-x-close))"):t(_templateObject8||(_templateObject8=_taggedTemplateLiteral([""]))));}},{key:"render",value:function render(){return t(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["\n <div class=\"chip\" @click=\"","\">\n <slot name=\"icon\">\n ","\n </slot>\n ","\n <slot name=\"content\"></slot>\n ","\n ","\n ","\n </div>\n "])),this.handleClick,this.icon?t(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["<span class=\"icon\">","</span>"])),this.icon):t(_templateObject11||(_templateObject11=_taggedTemplateLiteral([""]))),this.getLabelSlot(),this.getValueSlot(),this.getviewMoreCountSlot(),this.getCloseIconSlot());}}],[{key:"styles",get:function get(){return[a];}}]);}(l));n.activeChips=[],e([s({type:String})],n.prototype,"label",void 0),e([s({type:String})],n.prototype,"value",void 0),e([s({type:Number})],n.prototype,"viewMoreCount",void 0),e([s({type:Boolean})],n.prototype,"editable",void 0),e([s({type:Boolean})],n.prototype,"closable",void 0),e([s({type:String})],n.prototype,"icon",void 0),e([s({type:String})],n.prototype,"removeIcon",void 0),e([s({type:Boolean,reflect:!0})],n.prototype,"active",void 0),e([s({type:Boolean,reflect:!0})],n.prototype,"disabled",void 0),_export("N",n=_o=e([i("nile-filter-chip")],n));}};});
2
2
  //# sourceMappingURL=nile-filter-chip.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-filter-chip.cjs.js","sources":["../../../src/nile-filter-chip/nile-filter-chip.ts"],"sourcesContent":["import { LitElement, html, css, CSSResultArray, TemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport NileElement from '../internal/nile-element';\nimport { styles } from './nile-filter-chip.css';\n\n/**\n * Nile filter-chip component.\n *\n * @tag nile-filter-chip\n */\n@customElement('nile-filter-chip')\nexport class NileFilterChip extends NileElement {\n @property({ type: String }) label = '';\n @property({ type: String }) value = '';\n @property({ type: Number }) viewMoreCount: number = 0;\n @property({ type: Boolean }) editable = false;\n @property({ type: Boolean }) closable = false;\n @property({ type: String }) icon = '';\n @property({ type: String }) removeIcon = '';\n @property({ type: Boolean, reflect: true }) active = false;\n\n\n private static activeChips: NileFilterChip[] = [];\n\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.registerChip();\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.unregisterChip();\n }\n\n private registerChip() {\n NileFilterChip.activeChips.push(this);\n }\n\n private unregisterChip() {\n NileFilterChip.activeChips = NileFilterChip.activeChips.filter(\n (chip) => chip !== this\n );\n }\n\n private handleClose(event: Event) {\n event.stopPropagation();\n this.dispatchEvent(\n new CustomEvent('nile-close', { detail: { value: this.value, viewMoreCount: this.viewMoreCount } })\n );\n this.remove();\n }\n\n private handleClick() {\n this.dispatchEvent(\n new CustomEvent('nile-click', { detail: { value: this.value, viewMoreCount: this.viewMoreCount } })\n );\n }\n\n private getLabelSlot(): TemplateResult {\n return html`\n <span class=\"label-wrapper\">\n <slot name=\"label\">\n <span class=\"label\" part=\"label\">${this.label}:</span>\n </slot>\n </span>\n\n `;\n }\n\n private getValueSlot(): TemplateResult {\n return html`\n <span class=\"value-wrapper\">\n <slot name=\"value\">\n <span class=\"value\" part=\"value\">${this.value}</span>\n </slot>\n </span>\n\n `;\n }\n\n private getviewMoreCountSlot(): TemplateResult {\n return html`\n <slot name=\"suffix\">\n ${this.viewMoreCount\n ? html`\n <span class=\"badge-wrapper\">\n <nile-badge class=\"badge\" part=\"badge\" variant=\"primary\" pilltype=\"pill-color\" exportparts=\"content, base\">\n +${this.viewMoreCount}\n </nile-badge>\n </span>\n\n `\n : html``}\n </slot>\n `;\n }\n\n private getCloseIconSlot(): TemplateResult {\n return html`\n ${this.closable\n ? html`\n <span class=\"close-icon\" @click=\"${this.handleClose}\">\n <nile-icon name=\"${this.removeIcon || 'var(--nile-icon-close, var(--ng-icon-x-close))'}\" size=\"12\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\"></nile-icon>\n </span>\n `\n : html``}\n `;\n }\n\n public render(): TemplateResult {\n return html`\n <div class=\"chip\" @click=\"${this.handleClick}\">\n <slot name=\"icon\">\n ${this.icon ? html`<span class=\"icon\">${this.icon}</span>` : html``}\n </slot>\n ${this.getLabelSlot()}\n <slot name=\"content\"></slot>\n ${this.getValueSlot()}\n ${this.getviewMoreCountSlot()}\n ${this.getCloseIconSlot()}\n </div>\n `;\n }\n}\n\nexport default NileFilterChip;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-filter-chip': NileFilterChip;\n }\n}\n"],"names":["NileFilterChip","NileFilterChip_1","_l","n","this","label","value","viewMoreCount","editable","closable","icon","removeIcon","active","_this","_inherits","_createClass","key","connectedCallback","super","registerChip","disconnectedCallback","unregisterChip","activeChips","push","filter","chip","handleClose","event","stopPropagation","dispatchEvent","CustomEvent","detail","remove","handleClick","getLabelSlot","html","_templateObject","_taggedTemplateLiteral","getValueSlot","_templateObject2","getviewMoreCountSlot","_templateObject3","_templateObject4","_templateObject5","getCloseIconSlot","_templateObject6","_templateObject7","_templateObject8","render","_templateObject9","_templateObject10","_templateObject11","get","styles","NileElement","__decorate","property","type","String","prototype","Number","Boolean","reflect","customElement"],"mappings":"o0HAWaA,CAAAA,CAAcC,EAApB,uBAAAC,EAAA,EAAA,SAAAC,EAAA,qEACuBC,EAAAA,KAAAA,CAAKC,KAAG,CAAA,EAAA,CACRD,KAAAA,CAAKE,KAAAA,CAAG,EACRF,CAAAA,KAAAA,CAAaG,aAAW,CAAA,CAAA,CACvBH,KAAAA,CAAQI,QAAAA,CAAAA,CAAG,CACXJ,CAAAA,KAAAA,CAAQK,QAAG,CAAA,CAAA,CAAA,CACZL,KAAAA,CAAIM,IAAAA,CAAG,EACPN,CAAAA,KAAAA,CAAUO,UAAG,CAAA,EAAA,CACGP,KAAAA,CAAMQ,MAAAA,CAAAA,CAAG,CA4GtD,QAAAC,KAAA,EAvGQC,SAAA,CAAAX,CAAA,CAAAD,EAAA,SAAAa,YAAA,CAAAZ,CAAA,GAAAa,GAAA,qBAAAV,KAAA,CAIP,SAAAW,iBAAAA,CAAAA,CAAAA,CACEC,aAAAA,CAAAA,CAAAA,iCACAd,IAAKe,CAAAA,YAAAA,CAAAA,CACN,EAED,GAAAH,GAAA,wBAAAV,KAAA,UAAAc,oBAAAA,CAAAA,EACEF,aAAAA,CAAAA,CAAAA,oCACAd,IAAKiB,CAAAA,cAAAA,CAAAA,CACN,EAEO,GAAAL,GAAA,gBAAAV,KAAA,UAAAa,YAAAA,CAAAA,CACNlB,CAAAA,EAAAA,CAAeqB,WAAYC,CAAAA,IAAAA,CAAKnB,IACjC,CAAA,EAEO,GAAAY,GAAA,kBAAAV,KAAA,UAAAe,cAAAA,CAAAA,CAAAA,KAAAA,MAAAA,MACNpB,EAAeqB,CAAAA,WAAAA,CAAcrB,EAAeqB,CAAAA,WAAAA,CAAYE,MACrDC,CAAAA,SAAAA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AA,CAAAA,CAAAA,CAAAA,CAAqB1D,EAAA2D,SAAA,CAAA,OAAA,CAAA,IAAA,IACXJ,CAAA,CAAA,CAA3BC,EAAS,CAAEC,IAAAA,CAAMC,UAAqB1D,CAAA2D,CAAAA,SAAAA,CAAA,YAAA,EACXJ,CAAAA,CAAAA,CAAAA,CAAA,CAA3BC,CAAS,CAAA,CAAEC,KAAMG,MAAoC5D,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA2D,UAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CACzBJ,EAAA,CAA5BC,CAAAA,CAAS,CAAEC,IAAMI,CAAAA,OAAAA,CAAAA,CAAAA,CAAAA,CAA4B7D,EAAA2D,SAAA,CAAA,UAAA,CAAA,IAAA,IACjBJ,CAAA,CAAA,CAA5BC,EAAS,CAAEC,IAAAA,CAAMI,WAA4B7D,CAAA2D,CAAAA,SAAAA,CAAA,eAAA,EAClBJ,CAAAA,CAAAA,CAAAA,CAAA,CAA3BC,CAAS,CAAA,CAAEC,KAAMC,MAAoB1D,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA2D,UAAA,MAAA,CAAA,IAAA,EAAA,CAAA,CACVJ,EAAA,CAA3BC,CAAAA,CAAS,CAAEC,IAAMC,CAAAA,MAAAA,CAAAA,CAAAA,CAAAA,CAA0B1D,EAAA2D,SAAA,CAAA,YAAA,CAAA,IAAA,IACAJ,CAAA,CAAA,CAA3CC,EAAS,CAAEC,IAAAA,CAAMI,QAASC,OAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuB9D,EAAA2D,SAAA,CAAA,QAAA,CAAA,IAAA,gBARhD3D,CAAcC,CAAAA,EAAAA,CAAAsD,EAAA,CAD1BQ,CAAAA,CAAc,qBACF/D"}
1
+ {"version":3,"file":"nile-filter-chip.cjs.js","sources":["../../../src/nile-filter-chip/nile-filter-chip.ts"],"sourcesContent":["import { LitElement, html, css, CSSResultArray, TemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport NileElement from '../internal/nile-element';\nimport { styles } from './nile-filter-chip.css';\n\n/**\n * Nile filter-chip component.\n *\n * @tag nile-filter-chip\n */\n@customElement('nile-filter-chip')\nexport class NileFilterChip extends NileElement {\n @property({ type: String }) label = '';\n @property({ type: String }) value = '';\n @property({ type: Number }) viewMoreCount: number = 0;\n @property({ type: Boolean }) editable = false;\n @property({ type: Boolean }) closable = false;\n @property({ type: String }) icon = '';\n @property({ type: String }) removeIcon = '';\n @property({ type: Boolean, reflect: true }) active = false;\n @property({type:Boolean, reflect:true}) disabled = false;\n\n\n private static activeChips: NileFilterChip[] = [];\n\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.registerChip();\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.unregisterChip();\n }\n\n private registerChip() {\n NileFilterChip.activeChips.push(this);\n }\n\n private unregisterChip() {\n NileFilterChip.activeChips = NileFilterChip.activeChips.filter(\n (chip) => chip !== this\n );\n }\n\n private handleClose(event: Event) {\n event.stopPropagation();\n this.dispatchEvent(\n new CustomEvent('nile-close', { detail: { value: this.value, viewMoreCount: this.viewMoreCount } })\n );\n this.remove();\n }\n\n private handleClick() {\n if (this.disabled) return;\n this.dispatchEvent(\n new CustomEvent('nile-click', { detail: { value: this.value, viewMoreCount: this.viewMoreCount } })\n );\n }\n\n private getLabelSlot(): TemplateResult {\n return html`\n <span class=\"label-wrapper\">\n <slot name=\"label\">\n <span class=\"label\" part=\"label\">${this.label}:</span>\n </slot>\n </span>\n\n `;\n }\n\n private getValueSlot(): TemplateResult {\n return html`\n <span class=\"value-wrapper\">\n <slot name=\"value\">\n <span class=\"value\" part=\"value\">${this.value}</span>\n </slot>\n </span>\n\n `;\n }\n\n private getviewMoreCountSlot(): TemplateResult {\n return html`\n <slot name=\"suffix\">\n ${this.viewMoreCount\n ? html`\n <span class=\"badge-wrapper\">\n <nile-badge class=\"badge\" part=\"badge\" variant=\"primary\" pilltype=\"pill-color\" exportparts=\"content, base\">\n +${this.viewMoreCount}\n </nile-badge>\n </span>\n\n `\n : html``}\n </slot>\n `;\n }\n\n private getCloseIconSlot(): TemplateResult {\n return html`\n ${this.closable\n ? html`\n <span class=\"close-icon\" @click=\"${this.handleClose}\">\n <nile-icon name=\"${this.removeIcon || 'var(--nile-icon-close, var(--ng-icon-x-close))'}\" size=\"12\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\"></nile-icon>\n </span>\n `\n : html``}\n `;\n }\n\n public render(): TemplateResult {\n return html`\n <div class=\"chip\" @click=\"${this.handleClick}\">\n <slot name=\"icon\">\n ${this.icon ? html`<span class=\"icon\">${this.icon}</span>` : html``}\n </slot>\n ${this.getLabelSlot()}\n <slot name=\"content\"></slot>\n ${this.getValueSlot()}\n ${this.getviewMoreCountSlot()}\n ${this.getCloseIconSlot()}\n </div>\n `;\n }\n}\n\nexport default NileFilterChip;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-filter-chip': NileFilterChip;\n }\n}\n"],"names":["NileFilterChip","NileFilterChip_1","_l","o","this","label","value","viewMoreCount","editable","closable","icon","removeIcon","active","disabled","_this","_inherits","_createClass","key","connectedCallback","super","registerChip","disconnectedCallback","unregisterChip","activeChips","push","filter","chip","handleClose","event","stopPropagation","dispatchEvent","CustomEvent","detail","remove","handleClick","getLabelSlot","html","_templateObject","_taggedTemplateLiteral","getValueSlot","_templateObject2","getviewMoreCountSlot","_templateObject3","_templateObject4","_templateObject5","getCloseIconSlot","_templateObject6","_templateObject7","_templateObject8","render","_templateObject9","_templateObject10","_templateObject11","get","styles","NileElement","__decorate","property","type","String","prototype","Number","Boolean","reflect","customElement"],"mappings":"o0HAWaA,CAAAA,CAAcC,EAApB,uBAAAC,EAAA,EAAA,SAAAC,EAAA,qEACuBC,EAAAA,KAAAA,CAAKC,KAAG,CAAA,EAAA,CACRD,KAAAA,CAAKE,KAAAA,CAAG,EACRF,CAAAA,KAAAA,CAAaG,cAAW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(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){r=_lit.css;}],execute:function execute(){_export("s",e=r(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n\n :host{\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n }\n\n .filter-chips {\n display: flex;\n align-items: center;\n }\n\n\n .chip {\n display: inline-flex;\n align-items: center;\n height: 30px;\n padding: 8px;\n border: 1px solid var(--nile-filter-chip-chip-border-color-stroke, var(--ng-colors-border-primary));\n border-radius: var(--nile-radius-sm, var(--ng-radius-md));\n font-size: 14px;\n background-color: var(--nile-filter-chip-background-default, var(--ng-colors-bg-primary));\n color: var(--nile-filter-chip-text-default, var(--ng-colors-text-secondary-700));\n transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;\n cursor: pointer;\n box-sizing: border-box;\n }\n\n .chip:hover {\n background-color: var(--nile-filter-chip-hover-background, var(--ng-colors-bg-primary-hover));\n }\n .chip:active {\n background-color: var(--nile-filter-chip-active-background, var(--ng-colors-bg-active));\n border-color: var(--nile-filter-chip-active-border-color-stroke);\n}\n:host([active]) .chip {\n background-color: var(--nile-filter-chip-active-background, var(--ng-colors-bg-active));\n border-color: var(--nile-filter-chip-active-border-color-stroke);\n}\n\n\n .icon {\n color: var(--nile-filter-chip-icon-color-default, var(--ng-colors-text-primary-900));\n display: flex;\n align-items: center;\n justify-content: center;\n vertical-align: middle;\n position: relative;\n top: 12px;\n }\n\n .label {\n font-weight: 500;\n color: var(--nile-filter-chip-label-color-default, var(--ng-colors-text-primary-900));\n }\n\n nile-badge::part(base) {\n width: auto;\n height: 14px;\n border-radius: 100px;\n padding: 6px;\n gap: 10px;\n font-size: 8px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n line-height: 1;\n }\n\n .chip-container {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n }\n\n .clear-all-container {\n margin-left: 18px;\n white-space: nowrap;\n cursor: pointer;\n }\n\n\n .value {\n color: var(--nile-filter-chip-values-color-default, var(--ng-colors-text-brand-secondary-700));\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 140px;\n vertical-align: bottom;\n}\n\n\n .close-icon {\n color: var(--nile-filter-chip-close-icon-color-default, var(--ng-componentcolors-utility-gray-400));\n cursor: pointer;\n display: flex;\n align-items: center;\n border-radius: 50%;\n transition: background-color 0.2s;\n }\n\n .close-icon:hover {\n background-color: var(--nile-filter-chip-close-icon-hover-background, var(--ng-colors-bg-primary-hover));\n color: var(--nile-filter-chip-close-icon-hover-color, var(--ng-componentcolors-utility-gray-500));\n }\n\n.label-wrapper {\n margin-right: 4px;\n}\n\n::slotted([slot=\"icon\"]) {\n margin-right: 6px;\n}\n\n.value-wrapper {\n margin-right: 4px; \n}\n\n.badge-wrapper {\n margin-right: 12px; \n}\n\n.badge{\n display: inline-flex;\n align-items: center;\n height: 20px; \n}\n\nnile-badge::part(content) {\n line-height: 20px;\n}\n\n"]))));}};});
1
+ System.register(["lit"],function(_export,_context){"use strict";var r,_templateObject,o;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){r=_lit.css;}],execute:function execute(){_export("s",o=r(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n\n :host{\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n }\n\n .filter-chips {\n display: flex;\n align-items: center;\n }\n\n\n .chip {\n display: inline-flex;\n align-items: center;\n height: 30px;\n padding: 8px;\n border: 1px solid var(--nile-filter-chip-chip-border-color-stroke, var(--ng-colors-border-primary));\n border-radius: var(--nile-radius-sm, var(--ng-radius-md));\n font-size: 14px;\n background-color: var(--nile-filter-chip-background-default, var(--ng-colors-bg-primary));\n color: var(--nile-filter-chip-text-default, var(--ng-colors-text-secondary-700));\n transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;\n cursor: pointer;\n box-sizing: border-box;\n }\n\n .chip:hover {\n background-color: var(--nile-filter-chip-hover-background, var(--ng-colors-bg-primary-hover));\n }\n .chip:active {\n background-color: var(--nile-filter-chip-active-background, var(--ng-colors-bg-active));\n border-color: var(--nile-filter-chip-active-border-color-stroke);\n}\n:host([active]) .chip {\n background-color: var(--nile-filter-chip-active-background, var(--ng-colors-bg-active));\n border-color: var(--nile-filter-chip-active-border-color-stroke);\n}\n\n\n .icon {\n color: var(--nile-filter-chip-icon-color-default, var(--ng-colors-text-primary-900));\n display: flex;\n align-items: center;\n justify-content: center;\n vertical-align: middle;\n position: relative;\n top: 12px;\n }\n\n .label {\n font-weight: 500;\n color: var(--nile-filter-chip-label-color-default, var(--ng-colors-text-primary-900));\n }\n\n nile-badge::part(base) {\n width: auto;\n height: 14px;\n border-radius: 100px;\n padding: 6px;\n gap: 10px;\n font-size: 8px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n line-height: 1;\n }\n\n .chip-container {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n }\n\n .clear-all-container {\n margin-left: 18px;\n white-space: nowrap;\n cursor: pointer;\n }\n\n\n .value {\n color: var(--nile-filter-chip-values-color-default, var(--ng-colors-text-brand-secondary-700));\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 140px;\n vertical-align: bottom;\n}\n\n\n .close-icon {\n color: var(--nile-filter-chip-close-icon-color-default, var(--ng-componentcolors-utility-gray-400));\n cursor: pointer;\n display: flex;\n align-items: center;\n border-radius: 50%;\n transition: background-color 0.2s;\n }\n\n .close-icon:hover {\n background-color: var(--nile-filter-chip-close-icon-hover-background, var(--ng-colors-bg-primary-hover));\n color: var(--nile-filter-chip-close-icon-hover-color, var(--ng-componentcolors-utility-gray-500));\n }\n\n.label-wrapper {\n margin-right: 4px;\n}\n\n::slotted([slot=\"icon\"]) {\n margin-right: 6px;\n}\n\n.value-wrapper {\n margin-right: 4px; \n}\n\n.badge-wrapper {\n margin-right: 12px; \n}\n\n.badge{\n display: inline-flex;\n align-items: center;\n height: 20px; \n}\n\nnile-badge::part(content) {\n line-height: 20px;\n}\n\n:host([disabled]) .chip {\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-disabled-subtle));\n border-color: var(--nile-colors-neutral-400, var(--ng-colors-border-disabled));\n color: var(--nile-colors-neutral-500, var(--ng-colors-text-secondary-700));\n cursor: not-allowed;\n opacity: var(--nile-opacity-100, var(--ng-opacity-50));\n}\n\n:host([disabled]) .label {\n color: var(--nile-colors-neutral-500, var(--ng-colors-text-secondary-700));\n font-family:colfax-regular;\n}\n\n:host([disabled]) .value {\n color: var(--nile-colors-primary-500, var(--ng-colors-text-brand-secondary-700));\n}\n\n:host([disabled]) nile-badge::part(base) {\n background-color: var(--nile-colors-primary-500,var(--ng-colors-text-brand-secondary-700));\n color: var(--nile-colors-white-base, var(--ng-colors-text-white));\n}\n\n"]))));}};});
2
2
  //# sourceMappingURL=nile-filter-chip.css.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-filter-chip.css.cjs.js","sources":["../../../src/nile-filter-chip/nile-filter-chip.css.ts"],"sourcesContent":["/**\n* Copyright Aquera Inc 2023\n*\n* This source code is licensed under the BSD-3-Clause license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nimport {css} from 'lit';\n\n/**\n * FilterChip CSS\n */\n\nexport const styles = css`\n\n :host{\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n }\n\n .filter-chips {\n display: flex;\n align-items: center;\n }\n\n\n .chip {\n display: inline-flex;\n align-items: center;\n height: 30px;\n padding: 8px;\n border: 1px solid var(--nile-filter-chip-chip-border-color-stroke, var(--ng-colors-border-primary));\n border-radius: var(--nile-radius-sm, var(--ng-radius-md));\n font-size: 14px;\n background-color: var(--nile-filter-chip-background-default, var(--ng-colors-bg-primary));\n color: var(--nile-filter-chip-text-default, var(--ng-colors-text-secondary-700));\n transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;\n cursor: pointer;\n box-sizing: border-box;\n }\n\n .chip:hover {\n background-color: var(--nile-filter-chip-hover-background, var(--ng-colors-bg-primary-hover));\n }\n .chip:active {\n background-color: var(--nile-filter-chip-active-background, var(--ng-colors-bg-active));\n border-color: var(--nile-filter-chip-active-border-color-stroke);\n}\n:host([active]) .chip {\n background-color: var(--nile-filter-chip-active-background, var(--ng-colors-bg-active));\n border-color: var(--nile-filter-chip-active-border-color-stroke);\n}\n\n\n .icon {\n color: var(--nile-filter-chip-icon-color-default, var(--ng-colors-text-primary-900));\n display: flex;\n align-items: center;\n justify-content: center;\n vertical-align: middle;\n position: relative;\n top: 12px;\n }\n\n .label {\n font-weight: 500;\n color: var(--nile-filter-chip-label-color-default, var(--ng-colors-text-primary-900));\n }\n\n nile-badge::part(base) {\n width: auto;\n height: 14px;\n border-radius: 100px;\n padding: 6px;\n gap: 10px;\n font-size: 8px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n line-height: 1;\n }\n\n .chip-container {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n }\n\n .clear-all-container {\n margin-left: 18px;\n white-space: nowrap;\n cursor: pointer;\n }\n\n\n .value {\n color: var(--nile-filter-chip-values-color-default, var(--ng-colors-text-brand-secondary-700));\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 140px;\n vertical-align: bottom;\n}\n\n\n .close-icon {\n color: var(--nile-filter-chip-close-icon-color-default, var(--ng-componentcolors-utility-gray-400));\n cursor: pointer;\n display: flex;\n align-items: center;\n border-radius: 50%;\n transition: background-color 0.2s;\n }\n\n .close-icon:hover {\n background-color: var(--nile-filter-chip-close-icon-hover-background, var(--ng-colors-bg-primary-hover));\n color: var(--nile-filter-chip-close-icon-hover-color, var(--ng-componentcolors-utility-gray-500));\n }\n\n.label-wrapper {\n margin-right: 4px;\n}\n\n::slotted([slot=\"icon\"]) {\n margin-right: 6px;\n}\n\n.value-wrapper {\n margin-right: 4px; \n}\n\n.badge-wrapper {\n margin-right: 12px; \n}\n\n.badge{\n display: inline-flex;\n align-items: center;\n height: 20px; \n}\n\nnile-badge::part(content) {\n line-height: 20px;\n}\n\n`;\n\nexport default [styles];\n\n "],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAaaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
1
+ {"version":3,"file":"nile-filter-chip.css.cjs.js","sources":["../../../src/nile-filter-chip/nile-filter-chip.css.ts"],"sourcesContent":["/**\n* Copyright Aquera Inc 2023\n*\n* This source code is licensed under the BSD-3-Clause license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nimport {css} from 'lit';\n\n/**\n * FilterChip CSS\n */\n\nexport const styles = css`\n\n :host{\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n }\n\n .filter-chips {\n display: flex;\n align-items: center;\n }\n\n\n .chip {\n display: inline-flex;\n align-items: center;\n height: 30px;\n padding: 8px;\n border: 1px solid var(--nile-filter-chip-chip-border-color-stroke, var(--ng-colors-border-primary));\n border-radius: var(--nile-radius-sm, var(--ng-radius-md));\n font-size: 14px;\n background-color: var(--nile-filter-chip-background-default, var(--ng-colors-bg-primary));\n color: var(--nile-filter-chip-text-default, var(--ng-colors-text-secondary-700));\n transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;\n cursor: pointer;\n box-sizing: border-box;\n }\n\n .chip:hover {\n background-color: var(--nile-filter-chip-hover-background, var(--ng-colors-bg-primary-hover));\n }\n .chip:active {\n background-color: var(--nile-filter-chip-active-background, var(--ng-colors-bg-active));\n border-color: var(--nile-filter-chip-active-border-color-stroke);\n}\n:host([active]) .chip {\n background-color: var(--nile-filter-chip-active-background, var(--ng-colors-bg-active));\n border-color: var(--nile-filter-chip-active-border-color-stroke);\n}\n\n\n .icon {\n color: var(--nile-filter-chip-icon-color-default, var(--ng-colors-text-primary-900));\n display: flex;\n align-items: center;\n justify-content: center;\n vertical-align: middle;\n position: relative;\n top: 12px;\n }\n\n .label {\n font-weight: 500;\n color: var(--nile-filter-chip-label-color-default, var(--ng-colors-text-primary-900));\n }\n\n nile-badge::part(base) {\n width: auto;\n height: 14px;\n border-radius: 100px;\n padding: 6px;\n gap: 10px;\n font-size: 8px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n line-height: 1;\n }\n\n .chip-container {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n }\n\n .clear-all-container {\n margin-left: 18px;\n white-space: nowrap;\n cursor: pointer;\n }\n\n\n .value {\n color: var(--nile-filter-chip-values-color-default, var(--ng-colors-text-brand-secondary-700));\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 140px;\n vertical-align: bottom;\n}\n\n\n .close-icon {\n color: var(--nile-filter-chip-close-icon-color-default, var(--ng-componentcolors-utility-gray-400));\n cursor: pointer;\n display: flex;\n align-items: center;\n border-radius: 50%;\n transition: background-color 0.2s;\n }\n\n .close-icon:hover {\n background-color: var(--nile-filter-chip-close-icon-hover-background, var(--ng-colors-bg-primary-hover));\n color: var(--nile-filter-chip-close-icon-hover-color, var(--ng-componentcolors-utility-gray-500));\n }\n\n.label-wrapper {\n margin-right: 4px;\n}\n\n::slotted([slot=\"icon\"]) {\n margin-right: 6px;\n}\n\n.value-wrapper {\n margin-right: 4px; \n}\n\n.badge-wrapper {\n margin-right: 12px; \n}\n\n.badge{\n display: inline-flex;\n align-items: center;\n height: 20px; \n}\n\nnile-badge::part(content) {\n line-height: 20px;\n}\n\n:host([disabled]) .chip {\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-disabled-subtle));\n border-color: var(--nile-colors-neutral-400, var(--ng-colors-border-disabled));\n color: var(--nile-colors-neutral-500, var(--ng-colors-text-secondary-700));\n cursor: not-allowed;\n opacity: var(--nile-opacity-100, var(--ng-opacity-50));\n}\n\n:host([disabled]) .label {\n color: var(--nile-colors-neutral-500, var(--ng-colors-text-secondary-700));\n font-family:colfax-regular;\n}\n\n:host([disabled]) .value {\n color: var(--nile-colors-primary-500, var(--ng-colors-text-brand-secondary-700));\n}\n\n:host([disabled]) nile-badge::part(base) {\n background-color: var(--nile-colors-primary-500,var(--ng-colors-text-brand-secondary-700));\n color: var(--nile-colors-white-base, var(--ng-colors-text-white));\n}\n\n`;\n\nexport default [styles];\n\n "],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAaaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
@@ -1,4 +1,4 @@
1
- import{css as r}from"lit";const e=r`
1
+ import{css as r}from"lit";const o=r`
2
2
 
3
3
  :host{
4
4
  -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));
@@ -133,4 +133,26 @@ nile-badge::part(content) {
133
133
  line-height: 20px;
134
134
  }
135
135
 
136
- `;export{e as s};
136
+ :host([disabled]) .chip {
137
+ background-color: var(--nile-colors-white-base, var(--ng-colors-bg-disabled-subtle));
138
+ border-color: var(--nile-colors-neutral-400, var(--ng-colors-border-disabled));
139
+ color: var(--nile-colors-neutral-500, var(--ng-colors-text-secondary-700));
140
+ cursor: not-allowed;
141
+ opacity: var(--nile-opacity-100, var(--ng-opacity-50));
142
+ }
143
+
144
+ :host([disabled]) .label {
145
+ color: var(--nile-colors-neutral-500, var(--ng-colors-text-secondary-700));
146
+ font-family:colfax-regular;
147
+ }
148
+
149
+ :host([disabled]) .value {
150
+ color: var(--nile-colors-primary-500, var(--ng-colors-text-brand-secondary-700));
151
+ }
152
+
153
+ :host([disabled]) nile-badge::part(base) {
154
+ background-color: var(--nile-colors-primary-500,var(--ng-colors-text-brand-secondary-700));
155
+ color: var(--nile-colors-white-base, var(--ng-colors-text-white));
156
+ }
157
+
158
+ `;export{o as s};
@@ -1,4 +1,4 @@
1
- import{__decorate as e}from"tslib";import{html as t}from"lit";import{property as s,customElement as i}from"lit/decorators.js";import{N as l}from"../internal/nile-element.esm.js";import{s as a}from"./nile-filter-chip.css.esm.js";var n;let o=n=class extends l{constructor(){super(...arguments),this.label="",this.value="",this.viewMoreCount=0,this.editable=!1,this.closable=!1,this.icon="",this.removeIcon="",this.active=!1}static get styles(){return[a]}connectedCallback(){super.connectedCallback(),this.registerChip()}disconnectedCallback(){super.disconnectedCallback(),this.unregisterChip()}registerChip(){n.activeChips.push(this)}unregisterChip(){n.activeChips=n.activeChips.filter((e=>e!==this))}handleClose(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("nile-close",{detail:{value:this.value,viewMoreCount:this.viewMoreCount}})),this.remove()}handleClick(){this.dispatchEvent(new CustomEvent("nile-click",{detail:{value:this.value,viewMoreCount:this.viewMoreCount}}))}getLabelSlot(){return t`
1
+ import{__decorate as e}from"tslib";import{html as t}from"lit";import{property as s,customElement as i}from"lit/decorators.js";import{N as l}from"../internal/nile-element.esm.js";import{s as a}from"./nile-filter-chip.css.esm.js";var o;let n=o=class extends l{constructor(){super(...arguments),this.label="",this.value="",this.viewMoreCount=0,this.editable=!1,this.closable=!1,this.icon="",this.removeIcon="",this.active=!1,this.disabled=!1}static get styles(){return[a]}connectedCallback(){super.connectedCallback(),this.registerChip()}disconnectedCallback(){super.disconnectedCallback(),this.unregisterChip()}registerChip(){o.activeChips.push(this)}unregisterChip(){o.activeChips=o.activeChips.filter((e=>e!==this))}handleClose(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("nile-close",{detail:{value:this.value,viewMoreCount:this.viewMoreCount}})),this.remove()}handleClick(){this.disabled||this.dispatchEvent(new CustomEvent("nile-click",{detail:{value:this.value,viewMoreCount:this.viewMoreCount}}))}getLabelSlot(){return t`
2
2
  <span class="label-wrapper">
3
3
  <slot name="label">
4
4
  <span class="label" part="label">${this.label}:</span>
@@ -40,4 +40,4 @@ import{__decorate as e}from"tslib";import{html as t}from"lit";import{property as
40
40
  ${this.getviewMoreCountSlot()}
41
41
  ${this.getCloseIconSlot()}
42
42
  </div>
43
- `}};o.activeChips=[],e([s({type:String})],o.prototype,"label",void 0),e([s({type:String})],o.prototype,"value",void 0),e([s({type:Number})],o.prototype,"viewMoreCount",void 0),e([s({type:Boolean})],o.prototype,"editable",void 0),e([s({type:Boolean})],o.prototype,"closable",void 0),e([s({type:String})],o.prototype,"icon",void 0),e([s({type:String})],o.prototype,"removeIcon",void 0),e([s({type:Boolean,reflect:!0})],o.prototype,"active",void 0),o=n=e([i("nile-filter-chip")],o);export{o as N};
43
+ `}};n.activeChips=[],e([s({type:String})],n.prototype,"label",void 0),e([s({type:String})],n.prototype,"value",void 0),e([s({type:Number})],n.prototype,"viewMoreCount",void 0),e([s({type:Boolean})],n.prototype,"editable",void 0),e([s({type:Boolean})],n.prototype,"closable",void 0),e([s({type:String})],n.prototype,"icon",void 0),e([s({type:String})],n.prototype,"removeIcon",void 0),e([s({type:Boolean,reflect:!0})],n.prototype,"active",void 0),e([s({type:Boolean,reflect:!0})],n.prototype,"disabled",void 0),n=o=e([i("nile-filter-chip")],n);export{n as N};
@@ -1,2 +1,2 @@
1
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","./nile-inline-edit.css.cjs.js","../internal/nile-element.cjs.js","./nile-inline-edit-utils.cjs.js"],function(_export,_context){"use strict";var t,i,e,s,o,n,l,r,a,c,_templateObject,_templateObject2,_templateObject3,h;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.html;},function(_litDecoratorsJs){e=_litDecoratorsJs.property;s=_litDecoratorsJs.customElement;},function(_nileInlineEditCssCjsJs){o=_nileInlineEditCssCjsJs.s;},function(_internalNileElementCjsJs){n=_internalNileElementCjsJs.N;},function(_nileInlineEditUtilsCjsJs){l=_nileInlineEditUtilsCjsJs.h;r=_nileInlineEditUtilsCjsJs.a;a=_nileInlineEditUtilsCjsJs.u;c=_nileInlineEditUtilsCjsJs.g;}],execute:function execute(){_export("N",h=/*#__PURE__*/function(_n){function h(){var _this;_classCallCheck(this,h);_this=_callSuper(this,h,arguments),_this.label="",_this.placeholder="",_this.open=!1,_this.value="",_this.maxPlaceholderLength=25,_this.autoClose=!1,_this.handleDocumentFocusInWrapper=function(t){var i=l(t,_assertThisInitialized(_this),_this.open);_this.handleCloseResult(i);},_this.handleDocumentMouseDownWrapper=function(t){var i=r(t,_assertThisInitialized(_this),_this.open);_this.handleCloseResult(i);};return _this;}_inherits(h,_n);return _createClass(h,[{key:"handleCloseResult",value:function handleCloseResult(t){t.shouldClose&&(null!==t.newValue&&(this.value=t.newValue),this.open=!1);}},{key:"connectedCallback",value:function connectedCallback(){_superPropGet(h,"connectedCallback",this,3)([]);}},{key:"updated",value:function updated(t){_superPropGet(h,"updated",this,3)([t]),t.has("open")&&this.autoClose&&(this.open?(a(this.updateComplete,this.shadowRoot,this.value),document.addEventListener("focusin",this.handleDocumentFocusInWrapper,!0),document.addEventListener("mousedown",this.handleDocumentMouseDownWrapper,!0)):(document.removeEventListener("focusin",this.handleDocumentFocusInWrapper,!0),document.removeEventListener("mousedown",this.handleDocumentMouseDownWrapper,!0)));}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(h,"disconnectedCallback",this,3)([]),document.removeEventListener("focusin",this.handleDocumentFocusInWrapper,!0),document.removeEventListener("mousedown",this.handleDocumentMouseDownWrapper,!0);}},{key:"handleClick",value:function handleClick(){this.open=!0;}},{key:"render",value:function render(){var t=(this.autoClose?c(this.value,this.maxPlaceholderLength):this.value)||this.placeholder;return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div class=\"inline__edit--label\" part=\"label\">","</div>\n ","\n "])),this.label,this.open?i(_templateObject2||(_templateObject2=_taggedTemplateLiteral([" <slot class=\"inline__edit--open--container\" part=\"base\"> </slot>"]))):i(_templateObject3||(_templateObject3=_taggedTemplateLiteral([" <div class=\"inline__edit--container\" part=\"container\" @click=",">\n ","\n </div>"])),this.handleClick,t));}}],[{key:"styles",get:function get(){return[o];}}]);}(n));t([e({type:String,reflect:!0})],h.prototype,"label",void 0),t([e({type:String,reflect:!0})],h.prototype,"placeholder",void 0),t([e({type:Boolean,reflect:!0})],h.prototype,"open",void 0),t([e({type:String,reflect:!0})],h.prototype,"value",void 0),t([e({type:Number,attribute:"max-placeholder-length"})],h.prototype,"maxPlaceholderLength",void 0),t([e({type:Boolean,attribute:"auto-close"})],h.prototype,"autoClose",void 0),_export("N",h=t([s("nile-inline-edit")],h));}};});
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","./nile-inline-edit.css.cjs.js","../internal/nile-element.cjs.js","./nile-inline-edit-utils.cjs.js"],function(_export,_context){"use strict";var t,e,i,s,o,n,l,r,a,h,_templateObject,_templateObject2,_templateObject3,c;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){e=_lit.html;},function(_litDecoratorsJs){i=_litDecoratorsJs.property;s=_litDecoratorsJs.customElement;},function(_nileInlineEditCssCjsJs){o=_nileInlineEditCssCjsJs.s;},function(_internalNileElementCjsJs){n=_internalNileElementCjsJs.N;},function(_nileInlineEditUtilsCjsJs){l=_nileInlineEditUtilsCjsJs.h;r=_nileInlineEditUtilsCjsJs.a;a=_nileInlineEditUtilsCjsJs.u;h=_nileInlineEditUtilsCjsJs.g;}],execute:function execute(){_export("N",c=/*#__PURE__*/function(_n){function c(){var _this;_classCallCheck(this,c);_this=_callSuper(this,c,arguments),_this.label="",_this.placeholder="",_this.open=!1,_this.value="",_this.maxPlaceholderLength=25,_this.autoClose=!1,_this.disabled=!1,_this.handleDocumentFocusInWrapper=function(t){var e=l(t,_assertThisInitialized(_this),_this.open);_this.handleCloseResult(e);},_this.handleDocumentMouseDownWrapper=function(t){var e=r(t,_assertThisInitialized(_this),_this.open);_this.handleCloseResult(e);};return _this;}_inherits(c,_n);return _createClass(c,[{key:"handleCloseResult",value:function handleCloseResult(t){t.shouldClose&&(null!==t.newValue&&(this.value=t.newValue),this.open=!1);}},{key:"connectedCallback",value:function connectedCallback(){_superPropGet(c,"connectedCallback",this,3)([]);}},{key:"updated",value:function updated(t){_superPropGet(c,"updated",this,3)([t]),t.has("open")&&this.autoClose&&(this.open?(a(this.updateComplete,this.shadowRoot,this.value),document.addEventListener("focusin",this.handleDocumentFocusInWrapper,!0),document.addEventListener("mousedown",this.handleDocumentMouseDownWrapper,!0)):(document.removeEventListener("focusin",this.handleDocumentFocusInWrapper,!0),document.removeEventListener("mousedown",this.handleDocumentMouseDownWrapper,!0)));}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(c,"disconnectedCallback",this,3)([]),document.removeEventListener("focusin",this.handleDocumentFocusInWrapper,!0),document.removeEventListener("mousedown",this.handleDocumentMouseDownWrapper,!0);}},{key:"handleClick",value:function handleClick(){this.disabled||(this.open=!0);}},{key:"render",value:function render(){var t=(this.autoClose?h(this.value,this.maxPlaceholderLength):this.value)||this.placeholder;return e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div class=\"inline__edit--label\" part=\"label\">","</div>\n ","\n "])),this.label,this.open?e(_templateObject2||(_templateObject2=_taggedTemplateLiteral([" <slot class=\"inline__edit--open--container\" part=\"base\"> </slot>"]))):e(_templateObject3||(_templateObject3=_taggedTemplateLiteral([" <div class=\"inline__edit--container\" part=\"container\" @click=",">\n ","\n </div>"])),this.handleClick,t));}}],[{key:"styles",get:function get(){return[o];}}]);}(n));t([i({type:String,reflect:!0})],c.prototype,"label",void 0),t([i({type:String,reflect:!0})],c.prototype,"placeholder",void 0),t([i({type:Boolean,reflect:!0})],c.prototype,"open",void 0),t([i({type:String,reflect:!0})],c.prototype,"value",void 0),t([i({type:Number,attribute:"max-placeholder-length"})],c.prototype,"maxPlaceholderLength",void 0),t([i({type:Boolean,attribute:"auto-close"})],c.prototype,"autoClose",void 0),t([i({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),_export("N",c=t([s("nile-inline-edit")],c));}};});
2
2
  //# sourceMappingURL=nile-inline-edit.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-inline-edit.cjs.js","sources":["../../../src/nile-inline-edit/nile-inline-edit.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n} from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { styles } from './nile-inline-edit.css';\nimport NileElement from '../internal/nile-element';\nimport {\n getDisplayValue,\n updateSlottedElementValue,\n handleDocumentFocusIn,\n handleDocumentMouseDown,\n} from './nile-inline-edit-utils';\n\n/**\n * Nile inline-edit component.\n *\n * @tag nile-inline-edit\n *\n */\n@customElement('nile-inline-edit')\nexport class NileInlineEdit extends NileElement {\n /**\n * The styles for nile-inline-edit\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 /** Gives the label to the Inline Edit */\n @property({ type: String, reflect: true }) label = '';\n\n /** Gives the Placeholder to the Inline Edit */\n @property({ type: String, reflect: true }) placeholder = '';\n\n /** Open prop for displaying default slot in Inline Edit */\n @property({ type: Boolean, reflect: true }) open = false;\n\n /** Gives the Value to the Inline Edit */\n @property({ type: String, reflect: true }) value = '';\n\n /** Maximum length for the placeholder value. Values longer than this will be truncated */\n @property({ type: Number, attribute: 'max-placeholder-length' }) maxPlaceholderLength: number = 25;\n\n /** Enables automatic closing when focus moves outside the component or when clicking outside */\n @property({ type: Boolean, attribute: 'auto-close' }) autoClose: boolean = false;\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n\n private handleCloseResult(result: { shouldClose: boolean; newValue: string | null }) {\n if (result.shouldClose) {\n if (result.newValue !== null) {\n this.value = result.newValue;\n }\n this.open = false;\n }\n }\n\n private handleDocumentFocusInWrapper = (event: FocusEvent) => {\n const result = handleDocumentFocusIn(event, this, this.open);\n this.handleCloseResult(result);\n };\n\n private handleDocumentMouseDownWrapper = (event: MouseEvent) => {\n const result = handleDocumentMouseDown(event, this, this.open);\n this.handleCloseResult(result);\n };\n\n connectedCallback() {\n super.connectedCallback();\n }\n\n updated(changedProperties: Map<string, unknown>) {\n super.updated(changedProperties);\n \n if (changedProperties.has('open') && this.autoClose) {\n if (this.open) {\n updateSlottedElementValue(this.updateComplete, this.shadowRoot, this.value);\n document.addEventListener('focusin', this.handleDocumentFocusInWrapper, true);\n document.addEventListener('mousedown', this.handleDocumentMouseDownWrapper, true);\n } else {\n document.removeEventListener('focusin', this.handleDocumentFocusInWrapper, true);\n document.removeEventListener('mousedown', this.handleDocumentMouseDownWrapper, true);\n }\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n document.removeEventListener('focusin', this.handleDocumentFocusInWrapper, true);\n document.removeEventListener('mousedown', this.handleDocumentMouseDownWrapper, true);\n }\n\n private handleClick() {\n this.open = true;\n }\n public render(): TemplateResult {\n // Use truncated value for display, or placeholder if empty\n const displayValue = this.autoClose ? getDisplayValue(this.value, this.maxPlaceholderLength) : this.value;\n const textInsideContainer = displayValue || this.placeholder;\n return html`\n <div class=\"inline__edit--label\" part=\"label\">${this.label}</div>\n ${this.open\n ? html` <slot class=\"inline__edit--open--container\" part=\"base\"> </slot>`\n : html` <div class=\"inline__edit--container\" part=\"container\" @click=${this.handleClick}>\n ${textInsideContainer}\n </div>`}\n `;\n }\n\n /* #endregion */\n}\n\nexport default NileInlineEdit;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-inline-edit': NileInlineEdit;\n }\n}\n"],"names":["NileInlineEdit","_n","h","constructor","this","label","placeholder","open","value","maxPlaceholderLength","autoClose","handleDocumentFocusInWrapper","event","result","handleDocumentFocusIn","handleCloseResult","handleDocumentMouseDownWrapper","handleDocumentMouseDown","_this","_inherits","_createClass","key","shouldClose","newValue","connectedCallback","super","updated","changedProperties","has","updateSlottedElementValue","updateComplete","shadowRoot","document","addEventListener","removeEventListener","disconnectedCallback","handleClick","render","textInsideContainer","getDisplayValue","html","_templateObject","_taggedTemplateLiteral","_templateObject2","_templateObject3","get","styles","NileElement","__decorate","property","type","String","reflect","prototype","Boolean","Number","attribute","customElement"],"mappings":"+3HA8BaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCAUsCC,KAAAA,CAAKC,KAAG,CAAA,EAAA,CAGRD,KAAAA,CAAWE,WAAG,CAAA,EAAA,CAGbF,KAAAA,CAAIG,IAAG,CAAA,CAAA,CAAA,CAGRH,KAAAA,CAAKI,KAAG,CAAA,EAAA,CAGcJ,KAAAA,CAAoBK,oBAAW,CAAA,EAAA,CAG1CL,KAAAA,CAASM,SAAY,CAAA,CAAA,CAAA,CAoBnEN,KAAAA,CAAAO,4BAAgCC,CAAAA,SAAAA,CAAAA,CAAAA,CACtC,GAAMC,CAAAA,CAAAA,CAASC,EAAsBF,CAAOR,CAAAA,sBAAAA,CAAAA,KAAAA,EAAMA,KAAAA,CAAKG,IACvDH,CAAAA,CAAAA,KAAAA,CAAKW,kBAAkBF,CAAO,CAAA,EAAA,CAGxBT,KAAAA,CAAAY,8BAAkCJ,CAAAA,SAAAA,CAAAA,CAAAA,CACxC,GAAMC,CAAAA,CAASI,CAAAA,CAAAA,CAAwBL,gCA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AA,EAGhBL,CAAAA,CAAAA,CAAAA,CAAA,CAA3CC,CAAS,CAAA,CAAEC,IAAMI,CAAAA,OAAAA,CAASF,SAAS,CAAqBpD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAqD,SAAA,CAAA,MAAA,CAAA,IAAA,IAGdL,CAAA,CAAA,CAA1CC,CAAS,CAAA,CAAEC,KAAMC,MAAQC,CAAAA,OAAAA,CAAAA,CAAS,CAAmBpD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAqD,UAAA,OAAA,CAAA,IAAA,EAAA,CAAA,CAGWL,CAAA,CAAA,CAAhEC,EAAS,CAAEC,IAAAA,CAAMK,MAAQC,CAAAA,SAAAA,CAAW,4BAA8DxD,CAAAqD,CAAAA,SAAAA,CAAA,sBAAA,CAAA,IAAA,EAAA,CAAA,CAG7CL,EAAA,CAArDC,CAAAA,CAAS,CAAEC,IAAAA,CAAMI,QAASE,SAAW,CAAA,YAAA,CAAA,CAAA,CAAA,CAA2CxD,CAAAqD,CAAAA,SAAAA,CAAA,gBAAA,EAzBtErD,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAcgD,EAAA,CAD1BS,CAAAA,CAAc,qBACFzD"}
1
+ {"version":3,"file":"nile-inline-edit.cjs.js","sources":["../../../src/nile-inline-edit/nile-inline-edit.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n} from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { styles } from './nile-inline-edit.css';\nimport NileElement from '../internal/nile-element';\nimport {\n getDisplayValue,\n updateSlottedElementValue,\n handleDocumentFocusIn,\n handleDocumentMouseDown,\n} from './nile-inline-edit-utils';\n\n/**\n * Nile inline-edit component.\n *\n * @tag nile-inline-edit\n *\n */\n@customElement('nile-inline-edit')\nexport class NileInlineEdit extends NileElement {\n /**\n * The styles for nile-inline-edit\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 /** Gives the label to the Inline Edit */\n @property({ type: String, reflect: true }) label = '';\n\n /** Gives the Placeholder to the Inline Edit */\n @property({ type: String, reflect: true }) placeholder = '';\n\n /** Open prop for displaying default slot in Inline Edit */\n @property({ type: Boolean, reflect: true }) open = false;\n\n /** Gives the Value to the Inline Edit */\n @property({ type: String, reflect: true }) value = '';\n\n /** Maximum length for the placeholder value. Values longer than this will be truncated */\n @property({ type: Number, attribute: 'max-placeholder-length' }) maxPlaceholderLength: number = 25;\n\n /** Enables automatic closing when focus moves outside the component or when clicking outside */\n @property({ type: Boolean, attribute: 'auto-close' }) autoClose: boolean = false;\n\n /** Disables the inline edit, preventing it from being opened */\n @property({ type: Boolean, reflect: true}) disabled: boolean = false;\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n\n private handleCloseResult(result: { shouldClose: boolean; newValue: string | null }) {\n if (result.shouldClose) {\n if (result.newValue !== null) {\n this.value = result.newValue;\n }\n this.open = false;\n }\n }\n\n private handleDocumentFocusInWrapper = (event: FocusEvent) => {\n const result = handleDocumentFocusIn(event, this, this.open);\n this.handleCloseResult(result);\n };\n\n private handleDocumentMouseDownWrapper = (event: MouseEvent) => {\n const result = handleDocumentMouseDown(event, this, this.open);\n this.handleCloseResult(result);\n };\n\n connectedCallback() {\n super.connectedCallback();\n }\n\n updated(changedProperties: Map<string, unknown>) {\n super.updated(changedProperties);\n \n if (changedProperties.has('open') && this.autoClose) {\n if (this.open) {\n updateSlottedElementValue(this.updateComplete, this.shadowRoot, this.value);\n document.addEventListener('focusin', this.handleDocumentFocusInWrapper, true);\n document.addEventListener('mousedown', this.handleDocumentMouseDownWrapper, true);\n } else {\n document.removeEventListener('focusin', this.handleDocumentFocusInWrapper, true);\n document.removeEventListener('mousedown', this.handleDocumentMouseDownWrapper, true);\n }\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n document.removeEventListener('focusin', this.handleDocumentFocusInWrapper, true);\n document.removeEventListener('mousedown', this.handleDocumentMouseDownWrapper, true);\n }\n\n private handleClick() {\n if (this.disabled) return;\n this.open = true;\n }\n public render(): TemplateResult {\n // Use truncated value for display, or placeholder if empty\n const displayValue = this.autoClose ? getDisplayValue(this.value, this.maxPlaceholderLength) : this.value;\n const textInsideContainer = displayValue || this.placeholder;\n return html`\n <div class=\"inline__edit--label\" part=\"label\">${this.label}</div>\n ${this.open\n ? html` <slot class=\"inline__edit--open--container\" part=\"base\"> </slot>`\n : html` <div class=\"inline__edit--container\" part=\"container\" @click=${this.handleClick}>\n ${textInsideContainer}\n </div>`}\n `;\n }\n\n /* #endregion */\n}\n\nexport default NileInlineEdit;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-inline-edit': NileInlineEdit;\n }\n}\n"],"names":["NileInlineEdit","_n","c","constructor","this","label","placeholder","open","value","maxPlaceholderLength","autoClose","disabled","handleDocumentFocusInWrapper","event","result","handleDocumentFocusIn","handleCloseResult","handleDocumentMouseDownWrapper","handleDocumentMouseDown","_this","_inherits","_createClass","key","shouldClose","newValue","connectedCallback","super","updated","changedProperties","has","updateSlottedElementValue","updateComplete","shadowRoot","document","addEventListener","removeEventListener","disconnectedCallback","handleClick","render","textInsideContainer","getDisplayValue","html","_templateObject","_taggedTemplateLiteral","_templateObject2","_templateObject3","get","styles","NileElement","__decorate","property","type","String","reflect","prototype","Boolean","Number","attribute","customElement"],"mappings":"+3HA8BaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,mCAUsCC,EAAAA,KAAAA,CAAKC,MAAG,EAGRD,CAAAA,KAAAA,CAAWE,YAAG,EAGbF,CAAAA,KAAAA,CAAIG,MAAG,CAGRH,CAAAA,KAAAA,CAAKI,MAAG,EAGc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,OAAAA,KAAAA,CAAAA,CAAciD,EAAA,CAD1BS,CAAAA,CAAc,qBACF1D"}
@@ -1,2 +1,2 @@
1
- System.register(["lit"],function(_export,_context){"use strict";var n,_templateObject,i;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){n=_lit.css;}],execute:function execute(){_export("s",i=n(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n box-sizing: border-box;\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n }\n\n .inline__edit--label {\n color: var(--nile-inline-edit-label-font-color, var(--ng-colors-text-primary-900));\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));\n font-style: normal;\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-medium));\n line-height: var(--nile-line-height-small, var(--ng-line-height-text-sm));\n margin-bottom: var(--nile-spacing-sm);\n }\n\n .inline__edit--open--container {\n display: block;\n width: var(--nile-width-width-xxs, var(--ng-spacing-80));\n box-sizing: border-box;\n }\n\n .inline__edit--container {\n box-sizing: border-box;\n width: var(--nile-width-width-xxs, var(--ng-width-80));\n min-width: var(--nile-width-width-xxs, var(--ng-width-80));\n min-height: var(--nile-height-40px, var(--ng-height-40px));\n height: auto;\n padding-top: var(--nile-spacing-spacing-md, var(--ng-spacing-md));\n padding-bottom: var(--nile-spacing-spacing-md, var(--ng-spacing-md));\n padding-left: var(--nile-spacing-spacing-lg, var(--ng-spacing-lg));\n padding-right:var(--nile-spacing-spacing-lg, var(--ng-spacing-lg));\n border-radius: var(--nile-radius-radius-xs, var(--ng-radius-md));\n color: var(--nile-inline-edit-font-color, var(--ng-colors-text-quaternary-500));\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-4, var(--ng-font-size-text-md));\n font-style: normal;\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-regular));\n line-height: var(--nile-spacing-spacing-3xl, var(--ng-line-height-text-md));\n word-wrap: break-word;\n }\n\n .inline__edit--container:hover {\n background-color:var(--nile-inline-edit-hover-background-color, var(--ng-colors-bg-secondary-hover));\n }\n"]))));}};});
1
+ System.register(["lit"],function(_export,_context){"use strict";var n,_templateObject,i;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){n=_lit.css;}],execute:function execute(){_export("s",i=n(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n box-sizing: border-box;\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n }\n\n .inline__edit--label {\n color: var(--nile-inline-edit-label-font-color, var(--ng-colors-text-primary-900));\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));\n font-style: normal;\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-medium));\n line-height: var(--nile-line-height-small, var(--ng-line-height-text-sm));\n margin-bottom: var(--nile-spacing-sm, var(--ng-spacing-sm));\n }\n\n .inline__edit--open--container {\n display: block;\n width: var(--nile-width-width-xxs, var(--ng-spacing-80));\n box-sizing: border-box;\n }\n\n .inline__edit--container {\n box-sizing: border-box;\n width: var(--nile-width-width-xxs, var(--ng-width-80));\n min-width: var(--nile-width-width-xxs, var(--ng-width-80));\n min-height: var(--nile-height-40px, var(--ng-height-40px));\n height: auto;\n padding-top: var(--nile-spacing-spacing-lg, var(--ng-spacing-lg));\n padding-bottom: var(--nile-spacing-spacing-lg, var(--ng-spacing-lg));\n padding-left: var(--nile-spacing-spacing-lg, var(--ng-spacing-lg));\n padding-right:var(--nile-spacing-spacing-lg, var(--ng-spacing-lg));\n border-radius: var(--nile-radius-radius-xs, var(--ng-radius-md));\n color: var(--nile-inline-edit-font-color, var(--ng-colors-text-quaternary-500));\n font-family: var(--nile-font-family-sans-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-md));\n font-style: normal;\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-regular));\n line-height: var(--nile-spacing-spacing-3xl, var(--ng-line-height-text-md));\n word-wrap: break-word;\n width: 100%;\n }\n\n .inline__edit--container:hover {\n background-color: var(--nile-inline-edit-hover-background-color, var(--ng-colors-bg-secondary-hover));\n }\n\n :host([disabled]) .inline__edit--container,\n :host([disabled]) .inline__edit--container:hover {\n background-color: var(--nile-colors-dark-200, var(--ng-colors-bg-disabled-subtle));\n color: var(--nile-colors-dark-500, var(--ng-colors-text-disabled));\n cursor: not-allowed;\n}\n\n"]))));}};});
2
2
  //# sourceMappingURL=nile-inline-edit.css.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-inline-edit.css.cjs.js","sources":["../../../src/nile-inline-edit/nile-inline-edit.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\n/**\n * InlineEdit CSS\n */\nexport const styles = css`\n :host {\n box-sizing: border-box;\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n }\n\n .inline__edit--label {\n color: var(--nile-inline-edit-label-font-color, var(--ng-colors-text-primary-900));\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));\n font-style: normal;\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-medium));\n line-height: var(--nile-line-height-small, var(--ng-line-height-text-sm));\n margin-bottom: var(--nile-spacing-sm);\n }\n\n .inline__edit--open--container {\n display: block;\n width: var(--nile-width-width-xxs, var(--ng-spacing-80));\n box-sizing: border-box;\n }\n\n .inline__edit--container {\n box-sizing: border-box;\n width: var(--nile-width-width-xxs, var(--ng-width-80));\n min-width: var(--nile-width-width-xxs, var(--ng-width-80));\n min-height: var(--nile-height-40px, var(--ng-height-40px));\n height: auto;\n padding-top: var(--nile-spacing-spacing-md, var(--ng-spacing-md));\n padding-bottom: var(--nile-spacing-spacing-md, var(--ng-spacing-md));\n padding-left: var(--nile-spacing-spacing-lg, var(--ng-spacing-lg));\n padding-right:var(--nile-spacing-spacing-lg, var(--ng-spacing-lg));\n border-radius: var(--nile-radius-radius-xs, var(--ng-radius-md));\n color: var(--nile-inline-edit-font-color, var(--ng-colors-text-quaternary-500));\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-4, var(--ng-font-size-text-md));\n font-style: normal;\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-regular));\n line-height: var(--nile-spacing-spacing-3xl, var(--ng-line-height-text-md));\n word-wrap: break-word;\n }\n\n .inline__edit--container:hover {\n background-color:var(--nile-inline-edit-hover-background-color, var(--ng-colors-bg-secondary-hover));\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
1
+ {"version":3,"file":"nile-inline-edit.css.cjs.js","sources":["../../../src/nile-inline-edit/nile-inline-edit.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\n/**\n * InlineEdit CSS\n */\nexport const styles = css`\n :host {\n box-sizing: border-box;\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n }\n\n .inline__edit--label {\n color: var(--nile-inline-edit-label-font-color, var(--ng-colors-text-primary-900));\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));\n font-style: normal;\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-medium));\n line-height: var(--nile-line-height-small, var(--ng-line-height-text-sm));\n margin-bottom: var(--nile-spacing-sm, var(--ng-spacing-sm));\n }\n\n .inline__edit--open--container {\n display: block;\n width: var(--nile-width-width-xxs, var(--ng-spacing-80));\n box-sizing: border-box;\n }\n\n .inline__edit--container {\n box-sizing: border-box;\n width: var(--nile-width-width-xxs, var(--ng-width-80));\n min-width: var(--nile-width-width-xxs, var(--ng-width-80));\n min-height: var(--nile-height-40px, var(--ng-height-40px));\n height: auto;\n padding-top: var(--nile-spacing-spacing-lg, var(--ng-spacing-lg));\n padding-bottom: var(--nile-spacing-spacing-lg, var(--ng-spacing-lg));\n padding-left: var(--nile-spacing-spacing-lg, var(--ng-spacing-lg));\n padding-right:var(--nile-spacing-spacing-lg, var(--ng-spacing-lg));\n border-radius: var(--nile-radius-radius-xs, var(--ng-radius-md));\n color: var(--nile-inline-edit-font-color, var(--ng-colors-text-quaternary-500));\n font-family: var(--nile-font-family-sans-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-md));\n font-style: normal;\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-regular));\n line-height: var(--nile-spacing-spacing-3xl, var(--ng-line-height-text-md));\n word-wrap: break-word;\n width: 100%;\n }\n\n .inline__edit--container:hover {\n background-color: var(--nile-inline-edit-hover-background-color, var(--ng-colors-bg-secondary-hover));\n }\n\n :host([disabled]) .inline__edit--container,\n :host([disabled]) .inline__edit--container:hover {\n background-color: var(--nile-colors-dark-200, var(--ng-colors-bg-disabled-subtle));\n color: var(--nile-colors-dark-500, var(--ng-colors-text-disabled));\n cursor: not-allowed;\n}\n\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
@@ -13,7 +13,7 @@ import{css as n}from"lit";const i=n`
13
13
  font-style: normal;
14
14
  font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-medium));
15
15
  line-height: var(--nile-line-height-small, var(--ng-line-height-text-sm));
16
- margin-bottom: var(--nile-spacing-sm);
16
+ margin-bottom: var(--nile-spacing-sm, var(--ng-spacing-sm));
17
17
  }
18
18
 
19
19
  .inline__edit--open--container {
@@ -28,21 +28,30 @@ import{css as n}from"lit";const i=n`
28
28
  min-width: var(--nile-width-width-xxs, var(--ng-width-80));
29
29
  min-height: var(--nile-height-40px, var(--ng-height-40px));
30
30
  height: auto;
31
- padding-top: var(--nile-spacing-spacing-md, var(--ng-spacing-md));
32
- padding-bottom: var(--nile-spacing-spacing-md, var(--ng-spacing-md));
31
+ padding-top: var(--nile-spacing-spacing-lg, var(--ng-spacing-lg));
32
+ padding-bottom: var(--nile-spacing-spacing-lg, var(--ng-spacing-lg));
33
33
  padding-left: var(--nile-spacing-spacing-lg, var(--ng-spacing-lg));
34
34
  padding-right:var(--nile-spacing-spacing-lg, var(--ng-spacing-lg));
35
35
  border-radius: var(--nile-radius-radius-xs, var(--ng-radius-md));
36
36
  color: var(--nile-inline-edit-font-color, var(--ng-colors-text-quaternary-500));
37
- font-family: var(--nile-font-family-serif, var(--ng-font-family-body));
38
- font-size: var(--nile-type-scale-4, var(--ng-font-size-text-md));
37
+ font-family: var(--nile-font-family-sans-serif, var(--ng-font-family-body));
38
+ font-size: var(--nile-type-scale-3, var(--ng-font-size-text-md));
39
39
  font-style: normal;
40
40
  font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-regular));
41
41
  line-height: var(--nile-spacing-spacing-3xl, var(--ng-line-height-text-md));
42
42
  word-wrap: break-word;
43
+ width: 100%;
43
44
  }
44
45
 
45
46
  .inline__edit--container:hover {
46
- background-color:var(--nile-inline-edit-hover-background-color, var(--ng-colors-bg-secondary-hover));
47
+ background-color: var(--nile-inline-edit-hover-background-color, var(--ng-colors-bg-secondary-hover));
47
48
  }
49
+
50
+ :host([disabled]) .inline__edit--container,
51
+ :host([disabled]) .inline__edit--container:hover {
52
+ background-color: var(--nile-colors-dark-200, var(--ng-colors-bg-disabled-subtle));
53
+ color: var(--nile-colors-dark-500, var(--ng-colors-text-disabled));
54
+ cursor: not-allowed;
55
+ }
56
+
48
57
  `;export{i as s};
@@ -1,6 +1,6 @@
1
- import{__decorate as t}from"tslib";import{html as e}from"lit";import{property as i,customElement as s}from"lit/decorators.js";import{s as o}from"./nile-inline-edit.css.esm.js";import{N as n}from"../internal/nile-element.esm.js";import{h as l,a as r,u as a,g as h}from"./nile-inline-edit-utils.esm.js";let c=class extends n{constructor(){super(...arguments),this.label="",this.placeholder="",this.open=!1,this.value="",this.maxPlaceholderLength=25,this.autoClose=!1,this.handleDocumentFocusInWrapper=t=>{const e=l(t,this,this.open);this.handleCloseResult(e)},this.handleDocumentMouseDownWrapper=t=>{const e=r(t,this,this.open);this.handleCloseResult(e)}}static get styles(){return[o]}handleCloseResult(t){t.shouldClose&&(null!==t.newValue&&(this.value=t.newValue),this.open=!1)}connectedCallback(){super.connectedCallback()}updated(t){super.updated(t),t.has("open")&&this.autoClose&&(this.open?(a(this.updateComplete,this.shadowRoot,this.value),document.addEventListener("focusin",this.handleDocumentFocusInWrapper,!0),document.addEventListener("mousedown",this.handleDocumentMouseDownWrapper,!0)):(document.removeEventListener("focusin",this.handleDocumentFocusInWrapper,!0),document.removeEventListener("mousedown",this.handleDocumentMouseDownWrapper,!0)))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("focusin",this.handleDocumentFocusInWrapper,!0),document.removeEventListener("mousedown",this.handleDocumentMouseDownWrapper,!0)}handleClick(){this.open=!0}render(){const t=(this.autoClose?h(this.value,this.maxPlaceholderLength):this.value)||this.placeholder;return e`
1
+ import{__decorate as t}from"tslib";import{html as e}from"lit";import{property as i,customElement as s}from"lit/decorators.js";import{s as o}from"./nile-inline-edit.css.esm.js";import{N as n}from"../internal/nile-element.esm.js";import{h as l,a as r,u as a,g as h}from"./nile-inline-edit-utils.esm.js";let c=class extends n{constructor(){super(...arguments),this.label="",this.placeholder="",this.open=!1,this.value="",this.maxPlaceholderLength=25,this.autoClose=!1,this.disabled=!1,this.handleDocumentFocusInWrapper=t=>{const e=l(t,this,this.open);this.handleCloseResult(e)},this.handleDocumentMouseDownWrapper=t=>{const e=r(t,this,this.open);this.handleCloseResult(e)}}static get styles(){return[o]}handleCloseResult(t){t.shouldClose&&(null!==t.newValue&&(this.value=t.newValue),this.open=!1)}connectedCallback(){super.connectedCallback()}updated(t){super.updated(t),t.has("open")&&this.autoClose&&(this.open?(a(this.updateComplete,this.shadowRoot,this.value),document.addEventListener("focusin",this.handleDocumentFocusInWrapper,!0),document.addEventListener("mousedown",this.handleDocumentMouseDownWrapper,!0)):(document.removeEventListener("focusin",this.handleDocumentFocusInWrapper,!0),document.removeEventListener("mousedown",this.handleDocumentMouseDownWrapper,!0)))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("focusin",this.handleDocumentFocusInWrapper,!0),document.removeEventListener("mousedown",this.handleDocumentMouseDownWrapper,!0)}handleClick(){this.disabled||(this.open=!0)}render(){const t=(this.autoClose?h(this.value,this.maxPlaceholderLength):this.value)||this.placeholder;return e`
2
2
  <div class="inline__edit--label" part="label">${this.label}</div>
3
3
  ${this.open?e` <slot class="inline__edit--open--container" part="base"> </slot>`:e` <div class="inline__edit--container" part="container" @click=${this.handleClick}>
4
4
  ${t}
5
5
  </div>`}
6
- `}};t([i({type:String,reflect:!0})],c.prototype,"label",void 0),t([i({type:String,reflect:!0})],c.prototype,"placeholder",void 0),t([i({type:Boolean,reflect:!0})],c.prototype,"open",void 0),t([i({type:String,reflect:!0})],c.prototype,"value",void 0),t([i({type:Number,attribute:"max-placeholder-length"})],c.prototype,"maxPlaceholderLength",void 0),t([i({type:Boolean,attribute:"auto-close"})],c.prototype,"autoClose",void 0),c=t([s("nile-inline-edit")],c);export{c as N};
6
+ `}};t([i({type:String,reflect:!0})],c.prototype,"label",void 0),t([i({type:String,reflect:!0})],c.prototype,"placeholder",void 0),t([i({type:Boolean,reflect:!0})],c.prototype,"open",void 0),t([i({type:String,reflect:!0})],c.prototype,"value",void 0),t([i({type:Number,attribute:"max-placeholder-length"})],c.prototype,"maxPlaceholderLength",void 0),t([i({type:Boolean,attribute:"auto-close"})],c.prototype,"autoClose",void 0),t([i({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),c=t([s("nile-inline-edit")],c);export{c as N};