ngx-rs-ant 0.10.7 → 0.10.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/esm2020/box-container/PluginManager.mjs +30 -1
- package/esm2020/box-container/box-item/box-item.component.mjs +4 -4
- package/esm2020/box-container/plugin-active/plugin-active.component.mjs +4 -4
- package/esm2020/data-grid/data-grid.component.mjs +5 -1
- package/esm2020/form/form.component.mjs +2 -5
- package/esm2020/form/form.service.mjs +4 -3
- package/fesm2015/ngx-rs-ant.mjs +43 -12
- package/fesm2015/ngx-rs-ant.mjs.map +1 -1
- package/fesm2020/ngx-rs-ant.mjs +43 -12
- package/fesm2020/ngx-rs-ant.mjs.map +1 -1
- package/form/form.service.d.ts +1 -1
- package/package.json +1 -1
package/fesm2020/ngx-rs-ant.mjs
CHANGED
|
@@ -138,14 +138,14 @@ class PluginActiveComponent {
|
|
|
138
138
|
this.itemRemove.emit();
|
|
139
139
|
}
|
|
140
140
|
splitItem(direction) {
|
|
141
|
-
//
|
|
141
|
+
// 上层实例化时重写
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
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-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
|
|
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-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 class=\"coast-icon-add-row\" title=\"\u6DFB\u52A0\u884C\" (click)=\"splitItem('column')\"></i>\r\n <i class=\"coast-icon-add-column\" title=\"\u6DFB\u52A0\u5217\" (click)=\"splitItem('row')\"></i>\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{flex:none;cursor:pointer}:host .active-item .active-bar i:not(:last-child){margin-right:8px}:host .active-item .active-bar i.icon-drag{cursor:move}:host .active-item .active-bar i.icon-close:hover{color:var(--devui-danger, #f66f6a)}:host .active-item .active-bar span{flex:1;margin-right:8px}.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
146
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PluginActiveComponent, decorators: [{
|
|
147
147
|
type: Component,
|
|
148
|
-
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
|
|
148
|
+
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 class=\"coast-icon-add-row\" title=\"\u6DFB\u52A0\u884C\" (click)=\"splitItem('column')\"></i>\r\n <i class=\"coast-icon-add-column\" title=\"\u6DFB\u52A0\u5217\" (click)=\"splitItem('row')\"></i>\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{flex:none;cursor:pointer}:host .active-item .active-bar i:not(:last-child){margin-right:8px}:host .active-item .active-bar i.icon-drag{cursor:move}:host .active-item .active-bar i.icon-close:hover{color:var(--devui-danger, #f66f6a)}:host .active-item .active-bar span{flex:1;margin-right:8px}.plugin-active>:host{display:block}\n"] }]
|
|
149
149
|
}], propDecorators: { _style: [{
|
|
150
150
|
type: HostBinding,
|
|
151
151
|
args: ['style']
|
|
@@ -210,6 +210,7 @@ class PluginManager {
|
|
|
210
210
|
boxItem.config.list.splice(index, 1, { type: 'blank', style: boxItem.config.list[index].style });
|
|
211
211
|
boxItem.load();
|
|
212
212
|
};
|
|
213
|
+
componentRef.location.nativeElement.style.margin = '16px';
|
|
213
214
|
componentRef.location.nativeElement.style.pointerEvents = 'all';
|
|
214
215
|
for (let child of componentRef.location.nativeElement.children) {
|
|
215
216
|
child.style.pointerEvents = 'none';
|
|
@@ -267,6 +268,34 @@ class PluginManager {
|
|
|
267
268
|
this.activeItem.next({ boxItem, index, style, config: config.config, componentRef });
|
|
268
269
|
$event.target.classList.add('plugin-active');
|
|
269
270
|
});
|
|
271
|
+
activeComponentRef.instance.splitItem = (direction) => {
|
|
272
|
+
if (boxItem.config.direction === direction) {
|
|
273
|
+
boxItem.config.list.splice(index + 1, 0, { type: 'blank', style: {} });
|
|
274
|
+
boxItem.load();
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
if (boxItem.config.list.length === 1) {
|
|
278
|
+
boxItem.config.direction = direction;
|
|
279
|
+
boxItem.config.list.push({ type: 'blank', style: {} });
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
if (boxItem.config.list[index].type === 'item' && boxItem.config.list[index].config.direction === direction) {
|
|
283
|
+
boxItem.config.list[index].config.list.push({ type: 'blank', style: {} });
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
boxItem.config.list.splice(index, 1, {
|
|
287
|
+
type: 'item',
|
|
288
|
+
style: boxItem.config.list[index].style,
|
|
289
|
+
config: {
|
|
290
|
+
direction,
|
|
291
|
+
list: [boxItem.config.list[index], { type: 'blank', style: {} }]
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
boxItem.load();
|
|
297
|
+
}
|
|
298
|
+
};
|
|
270
299
|
activeComponentRef.instance.itemRemove.subscribe(() => {
|
|
271
300
|
this.activeItem.next('');
|
|
272
301
|
viewContainerRef.clear();
|
|
@@ -540,7 +569,7 @@ class BoxItemComponent {
|
|
|
540
569
|
activeComponentRef.instance.showDivider = true;
|
|
541
570
|
activeComponentRef.instance.splitItem = (direction) => {
|
|
542
571
|
if (this.config.direction === direction) {
|
|
543
|
-
this.config.list.splice(index, 0, { type: 'blank', style: {} });
|
|
572
|
+
this.config.list.splice(index + 1, 0, { type: 'blank', style: {} });
|
|
544
573
|
this.load();
|
|
545
574
|
}
|
|
546
575
|
else {
|
|
@@ -551,10 +580,10 @@ class BoxItemComponent {
|
|
|
551
580
|
else {
|
|
552
581
|
this.config.list.splice(index, 1, {
|
|
553
582
|
type: 'item',
|
|
554
|
-
style:
|
|
583
|
+
style: {},
|
|
555
584
|
config: {
|
|
556
585
|
direction,
|
|
557
|
-
list: [
|
|
586
|
+
list: [this.config.list[index], { type: 'blank', style: {} }]
|
|
558
587
|
}
|
|
559
588
|
});
|
|
560
589
|
}
|
|
@@ -1000,6 +1029,7 @@ class DataGridComponent {
|
|
|
1000
1029
|
caption: field.caption,
|
|
1001
1030
|
dataType: 'string',
|
|
1002
1031
|
alignment: 'center',
|
|
1032
|
+
cssClass: 'cell-vertical-middle',
|
|
1003
1033
|
allowHeaderFiltering: false,
|
|
1004
1034
|
allowFiltering: false,
|
|
1005
1035
|
allowSorting: false,
|
|
@@ -1014,6 +1044,7 @@ class DataGridComponent {
|
|
|
1014
1044
|
caption: field.caption,
|
|
1015
1045
|
dataType: this.typeMap[field.dataType].dataType,
|
|
1016
1046
|
alignment: 'left',
|
|
1047
|
+
cssClass: 'cell-vertical-middle',
|
|
1017
1048
|
allowHeaderFiltering: true,
|
|
1018
1049
|
headerFilter: {
|
|
1019
1050
|
allowSelectAll: false
|
|
@@ -1235,6 +1266,7 @@ class DataGridComponent {
|
|
|
1235
1266
|
caption: field.caption,
|
|
1236
1267
|
dataType: 'string',
|
|
1237
1268
|
alignment: 'left',
|
|
1269
|
+
cssClass: 'cell-vertical-middle',
|
|
1238
1270
|
allowHeaderFiltering: false,
|
|
1239
1271
|
allowFiltering: false,
|
|
1240
1272
|
visible: field.visible,
|
|
@@ -1248,6 +1280,7 @@ class DataGridComponent {
|
|
|
1248
1280
|
caption: field.caption,
|
|
1249
1281
|
dataType: 'string',
|
|
1250
1282
|
alignment: 'left',
|
|
1283
|
+
cssClass: 'cell-vertical-middle',
|
|
1251
1284
|
allowHeaderFiltering: false,
|
|
1252
1285
|
filterOperations: ['='],
|
|
1253
1286
|
visible: field.visible,
|
|
@@ -1454,12 +1487,13 @@ class FormService {
|
|
|
1454
1487
|
}
|
|
1455
1488
|
});
|
|
1456
1489
|
}
|
|
1457
|
-
getOne(tenant, className, oid, template) {
|
|
1490
|
+
getOne(tenant, className, oid, template, isCopy) {
|
|
1458
1491
|
let api = 'api/data/' + className + '/' + oid;
|
|
1459
1492
|
return this.http.get(api, {
|
|
1460
1493
|
params: {
|
|
1461
1494
|
tenant,
|
|
1462
|
-
template: template || ''
|
|
1495
|
+
template: template || '',
|
|
1496
|
+
isCopy: !!isCopy
|
|
1463
1497
|
}
|
|
1464
1498
|
});
|
|
1465
1499
|
}
|
|
@@ -1505,11 +1539,8 @@ class FormComponent {
|
|
|
1505
1539
|
this.service.getFormTemplateConfig(this.tenant, this.className, this.template).subscribe(response => {
|
|
1506
1540
|
this.config = response.data.template;
|
|
1507
1541
|
if (this.copyOid || this.oid) {
|
|
1508
|
-
this.service.getOne(this.tenant, this.className, this.copyOid || this.oid, this.template)
|
|
1542
|
+
this.service.getOne(this.tenant, this.className, this.copyOid || this.oid, this.template, this.copyOid)
|
|
1509
1543
|
.subscribe(response => {
|
|
1510
|
-
if (this.copyOid) {
|
|
1511
|
-
delete response.data.oid;
|
|
1512
|
-
}
|
|
1513
1544
|
this.model = response.data;
|
|
1514
1545
|
this.loaded = true;
|
|
1515
1546
|
this.loading = false;
|