aeb-ui-kit 9.1.0-preview.1135 → 9.1.0-preview.1138
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/aeb-ui-kit.mjs +48 -21
- package/fesm2022/aeb-ui-kit.mjs.map +1 -1
- package/index.d.ts +16 -7
- package/package.json +1 -1
package/fesm2022/aeb-ui-kit.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { signal, viewChild, input, computed, effect, HostBinding, ViewEncapsulation, Component, NgModule, Input, Directive, inject, ElementRef, HostListener, ContentChild, ChangeDetectionStrategy, Renderer2, EventEmitter, forwardRef, Output, ViewChild, ComponentFactoryResolver, Injector, ApplicationRef, RendererFactory2, Injectable, output, Pipe, LOCALE_ID, ChangeDetectorRef, ContentChildren, TemplateRef, ViewChildren } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule, DOCUMENT, formatDate, formatNumber } from '@angular/common';
|
|
5
5
|
import * as i3 from '@angular/forms';
|
|
@@ -12,35 +12,62 @@ import '@angular/common/locales/global/ru';
|
|
|
12
12
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
13
13
|
|
|
14
14
|
class AccordionComponent {
|
|
15
|
+
get isOpen() {
|
|
16
|
+
return this._isOpen();
|
|
17
|
+
}
|
|
18
|
+
get isPrimary() {
|
|
19
|
+
return this.type() === 'primary';
|
|
20
|
+
}
|
|
21
|
+
get isSecondary() {
|
|
22
|
+
return this.type() === 'secondary';
|
|
23
|
+
}
|
|
15
24
|
constructor() {
|
|
16
|
-
this.
|
|
25
|
+
this._isOpen = signal(false, ...(ngDevMode ? [{ debugName: "_isOpen" }] : []));
|
|
26
|
+
this.content = viewChild('content', ...(ngDevMode ? [{ debugName: "content" }] : []));
|
|
27
|
+
this._contentHeight = signal(0, ...(ngDevMode ? [{ debugName: "_contentHeight" }] : []));
|
|
28
|
+
this.isAccordion = true;
|
|
29
|
+
this.header = input('', ...(ngDevMode ? [{ debugName: "header" }] : []));
|
|
30
|
+
this.type = input('primary', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
31
|
+
this.contentHeight = computed(() => this._contentHeight(), ...(ngDevMode ? [{ debugName: "contentHeight" }] : []));
|
|
32
|
+
effect(() => {
|
|
33
|
+
const contentEl = this.content();
|
|
34
|
+
if (contentEl) {
|
|
35
|
+
this.setupResizeObserver(contentEl.nativeElement);
|
|
36
|
+
this._contentHeight.set(contentEl.nativeElement.scrollHeight);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
17
39
|
}
|
|
18
|
-
|
|
19
|
-
this.
|
|
20
|
-
this.normalizeTransition();
|
|
40
|
+
ngOnDestroy() {
|
|
41
|
+
this.resizeObserver?.disconnect();
|
|
21
42
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
this.content.nativeElement.style.height = `${this.content.nativeElement.scrollHeight}px`;
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
this.content.nativeElement.style.height = '0';
|
|
28
|
-
}
|
|
43
|
+
openHandler() {
|
|
44
|
+
this._isOpen.set(!this._isOpen());
|
|
29
45
|
}
|
|
30
|
-
|
|
31
|
-
this.
|
|
46
|
+
setupResizeObserver(element) {
|
|
47
|
+
this.resizeObserver?.disconnect();
|
|
48
|
+
this.resizeObserver = new ResizeObserver(() => {
|
|
49
|
+
this._contentHeight.set(element.scrollHeight);
|
|
50
|
+
});
|
|
51
|
+
this.resizeObserver.observe(element);
|
|
32
52
|
}
|
|
33
53
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
34
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
54
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.2.4", type: AccordionComponent, isStandalone: false, selector: "aeb-accordion", inputs: { header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.aeb-accordion": "this.isAccordion", "class.aeb-accordion--open": "this.isOpen", "class.aeb-accordion--primary": "this.isPrimary", "class.aeb-accordion--secondary": "this.isSecondary" } }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"aeb-accordion__header\" (click)=\"openHandler()\">\n <span class=\"aeb-accordion__heading\">\n {{ header() }}\n </span>\n <div class=\"aeb-accordion__arrow-icon\">\n <svg\n width=\"32\"\n height=\"32\"\n viewBox=\"0 0 32 32\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M6.66675 11.3333L15.6465 20.3131C15.8418 20.5083 16.1584 20.5083 16.3536 20.3131L25.3334 11.3333\"\n stroke=\"#1F2632\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n />\n </svg>\n </div>\n</div>\n<div\n class=\"aeb-accordion__content\"\n [style.height]=\"isOpen ? contentHeight() + 'px' : '0'\"\n>\n <div #content class=\"aeb-accordion__content-inner\">\n <ng-content />\n </div>\n</div>\n", styles: [".aeb-accordion{display:block;box-sizing:border-box;width:100%;color:var(--c-t-primary);cursor:pointer;border-radius:32px;transition:background-color .2s;-webkit-user-select:none;user-select:none;overflow:hidden}@media screen and (max-width: 599px){.aeb-accordion{border-radius:20px}}@media screen and (min-width: 600px) and (max-width: 1200px){.aeb-accordion{border-radius:24px}}.aeb-accordion--primary{background-color:var(--c-bg-light);box-shadow:0 2px 8px #27303e1a}.aeb-accordion--secondary{background-color:var(--c-bg-surface)}.aeb-accordion__header{display:flex;align-items:center;justify-content:space-between;padding:32px;font-size:22px;font-weight:500}.aeb-accordion__header:hover .aeb-accordion__heading{color:var(--c-t-secondary)}.aeb-accordion__header:hover .aeb-accordion__arrow-icon svg path{stroke:var(--c-i-secondary)}@media screen and (max-width: 599px){.aeb-accordion__header{padding:20px;font-size:16px}}@media screen and (min-width: 600px) and (max-width: 1200px){.aeb-accordion__header{padding:24px;font-size:18px}}.aeb-accordion__arrow-icon{display:flex;align-items:center;transition:transform .4s ease-in-out;width:32px;height:32px}@media screen and (max-width: 1200px){.aeb-accordion__arrow-icon{width:24px;height:24px}}.aeb-accordion__content{overflow:hidden;height:0;transition:height .4s ease-in-out;background-color:var(--c-bg-light)}.aeb-accordion__content-inner{padding:0 32px 32px;line-height:1.6;-webkit-user-select:text;user-select:text}@media screen and (max-width: 599px){.aeb-accordion__content-inner{padding:0 20px 20px}}@media screen and (min-width: 600px) and (max-width: 1200px){.aeb-accordion__content-inner{padding:0 24px 24px}}.aeb-accordion--open .aeb-accordion__arrow-icon{transform:rotate(180deg)}\n"], encapsulation: i0.ViewEncapsulation.None }); }
|
|
35
55
|
}
|
|
36
56
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AccordionComponent, decorators: [{
|
|
37
57
|
type: Component,
|
|
38
|
-
args: [{ selector: 'aeb-accordion', encapsulation: ViewEncapsulation.None, standalone: false, template: "<div class=\"aeb-
|
|
39
|
-
}], propDecorators: {
|
|
40
|
-
type:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
58
|
+
args: [{ selector: 'aeb-accordion', encapsulation: ViewEncapsulation.None, standalone: false, template: "<div class=\"aeb-accordion__header\" (click)=\"openHandler()\">\n <span class=\"aeb-accordion__heading\">\n {{ header() }}\n </span>\n <div class=\"aeb-accordion__arrow-icon\">\n <svg\n width=\"32\"\n height=\"32\"\n viewBox=\"0 0 32 32\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M6.66675 11.3333L15.6465 20.3131C15.8418 20.5083 16.1584 20.5083 16.3536 20.3131L25.3334 11.3333\"\n stroke=\"#1F2632\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n />\n </svg>\n </div>\n</div>\n<div\n class=\"aeb-accordion__content\"\n [style.height]=\"isOpen ? contentHeight() + 'px' : '0'\"\n>\n <div #content class=\"aeb-accordion__content-inner\">\n <ng-content />\n </div>\n</div>\n", styles: [".aeb-accordion{display:block;box-sizing:border-box;width:100%;color:var(--c-t-primary);cursor:pointer;border-radius:32px;transition:background-color .2s;-webkit-user-select:none;user-select:none;overflow:hidden}@media screen and (max-width: 599px){.aeb-accordion{border-radius:20px}}@media screen and (min-width: 600px) and (max-width: 1200px){.aeb-accordion{border-radius:24px}}.aeb-accordion--primary{background-color:var(--c-bg-light);box-shadow:0 2px 8px #27303e1a}.aeb-accordion--secondary{background-color:var(--c-bg-surface)}.aeb-accordion__header{display:flex;align-items:center;justify-content:space-between;padding:32px;font-size:22px;font-weight:500}.aeb-accordion__header:hover .aeb-accordion__heading{color:var(--c-t-secondary)}.aeb-accordion__header:hover .aeb-accordion__arrow-icon svg path{stroke:var(--c-i-secondary)}@media screen and (max-width: 599px){.aeb-accordion__header{padding:20px;font-size:16px}}@media screen and (min-width: 600px) and (max-width: 1200px){.aeb-accordion__header{padding:24px;font-size:18px}}.aeb-accordion__arrow-icon{display:flex;align-items:center;transition:transform .4s ease-in-out;width:32px;height:32px}@media screen and (max-width: 1200px){.aeb-accordion__arrow-icon{width:24px;height:24px}}.aeb-accordion__content{overflow:hidden;height:0;transition:height .4s ease-in-out;background-color:var(--c-bg-light)}.aeb-accordion__content-inner{padding:0 32px 32px;line-height:1.6;-webkit-user-select:text;user-select:text}@media screen and (max-width: 599px){.aeb-accordion__content-inner{padding:0 20px 20px}}@media screen and (min-width: 600px) and (max-width: 1200px){.aeb-accordion__content-inner{padding:0 24px 24px}}.aeb-accordion--open .aeb-accordion__arrow-icon{transform:rotate(180deg)}\n"] }]
|
|
59
|
+
}], ctorParameters: () => [], propDecorators: { isAccordion: [{
|
|
60
|
+
type: HostBinding,
|
|
61
|
+
args: ['class.aeb-accordion']
|
|
62
|
+
}], isOpen: [{
|
|
63
|
+
type: HostBinding,
|
|
64
|
+
args: ['class.aeb-accordion--open']
|
|
65
|
+
}], isPrimary: [{
|
|
66
|
+
type: HostBinding,
|
|
67
|
+
args: ['class.aeb-accordion--primary']
|
|
68
|
+
}], isSecondary: [{
|
|
69
|
+
type: HostBinding,
|
|
70
|
+
args: ['class.aeb-accordion--secondary']
|
|
44
71
|
}] } });
|
|
45
72
|
|
|
46
73
|
class AccordionModule {
|