@acorex/components 7.2.2 → 7.2.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.
- package/action-sheet/lib/action-sheet.component.d.ts +6 -5
- package/action-sheet/lib/action-sheet.interface.d.ts +4 -3
- package/decorators/lib/close-button.component.d.ts +3 -2
- package/decorators/lib/content.component.d.ts +2 -1
- package/decorators/lib/footer.component.d.ts +3 -2
- package/decorators/lib/header.component.d.ts +3 -2
- package/decorators/lib/prefix.component.d.ts +2 -1
- package/decorators/lib/sub-title.component.d.ts +3 -3
- package/decorators/lib/suffix.component.d.ts +2 -1
- package/esm2022/action-sheet/lib/action-sheet.component.mjs +14 -18
- package/esm2022/action-sheet/lib/action-sheet.interface.mjs +1 -2
- package/esm2022/action-sheet/lib/action-sheet.module.mjs +21 -7
- package/esm2022/action-sheet/lib/action-sheet.service.mjs +4 -4
- package/esm2022/common/lib/components/base-component.class.mjs +1 -2
- package/esm2022/decorators/lib/close-button.component.mjs +11 -14
- package/esm2022/decorators/lib/content.component.mjs +10 -5
- package/esm2022/decorators/lib/decorators.module.mjs +10 -10
- package/esm2022/decorators/lib/footer.component.mjs +11 -14
- package/esm2022/decorators/lib/header.component.mjs +11 -14
- package/esm2022/decorators/lib/prefix.component.mjs +11 -6
- package/esm2022/decorators/lib/sub-title.component.mjs +10 -11
- package/esm2022/decorators/lib/suffix.component.mjs +10 -5
- package/esm2022/result/lib/result.component.mjs +10 -4
- package/fesm2022/acorex-components-action-sheet.mjs +31 -23
- package/fesm2022/acorex-components-action-sheet.mjs.map +1 -1
- package/fesm2022/acorex-components-common.mjs +0 -1
- package/fesm2022/acorex-components-common.mjs.map +1 -1
- package/fesm2022/acorex-components-decorators.mjs +118 -113
- package/fesm2022/acorex-components-decorators.mjs.map +1 -1
- package/fesm2022/acorex-components-result.mjs +9 -3
- package/fesm2022/acorex-components-result.mjs.map +1 -1
- package/package.json +13 -13
- package/result/lib/result.component.d.ts +1 -0
@@ -8,9 +8,9 @@ import * as i1 from '@angular/common';
|
|
8
8
|
import { CommonModule } from '@angular/common';
|
9
9
|
import * as i3 from '@acorex/components/decorators';
|
10
10
|
import { AXDecoratorModule } from '@acorex/components/decorators';
|
11
|
+
import { AXButtonModule } from '@acorex/components/button';
|
11
12
|
import { A11yModule } from '@angular/cdk/a11y';
|
12
13
|
import { DragDropModule } from '@angular/cdk/drag-drop';
|
13
|
-
import { AXButtonModule } from '@acorex/components/button';
|
14
14
|
import { AXTranslator } from '@acorex/core/translation';
|
15
15
|
import * as i1$1 from '@angular/cdk/overlay';
|
16
16
|
|
@@ -32,15 +32,11 @@ class AXActionSheetComponent extends MXBaseComponent {
|
|
32
32
|
}
|
33
33
|
ngOnInit() {
|
34
34
|
if (this.content) {
|
35
|
-
if (
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
// });
|
41
|
-
}
|
42
|
-
else if (this.content instanceof TemplateRef) {
|
43
|
-
this._selectedPortal = new TemplatePortal(this.content, this.getViewContainer(), { $implicit: this.data, ref: this });
|
35
|
+
if (this.content instanceof TemplateRef) {
|
36
|
+
this._selectedPortal = new TemplatePortal(this.content, this.getViewContainer(), {
|
37
|
+
$implicit: this.data,
|
38
|
+
ref: this,
|
39
|
+
});
|
44
40
|
this.cdr.markForCheck();
|
45
41
|
}
|
46
42
|
else if (typeof this.content === 'function') {
|
@@ -49,8 +45,8 @@ class AXActionSheetComponent extends MXBaseComponent {
|
|
49
45
|
}
|
50
46
|
}
|
51
47
|
}
|
52
|
-
onKeydownHandler(
|
53
|
-
|
48
|
+
onKeydownHandler() {
|
49
|
+
const focusedOrHasFocused = this.getHostElement().matches(':focus-within');
|
54
50
|
if (this.showCloseButton && focusedOrHasFocused) {
|
55
51
|
this.close();
|
56
52
|
}
|
@@ -71,26 +67,38 @@ class AXActionSheetComponent extends MXBaseComponent {
|
|
71
67
|
this.close();
|
72
68
|
}
|
73
69
|
onItemClick(item) {
|
74
|
-
item.onClick();
|
75
70
|
this.close();
|
71
|
+
item.onClick();
|
76
72
|
}
|
77
73
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: AXActionSheetComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
78
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: AXActionSheetComponent, selector: "ax-action-sheet", host: { listeners: { "keydown.escape": "onKeydownHandler(
|
74
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: AXActionSheetComponent, selector: "ax-action-sheet", host: { listeners: { "keydown.escape": "onKeydownHandler()" } }, usesInheritance: true, ngImport: i0, template: "<ax-header *ngIf=\"showHeader\">\n <ax-prefix>\n <ax-title>{{ title }}</ax-title>\n <ax-sub-title *ngIf=\"subTitle\">{{ subTitle }}</ax-sub-title>\n </ax-prefix>\n <ax-suffix>\n <ax-close-button\n *ngIf=\"showCloseButton\"\n (click)=\"_handleCloseClick()\"\n tabindex=\"1\"\n ></ax-close-button>\n </ax-suffix>\n</ax-header>\n<ng-template [cdkPortalOutlet]=\"_selectedPortal\" (attached)=\"_handleAttched($event)\"></ng-template>\n<div class=\"ax-action-sheet-items\">\n <ng-container *ngFor=\"let item of items\">\n <div\n class=\"ax-action-sheet-item ax-{{ item.color }}\"\n [class.ax-state-disabled]=\"item.disabled\"\n (click)=\"onItemClick(item)\"\n >\n <span class=\"item-icon\" *ngIf=\"item.icon\" [class]=\"item.icon\"></span>\n <span class=\"item-text\">{{ item.text }}</span>\n </div>\n </ng-container>\n</div>\n", styles: ["@media (max-width: 599px){ax-action-sheet{width:100vw}}@media (min-width: 600px){ax-action-sheet{width:75vw}}@media (min-width: 1200px){ax-action-sheet{width:30vw}}@media (min-width: 1800px){ax-action-sheet{width:25vw}}ax-action-sheet ax-header{padding:1rem;font-size:1.125rem;font-weight:500;border-bottom:1px solid;border-color:rgba(var(--ax-color-border-default))}ax-action-sheet ax-header ax-prefix,ax-action-sheet ax-header ax-suffix{display:flex;flex-direction:column;justify-content:flex-start}ax-action-sheet ax-header ax-prefix{align-items:flex-start}ax-action-sheet ax-header ax-suffix{align-items:flex-end}@media (max-width: 599px){ax-action-sheet ax-header{font-size:1rem}}ax-action-sheet .ax-action-sheet-items{padding:.5rem 0}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item{-webkit-user-select:none;user-select:none;cursor:pointer;padding:.75rem 1rem;display:flex}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item:hover{background-color:rgba(var(--ax-color-default))}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item .item-icon{font-size:1.5rem;margin-inline-end:.75rem}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item.ax-primary{color:rgba(var(--ax-color-primary-500))}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item.ax-secondary{color:rgba(var(--ax-color-secondary-500))}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item.ax-success{color:rgba(var(--ax-color-success-500))}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item.ax-warning{color:rgba(var(--ax-color-warning-500))}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item.ax-danger{color:rgba(var(--ax-color-danger-500))}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item.ax-info{color:rgba(var(--ax-color-info-500))}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "component", type: i3.AXDecoratorPrefixComponent, selector: "ax-prefix" }, { kind: "component", type: i3.AXDecoratorSuffixComponent, selector: "ax-suffix" }, { kind: "component", type: i3.AXDecoratorHeaderComponent, selector: "ax-header" }, { kind: "component", type: i3.AXDecoratorTitleComponent, selector: "ax-title" }, { kind: "component", type: i3.AXDecoratorSubTitleComponent, selector: "ax-sub-title" }, { kind: "component", type: i3.AXDecoratorCloseButtonComponent, selector: "ax-close-button", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
79
75
|
}
|
80
76
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: AXActionSheetComponent, decorators: [{
|
81
77
|
type: Component,
|
82
|
-
args: [{ selector: 'ax-action-sheet', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ax-header>\n <ax-title>{{ title }}</ax-title>\n <ax-close-button
|
78
|
+
args: [{ selector: 'ax-action-sheet', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ax-header *ngIf=\"showHeader\">\n <ax-prefix>\n <ax-title>{{ title }}</ax-title>\n <ax-sub-title *ngIf=\"subTitle\">{{ subTitle }}</ax-sub-title>\n </ax-prefix>\n <ax-suffix>\n <ax-close-button\n *ngIf=\"showCloseButton\"\n (click)=\"_handleCloseClick()\"\n tabindex=\"1\"\n ></ax-close-button>\n </ax-suffix>\n</ax-header>\n<ng-template [cdkPortalOutlet]=\"_selectedPortal\" (attached)=\"_handleAttched($event)\"></ng-template>\n<div class=\"ax-action-sheet-items\">\n <ng-container *ngFor=\"let item of items\">\n <div\n class=\"ax-action-sheet-item ax-{{ item.color }}\"\n [class.ax-state-disabled]=\"item.disabled\"\n (click)=\"onItemClick(item)\"\n >\n <span class=\"item-icon\" *ngIf=\"item.icon\" [class]=\"item.icon\"></span>\n <span class=\"item-text\">{{ item.text }}</span>\n </div>\n </ng-container>\n</div>\n", styles: ["@media (max-width: 599px){ax-action-sheet{width:100vw}}@media (min-width: 600px){ax-action-sheet{width:75vw}}@media (min-width: 1200px){ax-action-sheet{width:30vw}}@media (min-width: 1800px){ax-action-sheet{width:25vw}}ax-action-sheet ax-header{padding:1rem;font-size:1.125rem;font-weight:500;border-bottom:1px solid;border-color:rgba(var(--ax-color-border-default))}ax-action-sheet ax-header ax-prefix,ax-action-sheet ax-header ax-suffix{display:flex;flex-direction:column;justify-content:flex-start}ax-action-sheet ax-header ax-prefix{align-items:flex-start}ax-action-sheet ax-header ax-suffix{align-items:flex-end}@media (max-width: 599px){ax-action-sheet ax-header{font-size:1rem}}ax-action-sheet .ax-action-sheet-items{padding:.5rem 0}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item{-webkit-user-select:none;user-select:none;cursor:pointer;padding:.75rem 1rem;display:flex}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item:hover{background-color:rgba(var(--ax-color-default))}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item .item-icon{font-size:1.5rem;margin-inline-end:.75rem}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item.ax-primary{color:rgba(var(--ax-color-primary-500))}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item.ax-secondary{color:rgba(var(--ax-color-secondary-500))}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item.ax-success{color:rgba(var(--ax-color-success-500))}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item.ax-warning{color:rgba(var(--ax-color-warning-500))}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item.ax-danger{color:rgba(var(--ax-color-danger-500))}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item.ax-info{color:rgba(var(--ax-color-info-500))}\n"] }]
|
83
79
|
}], propDecorators: { onKeydownHandler: [{
|
84
80
|
type: HostListener,
|
85
|
-
args: ['keydown.escape'
|
81
|
+
args: ['keydown.escape']
|
86
82
|
}] } });
|
87
83
|
|
88
|
-
|
89
|
-
|
90
|
-
|
84
|
+
const MODULES = [
|
85
|
+
CommonModule,
|
86
|
+
AXCommonModule,
|
87
|
+
DragDropModule,
|
88
|
+
A11yModule,
|
89
|
+
AXButtonModule,
|
90
|
+
PortalModule,
|
91
|
+
AXDecoratorModule,
|
92
|
+
];
|
91
93
|
class AXActionSheetModule {
|
92
94
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: AXActionSheetModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
93
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: AXActionSheetModule, declarations: [AXActionSheetComponent], imports: [CommonModule,
|
95
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: AXActionSheetModule, declarations: [AXActionSheetComponent], imports: [CommonModule,
|
96
|
+
AXCommonModule,
|
97
|
+
DragDropModule,
|
98
|
+
A11yModule,
|
99
|
+
AXButtonModule,
|
100
|
+
PortalModule,
|
101
|
+
AXDecoratorModule], exports: [AXActionSheetComponent] }); }
|
94
102
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: AXActionSheetModule, imports: [MODULES] }); }
|
95
103
|
}
|
96
104
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: AXActionSheetModule, decorators: [{
|
@@ -127,11 +135,11 @@ class AXActionSheetService {
|
|
127
135
|
});
|
128
136
|
const actionSheet = com.instance;
|
129
137
|
actionSheet[TAB_META_KEY] = {};
|
130
|
-
actionSheet.onClosed.subscribe(c => {
|
138
|
+
actionSheet.onClosed.subscribe((c) => {
|
131
139
|
this.closePopup(actionSheet, com, c, lastActiveElement);
|
132
140
|
});
|
133
141
|
const promise = new AXComponentClosedPromise((resolve, reject) => {
|
134
|
-
actionSheet[TAB_META_KEY].close = e => {
|
142
|
+
actionSheet[TAB_META_KEY].close = (e) => {
|
135
143
|
if (resolve) {
|
136
144
|
resolve(e);
|
137
145
|
}
|
@@ -146,7 +154,7 @@ class AXActionSheetService {
|
|
146
154
|
return promise;
|
147
155
|
}
|
148
156
|
closePopup(popup, com, result, lastActiveElement) {
|
149
|
-
const closeFunc = e => {
|
157
|
+
const closeFunc = (e) => {
|
150
158
|
com.dispose();
|
151
159
|
delete e.cancel;
|
152
160
|
popup[TAB_META_KEY].close(e);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-components-action-sheet.mjs","sources":["../../../../libs/components/action-sheet/src/lib/action-sheet.component.ts","../../../../libs/components/action-sheet/src/lib/action-sheet.component.html","../../../../libs/components/action-sheet/src/lib/action-sheet.interface.ts","../../../../libs/components/action-sheet/src/lib/action-sheet.module.ts","../../../../libs/components/action-sheet/src/lib/action-sheet.service.ts","../../../../libs/components/action-sheet/src/acorex-components-action-sheet.ts"],"sourcesContent":["import { AXComponentCloseEvent, MXBaseComponent, TAB_META_KEY } from '@acorex/components/common';\nimport { CdkPortalOutletAttachedRef, ComponentPortal, Portal, TemplatePortal } from '@angular/cdk/portal';\nimport { ChangeDetectionStrategy, Component, ComponentRef, EventEmitter, HostListener, TemplateRef, ViewEncapsulation } from '@angular/core';\nimport { AXActionSheetItem } from './action-sheet.interface';\n\n@Component({\n selector: 'ax-action-sheet',\n templateUrl: './action-sheet.component.html',\n styleUrls: ['./action-sheet.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class AXActionSheetComponent extends MXBaseComponent {\n protected _selectedPortal: Portal<any>;\n title: string;\n items: AXActionSheetItem[] = [];\n content: any;\n showCloseButton: boolean = true;\n showHeader: boolean = true;\n data: any = {};\n\n onClosed: EventEmitter<AXComponentCloseEvent> = new EventEmitter<AXComponentCloseEvent>();\n\n close(): void {\n this.onClosed.emit({\n component: this[TAB_META_KEY].component,\n htmlElement: this.getHostElement(),\n });\n this.cdr.detectChanges();\n }\n\n protected ngOnInit(): void {\n if (this.content) {\n if (typeof this.content === 'string') {\n // this.rendererService.findLoadedComponentByRoute(this.content, 20).then(route => {\n // setTimeout(() => {\n // this.loadComponent(route.component);\n // }, 300);\n // });\n } else if (this.content instanceof TemplateRef) {\n this._selectedPortal = new TemplatePortal(this.content, this.getViewContainer(), { $implicit: this.data, ref: this });\n this.cdr.markForCheck();\n } else if (typeof this.content === 'function') {\n this._selectedPortal = new ComponentPortal(this.content);\n this.cdr.markForCheck();\n }\n }\n }\n\n @HostListener('keydown.escape', ['$event'])\n protected onKeydownHandler(event: KeyboardEvent) {\n let focusedOrHasFocused = this.getHostElement().matches(':focus-within');\n if (this.showCloseButton && focusedOrHasFocused) {\n this.close();\n }\n }\n\n protected _handleAttched(ref: CdkPortalOutletAttachedRef) {\n ref = ref as ComponentRef<any>;\n if (ref.instance) {\n this[TAB_META_KEY].component = ref.instance;\n Object.assign(this[TAB_META_KEY].component, this.data);\n if (ref.instance.onClosed) {\n ref.instance.onClosed.subscribe((e: AXComponentCloseEvent) => {\n this.onClosed.emit(e);\n });\n }\n }\n }\n\n protected _handleCloseClick() {\n this.close();\n }\n onItemClick(item: AXActionSheetItem) {\n item.onClick();\n this.close();\n }\n}\n","<ax-header>\n <ax-title>{{ title }}</ax-title>\n <ax-close-button (click)=\"_handleCloseClick()\" tabindex=\"1\"></ax-close-button>\n</ax-header>\n<ng-template [cdkPortalOutlet]=\"_selectedPortal\" (attached)=\"_handleAttched($event)\"></ng-template>\n<div class=\"ax-action-sheet-items\">\n <ng-container *ngFor=\"let item of items\">\n <div class=\"ax-action-sheet-item ax-{{ item.color }}\" [class.ax-state-disabled]=\"item.disabled\" (click)=\"onItemClick(item)\">\n <span class=\"item-icon\" *ngIf=\"item.icon\" [class]=\"item.icon\"></span>\n <span class=\"item-text\">{{ item.text }}</span>\n </div>\n </ng-container>\n</div>\n","import { AXStyleColorType } from \"@acorex/components/common\";\nimport { TemplateRef } from \"@angular/core\";\n\nexport interface AXActionSheetItem {\n name?: string,\n text: string,\n icon?: string;\n disabled?: boolean,\n color?: AXStyleColorType,\n onClick?: () => void,\n}\n\nexport type AXActionSheetContentType = TemplateRef<any> | Function;\n\nexport interface AXActionSheetOptions {\n title?: string;\n showCloseButton?: boolean;\n closeOnBackdrop?: boolean;\n showHeader?: boolean;\n items?: AXActionSheetItem[]\n content?: AXActionSheetContentType;\n data?: any;\n};\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { A11yModule } from '@angular/cdk/a11y';\nimport { DragDropModule } from '@angular/cdk/drag-drop';\nimport { PortalModule } from '@angular/cdk/portal';\nimport { AXButtonModule } from '@acorex/components/button';\n\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXCommonModule } from '@acorex/components/common';\nimport { AXActionSheetComponent } from './action-sheet.component';\n\n\nconst MODULES = [CommonModule,AXCommonModule, DragDropModule, A11yModule, AXButtonModule, PortalModule, AXDecoratorModule];\n\n\n@NgModule({\n declarations: [AXActionSheetComponent],\n imports: [...MODULES],\n exports: [AXActionSheetComponent],\n providers: [],\n})\nexport class AXActionSheetModule { }\n","import {\n AXComponentClosedPromise,\n AXComponentCloseEvent,\n AXOverlayService,\n AXOverlayViewRef,\n TAB_META_KEY,\n} from '@acorex/components/common';\nimport { AXTranslator } from '@acorex/core/translation';\nimport { Overlay } from '@angular/cdk/overlay';\nimport { Injectable } from '@angular/core';\nimport { AXActionSheetComponent } from './action-sheet.component';\nimport { AXActionSheetOptions } from './action-sheet.interface';\n\n@Injectable({ providedIn: 'root' })\nexport class AXActionSheetService {\n\n constructor(private _overlay: Overlay, private overlayService: AXOverlayService) {}\n\n open(options: AXActionSheetOptions): AXComponentClosedPromise {\n const opt: any = {\n title: AXTranslator.get('action-sheet.title'),\n showCloseButton: true,\n closeOnBackdrop: true,\n showHeader: true,\n };\n Object.assign(opt, options);\n const lastActiveElement = document.activeElement as HTMLElement;\n const com = this.overlayService.show(AXActionSheetComponent, opt, {\n hasBackdrop: true,\n closeOnClickOutside: opt.closeOnBackdrop,\n transparentBackdrop: false,\n panelClass: ['ax-actionsheet-panel'],\n position: this._overlay.position().global().bottom().centerHorizontally(),\n scroll: 'block',\n });\n const actionSheet = com.instance as AXActionSheetComponent;\n actionSheet[TAB_META_KEY] = {};\n actionSheet.onClosed.subscribe(c => {\n this.closePopup(actionSheet, com, c, lastActiveElement);\n });\n const promise = new AXComponentClosedPromise((resolve, reject) => {\n actionSheet[TAB_META_KEY].close = e => {\n if (resolve) {\n resolve(e);\n } else {\n reject(e);\n }\n };\n });\n promise['closeMethod'] = () => {\n actionSheet.close();\n };\n return promise;\n }\n\n private closePopup(popup: AXActionSheetComponent, com: AXOverlayViewRef, result: AXComponentCloseEvent, lastActiveElement?: HTMLElement) {\n const closeFunc = e => {\n com.dispose();\n delete e.cancel;\n popup[TAB_META_KEY].close(e);\n if (lastActiveElement?.focus) {\n lastActiveElement.focus();\n }\n };\n const e = { cancel: false };\n const closingFunc = popup[TAB_META_KEY].component?.onClosing;\n if (closingFunc) {\n const res = closingFunc(e);\n if (res instanceof Promise) {\n res.then(() => {\n if (e == null || e.cancel !== true) {\n closeFunc(result);\n }\n });\n } else {\n if (e == null || e.cancel !== true) {\n closeFunc(result);\n }\n }\n } else {\n closeFunc(result);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;;;;AAYM,MAAO,sBAAuB,SAAQ,eAAe,CAAA;AAP3D,IAAA,WAAA,GAAA;;QAUE,IAAK,CAAA,KAAA,GAAwB,EAAE,CAAC;QAEhC,IAAe,CAAA,eAAA,GAAY,IAAI,CAAC;QAChC,IAAU,CAAA,UAAA,GAAY,IAAI,CAAC;QAC3B,IAAI,CAAA,IAAA,GAAQ,EAAE,CAAC;AAEf,QAAA,IAAA,CAAA,QAAQ,GAAwC,IAAI,YAAY,EAAyB,CAAC;AAwD3F,KAAA;IAtDC,KAAK,GAAA;AACH,QAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;AACjB,Y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AA,gBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;AAApB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cADP,MAAM,EAAA,CAAA,CAAA,EAAA;;2FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;;ACblC;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"acorex-components-action-sheet.mjs","sources":["../../../../libs/components/action-sheet/src/lib/action-sheet.component.ts","../../../../libs/components/action-sheet/src/lib/action-sheet.component.html","../../../../libs/components/action-sheet/src/lib/action-sheet.module.ts","../../../../libs/components/action-sheet/src/lib/action-sheet.service.ts","../../../../libs/components/action-sheet/src/acorex-components-action-sheet.ts"],"sourcesContent":["import { AXComponentCloseEvent, MXBaseComponent, TAB_META_KEY } from '@acorex/components/common';\nimport {\n CdkPortalOutletAttachedRef,\n ComponentPortal,\n Portal,\n TemplatePortal,\n} from '@angular/cdk/portal';\nimport {\n ChangeDetectionStrategy,\n Component,\n ComponentRef,\n EventEmitter,\n HostListener,\n OnInit,\n TemplateRef,\n ViewEncapsulation,\n} from '@angular/core';\nimport { AXActionSheetItem } from './action-sheet.interface';\n\n@Component({\n selector: 'ax-action-sheet',\n templateUrl: './action-sheet.component.html',\n styleUrls: ['./action-sheet.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class AXActionSheetComponent extends MXBaseComponent implements OnInit {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected _selectedPortal: Portal<any>;\n\n title: string;\n\n subTitle: string;\n\n items: AXActionSheetItem[] = [];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n content: any;\n\n showCloseButton = true;\n\n showHeader = true;\n\n data: unknown = {};\n\n onClosed: EventEmitter<AXComponentCloseEvent> = new EventEmitter<AXComponentCloseEvent>();\n\n close(): void {\n this.onClosed.emit({\n component: this[TAB_META_KEY].component,\n htmlElement: this.getHostElement(),\n });\n this.cdr.detectChanges();\n }\n\n ngOnInit(): void {\n if (this.content) {\n if (this.content instanceof TemplateRef) {\n this._selectedPortal = new TemplatePortal(this.content, this.getViewContainer(), {\n $implicit: this.data,\n ref: this,\n });\n this.cdr.markForCheck();\n } else if (typeof this.content === 'function') {\n this._selectedPortal = new ComponentPortal(this.content);\n this.cdr.markForCheck();\n }\n }\n }\n\n @HostListener('keydown.escape')\n protected onKeydownHandler() {\n const focusedOrHasFocused = this.getHostElement().matches(':focus-within');\n if (this.showCloseButton && focusedOrHasFocused) {\n this.close();\n }\n }\n\n protected _handleAttched(ref: CdkPortalOutletAttachedRef) {\n ref = ref as ComponentRef<unknown>;\n if (ref.instance) {\n this[TAB_META_KEY].component = ref.instance;\n Object.assign(this[TAB_META_KEY].component, this.data);\n if (ref.instance.onClosed) {\n ref.instance.onClosed.subscribe((e: AXComponentCloseEvent) => {\n this.onClosed.emit(e);\n });\n }\n }\n }\n\n protected _handleCloseClick() {\n this.close();\n }\n onItemClick(item: AXActionSheetItem) {\n this.close();\n item.onClick();\n }\n}\n","<ax-header *ngIf=\"showHeader\">\n <ax-prefix>\n <ax-title>{{ title }}</ax-title>\n <ax-sub-title *ngIf=\"subTitle\">{{ subTitle }}</ax-sub-title>\n </ax-prefix>\n <ax-suffix>\n <ax-close-button\n *ngIf=\"showCloseButton\"\n (click)=\"_handleCloseClick()\"\n tabindex=\"1\"\n ></ax-close-button>\n </ax-suffix>\n</ax-header>\n<ng-template [cdkPortalOutlet]=\"_selectedPortal\" (attached)=\"_handleAttched($event)\"></ng-template>\n<div class=\"ax-action-sheet-items\">\n <ng-container *ngFor=\"let item of items\">\n <div\n class=\"ax-action-sheet-item ax-{{ item.color }}\"\n [class.ax-state-disabled]=\"item.disabled\"\n (click)=\"onItemClick(item)\"\n >\n <span class=\"item-icon\" *ngIf=\"item.icon\" [class]=\"item.icon\"></span>\n <span class=\"item-text\">{{ item.text }}</span>\n </div>\n </ng-container>\n</div>\n","import { AXButtonModule } from '@acorex/components/button';\nimport { A11yModule } from '@angular/cdk/a11y';\nimport { DragDropModule } from '@angular/cdk/drag-drop';\nimport { PortalModule } from '@angular/cdk/portal';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { AXCommonModule } from '@acorex/components/common';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXActionSheetComponent } from './action-sheet.component';\n\nconst MODULES = [\n CommonModule,\n AXCommonModule,\n DragDropModule,\n A11yModule,\n AXButtonModule,\n PortalModule,\n AXDecoratorModule,\n];\n\n@NgModule({\n declarations: [AXActionSheetComponent],\n imports: [...MODULES],\n exports: [AXActionSheetComponent],\n providers: [],\n})\nexport class AXActionSheetModule {}\n","import {\n AXComponentClosedPromise,\n AXComponentCloseEvent,\n AXOverlayService,\n AXOverlayViewRef,\n TAB_META_KEY,\n} from '@acorex/components/common';\nimport { AXTranslator } from '@acorex/core/translation';\nimport { Overlay } from '@angular/cdk/overlay';\nimport { Injectable } from '@angular/core';\nimport { AXActionSheetComponent } from './action-sheet.component';\nimport { AXActionSheetOptions } from './action-sheet.interface';\n\n@Injectable({ providedIn: 'root' })\nexport class AXActionSheetService {\n constructor(private _overlay: Overlay, private overlayService: AXOverlayService) {}\n\n open(options: AXActionSheetOptions): AXComponentClosedPromise {\n const opt: AXActionSheetOptions = {\n title: AXTranslator.get('action-sheet.title'),\n showCloseButton: true,\n closeOnBackdrop: true,\n showHeader: true,\n };\n Object.assign(opt, options);\n\n const lastActiveElement = document.activeElement as HTMLElement;\n\n const com = this.overlayService.show(AXActionSheetComponent, opt, {\n hasBackdrop: true,\n closeOnClickOutside: opt.closeOnBackdrop,\n transparentBackdrop: false,\n panelClass: ['ax-actionsheet-panel'],\n position: this._overlay.position().global().bottom().centerHorizontally(),\n scroll: 'block',\n });\n\n const actionSheet = com.instance as AXActionSheetComponent;\n\n actionSheet[TAB_META_KEY] = {};\n actionSheet.onClosed.subscribe((c) => {\n this.closePopup(actionSheet, com, c, lastActiveElement);\n });\n\n const promise = new AXComponentClosedPromise((resolve, reject) => {\n actionSheet[TAB_META_KEY].close = (e) => {\n if (resolve) {\n resolve(e);\n } else {\n reject(e);\n }\n };\n });\n promise['closeMethod'] = () => {\n actionSheet.close();\n };\n\n return promise;\n }\n\n private closePopup(\n popup: AXActionSheetComponent,\n com: AXOverlayViewRef,\n result: AXComponentCloseEvent,\n lastActiveElement?: HTMLElement\n ) {\n const closeFunc = (e) => {\n com.dispose();\n delete e.cancel;\n popup[TAB_META_KEY].close(e);\n if (lastActiveElement?.focus) {\n lastActiveElement.focus();\n }\n };\n const e = { cancel: false };\n const closingFunc = popup[TAB_META_KEY].component?.onClosing;\n if (closingFunc) {\n const res = closingFunc(e);\n if (res instanceof Promise) {\n res.then(() => {\n if (e == null || e.cancel !== true) {\n closeFunc(result);\n }\n });\n } else {\n if (e == null || e.cancel !== true) {\n closeFunc(result);\n }\n }\n } else {\n closeFunc(result);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;;;;AA0BM,MAAO,sBAAuB,SAAQ,eAAe,CAAA;AAP3D,IAAA,WAAA,GAAA;;QAeE,IAAK,CAAA,KAAA,GAAwB,EAAE,CAAC;QAKhC,IAAe,CAAA,eAAA,GAAG,IAAI,CAAC;QAEvB,IAAU,CAAA,UAAA,GAAG,IAAI,CAAC;QAElB,IAAI,CAAA,IAAA,GAAY,EAAE,CAAC;AAEnB,QAAA,IAAA,CAAA,QAAQ,GAAwC,IAAI,YAAY,EAAyB,CAAC;AAqD3F,KAAA;IAnDC,KAAK,GAAA;AACH,QAAA,IAAI,CAAC,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