nuxeo-development-framework 5.7.1 → 5.7.3
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/bundles/nuxeo-development-framework.umd.js +211 -11
- package/bundles/nuxeo-development-framework.umd.js.map +1 -1
- package/esm2015/lib/components/pdf-tron/directives/index.js +2 -0
- package/esm2015/lib/components/pdf-tron/directives/ndf-tron-extract-text.directive.js +203 -0
- package/esm2015/lib/components/pdf-tron/models/index.js +2 -0
- package/esm2015/lib/components/pdf-tron/models/tron.model.js +2 -0
- package/esm2015/lib/components/pdf-tron/pdf-tron.module.js +7 -12
- package/esm2015/lib/components/reports/ndf-reports/base/base-custom-report.js +3 -2
- package/esm2015/lib/components/spell-checker-field/spell-checker-field.module.js +1 -1
- package/esm2015/public-api.js +2 -1
- package/fesm2015/nuxeo-development-framework.js +205 -14
- package/fesm2015/nuxeo-development-framework.js.map +1 -1
- package/lib/components/pdf-tron/directives/index.d.ts +1 -0
- package/lib/components/pdf-tron/directives/ndf-tron-extract-text.directive.d.ts +51 -0
- package/lib/components/pdf-tron/models/index.d.ts +1 -0
- package/lib/components/pdf-tron/models/tron.model.d.ts +35 -0
- package/lib/components/pdf-tron/pdf-tron.module.d.ts +3 -2
- package/lib/components/reports/ndf-reports/base/base-custom-report.d.ts +2 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/src/docs/ndf-reports.doc.md +27 -17
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ndf-tron-extract-text.directive';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { AfterViewChecked, EventEmitter, Injector, OnChanges, Renderer2, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { Coordinates, Page, RectangleCoordinates, RGBA, Word } from '../models';
|
|
3
|
+
import { BaseComponent } from '../../../shared';
|
|
4
|
+
import { PdftronService } from '../pdftron/pdftron.service';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class NdfTronExtractText extends BaseComponent implements AfterViewChecked, OnChanges {
|
|
7
|
+
private readonly pdfTronService;
|
|
8
|
+
private readonly renderer;
|
|
9
|
+
private readonly injector;
|
|
10
|
+
listnerAdded: boolean;
|
|
11
|
+
rect: Coordinates;
|
|
12
|
+
pagesZones: {
|
|
13
|
+
pages: Array<any>;
|
|
14
|
+
};
|
|
15
|
+
detectionRectColor: RGBA;
|
|
16
|
+
focusedField: string;
|
|
17
|
+
focusedFieldPrefix: string;
|
|
18
|
+
onExtractText: EventEmitter<string>;
|
|
19
|
+
extractedText: string;
|
|
20
|
+
currentPageNum: number;
|
|
21
|
+
allWords: Array<Word>;
|
|
22
|
+
targetPage: Page;
|
|
23
|
+
savedCoordinates: Array<{
|
|
24
|
+
fieldName: string;
|
|
25
|
+
coordinates: Array<RectangleCoordinates>;
|
|
26
|
+
}>;
|
|
27
|
+
focusedLabelDimensions: {
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
};
|
|
31
|
+
constructor(pdfTronService: PdftronService, renderer: Renderer2, injector: Injector);
|
|
32
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
33
|
+
enableAnnotationRectangle(): void;
|
|
34
|
+
ngAfterViewChecked(): void;
|
|
35
|
+
onAnnotationsChange: (annotations: any, action: any) => void;
|
|
36
|
+
setColorOfRectangle(docViewer: any): void;
|
|
37
|
+
addFieldNameToRectangle(docViewer: any, annotManager: any, Annotations: any): void;
|
|
38
|
+
holdDrawedRectangleCoordinates(ratio: {
|
|
39
|
+
width: number;
|
|
40
|
+
height: number;
|
|
41
|
+
}): void;
|
|
42
|
+
getAllWordsInThePage(): Array<Word>;
|
|
43
|
+
initiateTextDimensions(): void;
|
|
44
|
+
calculateWidthOfText(): {
|
|
45
|
+
width: number;
|
|
46
|
+
height: number;
|
|
47
|
+
};
|
|
48
|
+
get translatedLabel(): any;
|
|
49
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NdfTronExtractText, never>;
|
|
50
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NdfTronExtractText, "[ndfTronExtractText]", never, { "pagesZones": "pagesZones"; "detectionRectColor": "detectionRectColor"; "focusedField": "focusedField"; "focusedFieldPrefix": "focusedFieldPrefix"; }, { "onExtractText": "onExtractText"; }, never>;
|
|
51
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tron.model';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface Page {
|
|
2
|
+
page_height: number;
|
|
3
|
+
page_width: number;
|
|
4
|
+
zones: Array<any>;
|
|
5
|
+
}
|
|
6
|
+
export interface Word {
|
|
7
|
+
confidence: number;
|
|
8
|
+
coordinates: {
|
|
9
|
+
bottom_right: {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
};
|
|
13
|
+
upper_left: {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
text: string;
|
|
19
|
+
}
|
|
20
|
+
export declare type RGBA = {
|
|
21
|
+
R: number;
|
|
22
|
+
G: number;
|
|
23
|
+
B: number;
|
|
24
|
+
A: number;
|
|
25
|
+
};
|
|
26
|
+
export declare type Coordinates = {
|
|
27
|
+
x1: number;
|
|
28
|
+
x2: number;
|
|
29
|
+
y1: number;
|
|
30
|
+
y2: number;
|
|
31
|
+
};
|
|
32
|
+
export declare type RectangleCoordinates = {
|
|
33
|
+
pdfTronCoordinate: Coordinates;
|
|
34
|
+
windowCoordinate: Coordinates;
|
|
35
|
+
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import * as i1 from "./pdftron/pdftron.component";
|
|
3
|
-
import * as i2 from "
|
|
3
|
+
import * as i2 from "./directives/ndf-tron-extract-text.directive";
|
|
4
|
+
import * as i3 from "@angular/common";
|
|
4
5
|
export declare class PdfTronModule {
|
|
5
6
|
static ɵfac: i0.ɵɵFactoryDeclaration<PdfTronModule, never>;
|
|
6
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<PdfTronModule, [typeof i1.PdftronComponent], [typeof
|
|
7
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<PdfTronModule, [typeof i1.PdftronComponent, typeof i2.NdfTronExtractText], [typeof i3.CommonModule], [typeof i1.PdftronComponent, typeof i2.NdfTronExtractText]>;
|
|
7
8
|
static ɵinj: i0.ɵɵInjectorDeclaration<PdfTronModule>;
|
|
8
9
|
}
|
|
@@ -4,13 +4,14 @@ import { BehaviorSubject, ReplaySubject } from 'rxjs';
|
|
|
4
4
|
import { DestroySubject } from '../../../../shared/components';
|
|
5
5
|
import Chart from 'chart.js/auto';
|
|
6
6
|
import { CriteriaModel, CustomChart, CustomChartDefinition, ReportResponseModel } from '../models';
|
|
7
|
-
import { ChartManagerService } from '../services';
|
|
7
|
+
import { ChartManagerService, ChartThemeService } from '../services';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
export declare abstract class BaseCustomReport extends DestroySubject {
|
|
10
10
|
readonly injector: Injector;
|
|
11
11
|
protected chart: Chart;
|
|
12
12
|
protected _printListener: EventListener;
|
|
13
13
|
abstract print(): void;
|
|
14
|
+
protected _chartThemeService: ChartThemeService;
|
|
14
15
|
protected _chartHelperService: ChartManagerService;
|
|
15
16
|
direction: Direction;
|
|
16
17
|
definition: CustomChartDefinition;
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -121,6 +121,7 @@ export * from './lib/components/pdf-tron/pdf-tron.module';
|
|
|
121
121
|
export * from './lib/components/pdf-tron/pdftron/pdftron.component';
|
|
122
122
|
export * from './lib/components/pdf-tron/pdftron/pdftron.service';
|
|
123
123
|
export * from './lib/components/pdf-tron/pdftron/silent-pdftron.service';
|
|
124
|
+
export * from './lib/components/pdf-tron/directives/ndf-tron-extract-text.directive';
|
|
124
125
|
export * from './lib/components/select/select.module';
|
|
125
126
|
export * from './lib/components/select/select/select.component';
|
|
126
127
|
export * from './lib/components/users-card/users-card.component';
|
|
@@ -260,28 +260,35 @@ type NdfReportsFilters = {
|
|
|
260
260
|
fields: FieldConfigModel[];
|
|
261
261
|
visible?: boolean;
|
|
262
262
|
togglePanel?: boolean;
|
|
263
|
-
|
|
263
|
+
reload?: NdfReportsFiltersReloadConfig;
|
|
264
264
|
};
|
|
265
265
|
```
|
|
266
266
|
|
|
267
267
|
### Properties
|
|
268
268
|
|
|
269
|
-
| Property
|
|
270
|
-
|
|
|
271
|
-
| mode
|
|
272
|
-
| payload
|
|
273
|
-
| params
|
|
274
|
-
| fields
|
|
275
|
-
| visible
|
|
276
|
-
| togglePanel
|
|
277
|
-
|
|
|
278
|
-
|
|
279
|
-
### Reload
|
|
269
|
+
| Property | Type | Required | Description |
|
|
270
|
+
| ----------- | ------------------------------- | -------- | ---------------------------------------------- |
|
|
271
|
+
| mode | `'payload' \| 'params'` | ✅ | Where to apply filter values |
|
|
272
|
+
| payload | `Record<string, any>` | ❌ | Default payload values |
|
|
273
|
+
| params | `Record<string, any>` | ❌ | Default query parameters |
|
|
274
|
+
| fields | `FieldConfigModel[]` | ✅ | Filter field configurations |
|
|
275
|
+
| visible | `boolean` | ❌ | Initial visibility of filter UI |
|
|
276
|
+
| togglePanel | `boolean` | ❌ | Allow users to show/hide filter panel |
|
|
277
|
+
| reload | `NdfReportsFiltersReloadConfig` | ❌ | When to reload field data after filter changes |
|
|
278
|
+
|
|
279
|
+
### Reload
|
|
280
|
+
```ts
|
|
281
|
+
type NdfReportsFiltersReloadConfig =
|
|
282
|
+
| { strategy: 'always' }
|
|
283
|
+
| { strategy: 'never' }
|
|
284
|
+
| { strategy: 'onChange'; triggerFields: string[] }
|
|
285
|
+
```
|
|
280
286
|
|
|
281
|
-
|Strategy|Description|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
287
|
+
| Strategy | Description |
|
|
288
|
+
| ---------- | ------------------------------------------------- |
|
|
289
|
+
| `always` | Reload field data every time filters are applied |
|
|
290
|
+
| `never` | Only reload on programmatic configuration changes |
|
|
291
|
+
| `onChange` | Reload only when specific fields changed |
|
|
285
292
|
|
|
286
293
|
### Example Usage
|
|
287
294
|
|
|
@@ -291,7 +298,10 @@ type NdfReportsFilters = {
|
|
|
291
298
|
"mode": "payload",
|
|
292
299
|
"visible": true,
|
|
293
300
|
"togglePanel": true,
|
|
294
|
-
|
|
301
|
+
"reload": {
|
|
302
|
+
"strategy": "onChange",
|
|
303
|
+
"triggerFields": ["dc:title", "dc:category"]
|
|
304
|
+
},
|
|
295
305
|
"fields": [
|
|
296
306
|
{
|
|
297
307
|
"type": "predicate",
|