ngx-formly-zorro-antd 14.1.0 → 14.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,11 +4,13 @@ import * as i1 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i2 from '@angular/forms';
6
6
  import { ReactiveFormsModule } from '@angular/forms';
7
- import * as i4 from '@ngx-formly/core';
7
+ import * as i5 from '@ngx-formly/core';
8
8
  import { FieldType, FormlyModule } from '@ngx-formly/core';
9
9
  import { FormlyNzFormFieldModule } from 'ngx-formly-zorro-antd/form-field';
10
10
  import * as i3 from 'ng-zorro-antd/input';
11
11
  import { NzInputModule } from 'ng-zorro-antd/input';
12
+ import * as i4 from 'ng-zorro-antd/icon';
13
+ import { NzIconModule } from 'ng-zorro-antd/icon';
12
14
 
13
15
  class FormlyFieldTextarea extends FieldType {
14
16
  constructor() {
@@ -24,23 +26,37 @@ class FormlyFieldTextarea extends FieldType {
24
26
  }
25
27
  FormlyFieldTextarea.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: FormlyFieldTextarea, deps: null, target: i0.ɵɵFactoryTarget.Component });
26
28
  FormlyFieldTextarea.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.1", type: FormlyFieldTextarea, selector: "formly-field-textarea", usesInheritance: true, ngImport: i0, template: `
27
- <nz-textarea-count
28
- *ngIf="props['maxCharacterCount']; else textarea"
29
- [nzMaxCharacterCount]="props['maxCharacterCount']"
30
- >
31
- <textarea
32
- [formControl]="formControl"
33
- [formlyAttributes]="field"
34
- [ngClass]="props['className']"
35
- [rows]="props.rows"
36
- [cols]="props.cols"
37
- nz-input
38
- [nzBorderless]="props['borderless']"
39
- [nzAutosize]="props['autosize']!"
40
- ></textarea>
41
- </nz-textarea-count>
29
+ <ng-container [ngSwitch]="props.type">
30
+ <ng-container *ngSwitchCase="'count'">
31
+ <nz-textarea-count [nzMaxCharacterCount]="props['maxCharacterCount'] || 0">
32
+ <textarea
33
+ [formControl]="formControl"
34
+ [formlyAttributes]="field"
35
+ [ngClass]="props['className']"
36
+ [rows]="props.rows"
37
+ [cols]="props.cols"
38
+ nz-input
39
+ [nzBorderless]="props['borderless']!!"
40
+ [nzAutosize]="props['autosize']!!"
41
+ ></textarea>
42
+ </nz-textarea-count>
43
+ </ng-container>
44
+
45
+ <ng-container *ngSwitchCase="'clear'">
46
+ <nz-input-group
47
+ class="ant-input-affix-wrapper-textarea-with-clear-btn"
48
+ [nzSuffix]="textAreaClearTpl"
49
+ >
50
+ <ng-container *ngTemplateOutlet="textareaTpl"> </ng-container>
51
+ </nz-input-group>
52
+ </ng-container>
53
+
54
+ <ng-container *ngSwitchDefault>
55
+ <ng-container *ngTemplateOutlet="textareaTpl"> </ng-container>
56
+ </ng-container>
57
+ </ng-container>
42
58
 
43
- <ng-template #textarea>
59
+ <ng-template #textareaTpl>
44
60
  <textarea
45
61
  [formControl]="formControl"
46
62
  [formlyAttributes]="field"
@@ -48,33 +64,59 @@ FormlyFieldTextarea.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", ve
48
64
  [rows]="props.rows"
49
65
  [cols]="props.cols"
50
66
  nz-input
51
- [nzBorderless]="props['borderless']"
52
- [nzAutosize]="props['autosize']!"
67
+ [nzBorderless]="props['borderless']!!"
68
+ [nzAutosize]="props['autosize']!!"
53
69
  ></textarea>
54
70
  </ng-template>
