@star-ng/ui 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +162 -2
  3. package/fesm2022/star-ng-ui-accordion.mjs +376 -0
  4. package/fesm2022/star-ng-ui-accordion.mjs.map +1 -0
  5. package/fesm2022/star-ng-ui-autocomplete.mjs +786 -0
  6. package/fesm2022/star-ng-ui-autocomplete.mjs.map +1 -0
  7. package/fesm2022/star-ng-ui-avatar.mjs +154 -0
  8. package/fesm2022/star-ng-ui-avatar.mjs.map +1 -0
  9. package/fesm2022/star-ng-ui-badge.mjs +153 -0
  10. package/fesm2022/star-ng-ui-badge.mjs.map +1 -0
  11. package/fesm2022/star-ng-ui-breadcrumb.mjs +199 -0
  12. package/fesm2022/star-ng-ui-breadcrumb.mjs.map +1 -0
  13. package/fesm2022/star-ng-ui-button.mjs +282 -0
  14. package/fesm2022/star-ng-ui-button.mjs.map +1 -0
  15. package/fesm2022/star-ng-ui-card.mjs +112 -0
  16. package/fesm2022/star-ng-ui-card.mjs.map +1 -0
  17. package/fesm2022/star-ng-ui-chart.mjs +1904 -0
  18. package/fesm2022/star-ng-ui-chart.mjs.map +1 -0
  19. package/fesm2022/star-ng-ui-checkbox.mjs +345 -0
  20. package/fesm2022/star-ng-ui-checkbox.mjs.map +1 -0
  21. package/fesm2022/star-ng-ui-core.mjs +484 -0
  22. package/fesm2022/star-ng-ui-core.mjs.map +1 -0
  23. package/fesm2022/star-ng-ui-data-display.mjs +1870 -0
  24. package/fesm2022/star-ng-ui-data-display.mjs.map +1 -0
  25. package/fesm2022/star-ng-ui-date-picker.mjs +2786 -0
  26. package/fesm2022/star-ng-ui-date-picker.mjs.map +1 -0
  27. package/fesm2022/star-ng-ui-dialog.mjs +948 -0
  28. package/fesm2022/star-ng-ui-dialog.mjs.map +1 -0
  29. package/fesm2022/star-ng-ui-drawer.mjs +158 -0
  30. package/fesm2022/star-ng-ui-drawer.mjs.map +1 -0
  31. package/fesm2022/star-ng-ui-editor.mjs +416 -0
  32. package/fesm2022/star-ng-ui-editor.mjs.map +1 -0
  33. package/fesm2022/star-ng-ui-field.mjs +378 -0
  34. package/fesm2022/star-ng-ui-field.mjs.map +1 -0
  35. package/fesm2022/star-ng-ui-file-upload.mjs +762 -0
  36. package/fesm2022/star-ng-ui-file-upload.mjs.map +1 -0
  37. package/fesm2022/star-ng-ui-i18n-de.mjs +179 -0
  38. package/fesm2022/star-ng-ui-i18n-de.mjs.map +1 -0
  39. package/fesm2022/star-ng-ui-i18n-es.mjs +179 -0
  40. package/fesm2022/star-ng-ui-i18n-es.mjs.map +1 -0
  41. package/fesm2022/star-ng-ui-input-group.mjs +188 -0
  42. package/fesm2022/star-ng-ui-input-group.mjs.map +1 -0
  43. package/fesm2022/star-ng-ui-input-mask.mjs +434 -0
  44. package/fesm2022/star-ng-ui-input-mask.mjs.map +1 -0
  45. package/fesm2022/star-ng-ui-input-number.mjs +691 -0
  46. package/fesm2022/star-ng-ui-input-number.mjs.map +1 -0
  47. package/fesm2022/star-ng-ui-input-otp.mjs +343 -0
  48. package/fesm2022/star-ng-ui-input-otp.mjs.map +1 -0
  49. package/fesm2022/star-ng-ui-input-tags.mjs +616 -0
  50. package/fesm2022/star-ng-ui-input-tags.mjs.map +1 -0
  51. package/fesm2022/star-ng-ui-knob.mjs +514 -0
  52. package/fesm2022/star-ng-ui-knob.mjs.map +1 -0
  53. package/fesm2022/star-ng-ui-layout.mjs +608 -0
  54. package/fesm2022/star-ng-ui-layout.mjs.map +1 -0
  55. package/fesm2022/star-ng-ui-listbox.mjs +886 -0
  56. package/fesm2022/star-ng-ui-listbox.mjs.map +1 -0
  57. package/fesm2022/star-ng-ui-media.mjs +833 -0
  58. package/fesm2022/star-ng-ui-media.mjs.map +1 -0
  59. package/fesm2022/star-ng-ui-menu.mjs +1840 -0
  60. package/fesm2022/star-ng-ui-menu.mjs.map +1 -0
  61. package/fesm2022/star-ng-ui-message.mjs +191 -0
  62. package/fesm2022/star-ng-ui-message.mjs.map +1 -0
  63. package/fesm2022/star-ng-ui-paginator.mjs +387 -0
  64. package/fesm2022/star-ng-ui-paginator.mjs.map +1 -0
  65. package/fesm2022/star-ng-ui-panel.mjs +324 -0
  66. package/fesm2022/star-ng-ui-panel.mjs.map +1 -0
  67. package/fesm2022/star-ng-ui-password.mjs +517 -0
  68. package/fesm2022/star-ng-ui-password.mjs.map +1 -0
  69. package/fesm2022/star-ng-ui-popover.mjs +241 -0
  70. package/fesm2022/star-ng-ui-popover.mjs.map +1 -0
  71. package/fesm2022/star-ng-ui-progress-bar.mjs +183 -0
  72. package/fesm2022/star-ng-ui-progress-bar.mjs.map +1 -0
  73. package/fesm2022/star-ng-ui-radio.mjs +411 -0
  74. package/fesm2022/star-ng-ui-radio.mjs.map +1 -0
  75. package/fesm2022/star-ng-ui-rating.mjs +211 -0
  76. package/fesm2022/star-ng-ui-rating.mjs.map +1 -0
  77. package/fesm2022/star-ng-ui-select-button.mjs +613 -0
  78. package/fesm2022/star-ng-ui-select-button.mjs.map +1 -0
  79. package/fesm2022/star-ng-ui-select.mjs +2547 -0
  80. package/fesm2022/star-ng-ui-select.mjs.map +1 -0
  81. package/fesm2022/star-ng-ui-skeleton.mjs +160 -0
  82. package/fesm2022/star-ng-ui-skeleton.mjs.map +1 -0
  83. package/fesm2022/star-ng-ui-slider.mjs +552 -0
  84. package/fesm2022/star-ng-ui-slider.mjs.map +1 -0
  85. package/fesm2022/star-ng-ui-spinner.mjs +148 -0
  86. package/fesm2022/star-ng-ui-spinner.mjs.map +1 -0
  87. package/fesm2022/star-ng-ui-stepper.mjs +360 -0
  88. package/fesm2022/star-ng-ui-stepper.mjs.map +1 -0
  89. package/fesm2022/star-ng-ui-table.mjs +3531 -0
  90. package/fesm2022/star-ng-ui-table.mjs.map +1 -0
  91. package/fesm2022/star-ng-ui-tabs.mjs +464 -0
  92. package/fesm2022/star-ng-ui-tabs.mjs.map +1 -0
  93. package/fesm2022/star-ng-ui-tag.mjs +129 -0
  94. package/fesm2022/star-ng-ui-tag.mjs.map +1 -0
  95. package/fesm2022/star-ng-ui-theme-switch.mjs +105 -0
  96. package/fesm2022/star-ng-ui-theme-switch.mjs.map +1 -0
  97. package/fesm2022/star-ng-ui-theme.mjs +98 -0
  98. package/fesm2022/star-ng-ui-theme.mjs.map +1 -0
  99. package/fesm2022/star-ng-ui-toast.mjs +298 -0
  100. package/fesm2022/star-ng-ui-toast.mjs.map +1 -0
  101. package/fesm2022/star-ng-ui-toggle-switch.mjs +316 -0
  102. package/fesm2022/star-ng-ui-toggle-switch.mjs.map +1 -0
  103. package/fesm2022/star-ng-ui-tooltip.mjs +297 -0
  104. package/fesm2022/star-ng-ui-tooltip.mjs.map +1 -0
  105. package/fesm2022/star-ng-ui-transloco.mjs +40 -0
  106. package/fesm2022/star-ng-ui-transloco.mjs.map +1 -0
  107. package/fesm2022/star-ng-ui-tree.mjs +1446 -0
  108. package/fesm2022/star-ng-ui-tree.mjs.map +1 -0
  109. package/fesm2022/star-ng-ui-utility.mjs +2134 -0
  110. package/fesm2022/star-ng-ui-utility.mjs.map +1 -0
  111. package/fesm2022/star-ng-ui.mjs +51 -0
  112. package/package.json +285 -3
  113. package/styles/_base.scss +70 -0
  114. package/styles/_shared.scss +2 -0
  115. package/styles/_tokens.scss +190 -0
  116. package/styles/controls/_accordion.scss +75 -0
  117. package/styles/controls/_autocomplete.scss +44 -0
  118. package/styles/controls/_avatar.scss +39 -0
  119. package/styles/controls/_breadcrumb.scss +45 -0
  120. package/styles/controls/_button.scss +137 -0
  121. package/styles/controls/_card.scss +38 -0
  122. package/styles/controls/_chart.scss +214 -0
  123. package/styles/controls/_chip.scss +51 -0
  124. package/styles/controls/_choice.scss +153 -0
  125. package/styles/controls/_data-display.scss +124 -0
  126. package/styles/controls/_date-picker.scss +300 -0
  127. package/styles/controls/_dialog.scss +123 -0
  128. package/styles/controls/_drawer.scss +118 -0
  129. package/styles/controls/_editor.scss +74 -0
  130. package/styles/controls/_field.scss +92 -0
  131. package/styles/controls/_file-upload.scss +136 -0
  132. package/styles/controls/_input-group.scss +104 -0
  133. package/styles/controls/_input-mask.scss +46 -0
  134. package/styles/controls/_input-number.scss +125 -0
  135. package/styles/controls/_knob.scss +76 -0
  136. package/styles/controls/_layout.scss +182 -0
  137. package/styles/controls/_listbox.scss +38 -0
  138. package/styles/controls/_media.scss +222 -0
  139. package/styles/controls/_menu.scss +254 -0
  140. package/styles/controls/_message.scss +48 -0
  141. package/styles/controls/_org-chart.scss +128 -0
  142. package/styles/controls/_paginator.scss +59 -0
  143. package/styles/controls/_panel.scss +83 -0
  144. package/styles/controls/_popover.scss +40 -0
  145. package/styles/controls/_progress-bar.scss +74 -0
  146. package/styles/controls/_select-button.scss +61 -0
  147. package/styles/controls/_select.scss +216 -0
  148. package/styles/controls/_skeleton.scss +43 -0
  149. package/styles/controls/_slider.scss +163 -0
  150. package/styles/controls/_spinner.scss +34 -0
  151. package/styles/controls/_stepper.scss +109 -0
  152. package/styles/controls/_table.scss +523 -0
  153. package/styles/controls/_tabs.scss +93 -0
  154. package/styles/controls/_tag.scss +84 -0
  155. package/styles/controls/_toast.scss +141 -0
  156. package/styles/controls/_tooltip.scss +14 -0
  157. package/styles/controls/_tree.scss +113 -0
  158. package/styles/controls/_utility.scss +654 -0
  159. package/styles/star-ng.css +5807 -0
  160. package/styles/star-ng.min.css +1 -0
  161. package/styles/star-ng.scss +50 -0
  162. package/theme/star-theme-first-paint.js +1 -0
  163. package/types/star-ng-ui-accordion.d.ts +82 -0
  164. package/types/star-ng-ui-autocomplete.d.ts +171 -0
  165. package/types/star-ng-ui-avatar.d.ts +43 -0
  166. package/types/star-ng-ui-badge.d.ts +46 -0
  167. package/types/star-ng-ui-breadcrumb.d.ts +39 -0
  168. package/types/star-ng-ui-button.d.ts +79 -0
  169. package/types/star-ng-ui-card.d.ts +29 -0
  170. package/types/star-ng-ui-chart.d.ts +337 -0
  171. package/types/star-ng-ui-checkbox.d.ts +92 -0
  172. package/types/star-ng-ui-core.d.ts +373 -0
  173. package/types/star-ng-ui-data-display.d.ts +438 -0
  174. package/types/star-ng-ui-date-picker.d.ts +701 -0
  175. package/types/star-ng-ui-dialog.d.ts +254 -0
  176. package/types/star-ng-ui-drawer.d.ts +29 -0
  177. package/types/star-ng-ui-editor.d.ts +96 -0
  178. package/types/star-ng-ui-field.d.ts +146 -0
  179. package/types/star-ng-ui-file-upload.d.ts +192 -0
  180. package/types/star-ng-ui-i18n-de.d.ts +7 -0
  181. package/types/star-ng-ui-i18n-es.d.ts +7 -0
  182. package/types/star-ng-ui-input-group.d.ts +58 -0
  183. package/types/star-ng-ui-input-mask.d.ts +126 -0
  184. package/types/star-ng-ui-input-number.d.ts +193 -0
  185. package/types/star-ng-ui-input-otp.d.ts +86 -0
  186. package/types/star-ng-ui-input-tags.d.ts +159 -0
  187. package/types/star-ng-ui-knob.d.ts +121 -0
  188. package/types/star-ng-ui-layout.d.ts +154 -0
  189. package/types/star-ng-ui-listbox.d.ts +170 -0
  190. package/types/star-ng-ui-media.d.ts +161 -0
  191. package/types/star-ng-ui-menu.d.ts +332 -0
  192. package/types/star-ng-ui-message.d.ts +52 -0
  193. package/types/star-ng-ui-paginator.d.ts +85 -0
  194. package/types/star-ng-ui-panel.d.ts +65 -0
  195. package/types/star-ng-ui-password.d.ts +129 -0
  196. package/types/star-ng-ui-popover.d.ts +57 -0
  197. package/types/star-ng-ui-progress-bar.d.ts +49 -0
  198. package/types/star-ng-ui-radio.d.ts +116 -0
  199. package/types/star-ng-ui-rating.d.ts +52 -0
  200. package/types/star-ng-ui-select-button.d.ts +169 -0
  201. package/types/star-ng-ui-select.d.ts +563 -0
  202. package/types/star-ng-ui-skeleton.d.ts +47 -0
  203. package/types/star-ng-ui-slider.d.ts +145 -0
  204. package/types/star-ng-ui-spinner.d.ts +29 -0
  205. package/types/star-ng-ui-stepper.d.ts +89 -0
  206. package/types/star-ng-ui-table.d.ts +885 -0
  207. package/types/star-ng-ui-tabs.d.ts +109 -0
  208. package/types/star-ng-ui-tag.d.ts +35 -0
  209. package/types/star-ng-ui-theme-switch.d.ts +36 -0
  210. package/types/star-ng-ui-theme.d.ts +95 -0
  211. package/types/star-ng-ui-toast.d.ts +84 -0
  212. package/types/star-ng-ui-toggle-switch.d.ts +81 -0
  213. package/types/star-ng-ui-tooltip.d.ts +66 -0
  214. package/types/star-ng-ui-transloco.d.ts +14 -0
  215. package/types/star-ng-ui-tree.d.ts +343 -0
  216. package/types/star-ng-ui-utility.d.ts +533 -0
  217. package/types/star-ng-ui.d.ts +51 -0
