@acorex/platform 19.2.4 → 19.2.5

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.
Files changed (52) hide show
  1. package/common/lib/layout/menu/menu.types.d.ts +2 -1
  2. package/common/lib/utils/export-popup.d.ts +19 -0
  3. package/common/lib/utils/export.service.d.ts +21 -0
  4. package/common/lib/utils/index.d.ts +1 -1
  5. package/fesm2022/acorex-platform-common.mjs +236 -84
  6. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  7. package/fesm2022/acorex-platform-layout-designer.mjs +8 -8
  8. package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
  9. package/fesm2022/acorex-platform-layout-entity.mjs +3 -3
  10. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  11. package/fesm2022/acorex-platform-layout-search.mjs +10 -6
  12. package/fesm2022/acorex-platform-layout-search.mjs.map +1 -1
  13. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-CgyBuwTc.mjs +108 -0
  14. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-CgyBuwTc.mjs.map +1 -0
  15. package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-DarhCaO1.mjs → acorex-platform-themes-default-entity-master-list-view.component-Btza4YAZ.mjs} +6 -6
  16. package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-DarhCaO1.mjs.map → acorex-platform-themes-default-entity-master-list-view.component-Btza4YAZ.mjs.map} +1 -1
  17. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-U8aBv1Ql.mjs +87 -0
  18. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-U8aBv1Ql.mjs.map +1 -0
  19. package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-Bwgawuvl.mjs → acorex-platform-themes-default-entity-master-single-view.component-63iOyFsf.mjs} +4 -4
  20. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-63iOyFsf.mjs.map +1 -0
  21. package/fesm2022/acorex-platform-themes-default-search-popup.component-DZHRY0aM.mjs +129 -0
  22. package/fesm2022/acorex-platform-themes-default-search-popup.component-DZHRY0aM.mjs.map +1 -0
  23. package/fesm2022/{acorex-platform-themes-default-setting-page.component-CGjDwlvq.mjs → acorex-platform-themes-default-setting-page.component-Cj83wZbs.mjs} +3 -3
  24. package/fesm2022/{acorex-platform-themes-default-setting-page.component-CGjDwlvq.mjs.map → acorex-platform-themes-default-setting-page.component-Cj83wZbs.mjs.map} +1 -1
  25. package/fesm2022/{acorex-platform-themes-default-setting-view.component-DK9j13yV.mjs → acorex-platform-themes-default-setting-view.component-Ypj7RgOU.mjs} +2 -2
  26. package/fesm2022/{acorex-platform-themes-default-setting-view.component-DK9j13yV.mjs.map → acorex-platform-themes-default-setting-view.component-Ypj7RgOU.mjs.map} +1 -1
  27. package/fesm2022/{acorex-platform-themes-default-theme-palette-preview.page-C3RJdApv.mjs → acorex-platform-themes-default-theme-palette-preview.page-D994cHWW.mjs} +2 -2
  28. package/fesm2022/{acorex-platform-themes-default-theme-palette-preview.page-C3RJdApv.mjs.map → acorex-platform-themes-default-theme-palette-preview.page-D994cHWW.mjs.map} +1 -1
  29. package/fesm2022/acorex-platform-themes-default.mjs +21 -21
  30. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  31. package/fesm2022/acorex-platform-themes-shared.mjs +11 -6
  32. package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
  33. package/fesm2022/{acorex-platform-widgets-button-widget-designer.component-B53z9A_A.mjs → acorex-platform-widgets-button-widget-designer.component-2iWPztWW.mjs} +2 -2
  34. package/fesm2022/{acorex-platform-widgets-button-widget-designer.component-B53z9A_A.mjs.map → acorex-platform-widgets-button-widget-designer.component-2iWPztWW.mjs.map} +1 -1
  35. package/fesm2022/{acorex-platform-widgets-rich-text-popup.component-CHDMlorX.mjs → acorex-platform-widgets-rich-text-popup.component-DYExfz5U.mjs} +2 -2
  36. package/fesm2022/{acorex-platform-widgets-rich-text-popup.component-CHDMlorX.mjs.map → acorex-platform-widgets-rich-text-popup.component-DYExfz5U.mjs.map} +1 -1
  37. package/fesm2022/acorex-platform-widgets.mjs +21 -21
  38. package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
  39. package/layout/search/lib/search.viewmodel.d.ts +2 -1
  40. package/package.json +2 -2
  41. package/themes/default/lib/layouts/search-layout/search-popup.component.d.ts +2 -1
  42. package/themes/shared/lib/components/layout-elements/layout-blocks.component.d.ts +1 -1
  43. package/themes/shared/lib/components/layout-elements/layout-header.component.d.ts +1 -1
  44. package/themes/shared/lib/components/layout-elements/layout-list.component.d.ts +1 -1
  45. package/common/lib/utils/pdf.service.d.ts +0 -25
  46. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Yq3pzh9K.mjs +0 -108
  47. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Yq3pzh9K.mjs.map +0 -1
  48. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-CPG4i72f.mjs +0 -87
  49. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-CPG4i72f.mjs.map +0 -1
  50. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-Bwgawuvl.mjs.map +0 -1
  51. package/fesm2022/acorex-platform-themes-default-search-popup.component-ChZHzvG4.mjs +0 -122
  52. package/fesm2022/acorex-platform-themes-default-search-popup.component-ChZHzvG4.mjs.map +0 -1
