@dignite-ng/expand.core 0.0.3 → 0.0.5

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.
Files changed (42) hide show
  1. package/README.md +24 -24
  2. package/esm2022/lib/directives/index.mjs +2 -0
  3. package/esm2022/lib/directives/keydown-prevent-default.directive.mjs +22 -0
  4. package/esm2022/lib/expand/image-preview.component.mjs +250 -0
  5. package/esm2022/lib/expand/index.mjs +2 -0
  6. package/esm2022/lib/pipes/get-now-domain.pipe.mjs +53 -0
  7. package/esm2022/lib/pipes/get-tenant-img.pipe.mjs +27 -0
  8. package/esm2022/lib/pipes/index.mjs +4 -0
  9. package/esm2022/lib/pipes/slug-normalizer.pipe.mjs +39 -0
  10. package/esm2022/lib/services/index.mjs +2 -2
  11. package/esm2022/lib/services/update-list.service.mjs +50 -0
  12. package/esm2022/lib/strategies/index.mjs +2 -0
  13. package/esm2022/lib/strategies/simple-reuse-strategy.mjs +84 -0
  14. package/esm2022/public-api.mjs +5 -4
  15. package/fesm2022/dignite-ng-expand.core.mjs +499 -98
  16. package/fesm2022/dignite-ng-expand.core.mjs.map +1 -1
  17. package/lib/directives/index.d.ts +1 -0
  18. package/lib/directives/keydown-prevent-default.directive.d.ts +7 -0
  19. package/lib/expand/image-preview.component.d.ts +40 -0
  20. package/lib/expand/index.d.ts +1 -0
  21. package/lib/pipes/get-now-domain.pipe.d.ts +19 -0
  22. package/lib/pipes/get-tenant-img.pipe.d.ts +9 -0
  23. package/lib/pipes/index.d.ts +3 -0
  24. package/lib/pipes/slug-normalizer.pipe.d.ts +8 -0
  25. package/lib/services/index.d.ts +1 -1
  26. package/lib/services/update-list.service.d.ts +37 -0
  27. package/lib/strategies/index.d.ts +1 -0
  28. package/lib/strategies/simple-reuse-strategy.d.ts +33 -0
  29. package/package.json +3 -3
  30. package/public-api.d.ts +4 -3
  31. package/esm2022/lib/constants/index.mjs +0 -2
  32. package/esm2022/lib/constants/styles.mjs +0 -24
  33. package/esm2022/lib/core.module.mjs +0 -26
  34. package/esm2022/lib/providers/appent-content.providers.mjs +0 -16
  35. package/esm2022/lib/providers/index.mjs +0 -2
  36. package/esm2022/lib/services/appent-content.service.mjs +0 -54
  37. package/lib/constants/index.d.ts +0 -1
  38. package/lib/constants/styles.d.ts +0 -2
  39. package/lib/core.module.d.ts +0 -8
  40. package/lib/providers/appent-content.providers.d.ts +0 -11
  41. package/lib/providers/index.d.ts +0 -1
  42. package/lib/services/appent-content.service.d.ts +0 -28
@@ -1,116 +1,517 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, APP_INITIALIZER, NgModule } from '@angular/core';
2
+ import { EventEmitter, Injectable, inject, Pipe, Component, Input, Output, Directive, HostListener } from '@angular/core';
3
+ import { BehaviorSubject } from 'rxjs';
4
+ import * as i3 from '@abp/ng.core';
5
+ import { EnvironmentService, ConfigStateService, CoreModule } from '@abp/ng.core';
6
+ import { PageModule } from '@abp/ng.components/page';
7
+ import { ThemeSharedModule } from '@abp/ng.theme.shared';
8
+ import * as i2 from '@angular/common';
9
+ import { CommonModule } from '@angular/common';
10
+ import * as i1 from '@ng-bootstrap/ng-bootstrap';
3
11
 
