@acorex/components 21.0.2-next.2 → 21.0.2-next.20

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 (55) hide show
  1. package/conversation2/README.md +8 -6
  2. package/fesm2022/acorex-components-button-group.mjs +26 -6
  3. package/fesm2022/acorex-components-button-group.mjs.map +1 -1
  4. package/fesm2022/acorex-components-color-palette.mjs +50 -9
  5. package/fesm2022/acorex-components-color-palette.mjs.map +1 -1
  6. package/fesm2022/acorex-components-conversation2.mjs +5958 -3866
  7. package/fesm2022/acorex-components-conversation2.mjs.map +1 -1
  8. package/fesm2022/acorex-components-data-pager.mjs +19 -3
  9. package/fesm2022/acorex-components-data-pager.mjs.map +1 -1
  10. package/fesm2022/acorex-components-data-table.mjs +14 -14
  11. package/fesm2022/acorex-components-data-table.mjs.map +1 -1
  12. package/fesm2022/acorex-components-dialog.mjs +2 -2
  13. package/fesm2022/acorex-components-dialog.mjs.map +1 -1
  14. package/fesm2022/acorex-components-flow-chart.mjs +42 -25
  15. package/fesm2022/acorex-components-flow-chart.mjs.map +1 -1
  16. package/fesm2022/acorex-components-menu.mjs +5 -5
  17. package/fesm2022/acorex-components-menu.mjs.map +1 -1
  18. package/fesm2022/{acorex-components-modal-acorex-components-modal-DWNqU6or.mjs → acorex-components-modal-acorex-components-modal-CcXuJ4IW.mjs} +3 -3
  19. package/fesm2022/{acorex-components-modal-acorex-components-modal-DWNqU6or.mjs.map → acorex-components-modal-acorex-components-modal-CcXuJ4IW.mjs.map} +1 -1
  20. package/fesm2022/{acorex-components-modal-modal-content.component-DplJbJyk.mjs → acorex-components-modal-modal-content.component-DTZu2zbU.mjs} +2 -2
  21. package/fesm2022/{acorex-components-modal-modal-content.component-DplJbJyk.mjs.map → acorex-components-modal-modal-content.component-DTZu2zbU.mjs.map} +1 -1
  22. package/fesm2022/acorex-components-modal.mjs +1 -1
  23. package/fesm2022/acorex-components-number-box.mjs +43 -5
  24. package/fesm2022/acorex-components-number-box.mjs.map +1 -1
  25. package/fesm2022/acorex-components-popup.mjs +25 -1
  26. package/fesm2022/acorex-components-popup.mjs.map +1 -1
  27. package/fesm2022/acorex-components-qrcode.mjs +19 -2
  28. package/fesm2022/acorex-components-qrcode.mjs.map +1 -1
  29. package/fesm2022/acorex-components-query-builder.mjs +3 -2
  30. package/fesm2022/acorex-components-query-builder.mjs.map +1 -1
  31. package/fesm2022/acorex-components-scheduler.mjs +1 -0
  32. package/fesm2022/acorex-components-scheduler.mjs.map +1 -1
  33. package/fesm2022/acorex-components-select-box.mjs +3 -7
  34. package/fesm2022/acorex-components-select-box.mjs.map +1 -1
  35. package/fesm2022/acorex-components-side-menu.mjs +336 -56
  36. package/fesm2022/acorex-components-side-menu.mjs.map +1 -1
  37. package/fesm2022/acorex-components-switch.mjs +2 -2
  38. package/fesm2022/acorex-components-switch.mjs.map +1 -1
  39. package/fesm2022/acorex-components-time-duration.mjs +3 -5
  40. package/fesm2022/acorex-components-time-duration.mjs.map +1 -1
  41. package/fesm2022/acorex-components-toast.mjs +19 -6
  42. package/fesm2022/acorex-components-toast.mjs.map +1 -1
  43. package/package.json +3 -3
  44. package/types/acorex-components-button-group.d.ts +9 -3
  45. package/types/acorex-components-color-palette.d.ts +2 -0
  46. package/types/acorex-components-conversation2.d.ts +2473 -2447
  47. package/types/acorex-components-data-pager.d.ts +2 -0
  48. package/types/acorex-components-data-table.d.ts +8 -8
  49. package/types/acorex-components-flow-chart.d.ts +4 -0
  50. package/types/acorex-components-number-box.d.ts +9 -0
  51. package/types/acorex-components-popup.d.ts +10 -0
  52. package/types/acorex-components-qrcode.d.ts +1 -0
  53. package/types/acorex-components-query-builder.d.ts +1 -1
  54. package/types/acorex-components-side-menu.d.ts +85 -6
  55. package/types/acorex-components-toast.d.ts +5 -1
@@ -71,7 +71,7 @@ class AXDialogComponent extends MXBaseComponent {
71
71
  provide: AXComponent,
72
72
  useExisting: AXDialogComponent,
73
73
  },
