@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,178 @@
1
+ import * as i0 from "@angular/core";
2
+ import { DestroyRef, Directive, ElementRef, afterNextRender, inject, input, signal } from "@angular/core";
3
+ import { vdUniqueId } from "@vadem/ui/field";
4
+ var VdPopover = class VdPopover {
5
+ placement = input("bottom", ...ngDevMode ? [{ debugName: "placement" }] : /* istanbul ignore next */ []);
6
+ id = vdUniqueId("vd-popover");
7
+ el = inject(ElementRef).nativeElement;
8
+ hide() {
9
+ if (this.el.matches(":popover-open")) this.el.hidePopover();
10
+ }
11
+ static ɵfac = i0.ɵɵngDeclareFactory({
12
+ minVersion: "12.0.0",
13
+ version: "22.2.1",
14
+ ngImport: i0,
15
+ type: VdPopover,
16
+ deps: [],
17
+ target: i0.ɵɵFactoryTarget.Directive
18
+ });
19
+ static ɵdir = i0.ɵɵngDeclareDirective({
20
+ minVersion: "17.1.0",
21
+ version: "22.2.1",
22
+ type: VdPopover,
23
+ isStandalone: true,
24
+ selector: "[vdPopover]",
25
+ inputs: { placement: {
26
+ classPropertyName: "placement",
27
+ publicName: "placement",
28
+ isSignal: true,
29
+ isRequired: false,
30
+ transformFunction: null
31
+ } },
32
+ host: {
33
+ attributes: {
34
+ "popover": "auto",
35
+ "role": "dialog"
36
+ },
37
+ properties: {
38
+ "id": "id",
39
+ "attr.data-placement": "placement()"
40
+ },
41
+ classAttribute: "vd-popover"
42
+ },
43
+ exportAs: ["vdPopover"],
44
+ ngImport: i0
45
+ });
46
+ };
47
+ i0.ɵɵngDeclareClassMetadata({
48
+ minVersion: "12.0.0",
49
+ version: "22.2.1",
50
+ ngImport: i0,
51
+ type: VdPopover,
52
+ decorators: [{
53
+ type: Directive,
54
+ args: [{
55
+ selector: "[vdPopover]",
56
+ exportAs: "vdPopover",
57
+ host: {
58
+ class: "vd-popover",
59
+ popover: "auto",
60
+ role: "dialog",
61
+ "[id]": "id",
62
+ "[attr.data-placement]": "placement()"
63
+ }
64
+ }]
65
+ }],
66
+ propDecorators: { placement: [{
67
+ type: i0.Input,
68
+ args: [{
69
+ isSignal: true,
70
+ alias: "placement",
71
+ required: false
72
+ }]
73
+ }] }
74
+ });
75
+ var VdPopoverTrigger = class VdPopoverTrigger {
76
+ vdPopoverTrigger = input.required(...ngDevMode ? [{ debugName: "vdPopoverTrigger" }] : /* istanbul ignore next */ []);
77
+ open = signal(false, ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
78
+ el = inject(ElementRef).nativeElement;
79
+ constructor() {
80
+ const destroyRef = inject(DestroyRef);
81
+ afterNextRender(() => {
82
+ const popover = this.vdPopoverTrigger();
83
+ const name = `--${popover.id}`;
84
+ this.el.style.setProperty("anchor-name", name);
85
+ popover.el.style.setProperty("position-anchor", name);
86
+ const onToggle = (event) => {
87
+ const opened = event.newState === "open";
88
+ this.open.set(opened);
89
+ if (opened) this.focusInside(popover.el);
90
+ };
91
+ popover.el.addEventListener("toggle", onToggle);
92
+ destroyRef.onDestroy(() => popover.el.removeEventListener("toggle", onToggle));
93
+ });
94
+ }
95
+ openAtPress = null;
96
+ rememberState() {
97
+ this.openAtPress = this.vdPopoverTrigger().el.matches(":popover-open");
98
+ }
99
+ toggle() {
100
+ const popover = this.vdPopoverTrigger().el;
101
+ const wasOpen = this.openAtPress ?? popover.matches(":popover-open");
102
+ this.openAtPress = null;
103
+ if (wasOpen) {
104
+ if (popover.matches(":popover-open")) popover.hidePopover();
105
+ } else popover.showPopover({ source: this.el });
106
+ }
107
+ focusInside(panel) {
108
+ (panel.querySelector("[autofocus]") ?? panel.querySelector("button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])"))?.focus();
109
+ }
110
+ static ɵfac = i0.ɵɵngDeclareFactory({
111
+ minVersion: "12.0.0",
112
+ version: "22.2.1",
113
+ ngImport: i0,
114
+ type: VdPopoverTrigger,
115
+ deps: [],
116
+ target: i0.ɵɵFactoryTarget.Directive
117
+ });
118
+ static ɵdir = i0.ɵɵngDeclareDirective({
119
+ minVersion: "17.1.0",
120
+ version: "22.2.1",
121
+ type: VdPopoverTrigger,
122
+ isStandalone: true,
123
+ selector: "button[vdPopoverTrigger]",
124
+ inputs: { vdPopoverTrigger: {
125
+ classPropertyName: "vdPopoverTrigger",
126
+ publicName: "vdPopoverTrigger",
127
+ isSignal: true,
128
+ isRequired: true,
129
+ transformFunction: null
130
+ } },
131
+ host: {
132
+ attributes: { "aria-haspopup": "dialog" },
133
+ listeners: {
134
+ "pointerdown": "rememberState()",
135
+ "click": "toggle()"
136
+ },
137
+ properties: {
138
+ "attr.aria-expanded": "open()",
139
+ "attr.aria-controls": "vdPopoverTrigger().id",
140
+ "attr.data-state": "open() ? \"open\" : \"closed\""
141
+ }
142
+ },
143
+ ngImport: i0
144
+ });
145
+ };
146
+ i0.ɵɵngDeclareClassMetadata({
147
+ minVersion: "12.0.0",
148
+ version: "22.2.1",
149
+ ngImport: i0,
150
+ type: VdPopoverTrigger,
151
+ decorators: [{
152
+ type: Directive,
153
+ args: [{
154
+ selector: "button[vdPopoverTrigger]",
155
+ host: {
156
+ "aria-haspopup": "dialog",
157
+ "[attr.aria-expanded]": "open()",
158
+ "[attr.aria-controls]": "vdPopoverTrigger().id",
159
+ "[attr.data-state]": "open() ? \"open\" : \"closed\"",
160
+ "(pointerdown)": "rememberState()",
161
+ "(click)": "toggle()"
162
+ }
163
+ }]
164
+ }],
165
+ ctorParameters: () => [],
166
+ propDecorators: { vdPopoverTrigger: [{
167
+ type: i0.Input,
168
+ args: [{
169
+ isSignal: true,
170
+ alias: "vdPopoverTrigger",
171
+ required: true
172
+ }]
173
+ }] }
174
+ });
175
+ const VD_POPOVER = [VdPopover, VdPopoverTrigger];
176
+ export { VD_POPOVER, VdPopover, VdPopoverTrigger };
177
+
178
+ //# sourceMappingURL=vadem-ui-popover.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vadem-ui-popover.mjs","names":[],"sources":["../../../projects/ui/popover/src/popover.ts"],"sourcesContent":["import {\n DestroyRef,\n Directive,\n ElementRef,\n afterNextRender,\n inject,\n input,\n signal,\n} from '@angular/core';\nimport { vdUniqueId } from '@vadem/ui/field';\n\nexport type VdPopoverPlacement = 'bottom' | 'top' | 'start' | 'end';\n\n/**\n * Non-modal floating panel with any content (filters, a share form, details): a\n * `popover=\"auto\"` in the top layer, anchored to its trigger with CSS anchor positioning.\n * Light dismiss and Escape are native. Give it a name (`aria-label` / `aria-labelledby`).\n * Spec: specs/popover.md\n */\n@Directive({\n selector: '[vdPopover]',\n exportAs: 'vdPopover',\n host: {\n class: 'vd-popover',\n popover: 'auto',\n role: 'dialog',\n '[id]': 'id',\n '[attr.data-placement]': 'placement()',\n },\n})\nexport class VdPopover {\n readonly placement = input<VdPopoverPlacement>('bottom');\n readonly id = vdUniqueId('vd-popover');\n readonly el: HTMLElement = inject(ElementRef).nativeElement;\n\n hide(): void {\n if (this.el.matches(':popover-open')) this.el.hidePopover();\n }\n}\n\n/**\n * Toggles a `vdPopover` from a button. On open, focus moves to the popover's `[autofocus]`\n * element or its first focusable one; closing returns focus to the trigger (the trigger is the\n * popover's invoker).\n */\n@Directive({\n selector: 'button[vdPopoverTrigger]',\n host: {\n 'aria-haspopup': 'dialog',\n '[attr.aria-expanded]': 'open()',\n '[attr.aria-controls]': 'vdPopoverTrigger().id',\n '[attr.data-state]': 'open() ? \"open\" : \"closed\"',\n '(pointerdown)': 'rememberState()',\n '(click)': 'toggle()',\n },\n})\nexport class VdPopoverTrigger {\n readonly vdPopoverTrigger = input.required<VdPopover>();\n protected readonly open = signal(false);\n private readonly el: HTMLButtonElement = inject(ElementRef).nativeElement;\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n afterNextRender(() => {\n const popover = this.vdPopoverTrigger();\n const name = `--${popover.id}`;\n this.el.style.setProperty('anchor-name', name);\n popover.el.style.setProperty('position-anchor', name);\n const onToggle = (event: Event) => {\n const opened = (event as ToggleEvent).newState === 'open';\n this.open.set(opened);\n if (opened) this.focusInside(popover.el);\n };\n popover.el.addEventListener('toggle', onToggle);\n destroyRef.onDestroy(() => popover.el.removeEventListener('toggle', onToggle));\n });\n }\n\n /** Open state when the press started: light dismiss may already have closed it by click. */\n private openAtPress: boolean | null = null;\n\n protected rememberState(): void {\n this.openAtPress = this.vdPopoverTrigger().el.matches(':popover-open');\n }\n\n protected toggle(): void {\n const popover = this.vdPopoverTrigger().el;\n // Keyboard activation has no pointerdown: use the current state.\n const wasOpen = this.openAtPress ?? popover.matches(':popover-open');\n this.openAtPress = null;\n if (wasOpen) {\n if (popover.matches(':popover-open')) popover.hidePopover();\n }\n // `source` makes the trigger the invoker (focus returns to it on close). Some engines still\n // light-dismiss on the trigger's pointerdown; `openAtPress` keeps the toggle correct then.\n else popover.showPopover({ source: this.el } as ShowPopoverOptions);\n }\n\n private focusInside(panel: HTMLElement): void {\n const target =\n panel.querySelector<HTMLElement>('[autofocus]') ??\n panel.querySelector<HTMLElement>(\n 'button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])',\n );\n target?.focus();\n }\n}\n\nexport const VD_POPOVER = [VdPopover, VdPopoverTrigger] as const;\n"],"mappings":";;;AA8BA,IAAa,YAAb,MAAa,UAAS;CACX,YAAY,MAA0B,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAC/C,KAAK,WAAW,YAAY;CAC5B,KAAkB,OAAO,UAAU,CAAC,CAAC;CAE9C,OAAI;EACF,IAAI,KAAK,GAAG,QAAQ,eAAe,GAAG,KAAK,GAAG,YAAW;CAC3D;CAPW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAS,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAT,OA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B,iBAAiB;IACjB,WAAW;GACZ;EACF,CAAA;;;;;;;;;;;;AAqDD,MAAa,aAAa,CAAC,WAAW,gBAAgB"}
@@ -0,0 +1,331 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, Directive, ViewEncapsulation, booleanAttribute, computed, input, numberAttribute } from "@angular/core";
3
+ import { vdTexts } from "@vadem/ui/locale";
4
+ var VdProgress = class VdProgress {
5
+ size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
6
+ variant = input("accent", ...ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []);
7
+ static ɵfac = i0.ɵɵngDeclareFactory({
8
+ minVersion: "12.0.0",
9
+ version: "22.2.1",
10
+ ngImport: i0,
11
+ type: VdProgress,
12
+ deps: [],
13
+ target: i0.ɵɵFactoryTarget.Directive
14
+ });
15
+ static ɵdir = i0.ɵɵngDeclareDirective({
16
+ minVersion: "17.1.0",
17
+ version: "22.2.1",
18
+ type: VdProgress,
19
+ isStandalone: true,
20
+ selector: "progress[vdProgress]",
21
+ inputs: {
22
+ size: {
23
+ classPropertyName: "size",
24
+ publicName: "size",
25
+ isSignal: true,
26
+ isRequired: false,
27
+ transformFunction: null
28
+ },
29
+ variant: {
30
+ classPropertyName: "variant",
31
+ publicName: "variant",
32
+ isSignal: true,
33
+ isRequired: false,
34
+ transformFunction: null
35
+ }
36
+ },
37
+ host: {
38
+ properties: {
39
+ "attr.data-size": "size()",
40
+ "attr.data-variant": "variant()"
41
+ },
42
+ classAttribute: "vd-progress"
43
+ },
44
+ ngImport: i0
45
+ });
46
+ };
47
+ i0.ɵɵngDeclareClassMetadata({
48
+ minVersion: "12.0.0",
49
+ version: "22.2.1",
50
+ ngImport: i0,
51
+ type: VdProgress,
52
+ decorators: [{
53
+ type: Directive,
54
+ args: [{
55
+ selector: "progress[vdProgress]",
56
+ host: {
57
+ class: "vd-progress",
58
+ "[attr.data-size]": "size()",
59
+ "[attr.data-variant]": "variant()"
60
+ }
61
+ }]
62
+ }],
63
+ propDecorators: {
64
+ size: [{
65
+ type: i0.Input,
66
+ args: [{
67
+ isSignal: true,
68
+ alias: "size",
69
+ required: false
70
+ }]
71
+ }],
72
+ variant: [{
73
+ type: i0.Input,
74
+ args: [{
75
+ isSignal: true,
76
+ alias: "variant",
77
+ required: false
78
+ }]
79
+ }]
80
+ }
81
+ });
82
+ var VdMeter = class VdMeter {
83
+ size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
84
+ static ɵfac = i0.ɵɵngDeclareFactory({
85
+ minVersion: "12.0.0",
86
+ version: "22.2.1",
87
+ ngImport: i0,
88
+ type: VdMeter,
89
+ deps: [],
90
+ target: i0.ɵɵFactoryTarget.Directive
91
+ });
92
+ static ɵdir = i0.ɵɵngDeclareDirective({
93
+ minVersion: "17.1.0",
94
+ version: "22.2.1",
95
+ type: VdMeter,
96
+ isStandalone: true,
97
+ selector: "meter[vdMeter]",
98
+ inputs: { size: {
99
+ classPropertyName: "size",
100
+ publicName: "size",
101
+ isSignal: true,
102
+ isRequired: false,
103
+ transformFunction: null
104
+ } },
105
+ host: {
106
+ properties: { "attr.data-size": "size()" },
107
+ classAttribute: "vd-meter"
108
+ },
109
+ ngImport: i0
110
+ });
111
+ };
112
+ i0.ɵɵngDeclareClassMetadata({
113
+ minVersion: "12.0.0",
114
+ version: "22.2.1",
115
+ ngImport: i0,
116
+ type: VdMeter,
117
+ decorators: [{
118
+ type: Directive,
119
+ args: [{
120
+ selector: "meter[vdMeter]",
121
+ host: {
122
+ class: "vd-meter",
123
+ "[attr.data-size]": "size()"
124
+ }
125
+ }]
126
+ }],
127
+ propDecorators: { size: [{
128
+ type: i0.Input,
129
+ args: [{
130
+ isSignal: true,
131
+ alias: "size",
132
+ required: false
133
+ }]
134
+ }] }
135
+ });
136
+ const optionalNumber = (value) => value === null || value === void 0 || value === "" ? null : numberAttribute(value);
137
+ var VdProgressRing = class VdProgressRing {
138
+ value = input(null, {
139
+ ...ngDevMode ? { debugName: "value" } : /* istanbul ignore next */ {},
140
+ transform: optionalNumber
141
+ });
142
+ max = input(100, {
143
+ ...ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {},
144
+ transform: numberAttribute
145
+ });
146
+ size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
147
+ variant = input("accent", ...ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []);
148
+ showValue = input(false, {
149
+ ...ngDevMode ? { debugName: "showValue" } : /* istanbul ignore next */ {},
150
+ transform: booleanAttribute
151
+ });
152
+ label = input(...ngDevMode ? [void 0, { debugName: "label" }] : /* istanbul ignore next */ []);
153
+ t = vdTexts("progressRing", { label: this.label });
154
+ determinate = computed(() => this.value() !== null, ...ngDevMode ? [{ debugName: "determinate" }] : /* istanbul ignore next */ []);
155
+ clamped = computed(() => Math.min(Math.max(this.value() ?? 0, 0), Math.max(this.max(), 0)), ...ngDevMode ? [{ debugName: "clamped" }] : /* istanbul ignore next */ []);
156
+ percent = computed(() => this.max() > 0 ? Math.round(this.clamped() / this.max() * 100) : 0, ...ngDevMode ? [{ debugName: "percent" }] : /* istanbul ignore next */ []);
157
+ static ɵfac = i0.ɵɵngDeclareFactory({
158
+ minVersion: "12.0.0",
159
+ version: "22.2.1",
160
+ ngImport: i0,
161
+ type: VdProgressRing,
162
+ deps: [],
163
+ target: i0.ɵɵFactoryTarget.Component
164
+ });
165
+ static ɵcmp = i0.ɵɵngDeclareComponent({
166
+ minVersion: "17.0.0",
167
+ version: "22.2.1",
168
+ type: VdProgressRing,
169
+ isStandalone: true,
170
+ selector: "vd-progress-ring",
171
+ inputs: {
172
+ value: {
173
+ classPropertyName: "value",
174
+ publicName: "value",
175
+ isSignal: true,
176
+ isRequired: false,
177
+ transformFunction: null
178
+ },
179
+ max: {
180
+ classPropertyName: "max",
181
+ publicName: "max",
182
+ isSignal: true,
183
+ isRequired: false,
184
+ transformFunction: null
185
+ },
186
+ size: {
187
+ classPropertyName: "size",
188
+ publicName: "size",
189
+ isSignal: true,
190
+ isRequired: false,
191
+ transformFunction: null
192
+ },
193
+ variant: {
194
+ classPropertyName: "variant",
195
+ publicName: "variant",
196
+ isSignal: true,
197
+ isRequired: false,
198
+ transformFunction: null
199
+ },
200
+ showValue: {
201
+ classPropertyName: "showValue",
202
+ publicName: "showValue",
203
+ isSignal: true,
204
+ isRequired: false,
205
+ transformFunction: null
206
+ },
207
+ label: {
208
+ classPropertyName: "label",
209
+ publicName: "label",
210
+ isSignal: true,
211
+ isRequired: false,
212
+ transformFunction: null
213
+ }
214
+ },
215
+ host: {
216
+ attributes: { "role": "progressbar" },
217
+ properties: {
218
+ "attr.aria-label": "t().label",
219
+ "attr.aria-valuemin": "determinate() ? 0 : null",
220
+ "attr.aria-valuemax": "determinate() ? max() : null",
221
+ "attr.aria-valuenow": "determinate() ? clamped() : null",
222
+ "attr.data-size": "size()",
223
+ "attr.data-variant": "variant()",
224
+ "attr.data-indeterminate": "determinate() ? null : \"\"",
225
+ "style.--vd-progress-ring-value": "percent()"
226
+ },
227
+ classAttribute: "vd-progress-ring"
228
+ },
229
+ ngImport: i0,
230
+ template: `
231
+ <svg class="vd-progress-ring__svg" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
232
+ <circle class="vd-progress-ring__track" cx="12" cy="12" r="10" pathLength="100" />
233
+ <circle class="vd-progress-ring__indicator" cx="12" cy="12" r="10" pathLength="100" />
234
+ </svg>
235
+ @if (showValue() && determinate()) {
236
+ <span class="vd-progress-ring__value" aria-hidden="true">{{ percent() }}%</span>
237
+ }
238
+ `,
239
+ isInline: true,
240
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
241
+ encapsulation: i0.ViewEncapsulation.None
242
+ });
243
+ };
244
+ i0.ɵɵngDeclareClassMetadata({
245
+ minVersion: "12.0.0",
246
+ version: "22.2.1",
247
+ ngImport: i0,
248
+ type: VdProgressRing,
249
+ decorators: [{
250
+ type: Component,
251
+ args: [{
252
+ selector: "vd-progress-ring",
253
+ changeDetection: ChangeDetectionStrategy.OnPush,
254
+ encapsulation: ViewEncapsulation.None,
255
+ host: {
256
+ class: "vd-progress-ring",
257
+ role: "progressbar",
258
+ "[attr.aria-label]": "t().label",
259
+ "[attr.aria-valuemin]": "determinate() ? 0 : null",
260
+ "[attr.aria-valuemax]": "determinate() ? max() : null",
261
+ "[attr.aria-valuenow]": "determinate() ? clamped() : null",
262
+ "[attr.data-size]": "size()",
263
+ "[attr.data-variant]": "variant()",
264
+ "[attr.data-indeterminate]": "determinate() ? null : \"\"",
265
+ "[style.--vd-progress-ring-value]": "percent()"
266
+ },
267
+ template: `
268
+ <svg class="vd-progress-ring__svg" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
269
+ <circle class="vd-progress-ring__track" cx="12" cy="12" r="10" pathLength="100" />
270
+ <circle class="vd-progress-ring__indicator" cx="12" cy="12" r="10" pathLength="100" />
271
+ </svg>
272
+ @if (showValue() && determinate()) {
273
+ <span class="vd-progress-ring__value" aria-hidden="true">{{ percent() }}%</span>
274
+ }
275
+ `
276
+ }]
277
+ }],
278
+ propDecorators: {
279
+ value: [{
280
+ type: i0.Input,
281
+ args: [{
282
+ isSignal: true,
283
+ alias: "value",
284
+ required: false
285
+ }]
286
+ }],
287
+ max: [{
288
+ type: i0.Input,
289
+ args: [{
290
+ isSignal: true,
291
+ alias: "max",
292
+ required: false
293
+ }]
294
+ }],
295
+ size: [{
296
+ type: i0.Input,
297
+ args: [{
298
+ isSignal: true,
299
+ alias: "size",
300
+ required: false
301
+ }]
302
+ }],
303
+ variant: [{
304
+ type: i0.Input,
305
+ args: [{
306
+ isSignal: true,
307
+ alias: "variant",
308
+ required: false
309
+ }]
310
+ }],
311
+ showValue: [{
312
+ type: i0.Input,
313
+ args: [{
314
+ isSignal: true,
315
+ alias: "showValue",
316
+ required: false
317
+ }]
318
+ }],
319
+ label: [{
320
+ type: i0.Input,
321
+ args: [{
322
+ isSignal: true,
323
+ alias: "label",
324
+ required: false
325
+ }]
326
+ }]
327
+ }
328
+ });
329
+ export { VdMeter, VdProgress, VdProgressRing };
330
+
331
+ //# sourceMappingURL=vadem-ui-progress.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vadem-ui-progress.mjs","names":[],"sources":["../../../projects/ui/progress/src/progress.ts","../../../projects/ui/progress/src/progress-ring.ts"],"sourcesContent":["import { Directive, input } from '@angular/core';\n\nexport type VdProgressSize = 'sm' | 'md';\nexport type VdProgressVariant = 'accent' | 'success' | 'warning' | 'danger';\n\n/**\n * Styles a native `<progress>`: completion of a task. Without `value` it is indeterminate.\n * Role, value and labelling (`<label for>`, `aria-label`) stay native. Spec: specs/progress.md\n */\n@Directive({\n selector: 'progress[vdProgress]',\n host: {\n class: 'vd-progress',\n '[attr.data-size]': 'size()',\n '[attr.data-variant]': 'variant()',\n },\n})\nexport class VdProgress {\n readonly size = input<VdProgressSize>('md');\n readonly variant = input<VdProgressVariant>('accent');\n}\n\n/**\n * Styles a native `<meter>`: a measurement within a known range (quota, disk, score).\n * Colors follow the native `low` / `high` / `optimum` regions. Spec: specs/progress.md\n */\n@Directive({\n selector: 'meter[vdMeter]',\n host: {\n class: 'vd-meter',\n '[attr.data-size]': 'size()',\n },\n})\nexport class VdMeter {\n readonly size = input<VdProgressSize>('md');\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n input,\n numberAttribute,\n} from '@angular/core';\nimport { vdTexts } from '@vadem/ui/locale';\nimport type { VdProgressVariant } from './progress';\n\nexport type VdProgressRingSize = 'sm' | 'md' | 'lg';\n\nconst optionalNumber = (value: unknown): number | null =>\n value === null || value === undefined || value === '' ? null : numberAttribute(value);\n\n/**\n * Circular progress. Without `value` it is indeterminate (a spinner); with `value` it shows\n * completion. Spec: specs/progress.md\n */\n@Component({\n selector: 'vd-progress-ring',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'vd-progress-ring',\n role: 'progressbar',\n '[attr.aria-label]': 't().label',\n '[attr.aria-valuemin]': 'determinate() ? 0 : null',\n '[attr.aria-valuemax]': 'determinate() ? max() : null',\n '[attr.aria-valuenow]': 'determinate() ? clamped() : null',\n '[attr.data-size]': 'size()',\n '[attr.data-variant]': 'variant()',\n '[attr.data-indeterminate]': 'determinate() ? null : \"\"',\n '[style.--vd-progress-ring-value]': 'percent()',\n },\n template: `\n <svg class=\"vd-progress-ring__svg\" viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\">\n <circle class=\"vd-progress-ring__track\" cx=\"12\" cy=\"12\" r=\"10\" pathLength=\"100\" />\n <circle class=\"vd-progress-ring__indicator\" cx=\"12\" cy=\"12\" r=\"10\" pathLength=\"100\" />\n </svg>\n @if (showValue() && determinate()) {\n <span class=\"vd-progress-ring__value\" aria-hidden=\"true\">{{ percent() }}%</span>\n }\n `,\n})\nexport class VdProgressRing {\n /** Completed amount; leave empty for an indeterminate spinner. */\n readonly value = input<number | null, unknown>(null, { transform: optionalNumber });\n readonly max = input(100, { transform: numberAttribute });\n readonly size = input<VdProgressRingSize>('md');\n readonly variant = input<VdProgressVariant>('accent');\n /** Percentage in the centre; shown at size lg only. */\n readonly showValue = input(false, { transform: booleanAttribute });\n /** Accessible name; defaults to the locale's \"Loading\". */\n readonly label = input<string>();\n protected readonly t = vdTexts('progressRing', { label: this.label });\n\n protected readonly determinate = computed(() => this.value() !== null);\n protected readonly clamped = computed(() =>\n Math.min(Math.max(this.value() ?? 0, 0), Math.max(this.max(), 0)),\n );\n protected readonly percent = computed(() =>\n this.max() > 0 ? Math.round((this.clamped() / this.max()) * 100) : 0,\n );\n}\n"],"mappings":";;;AAiBA,IAAa,aAAb,MAAa,WAAU;CACZ,OAAO,MAAsB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAClC,UAAU,MAAyB,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,UA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AA;;AAEU,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAc,YAAA,CAAA;EA1B1B,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,iBAAiB,wBAAwB;GACzC,eAAe,kBAAkB;GACjC,MAAM;IACJ,OAAO;IACP,MAAM;IACN,qBAAqB;IACrB,wBAAwB;IACxB,wBAAwB;IACxB,wBAAwB;IACxB,oBAAoB;IACpB,uBAAuB;IACvB,6BAA6B;IAC7B,oCAAoC;GACrC;GACD,UAAU;;;;;;;;;EASX,CAAA"}
@@ -0,0 +1,39 @@
1
+ import * as i0 from "@angular/core";
2
+ import { Directive } from "@angular/core";
3
+ import { VdFieldControlBase } from "@vadem/ui/field";
4
+ var VdRadio = class VdRadio extends VdFieldControlBase {
5
+ static ɵfac = i0.ɵɵngDeclareFactory({
6
+ minVersion: "12.0.0",
7
+ version: "22.2.1",
8
+ ngImport: i0,
9
+ type: VdRadio,
10
+ deps: null,
11
+ target: i0.ɵɵFactoryTarget.Directive
12
+ });
13
+ static ɵdir = i0.ɵɵngDeclareDirective({
14
+ minVersion: "14.0.0",
15
+ version: "22.2.1",
16
+ type: VdRadio,
17
+ isStandalone: true,
18
+ selector: "input[type=radio][vdRadio]",
19
+ host: { classAttribute: "vd-radio" },
20
+ usesInheritance: true,
21
+ ngImport: i0
22
+ });
23
+ };
24
+ i0.ɵɵngDeclareClassMetadata({
25
+ minVersion: "12.0.0",
26
+ version: "22.2.1",
27
+ ngImport: i0,
28
+ type: VdRadio,
29
+ decorators: [{
30
+ type: Directive,
31
+ args: [{
32
+ selector: "input[type=radio][vdRadio]",
33
+ host: { class: "vd-radio" }
34
+ }]
35
+ }]
36
+ });
37
+ export { VdRadio };
38
+
39
+ //# sourceMappingURL=vadem-ui-radio.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vadem-ui-radio.mjs","names":[],"sources":["../../../projects/ui/radio/src/radio.ts"],"sourcesContent":["import { Directive } from '@angular/core';\nimport { VdFieldControlBase } from '@vadem/ui/field';\n\n/**\n * Styles a native `<input type=\"radio\">`. Grouping (shared `name`), arrow keys and form values\n * stay native; wrap each in `label[vdChoice]` and the group in `fieldset[vdFieldset]`.\n * Spec: specs/radio.md\n */\n@Directive({\n selector: 'input[type=radio][vdRadio]',\n host: { class: 'vd-radio' },\n})\nexport class VdRadio extends VdFieldControlBase {}\n"],"mappings":";;;AAYA,IAAa,UAAb,MAAa,gBAAgB,mBAAkB;CAAlC,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAO,MAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAP,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAO,cAAA;EAAA,UAAA;EAAA,MAAA,EAAA,gBAAA,WAAA;EAAA,iBAAA;EAAA,UAAA;CAAA,CAAA;;AAAP,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAO,YAAA,CAAA;EAJnB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,MAAM,EAAE,OAAO,WAAU;EAC1B,CAAA"}