ngx-axis-appforge 0.0.13 → 0.0.15
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/dynamic-value/design/index.d.ts +5 -0
- package/axis-components/dynamic-value/index.d.ts +16 -0
- package/axis-components/form/index.d.ts +3 -2
- package/axis-components/form-item/index.d.ts +1 -1
- package/axis-components/scope/index.d.ts +1 -0
- package/axis-components-covers/dynamic-value.svg +32 -0
- package/core/index.d.ts +6 -6
- package/fesm2022/ngx-axis-appforge-axis-components-badge-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-badge.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-badge.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-button-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-button-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-button.mjs +4 -3
- package/fesm2022/ngx-axis-appforge-axis-components-button.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-date-picker-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-date-picker.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-desc-design.mjs +9 -9
- package/fesm2022/ngx-axis-appforge-axis-components-desc-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-desc.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-desc.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-design-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-design-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-design.mjs +18 -18
- package/fesm2022/ngx-axis-appforge-axis-components-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-dynamic-container-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-dynamic-container-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-dynamic-container.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-dynamic-container.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-dynamic-value-design.mjs +77 -0
- package/fesm2022/ngx-axis-appforge-axis-components-dynamic-value-design.mjs.map +1 -0
- package/fesm2022/ngx-axis-appforge-axis-components-dynamic-value.mjs +29 -0
- package/fesm2022/ngx-axis-appforge-axis-components-dynamic-value.mjs.map +1 -0
- package/fesm2022/ngx-axis-appforge-axis-components-editor-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-editor-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-editor.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-flex-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-flex.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-flex.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-form-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-form-item-design.mjs +6 -6
- package/fesm2022/ngx-axis-appforge-axis-components-form-item.mjs +6 -22
- package/fesm2022/ngx-axis-appforge-axis-components-form-item.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-form.mjs +19 -10
- package/fesm2022/ngx-axis-appforge-axis-components-form.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-icon-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-icon-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-icon.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-image-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-image-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-image.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-input-component-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-input-component-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-input-component.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-input-component.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-input-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-input-icon-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-input-icon.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-input-icon.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-input-json-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-input-json.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-input-json.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-input-number-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-input-number.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-input.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-input.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-modal-design.mjs +6 -6
- package/fesm2022/ngx-axis-appforge-axis-components-modal.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-modal.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-scope-design.mjs +10 -9
- package/fesm2022/ngx-axis-appforge-axis-components-scope-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-scope.mjs +4 -3
- package/fesm2022/ngx-axis-appforge-axis-components-scope.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-single-selector-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-single-selector-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-single-selector.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-splitter-design.mjs +9 -9
- package/fesm2022/ngx-axis-appforge-axis-components-splitter.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-splitter.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-steps-design.mjs +9 -9
- package/fesm2022/ngx-axis-appforge-axis-components-steps-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-steps.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-steps.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-table-design.mjs +9 -9
- package/fesm2022/ngx-axis-appforge-axis-components-table-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-table.mjs +6 -6
- package/fesm2022/ngx-axis-appforge-axis-components-table.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-tabs-design.mjs +9 -9
- package/fesm2022/ngx-axis-appforge-axis-components-tabs.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-tabs.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-text-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-text.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-textarea-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-textarea.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-tree-selector-design.mjs +9 -9
- package/fesm2022/ngx-axis-appforge-axis-components-tree-selector-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-tree-selector.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-tree-selector.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-upload-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-upload-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-upload.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-upload.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components.mjs +23 -0
- package/fesm2022/ngx-axis-appforge-axis-components.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-core.mjs +90 -93
- package/fesm2022/ngx-axis-appforge-core.mjs.map +1 -1
- package/package.json +91 -83
|
@@ -24,10 +24,10 @@ class Setting extends FunFieldValueBase {
|
|
|
24
24
|
defaultValue: true,
|
|
25
25
|
},
|
|
26
26
|
};
|
|
27
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.
|
|
28
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.
|
|
27
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Setting, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
28
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: Setting, isStandalone: true, selector: "axis-design-form-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 \u63D0\u4EA4\u786E\u8BA4\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"submitConfirm\">\n <nz-switch ngModel [ngModelOptions]=\"{standalone:true}\"></nz-switch>\n </axis-fun-field>\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\"\n [eventDesc]=\"[{name:'formStatusChange',title:'\u8868\u5355\u72B6\u6001\u6539\u53D8',ds:{status:{dirty:false,valid:true}}}]\"\n [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.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: NzFormModule }, { kind: "directive", type: i2.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: i2.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i3.NzFormDirective, selector: "[nz-form]", inputs: ["nzLayout", "nzNoColon", "nzAutoTips", "nzDisableAutoTips", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzForm"] }, { kind: "component", type: i3.NzFormItemComponent, selector: "nz-form-item", exportAs: ["nzFormItem"] }, { kind: "component", type: i3.NzFormLabelComponent, selector: "nz-form-label", inputs: ["nzFor", "nzRequired", "nzNoColon", "nzTooltipTitle", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzFormLabel"] }, { kind: "component", type: i3.NzFormControlComponent, selector: "nz-form-control", inputs: ["nzSuccessTip", "nzWarningTip", "nzErrorTip", "nzValidatingTip", "nzExtra", "nzAutoTips", "nzDisableAutoTips", "nzHasFeedback", "nzValidateStatus"], exportAs: ["nzFormControl"] }, { 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: NzCollapseModule }, { kind: "component", type: i4.NzCollapsePanelComponent, selector: "nz-collapse-panel", inputs: ["nzActive", "nzDisabled", "nzShowArrow", "nzExtra", "nzHeader", "nzExpandedIcon"], outputs: ["nzActiveChange"], exportAs: ["nzCollapsePanel"] }, { kind: "component", type: i4.NzCollapseComponent, selector: "nz-collapse", inputs: ["nzAccordion", "nzBordered", "nzGhost", "nzExpandIconPosition"], exportAs: ["nzCollapse"] }, { kind: "component", type: BaseDesignSetting, selector: "axis-base-design-setting", inputs: ["scopeId", "exclude", "fg"] }, { 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: "ngmodule", type: NzSwitchModule }, { kind: "component", type: i5.NzSwitchComponent, selector: "nz-switch", inputs: ["nzLoading", "nzDisabled", "nzControl", "nzCheckedChildren", "nzUnCheckedChildren", "nzSize", "nzId"], exportAs: ["nzSwitch"] }, { kind: "component", type: InputTrigger, selector: "axis-input-trigger", inputs: ["internalTriggers", "value", "eventDesc", "isVisibleHandlerModal", "editEventHandler"], outputs: ["valueChange", "isVisibleHandlerModalChange", "editEventHandlerChange"] }, { kind: "component", type: ValueDesignSetting, selector: "axis-value-design-setting", inputs: ["scopeId", "exclude", "fg"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
29
29
|
}
|
|
30
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Setting, decorators: [{
|
|
31
31
|
type: Component,
|
|
32
32
|
args: [{ selector: 'axis-design-form-setting', imports: [FormsModule, NzFormModule, ReactiveFormsModule, NzCollapseModule, BaseDesignSetting, FunField, NzSwitchModule, InputTrigger, ValueDesignSetting], 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 \u63D0\u4EA4\u786E\u8BA4\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"submitConfirm\">\n <nz-switch ngModel [ngModelOptions]=\"{standalone:true}\"></nz-switch>\n </axis-fun-field>\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\"\n [eventDesc]=\"[{name:'formStatusChange',title:'\u8868\u5355\u72B6\u6001\u6539\u53D8',ds:{status:{dirty:false,valid:true}}}]\"\n [internalTriggers]=\"['valueChange']\"></axis-input-trigger>\n </nz-collapse>\n</form>" }]
|
|
33
33
|
}] });
|
|
@@ -146,8 +146,8 @@ class InputValidator extends FunFieldBase {
|
|
|
146
146
|
this.value.set([...this.value()]);
|
|
147
147
|
this.onChange(this.value());
|
|
148
148
|
}
|
|
149
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.
|
|
150
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.
|
|
149
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: InputValidator, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
150
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: InputValidator, isStandalone: true, selector: "axis-design-form-item-setting-input-validator", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, showModal: { classPropertyName: "showModal", publicName: "showModal", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", showModal: "showModalChange" }, providers: [
|
|
151
151
|
{
|
|
152
152
|
provide: NG_VALUE_ACCESSOR,
|
|
153
153
|
useExisting: forwardRef(() => InputValidator),
|
|
@@ -155,7 +155,7 @@ class InputValidator extends FunFieldBase {
|
|
|
155
155
|
},
|
|
156
156
|
], usesInheritance: true, ngImport: i0, template: "<nz-collapse [nzBordered]=\"false\">\n <ng-template #addButton>\n <a nz-button nzType=\"link\" style=\"float: right;\" (click)=\"$event.stopPropagation();openWithCreate()\">\n <nz-icon nzType=\"plus\"></nz-icon>\n \u6DFB\u52A0\n </a>\n </ng-template>\n <nz-collapse-panel nzHeader=\"\u8868\u5355\u9879\u9A8C\u8BC1\" nzActive [nzExtra]=\"addButton\">\n @if (!value()?.length) {\n <nz-empty nzNotFoundContent=\"\u6682\u65E0\u9A8C\u8BC1\u5668\"></nz-empty>\n }@else{\n <div nz-flex nzVertical nzGap=\"8px\" style=\"padding: 6px;\">\n @for (item of value()??[]; track item;let i=$index) {\n <div nz-flex nzGap=\"8px\" nzAlign=\"center\">\n <div style=\"width: 64px;\">\n @switch (item.type) {\n @case (\"required\") {\n <nz-tag nzColor=\"magenta\">\u5FC5\u586B\u9A8C\u8BC1</nz-tag>\n }\n @case (\"length\") {\n <nz-tag nzColor=\"blue\">\u957F\u5EA6\u9A8C\u8BC1</nz-tag>\n }\n @case (\"value\") {\n <nz-tag nzColor=\"purple\">\u503C\u9A8C\u8BC1</nz-tag>\n }\n @case (\"regex\") {\n <nz-tag nzColor=\"cyan\">\u6B63\u5219\u9A8C\u8BC1</nz-tag>\n }\n }\n </div>\n <div class=\"validator-desc\">{{validatorDesc()?.[i]}}</div>\n <div>\n <a nz-button nzType=\"link\" nzSize=\"small\" (click)=\"openWithUpdate(i)\">\n <i nz-icon nzType=\"edit\" nzTheme=\"outline\"></i>\n </a>\n <a nz-button nzType=\"link\" nzSize=\"small\" nzDanger (click)=\"deleteValidator(i)\">\n <i nz-icon nzType=\"delete\" nzTheme=\"outline\"></i>\n </a>\n </div>\n </div>\n }\n </div>\n }\n </nz-collapse-panel>\n @if (showLine()) {\n <div></div>\n }\n</nz-collapse>\n\n<nz-modal [(nzVisible)]=\"showModal\" nzTitle=\"\u9A8C\u8BC1\u5668\" nzWidth=\"450px\" (nzOnCancel)=\"showModal.set(false)\" (nzOnOk)=\"save()\">\n <ng-container *nzModalContent>\n <form [formGroup]=\"fg\" nz-form>\n <nz-form-item>\n <nz-form-label nzSpan=\"6\" nzRequired>\n \u9A8C\u8BC1\u7C7B\u578B\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <nz-select formControlName=\"type\">\n <nz-option nzValue=\"required\" nzLabel=\"\u5FC5\u586B\u9A8C\u8BC1\"></nz-option>\n <nz-option nzValue=\"length\" nzLabel=\"\u957F\u5EA6\u9A8C\u8BC1\"></nz-option>\n <nz-option nzValue=\"value\" nzLabel=\"\u503C\u9A8C\u8BC1\"></nz-option>\n <nz-option nzValue=\"regex\" nzLabel=\"\u6B63\u5219\u9A8C\u8BC1\"></nz-option>\n </nz-select>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"6\" nzRequired>\n \u7981\u7528\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"disabled\">\n <nz-switch ngModel [ngModelOptions]=\"{standalone:true}\"></nz-switch>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n @switch (fg.value.type) {\n @case (\"length\") {\n <nz-form-item>\n <nz-form-label nzSpan=\"6\">\n \u6700\u5C0F\u957F\u5EA6\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"minLength\">\n <nz-input-number style=\"width: 100%\" nzPlaceHolder=\"\u4E0D\u9650\u5236\" nzMin=\"0\" ngModel\n [ngModelOptions]=\"{standalone:true}\"></nz-input-number>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"6\">\n \u6700\u5927\u957F\u5EA6\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"maxLength\">\n <nz-input-number style=\"width: 100%\" nzPlaceHolder=\"\u4E0D\u9650\u5236\" nzMin=\"0\" ngModel\n [ngModelOptions]=\"{standalone:true}\"></nz-input-number>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n }\n @case (\"value\") {\n <nz-form-item>\n <nz-form-label nzSpan=\"6\">\n \u6700\u5C0F\u503C\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"minValue\">\n <nz-input-number style=\"width: 100%\" nzPlaceHolder=\"\u4E0D\u9650\u5236\" ngModel\n [ngModelOptions]=\"{standalone:true}\"></nz-input-number>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"6\">\n \u6700\u5927\u503C\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"maxValue\">\n <nz-input-number style=\"width: 100%\" nzPlaceHolder=\"\u4E0D\u9650\u5236\" ngModel\n [ngModelOptions]=\"{standalone:true}\"></nz-input-number>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n }\n @case (\"regex\") {\n <nz-form-item>\n <nz-form-label nzSpan=\"6\">\n \u6B63\u5219\u8868\u8FBE\u5F0F\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"pattern\">\n <input nz-input nzPlaceHolder=\"\u8F93\u5165\u6B63\u5219\u8868\u8FBE\u5F0F\" ngModel [ngModelOptions]=\"{standalone:true}\" />\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n }\n }\n </form>\n </ng-container>\n</nz-modal>", styles: [".validator-desc{flex:1;font-size:12px;color:#00000073;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n"], dependencies: [{ kind: "ngmodule", type: NzListModule }, { kind: "ngmodule", type: NzTagModule }, { kind: "component", type: i1.NzTagComponent, selector: "nz-tag", inputs: ["nzMode", "nzColor", "nzChecked", "nzBordered"], outputs: ["nzOnClose", "nzCheckedChange"], exportAs: ["nzTag"] }, { kind: "ngmodule", type: NzSpaceModule }, { kind: "ngmodule", type: NzGridModule }, { kind: "directive", type: i2.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: i2.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i3.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzEmptyModule }, { kind: "component", type: i4.NzEmptyComponent, selector: "nz-empty", inputs: ["nzNotFoundImage", "nzNotFoundContent", "nzNotFoundFooter"], exportAs: ["nzEmpty"] }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i5.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i6.ɵNzTransitionPatchDirective, selector: "[nz-button], [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "ngmodule", type: NzModalModule }, { kind: "component", type: i7.NzModalComponent, selector: "nz-modal", inputs: ["nzMask", "nzMaskClosable", "nzCloseOnNavigation", "nzVisible", "nzClosable", "nzOkLoading", "nzOkDisabled", "nzCancelDisabled", "nzCancelLoading", "nzKeyboard", "nzNoAnimation", "nzCentered", "nzDraggable", "nzContent", "nzFooter", "nzZIndex", "nzWidth", "nzWrapClassName", "nzClassName", "nzStyle", "nzTitle", "nzCloseIcon", "nzMaskStyle", "nzBodyStyle", "nzOkText", "nzCancelText", "nzOkType", "nzOkDanger", "nzIconType", "nzModalType", "nzAutofocus", "nzOnOk", "nzOnCancel"], outputs: ["nzOnOk", "nzOnCancel", "nzAfterOpen", "nzAfterClose", "nzVisibleChange"], exportAs: ["nzModal"] }, { kind: "directive", type: i7.NzModalContentDirective, selector: "[nzModalContent]", exportAs: ["nzModalContent"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i8.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: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzCollapseModule }, { kind: "component", type: i9.NzCollapsePanelComponent, selector: "nz-collapse-panel", inputs: ["nzActive", "nzDisabled", "nzShowArrow", "nzExtra", "nzHeader", "nzExpandedIcon"], outputs: ["nzActiveChange"], exportAs: ["nzCollapsePanel"] }, { kind: "component", type: i9.NzCollapseComponent, selector: "nz-collapse", inputs: ["nzAccordion", "nzBordered", "nzGhost", "nzExpandIconPosition"], exportAs: ["nzCollapse"] }, { kind: "ngmodule", type: NzFormModule }, { kind: "directive", type: i10.NzFormDirective, selector: "[nz-form]", inputs: ["nzLayout", "nzNoColon", "nzAutoTips", "nzDisableAutoTips", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzForm"] }, { kind: "component", type: i10.NzFormItemComponent, selector: "nz-form-item", exportAs: ["nzFormItem"] }, { kind: "component", type: i10.NzFormLabelComponent, selector: "nz-form-label", inputs: ["nzFor", "nzRequired", "nzNoColon", "nzTooltipTitle", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzFormLabel"] }, { kind: "component", type: i10.NzFormControlComponent, selector: "nz-form-control", inputs: ["nzSuccessTip", "nzWarningTip", "nzErrorTip", "nzValidatingTip", "nzExtra", "nzAutoTips", "nzDisableAutoTips", "nzHasFeedback", "nzValidateStatus"], exportAs: ["nzFormControl"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i8.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i8.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { 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: "ngmodule", type: NzSelectModule }, { kind: "component", type: i11.NzOptionComponent, selector: "nz-option", inputs: ["nzTitle", "nzLabel", "nzValue", "nzKey", "nzDisabled", "nzHide", "nzCustomContent"], exportAs: ["nzOption"] }, { kind: "component", type: i11.NzSelectComponent, selector: "nz-select", inputs: ["nzId", "nzSize", "nzStatus", "nzVariant", "nzOptionHeightPx", "nzOptionOverflowSize", "nzDropdownClassName", "nzDropdownMatchSelectWidth", "nzDropdownStyle", "nzNotFoundContent", "nzPlaceHolder", "nzPlacement", "nzMaxTagCount", "nzDropdownRender", "nzCustomTemplate", "nzSuffixIcon", "nzClearIcon", "nzRemoveIcon", "nzMenuItemSelectedIcon", "nzTokenSeparators", "nzMaxTagPlaceholder", "nzMaxMultipleCount", "nzMode", "nzFilterOption", "compareWith", "nzAllowClear", "nzBorderless", "nzShowSearch", "nzLoading", "nzAutoFocus", "nzAutoClearSearchValue", "nzServerSearch", "nzDisabled", "nzOpen", "nzSelectOnTab", "nzBackdrop", "nzOptions", "nzShowArrow"], outputs: ["nzOnSearch", "nzScrollToBottom", "nzOpenChange", "nzBlur", "nzFocus", "nzOnClear"], exportAs: ["nzSelect"] }, { kind: "ngmodule", type: NzInputModule }, { kind: "directive", type: i12.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzVariant", "nzSize", "nzStepperless", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "ngmodule", type: NzSwitchModule }, { kind: "component", type: i13.NzSwitchComponent, selector: "nz-switch", inputs: ["nzLoading", "nzDisabled", "nzControl", "nzCheckedChildren", "nzUnCheckedChildren", "nzSize", "nzId"], exportAs: ["nzSwitch"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: NzFlexModule }, { kind: "directive", type: i14.NzFlexDirective, selector: "[nz-flex],nz-flex", inputs: ["nzVertical", "nzJustify", "nzAlign", "nzGap", "nzWrap", "nzFlex"], exportAs: ["nzFlex"] }, { kind: "ngmodule", type: NzInputNumberModule }, { kind: "component", type: i15.NzInputNumberComponent, selector: "nz-input-number", inputs: ["nzId", "nzSize", "nzPlaceHolder", "nzStatus", "nzVariant", "nzStep", "nzMin", "nzMax", "nzPrecision", "nzParser", "nzFormatter", "nzDisabled", "nzReadOnly", "nzAutoFocus", "nzBordered", "nzKeyboard", "nzControls"], outputs: ["nzBlur", "nzFocus", "nzOnStep"], exportAs: ["nzInputNumber"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
157
157
|
}
|
|
158
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.
|
|
158
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: InputValidator, decorators: [{
|
|
159
159
|
type: Component,
|
|
160
160
|
args: [{ selector: 'axis-design-form-item-setting-input-validator', imports: [NzListModule, NzTagModule, NzSpaceModule, NzGridModule, NzIconModule, NzEmptyModule, NzButtonModule, NzModalModule, FormsModule, NzCollapseModule, NzFormModule, ReactiveFormsModule, FunField, NzSelectModule, NzInputModule, NzSwitchModule, CommonModule, NzFlexModule, NzInputNumberModule], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
161
161
|
{
|
|
@@ -186,10 +186,10 @@ class Setting extends FunFieldValueBase {
|
|
|
186
186
|
defaultValue: "120px",
|
|
187
187
|
},
|
|
188
188
|
};
|
|
189
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.
|
|
190
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.
|
|
189
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Setting, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
190
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: Setting, isStandalone: true, selector: "axis-design-form-item-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\">\n \u8868\u5355\u9879\u540D\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"name\">\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 \u8868\u5355\u9879\u6807\u7B7E\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"label\">\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 \u6807\u7B7E\u5BBD\u5EA6\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"labelWidth\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" />\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n </nz-collapse-panel>\n <axis-design-form-item-setting-input-validator\n formControlName=\"validators\"></axis-design-form-item-setting-input-validator>\n <axis-base-design-setting [fg]=\"fg\"></axis-base-design-setting>\n </nz-collapse>\n</form>", styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i8.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: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzFormModule }, { kind: "directive", type: i2.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: i2.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i10.NzFormDirective, selector: "[nz-form]", inputs: ["nzLayout", "nzNoColon", "nzAutoTips", "nzDisableAutoTips", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzForm"] }, { kind: "component", type: i10.NzFormItemComponent, selector: "nz-form-item", exportAs: ["nzFormItem"] }, { kind: "component", type: i10.NzFormLabelComponent, selector: "nz-form-label", inputs: ["nzFor", "nzRequired", "nzNoColon", "nzTooltipTitle", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzFormLabel"] }, { kind: "component", type: i10.NzFormControlComponent, selector: "nz-form-control", inputs: ["nzSuccessTip", "nzWarningTip", "nzErrorTip", "nzValidatingTip", "nzExtra", "nzAutoTips", "nzDisableAutoTips", "nzHasFeedback", "nzValidateStatus"], exportAs: ["nzFormControl"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i8.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i8.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: NzCollapseModule }, { kind: "component", type: i9.NzCollapsePanelComponent, selector: "nz-collapse-panel", inputs: ["nzActive", "nzDisabled", "nzShowArrow", "nzExtra", "nzHeader", "nzExpandedIcon"], outputs: ["nzActiveChange"], exportAs: ["nzCollapsePanel"] }, { kind: "component", type: i9.NzCollapseComponent, selector: "nz-collapse", inputs: ["nzAccordion", "nzBordered", "nzGhost", "nzExpandIconPosition"], exportAs: ["nzCollapse"] }, { kind: "component", type: BaseDesignSetting, selector: "axis-base-design-setting", inputs: ["scopeId", "exclude", "fg"] }, { 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: "ngmodule", type: NzSwitchModule }, { kind: "ngmodule", type: NzInputModule }, { kind: "directive", type: i12.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzVariant", "nzSize", "nzStepperless", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "component", type: InputValidator, selector: "axis-design-form-item-setting-input-validator", inputs: ["value", "showModal"], outputs: ["valueChange", "showModalChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
191
191
|
}
|
|
192
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.
|
|
192
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Setting, decorators: [{
|
|
193
193
|
type: Component,
|
|
194
194
|
args: [{ selector: 'axis-design-form-item-setting', imports: [FormsModule, NzFormModule, ReactiveFormsModule, NzCollapseModule, BaseDesignSetting, FunField, NzSwitchModule, NzInputModule, InputValidator], 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\">\n \u8868\u5355\u9879\u540D\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"name\">\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 \u8868\u5355\u9879\u6807\u7B7E\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"label\">\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 \u6807\u7B7E\u5BBD\u5EA6\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"labelWidth\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" />\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n </nz-collapse-panel>\n <axis-design-form-item-setting-input-validator\n formControlName=\"validators\"></axis-design-form-item-setting-input-validator>\n <axis-base-design-setting [fg]=\"fg\"></axis-base-design-setting>\n </nz-collapse>\n</form>" }]
|
|
195
195
|
}] });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { signal, effect, inject, model, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { BaseOptions, Base, AXIS_FORM_REGISTE_CONTROL_TOKEN, FormValidators, DynamicDirective
|
|
3
|
+
import { BaseOptions, Base, AXIS_FORM_REGISTE_CONTROL_TOKEN, FormValidators, DynamicDirective } from 'ngx-axis-appforge/core';
|
|
4
4
|
import * as i2 from 'ng-zorro-antd/form';
|
|
5
5
|
import { NzFormModule } from 'ng-zorro-antd/form';
|
|
6
6
|
import * as i3 from '@angular/forms';
|
|
@@ -37,7 +37,7 @@ class FormItem extends Base {
|
|
|
37
37
|
options = new FormItemOptions();
|
|
38
38
|
registe = inject(AXIS_FORM_REGISTE_CONTROL_TOKEN, { optional: true });
|
|
39
39
|
fb = inject(FormBuilder);
|
|
40
|
-
control = this.fb.control(
|
|
40
|
+
control = this.fb.control(undefined);
|
|
41
41
|
value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
|
|
42
42
|
validatorSignal = signal([], ...(ngDevMode ? [{ debugName: "validatorSignal" }] : []));
|
|
43
43
|
isRequired = computed(() => this.validatorSignal().includes(FormValidators.required), ...(ngDevMode ? [{ debugName: "isRequired" }] : []));
|
|
@@ -112,28 +112,12 @@ class FormItem extends Base {
|
|
|
112
112
|
this.validatorSignal.set(this.buildSnapshotValidators());
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.
|
|
116
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.
|
|
117
|
-
{
|
|
118
|
-
provide: AXIS_FORMITEM_REGISTE_VALUE_ACCESS_TOKEN,
|
|
119
|
-
useFactory: (formItem) => {
|
|
120
|
-
return formItem.registeValueAccess.bind(formItem);
|
|
121
|
-
},
|
|
122
|
-
deps: [FormItem]
|
|
123
|
-
}
|
|
124
|
-
], usesInheritance: true, ngImport: i0, template: "@if (options.label()) {\n<nz-form-item style=\"width: 100%;\">\n <nz-form-label [style.width]=\"options.labelWidth()\" [nzRequired]=\"isRequired()\">\n {{options.label()}}\n </nz-form-label>\n <nz-form-control style=\"flex:1\" [nzValidateStatus]=\"control\">\n <ng-container [axisDynamic]=\"options.child()\" [(ngModel)]=\"value\"\n (ngModelChange)=\"onModelChange($event)\"></ng-container>\n </nz-form-control>\n</nz-form-item>\n}@else {\n<div>\n <ng-container [axisDynamic]=\"options.child()\" [(ngModel)]=\"value\"\n (ngModelChange)=\"onModelChange($event)\"></ng-container>\n</div>\n}", styles: [":host{display:block;width: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"], 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 });
|
|
115
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: FormItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
116
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", 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%;\">\n <nz-form-label [style.width]=\"options.labelWidth()\" [nzRequired]=\"isRequired()\">\n {{options.label()}}\n </nz-form-label>\n <nz-form-control style=\"flex:1\" [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<div>\n <ng-container [axisDynamic]=\"options.child()\" [(ngModel)]=\"value\"\n (ngModelChange)=\"onModelChange($event)\"></ng-container>\n</div>\n}", styles: [":host{display:block;width: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 });
|
|
125
117
|
}
|
|
126
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.
|
|
118
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: FormItem, decorators: [{
|
|
127
119
|
type: Component,
|
|
128
|
-
args: [{ selector: 'axis-form-item', imports: [NzFormModule, DynamicDirective, FormsModule], changeDetection: ChangeDetectionStrategy.OnPush,
|
|
129
|
-
{
|
|
130
|
-
provide: AXIS_FORMITEM_REGISTE_VALUE_ACCESS_TOKEN,
|
|
131
|
-
useFactory: (formItem) => {
|
|
132
|
-
return formItem.registeValueAccess.bind(formItem);
|
|
133
|
-
},
|
|
134
|
-
deps: [FormItem]
|
|
135
|
-
}
|
|
136
|
-
], template: "@if (options.label()) {\n<nz-form-item style=\"width: 100%;\">\n <nz-form-label [style.width]=\"options.labelWidth()\" [nzRequired]=\"isRequired()\">\n {{options.label()}}\n </nz-form-label>\n <nz-form-control style=\"flex:1\" [nzValidateStatus]=\"control\">\n <ng-container [axisDynamic]=\"options.child()\" [(ngModel)]=\"value\"\n (ngModelChange)=\"onModelChange($event)\"></ng-container>\n </nz-form-control>\n</nz-form-item>\n}@else {\n<div>\n <ng-container [axisDynamic]=\"options.child()\" [(ngModel)]=\"value\"\n (ngModelChange)=\"onModelChange($event)\"></ng-container>\n</div>\n}", styles: [":host{display:block;width:100%}\n"] }]
|
|
120
|
+
args: [{ selector: 'axis-form-item', imports: [NzFormModule, DynamicDirective, FormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (options.label()) {\n<nz-form-item style=\"width: 100%;\">\n <nz-form-label [style.width]=\"options.labelWidth()\" [nzRequired]=\"isRequired()\">\n {{options.label()}}\n </nz-form-label>\n <nz-form-control style=\"flex:1\" [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<div>\n <ng-container [axisDynamic]=\"options.child()\" [(ngModel)]=\"value\"\n (ngModelChange)=\"onModelChange($event)\"></ng-container>\n</div>\n}", styles: [":host{display:block;width:100%}\n"] }]
|
|
137
121
|
}], ctorParameters: () => [] });
|
|
138
122
|
|
|
139
123
|
/**
|
|
@@ -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, AXIS_FORMITEM_REGISTE_VALUE_ACCESS_TOKEN, Base, 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';\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 providers: [\n {\n provide: AXIS_FORMITEM_REGISTE_VALUE_ACCESS_TOKEN,\n useFactory: (formItem: FormItem) => {\n return formItem.registeValueAccess.bind(formItem);\n },\n deps: [FormItem]\n }\n ]\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 protected 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([]);\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 const output: ValidatorFn[] = [];\n if (this.valueAccessValidFn) {\n output.push(this.valueAccessValidFn);\n }\n for (const v of validators) {\n if (v.disabled) {\n continue;\n }\n switch (v.type) {\n case \"required\":\n output.push(FormValidators.required);\n break;\n case \"length\":\n if (v.minLength || v.minLength == 0) {\n output.push(FormValidators.minLength(v.minLength));\n }\n if (v.maxLength || v.maxLength == 0) {\n output.push(FormValidators.maxLength(v.maxLength));\n }\n break;\n case \"value\":\n if (v.minValue || v.minValue == 0) {\n output.push(FormValidators.min(v.minValue));\n }\n if (v.maxValue || v.maxValue == 0) {\n output.push(FormValidators.max(v.maxValue));\n }\n break;\n case \"regex\":\n if (v.pattern) {\n output.push(FormValidators.pattern(v.pattern));\n }\n break;\n }\n }\n return output;\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%;\">\n <nz-form-label [style.width]=\"options.labelWidth()\" [nzRequired]=\"isRequired()\">\n {{options.label()}}\n </nz-form-label>\n <nz-form-control style=\"flex:1\" [nzValidateStatus]=\"control\">\n <ng-container [axisDynamic]=\"options.child()\" [(ngModel)]=\"value\"\n (ngModelChange)=\"onModelChange($event)\"></ng-container>\n </nz-form-control>\n</nz-form-item>\n}@else {\n<div>\n <ng-container [axisDynamic]=\"options.child()\" [(ngModel)]=\"value\"\n (ngModelChange)=\"onModelChange($event)\"></ng-container>\n</div>\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;;ACYK,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,aAAC,CAAC;YACF,MAAM,CAAC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A,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAc1C,QAAQ,EAAA,UAAA,EAAA,CAAA;kBAhBpB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAAA,OAAA,EACjB,CAAC,YAAY,EAAE,gBAAgB,EAAE,WAAW,CAAC,EAAA,eAAA,EAGrC,uBAAuB,CAAC,MAAM,EAAA,SAAA,EACpC;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,wCAAwC;AACjD,4BAAA,UAAU,EAAE,CAAC,QAAkB,KAAI;gCACjC,OAAO,QAAQ,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC;6BAClD;AACD,4BAAA,IAAI,EAAE,CAAA,QAAA;AACP;AACF,qBAAA,EAAA,QAAA,EAAA,6nBAAA,EAAA,MAAA,EAAA,CAAA,mCAAA,CAAA,EAAA;;;AErBH;;AAEG;;;;"}
|
|
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, 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';\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 protected 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 const output: ValidatorFn[] = [];\n if (this.valueAccessValidFn) {\n output.push(this.valueAccessValidFn);\n }\n for (const v of validators) {\n if (v.disabled) {\n continue;\n }\n switch (v.type) {\n case \"required\":\n output.push(FormValidators.required);\n break;\n case \"length\":\n if (v.minLength || v.minLength == 0) {\n output.push(FormValidators.minLength(v.minLength));\n }\n if (v.maxLength || v.maxLength == 0) {\n output.push(FormValidators.maxLength(v.maxLength));\n }\n break;\n case \"value\":\n if (v.minValue || v.minValue == 0) {\n output.push(FormValidators.min(v.minValue));\n }\n if (v.maxValue || v.maxValue == 0) {\n output.push(FormValidators.max(v.maxValue));\n }\n break;\n case \"regex\":\n if (v.pattern) {\n output.push(FormValidators.pattern(v.pattern));\n }\n break;\n }\n }\n return output;\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%;\">\n <nz-form-label [style.width]=\"options.labelWidth()\" [nzRequired]=\"isRequired()\">\n {{options.label()}}\n </nz-form-label>\n <nz-form-control style=\"flex:1\" [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<div>\n <ng-container [axisDynamic]=\"options.child()\" [(ngModel)]=\"value\"\n (ngModelChange)=\"onModelChange($event)\"></ng-container>\n</div>\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,SA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BAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,mrBAAA,EAAA,MAAA,EAAA,CAAA,mCAAA,CAAA,EAAA;;;AEZjD;;AAEG;;;;"}
|
|
@@ -28,22 +28,25 @@ class Form extends ValueAccess {
|
|
|
28
28
|
fb = inject(FormBuilder);
|
|
29
29
|
modal = inject(NzModalService);
|
|
30
30
|
fg = this.fb.group({});
|
|
31
|
+
oriFormValue;
|
|
31
32
|
oriValue;
|
|
32
33
|
resetSubject = new Subject();
|
|
33
34
|
writeValue(value) {
|
|
34
35
|
super.writeValue(value);
|
|
35
|
-
this.
|
|
36
|
+
this.oriFormValue = value;
|
|
37
|
+
this.oriValue = this.oriFormValue;
|
|
36
38
|
this.resetSubject.next(false);
|
|
37
39
|
}
|
|
38
40
|
setInitValue(value) {
|
|
39
41
|
super.setInitValue(value);
|
|
40
42
|
if (this.options.initValue() !== undefined) {
|
|
41
|
-
this.
|
|
43
|
+
this.oriFormValue = this.options.initValue();
|
|
44
|
+
this.oriValue = this.oriFormValue;
|
|
42
45
|
this.resetSubject.next(true);
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
48
|
ngOnInit() {
|
|
46
|
-
this.
|
|
49
|
+
this.registeValueAccess?.({
|
|
47
50
|
validFn: (control) => {
|
|
48
51
|
return updateAndValidAll(this.fg, { markAsDirty: control.dirty });
|
|
49
52
|
}
|
|
@@ -51,17 +54,23 @@ class Form extends ValueAccess {
|
|
|
51
54
|
}
|
|
52
55
|
registerControl(opt) {
|
|
53
56
|
if (opt.control) {
|
|
57
|
+
const oldControl = this.fg.get(opt.name);
|
|
58
|
+
if (oldControl?.value != undefined) {
|
|
59
|
+
opt.control.setValue(oldControl.value);
|
|
60
|
+
}
|
|
54
61
|
this.fg.setControl(opt.name, opt.control, { emitEvent: false });
|
|
55
62
|
}
|
|
56
63
|
let emitEvent = false;
|
|
57
|
-
if (opt.initValue !== undefined) {
|
|
64
|
+
if (this.oriFormValue?.[opt.name] === undefined && opt.initValue !== undefined) {
|
|
58
65
|
this.oriValue = Object.assign({}, this.oriValue, { [opt.name]: opt.initValue });
|
|
59
|
-
this.
|
|
66
|
+
this.registeValueAccess?.({
|
|
60
67
|
initValue: this.oriValue
|
|
61
68
|
});
|
|
62
69
|
emitEvent = true;
|
|
63
70
|
}
|
|
64
|
-
this.
|
|
71
|
+
if (!this.fg.dirty) {
|
|
72
|
+
this.resetSubject.next(emitEvent);
|
|
73
|
+
}
|
|
65
74
|
}
|
|
66
75
|
reset(emitEvent = false) {
|
|
67
76
|
this.fg.reset(this.oriValue, { emitEvent: emitEvent, onlySelf: true });
|
|
@@ -99,8 +108,8 @@ class Form extends ValueAccess {
|
|
|
99
108
|
}
|
|
100
109
|
return undefined;
|
|
101
110
|
}
|
|
102
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.
|
|
103
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.
|
|
111
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Form, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
112
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: Form, isStandalone: true, selector: "axis-form", providers: [
|
|
104
113
|
{
|
|
105
114
|
provide: AXIS_FORM_REGISTE_CONTROL_TOKEN,
|
|
106
115
|
useFactory: (form) => {
|
|
@@ -108,9 +117,9 @@ class Form extends ValueAccess {
|
|
|
108
117
|
},
|
|
109
118
|
deps: [Form]
|
|
110
119
|
}
|
|
111
|
-
], 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"], exportAs: ["axisDynamic"] }, { kind: "ngmodule", type: NzModalModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
120
|
+
], 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 });
|
|
112
121
|
}
|
|
113
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.
|
|
122
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Form, decorators: [{
|
|
114
123
|
type: Component,
|
|
115
124
|
args: [{ selector: 'axis-form', imports: [ReactiveFormsModule, DynamicDirective, NzModalModule], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
116
125
|
{
|
|
@@ -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 } 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.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 } });\n }))\n }\n\n protected override options: FormOptions = new FormOptions();\n private readonly fb = inject(FormBuilder);\n private readonly modal = inject(NzModalService);\n readonly fg = this.fb.group({});\n private oriValue: any;\n private resetSubject = new Subject<boolean>();\n\n override writeValue(value: any): void {\n super.writeValue(value);\n this.oriValue = value;\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.oriValue = this.options.initValue();\n this.resetSubject.next(true);\n }\n }\n\n ngOnInit(): void {\n this.registValueAccess({\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 this.fg.setControl(opt.name, opt.control, { emitEvent: false });\n }\n let emitEvent = false;\n if (opt.initValue !== undefined) {\n this.oriValue = Object.assign({}, this.oriValue, { [opt.name]: opt.initValue });\n this.registValueAccess({\n initValue: this.oriValue\n });\n emitEvent = true;\n }\n this.resetSubject.next(emitEvent);\n }\n\n reset(emitEvent = false) {\n this.fg.reset(this.oriValue, { emitEvent: emitEvent, onlySelf: true });\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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A,CAAA,WAAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,gBAAgB,uIAAE,aAAa,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAcnD,IAAI,EAAA,UAAA,EAAA,CAAA;kBAhBhB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,WAAW,EAAA,OAAA,EACZ,CAAC,mBAAmB,EAAE,gBAAgB,EAAE,aAAa,CAAC,EAAA,eAAA,EAG9C,uBAAuB,CAAC,MAAM,EAAA,SAAA,EACpC;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,+BAA+B;AACxC,4BAAA,UAAU,EAAE,CAAC,IAAU,KAAI;gCACzB,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;6BACvC;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.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 } });\n }))\n }\n\n protected 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(true);\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 let emitEvent = false;\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 emitEvent = true;\n }\n if (!this.fg.dirty) {\n this.resetSubject.next(emitEvent);\n }\n }\n\n reset(emitEvent = false) {\n this.fg.reset(this.oriValue, { emitEvent: emitEvent, onlySelf: true });\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,I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EAAA,CAAA,aAAA,EAAA,QAAA,EAAA,8CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,0FAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,kBAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,WAAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,gBAAgB,0KAAE,aAAa,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAcnD,IAAI,EAAA,UAAA,EAAA,CAAA;kBAhBhB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,WAAW,EAAA,OAAA,EACZ,CAAC,mBAAmB,EAAE,gBAAgB,EAAE,aAAa,CAAC,EAAA,eAAA,EAG9C,uBAAuB,CAAC,MAAM,EAAA,SAAA,EACpC;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,+BAA+B;AACxC,4BAAA,UAAU,EAAE,CAAC,IAAU,KAAI;gCACzB,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;6BACvC;AACD,4BAAA,IAAI,EAAE,CAAA,IAAA;AACP;AACF,qBAAA,EAAA,QAAA,EAAA,yGAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA;;;AErBH;;AAEG;;;;"}
|
|
@@ -36,10 +36,10 @@ class Setting extends FunFieldValueBase {
|
|
|
36
36
|
theme;
|
|
37
37
|
icon;
|
|
38
38
|
preview = computed(() => ({ component: "axis-components/icon", inuse: true, lib: this.lib.computeResult(), theme: this.theme?.computeResult(), icon: this.icon.computeResult() }), ...(ngDevMode ? [{ debugName: "preview" }] : []));
|
|
39
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.
|
|
40
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.
|
|
39
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Setting, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
40
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: Setting, isStandalone: true, selector: "axis-design-icon-setting", viewQueries: [{ propertyName: "lib", first: true, predicate: ["lib"], descendants: true, static: true }, { propertyName: "theme", first: true, predicate: ["theme"], descendants: true }, { propertyName: "icon", first: true, predicate: ["icon"], descendants: true, static: true }], 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 \u56FE\u6807\u5E93\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"lib\" #lib>\n <nz-radio-group ngModel [ngModelOptions]=\"{standalone:true}\" nzSize=\"small\">\n <label nz-radio-button nzValue=\"antdesign\">antdesign</label>\n <label nz-radio-button nzValue=\"iconfont\">iconfont</label>\n </nz-radio-group>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n @if (formValue()?.lib.funMode || formValue()?.lib.originValue == 'antdesign') {\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\u56FE\u6807\u4E3B\u9898</nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"theme\" #theme>\n <nz-radio-group ngModel [ngModelOptions]=\"{standalone:true}\" nzSize=\"small\">\n <label nz-radio-button nzValue=\"outline\">outline</label>\n <label nz-radio-button nzValue=\"fill\">fill</label>\n <label nz-radio-button nzValue=\"twotone\">twotone</label>\n </nz-radio-group>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n }\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\u56FE\u6807</nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"icon\" #icon>\n <nz-input-group style=\"max-width: 200px;\" [nzSuffix]=\"iconPreview\">\n <input autofocus placeholder=\"\u8F93\u5165\u56FE\u6807\uFF0C\u5982 edit\" nz-input ngModel\n [ngModelOptions]=\"{standalone:true}\" />\n </nz-input-group>\n </axis-fun-field>\n <ng-template #iconPreview>\n @if (value()) {\n <ng-container [axisDynamic]=\"preview()\" [standalone]=\"true\"></ng-container>\n }\n </ng-template>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n antdesign \u56FE\u6807\u5E93\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <a target=\"_blank\"\n href=\"https://ng.ant.design/components/icon/zh\">https://ng.ant.design/components/icon/zh</a>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n iconfont \u56FE\u6807\u5E93\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <a target=\"_blank\" href=\"https://www.iconfont.cn/\">https://www.iconfont.cn/</a>\n </nz-form-control>\n </nz-form-item>\n </nz-collapse-panel>\n <axis-base-design-setting [fg]=\"fg\"></axis-base-design-setting>\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: NzFormModule }, { kind: "directive", type: i2.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: i2.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i3.NzFormDirective, selector: "[nz-form]", inputs: ["nzLayout", "nzNoColon", "nzAutoTips", "nzDisableAutoTips", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzForm"] }, { kind: "component", type: i3.NzFormItemComponent, selector: "nz-form-item", exportAs: ["nzFormItem"] }, { kind: "component", type: i3.NzFormLabelComponent, selector: "nz-form-label", inputs: ["nzFor", "nzRequired", "nzNoColon", "nzTooltipTitle", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzFormLabel"] }, { kind: "component", type: i3.NzFormControlComponent, selector: "nz-form-control", inputs: ["nzSuccessTip", "nzWarningTip", "nzErrorTip", "nzValidatingTip", "nzExtra", "nzAutoTips", "nzDisableAutoTips", "nzHasFeedback", "nzValidateStatus"], exportAs: ["nzFormControl"] }, { 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: NzCollapseModule }, { kind: "component", type: i4.NzCollapsePanelComponent, selector: "nz-collapse-panel", inputs: ["nzActive", "nzDisabled", "nzShowArrow", "nzExtra", "nzHeader", "nzExpandedIcon"], outputs: ["nzActiveChange"], exportAs: ["nzCollapsePanel"] }, { kind: "component", type: i4.NzCollapseComponent, selector: "nz-collapse", inputs: ["nzAccordion", "nzBordered", "nzGhost", "nzExpandIconPosition"], exportAs: ["nzCollapse"] }, { kind: "component", type: BaseDesignSetting, selector: "axis-base-design-setting", inputs: ["scopeId", "exclude", "fg"] }, { 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: "ngmodule", type: NzRadioModule }, { kind: "component", type: i5.NzRadioComponent, selector: "[nz-radio],[nz-radio-button]", inputs: ["nzValue", "nzDisabled", "nzAutoFocus", "nz-radio-button"], exportAs: ["nzRadio"] }, { kind: "component", type: i5.NzRadioGroupComponent, selector: "nz-radio-group", inputs: ["nzDisabled", "nzButtonStyle", "nzSize", "nzName"], exportAs: ["nzRadioGroup"] }, { kind: "ngmodule", type: NzInputModule }, { kind: "directive", type: i6.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzVariant", "nzSize", "nzStepperless", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "component", type: i6.NzInputGroupComponent, selector: "nz-input-group", inputs: ["nzAddOnBeforeIcon", "nzAddOnAfterIcon", "nzPrefixIcon", "nzSuffixIcon", "nzAddOnBefore", "nzAddOnAfter", "nzPrefix", "nzStatus", "nzSuffix", "nzSize", "nzSearch"], exportAs: ["nzInputGroup"] }, { kind: "directive", type: i6.NzInputGroupWhitSuffixOrPrefixDirective, selector: "nz-input-group[nzSuffix], nz-input-group[nzPrefix]" }, { kind: "directive", type: DynamicDirective, selector: "[axisDynamic]", inputs: ["axisDynamic", "standalone", "isDesign"], outputs: ["onRegisteValueAccess"], exportAs: ["axisDynamic"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
41
41
|
}
|
|
42
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.
|
|
42
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Setting, decorators: [{
|
|
43
43
|
type: Component,
|
|
44
44
|
args: [{ selector: 'axis-design-icon-setting', imports: [FormsModule, NzFormModule, ReactiveFormsModule, NzCollapseModule, BaseDesignSetting, FunField, NzRadioModule, NzInputModule, 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 \u56FE\u6807\u5E93\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"lib\" #lib>\n <nz-radio-group ngModel [ngModelOptions]=\"{standalone:true}\" nzSize=\"small\">\n <label nz-radio-button nzValue=\"antdesign\">antdesign</label>\n <label nz-radio-button nzValue=\"iconfont\">iconfont</label>\n </nz-radio-group>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n @if (formValue()?.lib.funMode || formValue()?.lib.originValue == 'antdesign') {\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\u56FE\u6807\u4E3B\u9898</nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"theme\" #theme>\n <nz-radio-group ngModel [ngModelOptions]=\"{standalone:true}\" nzSize=\"small\">\n <label nz-radio-button nzValue=\"outline\">outline</label>\n <label nz-radio-button nzValue=\"fill\">fill</label>\n <label nz-radio-button nzValue=\"twotone\">twotone</label>\n </nz-radio-group>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n }\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\u56FE\u6807</nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"icon\" #icon>\n <nz-input-group style=\"max-width: 200px;\" [nzSuffix]=\"iconPreview\">\n <input autofocus placeholder=\"\u8F93\u5165\u56FE\u6807\uFF0C\u5982 edit\" nz-input ngModel\n [ngModelOptions]=\"{standalone:true}\" />\n </nz-input-group>\n </axis-fun-field>\n <ng-template #iconPreview>\n @if (value()) {\n <ng-container [axisDynamic]=\"preview()\" [standalone]=\"true\"></ng-container>\n }\n </ng-template>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n antdesign \u56FE\u6807\u5E93\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <a target=\"_blank\"\n href=\"https://ng.ant.design/components/icon/zh\">https://ng.ant.design/components/icon/zh</a>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n iconfont \u56FE\u6807\u5E93\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <a target=\"_blank\" href=\"https://www.iconfont.cn/\">https://www.iconfont.cn/</a>\n </nz-form-control>\n </nz-form-item>\n </nz-collapse-panel>\n <axis-base-design-setting [fg]=\"fg\"></axis-base-design-setting>\n </nz-collapse>\n</form>" }]
|
|
45
45
|
}], propDecorators: { lib: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-axis-appforge-axis-components-icon-design.mjs","sources":["../../../axis-components/icon/design/setting/setting.ts","../../../axis-components/icon/design/setting/setting.html","../../../axis-components/icon/design/config.ts","../../../axis-components/icon/design/ngx-axis-appforge-axis-components-icon-design.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, ViewChild } 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 { NzRadioModule } from 'ng-zorro-antd/radio';\nimport { BaseDesignSetting, baseFbConfig, baseFunField, DynamicDirective, FormValidators, FunField, FunFieldOptions, FunFieldValueBase } from 'ngx-axis-appforge/core';\n\n@Component({\n selector: 'axis-design-icon-setting',\n imports: [FormsModule, NzFormModule, ReactiveFormsModule, NzCollapseModule, BaseDesignSetting, FunField, NzRadioModule, NzInputModule, 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 lib: [undefined, FormValidators.requiredFun],\n theme: [undefined, FormValidators.requiredFun],\n icon: [undefined, FormValidators.requiredFun],\n });\n\n protected override funFields: FunFieldOptions = {\n ...baseFunField,\n lib: {\n defaultValue: \"antdesign\"\n },\n theme: {\n defaultValue: \"outline\"\n },\n icon: {\n defaultValue: undefined\n },\n };\n\n @ViewChild(\"lib\", { static: true })\n lib!: FunField;\n\n @ViewChild(\"theme\")\n theme?: FunField;\n\n @ViewChild(\"icon\", { static: true })\n icon!: FunField;\n\n readonly preview = computed(() => ({ component: \"axis-components/icon\", inuse: true, lib: this.lib.computeResult(), theme: this.theme?.computeResult(), icon: this.icon.computeResult() }));\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=\"lib\" #lib>\n <nz-radio-group ngModel [ngModelOptions]=\"{standalone:true}\" nzSize=\"small\">\n <label nz-radio-button nzValue=\"antdesign\">antdesign</label>\n <label nz-radio-button nzValue=\"iconfont\">iconfont</label>\n </nz-radio-group>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n @if (formValue()?.lib.funMode || formValue()?.lib.originValue == 'antdesign') {\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>图标主题</nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"theme\" #theme>\n <nz-radio-group ngModel [ngModelOptions]=\"{standalone:true}\" nzSize=\"small\">\n <label nz-radio-button nzValue=\"outline\">outline</label>\n <label nz-radio-button nzValue=\"fill\">fill</label>\n <label nz-radio-button nzValue=\"twotone\">twotone</label>\n </nz-radio-group>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n }\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>图标</nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"icon\" #icon>\n <nz-input-group style=\"max-width: 200px;\" [nzSuffix]=\"iconPreview\">\n <input autofocus placeholder=\"输入图标,如 edit\" nz-input ngModel\n [ngModelOptions]=\"{standalone:true}\" />\n </nz-input-group>\n </axis-fun-field>\n <ng-template #iconPreview>\n @if (value()) {\n <ng-container [axisDynamic]=\"preview()\" [standalone]=\"true\"></ng-container>\n }\n </ng-template>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n antdesign 图标库\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <a target=\"_blank\"\n href=\"https://ng.ant.design/components/icon/zh\">https://ng.ant.design/components/icon/zh</a>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n iconfont 图标库\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <a target=\"_blank\" href=\"https://www.iconfont.cn/\">https://www.iconfont.cn/</a>\n </nz-form-control>\n </nz-form-item>\n </nz-collapse-panel>\n <axis-base-design-setting [fg]=\"fg\"></axis-base-design-setting>\n </nz-collapse>\n</form>","import { NextInfo, DesignBuildResult, DesignBindElementsResult, DesignConfig, OptionsNode, nameCode, SimpleMenu } from \"ngx-axis-appforge/core\";\nimport { Setting } from \"./setting/setting\";\n\nexport const Config: DesignConfig = {\n componentName: \"图标\",\n buildOptionsNodes(nextInfo: NextInfo): DesignBuildResult {\n return {\n treeNode: new OptionsNode({\n parentId: nextInfo.parentId,\n scopeId: nextInfo.scopeId,\n name: nameCode(\"图标\", nextInfo.currentObject.icon),\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: \"fire\"\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":";;;;;;;;;;;;;;;AAeM,MAAO,OAAQ,SAAQ,iBAAiB,CAAA;AAEnC,IAAA,EAAE,GAAqB,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC;AAC5C,QAAA,GAAG,YAAY;AACf,QAAA,GAAG,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC;AAC5C,QAAA,KAAK,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC;AAC9C,QAAA,IAAI,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC;AAC9C,KAAA,CAAC;AAEiB,IAAA,SAAS,GAAoB;AAC9C,QAAA,GAAG,YAAY;AACf,QAAA,GAAG,EAAE;AACH,YAAA,YAAY,EAAE;AACf,SAAA;AACD,QAAA,KAAK,EAAE;AACL,YAAA,YAAY,EAAE;AACf,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,YAAY,EAAE;AACf,SAAA;KACF;AAGD,IAAA,GAAG;AAGH,IAAA,KAAK;AAGL,IAAA,IAAI;IAEK,OAAO,GAAG,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gHAAA,EAAA;8BAyB/C,GAAG,EAAA,CAAA;sBADF,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;gBAIlC,KAAK,EAAA,CAAA;sBADJ,SAAS;uBAAC,OAAO;gBAIlB,IAAI,EAAA,CAAA;sBADH,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;;;AExC9B,MAAM,MAAM,GAAiB;AAChC,IAAA,aAAa,EAAE,IAAI;AACnB,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;gBACzB,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC;AACjD,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;aACT;SACJ;KACJ;IACD,uBAAuB,CAAC,OAAoB,EAAE,OAAY,EAAA;QACtD,OAAO;AACH,YAAA,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,OAAO;SAC1B;KACJ;;;AC3BL;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-axis-appforge-axis-components-icon-design.mjs","sources":["../../../axis-components/icon/design/setting/setting.ts","../../../axis-components/icon/design/setting/setting.html","../../../axis-components/icon/design/config.ts","../../../axis-components/icon/design/ngx-axis-appforge-axis-components-icon-design.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, ViewChild } 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 { NzRadioModule } from 'ng-zorro-antd/radio';\nimport { BaseDesignSetting, baseFbConfig, baseFunField, DynamicDirective, FormValidators, FunField, FunFieldOptions, FunFieldValueBase } from 'ngx-axis-appforge/core';\n\n@Component({\n selector: 'axis-design-icon-setting',\n imports: [FormsModule, NzFormModule, ReactiveFormsModule, NzCollapseModule, BaseDesignSetting, FunField, NzRadioModule, NzInputModule, 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 lib: [undefined, FormValidators.requiredFun],\n theme: [undefined, FormValidators.requiredFun],\n icon: [undefined, FormValidators.requiredFun],\n });\n\n protected override funFields: FunFieldOptions = {\n ...baseFunField,\n lib: {\n defaultValue: \"antdesign\"\n },\n theme: {\n defaultValue: \"outline\"\n },\n icon: {\n defaultValue: undefined\n },\n };\n\n @ViewChild(\"lib\", { static: true })\n lib!: FunField;\n\n @ViewChild(\"theme\")\n theme?: FunField;\n\n @ViewChild(\"icon\", { static: true })\n icon!: FunField;\n\n readonly preview = computed(() => ({ component: \"axis-components/icon\", inuse: true, lib: this.lib.computeResult(), theme: this.theme?.computeResult(), icon: this.icon.computeResult() }));\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=\"lib\" #lib>\n <nz-radio-group ngModel [ngModelOptions]=\"{standalone:true}\" nzSize=\"small\">\n <label nz-radio-button nzValue=\"antdesign\">antdesign</label>\n <label nz-radio-button nzValue=\"iconfont\">iconfont</label>\n </nz-radio-group>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n @if (formValue()?.lib.funMode || formValue()?.lib.originValue == 'antdesign') {\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>图标主题</nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"theme\" #theme>\n <nz-radio-group ngModel [ngModelOptions]=\"{standalone:true}\" nzSize=\"small\">\n <label nz-radio-button nzValue=\"outline\">outline</label>\n <label nz-radio-button nzValue=\"fill\">fill</label>\n <label nz-radio-button nzValue=\"twotone\">twotone</label>\n </nz-radio-group>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n }\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>图标</nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"icon\" #icon>\n <nz-input-group style=\"max-width: 200px;\" [nzSuffix]=\"iconPreview\">\n <input autofocus placeholder=\"输入图标,如 edit\" nz-input ngModel\n [ngModelOptions]=\"{standalone:true}\" />\n </nz-input-group>\n </axis-fun-field>\n <ng-template #iconPreview>\n @if (value()) {\n <ng-container [axisDynamic]=\"preview()\" [standalone]=\"true\"></ng-container>\n }\n </ng-template>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n antdesign 图标库\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <a target=\"_blank\"\n href=\"https://ng.ant.design/components/icon/zh\">https://ng.ant.design/components/icon/zh</a>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n iconfont 图标库\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <a target=\"_blank\" href=\"https://www.iconfont.cn/\">https://www.iconfont.cn/</a>\n </nz-form-control>\n </nz-form-item>\n </nz-collapse-panel>\n <axis-base-design-setting [fg]=\"fg\"></axis-base-design-setting>\n </nz-collapse>\n</form>","import { NextInfo, DesignBuildResult, DesignBindElementsResult, DesignConfig, OptionsNode, nameCode, SimpleMenu } from \"ngx-axis-appforge/core\";\nimport { Setting } from \"./setting/setting\";\n\nexport const Config: DesignConfig = {\n componentName: \"图标\",\n buildOptionsNodes(nextInfo: NextInfo): DesignBuildResult {\n return {\n treeNode: new OptionsNode({\n parentId: nextInfo.parentId,\n scopeId: nextInfo.scopeId,\n name: nameCode(\"图标\", nextInfo.currentObject.icon),\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: \"fire\"\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":";;;;;;;;;;;;;;;AAeM,MAAO,OAAQ,SAAQ,iBAAiB,CAAA;AAEnC,IAAA,EAAE,GAAqB,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC;AAC5C,QAAA,GAAG,YAAY;AACf,QAAA,GAAG,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC;AAC5C,QAAA,KAAK,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC;AAC9C,QAAA,IAAI,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC;AAC9C,KAAA,CAAC;AAEiB,IAAA,SAAS,GAAoB;AAC9C,QAAA,GAAG,YAAY;AACf,QAAA,GAAG,EAAE;AACH,YAAA,YAAY,EAAE;AACf,SAAA;AACD,QAAA,KAAK,EAAE;AACL,YAAA,YAAY,EAAE;AACf,SAAA;AACD,QAAA,IAAI,EA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12,10 @@ class IconOptions extends BaseOptions {
|
|
|
12
12
|
|
|
13
13
|
class Icon extends Base {
|
|
14
14
|
options = new IconOptions();
|
|
15
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.
|
|
16
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.
|
|
15
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Icon, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
16
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: Icon, isStandalone: true, selector: "axis-icon", usesInheritance: true, ngImport: i0, template: "@if (options.icon()) {\n@if (options.lib()!='iconfont') {\n<nz-icon [nzType]=\"options.icon()\" [nzTheme]=\"options.theme()\"></nz-icon>\n}@else {\n<nz-icon [nzIconfont]=\"options.icon()\"></nz-icon>\n}\n}", styles: [""], dependencies: [{ kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i1.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
17
17
|
}
|
|
18
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.
|
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Icon, decorators: [{
|
|
19
19
|
type: Component,
|
|
20
20
|
args: [{ selector: 'axis-icon', imports: [NzIconModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (options.icon()) {\n@if (options.lib()!='iconfont') {\n<nz-icon [nzType]=\"options.icon()\" [nzTheme]=\"options.theme()\"></nz-icon>\n}@else {\n<nz-icon [nzIconfont]=\"options.icon()\"></nz-icon>\n}\n}" }]
|
|
21
21
|
}] });
|