@acorex/components 22.2.10 → 22.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/emoji/README.md +3 -0
- package/emojipicker/README.md +3 -0
- package/fesm2022/acorex-components-bubble.mjs +71 -0
- package/fesm2022/acorex-components-bubble.mjs.map +1 -0
- package/fesm2022/acorex-components-combo-box.mjs +71 -18
- package/fesm2022/acorex-components-combo-box.mjs.map +1 -1
- package/fesm2022/{acorex-components-conversation-acorex-components-conversation-CXf00kvo.mjs → acorex-components-conversation-acorex-components-conversation-DDkiZfPb.mjs} +831 -254
- package/fesm2022/acorex-components-conversation-acorex-components-conversation-DDkiZfPb.mjs.map +1 -0
- package/fesm2022/{acorex-components-conversation-picker-rename-file-dialog.component-DZINTie8.mjs → acorex-components-conversation-picker-rename-file-dialog.component-CH3Q6Hry.mjs} +2 -2
- package/fesm2022/{acorex-components-conversation-picker-rename-file-dialog.component-DZINTie8.mjs.map → acorex-components-conversation-picker-rename-file-dialog.component-CH3Q6Hry.mjs.map} +1 -1
- package/fesm2022/acorex-components-conversation.mjs +1 -1
- package/fesm2022/acorex-components-data-table.mjs +14 -10
- package/fesm2022/acorex-components-data-table.mjs.map +1 -1
- package/fesm2022/acorex-components-emoji.mjs +74 -0
- package/fesm2022/acorex-components-emoji.mjs.map +1 -0
- package/fesm2022/acorex-components-emojipicker.mjs +425 -0
- package/fesm2022/acorex-components-emojipicker.mjs.map +1 -0
- package/fesm2022/acorex-components-file-viewer.mjs +46 -22
- package/fesm2022/acorex-components-file-viewer.mjs.map +1 -1
- package/fesm2022/acorex-components-inline-reaction.mjs +111 -0
- package/fesm2022/acorex-components-inline-reaction.mjs.map +1 -0
- package/fesm2022/acorex-components-map.mjs +7 -0
- package/fesm2022/acorex-components-map.mjs.map +1 -1
- package/fesm2022/acorex-components-message-status.mjs +71 -0
- package/fesm2022/acorex-components-message-status.mjs.map +1 -0
- package/fesm2022/acorex-components-message-time.mjs +36 -0
- package/fesm2022/acorex-components-message-time.mjs.map +1 -0
- package/fesm2022/acorex-components-message.mjs +120 -0
- package/fesm2022/acorex-components-message.mjs.map +1 -0
- package/fesm2022/acorex-components-reaction.mjs +144 -0
- package/fesm2022/acorex-components-reaction.mjs.map +1 -0
- package/fesm2022/acorex-components-tabs.mjs +2 -2
- package/fesm2022/acorex-components-tabs.mjs.map +1 -1
- package/inline-reaction/README.md +3 -0
- package/message/README.md +3 -0
- package/message-status/README.md +3 -0
- package/message-time/README.md +3 -0
- package/package.json +35 -3
- package/reaction/README.md +3 -0
- package/types/acorex-components-bubble.d.ts +31 -0
- package/types/acorex-components-combo-box.d.ts +2 -2
- package/types/acorex-components-conversation.d.ts +126 -13
- package/types/acorex-components-data-table.d.ts +1 -1
- package/types/acorex-components-emoji.d.ts +42 -0
- package/types/acorex-components-emojipicker.d.ts +146 -0
- package/types/acorex-components-file-viewer.d.ts +5 -0
- package/types/acorex-components-inline-reaction.d.ts +52 -0
- package/types/acorex-components-map.d.ts +5 -0
- package/types/acorex-components-message-status.d.ts +23 -0
- package/types/acorex-components-message-time.d.ts +19 -0
- package/types/acorex-components-message.d.ts +59 -0
- package/types/acorex-components-reaction.d.ts +85 -0
- package/fesm2022/acorex-components-conversation-acorex-components-conversation-CXf00kvo.mjs.map +0 -1
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { AXComponent } from '@acorex/cdk/common';
|
|
2
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { inject, ElementRef, DOCUMENT, PLATFORM_ID, input, signal, output, computed, effect, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule } from '@angular/core';
|
|
5
|
+
import { AXEmojiComponent } from '@acorex/components/emoji';
|
|
6
|
+
|
|
7
|
+
class AXInlineReactionComponent {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.elementRef = inject((ElementRef));
|
|
10
|
+
this.document = inject(DOCUMENT);
|
|
11
|
+
this.platformId = inject(PLATFORM_ID);
|
|
12
|
+
this.emojis = input([], /* @ts-ignore */
|
|
13
|
+
...(ngDevMode ? [{ debugName: "emojis" }] : /* istanbul ignore next */ []));
|
|
14
|
+
this.size = input(24, /* @ts-ignore */
|
|
15
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
16
|
+
/** Whether the reaction bar is expanded to show all emojis. */
|
|
17
|
+
this.expanded = signal(false, /* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
19
|
+
/**
|
|
20
|
+
* Maximum number of emojis to display in the bar.
|
|
21
|
+
*
|
|
22
|
+
* @defaultValue 8
|
|
23
|
+
*/
|
|
24
|
+
this.maxVisible = input(8, /* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [{ debugName: "maxVisible" }] : /* istanbul ignore next */ []));
|
|
26
|
+
/**
|
|
27
|
+
* When true, hides the expand button and always shows the collapsed bar only.
|
|
28
|
+
*
|
|
29
|
+
* @defaultValue false
|
|
30
|
+
*/
|
|
31
|
+
this.showExpanded = input(false, /* @ts-ignore */
|
|
32
|
+
...(ngDevMode ? [{ debugName: "showExpanded" }] : /* istanbul ignore next */ []));
|
|
33
|
+
/**
|
|
34
|
+
* When true, collapses the bar when the user clicks outside the component.
|
|
35
|
+
*
|
|
36
|
+
* @defaultValue true
|
|
37
|
+
*/
|
|
38
|
+
this.closeOnClickOutside = input(true, /* @ts-ignore */
|
|
39
|
+
...(ngDevMode ? [{ debugName: "closeOnClickOutside" }] : /* istanbul ignore next */ []));
|
|
40
|
+
/**
|
|
41
|
+
* Emits when the user clicks a quick reaction.
|
|
42
|
+
*/
|
|
43
|
+
this.selected = output();
|
|
44
|
+
/**
|
|
45
|
+
* Emits when the expanded state changes (expand button or click outside).
|
|
46
|
+
*/
|
|
47
|
+
this.expandedChange = output();
|
|
48
|
+
this.visibleEmojis = computed(() => {
|
|
49
|
+
if (this.expanded()) {
|
|
50
|
+
return this.emojis();
|
|
51
|
+
}
|
|
52
|
+
return this.emojis().slice(0, this.maxVisible());
|
|
53
|
+
}, /* @ts-ignore */
|
|
54
|
+
...(ngDevMode ? [{ debugName: "visibleEmojis" }] : /* istanbul ignore next */ []));
|
|
55
|
+
effect((onCleanup) => {
|
|
56
|
+
if (!isPlatformBrowser(this.platformId) || !this.closeOnClickOutside() || !this.expanded()) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const onDocumentClick = (event) => {
|
|
60
|
+
if (this.elementRef.nativeElement.contains(event.target)) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
this.setExpanded(false);
|
|
64
|
+
};
|
|
65
|
+
const timeoutId = globalThis.setTimeout(() => {
|
|
66
|
+
this.document.addEventListener('click', onDocumentClick, true);
|
|
67
|
+
}, 0);
|
|
68
|
+
onCleanup(() => {
|
|
69
|
+
globalThis.clearTimeout(timeoutId);
|
|
70
|
+
this.document.removeEventListener('click', onDocumentClick, true);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
toggleExpanded(event) {
|
|
75
|
+
event.stopPropagation();
|
|
76
|
+
this.setExpanded(!this.expanded());
|
|
77
|
+
}
|
|
78
|
+
setExpanded(value) {
|
|
79
|
+
if (this.expanded() === value) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
this.expanded.set(value);
|
|
83
|
+
this.expandedChange.emit(value);
|
|
84
|
+
}
|
|
85
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXInlineReactionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
86
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXInlineReactionComponent, isStandalone: true, selector: "ax-inline-reaction", inputs: { emojis: { classPropertyName: "emojis", publicName: "emojis", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, maxVisible: { classPropertyName: "maxVisible", publicName: "maxVisible", isSignal: true, isRequired: false, transformFunction: null }, showExpanded: { classPropertyName: "showExpanded", publicName: "showExpanded", isSignal: true, isRequired: false, transformFunction: null }, closeOnClickOutside: { classPropertyName: "closeOnClickOutside", publicName: "closeOnClickOutside", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selected", expandedChange: "expandedChange" }, providers: [{ provide: AXComponent, useExisting: AXInlineReactionComponent }], ngImport: i0, template: "<div\n class=\"ax-inline-reaction\"\n [class.ax-inline-reaction-expanded]=\"expanded()\"\n [style.--ax-comp-inline-reaction-item-size.px]=\"size()\"\n [style.--ax-comp-inline-reaction-max-visible]=\"maxVisible()\"\n>\n <div class=\"ax-inline-reaction-items\">\n @for (emoji of visibleEmojis(); track emoji.code) {\n <button type=\"button\" class=\"ax-inline-reaction-item\" [attr.aria-label]=\"emoji.name\" [title]=\"emoji.name\">\n <ax-emoji [emoji]=\"emoji\" [size]=\"size()\" />\n </button>\n }\n </div>\n\n @if (!showExpanded()) {\n <button\n type=\"button\"\n class=\"ax-inline-reaction-expand\"\n [class.ax-inline-reaction-expand-open]=\"expanded()\"\n (click)=\"toggleExpanded($event)\"\n >\n <i class=\"fa-solid\" [class.fa-chevron-down]=\"!expanded()\" [class.fa-chevron-up]=\"expanded()\"></i>\n </button>\n }\n</div>\n", styles: ["@layer properties;@layer components{ax-inline-reaction{--ax-comp-inline-reaction-gap: .375rem;--ax-comp-inline-reaction-padding-x: .5rem;--ax-comp-inline-reaction-padding-y: .375rem;--ax-comp-inline-reaction-radius: 9999px;--ax-comp-inline-reaction-bg: var(--color-lightest);--ax-comp-inline-reaction-border: var(--color-border-surface);--ax-comp-inline-reaction-item-size: 1.5rem;--ax-comp-inline-reaction-collapsed-height: 2.5rem;--ax-comp-inline-reaction-max-height: 10rem;--ax-comp-inline-reaction-item-hover-bg: var(--color-lightest);--ax-comp-inline-reaction-expand-size: 1.5rem;--ax-comp-inline-reaction-expand-bg: var(--color-surface);--ax-comp-inline-reaction-expand-color: var(--color-on-lightest);--ax-comp-inline-reaction-expand-hover-bg: var(--color-light);--ax-comp-inline-reaction-expand-open-bg: color-mix(in srgb, rgba(var(--ax-sys-color-primary-surface)) 18%, rgba(var(--ax-sys-color-surface)));--ax-comp-inline-reaction-expand-open-color: var(--color-primary);display:inline-flex}@supports (color: color-mix(in lab,red,red)){ax-inline-reaction{--ax-comp-inline-reaction-expand-open-bg: color-mix(in oklab, var(--color-primary) 18%, var(--color-surface))}}ax-inline-reaction .ax-inline-reaction{display:flex;flex-direction:row;align-items:center;gap:var(--ax-comp-inline-reaction-gap);padding:var(--ax-comp-inline-reaction-padding-y) var(--ax-comp-inline-reaction-padding-x);border:1px solid var(--ax-comp-inline-reaction-border);border-radius:var(--ax-comp-inline-reaction-radius);background-color:var(--ax-comp-inline-reaction-bg);overflow:hidden;max-height:var(--ax-comp-inline-reaction-collapsed-height);transition:max-height .3s cubic-bezier(.4,0,.2,1),border-radius .3s cubic-bezier(.4,0,.2,1)}ax-inline-reaction .ax-inline-reaction-items{display:flex;flex-direction:row;align-items:center;flex-wrap:nowrap;gap:var(--ax-comp-inline-reaction-gap);transition:grid-template-columns .3s ease,transform .2s ease}ax-inline-reaction .ax-inline-reaction-expanded{max-height:var(--ax-comp-inline-reaction-max-height);border-radius:1rem}ax-inline-reaction .ax-inline-reaction-expanded .ax-inline-reaction-items{display:grid;grid-template-columns:repeat(var(--ax-comp-inline-reaction-max-visible, 8),var(--ax-comp-inline-reaction-item-size));gap:var(--ax-comp-inline-reaction-gap);align-content:start;justify-content:start}ax-inline-reaction .ax-inline-reaction-item{display:inline-flex;flex-shrink:0;cursor:pointer;align-items:center;justify-content:center;border-radius:calc(infinity * 1px);border-style:var(--tw-border-style);border-width:0px;background-color:transparent;padding:calc(var(--spacing, .25rem) * 0);width:var(--ax-comp-inline-reaction-item-size);height:var(--ax-comp-inline-reaction-item-size);line-height:0;animation:ax-inline-reaction-item-enter .2s ease}ax-inline-reaction .ax-inline-reaction-item ax-emoji{pointer-events:none}ax-inline-reaction .ax-inline-reaction-item:hover{background-color:var(--ax-comp-inline-reaction-item-hover-bg)}ax-inline-reaction .ax-inline-reaction-item:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}ax-inline-reaction .ax-inline-reaction-expand{display:inline-flex;flex-shrink:0;cursor:pointer;align-items:center;justify-content:center;border-radius:calc(infinity * 1px);border-style:var(--tw-border-style);border-width:0px;width:var(--ax-comp-inline-reaction-expand-size);height:var(--ax-comp-inline-reaction-expand-size);margin-inline-start:.125rem;background-color:var(--ax-comp-inline-reaction-expand-bg);color:var(--ax-comp-inline-reaction-expand-color)}ax-inline-reaction .ax-inline-reaction-expand i{font-size:.625rem;line-height:1}ax-inline-reaction .ax-inline-reaction-expand:hover{background-color:var(--ax-comp-inline-reaction-expand-hover-bg)}ax-inline-reaction .ax-inline-reaction-expand:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}ax-inline-reaction .ax-inline-reaction-expand-open{background-color:var(--ax-comp-inline-reaction-expand-open-bg);color:var(--ax-comp-inline-reaction-expand-open-color)}@keyframes ax-inline-reaction-item-enter{0%{opacity:0;transform:scale(.85)}to{opacity:1;transform:scale(1)}}}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@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}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: AXEmojiComponent, selector: "ax-emoji", inputs: ["emoji", "appearance", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
87
|
+
}
|
|
88
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXInlineReactionComponent, decorators: [{
|
|
89
|
+
type: Component,
|
|
90
|
+
args: [{ selector: 'ax-inline-reaction', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [AXEmojiComponent], providers: [{ provide: AXComponent, useExisting: AXInlineReactionComponent }], template: "<div\n class=\"ax-inline-reaction\"\n [class.ax-inline-reaction-expanded]=\"expanded()\"\n [style.--ax-comp-inline-reaction-item-size.px]=\"size()\"\n [style.--ax-comp-inline-reaction-max-visible]=\"maxVisible()\"\n>\n <div class=\"ax-inline-reaction-items\">\n @for (emoji of visibleEmojis(); track emoji.code) {\n <button type=\"button\" class=\"ax-inline-reaction-item\" [attr.aria-label]=\"emoji.name\" [title]=\"emoji.name\">\n <ax-emoji [emoji]=\"emoji\" [size]=\"size()\" />\n </button>\n }\n </div>\n\n @if (!showExpanded()) {\n <button\n type=\"button\"\n class=\"ax-inline-reaction-expand\"\n [class.ax-inline-reaction-expand-open]=\"expanded()\"\n (click)=\"toggleExpanded($event)\"\n >\n <i class=\"fa-solid\" [class.fa-chevron-down]=\"!expanded()\" [class.fa-chevron-up]=\"expanded()\"></i>\n </button>\n }\n</div>\n", styles: ["@layer properties;@layer components{ax-inline-reaction{--ax-comp-inline-reaction-gap: .375rem;--ax-comp-inline-reaction-padding-x: .5rem;--ax-comp-inline-reaction-padding-y: .375rem;--ax-comp-inline-reaction-radius: 9999px;--ax-comp-inline-reaction-bg: var(--color-lightest);--ax-comp-inline-reaction-border: var(--color-border-surface);--ax-comp-inline-reaction-item-size: 1.5rem;--ax-comp-inline-reaction-collapsed-height: 2.5rem;--ax-comp-inline-reaction-max-height: 10rem;--ax-comp-inline-reaction-item-hover-bg: var(--color-lightest);--ax-comp-inline-reaction-expand-size: 1.5rem;--ax-comp-inline-reaction-expand-bg: var(--color-surface);--ax-comp-inline-reaction-expand-color: var(--color-on-lightest);--ax-comp-inline-reaction-expand-hover-bg: var(--color-light);--ax-comp-inline-reaction-expand-open-bg: color-mix(in srgb, rgba(var(--ax-sys-color-primary-surface)) 18%, rgba(var(--ax-sys-color-surface)));--ax-comp-inline-reaction-expand-open-color: var(--color-primary);display:inline-flex}@supports (color: color-mix(in lab,red,red)){ax-inline-reaction{--ax-comp-inline-reaction-expand-open-bg: color-mix(in oklab, var(--color-primary) 18%, var(--color-surface))}}ax-inline-reaction .ax-inline-reaction{display:flex;flex-direction:row;align-items:center;gap:var(--ax-comp-inline-reaction-gap);padding:var(--ax-comp-inline-reaction-padding-y) var(--ax-comp-inline-reaction-padding-x);border:1px solid var(--ax-comp-inline-reaction-border);border-radius:var(--ax-comp-inline-reaction-radius);background-color:var(--ax-comp-inline-reaction-bg);overflow:hidden;max-height:var(--ax-comp-inline-reaction-collapsed-height);transition:max-height .3s cubic-bezier(.4,0,.2,1),border-radius .3s cubic-bezier(.4,0,.2,1)}ax-inline-reaction .ax-inline-reaction-items{display:flex;flex-direction:row;align-items:center;flex-wrap:nowrap;gap:var(--ax-comp-inline-reaction-gap);transition:grid-template-columns .3s ease,transform .2s ease}ax-inline-reaction .ax-inline-reaction-expanded{max-height:var(--ax-comp-inline-reaction-max-height);border-radius:1rem}ax-inline-reaction .ax-inline-reaction-expanded .ax-inline-reaction-items{display:grid;grid-template-columns:repeat(var(--ax-comp-inline-reaction-max-visible, 8),var(--ax-comp-inline-reaction-item-size));gap:var(--ax-comp-inline-reaction-gap);align-content:start;justify-content:start}ax-inline-reaction .ax-inline-reaction-item{display:inline-flex;flex-shrink:0;cursor:pointer;align-items:center;justify-content:center;border-radius:calc(infinity * 1px);border-style:var(--tw-border-style);border-width:0px;background-color:transparent;padding:calc(var(--spacing, .25rem) * 0);width:var(--ax-comp-inline-reaction-item-size);height:var(--ax-comp-inline-reaction-item-size);line-height:0;animation:ax-inline-reaction-item-enter .2s ease}ax-inline-reaction .ax-inline-reaction-item ax-emoji{pointer-events:none}ax-inline-reaction .ax-inline-reaction-item:hover{background-color:var(--ax-comp-inline-reaction-item-hover-bg)}ax-inline-reaction .ax-inline-reaction-item:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}ax-inline-reaction .ax-inline-reaction-expand{display:inline-flex;flex-shrink:0;cursor:pointer;align-items:center;justify-content:center;border-radius:calc(infinity * 1px);border-style:var(--tw-border-style);border-width:0px;width:var(--ax-comp-inline-reaction-expand-size);height:var(--ax-comp-inline-reaction-expand-size);margin-inline-start:.125rem;background-color:var(--ax-comp-inline-reaction-expand-bg);color:var(--ax-comp-inline-reaction-expand-color)}ax-inline-reaction .ax-inline-reaction-expand i{font-size:.625rem;line-height:1}ax-inline-reaction .ax-inline-reaction-expand:hover{background-color:var(--ax-comp-inline-reaction-expand-hover-bg)}ax-inline-reaction .ax-inline-reaction-expand:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}ax-inline-reaction .ax-inline-reaction-expand-open{background-color:var(--ax-comp-inline-reaction-expand-open-bg);color:var(--ax-comp-inline-reaction-expand-open-color)}@keyframes ax-inline-reaction-item-enter{0%{opacity:0;transform:scale(.85)}to{opacity:1;transform:scale(1)}}}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@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}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"] }]
|
|
91
|
+
}], ctorParameters: () => [], propDecorators: { emojis: [{ type: i0.Input, args: [{ isSignal: true, alias: "emojis", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], maxVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxVisible", required: false }] }], showExpanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "showExpanded", required: false }] }], closeOnClickOutside: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnClickOutside", required: false }] }], selected: [{ type: i0.Output, args: ["selected"] }], expandedChange: [{ type: i0.Output, args: ["expandedChange"] }] } });
|
|
92
|
+
|
|
93
|
+
class AXInlineReactionModule {
|
|
94
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXInlineReactionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
95
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.8", ngImport: i0, type: AXInlineReactionModule, imports: [AXInlineReactionComponent], exports: [AXInlineReactionComponent] }); }
|
|
96
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXInlineReactionModule, imports: [AXInlineReactionComponent] }); }
|
|
97
|
+
}
|
|
98
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXInlineReactionModule, decorators: [{
|
|
99
|
+
type: NgModule,
|
|
100
|
+
args: [{
|
|
101
|
+
imports: [AXInlineReactionComponent],
|
|
102
|
+
exports: [AXInlineReactionComponent],
|
|
103
|
+
}]
|
|
104
|
+
}] });
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Generated bundle index. Do not edit.
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
export { AXInlineReactionComponent, AXInlineReactionModule };
|
|
111
|
+
//# sourceMappingURL=acorex-components-inline-reaction.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-components-inline-reaction.mjs","sources":["../../../../packages/components/inline-reaction/src/lib/inline-reaction.component.ts","../../../../packages/components/inline-reaction/src/lib/inline-reaction.component.html","../../../../packages/components/inline-reaction/src/lib/inline-reaction.module.ts","../../../../packages/components/inline-reaction/src/acorex-components-inline-reaction.ts"],"sourcesContent":["import { AXComponent } from '@acorex/cdk/common';\nimport { AXEmoji } from '@acorex/core/constants';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n DOCUMENT,\n effect,\n ElementRef,\n inject,\n input,\n output,\n PLATFORM_ID,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport { AXEmojiComponent } from '@acorex/components/emoji';\n\n@Component({\n selector: 'ax-inline-reaction',\n templateUrl: './inline-reaction.component.html',\n styleUrls: ['./inline-reaction.component.css'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AXEmojiComponent],\n providers: [{ provide: AXComponent, useExisting: AXInlineReactionComponent }],\n})\nexport class AXInlineReactionComponent {\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly document = inject(DOCUMENT);\n private readonly platformId = inject(PLATFORM_ID);\n\n readonly emojis = input<readonly AXEmoji[]>([]);\n\n readonly size = input(24);\n\n /** Whether the reaction bar is expanded to show all emojis. */\n readonly expanded = signal(false);\n\n /**\n * Maximum number of emojis to display in the bar.\n *\n * @defaultValue 8\n */\n readonly maxVisible = input(8);\n\n /**\n * When true, hides the expand button and always shows the collapsed bar only.\n *\n * @defaultValue false\n */\n readonly showExpanded = input(false);\n\n /**\n * When true, collapses the bar when the user clicks outside the component.\n *\n * @defaultValue true\n */\n readonly closeOnClickOutside = input(true);\n\n /**\n * Emits when the user clicks a quick reaction.\n */\n readonly selected = output<AXEmoji>();\n\n /**\n * Emits when the expanded state changes (expand button or click outside).\n */\n readonly expandedChange = output<boolean>();\n\n protected readonly visibleEmojis = computed(() => {\n if (this.expanded()) {\n return this.emojis();\n }\n\n return this.emojis().slice(0, this.maxVisible());\n });\n\n constructor() {\n effect((onCleanup) => {\n if (!isPlatformBrowser(this.platformId) || !this.closeOnClickOutside() || !this.expanded()) {\n return;\n }\n\n const onDocumentClick = (event: MouseEvent): void => {\n if (this.elementRef.nativeElement.contains(event.target as Node)) {\n return;\n }\n\n this.setExpanded(false);\n };\n\n const timeoutId = globalThis.setTimeout(() => {\n this.document.addEventListener('click', onDocumentClick, true);\n }, 0);\n\n onCleanup(() => {\n globalThis.clearTimeout(timeoutId);\n this.document.removeEventListener('click', onDocumentClick, true);\n });\n });\n }\n\n protected toggleExpanded(event: Event): void {\n event.stopPropagation();\n this.setExpanded(!this.expanded());\n }\n\n private setExpanded(value: boolean): void {\n if (this.expanded() === value) {\n return;\n }\n\n this.expanded.set(value);\n this.expandedChange.emit(value);\n }\n}\n","<div\n class=\"ax-inline-reaction\"\n [class.ax-inline-reaction-expanded]=\"expanded()\"\n [style.--ax-comp-inline-reaction-item-size.px]=\"size()\"\n [style.--ax-comp-inline-reaction-max-visible]=\"maxVisible()\"\n>\n <div class=\"ax-inline-reaction-items\">\n @for (emoji of visibleEmojis(); track emoji.code) {\n <button type=\"button\" class=\"ax-inline-reaction-item\" [attr.aria-label]=\"emoji.name\" [title]=\"emoji.name\">\n <ax-emoji [emoji]=\"emoji\" [size]=\"size()\" />\n </button>\n }\n </div>\n\n @if (!showExpanded()) {\n <button\n type=\"button\"\n class=\"ax-inline-reaction-expand\"\n [class.ax-inline-reaction-expand-open]=\"expanded()\"\n (click)=\"toggleExpanded($event)\"\n >\n <i class=\"fa-solid\" [class.fa-chevron-down]=\"!expanded()\" [class.fa-chevron-up]=\"expanded()\"></i>\n </button>\n }\n</div>\n","import { NgModule } from '@angular/core';\nimport { AXInlineReactionComponent } from './inline-reaction.component';\n\n@NgModule({\n imports: [AXInlineReactionComponent],\n exports: [AXInlineReactionComponent],\n})\nexport class AXInlineReactionModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MA4Ba,yBAAyB,CAAA;AAmDpC,IAAA,WAAA,GAAA;AAlDiB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,EAAC,UAAuB,EAAC;AAC5C,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;QAExC,IAAA,CAAA,MAAM,GAAG,KAAK,CAAqB,EAAE;mFAAC;QAEtC,IAAA,CAAA,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,o5IAAA,CAAA,EAAA;;;MEnBlE,sBAAsB,CAAA;8GAAtB,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAtB,sBAAsB,EAAA,OAAA,EAAA,CAHvB,yBAAyB,CAAA,EAAA,OAAA,EAAA,CACzB,yBAAyB,CAAA,EAAA,CAAA,CAAA;AAExB,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,sBAAsB,YAHvB,yBAAyB,CAAA,EAAA,CAAA,CAAA;;2FAGxB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAJlC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,yBAAyB,CAAC;oBACpC,OAAO,EAAE,CAAC,yBAAyB,CAAC;AACrC,iBAAA;;;ACND;;AAEG;;;;"}
|
|
@@ -3255,6 +3255,13 @@ class AXMapComponent extends NXComponent {
|
|
|
3255
3255
|
async refreshPois() {
|
|
3256
3256
|
return this.leafletService.refreshPois();
|
|
3257
3257
|
}
|
|
3258
|
+
/**
|
|
3259
|
+
* Recalculates Leaflet tile layout after the map container is resized
|
|
3260
|
+
* (for example after entering or exiting fullscreen).
|
|
3261
|
+
*/
|
|
3262
|
+
invalidateSize() {
|
|
3263
|
+
this.leafletService.getMap()?.invalidateSize();
|
|
3264
|
+
}
|
|
3258
3265
|
/**
|
|
3259
3266
|
* Cleanup function that destroys the map and unsubscribes from all subscriptions.
|
|
3260
3267
|
*/
|