@und-ui/angular 0.0.0-stage → 0.1.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 (228) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +37 -2
  3. package/dist/forms.d.ts +6 -0
  4. package/dist/forms.d.ts.map +1 -0
  5. package/dist/forms.js +6 -0
  6. package/dist/forms.js.map +1 -0
  7. package/dist/generated/forms.d.ts +139 -0
  8. package/dist/generated/forms.d.ts.map +1 -0
  9. package/dist/generated/forms.js +449 -0
  10. package/dist/generated/forms.js.map +1 -0
  11. package/dist/generated/index.d.ts +85 -0
  12. package/dist/generated/index.d.ts.map +1 -0
  13. package/dist/generated/index.js +88 -0
  14. package/dist/generated/index.js.map +1 -0
  15. package/dist/generated/und-accordion.d.ts +13 -0
  16. package/dist/generated/und-accordion.d.ts.map +1 -0
  17. package/dist/generated/und-accordion.js +30 -0
  18. package/dist/generated/und-accordion.js.map +1 -0
  19. package/dist/generated/und-alert.d.ts +27 -0
  20. package/dist/generated/und-alert.d.ts.map +1 -0
  21. package/dist/generated/und-alert.js +67 -0
  22. package/dist/generated/und-alert.js.map +1 -0
  23. package/dist/generated/und-avatar-group.d.ts +22 -0
  24. package/dist/generated/und-avatar-group.d.ts.map +1 -0
  25. package/dist/generated/und-avatar-group.js +57 -0
  26. package/dist/generated/und-avatar-group.js.map +1 -0
  27. package/dist/generated/und-avatar.d.ts +38 -0
  28. package/dist/generated/und-avatar.d.ts.map +1 -0
  29. package/dist/generated/und-avatar.js +103 -0
  30. package/dist/generated/und-avatar.js.map +1 -0
  31. package/dist/generated/und-badge.d.ts +23 -0
  32. package/dist/generated/und-badge.d.ts.map +1 -0
  33. package/dist/generated/und-badge.js +58 -0
  34. package/dist/generated/und-badge.js.map +1 -0
  35. package/dist/generated/und-breadcrumb-item.d.ts +17 -0
  36. package/dist/generated/und-breadcrumb-item.d.ts.map +1 -0
  37. package/dist/generated/und-breadcrumb-item.js +40 -0
  38. package/dist/generated/und-breadcrumb-item.js.map +1 -0
  39. package/dist/generated/und-breadcrumb.d.ts +13 -0
  40. package/dist/generated/und-breadcrumb.d.ts.map +1 -0
  41. package/dist/generated/und-breadcrumb.js +30 -0
  42. package/dist/generated/und-breadcrumb.js.map +1 -0
  43. package/dist/generated/und-button.d.ts +82 -0
  44. package/dist/generated/und-button.d.ts.map +1 -0
  45. package/dist/generated/und-button.js +216 -0
  46. package/dist/generated/und-button.js.map +1 -0
  47. package/dist/generated/und-card.d.ts +25 -0
  48. package/dist/generated/und-card.d.ts.map +1 -0
  49. package/dist/generated/und-card.js +66 -0
  50. package/dist/generated/und-card.js.map +1 -0
  51. package/dist/generated/und-checkbox.d.ts +51 -0
  52. package/dist/generated/und-checkbox.d.ts.map +1 -0
  53. package/dist/generated/und-checkbox.js +128 -0
  54. package/dist/generated/und-checkbox.js.map +1 -0
  55. package/dist/generated/und-combobox.d.ts +81 -0
  56. package/dist/generated/und-combobox.d.ts.map +1 -0
  57. package/dist/generated/und-combobox.js +214 -0
  58. package/dist/generated/und-combobox.js.map +1 -0
  59. package/dist/generated/und-dialog.d.ts +54 -0
  60. package/dist/generated/und-dialog.d.ts.map +1 -0
  61. package/dist/generated/und-dialog.js +133 -0
  62. package/dist/generated/und-dialog.js.map +1 -0
  63. package/dist/generated/und-divider.d.ts +17 -0
  64. package/dist/generated/und-divider.d.ts.map +1 -0
  65. package/dist/generated/und-divider.js +40 -0
  66. package/dist/generated/und-divider.js.map +1 -0
  67. package/dist/generated/und-drawer.d.ts +57 -0
  68. package/dist/generated/und-drawer.d.ts.map +1 -0
  69. package/dist/generated/und-drawer.js +142 -0
  70. package/dist/generated/und-drawer.js.map +1 -0
  71. package/dist/generated/und-form-field.d.ts +27 -0
  72. package/dist/generated/und-form-field.d.ts.map +1 -0
  73. package/dist/generated/und-form-field.js +68 -0
  74. package/dist/generated/und-form-field.js.map +1 -0
  75. package/dist/generated/und-icon-button.d.ts +82 -0
  76. package/dist/generated/und-icon-button.d.ts.map +1 -0
  77. package/dist/generated/und-icon-button.js +216 -0
  78. package/dist/generated/und-icon-button.js.map +1 -0
  79. package/dist/generated/und-link.d.ts +31 -0
  80. package/dist/generated/und-link.d.ts.map +1 -0
  81. package/dist/generated/und-link.js +84 -0
  82. package/dist/generated/und-link.js.map +1 -0
  83. package/dist/generated/und-menu-group.d.ts +13 -0
  84. package/dist/generated/und-menu-group.d.ts.map +1 -0
  85. package/dist/generated/und-menu-group.js +30 -0
  86. package/dist/generated/und-menu-group.js.map +1 -0
  87. package/dist/generated/und-menu-item.d.ts +31 -0
  88. package/dist/generated/und-menu-item.d.ts.map +1 -0
  89. package/dist/generated/und-menu-item.js +78 -0
  90. package/dist/generated/und-menu-item.js.map +1 -0
  91. package/dist/generated/und-menu-separator.d.ts +9 -0
  92. package/dist/generated/und-menu-separator.d.ts.map +1 -0
  93. package/dist/generated/und-menu-separator.js +21 -0
  94. package/dist/generated/und-menu-separator.js.map +1 -0
  95. package/dist/generated/und-menu.d.ts +31 -0
  96. package/dist/generated/und-menu.d.ts.map +1 -0
  97. package/dist/generated/und-menu.js +63 -0
  98. package/dist/generated/und-menu.js.map +1 -0
  99. package/dist/generated/und-pagination.d.ts +41 -0
  100. package/dist/generated/und-pagination.d.ts.map +1 -0
  101. package/dist/generated/und-pagination.js +111 -0
  102. package/dist/generated/und-pagination.js.map +1 -0
  103. package/dist/generated/und-popover.d.ts +40 -0
  104. package/dist/generated/und-popover.d.ts.map +1 -0
  105. package/dist/generated/und-popover.js +95 -0
  106. package/dist/generated/und-popover.js.map +1 -0
  107. package/dist/generated/und-progress.d.ts +31 -0
  108. package/dist/generated/und-progress.d.ts.map +1 -0
  109. package/dist/generated/und-progress.js +84 -0
  110. package/dist/generated/und-progress.js.map +1 -0
  111. package/dist/generated/und-radio-group.d.ts +42 -0
  112. package/dist/generated/und-radio-group.d.ts.map +1 -0
  113. package/dist/generated/und-radio-group.js +107 -0
  114. package/dist/generated/und-radio-group.js.map +1 -0
  115. package/dist/generated/und-radio.d.ts +27 -0
  116. package/dist/generated/und-radio.d.ts.map +1 -0
  117. package/dist/generated/und-radio.js +68 -0
  118. package/dist/generated/und-radio.js.map +1 -0
  119. package/dist/generated/und-select.d.ts +53 -0
  120. package/dist/generated/und-select.d.ts.map +1 -0
  121. package/dist/generated/und-select.js +135 -0
  122. package/dist/generated/und-select.js.map +1 -0
  123. package/dist/generated/und-skeleton.d.ts +16 -0
  124. package/dist/generated/und-skeleton.d.ts.map +1 -0
  125. package/dist/generated/und-skeleton.js +39 -0
  126. package/dist/generated/und-skeleton.js.map +1 -0
  127. package/dist/generated/und-slider.d.ts +71 -0
  128. package/dist/generated/und-slider.d.ts.map +1 -0
  129. package/dist/generated/und-slider.js +190 -0
  130. package/dist/generated/und-slider.js.map +1 -0
  131. package/dist/generated/und-spinner.d.ts +20 -0
  132. package/dist/generated/und-spinner.d.ts.map +1 -0
  133. package/dist/generated/und-spinner.js +49 -0
  134. package/dist/generated/und-spinner.js.map +1 -0
  135. package/dist/generated/und-switch.d.ts +47 -0
  136. package/dist/generated/und-switch.d.ts.map +1 -0
  137. package/dist/generated/und-switch.js +118 -0
  138. package/dist/generated/und-switch.js.map +1 -0
  139. package/dist/generated/und-tab-panel.d.ts +13 -0
  140. package/dist/generated/und-tab-panel.d.ts.map +1 -0
  141. package/dist/generated/und-tab-panel.js +30 -0
  142. package/dist/generated/und-tab-panel.js.map +1 -0
  143. package/dist/generated/und-tab.d.ts +21 -0
  144. package/dist/generated/und-tab.d.ts.map +1 -0
  145. package/dist/generated/und-tab.js +50 -0
  146. package/dist/generated/und-tab.js.map +1 -0
  147. package/dist/generated/und-table.d.ts +37 -0
  148. package/dist/generated/und-table.d.ts.map +1 -0
  149. package/dist/generated/und-table.js +95 -0
  150. package/dist/generated/und-table.js.map +1 -0
  151. package/dist/generated/und-tabs.d.ts +26 -0
  152. package/dist/generated/und-tabs.d.ts.map +1 -0
  153. package/dist/generated/und-tabs.js +66 -0
  154. package/dist/generated/und-tabs.js.map +1 -0
  155. package/dist/generated/und-text-field.d.ts +83 -0
  156. package/dist/generated/und-text-field.d.ts.map +1 -0
  157. package/dist/generated/und-text-field.js +226 -0
  158. package/dist/generated/und-text-field.js.map +1 -0
  159. package/dist/generated/und-textarea.d.ts +69 -0
  160. package/dist/generated/und-textarea.d.ts.map +1 -0
  161. package/dist/generated/und-textarea.js +182 -0
  162. package/dist/generated/und-textarea.js.map +1 -0
  163. package/dist/generated/und-toast.d.ts +35 -0
  164. package/dist/generated/und-toast.d.ts.map +1 -0
  165. package/dist/generated/und-toast.js +85 -0
  166. package/dist/generated/und-toast.js.map +1 -0
  167. package/dist/generated/und-toaster.d.ts +19 -0
  168. package/dist/generated/und-toaster.d.ts.map +1 -0
  169. package/dist/generated/und-toaster.js +48 -0
  170. package/dist/generated/und-toaster.js.map +1 -0
  171. package/dist/generated/und-tooltip.d.ts +40 -0
  172. package/dist/generated/und-tooltip.d.ts.map +1 -0
  173. package/dist/generated/und-tooltip.js +95 -0
  174. package/dist/generated/und-tooltip.js.map +1 -0
  175. package/dist/generated/und-visually-hidden.d.ts +14 -0
  176. package/dist/generated/und-visually-hidden.d.ts.map +1 -0
  177. package/dist/generated/und-visually-hidden.js +31 -0
  178. package/dist/generated/und-visually-hidden.js.map +1 -0
  179. package/dist/index.d.ts +2 -0
  180. package/dist/index.d.ts.map +1 -0
  181. package/dist/index.js +2 -0
  182. package/dist/index.js.map +1 -0
  183. package/package.json +74 -3
  184. package/src/forms.ts +5 -0
  185. package/src/generated/forms.ts +400 -0
  186. package/src/generated/index.ts +89 -0
  187. package/src/generated/und-accordion.ts +25 -0
  188. package/src/generated/und-alert.ts +62 -0
  189. package/src/generated/und-avatar-group.ts +52 -0
  190. package/src/generated/und-avatar.ts +97 -0
  191. package/src/generated/und-badge.ts +52 -0
  192. package/src/generated/und-breadcrumb-item.ts +34 -0
  193. package/src/generated/und-breadcrumb.ts +25 -0
  194. package/src/generated/und-button.ts +206 -0
  195. package/src/generated/und-card.ts +61 -0
  196. package/src/generated/und-checkbox.ts +118 -0
  197. package/src/generated/und-combobox.ts +205 -0
  198. package/src/generated/und-dialog.ts +126 -0
  199. package/src/generated/und-divider.ts +34 -0
  200. package/src/generated/und-drawer.ts +135 -0
  201. package/src/generated/und-form-field.ts +61 -0
  202. package/src/generated/und-icon-button.ts +206 -0
  203. package/src/generated/und-link.ts +79 -0
  204. package/src/generated/und-menu-group.ts +25 -0
  205. package/src/generated/und-menu-item.ts +70 -0
  206. package/src/generated/und-menu-separator.ts +17 -0
  207. package/src/generated/und-menu.ts +58 -0
  208. package/src/generated/und-pagination.ts +107 -0
  209. package/src/generated/und-popover.ts +90 -0
  210. package/src/generated/und-progress.ts +79 -0
  211. package/src/generated/und-radio-group.ts +100 -0
  212. package/src/generated/und-radio.ts +61 -0
  213. package/src/generated/und-select.ts +128 -0
  214. package/src/generated/und-skeleton.ts +34 -0
  215. package/src/generated/und-slider.ts +181 -0
  216. package/src/generated/und-spinner.ts +43 -0
  217. package/src/generated/und-switch.ts +109 -0
  218. package/src/generated/und-tab-panel.ts +25 -0
  219. package/src/generated/und-tab.ts +43 -0
  220. package/src/generated/und-table.ts +89 -0
  221. package/src/generated/und-tabs.ts +62 -0
  222. package/src/generated/und-text-field.ts +217 -0
  223. package/src/generated/und-textarea.ts +172 -0
  224. package/src/generated/und-toast.ts +80 -0
  225. package/src/generated/und-toaster.ts +43 -0
  226. package/src/generated/und-tooltip.ts +89 -0
  227. package/src/generated/und-visually-hidden.ts +25 -0
  228. package/src/index.ts +1 -0
