@acorex/components 18.10.1 → 18.10.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. package/calendar/lib/calendar-range.component.d.ts +2 -1
  2. package/esm2022/calendar/lib/calendar-range.component.mjs +8 -4
  3. package/esm2022/menu/lib/menu-item/menu-item.component.mjs +11 -9
  4. package/esm2022/menu/lib/menu.component.mjs +85 -70
  5. package/esm2022/menu/lib/menu.service.mjs +2 -1
  6. package/esm2022/qrcode/lib/qrcode.class.mjs +3 -3
  7. package/esm2022/qrcode/lib/qrcode.component.mjs +4 -19
  8. package/esm2022/qrcode/lib/qrcode.module.mjs +6 -6
  9. package/esm2022/range-slider/lib/range-slider.component.mjs +8 -10
  10. package/esm2022/wysiwyg/lib/wysiwyg/wysiwyg-container/wysiwyg-container.component.mjs +4 -7
  11. package/fesm2022/acorex-components-calendar.mjs +6 -2
  12. package/fesm2022/acorex-components-calendar.mjs.map +1 -1
  13. package/fesm2022/acorex-components-menu.mjs +94 -76
  14. package/fesm2022/acorex-components-menu.mjs.map +1 -1
  15. package/fesm2022/acorex-components-qrcode.mjs +11 -26
  16. package/fesm2022/acorex-components-qrcode.mjs.map +1 -1
  17. package/fesm2022/acorex-components-range-slider.mjs +7 -9
  18. package/fesm2022/acorex-components-range-slider.mjs.map +1 -1
  19. package/fesm2022/acorex-components-wysiwyg.mjs +3 -6
  20. package/fesm2022/acorex-components-wysiwyg.mjs.map +1 -1
  21. package/menu/lib/menu-item/menu-item.component.d.ts +3 -2
  22. package/menu/lib/menu.component.d.ts +2 -1
  23. package/menu/lib/menu.service.d.ts +1 -0
  24. package/package.json +54 -54
  25. package/qrcode/lib/qrcode.class.d.ts +1 -1
  26. package/qrcode/lib/qrcode.component.d.ts +0 -4
  27. package/qrcode/lib/qrcode.module.d.ts +4 -4
  28. package/wysiwyg/lib/wysiwyg/wysiwyg-container/wysiwyg-container.component.d.ts +1 -2
@@ -26,6 +26,7 @@ class AXMenuService {
26
26
  this.leftOverflow = signal(0);
27
27
  this.overflowElements = signal([]);
28
28
  this.notOverflowElements = signal([]);
29
+ this.isOverflowExist = signal(false);
29
30
  }
