ngx-rs-ant 1.3.7 → 1.3.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.
@@ -2,7 +2,7 @@ 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 { CommonModule } from '@angular/common';
5
+ import { CommonModule, formatDate } from '@angular/common';
6
6
  import { Subject, ReplaySubject, Subscription, map, shareReplay, lastValueFrom, debounceTime, interval } from 'rxjs';
7
7
  import * as i2 from 'devextreme-angular/ui/number-box';
8
8
  import * as i2$1 from 'devextreme-angular/ui/draggable';
@@ -20,9 +20,9 @@ import CustomStore from 'devextreme/data/custom_store';
20
20
  import * as i3 from 'devextreme-angular/core';
21
21
  import * as i5$1 from 'devextreme-angular/ui/data-grid';
22
22
  import * as i5 from 'devextreme-angular/ui/tooltip';
23
+ import notify from 'devextreme/ui/notify';
23
24
  import * as i2$2 from '@angular/platform-browser';
24
25
  import * as i3$1 from 'devextreme-angular/ui/accordion';
25
- import notify from 'devextreme/ui/notify';
26
26
  import * as i7 from 'devextreme-angular/ui/validation-group';
27
27
  import * as i4$1 from 'devextreme-angular/ui/text-box';
28
28
  import * as i4$2 from 'devextreme-angular/ui/popover';
@@ -2322,6 +2322,7 @@ class DataGridFactory {
2322
2322
  cssClass: 'cell-vertical-middle',
2323
2323
  allowHeaderFiltering: false,
2324
2324
  allowFiltering: false,
2325
+ allowSorting: false,
2325
2326
  visible: field.visible,
2326
2327
  fixed: field.fixed
2327
2328
  };
@@ -2415,6 +2416,153 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
2415
2416
  }]
2416
2417
  }], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
2417
2418
 
