ngx-rs-ant 0.2.4 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/box-container/PluginManager.d.ts +15 -0
  2. package/box-container/box-container.component.d.ts +12 -0
  3. package/box-container/box-container.module.d.ts +21 -0
  4. package/box-container/box-item/box-item-host.directive.d.ts +10 -0
  5. package/box-container/box-item/box-item.component.d.ts +36 -0
  6. package/box-container/box-item/item-blank/item-blank.component.d.ts +8 -0
  7. package/box-container/box-item/item-config/item-config.component.d.ts +8 -0
  8. package/box-container/box-item/item-style/item-style.component.d.ts +10 -0
  9. package/box-container/box-item/item-style/style/style.component.d.ts +12 -0
  10. package/box-container/box-item/item-style/style-blank/style-blank.component.d.ts +5 -0
  11. package/box-container/plugin-active/divider/divider-line/divider-line.component.d.ts +12 -0
  12. package/box-container/plugin-active/divider/divider.component.d.ts +23 -0
  13. package/box-container/plugin-active/plugin-active.component.d.ts +31 -0
  14. package/box-container/plugin-hover/plugin-hover.component.d.ts +18 -0
  15. package/data-grid/data-grid.component.d.ts +7 -4
  16. package/data-grid/data-grid.module.d.ts +1 -1
  17. package/esm2020/box-container/PluginManager.mjs +103 -0
  18. package/esm2020/box-container/box-container.component.mjs +44 -0
  19. package/esm2020/box-container/box-container.module.mjs +69 -0
  20. package/esm2020/box-container/box-item/box-item-host.directive.mjs +20 -0
  21. package/esm2020/box-container/box-item/box-item.component.mjs +169 -0
  22. package/esm2020/box-container/box-item/item-blank/item-blank.component.mjs +20 -0
  23. package/esm2020/box-container/box-item/item-config/item-config.component.mjs +35 -0
  24. package/esm2020/box-container/box-item/item-style/item-style.component.mjs +35 -0
  25. package/esm2020/box-container/box-item/item-style/style/style.component.mjs +44 -0
  26. package/esm2020/box-container/box-item/item-style/style-blank/style-blank.component.mjs +11 -0
  27. package/esm2020/box-container/plugin-active/divider/divider-line/divider-line.component.mjs +35 -0
  28. package/esm2020/box-container/plugin-active/divider/divider.component.mjs +50 -0
  29. package/esm2020/box-container/plugin-active/plugin-active.component.mjs +55 -0
  30. package/esm2020/box-container/plugin-hover/plugin-hover.component.mjs +26 -0
  31. package/esm2020/data-grid/data-grid.component.mjs +18 -11
  32. package/esm2020/data-grid/data-grid.module.mjs +9 -9
  33. package/esm2020/form/form.component.mjs +53 -0
  34. package/esm2020/form/form.module.mjs +39 -0
  35. package/esm2020/modal/modal.component.mjs +5 -5
  36. package/esm2020/modal/modal.module.mjs +8 -6
  37. package/esm2020/modal/modal.service.mjs +3 -3
  38. package/esm2020/public-api.mjs +11 -3
  39. package/fesm2015/ngx-rs-ant.mjs +905 -155
  40. package/fesm2015/ngx-rs-ant.mjs.map +1 -1
  41. package/fesm2020/ngx-rs-ant.mjs +897 -155
  42. package/fesm2020/ngx-rs-ant.mjs.map +1 -1
  43. package/form/form.component.d.ts +21 -0
  44. package/form/form.module.d.ts +11 -0
  45. package/modal/modal.component.d.ts +1 -1
  46. package/modal/modal.module.d.ts +1 -1
  47. package/package.json +4 -3
  48. package/public-api.d.ts +10 -2
@@ -1,188 +1,675 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, Input, ViewChild, HostListener, Injectable, NgModule } from '@angular/core';
2
+ import { Component, Input, HostBinding, EventEmitter, Output, HostListener, ViewContainerRef, ViewChild, Directive, ViewChildren, NgModule, Injectable } from '@angular/core';
3
+ import { PluginFactory } from 'coast-plugin-register';
3
4
  import * as i1 from '@angular/common';
4
5
  import { CommonModule } from '@angular/common';
6
+ import { Subject, lastValueFrom } from 'rxjs';
7
+ import * as i2 from 'ng-devui/input-number';
8
+ import * as i3 from '@angular/forms';
9
+ import { UntypedFormControl, FormsModule, UntypedFormGroup, ReactiveFormsModule } from '@angular/forms';
10
+ import * as i1$1 from 'ng-devui/dragdrop';
11
+ import { DevUIModule, FormLayout } from 'ng-devui';
5
12
  import CustomStore from 'devextreme/data/custom_store';
6
- import { lastValueFrom } from 'rxjs';
7
- import * as i1$1 from 'devextreme-angular/core';
8
- import * as i2 from 'devextreme-angular/ui/nested';
9
- import * as i3 from 'devextreme-angular/ui/data-grid';
10
- import { DevExtremeModule } from 'devextreme-angular';
13
+ import * as i1$2 from 'devextreme-angular';
14
+ import { DxDataGridComponent, DxDataGridModule } from 'devextreme-angular';
15
+ import * as i2$1 from 'devextreme-angular/ui/nested';
16
+ import * as i3$1 from 'devextreme-angular/core';
17
+ import * as i2$2 from 'ng-devui/form';
11
18
 
