@dignite-ng/expand.core 0.0.2 → 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 (41) hide show
  1. package/README.md +24 -24
  2. package/esm2022/dignite-ng-expand.core.mjs +1 -1
  3. package/esm2022/lib/directives/index.mjs +2 -0
  4. package/esm2022/lib/directives/keydown-prevent-default.directive.mjs +22 -0
  5. package/esm2022/lib/expand/image-preview.component.mjs +250 -0
  6. package/esm2022/lib/expand/index.mjs +2 -0
  7. package/esm2022/lib/pipes/get-now-domain.pipe.mjs +53 -0
  8. package/esm2022/lib/pipes/get-tenant-img.pipe.mjs +27 -0
  9. package/esm2022/lib/pipes/index.mjs +4 -0
  10. package/esm2022/lib/pipes/slug-normalizer.pipe.mjs +39 -0
  11. package/esm2022/lib/services/index.mjs +2 -0
  12. package/esm2022/lib/services/update-list.service.mjs +50 -0
  13. package/esm2022/lib/strategies/index.mjs +2 -0
  14. package/esm2022/lib/strategies/simple-reuse-strategy.mjs +84 -0
  15. package/esm2022/public-api.mjs +6 -5
  16. package/fesm2022/dignite-ng-expand.core.mjs +497 -38
  17. package/fesm2022/dignite-ng-expand.core.mjs.map +1 -1
  18. package/lib/directives/index.d.ts +1 -0
  19. package/lib/directives/keydown-prevent-default.directive.d.ts +7 -0
  20. package/lib/expand/image-preview.component.d.ts +40 -0
  21. package/lib/expand/index.d.ts +1 -0
  22. package/lib/pipes/get-now-domain.pipe.d.ts +19 -0
  23. package/lib/pipes/get-tenant-img.pipe.d.ts +9 -0
  24. package/lib/pipes/index.d.ts +3 -0
  25. package/lib/pipes/slug-normalizer.pipe.d.ts +8 -0
  26. package/lib/services/index.d.ts +1 -0
  27. package/lib/services/update-list.service.d.ts +37 -0
  28. package/lib/strategies/index.d.ts +1 -0
  29. package/lib/strategies/simple-reuse-strategy.d.ts +33 -0
  30. package/package.json +3 -7
  31. package/public-api.d.ts +5 -4
  32. package/esm2022/lib/core.component.mjs +0 -19
  33. package/esm2022/lib/core.module.mjs +0 -21
  34. package/esm2022/lib/core.service.mjs +0 -14
  35. package/esm2022/lib/utils/common-utils.mjs +0 -5
  36. package/esm2022/lib/utils/index.mjs +0 -2
  37. package/lib/core.component.d.ts +0 -5
  38. package/lib/core.module.d.ts +0 -7
  39. package/lib/core.service.d.ts +0 -6
  40. package/lib/utils/common-utils.d.ts +0 -1
  41. package/lib/utils/index.d.ts +0 -1
