@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,433 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, DestroyRef, ViewEncapsulation, computed, effect, inject, input, model, output, signal } from "@angular/core";
3
+ import { VdButton } from "@vadem/ui/button";
4
+ import * as i1 from "@vadem/ui/dialog";
5
+ import { VD_DIALOG } from "@vadem/ui/dialog";
6
+ import { vdTexts } from "@vadem/ui/locale";
7
+ var VdAlertDialog = class VdAlertDialog {
8
+ open = model(false, ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
9
+ title = input.required(...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
10
+ description = input.required(...ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []);
11
+ action = input.required(...ngDevMode ? [{ debugName: "action" }] : /* istanbul ignore next */ []);
12
+ variant = input("danger", ...ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []);
13
+ confirmLabel = input(...ngDevMode ? [void 0, { debugName: "confirmLabel" }] : /* istanbul ignore next */ []);
14
+ cancelLabel = input(...ngDevMode ? [void 0, { debugName: "cancelLabel" }] : /* istanbul ignore next */ []);
15
+ pendingText = input(...ngDevMode ? [void 0, { debugName: "pendingText" }] : /* istanbul ignore next */ []);
16
+ errorText = input(...ngDevMode ? [void 0, { debugName: "errorText" }] : /* istanbul ignore next */ []);
17
+ confirmed = output();
18
+ canceled = output();
19
+ actionFailed = output();
20
+ t = vdTexts("alertDialog", {
21
+ confirmLabel: this.confirmLabel,
22
+ cancelLabel: this.cancelLabel,
23
+ pendingText: this.pendingText,
24
+ errorText: this.errorText
25
+ });
26
+ pending = signal(false, ...ngDevMode ? [{ debugName: "pending" }] : /* istanbul ignore next */ []);
27
+ failed = signal(false, ...ngDevMode ? [{ debugName: "failed" }] : /* istanbul ignore next */ []);
28
+ state = computed(() => !this.open() ? "closed" : this.pending() ? "pending" : this.failed() ? "error" : "idle", ...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
29
+ generation = 0;
30
+ destroyed = false;
31
+ constructor() {
32
+ effect(() => {
33
+ this.open();
34
+ this.generation++;
35
+ this.pending.set(false);
36
+ this.failed.set(false);
37
+ });
38
+ inject(DestroyRef).onDestroy(() => {
39
+ this.destroyed = true;
40
+ this.generation++;
41
+ });
42
+ }
43
+ escape(event) {
44
+ event.preventDefault();
45
+ event.stopPropagation();
46
+ this.cancel();
47
+ }
48
+ cancel() {
49
+ if (!this.open() || this.pending()) return;
50
+ this.generation++;
51
+ this.failed.set(false);
52
+ this.open.set(false);
53
+ this.canceled.emit();
54
+ }
55
+ async confirm() {
56
+ if (!this.open() || this.pending()) return;
57
+ const action = this.action();
58
+ const generation = ++this.generation;
59
+ this.failed.set(false);
60
+ this.pending.set(true);
61
+ try {
62
+ await action();
63
+ if (!this.current(generation)) return;
64
+ this.pending.set(false);
65
+ this.open.set(false);
66
+ this.confirmed.emit();
67
+ } catch (error) {
68
+ if (!this.current(generation)) return;
69
+ this.pending.set(false);
70
+ this.failed.set(true);
71
+ this.actionFailed.emit(error);
72
+ }
73
+ }
74
+ current(generation) {
75
+ return !this.destroyed && this.open() && generation === this.generation;
76
+ }
77
+ static ɵfac = i0.ɵɵngDeclareFactory({
78
+ minVersion: "12.0.0",
79
+ version: "22.2.1",
80
+ ngImport: i0,
81
+ type: VdAlertDialog,
82
+ deps: [],
83
+ target: i0.ɵɵFactoryTarget.Component
84
+ });
85
+ static ɵcmp = i0.ɵɵngDeclareComponent({
86
+ minVersion: "17.1.0",
87
+ version: "22.2.1",
88
+ type: VdAlertDialog,
89
+ isStandalone: true,
90
+ selector: "vd-alert-dialog",
91
+ inputs: {
92
+ open: {
93
+ classPropertyName: "open",
94
+ publicName: "open",
95
+ isSignal: true,
96
+ isRequired: false,
97
+ transformFunction: null
98
+ },
99
+ title: {
100
+ classPropertyName: "title",
101
+ publicName: "title",
102
+ isSignal: true,
103
+ isRequired: true,
104
+ transformFunction: null
105
+ },
106
+ description: {
107
+ classPropertyName: "description",
108
+ publicName: "description",
109
+ isSignal: true,
110
+ isRequired: true,
111
+ transformFunction: null
112
+ },
113
+ action: {
114
+ classPropertyName: "action",
115
+ publicName: "action",
116
+ isSignal: true,
117
+ isRequired: true,
118
+ transformFunction: null
119
+ },
120
+ variant: {
121
+ classPropertyName: "variant",
122
+ publicName: "variant",
123
+ isSignal: true,
124
+ isRequired: false,
125
+ transformFunction: null
126
+ },
127
+ confirmLabel: {
128
+ classPropertyName: "confirmLabel",
129
+ publicName: "confirmLabel",
130
+ isSignal: true,
131
+ isRequired: false,
132
+ transformFunction: null
133
+ },
134
+ cancelLabel: {
135
+ classPropertyName: "cancelLabel",
136
+ publicName: "cancelLabel",
137
+ isSignal: true,
138
+ isRequired: false,
139
+ transformFunction: null
140
+ },
141
+ pendingText: {
142
+ classPropertyName: "pendingText",
143
+ publicName: "pendingText",
144
+ isSignal: true,
145
+ isRequired: false,
146
+ transformFunction: null
147
+ },
148
+ errorText: {
149
+ classPropertyName: "errorText",
150
+ publicName: "errorText",
151
+ isSignal: true,
152
+ isRequired: false,
153
+ transformFunction: null
154
+ }
155
+ },
156
+ outputs: {
157
+ open: "openChange",
158
+ confirmed: "confirmed",
159
+ canceled: "canceled",
160
+ actionFailed: "actionFailed"
161
+ },
162
+ host: { classAttribute: "vd-alert-dialog" },
163
+ ngImport: i0,
164
+ template: `
165
+ <dialog
166
+ vdDialog
167
+ class="vd-alert-dialog__dialog"
168
+ role="alertdialog"
169
+ aria-modal="true"
170
+ [open]="open()"
171
+ (openChange)="open.set($event)"
172
+ [dismissible]="false"
173
+ [attr.data-state]="state()"
174
+ (cancel)="escape($event)"
175
+ >
176
+ <div
177
+ vdDialogBody
178
+ class="vd-alert-dialog__content"
179
+ tabindex="0"
180
+ role="region"
181
+ [attr.aria-label]="title()"
182
+ >
183
+ <h2 vdDialogTitle>{{ title() }}</h2>
184
+ <p vdDialogDescription>{{ description() }}</p>
185
+ <p
186
+ class="vd-alert-dialog__status"
187
+ [class.vd-visually-hidden]="!pending() && !failed()"
188
+ role="status"
189
+ aria-atomic="true"
190
+ [attr.data-error]="failed() ? '' : null"
191
+ >
192
+ {{ pending() ? t().pendingText : failed() ? t().errorText : '' }}
193
+ </p>
194
+ </div>
195
+ <footer vdDialogFooter>
196
+ <button
197
+ vdButton
198
+ variant="secondary"
199
+ type="button"
200
+ autofocus
201
+ [attr.aria-disabled]="pending() ? 'true' : null"
202
+ (click)="cancel()"
203
+ >
204
+ {{ t().cancelLabel }}
205
+ </button>
206
+ <button
207
+ vdButton
208
+ [variant]="variant()"
209
+ type="button"
210
+ [loading]="pending()"
211
+ (click)="confirm()"
212
+ >
213
+ {{ t().confirmLabel }}
214
+ </button>
215
+ </footer>
216
+ </dialog>
217
+ `,
218
+ isInline: true,
219
+ dependencies: [
220
+ {
221
+ kind: "component",
222
+ type: VdButton,
223
+ selector: "button[vdButton], a[vdButton]",
224
+ inputs: [
225
+ "variant",
226
+ "size",
227
+ "disabled",
228
+ "loading",
229
+ "iconOnly",
230
+ "type"
231
+ ]
232
+ },
233
+ {
234
+ kind: "directive",
235
+ type: i1.VdDialog,
236
+ selector: "dialog[vdDialog]",
237
+ inputs: [
238
+ "open",
239
+ "size",
240
+ "placement",
241
+ "dismissible"
242
+ ],
243
+ outputs: ["openChange", "closed"],
244
+ exportAs: ["vdDialog"]
245
+ },
246
+ {
247
+ kind: "directive",
248
+ type: i1.VdDialogTitle,
249
+ selector: "[vdDialogTitle]"
250
+ },
251
+ {
252
+ kind: "directive",
253
+ type: i1.VdDialogDescription,
254
+ selector: "[vdDialogDescription]"
255
+ },
256
+ {
257
+ kind: "directive",
258
+ type: i1.VdDialogBody,
259
+ selector: "[vdDialogBody]"
260
+ },
261
+ {
262
+ kind: "directive",
263
+ type: i1.VdDialogFooter,
264
+ selector: "[vdDialogFooter]"
265
+ }
266
+ ],
267
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
268
+ encapsulation: i0.ViewEncapsulation.None
269
+ });
270
+ };
271
+ i0.ɵɵngDeclareClassMetadata({
272
+ minVersion: "12.0.0",
273
+ version: "22.2.1",
274
+ ngImport: i0,
275
+ type: VdAlertDialog,
276
+ decorators: [{
277
+ type: Component,
278
+ args: [{
279
+ selector: "vd-alert-dialog",
280
+ imports: [VdButton, VD_DIALOG],
281
+ template: `
282
+ <dialog
283
+ vdDialog
284
+ class="vd-alert-dialog__dialog"
285
+ role="alertdialog"
286
+ aria-modal="true"
287
+ [open]="open()"
288
+ (openChange)="open.set($event)"
289
+ [dismissible]="false"
290
+ [attr.data-state]="state()"
291
+ (cancel)="escape($event)"
292
+ >
293
+ <div
294
+ vdDialogBody
295
+ class="vd-alert-dialog__content"
296
+ tabindex="0"
297
+ role="region"
298
+ [attr.aria-label]="title()"
299
+ >
300
+ <h2 vdDialogTitle>{{ title() }}</h2>
301
+ <p vdDialogDescription>{{ description() }}</p>
302
+ <p
303
+ class="vd-alert-dialog__status"
304
+ [class.vd-visually-hidden]="!pending() && !failed()"
305
+ role="status"
306
+ aria-atomic="true"
307
+ [attr.data-error]="failed() ? '' : null"
308
+ >
309
+ {{ pending() ? t().pendingText : failed() ? t().errorText : '' }}
310
+ </p>
311
+ </div>
312
+ <footer vdDialogFooter>
313
+ <button
314
+ vdButton
315
+ variant="secondary"
316
+ type="button"
317
+ autofocus
318
+ [attr.aria-disabled]="pending() ? 'true' : null"
319
+ (click)="cancel()"
320
+ >
321
+ {{ t().cancelLabel }}
322
+ </button>
323
+ <button
324
+ vdButton
325
+ [variant]="variant()"
326
+ type="button"
327
+ [loading]="pending()"
328
+ (click)="confirm()"
329
+ >
330
+ {{ t().confirmLabel }}
331
+ </button>
332
+ </footer>
333
+ </dialog>
334
+ `,
335
+ host: { class: "vd-alert-dialog" },
336
+ changeDetection: ChangeDetectionStrategy.OnPush,
337
+ encapsulation: ViewEncapsulation.None
338
+ }]
339
+ }],
340
+ ctorParameters: () => [],
341
+ propDecorators: {
342
+ open: [{
343
+ type: i0.Input,
344
+ args: [{
345
+ isSignal: true,
346
+ alias: "open",
347
+ required: false
348
+ }]
349
+ }, {
350
+ type: i0.Output,
351
+ args: ["openChange"]
352
+ }],
353
+ title: [{
354
+ type: i0.Input,
355
+ args: [{
356
+ isSignal: true,
357
+ alias: "title",
358
+ required: true
359
+ }]
360
+ }],
361
+ description: [{
362
+ type: i0.Input,
363
+ args: [{
364
+ isSignal: true,
365
+ alias: "description",
366
+ required: true
367
+ }]
368
+ }],
369
+ action: [{
370
+ type: i0.Input,
371
+ args: [{
372
+ isSignal: true,
373
+ alias: "action",
374
+ required: true
375
+ }]
376
+ }],
377
+ variant: [{
378
+ type: i0.Input,
379
+ args: [{
380
+ isSignal: true,
381
+ alias: "variant",
382
+ required: false
383
+ }]
384
+ }],
385
+ confirmLabel: [{
386
+ type: i0.Input,
387
+ args: [{
388
+ isSignal: true,
389
+ alias: "confirmLabel",
390
+ required: false
391
+ }]
392
+ }],
393
+ cancelLabel: [{
394
+ type: i0.Input,
395
+ args: [{
396
+ isSignal: true,
397
+ alias: "cancelLabel",
398
+ required: false
399
+ }]
400
+ }],
401
+ pendingText: [{
402
+ type: i0.Input,
403
+ args: [{
404
+ isSignal: true,
405
+ alias: "pendingText",
406
+ required: false
407
+ }]
408
+ }],
409
+ errorText: [{
410
+ type: i0.Input,
411
+ args: [{
412
+ isSignal: true,
413
+ alias: "errorText",
414
+ required: false
415
+ }]
416
+ }],
417
+ confirmed: [{
418
+ type: i0.Output,
419
+ args: ["confirmed"]
420
+ }],
421
+ canceled: [{
422
+ type: i0.Output,
423
+ args: ["canceled"]
424
+ }],
425
+ actionFailed: [{
426
+ type: i0.Output,
427
+ args: ["actionFailed"]
428
+ }]
429
+ }
430
+ });
431
+ export { VdAlertDialog };
432
+
433
+ //# sourceMappingURL=vadem-ui-alert-dialog.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vadem-ui-alert-dialog.mjs","names":[],"sources":["../../../projects/ui/alert-dialog/src/alert-dialog.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ViewEncapsulation,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { VdButton } from '@vadem/ui/button';\nimport { VD_DIALOG } from '@vadem/ui/dialog';\nimport { vdTexts } from '@vadem/ui/locale';\n\nexport type VdAlertDialogAction = () => void | Promise<void>;\n\n/** An explicit decision with application-owned work and a safe initial focus. */\n@Component({\n selector: 'vd-alert-dialog',\n imports: [VdButton, VD_DIALOG],\n template: `\n <dialog\n vdDialog\n class=\"vd-alert-dialog__dialog\"\n role=\"alertdialog\"\n aria-modal=\"true\"\n [open]=\"open()\"\n (openChange)=\"open.set($event)\"\n [dismissible]=\"false\"\n [attr.data-state]=\"state()\"\n (cancel)=\"escape($event)\"\n >\n <div\n vdDialogBody\n class=\"vd-alert-dialog__content\"\n tabindex=\"0\"\n role=\"region\"\n [attr.aria-label]=\"title()\"\n >\n <h2 vdDialogTitle>{{ title() }}</h2>\n <p vdDialogDescription>{{ description() }}</p>\n <p\n class=\"vd-alert-dialog__status\"\n [class.vd-visually-hidden]=\"!pending() && !failed()\"\n role=\"status\"\n aria-atomic=\"true\"\n [attr.data-error]=\"failed() ? '' : null\"\n >\n {{ pending() ? t().pendingText : failed() ? t().errorText : '' }}\n </p>\n </div>\n <footer vdDialogFooter>\n <button\n vdButton\n variant=\"secondary\"\n type=\"button\"\n autofocus\n [attr.aria-disabled]=\"pending() ? 'true' : null\"\n (click)=\"cancel()\"\n >\n {{ t().cancelLabel }}\n </button>\n <button\n vdButton\n [variant]=\"variant()\"\n type=\"button\"\n [loading]=\"pending()\"\n (click)=\"confirm()\"\n >\n {{ t().confirmLabel }}\n </button>\n </footer>\n </dialog>\n `,\n host: { class: 'vd-alert-dialog' },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class VdAlertDialog {\n readonly open = model(false);\n readonly title = input.required<string>();\n readonly description = input.required<string>();\n readonly action = input.required<VdAlertDialogAction>();\n readonly variant = input<'primary' | 'danger'>('danger');\n readonly confirmLabel = input<string>();\n readonly cancelLabel = input<string>();\n readonly pendingText = input<string>();\n readonly errorText = input<string>();\n readonly confirmed = output<void>();\n readonly canceled = output<void>();\n readonly actionFailed = output<unknown>();\n protected readonly t = vdTexts('alertDialog', {\n confirmLabel: this.confirmLabel,\n cancelLabel: this.cancelLabel,\n pendingText: this.pendingText,\n errorText: this.errorText,\n });\n protected readonly pending = signal(false);\n protected readonly failed = signal(false);\n protected readonly state = computed(() =>\n !this.open() ? 'closed' : this.pending() ? 'pending' : this.failed() ? 'error' : 'idle',\n );\n private generation = 0;\n private destroyed = false;\n\n constructor() {\n effect(() => {\n this.open();\n // A visible session boundary invalidates work without claiming to abort it.\n this.generation++;\n this.pending.set(false);\n this.failed.set(false);\n });\n inject(DestroyRef).onDestroy(() => {\n this.destroyed = true;\n this.generation++;\n });\n }\n protected escape(event: Event): void {\n event.preventDefault();\n event.stopPropagation();\n this.cancel();\n }\n protected cancel(): void {\n if (!this.open() || this.pending()) return;\n this.generation++;\n this.failed.set(false);\n this.open.set(false);\n this.canceled.emit();\n }\n protected async confirm(): Promise<void> {\n if (!this.open() || this.pending()) return;\n const action = this.action();\n const generation = ++this.generation;\n this.failed.set(false);\n this.pending.set(true);\n try {\n await action();\n if (!this.current(generation)) return;\n this.pending.set(false);\n this.open.set(false);\n this.confirmed.emit();\n } catch (error: unknown) {\n if (!this.current(generation)) return;\n this.pending.set(false);\n this.failed.set(true);\n this.actionFailed.emit(error);\n }\n }\n private current(generation: number): boolean {\n return !this.destroyed && this.open() && generation === this.generation;\n }\n}\n"],"mappings":";;;;;;AAiFA,IAAa,gBAAb,MAAa,cAAa;CACf,OAAO,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACnB,QAAQ,M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