ngx-rs-ant 0.7.0 → 0.7.9
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/box-container/box-container.component.d.ts +2 -1
- package/box-container/box-container.module.d.ts +5 -4
- package/box-container/box-item/box-item.component.d.ts +2 -1
- package/box-container/plugin-active/plugin-active.component.d.ts +1 -2
- package/box-container/plugin-not-found/plugin-not-found.component.d.ts +5 -0
- package/esm2020/box-container/PluginManager.mjs +15 -3
- package/esm2020/box-container/box-container.component.mjs +4 -2
- package/esm2020/box-container/box-container.module.mjs +6 -3
- package/esm2020/box-container/box-item/box-item.component.mjs +24 -7
- package/esm2020/box-container/box-item/item-blank/item-blank.component.mjs +13 -4
- package/esm2020/box-container/plugin-active/plugin-active.component.mjs +5 -6
- package/esm2020/box-container/plugin-not-found/plugin-not-found.component.mjs +11 -0
- package/esm2020/form/form.component.mjs +11 -5
- package/fesm2015/ngx-rs-ant.mjs +84 -31
- package/fesm2015/ngx-rs-ant.mjs.map +1 -1
- package/fesm2020/ngx-rs-ant.mjs +84 -31
- package/fesm2020/ngx-rs-ant.mjs.map +1 -1
- package/form/form.component.d.ts +2 -0
- package/package.json +1 -1
package/fesm2020/ngx-rs-ant.mjs
CHANGED
|
@@ -3,19 +3,19 @@ import { Component, Input, HostBinding, EventEmitter, Output, HostListener, View
|
|
|
3
3
|
import { PluginFactory } from 'coast-plugin-register';
|
|
4
4
|
import * as i1 from '@angular/common';
|
|
5
5
|
import { CommonModule } from '@angular/common';
|
|
6
|
+
import * as i2 from 'ng-devui/dragdrop';
|
|
6
7
|
import { Subject, map, lastValueFrom } from 'rxjs';
|
|
7
|
-
import * as i2 from 'ng-devui/input-number';
|
|
8
|
+
import * as i2$1 from 'ng-devui/input-number';
|
|
8
9
|
import * as i5 from '@angular/forms';
|
|
9
10
|
import { FormsModule, UntypedFormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
10
|
-
import * as i1$1 from 'ng-devui/dragdrop';
|
|
11
11
|
import { DevUIModule, FormLayout } from 'ng-devui';
|
|
12
12
|
import CustomStore from 'devextreme/data/custom_store';
|
|
13
13
|
import * as i3 from 'devextreme-angular';
|
|
14
14
|
import { DxDataGridComponent, DxDataGridModule } from 'devextreme-angular';
|
|
15
|
-
import * as i1$
|
|
15
|
+
import * as i1$1 from '@angular/common/http';
|
|
16
16
|
import * as i4 from 'devextreme-angular/ui/nested';
|
|
17
17
|
import * as i5$1 from 'devextreme-angular/core';
|
|
18
|
-
import * as i2$
|
|
18
|
+
import * as i2$2 from 'ng-devui/button';
|
|
19
19
|
import * as i3$1 from 'ng-devui/form';
|
|
20
20
|
import * as i4$1 from 'ng-devui/text-input';
|
|
21
21
|
import * as i4$2 from 'ng-devui/loading';
|
|
@@ -111,9 +111,7 @@ class PluginActiveComponent {
|
|
|
111
111
|
};
|
|
112
112
|
this._targetRect = {};
|
|
113
113
|
this.width = 0;
|
|
114
|
-
this._width = 0;
|
|
115
114
|
this.height = 0;
|
|
116
|
-
this._height = 0;
|
|
117
115
|
}
|
|
118
116
|
get _style() {
|
|
119
117
|
if (!this.targetElement) {
|
|
@@ -142,10 +140,10 @@ class PluginActiveComponent {
|
|
|
142
140
|
}
|
|
143
141
|
}
|
|
144
142
|
PluginActiveComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PluginActiveComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
145
|
-
PluginActiveComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: PluginActiveComponent, selector: "rs-plugin-active", host: { properties: { "style": "this._style" } }, ngImport: i0, template: "<div class=\"active-
|
|
143
|
+
PluginActiveComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: PluginActiveComponent, selector: "rs-plugin-active", host: { properties: { "style": "this._style" } }, ngImport: i0, template: "<div class=\"active-item\"\r\n dDraggable\r\n [disabled]=\"!showClose || showDivider\"\r\n [dragData]=\"dragData\"\r\n dragScope=\"plugin-item\"\r\n>\r\n <div class=\"active-bar\">\r\n <i *ngIf=\"showClose && !showDivider\" class=\"icon-drag\"></i>\r\n <span>{{name}}</span>\r\n <i *ngIf=\"showClose\" class=\"icon-close\" (click)=\"onItemCloseIconClick($event)\"></i>\r\n </div>\r\n <rs-divider *ngIf=\"showDivider\" [targetElement]=\"targetElement\" direction=\"row\"\r\n (dividerClick)=\"splitItem('column')\"></rs-divider>\r\n <rs-divider *ngIf=\"showDivider\" [targetElement]=\"targetElement\" direction=\"column\"\r\n (dividerClick)=\"splitItem('row')\"></rs-divider>\r\n</div>\r\n", styles: [":host{display:none;position:absolute;border:1px solid var(--devui-brand, #5e7ce0);pointer-events:none}:host .active-item{width:100%;height:100%}:host .active-item .active-bar{padding:2px 4px;color:#fff;background-color:var(--devui-brand, #5e7ce0);position:absolute;top:-23px;right:-1px;display:flex;flex-flow:row nowrap;align-items:center;pointer-events:all;white-space:nowrap}:host .active-item .active-bar i.icon-drag{flex:none;margin-right:8px;cursor:move}:host .active-item .active-bar span{flex:1}:host .active-item .active-bar i.icon-close{flex:none;margin-left:8px;cursor:pointer}:host .active-item .active-bar i.icon-close:hover{color:var(--devui-danger, #f66f6a)}.plugin-active>:host{display:block}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DraggableDirective, selector: "[dDraggable]", inputs: ["dragData", "dragHandle", "dragEffect", "dragScope", "dragHandleClass", "dragOverClass", "disabled", "enableDragFollow", "dragFollowOptions", "originPlaceholder", "dragIdentity", "dragItemParentName", "dragItemChildrenName"], outputs: ["dragStartEvent", "dragEvent", "dragEndEvent", "dropEndEvent"] }, { kind: "component", type: DividerComponent, selector: "rs-divider", inputs: ["direction", "targetElement"], outputs: ["dividerClick"] }] });
|
|
146
144
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PluginActiveComponent, decorators: [{
|
|
147
145
|
type: Component,
|
|
148
|
-
args: [{ selector: 'rs-plugin-active', template: "<div class=\"active-
|
|
146
|
+
args: [{ selector: 'rs-plugin-active', template: "<div class=\"active-item\"\r\n dDraggable\r\n [disabled]=\"!showClose || showDivider\"\r\n [dragData]=\"dragData\"\r\n dragScope=\"plugin-item\"\r\n>\r\n <div class=\"active-bar\">\r\n <i *ngIf=\"showClose && !showDivider\" class=\"icon-drag\"></i>\r\n <span>{{name}}</span>\r\n <i *ngIf=\"showClose\" class=\"icon-close\" (click)=\"onItemCloseIconClick($event)\"></i>\r\n </div>\r\n <rs-divider *ngIf=\"showDivider\" [targetElement]=\"targetElement\" direction=\"row\"\r\n (dividerClick)=\"splitItem('column')\"></rs-divider>\r\n <rs-divider *ngIf=\"showDivider\" [targetElement]=\"targetElement\" direction=\"column\"\r\n (dividerClick)=\"splitItem('row')\"></rs-divider>\r\n</div>\r\n", styles: [":host{display:none;position:absolute;border:1px solid var(--devui-brand, #5e7ce0);pointer-events:none}:host .active-item{width:100%;height:100%}:host .active-item .active-bar{padding:2px 4px;color:#fff;background-color:var(--devui-brand, #5e7ce0);position:absolute;top:-23px;right:-1px;display:flex;flex-flow:row nowrap;align-items:center;pointer-events:all;white-space:nowrap}:host .active-item .active-bar i.icon-drag{flex:none;margin-right:8px;cursor:move}:host .active-item .active-bar span{flex:1}:host .active-item .active-bar i.icon-close{flex:none;margin-left:8px;cursor:pointer}:host .active-item .active-bar i.icon-close:hover{color:var(--devui-danger, #f66f6a)}.plugin-active>:host{display:block}\n"] }]
|
|
149
147
|
}], propDecorators: { _style: [{
|
|
150
148
|
type: HostBinding,
|
|
151
149
|
args: ['style']
|
|
@@ -175,12 +173,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
175
173
|
args: ['style']
|
|
176
174
|
}] } });
|
|
177
175
|
|
|
176
|
+
class PluginNotFoundComponent {
|
|
177
|
+
}
|
|
178
|
+
PluginNotFoundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PluginNotFoundComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
179
|
+
PluginNotFoundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: PluginNotFoundComponent, selector: "rs-plugin-not-found", ngImport: i0, template: "<div>\n <span>\u7EC4\u4EF6\u52A0\u8F7D\u5931\u8D25</span>\n</div>\n", styles: [":host{flex:1;margin:16px;border:1px solid var(--devui-dividing-line, #f2f2f3);display:flex;flex-flow:row nowrap;justify-content:center;pointer-events:all}:host div{flex:1;padding:16px;display:flex;flex-flow:row nowrap;justify-content:center;align-items:center}:host div span{color:var(--devui-danger, #f66f6a);text-align:center;-webkit-user-select:none;user-select:none}:host div.active{background-color:var(--devui-waiting, #beccfa)}:host.plugin-hover>div{pointer-events:none}\n"] });
|
|
180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PluginNotFoundComponent, decorators: [{
|
|
181
|
+
type: Component,
|
|
182
|
+
args: [{ selector: 'rs-plugin-not-found', template: "<div>\n <span>\u7EC4\u4EF6\u52A0\u8F7D\u5931\u8D25</span>\n</div>\n", styles: [":host{flex:1;margin:16px;border:1px solid var(--devui-dividing-line, #f2f2f3);display:flex;flex-flow:row nowrap;justify-content:center;pointer-events:all}:host div{flex:1;padding:16px;display:flex;flex-flow:row nowrap;justify-content:center;align-items:center}:host div span{color:var(--devui-danger, #f66f6a);text-align:center;-webkit-user-select:none;user-select:none}:host div.active{background-color:var(--devui-waiting, #beccfa)}:host.plugin-hover>div{pointer-events:none}\n"] }]
|
|
183
|
+
}] });
|
|
184
|
+
|
|
178
185
|
class PluginManager {
|
|
179
186
|
static createComponent(boxItem, index, style, config) {
|
|
180
|
-
|
|
187
|
+
let plugin = PluginFactory.get(config.name);
|
|
181
188
|
if (!plugin) {
|
|
182
189
|
console.error('undefined plugin: ' + config.name);
|
|
183
|
-
|
|
190
|
+
plugin = {
|
|
191
|
+
component: PluginNotFoundComponent,
|
|
192
|
+
name: config.name,
|
|
193
|
+
caption: config.name
|
|
194
|
+
};
|
|
184
195
|
}
|
|
185
196
|
const viewContainerRef = boxItem.itemHosts.get(index)?.viewContainerRef;
|
|
186
197
|
viewContainerRef.clear();
|
|
@@ -189,6 +200,7 @@ class PluginManager {
|
|
|
189
200
|
Object.assign(instance, config.pluginConfig);
|
|
190
201
|
if (plugin.type === 'form') {
|
|
191
202
|
instance.formGroup = boxItem.boxContainer.formGroup;
|
|
203
|
+
instance.model = boxItem.boxContainer.model;
|
|
192
204
|
}
|
|
193
205
|
instance.tabViewContainerRef = boxItem.boxContainer.tabViewContainerRef;
|
|
194
206
|
if (boxItem.boxContainer.editMode) {
|
|
@@ -232,6 +244,12 @@ class PluginManager {
|
|
|
232
244
|
const activeComponentRef = viewContainerRef.createComponent(PluginActiveComponent);
|
|
233
245
|
activeComponentRef.instance.name = config.caption;
|
|
234
246
|
activeComponentRef.instance.showClose = showClose;
|
|
247
|
+
activeComponentRef.instance.dragData = {
|
|
248
|
+
type: 'plugin-item',
|
|
249
|
+
boxItem,
|
|
250
|
+
index,
|
|
251
|
+
config: config.config
|
|
252
|
+
};
|
|
235
253
|
activeComponentRef.instance.targetElement = componentRef.location.nativeElement;
|
|
236
254
|
const activeElement = activeComponentRef.location.nativeElement;
|
|
237
255
|
componentRef.location.nativeElement.appendChild(activeElement);
|
|
@@ -332,7 +350,7 @@ class StyleComponent {
|
|
|
332
350
|
}
|
|
333
351
|
}
|
|
334
352
|
StyleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: StyleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
335
|
-
StyleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: StyleComponent, selector: "rs-style", ngImport: i0, template: "<div class=\"config-item\">\n <div class=\"item-title\">\u5BBD\u5EA6\u7C7B\u578B</div>\n <div class=\"item-setting\">\n <div class=\"card-style-radio\">\n <div class=\"radio-value\" [ngClass]=\"!style.width || style.width === 'auto' ? 'active' : ''\"\n (click)=\"select('width','auto')\">\n <span>\u81EA\u9002\u5E94</span>\n </div>\n <div class=\"radio-value\" [ngClass]=\"style.width && style.width !== 'auto' ? 'active' : ''\"\n (click)=\"select('width',240)\">\n <span>\u56FA\u5B9A\u503C</span>\n </div>\n </div>\n </div>\n</div>\n<div class=\"config-item\">\n <div class=\"item-title\">\u56FA\u5B9A\u5BBD\u5EA6</div>\n <div class=\"item-setting\">\n <d-input-number [allowEmpty]=\"true\" [(ngModel)]=\"width\"\n (whileValueChanging)=\"typing('width', $event)\"></d-input-number>\n </div>\n</div>\n<div class=\"config-item\">\n <div class=\"item-title\">\u9AD8\u5EA6\u7C7B\u578B</div>\n <div class=\"item-setting\">\n <div class=\"card-style-radio\">\n <div class=\"radio-value\" [ngClass]=\"!style.height || style.height === 'auto' ? 'active' : ''\"\n (click)=\"select('height','auto')\">\n <span>\u81EA\u9002\u5E94</span>\n </div>\n <div class=\"radio-value\" [ngClass]=\"style.height && style.height !== 'auto' ? 'active' : ''\"\n (click)=\"select('height',800)\">\n <span>\u56FA\u5B9A\u503C</span>\n </div>\n </div>\n </div>\n</div>\n<div class=\"config-item\">\n <div class=\"item-title\">\u56FA\u5B9A\u9AD8\u5EA6</div>\n <div class=\"item-setting\">\n <d-input-number [allowEmpty]=\"true\" [(ngModel)]=\"height\"\n (whileValueChanging)=\"typing('height', $event)\"></d-input-number>\n </div>\n</div>\n", styles: [":host .config-item{display:flex;flex-flow:row nowrap;align-items:center;margin-bottom:8px}:host .config-item .item-title{flex:0 0 80px}:host .config-item .item-setting{flex:1;display:flex;flex-flow:row nowrap}:host .config-item .item-setting .card-style-radio{flex:1;display:flex;flex-flow:row nowrap;justify-content:stretch}:host .config-item .item-setting .card-style-radio .radio-value{flex:1;border:1px solid var(--devui-dividing-line, #f2f2f3);text-align:center;padding:4px;margin-left:-1px;cursor:pointer}:host .config-item .item-setting .card-style-radio .radio-value span{-webkit-user-select:none;user-select:none}:host .config-item .item-setting .card-style-radio .radio-value.active{color:var(--devui-brand, #5e7ce0);border:1px solid var(--devui-brand, #5e7ce0);z-index:1}:host .config-item .item-setting d-input-number{flex:1}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i2.InputNumberComponent, selector: "d-input-number", inputs: ["step", "disabled", "size", "decimalLimit", "autoFocus", "allowEmpty", "placeholder", "maxLength", "reg", "styleType", "min", "max"], outputs: ["afterValueChanged", "whileValueChanging"] }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
353
|
+
StyleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: StyleComponent, selector: "rs-style", ngImport: i0, template: "<div class=\"config-item\">\n <div class=\"item-title\">\u5BBD\u5EA6\u7C7B\u578B</div>\n <div class=\"item-setting\">\n <div class=\"card-style-radio\">\n <div class=\"radio-value\" [ngClass]=\"!style.width || style.width === 'auto' ? 'active' : ''\"\n (click)=\"select('width','auto')\">\n <span>\u81EA\u9002\u5E94</span>\n </div>\n <div class=\"radio-value\" [ngClass]=\"style.width && style.width !== 'auto' ? 'active' : ''\"\n (click)=\"select('width',240)\">\n <span>\u56FA\u5B9A\u503C</span>\n </div>\n </div>\n </div>\n</div>\n<div class=\"config-item\">\n <div class=\"item-title\">\u56FA\u5B9A\u5BBD\u5EA6</div>\n <div class=\"item-setting\">\n <d-input-number [allowEmpty]=\"true\" [(ngModel)]=\"width\"\n (whileValueChanging)=\"typing('width', $event)\"></d-input-number>\n </div>\n</div>\n<div class=\"config-item\">\n <div class=\"item-title\">\u9AD8\u5EA6\u7C7B\u578B</div>\n <div class=\"item-setting\">\n <div class=\"card-style-radio\">\n <div class=\"radio-value\" [ngClass]=\"!style.height || style.height === 'auto' ? 'active' : ''\"\n (click)=\"select('height','auto')\">\n <span>\u81EA\u9002\u5E94</span>\n </div>\n <div class=\"radio-value\" [ngClass]=\"style.height && style.height !== 'auto' ? 'active' : ''\"\n (click)=\"select('height',800)\">\n <span>\u56FA\u5B9A\u503C</span>\n </div>\n </div>\n </div>\n</div>\n<div class=\"config-item\">\n <div class=\"item-title\">\u56FA\u5B9A\u9AD8\u5EA6</div>\n <div class=\"item-setting\">\n <d-input-number [allowEmpty]=\"true\" [(ngModel)]=\"height\"\n (whileValueChanging)=\"typing('height', $event)\"></d-input-number>\n </div>\n</div>\n", styles: [":host .config-item{display:flex;flex-flow:row nowrap;align-items:center;margin-bottom:8px}:host .config-item .item-title{flex:0 0 80px}:host .config-item .item-setting{flex:1;display:flex;flex-flow:row nowrap}:host .config-item .item-setting .card-style-radio{flex:1;display:flex;flex-flow:row nowrap;justify-content:stretch}:host .config-item .item-setting .card-style-radio .radio-value{flex:1;border:1px solid var(--devui-dividing-line, #f2f2f3);text-align:center;padding:4px;margin-left:-1px;cursor:pointer}:host .config-item .item-setting .card-style-radio .radio-value span{-webkit-user-select:none;user-select:none}:host .config-item .item-setting .card-style-radio .radio-value.active{color:var(--devui-brand, #5e7ce0);border:1px solid var(--devui-brand, #5e7ce0);z-index:1}:host .config-item .item-setting d-input-number{flex:1}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i2$1.InputNumberComponent, selector: "d-input-number", inputs: ["step", "disabled", "size", "decimalLimit", "autoFocus", "allowEmpty", "placeholder", "maxLength", "reg", "styleType", "min", "max"], outputs: ["afterValueChanged", "whileValueChanging"] }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
336
354
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: StyleComponent, decorators: [{
|
|
337
355
|
type: Component,
|
|
338
356
|
args: [{ selector: 'rs-style', template: "<div class=\"config-item\">\n <div class=\"item-title\">\u5BBD\u5EA6\u7C7B\u578B</div>\n <div class=\"item-setting\">\n <div class=\"card-style-radio\">\n <div class=\"radio-value\" [ngClass]=\"!style.width || style.width === 'auto' ? 'active' : ''\"\n (click)=\"select('width','auto')\">\n <span>\u81EA\u9002\u5E94</span>\n </div>\n <div class=\"radio-value\" [ngClass]=\"style.width && style.width !== 'auto' ? 'active' : ''\"\n (click)=\"select('width',240)\">\n <span>\u56FA\u5B9A\u503C</span>\n </div>\n </div>\n </div>\n</div>\n<div class=\"config-item\">\n <div class=\"item-title\">\u56FA\u5B9A\u5BBD\u5EA6</div>\n <div class=\"item-setting\">\n <d-input-number [allowEmpty]=\"true\" [(ngModel)]=\"width\"\n (whileValueChanging)=\"typing('width', $event)\"></d-input-number>\n </div>\n</div>\n<div class=\"config-item\">\n <div class=\"item-title\">\u9AD8\u5EA6\u7C7B\u578B</div>\n <div class=\"item-setting\">\n <div class=\"card-style-radio\">\n <div class=\"radio-value\" [ngClass]=\"!style.height || style.height === 'auto' ? 'active' : ''\"\n (click)=\"select('height','auto')\">\n <span>\u81EA\u9002\u5E94</span>\n </div>\n <div class=\"radio-value\" [ngClass]=\"style.height && style.height !== 'auto' ? 'active' : ''\"\n (click)=\"select('height',800)\">\n <span>\u56FA\u5B9A\u503C</span>\n </div>\n </div>\n </div>\n</div>\n<div class=\"config-item\">\n <div class=\"item-title\">\u56FA\u5B9A\u9AD8\u5EA6</div>\n <div class=\"item-setting\">\n <d-input-number [allowEmpty]=\"true\" [(ngModel)]=\"height\"\n (whileValueChanging)=\"typing('height', $event)\"></d-input-number>\n </div>\n</div>\n", styles: [":host .config-item{display:flex;flex-flow:row nowrap;align-items:center;margin-bottom:8px}:host .config-item .item-title{flex:0 0 80px}:host .config-item .item-setting{flex:1;display:flex;flex-flow:row nowrap}:host .config-item .item-setting .card-style-radio{flex:1;display:flex;flex-flow:row nowrap;justify-content:stretch}:host .config-item .item-setting .card-style-radio .radio-value{flex:1;border:1px solid var(--devui-dividing-line, #f2f2f3);text-align:center;padding:4px;margin-left:-1px;cursor:pointer}:host .config-item .item-setting .card-style-radio .radio-value span{-webkit-user-select:none;user-select:none}:host .config-item .item-setting .card-style-radio .radio-value.active{color:var(--devui-brand, #5e7ce0);border:1px solid var(--devui-brand, #5e7ce0);z-index:1}:host .config-item .item-setting d-input-number{flex:1}\n"] }]
|
|
@@ -391,14 +409,23 @@ class ItemBlankComponent {
|
|
|
391
409
|
this.dropItem = new EventEmitter();
|
|
392
410
|
}
|
|
393
411
|
dropEvent($event) {
|
|
394
|
-
|
|
412
|
+
if ($event.dragData.type === 'plugin-item') {
|
|
413
|
+
const boxItem = $event.dragData.boxItem;
|
|
414
|
+
const index = $event.dragData.index;
|
|
415
|
+
boxItem.config.list.splice(index, 1, { type: 'blank', style: boxItem.config.list[index].style });
|
|
416
|
+
boxItem.load();
|
|
417
|
+
this.dropItem.emit($event.dragData.config);
|
|
418
|
+
}
|
|
419
|
+
else {
|
|
420
|
+
this.dropItem.emit($event.dragData);
|
|
421
|
+
}
|
|
395
422
|
}
|
|
396
423
|
}
|
|
397
424
|
ItemBlankComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ItemBlankComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
398
|
-
ItemBlankComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: ItemBlankComponent, selector: "rs-item-blank", outputs: { dropItem: "dropItem" }, ngImport: i0, template: "<div
|
|
425
|
+
ItemBlankComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: ItemBlankComponent, selector: "rs-item-blank", outputs: { dropItem: "dropItem" }, ngImport: i0, template: "<div dDroppable\n [dropScope]=\"['plugin-item', 'page', 'form']\"\n dragOverClass=\"active\"\n (dropEvent)=\"dropEvent($event)\"\n>\n <span>\u62D6\u62FD\u7EC4\u4EF6\u5230\u6B64\u5904</span>\n</div>\n", styles: [":host{flex:1;margin:16px;border:1px solid var(--devui-dividing-line, #f2f2f3);background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8AQMAAAAAMksxAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAZQTFRF8fHxAAAAMCd7XAAAAAJ0Uk5T/wDltzBKAAABJUlEQVR4nFVSy23EIBCdAiKxBaxCC1tBaGk7YG/OjZYSOQptLKKB8Y0D8ssbjBPl9gQz7wfigQbgQxygEXjIAjwDcJEV+PbYb1KAlNDusgE+Q1Va3EPFptJDjwVVZfcNiqwCV9BiIlhW9DdPkEn5GggKRV4igVL2AYJGpc8TFAMa5lXhzHuc69dwEO6DkBI9OhNVii60ERu3VxrjRUVRet7DsMoUbpgny+LRb5b0K2C/CAWejCxCSYVl9wcQSaMEzuRRArcqebzxcMCnUcKQsBKiiVoJoR1+4DfWSodILCGa5zXTvKWo5L5ars0C/iuh003F7GecbG62YVujunzypDqZTcsK76HF2UYP41HM4WoO7eEWNLUUyaHf/3L9JvXnBwjzS/wAoXR0PDbjCSUAAAAASUVORK5CYII=) repeat var(--devui-unavailable, #f5f5f5);display:flex;flex-flow:row nowrap;justify-content:center;pointer-events:all}:host div{flex:1;padding:16px;display:flex;flex-flow:row nowrap;justify-content:center;align-items:center}:host div span{text-align:center;-webkit-user-select:none;user-select:none}:host div.active{background-color:var(--devui-waiting, #beccfa)}:host.plugin-hover>div{pointer-events:none}\n"], dependencies: [{ kind: "directive", type: i2.DroppableDirective, selector: "[dDroppable]", inputs: ["dragOverClass", "dropScope", "placeholderTag", "placeholderStyle", "placeholderText", "allowDropOnItem", "dragOverItemClass", "nestingTargetRect", "switchWhileCrossEdge", "defaultDropPosition", "dropSortCountSelector", "dropSortVirtualScrollOption"], outputs: ["dragEnterEvent", "dragOverEvent", "dragLeaveEvent", "dropEvent"] }] });
|
|
399
426
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ItemBlankComponent, decorators: [{
|
|
400
427
|
type: Component,
|
|
401
|
-
args: [{ selector: 'rs-item-blank', template: "<div
|
|
428
|
+
args: [{ selector: 'rs-item-blank', template: "<div dDroppable\n [dropScope]=\"['plugin-item', 'page', 'form']\"\n dragOverClass=\"active\"\n (dropEvent)=\"dropEvent($event)\"\n>\n <span>\u62D6\u62FD\u7EC4\u4EF6\u5230\u6B64\u5904</span>\n</div>\n", styles: [":host{flex:1;margin:16px;border:1px solid var(--devui-dividing-line, #f2f2f3);background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8AQMAAAAAMksxAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAZQTFRF8fHxAAAAMCd7XAAAAAJ0Uk5T/wDltzBKAAABJUlEQVR4nFVSy23EIBCdAiKxBaxCC1tBaGk7YG/OjZYSOQptLKKB8Y0D8ssbjBPl9gQz7wfigQbgQxygEXjIAjwDcJEV+PbYb1KAlNDusgE+Q1Va3EPFptJDjwVVZfcNiqwCV9BiIlhW9DdPkEn5GggKRV4igVL2AYJGpc8TFAMa5lXhzHuc69dwEO6DkBI9OhNVii60ERu3VxrjRUVRet7DsMoUbpgny+LRb5b0K2C/CAWejCxCSYVl9wcQSaMEzuRRArcqebzxcMCnUcKQsBKiiVoJoR1+4DfWSodILCGa5zXTvKWo5L5ars0C/iuh003F7GecbG62YVujunzypDqZTcsK76HF2UYP41HM4WoO7eEWNLUUyaHf/3L9JvXnBwjzS/wAoXR0PDbjCSUAAAAASUVORK5CYII=) repeat var(--devui-unavailable, #f5f5f5);display:flex;flex-flow:row nowrap;justify-content:center;pointer-events:all}:host div{flex:1;padding:16px;display:flex;flex-flow:row nowrap;justify-content:center;align-items:center}:host div span{text-align:center;-webkit-user-select:none;user-select:none}:host div.active{background-color:var(--devui-waiting, #beccfa)}:host.plugin-hover>div{pointer-events:none}\n"] }]
|
|
402
429
|
}], propDecorators: { dropItem: [{
|
|
403
430
|
type: Output
|
|
404
431
|
}] } });
|
|
@@ -423,7 +450,7 @@ class BoxItemComponent {
|
|
|
423
450
|
ngOnInit() {
|
|
424
451
|
this.load();
|
|
425
452
|
}
|
|
426
|
-
load() {
|
|
453
|
+
load(activeIndex) {
|
|
427
454
|
setTimeout(() => {
|
|
428
455
|
for (let i = 0; i < this.itemHosts.length; i++) {
|
|
429
456
|
const itemHost = this.itemHosts.get(i);
|
|
@@ -431,7 +458,10 @@ class BoxItemComponent {
|
|
|
431
458
|
const item = this.config.list[i];
|
|
432
459
|
switch (item.type) {
|
|
433
460
|
case 'plugin':
|
|
434
|
-
PluginManager.createComponent(this, i, item.style, item.config);
|
|
461
|
+
const componentRef = PluginManager.createComponent(this, i, item.style, item.config);
|
|
462
|
+
if (activeIndex === i) {
|
|
463
|
+
componentRef.location.nativeElement.click();
|
|
464
|
+
}
|
|
435
465
|
break;
|
|
436
466
|
case 'item':
|
|
437
467
|
const boxItemComponentRef = itemHost.viewContainerRef.createComponent(BoxItemComponent);
|
|
@@ -479,7 +509,7 @@ class BoxItemComponent {
|
|
|
479
509
|
pluginConfig: plugin.pluginConfig || {}
|
|
480
510
|
}
|
|
481
511
|
};
|
|
482
|
-
this.load();
|
|
512
|
+
this.load(index);
|
|
483
513
|
});
|
|
484
514
|
containerBlankComponentRef.instance.onRemove = () => {
|
|
485
515
|
this.config.list.splice(index, 1);
|
|
@@ -544,12 +574,25 @@ class BoxItemComponent {
|
|
|
544
574
|
pointerEvents: this.boxContainer.editMode ? 'none' : 'all'
|
|
545
575
|
};
|
|
546
576
|
}
|
|
577
|
+
dropEvent($event, i) {
|
|
578
|
+
if ($event.dragData.type === 'plugin-item') {
|
|
579
|
+
const boxItem = $event.dragData.boxItem;
|
|
580
|
+
const index = $event.dragData.index;
|
|
581
|
+
boxItem.config.list[index].config = this.config.list[i].config;
|
|
582
|
+
boxItem.load();
|
|
583
|
+
this.config.list[i].config = $event.dragData.config;
|
|
584
|
+
}
|
|
585
|
+
else {
|
|
586
|
+
this.config.list[i].config = $event.dragData;
|
|
587
|
+
}
|
|
588
|
+
this.load(i);
|
|
589
|
+
}
|
|
547
590
|
}
|
|
548
591
|
BoxItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: BoxItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
549
|
-
BoxItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: BoxItemComponent, selector: "rs-box-item", outputs: { leaveOneItem: "leaveOneItem" }, host: { properties: { "style.flex-direction": "this._direction", "style": "this._style" } }, viewQueries: [{ propertyName: "itemHosts", predicate: BoxItemHostDirective, descendants: true }], ngImport: i0, template: "<ng-container *ngFor=\"let item of config.list; index as index\">\n <div [ngStyle]=\"calcStyle(item)\">\n <ng-template rsBoxItemHost [hostId]=\"index\"></ng-template>\n </div>\n</ng-container>\n", styles: [":host{flex:1;display:flex;flex-flow:row nowrap;pointer-events:all}:host div{display:flex;flex-flow:row nowrap}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: BoxItemHostDirective, selector: "[rsBoxItemHost]", inputs: ["hostId"] }] });
|
|
592
|
+
BoxItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: BoxItemComponent, selector: "rs-box-item", outputs: { leaveOneItem: "leaveOneItem" }, host: { properties: { "style.flex-direction": "this._direction", "style": "this._style" } }, viewQueries: [{ propertyName: "itemHosts", predicate: BoxItemHostDirective, descendants: true }], ngImport: i0, template: "<ng-container *ngFor=\"let item of config.list; index as index\">\n <div [ngStyle]=\"calcStyle(item)\"\n dDroppable\n [dropScope]=\"item.type === 'plugin' && boxContainer.editMode ? ['plugin-item', 'page', 'form'] : ''\"\n dragOverClass=\"active\"\n (dropEvent)=\"dropEvent($event, index)\"\n >\n <ng-template rsBoxItemHost [hostId]=\"index\"></ng-template>\n </div>\n</ng-container>\n", styles: [":host{flex:1;display:flex;flex-flow:row nowrap;pointer-events:all}:host div{display:flex;flex-flow:row nowrap}:host div.active{background-color:var(--devui-waiting, #beccfa)}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.DroppableDirective, selector: "[dDroppable]", inputs: ["dragOverClass", "dropScope", "placeholderTag", "placeholderStyle", "placeholderText", "allowDropOnItem", "dragOverItemClass", "nestingTargetRect", "switchWhileCrossEdge", "defaultDropPosition", "dropSortCountSelector", "dropSortVirtualScrollOption"], outputs: ["dragEnterEvent", "dragOverEvent", "dragLeaveEvent", "dropEvent"] }, { kind: "directive", type: BoxItemHostDirective, selector: "[rsBoxItemHost]", inputs: ["hostId"] }] });
|
|
550
593
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: BoxItemComponent, decorators: [{
|
|
551
594
|
type: Component,
|
|
552
|
-
args: [{ selector: 'rs-box-item', template: "<ng-container *ngFor=\"let item of config.list; index as index\">\n <div [ngStyle]=\"calcStyle(item)\">\n <ng-template rsBoxItemHost [hostId]=\"index\"></ng-template>\n </div>\n</ng-container>\n", styles: [":host{flex:1;display:flex;flex-flow:row nowrap;pointer-events:all}:host div{display:flex;flex-flow:row nowrap}\n"] }]
|
|
595
|
+
args: [{ selector: 'rs-box-item', template: "<ng-container *ngFor=\"let item of config.list; index as index\">\n <div [ngStyle]=\"calcStyle(item)\"\n dDroppable\n [dropScope]=\"item.type === 'plugin' && boxContainer.editMode ? ['plugin-item', 'page', 'form'] : ''\"\n dragOverClass=\"active\"\n (dropEvent)=\"dropEvent($event, index)\"\n >\n <ng-template rsBoxItemHost [hostId]=\"index\"></ng-template>\n </div>\n</ng-container>\n", styles: [":host{flex:1;display:flex;flex-flow:row nowrap;pointer-events:all}:host div{display:flex;flex-flow:row nowrap}:host div.active{background-color:var(--devui-waiting, #beccfa)}\n"] }]
|
|
553
596
|
}], propDecorators: { _direction: [{
|
|
554
597
|
type: HostBinding,
|
|
555
598
|
args: ['style.flex-direction']
|
|
@@ -588,7 +631,7 @@ class BoxContainerComponent {
|
|
|
588
631
|
}
|
|
589
632
|
}
|
|
590
633
|
BoxContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: BoxContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
591
|
-
BoxContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: BoxContainerComponent, selector: "rs-box-container", inputs: { editMode: "editMode", config: "config", formGroup: "formGroup", tabViewContainerRef: "tabViewContainerRef" }, viewQueries: [{ propertyName: "boxContainerContent", first: true, predicate: ["boxContainerContent"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<ng-container #boxContainerContent></ng-container>\n", styles: [":host{flex:1;position:relative;display:flex;flex-flow:row nowrap}\n"] });
|
|
634
|
+
BoxContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: BoxContainerComponent, selector: "rs-box-container", inputs: { editMode: "editMode", config: "config", formGroup: "formGroup", model: "model", tabViewContainerRef: "tabViewContainerRef" }, viewQueries: [{ propertyName: "boxContainerContent", first: true, predicate: ["boxContainerContent"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<ng-container #boxContainerContent></ng-container>\n", styles: [":host{flex:1;position:relative;display:flex;flex-flow:row nowrap}\n"] });
|
|
592
635
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: BoxContainerComponent, decorators: [{
|
|
593
636
|
type: Component,
|
|
594
637
|
args: [{ selector: 'rs-box-container', template: "<ng-container #boxContainerContent></ng-container>\n", styles: [":host{flex:1;position:relative;display:flex;flex-flow:row nowrap}\n"] }]
|
|
@@ -598,6 +641,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
598
641
|
type: Input
|
|
599
642
|
}], formGroup: [{
|
|
600
643
|
type: Input
|
|
644
|
+
}], model: [{
|
|
645
|
+
type: Input
|
|
601
646
|
}], tabViewContainerRef: [{
|
|
602
647
|
type: Input
|
|
603
648
|
}], boxContainerContent: [{
|
|
@@ -619,7 +664,8 @@ BoxContainerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", vers
|
|
|
619
664
|
ItemStyleComponent,
|
|
620
665
|
StyleBlankComponent,
|
|
621
666
|
ItemBlankComponent,
|
|
622
|
-
StyleComponent
|
|
667
|
+
StyleComponent,
|
|
668
|
+
PluginNotFoundComponent], imports: [CommonModule,
|
|
623
669
|
DevUIModule,
|
|
624
670
|
FormsModule], exports: [BoxContainerComponent,
|
|
625
671
|
ItemConfigComponent,
|
|
@@ -642,7 +688,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
642
688
|
ItemStyleComponent,
|
|
643
689
|
StyleBlankComponent,
|
|
644
690
|
ItemBlankComponent,
|
|
645
|
-
StyleComponent
|
|
691
|
+
StyleComponent,
|
|
692
|
+
PluginNotFoundComponent
|
|
646
693
|
],
|
|
647
694
|
imports: [
|
|
648
695
|
CommonModule,
|
|
@@ -692,11 +739,11 @@ class DataGridService {
|
|
|
692
739
|
}));
|
|
693
740
|
}
|
|
694
741
|
}
|
|
695
|
-
DataGridService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DataGridService, deps: [{ token: i1$
|
|
742
|
+
DataGridService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DataGridService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
696
743
|
DataGridService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DataGridService });
|
|
697
744
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DataGridService, decorators: [{
|
|
698
745
|
type: Injectable
|
|
699
|
-
}], ctorParameters: function () { return [{ type: i1$
|
|
746
|
+
}], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
|
|
700
747
|
|
|
701
748
|
class MasterDetailTemplateDirective {
|
|
702
749
|
constructor(templateRef) {
|
|
@@ -907,7 +954,7 @@ class DynamicParamsComponent {
|
|
|
907
954
|
}
|
|
908
955
|
}
|
|
909
956
|
DynamicParamsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DynamicParamsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
910
|
-
DynamicParamsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: DynamicParamsComponent, selector: "rs-dynamic-params", inputs: { params: "params" }, ngImport: i0, template: "<form dForm labelSize=\"sm\">\n <d-form-item>\n <d-form-label>\u52A8\u6001\u53C2\u6570</d-form-label>\n <d-form-control>\n <d-button icon=\"icon-add\" [bsSize]=\"'sm'\" (btnClick)=\"add()\"></d-button>\n </d-form-control>\n </d-form-item>\n <d-form-item>\n <d-form-label></d-form-label>\n <d-form-control>\n <div *ngFor=\"let param of params; let index = index\">\n <input dTextInput [name]=\"'name' + index\" placeholder=\"\u53C2\u6570\u540D\" [(ngModel)]=\"param.name\"/>\n <input dTextInput [name]=\"'value' + index\" placeholder=\"\u53C2\u6570\u503C\" [(ngModel)]=\"param.value\"/>\n <d-button icon=\"icon-close\" [bsStyle]=\"'text'\" (btnClick)=\"delete(index)\"></d-button>\n </div>\n </d-form-control>\n </d-form-item>\n</form>\n", styles: [":host form d-form-item{margin-bottom:8px}:host form d-form-item d-form-control{margin:0}:host form d-form-item d-form-control div{position:relative;display:flex;flex-flow:row nowrap}:host form d-form-item d-form-control div d-button{display:none;position:absolute;left:-30px}:host form d-form-item:hover d-form-control div d-button{display:inline-block!important}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i2$
|
|
957
|
+
DynamicParamsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: DynamicParamsComponent, selector: "rs-dynamic-params", inputs: { params: "params" }, ngImport: i0, template: "<form dForm labelSize=\"sm\">\n <d-form-item>\n <d-form-label>\u52A8\u6001\u53C2\u6570</d-form-label>\n <d-form-control>\n <d-button icon=\"icon-add\" [bsSize]=\"'sm'\" (btnClick)=\"add()\"></d-button>\n </d-form-control>\n </d-form-item>\n <d-form-item>\n <d-form-label></d-form-label>\n <d-form-control>\n <div *ngFor=\"let param of params; let index = index\">\n <input dTextInput [name]=\"'name' + index\" placeholder=\"\u53C2\u6570\u540D\" [(ngModel)]=\"param.name\"/>\n <input dTextInput [name]=\"'value' + index\" placeholder=\"\u53C2\u6570\u503C\" [(ngModel)]=\"param.value\"/>\n <d-button icon=\"icon-close\" [bsStyle]=\"'text'\" (btnClick)=\"delete(index)\"></d-button>\n </div>\n </d-form-control>\n </d-form-item>\n</form>\n", styles: [":host form d-form-item{margin-bottom:8px}:host form d-form-item d-form-control{margin:0}:host form d-form-item d-form-control div{position:relative;display:flex;flex-flow:row nowrap}:host form d-form-item d-form-control div d-button{display:none;position:absolute;left:-30px}:host form d-form-item:hover d-form-control div d-button{display:inline-block!important}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i2$2.ButtonComponent, selector: "d-button", inputs: ["id", "type", "bsStyle", "shape", "bsSize", "bsPosition", "bordered", "icon", "disabled", "showLoading", "width", "autofocus", "loadingTemplateRef"], outputs: ["btnClick"] }, { kind: "component", type: i3$1.FormItemComponent, selector: "d-form-item", inputs: ["dFeedbackType", "dHasFeedback"] }, { kind: "component", type: i3$1.FormLabelComponent, selector: "d-form-label", inputs: ["required", "hasHelp", "helpTips"] }, { kind: "component", type: i3$1.FormControlComponent, selector: "d-form-control", inputs: ["extraInfo", "feedbackStatus", "suffixTemplate"] }, { kind: "directive", type: i3$1.FormDirective, selector: "[dForm]", inputs: ["layout", "labelSize", "labelAlign", "dFeedbackType", "dHasFeedback"], outputs: ["dSubmit"], exportAs: ["dForm"] }, { kind: "directive", type: i4$1.TextDirective, selector: "[dTextInput]", inputs: ["error", "size", "styleType"], exportAs: ["dTextInput"] }, { kind: "directive", type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5.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: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i5.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
|
|
911
958
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DynamicParamsComponent, decorators: [{
|
|
912
959
|
type: Component,
|
|
913
960
|
args: [{ selector: 'rs-dynamic-params', template: "<form dForm labelSize=\"sm\">\n <d-form-item>\n <d-form-label>\u52A8\u6001\u53C2\u6570</d-form-label>\n <d-form-control>\n <d-button icon=\"icon-add\" [bsSize]=\"'sm'\" (btnClick)=\"add()\"></d-button>\n </d-form-control>\n </d-form-item>\n <d-form-item>\n <d-form-label></d-form-label>\n <d-form-control>\n <div *ngFor=\"let param of params; let index = index\">\n <input dTextInput [name]=\"'name' + index\" placeholder=\"\u53C2\u6570\u540D\" [(ngModel)]=\"param.name\"/>\n <input dTextInput [name]=\"'value' + index\" placeholder=\"\u53C2\u6570\u503C\" [(ngModel)]=\"param.value\"/>\n <d-button icon=\"icon-close\" [bsStyle]=\"'text'\" (btnClick)=\"delete(index)\"></d-button>\n </div>\n </d-form-control>\n </d-form-item>\n</form>\n", styles: [":host form d-form-item{margin-bottom:8px}:host form d-form-item d-form-control{margin:0}:host form d-form-item d-form-control div{position:relative;display:flex;flex-flow:row nowrap}:host form d-form-item d-form-control div d-button{display:none;position:absolute;left:-30px}:host form d-form-item:hover d-form-control div d-button{display:inline-block!important}\n"] }]
|
|
@@ -974,11 +1021,11 @@ class FormService {
|
|
|
974
1021
|
});
|
|
975
1022
|
}
|
|
976
1023
|
}
|
|
977
|
-
FormService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormService, deps: [{ token: i1$
|
|
1024
|
+
FormService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
978
1025
|
FormService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormService });
|
|
979
1026
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormService, decorators: [{
|
|
980
1027
|
type: Injectable
|
|
981
|
-
}], ctorParameters: function () { return [{ type: i1$
|
|
1028
|
+
}], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
|
|
982
1029
|
|
|
983
1030
|
class FormComponent {
|
|
984
1031
|
constructor(service) {
|
|
@@ -986,6 +1033,7 @@ class FormComponent {
|
|
|
986
1033
|
this.layoutDirection = FormLayout.Vertical;
|
|
987
1034
|
this.formGroup = new UntypedFormGroup({});
|
|
988
1035
|
this.submitCallback = new EventEmitter();
|
|
1036
|
+
this.loaded = false;
|
|
989
1037
|
this.loading = false;
|
|
990
1038
|
}
|
|
991
1039
|
ngOnInit() {
|
|
@@ -998,10 +1046,15 @@ class FormComponent {
|
|
|
998
1046
|
if (this.copyOid) {
|
|
999
1047
|
delete response.data.oid;
|
|
1000
1048
|
}
|
|
1001
|
-
this.
|
|
1049
|
+
this.model = response.data;
|
|
1050
|
+
this.loaded = true;
|
|
1002
1051
|
this.loading = false;
|
|
1003
1052
|
});
|
|
1004
1053
|
}
|
|
1054
|
+
else {
|
|
1055
|
+
this.model = {};
|
|
1056
|
+
this.loaded = true;
|
|
1057
|
+
}
|
|
1005
1058
|
});
|
|
1006
1059
|
}
|
|
1007
1060
|
submitForm($event) {
|
|
@@ -1011,7 +1064,7 @@ class FormComponent {
|
|
|
1011
1064
|
}
|
|
1012
1065
|
this.service.createOrUpdate(this.tenant, this.className, {
|
|
1013
1066
|
oid: this.oid,
|
|
1014
|
-
...this.
|
|
1067
|
+
...this.model
|
|
1015
1068
|
}).subscribe((response) => {
|
|
1016
1069
|
this.submitCallback.emit(response);
|
|
1017
1070
|
});
|
|
@@ -1021,10 +1074,10 @@ class FormComponent {
|
|
|
1021
1074
|
}
|
|
1022
1075
|
}
|
|
1023
1076
|
FormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormComponent, deps: [{ token: FormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1024
|
-
FormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: FormComponent, selector: "rs-form", inputs: { tenant: "tenant", className: "className", oid: "oid", copyOid: "copyOid", template: "template" }, outputs: { submitCallback: "submitCallback" }, providers: [FormService], viewQueries: [{ propertyName: "formSubmitter", first: true, predicate: ["formSubmitter"], descendants: true }], ngImport: i0, template: "<form dForm [formGroup]=\"formGroup\" [layout]=\"layoutDirection\" (dSubmit)=\"submitForm($event)\"\n dLoading [loading]=\"loading\">\n <ng-container *ngIf=\"
|
|
1077
|
+
FormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: FormComponent, selector: "rs-form", inputs: { tenant: "tenant", className: "className", oid: "oid", copyOid: "copyOid", template: "template" }, outputs: { submitCallback: "submitCallback" }, providers: [FormService], viewQueries: [{ propertyName: "formSubmitter", first: true, predicate: ["formSubmitter"], descendants: true }], ngImport: i0, template: "<form dForm [formGroup]=\"formGroup\" [layout]=\"layoutDirection\" (dSubmit)=\"submitForm($event)\"\n dLoading [loading]=\"loading\">\n <ng-container *ngIf=\"loaded\">\n <rs-box-container [config]=\"config\" [formGroup]=\"formGroup\" [model]=\"model\"></rs-box-container>\n </ng-container>\n <button #formSubmitter dFormSubmit=\"click\"></button>\n</form>\n", styles: ["form{display:flex;flex-flow:row nowrap}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.FormDirective, selector: "[dForm]", inputs: ["layout", "labelSize", "labelAlign", "dFeedbackType", "dHasFeedback"], outputs: ["dSubmit"], exportAs: ["dForm"] }, { kind: "directive", type: i3$1.DFormSubmitDirective, selector: "[dFormSubmit]", inputs: ["dFormSubmit", "dFormSubmitData"] }, { kind: "directive", type: i4$2.LoadingDirective, selector: "[dLoading]", inputs: ["backdrop", "message", "positionType", "showLoading", "view", "zIndex", "loading", "loadingStyle", "loadingTemplateRef"], exportAs: ["dLoading"] }, { kind: "directive", type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: BoxContainerComponent, selector: "rs-box-container", inputs: ["editMode", "config", "formGroup", "model", "tabViewContainerRef"] }] });
|
|
1025
1078
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormComponent, decorators: [{
|
|
1026
1079
|
type: Component,
|
|
1027
|
-
args: [{ selector: 'rs-form', providers: [FormService], template: "<form dForm [formGroup]=\"formGroup\" [layout]=\"layoutDirection\" (dSubmit)=\"submitForm($event)\"\n dLoading [loading]=\"loading\">\n <ng-container *ngIf=\"
|
|
1080
|
+
args: [{ selector: 'rs-form', providers: [FormService], template: "<form dForm [formGroup]=\"formGroup\" [layout]=\"layoutDirection\" (dSubmit)=\"submitForm($event)\"\n dLoading [loading]=\"loading\">\n <ng-container *ngIf=\"loaded\">\n <rs-box-container [config]=\"config\" [formGroup]=\"formGroup\" [model]=\"model\"></rs-box-container>\n </ng-container>\n <button #formSubmitter dFormSubmit=\"click\"></button>\n</form>\n", styles: ["form{display:flex;flex-flow:row nowrap}\n"] }]
|
|
1028
1081
|
}], ctorParameters: function () { return [{ type: FormService }]; }, propDecorators: { tenant: [{
|
|
1029
1082
|
type: Input
|
|
1030
1083
|
}], className: [{
|