@webilix/ngx-helper-m3 0.0.32 → 0.0.33
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/webilix-ngx-helper-m3.mjs +120 -1
- package/fesm2022/webilix-ngx-helper-m3.mjs.map +1 -1
- package/index.d.ts +21 -2
- package/ngx-helper-m3.css +457 -341
- package/package.json +1 -1
|
@@ -2088,6 +2088,125 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
2088
2088
|
args: [{ providedIn: 'root' }]
|
|
2089
2089
|
}], ctorParameters: () => [{ type: i0.ApplicationRef }, { type: i0.Injector }, { type: NgxHelperToastService }] });
|
|
2090
2090
|
|
|
2091
|
+
class ImageComponent {
|
|
2092
|
+
className = 'ngx-helper-m3-image';
|
|
2093
|
+
image;
|
|
2094
|
+
config;
|
|
2095
|
+
close;
|
|
2096
|
+
checkEscape(event) {
|
|
2097
|
+
if (!(event instanceof KeyboardEvent))
|
|
2098
|
+
return;
|
|
2099
|
+
if (event.code === 'Escape') {
|
|
2100
|
+
event.preventDefault();
|
|
2101
|
+
this.close();
|
|
2102
|
+
}
|
|
2103
|
+
}
|
|
2104
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ImageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2105
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: ImageComponent, isStandalone: true, selector: "ng-component", host: { attributes: { "selector": "image" }, listeners: { "window:keydown": "checkEscape($event)" }, properties: { "className": "this.className" } }, ngImport: i0, template: "<div\n class=\"background\"\n [style.background-color]=\"config?.backgroundColor || 'var(--background)'\"\n [style.opacity]=\"config?.backgroundOpacity || 0.95\"\n></div>\n\n<button class=\"close\" mat-icon-button (click)=\"close()\"><mat-icon>close</mat-icon></button>\n\n<div class=\"image\">\n <img [src]=\"image.image\" />\n</div>\n\n<!-- DESCRIPTION -->\n@if (image.description) {\n<div class=\"description\">\n <div class=\"content\" [innerHTML]=\"image.description | ngxHelperMultiLine\"></div>\n</div>\n}\n", styles: [""], dependencies: [{ kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "pipe", type: NgxHelperMultiLinePipe, name: "ngxHelperMultiLine" }] });
|
|
2106
|
+
}
|
|
2107
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ImageComponent, decorators: [{
|
|
2108
|
+
type: Component,
|
|
2109
|
+
args: [{ host: { selector: 'image', '(window:keydown)': 'checkEscape($event)' }, imports: [MatIcon, MatIconButton, NgxHelperMultiLinePipe], template: "<div\n class=\"background\"\n [style.background-color]=\"config?.backgroundColor || 'var(--background)'\"\n [style.opacity]=\"config?.backgroundOpacity || 0.95\"\n></div>\n\n<button class=\"close\" mat-icon-button (click)=\"close()\"><mat-icon>close</mat-icon></button>\n\n<div class=\"image\">\n <img [src]=\"image.image\" />\n</div>\n\n<!-- DESCRIPTION -->\n@if (image.description) {\n<div class=\"description\">\n <div class=\"content\" [innerHTML]=\"image.description | ngxHelperMultiLine\"></div>\n</div>\n}\n" }]
|
|
2110
|
+
}], propDecorators: { className: [{
|
|
2111
|
+
type: HostBinding,
|
|
2112
|
+
args: ['className']
|
|
2113
|
+
}] } });
|
|
2114
|
+
|
|
2115
|
+
class GalleryComponent {
|
|
2116
|
+
className = 'ngx-helper-m3-image';
|
|
2117
|
+
images;
|
|
2118
|
+
config;
|
|
2119
|
+
close;
|
|
2120
|
+
index = 0;
|
|
2121
|
+
checkKey(event) {
|
|
2122
|
+
if (!(event instanceof KeyboardEvent))
|
|
2123
|
+
return;
|
|
2124
|
+
if (event.code === 'Escape') {
|
|
2125
|
+
event.preventDefault();
|
|
2126
|
+
this.close();
|
|
2127
|
+
}
|
|
2128
|
+
if (event.code === 'ArrowRight') {
|
|
2129
|
+
event.preventDefault();
|
|
2130
|
+
this.changeIndex(-1);
|
|
2131
|
+
}
|
|
2132
|
+
if (event.code === 'ArrowLeft') {
|
|
2133
|
+
event.preventDefault();
|
|
2134
|
+
this.changeIndex(1);
|
|
2135
|
+
}
|
|
2136
|
+
}
|
|
2137
|
+
changeIndex(change) {
|
|
2138
|
+
this.index += change;
|
|
2139
|
+
if (this.index < 0)
|
|
2140
|
+
this.index = this.images.length - 1;
|
|
2141
|
+
if (this.index >= this.images.length)
|
|
2142
|
+
this.index = 0;
|
|
2143
|
+
}
|
|
2144
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: GalleryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2145
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: GalleryComponent, isStandalone: true, selector: "ng-component", host: { attributes: { "selector": "gallery" }, listeners: { "window:keydown": "checkKey($event)" }, properties: { "className": "this.className" } }, ngImport: i0, template: "<div\n class=\"background\"\n [style.background-color]=\"config?.backgroundColor || 'var(--background)'\"\n [style.opacity]=\"config?.backgroundOpacity || 0.95\"\n></div>\n\n<button class=\"close\" mat-icon-button (click)=\"close()\"><mat-icon>close</mat-icon></button>\n\n<div class=\"arrows\">\n <button class=\"arrow\" mat-icon-button (click)=\"changeIndex(-1)\"><mat-icon>chevron_right</mat-icon></button>\n <div class=\"count\">{{ index + 1 }} \u0627\u0632 {{ images.length }}</div>\n <button class=\"arrow\" mat-icon-button (click)=\"changeIndex(1)\"><mat-icon>chevron_left</mat-icon></button>\n</div>\n\n<div class=\"image\">\n <img [src]=\"images[index].image\" />\n</div>\n\n<!-- DESCRIPTION -->\n@if (images[index].description) {\n<div class=\"description\">\n <div class=\"content\" [innerHTML]=\"images[index].description | ngxHelperMultiLine\"></div>\n</div>\n}\n", styles: [""], dependencies: [{ kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "pipe", type: NgxHelperMultiLinePipe, name: "ngxHelperMultiLine" }] });
|
|
2146
|
+
}
|
|
2147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: GalleryComponent, decorators: [{
|
|
2148
|
+
type: Component,
|
|
2149
|
+
args: [{ host: { selector: 'gallery', '(window:keydown)': 'checkKey($event)' }, imports: [MatIcon, MatIconButton, NgxHelperMultiLinePipe], template: "<div\n class=\"background\"\n [style.background-color]=\"config?.backgroundColor || 'var(--background)'\"\n [style.opacity]=\"config?.backgroundOpacity || 0.95\"\n></div>\n\n<button class=\"close\" mat-icon-button (click)=\"close()\"><mat-icon>close</mat-icon></button>\n\n<div class=\"arrows\">\n <button class=\"arrow\" mat-icon-button (click)=\"changeIndex(-1)\"><mat-icon>chevron_right</mat-icon></button>\n <div class=\"count\">{{ index + 1 }} \u0627\u0632 {{ images.length }}</div>\n <button class=\"arrow\" mat-icon-button (click)=\"changeIndex(1)\"><mat-icon>chevron_left</mat-icon></button>\n</div>\n\n<div class=\"image\">\n <img [src]=\"images[index].image\" />\n</div>\n\n<!-- DESCRIPTION -->\n@if (images[index].description) {\n<div class=\"description\">\n <div class=\"content\" [innerHTML]=\"images[index].description | ngxHelperMultiLine\"></div>\n</div>\n}\n" }]
|
|
2150
|
+
}], propDecorators: { className: [{
|
|
2151
|
+
type: HostBinding,
|
|
2152
|
+
args: ['className']
|
|
2153
|
+
}] } });
|
|
2154
|
+
|
|
2155
|
+
class NgxHelperImageService {
|
|
2156
|
+
applicationRef;
|
|
2157
|
+
injector;
|
|
2158
|
+
constructor(applicationRef, injector) {
|
|
2159
|
+
this.applicationRef = applicationRef;
|
|
2160
|
+
this.injector = injector;
|
|
2161
|
+
}
|
|
2162
|
+
showImage(image, config) {
|
|
2163
|
+
const componentRef = createComponent(ImageComponent, {
|
|
2164
|
+
environmentInjector: this.applicationRef.injector,
|
|
2165
|
+
elementInjector: this.injector,
|
|
2166
|
+
});
|
|
2167
|
+
componentRef.instance.image = image;
|
|
2168
|
+
componentRef.instance.config = config;
|
|
2169
|
+
componentRef.instance.close = () => {
|
|
2170
|
+
this.applicationRef.detachView(componentRef.hostView);
|
|
2171
|
+
componentRef.destroy();
|
|
2172
|
+
document.body.style.overflow = 'visible';
|
|
2173
|
+
};
|
|
2174
|
+
const htmlElement = componentRef.hostView.rootNodes[0];
|
|
2175
|
+
this.applicationRef.attachView(componentRef.hostView);
|
|
2176
|
+
document.body.appendChild(htmlElement);
|
|
2177
|
+
document.body.style.overflow = 'hidden';
|
|
2178
|
+
}
|
|
2179
|
+
showGallery(images, config) {
|
|
2180
|
+
if (images.length === 0)
|
|
2181
|
+
return;
|
|
2182
|
+
if (images.length === 1) {
|
|
2183
|
+
this.showImage(images[0], config);
|
|
2184
|
+
return;
|
|
2185
|
+
}
|
|
2186
|
+
const componentRef = createComponent(GalleryComponent, {
|
|
2187
|
+
environmentInjector: this.applicationRef.injector,
|
|
2188
|
+
elementInjector: this.injector,
|
|
2189
|
+
});
|
|
2190
|
+
componentRef.instance.images = images;
|
|
2191
|
+
componentRef.instance.config = config;
|
|
2192
|
+
componentRef.instance.close = () => {
|
|
2193
|
+
this.applicationRef.detachView(componentRef.hostView);
|
|
2194
|
+
componentRef.destroy();
|
|
2195
|
+
document.body.style.overflow = 'visible';
|
|
2196
|
+
};
|
|
2197
|
+
const htmlElement = componentRef.hostView.rootNodes[0];
|
|
2198
|
+
this.applicationRef.attachView(componentRef.hostView);
|
|
2199
|
+
document.body.appendChild(htmlElement);
|
|
2200
|
+
document.body.style.overflow = 'hidden';
|
|
2201
|
+
}
|
|
2202
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgxHelperImageService, deps: [{ token: i0.ApplicationRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2203
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgxHelperImageService, providedIn: 'root' });
|
|
2204
|
+
}
|
|
2205
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgxHelperImageService, decorators: [{
|
|
2206
|
+
type: Injectable,
|
|
2207
|
+
args: [{ providedIn: 'root' }]
|
|
2208
|
+
}], ctorParameters: () => [{ type: i0.ApplicationRef }, { type: i0.Injector }] });
|
|
2209
|
+
|
|
2091
2210
|
class GetComponent {
|
|
2092
2211
|
className = 'ngx-helper-m3-route';
|
|
2093
2212
|
route;
|
|
@@ -2599,5 +2718,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
2599
2718
|
* Generated bundle index. Do not edit.
|
|
2600
2719
|
*/
|
|
2601
2720
|
|
|
2602
|
-
export { NGX_HELPER_BOX_DATA, NGX_HELPER_CONFIG, NGX_HELPER_CONTAINER_CLOSE, NGX_HELPER_CONTAINER_DATA, NGX_HELPER_CONTAINER_TYPE, NGX_HELPER_PAGE_GROUP_DATA, NGX_HELPER_PAGE_GROUP_DATA_CHANGE, NGX_HELPER_PAGE_GROUP_ITEM, NgxHelperBankCardPipe, NgxHelperBoxComponent, NgxHelperCardComponent, NgxHelperConfirmService, NgxHelperContainerService, NgxHelperCoordinatesService, NgxHelperDatePipe, NgxHelperDurationPipe, NgxHelperFileSizePipe, NgxHelperHttpService, NgxHelperLoaderComponent, NgxHelperMobilePipe, NgxHelperMobileViewDirective, NgxHelperMultiLinePipe, NgxHelperNumberPipe, NgxHelperPageGroupComponent, NgxHelperPeriodPipe, NgxHelperPricePipe, NgxHelperProgressComponent, NgxHelperRouteService, NgxHelperSafePipe, NgxHelperSectionColumnComponent, NgxHelperSectionComponent, NgxHelperStickyDirective, NgxHelperToastService, NgxHelperValueBoxComponent, NgxHelperValueListComponent, NgxHelperValuePipe, NgxHelperVolumePipe, NgxHelperWeightPipe, provideNgxHelperConfig };
|
|
2721
|
+
export { NGX_HELPER_BOX_DATA, NGX_HELPER_CONFIG, NGX_HELPER_CONTAINER_CLOSE, NGX_HELPER_CONTAINER_DATA, NGX_HELPER_CONTAINER_TYPE, NGX_HELPER_PAGE_GROUP_DATA, NGX_HELPER_PAGE_GROUP_DATA_CHANGE, NGX_HELPER_PAGE_GROUP_ITEM, NgxHelperBankCardPipe, NgxHelperBoxComponent, NgxHelperCardComponent, NgxHelperConfirmService, NgxHelperContainerService, NgxHelperCoordinatesService, NgxHelperDatePipe, NgxHelperDurationPipe, NgxHelperFileSizePipe, NgxHelperHttpService, NgxHelperImageService, NgxHelperLoaderComponent, NgxHelperMobilePipe, NgxHelperMobileViewDirective, NgxHelperMultiLinePipe, NgxHelperNumberPipe, NgxHelperPageGroupComponent, NgxHelperPeriodPipe, NgxHelperPricePipe, NgxHelperProgressComponent, NgxHelperRouteService, NgxHelperSafePipe, NgxHelperSectionColumnComponent, NgxHelperSectionComponent, NgxHelperStickyDirective, NgxHelperToastService, NgxHelperValueBoxComponent, NgxHelperValueListComponent, NgxHelperValuePipe, NgxHelperVolumePipe, NgxHelperWeightPipe, provideNgxHelperConfig };
|
|
2603
2722
|
//# sourceMappingURL=webilix-ngx-helper-m3.mjs.map
|