wj-elements 0.1.134 → 0.1.136

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 (319) hide show
  1. package/package.json +3 -2
  2. package/dist/dark.css +0 -223
  3. package/dist/infinite-scroll.element-XVJukzjy.js +0 -271
  4. package/dist/light.css +0 -530
  5. package/dist/list.element-Ce1vIm1O.js +0 -49
  6. package/dist/localize.js +0 -67
  7. package/dist/packages/index.d.ts +0 -98
  8. package/dist/packages/localize/localize.d.ts +0 -17
  9. package/dist/packages/translations/en-GB.d.ts +0 -13
  10. package/dist/packages/translations/sk-SK.d.ts +0 -13
  11. package/dist/packages/utils/animations.d.ts +0 -2
  12. package/dist/packages/utils/date.d.ts +0 -1
  13. package/dist/packages/utils/element-utils.d.ts +0 -46
  14. package/dist/packages/utils/event.d.ts +0 -67
  15. package/dist/packages/utils/localize.d.ts +0 -4
  16. package/dist/packages/utils/permissions-api.d.ts +0 -34
  17. package/dist/packages/utils/utils.d.ts +0 -1
  18. package/dist/packages/utils/wje-import-firefox.d.ts +0 -0
  19. package/dist/packages/utils/wje-import.d.ts +0 -0
  20. package/dist/packages/wje-accordion/accordion.d.ts +0 -2
  21. package/dist/packages/wje-accordion/accordion.element.d.ts +0 -72
  22. package/dist/packages/wje-accordion-item/accordion-item.d.ts +0 -2
  23. package/dist/packages/wje-accordion-item/accordion-item.element.d.ts +0 -40
  24. package/dist/packages/wje-animation/animation.d.ts +0 -2
  25. package/dist/packages/wje-animation/animation.element.d.ts +0 -153
  26. package/dist/packages/wje-animation/animation.test.d.ts +0 -1
  27. package/dist/packages/wje-aside/aside.d.ts +0 -2
  28. package/dist/packages/wje-aside/aside.element.d.ts +0 -31
  29. package/dist/packages/wje-avatar/avatar.d.ts +0 -2
  30. package/dist/packages/wje-avatar/avatar.element.d.ts +0 -37
  31. package/dist/packages/wje-avatar/service/service.d.ts +0 -40
  32. package/dist/packages/wje-badge/badge.d.ts +0 -2
  33. package/dist/packages/wje-badge/badge.element.d.ts +0 -35
  34. package/dist/packages/wje-badge/badge.test.d.ts +0 -1
  35. package/dist/packages/wje-breadcrumb/breadcrumb.d.ts +0 -2
  36. package/dist/packages/wje-breadcrumb/breadcrumb.element.d.ts +0 -80
  37. package/dist/packages/wje-breadcrumbs/breadcrumbs.d.ts +0 -2
  38. package/dist/packages/wje-breadcrumbs/breadcrumbs.element.d.ts +0 -97
  39. package/dist/packages/wje-breadcrumbs/breadcrumbs.test.d.ts +0 -1
  40. package/dist/packages/wje-button/button.d.ts +0 -2
  41. package/dist/packages/wje-button/button.element.d.ts +0 -173
  42. package/dist/packages/wje-button/button.test.d.ts +0 -1
  43. package/dist/packages/wje-button-group/button-group.d.ts +0 -2
  44. package/dist/packages/wje-button-group/button-group.element.d.ts +0 -39
  45. package/dist/packages/wje-card/card.d.ts +0 -2
  46. package/dist/packages/wje-card/card.element.d.ts +0 -29
  47. package/dist/packages/wje-card-content/card-content.d.ts +0 -2
  48. package/dist/packages/wje-card-content/card-content.element.d.ts +0 -22
  49. package/dist/packages/wje-card-controls/card-controls.d.ts +0 -2
  50. package/dist/packages/wje-card-controls/card-controls.element.d.ts +0 -23
  51. package/dist/packages/wje-card-header/card-header.d.ts +0 -2
  52. package/dist/packages/wje-card-header/card-header.element.d.ts +0 -22
  53. package/dist/packages/wje-card-subtitle/card-subtitle.d.ts +0 -2
  54. package/dist/packages/wje-card-subtitle/card-subtitle.element.d.ts +0 -30
  55. package/dist/packages/wje-card-title/card-title.d.ts +0 -2
  56. package/dist/packages/wje-card-title/card-title.element.d.ts +0 -32
  57. package/dist/packages/wje-carousel/carousel.d.ts +0 -2
  58. package/dist/packages/wje-carousel/carousel.element.d.ts +0 -146
  59. package/dist/packages/wje-carousel-item/carousel-item.d.ts +0 -2
  60. package/dist/packages/wje-carousel-item/carousel-item.element.d.ts +0 -38
  61. package/dist/packages/wje-checkbox/checkbox.d.ts +0 -2
  62. package/dist/packages/wje-checkbox/checkbox.element.d.ts +0 -171
  63. package/dist/packages/wje-chip/chip.d.ts +0 -2
  64. package/dist/packages/wje-chip/chip.element.d.ts +0 -29
  65. package/dist/packages/wje-col/col.d.ts +0 -2
  66. package/dist/packages/wje-col/col.element.d.ts +0 -16
  67. package/dist/packages/wje-color-picker/color-picker.d.ts +0 -2
  68. package/dist/packages/wje-color-picker/color-picker.element.d.ts +0 -187
  69. package/dist/packages/wje-container/container.d.ts +0 -2
  70. package/dist/packages/wje-container/container.element.d.ts +0 -31
  71. package/dist/packages/wje-copy-button/copy-button.d.ts +0 -2
  72. package/dist/packages/wje-copy-button/copy-button.element.d.ts +0 -89
  73. package/dist/packages/wje-copy-button/service/service.d.ts +0 -12
  74. package/dist/packages/wje-dialog/dialog.d.ts +0 -2
  75. package/dist/packages/wje-dialog/dialog.element.d.ts +0 -116
  76. package/dist/packages/wje-divider/divider.d.ts +0 -2
  77. package/dist/packages/wje-divider/divider.element.d.ts +0 -32
  78. package/dist/packages/wje-dropdown/dropdown.d.ts +0 -2
  79. package/dist/packages/wje-dropdown/dropdown.element.d.ts +0 -85
  80. package/dist/packages/wje-element/element.d.ts +0 -313
  81. package/dist/packages/wje-element/service/universal-service.d.ts +0 -18
  82. package/dist/packages/wje-file-upload/file-upload.d.ts +0 -2
  83. package/dist/packages/wje-file-upload/file-upload.element.d.ts +0 -191
  84. package/dist/packages/wje-file-upload/service/service.d.ts +0 -70
  85. package/dist/packages/wje-file-upload-item/file-upload-item.d.ts +0 -2
  86. package/dist/packages/wje-file-upload-item/file-upload-item.element.d.ts +0 -62
  87. package/dist/packages/wje-footer/footer.d.ts +0 -2
  88. package/dist/packages/wje-footer/footer.element.d.ts +0 -28
  89. package/dist/packages/wje-form/form.d.ts +0 -2
  90. package/dist/packages/wje-form/form.element.d.ts +0 -28
  91. package/dist/packages/wje-format-digital/format-digital.d.ts +0 -2
  92. package/dist/packages/wje-format-digital/format-digital.element.d.ts +0 -87
  93. package/dist/packages/wje-format-digital/format-digital.test.d.ts +0 -1
  94. package/dist/packages/wje-grid/grid.d.ts +0 -2
  95. package/dist/packages/wje-grid/grid.element.d.ts +0 -26
  96. package/dist/packages/wje-header/header.d.ts +0 -2
  97. package/dist/packages/wje-header/header.element.d.ts +0 -35
  98. package/dist/packages/wje-icon/icon.d.ts +0 -2
  99. package/dist/packages/wje-icon/icon.element.d.ts +0 -40
  100. package/dist/packages/wje-icon/service/service.d.ts +0 -11
  101. package/dist/packages/wje-icon-picker/icon-picker.d.ts +0 -2
  102. package/dist/packages/wje-icon-picker/icon-picker.element.d.ts +0 -197
  103. package/dist/packages/wje-img/img.d.ts +0 -2
  104. package/dist/packages/wje-img/img.element.d.ts +0 -30
  105. package/dist/packages/wje-img-comparer/img-comparer.d.ts +0 -2
  106. package/dist/packages/wje-img-comparer/img-comparer.element.d.ts +0 -60
  107. package/dist/packages/wje-img-comparer/service/service.d.ts +0 -1
  108. package/dist/packages/wje-infinite-scroll/infinite-scroll.d.ts +0 -2
  109. package/dist/packages/wje-infinite-scroll/infinite-scroll.element.d.ts +0 -134
  110. package/dist/packages/wje-input/input.d.ts +0 -2
  111. package/dist/packages/wje-input/input.element.d.ts +0 -204
  112. package/dist/packages/wje-input-file/input-file.d.ts +0 -2
  113. package/dist/packages/wje-input-file/input-file.element.d.ts +0 -50
  114. package/dist/packages/wje-item/item.d.ts +0 -2
  115. package/dist/packages/wje-item/item.element.d.ts +0 -68
  116. package/dist/packages/wje-kanban/kanban.d.ts +0 -2
  117. package/dist/packages/wje-kanban/kanban.element.d.ts +0 -183
  118. package/dist/packages/wje-label/label.d.ts +0 -2
  119. package/dist/packages/wje-label/label.element.d.ts +0 -34
  120. package/dist/packages/wje-list/list.d.ts +0 -2
  121. package/dist/packages/wje-list/list.element.d.ts +0 -31
  122. package/dist/packages/wje-main/main.d.ts +0 -2
  123. package/dist/packages/wje-main/main.element.d.ts +0 -30
  124. package/dist/packages/wje-masonry/masonry.d.ts +0 -2
  125. package/dist/packages/wje-masonry/masonry.element.d.ts +0 -114
  126. package/dist/packages/wje-masonry/service/service.d.ts +0 -32
  127. package/dist/packages/wje-menu/menu.d.ts +0 -2
  128. package/dist/packages/wje-menu/menu.element.d.ts +0 -47
  129. package/dist/packages/wje-menu-button/menu-button.d.ts +0 -2
  130. package/dist/packages/wje-menu-button/menu-button.element.d.ts +0 -34
  131. package/dist/packages/wje-menu-item/menu-item.d.ts +0 -2
  132. package/dist/packages/wje-menu-item/menu-item.element.d.ts +0 -139
  133. package/dist/packages/wje-menu-label/menu-label.d.ts +0 -2
  134. package/dist/packages/wje-menu-label/menu-label.element.d.ts +0 -39
  135. package/dist/packages/wje-option/option.d.ts +0 -2
  136. package/dist/packages/wje-option/option.element.d.ts +0 -59
  137. package/dist/packages/wje-options/options.d.ts +0 -2
  138. package/dist/packages/wje-options/options.element.d.ts +0 -180
  139. package/dist/packages/wje-orgchart/orgchart.d.ts +0 -2
  140. package/dist/packages/wje-orgchart/orgchart.element.d.ts +0 -24
  141. package/dist/packages/wje-orgchart-group/orgchart-group.d.ts +0 -2
  142. package/dist/packages/wje-orgchart-group/orgchart-group.element.d.ts +0 -28
  143. package/dist/packages/wje-orgchart-item/orgchart-item.d.ts +0 -2
  144. package/dist/packages/wje-orgchart-item/orgchart-item.element.d.ts +0 -49
  145. package/dist/packages/wje-panel/panel.d.ts +0 -2
  146. package/dist/packages/wje-panel/panel.element.d.ts +0 -34
  147. package/dist/packages/wje-popup/popup.d.ts +0 -2
  148. package/dist/packages/wje-popup/popup.element.d.ts +0 -93
  149. package/dist/packages/wje-progress-bar/progress-bar.d.ts +0 -2
  150. package/dist/packages/wje-progress-bar/progress-bar.element.d.ts +0 -96
  151. package/dist/packages/wje-qr-code/qr-code.d.ts +0 -2
  152. package/dist/packages/wje-qr-code/qr-code.element.d.ts +0 -33
  153. package/dist/packages/wje-radio/radio.d.ts +0 -2
  154. package/dist/packages/wje-radio/radio.element.d.ts +0 -53
  155. package/dist/packages/wje-radio-group/radio-group.d.ts +0 -2
  156. package/dist/packages/wje-radio-group/radio-group.element.d.ts +0 -137
  157. package/dist/packages/wje-rate/rate.d.ts +0 -2
  158. package/dist/packages/wje-rate/rate.element.d.ts +0 -156
  159. package/dist/packages/wje-relative-time/relative-time.d.ts +0 -2
  160. package/dist/packages/wje-relative-time/relative-time.element.d.ts +0 -55
  161. package/dist/packages/wje-relative-time/relative-time.test.d.ts +0 -1
  162. package/dist/packages/wje-reorder/reorder.d.ts +0 -2
  163. package/dist/packages/wje-reorder/reorder.element.d.ts +0 -119
  164. package/dist/packages/wje-reorder-dropzone/reorder-dropzone.d.ts +0 -2
  165. package/dist/packages/wje-reorder-dropzone/reorder-dropzone.element.d.ts +0 -23
  166. package/dist/packages/wje-reorder-handle/reorder-handle.d.ts +0 -2
  167. package/dist/packages/wje-reorder-handle/reorder-handle.element.d.ts +0 -75
  168. package/dist/packages/wje-reorder-item/reorder-item.d.ts +0 -2
  169. package/dist/packages/wje-reorder-item/reorder-item.element.d.ts +0 -24
  170. package/dist/packages/wje-route/route.d.ts +0 -2
  171. package/dist/packages/wje-route/route.element.d.ts +0 -22
  172. package/dist/packages/wje-router/router.d.ts +0 -2
  173. package/dist/packages/wje-router/router.element.d.ts +0 -39
  174. package/dist/packages/wje-router-link/router-link.d.ts +0 -2
  175. package/dist/packages/wje-router-link/router-link.element.d.ts +0 -31
  176. package/dist/packages/wje-router-outlet/router-outlet.d.ts +0 -2
  177. package/dist/packages/wje-router-outlet/router-outlet.element.d.ts +0 -15
  178. package/dist/packages/wje-row/row.d.ts +0 -2
  179. package/dist/packages/wje-row/row.element.d.ts +0 -23
  180. package/dist/packages/wje-select/select.d.ts +0 -2
  181. package/dist/packages/wje-select/select.element.d.ts +0 -315
  182. package/dist/packages/wje-slider/slider.d.ts +0 -2
  183. package/dist/packages/wje-slider/slider.element.d.ts +0 -103
  184. package/dist/packages/wje-split-view/service/service.d.ts +0 -1
  185. package/dist/packages/wje-split-view/split-view.d.ts +0 -2
  186. package/dist/packages/wje-split-view/split-view.element.d.ts +0 -66
  187. package/dist/packages/wje-status/status.d.ts +0 -2
  188. package/dist/packages/wje-status/status.element.d.ts +0 -26
  189. package/dist/packages/wje-step/step.d.ts +0 -2
  190. package/dist/packages/wje-step/step.element.d.ts +0 -23
  191. package/dist/packages/wje-stepper/stepper.d.ts +0 -2
  192. package/dist/packages/wje-stepper/stepper.element.d.ts +0 -78
  193. package/dist/packages/wje-store/default-store-actions.d.ts +0 -20
  194. package/dist/packages/wje-store/pubsub.d.ts +0 -21
  195. package/dist/packages/wje-store/store.d.ts +0 -153
  196. package/dist/packages/wje-tab/tab.d.ts +0 -2
  197. package/dist/packages/wje-tab/tab.element.d.ts +0 -41
  198. package/dist/packages/wje-tab-group/tab-group.d.ts +0 -2
  199. package/dist/packages/wje-tab-group/tab-group.element.d.ts +0 -67
  200. package/dist/packages/wje-tab-panel/tab-panel.d.ts +0 -2
  201. package/dist/packages/wje-tab-panel/tab-panel.element.d.ts +0 -23
  202. package/dist/packages/wje-textarea/textarea.d.ts +0 -2
  203. package/dist/packages/wje-textarea/textarea.element.d.ts +0 -176
  204. package/dist/packages/wje-thumbnail/thumbnail.d.ts +0 -2
  205. package/dist/packages/wje-thumbnail/thumbnail.element.d.ts +0 -31
  206. package/dist/packages/wje-timeline/timeline.d.ts +0 -2
  207. package/dist/packages/wje-timeline/timeline.element.d.ts +0 -25
  208. package/dist/packages/wje-timeline-item/timeline-item.d.ts +0 -2
  209. package/dist/packages/wje-timeline-item/timeline-item.element.d.ts +0 -27
  210. package/dist/packages/wje-toast/toast.d.ts +0 -2
  211. package/dist/packages/wje-toast/toast.element.d.ts +0 -173
  212. package/dist/packages/wje-toast/toast.test.d.ts +0 -1
  213. package/dist/packages/wje-toggle/toggle.d.ts +0 -2
  214. package/dist/packages/wje-toggle/toggle.element.d.ts +0 -65
  215. package/dist/packages/wje-toolbar/toolbar.d.ts +0 -2
  216. package/dist/packages/wje-toolbar/toolbar.element.d.ts +0 -39
  217. package/dist/packages/wje-toolbar-action/toolbar-action.d.ts +0 -2
  218. package/dist/packages/wje-toolbar-action/toolbar-action.element.d.ts +0 -35
  219. package/dist/packages/wje-tooltip/tooltip.d.ts +0 -2
  220. package/dist/packages/wje-tooltip/tooltip.element.d.ts +0 -71
  221. package/dist/packages/wje-visually-hidden/visually-hidden.d.ts +0 -2
  222. package/dist/packages/wje-visually-hidden/visually-hidden.element.d.ts +0 -29
  223. package/dist/popup.element-tyYxow0p.js +0 -1622
  224. package/dist/router-links-CJnOdbas.js +0 -149
  225. package/dist/styles.css +0 -849
  226. package/dist/wje-accordion-item.js +0 -112
  227. package/dist/wje-accordion.js +0 -121
  228. package/dist/wje-animation.js +0 -4323
  229. package/dist/wje-aside.js +0 -54
  230. package/dist/wje-avatar.js +0 -89
  231. package/dist/wje-badge.js +0 -70
  232. package/dist/wje-breadcrumb.js +0 -194
  233. package/dist/wje-breadcrumbs.js +0 -139
  234. package/dist/wje-button-group.js +0 -84
  235. package/dist/wje-button.js +0 -351
  236. package/dist/wje-card-content.js +0 -47
  237. package/dist/wje-card-controls.js +0 -47
  238. package/dist/wje-card-header.js +0 -47
  239. package/dist/wje-card-subtitle.js +0 -54
  240. package/dist/wje-card-title.js +0 -54
  241. package/dist/wje-card.js +0 -55
  242. package/dist/wje-carousel-item.js +0 -62
  243. package/dist/wje-carousel.js +0 -379
  244. package/dist/wje-checkbox.js +0 -539
  245. package/dist/wje-chip.js +0 -75
  246. package/dist/wje-col.js +0 -37
  247. package/dist/wje-color-picker.js +0 -1338
  248. package/dist/wje-container.js +0 -55
  249. package/dist/wje-copy-button.js +0 -217
  250. package/dist/wje-dialog.js +0 -248
  251. package/dist/wje-divider.js +0 -54
  252. package/dist/wje-dropdown.js +0 -193
  253. package/dist/wje-element.js +0 -966
  254. package/dist/wje-fetchAndParseCSS.js +0 -59
  255. package/dist/wje-file-upload-item.js +0 -133
  256. package/dist/wje-file-upload.js +0 -546
  257. package/dist/wje-footer.js +0 -51
  258. package/dist/wje-form.js +0 -52
  259. package/dist/wje-format-digital.js +0 -145
  260. package/dist/wje-grid.js +0 -53
  261. package/dist/wje-header.js +0 -55
  262. package/dist/wje-icon-picker.js +0 -348
  263. package/dist/wje-icon.js +0 -190
  264. package/dist/wje-img-comparer.js +0 -130
  265. package/dist/wje-img.js +0 -71
  266. package/dist/wje-infinite-scroll.js +0 -5
  267. package/dist/wje-input-file.js +0 -110
  268. package/dist/wje-input.js +0 -451
  269. package/dist/wje-item.js +0 -87
  270. package/dist/wje-kanban.js +0 -461
  271. package/dist/wje-label.js +0 -52
  272. package/dist/wje-list.js +0 -5
  273. package/dist/wje-main.js +0 -51
  274. package/dist/wje-masonry.js +0 -266
  275. package/dist/wje-master.js +0 -342
  276. package/dist/wje-menu-button.js +0 -59
  277. package/dist/wje-menu-item.js +0 -544
  278. package/dist/wje-menu-label.js +0 -54
  279. package/dist/wje-menu.js +0 -71
  280. package/dist/wje-option.js +0 -111
  281. package/dist/wje-options.js +0 -341
  282. package/dist/wje-orgchart-group.js +0 -71
  283. package/dist/wje-orgchart-item.js +0 -97
  284. package/dist/wje-orgchart.js +0 -48
  285. package/dist/wje-popup.js +0 -5
  286. package/dist/wje-progress-bar.js +0 -212
  287. package/dist/wje-qr-code.js +0 -2891
  288. package/dist/wje-radio-group.js +0 -227
  289. package/dist/wje-radio.js +0 -105
  290. package/dist/wje-rate.js +0 -299
  291. package/dist/wje-relative-time.js +0 -114
  292. package/dist/wje-reorder-dropzone.js +0 -48
  293. package/dist/wje-reorder-handle.js +0 -217
  294. package/dist/wje-reorder-item.js +0 -60
  295. package/dist/wje-reorder.js +0 -280
  296. package/dist/wje-route.js +0 -42
  297. package/dist/wje-router-link.js +0 -63
  298. package/dist/wje-router-outlet.js +0 -191
  299. package/dist/wje-routerx.js +0 -1436
  300. package/dist/wje-row.js +0 -48
  301. package/dist/wje-select.js +0 -629
  302. package/dist/wje-slider.js +0 -220
  303. package/dist/wje-sliding-container.js +0 -477
  304. package/dist/wje-split-view.js +0 -152
  305. package/dist/wje-status.js +0 -60
  306. package/dist/wje-step.js +0 -49
  307. package/dist/wje-stepper.js +0 -230
  308. package/dist/wje-store.js +0 -387
  309. package/dist/wje-tab-group.js +0 -136
  310. package/dist/wje-tab-panel.js +0 -45
  311. package/dist/wje-tab.js +0 -58
  312. package/dist/wje-textarea.js +0 -372
  313. package/dist/wje-thumbnail.js +0 -53
  314. package/dist/wje-toast.js +0 -333
  315. package/dist/wje-toggle.js +0 -124
  316. package/dist/wje-toolbar-action.js +0 -71
  317. package/dist/wje-toolbar.js +0 -62
  318. package/dist/wje-tooltip.js +0 -165
  319. package/dist/wje-visually-hidden.js +0 -54