4
- var styles = `
5
- /* 垂直滚动条样式 */
6
- /* 宽度 */
7
- ::-webkit-scrollbar {
8
- width: 8px;
9
- height: 8px;
10
- }
11
- /* 背景色 */
12
- ::-webkit-scrollbar-track {
13
- background-color: #f5f5f5;
14
- }
15
- /* 滑块颜色 */
16
- ::-webkit-scrollbar-thumb {
17
- background-color: #c1c1c1;
18
-
19
- border-radius: 50px;
20
- }
21
-
22
- .lpx-content-container .lpx-content {
23
- min-height: calc(100vh - 34px);
24
- padding: 1.25em 2em 1.25em;
25
- }
26
- `;
12
+ /**
13
+ * 路由复用策略
14
+ *
15
+ * 1. 实现shouldReuseRoute方法,判断是否同一路由时复用路由
16
+ * 2. 实现retrieve方法,获取存储路由
17
+ * 3. 实现shouldDetach方法,判断是否有路由存储
18
+ * 4. 实现store方法,存储路由
19
+ * 5. 实现shouldAttach方法,判断是否有路由存储
20
+ * 6. 实现retrieve方法,获取存储路由
21
+ * 7. 实现destroy方法,销毁路由
22
+ *
23
+ * *使用方法
24
+ @NgModule({
25
+ providers: [
26
+ { provide: RouteReuseStrategy, useClass: SimpleReuseStrategy }
27
+ ],
28
+ })
27
29
 
28
- class AppentContentService {
29
- renderer;
30
- constructor(rendererFactory) {
31
- this.renderer = rendererFactory.createRenderer(null, null);
32
- }
33
- /**
34
- * 创建style标签添加到head中
35
- * @param content
36
- */
37
- appentStyleToHead(content) {
38
- const style = this.renderer.createElement('style');
39
- this.renderer.setProperty(style, 'innerHTML', content);
40
- this.renderer.appendChild(document.head, style);
41
- }
42
- /**
43
- * 创建style标签添加到body中
44
- * @param content
45
- */
46
- appentStyleToBody(content) {
47
- const style = this.renderer.createElement('style');
48
- this.renderer.setProperty(style, 'innerHTML', content);
49
- this.renderer.appendChild(document.body, style);
50
- }
51
- /**
52
- * 创建script标签添加到head中
53
- * @param content
54
- */
55
- appentScriptToHead(content) {
56
- const style = this.renderer.createElement('script');
57
- this.renderer.setProperty(style, 'innerHTML', content);
58
- this.renderer.appendChild(document.head, style);
59
- }
60
- /**
61
- * 创建script标签添加到body中
62
- * @param content
63
- */
64
- appentScriptToBody(content) {
65
- const style = this.renderer.createElement('script');
66
- this.renderer.setProperty(style, 'innerHTML', content);
67
- this.renderer.appendChild(document.body, style);
68
- }
69
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AppentContentService, deps: [{ token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable });
70
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AppentContentService, providedIn: 'root' });
30
+ data: { keep: true }
31
+ */
32
+ class SimpleReuseStrategy {
33
+ static { this.cacheRouters = new Map(); }
34
+ static deleteRouteCache(url) {
35
+ if (SimpleReuseStrategy.cacheRouters.has(url)) {
36
+ const handle = SimpleReuseStrategy.cacheRouters.get(url);
37
+ try {
38
+ handle.componentRef.destory();
39
+ }
40
+ catch (e) { }
41
+ SimpleReuseStrategy.cacheRouters.delete(url);
42
+ }
43
+ }
44
+ static deleteAllRouteCache() {
45
+ SimpleReuseStrategy.cacheRouters.forEach((handle, key) => {
46
+ SimpleReuseStrategy.deleteRouteCache(key);
47
+ });
48
+ }
49
+ // one 进入路由触发,是否同一路由时复用路由
50
+ shouldReuseRoute(future, curr) {
51
+ return (future.routeConfig === curr.routeConfig &&
52
+ JSON.stringify(future.params) === JSON.stringify(curr.params));
53
+ }
54
+ // 获取存储路由
55
+ retrieve(route) {
56
+ const url = this.getFullRouteURL(route);
57
+ if (route.data.keep && SimpleReuseStrategy.cacheRouters.has(url)) {
58
+ return SimpleReuseStrategy.cacheRouters.get(url);
59
+ }
60
+ else {
61
+ return null;
62
+ }
63
+ }
64
+ // Whether to allow multiplexing routes
65
+ shouldDetach(route) {
66
+ return Boolean(route.data.keep);
67
+ }
68
+ //It is triggered when the route leaves. The route is stored
69
+ store(route, handle) {
70
+ const url = this.getFullRouteURL(route);
71
+ // 先把之前缓存的删除,
72
+ SimpleReuseStrategy.cacheRouters.forEach((handle, key) => {
73
+ SimpleReuseStrategy.deleteRouteCache(key);
74
+ });
75
+ SimpleReuseStrategy.cacheRouters.set(url, handle);
76
+ }
77
+ // Whether to allow route restoration
78
+ shouldAttach(route) {
79
+ const url = this.getFullRouteURL(route);
80
+ return Boolean(route.data.keep) && SimpleReuseStrategy.cacheRouters.has(url);
81
+ }
82
+ // Gets the current route url
83
+ getFullRouteURL(route) {
84
+ const { pathFromRoot } = route;
85
+ let fullRouteUrlPath = [];
86
+ pathFromRoot.forEach((item) => {
87
+ fullRouteUrlPath = fullRouteUrlPath.concat(this.getRouteUrlPath(item));
88
+ });
89
+ return `/${fullRouteUrlPath.join('/')}`;
90
+ }
91
+ getRouteUrlPath(route) {
92
+ return route.url.map(urlSegment => urlSegment.path);
93
+ }
71
94
  }
