@acorex/components 20.2.26 → 20.2.28

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.
@@ -1025,7 +1025,7 @@ declare class AXDataTableComponent extends AXBaseDataTable implements OnInit, Af
1025
1025
  /**
1026
1026
  * @ignore
1027
1027
  */
1028
- private hasLoadedData;
1028
+ private isRefreshCalled;
1029
1029
  /**
1030
1030
  * Returns true if in manual mode and no data has been loaded yet.
1031
1031
  */
package/editor/index.d.ts CHANGED
@@ -3,12 +3,48 @@ import * as i0 from '@angular/core';
3
3
  import { MXInputBaseValueComponent, MXLookComponent } from '@acorex/cdk/common';
4
4
  import { OutputData } from '@editorjs/editorjs';
5
5
 
6
- type EditorJsTool = 'header' | 'list' | 'raw' | 'image' | 'quote' | 'code' | 'underline' | 'color';
6
+ type EditorJsTool = 'header' | 'list' | 'raw' | 'image' | 'quote' | 'codeBox' | 'underline' | 'color';
7
7
  type ImageToolConfig = {
8
- endpoints: {
8
+ endpoints?: {
9
9
  byFile: string;
10
10
  byUrl: string;
11
11
  };
12
+ /** Name of the uploaded image field in POST request (default: "image") */
13
+ field?: string;
14
+ /** Mime-types of files accepted (default: "image/*") */
15
+ types?: string;
16
+ /** Extra data to send with upload requests */
17
+ additionalRequestData?: Record<string, any>;
18
+ /** Custom headers to include in upload requests */
19
+ additionalRequestHeaders?: Record<string, string>;
20
+ /** Placeholder text for the caption input (default: "Caption") */
21
+ captionPlaceholder?: string;
22
+ /** HTML content for the “Select file” button */
23
+ buttonContent?: string;
24
+ /** Custom uploader methods */
25
+ uploader?: {
26
+ uploadByFile?: (file: File) => Promise<{
27
+ success: number;
28
+ file: {
29
+ url: string;
30
+ };
31
+ }>;
32
+ uploadByUrl?: (url: string) => Promise<{
33
+ success: number;
34
+ file: {
35
+ url: string;
36
+ };
37
+ }>;
38
+ };
39
+ /** Custom actions for the tool's settings menu */
40
+ actions?: Array<Record<string, any>>;
41
+ /** Feature toggles (border, background, caption, etc.) */
42
+ features?: {
43
+ border?: boolean;
44
+ background?: boolean;
45
+ caption?: boolean;
46
+ [key: string]: any;
47
+ };
12
48
  };
13
49
 
14
50
  declare const AXEditorComponent_base: polytype.Polytype.ClusteredConstructor<[{
@@ -18,8 +54,11 @@ declare const AXEditorComponent_base: polytype.Polytype.ClusteredConstructor<[{
18
54
  }, typeof MXLookComponent]>;
19
55
  declare class AXEditorComponent extends AXEditorComponent_base {
20
56
  #private;
57
+ toolLoaders: Record<EditorJsTool, () => Promise<any>>;
21
58
  private editorHolder;
59
+ private platform;
22
60
  modules: i0.InputSignal<EditorJsTool[]>;
61
+ imageConfig: i0.InputSignal<ImageToolConfig>;
23
62
  private editorClass;
24
63
  private colorConfig;
25
64
  private markerConfig;
@@ -28,7 +67,7 @@ declare class AXEditorComponent extends AXEditorComponent_base {
28
67
  private get __hostName();
29
68
  save(): Promise<OutputData>;
30
69
  static ɵfac: i0.ɵɵFactoryDeclaration<AXEditorComponent, never>;
31
- static ɵcmp: i0.ɵɵComponentDeclaration<AXEditorComponent, "ax-editor", never, { "look": { "alias": "look"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "modules": { "alias": "modules"; "required": false; "isSignal": true; }; }, { "onValueChanged": "onValueChanged"; }, never, ["ax-validation-rule"], true, never>;
70
+ static ɵcmp: i0.ɵɵComponentDeclaration<AXEditorComponent, "ax-editor", never, { "look": { "alias": "look"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "modules": { "alias": "modules"; "required": false; "isSignal": true; }; "imageConfig": { "alias": "imageConfig"; "required": false; "isSignal": true; }; }, { "onValueChanged": "onValueChanged"; }, never, ["ax-validation-rule"], true, never>;
32
71
  }
33
72
 
34
73
  declare class EditorModule {
@@ -1,6 +1,6 @@
1
1
  import { MXBaseComponent, convertArrayToDataSource, AXComponent, AXRippleDirective, AXListDataSource, AXPagedComponent, AXCommonModule } from '@acorex/cdk/common';
2
2
  import * as i0 from '@angular/core';
3
- import { EventEmitter, signal, Input, Output, Injectable, inject, ElementRef, Renderer2, NgZone, ChangeDetectorRef, DOCUMENT, PLATFORM_ID, HostListener, Directive, ViewChild, ChangeDetectionStrategy, ViewEncapsulation, Component, computed, effect, ContentChildren, ContentChild, NgModule } from '@angular/core';
3
+ import { EventEmitter, signal, Input, Output, Injectable, inject, ElementRef, Renderer2, NgZone, ChangeDetectorRef, DOCUMENT, PLATFORM_ID, HostListener, Directive, ViewChild, ChangeDetectionStrategy, ViewEncapsulation, Component, computed, effect, untracked, ContentChildren, ContentChild, NgModule } from '@angular/core';
4
4
  import { isEqual, cloneDeep } from 'lodash-es';
5
5
  import { isPlatformBrowser, AsyncPipe, NgTemplateOutlet, NgClass, CommonModule } from '@angular/common';
6
6
  import { Subject, debounceTime, buffer, filter } from 'rxjs';
@@ -1388,7 +1388,7 @@ class AXDataTableComponent extends AXBaseDataTable {
1388
1388
  /**
1389
1389
  * @ignore
1390
1390
  */
1391
- this.hasLoadedData = false;
1391
+ this.isRefreshCalled = signal(false, ...(ngDevMode ? [{ debugName: "isRefreshCalled" }] : []));
1392
1392
  /**
1393
1393
  * @ignore
1394
1394
  */
@@ -1450,7 +1450,7 @@ class AXDataTableComponent extends AXBaseDataTable {
1450
1450
  * Returns true if in manual mode and no data has been loaded yet.
1451
1451
  */
1452
1452
  get showNoDataLoadedYet() {
1453
- return this.fetchDataMode === 'manual' && !this.hasLoadedData;
1453
+ return this.fetchDataMode === 'manual' && !this.isRefreshCalled();
1454
1454
  }
1455
1455
  /**
1456
1456
  * @ignore
@@ -1474,9 +1474,6 @@ class AXDataTableComponent extends AXBaseDataTable {
1474
1474
  this.displayedRows.set(data.items.filter((item) => !item[this.parentField]));
1475
1475
  this.totalRows = data.totalCount;
1476
1476
  this.hasItems = data.totalCount > 0;
1477
- if (this.fetchDataMode === 'manual' && !this.hasLoadedData) {
1478
- this.hasLoadedData = true;
1479
- }
1480
1477
  });
1481
1478
  this.dataSource.onItemExpanded.pipe(this._unsubscriber.takeUntilDestroy).subscribe((data) => {
1482
1479
  const { expandedItem, children } = data;
@@ -1663,6 +1660,10 @@ class AXDataTableComponent extends AXBaseDataTable {
1663
1660
  */
1664
1661
  refresh(options = { reset: true }) {
1665
1662
  this.dataSource.refresh(options);
1663
+ const isRefreshCalled = untracked(() => this.isRefreshCalled());
1664
+ if (this.fetchDataMode === 'manual' && !isRefreshCalled) {
1665
+ this.isRefreshCalled.set(true);
1666
+ }
1666
1667
  if (this.dataPager && options.reset) {
1667
1668
  this.dataPager.goFirstPage();
1668
1669
  }