wj-elements 0.7.7 → 0.8.0

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 (233) hide show
  1. package/dist/animations.js +28 -51
  2. package/dist/animations.js.map +1 -1
  3. package/dist/base-path.js +19 -31
  4. package/dist/base-path.js.map +1 -1
  5. package/dist/custom-elements.json +11504 -11499
  6. package/dist/dark.css +1 -302
  7. package/dist/date.js +16 -36
  8. package/dist/date.js.map +1 -1
  9. package/dist/element-utils.js +20 -81
  10. package/dist/element-utils.js.map +1 -1
  11. package/dist/event.js +49 -165
  12. package/dist/event.js.map +1 -1
  13. package/dist/form-associated-element-BjeJn7j8.js +101 -0
  14. package/dist/{form-associated-element-DEQ4y-jn.js.map → form-associated-element-BjeJn7j8.js.map} +1 -1
  15. package/dist/icon-DmsqtDpL.js +102 -0
  16. package/dist/{icon-CReYMzAK.js.map → icon-DmsqtDpL.js.map} +1 -1
  17. package/dist/light.css +1 -731
  18. package/dist/localize.js +36 -111
  19. package/dist/localize.js.map +1 -1
  20. package/dist/packages/wje-accordion-item/accordion-item.element.d.ts +3 -2
  21. package/dist/permissions.js +14 -41
  22. package/dist/permissions.js.map +1 -1
  23. package/dist/popup.element-CbkhthPP.js +806 -0
  24. package/dist/{popup.element-CwXvVFK7.js.map → popup.element-CbkhthPP.js.map} +1 -1
  25. package/dist/router-links-CNsJ-elb.js +105 -0
  26. package/dist/{router-links-wjqCnncc.js.map → router-links-CNsJ-elb.js.map} +1 -1
  27. package/dist/skeleton.css +1 -197
  28. package/dist/styles.css +1 -866
  29. package/dist/universal-service.js +48 -109
  30. package/dist/universal-service.js.map +1 -1
  31. package/dist/utils.js +11 -18
  32. package/dist/utils.js.map +1 -1
  33. package/dist/web-types.json +760 -760
  34. package/dist/wje-accordion-item.js +33 -106
  35. package/dist/wje-accordion-item.js.map +1 -1
  36. package/dist/wje-accordion.js +19 -84
  37. package/dist/wje-accordion.js.map +1 -1
  38. package/dist/wje-animation.js +37 -4258
  39. package/dist/wje-animation.js.map +1 -1
  40. package/dist/wje-aside.js +9 -34
  41. package/dist/wje-aside.js.map +1 -1
  42. package/dist/wje-avatar.js +36 -126
  43. package/dist/wje-avatar.js.map +1 -1
  44. package/dist/wje-badge.js +10 -52
  45. package/dist/wje-badge.js.map +1 -1
  46. package/dist/wje-breadcrumb.js +205 -672
  47. package/dist/wje-breadcrumb.js.map +1 -1
  48. package/dist/wje-breadcrumbs.js +177 -633
  49. package/dist/wje-breadcrumbs.js.map +1 -1
  50. package/dist/wje-button-group.js +48 -153
  51. package/dist/wje-button-group.js.map +1 -1
  52. package/dist/wje-button.js +92 -413
  53. package/dist/wje-button.js.map +1 -1
  54. package/dist/wje-card-content.js +7 -30
  55. package/dist/wje-card-content.js.map +1 -1
  56. package/dist/wje-card-controls.js +7 -30
  57. package/dist/wje-card-controls.js.map +1 -1
  58. package/dist/wje-card-header.js +7 -30
  59. package/dist/wje-card-header.js.map +1 -1
  60. package/dist/wje-card-subtitle.js +7 -34
  61. package/dist/wje-card-subtitle.js.map +1 -1
  62. package/dist/wje-card-title.js +7 -34
  63. package/dist/wje-card-title.js.map +1 -1
  64. package/dist/wje-card.js +15 -71
  65. package/dist/wje-card.js.map +1 -1
  66. package/dist/wje-carousel-item.js +12 -56
  67. package/dist/wje-carousel-item.js.map +1 -1
  68. package/dist/wje-carousel.js +154 -509
  69. package/dist/wje-carousel.js.map +1 -1
  70. package/dist/wje-checkbox.js +50 -227
  71. package/dist/wje-checkbox.js.map +1 -1
  72. package/dist/wje-chip.js +43 -160
  73. package/dist/wje-chip.js.map +1 -1
  74. package/dist/wje-col.js +7 -20
  75. package/dist/wje-col.js.map +1 -1
  76. package/dist/wje-color-picker.js +445 -1464
  77. package/dist/wje-color-picker.js.map +1 -1
  78. package/dist/wje-container.js +9 -35
  79. package/dist/wje-container.js.map +1 -1
  80. package/dist/wje-copy-button.js +64 -204
  81. package/dist/wje-copy-button.js.map +1 -1
  82. package/dist/wje-dialog.js +85 -553
  83. package/dist/wje-dialog.js.map +1 -1
  84. package/dist/wje-divider.js +7 -34
  85. package/dist/wje-divider.js.map +1 -1
  86. package/dist/wje-dropdown.js +78 -305
  87. package/dist/wje-dropdown.js.map +1 -1
  88. package/dist/wje-element.js +191 -700
  89. package/dist/wje-element.js.map +1 -1
  90. package/dist/wje-file-upload-item.js +51 -156
  91. package/dist/wje-file-upload-item.js.map +1 -1
  92. package/dist/wje-file-upload.js +181 -619
  93. package/dist/wje-file-upload.js.map +1 -1
  94. package/dist/wje-footer.js +7 -31
  95. package/dist/wje-footer.js.map +1 -1
  96. package/dist/wje-form.js +7 -32
  97. package/dist/wje-form.js.map +1 -1
  98. package/dist/wje-format-digital.js +26 -118
  99. package/dist/wje-format-digital.js.map +1 -1
  100. package/dist/wje-grid.js +7 -33
  101. package/dist/wje-grid.js.map +1 -1
  102. package/dist/wje-header.js +9 -35
  103. package/dist/wje-header.js.map +1 -1
  104. package/dist/wje-icon-library.js +12 -18
  105. package/dist/wje-icon-library.js.map +1 -1
  106. package/dist/wje-icon-picker.js +65 -320
  107. package/dist/wje-icon-picker.js.map +1 -1
  108. package/dist/wje-icon.js +1 -1
  109. package/dist/wje-img-comparer.js +37 -114
  110. package/dist/wje-img-comparer.js.map +1 -1
  111. package/dist/wje-img.js +50 -198
  112. package/dist/wje-img.js.map +1 -1
  113. package/dist/wje-infinite-scroll.js +94 -346
  114. package/dist/wje-infinite-scroll.js.map +1 -1
  115. package/dist/wje-input-file.js +23 -84
  116. package/dist/wje-input-file.js.map +1 -1
  117. package/dist/wje-input.js +78 -392
  118. package/dist/wje-input.js.map +1 -1
  119. package/dist/wje-item.js +11 -64
  120. package/dist/wje-item.js.map +1 -1
  121. package/dist/wje-kanban.js +124 -401
  122. package/dist/wje-kanban.js.map +1 -1
  123. package/dist/wje-label.js +9 -32
  124. package/dist/wje-label.js.map +1 -1
  125. package/dist/wje-level-indicator.js +38 -157
  126. package/dist/wje-level-indicator.js.map +1 -1
  127. package/dist/wje-list.js +10 -40
  128. package/dist/wje-list.js.map +1 -1
  129. package/dist/wje-main.js +7 -31
  130. package/dist/wje-main.js.map +1 -1
  131. package/dist/wje-masonry.js +66 -211
  132. package/dist/wje-masonry.js.map +1 -1
  133. package/dist/wje-master.js +45 -161
  134. package/dist/wje-master.js.map +1 -1
  135. package/dist/wje-menu-button.js +10 -38
  136. package/dist/wje-menu-button.js.map +1 -1
  137. package/dist/wje-menu-item.js +127 -577
  138. package/dist/wje-menu-item.js.map +1 -1
  139. package/dist/wje-menu-label.js +9 -35
  140. package/dist/wje-menu-label.js.map +1 -1
  141. package/dist/wje-menu.js +14 -49
  142. package/dist/wje-menu.js.map +1 -1
  143. package/dist/wje-option.js +48 -279
  144. package/dist/wje-option.js.map +1 -1
  145. package/dist/wje-options.js +130 -384
  146. package/dist/wje-options.js.map +1 -1
  147. package/dist/wje-orgchart-group.js +16 -52
  148. package/dist/wje-orgchart-group.js.map +1 -1
  149. package/dist/wje-orgchart-item.js +24 -93
  150. package/dist/wje-orgchart-item.js.map +1 -1
  151. package/dist/wje-orgchart.js +18 -68
  152. package/dist/wje-orgchart.js.map +1 -1
  153. package/dist/wje-pagination.js +113 -397
  154. package/dist/wje-pagination.js.map +1 -1
  155. package/dist/wje-popup.js +3 -3
  156. package/dist/wje-popup.js.map +1 -1
  157. package/dist/wje-progress-bar.js +53 -205
  158. package/dist/wje-progress-bar.js.map +1 -1
  159. package/dist/wje-qr-code.js +398 -2980
  160. package/dist/wje-qr-code.js.map +1 -1
  161. package/dist/wje-radio-group.js +52 -190
  162. package/dist/wje-radio-group.js.map +1 -1
  163. package/dist/wje-radio.js +24 -118
  164. package/dist/wje-radio.js.map +1 -1
  165. package/dist/wje-rate.js +62 -266
  166. package/dist/wje-rate.js.map +1 -1
  167. package/dist/wje-relative-time.js +24 -99
  168. package/dist/wje-relative-time.js.map +1 -1
  169. package/dist/wje-reorder-dropzone.js +9 -31
  170. package/dist/wje-reorder-dropzone.js.map +1 -1
  171. package/dist/wje-reorder-handle.js +67 -204
  172. package/dist/wje-reorder-handle.js.map +1 -1
  173. package/dist/wje-reorder-item.js +14 -44
  174. package/dist/wje-reorder-item.js.map +1 -1
  175. package/dist/wje-reorder.js +61 -246
  176. package/dist/wje-reorder.js.map +1 -1
  177. package/dist/wje-route.js +6 -24
  178. package/dist/wje-route.js.map +1 -1
  179. package/dist/wje-router-link.js +11 -39
  180. package/dist/wje-router-link.js.map +1 -1
  181. package/dist/wje-router-outlet.js +76 -172
  182. package/dist/wje-router-outlet.js.map +1 -1
  183. package/dist/wje-routerx.js +537 -1331
  184. package/dist/wje-routerx.js.map +1 -1
  185. package/dist/wje-row.js +9 -31
  186. package/dist/wje-row.js.map +1 -1
  187. package/dist/wje-select.js +326 -1152
  188. package/dist/wje-select.js.map +1 -1
  189. package/dist/wje-slider.js +44 -225
  190. package/dist/wje-slider.js.map +1 -1
  191. package/dist/wje-sliding-container.js +295 -1319
  192. package/dist/wje-sliding-container.js.map +1 -1
  193. package/dist/wje-split-view.js +35 -121
  194. package/dist/wje-split-view.js.map +1 -1
  195. package/dist/wje-status.js +14 -45
  196. package/dist/wje-status.js.map +1 -1
  197. package/dist/wje-step.js +9 -32
  198. package/dist/wje-step.js.map +1 -1
  199. package/dist/wje-stepper.js +109 -357
  200. package/dist/wje-stepper.js.map +1 -1
  201. package/dist/wje-store.js +67 -360
  202. package/dist/wje-store.js.map +1 -1
  203. package/dist/wje-tab-group.js +85 -314
  204. package/dist/wje-tab-group.js.map +1 -1
  205. package/dist/wje-tab-panel.js +7 -28
  206. package/dist/wje-tab-panel.js.map +1 -1
  207. package/dist/wje-tab.js +21 -198
  208. package/dist/wje-tab.js.map +1 -1
  209. package/dist/wje-textarea.js +64 -264
  210. package/dist/wje-textarea.js.map +1 -1
  211. package/dist/wje-thumbnail.js +10 -51
  212. package/dist/wje-thumbnail.js.map +1 -1
  213. package/dist/wje-toast.js +127 -632
  214. package/dist/wje-toast.js.map +1 -1
  215. package/dist/wje-toggle.js +52 -177
  216. package/dist/wje-toggle.js.map +1 -1
  217. package/dist/wje-toolbar-action.js +128 -456
  218. package/dist/wje-toolbar-action.js.map +1 -1
  219. package/dist/wje-toolbar.js +75 -270
  220. package/dist/wje-toolbar.js.map +1 -1
  221. package/dist/wje-tooltip.js +50 -161
  222. package/dist/wje-tooltip.js.map +1 -1
  223. package/dist/wje-tree-item.js +70 -301
  224. package/dist/wje-tree-item.js.map +1 -1
  225. package/dist/wje-tree.js +145 -489
  226. package/dist/wje-tree.js.map +1 -1
  227. package/dist/wje-visually-hidden.js +7 -34
  228. package/dist/wje-visually-hidden.js.map +1 -1
  229. package/package.json +3 -2
  230. package/dist/form-associated-element-DEQ4y-jn.js +0 -245
  231. package/dist/icon-CReYMzAK.js +0 -245
  232. package/dist/popup.element-CwXvVFK7.js +0 -2133
  233. package/dist/router-links-wjqCnncc.js +0 -156
