ngx-formly-zorro-antd 17.2.3 → 17.3.1
Sign up to get free protection for your applications and to get access to all the features.
- package/button-group/button-group.type.d.ts +1 -2
- package/button-group/public_api.d.ts +1 -1
- package/card/card.type.d.ts +1 -2
- package/card/public_api.d.ts +1 -1
- package/cascader/cascader.type.d.ts +2 -3
- package/cascader/public_api.d.ts +1 -1
- package/checkbox/checkbox.type.d.ts +1 -2
- package/checkbox/public_api.d.ts +1 -1
- package/datepicker/public_api.d.ts +1 -0
- package/esm2022/button/button.type.mjs +6 -2
- package/esm2022/button-group/button-group.type.mjs +18 -4
- package/esm2022/button-group/public_api.mjs +1 -1
- package/esm2022/card/card.type.mjs +3 -7
- package/esm2022/card/public_api.mjs +1 -1
- package/esm2022/cascader/cascader.type.mjs +3 -3
- package/esm2022/cascader/public_api.mjs +1 -1
- package/esm2022/checkbox/checkbox.type.mjs +1 -1
- package/esm2022/checkbox/public_api.mjs +1 -1
- package/esm2022/common/interface.mjs +1 -1
- package/esm2022/datepicker/public_api.mjs +1 -1
- package/esm2022/flex/flex.type.mjs +1 -1
- package/esm2022/flex/public_api.mjs +1 -1
- package/esm2022/helpers/common.mjs +14 -0
- package/esm2022/helpers/formly.mjs +119 -0
- package/esm2022/helpers/ngx-formly-zorro-antd-helpers.mjs +5 -0
- package/esm2022/helpers/public_api.mjs +38 -0
- package/esm2022/input-number/public_api.mjs +1 -1
- package/esm2022/radio/public_api.mjs +1 -1
- package/esm2022/radio/radio.type.mjs +9 -45
- package/esm2022/rate/public_api.mjs +1 -1
- package/esm2022/rate/rate.type.mjs +1 -1
- package/esm2022/ref-template/public_api.mjs +1 -1
- package/esm2022/ref-template/ref-template.type.mjs +1 -1
- package/esm2022/select/public_api.mjs +1 -1
- package/esm2022/slider/public_api.mjs +1 -1
- package/esm2022/slider/slider.type.mjs +1 -1
- package/esm2022/space/public_api.mjs +1 -1
- package/esm2022/space/space.type.mjs +1 -1
- package/esm2022/switch/public_api.mjs +1 -1
- package/esm2022/switch/switch.type.mjs +1 -1
- package/esm2022/text-value/public_api.mjs +1 -1
- package/esm2022/text-value/text-value.type.mjs +1 -1
- package/esm2022/textarea/public_api.mjs +1 -1
- package/esm2022/textarea/textarea.type.mjs +3 -9
- package/esm2022/types/ngx-formly-zorro-antd-types.mjs +5 -0
- package/esm2022/types/public_api.mjs +2 -0
- package/fesm2022/ngx-formly-zorro-antd-button-group.mjs +17 -3
- package/fesm2022/ngx-formly-zorro-antd-button-group.mjs.map +1 -1
- package/fesm2022/ngx-formly-zorro-antd-button.mjs +5 -1
- package/fesm2022/ngx-formly-zorro-antd-button.mjs.map +1 -1
- package/fesm2022/ngx-formly-zorro-antd-card.mjs +2 -6
- package/fesm2022/ngx-formly-zorro-antd-card.mjs.map +1 -1
- package/fesm2022/ngx-formly-zorro-antd-cascader.mjs +2 -2
- package/fesm2022/ngx-formly-zorro-antd-cascader.mjs.map +1 -1
- package/fesm2022/ngx-formly-zorro-antd-checkbox.mjs.map +1 -1
- package/fesm2022/ngx-formly-zorro-antd-flex.mjs.map +1 -1
- package/fesm2022/ngx-formly-zorro-antd-helpers.mjs +174 -0
- package/fesm2022/ngx-formly-zorro-antd-helpers.mjs.map +1 -0
- package/fesm2022/ngx-formly-zorro-antd-radio.mjs +8 -44
- package/fesm2022/ngx-formly-zorro-antd-radio.mjs.map +1 -1
- package/fesm2022/ngx-formly-zorro-antd-rate.mjs.map +1 -1
- package/fesm2022/ngx-formly-zorro-antd-ref-template.mjs.map +1 -1
- package/fesm2022/ngx-formly-zorro-antd-slider.mjs.map +1 -1
- package/fesm2022/ngx-formly-zorro-antd-space.mjs.map +1 -1
- package/fesm2022/ngx-formly-zorro-antd-switch.mjs.map +1 -1
- package/fesm2022/ngx-formly-zorro-antd-text-value.mjs.map +1 -1
- package/fesm2022/ngx-formly-zorro-antd-textarea.mjs +2 -8
- package/fesm2022/ngx-formly-zorro-antd-textarea.mjs.map +1 -1
- package/fesm2022/ngx-formly-zorro-antd-types.mjs +4 -0
- package/fesm2022/ngx-formly-zorro-antd-types.mjs.map +1 -0
- package/flex/flex.type.d.ts +1 -2
- package/flex/public_api.d.ts +1 -1
- package/helpers/common.d.ts +9 -0
- package/helpers/formly.d.ts +70 -0
- package/helpers/index.d.ts +5 -0
- package/helpers/package.json +3 -0
- package/helpers/public_api.d.ts +37 -0
- package/input-number/public_api.d.ts +1 -0
- package/package.json +24 -12
- package/radio/public_api.d.ts +1 -1
- package/radio/radio.type.d.ts +1 -2
- package/rate/public_api.d.ts +1 -1
- package/rate/rate.type.d.ts +1 -2
- package/ref-template/public_api.d.ts +1 -1
- package/ref-template/ref-template.type.d.ts +1 -2
- package/select/public_api.d.ts +1 -0
- package/slider/public_api.d.ts +1 -1
- package/slider/slider.type.d.ts +1 -2
- package/space/public_api.d.ts +1 -1
- package/space/space.type.d.ts +1 -2
- package/switch/public_api.d.ts +1 -1
- package/switch/switch.type.d.ts +1 -2
- package/text-value/public_api.d.ts +1 -1
- package/text-value/text-value.type.d.ts +1 -2
- package/textarea/public_api.d.ts +1 -1
- package/textarea/textarea.type.d.ts +1 -2
- package/types/index.d.ts +5 -0
- package/types/package.json +3 -0
- package/types/public_api.d.ts +26 -0
@@ -0,0 +1,5 @@
|
|
1
|
+
/**
|
2
|
+
* Generated bundle index. Do not edit.
|
3
|
+
*/
|
4
|
+
export * from './public_api';
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWZvcm1seS16b3Jyby1hbnRkLXR5cGVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvZm9ybWx5YW50ZC90eXBlcy9uZ3gtZm9ybWx5LXpvcnJvLWFudGQtdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmR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|
33
33
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: FormlyFieldButtonGroup, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
34
34
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.0.9", type: FormlyFieldButtonGroup, selector: "formly-field-button-group", usesInheritance: true, ngImport: i0, template: `
|
35
|
-
<nz-button-group
|
35
|
+
<nz-button-group
|
36
|
+
[formlyAttributes]="field"
|
37
|
+
[nzSize]="props['size'] || 'default'"
|
38
|
+
[ngClass]="props['ngClass']"
|
39
|
+
[ngStyle]="props['ngStyle']"
|
40
|
+
>
|
36
41
|
@for (item of props.buttons; track item.id) {
|
37
42
|
<ng-container *ngTemplateOutlet="btnTemplate; context: { $implicit: item }"></ng-container>
|
38
43
|
}
|
@@ -48,6 +53,8 @@ class FormlyFieldButtonGroup extends FieldType {
|
|
48
53
|
[nzBlock]="item.props.block!!"
|
49
54
|
[nzDanger]="item.props.danger!!"
|
50
55
|
[nzGhost]="item.props.ghost!!"
|
56
|
+
[ngClass]="item.props['ngClass']"
|
57
|
+
[ngStyle]="item.props['ngStyle']"
|
51
58
|
[nzSize]="item.props.size || 'default'"
|
52
59
|
[nzLoading]="item.props.loading!!"
|
53
60
|
[nzShape]="item.props.shape ?? null"
|
@@ -64,14 +71,19 @@ class FormlyFieldButtonGroup extends FieldType {
|
|
64
71
|
}
|
65
72
|
</button>
|
66
73
|
</ng-template>
|
67
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "component", type: i2.NzButtonGroupComponent, selector: "nz-button-group", inputs: ["nzSize"], exportAs: ["nzButtonGroup"] }, { kind: "directive", type: i3.ɵ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: i4.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }, { kind: "directive", type: i5.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "directive", type: i6.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
74
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i2.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "component", type: i2.NzButtonGroupComponent, selector: "nz-button-group", inputs: ["nzSize"], exportAs: ["nzButtonGroup"] }, { kind: "directive", type: i3.ɵ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: i4.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }, { kind: "directive", type: i5.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "directive", type: i6.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
68
75
|
}
|
69
76
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: FormlyFieldButtonGroup, decorators: [{
|
70
77
|
type: Component,
|
71
78
|
args: [{
|
72
79
|
selector: 'formly-field-button-group',
|
73
80
|
template: `
|
74
|
-
<nz-button-group
|
81
|
+
<nz-button-group
|
82
|
+
[formlyAttributes]="field"
|
83
|
+
[nzSize]="props['size'] || 'default'"
|
84
|
+
[ngClass]="props['ngClass']"
|
85
|
+
[ngStyle]="props['ngStyle']"
|
86
|
+
>
|
75
87
|
@for (item of props.buttons; track item.id) {
|
76
88
|
<ng-container *ngTemplateOutlet="btnTemplate; context: { $implicit: item }"></ng-container>
|
77
89
|
}
|
@@ -87,6 +99,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImpor
|
|
87
99
|
[nzBlock]="item.props.block!!"
|
88
100
|
[nzDanger]="item.props.danger!!"
|
89
101
|
[nzGhost]="item.props.ghost!!"
|
102
|
+
[ngClass]="item.props['ngClass']"
|
103
|
+
[ngStyle]="item.props['ngStyle']"
|
90
104
|
[nzSize]="item.props.size || 'default'"
|
91
105
|
[nzLoading]="item.props.loading!!"
|
92
106
|
[nzShape]="item.props.shape ?? null"
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ngx-formly-zorro-antd-button-group.mjs","sources":["../../../../packages/formlyantd/button-group/src/button-group.type.ts","../../../../packages/formlyantd/button-group/src/button-group.module.ts","../../../../packages/formlyantd/button-group/src/ngx-formly-zorro-antd-button-group.ts"],"sourcesContent":["import { Component, Type, OnDestroy, ChangeDetectionStrategy } from '@angular/core';\nimport { FieldType, FieldTypeConfig } from '@ngx-formly/core';\nimport type { FormlyFieldProps } from 'ngx-formly-zorro-antd/form-field';\nimport { Subject } from 'rxjs';\nimport { NzFormlyFieldConfig } from 'ngx-formly-zorro-antd/common';\nimport { ButtonProps } from 'ngx-formly-zorro-antd/button';\n\nimport type { NzButtonGroupSize } from 'ng-zorro-antd/button';\n\
|
1
|
+
{"version":3,"file":"ngx-formly-zorro-antd-button-group.mjs","sources":["../../../../packages/formlyantd/button-group/src/button-group.type.ts","../../../../packages/formlyantd/button-group/src/button-group.module.ts","../../../../packages/formlyantd/button-group/src/ngx-formly-zorro-antd-button-group.ts"],"sourcesContent":["import { Component, Type, OnDestroy, ChangeDetectionStrategy } from '@angular/core';\nimport { FieldType, FieldTypeConfig } from '@ngx-formly/core';\nimport type { FormlyFieldProps } from 'ngx-formly-zorro-antd/form-field';\nimport { Subject } from 'rxjs';\nimport { NzFormlyFieldConfig } from 'ngx-formly-zorro-antd/common';\nimport { ButtonProps } from 'ngx-formly-zorro-antd/button';\n\nimport type { NzButtonGroupSize } from 'ng-zorro-antd/button';\n\nexport interface ButtonGroupProps extends FormlyFieldProps {\n size?: NzButtonGroupSize;\n\n /**\n * 每个按钮配置\n */\n buttons?: NzFormlyFieldConfig<Omit<ButtonProps, 'size' | 'textName'>>[];\n}\n\nexport interface FormlyButtonGroupFieldConfig extends NzFormlyFieldConfig<ButtonGroupProps> {\n type: 'button-group' | Type<FormlyFieldButtonGroup>;\n}\n\n@Component({\n selector: 'formly-field-button-group',\n template: `\n <nz-button-group\n [formlyAttributes]=\"field\"\n [nzSize]=\"props['size'] || 'default'\"\n [ngClass]=\"props['ngClass']\"\n [ngStyle]=\"props['ngStyle']\"\n >\n @for (item of props.buttons; track item.id) {\n <ng-container *ngTemplateOutlet=\"btnTemplate; context: { $implicit: item }\"></ng-container>\n }\n </nz-button-group>\n\n <ng-template #btnTemplate let-item>\n <button\n nz-button\n [formlyAttributes]=\"item\"\n [type]=\"item.type || 'button'\"\n [attr.title]=\"item.props['title']\"\n [disabled]=\"item.props.disabled!!\"\n [nzBlock]=\"item.props.block!!\"\n [nzDanger]=\"item.props.danger!!\"\n [nzGhost]=\"item.props.ghost!!\"\n [ngClass]=\"item.props['ngClass']\"\n [ngStyle]=\"item.props['ngStyle']\"\n [nzSize]=\"item.props.size || 'default'\"\n [nzLoading]=\"item.props.loading!!\"\n [nzShape]=\"item.props.shape ?? null\"\n [nzType]=\"item.props.nzType ?? null\"\n >\n @if (item.props.beforeIcon) {\n <span nz-icon [nzType]=\"item.props.beforeIcon\"></span>\n }\n @if (item.props.text) {\n <span>{{ item.props.text }}</span>\n }\n @if (item.props.afterIcon) {\n <span nz-icon [nzType]=\"item.props.afterIcon\"></span>\n }\n </button>\n </ng-template>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FormlyFieldButtonGroup extends FieldType<FieldTypeConfig<ButtonGroupProps>> implements OnDestroy {\n destroy$ = new Subject<void>();\n override defaultOptions = {\n props: {\n size: 'default' as const,\n buttons: []\n }\n };\n\n constructor() {\n super();\n }\n\n subjectDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n ngOnDestroy(): void {\n this.subjectDestroy();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\n\nimport { FormlyFieldButtonGroup } from './button-group.type';\nimport { NzButtonModule } from 'ng-zorro-antd/button';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\n\n@NgModule({\n declarations: [FormlyFieldButtonGroup],\n imports: [\n CommonModule,\n NzButtonModule,\n NzIconModule,\n\n FormlyModule.forChild({\n types: [\n {\n name: 'button-group',\n component: FormlyFieldButtonGroup\n }\n ]\n })\n ]\n})\nexport class FormlyNzButtonGroupModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api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AAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,sBAAsB,CAAC;AACtC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,cAAc;wBACd,YAAY;wBAEZ,YAAY,CAAC,QAAQ,CAAC;AACpB,4BAAA,KAAK,EAAE;AACL,gCAAA;AACE,oCAAA,IAAI,EAAE,cAAc;AACpB,oCAAA,SAAS,EAAE,sBAAsB;AAClC,iCAAA;AACF,6BAAA;yBACF,CAAC;AACH,qBAAA;AACF,iBAAA,CAAA;;;ACxBD;;AAEG;;;;"}
|
@@ -50,6 +50,7 @@ class FormlyFieldButton extends FieldType {
|
|
50
50
|
[nzDanger]="props['danger']!!"
|
51
51
|
[nzType]="props['nzType'] ?? 'link'"
|
52
52
|
[ngClass]="props['ngClass']"
|
53
|
+
[ngStyle]="props['ngStyle']"
|
53
54
|
>
|
54
55
|
@if (props['beforeIcon']) {
|
55
56
|
<span nz-icon [nzType]="props['beforeIcon']"></span>
|
@@ -80,6 +81,7 @@ class FormlyFieldButton extends FieldType {
|
|
80
81
|
[nzDanger]="props['danger']!!"
|
81
82
|
[nzType]="props['nzType'] ?? null"
|
82
83
|
[ngClass]="props['ngClass']"
|
84
|
+
[ngStyle]="props['ngStyle']"
|
83
85
|
nz-button
|
84
86
|
>
|
85
87
|
@if (props['beforeIcon']) {
|
@@ -97,7 +99,7 @@ class FormlyFieldButton extends FieldType {
|
|
97
99
|
}
|
98
100
|
</button>
|
99
101
|
}
|
100
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NzStringTemplateOutletDirective, selector: "[nzStringTemplateOutlet]", inputs: ["nzStringTemplateOutletContext", "nzStringTemplateOutlet"], exportAs: ["nzStringTemplateOutlet"] }, { kind: "component", type: i4.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i5.ɵ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: i6.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }, { kind: "directive", type: i7.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "directive", type: i8.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
102
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i3.NzStringTemplateOutletDirective, selector: "[nzStringTemplateOutlet]", inputs: ["nzStringTemplateOutletContext", "nzStringTemplateOutlet"], exportAs: ["nzStringTemplateOutlet"] }, { kind: "component", type: i4.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i5.ɵ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: i6.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }, { kind: "directive", type: i7.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "directive", type: i8.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
101
103
|
}
|
102
104
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: FormlyFieldButton, decorators: [{
|
103
105
|
type: Component,
|
@@ -117,6 +119,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImpor
|
|
117
119
|
[nzDanger]="props['danger']!!"
|
118
120
|
[nzType]="props['nzType'] ?? 'link'"
|
119
121
|
[ngClass]="props['ngClass']"
|
122
|
+
[ngStyle]="props['ngStyle']"
|
120
123
|
>
|
121
124
|
@if (props['beforeIcon']) {
|
122
125
|
<span nz-icon [nzType]="props['beforeIcon']"></span>
|
@@ -147,6 +150,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImpor
|
|
147
150
|
[nzDanger]="props['danger']!!"
|
148
151
|
[nzType]="props['nzType'] ?? null"
|
149
152
|
[ngClass]="props['ngClass']"
|
153
|
+
[ngStyle]="props['ngStyle']"
|
150
154
|
nz-button
|
151
155
|
>
|
152
156
|
@if (props['beforeIcon']) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ngx-formly-zorro-antd-button.mjs","sources":["../../../../packages/formlyantd/button/src/button.type.ts","../../../../packages/formlyantd/button/src/button.module.ts","../../../../packages/formlyantd/button/src/ngx-formly-zorro-antd-button.ts"],"sourcesContent":["import { Component, Type, TemplateRef, Optional, ChangeDetectionStrategy } from '@angular/core';\nimport { FieldType, FieldTypeConfig } from '@ngx-formly/core';\nimport type { FormlyFieldProps } from 'ngx-formly-zorro-antd/form-field';\nimport {\n NzFormlyFieldConfig,\n FormlyBoxTemplates,\n hasTplNameValue,\n resolveTplName\n} from 'ngx-formly-zorro-antd/common';\n\nimport type { NzButtonShape, NzButtonSize, NzButtonType } from 'ng-zorro-antd/button';\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nexport interface ButtonProps extends FormlyFieldProps {\n type?: 'a' | 'button';\n\n /**\n * 标题\n */\n title?: string;\n\n /**\n * form 名称\n */\n formName?: string;\n\n /**\n * 按钮内容文本\n */\n text?: string | TemplateRef<{ $implicit: NzSafeAny; options: ButtonProps }>;\n textName?: string;\n\n /**\n * 幽灵属性,使按钮背景透明\n * @default false\n */\n ghost?: boolean;\n\n /**\n * 设置按钮载入状态\n * @default false\n */\n loading?: boolean;\n\n /**\n * 设置按钮形状\n */\n shape?: NzButtonShape;\n\n /**\n * 设置按钮大小\n * @default default\n */\n size?: NzButtonSize;\n\n /**\n * 设置按钮类型\n */\n nzType?: NzButtonType;\n\n /**\n * 将按钮宽度调整为其父宽度的选项\n * @default false\n */\n block?: boolean;\n\n /**\n * 设置危险按钮\n * @default false\n */\n danger?: boolean;\n\n /**\n * 文字前面的图标\n */\n beforeIcon?: string;\n\n /**\n * 文字后面面的图标\n */\n afterIcon?: string;\n}\n\nexport interface FormlyButtonFieldConfig extends NzFormlyFieldConfig<ButtonProps> {\n type: 'button' | 'submit' | 'reset' | Type<FormlyFieldButton>;\n}\n\n@Component({\n selector: 'formly-field-button',\n template: `\n @if (props.type === 'a') {\n <a\n nz-button\n [formlyAttributes]=\"field\"\n [attr.title]=\"props['title']\"\n [nzGhost]=\"props['ghost']!!\"\n [nzLoading]=\"props['loading']!!\"\n [nzShape]=\"props['shape'] ?? null\"\n [nzSize]=\"props['size']!\"\n [nzBlock]=\"props['block']!!\"\n [nzDanger]=\"props['danger']!!\"\n [nzType]=\"props['nzType'] ?? 'link'\"\n [ngClass]=\"props['ngClass']\"\n >\n @if (props['beforeIcon']) {\n <span nz-icon [nzType]=\"props['beforeIcon']\"></span>\n }\n @if (hasText) {\n <ng-container\n *nzStringTemplateOutlet=\"text; context: { $implicit: field, options: props }\"\n >\n {{ text }}\n </ng-container>\n }\n @if (props['afterIcon']) {\n <span nz-icon [nzType]=\"props['afterIcon']\"></span>\n }\n </a>\n } @else {\n <button\n [formlyAttributes]=\"field\"\n [attr.type]=\"field.type\"\n [attr.form]=\"props['formName']\"\n [attr.title]=\"props['title']\"\n [disabled]=\"props['disabled'] || formControl.disabled!!\"\n [nzGhost]=\"props['ghost']!!\"\n [nzLoading]=\"props['loading']!!\"\n [nzShape]=\"props['shape'] ?? null\"\n [nzSize]=\"props['size']!\"\n [nzBlock]=\"props['block']!!\"\n [nzDanger]=\"props['danger']!!\"\n [nzType]=\"props['nzType'] ?? null\"\n [ngClass]=\"props['ngClass']\"\n nz-button\n >\n @if (props['beforeIcon']) {\n <span nz-icon [nzType]=\"props['beforeIcon']\"></span>\n }\n @if (hasText) {\n <ng-container\n *nzStringTemplateOutlet=\"text; context: { $implicit: field, options: props }\"\n >\n {{ text }}\n </ng-container>\n }\n @if (props['afterIcon']) {\n <span nz-icon [nzType]=\"props['afterIcon']\"></span>\n }\n </button>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FormlyFieldButton extends FieldType<FieldTypeConfig<ButtonProps>> {\n override defaultOptions = {\n props: {\n ghost: false,\n loading: false,\n block: false,\n size: 'default' as const,\n danger: false\n }\n };\n\n constructor(@Optional() public fieldTemplates: FormlyBoxTemplates) {\n super();\n }\n\n get hasText() {\n return hasTplNameValue(this.props, 'text');\n }\n\n get text() {\n return resolveTplName(this.props, this.fieldTemplates, 'text');\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\n\nimport { FormlyFieldButton } from './button.type';\nimport { NzOutletModule } from 'ng-zorro-antd/core/outlet';\nimport { NzButtonModule } from 'ng-zorro-antd/button';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\n\n@NgModule({\n declarations: [FormlyFieldButton],\n imports: [\n CommonModule,\n NzOutletModule,\n NzButtonModule,\n NzIconModule,\n\n FormlyModule.forChild({\n types: [\n {\n name: 'button',\n component: FormlyFieldButton\n },\n {\n name: 'submit',\n extends: 'button'\n },\n {\n name: 'reset',\n extends: 'button'\n }\n ]\n })\n ]\n})\nexport class FormlyNzButtonModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;;
|
1
|
+
{"version":3,"file":"ngx-formly-zorro-antd-button.mjs","sources":["../../../../packages/formlyantd/button/src/button.type.ts","../../../../packages/formlyantd/button/src/button.module.ts","../../../../packages/formlyantd/button/src/ngx-formly-zorro-antd-button.ts"],"sourcesContent":["import { Component, Type, TemplateRef, Optional, ChangeDetectionStrategy } from '@angular/core';\nimport { FieldType, FieldTypeConfig } from '@ngx-formly/core';\nimport type { FormlyFieldProps } from 'ngx-formly-zorro-antd/form-field';\nimport {\n NzFormlyFieldConfig,\n FormlyBoxTemplates,\n hasTplNameValue,\n resolveTplName\n} from 'ngx-formly-zorro-antd/common';\n\nimport type { NzButtonShape, NzButtonSize, NzButtonType } from 'ng-zorro-antd/button';\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nexport interface ButtonProps extends FormlyFieldProps {\n type?: 'a' | 'button';\n\n /**\n * 标题\n */\n title?: string;\n\n /**\n * form 名称\n */\n formName?: string;\n\n /**\n * 按钮内容文本\n */\n text?: string | TemplateRef<{ $implicit: NzSafeAny; options: ButtonProps }>;\n textName?: string;\n\n /**\n * 幽灵属性,使按钮背景透明\n * @default false\n */\n ghost?: boolean;\n\n /**\n * 设置按钮载入状态\n * @default false\n */\n loading?: boolean;\n\n /**\n * 设置按钮形状\n */\n shape?: NzButtonShape;\n\n /**\n * 设置按钮大小\n * @default default\n */\n size?: NzButtonSize;\n\n /**\n * 设置按钮类型\n */\n nzType?: NzButtonType;\n\n /**\n * 将按钮宽度调整为其父宽度的选项\n * @default false\n */\n block?: boolean;\n\n /**\n * 设置危险按钮\n * @default false\n */\n danger?: boolean;\n\n /**\n * 文字前面的图标\n */\n beforeIcon?: string;\n\n /**\n * 文字后面面的图标\n */\n afterIcon?: string;\n}\n\nexport interface FormlyButtonFieldConfig extends NzFormlyFieldConfig<ButtonProps> {\n type: 'button' | 'submit' | 'reset' | Type<FormlyFieldButton>;\n}\n\n@Component({\n selector: 'formly-field-button',\n template: `\n @if (props.type === 'a') {\n <a\n nz-button\n [formlyAttributes]=\"field\"\n [attr.title]=\"props['title']\"\n [nzGhost]=\"props['ghost']!!\"\n [nzLoading]=\"props['loading']!!\"\n [nzShape]=\"props['shape'] ?? null\"\n [nzSize]=\"props['size']!\"\n [nzBlock]=\"props['block']!!\"\n [nzDanger]=\"props['danger']!!\"\n [nzType]=\"props['nzType'] ?? 'link'\"\n [ngClass]=\"props['ngClass']\"\n [ngStyle]=\"props['ngStyle']\"\n >\n @if (props['beforeIcon']) {\n <span nz-icon [nzType]=\"props['beforeIcon']\"></span>\n }\n @if (hasText) {\n <ng-container\n *nzStringTemplateOutlet=\"text; context: { $implicit: field, options: props }\"\n >\n {{ text }}\n </ng-container>\n }\n @if (props['afterIcon']) {\n <span nz-icon [nzType]=\"props['afterIcon']\"></span>\n }\n </a>\n } @else {\n <button\n [formlyAttributes]=\"field\"\n [attr.type]=\"field.type\"\n [attr.form]=\"props['formName']\"\n [attr.title]=\"props['title']\"\n [disabled]=\"props['disabled'] || formControl.disabled!!\"\n [nzGhost]=\"props['ghost']!!\"\n [nzLoading]=\"props['loading']!!\"\n [nzShape]=\"props['shape'] ?? null\"\n [nzSize]=\"props['size']!\"\n [nzBlock]=\"props['block']!!\"\n [nzDanger]=\"props['danger']!!\"\n [nzType]=\"props['nzType'] ?? null\"\n [ngClass]=\"props['ngClass']\"\n [ngStyle]=\"props['ngStyle']\"\n nz-button\n >\n @if (props['beforeIcon']) {\n <span nz-icon [nzType]=\"props['beforeIcon']\"></span>\n }\n @if (hasText) {\n <ng-container\n *nzStringTemplateOutlet=\"text; context: { $implicit: field, options: props }\"\n >\n {{ text }}\n </ng-container>\n }\n @if (props['afterIcon']) {\n <span nz-icon [nzType]=\"props['afterIcon']\"></span>\n }\n </button>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FormlyFieldButton extends FieldType<FieldTypeConfig<ButtonProps>> {\n override defaultOptions = {\n props: {\n ghost: false,\n loading: false,\n block: false,\n size: 'default' as const,\n danger: false\n }\n };\n\n constructor(@Optional() public fieldTemplates: FormlyBoxTemplates) {\n super();\n }\n\n get hasText() {\n return hasTplNameValue(this.props, 'text');\n }\n\n get text() {\n return resolveTplName(this.props, this.fieldTemplates, 'text');\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\n\nimport { FormlyFieldButton } from './button.type';\nimport { NzOutletModule } from 'ng-zorro-antd/core/outlet';\nimport { NzButtonModule } from 'ng-zorro-antd/button';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\n\n@NgModule({\n declarations: [FormlyFieldButton],\n imports: [\n CommonModule,\n NzOutletModule,\n NzButtonModule,\n NzIconModule,\n\n FormlyModule.forChild({\n types: [\n {\n name: 'button',\n component: FormlyFieldButton\n },\n {\n name: 'submit',\n extends: 'button'\n },\n {\n name: 'reset',\n extends: 'button'\n }\n ]\n })\n ]\n})\nexport class FormlyNzButtonModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;;AA2JM,MAAO,iBAAkB,SAAQ,SAAuC,CAAA;AAW5E,IAAA,WAAA,CAA+B,cAAkC,EAAA;AAC/D,QAAA,KAAK,EAAE,CAAC;QADqB,IAAc,CAAA,cAAA,GAAd,cAAc,CAAoB;AAVxD,QAAA,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;AACL,gBAAA,KAAK,EAAE,KAAK;AACZ,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,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AAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,iBAAiB,CAAC;AACjC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,cAAc;wBACd,cAAc;wBACd,YAAY;wBAEZ,YAAY,CAAC,QAAQ,CAAC;AACpB,4BAAA,KAAK,EAAE;AACL,gCAAA;AACE,oCAAA,IAAI,EAAE,QAAQ;AACd,oCAAA,SAAS,EAAE,iBAAiB;AAC7B,iCAAA;AACD,gCAAA;AACE,oCAAA,IAAI,EAAE,QAAQ;AACd,oCAAA,OAAO,EAAE,QAAQ;AAClB,iCAAA;AACD,gCAAA;AACE,oCAAA,IAAI,EAAE,OAAO;AACb,oCAAA,OAAO,EAAE,QAAQ;AAClB,iCAAA;AACF,6BAAA;yBACF,CAAC;AACH,qBAAA;AACF,iBAAA,CAAA;;;AClCD;;AAEG;;;;"}
|
@@ -57,9 +57,7 @@ class FormlyFieldCard extends FieldType {
|
|
57
57
|
@for (g of field.fieldGroup; track g.id) {
|
58
58
|
<formly-field [field]="g"></formly-field>
|
59
59
|
}
|
60
|
-
<ng-container
|
61
|
-
*nzStringTemplateOutlet="nzContent; context: { $implicit: field, options: props }"
|
62
|
-
>
|
60
|
+
<ng-container *nzStringTemplateOutlet="nzContent; context: { $implicit: field, options: props }">
|
63
61
|
{{ nzContent }}
|
64
62
|
</ng-container>
|
65
63
|
</nz-card>
|
@@ -88,9 +86,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImpor
|
|
88
86
|
@for (g of field.fieldGroup; track g.id) {
|
89
87
|
<formly-field [field]="g"></formly-field>
|
90
88
|
}
|
91
|
-
<ng-container
|
92
|
-
*nzStringTemplateOutlet="nzContent; context: { $implicit: field, options: props }"
|
93
|
-
>
|
89
|
+
<ng-container *nzStringTemplateOutlet="nzContent; context: { $implicit: field, options: props }">
|
94
90
|
{{ nzContent }}
|
95
91
|
</ng-container>
|
96
92
|
</nz-card>
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ngx-formly-zorro-antd-card.mjs","sources":["../../../../packages/formlyantd/card/src/card.type.ts","../../../../packages/formlyantd/card/src/card.module.ts","../../../../packages/formlyantd/card/src/ngx-formly-zorro-antd-card.ts"],"sourcesContent":["import { Component, TemplateRef, Type, Optional, ChangeDetectionStrategy } from '@angular/core';\nimport { FieldType, FieldTypeConfig } from '@ngx-formly/core';\nimport {
|
1
|
+
{"version":3,"file":"ngx-formly-zorro-antd-card.mjs","sources":["../../../../packages/formlyantd/card/src/card.type.ts","../../../../packages/formlyantd/card/src/card.module.ts","../../../../packages/formlyantd/card/src/ngx-formly-zorro-antd-card.ts"],"sourcesContent":["import { Component, TemplateRef, Type, Optional, ChangeDetectionStrategy } from '@angular/core';\nimport { FieldType, FieldTypeConfig } from '@ngx-formly/core';\nimport { FormlyBoxTemplates, resolveTplName, resolveTplNameArray } from 'ngx-formly-zorro-antd/common';\nimport type { NzFormlyFieldConfig } from 'ngx-formly-zorro-antd/common';\nimport { CardWrapperProps } from 'ngx-formly-zorro-antd/card-wrapper';\n\nexport interface CardProps extends CardWrapperProps {\n /**\n * 内容\n */\n content?: string | TemplateRef<{ $implicit: CardProps; options: CardProps }>;\n contentName?: string;\n}\n\nexport interface FormlyCardFieldConfig extends NzFormlyFieldConfig<CardProps> {\n type: 'card' | Type<FormlyFieldCard>;\n}\n\n@Component({\n selector: 'formly-field-card',\n template: `\n <nz-card\n [nzActions]=\"nzActions\"\n [formlyAttributes]=\"field\"\n [ngClass]=\"props['ngClass']\"\n [nzBodyStyle]=\"props['bodyStyle'] ?? null\"\n [nzSize]=\"props['size']!\"\n [nzBorderless]=\"props['borderless']!!\"\n [nzCover]=\"nzCover\"\n [nzExtra]=\"nzExtra\"\n [nzHoverable]=\"props['hoverable']!!\"\n [nzLoading]=\"props['loading']!!\"\n [nzTitle]=\"nzTitle\"\n [nzBordered]=\"props['bordered']!!\"\n [nzType]=\"props['type'] ?? null\"\n >\n @for (g of field.fieldGroup; track g.id) {\n <formly-field [field]=\"g\"></formly-field>\n }\n <ng-container *nzStringTemplateOutlet=\"nzContent; context: { $implicit: field, options: props }\">\n {{ nzContent }}\n </ng-container>\n </nz-card>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FormlyFieldCard extends FieldType<FieldTypeConfig<CardProps>> {\n override defaultOptions = {\n props: {\n bordered: true,\n type: 'button'\n }\n };\n\n constructor(@Optional() public fieldTemplates: FormlyBoxTemplates) {\n super();\n }\n\n get nzTitle() {\n return resolveTplName(this.props, this.fieldTemplates, 'title');\n }\n get nzCover() {\n return resolveTplName(this.props, this.fieldTemplates, 'cover');\n }\n get nzExtra() {\n return resolveTplName(this.props, this.fieldTemplates, 'extra');\n }\n get nzActions() {\n return resolveTplNameArray(this.props, this.fieldTemplates, 'actions') || [];\n }\n get nzContent() {\n return resolveTplName(this.props, this.fieldTemplates, 'content');\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { NzOutletModule } from 'ng-zorro-antd/core/outlet';\nimport { FormlyFieldCard } from './card.type';\nimport { NzCardModule } from 'ng-zorro-antd/card';\n\nconst COMPONENT = FormlyFieldCard;\n\n@NgModule({\n declarations: [COMPONENT],\n imports: [\n CommonModule,\n NzCardModule,\n NzOutletModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'card',\n component: COMPONENT\n }\n ]\n })\n ]\n})\nexport class FormlyNzCardModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;AA8CM,MAAO,eAAgB,SAAQ,SAAqC,CAAA;AAQxE,IAAA,WAAA,CAA+B,cAAkC,EAAA;AAC/D,QAAA,KAAK,EAAE,CAAC;QADqB,IAAc,CAAA,cAAA,GAAd,cAAc,CAAoB;AAPxD,QAAA,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;AACL,gBAAA,QAAQ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
70
|
[nzColumnClassName]="props['columnClassName']"
|
71
71
|
[nzExpandIcon]="nzExpandIcon!"
|
72
72
|
[nzExpandTrigger]="props['expandTrigger']!"
|
73
|
-
[nzLabelProperty]="props['labelProperty']"
|
73
|
+
[nzLabelProperty]="props['labelProperty'] ?? ''"
|
74
74
|
[nzLabelRender]="nzLabelRender ?? null"
|
75
75
|
[nzLoadData]="props['loadData']"
|
76
76
|
[nzMenuClassName]="props['menuClassName']"
|
@@ -108,7 +108,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImpor
|
|
108
108
|
[nzColumnClassName]="props['columnClassName']"
|
109
109
|
[nzExpandIcon]="nzExpandIcon!"
|
110
110
|
[nzExpandTrigger]="props['expandTrigger']!"
|
111
|
-
[nzLabelProperty]="props['labelProperty']"
|
111
|
+
[nzLabelProperty]="props['labelProperty'] ?? ''"
|
112
112
|
[nzLabelRender]="nzLabelRender ?? null"
|
113
113
|
[nzLoadData]="props['loadData']"
|
114
114
|
[nzMenuClassName]="props['menuClassName']"
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ngx-formly-zorro-antd-cascader.mjs","sources":["../../../../packages/formlyantd/cascader/src/cascader.type.ts","../../../../packages/formlyantd/cascader/src/cascader.module.ts","../../../../packages/formlyantd/cascader/src/ngx-formly-zorro-antd-cascader.ts"],"sourcesContent":["import {\n Component,\n TemplateRef,\n Optional,\n Type,\n ChangeDetectionStrategy,\n OnInit\n} from '@angular/core';\nimport { FieldType, FieldTypeConfig } from '@ngx-formly/core';\nimport { FormlyFieldProps } from 'ngx-formly-zorro-antd/form-field';\n\nimport type {\n NzCascaderOption,\n NzShowSearchOptions,\n NzCascaderExpandTrigger,\n NzCascaderSize\n} from 'ng-zorro-antd/cascader';\nimport type { NzSafeAny, NzStatus, NgStyleInterface } from 'ng-zorro-antd/core/types';\nimport type { NzFormlyFieldConfig, FormlyAttributeEvent } from 'ngx-formly-zorro-antd/common';\nimport { resolveTplName, FormlyBoxTemplates } from 'ngx-formly-zorro-antd/common';\n\ninterface CascaderProps extends FormlyFieldProps {\n /**\n * 是否支持清除\n * @default true\n */\n allowClear?: boolean;\n\n /**\n * 是否自动聚焦,当存在输入框时\n * @default false\n */\n autoFocus?: boolean;\n\n /**\n * 浮层是否应带有背景板\n * @default false\n */\n backdrop?: boolean;\n\n /**\n * 点击父级菜单选项时,可通过该函数判断是否允许值的变化\n */\n changeOn?: (option: NzSafeAny, index: number) => boolean;\n\n /**\n * 当此项为 true 时,点选每级菜单选项值都会发生变化,具体见上面的演示\n * @default false\n */\n changeOnSelect?: boolean;\n\n /**\n * 自定义浮层列类名\n */\n columnClassName?: string;\n\n /**\n * 自定义次级菜单展开图标\n */\n expandIcon?: string | TemplateRef<void>;\n expandIconName?: string;\n\n /**\n * 次级菜单的展开方式\n * @default 'click'\n */\n expandTrigger?: NzCascaderExpandTrigger;\n\n /**\n * 选项的显示值的属性名\n * @default 'label'\n */\n labelProperty: string;\n\n /**\n * 选择后展示的渲染模板\n */\n labelRender?: TemplateRef<NzSafeAny> | null;\n labelRenderName?: string;\n\n /**\n * 用于动态加载选项。如果提供了ngModel初始值,且未提供nzOptions值,则会立即触发动态加载。\n */\n loadData?: (option: NzSafeAny, index?: number) => PromiseLike<NzSafeAny>;\n\n /**\n * 自定义浮层类名\n */\n menuClassName?: string;\n\n /**\n * 自定义浮层样式\n */\n menuStyle?: NgStyleInterface | null;\n\n /**\n * 当下拉列表为空时显示的内容\n */\n notFoundContent?: string | TemplateRef<void>;\n notFoundContentName?: string;\n\n /**\n * 选项的渲染模板\n */\n optionRender?: TemplateRef<{ $implicit: NzCascaderOption; index: number }> | null;\n optionRenderName?: string;\n\n /**\n * 是否显示箭头\n * @default true\n */\n showArrow?: boolean;\n\n /**\n * 显示输入框\n * @default true\n */\n showInput?: boolean;\n\n /**\n * 是否支持搜索,默认情况下对 label 进行全匹配搜索,不能和 [nzLoadData] 同时使用\n * @default false\n */\n showSearch?: boolean | NzShowSearchOptions;\n\n /**\n * 输入框大小\n * @default default\n */\n size?: NzCascaderSize;\n\n /**\n * 设置校验状态\n */\n status?: NzStatus;\n\n /**\n * 自定义的选择框后缀图标\n */\n suffixIcon?: string | TemplateRef<void>;\n suffixIconName?: string;\n\n /**\n * 选项的实际值的属性名\n * @default 'value'\n */\n valueProperty?: string;\n\n /**\n * 可选项数据源\n */\n cascaderOptions?: NzCascaderOption[] | null;\n\n /**\n * 清除值时触发\n */\n onClear?: FormlyAttributeEvent;\n /**\n * 菜单浮层的显示/隐藏\n */\n visibleChange?: FormlyAttributeEvent<boolean>;\n\n /**\n * 值发生变化时触发\n */\n selectionChange?: FormlyAttributeEvent<NzCascaderOption[]>;\n}\n\nexport interface FormlyCascaderFieldConfig extends NzFormlyFieldConfig<CascaderProps> {\n type: 'cascader' | Type<FormlyFieldCascader>;\n}\n\n@Component({\n selector: 'formly-field-cascader',\n template: `<nz-cascader\n #cascader\n [nzPlaceHolder]=\"props.placeholder ?? ''\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [ngClass]=\"props['ngClass']\"\n [nzAllowClear]=\"props['allowClear']!!\"\n [nzAutoFocus]=\"props['autoFocus']!!\"\n [nzBackdrop]=\"props['backdrop']!!\"\n [nzChangeOn]=\"props['changeOn']\"\n [nzChangeOnSelect]=\"props['changeOnSelect']!!\"\n [nzColumnClassName]=\"props['columnClassName']\"\n [nzExpandIcon]=\"nzExpandIcon!\"\n [nzExpandTrigger]=\"props['expandTrigger']!\"\n [nzLabelProperty]=\"props['labelProperty']\"\n [nzLabelRender]=\"nzLabelRender ?? null\"\n [nzLoadData]=\"props['loadData']\"\n [nzMenuClassName]=\"props['menuClassName']\"\n [nzMenuStyle]=\"props['menuStyle'] ?? null\"\n [nzNotFoundContent]=\"nzNotFoundContent\"\n [nzOptionRender]=\"nzOptionRender ?? null\"\n [nzOptions]=\"props['cascaderOptions'] ?? null\"\n [nzShowArrow]=\"props['showArrow']!!\"\n [nzShowInput]=\"props['showInput']!!\"\n [nzShowSearch]=\"props['showSearch']!!\"\n [nzSize]=\"props['size']!\"\n [nzStatus]=\"props['status'] ?? ''\"\n [nzSuffixIcon]=\"nzSuffixIcon!\"\n [nzValueProperty]=\"props['valueProperty']!\"\n (nzClear)=\"props['onClear'] && props['onClear'](field)\"\n (nzVisibleChange)=\"props['visibleChange'] && props['visibleChange'](field, $event)\"\n (nzSelectionChange)=\"props['selectionChange'] && props['selectionChange'](field, $event)\"\n ></nz-cascader>`,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FormlyFieldCascader\n extends FieldType<FieldTypeConfig<CascaderProps>>\n implements OnInit\n{\n override defaultOptions = {\n props: {\n placeholder: '请选择',\n allowClear: true,\n backdrop: false,\n changeOnSelect: false,\n expandTrigger: 'click' as const,\n labelProperty: 'label',\n showArrow: true,\n showInput: true,\n showSearch: false,\n size: 'default' as const,\n status: '' as const,\n valueProperty: 'value',\n cascaderOptions: []\n }\n };\n constructor(@Optional() public fieldTemplates: FormlyBoxTemplates) {\n super();\n }\n\n get nzNotFoundContent() {\n return resolveTplName(this.props, this.fieldTemplates, 'notFoundContent');\n }\n\n get nzExpandIcon() {\n return resolveTplName(this.props, this.fieldTemplates, 'expandIcon');\n }\n\n get nzLabelRender() {\n return resolveTplName(this.props, this.fieldTemplates, 'labelRender');\n }\n\n get nzOptionRender() {\n return resolveTplName(this.props, this.fieldTemplates, 'optionRender');\n }\n\n get nzSuffixIcon() {\n return resolveTplName(this.props, this.fieldTemplates, 'suffixIcon');\n }\n\n ngOnInit(): void {\n const options = this.props['cascaderOptions'];\n if (!options || options.length === 0) {\n this.props['cascaderOptions'] = this.props.options as NzSafeAny;\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FormlyNzFormFieldModule } from 'ngx-formly-zorro-antd/form-field';\nimport { NzCascaderModule } from 'ng-zorro-antd/cascader';\nimport { FormlyFieldCascader } from './cascader.type';\n\n@NgModule({\n declarations: [FormlyFieldCascader],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n FormlyNzFormFieldModule,\n NzCascaderModule,\n\n FormlyModule.forChild({\n types: [\n {\n name: 'cascader',\n component: FormlyFieldCascader,\n wrappers: ['form-field']\n }\n ]\n })\n ]\n})\nexport class FormlyNzCascaderModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;AAiNM,MAAO,mBACX,SAAQ,SAAyC,CAAA;AAoBjD,IAAA,WAAA,CAA+B,cAAkC,EAAA;AAC/D,QAAA,KAAK,EAAE,CAAC;QADqB,IAAc,CAAA,cAAA,GAAd,cAAc,CAAoB;AAjBxD,QAAA,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;AACL,gBAAA,WAAW,EAAE,KAAK;AAClB,gBAAA,UAAU,EAAE,IAAI;AAChB,gBAAA,QAAQ,EAAE,KAAK;AACf,gBAAA,cAAc,EAAE,KAAK;AACrB,gBAAA,aAAa,EAAE,OAAgB;AAC/B,gBAAA,aAAa,EAAE,OAAO;AACtB,gBAAA,SAAS,EAAE,IAAI;AACf,gBAAA,SAAS,EAAE,IAAI;AACf,gBAAA,UAAU,EAAE,KAAK;AACjB,gBAAA,IAAI,EAAE,SAAkB;AACxB,gBAAA,MAAM,EAAE,EAAW;AACnB,gBAAA,aAAa,EAAE,OAAO;AACtB,gBAAA,eAAe,EAAE,EAAE;AACpB,aAAA;SACF,CAAC;KAGD;AAED,IAAA,IAAI,iBAAiB,GAAA;AACnB,QAAA,OAAO,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;KAC3E;AAED,IAAA,IAAI,YAAY,GAAA;AACd,QAAA,OAAO,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,YAAY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O,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,uBAAuB;wBACvB,gBAAgB;wBAEhB,YAAY,CAAC,QAAQ,CAAC;AACpB,4BAAA,KAAK,EAAE;AACL,gCAAA;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;;;AC1BD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"ngx-formly-zorro-antd-cascader.mjs","sources":["../../../../packages/formlyantd/cascader/src/cascader.type.ts","../../../../packages/formlyantd/cascader/src/cascader.module.ts","../../../../packages/formlyantd/cascader/src/ngx-formly-zorro-antd-cascader.ts"],"sourcesContent":["import { Component, TemplateRef, Optional, Type, ChangeDetectionStrategy, OnInit } from '@angular/core';\nimport { FieldType, FieldTypeConfig } from '@ngx-formly/core';\nimport { FormlyFieldProps } from 'ngx-formly-zorro-antd/form-field';\n\nimport type {\n NzCascaderOption,\n NzShowSearchOptions,\n NzCascaderExpandTrigger,\n NzCascaderSize\n} from 'ng-zorro-antd/cascader';\nimport type { NzSafeAny, NzStatus, NgStyleInterface } from 'ng-zorro-antd/core/types';\nimport type { NzFormlyFieldConfig, FormlyAttributeEvent } from 'ngx-formly-zorro-antd/common';\nimport { resolveTplName, FormlyBoxTemplates } from 'ngx-formly-zorro-antd/common';\n\nexport interface CascaderProps extends FormlyFieldProps {\n /**\n * 是否支持清除\n * @default true\n */\n allowClear?: boolean;\n\n /**\n * 是否自动聚焦,当存在输入框时\n * @default false\n */\n autoFocus?: boolean;\n\n /**\n * 浮层是否应带有背景板\n * @default false\n */\n backdrop?: boolean;\n\n /**\n * 点击父级菜单选项时,可通过该函数判断是否允许值的变化\n */\n changeOn?: (option: NzSafeAny, index: number) => boolean;\n\n /**\n * 当此项为 true 时,点选每级菜单选项值都会发生变化,具体见上面的演示\n * @default false\n */\n changeOnSelect?: boolean;\n\n /**\n * 自定义浮层列类名\n */\n columnClassName?: string;\n\n /**\n * 自定义次级菜单展开图标\n */\n expandIcon?: string | TemplateRef<void>;\n expandIconName?: string;\n\n /**\n * 次级菜单的展开方式\n * @default 'click'\n */\n expandTrigger?: NzCascaderExpandTrigger;\n\n /**\n * 选项的显示值的属性名\n * @default 'label'\n */\n labelProperty?: string;\n\n /**\n * 选择后展示的渲染模板\n */\n labelRender?: TemplateRef<NzSafeAny> | null;\n labelRenderName?: string;\n\n /**\n * 用于动态加载选项。如果提供了ngModel初始值,且未提供nzOptions值,则会立即触发动态加载。\n */\n loadData?: (option: NzSafeAny, index?: number) => PromiseLike<NzSafeAny>;\n\n /**\n * 自定义浮层类名\n */\n menuClassName?: string;\n\n /**\n * 自定义浮层样式\n */\n menuStyle?: NgStyleInterface | null;\n\n /**\n * 当下拉列表为空时显示的内容\n */\n notFoundContent?: string | TemplateRef<void>;\n notFoundContentName?: string;\n\n /**\n * 选项的渲染模板\n */\n optionRender?: TemplateRef<{ $implicit: NzCascaderOption; index: number }> | null;\n optionRenderName?: string;\n\n /**\n * 是否显示箭头\n * @default true\n */\n showArrow?: boolean;\n\n /**\n * 显示输入框\n * @default true\n */\n showInput?: boolean;\n\n /**\n * 是否支持搜索,默认情况下对 label 进行全匹配搜索,不能和 [nzLoadData] 同时使用\n * @default false\n */\n showSearch?: boolean | NzShowSearchOptions;\n\n /**\n * 输入框大小\n * @default default\n */\n size?: NzCascaderSize;\n\n /**\n * 设置校验状态\n */\n status?: NzStatus;\n\n /**\n * 自定义的选择框后缀图标\n */\n suffixIcon?: string | TemplateRef<void>;\n suffixIconName?: string;\n\n /**\n * 选项的实际值的属性名\n * @default 'value'\n */\n valueProperty?: string;\n\n /**\n * 可选项数据源\n */\n cascaderOptions?: NzCascaderOption[] | null;\n\n /**\n * 清除值时触发\n */\n onClear?: FormlyAttributeEvent;\n /**\n * 菜单浮层的显示/隐藏\n */\n visibleChange?: FormlyAttributeEvent<boolean>;\n\n /**\n * 值发生变化时触发\n */\n selectionChange?: FormlyAttributeEvent<NzCascaderOption[]>;\n}\n\nexport interface FormlyCascaderFieldConfig extends NzFormlyFieldConfig<CascaderProps> {\n type: 'cascader' | Type<FormlyFieldCascader>;\n}\n\n@Component({\n selector: 'formly-field-cascader',\n template: `<nz-cascader\n #cascader\n [nzPlaceHolder]=\"props.placeholder ?? ''\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [ngClass]=\"props['ngClass']\"\n [nzAllowClear]=\"props['allowClear']!!\"\n [nzAutoFocus]=\"props['autoFocus']!!\"\n [nzBackdrop]=\"props['backdrop']!!\"\n [nzChangeOn]=\"props['changeOn']\"\n [nzChangeOnSelect]=\"props['changeOnSelect']!!\"\n [nzColumnClassName]=\"props['columnClassName']\"\n [nzExpandIcon]=\"nzExpandIcon!\"\n [nzExpandTrigger]=\"props['expandTrigger']!\"\n [nzLabelProperty]=\"props['labelProperty'] ?? ''\"\n [nzLabelRender]=\"nzLabelRender ?? null\"\n [nzLoadData]=\"props['loadData']\"\n [nzMenuClassName]=\"props['menuClassName']\"\n [nzMenuStyle]=\"props['menuStyle'] ?? null\"\n [nzNotFoundContent]=\"nzNotFoundContent\"\n [nzOptionRender]=\"nzOptionRender ?? null\"\n [nzOptions]=\"props['cascaderOptions'] ?? null\"\n [nzShowArrow]=\"props['showArrow']!!\"\n [nzShowInput]=\"props['showInput']!!\"\n [nzShowSearch]=\"props['showSearch']!!\"\n [nzSize]=\"props['size']!\"\n [nzStatus]=\"props['status'] ?? ''\"\n [nzSuffixIcon]=\"nzSuffixIcon!\"\n [nzValueProperty]=\"props['valueProperty']!\"\n (nzClear)=\"props['onClear'] && props['onClear'](field)\"\n (nzVisibleChange)=\"props['visibleChange'] && props['visibleChange'](field, $event)\"\n (nzSelectionChange)=\"props['selectionChange'] && props['selectionChange'](field, $event)\"\n ></nz-cascader>`,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FormlyFieldCascader extends FieldType<FieldTypeConfig<CascaderProps>> implements OnInit {\n override defaultOptions = {\n props: {\n placeholder: '请选择',\n allowClear: true,\n backdrop: false,\n changeOnSelect: false,\n expandTrigger: 'click' as const,\n labelProperty: 'label',\n showArrow: true,\n showInput: true,\n showSearch: false,\n size: 'default' as const,\n status: '' as const,\n valueProperty: 'value',\n cascaderOptions: []\n }\n };\n constructor(@Optional() public fieldTemplates: FormlyBoxTemplates) {\n super();\n }\n\n get nzNotFoundContent() {\n return resolveTplName(this.props, this.fieldTemplates, 'notFoundContent');\n }\n\n get nzExpandIcon() {\n return resolveTplName(this.props, this.fieldTemplates, 'expandIcon');\n }\n\n get nzLabelRender() {\n return resolveTplName(this.props, this.fieldTemplates, 'labelRender');\n }\n\n get nzOptionRender() {\n return resolveTplName(this.props, this.fieldTemplates, 'optionRender');\n }\n\n get nzSuffixIcon() {\n return resolveTplName(this.props, this.fieldTemplates, 'suffixIcon');\n }\n\n ngOnInit(): void {\n const options = this.props['cascaderOptions'];\n if (!options || options.length === 0) {\n this.props['cascaderOptions'] = this.props.options as NzSafeAny;\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FormlyNzFormFieldModule } from 'ngx-formly-zorro-antd/form-field';\nimport { NzCascaderModule } from 'ng-zorro-antd/cascader';\nimport { FormlyFieldCascader } from './cascader.type';\n\n@NgModule({\n declarations: [FormlyFieldCascader],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n FormlyNzFormFieldModule,\n NzCascaderModule,\n\n FormlyModule.forChild({\n types: [\n {\n name: 'cascader',\n component: FormlyFieldCascader,\n wrappers: ['form-field']\n }\n ]\n })\n ]\n})\nexport class FormlyNzCascaderModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;AA0MM,MAAO,mBAAoB,SAA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
1
|
-
{"version":3,"file":"ngx-formly-zorro-antd-checkbox.mjs","sources":["../../../../packages/formlyantd/checkbox/src/checkbox.type.ts","../../../../packages/formlyantd/checkbox/src/checkbox.module.ts","../../../../packages/formlyantd/checkbox/src/ngx-formly-zorro-antd-checkbox.ts"],"sourcesContent":["import { Component, Type, ChangeDetectionStrategy } from '@angular/core';\nimport { FieldType, FieldTypeConfig } from '@ngx-formly/core';\nimport type { NzFormlyFieldConfig, FormlyAttributeEvent } from 'ngx-formly-zorro-antd/common';\nimport type { FormlyFieldProps } from 'ngx-formly-zorro-antd/form-field';\n\
|
1
|
+
{"version":3,"file":"ngx-formly-zorro-antd-checkbox.mjs","sources":["../../../../packages/formlyantd/checkbox/src/checkbox.type.ts","../../../../packages/formlyantd/checkbox/src/checkbox.module.ts","../../../../packages/formlyantd/checkbox/src/ngx-formly-zorro-antd-checkbox.ts"],"sourcesContent":["import { Component, Type, ChangeDetectionStrategy } from '@angular/core';\nimport { FieldType, FieldTypeConfig } from '@ngx-formly/core';\nimport type { NzFormlyFieldConfig, FormlyAttributeEvent } from 'ngx-formly-zorro-antd/common';\nimport type { FormlyFieldProps } from 'ngx-formly-zorro-antd/form-field';\n\nexport interface CheckboxProps extends FormlyFieldProps {\n type?: 'group' | 'single';\n\n /**\n * 自动获取焦点\n * @default false\n */\n autoFocus?: boolean;\n\n /**\n * 设置 indeterminate 状态,只负责样式控制\n * @default false\n */\n indeterminate?: boolean;\n\n /**\n * 数值改变时回调\n */\n modelChange?: FormlyAttributeEvent<boolean | null | undefined>;\n}\n\nexport interface FormlyCheckboxFieldConfig extends NzFormlyFieldConfig<CheckboxProps> {\n type: 'checkbox' | 'boolean' | Type<FormlyFieldCheckbox>;\n}\n\n@Component({\n selector: 'formly-field-checkbox',\n template: `\n @if (props.type !== 'group') {\n <label\n [ngClass]=\"props['ngClass']\"\n [ngStyle]=\"props['ngStyle']\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [nzIndeterminate]=\"props['indeterminate'] && formControl.value == null\"\n (ngModelChange)=\"props['modelChange'] && props['modelChange'](field, $event)\"\n nz-checkbox\n >\n {{ props.label }}\n </label>\n } @else {\n <nz-checkbox-group\n [formlyAttributes]=\"field\"\n [(ngModel)]=\"props.options\"\n [formControl]=\"formControl\"\n (ngModelChange)=\"props['modelChange']?.(field, $event)\"\n ></nz-checkbox-group>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FormlyFieldCheckbox extends FieldType<FieldTypeConfig<CheckboxProps>> {\n override defaultOptions = {\n props: {\n indeterminate: false,\n hideLabel: true\n }\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FormlyNzFormFieldModule } from 'ngx-formly-zorro-antd/form-field';\n\nimport { NzCheckboxModule } from 'ng-zorro-antd/checkbox';\n\nimport { FormlyFieldCheckbox } from './checkbox.type';\n\n@NgModule({\n declarations: [FormlyFieldCheckbox],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n FormlyNzFormFieldModule,\n\n NzCheckboxModule,\n\n FormlyModule.forChild({\n types: [\n {\n name: 'checkbox',\n component: FormlyFieldCheckbox,\n wrappers: ['form-field']\n },\n {\n name: 'boolean',\n extends: 'checkbox'\n }\n ]\n })\n ]\n})\nexport class FormlyNzCheckboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;AAwDM,MAAO,mBAAoB,SAAQ,SAAyC,CAAA;AA1BlF,IAAA,WAAA,GAAA;;AA2BW,QAAA,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;AACL,gBAAA,aAAa,EAAE,KAAK;AACpB,gBAAA,SAAS,EAAE,IAAI;AAChB,aAAA;SACF,CAAC;AACH,KAAA;8GAPY,mBAAmB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA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hB,YAAY,CAAC,QAAQ,CAAC;AACpB,gBAAA,KAAK,EAAE;AACL,oBAAA;AACE,wBAAA,IAAI,EAAE,UAAU;AAChB,wBAAA,SAAS,EAAE,mBAAmB;wBAC9B,QAAQ,EAAE,CAAC,YAAY,CAAC;AACzB,qBAAA;AACD,oBAAA;AACE,wBAAA,IAAI,EAAE,SAAS;AACf,wBAAA,OAAO,EAAE,UAAU;AACpB,qBAAA;AACF,iBAAA;aACF,CAAC,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAGO,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAxBlC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,mBAAmB,CAAC;AACnC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,uBAAuB;wBAEvB,gBAAgB;wBAEhB,YAAY,CAAC,QAAQ,CAAC;AACpB,4BAAA,KAAK,EAAE;AACL,gCAAA;AACE,oCAAA,IAAI,EAAE,UAAU;AAChB,oCAAA,SAAS,EAAE,mBAAmB;oCAC9B,QAAQ,EAAE,CAAC,YAAY,CAAC;AACzB,iCAAA;AACD,gCAAA;AACE,oCAAA,IAAI,EAAE,SAAS;AACf,oCAAA,OAAO,EAAE,UAAU;AACpB,iCAAA;AACF,6BAAA;yBACF,CAAC;AACH,qBAAA;AACF,iBAAA,CAAA;;;ACjCD;;AAEG;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ngx-formly-zorro-antd-flex.mjs","sources":["../../../../packages/formlyantd/flex/src/flex.type.ts","../../../../packages/formlyantd/flex/src/flex.module.ts","../../../../packages/formlyantd/flex/src/ngx-formly-zorro-antd-flex.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, Type } from '@angular/core';\nimport { FieldType, FieldTypeConfig, FormlyFieldProps } from '@ngx-formly/core';\nimport type { NzFormlyFieldConfig, NgClassType, NgStyleType } from 'ngx-formly-zorro-antd/common';\nimport type { NzWrap, NzJustify, NzAlign, NzFlex, NzGap } from 'ng-zorro-antd/flex';\n\
|
1
|
+
{"version":3,"file":"ngx-formly-zorro-antd-flex.mjs","sources":["../../../../packages/formlyantd/flex/src/flex.type.ts","../../../../packages/formlyantd/flex/src/flex.module.ts","../../../../packages/formlyantd/flex/src/ngx-formly-zorro-antd-flex.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, Type } from '@angular/core';\nimport { FieldType, FieldTypeConfig, FormlyFieldProps } from '@ngx-formly/core';\nimport type { NzFormlyFieldConfig, NgClassType, NgStyleType } from 'ngx-formly-zorro-antd/common';\nimport type { NzWrap, NzJustify, NzAlign, NzFlex, NzGap } from 'ng-zorro-antd/flex';\n\nexport interface FlexProps extends FormlyFieldProps {\n /**\n * 自定义css类\n */\n ngClass?: NgClassType;\n /**\n * 自定义样式\n */\n ngStyle?: NgStyleType;\n /**\n * flex 主轴的方向是否垂直,使用 flex-direction: column\n * @default false\n */\n vertical?: boolean;\n\n /** 设置元素在主轴方向上的对齐方式 */\n justify?: NzJustify;\n\n /** 设置元素在交叉轴方向上的对齐方式 */\n align?: NzAlign;\n\n /** 设置网格之间的间隙 */\n gap?: NzGap;\n\n /** 设置元素单行显示还是多行显示 */\n wrap?: NzWrap;\n\n /** flex CSS 简写属性 */\n flex?: NzFlex;\n}\n\nexport interface FormlyFlexFieldConfig extends NzFormlyFieldConfig<FlexProps> {\n type: 'flex' | Type<FormlyFieldFlex>;\n}\n\n@Component({\n selector: 'formly-field-flex',\n template: `\n <div\n [ngClass]=\"props['ngClass']\"\n [ngStyle]=\"props['ngStyle']\"\n [formlyAttributes]=\"field\"\n [nzVertical]=\"props['vertical']!!\"\n [nzJustify]=\"props['justify']!\"\n [nzAlign]=\"props['align']!\"\n [nzGap]=\"props['gap']!\"\n [nzWrap]=\"props['wrap']!\"\n [nzFlex]=\"props['flex']!\"\n nz-flex\n >\n @for (item of field.fieldGroup; track item.id) {\n <formly-field [field]=\"item\"></formly-field>\n }\n </div>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FormlyFieldFlex extends FieldType<FieldTypeConfig<FlexProps>> {\n override defaultOptions = {\n props: {\n vertical: false,\n justify: 'normal' as const,\n align: 'normal' as const,\n gap: 0,\n wrap: 'nowrap' as const,\n flex: 'unset' as const\n }\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { FormlyFieldFlex } from './flex.type';\n\nimport { NzFlexModule } from 'ng-zorro-antd/flex';\n\n@NgModule({\n declarations: [FormlyFieldFlex],\n imports: [\n CommonModule,\n NzFlexModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'flex',\n component: FormlyFieldFlex\n }\n ]\n })\n ]\n})\nexport class FormlyNzFlexModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;AA8DM,MAAO,eAAgB,SAAQ,SAAqC,CAAA;AAtB1E,IAAA,WAAA,GAAA;;AAuBW,QAAA,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;AACL,gBAAA,QAAQ,EAAE,KAAK;AACf,gBAAA,OAAO,EAAE,QAAiB;AAC1B,gBAAA,KAAK,EAAE,QAAiB;AACxB,gBAAA,GAAG,EAAE,CAAC;AACN,gBAAA,IAAI,EAAE,QAAiB;AACvB,gBAAA,IAAI,EAAE,OAAgB;AACvB,aAAA;SACF,CAAC;AACH,KAAA;8GAXY,eAAe,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAAf,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAe,EApBhB,QAAA,EAAA,mBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,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AAA;;;MCvCY,kBAAkB,CAAA;8GAAlB,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;+GAAlB,kBAAkB,EAAA,YAAA,EAAA,CAdd,eAAe,CAAA,EAAA,OAAA,EAAA,CAE5B,YAAY;YACZ,YAAY,EAAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,CAAA,EAAA;AAWH,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,YAZ3B,YAAY;YACZ,YAAY;YACZ,YAAY,CAAC,QAAQ,CAAC;AACpB,gBAAA,KAAK,EAAE;AACL,oBAAA;AACE,wBAAA,IAAI,EAAE,MAAM;AACZ,wBAAA,SAAS,EAAE,eAAe;AAC3B,qBAAA;AACF,iBAAA;aACF,CAAC,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAGO,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAf9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,eAAe,CAAC;AAC/B,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,YAAY;wBACZ,YAAY,CAAC,QAAQ,CAAC;AACpB,4BAAA,KAAK,EAAE;AACL,gCAAA;AACE,oCAAA,IAAI,EAAE,MAAM;AACZ,oCAAA,SAAS,EAAE,eAAe;AAC3B,iCAAA;AACF,6BAAA;yBACF,CAAC;AACH,qBAAA;AACF,iBAAA,CAAA;;;ACrBD;;AAEG;;;;"}
|
@@ -0,0 +1,174 @@
|
|
1
|
+
function field(key, type = 'input', label = '', props = {}, otherOptions = {}) {
|
2
|
+
const returner = { key, type };
|
3
|
+
returner.props = Object.assign({ label, ...props });
|
4
|
+
const className = `formly-${key}`;
|
5
|
+
otherOptions.className = otherOptions.className ? `${otherOptions.className} ${className}` : className;
|
6
|
+
return { ...returner, ...otherOptions };
|
7
|
+
}
|
8
|
+
function requiredField(key, type = 'input', label = '', props = {}, otherOptions = {}) {
|
9
|
+
return field(key, type, label, { ...props, required: true }, otherOptions);
|
10
|
+
}
|
11
|
+
function hidden(key) {
|
12
|
+
return { key, type: 'input', hide: true };
|
13
|
+
}
|
14
|
+
|
15
|
+
// import type { FormlyTimepickerFieldConfig } from 'ngx-formly-zorro-antd/timepicker';
|
16
|
+
// import type { FormlyTransferFieldConfig } from 'ngx-formly-zorro-antd/transfer';
|
17
|
+
// import type { FormlyTreeSelectFieldConfig } from 'ngx-formly-zorro-antd/tree-select';
|
18
|
+
// import type { FormlyUploadFieldConfig } from 'ngx-formly-zorro-antd/upload';
|
19
|
+
function input(key, label = '', props = {}, otherOptions = {}) {
|
20
|
+
return field(key, 'input', label, props, otherOptions);
|
21
|
+
}
|
22
|
+
function requiredInput(key, label = '', props = {}, otherOptions = {}) {
|
23
|
+
return requiredField(key, 'input', label, props, otherOptions);
|
24
|
+
}
|
25
|
+
function textArea(key, label = '', props = {}, otherOptions = {}) {
|
26
|
+
return field(key, 'textarea', label, props, otherOptions);
|
27
|
+
}
|
28
|
+
function requiredTextArea(key, label = '', props = {}, otherOptions = {}) {
|
29
|
+
return requiredField(key, 'textarea', label, props, otherOptions);
|
30
|
+
}
|
31
|
+
function checkbox(key, label = '', props = {}, otherOptions = {}) {
|
32
|
+
return field(key, 'checkbox', label, props, otherOptions);
|
33
|
+
}
|
34
|
+
function requiredCheckbox(key, label = '', props = {}, otherOptions = {}) {
|
35
|
+
return requiredField(key, 'checkbox', label, props, otherOptions);
|
36
|
+
}
|
37
|
+
function cascader(key, label = '', props = {}, otherOptions = {}) {
|
38
|
+
return field(key, 'cascader', label, props, otherOptions);
|
39
|
+
}
|
40
|
+
function requiredCascader(key, label = '', props = {}, otherOptions = {}) {
|
41
|
+
return requiredField(key, 'cascader', label, props, otherOptions);
|
42
|
+
}
|
43
|
+
function datepicker(key, label = '', props = {}, otherOptions = {}) {
|
44
|
+
return field(key, 'datepicker', label, props, otherOptions);
|
45
|
+
}
|
46
|
+
function requiredDatepicker(key, label = '', props = {}, otherOptions = {}) {
|
47
|
+
return requiredField(key, 'datepicker', label, props, otherOptions);
|
48
|
+
}
|
49
|
+
function number(key, label = '', props = {}, otherOptions = {}) {
|
50
|
+
return field(key, 'number', label, props, otherOptions);
|
51
|
+
}
|
52
|
+
function requiredNumber(key, label = '', props = {}, otherOptions = {}) {
|
53
|
+
return requiredField(key, 'number', label, props, otherOptions);
|
54
|
+
}
|
55
|
+
/** 选择器 */
|
56
|
+
function select(key, label = '', props = {}, otherOptions = {}) {
|
57
|
+
return field(key, 'select', label, props, otherOptions);
|
58
|
+
}
|
59
|
+
/** 选择器 */
|
60
|
+
function requiredSelect(key, label = '', props = {}, otherOptions = {}) {
|
61
|
+
return requiredField(key, 'select', label, props, otherOptions);
|
62
|
+
}
|
63
|
+
/** 单选框 */
|
64
|
+
function radio(key, label = '', props = {}, otherOptions = {}) {
|
65
|
+
return field(key, 'radio', label, props, otherOptions);
|
66
|
+
}
|
67
|
+
/** 单选框 */
|
68
|
+
function requiredRadio(key, label = '', props = {}, otherOptions = {}) {
|
69
|
+
return requiredField(key, 'radio', label, props, otherOptions);
|
70
|
+
}
|
71
|
+
/** 评分 */
|
72
|
+
function rate(key, label = '', props = {}, otherOptions = {}) {
|
73
|
+
return field(key, 'rate', label, props, otherOptions);
|
74
|
+
}
|
75
|
+
/** 评分 */
|
76
|
+
function requiredRate(key, label = '', props = {}, otherOptions = {}) {
|
77
|
+
return requiredField(key, 'rate', label, props, otherOptions);
|
78
|
+
}
|
79
|
+
/** 开关 */
|
80
|
+
function requiredSwitch(key, label = '', props = {}, otherOptions = {}) {
|
81
|
+
return requiredField(key, 'switch', label, props, otherOptions);
|
82
|
+
}
|
83
|
+
/** 滑动输入条 */
|
84
|
+
function slider(key, label = '', props = {}, otherOptions = {}) {
|
85
|
+
return field(key, 'slider', label, props, otherOptions);
|
86
|
+
}
|
87
|
+
/** 滑动输入条 */
|
88
|
+
function requiredSlide(key, label = '', props = {}, otherOptions = {}) {
|
89
|
+
return requiredField(key, 'slider', label, props, otherOptions);
|
90
|
+
}
|
91
|
+
/** 文本显示 */
|
92
|
+
function text(props = {}, otherOptions = {}) {
|
93
|
+
return field('', 'text', '', props, otherOptions);
|
94
|
+
}
|
95
|
+
/** 输入组 */
|
96
|
+
function inputGroup(props = {}, otherOptions = {}) {
|
97
|
+
return field('', 'input-group', '', props, otherOptions);
|
98
|
+
}
|
99
|
+
/** 间距 */
|
100
|
+
function space(props = {}, otherOptions = {}) {
|
101
|
+
return field('', 'space', '', props, otherOptions);
|
102
|
+
}
|
103
|
+
/** 模板 */
|
104
|
+
function ref(props = {}, otherOptions = {}) {
|
105
|
+
return field('', 'ref-template', '', props, otherOptions);
|
106
|
+
}
|
107
|
+
/** 栅格 */
|
108
|
+
function grid(props = {}, otherOptions = {}) {
|
109
|
+
return field('', 'grid', '', props, otherOptions);
|
110
|
+
}
|
111
|
+
/** 弹性布局 */
|
112
|
+
function flex(props = {}, otherOptions = {}) {
|
113
|
+
return field('', 'flex', '', props, otherOptions);
|
114
|
+
}
|
115
|
+
/** 卡片 */
|
116
|
+
function card(props = {}, otherOptions = {}) {
|
117
|
+
return field('', 'card', '', props, otherOptions);
|
118
|
+
}
|
119
|
+
/** 按钮组 */
|
120
|
+
function buttonGroup(props = {}, otherOptions = {}) {
|
121
|
+
return field('', 'button-group', '', props, otherOptions);
|
122
|
+
}
|
123
|
+
function button(text = '', props = {}, otherOptions = {}) {
|
124
|
+
return field('', 'button', '', { text, ...props }, otherOptions);
|
125
|
+
}
|
126
|
+
function submit(text = '', props = {}, otherOptions = {}) {
|
127
|
+
return field('', 'submit', '', { text, ...props }, otherOptions);
|
128
|
+
}
|
129
|
+
function reset(text = '', props = {}, otherOptions = {}) {
|
130
|
+
return field('', 'reset', '', { text, ...props }, otherOptions);
|
131
|
+
}
|
132
|
+
|
133
|
+
const formly = {
|
134
|
+
field,
|
135
|
+
requiredField,
|
136
|
+
hidden,
|
137
|
+
input,
|
138
|
+
requiredInput,
|
139
|
+
textArea,
|
140
|
+
requiredTextArea,
|
141
|
+
checkbox,
|
142
|
+
requiredCheckbox,
|
143
|
+
cascader,
|
144
|
+
requiredCascader,
|
145
|
+
datepicker,
|
146
|
+
requiredDatepicker,
|
147
|
+
/** 开关 */
|
148
|
+
switch: (key, label = '', props = {}, otherOptions = {}) => {
|
149
|
+
return field(key, 'switch', label, props, otherOptions);
|
150
|
+
},
|
151
|
+
requiredSwitch,
|
152
|
+
slider,
|
153
|
+
requiredSlide,
|
154
|
+
select,
|
155
|
+
requiredSelect,
|
156
|
+
text,
|
157
|
+
space,
|
158
|
+
inputGroup,
|
159
|
+
ref,
|
160
|
+
grid,
|
161
|
+
flex,
|
162
|
+
card,
|
163
|
+
button,
|
164
|
+
buttonGroup,
|
165
|
+
submit,
|
166
|
+
reset
|
167
|
+
};
|
168
|
+
|
169
|
+
/**
|
170
|
+
* Generated bundle index. Do not edit.
|
171
|
+
*/
|
172
|
+
|
173
|
+
export { formly };
|
174
|
+
//# sourceMappingURL=ngx-formly-zorro-antd-helpers.mjs.map
|