@@ -1,8 +1,9 @@
1
1
  import { AXPNavigateActionCommand } from '@acorex/platform/core';
2
2
  export type AXPMenuInsertion = 'before' | 'after' | 'inside';
3
+ export type AXPMenuType = 'menu' | 'group' | 'break';
3
4
  export interface AXPMenuItem {
4
5
  text: string;
5
- type?: 'menu' | 'group';
6
+ type?: AXPMenuType;
6
7
  name?: string;
7
8
  description?: string;
8
9
  icon?: string;
@@ -0,0 +1,19 @@
1
+ import { AXBasePageComponent } from '@acorex/components/page';
2
+ import * as i0 from "@angular/core";
3
+ export declare class AXMOrgChartPrintPage extends AXBasePageComponent {
4
+ #private;
5
+ private data;
6
+ protected ratio: import("@angular/core").WritableSignal<boolean>;
7
+ protected baseWidth: import("@angular/core").WritableSignal<number | undefined>;
8
+ protected baseHeight: import("@angular/core").WritableSignal<number | undefined>;
9
+ protected bgcolor: import("@angular/core").ModelSignal<string | undefined>;
10
+ protected width: import("@angular/core").ModelSignal<number | undefined>;
11
+ protected height: import("@angular/core").ModelSignal<number | undefined>;
12
+ protected quality: import("@angular/core").ModelSignal<number | undefined>;
13
+ protected qualityComputed: import("@angular/core").WritableSignal<number>;
14
+ protected scale: import("@angular/core").ModelSignal<number | undefined>;
15
+ protected calculateRatio(value: number, type: 'width' | 'height'): void;
16
+ protected handleClose(isCanceled?: boolean): Promise<void>;
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXMOrgChartPrintPage, never>;
18
+ static ɵcmp: i0.ɵɵComponentDeclaration<AXMOrgChartPrintPage, "ng-component", never, { "bgcolor": { "alias": "bgcolor"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "quality": { "alias": "quality"; "required": false; "isSignal": true; }; "scale": { "alias": "scale"; "required": false; "isSignal": true; }; }, { "bgcolor": "bgcolorChange"; "width": "widthChange"; "height": "heightChange"; "quality": "qualityChange"; "scale": "scaleChange"; }, never, never, true, never>;
19
+ }
@@ -0,0 +1,21 @@
1
+ import { AXPopupService } from '@acorex/components/popup';
2
+ import * as i0 from "@angular/core";
3
+ export declare class AXPExportService {
4
+ popupService: AXPopupService;
5
+ generateBlobFromElement(element: HTMLElement, blobOptions?: AXPDomToImageOptions): Promise<Blob>;
6
+ download(blob: Blob, filename: string): void;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXPExportService, never>;
8
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXPExportService>;
9
+ }
10
+ export interface AXPDomToImageOptions {
11
+ popup?: true;
12
+ filter?: (node: Node) => boolean;
13
+ bgcolor?: string;
14
+ width?: number;
15
+ height?: number;
16
+ style?: {};
17
+ quality?: number;
18
+ imagePlaceholder?: string;
19
+ cacheBust?: boolean;
20
+ scale?: number;
21
+ }
@@ -1,3 +1,3 @@
1
1
  export * from './clipboard-service';
2
2
  export * from './data-generator';
3
- export * from './pdf.service';
3
+ export * from './export.service';
@@ -1,19 +1,32 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, provideAppInitializer, inject, InjectionToken, RendererFactory2, Injector, ErrorHandler, Directive, Input, EventEmitter, Output, runInInjectionContext, NgModule, Optional, Inject, Component, ViewEncapsulation } from '@angular/core';
2
+ import { Injectable, provideAppInitializer, inject, InjectionToken, signal, model, linkedSignal, afterNextRender, Component, Injector, ErrorHandler, Directive, Input, EventEmitter, Output, runInInjectionContext, NgModule, Optional, Inject, ViewEncapsulation } from '@angular/core';
3
3
  import { kebabCase, sortBy, omit, merge, cloneDeep, get } from 'lodash-es';
4
- import { AXPopupModule } from '@acorex/components/popup';
4
+ import { AXPopupService, AXPopupModule } from '@acorex/components/popup';
5
5
  import { AXToastService, AXToastModule } from '@acorex/components/toast';
6
6
  import { AXDateTimeModule } from '@acorex/core/date-time';
7
- import * as i4 from '@acorex/platform/workflow';
7
+ import * as i4$1 from '@acorex/platform/workflow';
8
8
  import { AXPWorkflowService, createWorkFlowEvent, AXPWorkflowAction, AXPWorkflowError, AXPWorkflowModule } from '@acorex/platform/workflow';
9
9
  import { Router, RouterModule } from '@angular/router';
10
10
  import { applySortArray, applyFilterArray } from '@acorex/platform/core';
11
11
  import Dexie from 'dexie';
12
- import * as i3 from '@acorex/components/decorators';
12
+ import * as i5 from '@acorex/components/button';
13
+ import { AXButtonModule } from '@acorex/components/button';
14
+ import { AXCheckBoxModule } from '@acorex/components/check-box';
15
+ import * as i6 from '@acorex/components/color-box';
16
+ import { AXColorBoxModule } from '@acorex/components/color-box';
17
+ import * as i4 from '@acorex/components/decorators';
13
18
  import { AXDecoratorModule } from '@acorex/components/decorators';
14
- import * as i2 from '@acorex/components/image';
19
+ import * as i3 from '@acorex/components/label';
20
+ import { AXLabelModule } from '@acorex/components/label';
21
+ import * as i2 from '@acorex/components/number-box';
22
+ import { AXNumberBoxModule } from '@acorex/components/number-box';
23
+ import { AXBasePageComponent } from '@acorex/components/page';
24
+ import { AXTextBoxModule } from '@acorex/components/text-box';
25
+ import * as i1 from '@angular/forms';
26
+ import { FormsModule } from '@angular/forms';
27
+ import * as i2$1 from '@acorex/components/image';
15
28
  import { AXImageModule } from '@acorex/components/image';
16
- import * as i1 from '@angular/common';
29
+ import * as i1$1 from '@angular/common';
17
30
  import { CommonModule } from '@angular/common';
18
31
  import { signalStore, withState, withMethods, patchState, withHooks } from '@ngrx/signals';
19
32
  import { AXTranslationService } from '@acorex/core/translation';
@@ -374,86 +387,226 @@ class AXPDataGenerator {
374
387
  }
375
388
  }