74
- ], usesInheritance: true, ngImport: i0, template: "<div\n class=\"ax-dialog ax-orientation-{{ data().orientation }}\"\n tabindex=\"-1\"\n cdkDrag\n cdkDragHandle\n [cdkDragDisabled]=\"!data().draggable\"\n>\n <div class=\"ax-dialog-content-wrapper\">\n @if (data().icon !== 'none') {\n <div class=\"ax-dialog-icon-side\">\n <i class=\"ax-dialog-icon {{ data().icon }}\"></i>\n </div>\n }\n <div class=\"ax-dialog-content-side\">\n <div class=\"ax-dialog-title\">{{ data().title | translate | async }}</div>\n <div class=\"ax-dialog-content\">{{ data().content | translate | async }}</div>\n </div>\n <div class=\"ax-dialog-dismiss-icon\">\n @if (data().closeButton) {\n <i class=\"ax-icon ax-icon-close\"></i>\n }\n </div>\n </div>\n\n <ax-footer>\n @for (button of data().buttons; let i = $index; track i) {\n <ax-button\n [text]=\"button.text | translate | async\"\n [tabindex]=\"i\"\n [axHotkey]=\"button.hotkey\"\n [axAutoFocus]=\"_hasAutoFocus(button)\"\n (onClick)=\"_handleButtonClick(button)\"\n [look]=\"button.look || 'solid'\"\n [disabled]=\"button.disabled\"\n [color]=\"button.color || 'default'\"\n >\n @if (button.loading) {\n <ax-loading></ax-loading>\n }\n </ax-button>\n }\n </ax-footer>\n</div>\n", styles: ["@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial}}}@layer components{.ax-dialog{border-radius:var(--radius-xl,.75rem);border-style:var(--tw-border-style);background-color:var(--color-lightest);width:93vw;color:var(--color-on-lightest);border-width:1px;border-color:var(--color-border-lightest);flex-direction:column;display:flex;position:relative;overflow:hidden}.ax-dialog:where(.ax-dark,.ax-dark *){background-color:var(--color-darkest);color:var(--color-on-darkest);border-color:var(--color-border-darkest)}@media(min-width:48rem){.ax-dialog{width:75vw}}@media(min-width:64rem){.ax-dialog{width:50vw}}@media(min-width:80rem){.ax-dialog{width:35vw}}@media(min-width:96rem){.ax-dialog{width:w5vw}}.ax-dialog.ax-orientation-horizontal .ax-dialog-content-wrapper{flex-direction:row!important}.ax-dialog.ax-orientation-vertical .ax-dialog-content-wrapper{flex-direction:column;align-items:center}.ax-dialog.ax-orientation-vertical .ax-dialog-content-wrapper .ax-dialog-icon-side{margin-bottom:calc(var(--spacing,.25rem) * 4)}.ax-dialog.ax-orientation-vertical .ax-dialog-content-wrapper .ax-dialog-content-side{margin:calc(var(--spacing,.25rem) * 0);text-align:center}.ax-dialog.ax-orientation-vertical ax-footer ax-button{flex:1}.ax-dialog .ax-dialog-content-wrapper{gap:calc(var(--spacing,.25rem) * 2);padding:calc(var(--spacing,.25rem) * 6);display:flex}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-icon-side .ax-dialog-icon{min-height:calc(var(--spacing,.25rem) * 12)!important;width:calc(var(--spacing,.25rem) * 12)!important;cursor:move!important;background-color:var(--ax-comp-bg,var(--color-surface))!important;font-size:var(--text-2xl,1.5rem)!important;line-height:var(--tw-leading,var(--text-2xl--line-height,calc(2 / 1.5)))!important;color:var(--ax-comp-text,var(--color-on-surface))!important;border-radius:3.40282e38px!important;justify-content:center!important;align-items:center!important;display:flex!important}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-content-side{flex:1;margin-inline-start:calc(var(--spacing,.25rem) * 4)}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-content-side .ax-dialog-title{margin-bottom:calc(var(--spacing,.25rem) * 2);font-size:var(--text-lg,1.125rem);line-height:var(--tw-leading,var(--text-lg--line-height,calc(1.75 / 1.125)));--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500)}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-content-side .ax-dialog-content{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)))}.ax-dialog ax-footer{padding-inline:calc(var(--spacing,.25rem) * 6);padding-block:calc(var(--spacing,.25rem) * 3);align-items:flex-end}}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:\"*\";inherits:false}\n/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: 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: "component", type: AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "directive", type: AXHotkeyDirective, selector: "[axHotkey]", inputs: ["axHotkey"] }, { kind: "directive", type: AXAutoFocusDirective, selector: "[axAutoFocus]", inputs: ["axAutoFocus", "axAutoFocusTime"] }, { kind: "component", type: AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
74
+ ], usesInheritance: true, ngImport: i0, template: "<div\n class=\"ax-dialog ax-orientation-{{ data().orientation }}\"\n tabindex=\"-1\"\n cdkDrag\n cdkDragHandle\n [cdkDragDisabled]=\"!data().draggable\"\n>\n <div class=\"ax-dialog-content-wrapper\">\n @if (data().icon !== 'none') {\n <div class=\"ax-dialog-icon-side\">\n <i class=\"ax-dialog-icon {{ data().icon }}\"></i>\n </div>\n }\n <div class=\"ax-dialog-content-side\">\n <div class=\"ax-dialog-title\">{{ data().title | translate | async }}</div>\n <div class=\"ax-dialog-content\">{{ data().content | translate | async }}</div>\n </div>\n <div class=\"ax-dialog-dismiss-icon\">\n @if (data().closeButton) {\n <i class=\"ax-icon ax-icon-close\"></i>\n }\n </div>\n </div>\n\n <ax-footer>\n <ax-suffix>\n @for (button of data().buttons; let i = $index; track i) {\n <ax-button\n [text]=\"button.text | translate | async\"\n [tabindex]=\"i\"\n [axHotkey]=\"button.hotkey\"\n [axAutoFocus]=\"_hasAutoFocus(button)\"\n (onClick)=\"_handleButtonClick(button)\"\n [look]=\"button.look || 'solid'\"\n [disabled]=\"button.disabled\"\n [color]=\"button.color || 'default'\"\n >\n @if (button.loading) {\n <ax-loading></ax-loading>\n }\n </ax-button>\n }\n </ax-suffix>\n </ax-footer>\n</div>\n", styles: ["@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial}}}@layer components{.ax-dialog{border-radius:var(--radius-xl,.75rem);border-style:var(--tw-border-style);background-color:var(--color-lightest);width:93vw;color:var(--color-on-lightest);border-width:1px;border-color:var(--color-border-lightest);flex-direction:column;display:flex;position:relative;overflow:hidden}.ax-dialog:where(.ax-dark,.ax-dark *){background-color:var(--color-darkest);color:var(--color-on-darkest);border-color:var(--color-border-darkest)}@media(min-width:48rem){.ax-dialog{width:75vw}}@media(min-width:64rem){.ax-dialog{width:50vw}}@media(min-width:80rem){.ax-dialog{width:35vw}}@media(min-width:96rem){.ax-dialog{width:w5vw}}.ax-dialog.ax-orientation-horizontal .ax-dialog-content-wrapper{flex-direction:row!important}.ax-dialog.ax-orientation-vertical .ax-dialog-content-wrapper{flex-direction:column;align-items:center}.ax-dialog.ax-orientation-vertical .ax-dialog-content-wrapper .ax-dialog-icon-side{margin-bottom:calc(var(--spacing,.25rem) * 4)}.ax-dialog.ax-orientation-vertical .ax-dialog-content-wrapper .ax-dialog-content-side{margin:calc(var(--spacing,.25rem) * 0);text-align:center}.ax-dialog.ax-orientation-vertical ax-footer ax-button{flex:1}.ax-dialog .ax-dialog-content-wrapper{gap:calc(var(--spacing,.25rem) * 2);padding:calc(var(--spacing,.25rem) * 6);display:flex}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-icon-side .ax-dialog-icon{min-height:calc(var(--spacing,.25rem) * 12)!important;width:calc(var(--spacing,.25rem) * 12)!important;cursor:move!important;background-color:var(--ax-comp-bg,var(--color-surface))!important;font-size:var(--text-2xl,1.5rem)!important;line-height:var(--tw-leading,var(--text-2xl--line-height,calc(2 / 1.5)))!important;color:var(--ax-comp-text,var(--color-on-surface))!important;border-radius:3.40282e38px!important;justify-content:center!important;align-items:center!important;display:flex!important}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-content-side{flex:1;margin-inline-start:calc(var(--spacing,.25rem) * 4)}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-content-side .ax-dialog-title{margin-bottom:calc(var(--spacing,.25rem) * 2);font-size:var(--text-lg,1.125rem);line-height:var(--tw-leading,var(--text-lg--line-height,calc(1.75 / 1.125)));--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500)}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-content-side .ax-dialog-content{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)))}.ax-dialog ax-footer{padding-inline:calc(var(--spacing,.25rem) * 6);padding-block:calc(var(--spacing,.25rem) * 3);align-items:flex-end}}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:\"*\";inherits:false}\n/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: 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: "component", type: AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "directive", type: AXHotkeyDirective, selector: "[axHotkey]", inputs: ["axHotkey"] }, { kind: "directive", type: AXAutoFocusDirective, selector: "[axAutoFocus]", inputs: ["axAutoFocus", "axAutoFocusTime"] }, { kind: "component", type: AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
75
75
  }