30
31
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMenuService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
31
32
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMenuService, providedIn: 'root' }); }
@@ -83,6 +84,7 @@ class AXMenuItemComponent extends MXInteractiveComponent {
83
84
  * Injects the root menu service.
84
85
  */
85
86
  this.rootMenu = inject(AXRootMenu);
87
+ this.arrowState = input(true);
86
88
  afterNextRender(() => {
87
89
  this.children.forEach((c) => {
88
90
  c.parent = this;
@@ -92,12 +94,13 @@ class AXMenuItemComponent extends MXInteractiveComponent {
92
94
  this.getPlacement();
93
95
  });
94
96
  effect(() => {
95
- if (!this.getHostElement().getClientRects()[0]?.right)
97
+ if (!this.getHostElement()?.getClientRects()[0])
96
98
  return;
97
99
  //add overflow items to array
98
- if (this.getHostElement().getClientRects()[0]?.right > this.service.rightOverflow() ||
99
- this.getHostElement().getClientRects()[0]?.left < this.service.leftOverflow()) {
100
+ if (this.getHostElement()?.getClientRects()[0]?.right > this.service.rightOverflow() ||
101
+ this.getHostElement()?.getClientRects()[0]?.left < this.service.leftOverflow()) {
100
102
  this.service.overflowElements.update((prev) => [...prev, this.getHostElement()]);
103
+ this.service.isOverflowExist.set(true);
101
104
  }
102
105
  else {
103
106
  this.service.notOverflowElements.update((prev) => [...prev, this.getHostElement()]);
@@ -131,11 +134,11 @@ class AXMenuItemComponent extends MXInteractiveComponent {
131
134
  * Returns the icon based on the orientation of the root menu.
132
135
  */
133
136
  getIcon() {
134
- if (this.rootMenu.orientation() == 'vertical') {
135
- return 'ax-icon-arrow-right';
137
+ if (this.rootMenu.orientation() === 'vertical') {
138
+ return 'ax-icon-chevron-right';
136
139
  }
137
140
  else {
138
- return 'ax-icon-arrow-down';
141
+ return 'ax-icon-chevron-down';
139
142
  }
140
143
  }
141
144
  /**
@@ -182,11 +185,11 @@ class AXMenuItemComponent extends MXInteractiveComponent {
182
185
  }
183
186
  }
184
187
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
185
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXMenuItemComponent, selector: "ax-menu-item", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeChange: "activeChange", onClick: "onClick" }, host: { attributes: { "ngSkipHydration": "true" }, listeners: { "click": "__hostClick($event)" }, properties: { "class": "this.__hostClass" } }, queries: [{ propertyName: "children", predicate: AXMenuItemComponent }], viewQueries: [{ propertyName: "popover", first: true, predicate: AXPopoverComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-menu-item-start-side\">\n <ng-content select=\"ax-prefix\"></ng-content>\n <p class=\"ax-menu-item-text\">{{ text() }}</p>\n</div>\n<ng-content select=\"ax-suffix\"></ng-content>\n@if (children.length) {\n <i class=\"ax-icon ax-icon-solid {{ getIcon() }} ax-menu-item-child-icon\"></i>\n}\n\n<ax-popover\n #popover\n [closeOn]=\"'clickOut'\"\n [openOn]=\"rootMenu.openOn()\"\n [target]=\"getHostElement()\"\n [offsetY]=\"offsetY()\"\n [offsetX]=\"offsetX()\"\n [placement]=\"getPlacement()\"\n (onOpened)=\"_handleOnOpened()\"\n (onClosed)=\"_handleOnClosed()\"\n>\n <div class=\"ax-menu-item-children ax-parent-{{ this.rootMenu.orientation() }}\">\n <ng-content select=\"ax-menu-item\"></ng-content>\n </div>\n</ax-popover>\n", styles: [".ax-menu-item-text{white-space:nowrap}\n"], dependencies: [{ kind: "component", type: i1.AXPopoverComponent, selector: "ax-popover", inputs: ["offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }], encapsulation: i0.ViewEncapsulation.None }); }
188
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXMenuItemComponent, selector: "ax-menu-item", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, arrowState: { classPropertyName: "arrowState", publicName: "arrowState", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeChange: "activeChange", onClick: "onClick" }, host: { attributes: { "ngSkipHydration": "true" }, listeners: { "click": "__hostClick($event)" }, properties: { "class": "this.__hostClass" } }, queries: [{ propertyName: "children", predicate: AXMenuItemComponent }], viewQueries: [{ propertyName: "popover", first: true, predicate: AXPopoverComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-menu-item-start-side\">\n <ng-content select=\"ax-prefix\"></ng-content>\n <p class=\"ax-menu-item-text\">{{ text() }}</p>\n</div>\n<ng-content select=\"ax-suffix\"></ng-content>\n@if (children.length && arrowState()) {\n <i class=\"ax-icon ax-icon-solid {{ getIcon() }} ax-menu-item-child-icon\"></i>\n}\n\n<ax-popover\n #popover\n [closeOn]=\"'clickOut'\"\n [openOn]=\"rootMenu.openOn()\"\n [target]=\"getHostElement()\"\n [offsetY]=\"offsetY()\"\n [offsetX]=\"offsetX()\"\n [placement]=\"getPlacement()\"\n (onOpened)=\"_handleOnOpened()\"\n (onClosed)=\"_handleOnClosed()\"\n>\n <div class=\"ax-menu-item-children ax-parent-{{ this.rootMenu.orientation() }}\">\n <ng-content select=\"ax-menu-item\"></ng-content>\n </div>\n</ax-popover>\n", styles: [".ax-menu-item-text{white-space:nowrap}\n"], dependencies: [{ kind: "component", type: i1.AXPopoverComponent, selector: "ax-popover", inputs: ["offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }], encapsulation: i0.ViewEncapsulation.None }); }
186
189
  }
187
190
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMenuItemComponent, decorators: [{
188
191
  type: Component,
189
- args: [{ selector: 'ax-menu-item', inputs: ['disabled'], host: { ngSkipHydration: 'true' }, encapsulation: ViewEncapsulation.None, template: "<div class=\"ax-menu-item-start-side\">\n <ng-content select=\"ax-prefix\"></ng-content>\n <p class=\"ax-menu-item-text\">{{ text() }}</p>\n</div>\n<ng-content select=\"ax-suffix\"></ng-content>\n@if (children.length) {\n <i class=\"ax-icon ax-icon-solid {{ getIcon() }} ax-menu-item-child-icon\"></i>\n}\n\n<ax-popover\n #popover\n [closeOn]=\"'clickOut'\"\n [openOn]=\"rootMenu.openOn()\"\n [target]=\"getHostElement()\"\n [offsetY]=\"offsetY()\"\n [offsetX]=\"offsetX()\"\n [placement]=\"getPlacement()\"\n (onOpened)=\"_handleOnOpened()\"\n (onClosed)=\"_handleOnClosed()\"\n>\n <div class=\"ax-menu-item-children ax-parent-{{ this.rootMenu.orientation() }}\">\n <ng-content select=\"ax-menu-item\"></ng-content>\n </div>\n</ax-popover>\n", styles: [".ax-menu-item-text{white-space:nowrap}\n"] }]
192
+ args: [{ selector: 'ax-menu-item', inputs: ['disabled'], host: { ngSkipHydration: 'true' }, encapsulation: ViewEncapsulation.None, template: "<div class=\"ax-menu-item-start-side\">\n <ng-content select=\"ax-prefix\"></ng-content>\n <p class=\"ax-menu-item-text\">{{ text() }}</p>\n</div>\n<ng-content select=\"ax-suffix\"></ng-content>\n@if (children.length && arrowState()) {\n <i class=\"ax-icon ax-icon-solid {{ getIcon() }} ax-menu-item-child-icon\"></i>\n}\n\n<ax-popover\n #popover\n [closeOn]=\"'clickOut'\"\n [openOn]=\"rootMenu.openOn()\"\n [target]=\"getHostElement()\"\n [offsetY]=\"offsetY()\"\n [offsetX]=\"offsetX()\"\n [placement]=\"getPlacement()\"\n (onOpened)=\"_handleOnOpened()\"\n (onClosed)=\"_handleOnClosed()\"\n>\n <div class=\"ax-menu-item-children ax-parent-{{ this.rootMenu.orientation() }}\">\n <ng-content select=\"ax-menu-item\"></ng-content>\n </div>\n</ax-popover>\n", styles: [".ax-menu-item-text{white-space:nowrap}\n"] }]
190
193
  }], ctorParameters: () => [], propDecorators: { popover: [{
191
194
  type: ViewChild,
192
195
  args: [AXPopoverComponent]
@@ -213,56 +216,61 @@ class AXMenuComponent extends MXBaseComponent {
213
216
  this.service = inject(AXMenuService);
214
217
  this.menuHeight = signal('');
215
218
  this.isMenuOpen = signal(false);
219
+ this.truncateMenu = input(false);
216
220
  afterNextRender(() => {
217
- //add menu container border for detect overflow happen
218
- this.menuHeight.set(`${this.getHostElement()?.getClientRects()[0]?.height}px`);
219
- this.service.rightOverflow.set(this.getHostElement().querySelector('.ax-menu-item-container')?.getClientRects()[0]?.right);
220
- this.service.leftOverflow.set(this.getHostElement().querySelector('.ax-menu-item-container')?.getClientRects()[0]?.left);
221
- });
222
- let resizeTimer;
223
- window.addEventListener('resize', () => {
224
- //add menu container border for detect overflow happen
225
- clearTimeout(resizeTimer);
226
- if (!this.getHostElement())
221
+ if (!this.truncateMenu())
227
222
  return;
228
- resizeTimer = setTimeout(() => {
229
- this.service.rightOverflow.set(this.getHostElement().querySelector('.ax-menu-item-container').getClientRects()[0].right);
230
- this.service.leftOverflow.set(this.getHostElement().querySelector('.ax-menu-item-container').getClientRects()[0].left);
231
- this.service.notOverflowElements.set([]);
232
- this.service.overflowElements.set([]);
233
- this.isMenuOpen.set(false);
234
- }, 200);
235
- });
236
- effect(() => {
237
- //rearrange items base on menu state
238
- const overflowMenu = this.getHostElement().querySelector('.overflowMenu');
239
- const originalMenu = this.getHostElement().querySelector('.originalMenu');
240
- const injectContainer = this.getHostElement().querySelector('.ax-overflow-menu-container');
241
- const injectContainer2 = this.getHostElement().querySelector('.ax-menu-item-container');
242
- if (this.isMenuOpen()) {
243
- overflowMenu?.remove();
244
- const axMenu = document.createElement('ax-menu');
245
- axMenu.classList.add('overflowMenu');
246
- this.service.overflowElements().forEach((item) => {
247
- axMenu.appendChild(item);
248
- });
249
- injectContainer.appendChild(axMenu);
250
- }
251
- else {
252
- originalMenu?.remove();
253
- overflowMenu?.remove();
254
- const axMenu = document.createElement('ax-menu');
255
- axMenu.classList.add('originalMenu');
256
- const allItems = [...this.service.overflowElements(), ...this.service.notOverflowElements()];
257
- allItems.forEach((item) => {
258
- axMenu.appendChild(item);
259
- });
260
- injectContainer2.appendChild(axMenu);
261
- }
223
+ //add menu container border for detect overflow happen
224
+ this.menuHeight.set(`${this.getHostElement()?.getClientRects()[0]?.height + 10}px`);
225
+ this.service.rightOverflow.set(this.getHostElement()?.querySelector('.ax-menu-item-container')?.getClientRects()[0]?.right);
226
+ this.service.leftOverflow.set(this.getHostElement()?.querySelector('.ax-menu-item-container')?.getClientRects()[0]?.left);
227
+ let resizeTimer;
228
+ window.addEventListener('resize', () => {
229
+ //add menu container border for detect overflow happen
230
+ clearTimeout(resizeTimer);
231
+ if (!this.getHostElement())
232
+ return;
233
+ resizeTimer = setTimeout(() => {
234
+ this.service.rightOverflow.set(this.getHostElement()?.querySelector('.ax-menu-item-container').getClientRects()[0].right);
235
+ this.service.leftOverflow.set(this.getHostElement()?.querySelector('.ax-menu-item-container').getClientRects()[0].left);
236
+ if (this.isMenuOpen())
237
+ this.showMenuHandler();
238
+ this.service.notOverflowElements.set([]);
239
+ this.service.overflowElements.set([]);
240
+ }, 200);
241
+ });
242
+ document.addEventListener('click', (event) => {
243
+ const menu = document.querySelector('.ax-overflow-menu-container');
244
+ const menuButton = document.querySelector('.ax-show-truncate-menu');
245
+ if (!menu.contains(event.target) &&
246
+ !menuButton.contains(event.target)) {
247
+ if (this.isMenuOpen())
248
+ this.showMenuHandler();
249
+ }
250
+ });
262
251
  });
263
252
  }
264
253
  showMenuHandler() {
265
254
  this.isMenuOpen.update((prev) => !prev);
255
+ const injectContainer = this.getHostElement().querySelector('.ax-overflow-menu-container');
256
+ const injectContainer2 = this.getHostElement().querySelector('.ax-menu-item-container');
257
+ if (this.isMenuOpen()) {
258
+ this.service.overflowElements().forEach((item) => {
259
+ item.classList.add('overflowMenuOverride');
260
+ injectContainer.appendChild(item);
261
+ });
262
+ this.service.notOverflowElements().forEach((item) => {
263
+ item.classList.remove('overflowMenuOverride');
264
+ injectContainer2.appendChild(item);
265
+ });
266
+ }
267
+ else {
268
+ const allItems = [...this.service.notOverflowElements(), ...this.service.overflowElements()];
269
+ allItems.forEach((item) => {
270
+ item.classList.remove('overflowMenuOverride');
271
+ injectContainer2.appendChild(item);
272
+ });
273
+ }
266
274
  }
267
275
  /** @ignore */
268
276
  ngAfterViewInit() {
@@ -273,10 +281,10 @@ class AXMenuComponent extends MXBaseComponent {
273
281
  }
274
282
  /** @ignore */
275
283
  get __hostClass() {
276
- return `ax-orientation-${this.orientation()} main-menu`;
284
+ return `ax-orientation-${this.orientation()}`;
277
285
  }
278
286
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
279
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXMenuComponent, selector: "ax-menu", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, openOn: { classPropertyName: "openOn", publicName: "openOn", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.__hostClass" } }, providers: [
287
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXMenuComponent, selector: "ax-menu", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, openOn: { classPropertyName: "openOn", publicName: "openOn", isSignal: true, isRequired: false, transformFunction: null }, truncateMenu: { classPropertyName: "truncateMenu", publicName: "truncateMenu", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.__hostClass" } }, providers: [
280
288
  {
281
289
  provide: AXRootMenu,
282
290
  useExisting: AXMenuComponent,
@@ -287,47 +295,57 @@ class AXMenuComponent extends MXBaseComponent {
287
295
  ], queries: [{ propertyName: "children", predicate: AXMenuItemComponent }], usesInheritance: true, ngImport: i0, template: `
288
296
  <div class="ax-main-menu-container">
289
297
  <div
290
- [style]="{ width: this.service.overflowElements().length !== 0 ? '90%' : '100%' }"
298
+ [style]="{ width: !this.service.isOverflowExist() && !this.truncateMenu() && '100%' }"
291
299
  class="ax-menu-item-container"
292
300
  >
293
301
  <ng-content select="ax-menu-item,ng-container"></ng-content>
294
302
  </div>
295
- @if (this.service.overflowElements().length !== 0) {
296
- <div class="ax-show-truncate-menu">
297
- <button (click)="showMenuHandler()" tabindex="0" type="button">
298
- <ax-icon class="ax-icon ax-icon-more-horizontal ng-star-inserted ax-text-xl"></ax-icon>
299
- </button>
300
- </div>
303
+
304
+ @if (this.service.overflowElements().length !== 0 && this.truncateMenu()) {
305
+ <button
306
+ class="ax-general-button ax-button-icon ax-show-truncate-menu"
307
+ (click)="showMenuHandler()"
308
+ tabindex="0"
309
+ type="button"
310
+ >
311
+ <ax-icon class="ax-icon ax-icon-more-horizontal ng-star-inserted ax-text-xl"></ax-icon>
312
+ </button>
301
313
  }
302
314
  </div>
303
315
 
304
- @if (this.service.overflowElements().length !== 0) {
305
- <div [style]="{ top: menuHeight() }" class="ax-overflow-menu-container ax-menu-item-children"></div>
306
- }
307
- `, isInline: true, styles: ["ax-menu{width:100%;font-size:.875rem;line-height:1.25rem;color:inherit;position:relative}ax-menu .ax-main-menu-container{display:flex;align-items:center;width:100%;overflow:hidden}ax-menu .ax-menu-item-container{display:flex;overflow:hidden}ax-menu .originalMenu{display:flex;overflow:hidden;width:100%}ax-menu .ax-show-truncate-menu{position:absolute;right:0;width:10%}ax-menu .ax-overflow-menu-container{position:absolute;right:0}ax-menu.ax-orientation-horizontal{display:flex}ax-menu.ax-orientation-horizontal ax-menu-item:not(ax-menu.ax-orientation-horizontal ax-menu-item:last-child){margin-inline-end:1rem}ax-menu.ax-orientation-vertical{display:flex;flex-direction:column}ax-menu.ax-orientation-vertical ax-menu-item{justify-content:space-between}ax-menu.ax-orientation-vertical ax-menu-item:not(ax-menu.ax-orientation-vertical ax-menu-item:last-child){margin-bottom:1rem}ax-menu ax-menu-item:hover:not(ax-menu ax-menu-item:hover.ax-state-disabled){color:rgba(var(--ax-color-primary-500))}ax-menu-item{position:relative;display:flex;align-items:center;gap:.5rem;font-size:.875rem;line-height:1.25rem;font-weight:500;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;justify-content:space-between;color:rgba(var(--ax-color-text-default))}ax-menu-item:not(ax-menu-item.ax-state-disabled){cursor:pointer}ax-menu-item .ax-menu-item-start-side{display:flex;align-items:center;gap:.5rem}ax-menu-item.ax-state-disabled{cursor:not-allowed;opacity:.5}ax-menu-item.ax-state-selected{color:rgba(var(--ax-color-primary-500))}ax-menu-item .ax-menu-item-child-icon{width:fit-content;line-height:1}ax-menu-item ax-popover{position:absolute}.ax-menu-item-children{padding-top:.5rem;padding-bottom:.5rem}.ax-menu-item-children:not(.ax-menu-item-children:empty){display:flex;min-width:12rem;flex-direction:column;border-radius:var(--ax-rounded-border-default);border-width:1px;border-color:rgba(var(--ax-color-border-default));background-color:rgba(var(--ax-color-surface))}.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item{padding:.5rem 1rem;font-size:.875rem;line-height:1.25rem}.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item:hover:not(.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item:hover.ax-state-disabled){background-color:rgba(var(--ax-color-on-surface))}.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item:hover:not(.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item:hover.ax-state-disabled) ax-prefix,.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item:hover:not(.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item:hover.ax-state-disabled) ax-suffix{opacity:1}.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item ax-prefix,.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item ax-suffix{opacity:.75}.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item .ax-menu-item-text{flex:1 1 0%}html[dir=rtl] .ax-parent-horizontal .ax-menu-item-child-icon{transform:rotate(-90deg)}html[dir=rtl] .ax-parent-horizontal .ax-menu-item-child-icon:before{-moz-transform:scale(1,-1);-webkit-transform:scale(1,-1);-o-transform:scale(1,-1);-ms-transform:scale(1,-1);transform:scaleY(-1)}.ax-parent-horizontal .ax-menu-item-child-icon{transform:rotate(-90deg)}\n"], dependencies: [{ kind: "component", type: i1$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }], encapsulation: i0.ViewEncapsulation.None }); }
316
+ <div
317
+ [style]="{ top: menuHeight(), display: this.isMenuOpen() ? 'block' : 'none' }"
318
+ class="ax-overflow-menu-container ax-menu-item-children"
319
+ ></div>
320
+ `, isInline: true, styles: ["ax-menu{width:100%;font-size:.875rem;line-height:1.25rem;color:inherit;position:relative}ax-menu .ax-main-menu-container{display:flex;align-items:center;width:100%;overflow:hidden}ax-menu .ax-menu-item-container{display:flex;overflow:hidden;width:calc(100% - 1.3rem)}ax-menu .ax-show-truncate-menu{position:absolute;right:0;width:1.3rem}ax-menu .ax-overflow-menu-container{position:absolute;right:0}ax-menu.ax-orientation-horizontal{display:flex}ax-menu.ax-orientation-horizontal ax-menu-item:not(ax-menu.ax-orientation-horizontal ax-menu-item:last-child){margin-inline-end:1rem}ax-menu.ax-orientation-vertical{display:flex;flex-direction:column}ax-menu.ax-orientation-vertical ax-menu-item{justify-content:space-between}ax-menu.ax-orientation-vertical ax-menu-item:not(ax-menu.ax-orientation-vertical ax-menu-item:last-child){margin-bottom:1rem}ax-menu ax-menu-item:hover:not(ax-menu ax-menu-item:hover.ax-state-disabled){color:rgba(var(--ax-color-primary-500))}ax-menu-item{position:relative;display:flex;align-items:center;gap:.5rem;font-size:.875rem;line-height:1.25rem;font-weight:500;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;justify-content:space-between;color:rgba(var(--ax-color-text-default))}ax-menu-item:not(ax-menu-item.ax-state-disabled){cursor:pointer}ax-menu-item .ax-menu-item-start-side{display:flex;align-items:center;gap:.5rem}ax-menu-item.ax-state-disabled{cursor:not-allowed;opacity:.5}ax-menu-item.ax-state-selected{color:rgba(var(--ax-color-primary-500))}ax-menu-item .ax-menu-item-child-icon{width:fit-content;line-height:1;font-size:10px}ax-menu-item ax-popover{position:absolute}.overflowMenuOverride{margin-inline-end:0!important}.overflowMenuOverride:hover:not(.overflowMenuOverride:hover.ax-state-disabled){color:rgba(var(--ax-color-text-default))!important}.ax-menu-item-children{padding-top:.5rem;padding-bottom:.5rem}.ax-menu-item-children:not(.ax-menu-item-children:empty){display:flex;min-width:12rem;flex-direction:column;border-radius:var(--ax-rounded-border-default);border-width:1px;border-color:rgba(var(--ax-color-border-default));background-color:rgba(var(--ax-color-surface))}.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item{padding:.5rem 1rem;font-size:.875rem;line-height:1.25rem}.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item:hover:not(.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item:hover.ax-state-disabled){background-color:rgba(var(--ax-color-on-surface))}.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item:hover:not(.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item:hover.ax-state-disabled) ax-prefix,.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item:hover:not(.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item:hover.ax-state-disabled) ax-suffix{opacity:1}.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item ax-prefix,.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item ax-suffix{opacity:.75}.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item .ax-menu-item-text{flex:1 1 0%}html[dir=rtl] .ax-parent-horizontal .ax-menu-item-child-icon{transform:rotate(-90deg)}html[dir=rtl] .ax-parent-horizontal .ax-menu-item-child-icon:before{-moz-transform:scale(1,-1);-webkit-transform:scale(1,-1);-o-transform:scale(1,-1);-ms-transform:scale(1,-1);transform:scaleY(-1)}.ax-parent-horizontal .ax-menu-item-child-icon{transform:rotate(-90deg)}\n"], dependencies: [{ kind: "component", type: i1$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }], encapsulation: i0.ViewEncapsulation.None }); }
308
321
  }
309
322
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMenuComponent, decorators: [{
310
323
  type: Component,
311
324
  args: [{ selector: 'ax-menu', template: `
312
325
  <div class="ax-main-menu-container">
313
326
  <div
314
- [style]="{ width: this.service.overflowElements().length !== 0 ? '90%' : '100%' }"
327
+ [style]="{ width: !this.service.isOverflowExist() && !this.truncateMenu() && '100%' }"
315
328
  class="ax-menu-item-container"
316
329
  >
317
330
  <ng-content select="ax-menu-item,ng-container"></ng-content>
318
331
  </div>
319
- @if (this.service.overflowElements().length !== 0) {
320
- <div class="ax-show-truncate-menu">
321
- <button (click)="showMenuHandler()" tabindex="0" type="button">
322
- <ax-icon class="ax-icon ax-icon-more-horizontal ng-star-inserted ax-text-xl"></ax-icon>
323
- </button>
324
- </div>
332
+
333
+ @if (this.service.overflowElements().length !== 0 && this.truncateMenu()) {
334
+ <button
335
+ class="ax-general-button ax-button-icon ax-show-truncate-menu"
336
+ (click)="showMenuHandler()"
337
+ tabindex="0"
338
+ type="button"
339
+ >
340
+ <ax-icon class="ax-icon ax-icon-more-horizontal ng-star-inserted ax-text-xl"></ax-icon>
341
+ </button>
325
342
  }
326
343
  </div>
327
344
 
328
- @if (this.service.overflowElements().length !== 0) {
329
- <div [style]="{ top: menuHeight() }" class="ax-overflow-menu-container ax-menu-item-children"></div>
330
- }
345
+ <div
346
+ [style]="{ top: menuHeight(), display: this.isMenuOpen() ? 'block' : 'none' }"
347
+ class="ax-overflow-menu-container ax-menu-item-children"
348
+ ></div>
331
349
  `, encapsulation: ViewEncapsulation.None, providers: [
332
350
  {
333
351
  provide: AXRootMenu,
@@ -336,7 +354,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
336
354
  {
337
355
  provide: AXMenuService,
338
356
  },
339
- ], styles: ["ax-menu{width:100%;font-size:.875rem;line-height:1.25rem;color:inherit;position:relative}ax-menu .ax-main-menu-container{display:flex;align-items:center;width:100%;overflow:hidden}ax-menu .ax-menu-item-container{display:flex;overflow:hidden}ax-menu .originalMenu{display:flex;overflow:hidden;width:100%}ax-menu .ax-show-truncate-menu{position:absolute;right:0;width:10%}ax-menu .ax-overflow-menu-container{position:absolute;right:0}ax-menu.ax-orientation-horizontal{display:flex}ax-menu.ax-orientation-horizontal ax-menu-item:not(ax-menu.ax-orientation-horizontal ax-menu-item:last-child){margin-inline-end:1rem}ax-menu.ax-orientation-vertical{display:flex;flex-direction:column}ax-menu.ax-orientation-vertical ax-menu-item{justify-content:space-between}ax-menu.ax-orientation-vertical ax-menu-item:not(ax-menu.ax-orientation-vertical ax-menu-item:last-child){margin-bottom:1rem}ax-menu ax-menu-item:hover:not(ax-menu ax-menu-item:hover.ax-state-disabled){color:rgba(var(--ax-color-primary-500))}ax-menu-item{position:relative;display:flex;align-items:center;gap:.5rem;font-size:.875rem;line-height:1.25rem;font-weight:500;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;justify-content:space-between;color:rgba(var(--ax-color-text-default))}ax-menu-item:not(ax-menu-item.ax-state-disabled){cursor:pointer}ax-menu-item .ax-menu-item-start-side{display:flex;align-items:center;gap:.5rem}ax-menu-item.ax-state-disabled{cursor:not-allowed;opacity:.5}ax-menu-item.ax-state-selected{color:rgba(var(--ax-color-primary-500))}ax-menu-item .ax-menu-item-child-icon{width:fit-content;line-height:1}ax-menu-item ax-popover{position:absolute}.ax-menu-item-children{padding-top:.5rem;padding-bottom:.5rem}.ax-menu-item-children:not(.ax-menu-item-children:empty){display:flex;min-width:12rem;flex-direction:column;border-radius:var(--ax-rounded-border-default);border-width:1px;border-color:rgba(var(--ax-color-border-default));background-color:rgba(var(--ax-color-surface))}.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item{padding:.5rem 1rem;font-size:.875rem;line-height:1.25rem}.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item:hover:not(.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item:hover.ax-state-disabled){background-color:rgba(var(--ax-color-on-surface))}.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item:hover:not(.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item:hover.ax-state-disabled) ax-prefix,.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item:hover:not(.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item:hover.ax-state-disabled) ax-suffix{opacity:1}.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item ax-prefix,.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item ax-suffix{opacity:.75}.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item .ax-menu-item-text{flex:1 1 0%}html[dir=rtl] .ax-parent-horizontal .ax-menu-item-child-icon{transform:rotate(-90deg)}html[dir=rtl] .ax-parent-horizontal .ax-menu-item-child-icon:before{-moz-transform:scale(1,-1);-webkit-transform:scale(1,-1);-o-transform:scale(1,-1);-ms-transform:scale(1,-1);transform:scaleY(-1)}.ax-parent-horizontal .ax-menu-item-child-icon{transform:rotate(-90deg)}\n"] }]
357
+ ], styles: ["ax-menu{width:100%;font-size:.875rem;line-height:1.25rem;color:inherit;position:relative}ax-menu .ax-main-menu-container{display:flex;align-items:center;width:100%;overflow:hidden}ax-menu .ax-menu-item-container{display:flex;overflow:hidden;width:calc(100% - 1.3rem)}ax-menu .ax-show-truncate-menu{position:absolute;right:0;width:1.3rem}ax-menu .ax-overflow-menu-container{position:absolute;right:0}ax-menu.ax-orientation-horizontal{display:flex}ax-menu.ax-orientation-horizontal ax-menu-item:not(ax-menu.ax-orientation-horizontal ax-menu-item:last-child){margin-inline-end:1rem}ax-menu.ax-orientation-vertical{display:flex;flex-direction:column}ax-menu.ax-orientation-vertical ax-menu-item{justify-content:space-between}ax-menu.ax-orientation-vertical ax-menu-item:not(ax-menu.ax-orientation-vertical ax-menu-item:last-child){margin-bottom:1rem}ax-menu ax-menu-item:hover:not(ax-menu ax-menu-item:hover.ax-state-disabled){color:rgba(var(--ax-color-primary-500))}ax-menu-item{position:relative;display:flex;align-items:center;gap:.5rem;font-size:.875rem;line-height:1.25rem;font-weight:500;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;justify-content:space-between;color:rgba(var(--ax-color-text-default))}ax-menu-item:not(ax-menu-item.ax-state-disabled){cursor:pointer}ax-menu-item .ax-menu-item-start-side{display:flex;align-items:center;gap:.5rem}ax-menu-item.ax-state-disabled{cursor:not-allowed;opacity:.5}ax-menu-item.ax-state-selected{color:rgba(var(--ax-color-primary-500))}ax-menu-item .ax-menu-item-child-icon{width:fit-content;line-height:1;font-size:10px}ax-menu-item ax-popover{position:absolute}.overflowMenuOverride{margin-inline-end:0!important}.overflowMenuOverride:hover:not(.overflowMenuOverride:hover.ax-state-disabled){color:rgba(var(--ax-color-text-default))!important}.ax-menu-item-children{padding-top:.5rem;padding-bottom:.5rem}.ax-menu-item-children:not(.ax-menu-item-children:empty){display:flex;min-width:12rem;flex-direction:column;border-radius:var(--ax-rounded-border-default);border-width:1px;border-color:rgba(var(--ax-color-border-default));background-color:rgba(var(--ax-color-surface))}.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item{padding:.5rem 1rem;font-size:.875rem;line-height:1.25rem}.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item:hover:not(.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item:hover.ax-state-disabled){background-color:rgba(var(--ax-color-on-surface))}.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item:hover:not(.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item:hover.ax-state-disabled) ax-prefix,.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item:hover:not(.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item:hover.ax-state-disabled) ax-suffix{opacity:1}.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item ax-prefix,.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item ax-suffix{opacity:.75}.ax-menu-item-children:not(.ax-menu-item-children:empty) ax-menu-item .ax-menu-item-text{flex:1 1 0%}html[dir=rtl] .ax-parent-horizontal .ax-menu-item-child-icon{transform:rotate(-90deg)}html[dir=rtl] .ax-parent-horizontal .ax-menu-item-child-icon:before{-moz-transform:scale(1,-1);-webkit-transform:scale(1,-1);-o-transform:scale(1,-1);-ms-transform:scale(1,-1);transform:scaleY(-1)}.ax-parent-horizontal .ax-menu-item-child-icon{transform:rotate(-90deg)}\n"] }]
340
358
  }], ctorParameters: () => [], propDecorators: { children: [{
341
359
  type: ContentChildren,
342
360
  args: [AXMenuItemComponent]
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-components-menu.mjs","sources":["../../../../libs/components/menu/src/lib/class/root-menu.class.ts","../../../../libs/components/menu/src/lib/menu.service.ts","../../../../libs/components/menu/src/lib/menu-item/menu-item.component.ts","../../../../libs/components/menu/src/lib/menu-item/menu-item.component.html","../../../../libs/components/menu/src/lib/menu.component.ts","../../../../libs/components/menu/src/lib/menu.module.ts","../../../../libs/components/menu/src/acorex-components-menu.ts"],"sourcesContent":["import { AXOrientation } from '@acorex/components/common';\nimport { WritableSignal, signal } from '@angular/core';\nimport { AXMenuPopoverTrigger } from './popover.class';\nexport class AXRootMenu {\n orientation: WritableSignal<AXOrientation> = signal('horizontal');\n openOn: WritableSignal<AXMenuPopoverTrigger> = signal('toggle');\n}\n","import { Injectable, signal } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\nimport { AXMenuItemComponent } from './menu-item/menu-item.component';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXMenuService {\n activeMenus$: BehaviorSubject<AXMenuItemComponent[]> = new BehaviorSubject<AXMenuItemComponent[]>([]);\n\n rightOverflow = signal<number>(0);\n leftOverflow = signal<number>(0);\n overflowElements = signal<HTMLElement[]>([]);\n notOverflowElements = signal<HTMLElement[]>([]);\n}\n","import { AXClickEvent, MXInteractiveComponent } from '@acorex/components/common';\nimport { AXPopoverComponent } from '@acorex/components/popover';\nimport {\n Component,\n ContentChildren,\n HostBinding,\n HostListener,\n QueryList,\n ViewChild,\n ViewEncapsulation,\n afterNextRender,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { AXRootMenu } from '../class/root-menu.class';\nimport { AXMenuService } from '../menu.service';\n\n/**\n * Represents a menu item component used within an `ax-menu`.\n * @category Components\n */\n@Component({\n selector: 'ax-menu-item',\n inputs: ['disabled'],\n templateUrl: './menu-item.component.html',\n host: { ngSkipHydration: 'true' },\n styles: `\n .ax-menu-item-text {\n white-space: nowrap;\n }\n `,\n encapsulation: ViewEncapsulation.None,\n})\nexport class AXMenuItemComponent extends MXInteractiveComponent {\n service = inject(AXMenuService);\n\n /** @ignore */\n @ViewChild(AXPopoverComponent)\n\n /** @ignore */\n private popover: AXPopoverComponent;\n\n /**\n * Injects the `AXMenuService` for managing menu interactions.\n */\n menuService = inject(AXMenuService);\n\n /**\n * The vertical offset for positioning, initialized to 0.\n */\n offsetY = signal(0);\n\n /**\n * The horizontal offset for positioning, initialized to 0.\n */\n offsetX = signal(0);\n\n /**\n * The text content, initialized to an empty string.\n */\n text = input<string>();\n\n /**\n * Indicates whether the item is active.\n */\n active = input<boolean>();\n\n /**\n * Emitted when the active state changes.\n */\n activeChange = output<boolean>();\n\n /**\n * Emitted when the element is clicked.\n */\n onClick = output<AXClickEvent>();\n\n /**\n * Indicates whether the component is a root menu item.\n * @defaultValue false\n */\n isRoot = false;\n\n /**\n * The parent menu item component, if any.\n */\n parent?: AXMenuItemComponent;\n\n /**\n * Injects the root menu service.\n */\n rootMenu = inject(AXRootMenu);\n\n /** @ignore */\n @ContentChildren(AXMenuItemComponent)\n children: QueryList<AXMenuItemComponent>;\n\n /** @ignore */\n constructor() {\n super();\n\n afterNextRender(() => {\n this.children.forEach((c) => {\n c.parent = this;\n });\n\n this.offsetY.set(this.isRoot ? 8 : 0);\n this.offsetX.set(this.isRoot ? 0 : 4);\n\n this.getPlacement();\n });\n\n effect(\n () => {\n if (!this.getHostElement().getClientRects()[0]?.right) return;\n //add overflow items to array\n if (\n this.getHostElement().getClientRects()[0]?.right > this.service.rightOverflow() ||\n this.getHostElement().getClientRects()[0]?.left < this.service.leftOverflow()\n ) {\n this.service.overflowElements.update((prev) => [...prev, this.getHostElement()]);\n } else {\n this.service.notOverflowElements.update((prev) => [...prev, this.getHostElement()]);\n }\n },\n { allowSignalWrites: true },\n );\n }\n\n /**\n * Closes the popover if it is open.\n */\n close() {\n this.popover?.close();\n }\n\n /** @ignore */\n _handleOnOpened() {\n this.parent.children.forEach((c) => {\n if (c != this) {\n c.close();\n }\n });\n if (this.children.length) {\n this.menuService.activeMenus$.next(this.menuService.activeMenus$.getValue().concat(this));\n }\n }\n\n /** @ignore */\n _handleOnClosed() {\n this.children.forEach((c) => {\n c.close();\n });\n }\n\n /**\n * Returns the icon based on the orientation of the root menu.\n */\n getIcon() {\n if (this.rootMenu.orientation() == 'vertical') {\n return 'ax-icon-arrow-right';\n } else {\n return 'ax-icon-arrow-down';\n }\n }\n\n /**\n * Determines the placement based on the root menu's orientation: 'bottom-start' for horizontal root, 'end-top' otherwise.\n */\n getPlacement() {\n switch (this.rootMenu.orientation()) {\n case 'horizontal':\n if (this.isRoot) {\n return 'bottom-start';\n } else {\n return 'end-top';\n }\n break;\n case 'vertical':\n if (this.isRoot) {\n return 'end-top';\n } else {\n return 'end-top';\n }\n break;\n default:\n return 'bottom-start';\n }\n }\n\n /** @ignore */\n @HostBinding('class')\n get __hostClass(): string[] {\n return [`${this.disabled ? 'ax-state-disabled' : ''}`, `${this.active() ? 'ax-state-active' : ''}`];\n }\n\n /** @ignore */\n @HostListener('click', ['$event'])\n private __hostClick(e: MouseEvent) {\n if (!this.disabled) {\n this.onClick.emit({\n component: this,\n htmlElement: this.getHostElement(),\n nativeEvent: e,\n });\n if (!this.children.length) {\n this.menuService.activeMenus$.subscribe((c) => c.forEach((x) => x.close())).unsubscribe();\n this.menuService.activeMenus$.next([]);\n }\n }\n }\n}\n","<div class=\"ax-menu-item-start-side\">\n <ng-content select=\"ax-prefix\"></ng-content>\n <p class=\"ax-menu-item-text\">{{ text() }}</p>\n</div>\n<ng-content select=\"ax-suffix\"></ng-content>\n@if (children.length) {\n <i class=\"ax-icon ax-icon-solid {{ getIcon() }} ax-menu-item-child-icon\"></i>\n}\n\n<ax-popover\n #popover\n [closeOn]=\"'clickOut'\"\n [openOn]=\"rootMenu.openOn()\"\n [target]=\"getHostElement()\"\n [offsetY]=\"offsetY()\"\n [offsetX]=\"offsetX()\"\n [placement]=\"getPlacement()\"\n (onOpened)=\"_handleOnOpened()\"\n (onClosed)=\"_handleOnClosed()\"\n>\n <div class=\"ax-menu-item-children ax-parent-{{ this.rootMenu.orientation() }}\">\n <ng-content select=\"ax-menu-item\"></ng-content>\n </div>\n</ax-popover>\n","import { AXOrientation, MXBaseComponent } from '@acorex/components/common';\nimport {\n afterNextRender,\n AfterViewInit,\n Component,\n ContentChildren,\n effect,\n HostBinding,\n inject,\n input,\n QueryList,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport { AXMenuPopoverTrigger } from './class/popover.class';\nimport { AXRootMenu } from './class/root-menu.class';\nimport { AXMenuItemComponent } from './menu-item/menu-item.component';\nimport { AXMenuService } from './menu.service';\n\n/**\n * Represents a menu component that displays menu items.\n * @category Components\n */\n@Component({\n selector: 'ax-menu',\n template: `\n <div class=\"ax-main-menu-container\">\n <div\n [style]=\"{ width: this.service.overflowElements().length !== 0 ? '90%' : '100%' }\"\n class=\"ax-menu-item-container\"\n >\n <ng-content select=\"ax-menu-item,ng-container\"></ng-content>\n </div>\n @if (this.service.overflowElements().length !== 0) {\n <div class=\"ax-show-truncate-menu\">\n <button (click)=\"showMenuHandler()\" tabindex=\"0\" type=\"button\">\n <ax-icon class=\"ax-icon ax-icon-more-horizontal ng-star-inserted ax-text-xl\"></ax-icon>\n </button>\n </div>\n }\n </div>\n\n @if (this.service.overflowElements().length !== 0) {\n <div [style]=\"{ top: menuHeight() }\" class=\"ax-overflow-menu-container ax-menu-item-children\"></div>\n }\n `,\n styleUrls: ['./menu.component.scss'],\n encapsulation: ViewEncapsulation.None,\n providers: [\n {\n provide: AXRootMenu,\n useExisting: AXMenuComponent,\n },\n {\n provide: AXMenuService,\n },\n ],\n})\nexport class AXMenuComponent extends MXBaseComponent implements AfterViewInit {\n orientation = input<AXOrientation>('horizontal');\n openOn = input<AXMenuPopoverTrigger>('toggle');\n service = inject(AXMenuService);\n menuHeight = signal<string>('');\n isMenuOpen = signal(false);\n\n /** @ignore */\n @ContentChildren(AXMenuItemComponent)\n children: QueryList<AXMenuItemComponent>;\n\n constructor() {\n super();\n\n afterNextRender(() => {\n //add menu container border for detect overflow happen\n this.menuHeight.set(`${this.getHostElement()?.getClientRects()[0]?.height}px`);\n this.service.rightOverflow.set(\n this.getHostElement().querySelector('.ax-menu-item-container')?.getClientRects()[0]?.right,\n );\n this.service.leftOverflow.set(\n this.getHostElement().querySelector('.ax-menu-item-container')?.getClientRects()[0]?.left,\n );\n });\n\n let resizeTimer;\n\n window.addEventListener('resize', () => {\n //add menu container border for detect overflow happen\n clearTimeout(resizeTimer);\n if (!this.getHostElement()) return;\n resizeTimer = setTimeout(() => {\n this.service.rightOverflow.set(\n this.getHostElement().querySelector('.ax-menu-item-container').getClientRects()[0].right,\n );\n this.service.leftOverflow.set(\n this.getHostElement().querySelector('.ax-menu-item-container').getClientRects()[0].left,\n );\n this.service.notOverflowElements.set([]);\n this.service.overflowElements.set([]);\n this.isMenuOpen.set(false);\n }, 200);\n });\n\n effect(() => {\n //rearrange items base on menu state\n const overflowMenu = this.getHostElement().querySelector('.overflowMenu');\n const originalMenu = this.getHostElement().querySelector('.originalMenu');\n const injectContainer = this.getHostElement().querySelector('.ax-overflow-menu-container');\n const injectContainer2 = this.getHostElement().querySelector('.ax-menu-item-container');\n\n if (this.isMenuOpen()) {\n overflowMenu?.remove();\n const axMenu = document.createElement('ax-menu');\n axMenu.classList.add('overflowMenu');\n this.service.overflowElements().forEach((item) => {\n axMenu.appendChild(item);\n });\n injectContainer.appendChild(axMenu);\n } else {\n originalMenu?.remove();\n overflowMenu?.remove();\n const axMenu = document.createElement('ax-menu');\n axMenu.classList.add('originalMenu');\n const allItems = [...this.service.overflowElements(), ...this.service.notOverflowElements()];\n allItems.forEach((item) => {\n axMenu.appendChild(item);\n });\n\n injectContainer2.appendChild(axMenu);\n }\n });\n }\n\n showMenuHandler() {\n this.isMenuOpen.update((prev) => !prev);\n }\n\n /** @ignore */\n ngAfterViewInit() {\n this.children.forEach((c) => {\n c.isRoot = true;\n c.parent = this as unknown as AXMenuItemComponent;\n });\n }\n\n /** @ignore */\n @HostBinding('class')\n get __hostClass(): string {\n return `ax-orientation-${this.orientation()} main-menu`;\n }\n}\n","import { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXLoadingModule } from '@acorex/components/loading';\nimport { AXPopoverModule } from '@acorex/components/popover';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { OverlayModule } from '@angular/cdk/overlay';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXMenuItemComponent } from './menu-item/menu-item.component';\nimport { AXMenuComponent } from './menu.component';\n\nconst COMPONENT = [AXMenuItemComponent, AXMenuComponent];\nconst MODULES = [AXDecoratorModule, AXLoadingModule, AXTranslationModule, OverlayModule, AXPopoverModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [CommonModule, ...MODULES, AXButtonModule],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXMenuModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;MAGa,UAAU,CAAA;AAAvB,IAAA,WAAA,GAAA;AACE,QAAA,IAAA,CAAA,WAAW,GAAkC,MAAM,CAAC,YAAY,CAAC,CAAC;AAClE,QAAA,IAAA,CAAA,MAAM,GAAyC,MAAM,CAAC,QAAQ,CAAC,CAAC;KACjE;AAAA;;MCCY,aAAa,CAAA;AAH1B,IAAA,WAAA,GAAA;AAIE,QAAA,IAAA,CAAA,YAAY,GAA2C,IAAI,eAAe,CAAwB,EAAE,CAAC,CAAC;AAEtG,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAS,CAAC,CAAC,CAAC;AAClC,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAS,CAAC,CAAC,CAAC;AACjC,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAgB,EAAE,CAAC,CAAC;AAC7C,QAAA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src/lib/class/root-menu.class.ts","../../../../libs/components/menu/src/lib/menu.service.ts","../../../../libs/components/menu/src/lib/menu-item/menu-item.component.ts","../../../../libs/components/menu/src/lib/menu-item/menu-item.component.html","../../../../libs/components/menu/src/lib/menu.component.ts","../../../../libs/components/menu/src/lib/menu.module.ts","../../../../libs/components/menu/src/acorex-components-menu.ts"],"sourcesContent":["import { AXOrientation } from '@acorex/components/common';\nimport { WritableSignal, signal } from '@angular/core';\nimport { AXMenuPopoverTrigger } from './popover.class';\nexport class AXRootMenu {\n orientation: WritableSignal<AXOrientation> = signal('horizontal');\n openOn: WritableSignal<AXMenuPopoverTrigger> = signal('toggle');\n}\n","import { Injectable, signal } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\nimport { AXMenuItemComponent } from './menu-item/menu-item.component';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXMenuService {\n activeMenus$: BehaviorSubject<AXMenuItemComponent[]> = new BehaviorSubject<AXMenuItemComponent[]>([]);\n\n rightOverflow = signal<number>(0);\n leftOverflow = signal<number>(0);\n overflowElements = signal<HTMLElement[]>([]);\n notOverflowElements = signal<HTMLElement[]>([]);\n isOverflowExist = signal(false);\n}\n","import { AXClickEvent, MXInteractiveComponent } from '@acorex/components/common';\nimport { AXPopoverComponent } from '@acorex/components/popover';\nimport {\n Component,\n ContentChildren,\n HostBinding,\n HostListener,\n QueryList,\n ViewChild,\n ViewEncapsulation,\n afterNextRender,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { AXRootMenu } from '../class/root-menu.class';\nimport { AXMenuService } from '../menu.service';\n\n/**\n * Represents a menu item component used within an `ax-menu`.\n * @category Components\n */\n@Component({\n selector: 'ax-menu-item',\n inputs: ['disabled'],\n templateUrl: './menu-item.component.html',\n host: { ngSkipHydration: 'true' },\n styles: `\n .ax-menu-item-text {\n white-space: nowrap;\n }\n `,\n encapsulation: ViewEncapsulation.None,\n})\nexport class AXMenuItemComponent extends MXInteractiveComponent {\n service = inject(AXMenuService);\n\n /** @ignore */\n @ViewChild(AXPopoverComponent)\n\n /** @ignore */\n private popover: AXPopoverComponent;\n\n /**\n * Injects the `AXMenuService` for managing menu interactions.\n */\n menuService = inject(AXMenuService);\n\n /**\n * The vertical offset for positioning, initialized to 0.\n */\n offsetY = signal(0);\n\n /**\n * The horizontal offset for positioning, initialized to 0.\n */\n offsetX = signal(0);\n\n /**\n * The text content, initialized to an empty string.\n */\n text = input<string>();\n\n /**\n * Indicates whether the item is active.\n */\n active = input<boolean>();\n\n /**\n * Emitted when the active state changes.\n */\n activeChange = output<boolean>();\n\n /**\n * Emitted when the element is clicked.\n */\n onClick = output<AXClickEvent>();\n\n /**\n * Indicates whether the component is a root menu item.\n * @defaultValue false\n */\n isRoot = false;\n\n /**\n * The parent menu item component, if any.\n */\n parent?: AXMenuItemComponent;\n\n /**\n * Injects the root menu service.\n */\n rootMenu = inject(AXRootMenu);\n\n /** @ignore */\n @ContentChildren(AXMenuItemComponent)\n children: QueryList<AXMenuItemComponent>;\n\n arrowState = input(true);\n\n /** @ignore */\n constructor() {\n super();\n\n afterNextRender(() => {\n this.children.forEach((c) => {\n c.parent = this;\n });\n\n this.offsetY.set(this.isRoot ? 8 : 0);\n this.offsetX.set(this.isRoot ? 0 : 4);\n\n this.getPlacement();\n });\n\n effect(\n () => {\n if (!this.getHostElement()?.getClientRects()[0]) return;\n //add overflow items to array\n if (\n this.getHostElement()?.getClientRects()[0]?.right > this.service.rightOverflow() ||\n this.getHostElement()?.getClientRects()[0]?.left < this.service.leftOverflow()\n ) {\n this.service.overflowElements.update((prev) => [...prev, this.getHostElement()]);\n this.service.isOverflowExist.set(true);\n } else {\n this.service.notOverflowElements.update((prev) => [...prev, this.getHostElement()]);\n }\n },\n { allowSignalWrites: true },\n );\n }\n\n /**\n * Closes the popover if it is open.\n */\n close() {\n this.popover?.close();\n }\n\n /** @ignore */\n _handleOnOpened() {\n this.parent.children.forEach((c) => {\n if (c != this) {\n c.close();\n }\n });\n if (this.children.length) {\n this.menuService.activeMenus$.next(this.menuService.activeMenus$.getValue().concat(this));\n }\n }\n\n /** @ignore */\n _handleOnClosed() {\n this.children.forEach((c) => {\n c.close();\n });\n }\n\n /**\n * Returns the icon based on the orientation of the root menu.\n */\n getIcon() {\n if (this.rootMenu.orientation() === 'vertical') {\n return 'ax-icon-chevron-right';\n } else {\n return 'ax-icon-chevron-down';\n }\n }\n\n /**\n * Determines the placement based on the root menu's orientation: 'bottom-start' for horizontal root, 'end-top' otherwise.\n */\n getPlacement() {\n switch (this.rootMenu.orientation()) {\n case 'horizontal':\n if (this.isRoot) {\n return 'bottom-start';\n } else {\n return 'end-top';\n }\n break;\n case 'vertical':\n if (this.isRoot) {\n return 'end-top';\n } else {\n return 'end-top';\n }\n break;\n default:\n return 'bottom-start';\n }\n }\n\n /** @ignore */\n @HostBinding('class')\n get __hostClass(): string[] {\n return [`${this.disabled ? 'ax-state-disabled' : ''}`, `${this.active() ? 'ax-state-active' : ''}`];\n }\n\n /** @ignore */\n @HostListener('click', ['$event'])\n private __hostClick(e: MouseEvent) {\n if (!this.disabled) {\n this.onClick.emit({\n component: this,\n htmlElement: this.getHostElement(),\n nativeEvent: e,\n });\n if (!this.children.length) {\n this.menuService.activeMenus$.subscribe((c) => c.forEach((x) => x.close())).unsubscribe();\n this.menuService.activeMenus$.next([]);\n }\n }\n }\n}\n","<div class=\"ax-menu-item-start-side\">\n <ng-content select=\"ax-prefix\"></ng-content>\n <p class=\"ax-menu-item-text\">{{ text() }}</p>\n</div>\n<ng-content select=\"ax-suffix\"></ng-content>\n@if (children.length && arrowState()) {\n <i class=\"ax-icon ax-icon-solid {{ getIcon() }} ax-menu-item-child-icon\"></i>\n}\n\n<ax-popover\n #popover\n [closeOn]=\"'clickOut'\"\n [openOn]=\"rootMenu.openOn()\"\n [target]=\"getHostElement()\"\n [offsetY]=\"offsetY()\"\n [offsetX]=\"offsetX()\"\n [placement]=\"getPlacement()\"\n (onOpened)=\"_handleOnOpened()\"\n (onClosed)=\"_handleOnClosed()\"\n>\n <div class=\"ax-menu-item-children ax-parent-{{ this.rootMenu.orientation() }}\">\n <ng-content select=\"ax-menu-item\"></ng-content>\n </div>\n</ax-popover>\n","import { AXOrientation, MXBaseComponent } from '@acorex/components/common';\nimport {\n afterNextRender,\n AfterViewInit,\n Component,\n ContentChildren,\n HostBinding,\n inject,\n input,\n QueryList,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport { AXMenuPopoverTrigger } from './class/popover.class';\nimport { AXRootMenu } from './class/root-menu.class';\nimport { AXMenuItemComponent } from './menu-item/menu-item.component';\nimport { AXMenuService } from './menu.service';\n\n/**\n * Represents a menu component that displays menu items.\n * @category Components\n */\n@Component({\n selector: 'ax-menu',\n template: `\n <div class=\"ax-main-menu-container\">\n <div\n [style]=\"{ width: !this.service.isOverflowExist() && !this.truncateMenu() && '100%' }\"\n class=\"ax-menu-item-container\"\n >\n <ng-content select=\"ax-menu-item,ng-container\"></ng-content>\n </div>\n\n @if (this.service.overflowElements().length !== 0 && this.truncateMenu()) {\n <button\n class=\"ax-general-button ax-button-icon ax-show-truncate-menu\"\n (click)=\"showMenuHandler()\"\n tabindex=\"0\"\n type=\"button\"\n >\n <ax-icon class=\"ax-icon ax-icon-more-horizontal ng-star-inserted ax-text-xl\"></ax-icon>\n </button>\n }\n </div>\n\n <div\n [style]=\"{ top: menuHeight(), display: this.isMenuOpen() ? 'block' : 'none' }\"\n class=\"ax-overflow-menu-container ax-menu-item-children\"\n ></div>\n `,\n styleUrls: ['./menu.component.scss'],\n encapsulation: ViewEncapsulation.None,\n providers: [\n {\n provide: AXRootMenu,\n useExisting: AXMenuComponent,\n },\n {\n provide: AXMenuService,\n },\n ],\n})\nexport class AXMenuComponent extends MXBaseComponent implements AfterViewInit {\n orientation = input<AXOrientation>('horizontal');\n openOn = input<AXMenuPopoverTrigger>('toggle');\n service = inject(AXMenuService);\n menuHeight = signal<string>('');\n isMenuOpen = signal(false);\n truncateMenu = input(false);\n\n /** @ignore */\n @ContentChildren(AXMenuItemComponent)\n children: QueryList<AXMenuItemComponent>;\n\n constructor() {\n super();\n afterNextRender(() => {\n if (!this.truncateMenu()) return;\n\n //add menu container border for detect overflow happen\n this.menuHeight.set(`${this.getHostElement()?.getClientRects()[0]?.height + 10}px`);\n this.service.rightOverflow.set(\n this.getHostElement()?.querySelector('.ax-menu-item-container')?.getClientRects()[0]?.right,\n );\n this.service.leftOverflow.set(\n this.getHostElement()?.querySelector('.ax-menu-item-container')?.getClientRects()[0]?.left,\n );\n\n let resizeTimer;\n\n window.addEventListener('resize', () => {\n //add menu container border for detect overflow happen\n clearTimeout(resizeTimer);\n if (!this.getHostElement()) return;\n resizeTimer = setTimeout(() => {\n this.service.rightOverflow.set(\n this.getHostElement()?.querySelector('.ax-menu-item-container').getClientRects()[0].right,\n );\n this.service.leftOverflow.set(\n this.getHostElement()?.querySelector('.ax-menu-item-container').getClientRects()[0].left,\n );\n if (this.isMenuOpen()) this.showMenuHandler();\n this.service.notOverflowElements.set([]);\n this.service.overflowElements.set([]);\n }, 200);\n });\n\n document.addEventListener('click', (event) => {\n const menu = document.querySelector('.ax-overflow-menu-container');\n const menuButton = document.querySelector('.ax-show-truncate-menu');\n if (\n !menu.contains(event.target as HTMLElement) &&\n !menuButton.contains(event.target as HTMLElement)\n ) {\n if (this.isMenuOpen()) this.showMenuHandler();\n }\n });\n });\n }\n\n showMenuHandler() {\n this.isMenuOpen.update((prev) => !prev);\n\n const injectContainer = this.getHostElement().querySelector('.ax-overflow-menu-container');\n const injectContainer2 = this.getHostElement().querySelector('.ax-menu-item-container');\n\n if (this.isMenuOpen()) {\n this.service.overflowElements().forEach((item) => {\n item.classList.add('overflowMenuOverride');\n injectContainer.appendChild(item);\n });\n this.service.notOverflowElements().forEach((item) => {\n item.classList.remove('overflowMenuOverride');\n injectContainer2.appendChild(item);\n });\n } else {\n const allItems = [...this.service.notOverflowElements(), ...this.service.overflowElements()];\n allItems.forEach((item) => {\n item.classList.remove('overflowMenuOverride');\n injectContainer2.appendChild(item);\n });\n }\n }\n\n /** @ignore */\n ngAfterViewInit() {\n this.children.forEach((c) => {\n c.isRoot = true;\n c.parent = this as unknown as AXMenuItemComponent;\n });\n }\n\n /** @ignore */\n @HostBinding('class')\n get __hostClass(): string {\n return `ax-orientation-${this.orientation()}`;\n }\n}\n","import { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXLoadingModule } from '@acorex/components/loading';\nimport { AXPopoverModule } from '@acorex/components/popover';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { OverlayModule } from '@angular/cdk/overlay';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXMenuItemComponent } from './menu-item/menu-item.component';\nimport { AXMenuComponent } from './menu.component';\n\nconst COMPONENT = [AXMenuItemComponent, AXMenuComponent];\nconst MODULES = [AXDecoratorModule, AXLoadingModule, AXTranslationModule, OverlayModule, AXPopoverModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [CommonModule, ...MODULES, AXButtonModule],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXMenuModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;MAGa,UAAU,CAAA;AAAvB,IAAA,WAAA,GAAA;AACE,QAAA,IAAA,CAAA,WAAW,GAAkC,MAAM,CAAC,YAAY,CAAC,CAAC;AAClE,QAAA,IAAA,CAAA,MAAM,GAAyC,MAAM,CAAC,QAAQ,CAAC,CAAC;KACjE;AAAA;;MCCY,aAAa,CAAA;AAH1B,IAAA,WAAA,GAAA;AAIE,QAAA,IAAA,CAAA,YAAY,GAA2C,IAAI,eAAe,CAAwB,EAAE,CAAC,CAAC;AAEtG,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAS,CAAC,CAAC,CAAC;AAClC,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAS,CAAC,CAAC,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A,YAAA,EAAA,CATN,mBAAmB,EAAE,eAAe,aAK3C,YAAY,EAJP,iBAAiB,EAAE,eAAe,EAAE,mBAAmB,EAAE,aAAa,EAAE,eAAe,EAIlE,cAAc,CAAA,EAAA,OAAA,EAAA,CALjC,mBAAmB,EAAE,eAAe,CAAA,EAAA,CAAA,CAAA,EAAA;AAS1C,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,EAJb,OAAA,EAAA,CAAA,YAAY,EAAK,OAAO,EAAE,cAAc,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAIvC,YAAY,EAAA,UAAA,EAAA,CAAA;kBANxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,GAAG,SAAS,CAAC;oBAC5B,OAAO,EAAE,CAAC,YAAY,EAAE,GAAG,OAAO,EAAE,cAAc,CAAC;AACnD,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;AACvB,oBAAA,SAAS,EAAE,EAAE;AACd,iBAAA,CAAA;;;ACnBD;;AAEG;;;;"}
@@ -1,11 +1,11 @@
1
1
  import { generateQRCode } from '@acorex/cdk/qrcode';
2
2
  import { AXValuableComponent } from '@acorex/components/common';
3
3
  import * as i0 from '@angular/core';
4
- import { input, signal, viewChild, computed, effect, forwardRef, Component, ViewEncapsulation, ChangeDetectionStrategy, NgModule } from '@angular/core';
4
+ import { input, signal, viewChild, effect, forwardRef, Component, ViewEncapsulation, ChangeDetectionStrategy, NgModule } from '@angular/core';
5
5
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
6
6
  import { CommonModule } from '@angular/common';
7
7
 
8
- function debounce(func, delay) {
8
+ function debounce(func, delayMS) {
9
9
  let timeoutId;
10
10
  return function (...args) {
11
11
  if (timeoutId) {
@@ -13,7 +13,7 @@ function debounce(func, delay) {
13
13
  }
14
14
  timeoutId = setTimeout(() => {
15
15
  func(...args);
16
- }, delay);
16
+ }, delayMS);
17
17
  };
18
18
  }
19
19
 
@@ -63,21 +63,6 @@ class AXQrcodeComponent {
63
63
  * @ignore
64
64
  */
65
65
  this.svg = viewChild('svg');
66
- /**
67
- * @ignore
68
- */
69
- this.calculateLogoSize = computed(() => {
70
- switch (this.level()) {
71
- case 'L':
72
- return Math.sqrt((5 / 100) * (this.size() * this.size()));
73
- case 'M':
74
- return Math.sqrt((8 / 100) * (this.size() * this.size()));
75
- case 'Q':
76
- return Math.sqrt((11 / 100) * (this.size() * this.size()));
77
- case 'H':
78
- return Math.sqrt((14 / 100) * (this.size() * this.size()));
79
- }
80
- });
81
66
  effect(() => {
82
67
  this.generate();
83
68
  }, {
@@ -106,7 +91,7 @@ class AXQrcodeComponent {
106
91
  useExisting: forwardRef(() => AXQrcodeComponent),
107
92
  multi: true,
108
93
  },
109
- ], viewQueries: [{ propertyName: "canvas", first: true, predicate: ["canvas"], descendants: true, isSignal: true }, { propertyName: "svg", first: true, predicate: ["svg"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"qrcode\">\n @if (outputType() === 'canvas') {\n <canvas #canvas></canvas>\n } @else if (outputType() === 'svg') {\n <div #svg></div>\n } @else {\n <img [src]=\"qrCodeUrl()\" alt=\"QR Code\" />\n }\n <div class=\"logo-container\" [style.width.px]=\"calculateLogoSize()\" [style.height.px]=\"calculateLogoSize()\">\n <ng-content select=\"img\"></ng-content>\n </div>\n</div>\n", styles: [".qrcode{position:relative}.qrcode .logo-container{position:absolute;display:flex;align-items:center;justify-content:center;top:50%;left:50%;transform:translate(-50%,-50%)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
94
+ ], viewQueries: [{ propertyName: "canvas", first: true, predicate: ["canvas"], descendants: true, isSignal: true }, { propertyName: "svg", first: true, predicate: ["svg"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"qrcode\">\n @if (outputType() === 'canvas') {\n <canvas #canvas></canvas>\n } @else if (outputType() === 'svg') {\n <div #svg></div>\n } @else {\n <img [src]=\"qrCodeUrl()\" alt=\"QR Code\" />\n }\n <div class=\"logo-container\">\n <ng-content select=\"img\"></ng-content>\n </div>\n</div>\n", styles: [".qrcode{position:relative}.qrcode .logo-container{position:absolute;display:flex;align-items:center;justify-content:center;top:50%;left:50%;transform:translate(-50%,-50%)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
110
95
  }
111
96
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXQrcodeComponent, decorators: [{
112
97
  type: Component,
@@ -117,15 +102,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
117
102
  useExisting: forwardRef(() => AXQrcodeComponent),
118
103
  multi: true,
119
104
  },
120
- ], template: "<div class=\"qrcode\">\n @if (outputType() === 'canvas') {\n <canvas #canvas></canvas>\n } @else if (outputType() === 'svg') {\n <div #svg></div>\n } @else {\n <img [src]=\"qrCodeUrl()\" alt=\"QR Code\" />\n }\n <div class=\"logo-container\" [style.width.px]=\"calculateLogoSize()\" [style.height.px]=\"calculateLogoSize()\">\n <ng-content select=\"img\"></ng-content>\n </div>\n</div>\n", styles: [".qrcode{position:relative}.qrcode .logo-container{position:absolute;display:flex;align-items:center;justify-content:center;top:50%;left:50%;transform:translate(-50%,-50%)}\n"] }]
105
+ ], template: "<div class=\"qrcode\">\n @if (outputType() === 'canvas') {\n <canvas #canvas></canvas>\n } @else if (outputType() === 'svg') {\n <div #svg></div>\n } @else {\n <img [src]=\"qrCodeUrl()\" alt=\"QR Code\" />\n }\n <div class=\"logo-container\">\n <ng-content select=\"img\"></ng-content>\n </div>\n</div>\n", styles: [".qrcode{position:relative}.qrcode .logo-container{position:absolute;display:flex;align-items:center;justify-content:center;top:50%;left:50%;transform:translate(-50%,-50%)}\n"] }]
121
106
  }], ctorParameters: () => [] });
122
107
 
123
- class QrcodeModule {
124
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: QrcodeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
125
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.0", ngImport: i0, type: QrcodeModule, declarations: [AXQrcodeComponent], imports: [CommonModule], exports: [AXQrcodeComponent] }); }
126
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: QrcodeModule, imports: [CommonModule] }); }
108
+ class AXQrcodeModule {
109
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXQrcodeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
110
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.0", ngImport: i0, type: AXQrcodeModule, declarations: [AXQrcodeComponent], imports: [CommonModule], exports: [AXQrcodeComponent] }); }
111
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXQrcodeModule, imports: [CommonModule] }); }
127
112
  }
128
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: QrcodeModule, decorators: [{
113
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXQrcodeModule, decorators: [{
129
114
  type: NgModule,
130
115
  args: [{
131
116
  declarations: [AXQrcodeComponent],
@@ -138,5 +123,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
138
123
  * Generated bundle index. Do not edit.
139
124
  */
140
125
 
141
- export { AXQrcodeComponent, QrcodeModule, debounce };
126
+ export { AXQrcodeComponent, AXQrcodeModule, debounce };
142
127
  //# sourceMappingURL=acorex-components-qrcode.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-components-qrcode.mjs","sources":["../../../../libs/components/qrcode/src/lib/qrcode.class.ts","../../../../libs/components/qrcode/src/lib/qrcode.component.ts","../../../../libs/components/qrcode/src/lib/qrcode.component.html","../../../../libs/components/qrcode/src/lib/qrcode.module.ts","../../../../libs/components/qrcode/src/acorex-components-qrcode.ts"],"sourcesContent":["export type AXQrcodeOutputType = 'canvas' | 'svg' | 'url';\nexport type AXQrcodeLevel = 'L' | 'M' | 'Q' | 'H';\n\nexport function debounce(func, delay) {\n let timeoutId;\n\n return function (...args) {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(() => {\n func(...args);\n }, delay);\n };\n}\n","import { generateQRCode } from '@acorex/cdk/qrcode';\nimport { AXValuableComponent } from '@acorex/components/common';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n forwardRef,\n input,\n signal,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { AXQrcodeLevel, AXQrcodeOutputType } from './qrcode.class';\n\n@Component({\n selector: 'ax-qrcode',\n templateUrl: './qrcode.component.html',\n styleUrls: ['./qrcode.component.scss'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n { provide: AXValuableComponent, useExisting: AXQrcodeComponent },\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AXQrcodeComponent),\n multi: true,\n },\n ],\n})\nexport class AXQrcodeComponent implements AfterViewInit {\n /**\n * @description Value of QR code\n */\n content = input.required<string>();\n /**\n * @description Size of the QR code\n * @default 256\n */\n size = input(256);\n /**\n * @description Error correction level can be 'L' | 'M' | 'Q' | 'H'\n * @default 'M'\n */\n level = input<AXQrcodeLevel>('M');\n /**\n * @description QR code color, can be a hex code or CSS color name\n * @default '#000000'\n */\n color = input('#000000');\n /**\n * @description QR code Background color, can be a hex code or CSS color name\n * @default '#FFFFFF'\n */\n backgroundColor = input('#FFFFFF');\n /**\n * @description Type of output can be 'canvas' | 'svg' | 'url'\n * @default 'canvas'\n */\n outputType = input<AXQrcodeOutputType>('canvas'); //\n /**\n * @ignore\n */\n /**\n * @description // Holds base64 or URL if outputType is 'url' or 'base64'\n */\n protected qrCodeUrl = signal<string | undefined>(undefined);\n /**\n * @ignore\n */\n private canvas = viewChild<ElementRef<HTMLCanvasElement>>('canvas');\n /**\n * @ignore\n */\n private svg = viewChild<ElementRef<HTMLCanvasElement>>('svg');\n /**\n * @ignore\n */\n calculateLogoSize = computed(() => {\n switch (this.level()) {\n case 'L':\n return Math.sqrt((5 / 100) * (this.size() * this.size()));\n case 'M':\n return Math.sqrt((8 / 100) * (this.size() * this.size()));\n case 'Q':\n return Math.sqrt((11 / 100) * (this.size() * this.size()));\n case 'H':\n return Math.sqrt((14 / 100) * (this.size() * this.size()));\n }\n });\n constructor() {\n effect(\n () => {\n this.generate();\n },\n {\n allowSignalWrites: true,\n },\n );\n }\n\n ngAfterViewInit() {\n this.generate();\n }\n generate() {\n generateQRCode(\n this.content(),\n this.size(),\n this.level(),\n this.color(),\n this.backgroundColor(),\n this.outputType(),\n this.canvas()?.nativeElement,\n this.svg()?.nativeElement,\n )\n .then((result) => {\n if (this.outputType() === 'url') {\n this.qrCodeUrl.set(result as string);\n }\n })\n .catch((error) => {\n console.error(error);\n });\n }\n}\n","<div class=\"qrcode\">\n @if (outputType() === 'canvas') {\n <canvas #canvas></canvas>\n } @else if (outputType() === 'svg') {\n <div #svg></div>\n } @else {\n <img [src]=\"qrCodeUrl()\" alt=\"QR Code\" />\n }\n <div class=\"logo-container\" [style.width.px]=\"calculateLogoSize()\" [style.height.px]=\"calculateLogoSize()\">\n <ng-content select=\"img\"></ng-content>\n </div>\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXQrcodeComponent } from './qrcode.component';\n\n@NgModule({\n declarations: [AXQrcodeComponent],\n imports: [CommonModule],\n exports: [AXQrcodeComponent],\n})\nexport class QrcodeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAGgB,SAAA,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAA;AAClC,IAAA,IAAI,SAAS,CAAC;IAEd,OAAO,UAAU,GAAG,IAAI,EAAA;QACtB,IAAI,SAAS,EAAE;YACb,YAAY,CAAC,SAAS,CAAC,CAAC;SACzB;AACD,QAAA,SAAS,GAAG,UAAU,CAAC,MAAK;AAC1B,YAAA,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;SACf,EAAE,KAAK,CAAC,CAAC;AACZ,KAAC,CAAC;AACJ;;MCmBa,iBAAiB,CAAA;AA4D5B,IAAA,WAAA,GAAA;AA3DA;;AAEG;AACH,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;AACnC;;;AAGG;AACH,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;AAClB;;;AAGG;AACH,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAgB,GAAG,CAAC,CAAC;AAClC;;;AAGG;AACH,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;AACzB;;;AAGG;AACH,QAAA,IAAA,CAAA,eAAe,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;AACnC;;;AAGG;AACH,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAqB,QAAQ,CAAC,CAAC;AACjD;;AAEG;AACH;;AAEG;AACO,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAqB,SAAS,CAAC,CAAC;AAC5D;;AAEG;AACK,QAAA,IAAA,CAAA,MAAM,GAAG,SAAS,CAAgC,QAAQ,CAAC,CAAC;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A;;;ACRD;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-components-qrcode.mjs","sources":["../../../../libs/components/qrcode/src/lib/qrcode.class.ts","../../../../libs/components/qrcode/src/lib/qrcode.component.ts","../../../../libs/components/qrcode/src/lib/qrcode.component.html","../../../../libs/components/qrcode/src/lib/qrcode.module.ts","../../../../libs/components/qrcode/src/acorex-components-qrcode.ts"],"sourcesContent":["export type AXQrcodeOutputType = 'canvas' | 'svg' | 'url';\nexport type AXQrcodeLevel = 'L' | 'M' | 'Q' | 'H';\n\nexport function debounce(func: (...args: any) => void, delayMS: number) {\n let timeoutId;\n\n return function (...args) {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(() => {\n func(...args);\n }, delayMS);\n };\n}\n","import { generateQRCode } from '@acorex/cdk/qrcode';\nimport { AXValuableComponent } from '@acorex/components/common';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n effect,\n ElementRef,\n forwardRef,\n input,\n signal,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { AXQrcodeLevel, AXQrcodeOutputType } from './qrcode.class';\n\n@Component({\n selector: 'ax-qrcode',\n templateUrl: './qrcode.component.html',\n styleUrls: ['./qrcode.component.scss'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n { provide: AXValuableComponent, useExisting: AXQrcodeComponent },\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AXQrcodeComponent),\n multi: true,\n },\n ],\n})\nexport class AXQrcodeComponent implements AfterViewInit {\n /**\n * @description Value of QR code\n */\n content = input.required<string>();\n /**\n * @description Size of the QR code\n * @default 256\n */\n size = input(256);\n /**\n * @description Error correction level can be 'L' | 'M' | 'Q' | 'H'\n * @default 'M'\n */\n level = input<AXQrcodeLevel>('M');\n /**\n * @description QR code color, can be a hex code or CSS color name\n * @default '#000000'\n */\n color = input('#000000');\n /**\n * @description QR code Background color, can be a hex code or CSS color name\n * @default '#FFFFFF'\n */\n backgroundColor = input('#FFFFFF');\n /**\n * @description Type of output can be 'canvas' | 'svg' | 'url'\n * @default 'canvas'\n */\n outputType = input<AXQrcodeOutputType>('canvas'); //\n /**\n * @ignore\n */\n /**\n * @description // Holds base64 or URL if outputType is 'url' or 'base64'\n */\n protected qrCodeUrl = signal<string | undefined>(undefined);\n /**\n * @ignore\n */\n private canvas = viewChild<ElementRef<HTMLCanvasElement>>('canvas');\n /**\n * @ignore\n */\n private svg = viewChild<ElementRef<HTMLCanvasElement>>('svg');\n\n constructor() {\n effect(\n () => {\n this.generate();\n },\n {\n allowSignalWrites: true,\n },\n );\n }\n\n ngAfterViewInit() {\n this.generate();\n }\n generate() {\n generateQRCode(\n this.content(),\n this.size(),\n this.level(),\n this.color(),\n this.backgroundColor(),\n this.outputType(),\n this.canvas()?.nativeElement,\n this.svg()?.nativeElement,\n )\n .then((result) => {\n if (this.outputType() === 'url') {\n this.qrCodeUrl.set(result as string);\n }\n })\n .catch((error) => {\n console.error(error);\n });\n }\n}\n","<div class=\"qrcode\">\n @if (outputType() === 'canvas') {\n <canvas #canvas></canvas>\n } @else if (outputType() === 'svg') {\n <div #svg></div>\n } @else {\n <img [src]=\"qrCodeUrl()\" alt=\"QR Code\" />\n }\n <div class=\"logo-container\">\n <ng-content select=\"img\"></ng-content>\n </div>\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXQrcodeComponent } from './qrcode.component';\n\n@NgModule({\n declarations: [AXQrcodeComponent],\n imports: [CommonModule],\n exports: [AXQrcodeComponent],\n})\nexport class AXQrcodeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAGgB,SAAA,QAAQ,CAAC,IAA4B,EAAE,OAAe,EAAA;AACpE,IAAA,IAAI,SAAS,CAAC;IAEd,OAAO,UAAU,GAAG,IAAI,EAAA;QAC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