barsa-develop-components 2.1.6 → 2.1.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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, Input, ViewChild, Injectable, EventEmitter, Output, Pipe, HostBinding, HostListener, RendererStyleFlags2, ElementRef, ViewEncapsulation, ViewChildren, ViewContainerRef, TemplateRef, Optional, inject, Renderer2, NgModule, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core';
2
+ import { Component, ChangeDetectionStrategy, Input, ViewChild, Injectable, EventEmitter, Output, Pipe, HostBinding, HostListener, RendererStyleFlags2, ElementRef, ViewEncapsulation, ViewChildren, ViewContainerRef, TemplateRef, Optional, inject, Renderer2, signal, NgModule, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core';
3
3
  import * as i2$1 from 'barsa-sap-ui';
4
4
  import { DeviceInfoFieldBaseComponent, UiMoInfoSubFormUiComponent, UiCheckBoxComponent, UiMoInfoUlvComboComponent, UiSimpleComboComponent, UiPicturesInfoComponent, UiPdfViewerComponent, ColumnRendererComponent, BarsaSapUiModule } from 'barsa-sap-ui';
5
5
  import { Subject, debounceTime, distinctUntilChanged, BehaviorSubject, of, takeUntil as takeUntil$1, switchMap } from 'rxjs';
@@ -8,7 +8,7 @@ import { ReactiveFormsModule, FormsModule } from '@angular/forms';
8
8
  import * as i2 from '@fundamental-ngx/core/input-group';
9
9
  import * as i3 from '@fundamental-ngx/core/toolbar';
10
10
  import * as i1$1 from 'barsa-novin-ray-core';
11
- import { ReportViewBaseComponent, FieldBaseComponent, FormBaseComponent, FormPanelService, BaseComponent, BarsaApi, ReportBaseComponent, getDeviceIsMobile, BaseItemContentPropsComponent, FormPropsBaseComponent, FindLayoutSettingFromLayout94, BaseFormToolbaritemPropsComponent, DateService, getDateService, LogService, UploadService, AudioRecordingService, VideoRecordingService, createGridEditorFormPanel, ImageMimeType, AudioMimeType, VideoMimeType, AllFilesMimeType, PreventDefaulEvent, isImage, getIcon, FilesValidationHelper, LinearListHelper, getUniqueId, BaseViewItemPropsComponent, FindColumnByDbNamePipe, ColumnValuePipe, BaseModule, BarsaNovinRayCoreModule } from 'barsa-novin-ray-core';
11
+ import { ReportViewBaseComponent, FieldBaseComponent, FormBaseComponent, FormPanelService, BaseComponent, BarsaApi, ReportBaseComponent, getDeviceIsMobile, BaseItemContentPropsComponent, FormPropsBaseComponent, FindLayoutSettingFromLayout94, BaseFormToolbaritemPropsComponent, DateService, getDateService, LogService, UploadService, AudioRecordingService, VideoRecordingService, createGridEditorFormPanel, ImageMimeType, AudioMimeType, VideoMimeType, AllFilesMimeType, PreventDefaulEvent, isImage, getIcon, FilesValidationHelper, LinearListHelper, getUniqueId, BaseViewItemPropsComponent, PortalService, ColumnValueOfParametersPipe, BaseModule, BarsaNovinRayCoreModule } from 'barsa-novin-ray-core';
12
12
  import { takeUntil, shareReplay, filter, map, debounceTime as debounceTime$1, tap, exhaustMap, concatMap, finalize, delay, withLatestFrom } from 'rxjs/operators';
13
13
  import * as i2$2 from '@fundamental-ngx/core';
14
14
  import { TabListComponent, PopoverBodyComponent, TabPanelComponent, FundamentalNgxCoreModule } from '@fundamental-ngx/core';
@@ -3416,64 +3416,65 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
3416
3416
  class ColumnProgressbarComponent extends ColumnRendererComponent {
3417
3417
  constructor() {
3418
3418
  super(...arguments);
3419
- this.maxValue = '100';
3420
- this.customUntitValueNow = 0;
3421
- this.unit = 'MB';
3422
- this.valueText = '';
3423
- this.state = 'informative';
3424
3419
  this._el = inject(ElementRef);
3425
3420
  this._renderer2 = inject(Renderer2);
3426
- this._findColumnByDbName = inject(FindColumnByDbNamePipe);
3427
- this._columnValuePipe = inject(ColumnValuePipe);
3421
+ this._portalService = inject(PortalService);
3422
+ this._columnValueOfParametersPipe = inject(ColumnValueOfParametersPipe);
3423
+ this.isRtl = true;
3424
+ this.maxValue = signal('100');
3425
+ this.customUntitValueNow = signal(0);
3426
+ this.unit = signal('MB');
3427
+ this.valueText = signal('');
3428
+ this.state = signal('informative');
3428
3429
  }
3429
3430
  ngOnInit() {
3430
3431
  super.ngOnInit();
3431
- this._setMaxValue();
3432
- if (this.parameters?.Units) {
3433
- this.unit = this.parameters.Units;
3434
- }
3435
- this.state = this.parameters.State$Caption;
3432
+ this._setMaxValue(this.mo);
3433
+ this._setState();
3434
+ this._setUnit();
3436
3435
  this._setValueText();
3436
+ this._setRtl();
3437
+ }
3438
+ ngOnChanges(changes) {
3439
+ super.ngOnChanges(changes);
3440
+ const { mo } = changes;
3441
+ if (mo && !mo.firstChange) {
3442
+ this._setMaxValue(mo.currentValue);
3443
+ this._setColor(mo.currentValue);
3444
+ this._setValueText();
3445
+ }
3437
3446
  }
3438
3447
  ngAfterViewInit() {
3439
3448
  super.ngAfterViewInit();
3440
- this._setColor();
3449
+ this._setColor(this.mo);
3450
+ }
3451
+ _setRtl() {
3452
+ this.isRtl = this._portalService.isRtl;
3453
+ }
3454
+ _setState() {
3455
+ this.state.set(this.parameters.State$Caption);
3456
+ }
3457
+ _setUnit() {
3458
+ if (this.parameters?.Units) {
3459
+ this.unit.set(this.parameters.Units);
3460
+ }
3441
3461
  }
3442
3462
  _setValueText() {
3443
- // const { ValueText } = this.parameters;
3444
- // this.valueText = this.value + ' ' + this.unit + ' ' + this.maxValue;
3445
- // if (ValueText) {
3446
- // const x = eval(ValueText); // eslint-disable-line
3447
- // }
3463
+ const t = String.fromCharCode(0x202a);
3464
+ this.valueText.set(this.isRtl
3465
+ ? `${t} ${this.maxValue()} ${BarsaApi.BBB[this.unit()] || this.unit()} ${this.signalValue()}`
3466
+ : `${this.signalValue()} ${BarsaApi.BBB[this.unit()] || this.unit()} ${this.maxValue()}`);
3448
3467
  }
3449
- _setMaxValue() {
3468
+ _setMaxValue(mo) {
3450
3469
  const { MaxValue, MaxValueField } = this.parameters;
3451
- if (MaxValue) {
3452
- this.maxValue = this.parameters.MaxValue;
3453
- }
3454
- if (MaxValueField) {
3455
- const column = this._findColumnByDbName.transform(this.allColumns, MaxValueField, []);
3456
- if (column) {
3457
- this.maxValue = this._columnValuePipe.transform(column, this.mo);
3458
- }
3459
- else {
3460
- this.maxValue = this.mo[MaxValueField];
3461
- }
3470
+ if (MaxValue || MaxValueField) {
3471
+ this.maxValue.set(this._columnValueOfParametersPipe.transform(this.allColumns, mo, MaxValueField, MaxValue));
3462
3472
  }
3463
3473
  }
3464
- _setColor() {
3474
+ _setColor(mo) {
3465
3475
  const { Color, ColorField } = this.parameters;
3466
3476
  if (Color || ColorField) {
3467
- let color = Color;
3468
- if (ColorField) {
3469
- const column = this._findColumnByDbName.transform(this.allColumns, ColorField, []);
3470
- if (column) {
3471
- color = this._columnValuePipe.transform(column, this.mo);
3472
- }
3473
- else {
3474
- color = this.mo[ColorField];
3475
- }
3476
- }
3477
+ const color = this._columnValueOfParametersPipe.transform(this.allColumns, mo, ColorField, Color);
3477
3478
  const dom = this._el.nativeElement;
3478
3479
  const x = dom.querySelector('.fd-progress-indicator__progress-bar');
3479
3480
  if (x) {
@@ -3482,11 +3483,11 @@ class ColumnProgressbarComponent extends ColumnRendererComponent {
3482
3483
  }
3483
3484
  }
3484
3485
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ColumnProgressbarComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
3485
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ColumnProgressbarComponent, selector: "bdc-column-progressbar", inputs: { layout94: "layout94", parameters: "parameters" }, usesInheritance: true, ngImport: i0, template: "<fd-progress-indicator\n [state]=\"state\"\n [valueNow]=\"value | strToNum\"\n [valueMax]=\"maxValue | strToNum\"\n [unit]=\"unit\"\n [valueText]=\"valueText\"\n></fd-progress-indicator>\n", styles: [":host{display:flex;width:100%;height:100%;align-items:stretch;justify-content:stretch}:host fd-progress-indicator{display:block;width:100%}:host fd-progress-indicator ::ng-deep>div{margin:2px!important;display:flex;align-items:center}:host fd-progress-indicator ::ng-deep>div>div{width:100%;display:flex;align-items:center}\n"], dependencies: [{ kind: "component", type: i5.ProgressIndicatorComponent, selector: "fd-progress-indicator", inputs: ["valueText", "unit", "valueMin", "valueMax", "valueNow", "state", "animate"] }, { kind: "pipe", type: i1$1.StringToNumberPipe, name: "strToNum" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3486
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ColumnProgressbarComponent, selector: "bdc-column-progressbar", inputs: { layout94: "layout94", parameters: "parameters" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<fd-progress-indicator\n [state]=\"state()\"\n [valueNow]=\"signalValue() | strToNum\"\n [valueMax]=\"maxValue() | strToNum\"\n [unit]=\"unit()\"\n [valueText]=\"valueText()\"\n></fd-progress-indicator>\n", styles: [":host{display:flex;width:100%;height:100%;align-items:stretch;justify-content:stretch}:host fd-progress-indicator{display:block;width:100%}:host fd-progress-indicator ::ng-deep>div{margin:2px!important;display:flex;align-items:center}:host fd-progress-indicator ::ng-deep>div>div{width:100%;display:flex;align-items:center}\n"], dependencies: [{ kind: "component", type: i5.ProgressIndicatorComponent, selector: "fd-progress-indicator", inputs: ["valueText", "unit", "valueMin", "valueMax", "valueNow", "state", "animate"] }, { kind: "pipe", type: i1$1.StringToNumberPipe, name: "strToNum" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3486
3487
  }
3487
3488
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ColumnProgressbarComponent, decorators: [{
3488
3489
  type: Component,
3489
- args: [{ selector: 'bdc-column-progressbar', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<fd-progress-indicator\n [state]=\"state\"\n [valueNow]=\"value | strToNum\"\n [valueMax]=\"maxValue | strToNum\"\n [unit]=\"unit\"\n [valueText]=\"valueText\"\n></fd-progress-indicator>\n", styles: [":host{display:flex;width:100%;height:100%;align-items:stretch;justify-content:stretch}:host fd-progress-indicator{display:block;width:100%}:host fd-progress-indicator ::ng-deep>div{margin:2px!important;display:flex;align-items:center}:host fd-progress-indicator ::ng-deep>div>div{width:100%;display:flex;align-items:center}\n"] }]
3490
+ args: [{ selector: 'bdc-column-progressbar', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<fd-progress-indicator\n [state]=\"state()\"\n [valueNow]=\"signalValue() | strToNum\"\n [valueMax]=\"maxValue() | strToNum\"\n [unit]=\"unit()\"\n [valueText]=\"valueText()\"\n></fd-progress-indicator>\n", styles: [":host{display:flex;width:100%;height:100%;align-items:stretch;justify-content:stretch}:host fd-progress-indicator{display:block;width:100%}:host fd-progress-indicator ::ng-deep>div{margin:2px!important;display:flex;align-items:center}:host fd-progress-indicator ::ng-deep>div>div{width:100%;display:flex;align-items:center}\n"] }]
3490
3491
  }], propDecorators: { layout94: [{
3491
3492
  type: Input
3492
3493
  }], parameters: [{
@@ -3496,20 +3497,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
3496
3497
  class ColumnChipComponent extends ColumnRendererComponent {
3497
3498
  constructor() {
3498
3499
  super(...arguments);
3499
- this.state = 'success';
3500
+ this.state = signal('success');
3501
+ this._columnValueOfParametersPipe = inject(ColumnValueOfParametersPipe);
3502
+ this.chipValue = signal(this.value);
3500
3503
  }
3501
3504
  ngOnInit() {
3502
3505
  super.ngOnInit();
3503
- if (this.parameters?.State) {
3504
- this.state = this.parameters.State$Caption;
3506
+ this._setStateField(this.mo);
3507
+ }
3508
+ ngOnChanges(changes) {
3509
+ super.ngOnChanges(changes);
3510
+ const { mo } = changes;
3511
+ if (mo && !mo.firstChange) {
3512
+ this._setStateField(mo.currentValue);
3513
+ }
3514
+ }
3515
+ _setStateField(mo) {
3516
+ const { State, StateField } = this.parameters;
3517
+ if (State || StateField) {
3518
+ const x = this._columnValueOfParametersPipe.transform(this.allColumns, mo, StateField, this.parameters.State, true);
3519
+ if (x !== this.state()) {
3520
+ this.state.set(x);
3521
+ }
3505
3522
  }
3506
3523
  }
3507
3524
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ColumnChipComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
3508
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: ColumnChipComponent, selector: "bdc-column-chip", inputs: { layout94: "layout94", parameters: "parameters" }, usesInheritance: true, ngImport: i0, template: "@if(value){\n<div\n fd-generic-tag\n [type]=\"state\"\n [name]=\"parameters?.ShowColumnCaption ? column.Alias : ''\"\n [value]=\"value\"\n [attr.title]=\"value\"\n></div>\n}\n", styles: [":host{display:flex;width:100%;height:100%;align-items:stretch;justify-content:stretch}:host ::ng-deep fd-icon{display:none!important}\n"], dependencies: [{ kind: "component", type: i1$8.GenericTagComponent, selector: "[fd-generic-tag]", inputs: ["class", "type", "name", "value", "ariaRoleDescription"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3525
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: ColumnChipComponent, selector: "bdc-column-chip", inputs: { layout94: "layout94", parameters: "parameters" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "@if(value){\n<div\n fd-generic-tag\n [type]=\"state()\"\n [name]=\"parameters?.ShowColumnCaption ? column.Alias : ''\"\n [value]=\"signalValue()\"\n [attr.title]=\"value\"\n></div>\n}\n", styles: [":host{display:flex;width:100%;height:100%;align-items:stretch;justify-content:stretch}:host ::ng-deep fd-icon{display:none!important}\n"], dependencies: [{ kind: "component", type: i1$8.GenericTagComponent, selector: "[fd-generic-tag]", inputs: ["class", "type", "name", "value", "ariaRoleDescription"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3509
3526
  }
3510
3527
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ColumnChipComponent, decorators: [{
3511
3528
  type: Component,
3512
- args: [{ selector: 'bdc-column-chip', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "@if(value){\n<div\n fd-generic-tag\n [type]=\"state\"\n [name]=\"parameters?.ShowColumnCaption ? column.Alias : ''\"\n [value]=\"value\"\n [attr.title]=\"value\"\n></div>\n}\n", styles: [":host{display:flex;width:100%;height:100%;align-items:stretch;justify-content:stretch}:host ::ng-deep fd-icon{display:none!important}\n"] }]
3529
+ args: [{ selector: 'bdc-column-chip', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "@if(value){\n<div\n fd-generic-tag\n [type]=\"state()\"\n [name]=\"parameters?.ShowColumnCaption ? column.Alias : ''\"\n [value]=\"signalValue()\"\n [attr.title]=\"value\"\n></div>\n}\n", styles: [":host{display:flex;width:100%;height:100%;align-items:stretch;justify-content:stretch}:host ::ng-deep fd-icon{display:none!important}\n"] }]
3513
3530
  }], propDecorators: { layout94: [{
3514
3531
  type: Input
3515
3532
  }], parameters: [{