72
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AppentContentService, decorators: [{
95
+
96
+ /**
97
+ * 子页面更新父级列表服务
98
+ *
99
+ * 父页面:
100
+ *
101
+ private _UpdateListService=inject(UpdateListService)
102
+
103
+ this._UpdateListService.updateListEvent.subscribe(() => {
104
+ this.list.get()
105
+ });
106
+ *
107
+ * 子页面:
108
+ *
109
+ private _UpdateListService=inject(UpdateListService)
110
+ this._UpdateListService.updateList();
111
+ */
112
+ class UpdateListService {
113
+ constructor() {
114
+ this.updateListEvent = new EventEmitter();
115
+ /**
116
+ * 使用发起数据
117
+ * this.dataSubject.next(res);
118
+ *
119
+ * 接收数据产生回调
120
+ this._UpdateLogoService.userInfo$.subscribe((res) => {
121
+ this.getData();
122
+ });
123
+ */
124
+ this.dataSubject = new BehaviorSubject(null);
125
+ this.data$ = this.dataSubject.asObservable();
126
+ }
127
+ updateList() {
128
+ this.updateListEvent.emit();
129
+ }
130
+ updatedata(newdata) {
131
+ this.dataSubject.next(newdata);
132
+ }
133
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: UpdateListService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
134
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: UpdateListService, providedIn: 'root' }); }
135
+ }
136
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: UpdateListService, decorators: [{
73
137
  type: Injectable,
74
138
  args: [{
75
- providedIn: 'root'
139
+ providedIn: 'root',
76
140
  }]
77
- }], ctorParameters: function () { return [{ type: i0.RendererFactory2 }]; } });
141
+ }], ctorParameters: () => [] });
78
142
 
79
- //创建依赖服务,导入到app中设置添加内容到html,添加
80
- /**
81
- * 添加style到head中
143
+ /**获取当前窗口域名
144
+ * 需要将environment.ts页面配置
145
+ application: {
146
+ baseUrl,
147
+ name: 'Travely',
148
+ webUrl:'https://localhost:44374',
149
+ },
150
+ *
82
151
  */
