aeb-ui-kit 9.1.0-preview.1132 → 9.1.0-preview.1135
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 +86 -114
- package/fesm2022/aeb-ui-kit.mjs.map +1 -1
- package/index.d.ts +14 -24
- package/package.json +1 -1
package/fesm2022/aeb-ui-kit.mjs
CHANGED
|
@@ -3880,146 +3880,118 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImpor
|
|
|
3880
3880
|
}] });
|
|
3881
3881
|
|
|
3882
3882
|
const defaultAmountOptions = [
|
|
3883
|
-
{ value: 10, label: '
|
|
3884
|
-
{ value: 20, label: '
|
|
3885
|
-
{ value: 30, label: '
|
|
3883
|
+
{ value: 10, label: '10 на странице' },
|
|
3884
|
+
{ value: 20, label: '20 на странице' },
|
|
3885
|
+
{ value: 30, label: '30 на странице' }
|
|
3886
3886
|
];
|
|
3887
3887
|
class PaginationComponent {
|
|
3888
3888
|
constructor() {
|
|
3889
3889
|
this.baseSize = 7;
|
|
3890
|
-
this.totalPages = 1500;
|
|
3891
|
-
this.currentPage = 1;
|
|
3892
|
-
this.usePageSizeSelector = false;
|
|
3893
|
-
this.pageSize = 10;
|
|
3894
|
-
this.btnType = 'text';
|
|
3895
|
-
this.size = 'L';
|
|
3896
|
-
this.pageSelect = new EventEmitter();
|
|
3897
|
-
this.amountChange = new EventEmitter();
|
|
3898
3890
|
this.isPagination = true;
|
|
3891
|
+
this.activePage = signal(1, ...(ngDevMode ? [{ debugName: "activePage" }] : []));
|
|
3892
|
+
this.totalPages = input(1500, ...(ngDevMode ? [{ debugName: "totalPages" }] : []));
|
|
3893
|
+
this.currentPage = input(1, ...(ngDevMode ? [{ debugName: "currentPage" }] : []));
|
|
3894
|
+
this.usePageSizeSelector = input(false, ...(ngDevMode ? [{ debugName: "usePageSizeSelector" }] : []));
|
|
3895
|
+
this.pageSize = input(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : []));
|
|
3896
|
+
this.pageSelect = output();
|
|
3897
|
+
this.amountChange = output();
|
|
3899
3898
|
this.pageSizeControl = new FormControl(10);
|
|
3900
|
-
this.head =
|
|
3901
|
-
|
|
3899
|
+
this.head = computed(() => {
|
|
3900
|
+
const total = this.totalPages();
|
|
3901
|
+
const page = this.activePage();
|
|
3902
|
+
if (total <= this.baseSize) {
|
|
3903
|
+
return null;
|
|
3904
|
+
}
|
|
3905
|
+
if (page <= 4) {
|
|
3906
|
+
return null;
|
|
3907
|
+
}
|
|
3908
|
+
return 1;
|
|
3909
|
+
}, ...(ngDevMode ? [{ debugName: "head" }] : []));
|
|
3910
|
+
this.middle = computed(() => {
|
|
3911
|
+
const total = this.totalPages();
|
|
3912
|
+
const page = this.activePage();
|
|
3913
|
+
const result = [];
|
|
3914
|
+
if (total <= this.baseSize) {
|
|
3915
|
+
for (let i = 1; i <= total; i++) {
|
|
3916
|
+
result.push(i);
|
|
3917
|
+
}
|
|
3918
|
+
return result;
|
|
3919
|
+
}
|
|
3920
|
+
if (page <= 4) {
|
|
3921
|
+
for (let i = 1; i <= 5; i++) {
|
|
3922
|
+
result.push(i);
|
|
3923
|
+
}
|
|
3924
|
+
return result;
|
|
3925
|
+
}
|
|
3926
|
+
if (page >= total - 3) {
|
|
3927
|
+
for (let i = total - 4; i <= total; i++) {
|
|
3928
|
+
result.push(i);
|
|
3929
|
+
}
|
|
3930
|
+
return result;
|
|
3931
|
+
}
|
|
3932
|
+
for (let i = page - 1; i <= page + 1; i++) {
|
|
3933
|
+
result.push(i);
|
|
3934
|
+
}
|
|
3935
|
+
return result;
|
|
3936
|
+
}, ...(ngDevMode ? [{ debugName: "middle" }] : []));
|
|
3937
|
+
this.tail = computed(() => {
|
|
3938
|
+
const total = this.totalPages();
|
|
3939
|
+
const page = this.activePage();
|
|
3940
|
+
if (total <= this.baseSize) {
|
|
3941
|
+
return null;
|
|
3942
|
+
}
|
|
3943
|
+
if (page <= 4) {
|
|
3944
|
+
return total;
|
|
3945
|
+
}
|
|
3946
|
+
if (page >= total - 3) {
|
|
3947
|
+
return null;
|
|
3948
|
+
}
|
|
3949
|
+
return total;
|
|
3950
|
+
}, ...(ngDevMode ? [{ debugName: "tail" }] : []));
|
|
3902
3951
|
this.amountOptions = defaultAmountOptions;
|
|
3952
|
+
this.pageSizeControl.setValue(this.pageSize());
|
|
3903
3953
|
}
|
|
3904
3954
|
headPageHandler(page) {
|
|
3905
|
-
this.
|
|
3906
|
-
this.
|
|
3907
|
-
this.pageSelect.emit(this.currentPage);
|
|
3908
|
-
}
|
|
3909
|
-
ngOnChanges(changes) {
|
|
3910
|
-
if (this.currentPage &&
|
|
3911
|
-
changes.currentPage &&
|
|
3912
|
-
!changes.currentPage.firstChange) {
|
|
3913
|
-
if (changes.currentPage.currentValue !== changes.currentPage.previousValue) {
|
|
3914
|
-
this.renderPages(changes.currentPage.currentValue);
|
|
3915
|
-
}
|
|
3916
|
-
}
|
|
3917
|
-
if (changes.totalPages && this.middle) {
|
|
3918
|
-
this.currentPage = 1;
|
|
3919
|
-
this.renderPages(this.currentPage);
|
|
3920
|
-
this.pageSelect.emit(this.currentPage);
|
|
3921
|
-
}
|
|
3955
|
+
this.activePage.set(page);
|
|
3956
|
+
this.pageSelect.emit(this.activePage());
|
|
3922
3957
|
}
|
|
3923
|
-
ngOnInit() {
|
|
3924
|
-
this.pageSizeControl.setValue(this.pageSize);
|
|
3925
|
-
this.renderPages(this.currentPage);
|
|
3926
|
-
}
|
|
3927
|
-
ngOnDestroy() { }
|
|
3928
3958
|
handleChangePageSize(pageSize) {
|
|
3929
3959
|
this.amountChange.emit(pageSize);
|
|
3930
3960
|
}
|
|
3931
3961
|
middlePageHandler(page) {
|
|
3932
|
-
this.
|
|
3933
|
-
this.
|
|
3934
|
-
this.pageSelect.emit(this.currentPage);
|
|
3962
|
+
this.activePage.set(page);
|
|
3963
|
+
this.pageSelect.emit(this.activePage());
|
|
3935
3964
|
}
|
|
3936
3965
|
nextPageHandler() {
|
|
3937
|
-
|
|
3966
|
+
const current = this.activePage();
|
|
3967
|
+
const total = this.totalPages();
|
|
3968
|
+
if (current === total) {
|
|
3938
3969
|
return;
|
|
3939
3970
|
}
|
|
3940
|
-
const nextPage =
|
|
3941
|
-
this.
|
|
3942
|
-
this.
|
|
3943
|
-
this.pageSelect.emit(this.currentPage);
|
|
3971
|
+
const nextPage = current + 1;
|
|
3972
|
+
this.activePage.set(nextPage);
|
|
3973
|
+
this.pageSelect.emit(this.activePage());
|
|
3944
3974
|
}
|
|
3945
3975
|
prevPageHandler() {
|
|
3946
|
-
|
|
3976
|
+
const current = this.activePage();
|
|
3977
|
+
if (current === 1) {
|
|
3947
3978
|
return;
|
|
3948
3979
|
}
|
|
3949
|
-
const prevPage =
|
|
3950
|
-
this.
|
|
3951
|
-
this.
|
|
3952
|
-
this.pageSelect.emit(this.currentPage);
|
|
3980
|
+
const prevPage = current - 1;
|
|
3981
|
+
this.activePage.set(prevPage);
|
|
3982
|
+
this.pageSelect.emit(this.activePage());
|
|
3953
3983
|
}
|
|
3954
3984
|
tailPageHandler(page) {
|
|
3955
|
-
this.
|
|
3956
|
-
this.
|
|
3957
|
-
this.pageSelect.emit(this.currentPage);
|
|
3958
|
-
}
|
|
3959
|
-
/**
|
|
3960
|
-
* Результатом работы являются заполненные массивы головной, средней и конечной частей пагинации
|
|
3961
|
-
*
|
|
3962
|
-
* @param currentPage текущая страница
|
|
3963
|
-
*/
|
|
3964
|
-
renderPages(currentPage) {
|
|
3965
|
-
this.head = null;
|
|
3966
|
-
this.middle = [];
|
|
3967
|
-
this.tail = null;
|
|
3968
|
-
if (this.totalPages <= this.baseSize) {
|
|
3969
|
-
// Если общее количество страниц меньше или равно максимальному количеству отображаемых страниц,
|
|
3970
|
-
// все страницы находятся в массиве middle
|
|
3971
|
-
for (let i = 1; i <= this.totalPages; i++) {
|
|
3972
|
-
this.middle.push(i);
|
|
3973
|
-
}
|
|
3974
|
-
}
|
|
3975
|
-
else {
|
|
3976
|
-
if (currentPage <= 4) {
|
|
3977
|
-
// Первые 5 страниц: [1 2 3 4 5 ...]
|
|
3978
|
-
for (let i = 1; i <= 5; i++) {
|
|
3979
|
-
this.middle.push(i);
|
|
3980
|
-
}
|
|
3981
|
-
this.tail = this.totalPages;
|
|
3982
|
-
}
|
|
3983
|
-
else if (currentPage >= this.totalPages - 3) {
|
|
3984
|
-
// Последние 5 страниц: [1 ... 96 97 98 99 100]
|
|
3985
|
-
this.head = 1;
|
|
3986
|
-
for (let i = this.totalPages - 4; i <= this.totalPages; i++) {
|
|
3987
|
-
this.middle.push(i);
|
|
3988
|
-
}
|
|
3989
|
-
}
|
|
3990
|
-
else {
|
|
3991
|
-
// Страницы между head и tail
|
|
3992
|
-
this.head = 1;
|
|
3993
|
-
for (let i = currentPage - 1; i <= currentPage + 1; i++) {
|
|
3994
|
-
this.middle.push(i);
|
|
3995
|
-
}
|
|
3996
|
-
this.tail = this.totalPages;
|
|
3997
|
-
}
|
|
3998
|
-
}
|
|
3985
|
+
this.activePage.set(page);
|
|
3986
|
+
this.pageSelect.emit(this.activePage());
|
|
3999
3987
|
}
|
|
4000
3988
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: PaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4001
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
3989
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.4", type: PaginationComponent, isStandalone: false, selector: "aeb-pagination", inputs: { totalPages: { classPropertyName: "totalPages", publicName: "totalPages", isSignal: true, isRequired: false, transformFunction: null }, currentPage: { classPropertyName: "currentPage", publicName: "currentPage", isSignal: true, isRequired: false, transformFunction: null }, usePageSizeSelector: { classPropertyName: "usePageSizeSelector", publicName: "usePageSizeSelector", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageSelect: "pageSelect", amountChange: "amountChange" }, host: { properties: { "class.aeb-pagination": "this.isPagination" } }, ngImport: i0, template: "<button\n (click)=\"prevPageHandler()\"\n class=\"aeb-pagination__button\"\n [ngClass]=\"{\n 'aeb-pagination__button--disabled': activePage() === 1\n }\"\n>\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M14 16L10.0707 12.0707C10.0317 12.0317 10.0317 11.9683 10.0707 11.9293L14 8\"\n stroke=\"#2F88F0\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n />\n </svg>\n</button>\n\n@if (head()) {\n <button (click)=\"headPageHandler(head())\" class=\"aeb-pagination__button\">\n {{ head() }}\n </button>\n}\n\n@if (head()) {\n <div class=\"aeb-pagination__breaker\">...</div>\n}\n\n@for (page of middle(); track page) {\n <button\n (click)=\"middlePageHandler(page)\"\n class=\"aeb-pagination__button\"\n [ngClass]=\"{\n 'aeb-pagination__button--active': activePage() === page\n }\"\n >\n {{ page }}\n </button>\n}\n\n@if (tail()) {\n <div class=\"aeb-pagination__breaker\">...</div>\n}\n\n@if (tail()) {\n <button\n (click)=\"tailPageHandler(tail())\"\n class=\"aeb-pagination__button\"\n [ngClass]=\"{\n 'aeb-pagination__button--active': activePage() === tail()\n }\"\n >\n {{ tail() }}\n </button>\n}\n\n<button\n (click)=\"nextPageHandler()\"\n class=\"aeb-pagination__button aeb-pagination__button--reversed\"\n [ngClass]=\"{\n 'aeb-pagination__button--disabled': activePage() === totalPages()\n }\"\n>\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M14 16L10.0707 12.0707C10.0317 12.0317 10.0317 11.9683 10.0707 11.9293L14 8\"\n stroke=\"#2F88F0\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n />\n </svg>\n</button>\n\n@if (usePageSizeSelector()) {\n <div class=\"aeb-pagination__select-container\">\n <aeb-select\n class=\"aeb-pagination__select\"\n [direction]=\"'top'\"\n (optionSelect)=\"handleChangePageSize($event)\"\n [formControl]=\"pageSizeControl\"\n [options]=\"amountOptions\"\n [label]=\"'\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u043F\u043E'\"\n >\n </aeb-select>\n </div>\n}\n", styles: [".aeb-pagination{gap:8px;display:flex;position:relative;align-items:center;justify-content:center;color:var(--c-t-primary-white)}@media screen and (max-width: 900px){.aeb-pagination{gap:6px}}.aeb-pagination__button{padding:0;border:none;outline:none;display:flex;cursor:pointer;align-items:center;justify-content:center;background:transparent;color:var(--c-t-links);font-family:inherit;width:48px;height:48px;border-radius:12px;font-weight:400}.aeb-pagination__button:hover,.aeb-pagination__button:focus{background-color:var(--c-bg-surface)}.aeb-pagination__button--active{color:var(--c-t-primary-white);background-color:var(--c-btn-p-default)}.aeb-pagination__button--active:hover,.aeb-pagination__button--active:focus{background-color:var(--c-btn-p-default)}.aeb-pagination__button--disabled{opacity:.5;cursor:not-allowed}.aeb-pagination__button--reversed{transform:rotate(180deg)}@media screen and (max-width: 900px){.aeb-pagination__button{width:24px;height:24px;font-size:12px;border-radius:8px}}.aeb-pagination__breaker{-webkit-user-select:none;user-select:none;text-align:center;color:var(--c-t-links);width:48px;height:48px;font-size:16px;display:flex;align-items:center;justify-content:center}@media screen and (max-width: 900px){.aeb-pagination__breaker{font-size:12px;width:24px;height:24px}}.aeb-pagination__select-container{width:192px}@media screen and (max-width: 900px){.aeb-pagination__select-container{display:none}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: SelectComponent, selector: "aeb-select", inputs: ["label", "options", "hasError", "disabled", "direction"], outputs: ["optionSelect"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
4002
3990
|
}
|
|
4003
3991
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: PaginationComponent, decorators: [{
|
|
4004
3992
|
type: Component,
|
|
4005
|
-
args: [{ selector: 'aeb-pagination', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<button
|
|
4006
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
4007
|
-
type: Input
|
|
4008
|
-
}], currentPage: [{
|
|
4009
|
-
type: Input
|
|
4010
|
-
}], usePageSizeSelector: [{
|
|
4011
|
-
type: Input
|
|
4012
|
-
}], pageSize: [{
|
|
4013
|
-
type: Input
|
|
4014
|
-
}], btnType: [{
|
|
4015
|
-
type: Input
|
|
4016
|
-
}], size: [{
|
|
4017
|
-
type: Input
|
|
4018
|
-
}], pageSelect: [{
|
|
4019
|
-
type: Output
|
|
4020
|
-
}], amountChange: [{
|
|
4021
|
-
type: Output
|
|
4022
|
-
}], isPagination: [{
|
|
3993
|
+
args: [{ selector: 'aeb-pagination', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<button\n (click)=\"prevPageHandler()\"\n class=\"aeb-pagination__button\"\n [ngClass]=\"{\n 'aeb-pagination__button--disabled': activePage() === 1\n }\"\n>\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M14 16L10.0707 12.0707C10.0317 12.0317 10.0317 11.9683 10.0707 11.9293L14 8\"\n stroke=\"#2F88F0\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n />\n </svg>\n</button>\n\n@if (head()) {\n <button (click)=\"headPageHandler(head())\" class=\"aeb-pagination__button\">\n {{ head() }}\n </button>\n}\n\n@if (head()) {\n <div class=\"aeb-pagination__breaker\">...</div>\n}\n\n@for (page of middle(); track page) {\n <button\n (click)=\"middlePageHandler(page)\"\n class=\"aeb-pagination__button\"\n [ngClass]=\"{\n 'aeb-pagination__button--active': activePage() === page\n }\"\n >\n {{ page }}\n </button>\n}\n\n@if (tail()) {\n <div class=\"aeb-pagination__breaker\">...</div>\n}\n\n@if (tail()) {\n <button\n (click)=\"tailPageHandler(tail())\"\n class=\"aeb-pagination__button\"\n [ngClass]=\"{\n 'aeb-pagination__button--active': activePage() === tail()\n }\"\n >\n {{ tail() }}\n </button>\n}\n\n<button\n (click)=\"nextPageHandler()\"\n class=\"aeb-pagination__button aeb-pagination__button--reversed\"\n [ngClass]=\"{\n 'aeb-pagination__button--disabled': activePage() === totalPages()\n }\"\n>\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M14 16L10.0707 12.0707C10.0317 12.0317 10.0317 11.9683 10.0707 11.9293L14 8\"\n stroke=\"#2F88F0\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n />\n </svg>\n</button>\n\n@if (usePageSizeSelector()) {\n <div class=\"aeb-pagination__select-container\">\n <aeb-select\n class=\"aeb-pagination__select\"\n [direction]=\"'top'\"\n (optionSelect)=\"handleChangePageSize($event)\"\n [formControl]=\"pageSizeControl\"\n [options]=\"amountOptions\"\n [label]=\"'\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u043F\u043E'\"\n >\n </aeb-select>\n </div>\n}\n", styles: [".aeb-pagination{gap:8px;display:flex;position:relative;align-items:center;justify-content:center;color:var(--c-t-primary-white)}@media screen and (max-width: 900px){.aeb-pagination{gap:6px}}.aeb-pagination__button{padding:0;border:none;outline:none;display:flex;cursor:pointer;align-items:center;justify-content:center;background:transparent;color:var(--c-t-links);font-family:inherit;width:48px;height:48px;border-radius:12px;font-weight:400}.aeb-pagination__button:hover,.aeb-pagination__button:focus{background-color:var(--c-bg-surface)}.aeb-pagination__button--active{color:var(--c-t-primary-white);background-color:var(--c-btn-p-default)}.aeb-pagination__button--active:hover,.aeb-pagination__button--active:focus{background-color:var(--c-btn-p-default)}.aeb-pagination__button--disabled{opacity:.5;cursor:not-allowed}.aeb-pagination__button--reversed{transform:rotate(180deg)}@media screen and (max-width: 900px){.aeb-pagination__button{width:24px;height:24px;font-size:12px;border-radius:8px}}.aeb-pagination__breaker{-webkit-user-select:none;user-select:none;text-align:center;color:var(--c-t-links);width:48px;height:48px;font-size:16px;display:flex;align-items:center;justify-content:center}@media screen and (max-width: 900px){.aeb-pagination__breaker{font-size:12px;width:24px;height:24px}}.aeb-pagination__select-container{width:192px}@media screen and (max-width: 900px){.aeb-pagination__select-container{display:none}}\n"] }]
|
|
3994
|
+
}], ctorParameters: () => [], propDecorators: { isPagination: [{
|
|
4023
3995
|
type: HostBinding,
|
|
4024
3996
|
args: ['class.aeb-pagination']
|
|
4025
3997
|
}] } });
|
|
@@ -5456,13 +5428,13 @@ class AebSwitchComponent {
|
|
|
5456
5428
|
this.renderer.setAttribute(el, 'aria-checked', String(this.checked));
|
|
5457
5429
|
}
|
|
5458
5430
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AebSwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5459
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
5431
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.4", type: AebSwitchComponent, isStandalone: false, selector: "aeb-switch", inputs: { id: "id", name: "name", warning: "warning", label: "label" }, outputs: { changed: "changed" }, host: { listeners: { "click": "toggle($event)", "keydown.space": "onSpace($event)", "mousedown": "onPressStart()", "mouseup": "onPressEndMouseUp()", "mouseout": "onPressEndMouseOut()" }, properties: { "class.switch": "this.hostClass", "attr.role": "this.role", "attr.aria-checked": "this.ariaChecked", "class.switch--warning": "this.isWarningOrInvalid" } }, providers: [
|
|
5460
5432
|
{
|
|
5461
5433
|
provide: NG_VALUE_ACCESSOR,
|
|
5462
5434
|
useExisting: forwardRef(() => AebSwitchComponent),
|
|
5463
5435
|
multi: true
|
|
5464
5436
|
}
|
|
5465
|
-
], viewQueries: [{ propertyName: "switchInput", first: true, predicate: ["switchInput"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"switch-wrapper\">\n <label
|
|
5437
|
+
], viewQueries: [{ propertyName: "switchInput", first: true, predicate: ["switchInput"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"switch-wrapper\">\n <label\n class=\"switch\"\n [class.switch--checked]=\"checked\"\n [class.switch--warning]=\"warning || ngControl?.status === 'INVALID'\"\n [class.switch--disabled]=\"disabled\"\n [class.switch--pressed]=\"pressed\"\n tabindex=\"0\"\n >\n <input\n #switchInput\n type=\"checkbox\"\n [id]=\"id\"\n [name]=\"name\"\n class=\"visually-hidden\"\n [disabled]=\"disabled\"\n [checked]=\"checked\"\n />\n\n <span class=\"switch-slider\"></span>\n </label>\n @if (label) {\n <span class=\"switch-label\">{{ label }}</span>\n }\n</div>\n", styles: [".switch-wrapper{display:flex;align-items:center;gap:12px}.switch{outline:none;position:relative;display:inline-block;width:40px;height:24px;cursor:pointer}.switch:hover .switch-slider{filter:brightness(110%)}.switch--disabled{cursor:not-allowed}.switch--disabled:hover .switch-slider{filter:none!important}.switch--disabled .switch-slider{opacity:.5}.switch .visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0;outline:none}.switch .switch-slider{position:absolute;inset:0;background-color:var(--color-mono-100);border-radius:12px;transition:background-color .3s,filter .3s}.switch .switch-slider:before{content:\"\";position:absolute;width:18px;height:18px;top:3px;left:3px;background-color:var(--color-mono-0);border-radius:50%;transition:transform .3s}.switch--checked .switch-slider{background-color:var(--color-blue-500)}.switch--checked .switch-slider:before{transform:translate(16px)}.switch--warning .switch-slider{background-color:var(--color-red-100)}.switch--checked.switch--warning .switch-slider{background-color:var(--color-red-500)}.switch--checked.switch--warning .switch-slider:before{transform:translate(16px)}.switch--pressed .switch-slider{background-color:var(--color-mono-200)}.switch--pressed.switch--warning .switch-slider{background-color:var(--color-red-200)}.switch--pressed.switch--checked .switch-slider{background-color:var(--color-blue-600);filter:none}.switch--pressed.switch--checked .switch-slider:before{transform:translate(16px)}.switch--pressed.switch--checked.switch--warning .switch-slider{background-color:var(--color-red-600);filter:none}.switch--pressed.switch--checked.switch--warning .switch-slider:before{transform:translate(16px)}.switch-label{cursor:pointer;-webkit-user-select:none;user-select:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5466
5438
|
}
|
|
5467
5439
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AebSwitchComponent, decorators: [{
|
|
5468
5440
|
type: Component,
|
|
@@ -5472,7 +5444,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImpor
|
|
|
5472
5444
|
useExisting: forwardRef(() => AebSwitchComponent),
|
|
5473
5445
|
multi: true
|
|
5474
5446
|
}
|
|
5475
|
-
], standalone: false, template: "<div class=\"switch-wrapper\">\n <label
|
|
5447
|
+
], standalone: false, template: "<div class=\"switch-wrapper\">\n <label\n class=\"switch\"\n [class.switch--checked]=\"checked\"\n [class.switch--warning]=\"warning || ngControl?.status === 'INVALID'\"\n [class.switch--disabled]=\"disabled\"\n [class.switch--pressed]=\"pressed\"\n tabindex=\"0\"\n >\n <input\n #switchInput\n type=\"checkbox\"\n [id]=\"id\"\n [name]=\"name\"\n class=\"visually-hidden\"\n [disabled]=\"disabled\"\n [checked]=\"checked\"\n />\n\n <span class=\"switch-slider\"></span>\n </label>\n @if (label) {\n <span class=\"switch-label\">{{ label }}</span>\n }\n</div>\n", styles: [".switch-wrapper{display:flex;align-items:center;gap:12px}.switch{outline:none;position:relative;display:inline-block;width:40px;height:24px;cursor:pointer}.switch:hover .switch-slider{filter:brightness(110%)}.switch--disabled{cursor:not-allowed}.switch--disabled:hover .switch-slider{filter:none!important}.switch--disabled .switch-slider{opacity:.5}.switch .visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0;outline:none}.switch .switch-slider{position:absolute;inset:0;background-color:var(--color-mono-100);border-radius:12px;transition:background-color .3s,filter .3s}.switch .switch-slider:before{content:\"\";position:absolute;width:18px;height:18px;top:3px;left:3px;background-color:var(--color-mono-0);border-radius:50%;transition:transform .3s}.switch--checked .switch-slider{background-color:var(--color-blue-500)}.switch--checked .switch-slider:before{transform:translate(16px)}.switch--warning .switch-slider{background-color:var(--color-red-100)}.switch--checked.switch--warning .switch-slider{background-color:var(--color-red-500)}.switch--checked.switch--warning .switch-slider:before{transform:translate(16px)}.switch--pressed .switch-slider{background-color:var(--color-mono-200)}.switch--pressed.switch--warning .switch-slider{background-color:var(--color-red-200)}.switch--pressed.switch--checked .switch-slider{background-color:var(--color-blue-600);filter:none}.switch--pressed.switch--checked .switch-slider:before{transform:translate(16px)}.switch--pressed.switch--checked.switch--warning .switch-slider{background-color:var(--color-red-600);filter:none}.switch--pressed.switch--checked.switch--warning .switch-slider:before{transform:translate(16px)}.switch-label{cursor:pointer;-webkit-user-select:none;user-select:none}\n"] }]
|
|
5476
5448
|
}], ctorParameters: () => [], propDecorators: { switchInput: [{
|
|
5477
5449
|
type: ViewChild,
|
|
5478
5450
|
args: ['switchInput', { static: true }]
|