@vadem/ui 0.0.0-stage → 0.0.1

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 (289) hide show
  1. package/LICENSE-lucide.txt +43 -0
  2. package/README.md +19 -2
  3. package/fesm2022/vadem-ui-accordion.mjs +139 -0
  4. package/fesm2022/vadem-ui-accordion.mjs.map +1 -0
  5. package/fesm2022/vadem-ui-active-filters.mjs +355 -0
  6. package/fesm2022/vadem-ui-active-filters.mjs.map +1 -0
  7. package/fesm2022/vadem-ui-alert-dialog.mjs +433 -0
  8. package/fesm2022/vadem-ui-alert-dialog.mjs.map +1 -0
  9. package/fesm2022/vadem-ui-alert.mjs +266 -0
  10. package/fesm2022/vadem-ui-alert.mjs.map +1 -0
  11. package/fesm2022/vadem-ui-autocomplete.mjs +715 -0
  12. package/fesm2022/vadem-ui-autocomplete.mjs.map +1 -0
  13. package/fesm2022/vadem-ui-avatar.mjs +219 -0
  14. package/fesm2022/vadem-ui-avatar.mjs.map +1 -0
  15. package/fesm2022/vadem-ui-badge.mjs +86 -0
  16. package/fesm2022/vadem-ui-badge.mjs.map +1 -0
  17. package/fesm2022/vadem-ui-breadcrumbs.mjs +61 -0
  18. package/fesm2022/vadem-ui-breadcrumbs.mjs.map +1 -0
  19. package/fesm2022/vadem-ui-button.mjs +220 -0
  20. package/fesm2022/vadem-ui-button.mjs.map +1 -0
  21. package/fesm2022/vadem-ui-calendar.mjs +1314 -0
  22. package/fesm2022/vadem-ui-calendar.mjs.map +1 -0
  23. package/fesm2022/vadem-ui-card.mjs +271 -0
  24. package/fesm2022/vadem-ui-card.mjs.map +1 -0
  25. package/fesm2022/vadem-ui-character-count.mjs +269 -0
  26. package/fesm2022/vadem-ui-character-count.mjs.map +1 -0
  27. package/fesm2022/vadem-ui-chart.mjs +1984 -0
  28. package/fesm2022/vadem-ui-chart.mjs.map +1 -0
  29. package/fesm2022/vadem-ui-checkbox.mjs +67 -0
  30. package/fesm2022/vadem-ui-checkbox.mjs.map +1 -0
  31. package/fesm2022/vadem-ui-color-picker.mjs +815 -0
  32. package/fesm2022/vadem-ui-color-picker.mjs.map +1 -0
  33. package/fesm2022/vadem-ui-command.mjs +735 -0
  34. package/fesm2022/vadem-ui-command.mjs.map +1 -0
  35. package/fesm2022/vadem-ui-copy-button.mjs +375 -0
  36. package/fesm2022/vadem-ui-copy-button.mjs.map +1 -0
  37. package/fesm2022/vadem-ui-date-range-picker.mjs +1011 -0
  38. package/fesm2022/vadem-ui-date-range-picker.mjs.map +1 -0
  39. package/fesm2022/vadem-ui-description-list.mjs +59 -0
  40. package/fesm2022/vadem-ui-description-list.mjs.map +1 -0
  41. package/fesm2022/vadem-ui-dialog.mjs +587 -0
  42. package/fesm2022/vadem-ui-dialog.mjs.map +1 -0
  43. package/fesm2022/vadem-ui-dropzone.mjs +176 -0
  44. package/fesm2022/vadem-ui-dropzone.mjs.map +1 -0
  45. package/fesm2022/vadem-ui-editable-text.mjs +641 -0
  46. package/fesm2022/vadem-ui-editable-text.mjs.map +1 -0
  47. package/fesm2022/vadem-ui-empty-state.mjs +175 -0
  48. package/fesm2022/vadem-ui-empty-state.mjs.map +1 -0
  49. package/fesm2022/vadem-ui-expandable-text.mjs +244 -0
  50. package/fesm2022/vadem-ui-expandable-text.mjs.map +1 -0
  51. package/fesm2022/vadem-ui-field.mjs +583 -0
  52. package/fesm2022/vadem-ui-field.mjs.map +1 -0
  53. package/fesm2022/vadem-ui-file-preview.mjs +532 -0
  54. package/fesm2022/vadem-ui-file-preview.mjs.map +1 -0
  55. package/fesm2022/vadem-ui-file-size.mjs +83 -0
  56. package/fesm2022/vadem-ui-file-size.mjs.map +1 -0
  57. package/fesm2022/vadem-ui-form-error-summary.mjs +201 -0
  58. package/fesm2022/vadem-ui-form-error-summary.mjs.map +1 -0
  59. package/fesm2022/vadem-ui-icon.mjs +303 -0
  60. package/fesm2022/vadem-ui-icon.mjs.map +1 -0
  61. package/fesm2022/vadem-ui-input.mjs +120 -0
  62. package/fesm2022/vadem-ui-input.mjs.map +1 -0
  63. package/fesm2022/vadem-ui-kbd.mjs +286 -0
  64. package/fesm2022/vadem-ui-kbd.mjs.map +1 -0
  65. package/fesm2022/vadem-ui-keyboard.mjs +105 -0
  66. package/fesm2022/vadem-ui-keyboard.mjs.map +1 -0
  67. package/fesm2022/vadem-ui-locale.mjs +443 -0
  68. package/fesm2022/vadem-ui-locale.mjs.map +1 -0
  69. package/fesm2022/vadem-ui-menu.mjs +637 -0
  70. package/fesm2022/vadem-ui-menu.mjs.map +1 -0
  71. package/fesm2022/vadem-ui-navigation-list.mjs +130 -0
  72. package/fesm2022/vadem-ui-navigation-list.mjs.map +1 -0
  73. package/fesm2022/vadem-ui-number-input.mjs +264 -0
  74. package/fesm2022/vadem-ui-number-input.mjs.map +1 -0
  75. package/fesm2022/vadem-ui-otp-input.mjs +86 -0
  76. package/fesm2022/vadem-ui-otp-input.mjs.map +1 -0
  77. package/fesm2022/vadem-ui-pagination.mjs +353 -0
  78. package/fesm2022/vadem-ui-pagination.mjs.map +1 -0
  79. package/fesm2022/vadem-ui-password-input.mjs +213 -0
  80. package/fesm2022/vadem-ui-password-input.mjs.map +1 -0
  81. package/fesm2022/vadem-ui-popover.mjs +178 -0
  82. package/fesm2022/vadem-ui-popover.mjs.map +1 -0
  83. package/fesm2022/vadem-ui-progress.mjs +331 -0
  84. package/fesm2022/vadem-ui-progress.mjs.map +1 -0
  85. package/fesm2022/vadem-ui-radio.mjs +39 -0
  86. package/fesm2022/vadem-ui-radio.mjs.map +1 -0
  87. package/fesm2022/vadem-ui-range-slider.mjs +561 -0
  88. package/fesm2022/vadem-ui-range-slider.mjs.map +1 -0
  89. package/fesm2022/vadem-ui-rating.mjs +404 -0
  90. package/fesm2022/vadem-ui-rating.mjs.map +1 -0
  91. package/fesm2022/vadem-ui-relative-time.mjs +217 -0
  92. package/fesm2022/vadem-ui-relative-time.mjs.map +1 -0
  93. package/fesm2022/vadem-ui-reorder-list.mjs +601 -0
  94. package/fesm2022/vadem-ui-reorder-list.mjs.map +1 -0
  95. package/fesm2022/vadem-ui-scroll-area.mjs +65 -0
  96. package/fesm2022/vadem-ui-scroll-area.mjs.map +1 -0
  97. package/fesm2022/vadem-ui-search-input.mjs +307 -0
  98. package/fesm2022/vadem-ui-search-input.mjs.map +1 -0
  99. package/fesm2022/vadem-ui-segmented.mjs +297 -0
  100. package/fesm2022/vadem-ui-segmented.mjs.map +1 -0
  101. package/fesm2022/vadem-ui-select.mjs +1462 -0
  102. package/fesm2022/vadem-ui-select.mjs.map +1 -0
  103. package/fesm2022/vadem-ui-sidebar.mjs +493 -0
  104. package/fesm2022/vadem-ui-sidebar.mjs.map +1 -0
  105. package/fesm2022/vadem-ui-skeleton.mjs +106 -0
  106. package/fesm2022/vadem-ui-skeleton.mjs.map +1 -0
  107. package/fesm2022/vadem-ui-slider.mjs +60 -0
  108. package/fesm2022/vadem-ui-slider.mjs.map +1 -0
  109. package/fesm2022/vadem-ui-splitter.mjs +438 -0
  110. package/fesm2022/vadem-ui-splitter.mjs.map +1 -0
  111. package/fesm2022/vadem-ui-stat.mjs +369 -0
  112. package/fesm2022/vadem-ui-stat.mjs.map +1 -0
  113. package/fesm2022/vadem-ui-stepper.mjs +483 -0
  114. package/fesm2022/vadem-ui-stepper.mjs.map +1 -0
  115. package/fesm2022/vadem-ui-switch.mjs +45 -0
  116. package/fesm2022/vadem-ui-switch.mjs.map +1 -0
  117. package/fesm2022/vadem-ui-table.mjs +593 -0
  118. package/fesm2022/vadem-ui-table.mjs.map +1 -0
  119. package/fesm2022/vadem-ui-tabs.mjs +405 -0
  120. package/fesm2022/vadem-ui-tabs.mjs.map +1 -0
  121. package/fesm2022/vadem-ui-tag-input.mjs +685 -0
  122. package/fesm2022/vadem-ui-tag-input.mjs.map +1 -0
  123. package/fesm2022/vadem-ui-text-highlight.mjs +126 -0
  124. package/fesm2022/vadem-ui-text-highlight.mjs.map +1 -0
  125. package/fesm2022/vadem-ui-time-input.mjs +430 -0
  126. package/fesm2022/vadem-ui-time-input.mjs.map +1 -0
  127. package/fesm2022/vadem-ui-timeline.mjs +313 -0
  128. package/fesm2022/vadem-ui-timeline.mjs.map +1 -0
  129. package/fesm2022/vadem-ui-toast.mjs +397 -0
  130. package/fesm2022/vadem-ui-toast.mjs.map +1 -0
  131. package/fesm2022/vadem-ui-toolbar.mjs +396 -0
  132. package/fesm2022/vadem-ui-toolbar.mjs.map +1 -0
  133. package/fesm2022/vadem-ui-tooltip.mjs +218 -0
  134. package/fesm2022/vadem-ui-tooltip.mjs.map +1 -0
  135. package/fesm2022/vadem-ui-tree.mjs +551 -0
  136. package/fesm2022/vadem-ui-tree.mjs.map +1 -0
  137. package/fesm2022/vadem-ui-upload-list.mjs +408 -0
  138. package/fesm2022/vadem-ui-upload-list.mjs.map +1 -0
  139. package/fesm2022/vadem-ui.mjs +4 -0
  140. package/fesm2022/vadem-ui.mjs.map +1 -0
  141. package/fonts/jetbrains-mono/OFL.txt +93 -0
  142. package/fonts/jetbrains-mono/jetbrains-mono-cyrillic.woff2 +0 -0
  143. package/fonts/jetbrains-mono/jetbrains-mono-latin.woff2 +0 -0
  144. package/fonts/manrope/OFL.txt +93 -0
  145. package/fonts/manrope/manrope-cyrillic.woff2 +0 -0
  146. package/fonts/manrope/manrope-latin.woff2 +0 -0
  147. package/package.json +306 -3
  148. package/styles/base.css +160 -0
  149. package/styles/components/accordion.css +130 -0
  150. package/styles/components/active-filters.css +42 -0
  151. package/styles/components/alert-dialog.css +34 -0
  152. package/styles/components/alert.css +159 -0
  153. package/styles/components/autocomplete.css +97 -0
  154. package/styles/components/avatar.css +90 -0
  155. package/styles/components/badge.css +91 -0
  156. package/styles/components/breadcrumbs.css +94 -0
  157. package/styles/components/button.css +174 -0
  158. package/styles/components/calendar.css +186 -0
  159. package/styles/components/card.css +206 -0
  160. package/styles/components/character-count.css +41 -0
  161. package/styles/components/chart.css +308 -0
  162. package/styles/components/checkbox.css +115 -0
  163. package/styles/components/color-picker.css +158 -0
  164. package/styles/components/command.css +175 -0
  165. package/styles/components/copy-button.css +58 -0
  166. package/styles/components/date-range-picker.css +153 -0
  167. package/styles/components/description-list.css +69 -0
  168. package/styles/components/dialog.css +334 -0
  169. package/styles/components/dropzone.css +89 -0
  170. package/styles/components/editable-text.css +58 -0
  171. package/styles/components/empty-state.css +72 -0
  172. package/styles/components/expandable-text.css +24 -0
  173. package/styles/components/field.css +148 -0
  174. package/styles/components/file-preview.css +65 -0
  175. package/styles/components/form-error-summary.css +71 -0
  176. package/styles/components/icon.css +38 -0
  177. package/styles/components/index.css +80 -0
  178. package/styles/components/input.css +171 -0
  179. package/styles/components/kbd.css +42 -0
  180. package/styles/components/menu.css +168 -0
  181. package/styles/components/multi-select.css +156 -0
  182. package/styles/components/navigation-list.css +147 -0
  183. package/styles/components/number-input.css +33 -0
  184. package/styles/components/otp-input.css +26 -0
  185. package/styles/components/pagination.css +127 -0
  186. package/styles/components/password-input.css +20 -0
  187. package/styles/components/popover.css +93 -0
  188. package/styles/components/progress-ring.css +112 -0
  189. package/styles/components/progress.css +162 -0
  190. package/styles/components/radio.css +117 -0
  191. package/styles/components/range-slider.css +158 -0
  192. package/styles/components/rating.css +100 -0
  193. package/styles/components/reorder-list.css +143 -0
  194. package/styles/components/scroll-area.css +39 -0
  195. package/styles/components/search-input.css +25 -0
  196. package/styles/components/segmented.css +136 -0
  197. package/styles/components/select.css +257 -0
  198. package/styles/components/sidebar.css +105 -0
  199. package/styles/components/skeleton.css +83 -0
  200. package/styles/components/slider.css +132 -0
  201. package/styles/components/splitter.css +83 -0
  202. package/styles/components/stat.css +62 -0
  203. package/styles/components/stepper.css +236 -0
  204. package/styles/components/switch.css +107 -0
  205. package/styles/components/table.css +195 -0
  206. package/styles/components/tabs.css +198 -0
  207. package/styles/components/tag-input.css +138 -0
  208. package/styles/components/text-highlight.css +22 -0
  209. package/styles/components/time-input.css +96 -0
  210. package/styles/components/timeline.css +182 -0
  211. package/styles/components/toast.css +146 -0
  212. package/styles/components/toolbar.css +72 -0
  213. package/styles/components/tooltip.css +93 -0
  214. package/styles/components/tree.css +88 -0
  215. package/styles/components/upload-list.css +113 -0
  216. package/styles/fonts.css +67 -0
  217. package/styles/index.css +14 -0
  218. package/styles/reset.css +57 -0
  219. package/styles/tokens/primitives.css +364 -0
  220. package/styles/tokens/semantic.css +233 -0
  221. package/types/vadem-ui-accordion.d.ts +43 -0
  222. package/types/vadem-ui-active-filters.d.ts +73 -0
  223. package/types/vadem-ui-alert-dialog.d.ts +87 -0
  224. package/types/vadem-ui-alert.d.ts +64 -0
  225. package/types/vadem-ui-autocomplete.d.ts +156 -0
  226. package/types/vadem-ui-avatar.d.ts +59 -0
  227. package/types/vadem-ui-badge.d.ts +25 -0
  228. package/types/vadem-ui-breadcrumbs.d.ts +22 -0
  229. package/types/vadem-ui-button.d.ts +52 -0
  230. package/types/vadem-ui-calendar.d.ts +327 -0
  231. package/types/vadem-ui-card.d.ts +58 -0
  232. package/types/vadem-ui-character-count.d.ts +71 -0
  233. package/types/vadem-ui-chart.d.ts +452 -0
  234. package/types/vadem-ui-checkbox.d.ts +20 -0
  235. package/types/vadem-ui-color-picker.d.ts +171 -0
  236. package/types/vadem-ui-command.d.ts +145 -0
  237. package/types/vadem-ui-copy-button.d.ts +90 -0
  238. package/types/vadem-ui-date-range-picker.d.ts +216 -0
  239. package/types/vadem-ui-description-list.d.ts +15 -0
  240. package/types/vadem-ui-dialog.d.ts +174 -0
  241. package/types/vadem-ui-dropzone.d.ts +73 -0
  242. package/types/vadem-ui-editable-text.d.ts +141 -0
  243. package/types/vadem-ui-empty-state.d.ts +34 -0
  244. package/types/vadem-ui-expandable-text.d.ts +52 -0
  245. package/types/vadem-ui-field.d.ts +180 -0
  246. package/types/vadem-ui-file-preview.d.ts +108 -0
  247. package/types/vadem-ui-file-size.d.ts +18 -0
  248. package/types/vadem-ui-form-error-summary.d.ts +46 -0
  249. package/types/vadem-ui-icon.d.ts +152 -0
  250. package/types/vadem-ui-input.d.ts +31 -0
  251. package/types/vadem-ui-kbd.d.ts +66 -0
  252. package/types/vadem-ui-keyboard.d.ts +61 -0
  253. package/types/vadem-ui-locale.d.ts +241 -0
  254. package/types/vadem-ui-menu.d.ts +132 -0
  255. package/types/vadem-ui-navigation-list.d.ts +28 -0
  256. package/types/vadem-ui-number-input.d.ts +39 -0
  257. package/types/vadem-ui-otp-input.d.ts +15 -0
  258. package/types/vadem-ui-pagination.d.ts +96 -0
  259. package/types/vadem-ui-password-input.d.ts +36 -0
  260. package/types/vadem-ui-popover.d.ts +48 -0
  261. package/types/vadem-ui-progress.d.ts +95 -0
  262. package/types/vadem-ui-radio.d.ts +11 -0
  263. package/types/vadem-ui-range-slider.d.ts +136 -0
  264. package/types/vadem-ui-rating.d.ts +95 -0
  265. package/types/vadem-ui-relative-time.d.ts +58 -0
  266. package/types/vadem-ui-reorder-list.d.ts +120 -0
  267. package/types/vadem-ui-scroll-area.d.ts +13 -0
  268. package/types/vadem-ui-search-input.d.ts +58 -0
  269. package/types/vadem-ui-segmented.d.ts +76 -0
  270. package/types/vadem-ui-select.d.ts +303 -0
  271. package/types/vadem-ui-sidebar.d.ts +70 -0
  272. package/types/vadem-ui-skeleton.d.ts +28 -0
  273. package/types/vadem-ui-slider.d.ts +17 -0
  274. package/types/vadem-ui-splitter.d.ts +99 -0
  275. package/types/vadem-ui-stat.d.ts +101 -0
  276. package/types/vadem-ui-stepper.d.ts +108 -0
  277. package/types/vadem-ui-switch.d.ts +10 -0
  278. package/types/vadem-ui-table.d.ts +172 -0
  279. package/types/vadem-ui-tabs.d.ts +101 -0
  280. package/types/vadem-ui-tag-input.d.ts +170 -0
  281. package/types/vadem-ui-text-highlight.d.ts +27 -0
  282. package/types/vadem-ui-time-input.d.ts +47 -0
  283. package/types/vadem-ui-timeline.d.ts +54 -0
  284. package/types/vadem-ui-toast.d.ts +104 -0
  285. package/types/vadem-ui-toolbar.d.ts +80 -0
  286. package/types/vadem-ui-tooltip.d.ts +71 -0
  287. package/types/vadem-ui-tree.d.ts +123 -0
  288. package/types/vadem-ui-upload-list.d.ts +70 -0
  289. package/types/vadem-ui.d.ts +1 -0
