@coreui/angular 5.5.4 → 5.5.5
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/coreui-angular.mjs +22 -30
- package/fesm2022/coreui-angular.mjs.map +1 -1
- package/index.d.ts +18 -19
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, ElementRef, Directive, input, Renderer2, effect, TemplateRef, booleanAttribute, untracked, NgModule, computed, Injectable, Component, afterNextRender, linkedSignal, output, signal, contentChildren, numberAttribute, DestroyRef, DOCUMENT, RendererFactory2, PLATFORM_ID, forwardRef, NgZone, ChangeDetectorRef, contentChild, afterEveryRender, viewChild, ViewContainerRef, model, Pipe, Input, ViewChild, HostBinding, ContentChildren, ChangeDetectionStrategy, HostListener, Injector, runInInjectionContext } from '@angular/core';
|
|
3
|
-
import { NgTemplateOutlet, NgClass,
|
|
3
|
+
import { NgTemplateOutlet, NgClass, isPlatformServer, isPlatformBrowser, NgStyle } from '@angular/common';
|
|
4
4
|
import { animation, animate, style, AnimationBuilder, useAnimation, trigger, state, transition, group, query, animateChild } from '@angular/animations';
|
|
5
|
-
import { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';
|
|
6
|
-
import { fromEvent, Subject, BehaviorSubject,
|
|
5
|
+
import { takeUntilDestroyed, toSignal, toObservable } from '@angular/core/rxjs-interop';
|
|
6
|
+
import { fromEvent, Subject, BehaviorSubject, merge, takeWhile } from 'rxjs';
|
|
7
7
|
import * as i1 from '@angular/router';
|
|
8
8
|
import { RouterModule, Router, ActivatedRoute, NavigationEnd, RouterLink } from '@angular/router';
|
|
9
9
|
import { filter, tap, finalize, zipWith, withLatestFrom, debounceTime } from 'rxjs/operators';
|
|
@@ -1379,17 +1379,23 @@ class BreadcrumbItemComponent {
|
|
|
1379
1379
|
active = input(undefined, ...(ngDevMode ? [{ debugName: "active", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
1380
1380
|
/**
|
|
1381
1381
|
* The `url` prop for the inner `[routerLink]` directive. [docs]
|
|
1382
|
-
* @
|
|
1382
|
+
* @return string
|
|
1383
1383
|
*/
|
|
1384
1384
|
url = input(...(ngDevMode ? [undefined, { debugName: "url" }] : []));
|
|
1385
1385
|
/**
|
|
1386
1386
|
* Additional html attributes for link. [docs]
|
|
1387
|
-
* @
|
|
1387
|
+
* @return INavAttributes
|
|
1388
1388
|
*/
|
|
1389
|
-
|
|
1389
|
+
attribs = input(...(ngDevMode ? [undefined, { debugName: "attribs" }] : []));
|
|
1390
|
+
_attributes = input(undefined, ...(ngDevMode ? [{ debugName: "_attributes", alias: 'attributes' }] : [{ alias: 'attributes' }]));
|
|
1391
|
+
#attributesEffect = effect(() => {
|
|
1392
|
+
if (this._attributes()) {
|
|
1393
|
+
console.error('c-breadcrumb-item: [attributes] prop is removed, use [attribs] instead:', this._attributes());
|
|
1394
|
+
}
|
|
1395
|
+
}, ...(ngDevMode ? [{ debugName: "#attributesEffect" }] : []));
|
|
1390
1396
|
/**
|
|
1391
1397
|
* Some `NavigationExtras` props for the inner `[routerLink]` directive and `routerLinkActiveOptions`. [docs]
|
|
1392
|
-
* @
|
|
1398
|
+
* @return INavLinkProps
|
|
1393
1399
|
*/
|
|
1394
1400
|
linkProps = input(...(ngDevMode ? [undefined, { debugName: "linkProps" }] : []));
|
|
1395
1401
|
ariaCurrent = computed(() => {
|
|
@@ -1402,14 +1408,14 @@ class BreadcrumbItemComponent {
|
|
|
1402
1408
|
};
|
|
1403
1409
|
}, ...(ngDevMode ? [{ debugName: "hostClasses" }] : []));
|
|
1404
1410
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: BreadcrumbItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1405
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.0", type: BreadcrumbItemComponent, isStandalone: true, selector: "c-breadcrumb-item", inputs: { active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, url: { classPropertyName: "url", publicName: "url", isSignal: true, isRequired: false, transformFunction: null },
|
|
1411
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.0", type: BreadcrumbItemComponent, isStandalone: true, selector: "c-breadcrumb-item", inputs: { active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, url: { classPropertyName: "url", publicName: "url", isSignal: true, isRequired: false, transformFunction: null }, attribs: { classPropertyName: "attribs", publicName: "attribs", isSignal: true, isRequired: false, transformFunction: null }, _attributes: { classPropertyName: "_attributes", publicName: "attributes", isSignal: true, isRequired: false, transformFunction: null }, linkProps: { classPropertyName: "linkProps", publicName: "linkProps", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-current": "ariaCurrent()", "class": "hostClasses()" } }, exportAs: ["breadcrumbItem"], ngImport: i0, template: "@if (!active()) {\n <a [routerLink]=\"url()\"\n [cHtmlAttr]=\"attribs() ?? {}\"\n [target]=\"attribs()?.['target']\"\n [queryParams]=\"linkProps()?.queryParams ?? null\"\n [fragment]=\"linkProps()?.fragment\"\n [queryParamsHandling]=\"linkProps()?.queryParamsHandling ?? null\"\n [preserveFragment]=\"linkProps()?.preserveFragment ?? false\"\n [skipLocationChange]=\"linkProps()?.skipLocationChange ?? false\"\n [replaceUrl]=\"linkProps()?.replaceUrl ?? false\"\n [state]=\"linkProps()?.state ?? {}\"\n >\n <ng-container *ngTemplateOutlet=\"defaultBreadcrumbItemContentTemplate\" />\n </a>\n} @else {\n <span [cHtmlAttr]=\"attribs() ?? {}\">\n <ng-container *ngTemplateOutlet=\"defaultBreadcrumbItemContentTemplate\" />\n </span>\n}\n\n<ng-template #defaultBreadcrumbItemContentTemplate>\n <ng-content />\n</ng-template>\n", styles: [":host{display:list-item;text-align:-webkit-match-parent;text-align:match-parent}\n"], dependencies: [{ kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: HtmlAttributesDirective, selector: "[cHtmlAttr]", inputs: ["cHtmlAttr"], exportAs: ["cHtmlAttr"] }] });
|
|
1406
1412
|
}
|
|
1407
1413
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: BreadcrumbItemComponent, decorators: [{
|
|
1408
1414
|
type: Component,
|
|
1409
1415
|
args: [{ selector: 'c-breadcrumb-item', imports: [RouterModule, NgTemplateOutlet, HtmlAttributesDirective], exportAs: 'breadcrumbItem', host: {
|
|
1410
1416
|
'[attr.aria-current]': 'ariaCurrent()',
|
|
1411
1417
|
'[class]': 'hostClasses()'
|
|
1412
|
-
}, template: "@if (!active()) {\n <a [routerLink]=\"url()\"\n [cHtmlAttr]=\"
|
|
1418
|
+
}, template: "@if (!active()) {\n <a [routerLink]=\"url()\"\n [cHtmlAttr]=\"attribs() ?? {}\"\n [target]=\"attribs()?.['target']\"\n [queryParams]=\"linkProps()?.queryParams ?? null\"\n [fragment]=\"linkProps()?.fragment\"\n [queryParamsHandling]=\"linkProps()?.queryParamsHandling ?? null\"\n [preserveFragment]=\"linkProps()?.preserveFragment ?? false\"\n [skipLocationChange]=\"linkProps()?.skipLocationChange ?? false\"\n [replaceUrl]=\"linkProps()?.replaceUrl ?? false\"\n [state]=\"linkProps()?.state ?? {}\"\n >\n <ng-container *ngTemplateOutlet=\"defaultBreadcrumbItemContentTemplate\" />\n </a>\n} @else {\n <span [cHtmlAttr]=\"attribs() ?? {}\">\n <ng-container *ngTemplateOutlet=\"defaultBreadcrumbItemContentTemplate\" />\n </span>\n}\n\n<ng-template #defaultBreadcrumbItemContentTemplate>\n <ng-content />\n</ng-template>\n", styles: [":host{display:list-item;text-align:-webkit-match-parent;text-align:match-parent}\n"] }]
|
|
1413
1419
|
}] });
|
|
1414
1420
|
|
|
1415
1421
|
class BreadcrumbComponent {
|
|
@@ -1486,36 +1492,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImpor
|
|
|
1486
1492
|
}], ctorParameters: () => [] });
|
|
1487
1493
|
|
|
1488
1494
|
class BreadcrumbRouterComponent {
|
|
1489
|
-
|
|
1495
|
+
#breadcrumbRouterService = inject(BreadcrumbRouterService);
|
|
1490
1496
|
/**
|
|
1491
1497
|
* Optional array of IBreadcrumbItem to override default BreadcrumbRouter behavior. [docs]
|
|
1492
1498
|
* @return IBreadcrumbItem[]
|
|
1493
1499
|
*/
|
|
1494
1500
|
items = input(...(ngDevMode ? [undefined, { debugName: "items" }] : []));
|
|
1495
|
-
breadcrumbs;
|
|
1496
|
-
|
|
1497
|
-
this.
|
|
1498
|
-
}
|
|
1499
|
-
setup = effect(() => {
|
|
1500
|
-
const items = this.items();
|
|
1501
|
-
if (items && items.length > 0) {
|
|
1502
|
-
this.breadcrumbs = new Observable((observer) => {
|
|
1503
|
-
const itemsValue = this.items();
|
|
1504
|
-
if (itemsValue) {
|
|
1505
|
-
observer.next(itemsValue);
|
|
1506
|
-
}
|
|
1507
|
-
});
|
|
1508
|
-
}
|
|
1509
|
-
}, ...(ngDevMode ? [{ debugName: "setup" }] : []));
|
|
1510
|
-
ngOnDestroy() {
|
|
1511
|
-
this.breadcrumbs = undefined;
|
|
1512
|
-
}
|
|
1501
|
+
#breadcrumbs = toSignal(this.#breadcrumbRouterService.breadcrumbs$);
|
|
1502
|
+
breadcrumbs = computed(() => {
|
|
1503
|
+
return this.items() ?? this.#breadcrumbs() ?? [];
|
|
1504
|
+
}, ...(ngDevMode ? [{ debugName: "breadcrumbs" }] : []));
|
|
1513
1505
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: BreadcrumbRouterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1514
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.0", type: BreadcrumbRouterComponent, isStandalone: true, selector: "c-breadcrumb-router, [cBreadcrumbRouter]", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<c-breadcrumb class=\"m-0\">\n @for (breadcrumb of breadcrumbs
|
|
1506
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.0", type: BreadcrumbRouterComponent, isStandalone: true, selector: "c-breadcrumb-router, [cBreadcrumbRouter]", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<c-breadcrumb class=\"m-0\">\n @for (breadcrumb of breadcrumbs(); track breadcrumb; let last = $last) {\n @if (breadcrumb?.label && (breadcrumb?.url?.slice(-1) === '/' || last)) {\n <c-breadcrumb-item\n [active]=\"last\"\n [url]=\"breadcrumb?.url\"\n [attribs]=\"breadcrumb?.attributes\"\n [linkProps]=\"breadcrumb?.linkProps\"\n >\n {{ breadcrumb?.label }}\n </c-breadcrumb-item>\n }\n }\n</c-breadcrumb>\n", dependencies: [{ kind: "component", type: BreadcrumbComponent, selector: "c-breadcrumb", inputs: ["ariaLabel", "role"] }, { kind: "component", type: BreadcrumbItemComponent, selector: "c-breadcrumb-item", inputs: ["active", "url", "attribs", "attributes", "linkProps"], exportAs: ["breadcrumbItem"] }] });
|
|
1515
1507
|
}
|
|
1516
1508
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: BreadcrumbRouterComponent, decorators: [{
|
|
1517
1509
|
type: Component,
|
|
1518
|
-
args: [{ selector: 'c-breadcrumb-router, [cBreadcrumbRouter]', imports: [BreadcrumbComponent, BreadcrumbItemComponent
|
|
1510
|
+
args: [{ selector: 'c-breadcrumb-router, [cBreadcrumbRouter]', imports: [BreadcrumbComponent, BreadcrumbItemComponent], template: "<c-breadcrumb class=\"m-0\">\n @for (breadcrumb of breadcrumbs(); track breadcrumb; let last = $last) {\n @if (breadcrumb?.label && (breadcrumb?.url?.slice(-1) === '/' || last)) {\n <c-breadcrumb-item\n [active]=\"last\"\n [url]=\"breadcrumb?.url\"\n [attribs]=\"breadcrumb?.attributes\"\n [linkProps]=\"breadcrumb?.linkProps\"\n >\n {{ breadcrumb?.label }}\n </c-breadcrumb-item>\n }\n }\n</c-breadcrumb>\n" }]
|
|
1519
1511
|
}] });
|
|
1520
1512
|
|
|
1521
1513
|
class BreadcrumbModule {
|