@coreui/angular 5.3.2 → 5.3.3
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/README.md
CHANGED
|
@@ -25,19 +25,12 @@
|
|
|
25
25
|
|
|
26
26
|
## Status
|
|
27
27
|
|
|
28
|
-
![angular][angular-badge]
|
|
29
28
|
[![npm-coreui-angular-v5-ng19][npm-coreui-angular-badge-v5-ng19]][npm-coreui-angular]
|
|
30
29
|
[![npm-coreui-angular-latest][npm-coreui-angular-badge-latest]][npm-coreui-angular]
|
|
31
30
|
[![npm-coreui-angular-next][npm-coreui-angular-badge-next]][npm-coreui-angular]
|
|
32
31
|
[![NPM downloads][npm-coreui-angular-download]][npm-coreui-angular]
|
|
33
|
-
[](https://github.com/coreui/coreui-angular/actions/workflows/build-check.yml)
|
|
32
|
+
![angular][angular-badge] [](https://github.com/coreui/coreui-angular/actions/workflows/build-check.yml)
|
|
34
33
|
|
|
35
|
-
[npm-coreui-angular-badge-v5-ng19]: https://img.shields.io/npm/v/@coreui/angular/v5-ng19?style=flat-square&color=brightgreen
|
|
36
|
-
[npm-coreui-angular-badge-latest]: https://img.shields.io/npm/v/@coreui/angular/latest?style=flat-square&color=brightgreen
|
|
37
|
-
[npm-coreui-angular-badge-next]: https://img.shields.io/npm/v/@coreui/angular/next?style=flat-square&color=red
|
|
38
|
-
[npm-coreui-angular]: https://www.npmjs.com/package/@coreui/angular
|
|
39
|
-
[npm-coreui-angular-download]: https://img.shields.io/npm/dm/@coreui/angular.svg?style=flat-square
|
|
40
|
-
[angular-badge]: https://img.shields.io/badge/angular-^19.0.0-lightgrey.svg?style=flat-square&logo=angular
|
|
41
34
|
|
|
42
35
|
## Table of contents
|
|
43
36
|
|
|
@@ -71,7 +64,7 @@
|
|
|
71
64
|
Before you begin, make sure your development environment includes `Node.js®` and `npm` package manager.
|
|
72
65
|
|
|
73
66
|
###### Node.js
|
|
74
|
-
[**Angular 19**](https://angular.dev/overview) requires `Node.js` LTS version `^18.19` or
|
|
67
|
+
[**Angular 19**](https://angular.dev/overview) requires `Node.js` LTS version `^18.19`, `^20.11` or `^22.0`.
|
|
75
68
|
|
|
76
69
|
- To check your version, run `node -v` in a terminal/console window.
|
|
77
70
|
- To get `Node.js`, go to [nodejs.org](https://nodejs.org/).
|
|
@@ -223,3 +216,10 @@ Thanks to all the backers and sponsors! Support this project by [becoming a back
|
|
|
223
216
|
## Copyright and license
|
|
224
217
|
|
|
225
218
|
Copyright 2024 creativeLabs Łukasz Holeczek. Code released under the [MIT License](https://github.com/coreui/coreui-angular/blob/main/LICENSE). Docs released under [Creative Commons](https://creativecommons.org/licenses/by/3.0/).
|
|
219
|
+
|
|
220
|
+
[npm-coreui-angular-badge-v5-ng19]: https://img.shields.io/npm/v/@coreui/angular/v5-ng19?style=flat-square&color=brightgreen
|
|
221
|
+
[npm-coreui-angular-badge-latest]: https://img.shields.io/npm/v/@coreui/angular/latest?style=flat-square&color=brightgreen
|
|
222
|
+
[npm-coreui-angular-badge-next]: https://img.shields.io/npm/v/@coreui/angular/next?style=flat-square&color=red
|
|
223
|
+
[npm-coreui-angular]: https://www.npmjs.com/package/@coreui/angular
|
|
224
|
+
[npm-coreui-angular-download]: https://img.shields.io/npm/dm/@coreui/angular.svg?style=flat-square
|
|
225
|
+
[angular-badge]: https://img.shields.io/badge/angular-^19.0.0-lightgrey.svg?style=flat-square&logo=angular
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, ElementRef, Directive, input, Renderer2, effect, TemplateRef, Input, booleanAttribute, NgModule, computed, Injectable, Component, signal, output, contentChildren, EventEmitter, HostBinding, Output, ContentChildren, HostListener, DestroyRef, RendererFactory2, PLATFORM_ID, Inject, afterNextRender, ViewChild, forwardRef, ContentChild, Optional, contentChild, afterRender, viewChild, ViewContainerRef, model, numberAttribute, ChangeDetectionStrategy, Pipe, Injector, untracked, runInInjectionContext } from '@angular/core';
|
|
3
|
-
import { NgTemplateOutlet, DOCUMENT, NgClass,
|
|
3
|
+
import { NgTemplateOutlet, DOCUMENT, NgClass, AsyncPipe, isPlatformServer, isPlatformBrowser, NgStyle } from '@angular/common';
|
|
4
4
|
import { animation, animate, style, AnimationBuilder, useAnimation, trigger, state, transition, group, query, animateChild } from '@angular/animations';
|
|
5
5
|
import { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';
|
|
6
6
|
import { fromEvent, Subject, BehaviorSubject, Observable, merge, takeWhile } from 'rxjs';
|
|
@@ -215,14 +215,14 @@ class AccordionService {
|
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
toggleItem(item) {
|
|
218
|
-
item.
|
|
218
|
+
item.itemVisible.update((value) => !value);
|
|
219
219
|
this.closeOtherItems(item);
|
|
220
220
|
}
|
|
221
221
|
closeOtherItems(openItem) {
|
|
222
222
|
if (!this.alwaysOpen) {
|
|
223
223
|
this.items.forEach((item) => {
|
|
224
224
|
if (item !== openItem) {
|
|
225
|
-
item.
|
|
225
|
+
item.itemVisible.set(false);
|
|
226
226
|
}
|
|
227
227
|
});
|
|
228
228
|
}
|
|
@@ -438,7 +438,14 @@ class AccordionItemComponent {
|
|
|
438
438
|
* @type boolean
|
|
439
439
|
* @default false
|
|
440
440
|
*/
|
|
441
|
-
|
|
441
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
442
|
+
this.visibleInput = input(false, { transform: booleanAttribute, alias: 'visible' });
|
|
443
|
+
this.itemVisible = signal(false);
|
|
444
|
+
this.visibleInputChange = effect(() => {
|
|
445
|
+
setTimeout(() => {
|
|
446
|
+
this.itemVisible.set(this.visibleInput());
|
|
447
|
+
});
|
|
448
|
+
});
|
|
442
449
|
this.contentId = `accordion-item-${nextId$2++}`;
|
|
443
450
|
this.contentTemplates = contentChildren(TemplateIdDirective, { descendants: true });
|
|
444
451
|
this.templates = computed(() => {
|
|
@@ -449,15 +456,14 @@ class AccordionItemComponent {
|
|
|
449
456
|
});
|
|
450
457
|
}
|
|
451
458
|
#accordionService;
|
|
452
|
-
set
|
|
453
|
-
|
|
454
|
-
this.visible = value || this.visible;
|
|
459
|
+
set visible(value) {
|
|
460
|
+
this.itemVisible.set(value);
|
|
455
461
|
}
|
|
456
|
-
get
|
|
457
|
-
return this.
|
|
462
|
+
get visible() {
|
|
463
|
+
return this.itemVisible();
|
|
458
464
|
}
|
|
459
465
|
get itemContext() {
|
|
460
|
-
return { $implicit: this.
|
|
466
|
+
return { $implicit: this.itemVisible() };
|
|
461
467
|
}
|
|
462
468
|
ngOnInit() {
|
|
463
469
|
this.#accordionService.addItem(this);
|
|
@@ -469,17 +475,12 @@ class AccordionItemComponent {
|
|
|
469
475
|
this.#accordionService.toggleItem(this);
|
|
470
476
|
}
|
|
471
477
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: AccordionItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
472
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.0.1", type: AccordionItemComponent, isStandalone: true, selector: "c-accordion-item", inputs: {
|
|
478
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.0.1", type: AccordionItemComponent, isStandalone: true, selector: "c-accordion-item", inputs: { visibleInput: { classPropertyName: "visibleInput", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "accordion-item" }, queries: [{ propertyName: "contentTemplates", predicate: TemplateIdDirective, descendants: true, isSignal: true }], exportAs: ["cAccordionItem"], ngImport: i0, template: "@let tmpl = templates();\n<ng-container>\n <div class=\"accordion-header\">\n <ng-container *ngTemplateOutlet=\"tmpl['accordionHeaderTemplate'] || defaultAccordionHeaderTemplate; context: itemContext\" />\n </div>\n <div class=\"accordion-collapse\" cCollapse [visible]=\"itemVisible()\" [attr.aria-expanded]=\"itemVisible()\" [id]=\"contentId\">\n <ng-container *ngTemplateOutlet=\"tmpl['accordionBodyTemplate'] || defaultAccordionBodyTemplate; context: itemContext\" />\n </div>\n</ng-container>\n\n<ng-template #defaultAccordionHeaderTemplate>\n <button cAccordionButton [collapsed]=\"!itemVisible()\" [attr.aria-controls]=\"contentId\" (click)=\"toggleItem()\">\n <ng-container\n *ngTemplateOutlet=\"tmpl['accordionHeader'] || defaultAccordionHeaderContentTemplate; context: itemContext\">\n </ng-container>\n </button>\n</ng-template>\n\n<ng-template #defaultAccordionHeaderContentTemplate>\n <ng-content />\n</ng-template>\n\n<ng-template #defaultAccordionBodyTemplate>\n <div class=\"accordion-body\">\n <ng-container\n *ngTemplateOutlet=\"tmpl['accordionBody'] || defaultAccordionBodyContentTemplate; context: itemContext\">\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #defaultAccordionBodyContentTemplate>\n <ng-content />\n</ng-template>\n", styles: [":host{display:block;overflow:hidden}\n"], dependencies: [{ kind: "directive", type: AccordionButtonDirective, selector: "[cAccordionButton]", inputs: ["collapsed", "type"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CollapseDirective, selector: "[cCollapse]", inputs: ["animate", "horizontal", "visible", "navbar", "duration", "transition"], outputs: ["visibleChange", "collapseChange"], exportAs: ["cCollapse"] }] }); }
|
|
473
479
|
}
|
|
474
480
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: AccordionItemComponent, decorators: [{
|
|
475
481
|
type: Component,
|
|
476
|
-
args: [{ selector: 'c-accordion-item', exportAs: 'cAccordionItem', imports: [AccordionButtonDirective, NgTemplateOutlet, CollapseDirective], host: { class: 'accordion-item' }, template: "@let tmpl = templates();\n<ng-container>\n <div class=\"accordion-header\">\n <ng-container *ngTemplateOutlet=\"tmpl['accordionHeaderTemplate'] || defaultAccordionHeaderTemplate; context: itemContext\" />\n </div>\n <div class=\"accordion-collapse\" cCollapse [visible]=\"
|
|
477
|
-
}]
|
|
478
|
-
type: Input,
|
|
479
|
-
args: [{ transform: booleanAttribute }]
|
|
480
|
-
}], open: [{
|
|
481
|
-
type: Input
|
|
482
|
-
}] } });
|
|
482
|
+
args: [{ selector: 'c-accordion-item', exportAs: 'cAccordionItem', imports: [AccordionButtonDirective, NgTemplateOutlet, CollapseDirective], host: { class: 'accordion-item' }, template: "@let tmpl = templates();\n<ng-container>\n <div class=\"accordion-header\">\n <ng-container *ngTemplateOutlet=\"tmpl['accordionHeaderTemplate'] || defaultAccordionHeaderTemplate; context: itemContext\" />\n </div>\n <div class=\"accordion-collapse\" cCollapse [visible]=\"itemVisible()\" [attr.aria-expanded]=\"itemVisible()\" [id]=\"contentId\">\n <ng-container *ngTemplateOutlet=\"tmpl['accordionBodyTemplate'] || defaultAccordionBodyTemplate; context: itemContext\" />\n </div>\n</ng-container>\n\n<ng-template #defaultAccordionHeaderTemplate>\n <button cAccordionButton [collapsed]=\"!itemVisible()\" [attr.aria-controls]=\"contentId\" (click)=\"toggleItem()\">\n <ng-container\n *ngTemplateOutlet=\"tmpl['accordionHeader'] || defaultAccordionHeaderContentTemplate; context: itemContext\">\n </ng-container>\n </button>\n</ng-template>\n\n<ng-template #defaultAccordionHeaderContentTemplate>\n <ng-content />\n</ng-template>\n\n<ng-template #defaultAccordionBodyTemplate>\n <div class=\"accordion-body\">\n <ng-container\n *ngTemplateOutlet=\"tmpl['accordionBody'] || defaultAccordionBodyContentTemplate; context: itemContext\">\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #defaultAccordionBodyContentTemplate>\n <ng-content />\n</ng-template>\n", styles: [":host{display:block;overflow:hidden}\n"] }]
|
|
483
|
+
}] });
|
|
483
484
|
|
|
484
485
|
class AccordionModule {
|
|
485
486
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: AccordionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
@@ -1222,16 +1223,16 @@ class AvatarComponent {
|
|
|
1222
1223
|
});
|
|
1223
1224
|
}
|
|
1224
1225
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: AvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1225
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: AvatarComponent, isStandalone: true, selector: "c-avatar", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, textColor: { classPropertyName: "textColor", publicName: "textColor", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()" }, classAttribute: "avatar" }, hostDirectives: [{ directive: TextColorDirective, inputs: ["cTextColor", "textColor"] }], ngImport: i0, template: "<ng-content>\n @if (src()) {\n @defer (prefetch on idle) {\n <img
|
|
1226
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: AvatarComponent, isStandalone: true, selector: "c-avatar", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, textColor: { classPropertyName: "textColor", publicName: "textColor", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()" }, classAttribute: "avatar" }, hostDirectives: [{ directive: TextColorDirective, inputs: ["cTextColor", "textColor"] }], ngImport: i0, template: "<ng-content>\n @if (src()) {\n @defer (prefetch on idle) {\n <img src=\"{{src() ?? ''}}\" class=\"avatar-img\" alt=\"{{alt()}}\" />\n } @placeholder () {\n <svg aria-label=\"Avatar placeholder\"\n focusable=\"false\"\n preserveAspectRatio=\"xMidYMid slice\"\n role=\"img\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"avatar-img\"\n style=\"position: absolute; width: 100%; height: 100%; inset: 0;\">\n <rect fill=\"#868e96\" height=\"100%\" width=\"100%\"></rect>\n </svg>\n }\n }\n</ng-content>\n@if (!!status()) {\n <span [ngClass]=\"statusClass()\"></span>\n}\n\n", styles: [":host .avatar-img{object-fit:cover}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] }); }
|
|
1226
1227
|
}
|
|
1227
1228
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: AvatarComponent, decorators: [{
|
|
1228
1229
|
type: Component,
|
|
1229
|
-
args: [{ selector: 'c-avatar', imports: [NgClass
|
|
1230
|
+
args: [{ selector: 'c-avatar', imports: [NgClass], hostDirectives: [
|
|
1230
1231
|
{
|
|
1231
1232
|
directive: TextColorDirective,
|
|
1232
1233
|
inputs: ['cTextColor: textColor']
|
|
1233
1234
|
}
|
|
1234
|
-
], host: { class: 'avatar', '[class]': 'hostClasses()' }, template: "<ng-content>\n @if (src()) {\n @defer (prefetch on idle) {\n <img
|
|
1235
|
+
], host: { class: 'avatar', '[class]': 'hostClasses()' }, template: "<ng-content>\n @if (src()) {\n @defer (prefetch on idle) {\n <img src=\"{{src() ?? ''}}\" class=\"avatar-img\" alt=\"{{alt()}}\" />\n } @placeholder () {\n <svg aria-label=\"Avatar placeholder\"\n focusable=\"false\"\n preserveAspectRatio=\"xMidYMid slice\"\n role=\"img\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"avatar-img\"\n style=\"position: absolute; width: 100%; height: 100%; inset: 0;\">\n <rect fill=\"#868e96\" height=\"100%\" width=\"100%\"></rect>\n </svg>\n }\n }\n</ng-content>\n@if (!!status()) {\n <span [ngClass]=\"statusClass()\"></span>\n}\n\n", styles: [":host .avatar-img{object-fit:cover}\n"] }]
|
|
1235
1236
|
}] });
|
|
1236
1237
|
|
|
1237
1238
|
class AvatarModule {
|