@@ -0,0 +1,205 @@
1
+ // GENERATED FILE. DO NOT EDIT.
2
+ // Source: @und-ui/core custom-elements.json, via tools/codegen/wrappers.mjs.
3
+ // Run `pnpm codegen` (or `pnpm build`) after changing a component.
4
+ import { booleanAttribute, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, NgZone, Output, inject } from '@angular/core';
5
+ import '@und-ui/core/combobox.js';
6
+ import type { UndCombobox as UndComboboxElement } from '@und-ui/core';
7
+
8
+ /** A text input with a filtered list of suggestions.
9
+ *
10
+ * Native events (`change`, `input`) are not outputs: bind them on the
11
+ * element as usual, for example `(change)="..."`. */
12
+ @Component({
13
+ selector: 'und-combobox',
14
+ template: '<ng-content></ng-content>',
15
+ changeDetection: ChangeDetectionStrategy.OnPush,
16
+ })
17
+ export class UndCombobox {
18
+ readonly #el: UndComboboxElement = inject<ElementRef<UndComboboxElement>>(ElementRef).nativeElement;
19
+
20
+ /** The committed value: the selected option's `value`, or the typed text with `allow-custom-value`. The attribute sets the initial (and reset) value. */
21
+ @Input()
22
+ set value(value: UndComboboxElement['value']) {
23
+ this.#el.value = value;
24
+ }
25
+ get value(): UndComboboxElement['value'] {
26
+ return this.#el.value;
27
+ }
28
+
29
+ /** Visible label text, shown above the input as on `und-text-field`. It is also the accessible name; a `<label for>`, `aria-labelledby` or `aria-label` on the element works too. */
30
+ @Input()
31
+ set label(value: UndComboboxElement['label']) {
32
+ this.#el.label = value;
33
+ }
34
+ get label(): UndComboboxElement['label'] {
35
+ return this.#el.label;
36
+ }
37
+
38
+ /** Help text under the label, announced as the input's description. */
39
+ @Input()
40
+ set description(value: UndComboboxElement['description']) {
41
+ this.#el.description = value;
42
+ }
43
+ get description(): UndComboboxElement['description'] {
44
+ return this.#el.description;
45
+ }
46
+
47
+ /** Error message. Marks the input invalid (`aria-invalid`, a custom validity error) and shows the message, prefixed with a visually hidden "Error:". A native "required" message also shows after a failed submit. */
48
+ @Input()
49
+ set error(value: UndComboboxElement['error']) {
50
+ this.#el.error = value;
51
+ }
52
+ get error(): UndComboboxElement['error'] {
53
+ return this.#el.error;
54
+ }
55
+
56
+ /** Placeholder text of the input. */
57
+ @Input()
58
+ set placeholder(value: UndComboboxElement['placeholder']) {
59
+ this.#el.placeholder = value;
60
+ }
61
+ get placeholder(): UndComboboxElement['placeholder'] {
62
+ return this.#el.placeholder;
63
+ }
64
+
65
+ /** Form field name. */
66
+ @Input()
67
+ set name(value: UndComboboxElement['name']) {
68
+ this.#el.name = value;
69
+ }
70
+ get name(): UndComboboxElement['name'] {
71
+ return this.#el.name;
72
+ }
73
+
74
+ /** Size of the control. */
75
+ @Input()
76
+ set size(value: UndComboboxElement['size']) {
77
+ this.#el.size = value;
78
+ }
79
+ get size(): UndComboboxElement['size'] {
80
+ return this.#el.size;
81
+ }
82
+
83
+ /** Disables the control. */
84
+ @Input({ transform: booleanAttribute })
85
+ set disabled(value: boolean) {
86
+ this.#el.disabled = value;
87
+ }
88
+ get disabled(): UndComboboxElement['disabled'] {
89
+ return this.#el.disabled;
90
+ }
91
+
92
+ /** Requires a non-empty value. */
93
+ @Input({ transform: booleanAttribute })
94
+ set required(value: boolean) {
95
+ this.#el.required = value;
96
+ }
97
+ get required(): UndComboboxElement['required'] {
98
+ return this.#el.required;
99
+ }
100
+
101
+ /** Whether the listbox is open. */
102
+ @Input({ transform: booleanAttribute })
103
+ set open(value: boolean) {
104
+ this.#el.open = value;
105
+ }
106
+ get open(): UndComboboxElement['open'] {
107
+ return this.#el.open;
108
+ }
109
+
110
+ /** How typed text filters the options. `none` shows every option, for filtering on the server through `und-search`. */
111
+ @Input()
112
+ set filter(value: UndComboboxElement['filter']) {
113
+ this.#el.filter = value;
114
+ }
115
+ get filter(): UndComboboxElement['filter'] {
116
+ return this.#el.filter;
117
+ }
118
+
119
+ /** Accept free text as the value instead of only listed options. */
120
+ @Input({ transform: booleanAttribute })
121
+ set allowCustomValue(value: boolean) {
122
+ this.#el.allowCustomValue = value;
123
+ }
124
+ get allowCustomValue(): UndComboboxElement['allowCustomValue'] {
125
+ return this.#el.allowCustomValue;
126
+ }
127
+
128
+ /** Shows a loading state in the popup (sets `aria-busy` on the listbox). */
129
+ @Input({ transform: booleanAttribute })
130
+ set loading(value: boolean) {
131
+ this.#el.loading = value;
132
+ }
133
+ get loading(): UndComboboxElement['loading'] {
134
+ return this.#el.loading;
135
+ }
136
+
137
+ /** Delay in ms before `und-search` fires after typing (0 fires at once). */
138
+ @Input()
139
+ set debounce(value: UndComboboxElement['debounce']) {
140
+ this.#el.debounce = value;
141
+ }
142
+ get debounce(): UndComboboxElement['debounce'] {
143
+ return this.#el.debounce;
144
+ }
145
+
146
+ /** Text shown (and announced) when no option matches. */
147
+ @Input()
148
+ set noResultsText(value: UndComboboxElement['noResultsText']) {
149
+ this.#el.noResultsText = value;
150
+ }
151
+ get noResultsText(): UndComboboxElement['noResultsText'] {
152
+ return this.#el.noResultsText;
153
+ }
154
+
155
+ /** Text shown while `loading`. */
156
+ @Input()
157
+ set loadingText(value: UndComboboxElement['loadingText']) {
158
+ this.#el.loadingText = value;
159
+ }
160
+ get loadingText(): UndComboboxElement['loadingText'] {
161
+ return this.#el.loadingText;
162
+ }
163
+
164
+ /** Options as data. When set, light-DOM options are ignored. */
165
+ @Input()
166
+ set options(value: UndComboboxElement['options']) {
167
+ this.#el.options = value;
168
+ }
169
+ get options(): UndComboboxElement['options'] {
170
+ return this.#el.options;
171
+ }
172
+
173
+ /** The text currently in the input. */
174
+ @Input()
175
+ set inputValue(value: UndComboboxElement['inputValue']) {
176
+ this.#el.inputValue = value;
177
+ }
178
+ get inputValue(): UndComboboxElement['inputValue'] {
179
+ return this.#el.inputValue;
180
+ }
181
+
182
+ /** Builds the polite announcement for the number of visible options. Override it to localise. */
183
+ @Input()
184
+ set resultsMessage(value: UndComboboxElement['resultsMessage']) {
185
+ this.#el.resultsMessage = value;
186
+ }
187
+ get resultsMessage(): UndComboboxElement['resultsMessage'] {
188
+ return this.#el.resultsMessage;
189
+ }
190
+
191
+ /** The user typed; use it to load options asynchronously. */
192
+ @Output() readonly undSearch = new EventEmitter<CustomEvent<unknown>>();
193
+ /** The listbox opened or closed. */
194
+ @Output() readonly undOpenChange = new EventEmitter<CustomEvent<unknown>>();
195
+
196
+ constructor() {
197
+ const zone = inject(NgZone);
198
+ this.#el.addEventListener('und-search', (event) =>
199
+ zone.run(() => this.undSearch.emit(event as CustomEvent<unknown>)),
200
+ );
201
+ this.#el.addEventListener('und-open-change', (event) =>
202
+ zone.run(() => this.undOpenChange.emit(event as CustomEvent<unknown>)),
203
+ );
204
+ }
205
+ }
@@ -0,0 +1,126 @@
1
+ // GENERATED FILE. DO NOT EDIT.
2
+ // Source: @und-ui/core custom-elements.json, via tools/codegen/wrappers.mjs.
3
+ // Run `pnpm codegen` (or `pnpm build`) after changing a component.
4
+ import { booleanAttribute, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, NgZone, Output, inject } from '@angular/core';
5
+ import '@und-ui/core/dialog.js';
6
+ import type { UndDialog as UndDialogElement } from '@und-ui/core';
7
+
8
+ /** A modal or non-modal dialog window. */
9
+ @Component({
10
+ selector: 'und-dialog',
11
+ template: '<ng-content></ng-content>',
12
+ changeDetection: ChangeDetectionStrategy.OnPush,
13
+ })
14
+ export class UndDialog {
15
+ readonly #el: UndDialogElement = inject<ElementRef<UndDialogElement>>(ElementRef).nativeElement;
16
+
17
+ /** Whether the dialog is open. Setting it opens or closes the dialog without firing `und-open-change`. */
18
+ @Input({ transform: booleanAttribute })
19
+ set open(value: boolean) {
20
+ this.#el.open = value;
21
+ }
22
+ get open(): UndDialogElement['open'] {
23
+ return this.#el.open;
24
+ }
25
+
26
+ /** Modal (default): the page behind is inert and scrolling is locked. Set `modal="false"` for a non-modal dialog that leaves the page usable. */
27
+ @Input({ transform: booleanAttribute })
28
+ set modal(value: boolean) {
29
+ this.#el.modal = value;
30
+ }
31
+ get modal(): UndDialogElement['modal'] {
32
+ return this.#el.modal;
33
+ }
34
+
35
+ /** `alert` renders an alert dialog (`role="alertdialog"`) for confirmations: no close button, and the backdrop does not dismiss it. */
36
+ @Input()
37
+ set variant(value: UndDialogElement['variant']) {
38
+ this.#el.variant = value;
39
+ }
40
+ get variant(): UndDialogElement['variant'] {
41
+ return this.#el.variant;
42
+ }
43
+
44
+ /** Preferred width. */
45
+ @Input()
46
+ set size(value: UndDialogElement['size']) {
47
+ this.#el.size = value;
48
+ }
49
+ get size(): UndDialogElement['size'] {
50
+ return this.#el.size;
51
+ }
52
+
53
+ /** Which user actions close the dialog, as on the native attribute: `any` (Escape, backdrop click or outside click), `closerequest` (Escape only) or `none`. Defaults to `any`, or `closerequest` for `variant="alert"`. */
54
+ @Input()
55
+ set closedBy(value: UndDialogElement['closedBy']) {
56
+ this.#el.closedBy = value;
57
+ }
58
+ get closedBy(): UndDialogElement['closedBy'] {
59
+ return this.#el.closedBy;
60
+ }
61
+
62
+ /** The title, rendered as the heading that names the dialog. Use the `label` slot for rich content. */
63
+ @Input()
64
+ set label(value: UndDialogElement['label']) {
65
+ this.#el.label = value;
66
+ }
67
+ get label(): UndDialogElement['label'] {
68
+ return this.#el.label;
69
+ }
70
+
71
+ /** CSS selector (inside the dialog content) of the element to focus on open. Defaults to an `[autofocus]` element, then the first focusable element. */
72
+ @Input()
73
+ set initialFocus(value: UndDialogElement['initialFocus']) {
74
+ this.#el.initialFocus = value;
75
+ }
76
+ get initialFocus(): UndDialogElement['initialFocus'] {
77
+ return this.#el.initialFocus;
78
+ }
79
+
80
+ /** Accessible name of the close button. */
81
+ @Input()
82
+ set closeLabel(value: UndDialogElement['closeLabel']) {
83
+ this.#el.closeLabel = value;
84
+ }
85
+ get closeLabel(): UndDialogElement['closeLabel'] {
86
+ return this.#el.closeLabel;
87
+ }
88
+
89
+ /** Hides the close button. Make sure another way to close remains. */
90
+ @Input({ transform: booleanAttribute })
91
+ set noCloseButton(value: boolean) {
92
+ this.#el.noCloseButton = value;
93
+ }
94
+ get noCloseButton(): UndDialogElement['noCloseButton'] {
95
+ return this.#el.noCloseButton;
96
+ }
97
+
98
+ /** The value passed to `close(value)` or submitted by a `method="dialog"` form. */
99
+ @Input()
100
+ set returnValue(value: UndDialogElement['returnValue']) {
101
+ this.#el.returnValue = value;
102
+ }
103
+ get returnValue(): UndDialogElement['returnValue'] {
104
+ return this.#el.returnValue;
105
+ }
106
+
107
+ /** The user asked to open or close the dialog (Escape, backdrop, close button, invoker command, `method="dialog"` form). Cancelable: call `preventDefault()` to keep the current state. */
108
+ @Output() readonly undOpenChange = new EventEmitter<CustomEvent<{ open: boolean; reason: string }>>();
109
+ /** The dialog opened and its entry animation finished. */
110
+ @Output() readonly undAfterOpen = new EventEmitter<CustomEvent<undefined>>();
111
+ /** The dialog closed and its exit animation finished. */
112
+ @Output() readonly undAfterClose = new EventEmitter<CustomEvent<undefined>>();
113
+
114
+ constructor() {
115
+ const zone = inject(NgZone);
116
+ this.#el.addEventListener('und-open-change', (event) =>
117
+ zone.run(() => this.undOpenChange.emit(event as CustomEvent<{ open: boolean; reason: string }>)),
118
+ );
119
+ this.#el.addEventListener('und-after-open', (event) =>
120
+ zone.run(() => this.undAfterOpen.emit(event as CustomEvent<undefined>)),
121
+ );
122
+ this.#el.addEventListener('und-after-close', (event) =>
123
+ zone.run(() => this.undAfterClose.emit(event as CustomEvent<undefined>)),
124
+ );
125
+ }
126
+ }
@@ -0,0 +1,34 @@
1
+ // GENERATED FILE. DO NOT EDIT.
2
+ // Source: @und-ui/core custom-elements.json, via tools/codegen/wrappers.mjs.
3
+ // Run `pnpm codegen` (or `pnpm build`) after changing a component.
4
+ import { booleanAttribute, ChangeDetectionStrategy, Component, ElementRef, Input, inject } from '@angular/core';
5
+ import '@und-ui/core/divider.js';
6
+ import type { UndDivider as UndDividerElement } from '@und-ui/core';
7
+
8
+ /** Separates content, optionally with a label. */
9
+ @Component({
10
+ selector: 'und-divider',
11
+ template: '<ng-content></ng-content>',
12
+ changeDetection: ChangeDetectionStrategy.OnPush,
13
+ })
14
+ export class UndDivider {
15
+ readonly #el: UndDividerElement = inject<ElementRef<UndDividerElement>>(ElementRef).nativeElement;
16
+
17
+ /** Direction of the line. */
18
+ @Input()
19
+ set orientation(value: UndDividerElement['orientation']) {
20
+ this.#el.orientation = value;
21
+ }
22
+ get orientation(): UndDividerElement['orientation'] {
23
+ return this.#el.orientation;
24
+ }
25
+
26
+ /** Purely visual: hides the divider from assistive technology. */
27
+ @Input({ transform: booleanAttribute })
28
+ set decorative(value: boolean) {
29
+ this.#el.decorative = value;
30
+ }
31
+ get decorative(): UndDividerElement['decorative'] {
32
+ return this.#el.decorative;
33
+ }
34
+ }
@@ -0,0 +1,135 @@
1
+ // GENERATED FILE. DO NOT EDIT.
2
+ // Source: @und-ui/core custom-elements.json, via tools/codegen/wrappers.mjs.
3
+ // Run `pnpm codegen` (or `pnpm build`) after changing a component.
4
+ import { booleanAttribute, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, NgZone, Output, inject } from '@angular/core';
5
+ import '@und-ui/core/drawer.js';
6
+ import type { UndDrawer as UndDrawerElement } from '@und-ui/core';
7
+
8
+ /** A dialog that slides in from an edge of the screen. */
9
+ @Component({
10
+ selector: 'und-drawer',
11
+ template: '<ng-content></ng-content>',
12
+ changeDetection: ChangeDetectionStrategy.OnPush,
13
+ })
14
+ export class UndDrawer {
15
+ readonly #el: UndDrawerElement = inject<ElementRef<UndDrawerElement>>(ElementRef).nativeElement;
16
+
17
+ /** The edge the drawer is attached to. `start` and `end` follow the text direction. */
18
+ @Input()
19
+ set placement(value: UndDrawerElement['placement']) {
20
+ this.#el.placement = value;
21
+ }
22
+ get placement(): UndDrawerElement['placement'] {
23
+ return this.#el.placement;
24
+ }
25
+
26
+ /** Whether the dialog is open. Setting it opens or closes the dialog without firing `und-open-change`. */
27
+ @Input({ transform: booleanAttribute })
28
+ set open(value: boolean) {
29
+ this.#el.open = value;
30
+ }
31
+ get open(): UndDrawerElement['open'] {
32
+ return this.#el.open;
33
+ }
34
+
35
+ /** Modal (default): the page behind is inert and scrolling is locked. Set `modal="false"` for a non-modal dialog that leaves the page usable. */
36
+ @Input({ transform: booleanAttribute })
37
+ set modal(value: boolean) {
38
+ this.#el.modal = value;
39
+ }
40
+ get modal(): UndDrawerElement['modal'] {
41
+ return this.#el.modal;
42
+ }
43
+
44
+ /** `alert` renders an alert dialog (`role="alertdialog"`) for confirmations: no close button, and the backdrop does not dismiss it. */
45
+ @Input()
46
+ set variant(value: UndDrawerElement['variant']) {
47
+ this.#el.variant = value;
48
+ }
49
+ get variant(): UndDrawerElement['variant'] {
50
+ return this.#el.variant;
51
+ }
52
+
53
+ /** Preferred width. */
54
+ @Input()
55
+ set size(value: UndDrawerElement['size']) {
56
+ this.#el.size = value;
57
+ }
58
+ get size(): UndDrawerElement['size'] {
59
+ return this.#el.size;
60
+ }
61
+
62
+ /** Which user actions close the dialog, as on the native attribute: `any` (Escape, backdrop click or outside click), `closerequest` (Escape only) or `none`. Defaults to `any`, or `closerequest` for `variant="alert"`. */
63
+ @Input()
64
+ set closedBy(value: UndDrawerElement['closedBy']) {
65
+ this.#el.closedBy = value;
66
+ }
67
+ get closedBy(): UndDrawerElement['closedBy'] {
68
+ return this.#el.closedBy;
69
+ }
70
+
71
+ /** The title, rendered as the heading that names the dialog. Use the `label` slot for rich content. */
72
+ @Input()
73
+ set label(value: UndDrawerElement['label']) {
74
+ this.#el.label = value;
75
+ }
76
+ get label(): UndDrawerElement['label'] {
77
+ return this.#el.label;
78
+ }
79
+
80
+ /** CSS selector (inside the dialog content) of the element to focus on open. Defaults to an `[autofocus]` element, then the first focusable element. */
81
+ @Input()
82
+ set initialFocus(value: UndDrawerElement['initialFocus']) {
83
+ this.#el.initialFocus = value;
84
+ }
85
+ get initialFocus(): UndDrawerElement['initialFocus'] {
86
+ return this.#el.initialFocus;
87
+ }
88
+
89
+ /** Accessible name of the close button. */
90
+ @Input()
91
+ set closeLabel(value: UndDrawerElement['closeLabel']) {
92
+ this.#el.closeLabel = value;
93
+ }
94
+ get closeLabel(): UndDrawerElement['closeLabel'] {
95
+ return this.#el.closeLabel;
96
+ }
97
+
98
+ /** Hides the close button. Make sure another way to close remains. */
99
+ @Input({ transform: booleanAttribute })
100
+ set noCloseButton(value: boolean) {
101
+ this.#el.noCloseButton = value;
102
+ }
103
+ get noCloseButton(): UndDrawerElement['noCloseButton'] {
104
+ return this.#el.noCloseButton;
105
+ }
106
+
107
+ /** The value passed to `close(value)` or submitted by a `method="dialog"` form. */
108
+ @Input()
109
+ set returnValue(value: UndDrawerElement['returnValue']) {
110
+ this.#el.returnValue = value;
111
+ }
112
+ get returnValue(): UndDrawerElement['returnValue'] {
113
+ return this.#el.returnValue;
114
+ }
115
+
116
+ /** The user asked to open or close the drawer. Cancelable. */
117
+ @Output() readonly undOpenChange = new EventEmitter<CustomEvent<{ open: boolean; reason: string }>>();
118
+ /** The drawer opened and its entry animation finished. */
119
+ @Output() readonly undAfterOpen = new EventEmitter<CustomEvent<undefined>>();
120
+ /** The drawer closed and its exit animation finished. */
121
+ @Output() readonly undAfterClose = new EventEmitter<CustomEvent<undefined>>();
122
+
123
+ constructor() {
124
+ const zone = inject(NgZone);
125
+ this.#el.addEventListener('und-open-change', (event) =>
126
+ zone.run(() => this.undOpenChange.emit(event as CustomEvent<{ open: boolean; reason: string }>)),
127
+ );
128
+ this.#el.addEventListener('und-after-open', (event) =>
129
+ zone.run(() => this.undAfterOpen.emit(event as CustomEvent<undefined>)),
130
+ );
131
+ this.#el.addEventListener('und-after-close', (event) =>
132
+ zone.run(() => this.undAfterClose.emit(event as CustomEvent<undefined>)),
133
+ );
134
+ }
135
+ }
@@ -0,0 +1,61 @@
1
+ // GENERATED FILE. DO NOT EDIT.
2
+ // Source: @und-ui/core custom-elements.json, via tools/codegen/wrappers.mjs.
3
+ // Run `pnpm codegen` (or `pnpm build`) after changing a component.
4
+ import { booleanAttribute, ChangeDetectionStrategy, Component, ElementRef, Input, inject } from '@angular/core';
5
+ import '@und-ui/core/form-field.js';
6
+ import type { UndFormField as UndFormFieldElement } from '@und-ui/core';
7
+
8
+ /** Label, description and error wiring for any form control. */
9
+ @Component({
10
+ selector: 'und-form-field',
11
+ template: '<ng-content></ng-content>',
12
+ changeDetection: ChangeDetectionStrategy.OnPush,
13
+ })
14
+ export class UndFormField {
15
+ readonly #el: UndFormFieldElement = inject<ElementRef<UndFormFieldElement>>(ElementRef).nativeElement;
16
+
17
+ /** Visible label text. */
18
+ @Input()
19
+ set label(value: UndFormFieldElement['label']) {
20
+ this.#el.label = value;
21
+ }
22
+ get label(): UndFormFieldElement['label'] {
23
+ return this.#el.label;
24
+ }
25
+
26
+ /** Help text under the label, referenced by `aria-describedby`. */
27
+ @Input()
28
+ set description(value: UndFormFieldElement['description']) {
29
+ this.#el.description = value;
30
+ }
31
+ get description(): UndFormFieldElement['description'] {
32
+ return this.#el.description;
33
+ }
34
+
35
+ /** Error message. Marks the control invalid and shows the message, prefixed with a visually hidden "Error:". */
36
+ @Input()
37
+ set error(value: UndFormFieldElement['error']) {
38
+ this.#el.error = value;
39
+ }
40
+ get error(): UndFormFieldElement['error'] {
41
+ return this.#el.error;
42
+ }
43
+
44
+ /** Marks the control required (also sets `required` on a native control). */
45
+ @Input({ transform: booleanAttribute })
46
+ set required(value: boolean) {
47
+ this.#el.required = value;
48
+ }
49
+ get required(): UndFormFieldElement['required'] {
50
+ return this.#el.required;
51
+ }
52
+
53
+ /** Shows an "(optional)" marker after the label. */
54
+ @Input({ transform: booleanAttribute })
55
+ set optional(value: boolean) {
56
+ this.#el.optional = value;
57
+ }
58
+ get optional(): UndFormFieldElement['optional'] {
59
+ return this.#el.optional;
60
+ }
61
+ }