83
- const APPENT_CONTENT = [
84
- { provide: APP_INITIALIZER, useFactory: configureRoutes, deps: [AppentContentService], multi: true },
85
- ];
86
- function configureRoutes(_AppentContentService) {
87
- return () => {
88
- _AppentContentService.appentStyleToHead(styles);
89
- };
152
+ class GetNowDomainPipe {
153
+ constructor() {
154
+ this.environment = inject(EnvironmentService);
155
+ }
156
+ transform(value, ...args) {
157
+ let production = this.environment.getEnvironment()?.production;
158
+ let application = this.environment.getEnvironment()?.application;
159
+ let webUrl = application?.webUrl;
160
+ if (!production)
161
+ return webUrl + value;
162
+ return this.get(value);
163
+ }
164
+ /**获取当前域名并重定向链接 */
165
+ get(value) {
166
+ const baseUrl = (function () {
167
+ let extractDomain = (url) => {
168
+ const regex = /^(https?:\/\/)?([^\/]+)(?:[\/?].*)?$/;
169
+ const match = url.match(regex);
170
+ if (match) {
171
+ const protocol = match[1] || '';
172
+ const domain = `${protocol}${match[2]}`;
173
+ return `${domain}`;
174
+ }
175
+ return url;
176
+ };
177
+ let url = window.location.href;
178
+ return `${extractDomain(url)}` + value;
179
+ })();
180
+ return baseUrl;
181
+ }
182
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: GetNowDomainPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
183
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: GetNowDomainPipe, isStandalone: true, name: "getNowDomain" }); }
90
184
  }
185
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: GetNowDomainPipe, decorators: [{
186
+ type: Pipe,
187
+ args: [{
188
+ name: 'getNowDomain',
189
+ standalone: true
190
+ }]
191
+ }] });
91
192
 
92
- class CoreExpandModule {
93
- static forRoot() {
94
- return {
95
- ngModule: CoreExpandModule,
96
- providers: [
97
- APPENT_CONTENT,
98
- ],
99
- };
100
- }
101
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CoreExpandModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
102
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: CoreExpandModule });
103
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CoreExpandModule });
193
+ //pipe下新建:get-tenant-img.pipe.ts,
194
+ //如何引用见:独立管道的使用
195
+ class GetTenantImgPipe {
196
+ constructor() {
197
+ this.configState = inject(ConfigStateService);
198
+ this.environment = inject(EnvironmentService);
199
+ }
200
+ transform(value, ...args) {
201
+ let tenantId = this.configState.getDeep('currentUser.tenantId');
202
+ const environment = this.environment.getEnvironment();
203
+ let imgUrl = `${environment.apis.default.url}/api/file-explorer/files/${args}/${value}?__tenant=${tenantId}`;
204
+ return value ? imgUrl : '';
205
+ }
206
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: GetTenantImgPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
207
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: GetTenantImgPipe, isStandalone: true, name: "getTenantImg" }); }
104
208
  }
105
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CoreExpandModule, decorators: [{
106
- type: NgModule,
209
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: GetTenantImgPipe, decorators: [{
210
+ type: Pipe,
107
211
  args: [{
108
- declarations: [],
109
- imports: [],
110
- exports: [],
212
+ name: 'getTenantImg',
213
+ standalone: true,
111
214
  }]
112
215
  }] });
113
216
 
