ngx-rs-ant 1.9.5 → 1.9.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/esm2020/box-container/PluginManager.mjs +4 -32
- package/esm2020/data-grid/cell-component-template/cell-component-template.component.mjs +1 -8
- package/fesm2015/ngx-rs-ant.mjs +251 -279
- package/fesm2015/ngx-rs-ant.mjs.map +1 -1
- package/fesm2020/ngx-rs-ant.mjs +248 -276
- package/fesm2020/ngx-rs-ant.mjs.map +1 -1
- package/package.json +1 -1
package/fesm2015/ngx-rs-ant.mjs
CHANGED
|
@@ -2,11 +2,9 @@ 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 {
|
|
5
|
+
import { CommonModule, formatDate } from '@angular/common';
|
|
6
|
+
import { Subject, ReplaySubject, Subscription, map, firstValueFrom, of, lastValueFrom, debounceTime, interval } from 'rxjs';
|
|
7
7
|
import * as i2 from 'devextreme-angular/ui/number-box';
|
|
8
|
-
import notify from 'devextreme/ui/notify';
|
|
9
|
-
import validationEngine from 'devextreme/ui/validation_engine';
|
|
10
8
|
import * as i2$1 from 'devextreme-angular/ui/draggable';
|
|
11
9
|
import { DevExtremeModule, DxValidationGroupComponent, DxDataGridComponent } from 'devextreme-angular';
|
|
12
10
|
import BpmnModeler from 'camunda-bpmn-js/lib/camunda-platform/Modeler';
|
|
@@ -15,6 +13,8 @@ import { isLabel } from 'diagram-js/lib/util/ModelUtil';
|
|
|
15
13
|
import * as i3 from 'devextreme-angular/ui/button';
|
|
16
14
|
import Viewer from 'camunda-bpmn-js/lib/camunda-platform/NavigatedViewer';
|
|
17
15
|
import * as i1$1 from '@angular/common/http';
|
|
16
|
+
import notify from 'devextreme/ui/notify';
|
|
17
|
+
import validationEngine from 'devextreme/ui/validation_engine';
|
|
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';
|
|
@@ -252,248 +252,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
252
252
|
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;flex-flow:row nowrap;justify-content:center}:host div{flex:1;display:flex;flex-flow:row nowrap;justify-content:center;align-items:center}:host div span{text-align:center;-webkit-user-select:none;user-select:none}\n"] }]
|
|
253
253
|
}] });
|
|
254
254
|
|
|
255
|
-
class ConfigBase {
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
class FormItemConfigBase extends ConfigBase {
|
|
259
|
-
constructor() {
|
|
260
|
-
super(...arguments);
|
|
261
|
-
/**
|
|
262
|
-
* 配置更新事件,emit()将更新配置到组件,emit(true)将更新配置到组件并重新加载组件
|
|
263
|
-
*/
|
|
264
|
-
this.configChange = new EventEmitter();
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
class PageItemConfigBase extends ConfigBase {
|
|
269
|
-
constructor() {
|
|
270
|
-
super(...arguments);
|
|
271
|
-
/**
|
|
272
|
-
* 配置更新事件,emit()将更新配置到组件,emit(true)将更新配置到组件并重新加载组件
|
|
273
|
-
*/
|
|
274
|
-
this.configChange = new EventEmitter();
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
class ComponentBase {
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
class PageItemComponentBase extends ComponentBase {
|
|
282
|
-
constructor() {
|
|
283
|
-
super(...arguments);
|
|
284
|
-
/**
|
|
285
|
-
* 编辑模式,在设计器中为true,用于区分组件设计和应用状态
|
|
286
|
-
*/
|
|
287
|
-
this.editMode = false;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
class FormItemComponentBase extends ComponentBase {
|
|
292
|
-
constructor() {
|
|
293
|
-
super(...arguments);
|
|
294
|
-
/**
|
|
295
|
-
* 编辑模式,在设计器中为true,用于区分组件设计和应用状态
|
|
296
|
-
*/
|
|
297
|
-
this.editMode = false;
|
|
298
|
-
/**
|
|
299
|
-
* 表单只读状态,用于区分组件只读状态
|
|
300
|
-
*/
|
|
301
|
-
this.readonly = false;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
class ModalComponentBase extends ComponentBase {
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
function notify_error(message) {
|
|
309
|
-
_notify(message, 12000, 'warning');
|
|
310
|
-
}
|
|
311
|
-
function notify_warning(message) {
|
|
312
|
-
_notify(message, 8000, 'warning');
|
|
313
|
-
}
|
|
314
|
-
function notify_success(message) {
|
|
315
|
-
_notify(message, 4000, 'success');
|
|
316
|
-
}
|
|
317
|
-
function _notify(message, time, type) {
|
|
318
|
-
notify({
|
|
319
|
-
displayTime: time,
|
|
320
|
-
message,
|
|
321
|
-
type: type,
|
|
322
|
-
closeOnSwipe: false,
|
|
323
|
-
minWidth: 200,
|
|
324
|
-
maxWidth: 500,
|
|
325
|
-
wrapperAttr: { class: 'global-toast-message' }
|
|
326
|
-
}, {
|
|
327
|
-
direction: 'up-push',
|
|
328
|
-
position: 'bottom right'
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
function format_date(date, locale) {
|
|
332
|
-
return formatDate(date, 'yyyy/MM/dd', locale, 'GMT+8');
|
|
333
|
-
}
|
|
334
|
-
function format_datetime(date, locale) {
|
|
335
|
-
return formatDate(date, 'yyyy/MM/dd HH:mm:ss', locale, 'GMT+8');
|
|
336
|
-
}
|
|
337
|
-
function localeSortMethod(value1, value2) {
|
|
338
|
-
return value1.localeCompare(value2);
|
|
339
|
-
}
|
|
340
|
-
function file_type_icon(name) {
|
|
341
|
-
const type = name.substring(name.lastIndexOf('.') + 1).toLocaleLowerCase();
|
|
342
|
-
switch (type) {
|
|
343
|
-
case 'doc':
|
|
344
|
-
case 'docx':
|
|
345
|
-
return 'word';
|
|
346
|
-
case 'xls':
|
|
347
|
-
case 'xlsx':
|
|
348
|
-
case 'csv':
|
|
349
|
-
return 'excel';
|
|
350
|
-
case 'ppt':
|
|
351
|
-
case 'pptx':
|
|
352
|
-
return 'ppt';
|
|
353
|
-
case 'pdf':
|
|
354
|
-
return 'pdf';
|
|
355
|
-
case 'txt':
|
|
356
|
-
case 'xml':
|
|
357
|
-
case 'json':
|
|
358
|
-
case 'js':
|
|
359
|
-
return 'text';
|
|
360
|
-
case 'png':
|
|
361
|
-
case 'jpg':
|
|
362
|
-
case 'jpeg':
|
|
363
|
-
case 'gif':
|
|
364
|
-
case 'bmp':
|
|
365
|
-
return 'image';
|
|
366
|
-
case 'zip':
|
|
367
|
-
case 'rar':
|
|
368
|
-
case '7z':
|
|
369
|
-
case 'jar':
|
|
370
|
-
return 'zip';
|
|
371
|
-
default:
|
|
372
|
-
return 'unknown';
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
function support_preview_ext() {
|
|
376
|
-
return ['pdf', 'png', 'jpg', 'jpeg', 'gif', 'bmp', 'doc', 'docx', 'txt', 'xml', 'json', 'js', 'xls', 'xlsx', 'csv', 'ppt', 'pptx'];
|
|
377
|
-
}
|
|
378
|
-
function format_file_size(size) {
|
|
379
|
-
const labels = ['b', 'Kb', 'Mb', 'Gb'];
|
|
380
|
-
const count = labels.length - 1;
|
|
381
|
-
let i = 0;
|
|
382
|
-
while (i < count && size >= 1024) {
|
|
383
|
-
size /= 1024;
|
|
384
|
-
i++;
|
|
385
|
-
}
|
|
386
|
-
return Math.round(size * 100) / 100 + " " + labels[i];
|
|
387
|
-
}
|
|
388
|
-
function filename_from_disposition(disposition) {
|
|
389
|
-
const filenamePair = disposition.split(';').filter(str => /^filename=/.test(str.trim())).pop();
|
|
390
|
-
if (filenamePair) {
|
|
391
|
-
let str = filenamePair.trim();
|
|
392
|
-
str = str.split('=')[1];
|
|
393
|
-
str = str.replace(/['"]/g, '');
|
|
394
|
-
return decodeURIComponent(str);
|
|
395
|
-
}
|
|
396
|
-
else {
|
|
397
|
-
return null;
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
function download_file(blob, filename, callback) {
|
|
401
|
-
const url = window.webkitURL.createObjectURL(blob);
|
|
402
|
-
const a = document.createElement('a');
|
|
403
|
-
document.body.appendChild(a);
|
|
404
|
-
a.setAttribute('style', 'display:none');
|
|
405
|
-
a.setAttribute('href', url);
|
|
406
|
-
a.setAttribute('download', decodeURIComponent(filename));
|
|
407
|
-
a.click();
|
|
408
|
-
setTimeout(() => {
|
|
409
|
-
if (callback) {
|
|
410
|
-
callback();
|
|
411
|
-
}
|
|
412
|
-
a.remove();
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
function validate(validator) {
|
|
416
|
-
return new Promise(resolve => {
|
|
417
|
-
var _a;
|
|
418
|
-
if (!validator) {
|
|
419
|
-
resolve(true);
|
|
420
|
-
}
|
|
421
|
-
const validateResult = validator.instance.validate();
|
|
422
|
-
if (!validateResult.isValid) {
|
|
423
|
-
resolve(false);
|
|
424
|
-
}
|
|
425
|
-
if (validateResult.status === 'pending') {
|
|
426
|
-
(_a = validateResult.complete) === null || _a === void 0 ? void 0 : _a.then((result) => {
|
|
427
|
-
if (result.isValid) {
|
|
428
|
-
resolve(true);
|
|
429
|
-
}
|
|
430
|
-
else {
|
|
431
|
-
resolve(false);
|
|
432
|
-
}
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
else {
|
|
436
|
-
resolve(true);
|
|
437
|
-
}
|
|
438
|
-
});
|
|
439
|
-
}
|
|
440
|
-
function validate_group(validationGroupComponent) {
|
|
441
|
-
if (!validationGroupComponent) {
|
|
442
|
-
return firstValueFrom(of(true));
|
|
443
|
-
}
|
|
444
|
-
return validateGroup(validationGroupComponent.instance, validationGroupComponent.element.nativeElement);
|
|
445
|
-
}
|
|
446
|
-
function validate_group_by_name(name, brokenElementParent) {
|
|
447
|
-
const validationGroup = validationEngine.getGroupConfig(name);
|
|
448
|
-
if (!validationGroup) {
|
|
449
|
-
return firstValueFrom(of(true));
|
|
450
|
-
}
|
|
451
|
-
return validateGroup(validationGroup, brokenElementParent);
|
|
452
|
-
}
|
|
453
|
-
function validateGroup(validationGroup, brokenElementParent) {
|
|
454
|
-
let sourceNode;
|
|
455
|
-
const targetClassName = 'dx-field';
|
|
456
|
-
const findTargetNode = (node) => {
|
|
457
|
-
sourceNode = node;
|
|
458
|
-
while (true) {
|
|
459
|
-
if (node.classList.contains(targetClassName)) {
|
|
460
|
-
return node;
|
|
461
|
-
}
|
|
462
|
-
else {
|
|
463
|
-
node = node.parentElement;
|
|
464
|
-
if (node === brokenElementParent) {
|
|
465
|
-
return sourceNode;
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
};
|
|
470
|
-
return new Promise(resolve => {
|
|
471
|
-
var _a, _b;
|
|
472
|
-
const validateResult = validationGroup.validate();
|
|
473
|
-
if (!validateResult.isValid) {
|
|
474
|
-
const brokenElement = ((_a = validateResult.brokenRules) === null || _a === void 0 ? void 0 : _a[0]).validator.element();
|
|
475
|
-
findTargetNode(brokenElement).scrollIntoView();
|
|
476
|
-
resolve(false);
|
|
477
|
-
}
|
|
478
|
-
if (validateResult.status === 'pending') {
|
|
479
|
-
(_b = validateResult.complete) === null || _b === void 0 ? void 0 : _b.then((result) => {
|
|
480
|
-
var _a;
|
|
481
|
-
if (result.isValid) {
|
|
482
|
-
resolve(true);
|
|
483
|
-
}
|
|
484
|
-
else {
|
|
485
|
-
const brokenElement = ((_a = result.brokenRules) === null || _a === void 0 ? void 0 : _a[0]).validator.element();
|
|
486
|
-
findTargetNode(brokenElement).scrollIntoView();
|
|
487
|
-
resolve(false);
|
|
488
|
-
}
|
|
489
|
-
});
|
|
490
|
-
}
|
|
491
|
-
else {
|
|
492
|
-
resolve(true);
|
|
493
|
-
}
|
|
494
|
-
});
|
|
495
|
-
}
|
|
496
|
-
|
|
497
255
|
class PluginManager {
|
|
498
256
|
static createComponent(boxItem, index, style, config) {
|
|
499
257
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
@@ -512,20 +270,10 @@ class PluginManager {
|
|
|
512
270
|
const instance = componentRef.instance;
|
|
513
271
|
Object.assign(instance, config.pluginConfig);
|
|
514
272
|
if (PluginFactory.hasType(plugin, 'page')) {
|
|
515
|
-
if (!(instance instanceof PageItemComponentBase)) {
|
|
516
|
-
console.error('page item component need extending PageItemComponentBase, name: ' + config.name);
|
|
517
|
-
notify_error('加载页面组件失败:' + config.name);
|
|
518
|
-
return;
|
|
519
|
-
}
|
|
520
273
|
instance.editMode = boxItem.boxContainer.editMode;
|
|
521
274
|
instance.tabId = (_b = boxItem.boxContainer.context) === null || _b === void 0 ? void 0 : _b.__tabId;
|
|
522
275
|
}
|
|
523
276
|
if (PluginFactory.hasType(plugin, 'form')) {
|
|
524
|
-
if (!(instance instanceof FormItemComponentBase)) {
|
|
525
|
-
console.error('form item component need extending FormItemComponentBase, name: ' + config.name);
|
|
526
|
-
notify_error('加载表单组件失败:' + config.name);
|
|
527
|
-
return;
|
|
528
|
-
}
|
|
529
277
|
instance.editMode = boxItem.boxContainer.editMode;
|
|
530
278
|
instance.validationGroupName = (_c = boxItem.boxContainer.context) === null || _c === void 0 ? void 0 : _c.__form.uniqueId;
|
|
531
279
|
instance.tenant = (_d = boxItem.boxContainer.context) === null || _d === void 0 ? void 0 : _d.__form.tenant;
|
|
@@ -538,11 +286,6 @@ class PluginManager {
|
|
|
538
286
|
}
|
|
539
287
|
}
|
|
540
288
|
if (PluginFactory.hasType(plugin, 'modal')) {
|
|
541
|
-
if (!(instance instanceof ModalComponentBase)) {
|
|
542
|
-
console.error('modal component need extending ModalComponentBase, name: ' + config.name);
|
|
543
|
-
notify_error('加载模窗组件失败:' + config.name);
|
|
544
|
-
return;
|
|
545
|
-
}
|
|
546
289
|
instance.opener = (_j = boxItem.boxContainer.context) === null || _j === void 0 ? void 0 : _j.__opener;
|
|
547
290
|
}
|
|
548
291
|
instance.params = boxItem.boxContainer.params;
|
|
@@ -670,18 +413,10 @@ class PluginManager {
|
|
|
670
413
|
const componentRef = itemConfigContainerRef.createComponent(pluginConfig.component);
|
|
671
414
|
const instance = componentRef.instance;
|
|
672
415
|
if (PluginFactory.hasType(plugin, 'page')) {
|
|
673
|
-
|
|
674
|
-
console.error('page item component config need extending PageItemConfigBase, name: ' + plugin.name);
|
|
675
|
-
notify_error('加载页面组件配置失败:' + plugin.name);
|
|
676
|
-
return;
|
|
677
|
-
}
|
|
416
|
+
instance.configChange = new EventEmitter();
|
|
678
417
|
}
|
|
679
418
|
if (PluginFactory.hasType(plugin, 'form')) {
|
|
680
|
-
|
|
681
|
-
console.error('form item component config need extending FormItemConfigBase, name: ' + plugin.name);
|
|
682
|
-
notify_error('加载表单组件配置失败:' + plugin.name);
|
|
683
|
-
return;
|
|
684
|
-
}
|
|
419
|
+
instance.configChange = new EventEmitter();
|
|
685
420
|
instance.tenant = context === null || context === void 0 ? void 0 : context.tenant;
|
|
686
421
|
instance.className = context === null || context === void 0 ? void 0 : context.className;
|
|
687
422
|
instance.fieldTree = context === null || context === void 0 ? void 0 : context.fieldTree;
|
|
@@ -2086,6 +1821,195 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2086
1821
|
}]
|
|
2087
1822
|
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
2088
1823
|
|
|
1824
|
+
function notify_error(message) {
|
|
1825
|
+
_notify(message, 12000, 'warning');
|
|
1826
|
+
}
|
|
1827
|
+
function notify_warning(message) {
|
|
1828
|
+
_notify(message, 8000, 'warning');
|
|
1829
|
+
}
|
|
1830
|
+
function notify_success(message) {
|
|
1831
|
+
_notify(message, 4000, 'success');
|
|
1832
|
+
}
|
|
1833
|
+
function _notify(message, time, type) {
|
|
1834
|
+
notify({
|
|
1835
|
+
displayTime: time,
|
|
1836
|
+
message,
|
|
1837
|
+
type: type,
|
|
1838
|
+
closeOnSwipe: false,
|
|
1839
|
+
minWidth: 200,
|
|
1840
|
+
maxWidth: 500,
|
|
1841
|
+
wrapperAttr: { class: 'global-toast-message' }
|
|
1842
|
+
}, {
|
|
1843
|
+
direction: 'up-push',
|
|
1844
|
+
position: 'bottom right'
|
|
1845
|
+
});
|
|
1846
|
+
}
|
|
1847
|
+
function format_date(date, locale) {
|
|
1848
|
+
return formatDate(date, 'yyyy/MM/dd', locale, 'GMT+8');
|
|
1849
|
+
}
|
|
1850
|
+
function format_datetime(date, locale) {
|
|
1851
|
+
return formatDate(date, 'yyyy/MM/dd HH:mm:ss', locale, 'GMT+8');
|
|
1852
|
+
}
|
|
1853
|
+
function localeSortMethod(value1, value2) {
|
|
1854
|
+
return value1.localeCompare(value2);
|
|
1855
|
+
}
|
|
1856
|
+
function file_type_icon(name) {
|
|
1857
|
+
const type = name.substring(name.lastIndexOf('.') + 1).toLocaleLowerCase();
|
|
1858
|
+
switch (type) {
|
|
1859
|
+
case 'doc':
|
|
1860
|
+
case 'docx':
|
|
1861
|
+
return 'word';
|
|
1862
|
+
case 'xls':
|
|
1863
|
+
case 'xlsx':
|
|
1864
|
+
case 'csv':
|
|
1865
|
+
return 'excel';
|
|
1866
|
+
case 'ppt':
|
|
1867
|
+
case 'pptx':
|
|
1868
|
+
return 'ppt';
|
|
1869
|
+
case 'pdf':
|
|
1870
|
+
return 'pdf';
|
|
1871
|
+
case 'txt':
|
|
1872
|
+
case 'xml':
|
|
1873
|
+
case 'json':
|
|
1874
|
+
case 'js':
|
|
1875
|
+
return 'text';
|
|
1876
|
+
case 'png':
|
|
1877
|
+
case 'jpg':
|
|
1878
|
+
case 'jpeg':
|
|
1879
|
+
case 'gif':
|
|
1880
|
+
case 'bmp':
|
|
1881
|
+
return 'image';
|
|
1882
|
+
case 'zip':
|
|
1883
|
+
case 'rar':
|
|
1884
|
+
case '7z':
|
|
1885
|
+
case 'jar':
|
|
1886
|
+
return 'zip';
|
|
1887
|
+
default:
|
|
1888
|
+
return 'unknown';
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
function support_preview_ext() {
|
|
1892
|
+
return ['pdf', 'png', 'jpg', 'jpeg', 'gif', 'bmp', 'doc', 'docx', 'txt', 'xml', 'json', 'js', 'xls', 'xlsx', 'csv', 'ppt', 'pptx'];
|
|
1893
|
+
}
|
|
1894
|
+
function format_file_size(size) {
|
|
1895
|
+
const labels = ['b', 'Kb', 'Mb', 'Gb'];
|
|
1896
|
+
const count = labels.length - 1;
|
|
1897
|
+
let i = 0;
|
|
1898
|
+
while (i < count && size >= 1024) {
|
|
1899
|
+
size /= 1024;
|
|
1900
|
+
i++;
|
|
1901
|
+
}
|
|
1902
|
+
return Math.round(size * 100) / 100 + " " + labels[i];
|
|
1903
|
+
}
|
|
1904
|
+
function filename_from_disposition(disposition) {
|
|
1905
|
+
const filenamePair = disposition.split(';').filter(str => /^filename=/.test(str.trim())).pop();
|
|
1906
|
+
if (filenamePair) {
|
|
1907
|
+
let str = filenamePair.trim();
|
|
1908
|
+
str = str.split('=')[1];
|
|
1909
|
+
str = str.replace(/['"]/g, '');
|
|
1910
|
+
return decodeURIComponent(str);
|
|
1911
|
+
}
|
|
1912
|
+
else {
|
|
1913
|
+
return null;
|
|
1914
|
+
}
|
|
1915
|
+
}
|
|
1916
|
+
function download_file(blob, filename, callback) {
|
|
1917
|
+
const url = window.webkitURL.createObjectURL(blob);
|
|
1918
|
+
const a = document.createElement('a');
|
|
1919
|
+
document.body.appendChild(a);
|
|
1920
|
+
a.setAttribute('style', 'display:none');
|
|
1921
|
+
a.setAttribute('href', url);
|
|
1922
|
+
a.setAttribute('download', decodeURIComponent(filename));
|
|
1923
|
+
a.click();
|
|
1924
|
+
setTimeout(() => {
|
|
1925
|
+
if (callback) {
|
|
1926
|
+
callback();
|
|
1927
|
+
}
|
|
1928
|
+
a.remove();
|
|
1929
|
+
});
|
|
1930
|
+
}
|
|
1931
|
+
function validate(validator) {
|
|
1932
|
+
return new Promise(resolve => {
|
|
1933
|
+
var _a;
|
|
1934
|
+
if (!validator) {
|
|
1935
|
+
resolve(true);
|
|
1936
|
+
}
|
|
1937
|
+
const validateResult = validator.instance.validate();
|
|
1938
|
+
if (!validateResult.isValid) {
|
|
1939
|
+
resolve(false);
|
|
1940
|
+
}
|
|
1941
|
+
if (validateResult.status === 'pending') {
|
|
1942
|
+
(_a = validateResult.complete) === null || _a === void 0 ? void 0 : _a.then((result) => {
|
|
1943
|
+
if (result.isValid) {
|
|
1944
|
+
resolve(true);
|
|
1945
|
+
}
|
|
1946
|
+
else {
|
|
1947
|
+
resolve(false);
|
|
1948
|
+
}
|
|
1949
|
+
});
|
|
1950
|
+
}
|
|
1951
|
+
else {
|
|
1952
|
+
resolve(true);
|
|
1953
|
+
}
|
|
1954
|
+
});
|
|
1955
|
+
}
|
|
1956
|
+
function validate_group(validationGroupComponent) {
|
|
1957
|
+
if (!validationGroupComponent) {
|
|
1958
|
+
return firstValueFrom(of(true));
|
|
1959
|
+
}
|
|
1960
|
+
return validateGroup(validationGroupComponent.instance, validationGroupComponent.element.nativeElement);
|
|
1961
|
+
}
|
|
1962
|
+
function validate_group_by_name(name, brokenElementParent) {
|
|
1963
|
+
const validationGroup = validationEngine.getGroupConfig(name);
|
|
1964
|
+
if (!validationGroup) {
|
|
1965
|
+
return firstValueFrom(of(true));
|
|
1966
|
+
}
|
|
1967
|
+
return validateGroup(validationGroup, brokenElementParent);
|
|
1968
|
+
}
|
|
1969
|
+
function validateGroup(validationGroup, brokenElementParent) {
|
|
1970
|
+
let sourceNode;
|
|
1971
|
+
const targetClassName = 'dx-field';
|
|
1972
|
+
const findTargetNode = (node) => {
|
|
1973
|
+
sourceNode = node;
|
|
1974
|
+
while (true) {
|
|
1975
|
+
if (node.classList.contains(targetClassName)) {
|
|
1976
|
+
return node;
|
|
1977
|
+
}
|
|
1978
|
+
else {
|
|
1979
|
+
node = node.parentElement;
|
|
1980
|
+
if (node === brokenElementParent) {
|
|
1981
|
+
return sourceNode;
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
};
|
|
1986
|
+
return new Promise(resolve => {
|
|
1987
|
+
var _a, _b;
|
|
1988
|
+
const validateResult = validationGroup.validate();
|
|
1989
|
+
if (!validateResult.isValid) {
|
|
1990
|
+
const brokenElement = ((_a = validateResult.brokenRules) === null || _a === void 0 ? void 0 : _a[0]).validator.element();
|
|
1991
|
+
findTargetNode(brokenElement).scrollIntoView();
|
|
1992
|
+
resolve(false);
|
|
1993
|
+
}
|
|
1994
|
+
if (validateResult.status === 'pending') {
|
|
1995
|
+
(_b = validateResult.complete) === null || _b === void 0 ? void 0 : _b.then((result) => {
|
|
1996
|
+
var _a;
|
|
1997
|
+
if (result.isValid) {
|
|
1998
|
+
resolve(true);
|
|
1999
|
+
}
|
|
2000
|
+
else {
|
|
2001
|
+
const brokenElement = ((_a = result.brokenRules) === null || _a === void 0 ? void 0 : _a[0]).validator.element();
|
|
2002
|
+
findTargetNode(brokenElement).scrollIntoView();
|
|
2003
|
+
resolve(false);
|
|
2004
|
+
}
|
|
2005
|
+
});
|
|
2006
|
+
}
|
|
2007
|
+
else {
|
|
2008
|
+
resolve(true);
|
|
2009
|
+
}
|
|
2010
|
+
});
|
|
2011
|
+
}
|
|
2012
|
+
|
|
2089
2013
|
class CustomTemplateDirective {
|
|
2090
2014
|
constructor(templateRef) {
|
|
2091
2015
|
this.templateRef = templateRef;
|
|
@@ -2879,9 +2803,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2879
2803
|
args: ['drawerFormContentTemplate', { static: true }]
|
|
2880
2804
|
}] } });
|
|
2881
2805
|
|
|
2882
|
-
class CellComponentBase extends ComponentBase {
|
|
2883
|
-
}
|
|
2884
|
-
|
|
2885
2806
|
class CellComponentTemplateComponent {
|
|
2886
2807
|
constructor(service) {
|
|
2887
2808
|
this.service = service;
|
|
@@ -2898,11 +2819,6 @@ class CellComponentTemplateComponent {
|
|
|
2898
2819
|
const componentRef = this.cellComponentRef.createComponent(plugin.component);
|
|
2899
2820
|
const instance = componentRef.instance;
|
|
2900
2821
|
Object.assign(instance, cellComponentConfig);
|
|
2901
|
-
if (!(instance instanceof CellComponentBase)) {
|
|
2902
|
-
console.error('cell component need extending CellComponentBase, name: ' + plugin.name);
|
|
2903
|
-
notify_error('加载单元格组件失败:' + plugin.name);
|
|
2904
|
-
return;
|
|
2905
|
-
}
|
|
2906
2822
|
instance.field = this.cellInfo.column.dataField;
|
|
2907
2823
|
instance.fieldConfig = fieldConfig;
|
|
2908
2824
|
instance.rowData = this.cellInfo.data;
|
|
@@ -3816,12 +3732,68 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
3816
3732
|
args: [PdfJsViewerComponent, { static: true }]
|
|
3817
3733
|
}] } });
|
|
3818
3734
|
|
|
3735
|
+
class ComponentBase {
|
|
3736
|
+
}
|
|
3737
|
+
|
|
3738
|
+
class CellComponentBase extends ComponentBase {
|
|
3739
|
+
}
|
|
3740
|
+
|
|
3741
|
+
class FormItemComponentBase extends ComponentBase {
|
|
3742
|
+
constructor() {
|
|
3743
|
+
super(...arguments);
|
|
3744
|
+
/**
|
|
3745
|
+
* 编辑模式,在设计器中为true,用于区分组件设计和应用状态
|
|
3746
|
+
*/
|
|
3747
|
+
this.editMode = false;
|
|
3748
|
+
/**
|
|
3749
|
+
* 表单只读状态,用于区分组件只读状态
|
|
3750
|
+
*/
|
|
3751
|
+
this.readonly = false;
|
|
3752
|
+
}
|
|
3753
|
+
}
|
|
3754
|
+
|
|
3755
|
+
class ModalComponentBase extends ComponentBase {
|
|
3756
|
+
}
|
|
3757
|
+
|
|
3758
|
+
class PageItemComponentBase extends ComponentBase {
|
|
3759
|
+
constructor() {
|
|
3760
|
+
super(...arguments);
|
|
3761
|
+
/**
|
|
3762
|
+
* 编辑模式,在设计器中为true,用于区分组件设计和应用状态
|
|
3763
|
+
*/
|
|
3764
|
+
this.editMode = false;
|
|
3765
|
+
}
|
|
3766
|
+
}
|
|
3767
|
+
|
|
3768
|
+
class ConfigBase {
|
|
3769
|
+
}
|
|
3770
|
+
|
|
3819
3771
|
class CellConfigBase extends ConfigBase {
|
|
3820
3772
|
}
|
|
3821
3773
|
|
|
3774
|
+
class FormItemConfigBase extends ConfigBase {
|
|
3775
|
+
constructor() {
|
|
3776
|
+
super(...arguments);
|
|
3777
|
+
/**
|
|
3778
|
+
* 配置更新事件,emit()将更新配置到组件,emit(true)将更新配置到组件并重新加载组件
|
|
3779
|
+
*/
|
|
3780
|
+
this.configChange = new EventEmitter();
|
|
3781
|
+
}
|
|
3782
|
+
}
|
|
3783
|
+
|
|
3822
3784
|
class ModalConfigBase extends ConfigBase {
|
|
3823
3785
|
}
|
|
3824
3786
|
|
|
3787
|
+
class PageItemConfigBase extends ConfigBase {
|
|
3788
|
+
constructor() {
|
|
3789
|
+
super(...arguments);
|
|
3790
|
+
/**
|
|
3791
|
+
* 配置更新事件,emit()将更新配置到组件,emit(true)将更新配置到组件并重新加载组件
|
|
3792
|
+
*/
|
|
3793
|
+
this.configChange = new EventEmitter();
|
|
3794
|
+
}
|
|
3795
|
+
}
|
|
3796
|
+
|
|
3825
3797
|
class WebsocketModule {
|
|
3826
3798
|
}
|
|
3827
3799
|
WebsocketModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WebsocketModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|