12
- class ModalComponent {
13
- constructor(elementRef) {
14
- this.elementRef = elementRef;
15
- this.size = 'default';
16
- this._width = 480;
17
- this.movable = false;
18
- this.topStart = 0;
19
- this.leftStart = 0;
20
- }
21
- ngOnInit() {
22
- if (this.size === 'full') {
23
- this.modalElementRef.nativeElement.style.top = '0px';
24
- this.modalElementRef.nativeElement.style.right = '0px';
25
- this.modalElementRef.nativeElement.style.bottom = '0px';
26
- this.modalElementRef.nativeElement.style.left = '0px';
27
- this.modalElementRef.nativeElement.style.margin = '2px';
28
- this.modalElementRef.nativeElement.style.boxShadow = 'none';
19
+ class DividerLineComponent {
20
+ get _style() {
21
+ if (!this.targetElement) {
22
+ return {};
29
23
  }
30
- else {
31
- if (this.size === 'large') {
32
- this._width = 960;
33
- }
34
- this.modalElementRef.nativeElement.style.width = this._width + 'px';
35
- this.modalElementRef.nativeElement.style.top = '40px';
36
- this.modalElementRef.nativeElement.style.left =
37
- (this.elementRef.nativeElement.parentElement.offsetWidth - this.modalElementRef.nativeElement.offsetWidth) / 2 + 'px';
38
- this.moveHandleEl = this.elementRef.nativeElement.querySelector('.modal-header');
39
- this.moveHandleEl.style.cursor = 'move';
24
+ const elementRect = this.targetElement.getBoundingClientRect();
25
+ if (this.direction === 'row') {
26
+ return {
27
+ height: elementRect.width + 'px'
28
+ };
40
29
  }
41
- }
42
- show() {
43
- // 若存在多层模态框,仅保留最上层遮罩颜色,下层遮罩设置为透明
44
- const parentElement = this.elementRef.nativeElement.parentElement;
45
- const nodeName = this.elementRef.nativeElement.nodeName;
46
- const modals = parentElement.querySelectorAll(nodeName);
47
- for (let i = 0; i < modals.length; i++) {
48
- if (i === modals.length - 1) {
49
- modals[i].querySelector('.modal-backdrop').style.backgroundColor = 'rgba(37, 43, 58, 0.05)';
50
- }
51
- else {
52
- modals[i].querySelector('.modal-backdrop').style.backgroundColor = 'rgba(37, 43, 58, 0)';
53
- }
30
+ if (this.direction === 'column') {
31
+ return {
32
+ height: elementRect.height + 'px'
33
+ };
54
34
  }
35
+ return {};
55
36
  }
56
- hide() {
57
- // 在service中重写
37
+ }
38
+ DividerLineComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DividerLineComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
39
+ DividerLineComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: DividerLineComponent, selector: "rs-divider-line", inputs: { direction: "direction", targetElement: "targetElement" }, host: { properties: { "style": "this._style" } }, ngImport: i0, template: "", styles: ["coast-divider:hover>:host{position:absolute;top:-5px;border:1px dashed var(--devui-brand, #5e7ce0)}\n"] });
40
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DividerLineComponent, decorators: [{
41
+ type: Component,
42
+ args: [{ selector: 'rs-divider-line', template: "", styles: ["coast-divider:hover>:host{position:absolute;top:-5px;border:1px dashed var(--devui-brand, #5e7ce0)}\n"] }]
43
+ }], propDecorators: { direction: [{
44
+ type: Input
45
+ }], targetElement: [{
46
+ type: Input
47
+ }], _style: [{
48
+ type: HostBinding,
49
+ args: ['style']
50
+ }] } });
51
+
52
+ class DividerComponent {
53
+ constructor() {
54
+ this.dividerClick = new EventEmitter();
58
55
  }
59
- ngOnDestroy() {
60
- // 若存在多层模态框,下一层遮罩设置为不透明
61
- const parentElement = this.elementRef.nativeElement.parentElement;
62
- const nodeName = this.elementRef.nativeElement.nodeName;
63
- const nextModal = parentElement.querySelector(nodeName + ':nth-last-child(2)');
64
- if (nextModal) {
65
- nextModal.querySelector('.modal-backdrop').style.backgroundColor = 'rgba(37, 43, 58, 0.05)';
56
+ get _style() {
57
+ if (!this.targetElement) {
58
+ return {};
59
+ }
60
+ const elementRect = this.targetElement.getBoundingClientRect();
61
+ if (this.direction === 'row') {
62
+ return {
63
+ top: elementRect.height / 2 - 12 + 'px',
64
+ left: '4px',
65
+ transform: 'rotate(270deg)'
66
+ };
67
+ }
68
+ if (this.direction === 'column') {
69
+ return {
70
+ top: '4px',
71
+ left: elementRect.width / 2 - 12 + 'px'
72
+ };
66
73
  }
74
+ return {};
67
75
  }
68
- resolveModalBackdropPosition() {
76
+ onClick() {
77
+ this.dividerClick.emit();
78
+ }
79
+ }
80
+ DividerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DividerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
81
+ DividerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: DividerComponent, selector: "rs-divider", inputs: { direction: "direction", targetElement: "targetElement" }, outputs: { dividerClick: "dividerClick" }, host: { listeners: { "click": "onClick()" }, properties: { "style": "this._style" } }, ngImport: i0, template: "<div class=\"divider-image\"></div>\n<rs-divider-line [targetElement]=\"targetElement\" [direction]=\"direction\"></rs-divider-line>\n", styles: [":host{position:absolute;display:flex;justify-content:center;align-items:center;width:24px;height:24px;background-color:#fff;border-radius:12px;cursor:pointer;pointer-events:all}:host .divider-image{width:12px;height:12px;background-size:contain;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACO0lEQVRIDa2Uy6tNURzHN7cwMUAmHncot0QeV5QiBgZKmWEgzDDx+ANu5soMcUkxIY+iEFIKEZnIyMC9GZAMrke6hXt9Pvus1VnntPbZ53B/9dnrt36P7zpr7bVPUTRtD+5j+Arv4QwshDpbTIG1o2CvGmq12CVmk/ADnsGnMHccgCpbRiLWjuA/BTXUUrM0VzNwD+aVkcbjIMNveJnEUrePyWuYgP1JYi6+WmqWO3FLrpqKMy3tHE8LtzemLc99ITfcEm1MXERNtYsxcGs520nQBV61JWcyHw253W25OFVzbDqPj1D1MheF6tWM24LvcAD6w7yqdwF5tYvT4K90y6m5zQ/wE37BC9Bmw2f4Ah6DNdamFo/vlEHP3pvwB87CLjgGNrrwEbgY/K2MQ8E/zHg0+NbaY68aaqmpdmlLeT4HBSPf8RXQloA3ylvzDTx/34OmsLWxz9Hdqtlivo/l4NXy1syB1C4ziSK547THXjXU6tk20uECnn1fz91dNJynJu5gUxf1PZV4nr6DdzABj2BK7Rpq/votcDX4GxinxNagovjDoOZLdBcPwvy/h/souMDaROlGiK1PYv/kbg5C19u6V4b43bZ4z1M/GF/uQKbzFjF3NpjJdRXaEQQuVFQr7AK3K/Idw36Jb2Ec+jtU3iHnIqs61GRTe4naeDKbbQbXhbqbzVC9N4OSEfAPbD7UmbfMa7uirjDmD+H464/HQM3oB2f9lVxd7l9vFoVv4ESuIRN7QkzxaZlc8RcdnI7tMHZBlAAAAABJRU5ErkJggg==)}:host:hover{background-color:var(--devui-brand, #5e7ce0)}\n"], dependencies: [{ kind: "component", type: DividerLineComponent, selector: "rs-divider-line", inputs: ["direction", "targetElement"] }] });
82
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DividerComponent, decorators: [{
83
+ type: Component,
84
+ args: [{ selector: 'rs-divider', template: "<div class=\"divider-image\"></div>\n<rs-divider-line [targetElement]=\"targetElement\" [direction]=\"direction\"></rs-divider-line>\n", styles: [":host{position:absolute;display:flex;justify-content:center;align-items:center;width:24px;height:24px;background-color:#fff;border-radius:12px;cursor:pointer;pointer-events:all}:host .divider-image{width:12px;height:12px;background-size:contain;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACO0lEQVRIDa2Uy6tNURzHN7cwMUAmHncot0QeV5QiBgZKmWEgzDDx+ANu5soMcUkxIY+iEFIKEZnIyMC9GZAMrke6hXt9Pvus1VnntPbZ53B/9dnrt36P7zpr7bVPUTRtD+5j+Arv4QwshDpbTIG1o2CvGmq12CVmk/ADnsGnMHccgCpbRiLWjuA/BTXUUrM0VzNwD+aVkcbjIMNveJnEUrePyWuYgP1JYi6+WmqWO3FLrpqKMy3tHE8LtzemLc99ITfcEm1MXERNtYsxcGs520nQBV61JWcyHw253W25OFVzbDqPj1D1MheF6tWM24LvcAD6w7yqdwF5tYvT4K90y6m5zQ/wE37BC9Bmw2f4Ah6DNdamFo/vlEHP3pvwB87CLjgGNrrwEbgY/K2MQ8E/zHg0+NbaY68aaqmpdmlLeT4HBSPf8RXQloA3ylvzDTx/34OmsLWxz9Hdqtlivo/l4NXy1syB1C4ziSK547THXjXU6tk20uECnn1fz91dNJynJu5gUxf1PZV4nr6DdzABj2BK7Rpq/votcDX4GxinxNagovjDoOZLdBcPwvy/h/souMDaROlGiK1PYv/kbg5C19u6V4b43bZ4z1M/GF/uQKbzFjF3NpjJdRXaEQQuVFQr7AK3K/Idw36Jb2Ec+jtU3iHnIqs61GRTe4naeDKbbQbXhbqbzVC9N4OSEfAPbD7UmbfMa7uirjDmD+H464/HQM3oB2f9lVxd7l9vFoVv4ESuIRN7QkzxaZlc8RcdnI7tMHZBlAAAAABJRU5ErkJggg==)}:host:hover{background-color:var(--devui-brand, #5e7ce0)}\n"] }]
85
+ }], propDecorators: { direction: [{
86
+ type: Input
87
+ }], targetElement: [{
88
+ type: Input
89
+ }], dividerClick: [{
90
+ type: Output
91
+ }], _style: [{
92
+ type: HostBinding,
93
+ args: ['style']
94
+ }], onClick: [{
95
+ type: HostListener,
96
+ args: ['click']
97
+ }] } });
98
+
99
+ class PluginActiveComponent {
100
+ constructor() {
101
+ this.showClose = true;
102
+ this.showDivider = false;
103
+ this.itemRemove = new EventEmitter();
104
+ this.targetRect = {
105
+ width: 0,
106
+ height: 0
107
+ };
108
+ this._targetRect = {};
109
+ this.width = 0;
110
+ this._width = 0;
111
+ this.height = 0;
112
+ this._height = 0;
113
+ }
114
+ get _style() {
115
+ if (!this.targetElement) {
116
+ return {};
117
+ }
118
+ const elementRect = this.targetElement.getBoundingClientRect();
119
+ this._targetRect.width = elementRect.width;
120
+ this._targetRect.height = elementRect.height;
69
121
  return {
70
- "width": this.elementRef.nativeElement.parentElement.offsetWidth + 'px',
71
- "height": this.elementRef.nativeElement.parentElement.offsetHeight + 'px',
72
- "top": this.elementRef.nativeElement.parentElement.offsetTop + 'px',
73
- "left": this.elementRef.nativeElement.parentElement.offsetLeft + 'px',
122
+ width: elementRect.width + 'px',
123
+ height: elementRect.height + 'px',
124
+ top: this.targetElement.offsetTop + 'px',
125
+ left: this.targetElement.offsetLeft + 'px'
74
126
  };
75
127
  }
76
- onMousedown($event) {
77
- if ($event.button === 2 || !this.checkHandleTarget($event.target, this.moveHandleEl)) {
78
- return;
128
+ ngOnInit() {
129
+ setTimeout(() => {
130
+ this.targetRect = this._targetRect;
131
+ });
132
+ }
133
+ onItemCloseIconClick($event) {
134
+ this.itemRemove.emit();
135
+ }
136
+ splitItem(direction) {
137
+ // 在布局型组件中实例化时重写
138
+ }
139
+ }
140
+ PluginActiveComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PluginActiveComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
141
+ 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-bar\">\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", styles: [":host{display:none;position:absolute;border:1px solid var(--devui-brand, #5e7ce0);pointer-events:none}:host .active-bar{padding:2px 4px;color:#fff;background-color:var(--devui-brand, #5e7ce0);position:absolute;top:-23px;right:-1px;display:flex;align-items:center;pointer-events:all;white-space:nowrap}:host .active-bar span{flex:auto}:host .active-bar i{flex:none;margin-left:8px;cursor:pointer}:host .active-bar i: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: "component", type: DividerComponent, selector: "rs-divider", inputs: ["direction", "targetElement"], outputs: ["dividerClick"] }] });
142
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PluginActiveComponent, decorators: [{
143
+ type: Component,
144
+ args: [{ selector: 'rs-plugin-active', template: "<div class=\"active-bar\">\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", styles: [":host{display:none;position:absolute;border:1px solid var(--devui-brand, #5e7ce0);pointer-events:none}:host .active-bar{padding:2px 4px;color:#fff;background-color:var(--devui-brand, #5e7ce0);position:absolute;top:-23px;right:-1px;display:flex;align-items:center;pointer-events:all;white-space:nowrap}:host .active-bar span{flex:auto}:host .active-bar i{flex:none;margin-left:8px;cursor:pointer}:host .active-bar i:hover{color:var(--devui-danger, #f66f6a)}.plugin-active>:host{display:block}\n"] }]
145
+ }], propDecorators: { _style: [{
146
+ type: HostBinding,
147
+ args: ['style']
148
+ }] } });
149
+
150
+ class PluginHoverComponent {
151
+ get _style() {
152
+ if (!this.targetElement) {
153
+ return {};
79
154
  }
80
- this.movable = true;
81
- this.topStart = $event.clientY - this.modalElementRef.nativeElement.style.top.replace('px', '');
82
- this.leftStart = $event.clientX - this.modalElementRef.nativeElement.style.left.replace('px', '');
155
+ const elementRect = this.targetElement.getBoundingClientRect();
156
+ return {
157
+ width: elementRect.width + 'px',
158
+ height: elementRect.height + 'px',
159
+ top: this.targetElement.offsetTop + 'px',
160
+ left: this.targetElement.offsetLeft + 'px'
161
+ };
83
162
  }
84
- checkHandleTarget(target, element) {
85
- if (!element) {
86
- return false;
163
+ }
164
+ PluginHoverComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PluginHoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
165
+ PluginHoverComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: PluginHoverComponent, selector: "rs-plugin-hover", host: { properties: { "style": "this._style" } }, ngImport: i0, template: "<div class=\"hover-title\">{{name}}</div>\n", styles: [":host{display:none;position:absolute;border:1px dashed var(--devui-brand, #5e7ce0);pointer-events:none}:host .hover-title{color:var(--devui-brand, #5e7ce0);position:absolute;top:-18px;left:0}.plugin-active>:host{display:none!important}.plugin-hover>:host{display:block}\n"] });
166
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PluginHoverComponent, decorators: [{
167
+ type: Component,
168
+ args: [{ selector: 'rs-plugin-hover', template: "<div class=\"hover-title\">{{name}}</div>\n", styles: [":host{display:none;position:absolute;border:1px dashed var(--devui-brand, #5e7ce0);pointer-events:none}:host .hover-title{color:var(--devui-brand, #5e7ce0);position:absolute;top:-18px;left:0}.plugin-active>:host{display:none!important}.plugin-hover>:host{display:block}\n"] }]
169
+ }], propDecorators: { _style: [{
170
+ type: HostBinding,
171
+ args: ['style']
172
+ }] } });
173
+
174
+ class StyleBlankComponent {
175
+ }
176
+ StyleBlankComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: StyleBlankComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
177
+ StyleBlankComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: StyleBlankComponent, selector: "rs-style-blank", ngImport: i0, template: "<div>\n <span>\u8BF7\u5728\u5DE6\u4FA7\u753B\u5E03\u9009\u4E2D\u8282\u70B9</span>\n</div>\n", styles: [":host{height:80px;margin:8px;display:flex;justify-content:center}:host div{flex:auto;display:flex;justify-content:center;align-items:center}:host div span{text-align:center;-webkit-user-select:none;user-select:none}\n"] });
178
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: StyleBlankComponent, decorators: [{
179
+ type: Component,
180
+ args: [{ selector: 'rs-style-blank', template: "<div>\n <span>\u8BF7\u5728\u5DE6\u4FA7\u753B\u5E03\u9009\u4E2D\u8282\u70B9</span>\n</div>\n", styles: [":host{height:80px;margin:8px;display:flex;justify-content:center}:host div{flex:auto;display:flex;justify-content:center;align-items:center}:host div span{text-align:center;-webkit-user-select:none;user-select:none}\n"] }]
181
+ }] });
182
+
183
+ class StyleComponent {
184
+ ngOnInit() {
185
+ this.style.width = this.style.width ? this.style.width : 'auto';
186
+ this.style.height = this.style.height ? this.style.height : 'auto';
187
+ if (this.style.width !== 'auto') {
188
+ this.width = this.style.width.substring(0, this.style.width.length - 2);
87
189
  }
88
- if (target === element) {
89
- return true;
190
+ if (this.style.height !== 'auto') {
191
+ this.height = this.style.height.substring(0, this.style.height.length - 2);
90
192
  }
91
- for (let child in element.children) {
92
- if (Object.prototype.hasOwnProperty.call(element.children, child)) {
93
- if (this.checkHandleTarget(target, element.children[child])) {
94
- return true;
95
- }
193
+ }
194
+ select(name, value) {
195
+ const that = this;
196
+ if (value === 'auto') {
197
+ this.style[name] = 'auto';
198
+ }
199
+ else {
200
+ if (!that[name]) {
201
+ that[name] = value;
96
202
  }
203
+ this.style[name] = that[name] + 'px';
97
204
  }
98
- return false;
99
205
  }
100
- onMouseup() {
101
- this.movable = false;
206
+ typing(name, value) {
207
+ if (value) {
208
+ this.style[name] = value + 'px';
209
+ }
210
+ else {
211
+ this.style[name] = 'auto';
212
+ }
102
213
  }
103
- onMousemove($event) {
104
- if (!this.movable) {
214
+ }
215
+ StyleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: StyleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
216
+ 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;margin:8px;align-items:center}:host .config-item .item-title{flex:0 0 80px}:host .config-item .item-setting{flex:auto;display:flex}:host .config-item .item-setting .card-style-radio{flex:auto;display:flex;justify-content:stretch}:host .config-item .item-setting .card-style-radio .radio-value{flex:auto;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:auto}\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: 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"] }] });
217
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: StyleComponent, decorators: [{
218
+ type: Component,
219
+ 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;margin:8px;align-items:center}:host .config-item .item-title{flex:0 0 80px}:host .config-item .item-setting{flex:auto;display:flex}:host .config-item .item-setting .card-style-radio{flex:auto;display:flex;justify-content:stretch}:host .config-item .item-setting .card-style-radio .radio-value{flex:auto;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:auto}\n"] }]
220
+ }] });
221
+
222
+ class ItemStyleComponent {
223
+ constructor(changeDetectorRef) {
224
+ this.changeDetectorRef = changeDetectorRef;
225
+ }
226
+ ngOnInit() {
227
+ this.pageStyleContent.createComponent(StyleBlankComponent);
228
+ PluginManager.activeItem.subscribe(item => {
229
+ this.pageStyleContent.clear();
230
+ if (item) {
231
+ const componentRef = this.pageStyleContent.createComponent(StyleComponent);
232
+ const instance = componentRef.instance;
233
+ instance.style = item.style;
234
+ }
235
+ else {
236
+ this.pageStyleContent.createComponent(StyleBlankComponent);
237
+ this.changeDetectorRef.detectChanges();
238
+ }
239
+ });
240
+ }
241
+ }
242
+ ItemStyleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ItemStyleComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
243
+ ItemStyleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: ItemStyleComponent, selector: "rs-item-style", viewQueries: [{ propertyName: "pageStyleContent", first: true, predicate: ["pageStyleContent"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<ng-container #pageStyleContent></ng-container>\n", styles: [""] });
244
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ItemStyleComponent, decorators: [{
245
+ type: Component,
246
+ args: [{ selector: 'rs-item-style', template: "<ng-container #pageStyleContent></ng-container>\n" }]
247
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { pageStyleContent: [{
248
+ type: ViewChild,
249
+ args: ['pageStyleContent', { static: true, read: ViewContainerRef }]
250
+ }] } });
251
+
252
+ class PluginManager {
253
+ static createComponent(boxItem, index, style, config, editMode = false, control) {
254
+ var _a;
255
+ const plugin = PluginFactory.get(config.name);
256
+ if (!plugin) {
257
+ console.error('undefined plugin: ' + config.name);
105
258
  return;
106
259
  }
107
- $event.stopPropagation();
108
- $event.preventDefault();
109
- const element = this.modalElementRef.nativeElement;
110
- let currentTop = $event.clientY - this.topStart;
111
- let currentLeft = $event.clientX - this.leftStart;
112
- currentTop = currentTop < 0 ? 0 : currentTop;
113
- const maxTop = element.parentElement.offsetHeight - element.offsetHeight;
114
- currentTop = currentTop > maxTop ? maxTop : currentTop;
115
- currentLeft = currentLeft < 0 ? 0 : currentLeft;
116
- const maxLeft = element.parentElement.offsetWidth - element.offsetWidth;
117
- currentLeft = currentLeft > maxLeft ? maxLeft : currentLeft;
118
- element.style.top = currentTop + 'px';
119
- element.style.left = currentLeft + 'px';
260
+ const viewContainerRef = (_a = boxItem.itemHosts.get(index)) === null || _a === void 0 ? void 0 : _a.viewContainerRef;
261
+ viewContainerRef.clear();
262
+ const componentRef = viewContainerRef.createComponent(plugin.component);
263
+ const instance = componentRef.instance;
264
+ Object.assign(instance, config.pluginConfig);
265
+ if (plugin.category === 'form') {
266
+ if (editMode) {
267
+ instance.control = new UntypedFormControl('');
268
+ }
269
+ else {
270
+ instance.control = control.get(config.pluginConfig.field);
271
+ }
272
+ }
273
+ if (editMode) {
274
+ instance.onRemove = () => {
275
+ boxItem.config.list.splice(index, 1, { type: 'blank', style: boxItem.config.list[index].style });
276
+ boxItem.load();
277
+ };
278
+ if (plugin.type === 'default') {
279
+ componentRef.location.nativeElement.style.pointerEvents = 'all';
280
+ for (let child of componentRef.location.nativeElement.children) {
281
+ child.style.pointerEvents = 'none';
282
+ }
283
+ }
284
+ this.createHoverComponent(viewContainerRef, componentRef, plugin.caption);
285
+ this.createActiveComponent(boxItem, index, componentRef, style, {
286
+ caption: plugin.caption,
287
+ config
288
+ }, true);
289
+ }
290
+ return componentRef;
291
+ }
292
+ static createHoverComponent(viewContainerRef, componentRef, caption) {
293
+ const hoverComponentRef = viewContainerRef.createComponent(PluginHoverComponent);
294
+ hoverComponentRef.instance.name = caption;
295
+ hoverComponentRef.instance.targetElement = componentRef.location.nativeElement;
296
+ const hoverElement = hoverComponentRef.location.nativeElement;
297
+ componentRef.location.nativeElement.appendChild(hoverElement);
298
+ this.hoverItems.push(componentRef.location.nativeElement);
299
+ componentRef.location.nativeElement.addEventListener('mouseenter', ($event) => {
300
+ for (let hoverItem of this.hoverItems) {
301
+ hoverItem.classList.remove('plugin-hover');
302
+ }
303
+ $event.target.classList.add('plugin-hover');
304
+ });
305
+ componentRef.location.nativeElement.addEventListener('mouseleave', ($event) => {
306
+ $event.target.classList.remove('plugin-hover');
307
+ $event.target.parentElement.parentElement.classList.add('plugin-hover');
308
+ });
309
+ return hoverComponentRef;
310
+ }
311
+ static createActiveComponent(boxItem, index, componentRef, style, config, showClose) {
312
+ var _a;
313
+ const viewContainerRef = (_a = boxItem.itemHosts.get(index)) === null || _a === void 0 ? void 0 : _a.viewContainerRef;
314
+ const activeComponentRef = viewContainerRef.createComponent(PluginActiveComponent);
315
+ activeComponentRef.instance.name = config.caption;
316
+ activeComponentRef.instance.showClose = showClose;
317
+ activeComponentRef.instance.targetElement = componentRef.location.nativeElement;
318
+ const activeElement = activeComponentRef.location.nativeElement;
319
+ componentRef.location.nativeElement.appendChild(activeElement);
320
+ this.activeItems.push(componentRef.location.nativeElement);
321
+ componentRef.location.nativeElement.addEventListener('click', ($event) => {
322
+ $event.stopPropagation();
323
+ for (let activeItem of this.activeItems) {
324
+ activeItem.classList.remove('plugin-active');
325
+ }
326
+ if (this.activeItems.indexOf($event.target) < 0) {
327
+ return;
328
+ }
329
+ this.activeItem.next({ boxItem, index, style, config: config.config });
330
+ $event.target.classList.add('plugin-active');
331
+ });
332
+ activeComponentRef.instance.itemRemove.subscribe(() => {
333
+ this.activeItem.next('');
334
+ viewContainerRef.clear();
335
+ componentRef.instance.onRemove();
336
+ });
337
+ return activeComponentRef;
338
+ }
339
+ static getItemConfigComponent() {
340
+ return ItemConfigComponent;
341
+ }
342
+ static getItemStyleComponent() {
343
+ return ItemStyleComponent;
120
344
  }
121
345
  }
122
- ModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: ModalComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
123
- ModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.0", type: ModalComponent, selector: "rs-modal", inputs: { title: "title", size: "size", contentTemplate: "contentTemplate", contentTemplateContext: "contentTemplateContext" }, host: { listeners: { "document:mouseup": "onMouseup($event)", "document:mousemove": "onMousemove($event)" } }, viewQueries: [{ propertyName: "modalElementRef", first: true, predicate: ["modal"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"modal-backdrop\" [ngStyle]=\"resolveModalBackdropPosition()\">\n <div #modal class=\"modal\">\n <div class=\"modal-header\" (mousedown)=\"onMousedown($event)\">\n <div class=\"modal-title\">{{title}}</div>\n <i class=\"icon-close\" (click)=\"hide()\"></i>\n </div>\n <div class=\"modal-content\">\n <ng-template [ngTemplateOutlet]=\"contentTemplate\"\n [ngTemplateOutletContext]=\"{$implicit: contentTemplateContext}\"></ng-template>\n </div>\n </div>\n</div>\n", styles: [":host .modal-backdrop{position:absolute;inset:0;z-index:calc(var(--devui-z-index-modal, 1050) - 1)}:host .modal-backdrop .modal{position:absolute;top:0;left:0;z-index:var(--devui-z-index-modal, 1050);background-color:var(--devui-base-bg, #ffffff);border-radius:var(--devui-border-radius-card, 6px);box-shadow:var(--devui-shadow-length-fullscreen-overlay, 0 12px 24px 0) var(--devui-shadow, rgba(37, 43, 58, .2));display:flex;flex-flow:column nowrap}:host .modal-backdrop .modal .modal-header{flex:0 0 36px;border-bottom:1px solid var(--devui-dividing-line, #f2f2f3)}:host .modal-backdrop .modal .modal-header .modal-title{padding:12px 24px;font-size:var(--devui-font-size-card-title, 14px);font-weight:700}:host .modal-backdrop .modal .modal-header i{position:absolute;top:12px;right:12px;padding:4px;font-size:var(--devui-font-size-card-title, 14px)}:host .modal-backdrop .modal .modal-header i:hover{cursor:pointer;color:var(--devui-danger, #f66f6a);background-color:var(--devui-info-bg, #e9edfa)}:host .modal-backdrop .modal .modal-content{flex:auto;padding:24px;display:flex;flex-flow:column;font-size:var(--devui-font-size, 12px);color:var(--devui-aide-text, #71757f)}\n"], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
124
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: ModalComponent, decorators: [{
346
+ PluginManager.hoverItems = [];
347
+ PluginManager.activeItem = new Subject();
348
+ PluginManager.activeItems = [];
349
+
350
+ class ItemConfigComponent {
351
+ ngOnInit() {
352
+ PluginManager.activeItem.subscribe(item => {
353
+ var _a;
354
+ if (!item) {
355
+ return;
356
+ }
357
+ this.pageConfigContent.clear();
358
+ const pluginConfig = PluginFactory.getConfig((_a = item.config) === null || _a === void 0 ? void 0 : _a.name);
359
+ if (!pluginConfig) {
360
+ return;
361
+ }
362
+ const componentRef = this.pageConfigContent.createComponent(pluginConfig.component);
363
+ const instance = componentRef.instance;
364
+ instance.config = item.config.pluginConfig;
365
+ instance.configChange.subscribe(() => {
366
+ const componentRef = PluginManager.createComponent(item.boxItem, item.index, item.style, item.config, true);
367
+ componentRef.location.nativeElement.click();
368
+ });
369
+ });
370
+ }
371
+ }
372
+ ItemConfigComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ItemConfigComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
373
+ ItemConfigComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: ItemConfigComponent, selector: "rs-item-config", viewQueries: [{ propertyName: "pageConfigContent", first: true, predicate: ["pageConfigContent"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<ng-container #pageConfigContent></ng-container>\n", styles: [""] });
374
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ItemConfigComponent, decorators: [{
125
375
  type: Component,
126
- args: [{ selector: 'rs-modal', template: "<div class=\"modal-backdrop\" [ngStyle]=\"resolveModalBackdropPosition()\">\n <div #modal class=\"modal\">\n <div class=\"modal-header\" (mousedown)=\"onMousedown($event)\">\n <div class=\"modal-title\">{{title}}</div>\n <i class=\"icon-close\" (click)=\"hide()\"></i>\n </div>\n <div class=\"modal-content\">\n <ng-template [ngTemplateOutlet]=\"contentTemplate\"\n [ngTemplateOutletContext]=\"{$implicit: contentTemplateContext}\"></ng-template>\n </div>\n </div>\n</div>\n", styles: [":host .modal-backdrop{position:absolute;inset:0;z-index:calc(var(--devui-z-index-modal, 1050) - 1)}:host .modal-backdrop .modal{position:absolute;top:0;left:0;z-index:var(--devui-z-index-modal, 1050);background-color:var(--devui-base-bg, #ffffff);border-radius:var(--devui-border-radius-card, 6px);box-shadow:var(--devui-shadow-length-fullscreen-overlay, 0 12px 24px 0) var(--devui-shadow, rgba(37, 43, 58, .2));display:flex;flex-flow:column nowrap}:host .modal-backdrop .modal .modal-header{flex:0 0 36px;border-bottom:1px solid var(--devui-dividing-line, #f2f2f3)}:host .modal-backdrop .modal .modal-header .modal-title{padding:12px 24px;font-size:var(--devui-font-size-card-title, 14px);font-weight:700}:host .modal-backdrop .modal .modal-header i{position:absolute;top:12px;right:12px;padding:4px;font-size:var(--devui-font-size-card-title, 14px)}:host .modal-backdrop .modal .modal-header i:hover{cursor:pointer;color:var(--devui-danger, #f66f6a);background-color:var(--devui-info-bg, #e9edfa)}:host .modal-backdrop .modal .modal-content{flex:auto;padding:24px;display:flex;flex-flow:column;font-size:var(--devui-font-size, 12px);color:var(--devui-aide-text, #71757f)}\n"] }]
127
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { title: [{
128
- type: Input
129
- }], size: [{
130
- type: Input
131
- }], modalElementRef: [{
376
+ args: [{ selector: 'rs-item-config', template: "<ng-container #pageConfigContent></ng-container>\n" }]
377
+ }], propDecorators: { pageConfigContent: [{
132
378
  type: ViewChild,
133
- args: ['modal', { static: true }]
134
- }], contentTemplate: [{
135
- type: Input
136
- }], contentTemplateContext: [{
379
+ args: ['pageConfigContent', { static: true, read: ViewContainerRef }]
380
+ }] } });
381
+
382
+ class BoxItemHostDirective {
383
+ constructor(el, viewContainerRef) {
384
+ this.el = el;
385
+ this.viewContainerRef = viewContainerRef;
386
+ this.el.nativeElement.hostId = this.hostId;
387
+ }
388
+ }
389
+ BoxItemHostDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: BoxItemHostDirective, deps: [{ token: i0.ElementRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
390
+ BoxItemHostDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.7", type: BoxItemHostDirective, selector: "[rsBoxItemHost]", inputs: { hostId: "hostId" }, ngImport: i0 });
391
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: BoxItemHostDirective, decorators: [{
392
+ type: Directive,
393
+ args: [{
394
+ selector: '[rsBoxItemHost]'
395
+ }]
396
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { hostId: [{
137
397
  type: Input
138
- }], onMouseup: [{
139
- type: HostListener,
140
- args: ['document:mouseup', ['$event']]
141
- }], onMousemove: [{
142
- type: HostListener,
143
- args: ['document:mousemove', ['$event']]
144
398
  }] } });
145
399
 
146
- class ModalService {
400
+ class ItemBlankComponent {
147
401
  constructor() {
402
+ this.dropItem = new EventEmitter();
148
403
  }
149
- open(viewContainerRef, title, size = 'default', contentTemplate, contentTemplateContext) {
150
- const modalRef = viewContainerRef.createComponent(ModalComponent);
151
- modalRef.instance.hide = () => {
152
- modalRef.hostView.destroy();
404
+ dropEvent($event) {
405
+ this.dropItem.emit($event.dragData);
406
+ }
407
+ }
408
+ ItemBlankComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ItemBlankComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
409
+ 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\n dDroppable\n [dropScope]=\"'default'\"\n dragOverClass=\"active\"\n (dropEvent)=\"dropEvent($event)\"\n>\n <span>\u62D6\u62FD\u7EC4\u4EF6\u5230\u6B64\u5904</span>\n</div>\n", styles: [":host{flex:auto;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;justify-content:center;pointer-events:all}:host div{flex:auto;padding:16px;display:flex;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: i1$1.DroppableDirective, selector: "[dDroppable]", inputs: ["dragOverClass", "dropScope", "placeholderTag", "placeholderStyle", "placeholderText", "allowDropOnItem", "dragOverItemClass", "nestingTargetRect", "switchWhileCrossEdge", "defaultDropPosition", "dropSortCountSelector", "dropSortVirtualScrollOption"], outputs: ["dragEnterEvent", "dragOverEvent", "dragLeaveEvent", "dropEvent"] }] });
410
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ItemBlankComponent, decorators: [{
411
+ type: Component,
412
+ args: [{ selector: 'rs-item-blank', template: "<div\n dDroppable\n [dropScope]=\"'default'\"\n dragOverClass=\"active\"\n (dropEvent)=\"dropEvent($event)\"\n>\n <span>\u62D6\u62FD\u7EC4\u4EF6\u5230\u6B64\u5904</span>\n</div>\n", styles: [":host{flex:auto;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;justify-content:center;pointer-events:all}:host div{flex:auto;padding:16px;display:flex;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"] }]
413
+ }], propDecorators: { dropItem: [{
414
+ type: Output
415
+ }] } });
416
+
417
+ class BoxItemComponent {
418
+ constructor() {
419
+ this.editMode = false;
420
+ this.style = {};
421
+ this.config = {};
422
+ this.leaveOneItem = new EventEmitter();
423
+ }
424
+ get _direction() {
425
+ return this.config.direction;
426
+ }
427
+ get _style() {
428
+ var _a, _b;
429
+ if (this.pDirection) {
430
+ return {};
431
+ }
432
+ const width = ((_a = this.style) === null || _a === void 0 ? void 0 : _a.width) ? this.style.width : 'auto';
433
+ const height = ((_b = this.style) === null || _b === void 0 ? void 0 : _b.height) ? this.style.height : 'auto';
434
+ return this._calcStyle(this.pDirection, width, height);
435
+ }
436
+ ngOnInit() {
437
+ this.load();
438
+ }
439
+ load() {
440
+ setTimeout(() => {
441
+ for (let i = 0; i < this.itemHosts.length; i++) {
442
+ const itemHost = this.itemHosts.get(i);
443
+ itemHost.viewContainerRef.clear();
444
+ const item = this.config.list[i];
445
+ switch (item.type) {
446
+ case 'plugin':
447
+ PluginManager.createComponent(this, i, item.style, item.config, this.editMode, this.control);
448
+ break;
449
+ case 'item':
450
+ const boxItemComponentRef = itemHost.viewContainerRef.createComponent(BoxItemComponent);
451
+ const instance = boxItemComponentRef.instance;
452
+ instance.editMode = this.editMode;
453
+ instance.style = item.style;
454
+ instance.config = item.config;
455
+ instance.control = this.control;
456
+ instance.pDirection = this.config.direction;
457
+ if (this.editMode) {
458
+ instance.leaveOneItem.subscribe((item) => {
459
+ if (item.type === 'item' && item.direction === this.config.direction) {
460
+ this.config.list.splice(i, 1, ...item.list);
461
+ }
462
+ else {
463
+ this.config.list.splice(i, 1, item);
464
+ }
465
+ this.load();
466
+ });
467
+ PluginManager.createHoverComponent(itemHost.viewContainerRef, boxItemComponentRef, '格子容器');
468
+ PluginManager.createActiveComponent(this, i, boxItemComponentRef, item.style, {
469
+ name: 'coast-box-container',
470
+ caption: '格子容器'
471
+ }, false);
472
+ }
473
+ break;
474
+ case 'blank':
475
+ default:
476
+ if (this.editMode) {
477
+ this.createBlankComponent(i);
478
+ }
479
+ break;
480
+ }
481
+ }
482
+ });
483
+ }
484
+ createBlankComponent(index) {
485
+ var _a;
486
+ const viewContainerRef = (_a = this.itemHosts.get(index)) === null || _a === void 0 ? void 0 : _a.viewContainerRef;
487
+ const containerBlankComponentRef = viewContainerRef.createComponent(ItemBlankComponent);
488
+ containerBlankComponentRef.instance.dropItem.subscribe((plugin) => {
489
+ this.config.list[index] = {
490
+ type: 'plugin',
491
+ style: this.config.list[index].style,
492
+ config: {
493
+ name: plugin.name,
494
+ pluginConfig: plugin.pluginConfig || {}
495
+ }
496
+ };
497
+ this.load();
498
+ });
499
+ containerBlankComponentRef.instance.onRemove = () => {
500
+ this.config.list.splice(index, 1);
501
+ if (this.config.list.length === 1) {
502
+ this.leaveOneItem.emit(this.config.list[0]);
503
+ }
504
+ else {
505
+ this.load();
506
+ }
507
+ };
508
+ PluginManager.createHoverComponent(viewContainerRef, containerBlankComponentRef, '占位格');
509
+ const activeComponentRef = PluginManager.createActiveComponent(this, index, containerBlankComponentRef, this.config.list[index].style, {
510
+ name: 'coast-box-container',
511
+ caption: '占位格'
512
+ }, this.config.list.length > 1);
513
+ activeComponentRef.instance.showDivider = true;
514
+ activeComponentRef.instance.splitItem = (direction) => {
515
+ if (this.config.direction === direction) {
516
+ this.config.list.splice(index, 0, { type: 'blank', style: {} });
517
+ this.load();
518
+ }
519
+ else {
520
+ if (this.config.list.length === 1) {
521
+ this.config.direction = direction;
522
+ this.config.list.push({ type: 'blank', style: {} });
523
+ }
524
+ else {
525
+ this.config.list.splice(index, 1, {
526
+ type: 'item',
527
+ style: this.config.list[index].style,
528
+ config: {
529
+ direction,
530
+ list: [{ type: 'blank', style: {} }, { type: 'blank', style: {} }]
531
+ }
532
+ });
533
+ }
534
+ this.load();
535
+ }
536
+ };
537
+ }
538
+ calcStyle(item) {
539
+ var _a, _b;
540
+ const width = ((_a = item.style) === null || _a === void 0 ? void 0 : _a.width) ? item.style.width : 'auto';
541
+ const height = ((_b = item.style) === null || _b === void 0 ? void 0 : _b.height) ? item.style.height : 'auto';
542
+ return this._calcStyle(this.config.direction, width, height);
543
+ }
544
+ _calcStyle(direction, width, height) {
545
+ if (direction === 'row') {
546
+ return {
547
+ flex: width === 'auto' ? '1' : '0 0 ' + width,
548
+ height,
549
+ pointerEvents: this.editMode ? 'none' : 'all'
550
+ };
551
+ }
552
+ else if (direction === 'column') {
553
+ return {
554
+ width,
555
+ flex: height === 'auto' ? '1' : '0 0 ' + height,
556
+ pointerEvents: this.editMode ? 'none' : 'all'
557
+ };
558
+ }
559
+ return {
560
+ pointerEvents: this.editMode ? 'none' : 'all'
153
561
  };
154
- modalRef.instance.title = title;
155
- modalRef.instance.contentTemplate = contentTemplate;
156
- modalRef.instance.size = size;
157
- modalRef.instance.contentTemplateContext = contentTemplateContext;
158
- modalRef.instance.show();
159
- return modalRef.instance;
160
562
  }
161
563
  }
162
- ModalService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: ModalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
163
- ModalServiceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: ModalService, providedIn: 'root' });
164
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: ModalService, decorators: [{
165
- type: Injectable,
166
- args: [{
167
- providedIn: 'root'
168
- }]
169
- }], ctorParameters: function () { return []; } });
564
+ BoxItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: BoxItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
565
+ BoxItemComponentcmp = 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:auto;display:flex;pointer-events:all}:host div{flex:auto;display:flex}\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"] }] });
566
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: BoxItemComponent, decorators: [{
567
+ type: Component,
568
+ 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:auto;display:flex;pointer-events:all}:host div{flex:auto;display:flex}\n"] }]
569
+ }], propDecorators: { _direction: [{
570
+ type: HostBinding,
571
+ args: ['style.flex-direction']
572
+ }], _style: [{
573
+ type: HostBinding,
574
+ args: ['style']
575
+ }], leaveOneItem: [{
576
+ type: Output
577
+ }], itemHosts: [{
578
+ type: ViewChildren,
579
+ args: [BoxItemHostDirective]
580
+ }] } });
170
581
 
171
- class ModalModule {
582
+ class BoxContainerComponent {
583
+ constructor() {
584
+ this.editMode = false;
585
+ this.config = {
586
+ direction: 'row',
587
+ list: [{ type: 'blank', style: {} }]
588
+ };
589
+ }
590
+ ngOnInit() {
591
+ var _a;
592
+ const boxItemComponentRef = this.boxContainerContent.createComponent(BoxItemComponent);
593
+ const instance = boxItemComponentRef.instance;
594
+ instance.editMode = this.editMode;
595
+ instance.config = this.config;
596
+ instance.control = this.control;
597
+ (_a = instance.leaveOneItem) === null || _a === void 0 ? void 0 : _a.subscribe((item) => {
598
+ if (item.type === 'item') {
599
+ Object.assign(instance.config, item);
600
+ }
601
+ else {
602
+ instance.config.direction = 'row';
603
+ }
604
+ instance.load();
605
+ });
606
+ }
607
+ }
608
+ BoxContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: BoxContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
609
+ BoxContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: BoxContainerComponent, selector: "rs-box-container", inputs: { editMode: "editMode", config: "config", control: "control" }, 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:auto;position:relative;display:flex;overflow:auto}\n"] });
610
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: BoxContainerComponent, decorators: [{
611
+ type: Component,
612
+ args: [{ selector: 'rs-box-container', template: "<ng-container #boxContainerContent></ng-container>\n", styles: [":host{flex:auto;position:relative;display:flex;overflow:auto}\n"] }]
613
+ }], propDecorators: { editMode: [{
614
+ type: Input
615
+ }], config: [{
616
+ type: Input
617
+ }], control: [{
618
+ type: Input
619
+ }], boxContainerContent: [{
620
+ type: ViewChild,
621
+ args: ['boxContainerContent', { static: true, read: ViewContainerRef }]
622
+ }] } });
623
+
624
+ class BoxContainerModule {
172
625
  }
173
- ModalModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: ModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
174
- ModalModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.0", ngImport: i0, type: ModalModule, declarations: [ModalComponent], imports: [CommonModule] });
175
- ModalModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: ModalModule, imports: [CommonModule] });
176
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: ModalModule, decorators: [{
626
+ BoxContainerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: BoxContainerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
627
+ BoxContainerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: BoxContainerModule, declarations: [BoxContainerComponent,
628
+ BoxItemHostDirective,
629
+ BoxItemComponent,
630
+ PluginActiveComponent,
631
+ DividerComponent,
632
+ DividerLineComponent,
633
+ PluginHoverComponent,
634
+ ItemConfigComponent,
635
+ ItemStyleComponent,
636
+ StyleBlankComponent,
637
+ ItemBlankComponent,
638
+ StyleComponent], imports: [CommonModule,
639
+ DevUIModule,
640
+ FormsModule], exports: [BoxContainerComponent,
641
+ ItemConfigComponent,
642
+ ItemStyleComponent] });
643
+ BoxContainerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: BoxContainerModule, imports: [CommonModule,
644
+ DevUIModule,
645
+ FormsModule] });
646
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: BoxContainerModule, decorators: [{
177
647
  type: NgModule,
178
648
  args: [{
179
649
  declarations: [
180
- ModalComponent
650
+ BoxContainerComponent,
651
+ BoxItemHostDirective,
652
+ BoxItemComponent,
653
+ PluginActiveComponent,
654
+ DividerComponent,
655
+ DividerLineComponent,
656
+ PluginHoverComponent,
657
+ ItemConfigComponent,
658
+ ItemStyleComponent,
659
+ StyleBlankComponent,
660
+ ItemBlankComponent,
661
+ StyleComponent
181
662
  ],
182
663
  imports: [
183
- CommonModule
664
+ CommonModule,
665
+ DevUIModule,
666
+ FormsModule
184
667
  ],
185
- exports: []
668
+ exports: [
669
+ BoxContainerComponent,
670
+ ItemConfigComponent,
671
+ ItemStyleComponent
672
+ ]
186
673
  }]
187
674
  }] });