217
+ class SlugNormalizerPipe {
218
+ transform(value, ...args) {
219
+ return this.normalize(value);
220
+ }
221
+ normalize(value) {
222
+ // Convert to lowercase
223
+ value = value.toLowerCase();
224
+ // Replace special characters with hyphen
225
+ const invalidChars = ['\\', '/', '?', '&', '=', '+', '%', '#', '@', '!', '$', '\'', '"', ':', ';', '>', '<', '*', '(', ')', '[', '],', '{', '}', '|', '^', '`', '~'];
226
+ for (let c of invalidChars) {
227
+ value = value.replaceAll(c, '-');
228
+ }
229
+ // Convert spaces to hyphens
230
+ value = value.replaceAll(" ", "-");
231
+ // Remove multiple consecutive hyphens
232
+ while (value.includes("--")) {
233
+ value = value.replaceAll("--", "-");
234
+ }
235
+ // Trim hyphens from start and end
236
+ value = value.trim('-');
237
+ // URL encode the remaining string (handles UTF-8 characters)
238
+ //部分编码-保留语义
239
+ //return encodeURI(value);
240
+ //全部编码
241
+ return encodeURIComponent(value);
242
+ }
243
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SlugNormalizerPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
244
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: SlugNormalizerPipe, isStandalone: true, name: "slugNormalizer" }); }
245
+ }
246
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SlugNormalizerPipe, decorators: [{
247
+ type: Pipe,
248
+ args: [{
249
+ name: 'slugNormalizer',
250
+ standalone: true
251
+ }]
252
+ }] });
253
+
254
+ /* eslint-disable @angular-eslint/component-selector */
255
+ class ImagePreviewComponent {
256
+ set src(v) {
257
+ this._src = v;
258
+ }
259
+ constructor(modalService) {
260
+ this.modalService = modalService;
261
+ /**图片链接 */
262
+ this._src = '';
263
+ /**是否预览 */
264
+ this.preview = true;
265
+ /**宽 */
266
+ this.width = 90;
267
+ /**高 */
268
+ this.height = 90;
269
+ this.rounded = '';
270
+ this.id = '';
271
+ /**放大倍数 */
272
+ this.zoom = 10;
273
+ /**旋转 */
274
+ this.rotate = 0;
275
+ // private modalService = inject(NgbModal);
276
+ this.deleteChange = new EventEmitter();
277
+ this.checkChange = new EventEmitter();
278
+ }
279
+ /**选择图片的事件,返回父组件是否选中 */
280
+ checkImage(event) {
281
+ this.checkChange.emit(event.target.checked);
282
+ }
283
+ /**删除图片 */
284
+ deletecoverPics() {
285
+ this.deleteChange.emit();
286
+ }
287
+ /**打开预览弹窗 */
288
+ OpenPreviewImage(content) {
289
+ this.modalRef = this.modalService.open(content, {
290
+ fullscreen: true,
291
+ modalDialogClass: 'dignite-preview',
292
+ });
293
+ this.modalRef.result.then(result => { }, reason => {
294
+ this.zoom = 10;
295
+ });
296
+ }
297
+ /**放大图像 */
298
+ zoomIn() {
299
+ let zoom = this.zoom;
300
+ if (zoom == 20)
301
+ return;
302
+ zoom++;
303
+ this.zoom = zoom;
304
+ }
305
+ /**缩小图像 */
306
+ zoomOut() {
307
+ let zoom = this.zoom;
308
+ if (zoom == 3)
309
+ return;
310
+ zoom--;
311
+ this.zoom = zoom;
312
+ }
313
+ /**右旋转 */
314
+ RotateRight() {
315
+ if (this.rotate == 360)
316
+ return (this.rotate = 0);
317
+ this.rotate += 90;
318
+ }
319
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: ImagePreviewComponent, deps: [{ token: i1.NgbModal }], target: i0.ɵɵFactoryTarget.Component }); }
320
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: ImagePreviewComponent, isStandalone: true, selector: "app-image-preview", inputs: { src: "src", preview: "preview", width: "width", height: "height", rounded: "rounded", id: "id" }, outputs: { deleteChange: "deleteChange", checkChange: "checkChange" }, ngImport: i0, template: `
321
+ <div
322
+ [id]="id"
323
+ *ngIf="_src"
324
+ class="image-preview imagehove border position-relative m-1 overflow-hidden "
325
+ [style]="{'width': width+'px','height': height+'px',borderRadius:rounded}" [ngClass]="{'rounded-4': !rounded}"
326
+ >
327
+ <img [src]="_src" alt="" class="w-100 h-100 object-fit-cover" />
328
+ <input
329
+ type="checkbox"
330
+ class="form-check-input position-absolute top-0 end-0 m-1"
331
+ *ngIf="checkChange.observed"
332
+ (change)="checkImage($event)"
333
+ style="z-index: 10;"
334
+ />
335
+ <div
336
+ class="w-100 h-100 text-white position-absolute top-0 start-0"
337
+ style="background-color: #00000050;"
338
+ *ngIf="preview || deleteChange.observed"
339
+ >
340
+ <i
341
+ type="button"
342
+ class="fa fa-eye p-2"
343
+ *ngIf="preview"
344
+ (click.stop)="OpenPreviewImage(content)"
345
+ ></i>
346
+ <i
347
+ type="button"
348
+ class="fa fa-times p-2"
349
+ *ngIf="deleteChange.observed"
350
+ (click.stop)="deletecoverPics()"
351
+ ></i>
352
+ </div>
353
+ </div>
354
+
355
+ <ng-template #content let-modal>
356
+ <div class="modal-header">
357
+ <div class="d-flex justify-content-end w-100 fs-3 text-white">
358
+ <i
359
+ class="mx-2 fa fa fa-repeat"
360
+ aria-hidden="true"
361
+ title="右旋转"
362
+ role="button"
363
+ (click)="RotateRight()"
364
+ ></i>
365
+ <i
366
+ class="mx-2 fa fa-search-minus"
367
+ aria-hidden="true"
368
+ title="缩小"
369
+ role="button"
370
+ (click)="zoomOut()"
371
+ ></i>
372
+ <i
373
+ class="mx-2 fa fa-search-plus"
374
+ aria-hidden="true"
375
+ title="放大"
376
+ role="button"
377
+ (click)="zoomIn()"
378
+ ></i>
379
+ <i
380
+ class="mx-2 fa fa-times"
381
+ aria-hidden="true"
382
+ role="button"
383
+ (click)="modal.dismiss('Cross click')"
384
+ ></i>
385
+ </div>
386
+ </div>
387
+ <div class="modal-body d-flex justify-content-center align-items-center ">
388
+ <img
389
+ width="400"
390
+ class="modal-body-preview"
391
+ [src]="_src"
392
+ [style.transform]="'scale(' + zoom / 10 + ') rotate(' + rotate + 'deg)'"
393
+ />
394
+ </div>
395
+ </ng-template>
396
+ `, isInline: true, styles: [".image-preview.imagehove>div{display:none}.image-preview.imagehove:hover div{display:flex;align-items:center;justify-content:center}::ng-deep .dignite-preview .modal-content{background-color:transparent!important}.object-fit-cover{object-fit:cover}\n"], dependencies: [{ kind: "ngmodule", type: CoreModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "ngmodule", type: ThemeSharedModule }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: PageModule }] }); }
397
+ }
398
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: ImagePreviewComponent, decorators: [{
399
+ type: Component,
400
+ args: [{ selector: 'app-image-preview', template: `
401
+ <div
402
+ [id]="id"
403
+ *ngIf="_src"
404
+ class="image-preview imagehove border position-relative m-1 overflow-hidden "
405
+ [style]="{'width': width+'px','height': height+'px',borderRadius:rounded}" [ngClass]="{'rounded-4': !rounded}"
406
+ >
407
+ <img [src]="_src" alt="" class="w-100 h-100 object-fit-cover" />
408
+ <input
409
+ type="checkbox"
410
+ class="form-check-input position-absolute top-0 end-0 m-1"
411
+ *ngIf="checkChange.observed"
412
+ (change)="checkImage($event)"
413
+ style="z-index: 10;"
414
+ />
415
+ <div
416
+ class="w-100 h-100 text-white position-absolute top-0 start-0"
417
+ style="background-color: #00000050;"
418
+ *ngIf="preview || deleteChange.observed"
419
+ >
420
+ <i
421
+ type="button"
422
+ class="fa fa-eye p-2"
423
+ *ngIf="preview"
424
+ (click.stop)="OpenPreviewImage(content)"
425
+ ></i>
426
+ <i
427
+ type="button"
428
+ class="fa fa-times p-2"
429
+ *ngIf="deleteChange.observed"
430
+ (click.stop)="deletecoverPics()"
431
+ ></i>
432
+ </div>
433
+ </div>
434
+
435
+ <ng-template #content let-modal>
436
+ <div class="modal-header">
437
+ <div class="d-flex justify-content-end w-100 fs-3 text-white">
438
+ <i
439
+ class="mx-2 fa fa fa-repeat"
440
+ aria-hidden="true"
441
+ title="右旋转"
442
+ role="button"
443
+ (click)="RotateRight()"
444
+ ></i>
445
+ <i
446
+ class="mx-2 fa fa-search-minus"
447
+ aria-hidden="true"
448
+ title="缩小"
449
+ role="button"
450
+ (click)="zoomOut()"
451
+ ></i>
452
+ <i
453
+ class="mx-2 fa fa-search-plus"
454
+ aria-hidden="true"
455
+ title="放大"
456
+ role="button"
457
+ (click)="zoomIn()"
458
+ ></i>
459
+ <i
460
+ class="mx-2 fa fa-times"
461
+ aria-hidden="true"
462
+ role="button"
463
+ (click)="modal.dismiss('Cross click')"
464
+ ></i>
465
+ </div>
466
+ </div>
467
+ <div class="modal-body d-flex justify-content-center align-items-center ">
468
+ <img
469
+ width="400"
470
+ class="modal-body-preview"
471
+ [src]="_src"
472
+ [style.transform]="'scale(' + zoom / 10 + ') rotate(' + rotate + 'deg)'"
473
+ />
474
+ </div>
475
+ </ng-template>
476
+ `, standalone: true, imports: [CoreModule, ThemeSharedModule, CommonModule, PageModule], styles: [".image-preview.imagehove>div{display:none}.image-preview.imagehove:hover div{display:flex;align-items:center;justify-content:center}::ng-deep .dignite-preview .modal-content{background-color:transparent!important}.object-fit-cover{object-fit:cover}\n"] }]
477
+ }], ctorParameters: () => [{ type: i1.NgbModal }], propDecorators: { src: [{
478
+ type: Input
479
+ }], preview: [{
480
+ type: Input
481
+ }], width: [{
482
+ type: Input
483
+ }], height: [{
484
+ type: Input
485
+ }], rounded: [{
486
+ type: Input
487
+ }], id: [{
488
+ type: Input
489
+ }], deleteChange: [{
490
+ type: Output
491
+ }], checkChange: [{
492
+ type: Output
493
+ }] } });
494
+
495
+ /* eslint-disable @angular-eslint/directive-selector */
496
+ class KeydownPreventDefaultDirective {
497
+ constructor() { }
498
+ onKeyDown(event) {
499
+ event.preventDefault();
500
+ }
501
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: KeydownPreventDefaultDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
502
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.1.5", type: KeydownPreventDefaultDirective, isStandalone: true, selector: "[KeydownPreventDefault]", host: { listeners: { "keydown.enter": "onKeyDown($event)" } }, ngImport: i0 }); }
503
+ }
504
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: KeydownPreventDefaultDirective, decorators: [{
505
+ type: Directive,
506
+ args: [{
507
+ selector: '[KeydownPreventDefault]',
508
+ standalone: true,
509
+ }]
510
+ }], ctorParameters: () => [], propDecorators: { onKeyDown: [{
511
+ type: HostListener,
512
+ args: ['keydown.enter', ['$event']]
513
+ }] } });
514
+
114
515
  /*
115
516
  * Public API Surface of core
116
517
  */
@@ -119,5 +520,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
119
520
  * Generated bundle index. Do not edit.
120
521
  */
121
522
 
122
- export { APPENT_CONTENT, AppentContentService, CoreExpandModule, configureRoutes };
523
+ export { GetNowDomainPipe, GetTenantImgPipe, ImagePreviewComponent, KeydownPreventDefaultDirective, SimpleReuseStrategy, SlugNormalizerPipe, UpdateListService };
123
524
  //# sourceMappingURL=dignite-ng-expand.core.mjs.map