@delon/abc 20.1.0 → 21.0.0-next.1
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/auto-focus.mjs +10 -10
- package/fesm2022/auto-focus.mjs.map +1 -1
- package/fesm2022/cell.mjs +23 -25
- package/fesm2022/cell.mjs.map +1 -1
- package/fesm2022/chart-observer-size.mjs +21 -34
- package/fesm2022/chart-observer-size.mjs.map +1 -1
- package/fesm2022/count-down.mjs +24 -31
- package/fesm2022/count-down.mjs.map +1 -1
- package/fesm2022/date-picker.mjs +89 -85
- package/fesm2022/date-picker.mjs.map +1 -1
- package/fesm2022/down-file.mjs +24 -44
- package/fesm2022/down-file.mjs.map +1 -1
- package/fesm2022/ellipsis.mjs +165 -106
- package/fesm2022/ellipsis.mjs.map +1 -1
- package/fesm2022/error-collect.mjs +12 -14
- package/fesm2022/error-collect.mjs.map +1 -1
- package/fesm2022/exception.mjs +9 -9
- package/fesm2022/exception.mjs.map +1 -1
- package/fesm2022/footer-toolbar.mjs +9 -9
- package/fesm2022/footer-toolbar.mjs.map +1 -1
- package/fesm2022/full-content.mjs +50 -58
- package/fesm2022/full-content.mjs.map +1 -1
- package/fesm2022/global-footer.mjs +14 -15
- package/fesm2022/global-footer.mjs.map +1 -1
- package/fesm2022/hotkey.mjs +7 -7
- package/fesm2022/hotkey.mjs.map +1 -1
- package/fesm2022/loading.mjs +62 -15
- package/fesm2022/loading.mjs.map +1 -1
- package/fesm2022/lodop.mjs +8 -8
- package/fesm2022/lodop.mjs.map +1 -1
- package/fesm2022/media.mjs +37 -61
- package/fesm2022/media.mjs.map +1 -1
- package/fesm2022/notice-icon.mjs +220 -25
- package/fesm2022/notice-icon.mjs.map +1 -1
- package/fesm2022/onboarding.mjs +163 -65
- package/fesm2022/onboarding.mjs.map +1 -1
- package/fesm2022/page-header.mjs +252 -155
- package/fesm2022/page-header.mjs.map +1 -1
- package/fesm2022/pdf.mjs +9 -9
- package/fesm2022/pdf.mjs.map +1 -1
- package/fesm2022/quick-menu.mjs +79 -71
- package/fesm2022/quick-menu.mjs.map +1 -1
- package/fesm2022/reuse-tab.mjs +262 -165
- package/fesm2022/reuse-tab.mjs.map +1 -1
- package/fesm2022/se.mjs +290 -310
- package/fesm2022/se.mjs.map +1 -1
- package/fesm2022/sg.mjs +32 -69
- package/fesm2022/sg.mjs.map +1 -1
- package/fesm2022/st.mjs +124 -115
- package/fesm2022/st.mjs.map +1 -1
- package/fesm2022/sv.mjs +185 -174
- package/fesm2022/sv.mjs.map +1 -1
- package/fesm2022/tag-select.mjs +44 -25
- package/fesm2022/tag-select.mjs.map +1 -1
- package/fesm2022/xlsx.mjs +16 -19
- package/fesm2022/xlsx.mjs.map +1 -1
- package/fesm2022/zip.mjs +4 -4
- package/fesm2022/zip.mjs.map +1 -1
- package/package.json +40 -40
- package/{auto-focus/index.d.ts → types/auto-focus.d.ts} +2 -2
- package/{cell/index.d.ts → types/cell.d.ts} +12 -13
- package/{observers/index.d.ts → types/chart-observer-size.d.ts} +5 -9
- package/{count-down/index.d.ts → types/count-down.d.ts} +6 -10
- package/{date-picker/index.d.ts → types/date-picker.d.ts} +6 -10
- package/types/down-file.d.ts +32 -0
- package/types/ellipsis.d.ts +46 -0
- package/types/error-collect.d.ts +34 -0
- package/{exception/index.d.ts → types/exception.d.ts} +13 -13
- package/{footer-toolbar/index.d.ts → types/footer-toolbar.d.ts} +2 -2
- package/{full-content/index.d.ts → types/full-content.d.ts} +8 -13
- package/{global-footer/index.d.ts → types/global-footer.d.ts} +7 -7
- package/{loading/index.d.ts → types/loading.d.ts} +1 -0
- package/{media/index.d.ts → types/media.d.ts} +10 -16
- package/{notice-icon/index.d.ts → types/notice-icon.d.ts} +15 -15
- package/{onboarding/index.d.ts → types/onboarding.d.ts} +12 -14
- package/types/page-header.d.ts +67 -0
- package/types/quick-menu.d.ts +31 -0
- package/{reuse-tab/index.d.ts → types/reuse-tab.d.ts} +46 -55
- package/types/se.d.ts +101 -0
- package/types/sg.d.ts +31 -0
- package/{st/index.d.ts → types/st.d.ts} +10 -2
- package/types/sv.d.ts +81 -0
- package/types/tag-select.d.ts +25 -0
- package/{xlsx/index.d.ts → types/xlsx.d.ts} +3 -3
- package/down-file/index.d.ts +0 -34
- package/ellipsis/index.d.ts +0 -55
- package/error-collect/index.d.ts +0 -35
- package/page-header/index.d.ts +0 -83
- package/quick-menu/index.d.ts +0 -38
- package/se/index.d.ts +0 -129
- package/sg/index.d.ts +0 -44
- package/sv/index.d.ts +0 -96
- package/tag-select/index.d.ts +0 -27
- /package/{index.d.ts → types/abc.d.ts} +0 -0
- /package/{hotkey/index.d.ts → types/hotkey.d.ts} +0 -0
- /package/{lodop/index.d.ts → types/lodop.d.ts} +0 -0
- /package/{pdf/index.d.ts → types/pdf.d.ts} +0 -0
- /package/{zip/index.d.ts → types/zip.d.ts} +0 -0
package/fesm2022/auto-focus.mjs
CHANGED
|
@@ -4,8 +4,8 @@ import { timer, take } from 'rxjs';
|
|
|
4
4
|
|
|
5
5
|
class AutoFocusDirective {
|
|
6
6
|
el = inject(ElementRef).nativeElement;
|
|
7
|
-
enabled = input(true, ...(ngDevMode ?
|
|
8
|
-
delay = input(25, ...(ngDevMode ?
|
|
7
|
+
enabled = input(true, { ...(ngDevMode ? { debugName: "enabled" } : {}), transform: booleanAttribute });
|
|
8
|
+
delay = input(25, { ...(ngDevMode ? { debugName: "delay" } : {}), transform: numberAttribute });
|
|
9
9
|
focus = output();
|
|
10
10
|
constructor() {
|
|
11
11
|
afterNextRender(() => {
|
|
@@ -19,24 +19,24 @@ class AutoFocusDirective {
|
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
23
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
22
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AutoFocusDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
23
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.6", type: AutoFocusDirective, isStandalone: true, selector: "[auto-focus], input[autofocus=\"autofocus\"], textarea[autofocus=\"autofocus\"]", inputs: { enabled: { classPropertyName: "enabled", publicName: "enabled", isSignal: true, isRequired: false, transformFunction: null }, delay: { classPropertyName: "delay", publicName: "delay", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { focus: "focus" }, exportAs: ["autoFocus"], ngImport: i0 });
|
|
24
24
|
}
|
|
25
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
25
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AutoFocusDirective, decorators: [{
|
|
26
26
|
type: Directive,
|
|
27
27
|
args: [{
|
|
28
28
|
selector: '[auto-focus], input[autofocus="autofocus"], textarea[autofocus="autofocus"]',
|
|
29
29
|
exportAs: 'autoFocus'
|
|
30
30
|
}]
|
|
31
|
-
}], ctorParameters: () => [] });
|
|
31
|
+
}], ctorParameters: () => [], propDecorators: { enabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "enabled", required: false }] }], delay: [{ type: i0.Input, args: [{ isSignal: true, alias: "delay", required: false }] }], focus: [{ type: i0.Output, args: ["focus"] }] } });
|
|
32
32
|
|
|
33
33
|
const COMPONENTS = [AutoFocusDirective];
|
|
34
34
|
class AutoFocusModule {
|
|
35
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
36
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
37
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
35
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AutoFocusModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
36
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.6", ngImport: i0, type: AutoFocusModule, imports: [AutoFocusDirective], exports: [AutoFocusDirective] });
|
|
37
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AutoFocusModule });
|
|
38
38
|
}
|
|
39
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
39
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AutoFocusModule, decorators: [{
|
|
40
40
|
type: NgModule,
|
|
41
41
|
args: [{
|
|
42
42
|
imports: COMPONENTS,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-focus.mjs","sources":["../../../../packages/abc/auto-focus/auto-focus.directive.ts","../../../../packages/abc/auto-focus/auto-focus.module.ts","../../../../packages/abc/auto-focus/auto-focus.ts"],"sourcesContent":["import {\n Directive,\n ElementRef,\n afterNextRender,\n booleanAttribute,\n inject,\n input,\n numberAttribute,\n output\n} from '@angular/core';\nimport { take, timer } from 'rxjs';\n\n@Directive({\n selector: '[auto-focus], input[autofocus=\"autofocus\"], textarea[autofocus=\"autofocus\"]',\n exportAs: 'autoFocus'\n})\nexport class AutoFocusDirective {\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n enabled = input(true, { transform: booleanAttribute });\n delay = input(25, { transform: numberAttribute });\n readonly focus = output();\n\n constructor() {\n afterNextRender(() => {\n if (this.enabled()) {\n timer(this.delay())\n .pipe(take(1))\n .subscribe(() => {\n this.el.focus({ preventScroll: false });\n this.focus.emit();\n });\n }\n });\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { AutoFocusDirective } from './auto-focus.directive';\n\nconst COMPONENTS = [AutoFocusDirective];\n\n@NgModule({\n imports: COMPONENTS,\n exports: COMPONENTS\n})\nexport class AutoFocusModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAgBa,kBAAkB,CAAA;AACZ,IAAA,EAAE,GAAG,MAAM,CAA0B,UAAU,CAAC,CAAC,aAAa;
|
|
1
|
+
{"version":3,"file":"auto-focus.mjs","sources":["../../../../packages/abc/auto-focus/auto-focus.directive.ts","../../../../packages/abc/auto-focus/auto-focus.module.ts","../../../../packages/abc/auto-focus/auto-focus.ts"],"sourcesContent":["import {\n Directive,\n ElementRef,\n afterNextRender,\n booleanAttribute,\n inject,\n input,\n numberAttribute,\n output\n} from '@angular/core';\nimport { take, timer } from 'rxjs';\n\n@Directive({\n selector: '[auto-focus], input[autofocus=\"autofocus\"], textarea[autofocus=\"autofocus\"]',\n exportAs: 'autoFocus'\n})\nexport class AutoFocusDirective {\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n readonly enabled = input(true, { transform: booleanAttribute });\n readonly delay = input(25, { transform: numberAttribute });\n readonly focus = output();\n\n constructor() {\n afterNextRender(() => {\n if (this.enabled()) {\n timer(this.delay())\n .pipe(take(1))\n .subscribe(() => {\n this.el.focus({ preventScroll: false });\n this.focus.emit();\n });\n }\n });\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { AutoFocusDirective } from './auto-focus.directive';\n\nconst COMPONENTS = [AutoFocusDirective];\n\n@NgModule({\n imports: COMPONENTS,\n exports: COMPONENTS\n})\nexport class AutoFocusModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAgBa,kBAAkB,CAAA;AACZ,IAAA,EAAE,GAAG,MAAM,CAA0B,UAAU,CAAC,CAAC,aAAa;IACtE,OAAO,GAAG,KAAK,CAAC,IAAI,oDAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;IACtD,KAAK,GAAG,KAAK,CAAC,EAAE,kDAAI,SAAS,EAAE,eAAe,EAAA,CAAG;IACjD,K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B,CAAC;MAM1B,eAAe,CAAA;uGAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;wGAAf,eAAe,EAAA,OAAA,EAAA,CANR,kBAAkB,CAAA,EAAA,OAAA,EAAA,CAAlB,kBAAkB,CAAA,EAAA,CAAA;wGAMzB,eAAe,EAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,UAAU;AACnB,oBAAA,OAAO,EAAE;AACV,iBAAA;;;ACTD;;AAEG;;;;"}
|
package/fesm2022/cell.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NgTemplateOutlet, CommonModule } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, Injectable, ViewContainerRef, input, effect, Directive, Renderer2, ElementRef, signal, computed, model, booleanAttribute, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule, makeEnvironmentProviders, provideEnvironmentInitializer } from '@angular/core';
|
|
3
|
+
import { inject, Injectable, ViewContainerRef, input, effect, Directive, Renderer2, ElementRef, DestroyRef, signal, computed, model, booleanAttribute, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule, makeEnvironmentProviders, provideEnvironmentInitializer } from '@angular/core';
|
|
4
4
|
import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import * as i1 from '@angular/forms';
|
|
6
6
|
import { FormsModule } from '@angular/forms';
|
|
@@ -177,10 +177,10 @@ class CellService {
|
|
|
177
177
|
return res;
|
|
178
178
|
}));
|
|
179
179
|
}
|
|
180
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
181
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
180
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CellService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
181
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CellService, providedIn: 'root' });
|
|
182
182
|
}
|
|
183
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
183
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CellService, decorators: [{
|
|
184
184
|
type: Injectable,
|
|
185
185
|
args: [{ providedIn: 'root' }]
|
|
186
186
|
}] });
|
|
@@ -205,15 +205,15 @@ class CellHostDirective {
|
|
|
205
205
|
componentRef.instance.data = data;
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
209
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
208
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CellHostDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
209
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.6", type: CellHostDirective, isStandalone: true, selector: "[cell-widget-host]", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
|
|
210
210
|
}
|
|
211
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
211
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CellHostDirective, decorators: [{
|
|
212
212
|
type: Directive,
|
|
213
213
|
args: [{
|
|
214
214
|
selector: '[cell-widget-host]'
|
|
215
215
|
}]
|
|
216
|
-
}], ctorParameters: () => [] });
|
|
216
|
+
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }] } });
|
|
217
217
|
|
|
218
218
|
class CellComponent {
|
|
219
219
|
srv = inject(CellService);
|
|
@@ -222,15 +222,15 @@ class CellComponent {
|
|
|
222
222
|
imgSrv = inject(NzImageService);
|
|
223
223
|
win = inject(WINDOW);
|
|
224
224
|
el = inject(ElementRef).nativeElement;
|
|
225
|
-
|
|
225
|
+
d$ = inject(DestroyRef);
|
|
226
226
|
_text = signal('', ...(ngDevMode ? [{ debugName: "_text" }] : []));
|
|
227
227
|
_unit = signal(undefined, ...(ngDevMode ? [{ debugName: "_unit" }] : []));
|
|
228
228
|
_res = signal(undefined, ...(ngDevMode ? [{ debugName: "_res" }] : []));
|
|
229
229
|
showDefault = computed(() => this.value() == this.safeOpt.default?.condition, ...(ngDevMode ? [{ debugName: "showDefault" }] : []));
|
|
230
230
|
value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
|
|
231
231
|
options = input(...(ngDevMode ? [undefined, { debugName: "options" }] : []));
|
|
232
|
-
loading = input(false, ...(ngDevMode ?
|
|
233
|
-
disabled = input(false, ...(ngDevMode ?
|
|
232
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : {}), transform: booleanAttribute });
|
|
233
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
234
234
|
get safeOpt() {
|
|
235
235
|
return this._res()?.options ?? {};
|
|
236
236
|
}
|
|
@@ -239,13 +239,14 @@ class CellComponent {
|
|
|
239
239
|
combineLatest([toObservable(this.loading), toObservable(this.disabled)])
|
|
240
240
|
.pipe(takeUntilDestroyed())
|
|
241
241
|
.subscribe(() => this.setClass());
|
|
242
|
+
let sub = null;
|
|
242
243
|
effect(() => {
|
|
243
244
|
const v = this.value();
|
|
244
245
|
const o = this.options();
|
|
245
|
-
|
|
246
|
-
|
|
246
|
+
sub?.unsubscribe();
|
|
247
|
+
sub = this.srv
|
|
247
248
|
.get(v, o)
|
|
248
|
-
.pipe(take(1))
|
|
249
|
+
.pipe(take(1), takeUntilDestroyed(this.d$))
|
|
249
250
|
.subscribe(res => {
|
|
250
251
|
this._res.set(res);
|
|
251
252
|
this._text.set(res.result?.text ?? '');
|
|
@@ -297,11 +298,8 @@ class CellComponent {
|
|
|
297
298
|
.preview(list.map(p => ({ src: p })), config.previewOptions)
|
|
298
299
|
.switchTo(idx);
|
|
299
300
|
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
}
|
|
303
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: CellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
304
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", type: CellComponent, isStandalone: true, selector: "cell, [cell]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, exportAs: ["cell"], ngImport: i0, template: `
|
|
301
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
302
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: CellComponent, isStandalone: true, selector: "cell, [cell]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, exportAs: ["cell"], ngImport: i0, template: `
|
|
305
303
|
<ng-template #text>
|
|
306
304
|
@let res = _res();
|
|
307
305
|
@let text = _text();
|
|
@@ -377,7 +375,7 @@ class CellComponent {
|
|
|
377
375
|
}
|
|
378
376
|
`, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NzCheckboxComponent, selector: "[nz-checkbox]", inputs: ["nzValue", "nzAutoFocus", "nzDisabled", "nzIndeterminate", "nzChecked", "nzId", "nzName"], outputs: ["nzCheckedChange"], exportAs: ["nzCheckbox"] }, { kind: "component", type: NzRadioComponent, selector: "[nz-radio],[nz-radio-button]", inputs: ["nzValue", "nzDisabled", "nzAutoFocus", "nz-radio-button"], exportAs: ["nzRadio"] }, { kind: "directive", type: NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "component", type: NzTagComponent, selector: "nz-tag", inputs: ["nzMode", "nzColor", "nzChecked", "nzBordered"], outputs: ["nzOnClose", "nzCheckedChange"], exportAs: ["nzTag"] }, { kind: "component", type: NzBadgeComponent, selector: "nz-badge", inputs: ["nzShowZero", "nzShowDot", "nzStandalone", "nzDot", "nzOverflowCount", "nzColor", "nzStyle", "nzText", "nzTitle", "nzStatus", "nzCount", "nzOffset", "nzSize"], exportAs: ["nzBadge"] }, { kind: "directive", type: NzTooltipDirective, selector: "[nz-tooltip]", inputs: ["nzTooltipTitle", "nzTooltipTitleContext", "nz-tooltip", "nzTooltipTrigger", "nzTooltipPlacement", "nzTooltipOrigin", "nzTooltipVisible", "nzTooltipMouseEnterDelay", "nzTooltipMouseLeaveDelay", "nzTooltipOverlayClassName", "nzTooltipOverlayStyle", "nzTooltipArrowPointAtCenter", "cdkConnectedOverlayPush", "nzTooltipColor"], outputs: ["nzTooltipVisibleChange"], exportAs: ["nzTooltip"] }, { kind: "ngmodule", type: NzImageModule }, { kind: "directive", type: CellHostDirective, selector: "[cell-widget-host]", inputs: ["data"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
379
377
|
}
|
|
380
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
378
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CellComponent, decorators: [{
|
|
381
379
|
type: Component,
|
|
382
380
|
args: [{
|
|
383
381
|
selector: 'cell, [cell]',
|
|
@@ -472,12 +470,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
472
470
|
CellHostDirective
|
|
473
471
|
]
|
|
474
472
|
}]
|
|
475
|
-
}], ctorParameters: () => [] });
|
|
473
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
476
474
|
|
|
477
475
|
const COMPS = [CellComponent];
|
|
478
476
|
class CellModule {
|
|
479
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
480
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
477
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CellModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
478
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.6", ngImport: i0, type: CellModule, imports: [CommonModule,
|
|
481
479
|
FormsModule,
|
|
482
480
|
NzCheckboxModule,
|
|
483
481
|
NzRadioModule,
|
|
@@ -486,7 +484,7 @@ class CellModule {
|
|
|
486
484
|
NzTooltipModule,
|
|
487
485
|
NzIconModule,
|
|
488
486
|
NzImageModule$1, CellComponent, CellHostDirective], exports: [CellComponent] });
|
|
489
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
487
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CellModule, imports: [CommonModule,
|
|
490
488
|
FormsModule,
|
|
491
489
|
NzCheckboxModule,
|
|
492
490
|
NzRadioModule,
|
|
@@ -496,7 +494,7 @@ class CellModule {
|
|
|
496
494
|
NzIconModule,
|
|
497
495
|
NzImageModule$1, COMPS] });
|
|
498
496
|
}
|
|
499
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
497
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CellModule, decorators: [{
|
|
500
498
|
type: NgModule,
|
|
501
499
|
args: [{
|
|
502
500
|
imports: [
|
package/fesm2022/cell.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell.mjs","sources":["../../../../packages/abc/cell/cell.service.ts","../../../../packages/abc/cell/cell-host.directive.ts","../../../../packages/abc/cell/cell.component.ts","../../../../packages/abc/cell/cell.module.ts","../../../../packages/abc/cell/provide.ts","../../../../packages/abc/cell/cell.ts"],"sourcesContent":["import { Injectable, Type, inject } from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { map, Observable, of } from 'rxjs';\n\nimport { yn } from '@delon/theme';\nimport { AlainConfigService } from '@delon/util/config';\nimport { formatDate } from '@delon/util/date-time';\nimport { CurrencyService, formatMask } from '@delon/util/format';\nimport { deepMerge } from '@delon/util/other';\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\nimport { NzI18nService } from 'ng-zorro-antd/i18n';\n\nimport type {\n CellFuValue,\n CellOptions,\n CellTextResult,\n CellTextUnit,\n CellType,\n CellWidget,\n CellWidgetFn\n} from './cell.types';\n\n@Injectable({ providedIn: 'root' })\nexport class CellService {\n private readonly nzI18n = inject(NzI18nService);\n private readonly currency = inject(CurrencyService);\n private readonly dom = inject(DomSanitizer);\n private readonly configSrv = inject(AlainConfigService);\n private globalOptions = this.configSrv.merge('cell', {\n date: { format: 'yyyy-MM-dd HH:mm:ss' },\n img: { size: 32 },\n default: { text: '-' }\n })!;\n private widgets: Record<string, CellWidget> = {\n date: {\n type: 'fn',\n ref: (value, opt) => {\n return {\n text: formatDate(value as string, opt.date!.format!, {\n locale: this.nzI18n.getDateLocale(),\n customFormat: this.configSrv.get('themePipe')?.dateFormatCustom\n })\n };\n }\n },\n mega: {\n type: 'fn',\n ref: (value, opt) => {\n const res = this.currency.mega(value as number, opt.mega);\n return { text: res.value, unit: res.unitI18n };\n }\n },\n currency: {\n type: 'fn',\n ref: (value, opt) => {\n return { text: this.currency.format(value as number, opt.currency) };\n }\n },\n cny: {\n type: 'fn',\n ref: (value, opt) => {\n return { text: this.currency.cny(value as number, opt.cny) };\n }\n },\n boolean: {\n type: 'fn',\n ref: (value, opt) => {\n return { text: this.dom.bypassSecurityTrustHtml(yn(value as boolean, opt.boolean)) };\n }\n },\n img: {\n type: 'fn',\n ref: value => {\n return { text: Array.isArray(value) ? value : [value] };\n }\n }\n };\n\n registerWidget(key: string, widget: Type<unknown>): void {\n this.widgets[key] = { type: 'widget', ref: widget };\n }\n\n getWidget(key: string): CellWidget | undefined {\n return this.widgets[key];\n }\n\n private genType(value: unknown, options: CellOptions): CellType {\n if (options.type != null) return options.type;\n\n const typeOf = typeof value;\n // When is timestamp\n if (typeOf === 'number' && /^[0-9]{13}$/g.test(value as string)) return 'date';\n if (value instanceof Date || options.date != null) return 'date';\n\n // Auto detection\n if (options.widget != null) return 'widget';\n else if (options.mega != null) return 'mega';\n else if (options.currency != null) return 'currency';\n else if (options.cny != null) return 'cny';\n else if (options.img != null) return 'img';\n else if (options.link != null) return 'link';\n else if (options.html != null) return 'html';\n else if (options.badge != null) return 'badge';\n else if (options.tag != null) return 'tag';\n else if (options.checkbox != null) return 'checkbox';\n else if (options.radio != null) return 'radio';\n else if (options.enum != null) return 'enum';\n else if (typeOf === 'number') return 'number';\n else if (typeOf === 'boolean' || options.boolean != null) return 'boolean';\n else return 'string';\n }\n\n fixOptions(options?: CellOptions): CellOptions {\n return deepMerge({}, this.globalOptions, options);\n }\n\n get(value: unknown, options?: CellOptions): Observable<CellTextResult> {\n const type = this.genType(value, { ...options });\n const opt = this.fixOptions(options);\n opt.type = type;\n const isSafeHtml =\n typeof value === 'object' &&\n typeof (value as NzSafeAny)?.getTypeName === 'function' &&\n (value as NzSafeAny)?.getTypeName() != null;\n\n let res: CellTextResult = {\n result:\n typeof value === 'object' && !isSafeHtml\n ? (value as CellTextUnit)\n : { text: value == null ? '' : isSafeHtml ? value : `${value}` },\n options: opt\n };\n\n const widget = this.widgets[type];\n if (widget?.type === 'fn') {\n res.result = (widget.ref as CellWidgetFn)(value, opt);\n }\n\n return (typeof value === 'function' ? (value as CellFuValue)(value, opt) : of(res.result)).pipe(\n map(text => {\n res.result = text;\n let dictData: { tooltip?: string } | undefined;\n switch (type) {\n case 'badge':\n dictData = (opt.badge?.data ?? {})[value as string];\n res.result = { color: 'default', ...dictData };\n break;\n case 'tag':\n dictData = (opt.tag?.data ?? {})[value as string];\n res.result = dictData as CellTextUnit;\n break;\n case 'enum':\n res.result = { text: (opt.enum ?? {})[value as string] };\n break;\n case 'html':\n res.safeHtml = opt.html?.safe;\n break;\n case 'string':\n if (isSafeHtml) res.safeHtml = 'safeHtml';\n break;\n }\n if ((type === 'badge' || type === 'tag') && dictData?.tooltip != null) {\n res.options.tooltip = dictData.tooltip;\n }\n if (opt.mask != null) {\n res.result.text = formatMask(res.result.text as string, opt.mask);\n }\n return res;\n })\n );\n }\n}\n","import { Directive, Type, ViewContainerRef, effect, inject, input } from '@angular/core';\n\nimport { warn } from '@delon/util/other';\n\nimport { CellService } from './cell.service';\nimport { CellTextResult } from './cell.types';\n\n@Directive({\n selector: '[cell-widget-host]'\n})\nexport class CellHostDirective {\n private readonly srv = inject(CellService);\n private readonly vcr = inject(ViewContainerRef);\n\n data = input.required<CellTextResult>();\n\n constructor() {\n effect(() => {\n const data = this.data();\n const widget = data.options.widget!;\n const componentType = this.srv.getWidget(widget.key!)?.ref as Type<unknown>;\n if (componentType == null) {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n warn(`cell: No widget for type \"${widget.key}\"`);\n }\n return;\n }\n\n this.vcr.clear();\n const componentRef = this.vcr.createComponent(componentType);\n (componentRef.instance as { data: CellTextResult }).data = data;\n });\n }\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n OnDestroy,\n Renderer2,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n effect,\n inject,\n input,\n model,\n signal\n} from '@angular/core';\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\nimport { FormsModule } from '@angular/forms';\nimport type { SafeValue } from '@angular/platform-browser';\nimport { Router } from '@angular/router';\nimport { combineLatest, Subscription, take } from 'rxjs';\n\nimport { updateHostClass } from '@delon/util/browser';\nimport { WINDOW } from '@delon/util/token';\nimport { NzBadgeComponent } from 'ng-zorro-antd/badge';\nimport { NzCheckboxComponent } from 'ng-zorro-antd/checkbox';\nimport { NzIconDirective } from 'ng-zorro-antd/icon';\nimport { NzImage, NzImageModule, NzImageService } from 'ng-zorro-antd/image';\nimport { NzRadioComponent } from 'ng-zorro-antd/radio';\nimport { NzTagComponent } from 'ng-zorro-antd/tag';\nimport { NzTooltipDirective } from 'ng-zorro-antd/tooltip';\n\nimport { CellHostDirective } from './cell-host.directive';\nimport { CellService } from './cell.service';\nimport type { CellDefaultText, CellOptions, CellTextResult, CellValue } from './cell.types';\n\n@Component({\n selector: 'cell, [cell]',\n template: `\n <ng-template #text>\n @let res = _res();\n @let text = _text();\n @switch (safeOpt.type) {\n @case ('checkbox') {\n <label nz-checkbox [nzDisabled]=\"disabled()\" [ngModel]=\"value()\" (ngModelChange)=\"value.set($event)\">\n {{ safeOpt.checkbox?.label }}\n </label>\n }\n @case ('radio') {\n <label nz-radio [nzDisabled]=\"disabled()\" [ngModel]=\"value()\" (ngModelChange)=\"value.set($event)\">\n {{ safeOpt.radio?.label }}\n </label>\n }\n @case ('link') {\n <a (click)=\"_link($event)\" [attr.target]=\"safeOpt.link?.target\" [attr.title]=\"value()\" [innerHTML]=\"text\"></a>\n }\n @case ('tag') {\n <nz-tag [nzColor]=\"res?.result?.color\">\n <span [innerHTML]=\"text\"></span>\n </nz-tag>\n }\n @case ('badge') {\n <nz-badge [nzStatus]=\"res?.result?.color\" nzText=\"{{ text }}\" />\n }\n @case ('widget') {\n @if (res) {\n <ng-template cell-widget-host [data]=\"res\" />\n }\n }\n @case ('img') {\n @for (i of $any(text); track $index) {\n @let img = safeOpt.img;\n <img\n [attr.src]=\"i\"\n [attr.height]=\"img?.size\"\n [attr.width]=\"img?.size\"\n (click)=\"_showImg(i)\"\n class=\"img\"\n [class.point]=\"img?.big\"\n />\n }\n }\n @default {\n @if (isText()) {\n <span [innerText]=\"text\" [attr.title]=\"value()\"></span>\n } @else {\n <span [innerHTML]=\"text\" [attr.title]=\"value()\"></span>\n }\n @if (_unit()) {\n <span class=\"unit\">{{ _unit() }}</span>\n }\n }\n }\n </ng-template>\n <ng-template #textWrap>\n @if (showDefault()) {\n {{ safeOpt.default?.text }}\n } @else {\n @if (safeOpt.tooltip) {\n <span [nz-tooltip]=\"safeOpt.tooltip\">\n <ng-template [ngTemplateOutlet]=\"text\" />\n </span>\n } @else {\n <ng-template [ngTemplateOutlet]=\"text\" />\n }\n }\n </ng-template>\n @if (loading()) {\n <nz-icon nzType=\"loading\" />\n } @else {\n <ng-template [ngTemplateOutlet]=\"textWrap\" />\n }\n `,\n exportAs: 'cell',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [\n FormsModule,\n NgTemplateOutlet,\n NzCheckboxComponent,\n NzRadioComponent,\n NzIconDirective,\n NzTagComponent,\n NzBadgeComponent,\n NzTooltipDirective,\n NzImageModule,\n CellHostDirective\n ]\n})\nexport class CellComponent implements OnDestroy {\n private readonly srv = inject(CellService);\n private readonly router = inject(Router);\n private readonly renderer = inject(Renderer2);\n private readonly imgSrv = inject(NzImageService);\n private readonly win = inject(WINDOW);\n private readonly el: HTMLElement = inject(ElementRef).nativeElement;\n\n private destroy$?: Subscription;\n\n _text = signal<string | SafeValue | string[] | number>('');\n _unit = signal<string | undefined>(undefined);\n _res = signal<CellTextResult | undefined>(undefined);\n showDefault = computed(() => this.value() == (this.safeOpt.default as CellDefaultText)?.condition);\n\n value = model<CellValue>();\n options = input<CellOptions>();\n loading = input(false, { transform: booleanAttribute });\n disabled = input(false, { transform: booleanAttribute });\n\n get safeOpt(): CellOptions {\n return this._res()?.options ?? {};\n }\n\n isText = computed(() => this._res()?.safeHtml === 'text');\n\n constructor() {\n combineLatest([toObservable(this.loading), toObservable(this.disabled)])\n .pipe(takeUntilDestroyed())\n .subscribe(() => this.setClass());\n\n effect(() => {\n const v = this.value();\n const o = this.options();\n this.destroy$?.unsubscribe();\n this.destroy$ = this.srv\n .get(v, o)\n .pipe(take(1))\n .subscribe(res => {\n this._res.set(res);\n this._text.set(res.result?.text ?? '');\n this._unit.set(res.result?.unit ?? this.safeOpt?.unit);\n this.setClass();\n });\n });\n }\n\n private setClass(): void {\n const { el, renderer } = this;\n const { renderType, size, type } = this.safeOpt;\n updateHostClass(el, renderer, {\n [`cell`]: true,\n [`cell__${renderType}`]: renderType != null,\n [`cell__${size}`]: size != null,\n [`cell__has-unit`]: this._unit(),\n [`cell__has-default`]: this.showDefault(),\n [`cell__disabled`]: this.disabled()\n });\n el.setAttribute('data-type', `${type}`);\n }\n\n _link(e: Event): void {\n e.preventDefault();\n e.stopPropagation();\n\n if (this.disabled()) return;\n\n const link = this.safeOpt.link;\n const url = link?.url;\n if (url == null) return;\n\n if (/https?:\\/\\//g.test(url)) {\n this.win.open(url, link?.target);\n } else {\n this.router.navigateByUrl(url);\n }\n }\n\n _showImg(img: string): void {\n const config = this.safeOpt.img;\n if (config == null || config.big == null) return;\n\n let idx = -1;\n const list = (this._text() as string[]).map((p, index) => {\n if (idx === -1 && p === img) idx = index;\n return typeof config.big === 'function' ? config.big(p) : p;\n });\n this.imgSrv\n .preview(\n list.map(p => ({ src: p }) as NzImage),\n config.previewOptions\n )\n .switchTo(idx);\n }\n\n ngOnDestroy(): void {\n this.destroy$?.unsubscribe();\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { NzBadgeModule } from 'ng-zorro-antd/badge';\nimport { NzCheckboxModule } from 'ng-zorro-antd/checkbox';\nimport { NzImageModule } from 'ng-zorro-antd/experimental/image';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport { NzRadioModule } from 'ng-zorro-antd/radio';\nimport { NzTagModule } from 'ng-zorro-antd/tag';\nimport { NzTooltipModule } from 'ng-zorro-antd/tooltip';\n\nimport { CellHostDirective } from './cell-host.directive';\nimport { CellComponent } from './cell.component';\n\nconst COMPS = [CellComponent];\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n NzCheckboxModule,\n NzRadioModule,\n NzBadgeModule,\n NzTagModule,\n NzTooltipModule,\n NzIconModule,\n NzImageModule,\n ...COMPS,\n CellHostDirective\n ],\n exports: COMPS\n})\nexport class CellModule {}\n","import { EnvironmentProviders, inject, makeEnvironmentProviders, provideEnvironmentInitializer } from '@angular/core';\n\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nimport { CellService } from './cell.service';\n\nexport interface CellWidgetProvideConfig {\n KEY: string;\n type: NzSafeAny;\n}\n\n/**\n * Just only using Standalone widgets\n */\nexport function provideCellWidgets(...widgets: CellWidgetProvideConfig[]): EnvironmentProviders {\n return makeEnvironmentProviders([\n provideEnvironmentInitializer(() => {\n const srv = inject(CellService);\n widgets.forEach(widget => srv.registerWidget(widget.KEY, widget.type));\n })\n ]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["NzImageModule"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;MAuBa,WAAW,CAAA;AACL,IAAA,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC;AAC9B,IAAA,QAAQ,GAAG,MAAM,CAAC,eAAe,CAAC;AAClC,IAAA,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC;AAC1B,IAAA,SAAS,GAAG,MAAM,CAAC,kBAAkB,CAAC;IAC/C,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE;AACnD,QAAA,IAAI,EAAE,EAAE,MAAM,EAAE,qBAAqB,EAAE;AACvC,QAAA,GAAG,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;AACjB,QAAA,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG;AACrB,KAAA,CAAE;AACK,IAAA,OAAO,GAA+B;AAC5C,QAAA,IAAI,EAAE;AACJ,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,GAAG,EAAE,CAAC,KAAK,EAAE,GAAG,KAAI;gBAClB,OAAO;oBACL,IAAI,EAAE,UAAU,CAAC,KAAe,EAAE,GAAG,CAAC,IAAK,CAAC,MAAO,EAAE;AACnD,wBAAA,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AAA,OAAO,EAAE;wBACP,YAAY;wBACZ,WAAW;wBACX,gBAAgB;wBAChB,aAAa;wBACb,aAAa;wBACb,WAAW;wBACX,eAAe;wBACf,YAAY;wBACZA,eAAa;AACb,wBAAA,GAAG,KAAK;wBACR;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;AACV,iBAAA;;;ACrBD;;AAEG;AACG,SAAU,kBAAkB,CAAC,GAAG,OAAkC,EAAA;AACtE,IAAA,OAAO,wBAAwB,CAAC;QAC9B,6BAA6B,CAAC,MAAK;AACjC,YAAA,MAAM,GAAG,GAAG,MAAM,CAAC,WAAW,CAAC;YAC/B,OAAO,CAAC,OAAO,CAAC,MAAM,IAAI,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;AACxE,QAAA,CAAC;AACF,KAAA,CAAC;AACJ;;ACrBA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cell.mjs","sources":["../../../../packages/abc/cell/cell.service.ts","../../../../packages/abc/cell/cell-host.directive.ts","../../../../packages/abc/cell/cell.component.ts","../../../../packages/abc/cell/cell.module.ts","../../../../packages/abc/cell/provide.ts","../../../../packages/abc/cell/cell.ts"],"sourcesContent":["import { Injectable, Type, inject } from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { map, Observable, of } from 'rxjs';\n\nimport { yn } from '@delon/theme';\nimport { AlainConfigService } from '@delon/util/config';\nimport { formatDate } from '@delon/util/date-time';\nimport { CurrencyService, formatMask } from '@delon/util/format';\nimport { deepMerge } from '@delon/util/other';\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\nimport { NzI18nService } from 'ng-zorro-antd/i18n';\n\nimport type {\n CellFuValue,\n CellOptions,\n CellTextResult,\n CellTextUnit,\n CellType,\n CellWidget,\n CellWidgetFn\n} from './cell.types';\n\n@Injectable({ providedIn: 'root' })\nexport class CellService {\n private readonly nzI18n = inject(NzI18nService);\n private readonly currency = inject(CurrencyService);\n private readonly dom = inject(DomSanitizer);\n private readonly configSrv = inject(AlainConfigService);\n private globalOptions = this.configSrv.merge('cell', {\n date: { format: 'yyyy-MM-dd HH:mm:ss' },\n img: { size: 32 },\n default: { text: '-' }\n })!;\n private widgets: Record<string, CellWidget> = {\n date: {\n type: 'fn',\n ref: (value, opt) => {\n return {\n text: formatDate(value as string, opt.date!.format!, {\n locale: this.nzI18n.getDateLocale(),\n customFormat: this.configSrv.get('themePipe')?.dateFormatCustom\n })\n };\n }\n },\n mega: {\n type: 'fn',\n ref: (value, opt) => {\n const res = this.currency.mega(value as number, opt.mega);\n return { text: res.value, unit: res.unitI18n };\n }\n },\n currency: {\n type: 'fn',\n ref: (value, opt) => {\n return { text: this.currency.format(value as number, opt.currency) };\n }\n },\n cny: {\n type: 'fn',\n ref: (value, opt) => {\n return { text: this.currency.cny(value as number, opt.cny) };\n }\n },\n boolean: {\n type: 'fn',\n ref: (value, opt) => {\n return { text: this.dom.bypassSecurityTrustHtml(yn(value as boolean, opt.boolean)) };\n }\n },\n img: {\n type: 'fn',\n ref: value => {\n return { text: Array.isArray(value) ? value : [value] };\n }\n }\n };\n\n registerWidget(key: string, widget: Type<unknown>): void {\n this.widgets[key] = { type: 'widget', ref: widget };\n }\n\n getWidget(key: string): CellWidget | undefined {\n return this.widgets[key];\n }\n\n private genType(value: unknown, options: CellOptions): CellType {\n if (options.type != null) return options.type;\n\n const typeOf = typeof value;\n // When is timestamp\n if (typeOf === 'number' && /^[0-9]{13}$/g.test(value as string)) return 'date';\n if (value instanceof Date || options.date != null) return 'date';\n\n // Auto detection\n if (options.widget != null) return 'widget';\n else if (options.mega != null) return 'mega';\n else if (options.currency != null) return 'currency';\n else if (options.cny != null) return 'cny';\n else if (options.img != null) return 'img';\n else if (options.link != null) return 'link';\n else if (options.html != null) return 'html';\n else if (options.badge != null) return 'badge';\n else if (options.tag != null) return 'tag';\n else if (options.checkbox != null) return 'checkbox';\n else if (options.radio != null) return 'radio';\n else if (options.enum != null) return 'enum';\n else if (typeOf === 'number') return 'number';\n else if (typeOf === 'boolean' || options.boolean != null) return 'boolean';\n else return 'string';\n }\n\n fixOptions(options?: CellOptions): CellOptions {\n return deepMerge({}, this.globalOptions, options);\n }\n\n get(value: unknown, options?: CellOptions): Observable<CellTextResult> {\n const type = this.genType(value, { ...options });\n const opt = this.fixOptions(options);\n opt.type = type;\n const isSafeHtml =\n typeof value === 'object' &&\n typeof (value as NzSafeAny)?.getTypeName === 'function' &&\n (value as NzSafeAny)?.getTypeName() != null;\n\n let res: CellTextResult = {\n result:\n typeof value === 'object' && !isSafeHtml\n ? (value as CellTextUnit)\n : { text: value == null ? '' : isSafeHtml ? value : `${value}` },\n options: opt\n };\n\n const widget = this.widgets[type];\n if (widget?.type === 'fn') {\n res.result = (widget.ref as CellWidgetFn)(value, opt);\n }\n\n return (typeof value === 'function' ? (value as CellFuValue)(value, opt) : of(res.result)).pipe(\n map(text => {\n res.result = text;\n let dictData: { tooltip?: string } | undefined;\n switch (type) {\n case 'badge':\n dictData = (opt.badge?.data ?? {})[value as string];\n res.result = { color: 'default', ...dictData };\n break;\n case 'tag':\n dictData = (opt.tag?.data ?? {})[value as string];\n res.result = dictData as CellTextUnit;\n break;\n case 'enum':\n res.result = { text: (opt.enum ?? {})[value as string] };\n break;\n case 'html':\n res.safeHtml = opt.html?.safe;\n break;\n case 'string':\n if (isSafeHtml) res.safeHtml = 'safeHtml';\n break;\n }\n if ((type === 'badge' || type === 'tag') && dictData?.tooltip != null) {\n res.options.tooltip = dictData.tooltip;\n }\n if (opt.mask != null) {\n res.result.text = formatMask(res.result.text as string, opt.mask);\n }\n return res;\n })\n );\n }\n}\n","import { Directive, Type, ViewContainerRef, effect, inject, input } from '@angular/core';\n\nimport { warn } from '@delon/util/other';\n\nimport { CellService } from './cell.service';\nimport { CellTextResult } from './cell.types';\n\n@Directive({\n selector: '[cell-widget-host]'\n})\nexport class CellHostDirective {\n private readonly srv = inject(CellService);\n private readonly vcr = inject(ViewContainerRef);\n\n readonly data = input.required<CellTextResult>();\n\n constructor() {\n effect(() => {\n const data = this.data();\n const widget = data.options.widget!;\n const componentType = this.srv.getWidget(widget.key!)?.ref as Type<unknown>;\n if (componentType == null) {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n warn(`cell: No widget for type \"${widget.key}\"`);\n }\n return;\n }\n\n this.vcr.clear();\n const componentRef = this.vcr.createComponent(componentType);\n (componentRef.instance as { data: CellTextResult }).data = data;\n });\n }\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n Renderer2,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n effect,\n inject,\n input,\n model,\n signal\n} from '@angular/core';\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\nimport { FormsModule } from '@angular/forms';\nimport type { SafeValue } from '@angular/platform-browser';\nimport { Router } from '@angular/router';\nimport { combineLatest, Subscription, take } from 'rxjs';\n\nimport { updateHostClass } from '@delon/util/browser';\nimport { WINDOW } from '@delon/util/token';\nimport { NzBadgeComponent } from 'ng-zorro-antd/badge';\nimport { NzCheckboxComponent } from 'ng-zorro-antd/checkbox';\nimport { NzIconDirective } from 'ng-zorro-antd/icon';\nimport { NzImage, NzImageModule, NzImageService } from 'ng-zorro-antd/image';\nimport { NzRadioComponent } from 'ng-zorro-antd/radio';\nimport { NzTagComponent } from 'ng-zorro-antd/tag';\nimport { NzTooltipDirective } from 'ng-zorro-antd/tooltip';\n\nimport { CellHostDirective } from './cell-host.directive';\nimport { CellService } from './cell.service';\nimport type { CellDefaultText, CellOptions, CellTextResult, CellValue } from './cell.types';\n\n@Component({\n selector: 'cell, [cell]',\n template: `\n <ng-template #text>\n @let res = _res();\n @let text = _text();\n @switch (safeOpt.type) {\n @case ('checkbox') {\n <label nz-checkbox [nzDisabled]=\"disabled()\" [ngModel]=\"value()\" (ngModelChange)=\"value.set($event)\">\n {{ safeOpt.checkbox?.label }}\n </label>\n }\n @case ('radio') {\n <label nz-radio [nzDisabled]=\"disabled()\" [ngModel]=\"value()\" (ngModelChange)=\"value.set($event)\">\n {{ safeOpt.radio?.label }}\n </label>\n }\n @case ('link') {\n <a (click)=\"_link($event)\" [attr.target]=\"safeOpt.link?.target\" [attr.title]=\"value()\" [innerHTML]=\"text\"></a>\n }\n @case ('tag') {\n <nz-tag [nzColor]=\"res?.result?.color\">\n <span [innerHTML]=\"text\"></span>\n </nz-tag>\n }\n @case ('badge') {\n <nz-badge [nzStatus]=\"res?.result?.color\" nzText=\"{{ text }}\" />\n }\n @case ('widget') {\n @if (res) {\n <ng-template cell-widget-host [data]=\"res\" />\n }\n }\n @case ('img') {\n @for (i of $any(text); track $index) {\n @let img = safeOpt.img;\n <img\n [attr.src]=\"i\"\n [attr.height]=\"img?.size\"\n [attr.width]=\"img?.size\"\n (click)=\"_showImg(i)\"\n class=\"img\"\n [class.point]=\"img?.big\"\n />\n }\n }\n @default {\n @if (isText()) {\n <span [innerText]=\"text\" [attr.title]=\"value()\"></span>\n } @else {\n <span [innerHTML]=\"text\" [attr.title]=\"value()\"></span>\n }\n @if (_unit()) {\n <span class=\"unit\">{{ _unit() }}</span>\n }\n }\n }\n </ng-template>\n <ng-template #textWrap>\n @if (showDefault()) {\n {{ safeOpt.default?.text }}\n } @else {\n @if (safeOpt.tooltip) {\n <span [nz-tooltip]=\"safeOpt.tooltip\">\n <ng-template [ngTemplateOutlet]=\"text\" />\n </span>\n } @else {\n <ng-template [ngTemplateOutlet]=\"text\" />\n }\n }\n </ng-template>\n @if (loading()) {\n <nz-icon nzType=\"loading\" />\n } @else {\n <ng-template [ngTemplateOutlet]=\"textWrap\" />\n }\n `,\n exportAs: 'cell',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [\n FormsModule,\n NgTemplateOutlet,\n NzCheckboxComponent,\n NzRadioComponent,\n NzIconDirective,\n NzTagComponent,\n NzBadgeComponent,\n NzTooltipDirective,\n NzImageModule,\n CellHostDirective\n ]\n})\nexport class CellComponent {\n private readonly srv = inject(CellService);\n private readonly router = inject(Router);\n private readonly renderer = inject(Renderer2);\n private readonly imgSrv = inject(NzImageService);\n private readonly win = inject(WINDOW);\n private readonly el: HTMLElement = inject(ElementRef).nativeElement;\n\n private d$ = inject(DestroyRef);\n\n protected _text = signal<string | SafeValue | string[] | number>('');\n protected _unit = signal<string | undefined>(undefined);\n protected _res = signal<CellTextResult | undefined>(undefined);\n protected showDefault = computed(() => this.value() == (this.safeOpt.default as CellDefaultText)?.condition);\n\n value = model<CellValue>();\n options = input<CellOptions>();\n loading = input(false, { transform: booleanAttribute });\n disabled = input(false, { transform: booleanAttribute });\n\n protected get safeOpt(): CellOptions {\n return this._res()?.options ?? {};\n }\n\n protected isText = computed(() => this._res()?.safeHtml === 'text');\n\n constructor() {\n combineLatest([toObservable(this.loading), toObservable(this.disabled)])\n .pipe(takeUntilDestroyed())\n .subscribe(() => this.setClass());\n\n let sub: Subscription | null = null;\n effect(() => {\n const v = this.value();\n const o = this.options();\n sub?.unsubscribe();\n sub = this.srv\n .get(v, o)\n .pipe(take(1), takeUntilDestroyed(this.d$))\n .subscribe(res => {\n this._res.set(res);\n this._text.set(res.result?.text ?? '');\n this._unit.set(res.result?.unit ?? this.safeOpt?.unit);\n this.setClass();\n });\n });\n }\n\n private setClass(): void {\n const { el, renderer } = this;\n const { renderType, size, type } = this.safeOpt;\n updateHostClass(el, renderer, {\n [`cell`]: true,\n [`cell__${renderType}`]: renderType != null,\n [`cell__${size}`]: size != null,\n [`cell__has-unit`]: this._unit(),\n [`cell__has-default`]: this.showDefault(),\n [`cell__disabled`]: this.disabled()\n });\n el.setAttribute('data-type', `${type}`);\n }\n\n protected _link(e: Event): void {\n e.preventDefault();\n e.stopPropagation();\n\n if (this.disabled()) return;\n\n const link = this.safeOpt.link;\n const url = link?.url;\n if (url == null) return;\n\n if (/https?:\\/\\//g.test(url)) {\n this.win.open(url, link?.target);\n } else {\n this.router.navigateByUrl(url);\n }\n }\n\n protected _showImg(img: string): void {\n const config = this.safeOpt.img;\n if (config == null || config.big == null) return;\n\n let idx = -1;\n const list = (this._text() as string[]).map((p, index) => {\n if (idx === -1 && p === img) idx = index;\n return typeof config.big === 'function' ? config.big(p) : p;\n });\n this.imgSrv\n .preview(\n list.map(p => ({ src: p }) as NzImage),\n config.previewOptions\n )\n .switchTo(idx);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { NzBadgeModule } from 'ng-zorro-antd/badge';\nimport { NzCheckboxModule } from 'ng-zorro-antd/checkbox';\nimport { NzImageModule } from 'ng-zorro-antd/experimental/image';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport { NzRadioModule } from 'ng-zorro-antd/radio';\nimport { NzTagModule } from 'ng-zorro-antd/tag';\nimport { NzTooltipModule } from 'ng-zorro-antd/tooltip';\n\nimport { CellHostDirective } from './cell-host.directive';\nimport { CellComponent } from './cell.component';\n\nconst COMPS = [CellComponent];\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n NzCheckboxModule,\n NzRadioModule,\n NzBadgeModule,\n NzTagModule,\n NzTooltipModule,\n NzIconModule,\n NzImageModule,\n ...COMPS,\n CellHostDirective\n ],\n exports: COMPS\n})\nexport class CellModule {}\n","import { EnvironmentProviders, inject, makeEnvironmentProviders, provideEnvironmentInitializer } from '@angular/core';\n\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nimport { CellService } from './cell.service';\n\nexport interface CellWidgetProvideConfig {\n KEY: string;\n type: NzSafeAny;\n}\n\n/**\n * Just only using Standalone widgets\n */\nexport function provideCellWidgets(...widgets: CellWidgetProvideConfig[]): EnvironmentProviders {\n return makeEnvironmentProviders([\n provideEnvironmentInitializer(() => {\n const srv = inject(CellService);\n widgets.forEach(widget => srv.registerWidget(widget.KEY, widget.type));\n })\n ]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */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,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, inject, ElementRef,
|
|
2
|
+
import { Injectable, inject, ElementRef, DestroyRef, output, afterNextRender, Directive, NgModule } from '@angular/core';
|
|
3
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
3
4
|
import { Observable, Subject } from 'rxjs';
|
|
4
5
|
|
|
5
6
|
class SizeObserver {
|
|
@@ -54,56 +55,42 @@ class SizeObserver {
|
|
|
54
55
|
this._observedElements.delete(element);
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
58
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
58
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SizeObserver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
59
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SizeObserver, providedIn: 'root' });
|
|
59
60
|
}
|
|
60
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
61
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SizeObserver, decorators: [{
|
|
61
62
|
type: Injectable,
|
|
62
63
|
args: [{ providedIn: 'root' }]
|
|
63
64
|
}] });
|
|
64
65
|
class ObserverSize {
|
|
65
66
|
_obs = inject(SizeObserver);
|
|
66
67
|
el = inject(ElementRef).nativeElement;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
_sub() {
|
|
76
|
-
this._unsub();
|
|
77
|
-
const stream = this._obs.observe(this.el);
|
|
78
|
-
this.ngZone.runOutsideAngular(() => {
|
|
79
|
-
this._sub$ = stream.subscribe(this.event);
|
|
68
|
+
d$ = inject(DestroyRef);
|
|
69
|
+
event = output({ alias: 'observeSize' });
|
|
70
|
+
constructor() {
|
|
71
|
+
afterNextRender(() => {
|
|
72
|
+
this._obs
|
|
73
|
+
.observe(this.el)
|
|
74
|
+
.pipe(takeUntilDestroyed(this.d$))
|
|
75
|
+
.subscribe(res => this.event.emit(res));
|
|
80
76
|
});
|
|
81
77
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
ngOnDestroy() {
|
|
86
|
-
this._unsub();
|
|
87
|
-
}
|
|
88
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ObserverSize, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
89
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.0", type: ObserverSize, isStandalone: true, selector: "[observeSize]", outputs: { event: "observeSize" }, exportAs: ["observeSize"], ngImport: i0 });
|
|
78
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ObserverSize, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
79
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: ObserverSize, isStandalone: true, selector: "[observeSize]", outputs: { event: "observeSize" }, exportAs: ["observeSize"], ngImport: i0 });
|
|
90
80
|
}
|
|
91
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
81
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ObserverSize, decorators: [{
|
|
92
82
|
type: Directive,
|
|
93
83
|
args: [{
|
|
94
84
|
selector: '[observeSize]',
|
|
95
85
|
exportAs: 'observeSize'
|
|
96
86
|
}]
|
|
97
|
-
}], propDecorators: { event: [{
|
|
98
|
-
type: Output,
|
|
99
|
-
args: ['observeSize']
|
|
100
|
-
}] } });
|
|
87
|
+
}], ctorParameters: () => [], propDecorators: { event: [{ type: i0.Output, args: ["observeSize"] }] } });
|
|
101
88
|
class ObserversModule {
|
|
102
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
103
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
104
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
89
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ObserversModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
90
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.6", ngImport: i0, type: ObserversModule, imports: [ObserverSize], exports: [ObserverSize] });
|
|
91
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ObserversModule });
|
|
105
92
|
}
|
|
106
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
93
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ObserversModule, decorators: [{
|
|
107
94
|
type: NgModule,
|
|
108
95
|
args: [{
|
|
109
96
|
exports: [ObserverSize],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-observer-size.mjs","sources":["../../../../packages/abc/observers/observer-size.ts","../../../../packages/abc/observers/chart-observer-size.ts"],"sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"file":"chart-observer-size.mjs","sources":["../../../../packages/abc/observers/observer-size.ts","../../../../packages/abc/observers/chart-observer-size.ts"],"sourcesContent":["import {\n DestroyRef,\n Directive,\n ElementRef,\n Injectable,\n NgModule,\n OnDestroy,\n afterNextRender,\n inject,\n output\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { Observable, Observer, Subject } from 'rxjs';\n\n@Injectable({ providedIn: 'root' })\nexport class SizeObserver implements OnDestroy {\n private _observedElements = new Map<\n Element,\n {\n observer: MutationObserver | null;\n readonly stream: Subject<MutationRecord[]>;\n count: number;\n }\n >();\n\n ngOnDestroy(): void {\n this._observedElements.forEach((_, element) => this._cleanupObserver(element));\n }\n\n observe(element: Element): Observable<MutationRecord[]> {\n return new Observable((observer: Observer<MutationRecord[]>) => {\n const stream = this._observeElement(element);\n const subscription = stream.subscribe(observer);\n\n return () => {\n subscription.unsubscribe();\n this._unobserveElement(element);\n };\n });\n }\n\n private _observeElement(element: Element): Subject<MutationRecord[]> {\n if (!this._observedElements.has(element)) {\n const stream = new Subject<MutationRecord[]>();\n let observer: MutationObserver | null = null;\n if (typeof MutationObserver !== 'undefined') {\n observer = new MutationObserver(mutations => stream.next(mutations));\n observer.observe(element, {\n attributes: true,\n attributeOldValue: true,\n attributeFilter: ['width', 'height', 'style']\n });\n }\n this._observedElements.set(element, { observer, stream, count: 1 });\n } else {\n this._observedElements.get(element)!.count++;\n }\n return this._observedElements.get(element)!.stream;\n }\n\n private _unobserveElement(element: Element): void {\n if (this._observedElements.has(element)) {\n this._observedElements.get(element)!.count--;\n if (!this._observedElements.get(element)!.count) {\n this._cleanupObserver(element);\n }\n }\n }\n\n private _cleanupObserver(element: Element): void {\n if (this._observedElements.has(element)) {\n const { observer, stream } = this._observedElements.get(element)!;\n if (observer) {\n observer.disconnect();\n }\n stream.complete();\n this._observedElements.delete(element);\n }\n }\n}\n\n@Directive({\n selector: '[observeSize]',\n exportAs: 'observeSize'\n})\nexport class ObserverSize {\n private readonly _obs = inject(SizeObserver);\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly d$ = inject(DestroyRef);\n\n readonly event = output<MutationRecord[]>({ alias: 'observeSize' });\n\n constructor() {\n afterNextRender(() => {\n this._obs\n .observe(this.el)\n .pipe(takeUntilDestroyed(this.d$))\n .subscribe(res => this.event.emit(res));\n });\n }\n}\n\n@NgModule({\n exports: [ObserverSize],\n imports: [ObserverSize]\n})\nexport class ObserversModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAea,YAAY,CAAA;AACf,IAAA,iBAAiB,GAAG,IAAI,GAAG,EAOhC;IAEH,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAChF;AAEA,IAAA,OAAO,CAAC,OAAgB,EAAA;AACtB,QAAA,OAAO,IAAI,UAAU,CAAC,CAAC,QAAoC,KAAI;YAC7D,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC;YAC5C,MAAM,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;AAE/C,YAAA,OAAO,MAAK;gBACV,YAAY,CAAC,WAAW,EAAE;AAC1B,gBAAA,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;AACjC,YAAA,CAAC;AACH,QAAA,CAAC,CAAC;IACJ;AAEQ,IAAA,eAAe,CAAC,OAAgB,EAAA;QACtC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;AACxC,YAAA,MAAM,MAAM,GAAG,IAAI,OAAO,EAAoB;YAC9C,IAAI,QAAQ,GAA4B,IAAI;AAC5C,YAAA,IAAI,OAAO,gBAAgB,KAAK,WAAW,EAAE;AAC3C,gBAAA,QAAQ,GAAG,IAAI,gBAAgB,CAAC,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACpE,gBAAA,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE;AACxB,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,iBAAiB,EAAE,IAAI;AACv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AAe,CAAA;uGAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;wGAAf,eAAe,EAAA,OAAA,EAAA,CArBf,YAAY,CAAA,EAAA,OAAA,EAAA,CAAZ,YAAY,CAAA,EAAA,CAAA;wGAqBZ,eAAe,EAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,OAAO,EAAE,CAAC,YAAY;AACvB,iBAAA;;;ACzGD;;AAEG;;;;"}
|
package/fesm2022/count-down.mjs
CHANGED
|
@@ -1,37 +1,36 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { input, output, computed, ViewChild, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
3
3
|
import { addSeconds, format } from 'date-fns';
|
|
4
|
-
import { CountdownComponent
|
|
4
|
+
import { CountdownComponent } from 'ngx-countdown';
|
|
5
5
|
import { CommonModule } from '@angular/common';
|
|
6
6
|
|
|
7
7
|
class CountDownComponent {
|
|
8
8
|
instance;
|
|
9
|
-
config;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
config = input(...(ngDevMode ? [undefined, { debugName: "config" }] : []));
|
|
10
|
+
target = input(...(ngDevMode ? [undefined, { debugName: "target" }] : []));
|
|
11
|
+
event = output();
|
|
12
|
+
cfg = computed(() => {
|
|
13
|
+
const value = this.target();
|
|
14
|
+
const config = this.config();
|
|
15
|
+
if (config)
|
|
16
|
+
return config;
|
|
17
|
+
return {
|
|
15
18
|
format: `HH:mm:ss`,
|
|
16
19
|
stopTime: typeof value === 'number' ? addSeconds(new Date(), value).valueOf() : +format(value, 't')
|
|
17
20
|
};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: CountDownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
24
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", type: CountDownComponent, isStandalone: true, selector: "count-down", inputs: { config: "config", target: "target" }, outputs: { event: "event" }, viewQueries: [{ propertyName: "instance", first: true, predicate: ["cd"], descendants: true }], exportAs: ["countDown"], ngImport: i0, template: `@if (config) {
|
|
25
|
-
<countdown #cd [config]="config" (event)="handleEvent($event)" />
|
|
21
|
+
}, ...(ngDevMode ? [{ debugName: "cfg" }] : []));
|
|
22
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CountDownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
23
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: CountDownComponent, isStandalone: true, selector: "count-down", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { event: "event" }, viewQueries: [{ propertyName: "instance", first: true, predicate: ["cd"], descendants: true }], exportAs: ["countDown"], ngImport: i0, template: `@if (cfg()) {
|
|
24
|
+
<countdown #cd [config]="cfg()" (event)="event.emit($event)" />
|
|
26
25
|
}`, isInline: true, dependencies: [{ kind: "component", type: CountdownComponent, selector: "countdown", inputs: ["config", "render"], outputs: ["event"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
27
26
|
}
|
|
28
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CountDownComponent, decorators: [{
|
|
29
28
|
type: Component,
|
|
30
29
|
args: [{
|
|
31
30
|
selector: 'count-down',
|
|
32
31
|
exportAs: 'countDown',
|
|
33
|
-
template: `@if (
|
|
34
|
-
<countdown #cd [config]="
|
|
32
|
+
template: `@if (cfg()) {
|
|
33
|
+
<countdown #cd [config]="cfg()" (event)="event.emit($event)" />
|
|
35
34
|
}`,
|
|
36
35
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
37
36
|
encapsulation: ViewEncapsulation.None,
|
|
@@ -40,24 +39,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
40
39
|
}], propDecorators: { instance: [{
|
|
41
40
|
type: ViewChild,
|
|
42
41
|
args: ['cd', { static: false }]
|
|
43
|
-
}], config: [{
|
|
44
|
-
type: Input
|
|
45
|
-
}], target: [{
|
|
46
|
-
type: Input
|
|
47
|
-
}], event: [{
|
|
48
|
-
type: Output
|
|
49
|
-
}] } });
|
|
42
|
+
}], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], target: [{ type: i0.Input, args: [{ isSignal: true, alias: "target", required: false }] }], event: [{ type: i0.Output, args: ["event"] }] } });
|
|
50
43
|
|
|
51
44
|
const COMPONENTS = [CountDownComponent];
|
|
52
45
|
class CountDownModule {
|
|
53
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
54
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
55
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
46
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CountDownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
47
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.6", ngImport: i0, type: CountDownModule, imports: [CommonModule, CountdownComponent, CountDownComponent], exports: [CountDownComponent] });
|
|
48
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CountDownModule, imports: [CommonModule, CountdownComponent, COMPONENTS] });
|
|
56
49
|
}
|
|
57
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
50
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CountDownModule, decorators: [{
|
|
58
51
|
type: NgModule,
|
|
59
52
|
args: [{
|
|
60
|
-
imports: [CommonModule,
|
|
53
|
+
imports: [CommonModule, CountdownComponent, ...COMPONENTS],
|
|
61
54
|
exports: COMPONENTS
|
|
62
55
|
}]
|
|
63
56
|
}] });
|