188
675
 
@@ -224,10 +711,12 @@ class DataGridComponent {
224
711
  };
225
712
  }
226
713
  ngOnInit() {
227
- this.load();
714
+ this.reload();
228
715
  }
229
- load() {
230
- this.service.getMetadata(this.tenant, this.className, this.view || '').subscribe((response) => {
716
+ reload() {
717
+ var _a;
718
+ (_a = this.dxDataGrid.instance) === null || _a === void 0 ? void 0 : _a.state(null);
719
+ this.service.getMetadataByView(this.tenant, this.className, this.view || '').subscribe((response) => {
231
720
  this.columns = [];
232
721
  for (let column of response.data.columns) {
233
722
  if (column.type === 'NORMAL') {
@@ -291,11 +780,11 @@ class DataGridComponent {
291
780
  });
292
781
  }
293
782
  }
294
- DataGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: DataGridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
295
- DataGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.0", type: DataGridComponent, selector: "rs-data-grid", inputs: { tenant: "tenant", className: "className", view: "view", filter: "filter", service: "service" }, ngImport: i0, template: "<dx-data-grid [dataSource]=\"dataSource\"\n [columns]=\"columns\"\n [showBorders]=\"true\"\n [showColumnLines]=\"true\"\n [showRowLines]=\"true\"\n [hoverStateEnabled]=\"true\"\n [rowAlternationEnabled]=\"true\"\n [columnAutoWidth]=\"true\"\n [allowColumnResizing]=\"true\"\n columnResizingMode=\"widget\"\n dateSerializationFormat=\"yyyy/MM/dd HH:mm:ss\"\n>\n <dxo-sorting mode=\"multiple\"></dxo-sorting>\n <dxo-selection mode=\"multiple\" selectAllMode=\"page\"></dxo-selection>\n <dxo-filter-row [visible]=\"true\"></dxo-filter-row>\n <dxo-remote-operations [filtering]=\"true\"\n [sorting]=\"true\"\n [paging]=\"true\">\n </dxo-remote-operations>\n <dxo-paging [pageSize]=\"15\"></dxo-paging>\n <dxo-pager [visible]=\"true\"\n [showInfo]=\"true\"\n infoText=\"\u7B2C{0}\u9875\uFF0C\u5171{1}\u9875\uFF08\u5171{2}\u4E2A\u9879\u76EE\uFF09\"\n [showPageSizeSelector]=\"true\"\n [allowedPageSizes]=\"[15, 30, 50]\"\n ></dxo-pager>\n <dxo-scrolling showScrollbar=\"always\"></dxo-scrolling>\n <dxo-export [allowExportSelectedData]=\"true\"\n [fileName]=\"className\"></dxo-export>\n <div *dxTemplate=\"let cellInfo of 'rowIndexTemplate'\">\n {{cellInfo.rowIndex + 1}}\n </div>\n</dx-data-grid>\n", styles: [""], dependencies: [{ kind: "directive", type: i1$1.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }, { kind: "component", type: i2.DxoExportComponent, selector: "dxo-export", inputs: ["backgroundColor", "enabled", "fileName", "formats", "margin", "printingEnabled", "svgToCanvas", "allowExportSelectedData", "texts"] }, { kind: "component", type: i3.DxDataGridComponent, selector: "dx-data-grid", inputs: ["accessKey", "activeStateEnabled", "allowColumnReordering", "allowColumnResizing", "autoNavigateToFocusedRow", "cacheEnabled", "cellHintEnabled", "columnAutoWidth", "columnChooser", "columnFixing", "columnHidingEnabled", "columnMinWidth", "columnResizingMode", "columns", "columnWidth", "customizeColumns", "dataRowTemplate", "dataSource", "dateSerializationFormat", "disabled", "editing", "elementAttr", "errorRowEnabled", "export", "filterBuilder", "filterBuilderPopup", "filterPanel", "filterRow", "filterSyncEnabled", "filterValue", "focusedColumnIndex", "focusedRowEnabled", "focusedRowIndex", "focusedRowKey", "grouping", "groupPanel", "headerFilter", "height", "highlightChanges", "hint", "hoverStateEnabled", "keyboardNavigation", "keyExpr", "loadPanel", "masterDetail", "noDataText", "pager", "paging", "remoteOperations", "renderAsync", "repaintChangesOnly", "rowAlternationEnabled", "rowDragging", "rowTemplate", "rtlEnabled", "scrolling", "searchPanel", "selectedRowKeys", "selection", "selectionFilter", "showBorders", "showColumnHeaders", "showColumnLines", "showRowLines", "sortByGroupSummaryInfo", "sorting", "stateStoring", "summary", "syncLookupFilterValues", "tabIndex", "toolbar", "twoWayBindingEnabled", "visible", "width", "wordWrapEnabled"], outputs: ["onAdaptiveDetailRowPreparing", "onCellClick", "onCellDblClick", "onCellHoverChanged", "onCellPrepared", "onContentReady", "onContextMenuPreparing", "onDataErrorOccurred", "onDisposing", "onEditCanceled", "onEditCanceling", "onEditingStart", "onEditorPrepared", "onEditorPreparing", "onExporting", "onFocusedCellChanged", "onFocusedCellChanging", "onFocusedRowChanged", "onFocusedRowChanging", "onInitialized", "onInitNewRow", "onKeyDown", "onOptionChanged", "onRowClick", "onRowCollapsed", "onRowCollapsing", "onRowDblClick", "onRowExpanded", "onRowExpanding", "onRowInserted", "onRowInserting", "onRowPrepared", "onRowRemoved", "onRowRemoving", "onRowUpdated", "onRowUpdating", "onRowValidating", "onSaved", "onSaving", "onSelectionChanged", "onToolbarPreparing", "accessKeyChange", "activeStateEnabledChange", "allowColumnReorderingChange", "allowColumnResizingChange", "autoNavigateToFocusedRowChange", "cacheEnabledChange", "cellHintEnabledChange", "columnAutoWidthChange", "columnChooserChange", "columnFixingChange", "columnHidingEnabledChange", "columnMinWidthChange", "columnResizingModeChange", "columnsChange", "columnWidthChange", "customizeColumnsChange", "dataRowTemplateChange", "dataSourceChange", "dateSerializationFormatChange", "disabledChange", "editingChange", "elementAttrChange", "errorRowEnabledChange", "exportChange", "filterBuilderChange", "filterBuilderPopupChange", "filterPanelChange", "filterRowChange", "filterSyncEnabledChange", "filterValueChange", "focusedColumnIndexChange", "focusedRowEnabledChange", "focusedRowIndexChange", "focusedRowKeyChange", "groupingChange", "groupPanelChange", "headerFilterChange", "heightChange", "highlightChangesChange", "hintChange", "hoverStateEnabledChange", "keyboardNavigationChange", "keyExprChange", "loadPanelChange", "masterDetailChange", "noDataTextChange", "pagerChange", "pagingChange", "remoteOperationsChange", "renderAsyncChange", "repaintChangesOnlyChange", "rowAlternationEnabledChange", "rowDraggingChange", "rowTemplateChange", "rtlEnabledChange", "scrollingChange", "searchPanelChange", "selectedRowKeysChange", "selectionChange", "selectionFilterChange", "showBordersChange", "showColumnHeadersChange", "showColumnLinesChange", "showRowLinesChange", "sortByGroupSummaryInfoChange", "sortingChange", "stateStoringChange", "summaryChange", "syncLookupFilterValuesChange", "tabIndexChange", "toolbarChange", "twoWayBindingEnabledChange", "visibleChange", "widthChange", "wordWrapEnabledChange"] }, { kind: "component", type: i2.DxoFilterRowComponent, selector: "dxo-filter-row", inputs: ["applyFilter", "applyFilterText", "betweenEndText", "betweenStartText", "operationDescriptions", "resetOperationText", "showAllText", "showOperationChooser", "visible"] }, { kind: "component", type: i2.DxoPagerComponent, selector: "dxo-pager", inputs: ["allowedPageSizes", "displayMode", "infoText", "label", "showInfo", "showNavigationButtons", "showPageSizeSelector", "visible"] }, { kind: "component", type: i2.DxoPagingComponent, selector: "dxo-paging", inputs: ["enabled", "pageIndex", "pageSize"], outputs: ["pageIndexChange", "pageSizeChange"] }, { kind: "component", type: i2.DxoRemoteOperationsComponent, selector: "dxo-remote-operations", inputs: ["filtering", "grouping", "groupPaging", "paging", "sorting", "summary"] }, { kind: "component", type: i2.DxoScrollingComponent, selector: "dxo-scrolling", inputs: ["columnRenderingMode", "mode", "preloadEnabled", "renderAsync", "rowRenderingMode", "scrollByContent", "scrollByThumb", "showScrollbar", "useNative"] }, { kind: "component", type: i2.DxoSelectionComponent, selector: "dxo-selection", inputs: ["allowSelectAll", "deferred", "mode", "selectAllMode", "showCheckBoxesMode", "recursive"] }, { kind: "component", type: i2.DxoSortingComponent, selector: "dxo-sorting", inputs: ["ascendingText", "clearText", "descendingText", "mode", "showSortIndexes"] }] });
296
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: DataGridComponent, decorators: [{
783
+ DataGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DataGridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
784
+ DataGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: DataGridComponent, selector: "rs-data-grid", inputs: { tenant: "tenant", className: "className", view: "view", filter: "filter", service: "service", height: "height" }, viewQueries: [{ propertyName: "dxDataGrid", first: true, predicate: DxDataGridComponent, descendants: true, static: true }], ngImport: i0, template: "<dx-data-grid [dataSource]=\"dataSource\"\n [columns]=\"columns\"\n [height]=\"height\"\n [showBorders]=\"true\"\n [showColumnLines]=\"true\"\n [showRowLines]=\"true\"\n [hoverStateEnabled]=\"true\"\n [rowAlternationEnabled]=\"true\"\n [columnAutoWidth]=\"true\"\n [allowColumnResizing]=\"true\"\n columnResizingMode=\"widget\"\n dateSerializationFormat=\"yyyy/MM/dd HH:mm:ss\"\n>\n <dxo-sorting mode=\"multiple\"></dxo-sorting>\n <dxo-selection mode=\"multiple\" selectAllMode=\"page\"></dxo-selection>\n <dxo-filter-row [visible]=\"true\"></dxo-filter-row>\n <dxo-remote-operations [filtering]=\"true\"\n [sorting]=\"true\"\n [paging]=\"true\">\n </dxo-remote-operations>\n <dxo-paging [pageSize]=\"15\"></dxo-paging>\n <dxo-pager [visible]=\"true\"\n [showInfo]=\"true\"\n infoText=\"\u7B2C{0}\u9875\uFF0C\u5171{1}\u9875\uFF08\u5171{2}\u4E2A\u9879\u76EE\uFF09\"\n [showPageSizeSelector]=\"true\"\n [allowedPageSizes]=\"[15, 30, 50]\"\n ></dxo-pager>\n <dxo-scrolling showScrollbar=\"always\"></dxo-scrolling>\n <dxo-export [allowExportSelectedData]=\"true\"\n [fileName]=\"className\"></dxo-export>\n <div *dxTemplate=\"let cellInfo of 'rowIndexTemplate'\">\n {{cellInfo.rowIndex + 1}}\n </div>\n</dx-data-grid>\n", styles: [""], dependencies: [{ kind: "component", type: i1$2.DxDataGridComponent, selector: "dx-data-grid", inputs: ["accessKey", "activeStateEnabled", "allowColumnReordering", "allowColumnResizing", "autoNavigateToFocusedRow", "cacheEnabled", "cellHintEnabled", "columnAutoWidth", "columnChooser", "columnFixing", "columnHidingEnabled", "columnMinWidth", "columnResizingMode", "columns", "columnWidth", "customizeColumns", "dataRowTemplate", "dataSource", "dateSerializationFormat", "disabled", "editing", "elementAttr", "errorRowEnabled", "export", "filterBuilder", "filterBuilderPopup", "filterPanel", "filterRow", "filterSyncEnabled", "filterValue", "focusedColumnIndex", "focusedRowEnabled", "focusedRowIndex", "focusedRowKey", "grouping", "groupPanel", "headerFilter", "height", "highlightChanges", "hint", "hoverStateEnabled", "keyboardNavigation", "keyExpr", "loadPanel", "masterDetail", "noDataText", "pager", "paging", "remoteOperations", "renderAsync", "repaintChangesOnly", "rowAlternationEnabled", "rowDragging", "rowTemplate", "rtlEnabled", "scrolling", "searchPanel", "selectedRowKeys", "selection", "selectionFilter", "showBorders", "showColumnHeaders", "showColumnLines", "showRowLines", "sortByGroupSummaryInfo", "sorting", "stateStoring", "summary", "syncLookupFilterValues", "tabIndex", "toolbar", "twoWayBindingEnabled", "visible", "width", "wordWrapEnabled"], outputs: ["onAdaptiveDetailRowPreparing", "onCellClick", "onCellDblClick", "onCellHoverChanged", "onCellPrepared", "onContentReady", "onContextMenuPreparing", "onDataErrorOccurred", "onDisposing", "onEditCanceled", "onEditCanceling", "onEditingStart", "onEditorPrepared", "onEditorPreparing", "onExporting", "onFocusedCellChanged", "onFocusedCellChanging", "onFocusedRowChanged", "onFocusedRowChanging", "onInitialized", "onInitNewRow", "onKeyDown", "onOptionChanged", "onRowClick", "onRowCollapsed", "onRowCollapsing", "onRowDblClick", "onRowExpanded", "onRowExpanding", "onRowInserted", "onRowInserting", "onRowPrepared", "onRowRemoved", "onRowRemoving", "onRowUpdated", "onRowUpdating", "onRowValidating", "onSaved", "onSaving", "onSelectionChanged", "onToolbarPreparing", "accessKeyChange", "activeStateEnabledChange", "allowColumnReorderingChange", "allowColumnResizingChange", "autoNavigateToFocusedRowChange", "cacheEnabledChange", "cellHintEnabledChange", "columnAutoWidthChange", "columnChooserChange", "columnFixingChange", "columnHidingEnabledChange", "columnMinWidthChange", "columnResizingModeChange", "columnsChange", "columnWidthChange", "customizeColumnsChange", "dataRowTemplateChange", "dataSourceChange", "dateSerializationFormatChange", "disabledChange", "editingChange", "elementAttrChange", "errorRowEnabledChange", "exportChange", "filterBuilderChange", "filterBuilderPopupChange", "filterPanelChange", "filterRowChange", "filterSyncEnabledChange", "filterValueChange", "focusedColumnIndexChange", "focusedRowEnabledChange", "focusedRowIndexChange", "focusedRowKeyChange", "groupingChange", "groupPanelChange", "headerFilterChange", "heightChange", "highlightChangesChange", "hintChange", "hoverStateEnabledChange", "keyboardNavigationChange", "keyExprChange", "loadPanelChange", "masterDetailChange", "noDataTextChange", "pagerChange", "pagingChange", "remoteOperationsChange", "renderAsyncChange", "repaintChangesOnlyChange", "rowAlternationEnabledChange", "rowDraggingChange", "rowTemplateChange", "rtlEnabledChange", "scrollingChange", "searchPanelChange", "selectedRowKeysChange", "selectionChange", "selectionFilterChange", "showBordersChange", "showColumnHeadersChange", "showColumnLinesChange", "showRowLinesChange", "sortByGroupSummaryInfoChange", "sortingChange", "stateStoringChange", "summaryChange", "syncLookupFilterValuesChange", "tabIndexChange", "toolbarChange", "twoWayBindingEnabledChange", "visibleChange", "widthChange", "wordWrapEnabledChange"] }, { kind: "component", type: i2$1.DxoExportComponent, selector: "dxo-export", inputs: ["backgroundColor", "enabled", "fileName", "formats", "margin", "printingEnabled", "svgToCanvas", "allowExportSelectedData", "texts"] }, { kind: "component", type: i2$1.DxoFilterRowComponent, selector: "dxo-filter-row", inputs: ["applyFilter", "applyFilterText", "betweenEndText", "betweenStartText", "operationDescriptions", "resetOperationText", "showAllText", "showOperationChooser", "visible"] }, { kind: "component", type: i2$1.DxoPagerComponent, selector: "dxo-pager", inputs: ["allowedPageSizes", "displayMode", "infoText", "label", "showInfo", "showNavigationButtons", "showPageSizeSelector", "visible"] }, { kind: "component", type: i2$1.DxoPagingComponent, selector: "dxo-paging", inputs: ["enabled", "pageIndex", "pageSize"], outputs: ["pageIndexChange", "pageSizeChange"] }, { kind: "component", type: i2$1.DxoRemoteOperationsComponent, selector: "dxo-remote-operations", inputs: ["filtering", "grouping", "groupPaging", "paging", "sorting", "summary"] }, { kind: "component", type: i2$1.DxoScrollingComponent, selector: "dxo-scrolling", inputs: ["columnRenderingMode", "mode", "preloadEnabled", "renderAsync", "rowRenderingMode", "scrollByContent", "scrollByThumb", "showScrollbar", "useNative"] }, { kind: "component", type: i2$1.DxoSelectionComponent, selector: "dxo-selection", inputs: ["allowSelectAll", "deferred", "mode", "selectAllMode", "showCheckBoxesMode", "recursive"] }, { kind: "component", type: i2$1.DxoSortingComponent, selector: "dxo-sorting", inputs: ["ascendingText", "clearText", "descendingText", "mode", "showSortIndexes"] }, { kind: "directive", type: i3$1.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }] });
785
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DataGridComponent, decorators: [{
297
786
  type: Component,
298
- args: [{ selector: 'rs-data-grid', template: "<dx-data-grid [dataSource]=\"dataSource\"\n [columns]=\"columns\"\n [showBorders]=\"true\"\n [showColumnLines]=\"true\"\n [showRowLines]=\"true\"\n [hoverStateEnabled]=\"true\"\n [rowAlternationEnabled]=\"true\"\n [columnAutoWidth]=\"true\"\n [allowColumnResizing]=\"true\"\n columnResizingMode=\"widget\"\n dateSerializationFormat=\"yyyy/MM/dd HH:mm:ss\"\n>\n <dxo-sorting mode=\"multiple\"></dxo-sorting>\n <dxo-selection mode=\"multiple\" selectAllMode=\"page\"></dxo-selection>\n <dxo-filter-row [visible]=\"true\"></dxo-filter-row>\n <dxo-remote-operations [filtering]=\"true\"\n [sorting]=\"true\"\n [paging]=\"true\">\n </dxo-remote-operations>\n <dxo-paging [pageSize]=\"15\"></dxo-paging>\n <dxo-pager [visible]=\"true\"\n [showInfo]=\"true\"\n infoText=\"\u7B2C{0}\u9875\uFF0C\u5171{1}\u9875\uFF08\u5171{2}\u4E2A\u9879\u76EE\uFF09\"\n [showPageSizeSelector]=\"true\"\n [allowedPageSizes]=\"[15, 30, 50]\"\n ></dxo-pager>\n <dxo-scrolling showScrollbar=\"always\"></dxo-scrolling>\n <dxo-export [allowExportSelectedData]=\"true\"\n [fileName]=\"className\"></dxo-export>\n <div *dxTemplate=\"let cellInfo of 'rowIndexTemplate'\">\n {{cellInfo.rowIndex + 1}}\n </div>\n</dx-data-grid>\n" }]
787
+ args: [{ selector: 'rs-data-grid', template: "<dx-data-grid [dataSource]=\"dataSource\"\n [columns]=\"columns\"\n [height]=\"height\"\n [showBorders]=\"true\"\n [showColumnLines]=\"true\"\n [showRowLines]=\"true\"\n [hoverStateEnabled]=\"true\"\n [rowAlternationEnabled]=\"true\"\n [columnAutoWidth]=\"true\"\n [allowColumnResizing]=\"true\"\n columnResizingMode=\"widget\"\n dateSerializationFormat=\"yyyy/MM/dd HH:mm:ss\"\n>\n <dxo-sorting mode=\"multiple\"></dxo-sorting>\n <dxo-selection mode=\"multiple\" selectAllMode=\"page\"></dxo-selection>\n <dxo-filter-row [visible]=\"true\"></dxo-filter-row>\n <dxo-remote-operations [filtering]=\"true\"\n [sorting]=\"true\"\n [paging]=\"true\">\n </dxo-remote-operations>\n <dxo-paging [pageSize]=\"15\"></dxo-paging>\n <dxo-pager [visible]=\"true\"\n [showInfo]=\"true\"\n infoText=\"\u7B2C{0}\u9875\uFF0C\u5171{1}\u9875\uFF08\u5171{2}\u4E2A\u9879\u76EE\uFF09\"\n [showPageSizeSelector]=\"true\"\n [allowedPageSizes]=\"[15, 30, 50]\"\n ></dxo-pager>\n <dxo-scrolling showScrollbar=\"always\"></dxo-scrolling>\n <dxo-export [allowExportSelectedData]=\"true\"\n [fileName]=\"className\"></dxo-export>\n <div *dxTemplate=\"let cellInfo of 'rowIndexTemplate'\">\n {{cellInfo.rowIndex + 1}}\n </div>\n</dx-data-grid>\n" }]
299
788
  }], propDecorators: { tenant: [{
300
789
  type: Input
301
790
  }], className: [{
@@ -306,16 +795,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImpor
306
795
  type: Input
307
796
  }], service: [{
308
797
  type: Input
798
+ }], height: [{
799
+ type: Input
800
+ }], dxDataGrid: [{
801
+ type: ViewChild,
802
+ args: [DxDataGridComponent, { static: true }]
309
803
  }] } });
310
804
 
311
805
  class DataGridModule {
312
806
  }
313
- DataGridModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: DataGridModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
314
- DataGridModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.0", ngImport: i0, type: DataGridModule, declarations: [DataGridComponent], imports: [CommonModule,
315
- DevExtremeModule], exports: [DataGridComponent] });
316
- DataGridModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: DataGridModule, imports: [CommonModule,
317
- DevExtremeModule] });
318
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: DataGridModule, decorators: [{
807
+ DataGridModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DataGridModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
808
+ DataGridModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: DataGridModule, declarations: [DataGridComponent], imports: [CommonModule,
809
+ DxDataGridModule], exports: [DataGridComponent] });
810
+ DataGridModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DataGridModule, imports: [CommonModule,
811
+ DxDataGridModule] });
812
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DataGridModule, decorators: [{
319
813
  type: NgModule,
320
814
  args: [{
321
815
  declarations: [
@@ -323,7 +817,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImpor
323
817
  ],
324
818
  imports: [
325
819
  CommonModule,
326
- DevExtremeModule
820
+ DxDataGridModule
327
821
  ],
328
822
  exports: [
329
823
  DataGridComponent
@@ -331,6 +825,262 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImpor
331
825
  }]
332
826
  }] });
