ngx-rs-ant 0.5.1 → 0.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/box-container/PluginManager.d.ts +1 -5
- package/box-container/box-container.component.d.ts +2 -1
- package/box-container/box-item/box-item.component.d.ts +1 -2
- package/esm2020/box-container/PluginManager.mjs +5 -12
- package/esm2020/box-container/box-container.component.mjs +5 -4
- package/esm2020/box-container/box-item/box-item.component.mjs +11 -13
- package/esm2020/box-container/box-item/item-config/item-config.component.mjs +2 -2
- package/esm2020/form/form.component.mjs +1 -1
- package/fesm2015/ngx-rs-ant.mjs +98 -104
- package/fesm2015/ngx-rs-ant.mjs.map +1 -1
- package/fesm2020/ngx-rs-ant.mjs +98 -104
- package/fesm2020/ngx-rs-ant.mjs.map +1 -1
- package/package.json +1 -1
package/fesm2020/ngx-rs-ant.mjs
CHANGED
|
@@ -172,86 +172,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
172
172
|
args: ['style']
|
|
173
173
|
}] } });
|
|
174
174
|
|
|
175
|
-
class StyleBlankComponent {
|
|
176
|
-
}
|
|
177
|
-
StyleBlankComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: StyleBlankComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
178
|
-
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"] });
|
|
179
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: StyleBlankComponent, decorators: [{
|
|
180
|
-
type: Component,
|
|
181
|
-
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"] }]
|
|
182
|
-
}] });
|
|
183
|
-
|
|
184
|
-
class StyleComponent {
|
|
185
|
-
ngOnInit() {
|
|
186
|
-
this.style.width = this.style.width ? this.style.width : 'auto';
|
|
187
|
-
this.style.height = this.style.height ? this.style.height : 'auto';
|
|
188
|
-
if (this.style.width !== 'auto') {
|
|
189
|
-
this.width = this.style.width.substring(0, this.style.width.length - 2);
|
|
190
|
-
}
|
|
191
|
-
if (this.style.height !== 'auto') {
|
|
192
|
-
this.height = this.style.height.substring(0, this.style.height.length - 2);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
select(name, value) {
|
|
196
|
-
const that = this;
|
|
197
|
-
if (value === 'auto') {
|
|
198
|
-
this.style[name] = 'auto';
|
|
199
|
-
}
|
|
200
|
-
else {
|
|
201
|
-
if (!that[name]) {
|
|
202
|
-
that[name] = value;
|
|
203
|
-
}
|
|
204
|
-
this.style[name] = that[name] + 'px';
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
typing(name, value) {
|
|
208
|
-
if (value) {
|
|
209
|
-
this.style[name] = value + 'px';
|
|
210
|
-
}
|
|
211
|
-
else {
|
|
212
|
-
this.style[name] = 'auto';
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
StyleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: StyleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
217
|
-
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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
218
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: StyleComponent, decorators: [{
|
|
219
|
-
type: Component,
|
|
220
|
-
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"] }]
|
|
221
|
-
}] });
|
|
222
|
-
|
|
223
|
-
class ItemStyleComponent {
|
|
224
|
-
constructor(changeDetectorRef) {
|
|
225
|
-
this.changeDetectorRef = changeDetectorRef;
|
|
226
|
-
}
|
|
227
|
-
ngOnInit() {
|
|
228
|
-
this.pageStyleContent.createComponent(StyleBlankComponent);
|
|
229
|
-
PluginManager.activeItem.subscribe(item => {
|
|
230
|
-
this.pageStyleContent.clear();
|
|
231
|
-
if (item) {
|
|
232
|
-
const componentRef = this.pageStyleContent.createComponent(StyleComponent);
|
|
233
|
-
const instance = componentRef.instance;
|
|
234
|
-
instance.style = item.style;
|
|
235
|
-
}
|
|
236
|
-
else {
|
|
237
|
-
this.pageStyleContent.createComponent(StyleBlankComponent);
|
|
238
|
-
this.changeDetectorRef.detectChanges();
|
|
239
|
-
}
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
ItemStyleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ItemStyleComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
244
|
-
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: [""] });
|
|
245
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ItemStyleComponent, decorators: [{
|
|
246
|
-
type: Component,
|
|
247
|
-
args: [{ selector: 'rs-item-style', template: "<ng-container #pageStyleContent></ng-container>\n" }]
|
|
248
|
-
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { pageStyleContent: [{
|
|
249
|
-
type: ViewChild,
|
|
250
|
-
args: ['pageStyleContent', { static: true, read: ViewContainerRef }]
|
|
251
|
-
}] } });
|
|
252
|
-
|
|
253
175
|
class PluginManager {
|
|
254
|
-
static createComponent(boxItem, index, style, config
|
|
176
|
+
static createComponent(boxItem, index, style, config) {
|
|
255
177
|
const plugin = PluginFactory.get(config.name);
|
|
256
178
|
if (!plugin) {
|
|
257
179
|
console.error('undefined plugin: ' + config.name);
|
|
@@ -263,9 +185,10 @@ class PluginManager {
|
|
|
263
185
|
const instance = componentRef.instance;
|
|
264
186
|
Object.assign(instance, config.pluginConfig);
|
|
265
187
|
if (plugin.category === 'form') {
|
|
266
|
-
instance.formGroup = formGroup;
|
|
188
|
+
instance.formGroup = boxItem.boxContainer.formGroup;
|
|
267
189
|
}
|
|
268
|
-
|
|
190
|
+
instance.tabViewContainerRef = boxItem.boxContainer.tabViewContainerRef;
|
|
191
|
+
if (boxItem.boxContainer.editMode) {
|
|
269
192
|
instance.onRemove = () => {
|
|
270
193
|
boxItem.config.list.splice(index, 1, { type: 'blank', style: boxItem.config.list[index].style });
|
|
271
194
|
boxItem.load();
|
|
@@ -330,12 +253,6 @@ class PluginManager {
|
|
|
330
253
|
});
|
|
331
254
|
return activeComponentRef;
|
|
332
255
|
}
|
|
333
|
-
static getItemConfigComponent() {
|
|
334
|
-
return ItemConfigComponent;
|
|
335
|
-
}
|
|
336
|
-
static getItemStyleComponent() {
|
|
337
|
-
return ItemStyleComponent;
|
|
338
|
-
}
|
|
339
256
|
}
|
|
340
257
|
PluginManager.hoverItems = [];
|
|
341
258
|
PluginManager.activeItem = new Subject();
|
|
@@ -356,7 +273,7 @@ class ItemConfigComponent {
|
|
|
356
273
|
const instance = componentRef.instance;
|
|
357
274
|
instance.config = item.config.pluginConfig;
|
|
358
275
|
instance.configChange.subscribe(() => {
|
|
359
|
-
const componentRef = PluginManager.createComponent(item.boxItem, item.index, item.style, item.config
|
|
276
|
+
const componentRef = PluginManager.createComponent(item.boxItem, item.index, item.style, item.config);
|
|
360
277
|
componentRef.location.nativeElement.click();
|
|
361
278
|
});
|
|
362
279
|
});
|
|
@@ -372,6 +289,84 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
372
289
|
args: ['pageConfigContent', { static: true, read: ViewContainerRef }]
|
|
373
290
|
}] } });
|
|
374
291
|
|
|
292
|
+
class StyleBlankComponent {
|
|
293
|
+
}
|
|
294
|
+
StyleBlankComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: StyleBlankComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
295
|
+
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"] });
|
|
296
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: StyleBlankComponent, decorators: [{
|
|
297
|
+
type: Component,
|
|
298
|
+
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"] }]
|
|
299
|
+
}] });
|
|
300
|
+
|
|
301
|
+
class StyleComponent {
|
|
302
|
+
ngOnInit() {
|
|
303
|
+
this.style.width = this.style.width ? this.style.width : 'auto';
|
|
304
|
+
this.style.height = this.style.height ? this.style.height : 'auto';
|
|
305
|
+
if (this.style.width !== 'auto') {
|
|
306
|
+
this.width = this.style.width.substring(0, this.style.width.length - 2);
|
|
307
|
+
}
|
|
308
|
+
if (this.style.height !== 'auto') {
|
|
309
|
+
this.height = this.style.height.substring(0, this.style.height.length - 2);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
select(name, value) {
|
|
313
|
+
const that = this;
|
|
314
|
+
if (value === 'auto') {
|
|
315
|
+
this.style[name] = 'auto';
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
if (!that[name]) {
|
|
319
|
+
that[name] = value;
|
|
320
|
+
}
|
|
321
|
+
this.style[name] = that[name] + 'px';
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
typing(name, value) {
|
|
325
|
+
if (value) {
|
|
326
|
+
this.style[name] = value + 'px';
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
this.style[name] = 'auto';
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
StyleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: StyleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
334
|
+
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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
335
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: StyleComponent, decorators: [{
|
|
336
|
+
type: Component,
|
|
337
|
+
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"] }]
|
|
338
|
+
}] });
|
|
339
|
+
|
|
340
|
+
class ItemStyleComponent {
|
|
341
|
+
constructor(changeDetectorRef) {
|
|
342
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
343
|
+
}
|
|
344
|
+
ngOnInit() {
|
|
345
|
+
this.pageStyleContent.createComponent(StyleBlankComponent);
|
|
346
|
+
PluginManager.activeItem.subscribe(item => {
|
|
347
|
+
this.pageStyleContent.clear();
|
|
348
|
+
if (item) {
|
|
349
|
+
const componentRef = this.pageStyleContent.createComponent(StyleComponent);
|
|
350
|
+
const instance = componentRef.instance;
|
|
351
|
+
instance.style = item.style;
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
this.pageStyleContent.createComponent(StyleBlankComponent);
|
|
355
|
+
this.changeDetectorRef.detectChanges();
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
ItemStyleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ItemStyleComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
361
|
+
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: [""] });
|
|
362
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ItemStyleComponent, decorators: [{
|
|
363
|
+
type: Component,
|
|
364
|
+
args: [{ selector: 'rs-item-style', template: "<ng-container #pageStyleContent></ng-container>\n" }]
|
|
365
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { pageStyleContent: [{
|
|
366
|
+
type: ViewChild,
|
|
367
|
+
args: ['pageStyleContent', { static: true, read: ViewContainerRef }]
|
|
368
|
+
}] } });
|
|
369
|
+
|
|
375
370
|
class BoxItemHostDirective {
|
|
376
371
|
constructor(el, viewContainerRef) {
|
|
377
372
|
this.el = el;
|
|
@@ -409,7 +404,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
409
404
|
|
|
410
405
|
class BoxItemComponent {
|
|
411
406
|
constructor() {
|
|
412
|
-
this.editMode = false;
|
|
413
407
|
this.style = {};
|
|
414
408
|
this.config = {};
|
|
415
409
|
this.leaveOneItem = new EventEmitter();
|
|
@@ -436,17 +430,16 @@ class BoxItemComponent {
|
|
|
436
430
|
const item = this.config.list[i];
|
|
437
431
|
switch (item.type) {
|
|
438
432
|
case 'plugin':
|
|
439
|
-
PluginManager.createComponent(this, i, item.style, item.config
|
|
433
|
+
PluginManager.createComponent(this, i, item.style, item.config);
|
|
440
434
|
break;
|
|
441
435
|
case 'item':
|
|
442
436
|
const boxItemComponentRef = itemHost.viewContainerRef.createComponent(BoxItemComponent);
|
|
443
437
|
const instance = boxItemComponentRef.instance;
|
|
444
|
-
instance.
|
|
438
|
+
instance.boxContainer = this.boxContainer;
|
|
445
439
|
instance.style = item.style;
|
|
446
440
|
instance.config = item.config;
|
|
447
|
-
instance.formGroup = this.formGroup;
|
|
448
441
|
instance.pDirection = this.config.direction;
|
|
449
|
-
if (this.editMode) {
|
|
442
|
+
if (this.boxContainer.editMode) {
|
|
450
443
|
instance.leaveOneItem.subscribe((item) => {
|
|
451
444
|
if (item.type === 'item' && item.direction === this.config.direction) {
|
|
452
445
|
this.config.list.splice(i, 1, ...item.list);
|
|
@@ -465,7 +458,7 @@ class BoxItemComponent {
|
|
|
465
458
|
break;
|
|
466
459
|
case 'blank':
|
|
467
460
|
default:
|
|
468
|
-
if (this.editMode) {
|
|
461
|
+
if (this.boxContainer.editMode) {
|
|
469
462
|
this.createBlankComponent(i);
|
|
470
463
|
}
|
|
471
464
|
break;
|
|
@@ -536,26 +529,26 @@ class BoxItemComponent {
|
|
|
536
529
|
return {
|
|
537
530
|
flex: width === 'auto' ? '1' : '0 0 ' + width,
|
|
538
531
|
height,
|
|
539
|
-
pointerEvents: this.editMode ? 'none' : 'all'
|
|
532
|
+
pointerEvents: this.boxContainer.editMode ? 'none' : 'all'
|
|
540
533
|
};
|
|
541
534
|
}
|
|
542
535
|
else if (direction === 'column') {
|
|
543
536
|
return {
|
|
544
537
|
width,
|
|
545
|
-
flex: height === 'auto' ? '
|
|
546
|
-
pointerEvents: this.editMode ? 'none' : 'all'
|
|
538
|
+
flex: height === 'auto' ? 'auto' : '0 0 ' + height,
|
|
539
|
+
pointerEvents: this.boxContainer.editMode ? 'none' : 'all'
|
|
547
540
|
};
|
|
548
541
|
}
|
|
549
542
|
return {
|
|
550
|
-
pointerEvents: this.editMode ? 'none' : 'all'
|
|
543
|
+
pointerEvents: this.boxContainer.editMode ? 'none' : 'all'
|
|
551
544
|
};
|
|
552
545
|
}
|
|
553
546
|
}
|
|
554
547
|
BoxItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: BoxItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
555
|
-
BoxItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: BoxItemComponent, selector: "rs-box-item", outputs: { leaveOneItem: "leaveOneItem" }, host: { properties: { "style.flex-direction": "this._direction", "style": "this._style" } }, viewQueries: [{ propertyName: "itemHosts", predicate: BoxItemHostDirective, descendants: true }], ngImport: i0, template: "<ng-container *ngFor=\"let item of config.list; index as index\">\n <div [ngStyle]=\"calcStyle(item)\">\n <ng-template rsBoxItemHost [hostId]=\"index\"></ng-template>\n </div>\n</ng-container>\n", styles: [":host{flex:
|
|
548
|
+
BoxItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: BoxItemComponent, selector: "rs-box-item", outputs: { leaveOneItem: "leaveOneItem" }, host: { properties: { "style.flex-direction": "this._direction", "style": "this._style" } }, viewQueries: [{ propertyName: "itemHosts", predicate: BoxItemHostDirective, descendants: true }], ngImport: i0, template: "<ng-container *ngFor=\"let item of config.list; index as index\">\n <div [ngStyle]=\"calcStyle(item)\">\n <ng-template rsBoxItemHost [hostId]=\"index\"></ng-template>\n </div>\n</ng-container>\n", styles: [":host{flex:1;display:flex;pointer-events:all;overflow:hidden}:host div{display:flex;overflow:hidden}\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"] }] });
|
|
556
549
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: BoxItemComponent, decorators: [{
|
|
557
550
|
type: Component,
|
|
558
|
-
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:
|
|
551
|
+
args: [{ selector: 'rs-box-item', template: "<ng-container *ngFor=\"let item of config.list; index as index\">\n <div [ngStyle]=\"calcStyle(item)\">\n <ng-template rsBoxItemHost [hostId]=\"index\"></ng-template>\n </div>\n</ng-container>\n", styles: [":host{flex:1;display:flex;pointer-events:all;overflow:hidden}:host div{display:flex;overflow:hidden}\n"] }]
|
|
559
552
|
}], propDecorators: { _direction: [{
|
|
560
553
|
type: HostBinding,
|
|
561
554
|
args: ['style.flex-direction']
|
|
@@ -580,9 +573,8 @@ class BoxContainerComponent {
|
|
|
580
573
|
ngOnInit() {
|
|
581
574
|
const boxItemComponentRef = this.boxContainerContent.createComponent(BoxItemComponent);
|
|
582
575
|
const instance = boxItemComponentRef.instance;
|
|
583
|
-
instance.
|
|
576
|
+
instance.boxContainer = this;
|
|
584
577
|
instance.config = this.config;
|
|
585
|
-
instance.formGroup = this.formGroup;
|
|
586
578
|
instance.leaveOneItem?.subscribe((item) => {
|
|
587
579
|
if (item.type === 'item') {
|
|
588
580
|
Object.assign(instance.config, item);
|
|
@@ -595,7 +587,7 @@ class BoxContainerComponent {
|
|
|
595
587
|
}
|
|
596
588
|
}
|
|
597
589
|
BoxContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: BoxContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
598
|
-
BoxContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: BoxContainerComponent, selector: "rs-box-container", inputs: { editMode: "editMode", config: "config", formGroup: "formGroup" }, 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"] });
|
|
590
|
+
BoxContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: BoxContainerComponent, selector: "rs-box-container", inputs: { editMode: "editMode", config: "config", formGroup: "formGroup", tabViewContainerRef: "tabViewContainerRef" }, viewQueries: [{ propertyName: "boxContainerContent", first: true, predicate: ["boxContainerContent"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<ng-container #boxContainerContent></ng-container>\n", styles: [":host{flex:auto;position:relative;display:flex;overflow:auto}\n"] });
|
|
599
591
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: BoxContainerComponent, decorators: [{
|
|
600
592
|
type: Component,
|
|
601
593
|
args: [{ selector: 'rs-box-container', template: "<ng-container #boxContainerContent></ng-container>\n", styles: [":host{flex:auto;position:relative;display:flex;overflow:auto}\n"] }]
|
|
@@ -605,6 +597,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
605
597
|
type: Input
|
|
606
598
|
}], formGroup: [{
|
|
607
599
|
type: Input
|
|
600
|
+
}], tabViewContainerRef: [{
|
|
601
|
+
type: Input
|
|
608
602
|
}], boxContainerContent: [{
|
|
609
603
|
type: ViewChild,
|
|
610
604
|
args: ['boxContainerContent', { static: true, read: ViewContainerRef }]
|
|
@@ -945,7 +939,7 @@ class FormComponent {
|
|
|
945
939
|
}
|
|
946
940
|
}
|
|
947
941
|
FormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormComponent, deps: [{ token: FormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
948
|
-
FormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: FormComponent, selector: "rs-form", inputs: { tenant: "tenant", className: "className", oid: "oid", copyOid: "copyOid", template: "template" }, outputs: { submitCallback: "submitCallback" }, providers: [FormService], viewQueries: [{ propertyName: "formSubmitter", first: true, predicate: ["formSubmitter"], descendants: true }], ngImport: i0, template: "<form dForm [formGroup]=\"formGroup\" [layout]=\"layoutDirection\" (dSubmit)=\"submit($event)\">\n <ng-container *ngIf=\"config\">\n <rs-box-container [config]=\"config\" [formGroup]=\"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: i3$1.FormDirective, selector: "[dForm]", inputs: ["layout", "labelSize", "labelAlign", "dFeedbackType", "dHasFeedback"], outputs: ["dSubmit"], exportAs: ["dForm"] }, { kind: "directive", type: i3$1.DFormSubmitDirective, selector: "[dFormSubmit]", inputs: ["dFormSubmit", "dFormSubmitData"] }, { kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: BoxContainerComponent, selector: "rs-box-container", inputs: ["editMode", "config", "formGroup"] }] });
|
|
942
|
+
FormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: FormComponent, selector: "rs-form", inputs: { tenant: "tenant", className: "className", oid: "oid", copyOid: "copyOid", template: "template" }, outputs: { submitCallback: "submitCallback" }, providers: [FormService], viewQueries: [{ propertyName: "formSubmitter", first: true, predicate: ["formSubmitter"], descendants: true }], ngImport: i0, template: "<form dForm [formGroup]=\"formGroup\" [layout]=\"layoutDirection\" (dSubmit)=\"submit($event)\">\n <ng-container *ngIf=\"config\">\n <rs-box-container [config]=\"config\" [formGroup]=\"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: i3$1.FormDirective, selector: "[dForm]", inputs: ["layout", "labelSize", "labelAlign", "dFeedbackType", "dHasFeedback"], outputs: ["dSubmit"], exportAs: ["dForm"] }, { kind: "directive", type: i3$1.DFormSubmitDirective, selector: "[dFormSubmit]", inputs: ["dFormSubmit", "dFormSubmitData"] }, { kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: BoxContainerComponent, selector: "rs-box-container", inputs: ["editMode", "config", "formGroup", "tabViewContainerRef"] }] });
|
|
949
943
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormComponent, decorators: [{
|
|
950
944
|
type: Component,
|
|
951
945
|
args: [{ selector: 'rs-form', providers: [FormService], template: "<form dForm [formGroup]=\"formGroup\" [layout]=\"layoutDirection\" (dSubmit)=\"submit($event)\">\n <ng-container *ngIf=\"config\">\n <rs-box-container [config]=\"config\" [formGroup]=\"formGroup\"></rs-box-container>\n </ng-container>\n <button #formSubmitter dFormSubmit=\"click\"></button>\n</form>\n" }]
|