376
389
 
377
- // AXPPdfService
378
- var AXPPdfPageSize;
379
- (function (AXPPdfPageSize) {
380
- AXPPdfPageSize["A4"] = "a4";
381
- AXPPdfPageSize["A5"] = "a5";
382
- AXPPdfPageSize["Letter"] = "letter";
383
- AXPPdfPageSize["Legal"] = "legal";
384
- AXPPdfPageSize["Custom"] = "custom"; // Handle custom sizes
385
- })(AXPPdfPageSize || (AXPPdfPageSize = {}));
386
- class AXPPdfService {
390
+ class AXMOrgChartPrintPage extends AXBasePageComponent {
387
391
  constructor() {
388
- this.renderer = inject(RendererFactory2).createRenderer(null, null);
389
- }
390
- async generatePdfBlob(div, options = {}) {
391
- const { jsPDF } = await import('jspdf');
392
- const html2canvas = (await import('html2canvas')).default;
393
- const element = typeof div === 'string' ? document.getElementById(div) : div;
394
- if (!element) {
395
- console.error('Element not found.');
396
- return Promise.reject('Element not found.');
397
- }
398
- const { pageSize = AXPPdfPageSize.A4 } = options;
399
- let pdf;
400
- if (typeof pageSize === 'string' && pageSize !== AXPPdfPageSize.Custom) {
401
- pdf = new jsPDF({
402
- orientation: 'portrait',
403
- format: pageSize
404
- });
392
+ super(...arguments);
393
+ this.ratio = signal(false);
394
+ this.baseWidth = signal(undefined);
395
+ this.baseHeight = signal(undefined);
396
+ this.bgcolor = model();
397
+ this.width = model();
398
+ this.height = model();
399
+ this.quality = model();
400
+ this.qualityComputed = linkedSignal(() => (this.data.quality ?? 1) * 100);
401
+ this.scale = model();
402
+ this.#init = afterNextRender(() => {
403
+ this.bgcolor.set(this.data.bgcolor);
404
+ this.width.set(this.data.width);
405
+ this.baseWidth.set(this.data.width);
406
+ this.height.set(this.data.height);
407
+ this.baseHeight.set(this.data.height);
408
+ this.quality.set(this.data.quality);
409
+ this.scale.set(this.data.scale);
410
+ });
411
+ }
412
+ #init;
413
+ calculateRatio(value, type) {
414
+ if (!this.ratio())
415
+ return;
416
+ if (type === 'width') {
417
+ const newHeight = Math.round((value / this.baseWidth()) * this.baseHeight());
418
+ this.height.set(newHeight);
405
419
  }
406
- else if (typeof pageSize !== 'string') {
407
- const { width, height } = pageSize;
408
- pdf = new jsPDF({
409
- orientation: 'portrait',
410
- unit: 'pt',
411
- format: [width, height]
420
+ else {
421
+ const newWidth = Math.round((value / this.baseHeight()) * this.baseWidth());
422
+ this.width.set(newWidth);
423
+ }
424
+ }
425
+ async handleClose(isCanceled = false) {
426
+ this.close({
427
+ bgcolor: this.bgcolor(),
428
+ width: this.width(),
429
+ height: this.height(),
430
+ quality: this.qualityComputed() / 100,
431
+ scale: this.scale(),
432
+ isCanceled,
433
+ });
434
+ }
435
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartPrintPage, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
436
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.3", type: AXMOrgChartPrintPage, isStandalone: true, selector: "ng-component", inputs: { bgcolor: { classPropertyName: "bgcolor", publicName: "bgcolor", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, quality: { classPropertyName: "quality", publicName: "quality", isSignal: true, isRequired: false, transformFunction: null }, scale: { classPropertyName: "scale", publicName: "scale", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { bgcolor: "bgcolorChange", width: "widthChange", height: "heightChange", quality: "qualityChange", scale: "scaleChange" }, usesInheritance: true, ngImport: i0, template: ` <div class="ax-grid ax-grid-cols-[auto_18rem] ax-gap-4 ax-justify-center ax-p-4 ax-items-center">
437
+ <ax-label>Resolution (px)</ax-label>
438
+ <div class="ax-flex ax-gap-2 ax-items-center">
439
+ <ax-number-box
440
+ [changeOnScroll]="true"
441
+ [decimals]="4"
442
+ [(ngModel)]="width"
443
+ (ngModelChange)="calculateRatio($event, 'width')"
444
+ name="Width"
445
+ >
446
+ </ax-number-box>
447
+ <ax-button [toggleable]="true" [(selected)]="ratio"
448
+ ><ax-icon><i class="fa-solid fa-vector-square"></i></ax-icon
449
+ ></ax-button>
450
+ <ax-number-box
451
+ [changeOnScroll]="true"
452
+ [decimals]="4"
453
+ [(ngModel)]="height"
454
+ (ngModelChange)="calculateRatio($event, 'height')"
455
+ name="Height"
456
+ >
457
+ </ax-number-box>
458
+ </div>
459
+
460
+ <ax-label>Background color</ax-label>
461
+ <ax-color-box [(ngModel)]="bgcolor"></ax-color-box>
462
+
463
+ <ax-label>Quality of image (50-100%)</ax-label>
464
+ <ax-number-box
465
+ [changeOnScroll]="true"
466
+ [minValue]="50"
467
+ [maxValue]="100"
468
+ [(ngModel)]="qualityComputed"
469
+ name="Quality"
470
+ >
471
+ </ax-number-box>
472
+
473
+ <ax-label>Scale</ax-label>
474
+ <ax-number-box [changeOnScroll]="true" [minValue]="1" [(ngModel)]="scale" name="scale"> </ax-number-box>
475
+ </div>
476
+
477
+ <ax-footer>
478
+ <ax-suffix>
479
+ <ax-button text="Print" look="solid" color="primary" (onClick)="handleClose()">
480
+ <ax-icon class="fa-solid fa-print"> </ax-icon>
481
+ </ax-button>
482
+ </ax-suffix>
483
+ <ax-prefix>
484
+ <ax-button text="Cancel" look="solid" color="danger" (onClick)="handleClose(true)"> </ax-button>
485
+ </ax-prefix>
486
+ </ax-footer>`, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXCheckBoxModule }, { kind: "ngmodule", type: AXNumberBoxModule }, { kind: "component", type: i2.AXNumberBoxComponent, selector: "ax-number-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "changeOnScroll", "thousandsSeparator", "padDecimalZeros", "step", "decimals", "decimalStep", "showSpinButtons", "minValue", "maxValue", "class"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXTextBoxModule }, { kind: "ngmodule", type: AXLabelModule }, { kind: "component", type: i3.AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i4.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i5.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXColorBoxModule }, { kind: "component", type: i6.AXColorBoxComponent, selector: "ax-color-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "showBadge", "showValue", "showClearButton", "showIcon"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange"] }] }); }
487
+ }
488
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartPrintPage, decorators: [{
489
+ type: Component,
490
+ args: [{
491
+ template: ` <div class="ax-grid ax-grid-cols-[auto_18rem] ax-gap-4 ax-justify-center ax-p-4 ax-items-center">
492
+ <ax-label>Resolution (px)</ax-label>
493
+ <div class="ax-flex ax-gap-2 ax-items-center">
494
+ <ax-number-box
495
+ [changeOnScroll]="true"
496
+ [decimals]="4"
497
+ [(ngModel)]="width"
498
+ (ngModelChange)="calculateRatio($event, 'width')"
499
+ name="Width"
500
+ >
501
+ </ax-number-box>
502
+ <ax-button [toggleable]="true" [(selected)]="ratio"
503
+ ><ax-icon><i class="fa-solid fa-vector-square"></i></ax-icon
504
+ ></ax-button>
505
+ <ax-number-box
506
+ [changeOnScroll]="true"
507
+ [decimals]="4"
508
+ [(ngModel)]="height"
509
+ (ngModelChange)="calculateRatio($event, 'height')"
510
+ name="Height"
511
+ >
512
+ </ax-number-box>
513
+ </div>
514
+
515
+ <ax-label>Background color</ax-label>
516
+ <ax-color-box [(ngModel)]="bgcolor"></ax-color-box>
517
+
518
+ <ax-label>Quality of image (50-100%)</ax-label>
519
+ <ax-number-box
520
+ [changeOnScroll]="true"
521
+ [minValue]="50"
522
+ [maxValue]="100"
523
+ [(ngModel)]="qualityComputed"
524
+ name="Quality"
525
+ >
526
+ </ax-number-box>
527
+
528
+ <ax-label>Scale</ax-label>
529
+ <ax-number-box [changeOnScroll]="true" [minValue]="1" [(ngModel)]="scale" name="scale"> </ax-number-box>
530
+ </div>
531
+
532
+ <ax-footer>
533
+ <ax-suffix>
534
+ <ax-button text="Print" look="solid" color="primary" (onClick)="handleClose()">
535
+ <ax-icon class="fa-solid fa-print"> </ax-icon>
536
+ </ax-button>
537
+ </ax-suffix>
538
+ <ax-prefix>
539
+ <ax-button text="Cancel" look="solid" color="danger" (onClick)="handleClose(true)"> </ax-button>
540
+ </ax-prefix>
541
+ </ax-footer>`,
542
+ imports: [
543
+ FormsModule,
544
+ AXCheckBoxModule,
545
+ AXNumberBoxModule,
546
+ AXTextBoxModule,
547
+ AXLabelModule,
548
+ AXDecoratorModule,
549
+ AXButtonModule,
550
+ AXColorBoxModule,
551
+ ],
552
+ }]
553
+ }] });
554
+
555
+ // AXPPdfService
556
+ class AXPExportService {
557
+ constructor() {
558
+ this.popupService = inject(AXPopupService);
559
+ }
560
+ async generateBlobFromElement(element, blobOptions) {
561
+ const domtoimage = (await import('dom-to-image')).default;
562
+ const originalWidth = element.scrollWidth;
563
+ const originalHeight = element.scrollHeight;
564
+ let popup, options = {}, newOptions = {};
565
+ if (blobOptions) {
566
+ ({ popup, ...options } = blobOptions);
567
+ }
568
+ if (popup) {
569
+ const result = await this.popupService.open(AXMOrgChartPrintPage, {
570
+ header: true,
571
+ size: 'fit',
572
+ draggable: true,
573
+ hasBackdrop: true,
574
+ title: 'Export Options',
575
+ data: { data: options },
412
576
  });
577
+ if (result.data.isCanceled) {
578
+ throw new Error('Process is Canceled by User!');
579
+ }
580
+ else {
581
+ newOptions = result.data;
582
+ }
413
583
  }
414
- else {
415
- return Promise.reject("Invalid page size.");
416
- }
417
- const canvas = await html2canvas(element);
418
- const imageData = canvas.toDataURL('image/png');
419
- const imgProps = pdf.getImageProperties(imageData);
420
- const pdfWidth = pdf.internal.pageSize.getWidth();
421
- const pdfHeight = (imgProps.height * pdfWidth) / imgProps.width;
422
- pdf.addImage(imageData, 'PNG', 0, 0, pdfWidth, pdfHeight);
423
- return pdf.output('bloburl');
424
- }
425
- async printPdf(div, options = {}) {
426
- const blobUrl = await this.generatePdfBlob(div, options).catch(err => {
427
- console.error('Failed to generate PDF', err);
428
- return null;
584
+ return domtoimage.toBlob(element, {
585
+ ...newOptions,
586
+ width: (newOptions.width ?? originalWidth) * (newOptions?.scale ?? 1),
587
+ height: (newOptions.height ?? originalHeight) * (newOptions?.scale ?? 1),
588
+ style: {
589
+ transform: `scale(${newOptions?.scale ?? 1})`,
590
+ transformOrigin: 'top left',
591
+ },
429
592
  });
430
- if (!blobUrl)
431
- return;
432
- const iframe = this.renderer.createElement('iframe');
433
- this.renderer.setStyle(iframe, 'display', 'none');
434
- this.renderer.appendChild(document.body, iframe);
435
- iframe.src = blobUrl;
436
- iframe.onload = () => {
437
- setTimeout(() => {
438
- iframe.contentWindow.print();
439
- }, 1000);
440
- };
441
- // Add a button or some UI element that allows the user to manually signal they are done printing
442
- // const finishButton = this.renderer.createElement('button');
443
- // this.renderer.setProperty(finishButton, 'innerText', 'Finish Printing');
444
- // this.renderer.listen(finishButton, 'click', () => {
445
- // this.renderer.removeChild(document.body, iframe);
446
- // this.renderer.removeChild(document.body, finishButton);
447
- // });
448
- // this.renderer.appendChild(document.body, finishButton);
449
- }
450
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPPdfService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
451
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPPdfService, providedIn: 'root' }); }
452
- }
453
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPPdfService, decorators: [{
593
+ }
594
+ download(blob, filename) {
595
+ const link = document.createElement('a');
596
+ link.href = URL.createObjectURL(blob);
597
+ link.download = filename;
598
+ document.body.appendChild(link);
599
+ link.click();
600
+ document.body.removeChild(link);
601
+ URL.revokeObjectURL(link.href);
602
+ }
603
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPExportService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
604
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPExportService, providedIn: 'root' }); }
605
+ }
606
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPExportService, decorators: [{
454
607
  type: Injectable,
455
608
  args: [{
456
- providedIn: 'root'
609
+ providedIn: 'root',
457
610
  }]
458
611
  }] });
459
612
 
@@ -1166,7 +1319,7 @@ class AXPLogoComponent {
1166
1319
  }
1167
1320
  }
1168
1321
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPLogoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1169
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXPLogoComponent, isStandalone: true, selector: "axp-logo", inputs: { source: "source" }, host: { classAttribute: "ax-flex ax-justify-center" }, ngImport: i0, template: "@switch (logoType) {\n@case ('text') {\n<span class=\"ax-font-bold ax-select-none\">{{ source.text }}</span>\n}\n@case ('url') {\n<ax-image [src]=\"source.url\"></ax-image>\n} @case ('iconClass') {\n<ax-icon class=\"{{ source.classIcon }}\"></ax-icon>\n} @case ('component') {\n<ng-container *ngComponentOutlet=\"source.component\"></ng-container>\n}\n}", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "ngmodule", type: AXImageModule }, { kind: "component", type: i2.AXImageComponent, selector: "ax-image", inputs: ["overlayMode", "src", "alt", "priority", "lazy"], outputs: ["onLoad", "onError"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }] }); }
1322
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXPLogoComponent, isStandalone: true, selector: "axp-logo", inputs: { source: "source" }, host: { classAttribute: "ax-flex ax-justify-center" }, ngImport: i0, template: "@switch (logoType) {\n@case ('text') {\n<span class=\"ax-font-bold ax-select-none\">{{ source.text }}</span>\n}\n@case ('url') {\n<ax-image [src]=\"source.url\"></ax-image>\n} @case ('iconClass') {\n<ax-icon class=\"{{ source.classIcon }}\"></ax-icon>\n} @case ('component') {\n<ng-container *ngComponentOutlet=\"source.component\"></ng-container>\n}\n}", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "ngmodule", type: AXImageModule }, { kind: "component", type: i2$1.AXImageComponent, selector: "ax-image", inputs: ["overlayMode", "src", "alt", "priority", "lazy"], outputs: ["onLoad", "onError"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i4.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }] }); }
1170
1323
  }
1171
1324
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPLogoComponent, decorators: [{
1172
1325
  type: Component,
@@ -1521,7 +1674,7 @@ class AXPNavBarSlotComponent {
1521
1674
  <div class="ax-flex ax-items-center ax-justify-between ax-gap-5">
1522
1675
  <a *ngFor="let link of items" (click)="handleCommand(link.command)" >{{ link.text }}</a>
1523
1676
  </div>
1524
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], encapsulation: i0.ViewEncapsulation.None }); }
1677
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], encapsulation: i0.ViewEncapsulation.None }); }
1525
1678
  }
1526
1679
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPNavBarSlotComponent, decorators: [{
1527
1680
  type: Component,
@@ -2015,7 +2168,6 @@ const AXP_SETTING_VALUE_PROVIDER = new InjectionToken('AXP_SETTING_VALUE_PROVIDE
2015
2168
  providedIn: 'root',
2016
2169
  factory: () => {
2017
2170
  return [
2018
- //new AXPSettingDefaultValueProvider(),
2019
2171
  new AXPSettingValueProviderDefault(AXPSettingScope.Tenant),
2020
2172
  new AXPSettingValueProviderDefault(AXPSettingScope.User)
2021
2173
  ];
@@ -2403,7 +2555,7 @@ class AXPCommonModule {
2403
2555
  });
2404
2556
  }
2405
2557
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPCommonModule, deps: [{ token: 'AXPCommonModuleFactory' }, { token: AXPAppStartUpService }, { token: AXPSettingService }, { token: AXPDataSeederService }], target: i0.ɵɵFactoryTarget.NgModule }); }
2406
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXPCommonModule, imports: [i4.AXPWorkflowModule, AXPopupModule,
2558
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXPCommonModule, imports: [i4$1.AXPWorkflowModule, AXPopupModule,
2407
2559
  AXDateTimeModule,
2408
2560
  AXToastModule], exports: [RouterModule] }); }
2409
2561
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPCommonModule, providers: [
@@ -2560,5 +2712,5 @@ const AXPSignInAction = createAction('[SignIn] Action');
2560
2712
  * Generated bundle index. Do not edit.
2561
2713
  */
2562
2714
 
2563
- export { ALL_DEFAULT_OPERATORS, AXMEntityCrudService, AXMEntityCrudServiceImpl, AXMWorkflowErrorHandler, AXPAppStartUpProvider, AXPAppStartUpService, AXPClipBoardService, AXPCommonModule, AXPComponentLogoConfig, AXPComponentSlotDirective, AXPComponentSlotLoaderService, AXPComponentSlotModule, AXPComponentSlotRegistryService, AXPCustomOperatorService, AXPCustomOperatorServiceImpl, AXPDataGenerator, AXPDataProvider, AXPDataSeederService, AXPDexieEntityStorageService, AXPDialogConfirmAction, AXPEntityCommandScope, AXPEntityDataProvider, AXPEntityDataProviderImpl, AXPEntityQueryType, AXPEntityStorageService, AXPErrorHandlerRegistryService, AXPFileStorageService, AXPFileStorageStatus, AXPFilterOperatorMiddlewareService, AXPFilterOperatorMiddlewareServiceImpl, AXPFiltersProviderService, AXPFontIconLogoConfig, AXPFooterTextSlotComponent, AXPGlobalErrorHandler, AXPGridLayoutDirective, AXPImageUrlLogoConfig, AXPLogoComponent, AXPMenuProviderService, AXPMenuSearchDefinitionProvider, AXPMenuSearchProvider, AXPMenuService, AXPNavBarSlotComponent, AXPNavigateWorkflow, AXPPdfPageSize, AXPPdfService, AXPPlatformDefaultConfigs, AXPRedirectEvent, AXPRefreshEvent, AXPRelationshipCardinality, AXPRelationshipKind, AXPSearchCommandProvider, AXPSearchDefinitionActionBuilder, AXPSearchDefinitionBuilder, AXPSearchDefinitionProviderContext, AXPSearchDefinitionProviderService, AXPSearchService, AXPSettingDefaultValueProvider, AXPSettingDefinitionGroupBuilder, AXPSettingDefinitionProviderContext, AXPSettingDefinitionProviderService, AXPSettingDefinitionSectionBuilder, AXPSettingScope, AXPSettingService, AXPSignInAction, AXPSignOutAction, AXPStickyDirective, AXPTextLogoConfig, AXPToastAction, AXPWorkflowNavigateAction, AXPWorkflowRouterNavigateAction, AXP_APP_VERSION_PROVIDER, AXP_DATA_SEEDER_TOKEN, AXP_MENU_PROVIDER, AXP_PLATFORM_CONFIG_TOKEN, AXP_ROOT_CONFIG_TOKEN, AXP_SEARCH_DEFINITION_PROVIDER, AXP_SEARCH_PROVIDER, AXP_SETTING_DEFINITION_PROVIDER, AXP_SETTING_VALUE_PROVIDER, BETWEEN_OPER, BOOLEAN_OPERATORS, CONTAINS_OPER, DATE_OPERATORS, ENDS_WITH_OPER, ENVIRONMENT, EQ_OPER, GTE_OPER, GT_OPER, IS_EMPTY_OPER, IS_NOT_EMPTY_OPER, LTE_OPER, LT_OPER, NOT_CONTAINS_OPER, NOT_EQ_OPER, NUMBER_OPERATORS, STARTS_WITH_OPER, STRING_OPERATORS, configPlatform, createAllQueryView, createQueryView, getEntityInfo, resolveActionLook };
2715
+ export { ALL_DEFAULT_OPERATORS, AXMEntityCrudService, AXMEntityCrudServiceImpl, AXMWorkflowErrorHandler, AXPAppStartUpProvider, AXPAppStartUpService, AXPClipBoardService, AXPCommonModule, AXPComponentLogoConfig, AXPComponentSlotDirective, AXPComponentSlotLoaderService, AXPComponentSlotModule, AXPComponentSlotRegistryService, AXPCustomOperatorService, AXPCustomOperatorServiceImpl, AXPDataGenerator, AXPDataProvider, AXPDataSeederService, AXPDexieEntityStorageService, AXPDialogConfirmAction, AXPEntityCommandScope, AXPEntityDataProvider, AXPEntityDataProviderImpl, AXPEntityQueryType, AXPEntityStorageService, AXPErrorHandlerRegistryService, AXPExportService, AXPFileStorageService, AXPFileStorageStatus, AXPFilterOperatorMiddlewareService, AXPFilterOperatorMiddlewareServiceImpl, AXPFiltersProviderService, AXPFontIconLogoConfig, AXPFooterTextSlotComponent, AXPGlobalErrorHandler, AXPGridLayoutDirective, AXPImageUrlLogoConfig, AXPLogoComponent, AXPMenuProviderService, AXPMenuSearchDefinitionProvider, AXPMenuSearchProvider, AXPMenuService, AXPNavBarSlotComponent, AXPNavigateWorkflow, AXPPlatformDefaultConfigs, AXPRedirectEvent, AXPRefreshEvent, AXPRelationshipCardinality, AXPRelationshipKind, AXPSearchCommandProvider, AXPSearchDefinitionActionBuilder, AXPSearchDefinitionBuilder, AXPSearchDefinitionProviderContext, AXPSearchDefinitionProviderService, AXPSearchService, AXPSettingDefaultValueProvider, AXPSettingDefinitionGroupBuilder, AXPSettingDefinitionProviderContext, AXPSettingDefinitionProviderService, AXPSettingDefinitionSectionBuilder, AXPSettingScope, AXPSettingService, AXPSignInAction, AXPSignOutAction, AXPStickyDirective, AXPTextLogoConfig, AXPToastAction, AXPWorkflowNavigateAction, AXPWorkflowRouterNavigateAction, AXP_APP_VERSION_PROVIDER, AXP_DATA_SEEDER_TOKEN, AXP_MENU_PROVIDER, AXP_PLATFORM_CONFIG_TOKEN, AXP_ROOT_CONFIG_TOKEN, AXP_SEARCH_DEFINITION_PROVIDER, AXP_SEARCH_PROVIDER, AXP_SETTING_DEFINITION_PROVIDER, AXP_SETTING_VALUE_PROVIDER, BETWEEN_OPER, BOOLEAN_OPERATORS, CONTAINS_OPER, DATE_OPERATORS, ENDS_WITH_OPER, ENVIRONMENT, EQ_OPER, GTE_OPER, GT_OPER, IS_EMPTY_OPER, IS_NOT_EMPTY_OPER, LTE_OPER, LT_OPER, NOT_CONTAINS_OPER, NOT_EQ_OPER, NUMBER_OPERATORS, STARTS_WITH_OPER, STRING_OPERATORS, configPlatform, createAllQueryView, createQueryView, getEntityInfo, resolveActionLook };
2564
2716
  //# sourceMappingURL=acorex-platform-common.mjs.map