@@ -1,372 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import WJElement, { event } from "./wje-element.js";
5
- const styles = "/*\n[ WJ Textarea ]\n*/\n\n:host {\n width: 100%;\n margin-bottom: var(--wje-textarea-margin-bottom);\n display: block;\n .wrapper {\n display: flex;\n width: 100%;\n border-width: var(--wje-textarea-border-width);\n border-style: var(--wje-textarea-border-style);\n border-color: var(--wje-textarea-border-color);\n border-radius: var(--wje-textarea-border-radius);\n box-sizing: border-box;\n }\n textarea {\n font-family: var(--wje-textarea-font-family);\n color: var(--wje-textarea-color);\n font-size: 14px;\n border: 0 none;\n padding: 0 var(--wje-textarea-padding);\n &:focus {\n outline: none;\n }\n }\n}\n\n:host([invalid]) {\n .error-message {\n display: block;\n }\n .default {\n label {\n opacity: 1 !important;\n color: var(--wje-input-color-invalid) !important;\n animation-name: shake;\n animation-duration: 0.4s;\n animation-iteration-count: 1;\n }\n }\n}\n\n:host([required]) .input-wrapper::after {\n color: var(--wje-input-color-invalid);\n content: '*';\n font-family: var(--wje-force-mac-font-family);\n font-size: 20px;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n:host([required]) .standard .input-wrapper::after {\n top: 0;\n}\n\n:host([resize='auto']) textarea,\n:host([resize='none']) textarea {\n resize: none;\n}\n\n.native-textarea {\n .input-wrapper {\n width: 100%;\n line-height: normal;\n }\n &.default {\n background-color: var(--wje-textarea-background-color);\n font-family: var(--wje-textarea-font-family);\n position: relative;\n padding-inline: 0;\n padding-top: 0;\n transition: background-color 0.2s ease;\n cursor: text;\n &.focused {\n .wrapper {\n border-color: var(--wje-textarea-border-color-focus) !important;\n }\n label {\n opacity: 0.67;\n font-size: 12px;\n letter-spacing: normal;\n }\n }\n textarea {\n border: none;\n padding-top: 0;\n background: none;\n box-shadow: none;\n width: calc(100% - var(--wje-textarea-padding) * 2);\n max-width: calc(100% - var(--wje-textarea-padding) * 2);\n min-width: calc(100% - var(--wje-textarea-padding) * 2);\n }\n label {\n padding: 0 var(--wje-textarea-padding);\n display: block;\n opacity: 1;\n cursor: text;\n transition: opacity 0.2s ease;\n line-height: var(--wje-textarea-line-height);\n padding-top: 0.25rem;\n &.fade {\n opacity: 0.5;\n font-size: 12px;\n letter-spacing: normal;\n }\n }\n ::slotted([slot='start']) {\n border-left: none;\n border-top: none;\n border-bottom: none;\n }\n\n ::slotted([slot='end']) {\n border-right: none;\n border-top: none;\n border-bottom: none;\n }\n }\n &.standard {\n font-family: var(--wje-textarea-font-family);\n position: relative;\n border-radius: var(--wje-textarea-border-radius);\n padding: 0;\n transition: background-color 0.2s ease;\n cursor: text;\n &.focused {\n .wrapper {\n border-color: var(--wje-textarea-border-color-focus) !important;\n }\n }\n textarea {\n background-color: var(--wje-textarea-background-color);\n display: block;\n min-height: 32px;\n box-shadow: none;\n width: 100%;\n box-sizing: border-box;\n border-radius: var(--wje-textarea-border-radius);\n }\n label {\n margin: 0;\n display: inline-block;\n opacity: 1;\n cursor: text;\n transition: opacity 0.2s ease;\n line-height: var(--wje-textarea-line-height);\n }\n ::slotted([slot='start']) {\n border-right: none;\n border-radius: var(--wje-textarea-border-radius) 0 0 var(--wje-textarea-border-radius);\n }\n\n ::slotted([slot='end']) {\n border-left: none;\n border-radius: 0 var(--wje-textarea-border-radius) var(--wje-textarea-border-radius) 0;\n }\n\n &.has-start textarea {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n\n &.has-end textarea {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n .error-message {\n position: static;\n background: transparent;\n padding: 0.25rem 0;\n left: auto;\n transform: none;\n color: var(--wje-textarea-color-invalid);\n font-size: 12px;\n line-height: normal;\n }\n }\n}\n\n.counter {\n float: right;\n}\n\n@keyframes shake {\n 8%,\n 41% {\n transform: translateX(-4px);\n }\n 25%,\n 58% {\n transform: translateX(4px);\n }\n 75% {\n transform: translateX(-2px);\n }\n 92% {\n transform: translateX(2px);\n }\n 0%,\n 100% {\n transform: translateX(0);\n }\n}\n";
6
- class Textarea extends WJElement {
7
- /**
8
- * Creates an instance of Textarea.
9
- * @class
10
- */
11
- constructor() {
12
- super();
13
- __publicField(this, "observeFunction", (mutations) => {
14
- mutations.forEach((mutation) => {
15
- if (mutation.type === "attributes") {
16
- const attributeName = mutation.attributeName;
17
- const oldValue = mutation.oldValue;
18
- const newValue = this.getAttribute(attributeName);
19
- console.log(`Attribute ${attributeName} changed from ${oldValue} to ${newValue}`);
20
- }
21
- });
22
- this.refresh();
23
- });
24
- __publicField(this, "className", "Textarea");
25
- /**
26
- * Sets the height of the textarea.
27
- */
28
- __publicField(this, "setTextareaHeight", () => {
29
- if (this.getAttribute("resize") === "auto") {
30
- this.input.style.height = "auto";
31
- this.input.style.height = this.input.scrollHeight + "px";
32
- }
33
- });
34
- /**
35
- * Updates the counter for the textarea.
36
- * @param {Event} e The event object.
37
- */
38
- __publicField(this, "counterFn", (e) => {
39
- this.counterElement.innerText = e.target.value.length + "/" + this.input.maxLength;
40
- });
41
- this.invalid = false;
42
- this.pristine = true;
43
- this.internals = this.attachInternals();
44
- this.observer = new MutationObserver(this.observeFunction);
45
- }
46
- /**
47
- * Setter for the value attribute.
48
- * @param {string} value The value to set.
49
- */
50
- set value(value) {
51
- this.internals.setFormValue(value);
52
- if (this.input) this.input.value = value;
53
- this.pristine = false;
54
- this._value = value;
55
- }
56
- /**
57
- * Getter for the value attribute.
58
- * @returns {string} The value of the attribute.
59
- */
60
- get value() {
61
- var _a;
62
- return ((_a = this.input) == null ? void 0 : _a.value) ?? this._value ?? "";
63
- }
64
- /**
65
- * Getter for the invalid attribute.
66
- * @returns {boolean} Whether the attribute is present.
67
- */
68
- get invalid() {
69
- return this.hasAttribute("invalid");
70
- }
71
- /**
72
- * Setter for the invalid attribute.
73
- * @param {boolean} isInvalid Whether the input is invalid.
74
- */
75
- set invalid(isInvalid) {
76
- if (isInvalid) this.setAttribute("invalid", "");
77
- else this.removeAttribute("invalid");
78
- }
79
- /**
80
- * Getter for the form attribute.
81
- * @returns {HTMLFormElement} The form the input is associated with.
82
- */
83
- get form() {
84
- return this.internals.form;
85
- }
86
- /**
87
- * Getter for the name attribute.
88
- * @returns {string} The name of the input.
89
- */
90
- get name() {
91
- return this.getAttribute("name");
92
- }
93
- /**
94
- * Getter for the type attribute.
95
- * @returns {string} The type of the input.
96
- */
97
- get type() {
98
- return this.localName;
99
- }
100
- /**
101
- * Getter for the validity attribute.
102
- * @returns {ValidityState} The validity state of the input.
103
- */
104
- get validity() {
105
- return this.internals.validity;
106
- }
107
- /**
108
- * Getter for the validationMessage attribute.
109
- * @returns {string} The validation message of the input.
110
- */
111
- get validationMessage() {
112
- return this.internals.validationMessage;
113
- }
114
- /**
115
- * Getter for the willValidate attribute.
116
- * @returns {boolean} Whether the input will be validated.
117
- */
118
- get willValidate() {
119
- return this.internals.willValidate;
120
- }
121
- /**
122
- * Returns the CSS styles for the component.
123
- * @static
124
- * @returns {CSSStyleSheet} The CSS stylesheet
125
- */
126
- static get cssStyleSheet() {
127
- return styles;
128
- }
129
- /**
130
- * Returns the list of attributes to observe for changes.
131
- * @static
132
- * @returns {Array<string>}
133
- */
134
- static get observedAttributes() {
135
- return [];
136
- }
137
- set placeholder(value) {
138
- this.setAttribute("placeholder", value);
139
- }
140
- get placeholder() {
141
- return this.getAttribute("placeholder");
142
- }
143
- /**
144
- * Sets up the attributes for the component.
145
- */
146
- setupAttributes() {
147
- this.isShadowRoot = "open";
148
- if (this.pristine) {
149
- this.value = this.innerHTML;
150
- this.pristine = false;
151
- }
152
- }
153
- beforeDraw() {
154
- this.observer.disconnect();
155
- }
156
- /**
157
- * Draws the component for the textarea.
158
- * @returns {DocumentFragment}
159
- */
160
- draw() {
161
- let fragment = document.createDocumentFragment();
162
- let native = document.createElement("div");
163
- native.classList.add("native-textarea", this.variant || "default");
164
- native.setAttribute("part", "native");
165
- if (this.hasAttribute("invalid")) native.classList.add("has-error");
166
- let wrapper = document.createElement("div");
167
- wrapper.setAttribute("part", "wrapper");
168
- wrapper.classList.add("wrapper");
169
- let inputWrapper = document.createElement("div");
170
- inputWrapper.classList.add("input-wrapper");
171
- let label = document.createElement("label");
172
- label.htmlFor = "textarea";
173
- label.innerHTML = this.label || "";
174
- let input = document.createElement("textarea");
175
- input.id = "textarea";
176
- input.name = this.name;
177
- input.disabled = this.hasAttribute("disabled");
178
- input.innerText = this.value;
179
- input.placeholder = this.placeholder || "";
180
- input.classList.add("form-control");
181
- input.setAttribute("part", "input");
182
- input.setAttribute("rows", this.rows || 3);
183
- input.setAttribute("spellcheck", false);
184
- const attributes = Array.from(this.attributes).map((attr) => attr.name);
185
- attributes.forEach((attr) => {
186
- if (this.hasAttribute(attr)) {
187
- input.setAttribute(attr, this[attr] || "");
188
- }
189
- });
190
- if (this.resize === "auto") input.addEventListener("input", this.setTextareaHeight);
191
- if (this.variant === "standard") {
192
- if (this.label) native.appendChild(label);
193
- } else {
194
- inputWrapper.appendChild(label);
195
- }
196
- inputWrapper.appendChild(input);
197
- wrapper.appendChild(inputWrapper);
198
- native.appendChild(wrapper);
199
- fragment.appendChild(native);
200
- if (this.hasAttribute("counter")) {
201
- input.maxLength = this.maxLength || 1e3;
202
- input.addEventListener("input", this.counterFn);
203
- let counter = document.createElement("div");
204
- counter.classList.add("counter");
205
- counter.innerText = `${input.value.length}/${input.maxLength}`;
206
- this.counterElement = counter;
207
- fragment.appendChild(counter);
208
- }
209
- this.native = native;
210
- this.labelElement = label;
211
- this.input = input;
212
- return fragment;
213
- }
214
- /**
215
- * Sets up the event listeners after the component is drawn.
216
- */
217
- afterDraw() {
218
- this.resizeObserver = new ResizeObserver(() => this.setTextareaHeight);
219
- if (!this.hasAttribute("disabled")) {
220
- event.addListener(this, "click", "wje:textarea:change");
221
- event.addListener(this, "click", "wje:textarea:input");
222
- }
223
- this.input.addEventListener("focus", (e) => {
224
- this.labelElement.classList.add("fade");
225
- this.native.classList.add("focused");
226
- });
227
- this.input.addEventListener("blur", (e) => {
228
- this.native.classList.remove("focused");
229
- if (!e.target.value) this.labelElement.classList.remove("fade");
230
- });
231
- this.addEventListener("invalid", (e) => {
232
- this.invalid = true;
233
- this.pristine = false;
234
- this.showInvalidMessage();
235
- if (this.customErrorDisplay) {
236
- e.preventDefault();
237
- }
238
- });
239
- this.input.addEventListener("input", (e) => {
240
- this.validateInput();
241
- if (this.validateOnChange) {
242
- this.pristine = false;
243
- this.propagateValidation();
244
- }
245
- this.input.classList.remove("pristine");
246
- this.labelElement.classList.add("fade");
247
- const clone = new e.constructor(e.type, e);
248
- this.dispatchEvent(clone);
249
- event.dispatchCustomEvent(this, "wje-textarea:input", {
250
- value: this.input.value
251
- });
252
- this.value = this.input.value;
253
- });
254
- this.validateInput();
255
- this.observer.observe(this, {
256
- attributes: true,
257
- // Watch for attribute changes
258
- attributeOldValue: true
259
- // Keep track of the old value of attributes
260
- });
261
- }
262
- componentCleanup() {
263
- this.observer.disconnect();
264
- }
265
- /**
266
- * Disconnects the component.
267
- */
268
- beforeDisconnect() {
269
- this.resizeObserver.unobserve(this.input);
270
- }
271
- /**
272
- * @summary Validates the input.
273
- * This method checks the validity state of the input. If the input is not valid, it iterates over the validity state object.
274
- * For each invalid state, it constructs an attribute name and checks if the input has this attribute.
275
- * If the input has the attribute, it sets the validation error to the state and the error message to the attribute value.
276
- * If the input does not have the attribute, it sets the error message to the default validation message of the input.
277
- * It then sets the validity in the form internals to an object with the validation error as key and true as value, and the error message.
278
- * If the input is valid, it sets the validity in the form internals to an empty object.
279
- */
280
- validateInput() {
281
- const validState = this.input.validity;
282
- if (!validState.valid) {
283
- for (let state in validState) {
284
- const attr = `message-${state.toString()}`;
285
- if (validState[state]) {
286
- this.validationError = state.toString();
287
- let errorMessage = this.message;
288
- if (!this.hasAttribute("message"))
289
- errorMessage = this.hasAttribute(attr) ? this.getAttribute(attr) : this.input.validationMessage;
290
- this.internals.setValidity({ [this.validationError]: true }, errorMessage);
291
- }
292
- }
293
- } else {
294
- this.internals.setValidity({});
295
- }
296
- }
297
- /**
298
- * @summary Propagates the validation state of the input.
299
- * This method sets the 'invalid' property of the input based on its 'pristine' state and its internal validity state.
300
- * If the input is invalid and the 'customErrorDisplay' property is true, it dispatches an 'invalid' event.
301
- */
302
- propagateValidation() {
303
- this.invalid = !this.pristine && !this.internals.validity.valid;
304
- if (this.invalid && this.customErrorDisplay) {
305
- this.dispatchEvent(new Event("invalid"));
306
- }
307
- }
308
- /**
309
- * @summary Callback function that is called when the custom element is associated with a form.
310
- * This function adds an event listener to the form's submit event, which validates the input and propagates the validation.
311
- * @param {HTMLFormElement} form The form the custom element is associated with.
312
- */
313
- formAssociatedCallback(form) {
314
- this.internals.setFormValue(this.value);
315
- form == null ? void 0 : form.addEventListener("submit", () => {
316
- this.validateInput();
317
- this.propagateValidation();
318
- });
319
- }
320
- /**
321
- * The formResetCallback method is a built-in lifecycle callback that gets called when a form gets reset.
322
- * This method is responsible for resetting the value of the custom input element to its default value.
323
- * It also resets the form value and validity state in the form internals.
324
- * @function
325
- */
326
- formResetCallback() {
327
- this.value = this.defaultValue;
328
- this.internals.setFormValue(this.defaultValue);
329
- this.internals.setValidity({});
330
- }
331
- /**
332
- * The formStateRestoreCallback method is a built-in lifecycle callback that gets called when the state of a form-associated custom element is restored.
333
- * This method is responsible for restoring the value of the custom input element to its saved state.
334
- * It also restores the form value and validity state in the form internals to their saved states.
335
- * @param {object} state The saved state of the custom input element.
336
- * @function
337
- */
338
- formStateRestoreCallback(state) {
339
- this.value = state.value;
340
- this.internals.setFormValue(state.value);
341
- this.internals.setValidity({});
342
- }
343
- /**
344
- * The formStateSaveCallback method is a built-in lifecycle callback that gets called when the state of a form-associated custom element is saved.
345
- * This method is responsible for saving the value of the custom input element.
346
- * @returns {object} The saved state of the custom input element.
347
- * @function
348
- */
349
- formStateSaveCallback() {
350
- return {
351
- value: this.value
352
- };
353
- }
354
- /**
355
- * The formDisabledCallback method is a built-in lifecycle callback that gets called when the disabled state of a form-associated custom element changes.
356
- * This method is not implemented yet.
357
- * @param {boolean} disabled The new disabled state of the custom input element.
358
- * @function
359
- */
360
- formDisabledCallback(disabled) {
361
- console.warn("formDisabledCallback not implemented yet");
362
- }
363
- }
364
- /**
365
- * Whether the input is associated with a form.
366
- * @type {boolean}
367
- */
368
- __publicField(Textarea, "formAssociated", true);
369
- Textarea.define("wje-textarea", Textarea);
370
- export {
371
- Textarea as default
372
- };
@@ -1,53 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import WJElement from "./wje-element.js";
5
- const styles = "/*\n[ WJ Thumbnail ]\n*/\n\n:host {\n width: var(--wje-thumbnail-width);\n height: var(--wje-thumbnail-height);\n display: block;\n border-radius: var(--wje-border-radius);\n}\n\n:host([circle]) ::slotted(img) {\n border-radius: 50%;\n}\n::slotted(wje-img),\n::slotted(img) {\n border-radius: var(--wje-thumbnail-border-radius);\n width: 100%;\n height: 100%;\n object-fit: cover;\n overflow: hidden;\n}\n";
6
- class Thumbnail extends WJElement {
7
- /**
8
- * Creates an instance of Thumbnail.
9
- */
10
- constructor() {
11
- super();
12
- /**
13
- * The class name for the component
14
- */
15
- __publicField(this, "className", "Thumbnail");
16
- }
17
- /**
18
- * Returns the CSS stylesheet for the component.
19
- * @static
20
- * @returns {CSSStyleSheet} The CSS stylesheet
21
- */
22
- static get cssStyleSheet() {
23
- return styles;
24
- }
25
- /**
26
- * Returns the list of observed attributes.
27
- * @static
28
- * @returns {Array} An empty array
29
- */
30
- static get observedAttributes() {
31
- return [];
32
- }
33
- /**
34
- * Sets up the attributes for the component.
35
- */
36
- setupAttributes() {
37
- this.isShadowRoot = "open";
38
- }
39
- /**
40
- * Draws the component for the thumbnail.
41
- * @returns {object} Document fragment
42
- */
43
- draw() {
44
- let fragment = document.createDocumentFragment();
45
- let element = document.createElement("slot");
46
- fragment.appendChild(element);
47
- return fragment;
48
- }
49
- }
50
- Thumbnail.define("wje-thumbnail", Thumbnail);
51
- export {
52
- Thumbnail as default
53
- };