@assistanz/carbideui 1.2.1 → 1.3.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.
- package/fesm2022/assistanz-carbideui.mjs +1983 -33
- package/fesm2022/assistanz-carbideui.mjs.map +1 -1
- package/index.d.ts +563 -12
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as i1$2 from '@angular/common';
|
|
2
2
|
import { CommonModule, NgTemplateOutlet, DOCUMENT, isPlatformBrowser } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { signal, computed, Input, ChangeDetectionStrategy, Component, EventEmitter, Output, Directive, inject, ElementRef, effect, Optional, Self, InjectionToken, ViewChild, forwardRef, ContentChildren, TemplateRef, untracked, Renderer2, afterNextRender, input, output, ChangeDetectorRef, DestroyRef, Injector, runInInjectionContext, ViewChildren, contentChildren, Injectable, viewChild, PLATFORM_ID, Pipe, makeEnvironmentProviders, HostListener } from '@angular/core';
|
|
4
|
+
import { signal, computed, Input, ChangeDetectionStrategy, Component, EventEmitter, Output, Directive, inject, ElementRef, effect, Optional, Self, InjectionToken, ViewChild, forwardRef, ContentChildren, TemplateRef, untracked, Renderer2, afterNextRender, input, output, ChangeDetectorRef, DestroyRef, Injector, runInInjectionContext, ViewChildren, contentChildren, Injectable, viewChild, PLATFORM_ID, Pipe, makeEnvironmentProviders, HostListener, model, linkedSignal, viewChildren } from '@angular/core';
|
|
5
5
|
import * as i1 from '@angular/platform-browser';
|
|
6
6
|
import * as i1$1 from '@angular/forms';
|
|
7
7
|
import { NgControl, NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
8
8
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
9
|
-
import { Router, NavigationEnd, RouterLink } from '@angular/router';
|
|
9
|
+
import { Router, ActivatedRoute, NavigationEnd, RouterLink, RouterLinkActive } from '@angular/router';
|
|
10
10
|
import { filter, fromEvent } from 'rxjs';
|
|
11
11
|
import { DonutChart, PieChart, AreaChart, LineChart, StackedBarChart, SimpleBarChart, GaugeChart } from '@carbon/charts';
|
|
12
12
|
import { map } from 'rxjs/operators';
|
|
@@ -193,6 +193,146 @@ const ICONS = {
|
|
|
193
193
|
svg: `<circle cx="16" cy="8" r="2"></circle><circle cx="16" cy="16" r="2"></circle><circle cx="16" cy="24" r="2"></circle>`,
|
|
194
194
|
viewBox: '0 0 32 32',
|
|
195
195
|
},
|
|
196
|
+
/** Currency symbol — billing, invoices, pricing */
|
|
197
|
+
billing: {
|
|
198
|
+
svg: `<path d="M21,12V10H17V7H15v3H13a2.002,2.002,0,0,0-2,2v3a2.002,2.002,0,0,0,2,2h6v3H11v2h4v3h2V22h2a2.0023,2.0023,0,0,0,2-2V17a2.002,2.002,0,0,0-2-2H13V12Z"/><path d="M16,4A12,12,0,1,1,4,16,12.0353,12.0353,0,0,1,16,4m0-2A14,14,0,1,0,30,16,14.0412,14.0412,0,0,0,16,2Z"/>`,
|
|
199
|
+
viewBox: '0 0 32 32',
|
|
200
|
+
},
|
|
201
|
+
/** Bar chart — reports and analytics pages */
|
|
202
|
+
reports: {
|
|
203
|
+
svg: `<path d="M4,2H2V28a2,2,0,0,0,2,2H30V28H4V25H26V17H4V13H18V5H4ZM24,19v4H4V19ZM16,7v4H4V7Z"/>`,
|
|
204
|
+
viewBox: '0 0 32 32',
|
|
205
|
+
},
|
|
206
|
+
/** Shopping catalog — marketplace / product catalog */
|
|
207
|
+
marketplace: {
|
|
208
|
+
svg: `<path d="M17 24H21V28H17z"/><path d="M24 24H28V28H24z"/><path d="M17 17H21V21H17z"/><path d="M24 17H28V21H24z"/><path d="M28,11h-6V7c0-1.7-1.3-3-3-3h-6c-1.7,0-3,1.3-3,3v4H4c-0.6,0-1,0.4-1,1c0,0.1,0,0.1,0,0.2l1.9,12.1c0.1,1,1,1.7,2,1.7H15v-2 H6.9L5.2,13H28V11z M12,7c0-0.6,0.4-1,1-1h6c0.6,0,1,0.4,1,1v4h-8V7z"/>`,
|
|
209
|
+
viewBox: '0 0 32 32',
|
|
210
|
+
},
|
|
211
|
+
/** Question mark in circle — support and help */
|
|
212
|
+
support: {
|
|
213
|
+
svg: `<path d="M16,2A14,14,0,1,0,30,16,14,14,0,0,0,16,2Zm0,26A12,12,0,1,1,28,16,12,12,0,0,1,16,28Z"/><circle cx="16" cy="23.5" r="1.5"/><path d="M17,8H15.5A4.49,4.49,0,0,0,11,12.5V13h2v-.5A2.5,2.5,0,0,1,15.5,10H17a2.5,2.5,0,0,1,0,5H15v4.5h2V17a4.5,4.5,0,0,0,0-9Z"/>`,
|
|
214
|
+
viewBox: '0 0 32 32',
|
|
215
|
+
},
|
|
216
|
+
/** Key / certificate — licenses and entitlements */
|
|
217
|
+
license: {
|
|
218
|
+
svg: `<path d="M10 6H22V8H10z"/><path d="M10 10H22V12H10z"/><path d="M10 24H16V26H10z"/><path d="M10 14H16V16H10z"/><path d="M24,30H8a2.0023,2.0023,0,0,1-2-2V4A2.0023,2.0023,0,0,1,8,2H24a2.0023,2.0023,0,0,1,2,2V28A2.0023,2.0023,0,0,1,24,30ZM8,4V28H24V4Z"/>`,
|
|
219
|
+
viewBox: '0 0 32 32',
|
|
220
|
+
},
|
|
221
|
+
/** Pulse line — activity feed, audit log, health */
|
|
222
|
+
activity: {
|
|
223
|
+
svg: `<path d="M12,29a1,1,0,0,1-.92-.62L6.33,17H2V15H7a1,1,0,0,1,.92.62L12,25.28,20.06,3.65A1,1,0,0,1,21,3a1,1,0,0,1,.93.68L25.72,15H30v2H25a1,1,0,0,1-.95-.68L21,7,12.94,28.35A1,1,0,0,1,12,29Z"/>`,
|
|
224
|
+
viewBox: '0 0 32 32',
|
|
225
|
+
},
|
|
226
|
+
/** Globe — language / region selector */
|
|
227
|
+
globe: {
|
|
228
|
+
svg: `<path d="M16,2A14,14,0,1,0,30,16,14.0158,14.0158,0,0,0,16,2Zm5,3.1055a12.0136,12.0136,0,0,1,2.9158,1.8994L23.5034,8H21ZM13.3784,27.7026A11.9761,11.9761,0,0,1,8.1157,6.9761L9.4648,9h3.3423l-1.5,4H7.2793L5.8967,17.1475,8.4648,21h5l1.4319,2.1475ZM16,28c-.2034,0-.4016-.02-.6025-.03l1.3967-4.19a1.9876,1.9876,0,0,0-.2334-1.7412l-1.4319-2.1475A1.9962,1.9962,0,0,0,13.4648,19h-3.93L8.1033,16.8525,8.7207,15H11v2h2V14.1812l2.9363-7.83-1.8726-.7022L13.5571,7H10.5352L9.728,5.7891A11.7941,11.7941,0,0,1,19,4.395V8a2.0025,2.0025,0,0,0,2,2h2.5857A1.9865,1.9865,0,0,0,25,9.4141l.1406-.1407.2818-.68A11.9813,11.9813,0,0,1,27.3,12H22.5986a1.9927,1.9927,0,0,0-1.9719,1.665L20.03,17.1064a1.99,1.99,0,0,0,.991,2.086l2.1647,1.4638,1.4585,3.646A11.9577,11.9577,0,0,1,16,28Zm8.8145-8.6563L22.1,17.5088l-.1-.06L22.5986,14h5.2207a11.743,11.743,0,0,1-1.7441,8.4951Z"/>`,
|
|
229
|
+
viewBox: '0 0 32 32',
|
|
230
|
+
},
|
|
231
|
+
/** Arrow leaving a door — sign out / log out */
|
|
232
|
+
sign_out: {
|
|
233
|
+
svg: `<path d="M6,30H18a2.0023,2.0023,0,0,0,2-2V25H18v3H6V4H18V7h2V4a2.0023,2.0023,0,0,0-2-2H6A2.0023,2.0023,0,0,0,4,4V28A2.0023,2.0023,0,0,0,6,30Z"/><path d="M20.586 20.586 24.172 17 10 17 10 15 24.172 15 20.586 11.414 22 10 28 16 22 22 20.586 20.586z"/>`,
|
|
234
|
+
viewBox: '0 0 32 32',
|
|
235
|
+
},
|
|
236
|
+
/** Palette — theme / appearance switcher */
|
|
237
|
+
theme: {
|
|
238
|
+
svg: `<circle cx="10" cy="12" r="2"/><circle cx="16" cy="9" r="2"/><circle cx="22" cy="12" r="2"/><circle cx="23" cy="18" r="2"/><circle cx="19" cy="23" r="2"/><path d="M16.54,2A14,14,0,0,0,2,16a4.82,4.82,0,0,0,6.09,4.65l1.12-.31A3,3,0,0,1,13,23.24V27a3,3,0,0,0,3,3A14,14,0,0,0,30,15.46,14.05,14.05,0,0,0,16.54,2Zm8.11,22.31A11.93,11.93,0,0,1,16,28a1,1,0,0,1-1-1V23.24a5,5,0,0,0-5-5,5.07,5.07,0,0,0-1.33.18l-1.12.31A2.82,2.82,0,0,1,4,16,12,12,0,0,1,16.47,4,12.18,12.18,0,0,1,28,15.53,11.89,11.89,0,0,1,24.65,24.32Z"/>`,
|
|
239
|
+
viewBox: '0 0 32 32',
|
|
240
|
+
},
|
|
241
|
+
/** Funnel — filter table or list data */
|
|
242
|
+
filter: {
|
|
243
|
+
svg: `<path d="M18,28H14a2,2,0,0,1-2-2V18.41L4.59,11A2,2,0,0,1,4,9.59V6A2,2,0,0,1,6,4H26a2,2,0,0,1,2,2V9.59A2,2,0,0,1,27.41,11L20,18.41V26A2,2,0,0,1,18,28ZM6,6V9.59l8,8V26h4V17.59l8-8V6Z"/>`,
|
|
244
|
+
viewBox: '0 0 32 32',
|
|
245
|
+
},
|
|
246
|
+
/** Arrow into tray — download a file */
|
|
247
|
+
download: {
|
|
248
|
+
svg: `<path d="M26,24v4H6V24H4v4H4a2,2,0,0,0,2,2H26a2,2,0,0,0,2-2h0V24Z"/><path d="M26 14 24.59 12.59 17 20.17 17 2 15 2 15 20.17 7.41 12.59 6 14 16 24 26 14z"/>`,
|
|
249
|
+
viewBox: '0 0 32 32',
|
|
250
|
+
},
|
|
251
|
+
/** Arrow out of box — export data / share out */
|
|
252
|
+
export: {
|
|
253
|
+
svg: `<path d="M26,24v4H6V24H4v4l.0076-.0049A1.9977,1.9977,0,0,0,6,30H26a2,2,0,0,0,2-2h0V24Z"/><path d="M6 12 7.411 13.405 15 5.825 15 24 17 24 17 5.825 24.591 13.405 26 12 16 2 6 12z"/>`,
|
|
254
|
+
viewBox: '0 0 32 32',
|
|
255
|
+
},
|
|
256
|
+
/** Arrow up from tray — upload a file */
|
|
257
|
+
upload: {
|
|
258
|
+
svg: `<path d="M6 18 7.41 19.41 15 11.83 15 30 17 30 17 11.83 24.59 19.41 26 18 16 8 6 18z"/><path d="M6,8V4H26V8h2V4a2,2,0,0,0-2-2H6A2,2,0,0,0,4,4V8Z"/>`,
|
|
259
|
+
viewBox: '0 0 32 32',
|
|
260
|
+
},
|
|
261
|
+
/** Sliders — preferences and per-view settings */
|
|
262
|
+
settings_adjust: {
|
|
263
|
+
svg: `<path d="M30,8h-4.1c-0.5-2.3-2.5-4-4.9-4s-4.4,1.7-4.9,4H2v2h14.1c0.5,2.3,2.5,4,4.9,4s4.4-1.7,4.9-4H30V8z M21,12c-1.7,0-3-1.3-3-3 s1.3-3,3-3s3,1.3,3,3S22.7,12,21,12z"/><path d="M2,24h4.1c0.5,2.3,2.5,4,4.9,4s4.4-1.7,4.9-4H30v-2H15.9c-0.5-2.3-2.5-4-4.9-4s-4.4,1.7-4.9,4H2V24z M11,20c1.7,0,3,1.3,3,3 s-1.3,3-3,3s-3-1.3-3-3S9.3,20,11,20z"/>`,
|
|
264
|
+
viewBox: '0 0 32 32',
|
|
265
|
+
},
|
|
266
|
+
/** Clock — duration, scheduled, recent */
|
|
267
|
+
time: {
|
|
268
|
+
svg: `<path d="M16,30A14,14,0,1,1,30,16,14,14,0,0,1,16,30ZM16,4A12,12,0,1,0,28,16,12,12,0,0,0,16,4Z"/><path d="M20.59 22 15 16.41 15 7 17 7 17 15.58 22 20.59 20.59 22z"/>`,
|
|
269
|
+
viewBox: '0 0 32 32',
|
|
270
|
+
},
|
|
271
|
+
/** Page — documents, files, invoices */
|
|
272
|
+
document: {
|
|
273
|
+
svg: `<path d="M25.7,9.3l-7-7C18.5,2.1,18.3,2,18,2H8C6.9,2,6,2.9,6,4v24c0,1.1,0.9,2,2,2h16c1.1,0,2-0.9,2-2V10C26,9.7,25.9,9.5,25.7,9.3 z M18,4.4l5.6,5.6H18V4.4z M24,28H8V4h8v6c0,1.1,0.9,2,2,2h6V28z"/><path d="M10 22H22V24H10z"/><path d="M10 16H22V18H10z"/>`,
|
|
274
|
+
viewBox: '0 0 32 32',
|
|
275
|
+
},
|
|
276
|
+
/** Chain link — copy link, external reference */
|
|
277
|
+
link: {
|
|
278
|
+
svg: `<path d="M29.25,6.76a6,6,0,0,0-8.5,0l1.42,1.42a4,4,0,1,1,5.67,5.67l-8,8a4,4,0,1,1-5.67-5.66l1.41-1.42-1.41-1.42-1.42,1.42a6,6,0,0,0,0,8.5A6,6,0,0,0,17,25a6,6,0,0,0,4.27-1.76l8-8A6,6,0,0,0,29.25,6.76Z"/><path d="M4.19,24.82a4,4,0,0,1,0-5.67l8-8a4,4,0,0,1,5.67,0A3.94,3.94,0,0,1,19,14a4,4,0,0,1-1.17,2.85L15.71,19l1.42,1.42,2.12-2.12a6,6,0,0,0-8.51-8.51l-8,8a6,6,0,0,0,0,8.51A6,6,0,0,0,7,28a6.07,6.07,0,0,0,4.28-1.76L9.86,24.82A4,4,0,0,1,4.19,24.82Z"/>`,
|
|
279
|
+
viewBox: '0 0 32 32',
|
|
280
|
+
},
|
|
281
|
+
/** Floppy disk — save changes */
|
|
282
|
+
save: {
|
|
283
|
+
svg: `<path d="M27.71,9.29l-5-5A1,1,0,0,0,22,4H6A2,2,0,0,0,4,6V26a2,2,0,0,0,2,2H26a2,2,0,0,0,2-2V10A1,1,0,0,0,27.71,9.29ZM12,6h8v4H12Zm8,20H12V18h8Zm2,0V18a2,2,0,0,0-2-2H12a2,2,0,0,0-2,2v8H6V6h4v4a2,2,0,0,0,2,2h8a2,2,0,0,0,2-2V6.41l4,4V26Z"/>`,
|
|
284
|
+
viewBox: '0 0 32 32',
|
|
285
|
+
},
|
|
286
|
+
/** Circular arrow — reload / retry */
|
|
287
|
+
refresh: {
|
|
288
|
+
svg: `<path d="M26,18A10,10,0,1,1,16,8h6.1821l-3.5844,3.5854L20,13l6-6L20,1,18.5977,2.414,22.1851,6H16A12,12,0,1,0,28,18Z"/>`,
|
|
289
|
+
viewBox: '0 0 32 32',
|
|
290
|
+
},
|
|
291
|
+
/** Closed padlock — secured or restricted */
|
|
292
|
+
lock: {
|
|
293
|
+
svg: `<path d="M24,14H22V8A6,6,0,0,0,10,8v6H8a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H24a2,2,0,0,0,2-2V16A2,2,0,0,0,24,14ZM12,8a4,4,0,0,1,8,0v6H12ZM24,28H8V16H24Z"/>`,
|
|
294
|
+
viewBox: '0 0 32 32',
|
|
295
|
+
},
|
|
296
|
+
/** Open padlock — unlocked or public */
|
|
297
|
+
unlock: {
|
|
298
|
+
svg: `<path d="M24,14H12V8a4,4,0,0,1,8,0h2A6,6,0,0,0,10,8v6H8a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H24a2,2,0,0,0,2-2V16A2,2,0,0,0,24,14Zm0,14H8V16H24Z"/>`,
|
|
299
|
+
viewBox: '0 0 32 32',
|
|
300
|
+
},
|
|
301
|
+
/** Arrow out of square — opens in new tab */
|
|
302
|
+
launch: {
|
|
303
|
+
svg: `<path d="M26,28H6a2.0027,2.0027,0,0,1-2-2V6A2.0027,2.0027,0,0,1,6,4H16V6H6V26H26V16h2V26A2.0027,2.0027,0,0,1,26,28Z"/><path d="M20 2 20 4 26.586 4 18 12.586 19.414 14 28 5.414 28 12 30 12 30 2 20 2z"/>`,
|
|
304
|
+
viewBox: '0 0 32 32',
|
|
305
|
+
},
|
|
306
|
+
/** Sun — light theme */
|
|
307
|
+
light: {
|
|
308
|
+
svg: `<path d="M15 2H17V7H15z"/><path d="M21.668 6.854H26.625999999999998V8.854H21.668z" transform="rotate(-45 24.147 7.853)"/><path d="M25 15H30V17H25z"/><path d="M23.147 21.668H25.147V26.625999999999998H23.147z" transform="rotate(-45 24.147 24.146)"/><path d="M15 25H17V30H15z"/><path d="M5.375 23.147H10.333V25.147H5.375z" transform="rotate(-45 7.853 24.146)"/><path d="M2 15H7V17H2z"/><path d="M6.854 5.375H8.854V10.333H6.854z" transform="rotate(-45 7.854 7.853)"/><path d="M16,12a4,4,0,1,1-4,4,4.0045,4.0045,0,0,1,4-4m0-2a6,6,0,1,0,6,6,6,6,0,0,0-6-6Z"/>`,
|
|
309
|
+
viewBox: '0 0 32 32',
|
|
310
|
+
},
|
|
311
|
+
/** Moon — dark theme */
|
|
312
|
+
dark: {
|
|
313
|
+
svg: `<path d="M13.5025,5.4136A15.0755,15.0755,0,0,0,25.096,23.6082a11.1134,11.1134,0,0,1-7.9749,3.3893c-.1385,0-.2782.0051-.4178,0A11.0944,11.0944,0,0,1,13.5025,5.4136M14.98,3a1.0024,1.0024,0,0,0-.1746.0156A13.0959,13.0959,0,0,0,16.63,28.9973c.1641.006.3282,0,.4909,0a13.0724,13.0724,0,0,0,10.702-5.5556,1.0094,1.0094,0,0,0-.7833-1.5644A13.08,13.08,0,0,1,15.8892,4.38,1.0149,1.0149,0,0,0,14.98,3Z"/>`,
|
|
314
|
+
viewBox: '0 0 32 32',
|
|
315
|
+
},
|
|
316
|
+
/** Envelope — email / messages */
|
|
317
|
+
email: {
|
|
318
|
+
svg: `<path d="M28,6H4A2,2,0,0,0,2,8V24a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V8A2,2,0,0,0,28,6ZM25.8,8,16,14.78,6.2,8ZM4,24V8.91l11.43,7.91a1,1,0,0,0,1.14,0L28,8.91V24Z"/>`,
|
|
319
|
+
viewBox: '0 0 32 32',
|
|
320
|
+
},
|
|
321
|
+
/** Tag — labels and categories */
|
|
322
|
+
tag: {
|
|
323
|
+
svg: `<path d="M10,14a4,4,0,1,1,4-4A4.0045,4.0045,0,0,1,10,14Zm0-6a2,2,0,1,0,1.998,2.0044A2.002,2.002,0,0,0,10,8Z"/><path d="M16.6436,29.4145,2.5858,15.3555A2,2,0,0,1,2,13.9414V4A2,2,0,0,1,4,2h9.9413a2,2,0,0,1,1.4142.5858L29.4144,16.6436a2.0005,2.0005,0,0,1,0,2.8285l-9.9424,9.9425a2.0008,2.0008,0,0,1-2.8285,0ZM4,4v9.9417L18.0578,28,28,18.0579,13.9416,4Z"/>`,
|
|
324
|
+
viewBox: '0 0 32 32',
|
|
325
|
+
},
|
|
326
|
+
/** Cloud — cloud resources and hosting */
|
|
327
|
+
cloud: {
|
|
328
|
+
svg: `<path d="M16,7h0a7.66,7.66,0,0,1,1.51.15,8,8,0,0,1,6.35,6.34l.26,1.35,1.35.24a5.5,5.5,0,0,1-1,10.92H7.5a5.5,5.5,0,0,1-1-10.92l1.34-.24.26-1.35A8,8,0,0,1,16,7m0-2a10,10,0,0,0-9.83,8.12A7.5,7.5,0,0,0,7.49,28h17a7.5,7.5,0,0,0,1.32-14.88,10,10,0,0,0-7.94-7.94A10.27,10.27,0,0,0,16,5Z"/>`,
|
|
329
|
+
viewBox: '0 0 32 32',
|
|
330
|
+
},
|
|
331
|
+
/** Server rack — servers and compute */
|
|
332
|
+
server: {
|
|
333
|
+
svg: `<circle cx="9" cy="6" r="1"/><path d="M26,10H6A2.0021,2.0021,0,0,1,4,8V4A2.0021,2.0021,0,0,1,6,2H26a2.0021,2.0021,0,0,1,2,2V8A2.0021,2.0021,0,0,1,26,10ZM6,4V8H26V4Z"/><circle cx="9" cy="16" r="1"/><path d="M26,20H6a2.0021,2.0021,0,0,1-2-2V14a2.0021,2.0021,0,0,1,2-2H26a2.0021,2.0021,0,0,1,2,2v4A2.0021,2.0021,0,0,1,26,20ZM6,14v4H26V14Z"/><circle cx="9" cy="26" r="1"/><path d="M26,30H6a2.0021,2.0021,0,0,1-2-2V24a2.0021,2.0021,0,0,1,2-2H26a2.0021,2.0021,0,0,1,2,2v4A2.0021,2.0021,0,0,1,26,30ZM6,24v4H26V24Z"/>`,
|
|
334
|
+
viewBox: '0 0 32 32',
|
|
335
|
+
},
|
|
196
336
|
};
|
|
197
337
|
|
|
198
338
|
class NgccIcon {
|
|
@@ -3366,6 +3506,8 @@ class NgccTab {
|
|
|
3366
3506
|
cacheActive = signal(false, ...(ngDevMode ? [{ debugName: "cacheActive" }] : []));
|
|
3367
3507
|
tabContent = input(null, ...(ngDevMode ? [{ debugName: "tabContent" }] : []));
|
|
3368
3508
|
templateContext = input(null, ...(ngDevMode ? [{ debugName: "templateContext" }] : []));
|
|
3509
|
+
queryParamKey = input(null, ...(ngDevMode ? [{ debugName: "queryParamKey" }] : []));
|
|
3510
|
+
queryParamValue = input(null, ...(ngDevMode ? [{ debugName: "queryParamValue" }] : []));
|
|
3369
3511
|
active = signal(false, ...(ngDevMode ? [{ debugName: "active" }] : []));
|
|
3370
3512
|
// add:
|
|
3371
3513
|
setActive(value) {
|
|
@@ -3392,7 +3534,7 @@ class NgccTab {
|
|
|
3392
3534
|
return value instanceof TemplateRef;
|
|
3393
3535
|
}
|
|
3394
3536
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccTab, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3395
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: NgccTab, isStandalone: true, selector: "ngcc-tab", inputs: { heading: { classPropertyName: "heading", publicName: "heading", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, tabContent: { classPropertyName: "tabContent", publicName: "tabContent", isSignal: true, isRequired: false, transformFunction: null }, templateContext: { classPropertyName: "templateContext", publicName: "templateContext", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selected" }, host: { attributes: { "role": "presentation" }, classAttribute: "cds--tab" }, ngImport: i0, template: "@if (shouldRender()) {\n <div\n class=\"cds--tab-content\"\n role=\"tabpanel\"\n [id]=\"id()\"\n [attr.tabindex]=\"tabIndex()\"\n [attr.aria-labelledby]=\"id() + '-header'\"\n aria-live=\"polite\"\n [style.display]=\"active() ? null : 'none'\"\n >\n @if (isTemplate(tabContent())) {\n <ng-template\n [ngTemplateOutlet]=\"tabContent()\"\n [ngTemplateOutletContext]=\"{ $implicit: templateContext() }\"\n />\n }\n\n <ng-content />\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3537
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: NgccTab, isStandalone: true, selector: "ngcc-tab", inputs: { heading: { classPropertyName: "heading", publicName: "heading", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, tabContent: { classPropertyName: "tabContent", publicName: "tabContent", isSignal: true, isRequired: false, transformFunction: null }, templateContext: { classPropertyName: "templateContext", publicName: "templateContext", isSignal: true, isRequired: false, transformFunction: null }, queryParamKey: { classPropertyName: "queryParamKey", publicName: "queryParamKey", isSignal: true, isRequired: false, transformFunction: null }, queryParamValue: { classPropertyName: "queryParamValue", publicName: "queryParamValue", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selected" }, host: { attributes: { "role": "presentation" }, classAttribute: "cds--tab" }, ngImport: i0, template: "@if (shouldRender()) {\n <div\n class=\"cds--tab-content\"\n role=\"tabpanel\"\n [id]=\"id()\"\n [attr.tabindex]=\"tabIndex()\"\n [attr.aria-labelledby]=\"id() + '-header'\"\n aria-live=\"polite\"\n [style.display]=\"active() ? null : 'none'\"\n >\n @if (isTemplate(tabContent())) {\n <ng-template\n [ngTemplateOutlet]=\"tabContent()\"\n [ngTemplateOutletContext]=\"{ $implicit: templateContext() }\"\n />\n }\n\n <ng-content />\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3396
3538
|
}
|
|
3397
3539
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccTab, decorators: [{
|
|
3398
3540
|
type: Component,
|
|
@@ -3400,7 +3542,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
3400
3542
|
class: 'cds--tab',
|
|
3401
3543
|
role: 'presentation',
|
|
3402
3544
|
}, template: "@if (shouldRender()) {\n <div\n class=\"cds--tab-content\"\n role=\"tabpanel\"\n [id]=\"id()\"\n [attr.tabindex]=\"tabIndex()\"\n [attr.aria-labelledby]=\"id() + '-header'\"\n aria-live=\"polite\"\n [style.display]=\"active() ? null : 'none'\"\n >\n @if (isTemplate(tabContent())) {\n <ng-template\n [ngTemplateOutlet]=\"tabContent()\"\n [ngTemplateOutletContext]=\"{ $implicit: templateContext() }\"\n />\n }\n\n <ng-content />\n </div>\n}\n" }]
|
|
3403
|
-
}], propDecorators: { heading: [{ type: i0.Input, args: [{ isSignal: true, alias: "heading", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], tabContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabContent", required: false }] }], templateContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "templateContext", required: false }] }], selected: [{ type: i0.Output, args: ["selected"] }] } });
|
|
3545
|
+
}], propDecorators: { heading: [{ type: i0.Input, args: [{ isSignal: true, alias: "heading", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], tabContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabContent", required: false }] }], templateContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "templateContext", required: false }] }], queryParamKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "queryParamKey", required: false }] }], queryParamValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "queryParamValue", required: false }] }], selected: [{ type: i0.Output, args: ["selected"] }] } });
|
|
3404
3546
|
|
|
3405
3547
|
class NgccBaseTabHeader {
|
|
3406
3548
|
// =============================
|
|
@@ -3543,6 +3685,8 @@ class NgccTabHeaders extends NgccBaseTabHeader {
|
|
|
3543
3685
|
injector = inject(Injector);
|
|
3544
3686
|
// store cleanup handle for the effect
|
|
3545
3687
|
destroyEffect;
|
|
3688
|
+
// Inject ActivatedRoute optionally, in case routerIntegration is used without Angular Router
|
|
3689
|
+
activatedRoute = inject(ActivatedRoute, { optional: true });
|
|
3546
3690
|
constructor() {
|
|
3547
3691
|
super();
|
|
3548
3692
|
// effect returns a cleanup function; store it for ngOnDestroy
|
|
@@ -3605,24 +3749,28 @@ class NgccTabHeaders extends NgccBaseTabHeader {
|
|
|
3605
3749
|
return;
|
|
3606
3750
|
const headers = this.allTabHeaders.toArray();
|
|
3607
3751
|
const tabs = this.tabsArray;
|
|
3608
|
-
|
|
3609
|
-
const
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
if (href &&
|
|
3614
|
-
this.router.isActive(href, {
|
|
3752
|
+
const activeTab = tabs.find((tab, index) => {
|
|
3753
|
+
const routeLink = headers[index]?.nativeElement.querySelector('a[routerLink]');
|
|
3754
|
+
const href = routeLink instanceof HTMLAnchorElement ? routeLink.getAttribute('href') : null;
|
|
3755
|
+
if (href) {
|
|
3756
|
+
return this.router.isActive(href, {
|
|
3615
3757
|
paths: 'exact',
|
|
3616
3758
|
queryParams: 'ignored',
|
|
3617
3759
|
fragment: 'ignored',
|
|
3618
3760
|
matrixParams: 'ignored',
|
|
3619
|
-
})
|
|
3620
|
-
// Found active route - select this tab
|
|
3621
|
-
if (tabs[i] && !tabs[i].disabled()) {
|
|
3622
|
-
this.selectTab(tabs[i], i);
|
|
3623
|
-
}
|
|
3761
|
+
});
|
|
3624
3762
|
}
|
|
3763
|
+
const queryParamKey = tab.queryParamKey?.() ?? null;
|
|
3764
|
+
const queryParamValue = tab.queryParamValue?.() ?? null;
|
|
3765
|
+
if (!queryParamKey || !this.activatedRoute)
|
|
3766
|
+
return false;
|
|
3767
|
+
const paramValue = this.activatedRoute.snapshot.queryParamMap.get(queryParamKey);
|
|
3768
|
+
return paramValue !== null && queryParamValue !== null && paramValue === queryParamValue;
|
|
3625
3769
|
});
|
|
3770
|
+
const targetIndex = activeTab ? tabs.indexOf(activeTab) : -1;
|
|
3771
|
+
if (targetIndex >= 0 && !tabs[targetIndex].disabled()) {
|
|
3772
|
+
this.selectTab(tabs[targetIndex], targetIndex);
|
|
3773
|
+
}
|
|
3626
3774
|
}
|
|
3627
3775
|
setFirstTab() {
|
|
3628
3776
|
const tabs = this.tabsArray;
|
|
@@ -7404,6 +7552,8 @@ class NgccHeaderItem {
|
|
|
7404
7552
|
ngOnChanges(changes) {
|
|
7405
7553
|
if (changes['href'])
|
|
7406
7554
|
this._href.set(changes['href'].currentValue ?? '/');
|
|
7555
|
+
if (changes['routerLink'])
|
|
7556
|
+
this._routerLink.set(changes['routerLink'].currentValue ?? null);
|
|
7407
7557
|
if (changes['isCurrentPage'])
|
|
7408
7558
|
this._isCurrentPage.set(changes['isCurrentPage'].currentValue ?? false);
|
|
7409
7559
|
if (changes['tabIndex'])
|
|
@@ -7412,6 +7562,9 @@ class NgccHeaderItem {
|
|
|
7412
7562
|
/** Navigation URL */
|
|
7413
7563
|
href = '/';
|
|
7414
7564
|
_href = signal('/', ...(ngDevMode ? [{ debugName: "_href" }] : []));
|
|
7565
|
+
/** Angular Router route target. When provided, it takes precedence over href. */
|
|
7566
|
+
routerLink = null;
|
|
7567
|
+
_routerLink = signal(null, ...(ngDevMode ? [{ debugName: "_routerLink" }] : []));
|
|
7415
7568
|
/** Marks this link as the active / current page */
|
|
7416
7569
|
isCurrentPage = false;
|
|
7417
7570
|
_isCurrentPage = signal(false, ...(ngDevMode ? [{ debugName: "_isCurrentPage" }] : []));
|
|
@@ -7422,6 +7575,11 @@ class NgccHeaderItem {
|
|
|
7422
7575
|
linkClasses = computed(() => ['cds--header__menu-item', this._isCurrentPage() ? 'cds--header__menu-item--current' : '']
|
|
7423
7576
|
.filter(Boolean)
|
|
7424
7577
|
.join(' '), ...(ngDevMode ? [{ debugName: "linkClasses" }] : []));
|
|
7578
|
+
resolvedHref = computed(() => {
|
|
7579
|
+
if (this._routerLink())
|
|
7580
|
+
return this._routerLink();
|
|
7581
|
+
return this._href();
|
|
7582
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedHref" }] : []));
|
|
7425
7583
|
onClick(event) {
|
|
7426
7584
|
this.itemClick.emit(event);
|
|
7427
7585
|
}
|
|
@@ -7432,13 +7590,15 @@ class NgccHeaderItem {
|
|
|
7432
7590
|
}
|
|
7433
7591
|
}
|
|
7434
7592
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccHeaderItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7435
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
7593
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: NgccHeaderItem, isStandalone: true, selector: "ngcc-header-item", inputs: { href: "href", routerLink: "routerLink", isCurrentPage: "isCurrentPage", tabIndex: "tabIndex" }, outputs: { itemClick: "itemClick" }, host: { attributes: { "role": "none" } }, usesOnChanges: true, ngImport: i0, template: "<li role=\"none\">\n @if (routerLink) {\n <a\n [class]=\"linkClasses()\"\n role=\"menuitem\"\n [routerLink]=\"resolvedHref()\"\n [attr.tabindex]=\"tabIndex\"\n [attr.aria-current]=\"isCurrentPage ? 'page' : null\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeydown($event)\"\n >\n <ng-content />\n </a>\n } @else {\n <a\n [class]=\"linkClasses()\"\n role=\"menuitem\"\n [href]=\"resolvedHref()\"\n [attr.tabindex]=\"tabIndex\"\n [attr.aria-current]=\"isCurrentPage ? 'page' : null\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeydown($event)\"\n >\n <ng-content />\n </a>\n }\n</li>\n", styles: [":host{display:contents}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7436
7594
|
}
|
|
7437
7595
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccHeaderItem, decorators: [{
|
|
7438
7596
|
type: Component,
|
|
7439
|
-
args: [{ selector: 'ngcc-header-item', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, host: { role: 'none' }, template: "<li role=\"none\">\n <a\n
|
|
7597
|
+
args: [{ selector: 'ngcc-header-item', standalone: true, imports: [RouterLink], changeDetection: ChangeDetectionStrategy.OnPush, host: { role: 'none' }, template: "<li role=\"none\">\n @if (routerLink) {\n <a\n [class]=\"linkClasses()\"\n role=\"menuitem\"\n [routerLink]=\"resolvedHref()\"\n [attr.tabindex]=\"tabIndex\"\n [attr.aria-current]=\"isCurrentPage ? 'page' : null\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeydown($event)\"\n >\n <ng-content />\n </a>\n } @else {\n <a\n [class]=\"linkClasses()\"\n role=\"menuitem\"\n [href]=\"resolvedHref()\"\n [attr.tabindex]=\"tabIndex\"\n [attr.aria-current]=\"isCurrentPage ? 'page' : null\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeydown($event)\"\n >\n <ng-content />\n </a>\n }\n</li>\n", styles: [":host{display:contents}\n"] }]
|
|
7440
7598
|
}], propDecorators: { href: [{
|
|
7441
7599
|
type: Input
|
|
7600
|
+
}], routerLink: [{
|
|
7601
|
+
type: Input
|
|
7442
7602
|
}], isCurrentPage: [{
|
|
7443
7603
|
type: Input
|
|
7444
7604
|
}], tabIndex: [{
|
|
@@ -7652,6 +7812,8 @@ class NgccHeaderMenuItem {
|
|
|
7652
7812
|
ngOnChanges(changes) {
|
|
7653
7813
|
if (changes['href'])
|
|
7654
7814
|
this._href.set(changes['href'].currentValue ?? '/');
|
|
7815
|
+
if (changes['routerLink'])
|
|
7816
|
+
this._routerLink.set(changes['routerLink'].currentValue ?? null);
|
|
7655
7817
|
if (changes['isCurrentPage'])
|
|
7656
7818
|
this._isCurrentPage.set(changes['isCurrentPage'].currentValue ?? false);
|
|
7657
7819
|
if (changes['disabled'])
|
|
@@ -7659,6 +7821,8 @@ class NgccHeaderMenuItem {
|
|
|
7659
7821
|
}
|
|
7660
7822
|
href = '/';
|
|
7661
7823
|
_href = signal('/', ...(ngDevMode ? [{ debugName: "_href" }] : []));
|
|
7824
|
+
routerLink = null;
|
|
7825
|
+
_routerLink = signal(null, ...(ngDevMode ? [{ debugName: "_routerLink" }] : []));
|
|
7662
7826
|
isCurrentPage = false;
|
|
7663
7827
|
_isCurrentPage = signal(false, ...(ngDevMode ? [{ debugName: "_isCurrentPage" }] : []));
|
|
7664
7828
|
disabled = false;
|
|
@@ -7667,6 +7831,11 @@ class NgccHeaderMenuItem {
|
|
|
7667
7831
|
linkClasses = computed(() => ['cds--header__menu-item', this._isCurrentPage() ? 'cds--header__menu-item--current' : '']
|
|
7668
7832
|
.filter(Boolean)
|
|
7669
7833
|
.join(' '), ...(ngDevMode ? [{ debugName: "linkClasses" }] : []));
|
|
7834
|
+
resolvedHref = computed(() => {
|
|
7835
|
+
if (this._routerLink())
|
|
7836
|
+
return this._routerLink();
|
|
7837
|
+
return this._href();
|
|
7838
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedHref" }] : []));
|
|
7670
7839
|
onClick(event) {
|
|
7671
7840
|
if (this._disabled()) {
|
|
7672
7841
|
event.preventDefault();
|
|
@@ -7683,13 +7852,15 @@ class NgccHeaderMenuItem {
|
|
|
7683
7852
|
}
|
|
7684
7853
|
}
|
|
7685
7854
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccHeaderMenuItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7686
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
7855
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: NgccHeaderMenuItem, isStandalone: true, selector: "ngcc-header-menu-item", inputs: { href: "href", routerLink: "routerLink", isCurrentPage: "isCurrentPage", disabled: "disabled" }, outputs: { itemClick: "itemClick" }, host: { attributes: { "role": "none" } }, usesOnChanges: true, ngImport: i0, template: "<li role=\"none\">\n @if (routerLink) {\n <a\n [class]=\"linkClasses()\"\n role=\"menuitem\"\n [attr.href]=\"disabled ? null : null\"\n [routerLink]=\"disabled ? null : resolvedHref()\"\n [attr.aria-disabled]=\"disabled ? true : null\"\n [attr.aria-current]=\"isCurrentPage ? 'page' : null\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeydown($event)\"\n >\n <ng-content />\n </a>\n } @else {\n <a\n [class]=\"linkClasses()\"\n role=\"menuitem\"\n [attr.href]=\"disabled ? null : resolvedHref()\"\n [attr.aria-disabled]=\"disabled ? true : null\"\n [attr.aria-current]=\"isCurrentPage ? 'page' : null\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeydown($event)\"\n >\n <ng-content />\n </a>\n }\n</li>\n", styles: [":host{display:contents}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7687
7856
|
}
|
|
7688
7857
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccHeaderMenuItem, decorators: [{
|
|
7689
7858
|
type: Component,
|
|
7690
|
-
args: [{ selector: 'ngcc-header-menu-item', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, host: { role: 'none' }, template: "<li role=\"none\">\n <a\n
|
|
7859
|
+
args: [{ selector: 'ngcc-header-menu-item', standalone: true, imports: [RouterLink], changeDetection: ChangeDetectionStrategy.OnPush, host: { role: 'none' }, template: "<li role=\"none\">\n @if (routerLink) {\n <a\n [class]=\"linkClasses()\"\n role=\"menuitem\"\n [attr.href]=\"disabled ? null : null\"\n [routerLink]=\"disabled ? null : resolvedHref()\"\n [attr.aria-disabled]=\"disabled ? true : null\"\n [attr.aria-current]=\"isCurrentPage ? 'page' : null\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeydown($event)\"\n >\n <ng-content />\n </a>\n } @else {\n <a\n [class]=\"linkClasses()\"\n role=\"menuitem\"\n [attr.href]=\"disabled ? null : resolvedHref()\"\n [attr.aria-disabled]=\"disabled ? true : null\"\n [attr.aria-current]=\"isCurrentPage ? 'page' : null\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeydown($event)\"\n >\n <ng-content />\n </a>\n }\n</li>\n", styles: [":host{display:contents}\n"] }]
|
|
7691
7860
|
}], propDecorators: { href: [{
|
|
7692
7861
|
type: Input
|
|
7862
|
+
}], routerLink: [{
|
|
7863
|
+
type: Input
|
|
7693
7864
|
}], isCurrentPage: [{
|
|
7694
7865
|
type: Input
|
|
7695
7866
|
}], disabled: [{
|
|
@@ -7734,6 +7905,9 @@ class NgccHeaderAction {
|
|
|
7734
7905
|
if (changes['active']) {
|
|
7735
7906
|
this._active.set(changes['active'].currentValue ?? false);
|
|
7736
7907
|
}
|
|
7908
|
+
if (changes['href']) {
|
|
7909
|
+
this._href.set(changes['href'].currentValue ?? undefined);
|
|
7910
|
+
}
|
|
7737
7911
|
}
|
|
7738
7912
|
elementRef = inject(ElementRef);
|
|
7739
7913
|
/** Accessible label for the button */
|
|
@@ -7743,6 +7917,9 @@ class NgccHeaderAction {
|
|
|
7743
7917
|
active = false;
|
|
7744
7918
|
activeChange = new EventEmitter();
|
|
7745
7919
|
_active = signal(false, ...(ngDevMode ? [{ debugName: "_active" }] : []));
|
|
7920
|
+
/** Optional link target for actions that behave like anchors, e.g. “Switch to Legacy”. */
|
|
7921
|
+
href = null;
|
|
7922
|
+
_href = signal(null, ...(ngDevMode ? [{ debugName: "_href" }] : []));
|
|
7746
7923
|
/** Icon to display — any key from the NgccIcon registry */
|
|
7747
7924
|
iconName = undefined;
|
|
7748
7925
|
_iconName = signal(undefined, ...(ngDevMode ? [{ debugName: "_iconName" }] : []));
|
|
@@ -7750,7 +7927,12 @@ class NgccHeaderAction {
|
|
|
7750
7927
|
toggleable = true;
|
|
7751
7928
|
_toggleable = signal(true, ...(ngDevMode ? [{ debugName: "_toggleable" }] : []));
|
|
7752
7929
|
actionClick = new EventEmitter();
|
|
7930
|
+
linkClick = new EventEmitter();
|
|
7753
7931
|
onClick(event) {
|
|
7932
|
+
if (this._href()) {
|
|
7933
|
+
this.linkClick.emit(event);
|
|
7934
|
+
return;
|
|
7935
|
+
}
|
|
7754
7936
|
this.actionClick.emit(event);
|
|
7755
7937
|
if (this._toggleable()) {
|
|
7756
7938
|
this._active.update((v) => !v);
|
|
@@ -7779,23 +7961,27 @@ class NgccHeaderAction {
|
|
|
7779
7961
|
}
|
|
7780
7962
|
}
|
|
7781
7963
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccHeaderAction, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7782
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: NgccHeaderAction, isStandalone: true, selector: "ngcc-header-action", inputs: { ariaLabel: "ariaLabel", active: "active", iconName: "iconName", toggleable: "toggleable" }, outputs: { activeChange: "activeChange", actionClick: "actionClick" }, host: { attributes: { "role": "none" }, listeners: { "document:click": "onDocumentClick($event)", "document:keydown.escape": "onEscape()" } }, usesOnChanges: true, ngImport: i0, template: "<ngcc-button\n
|
|
7964
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: NgccHeaderAction, isStandalone: true, selector: "ngcc-header-action", inputs: { ariaLabel: "ariaLabel", active: "active", href: "href", iconName: "iconName", toggleable: "toggleable" }, outputs: { activeChange: "activeChange", actionClick: "actionClick", linkClick: "linkClick" }, host: { attributes: { "role": "none" }, listeners: { "document:click": "onDocumentClick($event)", "document:keydown.escape": "onEscape()" } }, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"href; else buttonTemplate\">\n <a\n class=\"cds--header__action\"\n [href]=\"href\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-expanded]=\"active ? 'true' : 'false'\"\n (click)=\"onClick($event)\"\n >\n <ngcc-icon [name]=\"iconName ?? 'add'\" [decorative]=\"true\" />\n </a>\n</ng-container>\n<ng-template #buttonTemplate>\n <ngcc-button\n variant=\"ghost\"\n [iconOnly]=\"true\"\n [iconName]=\"iconName\"\n [ariaLabel]=\"ariaLabel\"\n [ariaExpanded]=\"active\"\n [className]=\"'cds--header__action' + (active ? ' cds--header__action--active' : '')\"\n (click)=\"onClick($event)\"\n />\n</ng-template>\n", styles: [":host{display:contents}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: NgccButton, selector: "ngcc-button", inputs: ["label", "variant", "size", "disabled", "expressive", "className", "skeleton", "type", "ariaLabel", "ariaExpanded", "iconName", "iconOnly"] }, { kind: "component", type: NgccIcon, selector: "ngcc-icon", inputs: ["name", "size", "color", "ariaLabel", "decorative", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7783
7965
|
}
|
|
7784
7966
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccHeaderAction, decorators: [{
|
|
7785
7967
|
type: Component,
|
|
7786
|
-
args: [{ selector: 'ngcc-header-action', standalone: true, imports: [NgccButton], changeDetection: ChangeDetectionStrategy.OnPush, host: { role: 'none' }, template: "<ngcc-button\n
|
|
7968
|
+
args: [{ selector: 'ngcc-header-action', standalone: true, imports: [CommonModule, NgccButton, NgccIcon], changeDetection: ChangeDetectionStrategy.OnPush, host: { role: 'none' }, template: "<ng-container *ngIf=\"href; else buttonTemplate\">\n <a\n class=\"cds--header__action\"\n [href]=\"href\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-expanded]=\"active ? 'true' : 'false'\"\n (click)=\"onClick($event)\"\n >\n <ngcc-icon [name]=\"iconName ?? 'add'\" [decorative]=\"true\" />\n </a>\n</ng-container>\n<ng-template #buttonTemplate>\n <ngcc-button\n variant=\"ghost\"\n [iconOnly]=\"true\"\n [iconName]=\"iconName\"\n [ariaLabel]=\"ariaLabel\"\n [ariaExpanded]=\"active\"\n [className]=\"'cds--header__action' + (active ? ' cds--header__action--active' : '')\"\n (click)=\"onClick($event)\"\n />\n</ng-template>\n", styles: [":host{display:contents}\n"] }]
|
|
7787
7969
|
}], propDecorators: { ariaLabel: [{
|
|
7788
7970
|
type: Input
|
|
7789
7971
|
}], active: [{
|
|
7790
7972
|
type: Input
|
|
7791
7973
|
}], activeChange: [{
|
|
7792
7974
|
type: Output
|
|
7975
|
+
}], href: [{
|
|
7976
|
+
type: Input
|
|
7793
7977
|
}], iconName: [{
|
|
7794
7978
|
type: Input
|
|
7795
7979
|
}], toggleable: [{
|
|
7796
7980
|
type: Input
|
|
7797
7981
|
}], actionClick: [{
|
|
7798
7982
|
type: Output
|
|
7983
|
+
}], linkClick: [{
|
|
7984
|
+
type: Output
|
|
7799
7985
|
}], onDocumentClick: [{
|
|
7800
7986
|
type: HostListener,
|
|
7801
7987
|
args: ['document:click', ['$event']]
|
|
@@ -7981,22 +8167,32 @@ const NGCC_SIDE_NAV_CONTEXT = new InjectionToken('NgccSideNavContext');
|
|
|
7981
8167
|
class NgccSideNavMenuItem {
|
|
7982
8168
|
/** Navigation URL */
|
|
7983
8169
|
href = '#';
|
|
8170
|
+
/** Angular Router route target. When provided, it takes precedence over href. */
|
|
8171
|
+
routerLink = null;
|
|
7984
8172
|
/** Marks this link as the active / current page */
|
|
7985
8173
|
active = false;
|
|
7986
8174
|
/** Optional title attribute for the anchor */
|
|
7987
8175
|
title = '';
|
|
7988
8176
|
itemClick = new EventEmitter();
|
|
8177
|
+
linkHref = () => {
|
|
8178
|
+
if (this.routerLink) {
|
|
8179
|
+
return Array.isArray(this.routerLink) ? this.routerLink.join('/') : this.routerLink;
|
|
8180
|
+
}
|
|
8181
|
+
return this.href ?? '#';
|
|
8182
|
+
};
|
|
7989
8183
|
onClick(event) {
|
|
7990
8184
|
this.itemClick.emit(event);
|
|
7991
8185
|
}
|
|
7992
8186
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccSideNavMenuItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7993
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: NgccSideNavMenuItem, isStandalone: true, selector: "ngcc-side-nav-menu-item", inputs: { href: "href", active: "active", title: "title" }, outputs: { itemClick: "itemClick" }, host: { attributes: { "role": "none" } }, ngImport: i0, template: "<li class=\"cds--side-nav__menu-item\">\n <a\n [class]=\"active ? 'cds--side-nav__link cds--side-nav__link--current' : 'cds--side-nav__link'\"\n [href]=\"href\"\n [attr.aria-current]=\"active ? 'page' : null\"\n [attr.title]=\"title || null\"\n (click)=\"onClick($event)\"\n >\n <span class=\"cds--side-nav__link-text\">\n <ng-content />\n </span>\n </a>\n</li>\n", styles: [":host{display:contents}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8187
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: NgccSideNavMenuItem, isStandalone: true, selector: "ngcc-side-nav-menu-item", inputs: { href: "href", routerLink: "routerLink", active: "active", title: "title" }, outputs: { itemClick: "itemClick" }, host: { attributes: { "role": "none" } }, ngImport: i0, template: "<li class=\"cds--side-nav__menu-item\">\n <a\n [class]=\"active ? 'cds--side-nav__link cds--side-nav__link--current' : 'cds--side-nav__link'\"\n [href]=\"routerLink ? null : href\"\n [routerLink]=\"routerLink ? linkHref() : null\"\n [attr.aria-current]=\"active ? 'page' : null\"\n [attr.title]=\"title || null\"\n (click)=\"onClick($event)\"\n >\n <span class=\"cds--side-nav__link-text\">\n <ng-content />\n </span>\n </a>\n</li>\n", styles: [":host{display:contents}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7994
8188
|
}
|
|
7995
8189
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccSideNavMenuItem, decorators: [{
|
|
7996
8190
|
type: Component,
|
|
7997
|
-
args: [{ selector: 'ngcc-side-nav-menu-item', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, host: { role: 'none' }, template: "<li class=\"cds--side-nav__menu-item\">\n <a\n [class]=\"active ? 'cds--side-nav__link cds--side-nav__link--current' : 'cds--side-nav__link'\"\n [href]=\"href\"\n [attr.aria-current]=\"active ? 'page' : null\"\n [attr.title]=\"title || null\"\n (click)=\"onClick($event)\"\n >\n <span class=\"cds--side-nav__link-text\">\n <ng-content />\n </span>\n </a>\n</li>\n", styles: [":host{display:contents}\n"] }]
|
|
8191
|
+
args: [{ selector: 'ngcc-side-nav-menu-item', standalone: true, imports: [RouterLink], changeDetection: ChangeDetectionStrategy.OnPush, host: { role: 'none' }, template: "<li class=\"cds--side-nav__menu-item\">\n <a\n [class]=\"active ? 'cds--side-nav__link cds--side-nav__link--current' : 'cds--side-nav__link'\"\n [href]=\"routerLink ? null : href\"\n [routerLink]=\"routerLink ? linkHref() : null\"\n [attr.aria-current]=\"active ? 'page' : null\"\n [attr.title]=\"title || null\"\n (click)=\"onClick($event)\"\n >\n <span class=\"cds--side-nav__link-text\">\n <ng-content />\n </span>\n </a>\n</li>\n", styles: [":host{display:contents}\n"] }]
|
|
7998
8192
|
}], propDecorators: { href: [{
|
|
7999
8193
|
type: Input
|
|
8194
|
+
}], routerLink: [{
|
|
8195
|
+
type: Input
|
|
8000
8196
|
}], active: [{
|
|
8001
8197
|
type: Input
|
|
8002
8198
|
}], title: [{
|
|
@@ -8240,6 +8436,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
8240
8436
|
class NgccSideNavItem {
|
|
8241
8437
|
/** Navigation URL */
|
|
8242
8438
|
href = '#';
|
|
8439
|
+
/** Angular Router route target. When provided, it takes precedence over href. */
|
|
8440
|
+
routerLink = null;
|
|
8243
8441
|
/** Marks this link as the active / current page */
|
|
8244
8442
|
active = false;
|
|
8245
8443
|
/** Optional title attribute for the anchor */
|
|
@@ -8247,25 +8445,32 @@ class NgccSideNavItem {
|
|
|
8247
8445
|
/** Optional icon placed before the link text */
|
|
8248
8446
|
iconName = undefined;
|
|
8249
8447
|
itemClick = new EventEmitter();
|
|
8250
|
-
|
|
8251
|
-
|
|
8252
|
-
|
|
8253
|
-
|
|
8254
|
-
return ['cds--side-nav__link', this.active ? 'cds--side-nav__link--current' : '']
|
|
8448
|
+
itemClasses = computed(() => 'cds--side-nav__item', ...(ngDevMode ? [{ debugName: "itemClasses" }] : []));
|
|
8449
|
+
linkClasses = computed(() => {
|
|
8450
|
+
const isCurrent = this.active || false;
|
|
8451
|
+
return ['cds--side-nav__link', isCurrent ? 'cds--side-nav__link--current' : '']
|
|
8255
8452
|
.filter(Boolean)
|
|
8256
8453
|
.join(' ');
|
|
8257
|
-
}
|
|
8454
|
+
}, ...(ngDevMode ? [{ debugName: "linkClasses" }] : []));
|
|
8455
|
+
linkHref = computed(() => {
|
|
8456
|
+
if (this.routerLink) {
|
|
8457
|
+
return Array.isArray(this.routerLink) ? this.routerLink.join('/') : this.routerLink;
|
|
8458
|
+
}
|
|
8459
|
+
return this.href ?? '#';
|
|
8460
|
+
}, ...(ngDevMode ? [{ debugName: "linkHref" }] : []));
|
|
8258
8461
|
onClick(event) {
|
|
8259
8462
|
this.itemClick.emit(event);
|
|
8260
8463
|
}
|
|
8261
8464
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccSideNavItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8262
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: NgccSideNavItem, isStandalone: true, selector: "ngcc-side-nav-item", inputs: { href: "href", active: "active", title: "title", iconName: "iconName" }, outputs: { itemClick: "itemClick" }, host: { attributes: { "role": "none" } }, ngImport: i0, template: "<li [class]=\"itemClasses\">\n <a\n [class]=\"linkClasses\"\n [href]=\"
|
|
8465
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: NgccSideNavItem, isStandalone: true, selector: "ngcc-side-nav-item", inputs: { href: "href", routerLink: "routerLink", active: "active", title: "title", iconName: "iconName" }, outputs: { itemClick: "itemClick" }, host: { attributes: { "role": "none" } }, ngImport: i0, template: "<li [class]=\"itemClasses()\">\n <a\n [class]=\"linkClasses()\"\n [href]=\"routerLink ? null : linkHref()\"\n [routerLink]=\"routerLink ? linkHref() : null\"\n [routerLinkActive]=\"\n routerLink ? 'cds--side-nav__link--current' : 'cds--side-nav__link--current'\n \"\n [routerLinkActiveOptions]=\"{ exact: false }\"\n [attr.aria-current]=\"active ? 'page' : null\"\n [attr.title]=\"title || null\"\n (click)=\"onClick($event)\"\n >\n @if (iconName) {\n <div class=\"cds--side-nav__icon\">\n <ngcc-icon [name]=\"iconName!\" [decorative]=\"true\" size=\"md\" />\n </div>\n }\n <span class=\"cds--side-nav__link-text\">\n <ng-content />\n </span>\n </a>\n</li>\n", styles: [":host{display:contents}\n"], dependencies: [{ kind: "component", type: NgccIcon, selector: "ngcc-icon", inputs: ["name", "size", "color", "ariaLabel", "decorative", "svgClass"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8263
8466
|
}
|
|
8264
8467
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccSideNavItem, decorators: [{
|
|
8265
8468
|
type: Component,
|
|
8266
|
-
args: [{ selector: 'ngcc-side-nav-item', standalone: true, imports: [NgccIcon], changeDetection: ChangeDetectionStrategy.OnPush, host: { role: 'none' }, template: "<li [class]=\"itemClasses\">\n <a\n [class]=\"linkClasses\"\n [href]=\"
|
|
8469
|
+
args: [{ selector: 'ngcc-side-nav-item', standalone: true, imports: [NgccIcon, RouterLink, RouterLinkActive], changeDetection: ChangeDetectionStrategy.OnPush, host: { role: 'none' }, template: "<li [class]=\"itemClasses()\">\n <a\n [class]=\"linkClasses()\"\n [href]=\"routerLink ? null : linkHref()\"\n [routerLink]=\"routerLink ? linkHref() : null\"\n [routerLinkActive]=\"\n routerLink ? 'cds--side-nav__link--current' : 'cds--side-nav__link--current'\n \"\n [routerLinkActiveOptions]=\"{ exact: false }\"\n [attr.aria-current]=\"active ? 'page' : null\"\n [attr.title]=\"title || null\"\n (click)=\"onClick($event)\"\n >\n @if (iconName) {\n <div class=\"cds--side-nav__icon\">\n <ngcc-icon [name]=\"iconName!\" [decorative]=\"true\" size=\"md\" />\n </div>\n }\n <span class=\"cds--side-nav__link-text\">\n <ng-content />\n </span>\n </a>\n</li>\n", styles: [":host{display:contents}\n"] }]
|
|
8267
8470
|
}], propDecorators: { href: [{
|
|
8268
8471
|
type: Input
|
|
8472
|
+
}], routerLink: [{
|
|
8473
|
+
type: Input
|
|
8269
8474
|
}], active: [{
|
|
8270
8475
|
type: Input
|
|
8271
8476
|
}], title: [{
|
|
@@ -8295,6 +8500,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
8295
8500
|
args: [{ selector: 'ngcc-side-nav-divider', standalone: true, imports: [], template: '<li class="cds--side-nav__divider" role="separator" aria-hidden="true"></li>', changeDetection: ChangeDetectionStrategy.OnPush, host: { role: 'none' }, styles: [":host{display:contents}\n"] }]
|
|
8296
8501
|
}] });
|
|
8297
8502
|
|
|
8503
|
+
/**
|
|
8504
|
+
* A simple labeled section within <ngcc-side-nav>.
|
|
8505
|
+
*
|
|
8506
|
+
* This is used for admin shell groupings like "BSS" / "OSS" where a divider is not enough,
|
|
8507
|
+
* but a labeled heading helps users understand the grouping.
|
|
8508
|
+
*/
|
|
8509
|
+
class NgccSideNavSection {
|
|
8510
|
+
label = '';
|
|
8511
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccSideNavSection, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8512
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: NgccSideNavSection, isStandalone: true, selector: "ngcc-side-nav-section", inputs: { label: "label" }, host: { attributes: { "role": "none" } }, ngImport: i0, template: `
|
|
8513
|
+
<li class="cds--side-nav__section" role="presentation">
|
|
8514
|
+
<span class="cds--side-nav__section-title">{{ label }}</span>
|
|
8515
|
+
</li>
|
|
8516
|
+
`, isInline: true, styles: [":host{display:contents}\n", ".cds--side-nav__section{display:flex;align-items:center;min-height:2rem;padding:.5rem 1rem .25rem}\n", ".cds--side-nav__section-title{color:var(--cds-text-secondary, #525252);font-size:.625rem;font-weight:600;letter-spacing:.08em;line-height:1.25rem;text-transform:uppercase}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8517
|
+
}
|
|
8518
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccSideNavSection, decorators: [{
|
|
8519
|
+
type: Component,
|
|
8520
|
+
args: [{ selector: 'ngcc-side-nav-section', standalone: true, template: `
|
|
8521
|
+
<li class="cds--side-nav__section" role="presentation">
|
|
8522
|
+
<span class="cds--side-nav__section-title">{{ label }}</span>
|
|
8523
|
+
</li>
|
|
8524
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, host: { role: 'none' }, styles: [":host{display:contents}\n", ".cds--side-nav__section{display:flex;align-items:center;min-height:2rem;padding:.5rem 1rem .25rem}\n", ".cds--side-nav__section-title{color:var(--cds-text-secondary, #525252);font-size:.625rem;font-weight:600;letter-spacing:.08em;line-height:1.25rem;text-transform:uppercase}\n"] }]
|
|
8525
|
+
}], propDecorators: { label: [{
|
|
8526
|
+
type: Input
|
|
8527
|
+
}] } });
|
|
8528
|
+
|
|
8298
8529
|
/** Line height for code-01 typography token (1.5rem per row). */
|
|
8299
8530
|
const CODE_LINE_HEIGHT_REM = 1.5;
|
|
8300
8531
|
class NgccCodeSnippetComponent {
|
|
@@ -8414,6 +8645,1725 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
8414
8645
|
type: Input
|
|
8415
8646
|
}] } });
|
|
8416
8647
|
|
|
8648
|
+
const NGCC_CONTENT_SWITCHER = new InjectionToken('NGCC_CONTENT_SWITCHER');
|
|
8649
|
+
|
|
8650
|
+
class NgccContentSwitcherOption {
|
|
8651
|
+
name = input('option', ...(ngDevMode ? [{ debugName: "name" }] : []));
|
|
8652
|
+
active = signal(false, ...(ngDevMode ? [{ debugName: "active" }] : []));
|
|
8653
|
+
selectionMode = signal('automatic', ...(ngDevMode ? [{ debugName: "selectionMode" }] : []));
|
|
8654
|
+
selected = output();
|
|
8655
|
+
clicked = output();
|
|
8656
|
+
focused = output();
|
|
8657
|
+
switcher = inject(NGCC_CONTENT_SWITCHER, { optional: true });
|
|
8658
|
+
handleClick(event) {
|
|
8659
|
+
this.clicked.emit(event);
|
|
8660
|
+
if (this.active())
|
|
8661
|
+
return;
|
|
8662
|
+
if (this.switcher) {
|
|
8663
|
+
this.switcher.selectOption(this);
|
|
8664
|
+
}
|
|
8665
|
+
else {
|
|
8666
|
+
this.active.set(true);
|
|
8667
|
+
}
|
|
8668
|
+
this.selected.emit(true);
|
|
8669
|
+
}
|
|
8670
|
+
handleFocus(event) {
|
|
8671
|
+
this.focused.emit(event);
|
|
8672
|
+
if (this.active())
|
|
8673
|
+
return;
|
|
8674
|
+
if (this.selectionMode() === 'manual')
|
|
8675
|
+
return;
|
|
8676
|
+
if (this.switcher) {
|
|
8677
|
+
this.switcher.selectOption(this);
|
|
8678
|
+
}
|
|
8679
|
+
else {
|
|
8680
|
+
this.active.set(true);
|
|
8681
|
+
}
|
|
8682
|
+
this.selected.emit(true);
|
|
8683
|
+
}
|
|
8684
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccContentSwitcherOption, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8685
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.18", type: NgccContentSwitcherOption, isStandalone: true, selector: "ngcc-content-switcher-option", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selected", clicked: "clicked", focused: "focused" }, ngImport: i0, template: `<button
|
|
8686
|
+
class="cds--content-switcher-btn"
|
|
8687
|
+
[class.cds--content-switcher--selected]="active()"
|
|
8688
|
+
role="tab"
|
|
8689
|
+
[attr.aria-selected]="active()"
|
|
8690
|
+
[attr.tabindex]="active() ? 0 : -1"
|
|
8691
|
+
(click)="handleClick($event)"
|
|
8692
|
+
(focus)="handleFocus($event)"
|
|
8693
|
+
>
|
|
8694
|
+
<span class="cds--content-switcher__label"><ng-content></ng-content></span>
|
|
8695
|
+
</button>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8696
|
+
}
|
|
8697
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccContentSwitcherOption, decorators: [{
|
|
8698
|
+
type: Component,
|
|
8699
|
+
args: [{
|
|
8700
|
+
selector: 'ngcc-content-switcher-option',
|
|
8701
|
+
standalone: true,
|
|
8702
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
8703
|
+
template: `<button
|
|
8704
|
+
class="cds--content-switcher-btn"
|
|
8705
|
+
[class.cds--content-switcher--selected]="active()"
|
|
8706
|
+
role="tab"
|
|
8707
|
+
[attr.aria-selected]="active()"
|
|
8708
|
+
[attr.tabindex]="active() ? 0 : -1"
|
|
8709
|
+
(click)="handleClick($event)"
|
|
8710
|
+
(focus)="handleFocus($event)"
|
|
8711
|
+
>
|
|
8712
|
+
<span class="cds--content-switcher__label"><ng-content></ng-content></span>
|
|
8713
|
+
</button>`,
|
|
8714
|
+
}]
|
|
8715
|
+
}], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], selected: [{ type: i0.Output, args: ["selected"] }], clicked: [{ type: i0.Output, args: ["clicked"] }], focused: [{ type: i0.Output, args: ["focused"] }] } });
|
|
8716
|
+
|
|
8717
|
+
class NgccContentSwitcher {
|
|
8718
|
+
ariaLabel = input('content switcher', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
8719
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
8720
|
+
lowContrast = input(false, ...(ngDevMode ? [{ debugName: "lowContrast" }] : []));
|
|
8721
|
+
selectionMode = input('automatic', ...(ngDevMode ? [{ debugName: "selectionMode" }] : []));
|
|
8722
|
+
selectedIndex = model(undefined, ...(ngDevMode ? [{ debugName: "selectedIndex" }] : []));
|
|
8723
|
+
selected = output();
|
|
8724
|
+
options = contentChildren(NgccContentSwitcherOption, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
8725
|
+
hostRef = inject((ElementRef));
|
|
8726
|
+
switcherClasses = computed(() => {
|
|
8727
|
+
const s = this.size();
|
|
8728
|
+
return [
|
|
8729
|
+
'cds--content-switcher',
|
|
8730
|
+
s === 'sm' ? 'cds--content-switcher--sm' : '',
|
|
8731
|
+
s === 'md' ? 'cds--content-switcher--md' : '',
|
|
8732
|
+
s === 'lg' ? 'cds--content-switcher--lg' : '',
|
|
8733
|
+
this.lowContrast() ? 'cds--content-switcher--low-contrast' : '',
|
|
8734
|
+
]
|
|
8735
|
+
.filter(Boolean)
|
|
8736
|
+
.join(' ');
|
|
8737
|
+
}, ...(ngDevMode ? [{ debugName: "switcherClasses" }] : []));
|
|
8738
|
+
constructor() {
|
|
8739
|
+
// Sync selectionMode to children
|
|
8740
|
+
effect(() => {
|
|
8741
|
+
const mode = this.selectionMode();
|
|
8742
|
+
untracked(() => {
|
|
8743
|
+
this.options().forEach((option) => option.selectionMode.set(mode));
|
|
8744
|
+
});
|
|
8745
|
+
});
|
|
8746
|
+
// Handle selectedIndex or options changes
|
|
8747
|
+
effect(() => {
|
|
8748
|
+
const index = this.selectedIndex();
|
|
8749
|
+
const opts = this.options();
|
|
8750
|
+
if (opts.length === 0)
|
|
8751
|
+
return;
|
|
8752
|
+
untracked(() => {
|
|
8753
|
+
if (index !== undefined && index >= 0 && index < opts.length) {
|
|
8754
|
+
opts.forEach((opt, i) => {
|
|
8755
|
+
opt.active.set(i === index);
|
|
8756
|
+
});
|
|
8757
|
+
}
|
|
8758
|
+
else {
|
|
8759
|
+
const hasActive = opts.some((opt) => opt.active());
|
|
8760
|
+
if (!hasActive) {
|
|
8761
|
+
opts[0].active.set(true);
|
|
8762
|
+
}
|
|
8763
|
+
}
|
|
8764
|
+
});
|
|
8765
|
+
});
|
|
8766
|
+
}
|
|
8767
|
+
selectOption(option) {
|
|
8768
|
+
const opt = option;
|
|
8769
|
+
const opts = this.options();
|
|
8770
|
+
const index = opts.indexOf(opt);
|
|
8771
|
+
opts.forEach((o) => {
|
|
8772
|
+
if (o !== opt)
|
|
8773
|
+
o.active.set(false);
|
|
8774
|
+
});
|
|
8775
|
+
opt.active.set(true);
|
|
8776
|
+
if (index !== -1) {
|
|
8777
|
+
this.selectedIndex.set(index);
|
|
8778
|
+
}
|
|
8779
|
+
this.selected.emit(opt);
|
|
8780
|
+
}
|
|
8781
|
+
onKeydown(event) {
|
|
8782
|
+
const buttonList = Array.from(this.hostRef.nativeElement.querySelectorAll('ngcc-content-switcher-option'));
|
|
8783
|
+
if (!buttonList.length)
|
|
8784
|
+
return;
|
|
8785
|
+
switch (event.key) {
|
|
8786
|
+
case 'ArrowRight': {
|
|
8787
|
+
event.preventDefault();
|
|
8788
|
+
const index = buttonList.findIndex((item) => item === event.target);
|
|
8789
|
+
if (index < buttonList.length - 1) {
|
|
8790
|
+
buttonList[index + 1].focus();
|
|
8791
|
+
}
|
|
8792
|
+
else {
|
|
8793
|
+
buttonList[0].focus();
|
|
8794
|
+
}
|
|
8795
|
+
break;
|
|
8796
|
+
}
|
|
8797
|
+
case 'ArrowLeft': {
|
|
8798
|
+
event.preventDefault();
|
|
8799
|
+
const index = buttonList.findIndex((item) => item === event.target);
|
|
8800
|
+
if (index > 0) {
|
|
8801
|
+
buttonList[index - 1].focus();
|
|
8802
|
+
}
|
|
8803
|
+
else {
|
|
8804
|
+
buttonList[buttonList.length - 1].focus();
|
|
8805
|
+
}
|
|
8806
|
+
break;
|
|
8807
|
+
}
|
|
8808
|
+
case 'Home': {
|
|
8809
|
+
event.preventDefault();
|
|
8810
|
+
buttonList[0].focus();
|
|
8811
|
+
break;
|
|
8812
|
+
}
|
|
8813
|
+
case 'End': {
|
|
8814
|
+
event.preventDefault();
|
|
8815
|
+
buttonList[buttonList.length - 1].focus();
|
|
8816
|
+
break;
|
|
8817
|
+
}
|
|
8818
|
+
}
|
|
8819
|
+
}
|
|
8820
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccContentSwitcher, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8821
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.18", type: NgccContentSwitcher, isStandalone: true, selector: "ngcc-content-switcher", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, lowContrast: { classPropertyName: "lowContrast", publicName: "lowContrast", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, selectedIndex: { classPropertyName: "selectedIndex", publicName: "selectedIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedIndex: "selectedIndexChange", selected: "selected" }, providers: [
|
|
8822
|
+
{
|
|
8823
|
+
provide: NGCC_CONTENT_SWITCHER,
|
|
8824
|
+
useExisting: forwardRef(() => NgccContentSwitcher),
|
|
8825
|
+
},
|
|
8826
|
+
], queries: [{ propertyName: "options", predicate: NgccContentSwitcherOption, isSignal: true }], ngImport: i0, template: `
|
|
8827
|
+
<div
|
|
8828
|
+
[attr.aria-label]="ariaLabel()"
|
|
8829
|
+
[class]="switcherClasses()"
|
|
8830
|
+
role="tablist"
|
|
8831
|
+
(keydown)="onKeydown($event)"
|
|
8832
|
+
>
|
|
8833
|
+
<ng-content></ng-content>
|
|
8834
|
+
</div>
|
|
8835
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8836
|
+
}
|
|
8837
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccContentSwitcher, decorators: [{
|
|
8838
|
+
type: Component,
|
|
8839
|
+
args: [{
|
|
8840
|
+
selector: 'ngcc-content-switcher',
|
|
8841
|
+
standalone: true,
|
|
8842
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
8843
|
+
providers: [
|
|
8844
|
+
{
|
|
8845
|
+
provide: NGCC_CONTENT_SWITCHER,
|
|
8846
|
+
useExisting: forwardRef(() => NgccContentSwitcher),
|
|
8847
|
+
},
|
|
8848
|
+
],
|
|
8849
|
+
template: `
|
|
8850
|
+
<div
|
|
8851
|
+
[attr.aria-label]="ariaLabel()"
|
|
8852
|
+
[class]="switcherClasses()"
|
|
8853
|
+
role="tablist"
|
|
8854
|
+
(keydown)="onKeydown($event)"
|
|
8855
|
+
>
|
|
8856
|
+
<ng-content></ng-content>
|
|
8857
|
+
</div>
|
|
8858
|
+
`,
|
|
8859
|
+
}]
|
|
8860
|
+
}], ctorParameters: () => [], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], lowContrast: [{ type: i0.Input, args: [{ isSignal: true, alias: "lowContrast", required: false }] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], selectedIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedIndex", required: false }] }, { type: i0.Output, args: ["selectedIndexChange"] }], selected: [{ type: i0.Output, args: ["selected"] }], options: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => NgccContentSwitcherOption), { isSignal: true }] }] } });
|
|
8861
|
+
|
|
8862
|
+
/**
|
|
8863
|
+
* Tile / card with optional header, body, footer and action slots.
|
|
8864
|
+
*
|
|
8865
|
+
* Slots (content projection):
|
|
8866
|
+
* - `[ngccTileHeader]` — header content (or use the `heading` input)
|
|
8867
|
+
* - default — body
|
|
8868
|
+
* - `[ngccTileAction]` — action area in the header (e.g. an icon button)
|
|
8869
|
+
* - `[ngccTileFooter]` — footer content
|
|
8870
|
+
*
|
|
8871
|
+
* Set `href` to render the whole tile as a link, or `clickable` to make it a button.
|
|
8872
|
+
*/
|
|
8873
|
+
class NgccTile {
|
|
8874
|
+
heading = input('', ...(ngDevMode ? [{ debugName: "heading" }] : []));
|
|
8875
|
+
/** Renders the tile as an anchor. */
|
|
8876
|
+
href = input(undefined, ...(ngDevMode ? [{ debugName: "href" }] : []));
|
|
8877
|
+
/** Renders the tile as a button. */
|
|
8878
|
+
clickable = input(false, ...(ngDevMode ? [{ debugName: "clickable" }] : []));
|
|
8879
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
8880
|
+
/** Use on layers that already have a `$layer` background. */
|
|
8881
|
+
light = input(false, ...(ngDevMode ? [{ debugName: "light" }] : []));
|
|
8882
|
+
activated = output();
|
|
8883
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccTile, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8884
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: NgccTile, isStandalone: true, selector: "ngcc-tile", inputs: { heading: { classPropertyName: "heading", publicName: "heading", isSignal: true, isRequired: false, transformFunction: null }, href: { classPropertyName: "href", publicName: "href", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, light: { classPropertyName: "light", publicName: "light", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activated: "activated" }, host: { styleAttribute: "display: block" }, ngImport: i0, template: `
|
|
8885
|
+
@if (href(); as link) {
|
|
8886
|
+
<a
|
|
8887
|
+
class="cds--tile cds--tile--clickable"
|
|
8888
|
+
[class.cds--tile--light]="light()"
|
|
8889
|
+
[attr.href]="link"
|
|
8890
|
+
(click)="activated.emit($event)"
|
|
8891
|
+
>
|
|
8892
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
8893
|
+
</a>
|
|
8894
|
+
} @else if (clickable()) {
|
|
8895
|
+
<button
|
|
8896
|
+
type="button"
|
|
8897
|
+
class="cds--tile cds--tile--clickable"
|
|
8898
|
+
[class.cds--tile--light]="light()"
|
|
8899
|
+
[disabled]="disabled()"
|
|
8900
|
+
(click)="activated.emit($event)"
|
|
8901
|
+
>
|
|
8902
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
8903
|
+
</button>
|
|
8904
|
+
} @else {
|
|
8905
|
+
<div class="cds--tile" [class.cds--tile--light]="light()">
|
|
8906
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
8907
|
+
</div>
|
|
8908
|
+
}
|
|
8909
|
+
|
|
8910
|
+
<ng-template #content>
|
|
8911
|
+
<div class="ngcc-tile__header">
|
|
8912
|
+
@if (heading()) {
|
|
8913
|
+
<h3 class="ngcc-tile__heading">{{ heading() }}</h3>
|
|
8914
|
+
}
|
|
8915
|
+
<ng-content select="[ngccTileHeader]" />
|
|
8916
|
+
<ng-content select="[ngccTileAction]" />
|
|
8917
|
+
</div>
|
|
8918
|
+
<div class="ngcc-tile__body"><ng-content /></div>
|
|
8919
|
+
<div class="ngcc-tile__footer"><ng-content select="[ngccTileFooter]" /></div>
|
|
8920
|
+
</ng-template>
|
|
8921
|
+
`, isInline: true, styles: [".ngcc-tile__header{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:1rem}.ngcc-tile__heading{margin:0;font-size:var(--cds-heading-compact-01-font-size, .875rem);font-weight:600}.ngcc-tile__footer{margin-top:1rem;padding-top:.75rem;border-top:1px solid var(--cds-border-subtle)}.ngcc-tile__header:not(:has(*)){display:none}.ngcc-tile__footer:not(:has(*)){display:none}.cds--tile--clickable{width:100%;text-align:start}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8922
|
+
}
|
|
8923
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccTile, decorators: [{
|
|
8924
|
+
type: Component,
|
|
8925
|
+
args: [{ selector: 'ngcc-tile', standalone: true, imports: [NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, host: { style: 'display: block' }, template: `
|
|
8926
|
+
@if (href(); as link) {
|
|
8927
|
+
<a
|
|
8928
|
+
class="cds--tile cds--tile--clickable"
|
|
8929
|
+
[class.cds--tile--light]="light()"
|
|
8930
|
+
[attr.href]="link"
|
|
8931
|
+
(click)="activated.emit($event)"
|
|
8932
|
+
>
|
|
8933
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
8934
|
+
</a>
|
|
8935
|
+
} @else if (clickable()) {
|
|
8936
|
+
<button
|
|
8937
|
+
type="button"
|
|
8938
|
+
class="cds--tile cds--tile--clickable"
|
|
8939
|
+
[class.cds--tile--light]="light()"
|
|
8940
|
+
[disabled]="disabled()"
|
|
8941
|
+
(click)="activated.emit($event)"
|
|
8942
|
+
>
|
|
8943
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
8944
|
+
</button>
|
|
8945
|
+
} @else {
|
|
8946
|
+
<div class="cds--tile" [class.cds--tile--light]="light()">
|
|
8947
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
8948
|
+
</div>
|
|
8949
|
+
}
|
|
8950
|
+
|
|
8951
|
+
<ng-template #content>
|
|
8952
|
+
<div class="ngcc-tile__header">
|
|
8953
|
+
@if (heading()) {
|
|
8954
|
+
<h3 class="ngcc-tile__heading">{{ heading() }}</h3>
|
|
8955
|
+
}
|
|
8956
|
+
<ng-content select="[ngccTileHeader]" />
|
|
8957
|
+
<ng-content select="[ngccTileAction]" />
|
|
8958
|
+
</div>
|
|
8959
|
+
<div class="ngcc-tile__body"><ng-content /></div>
|
|
8960
|
+
<div class="ngcc-tile__footer"><ng-content select="[ngccTileFooter]" /></div>
|
|
8961
|
+
</ng-template>
|
|
8962
|
+
`, styles: [".ngcc-tile__header{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:1rem}.ngcc-tile__heading{margin:0;font-size:var(--cds-heading-compact-01-font-size, .875rem);font-weight:600}.ngcc-tile__footer{margin-top:1rem;padding-top:.75rem;border-top:1px solid var(--cds-border-subtle)}.ngcc-tile__header:not(:has(*)){display:none}.ngcc-tile__footer:not(:has(*)){display:none}.cds--tile--clickable{width:100%;text-align:start}\n"] }]
|
|
8963
|
+
}], propDecorators: { heading: [{ type: i0.Input, args: [{ isSignal: true, alias: "heading", required: false }] }], href: [{ type: i0.Input, args: [{ isSignal: true, alias: "href", required: false }] }], clickable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickable", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], light: [{ type: i0.Input, args: [{ isSignal: true, alias: "light", required: false }] }], activated: [{ type: i0.Output, args: ["activated"] }] } });
|
|
8964
|
+
|
|
8965
|
+
/**
|
|
8966
|
+
* KPI tile: label, value, optional delta with trend arrow, and a status accent bar.
|
|
8967
|
+
* If `trend` is omitted it is derived from the sign of a numeric `delta`.
|
|
8968
|
+
*/
|
|
8969
|
+
class NgccStatTile {
|
|
8970
|
+
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
8971
|
+
value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
8972
|
+
unit = input('', ...(ngDevMode ? [{ debugName: "unit" }] : []));
|
|
8973
|
+
/** Displayed as-is; numbers get a leading + / − and are used to infer the trend. */
|
|
8974
|
+
delta = input(undefined, ...(ngDevMode ? [{ debugName: "delta" }] : []));
|
|
8975
|
+
deltaCaption = input('', ...(ngDevMode ? [{ debugName: "deltaCaption" }] : []));
|
|
8976
|
+
trend = input(undefined, ...(ngDevMode ? [{ debugName: "trend" }] : []));
|
|
8977
|
+
trendSentiment = input('positive-up', ...(ngDevMode ? [{ debugName: "trendSentiment" }] : []));
|
|
8978
|
+
status = input('none', ...(ngDevMode ? [{ debugName: "status" }] : []));
|
|
8979
|
+
hasDelta = computed(() => this.delta() !== undefined && this.delta() !== '', ...(ngDevMode ? [{ debugName: "hasDelta" }] : []));
|
|
8980
|
+
resolvedTrend = computed(() => {
|
|
8981
|
+
const explicit = this.trend();
|
|
8982
|
+
if (explicit)
|
|
8983
|
+
return explicit;
|
|
8984
|
+
const d = this.delta();
|
|
8985
|
+
const n = typeof d === 'number' ? d : parseFloat(String(d ?? ''));
|
|
8986
|
+
if (Number.isNaN(n) || n === 0)
|
|
8987
|
+
return 'flat';
|
|
8988
|
+
return n > 0 ? 'up' : 'down';
|
|
8989
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedTrend" }] : []));
|
|
8990
|
+
accentColor = computed(() => {
|
|
8991
|
+
const s = this.status();
|
|
8992
|
+
return s === 'none' ? null : `var(--cds-support-${s})`;
|
|
8993
|
+
}, ...(ngDevMode ? [{ debugName: "accentColor" }] : []));
|
|
8994
|
+
deltaColor = computed(() => {
|
|
8995
|
+
const t = this.resolvedTrend();
|
|
8996
|
+
const sentiment = this.trendSentiment();
|
|
8997
|
+
if (t === 'flat' || sentiment === 'neutral')
|
|
8998
|
+
return null;
|
|
8999
|
+
const good = (t === 'up') === (sentiment === 'positive-up');
|
|
9000
|
+
return good ? 'var(--cds-support-success)' : 'var(--cds-support-error)';
|
|
9001
|
+
}, ...(ngDevMode ? [{ debugName: "deltaColor" }] : []));
|
|
9002
|
+
deltaAriaLabel = computed(() => {
|
|
9003
|
+
const t = this.resolvedTrend();
|
|
9004
|
+
const dir = t === 'up' ? 'Up' : t === 'down' ? 'Down' : 'Unchanged';
|
|
9005
|
+
return `${dir} ${this.delta()} ${this.deltaCaption()}`.trim();
|
|
9006
|
+
}, ...(ngDevMode ? [{ debugName: "deltaAriaLabel" }] : []));
|
|
9007
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccStatTile, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9008
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: NgccStatTile, isStandalone: true, selector: "ngcc-stat-tile", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, unit: { classPropertyName: "unit", publicName: "unit", isSignal: true, isRequired: false, transformFunction: null }, delta: { classPropertyName: "delta", publicName: "delta", isSignal: true, isRequired: false, transformFunction: null }, deltaCaption: { classPropertyName: "deltaCaption", publicName: "deltaCaption", isSignal: true, isRequired: false, transformFunction: null }, trend: { classPropertyName: "trend", publicName: "trend", isSignal: true, isRequired: false, transformFunction: null }, trendSentiment: { classPropertyName: "trendSentiment", publicName: "trendSentiment", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null } }, host: { styleAttribute: "display: block" }, ngImport: i0, template: `
|
|
9009
|
+
<div
|
|
9010
|
+
class="cds--tile ngcc-stat"
|
|
9011
|
+
[style.--ngcc-stat-accent]="accentColor()"
|
|
9012
|
+
[style.--ngcc-stat-delta]="deltaColor()"
|
|
9013
|
+
>
|
|
9014
|
+
<p class="ngcc-stat__label">{{ label() }}</p>
|
|
9015
|
+
<p class="ngcc-stat__value">
|
|
9016
|
+
{{ value() }}
|
|
9017
|
+
@if (unit()) {
|
|
9018
|
+
<span class="ngcc-stat__unit">{{ unit() }}</span>
|
|
9019
|
+
}
|
|
9020
|
+
</p>
|
|
9021
|
+
@if (hasDelta()) {
|
|
9022
|
+
<p class="ngcc-stat__delta" [attr.aria-label]="deltaAriaLabel()">
|
|
9023
|
+
@if (resolvedTrend() !== 'flat') {
|
|
9024
|
+
<ngcc-icon
|
|
9025
|
+
[name]="resolvedTrend() === 'up' ? 'arrow_up' : 'arrow_down'"
|
|
9026
|
+
size="sm"
|
|
9027
|
+
[decorative]="true"
|
|
9028
|
+
/>
|
|
9029
|
+
}
|
|
9030
|
+
<span>{{ delta() }}</span>
|
|
9031
|
+
@if (deltaCaption()) {
|
|
9032
|
+
<span class="ngcc-stat__caption">{{ deltaCaption() }}</span>
|
|
9033
|
+
}
|
|
9034
|
+
</p>
|
|
9035
|
+
}
|
|
9036
|
+
</div>
|
|
9037
|
+
`, isInline: true, styles: [".ngcc-stat{border-inline-start:4px solid var(--ngcc-stat-accent, transparent)}.ngcc-stat__label{margin:0;color:var(--cds-text-secondary);font-size:var(--cds-label-01-font-size, .75rem)}.ngcc-stat__value{margin:.5rem 0 0;font-size:2rem;line-height:1.2;font-weight:300;color:var(--cds-text-primary)}.ngcc-stat__unit{font-size:1rem;margin-inline-start:.25rem;color:var(--cds-text-secondary)}.ngcc-stat__delta{display:inline-flex;align-items:center;gap:.25rem;margin-top:.5rem;font-size:.875rem;color:var(--ngcc-stat-delta, var(--cds-text-secondary))}.ngcc-stat__delta ngcc-icon{fill:currentColor}.ngcc-stat__caption{margin-inline-start:.25rem;color:var(--cds-text-secondary)}\n"], dependencies: [{ kind: "component", type: NgccIcon, selector: "ngcc-icon", inputs: ["name", "size", "color", "ariaLabel", "decorative", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9038
|
+
}
|
|
9039
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccStatTile, decorators: [{
|
|
9040
|
+
type: Component,
|
|
9041
|
+
args: [{ selector: 'ngcc-stat-tile', standalone: true, imports: [NgccIcon], changeDetection: ChangeDetectionStrategy.OnPush, host: { style: 'display: block' }, template: `
|
|
9042
|
+
<div
|
|
9043
|
+
class="cds--tile ngcc-stat"
|
|
9044
|
+
[style.--ngcc-stat-accent]="accentColor()"
|
|
9045
|
+
[style.--ngcc-stat-delta]="deltaColor()"
|
|
9046
|
+
>
|
|
9047
|
+
<p class="ngcc-stat__label">{{ label() }}</p>
|
|
9048
|
+
<p class="ngcc-stat__value">
|
|
9049
|
+
{{ value() }}
|
|
9050
|
+
@if (unit()) {
|
|
9051
|
+
<span class="ngcc-stat__unit">{{ unit() }}</span>
|
|
9052
|
+
}
|
|
9053
|
+
</p>
|
|
9054
|
+
@if (hasDelta()) {
|
|
9055
|
+
<p class="ngcc-stat__delta" [attr.aria-label]="deltaAriaLabel()">
|
|
9056
|
+
@if (resolvedTrend() !== 'flat') {
|
|
9057
|
+
<ngcc-icon
|
|
9058
|
+
[name]="resolvedTrend() === 'up' ? 'arrow_up' : 'arrow_down'"
|
|
9059
|
+
size="sm"
|
|
9060
|
+
[decorative]="true"
|
|
9061
|
+
/>
|
|
9062
|
+
}
|
|
9063
|
+
<span>{{ delta() }}</span>
|
|
9064
|
+
@if (deltaCaption()) {
|
|
9065
|
+
<span class="ngcc-stat__caption">{{ deltaCaption() }}</span>
|
|
9066
|
+
}
|
|
9067
|
+
</p>
|
|
9068
|
+
}
|
|
9069
|
+
</div>
|
|
9070
|
+
`, styles: [".ngcc-stat{border-inline-start:4px solid var(--ngcc-stat-accent, transparent)}.ngcc-stat__label{margin:0;color:var(--cds-text-secondary);font-size:var(--cds-label-01-font-size, .75rem)}.ngcc-stat__value{margin:.5rem 0 0;font-size:2rem;line-height:1.2;font-weight:300;color:var(--cds-text-primary)}.ngcc-stat__unit{font-size:1rem;margin-inline-start:.25rem;color:var(--cds-text-secondary)}.ngcc-stat__delta{display:inline-flex;align-items:center;gap:.25rem;margin-top:.5rem;font-size:.875rem;color:var(--ngcc-stat-delta, var(--cds-text-secondary))}.ngcc-stat__delta ngcc-icon{fill:currentColor}.ngcc-stat__caption{margin-inline-start:.25rem;color:var(--cds-text-secondary)}\n"] }]
|
|
9071
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], unit: [{ type: i0.Input, args: [{ isSignal: true, alias: "unit", required: false }] }], delta: [{ type: i0.Input, args: [{ isSignal: true, alias: "delta", required: false }] }], deltaCaption: [{ type: i0.Input, args: [{ isSignal: true, alias: "deltaCaption", required: false }] }], trend: [{ type: i0.Input, args: [{ isSignal: true, alias: "trend", required: false }] }], trendSentiment: [{ type: i0.Input, args: [{ isSignal: true, alias: "trendSentiment", required: false }] }], status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }] } });
|
|
9072
|
+
|
|
9073
|
+
/** Convenience map for status badges: `<ngcc-tag [type]="NGCC_STATUS_TAG.running">`. */
|
|
9074
|
+
const NGCC_STATUS_TAG = {
|
|
9075
|
+
running: 'green',
|
|
9076
|
+
success: 'green',
|
|
9077
|
+
pending: 'blue',
|
|
9078
|
+
warning: 'purple',
|
|
9079
|
+
error: 'red',
|
|
9080
|
+
stopped: 'gray',
|
|
9081
|
+
unknown: 'cool-gray',
|
|
9082
|
+
};
|
|
9083
|
+
/**
|
|
9084
|
+
* Tag / status badge. `dot` adds a leading status dot (status-badge look).
|
|
9085
|
+
* `dismissible` shows a close button and emits `dismissed`.
|
|
9086
|
+
*/
|
|
9087
|
+
class NgccTag {
|
|
9088
|
+
type = input('gray', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
9089
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
9090
|
+
dot = input(false, ...(ngDevMode ? [{ debugName: "dot" }] : []));
|
|
9091
|
+
dismissible = input(false, ...(ngDevMode ? [{ debugName: "dismissible" }] : []));
|
|
9092
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
9093
|
+
dismissLabel = input('Clear filter', ...(ngDevMode ? [{ debugName: "dismissLabel" }] : []));
|
|
9094
|
+
dismissed = output();
|
|
9095
|
+
classes = computed(() => [
|
|
9096
|
+
'cds--tag',
|
|
9097
|
+
`cds--tag--${this.type()}`,
|
|
9098
|
+
this.size() !== 'md' ? `cds--tag--${this.size()}` : '',
|
|
9099
|
+
this.dismissible() ? 'cds--tag--filter' : '',
|
|
9100
|
+
this.disabled() ? 'cds--tag--disabled' : '',
|
|
9101
|
+
]
|
|
9102
|
+
.filter(Boolean)
|
|
9103
|
+
.join(' '), ...(ngDevMode ? [{ debugName: "classes" }] : []));
|
|
9104
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccTag, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9105
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: NgccTag, isStandalone: true, selector: "ngcc-tag", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, dot: { classPropertyName: "dot", publicName: "dot", isSignal: true, isRequired: false, transformFunction: null }, dismissible: { classPropertyName: "dismissible", publicName: "dismissible", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, dismissLabel: { classPropertyName: "dismissLabel", publicName: "dismissLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dismissed: "dismissed" }, host: { styleAttribute: "display: inline-flex" }, ngImport: i0, template: `
|
|
9106
|
+
<span [class]="classes()" [attr.aria-disabled]="disabled() || null">
|
|
9107
|
+
@if (dot()) {
|
|
9108
|
+
<span class="ngcc-tag__dot" aria-hidden="true"></span>
|
|
9109
|
+
}
|
|
9110
|
+
<span class="cds--tag__label"><ng-content /></span>
|
|
9111
|
+
@if (dismissible()) {
|
|
9112
|
+
<button
|
|
9113
|
+
type="button"
|
|
9114
|
+
class="cds--tag__close-icon"
|
|
9115
|
+
[disabled]="disabled()"
|
|
9116
|
+
[attr.aria-label]="dismissLabel()"
|
|
9117
|
+
(click)="dismissed.emit()"
|
|
9118
|
+
>
|
|
9119
|
+
<svg width="16" height="16" viewBox="0 0 32 32" fill="currentColor" aria-hidden="true">
|
|
9120
|
+
<path
|
|
9121
|
+
d="M24 9.4 22.6 8 16 14.6 9.4 8 8 9.4 14.6 16 8 22.6 9.4 24 16 17.4 22.6 24 24 22.6 17.4 16z"
|
|
9122
|
+
></path>
|
|
9123
|
+
</svg>
|
|
9124
|
+
</button>
|
|
9125
|
+
}
|
|
9126
|
+
</span>
|
|
9127
|
+
`, isInline: true, styles: [".ngcc-tag__dot{width:.5rem;height:.5rem;border-radius:50%;background:currentColor;margin-inline-end:.375rem;flex:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9128
|
+
}
|
|
9129
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccTag, decorators: [{
|
|
9130
|
+
type: Component,
|
|
9131
|
+
args: [{ selector: 'ngcc-tag', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: { style: 'display: inline-flex' }, template: `
|
|
9132
|
+
<span [class]="classes()" [attr.aria-disabled]="disabled() || null">
|
|
9133
|
+
@if (dot()) {
|
|
9134
|
+
<span class="ngcc-tag__dot" aria-hidden="true"></span>
|
|
9135
|
+
}
|
|
9136
|
+
<span class="cds--tag__label"><ng-content /></span>
|
|
9137
|
+
@if (dismissible()) {
|
|
9138
|
+
<button
|
|
9139
|
+
type="button"
|
|
9140
|
+
class="cds--tag__close-icon"
|
|
9141
|
+
[disabled]="disabled()"
|
|
9142
|
+
[attr.aria-label]="dismissLabel()"
|
|
9143
|
+
(click)="dismissed.emit()"
|
|
9144
|
+
>
|
|
9145
|
+
<svg width="16" height="16" viewBox="0 0 32 32" fill="currentColor" aria-hidden="true">
|
|
9146
|
+
<path
|
|
9147
|
+
d="M24 9.4 22.6 8 16 14.6 9.4 8 8 9.4 14.6 16 8 22.6 9.4 24 16 17.4 22.6 24 24 22.6 17.4 16z"
|
|
9148
|
+
></path>
|
|
9149
|
+
</svg>
|
|
9150
|
+
</button>
|
|
9151
|
+
}
|
|
9152
|
+
</span>
|
|
9153
|
+
`, styles: [".ngcc-tag__dot{width:.5rem;height:.5rem;border-radius:50%;background:currentColor;margin-inline-end:.375rem;flex:none}\n"] }]
|
|
9154
|
+
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], dot: [{ type: i0.Input, args: [{ isSignal: true, alias: "dot", required: false }] }], dismissible: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissible", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], dismissLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissLabel", required: false }] }], dismissed: [{ type: i0.Output, args: ["dismissed"] }] } });
|
|
9155
|
+
|
|
9156
|
+
let nextId = 0;
|
|
9157
|
+
/**
|
|
9158
|
+
* Progress / meter bar. The bar changes color once the value crosses
|
|
9159
|
+
* `warningThreshold` and `criticalThreshold` (percent of `max`), which suits
|
|
9160
|
+
* usage meters (CPU, disk, quota). Set `finishAtMax` for task progress, where
|
|
9161
|
+
* 100% means "done" rather than "critical".
|
|
9162
|
+
*/
|
|
9163
|
+
class NgccProgressBar {
|
|
9164
|
+
value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
9165
|
+
max = input(100, ...(ngDevMode ? [{ debugName: "max" }] : []));
|
|
9166
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
9167
|
+
helperText = input('', ...(ngDevMode ? [{ debugName: "helperText" }] : []));
|
|
9168
|
+
size = input('big', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
9169
|
+
showValue = input(true, ...(ngDevMode ? [{ debugName: "showValue" }] : []));
|
|
9170
|
+
/** Percent at which the bar turns to the warning color. */
|
|
9171
|
+
warningThreshold = input(75, ...(ngDevMode ? [{ debugName: "warningThreshold" }] : []));
|
|
9172
|
+
/** Percent at which the bar turns to the critical (error) color. */
|
|
9173
|
+
criticalThreshold = input(90, ...(ngDevMode ? [{ debugName: "criticalThreshold" }] : []));
|
|
9174
|
+
/** Treat 100% as finished (success) instead of critical; thresholds are ignored. */
|
|
9175
|
+
finishAtMax = input(false, ...(ngDevMode ? [{ debugName: "finishAtMax" }] : []));
|
|
9176
|
+
labelId = `ngcc-progress-bar-${nextId++}`;
|
|
9177
|
+
clampedValue = computed(() => Math.min(Math.max(this.value(), 0), this.max()), ...(ngDevMode ? [{ debugName: "clampedValue" }] : []));
|
|
9178
|
+
percent = computed(() => {
|
|
9179
|
+
const max = this.max();
|
|
9180
|
+
return max > 0 ? Math.round((this.clampedValue() / max) * 100) : 0;
|
|
9181
|
+
}, ...(ngDevMode ? [{ debugName: "percent" }] : []));
|
|
9182
|
+
level = computed(() => {
|
|
9183
|
+
const p = this.percent();
|
|
9184
|
+
if (this.finishAtMax())
|
|
9185
|
+
return p >= 100 ? 'finished' : 'normal';
|
|
9186
|
+
if (p >= this.criticalThreshold())
|
|
9187
|
+
return 'critical';
|
|
9188
|
+
if (p >= this.warningThreshold())
|
|
9189
|
+
return 'warning';
|
|
9190
|
+
return 'normal';
|
|
9191
|
+
}, ...(ngDevMode ? [{ debugName: "level" }] : []));
|
|
9192
|
+
valueText = computed(() => `${this.percent()}%${this.level() === 'normal' || this.level() === 'finished' ? '' : ` (${this.level()})`}`, ...(ngDevMode ? [{ debugName: "valueText" }] : []));
|
|
9193
|
+
barColor = computed(() => {
|
|
9194
|
+
switch (this.level()) {
|
|
9195
|
+
case 'warning':
|
|
9196
|
+
return 'var(--cds-support-warning)';
|
|
9197
|
+
case 'critical':
|
|
9198
|
+
return 'var(--cds-support-error)';
|
|
9199
|
+
default:
|
|
9200
|
+
return null;
|
|
9201
|
+
}
|
|
9202
|
+
}, ...(ngDevMode ? [{ debugName: "barColor" }] : []));
|
|
9203
|
+
classes = computed(() => [
|
|
9204
|
+
'cds--progress-bar',
|
|
9205
|
+
this.size() === 'big' ? 'cds--progress-bar--big' : 'cds--progress-bar--small',
|
|
9206
|
+
this.level() === 'critical' ? 'cds--progress-bar--error' : '',
|
|
9207
|
+
this.level() === 'finished' ? 'cds--progress-bar--finished' : '',
|
|
9208
|
+
]
|
|
9209
|
+
.filter(Boolean)
|
|
9210
|
+
.join(' '), ...(ngDevMode ? [{ debugName: "classes" }] : []));
|
|
9211
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccProgressBar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9212
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: NgccProgressBar, isStandalone: true, selector: "ngcc-progress-bar", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, helperText: { classPropertyName: "helperText", publicName: "helperText", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, showValue: { classPropertyName: "showValue", publicName: "showValue", isSignal: true, isRequired: false, transformFunction: null }, warningThreshold: { classPropertyName: "warningThreshold", publicName: "warningThreshold", isSignal: true, isRequired: false, transformFunction: null }, criticalThreshold: { classPropertyName: "criticalThreshold", publicName: "criticalThreshold", isSignal: true, isRequired: false, transformFunction: null }, finishAtMax: { classPropertyName: "finishAtMax", publicName: "finishAtMax", isSignal: true, isRequired: false, transformFunction: null } }, host: { styleAttribute: "display: block" }, ngImport: i0, template: `
|
|
9213
|
+
<div [class]="classes()">
|
|
9214
|
+
<div class="cds--progress-bar__label" [id]="labelId">
|
|
9215
|
+
<span>{{ label() }}</span>
|
|
9216
|
+
@if (showValue()) {
|
|
9217
|
+
<span>{{ percent() }}%</span>
|
|
9218
|
+
}
|
|
9219
|
+
</div>
|
|
9220
|
+
<div
|
|
9221
|
+
class="cds--progress-bar__track"
|
|
9222
|
+
role="progressbar"
|
|
9223
|
+
[attr.aria-labelledby]="labelId"
|
|
9224
|
+
[attr.aria-valuemin]="0"
|
|
9225
|
+
[attr.aria-valuemax]="max()"
|
|
9226
|
+
[attr.aria-valuenow]="clampedValue()"
|
|
9227
|
+
[attr.aria-valuetext]="valueText()"
|
|
9228
|
+
>
|
|
9229
|
+
<div
|
|
9230
|
+
class="cds--progress-bar__bar"
|
|
9231
|
+
[style.transform]="'scaleX(' + percent() / 100 + ')'"
|
|
9232
|
+
[style.background-color]="barColor()"
|
|
9233
|
+
></div>
|
|
9234
|
+
</div>
|
|
9235
|
+
@if (helperText()) {
|
|
9236
|
+
<div class="cds--progress-bar__helper-text">{{ helperText() }}</div>
|
|
9237
|
+
}
|
|
9238
|
+
</div>
|
|
9239
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9240
|
+
}
|
|
9241
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccProgressBar, decorators: [{
|
|
9242
|
+
type: Component,
|
|
9243
|
+
args: [{
|
|
9244
|
+
selector: 'ngcc-progress-bar',
|
|
9245
|
+
standalone: true,
|
|
9246
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9247
|
+
host: { style: 'display: block' },
|
|
9248
|
+
template: `
|
|
9249
|
+
<div [class]="classes()">
|
|
9250
|
+
<div class="cds--progress-bar__label" [id]="labelId">
|
|
9251
|
+
<span>{{ label() }}</span>
|
|
9252
|
+
@if (showValue()) {
|
|
9253
|
+
<span>{{ percent() }}%</span>
|
|
9254
|
+
}
|
|
9255
|
+
</div>
|
|
9256
|
+
<div
|
|
9257
|
+
class="cds--progress-bar__track"
|
|
9258
|
+
role="progressbar"
|
|
9259
|
+
[attr.aria-labelledby]="labelId"
|
|
9260
|
+
[attr.aria-valuemin]="0"
|
|
9261
|
+
[attr.aria-valuemax]="max()"
|
|
9262
|
+
[attr.aria-valuenow]="clampedValue()"
|
|
9263
|
+
[attr.aria-valuetext]="valueText()"
|
|
9264
|
+
>
|
|
9265
|
+
<div
|
|
9266
|
+
class="cds--progress-bar__bar"
|
|
9267
|
+
[style.transform]="'scaleX(' + percent() / 100 + ')'"
|
|
9268
|
+
[style.background-color]="barColor()"
|
|
9269
|
+
></div>
|
|
9270
|
+
</div>
|
|
9271
|
+
@if (helperText()) {
|
|
9272
|
+
<div class="cds--progress-bar__helper-text">{{ helperText() }}</div>
|
|
9273
|
+
}
|
|
9274
|
+
</div>
|
|
9275
|
+
`,
|
|
9276
|
+
}]
|
|
9277
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], helperText: [{ type: i0.Input, args: [{ isSignal: true, alias: "helperText", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], showValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValue", required: false }] }], warningThreshold: [{ type: i0.Input, args: [{ isSignal: true, alias: "warningThreshold", required: false }] }], criticalThreshold: [{ type: i0.Input, args: [{ isSignal: true, alias: "criticalThreshold", required: false }] }], finishAtMax: [{ type: i0.Input, args: [{ isSignal: true, alias: "finishAtMax", required: false }] }] } });
|
|
9278
|
+
|
|
9279
|
+
/**
|
|
9280
|
+
* Empty state: icon, title, description and action.
|
|
9281
|
+
* - `icon` uses the icon registry; project `[ngccEmptyIcon]` for a custom illustration.
|
|
9282
|
+
* - Project buttons/links into `[ngccEmptyAction]` for the call to action.
|
|
9283
|
+
*/
|
|
9284
|
+
class NgccEmptyState {
|
|
9285
|
+
title = input.required(...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
9286
|
+
description = input('', ...(ngDevMode ? [{ debugName: "description" }] : []));
|
|
9287
|
+
icon = input(undefined, ...(ngDevMode ? [{ debugName: "icon" }] : []));
|
|
9288
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
9289
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccEmptyState, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9290
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: NgccEmptyState, isStandalone: true, selector: "ngcc-empty-state", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { styleAttribute: "display: block" }, ngImport: i0, template: `
|
|
9291
|
+
<div [class]="'ngcc-empty ngcc-empty--' + size()">
|
|
9292
|
+
<div class="ngcc-empty__icon">
|
|
9293
|
+
<ng-content select="[ngccEmptyIcon]">
|
|
9294
|
+
@if (icon(); as name) {
|
|
9295
|
+
<ngcc-icon [name]="name" [size]="size() === 'sm' ? 'lg' : 'xl'" [decorative]="true" />
|
|
9296
|
+
}
|
|
9297
|
+
</ng-content>
|
|
9298
|
+
</div>
|
|
9299
|
+
<h3 class="ngcc-empty__title">{{ title() }}</h3>
|
|
9300
|
+
@if (description()) {
|
|
9301
|
+
<p class="ngcc-empty__description">{{ description() }}</p>
|
|
9302
|
+
}
|
|
9303
|
+
<div class="ngcc-empty__action"><ng-content select="[ngccEmptyAction]" /></div>
|
|
9304
|
+
</div>
|
|
9305
|
+
`, isInline: true, styles: [".ngcc-empty{display:flex;flex-direction:column;align-items:center;text-align:center;padding:var(--ngcc-empty-padding, 3rem 1rem);color:var(--cds-text-secondary)}.ngcc-empty--sm{--ngcc-empty-padding: 1.5rem 1rem}.ngcc-empty--lg{--ngcc-empty-padding: 5rem 1rem}.ngcc-empty__icon{margin-block-end:1rem;color:var(--cds-icon-secondary)}.ngcc-empty__title{margin:0;font-size:1.25rem;font-weight:400;color:var(--cds-text-primary)}.ngcc-empty--sm .ngcc-empty__title{font-size:1rem}.ngcc-empty__description{margin:.5rem 0 0;max-inline-size:24rem;font-size:.875rem;line-height:1.43}.ngcc-empty__action{margin-block-start:1.5rem;display:flex;flex-wrap:wrap;justify-content:center;gap:.5rem}.ngcc-empty__action:empty{display:none}\n"], dependencies: [{ kind: "component", type: NgccIcon, selector: "ngcc-icon", inputs: ["name", "size", "color", "ariaLabel", "decorative", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9306
|
+
}
|
|
9307
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccEmptyState, decorators: [{
|
|
9308
|
+
type: Component,
|
|
9309
|
+
args: [{ selector: 'ngcc-empty-state', standalone: true, imports: [NgccIcon], changeDetection: ChangeDetectionStrategy.OnPush, host: { style: 'display: block' }, template: `
|
|
9310
|
+
<div [class]="'ngcc-empty ngcc-empty--' + size()">
|
|
9311
|
+
<div class="ngcc-empty__icon">
|
|
9312
|
+
<ng-content select="[ngccEmptyIcon]">
|
|
9313
|
+
@if (icon(); as name) {
|
|
9314
|
+
<ngcc-icon [name]="name" [size]="size() === 'sm' ? 'lg' : 'xl'" [decorative]="true" />
|
|
9315
|
+
}
|
|
9316
|
+
</ng-content>
|
|
9317
|
+
</div>
|
|
9318
|
+
<h3 class="ngcc-empty__title">{{ title() }}</h3>
|
|
9319
|
+
@if (description()) {
|
|
9320
|
+
<p class="ngcc-empty__description">{{ description() }}</p>
|
|
9321
|
+
}
|
|
9322
|
+
<div class="ngcc-empty__action"><ng-content select="[ngccEmptyAction]" /></div>
|
|
9323
|
+
</div>
|
|
9324
|
+
`, styles: [".ngcc-empty{display:flex;flex-direction:column;align-items:center;text-align:center;padding:var(--ngcc-empty-padding, 3rem 1rem);color:var(--cds-text-secondary)}.ngcc-empty--sm{--ngcc-empty-padding: 1.5rem 1rem}.ngcc-empty--lg{--ngcc-empty-padding: 5rem 1rem}.ngcc-empty__icon{margin-block-end:1rem;color:var(--cds-icon-secondary)}.ngcc-empty__title{margin:0;font-size:1.25rem;font-weight:400;color:var(--cds-text-primary)}.ngcc-empty--sm .ngcc-empty__title{font-size:1rem}.ngcc-empty__description{margin:.5rem 0 0;max-inline-size:24rem;font-size:.875rem;line-height:1.43}.ngcc-empty__action{margin-block-start:1.5rem;display:flex;flex-wrap:wrap;justify-content:center;gap:.5rem}.ngcc-empty__action:empty{display:none}\n"] }]
|
|
9325
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
9326
|
+
|
|
9327
|
+
/**
|
|
9328
|
+
* Activity feed / timeline. `feed` is a compact list with status dots;
|
|
9329
|
+
* `timeline` adds a connecting vertical line between entries.
|
|
9330
|
+
*/
|
|
9331
|
+
class NgccActivityFeed {
|
|
9332
|
+
items = input([], ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
9333
|
+
variant = input('feed', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
9334
|
+
ariaLabel = input('Activity', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
9335
|
+
emptyText = input('No recent activity', ...(ngDevMode ? [{ debugName: "emptyText" }] : []));
|
|
9336
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccActivityFeed, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9337
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: NgccActivityFeed, isStandalone: true, selector: "ngcc-activity-feed", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null } }, host: { styleAttribute: "display: block" }, ngImport: i0, template: `
|
|
9338
|
+
@if (items().length) {
|
|
9339
|
+
<ol [class]="'ngcc-feed ngcc-feed--' + variant()" [attr.aria-label]="ariaLabel()">
|
|
9340
|
+
@for (item of items(); track item.id) {
|
|
9341
|
+
<li [class]="'ngcc-feed__item ngcc-feed__item--' + (item.status ?? 'info')">
|
|
9342
|
+
<span class="ngcc-feed__marker" aria-hidden="true"
|
|
9343
|
+
><span class="ngcc-feed__dot"></span
|
|
9344
|
+
></span>
|
|
9345
|
+
<div class="ngcc-feed__body">
|
|
9346
|
+
<p class="ngcc-feed__title">
|
|
9347
|
+
@if (item.actor) {
|
|
9348
|
+
<span class="ngcc-feed__actor">{{ item.actor }}</span>
|
|
9349
|
+
}
|
|
9350
|
+
{{ item.title }}
|
|
9351
|
+
</p>
|
|
9352
|
+
@if (item.description) {
|
|
9353
|
+
<p class="ngcc-feed__description">{{ item.description }}</p>
|
|
9354
|
+
}
|
|
9355
|
+
@if (item.timestamp) {
|
|
9356
|
+
<time class="ngcc-feed__time" [attr.datetime]="item.datetime ?? null">{{
|
|
9357
|
+
item.timestamp
|
|
9358
|
+
}}</time>
|
|
9359
|
+
}
|
|
9360
|
+
</div>
|
|
9361
|
+
</li>
|
|
9362
|
+
}
|
|
9363
|
+
</ol>
|
|
9364
|
+
} @else {
|
|
9365
|
+
<p class="ngcc-feed__empty">{{ emptyText() }}</p>
|
|
9366
|
+
}
|
|
9367
|
+
`, isInline: true, styles: [".ngcc-feed{list-style:none;margin:0;padding:0}.ngcc-feed__item{position:relative;display:flex;gap:1rem;padding-block:.75rem}.ngcc-feed--feed .ngcc-feed__item:not(:last-child){border-block-end:1px solid var(--cds-border-subtle-01)}.ngcc-feed__marker{position:relative;flex:none;inline-size:.75rem;padding-block-start:.3rem}.ngcc-feed__dot{display:block;inline-size:.75rem;block-size:.75rem;border-radius:50%;background:var(--ngcc-feed-color, var(--cds-support-info))}.ngcc-feed--timeline .ngcc-feed__item:not(:last-child) .ngcc-feed__marker:after{content:\"\";position:absolute;inset-block:1.35rem -1.05rem;inset-inline-start:calc(50% - 1px);inline-size:2px;background:var(--cds-border-subtle-01)}.ngcc-feed__item--success{--ngcc-feed-color: var(--cds-support-success)}.ngcc-feed__item--warning{--ngcc-feed-color: var(--cds-support-warning)}.ngcc-feed__item--error{--ngcc-feed-color: var(--cds-support-error)}.ngcc-feed__item--neutral{--ngcc-feed-color: var(--cds-icon-secondary)}.ngcc-feed__body{flex:1;min-inline-size:0}.ngcc-feed__title{margin:0;font-size:.875rem;color:var(--cds-text-primary)}.ngcc-feed__actor{font-weight:600}.ngcc-feed__description{margin:.25rem 0 0;font-size:.875rem;color:var(--cds-text-secondary)}.ngcc-feed__time{display:block;margin-block-start:.25rem;font-size:.75rem;color:var(--cds-text-helper)}.ngcc-feed__empty{margin:0;padding:1rem 0;font-size:.875rem;color:var(--cds-text-secondary)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9368
|
+
}
|
|
9369
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccActivityFeed, decorators: [{
|
|
9370
|
+
type: Component,
|
|
9371
|
+
args: [{ selector: 'ngcc-activity-feed', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: { style: 'display: block' }, template: `
|
|
9372
|
+
@if (items().length) {
|
|
9373
|
+
<ol [class]="'ngcc-feed ngcc-feed--' + variant()" [attr.aria-label]="ariaLabel()">
|
|
9374
|
+
@for (item of items(); track item.id) {
|
|
9375
|
+
<li [class]="'ngcc-feed__item ngcc-feed__item--' + (item.status ?? 'info')">
|
|
9376
|
+
<span class="ngcc-feed__marker" aria-hidden="true"
|
|
9377
|
+
><span class="ngcc-feed__dot"></span
|
|
9378
|
+
></span>
|
|
9379
|
+
<div class="ngcc-feed__body">
|
|
9380
|
+
<p class="ngcc-feed__title">
|
|
9381
|
+
@if (item.actor) {
|
|
9382
|
+
<span class="ngcc-feed__actor">{{ item.actor }}</span>
|
|
9383
|
+
}
|
|
9384
|
+
{{ item.title }}
|
|
9385
|
+
</p>
|
|
9386
|
+
@if (item.description) {
|
|
9387
|
+
<p class="ngcc-feed__description">{{ item.description }}</p>
|
|
9388
|
+
}
|
|
9389
|
+
@if (item.timestamp) {
|
|
9390
|
+
<time class="ngcc-feed__time" [attr.datetime]="item.datetime ?? null">{{
|
|
9391
|
+
item.timestamp
|
|
9392
|
+
}}</time>
|
|
9393
|
+
}
|
|
9394
|
+
</div>
|
|
9395
|
+
</li>
|
|
9396
|
+
}
|
|
9397
|
+
</ol>
|
|
9398
|
+
} @else {
|
|
9399
|
+
<p class="ngcc-feed__empty">{{ emptyText() }}</p>
|
|
9400
|
+
}
|
|
9401
|
+
`, styles: [".ngcc-feed{list-style:none;margin:0;padding:0}.ngcc-feed__item{position:relative;display:flex;gap:1rem;padding-block:.75rem}.ngcc-feed--feed .ngcc-feed__item:not(:last-child){border-block-end:1px solid var(--cds-border-subtle-01)}.ngcc-feed__marker{position:relative;flex:none;inline-size:.75rem;padding-block-start:.3rem}.ngcc-feed__dot{display:block;inline-size:.75rem;block-size:.75rem;border-radius:50%;background:var(--ngcc-feed-color, var(--cds-support-info))}.ngcc-feed--timeline .ngcc-feed__item:not(:last-child) .ngcc-feed__marker:after{content:\"\";position:absolute;inset-block:1.35rem -1.05rem;inset-inline-start:calc(50% - 1px);inline-size:2px;background:var(--cds-border-subtle-01)}.ngcc-feed__item--success{--ngcc-feed-color: var(--cds-support-success)}.ngcc-feed__item--warning{--ngcc-feed-color: var(--cds-support-warning)}.ngcc-feed__item--error{--ngcc-feed-color: var(--cds-support-error)}.ngcc-feed__item--neutral{--ngcc-feed-color: var(--cds-icon-secondary)}.ngcc-feed__body{flex:1;min-inline-size:0}.ngcc-feed__title{margin:0;font-size:.875rem;color:var(--cds-text-primary)}.ngcc-feed__actor{font-weight:600}.ngcc-feed__description{margin:.25rem 0 0;font-size:.875rem;color:var(--cds-text-secondary)}.ngcc-feed__time{display:block;margin-block-start:.25rem;font-size:.75rem;color:var(--cds-text-helper)}.ngcc-feed__empty{margin:0;padding:1rem 0;font-size:.875rem;color:var(--cds-text-secondary)}\n"] }]
|
|
9402
|
+
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }] } });
|
|
9403
|
+
|
|
9404
|
+
/** Data-driven Carbon structured list (read-only, key/value style rows). */
|
|
9405
|
+
class NgccStructuredList {
|
|
9406
|
+
columns = input([], ...(ngDevMode ? [{ debugName: "columns" }] : []));
|
|
9407
|
+
rows = input([], ...(ngDevMode ? [{ debugName: "rows" }] : []));
|
|
9408
|
+
condensed = input(false, ...(ngDevMode ? [{ debugName: "condensed" }] : []));
|
|
9409
|
+
ariaLabel = input('Structured list', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
9410
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccStructuredList, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9411
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: NgccStructuredList, isStandalone: true, selector: "ngcc-structured-list", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, condensed: { classPropertyName: "condensed", publicName: "condensed", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { styleAttribute: "display: block" }, ngImport: i0, template: `
|
|
9412
|
+
<div
|
|
9413
|
+
[class]="'cds--structured-list' + (condensed() ? ' cds--structured-list--condensed' : '')"
|
|
9414
|
+
role="table"
|
|
9415
|
+
[attr.aria-label]="ariaLabel()"
|
|
9416
|
+
>
|
|
9417
|
+
<div class="cds--structured-list-thead" role="rowgroup">
|
|
9418
|
+
<div class="cds--structured-list-row cds--structured-list-row--header-row" role="row">
|
|
9419
|
+
@for (col of columns(); track col.key) {
|
|
9420
|
+
<div class="cds--structured-list-th" role="columnheader">{{ col.header }}</div>
|
|
9421
|
+
}
|
|
9422
|
+
</div>
|
|
9423
|
+
</div>
|
|
9424
|
+
<div class="cds--structured-list-tbody" role="rowgroup">
|
|
9425
|
+
@for (row of rows(); track row.id ?? $index) {
|
|
9426
|
+
<div class="cds--structured-list-row" role="row">
|
|
9427
|
+
@for (col of columns(); track col.key) {
|
|
9428
|
+
<div class="cds--structured-list-td" role="cell">{{ row[col.key] ?? '' }}</div>
|
|
9429
|
+
}
|
|
9430
|
+
</div>
|
|
9431
|
+
}
|
|
9432
|
+
</div>
|
|
9433
|
+
</div>
|
|
9434
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9435
|
+
}
|
|
9436
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccStructuredList, decorators: [{
|
|
9437
|
+
type: Component,
|
|
9438
|
+
args: [{
|
|
9439
|
+
selector: 'ngcc-structured-list',
|
|
9440
|
+
standalone: true,
|
|
9441
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9442
|
+
host: { style: 'display: block' },
|
|
9443
|
+
template: `
|
|
9444
|
+
<div
|
|
9445
|
+
[class]="'cds--structured-list' + (condensed() ? ' cds--structured-list--condensed' : '')"
|
|
9446
|
+
role="table"
|
|
9447
|
+
[attr.aria-label]="ariaLabel()"
|
|
9448
|
+
>
|
|
9449
|
+
<div class="cds--structured-list-thead" role="rowgroup">
|
|
9450
|
+
<div class="cds--structured-list-row cds--structured-list-row--header-row" role="row">
|
|
9451
|
+
@for (col of columns(); track col.key) {
|
|
9452
|
+
<div class="cds--structured-list-th" role="columnheader">{{ col.header }}</div>
|
|
9453
|
+
}
|
|
9454
|
+
</div>
|
|
9455
|
+
</div>
|
|
9456
|
+
<div class="cds--structured-list-tbody" role="rowgroup">
|
|
9457
|
+
@for (row of rows(); track row.id ?? $index) {
|
|
9458
|
+
<div class="cds--structured-list-row" role="row">
|
|
9459
|
+
@for (col of columns(); track col.key) {
|
|
9460
|
+
<div class="cds--structured-list-td" role="cell">{{ row[col.key] ?? '' }}</div>
|
|
9461
|
+
}
|
|
9462
|
+
</div>
|
|
9463
|
+
}
|
|
9464
|
+
</div>
|
|
9465
|
+
</div>
|
|
9466
|
+
`,
|
|
9467
|
+
}]
|
|
9468
|
+
}], propDecorators: { columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], condensed: [{ type: i0.Input, args: [{ isSignal: true, alias: "condensed", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
9469
|
+
|
|
9470
|
+
/**
|
|
9471
|
+
* Notification list sized for `ngcc-header-panel` (fills its width).
|
|
9472
|
+
* Stateless: the parent owns `items` and updates them in response to
|
|
9473
|
+
* `markRead`, `markAllRead`, `clear` and `dismissed`.
|
|
9474
|
+
*/
|
|
9475
|
+
class NgccNotificationList {
|
|
9476
|
+
items = input([], ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
9477
|
+
heading = input('Notifications', ...(ngDevMode ? [{ debugName: "heading" }] : []));
|
|
9478
|
+
emptyText = input("You're all caught up", ...(ngDevMode ? [{ debugName: "emptyText" }] : []));
|
|
9479
|
+
itemClicked = output();
|
|
9480
|
+
dismissed = output();
|
|
9481
|
+
markAllRead = output();
|
|
9482
|
+
clear = output();
|
|
9483
|
+
unreadCount = computed(() => this.items().filter((i) => !i.read).length, ...(ngDevMode ? [{ debugName: "unreadCount" }] : []));
|
|
9484
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccNotificationList, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9485
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: NgccNotificationList, isStandalone: true, selector: "ngcc-notification-list", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, heading: { classPropertyName: "heading", publicName: "heading", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClicked: "itemClicked", dismissed: "dismissed", markAllRead: "markAllRead", clear: "clear" }, host: { styleAttribute: "display: block" }, ngImport: i0, template: `
|
|
9486
|
+
<div class="ngcc-notif__header">
|
|
9487
|
+
<h2 class="ngcc-notif__heading">
|
|
9488
|
+
{{ heading() }}
|
|
9489
|
+
@if (unreadCount() > 0) {
|
|
9490
|
+
<span class="ngcc-notif__count" [attr.aria-label]="unreadCount() + ' unread'">{{
|
|
9491
|
+
unreadCount()
|
|
9492
|
+
}}</span>
|
|
9493
|
+
}
|
|
9494
|
+
</h2>
|
|
9495
|
+
<div class="ngcc-notif__actions">
|
|
9496
|
+
<button
|
|
9497
|
+
type="button"
|
|
9498
|
+
class="ngcc-notif__link"
|
|
9499
|
+
[disabled]="unreadCount() === 0"
|
|
9500
|
+
(click)="markAllRead.emit()"
|
|
9501
|
+
>
|
|
9502
|
+
Mark all read
|
|
9503
|
+
</button>
|
|
9504
|
+
<button
|
|
9505
|
+
type="button"
|
|
9506
|
+
class="ngcc-notif__link"
|
|
9507
|
+
[disabled]="items().length === 0"
|
|
9508
|
+
(click)="clear.emit()"
|
|
9509
|
+
>
|
|
9510
|
+
Clear all
|
|
9511
|
+
</button>
|
|
9512
|
+
</div>
|
|
9513
|
+
</div>
|
|
9514
|
+
@if (items().length) {
|
|
9515
|
+
<ul class="ngcc-notif__list">
|
|
9516
|
+
@for (item of items(); track item.id) {
|
|
9517
|
+
<li
|
|
9518
|
+
[class]="
|
|
9519
|
+
'ngcc-notif__item ngcc-notif__item--' +
|
|
9520
|
+
(item.severity ?? 'info') +
|
|
9521
|
+
(item.read ? ' ngcc-notif__item--read' : '')
|
|
9522
|
+
"
|
|
9523
|
+
>
|
|
9524
|
+
<button type="button" class="ngcc-notif__main" (click)="itemClicked.emit(item)">
|
|
9525
|
+
@if (!item.read) {
|
|
9526
|
+
<span class="cds--visually-hidden">Unread: </span>
|
|
9527
|
+
}
|
|
9528
|
+
<span class="ngcc-notif__title">{{ item.title }}</span>
|
|
9529
|
+
@if (item.message) {
|
|
9530
|
+
<span class="ngcc-notif__message">{{ item.message }}</span>
|
|
9531
|
+
}
|
|
9532
|
+
@if (item.timestamp) {
|
|
9533
|
+
<span class="ngcc-notif__time">{{ item.timestamp }}</span>
|
|
9534
|
+
}
|
|
9535
|
+
</button>
|
|
9536
|
+
<button
|
|
9537
|
+
type="button"
|
|
9538
|
+
class="ngcc-notif__dismiss"
|
|
9539
|
+
[attr.aria-label]="'Dismiss ' + item.title"
|
|
9540
|
+
(click)="dismissed.emit(item)"
|
|
9541
|
+
>
|
|
9542
|
+
<svg
|
|
9543
|
+
width="16"
|
|
9544
|
+
height="16"
|
|
9545
|
+
viewBox="0 0 32 32"
|
|
9546
|
+
fill="currentColor"
|
|
9547
|
+
aria-hidden="true"
|
|
9548
|
+
>
|
|
9549
|
+
<path
|
|
9550
|
+
d="M24 9.4 22.6 8 16 14.6 9.4 8 8 9.4 14.6 16 8 22.6 9.4 24 16 17.4 22.6 24 24 22.6 17.4 16z"
|
|
9551
|
+
></path>
|
|
9552
|
+
</svg>
|
|
9553
|
+
</button>
|
|
9554
|
+
</li>
|
|
9555
|
+
}
|
|
9556
|
+
</ul>
|
|
9557
|
+
} @else {
|
|
9558
|
+
<p class="ngcc-notif__empty">{{ emptyText() }}</p>
|
|
9559
|
+
}
|
|
9560
|
+
`, isInline: true, styles: [".ngcc-notif__header{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:1rem;border-block-end:1px solid var(--cds-border-subtle-01)}.ngcc-notif__heading{margin:0;font-size:1rem;font-weight:600;color:var(--cds-text-primary)}.ngcc-notif__count{margin-inline-start:.5rem;padding:0 .5rem;border-radius:1rem;font-size:.75rem;font-weight:400;color:var(--cds-text-on-color);background:var(--cds-support-error)}.ngcc-notif__actions{display:flex;gap:.25rem}.ngcc-notif__link{padding:.25rem .5rem;border:0;background:none;font:inherit;font-size:.75rem;color:var(--cds-link-primary);cursor:pointer}.ngcc-notif__link:hover:not(:disabled){text-decoration:underline}.ngcc-notif__link:disabled{color:var(--cds-text-disabled);cursor:not-allowed}.ngcc-notif__link:focus-visible,.ngcc-notif__main:focus-visible,.ngcc-notif__dismiss:focus-visible{outline:2px solid var(--cds-focus);outline-offset:-2px}.ngcc-notif__list{list-style:none;margin:0;padding:0}.ngcc-notif__item{display:flex;align-items:flex-start;border-block-end:1px solid var(--cds-border-subtle-01);border-inline-start:3px solid var(--ngcc-notif-color, transparent)}.ngcc-notif__item--info{--ngcc-notif-color: var(--cds-support-info)}.ngcc-notif__item--success{--ngcc-notif-color: var(--cds-support-success)}.ngcc-notif__item--warning{--ngcc-notif-color: var(--cds-support-warning)}.ngcc-notif__item--error{--ngcc-notif-color: var(--cds-support-error)}.ngcc-notif__item--read{--ngcc-notif-color: transparent}.ngcc-notif__main{flex:1;min-inline-size:0;padding:.75rem .5rem .75rem 1rem;border:0;background:none;text-align:start;font:inherit;color:var(--cds-text-primary);cursor:pointer}.ngcc-notif__main:hover{background:var(--cds-layer-hover-01)}.ngcc-notif__title{display:block;font-size:.875rem;font-weight:600}.ngcc-notif__item--read .ngcc-notif__title{font-weight:400}.ngcc-notif__message{display:block;margin-block-start:.25rem;font-size:.875rem;color:var(--cds-text-secondary)}.ngcc-notif__time{display:block;margin-block-start:.25rem;font-size:.75rem;color:var(--cds-text-helper)}.ngcc-notif__dismiss{flex:none;margin:.5rem .5rem 0 0;padding:.25rem;border:0;background:none;color:var(--cds-icon-secondary);cursor:pointer;line-height:0}.ngcc-notif__empty{margin:0;padding:2rem 1rem;text-align:center;font-size:.875rem;color:var(--cds-text-secondary)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9561
|
+
}
|
|
9562
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccNotificationList, decorators: [{
|
|
9563
|
+
type: Component,
|
|
9564
|
+
args: [{ selector: 'ngcc-notification-list', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: { style: 'display: block' }, template: `
|
|
9565
|
+
<div class="ngcc-notif__header">
|
|
9566
|
+
<h2 class="ngcc-notif__heading">
|
|
9567
|
+
{{ heading() }}
|
|
9568
|
+
@if (unreadCount() > 0) {
|
|
9569
|
+
<span class="ngcc-notif__count" [attr.aria-label]="unreadCount() + ' unread'">{{
|
|
9570
|
+
unreadCount()
|
|
9571
|
+
}}</span>
|
|
9572
|
+
}
|
|
9573
|
+
</h2>
|
|
9574
|
+
<div class="ngcc-notif__actions">
|
|
9575
|
+
<button
|
|
9576
|
+
type="button"
|
|
9577
|
+
class="ngcc-notif__link"
|
|
9578
|
+
[disabled]="unreadCount() === 0"
|
|
9579
|
+
(click)="markAllRead.emit()"
|
|
9580
|
+
>
|
|
9581
|
+
Mark all read
|
|
9582
|
+
</button>
|
|
9583
|
+
<button
|
|
9584
|
+
type="button"
|
|
9585
|
+
class="ngcc-notif__link"
|
|
9586
|
+
[disabled]="items().length === 0"
|
|
9587
|
+
(click)="clear.emit()"
|
|
9588
|
+
>
|
|
9589
|
+
Clear all
|
|
9590
|
+
</button>
|
|
9591
|
+
</div>
|
|
9592
|
+
</div>
|
|
9593
|
+
@if (items().length) {
|
|
9594
|
+
<ul class="ngcc-notif__list">
|
|
9595
|
+
@for (item of items(); track item.id) {
|
|
9596
|
+
<li
|
|
9597
|
+
[class]="
|
|
9598
|
+
'ngcc-notif__item ngcc-notif__item--' +
|
|
9599
|
+
(item.severity ?? 'info') +
|
|
9600
|
+
(item.read ? ' ngcc-notif__item--read' : '')
|
|
9601
|
+
"
|
|
9602
|
+
>
|
|
9603
|
+
<button type="button" class="ngcc-notif__main" (click)="itemClicked.emit(item)">
|
|
9604
|
+
@if (!item.read) {
|
|
9605
|
+
<span class="cds--visually-hidden">Unread: </span>
|
|
9606
|
+
}
|
|
9607
|
+
<span class="ngcc-notif__title">{{ item.title }}</span>
|
|
9608
|
+
@if (item.message) {
|
|
9609
|
+
<span class="ngcc-notif__message">{{ item.message }}</span>
|
|
9610
|
+
}
|
|
9611
|
+
@if (item.timestamp) {
|
|
9612
|
+
<span class="ngcc-notif__time">{{ item.timestamp }}</span>
|
|
9613
|
+
}
|
|
9614
|
+
</button>
|
|
9615
|
+
<button
|
|
9616
|
+
type="button"
|
|
9617
|
+
class="ngcc-notif__dismiss"
|
|
9618
|
+
[attr.aria-label]="'Dismiss ' + item.title"
|
|
9619
|
+
(click)="dismissed.emit(item)"
|
|
9620
|
+
>
|
|
9621
|
+
<svg
|
|
9622
|
+
width="16"
|
|
9623
|
+
height="16"
|
|
9624
|
+
viewBox="0 0 32 32"
|
|
9625
|
+
fill="currentColor"
|
|
9626
|
+
aria-hidden="true"
|
|
9627
|
+
>
|
|
9628
|
+
<path
|
|
9629
|
+
d="M24 9.4 22.6 8 16 14.6 9.4 8 8 9.4 14.6 16 8 22.6 9.4 24 16 17.4 22.6 24 24 22.6 17.4 16z"
|
|
9630
|
+
></path>
|
|
9631
|
+
</svg>
|
|
9632
|
+
</button>
|
|
9633
|
+
</li>
|
|
9634
|
+
}
|
|
9635
|
+
</ul>
|
|
9636
|
+
} @else {
|
|
9637
|
+
<p class="ngcc-notif__empty">{{ emptyText() }}</p>
|
|
9638
|
+
}
|
|
9639
|
+
`, styles: [".ngcc-notif__header{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:1rem;border-block-end:1px solid var(--cds-border-subtle-01)}.ngcc-notif__heading{margin:0;font-size:1rem;font-weight:600;color:var(--cds-text-primary)}.ngcc-notif__count{margin-inline-start:.5rem;padding:0 .5rem;border-radius:1rem;font-size:.75rem;font-weight:400;color:var(--cds-text-on-color);background:var(--cds-support-error)}.ngcc-notif__actions{display:flex;gap:.25rem}.ngcc-notif__link{padding:.25rem .5rem;border:0;background:none;font:inherit;font-size:.75rem;color:var(--cds-link-primary);cursor:pointer}.ngcc-notif__link:hover:not(:disabled){text-decoration:underline}.ngcc-notif__link:disabled{color:var(--cds-text-disabled);cursor:not-allowed}.ngcc-notif__link:focus-visible,.ngcc-notif__main:focus-visible,.ngcc-notif__dismiss:focus-visible{outline:2px solid var(--cds-focus);outline-offset:-2px}.ngcc-notif__list{list-style:none;margin:0;padding:0}.ngcc-notif__item{display:flex;align-items:flex-start;border-block-end:1px solid var(--cds-border-subtle-01);border-inline-start:3px solid var(--ngcc-notif-color, transparent)}.ngcc-notif__item--info{--ngcc-notif-color: var(--cds-support-info)}.ngcc-notif__item--success{--ngcc-notif-color: var(--cds-support-success)}.ngcc-notif__item--warning{--ngcc-notif-color: var(--cds-support-warning)}.ngcc-notif__item--error{--ngcc-notif-color: var(--cds-support-error)}.ngcc-notif__item--read{--ngcc-notif-color: transparent}.ngcc-notif__main{flex:1;min-inline-size:0;padding:.75rem .5rem .75rem 1rem;border:0;background:none;text-align:start;font:inherit;color:var(--cds-text-primary);cursor:pointer}.ngcc-notif__main:hover{background:var(--cds-layer-hover-01)}.ngcc-notif__title{display:block;font-size:.875rem;font-weight:600}.ngcc-notif__item--read .ngcc-notif__title{font-weight:400}.ngcc-notif__message{display:block;margin-block-start:.25rem;font-size:.875rem;color:var(--cds-text-secondary)}.ngcc-notif__time{display:block;margin-block-start:.25rem;font-size:.75rem;color:var(--cds-text-helper)}.ngcc-notif__dismiss{flex:none;margin:.5rem .5rem 0 0;padding:.25rem;border:0;background:none;color:var(--cds-icon-secondary);cursor:pointer;line-height:0}.ngcc-notif__empty{margin:0;padding:2rem 1rem;text-align:center;font-size:.875rem;color:var(--cds-text-secondary)}\n"] }]
|
|
9640
|
+
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], heading: [{ type: i0.Input, args: [{ isSignal: true, alias: "heading", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], itemClicked: [{ type: i0.Output, args: ["itemClicked"] }], dismissed: [{ type: i0.Output, args: ["dismissed"] }], markAllRead: [{ type: i0.Output, args: ["markAllRead"] }], clear: [{ type: i0.Output, args: ["clear"] }] } });
|
|
9641
|
+
|
|
9642
|
+
const day = (d, offset = 0) => new Date(d.getFullYear(), d.getMonth(), d.getDate() + offset);
|
|
9643
|
+
const NGCC_DEFAULT_DATE_PRESETS = [
|
|
9644
|
+
{ key: 'today', label: 'Today', range: (t) => ({ start: day(t), end: day(t) }) },
|
|
9645
|
+
{ key: 'last-7-days', label: 'Last 7 days', range: (t) => ({ start: day(t, -6), end: day(t) }) },
|
|
9646
|
+
{
|
|
9647
|
+
key: 'last-30-days',
|
|
9648
|
+
label: 'Last 30 days',
|
|
9649
|
+
range: (t) => ({ start: day(t, -29), end: day(t) }),
|
|
9650
|
+
},
|
|
9651
|
+
{
|
|
9652
|
+
key: 'this-month',
|
|
9653
|
+
label: 'This month',
|
|
9654
|
+
range: (t) => ({
|
|
9655
|
+
start: new Date(t.getFullYear(), t.getMonth(), 1),
|
|
9656
|
+
end: new Date(t.getFullYear(), t.getMonth() + 1, 0),
|
|
9657
|
+
}),
|
|
9658
|
+
},
|
|
9659
|
+
{
|
|
9660
|
+
key: 'last-month',
|
|
9661
|
+
label: 'Last month',
|
|
9662
|
+
range: (t) => ({
|
|
9663
|
+
start: new Date(t.getFullYear(), t.getMonth() - 1, 1),
|
|
9664
|
+
end: new Date(t.getFullYear(), t.getMonth(), 0),
|
|
9665
|
+
}),
|
|
9666
|
+
},
|
|
9667
|
+
{ key: 'custom', label: 'Custom range' },
|
|
9668
|
+
];
|
|
9669
|
+
/** Resolves a preset key to a concrete range, e.g. to seed `[(value)]`. */
|
|
9670
|
+
function ngccResolveDatePreset(key, today = new Date(), presets = NGCC_DEFAULT_DATE_PRESETS) {
|
|
9671
|
+
const range = presets.find((p) => p.key === key)?.range?.(today);
|
|
9672
|
+
return { start: range?.start ?? null, end: range?.end ?? null, preset: key };
|
|
9673
|
+
}
|
|
9674
|
+
const toIso = (d) => d
|
|
9675
|
+
? `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`
|
|
9676
|
+
: '';
|
|
9677
|
+
const fromIso = (s) => {
|
|
9678
|
+
const [y, m, d] = s.split('-').map(Number);
|
|
9679
|
+
return y && m && d ? new Date(y, m - 1, d) : null;
|
|
9680
|
+
};
|
|
9681
|
+
/**
|
|
9682
|
+
* Date-range picker with presets. Choosing "Custom range" reveals start/end date
|
|
9683
|
+
* inputs; the model only updates once both dates are set and start <= end.
|
|
9684
|
+
*/
|
|
9685
|
+
class NgccDateRangePicker {
|
|
9686
|
+
static nextId = 0;
|
|
9687
|
+
id = `ngcc-drp-${NgccDateRangePicker.nextId++}`;
|
|
9688
|
+
value = model({ start: null, end: null, preset: '' }, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
9689
|
+
presets = input(NGCC_DEFAULT_DATE_PRESETS, ...(ngDevMode ? [{ debugName: "presets" }] : []));
|
|
9690
|
+
label = input('Date range', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
9691
|
+
placeholder = input('Select a range', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
9692
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
9693
|
+
minDate = input(null, ...(ngDevMode ? [{ debugName: "minDate" }] : []));
|
|
9694
|
+
maxDate = input(null, ...(ngDevMode ? [{ debugName: "maxDate" }] : []));
|
|
9695
|
+
/** "Today" used to resolve presets; override for tests/SSR. */
|
|
9696
|
+
today = input(undefined, ...(ngDevMode ? [{ debugName: "today" }] : []));
|
|
9697
|
+
min = computed(() => toIso(this.minDate()) || null, ...(ngDevMode ? [{ debugName: "min" }] : []));
|
|
9698
|
+
max = computed(() => toIso(this.maxDate()) || null, ...(ngDevMode ? [{ debugName: "max" }] : []));
|
|
9699
|
+
isCustom = computed(() => {
|
|
9700
|
+
const preset = this.presets().find((p) => p.key === this.value().preset);
|
|
9701
|
+
return !!preset && !preset.range;
|
|
9702
|
+
}, ...(ngDevMode ? [{ debugName: "isCustom" }] : []));
|
|
9703
|
+
startText = linkedSignal(() => toIso(this.value().start), ...(ngDevMode ? [{ debugName: "startText" }] : []));
|
|
9704
|
+
endText = linkedSignal(() => toIso(this.value().end), ...(ngDevMode ? [{ debugName: "endText" }] : []));
|
|
9705
|
+
invalid = computed(() => !!this.startText() && !!this.endText() && this.endText() < this.startText(), ...(ngDevMode ? [{ debugName: "invalid" }] : []));
|
|
9706
|
+
onPreset(key) {
|
|
9707
|
+
const preset = this.presets().find((p) => p.key === key);
|
|
9708
|
+
if (!preset)
|
|
9709
|
+
return;
|
|
9710
|
+
if (preset.range) {
|
|
9711
|
+
this.value.set({ ...preset.range(this.today() ?? new Date()), preset: key });
|
|
9712
|
+
}
|
|
9713
|
+
else {
|
|
9714
|
+
this.value.update((v) => ({ ...v, preset: key }));
|
|
9715
|
+
}
|
|
9716
|
+
}
|
|
9717
|
+
onCustom(which, text) {
|
|
9718
|
+
(which === 'start' ? this.startText : this.endText).set(text);
|
|
9719
|
+
const start = fromIso(this.startText());
|
|
9720
|
+
const end = fromIso(this.endText());
|
|
9721
|
+
if (start && end && !this.invalid()) {
|
|
9722
|
+
this.value.set({ start, end, preset: this.value().preset });
|
|
9723
|
+
}
|
|
9724
|
+
}
|
|
9725
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccDateRangePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9726
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: NgccDateRangePicker, isStandalone: true, selector: "ngcc-date-range-picker", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, presets: { classPropertyName: "presets", publicName: "presets", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, today: { classPropertyName: "today", publicName: "today", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { styleAttribute: "display: block" }, ngImport: i0, template: `
|
|
9727
|
+
<fieldset class="ngcc-drp" [disabled]="disabled()">
|
|
9728
|
+
@if (label()) {
|
|
9729
|
+
<legend class="cds--label">{{ label() }}</legend>
|
|
9730
|
+
}
|
|
9731
|
+
<div class="cds--select">
|
|
9732
|
+
<div class="cds--select-input__wrapper">
|
|
9733
|
+
<select
|
|
9734
|
+
class="cds--select-input"
|
|
9735
|
+
[attr.aria-label]="label() || 'Date range'"
|
|
9736
|
+
(change)="onPreset($any($event.target).value)"
|
|
9737
|
+
>
|
|
9738
|
+
@if (!value().preset) {
|
|
9739
|
+
<option value="" selected disabled hidden>{{ placeholder() }}</option>
|
|
9740
|
+
}
|
|
9741
|
+
@for (p of presets(); track p.key) {
|
|
9742
|
+
<option [value]="p.key" [selected]="p.key === value().preset">{{ p.label }}</option>
|
|
9743
|
+
}
|
|
9744
|
+
</select>
|
|
9745
|
+
<svg
|
|
9746
|
+
class="cds--select__arrow"
|
|
9747
|
+
width="16"
|
|
9748
|
+
height="16"
|
|
9749
|
+
viewBox="0 0 16 16"
|
|
9750
|
+
fill="currentColor"
|
|
9751
|
+
aria-hidden="true"
|
|
9752
|
+
>
|
|
9753
|
+
<path d="M8 11 3 6l.7-.7L8 9.6l4.3-4.3.7.7z"></path>
|
|
9754
|
+
</svg>
|
|
9755
|
+
</div>
|
|
9756
|
+
</div>
|
|
9757
|
+
@if (isCustom()) {
|
|
9758
|
+
<div class="ngcc-drp__custom">
|
|
9759
|
+
<div class="cds--form-item ngcc-drp__field">
|
|
9760
|
+
<label class="cds--label" [attr.for]="id + '-start'">Start date</label>
|
|
9761
|
+
<input
|
|
9762
|
+
type="date"
|
|
9763
|
+
class="cds--text-input"
|
|
9764
|
+
[id]="id + '-start'"
|
|
9765
|
+
[value]="startText()"
|
|
9766
|
+
[attr.min]="min()"
|
|
9767
|
+
[attr.max]="max()"
|
|
9768
|
+
[attr.aria-invalid]="invalid() || null"
|
|
9769
|
+
(change)="onCustom('start', $any($event.target).value)"
|
|
9770
|
+
/>
|
|
9771
|
+
</div>
|
|
9772
|
+
<div class="cds--form-item ngcc-drp__field">
|
|
9773
|
+
<label class="cds--label" [attr.for]="id + '-end'">End date</label>
|
|
9774
|
+
<input
|
|
9775
|
+
type="date"
|
|
9776
|
+
class="cds--text-input"
|
|
9777
|
+
[id]="id + '-end'"
|
|
9778
|
+
[value]="endText()"
|
|
9779
|
+
[attr.min]="startText() || min()"
|
|
9780
|
+
[attr.max]="max()"
|
|
9781
|
+
[attr.aria-invalid]="invalid() || null"
|
|
9782
|
+
(change)="onCustom('end', $any($event.target).value)"
|
|
9783
|
+
/>
|
|
9784
|
+
</div>
|
|
9785
|
+
</div>
|
|
9786
|
+
@if (invalid()) {
|
|
9787
|
+
<div class="cds--form-requirement" role="alert" style="display: block; max-height: none">
|
|
9788
|
+
End date must be on or after the start date.
|
|
9789
|
+
</div>
|
|
9790
|
+
}
|
|
9791
|
+
}
|
|
9792
|
+
</fieldset>
|
|
9793
|
+
`, isInline: true, styles: [".ngcc-drp{border:0;margin:0;padding:0}.ngcc-drp__custom{display:flex;flex-wrap:wrap;gap:1rem;margin-block-start:1rem}.ngcc-drp__field{flex:1 1 10rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9794
|
+
}
|
|
9795
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccDateRangePicker, decorators: [{
|
|
9796
|
+
type: Component,
|
|
9797
|
+
args: [{ selector: 'ngcc-date-range-picker', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: { style: 'display: block' }, template: `
|
|
9798
|
+
<fieldset class="ngcc-drp" [disabled]="disabled()">
|
|
9799
|
+
@if (label()) {
|
|
9800
|
+
<legend class="cds--label">{{ label() }}</legend>
|
|
9801
|
+
}
|
|
9802
|
+
<div class="cds--select">
|
|
9803
|
+
<div class="cds--select-input__wrapper">
|
|
9804
|
+
<select
|
|
9805
|
+
class="cds--select-input"
|
|
9806
|
+
[attr.aria-label]="label() || 'Date range'"
|
|
9807
|
+
(change)="onPreset($any($event.target).value)"
|
|
9808
|
+
>
|
|
9809
|
+
@if (!value().preset) {
|
|
9810
|
+
<option value="" selected disabled hidden>{{ placeholder() }}</option>
|
|
9811
|
+
}
|
|
9812
|
+
@for (p of presets(); track p.key) {
|
|
9813
|
+
<option [value]="p.key" [selected]="p.key === value().preset">{{ p.label }}</option>
|
|
9814
|
+
}
|
|
9815
|
+
</select>
|
|
9816
|
+
<svg
|
|
9817
|
+
class="cds--select__arrow"
|
|
9818
|
+
width="16"
|
|
9819
|
+
height="16"
|
|
9820
|
+
viewBox="0 0 16 16"
|
|
9821
|
+
fill="currentColor"
|
|
9822
|
+
aria-hidden="true"
|
|
9823
|
+
>
|
|
9824
|
+
<path d="M8 11 3 6l.7-.7L8 9.6l4.3-4.3.7.7z"></path>
|
|
9825
|
+
</svg>
|
|
9826
|
+
</div>
|
|
9827
|
+
</div>
|
|
9828
|
+
@if (isCustom()) {
|
|
9829
|
+
<div class="ngcc-drp__custom">
|
|
9830
|
+
<div class="cds--form-item ngcc-drp__field">
|
|
9831
|
+
<label class="cds--label" [attr.for]="id + '-start'">Start date</label>
|
|
9832
|
+
<input
|
|
9833
|
+
type="date"
|
|
9834
|
+
class="cds--text-input"
|
|
9835
|
+
[id]="id + '-start'"
|
|
9836
|
+
[value]="startText()"
|
|
9837
|
+
[attr.min]="min()"
|
|
9838
|
+
[attr.max]="max()"
|
|
9839
|
+
[attr.aria-invalid]="invalid() || null"
|
|
9840
|
+
(change)="onCustom('start', $any($event.target).value)"
|
|
9841
|
+
/>
|
|
9842
|
+
</div>
|
|
9843
|
+
<div class="cds--form-item ngcc-drp__field">
|
|
9844
|
+
<label class="cds--label" [attr.for]="id + '-end'">End date</label>
|
|
9845
|
+
<input
|
|
9846
|
+
type="date"
|
|
9847
|
+
class="cds--text-input"
|
|
9848
|
+
[id]="id + '-end'"
|
|
9849
|
+
[value]="endText()"
|
|
9850
|
+
[attr.min]="startText() || min()"
|
|
9851
|
+
[attr.max]="max()"
|
|
9852
|
+
[attr.aria-invalid]="invalid() || null"
|
|
9853
|
+
(change)="onCustom('end', $any($event.target).value)"
|
|
9854
|
+
/>
|
|
9855
|
+
</div>
|
|
9856
|
+
</div>
|
|
9857
|
+
@if (invalid()) {
|
|
9858
|
+
<div class="cds--form-requirement" role="alert" style="display: block; max-height: none">
|
|
9859
|
+
End date must be on or after the start date.
|
|
9860
|
+
</div>
|
|
9861
|
+
}
|
|
9862
|
+
}
|
|
9863
|
+
</fieldset>
|
|
9864
|
+
`, styles: [".ngcc-drp{border:0;margin:0;padding:0}.ngcc-drp__custom{display:flex;flex-wrap:wrap;gap:1rem;margin-block-start:1rem}.ngcc-drp__field{flex:1 1 10rem}\n"] }]
|
|
9865
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], presets: [{ type: i0.Input, args: [{ isSignal: true, alias: "presets", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], today: [{ type: i0.Input, args: [{ isSignal: true, alias: "today", required: false }] }] } });
|
|
9866
|
+
|
|
9867
|
+
/**
|
|
9868
|
+
* Filter bar: a search input that is also a combobox. Typing narrows a list of
|
|
9869
|
+
* `Field: Option` suggestions; picking one adds a dismissible chip. The free-text
|
|
9870
|
+
* `query` and the chips are both part of the two-way `value`.
|
|
9871
|
+
*/
|
|
9872
|
+
class NgccFilterBar {
|
|
9873
|
+
static nextId = 0;
|
|
9874
|
+
listId = `ngcc-fb-list-${NgccFilterBar.nextId++}`;
|
|
9875
|
+
value = model({ query: '', filters: {} }, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
9876
|
+
fields = input([], ...(ngDevMode ? [{ debugName: "fields" }] : []));
|
|
9877
|
+
placeholder = input('Search or filter', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
9878
|
+
ariaLabel = input('Search and filter', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
9879
|
+
maxSuggestions = input(8, ...(ngDevMode ? [{ debugName: "maxSuggestions" }] : []));
|
|
9880
|
+
open = signal(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
9881
|
+
active = signal(-1, ...(ngDevMode ? [{ debugName: "active" }] : []));
|
|
9882
|
+
chips = computed(() => this.fields().flatMap((field) => (this.value().filters[field.key] ?? [])
|
|
9883
|
+
.map((v) => field.options.find((o) => o.value === v))
|
|
9884
|
+
.filter((o) => !!o)
|
|
9885
|
+
.map((option) => ({ field, option }))), ...(ngDevMode ? [{ debugName: "chips" }] : []));
|
|
9886
|
+
suggestions = computed(() => {
|
|
9887
|
+
const q = this.value().query.trim().toLowerCase();
|
|
9888
|
+
const selected = this.value().filters;
|
|
9889
|
+
return this.fields()
|
|
9890
|
+
.flatMap((field) => field.options
|
|
9891
|
+
.filter((o) => !selected[field.key]?.includes(o.value))
|
|
9892
|
+
.map((option) => ({ field, option })))
|
|
9893
|
+
.filter((s) => !q || `${s.field.label} ${s.option.label}`.toLowerCase().includes(q))
|
|
9894
|
+
.slice(0, this.maxSuggestions());
|
|
9895
|
+
}, ...(ngDevMode ? [{ debugName: "suggestions" }] : []));
|
|
9896
|
+
showList = computed(() => this.open() && this.suggestions().length > 0, ...(ngDevMode ? [{ debugName: "showList" }] : []));
|
|
9897
|
+
hasAny = computed(() => !!this.value().query || this.chips().length > 0, ...(ngDevMode ? [{ debugName: "hasAny" }] : []));
|
|
9898
|
+
activeId = computed(() => this.showList() && this.active() >= 0 ? this.optionId(this.active()) : null, ...(ngDevMode ? [{ debugName: "activeId" }] : []));
|
|
9899
|
+
optionId(i) {
|
|
9900
|
+
return `${this.listId}-opt-${i}`;
|
|
9901
|
+
}
|
|
9902
|
+
onInput(query) {
|
|
9903
|
+
this.value.update((v) => ({ ...v, query }));
|
|
9904
|
+
this.open.set(true);
|
|
9905
|
+
this.active.set(-1);
|
|
9906
|
+
}
|
|
9907
|
+
add(s) {
|
|
9908
|
+
this.value.update((v) => ({
|
|
9909
|
+
query: '',
|
|
9910
|
+
filters: { ...v.filters, [s.field.key]: [...(v.filters[s.field.key] ?? []), s.option.value] },
|
|
9911
|
+
}));
|
|
9912
|
+
this.active.set(-1);
|
|
9913
|
+
}
|
|
9914
|
+
remove(s) {
|
|
9915
|
+
this.value.update((v) => {
|
|
9916
|
+
const left = (v.filters[s.field.key] ?? []).filter((x) => x !== s.option.value);
|
|
9917
|
+
const filters = { ...v.filters };
|
|
9918
|
+
if (left.length)
|
|
9919
|
+
filters[s.field.key] = left;
|
|
9920
|
+
else
|
|
9921
|
+
delete filters[s.field.key];
|
|
9922
|
+
return { ...v, filters };
|
|
9923
|
+
});
|
|
9924
|
+
}
|
|
9925
|
+
clearAll() {
|
|
9926
|
+
this.value.set({ query: '', filters: {} });
|
|
9927
|
+
this.active.set(-1);
|
|
9928
|
+
}
|
|
9929
|
+
onKeydown(ev) {
|
|
9930
|
+
const n = this.suggestions().length;
|
|
9931
|
+
switch (ev.key) {
|
|
9932
|
+
case 'ArrowDown':
|
|
9933
|
+
case 'ArrowUp': {
|
|
9934
|
+
if (!n)
|
|
9935
|
+
return;
|
|
9936
|
+
ev.preventDefault();
|
|
9937
|
+
this.open.set(true);
|
|
9938
|
+
const step = ev.key === 'ArrowDown' ? 1 : -1;
|
|
9939
|
+
this.active.update((i) => (i < 0 ? (step > 0 ? 0 : n - 1) : (i + step + n) % n));
|
|
9940
|
+
break;
|
|
9941
|
+
}
|
|
9942
|
+
case 'Enter': {
|
|
9943
|
+
const s = this.showList() ? this.suggestions()[this.active()] : undefined;
|
|
9944
|
+
if (s) {
|
|
9945
|
+
ev.preventDefault();
|
|
9946
|
+
this.add(s);
|
|
9947
|
+
}
|
|
9948
|
+
break;
|
|
9949
|
+
}
|
|
9950
|
+
case 'Escape':
|
|
9951
|
+
if (this.open()) {
|
|
9952
|
+
this.open.set(false);
|
|
9953
|
+
ev.preventDefault();
|
|
9954
|
+
}
|
|
9955
|
+
else if (this.value().query) {
|
|
9956
|
+
this.onInput('');
|
|
9957
|
+
this.open.set(false);
|
|
9958
|
+
}
|
|
9959
|
+
break;
|
|
9960
|
+
case 'Backspace': {
|
|
9961
|
+
const chips = this.chips();
|
|
9962
|
+
if (!this.value().query && chips.length)
|
|
9963
|
+
this.remove(chips[chips.length - 1]);
|
|
9964
|
+
break;
|
|
9965
|
+
}
|
|
9966
|
+
}
|
|
9967
|
+
}
|
|
9968
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccFilterBar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9969
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: NgccFilterBar, isStandalone: true, selector: "ngcc-filter-bar", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, fields: { classPropertyName: "fields", publicName: "fields", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, maxSuggestions: { classPropertyName: "maxSuggestions", publicName: "maxSuggestions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { styleAttribute: "display: block; position: relative" }, ngImport: i0, template: `
|
|
9970
|
+
<div class="ngcc-fb">
|
|
9971
|
+
<div class="ngcc-fb__box">
|
|
9972
|
+
@for (chip of chips(); track chip.field.key + chip.option.value) {
|
|
9973
|
+
<ngcc-tag
|
|
9974
|
+
type="gray"
|
|
9975
|
+
[dismissible]="true"
|
|
9976
|
+
[dismissLabel]="'Remove filter ' + chip.field.label + ': ' + chip.option.label"
|
|
9977
|
+
(dismissed)="remove(chip)"
|
|
9978
|
+
>{{ chip.field.label }}: {{ chip.option.label }}</ngcc-tag
|
|
9979
|
+
>
|
|
9980
|
+
}
|
|
9981
|
+
<input
|
|
9982
|
+
type="text"
|
|
9983
|
+
class="ngcc-fb__input"
|
|
9984
|
+
role="combobox"
|
|
9985
|
+
aria-autocomplete="list"
|
|
9986
|
+
autocomplete="off"
|
|
9987
|
+
[attr.aria-label]="ariaLabel()"
|
|
9988
|
+
[attr.aria-expanded]="showList()"
|
|
9989
|
+
[attr.aria-controls]="listId"
|
|
9990
|
+
[attr.aria-activedescendant]="activeId()"
|
|
9991
|
+
[placeholder]="placeholder()"
|
|
9992
|
+
[value]="value().query"
|
|
9993
|
+
(input)="onInput($any($event.target).value)"
|
|
9994
|
+
(focus)="open.set(true)"
|
|
9995
|
+
(blur)="open.set(false)"
|
|
9996
|
+
(keydown)="onKeydown($event)"
|
|
9997
|
+
/>
|
|
9998
|
+
</div>
|
|
9999
|
+
@if (hasAny()) {
|
|
10000
|
+
<button type="button" class="ngcc-fb__clear" (click)="clearAll()">Clear all</button>
|
|
10001
|
+
}
|
|
10002
|
+
</div>
|
|
10003
|
+
<ul
|
|
10004
|
+
class="ngcc-fb__list"
|
|
10005
|
+
role="listbox"
|
|
10006
|
+
[id]="listId"
|
|
10007
|
+
[attr.aria-label]="'Filter suggestions'"
|
|
10008
|
+
[hidden]="!showList()"
|
|
10009
|
+
>
|
|
10010
|
+
@for (s of suggestions(); track s.field.key + s.option.value; let i = $index) {
|
|
10011
|
+
<li
|
|
10012
|
+
role="option"
|
|
10013
|
+
[id]="optionId(i)"
|
|
10014
|
+
[class]="'ngcc-fb__option' + (i === active() ? ' ngcc-fb__option--active' : '')"
|
|
10015
|
+
[attr.aria-selected]="i === active()"
|
|
10016
|
+
(mousedown)="$event.preventDefault(); add(s)"
|
|
10017
|
+
>
|
|
10018
|
+
<span class="ngcc-fb__field">{{ s.field.label }}:</span> {{ s.option.label }}
|
|
10019
|
+
</li>
|
|
10020
|
+
}
|
|
10021
|
+
</ul>
|
|
10022
|
+
`, isInline: true, styles: [".ngcc-fb{display:flex;align-items:center;gap:.5rem}.ngcc-fb__box{flex:1;display:flex;flex-wrap:wrap;align-items:center;gap:.25rem;min-block-size:2.5rem;padding:0 1rem;background:var(--cds-field);border-block-end:1px solid var(--cds-border-strong);color:var(--cds-text-primary)}.ngcc-fb__box:focus-within{outline:2px solid var(--cds-focus);outline-offset:-2px}.ngcc-fb__input{flex:1;min-inline-size:8rem;block-size:2.5rem;padding:0;border:0;background:none;font:inherit;font-size:.875rem;color:inherit;outline:none}.ngcc-fb__input::placeholder{color:var(--cds-text-placeholder)}.ngcc-fb__clear{padding:.5rem;border:0;background:none;font:inherit;font-size:.875rem;color:var(--cds-link-primary);cursor:pointer}.ngcc-fb__clear:focus-visible{outline:2px solid var(--cds-focus)}.ngcc-fb__list{position:absolute;inset-inline:0;z-index:var(--cds-layer-overlay, 9000);max-block-size:15rem;margin:0;padding:0;overflow-y:auto;list-style:none;background:var(--cds-layer-01);box-shadow:0 2px 6px #0000004d}.ngcc-fb__option{padding:.75rem 1rem;font-size:.875rem;color:var(--cds-text-primary);cursor:pointer}.ngcc-fb__option--active,.ngcc-fb__option:hover{background:var(--cds-layer-hover-01)}.ngcc-fb__field{color:var(--cds-text-secondary)}\n"], dependencies: [{ kind: "component", type: NgccTag, selector: "ngcc-tag", inputs: ["type", "size", "dot", "dismissible", "disabled", "dismissLabel"], outputs: ["dismissed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
10023
|
+
}
|
|
10024
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccFilterBar, decorators: [{
|
|
10025
|
+
type: Component,
|
|
10026
|
+
args: [{ selector: 'ngcc-filter-bar', standalone: true, imports: [NgccTag], changeDetection: ChangeDetectionStrategy.OnPush, host: { style: 'display: block; position: relative' }, template: `
|
|
10027
|
+
<div class="ngcc-fb">
|
|
10028
|
+
<div class="ngcc-fb__box">
|
|
10029
|
+
@for (chip of chips(); track chip.field.key + chip.option.value) {
|
|
10030
|
+
<ngcc-tag
|
|
10031
|
+
type="gray"
|
|
10032
|
+
[dismissible]="true"
|
|
10033
|
+
[dismissLabel]="'Remove filter ' + chip.field.label + ': ' + chip.option.label"
|
|
10034
|
+
(dismissed)="remove(chip)"
|
|
10035
|
+
>{{ chip.field.label }}: {{ chip.option.label }}</ngcc-tag
|
|
10036
|
+
>
|
|
10037
|
+
}
|
|
10038
|
+
<input
|
|
10039
|
+
type="text"
|
|
10040
|
+
class="ngcc-fb__input"
|
|
10041
|
+
role="combobox"
|
|
10042
|
+
aria-autocomplete="list"
|
|
10043
|
+
autocomplete="off"
|
|
10044
|
+
[attr.aria-label]="ariaLabel()"
|
|
10045
|
+
[attr.aria-expanded]="showList()"
|
|
10046
|
+
[attr.aria-controls]="listId"
|
|
10047
|
+
[attr.aria-activedescendant]="activeId()"
|
|
10048
|
+
[placeholder]="placeholder()"
|
|
10049
|
+
[value]="value().query"
|
|
10050
|
+
(input)="onInput($any($event.target).value)"
|
|
10051
|
+
(focus)="open.set(true)"
|
|
10052
|
+
(blur)="open.set(false)"
|
|
10053
|
+
(keydown)="onKeydown($event)"
|
|
10054
|
+
/>
|
|
10055
|
+
</div>
|
|
10056
|
+
@if (hasAny()) {
|
|
10057
|
+
<button type="button" class="ngcc-fb__clear" (click)="clearAll()">Clear all</button>
|
|
10058
|
+
}
|
|
10059
|
+
</div>
|
|
10060
|
+
<ul
|
|
10061
|
+
class="ngcc-fb__list"
|
|
10062
|
+
role="listbox"
|
|
10063
|
+
[id]="listId"
|
|
10064
|
+
[attr.aria-label]="'Filter suggestions'"
|
|
10065
|
+
[hidden]="!showList()"
|
|
10066
|
+
>
|
|
10067
|
+
@for (s of suggestions(); track s.field.key + s.option.value; let i = $index) {
|
|
10068
|
+
<li
|
|
10069
|
+
role="option"
|
|
10070
|
+
[id]="optionId(i)"
|
|
10071
|
+
[class]="'ngcc-fb__option' + (i === active() ? ' ngcc-fb__option--active' : '')"
|
|
10072
|
+
[attr.aria-selected]="i === active()"
|
|
10073
|
+
(mousedown)="$event.preventDefault(); add(s)"
|
|
10074
|
+
>
|
|
10075
|
+
<span class="ngcc-fb__field">{{ s.field.label }}:</span> {{ s.option.label }}
|
|
10076
|
+
</li>
|
|
10077
|
+
}
|
|
10078
|
+
</ul>
|
|
10079
|
+
`, styles: [".ngcc-fb{display:flex;align-items:center;gap:.5rem}.ngcc-fb__box{flex:1;display:flex;flex-wrap:wrap;align-items:center;gap:.25rem;min-block-size:2.5rem;padding:0 1rem;background:var(--cds-field);border-block-end:1px solid var(--cds-border-strong);color:var(--cds-text-primary)}.ngcc-fb__box:focus-within{outline:2px solid var(--cds-focus);outline-offset:-2px}.ngcc-fb__input{flex:1;min-inline-size:8rem;block-size:2.5rem;padding:0;border:0;background:none;font:inherit;font-size:.875rem;color:inherit;outline:none}.ngcc-fb__input::placeholder{color:var(--cds-text-placeholder)}.ngcc-fb__clear{padding:.5rem;border:0;background:none;font:inherit;font-size:.875rem;color:var(--cds-link-primary);cursor:pointer}.ngcc-fb__clear:focus-visible{outline:2px solid var(--cds-focus)}.ngcc-fb__list{position:absolute;inset-inline:0;z-index:var(--cds-layer-overlay, 9000);max-block-size:15rem;margin:0;padding:0;overflow-y:auto;list-style:none;background:var(--cds-layer-01);box-shadow:0 2px 6px #0000004d}.ngcc-fb__option{padding:.75rem 1rem;font-size:.875rem;color:var(--cds-text-primary);cursor:pointer}.ngcc-fb__option--active,.ngcc-fb__option:hover{background:var(--cds-layer-hover-01)}.ngcc-fb__field{color:var(--cds-text-secondary)}\n"] }]
|
|
10080
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], fields: [{ type: i0.Input, args: [{ isSignal: true, alias: "fields", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], maxSuggestions: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSuggestions", required: false }] }] } });
|
|
10081
|
+
|
|
10082
|
+
/**
|
|
10083
|
+
* Overflow (row action) menu. The menu is `position: fixed`, so it is not clipped by
|
|
10084
|
+
* table or scroll containers. Keyboard: Enter/Space/ArrowDown open, arrows/Home/End move,
|
|
10085
|
+
* Escape closes and returns focus to the trigger.
|
|
10086
|
+
*/
|
|
10087
|
+
class NgccOverflowMenu {
|
|
10088
|
+
host = inject(ElementRef);
|
|
10089
|
+
injector = inject(Injector);
|
|
10090
|
+
options = viewChildren('option', ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
10091
|
+
items = input([], ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
10092
|
+
ariaLabel = input('Actions', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
10093
|
+
/** Which edge of the trigger the menu lines up with. */
|
|
10094
|
+
align = input('end', ...(ngDevMode ? [{ debugName: "align" }] : []));
|
|
10095
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
10096
|
+
orientation = input('vertical', ...(ngDevMode ? [{ debugName: "orientation" }] : []));
|
|
10097
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
10098
|
+
itemSelected = output();
|
|
10099
|
+
open = signal(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
10100
|
+
pos = signal({ top: null, bottom: null, left: null, right: null }, ...(ngDevMode ? [{ debugName: "pos" }] : []));
|
|
10101
|
+
constructor() {
|
|
10102
|
+
// Fixed positioning would detach the menu from its trigger on scroll, so close instead.
|
|
10103
|
+
effect((onCleanup) => {
|
|
10104
|
+
if (!this.open())
|
|
10105
|
+
return;
|
|
10106
|
+
const close = () => this.close();
|
|
10107
|
+
document.addEventListener('scroll', close, true);
|
|
10108
|
+
onCleanup(() => document.removeEventListener('scroll', close, true));
|
|
10109
|
+
});
|
|
10110
|
+
}
|
|
10111
|
+
toggle() {
|
|
10112
|
+
if (this.open())
|
|
10113
|
+
this.close();
|
|
10114
|
+
else
|
|
10115
|
+
this.show(0);
|
|
10116
|
+
}
|
|
10117
|
+
close(returnFocus = false) {
|
|
10118
|
+
if (!this.open())
|
|
10119
|
+
return;
|
|
10120
|
+
this.open.set(false);
|
|
10121
|
+
if (returnFocus)
|
|
10122
|
+
this.trigger()?.focus();
|
|
10123
|
+
}
|
|
10124
|
+
trigger() {
|
|
10125
|
+
return this.host.nativeElement.querySelector('button.cds--overflow-menu');
|
|
10126
|
+
}
|
|
10127
|
+
show(focusFrom) {
|
|
10128
|
+
const trigger = this.trigger();
|
|
10129
|
+
if (!trigger)
|
|
10130
|
+
return;
|
|
10131
|
+
const rect = trigger.getBoundingClientRect();
|
|
10132
|
+
const estimate = this.items().length * 40;
|
|
10133
|
+
const flip = rect.bottom + estimate > window.innerHeight && rect.top > estimate;
|
|
10134
|
+
const end = this.align() === 'end';
|
|
10135
|
+
this.pos.set({
|
|
10136
|
+
top: flip ? null : rect.bottom,
|
|
10137
|
+
bottom: flip ? window.innerHeight - rect.top : null,
|
|
10138
|
+
left: end ? null : rect.left,
|
|
10139
|
+
right: end ? document.documentElement.clientWidth - rect.right : null,
|
|
10140
|
+
});
|
|
10141
|
+
this.open.set(true);
|
|
10142
|
+
afterNextRender(() => this.focusOption(focusFrom === 'last' ? this.enabledIndexes().length - 1 : focusFrom, true), {
|
|
10143
|
+
injector: this.injector,
|
|
10144
|
+
});
|
|
10145
|
+
}
|
|
10146
|
+
enabledIndexes() {
|
|
10147
|
+
return this.options()
|
|
10148
|
+
.map((o, i) => (o.nativeElement.disabled ? -1 : i))
|
|
10149
|
+
.filter((i) => i >= 0);
|
|
10150
|
+
}
|
|
10151
|
+
/** `n` indexes into the enabled options; wraps around when `wrap`. */
|
|
10152
|
+
focusOption(n, wrap = false) {
|
|
10153
|
+
const enabled = this.enabledIndexes();
|
|
10154
|
+
if (!enabled.length)
|
|
10155
|
+
return;
|
|
10156
|
+
const i = wrap
|
|
10157
|
+
? (n + enabled.length) % enabled.length
|
|
10158
|
+
: Math.min(Math.max(n, 0), enabled.length - 1);
|
|
10159
|
+
this.options()[enabled[i]].nativeElement.focus();
|
|
10160
|
+
}
|
|
10161
|
+
select(item) {
|
|
10162
|
+
if (item.disabled)
|
|
10163
|
+
return;
|
|
10164
|
+
this.close(true);
|
|
10165
|
+
this.itemSelected.emit(item);
|
|
10166
|
+
}
|
|
10167
|
+
onTriggerKeydown(ev) {
|
|
10168
|
+
if (this.open())
|
|
10169
|
+
return;
|
|
10170
|
+
if (ev.key === 'ArrowDown') {
|
|
10171
|
+
ev.preventDefault();
|
|
10172
|
+
this.show(0);
|
|
10173
|
+
}
|
|
10174
|
+
else if (ev.key === 'ArrowUp') {
|
|
10175
|
+
ev.preventDefault();
|
|
10176
|
+
this.show('last');
|
|
10177
|
+
}
|
|
10178
|
+
}
|
|
10179
|
+
onMenuKeydown(ev) {
|
|
10180
|
+
const enabled = this.enabledIndexes();
|
|
10181
|
+
const current = enabled.indexOf(this.options().findIndex((o) => o.nativeElement === document.activeElement));
|
|
10182
|
+
switch (ev.key) {
|
|
10183
|
+
case 'ArrowDown':
|
|
10184
|
+
this.focusOption(current + 1, true);
|
|
10185
|
+
break;
|
|
10186
|
+
case 'ArrowUp':
|
|
10187
|
+
this.focusOption(current - 1, true);
|
|
10188
|
+
break;
|
|
10189
|
+
case 'Home':
|
|
10190
|
+
this.focusOption(0);
|
|
10191
|
+
break;
|
|
10192
|
+
case 'End':
|
|
10193
|
+
this.focusOption(enabled.length - 1);
|
|
10194
|
+
break;
|
|
10195
|
+
case 'Escape':
|
|
10196
|
+
this.close(true);
|
|
10197
|
+
break;
|
|
10198
|
+
case 'Tab':
|
|
10199
|
+
this.close();
|
|
10200
|
+
return;
|
|
10201
|
+
default:
|
|
10202
|
+
return;
|
|
10203
|
+
}
|
|
10204
|
+
ev.preventDefault();
|
|
10205
|
+
}
|
|
10206
|
+
onDocumentClick(ev) {
|
|
10207
|
+
if (this.open() && !this.host.nativeElement.contains(ev.target))
|
|
10208
|
+
this.close();
|
|
10209
|
+
}
|
|
10210
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccOverflowMenu, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10211
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: NgccOverflowMenu, isStandalone: true, selector: "ngcc-overflow-menu", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemSelected: "itemSelected" }, host: { listeners: { "document:click": "onDocumentClick($event)", "window:resize": "close()", "window:blur": "close()" }, styleAttribute: "display: inline-block" }, viewQueries: [{ propertyName: "options", predicate: ["option"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
10212
|
+
<button
|
|
10213
|
+
#trigger
|
|
10214
|
+
type="button"
|
|
10215
|
+
[class]="
|
|
10216
|
+
'cds--overflow-menu' +
|
|
10217
|
+
(size() !== 'md' ? ' cds--overflow-menu--' + size() : '') +
|
|
10218
|
+
(open() ? ' cds--overflow-menu--open' : '')
|
|
10219
|
+
"
|
|
10220
|
+
aria-haspopup="menu"
|
|
10221
|
+
[attr.aria-expanded]="open()"
|
|
10222
|
+
[attr.aria-label]="ariaLabel()"
|
|
10223
|
+
[disabled]="disabled()"
|
|
10224
|
+
(click)="toggle()"
|
|
10225
|
+
(keydown)="onTriggerKeydown($event)"
|
|
10226
|
+
>
|
|
10227
|
+
<svg
|
|
10228
|
+
class="cds--overflow-menu__icon"
|
|
10229
|
+
width="16"
|
|
10230
|
+
height="16"
|
|
10231
|
+
viewBox="0 0 32 32"
|
|
10232
|
+
fill="currentColor"
|
|
10233
|
+
aria-hidden="true"
|
|
10234
|
+
focusable="false"
|
|
10235
|
+
>
|
|
10236
|
+
@if (orientation() === 'vertical') {
|
|
10237
|
+
<circle cx="16" cy="8" r="2"></circle>
|
|
10238
|
+
<circle cx="16" cy="16" r="2"></circle>
|
|
10239
|
+
<circle cx="16" cy="24" r="2"></circle>
|
|
10240
|
+
} @else {
|
|
10241
|
+
<circle cx="8" cy="16" r="2"></circle>
|
|
10242
|
+
<circle cx="16" cy="16" r="2"></circle>
|
|
10243
|
+
<circle cx="24" cy="16" r="2"></circle>
|
|
10244
|
+
}
|
|
10245
|
+
</svg>
|
|
10246
|
+
</button>
|
|
10247
|
+
@if (open()) {
|
|
10248
|
+
<ul
|
|
10249
|
+
class="cds--overflow-menu-options cds--overflow-menu-options--open ngcc-overflow__menu"
|
|
10250
|
+
role="menu"
|
|
10251
|
+
[attr.aria-label]="ariaLabel()"
|
|
10252
|
+
[style.--ngcc-overflow-top.px]="pos().top"
|
|
10253
|
+
[style.--ngcc-overflow-bottom.px]="pos().bottom"
|
|
10254
|
+
[style.--ngcc-overflow-left.px]="pos().left"
|
|
10255
|
+
[style.--ngcc-overflow-right.px]="pos().right"
|
|
10256
|
+
(keydown)="onMenuKeydown($event)"
|
|
10257
|
+
>
|
|
10258
|
+
@for (item of items(); track item.id) {
|
|
10259
|
+
<li
|
|
10260
|
+
role="none"
|
|
10261
|
+
[class]="
|
|
10262
|
+
'cds--overflow-menu-options__option' +
|
|
10263
|
+
(item.danger ? ' cds--overflow-menu-options__option--danger' : '') +
|
|
10264
|
+
(item.disabled ? ' cds--overflow-menu-options__option--disabled' : '') +
|
|
10265
|
+
(item.divider ? ' ngcc-overflow__divider' : '')
|
|
10266
|
+
"
|
|
10267
|
+
>
|
|
10268
|
+
<button
|
|
10269
|
+
#option
|
|
10270
|
+
type="button"
|
|
10271
|
+
role="menuitem"
|
|
10272
|
+
class="cds--overflow-menu-options__btn"
|
|
10273
|
+
tabindex="-1"
|
|
10274
|
+
[disabled]="item.disabled"
|
|
10275
|
+
(click)="select(item)"
|
|
10276
|
+
>
|
|
10277
|
+
<span class="cds--overflow-menu-options__option-content">{{ item.label }}</span>
|
|
10278
|
+
</button>
|
|
10279
|
+
</li>
|
|
10280
|
+
}
|
|
10281
|
+
</ul>
|
|
10282
|
+
}
|
|
10283
|
+
`, isInline: true, styles: [".ngcc-overflow__menu{position:fixed;inset-block-start:var(--ngcc-overflow-top, auto);inset-block-end:var(--ngcc-overflow-bottom, auto);inset-inline-start:var(--ngcc-overflow-left, auto);inset-inline-end:var(--ngcc-overflow-right, auto);z-index:var(--cds-layer-overlay, 9000);margin:0;padding:0;list-style:none}.ngcc-overflow__divider{border-block-start:1px solid var(--cds-border-subtle)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
10284
|
+
}
|
|
10285
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NgccOverflowMenu, decorators: [{
|
|
10286
|
+
type: Component,
|
|
10287
|
+
args: [{ selector: 'ngcc-overflow-menu', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
10288
|
+
style: 'display: inline-block',
|
|
10289
|
+
'(document:click)': 'onDocumentClick($event)',
|
|
10290
|
+
'(window:resize)': 'close()',
|
|
10291
|
+
'(window:blur)': 'close()',
|
|
10292
|
+
}, template: `
|
|
10293
|
+
<button
|
|
10294
|
+
#trigger
|
|
10295
|
+
type="button"
|
|
10296
|
+
[class]="
|
|
10297
|
+
'cds--overflow-menu' +
|
|
10298
|
+
(size() !== 'md' ? ' cds--overflow-menu--' + size() : '') +
|
|
10299
|
+
(open() ? ' cds--overflow-menu--open' : '')
|
|
10300
|
+
"
|
|
10301
|
+
aria-haspopup="menu"
|
|
10302
|
+
[attr.aria-expanded]="open()"
|
|
10303
|
+
[attr.aria-label]="ariaLabel()"
|
|
10304
|
+
[disabled]="disabled()"
|
|
10305
|
+
(click)="toggle()"
|
|
10306
|
+
(keydown)="onTriggerKeydown($event)"
|
|
10307
|
+
>
|
|
10308
|
+
<svg
|
|
10309
|
+
class="cds--overflow-menu__icon"
|
|
10310
|
+
width="16"
|
|
10311
|
+
height="16"
|
|
10312
|
+
viewBox="0 0 32 32"
|
|
10313
|
+
fill="currentColor"
|
|
10314
|
+
aria-hidden="true"
|
|
10315
|
+
focusable="false"
|
|
10316
|
+
>
|
|
10317
|
+
@if (orientation() === 'vertical') {
|
|
10318
|
+
<circle cx="16" cy="8" r="2"></circle>
|
|
10319
|
+
<circle cx="16" cy="16" r="2"></circle>
|
|
10320
|
+
<circle cx="16" cy="24" r="2"></circle>
|
|
10321
|
+
} @else {
|
|
10322
|
+
<circle cx="8" cy="16" r="2"></circle>
|
|
10323
|
+
<circle cx="16" cy="16" r="2"></circle>
|
|
10324
|
+
<circle cx="24" cy="16" r="2"></circle>
|
|
10325
|
+
}
|
|
10326
|
+
</svg>
|
|
10327
|
+
</button>
|
|
10328
|
+
@if (open()) {
|
|
10329
|
+
<ul
|
|
10330
|
+
class="cds--overflow-menu-options cds--overflow-menu-options--open ngcc-overflow__menu"
|
|
10331
|
+
role="menu"
|
|
10332
|
+
[attr.aria-label]="ariaLabel()"
|
|
10333
|
+
[style.--ngcc-overflow-top.px]="pos().top"
|
|
10334
|
+
[style.--ngcc-overflow-bottom.px]="pos().bottom"
|
|
10335
|
+
[style.--ngcc-overflow-left.px]="pos().left"
|
|
10336
|
+
[style.--ngcc-overflow-right.px]="pos().right"
|
|
10337
|
+
(keydown)="onMenuKeydown($event)"
|
|
10338
|
+
>
|
|
10339
|
+
@for (item of items(); track item.id) {
|
|
10340
|
+
<li
|
|
10341
|
+
role="none"
|
|
10342
|
+
[class]="
|
|
10343
|
+
'cds--overflow-menu-options__option' +
|
|
10344
|
+
(item.danger ? ' cds--overflow-menu-options__option--danger' : '') +
|
|
10345
|
+
(item.disabled ? ' cds--overflow-menu-options__option--disabled' : '') +
|
|
10346
|
+
(item.divider ? ' ngcc-overflow__divider' : '')
|
|
10347
|
+
"
|
|
10348
|
+
>
|
|
10349
|
+
<button
|
|
10350
|
+
#option
|
|
10351
|
+
type="button"
|
|
10352
|
+
role="menuitem"
|
|
10353
|
+
class="cds--overflow-menu-options__btn"
|
|
10354
|
+
tabindex="-1"
|
|
10355
|
+
[disabled]="item.disabled"
|
|
10356
|
+
(click)="select(item)"
|
|
10357
|
+
>
|
|
10358
|
+
<span class="cds--overflow-menu-options__option-content">{{ item.label }}</span>
|
|
10359
|
+
</button>
|
|
10360
|
+
</li>
|
|
10361
|
+
}
|
|
10362
|
+
</ul>
|
|
10363
|
+
}
|
|
10364
|
+
`, styles: [".ngcc-overflow__menu{position:fixed;inset-block-start:var(--ngcc-overflow-top, auto);inset-block-end:var(--ngcc-overflow-bottom, auto);inset-inline-start:var(--ngcc-overflow-left, auto);inset-inline-end:var(--ngcc-overflow-right, auto);z-index:var(--cds-layer-overlay, 9000);margin:0;padding:0;list-style:none}.ngcc-overflow__divider{border-block-start:1px solid var(--cds-border-subtle)}\n"] }]
|
|
10365
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.ViewChildren, args: ['option', { isSignal: true }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], itemSelected: [{ type: i0.Output, args: ["itemSelected"] }] } });
|
|
10366
|
+
|
|
8417
10367
|
/*
|
|
8418
10368
|
* Public API Surface of ngcc
|
|
8419
10369
|
*/
|
|
@@ -8423,5 +10373,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
8423
10373
|
* Generated bundle index. Do not edit.
|
|
8424
10374
|
*/
|
|
8425
10375
|
|
|
8426
|
-
export { HttpNgccI18nLoader, NGCC_ACCORDION_ALIGN, NGCC_I18N_CONFIG, NGCC_RADIO_GROUP_TOKEN, NGCC_SIDE_NAV_CONTEXT, NgccAccordion, NgccAccordionItem, NgccBreadcrumbComponent, NgccBreadcrumbItemComponent, NgccButton, NgccCharts, NgccCheckbox, NgccCodeSnippetComponent, NgccColorThemeService, NgccColorThemeSwitcher, NgccContainedList, NgccContainedListActionDirective, NgccContainedListItem, NgccContainedListItemActionDirective, NgccDatePicker, NgccDatePickerCalendar, NgccDropdown, NgccGaugeChart, NgccHamburger, NgccHeader, NgccHeaderAction, NgccHeaderGlobal, NgccHeaderItem, NgccHeaderMenu, NgccHeaderMenuItem, NgccHeaderName, NgccHeaderNavigation, NgccHeaderPanel, NgccI18nPipe, NgccI18nService, NgccIcon, NgccInput, NgccLink, NgccModal, NgccNotification, NgccNotificationContainer, NgccPagination, NgccRadio, NgccRadioGroup, NgccSideNav, NgccSideNavDivider, NgccSideNavItem, NgccSideNavMenu, NgccSideNavMenuItem, NgccSkeleton, NgccTab, NgccTabHeaders, NgccTable, NgccTableSearchDirective, NgccTableSearchService, NgccTableService, NgccTableSkeleton, NgccTableToolbar, NgccTabs, NgccTabsSkeleton, NgccTextAreaComponent, NgccToast, NgccToastContainer, NgccToggle, NgccTooltip, NotificationService, ToastService, WCAG_CONTRAST, adjustColorForContrast, checkContrast, createAccessibleColorPair, derivePaletteFromBrand, generateColorScale, generateInteractiveStates, getAccessibleTextColor, getAvailableThemes, getContrastRatio, getFocusIndicatorColor, getRelativeLuminance, getThemeBackground, getThemeSecondaryButtonBg, hexToHsl, hexToRgb, hslToHex, hslToRgb, initNgccTheme, isThemeDark, provideNgccI18n, rgbToHex, rgbToHsl, themeMetadata, validateColorToken };
|
|
10376
|
+
export { HttpNgccI18nLoader, ICONS, NGCC_ACCORDION_ALIGN, NGCC_CONTENT_SWITCHER, NGCC_DEFAULT_DATE_PRESETS, NGCC_I18N_CONFIG, NGCC_RADIO_GROUP_TOKEN, NGCC_SIDE_NAV_CONTEXT, NGCC_STATUS_TAG, NgccAccordion, NgccAccordionItem, NgccActivityFeed, NgccBreadcrumbComponent, NgccBreadcrumbItemComponent, NgccButton, NgccCharts, NgccCheckbox, NgccCodeSnippetComponent, NgccColorThemeService, NgccColorThemeSwitcher, NgccContainedList, NgccContainedListActionDirective, NgccContainedListItem, NgccContainedListItemActionDirective, NgccContentSwitcher, NgccContentSwitcherOption, NgccDatePicker, NgccDatePickerCalendar, NgccDateRangePicker, NgccDropdown, NgccEmptyState, NgccFilterBar, NgccGaugeChart, NgccHamburger, NgccHeader, NgccHeaderAction, NgccHeaderGlobal, NgccHeaderItem, NgccHeaderMenu, NgccHeaderMenuItem, NgccHeaderName, NgccHeaderNavigation, NgccHeaderPanel, NgccI18nPipe, NgccI18nService, NgccIcon, NgccInput, NgccLink, NgccModal, NgccNotification, NgccNotificationContainer, NgccNotificationList, NgccOverflowMenu, NgccPagination, NgccProgressBar, NgccRadio, NgccRadioGroup, NgccSideNav, NgccSideNavDivider, NgccSideNavItem, NgccSideNavMenu, NgccSideNavMenuItem, NgccSideNavSection, NgccSkeleton, NgccStatTile, NgccStructuredList, NgccTab, NgccTabHeaders, NgccTable, NgccTableSearchDirective, NgccTableSearchService, NgccTableService, NgccTableSkeleton, NgccTableToolbar, NgccTabs, NgccTabsSkeleton, NgccTag, NgccTextAreaComponent, NgccTile, NgccToast, NgccToastContainer, NgccToggle, NgccTooltip, NotificationService, ToastService, WCAG_CONTRAST, adjustColorForContrast, checkContrast, createAccessibleColorPair, derivePaletteFromBrand, generateColorScale, generateInteractiveStates, getAccessibleTextColor, getAvailableThemes, getContrastRatio, getFocusIndicatorColor, getRelativeLuminance, getThemeBackground, getThemeSecondaryButtonBg, hexToHsl, hexToRgb, hslToHex, hslToRgb, initNgccTheme, isThemeDark, ngccResolveDatePreset, provideNgccI18n, rgbToHex, rgbToHsl, themeMetadata, validateColorToken };
|
|
8427
10377
|
//# sourceMappingURL=assistanz-carbideui.mjs.map
|