@acorex/platform 20.0.7 → 20.0.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.
@@ -10,7 +10,7 @@ import { AXDecoratorModule } from '@acorex/components/decorators';
10
10
  import * as i2$1 from '@acorex/components/loading';
11
11
  import { AXLoadingModule } from '@acorex/components/loading';
12
12
  import * as i0 from '@angular/core';
13
- import { computed, EventEmitter, ChangeDetectionStrategy, Component, inject, afterNextRender, HostBinding, signal, effect, ViewEncapsulation, InjectionToken, ViewChild, CUSTOM_ELEMENTS_SCHEMA, untracked, Injectable, output, input, ChangeDetectorRef, viewChild, ElementRef, afterEveryRender, NgZone, model, linkedSignal, HostListener, importProvidersFrom, NgModule } from '@angular/core';
13
+ import { computed, EventEmitter, ChangeDetectionStrategy, Component, inject, afterNextRender, HostBinding, signal, ViewEncapsulation, InjectionToken, effect, ViewChild, CUSTOM_ELEMENTS_SCHEMA, untracked, Injectable, output, input, ChangeDetectorRef, viewChild, ElementRef, afterEveryRender, NgZone, model, linkedSignal, HostListener, importProvidersFrom, NgModule } from '@angular/core';
14
14
  import * as i1 from '@acorex/components/check-box';
15
15
  import { AXCheckBoxModule } from '@acorex/components/check-box';
16
16
  import * as i4 from '@acorex/components/form';
@@ -20,7 +20,7 @@ import { AXLabelModule } from '@acorex/components/label';
20
20
  import { AXValidationModule, AXValidationService } from '@acorex/core/validation';
21
21
  import * as i2$3 from '@angular/forms';
22
22
  import { FormsModule } from '@angular/forms';
23
- import { AXPClipBoardService, AXPSettingService, AXPRegionalService, AXPFilterOperatorMiddlewareService, AXPCleanNestedFilters, AXPFileStorageService, AXPFileTypeProviderService, ALL_DEFAULT_OPERATORS, DATE_OPERATORS, BOOLEAN_OPERATORS, NUMBER_OPERATORS, STRING_OPERATORS } from '@acorex/platform/common';
23
+ import { AXPClipBoardService, AXPRegionalService, AXPFilterOperatorMiddlewareService, AXPCleanNestedFilters, AXPFileStorageService, AXPFileTypeProviderService, ALL_DEFAULT_OPERATORS, DATE_OPERATORS, BOOLEAN_OPERATORS, NUMBER_OPERATORS, STRING_OPERATORS } from '@acorex/platform/common';
24
24
  import { AXPopupService } from '@acorex/components/popup';
25
25
  import * as i3 from '@acorex/components/select-box';
26
26
  import { AXSelectBoxModule, AXSelectBoxComponent } from '@acorex/components/select-box';
@@ -34,12 +34,12 @@ import { AXBasePageComponent } from '@acorex/components/page';
34
34
  import { AXDateTimeFormatter, AXTimeDurationFormatter, AXCalendarService } from '@acorex/core/date-time';
35
35
  import * as i3$1 from '@acorex/components/datetime-box';
36
36
  import { AXDateTimeBoxModule } from '@acorex/components/datetime-box';
37
- import { AXFormatService } from '@acorex/core/format';
38
37
  import * as i5 from '@acorex/components/text-area';
39
38
  import { AXTextAreaModule } from '@acorex/components/text-area';
40
39
  import { set, isNumber, castArray, cloneDeep, isEqual, sum, get } from 'lodash-es';
41
40
  import * as i4$1 from '@acorex/components/tabs';
42
41
  import { AXTabsModule } from '@acorex/components/tabs';
42
+ import { AXFormatService } from '@acorex/core/format';
43
43
  import * as i1$5 from '@acorex/components/number-box';
44
44
  import { AXNumberBoxModule } from '@acorex/components/number-box';
