ngx-rs-ant 1.8.4 → 1.8.6
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 -1
- package/box-container/box-container.component.d.ts +1 -4
- package/box-container/box-item/item-config/item-config.component.d.ts +2 -2
- package/data-grid/data-grid.component.d.ts +0 -1
- package/data-grid/data-grid.service.d.ts +4 -1
- package/esm2020/box-container/PluginManager.mjs +28 -12
- package/esm2020/box-container/box-container.component.mjs +2 -8
- package/esm2020/box-container/box-item/item-config/item-config.component.mjs +4 -4
- package/esm2020/data-grid/cell-component-template/cell-component-template.component.mjs +5 -2
- package/esm2020/data-grid/data-grid.component.mjs +5 -21
- package/esm2020/data-grid/data-grid.factory.mjs +2 -27
- package/esm2020/data-grid/data-grid.service.mjs +15 -4
- package/esm2020/form/form.component.mjs +6 -4
- package/esm2020/types/component/form-item-component-base.mjs +1 -1
- package/esm2020/types/config/form-item-config-base.mjs +1 -1
- package/fesm2015/ngx-rs-ant.mjs +246 -263
- package/fesm2015/ngx-rs-ant.mjs.map +1 -1
- package/fesm2020/ngx-rs-ant.mjs +237 -254
- package/fesm2020/ngx-rs-ant.mjs.map +1 -1
- package/package.json +1 -1
- package/types/component/form-item-component-base.d.ts +12 -0
- package/types/config/form-item-config-base.d.ts +8 -0
package/fesm2015/ngx-rs-ant.mjs
CHANGED
|
@@ -2,9 +2,11 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Component, Input, HostBinding, EventEmitter, Output, HostListener, ViewContainerRef, ViewChild, Directive, ViewChildren, NgModule, Injectable, ContentChild } from '@angular/core';
|
|
3
3
|
import { PluginFactory } from 'coast-plugin-register';
|
|
4
4
|
import * as i1 from '@angular/common';
|
|
5
|
-
import {
|
|
6
|
-
import { Subject, ReplaySubject, Subscription, map,
|
|
5
|
+
import { formatDate, CommonModule } from '@angular/common';
|
|
6
|
+
import { firstValueFrom, of, Subject, ReplaySubject, Subscription, map, lastValueFrom, debounceTime, interval } from 'rxjs';
|
|
7
7
|
import * as i2 from 'devextreme-angular/ui/number-box';
|
|
8
|
+
import { __awaiter } from 'tslib';
|
|
9
|
+
import notify from 'devextreme/ui/notify';
|
|
8
10
|
import * as i2$1 from 'devextreme-angular/ui/draggable';
|
|
9
11
|
import { DevExtremeModule, DxValidationGroupComponent, DxDataGridComponent } from 'devextreme-angular';
|
|
10
12
|
import BpmnModeler from 'camunda-bpmn-js/lib/camunda-platform/Modeler';
|
|
@@ -13,8 +15,6 @@ import { isLabel } from 'diagram-js/lib/util/ModelUtil';
|
|
|
13
15
|
import * as i3 from 'devextreme-angular/ui/button';
|
|
14
16
|
import Viewer from 'camunda-bpmn-js/lib/camunda-platform/NavigatedViewer';
|
|
15
17
|
import * as i1$1 from '@angular/common/http';
|
|
16
|
-
import { __awaiter } from 'tslib';
|
|
17
|
-
import notify from 'devextreme/ui/notify';
|
|
18
18
|
import CustomStore from 'devextreme/data/custom_store';
|
|
19
19
|
import * as i2$2 from 'devextreme-angular/core';
|
|
20
20
|
import * as i5 from 'devextreme-angular/ui/data-grid';
|
|
@@ -309,9 +309,193 @@ class FormItemComponentBase extends ComponentBase {
|
|
|
309
309
|
class ModalComponentBase extends ComponentBase {
|
|
310
310
|
}
|
|
311
311
|
|
|
312
|
+
function notify_error(message) {
|
|
313
|
+
_notify(message, 12000, 'warning');
|
|
314
|
+
}
|
|
315
|
+
function notify_warning(message) {
|
|
316
|
+
_notify(message, 8000, 'warning');
|
|
317
|
+
}
|
|
318
|
+
function notify_success(message) {
|
|
319
|
+
_notify(message, 4000, 'success');
|
|
320
|
+
}
|
|
321
|
+
function _notify(message, time, type) {
|
|
322
|
+
notify({
|
|
323
|
+
displayTime: time,
|
|
324
|
+
message,
|
|
325
|
+
type: type,
|
|
326
|
+
closeOnSwipe: false,
|
|
327
|
+
minWidth: 200,
|
|
328
|
+
maxWidth: 500,
|
|
329
|
+
wrapperAttr: { class: 'global-toast-message' }
|
|
330
|
+
}, {
|
|
331
|
+
direction: 'up-push',
|
|
332
|
+
position: 'bottom right'
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
function format_date(date, locale) {
|
|
336
|
+
return formatDate(date, 'yyyy/MM/dd', locale, 'GMT+8');
|
|
337
|
+
}
|
|
338
|
+
function format_datetime(date, locale) {
|
|
339
|
+
return formatDate(date, 'yyyy/MM/dd HH:mm:ss', locale, 'GMT+8');
|
|
340
|
+
}
|
|
341
|
+
function localeSortMethod(value1, value2) {
|
|
342
|
+
return value1.localeCompare(value2);
|
|
343
|
+
}
|
|
344
|
+
function file_type_icon(name) {
|
|
345
|
+
const type = name.substring(name.lastIndexOf('.') + 1).toLocaleLowerCase();
|
|
346
|
+
switch (type) {
|
|
347
|
+
case 'doc':
|
|
348
|
+
case 'docx':
|
|
349
|
+
return 'word';
|
|
350
|
+
case 'xls':
|
|
351
|
+
case 'xlsx':
|
|
352
|
+
case 'csv':
|
|
353
|
+
return 'excel';
|
|
354
|
+
case 'ppt':
|
|
355
|
+
case 'pptx':
|
|
356
|
+
return 'ppt';
|
|
357
|
+
case 'pdf':
|
|
358
|
+
return 'pdf';
|
|
359
|
+
case 'txt':
|
|
360
|
+
case 'xml':
|
|
361
|
+
case 'json':
|
|
362
|
+
case 'js':
|
|
363
|
+
return 'text';
|
|
364
|
+
case 'png':
|
|
365
|
+
case 'jpg':
|
|
366
|
+
case 'jpeg':
|
|
367
|
+
case 'gif':
|
|
368
|
+
case 'bmp':
|
|
369
|
+
return 'image';
|
|
370
|
+
case 'zip':
|
|
371
|
+
case 'rar':
|
|
372
|
+
case '7z':
|
|
373
|
+
case 'jar':
|
|
374
|
+
return 'zip';
|
|
375
|
+
default:
|
|
376
|
+
return 'unknown';
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
function support_preview_ext() {
|
|
380
|
+
return ['pdf', 'png', 'jpg', 'jpeg', 'gif', 'bmp', 'doc', 'docx', 'txt', 'xml', 'json', 'js', 'xls', 'xlsx', 'csv', 'ppt', 'pptx'];
|
|
381
|
+
}
|
|
382
|
+
function format_file_size(size) {
|
|
383
|
+
const labels = ['b', 'Kb', 'Mb', 'Gb'];
|
|
384
|
+
const count = labels.length - 1;
|
|
385
|
+
let i = 0;
|
|
386
|
+
while (i < count && size >= 1024) {
|
|
387
|
+
size /= 1024;
|
|
388
|
+
i++;
|
|
389
|
+
}
|
|
390
|
+
return Math.round(size * 100) / 100 + " " + labels[i];
|
|
391
|
+
}
|
|
392
|
+
function filename_from_disposition(disposition) {
|
|
393
|
+
const filenamePair = disposition.split(';').filter(str => /^filename=/.test(str.trim())).pop();
|
|
394
|
+
if (filenamePair) {
|
|
395
|
+
let str = filenamePair.trim();
|
|
396
|
+
str = str.split('=')[1];
|
|
397
|
+
str = str.replace(/['"]/g, '');
|
|
398
|
+
return decodeURIComponent(str);
|
|
399
|
+
}
|
|
400
|
+
else {
|
|
401
|
+
return null;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
function download_file(blob, filename, callback) {
|
|
405
|
+
const url = window.webkitURL.createObjectURL(blob);
|
|
406
|
+
const a = document.createElement('a');
|
|
407
|
+
document.body.appendChild(a);
|
|
408
|
+
a.setAttribute('style', 'display:none');
|
|
409
|
+
a.setAttribute('href', url);
|
|
410
|
+
a.setAttribute('download', decodeURIComponent(filename));
|
|
411
|
+
a.click();
|
|
412
|
+
setTimeout(() => {
|
|
413
|
+
if (callback) {
|
|
414
|
+
callback();
|
|
415
|
+
}
|
|
416
|
+
a.remove();
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
function validate(validator) {
|
|
420
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
421
|
+
return new Promise(resolve => {
|
|
422
|
+
var _a;
|
|
423
|
+
if (!validator) {
|
|
424
|
+
resolve(true);
|
|
425
|
+
}
|
|
426
|
+
const validateResult = validator.instance.validate();
|
|
427
|
+
if (!validateResult.isValid) {
|
|
428
|
+
resolve(false);
|
|
429
|
+
}
|
|
430
|
+
if (validateResult.status === 'pending') {
|
|
431
|
+
(_a = validateResult.complete) === null || _a === void 0 ? void 0 : _a.then((result) => {
|
|
432
|
+
if (result.isValid) {
|
|
433
|
+
resolve(true);
|
|
434
|
+
}
|
|
435
|
+
else {
|
|
436
|
+
resolve(false);
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
else {
|
|
441
|
+
resolve(true);
|
|
442
|
+
}
|
|
443
|
+
});
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
function validate_group(validationGroup) {
|
|
447
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
448
|
+
if (!validationGroup) {
|
|
449
|
+
return firstValueFrom(of(true));
|
|
450
|
+
}
|
|
451
|
+
const top = validationGroup.element.nativeElement;
|
|
452
|
+
let sourceNode;
|
|
453
|
+
const targetClassName = 'dx-field';
|
|
454
|
+
const findTargetNode = (node) => {
|
|
455
|
+
sourceNode = node;
|
|
456
|
+
while (true) {
|
|
457
|
+
if (node.classList.contains(targetClassName)) {
|
|
458
|
+
return node;
|
|
459
|
+
}
|
|
460
|
+
else {
|
|
461
|
+
node = node.parentElement;
|
|
462
|
+
if (node === top) {
|
|
463
|
+
return sourceNode;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
return new Promise(resolve => {
|
|
469
|
+
var _a, _b;
|
|
470
|
+
const validateResult = validationGroup.instance.validate();
|
|
471
|
+
if (!validateResult.isValid) {
|
|
472
|
+
const brokenElement = ((_a = validateResult.brokenRules) === null || _a === void 0 ? void 0 : _a[0]).validator.element();
|
|
473
|
+
findTargetNode(brokenElement).scrollIntoView();
|
|
474
|
+
resolve(false);
|
|
475
|
+
}
|
|
476
|
+
if (validateResult.status === 'pending') {
|
|
477
|
+
(_b = validateResult.complete) === null || _b === void 0 ? void 0 : _b.then((result) => {
|
|
478
|
+
var _a;
|
|
479
|
+
if (result.isValid) {
|
|
480
|
+
resolve(true);
|
|
481
|
+
}
|
|
482
|
+
else {
|
|
483
|
+
const brokenElement = ((_a = result.brokenRules) === null || _a === void 0 ? void 0 : _a[0]).validator.element();
|
|
484
|
+
findTargetNode(brokenElement).scrollIntoView();
|
|
485
|
+
resolve(false);
|
|
486
|
+
}
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
else {
|
|
490
|
+
resolve(true);
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
|
|
312
496
|
class PluginManager {
|
|
313
497
|
static createComponent(boxItem, index, style, config) {
|
|
314
|
-
var _a;
|
|
498
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
315
499
|
let plugin = PluginFactory.get(config.name);
|
|
316
500
|
if (!plugin) {
|
|
317
501
|
console.error('undefined plugin: ' + config.name);
|
|
@@ -328,27 +512,36 @@ class PluginManager {
|
|
|
328
512
|
Object.assign(instance, config.pluginConfig);
|
|
329
513
|
if (PluginFactory.hasType(plugin, 'page')) {
|
|
330
514
|
if (!(instance instanceof PageItemComponentBase)) {
|
|
331
|
-
console.
|
|
515
|
+
console.error('page item component need extending PageItemComponentBase, name: ' + config.name);
|
|
516
|
+
notify_error('加载页面组件失败:' + config.name);
|
|
517
|
+
return;
|
|
332
518
|
}
|
|
333
519
|
instance.editMode = boxItem.boxContainer.editMode;
|
|
334
|
-
instance.tabId = boxItem.boxContainer.
|
|
520
|
+
instance.tabId = (_b = boxItem.boxContainer.params) === null || _b === void 0 ? void 0 : _b.__tabId;
|
|
335
521
|
}
|
|
336
522
|
if (PluginFactory.hasType(plugin, 'form')) {
|
|
337
523
|
if (!(instance instanceof FormItemComponentBase)) {
|
|
338
|
-
console.
|
|
524
|
+
console.error('form item component need extending FormItemComponentBase, name: ' + config.name);
|
|
525
|
+
notify_error('加载表单组件失败:' + config.name);
|
|
526
|
+
return;
|
|
339
527
|
}
|
|
340
528
|
instance.editMode = boxItem.boxContainer.editMode;
|
|
341
|
-
instance.
|
|
342
|
-
instance.
|
|
529
|
+
instance.tenant = (_c = boxItem.boxContainer.params) === null || _c === void 0 ? void 0 : _c.__form.tenant;
|
|
530
|
+
instance.className = (_d = boxItem.boxContainer.params) === null || _d === void 0 ? void 0 : _d.__form.className;
|
|
531
|
+
instance.oid = (_e = boxItem.boxContainer.params) === null || _e === void 0 ? void 0 : _e.__form.oid;
|
|
532
|
+
instance.model = (_f = boxItem.boxContainer.params) === null || _f === void 0 ? void 0 : _f.__model;
|
|
533
|
+
instance.opener = (_g = boxItem.boxContainer.params) === null || _g === void 0 ? void 0 : _g.__opener;
|
|
343
534
|
if (boxItem.boxContainer.readonly) {
|
|
344
535
|
instance.readonly = true;
|
|
345
536
|
}
|
|
346
537
|
}
|
|
347
538
|
if (PluginFactory.hasType(plugin, 'modal')) {
|
|
348
539
|
if (!(instance instanceof ModalComponentBase)) {
|
|
349
|
-
console.
|
|
540
|
+
console.error('modal component need extending ModalComponentBase, name: ' + config.name);
|
|
541
|
+
notify_error('加载模窗组件失败:' + config.name);
|
|
542
|
+
return;
|
|
350
543
|
}
|
|
351
|
-
instance.opener = boxItem.boxContainer.
|
|
544
|
+
instance.opener = (_h = boxItem.boxContainer.params) === null || _h === void 0 ? void 0 : _h.__opener;
|
|
352
545
|
}
|
|
353
546
|
instance.params = boxItem.boxContainer.params;
|
|
354
547
|
instance.tabViewContainerRef = boxItem.boxContainer.tabViewContainerRef;
|
|
@@ -457,7 +650,7 @@ class PluginManager {
|
|
|
457
650
|
});
|
|
458
651
|
return activeComponentRef;
|
|
459
652
|
}
|
|
460
|
-
static resetItemConfig(itemConfigContainerRef, item,
|
|
653
|
+
static resetItemConfig(itemConfigContainerRef, item, params) {
|
|
461
654
|
var _a, _b;
|
|
462
655
|
itemConfigContainerRef.clear();
|
|
463
656
|
if (!item) {
|
|
@@ -471,14 +664,20 @@ class PluginManager {
|
|
|
471
664
|
const instance = componentRef.instance;
|
|
472
665
|
if (PluginFactory.hasType(plugin, 'page')) {
|
|
473
666
|
if (!(instance instanceof PageItemConfigBase)) {
|
|
474
|
-
console.
|
|
667
|
+
console.error('page item component config need extending PageItemConfigBase, name: ' + plugin.name);
|
|
668
|
+
notify_error('加载页面组件配置失败:' + plugin.name);
|
|
669
|
+
return;
|
|
475
670
|
}
|
|
476
671
|
}
|
|
477
672
|
if (PluginFactory.hasType(plugin, 'form')) {
|
|
478
673
|
if (!(instance instanceof FormItemConfigBase)) {
|
|
479
|
-
console.
|
|
674
|
+
console.error('form item component config need extending FormItemConfigBase, name: ' + plugin.name);
|
|
675
|
+
notify_error('加载表单组件配置失败:' + plugin.name);
|
|
676
|
+
return;
|
|
480
677
|
}
|
|
481
|
-
instance.
|
|
678
|
+
instance.tenant = params.tenant;
|
|
679
|
+
instance.className = params.className;
|
|
680
|
+
instance.fieldTree = params.fieldTree;
|
|
482
681
|
}
|
|
483
682
|
instance.config = item.config.pluginConfig;
|
|
484
683
|
instance.configChange.subscribe((reload) => {
|
|
@@ -522,18 +721,18 @@ class ItemConfigComponent {
|
|
|
522
721
|
if (data.id !== this.id) {
|
|
523
722
|
return;
|
|
524
723
|
}
|
|
525
|
-
PluginManager.resetItemConfig(this.itemConfigContainerRef, data.item, this.
|
|
724
|
+
PluginManager.resetItemConfig(this.itemConfigContainerRef, data.item, this.params);
|
|
526
725
|
});
|
|
527
726
|
}
|
|
528
727
|
}
|
|
529
728
|
ItemConfigComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ItemConfigComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
530
|
-
ItemConfigComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ItemConfigComponent, selector: "rs-item-config", inputs: { id: "id",
|
|
729
|
+
ItemConfigComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ItemConfigComponent, selector: "rs-item-config", inputs: { id: "id", params: "params" }, viewQueries: [{ propertyName: "itemConfigContainerRef", first: true, predicate: ["itemConfigContainerRef"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<ng-container #itemConfigContainerRef></ng-container>\n", styles: [""] });
|
|
531
730
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ItemConfigComponent, decorators: [{
|
|
532
731
|
type: Component,
|
|
533
732
|
args: [{ selector: 'rs-item-config', template: "<ng-container #itemConfigContainerRef></ng-container>\n" }]
|
|
534
733
|
}], propDecorators: { id: [{
|
|
535
734
|
type: Input
|
|
536
|
-
}],
|
|
735
|
+
}], params: [{
|
|
537
736
|
type: Input
|
|
538
737
|
}], itemConfigContainerRef: [{
|
|
539
738
|
type: ViewChild,
|
|
@@ -910,7 +1109,7 @@ class BoxContainerComponent {
|
|
|
910
1109
|
}
|
|
911
1110
|
}
|
|
912
1111
|
BoxContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BoxContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
913
|
-
BoxContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: BoxContainerComponent, selector: "rs-box-container", inputs: { id: "id", editMode: "editMode", config: "config",
|
|
1112
|
+
BoxContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: BoxContainerComponent, selector: "rs-box-container", inputs: { id: "id", editMode: "editMode", config: "config", params: "params", readonly: "readonly", tabViewContainerRef: "tabViewContainerRef" }, viewQueries: [{ propertyName: "boxContainerContent", first: true, predicate: ["boxContainerContent"], descendants: true, read: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container #boxContainerContent></ng-container>\n", styles: [":host{flex:1;position:relative;display:flex;flex-flow:row nowrap}\n"] });
|
|
914
1113
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BoxContainerComponent, decorators: [{
|
|
915
1114
|
type: Component,
|
|
916
1115
|
args: [{ selector: 'rs-box-container', template: "<ng-container #boxContainerContent></ng-container>\n", styles: [":host{flex:1;position:relative;display:flex;flex-flow:row nowrap}\n"] }]
|
|
@@ -920,16 +1119,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
920
1119
|
type: Input
|
|
921
1120
|
}], config: [{
|
|
922
1121
|
type: Input
|
|
923
|
-
}], model: [{
|
|
924
|
-
type: Input
|
|
925
|
-
}], opener: [{
|
|
926
|
-
type: Input
|
|
927
1122
|
}], params: [{
|
|
928
1123
|
type: Input
|
|
929
1124
|
}], readonly: [{
|
|
930
1125
|
type: Input
|
|
931
|
-
}], tabId: [{
|
|
932
|
-
type: Input
|
|
933
1126
|
}], tabViewContainerRef: [{
|
|
934
1127
|
type: Input
|
|
935
1128
|
}], boxContainerContent: [{
|
|
@@ -1766,9 +1959,20 @@ class DataGridService {
|
|
|
1766
1959
|
};
|
|
1767
1960
|
}));
|
|
1768
1961
|
}
|
|
1769
|
-
getConstraintEntries(name) {
|
|
1770
|
-
return this.http.get('api/metadata/constraint/' + name
|
|
1771
|
-
|
|
1962
|
+
getConstraintEntries(tenant, name) {
|
|
1963
|
+
return this.http.get('api/metadata/constraint/' + name, {
|
|
1964
|
+
params: {
|
|
1965
|
+
tenant
|
|
1966
|
+
}
|
|
1967
|
+
}).pipe(map(response => {
|
|
1968
|
+
const entries = [];
|
|
1969
|
+
for (let entry of response.data) {
|
|
1970
|
+
entries.push({
|
|
1971
|
+
store: entry.store,
|
|
1972
|
+
display: entry.enabled ? entry.display : entry.display + '(已禁用)'
|
|
1973
|
+
});
|
|
1974
|
+
}
|
|
1975
|
+
return entries;
|
|
1772
1976
|
}));
|
|
1773
1977
|
}
|
|
1774
1978
|
getUserColumnDataSource(tenant, className, view, field) {
|
|
@@ -1872,190 +2076,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1872
2076
|
}]
|
|
1873
2077
|
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
1874
2078
|
|
|
1875
|
-
function notify_error(message) {
|
|
1876
|
-
_notify(message, 12000, 'warning');
|
|
1877
|
-
}
|
|
1878
|
-
function notify_warning(message) {
|
|
1879
|
-
_notify(message, 8000, 'warning');
|
|
1880
|
-
}
|
|
1881
|
-
function notify_success(message) {
|
|
1882
|
-
_notify(message, 4000, 'success');
|
|
1883
|
-
}
|
|
1884
|
-
function _notify(message, time, type) {
|
|
1885
|
-
notify({
|
|
1886
|
-
displayTime: time,
|
|
1887
|
-
message,
|
|
1888
|
-
type: type,
|
|
1889
|
-
closeOnSwipe: false,
|
|
1890
|
-
minWidth: 200,
|
|
1891
|
-
maxWidth: 500,
|
|
1892
|
-
wrapperAttr: { class: 'global-toast-message' }
|
|
1893
|
-
}, {
|
|
1894
|
-
direction: 'up-push',
|
|
1895
|
-
position: 'bottom right'
|
|
1896
|
-
});
|
|
1897
|
-
}
|
|
1898
|
-
function format_date(date, locale) {
|
|
1899
|
-
return formatDate(date, 'yyyy/MM/dd', locale, 'GMT+8');
|
|
1900
|
-
}
|
|
1901
|
-
function format_datetime(date, locale) {
|
|
1902
|
-
return formatDate(date, 'yyyy/MM/dd HH:mm:ss', locale, 'GMT+8');
|
|
1903
|
-
}
|
|
1904
|
-
function localeSortMethod(value1, value2) {
|
|
1905
|
-
return value1.localeCompare(value2);
|
|
1906
|
-
}
|
|
1907
|
-
function file_type_icon(name) {
|
|
1908
|
-
const type = name.substring(name.lastIndexOf('.') + 1).toLocaleLowerCase();
|
|
1909
|
-
switch (type) {
|
|
1910
|
-
case 'doc':
|
|
1911
|
-
case 'docx':
|
|
1912
|
-
return 'word';
|
|
1913
|
-
case 'xls':
|
|
1914
|
-
case 'xlsx':
|
|
1915
|
-
case 'csv':
|
|
1916
|
-
return 'excel';
|
|
1917
|
-
case 'ppt':
|
|
1918
|
-
case 'pptx':
|
|
1919
|
-
return 'ppt';
|
|
1920
|
-
case 'pdf':
|
|
1921
|
-
return 'pdf';
|
|
1922
|
-
case 'txt':
|
|
1923
|
-
case 'xml':
|
|
1924
|
-
case 'json':
|
|
1925
|
-
case 'js':
|
|
1926
|
-
return 'text';
|
|
1927
|
-
case 'png':
|
|
1928
|
-
case 'jpg':
|
|
1929
|
-
case 'jpeg':
|
|
1930
|
-
case 'gif':
|
|
1931
|
-
case 'bmp':
|
|
1932
|
-
return 'image';
|
|
1933
|
-
case 'zip':
|
|
1934
|
-
case 'rar':
|
|
1935
|
-
case '7z':
|
|
1936
|
-
case 'jar':
|
|
1937
|
-
return 'zip';
|
|
1938
|
-
default:
|
|
1939
|
-
return 'unknown';
|
|
1940
|
-
}
|
|
1941
|
-
}
|
|
1942
|
-
function support_preview_ext() {
|
|
1943
|
-
return ['pdf', 'png', 'jpg', 'jpeg', 'gif', 'bmp', 'doc', 'docx', 'txt', 'xml', 'json', 'js', 'xls', 'xlsx', 'csv', 'ppt', 'pptx'];
|
|
1944
|
-
}
|
|
1945
|
-
function format_file_size(size) {
|
|
1946
|
-
const labels = ['b', 'Kb', 'Mb', 'Gb'];
|
|
1947
|
-
const count = labels.length - 1;
|
|
1948
|
-
let i = 0;
|
|
1949
|
-
while (i < count && size >= 1024) {
|
|
1950
|
-
size /= 1024;
|
|
1951
|
-
i++;
|
|
1952
|
-
}
|
|
1953
|
-
return Math.round(size * 100) / 100 + " " + labels[i];
|
|
1954
|
-
}
|
|
1955
|
-
function filename_from_disposition(disposition) {
|
|
1956
|
-
const filenamePair = disposition.split(';').filter(str => /^filename=/.test(str.trim())).pop();
|
|
1957
|
-
if (filenamePair) {
|
|
1958
|
-
let str = filenamePair.trim();
|
|
1959
|
-
str = str.split('=')[1];
|
|
1960
|
-
str = str.replace(/['"]/g, '');
|
|
1961
|
-
return decodeURIComponent(str);
|
|
1962
|
-
}
|
|
1963
|
-
else {
|
|
1964
|
-
return null;
|
|
1965
|
-
}
|
|
1966
|
-
}
|
|
1967
|
-
function download_file(blob, filename, callback) {
|
|
1968
|
-
const url = window.webkitURL.createObjectURL(blob);
|
|
1969
|
-
const a = document.createElement('a');
|
|
1970
|
-
document.body.appendChild(a);
|
|
1971
|
-
a.setAttribute('style', 'display:none');
|
|
1972
|
-
a.setAttribute('href', url);
|
|
1973
|
-
a.setAttribute('download', decodeURIComponent(filename));
|
|
1974
|
-
a.click();
|
|
1975
|
-
setTimeout(() => {
|
|
1976
|
-
if (callback) {
|
|
1977
|
-
callback();
|
|
1978
|
-
}
|
|
1979
|
-
a.remove();
|
|
1980
|
-
});
|
|
1981
|
-
}
|
|
1982
|
-
function validate(validator) {
|
|
1983
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1984
|
-
return new Promise(resolve => {
|
|
1985
|
-
var _a;
|
|
1986
|
-
if (!validator) {
|
|
1987
|
-
resolve(true);
|
|
1988
|
-
}
|
|
1989
|
-
const validateResult = validator.instance.validate();
|
|
1990
|
-
if (!validateResult.isValid) {
|
|
1991
|
-
resolve(false);
|
|
1992
|
-
}
|
|
1993
|
-
if (validateResult.status === 'pending') {
|
|
1994
|
-
(_a = validateResult.complete) === null || _a === void 0 ? void 0 : _a.then((result) => {
|
|
1995
|
-
if (result.isValid) {
|
|
1996
|
-
resolve(true);
|
|
1997
|
-
}
|
|
1998
|
-
else {
|
|
1999
|
-
resolve(false);
|
|
2000
|
-
}
|
|
2001
|
-
});
|
|
2002
|
-
}
|
|
2003
|
-
else {
|
|
2004
|
-
resolve(true);
|
|
2005
|
-
}
|
|
2006
|
-
});
|
|
2007
|
-
});
|
|
2008
|
-
}
|
|
2009
|
-
function validate_group(validationGroup) {
|
|
2010
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
2011
|
-
if (!validationGroup) {
|
|
2012
|
-
return firstValueFrom(of(true));
|
|
2013
|
-
}
|
|
2014
|
-
const top = validationGroup.element.nativeElement;
|
|
2015
|
-
let sourceNode;
|
|
2016
|
-
const targetClassName = 'dx-field';
|
|
2017
|
-
const findTargetNode = (node) => {
|
|
2018
|
-
sourceNode = node;
|
|
2019
|
-
while (true) {
|
|
2020
|
-
if (node.classList.contains(targetClassName)) {
|
|
2021
|
-
return node;
|
|
2022
|
-
}
|
|
2023
|
-
else {
|
|
2024
|
-
node = node.parentElement;
|
|
2025
|
-
if (node === top) {
|
|
2026
|
-
return sourceNode;
|
|
2027
|
-
}
|
|
2028
|
-
}
|
|
2029
|
-
}
|
|
2030
|
-
};
|
|
2031
|
-
return new Promise(resolve => {
|
|
2032
|
-
var _a, _b;
|
|
2033
|
-
const validateResult = validationGroup.instance.validate();
|
|
2034
|
-
if (!validateResult.isValid) {
|
|
2035
|
-
const brokenElement = ((_a = validateResult.brokenRules) === null || _a === void 0 ? void 0 : _a[0]).validator.element();
|
|
2036
|
-
findTargetNode(brokenElement).scrollIntoView();
|
|
2037
|
-
resolve(false);
|
|
2038
|
-
}
|
|
2039
|
-
if (validateResult.status === 'pending') {
|
|
2040
|
-
(_b = validateResult.complete) === null || _b === void 0 ? void 0 : _b.then((result) => {
|
|
2041
|
-
var _a;
|
|
2042
|
-
if (result.isValid) {
|
|
2043
|
-
resolve(true);
|
|
2044
|
-
}
|
|
2045
|
-
else {
|
|
2046
|
-
const brokenElement = ((_a = result.brokenRules) === null || _a === void 0 ? void 0 : _a[0]).validator.element();
|
|
2047
|
-
findTargetNode(brokenElement).scrollIntoView();
|
|
2048
|
-
resolve(false);
|
|
2049
|
-
}
|
|
2050
|
-
});
|
|
2051
|
-
}
|
|
2052
|
-
else {
|
|
2053
|
-
resolve(true);
|
|
2054
|
-
}
|
|
2055
|
-
});
|
|
2056
|
-
});
|
|
2057
|
-
}
|
|
2058
|
-
|
|
2059
2079
|
class CustomTemplateDirective {
|
|
2060
2080
|
constructor(templateRef) {
|
|
2061
2081
|
this.templateRef = templateRef;
|
|
@@ -2117,7 +2137,6 @@ class DataGridFactory {
|
|
|
2117
2137
|
caption: field.caption,
|
|
2118
2138
|
dataType: 'string',
|
|
2119
2139
|
alignment: 'left',
|
|
2120
|
-
cssClass: 'cell-vertical-middle',
|
|
2121
2140
|
allowHeaderFiltering: true,
|
|
2122
2141
|
allowFiltering: true,
|
|
2123
2142
|
allowSorting: true,
|
|
@@ -2227,18 +2246,6 @@ class DataGridFactory {
|
|
|
2227
2246
|
};
|
|
2228
2247
|
if (field.config.constraint.multiple) {
|
|
2229
2248
|
column.allowFiltering = false;
|
|
2230
|
-
column.lookup = {
|
|
2231
|
-
dataSource: {
|
|
2232
|
-
store: new CustomStore({
|
|
2233
|
-
load: () => {
|
|
2234
|
-
return lastValueFrom(this.service.getUserColumnDataSource(tenant, className, view, field.name));
|
|
2235
|
-
}
|
|
2236
|
-
}),
|
|
2237
|
-
paginate: true
|
|
2238
|
-
},
|
|
2239
|
-
valueExpr: 'value',
|
|
2240
|
-
displayExpr: 'text'
|
|
2241
|
-
};
|
|
2242
2249
|
column.calculateFilterExpression = function (filterValue, selectedFilterOperation, target) {
|
|
2243
2250
|
if (this.defaultCalculateFilterExpression) {
|
|
2244
2251
|
if (!filterValue) {
|
|
@@ -2280,18 +2287,6 @@ class DataGridFactory {
|
|
|
2280
2287
|
};
|
|
2281
2288
|
if (field.config.constraint.multiple) {
|
|
2282
2289
|
column.allowFiltering = false;
|
|
2283
|
-
column.lookup = {
|
|
2284
|
-
dataSource: {
|
|
2285
|
-
store: new CustomStore({
|
|
2286
|
-
load: () => {
|
|
2287
|
-
return lastValueFrom(this.service.getUnitColumnDataSource(tenant, className, view, field.name));
|
|
2288
|
-
}
|
|
2289
|
-
}),
|
|
2290
|
-
paginate: true
|
|
2291
|
-
},
|
|
2292
|
-
valueExpr: 'value',
|
|
2293
|
-
displayExpr: 'text'
|
|
2294
|
-
};
|
|
2295
2290
|
column.calculateFilterExpression = function (filterValue, selectedFilterOperation, target) {
|
|
2296
2291
|
if (this.defaultCalculateFilterExpression) {
|
|
2297
2292
|
if (!filterValue) {
|
|
@@ -2332,7 +2327,7 @@ class DataGridFactory {
|
|
|
2332
2327
|
dataSource: {
|
|
2333
2328
|
store: new CustomStore({
|
|
2334
2329
|
load: () => {
|
|
2335
|
-
return lastValueFrom(this.service.getConstraintEntries(field.config.constraint.name));
|
|
2330
|
+
return lastValueFrom(this.service.getConstraintEntries(tenant, field.config.constraint.name));
|
|
2336
2331
|
}
|
|
2337
2332
|
}),
|
|
2338
2333
|
paginate: true
|
|
@@ -2583,7 +2578,9 @@ class FormComponent {
|
|
|
2583
2578
|
oid: this.oid,
|
|
2584
2579
|
copyOid: this.copyOid,
|
|
2585
2580
|
template: this.template
|
|
2586
|
-
}
|
|
2581
|
+
},
|
|
2582
|
+
__model: this.model,
|
|
2583
|
+
__opener: this
|
|
2587
2584
|
});
|
|
2588
2585
|
this.service.getFormTemplateConfig(this.tenant, this.className, this.template).subscribe(response => {
|
|
2589
2586
|
this.config = response.data.template;
|
|
@@ -2654,10 +2651,10 @@ class FormComponent {
|
|
|
2654
2651
|
}
|
|
2655
2652
|
}
|
|
2656
2653
|
FormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FormComponent, deps: [{ token: i0.ViewContainerRef }, { token: FormService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2657
|
-
FormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: FormComponent, selector: "rs-form", inputs: { tenant: "tenant", className: "className", oid: "oid", copyOid: "copyOid", template: "template", extraAttrMap: "extraAttrMap", opener: "opener", params: "params", tabViewContainerRef: "tabViewContainerRef", onlyFrontEnd: "onlyFrontEnd", model: "model", readonly: "readonly" }, outputs: { onDataLoaded: "onDataLoaded", submitCallback: "submitCallback" }, providers: [FormService], viewQueries: [{ propertyName: "validator", first: true, predicate: DxValidationGroupComponent, descendants: true }, { propertyName: "formSubmitter", first: true, predicate: ["formSubmitter"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<dx-load-panel [container]=\"viewContainerRef.element.nativeElement\" [showPane]=\"false\"\r\n [visible]=\"loading\">\r\n <dxo-position [of]=\"viewContainerRef.element.nativeElement\"></dxo-position>\r\n</dx-load-panel>\r\n<dx-validation-group *ngIf=\"!loading\">\r\n <rs-box-container [config]=\"config\"\r\n [
|
|
2654
|
+
FormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: FormComponent, selector: "rs-form", inputs: { tenant: "tenant", className: "className", oid: "oid", copyOid: "copyOid", template: "template", extraAttrMap: "extraAttrMap", opener: "opener", params: "params", tabViewContainerRef: "tabViewContainerRef", onlyFrontEnd: "onlyFrontEnd", model: "model", readonly: "readonly" }, outputs: { onDataLoaded: "onDataLoaded", submitCallback: "submitCallback" }, providers: [FormService], viewQueries: [{ propertyName: "validator", first: true, predicate: DxValidationGroupComponent, descendants: true }, { propertyName: "formSubmitter", first: true, predicate: ["formSubmitter"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<dx-load-panel [container]=\"viewContainerRef.element.nativeElement\" [showPane]=\"false\"\r\n [visible]=\"loading\">\r\n <dxo-position [of]=\"viewContainerRef.element.nativeElement\"></dxo-position>\r\n</dx-load-panel>\r\n<dx-validation-group *ngIf=\"!loading\">\r\n <rs-box-container [config]=\"config\"\r\n [params]=\"params\"\r\n [tabViewContainerRef]=\"tabViewContainerRef\"\r\n [readonly]=\"readonly\"></rs-box-container>\r\n <dx-text-box height=\"0\" style=\"border: none;\">\r\n <dx-validator>\r\n <dxi-validation-rule *ngIf=\"extraValidator\" type=\"async\"\r\n [validationCallback]=\"extraValidate\"></dxi-validation-rule>\r\n </dx-validator>\r\n </dx-text-box>\r\n <div *ngIf=\"extraValidateMessage\" class=\"dx-field\">\r\n <div class=\"dx-field-value\">\r\n <div class=\"dx-toast-error dx-toast-content\">\r\n <div class=\"dx-toast-message\">{{ extraValidateMessage }}</div>\r\n </div>\r\n </div>\r\n </div>\r\n <dx-button #formSubmitter [visible]=\"false\" (onClick)=\"submitForm()\"></dx-button>\r\n</dx-validation-group>\r\n", styles: [":host{padding:12px 24px 20px}:host dx-validation-group{display:flex;flex-flow:column nowrap}:host dx-validation-group .dx-field{top:16px}:host dx-validation-group .dx-field .dx-field-value .dx-toast-content{padding:4px 8px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: BoxContainerComponent, selector: "rs-box-container", inputs: ["id", "editMode", "config", "params", "readonly", "tabViewContainerRef"] }, { kind: "component", type: i6.DxoPositionComponent, selector: "dxo-position", inputs: ["at", "boundary", "boundaryOffset", "collision", "my", "of", "offset"] }, { kind: "component", type: i3.DxButtonComponent, selector: "dx-button", inputs: ["accessKey", "activeStateEnabled", "disabled", "elementAttr", "focusStateEnabled", "height", "hint", "hoverStateEnabled", "icon", "rtlEnabled", "stylingMode", "tabIndex", "template", "text", "type", "useSubmitBehavior", "validationGroup", "visible", "width"], outputs: ["onClick", "onContentReady", "onDisposing", "onInitialized", "onOptionChanged", "accessKeyChange", "activeStateEnabledChange", "disabledChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hintChange", "hoverStateEnabledChange", "iconChange", "rtlEnabledChange", "stylingModeChange", "tabIndexChange", "templateChange", "textChange", "typeChange", "useSubmitBehaviorChange", "validationGroupChange", "visibleChange", "widthChange"] }, { kind: "component", type: i6.DxiValidationRuleComponent, selector: "dxi-validation-rule", inputs: ["message", "trim", "type", "ignoreEmptyValue", "max", "min", "reevaluate", "validationCallback", "comparisonTarget", "comparisonType", "pattern"] }, { kind: "component", type: i6$1.DxLoadPanelComponent, selector: "dx-load-panel", inputs: ["animation", "closeOnOutsideClick", "container", "copyRootClassesToWrapper", "deferRendering", "delay", "elementAttr", "focusStateEnabled", "height", "hideOnOutsideClick", "hideOnParentScroll", "hint", "hoverStateEnabled", "indicatorSrc", "maxHeight", "maxWidth", "message", "minHeight", "minWidth", "position", "rtlEnabled", "shading", "shadingColor", "showIndicator", "showPane", "visible", "width", "wrapperAttr"], outputs: ["onContentReady", "onDisposing", "onHidden", "onHiding", "onInitialized", "onOptionChanged", "onShowing", "onShown", "animationChange", "closeOnOutsideClickChange", "containerChange", "copyRootClassesToWrapperChange", "deferRenderingChange", "delayChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hideOnOutsideClickChange", "hideOnParentScrollChange", "hintChange", "hoverStateEnabledChange", "indicatorSrcChange", "maxHeightChange", "maxWidthChange", "messageChange", "minHeightChange", "minWidthChange", "positionChange", "rtlEnabledChange", "shadingChange", "shadingColorChange", "showIndicatorChange", "showPaneChange", "visibleChange", "widthChange", "wrapperAttrChange"] }, { kind: "component", type: i7.DxTextBoxComponent, selector: "dx-text-box", inputs: ["accessKey", "activeStateEnabled", "buttons", "disabled", "elementAttr", "focusStateEnabled", "height", "hint", "hoverStateEnabled", "inputAttr", "isValid", "label", "labelMode", "mask", "maskChar", "maskInvalidMessage", "maskRules", "maxLength", "mode", "name", "placeholder", "readOnly", "rtlEnabled", "showClearButton", "showMaskMode", "spellcheck", "stylingMode", "tabIndex", "text", "useMaskedValue", "validationError", "validationErrors", "validationMessageMode", "validationMessagePosition", "validationStatus", "value", "valueChangeEvent", "visible", "width"], outputs: ["onChange", "onContentReady", "onCopy", "onCut", "onDisposing", "onEnterKey", "onFocusIn", "onFocusOut", "onInitialized", "onInput", "onKeyDown", "onKeyUp", "onOptionChanged", "onPaste", "onValueChanged", "accessKeyChange", "activeStateEnabledChange", "buttonsChange", "disabledChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hintChange", "hoverStateEnabledChange", "inputAttrChange", "isValidChange", "labelChange", "labelModeChange", "maskChange", "maskCharChange", "maskInvalidMessageChange", "maskRulesChange", "maxLengthChange", "modeChange", "nameChange", "placeholderChange", "readOnlyChange", "rtlEnabledChange", "showClearButtonChange", "showMaskModeChange", "spellcheckChange", "stylingModeChange", "tabIndexChange", "textChange", "useMaskedValueChange", "validationErrorChange", "validationErrorsChange", "validationMessageModeChange", "validationMessagePositionChange", "validationStatusChange", "valueChange", "valueChangeEventChange", "visibleChange", "widthChange", "onBlur"] }, { kind: "component", type: i8.DxValidationGroupComponent, selector: "dx-validation-group", inputs: ["elementAttr", "height", "width"], outputs: ["onDisposing", "onInitialized", "onOptionChanged", "elementAttrChange", "heightChange", "widthChange"] }, { kind: "component", type: i9.DxValidatorComponent, selector: "dx-validator", inputs: ["adapter", "elementAttr", "height", "name", "validationGroup", "validationRules", "width"], outputs: ["onDisposing", "onInitialized", "onOptionChanged", "onValidated", "adapterChange", "elementAttrChange", "heightChange", "nameChange", "validationGroupChange", "validationRulesChange", "widthChange"] }] });
|
|
2658
2655
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FormComponent, decorators: [{
|
|
2659
2656
|
type: Component,
|
|
2660
|
-
args: [{ selector: 'rs-form', providers: [FormService], template: "<dx-load-panel [container]=\"viewContainerRef.element.nativeElement\" [showPane]=\"false\"\r\n [visible]=\"loading\">\r\n <dxo-position [of]=\"viewContainerRef.element.nativeElement\"></dxo-position>\r\n</dx-load-panel>\r\n<dx-validation-group *ngIf=\"!loading\">\r\n <rs-box-container [config]=\"config\"\r\n [
|
|
2657
|
+
args: [{ selector: 'rs-form', providers: [FormService], template: "<dx-load-panel [container]=\"viewContainerRef.element.nativeElement\" [showPane]=\"false\"\r\n [visible]=\"loading\">\r\n <dxo-position [of]=\"viewContainerRef.element.nativeElement\"></dxo-position>\r\n</dx-load-panel>\r\n<dx-validation-group *ngIf=\"!loading\">\r\n <rs-box-container [config]=\"config\"\r\n [params]=\"params\"\r\n [tabViewContainerRef]=\"tabViewContainerRef\"\r\n [readonly]=\"readonly\"></rs-box-container>\r\n <dx-text-box height=\"0\" style=\"border: none;\">\r\n <dx-validator>\r\n <dxi-validation-rule *ngIf=\"extraValidator\" type=\"async\"\r\n [validationCallback]=\"extraValidate\"></dxi-validation-rule>\r\n </dx-validator>\r\n </dx-text-box>\r\n <div *ngIf=\"extraValidateMessage\" class=\"dx-field\">\r\n <div class=\"dx-field-value\">\r\n <div class=\"dx-toast-error dx-toast-content\">\r\n <div class=\"dx-toast-message\">{{ extraValidateMessage }}</div>\r\n </div>\r\n </div>\r\n </div>\r\n <dx-button #formSubmitter [visible]=\"false\" (onClick)=\"submitForm()\"></dx-button>\r\n</dx-validation-group>\r\n", styles: [":host{padding:12px 24px 20px}:host dx-validation-group{display:flex;flex-flow:column nowrap}:host dx-validation-group .dx-field{top:16px}:host dx-validation-group .dx-field .dx-field-value .dx-toast-content{padding:4px 8px}\n"] }]
|
|
2661
2658
|
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: FormService }, { type: i0.ElementRef }]; }, propDecorators: { tenant: [{
|
|
2662
2659
|
type: Input
|
|
2663
2660
|
}], className: [{
|
|
@@ -2875,7 +2872,9 @@ class CellComponentTemplateComponent {
|
|
|
2875
2872
|
const instance = componentRef.instance;
|
|
2876
2873
|
Object.assign(instance, cellComponentConfig);
|
|
2877
2874
|
if (!(instance instanceof CellComponentBase)) {
|
|
2878
|
-
console.
|
|
2875
|
+
console.error('cell component need extending CellComponentBase, name: ' + plugin.name);
|
|
2876
|
+
notify_error('加载单元格组件配置失败:' + plugin.name);
|
|
2877
|
+
return;
|
|
2879
2878
|
}
|
|
2880
2879
|
instance.field = this.cellInfo.column.dataField;
|
|
2881
2880
|
instance.fieldConfig = fieldConfig;
|
|
@@ -2938,22 +2937,20 @@ class DataGridComponent {
|
|
|
2938
2937
|
}
|
|
2939
2938
|
if (this.instanceLinkType === 'tab' || this.instanceLinkType === 'drawer') {
|
|
2940
2939
|
columns.unshift({
|
|
2941
|
-
fixed: true,
|
|
2942
2940
|
caption: '详情',
|
|
2941
|
+
fixed: true,
|
|
2943
2942
|
width: 48,
|
|
2944
|
-
cellTemplate: 'instanceLinkTemplate',
|
|
2945
2943
|
alignment: 'center',
|
|
2946
|
-
|
|
2944
|
+
cellTemplate: 'instanceLinkTemplate'
|
|
2947
2945
|
});
|
|
2948
2946
|
}
|
|
2949
2947
|
if (this.showRowNum) {
|
|
2950
2948
|
columns.unshift({
|
|
2951
|
-
fixed: true,
|
|
2952
2949
|
caption: '行号',
|
|
2950
|
+
fixed: true,
|
|
2953
2951
|
width: 48,
|
|
2954
|
-
cellTemplate: 'rowIndexTemplate',
|
|
2955
2952
|
alignment: 'center',
|
|
2956
|
-
|
|
2953
|
+
cellTemplate: 'rowIndexTemplate'
|
|
2957
2954
|
});
|
|
2958
2955
|
}
|
|
2959
2956
|
this.columns = columns;
|
|
@@ -2967,20 +2964,6 @@ class DataGridComponent {
|
|
|
2967
2964
|
this.dataSource = this.factory.makeDataGridDataSource(this.tenant, this.className, this.view, this.filter, this.keyExpr, this.dataGridName);
|
|
2968
2965
|
}
|
|
2969
2966
|
}
|
|
2970
|
-
getOriginalValue(cellInfo, key) {
|
|
2971
|
-
const config = cellInfo.column[key];
|
|
2972
|
-
if (config) {
|
|
2973
|
-
const value = cellInfo.data[config.field];
|
|
2974
|
-
if (value) {
|
|
2975
|
-
if (Array.isArray(value)) {
|
|
2976
|
-
return value;
|
|
2977
|
-
}
|
|
2978
|
-
return [value];
|
|
2979
|
-
}
|
|
2980
|
-
return [];
|
|
2981
|
-
}
|
|
2982
|
-
return cellInfo.data[key];
|
|
2983
|
-
}
|
|
2984
2967
|
getSelectedRowKeys() {
|
|
2985
2968
|
return this.dxDataGrid.instance.getSelectedRowKeys();
|
|
2986
2969
|
}
|