333
827
 
828
+ class FormComponent {
829
+ constructor() {
830
+ this.layoutDirection = FormLayout.Vertical;
831
+ this.model = {};
832
+ this.items = [];
833
+ this.formGroup = new UntypedFormGroup({});
834
+ this.submitted = new EventEmitter();
835
+ }
836
+ ngOnInit() {
837
+ this.formGroup.valueChanges.subscribe(model => {
838
+ this.model = model;
839
+ });
840
+ this.service.getMetadataByTemplate(this.tenant, this.className, this.template || 'Test').subscribe((response) => {
841
+ this.config = JSON.parse(response.data.template);
842
+ this.items = ["modifier", "createTime", "modifyTime", "creator", "number"];
843
+ for (let item of this.items) {
844
+ this.formGroup.addControl(item, new UntypedFormControl(this.model[item]));
845
+ }
846
+ });
847
+ }
848
+ submit($event) {
849
+ console.log($event);
850
+ console.log(this.model);
851
+ }
852
+ }
853
+ FormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
854
+ FormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: FormComponent, selector: "rs-form", inputs: { tenant: "tenant", className: "className", template: "template", service: "service" }, outputs: { submitted: "submitted" }, viewQueries: [{ propertyName: "formSubmitter", first: true, predicate: ["formSubmitter"], descendants: true }], ngImport: i0, template: "<form dForm [formGroup]=\"formGroup\" [layout]=\"layoutDirection\" (dSubmit)=\"submit($event)\">\n <ng-container *ngIf=\"config && formGroup\">\n <rs-box-container [config]=\"config\" [control]=\"formGroup\"></rs-box-container>\n </ng-container>\n <button #formSubmitter dFormSubmit=\"click\"></button>\n</form>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$2.FormDirective, selector: "[dForm]", inputs: ["layout", "labelSize", "labelAlign", "dFeedbackType", "dHasFeedback"], outputs: ["dSubmit"], exportAs: ["dForm"] }, { kind: "directive", type: i2$2.DFormSubmitDirective, selector: "[dFormSubmit]", inputs: ["dFormSubmit", "dFormSubmitData"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: BoxContainerComponent, selector: "rs-box-container", inputs: ["editMode", "config", "control"] }] });
855
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormComponent, decorators: [{
856
+ type: Component,
857
+ args: [{ selector: 'rs-form', template: "<form dForm [formGroup]=\"formGroup\" [layout]=\"layoutDirection\" (dSubmit)=\"submit($event)\">\n <ng-container *ngIf=\"config && formGroup\">\n <rs-box-container [config]=\"config\" [control]=\"formGroup\"></rs-box-container>\n </ng-container>\n <button #formSubmitter dFormSubmit=\"click\"></button>\n</form>\n" }]
858
+ }], propDecorators: { tenant: [{
859
+ type: Input
860
+ }], className: [{
861
+ type: Input
862
+ }], template: [{
863
+ type: Input
864
+ }], service: [{
865
+ type: Input
866
+ }], formSubmitter: [{
867
+ type: ViewChild,
868
+ args: ['formSubmitter']
869
+ }], submitted: [{
870
+ type: Output
871
+ }] } });
872
+
873
+ class FormModule {
874
+ }
875
+ FormModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
876
+ FormModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: FormModule, declarations: [FormComponent], imports: [CommonModule,
877
+ DevUIModule,
878
+ FormsModule,
879
+ ReactiveFormsModule,
880
+ BoxContainerModule], exports: [FormComponent] });
881
+ FormModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormModule, imports: [CommonModule,
882
+ DevUIModule,
883
+ FormsModule,
884
+ ReactiveFormsModule,
885
+ BoxContainerModule] });
886
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormModule, decorators: [{
887
+ type: NgModule,
888
+ args: [{
889
+ declarations: [
890
+ FormComponent
891
+ ],
892
+ imports: [
893
+ CommonModule,
894
+ DevUIModule,
895
+ FormsModule,
896
+ ReactiveFormsModule,
897
+ BoxContainerModule
898
+ ],
899
+ exports: [
900
+ FormComponent
901
+ ]
902
+ }]
903
+ }] });
904
+
905
+ class ModalComponent {
906
+ constructor(elementRef) {
907
+ this.elementRef = elementRef;
908
+ this.size = 'default';
909
+ this._width = 480;
910
+ this.movable = false;
911
+ this.topStart = 0;
912
+ this.leftStart = 0;
913
+ }
914
+ ngOnInit() {
915
+ if (this.size === 'full') {
916
+ this.modalElementRef.nativeElement.style.top = '0px';
917
+ this.modalElementRef.nativeElement.style.right = '0px';
918
+ this.modalElementRef.nativeElement.style.bottom = '0px';
919
+ this.modalElementRef.nativeElement.style.left = '0px';
920
+ this.modalElementRef.nativeElement.style.margin = '2px';
921
+ this.modalElementRef.nativeElement.style.boxShadow = 'none';
922
+ }
923
+ else {
924
+ if (this.size === 'large') {
925
+ this._width = 960;
926
+ }
927
+ this.modalElementRef.nativeElement.style.width = this._width + 'px';
928
+ this.modalElementRef.nativeElement.style.top = '40px';
929
+ this.modalElementRef.nativeElement.style.left =
930
+ (this.elementRef.nativeElement.parentElement.offsetWidth - this.modalElementRef.nativeElement.offsetWidth) / 2 + 'px';
931
+ this.moveHandleEl = this.elementRef.nativeElement.querySelector('.modal-header');
932
+ this.moveHandleEl.style.cursor = 'move';
933
+ }
934
+ }
935
+ show() {
936
+ // 若存在多层模态框,仅保留最上层遮罩颜色,下层遮罩设置为透明
937
+ const parentElement = this.elementRef.nativeElement.parentElement;
938
+ const nodeName = this.elementRef.nativeElement.nodeName;
939
+ const modals = parentElement.querySelectorAll(nodeName);
940
+ for (let i = 0; i < modals.length; i++) {
941
+ if (i === modals.length - 1) {
942
+ modals[i].querySelector('.modal-backdrop').style.backgroundColor = 'rgba(37, 43, 58, 0.05)';
943
+ }
944
+ else {
945
+ modals[i].querySelector('.modal-backdrop').style.backgroundColor = 'rgba(37, 43, 58, 0)';
946
+ }
947
+ }
948
+ }
949
+ hide() {
950
+ // 在service中重写
951
+ }
952
+ ngOnDestroy() {
953
+ // 若存在多层模态框,下一层遮罩设置为不透明
954
+ const parentElement = this.elementRef.nativeElement.parentElement;
955
+ const nodeName = this.elementRef.nativeElement.nodeName;
956
+ const nextModal = parentElement.querySelector(nodeName + ':nth-last-child(2)');
957
+ if (nextModal) {
958
+ nextModal.querySelector('.modal-backdrop').style.backgroundColor = 'rgba(37, 43, 58, 0.05)';
959
+ }
960
+ }
961
+ resolveModalBackdropPosition() {
962
+ return {
963
+ "width": this.elementRef.nativeElement.parentElement.offsetWidth + 'px',
964
+ "height": this.elementRef.nativeElement.parentElement.offsetHeight + 'px',
965
+ "top": this.elementRef.nativeElement.parentElement.offsetTop + 'px',
966
+ "left": this.elementRef.nativeElement.parentElement.offsetLeft + 'px',
967
+ };
968
+ }
969
+ onMousedown($event) {
970
+ if ($event.button === 2 || !this.checkHandleTarget($event.target, this.moveHandleEl)) {
971
+ return;
972
+ }
973
+ this.movable = true;
974
+ this.topStart = $event.clientY - this.modalElementRef.nativeElement.style.top.replace('px', '');
975
+ this.leftStart = $event.clientX - this.modalElementRef.nativeElement.style.left.replace('px', '');
976
+ }
977
+ checkHandleTarget(target, element) {
978
+ if (!element) {
979
+ return false;
980
+ }
981
+ if (target === element) {
982
+ return true;
983
+ }
984
+ for (let child in element.children) {
985
+ if (Object.prototype.hasOwnProperty.call(element.children, child)) {
986
+ if (this.checkHandleTarget(target, element.children[child])) {
987
+ return true;
988
+ }
989
+ }
990
+ }
991
+ return false;
992
+ }
993
+ onMouseup() {
994
+ this.movable = false;
995
+ }
996
+ onMousemove($event) {
997
+ if (!this.movable) {
998
+ return;
999
+ }
1000
+ $event.stopPropagation();
1001
+ $event.preventDefault();
1002
+ const element = this.modalElementRef.nativeElement;
1003
+ let currentTop = $event.clientY - this.topStart;
1004
+ let currentLeft = $event.clientX - this.leftStart;
1005
+ currentTop = currentTop < 0 ? 0 : currentTop;
1006
+ const maxTop = element.parentElement.offsetHeight - element.offsetHeight;
1007
+ currentTop = currentTop > maxTop ? maxTop : currentTop;
1008
+ currentLeft = currentLeft < 0 ? 0 : currentLeft;
1009
+ const maxLeft = element.parentElement.offsetWidth - element.offsetWidth;
1010
+ currentLeft = currentLeft > maxLeft ? maxLeft : currentLeft;
1011
+ element.style.top = currentTop + 'px';
1012
+ element.style.left = currentLeft + 'px';
1013
+ }
1014
+ }
1015
+ ModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ModalComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1016
+ ModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: ModalComponent, selector: "rs-modal", inputs: { title: "title", size: "size", contentTemplate: "contentTemplate", contentTemplateContext: "contentTemplateContext" }, host: { listeners: { "document:mouseup": "onMouseup($event)", "document:mousemove": "onMousemove($event)" } }, viewQueries: [{ propertyName: "modalElementRef", first: true, predicate: ["modal"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"modal-backdrop\" [ngStyle]=\"resolveModalBackdropPosition()\">\n <div #modal class=\"modal\">\n <div class=\"modal-header\" (mousedown)=\"onMousedown($event)\">\n <div class=\"modal-title\">{{title}}</div>\n <i class=\"icon-close\" (click)=\"hide()\"></i>\n </div>\n <div class=\"modal-content\">\n <ng-template [ngTemplateOutlet]=\"contentTemplate\"\n [ngTemplateOutletContext]=\"{$implicit: contentTemplateContext}\"></ng-template>\n </div>\n </div>\n</div>\n", styles: [":host .modal-backdrop{position:absolute;inset:0;z-index:calc(var(--devui-z-index-modal, 1050) - 1)}:host .modal-backdrop .modal{position:absolute;top:0;left:0;z-index:var(--devui-z-index-modal, 1050);background-color:var(--devui-base-bg, #ffffff);border-radius:var(--devui-border-radius-card, 6px);box-shadow:var(--devui-shadow-length-fullscreen-overlay, 0 10px 24px 0) var(--devui-shadow, rgba(37, 43, 58, .24));display:flex;flex-flow:column nowrap}:host .modal-backdrop .modal .modal-header{flex:0 0 36px;border-bottom:1px solid var(--devui-dividing-line, #f2f2f3)}:host .modal-backdrop .modal .modal-header .modal-title{padding:12px 24px;font-size:var(--devui-font-size-card-title, 14px);font-weight:700}:host .modal-backdrop .modal .modal-header i{position:absolute;top:12px;right:12px;padding:4px;font-size:var(--devui-font-size-card-title, 14px)}:host .modal-backdrop .modal .modal-header i:hover{cursor:pointer;color:var(--devui-danger, #f66f6a);background-color:var(--devui-info-bg, #e9edfa)}:host .modal-backdrop .modal .modal-content{flex:auto;padding:24px;display:flex;flex-flow:column;font-size:var(--devui-font-size, 12px);color:var(--devui-aide-text, #71757f)}\n"], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
1017
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ModalComponent, decorators: [{
1018
+ type: Component,
1019
+ args: [{ selector: 'rs-modal', template: "<div class=\"modal-backdrop\" [ngStyle]=\"resolveModalBackdropPosition()\">\n <div #modal class=\"modal\">\n <div class=\"modal-header\" (mousedown)=\"onMousedown($event)\">\n <div class=\"modal-title\">{{title}}</div>\n <i class=\"icon-close\" (click)=\"hide()\"></i>\n </div>\n <div class=\"modal-content\">\n <ng-template [ngTemplateOutlet]=\"contentTemplate\"\n [ngTemplateOutletContext]=\"{$implicit: contentTemplateContext}\"></ng-template>\n </div>\n </div>\n</div>\n", styles: [":host .modal-backdrop{position:absolute;inset:0;z-index:calc(var(--devui-z-index-modal, 1050) - 1)}:host .modal-backdrop .modal{position:absolute;top:0;left:0;z-index:var(--devui-z-index-modal, 1050);background-color:var(--devui-base-bg, #ffffff);border-radius:var(--devui-border-radius-card, 6px);box-shadow:var(--devui-shadow-length-fullscreen-overlay, 0 10px 24px 0) var(--devui-shadow, rgba(37, 43, 58, .24));display:flex;flex-flow:column nowrap}:host .modal-backdrop .modal .modal-header{flex:0 0 36px;border-bottom:1px solid var(--devui-dividing-line, #f2f2f3)}:host .modal-backdrop .modal .modal-header .modal-title{padding:12px 24px;font-size:var(--devui-font-size-card-title, 14px);font-weight:700}:host .modal-backdrop .modal .modal-header i{position:absolute;top:12px;right:12px;padding:4px;font-size:var(--devui-font-size-card-title, 14px)}:host .modal-backdrop .modal .modal-header i:hover{cursor:pointer;color:var(--devui-danger, #f66f6a);background-color:var(--devui-info-bg, #e9edfa)}:host .modal-backdrop .modal .modal-content{flex:auto;padding:24px;display:flex;flex-flow:column;font-size:var(--devui-font-size, 12px);color:var(--devui-aide-text, #71757f)}\n"] }]
1020
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { title: [{
1021
+ type: Input
1022
+ }], size: [{
1023
+ type: Input
1024
+ }], modalElementRef: [{
1025
+ type: ViewChild,
1026
+ args: ['modal', { static: true }]
1027
+ }], contentTemplate: [{
1028
+ type: Input
1029
+ }], contentTemplateContext: [{
1030
+ type: Input
1031
+ }], onMouseup: [{
1032
+ type: HostListener,
1033
+ args: ['document:mouseup', ['$event']]
1034
+ }], onMousemove: [{
1035
+ type: HostListener,
1036
+ args: ['document:mousemove', ['$event']]
1037
+ }] } });
1038
+
1039
+ class ModalModule {
1040
+ }
1041
+ ModalModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1042
+ ModalModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: ModalModule, declarations: [ModalComponent], imports: [CommonModule], exports: [ModalComponent] });
1043
+ ModalModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ModalModule, imports: [CommonModule] });
1044
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ModalModule, decorators: [{
1045
+ type: NgModule,
1046
+ args: [{
1047
+ declarations: [
1048
+ ModalComponent
1049
+ ],
1050
+ imports: [
1051
+ CommonModule
1052
+ ],
1053
+ exports: [
1054
+ ModalComponent
1055
+ ]
1056
+ }]
1057
+ }] });
1058
+
1059
+ class ModalService {
1060
+ constructor() {
1061
+ }
1062
+ open(viewContainerRef, title, size = 'default', contentTemplate, contentTemplateContext) {
1063
+ const modalRef = viewContainerRef.createComponent(ModalComponent);
1064
+ modalRef.instance.hide = () => {
1065
+ modalRef.hostView.destroy();
1066
+ };
1067
+ modalRef.instance.title = title;
1068
+ modalRef.instance.contentTemplate = contentTemplate;
1069
+ modalRef.instance.size = size;
1070
+ modalRef.instance.contentTemplateContext = contentTemplateContext;
1071
+ modalRef.instance.show();
1072
+ return modalRef.instance;
1073
+ }
1074
+ }
1075
+ ModalService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ModalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1076
+ ModalService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ModalService, providedIn: 'root' });
1077
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ModalService, decorators: [{
1078
+ type: Injectable,
1079
+ args: [{
1080
+ providedIn: 'root'
1081
+ }]
1082
+ }], ctorParameters: function () { return []; } });
1083
+
334
1084
  /*
335
1085
  * Public API Surface of ngx-rs-ant
336
1086
  */
@@ -339,5 +1089,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImpor
339
1089
  * Generated bundle index. Do not edit.
340
1090
  */
341
1091
 
342
- export { DataGridComponent, DataGridModule, ModalModule, ModalService };
1092
+ export { BoxContainerComponent, BoxContainerModule, DataGridComponent, DataGridModule, FormComponent, FormModule, ItemConfigComponent, ItemStyleComponent, ModalComponent, ModalModule, ModalService, PluginManager };
343
1093
  //# sourceMappingURL=ngx-rs-ant.mjs.map