45
45
  import * as i3$2 from '@acorex/components/password-box';
@@ -2056,11 +2056,10 @@ var dateTimeBoxWidgetFilter_component = /*#__PURE__*/Object.freeze({
2056
2056
  class AXPDateTimeBoxWidgetColumnComponent extends AXPColumnWidgetComponent {
2057
2057
  constructor() {
2058
2058
  super(...arguments);
2059
- this.formatter = inject(AXFormatService);
2060
- this.settingService = inject(AXPSettingService);
2061
- this.convertedValue = signal(this.rawValue);
2062
- this.multiple = this.options['multiple'] || false;
2063
- this.mode = computed(() => {
2059
+ this.formatter = inject(AXDateTimeFormatter);
2060
+ this.translationService = inject(AXTranslationService);
2061
+ this.multiple = this.options['multiple'];
2062
+ this.format = computed(() => {
2064
2063
  const rawValue = this.options['format'];
2065
2064
  if (typeof rawValue == 'string')
2066
2065
  return rawValue;
@@ -2069,44 +2068,28 @@ class AXPDateTimeBoxWidgetColumnComponent extends AXPColumnWidgetComponent {
2069
2068
  else
2070
2069
  return 'date';
2071
2070
  });
2072
- this.#effect = effect(() => {
2073
- this.updateValue();
2074
- });
2075
- this.updateValue = async () => {
2076
- const rawValue = this.rawValue;
2077
- if (rawValue == null) {
2078
- this.convertedValue.set(null);
2079
- }
2080
- if (this.isArray(rawValue)) {
2081
- this.convertedValue.set(rawValue.map((item) => this.handleFormat(item)).join(', '));
2082
- }
2083
- else {
2084
- this.convertedValue.set(await this.handleFormat(rawValue));
2085
- }
2086
- };
2071
+ this.internalValue = () => Array.isArray(this.rawValue)
2072
+ ? this.rawValue.map((v) => this.handleFormat(v))
2073
+ : [this.handleFormat(this.rawValue)];
2087
2074
  }
2088
- #effect;
2089
- async handleFormat(value) {
2090
- const format = await this.settingService.get('regional:short-date');
2075
+ handleFormat(value) {
2091
2076
  return value
2092
- ? this.formatter.format(new Date(value), this.mode(), {
2093
- format: format,
2077
+ ? this.formatter.format(new Date(value), {
2078
+ format: this.format(),
2079
+ locale: this.translationService.getActiveLang() === 'fa' ? 'fa' : undefined,
2094
2080
  })
2095
2081
  : '---';
2096
2082
  }
2097
- isArray(val) {
2098
- return Array.isArray(val);
2099
- }
2100
2083
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: AXPDateTimeBoxWidgetColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2101
2084
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.6", type: AXPDateTimeBoxWidgetColumnComponent, isStandalone: true, selector: "ng-component", inputs: { rawValue: "rawValue", rowData: "rowData" }, usesInheritance: true, ngImport: i0, template: `<div class="ax-flex">
2102
- <span [dir]="'ltr'" [title]="convertedValue()">{{ convertedValue() }}</span>
2085
+ <span [dir]="'ltr'" [title]="internalValue()">{{ internalValue() }}</span>
2103
2086
  </div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2104
2087
  }
2105
2088
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: AXPDateTimeBoxWidgetColumnComponent, decorators: [{
2106
2089
  type: Component,
2107
2090
  args: [{
2108
2091
  template: `<div class="ax-flex">
2109
- <span [dir]="'ltr'" [title]="convertedValue()">{{ convertedValue() }}</span>
2092
+ <span [dir]="'ltr'" [title]="internalValue()">{{ internalValue() }}</span>
2110
2093
  </div>`,
2111
2094
  changeDetection: ChangeDetectionStrategy.OnPush,
2112
2095
  imports: [CommonModule],