@virusis/angular-ui 0.1.3 → 0.1.4

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.
@@ -1555,49 +1555,93 @@ class VpBreadcrumbComponent {
1555
1555
  this.trail = [];
1556
1556
  this.navLabel = 'Kırıntı izi';
1557
1557
  }
1558
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: VpBreadcrumbComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1559
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.27", type: VpBreadcrumbComponent, isStandalone: true, selector: "vp-breadcrumb", inputs: { trail: "trail", navLabel: "navLabel" }, ngImport: i0, template: `
1560
- @if (trail.length > 0) {
1561
- <nav class="vp-breadcrumb" [attr.aria-label]="navLabel">
1562
- <ol class="vp-breadcrumb__list">
1563
- @for (crumb of trail; track crumb.path; let last = $last; let first = $first) {
1564
- <li class="vp-breadcrumb__item">
1565
- @if (!first) {
1566
- <span class="vp-breadcrumb__sep" data-vp-crumb-sep aria-hidden="true">/</span>
1567
- }
1568
- @if (last) {
1569
- <span class="vp-breadcrumb__current" data-vp-crumb aria-current="page">{{ crumb.label }}</span>
1570
- } @else {
1571
- <a class="vp-breadcrumb__link" data-vp-crumb [attr.href]="crumb.path">{{ crumb.label }}</a>
1572
- }
1573
- </li>
1574
- }
1575
- </ol>
1576
- </nav>
1558
+ /**
1559
+ * Uzun etiket sinirini asinca kisaltiliyor.
1560
+ *
1561
+ * 🔴 Sozlesme `page-anatomy.md` §14'te yazili: 24 karakter + tek karakterlik
1562
+ * ucnokta, tam ad `title` icinde. Kisaltmadan birakmak dar ekranda izin
1563
+ * satirini kirar ve kirinti ana navigasyonun onune gecerdi.
1564
+ *
1565
+ * ⚠️ Kesme **karakter sayisina** gore; kelime siniri aranmiyor. Kirinti
1566
+ * etiketleri kisa ad, cumle degil; kelimeye gore kesmek bazi adlarda
1567
+ * neredeyse hicbir sey birakmazdi.
1568
+ */
1569
+ shortLabel(label) {
1570
+ const text = label ?? '';
1571
+ return text.length > VpBreadcrumbComponent.MAX_LABEL
1572
+ ? `${text.slice(0, VpBreadcrumbComponent.MAX_LABEL)}…`
1573
+ : text;
1574
+ }
1575
+ /**
1576
+ * `title` yalniz kisaltilmis etiketlerde veriliyor.
1577
+ *
1578
+ * ⚠️ Kisaltilmamis etikete de `title` koymak, fare uzerine gelince ekrandaki
1579
+ * metnin aynisini tekrarlayan bos bir ipucu gosterirdi.
1580
+ */
1581
+ fullLabel(label) {
1582
+ const text = label ?? '';
1583
+ return text.length > VpBreadcrumbComponent.MAX_LABEL ? text : null;
1577
1584
  }
1585
+ static { this.MAX_LABEL = 24; }
1586
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: VpBreadcrumbComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1587
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.27", type: VpBreadcrumbComponent, isStandalone: true, selector: "vp-breadcrumb", inputs: { trail: "trail", navLabel: "navLabel" }, ngImport: i0, template: `
1588
+ @if (trail.length > 0) {
1589
+ <nav class="vp-breadcrumb" [attr.aria-label]="navLabel">
1590
+ <ol class="vp-breadcrumb__list">
1591
+ @for (crumb of trail; track crumb.path; let last = $last; let first = $first) {
1592
+ <li class="vp-breadcrumb__item">
1593
+ @if (!first) {
1594
+ <span class="vp-breadcrumb__sep" data-vp-crumb-sep aria-hidden="true">/</span>
1595
+ }
1596
+ @if (last) {
1597
+ <span
1598
+ class="vp-breadcrumb__current"
1599
+ data-vp-crumb
1600
+ aria-current="page"
1601
+ [attr.title]="fullLabel(crumb.label)">{{ shortLabel(crumb.label) }}</span>
1602
+ } @else {
1603
+ <a
1604
+ class="vp-breadcrumb__link"
1605
+ data-vp-crumb
1606
+ [attr.href]="crumb.path"
1607
+ [attr.title]="fullLabel(crumb.label)">{{ shortLabel(crumb.label) }}</a>
1608
+ }
1609
+ </li>
1610
+ }
1611
+ </ol>
1612
+ </nav>
1613
+ }
1578
1614
  `, isInline: true, styles: [":host{display:block}.vp-breadcrumb__list{list-style:none;display:flex;flex-wrap:wrap;align-items:center;gap:var(--vp-space-1);margin:0 0 var(--vp-space-3);padding:0;font-size:var(--vp-text-sm)}.vp-breadcrumb__item{display:flex;align-items:center;gap:var(--vp-space-1);margin:0}.vp-breadcrumb__link{color:var(--vp-text-muted);text-decoration:none}.vp-breadcrumb__link:hover{color:var(--vp-text-primary);text-decoration:underline}.vp-breadcrumb__link:focus-visible{outline:var(--vp-focus-width) solid var(--vp-focus-ring);outline-offset:var(--vp-focus-offset);border-radius:var(--vp-radius-sm)}.vp-breadcrumb__current{color:var(--vp-text-primary);font-weight:var(--vp-weight-medium)}.vp-breadcrumb__sep{color:var(--vp-text-muted)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1579
1615
  }
1580
1616
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: VpBreadcrumbComponent, decorators: [{
1581
1617
  type: Component,
1582
- args: [{ selector: 'vp-breadcrumb', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
1583
- @if (trail.length > 0) {
1584
- <nav class="vp-breadcrumb" [attr.aria-label]="navLabel">
1585
- <ol class="vp-breadcrumb__list">
1586
- @for (crumb of trail; track crumb.path; let last = $last; let first = $first) {
1587
- <li class="vp-breadcrumb__item">
1588
- @if (!first) {
1589
- <span class="vp-breadcrumb__sep" data-vp-crumb-sep aria-hidden="true">/</span>
1590
- }
1591
- @if (last) {
1592
- <span class="vp-breadcrumb__current" data-vp-crumb aria-current="page">{{ crumb.label }}</span>
1593
- } @else {
1594
- <a class="vp-breadcrumb__link" data-vp-crumb [attr.href]="crumb.path">{{ crumb.label }}</a>
1595
- }
1596
- </li>
1597
- }
1598
- </ol>
1599
- </nav>
1600
- }
1618
+ args: [{ selector: 'vp-breadcrumb', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
1619
+ @if (trail.length > 0) {
1620
+ <nav class="vp-breadcrumb" [attr.aria-label]="navLabel">
1621
+ <ol class="vp-breadcrumb__list">
1622
+ @for (crumb of trail; track crumb.path; let last = $last; let first = $first) {
1623
+ <li class="vp-breadcrumb__item">
1624
+ @if (!first) {
1625
+ <span class="vp-breadcrumb__sep" data-vp-crumb-sep aria-hidden="true">/</span>
1626
+ }
1627
+ @if (last) {
1628
+ <span
1629
+ class="vp-breadcrumb__current"
1630
+ data-vp-crumb
1631
+ aria-current="page"
1632
+ [attr.title]="fullLabel(crumb.label)">{{ shortLabel(crumb.label) }}</span>
1633
+ } @else {
1634
+ <a
1635
+ class="vp-breadcrumb__link"
1636
+ data-vp-crumb
1637
+ [attr.href]="crumb.path"
1638
+ [attr.title]="fullLabel(crumb.label)">{{ shortLabel(crumb.label) }}</a>
1639
+ }
1640
+ </li>
1641
+ }
1642
+ </ol>
1643
+ </nav>
1644
+ }
1601
1645
  `, styles: [":host{display:block}.vp-breadcrumb__list{list-style:none;display:flex;flex-wrap:wrap;align-items:center;gap:var(--vp-space-1);margin:0 0 var(--vp-space-3);padding:0;font-size:var(--vp-text-sm)}.vp-breadcrumb__item{display:flex;align-items:center;gap:var(--vp-space-1);margin:0}.vp-breadcrumb__link{color:var(--vp-text-muted);text-decoration:none}.vp-breadcrumb__link:hover{color:var(--vp-text-primary);text-decoration:underline}.vp-breadcrumb__link:focus-visible{outline:var(--vp-focus-width) solid var(--vp-focus-ring);outline-offset:var(--vp-focus-offset);border-radius:var(--vp-radius-sm)}.vp-breadcrumb__current{color:var(--vp-text-primary);font-weight:var(--vp-weight-medium)}.vp-breadcrumb__sep{color:var(--vp-text-muted)}\n"] }]
1602
1646
  }], propDecorators: { trail: [{
1603
1647
  type: Input,