76
76
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXDialogComponent, decorators: [{
77
77
  type: Component,
@@ -97,7 +97,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
97
97
  AXLoadingComponent,
98
98
  AsyncPipe,
99
99
  AXTranslatorPipe,
100
- ], template: "<div\n class=\"ax-dialog ax-orientation-{{ data().orientation }}\"\n tabindex=\"-1\"\n cdkDrag\n cdkDragHandle\n [cdkDragDisabled]=\"!data().draggable\"\n>\n <div class=\"ax-dialog-content-wrapper\">\n @if (data().icon !== 'none') {\n <div class=\"ax-dialog-icon-side\">\n <i class=\"ax-dialog-icon {{ data().icon }}\"></i>\n </div>\n }\n <div class=\"ax-dialog-content-side\">\n <div class=\"ax-dialog-title\">{{ data().title | translate | async }}</div>\n <div class=\"ax-dialog-content\">{{ data().content | translate | async }}</div>\n </div>\n <div class=\"ax-dialog-dismiss-icon\">\n @if (data().closeButton) {\n <i class=\"ax-icon ax-icon-close\"></i>\n }\n </div>\n </div>\n\n <ax-footer>\n @for (button of data().buttons; let i = $index; track i) {\n <ax-button\n [text]=\"button.text | translate | async\"\n [tabindex]=\"i\"\n [axHotkey]=\"button.hotkey\"\n [axAutoFocus]=\"_hasAutoFocus(button)\"\n (onClick)=\"_handleButtonClick(button)\"\n [look]=\"button.look || 'solid'\"\n [disabled]=\"button.disabled\"\n [color]=\"button.color || 'default'\"\n >\n @if (button.loading) {\n <ax-loading></ax-loading>\n }\n </ax-button>\n }\n </ax-footer>\n</div>\n", styles: ["@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial}}}@layer components{.ax-dialog{border-radius:var(--radius-xl,.75rem);border-style:var(--tw-border-style);background-color:var(--color-lightest);width:93vw;color:var(--color-on-lightest);border-width:1px;border-color:var(--color-border-lightest);flex-direction:column;display:flex;position:relative;overflow:hidden}.ax-dialog:where(.ax-dark,.ax-dark *){background-color:var(--color-darkest);color:var(--color-on-darkest);border-color:var(--color-border-darkest)}@media(min-width:48rem){.ax-dialog{width:75vw}}@media(min-width:64rem){.ax-dialog{width:50vw}}@media(min-width:80rem){.ax-dialog{width:35vw}}@media(min-width:96rem){.ax-dialog{width:w5vw}}.ax-dialog.ax-orientation-horizontal .ax-dialog-content-wrapper{flex-direction:row!important}.ax-dialog.ax-orientation-vertical .ax-dialog-content-wrapper{flex-direction:column;align-items:center}.ax-dialog.ax-orientation-vertical .ax-dialog-content-wrapper .ax-dialog-icon-side{margin-bottom:calc(var(--spacing,.25rem) * 4)}.ax-dialog.ax-orientation-vertical .ax-dialog-content-wrapper .ax-dialog-content-side{margin:calc(var(--spacing,.25rem) * 0);text-align:center}.ax-dialog.ax-orientation-vertical ax-footer ax-button{flex:1}.ax-dialog .ax-dialog-content-wrapper{gap:calc(var(--spacing,.25rem) * 2);padding:calc(var(--spacing,.25rem) * 6);display:flex}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-icon-side .ax-dialog-icon{min-height:calc(var(--spacing,.25rem) * 12)!important;width:calc(var(--spacing,.25rem) * 12)!important;cursor:move!important;background-color:var(--ax-comp-bg,var(--color-surface))!important;font-size:var(--text-2xl,1.5rem)!important;line-height:var(--tw-leading,var(--text-2xl--line-height,calc(2 / 1.5)))!important;color:var(--ax-comp-text,var(--color-on-surface))!important;border-radius:3.40282e38px!important;justify-content:center!important;align-items:center!important;display:flex!important}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-content-side{flex:1;margin-inline-start:calc(var(--spacing,.25rem) * 4)}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-content-side .ax-dialog-title{margin-bottom:calc(var(--spacing,.25rem) * 2);font-size:var(--text-lg,1.125rem);line-height:var(--tw-leading,var(--text-lg--line-height,calc(1.75 / 1.125)));--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500)}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-content-side .ax-dialog-content{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)))}.ax-dialog ax-footer{padding-inline:calc(var(--spacing,.25rem) * 6);padding-block:calc(var(--spacing,.25rem) * 3);align-items:flex-end}}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:\"*\";inherits:false}\n/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */\n"] }]
100
+ ], template: "<div\n class=\"ax-dialog ax-orientation-{{ data().orientation }}\"\n tabindex=\"-1\"\n cdkDrag\n cdkDragHandle\n [cdkDragDisabled]=\"!data().draggable\"\n>\n <div class=\"ax-dialog-content-wrapper\">\n @if (data().icon !== 'none') {\n <div class=\"ax-dialog-icon-side\">\n <i class=\"ax-dialog-icon {{ data().icon }}\"></i>\n </div>\n }\n <div class=\"ax-dialog-content-side\">\n <div class=\"ax-dialog-title\">{{ data().title | translate | async }}</div>\n <div class=\"ax-dialog-content\">{{ data().content | translate | async }}</div>\n </div>\n <div class=\"ax-dialog-dismiss-icon\">\n @if (data().closeButton) {\n <i class=\"ax-icon ax-icon-close\"></i>\n }\n </div>\n </div>\n\n <ax-footer>\n <ax-suffix>\n @for (button of data().buttons; let i = $index; track i) {\n <ax-button\n [text]=\"button.text | translate | async\"\n [tabindex]=\"i\"\n [axHotkey]=\"button.hotkey\"\n [axAutoFocus]=\"_hasAutoFocus(button)\"\n (onClick)=\"_handleButtonClick(button)\"\n [look]=\"button.look || 'solid'\"\n [disabled]=\"button.disabled\"\n [color]=\"button.color || 'default'\"\n >\n @if (button.loading) {\n <ax-loading></ax-loading>\n }\n </ax-button>\n }\n </ax-suffix>\n </ax-footer>\n</div>\n", styles: ["@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial}}}@layer components{.ax-dialog{border-radius:var(--radius-xl,.75rem);border-style:var(--tw-border-style);background-color:var(--color-lightest);width:93vw;color:var(--color-on-lightest);border-width:1px;border-color:var(--color-border-lightest);flex-direction:column;display:flex;position:relative;overflow:hidden}.ax-dialog:where(.ax-dark,.ax-dark *){background-color:var(--color-darkest);color:var(--color-on-darkest);border-color:var(--color-border-darkest)}@media(min-width:48rem){.ax-dialog{width:75vw}}@media(min-width:64rem){.ax-dialog{width:50vw}}@media(min-width:80rem){.ax-dialog{width:35vw}}@media(min-width:96rem){.ax-dialog{width:w5vw}}.ax-dialog.ax-orientation-horizontal .ax-dialog-content-wrapper{flex-direction:row!important}.ax-dialog.ax-orientation-vertical .ax-dialog-content-wrapper{flex-direction:column;align-items:center}.ax-dialog.ax-orientation-vertical .ax-dialog-content-wrapper .ax-dialog-icon-side{margin-bottom:calc(var(--spacing,.25rem) * 4)}.ax-dialog.ax-orientation-vertical .ax-dialog-content-wrapper .ax-dialog-content-side{margin:calc(var(--spacing,.25rem) * 0);text-align:center}.ax-dialog.ax-orientation-vertical ax-footer ax-button{flex:1}.ax-dialog .ax-dialog-content-wrapper{gap:calc(var(--spacing,.25rem) * 2);padding:calc(var(--spacing,.25rem) * 6);display:flex}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-icon-side .ax-dialog-icon{min-height:calc(var(--spacing,.25rem) * 12)!important;width:calc(var(--spacing,.25rem) * 12)!important;cursor:move!important;background-color:var(--ax-comp-bg,var(--color-surface))!important;font-size:var(--text-2xl,1.5rem)!important;line-height:var(--tw-leading,var(--text-2xl--line-height,calc(2 / 1.5)))!important;color:var(--ax-comp-text,var(--color-on-surface))!important;border-radius:3.40282e38px!important;justify-content:center!important;align-items:center!important;display:flex!important}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-content-side{flex:1;margin-inline-start:calc(var(--spacing,.25rem) * 4)}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-content-side .ax-dialog-title{margin-bottom:calc(var(--spacing,.25rem) * 2);font-size:var(--text-lg,1.125rem);line-height:var(--tw-leading,var(--text-lg--line-height,calc(1.75 / 1.125)));--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500)}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-content-side .ax-dialog-content{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)))}.ax-dialog ax-footer{padding-inline:calc(var(--spacing,.25rem) * 6);padding-block:calc(var(--spacing,.25rem) * 3);align-items:flex-end}}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:\"*\";inherits:false}\n/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */\n"] }]
101
101
  }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], onClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "onClose", required: false }] }] } });
102
102
 