@@ -0,0 +1,833 @@
1
+ import { _IdGenerator } from "@angular/cdk/a11y";
2
+ import { NgTemplateOutlet } from "@angular/common";
3
+ import * as i0 from "@angular/core";
4
+ import { ChangeDetectionStrategy, Component, Directive, TemplateRef, booleanAttribute, computed, contentChild, effect, inject, input, model, signal, viewChild } from "@angular/core";
5
+ import { STAR_UI_TEXT, starInlineKey, starIsRtl } from "@star-ng/ui/core";
6
+ import { StarDialog } from "@star-ng/ui/dialog";
7
+ var StarCarouselItem = class StarCarouselItem {
8
+ starCarouselItemOf = input(null, ...ngDevMode ? [{ debugName: "starCarouselItemOf" }] : /* istanbul ignore next */ []);
9
+ template = inject(TemplateRef);
10
+ static ngTemplateContextGuard(_dir, _ctx) {
11
+ return true;
12
+ }
13
+ static ɵfac = i0.ɵɵngDeclareFactory({
14
+ minVersion: "12.0.0",
15
+ version: "22.2.6",
16
+ ngImport: i0,
17
+ type: StarCarouselItem,
18
+ deps: [],
19
+ target: i0.ɵɵFactoryTarget.Directive
20
+ });
21
+ static ɵdir = i0.ɵɵngDeclareDirective({
22
+ minVersion: "17.1.0",
23
+ version: "22.2.6",
24
+ type: StarCarouselItem,
25
+ isStandalone: true,
26
+ selector: "ng-template[starCarouselItem]",
27
+ inputs: { starCarouselItemOf: {
28
+ classPropertyName: "starCarouselItemOf",
29
+ publicName: "starCarouselItemOf",
30
+ isSignal: true,
31
+ isRequired: false,
32
+ transformFunction: null
33
+ } },
34
+ ngImport: i0
35
+ });
36
+ };
37
+ i0.ɵɵngDeclareClassMetadata({
38
+ minVersion: "12.0.0",
39
+ version: "22.2.6",
40
+ ngImport: i0,
41
+ type: StarCarouselItem,
42
+ decorators: [{
43
+ type: Directive,
44
+ args: [{ selector: "ng-template[starCarouselItem]" }]
45
+ }],
46
+ propDecorators: { starCarouselItemOf: [{
47
+ type: i0.Input,
48
+ args: [{
49
+ isSignal: true,
50
+ alias: "starCarouselItemOf",
51
+ required: false
52
+ }]
53
+ }] }
54
+ });
55
+ var StarCarousel = class StarCarousel {
56
+ text = inject(STAR_UI_TEXT);
57
+ items = input([], ...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
58
+ numVisible = input(1, ...ngDevMode ? [{ debugName: "numVisible" }] : /* istanbul ignore next */ []);
59
+ autoplay = input(0, ...ngDevMode ? [{ debugName: "autoplay" }] : /* istanbul ignore next */ []);
60
+ ariaLabel = input(null, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
61
+ itemTemplate = contentChild(StarCarouselItem, ...ngDevMode ? [{ debugName: "itemTemplate" }] : /* istanbul ignore next */ []);
62
+ track = viewChild.required("track", ...ngDevMode ? [{ debugName: "track" }] : /* istanbul ignore next */ []);
63
+ page = signal(0, ...ngDevMode ? [{ debugName: "page" }] : /* istanbul ignore next */ []);
64
+ playing = signal(true, ...ngDevMode ? [{ debugName: "playing" }] : /* istanbul ignore next */ []);
65
+ hovering = signal(false, ...ngDevMode ? [{ debugName: "hovering" }] : /* istanbul ignore next */ []);
66
+ pages = computed(() => Math.max(1, Math.ceil(this.items().length / this.numVisible())), ...ngDevMode ? [{ debugName: "pages" }] : /* istanbul ignore next */ []);
67
+ dots = computed(() => Array.from({ length: this.pages() }, (_, i) => i), ...ngDevMode ? [{ debugName: "dots" }] : /* istanbul ignore next */ []);
68
+ constructor() {
69
+ effect((onCleanup) => {
70
+ const ms = this.autoplay();
71
+ if (!ms) return;
72
+ const id = setInterval(() => {
73
+ if (!this.playing() || this.hovering()) return;
74
+ this.goTo(this.page() >= this.pages() - 1 ? 0 : this.page() + 1);
75
+ }, ms);
76
+ onCleanup(() => clearInterval(id));
77
+ });
78
+ }
79
+ goTo(page) {
80
+ const target = Math.min(Math.max(page, 0), this.pages() - 1);
81
+ this.page.set(target);
82
+ const track = this.track().nativeElement;
83
+ const slide = track.children[target * this.numVisible()];
84
+ const reduce = matchMedia?.("(prefers-reduced-motion: reduce)").matches;
85
+ const distance = slide ? this.distanceToStart(slide, track) : -track.scrollLeft;
86
+ track.scrollBy?.({
87
+ left: distance,
88
+ behavior: reduce ? "auto" : "smooth"
89
+ });
90
+ }
91
+ distanceToStart(slide, track) {
92
+ const slideBox = slide.getBoundingClientRect();
93
+ const trackBox = track.getBoundingClientRect();
94
+ return starIsRtl(track) ? slideBox.right - trackBox.right : slideBox.left - trackBox.left;
95
+ }
96
+ syncPage() {
97
+ const track = this.track().nativeElement;
98
+ const slideWidth = track.children[0]?.offsetWidth ?? 1;
99
+ this.page.set(Math.round(Math.abs(track.scrollLeft) / (slideWidth * this.numVisible())));
100
+ }
101
+ static ɵfac = i0.ɵɵngDeclareFactory({
102
+ minVersion: "12.0.0",
103
+ version: "22.2.6",
104
+ ngImport: i0,
105
+ type: StarCarousel,
106
+ deps: [],
107
+ target: i0.ɵɵFactoryTarget.Component
108
+ });
109
+ static ɵcmp = i0.ɵɵngDeclareComponent({
110
+ minVersion: "17.0.0",
111
+ version: "22.2.6",
112
+ type: StarCarousel,
113
+ isStandalone: true,
114
+ selector: "star-carousel",
115
+ inputs: {
116
+ items: {
117
+ classPropertyName: "items",
118
+ publicName: "items",
119
+ isSignal: true,
120
+ isRequired: false,
121
+ transformFunction: null
122
+ },
123
+ numVisible: {
124
+ classPropertyName: "numVisible",
125
+ publicName: "numVisible",
126
+ isSignal: true,
127
+ isRequired: false,
128
+ transformFunction: null
129
+ },
130
+ autoplay: {
131
+ classPropertyName: "autoplay",
132
+ publicName: "autoplay",
133
+ isSignal: true,
134
+ isRequired: false,
135
+ transformFunction: null
136
+ },
137
+ ariaLabel: {
138
+ classPropertyName: "ariaLabel",
139
+ publicName: "ariaLabel",
140
+ isSignal: true,
141
+ isRequired: false,
142
+ transformFunction: null
143
+ }
144
+ },
145
+ host: {
146
+ attributes: {
147
+ "role": "region",
148
+ "aria-roledescription": "carousel"
149
+ },
150
+ listeners: {
151
+ "mouseenter": "hovering.set(true)",
152
+ "mouseleave": "hovering.set(false)",
153
+ "focusin": "hovering.set(true)",
154
+ "focusout": "hovering.set(false)"
155
+ },
156
+ properties: {
157
+ "attr.aria-label": "ariaLabel()",
158
+ "style.--star-visible": "numVisible()"
159
+ },
160
+ classAttribute: "star-carousel"
161
+ },
162
+ queries: [{
163
+ propertyName: "itemTemplate",
164
+ first: true,
165
+ predicate: StarCarouselItem,
166
+ descendants: true,
167
+ isSignal: true
168
+ }],
169
+ viewQueries: [{
170
+ propertyName: "track",
171
+ first: true,
172
+ predicate: ["track"],
173
+ descendants: true,
174
+ isSignal: true
175
+ }],
176
+ ngImport: i0,
177
+ template: `
178
+ <div class="star-carousel__controls">
179
+ @if (autoplay()) {
180
+ <button
181
+ type="button"
182
+ class="star-select__icon-btn"
183
+ [attr.aria-label]="playing() ? text.pauseSlides : text.playSlides"
184
+ (click)="playing.set(!playing())"
185
+ >
186
+ <i
187
+ class="ph-bold"
188
+ [class.ph-pause]="playing()"
189
+ [class.ph-play]="!playing()"
190
+ aria-hidden="true"
191
+ ></i>
192
+ </button>
193
+ }
194
+ <button
195
+ type="button"
196
+ class="star-select__icon-btn"
197
+ [attr.aria-label]="text.previousSlides"
198
+ [disabled]="page() === 0"
199
+ (click)="goTo(page() - 1)"
200
+ >
201
+ <i class="ph-bold ph-caret-left star-icon-mirror" aria-hidden="true"></i>
202
+ </button>
203
+ <button
204
+ type="button"
205
+ class="star-select__icon-btn"
206
+ [attr.aria-label]="text.nextSlides"
207
+ [disabled]="page() >= pages() - 1"
208
+ (click)="goTo(page() + 1)"
209
+ >
210
+ <i class="ph-bold ph-caret-right star-icon-mirror" aria-hidden="true"></i>
211
+ </button>
212
+ </div>
213
+ <div
214
+ #track
215
+ class="star-carousel__track"
216
+ role="group"
217
+ tabindex="0"
218
+ [attr.aria-label]="ariaLabel()"
219
+ [attr.aria-live]="playing() ? 'off' : 'polite'"
220
+ (scrollend)="syncPage()"
221
+ >
222
+ @for (item of items(); track $index; let i = $index) {
223
+ <div
224
+ class="star-carousel__slide"
225
+ role="group"
226
+ aria-roledescription="slide"
227
+ [attr.aria-label]="text.ofTotal(i + 1, items().length)"
228
+ >
229
+ @if (itemTemplate(); as custom) {
230
+ <ng-container
231
+ *ngTemplateOutlet="custom.template; context: { $implicit: item, index: i }"
232
+ />
233
+ }
234
+ </div>
235
+ }
236
+ </div>
237
+ @if (pages() > 1) {
238
+ <div class="star-carousel__dots">
239
+ @for (dot of dots(); track dot) {
240
+ <button
241
+ type="button"
242
+ class="star-carousel__dot"
243
+ [class.star-carousel__dot--on]="dot === page()"
244
+ [attr.aria-label]="text.page(dot + 1)"
245
+ [attr.aria-current]="dot === page() || null"
246
+ (click)="goTo(dot)"
247
+ ></button>
248
+ }
249
+ </div>
250
+ }
251
+ `,
252
+ isInline: true,
253
+ dependencies: [{
254
+ kind: "directive",
255
+ type: NgTemplateOutlet,
256
+ selector: "[ngTemplateOutlet]",
257
+ inputs: [
258
+ "ngTemplateOutletContext",
259
+ "ngTemplateOutlet",
260
+ "ngTemplateOutletInjector"
261
+ ]
262
+ }],
263
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
264
+ });
265
+ };
266
+ i0.ɵɵngDeclareClassMetadata({
267
+ minVersion: "12.0.0",
268
+ version: "22.2.6",
269
+ ngImport: i0,
270
+ type: StarCarousel,
271
+ decorators: [{
272
+ type: Component,
273
+ args: [{
274
+ selector: "star-carousel",
275
+ imports: [NgTemplateOutlet],
276
+ changeDetection: ChangeDetectionStrategy.OnPush,
277
+ host: {
278
+ class: "star-carousel",
279
+ role: "region",
280
+ "aria-roledescription": "carousel",
281
+ "[attr.aria-label]": "ariaLabel()",
282
+ "[style.--star-visible]": "numVisible()",
283
+ "(mouseenter)": "hovering.set(true)",
284
+ "(mouseleave)": "hovering.set(false)",
285
+ "(focusin)": "hovering.set(true)",
286
+ "(focusout)": "hovering.set(false)"
287
+ },
288
+ template: `
289
+ <div class="star-carousel__controls">
290
+ @if (autoplay()) {
291
+ <button
292
+ type="button"
293
+ class="star-select__icon-btn"
294
+ [attr.aria-label]="playing() ? text.pauseSlides : text.playSlides"
295
+ (click)="playing.set(!playing())"
296
+ >
297
+ <i
298
+ class="ph-bold"
299
+ [class.ph-pause]="playing()"
300
+ [class.ph-play]="!playing()"
301
+ aria-hidden="true"
302
+ ></i>
303
+ </button>
304
+ }
305
+ <button
306
+ type="button"
307
+ class="star-select__icon-btn"
308
+ [attr.aria-label]="text.previousSlides"
309
+ [disabled]="page() === 0"
310
+ (click)="goTo(page() - 1)"
311
+ >
312
+ <i class="ph-bold ph-caret-left star-icon-mirror" aria-hidden="true"></i>
313
+ </button>
314
+ <button
315
+ type="button"
316
+ class="star-select__icon-btn"
317
+ [attr.aria-label]="text.nextSlides"
318
+ [disabled]="page() >= pages() - 1"
319
+ (click)="goTo(page() + 1)"
320
+ >
321
+ <i class="ph-bold ph-caret-right star-icon-mirror" aria-hidden="true"></i>
322
+ </button>
323
+ </div>
324
+ <div
325
+ #track
326
+ class="star-carousel__track"
327
+ role="group"
328
+ tabindex="0"
329
+ [attr.aria-label]="ariaLabel()"
330
+ [attr.aria-live]="playing() ? 'off' : 'polite'"
331
+ (scrollend)="syncPage()"
332
+ >
333
+ @for (item of items(); track $index; let i = $index) {
334
+ <div
335
+ class="star-carousel__slide"
336
+ role="group"
337
+ aria-roledescription="slide"
338
+ [attr.aria-label]="text.ofTotal(i + 1, items().length)"
339
+ >
340
+ @if (itemTemplate(); as custom) {
341
+ <ng-container
342
+ *ngTemplateOutlet="custom.template; context: { $implicit: item, index: i }"
343
+ />
344
+ }
345
+ </div>
346
+ }
347
+ </div>
348
+ @if (pages() > 1) {
349
+ <div class="star-carousel__dots">
350
+ @for (dot of dots(); track dot) {
351
+ <button
352
+ type="button"
353
+ class="star-carousel__dot"
354
+ [class.star-carousel__dot--on]="dot === page()"
355
+ [attr.aria-label]="text.page(dot + 1)"
356
+ [attr.aria-current]="dot === page() || null"
357
+ (click)="goTo(dot)"
358
+ ></button>
359
+ }
360
+ </div>
361
+ }
362
+ `
363
+ }]
364
+ }],
365
+ ctorParameters: () => [],
366
+ propDecorators: {
367
+ items: [{
368
+ type: i0.Input,
369
+ args: [{
370
+ isSignal: true,
371
+ alias: "items",
372
+ required: false
373
+ }]
374
+ }],
375
+ numVisible: [{
376
+ type: i0.Input,
377
+ args: [{
378
+ isSignal: true,
379
+ alias: "numVisible",
380
+ required: false
381
+ }]
382
+ }],
383
+ autoplay: [{
384
+ type: i0.Input,
385
+ args: [{
386
+ isSignal: true,
387
+ alias: "autoplay",
388
+ required: false
389
+ }]
390
+ }],
391
+ ariaLabel: [{
392
+ type: i0.Input,
393
+ args: [{
394
+ isSignal: true,
395
+ alias: "ariaLabel",
396
+ required: false
397
+ }]
398
+ }],
399
+ itemTemplate: [{
400
+ type: i0.ContentChild,
401
+ args: [i0.forwardRef(() => StarCarouselItem), { isSignal: true }]
402
+ }],
403
+ track: [{
404
+ type: i0.ViewChild,
405
+ args: ["track", { isSignal: true }]
406
+ }]
407
+ }
408
+ });
409
+ var StarGalleria = class StarGalleria {
410
+ text = inject(STAR_UI_TEXT);
411
+ images = input([], ...ngDevMode ? [{ debugName: "images" }] : /* istanbul ignore next */ []);
412
+ activeIndex = model(0, ...ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []);
413
+ ariaLabel = input(null, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
414
+ current = computed(() => this.images()[this.activeIndex()] ?? null, ...ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []);
415
+ step(delta) {
416
+ const count = this.images().length;
417
+ if (count) this.activeIndex.set((this.activeIndex() + delta + count) % count);
418
+ }
419
+ onKeydown(event) {
420
+ const key = starInlineKey(event);
421
+ if (key === "ArrowLeft" || key === "ArrowRight") {
422
+ event.preventDefault();
423
+ this.step(key === "ArrowLeft" ? -1 : 1);
424
+ }
425
+ }
426
+ static ɵfac = i0.ɵɵngDeclareFactory({
427
+ minVersion: "12.0.0",
428
+ version: "22.2.6",
429
+ ngImport: i0,
430
+ type: StarGalleria,
431
+ deps: [],
432
+ target: i0.ɵɵFactoryTarget.Component
433
+ });
434
+ static ɵcmp = i0.ɵɵngDeclareComponent({
435
+ minVersion: "17.0.0",
436
+ version: "22.2.6",
437
+ type: StarGalleria,
438
+ isStandalone: true,
439
+ selector: "star-galleria",
440
+ inputs: {
441
+ images: {
442
+ classPropertyName: "images",
443
+ publicName: "images",
444
+ isSignal: true,
445
+ isRequired: false,
446
+ transformFunction: null
447
+ },
448
+ activeIndex: {
449
+ classPropertyName: "activeIndex",
450
+ publicName: "activeIndex",
451
+ isSignal: true,
452
+ isRequired: false,
453
+ transformFunction: null
454
+ },
455
+ ariaLabel: {
456
+ classPropertyName: "ariaLabel",
457
+ publicName: "ariaLabel",
458
+ isSignal: true,
459
+ isRequired: false,
460
+ transformFunction: null
461
+ }
462
+ },
463
+ outputs: { activeIndex: "activeIndexChange" },
464
+ host: {
465
+ attributes: {
466
+ "role": "region",
467
+ "aria-roledescription": "gallery"
468
+ },
469
+ properties: { "attr.aria-label": "ariaLabel() ?? text.galleryLabel" },
470
+ classAttribute: "star-galleria"
471
+ },
472
+ ngImport: i0,
473
+ template: `
474
+ @if (current(); as image) {
475
+ <figure class="star-galleria__stage" tabindex="0" (keydown)="onKeydown($event)">
476
+ <img [src]="image.src" [alt]="image.alt" loading="lazy" />
477
+ @if (image.caption) {
478
+ <figcaption class="star-galleria__caption">{{ image.caption }}</figcaption>
479
+ }
480
+ <button
481
+ type="button"
482
+ class="star-galleria__nav star-galleria__nav--prev"
483
+ [attr.aria-label]="text.previousImage"
484
+ (click)="step(-1)"
485
+ >
486
+ <i class="ph-bold ph-caret-left star-icon-mirror" aria-hidden="true"></i>
487
+ </button>
488
+ <button
489
+ type="button"
490
+ class="star-galleria__nav star-galleria__nav--next"
491
+ [attr.aria-label]="text.nextImage"
492
+ (click)="step(1)"
493
+ >
494
+ <i class="ph-bold ph-caret-right star-icon-mirror" aria-hidden="true"></i>
495
+ </button>
496
+ <span class="star-galleria__count" aria-live="polite"
497
+ >{{ activeIndex() + 1 }} / {{ images().length }}</span
498
+ >
499
+ </figure>
500
+ }
501
+ <div class="star-galleria__thumbs">
502
+ @for (image of images(); track $index; let i = $index) {
503
+ <button
504
+ type="button"
505
+ class="star-galleria__thumb"
506
+ [attr.aria-current]="i === activeIndex() || null"
507
+ [attr.aria-label]="text.showImage(image.alt)"
508
+ (click)="activeIndex.set(i)"
509
+ >
510
+ <img [src]="image.thumbnail ?? image.src" alt="" loading="lazy" />
511
+ </button>
512
+ }
513
+ </div>
514
+ `,
515
+ isInline: true,
516
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
517
+ });
518
+ };
519
+ i0.ɵɵngDeclareClassMetadata({
520
+ minVersion: "12.0.0",
521
+ version: "22.2.6",
522
+ ngImport: i0,
523
+ type: StarGalleria,
524
+ decorators: [{
525
+ type: Component,
526
+ args: [{
527
+ selector: "star-galleria",
528
+ changeDetection: ChangeDetectionStrategy.OnPush,
529
+ host: {
530
+ class: "star-galleria",
531
+ role: "region",
532
+ "aria-roledescription": "gallery",
533
+ "[attr.aria-label]": "ariaLabel() ?? text.galleryLabel"
534
+ },
535
+ template: `
536
+ @if (current(); as image) {
537
+ <figure class="star-galleria__stage" tabindex="0" (keydown)="onKeydown($event)">
538
+ <img [src]="image.src" [alt]="image.alt" loading="lazy" />
539
+ @if (image.caption) {
540
+ <figcaption class="star-galleria__caption">{{ image.caption }}</figcaption>
541
+ }
542
+ <button
543
+ type="button"
544
+ class="star-galleria__nav star-galleria__nav--prev"
545
+ [attr.aria-label]="text.previousImage"
546
+ (click)="step(-1)"
547
+ >
548
+ <i class="ph-bold ph-caret-left star-icon-mirror" aria-hidden="true"></i>
549
+ </button>
550
+ <button
551
+ type="button"
552
+ class="star-galleria__nav star-galleria__nav--next"
553
+ [attr.aria-label]="text.nextImage"
554
+ (click)="step(1)"
555
+ >
556
+ <i class="ph-bold ph-caret-right star-icon-mirror" aria-hidden="true"></i>
557
+ </button>
558
+ <span class="star-galleria__count" aria-live="polite"
559
+ >{{ activeIndex() + 1 }} / {{ images().length }}</span
560
+ >
561
+ </figure>
562
+ }
563
+ <div class="star-galleria__thumbs">
564
+ @for (image of images(); track $index; let i = $index) {
565
+ <button
566
+ type="button"
567
+ class="star-galleria__thumb"
568
+ [attr.aria-current]="i === activeIndex() || null"
569
+ [attr.aria-label]="text.showImage(image.alt)"
570
+ (click)="activeIndex.set(i)"
571
+ >
572
+ <img [src]="image.thumbnail ?? image.src" alt="" loading="lazy" />
573
+ </button>
574
+ }
575
+ </div>
576
+ `
577
+ }]
578
+ }],
579
+ propDecorators: {
580
+ images: [{
581
+ type: i0.Input,
582
+ args: [{
583
+ isSignal: true,
584
+ alias: "images",
585
+ required: false
586
+ }]
587
+ }],
588
+ activeIndex: [{
589
+ type: i0.Input,
590
+ args: [{
591
+ isSignal: true,
592
+ alias: "activeIndex",
593
+ required: false
594
+ }]
595
+ }, {
596
+ type: i0.Output,
597
+ args: ["activeIndexChange"]
598
+ }],
599
+ ariaLabel: [{
600
+ type: i0.Input,
601
+ args: [{
602
+ isSignal: true,
603
+ alias: "ariaLabel",
604
+ required: false
605
+ }]
606
+ }]
607
+ }
608
+ });
609
+ var StarImage = class StarImage {
610
+ text = inject(STAR_UI_TEXT);
611
+ src = input.required(...ngDevMode ? [{ debugName: "src" }] : /* istanbul ignore next */ []);
612
+ alt = input.required(...ngDevMode ? [{ debugName: "alt" }] : /* istanbul ignore next */ []);
613
+ width = input(null, ...ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []);
614
+ preview = input(false, {
615
+ ...ngDevMode ? { debugName: "preview" } : /* istanbul ignore next */ {},
616
+ transform: booleanAttribute
617
+ });
618
+ open = signal(false, ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
619
+ zoom = signal(1, ...ngDevMode ? [{ debugName: "zoom" }] : /* istanbul ignore next */ []);
620
+ id = inject(_IdGenerator).getId("star-image-");
621
+ static ɵfac = i0.ɵɵngDeclareFactory({
622
+ minVersion: "12.0.0",
623
+ version: "22.2.6",
624
+ ngImport: i0,
625
+ type: StarImage,
626
+ deps: [],
627
+ target: i0.ɵɵFactoryTarget.Component
628
+ });
629
+ static ɵcmp = i0.ɵɵngDeclareComponent({
630
+ minVersion: "17.0.0",
631
+ version: "22.2.6",
632
+ type: StarImage,
633
+ isStandalone: true,
634
+ selector: "star-image",
635
+ inputs: {
636
+ src: {
637
+ classPropertyName: "src",
638
+ publicName: "src",
639
+ isSignal: true,
640
+ isRequired: true,
641
+ transformFunction: null
642
+ },
643
+ alt: {
644
+ classPropertyName: "alt",
645
+ publicName: "alt",
646
+ isSignal: true,
647
+ isRequired: true,
648
+ transformFunction: null
649
+ },
650
+ width: {
651
+ classPropertyName: "width",
652
+ publicName: "width",
653
+ isSignal: true,
654
+ isRequired: false,
655
+ transformFunction: null
656
+ },
657
+ preview: {
658
+ classPropertyName: "preview",
659
+ publicName: "preview",
660
+ isSignal: true,
661
+ isRequired: false,
662
+ transformFunction: null
663
+ }
664
+ },
665
+ host: { classAttribute: "star-image" },
666
+ ngImport: i0,
667
+ template: `
668
+ @if (preview()) {
669
+ <button
670
+ type="button"
671
+ class="star-image__trigger"
672
+ [attr.aria-label]="text.previewImage(alt())"
673
+ (click)="open.set(true)"
674
+ >
675
+ <img [src]="src()" [alt]="alt()" [attr.width]="width()" loading="lazy" />
676
+ <span class="star-image__hint" aria-hidden="true"
677
+ ><i class="ph-bold ph-magnifying-glass-plus"></i
678
+ ></span>
679
+ </button>
680
+ <star-dialog [(visible)]="open" [header]="alt()" size="xl" dismissableMask>
681
+ <div class="star-image__zoom-bar">
682
+ <button
683
+ type="button"
684
+ class="star-select__icon-btn"
685
+ [attr.aria-label]="text.zoomOut"
686
+ [disabled]="zoom() <= 0.5"
687
+ (click)="zoom.set(zoom() - 0.25)"
688
+ >
689
+ <i class="ph-bold ph-magnifying-glass-minus" aria-hidden="true"></i>
690
+ </button>
691
+ <span aria-live="polite">{{ zoom() * 100 }}%</span>
692
+ <button
693
+ type="button"
694
+ class="star-select__icon-btn"
695
+ [attr.aria-label]="text.zoomIn"
696
+ [disabled]="zoom() >= 3"
697
+ (click)="zoom.set(zoom() + 0.25)"
698
+ >
699
+ <i class="ph-bold ph-magnifying-glass-plus" aria-hidden="true"></i>
700
+ </button>
701
+ </div>
702
+ <!-- Focusable, so the arrow keys scroll a zoomed image. -->
703
+ <div class="star-image__stage" role="group" tabindex="0" [attr.aria-label]="alt()">
704
+ <img [src]="src()" [alt]="alt()" [style.transform]="'scale(' + zoom() + ')'" />
705
+ </div>
706
+ </star-dialog>
707
+ } @else {
708
+ <img [src]="src()" [alt]="alt()" [attr.width]="width()" loading="lazy" />
709
+ }
710
+ `,
711
+ isInline: true,
712
+ dependencies: [{
713
+ kind: "component",
714
+ type: StarDialog,
715
+ selector: "star-dialog",
716
+ inputs: [
717
+ "visible",
718
+ "header",
719
+ "size",
720
+ "width",
721
+ "modal",
722
+ "closable",
723
+ "closeOnEscape",
724
+ "dismissableMask",
725
+ "showHeader",
726
+ "role",
727
+ "ariaLabel"
728
+ ],
729
+ outputs: [
730
+ "visibleChange",
731
+ "shown",
732
+ "hidden"
733
+ ]
734
+ }],
735
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
736
+ });
737
+ };
738
+ i0.ɵɵngDeclareClassMetadata({
739
+ minVersion: "12.0.0",
740
+ version: "22.2.6",
741
+ ngImport: i0,
742
+ type: StarImage,
743
+ decorators: [{
744
+ type: Component,
745
+ args: [{
746
+ selector: "star-image",
747
+ imports: [StarDialog],
748
+ changeDetection: ChangeDetectionStrategy.OnPush,
749
+ host: { class: "star-image" },
750
+ template: `
751
+ @if (preview()) {
752
+ <button
753
+ type="button"
754
+ class="star-image__trigger"
755
+ [attr.aria-label]="text.previewImage(alt())"
756
+ (click)="open.set(true)"
757
+ >
758
+ <img [src]="src()" [alt]="alt()" [attr.width]="width()" loading="lazy" />
759
+ <span class="star-image__hint" aria-hidden="true"
760
+ ><i class="ph-bold ph-magnifying-glass-plus"></i
761
+ ></span>
762
+ </button>
763
+ <star-dialog [(visible)]="open" [header]="alt()" size="xl" dismissableMask>
764
+ <div class="star-image__zoom-bar">
765
+ <button
766
+ type="button"
767
+ class="star-select__icon-btn"
768
+ [attr.aria-label]="text.zoomOut"
769
+ [disabled]="zoom() <= 0.5"
770
+ (click)="zoom.set(zoom() - 0.25)"
771
+ >
772
+ <i class="ph-bold ph-magnifying-glass-minus" aria-hidden="true"></i>
773
+ </button>
774
+ <span aria-live="polite">{{ zoom() * 100 }}%</span>
775
+ <button
776
+ type="button"
777
+ class="star-select__icon-btn"
778
+ [attr.aria-label]="text.zoomIn"
779
+ [disabled]="zoom() >= 3"
780
+ (click)="zoom.set(zoom() + 0.25)"
781
+ >
782
+ <i class="ph-bold ph-magnifying-glass-plus" aria-hidden="true"></i>
783
+ </button>
784
+ </div>
785
+ <!-- Focusable, so the arrow keys scroll a zoomed image. -->
786
+ <div class="star-image__stage" role="group" tabindex="0" [attr.aria-label]="alt()">
787
+ <img [src]="src()" [alt]="alt()" [style.transform]="'scale(' + zoom() + ')'" />
788
+ </div>
789
+ </star-dialog>
790
+ } @else {
791
+ <img [src]="src()" [alt]="alt()" [attr.width]="width()" loading="lazy" />
792
+ }
793
+ `
794
+ }]
795
+ }],
796
+ propDecorators: {
797
+ src: [{
798
+ type: i0.Input,
799
+ args: [{
800
+ isSignal: true,
801
+ alias: "src",
802
+ required: true
803
+ }]
804
+ }],
805
+ alt: [{
806
+ type: i0.Input,
807
+ args: [{
808
+ isSignal: true,
809
+ alias: "alt",
810
+ required: true
811
+ }]
812
+ }],
813
+ width: [{
814
+ type: i0.Input,
815
+ args: [{
816
+ isSignal: true,
817
+ alias: "width",
818
+ required: false
819
+ }]
820
+ }],
821
+ preview: [{
822
+ type: i0.Input,
823
+ args: [{
824
+ isSignal: true,
825
+ alias: "preview",
826
+ required: false
827
+ }]
828
+ }]
829
+ }
830
+ });
831
+ export { StarCarousel, StarCarouselItem, StarGalleria, StarImage };
832
+
833
+ //# sourceMappingURL=star-ng-ui-media.mjs.map