@thalassic/ui 22.14.3 → 22.15.0
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/fesm2022/thalassic-ui-rich-text-editor.mjs +650 -0
- package/fesm2022/thalassic-ui-rich-text-editor.mjs.map +1 -0
- package/fesm2022/thalassic-ui.mjs +1088 -533
- package/fesm2022/thalassic-ui.mjs.map +1 -1
- package/package.json +46 -2
- package/types/thalassic-ui-rich-text-editor.d.ts +141 -0
- package/types/thalassic-ui.d.ts +299 -27
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, model, input, signal, computed, booleanAttribute, Directive, ViewContainerRef, DestroyRef, viewChild, contentChild,
|
|
2
|
+
import { InjectionToken, inject, model, input, signal, computed, booleanAttribute, Directive, ViewContainerRef, DestroyRef, viewChild, contentChild, PLATFORM_ID, Injectable, Component, Renderer2, ElementRef, numberAttribute, output, makeEnvironmentProviders, TemplateRef, forwardRef, effect, afterNextRender, linkedSignal, viewChildren, contentChildren, isDevMode, untracked, provideEnvironmentInitializer, DOCUMENT } from '@angular/core';
|
|
3
3
|
import { Overlay } from '@angular/cdk/overlay';
|
|
4
4
|
import { TemplatePortal, ComponentPortal, CdkPortalOutlet } from '@angular/cdk/portal';
|
|
5
5
|
import { takeUntilDestroyed, rxResource, toSignal, toObservable } from '@angular/core/rxjs-interop';
|
|
6
6
|
import { filter, throwError, map, shareReplay, of, Subscription, takeUntil } from 'rxjs';
|
|
7
7
|
import { Router, ActivatedRoute, RouterLink, NavigationStart, RouterLinkActive } from '@angular/router';
|
|
8
|
-
import {
|
|
8
|
+
import { Grid, GridRow, GridCell } from '@angular/aria/grid';
|
|
9
|
+
import { startOfWeek, startOfMonth, endOfWeek, endOfMonth, addDays, eachDayOfInterval, startOfDay, isSameMonth, format, isSameDay, subMonths, isBefore, isAfter, differenceInCalendarDays, addHours, differenceInMinutes, isSameWeek, addMonths, addWeeks, isToday, setMonth, subYears, addYears, getYear, getMonth, getHours, getMinutes, setHours, setMinutes, setYear } from 'date-fns';
|
|
10
|
+
import { isPlatformBrowser, NgTemplateOutlet, NgComponentOutlet, LocationStrategy } from '@angular/common';
|
|
9
11
|
import { HttpClient } from '@angular/common/http';
|
|
10
12
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
11
|
-
import { startOfWeek, startOfMonth, endOfWeek, endOfMonth, addDays, eachDayOfInterval, format, startOfDay, isBefore, isAfter, isSameDay, differenceInCalendarDays, isSameMonth, addHours, differenceInMinutes, isSameWeek, addMonths, addWeeks, subMonths, isToday, setMonth, subYears, addYears, getYear, getMonth, getHours, getMinutes, setHours, setMinutes, setYear } from 'date-fns';
|
|
12
|
-
import { Grid, GridRow, GridCell } from '@angular/aria/grid';
|
|
13
13
|
import { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';
|
|
14
14
|
import { filter as filter$1 } from 'rxjs/operators';
|
|
15
15
|
import { CdkDialogContainer, DialogRef, Dialog as Dialog$1 } from '@angular/cdk/dialog';
|
|
@@ -719,76 +719,1050 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
719
719
|
type: Directive
|
|
720
720
|
}] });
|
|
721
721
|
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
722
|
+
/**
|
|
723
|
+
* Adds `id` to `element`'s `aria-describedby`, preserving any description the consumer already
|
|
724
|
+
* put there. The attribute is a token list, so an overlay describing an element joins that list
|
|
725
|
+
* rather than replacing it.
|
|
726
|
+
*/
|
|
727
|
+
const addDescribedBy = (renderer, element, id) => {
|
|
728
|
+
const existing = element.getAttribute('aria-describedby');
|
|
729
|
+
const tokens = existing ? existing.split(' ').filter(Boolean) : [];
|
|
730
|
+
if (tokens.includes(id))
|
|
731
|
+
return;
|
|
732
|
+
tokens.push(id);
|
|
733
|
+
renderer.setAttribute(element, 'aria-describedby', tokens.join(' '));
|
|
734
|
+
};
|
|
735
|
+
|
|
736
|
+
const DAYS_IN_WEEK = 7;
|
|
737
|
+
/**
|
|
738
|
+
* Every day shown in a month grid for the month containing `anchor`, starting at the
|
|
739
|
+
* first day of the first week (per `weekStartsOn`).
|
|
740
|
+
*
|
|
741
|
+
* With `weeks` omitted the span is the natural 5–6 weeks that cover the month. Passing a
|
|
742
|
+
* fixed `weeks` count returns exactly that many weeks, so the grid height never reflows
|
|
743
|
+
* between months.
|
|
744
|
+
*/
|
|
745
|
+
const buildMonthDays = (anchor, weekStartsOn, weeks) => {
|
|
746
|
+
const start = startOfWeek(startOfMonth(anchor), { weekStartsOn });
|
|
747
|
+
const end = weeks === undefined
|
|
748
|
+
? endOfWeek(endOfMonth(anchor), { weekStartsOn })
|
|
749
|
+
: addDays(start, weeks * DAYS_IN_WEEK - 1);
|
|
750
|
+
return eachDayOfInterval({ start, end });
|
|
751
|
+
};
|
|
752
|
+
|
|
753
|
+
const OVERLAY_POSITION_MAP = {
|
|
754
|
+
top: {
|
|
755
|
+
originX: 'center',
|
|
756
|
+
originY: 'top',
|
|
757
|
+
overlayX: 'center',
|
|
758
|
+
overlayY: 'bottom',
|
|
759
|
+
offsetX: 0,
|
|
760
|
+
offsetY: -1,
|
|
761
|
+
},
|
|
762
|
+
right: {
|
|
763
|
+
originX: 'end',
|
|
764
|
+
originY: 'center',
|
|
765
|
+
overlayX: 'start',
|
|
766
|
+
overlayY: 'center',
|
|
767
|
+
offsetX: 1,
|
|
768
|
+
offsetY: 0,
|
|
769
|
+
},
|
|
770
|
+
bottom: {
|
|
771
|
+
originX: 'center',
|
|
772
|
+
originY: 'bottom',
|
|
773
|
+
overlayX: 'center',
|
|
774
|
+
overlayY: 'top',
|
|
775
|
+
offsetX: 1,
|
|
776
|
+
offsetY: 1,
|
|
777
|
+
},
|
|
778
|
+
left: {
|
|
779
|
+
originX: 'start',
|
|
780
|
+
originY: 'center',
|
|
781
|
+
overlayX: 'end',
|
|
782
|
+
overlayY: 'center',
|
|
783
|
+
offsetX: -1,
|
|
784
|
+
offsetY: 0,
|
|
785
|
+
},
|
|
786
|
+
'top-start': {
|
|
787
|
+
originX: 'start',
|
|
788
|
+
originY: 'top',
|
|
789
|
+
overlayX: 'start',
|
|
790
|
+
overlayY: 'bottom',
|
|
791
|
+
offsetX: 0,
|
|
792
|
+
offsetY: -1,
|
|
793
|
+
},
|
|
794
|
+
'top-end': {
|
|
795
|
+
originX: 'end',
|
|
796
|
+
originY: 'top',
|
|
797
|
+
overlayX: 'end',
|
|
798
|
+
overlayY: 'bottom',
|
|
799
|
+
offsetX: 0,
|
|
800
|
+
offsetY: -1,
|
|
801
|
+
},
|
|
802
|
+
'right-start': {
|
|
803
|
+
originX: 'end',
|
|
804
|
+
originY: 'top',
|
|
805
|
+
overlayX: 'start',
|
|
806
|
+
overlayY: 'top',
|
|
807
|
+
offsetX: 1,
|
|
808
|
+
offsetY: 0,
|
|
809
|
+
},
|
|
810
|
+
'right-end': {
|
|
811
|
+
originX: 'end',
|
|
812
|
+
originY: 'bottom',
|
|
813
|
+
overlayX: 'start',
|
|
814
|
+
overlayY: 'bottom',
|
|
815
|
+
offsetX: 1,
|
|
816
|
+
offsetY: 0,
|
|
817
|
+
},
|
|
818
|
+
'bottom-start': {
|
|
819
|
+
originX: 'start',
|
|
820
|
+
originY: 'bottom',
|
|
821
|
+
overlayX: 'start',
|
|
822
|
+
overlayY: 'top',
|
|
823
|
+
offsetX: 0,
|
|
824
|
+
offsetY: 1,
|
|
825
|
+
},
|
|
826
|
+
'bottom-end': {
|
|
827
|
+
originX: 'end',
|
|
828
|
+
originY: 'bottom',
|
|
829
|
+
overlayX: 'end',
|
|
830
|
+
overlayY: 'top',
|
|
831
|
+
offsetX: 0,
|
|
832
|
+
offsetY: 1,
|
|
833
|
+
},
|
|
834
|
+
'left-start': {
|
|
835
|
+
originX: 'start',
|
|
836
|
+
originY: 'top',
|
|
837
|
+
overlayX: 'end',
|
|
838
|
+
overlayY: 'top',
|
|
839
|
+
offsetX: -1,
|
|
840
|
+
offsetY: 0,
|
|
841
|
+
},
|
|
842
|
+
'left-end': {
|
|
843
|
+
originX: 'start',
|
|
844
|
+
originY: 'bottom',
|
|
845
|
+
overlayX: 'end',
|
|
846
|
+
overlayY: 'bottom',
|
|
847
|
+
offsetX: -1,
|
|
848
|
+
offsetY: 0,
|
|
849
|
+
},
|
|
850
|
+
'top-left': {
|
|
851
|
+
originX: 'start',
|
|
852
|
+
originY: 'top',
|
|
853
|
+
overlayX: 'end',
|
|
854
|
+
overlayY: 'bottom',
|
|
855
|
+
offsetX: -1,
|
|
856
|
+
offsetY: -1,
|
|
857
|
+
},
|
|
858
|
+
'top-right': {
|
|
859
|
+
originX: 'end',
|
|
860
|
+
originY: 'top',
|
|
861
|
+
overlayX: 'start',
|
|
862
|
+
overlayY: 'bottom',
|
|
863
|
+
offsetX: 1,
|
|
864
|
+
offsetY: -1,
|
|
865
|
+
},
|
|
866
|
+
'bottom-left': {
|
|
867
|
+
originX: 'start',
|
|
868
|
+
originY: 'bottom',
|
|
869
|
+
overlayX: 'end',
|
|
870
|
+
overlayY: 'top',
|
|
871
|
+
offsetX: -1,
|
|
872
|
+
offsetY: 1,
|
|
873
|
+
},
|
|
874
|
+
'bottom-right': {
|
|
875
|
+
originX: 'end',
|
|
876
|
+
originY: 'bottom',
|
|
877
|
+
overlayX: 'start',
|
|
878
|
+
overlayY: 'top',
|
|
879
|
+
offsetX: 1,
|
|
880
|
+
offsetY: 1,
|
|
732
881
|
},
|
|
733
|
-
hideLabel: false,
|
|
734
882
|
};
|
|
735
883
|
|
|
736
|
-
const
|
|
737
|
-
|
|
738
|
-
|
|
884
|
+
const buildOverlayPositions = (position, offset) => {
|
|
885
|
+
const preferred = OVERLAY_POSITION_MAP[position];
|
|
886
|
+
const rest = Object.values(OVERLAY_POSITION_MAP).filter(p => p !== preferred);
|
|
887
|
+
const positions = [preferred, ...rest];
|
|
888
|
+
return positions.map(position => ({
|
|
889
|
+
...position,
|
|
890
|
+
offsetX: Math.sign(position.offsetX ?? 0) * offset.x,
|
|
891
|
+
offsetY: Math.sign(position.offsetY ?? 0) * offset.y,
|
|
892
|
+
}));
|
|
893
|
+
};
|
|
739
894
|
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
const className = 'tls-alert';
|
|
759
|
-
const array = [className];
|
|
760
|
-
array.push(`${className}--${this.color()}`);
|
|
761
|
-
return array;
|
|
762
|
-
}, /* @ts-ignore */
|
|
763
|
-
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
764
|
-
hostRole = computed(() => {
|
|
765
|
-
const urgent = ['danger', 'warning'];
|
|
766
|
-
return urgent.includes(this.color()) ? 'alert' : 'note';
|
|
767
|
-
}, /* @ts-ignore */
|
|
768
|
-
...(ngDevMode ? [{ debugName: "hostRole" }] : /* istanbul ignore next */ []));
|
|
769
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Alert, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
770
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Alert, isStandalone: true, selector: "tls-alert", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hideLabel: { classPropertyName: "hideLabel", publicName: "hideLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()", "attr.role": "hostRole()", "attr.aria-label": "hideLabel() ? displayLabel() : null" } }, ngImport: i0, template: "<div class=\"tls-alert-icon\"></div>\n<div class=\"tls-alert-body\">\n @if (!hideLabel()) {\n <span class=\"tls-alert-body__label\">{{ displayLabel() }}</span>\n }\n <span class=\"tls-alert-body__content\">\n <ng-content></ng-content>\n </span>\n</div>\n" });
|
|
771
|
-
}
|
|
772
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Alert, decorators: [{
|
|
773
|
-
type: Component,
|
|
774
|
-
args: [{ selector: 'tls-alert', imports: [], host: {
|
|
775
|
-
'[class]': 'hostClasses()',
|
|
776
|
-
'[attr.role]': 'hostRole()',
|
|
777
|
-
'[attr.aria-label]': 'hideLabel() ? displayLabel() : null',
|
|
778
|
-
}, template: "<div class=\"tls-alert-icon\"></div>\n<div class=\"tls-alert-body\">\n @if (!hideLabel()) {\n <span class=\"tls-alert-body__label\">{{ displayLabel() }}</span>\n }\n <span class=\"tls-alert-body__content\">\n <ng-content></ng-content>\n </span>\n</div>\n" }]
|
|
779
|
-
}], propDecorators: { color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hideLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideLabel", required: false }] }] } });
|
|
895
|
+
/**
|
|
896
|
+
* A signal of the current time, refreshed every `intervalMs` (browser only), so
|
|
897
|
+
* time-dependent computed's — a current-time indicator, a "today" highlight —
|
|
898
|
+
* stay correct while the view is left open instead of freezing at first render.
|
|
899
|
+
*
|
|
900
|
+
* Must be called from an injection context (a field initializer or
|
|
901
|
+
* constructor); the refresh interval is cleared when that context is destroyed.
|
|
902
|
+
* On the server the signal holds the construction time and never ticks.
|
|
903
|
+
*/
|
|
904
|
+
const createNowSignal = (intervalMs) => {
|
|
905
|
+
const now = signal(new Date(), /* @ts-ignore */
|
|
906
|
+
...(ngDevMode ? [{ debugName: "now" }] : /* istanbul ignore next */ []));
|
|
907
|
+
if (isPlatformBrowser(inject(PLATFORM_ID))) {
|
|
908
|
+
const handle = setInterval(() => now.set(new Date()), intervalMs);
|
|
909
|
+
inject(DestroyRef).onDestroy(() => clearInterval(handle));
|
|
910
|
+
}
|
|
911
|
+
return now.asReadonly();
|
|
912
|
+
};
|
|
780
913
|
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
914
|
+
/** Escapes RegExp metacharacters so the string matches literally inside a pattern. */
|
|
915
|
+
const escapeRegularExpression = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
916
|
+
|
|
917
|
+
/**
|
|
918
|
+
* Drops `id` from `element`'s `aria-describedby`, leaving the consumer's own descriptions in
|
|
919
|
+
* place and removing the attribute only once nothing is left in it.
|
|
920
|
+
*/
|
|
921
|
+
const removeDescribedBy = (renderer, element, id) => {
|
|
922
|
+
const existing = element.getAttribute('aria-describedby');
|
|
923
|
+
if (!existing)
|
|
924
|
+
return;
|
|
925
|
+
const tokens = existing.split(' ').filter(token => token && token !== id);
|
|
926
|
+
if (tokens.length === 0) {
|
|
927
|
+
renderer.removeAttribute(element, 'aria-describedby');
|
|
928
|
+
return;
|
|
929
|
+
}
|
|
930
|
+
renderer.setAttribute(element, 'aria-describedby', tokens.join(' '));
|
|
787
931
|
};
|
|
788
932
|
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
933
|
+
/** Reorders Sunday-first weekday labels so the one for `weekStartsOn` comes first. */
|
|
934
|
+
const rotateWeekDays = (weekDays, weekStartsOn) => [
|
|
935
|
+
...weekDays.slice(weekStartsOn),
|
|
936
|
+
...weekDays.slice(0, weekStartsOn),
|
|
937
|
+
];
|
|
938
|
+
|
|
939
|
+
/** Attribute a delegated tooltip reads its content from, and matches its items by. */
|
|
940
|
+
const DEFAULT_TOOLTIP_CONTENT_ATTRIBUTE = 'data-tooltip';
|
|
941
|
+
|
|
942
|
+
class TooltipService {
|
|
943
|
+
_overlay = inject(Overlay);
|
|
944
|
+
_overlayRef = null;
|
|
945
|
+
// Public methods
|
|
946
|
+
show(origin, positions, tooltipPortal) {
|
|
947
|
+
this.dispose();
|
|
948
|
+
const positionStrategy = this._overlay
|
|
949
|
+
.position()
|
|
950
|
+
.flexibleConnectedTo(origin)
|
|
951
|
+
.withPositions(positions);
|
|
952
|
+
this._overlayRef = this._overlay.create({
|
|
953
|
+
positionStrategy,
|
|
954
|
+
scrollStrategy: this._overlay.scrollStrategies.reposition(),
|
|
955
|
+
});
|
|
956
|
+
return this._overlayRef.attach(tooltipPortal);
|
|
957
|
+
}
|
|
958
|
+
move(origin, positions) {
|
|
959
|
+
if (this._overlayRef) {
|
|
960
|
+
const positionStrategy = this._overlay
|
|
961
|
+
.position()
|
|
962
|
+
.flexibleConnectedTo(origin)
|
|
963
|
+
.withPositions(positions);
|
|
964
|
+
this._overlayRef.updatePositionStrategy(positionStrategy);
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
// Detaches the tooltip so Angular's `animate.leave` plays the exit animation,
|
|
968
|
+
// then disposes the pane once that animation finishes. The pane is kept alive
|
|
969
|
+
// in the meantime so it is not torn down mid-animation.
|
|
970
|
+
hide() {
|
|
971
|
+
if (!this._overlayRef)
|
|
972
|
+
return;
|
|
973
|
+
const overlayRef = this._overlayRef;
|
|
974
|
+
this._overlayRef = null;
|
|
975
|
+
overlayRef.detach();
|
|
976
|
+
disposeAfterLeaveAnimation(overlayRef);
|
|
977
|
+
}
|
|
978
|
+
dispose() {
|
|
979
|
+
if (!this._overlayRef)
|
|
980
|
+
return;
|
|
981
|
+
this._overlayRef.dispose();
|
|
982
|
+
this._overlayRef = null;
|
|
983
|
+
}
|
|
984
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
985
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipService });
|
|
986
|
+
}
|
|
987
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipService, decorators: [{
|
|
988
|
+
type: Injectable
|
|
989
|
+
}] });
|
|
990
|
+
|
|
991
|
+
class Tooltip {
|
|
992
|
+
static _counter = 0;
|
|
993
|
+
id = `tls-tooltip-${++Tooltip._counter}`;
|
|
994
|
+
content = model.required(/* @ts-ignore */
|
|
995
|
+
...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
|
|
996
|
+
templateData = model(null, /* @ts-ignore */
|
|
997
|
+
...(ngDevMode ? [{ debugName: "templateData" }] : /* istanbul ignore next */ []));
|
|
998
|
+
color = model.required(/* @ts-ignore */
|
|
999
|
+
...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
1000
|
+
isString = computed(() => typeof this.content() === 'string', /* @ts-ignore */
|
|
1001
|
+
...(ngDevMode ? [{ debugName: "isString" }] : /* istanbul ignore next */ []));
|
|
1002
|
+
templateRef = computed(() => {
|
|
1003
|
+
if (this.isString())
|
|
1004
|
+
return null;
|
|
1005
|
+
return this.content();
|
|
1006
|
+
}, /* @ts-ignore */
|
|
1007
|
+
...(ngDevMode ? [{ debugName: "templateRef" }] : /* istanbul ignore next */ []));
|
|
1008
|
+
hostClasses = computed(() => {
|
|
1009
|
+
const className = 'tls-tooltip';
|
|
1010
|
+
const array = [className];
|
|
1011
|
+
array.push(`${className}--${this.color()}`);
|
|
1012
|
+
return array;
|
|
1013
|
+
}, /* @ts-ignore */
|
|
1014
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
1015
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Tooltip, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1016
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Tooltip, isStandalone: true, selector: "tls-tooltip", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, templateData: { classPropertyName: "templateData", publicName: "templateData", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { content: "contentChange", templateData: "templateDataChange", color: "colorChange" }, host: { attributes: { "role": "tooltip", "animate.enter": "tls-tooltip--enter", "animate.leave": "tls-tooltip--leave" }, properties: { "class": "hostClasses()", "id": "id" } }, ngImport: i0, template: `
|
|
1017
|
+
@if (isString()) {
|
|
1018
|
+
{{ content() }}
|
|
1019
|
+
} @else {
|
|
1020
|
+
<ng-container
|
|
1021
|
+
[ngTemplateOutlet]="templateRef()"
|
|
1022
|
+
[ngTemplateOutletContext]="{ $implicit: templateData() }"
|
|
1023
|
+
></ng-container>
|
|
1024
|
+
}
|
|
1025
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
1026
|
+
}
|
|
1027
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Tooltip, decorators: [{
|
|
1028
|
+
type: Component,
|
|
1029
|
+
args: [{
|
|
1030
|
+
selector: 'tls-tooltip',
|
|
1031
|
+
template: `
|
|
1032
|
+
@if (isString()) {
|
|
1033
|
+
{{ content() }}
|
|
1034
|
+
} @else {
|
|
1035
|
+
<ng-container
|
|
1036
|
+
[ngTemplateOutlet]="templateRef()"
|
|
1037
|
+
[ngTemplateOutletContext]="{ $implicit: templateData() }"
|
|
1038
|
+
></ng-container>
|
|
1039
|
+
}
|
|
1040
|
+
`,
|
|
1041
|
+
imports: [NgTemplateOutlet],
|
|
1042
|
+
host: {
|
|
1043
|
+
'[class]': 'hostClasses()',
|
|
1044
|
+
'role': 'tooltip',
|
|
1045
|
+
'[id]': 'id',
|
|
1046
|
+
'animate.enter': 'tls-tooltip--enter',
|
|
1047
|
+
'animate.leave': 'tls-tooltip--leave',
|
|
1048
|
+
},
|
|
1049
|
+
}]
|
|
1050
|
+
}], propDecorators: { content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: true }] }, { type: i0.Output, args: ["contentChange"] }], templateData: [{ type: i0.Input, args: [{ isSignal: true, alias: "templateData", required: false }] }, { type: i0.Output, args: ["templateDataChange"] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: true }] }, { type: i0.Output, args: ["colorChange"] }] } });
|
|
1051
|
+
|
|
1052
|
+
const DEFAULT_TOOLTIP_CONFIG = {
|
|
1053
|
+
positions: undefined,
|
|
1054
|
+
position: 'top',
|
|
1055
|
+
offset: { x: 4, y: 4 },
|
|
1056
|
+
origin: 'element',
|
|
1057
|
+
color: 'secondary',
|
|
1058
|
+
};
|
|
1059
|
+
|
|
1060
|
+
const TOOLTIP_CONFIG = new InjectionToken('TOOLTIP_CONFIG', {
|
|
1061
|
+
factory: () => DEFAULT_TOOLTIP_CONFIG,
|
|
1062
|
+
});
|
|
1063
|
+
|
|
1064
|
+
/**
|
|
1065
|
+
* Shared machinery behind every tooltip trigger: the appearance inputs, the overlay lifecycle,
|
|
1066
|
+
* and the `aria-describedby` link. A subclass owns only *when* a tooltip opens and *which*
|
|
1067
|
+
* element it anchors to — `[tlsTooltip]` binds its own host, `[tlsTooltipDelegate]` resolves an
|
|
1068
|
+
* item out of a delegated event — and calls `_show` / `_hide` accordingly.
|
|
1069
|
+
*
|
|
1070
|
+
* One tooltip is visible at a time per trigger; showing for a different anchor closes the
|
|
1071
|
+
* previous one first, and showing for the anchor already open is a no-op so a hovered element
|
|
1072
|
+
* receiving focus does not rebuild the overlay.
|
|
1073
|
+
*/
|
|
1074
|
+
class TooltipTrigger {
|
|
1075
|
+
// Injections
|
|
1076
|
+
_tooltipService = inject(TooltipService);
|
|
1077
|
+
_renderer = inject(Renderer2);
|
|
1078
|
+
_config = inject(TOOLTIP_CONFIG);
|
|
1079
|
+
// Inputs
|
|
1080
|
+
tooltipDisabled = input(false, /* @ts-ignore */
|
|
1081
|
+
...(ngDevMode ? [{ debugName: "tooltipDisabled" }] : /* istanbul ignore next */ []));
|
|
1082
|
+
tooltipOrigin = input(this._config.origin, /* @ts-ignore */
|
|
1083
|
+
...(ngDevMode ? [{ debugName: "tooltipOrigin" }] : /* istanbul ignore next */ []));
|
|
1084
|
+
tooltipPositions = input(this._config.positions, /* @ts-ignore */
|
|
1085
|
+
...(ngDevMode ? [{ debugName: "tooltipPositions" }] : /* istanbul ignore next */ []));
|
|
1086
|
+
tooltipPosition = input(this._config.position, /* @ts-ignore */
|
|
1087
|
+
...(ngDevMode ? [{ debugName: "tooltipPosition" }] : /* istanbul ignore next */ []));
|
|
1088
|
+
tooltipOffset = input(this._config.offset, /* @ts-ignore */
|
|
1089
|
+
...(ngDevMode ? [{ debugName: "tooltipOffset" }] : /* istanbul ignore next */ []));
|
|
1090
|
+
tooltipColor = input(this._config.color, /* @ts-ignore */
|
|
1091
|
+
...(ngDevMode ? [{ debugName: "tooltipColor" }] : /* istanbul ignore next */ []));
|
|
1092
|
+
// State
|
|
1093
|
+
/** Element the visible tooltip is anchored to, `null` while nothing is shown. */
|
|
1094
|
+
_anchor = null;
|
|
1095
|
+
/** Id of the description the visible tooltip added, so only that one is taken back. */
|
|
1096
|
+
_describedById = null;
|
|
1097
|
+
// Computed
|
|
1098
|
+
_positions = computed(() => {
|
|
1099
|
+
const positions = this.tooltipPositions();
|
|
1100
|
+
if (positions)
|
|
1101
|
+
return positions;
|
|
1102
|
+
return buildOverlayPositions(this.tooltipPosition(), this.tooltipOffset());
|
|
1103
|
+
}, /* @ts-ignore */
|
|
1104
|
+
...(ngDevMode ? [{ debugName: "_positions" }] : /* istanbul ignore next */ []));
|
|
1105
|
+
// Accessors
|
|
1106
|
+
/** Anchor of the visible tooltip, for a subclass deciding whether an event concerns it. */
|
|
1107
|
+
get anchor() {
|
|
1108
|
+
return this._anchor;
|
|
1109
|
+
}
|
|
1110
|
+
// Protected methods
|
|
1111
|
+
/** Dismisses the tooltip without moving the pointer or focus (WCAG 1.4.13). */
|
|
1112
|
+
onEscape() {
|
|
1113
|
+
this._hide();
|
|
1114
|
+
}
|
|
1115
|
+
/**
|
|
1116
|
+
* Opens the tooltip for `anchor`. `point` anchors to the cursor instead, when the origin is
|
|
1117
|
+
* configured that way and the caller has a pointer position to give.
|
|
1118
|
+
*/
|
|
1119
|
+
_show(anchor, content, data = null, point) {
|
|
1120
|
+
if (this.tooltipDisabled())
|
|
1121
|
+
return;
|
|
1122
|
+
// Re-showing for the anchor already open would rebuild the overlay for nothing.
|
|
1123
|
+
if (this._anchor === anchor)
|
|
1124
|
+
return;
|
|
1125
|
+
// Nothing to render — empty content would show a bare bubble.
|
|
1126
|
+
if (!content)
|
|
1127
|
+
return;
|
|
1128
|
+
this._hide();
|
|
1129
|
+
this._anchor = anchor;
|
|
1130
|
+
const tooltipPortal = new ComponentPortal(Tooltip);
|
|
1131
|
+
const origin = this.tooltipOrigin() === 'cursor' && point ? point : anchor;
|
|
1132
|
+
const tooltipRef = this._tooltipService.show(origin, this._positions(), tooltipPortal);
|
|
1133
|
+
tooltipRef.instance.content.set(content);
|
|
1134
|
+
tooltipRef.instance.templateData.set(data);
|
|
1135
|
+
tooltipRef.instance.color.set(this.tooltipColor());
|
|
1136
|
+
// A description identical to the accessible name would be announced twice; the tooltip is
|
|
1137
|
+
// purely visual then and the link is omitted.
|
|
1138
|
+
if (anchor.getAttribute('aria-label') === content)
|
|
1139
|
+
return;
|
|
1140
|
+
this._describedById = tooltipRef.instance.id;
|
|
1141
|
+
addDescribedBy(this._renderer, anchor, this._describedById);
|
|
1142
|
+
}
|
|
1143
|
+
_hide() {
|
|
1144
|
+
const anchor = this._anchor;
|
|
1145
|
+
if (!anchor)
|
|
1146
|
+
return;
|
|
1147
|
+
this._anchor = null;
|
|
1148
|
+
this._tooltipService.hide();
|
|
1149
|
+
this._undescribe(anchor);
|
|
1150
|
+
}
|
|
1151
|
+
// Private methods
|
|
1152
|
+
/** Takes back only the description this trigger added, leaving the consumer's own intact. */
|
|
1153
|
+
_undescribe(anchor) {
|
|
1154
|
+
const describedById = this._describedById;
|
|
1155
|
+
if (!describedById)
|
|
1156
|
+
return;
|
|
1157
|
+
this._describedById = null;
|
|
1158
|
+
removeDescribedBy(this._renderer, anchor, describedById);
|
|
1159
|
+
}
|
|
1160
|
+
// Lifecycle
|
|
1161
|
+
ngOnDestroy() {
|
|
1162
|
+
const anchor = this._anchor;
|
|
1163
|
+
if (anchor)
|
|
1164
|
+
this._undescribe(anchor);
|
|
1165
|
+
this._anchor = null;
|
|
1166
|
+
this._tooltipService.dispose();
|
|
1167
|
+
}
|
|
1168
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1169
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: TooltipTrigger, isStandalone: true, inputs: { tooltipDisabled: { classPropertyName: "tooltipDisabled", publicName: "tooltipDisabled", isSignal: true, isRequired: false, transformFunction: null }, tooltipOrigin: { classPropertyName: "tooltipOrigin", publicName: "tooltipOrigin", isSignal: true, isRequired: false, transformFunction: null }, tooltipPositions: { classPropertyName: "tooltipPositions", publicName: "tooltipPositions", isSignal: true, isRequired: false, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, tooltipOffset: { classPropertyName: "tooltipOffset", publicName: "tooltipOffset", isSignal: true, isRequired: false, transformFunction: null }, tooltipColor: { classPropertyName: "tooltipColor", publicName: "tooltipColor", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "document:keydown.escape": "onEscape()" } }, ngImport: i0 });
|
|
1170
|
+
}
|
|
1171
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipTrigger, decorators: [{
|
|
1172
|
+
type: Directive,
|
|
1173
|
+
args: [{
|
|
1174
|
+
host: {
|
|
1175
|
+
'(document:keydown.escape)': 'onEscape()',
|
|
1176
|
+
},
|
|
1177
|
+
}]
|
|
1178
|
+
}], propDecorators: { tooltipDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipDisabled", required: false }] }], tooltipOrigin: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipOrigin", required: false }] }], tooltipPositions: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPositions", required: false }] }], tooltipPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPosition", required: false }] }], tooltipOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipOffset", required: false }] }], tooltipColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipColor", required: false }] }] } });
|
|
1179
|
+
|
|
1180
|
+
/**
|
|
1181
|
+
* Serves tooltips for a whole subtree from one instance. Any descendant carrying the content
|
|
1182
|
+
* attribute (`data-tooltip` by default) gets a tooltip, without each one needing its own
|
|
1183
|
+
* `[tlsTooltip]`. Events are delegated to this host, so a grid of hundreds of cells costs one
|
|
1184
|
+
* directive, one overlay service and one set of listeners rather than one of each per cell.
|
|
1185
|
+
*
|
|
1186
|
+
* Interaction matches `[tlsTooltip]`: hover for mouse and pen, tap-to-toggle for touch, show
|
|
1187
|
+
* on keyboard focus, dismiss on Escape without moving the pointer or focus (WCAG 1.4.13), and
|
|
1188
|
+
* `aria-describedby` linking the item to the visible tooltip — joining any description the item
|
|
1189
|
+
* already carries, and omitted entirely when the item's `aria-label` already says the same thing.
|
|
1190
|
+
*
|
|
1191
|
+
* Trade-off: content is a plain string read from an attribute when the tooltip opens, so a
|
|
1192
|
+
* `TemplateRef` tooltip is not available here and an attribute change while the tooltip is
|
|
1193
|
+
* visible shows up on the next open. Reach for `[tlsTooltip]` when a handful of tooltips need
|
|
1194
|
+
* rich content, and for this one when the number of them is what costs.
|
|
1195
|
+
*/
|
|
1196
|
+
class TooltipDelegateDirective extends TooltipTrigger {
|
|
1197
|
+
// Injections
|
|
1198
|
+
_elementRef = inject(ElementRef);
|
|
1199
|
+
// Inputs
|
|
1200
|
+
/**
|
|
1201
|
+
* Attribute a descendant carries its tooltip text in, which also matches the descendants
|
|
1202
|
+
* that own a tooltip. Written bare (`tlsTooltipDelegate`) it stays at the default.
|
|
1203
|
+
*/
|
|
1204
|
+
contentAttribute = input(DEFAULT_TOOLTIP_CONTENT_ATTRIBUTE, { ...(ngDevMode ? { debugName: "contentAttribute" } : /* istanbul ignore next */ {}), alias: 'tlsTooltipDelegate',
|
|
1205
|
+
transform: attribute => attribute || DEFAULT_TOOLTIP_CONTENT_ATTRIBUTE });
|
|
1206
|
+
// Computed
|
|
1207
|
+
_selector = computed(() => `[${this.contentAttribute()}]`, /* @ts-ignore */
|
|
1208
|
+
...(ngDevMode ? [{ debugName: "_selector" }] : /* istanbul ignore next */ []));
|
|
1209
|
+
// Protected methods
|
|
1210
|
+
onPointerOver(event) {
|
|
1211
|
+
const item = this._resolveItem(event.target);
|
|
1212
|
+
if (!item)
|
|
1213
|
+
return;
|
|
1214
|
+
// A touch "over" is a tap, not a hover — toggle instead. The default is not prevented,
|
|
1215
|
+
// so the tap still activates an interactive item.
|
|
1216
|
+
if (event.pointerType === 'touch') {
|
|
1217
|
+
if (this.anchor === item) {
|
|
1218
|
+
this._hide();
|
|
1219
|
+
}
|
|
1220
|
+
else {
|
|
1221
|
+
this._showItem(item);
|
|
1222
|
+
}
|
|
1223
|
+
return;
|
|
1224
|
+
}
|
|
1225
|
+
this._showItem(item, { x: event.clientX, y: event.clientY });
|
|
1226
|
+
}
|
|
1227
|
+
onPointerMove(event) {
|
|
1228
|
+
if (event.pointerType === 'touch')
|
|
1229
|
+
return;
|
|
1230
|
+
if (!this.anchor)
|
|
1231
|
+
return;
|
|
1232
|
+
if (this.tooltipOrigin() === 'cursor') {
|
|
1233
|
+
this._tooltipService.move({ x: event.clientX, y: event.clientY }, this._positions());
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
onPointerOut(event) {
|
|
1237
|
+
// A tap retires its pointer immediately, firing `pointerout` within the same gesture;
|
|
1238
|
+
// hiding here would undo the toggle the tap just made.
|
|
1239
|
+
if (event.pointerType === 'touch')
|
|
1240
|
+
return;
|
|
1241
|
+
if (!this.anchor)
|
|
1242
|
+
return;
|
|
1243
|
+
// Crossing between children of the same item is not a leave.
|
|
1244
|
+
if (this._resolveItem(event.relatedTarget) === this.anchor)
|
|
1245
|
+
return;
|
|
1246
|
+
this._hide();
|
|
1247
|
+
}
|
|
1248
|
+
onFocusIn(event) {
|
|
1249
|
+
const item = this._resolveItem(event.target);
|
|
1250
|
+
if (!item)
|
|
1251
|
+
return;
|
|
1252
|
+
// No cursor to anchor to; a focus-triggered tooltip always anchors to the item.
|
|
1253
|
+
this._showItem(item);
|
|
1254
|
+
}
|
|
1255
|
+
onFocusOut(event) {
|
|
1256
|
+
// Focus moving between children of the same item is not a leave.
|
|
1257
|
+
if (this._resolveItem(event.relatedTarget) === this.anchor)
|
|
1258
|
+
return;
|
|
1259
|
+
this._hide();
|
|
1260
|
+
}
|
|
1261
|
+
// Private methods
|
|
1262
|
+
/** The tooltip-owning ancestor of `target` within this subtree, if there is one. */
|
|
1263
|
+
_resolveItem(target) {
|
|
1264
|
+
if (!(target instanceof Element))
|
|
1265
|
+
return null;
|
|
1266
|
+
const item = target.closest(this._selector());
|
|
1267
|
+
if (!item)
|
|
1268
|
+
return null;
|
|
1269
|
+
// `closest` walks past this host, so an item of an outer delegate is not ours to serve.
|
|
1270
|
+
if (!this._elementRef.nativeElement.contains(item))
|
|
1271
|
+
return null;
|
|
1272
|
+
return item;
|
|
1273
|
+
}
|
|
1274
|
+
_showItem(item, point) {
|
|
1275
|
+
const content = item.getAttribute(this.contentAttribute());
|
|
1276
|
+
if (!content)
|
|
1277
|
+
return;
|
|
1278
|
+
this._show(item, content, null, point);
|
|
1279
|
+
}
|
|
1280
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipDelegateDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
1281
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: TooltipDelegateDirective, isStandalone: true, selector: "[tlsTooltipDelegate]", inputs: { contentAttribute: { classPropertyName: "contentAttribute", publicName: "tlsTooltipDelegate", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "pointerover": "onPointerOver($event)", "pointermove": "onPointerMove($event)", "pointerout": "onPointerOut($event)", "focusin": "onFocusIn($event)", "focusout": "onFocusOut($event)" } }, providers: [TooltipService], usesInheritance: true, ngImport: i0 });
|
|
1282
|
+
}
|
|
1283
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipDelegateDirective, decorators: [{
|
|
1284
|
+
type: Directive,
|
|
1285
|
+
args: [{
|
|
1286
|
+
selector: '[tlsTooltipDelegate]',
|
|
1287
|
+
providers: [TooltipService],
|
|
1288
|
+
host: {
|
|
1289
|
+
'(pointerover)': 'onPointerOver($event)',
|
|
1290
|
+
'(pointermove)': 'onPointerMove($event)',
|
|
1291
|
+
'(pointerout)': 'onPointerOut($event)',
|
|
1292
|
+
'(focusin)': 'onFocusIn($event)',
|
|
1293
|
+
'(focusout)': 'onFocusOut($event)',
|
|
1294
|
+
},
|
|
1295
|
+
}]
|
|
1296
|
+
}], propDecorators: { contentAttribute: [{ type: i0.Input, args: [{ isSignal: true, alias: "tlsTooltipDelegate", required: false }] }] } });
|
|
1297
|
+
|
|
1298
|
+
/**
|
|
1299
|
+
* Attaches a tooltip to the host element. Shows on hover and on keyboard focus,
|
|
1300
|
+
* toggles on touch, and dismisses on Escape without moving the pointer or focus
|
|
1301
|
+
* (WCAG 1.4.13). The tooltip is linked to the host via `aria-describedby` while
|
|
1302
|
+
* visible, joining any description the host already carries rather than replacing
|
|
1303
|
+
* it, and leaving that one behind when the tooltip hides.
|
|
1304
|
+
*
|
|
1305
|
+
* Interaction is driven by pointer events, branching on `pointerType`: mouse
|
|
1306
|
+
* and pen get hover semantics, touch gets tap-to-toggle. A single stream avoids
|
|
1307
|
+
* the synthesized mouse events browsers replay after a tap.
|
|
1308
|
+
*
|
|
1309
|
+
* Serving many elements at once costs one instance each; `[tlsTooltipDelegate]`
|
|
1310
|
+
* serves a whole subtree from one instead.
|
|
1311
|
+
*/
|
|
1312
|
+
class TooltipDirective extends TooltipTrigger {
|
|
1313
|
+
// Injections
|
|
1314
|
+
_elementRef = inject(ElementRef);
|
|
1315
|
+
// Inputs
|
|
1316
|
+
content = input('', { ...(ngDevMode ? { debugName: "content" } : /* istanbul ignore next */ {}), alias: 'tlsTooltip' });
|
|
1317
|
+
data = input(null, /* @ts-ignore */
|
|
1318
|
+
...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
1319
|
+
// Protected methods
|
|
1320
|
+
onPointerEnter(event) {
|
|
1321
|
+
// A touch "enter" is a tap, not a hover — toggle instead. The default is
|
|
1322
|
+
// not prevented, so the tap still activates an interactive host.
|
|
1323
|
+
if (event.pointerType === 'touch') {
|
|
1324
|
+
if (this.anchor) {
|
|
1325
|
+
this._hide();
|
|
1326
|
+
}
|
|
1327
|
+
else {
|
|
1328
|
+
this._showHost();
|
|
1329
|
+
}
|
|
1330
|
+
return;
|
|
1331
|
+
}
|
|
1332
|
+
this._showHost({ x: event.clientX, y: event.clientY });
|
|
1333
|
+
}
|
|
1334
|
+
onPointerMove(event) {
|
|
1335
|
+
if (event.pointerType === 'touch')
|
|
1336
|
+
return;
|
|
1337
|
+
if (this.tooltipOrigin() === 'cursor') {
|
|
1338
|
+
this._tooltipService.move({ x: event.clientX, y: event.clientY }, this._positions());
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
onPointerLeave(event) {
|
|
1342
|
+
// A tap retires its pointer immediately, firing `pointerleave` within the
|
|
1343
|
+
// same gesture; hiding here would undo the toggle the tap just made.
|
|
1344
|
+
if (event.pointerType === 'touch')
|
|
1345
|
+
return;
|
|
1346
|
+
this._hide();
|
|
1347
|
+
}
|
|
1348
|
+
onFocus() {
|
|
1349
|
+
// No cursor to anchor to; a focus-triggered tooltip always anchors to the element.
|
|
1350
|
+
this._showHost();
|
|
1351
|
+
}
|
|
1352
|
+
onBlur() {
|
|
1353
|
+
this._hide();
|
|
1354
|
+
}
|
|
1355
|
+
// Private methods
|
|
1356
|
+
_showHost(point) {
|
|
1357
|
+
this._show(this._elementRef.nativeElement, this.content(), this.data(), point);
|
|
1358
|
+
}
|
|
1359
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
1360
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: TooltipDirective, isStandalone: true, selector: "[tlsTooltip]", inputs: { content: { classPropertyName: "content", publicName: "tlsTooltip", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "pointerenter": "onPointerEnter($event)", "pointermove": "onPointerMove($event)", "pointerleave": "onPointerLeave($event)", "focus": "onFocus()", "blur": "onBlur()" } }, providers: [TooltipService], usesInheritance: true, ngImport: i0 });
|
|
1361
|
+
}
|
|
1362
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipDirective, decorators: [{
|
|
1363
|
+
type: Directive,
|
|
1364
|
+
args: [{
|
|
1365
|
+
selector: '[tlsTooltip]',
|
|
1366
|
+
providers: [TooltipService],
|
|
1367
|
+
host: {
|
|
1368
|
+
'(pointerenter)': 'onPointerEnter($event)',
|
|
1369
|
+
'(pointermove)': 'onPointerMove($event)',
|
|
1370
|
+
'(pointerleave)': 'onPointerLeave($event)',
|
|
1371
|
+
'(focus)': 'onFocus()',
|
|
1372
|
+
'(blur)': 'onBlur()',
|
|
1373
|
+
},
|
|
1374
|
+
}]
|
|
1375
|
+
}], propDecorators: { content: [{ type: i0.Input, args: [{ isSignal: true, alias: "tlsTooltip", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }] } });
|
|
1376
|
+
|
|
1377
|
+
/** Days in a calendar week; the grid renders one weekday row each. */
|
|
1378
|
+
const DAYS_PER_WEEK$1 = 7;
|
|
1379
|
+
/** Lowest meaningful step count: an empty step plus a single activity step. */
|
|
1380
|
+
const MIN_LEVELS = 2;
|
|
1381
|
+
/** `date-fns` format token for a month heading above the week columns, e.g. "Jul". */
|
|
1382
|
+
const MONTH_LABEL_FORMAT = 'MMM';
|
|
1383
|
+
/** `date-fns` format token for a day's accessible name, e.g. "July 20th, 2026". */
|
|
1384
|
+
const DAY_LABEL_FORMAT = 'PPP';
|
|
1385
|
+
/**
|
|
1386
|
+
* Share of the color a level-1 cell already carries, so the faintest activity step stays
|
|
1387
|
+
* distinguishable from an empty day instead of fading into the surface.
|
|
1388
|
+
*/
|
|
1389
|
+
const MIN_LEVEL_INTENSITY = 0.35;
|
|
1390
|
+
/** How often the heatmap's notion of "today" refreshes, so the marker survives midnight. */
|
|
1391
|
+
const NOW_REFRESH_INTERVAL_MS$1 = 60_000;
|
|
1392
|
+
|
|
1393
|
+
const DEFAULT_ACTIVITY_HEATMAP_CONFIG = {
|
|
1394
|
+
levels: 5,
|
|
1395
|
+
weekStartsOn: 0,
|
|
1396
|
+
weekDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
|
1397
|
+
rangeMonths: 12,
|
|
1398
|
+
weekdayLabelInterval: 2,
|
|
1399
|
+
color: 'primary',
|
|
1400
|
+
size: 'md',
|
|
1401
|
+
showMonthLabels: true,
|
|
1402
|
+
showWeekdayLabels: true,
|
|
1403
|
+
showLegend: true,
|
|
1404
|
+
showTooltip: true,
|
|
1405
|
+
labels: {
|
|
1406
|
+
grid: 'Activity',
|
|
1407
|
+
day: (count, date) => `${count} ${count === 1 ? 'activity' : 'activities'} on ${date}`,
|
|
1408
|
+
outsideRange: 'Outside the selected range',
|
|
1409
|
+
less: 'Less',
|
|
1410
|
+
more: 'More',
|
|
1411
|
+
},
|
|
1412
|
+
};
|
|
1413
|
+
|
|
1414
|
+
const ACTIVITY_HEATMAP_CONFIG = new InjectionToken('ACTIVITY_HEATMAP_CONFIG', { factory: () => DEFAULT_ACTIVITY_HEATMAP_CONFIG });
|
|
1415
|
+
|
|
1416
|
+
/**
|
|
1417
|
+
* Sums entries per calendar day, keyed by the day's start-of-day timestamp so lookups
|
|
1418
|
+
* are exact regardless of the time of day each entry carries.
|
|
1419
|
+
*/
|
|
1420
|
+
const aggregateActivityEntries = (entries) => {
|
|
1421
|
+
const totals = new Map();
|
|
1422
|
+
for (const entry of entries) {
|
|
1423
|
+
const key = startOfDay(entry.date).getTime();
|
|
1424
|
+
const existing = totals.get(key);
|
|
1425
|
+
const count = existing ? existing.count + entry.count : entry.count;
|
|
1426
|
+
// The last entry of a day wins the payload slot, so a single-entry-per-day feed —
|
|
1427
|
+
// the common case — always surfaces its own payload.
|
|
1428
|
+
totals.set(key, { count, data: entry.data });
|
|
1429
|
+
}
|
|
1430
|
+
return totals;
|
|
1431
|
+
};
|
|
1432
|
+
|
|
1433
|
+
/** Week columns a month must cover before it earns a heading, so slivers stay unlabelled. */
|
|
1434
|
+
const MIN_SEGMENT_WEEKS = 2;
|
|
1435
|
+
/**
|
|
1436
|
+
* Month headings for the week columns starting at `weekStarts`, each spanning the columns
|
|
1437
|
+
* whose first day falls in that month. `formatMonth` renders the heading text, keeping the
|
|
1438
|
+
* locale concern with the caller.
|
|
1439
|
+
*
|
|
1440
|
+
* Segments are emitted as they close, so a discarded sliver is never formatted.
|
|
1441
|
+
*/
|
|
1442
|
+
const buildActivityMonthSegments = (weekStarts, formatMonth) => {
|
|
1443
|
+
const segments = [];
|
|
1444
|
+
let pending;
|
|
1445
|
+
const close = (segment) => {
|
|
1446
|
+
if (segment.span < MIN_SEGMENT_WEEKS)
|
|
1447
|
+
return;
|
|
1448
|
+
segments.push({ label: formatMonth(segment.date), column: segment.column, span: segment.span });
|
|
1449
|
+
};
|
|
1450
|
+
for (let index = 0; index < weekStarts.length; index++) {
|
|
1451
|
+
const weekStart = weekStarts[index];
|
|
1452
|
+
if (pending && isSameMonth(pending.date, weekStart)) {
|
|
1453
|
+
pending.span++;
|
|
1454
|
+
continue;
|
|
1455
|
+
}
|
|
1456
|
+
if (pending)
|
|
1457
|
+
close(pending);
|
|
1458
|
+
// Grid columns are 1-based.
|
|
1459
|
+
pending = { date: weekStart, column: index + 1, span: 1 };
|
|
1460
|
+
}
|
|
1461
|
+
if (pending)
|
|
1462
|
+
close(pending);
|
|
1463
|
+
return segments;
|
|
1464
|
+
};
|
|
1465
|
+
|
|
1466
|
+
/**
|
|
1467
|
+
* Minimum count required for each activity level, ascending, covering levels 1…`levels - 1`
|
|
1468
|
+
* (level 0 is the empty day). Level 1 always starts at a single activity, so no active day
|
|
1469
|
+
* renders as empty, and the busiest day always reaches the top level; the levels in between
|
|
1470
|
+
* are spread evenly across that span.
|
|
1471
|
+
*
|
|
1472
|
+
* Returns an empty array when nothing is active, in which case every day resolves to level 0.
|
|
1473
|
+
*/
|
|
1474
|
+
const buildActivityThresholds = (maxCount, levels) => {
|
|
1475
|
+
if (maxCount <= 0)
|
|
1476
|
+
return [];
|
|
1477
|
+
const steps = levels - 1;
|
|
1478
|
+
const thresholds = [];
|
|
1479
|
+
for (let step = 1; step <= steps; step++) {
|
|
1480
|
+
const spread = steps === 1 ? 1 : Math.ceil(1 + ((maxCount - 1) * (step - 1)) / (steps - 1));
|
|
1481
|
+
const previous = thresholds[thresholds.length - 1];
|
|
1482
|
+
// Keep the thresholds strictly ascending when the busiest day has too few activities to
|
|
1483
|
+
// spread across every level; the surplus levels simply stay unreachable.
|
|
1484
|
+
thresholds.push(previous === undefined ? spread : Math.max(spread, previous + 1));
|
|
1485
|
+
}
|
|
1486
|
+
return thresholds;
|
|
1487
|
+
};
|
|
1488
|
+
|
|
1489
|
+
/**
|
|
1490
|
+
* Intensity step for `count` against ascending `thresholds` (the minimum count of each
|
|
1491
|
+
* level from 1 upwards): the highest level whose threshold the count reaches, or 0 when
|
|
1492
|
+
* it reaches none.
|
|
1493
|
+
*/
|
|
1494
|
+
const resolveActivityLevel = (count, thresholds) => {
|
|
1495
|
+
let level = 0;
|
|
1496
|
+
for (const threshold of thresholds) {
|
|
1497
|
+
if (count < threshold)
|
|
1498
|
+
break;
|
|
1499
|
+
level++;
|
|
1500
|
+
}
|
|
1501
|
+
return level;
|
|
1502
|
+
};
|
|
1503
|
+
|
|
1504
|
+
/**
|
|
1505
|
+
* Calendar heatmap of daily activity: one column per week, one row per weekday, each cell
|
|
1506
|
+
* shaded by how much activity its day carries.
|
|
1507
|
+
*
|
|
1508
|
+
* Cells are deliberately dense — the year-at-a-glance layout is the point — so they fall
|
|
1509
|
+
* below the WCAG 2.5.8 target size and rely on that success criterion's essential-presentation
|
|
1510
|
+
* exception. Every cell is reachable with the grid's arrow keys and carries its exact total as
|
|
1511
|
+
* an accessible name, so the data never depends on either the fill shade or a precise tap.
|
|
1512
|
+
*/
|
|
1513
|
+
class ActivityHeatmap {
|
|
1514
|
+
// Injections
|
|
1515
|
+
_config = inject(ACTIVITY_HEATMAP_CONFIG);
|
|
1516
|
+
_locale = inject(LOCALE_CONFIG);
|
|
1517
|
+
// Inputs
|
|
1518
|
+
entries = input([], /* @ts-ignore */
|
|
1519
|
+
...(ngDevMode ? [{ debugName: "entries" }] : /* istanbul ignore next */ []));
|
|
1520
|
+
/** First day of the range; defaults to `rangeMonths` before the end of the range. */
|
|
1521
|
+
startDate = input(undefined, /* @ts-ignore */
|
|
1522
|
+
...(ngDevMode ? [{ debugName: "startDate" }] : /* istanbul ignore next */ []));
|
|
1523
|
+
/** Last day of the range; defaults to today. */
|
|
1524
|
+
endDate = input(undefined, /* @ts-ignore */
|
|
1525
|
+
...(ngDevMode ? [{ debugName: "endDate" }] : /* istanbul ignore next */ []));
|
|
1526
|
+
/** Intensity steps including the empty one, so `levels - 1` shades carry activity. */
|
|
1527
|
+
levels = input(this._config.levels, { ...(ngDevMode ? { debugName: "levels" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
1528
|
+
/**
|
|
1529
|
+
* Minimum count of each level from 1 upwards, ascending. Left unset the thresholds are
|
|
1530
|
+
* derived from the busiest day, so the scale always spans the data.
|
|
1531
|
+
*/
|
|
1532
|
+
thresholds = input(undefined, /* @ts-ignore */
|
|
1533
|
+
...(ngDevMode ? [{ debugName: "thresholds" }] : /* istanbul ignore next */ []));
|
|
1534
|
+
weekStartsOn = input(this._config.weekStartsOn, /* @ts-ignore */
|
|
1535
|
+
...(ngDevMode ? [{ debugName: "weekStartsOn" }] : /* istanbul ignore next */ []));
|
|
1536
|
+
/** Short weekday labels, Sunday-first; rotated to honour `weekStartsOn`. */
|
|
1537
|
+
weekDays = input(this._config.weekDays, /* @ts-ignore */
|
|
1538
|
+
...(ngDevMode ? [{ debugName: "weekDays" }] : /* istanbul ignore next */ []));
|
|
1539
|
+
/** Every nth weekday row carries a label; 1 labels all seven, 2 labels every other row. */
|
|
1540
|
+
weekdayLabelInterval = input(this._config.weekdayLabelInterval, { ...(ngDevMode ? { debugName: "weekdayLabelInterval" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
1541
|
+
color = input(this._config.color, /* @ts-ignore */
|
|
1542
|
+
...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
1543
|
+
size = input(this._config.size, /* @ts-ignore */
|
|
1544
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
1545
|
+
showMonthLabels = input(this._config.showMonthLabels, { ...(ngDevMode ? { debugName: "showMonthLabels" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1546
|
+
showWeekdayLabels = input(this._config.showWeekdayLabels, { ...(ngDevMode ? { debugName: "showWeekdayLabels" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1547
|
+
showLegend = input(this._config.showLegend, { ...(ngDevMode ? { debugName: "showLegend" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1548
|
+
showTooltip = input(this._config.showTooltip, { ...(ngDevMode ? { debugName: "showTooltip" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1549
|
+
/** Accessible name for the grid; falls back to the configured label. */
|
|
1550
|
+
ariaLabel = input(undefined, /* @ts-ignore */
|
|
1551
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
1552
|
+
ariaLabelledby = input(undefined, /* @ts-ignore */
|
|
1553
|
+
...(ngDevMode ? [{ debugName: "ariaLabelledby" }] : /* istanbul ignore next */ []));
|
|
1554
|
+
// Outputs
|
|
1555
|
+
/** Emits the activated day; padding days outside the range never emit. */
|
|
1556
|
+
daySelect = output();
|
|
1557
|
+
// State
|
|
1558
|
+
legendLess = this._config.labels.less;
|
|
1559
|
+
legendMore = this._config.labels.more;
|
|
1560
|
+
_dateOptions = localeFormatOptions(this._locale);
|
|
1561
|
+
/** Ticking current time, so the today marker tracks the clock across midnight. */
|
|
1562
|
+
_now = createNowSignal(NOW_REFRESH_INTERVAL_MS$1);
|
|
1563
|
+
// Computed
|
|
1564
|
+
/** Steps actually rendered; a heatmap needs an empty step plus at least one active one. */
|
|
1565
|
+
resolvedLevels = computed(() => Math.max(MIN_LEVELS, Math.floor(this.levels())), /* @ts-ignore */
|
|
1566
|
+
...(ngDevMode ? [{ debugName: "resolvedLevels" }] : /* istanbul ignore next */ []));
|
|
1567
|
+
gridLabel = computed(() => {
|
|
1568
|
+
if (this.ariaLabelledby())
|
|
1569
|
+
return undefined;
|
|
1570
|
+
return this.ariaLabel() ?? this._config.labels.grid;
|
|
1571
|
+
}, /* @ts-ignore */
|
|
1572
|
+
...(ngDevMode ? [{ debugName: "gridLabel" }] : /* istanbul ignore next */ []));
|
|
1573
|
+
/** Weekday rows, each holding one weekday's cell across every week column. */
|
|
1574
|
+
rows = computed(() => {
|
|
1575
|
+
const { start, end } = this._range();
|
|
1576
|
+
const weekStartsOn = this.weekStartsOn();
|
|
1577
|
+
const totals = aggregateActivityEntries(this.entries());
|
|
1578
|
+
const today = startOfDay(this._now());
|
|
1579
|
+
const days = eachDayOfInterval({
|
|
1580
|
+
start: startOfWeek(start, { weekStartsOn }),
|
|
1581
|
+
end: endOfWeek(end, { weekStartsOn }),
|
|
1582
|
+
});
|
|
1583
|
+
const thresholds = this._resolveThresholds(days, totals, start, end);
|
|
1584
|
+
const weekdayLabels = rotateWeekDays(this.weekDays(), weekStartsOn);
|
|
1585
|
+
const interval = Math.max(1, Math.floor(this.weekdayLabelInterval()));
|
|
1586
|
+
const rows = weekdayLabels.map((label, index) => ({
|
|
1587
|
+
// Sparse labelling starts one row in, mirroring the offset a dense grid reads best with.
|
|
1588
|
+
label: (index - 1) % interval === 0 ? label : '',
|
|
1589
|
+
days: [],
|
|
1590
|
+
}));
|
|
1591
|
+
for (let index = 0; index < days.length; index++) {
|
|
1592
|
+
const date = days[index];
|
|
1593
|
+
const total = totals.get(date.getTime());
|
|
1594
|
+
const inRange = date >= start && date <= end;
|
|
1595
|
+
const count = total && inRange ? total.count : 0;
|
|
1596
|
+
rows[index % DAYS_PER_WEEK$1].days.push({
|
|
1597
|
+
date,
|
|
1598
|
+
count,
|
|
1599
|
+
level: resolveActivityLevel(count, thresholds),
|
|
1600
|
+
inRange,
|
|
1601
|
+
isToday: isSameDay(date, today),
|
|
1602
|
+
label: inRange
|
|
1603
|
+
? this._config.labels.day(count, format(date, DAY_LABEL_FORMAT, this._dateOptions))
|
|
1604
|
+
: this._config.labels.outsideRange,
|
|
1605
|
+
data: total && inRange ? total.data : undefined,
|
|
1606
|
+
});
|
|
1607
|
+
}
|
|
1608
|
+
return rows;
|
|
1609
|
+
}, /* @ts-ignore */
|
|
1610
|
+
...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
|
|
1611
|
+
weekCount = computed(() => {
|
|
1612
|
+
const rows = this.rows();
|
|
1613
|
+
if (rows.length === 0)
|
|
1614
|
+
return 0;
|
|
1615
|
+
return rows[0].days.length;
|
|
1616
|
+
}, /* @ts-ignore */
|
|
1617
|
+
...(ngDevMode ? [{ debugName: "weekCount" }] : /* istanbul ignore next */ []));
|
|
1618
|
+
months = computed(() => {
|
|
1619
|
+
const rows = this.rows();
|
|
1620
|
+
if (rows.length === 0)
|
|
1621
|
+
return [];
|
|
1622
|
+
// The first row holds one day per week column, and each is that week's first day.
|
|
1623
|
+
const weekStarts = rows[0].days.map(day => day.date);
|
|
1624
|
+
return buildActivityMonthSegments(weekStarts, date => format(date, MONTH_LABEL_FORMAT, this._dateOptions));
|
|
1625
|
+
}, /* @ts-ignore */
|
|
1626
|
+
...(ngDevMode ? [{ debugName: "months" }] : /* istanbul ignore next */ []));
|
|
1627
|
+
/** Every intensity step, low to high, for the legend's sample swatches. */
|
|
1628
|
+
legendLevels = computed(() => Array.from({ length: this.resolvedLevels() }, (unused, level) => level), /* @ts-ignore */
|
|
1629
|
+
...(ngDevMode ? [{ debugName: "legendLevels" }] : /* istanbul ignore next */ []));
|
|
1630
|
+
hostClasses = computed(() => {
|
|
1631
|
+
const className = 'tls-activity-heatmap';
|
|
1632
|
+
return [className, `${className}--${this.color()}`, `${className}--${this.size()}`];
|
|
1633
|
+
}, /* @ts-ignore */
|
|
1634
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
1635
|
+
/** Inclusive day range covered by the heatmap, whether given or derived from today. */
|
|
1636
|
+
_range = computed(() => {
|
|
1637
|
+
const endDate = this.endDate();
|
|
1638
|
+
const end = startOfDay(endDate ?? this._now());
|
|
1639
|
+
const startDate = this.startDate();
|
|
1640
|
+
if (startDate)
|
|
1641
|
+
return { start: startOfDay(startDate), end };
|
|
1642
|
+
// A month-aligned span is inclusive of both ends, so it starts the day after the offset.
|
|
1643
|
+
return { start: addDays(subMonths(end, this._config.rangeMonths), 1), end };
|
|
1644
|
+
}, /* @ts-ignore */
|
|
1645
|
+
...(ngDevMode ? [{ debugName: "_range" }] : /* istanbul ignore next */ []));
|
|
1646
|
+
// Protected methods
|
|
1647
|
+
/**
|
|
1648
|
+
* Share of the theme color a cell of `level` is filled with, `0` leaving it on the empty
|
|
1649
|
+
* surface. Level 1 already carries `MIN_LEVEL_INTENSITY` so the faintest active day stays
|
|
1650
|
+
* distinguishable, and the remaining levels spread evenly up to the full color.
|
|
1651
|
+
*/
|
|
1652
|
+
intensity(level) {
|
|
1653
|
+
if (level <= 0)
|
|
1654
|
+
return 0;
|
|
1655
|
+
const topLevel = this.resolvedLevels() - 1;
|
|
1656
|
+
if (topLevel <= 1)
|
|
1657
|
+
return 1;
|
|
1658
|
+
return MIN_LEVEL_INTENSITY + ((1 - MIN_LEVEL_INTENSITY) * (level - 1)) / (topLevel - 1);
|
|
1659
|
+
}
|
|
1660
|
+
onDaySelect(day) {
|
|
1661
|
+
if (!day.inRange)
|
|
1662
|
+
return;
|
|
1663
|
+
this.daySelect.emit(day);
|
|
1664
|
+
}
|
|
1665
|
+
/** Space would scroll the grid; consume it and activate the focused day instead. */
|
|
1666
|
+
onDaySpace(event, day) {
|
|
1667
|
+
event.preventDefault();
|
|
1668
|
+
this.onDaySelect(day);
|
|
1669
|
+
}
|
|
1670
|
+
// Private methods
|
|
1671
|
+
/** Consumer thresholds when given, otherwise a scale spanning the busiest day in range. */
|
|
1672
|
+
_resolveThresholds(days, totals, start, end) {
|
|
1673
|
+
const thresholds = this.thresholds();
|
|
1674
|
+
if (thresholds)
|
|
1675
|
+
return thresholds;
|
|
1676
|
+
let maxCount = 0;
|
|
1677
|
+
for (const date of days) {
|
|
1678
|
+
if (date < start || date > end)
|
|
1679
|
+
continue;
|
|
1680
|
+
const total = totals.get(date.getTime());
|
|
1681
|
+
if (total && total.count > maxCount)
|
|
1682
|
+
maxCount = total.count;
|
|
1683
|
+
}
|
|
1684
|
+
return buildActivityThresholds(maxCount, this.resolvedLevels());
|
|
1685
|
+
}
|
|
1686
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ActivityHeatmap, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1687
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: ActivityHeatmap, isStandalone: true, selector: "tls-activity-heatmap", inputs: { entries: { classPropertyName: "entries", publicName: "entries", isSignal: true, isRequired: false, transformFunction: null }, startDate: { classPropertyName: "startDate", publicName: "startDate", isSignal: true, isRequired: false, transformFunction: null }, endDate: { classPropertyName: "endDate", publicName: "endDate", isSignal: true, isRequired: false, transformFunction: null }, levels: { classPropertyName: "levels", publicName: "levels", isSignal: true, isRequired: false, transformFunction: null }, thresholds: { classPropertyName: "thresholds", publicName: "thresholds", isSignal: true, isRequired: false, transformFunction: null }, weekStartsOn: { classPropertyName: "weekStartsOn", publicName: "weekStartsOn", isSignal: true, isRequired: false, transformFunction: null }, weekDays: { classPropertyName: "weekDays", publicName: "weekDays", isSignal: true, isRequired: false, transformFunction: null }, weekdayLabelInterval: { classPropertyName: "weekdayLabelInterval", publicName: "weekdayLabelInterval", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, showMonthLabels: { classPropertyName: "showMonthLabels", publicName: "showMonthLabels", isSignal: true, isRequired: false, transformFunction: null }, showWeekdayLabels: { classPropertyName: "showWeekdayLabels", publicName: "showWeekdayLabels", isSignal: true, isRequired: false, transformFunction: null }, showLegend: { classPropertyName: "showLegend", publicName: "showLegend", isSignal: true, isRequired: false, transformFunction: null }, showTooltip: { classPropertyName: "showTooltip", publicName: "showTooltip", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { daySelect: "daySelect" }, host: { properties: { "class": "hostClasses()" } }, ngImport: i0, template: "<div class=\"tls-activity-heatmap__viewport\">\n <div class=\"tls-activity-heatmap__chart\" [style.--tls-activity-heatmap-weeks]=\"weekCount()\">\n @if (showMonthLabels()) {\n <!-- Month headings repeat the dates already announced on every cell, so they stay decorative. -->\n <div class=\"tls-activity-heatmap__months\" aria-hidden=\"true\">\n @for (month of months(); track month.column) {\n <span\n class=\"tls-activity-heatmap__month\"\n [style.grid-column]=\"month.column + ' / span ' + month.span\"\n >\n {{ month.label }}\n </span>\n }\n </div>\n }\n\n @if (showWeekdayLabels()) {\n <div class=\"tls-activity-heatmap__weekdays\" aria-hidden=\"true\">\n @for (row of rows(); track $index) {\n <span class=\"tls-activity-heatmap__weekday\">{{ row.label }}</span>\n }\n </div>\n }\n\n <!-- One delegated tooltip serves every cell, so a year of days costs a single directive\n and overlay service instead of one per cell. -->\n <div\n ngGrid\n tlsTooltipDelegate\n class=\"tls-activity-heatmap__grid\"\n rowWrap=\"nowrap\"\n colWrap=\"nowrap\"\n [tooltipDisabled]=\"!showTooltip()\"\n [attr.aria-label]=\"gridLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledby() ?? null\"\n >\n @for (row of rows(); track $index) {\n <div ngGridRow class=\"tls-activity-heatmap__row\">\n @for (day of row.days; track day.date.getTime()) {\n <!-- Padding days stay navigable so arrow keys never dead-end on the grid's corners;\n they are only unselectable and announce themselves as outside the range. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- ngGridCell manages role and roving tabindex -->\n <div\n ngGridCell\n class=\"tls-activity-heatmap__day\"\n [class.tls-activity-heatmap__day--outside]=\"!day.inRange\"\n [class.tls-activity-heatmap__day--today]=\"day.isToday\"\n [selectable]=\"day.inRange\"\n [style.--tls-activity-heatmap-intensity]=\"intensity(day.level)\"\n [attr.aria-label]=\"day.label\"\n [attr.data-tooltip]=\"day.inRange ? day.label : null\"\n (click)=\"onDaySelect(day)\"\n (keydown.enter)=\"onDaySelect(day)\"\n (keydown.space)=\"onDaySpace($event, day)\"\n ></div>\n }\n </div>\n }\n </div>\n </div>\n</div>\n\n@if (showLegend()) {\n <div class=\"tls-activity-heatmap__legend\">\n <span class=\"tls-activity-heatmap__legend-label\">{{ legendLess }}</span>\n\n <!-- Sample swatches carry no information the \"less \u2026 more\" captions don't already give. -->\n @for (level of legendLevels(); track level) {\n <span\n class=\"tls-activity-heatmap__legend-swatch\"\n aria-hidden=\"true\"\n [style.--tls-activity-heatmap-intensity]=\"intensity(level)\"\n ></span>\n }\n\n <span class=\"tls-activity-heatmap__legend-label\">{{ legendMore }}</span>\n </div>\n}\n", dependencies: [{ kind: "directive", type: Grid, selector: "[ngGrid]", inputs: ["enableSelection", "disabled", "softDisabled", "focusMode", "rowWrap", "colWrap", "multi", "selectionMode", "tabindex"], exportAs: ["ngGrid"] }, { kind: "directive", type: GridRow, selector: "[ngGridRow]", inputs: ["rowIndex"], exportAs: ["ngGridRow"] }, { kind: "directive", type: GridCell, selector: "[ngGridCell]", inputs: ["id", "role", "rowSpan", "colSpan", "rowIndex", "colIndex", "disabled", "selected", "selectable", "tabindex"], outputs: ["selectedChange"], exportAs: ["ngGridCell"] }, { kind: "directive", type: TooltipDelegateDirective, selector: "[tlsTooltipDelegate]", inputs: ["tlsTooltipDelegate"] }] });
|
|
1688
|
+
}
|
|
1689
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ActivityHeatmap, decorators: [{
|
|
1690
|
+
type: Component,
|
|
1691
|
+
args: [{ selector: 'tls-activity-heatmap', imports: [Grid, GridRow, GridCell, TooltipDelegateDirective], host: {
|
|
1692
|
+
'[class]': 'hostClasses()',
|
|
1693
|
+
}, template: "<div class=\"tls-activity-heatmap__viewport\">\n <div class=\"tls-activity-heatmap__chart\" [style.--tls-activity-heatmap-weeks]=\"weekCount()\">\n @if (showMonthLabels()) {\n <!-- Month headings repeat the dates already announced on every cell, so they stay decorative. -->\n <div class=\"tls-activity-heatmap__months\" aria-hidden=\"true\">\n @for (month of months(); track month.column) {\n <span\n class=\"tls-activity-heatmap__month\"\n [style.grid-column]=\"month.column + ' / span ' + month.span\"\n >\n {{ month.label }}\n </span>\n }\n </div>\n }\n\n @if (showWeekdayLabels()) {\n <div class=\"tls-activity-heatmap__weekdays\" aria-hidden=\"true\">\n @for (row of rows(); track $index) {\n <span class=\"tls-activity-heatmap__weekday\">{{ row.label }}</span>\n }\n </div>\n }\n\n <!-- One delegated tooltip serves every cell, so a year of days costs a single directive\n and overlay service instead of one per cell. -->\n <div\n ngGrid\n tlsTooltipDelegate\n class=\"tls-activity-heatmap__grid\"\n rowWrap=\"nowrap\"\n colWrap=\"nowrap\"\n [tooltipDisabled]=\"!showTooltip()\"\n [attr.aria-label]=\"gridLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledby() ?? null\"\n >\n @for (row of rows(); track $index) {\n <div ngGridRow class=\"tls-activity-heatmap__row\">\n @for (day of row.days; track day.date.getTime()) {\n <!-- Padding days stay navigable so arrow keys never dead-end on the grid's corners;\n they are only unselectable and announce themselves as outside the range. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- ngGridCell manages role and roving tabindex -->\n <div\n ngGridCell\n class=\"tls-activity-heatmap__day\"\n [class.tls-activity-heatmap__day--outside]=\"!day.inRange\"\n [class.tls-activity-heatmap__day--today]=\"day.isToday\"\n [selectable]=\"day.inRange\"\n [style.--tls-activity-heatmap-intensity]=\"intensity(day.level)\"\n [attr.aria-label]=\"day.label\"\n [attr.data-tooltip]=\"day.inRange ? day.label : null\"\n (click)=\"onDaySelect(day)\"\n (keydown.enter)=\"onDaySelect(day)\"\n (keydown.space)=\"onDaySpace($event, day)\"\n ></div>\n }\n </div>\n }\n </div>\n </div>\n</div>\n\n@if (showLegend()) {\n <div class=\"tls-activity-heatmap__legend\">\n <span class=\"tls-activity-heatmap__legend-label\">{{ legendLess }}</span>\n\n <!-- Sample swatches carry no information the \"less \u2026 more\" captions don't already give. -->\n @for (level of legendLevels(); track level) {\n <span\n class=\"tls-activity-heatmap__legend-swatch\"\n aria-hidden=\"true\"\n [style.--tls-activity-heatmap-intensity]=\"intensity(level)\"\n ></span>\n }\n\n <span class=\"tls-activity-heatmap__legend-label\">{{ legendMore }}</span>\n </div>\n}\n" }]
|
|
1694
|
+
}], propDecorators: { entries: [{ type: i0.Input, args: [{ isSignal: true, alias: "entries", required: false }] }], startDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "startDate", required: false }] }], endDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "endDate", required: false }] }], levels: [{ type: i0.Input, args: [{ isSignal: true, alias: "levels", required: false }] }], thresholds: [{ type: i0.Input, args: [{ isSignal: true, alias: "thresholds", required: false }] }], weekStartsOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekStartsOn", required: false }] }], weekDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekDays", required: false }] }], weekdayLabelInterval: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekdayLabelInterval", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], showMonthLabels: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMonthLabels", required: false }] }], showWeekdayLabels: [{ type: i0.Input, args: [{ isSignal: true, alias: "showWeekdayLabels", required: false }] }], showLegend: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLegend", required: false }] }], showTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTooltip", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }], daySelect: [{ type: i0.Output, args: ["daySelect"] }] } });
|
|
1695
|
+
|
|
1696
|
+
const DEFAULT_ALERT_CONFIG = {
|
|
1697
|
+
color: 'primary',
|
|
1698
|
+
label: {
|
|
1699
|
+
primary: '',
|
|
1700
|
+
secondary: '',
|
|
1701
|
+
tertiary: '',
|
|
1702
|
+
success: 'TIP: ',
|
|
1703
|
+
info: 'INFO: ',
|
|
1704
|
+
warning: 'WARNING: ',
|
|
1705
|
+
danger: 'IMPORTANT: ',
|
|
1706
|
+
},
|
|
1707
|
+
hideLabel: false,
|
|
1708
|
+
};
|
|
1709
|
+
|
|
1710
|
+
const ALERT_CONFIG = new InjectionToken('ALERT_CONFIG', {
|
|
1711
|
+
factory: () => DEFAULT_ALERT_CONFIG,
|
|
1712
|
+
});
|
|
1713
|
+
|
|
1714
|
+
class Alert {
|
|
1715
|
+
_config = inject(ALERT_CONFIG);
|
|
1716
|
+
color = input(this._config.color, /* @ts-ignore */
|
|
1717
|
+
...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
1718
|
+
label = input(typeof this._config.label === 'string' ? this._config.label : null, /* @ts-ignore */
|
|
1719
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
1720
|
+
hideLabel = input(this._config.hideLabel, { ...(ngDevMode ? { debugName: "hideLabel" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1721
|
+
displayLabel = computed(() => {
|
|
1722
|
+
const label = this.label();
|
|
1723
|
+
if (label)
|
|
1724
|
+
return label;
|
|
1725
|
+
if (typeof this._config.label === 'object') {
|
|
1726
|
+
return this._config.label[this.color()];
|
|
1727
|
+
}
|
|
1728
|
+
return '';
|
|
1729
|
+
}, /* @ts-ignore */
|
|
1730
|
+
...(ngDevMode ? [{ debugName: "displayLabel" }] : /* istanbul ignore next */ []));
|
|
1731
|
+
hostClasses = computed(() => {
|
|
1732
|
+
const className = 'tls-alert';
|
|
1733
|
+
const array = [className];
|
|
1734
|
+
array.push(`${className}--${this.color()}`);
|
|
1735
|
+
return array;
|
|
1736
|
+
}, /* @ts-ignore */
|
|
1737
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
1738
|
+
hostRole = computed(() => {
|
|
1739
|
+
const urgent = ['danger', 'warning'];
|
|
1740
|
+
return urgent.includes(this.color()) ? 'alert' : 'note';
|
|
1741
|
+
}, /* @ts-ignore */
|
|
1742
|
+
...(ngDevMode ? [{ debugName: "hostRole" }] : /* istanbul ignore next */ []));
|
|
1743
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Alert, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1744
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Alert, isStandalone: true, selector: "tls-alert", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hideLabel: { classPropertyName: "hideLabel", publicName: "hideLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()", "attr.role": "hostRole()", "attr.aria-label": "hideLabel() ? displayLabel() : null" } }, ngImport: i0, template: "<div class=\"tls-alert-icon\"></div>\n<div class=\"tls-alert-body\">\n @if (!hideLabel()) {\n <span class=\"tls-alert-body__label\">{{ displayLabel() }}</span>\n }\n <span class=\"tls-alert-body__content\">\n <ng-content></ng-content>\n </span>\n</div>\n" });
|
|
1745
|
+
}
|
|
1746
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Alert, decorators: [{
|
|
1747
|
+
type: Component,
|
|
1748
|
+
args: [{ selector: 'tls-alert', imports: [], host: {
|
|
1749
|
+
'[class]': 'hostClasses()',
|
|
1750
|
+
'[attr.role]': 'hostRole()',
|
|
1751
|
+
'[attr.aria-label]': 'hideLabel() ? displayLabel() : null',
|
|
1752
|
+
}, template: "<div class=\"tls-alert-icon\"></div>\n<div class=\"tls-alert-body\">\n @if (!hideLabel()) {\n <span class=\"tls-alert-body__label\">{{ displayLabel() }}</span>\n }\n <span class=\"tls-alert-body__content\">\n <ng-content></ng-content>\n </span>\n</div>\n" }]
|
|
1753
|
+
}], propDecorators: { color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hideLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideLabel", required: false }] }] } });
|
|
1754
|
+
|
|
1755
|
+
const DEFAULT_BADGE_CONFIG = {
|
|
1756
|
+
color: 'primary',
|
|
1757
|
+
variant: 'filled',
|
|
1758
|
+
position: 'top-end',
|
|
1759
|
+
size: 'md',
|
|
1760
|
+
max: 99,
|
|
1761
|
+
};
|
|
1762
|
+
|
|
1763
|
+
const BADGE_CONFIG = new InjectionToken('BADGE_CONFIG', {
|
|
1764
|
+
factory: () => DEFAULT_BADGE_CONFIG,
|
|
1765
|
+
});
|
|
792
1766
|
|
|
793
1767
|
class Badge {
|
|
794
1768
|
// Injections
|
|
@@ -890,6 +1864,18 @@ const DEFAULT_ICONS = {
|
|
|
890
1864
|
'<line x1="12" y1="9" x2="12" y2="13" /><line x1="12" y1="17" x2="12.01" y2="17" />'),
|
|
891
1865
|
error: svg('<circle cx="12" cy="12" r="10" /><line x1="15" y1="9" x2="9" y2="15" /><line x1="9" y1="9" x2="15" y2="15" />'),
|
|
892
1866
|
info: svg('<circle cx="12" cy="12" r="10" /><line x1="12" y1="16" x2="12" y2="12" /><line x1="12" y1="8" x2="12.01" y2="8" />'),
|
|
1867
|
+
bold: svg('<path d="M6 4h8a4 4 0 0 1 0 8H6z" /><path d="M6 12h9a4 4 0 0 1 0 8H6z" />'),
|
|
1868
|
+
italic: svg('<line x1="19" y1="4" x2="10" y2="4" /><line x1="14" y1="20" x2="5" y2="20" /><line x1="15" y1="4" x2="9" y2="20" />'),
|
|
1869
|
+
strikethrough: svg('<path d="M16 4H9a3 3 0 0 0-2.83 4" /><path d="M14 12a4 4 0 0 1 0 8H6" /><line x1="4" y1="12" x2="20" y2="12" />'),
|
|
1870
|
+
'inline-code': svg('<polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" />'),
|
|
1871
|
+
'bullet-list': svg('<line x1="8" y1="6" x2="21" y2="6" /><line x1="8" y1="12" x2="21" y2="12" /><line x1="8" y1="18" x2="21" y2="18" />' +
|
|
1872
|
+
'<line x1="3" y1="6" x2="3.01" y2="6" /><line x1="3" y1="12" x2="3.01" y2="12" /><line x1="3" y1="18" x2="3.01" y2="18" />'),
|
|
1873
|
+
'ordered-list': svg('<line x1="10" y1="6" x2="21" y2="6" /><line x1="10" y1="12" x2="21" y2="12" /><line x1="10" y1="18" x2="21" y2="18" />' +
|
|
1874
|
+
'<path d="M4 6h1v4" /><path d="M4 10h2" /><path d="M6 18H4c0-1 2-2 2-3s-1-1.5-2-1" />'),
|
|
1875
|
+
blockquote: svg('<path d="M3 21c3 0 7-1 7-8V5H3v7h4" /><path d="M14 21c3 0 7-1 7-8V5h-7v7h4" />'),
|
|
1876
|
+
link: svg('<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" />' +
|
|
1877
|
+
'<path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" />'),
|
|
1878
|
+
'code-block': svg('<rect x="3" y="4" width="18" height="16" rx="2" /><polyline points="10 9 8 12 10 15" /><polyline points="14 9 16 12 14 15" />'),
|
|
893
1879
|
};
|
|
894
1880
|
function svg(body) {
|
|
895
1881
|
return ('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" ' +
|
|
@@ -1346,221 +2332,34 @@ class ToggleGroup extends SelectionGroup {
|
|
|
1346
2332
|
fluid = input(this._config.fluid, { ...(ngDevMode ? { debugName: "fluid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1347
2333
|
optionTemplate = contentChild('option', /* @ts-ignore */
|
|
1348
2334
|
...(ngDevMode ? [{ debugName: "optionTemplate" }] : /* istanbul ignore next */ []));
|
|
1349
|
-
classes = computed(() => {
|
|
1350
|
-
const className = this.CLASS_NAME;
|
|
1351
|
-
const array = [
|
|
1352
|
-
className,
|
|
1353
|
-
`${className}--${this.size()}`,
|
|
1354
|
-
`${className}--${this.color()}`,
|
|
1355
|
-
`${className}--${this.variant()}`,
|
|
1356
|
-
`${className}--${this.orientation()}`,
|
|
1357
|
-
];
|
|
1358
|
-
if (this.fluid())
|
|
1359
|
-
array.push(`${className}--fluid`);
|
|
1360
|
-
return array.concat(this.controlClasses());
|
|
1361
|
-
}, /* @ts-ignore */
|
|
1362
|
-
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
1363
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ToggleGroup, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1364
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: ToggleGroup, isStandalone: true, selector: "tls-toggle-group", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, unselectable: { classPropertyName: "unselectable", publicName: "unselectable", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "group" }, properties: { "class": "classes()", "attr.aria-label": "ariaLabel() ?? null", "attr.aria-labelledby": "labelledBy()", "attr.aria-describedby": "describedBy()", "attr.aria-invalid": "invalid() ? 'true' : null" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => ToggleGroup) }], queries: [{ propertyName: "optionTemplate", first: true, predicate: ["option"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@for (option of normalizedOptions(); track option.value; let index = $index) {\n <button\n type=\"button\"\n class=\"tls-toggle-group__option\"\n [class.tls-toggle-group__option--selected]=\"isSelected(option.value)\"\n [class.tls-toggle-group__option--disabled]=\"option.disabled\"\n [attr.aria-pressed]=\"isSelected(option.value)\"\n [disabled]=\"disabled() || option.disabled\"\n (click)=\"select(option)\"\n (blur)=\"touched.set(true)\"\n >\n @if (optionTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"optionContext(option, index)\" />\n } @else {\n {{ option.label }}\n }\n </button>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
1365
|
-
}
|
|
1366
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ToggleGroup, decorators: [{
|
|
1367
|
-
type: Component,
|
|
1368
|
-
args: [{ selector: 'tls-toggle-group', imports: [NgTemplateOutlet], providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => ToggleGroup) }], host: {
|
|
1369
|
-
role: 'group',
|
|
1370
|
-
'[class]': 'classes()',
|
|
1371
|
-
'[attr.aria-label]': 'ariaLabel() ?? null',
|
|
1372
|
-
'[attr.aria-labelledby]': 'labelledBy()',
|
|
1373
|
-
'[attr.aria-describedby]': 'describedBy()',
|
|
1374
|
-
'[attr.aria-invalid]': "invalid() ? 'true' : null",
|
|
1375
|
-
}, template: "@for (option of normalizedOptions(); track option.value; let index = $index) {\n <button\n type=\"button\"\n class=\"tls-toggle-group__option\"\n [class.tls-toggle-group__option--selected]=\"isSelected(option.value)\"\n [class.tls-toggle-group__option--disabled]=\"option.disabled\"\n [attr.aria-pressed]=\"isSelected(option.value)\"\n [disabled]=\"disabled() || option.disabled\"\n (click)=\"select(option)\"\n (blur)=\"touched.set(true)\"\n >\n @if (optionTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"optionContext(option, index)\" />\n } @else {\n {{ option.label }}\n }\n </button>\n}\n" }]
|
|
1376
|
-
}], propDecorators: { multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], unselectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "unselectable", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], optionTemplate: [{ type: i0.ContentChild, args: ['option', { isSignal: true }] }] } });
|
|
1377
|
-
|
|
1378
|
-
const DAYS_IN_WEEK = 7;
|
|
1379
|
-
/**
|
|
1380
|
-
* Every day shown in a month grid for the month containing `anchor`, starting at the
|
|
1381
|
-
* first day of the first week (per `weekStartsOn`).
|
|
1382
|
-
*
|
|
1383
|
-
* With `weeks` omitted the span is the natural 5–6 weeks that cover the month. Passing a
|
|
1384
|
-
* fixed `weeks` count returns exactly that many weeks, so the grid height never reflows
|
|
1385
|
-
* between months.
|
|
1386
|
-
*/
|
|
1387
|
-
const buildMonthDays = (anchor, weekStartsOn, weeks) => {
|
|
1388
|
-
const start = startOfWeek(startOfMonth(anchor), { weekStartsOn });
|
|
1389
|
-
const end = weeks === undefined
|
|
1390
|
-
? endOfWeek(endOfMonth(anchor), { weekStartsOn })
|
|
1391
|
-
: addDays(start, weeks * DAYS_IN_WEEK - 1);
|
|
1392
|
-
return eachDayOfInterval({ start, end });
|
|
1393
|
-
};
|
|
1394
|
-
|
|
1395
|
-
const OVERLAY_POSITION_MAP = {
|
|
1396
|
-
top: {
|
|
1397
|
-
originX: 'center',
|
|
1398
|
-
originY: 'top',
|
|
1399
|
-
overlayX: 'center',
|
|
1400
|
-
overlayY: 'bottom',
|
|
1401
|
-
offsetX: 0,
|
|
1402
|
-
offsetY: -1,
|
|
1403
|
-
},
|
|
1404
|
-
right: {
|
|
1405
|
-
originX: 'end',
|
|
1406
|
-
originY: 'center',
|
|
1407
|
-
overlayX: 'start',
|
|
1408
|
-
overlayY: 'center',
|
|
1409
|
-
offsetX: 1,
|
|
1410
|
-
offsetY: 0,
|
|
1411
|
-
},
|
|
1412
|
-
bottom: {
|
|
1413
|
-
originX: 'center',
|
|
1414
|
-
originY: 'bottom',
|
|
1415
|
-
overlayX: 'center',
|
|
1416
|
-
overlayY: 'top',
|
|
1417
|
-
offsetX: 1,
|
|
1418
|
-
offsetY: 1,
|
|
1419
|
-
},
|
|
1420
|
-
left: {
|
|
1421
|
-
originX: 'start',
|
|
1422
|
-
originY: 'center',
|
|
1423
|
-
overlayX: 'end',
|
|
1424
|
-
overlayY: 'center',
|
|
1425
|
-
offsetX: -1,
|
|
1426
|
-
offsetY: 0,
|
|
1427
|
-
},
|
|
1428
|
-
'top-start': {
|
|
1429
|
-
originX: 'start',
|
|
1430
|
-
originY: 'top',
|
|
1431
|
-
overlayX: 'start',
|
|
1432
|
-
overlayY: 'bottom',
|
|
1433
|
-
offsetX: 0,
|
|
1434
|
-
offsetY: -1,
|
|
1435
|
-
},
|
|
1436
|
-
'top-end': {
|
|
1437
|
-
originX: 'end',
|
|
1438
|
-
originY: 'top',
|
|
1439
|
-
overlayX: 'end',
|
|
1440
|
-
overlayY: 'bottom',
|
|
1441
|
-
offsetX: 0,
|
|
1442
|
-
offsetY: -1,
|
|
1443
|
-
},
|
|
1444
|
-
'right-start': {
|
|
1445
|
-
originX: 'end',
|
|
1446
|
-
originY: 'top',
|
|
1447
|
-
overlayX: 'start',
|
|
1448
|
-
overlayY: 'top',
|
|
1449
|
-
offsetX: 1,
|
|
1450
|
-
offsetY: 0,
|
|
1451
|
-
},
|
|
1452
|
-
'right-end': {
|
|
1453
|
-
originX: 'end',
|
|
1454
|
-
originY: 'bottom',
|
|
1455
|
-
overlayX: 'start',
|
|
1456
|
-
overlayY: 'bottom',
|
|
1457
|
-
offsetX: 1,
|
|
1458
|
-
offsetY: 0,
|
|
1459
|
-
},
|
|
1460
|
-
'bottom-start': {
|
|
1461
|
-
originX: 'start',
|
|
1462
|
-
originY: 'bottom',
|
|
1463
|
-
overlayX: 'start',
|
|
1464
|
-
overlayY: 'top',
|
|
1465
|
-
offsetX: 0,
|
|
1466
|
-
offsetY: 1,
|
|
1467
|
-
},
|
|
1468
|
-
'bottom-end': {
|
|
1469
|
-
originX: 'end',
|
|
1470
|
-
originY: 'bottom',
|
|
1471
|
-
overlayX: 'end',
|
|
1472
|
-
overlayY: 'top',
|
|
1473
|
-
offsetX: 0,
|
|
1474
|
-
offsetY: 1,
|
|
1475
|
-
},
|
|
1476
|
-
'left-start': {
|
|
1477
|
-
originX: 'start',
|
|
1478
|
-
originY: 'top',
|
|
1479
|
-
overlayX: 'end',
|
|
1480
|
-
overlayY: 'top',
|
|
1481
|
-
offsetX: -1,
|
|
1482
|
-
offsetY: 0,
|
|
1483
|
-
},
|
|
1484
|
-
'left-end': {
|
|
1485
|
-
originX: 'start',
|
|
1486
|
-
originY: 'bottom',
|
|
1487
|
-
overlayX: 'end',
|
|
1488
|
-
overlayY: 'bottom',
|
|
1489
|
-
offsetX: -1,
|
|
1490
|
-
offsetY: 0,
|
|
1491
|
-
},
|
|
1492
|
-
'top-left': {
|
|
1493
|
-
originX: 'start',
|
|
1494
|
-
originY: 'top',
|
|
1495
|
-
overlayX: 'end',
|
|
1496
|
-
overlayY: 'bottom',
|
|
1497
|
-
offsetX: -1,
|
|
1498
|
-
offsetY: -1,
|
|
1499
|
-
},
|
|
1500
|
-
'top-right': {
|
|
1501
|
-
originX: 'end',
|
|
1502
|
-
originY: 'top',
|
|
1503
|
-
overlayX: 'start',
|
|
1504
|
-
overlayY: 'bottom',
|
|
1505
|
-
offsetX: 1,
|
|
1506
|
-
offsetY: -1,
|
|
1507
|
-
},
|
|
1508
|
-
'bottom-left': {
|
|
1509
|
-
originX: 'start',
|
|
1510
|
-
originY: 'bottom',
|
|
1511
|
-
overlayX: 'end',
|
|
1512
|
-
overlayY: 'top',
|
|
1513
|
-
offsetX: -1,
|
|
1514
|
-
offsetY: 1,
|
|
1515
|
-
},
|
|
1516
|
-
'bottom-right': {
|
|
1517
|
-
originX: 'end',
|
|
1518
|
-
originY: 'bottom',
|
|
1519
|
-
overlayX: 'start',
|
|
1520
|
-
overlayY: 'top',
|
|
1521
|
-
offsetX: 1,
|
|
1522
|
-
offsetY: 1,
|
|
1523
|
-
},
|
|
1524
|
-
};
|
|
1525
|
-
|
|
1526
|
-
const buildOverlayPositions = (position, offset) => {
|
|
1527
|
-
const preferred = OVERLAY_POSITION_MAP[position];
|
|
1528
|
-
const rest = Object.values(OVERLAY_POSITION_MAP).filter(p => p !== preferred);
|
|
1529
|
-
const positions = [preferred, ...rest];
|
|
1530
|
-
return positions.map(position => ({
|
|
1531
|
-
...position,
|
|
1532
|
-
offsetX: Math.sign(position.offsetX ?? 0) * offset.x,
|
|
1533
|
-
offsetY: Math.sign(position.offsetY ?? 0) * offset.y,
|
|
1534
|
-
}));
|
|
1535
|
-
};
|
|
1536
|
-
|
|
1537
|
-
/**
|
|
1538
|
-
* A signal of the current time, refreshed every `intervalMs` (browser only), so
|
|
1539
|
-
* time-dependent computed's — a current-time indicator, a "today" highlight —
|
|
1540
|
-
* stay correct while the view is left open instead of freezing at first render.
|
|
1541
|
-
*
|
|
1542
|
-
* Must be called from an injection context (a field initializer or
|
|
1543
|
-
* constructor); the refresh interval is cleared when that context is destroyed.
|
|
1544
|
-
* On the server the signal holds the construction time and never ticks.
|
|
1545
|
-
*/
|
|
1546
|
-
const createNowSignal = (intervalMs) => {
|
|
1547
|
-
const now = signal(new Date(), /* @ts-ignore */
|
|
1548
|
-
...(ngDevMode ? [{ debugName: "now" }] : /* istanbul ignore next */ []));
|
|
1549
|
-
if (isPlatformBrowser(inject(PLATFORM_ID))) {
|
|
1550
|
-
const handle = setInterval(() => now.set(new Date()), intervalMs);
|
|
1551
|
-
inject(DestroyRef).onDestroy(() => clearInterval(handle));
|
|
1552
|
-
}
|
|
1553
|
-
return now.asReadonly();
|
|
1554
|
-
};
|
|
1555
|
-
|
|
1556
|
-
/** Escapes RegExp metacharacters so the string matches literally inside a pattern. */
|
|
1557
|
-
const escapeRegularExpression = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
1558
|
-
|
|
1559
|
-
/** Reorders Sunday-first weekday labels so the one for `weekStartsOn` comes first. */
|
|
1560
|
-
const rotateWeekDays = (weekDays, weekStartsOn) => [
|
|
1561
|
-
...weekDays.slice(weekStartsOn),
|
|
1562
|
-
...weekDays.slice(0, weekStartsOn),
|
|
1563
|
-
];
|
|
2335
|
+
classes = computed(() => {
|
|
2336
|
+
const className = this.CLASS_NAME;
|
|
2337
|
+
const array = [
|
|
2338
|
+
className,
|
|
2339
|
+
`${className}--${this.size()}`,
|
|
2340
|
+
`${className}--${this.color()}`,
|
|
2341
|
+
`${className}--${this.variant()}`,
|
|
2342
|
+
`${className}--${this.orientation()}`,
|
|
2343
|
+
];
|
|
2344
|
+
if (this.fluid())
|
|
2345
|
+
array.push(`${className}--fluid`);
|
|
2346
|
+
return array.concat(this.controlClasses());
|
|
2347
|
+
}, /* @ts-ignore */
|
|
2348
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
2349
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ToggleGroup, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2350
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: ToggleGroup, isStandalone: true, selector: "tls-toggle-group", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, unselectable: { classPropertyName: "unselectable", publicName: "unselectable", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "group" }, properties: { "class": "classes()", "attr.aria-label": "ariaLabel() ?? null", "attr.aria-labelledby": "labelledBy()", "attr.aria-describedby": "describedBy()", "attr.aria-invalid": "invalid() ? 'true' : null" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => ToggleGroup) }], queries: [{ propertyName: "optionTemplate", first: true, predicate: ["option"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@for (option of normalizedOptions(); track option.value; let index = $index) {\n <button\n type=\"button\"\n class=\"tls-toggle-group__option\"\n [class.tls-toggle-group__option--selected]=\"isSelected(option.value)\"\n [class.tls-toggle-group__option--disabled]=\"option.disabled\"\n [attr.aria-pressed]=\"isSelected(option.value)\"\n [disabled]=\"disabled() || option.disabled\"\n (click)=\"select(option)\"\n (blur)=\"touched.set(true)\"\n >\n @if (optionTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"optionContext(option, index)\" />\n } @else {\n {{ option.label }}\n }\n </button>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
2351
|
+
}
|
|
2352
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ToggleGroup, decorators: [{
|
|
2353
|
+
type: Component,
|
|
2354
|
+
args: [{ selector: 'tls-toggle-group', imports: [NgTemplateOutlet], providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => ToggleGroup) }], host: {
|
|
2355
|
+
role: 'group',
|
|
2356
|
+
'[class]': 'classes()',
|
|
2357
|
+
'[attr.aria-label]': 'ariaLabel() ?? null',
|
|
2358
|
+
'[attr.aria-labelledby]': 'labelledBy()',
|
|
2359
|
+
'[attr.aria-describedby]': 'describedBy()',
|
|
2360
|
+
'[attr.aria-invalid]': "invalid() ? 'true' : null",
|
|
2361
|
+
}, template: "@for (option of normalizedOptions(); track option.value; let index = $index) {\n <button\n type=\"button\"\n class=\"tls-toggle-group__option\"\n [class.tls-toggle-group__option--selected]=\"isSelected(option.value)\"\n [class.tls-toggle-group__option--disabled]=\"option.disabled\"\n [attr.aria-pressed]=\"isSelected(option.value)\"\n [disabled]=\"disabled() || option.disabled\"\n (click)=\"select(option)\"\n (blur)=\"touched.set(true)\"\n >\n @if (optionTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"optionContext(option, index)\" />\n } @else {\n {{ option.label }}\n }\n </button>\n}\n" }]
|
|
2362
|
+
}], propDecorators: { multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], unselectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "unselectable", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], optionTemplate: [{ type: i0.ContentChild, args: ['option', { isSignal: true }] }] } });
|
|
1564
2363
|
|
|
1565
2364
|
/** Days in a calendar week. */
|
|
1566
2365
|
const DAYS_PER_WEEK = 7;
|
|
@@ -7759,256 +8558,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
7759
8558
|
}, template: "<div\n [class]=\"regionClasses()\"\n role=\"region\"\n [attr.aria-label]=\"regionLabel()\"\n [style.height.px]=\"regionHeight()\"\n (pointerenter)=\"onPointerEnter()\"\n (pointerleave)=\"onPointerLeave($event)\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut()\"\n>\n @for (toast of toasts(); track toast.id; let index = $index) {\n <tls-toast\n #toastEl\n [style.transform]=\"layouts()[index].transform\"\n [style.z-index]=\"layouts()[index].zIndex\"\n [style.--tls-toast-depth-opacity]=\"layouts()[index].depthOpacity\"\n [message]=\"toast.message\"\n [title]=\"toast.title\"\n [color]=\"toast.color\"\n [duration]=\"toast.duration\"\n [paused]=\"paused()\"\n [closable]=\"toast.closable\"\n [showIcon]=\"toast.showIcon\"\n [showProgress]=\"toast.showProgress\"\n [action]=\"toast.action\"\n [ariaLabel]=\"toast.ariaLabel\"\n [dismissLabel]=\"dismissLabel()\"\n (dismissed)=\"onDismiss(toast.id)\"\n (actionTriggered)=\"onAction(toast)\"\n ></tls-toast>\n }\n</div>\n" }]
|
|
7760
8559
|
}], ctorParameters: () => [], propDecorators: { _toastElements: [{ type: i0.ViewChildren, args: ['toastEl', { ...{ read: ElementRef }, isSignal: true }] }] } });
|
|
7761
8560
|
|
|
7762
|
-
class Tooltip {
|
|
7763
|
-
static _counter = 0;
|
|
7764
|
-
id = `tls-tooltip-${++Tooltip._counter}`;
|
|
7765
|
-
content = model.required(/* @ts-ignore */
|
|
7766
|
-
...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
|
|
7767
|
-
templateData = model(null, /* @ts-ignore */
|
|
7768
|
-
...(ngDevMode ? [{ debugName: "templateData" }] : /* istanbul ignore next */ []));
|
|
7769
|
-
color = model.required(/* @ts-ignore */
|
|
7770
|
-
...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
7771
|
-
isString = computed(() => typeof this.content() === 'string', /* @ts-ignore */
|
|
7772
|
-
...(ngDevMode ? [{ debugName: "isString" }] : /* istanbul ignore next */ []));
|
|
7773
|
-
templateRef = computed(() => {
|
|
7774
|
-
if (this.isString())
|
|
7775
|
-
return null;
|
|
7776
|
-
return this.content();
|
|
7777
|
-
}, /* @ts-ignore */
|
|
7778
|
-
...(ngDevMode ? [{ debugName: "templateRef" }] : /* istanbul ignore next */ []));
|
|
7779
|
-
hostClasses = computed(() => {
|
|
7780
|
-
const className = 'tls-tooltip';
|
|
7781
|
-
const array = [className];
|
|
7782
|
-
array.push(`${className}--${this.color()}`);
|
|
7783
|
-
return array;
|
|
7784
|
-
}, /* @ts-ignore */
|
|
7785
|
-
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
7786
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Tooltip, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7787
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Tooltip, isStandalone: true, selector: "tls-tooltip", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, templateData: { classPropertyName: "templateData", publicName: "templateData", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { content: "contentChange", templateData: "templateDataChange", color: "colorChange" }, host: { attributes: { "role": "tooltip", "animate.enter": "tls-tooltip--enter", "animate.leave": "tls-tooltip--leave" }, properties: { "class": "hostClasses()", "id": "id" } }, ngImport: i0, template: `
|
|
7788
|
-
@if (isString()) {
|
|
7789
|
-
{{ content() }}
|
|
7790
|
-
} @else {
|
|
7791
|
-
<ng-container
|
|
7792
|
-
[ngTemplateOutlet]="templateRef()"
|
|
7793
|
-
[ngTemplateOutletContext]="{ $implicit: templateData() }"
|
|
7794
|
-
></ng-container>
|
|
7795
|
-
}
|
|
7796
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
7797
|
-
}
|
|
7798
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Tooltip, decorators: [{
|
|
7799
|
-
type: Component,
|
|
7800
|
-
args: [{
|
|
7801
|
-
selector: 'tls-tooltip',
|
|
7802
|
-
template: `
|
|
7803
|
-
@if (isString()) {
|
|
7804
|
-
{{ content() }}
|
|
7805
|
-
} @else {
|
|
7806
|
-
<ng-container
|
|
7807
|
-
[ngTemplateOutlet]="templateRef()"
|
|
7808
|
-
[ngTemplateOutletContext]="{ $implicit: templateData() }"
|
|
7809
|
-
></ng-container>
|
|
7810
|
-
}
|
|
7811
|
-
`,
|
|
7812
|
-
imports: [NgTemplateOutlet],
|
|
7813
|
-
host: {
|
|
7814
|
-
'[class]': 'hostClasses()',
|
|
7815
|
-
'role': 'tooltip',
|
|
7816
|
-
'[id]': 'id',
|
|
7817
|
-
'animate.enter': 'tls-tooltip--enter',
|
|
7818
|
-
'animate.leave': 'tls-tooltip--leave',
|
|
7819
|
-
},
|
|
7820
|
-
}]
|
|
7821
|
-
}], propDecorators: { content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: true }] }, { type: i0.Output, args: ["contentChange"] }], templateData: [{ type: i0.Input, args: [{ isSignal: true, alias: "templateData", required: false }] }, { type: i0.Output, args: ["templateDataChange"] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: true }] }, { type: i0.Output, args: ["colorChange"] }] } });
|
|
7822
|
-
|
|
7823
|
-
class TooltipService {
|
|
7824
|
-
_overlay = inject(Overlay);
|
|
7825
|
-
_overlayRef = null;
|
|
7826
|
-
// Public methods
|
|
7827
|
-
show(origin, positions, tooltipPortal) {
|
|
7828
|
-
this.dispose();
|
|
7829
|
-
const positionStrategy = this._overlay
|
|
7830
|
-
.position()
|
|
7831
|
-
.flexibleConnectedTo(origin)
|
|
7832
|
-
.withPositions(positions);
|
|
7833
|
-
this._overlayRef = this._overlay.create({
|
|
7834
|
-
positionStrategy,
|
|
7835
|
-
scrollStrategy: this._overlay.scrollStrategies.reposition(),
|
|
7836
|
-
});
|
|
7837
|
-
return this._overlayRef.attach(tooltipPortal);
|
|
7838
|
-
}
|
|
7839
|
-
move(origin, positions) {
|
|
7840
|
-
if (this._overlayRef) {
|
|
7841
|
-
const positionStrategy = this._overlay
|
|
7842
|
-
.position()
|
|
7843
|
-
.flexibleConnectedTo(origin)
|
|
7844
|
-
.withPositions(positions);
|
|
7845
|
-
this._overlayRef.updatePositionStrategy(positionStrategy);
|
|
7846
|
-
}
|
|
7847
|
-
}
|
|
7848
|
-
// Detaches the tooltip so Angular's `animate.leave` plays the exit animation,
|
|
7849
|
-
// then disposes the pane once that animation finishes. The pane is kept alive
|
|
7850
|
-
// in the meantime so it is not torn down mid-animation.
|
|
7851
|
-
hide() {
|
|
7852
|
-
if (!this._overlayRef)
|
|
7853
|
-
return;
|
|
7854
|
-
const overlayRef = this._overlayRef;
|
|
7855
|
-
this._overlayRef = null;
|
|
7856
|
-
overlayRef.detach();
|
|
7857
|
-
disposeAfterLeaveAnimation(overlayRef);
|
|
7858
|
-
}
|
|
7859
|
-
dispose() {
|
|
7860
|
-
if (!this._overlayRef)
|
|
7861
|
-
return;
|
|
7862
|
-
this._overlayRef.dispose();
|
|
7863
|
-
this._overlayRef = null;
|
|
7864
|
-
}
|
|
7865
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
7866
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipService });
|
|
7867
|
-
}
|
|
7868
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipService, decorators: [{
|
|
7869
|
-
type: Injectable
|
|
7870
|
-
}] });
|
|
7871
|
-
|
|
7872
|
-
const DEFAULT_TOOLTIP_CONFIG = {
|
|
7873
|
-
positions: undefined,
|
|
7874
|
-
position: 'top',
|
|
7875
|
-
offset: { x: 4, y: 4 },
|
|
7876
|
-
origin: 'element',
|
|
7877
|
-
color: 'secondary',
|
|
7878
|
-
};
|
|
7879
|
-
|
|
7880
|
-
const TOOLTIP_CONFIG = new InjectionToken('TOOLTIP_CONFIG', {
|
|
7881
|
-
factory: () => DEFAULT_TOOLTIP_CONFIG,
|
|
7882
|
-
});
|
|
7883
|
-
|
|
7884
|
-
/**
|
|
7885
|
-
* Attaches a tooltip to the host element. Shows on hover and on keyboard focus,
|
|
7886
|
-
* toggles on touch, and dismisses on Escape without moving the pointer or focus
|
|
7887
|
-
* (WCAG 1.4.13). The tooltip is linked to the host via `aria-describedby` while
|
|
7888
|
-
* visible.
|
|
7889
|
-
*
|
|
7890
|
-
* Interaction is driven by pointer events, branching on `pointerType`: mouse
|
|
7891
|
-
* and pen get hover semantics, touch gets tap-to-toggle. A single stream avoids
|
|
7892
|
-
* the synthesized mouse events browsers replay after a tap.
|
|
7893
|
-
*/
|
|
7894
|
-
class TooltipDirective {
|
|
7895
|
-
_tooltipService = inject(TooltipService);
|
|
7896
|
-
_elementRef = inject(ElementRef);
|
|
7897
|
-
_renderer = inject(Renderer2);
|
|
7898
|
-
_config = inject(TOOLTIP_CONFIG);
|
|
7899
|
-
content = input('', { ...(ngDevMode ? { debugName: "content" } : /* istanbul ignore next */ {}), alias: 'tlsTooltip' });
|
|
7900
|
-
data = input(null, /* @ts-ignore */
|
|
7901
|
-
...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
7902
|
-
tooltipDisabled = input(false, /* @ts-ignore */
|
|
7903
|
-
...(ngDevMode ? [{ debugName: "tooltipDisabled" }] : /* istanbul ignore next */ []));
|
|
7904
|
-
tooltipOrigin = input(this._config.origin, /* @ts-ignore */
|
|
7905
|
-
...(ngDevMode ? [{ debugName: "tooltipOrigin" }] : /* istanbul ignore next */ []));
|
|
7906
|
-
tooltipPositions = input(this._config.positions, /* @ts-ignore */
|
|
7907
|
-
...(ngDevMode ? [{ debugName: "tooltipPositions" }] : /* istanbul ignore next */ []));
|
|
7908
|
-
tooltipPosition = input(this._config.position, /* @ts-ignore */
|
|
7909
|
-
...(ngDevMode ? [{ debugName: "tooltipPosition" }] : /* istanbul ignore next */ []));
|
|
7910
|
-
tooltipOffset = input(this._config.offset, /* @ts-ignore */
|
|
7911
|
-
...(ngDevMode ? [{ debugName: "tooltipOffset" }] : /* istanbul ignore next */ []));
|
|
7912
|
-
tooltipColor = input(this._config.color, /* @ts-ignore */
|
|
7913
|
-
...(ngDevMode ? [{ debugName: "tooltipColor" }] : /* istanbul ignore next */ []));
|
|
7914
|
-
_visible = signal(false, /* @ts-ignore */
|
|
7915
|
-
...(ngDevMode ? [{ debugName: "_visible" }] : /* istanbul ignore next */ []));
|
|
7916
|
-
_positions = computed(() => {
|
|
7917
|
-
const positions = this.tooltipPositions();
|
|
7918
|
-
if (positions)
|
|
7919
|
-
return positions;
|
|
7920
|
-
return buildOverlayPositions(this.tooltipPosition(), this.tooltipOffset());
|
|
7921
|
-
}, /* @ts-ignore */
|
|
7922
|
-
...(ngDevMode ? [{ debugName: "_positions" }] : /* istanbul ignore next */ []));
|
|
7923
|
-
// Protected methods
|
|
7924
|
-
onPointerEnter(event) {
|
|
7925
|
-
// A touch "enter" is a tap, not a hover — toggle instead. The default is
|
|
7926
|
-
// not prevented, so the tap still activates an interactive host.
|
|
7927
|
-
if (event.pointerType === 'touch') {
|
|
7928
|
-
if (this._visible()) {
|
|
7929
|
-
this._hide();
|
|
7930
|
-
}
|
|
7931
|
-
else {
|
|
7932
|
-
this._show();
|
|
7933
|
-
}
|
|
7934
|
-
return;
|
|
7935
|
-
}
|
|
7936
|
-
this._show({ x: event.clientX, y: event.clientY });
|
|
7937
|
-
}
|
|
7938
|
-
onPointerMove(event) {
|
|
7939
|
-
if (event.pointerType === 'touch')
|
|
7940
|
-
return;
|
|
7941
|
-
if (this.tooltipOrigin() === 'cursor') {
|
|
7942
|
-
this._tooltipService.move({ x: event.clientX, y: event.clientY }, this._positions());
|
|
7943
|
-
}
|
|
7944
|
-
}
|
|
7945
|
-
onPointerLeave(event) {
|
|
7946
|
-
// A tap retires its pointer immediately, firing `pointerleave` within the
|
|
7947
|
-
// same gesture; hiding here would undo the toggle the tap just made.
|
|
7948
|
-
if (event.pointerType === 'touch')
|
|
7949
|
-
return;
|
|
7950
|
-
this._hide();
|
|
7951
|
-
}
|
|
7952
|
-
onFocus() {
|
|
7953
|
-
// No cursor to anchor to; a focus-triggered tooltip always anchors to the element.
|
|
7954
|
-
this._show();
|
|
7955
|
-
}
|
|
7956
|
-
onBlur() {
|
|
7957
|
-
this._hide();
|
|
7958
|
-
}
|
|
7959
|
-
/** Dismisses the tooltip without moving the pointer or focus (WCAG 1.4.13). */
|
|
7960
|
-
onEscape() {
|
|
7961
|
-
if (this._visible())
|
|
7962
|
-
this._hide();
|
|
7963
|
-
}
|
|
7964
|
-
// Private methods
|
|
7965
|
-
_show(point) {
|
|
7966
|
-
if (this.tooltipDisabled() || this._visible())
|
|
7967
|
-
return;
|
|
7968
|
-
// Nothing to render — an empty string would show a bare bubble.
|
|
7969
|
-
const content = this.content();
|
|
7970
|
-
if (content === '')
|
|
7971
|
-
return;
|
|
7972
|
-
this._visible.set(true);
|
|
7973
|
-
const tooltipPortal = new ComponentPortal(Tooltip);
|
|
7974
|
-
const origin = this.tooltipOrigin() === 'cursor' && point ? point : this._elementRef.nativeElement;
|
|
7975
|
-
const tooltipRef = this._tooltipService.show(origin, this._positions(), tooltipPortal);
|
|
7976
|
-
tooltipRef.instance.content.set(content);
|
|
7977
|
-
tooltipRef.instance.templateData.set(this.data());
|
|
7978
|
-
tooltipRef.instance.color.set(this.tooltipColor());
|
|
7979
|
-
this._renderer.setAttribute(this._elementRef.nativeElement, 'aria-describedby', tooltipRef.instance.id);
|
|
7980
|
-
}
|
|
7981
|
-
_hide() {
|
|
7982
|
-
if (!this._visible())
|
|
7983
|
-
return;
|
|
7984
|
-
this._tooltipService.hide();
|
|
7985
|
-
this._visible.set(false);
|
|
7986
|
-
this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');
|
|
7987
|
-
}
|
|
7988
|
-
// Lifecycle
|
|
7989
|
-
ngOnDestroy() {
|
|
7990
|
-
this._tooltipService.dispose();
|
|
7991
|
-
this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');
|
|
7992
|
-
}
|
|
7993
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
7994
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: TooltipDirective, isStandalone: true, selector: "[tlsTooltip]", inputs: { content: { classPropertyName: "content", publicName: "tlsTooltip", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, tooltipDisabled: { classPropertyName: "tooltipDisabled", publicName: "tooltipDisabled", isSignal: true, isRequired: false, transformFunction: null }, tooltipOrigin: { classPropertyName: "tooltipOrigin", publicName: "tooltipOrigin", isSignal: true, isRequired: false, transformFunction: null }, tooltipPositions: { classPropertyName: "tooltipPositions", publicName: "tooltipPositions", isSignal: true, isRequired: false, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, tooltipOffset: { classPropertyName: "tooltipOffset", publicName: "tooltipOffset", isSignal: true, isRequired: false, transformFunction: null }, tooltipColor: { classPropertyName: "tooltipColor", publicName: "tooltipColor", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "pointerenter": "onPointerEnter($event)", "pointermove": "onPointerMove($event)", "pointerleave": "onPointerLeave($event)", "focus": "onFocus()", "blur": "onBlur()", "document:keydown.escape": "onEscape()" } }, providers: [TooltipService], ngImport: i0 });
|
|
7995
|
-
}
|
|
7996
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipDirective, decorators: [{
|
|
7997
|
-
type: Directive,
|
|
7998
|
-
args: [{
|
|
7999
|
-
selector: '[tlsTooltip]',
|
|
8000
|
-
providers: [TooltipService],
|
|
8001
|
-
host: {
|
|
8002
|
-
'(pointerenter)': 'onPointerEnter($event)',
|
|
8003
|
-
'(pointermove)': 'onPointerMove($event)',
|
|
8004
|
-
'(pointerleave)': 'onPointerLeave($event)',
|
|
8005
|
-
'(focus)': 'onFocus()',
|
|
8006
|
-
'(blur)': 'onBlur()',
|
|
8007
|
-
'(document:keydown.escape)': 'onEscape()',
|
|
8008
|
-
},
|
|
8009
|
-
}]
|
|
8010
|
-
}], propDecorators: { content: [{ type: i0.Input, args: [{ isSignal: true, alias: "tlsTooltip", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], tooltipDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipDisabled", required: false }] }], tooltipOrigin: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipOrigin", required: false }] }], tooltipPositions: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPositions", required: false }] }], tooltipPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPosition", required: false }] }], tooltipOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipOffset", required: false }] }], tooltipColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipColor", required: false }] }] } });
|
|
8011
|
-
|
|
8012
8561
|
// Features
|
|
8013
8562
|
|
|
8014
8563
|
const provideThalassicUIConfig = (config = {}) => {
|
|
@@ -8042,6 +8591,12 @@ const provideThalassicUIConfig = (config = {}) => {
|
|
|
8042
8591
|
useValue: deepMerge(DEFAULT_FORM_CONTROL_CONFIG, config.formControl),
|
|
8043
8592
|
},
|
|
8044
8593
|
// Components
|
|
8594
|
+
{
|
|
8595
|
+
provide: ACTIVITY_HEATMAP_CONFIG,
|
|
8596
|
+
// `labels` is a deep-partial override; deepMerge merges it recursively, but its
|
|
8597
|
+
// `Partial<T>` signature only models a shallow partial, so cast to it.
|
|
8598
|
+
useValue: deepMerge(DEFAULT_ACTIVITY_HEATMAP_CONFIG, components.activityHeatmap),
|
|
8599
|
+
},
|
|
8045
8600
|
{
|
|
8046
8601
|
provide: ALERT_CONFIG,
|
|
8047
8602
|
useValue: deepMerge(DEFAULT_ALERT_CONFIG, components.alert),
|
|
@@ -8202,5 +8757,5 @@ const provideThalassicUIConfig = (config = {}) => {
|
|
|
8202
8757
|
* Generated bundle index. Do not edit.
|
|
8203
8758
|
*/
|
|
8204
8759
|
|
|
8205
|
-
export { ALERT_CONFIG, AUTOCOMPLETE_CONFIG, Alert, Autocomplete, BADGE_CONFIG, BREADCRUMBS_CONFIG, BUTTON_CONFIG, Badge, Breadcrumbs, Button, ButtonDirective, CALENDAR_CONFIG, CHECKBOX_CONFIG, CHIP_CONFIG, CHIP_CONTROL_CONFIG, CHIP_GROUP_CONFIG, CHIP_INPUT_CONFIG, CONFIRM_CONFIG, Calendar, CalendarAgendaView, CalendarEventItem, CalendarMonthView, CalendarTimeGrid, Checkbox, CheckboxFormControl, Chip, ChipControl, ChipGroup, ChipInput, Confirm, ConfirmPanel, ConfirmService, ContextMenuDirective, DATE_TIME_PICKER_CONFIG, DEFAULT_ALERT_CONFIG, DEFAULT_AUTOCOMPLETE_CONFIG, DEFAULT_BADGE_CONFIG, DEFAULT_BREADCRUMBS_CONFIG, DEFAULT_BUTTON_CONFIG, DEFAULT_CALENDAR_CONFIG, DEFAULT_CHECKBOX_CONFIG, DEFAULT_CHIP_CONFIG, DEFAULT_CHIP_CONTROL_CONFIG, DEFAULT_CHIP_GROUP_CONFIG, DEFAULT_CHIP_INPUT_CONFIG, DEFAULT_CONFIRM_CONFIG, DEFAULT_DATE_TIME_PICKER_CONFIG, DEFAULT_DIALOG_CONFIG, DEFAULT_DIVIDER_CONFIG, DEFAULT_DRAWER_CONFIG, DEFAULT_FILE_INPUT_CONFIG, DEFAULT_FORM_CONTROL_CONFIG, DEFAULT_FORM_CONTROL_GROUP_CONFIG, DEFAULT_FORM_ITEM_CONFIG, DEFAULT_HIGHLIGHT_CONFIG, DEFAULT_ICONS, DEFAULT_ICON_CONFIG, DEFAULT_IMAGE_COMPARE_CONFIG, DEFAULT_INPUT_CONFIG, DEFAULT_INPUT_NUMBER_CONFIG, DEFAULT_KBD_CONFIG, DEFAULT_LOADER_CONFIG, DEFAULT_MARK_CONFIG, DEFAULT_MENU_CONFIG, DEFAULT_MULTI_SELECT_CONFIG, DEFAULT_ODOMETER_CONFIG, DEFAULT_PAGINATION_CONFIG, DEFAULT_PAGINATION_QUERY_SYNC_CONFIG, DEFAULT_PASSWORD_CONFIG, DEFAULT_PIN_INPUT_CONFIG, DEFAULT_POPOVER_CONFIG, DEFAULT_RADIO_BUTTON_CONFIG, DEFAULT_SELECT_CONFIG, DEFAULT_SKELETON_CONFIG, DEFAULT_SPLITTER_CONFIG, DEFAULT_STEPPER_CONFIG, DEFAULT_STEP_CONFIG, DEFAULT_SWITCH_CONFIG, DEFAULT_TABLE_CONFIG, DEFAULT_TABS_CONFIG, DEFAULT_TABS_QUERY_SYNC_CONFIG, DEFAULT_TAB_NAV_CONFIG, DEFAULT_TEXTAREA_CONFIG, DEFAULT_TOAST_CONFIG, DEFAULT_TOGGLE_BUTTON_CONFIG, DEFAULT_TOGGLE_GROUP_CONFIG, DEFAULT_TOOLTIP_CONFIG, DIALOG_CONFIG, DIVIDER_CONFIG, DRAWER_CONFIG, DateTimePicker, Dialog, DialogService, Divider, Drawer, DrawerRef, DrawerService, FILE_INPUT_CONFIG, FORM_CONTROL_CONFIG, FORM_CONTROL_GROUP_CONFIG, FORM_ITEM_CONFIG, FileInput, FormControl, FormControlAddon, FormControlGroup, FormItem, HIGHLIGHT_CONFIG, Highlight, ICON_CONFIG, ICON_REGISTRY, IMAGE_COMPARE_CONFIG, INPUT_CONFIG, INPUT_NUMBER_CONFIG, Icon, IconRegistry, IconService, ImageCompare, Input, InputDirective, InputNumber, KBD_CONFIG, Kbd, LOADER_CONFIG, Loader, MARK_CONFIG, MASK_TOKENS, MENU_CONFIG, MULTI_SELECT_CONFIG, Mark, MaskDirective, Menu, MenuItemComponent, MenuTriggerDirective, MultiSelect, ODOMETER_CONFIG, Odometer, PAGINATION_CONFIG, PAGINATION_QUERY_SYNC_CONFIG, PASSWORD_CONFIG, PIN_INPUT_CONFIG, POPOVER_CONFIG, Pagination, PaginationQuerySyncDirective, Password, PinInput, Popover, RADIO_BUTTON_CONFIG, RadioButton, SELECT_CONFIG, SKELETON_CONFIG, SPLITTER_CONFIG, STEPPER_CONFIG, SWITCH_CONFIG, Select, Skeleton, Splitter, SplitterPanel, Step, Stepper, Switch, TABLE_CONFIG, TABS_CONFIG, TABS_QUERY_SYNC_CONFIG, TAB_NAV_CONFIG, TEXTAREA_CONFIG, TOAST_CONFIG, TOGGLE_BUTTON_CONFIG, TOGGLE_GROUP_CONFIG, TOOLTIP_CONFIG, Tab, TabLinkDirective, TabNavDirective, Table, TableColumn, Tabs, TabsQuerySyncDirective, Textarea, Toast, ToastOutlet, ToastService, ToggleButton, ToggleGroup, TooltipDirective, ValueFormControl, applyMask, provideThalassicIcons, provideThalassicUIConfig };
|
|
8760
|
+
export { ACTIVITY_HEATMAP_CONFIG, ALERT_CONFIG, AUTOCOMPLETE_CONFIG, ActivityHeatmap, Alert, Autocomplete, BADGE_CONFIG, BREADCRUMBS_CONFIG, BUTTON_CONFIG, Badge, Breadcrumbs, Button, ButtonDirective, CALENDAR_CONFIG, CHECKBOX_CONFIG, CHIP_CONFIG, CHIP_CONTROL_CONFIG, CHIP_GROUP_CONFIG, CHIP_INPUT_CONFIG, CONFIRM_CONFIG, Calendar, CalendarAgendaView, CalendarEventItem, CalendarMonthView, CalendarTimeGrid, Checkbox, CheckboxFormControl, Chip, ChipControl, ChipGroup, ChipInput, Confirm, ConfirmPanel, ConfirmService, ContextMenuDirective, DATE_TIME_PICKER_CONFIG, DEFAULT_ACTIVITY_HEATMAP_CONFIG, DEFAULT_ALERT_CONFIG, DEFAULT_AUTOCOMPLETE_CONFIG, DEFAULT_BADGE_CONFIG, DEFAULT_BREADCRUMBS_CONFIG, DEFAULT_BUTTON_CONFIG, DEFAULT_CALENDAR_CONFIG, DEFAULT_CHECKBOX_CONFIG, DEFAULT_CHIP_CONFIG, DEFAULT_CHIP_CONTROL_CONFIG, DEFAULT_CHIP_GROUP_CONFIG, DEFAULT_CHIP_INPUT_CONFIG, DEFAULT_CONFIRM_CONFIG, DEFAULT_DATE_TIME_PICKER_CONFIG, DEFAULT_DIALOG_CONFIG, DEFAULT_DIVIDER_CONFIG, DEFAULT_DRAWER_CONFIG, DEFAULT_FILE_INPUT_CONFIG, DEFAULT_FORM_CONTROL_CONFIG, DEFAULT_FORM_CONTROL_GROUP_CONFIG, DEFAULT_FORM_ITEM_CONFIG, DEFAULT_HIGHLIGHT_CONFIG, DEFAULT_ICONS, DEFAULT_ICON_CONFIG, DEFAULT_IMAGE_COMPARE_CONFIG, DEFAULT_INPUT_CONFIG, DEFAULT_INPUT_NUMBER_CONFIG, DEFAULT_KBD_CONFIG, DEFAULT_LOADER_CONFIG, DEFAULT_MARK_CONFIG, DEFAULT_MENU_CONFIG, DEFAULT_MULTI_SELECT_CONFIG, DEFAULT_ODOMETER_CONFIG, DEFAULT_PAGINATION_CONFIG, DEFAULT_PAGINATION_QUERY_SYNC_CONFIG, DEFAULT_PASSWORD_CONFIG, DEFAULT_PIN_INPUT_CONFIG, DEFAULT_POPOVER_CONFIG, DEFAULT_RADIO_BUTTON_CONFIG, DEFAULT_SELECT_CONFIG, DEFAULT_SKELETON_CONFIG, DEFAULT_SPLITTER_CONFIG, DEFAULT_STEPPER_CONFIG, DEFAULT_STEP_CONFIG, DEFAULT_SWITCH_CONFIG, DEFAULT_TABLE_CONFIG, DEFAULT_TABS_CONFIG, DEFAULT_TABS_QUERY_SYNC_CONFIG, DEFAULT_TAB_NAV_CONFIG, DEFAULT_TEXTAREA_CONFIG, DEFAULT_TOAST_CONFIG, DEFAULT_TOGGLE_BUTTON_CONFIG, DEFAULT_TOGGLE_GROUP_CONFIG, DEFAULT_TOOLTIP_CONFIG, DEFAULT_TOOLTIP_CONTENT_ATTRIBUTE, DIALOG_CONFIG, DIVIDER_CONFIG, DRAWER_CONFIG, DateTimePicker, Dialog, DialogService, Divider, Drawer, DrawerRef, DrawerService, FILE_INPUT_CONFIG, FORM_CONTROL, FORM_CONTROL_CONFIG, FORM_CONTROL_GROUP_CONFIG, FORM_ITEM_CONFIG, FileInput, FormControl, FormControlAddon, FormControlGroup, FormItem, HIGHLIGHT_CONFIG, Highlight, ICON_CONFIG, ICON_REGISTRY, IMAGE_COMPARE_CONFIG, INPUT_CONFIG, INPUT_NUMBER_CONFIG, Icon, IconRegistry, IconService, ImageCompare, Input, InputDirective, InputNumber, KBD_CONFIG, Kbd, LOADER_CONFIG, Loader, MARK_CONFIG, MASK_TOKENS, MENU_CONFIG, MULTI_SELECT_CONFIG, Mark, MaskDirective, Menu, MenuItemComponent, MenuTriggerDirective, MultiSelect, ODOMETER_CONFIG, Odometer, PAGINATION_CONFIG, PAGINATION_QUERY_SYNC_CONFIG, PASSWORD_CONFIG, PIN_INPUT_CONFIG, POPOVER_CONFIG, Pagination, PaginationQuerySyncDirective, Password, PinInput, Popover, RADIO_BUTTON_CONFIG, RadioButton, SELECT_CONFIG, SKELETON_CONFIG, SPLITTER_CONFIG, STEPPER_CONFIG, SWITCH_CONFIG, Select, Skeleton, Splitter, SplitterPanel, Step, Stepper, Switch, TABLE_CONFIG, TABS_CONFIG, TABS_QUERY_SYNC_CONFIG, TAB_NAV_CONFIG, TEXTAREA_CONFIG, TOAST_CONFIG, TOGGLE_BUTTON_CONFIG, TOGGLE_GROUP_CONFIG, TOOLTIP_CONFIG, Tab, TabLinkDirective, TabNavDirective, Table, TableColumn, Tabs, TabsQuerySyncDirective, Textarea, Toast, ToastOutlet, ToastService, ToggleButton, ToggleGroup, TooltipDelegateDirective, TooltipDirective, TooltipTrigger, ValueFormControl, aggregateActivityEntries, applyMask, buildActivityMonthSegments, buildActivityThresholds, provideThalassicIcons, provideThalassicUIConfig, resolveActivityLevel };
|
|
8206
8761
|
//# sourceMappingURL=thalassic-ui.mjs.map
|