103
103
  const AX_DIALOG_CONFIG = new InjectionToken('AX_DIALOG_CONFIG', {
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-components-dialog.mjs","sources":["../../../../packages/components/dialog/src/lib/dialog.component.ts","../../../../packages/components/dialog/src/lib/dialog.component.html","../../../../packages/components/dialog/src/lib/dialog.config.ts","../../../../packages/components/dialog/src/lib/dialog.service.ts","../../../../packages/components/dialog/src/lib/dialog.module.ts","../../../../packages/components/dialog/src/acorex-components-dialog.ts"],"sourcesContent":["import {\n AXAutoFocusDirective,\n AXClosableComponent,\n AXComponent,\n AXHotkeyDirective,\n MXBaseComponent,\n} from '@acorex/cdk/common';\nimport { AXButtonComponent } from '@acorex/components/button';\nimport { AXDecoratorGenericComponent } from '@acorex/components/decorators';\nimport { AXLoadingComponent } from '@acorex/components/loading';\nimport { AXTranslatorPipe } from '@acorex/core/translation';\nimport { CdkDrag, CdkDragHandle } from '@angular/cdk/drag-drop';\nimport { AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, ViewEncapsulation, input } from '@angular/core';\nimport { AXDialogButtonItem, AXDialogData } from './dialog.class';\n\n/**\n * A dialog component that provides a modal interface for user interactions.\n * @category Components\n */\n@Component({\n selector: 'ax-dialog',\n templateUrl: './dialog.component.html',\n styleUrls: ['./dialog.component.compiled.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n '[attr.tabIndex]': '\"-1\"',\n '[class]': '\"ax-\" + data().type',\n },\n providers: [\n {\n provide: AXClosableComponent,\n useExisting: AXDialogComponent,\n },\n {\n provide: AXComponent,\n useExisting: AXDialogComponent,\n },\n ],\n imports: [\n CdkDrag,\n CdkDragHandle,\n AXDecoratorGenericComponent,\n AXButtonComponent,\n AXHotkeyDirective,\n AXAutoFocusDirective,\n AXLoadingComponent,\n AsyncPipe,\n AXTranslatorPipe,\n ],\n})\nexport class AXDialogComponent extends MXBaseComponent {\n /** Dialog configuration data */\n data = input.required<AXDialogData>();\n\n /** @internal Callback function to close the dialog */\n onClose = input<() => void>();\n\n /**\n * @ignore\n */\n protected _icon: string;\n\n /**\n * @ignore\n */\n protected _handleButtonClick(button: AXDialogButtonItem) {\n if (button.onClick) {\n button.onClick({ source: button });\n }\n }\n\n /**\n * @ignore\n */\n protected _hasAutoFocus(button: AXDialogButtonItem): boolean {\n const buttons = this.data().buttons;\n const autoFocusItem = buttons.find((item) => item.autofocus === true);\n if (autoFocusItem && autoFocusItem.text === button.text) {\n return true;\n }\n if (!autoFocusItem) {\n if (buttons.length > 0) {\n buttons[0].autofocus = true;\n return buttons[0].text === button.text;\n }\n }\n return false;\n }\n\n /**\n * Closes the dialog.\n *\n * @returns void - No return value. The dialog is closed and removed from the DOM.\n */\n close() {\n const closeCallback = this.onClose();\n if (closeCallback) {\n closeCallback();\n }\n }\n}\n","<div\n class=\"ax-dialog ax-orientation-{{ data().orientation }}\"\n tabindex=\"-1\"\n cdkDrag\n cdkDragHandle\n [cdkDragDisabled]=\"!data().draggable\"\n>\n <div class=\"ax-dialog-content-wrapper\">\n @if (data().icon !== 'none') {\n <div class=\"ax-dialog-icon-side\">\n <i class=\"ax-dialog-icon {{ data().icon }}\"></i>\n </div>\n }\n <div class=\"ax-dialog-content-side\">\n <div class=\"ax-dialog-title\">{{ data().title | translate | async }}</div>\n <div class=\"ax-dialog-content\">{{ data().content | translate | async }}</div>\n </div>\n <div class=\"ax-dialog-dismiss-icon\">\n @if (data().closeButton) {\n <i class=\"ax-icon ax-icon-close\"></i>\n }\n </div>\n </div>\n\n <ax-footer>\n @for (button of data().buttons; let i = $index; track i) {\n <ax-button\n [text]=\"button.text | translate | async\"\n [tabindex]=\"i\"\n [axHotkey]=\"button.hotkey\"\n [axAutoFocus]=\"_hasAutoFocus(button)\"\n (onClick)=\"_handleButtonClick(button)\"\n [look]=\"button.look || 'solid'\"\n [disabled]=\"button.disabled\"\n [color]=\"button.color || 'default'\"\n >\n @if (button.loading) {\n <ax-loading></ax-loading>\n }\n </ax-button>\n }\n </ax-footer>\n</div>\n","import { AX_GLOBAL_CONFIG } from '@acorex/core/config';\nimport { InjectionToken, inject } from '@angular/core';\nimport { set } from 'lodash-es';\n\nexport interface AXDialogConfigToken {\n confirm: { defaultAction: 'confirm' | 'cancel' };\n}\n\nexport const AX_DIALOG_CONFIG = new InjectionToken<AXDialogConfigToken>('AX_DIALOG_CONFIG', {\n providedIn: 'root',\n factory: () => {\n const global = inject(AX_GLOBAL_CONFIG);\n set(global, 'layout.dialog', AX_DIALOG_CONFIG);\n return AXDialogDefaultConfig;\n },\n});\n\nexport const AXDialogDefaultConfig: AXDialogConfigToken = {\n confirm: { defaultAction: 'cancel' },\n};\n\nexport type PartialDialogConfig = Partial<AXDialogConfigToken>;\n\nexport function dialogConfig(config: PartialDialogConfig = {}): AXDialogConfigToken {\n const result = {\n ...AXDialogDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { AXStyleColorType } from '@acorex/cdk/common';\nimport { AXOverlayService } from '@acorex/cdk/overlay';\nimport { AXHtmlUtil } from '@acorex/core/utils';\nimport { Injectable, inject } from '@angular/core';\nimport { AXDialogConfig, AXDialogData, AXDialogInternalRef, AXDialogRef } from './dialog.class';\nimport { AXDialogComponent } from './dialog.component';\nimport { AXDialogConfigToken, AX_DIALOG_CONFIG } from './dialog.config';\n\n/**\n * The Button is a component which detects user interaction and triggers a corresponding event\n *\n * @category Components\n */\n@Injectable()\nexport class AXDialogService {\n private overlayService = inject(AXOverlayService);\n private defaultConfig: AXDialogConfigToken = inject(AX_DIALOG_CONFIG);\n\n private detectIcon(type: AXStyleColorType): string {\n let icon: string;\n switch (type) {\n case 'success':\n icon = 'ax-icon ax-icon-check';\n break;\n case 'danger':\n icon = 'ax-icon ax-icon-error';\n break;\n case 'warning':\n icon = 'ax-icon ax-icon-warning';\n break;\n default:\n icon = 'ax-icon ax-icon-info';\n break;\n }\n return icon;\n }\n\n /**\n * Show an alert box with 'Okay' button.\n *\n * @param title - The title of the alert dialog.\n * @param content - The content message of the alert dialog.\n * @param type - The type/color of the alert (primary, success, warning, danger).\n * @param orientation - The orientation of the dialog (horizontal or vertical).\n * @param draggable - Whether the dialog can be dragged.\n * @returns Promise<void> - Promise that resolves when the dialog is closed.\n */\n alert(\n title: string,\n content: string,\n type: AXStyleColorType = 'primary',\n orientation: 'horizontal' | 'vertical' = 'horizontal',\n draggable?: boolean,\n ): Promise<void> {\n return new Promise((resolve) => {\n const popup = this.open({\n title,\n type: type,\n content,\n icon: this.detectIcon(type),\n orientation,\n draggable,\n buttons: [\n {\n name: 'confirm',\n text: AXHtmlUtil.isRtl() ? 'باشه' : 'Okay',\n color: type,\n autofocus: true,\n onClick: () => {\n popup.close();\n if (resolve) {\n resolve();\n }\n },\n },\n ],\n });\n });\n }\n\n /**\n * Show a confirm box with 'Okay' & 'Cancel' buttons.\n *\n * @param title - The title of the confirm dialog.\n * @param content - The content message of the confirm dialog.\n * @param type - The type/color of the confirm dialog (primary, success, warning, danger).\n * @param orientation - The orientation of the dialog (horizontal or vertical).\n * @param draggable - Whether the dialog can be dragged.\n * @param defaultAction - The default action to focus (confirm or cancel).\n * @returns Promise<{ result: boolean }> - Promise that resolves with the user's choice.\n */\n confirm(\n title: string,\n content: string,\n type: AXStyleColorType = 'primary',\n orientation: 'horizontal' | 'vertical' = 'horizontal',\n draggable?: boolean,\n defaultAction?: 'confirm' | 'cancel',\n ): Promise<{ result: boolean }> {\n return new Promise<{ result: boolean }>((resolve) => {\n const tokenConfig = this.defaultConfig.confirm.defaultAction;\n\n const action = defaultAction || (type === 'danger' ? 'cancel' : tokenConfig);\n\n const popup = this.open({\n title,\n content,\n type,\n icon: this.detectIcon(type),\n orientation,\n draggable,\n buttons: [\n {\n name: 'confirm',\n text: AXHtmlUtil.isRtl() ? 'باشه' : 'Okay',\n color: type,\n autofocus: action === 'confirm',\n onClick: () => {\n popup.close();\n if (resolve) {\n resolve({ result: true });\n }\n },\n },\n {\n name: 'cancel',\n text: AXHtmlUtil.isRtl() ? 'انصراف' : 'Cancel',\n color: 'default',\n autofocus: action === 'cancel',\n onClick: () => {\n popup.close();\n if (resolve) {\n resolve({ result: false });\n }\n },\n hotkey: {\n Escape: () => {\n popup.close();\n if (resolve) {\n resolve({ result: false });\n }\n },\n },\n },\n ],\n });\n });\n }\n\n /**\n * Show a custom dialog box.\n *\n * @param options - Configuration options for the custom dialog.\n * @returns Promise<{ name: string }> - Promise that resolves with the button name that was clicked.\n */\n show(options: AXDialogConfig): Promise<{ name: string }> {\n return new Promise((resolve) => {\n options.orientation = options.orientation || 'horizontal';\n options.icon = options.icon ?? this.detectIcon(options.type);\n\n const popup = this.open(options);\n\n options.buttons?.forEach((b) => {\n const orginalClick = b.onClick;\n b.onClick = () => {\n const e = { source: b, handled: false };\n if (orginalClick) {\n orginalClick(e);\n if (e.handled) {\n resolve({ name: b.name ?? b.text });\n } else {\n popup.close();\n resolve({ name: b.name ?? b.text });\n }\n } else if (resolve) {\n popup.close();\n resolve({ name: b.name ?? b.text });\n } else {\n popup.close();\n }\n };\n });\n });\n }\n\n /**\n * Show a custom dialog box.\n *\n * @param options - Configuration options for the custom dialog.\n * @returns Promise<{ name: string }> - Promise that resolves with the button name that was clicked.\n */\n open(config: AXDialogConfig): AXDialogRef {\n config.orientation = config.orientation || 'horizontal';\n config.icon = config.icon ?? this.detectIcon(config.type);\n\n const dialogData: AXDialogData = {\n title: config.title,\n content: config.content,\n type: config.type,\n buttons: config.buttons,\n closeButton: config.closeButton ?? false,\n orientation: config.orientation,\n icon: config.icon,\n draggable: config.draggable,\n };\n\n let internalRef: AXDialogInternalRef;\n\n const closeDialog = () => {\n if (internalRef) {\n internalRef.overlayRef.dispose();\n }\n };\n\n this.overlayService\n .create<AXDialogComponent>(AXDialogComponent, {\n inputs: {\n data: dialogData,\n onClose: closeDialog,\n },\n backdrop: {\n enabled: true,\n background: true,\n closeOnClick: false, // disableClose: true equivalent\n },\n panelClass: ['ax-dialog-panel', 'ax-animate-bounceIn', 'ax-animate-faster'],\n })\n .then((overlayRef) => {\n internalRef = {\n overlayRef,\n close: closeDialog,\n };\n\n // Apply direction if specified\n if (config.direction || AXHtmlUtil.isRtl()) {\n const dir = config.direction ? config.direction : AXHtmlUtil.isRtl() ? 'rtl' : 'ltr';\n if (overlayRef.overlayElement) {\n overlayRef.overlayElement.setAttribute('dir', dir);\n }\n }\n });\n\n return {\n close: () => {\n closeDialog();\n },\n };\n }\n}\n","import { AXCommonModule, AXHotkeysService } from '@acorex/cdk/common';\nimport { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXLoadingModule } from '@acorex/components/loading';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { A11yModule } from '@angular/cdk/a11y';\nimport { DragDropModule } from '@angular/cdk/drag-drop';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXDialogComponent } from './dialog.component';\nimport { AXDialogService } from './dialog.service';\n\nconst COMPONENT = [AXDialogComponent];\nconst MODULES = [\n CommonModule,\n AXCommonModule,\n DragDropModule,\n A11yModule,\n AXButtonModule,\n AXDecoratorModule,\n AXLoadingModule,\n AXTranslationModule,\n];\n\n@NgModule({\n imports: [...MODULES, ...COMPONENT],\n exports: [...COMPONENT],\n providers: [AXDialogService, AXHotkeysService],\n})\nexport class AXDialogModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAgBA;;;AAGG;AAiCG,MAAO,iBAAkB,SAAQ,eAAe,CAAA;AAhCtD,IAAA,WAAA,GAAA;;;AAkCE,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,+CAAgB;;QAGrC,IAAA,CAAA,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAc;AA6C9B,IAAA;AAtCC;;AAEG;AACO,IAAA,kBAAkB,CAAC,MAA0B,EAAA;AACrD,QAAA,IAAI,MAAM,CAAC,OAAO,EAAE;YAClB,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QACpC;IACF;AAEA;;AAEG;AACO,IAAA,aAAa,CAAC,MAA0B,EAAA;QAChD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO;AACnC,QAAA,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC;QACrE,IAAI,aAAa,IAAI,aAAa,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,EAAE;AACvD,YAAA,OAAO,IAAI;QACb;QACA,IAAI,CAAC,aAAa,EAAE;AAClB,YAAA,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;AACtB,gBAAA,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,IAAI;gBAC3B,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI;YACxC;QACF;AACA,QAAA,OAAO,KAAK;IACd;AAEA;;;;AAIG;IACH,KAAK,GAAA;AACH,QAAA,MAAM,aAAa,GAAG,IAAI,CA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iBAAiB;YACjB,eAAe;YACf,mBAAmB,EATF,iBAAiB,CAAA,EAAA,OAAA,EAAA,CAAjB,iBAAiB,CAAA,EAAA,CAAA,CAAA;+GAiBvB,cAAc,EAAA,SAAA,EAFd,CAAC,eAAe,EAAE,gBAAgB,CAAC,EAAA,OAAA,EAAA,CAFjC,OAAO,EAAK,SAAS,CAAA,EAAA,CAAA,CAAA;;2FAIvB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAL1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,GAAG,SAAS,CAAC;AACnC,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;AACvB,oBAAA,SAAS,EAAE,CAAC,eAAe,EAAE,gBAAgB,CAAC;AAC/C,iBAAA;;;AC5BD;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-components-dialog.mjs","sources":["../../../../packages/components/dialog/src/lib/dialog.component.ts","../../../../packages/components/dialog/src/lib/dialog.component.html","../../../../packages/components/dialog/src/lib/dialog.config.ts","../../../../packages/components/dialog/src/lib/dialog.service.ts","../../../../packages/components/dialog/src/lib/dialog.module.ts","../../../../packages/components/dialog/src/acorex-components-dialog.ts"],"sourcesContent":["import {\n AXAutoFocusDirective,\n AXClosableComponent,\n AXComponent,\n AXHotkeyDirective,\n MXBaseComponent,\n} from '@acorex/cdk/common';\nimport { AXButtonComponent } from '@acorex/components/button';\nimport { AXDecoratorGenericComponent } from '@acorex/components/decorators';\nimport { AXLoadingComponent } from '@acorex/components/loading';\nimport { AXTranslatorPipe } from '@acorex/core/translation';\nimport { CdkDrag, CdkDragHandle } from '@angular/cdk/drag-drop';\nimport { AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, ViewEncapsulation, input } from '@angular/core';\nimport { AXDialogButtonItem, AXDialogData } from './dialog.class';\n\n/**\n * A dialog component that provides a modal interface for user interactions.\n * @category Components\n */\n@Component({\n selector: 'ax-dialog',\n templateUrl: './dialog.component.html',\n styleUrls: ['./dialog.component.compiled.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n '[attr.tabIndex]': '\"-1\"',\n '[class]': '\"ax-\" + data().type',\n },\n providers: [\n {\n provide: AXClosableComponent,\n useExisting: AXDialogComponent,\n },\n {\n provide: AXComponent,\n useExisting: AXDialogComponent,\n },\n ],\n imports: [\n CdkDrag,\n CdkDragHandle,\n AXDecoratorGenericComponent,\n AXButtonComponent,\n AXHotkeyDirective,\n AXAutoFocusDirective,\n AXLoadingComponent,\n AsyncPipe,\n AXTranslatorPipe,\n ],\n})\nexport class AXDialogComponent extends MXBaseComponent {\n /** Dialog configuration data */\n data = input.required<AXDialogData>();\n\n /** @internal Callback function to close the dialog */\n onClose = input<() => void>();\n\n /**\n * @ignore\n */\n protected _icon: string;\n\n /**\n * @ignore\n */\n protected _handleButtonClick(button: AXDialogButtonItem) {\n if (button.onClick) {\n button.onClick({ source: button });\n }\n }\n\n /**\n * @ignore\n */\n protected _hasAutoFocus(button: AXDialogButtonItem): boolean {\n const buttons = this.data().buttons;\n const autoFocusItem = buttons.find((item) => item.autofocus === true);\n if (autoFocusItem && autoFocusItem.text === button.text) {\n return true;\n }\n if (!autoFocusItem) {\n if (buttons.length > 0) {\n buttons[0].autofocus = true;\n return buttons[0].text === button.text;\n }\n }\n return false;\n }\n\n /**\n * Closes the dialog.\n *\n * @returns void - No return value. The dialog is closed and removed from the DOM.\n */\n close() {\n const closeCallback = this.onClose();\n if (closeCallback) {\n closeCallback();\n }\n }\n}\n","<div\n class=\"ax-dialog ax-orientation-{{ data().orientation }}\"\n tabindex=\"-1\"\n cdkDrag\n cdkDragHandle\n [cdkDragDisabled]=\"!data().draggable\"\n>\n <div class=\"ax-dialog-content-wrapper\">\n @if (data().icon !== 'none') {\n <div class=\"ax-dialog-icon-side\">\n <i class=\"ax-dialog-icon {{ data().icon }}\"></i>\n </div>\n }\n <div class=\"ax-dialog-content-side\">\n <div class=\"ax-dialog-title\">{{ data().title | translate | async }}</div>\n <div class=\"ax-dialog-content\">{{ data().content | translate | async }}</div>\n </div>\n <div class=\"ax-dialog-dismiss-icon\">\n @if (data().closeButton) {\n <i class=\"ax-icon ax-icon-close\"></i>\n }\n </div>\n </div>\n\n <ax-footer>\n <ax-suffix>\n @for (button of data().buttons; let i = $index; track i) {\n <ax-button\n [text]=\"button.text | translate | async\"\n [tabindex]=\"i\"\n [axHotkey]=\"button.hotkey\"\n [axAutoFocus]=\"_hasAutoFocus(button)\"\n (onClick)=\"_handleButtonClick(button)\"\n [look]=\"button.look || 'solid'\"\n [disabled]=\"button.disabled\"\n [color]=\"button.color || 'default'\"\n >\n @if (button.loading) {\n <ax-loading></ax-loading>\n }\n </ax-button>\n }\n </ax-suffix>\n </ax-footer>\n</div>\n","import { AX_GLOBAL_CONFIG } from '@acorex/core/config';\nimport { InjectionToken, inject } from '@angular/core';\nimport { set } from 'lodash-es';\n\nexport interface AXDialogConfigToken {\n confirm: { defaultAction: 'confirm' | 'cancel' };\n}\n\nexport const AX_DIALOG_CONFIG = new InjectionToken<AXDialogConfigToken>('AX_DIALOG_CONFIG', {\n providedIn: 'root',\n factory: () => {\n const global = inject(AX_GLOBAL_CONFIG);\n set(global, 'layout.dialog', AX_DIALOG_CONFIG);\n return AXDialogDefaultConfig;\n },\n});\n\nexport const AXDialogDefaultConfig: AXDialogConfigToken = {\n confirm: { defaultAction: 'cancel' },\n};\n\nexport type PartialDialogConfig = Partial<AXDialogConfigToken>;\n\nexport function dialogConfig(config: PartialDialogConfig = {}): AXDialogConfigToken {\n const result = {\n ...AXDialogDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { AXStyleColorType } from '@acorex/cdk/common';\nimport { AXOverlayService } from '@acorex/cdk/overlay';\nimport { AXHtmlUtil } from '@acorex/core/utils';\nimport { Injectable, inject } from '@angular/core';\nimport { AXDialogConfig, AXDialogData, AXDialogInternalRef, AXDialogRef } from './dialog.class';\nimport { AXDialogComponent } from './dialog.component';\nimport { AXDialogConfigToken, AX_DIALOG_CONFIG } from './dialog.config';\n\n/**\n * The Button is a component which detects user interaction and triggers a corresponding event\n *\n * @category Components\n */\n@Injectable()\nexport class AXDialogService {\n private overlayService = inject(AXOverlayService);\n private defaultConfig: AXDialogConfigToken = inject(AX_DIALOG_CONFIG);\n\n private detectIcon(type: AXStyleColorType): string {\n let icon: string;\n switch (type) {\n case 'success':\n icon = 'ax-icon ax-icon-check';\n break;\n case 'danger':\n icon = 'ax-icon ax-icon-error';\n break;\n case 'warning':\n icon = 'ax-icon ax-icon-warning';\n break;\n default:\n icon = 'ax-icon ax-icon-info';\n break;\n }\n return icon;\n }\n\n /**\n * Show an alert box with 'Okay' button.\n *\n * @param title - The title of the alert dialog.\n * @param content - The content message of the alert dialog.\n * @param type - The type/color of the alert (primary, success, warning, danger).\n * @param orientation - The orientation of the dialog (horizontal or vertical).\n * @param draggable - Whether the dialog can be dragged.\n * @returns Promise<void> - Promise that resolves when the dialog is closed.\n */\n alert(\n title: string,\n content: string,\n type: AXStyleColorType = 'primary',\n orientation: 'horizontal' | 'vertical' = 'horizontal',\n draggable?: boolean,\n ): Promise<void> {\n return new Promise((resolve) => {\n const popup = this.open({\n title,\n type: type,\n content,\n icon: this.detectIcon(type),\n orientation,\n draggable,\n buttons: [\n {\n name: 'confirm',\n text: AXHtmlUtil.isRtl() ? 'باشه' : 'Okay',\n color: type,\n autofocus: true,\n onClick: () => {\n popup.close();\n if (resolve) {\n resolve();\n }\n },\n },\n ],\n });\n });\n }\n\n /**\n * Show a confirm box with 'Okay' & 'Cancel' buttons.\n *\n * @param title - The title of the confirm dialog.\n * @param content - The content message of the confirm dialog.\n * @param type - The type/color of the confirm dialog (primary, success, warning, danger).\n * @param orientation - The orientation of the dialog (horizontal or vertical).\n * @param draggable - Whether the dialog can be dragged.\n * @param defaultAction - The default action to focus (confirm or cancel).\n * @returns Promise<{ result: boolean }> - Promise that resolves with the user's choice.\n */\n confirm(\n title: string,\n content: string,\n type: AXStyleColorType = 'primary',\n orientation: 'horizontal' | 'vertical' = 'horizontal',\n draggable?: boolean,\n defaultAction?: 'confirm' | 'cancel',\n ): Promise<{ result: boolean }> {\n return new Promise<{ result: boolean }>((resolve) => {\n const tokenConfig = this.defaultConfig.confirm.defaultAction;\n\n const action = defaultAction || (type === 'danger' ? 'cancel' : tokenConfig);\n\n const popup = this.open({\n title,\n content,\n type,\n icon: this.detectIcon(type),\n orientation,\n draggable,\n buttons: [\n {\n name: 'confirm',\n text: AXHtmlUtil.isRtl() ? 'باشه' : 'Okay',\n color: type,\n autofocus: action === 'confirm',\n onClick: () => {\n popup.close();\n if (resolve) {\n resolve({ result: true });\n }\n },\n },\n {\n name: 'cancel',\n text: AXHtmlUtil.isRtl() ? 'انصراف' : 'Cancel',\n color: 'default',\n autofocus: action === 'cancel',\n onClick: () => {\n popup.close();\n if (resolve) {\n resolve({ result: false });\n }\n },\n hotkey: {\n Escape: () => {\n popup.close();\n if (resolve) {\n resolve({ result: false });\n }\n },\n },\n },\n ],\n });\n });\n }\n\n /**\n * Show a custom dialog box.\n *\n * @param options - Configuration options for the custom dialog.\n * @returns Promise<{ name: string }> - Promise that resolves with the button name that was clicked.\n */\n show(options: AXDialogConfig): Promise<{ name: string }> {\n return new Promise((resolve) => {\n options.orientation = options.orientation || 'horizontal';\n options.icon = options.icon ?? this.detectIcon(options.type);\n\n const popup = this.open(options);\n\n options.buttons?.forEach((b) => {\n const orginalClick = b.onClick;\n b.onClick = () => {\n const e = { source: b, handled: false };\n if (orginalClick) {\n orginalClick(e);\n if (e.handled) {\n resolve({ name: b.name ?? b.text });\n } else {\n popup.close();\n resolve({ name: b.name ?? b.text });\n }\n } else if (resolve) {\n popup.close();\n resolve({ name: b.name ?? b.text });\n } else {\n popup.close();\n }\n };\n });\n });\n }\n\n /**\n * Show a custom dialog box.\n *\n * @param options - Configuration options for the custom dialog.\n * @returns Promise<{ name: string }> - Promise that resolves with the button name that was clicked.\n */\n open(config: AXDialogConfig): AXDialogRef {\n config.orientation = config.orientation || 'horizontal';\n config.icon = config.icon ?? this.detectIcon(config.type);\n\n const dialogData: AXDialogData = {\n title: config.title,\n content: config.content,\n type: config.type,\n buttons: config.buttons,\n closeButton: config.closeButton ?? false,\n orientation: config.orientation,\n icon: config.icon,\n draggable: config.draggable,\n };\n\n let internalRef: AXDialogInternalRef;\n\n const closeDialog = () => {\n if (internalRef) {\n internalRef.overlayRef.dispose();\n }\n };\n\n this.overlayService\n .create<AXDialogComponent>(AXDialogComponent, {\n inputs: {\n data: dialogData,\n onClose: closeDialog,\n },\n backdrop: {\n enabled: true,\n background: true,\n closeOnClick: false, // disableClose: true equivalent\n },\n panelClass: ['ax-dialog-panel', 'ax-animate-bounceIn', 'ax-animate-faster'],\n })\n .then((overlayRef) => {\n internalRef = {\n overlayRef,\n close: closeDialog,\n };\n\n // Apply direction if specified\n if (config.direction || AXHtmlUtil.isRtl()) {\n const dir = config.direction ? config.direction : AXHtmlUtil.isRtl() ? 'rtl' : 'ltr';\n if (overlayRef.overlayElement) {\n overlayRef.overlayElement.setAttribute('dir', dir);\n }\n }\n });\n\n return {\n close: () => {\n closeDialog();\n },\n };\n }\n}\n","import { AXCommonModule, AXHotkeysService } from '@acorex/cdk/common';\nimport { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXLoadingModule } from '@acorex/components/loading';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { A11yModule } from '@angular/cdk/a11y';\nimport { DragDropModule } from '@angular/cdk/drag-drop';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXDialogComponent } from './dialog.component';\nimport { AXDialogService } from './dialog.service';\n\nconst COMPONENT = [AXDialogComponent];\nconst MODULES = [\n CommonModule,\n AXCommonModule,\n DragDropModule,\n A11yModule,\n AXButtonModule,\n AXDecoratorModule,\n AXLoadingModule,\n AXTranslationModule,\n];\n\n@NgModule({\n imports: [...MODULES, ...COMPONENT],\n exports: [...COMPONENT],\n providers: [AXDialogService, AXHotkeysService],\n})\nexport class AXDialogModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAgBA;;;AAGG;AAiCG,MAAO,iBAAkB,SAAQ,eAAe,CAAA;AAhCtD,IAAA,WAAA,GAAA;;;AAkCE,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,+CAAgB;;QAGrC,IAAA,CAAA,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAc;AA6C9B,IAAA;AAtCC;;AAEG;AACO,IAAA,kBAAkB,CAAC,MAA0B,EAAA;AACrD,QAAA,IAAI,MAAM,CAAC,OAAO,EAAE;YAClB,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QACpC;IACF;AAEA;;AAEG;AACO,IAAA,aAAa,CAAC,MAA0B,EAAA;QAChD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO;AACnC,QAAA,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC;QACrE,IAAI,aAAa,IAAI,aAAa,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,EAAE;AACvD,YAAA,OAAO,IAAI;QACb;QACA,IAAI,CAAC,aAAa,EAAE;AAClB,YAAA,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;AACtB,gBAAA,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,IAAI;gBAC3B,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI;YACxC;QACF;AACA,QAAA,OAAO,KAAK;IACd;AAEA;;;;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B,YAAY;YACZ,cAAc;YACd,cAAc;YACd,UAAU;YACV,cAAc;YACd,iBAAiB;YACjB,eAAe;YACf,mBAAmB,EATF,iBAAiB,CAAA,EAAA,OAAA,EAAA,CAAjB,iBAAiB,CAAA,EAAA,CAAA,CAAA;+GAiBvB,cAAc,EAAA,SAAA,EAFd,CAAC,eAAe,EAAE,gBAAgB,CAAC,EAAA,OAAA,EAAA,CAFjC,OAAO,EAAK,SAAS,CAAA,EAAA,CAAA,CAAA;;2FAIvB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAL1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,GAAG,SAAS,CAAC;AACnC,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;AACvB,oBAAA,SAAS,EAAE,CAAC,eAAe,EAAE,gBAAgB,CAAC;AAC/C,iBAAA;;;AC5BD;;AAEG;;;;"}
@@ -4,9 +4,9 @@ import { AXButtonModule } from '@acorex/components/button';
4
4
  import * as i1 from '@acorex/components/text-box';
5
5
  import { AXTextBoxModule } from '@acorex/components/text-box';
6
6
  import * as i3 from '@angular/common';
7
- import { CommonModule } from '@angular/common';
7
+ import { DOCUMENT, isPlatformBrowser, CommonModule } from '@angular/common';
8
8
  import * as i0 from '@angular/core';
9
- import { inject, NgZone, signal, effect, Injectable, ViewEncapsulation, ChangeDetectionStrategy, Component, viewChild, output, afterNextRender, input, computed, HostListener, NgModule } from '@angular/core';
9
+ import { inject, NgZone, PLATFORM_ID, signal, effect, Injectable, ViewEncapsulation, ChangeDetectionStrategy, Component, viewChild, output, afterNextRender, input, computed, HostListener, NgModule } from '@angular/core';
10
10
  import * as i4 from '@angular/forms';
11
11
  import { FormsModule } from '@angular/forms';
12
12
  import { Subject } from 'rxjs';
@@ -14,6 +14,8 @@ import { Subject } from 'rxjs';
14
14
  class AXFlowChartService {
15
15
  constructor() {
16
16
  this.zone = inject(NgZone);
17
+ this.platformId = inject(PLATFORM_ID);
18
+ this.document = inject(DOCUMENT);
17
19
  this.initialFlowChartEdge = signal([], ...(ngDevMode ? [{ debugName: "initialFlowChartEdge" }] : []));
18
20
  this.initialFlowChartNode = signal([], ...(ngDevMode ? [{ debugName: "initialFlowChartNode" }] : []));
19
21
  this.selectedNode = signal(null, ...(ngDevMode ? [{ debugName: "selectedNode" }] : []));
@@ -33,16 +35,18 @@ class AXFlowChartService {
33
35
  this.draggingConnection = false;
34
36
  this.tempLine = null;
35
37
  this.#eff2 = effect(() => {
36
- if (this.initialFlowChartEdge()) {
37
- setTimeout(() => {
38
- this.drawEdges(this.initialFlowChartEdge());
39
- });
38
+ if (!isPlatformBrowser(this.platformId) || !this.initialFlowChartEdge()) {
39
+ return;
40
40
  }
41
+ setTimeout(() => {
42
+ this.drawEdges(this.initialFlowChartEdge());
43
+ });
41
44
  }, ...(ngDevMode ? [{ debugName: "#eff2" }] : []));
42
45
  this.#eff3 = effect(() => {
43
- if (this.initialFlowChartNode()) {
44
- this.createNode(this.initialFlowChartNode());
46
+ if (!isPlatformBrowser(this.platformId) || !this.initialFlowChartNode()) {
47
+ return;
45
48
  }
49
+ this.createNode(this.initialFlowChartNode());
46
50
  }, ...(ngDevMode ? [{ debugName: "#eff3" }] : []));
47
51
  }
48
52
  #eff2;
@@ -143,7 +147,7 @@ class AXFlowChartService {
143
147
  }
144
148
  addAnchors(el, type) {
145
149
  ['top', 'bottom', 'left', 'right'].forEach((anchor) => {
146
- const dot = document.createElement('div');
150
+ const dot = this.document.createElement('div');
147
151
  dot.className = 'ax-flow-chart-anchor';
148
152
  dot.dataset['anchor'] = anchor;
149
153
  dot.dataset['nodeId'] = el.dataset['id'];
@@ -205,8 +209,8 @@ class AXFlowChartService {
205
209
  };
206
210
  // Add global event listeners
207
211
  this.zone.runOutsideAngular(() => {
208
- document.addEventListener('mousemove', mousemoveHandler);
209
- document.addEventListener('mouseup', mouseupHandler);
212
+ this.document.addEventListener('mousemove', mousemoveHandler);
213
+ this.document.addEventListener('mouseup', mouseupHandler);
210
214
  });
211
215
  // Store global listeners
212
216
  const globalListeners = this.eventListeners.get('global');
@@ -278,7 +282,7 @@ class AXFlowChartService {
278
282
  const svgElement = this.svgService()?.nativeElement;
279
283
  if (!svgElement)
280
284
  return;
281
- this.tempLine = document.createElementNS('http://www.w3.org/2000/svg', 'line');
285
+ this.tempLine = this.document.createElementNS('http://www.w3.org/2000/svg', 'line');
282
286
  this.tempLine.setAttribute('x1', x.toString());
283
287
  this.tempLine.setAttribute('y1', y.toString());
284
288
  this.tempLine.setAttribute('x2', x.toString());
@@ -305,6 +309,9 @@ class AXFlowChartService {
305
309
  this.drawEdges();
306
310
  }
307
311
  drawEdges(edges) {
312
+ if (!isPlatformBrowser(this.platformId)) {
313
+ return;
314
+ }
308
315
  const svg = this.svgService()?.nativeElement;
309
316
  if (!svg)
310
317
  return;
@@ -337,7 +344,7 @@ class AXFlowChartService {
337
344
  this.selectedEdge.set(edge);
338
345
  this.selectedNode.set(null);
339
346
  // Remove selection from all other lines
340
- document.querySelectorAll('.ax-flow-chart-line').forEach((l) => {
347
+ this.document.querySelectorAll('.ax-flow-chart-line').forEach((l) => {
341
348
  if (l !== line)
342
349
  l.classList.remove('selected');
343
350
  });
@@ -351,7 +358,7 @@ class AXFlowChartService {
351
358
  });
352
359
  }
353
360
  createLine(from, to, edge) {
354
- const line = document.createElementNS('http://www.w3.org/2000/svg', 'line');
361
+ const line = this.document.createElementNS('http://www.w3.org/2000/svg', 'line');
355
362
  line.setAttribute('x1', from.x.toString());
356
363
  line.setAttribute('y1', from.y.toString());
357
364
  line.setAttribute('x2', to.x.toString());
@@ -391,10 +398,17 @@ class AXFlowChartService {
391
398
  }
392
399
  }
393
400
  createNode(nodes) {
394
- document.querySelectorAll('.ax-flow-chart-node')?.forEach((node) => node.remove());
401
+ if (!isPlatformBrowser(this.platformId)) {
402
+ return;
403
+ }
404
+ const canvas = this.canvasService()?.nativeElement;
405
+ if (!canvas) {
406
+ return;
407
+ }
408
+ this.document.querySelectorAll('.ax-flow-chart-node')?.forEach((node) => node.remove());
395
409
  nodes.forEach((node) => {
396
- const el = document.createElement('div');
397
- const p = document.createElement('p');
410
+ const el = this.document.createElement('div');
411
+ const p = this.document.createElement('p');
398
412
  p.innerText = node.label;
399
413
  el.appendChild(p);
400
414
  el.className = 'ax-flow-chart-node';
@@ -405,7 +419,7 @@ class AXFlowChartService {
405
419
  this.addAnchors(el, node.type);
406
420
  this.makeDraggable(el);
407
421
  this.setupNodeEventListeners(el, node);
408
- this.canvasService().nativeElement.appendChild(el);
422
+ canvas.appendChild(el);
409
423
  this.nodesMap.set(node.id, el);
410
424
  });
411
425
  }
@@ -416,7 +430,7 @@ class AXFlowChartService {
416
430
  this.removeEdge(edge);
417
431
  }
418
432
  });
419
- document.querySelector(`[data-id="${nodeId}"]`)?.remove();
433
+ this.document.querySelector(`[data-id="${nodeId}"]`)?.remove();
420
434
  this.anchorClickBuffer = null;
421
435
  }
422
436
  cleanup() {
@@ -513,6 +527,8 @@ class AXFlowChartRendererComponent extends NXComponent {
513
527
  this.canvas = viewChild('canvas', ...(ngDevMode ? [{ debugName: "canvas" }] : []));
514
528
  this.svg = viewChild('connections', ...(ngDevMode ? [{ debugName: "svg" }] : []));
515
529
  this.service = inject(AXFlowChartService);
530
+ this.document = inject(DOCUMENT);
531
+ this.platformId = inject(PLATFORM_ID);
516
532
  this.onLineClick = output();
517
533
  this.onLineDbClick = output();
518
534
  this.onNodeClick = output();
@@ -523,9 +539,10 @@ class AXFlowChartRendererComponent extends NXComponent {
523
539
  this.setupEventListeners();
524
540
  });
525
541
  this.#eff = effect(() => {
526
- if (this.canvas() && this.svg()) {
527
- this.initializeServices();
542
+ if (!isPlatformBrowser(this.platformId) || !this.canvas() || !this.svg()) {
543
+ return;
528
544
  }
545
+ this.initializeServices();
529
546
  }, ...(ngDevMode ? [{ debugName: "#eff" }] : []));
530
547
  }
531
548
  #init;
@@ -561,8 +578,8 @@ class AXFlowChartRendererComponent extends NXComponent {
561
578
  if (e.target === canvas) {
562
579
  this.service.selectedNode.set(null);
563
580
  this.service.selectedEdge.set(null);
564
- document.querySelectorAll('.ax-flow-chart-node').forEach((node) => node.classList.remove('selected'));
565
- document.querySelectorAll('.ax-flow-chart-line').forEach((line) => line.classList.remove('selected'));
581
+ this.document.querySelectorAll('.ax-flow-chart-node').forEach((node) => node.classList.remove('selected'));
582
+ this.document.querySelectorAll('.ax-flow-chart-line').forEach((line) => line.classList.remove('selected'));
566
583
  }
567
584
  });
568
585
  }
@@ -571,8 +588,8 @@ class AXFlowChartRendererComponent extends NXComponent {
571
588
  if (e.target === svg) {
572
589
  this.service.selectedNode.set(null);
573
590
  this.service.selectedEdge.set(null);
574
- document.querySelectorAll('.ax-flow-chart-node').forEach((node) => node.classList.remove('selected'));
575
- document.querySelectorAll('.ax-flow-chart-line').forEach((line) => line.classList.remove('selected'));
591
+ this.document.querySelectorAll('.ax-flow-chart-node').forEach((node) => node.classList.remove('selected'));
592
+ this.document.querySelectorAll('.ax-flow-chart-line').forEach((line) => line.classList.remove('selected'));
576
593
  }
577
594
  });
578
595
  }