2419
+ function notify_error(message) {
2420
+ notify({
2421
+ displayTime: 12000,
2422
+ message,
2423
+ type: 'error',
2424
+ width: '300px'
2425
+ }, {
2426
+ direction: 'up-push',
2427
+ position: 'bottom right'
2428
+ });
2429
+ }
2430
+ function notify_warning(message) {
2431
+ notify({
2432
+ displayTime: 8000,
2433
+ message,
2434
+ type: 'warning',
2435
+ width: '300px'
2436
+ }, {
2437
+ direction: 'up-push',
2438
+ position: 'bottom right'
2439
+ });
2440
+ }
2441
+ function notify_success(message) {
2442
+ notify({
2443
+ displayTime: 4000,
2444
+ message,
2445
+ type: 'success',
2446
+ width: '300px'
2447
+ }, {
2448
+ direction: 'down-push',
2449
+ position: 'top right'
2450
+ });
2451
+ }
2452
+ function format_date(date, locale) {
2453
+ return formatDate(date, 'yyyy/MM/dd', locale, 'GMT+8');
2454
+ }
2455
+ function format_datetime(date, locale) {
2456
+ return formatDate(date, 'yyyy/MM/dd HH:mm:ss', locale, 'GMT+8');
2457
+ }
2458
+ function file_type_icon(name) {
2459
+ const type = name.substring(name.lastIndexOf('.') + 1).toLocaleLowerCase();
2460
+ switch (type) {
2461
+ case 'xls':
2462
+ case 'xlsx':
2463
+ return 'excel';
2464
+ case 'doc':
2465
+ case 'docx':
2466
+ return 'word';
2467
+ case 'ppt':
2468
+ case 'pptx':
2469
+ return 'ppt';
2470
+ case 'pdf':
2471
+ return 'pdf';
2472
+ case 'txt':
2473
+ case 'csv':
2474
+ case 'xml':
2475
+ case 'json':
2476
+ case 'js':
2477
+ return 'text';
2478
+ case 'jpg':
2479
+ case 'jpeg':
2480
+ case 'png':
2481
+ case 'gif':
2482
+ return 'image';
2483
+ case 'zip':
2484
+ case 'rar':
2485
+ case '7z':
2486
+ case 'jar':
2487
+ return 'zip';
2488
+ default:
2489
+ return 'unknown';
2490
+ }
2491
+ }
2492
+ function format_file_size(size) {
2493
+ const labels = ['b', 'Kb', 'Mb', 'Gb'];
2494
+ const count = labels.length - 1;
2495
+ let i = 0;
2496
+ while (i < count && size >= 1024) {
2497
+ size /= 1024;
2498
+ i++;
2499
+ }
2500
+ return Math.round(size * 100) / 100 + " " + labels[i];
2501
+ }
2502
+ async function validate(validator) {
2503
+ return new Promise(resolve => {
2504
+ const validateResult = validator.instance.validate();
2505
+ if (!validateResult.isValid) {
2506
+ resolve(false);
2507
+ }
2508
+ if (validateResult.status === 'pending') {
2509
+ validateResult.complete?.then((result) => {
2510
+ if (result.isValid) {
2511
+ resolve(true);
2512
+ }
2513
+ else {
2514
+ resolve(false);
2515
+ }
2516
+ });
2517
+ }
2518
+ else {
2519
+ resolve(true);
2520
+ }
2521
+ });
2522
+ }
2523
+ async function validate_group(validationGroup) {
2524
+ const top = validationGroup.element.nativeElement;
2525
+ let sourceNode;
2526
+ const targetClassName = 'dx-field';
2527
+ const findTargetNode = (node) => {
2528
+ sourceNode = node;
2529
+ while (true) {
2530
+ if (node.classList.contains(targetClassName)) {
2531
+ return node;
2532
+ }
2533
+ else {
2534
+ node = node.parentElement;
2535
+ if (node === top) {
2536
+ return sourceNode;
2537
+ }
2538
+ }
2539
+ }
2540
+ };
2541
+ return new Promise(resolve => {
2542
+ const validateResult = validationGroup.instance.validate();
2543
+ if (!validateResult.isValid) {
2544
+ const brokenElement = (validateResult.brokenRules?.[0]).validator.element();
2545
+ findTargetNode(brokenElement).scrollIntoView();
2546
+ resolve(false);
2547
+ }
2548
+ if (validateResult.status === 'pending') {
2549
+ validateResult.complete?.then((result) => {
2550
+ if (result.isValid) {
2551
+ resolve(true);
2552
+ }
2553
+ else {
2554
+ const brokenElement = (result.brokenRules?.[0]).validator.element();
2555
+ findTargetNode(brokenElement).scrollIntoView();
2556
+ resolve(false);
2557
+ }
2558
+ });
2559
+ }
2560
+ else {
2561
+ resolve(true);
2562
+ }
2563
+ });
2564
+ }
2565
+
2418
2566
  class FileCellTemplateComponent {
2419
2567
  constructor(service, domSanitizer) {
2420
2568
  this.service = service;
@@ -2429,11 +2577,11 @@ class FileCellTemplateComponent {
2429
2577
  <table>
2430
2578
  <tr>
2431
2579
  <td style="text-align: right;">名称:</td>
2432
- <td style="text-align: left;">${this.file.fileName}</td>
2580
+ <td style="text-align: left;">${this.filename}</td>
2433
2581
  </tr>
2434
2582
  <tr>
2435
2583
  <td style="text-align: right;">大小:</td>
2436
- <td style="text-align: left;">${this.getFileSize(this.file.fileSize)}</td>
2584
+ <td style="text-align: left;">${format_file_size(this.file.fileSize)}</td>
2437
2585
  </tr>
2438
2586
  <tr>
2439
2587
  <td style="text-align: right;">时间:</td>
@@ -2441,46 +2589,7 @@ class FileCellTemplateComponent {
2441
2589
  </tr>
2442
2590
  </table>
2443
2591
  `);
2444
- const type = this.file.fileName.substring(this.file.fileName.lastIndexOf('.') + 1).toLocaleLowerCase();
2445
- switch (type) {
2446
- case 'xls':
2447
- case 'xlsx':
2448
- this.icon = 'excel';
2449
- break;
2450
- case 'doc':
2451
- case 'docx':
2452
- this.icon = 'word';
2453
- break;
2454
- case 'ppt':
2455
- case 'pptx':
2456
- this.icon = 'ppt';
2457
- break;
2458
- case 'pdf':
2459
- this.icon = 'pdf';
2460
- break;
2461
- case 'txt':
2462
- case 'csv':
2463
- case 'xml':
2464
- case 'json':
2465
- case 'js':
2466
- this.icon = 'text';
2467
- break;
2468
- case 'jpg':
2469
- case 'jpeg':
2470
- case 'png':
2471
- case 'gif':
2472
- this.icon = 'image';
2473
- break;
2474
- case 'zip':
2475
- case 'rar':
2476
- case '7z':
2477
- case 'jar':
2478
- this.icon = 'zip';
2479
- break;
2480
- default:
2481
- this.icon = 'unknown';
2482
- break;
2483
- }
2592
+ this.icon = file_type_icon(this.filename);
2484
2593
  // 重绘表格宽高
2485
2594
  setTimeout(() => {
2486
2595
  //this.table.resize();
@@ -2494,16 +2603,6 @@ class FileCellTemplateComponent {
2494
2603
  this.loading = false;
2495
2604
  });
2496
2605
  }
2497
- getFileSize(size) {
2498
- const labels = ['b', 'Kb', 'Mb', 'Gb'];
2499
- const count = labels.length - 1;
2500
- let i = 0;
2501
- while (i < count && size >= 1024) {
2502
- size /= 1024;
2503
- i++;
2504
- }
2505
- return Math.round(size * 100) / 100 + " " + labels[i];
2506
- }
2507
2606
  }
2508
2607
  FileCellTemplateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FileCellTemplateComponent, deps: [{ token: DataGridService }, { token: i2$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
2509
2608
  FileCellTemplateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: FileCellTemplateComponent, selector: "rs-file-cell-template", inputs: { table: "table", oid: "oid" }, ngImport: i0, template: "<dx-button #fileBtn type=\"default\" stylingMode=\"text\">\n <i class=\"coast-icon-file-{{icon}}\" style=\"padding-right: 4px;\"></i>\n {{filename}}\n <dx-tooltip [target]=\"fileBtn.instance.element()\"\n [position]=\"'top'\"\n [visible]=\"false\"\n [showEvent]=\"'click'\">\n <div *dxTemplate=\"let data of 'content'\">\n <div [innerHTML]=\"content\"></div>\n <dx-button type=\"default\" stylingMode=\"text\" icon=\"coast-icon coast-icon-download\" text=\"\u4E0B\u8F7D\"\n (onClick)=\"download()\" [disabled]=\"loading\"></dx-button>\n </div>\n </dx-tooltip>\n</dx-button><br/>\n", styles: [""], dependencies: [{ kind: "directive", type: i3.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }, { kind: "component", type: i4.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: i5.DxTooltipComponent, selector: "dx-tooltip", inputs: ["animation", "closeOnOutsideClick", "container", "contentTemplate", "copyRootClassesToWrapper", "deferRendering", "disabled", "elementAttr", "height", "hideEvent", "hideOnOutsideClick", "hideOnParentScroll", "hint", "hoverStateEnabled", "maxHeight", "maxWidth", "minHeight", "minWidth", "position", "rtlEnabled", "shading", "shadingColor", "showEvent", "target", "visible", "width", "wrapperAttr"], outputs: ["onContentReady", "onDisposing", "onHidden", "onHiding", "onInitialized", "onOptionChanged", "onShowing", "onShown", "animationChange", "closeOnOutsideClickChange", "containerChange", "contentTemplateChange", "copyRootClassesToWrapperChange", "deferRenderingChange", "disabledChange", "elementAttrChange", "heightChange", "hideEventChange", "hideOnOutsideClickChange", "hideOnParentScrollChange", "hintChange", "hoverStateEnabledChange", "maxHeightChange", "maxWidthChange", "minHeightChange", "minWidthChange", "positionChange", "rtlEnabledChange", "shadingChange", "shadingColorChange", "showEventChange", "targetChange", "visibleChange", "widthChange", "wrapperAttrChange"] }] });
@@ -2833,103 +2932,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
2833
2932
  type: Injectable
2834
2933
  }], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
2835
2934
 
2836
- function notify_error(message) {
2837
- notify({
2838
- displayTime: 12000,
2839
- message,
2840
- type: 'error',
2841
- width: '300px'
2842
- }, {
2843
- direction: 'up-push',
2844
- position: 'bottom right'
2845
- });
2846
- }
2847
- function notify_warning(message) {
2848
- notify({
2849
- displayTime: 8000,
2850
- message,
2851
- type: 'warning',
2852
- width: '300px'
2853
- }, {
2854
- direction: 'up-push',
2855
- position: 'bottom right'
2856
- });
2857
- }
2858
- function notify_success(message) {
2859
- notify({
2860
- displayTime: 4000,
2861
- message,
2862
- type: 'success',
2863
- width: '300px'
2864
- }, {
2865
- direction: 'down-push',
2866
- position: 'top right'
2867
- });
2868
- }
2869
- async function validate(validator) {
2870
- return new Promise(resolve => {
2871
- const validateResult = validator.instance.validate();
2872
- if (!validateResult.isValid) {
2873
- resolve(false);
2874
- }
2875
- if (validateResult.status === 'pending') {
2876
- validateResult.complete?.then((result) => {
2877
- if (result.isValid) {
2878
- resolve(true);
2879
- }
2880
- else {
2881
- resolve(false);
2882
- }
2883
- });
2884
- }
2885
- else {
2886
- resolve(true);
2887
- }
2888
- });
2889
- }
2890
- async function validate_group(validationGroup) {
2891
- const top = validationGroup.element.nativeElement;
2892
- let sourceNode;
2893
- const targetClassName = 'dx-field';
2894
- const findTargetNode = (node) => {
2895
- sourceNode = node;
2896
- while (true) {
2897
- if (node.classList.contains(targetClassName)) {
2898
- return node;
2899
- }
2900
- else {
2901
- node = node.parentElement;
2902
- if (node === top) {
2903
- return sourceNode;
2904
- }
2905
- }
2906
- }
2907
- };
2908
- return new Promise(resolve => {
2909
- const validateResult = validationGroup.instance.validate();
2910
- if (!validateResult.isValid) {
2911
- const brokenElement = (validateResult.brokenRules?.[0]).validator.element();
2912
- findTargetNode(brokenElement).scrollIntoView();
2913
- resolve(false);
2914
- }
2915
- if (validateResult.status === 'pending') {
2916
- validateResult.complete?.then((result) => {
2917
- if (result.isValid) {
2918
- resolve(true);
2919
- }
2920
- else {
2921
- const brokenElement = (result.brokenRules?.[0]).validator.element();
2922
- findTargetNode(brokenElement).scrollIntoView();
2923
- resolve(false);
2924
- }
2925
- });
2926
- }
2927
- else {
2928
- resolve(true);
2929
- }
2930
- });
2931
- }
2932
-
2933
2935
  class FormComponent {
2934
2936
  constructor(viewContainerRef, service, elementRef) {
2935
2937
  this.viewContainerRef = viewContainerRef;
@@ -3716,5 +3718,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
3716
3718
  * Generated bundle index. Do not edit.
3717
3719
  */
3718
3720
 
3719
- export { BoxContainerComponent, BoxContainerModule, CamundaBpmnEditorComponent, CamundaBpmnEditorModule, ChangeFilter, CodeEditorComponent, CodeEditorModule, DataDetailComponent, DataDetailModule, DataGridComponent, DataGridFactory, DataGridModule, DataGridService, DrawerComponent, DrawerModule, DrawerService, DynamicParamsComponent, DynamicParamsModule, FormComponent, FormModule, FormService, IconSelectorComponent, IconSelectorModule, InstanceLinkTemplateDirective, ItemConfigComponent, ItemStyleComponent, MasterDetailTemplateDirective, ModalComponent, ModalModule, ModalService, PluginManager, RowButtonsTemplateDirective, TooltipContentTemplateDirective, WebsocketModule, WebsocketService, notify_error, notify_success, notify_warning, validate, validate_group };
3721
+ export { BoxContainerComponent, BoxContainerModule, CamundaBpmnEditorComponent, CamundaBpmnEditorModule, ChangeFilter, CodeEditorComponent, CodeEditorModule, DataDetailComponent, DataDetailModule, DataGridComponent, DataGridFactory, DataGridModule, DataGridService, DrawerComponent, DrawerModule, DrawerService, DynamicParamsComponent, DynamicParamsModule, FormComponent, FormModule, FormService, IconSelectorComponent, IconSelectorModule, InstanceLinkTemplateDirective, ItemConfigComponent, ItemStyleComponent, MasterDetailTemplateDirective, ModalComponent, ModalModule, ModalService, PluginManager, RowButtonsTemplateDirective, TooltipContentTemplateDirective, WebsocketModule, WebsocketService, file_type_icon, format_date, format_datetime, format_file_size, notify_error, notify_success, notify_warning, validate, validate_group };
3720
3722
  //# sourceMappingURL=ngx-rs-ant.mjs.map