@ojiepermana/angular 21.1.26 → 21.1.30

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.
@@ -277,6 +277,9 @@ class UiNavItemComponent {
277
277
  level = input(0, ...(ngDevMode ? [{ debugName: "level" }] : /* istanbul ignore next */ []));
278
278
  /** Compact / icon-only rendering (sidebar `thin`). */
279
279
  compact = input(false, ...(ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []));
280
+ /** True when this branch sits inside a collapsable rail and can draw a connector back to it. */
281
+ railConnector = input(false, ...(ngDevMode ? [{ debugName: "railConnector" }] : /* istanbul ignore next */ []));
282
+ railConnectorDotClasses = 'pointer-events-none absolute -left-[11px] top-1/2 z-10 h-1 w-1 -translate-x-1/2 -translate-y-1/2 rounded-full bg-foreground/80';
280
283
  exactMatch = {
281
284
  exact: true,
282
285
  paths: 'exact',
@@ -312,6 +315,15 @@ class UiNavItemComponent {
312
315
  isTrailActive() {
313
316
  return this.nav.isActive(this.item().id);
314
317
  }
318
+ railConnectorClasses(active) {
319
+ if (!active || !this.railConnector())
320
+ return '';
321
+ return ('relative after:pointer-events-none after:absolute after:-left-3 after:top-1/2 after:z-0 after:h-px ' +
322
+ "after:w-3 after:-translate-y-1/2 after:rounded-full after:bg-primary/30 after:content-['']");
323
+ }
324
+ showRailConnector(active) {
325
+ return active && this.railConnector();
326
+ }
315
327
  toggleGroup() {
316
328
  const id = this.item().id;
317
329
  if (id)
@@ -324,7 +336,7 @@ class UiNavItemComponent {
324
336
  }
325
337
  }
326
338
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: UiNavItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
327
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.13", type: UiNavItemComponent, isStandalone: true, selector: "ui-nav-item", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null }, level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
339
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.13", type: UiNavItemComponent, isStandalone: true, selector: "ui-nav-item", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null }, level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, railConnector: { classPropertyName: "railConnector", publicName: "railConnector", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
328
340
  @switch (type()) {
329
341
  @case ('divider') {
330
342
  <hr class="my-2 border-t border-border" role="separator" />
@@ -343,7 +355,11 @@ class UiNavItemComponent {
343
355
  }
344
356
  <div class="flex flex-col gap-0.5">
345
357
  @for (child of groupItem().children; track child.id) {
346
- <ui-nav-item [item]="child" [level]="level() + 1" [compact]="compact()" />
358
+ <ui-nav-item
359
+ [item]="child"
360
+ [level]="level() + 1"
361
+ [compact]="compact()"
362
+ [railConnector]="railConnector()" />
347
363
  }
348
364
  </div>
349
365
  </div>
@@ -351,12 +367,14 @@ class UiNavItemComponent {
351
367
  @case ('collapsable') {
352
368
  @let id = collapsableItem().id ?? '';
353
369
  @let open = isGroupOpen();
370
+ @let active = isTrailActive();
354
371
  <button
355
372
  type="button"
356
373
  [class]="
357
374
  cn(
358
375
  'ui-nav-text ui-nav-hover-surface group/ni flex w-full items-center gap-3 rounded p-3 text-foreground/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',
359
- isTrailActive() && 'text-primary',
376
+ active && 'text-primary',
377
+ railConnectorClasses(active),
360
378
  item().classes?.wrapper
361
379
  )
362
380
  "
@@ -367,6 +385,9 @@ class UiNavItemComponent {
367
385
  matTooltipPosition="right"
368
386
  [matTooltipDisabled]="!compact()"
369
387
  (click)="toggleGroup()">
388
+ @if (showRailConnector(active)) {
389
+ <span aria-hidden="true" data-nav-rail-dot [class]="railConnectorDotClasses"></span>
390
+ }
370
391
  @if (collapsableItem().icon) {
371
392
  <span
372
393
  [class]="
@@ -397,7 +418,7 @@ class UiNavItemComponent {
397
418
  role="region"
398
419
  class="relative ml-6.5 mt-0.5 flex flex-col gap-0.5 pl-3 before:absolute before:bottom-0 before:left-0 before:-top-3.5 before:w-px before:bg-primary/30 before:content-['']">
399
420
  @for (child of collapsableItem().children; track child.id) {
400
- <ui-nav-item [item]="child" [level]="level() + 1" [compact]="false" />
421
+ <ui-nav-item [item]="child" [level]="level() + 1" [compact]="false" [railConnector]="true" />
401
422
  }
402
423
  </div>
403
424
  }
@@ -412,7 +433,11 @@ class UiNavItemComponent {
412
433
  }
413
434
  <div class="flex flex-col gap-0.5">
414
435
  @for (child of megaItem().children; track child.id) {
415
- <ui-nav-item [item]="child" [level]="level() + 1" [compact]="compact()" />
436
+ <ui-nav-item
437
+ [item]="child"
438
+ [level]="level() + 1"
439
+ [compact]="compact()"
440
+ [railConnector]="railConnector()" />
416
441
  }
417
442
  </div>
418
443
  </div>
@@ -422,6 +447,7 @@ class UiNavItemComponent {
422
447
  [class]="
423
448
  cn(
424
449
  'ui-nav-text ui-nav-hover-surface flex items-center gap-3 rounded px-3 py-2 text-foreground/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring aria-[current=page]:text-primary',
450
+ railConnectorClasses(rla.isActive),
425
451
  item().classes?.wrapper
426
452
  )
427
453
  "
@@ -435,6 +461,9 @@ class UiNavItemComponent {
435
461
  [matTooltip]="compact() ? (asideItem().title ?? '') : ''"
436
462
  matTooltipPosition="right"
437
463
  [matTooltipDisabled]="!compact()">
464
+ @if (showRailConnector(rla.isActive)) {
465
+ <span aria-hidden="true" data-nav-rail-dot [class]="railConnectorDotClasses"></span>
466
+ }
438
467
  @if (asideItem().icon) {
439
468
  <ui-nav-icon [name]="asideItem().icon!" [size]="18" />
440
469
  }
@@ -450,6 +479,7 @@ class UiNavItemComponent {
450
479
  [class]="
451
480
  cn(
452
481
  'ui-nav-text ui-nav-hover-surface flex items-center gap-3 rounded px-3 py-2 text-foreground/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring aria-[current=page]:text-primary aria-disabled:pointer-events-none aria-disabled:opacity-50',
482
+ railConnectorClasses(rla.isActive),
453
483
  item().classes?.wrapper
454
484
  )
455
485
  "
@@ -470,6 +500,9 @@ class UiNavItemComponent {
470
500
  [preserveFragment]="basicItem().preserveFragment ?? false"
471
501
  [target]="basicItem().target ?? undefined"
472
502
  (click)="runAction()">
503
+ @if (showRailConnector(rla.isActive)) {
504
+ <span aria-hidden="true" data-nav-rail-dot [class]="railConnectorDotClasses"></span>
505
+ }
473
506
  @if (basicItem().icon) {
474
507
  <ui-nav-icon [name]="basicItem().icon!" [size]="18" [class]="item().classes?.icon ?? ''" />
475
508
  }
@@ -525,7 +558,7 @@ class UiNavItemComponent {
525
558
  }
526
559
  }
527
560
  }
528
- `, isInline: true, dependencies: [{ kind: "component", type: UiNavItemComponent, selector: "ui-nav-item", inputs: ["item", "level", "compact"] }, { 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"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: UiNavIconComponent, selector: "ui-nav-icon", inputs: ["name", "class", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
561
+ `, isInline: true, dependencies: [{ kind: "component", type: UiNavItemComponent, selector: "ui-nav-item", inputs: ["item", "level", "compact", "railConnector"] }, { 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"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: UiNavIconComponent, selector: "ui-nav-icon", inputs: ["name", "class", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
529
562
  }
530
563
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: UiNavItemComponent, decorators: [{
531
564
  type: Component,
@@ -552,7 +585,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
552
585
  }
553
586
  <div class="flex flex-col gap-0.5">
554
587
  @for (child of groupItem().children; track child.id) {
555
- <ui-nav-item [item]="child" [level]="level() + 1" [compact]="compact()" />
588
+ <ui-nav-item
589
+ [item]="child"
590
+ [level]="level() + 1"
591
+ [compact]="compact()"
592
+ [railConnector]="railConnector()" />
556
593
  }
557
594
  </div>
558
595
  </div>
@@ -560,12 +597,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
560
597
  @case ('collapsable') {
561
598
  @let id = collapsableItem().id ?? '';
562
599
  @let open = isGroupOpen();
600
+ @let active = isTrailActive();
563
601
  <button
564
602
  type="button"
565
603
  [class]="
566
604
  cn(
567
605
  'ui-nav-text ui-nav-hover-surface group/ni flex w-full items-center gap-3 rounded p-3 text-foreground/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',
568
- isTrailActive() && 'text-primary',
606
+ active && 'text-primary',
607
+ railConnectorClasses(active),
569
608
  item().classes?.wrapper
570
609
  )
571
610
  "
@@ -576,6 +615,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
576
615
  matTooltipPosition="right"
577
616
  [matTooltipDisabled]="!compact()"
578
617
  (click)="toggleGroup()">
618
+ @if (showRailConnector(active)) {
619
+ <span aria-hidden="true" data-nav-rail-dot [class]="railConnectorDotClasses"></span>
620
+ }
579
621
  @if (collapsableItem().icon) {
580
622
  <span
581
623
  [class]="
@@ -606,7 +648,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
606
648
  role="region"
607
649
  class="relative ml-6.5 mt-0.5 flex flex-col gap-0.5 pl-3 before:absolute before:bottom-0 before:left-0 before:-top-3.5 before:w-px before:bg-primary/30 before:content-['']">
608
650
  @for (child of collapsableItem().children; track child.id) {
609
- <ui-nav-item [item]="child" [level]="level() + 1" [compact]="false" />
651
+ <ui-nav-item [item]="child" [level]="level() + 1" [compact]="false" [railConnector]="true" />
610
652
  }
611
653
  </div>
612
654
  }
@@ -621,7 +663,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
621
663
  }
622
664
  <div class="flex flex-col gap-0.5">
623
665
  @for (child of megaItem().children; track child.id) {
624
- <ui-nav-item [item]="child" [level]="level() + 1" [compact]="compact()" />
666
+ <ui-nav-item
667
+ [item]="child"
668
+ [level]="level() + 1"
669
+ [compact]="compact()"
670
+ [railConnector]="railConnector()" />
625
671
  }
626
672
  </div>
627
673
  </div>
@@ -631,6 +677,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
631
677
  [class]="
632
678
  cn(
633
679
  'ui-nav-text ui-nav-hover-surface flex items-center gap-3 rounded px-3 py-2 text-foreground/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring aria-[current=page]:text-primary',
680
+ railConnectorClasses(rla.isActive),
634
681
  item().classes?.wrapper
635
682
  )
636
683
  "
@@ -644,6 +691,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
644
691
  [matTooltip]="compact() ? (asideItem().title ?? '') : ''"
645
692
  matTooltipPosition="right"
646
693
  [matTooltipDisabled]="!compact()">
694
+ @if (showRailConnector(rla.isActive)) {
695
+ <span aria-hidden="true" data-nav-rail-dot [class]="railConnectorDotClasses"></span>
696
+ }
647
697
  @if (asideItem().icon) {
648
698
  <ui-nav-icon [name]="asideItem().icon!" [size]="18" />
649
699
  }
@@ -659,6 +709,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
659
709
  [class]="
660
710
  cn(
661
711
  'ui-nav-text ui-nav-hover-surface flex items-center gap-3 rounded px-3 py-2 text-foreground/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring aria-[current=page]:text-primary aria-disabled:pointer-events-none aria-disabled:opacity-50',
712
+ railConnectorClasses(rla.isActive),
662
713
  item().classes?.wrapper
663
714
  )
664
715
  "
@@ -679,6 +730,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
679
730
  [preserveFragment]="basicItem().preserveFragment ?? false"
680
731
  [target]="basicItem().target ?? undefined"
681
732
  (click)="runAction()">
733
+ @if (showRailConnector(rla.isActive)) {
734
+ <span aria-hidden="true" data-nav-rail-dot [class]="railConnectorDotClasses"></span>
735
+ }
682
736
  @if (basicItem().icon) {
683
737
  <ui-nav-icon [name]="basicItem().icon!" [size]="18" [class]="item().classes?.icon ?? ''" />
684
738
  }
@@ -736,7 +790,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
736
790
  }
737
791
  `,
738
792
  }]
739
- }], propDecorators: { item: [{ type: i0.Input, args: [{ isSignal: true, alias: "item", required: true }] }], level: [{ type: i0.Input, args: [{ isSignal: true, alias: "level", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }] } });
793
+ }], propDecorators: { item: [{ type: i0.Input, args: [{ isSignal: true, alias: "item", required: true }] }], level: [{ type: i0.Input, args: [{ isSignal: true, alias: "level", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], railConnector: [{ type: i0.Input, args: [{ isSignal: true, alias: "railConnector", required: false }] }] } });
740
794
 
741
795
  /**
742
796
  * Vertical navigation (sidebar) — shadcn-styled.
@@ -1015,7 +1069,7 @@ class SidebarComponent {
1015
1069
  <ng-container [ngTemplateOutlet]="body" />
1016
1070
  </div>
1017
1071
  </ng-template>
1018
- `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ScrollAreaComponent, selector: "ui-scroll-area", inputs: ["class", "viewportClass"] }, { kind: "component", type: UiNavIconComponent, selector: "ui-nav-icon", inputs: ["name", "class", "size"] }, { kind: "component", type: UiNavItemComponent, selector: "ui-nav-item", inputs: ["item", "level", "compact"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1072
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ScrollAreaComponent, selector: "ui-scroll-area", inputs: ["class", "viewportClass"] }, { kind: "component", type: UiNavIconComponent, selector: "ui-nav-icon", inputs: ["name", "class", "size"] }, { kind: "component", type: UiNavItemComponent, selector: "ui-nav-item", inputs: ["item", "level", "compact", "railConnector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1019
1073
  }
1020
1074
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: SidebarComponent, decorators: [{
1021
1075
  type: Component,
@@ -1381,7 +1435,7 @@ class TopbarComponent {
1381
1435
  }
1382
1436
  </div>
1383
1437
  </ng-template>
1384
- `, isInline: true, dependencies: [{ 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"] }, { kind: "component", type: UiNavIconComponent, selector: "ui-nav-icon", inputs: ["name", "class", "size"] }, { kind: "component", type: UiNavItemComponent, selector: "ui-nav-item", inputs: ["item", "level", "compact"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1438
+ `, isInline: true, dependencies: [{ 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"] }, { kind: "component", type: UiNavIconComponent, selector: "ui-nav-icon", inputs: ["name", "class", "size"] }, { kind: "component", type: UiNavItemComponent, selector: "ui-nav-item", inputs: ["item", "level", "compact", "railConnector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1385
1439
  }
1386
1440
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: TopbarComponent, decorators: [{
1387
1441
  type: Component,