package/dist/wje-input.js CHANGED
@@ -7,454 +7,140 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
7
7
  var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
8
8
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
9
9
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
10
- var _Input_instances, syncNativeAttribute_fn;
11
- import { F as FormAssociatedElement } from "./form-associated-element-DEQ4y-jn.js";
12
- import { event } from "./event.js";
13
- const styles = "/*\n[ WJ Input ]\n*/\n\n:host {\n --wje-input-clear-size: 1.625rem;\n --wje-input-clear-gap: 0.5rem;\n width: 100%;\n margin-bottom: var(--wje-input-margin-bottom);\n display: block;\n label {\n margin: var(--wje-input-label-margin);\n padding: var(--wje-input-label-padding);\n display: var(--wje-input-label-display);\n opacity: 1;\n cursor: text;\n transition: opacity 0.2s ease;\n line-height: var(--wje-input-label-line-height);\n font-size: var(--wje-input-label-font-size);\n }\n .wrapper {\n display: grid;\n grid-template-columns: auto 1fr auto;\n width: 100%;\n > .input-wrapper {\n grid-column: 2;\n }\n }\n .native-input {\n .input-wrapper {\n display: block;\n width: 100%;\n position: relative;\n box-sizing: border-box;\n\n label {\n width: 100%;\n }\n }\n &.default {\n background-color: var(--wje-input-background-color);\n font-family: var(--wje-input-font-family);\n position: relative;\n border-radius: var(--wje-input-border-radius);\n border-width: var(--wje-input-border-width);\n border-style: var(--wje-input-border-style);\n border-color: var(--wje-input-border-color);\n padding-inline: 0;\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n transition: background-color 0.2s ease;\n cursor: text;\n .input-wrapper {\n padding-inline: 0.5rem;\n }\n &.focused {\n border-color: var(--wje-input-border-color-focus) !important;\n label {\n opacity: 0.67;\n font-size: 12px;\n letter-spacing: normal;\n }\n }\n input {\n border: none;\n height: 25px;\n min-height: 25px;\n padding: 0;\n margin-top: -4px;\n background: none;\n box-shadow: none;\n width: 100%;\n }\n label {\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-input-font-family);\n position: relative;\n border-radius: var(--wje-input-border-radius);\n padding-inline: 0;\n padding-top: 0;\n padding-bottom: 0;\n transition: background-color 0.2s ease;\n cursor: text;\n &.focused {\n input {\n border-color: var(--wje-input-border-color-focus) !important;\n }\n }\n input {\n background-color: var(--wje-input-background-color);\n display: block;\n min-height: 32px;\n padding-inline: 0.5rem;\n padding-top: 0;\n padding-bottom: 0;\n /*background: none;*/\n box-shadow: none;\n width: 100%;\n box-sizing: border-box;\n border-radius: var(--wje-input-border-radius);\n border-width: var(--wje-input-border-width);\n border-style: var(--wje-input-border-style);\n border-color: var(--wje-input-border-color);\n }\n .input-wrapper {\n flex-wrap: nowrap;\n &:hover .clear {\n visibility: visible;\n }\n }\n ::slotted([slot='start']) {\n border-right: none;\n border-radius: var(--wje-input-border-radius) 0 0 var(--wje-input-border-radius);\n }\n\n ::slotted([slot='end']) {\n border-left: none;\n border-radius: 0 var(--wje-input-border-radius) var(--wje-input-border-radius) 0;\n }\n\n &.has-start input {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n\n &.has-end input {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n slot[name='error'] {\n position: static;\n\n background: transparent;\n padding: 0.25rem 0;\n left: auto;\n transform: none;\n color: var(--wje-input-color-invalid);\n font-size: 12px;\n line-height: normal;\n }\n }\n }\n}\n\n:host([type=hidden]) {\n margin: 0;\n .native-input {\n padding: 0;\n border-width: 0;\n }\n}\n\n.clear {\n visibility: hidden;\n position: absolute;\n right: var(--wje-input-clear-inline-end, 0);\n top: 3px;\n --wje-padding-top: 0.25rem;\n --wje-padding-start: 0.25rem;\n --wje-padding-end: 0.25rem;\n --wje-padding-bottom: 0.25rem;\n --wje-button-margin-inline: 0 0.25rem;\n}\n\n:host([clearable]) .native-input.focused .clear,\n:host([clearable]) .input-wrapper:hover .clear {\n visibility: visible;\n}\n\n:host([clearable][type='number']) .clear {\n right: var(--wje-input-number-control-width, 1.75rem);\n}\n\n:host([required]) .wrapper::after {\n color: var(--wje-input-color-invalid);\n content: var(--wje-input-required-symbol);\n font-size: 24px;\n position: absolute;\n right: 12px;\n top: 0;\n}\n\n:host([required]) .standard .input-wrapper::after {\n right: 13px;\n top: -20px;\n}\n\n:host([invalid]) {\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::slotted([slot='start']),\n::slotted([slot='end']) {\n display: flex;\n align-items: center;\n border-width: var(--wje-input-border-width);\n border-style: var(--wje-input-border-style);\n border-color: var(--wje-input-border-color);\n padding-inline: var(--wje-input-slot-padding-inline);\n}\n\n:host(.options-show) ::slotted([slot='start']) {\n border-bottom-left-radius: 0 !important;\n}\n\n:host(.options-show) ::slotted([slot='end']) {\n border-bottom-right-radius: 0 !important;\n}\n\nslot[name='start'],\nslot[name='end'] {\n display: flex;\n}\n\nslot[name='error'] {\n display: none;\n}\n\n:host([invalid]) slot[name='error'] {\n display: block;\n}\n\n:host([disabled]) input {\n opacity: 0.5;\n}\n\ninput {\n background-color: var(--wje-input-background-color);\n border-width: var(--wje-input-border-width);\n border-style: var(--wje-input-border-style);\n border-color: var(--wje-input-border-color);\n color: var(--wje-input-color);\n appearance: none;\n outline: 0;\n padding: 0.25rem 0.5rem;\n line-height: var(--wje-input-line-height);\n font-size: 14px;\n font-weight: normal;\n vertical-align: middle;\n min-height: 32px;\n}\n\n:host([clearable]) .native-input input {\n box-sizing: border-box;\n padding-inline-end: calc(var(--wje-input-clear-inline-end, 0px) + var(--wje-input-clear-size) + var(--wje-input-clear-gap));\n}\n\n:host([clearable][type='number']) .native-input input {\n padding-inline-end: calc(var(--wje-input-number-control-width, 1.75rem) + var(--wje-input-clear-size) + var(--wje-input-clear-gap));\n}\n\nslot[name='error'] {\n display: none;\n position: absolute;\n max-width: 100%;\n min-width: auto;\n border-radius: 50px;\n background-color: var(--wje-input-error-background-color, var(--wje-tooltip-background));\n padding: 0.25rem 0.5rem;\n top: 0;\n left: 50%;\n transform: translate(-50%, -50%);\n color: var(--wje-input-error-color, var(--wje-tooltip-color));\n font-size: var(--wje-font-size-small);\n width: max-content;\n line-height: normal;\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";
14
- const _Input = class _Input extends FormAssociatedElement {
15
- /**
16
- * Creates an instance of Input.
17
- */
10
+ var _i_instances, t_fn;
11
+ import { F as t } from "./form-associated-element-BjeJn7j8.js";
12
+ import { event as e } from "./event.js";
13
+ const _i = class _i extends t {
18
14
  constructor() {
19
15
  super();
20
- __privateAdd(this, _Input_instances);
21
- /**
22
- * The class name of the input element.
23
- * @type {string}
24
- */
16
+ __privateAdd(this, _i_instances);
25
17
  __publicField(this, "className", "Input");
26
- this.invalid = false;
27
- this.pristine = true;
28
- this._instanceId = ++_Input._instanceId;
18
+ this.invalid = false, this.pristine = true, this._instanceId = ++_i._instanceId;
29
19
  }
30
- /**
31
- * Setter for the value attribute.
32
- * @param {string} value The value to set.
33
- */
34
- set value(value) {
35
- value = value ?? "";
36
- this.internals.setFormValue(value);
37
- if (this.input && this.input.value !== value) this.input.value = value;
38
- this.pristine = false;
39
- this._value = value;
40
- this.syncAria();
20
+ set value(t2) {
21
+ t2 = t2 ?? "", this.internals.setFormValue(t2), this.input && this.input.value !== t2 && (this.input.value = t2), this.pristine = false, this._value = t2, this.syncAria();
41
22
  }
42
- /**
43
- * Retrieves the value from the input element if available; otherwise,
44
- * returns the internal _value property or an empty string as the default.
45
- * @returns {string} The current value from the input element, the internal _value, or an empty string.
46
- */
47
23
  get value() {
48
24
  var _a;
49
25
  return ((_a = this.input) == null ? void 0 : _a.value) ?? this._value ?? "";
50
26
  }
51
- /**
52
- * Sets the label attribute of the element.
53
- * @param {string} value The value to set as the label attribute.
54
- */
55
- set label(value) {
56
- this.setAttribute("label", value);
27
+ set label(t2) {
28
+ this.setAttribute("label", t2);
57
29
  }
58
- /**
59
- * Retrieves the value of the 'label' attribute if it exists.
60
- * If the 'label' attribute is not set, it returns false.
61
- * @returns {string|boolean} The value of the 'label' attribute as a string, or false if the attribute is not set.
62
- */
63
30
  get label() {
64
31
  return this.getAttribute("label") || false;
65
32
  }
66
- /**
67
- * Sets the custom error display attribute for an element.
68
- * @param {boolean} value If true, adds the 'custom-error-display' attribute to the element. If false, removes the attribute from the element.
69
- */
70
- set customErrorDisplay(value) {
71
- if (value) {
72
- this.setAttribute("custom-error-display", "");
73
- } else {
74
- this.removeAttribute("custom-error-display");
75
- }
33
+ set customErrorDisplay(t2) {
34
+ t2 ? this.setAttribute("custom-error-display", "") : this.removeAttribute("custom-error-display");
76
35
  }
77
- /**
78
- * Getter for the customErrorDisplay attribute.
79
- * @returns {boolean} Whether the attribute is present.
80
- */
81
36
  get customErrorDisplay() {
82
37
  return this.hasAttribute("custom-error-display");
83
38
  }
84
- /**
85
- * Sets the `validateOnChange` property. If set to a truthy value, it adds the
86
- * `validate-on-change` attribute to the element. If set to a falsy value, it
87
- * removes the `validate-on-change` attribute from the element.
88
- * @param {boolean} value Determines whether to add or remove the
89
- * `validate-on-change` attribute. A truthy value adds the attribute, whereas a
90
- * falsy value removes it.
91
- */
92
- set validateOnChange(value) {
93
- if (value) {
94
- this.setAttribute("validate-on-change", "");
95
- } else {
96
- this.removeAttribute("validate-on-change");
97
- }
39
+ set validateOnChange(t2) {
40
+ t2 ? this.setAttribute("validate-on-change", "") : this.removeAttribute("validate-on-change");
98
41
  }
99
- /**
100
- * Getter for the validateOnChange attribute.
101
- * @returns {boolean} Whether the attribute is present.
102
- */
103
42
  get validateOnChange() {
104
43
  return this.hasAttribute("validate-on-change");
105
44
  }
106
- /**
107
- * @summary Getter for the defaultValue attribute.
108
- * This method retrieves the 'value' attribute of the custom input element.
109
- * The 'value' attribute represents the default value of the input element.
110
- * If the 'value' attribute is not set, it returns an empty string.
111
- * @returns {string} The default value of the input element.
112
- */
113
45
  get defaultValue() {
114
46
  return this.getAttribute("value") ?? "";
115
47
  }
116
- /**
117
- * @summary Setter for the defaultValue attribute.
118
- * This method sets the 'value' attribute of the custom input element to the provided value.
119
- * The 'value' attribute represents the default value of the input element.
120
- * @param {string} value The value to set as the default value.
121
- */
122
- set defaultValue(value) {
123
- this.setAttribute("value", value);
48
+ set defaultValue(t2) {
49
+ this.setAttribute("value", t2);
124
50
  }
125
- /**
126
- * Sets or removes the 'clearable' attribute on the element.
127
- * When set to a truthy value, the 'clearable' attribute is added; when falsy, the attribute is removed.
128
- * @param {boolean} value Determines whether to set or remove the 'clearable' attribute. If true, the 'clearable' attribute is added. If false, it is removed.
129
- */
130
- set clearable(value) {
131
- if (value) {
132
- this.setAttribute("clearable", "");
133
- } else {
134
- this.removeAttribute("clearable");
135
- }
51
+ set clearable(t2) {
52
+ t2 ? this.setAttribute("clearable", "") : this.removeAttribute("clearable");
136
53
  }
137
- /**
138
- * Checks if the 'clearable' attribute is present on the element.
139
- * @returns {boolean} True if the 'clearable' attribute is set, otherwise false.
140
- */
141
54
  get clearable() {
142
55
  return this.hasAttribute("clearable");
143
56
  }
144
- /**
145
- * Sets the placeholder value for an element. If the provided value is non-empty,
146
- * it assigns the value to the "placeholder" attribute. Otherwise, it removes
147
- * the "placeholder" attribute from the element.
148
- * @param {string} value The placeholder text to set or null/undefined to remove the attribute.
149
- */
150
- set placeholder(value) {
151
- if (value) {
152
- this.setAttribute("placeholder", value);
153
- } else {
154
- this.removeAttribute("placeholder");
155
- }
57
+ set placeholder(t2) {
58
+ t2 ? this.setAttribute("placeholder", t2) : this.removeAttribute("placeholder");
156
59
  }
157
- /**
158
- * Retrieves the value of the 'placeholder' attribute from the element.
159
- * If the attribute is not set, it returns an empty string.
160
- * @returns {string} The value of the 'placeholder' attribute or an empty string if not set.
161
- */
162
60
  get placeholder() {
163
61
  return this.getAttribute("placeholder") || "";
164
62
  }
165
- /**
166
- * Sets the `variant` attribute on the element. If a value is provided, it will set the attribute to the given value.
167
- * If no value is provided, it removes the `variant` attribute from the element.
168
- * @param {string} value The value to set for the `variant` attribute. If falsy, the attribute is removed.
169
- */
170
- set variant(value) {
171
- if (value) {
172
- this.setAttribute("variant", value);
173
- } else {
174
- this.removeAttribute("variant");
175
- }
63
+ set variant(t2) {
64
+ t2 ? this.setAttribute("variant", t2) : this.removeAttribute("variant");
176
65
  }
177
- /**
178
- * Retrieves the value of the 'variant' attribute from the element.
179
- * If the attribute is not set, it defaults to 'default'.
180
- * @returns {string} The value of the 'variant' attribute or 'default' if not set.
181
- */
182
66
  get variant() {
183
67
  return this.getAttribute("variant") || "default";
184
68
  }
185
- /**
186
- * Getter for the cssStyleSheet attribute.
187
- * @returns {CSSStyleSheet} The CSS style sheet of the input element.
188
- */
189
69
  static get cssStyleSheet() {
190
- return styles;
70
+ return ':host{--wje-input-clear-size: 1.625rem;--wje-input-clear-gap: .5rem;width:100%;margin-bottom:var(--wje-input-margin-bottom);display:block}:host label{margin:var(--wje-input-label-margin);padding:var(--wje-input-label-padding);display:var(--wje-input-label-display);opacity:1;cursor:text;transition:opacity .2s ease;line-height:var(--wje-input-label-line-height);font-size:var(--wje-input-label-font-size)}:host .wrapper{display:grid;grid-template-columns:auto 1fr auto;width:100%}:host .wrapper>.input-wrapper{grid-column:2}:host .native-input .input-wrapper{display:block;width:100%;position:relative;box-sizing:border-box}:host .native-input .input-wrapper label{width:100%}:host .native-input.default{background-color:var(--wje-input-background-color);font-family:var(--wje-input-font-family);position:relative;border-radius:var(--wje-input-border-radius);border-width:var(--wje-input-border-width);border-style:var(--wje-input-border-style);border-color:var(--wje-input-border-color);padding-inline:0;padding-top:.25rem;padding-bottom:.25rem;transition:background-color .2s ease;cursor:text}:host .native-input.default .input-wrapper{padding-inline:.5rem}:host .native-input.default.focused{border-color:var(--wje-input-border-color-focus)!important}:host .native-input.default.focused label{opacity:.67;font-size:12px;letter-spacing:normal}:host .native-input.default input{border:none;height:25px;min-height:25px;padding:0;margin-top:-4px;background:none;box-shadow:none;width:100%}:host .native-input.default label.fade{opacity:.5;font-size:12px;letter-spacing:normal}:host .native-input.default ::slotted([slot="start"]){border-left:none;border-top:none;border-bottom:none}:host .native-input.default ::slotted([slot="end"]){border-right:none;border-top:none;border-bottom:none}:host .native-input.standard{font-family:var(--wje-input-font-family);position:relative;border-radius:var(--wje-input-border-radius);padding-inline:0;padding-top:0;padding-bottom:0;transition:background-color .2s ease;cursor:text}:host .native-input.standard.focused input{border-color:var(--wje-input-border-color-focus)!important}:host .native-input.standard input{background-color:var(--wje-input-background-color);display:block;min-height:32px;padding-inline:.5rem;padding-top:0;padding-bottom:0;box-shadow:none;width:100%;box-sizing:border-box;border-radius:var(--wje-input-border-radius);border-width:var(--wje-input-border-width);border-style:var(--wje-input-border-style);border-color:var(--wje-input-border-color)}:host .native-input.standard .input-wrapper{flex-wrap:nowrap}:host .native-input.standard .input-wrapper:hover .clear{visibility:visible}:host .native-input.standard ::slotted([slot="start"]){border-right:none;border-radius:var(--wje-input-border-radius) 0 0 var(--wje-input-border-radius)}:host .native-input.standard ::slotted([slot="end"]){border-left:none;border-radius:0 var(--wje-input-border-radius) var(--wje-input-border-radius) 0}:host .native-input.standard.has-start input{border-top-left-radius:0;border-bottom-left-radius:0}:host .native-input.standard.has-end input{border-top-right-radius:0;border-bottom-right-radius:0}:host .native-input.standard slot[name=error]{position:static;background:transparent;padding:.25rem 0;left:auto;transform:none;color:var(--wje-input-color-invalid);font-size:12px;line-height:normal}:host([type=hidden]){margin:0}:host([type=hidden]) .native-input{padding:0;border-width:0}.clear{visibility:hidden;position:absolute;right:var(--wje-input-clear-inline-end, 0);top:3px;--wje-padding-top: .25rem;--wje-padding-start: .25rem;--wje-padding-end: .25rem;--wje-padding-bottom: .25rem;--wje-button-margin-inline: 0 .25rem}:host([clearable]) .native-input.focused .clear,:host([clearable]) .input-wrapper:hover .clear{visibility:visible}:host([clearable][type="number"]) .clear{right:var(--wje-input-number-control-width, 1.75rem)}:host([required]) .wrapper:after{color:var(--wje-input-color-invalid);content:var(--wje-input-required-symbol);font-size:24px;position:absolute;right:12px;top:0}:host([required]) .standard .input-wrapper:after{right:13px;top:-20px}:host([invalid]) .default label{opacity:1!important;color:var(--wje-input-color-invalid)!important;animation-name:shake;animation-duration:.4s;animation-iteration-count:1}::slotted([slot="start"]),::slotted([slot="end"]){display:flex;align-items:center;border-width:var(--wje-input-border-width);border-style:var(--wje-input-border-style);border-color:var(--wje-input-border-color);padding-inline:var(--wje-input-slot-padding-inline)}:host(.options-show) ::slotted([slot="start"]){border-bottom-left-radius:0!important}:host(.options-show) ::slotted([slot="end"]){border-bottom-right-radius:0!important}slot[name=start],slot[name=end]{display:flex}slot[name=error]{display:none}:host([invalid]) slot[name=error]{display:block}:host([disabled]) input{opacity:.5}input{background-color:var(--wje-input-background-color);border-width:var(--wje-input-border-width);border-style:var(--wje-input-border-style);border-color:var(--wje-input-border-color);color:var(--wje-input-color);-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:0;padding:.25rem .5rem;line-height:var(--wje-input-line-height);font-size:14px;font-weight:400;vertical-align:middle;min-height:32px}:host([clearable]) .native-input input{box-sizing:border-box;padding-inline-end:calc(var(--wje-input-clear-inline-end, 0px) + var(--wje-input-clear-size) + var(--wje-input-clear-gap))}:host([clearable][type="number"]) .native-input input{padding-inline-end:calc(var(--wje-input-number-control-width, 1.75rem) + var(--wje-input-clear-size) + var(--wje-input-clear-gap))}slot[name=error]{display:none;position:absolute;max-width:100%;min-width:auto;border-radius:50px;background-color:var(--wje-input-error-background-color, var(--wje-tooltip-background));padding:.25rem .5rem;top:0;left:50%;transform:translate(-50%,-50%);color:var(--wje-input-error-color, var(--wje-tooltip-color));font-size:var(--wje-font-size-small);width:max-content;line-height:normal}@keyframes shake{8%,41%{transform:translate(-4px)}25%,58%{transform:translate(4px)}75%{transform:translate(-2px)}92%{transform:translate(2px)}0%,to{transform:translate(0)}}';
191
71
  }
192
- /**
193
- * Getter for the observedAttributes attribute of the input element.
194
- * @returns {Array} The attributes to observe for changes.
195
- */
196
72
  static get observedAttributes() {
197
- return [
198
- "type",
199
- "value",
200
- "name",
201
- "disabled",
202
- "placeholder",
203
- "label",
204
- "message",
205
- "error-inline",
206
- "required",
207
- "readonly",
208
- "invalid",
209
- "min",
210
- "max",
211
- "step",
212
- "inputmode"
213
- ];
73
+ return ["type", "value", "name", "disabled", "placeholder", "label", "message", "error-inline", "required", "readonly", "invalid", "min", "max", "step", "inputmode"];
214
74
  }
215
- /**
216
- * Sets up the attributes for the input.
217
- */
218
75
  setupAttributes() {
219
- this.isShadowRoot = "open";
220
- if (this.pristine) {
221
- this.value = this.defaultValue;
222
- this.pristine = false;
223
- }
224
- this.syncAria();
76
+ this.isShadowRoot = "open", this.pristine && (this.value = this.defaultValue, this.pristine = false), this.syncAria();
225
77
  }
226
- attributeChangedCallback(name, oldValue, newValue) {
78
+ attributeChangedCallback(t2, e2, i2) {
227
79
  var _a, _b;
228
- if (oldValue === newValue) return;
229
- const labelVisibilityChanged = Boolean(oldValue) !== Boolean(newValue);
230
- if (name === "label" && labelVisibilityChanged) {
231
- (_a = super.attributeChangedCallback) == null ? void 0 : _a.call(this, name, oldValue, newValue);
232
- return;
233
- }
234
- if (!this.input) {
235
- this.syncAria();
236
- return;
237
- }
238
- if (name === "value") {
239
- this._value = newValue ?? "";
240
- if (this.input.value !== this._value) this.input.value = this._value;
241
- this.internals.setFormValue(this._value);
242
- } else if (name === "type") {
243
- this.input.type = this.getAttribute("type") || "text";
244
- } else if (name === "name") {
245
- this.input.name = this.name;
246
- } else if (name === "disabled") {
247
- this.input.disabled = this.disabled;
248
- } else if (name === "required") {
249
- this.input.required = this.required;
250
- } else if (name === "readonly") {
251
- this.input.readOnly = this.hasAttribute("readonly");
252
- } else if (name === "placeholder") {
253
- this.input.placeholder = this.placeholder;
254
- } else if (["min", "max", "step", "inputmode"].includes(name)) {
255
- __privateMethod(this, _Input_instances, syncNativeAttribute_fn).call(this, name, newValue);
256
- } else if (name === "label") {
257
- if (this.labelElement) this.labelElement.innerText = this.label || "";
258
- } else if (name === "invalid") {
259
- (_b = this.native) == null ? void 0 : _b.classList.toggle("has-error", this.invalid);
260
- if (this.invalid && this.validationMessage) {
261
- this.showInvalidMessage();
262
- } else if (!this.invalid && this.errorMessage) {
263
- this.errorMessage.textContent = "";
264
- }
265
- }
266
- this.syncAria();
80
+ if (e2 === i2) return;
81
+ const r = Boolean(e2) !== Boolean(i2);
82
+ "label" === t2 && r ? (_a = super.attributeChangedCallback) == null ? void 0 : _a.call(this, t2, e2, i2) : this.input ? ("value" === t2 ? (this._value = i2 ?? "", this.input.value !== this._value && (this.input.value = this._value), this.internals.setFormValue(this._value)) : "type" === t2 ? this.input.type = this.getAttribute("type") || "text" : "name" === t2 ? this.input.name = this.name : "disabled" === t2 ? this.input.disabled = this.disabled : "required" === t2 ? this.input.required = this.required : "readonly" === t2 ? this.input.readOnly = this.hasAttribute("readonly") : "placeholder" === t2 ? this.input.placeholder = this.placeholder : ["min", "max", "step", "inputmode"].includes(t2) ? __privateMethod(this, _i_instances, t_fn).call(this, t2, i2) : "label" === t2 ? this.labelElement && (this.labelElement.innerText = this.label || "") : "invalid" === t2 && ((_b = this.native) == null ? void 0 : _b.classList.toggle("has-error", this.invalid), this.invalid && this.validationMessage ? this.showInvalidMessage() : !this.invalid && this.errorMessage && (this.errorMessage.textContent = "")), this.syncAria()) : this.syncAria();
267
83
  }
268
- /**
269
- * Draws the input element.
270
- * @returns {DocumentFragment} The drawn input.
271
- */
272
84
  draw() {
273
- let hasSlotStart = this.hasSlot(this, "start");
274
- let hasSlotEnd = this.hasSlot(this, "end");
85
+ let t2 = this.hasSlot(this, "start"), e2 = this.hasSlot(this, "end");
275
86
  this.hasSlot(this, "error");
276
- let fragment = document.createDocumentFragment();
277
- let native = document.createElement("div");
278
- native.setAttribute("part", "native");
279
- native.classList.add("native-input", this.variant);
280
- if (this.invalid) native.classList.add("has-error");
281
- let wrapper = document.createElement("div");
282
- wrapper.classList.add("wrapper");
283
- let inputWrapper = document.createElement("div");
284
- inputWrapper.setAttribute("part", "wrapper");
285
- inputWrapper.classList.add("input-wrapper");
286
- let label = document.createElement("label");
287
- label.setAttribute("part", "label");
288
- label.innerText = this.label;
289
- if (this.value && !this.hasAttribute("error")) label.classList.add("fade");
290
- let input = document.createElement("input");
291
- input.setAttribute("type", "text");
292
- input.setAttribute("part", "input");
293
- input.setAttribute("value", this.value || "");
294
- input.classList.add("form-control");
295
- const attributes = Array.from(this.attributes).map((attr) => attr.name);
296
- attributes.forEach((attr) => {
297
- if (this.hasAttribute(attr)) {
298
- input.setAttribute(attr, this[attr] || "");
299
- }
87
+ let i2 = document.createDocumentFragment(), r = document.createElement("div");
88
+ r.setAttribute("part", "native"), r.classList.add("native-input", this.variant), this.invalid && r.classList.add("has-error");
89
+ let a = document.createElement("div");
90
+ a.classList.add("wrapper");
91
+ let n = document.createElement("div");
92
+ n.setAttribute("part", "wrapper"), n.classList.add("input-wrapper");
93
+ let s = document.createElement("label");
94
+ s.setAttribute("part", "label"), s.innerText = this.label, this.value && !this.hasAttribute("error") && s.classList.add("fade");
95
+ let o = document.createElement("input");
96
+ o.setAttribute("type", "text"), o.setAttribute("part", "input"), o.setAttribute("value", this.value || ""), o.classList.add("form-control");
97
+ Array.from(this.attributes).map((t3) => t3.name).forEach((t3) => {
98
+ this.hasAttribute(t3) && o.setAttribute(t3, this[t3] || "");
300
99
  });
301
- let errorSlot = document.createElement("slot");
302
- errorSlot.setAttribute("name", "error");
303
- errorSlot.setAttribute("part", "error-slot");
304
- this._ariaErrorId = this.id ? `${this.id}-error` : `wje-input-${this._instanceId}-error`;
305
- errorSlot.id = this._ariaErrorId;
306
- let error = document.createElement("div");
307
- error.setAttribute("slot", "error");
308
- let start = null;
309
- if (hasSlotStart) {
310
- start = document.createElement("slot");
311
- start.setAttribute("name", "start");
312
- start.setAttribute("part", "start");
313
- }
314
- let end = null;
315
- if (hasSlotEnd) {
316
- end = document.createElement("slot");
317
- end.setAttribute("name", "end");
318
- end.setAttribute("part", "end");
319
- }
320
- if (hasSlotStart) {
321
- wrapper.appendChild(start);
322
- native.classList.add("has-start");
323
- }
324
- if (this.label) {
325
- if (this.variant === "standard") {
326
- native.append(label);
327
- } else {
328
- inputWrapper.appendChild(label);
329
- }
330
- }
331
- inputWrapper.appendChild(input);
332
- wrapper.appendChild(inputWrapper);
333
- native.appendChild(wrapper);
334
- native.append(errorSlot);
335
- this.append(error);
336
- if (this.clearable) {
337
- this.clear = document.createElement("wje-button");
338
- this.clear.classList.add("clear");
339
- this.clear.setAttribute("fill", "link");
340
- this.clear.setAttribute("part", "clear");
341
- let clearIcon = document.createElement("wje-icon");
342
- clearIcon.setAttribute("name", "x");
343
- this.clear.appendChild(clearIcon);
344
- inputWrapper.appendChild(this.clear);
345
- }
346
- if (hasSlotEnd) {
347
- wrapper.appendChild(end);
348
- native.classList.add("has-end");
349
- }
350
- fragment.appendChild(native);
351
- this.native = native;
352
- this.labelElement = label;
353
- this.input = input;
354
- this.errorMessage = error;
355
- this.syncAria();
356
- return fragment;
100
+ let l = document.createElement("slot");
101
+ l.setAttribute("name", "error"), l.setAttribute("part", "error-slot"), this._ariaErrorId = this.id ? `${this.id}-error` : `wje-input-${this._instanceId}-error`, l.id = this._ariaErrorId;
102
+ let d = document.createElement("div");
103
+ d.setAttribute("slot", "error");
104
+ let u = null;
105
+ t2 && (u = document.createElement("slot"), u.setAttribute("name", "start"), u.setAttribute("part", "start"));
106
+ let p = null;
107
+ if (e2 && (p = document.createElement("slot"), p.setAttribute("name", "end"), p.setAttribute("part", "end")), t2 && (a.appendChild(u), r.classList.add("has-start")), this.label && ("standard" === this.variant ? r.append(s) : n.appendChild(s)), n.appendChild(o), a.appendChild(n), r.appendChild(a), r.append(l), this.append(d), this.clearable) {
108
+ this.clear = document.createElement("wje-button"), this.clear.classList.add("clear"), this.clear.setAttribute("fill", "link"), this.clear.setAttribute("part", "clear");
109
+ let t3 = document.createElement("wje-icon");
110
+ t3.setAttribute("name", "x"), this.clear.appendChild(t3), n.appendChild(this.clear);
111
+ }
112
+ return e2 && (a.appendChild(p), r.classList.add("has-end")), i2.appendChild(r), this.native = r, this.labelElement = s, this.input = o, this.errorMessage = d, this.syncAria(), i2;
357
113
  }
358
- /**
359
- * Runs after the input is drawn to the DOM.
360
- */
361
114
  afterDraw() {
362
- this.input.addEventListener("focus", (e) => {
363
- this.labelElement.classList.add("fade");
364
- this.native.classList.add("focused");
365
- });
366
- this.input.addEventListener("blur", (e) => {
367
- this.native.classList.remove("focused");
368
- if (!e.target.value) this.labelElement.classList.remove("fade");
369
- });
370
- this.input.addEventListener("input", (e) => {
371
- this.validate();
372
- if (this.validateOnChange) {
373
- this.pristine = false;
374
- this.propagateValidation();
375
- }
376
- if (this.invalid && this.checkValidity()) {
377
- this.invalid = false;
378
- this.errorMessage.textContent = "";
379
- this.internals.setValidity({}, "");
380
- }
381
- this.input.classList.remove("pristine");
382
- this.labelElement.classList.add("fade");
383
- event.dispatchCustomEvent(this, "wje-input:input", {
384
- value: this.input.value
385
- });
386
- this.pristine = false;
387
- this._value = this.input.value;
388
- this.internals.setFormValue(this._value);
389
- this.syncAria();
390
- });
391
- this.addEventListener("invalid", (e) => {
392
- this.invalid = true;
393
- this.pristine = false;
394
- this.showInvalidMessage();
395
- if (this.customErrorDisplay) {
396
- e.preventDefault();
397
- }
398
- });
399
- this.addEventListener("focus", () => this.input.focus());
400
- if (this.clear) {
401
- this.clear.addEventListener("wje-button:click", (e) => {
402
- this.input.value = "";
403
- event.dispatchCustomEvent(this.clear, "wje-input:clear");
404
- });
405
- }
406
- this.validate();
407
- if (this.invalid) {
408
- this.showInvalidMessage();
409
- }
410
- this.syncAria();
115
+ this.input.addEventListener("focus", (t2) => {
116
+ this.labelElement.classList.add("fade"), this.native.classList.add("focused");
117
+ }), this.input.addEventListener("blur", (t2) => {
118
+ this.native.classList.remove("focused"), t2.target.value || this.labelElement.classList.remove("fade");
119
+ }), this.input.addEventListener("input", (t2) => {
120
+ this.validate(), this.validateOnChange && (this.pristine = false, this.propagateValidation()), this.invalid && this.checkValidity() && (this.invalid = false, this.errorMessage.textContent = "", this.internals.setValidity({}, "")), this.input.classList.remove("pristine"), this.labelElement.classList.add("fade"), e.dispatchCustomEvent(this, "wje-input:input", { value: this.input.value }), this.pristine = false, this._value = this.input.value, this.internals.setFormValue(this._value), this.syncAria();
121
+ }), this.addEventListener("invalid", (t2) => {
122
+ this.invalid = true, this.pristine = false, this.showInvalidMessage(), this.customErrorDisplay && t2.preventDefault();
123
+ }), this.addEventListener("focus", () => this.input.focus()), this.clear && this.clear.addEventListener("wje-button:click", (t2) => {
124
+ this.input.value = "", e.dispatchCustomEvent(this.clear, "wje-input:clear");
125
+ }), this.validate(), this.invalid && this.showInvalidMessage(), this.syncAria();
411
126
  }
412
- /**
413
- * Syncs ARIA attributes on the host element.
414
- */
415
127
  syncAria() {
416
- const requiredInvalid = this.required && !this.value;
417
- const invalid = this.invalid || requiredInvalid;
418
- const label = this.label && this.label !== false ? this.label.trim() : "";
419
- this.setAriaState({
420
- role: "textbox",
421
- disabled: this.disabled,
422
- required: this.required,
423
- readonly: this.hasAttribute("readonly"),
424
- invalid,
425
- describedBy: this._ariaErrorId,
426
- ...label ? { label } : {}
427
- });
128
+ const t2 = this.required && !this.value, e2 = this.invalid || t2, i2 = this.label && false !== this.label ? this.label.trim() : "";
129
+ this.setAriaState({ role: "textbox", disabled: this.disabled, required: this.required, readonly: this.hasAttribute("readonly"), invalid: e2, describedBy: this._ariaErrorId, ...i2 ? { label: i2 } : {} });
428
130
  }
429
- /**
430
- * Checks whether the input has a slot.
431
- * @param {HTMLElement} el The element to check.
432
- * @param {string} slotName The name of the slot to check for.
433
- * @returns {boolean} Whether the input has the slot.
434
- */
435
- hasSlot(el, slotName = null) {
436
- let selector = slotName ? `[slot="${slotName}"]` : "[slot]";
437
- return el.querySelectorAll(selector).length > 0 ? true : false;
131
+ hasSlot(t2, e2 = null) {
132
+ let i2 = e2 ? `[slot="${e2}"]` : "[slot]";
133
+ return t2.querySelectorAll(i2).length > 0;
438
134
  }
439
135
  };
440
- _Input_instances = new WeakSet();
441
- /**
442
- * Syncs an attribute from the host element to the native input without redrawing.
443
- * @param {string} name The attribute name.
444
- * @param {string|null} value The new attribute value.
445
- */
446
- syncNativeAttribute_fn = function(name, value) {
447
- if (!(this.input instanceof HTMLInputElement)) return;
448
- if (value === null) {
449
- this.input.removeAttribute(name);
450
- } else {
451
- this.input.setAttribute(name, value);
452
- }
136
+ _i_instances = new WeakSet();
137
+ t_fn = function(t2, e2) {
138
+ this.input instanceof HTMLInputElement && (null === e2 ? this.input.removeAttribute(t2) : this.input.setAttribute(t2, e2));
453
139
  };
454
- __publicField(_Input, "_instanceId", 0);
455
- let Input = _Input;
456
- Input.define("wje-input", Input);
140
+ __publicField(_i, "_instanceId", 0);
141
+ let i = _i;
142
+ i.define("wje-input", i);
457
143
  export {
458
- Input as default
144
+ i as default
459
145
  };
460
146
  //# sourceMappingURL=wje-input.js.map