@@ -0,0 +1,65 @@
1
+ import * as i0 from "@angular/core";
2
+ import { Directive, input } from "@angular/core";
3
+ var VdScrollArea = class VdScrollArea {
4
+ label = input.required(...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
5
+ static ɵfac = i0.ɵɵngDeclareFactory({
6
+ minVersion: "12.0.0",
7
+ version: "22.2.1",
8
+ ngImport: i0,
9
+ type: VdScrollArea,
10
+ deps: [],
11
+ target: i0.ɵɵFactoryTarget.Directive
12
+ });
13
+ static ɵdir = i0.ɵɵngDeclareDirective({
14
+ minVersion: "17.1.0",
15
+ version: "22.2.1",
16
+ type: VdScrollArea,
17
+ isStandalone: true,
18
+ selector: "[vdScrollArea]",
19
+ inputs: { label: {
20
+ classPropertyName: "label",
21
+ publicName: "label",
22
+ isSignal: true,
23
+ isRequired: true,
24
+ transformFunction: null
25
+ } },
26
+ host: {
27
+ attributes: {
28
+ "role": "region",
29
+ "tabindex": "0"
30
+ },
31
+ properties: { "attr.aria-label": "label()" },
32
+ classAttribute: "vd-scroll-area"
33
+ },
34
+ ngImport: i0
35
+ });
36
+ };
37
+ i0.ɵɵngDeclareClassMetadata({
38
+ minVersion: "12.0.0",
39
+ version: "22.2.1",
40
+ ngImport: i0,
41
+ type: VdScrollArea,
42
+ decorators: [{
43
+ type: Directive,
44
+ args: [{
45
+ selector: "[vdScrollArea]",
46
+ host: {
47
+ class: "vd-scroll-area",
48
+ role: "region",
49
+ tabindex: "0",
50
+ "[attr.aria-label]": "label()"
51
+ }
52
+ }]
53
+ }],
54
+ propDecorators: { label: [{
55
+ type: i0.Input,
56
+ args: [{
57
+ isSignal: true,
58
+ alias: "label",
59
+ required: true
60
+ }]
61
+ }] }
62
+ });
63
+ export { VdScrollArea };
64
+
65
+ //# sourceMappingURL=vadem-ui-scroll-area.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vadem-ui-scroll-area.mjs","names":[],"sources":["../../../projects/ui/scroll-area/src/scroll-area.ts"],"sourcesContent":["import { Directive, input } from '@angular/core';\n\n/** A named native scroll viewport; the browser owns all scrolling and descendant keys. */\n@Directive({\n selector: '[vdScrollArea]',\n host: {\n class: 'vd-scroll-area',\n role: 'region',\n tabindex: '0',\n '[attr.aria-label]': 'label()',\n },\n})\nexport class VdScrollArea {\n readonly label = input.required<string>();\n}\n"],"mappings":";;AAYA,IAAa,eAAb,MAAa,aAAY;CACd,QAAQ,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAD9B,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAY,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAZ,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAY,cAAA;EAAA,UAAA;EAAA,QAAA,EAAA,OAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,MAAA;GAAA,YAAA;IAAA,QAAA;IAAA,YAAA;GAAA;GAAA,YAAA,EAAA,mBAAA,UAAA;GAAA,gBAAA;EAAA;EAAA,UAAA;CAAA,CAAA;;AAAZ,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAY,YAAA,CAAA;EATxB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,MAAM;IACJ,OAAO;IACP,MAAM;IACN,UAAU;IACV,qBAAqB;GACtB;EACF,CAAA"}
@@ -0,0 +1,307 @@
1
+ import { DOCUMENT } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { ChangeDetectionStrategy, Component, Directive, ElementRef, ViewEncapsulation, afterEveryRender, booleanAttribute, contentChild, inject, input, output, signal } from "@angular/core";
4
+ import { VdButton } from "@vadem/ui/button";
5
+ import { VdIcon } from "@vadem/ui/icon";
6
+ import { VdInput } from "@vadem/ui/input";
7
+ import { vdTexts } from "@vadem/ui/locale";
8
+ import { VdProgressRing } from "@vadem/ui/progress";
9
+ var VdSearchInput = class VdSearchInput extends VdInput {
10
+ element = inject(ElementRef).nativeElement;
11
+ cleared = output();
12
+ document = inject(DOCUMENT);
13
+ hasValue = signal(false, ...ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []);
14
+ filled = this.hasValue.asReadonly();
15
+ editable = signal(true, ...ngDevMode ? [{ debugName: "editable" }] : /* istanbul ignore next */ []);
16
+ canClear = this.editable.asReadonly();
17
+ constructor() {
18
+ super();
19
+ afterEveryRender(() => {
20
+ this.sync();
21
+ this.editable.set(!this.element.disabled && !this.element.readOnly);
22
+ });
23
+ }
24
+ sync() {
25
+ this.hasValue.set(this.element.value !== "");
26
+ }
27
+ onEscape(event) {
28
+ if (!this.hasValue() || !this.editable()) return;
29
+ event.preventDefault();
30
+ event.stopPropagation();
31
+ this.clear();
32
+ }
33
+ clear() {
34
+ if (!this.editable()) return;
35
+ this.element.value = "";
36
+ this.element.dispatchEvent(new Event("input", { bubbles: true }));
37
+ this.element.dispatchEvent(new Event("search", { bubbles: true }));
38
+ this.sync();
39
+ if (this.document.activeElement !== this.element) this.element.focus();
40
+ this.cleared.emit();
41
+ }
42
+ preserveFocus(event) {
43
+ if (event.button === 0) event.preventDefault();
44
+ }
45
+ static ɵfac = i0.ɵɵngDeclareFactory({
46
+ minVersion: "12.0.0",
47
+ version: "22.2.1",
48
+ ngImport: i0,
49
+ type: VdSearchInput,
50
+ deps: [],
51
+ target: i0.ɵɵFactoryTarget.Directive
52
+ });
53
+ static ɵdir = i0.ɵɵngDeclareDirective({
54
+ minVersion: "14.0.0",
55
+ version: "22.2.1",
56
+ type: VdSearchInput,
57
+ isStandalone: true,
58
+ selector: "input[type=search][vdSearchInput]",
59
+ outputs: { cleared: "cleared" },
60
+ host: {
61
+ listeners: {
62
+ "input": "sync()",
63
+ "keydown.escape": "onEscape($event)"
64
+ },
65
+ classAttribute: "vd-search-input__input"
66
+ },
67
+ exportAs: ["vdSearchInput"],
68
+ usesInheritance: true,
69
+ ngImport: i0
70
+ });
71
+ };
72
+ i0.ɵɵngDeclareClassMetadata({
73
+ minVersion: "12.0.0",
74
+ version: "22.2.1",
75
+ ngImport: i0,
76
+ type: VdSearchInput,
77
+ decorators: [{
78
+ type: Directive,
79
+ args: [{
80
+ selector: "input[type=search][vdSearchInput]",
81
+ exportAs: "vdSearchInput",
82
+ host: {
83
+ class: "vd-search-input__input",
84
+ "(input)": "sync()",
85
+ "(keydown.escape)": "onEscape($event)"
86
+ }
87
+ }]
88
+ }],
89
+ ctorParameters: () => [],
90
+ propDecorators: { cleared: [{
91
+ type: i0.Output,
92
+ args: ["cleared"]
93
+ }] }
94
+ });
95
+ var VdSearchInputGroup = class VdSearchInputGroup {
96
+ loading = input(false, {
97
+ ...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
98
+ transform: booleanAttribute
99
+ });
100
+ clearLabel = input(...ngDevMode ? [void 0, { debugName: "clearLabel" }] : /* istanbul ignore next */ []);
101
+ loadingLabel = input(...ngDevMode ? [void 0, { debugName: "loadingLabel" }] : /* istanbul ignore next */ []);
102
+ t = vdTexts("searchInput", {
103
+ clearLabel: this.clearLabel,
104
+ loadingLabel: this.loadingLabel
105
+ });
106
+ control = contentChild(VdSearchInput, ...ngDevMode ? [{ debugName: "control" }] : /* istanbul ignore next */ []);
107
+ static ɵfac = i0.ɵɵngDeclareFactory({
108
+ minVersion: "12.0.0",
109
+ version: "22.2.1",
110
+ ngImport: i0,
111
+ type: VdSearchInputGroup,
112
+ deps: [],
113
+ target: i0.ɵɵFactoryTarget.Component
114
+ });
115
+ static ɵcmp = i0.ɵɵngDeclareComponent({
116
+ minVersion: "17.0.0",
117
+ version: "22.2.1",
118
+ type: VdSearchInputGroup,
119
+ isStandalone: true,
120
+ selector: "vd-search-input",
121
+ inputs: {
122
+ loading: {
123
+ classPropertyName: "loading",
124
+ publicName: "loading",
125
+ isSignal: true,
126
+ isRequired: false,
127
+ transformFunction: null
128
+ },
129
+ clearLabel: {
130
+ classPropertyName: "clearLabel",
131
+ publicName: "clearLabel",
132
+ isSignal: true,
133
+ isRequired: false,
134
+ transformFunction: null
135
+ },
136
+ loadingLabel: {
137
+ classPropertyName: "loadingLabel",
138
+ publicName: "loadingLabel",
139
+ isSignal: true,
140
+ isRequired: false,
141
+ transformFunction: null
142
+ }
143
+ },
144
+ host: {
145
+ properties: {
146
+ "attr.data-filled": "control()?.filled() ? \"\" : null",
147
+ "attr.data-loading": "loading() ? \"\" : null"
148
+ },
149
+ classAttribute: "vd-input-group vd-search-input"
150
+ },
151
+ queries: [{
152
+ propertyName: "control",
153
+ first: true,
154
+ predicate: VdSearchInput,
155
+ descendants: true,
156
+ isSignal: true
157
+ }],
158
+ ngImport: i0,
159
+ template: `
160
+ <vd-icon slot="start" name="search" />
161
+ <ng-content select="input[vdSearchInput]" />
162
+ @if (loading()) {
163
+ <vd-progress-ring slot="end" size="sm" [label]="t().loadingLabel" />
164
+ }
165
+ @if (control()?.filled() && control()?.canClear()) {
166
+ <button
167
+ vdButton
168
+ type="button"
169
+ variant="ghost"
170
+ iconOnly
171
+ slot="end"
172
+ class="vd-search-input__clear"
173
+ [size]="control()?.size() ?? 'md'"
174
+ [attr.aria-label]="t().clearLabel"
175
+ [attr.aria-controls]="control()?.id() ?? null"
176
+ (mousedown)="control()?.preserveFocus($event)"
177
+ (click)="control()?.clear()"
178
+ >
179
+ <vd-icon name="x" />
180
+ </button>
181
+ } @else {
182
+ <ng-content select="[slot=end]" />
183
+ }
184
+ `,
185
+ isInline: true,
186
+ dependencies: [
187
+ {
188
+ kind: "component",
189
+ type: VdButton,
190
+ selector: "button[vdButton], a[vdButton]",
191
+ inputs: [
192
+ "variant",
193
+ "size",
194
+ "disabled",
195
+ "loading",
196
+ "iconOnly",
197
+ "type"
198
+ ]
199
+ },
200
+ {
201
+ kind: "component",
202
+ type: VdIcon,
203
+ selector: "vd-icon",
204
+ inputs: ["name", "label"]
205
+ },
206
+ {
207
+ kind: "component",
208
+ type: VdProgressRing,
209
+ selector: "vd-progress-ring",
210
+ inputs: [
211
+ "value",
212
+ "max",
213
+ "size",
214
+ "variant",
215
+ "showValue",
216
+ "label"
217
+ ]
218
+ }
219
+ ],
220
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
221
+ encapsulation: i0.ViewEncapsulation.None
222
+ });
223
+ };
224
+ i0.ɵɵngDeclareClassMetadata({
225
+ minVersion: "12.0.0",
226
+ version: "22.2.1",
227
+ ngImport: i0,
228
+ type: VdSearchInputGroup,
229
+ decorators: [{
230
+ type: Component,
231
+ args: [{
232
+ selector: "vd-search-input",
233
+ imports: [
234
+ VdButton,
235
+ VdIcon,
236
+ VdProgressRing
237
+ ],
238
+ template: `
239
+ <vd-icon slot="start" name="search" />
240
+ <ng-content select="input[vdSearchInput]" />
241
+ @if (loading()) {
242
+ <vd-progress-ring slot="end" size="sm" [label]="t().loadingLabel" />
243
+ }
244
+ @if (control()?.filled() && control()?.canClear()) {
245
+ <button
246
+ vdButton
247
+ type="button"
248
+ variant="ghost"
249
+ iconOnly
250
+ slot="end"
251
+ class="vd-search-input__clear"
252
+ [size]="control()?.size() ?? 'md'"
253
+ [attr.aria-label]="t().clearLabel"
254
+ [attr.aria-controls]="control()?.id() ?? null"
255
+ (mousedown)="control()?.preserveFocus($event)"
256
+ (click)="control()?.clear()"
257
+ >
258
+ <vd-icon name="x" />
259
+ </button>
260
+ } @else {
261
+ <ng-content select="[slot=end]" />
262
+ }
263
+ `,
264
+ host: {
265
+ class: "vd-input-group vd-search-input",
266
+ "[attr.data-filled]": "control()?.filled() ? \"\" : null",
267
+ "[attr.data-loading]": "loading() ? \"\" : null"
268
+ },
269
+ changeDetection: ChangeDetectionStrategy.OnPush,
270
+ encapsulation: ViewEncapsulation.None
271
+ }]
272
+ }],
273
+ propDecorators: {
274
+ loading: [{
275
+ type: i0.Input,
276
+ args: [{
277
+ isSignal: true,
278
+ alias: "loading",
279
+ required: false
280
+ }]
281
+ }],
282
+ clearLabel: [{
283
+ type: i0.Input,
284
+ args: [{
285
+ isSignal: true,
286
+ alias: "clearLabel",
287
+ required: false
288
+ }]
289
+ }],
290
+ loadingLabel: [{
291
+ type: i0.Input,
292
+ args: [{
293
+ isSignal: true,
294
+ alias: "loadingLabel",
295
+ required: false
296
+ }]
297
+ }],
298
+ control: [{
299
+ type: i0.ContentChild,
300
+ args: [i0.forwardRef(() => VdSearchInput), { isSignal: true }]
301
+ }]
302
+ }
303
+ });
304
+ const VD_SEARCH_INPUT = [VdSearchInputGroup, VdSearchInput];
305
+ export { VD_SEARCH_INPUT, VdSearchInput, VdSearchInputGroup };
306
+
307
+ //# sourceMappingURL=vadem-ui-search-input.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vadem-ui-search-input.mjs","names":[],"sources":["../../../projects/ui/search-input/src/search-input.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport {\n afterEveryRender,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n contentChild,\n Directive,\n ElementRef,\n inject,\n input,\n output,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport { VdButton } from '@vadem/ui/button';\nimport { VdIcon } from '@vadem/ui/icon';\nimport { VdInput } from '@vadem/ui/input';\nimport { vdTexts } from '@vadem/ui/locale';\nimport { VdProgressRing } from '@vadem/ui/progress';\n\n/**\n * Native `input[type=search]`: value, forms accessor and the `search` event stay native.\n * Adds consistent Escape-to-clear and a clear action. Spec: specs/search-input.md\n */\n@Directive({\n selector: 'input[type=search][vdSearchInput]',\n exportAs: 'vdSearchInput',\n host: {\n class: 'vd-search-input__input',\n '(input)': 'sync()',\n '(keydown.escape)': 'onEscape($event)',\n },\n})\nexport class VdSearchInput extends VdInput {\n readonly element: HTMLInputElement = inject(ElementRef).nativeElement;\n /** Emits after the value was cleared by the button or Escape. */\n readonly cleared = output<void>();\n\n private readonly document = inject(DOCUMENT);\n private readonly hasValue = signal(false);\n readonly filled = this.hasValue.asReadonly();\n private readonly editable = signal(true);\n readonly canClear = this.editable.asReadonly();\n\n constructor() {\n super();\n // Forms can set the value programmatically without an input event.\n afterEveryRender(() => {\n this.sync();\n this.editable.set(!this.element.disabled && !this.element.readOnly);\n });\n }\n\n protected sync(): void {\n this.hasValue.set(this.element.value !== '');\n }\n\n /** Escape clears a non-empty field; an empty field lets Escape reach outer handlers (dialogs). */\n protected onEscape(event: Event): void {\n if (!this.hasValue() || !this.editable()) return;\n event.preventDefault();\n event.stopPropagation();\n this.clear();\n }\n\n clear(): void {\n if (!this.editable()) return;\n this.element.value = '';\n // Forms and consumers listen to the native events.\n this.element.dispatchEvent(new Event('input', { bubbles: true }));\n this.element.dispatchEvent(new Event('search', { bubbles: true }));\n this.sync();\n if (this.document.activeElement !== this.element) this.element.focus();\n this.cleared.emit();\n }\n\n /** Pointer activation keeps the caret in the field. */\n preserveFocus(event: MouseEvent): void {\n if (event.button === 0) event.preventDefault();\n }\n}\n\n@Component({\n selector: 'vd-search-input',\n imports: [VdButton, VdIcon, VdProgressRing],\n template: `\n <vd-icon slot=\"start\" name=\"search\" />\n <ng-content select=\"input[vdSearchInput]\" />\n @if (loading()) {\n <vd-progress-ring slot=\"end\" size=\"sm\" [label]=\"t().loadingLabel\" />\n }\n @if (control()?.filled() && control()?.canClear()) {\n <button\n vdButton\n type=\"button\"\n variant=\"ghost\"\n iconOnly\n slot=\"end\"\n class=\"vd-search-input__clear\"\n [size]=\"control()?.size() ?? 'md'\"\n [attr.aria-label]=\"t().clearLabel\"\n [attr.aria-controls]=\"control()?.id() ?? null\"\n (mousedown)=\"control()?.preserveFocus($event)\"\n (click)=\"control()?.clear()\"\n >\n <vd-icon name=\"x\" />\n </button>\n } @else {\n <ng-content select=\"[slot=end]\" />\n }\n `,\n host: {\n class: 'vd-input-group vd-search-input',\n '[attr.data-filled]': 'control()?.filled() ? \"\" : null',\n '[attr.data-loading]': 'loading() ? \"\" : null',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class VdSearchInputGroup {\n /** Shows a spinner while results load; the field stays editable. */\n readonly loading = input(false, { transform: booleanAttribute });\n readonly clearLabel = input<string>();\n readonly loadingLabel = input<string>();\n /** Text inputs resolved against the active VD_LOCALE. */\n protected readonly t = vdTexts('searchInput', {\n clearLabel: this.clearLabel,\n loadingLabel: this.loadingLabel,\n });\n protected readonly control = contentChild(VdSearchInput);\n}\n\nexport const VD_SEARCH_INPUT = [VdSearchInputGroup, VdSearchInput] as const;\n"],"mappings":"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"}
@@ -0,0 +1,297 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, ViewEncapsulation, booleanAttribute, computed, forwardRef, inject, input, model, signal } from "@angular/core";
3
+ import { NG_VALUE_ACCESSOR } from "@angular/forms";
4
+ import { vdUniqueId } from "@vadem/ui/field";
5
+ var VdSegmented = class VdSegmented {
6
+ value = model(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
7
+ size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
8
+ disabled = input(false, {
9
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
10
+ transform: booleanAttribute
11
+ });
12
+ name = vdUniqueId("vd-segmented");
13
+ formDisabled = signal(false, ...ngDevMode ? [{ debugName: "formDisabled" }] : /* istanbul ignore next */ []);
14
+ isDisabled = computed(() => this.disabled() || this.formDisabled(), ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
15
+ onChange = () => void 0;
16
+ onTouched = () => void 0;
17
+ select(value) {
18
+ if (this.isDisabled() || value === this.value()) return;
19
+ this.value.set(value);
20
+ this.onChange(value);
21
+ }
22
+ onFocusOut(event) {
23
+ if (!event.currentTarget.contains(event.relatedTarget)) this.onTouched();
24
+ }
25
+ writeValue(value) {
26
+ this.value.set(value ?? null);
27
+ }
28
+ registerOnChange(fn) {
29
+ this.onChange = fn;
30
+ }
31
+ registerOnTouched(fn) {
32
+ this.onTouched = fn;
33
+ }
34
+ setDisabledState(disabled) {
35
+ this.formDisabled.set(disabled);
36
+ }
37
+ static ɵfac = i0.ɵɵngDeclareFactory({
38
+ minVersion: "12.0.0",
39
+ version: "22.2.1",
40
+ ngImport: i0,
41
+ type: VdSegmented,
42
+ deps: [],
43
+ target: i0.ɵɵFactoryTarget.Component
44
+ });
45
+ static ɵcmp = i0.ɵɵngDeclareComponent({
46
+ minVersion: "17.1.0",
47
+ version: "22.2.1",
48
+ type: VdSegmented,
49
+ isStandalone: true,
50
+ selector: "vd-segmented",
51
+ inputs: {
52
+ value: {
53
+ classPropertyName: "value",
54
+ publicName: "value",
55
+ isSignal: true,
56
+ isRequired: false,
57
+ transformFunction: null
58
+ },
59
+ size: {
60
+ classPropertyName: "size",
61
+ publicName: "size",
62
+ isSignal: true,
63
+ isRequired: false,
64
+ transformFunction: null
65
+ },
66
+ disabled: {
67
+ classPropertyName: "disabled",
68
+ publicName: "disabled",
69
+ isSignal: true,
70
+ isRequired: false,
71
+ transformFunction: null
72
+ }
73
+ },
74
+ outputs: { value: "valueChange" },
75
+ host: {
76
+ attributes: { "role": "radiogroup" },
77
+ listeners: { "focusout": "onFocusOut($event)" },
78
+ properties: {
79
+ "attr.data-size": "size()",
80
+ "attr.data-disabled": "isDisabled() ? \"\" : null",
81
+ "attr.aria-disabled": "isDisabled() || null"
82
+ },
83
+ classAttribute: "vd-segmented"
84
+ },
85
+ providers: [{
86
+ provide: NG_VALUE_ACCESSOR,
87
+ useExisting: forwardRef(() => VdSegmented),
88
+ multi: true
89
+ }],
90
+ ngImport: i0,
91
+ template: `<ng-content />`,
92
+ isInline: true,
93
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
94
+ encapsulation: i0.ViewEncapsulation.None
95
+ });
96
+ };
97
+ i0.ɵɵngDeclareClassMetadata({
98
+ minVersion: "12.0.0",
99
+ version: "22.2.1",
100
+ ngImport: i0,
101
+ type: VdSegmented,
102
+ decorators: [{
103
+ type: Component,
104
+ args: [{
105
+ selector: "vd-segmented",
106
+ template: `<ng-content />`,
107
+ host: {
108
+ class: "vd-segmented",
109
+ role: "radiogroup",
110
+ "[attr.data-size]": "size()",
111
+ "[attr.data-disabled]": "isDisabled() ? \"\" : null",
112
+ "[attr.aria-disabled]": "isDisabled() || null",
113
+ "(focusout)": "onFocusOut($event)"
114
+ },
115
+ providers: [{
116
+ provide: NG_VALUE_ACCESSOR,
117
+ useExisting: forwardRef(() => VdSegmented),
118
+ multi: true
119
+ }],
120
+ changeDetection: ChangeDetectionStrategy.OnPush,
121
+ encapsulation: ViewEncapsulation.None
122
+ }]
123
+ }],
124
+ propDecorators: {
125
+ value: [{
126
+ type: i0.Input,
127
+ args: [{
128
+ isSignal: true,
129
+ alias: "value",
130
+ required: false
131
+ }]
132
+ }, {
133
+ type: i0.Output,
134
+ args: ["valueChange"]
135
+ }],
136
+ size: [{
137
+ type: i0.Input,
138
+ args: [{
139
+ isSignal: true,
140
+ alias: "size",
141
+ required: false
142
+ }]
143
+ }],
144
+ disabled: [{
145
+ type: i0.Input,
146
+ args: [{
147
+ isSignal: true,
148
+ alias: "disabled",
149
+ required: false
150
+ }]
151
+ }]
152
+ }
153
+ });
154
+ var VdSegment = class VdSegment {
155
+ value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
156
+ disabled = input(false, {
157
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
158
+ transform: booleanAttribute
159
+ });
160
+ ariaLabel = input(void 0, {
161
+ ...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
162
+ alias: "aria-label"
163
+ });
164
+ group = inject(VdSegmented);
165
+ labelId = vdUniqueId("vd-segment-label");
166
+ checked = computed(() => this.group.value() === this.value(), ...ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []);
167
+ isDisabled = computed(() => this.disabled() || this.group.isDisabled(), ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
168
+ static ɵfac = i0.ɵɵngDeclareFactory({
169
+ minVersion: "12.0.0",
170
+ version: "22.2.1",
171
+ ngImport: i0,
172
+ type: VdSegment,
173
+ deps: [],
174
+ target: i0.ɵɵFactoryTarget.Component
175
+ });
176
+ static ɵcmp = i0.ɵɵngDeclareComponent({
177
+ minVersion: "17.1.0",
178
+ version: "22.2.1",
179
+ type: VdSegment,
180
+ isStandalone: true,
181
+ selector: "vd-segment",
182
+ inputs: {
183
+ value: {
184
+ classPropertyName: "value",
185
+ publicName: "value",
186
+ isSignal: true,
187
+ isRequired: true,
188
+ transformFunction: null
189
+ },
190
+ disabled: {
191
+ classPropertyName: "disabled",
192
+ publicName: "disabled",
193
+ isSignal: true,
194
+ isRequired: false,
195
+ transformFunction: null
196
+ },
197
+ ariaLabel: {
198
+ classPropertyName: "ariaLabel",
199
+ publicName: "aria-label",
200
+ isSignal: true,
201
+ isRequired: false,
202
+ transformFunction: null
203
+ }
204
+ },
205
+ host: {
206
+ properties: {
207
+ "attr.data-checked": "checked() ? \"\" : null",
208
+ "attr.data-disabled": "isDisabled() ? \"\" : null",
209
+ "attr.data-icon-only": "ariaLabel() ? \"\" : null",
210
+ "attr.aria-label": "null"
211
+ },
212
+ classAttribute: "vd-segment"
213
+ },
214
+ ngImport: i0,
215
+ template: `
216
+ <input
217
+ type="radio"
218
+ class="vd-segment__input"
219
+ [name]="group.name"
220
+ [value]="value()"
221
+ [checked]="checked()"
222
+ [disabled]="isDisabled()"
223
+ [attr.aria-label]="ariaLabel() ?? null"
224
+ [attr.aria-labelledby]="ariaLabel() ? null : labelId"
225
+ (change)="group.select(value())"
226
+ />
227
+ <span class="vd-segment__label" [id]="labelId"><ng-content /></span>
228
+ `,
229
+ isInline: true,
230
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
231
+ encapsulation: i0.ViewEncapsulation.None
232
+ });
233
+ };
234
+ i0.ɵɵngDeclareClassMetadata({
235
+ minVersion: "12.0.0",
236
+ version: "22.2.1",
237
+ ngImport: i0,
238
+ type: VdSegment,
239
+ decorators: [{
240
+ type: Component,
241
+ args: [{
242
+ selector: "vd-segment",
243
+ template: `
244
+ <input
245
+ type="radio"
246
+ class="vd-segment__input"
247
+ [name]="group.name"
248
+ [value]="value()"
249
+ [checked]="checked()"
250
+ [disabled]="isDisabled()"
251
+ [attr.aria-label]="ariaLabel() ?? null"
252
+ [attr.aria-labelledby]="ariaLabel() ? null : labelId"
253
+ (change)="group.select(value())"
254
+ />
255
+ <span class="vd-segment__label" [id]="labelId"><ng-content /></span>
256
+ `,
257
+ host: {
258
+ class: "vd-segment",
259
+ "[attr.data-checked]": "checked() ? \"\" : null",
260
+ "[attr.data-disabled]": "isDisabled() ? \"\" : null",
261
+ "[attr.data-icon-only]": "ariaLabel() ? \"\" : null",
262
+ "[attr.aria-label]": "null"
263
+ },
264
+ changeDetection: ChangeDetectionStrategy.OnPush,
265
+ encapsulation: ViewEncapsulation.None
266
+ }]
267
+ }],
268
+ propDecorators: {
269
+ value: [{
270
+ type: i0.Input,
271
+ args: [{
272
+ isSignal: true,
273
+ alias: "value",
274
+ required: true
275
+ }]
276
+ }],
277
+ disabled: [{
278
+ type: i0.Input,
279
+ args: [{
280
+ isSignal: true,
281
+ alias: "disabled",
282
+ required: false
283
+ }]
284
+ }],
285
+ ariaLabel: [{
286
+ type: i0.Input,
287
+ args: [{
288
+ isSignal: true,
289
+ alias: "aria-label",
290
+ required: false
291
+ }]
292
+ }]
293
+ }
294
+ });
295
+ export { VdSegment, VdSegmented };
296
+
297
+ //# sourceMappingURL=vadem-ui-segmented.mjs.map