55
- `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i3.NzTextareaCountComponent, selector: "nz-textarea-count", inputs: ["nzMaxCharacterCount", "nzComputeCharacterCount", "nzFormatter"] }, { kind: "directive", type: i3.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzSize", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "directive", type: i3.NzAutosizeDirective, selector: "textarea[nzAutosize]", inputs: ["nzAutosize"], exportAs: ["nzAutosize"] }, { kind: "directive", type: i4.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
71
+
72
+ <!-- 清除数据 -->
73
+ <ng-template #textAreaClearTpl>
74
+ <span
75
+ nz-icon
76
+ class="ant-input-clear-icon"
77
+ nzTheme="fill"
78
+ nzType="close-circle"
79
+ *ngIf="formControl.value"
80
+ (click)="formControl.reset()"
81
+ ></span>
82
+ </ng-template>
83
+ `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i3.NzTextareaCountComponent, selector: "nz-textarea-count", inputs: ["nzMaxCharacterCount", "nzComputeCharacterCount", "nzFormatter"] }, { kind: "directive", type: i3.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzSize", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "component", type: i3.NzInputGroupComponent, selector: "nz-input-group", inputs: ["nzAddOnBeforeIcon", "nzAddOnAfterIcon", "nzPrefixIcon", "nzSuffixIcon", "nzAddOnBefore", "nzAddOnAfter", "nzPrefix", "nzStatus", "nzSuffix", "nzSize", "nzSearch", "nzCompact"], exportAs: ["nzInputGroup"] }, { kind: "directive", type: i3.NzAutosizeDirective, selector: "textarea[nzAutosize]", inputs: ["nzAutosize"], exportAs: ["nzAutosize"] }, { kind: "directive", type: i3.NzInputGroupWhitSuffixOrPrefixDirective, selector: "nz-input-group[nzSuffix], nz-input-group[nzPrefix]" }, { kind: "directive", type: i4.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "directive", type: i5.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
56
84
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: FormlyFieldTextarea, decorators: [{
57
85
  type: Component,
58
86
  args: [{
59
87
  selector: 'formly-field-textarea',
60
88
  template: `
61
- <nz-textarea-count
62
- *ngIf="props['maxCharacterCount']; else textarea"
63
- [nzMaxCharacterCount]="props['maxCharacterCount']"
64
- >
65
- <textarea
66
- [formControl]="formControl"
67
- [formlyAttributes]="field"
68
- [ngClass]="props['className']"
69
- [rows]="props.rows"
70
- [cols]="props.cols"
71
- nz-input
72
- [nzBorderless]="props['borderless']"
73
- [nzAutosize]="props['autosize']!"
74
- ></textarea>
75
- </nz-textarea-count>
89
+ <ng-container [ngSwitch]="props.type">
90
+ <ng-container *ngSwitchCase="'count'">
91
+ <nz-textarea-count [nzMaxCharacterCount]="props['maxCharacterCount'] || 0">
92
+ <textarea
93
+ [formControl]="formControl"
94
+ [formlyAttributes]="field"
95
+ [ngClass]="props['className']"
96
+ [rows]="props.rows"
97
+ [cols]="props.cols"
98
+ nz-input
99
+ [nzBorderless]="props['borderless']!!"
100
+ [nzAutosize]="props['autosize']!!"
101
+ ></textarea>
102
+ </nz-textarea-count>
103
+ </ng-container>
104
+
105
+ <ng-container *ngSwitchCase="'clear'">
106
+ <nz-input-group
107
+ class="ant-input-affix-wrapper-textarea-with-clear-btn"
108
+ [nzSuffix]="textAreaClearTpl"
109
+ >
110
+ <ng-container *ngTemplateOutlet="textareaTpl"> </ng-container>
111
+ </nz-input-group>
112
+ </ng-container>
113
+
114
+ <ng-container *ngSwitchDefault>
115
+ <ng-container *ngTemplateOutlet="textareaTpl"> </ng-container>
116
+ </ng-container>
117
+ </ng-container>
76
118
 
77
- <ng-template #textarea>
119
+ <ng-template #textareaTpl>
78
120
  <textarea
79
121
  [formControl]="formControl"
80
122
  [formlyAttributes]="field"
@@ -82,10 +124,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
82
124
  [rows]="props.rows"
83
125
  [cols]="props.cols"
84
126
  nz-input
85
- [nzBorderless]="props['borderless']"
86
- [nzAutosize]="props['autosize']!"
127
+ [nzBorderless]="props['borderless']!!"
128
+ [nzAutosize]="props['autosize']!!"
87
129
  ></textarea>
88
130
  </ng-template>
131
+
132
+ <!-- 清除数据 -->
133
+ <ng-template #textAreaClearTpl>
134
+ <span
135
+ nz-icon
136
+ class="ant-input-clear-icon"
137
+ nzTheme="fill"
138
+ nzType="close-circle"
139
+ *ngIf="formControl.value"
140
+ (click)="formControl.reset()"
141
+ ></span>
142
+ </ng-template>
89
143
  `,
90
144
  changeDetection: ChangeDetectionStrategy.OnPush
91
145
  }]
@@ -97,11 +151,13 @@ FormlyNzTextareaModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", v
97
151
  FormlyNzTextareaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.1", ngImport: i0, type: FormlyNzTextareaModule, declarations: [FormlyFieldTextarea], imports: [CommonModule,
98
152
  ReactiveFormsModule,
99
153
  FormlyNzFormFieldModule,
100
- NzInputModule, i4.FormlyModule] });
154
+ NzInputModule,
155
+ NzIconModule, i5.FormlyModule] });
101
156
  FormlyNzTextareaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: FormlyNzTextareaModule, imports: [CommonModule,
102
157
  ReactiveFormsModule,
103
158
  FormlyNzFormFieldModule,
104
159
  NzInputModule,
160
+ NzIconModule,
105
161
  FormlyModule.forChild({
106
162
  types: [
107
163
  {
@@ -120,6 +176,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
120
176
  ReactiveFormsModule,
121
177
  FormlyNzFormFieldModule,
122
178
  NzInputModule,
179
+ NzIconModule,
123
180
  FormlyModule.forChild({
124
181
  types: [
125
182
  {
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-formly-zorro-antd-textarea.mjs","sources":["../../../../packages/formlyantd/textarea/src/textarea.type.ts","../../../../packages/formlyantd/textarea/src/textarea.module.ts","../../../../packages/formlyantd/textarea/src/ngx-formly-zorro-antd-textarea.ts"],"sourcesContent":["import { Component, Type, ChangeDetectionStrategy } from '@angular/core';\nimport { FieldType, FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport type { FormlyFieldProps } from 'ngx-formly-zorro-antd/form-field';\n\ninterface TextareaProps extends FormlyFieldProps {\n /**\n * 自适应内容高度,可设置为 boolean 或对象:{ minRows: 2, maxRows: 6 }\n * @default false\n */\n autosize?: boolean | { minRows: number; maxRows: number };\n\n /**\n * 是否隐藏边框\n * @default false\n */\n borderless?: boolean;\n\n /**\n * textarea 数字提示显示的最大值\n */\n maxCharacterCount?: number;\n}\n\nexport interface FormlyTextareaFieldConfig extends FormlyFieldConfig<TextareaProps> {\n type: 'textarea' | Type<FormlyFieldTextarea>;\n}\n\n@Component({\n selector: 'formly-field-textarea',\n template: `\n <nz-textarea-count\n *ngIf=\"props['maxCharacterCount']; else textarea\"\n [nzMaxCharacterCount]=\"props['maxCharacterCount']\"\n >\n <textarea\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [ngClass]=\"props['className']\"\n [rows]=\"props.rows\"\n [cols]=\"props.cols\"\n nz-input\n [nzBorderless]=\"props['borderless']\"\n [nzAutosize]=\"props['autosize']!\"\n ></textarea>\n </nz-textarea-count>\n\n <ng-template #textarea>\n <textarea\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [ngClass]=\"props['className']\"\n [rows]=\"props.rows\"\n [cols]=\"props.cols\"\n nz-input\n [nzBorderless]=\"props['borderless']\"\n [nzAutosize]=\"props['autosize']!\"\n ></textarea>\n </ng-template>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FormlyFieldTextarea extends FieldType<FieldTypeConfig> {\n override defaultOptions = {\n props: {\n rows: 4,\n autosize: false,\n borderless: false\n }\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { FormlyNzFormFieldModule } from 'ngx-formly-zorro-antd/form-field';\n\nimport { FormlyFieldTextarea } from './textarea.type';\nimport { NzInputModule } from 'ng-zorro-antd/input';\n\n@NgModule({\n declarations: [FormlyFieldTextarea],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n FormlyNzFormFieldModule,\n NzInputModule,\n\n FormlyModule.forChild({\n types: [\n {\n name: 'textarea',\n component: FormlyFieldTextarea,\n wrappers: ['form-field']\n }\n ]\n })\n ]\n})\nexport class FormlyNzTextareaModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;AA6DM,MAAO,mBAAoB,SAAQ,SAA0B,CAAA;AAlCnE,IAAA,WAAA,GAAA;;AAmCW,QAAA,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;AACL,gBAAA,IAAI,EAAE,CAAC;AACP,gBAAA,QAAQ,EAAE,KAAK;AACf,gBAAA,UAAU,EAAE,KAAK;AAClB,aAAA;SACF,CAAC;AACH,KAAA;;gHARY,mBAAmB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAnB,mBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,mBAAmB,EAhCpB,QAAA,EAAA,uBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,IAAA,EAAA,QAAA,EAAA,QAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,EAAA,EAAA,I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AACE,oCAAA,IAAI,EAAE,UAAU;AAChB,oCAAA,SAAS,EAAE,mBAAmB;oCAC9B,QAAQ,EAAE,CAAC,YAAY,CAAC;AACzB,iCAAA;AACF,6BAAA;yBACF,CAAC;AACH,qBAAA;AACF,iBAAA,CAAA;;;AC3BD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-formly-zorro-antd-textarea.mjs","sources":["../../../../packages/formlyantd/textarea/src/textarea.type.ts","../../../../packages/formlyantd/textarea/src/textarea.module.ts","../../../../packages/formlyantd/textarea/src/ngx-formly-zorro-antd-textarea.ts"],"sourcesContent":["import { Component, Type, ChangeDetectionStrategy } from '@angular/core';\nimport { FieldType, FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport type { FormlyFieldProps } from 'ngx-formly-zorro-antd/form-field';\n\ninterface TextareaProps extends FormlyFieldProps {\n type?: 'count' | 'clear';\n\n /**\n * 自适应内容高度,可设置为 boolean 或对象:{ minRows: 2, maxRows: 6 }\n * @default false\n */\n autosize?: boolean | { minRows: number; maxRows: number };\n\n /**\n * 是否隐藏边框\n * @default false\n */\n borderless?: boolean;\n\n /**\n * textarea 数字提示显示的最大值\n */\n maxCharacterCount?: number;\n}\n\nexport interface FormlyTextareaFieldConfig extends FormlyFieldConfig<TextareaProps> {\n type: 'textarea' | Type<FormlyFieldTextarea>;\n}\n\n@Component({\n selector: 'formly-field-textarea',\n template: `\n <ng-container [ngSwitch]=\"props.type\">\n <ng-container *ngSwitchCase=\"'count'\">\n <nz-textarea-count [nzMaxCharacterCount]=\"props['maxCharacterCount'] || 0\">\n <textarea\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [ngClass]=\"props['className']\"\n [rows]=\"props.rows\"\n [cols]=\"props.cols\"\n nz-input\n [nzBorderless]=\"props['borderless']!!\"\n [nzAutosize]=\"props['autosize']!!\"\n ></textarea>\n </nz-textarea-count>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'clear'\">\n <nz-input-group\n class=\"ant-input-affix-wrapper-textarea-with-clear-btn\"\n [nzSuffix]=\"textAreaClearTpl\"\n >\n <ng-container *ngTemplateOutlet=\"textareaTpl\"> </ng-container>\n </nz-input-group>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <ng-container *ngTemplateOutlet=\"textareaTpl\"> </ng-container>\n </ng-container>\n </ng-container>\n\n <ng-template #textareaTpl>\n <textarea\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [ngClass]=\"props['className']\"\n [rows]=\"props.rows\"\n [cols]=\"props.cols\"\n nz-input\n [nzBorderless]=\"props['borderless']!!\"\n [nzAutosize]=\"props['autosize']!!\"\n ></textarea>\n </ng-template>\n\n <!-- 清除数据 -->\n <ng-template #textAreaClearTpl>\n <span\n nz-icon\n class=\"ant-input-clear-icon\"\n nzTheme=\"fill\"\n nzType=\"close-circle\"\n *ngIf=\"formControl.value\"\n (click)=\"formControl.reset()\"\n ></span>\n </ng-template>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FormlyFieldTextarea extends FieldType<FieldTypeConfig<TextareaProps>> {\n override defaultOptions = {\n props: {\n rows: 4,\n autosize: false,\n borderless: false\n }\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { FormlyNzFormFieldModule } from 'ngx-formly-zorro-antd/form-field';\n\nimport { FormlyFieldTextarea } from './textarea.type';\nimport { NzInputModule } from 'ng-zorro-antd/input';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\n\n@NgModule({\n declarations: [FormlyFieldTextarea],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n FormlyNzFormFieldModule,\n NzInputModule,\n NzIconModule,\n\n FormlyModule.forChild({\n types: [\n {\n name: 'textarea',\n component: FormlyFieldTextarea,\n wrappers: ['form-field']\n }\n ]\n })\n ]\n})\nexport class FormlyNzTextareaModule {}\n","/**\n * Generated bundle index. Do not edit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qBAAA;AACF,iBAAA,CAAA;;;AC7BD;;AAEG;;;;"}
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ViewEncapsulation, ChangeDetectionStrategy, ViewChild, Input, NgModule } from '@angular/core';
2
+ import { forwardRef, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, ViewChild, NgModule } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i2$1 from '@ngx-formly/core';
@@ -17,12 +17,14 @@ import * as i4 from 'ng-zorro-antd/core/transition-patch';
17
17
  import * as i5 from 'ng-zorro-antd/core/wave';
18
18
 
19
19
  /* eslint-disable @typescript-eslint/no-empty-function */
20
- class UploadComponent extends NzUploadComponent {
20
+ class UploadNzComponent extends NzUploadComponent {
21
21
  constructor() {
22
22
  super(...arguments);
23
- /**
24
- * 样式名
25
- */
23
+ /** 上传按钮的图标 */
24
+ this.nzeUploadButtonIcon = {
25
+ type: 'cloud-upload'
26
+ };
27
+ /** 样式名 */
26
28
  this.className = '';
27
29
  this.onChange = () => { };
28
30
  this.onTouched = () => { };
@@ -52,21 +54,23 @@ class UploadComponent extends NzUploadComponent {
52
54
  }
53
55
  }
54
56
  }
55
- UploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: UploadComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
56
- UploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.1", type: UploadComponent, selector: "formly-upload", inputs: { text: "text", className: "className", resultMap: "resultMap" }, providers: [
57
+ UploadNzComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: UploadNzComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
58
+ UploadNzComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.1", type: UploadNzComponent, selector: "formly-nz-upload", inputs: { nzeText: "nzeText", nzeHint: "nzeHint", nzeShowUploadButton: "nzeShowUploadButton", nzeUploadButton: "nzeUploadButton", nzeUploadButtonIcon: "nzeUploadButtonIcon", className: "className", resultMap: "resultMap" }, providers: [
57
59
  {
58
60
  provide: NG_VALUE_ACCESSOR,
59
- useExisting: UploadComponent,
61
+ useExisting: forwardRef(() => UploadNzComponent),
60
62
  multi: true
61
63
  }
62
- ], viewQueries: [{ propertyName: "transfer", first: true, predicate: ["upload"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
64
+ ], usesInheritance: true, ngImport: i0, template: `
63
65
  <nz-upload
66
+ [nzType]="nzType"
64
67
  [nzAccept]="nzAccept"
65
68
  [nzAction]="nzAction"
66
69
  [nzDirectory]="nzDirectory"
67
70
  [nzBeforeUpload]="nzBeforeUpload"
68
71
  [nzCustomRequest]="nzCustomRequest"
69
72
  [nzData]="nzData"
73
+ [nzDisabled]="nzDisabled"
70
74
  [(nzFileList)]="nzFileList"
71
75
  [nzLimit]="nzLimit"
72
76
  [nzSize]="nzSize"
@@ -90,35 +94,71 @@ UploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", versio
90
94
  [nzFileListRender]="nzFileListRender"
91
95
  [ngClass]="className"
92
96
  (nzChange)="change($event)"
93
- [nzType]="nzType"
94
97
  (nzFileListChange)="fileListChange($event)"
95
98
  >
96
- <ng-container *ngIf="text; else buttontext">
97
- <button nz-button type="button">
98
- <i nz-icon nzType="upload"></i>
99
- {{ text }}
100
- </button>
101
- </ng-container>
99
+ <ng-container [ngSwitch]="nzType">
100
+ <ng-container *ngSwitchCase="'drag'">
101
+ <p class="ant-upload-drag-icon">
102
+ <span
103
+ *ngIf="nzeUploadButtonIcon"
104
+ nz-icon
105
+ [nzType]="nzeUploadButtonIcon.type"
106
+ [nzTheme]="nzeUploadButtonIcon.theme || 'outline'"
107
+ [nzSpin]="nzeUploadButtonIcon.spin!!"
108
+ [nzTwotoneColor]="nzeUploadButtonIcon.twoToneColor || ''"
109
+ ></span>
110
+ </p>
111
+ <p class="ant-upload-text">{{ nzeText }}</p>
112
+ <p class="ant-upload-hint">{{ nzeHint }}</p>
113
+ </ng-container>
114
+ <ng-container *ngSwitchDefault>
115
+ <button
116
+ type="button"
117
+ nz-button
118
+ [disabled]="nzDisabled!!"
119
+ *ngIf="nzeShowUploadButton !== false"
120
+ >
121
+ <span
122
+ *ngIf="nzeUploadButtonIcon"
123
+ nz-icon
124
+ [nzType]="nzeUploadButtonIcon.type"
125
+ [nzTheme]="nzeUploadButtonIcon.theme || 'outline'"
126
+ [nzSpin]="nzeUploadButtonIcon.spin!!"
127
+ [nzTwotoneColor]="nzeUploadButtonIcon.twoToneColor || ''"
128
+ ></span>
129
+ {{ nzeText }}
130
+ </button>
102
131
 
103
- <ng-template #buttontext>
104
- <button nz-button type="button">
105
- <i nz-icon nzType="upload"></i>
106
- </button>
107
- </ng-template>
132
+ <div *ngIf="nzeShowUploadButton === false">
133
+ <span
134
+ *ngIf="nzeUploadButtonIcon"
135
+ nz-icon
136
+ [nzType]="nzeUploadButtonIcon.type"
137
+ [nzTheme]="nzeUploadButtonIcon.theme || 'outline'"
138
+ [nzSpin]="nzeUploadButtonIcon.spin!!"
139
+ [nzTwotoneColor]="nzeUploadButtonIcon.twoToneColor || ''"
140
+ ></span>
141
+ {{ nzeText }}
142
+ <div class="ant-upload-hint" style="margin-top: 8px">{{ nzeHint }}</div>
143
+ </div>
144
+ </ng-container>
145
+ </ng-container>
108
146
  </nz-upload>
109
- `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.NzUploadComponent, selector: "nz-upload", inputs: ["nzType", "nzLimit", "nzSize", "nzFileType", "nzAccept", "nzAction", "nzDirectory", "nzOpenFileDialogOnClick", "nzBeforeUpload", "nzCustomRequest", "nzData", "nzFilter", "nzFileList", "nzDisabled", "nzHeaders", "nzListType", "nzMultiple", "nzName", "nzShowUploadList", "nzShowButton", "nzWithCredentials", "nzRemove", "nzPreview", "nzPreviewFile", "nzPreviewIsImage", "nzTransformFile", "nzDownload", "nzIconRender", "nzFileListRender"], outputs: ["nzChange", "nzFileListChange"], exportAs: ["nzUpload"] }, { kind: "component", type: i3.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i4.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i5.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }, { kind: "directive", type: i6.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
110
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: UploadComponent, decorators: [{
147
+ `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: i2.NzUploadComponent, selector: "nz-upload", inputs: ["nzType", "nzLimit", "nzSize", "nzFileType", "nzAccept", "nzAction", "nzDirectory", "nzOpenFileDialogOnClick", "nzBeforeUpload", "nzCustomRequest", "nzData", "nzFilter", "nzFileList", "nzDisabled", "nzHeaders", "nzListType", "nzMultiple", "nzName", "nzShowUploadList", "nzShowButton", "nzWithCredentials", "nzRemove", "nzPreview", "nzPreviewFile", "nzPreviewIsImage", "nzTransformFile", "nzDownload", "nzIconRender", "nzFileListRender"], outputs: ["nzChange", "nzFileListChange"], exportAs: ["nzUpload"] }, { kind: "component", type: i3.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i4.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i5.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }, { kind: "directive", type: i6.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
148
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: UploadNzComponent, decorators: [{
111
149
  type: Component,
112
150
  args: [{
113
- selector: 'formly-upload',
151
+ selector: 'formly-nz-upload',
114
152
  template: `
115
153
  <nz-upload
154
+ [nzType]="nzType"
116
155
  [nzAccept]="nzAccept"
117
156
  [nzAction]="nzAction"
118
157
  [nzDirectory]="nzDirectory"
119
158
  [nzBeforeUpload]="nzBeforeUpload"
120
159
  [nzCustomRequest]="nzCustomRequest"
121
160
  [nzData]="nzData"
161
+ [nzDisabled]="nzDisabled"
122
162
  [(nzFileList)]="nzFileList"
123
163
  [nzLimit]="nzLimit"
124
164
  [nzSize]="nzSize"
@@ -142,21 +182,55 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
142
182
  [nzFileListRender]="nzFileListRender"
143
183
  [ngClass]="className"
144
184
  (nzChange)="change($event)"
145
- [nzType]="nzType"
146
185
  (nzFileListChange)="fileListChange($event)"
147
186
  >
148
- <ng-container *ngIf="text; else buttontext">
149
- <button nz-button type="button">
150
- <i nz-icon nzType="upload"></i>
151
- {{ text }}
152
- </button>
153
- </ng-container>
187
+ <ng-container [ngSwitch]="nzType">
188
+ <ng-container *ngSwitchCase="'drag'">
189
+ <p class="ant-upload-drag-icon">
190
+ <span
191
+ *ngIf="nzeUploadButtonIcon"
192
+ nz-icon
193
+ [nzType]="nzeUploadButtonIcon.type"
194
+ [nzTheme]="nzeUploadButtonIcon.theme || 'outline'"
195
+ [nzSpin]="nzeUploadButtonIcon.spin!!"
196
+ [nzTwotoneColor]="nzeUploadButtonIcon.twoToneColor || ''"
197
+ ></span>
198
+ </p>
199
+ <p class="ant-upload-text">{{ nzeText }}</p>
200
+ <p class="ant-upload-hint">{{ nzeHint }}</p>
201
+ </ng-container>
202
+ <ng-container *ngSwitchDefault>
203
+ <button
204
+ type="button"
205
+ nz-button
206
+ [disabled]="nzDisabled!!"
207
+ *ngIf="nzeShowUploadButton !== false"
208
+ >
209
+ <span
210
+ *ngIf="nzeUploadButtonIcon"
211
+ nz-icon
212
+ [nzType]="nzeUploadButtonIcon.type"
213
+ [nzTheme]="nzeUploadButtonIcon.theme || 'outline'"
214
+ [nzSpin]="nzeUploadButtonIcon.spin!!"
215
+ [nzTwotoneColor]="nzeUploadButtonIcon.twoToneColor || ''"
216
+ ></span>
217
+ {{ nzeText }}
218
+ </button>
154
219
 
155
- <ng-template #buttontext>
156
- <button nz-button type="button">
157
- <i nz-icon nzType="upload"></i>
158
- </button>
159
- </ng-template>
220
+ <div *ngIf="nzeShowUploadButton === false">
221
+ <span
222
+ *ngIf="nzeUploadButtonIcon"
223
+ nz-icon
224
+ [nzType]="nzeUploadButtonIcon.type"
225
+ [nzTheme]="nzeUploadButtonIcon.theme || 'outline'"
226
+ [nzSpin]="nzeUploadButtonIcon.spin!!"
227
+ [nzTwotoneColor]="nzeUploadButtonIcon.twoToneColor || ''"
228
+ ></span>
229
+ {{ nzeText }}
230
+ <div class="ant-upload-hint" style="margin-top: 8px">{{ nzeHint }}</div>
231
+ </div>
232
+ </ng-container>
233
+ </ng-container>
160
234
  </nz-upload>
161
235
  `,
162
236
  encapsulation: ViewEncapsulation.None,
@@ -164,15 +238,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
164
238
  providers: [
165
239
  {
166
240
  provide: NG_VALUE_ACCESSOR,
167
- useExisting: UploadComponent,
241
+ useExisting: forwardRef(() => UploadNzComponent),
168
242
  multi: true
169
243
  }
170
244
  ]
171
245
  }]
172
- }], propDecorators: { transfer: [{
173
- type: ViewChild,
174
- args: ['upload', { static: true }]
175
- }], text: [{
246
+ }], propDecorators: { nzeText: [{
247
+ type: Input
248
+ }], nzeHint: [{
249
+ type: Input
250
+ }], nzeShowUploadButton: [{
251
+ type: Input
252
+ }], nzeUploadButton: [{
253
+ type: Input
254
+ }], nzeUploadButtonIcon: [{
176
255
  type: Input
177
256
  }], className: [{
178
257
  type: Input
@@ -190,8 +269,10 @@ class FormlyFieldUpload extends FieldType {
190
269
  showUploadList: true,
191
270
  showButton: true,
192
271
  openFileDialogOnClick: true,
272
+ showUploadButton: true,
193
273
  limit: 0,
194
274
  size: 0,
275
+ fileList: [],
195
276
  filter: [],
196
277
  text: ''
197
278
  }
@@ -205,7 +286,7 @@ class FormlyFieldUpload extends FieldType {
205
286
  }
206
287
  }
207
288
  FormlyFieldUpload.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: FormlyFieldUpload, deps: null, target: i0.ɵɵFactoryTarget.Component });
208
- FormlyFieldUpload.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.1", type: FormlyFieldUpload, selector: "formly-field-upload", viewQueries: [{ propertyName: "upload", first: true, predicate: ["upload"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `<formly-upload
289
+ FormlyFieldUpload.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.1", type: FormlyFieldUpload, selector: "formly-field-upload", viewQueries: [{ propertyName: "upload", first: true, predicate: ["upload"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `<formly-nz-upload
209
290
  #upload
210
291
  [formControl]="formControl"
211
292
  [formlyAttributes]="field"
@@ -215,6 +296,7 @@ FormlyFieldUpload.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
215
296
  [nzBeforeUpload]="props['beforeUpload']"
216
297
  [nzCustomRequest]="props['customRequest']"
217
298
  [nzData]="props['data']"
299
+ [nzDisabled]="props['disabled']!!"
218
300
  [(nzFileList)]="props['fileList']"
219
301
  [nzLimit]="props['limit']"
220
302
  [nzSize]="props['size']"
@@ -223,7 +305,7 @@ FormlyFieldUpload.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
223
305
  [nzHeaders]="props['headers']"
224
306
  [nzListType]="props['listType']!"
225
307
  [nzMultiple]="props['multiple']!!"
226
- [nzName]="props['name']!"
308
+ [nzName]="props['name'] || ''"
227
309
  [nzShowUploadList]="props['showUploadList']"
228
310
  [nzShowButton]="props['showButton']!!"
229
311
  [nzWithCredentials]="props['withCredentials']!!"
@@ -232,22 +314,25 @@ FormlyFieldUpload.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
232
314
  [nzPreviewFile]="props['previewFile']"
233
315
  [nzPreviewIsImage]="props['previewIsImage']"
234
316
  [nzRemove]="props['remove']"
235
- (nzChange)="props['change'] && props['change']($event)"
317
+ (nzChange)="props.change && props.change(field, $event)"
236
318
  [nzDownload]="props['download']"
237
319
  [nzTransformFile]="props['transformFile']"
238
320
  [nzIconRender]="props['iconRender'] ?? null"
239
321
  [nzFileListRender]="props['fileListRender'] ?? null"
240
- [text]="props['text']"
241
- [className]="props['className']"
242
- (nzFileListChange)="props['fileListChange'] && props['fileListChange']($event)"
243
322
  [resultMap]="props['resultMap']"
323
+ [nzeHint]="props['hint']"
324
+ [nzeText]="props['text']"
325
+ [nzeUploadButtonIcon]="props['uploadButtonIcon']"
326
+ [nzeShowUploadButton]="props['showUploadButton']"
327
+ [className]="props['className'] || ''"
328
+ (nzFileListChange)="props['fileListChange'] && props['fileListChange'](field, $event)"
244
329
  >
245
- </formly-upload>`, isInline: true, dependencies: [{ kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { kind: "component", type: UploadComponent, selector: "formly-upload", inputs: ["text", "className", "resultMap"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
330
+ </formly-nz-upload>`, isInline: true, dependencies: [{ kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { kind: "component", type: UploadNzComponent, selector: "formly-nz-upload", inputs: ["nzeText", "nzeHint", "nzeShowUploadButton", "nzeUploadButton", "nzeUploadButtonIcon", "className", "resultMap"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
246
331
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: FormlyFieldUpload, decorators: [{
247
332
  type: Component,
248
333
  args: [{
249
334
  selector: 'formly-field-upload',
250
- template: `<formly-upload
335
+ template: `<formly-nz-upload
251
336
  #upload
252
337
  [formControl]="formControl"
253
338
  [formlyAttributes]="field"
@@ -257,6 +342,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
257
342
  [nzBeforeUpload]="props['beforeUpload']"
258
343
  [nzCustomRequest]="props['customRequest']"
259
344
  [nzData]="props['data']"
345
+ [nzDisabled]="props['disabled']!!"
260
346
  [(nzFileList)]="props['fileList']"
261
347
  [nzLimit]="props['limit']"
262
348
  [nzSize]="props['size']"
@@ -265,7 +351,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
265
351
  [nzHeaders]="props['headers']"
266
352
  [nzListType]="props['listType']!"
267
353
  [nzMultiple]="props['multiple']!!"
268
- [nzName]="props['name']!"
354
+ [nzName]="props['name'] || ''"
269
355
  [nzShowUploadList]="props['showUploadList']"
270
356
  [nzShowButton]="props['showButton']!!"
271
357
  [nzWithCredentials]="props['withCredentials']!!"
@@ -274,17 +360,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
274
360
  [nzPreviewFile]="props['previewFile']"
275
361
  [nzPreviewIsImage]="props['previewIsImage']"
276
362
  [nzRemove]="props['remove']"
277
- (nzChange)="props['change'] && props['change']($event)"
363
+ (nzChange)="props.change && props.change(field, $event)"
278
364
  [nzDownload]="props['download']"
279
365
  [nzTransformFile]="props['transformFile']"
280
366
  [nzIconRender]="props['iconRender'] ?? null"
281
367
  [nzFileListRender]="props['fileListRender'] ?? null"
282
- [text]="props['text']"
283
- [className]="props['className']"
284
- (nzFileListChange)="props['fileListChange'] && props['fileListChange']($event)"
285
368
  [resultMap]="props['resultMap']"
369
+ [nzeHint]="props['hint']"
370
+ [nzeText]="props['text']"
371
+ [nzeUploadButtonIcon]="props['uploadButtonIcon']"
372
+ [nzeShowUploadButton]="props['showUploadButton']"
373
+ [className]="props['className'] || ''"
374
+ (nzFileListChange)="props['fileListChange'] && props['fileListChange'](field, $event)"
286
375
  >
287
- </formly-upload>`,
376
+ </formly-nz-upload>`,
288
377
  changeDetection: ChangeDetectionStrategy.OnPush
289
378
  }]
290
379
  }], propDecorators: { upload: [{
@@ -295,7 +384,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
295
384
  class FormlyNzUploadModule {
296
385
  }
297
386
  FormlyNzUploadModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: FormlyNzUploadModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
298
- FormlyNzUploadModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.1", ngImport: i0, type: FormlyNzUploadModule, declarations: [FormlyFieldUpload, UploadComponent], imports: [CommonModule,
387
+ FormlyNzUploadModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.1", ngImport: i0, type: FormlyNzUploadModule, declarations: [FormlyFieldUpload, UploadNzComponent], imports: [CommonModule,
299
388
  ReactiveFormsModule,
300
389
  FormlyNzFormFieldModule,
301
390
  NzUploadModule,
@@ -319,7 +408,7 @@ FormlyNzUploadModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ve
319
408
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: FormlyNzUploadModule, decorators: [{
320
409
  type: NgModule,
321
410
  args: [{
322
- declarations: [FormlyFieldUpload, UploadComponent],
411
+ declarations: [FormlyFieldUpload, UploadNzComponent],
323
412
  imports: [
324
413
  CommonModule,
325
414
  ReactiveFormsModule,