@delon/abc 20.1.1 → 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.
Files changed (97) hide show
  1. package/fesm2022/auto-focus.mjs +10 -10
  2. package/fesm2022/auto-focus.mjs.map +1 -1
  3. package/fesm2022/cell.mjs +23 -25
  4. package/fesm2022/cell.mjs.map +1 -1
  5. package/fesm2022/chart-observer-size.mjs +21 -34
  6. package/fesm2022/chart-observer-size.mjs.map +1 -1
  7. package/fesm2022/count-down.mjs +24 -31
  8. package/fesm2022/count-down.mjs.map +1 -1
  9. package/fesm2022/date-picker.mjs +89 -85
  10. package/fesm2022/date-picker.mjs.map +1 -1
  11. package/fesm2022/down-file.mjs +23 -43
  12. package/fesm2022/down-file.mjs.map +1 -1
  13. package/fesm2022/ellipsis.mjs +163 -104
  14. package/fesm2022/ellipsis.mjs.map +1 -1
  15. package/fesm2022/error-collect.mjs +11 -13
  16. package/fesm2022/error-collect.mjs.map +1 -1
  17. package/fesm2022/exception.mjs +9 -9
  18. package/fesm2022/exception.mjs.map +1 -1
  19. package/fesm2022/footer-toolbar.mjs +9 -9
  20. package/fesm2022/footer-toolbar.mjs.map +1 -1
  21. package/fesm2022/full-content.mjs +50 -58
  22. package/fesm2022/full-content.mjs.map +1 -1
  23. package/fesm2022/global-footer.mjs +14 -15
  24. package/fesm2022/global-footer.mjs.map +1 -1
  25. package/fesm2022/hotkey.mjs +7 -7
  26. package/fesm2022/hotkey.mjs.map +1 -1
  27. package/fesm2022/loading.mjs +61 -14
  28. package/fesm2022/loading.mjs.map +1 -1
  29. package/fesm2022/lodop.mjs +7 -7
  30. package/fesm2022/media.mjs +37 -61
  31. package/fesm2022/media.mjs.map +1 -1
  32. package/fesm2022/notice-icon.mjs +220 -25
  33. package/fesm2022/notice-icon.mjs.map +1 -1
  34. package/fesm2022/onboarding.mjs +160 -62
  35. package/fesm2022/onboarding.mjs.map +1 -1
  36. package/fesm2022/page-header.mjs +252 -155
  37. package/fesm2022/page-header.mjs.map +1 -1
  38. package/fesm2022/pdf.mjs +7 -7
  39. package/fesm2022/pdf.mjs.map +1 -1
  40. package/fesm2022/quick-menu.mjs +79 -71
  41. package/fesm2022/quick-menu.mjs.map +1 -1
  42. package/fesm2022/reuse-tab.mjs +257 -160
  43. package/fesm2022/reuse-tab.mjs.map +1 -1
  44. package/fesm2022/se.mjs +289 -309
  45. package/fesm2022/se.mjs.map +1 -1
  46. package/fesm2022/sg.mjs +32 -69
  47. package/fesm2022/sg.mjs.map +1 -1
  48. package/fesm2022/st.mjs +93 -84
  49. package/fesm2022/st.mjs.map +1 -1
  50. package/fesm2022/sv.mjs +185 -174
  51. package/fesm2022/sv.mjs.map +1 -1
  52. package/fesm2022/tag-select.mjs +44 -25
  53. package/fesm2022/tag-select.mjs.map +1 -1
  54. package/fesm2022/xlsx.mjs +14 -17
  55. package/fesm2022/xlsx.mjs.map +1 -1
  56. package/fesm2022/zip.mjs +4 -4
  57. package/fesm2022/zip.mjs.map +1 -1
  58. package/package.json +37 -37
  59. package/{auto-focus/index.d.ts → types/auto-focus.d.ts} +2 -2
  60. package/{cell/index.d.ts → types/cell.d.ts} +12 -13
  61. package/{observers/index.d.ts → types/chart-observer-size.d.ts} +5 -9
  62. package/{count-down/index.d.ts → types/count-down.d.ts} +6 -10
  63. package/{date-picker/index.d.ts → types/date-picker.d.ts} +6 -10
  64. package/types/down-file.d.ts +32 -0
  65. package/types/ellipsis.d.ts +46 -0
  66. package/types/error-collect.d.ts +34 -0
  67. package/{exception/index.d.ts → types/exception.d.ts} +13 -13
  68. package/{footer-toolbar/index.d.ts → types/footer-toolbar.d.ts} +2 -2
  69. package/{full-content/index.d.ts → types/full-content.d.ts} +8 -13
  70. package/{global-footer/index.d.ts → types/global-footer.d.ts} +7 -7
  71. package/{loading/index.d.ts → types/loading.d.ts} +1 -0
  72. package/{media/index.d.ts → types/media.d.ts} +10 -16
  73. package/{notice-icon/index.d.ts → types/notice-icon.d.ts} +15 -15
  74. package/{onboarding/index.d.ts → types/onboarding.d.ts} +12 -14
  75. package/types/page-header.d.ts +67 -0
  76. package/types/quick-menu.d.ts +31 -0
  77. package/{reuse-tab/index.d.ts → types/reuse-tab.d.ts} +46 -55
  78. package/types/se.d.ts +101 -0
  79. package/types/sg.d.ts +31 -0
  80. package/{st/index.d.ts → types/st.d.ts} +10 -2
  81. package/types/sv.d.ts +81 -0
  82. package/types/tag-select.d.ts +25 -0
  83. package/{xlsx/index.d.ts → types/xlsx.d.ts} +3 -3
  84. package/down-file/index.d.ts +0 -34
  85. package/ellipsis/index.d.ts +0 -55
  86. package/error-collect/index.d.ts +0 -35
  87. package/page-header/index.d.ts +0 -83
  88. package/quick-menu/index.d.ts +0 -38
  89. package/se/index.d.ts +0 -129
  90. package/sg/index.d.ts +0 -44
  91. package/sv/index.d.ts +0 -96
  92. package/tag-select/index.d.ts +0 -27
  93. /package/{index.d.ts → types/abc.d.ts} +0 -0
  94. /package/{hotkey/index.d.ts → types/hotkey.d.ts} +0 -0
  95. /package/{lodop/index.d.ts → types/lodop.d.ts} +0 -0
  96. /package/{pdf/index.d.ts → types/pdf.d.ts} +0 -0
  97. /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, ElementRef, Renderer2, ViewEncapsulation, ChangeDetectionStrategy, Component, booleanAttribute, numberAttribute, Input, ChangeDetectorRef, DestroyRef, TemplateRef, ViewChild, ContentChild, NgModule } from '@angular/core';
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 { Validators, RequiredValidator, NgModel, FormControlName } from '@angular/forms';
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 { helpMotion } from 'ng-zorro-antd/core/animation';
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
- setClass() {
27
- const { el } = this;
28
- const gutter = this.parentComp.gutter;
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: "20.3.0", ngImport: i0, type: SETitleComponent, decorators: [{
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
- '[class.se__title]': 'true'
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
- cogSrv = inject(AlainConfigService);
53
- errorNotify$ = new BehaviorSubject(null);
54
- colInCon;
55
- col;
56
- labelWidth;
57
- noColon = false;
58
- title;
59
- get gutter() {
60
- return this.nzLayout === 'horizontal' ? this._gutter : 0;
61
- }
62
- set gutter(value) {
63
- this._gutter = value;
64
- }
65
- _gutter;
66
- get nzLayout() {
67
- return this._nzLayout;
68
- }
69
- set nzLayout(value) {
70
- this._nzLayout = value;
71
- if (value === 'inline') {
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="title">{{ title }}</ng-container>
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: "20.3.0", ngImport: i0, type: SEContainerComponent, decorators: [{
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
- @if (title) {
76
+ @let tit = title();
77
+ @if (tit) {
122
78
  <div se-title>
123
- <ng-container *nzStringTemplateOutlet="title">{{ title }}</ng-container>
79
+ <ng-container *nzStringTemplateOutlet="tit">{{ tit }}</ng-container>
124
80
  </div>
125
81
  }
126
82
  <ng-content />
127
83
  `,
128
84
  host: {
129
- '[class.ant-row]': `true`,
130
- '[class.se__container]': `true`,
131
- '[class.se__horizontal]': `nzLayout === 'horizontal'`,
132
- '[class.se__vertical]': `nzLayout === 'vertical'`,
133
- '[class.se__inline]': `nzLayout === 'inline'`,
134
- '[class.se__compact]': `size === 'compact'`,
135
- '[style.margin-left.px]': `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
- }], ctorParameters: () => [], propDecorators: { colInCon: [{
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
- ngModel;
187
- formControlName;
188
- contentElement;
189
- clsMap = [];
190
- inited = false;
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
- errorData = {};
193
- isBindModel = false;
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 = null;
200
- optionalHelp = null;
201
- optionalHelpColor;
202
- set error(val) {
203
- this.errorData = typeof val === 'string' || val instanceof TemplateRef ? { '': val } : val;
204
- }
205
- extra;
206
- label;
207
- col;
208
- required = false;
209
- controlClass = '';
210
- line;
211
- labelWidth;
212
- noColon;
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
- get paddingValue() {
222
- return this.parentComp.gutter / 2;
223
- }
224
- get showErr() {
225
- return this.invalid && !!this._error && !this.compact;
226
- }
227
- get compact() {
228
- return this.parentComp.size === 'compact';
229
- }
230
- get ngControl() {
231
- return this.ngModel ?? this.formControlName;
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.errorNotify
238
- .pipe(takeUntilDestroyed(), filter(w => this.inited && this.ngControl != null && this.ngControl.name === w.name))
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.error = item.error;
241
- this.updateStatus(this.ngControl.invalid);
172
+ this.errorType.set(item.error);
173
+ this.updateStatus();
242
174
  });
243
- }
244
- setClass() {
245
- const { el, ren, clsMap, col, cdr, line, labelWidth, rep, noColon } = this;
246
- const parent = this.parentComp;
247
- this._noColon = noColon != null ? noColon : parent.noColon;
248
- this._labelWidth = parent.nzLayout === 'horizontal' ? (labelWidth != null ? labelWidth : parent.labelWidth) : null;
249
- clsMap.forEach(cls => ren.removeClass(el, cls));
250
- clsMap.length = 0;
251
- const parentCol = parent.colInCon ?? parent.col;
252
- const repCls = parent.nzLayout === 'horizontal' ? rep.genCls(col != null ? col : parentCol, parentCol) : [];
253
- clsMap.push(`ant-form-item`, ...repCls, `${prefixCls}__item`);
254
- if (line || parent.line) {
255
- clsMap.push(`${prefixCls}__line`);
256
- }
257
- clsMap.forEach(cls => ren.addClass(el, cls));
258
- cdr.detectChanges();
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
- control.id = this._id;
193
+ controlEl.id = id;
277
194
  }
278
195
  }
279
- }
280
- // auto required
281
- if (this.required !== true) {
282
- let required = this.ngControl?.control?.hasValidator(Validators.required);
283
- if (required !== true) {
284
- const rawValidators = this.ngControl?._rawValidators;
285
- required = rawValidators.find(w => w instanceof RequiredValidator) != null;
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
- this.required = required;
288
- this.cdr.detectChanges();
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
- if (this.ngControl?.disabled || this.ngControl?.isDisabled) {
219
+ const control = this.ngControl();
220
+ if (!control || control.disabled || control.isDisabled)
293
221
  return;
294
- }
295
- this.invalid =
296
- !this.onceFlag && invalid && this.parentComp.ingoreDirty === false && !this.ngControl?.dirty ? false : invalid;
297
- const errors = this.ngControl?.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
227
  const key = Object.keys(errors)[0] ?? '';
300
- const err = this.errorData[key];
301
- this._error = err != null ? err : (this.errorData[''] ?? '');
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
- const cls = `${prefixCls}__item-empty`;
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
- ngAfterViewInit() {
326
- this.setClass().bindModel();
327
- this.inited = true;
328
- if (this.onceFlag) {
329
- Promise.resolve().then(() => {
330
- this.updateStatus(this.ngControl.invalid);
331
- this.onceFlag = false;
332
- });
333
- }
334
- }
335
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: SEComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
336
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", type: SEComponent, isStandalone: true, selector: "se", inputs: { optional: "optional", optionalHelp: "optionalHelp", optionalHelpColor: "optionalHelpColor", error: "error", extra: "extra", label: "label", col: ["col", "col", (v) => (v == null ? null : numberAttribute(v))], required: ["required", "required", booleanAttribute], controlClass: "controlClass", line: ["line", "line", (v) => (v == null ? null : booleanAttribute(v))], labelWidth: ["labelWidth", "labelWidth", (v) => (v == null ? null : numberAttribute(v))], noColon: ["noColon", "noColon", (v) => (v == null ? null : booleanAttribute(v))], hideLabel: ["hideLabel", "hideLabel", booleanAttribute], id: "id" }, 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" } }, providers: [NzFormStatusService], queries: [{ propertyName: "ngModel", first: true, predicate: NgModel, descendants: true, static: true }, { propertyName: "formControlName", first: true, predicate: FormControlName, descendants: true, static: true }], viewQueries: [{ propertyName: "contentElement", first: true, predicate: ["contentElement"], descendants: true, static: true }], exportAs: ["se"], usesOnChanges: true, ngImport: i0, template: "<div class=\"ant-form-item-label\" [class.se__nolabel]=\"hideLabel || !label\" [style.width.px]=\"_labelWidth\">\n @if (label) {\n <label [attr.for]=\"_id\" class=\"se__label\" [class.ant-form-item-required]=\"required\" [class.se__no-colon]=\"_noColon\">\n <span class=\"se__label-text\">\n <ng-container *nzStringTemplateOutlet=\"label\">{{ label }}</ng-container>\n </span>\n @if (optional || optionalHelp) {\n <span class=\"se__label-optional\" [class.se__label-optional-no-text]=\"!optional\">\n <ng-container *nzStringTemplateOutlet=\"optional\">{{ optional }}</ng-container>\n @if (optionalHelp) {\n <nz-icon\n nz-tooltip\n [nzTooltipTitle]=\"optionalHelp\"\n [nzTooltipColor]=\"optionalHelpColor\"\n nzType=\"question-circle\"\n />\n }\n </span>\n }\n </label>\n }\n</div>\n<div class=\"ant-form-item-control se__control\">\n <div class=\"ant-form-item-control-input {{ controlClass }}\">\n <div class=\"ant-form-item-control-input-content\" (cdkObserveContent)=\"checkContent()\" #contentElement>\n <ng-content />\n </div>\n </div>\n @if (showErr) {\n <div @helpMotion class=\"ant-form-item-explain ant-form-item-explain-connected\">\n <div role=\"alert\" class=\"ant-form-item-explain-error\">\n <ng-container *nzStringTemplateOutlet=\"_error\">{{ _error }}</ng-container>\n </div>\n </div>\n }\n @if (extra && !compact) {\n <div class=\"ant-form-item-extra\">\n <ng-container *nzStringTemplateOutlet=\"extra\">{{ extra }}</ng-container>\n </div>\n }\n</div>\n", 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"] }], animations: [helpMotion], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
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: "20.3.0", ngImport: i0, type: SEComponent, decorators: [{
295
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SEComponent, decorators: [{
339
296
  type: Component,
340
- args: [{ selector: 'se', exportAs: 'se', host: {
341
- '[style.padding-left.px]': 'paddingValue',
342
- '[style.padding-right.px]': 'paddingValue',
343
- '[class.se__hide-label]': 'hideLabel',
344
- '[class.ant-form-item-has-error]': 'invalid',
345
- '[class.ant-form-item-with-help]': 'showErr'
346
- }, providers: [NzFormStatusService], animations: [helpMotion], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [NzStringTemplateOutletDirective, NzTooltipDirective, NzIconDirective, CdkObserveContent], template: "<div class=\"ant-form-item-label\" [class.se__nolabel]=\"hideLabel || !label\" [style.width.px]=\"_labelWidth\">\n @if (label) {\n <label [attr.for]=\"_id\" class=\"se__label\" [class.ant-form-item-required]=\"required\" [class.se__no-colon]=\"_noColon\">\n <span class=\"se__label-text\">\n <ng-container *nzStringTemplateOutlet=\"label\">{{ label }}</ng-container>\n </span>\n @if (optional || optionalHelp) {\n <span class=\"se__label-optional\" [class.se__label-optional-no-text]=\"!optional\">\n <ng-container *nzStringTemplateOutlet=\"optional\">{{ optional }}</ng-container>\n @if (optionalHelp) {\n <nz-icon\n nz-tooltip\n [nzTooltipTitle]=\"optionalHelp\"\n [nzTooltipColor]=\"optionalHelpColor\"\n nzType=\"question-circle\"\n />\n }\n </span>\n }\n </label>\n }\n</div>\n<div class=\"ant-form-item-control se__control\">\n <div class=\"ant-form-item-control-input {{ controlClass }}\">\n <div class=\"ant-form-item-control-input-content\" (cdkObserveContent)=\"checkContent()\" #contentElement>\n <ng-content />\n </div>\n </div>\n @if (showErr) {\n <div @helpMotion class=\"ant-form-item-explain ant-form-item-explain-connected\">\n <div role=\"alert\" class=\"ant-form-item-explain-error\">\n <ng-container *nzStringTemplateOutlet=\"_error\">{{ _error }}</ng-container>\n </div>\n </div>\n }\n @if (extra && !compact) {\n <div class=\"ant-form-item-extra\">\n <ng-container *nzStringTemplateOutlet=\"extra\">{{ extra }}</ng-container>\n </div>\n }\n</div>\n" }]
347
- }], ctorParameters: () => [], propDecorators: { ngModel: [{
348
- type: ContentChild,
349
- args: [NgModel, { static: true }]
350
- }], formControlName: [{
351
- type: ContentChild,
352
- args: [FormControlName, { static: true }]
353
- }], contentElement: [{
354
- type: ViewChild,
355
- args: ['contentElement', { static: true }]
356
- }], optional: [{
357
- type: Input
358
- }], optionalHelp: [{
359
- type: Input
360
- }], optionalHelpColor: [{
361
- type: Input
362
- }], error: [{
363
- type: Input
364
- }], extra: [{
365
- type: Input
366
- }], label: [{
367
- type: Input
368
- }], col: [{
369
- type: Input,
370
- args: [{ transform: (v) => (v == null ? null : numberAttribute(v)) }]
371
- }], required: [{
372
- type: Input,
373
- args: [{ transform: booleanAttribute }]
374
- }], controlClass: [{
375
- type: Input
376
- }], line: [{
377
- type: Input,
378
- args: [{ transform: (v) => (v == null ? null : booleanAttribute(v)) }]
379
- }], labelWidth: [{
380
- type: Input,
381
- args: [{ transform: (v) => (v == null ? null : numberAttribute(v)) }]
382
- }], noColon: [{
383
- type: Input,
384
- args: [{ transform: (v) => (v == null ? null : booleanAttribute(v)) }]
385
- }], hideLabel: [{
386
- type: Input,
387
- args: [{ transform: booleanAttribute }]
388
- }], id: [{
389
- type: Input
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: "20.3.0", ngImport: i0, type: SEModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
395
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.0", ngImport: i0, type: SEModule, imports: [CommonModule, NzTooltipModule, NzIconModule, NzOutletModule, SEContainerComponent, SEComponent, SETitleComponent], exports: [SEContainerComponent, SEComponent, SETitleComponent] });
396
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: SEModule, imports: [CommonModule, NzTooltipModule, NzIconModule, NzOutletModule] });
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: "20.3.0", ngImport: i0, type: SEModule, decorators: [{
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],