@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/se.mjs
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject,
|
|
3
|
-
import { BehaviorSubject, filter } from 'rxjs';
|
|
4
|
-
import { AlainConfigService } from '@delon/util/config';
|
|
2
|
+
import { inject, computed, ViewEncapsulation, ChangeDetectionStrategy, Component, input, numberAttribute, booleanAttribute, DestroyRef, Injector, contentChild, viewChild, signal, linkedSignal, TemplateRef, effect, runInInjectionContext, afterNextRender, NgModule } from '@angular/core';
|
|
5
3
|
import { NzStringTemplateOutletDirective, NzOutletModule } from 'ng-zorro-antd/core/outlet';
|
|
6
4
|
import { CdkObserveContent } from '@angular/cdk/observers';
|
|
7
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
8
|
-
import {
|
|
5
|
+
import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
|
+
import { NgModel, FormControlName, Validators, RequiredValidator } from '@angular/forms';
|
|
7
|
+
import { map, filter } from 'rxjs';
|
|
9
8
|
import { ResponsiveService } from '@delon/theme';
|
|
10
9
|
import { isEmpty } from '@delon/util/browser';
|
|
11
|
-
import {
|
|
10
|
+
import { withAnimationCheck } from 'ng-zorro-antd/core/animation';
|
|
12
11
|
import { NzFormStatusService } from 'ng-zorro-antd/core/form';
|
|
13
12
|
import { NzIconDirective, NzIconModule } from 'ng-zorro-antd/icon';
|
|
14
13
|
import { NzTooltipDirective, NzTooltipModule } from 'ng-zorro-antd/tooltip';
|
|
@@ -16,386 +15,367 @@ import { CommonModule } from '@angular/common';
|
|
|
16
15
|
|
|
17
16
|
class SETitleComponent {
|
|
18
17
|
parentComp = inject(SEContainerComponent, { host: true, optional: true });
|
|
19
|
-
el = inject(ElementRef).nativeElement;
|
|
20
|
-
ren = inject(Renderer2);
|
|
21
18
|
constructor() {
|
|
22
19
|
if (this.parentComp == null) {
|
|
23
20
|
throw new Error(`[se-title] must include 'se-container' component`);
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
this.ren.setStyle(el, 'padding-left', `${gutter / 2}px`);
|
|
30
|
-
this.ren.setStyle(el, 'padding-right', `${gutter / 2}px`);
|
|
31
|
-
}
|
|
32
|
-
ngOnInit() {
|
|
33
|
-
this.setClass();
|
|
34
|
-
}
|
|
35
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: SETitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
36
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.0", type: SETitleComponent, isStandalone: true, selector: "se-title, [se-title]", host: { properties: { "class.se__title": "true" } }, exportAs: ["seTitle"], ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
23
|
+
paddingValue = computed(() => this.parentComp._gutter() / 2, ...(ngDevMode ? [{ debugName: "paddingValue" }] : []));
|
|
24
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SETitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
25
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: SETitleComponent, isStandalone: true, selector: "se-title, [se-title]", host: { properties: { "style.padding-left.px": "paddingValue()", "style.padding-right.px": "paddingValue()" }, classAttribute: "se__title" }, exportAs: ["seTitle"], ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
37
26
|
}
|
|
38
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SETitleComponent, decorators: [{
|
|
39
28
|
type: Component,
|
|
40
29
|
args: [{
|
|
41
30
|
selector: 'se-title, [se-title]',
|
|
42
31
|
exportAs: 'seTitle',
|
|
43
32
|
template: '<ng-content />',
|
|
44
33
|
host: {
|
|
45
|
-
|
|
34
|
+
class: 'se__title',
|
|
35
|
+
'[style.padding-left.px]': 'paddingValue()',
|
|
36
|
+
'[style.padding-right.px]': 'paddingValue()'
|
|
46
37
|
},
|
|
47
38
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
48
39
|
encapsulation: ViewEncapsulation.None
|
|
49
40
|
}]
|
|
50
41
|
}], ctorParameters: () => [] });
|
|
51
42
|
class SEContainerComponent {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
col;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
_gutter;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
this.size = 'compact';
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
_nzLayout;
|
|
76
|
-
size;
|
|
77
|
-
firstVisual;
|
|
78
|
-
ingoreDirty;
|
|
79
|
-
line = false;
|
|
80
|
-
set errors(val) {
|
|
81
|
-
this.setErrors(val);
|
|
82
|
-
}
|
|
83
|
-
get margin() {
|
|
84
|
-
return -(this.gutter / 2);
|
|
85
|
-
}
|
|
86
|
-
get errorNotify() {
|
|
87
|
-
return this.errorNotify$.pipe(filter(v => v != null));
|
|
88
|
-
}
|
|
89
|
-
constructor() {
|
|
90
|
-
this.cogSrv.attach(this, 'se', {
|
|
91
|
-
size: 'default',
|
|
92
|
-
nzLayout: 'horizontal',
|
|
93
|
-
gutter: 32,
|
|
94
|
-
col: 2,
|
|
95
|
-
labelWidth: 150,
|
|
96
|
-
firstVisual: false,
|
|
97
|
-
ingoreDirty: false
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
setErrors(errors) {
|
|
101
|
-
for (const error of errors) {
|
|
102
|
-
this.errorNotify$.next(error);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: SEContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
106
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", type: SEContainerComponent, isStandalone: true, selector: "se-container, [se-container]", inputs: { colInCon: ["se-container", "colInCon", (v) => (v == null ? null : numberAttribute(v))], col: ["col", "col", (v) => (v == null ? null : numberAttribute(v))], labelWidth: ["labelWidth", "labelWidth", (v) => (v == null ? null : numberAttribute(v))], noColon: ["noColon", "noColon", booleanAttribute], title: "title", gutter: ["gutter", "gutter", numberAttribute], nzLayout: "nzLayout", size: "size", firstVisual: ["firstVisual", "firstVisual", booleanAttribute], ingoreDirty: ["ingoreDirty", "ingoreDirty", booleanAttribute], line: ["line", "line", booleanAttribute], errors: "errors" }, host: { properties: { "class.ant-row": "true", "class.se__container": "true", "class.se__horizontal": "nzLayout === 'horizontal'", "class.se__vertical": "nzLayout === 'vertical'", "class.se__inline": "nzLayout === 'inline'", "class.se__compact": "size === 'compact'", "style.margin-left.px": "margin", "style.margin-right.px": "margin" } }, exportAs: ["seContainer"], ngImport: i0, template: `
|
|
107
|
-
@if (title) {
|
|
43
|
+
colInCon = input(null, { ...(ngDevMode ? { debugName: "colInCon" } : {}), transform: (v) => (v == null ? null : numberAttribute(v)),
|
|
44
|
+
alias: 'se-container' });
|
|
45
|
+
labelWidth = input(150, { ...(ngDevMode ? { debugName: "labelWidth" } : {}), transform: (v) => (v == null ? null : numberAttribute(v)) });
|
|
46
|
+
col = input(2, { ...(ngDevMode ? { debugName: "col" } : {}), transform: (v) => (v == null ? null : numberAttribute(v)) });
|
|
47
|
+
noColon = input(false, { ...(ngDevMode ? { debugName: "noColon" } : {}), transform: booleanAttribute });
|
|
48
|
+
title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : []));
|
|
49
|
+
gutter = input(32, { ...(ngDevMode ? { debugName: "gutter" } : {}), transform: numberAttribute });
|
|
50
|
+
nzLayout = input('horizontal', ...(ngDevMode ? [{ debugName: "nzLayout" }] : []));
|
|
51
|
+
size = input('default', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
52
|
+
firstVisual = input(false, { ...(ngDevMode ? { debugName: "firstVisual" } : {}), transform: booleanAttribute });
|
|
53
|
+
ingoreDirty = input(false, { ...(ngDevMode ? { debugName: "ingoreDirty" } : {}), transform: booleanAttribute });
|
|
54
|
+
line = input(false, { ...(ngDevMode ? { debugName: "line" } : {}), transform: booleanAttribute });
|
|
55
|
+
errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : []));
|
|
56
|
+
_gutter = computed(() => (this.nzLayout() === 'horizontal' ? this.gutter() : 0), ...(ngDevMode ? [{ debugName: "_gutter" }] : []));
|
|
57
|
+
_size = computed(() => (this.nzLayout() === 'inline' ? 'compact' : this.size()), ...(ngDevMode ? [{ debugName: "_size" }] : []));
|
|
58
|
+
margin = computed(() => -(this._gutter() / 2), ...(ngDevMode ? [{ debugName: "margin" }] : []));
|
|
59
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SEContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
60
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: SEContainerComponent, isStandalone: true, selector: "se-container, [se-container]", inputs: { colInCon: { classPropertyName: "colInCon", publicName: "se-container", isSignal: true, isRequired: false, transformFunction: null }, labelWidth: { classPropertyName: "labelWidth", publicName: "labelWidth", isSignal: true, isRequired: false, transformFunction: null }, col: { classPropertyName: "col", publicName: "col", isSignal: true, isRequired: false, transformFunction: null }, noColon: { classPropertyName: "noColon", publicName: "noColon", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, gutter: { classPropertyName: "gutter", publicName: "gutter", isSignal: true, isRequired: false, transformFunction: null }, nzLayout: { classPropertyName: "nzLayout", publicName: "nzLayout", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, firstVisual: { classPropertyName: "firstVisual", publicName: "firstVisual", isSignal: true, isRequired: false, transformFunction: null }, ingoreDirty: { classPropertyName: "ingoreDirty", publicName: "ingoreDirty", isSignal: true, isRequired: false, transformFunction: null }, line: { classPropertyName: "line", publicName: "line", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.se__horizontal": "nzLayout() === 'horizontal'", "class.se__vertical": "nzLayout() === 'vertical'", "class.se__inline": "nzLayout() === 'inline'", "class.se__compact": "_size() === 'compact'", "style.margin-left.px": "margin()", "style.margin-right.px": "margin()" }, classAttribute: "ant-row se__container" }, exportAs: ["seContainer"], ngImport: i0, template: `
|
|
61
|
+
@let tit = title();
|
|
62
|
+
@if (tit) {
|
|
108
63
|
<div se-title>
|
|
109
|
-
<ng-container *nzStringTemplateOutlet="
|
|
64
|
+
<ng-container *nzStringTemplateOutlet="tit">{{ tit }}</ng-container>
|
|
110
65
|
</div>
|
|
111
66
|
}
|
|
112
67
|
<ng-content />
|
|
113
68
|
`, isInline: true, dependencies: [{ kind: "component", type: SETitleComponent, selector: "se-title, [se-title]", exportAs: ["seTitle"] }, { kind: "directive", type: NzStringTemplateOutletDirective, selector: "[nzStringTemplateOutlet]", inputs: ["nzStringTemplateOutletContext", "nzStringTemplateOutlet"], exportAs: ["nzStringTemplateOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
114
69
|
}
|
|
115
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
70
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SEContainerComponent, decorators: [{
|
|
116
71
|
type: Component,
|
|
117
72
|
args: [{
|
|
118
73
|
selector: 'se-container, [se-container]',
|
|
119
74
|
exportAs: 'seContainer',
|
|
120
75
|
template: `
|
|
121
|
-
@
|
|
76
|
+
@let tit = title();
|
|
77
|
+
@if (tit) {
|
|
122
78
|
<div se-title>
|
|
123
|
-
<ng-container *nzStringTemplateOutlet="
|
|
79
|
+
<ng-container *nzStringTemplateOutlet="tit">{{ tit }}</ng-container>
|
|
124
80
|
</div>
|
|
125
81
|
}
|
|
126
82
|
<ng-content />
|
|
127
83
|
`,
|
|
128
84
|
host: {
|
|
129
|
-
'
|
|
130
|
-
'[class.
|
|
131
|
-
'[class.
|
|
132
|
-
'[class.
|
|
133
|
-
'[class.
|
|
134
|
-
'[
|
|
135
|
-
'[style.margin-
|
|
136
|
-
'[style.margin-right.px]': `margin`
|
|
85
|
+
class: 'ant-row se__container',
|
|
86
|
+
'[class.se__horizontal]': `nzLayout() === 'horizontal'`,
|
|
87
|
+
'[class.se__vertical]': `nzLayout() === 'vertical'`,
|
|
88
|
+
'[class.se__inline]': `nzLayout() === 'inline'`,
|
|
89
|
+
'[class.se__compact]': `_size() === 'compact'`,
|
|
90
|
+
'[style.margin-left.px]': `margin()`,
|
|
91
|
+
'[style.margin-right.px]': `margin()`
|
|
137
92
|
},
|
|
138
93
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
139
94
|
encapsulation: ViewEncapsulation.None,
|
|
140
95
|
imports: [SETitleComponent, NzStringTemplateOutletDirective]
|
|
141
96
|
}]
|
|
142
|
-
}],
|
|
143
|
-
type: Input,
|
|
144
|
-
args: [{ alias: 'se-container', transform: (v) => (v == null ? null : numberAttribute(v)) }]
|
|
145
|
-
}], col: [{
|
|
146
|
-
type: Input,
|
|
147
|
-
args: [{ transform: (v) => (v == null ? null : numberAttribute(v)) }]
|
|
148
|
-
}], labelWidth: [{
|
|
149
|
-
type: Input,
|
|
150
|
-
args: [{ transform: (v) => (v == null ? null : numberAttribute(v)) }]
|
|
151
|
-
}], noColon: [{
|
|
152
|
-
type: Input,
|
|
153
|
-
args: [{ transform: booleanAttribute }]
|
|
154
|
-
}], title: [{
|
|
155
|
-
type: Input
|
|
156
|
-
}], gutter: [{
|
|
157
|
-
type: Input,
|
|
158
|
-
args: [{ transform: numberAttribute }]
|
|
159
|
-
}], nzLayout: [{
|
|
160
|
-
type: Input
|
|
161
|
-
}], size: [{
|
|
162
|
-
type: Input
|
|
163
|
-
}], firstVisual: [{
|
|
164
|
-
type: Input,
|
|
165
|
-
args: [{ transform: booleanAttribute }]
|
|
166
|
-
}], ingoreDirty: [{
|
|
167
|
-
type: Input,
|
|
168
|
-
args: [{ transform: booleanAttribute }]
|
|
169
|
-
}], line: [{
|
|
170
|
-
type: Input,
|
|
171
|
-
args: [{ transform: booleanAttribute }]
|
|
172
|
-
}], errors: [{
|
|
173
|
-
type: Input
|
|
174
|
-
}] } });
|
|
97
|
+
}], propDecorators: { colInCon: [{ type: i0.Input, args: [{ isSignal: true, alias: "se-container", required: false }] }], labelWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelWidth", required: false }] }], col: [{ type: i0.Input, args: [{ isSignal: true, alias: "col", required: false }] }], noColon: [{ type: i0.Input, args: [{ isSignal: true, alias: "noColon", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], gutter: [{ type: i0.Input, args: [{ isSignal: true, alias: "gutter", required: false }] }], nzLayout: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzLayout", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], firstVisual: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstVisual", required: false }] }], ingoreDirty: [{ type: i0.Input, args: [{ isSignal: true, alias: "ingoreDirty", required: false }] }], line: [{ type: i0.Input, args: [{ isSignal: true, alias: "line", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }] } });
|
|
175
98
|
|
|
176
99
|
const prefixCls = `se`;
|
|
177
100
|
let nextUniqueId = 0;
|
|
178
101
|
class SEComponent {
|
|
179
102
|
parentComp = inject(SEContainerComponent, { host: true, optional: true });
|
|
180
|
-
el = inject(ElementRef).nativeElement;
|
|
181
103
|
rep = inject(ResponsiveService);
|
|
182
|
-
ren = inject(Renderer2);
|
|
183
|
-
cdr = inject(ChangeDetectorRef);
|
|
184
104
|
statusSrv = inject(NzFormStatusService);
|
|
185
105
|
destroy$ = inject(DestroyRef);
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
106
|
+
injector = inject(Injector);
|
|
107
|
+
ngModel = contentChild(NgModel, ...(ngDevMode ? [{ debugName: "ngModel" }] : []));
|
|
108
|
+
formControlName = contentChild(FormControlName, ...(ngDevMode ? [{ debugName: "formControlName" }] : []));
|
|
109
|
+
ngControl = computed(() => this.ngModel() ?? this.formControlName(), ...(ngDevMode ? [{ debugName: "ngControl" }] : []));
|
|
110
|
+
contentElement = viewChild.required('contentElement');
|
|
191
111
|
onceFlag = false;
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
invalid = false;
|
|
195
|
-
_labelWidth = null;
|
|
196
|
-
_noColon = null;
|
|
197
|
-
_error;
|
|
112
|
+
bindModel$;
|
|
113
|
+
empty = signal(false, ...(ngDevMode ? [{ debugName: "empty" }] : []));
|
|
198
114
|
// #region fields
|
|
199
|
-
optional =
|
|
200
|
-
optionalHelp =
|
|
201
|
-
optionalHelpColor;
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
hideLabel = false;
|
|
214
|
-
set id(value) {
|
|
215
|
-
this._id = value;
|
|
216
|
-
this._autoId = false;
|
|
217
|
-
}
|
|
218
|
-
_id = `_se-${++nextUniqueId}`;
|
|
219
|
-
_autoId = true;
|
|
115
|
+
optional = input(...(ngDevMode ? [undefined, { debugName: "optional" }] : []));
|
|
116
|
+
optionalHelp = input(...(ngDevMode ? [undefined, { debugName: "optionalHelp" }] : []));
|
|
117
|
+
optionalHelpColor = input(...(ngDevMode ? [undefined, { debugName: "optionalHelpColor" }] : []));
|
|
118
|
+
error = input(...(ngDevMode ? [undefined, { debugName: "error" }] : []));
|
|
119
|
+
extra = input(...(ngDevMode ? [undefined, { debugName: "extra" }] : []));
|
|
120
|
+
label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
|
|
121
|
+
col = input(null, { ...(ngDevMode ? { debugName: "col" } : {}), transform: (v) => (v == null ? null : numberAttribute(v)) });
|
|
122
|
+
required = input(false, { ...(ngDevMode ? { debugName: "required" } : {}), transform: booleanAttribute });
|
|
123
|
+
controlClass = input(...(ngDevMode ? [undefined, { debugName: "controlClass" }] : []));
|
|
124
|
+
line = input(null, { ...(ngDevMode ? { debugName: "line" } : {}), transform: (v) => (v == null ? null : booleanAttribute(v)) });
|
|
125
|
+
labelWidth = input(null, { ...(ngDevMode ? { debugName: "labelWidth" } : {}), transform: (v) => (v == null ? null : numberAttribute(v)) });
|
|
126
|
+
noColon = input(null, { ...(ngDevMode ? { debugName: "noColon" } : {}), transform: (v) => (v == null ? null : booleanAttribute(v)) });
|
|
127
|
+
hideLabel = input(false, { ...(ngDevMode ? { debugName: "hideLabel" } : {}), transform: booleanAttribute });
|
|
128
|
+
id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
|
|
220
129
|
// #endregion
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}
|
|
130
|
+
invalid = signal(false, ...(ngDevMode ? [{ debugName: "invalid" }] : []));
|
|
131
|
+
showErr = computed(() => this.invalid() && !!this.errorText() && !this.compact(), ...(ngDevMode ? [{ debugName: "showErr" }] : []));
|
|
132
|
+
errorType = linkedSignal(() => this.error(), ...(ngDevMode ? [{ debugName: "errorType" }] : []));
|
|
133
|
+
errorData = computed(() => {
|
|
134
|
+
const err = this.errorType();
|
|
135
|
+
return typeof err === 'string' || err instanceof TemplateRef ? { '': err } : err;
|
|
136
|
+
}, ...(ngDevMode ? [{ debugName: "errorData" }] : []));
|
|
137
|
+
errorText = signal(null, ...(ngDevMode ? [{ debugName: "errorText" }] : []));
|
|
138
|
+
_required = linkedSignal(() => this.required() === true, ...(ngDevMode ? [{ debugName: "_required" }] : []));
|
|
139
|
+
paddingValue = computed(() => this.parentComp._gutter() / 2, ...(ngDevMode ? [{ debugName: "paddingValue" }] : []));
|
|
140
|
+
compact = computed(() => this.parentComp._size() === 'compact', ...(ngDevMode ? [{ debugName: "compact" }] : []));
|
|
141
|
+
_id = linkedSignal(() => this.id(), ...(ngDevMode ? [{ debugName: "_id" }] : []));
|
|
142
|
+
_noColon = computed(() => {
|
|
143
|
+
const noColon = this.noColon();
|
|
144
|
+
return noColon != null ? noColon : this.parentComp.noColon();
|
|
145
|
+
}, ...(ngDevMode ? [{ debugName: "_noColon" }] : []));
|
|
146
|
+
_labelWidth = computed(() => {
|
|
147
|
+
const parent = this.parentComp;
|
|
148
|
+
const labelWidth = this.labelWidth();
|
|
149
|
+
return parent.nzLayout() === 'horizontal' ? (labelWidth != null ? labelWidth : parent.labelWidth()) : null;
|
|
150
|
+
}, ...(ngDevMode ? [{ debugName: "_labelWidth" }] : []));
|
|
151
|
+
cls = computed(() => {
|
|
152
|
+
const parent = this.parentComp;
|
|
153
|
+
const parentCol = parent.colInCon() ?? parent.col();
|
|
154
|
+
const col = this.col();
|
|
155
|
+
const repCls = parent.nzLayout() === 'horizontal' ? this.rep.genCls(col != null ? col : parentCol, parentCol) : [];
|
|
156
|
+
const ret = [];
|
|
157
|
+
ret.push(`ant-form-item`, ...repCls, `${prefixCls}__item`);
|
|
158
|
+
if (this.line() || parent.line()) {
|
|
159
|
+
ret.push(`${prefixCls}__line`);
|
|
160
|
+
}
|
|
161
|
+
return ret;
|
|
162
|
+
}, ...(ngDevMode ? [{ debugName: "cls" }] : []));
|
|
163
|
+
nzValidateAnimationEnter = withAnimationCheck(() => 'ant-form-validate_animation-enter');
|
|
164
|
+
nzValidateAnimationLeave = withAnimationCheck(() => 'ant-form-validate_animation-leave');
|
|
233
165
|
constructor() {
|
|
234
166
|
if (this.parentComp == null) {
|
|
235
167
|
throw new Error(`[se] must include 'se-container' component`);
|
|
236
168
|
}
|
|
237
|
-
this.parentComp.
|
|
238
|
-
.pipe(takeUntilDestroyed(),
|
|
169
|
+
toObservable(this.parentComp.errors)
|
|
170
|
+
.pipe(takeUntilDestroyed(), map(ls => ls.find(w => this.ngControl()?.name === w.name)), filter(w => w != null))
|
|
239
171
|
.subscribe(item => {
|
|
240
|
-
this.
|
|
241
|
-
this.updateStatus(
|
|
172
|
+
this.errorType.set(item.error);
|
|
173
|
+
this.updateStatus();
|
|
242
174
|
});
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
return this;
|
|
260
|
-
}
|
|
261
|
-
bindModel() {
|
|
262
|
-
if (!this.ngControl || this.isBindModel)
|
|
263
|
-
return;
|
|
264
|
-
this.isBindModel = true;
|
|
265
|
-
this.ngControl
|
|
266
|
-
.statusChanges.pipe(takeUntilDestroyed(this.destroy$))
|
|
267
|
-
.subscribe(res => this.updateStatus(res === 'INVALID'));
|
|
268
|
-
if (this._autoId) {
|
|
269
|
-
const controlAccessor = this.ngControl.valueAccessor;
|
|
270
|
-
const control = (controlAccessor?.elementRef || controlAccessor?._elementRef)?.nativeElement;
|
|
271
|
-
if (control) {
|
|
272
|
-
if (control.id) {
|
|
273
|
-
this._id = control.id;
|
|
175
|
+
effect(() => this.checkContent());
|
|
176
|
+
effect(() => {
|
|
177
|
+
const control = this.ngControl();
|
|
178
|
+
if (!control)
|
|
179
|
+
return;
|
|
180
|
+
this.bindModel$?.unsubscribe();
|
|
181
|
+
this.bindModel$ = control
|
|
182
|
+
.statusChanges.pipe(takeUntilDestroyed(this.destroy$))
|
|
183
|
+
.subscribe(res => this.updateStatus(res === 'INVALID'));
|
|
184
|
+
// set unique id
|
|
185
|
+
let id = this.id() ?? `_se-${++nextUniqueId}`;
|
|
186
|
+
const controlAccessor = this.ngControl()?.valueAccessor;
|
|
187
|
+
const controlEl = (controlAccessor?.elementRef ?? controlAccessor?._elementRef)?.nativeElement;
|
|
188
|
+
if (controlEl) {
|
|
189
|
+
if (controlEl.id) {
|
|
190
|
+
this._id.set(controlEl.id);
|
|
274
191
|
}
|
|
275
192
|
else {
|
|
276
|
-
|
|
193
|
+
controlEl.id = id;
|
|
277
194
|
}
|
|
278
195
|
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
196
|
+
// auto required
|
|
197
|
+
if (this.required() !== true) {
|
|
198
|
+
let required = control?.control?.hasValidator(Validators.required);
|
|
199
|
+
if (required !== true) {
|
|
200
|
+
const rawValidators = control?._rawValidators;
|
|
201
|
+
required = rawValidators.find(w => w instanceof RequiredValidator) != null;
|
|
202
|
+
}
|
|
203
|
+
this._required.set(required);
|
|
286
204
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
205
|
+
});
|
|
206
|
+
effect(() => {
|
|
207
|
+
this.onceFlag = this.parentComp.firstVisual();
|
|
208
|
+
if (!this.onceFlag)
|
|
209
|
+
return;
|
|
210
|
+
runInInjectionContext(this.injector, () => {
|
|
211
|
+
afterNextRender(() => {
|
|
212
|
+
this.updateStatus();
|
|
213
|
+
this.onceFlag = false;
|
|
214
|
+
});
|
|
215
|
+
});
|
|
216
|
+
});
|
|
290
217
|
}
|
|
291
218
|
updateStatus(invalid) {
|
|
292
|
-
|
|
219
|
+
const control = this.ngControl();
|
|
220
|
+
if (!control || control.disabled || control.isDisabled)
|
|
293
221
|
return;
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
const errors =
|
|
222
|
+
if (invalid == null)
|
|
223
|
+
invalid = control.invalid;
|
|
224
|
+
this.invalid.set(!this.onceFlag && invalid && this.parentComp.ingoreDirty() === false && !control?.dirty ? false : invalid);
|
|
225
|
+
const errors = control?.errors;
|
|
298
226
|
if (errors != null && Object.keys(errors).length > 0) {
|
|
299
|
-
const key = Object.keys(errors)[0]
|
|
300
|
-
const err = this.errorData[key];
|
|
301
|
-
this.
|
|
227
|
+
const key = Object.keys(errors)[0] ?? '';
|
|
228
|
+
const err = this.errorData()?.[key];
|
|
229
|
+
this.errorText.set(err != null ? err : (this.errorData()?.[''] ?? ''));
|
|
302
230
|
}
|
|
303
|
-
this.statusSrv.formStatusChanges.next({ status: this.invalid ? 'error' : '', hasFeedback: false });
|
|
304
|
-
this.cdr.detectChanges();
|
|
231
|
+
this.statusSrv.formStatusChanges.next({ status: this.invalid() ? 'error' : '', hasFeedback: false });
|
|
305
232
|
}
|
|
306
233
|
checkContent() {
|
|
307
|
-
const el = this.contentElement.nativeElement;
|
|
308
|
-
|
|
309
|
-
if (isEmpty(el)) {
|
|
310
|
-
this.ren.addClass(el, cls);
|
|
311
|
-
}
|
|
312
|
-
else {
|
|
313
|
-
this.ren.removeClass(el, cls);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
ngAfterContentInit() {
|
|
317
|
-
this.checkContent();
|
|
318
|
-
}
|
|
319
|
-
ngOnChanges() {
|
|
320
|
-
this.onceFlag = this.parentComp.firstVisual;
|
|
321
|
-
if (this.inited) {
|
|
322
|
-
this.setClass().bindModel();
|
|
323
|
-
}
|
|
234
|
+
const el = this.contentElement().nativeElement;
|
|
235
|
+
this.empty.set(isEmpty(el));
|
|
324
236
|
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
237
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SEComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
238
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: SEComponent, isStandalone: true, selector: "se", inputs: { optional: { classPropertyName: "optional", publicName: "optional", isSignal: true, isRequired: false, transformFunction: null }, optionalHelp: { classPropertyName: "optionalHelp", publicName: "optionalHelp", isSignal: true, isRequired: false, transformFunction: null }, optionalHelpColor: { classPropertyName: "optionalHelpColor", publicName: "optionalHelpColor", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, extra: { classPropertyName: "extra", publicName: "extra", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, col: { classPropertyName: "col", publicName: "col", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, controlClass: { classPropertyName: "controlClass", publicName: "controlClass", isSignal: true, isRequired: false, transformFunction: null }, line: { classPropertyName: "line", publicName: "line", isSignal: true, isRequired: false, transformFunction: null }, labelWidth: { classPropertyName: "labelWidth", publicName: "labelWidth", isSignal: true, isRequired: false, transformFunction: null }, noColon: { classPropertyName: "noColon", publicName: "noColon", isSignal: true, isRequired: false, transformFunction: null }, hideLabel: { classPropertyName: "hideLabel", publicName: "hideLabel", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.padding-left.px": "paddingValue()", "style.padding-right.px": "paddingValue()", "class.se__hide-label": "hideLabel()", "class.ant-form-item-has-error": "invalid()", "class.ant-form-item-with-help": "showErr()", "class.se__item-empty": "empty()", "class": "cls()" } }, providers: [NzFormStatusService], queries: [{ propertyName: "ngModel", first: true, predicate: NgModel, descendants: true, isSignal: true }, { propertyName: "formControlName", first: true, predicate: FormControlName, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "contentElement", first: true, predicate: ["contentElement"], descendants: true, isSignal: true }], exportAs: ["se"], ngImport: i0, template: `
|
|
239
|
+
@let _label = label();
|
|
240
|
+
<div class="ant-form-item-label" [class.se__nolabel]="hideLabel() || !_label" [style.width.px]="_labelWidth()">
|
|
241
|
+
@if (_label) {
|
|
242
|
+
<label
|
|
243
|
+
[attr.for]="_id()"
|
|
244
|
+
class="se__label"
|
|
245
|
+
[class.ant-form-item-required]="_required()"
|
|
246
|
+
[class.se__no-colon]="_noColon()"
|
|
247
|
+
>
|
|
248
|
+
<span class="se__label-text">
|
|
249
|
+
<ng-container *nzStringTemplateOutlet="_label">{{ _label }}</ng-container>
|
|
250
|
+
</span>
|
|
251
|
+
@let _optional = optional();
|
|
252
|
+
@let _optionalHelp = optionalHelp();
|
|
253
|
+
@if (_optional || _optionalHelp) {
|
|
254
|
+
<span class="se__label-optional" [class.se__label-optional-no-text]="!_optional">
|
|
255
|
+
<ng-container *nzStringTemplateOutlet="_optional">{{ _optional }}</ng-container>
|
|
256
|
+
@if (_optionalHelp) {
|
|
257
|
+
<nz-icon
|
|
258
|
+
nz-tooltip
|
|
259
|
+
[nzTooltipTitle]="_optionalHelp"
|
|
260
|
+
[nzTooltipColor]="optionalHelpColor()"
|
|
261
|
+
nzType="question-circle"
|
|
262
|
+
/>
|
|
263
|
+
}
|
|
264
|
+
</span>
|
|
265
|
+
}
|
|
266
|
+
</label>
|
|
267
|
+
}
|
|
268
|
+
</div>
|
|
269
|
+
<div class="ant-form-item-control se__control">
|
|
270
|
+
<div class="ant-form-item-control-input" [class]="controlClass()">
|
|
271
|
+
<div class="ant-form-item-control-input-content" (cdkObserveContent)="checkContent()" #contentElement>
|
|
272
|
+
<ng-content />
|
|
273
|
+
</div>
|
|
274
|
+
</div>
|
|
275
|
+
@if (showErr()) {
|
|
276
|
+
<div
|
|
277
|
+
[animate.enter]="nzValidateAnimationEnter()"
|
|
278
|
+
[animate.leave]="nzValidateAnimationLeave()"
|
|
279
|
+
class="ant-form-item-explain ant-form-item-explain-connected"
|
|
280
|
+
>
|
|
281
|
+
<div role="alert" class="ant-form-item-explain-error">
|
|
282
|
+
<ng-container *nzStringTemplateOutlet="errorText()">{{ errorText() }}</ng-container>
|
|
283
|
+
</div>
|
|
284
|
+
</div>
|
|
285
|
+
}
|
|
286
|
+
@let _extra = extra();
|
|
287
|
+
@if (_extra && !compact()) {
|
|
288
|
+
<div class="ant-form-item-extra">
|
|
289
|
+
<ng-container *nzStringTemplateOutlet="_extra">{{ _extra }}</ng-container>
|
|
290
|
+
</div>
|
|
291
|
+
}
|
|
292
|
+
</div>
|
|
293
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NzStringTemplateOutletDirective, selector: "[nzStringTemplateOutlet]", inputs: ["nzStringTemplateOutletContext", "nzStringTemplateOutlet"], exportAs: ["nzStringTemplateOutlet"] }, { 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: "directive", type: NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "directive", type: CdkObserveContent, selector: "[cdkObserveContent]", inputs: ["cdkObserveContentDisabled", "debounce"], outputs: ["cdkObserveContent"], exportAs: ["cdkObserveContent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
337
294
|
}
|
|
338
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
295
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SEComponent, decorators: [{
|
|
339
296
|
type: Component,
|
|
340
|
-
args: [{
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
297
|
+
args: [{
|
|
298
|
+
selector: 'se',
|
|
299
|
+
exportAs: 'se',
|
|
300
|
+
template: `
|
|
301
|
+
@let _label = label();
|
|
302
|
+
<div class="ant-form-item-label" [class.se__nolabel]="hideLabel() || !_label" [style.width.px]="_labelWidth()">
|
|
303
|
+
@if (_label) {
|
|
304
|
+
<label
|
|
305
|
+
[attr.for]="_id()"
|
|
306
|
+
class="se__label"
|
|
307
|
+
[class.ant-form-item-required]="_required()"
|
|
308
|
+
[class.se__no-colon]="_noColon()"
|
|
309
|
+
>
|
|
310
|
+
<span class="se__label-text">
|
|
311
|
+
<ng-container *nzStringTemplateOutlet="_label">{{ _label }}</ng-container>
|
|
312
|
+
</span>
|
|
313
|
+
@let _optional = optional();
|
|
314
|
+
@let _optionalHelp = optionalHelp();
|
|
315
|
+
@if (_optional || _optionalHelp) {
|
|
316
|
+
<span class="se__label-optional" [class.se__label-optional-no-text]="!_optional">
|
|
317
|
+
<ng-container *nzStringTemplateOutlet="_optional">{{ _optional }}</ng-container>
|
|
318
|
+
@if (_optionalHelp) {
|
|
319
|
+
<nz-icon
|
|
320
|
+
nz-tooltip
|
|
321
|
+
[nzTooltipTitle]="_optionalHelp"
|
|
322
|
+
[nzTooltipColor]="optionalHelpColor()"
|
|
323
|
+
nzType="question-circle"
|
|
324
|
+
/>
|
|
325
|
+
}
|
|
326
|
+
</span>
|
|
327
|
+
}
|
|
328
|
+
</label>
|
|
329
|
+
}
|
|
330
|
+
</div>
|
|
331
|
+
<div class="ant-form-item-control se__control">
|
|
332
|
+
<div class="ant-form-item-control-input" [class]="controlClass()">
|
|
333
|
+
<div class="ant-form-item-control-input-content" (cdkObserveContent)="checkContent()" #contentElement>
|
|
334
|
+
<ng-content />
|
|
335
|
+
</div>
|
|
336
|
+
</div>
|
|
337
|
+
@if (showErr()) {
|
|
338
|
+
<div
|
|
339
|
+
[animate.enter]="nzValidateAnimationEnter()"
|
|
340
|
+
[animate.leave]="nzValidateAnimationLeave()"
|
|
341
|
+
class="ant-form-item-explain ant-form-item-explain-connected"
|
|
342
|
+
>
|
|
343
|
+
<div role="alert" class="ant-form-item-explain-error">
|
|
344
|
+
<ng-container *nzStringTemplateOutlet="errorText()">{{ errorText() }}</ng-container>
|
|
345
|
+
</div>
|
|
346
|
+
</div>
|
|
347
|
+
}
|
|
348
|
+
@let _extra = extra();
|
|
349
|
+
@if (_extra && !compact()) {
|
|
350
|
+
<div class="ant-form-item-extra">
|
|
351
|
+
<ng-container *nzStringTemplateOutlet="_extra">{{ _extra }}</ng-container>
|
|
352
|
+
</div>
|
|
353
|
+
}
|
|
354
|
+
</div>
|
|
355
|
+
`,
|
|
356
|
+
host: {
|
|
357
|
+
'[style.padding-left.px]': 'paddingValue()',
|
|
358
|
+
'[style.padding-right.px]': 'paddingValue()',
|
|
359
|
+
'[class.se__hide-label]': 'hideLabel()',
|
|
360
|
+
'[class.ant-form-item-has-error]': 'invalid()',
|
|
361
|
+
'[class.ant-form-item-with-help]': 'showErr()',
|
|
362
|
+
'[class.se__item-empty]': 'empty()',
|
|
363
|
+
'[class]': 'cls()'
|
|
364
|
+
},
|
|
365
|
+
providers: [NzFormStatusService],
|
|
366
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
367
|
+
encapsulation: ViewEncapsulation.None,
|
|
368
|
+
imports: [NzStringTemplateOutletDirective, NzTooltipDirective, NzIconDirective, CdkObserveContent]
|
|
369
|
+
}]
|
|
370
|
+
}], ctorParameters: () => [], propDecorators: { ngModel: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NgModel), { isSignal: true }] }], formControlName: [{ type: i0.ContentChild, args: [i0.forwardRef(() => FormControlName), { isSignal: true }] }], contentElement: [{ type: i0.ViewChild, args: ['contentElement', { isSignal: true }] }], optional: [{ type: i0.Input, args: [{ isSignal: true, alias: "optional", required: false }] }], optionalHelp: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionalHelp", required: false }] }], optionalHelpColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionalHelpColor", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], extra: [{ type: i0.Input, args: [{ isSignal: true, alias: "extra", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], col: [{ type: i0.Input, args: [{ isSignal: true, alias: "col", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], controlClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlClass", required: false }] }], line: [{ type: i0.Input, args: [{ isSignal: true, alias: "line", required: false }] }], labelWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelWidth", required: false }] }], noColon: [{ type: i0.Input, args: [{ isSignal: true, alias: "noColon", required: false }] }], hideLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideLabel", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
|
|
391
371
|
|
|
392
372
|
const COMPONENTS = [SEContainerComponent, SEComponent, SETitleComponent];
|
|
393
373
|
class SEModule {
|
|
394
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
395
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
396
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
374
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SEModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
375
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.6", ngImport: i0, type: SEModule, imports: [CommonModule, NzTooltipModule, NzIconModule, NzOutletModule, SEContainerComponent, SEComponent, SETitleComponent], exports: [SEContainerComponent, SEComponent, SETitleComponent] });
|
|
376
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SEModule, imports: [CommonModule, NzTooltipModule, NzIconModule, NzOutletModule] });
|
|
397
377
|
}
|
|
398
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
378
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SEModule, decorators: [{
|
|
399
379
|
type: NgModule,
|
|
400
380
|
args: [{
|
|
401
381
|
imports: [CommonModule, NzTooltipModule, NzIconModule, NzOutletModule, ...COMPONENTS],
|