ngx-axis-appforge 0.0.51 → 0.0.52
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/axis-components/rich-text-editor/design/index.d.ts +5 -0
- package/axis-components/rich-text-editor/index.d.ts +27 -0
- package/axis-components/table/index.d.ts +1 -1
- package/axis-components/table-helper/index.d.ts +1 -0
- package/axis-components-covers/rate.svg +2 -2
- package/axis-components-covers/rich-text-editor.png +0 -0
- package/fesm2022/ngx-axis-appforge-axis-components-button.mjs +2 -2
- package/fesm2022/ngx-axis-appforge-axis-components-button.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-design.mjs +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-form-item.mjs +2 -2
- package/fesm2022/ngx-axis-appforge-axis-components-form-item.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-form.mjs +2 -2
- package/fesm2022/ngx-axis-appforge-axis-components-form.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-rich-text-editor-design.mjs +76 -0
- package/fesm2022/ngx-axis-appforge-axis-components-rich-text-editor-design.mjs.map +1 -0
- package/fesm2022/ngx-axis-appforge-axis-components-rich-text-editor.mjs +139 -0
- package/fesm2022/ngx-axis-appforge-axis-components-rich-text-editor.mjs.map +1 -0
- package/fesm2022/ngx-axis-appforge-axis-components-table-helper.mjs +3 -0
- package/fesm2022/ngx-axis-appforge-axis-components-table-helper.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-table.mjs +4 -4
- package/fesm2022/ngx-axis-appforge-axis-components-table.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-upload.mjs +19 -13
- package/fesm2022/ngx-axis-appforge-axis-components-upload.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components.mjs +19 -2
- package/fesm2022/ngx-axis-appforge-axis-components.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-core.mjs +76 -4
- package/fesm2022/ngx-axis-appforge-core.mjs.map +1 -1
- package/package.json +123 -113
|
@@ -82,11 +82,11 @@ class FormItem extends Base {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: FormItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
85
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: FormItem, isStandalone: true, selector: "axis-form-item", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, usesInheritance: true, ngImport: i0, template: "@if (options.label()) {\n<nz-form-item style=\"width: 100%;display:flex\">\n <nz-form-label [style.width]=\"options.labelWidth()\" [nzRequired]=\"isRequired()\">\n {{options.label()}}\n </nz-form-label>\n <nz-form-control style=\"flex:1;overflow: hidden;\" [nzValidateStatus]=\"control\">\n <ng-container [axisDynamic]=\"options.child()\" (onRegisteValueAccess)=\"registeValueAccess($event)\"\n [(ngModel)]=\"value\" (ngModelChange)=\"onModelChange($event)\"></ng-container>\n </nz-form-control>\n</nz-form-item>\n}@else {\n<nz-form-item
|
|
85
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: FormItem, isStandalone: true, selector: "axis-form-item", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, usesInheritance: true, ngImport: i0, template: "@if (options.label()) {\n<nz-form-item style=\"width: 100%;display:flex\">\n <nz-form-label [style.width]=\"options.labelWidth()\" [nzRequired]=\"isRequired()\">\n {{options.label()}}\n </nz-form-label>\n <nz-form-control style=\"flex:1;overflow: hidden;\" [nzValidateStatus]=\"control\">\n <ng-container [axisDynamic]=\"options.child()\" (onRegisteValueAccess)=\"registeValueAccess($event)\"\n [(ngModel)]=\"value\" (ngModelChange)=\"onModelChange($event)\"></ng-container>\n </nz-form-control>\n</nz-form-item>\n}@else {\n<nz-form-item class=\"nolabel-item\">\n <nz-form-control [nzValidateStatus]=\"control\">\n <ng-container [axisDynamic]=\"options.child()\" (onRegisteValueAccess)=\"registeValueAccess($event)\"\n [(ngModel)]=\"value\" (ngModelChange)=\"onModelChange($event)\"></ng-container>\n </nz-form-control>\n</nz-form-item>\n}", styles: [":host{display:block;width:100%}.nolabel-item{margin:0;height:100%}.nolabel-item ::ng-deep .ant-form-item-control-input,.nolabel-item ::ng-deep .ant-form-item-control-input-content{height:100%}\n"], dependencies: [{ kind: "ngmodule", type: NzFormModule }, { kind: "directive", type: i1.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i1.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "component", type: i2.NzFormItemComponent, selector: "nz-form-item", exportAs: ["nzFormItem"] }, { kind: "component", type: i2.NzFormLabelComponent, selector: "nz-form-label", inputs: ["nzFor", "nzRequired", "nzNoColon", "nzTooltipTitle", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzFormLabel"] }, { kind: "component", type: i2.NzFormControlComponent, selector: "nz-form-control", inputs: ["nzSuccessTip", "nzWarningTip", "nzErrorTip", "nzValidatingTip", "nzExtra", "nzAutoTips", "nzDisableAutoTips", "nzHasFeedback", "nzValidateStatus"], exportAs: ["nzFormControl"] }, { kind: "directive", type: DynamicDirective, selector: "[axisDynamic]", inputs: ["axisDynamic", "standalone", "isDesign"], outputs: ["onRegisteValueAccess"], exportAs: ["axisDynamic"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
86
86
|
}
|
|
87
87
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: FormItem, decorators: [{
|
|
88
88
|
type: Component,
|
|
89
|
-
args: [{ selector: 'axis-form-item', imports: [NzFormModule, DynamicDirective, FormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (options.label()) {\n<nz-form-item style=\"width: 100%;display:flex\">\n <nz-form-label [style.width]=\"options.labelWidth()\" [nzRequired]=\"isRequired()\">\n {{options.label()}}\n </nz-form-label>\n <nz-form-control style=\"flex:1;overflow: hidden;\" [nzValidateStatus]=\"control\">\n <ng-container [axisDynamic]=\"options.child()\" (onRegisteValueAccess)=\"registeValueAccess($event)\"\n [(ngModel)]=\"value\" (ngModelChange)=\"onModelChange($event)\"></ng-container>\n </nz-form-control>\n</nz-form-item>\n}@else {\n<nz-form-item
|
|
89
|
+
args: [{ selector: 'axis-form-item', imports: [NzFormModule, DynamicDirective, FormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (options.label()) {\n<nz-form-item style=\"width: 100%;display:flex\">\n <nz-form-label [style.width]=\"options.labelWidth()\" [nzRequired]=\"isRequired()\">\n {{options.label()}}\n </nz-form-label>\n <nz-form-control style=\"flex:1;overflow: hidden;\" [nzValidateStatus]=\"control\">\n <ng-container [axisDynamic]=\"options.child()\" (onRegisteValueAccess)=\"registeValueAccess($event)\"\n [(ngModel)]=\"value\" (ngModelChange)=\"onModelChange($event)\"></ng-container>\n </nz-form-control>\n</nz-form-item>\n}@else {\n<nz-form-item class=\"nolabel-item\">\n <nz-form-control [nzValidateStatus]=\"control\">\n <ng-container [axisDynamic]=\"options.child()\" (onRegisteValueAccess)=\"registeValueAccess($event)\"\n [(ngModel)]=\"value\" (ngModelChange)=\"onModelChange($event)\"></ng-container>\n </nz-form-control>\n</nz-form-item>\n}", styles: [":host{display:block;width:100%}.nolabel-item{margin:0;height:100%}.nolabel-item ::ng-deep .ant-form-item-control-input,.nolabel-item ::ng-deep .ant-form-item-control-input-content{height:100%}\n"] }]
|
|
90
90
|
}], ctorParameters: () => [] });
|
|
91
91
|
|
|
92
92
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-axis-appforge-axis-components-form-item.mjs","sources":["../../../axis-components/form-item/form-item.options.ts","../../../axis-components/form-item/form-item.ts","../../../axis-components/form-item/form-item.html","../../../axis-components/form-item/ngx-axis-appforge-axis-components-form-item.ts"],"sourcesContent":["import { signal } from \"@angular/core\";\nimport { BaseOptions } from \"ngx-axis-appforge/core\";\n\nexport class FormItemOptions extends BaseOptions {\n\n readonly name = \"\";\n readonly label = signal(\"\");\n readonly labelWidth = signal(\"120px\");\n readonly validators = signal<any[]>([]);\n readonly child = signal<any>(undefined);\n\n}","import { ChangeDetectionStrategy, Component, computed, effect, inject, model, OnInit, signal } from '@angular/core';\nimport { FormItemOptions } from './form-item.options';\nimport { AXIS_FORM_REGISTE_CONTROL_TOKEN, Base, buildValidators, DynamicDirective, FormValidators, RegisteValueAccessOptions } from 'ngx-axis-appforge/core';\nimport { NzFormModule } from 'ng-zorro-antd/form';\nimport { FormBuilder, FormsModule, ValidatorFn } from '@angular/forms';\nimport { debounceTime, merge, NEVER } from 'rxjs';\nimport { toSignal } from '@angular/core/rxjs-interop';\n\n@Component({\n selector: 'axis-form-item',\n imports: [NzFormModule, DynamicDirective, FormsModule],\n templateUrl: './form-item.html',\n styleUrl: './form-item.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormItem extends Base<FormItemOptions> implements OnInit {\n\n constructor() {\n super();\n if (this.getScope()) {\n effect(() => {\n this.control.setValidators(this.validatorSignal() ?? null);\n });\n effect(() => {\n this.validatorSignal.set(this.buildSnapshotValidators());\n this.unsubscribe([\"validatorsChange\"]);\n this.addSubscribe(merge(...this.options.validators().map(v => this.getScope()!.dynamicOptions(v)?.obs ?? NEVER))\n .pipe(debounceTime(50))\n .subscribe(_ => {\n this.validatorSignal.set(this.buildSnapshotValidators());\n }), \"validatorsChange\");\n });\n }\n }\n\n override options: FormItemOptions = new FormItemOptions();\n private readonly registe = inject(AXIS_FORM_REGISTE_CONTROL_TOKEN, { optional: true });\n private readonly fb = inject(FormBuilder);\n readonly control = this.fb.control(undefined);\n readonly value = model<any>();\n readonly validatorSignal = signal<ValidatorFn[]>([]);\n readonly isRequired = computed(() => this.validatorSignal().includes(FormValidators.required));\n private valueAccessValidFn?: ValidatorFn;\n\n ngOnInit(): void {\n if (this.options.name) {\n this.control.registerOnChange((v: any) => {\n this.value.set(v);\n });\n this.registe?.({\n name: this.options.name,\n control: this.control,\n });\n }\n }\n\n onModelChange(value: any) {\n if (this.options.name) {\n this.control.markAsDirty();\n this.control.setValue(value);\n }\n }\n\n private buildSnapshotValidators(): ValidatorFn[] {\n return this.buildValidators(this.options.validators().map(v => this.getScope()!.snapshotOptions(v)));\n }\n\n private buildValidators(validators: any[]): ValidatorFn[] {\n let output: ValidatorFn[] = [];\n if (this.valueAccessValidFn) {\n output.push(this.valueAccessValidFn);\n }\n return output.concat(buildValidators(validators));\n }\n\n registeValueAccess(opt: RegisteValueAccessOptions) {\n if (opt.initValue !== undefined) {\n this.registe?.({\n name: this.options.name,\n initValue: opt.initValue\n });\n }\n if (opt.validFn) {\n this.valueAccessValidFn = (c) => opt.validFn!(c) ? null : { error: true };\n this.validatorSignal.set(this.buildSnapshotValidators());\n }\n }\n\n}","@if (options.label()) {\n<nz-form-item style=\"width: 100%;display:flex\">\n <nz-form-label [style.width]=\"options.labelWidth()\" [nzRequired]=\"isRequired()\">\n {{options.label()}}\n </nz-form-label>\n <nz-form-control style=\"flex:1;overflow: hidden;\" [nzValidateStatus]=\"control\">\n <ng-container [axisDynamic]=\"options.child()\" (onRegisteValueAccess)=\"registeValueAccess($event)\"\n [(ngModel)]=\"value\" (ngModelChange)=\"onModelChange($event)\"></ng-container>\n </nz-form-control>\n</nz-form-item>\n}@else {\n<nz-form-item
|
|
1
|
+
{"version":3,"file":"ngx-axis-appforge-axis-components-form-item.mjs","sources":["../../../axis-components/form-item/form-item.options.ts","../../../axis-components/form-item/form-item.ts","../../../axis-components/form-item/form-item.html","../../../axis-components/form-item/ngx-axis-appforge-axis-components-form-item.ts"],"sourcesContent":["import { signal } from \"@angular/core\";\nimport { BaseOptions } from \"ngx-axis-appforge/core\";\n\nexport class FormItemOptions extends BaseOptions {\n\n readonly name = \"\";\n readonly label = signal(\"\");\n readonly labelWidth = signal(\"120px\");\n readonly validators = signal<any[]>([]);\n readonly child = signal<any>(undefined);\n\n}","import { ChangeDetectionStrategy, Component, computed, effect, inject, model, OnInit, signal } from '@angular/core';\nimport { FormItemOptions } from './form-item.options';\nimport { AXIS_FORM_REGISTE_CONTROL_TOKEN, Base, buildValidators, DynamicDirective, FormValidators, RegisteValueAccessOptions } from 'ngx-axis-appforge/core';\nimport { NzFormModule } from 'ng-zorro-antd/form';\nimport { FormBuilder, FormsModule, ValidatorFn } from '@angular/forms';\nimport { debounceTime, merge, NEVER } from 'rxjs';\nimport { toSignal } from '@angular/core/rxjs-interop';\n\n@Component({\n selector: 'axis-form-item',\n imports: [NzFormModule, DynamicDirective, FormsModule],\n templateUrl: './form-item.html',\n styleUrl: './form-item.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormItem extends Base<FormItemOptions> implements OnInit {\n\n constructor() {\n super();\n if (this.getScope()) {\n effect(() => {\n this.control.setValidators(this.validatorSignal() ?? null);\n });\n effect(() => {\n this.validatorSignal.set(this.buildSnapshotValidators());\n this.unsubscribe([\"validatorsChange\"]);\n this.addSubscribe(merge(...this.options.validators().map(v => this.getScope()!.dynamicOptions(v)?.obs ?? NEVER))\n .pipe(debounceTime(50))\n .subscribe(_ => {\n this.validatorSignal.set(this.buildSnapshotValidators());\n }), \"validatorsChange\");\n });\n }\n }\n\n override options: FormItemOptions = new FormItemOptions();\n private readonly registe = inject(AXIS_FORM_REGISTE_CONTROL_TOKEN, { optional: true });\n private readonly fb = inject(FormBuilder);\n readonly control = this.fb.control(undefined);\n readonly value = model<any>();\n readonly validatorSignal = signal<ValidatorFn[]>([]);\n readonly isRequired = computed(() => this.validatorSignal().includes(FormValidators.required));\n private valueAccessValidFn?: ValidatorFn;\n\n ngOnInit(): void {\n if (this.options.name) {\n this.control.registerOnChange((v: any) => {\n this.value.set(v);\n });\n this.registe?.({\n name: this.options.name,\n control: this.control,\n });\n }\n }\n\n onModelChange(value: any) {\n if (this.options.name) {\n this.control.markAsDirty();\n this.control.setValue(value);\n }\n }\n\n private buildSnapshotValidators(): ValidatorFn[] {\n return this.buildValidators(this.options.validators().map(v => this.getScope()!.snapshotOptions(v)));\n }\n\n private buildValidators(validators: any[]): ValidatorFn[] {\n let output: ValidatorFn[] = [];\n if (this.valueAccessValidFn) {\n output.push(this.valueAccessValidFn);\n }\n return output.concat(buildValidators(validators));\n }\n\n registeValueAccess(opt: RegisteValueAccessOptions) {\n if (opt.initValue !== undefined) {\n this.registe?.({\n name: this.options.name,\n initValue: opt.initValue\n });\n }\n if (opt.validFn) {\n this.valueAccessValidFn = (c) => opt.validFn!(c) ? null : { error: true };\n this.validatorSignal.set(this.buildSnapshotValidators());\n }\n }\n\n}","@if (options.label()) {\n<nz-form-item style=\"width: 100%;display:flex\">\n <nz-form-label [style.width]=\"options.labelWidth()\" [nzRequired]=\"isRequired()\">\n {{options.label()}}\n </nz-form-label>\n <nz-form-control style=\"flex:1;overflow: hidden;\" [nzValidateStatus]=\"control\">\n <ng-container [axisDynamic]=\"options.child()\" (onRegisteValueAccess)=\"registeValueAccess($event)\"\n [(ngModel)]=\"value\" (ngModelChange)=\"onModelChange($event)\"></ng-container>\n </nz-form-control>\n</nz-form-item>\n}@else {\n<nz-form-item class=\"nolabel-item\">\n <nz-form-control [nzValidateStatus]=\"control\">\n <ng-container [axisDynamic]=\"options.child()\" (onRegisteValueAccess)=\"registeValueAccess($event)\"\n [(ngModel)]=\"value\" (ngModelChange)=\"onModelChange($event)\"></ng-container>\n </nz-form-control>\n</nz-form-item>\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './form-item';\n"],"names":[],"mappings":";;;;;;;;;;AAGM,MAAO,eAAgB,SAAQ,WAAW,CAAA;IAEnC,IAAI,GAAG,EAAE;AACT,IAAA,KAAK,GAAG,MAAM,CAAC,EAAE,iDAAC;AAClB,IAAA,UAAU,GAAG,MAAM,CAAC,OAAO,sDAAC;AAC5B,IAAA,UAAU,GAAG,MAAM,CAAQ,EAAE,sDAAC;AAC9B,IAAA,KAAK,GAAG,MAAM,CAAM,SAAS,iDAAC;AAE1C;;ACIK,MAAO,QAAS,SAAQ,IAAqB,CAAA;AAEjD,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;AACP,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE,EAAE;YACnB,MAAM,CAAC,MAAK;AACV,gBAAA,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,IAAI,CAAC;AAC5D,YAAA,CAAC,CAAC;YACF,MAAM,CAAC,MAAK;gBACV,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC;AACxD,gBAAA,IAAI,CAAC,WAAW,CAAC,CAAC,kBAAkB,CAAC,CAAC;AACtC,gBAAA,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAG,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,KAAK,CAAC;AAC5G,qBAAA,IAAI,CAAC,YAA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BAAA,EAAA,SAAA,EAAA,YAAA,EAAA,mBAAA,EAAA,eAAA,EAAA,kBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,eAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,gBAAgB,0KAAE,WAAW,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,2CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,qDAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,SAAA,EAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAK1C,QAAQ,EAAA,UAAA,EAAA,CAAA;kBAPpB,SAAS;+BACE,gBAAgB,EAAA,OAAA,EACjB,CAAC,YAAY,EAAE,gBAAgB,EAAE,WAAW,CAAC,EAAA,eAAA,EAGrC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,s4BAAA,EAAA,MAAA,EAAA,CAAA,oMAAA,CAAA,EAAA;;;AEbjD;;AAEG;;;;"}
|
|
@@ -128,7 +128,7 @@ class Form extends ValueAccess {
|
|
|
128
128
|
},
|
|
129
129
|
deps: [Form]
|
|
130
130
|
}
|
|
131
|
-
], usesInheritance: true, ngImport: i0, template: "<form [formGroup]=\"fg\">\n <ng-container [axisDynamic]=\"options.child()\"></ng-container>\n</form>", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: DynamicDirective, selector: "[axisDynamic]", inputs: ["axisDynamic", "standalone", "isDesign"], outputs: ["onRegisteValueAccess"], exportAs: ["axisDynamic"] }, { kind: "ngmodule", type: NzModalModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
131
|
+
], usesInheritance: true, ngImport: i0, template: "<form [formGroup]=\"fg\" style=\"height: 100%;\">\n <ng-container [axisDynamic]=\"options.child()\"></ng-container>\n</form>", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: DynamicDirective, selector: "[axisDynamic]", inputs: ["axisDynamic", "standalone", "isDesign"], outputs: ["onRegisteValueAccess"], exportAs: ["axisDynamic"] }, { kind: "ngmodule", type: NzModalModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
132
132
|
}
|
|
133
133
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: Form, decorators: [{
|
|
134
134
|
type: Component,
|
|
@@ -140,7 +140,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
|
|
|
140
140
|
},
|
|
141
141
|
deps: [Form]
|
|
142
142
|
}
|
|
143
|
-
], template: "<form [formGroup]=\"fg\">\n <ng-container [axisDynamic]=\"options.child()\"></ng-container>\n</form>", styles: [":host{display:block}\n"] }]
|
|
143
|
+
], template: "<form [formGroup]=\"fg\" style=\"height: 100%;\">\n <ng-container [axisDynamic]=\"options.child()\"></ng-container>\n</form>", styles: [":host{display:block}\n"] }]
|
|
144
144
|
}], ctorParameters: () => [] });
|
|
145
145
|
|
|
146
146
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-axis-appforge-axis-components-form.mjs","sources":["../../../axis-components/form/form.options.ts","../../../axis-components/form/form.ts","../../../axis-components/form/form.html","../../../axis-components/form/ngx-axis-appforge-axis-components-form.ts"],"sourcesContent":["import { signal } from \"@angular/core\";\nimport { ValueAccessOptions } from \"ngx-axis-appforge/core\";\n\nexport class FormOptions extends ValueAccessOptions {\n\n readonly submitConfirm = signal(true);\n readonly child = signal<any>(undefined);\n\n}","import { ChangeDetectionStrategy, Component, inject, OnInit } from '@angular/core';\nimport { AXIS_FORM_REGISTE_CONTROL_TOKEN, DynamicDirective, EventHandlerOptions, RegisteFormControlOptions, updateAndValidAll, ValueAccess } from 'ngx-axis-appforge/core';\nimport { FormOptions } from './form.options';\nimport { AbstractControl, FormBuilder, ReactiveFormsModule, UntypedFormGroup } from '@angular/forms';\nimport { bufferWhen, debounceTime, map, Observable, of, Subject } from 'rxjs';\nimport { NzModalModule, NzModalService } from 'ng-zorro-antd/modal';\n\n@Component({\n selector: 'axis-form',\n imports: [ReactiveFormsModule, DynamicDirective, NzModalModule],\n templateUrl: './form.html',\n styleUrl: './form.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: AXIS_FORM_REGISTE_CONTROL_TOKEN,\n useFactory: (form: Form) => {\n return form.registerControl.bind(form);\n },\n deps: [Form]\n }\n ]\n})\nexport class Form extends ValueAccess<FormOptions> implements OnInit {\n\n constructor() {\n super();\n this.addSubscribe(this.fg.valueChanges.subscribe(v => {\n this.value.set(v);\n this.onChange?.(v);\n }));\n this.addSubscribe(this.resetSubject.pipe(bufferWhen(() => this.resetSubject.pipe(debounceTime(50))), map(v => v.reduce((a, b) => a || b, false)))\n .subscribe(emitEvent => this.reset(emitEvent)));\n this.addSubscribe(this.fg.statusChanges.subscribe(_ => {\n const { valid, dirty } = this.fg\n this.triggeEvents(\"formStatusChange\", { status: { valid, dirty } }).subscribe();\n }))\n }\n\n override options: FormOptions = new FormOptions();\n private readonly fb = inject(FormBuilder);\n private readonly modal = inject(NzModalService);\n readonly fg: UntypedFormGroup = this.fb.group({});\n private oriFormValue: any;\n private oriValue: any;\n private resetSubject = new Subject<boolean>();\n\n override writeValue(value: any): void {\n super.writeValue(value);\n this.oriFormValue = value;\n this.oriValue = this.oriFormValue;\n this.resetSubject.next(false);\n }\n\n override setInitValue(value: any): void {\n super.setInitValue(value);\n if (this.options.initValue() !== undefined) {\n this.oriFormValue = this.options.initValue();\n this.oriValue = this.oriFormValue;\n this.resetSubject.next(false);\n }\n }\n\n ngOnInit(): void {\n this.registeValueAccess?.({\n validFn: (control: AbstractControl) => {\n return updateAndValidAll(this.fg, { markAsDirty: control.dirty })\n }\n })\n }\n\n registerControl(opt: RegisteFormControlOptions) {\n if (opt.control) {\n const oldControl = this.fg.get(opt.name);\n if (oldControl?.value != undefined) {\n opt.control.setValue(oldControl.value);\n }\n this.fg.setControl(opt.name, opt.control, { emitEvent: false });\n }\n if (this.fg.dirty) {\n if (opt.initValue !== undefined) {\n this.fg.patchValue({ [opt.name]: opt.initValue });\n }\n } else {\n if (this.oriFormValue?.[opt.name] === undefined && opt.initValue !== undefined) {\n this.oriValue = Object.assign({}, this.oriValue, { [opt.name]: opt.initValue });\n this.registeValueAccess?.({\n initValue: this.oriValue\n });\n }\n this.resetSubject.next(false);\n }\n }\n\n reset(emitEvent = false) {\n this.fg.reset(this.oriValue, { emitEvent: emitEvent, onlySelf: true });\n if (!emitEvent && this.options.emitInitEvent()) {\n this.triggeEvents(\"valueChange\", { value: this.fg.value }).subscribe();\n }\n if (!emitEvent) {\n const { valid, dirty } = this.fg\n this.triggeEvents(\"formStatusChange\", { status: { valid, dirty } }).subscribe();\n }\n }\n\n override onEvents(e: EventHandlerOptions<any>): Observable<boolean> | undefined {\n const obs = super.onEvents(e);\n if (obs) {\n return;\n }\n switch (e.name) {\n case \"validForm\":\n if (updateAndValidAll(this.fg)) {\n if (this.options.submitConfirm()) {\n const subject = new Subject<boolean>();\n this.modal.confirm({\n nzTitle: \"确定提交吗?\",\n nzOnOk: () => {\n this.triggeEvents(\"formValid\", { formValue: this.fg.value }, e.triggeEvents).subscribe(subject);\n },\n nzOnCancel: () => {\n subject.next(false);\n subject.complete();\n }\n });\n return subject.asObservable();\n } else {\n return this.triggeEvents(\"formValid\", { formValue: this.fg.value }, e.triggeEvents);\n }\n }\n return of(false);\n case \"resetForm\":\n this.reset(true);\n return of(true);\n }\n return undefined;\n }\n\n}\n","<form [formGroup]=\"fg\">\n <ng-container [axisDynamic]=\"options.child()\"></ng-container>\n</form>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './form';\n"],"names":[],"mappings":";;;;;;;;AAGM,MAAO,WAAY,SAAQ,kBAAkB,CAAA;AAEtC,IAAA,aAAa,GAAG,MAAM,CAAC,IAAI,yDAAC;AAC5B,IAAA,KAAK,GAAG,MAAM,CAAM,SAAS,iDAAC;AAE1C;;ACeK,MAAO,IAAK,SAAQ,WAAwB,CAAA;AAEhD,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;AACP,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,IAAG;AACnD,YAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AACjB,YAAA,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC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C,IAAI,CAAC;4BACxC,CAAC;AACD,4BAAA,IAAI,EAAE,CAAA,IAAA;AACP;AACF,qBAAA,EAAA,QAAA,EAAA,yGAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA;;;AErBH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-axis-appforge-axis-components-form.mjs","sources":["../../../axis-components/form/form.options.ts","../../../axis-components/form/form.ts","../../../axis-components/form/form.html","../../../axis-components/form/ngx-axis-appforge-axis-components-form.ts"],"sourcesContent":["import { signal } from \"@angular/core\";\nimport { ValueAccessOptions } from \"ngx-axis-appforge/core\";\n\nexport class FormOptions extends ValueAccessOptions {\n\n readonly submitConfirm = signal(true);\n readonly child = signal<any>(undefined);\n\n}","import { ChangeDetectionStrategy, Component, inject, OnInit } from '@angular/core';\nimport { AXIS_FORM_REGISTE_CONTROL_TOKEN, DynamicDirective, EventHandlerOptions, RegisteFormControlOptions, updateAndValidAll, ValueAccess } from 'ngx-axis-appforge/core';\nimport { FormOptions } from './form.options';\nimport { AbstractControl, FormBuilder, ReactiveFormsModule, UntypedFormGroup } from '@angular/forms';\nimport { bufferWhen, debounceTime, map, Observable, of, Subject } from 'rxjs';\nimport { NzModalModule, NzModalService } from 'ng-zorro-antd/modal';\n\n@Component({\n selector: 'axis-form',\n imports: [ReactiveFormsModule, DynamicDirective, NzModalModule],\n templateUrl: './form.html',\n styleUrl: './form.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: AXIS_FORM_REGISTE_CONTROL_TOKEN,\n useFactory: (form: Form) => {\n return form.registerControl.bind(form);\n },\n deps: [Form]\n }\n ]\n})\nexport class Form extends ValueAccess<FormOptions> implements OnInit {\n\n constructor() {\n super();\n this.addSubscribe(this.fg.valueChanges.subscribe(v => {\n this.value.set(v);\n this.onChange?.(v);\n }));\n this.addSubscribe(this.resetSubject.pipe(bufferWhen(() => this.resetSubject.pipe(debounceTime(50))), map(v => v.reduce((a, b) => a || b, false)))\n .subscribe(emitEvent => this.reset(emitEvent)));\n this.addSubscribe(this.fg.statusChanges.subscribe(_ => {\n const { valid, dirty } = this.fg\n this.triggeEvents(\"formStatusChange\", { status: { valid, dirty } }).subscribe();\n }))\n }\n\n override options: FormOptions = new FormOptions();\n private readonly fb = inject(FormBuilder);\n private readonly modal = inject(NzModalService);\n readonly fg: UntypedFormGroup = this.fb.group({});\n private oriFormValue: any;\n private oriValue: any;\n private resetSubject = new Subject<boolean>();\n\n override writeValue(value: any): void {\n super.writeValue(value);\n this.oriFormValue = value;\n this.oriValue = this.oriFormValue;\n this.resetSubject.next(false);\n }\n\n override setInitValue(value: any): void {\n super.setInitValue(value);\n if (this.options.initValue() !== undefined) {\n this.oriFormValue = this.options.initValue();\n this.oriValue = this.oriFormValue;\n this.resetSubject.next(false);\n }\n }\n\n ngOnInit(): void {\n this.registeValueAccess?.({\n validFn: (control: AbstractControl) => {\n return updateAndValidAll(this.fg, { markAsDirty: control.dirty })\n }\n })\n }\n\n registerControl(opt: RegisteFormControlOptions) {\n if (opt.control) {\n const oldControl = this.fg.get(opt.name);\n if (oldControl?.value != undefined) {\n opt.control.setValue(oldControl.value);\n }\n this.fg.setControl(opt.name, opt.control, { emitEvent: false });\n }\n if (this.fg.dirty) {\n if (opt.initValue !== undefined) {\n this.fg.patchValue({ [opt.name]: opt.initValue });\n }\n } else {\n if (this.oriFormValue?.[opt.name] === undefined && opt.initValue !== undefined) {\n this.oriValue = Object.assign({}, this.oriValue, { [opt.name]: opt.initValue });\n this.registeValueAccess?.({\n initValue: this.oriValue\n });\n }\n this.resetSubject.next(false);\n }\n }\n\n reset(emitEvent = false) {\n this.fg.reset(this.oriValue, { emitEvent: emitEvent, onlySelf: true });\n if (!emitEvent && this.options.emitInitEvent()) {\n this.triggeEvents(\"valueChange\", { value: this.fg.value }).subscribe();\n }\n if (!emitEvent) {\n const { valid, dirty } = this.fg\n this.triggeEvents(\"formStatusChange\", { status: { valid, dirty } }).subscribe();\n }\n }\n\n override onEvents(e: EventHandlerOptions<any>): Observable<boolean> | undefined {\n const obs = super.onEvents(e);\n if (obs) {\n return;\n }\n switch (e.name) {\n case \"validForm\":\n if (updateAndValidAll(this.fg)) {\n if (this.options.submitConfirm()) {\n const subject = new Subject<boolean>();\n this.modal.confirm({\n nzTitle: \"确定提交吗?\",\n nzOnOk: () => {\n this.triggeEvents(\"formValid\", { formValue: this.fg.value }, e.triggeEvents).subscribe(subject);\n },\n nzOnCancel: () => {\n subject.next(false);\n subject.complete();\n }\n });\n return subject.asObservable();\n } else {\n return this.triggeEvents(\"formValid\", { formValue: this.fg.value }, e.triggeEvents);\n }\n }\n return of(false);\n case \"resetForm\":\n this.reset(true);\n return of(true);\n }\n return undefined;\n }\n\n}\n","<form [formGroup]=\"fg\" style=\"height: 100%;\">\n <ng-container [axisDynamic]=\"options.child()\"></ng-container>\n</form>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './form';\n"],"names":[],"mappings":";;;;;;;;AAGM,MAAO,WAAY,SAAQ,kBAAkB,CAAA;AAEtC,IAAA,aAAa,GAAG,MAAM,CAAC,IAAI,yDAAC;AAC5B,IAAA,KAAK,GAAG,MAAM,CAAM,SAAS,iDAAC;AAE1C;;ACeK,MAAO,IAAK,SAAQ,WAAwB,CAAA;AAEhD,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;AACP,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,IAAG;AACnD,YAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AACjB,YAAA,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,G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4BACxC,CAAC;AACD,4BAAA,IAAI,EAAE,CAAA,IAAA;AACP;AACF,qBAAA,EAAA,QAAA,EAAA,iIAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA;;;AErBH;;AAEG;;;;"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { FunFieldValueBase, FormValidators, valueFbConfig, baseFbConfig, valueFunField, baseFunField, FunField, BaseDesignSetting, InputTrigger, ValueDesignSetting, DynamicDirective, OptionsNode, SimpleMenu } from 'ngx-axis-appforge/core';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
+
import * as i1 from '@angular/forms';
|
|
5
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
6
|
+
import * as i2 from 'ng-zorro-antd/collapse';
|
|
7
|
+
import { NzCollapseModule } from 'ng-zorro-antd/collapse';
|
|
8
|
+
import * as i5 from 'ng-zorro-antd/form';
|
|
9
|
+
import { NzFormModule } from 'ng-zorro-antd/form';
|
|
10
|
+
import * as i3 from 'ng-zorro-antd/input';
|
|
11
|
+
import { NzInputModule } from 'ng-zorro-antd/input';
|
|
12
|
+
import * as i4 from 'ng-zorro-antd/grid';
|
|
13
|
+
|
|
14
|
+
class Setting extends FunFieldValueBase {
|
|
15
|
+
fg = this.fb.group({
|
|
16
|
+
...baseFbConfig,
|
|
17
|
+
...valueFbConfig,
|
|
18
|
+
fileUploadUrl: [undefined, FormValidators.requiredFun],
|
|
19
|
+
fileUploadFormName: [undefined, FormValidators.requiredFun],
|
|
20
|
+
fileUploadResponseFn: [],
|
|
21
|
+
tinymceOptions: [],
|
|
22
|
+
});
|
|
23
|
+
funFields = {
|
|
24
|
+
...baseFunField,
|
|
25
|
+
...valueFunField,
|
|
26
|
+
fileUploadUrl: {
|
|
27
|
+
defaultValue: undefined,
|
|
28
|
+
},
|
|
29
|
+
fileUploadFormName: {
|
|
30
|
+
defaultValue: "file"
|
|
31
|
+
},
|
|
32
|
+
tinymceOptions: {
|
|
33
|
+
defaultValue: undefined
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: Setting, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
37
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.4", type: Setting, isStandalone: true, selector: "axis-design-input-setting", usesInheritance: true, ngImport: i0, template: "<form [formGroup]=\"fg\" nz-form>\n <nz-collapse [nzBordered]=\"false\">\n <nz-collapse-panel nzHeader=\"\u57FA\u672C\u8BBE\u7F6E\" nzActive>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u4E0A\u4F20\u5730\u5740\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"fileUploadUrl\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" />\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u4E0A\u4F20\u8868\u5355\u540D\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"fileUploadFormName\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" />\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n \u4E0A\u4F20\u54CD\u5E94\u51FD\u6570\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"fileUploadResponseFn\"\n [scopes]=\"[{scopeId:'__uploadResponse',scopeName:'\u4E0A\u4F20\u63A5\u53E3\u54CD\u5E94',ds:{apiResponse:{tip:'\u793A\u4F8B\u6570\u636E'}}}]\"\n [noListen]=\"true\" [onlyFun]=\"true\"\n editTip=\"\u8BF7\u8FD4\u56DE\u4E00\u4E2A\u5BF9\u8C61\uFF0C\u7C7B\u578B\uFF1A{success:boolean,errmsg?:string,url?:string}\"></axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n TinyMCE\u914D\u7F6E\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"tinymceOptions\">\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\"\n [standalone]=\"true\" ngModel [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n <span style=\"font-size: 13px;color:rgba(0,0,0,.54)\">\u914D\u7F6E\u8BF4\u660E\u67E5\u770B<a\n href=\"https://www.tiny.cloud/docs/tinymce/latest/\" target=\"_blank\">Tiny\u5B98\u65B9\u6587\u6863</a></span>\n </nz-form-control>\n </nz-form-item>\n </nz-collapse-panel>\n <axis-value-design-setting [fg]=\"fg\"></axis-value-design-setting>\n <axis-base-design-setting [fg]=\"fg\"></axis-base-design-setting>\n <axis-input-trigger formControlName=\"triggeEvents\" [internalTriggers]=\"['valueChange']\"></axis-input-trigger>\n </nz-collapse>\n</form>", styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzCollapseModule }, { kind: "component", type: i2.NzCollapsePanelComponent, selector: "nz-collapse-panel", inputs: ["nzActive", "nzDisabled", "nzShowArrow", "nzExtra", "nzHeader", "nzExpandedIcon", "nzCollapsible"], outputs: ["nzActiveChange"], exportAs: ["nzCollapsePanel"] }, { kind: "component", type: i2.NzCollapseComponent, selector: "nz-collapse", inputs: ["nzAccordion", "nzBordered", "nzGhost", "nzExpandIconPosition", "nzSize"], exportAs: ["nzCollapse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: NzInputModule }, { kind: "directive", type: i3.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzVariant", "nzSize", "nzStepperless", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "ngmodule", type: NzFormModule }, { kind: "directive", type: i4.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i4.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i5.NzFormDirective, selector: "[nz-form]", inputs: ["nzLayout", "nzNoColon", "nzAutoTips", "nzDisableAutoTips", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzForm"] }, { kind: "component", type: i5.NzFormItemComponent, selector: "nz-form-item", exportAs: ["nzFormItem"] }, { kind: "component", type: i5.NzFormLabelComponent, selector: "nz-form-label", inputs: ["nzFor", "nzRequired", "nzNoColon", "nzTooltipTitle", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzFormLabel"] }, { kind: "component", type: i5.NzFormControlComponent, selector: "nz-form-control", inputs: ["nzSuccessTip", "nzWarningTip", "nzErrorTip", "nzValidatingTip", "nzExtra", "nzAutoTips", "nzDisableAutoTips", "nzHasFeedback", "nzValidateStatus"], exportAs: ["nzFormControl"] }, { kind: "component", type: FunField, selector: "axis-fun-field", inputs: ["scopes", "exclude", "scopeId", "onlyFun", "noListen", "disabled", "editTip", "value", "open", "showCreateListenModal", "createListenDataSourceName"], outputs: ["valueChange", "openChange", "showCreateListenModalChange", "createListenDataSourceNameChange"] }, { kind: "component", type: BaseDesignSetting, selector: "axis-base-design-setting", inputs: ["scopeId", "exclude", "fg"] }, { kind: "component", type: InputTrigger, selector: "axis-input-trigger", inputs: ["internalTriggers", "optionsNodeId", "value", "eventDesc", "isVisibleHandlerModal", "editEventHandler"], outputs: ["valueChange", "isVisibleHandlerModalChange", "editEventHandlerChange"] }, { kind: "component", type: ValueDesignSetting, selector: "axis-value-design-setting", inputs: ["scopeId", "exclude", "fg"] }, { kind: "directive", type: DynamicDirective, selector: "[axisDynamic]", inputs: ["axisDynamic", "standalone", "isDesign"], outputs: ["onRegisteValueAccess"], exportAs: ["axisDynamic"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
38
|
+
}
|
|
39
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: Setting, decorators: [{
|
|
40
|
+
type: Component,
|
|
41
|
+
args: [{ selector: 'axis-design-input-setting', imports: [FormsModule, NzCollapseModule, ReactiveFormsModule, NzInputModule, NzFormModule, FunField, BaseDesignSetting, InputTrigger, ValueDesignSetting, DynamicDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"fg\" nz-form>\n <nz-collapse [nzBordered]=\"false\">\n <nz-collapse-panel nzHeader=\"\u57FA\u672C\u8BBE\u7F6E\" nzActive>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u4E0A\u4F20\u5730\u5740\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"fileUploadUrl\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" />\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u4E0A\u4F20\u8868\u5355\u540D\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"fileUploadFormName\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" />\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n \u4E0A\u4F20\u54CD\u5E94\u51FD\u6570\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"fileUploadResponseFn\"\n [scopes]=\"[{scopeId:'__uploadResponse',scopeName:'\u4E0A\u4F20\u63A5\u53E3\u54CD\u5E94',ds:{apiResponse:{tip:'\u793A\u4F8B\u6570\u636E'}}}]\"\n [noListen]=\"true\" [onlyFun]=\"true\"\n editTip=\"\u8BF7\u8FD4\u56DE\u4E00\u4E2A\u5BF9\u8C61\uFF0C\u7C7B\u578B\uFF1A{success:boolean,errmsg?:string,url?:string}\"></axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n TinyMCE\u914D\u7F6E\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"tinymceOptions\">\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\"\n [standalone]=\"true\" ngModel [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n <span style=\"font-size: 13px;color:rgba(0,0,0,.54)\">\u914D\u7F6E\u8BF4\u660E\u67E5\u770B<a\n href=\"https://www.tiny.cloud/docs/tinymce/latest/\" target=\"_blank\">Tiny\u5B98\u65B9\u6587\u6863</a></span>\n </nz-form-control>\n </nz-form-item>\n </nz-collapse-panel>\n <axis-value-design-setting [fg]=\"fg\"></axis-value-design-setting>\n <axis-base-design-setting [fg]=\"fg\"></axis-base-design-setting>\n <axis-input-trigger formControlName=\"triggeEvents\" [internalTriggers]=\"['valueChange']\"></axis-input-trigger>\n </nz-collapse>\n</form>" }]
|
|
42
|
+
}] });
|
|
43
|
+
|
|
44
|
+
const Config = {
|
|
45
|
+
componentName: "富文本编辑器",
|
|
46
|
+
buildOptionsNodes(nextInfo) {
|
|
47
|
+
return {
|
|
48
|
+
treeNode: new OptionsNode({
|
|
49
|
+
parentId: nextInfo.parentId,
|
|
50
|
+
scopeId: nextInfo.scopeId,
|
|
51
|
+
name: "富文本编辑器",
|
|
52
|
+
canSetting: true,
|
|
53
|
+
canDrag: true,
|
|
54
|
+
dragType: "component",
|
|
55
|
+
parentObj: nextInfo.parentObject,
|
|
56
|
+
indexOfParentObj: nextInfo.indexOfParent,
|
|
57
|
+
rootOptions: nextInfo.currentObject,
|
|
58
|
+
settingType: Setting,
|
|
59
|
+
contextMenu: SimpleMenu,
|
|
60
|
+
icon: "font-colors",
|
|
61
|
+
}),
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
bindElementsOptionsNode(element, options) {
|
|
65
|
+
return {
|
|
66
|
+
[options.id]: { element }
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Generated bundle index. Do not edit.
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
export { Config };
|
|
76
|
+
//# sourceMappingURL=ngx-axis-appforge-axis-components-rich-text-editor-design.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-axis-appforge-axis-components-rich-text-editor-design.mjs","sources":["../../../axis-components/rich-text-editor/design/setting/setting.ts","../../../axis-components/rich-text-editor/design/setting/setting.html","../../../axis-components/rich-text-editor/design/config.ts","../../../axis-components/rich-text-editor/design/ngx-axis-appforge-axis-components-rich-text-editor-design.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule, UntypedFormGroup } from '@angular/forms';\nimport { NzCollapseModule } from 'ng-zorro-antd/collapse';\nimport { NzFormModule } from 'ng-zorro-antd/form';\nimport { NzInputModule } from 'ng-zorro-antd/input';\nimport { BaseDesignSetting, baseFbConfig, baseFunField, DynamicDirective, FormValidators, FunField, FunFieldOptions, FunFieldValueBase, InputTrigger, ValueDesignSetting, valueFbConfig, valueFunField } from 'ngx-axis-appforge/core';\n\n@Component({\n selector: 'axis-design-input-setting',\n imports: [FormsModule, NzCollapseModule, ReactiveFormsModule, NzInputModule, NzFormModule, FunField, BaseDesignSetting, InputTrigger, ValueDesignSetting, DynamicDirective],\n templateUrl: './setting.html',\n styleUrl: './setting.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Setting extends FunFieldValueBase {\n\n override fg: UntypedFormGroup = this.fb.group({\n ...baseFbConfig,\n ...valueFbConfig,\n fileUploadUrl: [undefined, FormValidators.requiredFun],\n fileUploadFormName: [undefined, FormValidators.requiredFun],\n fileUploadResponseFn: [],\n tinymceOptions: [],\n });\n\n protected override funFields: FunFieldOptions = {\n ...baseFunField,\n ...valueFunField,\n fileUploadUrl: {\n defaultValue: undefined,\n },\n fileUploadFormName: {\n defaultValue: \"file\"\n },\n tinymceOptions: {\n defaultValue: undefined\n }\n };\n}\n","<form [formGroup]=\"fg\" nz-form>\n <nz-collapse [nzBordered]=\"false\">\n <nz-collapse-panel nzHeader=\"基本设置\" nzActive>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n 上传地址\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"fileUploadUrl\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" />\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n 上传表单名\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"fileUploadFormName\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" />\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n 上传响应函数\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"fileUploadResponseFn\"\n [scopes]=\"[{scopeId:'__uploadResponse',scopeName:'上传接口响应',ds:{apiResponse:{tip:'示例数据'}}}]\"\n [noListen]=\"true\" [onlyFun]=\"true\"\n editTip=\"请返回一个对象,类型:{success:boolean,errmsg?:string,url?:string}\"></axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n TinyMCE配置\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"tinymceOptions\">\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\"\n [standalone]=\"true\" ngModel [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n <span style=\"font-size: 13px;color:rgba(0,0,0,.54)\">配置说明查看<a\n href=\"https://www.tiny.cloud/docs/tinymce/latest/\" target=\"_blank\">Tiny官方文档</a></span>\n </nz-form-control>\n </nz-form-item>\n </nz-collapse-panel>\n <axis-value-design-setting [fg]=\"fg\"></axis-value-design-setting>\n <axis-base-design-setting [fg]=\"fg\"></axis-base-design-setting>\n <axis-input-trigger formControlName=\"triggeEvents\" [internalTriggers]=\"['valueChange']\"></axis-input-trigger>\n </nz-collapse>\n</form>","import { NextInfo, DesignBuildResult, DesignBindElementsResult, DesignConfig, OptionsNode, SimpleMenu } from \"ngx-axis-appforge/core\";\nimport { Setting } from \"./setting/setting\";\n\nexport const Config: DesignConfig = {\n\n componentName: \"富文本编辑器\",\n buildOptionsNodes(nextInfo: NextInfo): DesignBuildResult {\n return {\n treeNode: new OptionsNode({\n parentId: nextInfo.parentId,\n scopeId: nextInfo.scopeId,\n name: \"富文本编辑器\",\n canSetting: true,\n canDrag: true,\n dragType: \"component\",\n parentObj: nextInfo.parentObject,\n indexOfParentObj: nextInfo.indexOfParent,\n rootOptions: nextInfo.currentObject,\n settingType: Setting,\n contextMenu: SimpleMenu,\n icon: \"font-colors\",\n }),\n };\n },\n bindElementsOptionsNode(element: HTMLElement, options: any): DesignBindElementsResult {\n return {\n [options.id]: { element }\n }\n },\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './config';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAcM,MAAO,OAAQ,SAAQ,iBAAiB,CAAA;AAEnC,IAAA,EAAE,GAAqB,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC;AAC5C,QAAA,GAAG,YAAY;AACf,QAAA,GAAG,aAAa;AAChB,QAAA,aAAa,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC;AACtD,QAAA,kBAAkB,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC;AAC3D,QAAA,oBAAoB,EAAE,EAAE;AACxB,QAAA,cAAc,EAAE,EAAE;AACnB,KAAA,CAAC;AAEiB,IAAA,SAAS,GAAoB;AAC9C,QAAA,GAAG,YAAY;AACf,QAAA,GAAG,aAAa;AAChB,QAAA,aAAa,EAAE;AACb,YAAA,YAAY,EAAE,SAAS;AACxB,SAAA;AACD,QAAA,kBAAkB,EAAE;AAClB,YAAA,YAAY,EAAE;AACf,SAAA;AACD,QAAA,cAAc,EAAE;AACd,YAAA,YAAY,EAAE;AACf;KACF;uGAvBU,OAAO,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAP,OAAO,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,2BAAA,EAAA,eAAA,EAAA,IAAA,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EAAA,OAAA,EAC5B,CAAC,WAAW,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,iBAAiB,EAAE,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,CAAC,EAAA,eAAA,EAG1J,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,4/FAAA,EAAA;;;AET1C,MAAM,MAAM,GAAiB;AAEhC,IAAA,aAAa,EAAE,QAAQ;AACvB,IAAA,iBAAiB,CAAC,QAAkB,EAAA;QAChC,OAAO;YACH,QAAQ,EAAE,IAAI,WAAW,CAAC;gBACtB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;gBAC3B,OAAO,EAAE,QAAQ,CAAC,OAAO;AACzB,gBAAA,IAAI,EAAE,QAAQ;AACd,gBAAA,UAAU,EAAE,IAAI;AAChB,gBAAA,OAAO,EAAE,IAAI;AACb,gBAAA,QAAQ,EAAE,WAAW;gBACrB,SAAS,EAAE,QAAQ,CAAC,YAAY;gBAChC,gBAAgB,EAAE,QAAQ,CAAC,aAAa;gBACxC,WAAW,EAAE,QAAQ,CAAC,aAAa;AACnC,gBAAA,WAAW,EAAE,OAAO;AACpB,gBAAA,WAAW,EAAE,UAAU;AACvB,gBAAA,IAAI,EAAE,aAAa;aACtB,CAAC;SACL;IACL,CAAC;IACD,uBAAuB,CAAC,OAAoB,EAAE,OAAY,EAAA;QACtD,OAAO;AACH,YAAA,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,OAAO;SAC1B;IACL,CAAC;;;AC5BL;;AAEG;;;;"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { signal, inject, computed, ViewChild, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { ValueAccessOptions, ValueAccess, AXIS_FILE_BASE_URL_TOKEN } from 'ngx-axis-appforge/core';
|
|
4
|
+
import * as i1 from '@angular/forms';
|
|
5
|
+
import { FormsModule } from '@angular/forms';
|
|
6
|
+
import * as i2 from '@tinymce/tinymce-angular';
|
|
7
|
+
import { EditorModule, EditorComponent, TINYMCE_SCRIPT_SRC } from '@tinymce/tinymce-angular';
|
|
8
|
+
import { BehaviorSubject } from 'rxjs';
|
|
9
|
+
import { HttpClient, HttpResponse, HttpEventType } from '@angular/common/http';
|
|
10
|
+
|
|
11
|
+
class RichTextEditorOptions extends ValueAccessOptions {
|
|
12
|
+
fileUploadUrl = signal("", ...(ngDevMode ? [{ debugName: "fileUploadUrl" }] : []));
|
|
13
|
+
fileUploadFormName = signal("file", ...(ngDevMode ? [{ debugName: "fileUploadFormName" }] : []));
|
|
14
|
+
fileUploadResponseFn = signal("", ...(ngDevMode ? [{ debugName: "fileUploadResponseFn" }] : []));
|
|
15
|
+
tinymceOptions = signal(undefined, ...(ngDevMode ? [{ debugName: "tinymceOptions" }] : []));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
class RichTextEditor extends ValueAccess {
|
|
19
|
+
options = new RichTextEditorOptions();
|
|
20
|
+
fileBaseUrl = inject(AXIS_FILE_BASE_URL_TOKEN, { optional: true }) ?? "";
|
|
21
|
+
http = inject(HttpClient);
|
|
22
|
+
editor;
|
|
23
|
+
editorConfig = computed(() => {
|
|
24
|
+
return Object.assign({}, this.defaultEditorConfig, this.options.tinymceOptions());
|
|
25
|
+
}, ...(ngDevMode ? [{ debugName: "editorConfig" }] : []));
|
|
26
|
+
filePickerCallback(callback, value, meta) {
|
|
27
|
+
const input = document.createElement('input');
|
|
28
|
+
input.setAttribute('type', 'file');
|
|
29
|
+
let accept;
|
|
30
|
+
switch (meta['filetype']) {
|
|
31
|
+
case "image":
|
|
32
|
+
accept = "image/*";
|
|
33
|
+
break;
|
|
34
|
+
case "media":
|
|
35
|
+
accept = "video/*,audio/*";
|
|
36
|
+
break;
|
|
37
|
+
default:
|
|
38
|
+
accept = "*/*";
|
|
39
|
+
}
|
|
40
|
+
input.setAttribute('accept', accept);
|
|
41
|
+
input.onchange = (e) => {
|
|
42
|
+
const file = e?.target?.files?.[0];
|
|
43
|
+
if (file) {
|
|
44
|
+
const reader = new FileReader();
|
|
45
|
+
reader.onload = () => {
|
|
46
|
+
if (reader.result) {
|
|
47
|
+
const id = 'blobid' + (new Date()).getTime();
|
|
48
|
+
const blobCache = this.editor.editor.editorUpload.blobCache;
|
|
49
|
+
const base64 = reader.result?.toString()?.split(',')[1];
|
|
50
|
+
const blobInfo = blobCache.create(id, file, base64);
|
|
51
|
+
blobCache.add(blobInfo);
|
|
52
|
+
callback(blobInfo.blobUri(), { title: file.name });
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
reader.readAsDataURL(file);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
input.click();
|
|
59
|
+
}
|
|
60
|
+
uploadHandler(blobInfo, progress) {
|
|
61
|
+
return new Promise((resolve, reject) => {
|
|
62
|
+
const formData = new FormData();
|
|
63
|
+
formData.append(this.options.fileUploadFormName(), blobInfo.blob(), blobInfo.filename());
|
|
64
|
+
this.http.post(this.options.fileUploadUrl(), formData, { reportProgress: true, observe: 'events' }).subscribe(event => {
|
|
65
|
+
if (event instanceof HttpResponse) {
|
|
66
|
+
if (this.options.fileUploadResponseFn()) {
|
|
67
|
+
const res = this.runFn(this.options.fileUploadResponseFn(), { apiResponse: event.body });
|
|
68
|
+
const { success, errmsg, url } = res;
|
|
69
|
+
if (success) {
|
|
70
|
+
resolve(this.getUrl(url));
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
reject(errmsg || "上传失败");
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
else if (event.type == HttpEventType.UploadProgress) {
|
|
78
|
+
progress(Math.floor(event.loaded / event.total * 100));
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
getUrl(url) {
|
|
84
|
+
if (url.startsWith("http")) {
|
|
85
|
+
return url;
|
|
86
|
+
}
|
|
87
|
+
else if (this.fileBaseUrl instanceof BehaviorSubject) {
|
|
88
|
+
return this.fileBaseUrl.value + url;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
return this.fileBaseUrl + url;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
defaultEditorConfig = {
|
|
95
|
+
base_url: "/tinymce",
|
|
96
|
+
suffix: '.min',
|
|
97
|
+
language: 'zh_CN',
|
|
98
|
+
skin: (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'oxide-dark' : 'oxide'),
|
|
99
|
+
content_css: (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'default'),
|
|
100
|
+
promotion: false,
|
|
101
|
+
onboarding: false,
|
|
102
|
+
branding: false,
|
|
103
|
+
plugins: 'preview importcss searchreplace autolink directionality code visualblocks visualchars fullscreen image link media codesample table charmap pagebreak nonbreaking anchor insertdatetime advlist lists wordcount help charmap quickbars emoticons accordion',
|
|
104
|
+
menubar: 'file edit view insert format tools table help',
|
|
105
|
+
toolbar: "undo redo | blocks fontfamily fontsize | bold italic underline strikethrough | align numlist bullist | link image | table media | lineheight outdent indent| forecolor backcolor removeformat | charmap emoticons | accordion accordionremove | code fullscreen preview | print | pagebreak anchor codesample | ltr rtl",
|
|
106
|
+
hidden_input: false,
|
|
107
|
+
file_picker_callback: this.filePickerCallback.bind(this),
|
|
108
|
+
images_upload_handler: this.uploadHandler.bind(this),
|
|
109
|
+
convert_urls: false,
|
|
110
|
+
image_advtab: true,
|
|
111
|
+
importcss_append: true,
|
|
112
|
+
image_caption: true,
|
|
113
|
+
images_reuse_filename: true,
|
|
114
|
+
quickbars_selection_toolbar: 'bold italic | quicklink h2 h3 blockquote quickimage quicktable',
|
|
115
|
+
noneditable_class: 'mceNonEditable',
|
|
116
|
+
toolbar_mode: 'sliding',
|
|
117
|
+
contextmenu: 'link image table',
|
|
118
|
+
};
|
|
119
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: RichTextEditor, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
120
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.4", type: RichTextEditor, isStandalone: true, selector: "axis-rich-text-editor", providers: [
|
|
121
|
+
{ provide: TINYMCE_SCRIPT_SRC, useValue: 'tinymce/tinymce.min.js' }
|
|
122
|
+
], viewQueries: [{ propertyName: "editor", first: true, predicate: EditorComponent, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<editor style=\"height: 100%;\" [init]=\"editorConfig()\" licenseKey=\"gpl\" [(ngModel)]=\"value\" (ngModelChange)=\"onChange?.($event)\"></editor>", styles: [":host{display:block;width:100%}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: EditorModule }, { kind: "component", type: i2.EditorComponent, selector: "editor", inputs: ["cloudChannel", "apiKey", "licenseKey", "init", "id", "initialValue", "outputFormat", "inline", "tagName", "plugins", "toolbar", "modelEvents", "allowedEvents", "ignoreEvents", "readonly", "disabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
123
|
+
}
|
|
124
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: RichTextEditor, decorators: [{
|
|
125
|
+
type: Component,
|
|
126
|
+
args: [{ selector: 'axis-rich-text-editor', imports: [FormsModule, EditorModule], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
127
|
+
{ provide: TINYMCE_SCRIPT_SRC, useValue: 'tinymce/tinymce.min.js' }
|
|
128
|
+
], template: "<editor style=\"height: 100%;\" [init]=\"editorConfig()\" licenseKey=\"gpl\" [(ngModel)]=\"value\" (ngModelChange)=\"onChange?.($event)\"></editor>", styles: [":host{display:block;width:100%}\n"] }]
|
|
129
|
+
}], propDecorators: { editor: [{
|
|
130
|
+
type: ViewChild,
|
|
131
|
+
args: [EditorComponent, { static: true }]
|
|
132
|
+
}] } });
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Generated bundle index. Do not edit.
|
|
136
|
+
*/
|
|
137
|
+
|
|
138
|
+
export { RichTextEditor };
|
|
139
|
+
//# sourceMappingURL=ngx-axis-appforge-axis-components-rich-text-editor.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-axis-appforge-axis-components-rich-text-editor.mjs","sources":["../../../axis-components/rich-text-editor/rich-text-editor.options.ts","../../../axis-components/rich-text-editor/rich-text-editor.ts","../../../axis-components/rich-text-editor/rich-text-editor.html","../../../axis-components/rich-text-editor/ngx-axis-appforge-axis-components-rich-text-editor.ts"],"sourcesContent":["import { signal } from \"@angular/core\";\nimport { ValueAccessOptions } from \"ngx-axis-appforge/core\";\n\nexport class RichTextEditorOptions extends ValueAccessOptions {\n\n readonly fileUploadUrl = signal(\"\");\n readonly fileUploadFormName = signal(\"file\");\n readonly fileUploadResponseFn = signal(\"\");\n readonly tinymceOptions = signal<any>(undefined);\n}","import { ChangeDetectionStrategy, Component, computed, inject, ViewChild } from '@angular/core';\nimport { RichTextEditorOptions } from './rich-text-editor.options';\nimport { AXIS_FILE_BASE_URL_TOKEN, ValueAccess } from 'ngx-axis-appforge/core';\nimport { FormsModule } from '@angular/forms';\nimport { EditorComponent, EditorModule, TINYMCE_SCRIPT_SRC } from '@tinymce/tinymce-angular';\nimport { RawEditorOptions } from 'tinymce';\nimport { BehaviorSubject } from 'rxjs';\nimport { HttpClient, HttpEventType, HttpResponse } from '@angular/common/http';\n\n@Component({\n selector: 'axis-rich-text-editor',\n imports: [FormsModule, EditorModule],\n templateUrl: './rich-text-editor.html',\n styleUrl: './rich-text-editor.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n { provide: TINYMCE_SCRIPT_SRC, useValue: 'tinymce/tinymce.min.js' }\n ]\n})\nexport class RichTextEditor extends ValueAccess<RichTextEditorOptions> {\n\n override options: RichTextEditorOptions = new RichTextEditorOptions();\n private readonly fileBaseUrl = inject(AXIS_FILE_BASE_URL_TOKEN, { optional: true }) ?? \"\";\n private readonly http = inject(HttpClient);\n\n @ViewChild(EditorComponent, { static: true })\n editor!: EditorComponent;\n\n editorConfig = computed(() => {\n return Object.assign({}, this.defaultEditorConfig, this.options.tinymceOptions());\n })\n\n filePickerCallback(callback: (value: string, meta?: Record<string, any>) => void, value: string, meta: Record<string, any>) {\n const input = document.createElement('input');\n input.setAttribute('type', 'file');\n let accept;\n switch (meta['filetype']) {\n case \"image\":\n accept = \"image/*\";\n break;\n case \"media\":\n accept = \"video/*,audio/*\";\n break;\n default:\n accept = \"*/*\";\n }\n input.setAttribute('accept', accept);\n input.onchange = (e) => {\n const file = (e?.target as HTMLInputElement | undefined)?.files?.[0];\n if (file) {\n const reader = new FileReader();\n reader.onload = () => {\n if (reader.result) {\n const id = 'blobid' + (new Date()).getTime();\n const blobCache = this.editor.editor.editorUpload.blobCache;\n const base64 = reader.result?.toString()?.split(',')[1];\n const blobInfo = blobCache.create(id, file, base64);\n blobCache.add(blobInfo);\n callback(blobInfo.blobUri(), { title: file.name });\n }\n }\n reader.readAsDataURL(file);\n }\n };\n\n input.click();\n }\n\n uploadHandler(blobInfo: any, progress: any): Promise<string> {\n return new Promise((resolve, reject) => {\n const formData = new FormData();\n formData.append(this.options.fileUploadFormName(), blobInfo.blob(), blobInfo.filename());\n this.http.post(this.options.fileUploadUrl(), formData, { reportProgress: true, observe: 'events' }).subscribe(event => {\n if (event instanceof HttpResponse) {\n if (this.options.fileUploadResponseFn()) {\n const res = this.runFn(this.options.fileUploadResponseFn(), { apiResponse: event.body });\n const { success, errmsg, url } = res;\n if (success) {\n resolve(this.getUrl(url));\n } else {\n reject(errmsg || \"上传失败\");\n }\n }\n } else if (event.type == HttpEventType.UploadProgress) {\n progress(Math.floor(event.loaded / event.total! * 100));\n }\n });\n });\n }\n\n getUrl(url: string): string {\n if (url.startsWith(\"http\")) {\n return url;\n } else if (this.fileBaseUrl instanceof BehaviorSubject) {\n return this.fileBaseUrl.value + url;\n } else {\n return this.fileBaseUrl + url;\n }\n }\n\n\n defaultEditorConfig: RawEditorOptions = {\n base_url: \"/tinymce\",\n suffix: '.min',\n language: 'zh_CN',\n skin: (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'oxide-dark' : 'oxide'),\n content_css: (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'default'),\n promotion: false,\n onboarding: false,\n branding: false,\n plugins: 'preview importcss searchreplace autolink directionality code visualblocks visualchars fullscreen image link media codesample table charmap pagebreak nonbreaking anchor insertdatetime advlist lists wordcount help charmap quickbars emoticons accordion',\n menubar: 'file edit view insert format tools table help',\n toolbar: \"undo redo | blocks fontfamily fontsize | bold italic underline strikethrough | align numlist bullist | link image | table media | lineheight outdent indent| forecolor backcolor removeformat | charmap emoticons | accordion accordionremove | code fullscreen preview | print | pagebreak anchor codesample | ltr rtl\",\n hidden_input: false,\n file_picker_callback: this.filePickerCallback.bind(this),\n images_upload_handler: this.uploadHandler.bind(this),\n convert_urls: false,\n image_advtab: true,\n importcss_append: true,\n image_caption: true,\n images_reuse_filename: true,\n quickbars_selection_toolbar: 'bold italic | quicklink h2 h3 blockquote quickimage quicktable',\n noneditable_class: 'mceNonEditable',\n toolbar_mode: 'sliding',\n contextmenu: 'link image table',\n }\n}\n","<editor style=\"height: 100%;\" [init]=\"editorConfig()\" licenseKey=\"gpl\" [(ngModel)]=\"value\" (ngModelChange)=\"onChange?.($event)\"></editor>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './rich-text-editor';\n"],"names":[],"mappings":";;;;;;;;;;AAGM,MAAO,qBAAsB,SAAQ,kBAAkB,CAAA;AAEhD,IAAA,aAAa,GAAG,M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{
|
|
|
108
108
|
if (this.ready() && this.useBackEndPaging() && this.data()) {
|
|
109
109
|
this.pageIndex.set(this.data().page_index + 1);
|
|
110
110
|
if (this.data()?.query_total) {
|
|
111
|
+
this.hasTotal = true;
|
|
111
112
|
this.rowtotal.set(this.data().total);
|
|
112
113
|
}
|
|
113
114
|
this.addCursorMark();
|
|
@@ -123,6 +124,7 @@ class TableService {
|
|
|
123
124
|
useBackEndPaging = computed(() => this.options.showPagination() && this.options.useBackEndPaging(), ...(ngDevMode ? [{ debugName: "useBackEndPaging" }] : []));
|
|
124
125
|
rows = computed(() => this.useBackEndPaging() ? this.data()?.rows : this.data(), ...(ngDevMode ? [{ debugName: "rows" }] : []));
|
|
125
126
|
pageIndex = signal(1, ...(ngDevMode ? [{ debugName: "pageIndex" }] : []));
|
|
127
|
+
hasTotal = false;
|
|
126
128
|
rowtotal = signal(0, ...(ngDevMode ? [{ debugName: "rowtotal" }] : []));
|
|
127
129
|
displayFields = computed(() => {
|
|
128
130
|
if (!this.ready()) {
|
|
@@ -301,6 +303,7 @@ class TableService {
|
|
|
301
303
|
use_page: true,
|
|
302
304
|
page_index: this.pageIndex() - 1,
|
|
303
305
|
page_size: this.options.pageSize(),
|
|
306
|
+
query_total: !this.hasTotal,
|
|
304
307
|
cursor_mark: this.getNearestCursorMark(),
|
|
305
308
|
order_by: this.displayFields().filter(f => f.sortAble() && f.sortOrder() != null).map(f => ({
|
|
306
309
|
column: f.field(),
|