@ebuilding/form 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/checkbox/index.d.ts +1 -0
- package/checkbox/src/checkbox.module.d.ts +9 -0
- package/checkbox/src/checkbox.type.d.ts +11 -0
- package/checkbox/src/public_api.d.ts +2 -0
- package/checkboxgroup/index.d.ts +1 -0
- package/checkboxgroup/src/checkboxgroup.module.d.ts +9 -0
- package/checkboxgroup/src/checkboxgroup.type.d.ts +19 -0
- package/checkboxgroup/src/public_api.d.ts +2 -0
- package/colors/index.d.ts +1 -0
- package/colors/src/default/index.d.ts +11 -0
- package/colors/src/index.module.d.ts +8 -0
- package/colors/src/public_api.d.ts +2 -0
- package/datetime/index.d.ts +1 -0
- package/datetime/src/datetime.module.d.ts +9 -0
- package/datetime/src/datetime.type.d.ts +18 -0
- package/datetime/src/public_api.d.ts +2 -0
- package/desc/index.d.ts +1 -0
- package/desc/src/desc.module.d.ts +9 -0
- package/desc/src/desc.type.d.ts +6 -0
- package/desc/src/public_api.d.ts +2 -0
- package/dim/index.d.ts +1 -0
- package/dim/src/default/index.d.ts +16 -0
- package/dim/src/dim.module.d.ts +9 -0
- package/dim/src/public_api.d.ts +2 -0
- package/dim-indicator/index.d.ts +1 -0
- package/dim-indicator/src/assess/index.d.ts +17 -0
- package/dim-indicator/src/default/index.d.ts +19 -0
- package/dim-indicator/src/finish/index.d.ts +16 -0
- package/dim-indicator/src/indicator.module.d.ts +8 -0
- package/dim-indicator/src/public_api.d.ts +2 -0
- package/fesm2022/ebuilding-form.mjs +3337 -0
- package/fesm2022/ebuilding-form.mjs.map +1 -0
- package/fesm2022/type.checkbox.mjs +93 -0
- package/fesm2022/type.checkbox.mjs.map +1 -0
- package/fesm2022/type.checkboxgroup.mjs +168 -0
- package/fesm2022/type.checkboxgroup.mjs.map +1 -0
- package/fesm2022/type.colors.mjs +74 -0
- package/fesm2022/type.colors.mjs.map +1 -0
- package/fesm2022/type.datetime.mjs +312 -0
- package/fesm2022/type.datetime.mjs.map +1 -0
- package/fesm2022/type.desc.mjs +67 -0
- package/fesm2022/type.desc.mjs.map +1 -0
- package/fesm2022/type.dim-indicator.mjs +187 -0
- package/fesm2022/type.dim-indicator.mjs.map +1 -0
- package/fesm2022/type.dim.mjs +101 -0
- package/fesm2022/type.dim.mjs.map +1 -0
- package/fesm2022/type.form-field.mjs +147 -0
- package/fesm2022/type.form-field.mjs.map +1 -0
- package/fesm2022/type.grid.mjs +126 -0
- package/fesm2022/type.grid.mjs.map +1 -0
- package/fesm2022/type.group.mjs +113 -0
- package/fesm2022/type.group.mjs.map +1 -0
- package/fesm2022/type.html.mjs +88 -0
- package/fesm2022/type.html.mjs.map +1 -0
- package/fesm2022/type.icon.mjs +143 -0
- package/fesm2022/type.icon.mjs.map +1 -0
- package/fesm2022/type.label.mjs +71 -0
- package/fesm2022/type.label.mjs.map +1 -0
- package/fesm2022/type.line.mjs +78 -0
- package/fesm2022/type.line.mjs.map +1 -0
- package/fesm2022/type.list.mjs +84 -0
- package/fesm2022/type.list.mjs.map +1 -0
- package/fesm2022/type.number.mjs +196 -0
- package/fesm2022/type.number.mjs.map +1 -0
- package/fesm2022/type.overtime.mjs +301 -0
- package/fesm2022/type.overtime.mjs.map +1 -0
- package/fesm2022/type.panel.mjs +117 -0
- package/fesm2022/type.panel.mjs.map +1 -0
- package/fesm2022/type.radio.mjs +71 -0
- package/fesm2022/type.radio.mjs.map +1 -0
- package/fesm2022/type.radiogroup.mjs +138 -0
- package/fesm2022/type.radiogroup.mjs.map +1 -0
- package/fesm2022/type.reform.mjs +91 -0
- package/fesm2022/type.reform.mjs.map +1 -0
- package/fesm2022/type.repeat-card.mjs +204 -0
- package/fesm2022/type.repeat-card.mjs.map +1 -0
- package/fesm2022/type.repeat.mjs +209 -0
- package/fesm2022/type.repeat.mjs.map +1 -0
- package/fesm2022/type.select.mjs +224 -0
- package/fesm2022/type.select.mjs.map +1 -0
- package/fesm2022/type.switch.mjs +73 -0
- package/fesm2022/type.switch.mjs.map +1 -0
- package/fesm2022/type.tabs.mjs +107 -0
- package/fesm2022/type.tabs.mjs.map +1 -0
- package/fesm2022/type.text.mjs +89 -0
- package/fesm2022/type.text.mjs.map +1 -0
- package/fesm2022/type.textarea.mjs +158 -0
- package/fesm2022/type.textarea.mjs.map +1 -0
- package/fesm2022/type.textcode.mjs +126 -0
- package/fesm2022/type.textcode.mjs.map +1 -0
- package/form-field/index.d.ts +1 -0
- package/form-field/src/form-field.module.d.ts +10 -0
- package/form-field/src/form-field.wrapper.d.ts +9 -0
- package/form-field/src/public_api.d.ts +2 -0
- package/grid/index.d.ts +1 -0
- package/grid/src/grid.module.d.ts +11 -0
- package/grid/src/grid.type.d.ts +11 -0
- package/grid/src/public_api.d.ts +2 -0
- package/group/index.d.ts +1 -0
- package/group/src/group.module.d.ts +11 -0
- package/group/src/group.type.d.ts +11 -0
- package/group/src/public_api.d.ts +2 -0
- package/html/index.d.ts +1 -0
- package/html/src/html.module.d.ts +10 -0
- package/html/src/html.type.d.ts +12 -0
- package/html/src/public_api.d.ts +2 -0
- package/icon/index.d.ts +1 -0
- package/icon/src/default/index.d.ts +14 -0
- package/icon/src/index.module.d.ts +14 -0
- package/icon/src/public_api.d.ts +2 -0
- package/index.d.ts +28 -0
- package/label/index.d.ts +1 -0
- package/label/src/label.module.d.ts +10 -0
- package/label/src/label.type.d.ts +9 -0
- package/label/src/public_api.d.ts +2 -0
- package/line/index.d.ts +1 -0
- package/line/src/line.module.d.ts +11 -0
- package/line/src/line.type.d.ts +11 -0
- package/line/src/public_api.d.ts +2 -0
- package/list/index.d.ts +1 -0
- package/list/src/list.module.d.ts +11 -0
- package/list/src/list.type.d.ts +9 -0
- package/list/src/public_api.d.ts +2 -0
- package/number/index.d.ts +1 -0
- package/number/src/number.module.d.ts +9 -0
- package/number/src/number.type.d.ts +19 -0
- package/number/src/number_rate.type.d.ts +9 -0
- package/number/src/public_api.d.ts +3 -0
- package/overtime/index.d.ts +1 -0
- package/overtime/src/default/index.d.ts +77 -0
- package/overtime/src/index.module.d.ts +13 -0
- package/overtime/src/public_api.d.ts +2 -0
- package/package.json +136 -0
- package/panel/index.d.ts +1 -0
- package/panel/src/panel.module.d.ts +11 -0
- package/panel/src/panel.type.d.ts +12 -0
- package/panel/src/public_api.d.ts +2 -0
- package/radio/index.d.ts +1 -0
- package/radio/src/public_api.d.ts +2 -0
- package/radio/src/radio.module.d.ts +8 -0
- package/radio/src/radio.type.d.ts +11 -0
- package/radiogroup/index.d.ts +1 -0
- package/radiogroup/src/public_api.d.ts +2 -0
- package/radiogroup/src/radiogroup.module.d.ts +8 -0
- package/radiogroup/src/radiogroup.type.d.ts +17 -0
- package/reform/index.d.ts +1 -0
- package/reform/src/public_api.d.ts +2 -0
- package/reform/src/reform.module.d.ts +11 -0
- package/reform/src/reform.type.d.ts +11 -0
- package/repeat/index.d.ts +1 -0
- package/repeat/src/default/index.d.ts +28 -0
- package/repeat/src/index.module.d.ts +17 -0
- package/repeat/src/public_api.d.ts +2 -0
- package/repeat-card/index.d.ts +1 -0
- package/repeat-card/src/default/index.d.ts +28 -0
- package/repeat-card/src/index.module.d.ts +18 -0
- package/repeat-card/src/public_api.d.ts +2 -0
- package/select/index.d.ts +1 -0
- package/select/src/public_api.d.ts +2 -0
- package/select/src/select.module.d.ts +9 -0
- package/select/src/select.type.d.ts +23 -0
- package/switch/index.d.ts +1 -0
- package/switch/src/default/index.d.ts +12 -0
- package/switch/src/index.module.d.ts +9 -0
- package/switch/src/public_api.d.ts +2 -0
- package/tabs/index.d.ts +1 -0
- package/tabs/src/default/index.d.ts +13 -0
- package/tabs/src/index.module.d.ts +7 -0
- package/tabs/src/public_api.d.ts +3 -0
- package/tabs/src/tab/index.d.ts +11 -0
- package/text/index.d.ts +1 -0
- package/text/src/public_api.d.ts +2 -0
- package/text/src/text.module.d.ts +8 -0
- package/text/src/text.type.d.ts +7 -0
- package/textarea/index.d.ts +1 -0
- package/textarea/src/public_api.d.ts +2 -0
- package/textarea/src/textarea.module.d.ts +7 -0
- package/textarea/src/textarea.type.d.ts +13 -0
- package/textcode/index.d.ts +1 -0
- package/textcode/src/public_api.d.ts +2 -0
- package/textcode/src/text.module.d.ts +7 -0
- package/textcode/src/text.type.d.ts +17 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.radio.mjs","sources":["../../../../packages/form/radio/src/radio.type.ts","../../../../packages/form/radio/src/radio.module.ts","../../../../packages/form/radio/type.radio.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy } from '@angular/core';\n\nimport { CommonModule } from '@angular/common';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { NzRadioModule } from 'ng-zorro-antd/radio';\n\nimport { FormlyModule, FieldType, FieldTypeConfig } from '@kre-form/core';\n\n@Component({\n selector: 'deon-nz-field-radio',\n template: ` <label nz-radio [formControl]=\"formControl\" [formlyAttributes]=\"field\"></label> `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n NzRadioModule,\n FormlyModule\n ]\n})\nexport class DeonNzFieldRadio extends FieldType<FieldTypeConfig> {\n override defaultOptions = {\n props: { options: [] },\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@kre-form/core';\n\nimport { DeonNzFieldRadio } from './radio.type';\n\n@NgModule({\n imports: [\n CommonModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'radio',\n component: DeonNzFieldRadio,\n wrappers: ['formly-form-field'],\n },\n ],\n }),\n ],\n})\nexport class DeonNzRadioModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;AAoBM,MAAO,gBAAiB,SAAQ,SAA0B,CAAA;AACrD,IAAA,cAAc,GAAG;AACxB,QAAA,KAAK,EAAE,EAAE,OAAO,EAA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AAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,YAAY,CAAC,QAAQ,CAAC;AACpB,4BAAA,KAAK,EAAE;AACL,gCAAA;AACE,oCAAA,IAAI,EAAE,OAAO;AACb,oCAAA,SAAS,EAAE,gBAAgB;oCAC3B,QAAQ,EAAE,CAAC,mBAAmB,CAAC;AAChC,iCAAA;AACF,6BAAA;yBACF,CAAC;AACH,qBAAA;AACF,iBAAA;;;ACnBD;;AAEG;;;;"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i1$1 from '@kre-form/core';
|
|
6
|
+
import { FieldType, FormlyModule } from '@kre-form/core';
|
|
7
|
+
import * as i3 from '@angular/forms';
|
|
8
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
9
|
+
import * as i4 from 'ng-zorro-antd/radio';
|
|
10
|
+
import { NzRadioModule } from 'ng-zorro-antd/radio';
|
|
11
|
+
import * as i1 from '@ebuilding/base/shared.srv/global.event';
|
|
12
|
+
|
|
13
|
+
class DeonNzFieldRadioGroup extends FieldType {
|
|
14
|
+
globalSrv;
|
|
15
|
+
defaultOptions = {
|
|
16
|
+
props: { options: [] },
|
|
17
|
+
};
|
|
18
|
+
get radioText() {
|
|
19
|
+
let result = null;
|
|
20
|
+
if (this.props && this.props.options && Array.isArray(this.props.options)) {
|
|
21
|
+
this.props.options.forEach((e) => {
|
|
22
|
+
if (e && e.value == this.model[this.key]) {
|
|
23
|
+
result = e.label;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
getOptions() {
|
|
30
|
+
if (this.props['options'] instanceof Array) {
|
|
31
|
+
return this.props['options'];
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
constructor(globalSrv) {
|
|
38
|
+
super();
|
|
39
|
+
this.globalSrv = globalSrv;
|
|
40
|
+
}
|
|
41
|
+
modelChange(e) {
|
|
42
|
+
this.globalSrv.notifyDataChanged('deon-field-radiogroup', {
|
|
43
|
+
field: this.field,
|
|
44
|
+
data: e,
|
|
45
|
+
type: 'click',
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzFieldRadioGroup, deps: [{ token: i1.GramGlobalService }], target: i0.ɵɵFactoryTarget.Component });
|
|
49
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: DeonNzFieldRadioGroup, isStandalone: true, selector: "deon-nz-field-radiogroup", usesInheritance: true, ngImport: i0, template: `
|
|
50
|
+
<nz-radio-group [formControl]="formControl" (ngModelChange)="modelChange($event)" [nzDisabled]="editor == false">
|
|
51
|
+
<ng-container *ngIf="props && props.type && props.type == 'button'; else tmpOther">
|
|
52
|
+
<ng-container *ngFor="let option of getOptions()">
|
|
53
|
+
<label nz-radio-button [nzValue]="option.value" [nzDisabled]="option?.disabled == true ? true : false">
|
|
54
|
+
{{ option.label }}
|
|
55
|
+
</label>
|
|
56
|
+
</ng-container>
|
|
57
|
+
</ng-container>
|
|
58
|
+
<ng-template #tmpOther>
|
|
59
|
+
<ng-container *ngFor="let option of getOptions()">
|
|
60
|
+
<label nz-radio [nzValue]="option.value" [nzDisabled]="option?.disabled == true ? true : false">
|
|
61
|
+
{{ option.label }}
|
|
62
|
+
</label>
|
|
63
|
+
</ng-container>
|
|
64
|
+
</ng-template>
|
|
65
|
+
</nz-radio-group>
|
|
66
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: NzRadioModule }, { kind: "component", type: i4.NzRadioComponent, selector: "[nz-radio],[nz-radio-button]", inputs: ["nzValue", "nzDisabled", "nzAutoFocus", "nz-radio-button"], exportAs: ["nzRadio"] }, { kind: "component", type: i4.NzRadioGroupComponent, selector: "nz-radio-group", inputs: ["nzDisabled", "nzButtonStyle", "nzSize", "nzName"], exportAs: ["nzRadioGroup"] }, { kind: "ngmodule", type: FormlyModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
67
|
+
}
|
|
68
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzFieldRadioGroup, decorators: [{
|
|
69
|
+
type: Component,
|
|
70
|
+
args: [{
|
|
71
|
+
selector: 'deon-nz-field-radiogroup',
|
|
72
|
+
template: `
|
|
73
|
+
<nz-radio-group [formControl]="formControl" (ngModelChange)="modelChange($event)" [nzDisabled]="editor == false">
|
|
74
|
+
<ng-container *ngIf="props && props.type && props.type == 'button'; else tmpOther">
|
|
75
|
+
<ng-container *ngFor="let option of getOptions()">
|
|
76
|
+
<label nz-radio-button [nzValue]="option.value" [nzDisabled]="option?.disabled == true ? true : false">
|
|
77
|
+
{{ option.label }}
|
|
78
|
+
</label>
|
|
79
|
+
</ng-container>
|
|
80
|
+
</ng-container>
|
|
81
|
+
<ng-template #tmpOther>
|
|
82
|
+
<ng-container *ngFor="let option of getOptions()">
|
|
83
|
+
<label nz-radio [nzValue]="option.value" [nzDisabled]="option?.disabled == true ? true : false">
|
|
84
|
+
{{ option.label }}
|
|
85
|
+
</label>
|
|
86
|
+
</ng-container>
|
|
87
|
+
</ng-template>
|
|
88
|
+
</nz-radio-group>
|
|
89
|
+
`,
|
|
90
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
91
|
+
imports: [
|
|
92
|
+
CommonModule,
|
|
93
|
+
FormsModule,
|
|
94
|
+
ReactiveFormsModule,
|
|
95
|
+
NzRadioModule,
|
|
96
|
+
FormlyModule
|
|
97
|
+
]
|
|
98
|
+
}]
|
|
99
|
+
}], ctorParameters: () => [{ type: i1.GramGlobalService }] });
|
|
100
|
+
|
|
101
|
+
class DeonNzRadioGroupModule {
|
|
102
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzRadioGroupModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
103
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: DeonNzRadioGroupModule, imports: [CommonModule, i1$1.FormlyModule] });
|
|
104
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzRadioGroupModule, imports: [CommonModule,
|
|
105
|
+
FormlyModule.forChild({
|
|
106
|
+
types: [
|
|
107
|
+
{
|
|
108
|
+
name: 'radiogroup',
|
|
109
|
+
component: DeonNzFieldRadioGroup,
|
|
110
|
+
wrappers: ['formly-form-field'],
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
})] });
|
|
114
|
+
}
|
|
115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzRadioGroupModule, decorators: [{
|
|
116
|
+
type: NgModule,
|
|
117
|
+
args: [{
|
|
118
|
+
imports: [
|
|
119
|
+
CommonModule,
|
|
120
|
+
FormlyModule.forChild({
|
|
121
|
+
types: [
|
|
122
|
+
{
|
|
123
|
+
name: 'radiogroup',
|
|
124
|
+
component: DeonNzFieldRadioGroup,
|
|
125
|
+
wrappers: ['formly-form-field'],
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
}),
|
|
129
|
+
],
|
|
130
|
+
}]
|
|
131
|
+
}] });
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Generated bundle index. Do not edit.
|
|
135
|
+
*/
|
|
136
|
+
|
|
137
|
+
export { DeonNzFieldRadioGroup, DeonNzRadioGroupModule };
|
|
138
|
+
//# sourceMappingURL=type.radiogroup.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.radiogroup.mjs","sources":["../../../../packages/form/radiogroup/src/radiogroup.type.ts","../../../../packages/form/radiogroup/src/radiogroup.module.ts","../../../../packages/form/radiogroup/type.radiogroup.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy } from '@angular/core';\n\nimport { CommonModule } from '@angular/common';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { NzRadioModule } from 'ng-zorro-antd/radio';\n\nimport { FormlyModule, FieldType, FieldTypeConfig } from '@kre-form/core';\nimport { GramGlobalService } from '@ebuilding/base/shared.srv/global.event';\n\n@Component({\n selector: 'deon-nz-field-radiogroup',\n template: ` \n <nz-radio-group [formControl]=\"formControl\" (ngModelChange)=\"modelChange($event)\" [nzDisabled]=\"editor == false\">\n <ng-container *ngIf=\"props && props.type && props.type == 'button'; else tmpOther\">\n <ng-container *ngFor=\"let option of getOptions()\">\n <label nz-radio-button [nzValue]=\"option.value\" [nzDisabled]=\"option?.disabled == true ? true : false\">\n {{ option.label }}\n </label>\n </ng-container>\n </ng-container>\n <ng-template #tmpOther>\n <ng-container *ngFor=\"let option of getOptions()\">\n <label nz-radio [nzValue]=\"option.value\" [nzDisabled]=\"option?.disabled == true ? true : false\">\n {{ option.label }}\n </label>\n </ng-container>\n </ng-template>\n </nz-radio-group> \n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n NzRadioModule,\n FormlyModule\n ]\n})\nexport class DeonNzFieldRadioGroup extends FieldType<FieldTypeConfig> {\n override defaultOptions = {\n props: { options: [] },\n };\n\n get radioText() {\n let result: any = null;\n if (this.props!! && this.props.options && Array.isArray(this.props.options)) {\n this.props.options.forEach((e: any) => {\n if (e && e.value == this.model[this.key]) {\n result = e.label;\n }\n });\n }\n return result;\n }\n\n getOptions() {\n if (this.props['options'] instanceof Array) {\n return this.props['options'];\n } else {\n return [];\n }\n }\n\n\n constructor(public globalSrv: GramGlobalService) {\n super();\n }\n\n modelChange(e: any) {\n this.globalSrv.notifyDataChanged('deon-field-radiogroup', {\n field: this.field,\n data: e,\n type: 'click',\n });\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@kre-form/core';\n\nimport { DeonNzFieldRadioGroup } from './radiogroup.type';\n\n@NgModule({\n imports: [\n CommonModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'radiogroup',\n component: DeonNzFieldRadioGroup,\n wrappers: ['formly-form-field'],\n },\n ],\n }),\n ],\n})\nexport class DeonNzRadioGroupModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;AAsCM,MAAO,qBAAsB,SAAQ,SAA0B,CAAA;AA0BhD,IAAA,SAAA;AAzBV,IAAA,cAAc,GAAG;AACxB,QAAA,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;KACvB;AAED,IAAA,IAAI,SAAS,GAAA;QACX,IAAI,MAAM,GAAQ,IAAI;QACtB,IAAI,IAAI,CAAC,KAAO,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAA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EAAAA,IAAA,CAAA,YAAA,CAAA,EAAA,CAAA;AAYH,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,YAZ/B,YAAY;YACZ,YAAY,CAAC,QAAQ,CAAC;AACpB,gBAAA,KAAK,EAAE;AACL,oBAAA;AACE,wBAAA,IAAI,EAAE,YAAY;AAClB,wBAAA,SAAS,EAAE,qBAAqB;wBAChC,QAAQ,EAAE,CAAC,mBAAmB,CAAC;AAChC,qBAAA;AACF,iBAAA;aACF,CAAC,CAAA,EAAA,CAAA;;4FAGO,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAdlC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,YAAY,CAAC,QAAQ,CAAC;AACpB,4BAAA,KAAK,EAAE;AACL,gCAAA;AACE,oCAAA,IAAI,EAAE,YAAY;AAClB,oCAAA,SAAS,EAAE,qBAAqB;oCAChC,QAAQ,EAAE,CAAC,mBAAmB,CAAC;AAChC,iCAAA;AACF,6BAAA;yBACF,CAAC;AACH,qBAAA;AACF,iBAAA;;;ACnBD;;AAEG;;;;"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i2 from '@kre-form/core';
|
|
6
|
+
import { FieldType, FormlyModule } from '@kre-form/core';
|
|
7
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
8
|
+
import { NzGridModule } from 'ng-zorro-antd/grid';
|
|
9
|
+
import { DeonNzFormFieldModule } from '@ebuilding/form/form-field';
|
|
10
|
+
|
|
11
|
+
class DeonNzFieldReform extends FieldType {
|
|
12
|
+
defaultOptions = {
|
|
13
|
+
props: { description: '' },
|
|
14
|
+
};
|
|
15
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzFieldReform, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
16
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: DeonNzFieldReform, isStandalone: true, selector: "deon-nz-field-reform", usesInheritance: true, ngImport: i0, template: `
|
|
17
|
+
<ng-container *ngIf="field.fieldGroup!! && field.fieldGroup.length > 0">
|
|
18
|
+
<ng-container *ngFor="let item of field.fieldGroup">
|
|
19
|
+
<formly-field [field]="item"></formly-field>
|
|
20
|
+
<ng-content></ng-content>
|
|
21
|
+
</ng-container>
|
|
22
|
+
</ng-container>
|
|
23
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: FormlyModule }, { kind: "component", type: i2.FormlyField, selector: "formly-field", inputs: ["field", "hideLabel", "isTable", "dimConfig", "tableConfig", "editor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
24
|
+
}
|
|
25
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzFieldReform, decorators: [{
|
|
26
|
+
type: Component,
|
|
27
|
+
args: [{
|
|
28
|
+
selector: 'deon-nz-field-reform',
|
|
29
|
+
template: `
|
|
30
|
+
<ng-container *ngIf="field.fieldGroup!! && field.fieldGroup.length > 0">
|
|
31
|
+
<ng-container *ngFor="let item of field.fieldGroup">
|
|
32
|
+
<formly-field [field]="item"></formly-field>
|
|
33
|
+
<ng-content></ng-content>
|
|
34
|
+
</ng-container>
|
|
35
|
+
</ng-container>
|
|
36
|
+
`,
|
|
37
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
38
|
+
imports: [
|
|
39
|
+
CommonModule,
|
|
40
|
+
FormsModule,
|
|
41
|
+
ReactiveFormsModule,
|
|
42
|
+
FormlyModule
|
|
43
|
+
]
|
|
44
|
+
}]
|
|
45
|
+
}] });
|
|
46
|
+
|
|
47
|
+
class DeonNzReformModule {
|
|
48
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzReformModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
49
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: DeonNzReformModule, imports: [CommonModule,
|
|
50
|
+
ReactiveFormsModule,
|
|
51
|
+
NzGridModule,
|
|
52
|
+
DeonNzFormFieldModule, i2.FormlyModule] });
|
|
53
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzReformModule, imports: [CommonModule,
|
|
54
|
+
ReactiveFormsModule,
|
|
55
|
+
NzGridModule,
|
|
56
|
+
DeonNzFormFieldModule,
|
|
57
|
+
FormlyModule.forChild({
|
|
58
|
+
types: [
|
|
59
|
+
{
|
|
60
|
+
name: 'reform',
|
|
61
|
+
component: DeonNzFieldReform,
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
})] });
|
|
65
|
+
}
|
|
66
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzReformModule, decorators: [{
|
|
67
|
+
type: NgModule,
|
|
68
|
+
args: [{
|
|
69
|
+
imports: [
|
|
70
|
+
CommonModule,
|
|
71
|
+
ReactiveFormsModule,
|
|
72
|
+
NzGridModule,
|
|
73
|
+
DeonNzFormFieldModule,
|
|
74
|
+
FormlyModule.forChild({
|
|
75
|
+
types: [
|
|
76
|
+
{
|
|
77
|
+
name: 'reform',
|
|
78
|
+
component: DeonNzFieldReform,
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
}),
|
|
82
|
+
],
|
|
83
|
+
}]
|
|
84
|
+
}] });
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Generated bundle index. Do not edit.
|
|
88
|
+
*/
|
|
89
|
+
|
|
90
|
+
export { DeonNzFieldReform, DeonNzReformModule };
|
|
91
|
+
//# sourceMappingURL=type.reform.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.reform.mjs","sources":["../../../../packages/form/reform/src/reform.type.ts","../../../../packages/form/reform/src/reform.module.ts","../../../../packages/form/reform/type.reform.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { FormlyModule, FieldType, FieldTypeConfig } from '@kre-form/core';\n\n@Component({\n selector: 'deon-nz-field-reform',\n template: `\n <ng-container *ngIf=\"field.fieldGroup!! && field.fieldGroup.length > 0\">\n <ng-container *ngFor=\"let item of field.fieldGroup\">\n <formly-field [field]=\"item\"></formly-field>\n <ng-content></ng-content>\n </ng-container>\n </ng-container>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n FormlyModule\n ]\n})\nexport class DeonNzFieldReform extends FieldType<FieldTypeConfig> {\n override defaultOptions = {\n props: { description: '' },\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@kre-form/core';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { NzGridModule } from 'ng-zorro-antd/grid';\nimport { DeonNzFormFieldModule } from '@ebuilding/form/form-field';\n\nimport { DeonNzFieldReform } from './reform.type';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n NzGridModule,\n DeonNzFormFieldModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'reform',\n component: DeonNzFieldReform,\n },\n ],\n }),\n ],\n})\nexport class DeonNzReformModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;AAuBM,MAAO,iBAAkB,SAAQ,SAA0B,CAAA;AACtD,IAAA,cAAc,GAAG;AACxB,QAAA,KAAK,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE;KAC3B;wGAHU,iBAAiB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAjB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,iBAAiB,EAhBlB,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA;;;;;;;AAOT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAGC,YAAY,EACZ,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,cAAA,EAAA,eAAA,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,IAAA,EAAA,UAAA,EAAA,IAAA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qBAAqB;YACrB,YAAY,CAAC,QAAQ,CAAC;AACpB,gBAAA,KAAK,EAAE;AACL,oBAAA;AACE,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,SAAS,EAAE,iBAAiB;AAC7B,qBAAA;AACF,iBAAA;aACF,CAAC,CAAA,EAAA,CAAA;;4FAGO,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAhB9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,YAAY;wBACZ,qBAAqB;wBACrB,YAAY,CAAC,QAAQ,CAAC;AACpB,4BAAA,KAAK,EAAE;AACL,gCAAA;AACE,oCAAA,IAAI,EAAE,QAAQ;AACd,oCAAA,SAAS,EAAE,iBAAiB;AAC7B,iCAAA;AACF,6BAAA;yBACF,CAAC;AACH,qBAAA;AACF,iBAAA;;;ACzBD;;AAEG;;;;"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, NgModule } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i8 from '@kre-form/core';
|
|
6
|
+
import { FieldArrayType, FormlyModule } from '@kre-form/core';
|
|
7
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
8
|
+
import { NzEmptyModule } from 'ng-zorro-antd/empty';
|
|
9
|
+
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
10
|
+
import * as i7 from 'ng-zorro-antd/icon';
|
|
11
|
+
import { NzIconModule } from 'ng-zorro-antd/icon';
|
|
12
|
+
import * as i3 from 'ng-zorro-antd/tooltip';
|
|
13
|
+
import { NzToolTipModule } from 'ng-zorro-antd/tooltip';
|
|
14
|
+
import { NzTableModule } from 'ng-zorro-antd/table';
|
|
15
|
+
import * as i4 from 'ng-zorro-antd/button';
|
|
16
|
+
import { NzButtonModule } from 'ng-zorro-antd/button';
|
|
17
|
+
import { NzModalModule } from 'ng-zorro-antd/modal';
|
|
18
|
+
import { DeonNzFormFieldModule } from '@ebuilding/form/form-field';
|
|
19
|
+
import * as i9 from '@ebuilding/base/components/empty';
|
|
20
|
+
import { GramDeonEmptyModule } from '@ebuilding/base/components/empty';
|
|
21
|
+
import _ from 'lodash';
|
|
22
|
+
import * as i1 from '@ebuilding/base/shared.srv/global.event';
|
|
23
|
+
import * as i5 from 'ng-zorro-antd/core/transition-patch';
|
|
24
|
+
import * as i6 from 'ng-zorro-antd/core/wave';
|
|
25
|
+
|
|
26
|
+
class DeonNzFieldRepeatCard extends FieldArrayType {
|
|
27
|
+
globalSrv;
|
|
28
|
+
/**
|
|
29
|
+
* 合并列
|
|
30
|
+
*/
|
|
31
|
+
get colSpan() {
|
|
32
|
+
let res = 0;
|
|
33
|
+
if (this.field?.fieldArray["fieldGroup"]) {
|
|
34
|
+
res = this.field.fieldArray["fieldGroup"].length + 2;
|
|
35
|
+
}
|
|
36
|
+
return res;
|
|
37
|
+
}
|
|
38
|
+
get dragDisabled() {
|
|
39
|
+
let result = true;
|
|
40
|
+
if (this.editor != false && _.get(this.props, 'drag') == true) {
|
|
41
|
+
result = false;
|
|
42
|
+
}
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
get clasName() {
|
|
46
|
+
if (this.props && this.props["className"]) {
|
|
47
|
+
return this.props["className"];
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
get operationShow() {
|
|
52
|
+
if (this.props && this.props["operationShow"] != undefined && this.props["operationShow"] != null) {
|
|
53
|
+
return this.props["operationShow"];
|
|
54
|
+
}
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
drop(event) {
|
|
58
|
+
moveItemInArray(this.field.fieldGroup, event.previousIndex, event.currentIndex);
|
|
59
|
+
moveItemInArray(this.model, event.previousIndex, event.currentIndex);
|
|
60
|
+
}
|
|
61
|
+
constructor(globalSrv) {
|
|
62
|
+
super();
|
|
63
|
+
this.globalSrv = globalSrv;
|
|
64
|
+
}
|
|
65
|
+
ngOnInit() { }
|
|
66
|
+
ngOnDestroy() { }
|
|
67
|
+
ngAfterViewInit() { }
|
|
68
|
+
ngOnChanges(change) {
|
|
69
|
+
// this.resize();
|
|
70
|
+
}
|
|
71
|
+
fieldEditor(f, i, m) {
|
|
72
|
+
if (f && f.props && f.props.builtin && f.props.builtin == true) {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
if (f && f.key == 'code' && m && m[i]['id']) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
if (this.editor == false) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
if (m && m[i]['builtin'] && m[i]['builtin'] == true) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
addData() {
|
|
89
|
+
this.add();
|
|
90
|
+
this.globalSrv.notifyDataChanged('deon-field-repeat-card', {
|
|
91
|
+
field: this.field,
|
|
92
|
+
data: null,
|
|
93
|
+
type: 'add',
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
rowDelete(e) {
|
|
97
|
+
this.remove(e);
|
|
98
|
+
this.globalSrv.notifyDataChanged('deon-field-repeat-card', {
|
|
99
|
+
field: this.field,
|
|
100
|
+
data: e,
|
|
101
|
+
type: 'delete',
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
rowOperation(button, e) {
|
|
105
|
+
this.globalSrv.notifyDataChanged('deon-field-repeat-card', {
|
|
106
|
+
field: this.field,
|
|
107
|
+
data: e,
|
|
108
|
+
type: button?.type,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
checkDelete(index) {
|
|
112
|
+
if (this.props["hideDelete"] && Array.isArray(this.props["hideDelete"])) {
|
|
113
|
+
if (this.props["hideDelete"].some((item) => {
|
|
114
|
+
return item == index;
|
|
115
|
+
})) {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzFieldRepeatCard, deps: [{ token: i1.GramGlobalService }], target: i0.ɵɵFactoryTarget.Component });
|
|
122
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: DeonNzFieldRepeatCard, isStandalone: true, selector: "deon-nz-field-repeat-card", usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"repeat-card\" [ngClass]=\"clasName\">\n <ng-container *ngIf=\"props && props.label\">\n <div class=\"card-label\">{{props.label}}</div>\n </ng-container>\n <ng-container\n *ngIf=\"field.fieldGroup!==undefined && field.fieldGroup!==null && field.fieldGroup.length>0;else cardEmpty\">\n <ng-container *ngFor=\"let fields of field.fieldGroup; let i = index\">\n <div class=\"card-header\">\n <div class=\"serial\">\u5E8F\u53F7\uFF1A{{ i + 1 }}</div>\n <div calss=\"delete\">\n <ng-container *ngIf=\"editor!=false\">\n <a nz-tooltip nzTooltipTitle=\"\u5220\u9664\" *ngIf=\"checkDelete(i)\" (click)=\"rowDelete(i)\"><i nz-icon\n nzType=\"delete\"></i></a>\n </ng-container>\n </div>\n </div>\n <div class=\"card-body\">\n <ng-container *ngFor=\"let item of fields.fieldGroup\">\n <formly-field [field]=\"item\"></formly-field>\n </ng-container>\n </div>\n </ng-container>\n </ng-container>\n <ng-template #cardEmpty>\n <gram-empty></gram-empty>\n <ng-container *ngIf=\"editor!=false\">\n <a nz-button nzType=\"link\" (click)=\"addData()\">+\u6DFB\u52A0</a>\n </ng-container>\n </ng-template>\n\n <ng-container *ngIf=\"editor!=false\">\n <div class=\"card-bottom\"\n *ngIf=\"field.fieldGroup!==undefined && field.fieldGroup!==null && field.fieldGroup.length>0\">\n <button nz-button nzType=\"default\" type=\"button\" (click)=\"addData()\">+\u6DFB\u52A0</button>\n </div>\n </ng-container>\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: NzToolTipModule }, { kind: "directive", type: i3.NzTooltipDirective, selector: "[nz-tooltip]", inputs: ["nzTooltipTitle", "nzTooltipTitleContext", "nz-tooltip", "nzTooltipTrigger", "nzTooltipPlacement", "nzTooltipOrigin", "nzTooltipVisible", "nzTooltipMouseEnterDelay", "nzTooltipMouseLeaveDelay", "nzTooltipOverlayClassName", "nzTooltipOverlayStyle", "nzTooltipArrowPointAtCenter", "cdkConnectedOverlayPush", "nzTooltipColor"], outputs: ["nzTooltipVisibleChange"], exportAs: ["nzTooltip"] }, { kind: "ngmodule", type: NzButtonModule }, { 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-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: "ngmodule", type: DragDropModule }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i7.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: FormlyModule }, { kind: "component", type: i8.FormlyField, selector: "formly-field", inputs: ["field", "hideLabel", "isTable", "dimConfig", "tableConfig", "editor"] }, { kind: "ngmodule", type: GramDeonEmptyModule }, { kind: "component", type: i9.BaseEmptyComponent, selector: "gram-empty", inputs: ["desc", "state"], outputs: ["emptyClick"] }] });
|
|
123
|
+
}
|
|
124
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzFieldRepeatCard, decorators: [{
|
|
125
|
+
type: Component,
|
|
126
|
+
args: [{ selector: 'deon-nz-field-repeat-card', imports: [
|
|
127
|
+
CommonModule,
|
|
128
|
+
FormsModule,
|
|
129
|
+
ReactiveFormsModule,
|
|
130
|
+
NzToolTipModule,
|
|
131
|
+
NzButtonModule,
|
|
132
|
+
DragDropModule,
|
|
133
|
+
NzIconModule,
|
|
134
|
+
FormlyModule,
|
|
135
|
+
GramDeonEmptyModule
|
|
136
|
+
], template: "<div class=\"repeat-card\" [ngClass]=\"clasName\">\n <ng-container *ngIf=\"props && props.label\">\n <div class=\"card-label\">{{props.label}}</div>\n </ng-container>\n <ng-container\n *ngIf=\"field.fieldGroup!==undefined && field.fieldGroup!==null && field.fieldGroup.length>0;else cardEmpty\">\n <ng-container *ngFor=\"let fields of field.fieldGroup; let i = index\">\n <div class=\"card-header\">\n <div class=\"serial\">\u5E8F\u53F7\uFF1A{{ i + 1 }}</div>\n <div calss=\"delete\">\n <ng-container *ngIf=\"editor!=false\">\n <a nz-tooltip nzTooltipTitle=\"\u5220\u9664\" *ngIf=\"checkDelete(i)\" (click)=\"rowDelete(i)\"><i nz-icon\n nzType=\"delete\"></i></a>\n </ng-container>\n </div>\n </div>\n <div class=\"card-body\">\n <ng-container *ngFor=\"let item of fields.fieldGroup\">\n <formly-field [field]=\"item\"></formly-field>\n </ng-container>\n </div>\n </ng-container>\n </ng-container>\n <ng-template #cardEmpty>\n <gram-empty></gram-empty>\n <ng-container *ngIf=\"editor!=false\">\n <a nz-button nzType=\"link\" (click)=\"addData()\">+\u6DFB\u52A0</a>\n </ng-container>\n </ng-template>\n\n <ng-container *ngIf=\"editor!=false\">\n <div class=\"card-bottom\"\n *ngIf=\"field.fieldGroup!==undefined && field.fieldGroup!==null && field.fieldGroup.length>0\">\n <button nz-button nzType=\"default\" type=\"button\" (click)=\"addData()\">+\u6DFB\u52A0</button>\n </div>\n </ng-container>\n</div>" }]
|
|
137
|
+
}], ctorParameters: () => [{ type: i1.GramGlobalService }] });
|
|
138
|
+
|
|
139
|
+
class DeonNzRepeatCardModule {
|
|
140
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzRepeatCardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
141
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: DeonNzRepeatCardModule, imports: [CommonModule,
|
|
142
|
+
ReactiveFormsModule,
|
|
143
|
+
NzEmptyModule,
|
|
144
|
+
NzTableModule,
|
|
145
|
+
NzButtonModule,
|
|
146
|
+
NzIconModule,
|
|
147
|
+
NzModalModule,
|
|
148
|
+
NzToolTipModule,
|
|
149
|
+
DeonNzFormFieldModule,
|
|
150
|
+
DragDropModule,
|
|
151
|
+
GramDeonEmptyModule, i8.FormlyModule] });
|
|
152
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzRepeatCardModule, imports: [CommonModule,
|
|
153
|
+
ReactiveFormsModule,
|
|
154
|
+
NzEmptyModule,
|
|
155
|
+
NzTableModule,
|
|
156
|
+
NzButtonModule,
|
|
157
|
+
NzIconModule,
|
|
158
|
+
NzModalModule,
|
|
159
|
+
NzToolTipModule,
|
|
160
|
+
DeonNzFormFieldModule,
|
|
161
|
+
DragDropModule,
|
|
162
|
+
GramDeonEmptyModule,
|
|
163
|
+
FormlyModule.forChild({
|
|
164
|
+
types: [
|
|
165
|
+
{
|
|
166
|
+
name: 'repeat-card',
|
|
167
|
+
component: DeonNzFieldRepeatCard,
|
|
168
|
+
},
|
|
169
|
+
],
|
|
170
|
+
})] });
|
|
171
|
+
}
|
|
172
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzRepeatCardModule, decorators: [{
|
|
173
|
+
type: NgModule,
|
|
174
|
+
args: [{
|
|
175
|
+
imports: [
|
|
176
|
+
CommonModule,
|
|
177
|
+
ReactiveFormsModule,
|
|
178
|
+
NzEmptyModule,
|
|
179
|
+
NzTableModule,
|
|
180
|
+
NzButtonModule,
|
|
181
|
+
NzIconModule,
|
|
182
|
+
NzModalModule,
|
|
183
|
+
NzToolTipModule,
|
|
184
|
+
DeonNzFormFieldModule,
|
|
185
|
+
DragDropModule,
|
|
186
|
+
GramDeonEmptyModule,
|
|
187
|
+
FormlyModule.forChild({
|
|
188
|
+
types: [
|
|
189
|
+
{
|
|
190
|
+
name: 'repeat-card',
|
|
191
|
+
component: DeonNzFieldRepeatCard,
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
}),
|
|
195
|
+
],
|
|
196
|
+
}]
|
|
197
|
+
}] });
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Generated bundle index. Do not edit.
|
|
201
|
+
*/
|
|
202
|
+
|
|
203
|
+
export { DeonNzFieldRepeatCard, DeonNzRepeatCardModule };
|
|
204
|
+
//# sourceMappingURL=type.repeat-card.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.repeat-card.mjs","sources":["../../../../packages/form/repeat-card/src/default/index.ts","../../../../packages/form/repeat-card/src/default/index.html","../../../../packages/form/repeat-card/src/index.module.ts","../../../../packages/form/repeat-card/type.repeat-card.ts"],"sourcesContent":["import { Component, AfterViewInit, OnInit, OnDestroy, OnChanges } from '@angular/core';\n\nimport { CommonModule } from '@angular/common';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';\nimport { NzToolTipModule } from 'ng-zorro-antd/tooltip';\nimport { NzButtonModule } from 'ng-zorro-antd/button';\nimport { DragDropModule } from '@angular/cdk/drag-drop';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\n\nimport { FormlyModule, FieldArrayType } from '@kre-form/core';\nimport { GramDeonEmptyModule } from '@ebuilding/base/components/empty';\nimport { GramGlobalService } from '@ebuilding/base/shared.srv/global.event';\n\nimport _ from 'lodash';\n@Component({\n selector: 'deon-nz-field-repeat-card',\n templateUrl: './index.html',\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n NzToolTipModule,\n NzButtonModule,\n DragDropModule,\n NzIconModule,\n FormlyModule,\n GramDeonEmptyModule\n ]\n})\nexport class DeonNzFieldRepeatCard extends FieldArrayType implements OnInit, OnDestroy, AfterViewInit, OnChanges {\n /**\n * 合并列\n */\n get colSpan() {\n let res = 0;\n if (this.field?.fieldArray[\"fieldGroup\"]) {\n res = this.field.fieldArray[\"fieldGroup\"].length + 2;\n }\n return res;\n }\n\n get dragDisabled() {\n let result: boolean = true;\n if (this.editor != false && _.get(this.props, 'drag') == true) {\n result = false;\n }\n return result;\n }\n\n get clasName() {\n if (this.props && this.props[\"className\"]) {\n return this.props[\"className\"];\n }\n return null;\n }\n\n get operationShow() {\n if (this.props && this.props[\"operationShow\"] != undefined && this.props[\"operationShow\"] != null) {\n return this.props[\"operationShow\"];\n }\n return false;\n }\n\n drop(event: CdkDragDrop<string[]>) {\n moveItemInArray(this.field.fieldGroup, event.previousIndex, event.currentIndex);\n moveItemInArray(this.model, event.previousIndex, event.currentIndex);\n }\n constructor(public globalSrv: GramGlobalService) {\n super();\n }\n\n ngOnInit() { }\n ngOnDestroy() { }\n ngAfterViewInit() { }\n ngOnChanges(change: any) {\n // this.resize();\n }\n\n fieldEditor(f: any, i: number, m: any) {\n if (f && f.props && f.props.builtin && f.props.builtin == true) {\n return true;\n }\n if (f && f.key == 'code' && m && m[i]['id']) {\n return false;\n }\n if (this.editor == false) {\n return false;\n } else {\n if (m && m[i]['builtin'] && m[i]['builtin'] == true) {\n return false;\n }\n return true;\n }\n }\n\n addData() {\n this.add();\n this.globalSrv.notifyDataChanged('deon-field-repeat-card', {\n field: this.field,\n data: null,\n type: 'add',\n });\n }\n\n rowDelete(e: any) {\n this.remove(e);\n this.globalSrv.notifyDataChanged('deon-field-repeat-card', {\n field: this.field,\n data: e,\n type: 'delete',\n });\n\n }\n\n rowOperation(button: any, e: any) {\n this.globalSrv.notifyDataChanged('deon-field-repeat-card', {\n field: this.field,\n data: e,\n type: button?.type,\n });\n }\n\n checkDelete(index: number) {\n if (this.props[\"hideDelete\"] && Array.isArray(this.props[\"hideDelete\"])) {\n if (\n this.props[\"hideDelete\"].some((item: any) => {\n return item == index;\n })\n ) {\n return false;\n }\n }\n return true;\n }\n}\n","<div class=\"repeat-card\" [ngClass]=\"clasName\">\n <ng-container *ngIf=\"props && props.label\">\n <div class=\"card-label\">{{props.label}}</div>\n </ng-container>\n <ng-container\n *ngIf=\"field.fieldGroup!==undefined && field.fieldGroup!==null && field.fieldGroup.length>0;else cardEmpty\">\n <ng-container *ngFor=\"let fields of field.fieldGroup; let i = index\">\n <div class=\"card-header\">\n <div class=\"serial\">序号:{{ i + 1 }}</div>\n <div calss=\"delete\">\n <ng-container *ngIf=\"editor!=false\">\n <a nz-tooltip nzTooltipTitle=\"删除\" *ngIf=\"checkDelete(i)\" (click)=\"rowDelete(i)\"><i nz-icon\n nzType=\"delete\"></i></a>\n </ng-container>\n </div>\n </div>\n <div class=\"card-body\">\n <ng-container *ngFor=\"let item of fields.fieldGroup\">\n <formly-field [field]=\"item\"></formly-field>\n </ng-container>\n </div>\n </ng-container>\n </ng-container>\n <ng-template #cardEmpty>\n <gram-empty></gram-empty>\n <ng-container *ngIf=\"editor!=false\">\n <a nz-button nzType=\"link\" (click)=\"addData()\">+添加</a>\n </ng-container>\n </ng-template>\n\n <ng-container *ngIf=\"editor!=false\">\n <div class=\"card-bottom\"\n *ngIf=\"field.fieldGroup!==undefined && field.fieldGroup!==null && field.fieldGroup.length>0\">\n <button nz-button nzType=\"default\" type=\"button\" (click)=\"addData()\">+添加</button>\n </div>\n </ng-container>\n</div>","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@kre-form/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { NzEmptyModule } from 'ng-zorro-antd/empty';\nimport { DragDropModule } from '@angular/cdk/drag-drop';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport { NzToolTipModule } from 'ng-zorro-antd/tooltip';\n\nimport { NzTableModule } from 'ng-zorro-antd/table';\nimport { NzButtonModule } from 'ng-zorro-antd/button';\nimport { NzModalModule } from 'ng-zorro-antd/modal';\n\nimport { DeonNzFormFieldModule } from '@ebuilding/form/form-field';\nimport { GramDeonEmptyModule } from \"@ebuilding/base/components/empty\";\n\nimport { DeonNzFieldRepeatCard } from './default/index';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n NzEmptyModule,\n NzTableModule,\n NzButtonModule,\n NzIconModule,\n NzModalModule,\n NzToolTipModule,\n DeonNzFormFieldModule,\n DragDropModule,\n GramDeonEmptyModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'repeat-card',\n component: DeonNzFieldRepeatCard,\n },\n ],\n }),\n ],\n})\nexport class DeonNzRepeatCardModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA8BM,MAAO,qBAAsB,SAAQ,cAAc,CAAA;AAsCpC,IAAA,SAAA;AArCnB;;AAEG;AACH,IAAA,IAAI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