@@ -0,0 +1,84 @@
1
+ /**
2
+ * 路由复用策略
3
+ *
4
+ * 1. 实现shouldReuseRoute方法,判断是否同一路由时复用路由
5
+ * 2. 实现retrieve方法,获取存储路由
6
+ * 3. 实现shouldDetach方法,判断是否有路由存储
7
+ * 4. 实现store方法,存储路由
8
+ * 5. 实现shouldAttach方法,判断是否有路由存储
9
+ * 6. 实现retrieve方法,获取存储路由
10
+ * 7. 实现destroy方法,销毁路由
11
+ *
12
+ * *使用方法
13
+ @NgModule({
14
+ providers: [
15
+ { provide: RouteReuseStrategy, useClass: SimpleReuseStrategy }
16
+ ],
17
+ })
18
+
19
+ data: { keep: true }
20
+ */
21
+ export class SimpleReuseStrategy {
22
+ static { this.cacheRouters = new Map(); }
23
+ static deleteRouteCache(url) {
24
+ if (SimpleReuseStrategy.cacheRouters.has(url)) {
25
+ const handle = SimpleReuseStrategy.cacheRouters.get(url);
26
+ try {
27
+ handle.componentRef.destory();
28
+ }
29
+ catch (e) { }
30
+ SimpleReuseStrategy.cacheRouters.delete(url);
31
+ }
32
+ }
33
+ static deleteAllRouteCache() {
34
+ SimpleReuseStrategy.cacheRouters.forEach((handle, key) => {
35
+ SimpleReuseStrategy.deleteRouteCache(key);
36
+ });
37
+ }
38
+ // one 进入路由触发,是否同一路由时复用路由
39
+ shouldReuseRoute(future, curr) {
40
+ return (future.routeConfig === curr.routeConfig &&
41
+ JSON.stringify(future.params) === JSON.stringify(curr.params));
42
+ }
43
+ // 获取存储路由
44
+ retrieve(route) {
45
+ const url = this.getFullRouteURL(route);
46
+ if (route.data.keep && SimpleReuseStrategy.cacheRouters.has(url)) {
47
+ return SimpleReuseStrategy.cacheRouters.get(url);
48
+ }
49
+ else {
50
+ return null;
51
+ }
52
+ }
53
+ // Whether to allow multiplexing routes
54
+ shouldDetach(route) {
55
+ return Boolean(route.data.keep);
56
+ }
57
+ //It is triggered when the route leaves. The route is stored
58
+ store(route, handle) {
59
+ const url = this.getFullRouteURL(route);
60
+ // 先把之前缓存的删除,
61
+ SimpleReuseStrategy.cacheRouters.forEach((handle, key) => {
62
+ SimpleReuseStrategy.deleteRouteCache(key);
63
+ });
64
+ SimpleReuseStrategy.cacheRouters.set(url, handle);
65
+ }
66
+ // Whether to allow route restoration
67
+ shouldAttach(route) {
68
+ const url = this.getFullRouteURL(route);
69
+ return Boolean(route.data.keep) && SimpleReuseStrategy.cacheRouters.has(url);
70
+ }
71
+ // Gets the current route url
72
+ getFullRouteURL(route) {
73
+ const { pathFromRoot } = route;
74
+ let fullRouteUrlPath = [];
75
+ pathFromRoot.forEach((item) => {
76
+ fullRouteUrlPath = fullRouteUrlPath.concat(this.getRouteUrlPath(item));
77
+ });
78
+ return `/${fullRouteUrlPath.join('/')}`;
79
+ }
80
+ getRouteUrlPath(route) {
81
+ return route.url.map(urlSegment => urlSegment.path);
82
+ }
83
+ }
84
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2ltcGxlLXJldXNlLXN0cmF0ZWd5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY29yZS9zcmMvbGliL3N0cmF0ZWdpZXMvc2ltcGxlLXJldXNlLXN0cmF0ZWd5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7O0dBbUJHO0FBQ0gsTUFBTSxPQUFPLG1CQUFtQjthQUNyQixpQkFBWSxHQUFHLElBQUksR0FBRyxFQUErQixDQ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ZFJvdXRlU25hcHNob3QpIHtcclxuICAgICAgICByZXR1cm4gcm91dGUudXJsLm1hcCh1cmxTZWdtZW50ID0+IHVybFNlZ21lbnQucGF0aCk7XHJcbiAgICB9XHJcbn1cclxuIl19
@@ -1,8 +1,9 @@
1
1
  /*
2
2
  * Public API Surface of core
3
3
  */
4
- export * from './lib/core.service';
5
- export * from './lib/core.component';
6
- export * from './lib/core.module';
7
- export * from './lib/utils';
8
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvcmUvc3JjL3B1YmxpYy1hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsc0JBQXNCLENBQUM7QUFDckMsY0FBYyxtQkFBbUIsQ0FBQztBQUNsQyxjQUFjLGFBQWEsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBQdWJsaWMgQVBJIFN1cmZhY2Ugb2YgY29yZVxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vbGliL2NvcmUuc2VydmljZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9jb3JlLmNvbXBvbmVudCc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9jb3JlLm1vZHVsZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi91dGlscyc7XG4iXX0=
4
+ export * from './lib/strategies';
5
+ export * from './lib/services';
6
+ export * from './lib/pipes';
7
+ export * from './lib/expand';
8
+ export * from './lib/directives';
9
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL2NvcmUvc3JjL3B1YmxpYy1hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGtCQUFrQixDQUFDO0FBQ2pDLGNBQWMsZ0JBQWdCLENBQUM7QUFDL0IsY0FBYyxhQUFhLENBQUM7QUFDNUIsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyxrQkFBa0IsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qXHJcbiAqIFB1YmxpYyBBUEkgU3VyZmFjZSBvZiBjb3JlXHJcbiAqL1xyXG5cclxuZXhwb3J0ICogZnJvbSAnLi9saWIvc3RyYXRlZ2llcyc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL3NlcnZpY2VzJztcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvcGlwZXMnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9leHBhbmQnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9kaXJlY3RpdmVzJztcclxuIl19
@@ -1,57 +1,516 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, Component, 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
- class CoreService {
5
- constructor() { }
6
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: CoreService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
7
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: CoreService, providedIn: 'root' }); }
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
+ })
29
+
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
+ }
94
+ }
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' }); }
8
135
  }
9
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: CoreService, decorators: [{
136
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: UpdateListService, decorators: [{
10
137
  type: Injectable,
11
138
  args: [{
12
- providedIn: 'root'
139
+ providedIn: 'root',
13
140
  }]
14
141
  }], ctorParameters: () => [] });
15
142
 
16
- class CoreComponent {
17
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: CoreComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
18
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.9", type: CoreComponent, selector: "lib-core", ngImport: i0, template: `
19
- <p>
20
- core works!
21
- </p>
22
- `, isInline: true }); }
143
+ /**获取当前窗口域名
144
+ * 需要将environment.ts页面配置
145
+ application: {
146
+ baseUrl,
147
+ name: 'Travely',
148
+ webUrl:'https://localhost:44374',
149
+ },
150
+ *
151
+ */
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" }); }
23
184
  }
24
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: CoreComponent, decorators: [{
25
- type: Component,
26
- args: [{ selector: 'lib-core', template: `
27
- <p>
28
- core works!
29
- </p>
30
- ` }]
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
+ }] });
192
+
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" }); }
208
+ }
209
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: GetTenantImgPipe, decorators: [{
210
+ type: Pipe,
211
+ args: [{
212
+ name: 'getTenantImg',
213
+ standalone: true,
214
+ }]
31
215
  }] });
32
216
 
33
- class CoreModule {
34
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: CoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
35
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.9", ngImport: i0, type: CoreModule, declarations: [CoreComponent], exports: [CoreComponent] }); }
36
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: CoreModule }); }
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" }); }
37
245
  }
38
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: CoreModule, decorators: [{
39
- type: NgModule,
246
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SlugNormalizerPipe, decorators: [{
247
+ type: Pipe,
40
248
  args: [{
41
- declarations: [
42
- CoreComponent
43
- ],
44
- imports: [],
45
- exports: [
46
- CoreComponent
47
- ]
249
+ name: 'slugNormalizer',
250
+ standalone: true
48
251
  }]
49
252
  }] });
50
253
 
51
- function noop() {
52
- const fn = function () { };
53
- return fn;
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 }] }); }
54
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
+ }] } });
55
514
 
56
515
  /*
57
516
  * Public API Surface of core
@@ -61,5 +520,5 @@ function noop() {
61
520
  * Generated bundle index. Do not edit.
62
521
  */
63
522
 
64
- export { CoreComponent, CoreModule, CoreService, noop };
523
+ export { GetNowDomainPipe, GetTenantImgPipe, ImagePreviewComponent, KeydownPreventDefaultDirective, SimpleReuseStrategy, SlugNormalizerPipe, UpdateListService };
65
524
  //# sourceMappingURL=dignite-ng-expand.core.mjs.map