@rivet-health/design-system 41.1.4 → 41.2.1
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.
|
@@ -4,8 +4,8 @@ import * as i1 from "@angular/common";
|
|
|
4
4
|
import { CommonModule, CurrencyPipe, DatePipe as DatePipe$1, DecimalPipe, PercentPipe } from "@angular/common";
|
|
5
5
|
import { BehaviorSubject, ReplaySubject, Subject, combineLatest, concatWith, connectable, distinctUntilChanged, filter, from, fromEvent, map, merge, mergeScan, of, scan, share, shareReplay, skip, skipUntil, startWith, switchMap, takeUntil, tap } from "rxjs";
|
|
6
6
|
import { timeDay, timeDays, timeMonth, timeMonths, timeSunday, timeWeek, timeYear, timeYears, utcDay, utcMonth, utcWeek, utcYear } from "d3-time";
|
|
7
|
-
import { timeFormat, utcFormat } from "d3-time-format";
|
|
8
7
|
import { cloneDeep, debounce, defaultsDeep, difference, flattenDeep, isEqual, isNumber, orderBy, partition, range, sortBy, sum, sumBy, toInteger, union, uniq, uniqueId } from "lodash";
|
|
8
|
+
import { timeFormat, utcFormat } from "d3-time-format";
|
|
9
9
|
import Fuse from "fuse.js";
|
|
10
10
|
import { animate, group, query, style, transition, trigger } from "@angular/animations";
|
|
11
11
|
import { distinctUntilChanged as distinctUntilChanged$1, map as map$1 } from "rxjs/operators";
|
|
@@ -5494,238 +5494,173 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5494
5494
|
CalendarComponent.defaultMin = timeYear.floor(timeYear.offset(/* @__PURE__ */ new Date(), -7));
|
|
5495
5495
|
CalendarComponent.defaultMax = timeDay.offset(timeYear.floor(timeYear.offset(/* @__PURE__ */ new Date(), 5)), -1);
|
|
5496
5496
|
})(CalendarComponent || (CalendarComponent = {}));
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
this.
|
|
5502
|
-
|
|
5503
|
-
this.
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
this.
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
this.
|
|
5513
|
-
|
|
5497
|
+
var DateComponent = class DateComponent extends InputLabelComponent {
|
|
5498
|
+
set value(v) {
|
|
5499
|
+
if (this._value?.getTime() === v?.getTime()) return;
|
|
5500
|
+
this._value = v;
|
|
5501
|
+
if (!this.hasFocus) this.syncInputText();
|
|
5502
|
+
if (v) this.setActiveMonth(v);
|
|
5503
|
+
this.cdr.markForCheck();
|
|
5504
|
+
}
|
|
5505
|
+
get value() {
|
|
5506
|
+
return this._value;
|
|
5507
|
+
}
|
|
5508
|
+
set open(v) {
|
|
5509
|
+
this.open$.next(v);
|
|
5510
|
+
}
|
|
5511
|
+
get open() {
|
|
5512
|
+
return this.open$.getValue();
|
|
5513
|
+
}
|
|
5514
|
+
constructor(cdr, host) {
|
|
5515
|
+
super();
|
|
5516
|
+
this.cdr = cdr;
|
|
5517
|
+
this.host = host;
|
|
5518
|
+
this.min = CalendarComponent.defaultMin;
|
|
5519
|
+
this.max = CalendarComponent.defaultMax;
|
|
5520
|
+
this.placeholder = "Select date";
|
|
5521
|
+
this.disabled = false;
|
|
5522
|
+
this.size = "medium";
|
|
5523
|
+
this.showClearButton = true;
|
|
5524
|
+
this.showTodayButton = true;
|
|
5525
|
+
this.activeYearMonth = timeMonth.floor(/* @__PURE__ */ new Date());
|
|
5514
5526
|
this.open$ = new BehaviorSubject(false);
|
|
5515
|
-
this.
|
|
5516
|
-
this.
|
|
5517
|
-
this.
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
}
|
|
5521
|
-
return date;
|
|
5522
|
-
})), this.userSelectedPreset$.pipe(filter((preset) => preset !== null), map((preset) => preset.dates))).pipe(shareReplay({
|
|
5523
|
-
refCount: true,
|
|
5524
|
-
bufferSize: 1
|
|
5525
|
-
}));
|
|
5526
|
-
this.filteredPresetOptions$ = combineLatest([
|
|
5527
|
-
this.min$,
|
|
5528
|
-
this.max$,
|
|
5529
|
-
this.alternativePresetList$
|
|
5530
|
-
]).pipe(map(([min, max, alternativePresetList]) => {
|
|
5531
|
-
const optionsFilteredOnMinMax = DateRangeComponent.Presets.filter((p) => p.dates[0].valueOf() >= min.valueOf() && p.dates[1].valueOf() <= max.valueOf());
|
|
5532
|
-
if (alternativePresetList.length == 0) return optionsFilteredOnMinMax;
|
|
5533
|
-
else return optionsFilteredOnMinMax.filter((p) => alternativePresetList.includes(p.id));
|
|
5534
|
-
}), shareReplay({
|
|
5535
|
-
refCount: true,
|
|
5536
|
-
bufferSize: 1
|
|
5537
|
-
}));
|
|
5538
|
-
this.selectedPreset$ = combineLatest([this.selectedValue$, this.userSelectedPreset$.pipe(startWith(null))]).pipe(map(([selectedValue, userSelectedPreset]) => {
|
|
5539
|
-
if (selectedValue instanceof Array) {
|
|
5540
|
-
const options = DateRangeComponent.Presets.filter((preset) => preset.dates[0].valueOf() === selectedValue[0].valueOf() && preset.dates[1].valueOf() === selectedValue[1].valueOf());
|
|
5541
|
-
if (options.length) {
|
|
5542
|
-
const mostRecent = options.find((option) => option.id === userSelectedPreset?.id);
|
|
5543
|
-
if (mostRecent) return mostRecent;
|
|
5544
|
-
return options[0];
|
|
5545
|
-
}
|
|
5546
|
-
}
|
|
5547
|
-
return null;
|
|
5548
|
-
}));
|
|
5549
|
-
this.favoritePresetIds$ = new LocalStorage(this.STORAGE_KEY, []);
|
|
5550
|
-
this.favoritePresets$ = combineLatest([
|
|
5551
|
-
this.favoritePresetIds$,
|
|
5552
|
-
this.filteredPresetOptions$,
|
|
5553
|
-
this.alternativePresetList$
|
|
5554
|
-
]).pipe(map(([ids, presets, alternativePresetList]) => {
|
|
5555
|
-
const favoritePresets = ids.map((id) => presets.find((preset) => preset.id === id)).filter((p) => p !== void 0);
|
|
5556
|
-
if (alternativePresetList.length == 0) return favoritePresets;
|
|
5557
|
-
else return favoritePresets.filter((p) => alternativePresetList.includes(p.id));
|
|
5558
|
-
}), shareReplay({
|
|
5559
|
-
refCount: true,
|
|
5560
|
-
bufferSize: 1
|
|
5561
|
-
}));
|
|
5562
|
-
this.userLeftActiveYearMonth$ = new Subject();
|
|
5563
|
-
this.userRightActiveYearMonth$ = new Subject();
|
|
5564
|
-
this.leftMin$ = this.min$.pipe(shareReplay({
|
|
5565
|
-
refCount: true,
|
|
5566
|
-
bufferSize: 1
|
|
5567
|
-
}));
|
|
5568
|
-
this.leftMax$ = this.max$.pipe(map((max) => timeDay.offset(timeMonth.floor(max), -1)), shareReplay({
|
|
5569
|
-
refCount: true,
|
|
5570
|
-
bufferSize: 1
|
|
5571
|
-
}));
|
|
5572
|
-
this.rightMax$ = this.max$.pipe(shareReplay({
|
|
5573
|
-
refCount: true,
|
|
5574
|
-
bufferSize: 1
|
|
5575
|
-
}));
|
|
5576
|
-
this.leftActiveYearMonth$ = combineLatest([this.leftMax$, merge(this.userLeftActiveYearMonth$.pipe(startWith(timeMonth.floor(this.TODAY))), this.userSelectedPreset$.pipe(filter((preset) => preset !== null), map((preset) => timeMonth.floor(preset.dates[0]))), this.distinctValue$.pipe(filter((v) => v !== void 0), map((v) => timeMonth.floor(v[0]))))]).pipe(map(([leftMax, left]) => {
|
|
5577
|
-
if (left.valueOf() >= leftMax.valueOf()) return timeMonth.floor(leftMax);
|
|
5578
|
-
else return left;
|
|
5579
|
-
}), shareReplay({
|
|
5580
|
-
refCount: true,
|
|
5581
|
-
bufferSize: 1
|
|
5582
|
-
}));
|
|
5583
|
-
this.rightActiveYearMonth$ = combineLatest([
|
|
5584
|
-
this.leftActiveYearMonth$,
|
|
5585
|
-
merge(this.userRightActiveYearMonth$.pipe(startWith(timeMonth.ceil(this.TODAY))), this.userSelectedPreset$.pipe(filter((preset) => preset !== null), map((preset) => timeMonth.floor(preset.dates[1]))), this.distinctValue$.pipe(filter((v) => v !== void 0), map((v) => timeMonth.floor(v[1])))),
|
|
5586
|
-
this.rightMax$
|
|
5587
|
-
]).pipe(map(([left, userRight, rightMax$]) => {
|
|
5588
|
-
if (left.valueOf() >= userRight.valueOf()) return timeMonth.floor(timeMonth.offset(left, 1));
|
|
5589
|
-
else if (userRight.valueOf() >= rightMax$.valueOf()) return timeMonth.floor(rightMax$);
|
|
5590
|
-
else return userRight;
|
|
5591
|
-
}), shareReplay({
|
|
5592
|
-
refCount: true,
|
|
5593
|
-
bufferSize: 1
|
|
5594
|
-
}));
|
|
5595
|
-
this.rightMin$ = this.leftActiveYearMonth$.pipe(map((left) => timeMonth.floor(timeMonth.offset(left, 1))), shareReplay({
|
|
5596
|
-
refCount: true,
|
|
5597
|
-
bufferSize: 1
|
|
5598
|
-
}));
|
|
5599
|
-
this.leftOmitRange$ = this.rightActiveYearMonth$.pipe(map((rightActiveYearMonth) => {
|
|
5600
|
-
return [timeMonth.floor(rightActiveYearMonth), timeDay.offset(timeMonth.floor(timeMonth.offset(rightActiveYearMonth, 1)), -1)];
|
|
5601
|
-
}), shareReplay({
|
|
5602
|
-
refCount: true,
|
|
5603
|
-
bufferSize: 1
|
|
5604
|
-
}));
|
|
5605
|
-
this.userInteracted$ = merge(this.userSelectedDate$, this.userSelectedPreset$);
|
|
5606
|
-
this.valueChange = this.selectedValue$.pipe(skipUntil(merge(this.userInteracted$, this.selectedValue$.pipe(filter((v) => v !== void 0)))), filter((v) => !(v instanceof Date)), distinctUntilChanged((previous, current) => previous?.[0].valueOf() === current?.[0].valueOf() && previous?.[1].valueOf() === current?.[1].valueOf()), shareReplay({
|
|
5607
|
-
refCount: true,
|
|
5608
|
-
bufferSize: 1
|
|
5609
|
-
}));
|
|
5610
|
-
this.displayValue$ = this.valueChange.pipe(map((v) => {
|
|
5611
|
-
if (v) return v.map((date) => new DatePipe().transform(date)).join(" — ");
|
|
5612
|
-
}), shareReplay({
|
|
5613
|
-
refCount: true,
|
|
5614
|
-
bufferSize: 1
|
|
5615
|
-
}));
|
|
5527
|
+
this.calendarId = uniqueId("riv-date-calendar-");
|
|
5528
|
+
this.valueChange = new EventEmitter();
|
|
5529
|
+
this.inputText = "";
|
|
5530
|
+
this.hasFocus = false;
|
|
5531
|
+
this.datePipe = new DatePipe();
|
|
5616
5532
|
}
|
|
5617
|
-
|
|
5618
|
-
this.
|
|
5533
|
+
ngOnChanges(changes) {
|
|
5534
|
+
if (changes["rollingTodayLabel"] && !this.hasFocus) this.syncInputText();
|
|
5619
5535
|
}
|
|
5620
|
-
|
|
5621
|
-
|
|
5536
|
+
onDocumentMouseDown(target) {
|
|
5537
|
+
if (!this.open$.getValue() || !(target instanceof Element)) return;
|
|
5538
|
+
if (this.isInsidePicker(target)) return;
|
|
5539
|
+
this.open$.next(false);
|
|
5540
|
+
this.cdr.markForCheck();
|
|
5622
5541
|
}
|
|
5623
|
-
|
|
5624
|
-
this.
|
|
5542
|
+
isInsidePicker(target) {
|
|
5543
|
+
const host = this.host.nativeElement;
|
|
5544
|
+
if (host.contains(target)) return true;
|
|
5545
|
+
const layer = target.closest(".callout, .scrim, .overlay-container");
|
|
5546
|
+
return !!layer && !layer.contains(host);
|
|
5625
5547
|
}
|
|
5626
|
-
|
|
5627
|
-
|
|
5548
|
+
clearValue() {
|
|
5549
|
+
this.commit(void 0);
|
|
5550
|
+
this.open$.next(false);
|
|
5628
5551
|
}
|
|
5629
|
-
|
|
5630
|
-
this.
|
|
5552
|
+
selectToday() {
|
|
5553
|
+
if (!this.isTodaySelectable) return;
|
|
5554
|
+
this.commit(this.isRolling ? void 0 : timeDay.floor(/* @__PURE__ */ new Date()));
|
|
5555
|
+
this.open$.next(false);
|
|
5631
5556
|
}
|
|
5632
|
-
get
|
|
5633
|
-
return this.max
|
|
5557
|
+
get isTodaySelectable() {
|
|
5558
|
+
return DateComponent.isValidDate(timeDay.floor(/* @__PURE__ */ new Date()), this.min, this.max);
|
|
5634
5559
|
}
|
|
5635
|
-
|
|
5636
|
-
this.
|
|
5560
|
+
get selectedCalendarValue() {
|
|
5561
|
+
return this.previewValue ?? this._value ?? (this.isRolling ? timeDay.floor(/* @__PURE__ */ new Date()) : void 0);
|
|
5637
5562
|
}
|
|
5638
|
-
|
|
5639
|
-
|
|
5563
|
+
onInputChange(value) {
|
|
5564
|
+
this.inputText = value;
|
|
5565
|
+
const parsed = this.parseInput(value);
|
|
5566
|
+
this.previewValue = parsed;
|
|
5567
|
+
if (parsed) this.setActiveMonth(parsed);
|
|
5568
|
+
this.cdr.markForCheck();
|
|
5640
5569
|
}
|
|
5641
|
-
|
|
5642
|
-
this.
|
|
5570
|
+
onInputBlur(event) {
|
|
5571
|
+
this.hasFocus = false;
|
|
5572
|
+
const parsed = this.parseInput(this.inputText);
|
|
5573
|
+
if (parsed) this.commit(parsed);
|
|
5574
|
+
else if (!this.inputText.trim() || this.isRollingText(this.inputText)) this.commit(void 0);
|
|
5575
|
+
else this.syncInputText();
|
|
5576
|
+
this.previewValue = void 0;
|
|
5577
|
+
const nextTarget = event?.relatedTarget;
|
|
5578
|
+
if (!(nextTarget instanceof Element && this.isInsidePicker(nextTarget))) this.open$.next(false);
|
|
5579
|
+
this.cdr.markForCheck();
|
|
5643
5580
|
}
|
|
5644
|
-
|
|
5645
|
-
|
|
5581
|
+
onDateSelect(date) {
|
|
5582
|
+
this.commit(timeDay.floor(date));
|
|
5583
|
+
this.open$.next(false);
|
|
5646
5584
|
}
|
|
5647
|
-
|
|
5648
|
-
this.
|
|
5585
|
+
onInputFocus() {
|
|
5586
|
+
this.hasFocus = true;
|
|
5587
|
+
this.open$.next(true);
|
|
5649
5588
|
}
|
|
5650
|
-
|
|
5651
|
-
|
|
5589
|
+
toggleCalendar() {
|
|
5590
|
+
this.open$.next(!this.open$.getValue());
|
|
5652
5591
|
}
|
|
5653
|
-
|
|
5654
|
-
return this.
|
|
5592
|
+
get isRolling() {
|
|
5593
|
+
return this.rollingTodayLabel != null;
|
|
5655
5594
|
}
|
|
5656
|
-
|
|
5657
|
-
this.
|
|
5595
|
+
isRollingText(text) {
|
|
5596
|
+
return this.rollingTodayLabel != null && text.trim().toLowerCase() === this.rollingTodayLabel.toLowerCase();
|
|
5658
5597
|
}
|
|
5659
|
-
|
|
5660
|
-
|
|
5598
|
+
syncInputText() {
|
|
5599
|
+
this.inputText = this._value ? this.formatValue(this._value) : this.rollingTodayLabel ?? "";
|
|
5661
5600
|
}
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
if (favorite) ids.add(preset.id);
|
|
5665
|
-
else ids.delete(preset.id);
|
|
5666
|
-
this.favoritePresetIds$.next([...ids]);
|
|
5601
|
+
formatValue(date) {
|
|
5602
|
+
return this.datePipe.transform(date);
|
|
5667
5603
|
}
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
version: "22.2.4",
|
|
5672
|
-
ngImport: i0,
|
|
5673
|
-
type: DateRangeComponent,
|
|
5674
|
-
deps: null,
|
|
5675
|
-
target: i0.ɵɵFactoryTarget.Component
|
|
5676
|
-
});
|
|
5604
|
+
parseInput(text) {
|
|
5605
|
+
const parsed = DateComponent.parseDate(text);
|
|
5606
|
+
return parsed && DateComponent.isValidDate(parsed, this.min, this.max) ? timeDay.floor(parsed) : void 0;
|
|
5677
5607
|
}
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5608
|
+
setActiveMonth(date) {
|
|
5609
|
+
const month = timeMonth.floor(date);
|
|
5610
|
+
if (month.getTime() !== this.activeYearMonth.getTime()) this.activeYearMonth = month;
|
|
5611
|
+
}
|
|
5612
|
+
commit(next) {
|
|
5613
|
+
const unchanged = next?.getTime() === this._value?.getTime();
|
|
5614
|
+
this._value = next;
|
|
5615
|
+
this.syncInputText();
|
|
5616
|
+
this.previewValue = void 0;
|
|
5617
|
+
if (next) this.setActiveMonth(next);
|
|
5618
|
+
if (!unchanged) this.valueChange.emit(next);
|
|
5619
|
+
this.cdr.markForCheck();
|
|
5620
|
+
}
|
|
5621
|
+
static {
|
|
5622
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
5623
|
+
minVersion: "12.0.0",
|
|
5624
|
+
version: "22.2.4",
|
|
5625
|
+
ngImport: i0,
|
|
5626
|
+
type: DateComponent,
|
|
5627
|
+
deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }],
|
|
5628
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
5629
|
+
});
|
|
5630
|
+
}
|
|
5631
|
+
static {
|
|
5632
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
5633
|
+
minVersion: "14.0.0",
|
|
5634
|
+
version: "22.2.4",
|
|
5635
|
+
type: DateComponent,
|
|
5683
5636
|
isStandalone: false,
|
|
5684
|
-
selector: "riv-date
|
|
5637
|
+
selector: "riv-date",
|
|
5685
5638
|
inputs: {
|
|
5686
|
-
showPresets: "showPresets",
|
|
5687
5639
|
min: "min",
|
|
5688
5640
|
max: "max",
|
|
5689
5641
|
value: "value",
|
|
5690
5642
|
placeholder: "placeholder",
|
|
5691
5643
|
disabled: "disabled",
|
|
5692
|
-
|
|
5644
|
+
size: "size",
|
|
5645
|
+
showClearButton: "showClearButton",
|
|
5646
|
+
showTodayButton: "showTodayButton",
|
|
5647
|
+
rollingTodayLabel: "rollingTodayLabel",
|
|
5648
|
+
open: "open"
|
|
5693
5649
|
},
|
|
5694
5650
|
outputs: { valueChange: "valueChange" },
|
|
5651
|
+
host: { listeners: { "document:mousedown": "onDocumentMouseDown($event.target)" } },
|
|
5695
5652
|
queries: [{
|
|
5696
|
-
propertyName: "
|
|
5653
|
+
propertyName: "headerTemplate",
|
|
5697
5654
|
first: true,
|
|
5698
|
-
predicate: ["
|
|
5655
|
+
predicate: ["header"],
|
|
5699
5656
|
descendants: true
|
|
5700
5657
|
}],
|
|
5701
|
-
viewQueries: [{
|
|
5702
|
-
propertyName: "customTriggerButton",
|
|
5703
|
-
first: true,
|
|
5704
|
-
predicate: ["customTriggerButton"],
|
|
5705
|
-
descendants: true,
|
|
5706
|
-
read: ElementRef
|
|
5707
|
-
}, {
|
|
5708
|
-
propertyName: "standardTriggerButton",
|
|
5709
|
-
first: true,
|
|
5710
|
-
predicate: ["standardTriggerButton"],
|
|
5711
|
-
descendants: true,
|
|
5712
|
-
read: ElementRef
|
|
5713
|
-
}],
|
|
5714
5658
|
usesInheritance: true,
|
|
5659
|
+
usesOnChanges: true,
|
|
5715
5660
|
ngImport: i0,
|
|
5716
|
-
template: "<
|
|
5717
|
-
styles: [".trigger{width:100%;border:var(--border-width) solid var(--border-light);border-radius:var(--border-radius-small);display:flex;gap:var(--size-small);background-color:var(--surface-light-0);
|
|
5661
|
+
template: "<riv-input-label\n [label]=\"label\"\n [help]=\"help\"\n [required]=\"required\"\n [state]=\"state\"\n [errorMessage]=\"errorMessage\"\n [labelActionText]=\"labelActionText\"\n (labelAction)=\"labelAction.emit($event)\"\n>\n <div\n #trigger\n class=\"trigger\"\n [class.xsmall]=\"size === 'xsmall'\"\n [class.small]=\"size === 'small'\"\n [class.large]=\"size === 'large'\"\n [class.xlarge]=\"size === 'xlarge'\"\n [class.warning]=\"state === 'warning'\"\n [class.error]=\"state === 'error'\"\n [class.disabled]=\"disabled\"\n >\n <input\n #input\n class=\"value\"\n [placeholder]=\"placeholder\"\n [value]=\"inputText\"\n [disabled]=\"disabled\"\n [attr.aria-disabled]=\"disabled ? 'true' : null\"\n [attr.aria-label]=\"label || null\"\n [attr.aria-controls]=\"calendarId\"\n [attr.aria-expanded]=\"open$ | async\"\n role=\"combobox\"\n aria-haspopup=\"dialog\"\n aria-autocomplete=\"none\"\n (input)=\"onInputChange(input.value)\"\n (blur)=\"onInputBlur($event)\"\n (focus)=\"onInputFocus()\"\n (keydown.enter)=\"input.blur(); open$.next(false); $event.preventDefault()\"\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n />\n <button\n class=\"chevron\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"toggleCalendar()\"\n [disabled]=\"disabled\"\n [attr.aria-disabled]=\"disabled ? 'true' : null\"\n [attr.aria-label]=\"(open$ | async) ? 'Close calendar' : 'Open calendar'\"\n type=\"button\"\n tabindex=\"-1\"\n >\n <riv-icon [name]=\"'Calendar'\" [size]=\"16\"></riv-icon>\n </button>\n </div>\n</riv-input-label>\n<ng-container *ngIf=\"open$ | async\">\n <riv-callout\n *riv-overlay\n [anchor]=\"trigger\"\n [isModal]=\"false\"\n [showCaret]=\"false\"\n [theme]=\"'light'\"\n [allowedPositions]=\"[\n 'top-left',\n 'top-right',\n 'bottom-right',\n 'bottom-left'\n ]\"\n [preferredPosition]=\"'bottom-right'\"\n (close)=\"open$.next(false)\"\n >\n <div [attr.id]=\"calendarId\" (mousedown)=\"$event.preventDefault()\">\n <header *ngIf=\"headerTemplate\">\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n </header>\n <div class=\"content\">\n <riv-calendar\n [activeYearMonth]=\"activeYearMonth\"\n (activeYearMonthChange)=\"activeYearMonth = $event\"\n [displayMin]=\"min\"\n [displayMax]=\"max\"\n [selectableMin]=\"min\"\n [selectableMax]=\"max\"\n [selectedValue]=\"selectedCalendarValue\"\n (dateSelect)=\"onDateSelect($event); input.blur()\"\n ></riv-calendar>\n </div>\n <footer *ngIf=\"showClearButton || showTodayButton\" class=\"buttons\">\n <button\n *ngIf=\"showClearButton\"\n rivButton\n [size]=\"'small'\"\n [variant]=\"'ghost'\"\n (click)=\"clearValue(); input.blur()\"\n type=\"button\"\n >\n Clear\n </button>\n <button\n *ngIf=\"showTodayButton\"\n class=\"today\"\n rivButton\n [size]=\"'small'\"\n [variant]=\"'basic'\"\n [disabled]=\"!isTodaySelectable\"\n (click)=\"selectToday(); input.blur()\"\n type=\"button\"\n >\n Today\n </button>\n </footer>\n </div>\n </riv-callout>\n</ng-container>\n",
|
|
5662
|
+
styles: [".trigger{width:100%;border:var(--border-width) solid var(--border-light);border-radius:var(--border-radius-small);display:flex;gap:var(--size-small);background-color:var(--surface-light-0);padding-left:var(--size-small);position:relative}.trigger:focus-within{outline:none;border:var(--border-width) solid var(--purp-60)}.trigger.disabled{color:var(--type-light-disabled);background-color:var(--surface-light-1)}.value{font:var(--input-medium);color:var(--type-light-high-contrast);padding:var(--size-small) 0;flex-grow:1;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:pre;border:none;background:transparent;outline:none;width:100%}.value::placeholder{color:var(--type-light-low-contrast)}.value:disabled{color:var(--type-light-disabled)}.trigger.xsmall .value{font:var(--input-small);padding:var(--size-xsmall) 0}.trigger.small .value{font:var(--input-small)}.trigger.large .value{font:var(--input-large);padding:var(--size-medium) var(--size-xsmall)}.trigger.xlarge .value{font:var(--input-large);padding:var(--size-large) var(--size-small)}.chevron{display:flex;justify-content:center;align-items:center;padding:var(--size-xsmall) calc(var(--base-grid-size) * 1.5);border:none;background:transparent;cursor:pointer;color:var(--type-light-high-contrast)}.chevron:disabled{color:var(--type-light-disabled);cursor:not-allowed}.trigger.warning{border-color:var(--surface-dark-caution)}.trigger.error{border-color:var(--surface-dark-danger);box-shadow:inset 0 0 0 var(--border-width-large) var(--surface-dark-danger)}.content{padding:var(--size-xlarge)}.buttons{padding:0 var(--size-xlarge) var(--size-xlarge);display:flex;justify-content:space-between}.buttons .today{margin-left:auto}\n"],
|
|
5718
5663
|
dependencies: [
|
|
5719
|
-
{
|
|
5720
|
-
kind: "directive",
|
|
5721
|
-
type: i1.NgForOf,
|
|
5722
|
-
selector: "[ngFor][ngForOf]",
|
|
5723
|
-
inputs: [
|
|
5724
|
-
"ngForOf",
|
|
5725
|
-
"ngForTrackBy",
|
|
5726
|
-
"ngForTemplate"
|
|
5727
|
-
]
|
|
5728
|
-
},
|
|
5729
5664
|
{
|
|
5730
5665
|
kind: "directive",
|
|
5731
5666
|
type: i1.NgIf,
|
|
@@ -5792,12 +5727,6 @@ var DateRangeComponent = class DateRangeComponent extends InputLabelComponent {
|
|
|
5792
5727
|
],
|
|
5793
5728
|
outputs: ["close"]
|
|
5794
5729
|
},
|
|
5795
|
-
{
|
|
5796
|
-
kind: "component",
|
|
5797
|
-
type: HighlightComponent,
|
|
5798
|
-
selector: "riv-highlight",
|
|
5799
|
-
inputs: ["text", "indices"]
|
|
5800
|
-
},
|
|
5801
5730
|
{
|
|
5802
5731
|
kind: "component",
|
|
5803
5732
|
type: IconComponent,
|
|
@@ -5829,55 +5758,10 @@ var DateRangeComponent = class DateRangeComponent extends InputLabelComponent {
|
|
|
5829
5758
|
type: OverlayDirective,
|
|
5830
5759
|
selector: "[riv-overlay]"
|
|
5831
5760
|
},
|
|
5832
|
-
{
|
|
5833
|
-
kind: "component",
|
|
5834
|
-
type: SimpleSelectComponent,
|
|
5835
|
-
selector: "riv-simple-select",
|
|
5836
|
-
inputs: [
|
|
5837
|
-
"optionGroups",
|
|
5838
|
-
"selectedOption",
|
|
5839
|
-
"size",
|
|
5840
|
-
"disabled",
|
|
5841
|
-
"locked",
|
|
5842
|
-
"filterabilityOptions",
|
|
5843
|
-
"orderBy",
|
|
5844
|
-
"placeholder",
|
|
5845
|
-
"maxHeight",
|
|
5846
|
-
"maxWidth",
|
|
5847
|
-
"minHeight",
|
|
5848
|
-
"minWidth",
|
|
5849
|
-
"dividers",
|
|
5850
|
-
"sortSelectedToTop",
|
|
5851
|
-
"grow",
|
|
5852
|
-
"preferredCalloutPosition",
|
|
5853
|
-
"allowedCalloutPositions"
|
|
5854
|
-
],
|
|
5855
|
-
outputs: ["selectedOptionChange"]
|
|
5856
|
-
},
|
|
5857
|
-
{
|
|
5858
|
-
kind: "directive",
|
|
5859
|
-
type: TooltipDirective,
|
|
5860
|
-
selector: "[rivTooltip]",
|
|
5861
|
-
inputs: [
|
|
5862
|
-
"rivTooltip",
|
|
5863
|
-
"rivTooltipTheme",
|
|
5864
|
-
"rivTooltipMaxWidth",
|
|
5865
|
-
"rivTooltipPreferredPosition",
|
|
5866
|
-
"rivTooltipAnchor",
|
|
5867
|
-
"rivTooltipCloseDelay",
|
|
5868
|
-
"rivTooltipOpenDelay",
|
|
5869
|
-
"rivTooltipGracePeriod"
|
|
5870
|
-
]
|
|
5871
|
-
},
|
|
5872
5761
|
{
|
|
5873
5762
|
kind: "pipe",
|
|
5874
5763
|
type: i1.AsyncPipe,
|
|
5875
5764
|
name: "async"
|
|
5876
|
-
},
|
|
5877
|
-
{
|
|
5878
|
-
kind: "pipe",
|
|
5879
|
-
type: OptionGroupPipe,
|
|
5880
|
-
name: "rivOptionGroup"
|
|
5881
5765
|
}
|
|
5882
5766
|
],
|
|
5883
5767
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
@@ -5888,361 +5772,334 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5888
5772
|
minVersion: "12.0.0",
|
|
5889
5773
|
version: "22.2.4",
|
|
5890
5774
|
ngImport: i0,
|
|
5891
|
-
type:
|
|
5775
|
+
type: DateComponent,
|
|
5892
5776
|
decorators: [{
|
|
5893
5777
|
type: Component,
|
|
5894
5778
|
args: [{
|
|
5895
|
-
selector: "riv-date
|
|
5779
|
+
selector: "riv-date",
|
|
5896
5780
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
5897
5781
|
standalone: false,
|
|
5898
|
-
template: "<
|
|
5899
|
-
styles: [".trigger{width:100%;border:var(--border-width) solid var(--border-light);border-radius:var(--border-radius-small);display:flex;gap:var(--size-small);background-color:var(--surface-light-0);
|
|
5782
|
+
template: "<riv-input-label\n [label]=\"label\"\n [help]=\"help\"\n [required]=\"required\"\n [state]=\"state\"\n [errorMessage]=\"errorMessage\"\n [labelActionText]=\"labelActionText\"\n (labelAction)=\"labelAction.emit($event)\"\n>\n <div\n #trigger\n class=\"trigger\"\n [class.xsmall]=\"size === 'xsmall'\"\n [class.small]=\"size === 'small'\"\n [class.large]=\"size === 'large'\"\n [class.xlarge]=\"size === 'xlarge'\"\n [class.warning]=\"state === 'warning'\"\n [class.error]=\"state === 'error'\"\n [class.disabled]=\"disabled\"\n >\n <input\n #input\n class=\"value\"\n [placeholder]=\"placeholder\"\n [value]=\"inputText\"\n [disabled]=\"disabled\"\n [attr.aria-disabled]=\"disabled ? 'true' : null\"\n [attr.aria-label]=\"label || null\"\n [attr.aria-controls]=\"calendarId\"\n [attr.aria-expanded]=\"open$ | async\"\n role=\"combobox\"\n aria-haspopup=\"dialog\"\n aria-autocomplete=\"none\"\n (input)=\"onInputChange(input.value)\"\n (blur)=\"onInputBlur($event)\"\n (focus)=\"onInputFocus()\"\n (keydown.enter)=\"input.blur(); open$.next(false); $event.preventDefault()\"\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n />\n <button\n class=\"chevron\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"toggleCalendar()\"\n [disabled]=\"disabled\"\n [attr.aria-disabled]=\"disabled ? 'true' : null\"\n [attr.aria-label]=\"(open$ | async) ? 'Close calendar' : 'Open calendar'\"\n type=\"button\"\n tabindex=\"-1\"\n >\n <riv-icon [name]=\"'Calendar'\" [size]=\"16\"></riv-icon>\n </button>\n </div>\n</riv-input-label>\n<ng-container *ngIf=\"open$ | async\">\n <riv-callout\n *riv-overlay\n [anchor]=\"trigger\"\n [isModal]=\"false\"\n [showCaret]=\"false\"\n [theme]=\"'light'\"\n [allowedPositions]=\"[\n 'top-left',\n 'top-right',\n 'bottom-right',\n 'bottom-left'\n ]\"\n [preferredPosition]=\"'bottom-right'\"\n (close)=\"open$.next(false)\"\n >\n <div [attr.id]=\"calendarId\" (mousedown)=\"$event.preventDefault()\">\n <header *ngIf=\"headerTemplate\">\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n </header>\n <div class=\"content\">\n <riv-calendar\n [activeYearMonth]=\"activeYearMonth\"\n (activeYearMonthChange)=\"activeYearMonth = $event\"\n [displayMin]=\"min\"\n [displayMax]=\"max\"\n [selectableMin]=\"min\"\n [selectableMax]=\"max\"\n [selectedValue]=\"selectedCalendarValue\"\n (dateSelect)=\"onDateSelect($event); input.blur()\"\n ></riv-calendar>\n </div>\n <footer *ngIf=\"showClearButton || showTodayButton\" class=\"buttons\">\n <button\n *ngIf=\"showClearButton\"\n rivButton\n [size]=\"'small'\"\n [variant]=\"'ghost'\"\n (click)=\"clearValue(); input.blur()\"\n type=\"button\"\n >\n Clear\n </button>\n <button\n *ngIf=\"showTodayButton\"\n class=\"today\"\n rivButton\n [size]=\"'small'\"\n [variant]=\"'basic'\"\n [disabled]=\"!isTodaySelectable\"\n (click)=\"selectToday(); input.blur()\"\n type=\"button\"\n >\n Today\n </button>\n </footer>\n </div>\n </riv-callout>\n</ng-container>\n",
|
|
5783
|
+
styles: [".trigger{width:100%;border:var(--border-width) solid var(--border-light);border-radius:var(--border-radius-small);display:flex;gap:var(--size-small);background-color:var(--surface-light-0);padding-left:var(--size-small);position:relative}.trigger:focus-within{outline:none;border:var(--border-width) solid var(--purp-60)}.trigger.disabled{color:var(--type-light-disabled);background-color:var(--surface-light-1)}.value{font:var(--input-medium);color:var(--type-light-high-contrast);padding:var(--size-small) 0;flex-grow:1;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:pre;border:none;background:transparent;outline:none;width:100%}.value::placeholder{color:var(--type-light-low-contrast)}.value:disabled{color:var(--type-light-disabled)}.trigger.xsmall .value{font:var(--input-small);padding:var(--size-xsmall) 0}.trigger.small .value{font:var(--input-small)}.trigger.large .value{font:var(--input-large);padding:var(--size-medium) var(--size-xsmall)}.trigger.xlarge .value{font:var(--input-large);padding:var(--size-large) var(--size-small)}.chevron{display:flex;justify-content:center;align-items:center;padding:var(--size-xsmall) calc(var(--base-grid-size) * 1.5);border:none;background:transparent;cursor:pointer;color:var(--type-light-high-contrast)}.chevron:disabled{color:var(--type-light-disabled);cursor:not-allowed}.trigger.warning{border-color:var(--surface-dark-caution)}.trigger.error{border-color:var(--surface-dark-danger);box-shadow:inset 0 0 0 var(--border-width-large) var(--surface-dark-danger)}.content{padding:var(--size-xlarge)}.buttons{padding:0 var(--size-xlarge) var(--size-xlarge);display:flex;justify-content:space-between}.buttons .today{margin-left:auto}\n"]
|
|
5900
5784
|
}]
|
|
5901
5785
|
}],
|
|
5786
|
+
ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }],
|
|
5902
5787
|
propDecorators: {
|
|
5903
|
-
showPresets: [{ type: Input }],
|
|
5904
5788
|
min: [{ type: Input }],
|
|
5905
5789
|
max: [{ type: Input }],
|
|
5906
5790
|
value: [{ type: Input }],
|
|
5907
5791
|
placeholder: [{ type: Input }],
|
|
5908
5792
|
disabled: [{ type: Input }],
|
|
5909
|
-
|
|
5793
|
+
size: [{ type: Input }],
|
|
5794
|
+
showClearButton: [{ type: Input }],
|
|
5795
|
+
showTodayButton: [{ type: Input }],
|
|
5796
|
+
rollingTodayLabel: [{ type: Input }],
|
|
5797
|
+
headerTemplate: [{
|
|
5910
5798
|
type: ContentChild,
|
|
5911
|
-
args: ["
|
|
5912
|
-
}],
|
|
5913
|
-
customTriggerButton: [{
|
|
5914
|
-
type: ViewChild,
|
|
5915
|
-
args: ["customTriggerButton", { read: ElementRef }]
|
|
5916
|
-
}],
|
|
5917
|
-
standardTriggerButton: [{
|
|
5918
|
-
type: ViewChild,
|
|
5919
|
-
args: ["standardTriggerButton", { read: ElementRef }]
|
|
5799
|
+
args: ["header"]
|
|
5920
5800
|
}],
|
|
5921
|
-
|
|
5922
|
-
valueChange: [{ type: Output }]
|
|
5801
|
+
open: [{ type: Input }],
|
|
5802
|
+
valueChange: [{ type: Output }],
|
|
5803
|
+
onDocumentMouseDown: [{
|
|
5804
|
+
type: HostListener,
|
|
5805
|
+
args: ["document:mousedown", ["$event.target"]]
|
|
5806
|
+
}]
|
|
5923
5807
|
}
|
|
5924
5808
|
});
|
|
5925
|
-
(function(
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
PresetType["THIS_WEEK"] = "this_week";
|
|
5933
|
-
PresetType["THIS_WEEK_SO_FAR"] = "this_week_so_far";
|
|
5934
|
-
PresetType["LAST_WEEK"] = "last_week";
|
|
5935
|
-
PresetType["NEXT_WEEK"] = "next_week";
|
|
5936
|
-
PresetType["THIS_MONTH"] = "this_month";
|
|
5937
|
-
PresetType["THIS_MONTH_SO_FAR"] = "this_month_so_far";
|
|
5938
|
-
PresetType["LAST_MONTH"] = "last_month";
|
|
5939
|
-
PresetType["NEXT_MONTH"] = "next_month";
|
|
5940
|
-
PresetType["THIS_QUARTER"] = "this_quarter";
|
|
5941
|
-
PresetType["THIS_QUARTER_SO_FAR"] = "this_quarter_so_far";
|
|
5942
|
-
PresetType["LAST_QUARTER"] = "last_quarter";
|
|
5943
|
-
PresetType["NEXT_QUARTER"] = "next_quarter";
|
|
5944
|
-
PresetType["THIS_YEAR"] = "this_year";
|
|
5945
|
-
PresetType["THIS_YEAR_SO_FAR"] = "this_year_so_far";
|
|
5946
|
-
PresetType["LAST_YEAR"] = "last_year";
|
|
5947
|
-
PresetType["NEXT_YEAR"] = "next_year";
|
|
5948
|
-
PresetType["LAST_7_DAYS"] = "last_7_days";
|
|
5949
|
-
PresetType["LAST_14_DAYS"] = "last_14_days";
|
|
5950
|
-
PresetType["LAST_30_DAYS"] = "last_30_days";
|
|
5951
|
-
PresetType["LAST_60_DAYS"] = "last_60_days";
|
|
5952
|
-
PresetType["LAST_90_DAYS"] = "last_90_days";
|
|
5953
|
-
PresetType["LAST_180_DAYS"] = "last_180_days";
|
|
5954
|
-
PresetType["LAST_365_DAYS"] = "last_365_days";
|
|
5955
|
-
})(PresetType = DateRangeComponent.PresetType || (DateRangeComponent.PresetType = {}));
|
|
5956
|
-
DateRangeComponent.Presets = [
|
|
5957
|
-
{
|
|
5958
|
-
id: PresetType.TODAY,
|
|
5959
|
-
title: "Today",
|
|
5960
|
-
subtitle: "Today from midnight until the current time",
|
|
5961
|
-
dates: [timeDay(), timeDay()]
|
|
5962
|
-
},
|
|
5963
|
-
{
|
|
5964
|
-
id: PresetType.YESTERDAY,
|
|
5965
|
-
title: "Yesterday",
|
|
5966
|
-
subtitle: "The previous 24 hour day",
|
|
5967
|
-
dates: [timeDay.offset(timeDay(), -1), timeDay.offset(timeDay(), -1)]
|
|
5968
|
-
},
|
|
5969
|
-
{
|
|
5970
|
-
id: PresetType.TOMORROW,
|
|
5971
|
-
title: "Tomorrow",
|
|
5972
|
-
subtitle: "The next 24 hour day",
|
|
5973
|
-
dates: [timeDay.offset(timeDay(), 1), timeDay.offset(timeDay(), 1)]
|
|
5974
|
-
},
|
|
5975
|
-
{
|
|
5976
|
-
id: PresetType.THIS_WEEK,
|
|
5977
|
-
title: "This week",
|
|
5978
|
-
subtitle: "The current calendar week",
|
|
5979
|
-
dates: [timeSunday.floor(today), timeDay.offset(timeSunday.ceil(today), -1)]
|
|
5980
|
-
},
|
|
5981
|
-
{
|
|
5982
|
-
id: PresetType.THIS_WEEK_SO_FAR,
|
|
5983
|
-
title: "This week so far",
|
|
5984
|
-
subtitle: "The current calendar week up to now",
|
|
5985
|
-
dates: [timeSunday.floor(today), timeDay.floor(today)]
|
|
5986
|
-
},
|
|
5987
|
-
{
|
|
5988
|
-
id: PresetType.LAST_WEEK,
|
|
5989
|
-
title: "Last week",
|
|
5990
|
-
subtitle: "The previous calendar week",
|
|
5991
|
-
dates: [timeSunday.offset(timeWeek.floor(today), -1), timeDay.offset(timeSunday.offset(timeWeek.ceil(today), -1), -1)]
|
|
5992
|
-
},
|
|
5993
|
-
{
|
|
5994
|
-
id: PresetType.NEXT_WEEK,
|
|
5995
|
-
title: "Next week",
|
|
5996
|
-
subtitle: "The next calendar week",
|
|
5997
|
-
dates: [timeSunday.offset(timeWeek.floor(today), 1), timeDay.offset(timeSunday.offset(timeWeek.ceil(today), 1), -1)]
|
|
5998
|
-
},
|
|
5999
|
-
{
|
|
6000
|
-
id: PresetType.THIS_MONTH,
|
|
6001
|
-
title: "This month",
|
|
6002
|
-
subtitle: "The current calendar month",
|
|
6003
|
-
dates: [timeMonth.floor(today), timeDay.offset(timeMonth.ceil(today), -1)]
|
|
6004
|
-
},
|
|
6005
|
-
{
|
|
6006
|
-
id: PresetType.THIS_MONTH_SO_FAR,
|
|
6007
|
-
title: "This month so far",
|
|
6008
|
-
subtitle: "The current calendar month up to now",
|
|
6009
|
-
dates: [timeMonth.floor(today), timeDay.floor(today)]
|
|
6010
|
-
},
|
|
6011
|
-
{
|
|
6012
|
-
id: PresetType.LAST_MONTH,
|
|
6013
|
-
title: "Last month",
|
|
6014
|
-
subtitle: "The previous calendar month",
|
|
6015
|
-
dates: [timeMonth.offset(timeMonth.floor(today), -1), timeDay.offset(timeMonth.offset(timeMonth.ceil(today), -1), -1)]
|
|
6016
|
-
},
|
|
6017
|
-
{
|
|
6018
|
-
id: PresetType.NEXT_MONTH,
|
|
6019
|
-
title: "Next month",
|
|
6020
|
-
subtitle: "The next calendar month",
|
|
6021
|
-
dates: [timeMonth.offset(timeMonth.floor(today), 1), timeDay.offset(timeMonth.offset(timeMonth.ceil(today), 1), -1)]
|
|
6022
|
-
},
|
|
6023
|
-
{
|
|
6024
|
-
id: PresetType.THIS_QUARTER,
|
|
6025
|
-
title: "This quarter",
|
|
6026
|
-
subtitle: "The current quarter",
|
|
6027
|
-
dates: [timeQuarter.floor(today), timeDay.offset(timeQuarter.ceil(today), -1)]
|
|
6028
|
-
},
|
|
6029
|
-
{
|
|
6030
|
-
id: PresetType.THIS_QUARTER_SO_FAR,
|
|
6031
|
-
title: "This quarter so far",
|
|
6032
|
-
subtitle: "The current quarter up to now",
|
|
6033
|
-
dates: [timeQuarter.floor(today), timeDay.floor(today)]
|
|
6034
|
-
},
|
|
6035
|
-
{
|
|
6036
|
-
id: PresetType.LAST_QUARTER,
|
|
6037
|
-
title: "Last quarter",
|
|
6038
|
-
subtitle: "The previous full quarter",
|
|
6039
|
-
dates: [timeQuarter.offset(timeQuarter.floor(today), -1), timeDay.offset(timeQuarter.offset(timeQuarter.ceil(today), -1), -1)]
|
|
6040
|
-
},
|
|
6041
|
-
{
|
|
6042
|
-
id: PresetType.NEXT_QUARTER,
|
|
6043
|
-
title: "Next quarter",
|
|
6044
|
-
subtitle: "The next full quarter",
|
|
6045
|
-
dates: [timeQuarter.offset(timeQuarter.floor(today), 1), timeDay.offset(timeQuarter.offset(timeQuarter.ceil(today), 1), -1)]
|
|
6046
|
-
},
|
|
6047
|
-
{
|
|
6048
|
-
id: PresetType.THIS_YEAR,
|
|
6049
|
-
title: "This year",
|
|
6050
|
-
subtitle: "The current calendar year",
|
|
6051
|
-
dates: [timeYear.floor(today), timeDay.offset(timeYear.ceil(today), -1)]
|
|
6052
|
-
},
|
|
6053
|
-
{
|
|
6054
|
-
id: PresetType.THIS_YEAR_SO_FAR,
|
|
6055
|
-
title: "This year so far",
|
|
6056
|
-
subtitle: "The current calendar year up to now",
|
|
6057
|
-
dates: [timeYear.floor(today), timeDay.floor(today)]
|
|
6058
|
-
},
|
|
6059
|
-
{
|
|
6060
|
-
id: PresetType.LAST_YEAR,
|
|
6061
|
-
title: "Last year",
|
|
6062
|
-
subtitle: "The previous calendar year",
|
|
6063
|
-
dates: [timeYear.offset(timeYear.floor(today), -1), timeDay.offset(timeYear.offset(timeYear.ceil(today), -1), -1)]
|
|
6064
|
-
},
|
|
6065
|
-
{
|
|
6066
|
-
id: PresetType.NEXT_YEAR,
|
|
6067
|
-
title: "Next year",
|
|
6068
|
-
subtitle: "The next calendar year",
|
|
6069
|
-
dates: [timeYear.offset(timeYear.floor(today), 1), timeDay.offset(timeYear.offset(timeYear.ceil(today), 1), -1)]
|
|
6070
|
-
},
|
|
6071
|
-
{
|
|
6072
|
-
id: PresetType.LAST_7_DAYS,
|
|
6073
|
-
title: "Last 7 days",
|
|
6074
|
-
subtitle: "The previous 7 days before today",
|
|
6075
|
-
dates: [timeDay.floor(timeDay.offset(today, -8)), timeDay.floor(timeDay.offset(today, -1))]
|
|
6076
|
-
},
|
|
6077
|
-
{
|
|
6078
|
-
id: PresetType.LAST_14_DAYS,
|
|
6079
|
-
title: "Last 14 days",
|
|
6080
|
-
subtitle: "The previous 14 days before today",
|
|
6081
|
-
dates: [timeDay.floor(timeDay.offset(today, -15)), timeDay.floor(timeDay.offset(today, -1))]
|
|
6082
|
-
},
|
|
6083
|
-
{
|
|
6084
|
-
id: PresetType.LAST_30_DAYS,
|
|
6085
|
-
title: "Last 30 days",
|
|
6086
|
-
subtitle: "The previous 30 days before today",
|
|
6087
|
-
dates: [timeDay.floor(timeDay.offset(today, -31)), timeDay.floor(timeDay.offset(today, -1))]
|
|
6088
|
-
},
|
|
6089
|
-
{
|
|
6090
|
-
id: PresetType.LAST_60_DAYS,
|
|
6091
|
-
title: "Last 60 days",
|
|
6092
|
-
subtitle: "The previous 60 days before today",
|
|
6093
|
-
dates: [timeDay.floor(timeDay.offset(today, -61)), timeDay.floor(timeDay.offset(today, -1))]
|
|
6094
|
-
},
|
|
6095
|
-
{
|
|
6096
|
-
id: PresetType.LAST_90_DAYS,
|
|
6097
|
-
title: "Last 90 days",
|
|
6098
|
-
subtitle: "The previous 90 days before today",
|
|
6099
|
-
dates: [timeDay.floor(timeDay.offset(today, -91)), timeDay.floor(timeDay.offset(today, -1))]
|
|
6100
|
-
},
|
|
6101
|
-
{
|
|
6102
|
-
id: PresetType.LAST_180_DAYS,
|
|
6103
|
-
title: "Last 180 days",
|
|
6104
|
-
subtitle: "The previous 180 days before today",
|
|
6105
|
-
dates: [timeDay.floor(timeDay.offset(today, -181)), timeDay.floor(timeDay.offset(today, -1))]
|
|
6106
|
-
},
|
|
6107
|
-
{
|
|
6108
|
-
id: PresetType.LAST_365_DAYS,
|
|
6109
|
-
title: "Last 365 days",
|
|
6110
|
-
subtitle: "The previous 365 days before today",
|
|
6111
|
-
dates: [timeDay.floor(timeDay.offset(today, -366)), timeDay.floor(timeDay.offset(today, -1))]
|
|
6112
|
-
}
|
|
5809
|
+
(function(DateComponent) {
|
|
5810
|
+
DateComponent.Sizes = [
|
|
5811
|
+
"xsmall",
|
|
5812
|
+
"small",
|
|
5813
|
+
"medium",
|
|
5814
|
+
"large",
|
|
5815
|
+
"xlarge"
|
|
6113
5816
|
];
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
5817
|
+
function parseDate(input) {
|
|
5818
|
+
const trimmed = input.trim();
|
|
5819
|
+
if (!trimmed) return void 0;
|
|
5820
|
+
const ymd = /^\d+$/.test(trimmed) ? parseDigits(trimmed) : parseSeparated(trimmed);
|
|
5821
|
+
if (!ymd) return void 0;
|
|
5822
|
+
const [year, month, day] = ymd;
|
|
5823
|
+
const date = new Date(year, month - 1, day);
|
|
5824
|
+
return date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day ? date : void 0;
|
|
6122
5825
|
}
|
|
6123
|
-
|
|
6124
|
-
|
|
5826
|
+
DateComponent.parseDate = parseDate;
|
|
5827
|
+
function expandTwoDigitYear(year) {
|
|
5828
|
+
return year < 100 ? year + (year < 50 ? 2e3 : 1900) : year;
|
|
6125
5829
|
}
|
|
6126
|
-
|
|
6127
|
-
|
|
5830
|
+
function parseDigits(digits) {
|
|
5831
|
+
if (digits.length !== 8 && digits.length !== 6) return void 0;
|
|
5832
|
+
const year = parseInt(digits.slice(4), 10);
|
|
5833
|
+
return [
|
|
5834
|
+
digits.length === 6 ? expandTwoDigitYear(year) : year,
|
|
5835
|
+
parseInt(digits.slice(0, 2), 10),
|
|
5836
|
+
parseInt(digits.slice(2, 4), 10)
|
|
5837
|
+
];
|
|
6128
5838
|
}
|
|
6129
|
-
|
|
6130
|
-
|
|
5839
|
+
function parseSeparated(input) {
|
|
5840
|
+
const parts = input.split(/[/.-]/);
|
|
5841
|
+
if (parts.length !== 3) return void 0;
|
|
5842
|
+
const nums = parts.map((p) => parseInt(p, 10));
|
|
5843
|
+
if (nums.some(isNaN)) return void 0;
|
|
5844
|
+
const [year, month, day] = parts[0].length === 4 ? nums : [
|
|
5845
|
+
nums[2],
|
|
5846
|
+
nums[0],
|
|
5847
|
+
nums[1]
|
|
5848
|
+
];
|
|
5849
|
+
return [
|
|
5850
|
+
parts[0].length === 4 ? year : expandTwoDigitYear(year),
|
|
5851
|
+
month,
|
|
5852
|
+
day
|
|
5853
|
+
];
|
|
6131
5854
|
}
|
|
6132
|
-
|
|
5855
|
+
function isValidDate(date, min, max) {
|
|
5856
|
+
const time = date.getTime();
|
|
5857
|
+
return time >= timeDay.floor(min).getTime() && time <= max.getTime();
|
|
5858
|
+
}
|
|
5859
|
+
DateComponent.isValidDate = isValidDate;
|
|
5860
|
+
})(DateComponent || (DateComponent = {}));
|
|
5861
|
+
const timeQuarter = timeMonth.every(3);
|
|
5862
|
+
var DateRangeComponent = class DateRangeComponent extends InputLabelComponent {
|
|
5863
|
+
constructor(host) {
|
|
6133
5864
|
super();
|
|
6134
|
-
this.cdr = cdr;
|
|
6135
5865
|
this.host = host;
|
|
6136
|
-
this.
|
|
6137
|
-
this.
|
|
6138
|
-
this.
|
|
6139
|
-
this.
|
|
6140
|
-
this.
|
|
6141
|
-
this.
|
|
6142
|
-
this.
|
|
6143
|
-
this.
|
|
5866
|
+
this.TODAY = /* @__PURE__ */ new Date();
|
|
5867
|
+
this.STORAGE_KEY = "date-range.default";
|
|
5868
|
+
this.calendarId = uniqueId("riv-date-range-calendar-");
|
|
5869
|
+
this.showPresets$ = new BehaviorSubject(true);
|
|
5870
|
+
this.min$ = new BehaviorSubject(CalendarComponent.defaultMin);
|
|
5871
|
+
this.max$ = new BehaviorSubject(CalendarComponent.defaultMax);
|
|
5872
|
+
this.value$ = new BehaviorSubject(void 0);
|
|
5873
|
+
this.distinctValue$ = this.value$.pipe(distinctUntilChanged((previous, current) => previous?.[0].valueOf() === current?.[0].valueOf() && previous?.[1].valueOf() === current?.[1].valueOf()), shareReplay({
|
|
5874
|
+
refCount: true,
|
|
5875
|
+
bufferSize: 1
|
|
5876
|
+
}));
|
|
5877
|
+
this.placeholder$ = new BehaviorSubject("Select date range");
|
|
5878
|
+
this.disabled$ = new BehaviorSubject(false);
|
|
5879
|
+
this.alternativePresetList$ = new BehaviorSubject([]);
|
|
6144
5880
|
this.open$ = new BehaviorSubject(false);
|
|
6145
|
-
this.
|
|
6146
|
-
this.
|
|
6147
|
-
this.
|
|
6148
|
-
this.
|
|
6149
|
-
|
|
5881
|
+
this.userSelectedPreset$ = new Subject();
|
|
5882
|
+
this.userSelectedDate$ = new Subject();
|
|
5883
|
+
this.userTypedRange$ = new Subject();
|
|
5884
|
+
this.selectedValue$ = merge(this.distinctValue$, merge(this.userSelectedDate$, this.userTypedRange$).pipe(scan((previous, date) => {
|
|
5885
|
+
if (previous instanceof Date && date instanceof Date) {
|
|
5886
|
+
if (date.valueOf() >= previous.valueOf()) return [previous, date];
|
|
5887
|
+
}
|
|
5888
|
+
return date;
|
|
5889
|
+
})), this.userSelectedPreset$.pipe(filter((preset) => preset !== null), map((preset) => preset.dates))).pipe(shareReplay({
|
|
5890
|
+
refCount: true,
|
|
5891
|
+
bufferSize: 1
|
|
5892
|
+
}));
|
|
5893
|
+
this.filteredPresetOptions$ = combineLatest([
|
|
5894
|
+
this.min$,
|
|
5895
|
+
this.max$,
|
|
5896
|
+
this.alternativePresetList$
|
|
5897
|
+
]).pipe(map(([min, max, alternativePresetList]) => {
|
|
5898
|
+
const optionsFilteredOnMinMax = DateRangeComponent.Presets.filter((p) => p.dates[0].valueOf() >= min.valueOf() && p.dates[1].valueOf() <= max.valueOf());
|
|
5899
|
+
if (alternativePresetList.length == 0) return optionsFilteredOnMinMax;
|
|
5900
|
+
else return optionsFilteredOnMinMax.filter((p) => alternativePresetList.includes(p.id));
|
|
5901
|
+
}), shareReplay({
|
|
5902
|
+
refCount: true,
|
|
5903
|
+
bufferSize: 1
|
|
5904
|
+
}));
|
|
5905
|
+
this.selectedPreset$ = combineLatest([this.selectedValue$, this.userSelectedPreset$.pipe(startWith(null))]).pipe(map(([selectedValue, userSelectedPreset]) => {
|
|
5906
|
+
if (selectedValue instanceof Array) {
|
|
5907
|
+
const options = DateRangeComponent.Presets.filter((preset) => preset.dates[0].valueOf() === selectedValue[0].valueOf() && preset.dates[1].valueOf() === selectedValue[1].valueOf());
|
|
5908
|
+
if (options.length) {
|
|
5909
|
+
const mostRecent = options.find((option) => option.id === userSelectedPreset?.id);
|
|
5910
|
+
if (mostRecent) return mostRecent;
|
|
5911
|
+
return options[0];
|
|
5912
|
+
}
|
|
5913
|
+
}
|
|
5914
|
+
return null;
|
|
5915
|
+
}));
|
|
5916
|
+
this.favoritePresetIds$ = new LocalStorage(this.STORAGE_KEY, []);
|
|
5917
|
+
this.favoritePresets$ = combineLatest([
|
|
5918
|
+
this.favoritePresetIds$,
|
|
5919
|
+
this.filteredPresetOptions$,
|
|
5920
|
+
this.alternativePresetList$
|
|
5921
|
+
]).pipe(map(([ids, presets, alternativePresetList]) => {
|
|
5922
|
+
const favoritePresets = ids.map((id) => presets.find((preset) => preset.id === id)).filter((p) => p !== void 0);
|
|
5923
|
+
if (alternativePresetList.length == 0) return favoritePresets;
|
|
5924
|
+
else return favoritePresets.filter((p) => alternativePresetList.includes(p.id));
|
|
5925
|
+
}), shareReplay({
|
|
5926
|
+
refCount: true,
|
|
5927
|
+
bufferSize: 1
|
|
5928
|
+
}));
|
|
5929
|
+
this.userLeftActiveYearMonth$ = new Subject();
|
|
5930
|
+
this.userRightActiveYearMonth$ = new Subject();
|
|
5931
|
+
this.leftMin$ = this.min$.pipe(shareReplay({
|
|
5932
|
+
refCount: true,
|
|
5933
|
+
bufferSize: 1
|
|
5934
|
+
}));
|
|
5935
|
+
this.leftMax$ = this.max$.pipe(map((max) => timeDay.offset(timeMonth.floor(max), -1)), shareReplay({
|
|
5936
|
+
refCount: true,
|
|
5937
|
+
bufferSize: 1
|
|
5938
|
+
}));
|
|
5939
|
+
this.rightMax$ = this.max$.pipe(shareReplay({
|
|
5940
|
+
refCount: true,
|
|
5941
|
+
bufferSize: 1
|
|
5942
|
+
}));
|
|
5943
|
+
this.leftActiveYearMonth$ = combineLatest([this.leftMax$, merge(this.userLeftActiveYearMonth$.pipe(startWith(timeMonth.floor(this.TODAY))), this.userSelectedPreset$.pipe(filter((preset) => preset !== null), map((preset) => timeMonth.floor(preset.dates[0]))), this.userTypedRange$.pipe(map((range) => timeMonth.floor(range[0]))), this.distinctValue$.pipe(filter((v) => v !== void 0), map((v) => timeMonth.floor(v[0]))))]).pipe(map(([leftMax, left]) => {
|
|
5944
|
+
if (left.valueOf() >= leftMax.valueOf()) return timeMonth.floor(leftMax);
|
|
5945
|
+
else return left;
|
|
5946
|
+
}), shareReplay({
|
|
5947
|
+
refCount: true,
|
|
5948
|
+
bufferSize: 1
|
|
5949
|
+
}));
|
|
5950
|
+
this.rightActiveYearMonth$ = combineLatest([
|
|
5951
|
+
this.leftActiveYearMonth$,
|
|
5952
|
+
merge(this.userRightActiveYearMonth$.pipe(startWith(timeMonth.ceil(this.TODAY))), this.userSelectedPreset$.pipe(filter((preset) => preset !== null), map((preset) => timeMonth.floor(preset.dates[1]))), this.userTypedRange$.pipe(map((range) => timeMonth.floor(range[1]))), this.distinctValue$.pipe(filter((v) => v !== void 0), map((v) => timeMonth.floor(v[1])))),
|
|
5953
|
+
this.rightMax$
|
|
5954
|
+
]).pipe(map(([left, userRight, rightMax$]) => {
|
|
5955
|
+
if (left.valueOf() >= userRight.valueOf()) return timeMonth.floor(timeMonth.offset(left, 1));
|
|
5956
|
+
else if (userRight.valueOf() >= rightMax$.valueOf()) return timeMonth.floor(rightMax$);
|
|
5957
|
+
else return userRight;
|
|
5958
|
+
}), shareReplay({
|
|
5959
|
+
refCount: true,
|
|
5960
|
+
bufferSize: 1
|
|
5961
|
+
}));
|
|
5962
|
+
this.rightMin$ = this.leftActiveYearMonth$.pipe(map((left) => timeMonth.floor(timeMonth.offset(left, 1))), shareReplay({
|
|
5963
|
+
refCount: true,
|
|
5964
|
+
bufferSize: 1
|
|
5965
|
+
}));
|
|
5966
|
+
this.leftOmitRange$ = this.rightActiveYearMonth$.pipe(map((rightActiveYearMonth) => {
|
|
5967
|
+
return [timeMonth.floor(rightActiveYearMonth), timeDay.offset(timeMonth.floor(timeMonth.offset(rightActiveYearMonth, 1)), -1)];
|
|
5968
|
+
}), shareReplay({
|
|
5969
|
+
refCount: true,
|
|
5970
|
+
bufferSize: 1
|
|
5971
|
+
}));
|
|
5972
|
+
this.userInteracted$ = merge(this.userSelectedDate$, this.userSelectedPreset$, this.userTypedRange$);
|
|
5973
|
+
this.valueChange = this.selectedValue$.pipe(skipUntil(merge(this.userInteracted$, this.selectedValue$.pipe(filter((v) => v !== void 0)))), filter((v) => !(v instanceof Date)), distinctUntilChanged((previous, current) => previous?.[0].valueOf() === current?.[0].valueOf() && previous?.[1].valueOf() === current?.[1].valueOf()), shareReplay({
|
|
5974
|
+
refCount: true,
|
|
5975
|
+
bufferSize: 1
|
|
5976
|
+
}));
|
|
5977
|
+
this.displayValue$ = this.valueChange.pipe(map((v) => {
|
|
5978
|
+
if (v) return v.map((date) => new DatePipe().transform(date)).join(" — ");
|
|
5979
|
+
}), shareReplay({
|
|
5980
|
+
refCount: true,
|
|
5981
|
+
bufferSize: 1
|
|
5982
|
+
}));
|
|
5983
|
+
this.typedText$ = new BehaviorSubject(null);
|
|
5984
|
+
this.inputText$ = combineLatest([this.typedText$, this.displayValue$.pipe(startWith(void 0))]).pipe(map(([typed, display]) => typed ?? display ?? ""));
|
|
6150
5985
|
}
|
|
6151
|
-
|
|
6152
|
-
|
|
5986
|
+
set showPresets(v) {
|
|
5987
|
+
this.showPresets$.next(v);
|
|
6153
5988
|
}
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
if (this.isInsidePicker(target)) return;
|
|
6157
|
-
this.open$.next(false);
|
|
6158
|
-
this.cdr.markForCheck();
|
|
5989
|
+
get showPresets() {
|
|
5990
|
+
return this.showPresets$.getValue();
|
|
6159
5991
|
}
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
if (host.contains(target)) return true;
|
|
6163
|
-
const layer = target.closest(".callout, .scrim, .overlay-container");
|
|
6164
|
-
return !!layer && !layer.contains(host);
|
|
5992
|
+
set min(v) {
|
|
5993
|
+
this.min$.next(v);
|
|
6165
5994
|
}
|
|
6166
|
-
|
|
6167
|
-
this.
|
|
6168
|
-
this.open$.next(false);
|
|
5995
|
+
get min() {
|
|
5996
|
+
return this.min$.getValue();
|
|
6169
5997
|
}
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
this.commit(this.isRolling ? void 0 : timeDay.floor(/* @__PURE__ */ new Date()));
|
|
6173
|
-
this.open$.next(false);
|
|
5998
|
+
set max(v) {
|
|
5999
|
+
this.max$.next(v);
|
|
6174
6000
|
}
|
|
6175
|
-
get
|
|
6176
|
-
return
|
|
6001
|
+
get max() {
|
|
6002
|
+
return this.max$.getValue();
|
|
6177
6003
|
}
|
|
6178
|
-
|
|
6179
|
-
|
|
6004
|
+
set value(v) {
|
|
6005
|
+
this.value$.next(v);
|
|
6180
6006
|
}
|
|
6181
|
-
|
|
6182
|
-
this.
|
|
6183
|
-
const parsed = this.parseInput(value);
|
|
6184
|
-
this.previewValue = parsed;
|
|
6185
|
-
if (parsed) this.setActiveMonth(parsed);
|
|
6186
|
-
this.cdr.markForCheck();
|
|
6007
|
+
get value() {
|
|
6008
|
+
return this.value$.getValue();
|
|
6187
6009
|
}
|
|
6188
|
-
|
|
6189
|
-
this.
|
|
6190
|
-
const parsed = this.parseInput(this.inputText);
|
|
6191
|
-
if (parsed) this.commit(parsed);
|
|
6192
|
-
else if (!this.inputText.trim() || this.isRollingText(this.inputText)) this.commit(void 0);
|
|
6193
|
-
else this.syncInputText();
|
|
6194
|
-
this.previewValue = void 0;
|
|
6195
|
-
const nextTarget = event?.relatedTarget;
|
|
6196
|
-
if (!(nextTarget instanceof Element && this.isInsidePicker(nextTarget))) this.open$.next(false);
|
|
6197
|
-
this.cdr.markForCheck();
|
|
6010
|
+
set placeholder(v) {
|
|
6011
|
+
this.placeholder$.next(v);
|
|
6198
6012
|
}
|
|
6199
|
-
|
|
6200
|
-
this.
|
|
6201
|
-
|
|
6013
|
+
get placeholder() {
|
|
6014
|
+
return this.placeholder$.getValue();
|
|
6015
|
+
}
|
|
6016
|
+
set disabled(v) {
|
|
6017
|
+
this.disabled$.next(v);
|
|
6018
|
+
}
|
|
6019
|
+
get disabled() {
|
|
6020
|
+
return this.disabled$.getValue();
|
|
6021
|
+
}
|
|
6022
|
+
getTrigger() {
|
|
6023
|
+
return this.customTriggerButton?.nativeElement ?? this.standardTriggerButton?.nativeElement ?? null;
|
|
6024
|
+
}
|
|
6025
|
+
set alternativePresetList(v) {
|
|
6026
|
+
this.alternativePresetList$.next(v);
|
|
6027
|
+
}
|
|
6028
|
+
get alternativePresetList() {
|
|
6029
|
+
return this.alternativePresetList$.getValue();
|
|
6030
|
+
}
|
|
6031
|
+
setFavorite(preset, favorite) {
|
|
6032
|
+
const ids = new Set(this.favoritePresetIds$.getValue());
|
|
6033
|
+
if (favorite) ids.add(preset.id);
|
|
6034
|
+
else ids.delete(preset.id);
|
|
6035
|
+
this.favoritePresetIds$.next([...ids]);
|
|
6202
6036
|
}
|
|
6203
6037
|
onInputFocus() {
|
|
6204
|
-
this.hasFocus = true;
|
|
6205
6038
|
this.open$.next(true);
|
|
6206
6039
|
}
|
|
6040
|
+
onInputChange(text) {
|
|
6041
|
+
this.typedText$.next(text);
|
|
6042
|
+
}
|
|
6043
|
+
onInputBlur(event) {
|
|
6044
|
+
this.closeOnFocusLeaving(event);
|
|
6045
|
+
this.commitTypedText();
|
|
6046
|
+
}
|
|
6047
|
+
onInputEnter() {
|
|
6048
|
+
this.closeCalendar();
|
|
6049
|
+
this.commitTypedText();
|
|
6050
|
+
}
|
|
6207
6051
|
toggleCalendar() {
|
|
6208
|
-
this.open$.
|
|
6052
|
+
if (this.open$.getValue()) this.closeCalendar();
|
|
6053
|
+
else this.open$.next(true);
|
|
6209
6054
|
}
|
|
6210
|
-
|
|
6211
|
-
|
|
6055
|
+
onEscape(event) {
|
|
6056
|
+
if (!this.open$.getValue() || event.defaultPrevented) return;
|
|
6057
|
+
event.preventDefault();
|
|
6058
|
+
(this.inputElement ?? this.customTriggerButton)?.nativeElement.focus();
|
|
6059
|
+
this.closeCalendar();
|
|
6212
6060
|
}
|
|
6213
|
-
|
|
6214
|
-
|
|
6061
|
+
onInputArrowDown() {
|
|
6062
|
+
this.open$.next(true);
|
|
6063
|
+
setTimeout(() => document.getElementById(this.calendarId)?.querySelector(DateRangeComponent.focusableSelector)?.focus(), 0);
|
|
6215
6064
|
}
|
|
6216
|
-
|
|
6217
|
-
|
|
6065
|
+
closeOnFocusLeaving(event) {
|
|
6066
|
+
const next = event?.relatedTarget;
|
|
6067
|
+
if (next instanceof Element && !this.isInsidePicker(next)) this.closeCalendar();
|
|
6218
6068
|
}
|
|
6219
|
-
|
|
6220
|
-
|
|
6069
|
+
closeCalendar() {
|
|
6070
|
+
this.open$.next(false);
|
|
6071
|
+
if (this.value) this.userTypedRange$.next(this.value);
|
|
6072
|
+
else this.userSelectedDate$.next(void 0);
|
|
6221
6073
|
}
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
|
|
6074
|
+
onDocumentMouseDown(target) {
|
|
6075
|
+
if (!this.open$.getValue() || !(target instanceof Element)) return;
|
|
6076
|
+
if (this.isInsidePicker(target)) return;
|
|
6077
|
+
this.closeCalendar();
|
|
6225
6078
|
}
|
|
6226
|
-
|
|
6227
|
-
const
|
|
6228
|
-
if (
|
|
6079
|
+
isInsidePicker(target) {
|
|
6080
|
+
const host = this.host.nativeElement;
|
|
6081
|
+
if (host.contains(target)) return true;
|
|
6082
|
+
const layer = target.closest(".callout, .scrim, .overlay-container");
|
|
6083
|
+
return !!layer && !layer.contains(host);
|
|
6229
6084
|
}
|
|
6230
|
-
|
|
6231
|
-
const
|
|
6232
|
-
|
|
6233
|
-
this.
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6085
|
+
commitTypedText() {
|
|
6086
|
+
const text = this.typedText$.getValue();
|
|
6087
|
+
if (text === null) return;
|
|
6088
|
+
this.typedText$.next(null);
|
|
6089
|
+
if (!text.trim()) {
|
|
6090
|
+
this.userSelectedDate$.next(void 0);
|
|
6091
|
+
return;
|
|
6092
|
+
}
|
|
6093
|
+
const range = DateRangeComponent.parseDateRange(text, this.min, this.max);
|
|
6094
|
+
if (range) this.userTypedRange$.next(range);
|
|
6238
6095
|
}
|
|
6239
6096
|
static {
|
|
6240
6097
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
6241
6098
|
minVersion: "12.0.0",
|
|
6242
6099
|
version: "22.2.4",
|
|
6243
6100
|
ngImport: i0,
|
|
6244
|
-
type:
|
|
6245
|
-
deps: [{ token: i0.
|
|
6101
|
+
type: DateRangeComponent,
|
|
6102
|
+
deps: [{ token: i0.ElementRef }],
|
|
6246
6103
|
target: i0.ɵɵFactoryTarget.Component
|
|
6247
6104
|
});
|
|
6248
6105
|
}
|
|
@@ -6250,35 +6107,64 @@ var DateComponent = class DateComponent extends InputLabelComponent {
|
|
|
6250
6107
|
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
6251
6108
|
minVersion: "14.0.0",
|
|
6252
6109
|
version: "22.2.4",
|
|
6253
|
-
type:
|
|
6110
|
+
type: DateRangeComponent,
|
|
6254
6111
|
isStandalone: false,
|
|
6255
|
-
selector: "riv-date",
|
|
6112
|
+
selector: "riv-date-range",
|
|
6256
6113
|
inputs: {
|
|
6114
|
+
showPresets: "showPresets",
|
|
6257
6115
|
min: "min",
|
|
6258
6116
|
max: "max",
|
|
6259
6117
|
value: "value",
|
|
6260
6118
|
placeholder: "placeholder",
|
|
6261
6119
|
disabled: "disabled",
|
|
6262
|
-
|
|
6263
|
-
showClearButton: "showClearButton",
|
|
6264
|
-
showTodayButton: "showTodayButton",
|
|
6265
|
-
rollingTodayLabel: "rollingTodayLabel",
|
|
6266
|
-
open: "open"
|
|
6120
|
+
alternativePresetList: "alternativePresetList"
|
|
6267
6121
|
},
|
|
6268
6122
|
outputs: { valueChange: "valueChange" },
|
|
6269
6123
|
host: { listeners: { "document:mousedown": "onDocumentMouseDown($event.target)" } },
|
|
6270
6124
|
queries: [{
|
|
6271
|
-
propertyName: "
|
|
6125
|
+
propertyName: "triggerTemplate",
|
|
6272
6126
|
first: true,
|
|
6273
|
-
predicate: ["
|
|
6127
|
+
predicate: ["trigger"],
|
|
6274
6128
|
descendants: true
|
|
6275
6129
|
}],
|
|
6130
|
+
viewQueries: [
|
|
6131
|
+
{
|
|
6132
|
+
propertyName: "customTriggerButton",
|
|
6133
|
+
first: true,
|
|
6134
|
+
predicate: ["customTriggerButton"],
|
|
6135
|
+
descendants: true,
|
|
6136
|
+
read: ElementRef
|
|
6137
|
+
},
|
|
6138
|
+
{
|
|
6139
|
+
propertyName: "standardTriggerButton",
|
|
6140
|
+
first: true,
|
|
6141
|
+
predicate: ["standardTriggerButton"],
|
|
6142
|
+
descendants: true,
|
|
6143
|
+
read: ElementRef
|
|
6144
|
+
},
|
|
6145
|
+
{
|
|
6146
|
+
propertyName: "inputElement",
|
|
6147
|
+
first: true,
|
|
6148
|
+
predicate: ["input"],
|
|
6149
|
+
descendants: true,
|
|
6150
|
+
read: ElementRef
|
|
6151
|
+
}
|
|
6152
|
+
],
|
|
6276
6153
|
usesInheritance: true,
|
|
6277
|
-
usesOnChanges: true,
|
|
6278
6154
|
ngImport: i0,
|
|
6279
|
-
template: "<
|
|
6280
|
-
styles: [".trigger{width:100%;border:var(--border-width) solid var(--border-light);border-radius:var(--border-radius-small);display:flex;gap:var(--size-small);background-color:var(--surface-light-0);padding-left:var(--size-small)
|
|
6155
|
+
template: "<ng-container *ngIf=\"triggerTemplate; else standardTrigger\">\n <button\n #customTriggerButton\n (click)=\"open$.next(true)\"\n [disabled]=\"disabled$ | async\"\n [attr.aria-disabled]=\"(disabled$ | async) ? 'true' : null\"\n type=\"button\"\n >\n <ng-container\n [ngTemplateOutlet]=\"triggerTemplate\"\n [ngTemplateOutletContext]=\"{ open: open$ | async }\"\n ></ng-container>\n </button>\n</ng-container>\n<ng-template #standardTrigger>\n <riv-input-label\n [label]=\"label\"\n [help]=\"help\"\n [required]=\"required\"\n [state]=\"state\"\n [errorMessage]=\"errorMessage\"\n [labelActionText]=\"labelActionText\"\n (labelAction)=\"labelAction.emit($event)\"\n >\n <div\n #standardTriggerButton\n class=\"trigger\"\n [class.warning]=\"state === 'warning'\"\n [class.error]=\"state === 'error'\"\n [class.disabled]=\"disabled$ | async\"\n >\n <input\n #input\n class=\"value\"\n [placeholder]=\"placeholder$ | async\"\n [value]=\"inputText$ | async\"\n [disabled]=\"disabled$ | async\"\n [attr.aria-disabled]=\"(disabled$ | async) ? 'true' : null\"\n [attr.aria-label]=\"label || null\"\n [attr.aria-controls]=\"calendarId\"\n [attr.aria-expanded]=\"open$ | async\"\n role=\"combobox\"\n aria-haspopup=\"dialog\"\n aria-autocomplete=\"none\"\n (input)=\"onInputChange(input.value)\"\n (blur)=\"onInputBlur($event)\"\n (focus)=\"onInputFocus()\"\n (click)=\"open$.next(true)\"\n (keydown.enter)=\"onInputEnter(); input.blur(); $event.preventDefault()\"\n (keydown.escape)=\"onEscape($event)\"\n (keydown.arrowdown)=\"onInputArrowDown(); $event.preventDefault()\"\n (keydown.alt.arrowdown)=\"onInputArrowDown(); $event.preventDefault()\"\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n />\n <button\n class=\"chevron\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"toggleCalendar()\"\n [disabled]=\"disabled$ | async\"\n [attr.aria-disabled]=\"(disabled$ | async) ? 'true' : null\"\n [attr.aria-label]=\"(open$ | async) ? 'Close calendar' : 'Open calendar'\"\n type=\"button\"\n tabindex=\"-1\"\n >\n <riv-icon [name]=\"'Calendar'\" [size]=\"16\"></riv-icon>\n </button>\n </div>\n </riv-input-label>\n</ng-template>\n\n<ng-container *ngIf=\"open$ | async\">\n <riv-callout\n *riv-overlay\n [anchor]=\"getTrigger()\"\n [isModal]=\"!!triggerTemplate\"\n [showCaret]=\"false\"\n [theme]=\"'light'\"\n [allowedPositions]=\"[\n 'top-left',\n 'top-right',\n 'bottom-right',\n 'bottom-left'\n ]\"\n [preferredPosition]=\"'bottom-right'\"\n (close)=\"closeCalendar()\"\n >\n <div\n class=\"content\"\n [class.include-preset]=\"showPresets\"\n [attr.id]=\"calendarId\"\n (keydown.escape)=\"onEscape($event)\"\n (focusout)=\"closeOnFocusLeaving($event)\"\n >\n <div *ngIf=\"showPresets\" class=\"presets\">\n <riv-simple-select\n [label]=\"'Date presets'\"\n [filterabilityOptions]=\"{ enabled: true, placeholder: 'Search' }\"\n [orderBy]=\"'source'\"\n [optionGroups]=\"\n (filteredPresetOptions$ | async) ?? [] | rivOptionGroup\n \"\n [selectedOption]=\"selectedPreset$ | async\"\n (selectedOptionChange)=\"userSelectedPreset$.next($event)\"\n >\n <ng-template #option let-node=\"node\">\n <ng-template\n #self\n [ngTemplateOutlet]=\"self\"\n let-isFavorite\n [ngTemplateOutletContext]=\"{\n $implicit: $safeNavigationMigration(\n (favoritePresetIds$ | async)?.includes(node.id)\n )\n }\"\n >\n <div class=\"preset\" [class.favorite]=\"isFavorite\">\n <div class=\"description\">\n <riv-highlight\n class=\"title\"\n [text]=\"node.title\"\n [indices]=\"node.titleHighlightIndices || []\"\n ></riv-highlight>\n <riv-highlight\n class=\"subtitle\"\n [text]=\"node.subtitle\"\n [indices]=\"node.subtitleHighlightIndices || []\"\n ></riv-highlight>\n </div>\n <button\n (click)=\"\n setFavorite(node, !isFavorite); $event.stopPropagation()\n \"\n type=\"button\"\n >\n <riv-icon\n [name]=\"isFavorite ? 'HeartActive' : 'Heart'\"\n [size]=\"16\"\n [rivTooltip]=\"'Mark as favorite'\"\n ></riv-icon>\n </button>\n </div>\n </ng-template>\n </ng-template>\n </riv-simple-select>\n <ng-template\n #self\n [ngTemplateOutlet]=\"self\"\n let-favorites\n [ngTemplateOutletContext]=\"{ $implicit: favoritePresets$ | async }\"\n >\n <riv-input-label *ngIf=\"favorites.length\" [label]=\"'Favorites'\">\n <div class=\"shortcuts\">\n <button\n *ngFor=\"let favorite of favorites\"\n class=\"shortcut\"\n [class.active]=\"(selectedPreset$ | async)?.id === favorite.id\"\n (click)=\"userSelectedPreset$.next(favorite)\"\n type=\"button\"\n >\n <span class=\"title\">{{ favorite.title }}</span>\n <button\n (click)=\"setFavorite(favorite, false)\"\n [rivTooltip]=\"'Remove favorite'\"\n type=\"button\"\n >\n <riv-icon [name]=\"'HeartActive'\" [size]=\"16\"></riv-icon>\n </button>\n </button>\n </div>\n </riv-input-label>\n </ng-template>\n </div>\n\n <div class=\"calendars\">\n <riv-calendar\n class=\"left\"\n [activeYearMonth]=\"(leftActiveYearMonth$ | async) || TODAY\"\n (activeYearMonthChange)=\"userLeftActiveYearMonth$.next($event)\"\n [displayMin]=\"(min$ | async) || TODAY\"\n [displayMax]=\"(max$ | async) || TODAY\"\n [selectableMin]=\"(leftMin$ | async) || TODAY\"\n [selectableMax]=\"(leftMax$ | async) || TODAY\"\n [omitRange]=\"(leftOmitRange$ | async) || [TODAY, TODAY]\"\n [selectedValue]=\"(selectedValue$ | async) || TODAY\"\n (dateSelect)=\"userSelectedDate$.next($event)\"\n ></riv-calendar>\n <riv-calendar\n class=\"right\"\n [activeYearMonth]=\"(rightActiveYearMonth$ | async) || TODAY\"\n (activeYearMonthChange)=\"userRightActiveYearMonth$.next($event)\"\n [displayMin]=\"(min$ | async) || TODAY\"\n [displayMax]=\"(max$ | async) || TODAY\"\n [selectableMin]=\"(rightMin$ | async) || TODAY\"\n [selectableMax]=\"(rightMax$ | async) || TODAY\"\n [selectedValue]=\"(selectedValue$ | async) || TODAY\"\n (dateSelect)=\"userSelectedDate$.next($event)\"\n ></riv-calendar>\n </div>\n\n <footer class=\"buttons\">\n <button\n rivButton\n [size]=\"'small'\"\n [variant]=\"'ghost'\"\n (click)=\"userSelectedDate$.next(undefined)\"\n type=\"button\"\n >\n Clear\n </button>\n <button\n rivButton\n [size]=\"'small'\"\n [variant]=\"'primary'\"\n (click)=\"closeCalendar()\"\n type=\"button\"\n >\n Done\n </button>\n </footer>\n </div>\n </riv-callout>\n</ng-container>\n",
|
|
6156
|
+
styles: [".trigger{width:100%;border:var(--border-width) solid var(--border-light);border-radius:var(--border-radius-small);display:flex;gap:var(--size-small);background-color:var(--surface-light-0);padding-left:var(--size-small)}.trigger:focus-within{outline:none;border:var(--border-width) solid var(--purp-60)}.trigger.disabled{color:var(--type-light-disabled);background-color:var(--surface-light-1)}.value{font:var(--input-medium);color:var(--type-light-high-contrast);padding:var(--size-small) 0;flex-grow:1;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:pre;border:none;background:transparent;outline:none;width:100%}.value::placeholder{color:var(--type-light-low-contrast)}.value:disabled{color:var(--type-light-disabled)}.chevron{display:flex;justify-content:center;align-items:center;padding:var(--size-xsmall) calc(var(--base-grid-size) * 1.5);border:none;background:transparent;cursor:pointer;color:var(--type-light-high-contrast)}.chevron:disabled{color:var(--type-light-disabled);cursor:not-allowed}.trigger.warning{border-color:var(--surface-dark-caution)}.trigger.error{border-color:var(--surface-dark-danger);box-shadow:inset 0 0 0 var(--border-width-large) var(--surface-dark-danger)}.content{display:inline-grid;grid-template-rows:1fr auto}.content.include-preset{grid-template-columns:calc(var(--base-grid-size) * 50) 1fr 1fr}.presets{grid-area:1 / 1 / 3 / 2;background-color:var(--surface-light-1);padding:var(--size-xlarge) var(--size-large);border-right:var(--border-width) solid var(--border-light);display:flex;flex-direction:column;gap:var(--size-medium)}.preset{display:flex;transition:background-color var(--short-transition)}.preset:hover{background-color:var(--surface-light-2)}.preset button{color:transparent;transition:color var(--short-transition);padding:var(--size-medium) var(--size-large) var(--size-medium) var(--size-small);cursor:pointer}.preset:hover button{color:var(--type-light-low-contrast)}.preset button:hover{color:var(--type-light-high-contrast)}.preset.favorite button{color:var(--type-light-link)}.preset .description{flex-grow:1;padding:var(--size-medium) var(--size-small) var(--size-medium) var(--size-medium)}.preset .title{display:block;font-size:var(--type-2-font-size);line-height:var(--type-2-line-height-1)}.preset .subtitle{display:block;font-size:var(--type-1-font-size);line-height:var(--type-1-line-height-1);color:var(--type-light-low-contrast)}.shortcuts{display:flex;flex-direction:column;gap:var(--size-xsmall);overflow-y:auto}.shortcut{display:flex;align-items:center;padding:var(--size-small) var(--size-small) var(--size-small) var(--size-medium);gap:var(--size-small);border-radius:var(--border-radius-small);transition:background-color var(--short-transition);cursor:pointer}.shortcut:hover{background-color:var(--black-20)}.shortcut.active{background-color:var(--baloo-05)}.shortcut .title{flex-grow:1;text-align:left;font-size:var(--type-1-font-size);line-height:var(--type-1-line-height-2)}.shortcut button{color:transparent;transition:color var(--short-transition);cursor:pointer}.shortcut:hover button{color:var(--type-light-link)}.calendars{grid-column:2 / 4;display:grid;grid-template-columns:subgrid;grid-template-rows:subgrid;padding:var(--size-large)}.left{grid-area:1 / 1 / 2 / 2;padding-right:var(--size-large);border-right:var(--border-width) solid var(--border-light)}.right{padding-left:var(--size-large);grid-area:1 / 2 / 2 / 3}.buttons{grid-area:2 / 2 / 3 / 4;padding:var(--size-small);display:flex;justify-content:space-between}\n"],
|
|
6281
6157
|
dependencies: [
|
|
6158
|
+
{
|
|
6159
|
+
kind: "directive",
|
|
6160
|
+
type: i1.NgForOf,
|
|
6161
|
+
selector: "[ngFor][ngForOf]",
|
|
6162
|
+
inputs: [
|
|
6163
|
+
"ngForOf",
|
|
6164
|
+
"ngForTrackBy",
|
|
6165
|
+
"ngForTemplate"
|
|
6166
|
+
]
|
|
6167
|
+
},
|
|
6282
6168
|
{
|
|
6283
6169
|
kind: "directive",
|
|
6284
6170
|
type: i1.NgIf,
|
|
@@ -6345,6 +6231,12 @@ var DateComponent = class DateComponent extends InputLabelComponent {
|
|
|
6345
6231
|
],
|
|
6346
6232
|
outputs: ["close"]
|
|
6347
6233
|
},
|
|
6234
|
+
{
|
|
6235
|
+
kind: "component",
|
|
6236
|
+
type: HighlightComponent,
|
|
6237
|
+
selector: "riv-highlight",
|
|
6238
|
+
inputs: ["text", "indices"]
|
|
6239
|
+
},
|
|
6348
6240
|
{
|
|
6349
6241
|
kind: "component",
|
|
6350
6242
|
type: IconComponent,
|
|
@@ -6376,10 +6268,55 @@ var DateComponent = class DateComponent extends InputLabelComponent {
|
|
|
6376
6268
|
type: OverlayDirective,
|
|
6377
6269
|
selector: "[riv-overlay]"
|
|
6378
6270
|
},
|
|
6271
|
+
{
|
|
6272
|
+
kind: "component",
|
|
6273
|
+
type: SimpleSelectComponent,
|
|
6274
|
+
selector: "riv-simple-select",
|
|
6275
|
+
inputs: [
|
|
6276
|
+
"optionGroups",
|
|
6277
|
+
"selectedOption",
|
|
6278
|
+
"size",
|
|
6279
|
+
"disabled",
|
|
6280
|
+
"locked",
|
|
6281
|
+
"filterabilityOptions",
|
|
6282
|
+
"orderBy",
|
|
6283
|
+
"placeholder",
|
|
6284
|
+
"maxHeight",
|
|
6285
|
+
"maxWidth",
|
|
6286
|
+
"minHeight",
|
|
6287
|
+
"minWidth",
|
|
6288
|
+
"dividers",
|
|
6289
|
+
"sortSelectedToTop",
|
|
6290
|
+
"grow",
|
|
6291
|
+
"preferredCalloutPosition",
|
|
6292
|
+
"allowedCalloutPositions"
|
|
6293
|
+
],
|
|
6294
|
+
outputs: ["selectedOptionChange"]
|
|
6295
|
+
},
|
|
6296
|
+
{
|
|
6297
|
+
kind: "directive",
|
|
6298
|
+
type: TooltipDirective,
|
|
6299
|
+
selector: "[rivTooltip]",
|
|
6300
|
+
inputs: [
|
|
6301
|
+
"rivTooltip",
|
|
6302
|
+
"rivTooltipTheme",
|
|
6303
|
+
"rivTooltipMaxWidth",
|
|
6304
|
+
"rivTooltipPreferredPosition",
|
|
6305
|
+
"rivTooltipAnchor",
|
|
6306
|
+
"rivTooltipCloseDelay",
|
|
6307
|
+
"rivTooltipOpenDelay",
|
|
6308
|
+
"rivTooltipGracePeriod"
|
|
6309
|
+
]
|
|
6310
|
+
},
|
|
6379
6311
|
{
|
|
6380
6312
|
kind: "pipe",
|
|
6381
6313
|
type: i1.AsyncPipe,
|
|
6382
6314
|
name: "async"
|
|
6315
|
+
},
|
|
6316
|
+
{
|
|
6317
|
+
kind: "pipe",
|
|
6318
|
+
type: OptionGroupPipe,
|
|
6319
|
+
name: "rivOptionGroup"
|
|
6383
6320
|
}
|
|
6384
6321
|
],
|
|
6385
6322
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
@@ -6390,33 +6327,42 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
6390
6327
|
minVersion: "12.0.0",
|
|
6391
6328
|
version: "22.2.4",
|
|
6392
6329
|
ngImport: i0,
|
|
6393
|
-
type:
|
|
6330
|
+
type: DateRangeComponent,
|
|
6394
6331
|
decorators: [{
|
|
6395
6332
|
type: Component,
|
|
6396
6333
|
args: [{
|
|
6397
|
-
selector: "riv-date",
|
|
6334
|
+
selector: "riv-date-range",
|
|
6398
6335
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
6399
6336
|
standalone: false,
|
|
6400
|
-
template: "<
|
|
6401
|
-
styles: [".trigger{width:100%;border:var(--border-width) solid var(--border-light);border-radius:var(--border-radius-small);display:flex;gap:var(--size-small);background-color:var(--surface-light-0);padding-left:var(--size-small)
|
|
6337
|
+
template: "<ng-container *ngIf=\"triggerTemplate; else standardTrigger\">\n <button\n #customTriggerButton\n (click)=\"open$.next(true)\"\n [disabled]=\"disabled$ | async\"\n [attr.aria-disabled]=\"(disabled$ | async) ? 'true' : null\"\n type=\"button\"\n >\n <ng-container\n [ngTemplateOutlet]=\"triggerTemplate\"\n [ngTemplateOutletContext]=\"{ open: open$ | async }\"\n ></ng-container>\n </button>\n</ng-container>\n<ng-template #standardTrigger>\n <riv-input-label\n [label]=\"label\"\n [help]=\"help\"\n [required]=\"required\"\n [state]=\"state\"\n [errorMessage]=\"errorMessage\"\n [labelActionText]=\"labelActionText\"\n (labelAction)=\"labelAction.emit($event)\"\n >\n <div\n #standardTriggerButton\n class=\"trigger\"\n [class.warning]=\"state === 'warning'\"\n [class.error]=\"state === 'error'\"\n [class.disabled]=\"disabled$ | async\"\n >\n <input\n #input\n class=\"value\"\n [placeholder]=\"placeholder$ | async\"\n [value]=\"inputText$ | async\"\n [disabled]=\"disabled$ | async\"\n [attr.aria-disabled]=\"(disabled$ | async) ? 'true' : null\"\n [attr.aria-label]=\"label || null\"\n [attr.aria-controls]=\"calendarId\"\n [attr.aria-expanded]=\"open$ | async\"\n role=\"combobox\"\n aria-haspopup=\"dialog\"\n aria-autocomplete=\"none\"\n (input)=\"onInputChange(input.value)\"\n (blur)=\"onInputBlur($event)\"\n (focus)=\"onInputFocus()\"\n (click)=\"open$.next(true)\"\n (keydown.enter)=\"onInputEnter(); input.blur(); $event.preventDefault()\"\n (keydown.escape)=\"onEscape($event)\"\n (keydown.arrowdown)=\"onInputArrowDown(); $event.preventDefault()\"\n (keydown.alt.arrowdown)=\"onInputArrowDown(); $event.preventDefault()\"\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n />\n <button\n class=\"chevron\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"toggleCalendar()\"\n [disabled]=\"disabled$ | async\"\n [attr.aria-disabled]=\"(disabled$ | async) ? 'true' : null\"\n [attr.aria-label]=\"(open$ | async) ? 'Close calendar' : 'Open calendar'\"\n type=\"button\"\n tabindex=\"-1\"\n >\n <riv-icon [name]=\"'Calendar'\" [size]=\"16\"></riv-icon>\n </button>\n </div>\n </riv-input-label>\n</ng-template>\n\n<ng-container *ngIf=\"open$ | async\">\n <riv-callout\n *riv-overlay\n [anchor]=\"getTrigger()\"\n [isModal]=\"!!triggerTemplate\"\n [showCaret]=\"false\"\n [theme]=\"'light'\"\n [allowedPositions]=\"[\n 'top-left',\n 'top-right',\n 'bottom-right',\n 'bottom-left'\n ]\"\n [preferredPosition]=\"'bottom-right'\"\n (close)=\"closeCalendar()\"\n >\n <div\n class=\"content\"\n [class.include-preset]=\"showPresets\"\n [attr.id]=\"calendarId\"\n (keydown.escape)=\"onEscape($event)\"\n (focusout)=\"closeOnFocusLeaving($event)\"\n >\n <div *ngIf=\"showPresets\" class=\"presets\">\n <riv-simple-select\n [label]=\"'Date presets'\"\n [filterabilityOptions]=\"{ enabled: true, placeholder: 'Search' }\"\n [orderBy]=\"'source'\"\n [optionGroups]=\"\n (filteredPresetOptions$ | async) ?? [] | rivOptionGroup\n \"\n [selectedOption]=\"selectedPreset$ | async\"\n (selectedOptionChange)=\"userSelectedPreset$.next($event)\"\n >\n <ng-template #option let-node=\"node\">\n <ng-template\n #self\n [ngTemplateOutlet]=\"self\"\n let-isFavorite\n [ngTemplateOutletContext]=\"{\n $implicit: $safeNavigationMigration(\n (favoritePresetIds$ | async)?.includes(node.id)\n )\n }\"\n >\n <div class=\"preset\" [class.favorite]=\"isFavorite\">\n <div class=\"description\">\n <riv-highlight\n class=\"title\"\n [text]=\"node.title\"\n [indices]=\"node.titleHighlightIndices || []\"\n ></riv-highlight>\n <riv-highlight\n class=\"subtitle\"\n [text]=\"node.subtitle\"\n [indices]=\"node.subtitleHighlightIndices || []\"\n ></riv-highlight>\n </div>\n <button\n (click)=\"\n setFavorite(node, !isFavorite); $event.stopPropagation()\n \"\n type=\"button\"\n >\n <riv-icon\n [name]=\"isFavorite ? 'HeartActive' : 'Heart'\"\n [size]=\"16\"\n [rivTooltip]=\"'Mark as favorite'\"\n ></riv-icon>\n </button>\n </div>\n </ng-template>\n </ng-template>\n </riv-simple-select>\n <ng-template\n #self\n [ngTemplateOutlet]=\"self\"\n let-favorites\n [ngTemplateOutletContext]=\"{ $implicit: favoritePresets$ | async }\"\n >\n <riv-input-label *ngIf=\"favorites.length\" [label]=\"'Favorites'\">\n <div class=\"shortcuts\">\n <button\n *ngFor=\"let favorite of favorites\"\n class=\"shortcut\"\n [class.active]=\"(selectedPreset$ | async)?.id === favorite.id\"\n (click)=\"userSelectedPreset$.next(favorite)\"\n type=\"button\"\n >\n <span class=\"title\">{{ favorite.title }}</span>\n <button\n (click)=\"setFavorite(favorite, false)\"\n [rivTooltip]=\"'Remove favorite'\"\n type=\"button\"\n >\n <riv-icon [name]=\"'HeartActive'\" [size]=\"16\"></riv-icon>\n </button>\n </button>\n </div>\n </riv-input-label>\n </ng-template>\n </div>\n\n <div class=\"calendars\">\n <riv-calendar\n class=\"left\"\n [activeYearMonth]=\"(leftActiveYearMonth$ | async) || TODAY\"\n (activeYearMonthChange)=\"userLeftActiveYearMonth$.next($event)\"\n [displayMin]=\"(min$ | async) || TODAY\"\n [displayMax]=\"(max$ | async) || TODAY\"\n [selectableMin]=\"(leftMin$ | async) || TODAY\"\n [selectableMax]=\"(leftMax$ | async) || TODAY\"\n [omitRange]=\"(leftOmitRange$ | async) || [TODAY, TODAY]\"\n [selectedValue]=\"(selectedValue$ | async) || TODAY\"\n (dateSelect)=\"userSelectedDate$.next($event)\"\n ></riv-calendar>\n <riv-calendar\n class=\"right\"\n [activeYearMonth]=\"(rightActiveYearMonth$ | async) || TODAY\"\n (activeYearMonthChange)=\"userRightActiveYearMonth$.next($event)\"\n [displayMin]=\"(min$ | async) || TODAY\"\n [displayMax]=\"(max$ | async) || TODAY\"\n [selectableMin]=\"(rightMin$ | async) || TODAY\"\n [selectableMax]=\"(rightMax$ | async) || TODAY\"\n [selectedValue]=\"(selectedValue$ | async) || TODAY\"\n (dateSelect)=\"userSelectedDate$.next($event)\"\n ></riv-calendar>\n </div>\n\n <footer class=\"buttons\">\n <button\n rivButton\n [size]=\"'small'\"\n [variant]=\"'ghost'\"\n (click)=\"userSelectedDate$.next(undefined)\"\n type=\"button\"\n >\n Clear\n </button>\n <button\n rivButton\n [size]=\"'small'\"\n [variant]=\"'primary'\"\n (click)=\"closeCalendar()\"\n type=\"button\"\n >\n Done\n </button>\n </footer>\n </div>\n </riv-callout>\n</ng-container>\n",
|
|
6338
|
+
styles: [".trigger{width:100%;border:var(--border-width) solid var(--border-light);border-radius:var(--border-radius-small);display:flex;gap:var(--size-small);background-color:var(--surface-light-0);padding-left:var(--size-small)}.trigger:focus-within{outline:none;border:var(--border-width) solid var(--purp-60)}.trigger.disabled{color:var(--type-light-disabled);background-color:var(--surface-light-1)}.value{font:var(--input-medium);color:var(--type-light-high-contrast);padding:var(--size-small) 0;flex-grow:1;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:pre;border:none;background:transparent;outline:none;width:100%}.value::placeholder{color:var(--type-light-low-contrast)}.value:disabled{color:var(--type-light-disabled)}.chevron{display:flex;justify-content:center;align-items:center;padding:var(--size-xsmall) calc(var(--base-grid-size) * 1.5);border:none;background:transparent;cursor:pointer;color:var(--type-light-high-contrast)}.chevron:disabled{color:var(--type-light-disabled);cursor:not-allowed}.trigger.warning{border-color:var(--surface-dark-caution)}.trigger.error{border-color:var(--surface-dark-danger);box-shadow:inset 0 0 0 var(--border-width-large) var(--surface-dark-danger)}.content{display:inline-grid;grid-template-rows:1fr auto}.content.include-preset{grid-template-columns:calc(var(--base-grid-size) * 50) 1fr 1fr}.presets{grid-area:1 / 1 / 3 / 2;background-color:var(--surface-light-1);padding:var(--size-xlarge) var(--size-large);border-right:var(--border-width) solid var(--border-light);display:flex;flex-direction:column;gap:var(--size-medium)}.preset{display:flex;transition:background-color var(--short-transition)}.preset:hover{background-color:var(--surface-light-2)}.preset button{color:transparent;transition:color var(--short-transition);padding:var(--size-medium) var(--size-large) var(--size-medium) var(--size-small);cursor:pointer}.preset:hover button{color:var(--type-light-low-contrast)}.preset button:hover{color:var(--type-light-high-contrast)}.preset.favorite button{color:var(--type-light-link)}.preset .description{flex-grow:1;padding:var(--size-medium) var(--size-small) var(--size-medium) var(--size-medium)}.preset .title{display:block;font-size:var(--type-2-font-size);line-height:var(--type-2-line-height-1)}.preset .subtitle{display:block;font-size:var(--type-1-font-size);line-height:var(--type-1-line-height-1);color:var(--type-light-low-contrast)}.shortcuts{display:flex;flex-direction:column;gap:var(--size-xsmall);overflow-y:auto}.shortcut{display:flex;align-items:center;padding:var(--size-small) var(--size-small) var(--size-small) var(--size-medium);gap:var(--size-small);border-radius:var(--border-radius-small);transition:background-color var(--short-transition);cursor:pointer}.shortcut:hover{background-color:var(--black-20)}.shortcut.active{background-color:var(--baloo-05)}.shortcut .title{flex-grow:1;text-align:left;font-size:var(--type-1-font-size);line-height:var(--type-1-line-height-2)}.shortcut button{color:transparent;transition:color var(--short-transition);cursor:pointer}.shortcut:hover button{color:var(--type-light-link)}.calendars{grid-column:2 / 4;display:grid;grid-template-columns:subgrid;grid-template-rows:subgrid;padding:var(--size-large)}.left{grid-area:1 / 1 / 2 / 2;padding-right:var(--size-large);border-right:var(--border-width) solid var(--border-light)}.right{padding-left:var(--size-large);grid-area:1 / 2 / 2 / 3}.buttons{grid-area:2 / 2 / 3 / 4;padding:var(--size-small);display:flex;justify-content:space-between}\n"]
|
|
6402
6339
|
}]
|
|
6403
6340
|
}],
|
|
6404
|
-
ctorParameters: () => [{ type: i0.
|
|
6341
|
+
ctorParameters: () => [{ type: i0.ElementRef }],
|
|
6405
6342
|
propDecorators: {
|
|
6343
|
+
showPresets: [{ type: Input }],
|
|
6406
6344
|
min: [{ type: Input }],
|
|
6407
6345
|
max: [{ type: Input }],
|
|
6408
6346
|
value: [{ type: Input }],
|
|
6409
6347
|
placeholder: [{ type: Input }],
|
|
6410
6348
|
disabled: [{ type: Input }],
|
|
6411
|
-
|
|
6412
|
-
showClearButton: [{ type: Input }],
|
|
6413
|
-
showTodayButton: [{ type: Input }],
|
|
6414
|
-
rollingTodayLabel: [{ type: Input }],
|
|
6415
|
-
headerTemplate: [{
|
|
6349
|
+
triggerTemplate: [{
|
|
6416
6350
|
type: ContentChild,
|
|
6417
|
-
args: ["
|
|
6351
|
+
args: ["trigger"]
|
|
6418
6352
|
}],
|
|
6419
|
-
|
|
6353
|
+
customTriggerButton: [{
|
|
6354
|
+
type: ViewChild,
|
|
6355
|
+
args: ["customTriggerButton", { read: ElementRef }]
|
|
6356
|
+
}],
|
|
6357
|
+
standardTriggerButton: [{
|
|
6358
|
+
type: ViewChild,
|
|
6359
|
+
args: ["standardTriggerButton", { read: ElementRef }]
|
|
6360
|
+
}],
|
|
6361
|
+
inputElement: [{
|
|
6362
|
+
type: ViewChild,
|
|
6363
|
+
args: ["input", { read: ElementRef }]
|
|
6364
|
+
}],
|
|
6365
|
+
alternativePresetList: [{ type: Input }],
|
|
6420
6366
|
valueChange: [{ type: Output }],
|
|
6421
6367
|
onDocumentMouseDown: [{
|
|
6422
6368
|
type: HostListener,
|
|
@@ -6424,58 +6370,216 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
6424
6370
|
}]
|
|
6425
6371
|
}
|
|
6426
6372
|
});
|
|
6427
|
-
(function(
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6373
|
+
(function(DateRangeComponent) {
|
|
6374
|
+
const today = /* @__PURE__ */ new Date();
|
|
6375
|
+
DateRangeComponent.focusableSelector = "button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
|
|
6376
|
+
const rangeSeparator = /\s*[—–]\s*|\s+(?:-|to|through)\s+/i;
|
|
6377
|
+
function splitRange(text) {
|
|
6378
|
+
const parts = text.split(rangeSeparator);
|
|
6379
|
+
if (parts.length !== 1) return parts;
|
|
6380
|
+
const splits = [...text.matchAll(/-/g)].map(({ index }) => [text.slice(0, index), text.slice(index + 1)]).filter((halves) => halves.every((half) => DateComponent.parseDate(half)));
|
|
6381
|
+
return splits.length === 1 ? splits[0] : parts;
|
|
6382
|
+
}
|
|
6383
|
+
function parseDateRange(text, min, max) {
|
|
6384
|
+
const parts = splitRange(text.trim());
|
|
6385
|
+
if (parts.length > 2) return void 0;
|
|
6386
|
+
const dates = parts.flatMap((part) => {
|
|
6387
|
+
const date = DateComponent.parseDate(part);
|
|
6388
|
+
return date && DateComponent.isValidDate(date, min, max) ? [timeDay.floor(date)] : [];
|
|
6389
|
+
});
|
|
6390
|
+
if (dates.length !== parts.length) return void 0;
|
|
6391
|
+
const [start, end = start] = sortBy(dates, (date) => date.valueOf());
|
|
6392
|
+
return start ? [start, end] : void 0;
|
|
6393
|
+
}
|
|
6394
|
+
DateRangeComponent.parseDateRange = parseDateRange;
|
|
6395
|
+
let PresetType;
|
|
6396
|
+
(function(PresetType) {
|
|
6397
|
+
PresetType["TODAY"] = "today";
|
|
6398
|
+
PresetType["YESTERDAY"] = "yesterday";
|
|
6399
|
+
PresetType["TOMORROW"] = "tomorrow";
|
|
6400
|
+
PresetType["THIS_WEEK"] = "this_week";
|
|
6401
|
+
PresetType["THIS_WEEK_SO_FAR"] = "this_week_so_far";
|
|
6402
|
+
PresetType["LAST_WEEK"] = "last_week";
|
|
6403
|
+
PresetType["NEXT_WEEK"] = "next_week";
|
|
6404
|
+
PresetType["THIS_MONTH"] = "this_month";
|
|
6405
|
+
PresetType["THIS_MONTH_SO_FAR"] = "this_month_so_far";
|
|
6406
|
+
PresetType["LAST_MONTH"] = "last_month";
|
|
6407
|
+
PresetType["NEXT_MONTH"] = "next_month";
|
|
6408
|
+
PresetType["THIS_QUARTER"] = "this_quarter";
|
|
6409
|
+
PresetType["THIS_QUARTER_SO_FAR"] = "this_quarter_so_far";
|
|
6410
|
+
PresetType["LAST_QUARTER"] = "last_quarter";
|
|
6411
|
+
PresetType["NEXT_QUARTER"] = "next_quarter";
|
|
6412
|
+
PresetType["THIS_YEAR"] = "this_year";
|
|
6413
|
+
PresetType["THIS_YEAR_SO_FAR"] = "this_year_so_far";
|
|
6414
|
+
PresetType["LAST_YEAR"] = "last_year";
|
|
6415
|
+
PresetType["NEXT_YEAR"] = "next_year";
|
|
6416
|
+
PresetType["LAST_7_DAYS"] = "last_7_days";
|
|
6417
|
+
PresetType["LAST_14_DAYS"] = "last_14_days";
|
|
6418
|
+
PresetType["LAST_30_DAYS"] = "last_30_days";
|
|
6419
|
+
PresetType["LAST_60_DAYS"] = "last_60_days";
|
|
6420
|
+
PresetType["LAST_90_DAYS"] = "last_90_days";
|
|
6421
|
+
PresetType["LAST_180_DAYS"] = "last_180_days";
|
|
6422
|
+
PresetType["LAST_365_DAYS"] = "last_365_days";
|
|
6423
|
+
})(PresetType = DateRangeComponent.PresetType || (DateRangeComponent.PresetType = {}));
|
|
6424
|
+
DateRangeComponent.Presets = [
|
|
6425
|
+
{
|
|
6426
|
+
id: PresetType.TODAY,
|
|
6427
|
+
title: "Today",
|
|
6428
|
+
subtitle: "Today from midnight until the current time",
|
|
6429
|
+
dates: [timeDay(), timeDay()]
|
|
6430
|
+
},
|
|
6431
|
+
{
|
|
6432
|
+
id: PresetType.YESTERDAY,
|
|
6433
|
+
title: "Yesterday",
|
|
6434
|
+
subtitle: "The previous 24 hour day",
|
|
6435
|
+
dates: [timeDay.offset(timeDay(), -1), timeDay.offset(timeDay(), -1)]
|
|
6436
|
+
},
|
|
6437
|
+
{
|
|
6438
|
+
id: PresetType.TOMORROW,
|
|
6439
|
+
title: "Tomorrow",
|
|
6440
|
+
subtitle: "The next 24 hour day",
|
|
6441
|
+
dates: [timeDay.offset(timeDay(), 1), timeDay.offset(timeDay(), 1)]
|
|
6442
|
+
},
|
|
6443
|
+
{
|
|
6444
|
+
id: PresetType.THIS_WEEK,
|
|
6445
|
+
title: "This week",
|
|
6446
|
+
subtitle: "The current calendar week",
|
|
6447
|
+
dates: [timeSunday.floor(today), timeDay.offset(timeSunday.ceil(today), -1)]
|
|
6448
|
+
},
|
|
6449
|
+
{
|
|
6450
|
+
id: PresetType.THIS_WEEK_SO_FAR,
|
|
6451
|
+
title: "This week so far",
|
|
6452
|
+
subtitle: "The current calendar week up to now",
|
|
6453
|
+
dates: [timeSunday.floor(today), timeDay.floor(today)]
|
|
6454
|
+
},
|
|
6455
|
+
{
|
|
6456
|
+
id: PresetType.LAST_WEEK,
|
|
6457
|
+
title: "Last week",
|
|
6458
|
+
subtitle: "The previous calendar week",
|
|
6459
|
+
dates: [timeSunday.offset(timeWeek.floor(today), -1), timeDay.offset(timeSunday.offset(timeWeek.ceil(today), -1), -1)]
|
|
6460
|
+
},
|
|
6461
|
+
{
|
|
6462
|
+
id: PresetType.NEXT_WEEK,
|
|
6463
|
+
title: "Next week",
|
|
6464
|
+
subtitle: "The next calendar week",
|
|
6465
|
+
dates: [timeSunday.offset(timeWeek.floor(today), 1), timeDay.offset(timeSunday.offset(timeWeek.ceil(today), 1), -1)]
|
|
6466
|
+
},
|
|
6467
|
+
{
|
|
6468
|
+
id: PresetType.THIS_MONTH,
|
|
6469
|
+
title: "This month",
|
|
6470
|
+
subtitle: "The current calendar month",
|
|
6471
|
+
dates: [timeMonth.floor(today), timeDay.offset(timeMonth.ceil(today), -1)]
|
|
6472
|
+
},
|
|
6473
|
+
{
|
|
6474
|
+
id: PresetType.THIS_MONTH_SO_FAR,
|
|
6475
|
+
title: "This month so far",
|
|
6476
|
+
subtitle: "The current calendar month up to now",
|
|
6477
|
+
dates: [timeMonth.floor(today), timeDay.floor(today)]
|
|
6478
|
+
},
|
|
6479
|
+
{
|
|
6480
|
+
id: PresetType.LAST_MONTH,
|
|
6481
|
+
title: "Last month",
|
|
6482
|
+
subtitle: "The previous calendar month",
|
|
6483
|
+
dates: [timeMonth.offset(timeMonth.floor(today), -1), timeDay.offset(timeMonth.offset(timeMonth.ceil(today), -1), -1)]
|
|
6484
|
+
},
|
|
6485
|
+
{
|
|
6486
|
+
id: PresetType.NEXT_MONTH,
|
|
6487
|
+
title: "Next month",
|
|
6488
|
+
subtitle: "The next calendar month",
|
|
6489
|
+
dates: [timeMonth.offset(timeMonth.floor(today), 1), timeDay.offset(timeMonth.offset(timeMonth.ceil(today), 1), -1)]
|
|
6490
|
+
},
|
|
6491
|
+
{
|
|
6492
|
+
id: PresetType.THIS_QUARTER,
|
|
6493
|
+
title: "This quarter",
|
|
6494
|
+
subtitle: "The current quarter",
|
|
6495
|
+
dates: [timeQuarter.floor(today), timeDay.offset(timeQuarter.ceil(today), -1)]
|
|
6496
|
+
},
|
|
6497
|
+
{
|
|
6498
|
+
id: PresetType.THIS_QUARTER_SO_FAR,
|
|
6499
|
+
title: "This quarter so far",
|
|
6500
|
+
subtitle: "The current quarter up to now",
|
|
6501
|
+
dates: [timeQuarter.floor(today), timeDay.floor(today)]
|
|
6502
|
+
},
|
|
6503
|
+
{
|
|
6504
|
+
id: PresetType.LAST_QUARTER,
|
|
6505
|
+
title: "Last quarter",
|
|
6506
|
+
subtitle: "The previous full quarter",
|
|
6507
|
+
dates: [timeQuarter.offset(timeQuarter.floor(today), -1), timeDay.offset(timeQuarter.offset(timeQuarter.ceil(today), -1), -1)]
|
|
6508
|
+
},
|
|
6509
|
+
{
|
|
6510
|
+
id: PresetType.NEXT_QUARTER,
|
|
6511
|
+
title: "Next quarter",
|
|
6512
|
+
subtitle: "The next full quarter",
|
|
6513
|
+
dates: [timeQuarter.offset(timeQuarter.floor(today), 1), timeDay.offset(timeQuarter.offset(timeQuarter.ceil(today), 1), -1)]
|
|
6514
|
+
},
|
|
6515
|
+
{
|
|
6516
|
+
id: PresetType.THIS_YEAR,
|
|
6517
|
+
title: "This year",
|
|
6518
|
+
subtitle: "The current calendar year",
|
|
6519
|
+
dates: [timeYear.floor(today), timeDay.offset(timeYear.ceil(today), -1)]
|
|
6520
|
+
},
|
|
6521
|
+
{
|
|
6522
|
+
id: PresetType.THIS_YEAR_SO_FAR,
|
|
6523
|
+
title: "This year so far",
|
|
6524
|
+
subtitle: "The current calendar year up to now",
|
|
6525
|
+
dates: [timeYear.floor(today), timeDay.floor(today)]
|
|
6526
|
+
},
|
|
6527
|
+
{
|
|
6528
|
+
id: PresetType.LAST_YEAR,
|
|
6529
|
+
title: "Last year",
|
|
6530
|
+
subtitle: "The previous calendar year",
|
|
6531
|
+
dates: [timeYear.offset(timeYear.floor(today), -1), timeDay.offset(timeYear.offset(timeYear.ceil(today), -1), -1)]
|
|
6532
|
+
},
|
|
6533
|
+
{
|
|
6534
|
+
id: PresetType.NEXT_YEAR,
|
|
6535
|
+
title: "Next year",
|
|
6536
|
+
subtitle: "The next calendar year",
|
|
6537
|
+
dates: [timeYear.offset(timeYear.floor(today), 1), timeDay.offset(timeYear.offset(timeYear.ceil(today), 1), -1)]
|
|
6538
|
+
},
|
|
6539
|
+
{
|
|
6540
|
+
id: PresetType.LAST_7_DAYS,
|
|
6541
|
+
title: "Last 7 days",
|
|
6542
|
+
subtitle: "The previous 7 days before today",
|
|
6543
|
+
dates: [timeDay.floor(timeDay.offset(today, -8)), timeDay.floor(timeDay.offset(today, -1))]
|
|
6544
|
+
},
|
|
6545
|
+
{
|
|
6546
|
+
id: PresetType.LAST_14_DAYS,
|
|
6547
|
+
title: "Last 14 days",
|
|
6548
|
+
subtitle: "The previous 14 days before today",
|
|
6549
|
+
dates: [timeDay.floor(timeDay.offset(today, -15)), timeDay.floor(timeDay.offset(today, -1))]
|
|
6550
|
+
},
|
|
6551
|
+
{
|
|
6552
|
+
id: PresetType.LAST_30_DAYS,
|
|
6553
|
+
title: "Last 30 days",
|
|
6554
|
+
subtitle: "The previous 30 days before today",
|
|
6555
|
+
dates: [timeDay.floor(timeDay.offset(today, -31)), timeDay.floor(timeDay.offset(today, -1))]
|
|
6556
|
+
},
|
|
6557
|
+
{
|
|
6558
|
+
id: PresetType.LAST_60_DAYS,
|
|
6559
|
+
title: "Last 60 days",
|
|
6560
|
+
subtitle: "The previous 60 days before today",
|
|
6561
|
+
dates: [timeDay.floor(timeDay.offset(today, -61)), timeDay.floor(timeDay.offset(today, -1))]
|
|
6562
|
+
},
|
|
6563
|
+
{
|
|
6564
|
+
id: PresetType.LAST_90_DAYS,
|
|
6565
|
+
title: "Last 90 days",
|
|
6566
|
+
subtitle: "The previous 90 days before today",
|
|
6567
|
+
dates: [timeDay.floor(timeDay.offset(today, -91)), timeDay.floor(timeDay.offset(today, -1))]
|
|
6568
|
+
},
|
|
6569
|
+
{
|
|
6570
|
+
id: PresetType.LAST_180_DAYS,
|
|
6571
|
+
title: "Last 180 days",
|
|
6572
|
+
subtitle: "The previous 180 days before today",
|
|
6573
|
+
dates: [timeDay.floor(timeDay.offset(today, -181)), timeDay.floor(timeDay.offset(today, -1))]
|
|
6574
|
+
},
|
|
6575
|
+
{
|
|
6576
|
+
id: PresetType.LAST_365_DAYS,
|
|
6577
|
+
title: "Last 365 days",
|
|
6578
|
+
subtitle: "The previous 365 days before today",
|
|
6579
|
+
dates: [timeDay.floor(timeDay.offset(today, -366)), timeDay.floor(timeDay.offset(today, -1))]
|
|
6580
|
+
}
|
|
6434
6581
|
];
|
|
6435
|
-
|
|
6436
|
-
const trimmed = input.trim();
|
|
6437
|
-
if (!trimmed) return void 0;
|
|
6438
|
-
const ymd = /^\d+$/.test(trimmed) ? parseDigits(trimmed) : parseSeparated(trimmed);
|
|
6439
|
-
if (!ymd) return void 0;
|
|
6440
|
-
const [year, month, day] = ymd;
|
|
6441
|
-
const date = new Date(year, month - 1, day);
|
|
6442
|
-
return date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day ? date : void 0;
|
|
6443
|
-
}
|
|
6444
|
-
DateComponent.parseDate = parseDate;
|
|
6445
|
-
function expandTwoDigitYear(year) {
|
|
6446
|
-
return year < 100 ? year + (year < 50 ? 2e3 : 1900) : year;
|
|
6447
|
-
}
|
|
6448
|
-
function parseDigits(digits) {
|
|
6449
|
-
if (digits.length !== 8 && digits.length !== 6) return void 0;
|
|
6450
|
-
const year = parseInt(digits.slice(4), 10);
|
|
6451
|
-
return [
|
|
6452
|
-
digits.length === 6 ? expandTwoDigitYear(year) : year,
|
|
6453
|
-
parseInt(digits.slice(0, 2), 10),
|
|
6454
|
-
parseInt(digits.slice(2, 4), 10)
|
|
6455
|
-
];
|
|
6456
|
-
}
|
|
6457
|
-
function parseSeparated(input) {
|
|
6458
|
-
const parts = input.split(/[/.-]/);
|
|
6459
|
-
if (parts.length !== 3) return void 0;
|
|
6460
|
-
const nums = parts.map((p) => parseInt(p, 10));
|
|
6461
|
-
if (nums.some(isNaN)) return void 0;
|
|
6462
|
-
const [year, month, day] = parts[0].length === 4 ? nums : [
|
|
6463
|
-
nums[2],
|
|
6464
|
-
nums[0],
|
|
6465
|
-
nums[1]
|
|
6466
|
-
];
|
|
6467
|
-
return [
|
|
6468
|
-
parts[0].length === 4 ? year : expandTwoDigitYear(year),
|
|
6469
|
-
month,
|
|
6470
|
-
day
|
|
6471
|
-
];
|
|
6472
|
-
}
|
|
6473
|
-
function isValidDate(date, min, max) {
|
|
6474
|
-
const time = date.getTime();
|
|
6475
|
-
return time >= timeDay.floor(min).getTime() && time <= max.getTime();
|
|
6476
|
-
}
|
|
6477
|
-
DateComponent.isValidDate = isValidDate;
|
|
6478
|
-
})(DateComponent || (DateComponent = {}));
|
|
6582
|
+
})(DateRangeComponent || (DateRangeComponent = {}));
|
|
6479
6583
|
var FilterChipComponent = class FilterChipComponent {
|
|
6480
6584
|
constructor() {
|
|
6481
6585
|
this.selected$ = new BehaviorSubject(false);
|
|
@@ -20525,7 +20629,7 @@ var ChartComponent = class ChartComponent {
|
|
|
20525
20629
|
descendants: true
|
|
20526
20630
|
}],
|
|
20527
20631
|
ngImport: i0,
|
|
20528
|
-
template: "<div\n class=\"container\"\n (rivClientSize)=\"width = $event.width\"\n *ngIf=\"{ d: drawData$ | async } as vm\"\n [style.--override-font-size]=\"getFontSize(vm.d)\"\n>\n <ng-container\n *ngIf=\"\n !checkForNonDisplayState(vm.d) && (drawData$ | async);\n let d;\n else: nonDisplayState\n \"\n >\n <div\n (mousemove)=\"mousemove($event, d.hover)\"\n (mouseleave)=\"mouseleave($event)\"\n (click)=\"click()\"\n #container\n class=\"sub-container\"\n [class.clickable]=\"isHoverClickable\"\n tabIndex=\"0\"\n [ngClass]=\"{ 'donut-container': config.type === 'donut' }\"\n [ngStyle]=\"{\n height: getSubcontainerHeight(d),\n width: getSubcontainerWidth(d)\n }\"\n >\n <svg:svg\n xmlns=\"http://www.w3.org/2000/svg\"\n [attr.viewBox]=\"d.viewBox\"\n [attr.height]=\"d.chartHeight\"\n [attr.width]=\"d.chartWidth\"\n >\n <defs>\n <!-- Stripe pattern -->\n <pattern\n id=\"stripes\"\n x=\"0\"\n y=\"0\"\n [attr.width]=\"10\"\n [attr.height]=\"10\"\n patternUnits=\"userSpaceOnUse\"\n >\n <line\n [attr.x1]=\"0\"\n [attr.y1]=\"10\"\n [attr.x2]=\"10\"\n [attr.y2]=\"0\"\n stroke=\"var(--white-100)\"\n stroke-width=\"1\"\n ></line>\n </pattern>\n </defs>\n <ng-container *ngIf=\"!(config.type === 'horizontal-bar')\">\n <g *ngFor=\"let tick of d.xTicks\" text-anchor=\"middle\">\n <text\n class=\"tick-label\"\n [attr.x]=\"tick.x\"\n [attr.y]=\"getBottomLabelY(d)\"\n >\n {{ tick.label }}\n </text>\n </g>\n </ng-container>\n <ng-container *ngIf=\"config.type === 'horizontal-bar'\">\n <g *ngFor=\"let tick of d.xTicks\" text-anchor=\"left\">\n <text\n class=\"tick-label\"\n [attr.x]=\"tick.x\"\n [attr.y]=\"d.chartSizingValues.fontSize\"\n >\n {{ tick.label }}\n </text>\n <line\n class=\"tick-line\"\n [attr.x1]=\"tick.x\"\n [attr.x2]=\"tick.x\"\n y1=\"0\"\n [attr.y2]=\"d.chartHeight\"\n ></line>\n <text\n *ngIf=\"tick.secondaryLabel\"\n class=\"tick-label\"\n [attr.x]=\"tick.x\"\n [attr.y]=\"getBottomLabelY(d)\"\n >\n {{ tick.secondaryLabel }}\n </text>\n </g>\n </ng-container>\n <g *ngFor=\"let tick of d.yTicks\">\n <line\n *ngIf=\"!(config.type === 'horizontal-bar')\"\n class=\"tick-line\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\"\n x1=\"0\"\n [attr.x2]=\"d.chartWidth\"\n ></line>\n <text\n rivSVGTextTruncate\n [text]=\"tick.label\"\n [width]=\"\n config.type === 'horizontal-bar'\n ? d.chartSizingValues.leftBucketLabel\n : d.chartSizingValues.leftPadding\n \"\n class=\"tick-label\"\n [attr.y]=\"tick.y\"\n [attr.x]=\"0\"\n >\n {{ tick.label }}\n </text>\n <text\n *ngIf=\"tick.secondaryLabel\"\n rivSVGTextTruncate\n [text]=\"tick.secondaryLabel\"\n [width]=\"d.chartSizingValues.rightPadding\"\n class=\"tick-label\"\n [attr.y]=\"tick.y\"\n [attr.x]=\"d.chartWidth\"\n text-anchor=\"end\"\n >\n {{ tick.secondaryLabel }}\n </text>\n </g>\n <ng-container *ngIf=\"standardHoverDataGuard(hover) as hoverData\">\n <g\n *ngIf=\"config.type !== 'horizontal-bar' && config.type !== 'donut'\"\n >\n <line\n class=\"tick-line\"\n [attr.x1]=\"hoverData?.x\"\n [attr.x2]=\"hoverData?.x\"\n y1=\"0\"\n [attr.y2]=\"d.chartHeight\"\n stroke-width=\"2\"\n stroke-dasharray=\"4\"\n />\n </g>\n </ng-container>\n <g *ngFor=\"let bar of d.bars; let i = index\">\n <ng-container *ngFor=\"let rect of bar; let j = index\">\n <defs *ngIf=\"rect.pattern === 'dots'\">\n <pattern\n [attr.id]=\"'dots-' + i + '-' + j\"\n patternUnits=\"userSpaceOnUse\"\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n width=\"4\"\n height=\"4\"\n >\n <circle\n cx=\"2\"\n cy=\"2\"\n r=\"1.5\"\n [attr.fill]=\"varColor(d.colors, i)\"\n ></circle>\n </pattern>\n </defs>\n\n <rect\n *ngIf=\"rect.nonDisplay !== true\"\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n [attr.width]=\"rect.width\"\n [attr.height]=\"rect.height\"\n [attr.fill]=\"\n rect.pattern === 'dots'\n ? 'url(#dots-' + i + '-' + j + ')'\n : getBarColor(rect, d.colors, i, hover)\n \"\n [attr.stroke]=\"\n showBarBorders(rect, hover) ? varWrap('--black-100') : undefined\n \"\n [attr.stroke-width]=\"showBarBorders(rect, hover) ? 1 : undefined\"\n ></rect>\n <rect\n *ngIf=\"showNonDisplayRect(rect, hover)\"\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n [attr.width]=\"rect.width\"\n [attr.height]=\"rect.height\"\n fill=\"transparent\"\n [attr.stroke]=\"varWrap('--black-100')\"\n [attr.stroke-width]=\"1\"\n ></rect>\n <rect\n *ngIf=\"rect.pattern === 'striped'\"\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n [attr.width]=\"rect.width\"\n [attr.height]=\"rect.height\"\n fill=\"url(#stripes)\"\n ></rect>\n </ng-container>\n </g>\n <g *ngFor=\"let bar of d.horizontalBars; let i = index\">\n <ng-container *ngFor=\"let indBar of bar; let j = index\">\n <defs *ngIf=\"indBar.pattern === 'dots'\">\n <pattern\n [attr.id]=\"'dots-' + i + '-' + j\"\n patternUnits=\"userSpaceOnUse\"\n [attr.x]=\"indBar.x\"\n [attr.y]=\"indBar.y\"\n width=\"4\"\n height=\"4\"\n >\n <circle\n cx=\"2\"\n cy=\"2\"\n r=\"1.5\"\n [attr.fill]=\"varColor(d.colors, i)\"\n ></circle>\n </pattern>\n </defs>\n <path\n [attr.d]=\"indBar.horizontalBar\"\n [attr.fill]=\"\n indBar.pattern === 'dots'\n ? 'url(#dots-' + i + '-' + j + ')'\n : varColor(d.colors, i)\n \"\n [attr.stroke]=\"\n indBar.pattern === 'dots' ? 'none' : varColor(d.colors, i)\n \"\n [attr.stroke-width]=\"indBar.pattern === 'dots' ? 0 : 2\"\n />\n <path\n *ngIf=\"indBar.pattern === 'striped'\"\n [attr.d]=\"indBar.horizontalBar\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n fill=\"url(#stripes)\"\n stroke-width=\"0\"\n />\n </ng-container>\n </g>\n <g *ngFor=\"let gradient of d.gradients; let i = index\">\n <ng-container *ngFor=\"let rect of gradient; let j = index\">\n <defs>\n <linearGradient\n [attr.id]=\"'grad-' + i + '-' + j\"\n x1=\"0\"\n y1=\"0\"\n x2=\"0\"\n y2=\"1\"\n >\n <stop offset=\"0%\" [attr.stop-color]=\"varColor(d.colors, i)\" />\n <stop offset=\"100%\" stop-color=\"white\" />\n </linearGradient>\n </defs>\n <rect\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n [attr.width]=\"rect.width\"\n [attr.height]=\"rect.height\"\n [attr.fill]=\"'url(#grad-' + i + '-' + j + ')'\"\n opacity=\"0.4\"\n ></rect>\n </ng-container>\n </g>\n <g *ngFor=\"let line of d.lines; let i = index\">\n <path\n [attr.d]=\"line.line\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n fill=\"none\"\n stroke-width=\"2\"\n [attr.stroke-linecap]=\"\n line.pattern === 'dots' ? 'round' : undefined\n \"\n [attr.stroke-linejoin]=\"\n line.pattern === 'dots' ? 'round' : undefined\n \"\n [attr.stroke-dasharray]=\"\n line.pattern === 'striped'\n ? '10 10'\n : line.pattern === 'dots'\n ? '0.25 7'\n : undefined\n \"\n ></path>\n </g>\n <g *ngFor=\"let lineSinglePointFallback of d.circles; let i = index\">\n <circle\n class=\"marker\"\n [attr.cx]=\"lineSinglePointFallback.cx\"\n [attr.cy]=\"lineSinglePointFallback.cy\"\n r=\"3.5\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></circle>\n </g>\n <g *ngFor=\"let line of d.lines; let i = index\">\n <ng-container *ngIf=\"standardHoverDataGuard(hover) as hoverData\">\n <circle\n class=\"marker\"\n *ngIf=\"config.groupedTooltip || i === hoverData?.visibleYIndex\"\n [attr.cx]=\"hoverData?.x\"\n [attr.cy]=\"hoverData?.ys?.[i]\"\n r=\"3.5\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></circle>\n </ng-container>\n </g>\n <g *ngFor=\"let area of d.areas; let i = index\">\n <path [attr.d]=\"area.area\" [attr.fill]=\"varColor(d.colors, i)\"></path>\n <path\n *ngIf=\"area.pattern === 'striped'\"\n [attr.d]=\"area.area\"\n fill=\"url(#stripes)\"\n ></path>\n </g>\n <g *ngFor=\"let area of d.areas; let i = index\">\n <ng-container *ngIf=\"standardHoverDataGuard(hover) as hoverData\">\n <circle\n class=\"marker\"\n *ngIf=\"config.groupedTooltip || i === hoverData?.visibleYIndex\"\n [attr.cx]=\"hoverData?.x\"\n [attr.cy]=\"hoverData?.ys?.[i]\"\n r=\"3.5\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></circle>\n </ng-container>\n </g>\n <g *ngFor=\"let wLine of d.waterfallLines\">\n <line\n class=\"waterfall-line\"\n [attr.x1]=\"wLine.x1\"\n [attr.x2]=\"wLine.x2\"\n [attr.y1]=\"wLine.y1\"\n [attr.y2]=\"wLine.y2\"\n stroke-width=\"1\"\n stroke-dasharray=\"6\"\n />\n </g>\n <path\n *ngFor=\"let path of d.arcs; let i = index\"\n [attr.d]=\"path\"\n [attr.fill]=\"varColor(d.colors, i)\"\n ></path>\n <g *ngFor=\"let dataLabel of d.dataLabels; let i = index\">\n <text\n *ngIf=\"config.showDataLabels && dataLabel.label\"\n [ngClass]=\"getDataLabelClass(dataLabel, config, hover)\"\n [attr.y]=\"dataLabel.yPos\"\n [attr.x]=\"dataLabel.xPos\"\n [attr.text-anchor]=\"dataLabel.anchor\"\n [attr.font-weight]=\"\n dataLabel.bold\n ? 'var(--font-weight-heavy)'\n : 'var(--font-weight-normal)'\n \"\n [attr.opacity]=\"getDataLabelOpacity(dataLabel, config, hover)\"\n >\n {{ dataLabel.label }}\n </text>\n <line\n *ngIf=\"dataLabel.line && config.showDataLabels\"\n [attr.y1]=\"dataLabel.line.y1\"\n [attr.y2]=\"dataLabel.line.y2\"\n [attr.x1]=\"dataLabel.line.x1\"\n [attr.x2]=\"dataLabel.line.x2\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></line>\n </g>\n <g *ngFor=\"let connection of d.flowConnections\">\n <path\n [attr.d]=\"connection.path\"\n [attr.fill]=\"getConnectionColor()\"\n [attr.opacity]=\"getConnectionOpacity(connection, hover)\"\n />\n </g>\n </svg:svg>\n <div *ngIf=\"config.type === 'donut'\" class=\"donut-display\">\n <div class=\"donut-value\" [ngClass]=\"config.donutDisplayInfo.size\">\n {{ config.donutDisplayInfo.displayValue }}\n </div>\n <div class=\"donut-label\">\n {{ config.donutDisplayInfo.displayLabel }}\n </div>\n </div>\n <ng-container *ngIf=\"standardHoverDataGuard(hover) as hoverData\">\n <riv-callout\n *riv-overlay\n [anchor]=\"\n hoverData?.tooltip?.anchor ? hoverData.tooltip.anchor : null\n \"\n [isModal]=\"false\"\n [preferredPosition]=\"\n hoverData?.tooltip?.preferredPosition ?? 'center-right'\n \"\n [theme]=\"'light'\"\n >\n <ng-container *ngIf=\"tooltipTemplate; else defaultTooltip\">\n <ng-container\n [ngTemplateOutlet]=\"tooltipTemplate\"\n [ngTemplateOutletContext]=\"{\n xIndex: hoverData.xIndex,\n yIndex: hoverData.yIndex,\n isSuppValue: hoverData.isSuppValue,\n suppYIndex: hoverData.suppYIndex,\n isDropOff: hoverData.isDropOff\n }\"\n ></ng-container>\n </ng-container>\n <ng-template #defaultTooltip>\n <div class=\"callout-content\">\n <div *ngIf=\"hoverData?.tooltip?.date\" class=\"callout-row\">\n {{ hoverData?.tooltip?.date }}\n </div>\n <div\n class=\"callout-row\"\n *ngFor=\"let metric of hoverData?.tooltip?.metrics\"\n >\n <span class=\"series-label\">\n <riv-legend-item\n [colorToken]=\"metric.color\"\n [style]=\"metric.pattern || 'solid'\"\n ></riv-legend-item>\n <span>{{ metric.label }}</span>\n </span>\n <span>{{ metric.value }}</span>\n </div>\n </div>\n </ng-template>\n </riv-callout>\n </ng-container>\n <ng-container *ngIf=\"flowHoverDataGuard(hover) as hoverData\">\n <riv-callout\n *riv-overlay\n [anchor]=\"\n hoverData?.tooltip?.anchor ? hoverData.tooltip.anchor : null\n \"\n [isModal]=\"false\"\n [preferredPosition]=\"'top-center'\"\n [theme]=\"'light'\"\n >\n <div class=\"callout-content\">\n <div class=\"callout-row\">\n <ng-container *ngIf=\"hoverData?.hoverTarget === 'connection'\">\n <ng-container\n *ngIf=\"\n getBucketConfigInfo(hoverData, 'startId') as startConfig\n \"\n >\n <riv-issue\n [label]=\"startConfig.title\"\n [colorToken]=\"startConfig.color\"\n ></riv-issue>\n </ng-container>\n ->\n <ng-container\n *ngIf=\"getBucketConfigInfo(hoverData, 'endId') as endConfig\"\n >\n <riv-issue\n [label]=\"endConfig.title\"\n [colorToken]=\"endConfig.color\"\n ></riv-issue>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"hoverData?.hoverTarget !== 'connection'\">\n <ng-container\n *ngIf=\"getBucketConfigInfo(hoverData, 'barId') as barConfig\"\n >\n <riv-issue\n [label]=\"barConfig.title\"\n [colorToken]=\"barConfig.color\"\n ></riv-issue>\n </ng-container>\n </ng-container>\n </div>\n <div\n *ngIf=\"hoverData?.tooltip?.subtitle\"\n class=\"callout-row flow-subtitle\"\n >\n {{ hoverData?.tooltip?.subtitle }}\n </div>\n </div>\n </riv-callout>\n </ng-container>\n </div>\n <legend *ngIf=\"d.data.type !== 'flow'\">\n <ng-container *ngIf=\"firstHiddenLegendItemIndex$ | async; let fi\">\n <ng-container *ngFor=\"let item of d.data.ys; let i = index\">\n <riv-legend-item\n *ngIf=\"i < fi.dataIndex && item.showLegendItem !== false\"\n [label]=\"item.label\"\n [style]=\"item.pattern || 'solid'\"\n [visibility]=\"item.hidden ? 'hidden' : 'visible'\"\n [clickable]=\"config.allowLegendToggle\"\n [showCheckWhenClickable]=\"item.pattern !== 'dots'\"\n [colorToken]=\"getItemColor(item, i)\"\n (itemClick)=\"toggleLegend(item, i)\"\n ></riv-legend-item>\n </ng-container>\n <ng-container\n *ngFor=\"let item of d.data.supplementaryYs; let i = index\"\n >\n <riv-legend-item\n *ngIf=\"i < fi.suppIndex && item.showLegendItem !== false\"\n [label]=\"item.label\"\n [style]=\"item.pattern || 'solid'\"\n [visibility]=\"item.hidden ? 'hidden' : 'visible'\"\n [clickable]=\"config.allowLegendToggle\"\n [showCheckWhenClickable]=\"item.pattern !== 'dots'\"\n [colorToken]=\"getItemColor(item, i)\"\n (itemClick)=\"toggleLegend(item, i)\"\n ></riv-legend-item>\n </ng-container>\n <div\n #moreTextContainer\n class=\"more-text-container\"\n (mouseover)=\"mouseoverLegend()\"\n (mouseleave)=\"mouseleaveLegend()\"\n (click)=\"moreClick()\"\n *ngIf=\"fi.hiddenCount\"\n >\n <span rivLink class=\"more-text\">\n +\n {{ fi.hiddenCount }} more\n </span>\n </div>\n <ng-container *ngIf=\"showMoreTooltip || lockShowMoreTooltip\">\n <riv-callout\n *riv-overlay\n [anchor]=\"\n $safeNavigationMigration(moreTextContainer?.nativeElement)\n \"\n [isModal]=\"lockShowMoreTooltip\"\n (close)=\"closeHandler()\"\n [preferredPosition]=\"'bottom-right'\"\n [theme]=\"'light'\"\n [showCaret]=\"false\"\n >\n <div class=\"legend-tooltip\">\n <ng-container *ngFor=\"let item of d.data.ys; let i = index\">\n <riv-legend-item\n *ngIf=\"i >= fi.dataIndex && item.showLegendItem !== false\"\n [label]=\"item.label\"\n [style]=\"item.pattern || 'solid'\"\n [visibility]=\"item.hidden ? 'hidden' : 'visible'\"\n [clickable]=\"config.allowLegendToggle\"\n [showCheckWhenClickable]=\"item.pattern !== 'dots'\"\n [colorToken]=\"getItemColor(item, i)\"\n (itemClick)=\"toggleLegend(item, i)\"\n ></riv-legend-item>\n </ng-container>\n <ng-container\n *ngFor=\"let item of d.data.supplementaryYs; let i = index\"\n >\n <riv-legend-item\n *ngIf=\"i >= fi.suppIndex && item.showLegendItem !== false\"\n [label]=\"item.label\"\n [style]=\"item.pattern || 'solid'\"\n [visibility]=\"item.hidden ? 'hidden' : 'visible'\"\n [colorToken]=\"getItemColor(item, i)\"\n [clickable]=\"config.allowLegendToggle\"\n [showCheckWhenClickable]=\"item.pattern !== 'dots'\"\n (itemClick)=\"toggleLegend(item, i)\"\n ></riv-legend-item>\n </ng-container>\n </div>\n </riv-callout>\n </ng-container>\n </ng-container>\n </legend>\n </ng-container>\n</div>\n\n<ng-template #nonDisplayState>\n <ng-container *ngIf=\"checkForNonDisplayState(drawData$ | async); let type\">\n <riv-zero-state\n *ngIf=\"type === 'zeroState'\"\n [message]=\"config.zeroStateMessage\"\n ></riv-zero-state>\n <riv-zero-state\n *ngIf=\"type === 'sizingErrorState'\"\n [message]=\"config.sizingErrorStateMessage\"\n ></riv-zero-state>\n </ng-container>\n</ng-template>\n",
|
|
20632
|
+
template: "<div\n class=\"container\"\n (rivClientSize)=\"width = $event.width\"\n *ngIf=\"{ d: drawData$ | async } as vm\"\n [style.--override-font-size]=\"getFontSize(vm.d)\"\n>\n <ng-container\n *ngIf=\"\n !checkForNonDisplayState(vm.d) && (drawData$ | async);\n let d;\n else: nonDisplayState\n \"\n >\n <div\n (mousemove)=\"mousemove($event, d.hover)\"\n (mouseleave)=\"mouseleave($event)\"\n (click)=\"click()\"\n #container\n class=\"sub-container\"\n [class.clickable]=\"isHoverClickable\"\n tabIndex=\"0\"\n [ngClass]=\"{ 'donut-container': config.type === 'donut' }\"\n [ngStyle]=\"{\n height: getSubcontainerHeight(d),\n width: getSubcontainerWidth(d)\n }\"\n >\n <svg:svg\n xmlns=\"http://www.w3.org/2000/svg\"\n [attr.viewBox]=\"d.viewBox\"\n [attr.height]=\"d.chartHeight\"\n [attr.width]=\"d.chartWidth\"\n >\n <defs>\n <!-- Stripe pattern -->\n <pattern\n id=\"stripes\"\n x=\"0\"\n y=\"0\"\n [attr.width]=\"10\"\n [attr.height]=\"10\"\n patternUnits=\"userSpaceOnUse\"\n >\n <line\n [attr.x1]=\"0\"\n [attr.y1]=\"10\"\n [attr.x2]=\"10\"\n [attr.y2]=\"0\"\n stroke=\"var(--white-100)\"\n stroke-width=\"1\"\n ></line>\n </pattern>\n </defs>\n <ng-container *ngIf=\"!(config.type === 'horizontal-bar')\">\n <g *ngFor=\"let tick of d.xTicks\" text-anchor=\"middle\">\n <text\n class=\"tick-label\"\n [attr.x]=\"tick.x\"\n [attr.y]=\"getBottomLabelY(d)\"\n >\n {{ tick.label }}\n </text>\n </g>\n </ng-container>\n <ng-container *ngIf=\"config.type === 'horizontal-bar'\">\n <g *ngFor=\"let tick of d.xTicks\" text-anchor=\"left\">\n <text\n class=\"tick-label\"\n [attr.x]=\"tick.x\"\n [attr.y]=\"d.chartSizingValues.fontSize\"\n >\n {{ tick.label }}\n </text>\n <line\n class=\"tick-line\"\n [attr.x1]=\"tick.x\"\n [attr.x2]=\"tick.x\"\n y1=\"0\"\n [attr.y2]=\"d.chartHeight\"\n ></line>\n <text\n *ngIf=\"tick.secondaryLabel\"\n class=\"tick-label\"\n [attr.x]=\"tick.x\"\n [attr.y]=\"getBottomLabelY(d)\"\n >\n {{ tick.secondaryLabel }}\n </text>\n </g>\n </ng-container>\n <g *ngFor=\"let tick of d.yTicks\">\n <line\n *ngIf=\"!(config.type === 'horizontal-bar')\"\n class=\"tick-line\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\"\n x1=\"0\"\n [attr.x2]=\"d.chartWidth\"\n ></line>\n <text\n rivSVGTextTruncate\n [text]=\"tick.label\"\n [width]=\"\n config.type === 'horizontal-bar'\n ? d.chartSizingValues.leftBucketLabel\n : d.chartSizingValues.leftPadding\n \"\n class=\"tick-label\"\n [attr.y]=\"tick.y\"\n [attr.x]=\"0\"\n >\n {{ tick.label }}\n </text>\n <text\n *ngIf=\"tick.secondaryLabel\"\n rivSVGTextTruncate\n [text]=\"tick.secondaryLabel\"\n [width]=\"d.chartSizingValues.rightPadding\"\n class=\"tick-label\"\n [attr.y]=\"tick.y\"\n [attr.x]=\"d.chartWidth\"\n text-anchor=\"end\"\n >\n {{ tick.secondaryLabel }}\n </text>\n </g>\n <ng-container *ngIf=\"standardHoverDataGuard(hover) as hoverData\">\n <g\n *ngIf=\"config.type !== 'horizontal-bar' && config.type !== 'donut'\"\n >\n <line\n class=\"tick-line\"\n [attr.x1]=\"hoverData?.x\"\n [attr.x2]=\"hoverData?.x\"\n y1=\"0\"\n [attr.y2]=\"d.chartHeight\"\n stroke-width=\"2\"\n stroke-dasharray=\"4\"\n />\n </g>\n </ng-container>\n <g *ngFor=\"let bar of d.bars; let i = index\">\n <ng-container *ngFor=\"let rect of bar; let j = index\">\n <defs *ngIf=\"rect.pattern === 'dots'\">\n <pattern\n [attr.id]=\"'dots-' + i + '-' + j\"\n patternUnits=\"userSpaceOnUse\"\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n width=\"4\"\n height=\"4\"\n >\n <circle\n cx=\"2\"\n cy=\"2\"\n r=\"1.5\"\n [attr.fill]=\"varColor(d.colors, i)\"\n ></circle>\n </pattern>\n </defs>\n\n <rect\n *ngIf=\"rect.nonDisplay !== true\"\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n [attr.width]=\"rect.width\"\n [attr.height]=\"rect.height\"\n [attr.fill]=\"\n rect.pattern === 'dots'\n ? 'url(#dots-' + i + '-' + j + ')'\n : getBarColor(rect, d.colors, i, hover)\n \"\n [attr.stroke]=\"\n showBarBorders(rect, hover) ? varWrap('--black-100') : undefined\n \"\n [attr.stroke-width]=\"showBarBorders(rect, hover) ? 1 : undefined\"\n ></rect>\n <rect\n *ngIf=\"showNonDisplayRect(rect, hover)\"\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n [attr.width]=\"rect.width\"\n [attr.height]=\"rect.height\"\n fill=\"transparent\"\n [attr.stroke]=\"varWrap('--black-100')\"\n [attr.stroke-width]=\"1\"\n ></rect>\n <rect\n *ngIf=\"rect.pattern === 'striped'\"\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n [attr.width]=\"rect.width\"\n [attr.height]=\"rect.height\"\n fill=\"url(#stripes)\"\n ></rect>\n </ng-container>\n </g>\n <g *ngFor=\"let bar of d.horizontalBars; let i = index\">\n <ng-container *ngFor=\"let indBar of bar; let j = index\">\n <defs *ngIf=\"indBar.pattern === 'dots'\">\n <pattern\n [attr.id]=\"'dots-' + i + '-' + j\"\n patternUnits=\"userSpaceOnUse\"\n [attr.x]=\"indBar.x\"\n [attr.y]=\"indBar.y\"\n width=\"4\"\n height=\"4\"\n >\n <circle\n cx=\"2\"\n cy=\"2\"\n r=\"1.5\"\n [attr.fill]=\"varColor(d.colors, i)\"\n ></circle>\n </pattern>\n </defs>\n <path\n [attr.d]=\"indBar.horizontalBar\"\n [attr.fill]=\"\n indBar.pattern === 'dots'\n ? 'url(#dots-' + i + '-' + j + ')'\n : varColor(d.colors, i)\n \"\n [attr.stroke]=\"\n indBar.pattern === 'dots' ? 'none' : varColor(d.colors, i)\n \"\n [attr.stroke-width]=\"indBar.pattern === 'dots' ? 0 : 2\"\n />\n <path\n *ngIf=\"indBar.pattern === 'striped'\"\n [attr.d]=\"indBar.horizontalBar\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n fill=\"url(#stripes)\"\n stroke-width=\"0\"\n />\n </ng-container>\n </g>\n <g *ngFor=\"let gradient of d.gradients; let i = index\">\n <ng-container *ngFor=\"let rect of gradient; let j = index\">\n <defs>\n <linearGradient\n [attr.id]=\"'grad-' + i + '-' + j\"\n x1=\"0\"\n y1=\"0\"\n x2=\"0\"\n y2=\"1\"\n >\n <stop offset=\"0%\" [attr.stop-color]=\"varColor(d.colors, i)\" />\n <stop offset=\"100%\" stop-color=\"white\" />\n </linearGradient>\n </defs>\n <rect\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n [attr.width]=\"rect.width\"\n [attr.height]=\"rect.height\"\n [attr.fill]=\"'url(#grad-' + i + '-' + j + ')'\"\n opacity=\"0.4\"\n ></rect>\n </ng-container>\n </g>\n <g *ngFor=\"let line of d.lines; let i = index\">\n <path\n [attr.d]=\"line.line\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n fill=\"none\"\n stroke-width=\"2\"\n [attr.stroke-linecap]=\"\n line.pattern === 'dots' ? 'round' : undefined\n \"\n [attr.stroke-linejoin]=\"\n line.pattern === 'dots' ? 'round' : undefined\n \"\n [attr.stroke-dasharray]=\"\n line.pattern === 'striped'\n ? '10 10'\n : line.pattern === 'dots'\n ? '0.25 7'\n : undefined\n \"\n ></path>\n </g>\n <g *ngFor=\"let lineSinglePointFallback of d.circles; let i = index\">\n <circle\n class=\"marker\"\n [attr.cx]=\"lineSinglePointFallback.cx\"\n [attr.cy]=\"lineSinglePointFallback.cy\"\n r=\"3.5\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></circle>\n </g>\n <g *ngFor=\"let line of d.lines; let i = index\">\n <ng-container *ngIf=\"standardHoverDataGuard(hover) as hoverData\">\n <circle\n class=\"marker\"\n *ngIf=\"config.groupedTooltip || i === hoverData?.visibleYIndex\"\n [attr.cx]=\"hoverData?.x\"\n [attr.cy]=\"hoverData?.ys?.[i]\"\n r=\"3.5\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></circle>\n </ng-container>\n </g>\n <g *ngFor=\"let area of d.areas; let i = index\">\n <path [attr.d]=\"area.area\" [attr.fill]=\"varColor(d.colors, i)\"></path>\n <path\n *ngIf=\"area.pattern === 'striped'\"\n [attr.d]=\"area.area\"\n fill=\"url(#stripes)\"\n ></path>\n </g>\n <g *ngFor=\"let area of d.areas; let i = index\">\n <ng-container *ngIf=\"standardHoverDataGuard(hover) as hoverData\">\n <circle\n class=\"marker\"\n *ngIf=\"config.groupedTooltip || i === hoverData?.visibleYIndex\"\n [attr.cx]=\"hoverData?.x\"\n [attr.cy]=\"hoverData?.ys?.[i]\"\n r=\"3.5\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></circle>\n </ng-container>\n </g>\n <g *ngFor=\"let wLine of d.waterfallLines\">\n <line\n class=\"waterfall-line\"\n [attr.x1]=\"wLine.x1\"\n [attr.x2]=\"wLine.x2\"\n [attr.y1]=\"wLine.y1\"\n [attr.y2]=\"wLine.y2\"\n stroke-width=\"1\"\n stroke-dasharray=\"6\"\n />\n </g>\n <path\n *ngFor=\"let path of d.arcs; let i = index\"\n [attr.d]=\"path\"\n [attr.fill]=\"varColor(d.colors, i)\"\n ></path>\n <g *ngFor=\"let dataLabel of d.dataLabels; let i = index\">\n <text\n *ngIf=\"config.showDataLabels && dataLabel.label\"\n [ngClass]=\"getDataLabelClass(dataLabel, config, hover)\"\n [attr.y]=\"dataLabel.yPos\"\n [attr.x]=\"dataLabel.xPos\"\n [attr.text-anchor]=\"dataLabel.anchor\"\n [attr.font-weight]=\"\n dataLabel.bold\n ? 'var(--font-weight-heavy)'\n : 'var(--font-weight-normal)'\n \"\n [attr.opacity]=\"getDataLabelOpacity(dataLabel, config, hover)\"\n >\n {{ dataLabel.label }}\n </text>\n <line\n *ngIf=\"dataLabel.line && config.showDataLabels\"\n [attr.y1]=\"dataLabel.line.y1\"\n [attr.y2]=\"dataLabel.line.y2\"\n [attr.x1]=\"dataLabel.line.x1\"\n [attr.x2]=\"dataLabel.line.x2\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></line>\n </g>\n <g *ngFor=\"let connection of d.flowConnections\">\n <path\n [attr.d]=\"connection.path\"\n [attr.fill]=\"getConnectionColor()\"\n [attr.opacity]=\"getConnectionOpacity(connection, hover)\"\n />\n </g>\n </svg:svg>\n <div *ngIf=\"config.type === 'donut'\" class=\"donut-display\">\n <div class=\"donut-value\" [ngClass]=\"config.donutDisplayInfo.size\">\n {{ config.donutDisplayInfo.displayValue }}\n </div>\n <div class=\"donut-label\">\n {{ config.donutDisplayInfo.displayLabel }}\n </div>\n </div>\n <ng-container *ngIf=\"standardHoverDataGuard(hover) as hoverData\">\n <riv-callout\n *riv-overlay\n [anchor]=\"\n hoverData?.tooltip?.anchor ? hoverData.tooltip.anchor : null\n \"\n [isModal]=\"false\"\n [preferredPosition]=\"\n hoverData?.tooltip?.preferredPosition ?? 'center-right'\n \"\n [theme]=\"'light'\"\n >\n <ng-container *ngIf=\"tooltipTemplate; else defaultTooltip\">\n <ng-container\n *ngIf=\"hoverData\"\n [ngTemplateOutlet]=\"tooltipTemplate\"\n [ngTemplateOutletContext]=\"{\n xIndex: hoverData.xIndex,\n yIndex: hoverData.yIndex,\n isSuppValue: hoverData.isSuppValue,\n suppYIndex: hoverData.suppYIndex,\n isDropOff: hoverData.isDropOff\n }\"\n ></ng-container>\n </ng-container>\n <ng-template #defaultTooltip>\n <div class=\"callout-content\">\n <div *ngIf=\"hoverData?.tooltip?.date\" class=\"callout-row\">\n {{ hoverData?.tooltip?.date }}\n </div>\n <div\n class=\"callout-row\"\n *ngFor=\"let metric of hoverData?.tooltip?.metrics\"\n >\n <span class=\"series-label\">\n <riv-legend-item\n [colorToken]=\"metric.color\"\n [style]=\"metric.pattern || 'solid'\"\n ></riv-legend-item>\n <span>{{ metric.label }}</span>\n </span>\n <span>{{ metric.value }}</span>\n </div>\n </div>\n </ng-template>\n </riv-callout>\n </ng-container>\n <ng-container *ngIf=\"flowHoverDataGuard(hover) as hoverData\">\n <riv-callout\n *riv-overlay\n [anchor]=\"\n hoverData?.tooltip?.anchor ? hoverData.tooltip.anchor : null\n \"\n [isModal]=\"false\"\n [preferredPosition]=\"'top-center'\"\n [theme]=\"'light'\"\n >\n <div class=\"callout-content\">\n <div class=\"callout-row\">\n <ng-container *ngIf=\"hoverData?.hoverTarget === 'connection'\">\n <ng-container\n *ngIf=\"\n getBucketConfigInfo(hoverData, 'startId') as startConfig\n \"\n >\n <riv-issue\n [label]=\"startConfig.title\"\n [colorToken]=\"startConfig.color\"\n ></riv-issue>\n </ng-container>\n ->\n <ng-container\n *ngIf=\"getBucketConfigInfo(hoverData, 'endId') as endConfig\"\n >\n <riv-issue\n [label]=\"endConfig.title\"\n [colorToken]=\"endConfig.color\"\n ></riv-issue>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"hoverData?.hoverTarget !== 'connection'\">\n <ng-container\n *ngIf=\"getBucketConfigInfo(hoverData, 'barId') as barConfig\"\n >\n <riv-issue\n [label]=\"barConfig.title\"\n [colorToken]=\"barConfig.color\"\n ></riv-issue>\n </ng-container>\n </ng-container>\n </div>\n <div\n *ngIf=\"hoverData?.tooltip?.subtitle\"\n class=\"callout-row flow-subtitle\"\n >\n {{ hoverData?.tooltip?.subtitle }}\n </div>\n </div>\n </riv-callout>\n </ng-container>\n </div>\n <legend *ngIf=\"d.data.type !== 'flow'\">\n <ng-container *ngIf=\"firstHiddenLegendItemIndex$ | async; let fi\">\n <ng-container *ngFor=\"let item of d.data.ys; let i = index\">\n <riv-legend-item\n *ngIf=\"i < fi.dataIndex && item.showLegendItem !== false\"\n [label]=\"item.label\"\n [style]=\"item.pattern || 'solid'\"\n [visibility]=\"item.hidden ? 'hidden' : 'visible'\"\n [clickable]=\"config.allowLegendToggle\"\n [showCheckWhenClickable]=\"item.pattern !== 'dots'\"\n [colorToken]=\"getItemColor(item, i)\"\n (itemClick)=\"toggleLegend(item, i)\"\n ></riv-legend-item>\n </ng-container>\n <ng-container\n *ngFor=\"let item of d.data.supplementaryYs; let i = index\"\n >\n <riv-legend-item\n *ngIf=\"i < fi.suppIndex && item.showLegendItem !== false\"\n [label]=\"item.label\"\n [style]=\"item.pattern || 'solid'\"\n [visibility]=\"item.hidden ? 'hidden' : 'visible'\"\n [clickable]=\"config.allowLegendToggle\"\n [showCheckWhenClickable]=\"item.pattern !== 'dots'\"\n [colorToken]=\"getItemColor(item, i)\"\n (itemClick)=\"toggleLegend(item, i)\"\n ></riv-legend-item>\n </ng-container>\n <div\n #moreTextContainer\n class=\"more-text-container\"\n (mouseover)=\"mouseoverLegend()\"\n (mouseleave)=\"mouseleaveLegend()\"\n (click)=\"moreClick()\"\n *ngIf=\"fi.hiddenCount\"\n >\n <span rivLink class=\"more-text\">\n +\n {{ fi.hiddenCount }} more\n </span>\n </div>\n <ng-container *ngIf=\"showMoreTooltip || lockShowMoreTooltip\">\n <riv-callout\n *riv-overlay\n [anchor]=\"\n $safeNavigationMigration(moreTextContainer?.nativeElement)\n \"\n [isModal]=\"lockShowMoreTooltip\"\n (close)=\"closeHandler()\"\n [preferredPosition]=\"'bottom-right'\"\n [theme]=\"'light'\"\n [showCaret]=\"false\"\n >\n <div class=\"legend-tooltip\">\n <ng-container *ngFor=\"let item of d.data.ys; let i = index\">\n <riv-legend-item\n *ngIf=\"i >= fi.dataIndex && item.showLegendItem !== false\"\n [label]=\"item.label\"\n [style]=\"item.pattern || 'solid'\"\n [visibility]=\"item.hidden ? 'hidden' : 'visible'\"\n [clickable]=\"config.allowLegendToggle\"\n [showCheckWhenClickable]=\"item.pattern !== 'dots'\"\n [colorToken]=\"getItemColor(item, i)\"\n (itemClick)=\"toggleLegend(item, i)\"\n ></riv-legend-item>\n </ng-container>\n <ng-container\n *ngFor=\"let item of d.data.supplementaryYs; let i = index\"\n >\n <riv-legend-item\n *ngIf=\"i >= fi.suppIndex && item.showLegendItem !== false\"\n [label]=\"item.label\"\n [style]=\"item.pattern || 'solid'\"\n [visibility]=\"item.hidden ? 'hidden' : 'visible'\"\n [colorToken]=\"getItemColor(item, i)\"\n [clickable]=\"config.allowLegendToggle\"\n [showCheckWhenClickable]=\"item.pattern !== 'dots'\"\n (itemClick)=\"toggleLegend(item, i)\"\n ></riv-legend-item>\n </ng-container>\n </div>\n </riv-callout>\n </ng-container>\n </ng-container>\n </legend>\n </ng-container>\n</div>\n\n<ng-template #nonDisplayState>\n <ng-container *ngIf=\"checkForNonDisplayState(drawData$ | async); let type\">\n <riv-zero-state\n *ngIf=\"type === 'zeroState'\"\n [message]=\"config.zeroStateMessage\"\n ></riv-zero-state>\n <riv-zero-state\n *ngIf=\"type === 'sizingErrorState'\"\n [message]=\"config.sizingErrorStateMessage\"\n ></riv-zero-state>\n </ng-container>\n</ng-template>\n",
|
|
20529
20633
|
styles: [".container{-webkit-user-select:none;user-select:none;position:relative;display:flex;flex-direction:column;gap:var(--size-xlarge)}.tick-line{stroke:var(--gray-20)}.tick-label{font-size:var(--override-font-size);line-height:var(--type-1-line-height-0);fill:var(--type-light-low-contrast)}.marker{fill:var(--surface-light-0)}.callout-content{pointer-events:none;padding:var(--size-medium) var(--size-xlarge);display:flex;flex-direction:column}.callout-row{white-space:nowrap;display:flex;padding:var(--size-medium) 0;gap:var(--size-medium);align-items:center;font-size:var(--type-1-font-size);line-height:var(--type-1-line-height-0)}.callout-row:not(:last-child){border-bottom:var(--border-width) solid var(--border-light)}.series-label{flex-grow:1;font-weight:var(--font-weight-heavy);display:flex;align-items:center;gap:var(--size-small)}legend{display:flex;flex-wrap:wrap;gap:var(--size-large);justify-content:flex-start;align-items:baseline;width:100%}.more-text-container{width:calc(var(--base-grid-size) * 15);height:var(--size-large)}.more-text{font-size:var(--type-1-font-size);top:calc(var(--base-grid-size) * -1);position:relative}.legend-tooltip{padding:var(--size-medium) var(--size-xlarge);display:flex;flex-direction:column;overflow-y:scroll;max-height:clamp(0px,60vh,600px)}.legend-tooltip>riv-legend-item{white-space:nowrap;display:flex;padding:var(--size-medium) 0;gap:var(--size-medium);align-items:center;line-height:var(--type-1-line-height-0)}.sub-container.clickable{cursor:pointer}.sub-container{display:grid;grid-template-rows:1fr;grid-template-columns:1fr;overflow:auto}.sub-container:not(.donut-container){justify-items:start;align-items:start}.sub-container.donut-container{justify-items:center;align-items:center}svg{grid-row:1 / 1;grid-column:1 / 1}.donut-display{grid-row:1 / 1;grid-column:1 / 1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--size-small)}.donut-label{font-size:var(--type-1-font-size);line-height:var(--type-1-line-height-0);color:var(--type-light-low-contrast)}.donut-value,.donut-label{text-shadow:0 0 var(--size-small) var(--surface-light-0),0 0 var(--size-xsmall) var(--surface-light-0)}.donut-value.xsmall{font:var(--stat-xsmall)}.donut-value.small{font:var(--stat-small)}.donut-value.medium{font:var(--stat-medium)}.donut-value.large{font:var(--stat-large)}.data-label{fill:var(--type-light-high-contrast);font-size:var(--override-font-size)}.flow-data-label{text-decoration:underline;font-size:var(--override-font-size);cursor:pointer;fill:var(--type-light-link-hover)}.waterfall-line{stroke:var(--gray-60)}.flow-subtitle{font-weight:var(--font-weight-heavy)}\n"],
|
|
20530
20634
|
dependencies: [
|
|
20531
20635
|
{
|
|
@@ -20669,7 +20773,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
20669
20773
|
selector: "riv-chart",
|
|
20670
20774
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
20671
20775
|
standalone: false,
|
|
20672
|
-
template: "<div\n class=\"container\"\n (rivClientSize)=\"width = $event.width\"\n *ngIf=\"{ d: drawData$ | async } as vm\"\n [style.--override-font-size]=\"getFontSize(vm.d)\"\n>\n <ng-container\n *ngIf=\"\n !checkForNonDisplayState(vm.d) && (drawData$ | async);\n let d;\n else: nonDisplayState\n \"\n >\n <div\n (mousemove)=\"mousemove($event, d.hover)\"\n (mouseleave)=\"mouseleave($event)\"\n (click)=\"click()\"\n #container\n class=\"sub-container\"\n [class.clickable]=\"isHoverClickable\"\n tabIndex=\"0\"\n [ngClass]=\"{ 'donut-container': config.type === 'donut' }\"\n [ngStyle]=\"{\n height: getSubcontainerHeight(d),\n width: getSubcontainerWidth(d)\n }\"\n >\n <svg:svg\n xmlns=\"http://www.w3.org/2000/svg\"\n [attr.viewBox]=\"d.viewBox\"\n [attr.height]=\"d.chartHeight\"\n [attr.width]=\"d.chartWidth\"\n >\n <defs>\n <!-- Stripe pattern -->\n <pattern\n id=\"stripes\"\n x=\"0\"\n y=\"0\"\n [attr.width]=\"10\"\n [attr.height]=\"10\"\n patternUnits=\"userSpaceOnUse\"\n >\n <line\n [attr.x1]=\"0\"\n [attr.y1]=\"10\"\n [attr.x2]=\"10\"\n [attr.y2]=\"0\"\n stroke=\"var(--white-100)\"\n stroke-width=\"1\"\n ></line>\n </pattern>\n </defs>\n <ng-container *ngIf=\"!(config.type === 'horizontal-bar')\">\n <g *ngFor=\"let tick of d.xTicks\" text-anchor=\"middle\">\n <text\n class=\"tick-label\"\n [attr.x]=\"tick.x\"\n [attr.y]=\"getBottomLabelY(d)\"\n >\n {{ tick.label }}\n </text>\n </g>\n </ng-container>\n <ng-container *ngIf=\"config.type === 'horizontal-bar'\">\n <g *ngFor=\"let tick of d.xTicks\" text-anchor=\"left\">\n <text\n class=\"tick-label\"\n [attr.x]=\"tick.x\"\n [attr.y]=\"d.chartSizingValues.fontSize\"\n >\n {{ tick.label }}\n </text>\n <line\n class=\"tick-line\"\n [attr.x1]=\"tick.x\"\n [attr.x2]=\"tick.x\"\n y1=\"0\"\n [attr.y2]=\"d.chartHeight\"\n ></line>\n <text\n *ngIf=\"tick.secondaryLabel\"\n class=\"tick-label\"\n [attr.x]=\"tick.x\"\n [attr.y]=\"getBottomLabelY(d)\"\n >\n {{ tick.secondaryLabel }}\n </text>\n </g>\n </ng-container>\n <g *ngFor=\"let tick of d.yTicks\">\n <line\n *ngIf=\"!(config.type === 'horizontal-bar')\"\n class=\"tick-line\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\"\n x1=\"0\"\n [attr.x2]=\"d.chartWidth\"\n ></line>\n <text\n rivSVGTextTruncate\n [text]=\"tick.label\"\n [width]=\"\n config.type === 'horizontal-bar'\n ? d.chartSizingValues.leftBucketLabel\n : d.chartSizingValues.leftPadding\n \"\n class=\"tick-label\"\n [attr.y]=\"tick.y\"\n [attr.x]=\"0\"\n >\n {{ tick.label }}\n </text>\n <text\n *ngIf=\"tick.secondaryLabel\"\n rivSVGTextTruncate\n [text]=\"tick.secondaryLabel\"\n [width]=\"d.chartSizingValues.rightPadding\"\n class=\"tick-label\"\n [attr.y]=\"tick.y\"\n [attr.x]=\"d.chartWidth\"\n text-anchor=\"end\"\n >\n {{ tick.secondaryLabel }}\n </text>\n </g>\n <ng-container *ngIf=\"standardHoverDataGuard(hover) as hoverData\">\n <g\n *ngIf=\"config.type !== 'horizontal-bar' && config.type !== 'donut'\"\n >\n <line\n class=\"tick-line\"\n [attr.x1]=\"hoverData?.x\"\n [attr.x2]=\"hoverData?.x\"\n y1=\"0\"\n [attr.y2]=\"d.chartHeight\"\n stroke-width=\"2\"\n stroke-dasharray=\"4\"\n />\n </g>\n </ng-container>\n <g *ngFor=\"let bar of d.bars; let i = index\">\n <ng-container *ngFor=\"let rect of bar; let j = index\">\n <defs *ngIf=\"rect.pattern === 'dots'\">\n <pattern\n [attr.id]=\"'dots-' + i + '-' + j\"\n patternUnits=\"userSpaceOnUse\"\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n width=\"4\"\n height=\"4\"\n >\n <circle\n cx=\"2\"\n cy=\"2\"\n r=\"1.5\"\n [attr.fill]=\"varColor(d.colors, i)\"\n ></circle>\n </pattern>\n </defs>\n\n <rect\n *ngIf=\"rect.nonDisplay !== true\"\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n [attr.width]=\"rect.width\"\n [attr.height]=\"rect.height\"\n [attr.fill]=\"\n rect.pattern === 'dots'\n ? 'url(#dots-' + i + '-' + j + ')'\n : getBarColor(rect, d.colors, i, hover)\n \"\n [attr.stroke]=\"\n showBarBorders(rect, hover) ? varWrap('--black-100') : undefined\n \"\n [attr.stroke-width]=\"showBarBorders(rect, hover) ? 1 : undefined\"\n ></rect>\n <rect\n *ngIf=\"showNonDisplayRect(rect, hover)\"\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n [attr.width]=\"rect.width\"\n [attr.height]=\"rect.height\"\n fill=\"transparent\"\n [attr.stroke]=\"varWrap('--black-100')\"\n [attr.stroke-width]=\"1\"\n ></rect>\n <rect\n *ngIf=\"rect.pattern === 'striped'\"\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n [attr.width]=\"rect.width\"\n [attr.height]=\"rect.height\"\n fill=\"url(#stripes)\"\n ></rect>\n </ng-container>\n </g>\n <g *ngFor=\"let bar of d.horizontalBars; let i = index\">\n <ng-container *ngFor=\"let indBar of bar; let j = index\">\n <defs *ngIf=\"indBar.pattern === 'dots'\">\n <pattern\n [attr.id]=\"'dots-' + i + '-' + j\"\n patternUnits=\"userSpaceOnUse\"\n [attr.x]=\"indBar.x\"\n [attr.y]=\"indBar.y\"\n width=\"4\"\n height=\"4\"\n >\n <circle\n cx=\"2\"\n cy=\"2\"\n r=\"1.5\"\n [attr.fill]=\"varColor(d.colors, i)\"\n ></circle>\n </pattern>\n </defs>\n <path\n [attr.d]=\"indBar.horizontalBar\"\n [attr.fill]=\"\n indBar.pattern === 'dots'\n ? 'url(#dots-' + i + '-' + j + ')'\n : varColor(d.colors, i)\n \"\n [attr.stroke]=\"\n indBar.pattern === 'dots' ? 'none' : varColor(d.colors, i)\n \"\n [attr.stroke-width]=\"indBar.pattern === 'dots' ? 0 : 2\"\n />\n <path\n *ngIf=\"indBar.pattern === 'striped'\"\n [attr.d]=\"indBar.horizontalBar\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n fill=\"url(#stripes)\"\n stroke-width=\"0\"\n />\n </ng-container>\n </g>\n <g *ngFor=\"let gradient of d.gradients; let i = index\">\n <ng-container *ngFor=\"let rect of gradient; let j = index\">\n <defs>\n <linearGradient\n [attr.id]=\"'grad-' + i + '-' + j\"\n x1=\"0\"\n y1=\"0\"\n x2=\"0\"\n y2=\"1\"\n >\n <stop offset=\"0%\" [attr.stop-color]=\"varColor(d.colors, i)\" />\n <stop offset=\"100%\" stop-color=\"white\" />\n </linearGradient>\n </defs>\n <rect\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n [attr.width]=\"rect.width\"\n [attr.height]=\"rect.height\"\n [attr.fill]=\"'url(#grad-' + i + '-' + j + ')'\"\n opacity=\"0.4\"\n ></rect>\n </ng-container>\n </g>\n <g *ngFor=\"let line of d.lines; let i = index\">\n <path\n [attr.d]=\"line.line\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n fill=\"none\"\n stroke-width=\"2\"\n [attr.stroke-linecap]=\"\n line.pattern === 'dots' ? 'round' : undefined\n \"\n [attr.stroke-linejoin]=\"\n line.pattern === 'dots' ? 'round' : undefined\n \"\n [attr.stroke-dasharray]=\"\n line.pattern === 'striped'\n ? '10 10'\n : line.pattern === 'dots'\n ? '0.25 7'\n : undefined\n \"\n ></path>\n </g>\n <g *ngFor=\"let lineSinglePointFallback of d.circles; let i = index\">\n <circle\n class=\"marker\"\n [attr.cx]=\"lineSinglePointFallback.cx\"\n [attr.cy]=\"lineSinglePointFallback.cy\"\n r=\"3.5\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></circle>\n </g>\n <g *ngFor=\"let line of d.lines; let i = index\">\n <ng-container *ngIf=\"standardHoverDataGuard(hover) as hoverData\">\n <circle\n class=\"marker\"\n *ngIf=\"config.groupedTooltip || i === hoverData?.visibleYIndex\"\n [attr.cx]=\"hoverData?.x\"\n [attr.cy]=\"hoverData?.ys?.[i]\"\n r=\"3.5\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></circle>\n </ng-container>\n </g>\n <g *ngFor=\"let area of d.areas; let i = index\">\n <path [attr.d]=\"area.area\" [attr.fill]=\"varColor(d.colors, i)\"></path>\n <path\n *ngIf=\"area.pattern === 'striped'\"\n [attr.d]=\"area.area\"\n fill=\"url(#stripes)\"\n ></path>\n </g>\n <g *ngFor=\"let area of d.areas; let i = index\">\n <ng-container *ngIf=\"standardHoverDataGuard(hover) as hoverData\">\n <circle\n class=\"marker\"\n *ngIf=\"config.groupedTooltip || i === hoverData?.visibleYIndex\"\n [attr.cx]=\"hoverData?.x\"\n [attr.cy]=\"hoverData?.ys?.[i]\"\n r=\"3.5\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></circle>\n </ng-container>\n </g>\n <g *ngFor=\"let wLine of d.waterfallLines\">\n <line\n class=\"waterfall-line\"\n [attr.x1]=\"wLine.x1\"\n [attr.x2]=\"wLine.x2\"\n [attr.y1]=\"wLine.y1\"\n [attr.y2]=\"wLine.y2\"\n stroke-width=\"1\"\n stroke-dasharray=\"6\"\n />\n </g>\n <path\n *ngFor=\"let path of d.arcs; let i = index\"\n [attr.d]=\"path\"\n [attr.fill]=\"varColor(d.colors, i)\"\n ></path>\n <g *ngFor=\"let dataLabel of d.dataLabels; let i = index\">\n <text\n *ngIf=\"config.showDataLabels && dataLabel.label\"\n [ngClass]=\"getDataLabelClass(dataLabel, config, hover)\"\n [attr.y]=\"dataLabel.yPos\"\n [attr.x]=\"dataLabel.xPos\"\n [attr.text-anchor]=\"dataLabel.anchor\"\n [attr.font-weight]=\"\n dataLabel.bold\n ? 'var(--font-weight-heavy)'\n : 'var(--font-weight-normal)'\n \"\n [attr.opacity]=\"getDataLabelOpacity(dataLabel, config, hover)\"\n >\n {{ dataLabel.label }}\n </text>\n <line\n *ngIf=\"dataLabel.line && config.showDataLabels\"\n [attr.y1]=\"dataLabel.line.y1\"\n [attr.y2]=\"dataLabel.line.y2\"\n [attr.x1]=\"dataLabel.line.x1\"\n [attr.x2]=\"dataLabel.line.x2\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></line>\n </g>\n <g *ngFor=\"let connection of d.flowConnections\">\n <path\n [attr.d]=\"connection.path\"\n [attr.fill]=\"getConnectionColor()\"\n [attr.opacity]=\"getConnectionOpacity(connection, hover)\"\n />\n </g>\n </svg:svg>\n <div *ngIf=\"config.type === 'donut'\" class=\"donut-display\">\n <div class=\"donut-value\" [ngClass]=\"config.donutDisplayInfo.size\">\n {{ config.donutDisplayInfo.displayValue }}\n </div>\n <div class=\"donut-label\">\n {{ config.donutDisplayInfo.displayLabel }}\n </div>\n </div>\n <ng-container *ngIf=\"standardHoverDataGuard(hover) as hoverData\">\n <riv-callout\n *riv-overlay\n [anchor]=\"\n hoverData?.tooltip?.anchor ? hoverData.tooltip.anchor : null\n \"\n [isModal]=\"false\"\n [preferredPosition]=\"\n hoverData?.tooltip?.preferredPosition ?? 'center-right'\n \"\n [theme]=\"'light'\"\n >\n <ng-container *ngIf=\"tooltipTemplate; else defaultTooltip\">\n <ng-container\n [ngTemplateOutlet]=\"tooltipTemplate\"\n [ngTemplateOutletContext]=\"{\n xIndex: hoverData.xIndex,\n yIndex: hoverData.yIndex,\n isSuppValue: hoverData.isSuppValue,\n suppYIndex: hoverData.suppYIndex,\n isDropOff: hoverData.isDropOff\n }\"\n ></ng-container>\n </ng-container>\n <ng-template #defaultTooltip>\n <div class=\"callout-content\">\n <div *ngIf=\"hoverData?.tooltip?.date\" class=\"callout-row\">\n {{ hoverData?.tooltip?.date }}\n </div>\n <div\n class=\"callout-row\"\n *ngFor=\"let metric of hoverData?.tooltip?.metrics\"\n >\n <span class=\"series-label\">\n <riv-legend-item\n [colorToken]=\"metric.color\"\n [style]=\"metric.pattern || 'solid'\"\n ></riv-legend-item>\n <span>{{ metric.label }}</span>\n </span>\n <span>{{ metric.value }}</span>\n </div>\n </div>\n </ng-template>\n </riv-callout>\n </ng-container>\n <ng-container *ngIf=\"flowHoverDataGuard(hover) as hoverData\">\n <riv-callout\n *riv-overlay\n [anchor]=\"\n hoverData?.tooltip?.anchor ? hoverData.tooltip.anchor : null\n \"\n [isModal]=\"false\"\n [preferredPosition]=\"'top-center'\"\n [theme]=\"'light'\"\n >\n <div class=\"callout-content\">\n <div class=\"callout-row\">\n <ng-container *ngIf=\"hoverData?.hoverTarget === 'connection'\">\n <ng-container\n *ngIf=\"\n getBucketConfigInfo(hoverData, 'startId') as startConfig\n \"\n >\n <riv-issue\n [label]=\"startConfig.title\"\n [colorToken]=\"startConfig.color\"\n ></riv-issue>\n </ng-container>\n ->\n <ng-container\n *ngIf=\"getBucketConfigInfo(hoverData, 'endId') as endConfig\"\n >\n <riv-issue\n [label]=\"endConfig.title\"\n [colorToken]=\"endConfig.color\"\n ></riv-issue>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"hoverData?.hoverTarget !== 'connection'\">\n <ng-container\n *ngIf=\"getBucketConfigInfo(hoverData, 'barId') as barConfig\"\n >\n <riv-issue\n [label]=\"barConfig.title\"\n [colorToken]=\"barConfig.color\"\n ></riv-issue>\n </ng-container>\n </ng-container>\n </div>\n <div\n *ngIf=\"hoverData?.tooltip?.subtitle\"\n class=\"callout-row flow-subtitle\"\n >\n {{ hoverData?.tooltip?.subtitle }}\n </div>\n </div>\n </riv-callout>\n </ng-container>\n </div>\n <legend *ngIf=\"d.data.type !== 'flow'\">\n <ng-container *ngIf=\"firstHiddenLegendItemIndex$ | async; let fi\">\n <ng-container *ngFor=\"let item of d.data.ys; let i = index\">\n <riv-legend-item\n *ngIf=\"i < fi.dataIndex && item.showLegendItem !== false\"\n [label]=\"item.label\"\n [style]=\"item.pattern || 'solid'\"\n [visibility]=\"item.hidden ? 'hidden' : 'visible'\"\n [clickable]=\"config.allowLegendToggle\"\n [showCheckWhenClickable]=\"item.pattern !== 'dots'\"\n [colorToken]=\"getItemColor(item, i)\"\n (itemClick)=\"toggleLegend(item, i)\"\n ></riv-legend-item>\n </ng-container>\n <ng-container\n *ngFor=\"let item of d.data.supplementaryYs; let i = index\"\n >\n <riv-legend-item\n *ngIf=\"i < fi.suppIndex && item.showLegendItem !== false\"\n [label]=\"item.label\"\n [style]=\"item.pattern || 'solid'\"\n [visibility]=\"item.hidden ? 'hidden' : 'visible'\"\n [clickable]=\"config.allowLegendToggle\"\n [showCheckWhenClickable]=\"item.pattern !== 'dots'\"\n [colorToken]=\"getItemColor(item, i)\"\n (itemClick)=\"toggleLegend(item, i)\"\n ></riv-legend-item>\n </ng-container>\n <div\n #moreTextContainer\n class=\"more-text-container\"\n (mouseover)=\"mouseoverLegend()\"\n (mouseleave)=\"mouseleaveLegend()\"\n (click)=\"moreClick()\"\n *ngIf=\"fi.hiddenCount\"\n >\n <span rivLink class=\"more-text\">\n +\n {{ fi.hiddenCount }} more\n </span>\n </div>\n <ng-container *ngIf=\"showMoreTooltip || lockShowMoreTooltip\">\n <riv-callout\n *riv-overlay\n [anchor]=\"\n $safeNavigationMigration(moreTextContainer?.nativeElement)\n \"\n [isModal]=\"lockShowMoreTooltip\"\n (close)=\"closeHandler()\"\n [preferredPosition]=\"'bottom-right'\"\n [theme]=\"'light'\"\n [showCaret]=\"false\"\n >\n <div class=\"legend-tooltip\">\n <ng-container *ngFor=\"let item of d.data.ys; let i = index\">\n <riv-legend-item\n *ngIf=\"i >= fi.dataIndex && item.showLegendItem !== false\"\n [label]=\"item.label\"\n [style]=\"item.pattern || 'solid'\"\n [visibility]=\"item.hidden ? 'hidden' : 'visible'\"\n [clickable]=\"config.allowLegendToggle\"\n [showCheckWhenClickable]=\"item.pattern !== 'dots'\"\n [colorToken]=\"getItemColor(item, i)\"\n (itemClick)=\"toggleLegend(item, i)\"\n ></riv-legend-item>\n </ng-container>\n <ng-container\n *ngFor=\"let item of d.data.supplementaryYs; let i = index\"\n >\n <riv-legend-item\n *ngIf=\"i >= fi.suppIndex && item.showLegendItem !== false\"\n [label]=\"item.label\"\n [style]=\"item.pattern || 'solid'\"\n [visibility]=\"item.hidden ? 'hidden' : 'visible'\"\n [colorToken]=\"getItemColor(item, i)\"\n [clickable]=\"config.allowLegendToggle\"\n [showCheckWhenClickable]=\"item.pattern !== 'dots'\"\n (itemClick)=\"toggleLegend(item, i)\"\n ></riv-legend-item>\n </ng-container>\n </div>\n </riv-callout>\n </ng-container>\n </ng-container>\n </legend>\n </ng-container>\n</div>\n\n<ng-template #nonDisplayState>\n <ng-container *ngIf=\"checkForNonDisplayState(drawData$ | async); let type\">\n <riv-zero-state\n *ngIf=\"type === 'zeroState'\"\n [message]=\"config.zeroStateMessage\"\n ></riv-zero-state>\n <riv-zero-state\n *ngIf=\"type === 'sizingErrorState'\"\n [message]=\"config.sizingErrorStateMessage\"\n ></riv-zero-state>\n </ng-container>\n</ng-template>\n",
|
|
20776
|
+
template: "<div\n class=\"container\"\n (rivClientSize)=\"width = $event.width\"\n *ngIf=\"{ d: drawData$ | async } as vm\"\n [style.--override-font-size]=\"getFontSize(vm.d)\"\n>\n <ng-container\n *ngIf=\"\n !checkForNonDisplayState(vm.d) && (drawData$ | async);\n let d;\n else: nonDisplayState\n \"\n >\n <div\n (mousemove)=\"mousemove($event, d.hover)\"\n (mouseleave)=\"mouseleave($event)\"\n (click)=\"click()\"\n #container\n class=\"sub-container\"\n [class.clickable]=\"isHoverClickable\"\n tabIndex=\"0\"\n [ngClass]=\"{ 'donut-container': config.type === 'donut' }\"\n [ngStyle]=\"{\n height: getSubcontainerHeight(d),\n width: getSubcontainerWidth(d)\n }\"\n >\n <svg:svg\n xmlns=\"http://www.w3.org/2000/svg\"\n [attr.viewBox]=\"d.viewBox\"\n [attr.height]=\"d.chartHeight\"\n [attr.width]=\"d.chartWidth\"\n >\n <defs>\n <!-- Stripe pattern -->\n <pattern\n id=\"stripes\"\n x=\"0\"\n y=\"0\"\n [attr.width]=\"10\"\n [attr.height]=\"10\"\n patternUnits=\"userSpaceOnUse\"\n >\n <line\n [attr.x1]=\"0\"\n [attr.y1]=\"10\"\n [attr.x2]=\"10\"\n [attr.y2]=\"0\"\n stroke=\"var(--white-100)\"\n stroke-width=\"1\"\n ></line>\n </pattern>\n </defs>\n <ng-container *ngIf=\"!(config.type === 'horizontal-bar')\">\n <g *ngFor=\"let tick of d.xTicks\" text-anchor=\"middle\">\n <text\n class=\"tick-label\"\n [attr.x]=\"tick.x\"\n [attr.y]=\"getBottomLabelY(d)\"\n >\n {{ tick.label }}\n </text>\n </g>\n </ng-container>\n <ng-container *ngIf=\"config.type === 'horizontal-bar'\">\n <g *ngFor=\"let tick of d.xTicks\" text-anchor=\"left\">\n <text\n class=\"tick-label\"\n [attr.x]=\"tick.x\"\n [attr.y]=\"d.chartSizingValues.fontSize\"\n >\n {{ tick.label }}\n </text>\n <line\n class=\"tick-line\"\n [attr.x1]=\"tick.x\"\n [attr.x2]=\"tick.x\"\n y1=\"0\"\n [attr.y2]=\"d.chartHeight\"\n ></line>\n <text\n *ngIf=\"tick.secondaryLabel\"\n class=\"tick-label\"\n [attr.x]=\"tick.x\"\n [attr.y]=\"getBottomLabelY(d)\"\n >\n {{ tick.secondaryLabel }}\n </text>\n </g>\n </ng-container>\n <g *ngFor=\"let tick of d.yTicks\">\n <line\n *ngIf=\"!(config.type === 'horizontal-bar')\"\n class=\"tick-line\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\"\n x1=\"0\"\n [attr.x2]=\"d.chartWidth\"\n ></line>\n <text\n rivSVGTextTruncate\n [text]=\"tick.label\"\n [width]=\"\n config.type === 'horizontal-bar'\n ? d.chartSizingValues.leftBucketLabel\n : d.chartSizingValues.leftPadding\n \"\n class=\"tick-label\"\n [attr.y]=\"tick.y\"\n [attr.x]=\"0\"\n >\n {{ tick.label }}\n </text>\n <text\n *ngIf=\"tick.secondaryLabel\"\n rivSVGTextTruncate\n [text]=\"tick.secondaryLabel\"\n [width]=\"d.chartSizingValues.rightPadding\"\n class=\"tick-label\"\n [attr.y]=\"tick.y\"\n [attr.x]=\"d.chartWidth\"\n text-anchor=\"end\"\n >\n {{ tick.secondaryLabel }}\n </text>\n </g>\n <ng-container *ngIf=\"standardHoverDataGuard(hover) as hoverData\">\n <g\n *ngIf=\"config.type !== 'horizontal-bar' && config.type !== 'donut'\"\n >\n <line\n class=\"tick-line\"\n [attr.x1]=\"hoverData?.x\"\n [attr.x2]=\"hoverData?.x\"\n y1=\"0\"\n [attr.y2]=\"d.chartHeight\"\n stroke-width=\"2\"\n stroke-dasharray=\"4\"\n />\n </g>\n </ng-container>\n <g *ngFor=\"let bar of d.bars; let i = index\">\n <ng-container *ngFor=\"let rect of bar; let j = index\">\n <defs *ngIf=\"rect.pattern === 'dots'\">\n <pattern\n [attr.id]=\"'dots-' + i + '-' + j\"\n patternUnits=\"userSpaceOnUse\"\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n width=\"4\"\n height=\"4\"\n >\n <circle\n cx=\"2\"\n cy=\"2\"\n r=\"1.5\"\n [attr.fill]=\"varColor(d.colors, i)\"\n ></circle>\n </pattern>\n </defs>\n\n <rect\n *ngIf=\"rect.nonDisplay !== true\"\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n [attr.width]=\"rect.width\"\n [attr.height]=\"rect.height\"\n [attr.fill]=\"\n rect.pattern === 'dots'\n ? 'url(#dots-' + i + '-' + j + ')'\n : getBarColor(rect, d.colors, i, hover)\n \"\n [attr.stroke]=\"\n showBarBorders(rect, hover) ? varWrap('--black-100') : undefined\n \"\n [attr.stroke-width]=\"showBarBorders(rect, hover) ? 1 : undefined\"\n ></rect>\n <rect\n *ngIf=\"showNonDisplayRect(rect, hover)\"\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n [attr.width]=\"rect.width\"\n [attr.height]=\"rect.height\"\n fill=\"transparent\"\n [attr.stroke]=\"varWrap('--black-100')\"\n [attr.stroke-width]=\"1\"\n ></rect>\n <rect\n *ngIf=\"rect.pattern === 'striped'\"\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n [attr.width]=\"rect.width\"\n [attr.height]=\"rect.height\"\n fill=\"url(#stripes)\"\n ></rect>\n </ng-container>\n </g>\n <g *ngFor=\"let bar of d.horizontalBars; let i = index\">\n <ng-container *ngFor=\"let indBar of bar; let j = index\">\n <defs *ngIf=\"indBar.pattern === 'dots'\">\n <pattern\n [attr.id]=\"'dots-' + i + '-' + j\"\n patternUnits=\"userSpaceOnUse\"\n [attr.x]=\"indBar.x\"\n [attr.y]=\"indBar.y\"\n width=\"4\"\n height=\"4\"\n >\n <circle\n cx=\"2\"\n cy=\"2\"\n r=\"1.5\"\n [attr.fill]=\"varColor(d.colors, i)\"\n ></circle>\n </pattern>\n </defs>\n <path\n [attr.d]=\"indBar.horizontalBar\"\n [attr.fill]=\"\n indBar.pattern === 'dots'\n ? 'url(#dots-' + i + '-' + j + ')'\n : varColor(d.colors, i)\n \"\n [attr.stroke]=\"\n indBar.pattern === 'dots' ? 'none' : varColor(d.colors, i)\n \"\n [attr.stroke-width]=\"indBar.pattern === 'dots' ? 0 : 2\"\n />\n <path\n *ngIf=\"indBar.pattern === 'striped'\"\n [attr.d]=\"indBar.horizontalBar\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n fill=\"url(#stripes)\"\n stroke-width=\"0\"\n />\n </ng-container>\n </g>\n <g *ngFor=\"let gradient of d.gradients; let i = index\">\n <ng-container *ngFor=\"let rect of gradient; let j = index\">\n <defs>\n <linearGradient\n [attr.id]=\"'grad-' + i + '-' + j\"\n x1=\"0\"\n y1=\"0\"\n x2=\"0\"\n y2=\"1\"\n >\n <stop offset=\"0%\" [attr.stop-color]=\"varColor(d.colors, i)\" />\n <stop offset=\"100%\" stop-color=\"white\" />\n </linearGradient>\n </defs>\n <rect\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n [attr.width]=\"rect.width\"\n [attr.height]=\"rect.height\"\n [attr.fill]=\"'url(#grad-' + i + '-' + j + ')'\"\n opacity=\"0.4\"\n ></rect>\n </ng-container>\n </g>\n <g *ngFor=\"let line of d.lines; let i = index\">\n <path\n [attr.d]=\"line.line\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n fill=\"none\"\n stroke-width=\"2\"\n [attr.stroke-linecap]=\"\n line.pattern === 'dots' ? 'round' : undefined\n \"\n [attr.stroke-linejoin]=\"\n line.pattern === 'dots' ? 'round' : undefined\n \"\n [attr.stroke-dasharray]=\"\n line.pattern === 'striped'\n ? '10 10'\n : line.pattern === 'dots'\n ? '0.25 7'\n : undefined\n \"\n ></path>\n </g>\n <g *ngFor=\"let lineSinglePointFallback of d.circles; let i = index\">\n <circle\n class=\"marker\"\n [attr.cx]=\"lineSinglePointFallback.cx\"\n [attr.cy]=\"lineSinglePointFallback.cy\"\n r=\"3.5\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></circle>\n </g>\n <g *ngFor=\"let line of d.lines; let i = index\">\n <ng-container *ngIf=\"standardHoverDataGuard(hover) as hoverData\">\n <circle\n class=\"marker\"\n *ngIf=\"config.groupedTooltip || i === hoverData?.visibleYIndex\"\n [attr.cx]=\"hoverData?.x\"\n [attr.cy]=\"hoverData?.ys?.[i]\"\n r=\"3.5\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></circle>\n </ng-container>\n </g>\n <g *ngFor=\"let area of d.areas; let i = index\">\n <path [attr.d]=\"area.area\" [attr.fill]=\"varColor(d.colors, i)\"></path>\n <path\n *ngIf=\"area.pattern === 'striped'\"\n [attr.d]=\"area.area\"\n fill=\"url(#stripes)\"\n ></path>\n </g>\n <g *ngFor=\"let area of d.areas; let i = index\">\n <ng-container *ngIf=\"standardHoverDataGuard(hover) as hoverData\">\n <circle\n class=\"marker\"\n *ngIf=\"config.groupedTooltip || i === hoverData?.visibleYIndex\"\n [attr.cx]=\"hoverData?.x\"\n [attr.cy]=\"hoverData?.ys?.[i]\"\n r=\"3.5\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></circle>\n </ng-container>\n </g>\n <g *ngFor=\"let wLine of d.waterfallLines\">\n <line\n class=\"waterfall-line\"\n [attr.x1]=\"wLine.x1\"\n [attr.x2]=\"wLine.x2\"\n [attr.y1]=\"wLine.y1\"\n [attr.y2]=\"wLine.y2\"\n stroke-width=\"1\"\n stroke-dasharray=\"6\"\n />\n </g>\n <path\n *ngFor=\"let path of d.arcs; let i = index\"\n [attr.d]=\"path\"\n [attr.fill]=\"varColor(d.colors, i)\"\n ></path>\n <g *ngFor=\"let dataLabel of d.dataLabels; let i = index\">\n <text\n *ngIf=\"config.showDataLabels && dataLabel.label\"\n [ngClass]=\"getDataLabelClass(dataLabel, config, hover)\"\n [attr.y]=\"dataLabel.yPos\"\n [attr.x]=\"dataLabel.xPos\"\n [attr.text-anchor]=\"dataLabel.anchor\"\n [attr.font-weight]=\"\n dataLabel.bold\n ? 'var(--font-weight-heavy)'\n : 'var(--font-weight-normal)'\n \"\n [attr.opacity]=\"getDataLabelOpacity(dataLabel, config, hover)\"\n >\n {{ dataLabel.label }}\n </text>\n <line\n *ngIf=\"dataLabel.line && config.showDataLabels\"\n [attr.y1]=\"dataLabel.line.y1\"\n [attr.y2]=\"dataLabel.line.y2\"\n [attr.x1]=\"dataLabel.line.x1\"\n [attr.x2]=\"dataLabel.line.x2\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></line>\n </g>\n <g *ngFor=\"let connection of d.flowConnections\">\n <path\n [attr.d]=\"connection.path\"\n [attr.fill]=\"getConnectionColor()\"\n [attr.opacity]=\"getConnectionOpacity(connection, hover)\"\n />\n </g>\n </svg:svg>\n <div *ngIf=\"config.type === 'donut'\" class=\"donut-display\">\n <div class=\"donut-value\" [ngClass]=\"config.donutDisplayInfo.size\">\n {{ config.donutDisplayInfo.displayValue }}\n </div>\n <div class=\"donut-label\">\n {{ config.donutDisplayInfo.displayLabel }}\n </div>\n </div>\n <ng-container *ngIf=\"standardHoverDataGuard(hover) as hoverData\">\n <riv-callout\n *riv-overlay\n [anchor]=\"\n hoverData?.tooltip?.anchor ? hoverData.tooltip.anchor : null\n \"\n [isModal]=\"false\"\n [preferredPosition]=\"\n hoverData?.tooltip?.preferredPosition ?? 'center-right'\n \"\n [theme]=\"'light'\"\n >\n <ng-container *ngIf=\"tooltipTemplate; else defaultTooltip\">\n <ng-container\n *ngIf=\"hoverData\"\n [ngTemplateOutlet]=\"tooltipTemplate\"\n [ngTemplateOutletContext]=\"{\n xIndex: hoverData.xIndex,\n yIndex: hoverData.yIndex,\n isSuppValue: hoverData.isSuppValue,\n suppYIndex: hoverData.suppYIndex,\n isDropOff: hoverData.isDropOff\n }\"\n ></ng-container>\n </ng-container>\n <ng-template #defaultTooltip>\n <div class=\"callout-content\">\n <div *ngIf=\"hoverData?.tooltip?.date\" class=\"callout-row\">\n {{ hoverData?.tooltip?.date }}\n </div>\n <div\n class=\"callout-row\"\n *ngFor=\"let metric of hoverData?.tooltip?.metrics\"\n >\n <span class=\"series-label\">\n <riv-legend-item\n [colorToken]=\"metric.color\"\n [style]=\"metric.pattern || 'solid'\"\n ></riv-legend-item>\n <span>{{ metric.label }}</span>\n </span>\n <span>{{ metric.value }}</span>\n </div>\n </div>\n </ng-template>\n </riv-callout>\n </ng-container>\n <ng-container *ngIf=\"flowHoverDataGuard(hover) as hoverData\">\n <riv-callout\n *riv-overlay\n [anchor]=\"\n hoverData?.tooltip?.anchor ? hoverData.tooltip.anchor : null\n \"\n [isModal]=\"false\"\n [preferredPosition]=\"'top-center'\"\n [theme]=\"'light'\"\n >\n <div class=\"callout-content\">\n <div class=\"callout-row\">\n <ng-container *ngIf=\"hoverData?.hoverTarget === 'connection'\">\n <ng-container\n *ngIf=\"\n getBucketConfigInfo(hoverData, 'startId') as startConfig\n \"\n >\n <riv-issue\n [label]=\"startConfig.title\"\n [colorToken]=\"startConfig.color\"\n ></riv-issue>\n </ng-container>\n ->\n <ng-container\n *ngIf=\"getBucketConfigInfo(hoverData, 'endId') as endConfig\"\n >\n <riv-issue\n [label]=\"endConfig.title\"\n [colorToken]=\"endConfig.color\"\n ></riv-issue>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"hoverData?.hoverTarget !== 'connection'\">\n <ng-container\n *ngIf=\"getBucketConfigInfo(hoverData, 'barId') as barConfig\"\n >\n <riv-issue\n [label]=\"barConfig.title\"\n [colorToken]=\"barConfig.color\"\n ></riv-issue>\n </ng-container>\n </ng-container>\n </div>\n <div\n *ngIf=\"hoverData?.tooltip?.subtitle\"\n class=\"callout-row flow-subtitle\"\n >\n {{ hoverData?.tooltip?.subtitle }}\n </div>\n </div>\n </riv-callout>\n </ng-container>\n </div>\n <legend *ngIf=\"d.data.type !== 'flow'\">\n <ng-container *ngIf=\"firstHiddenLegendItemIndex$ | async; let fi\">\n <ng-container *ngFor=\"let item of d.data.ys; let i = index\">\n <riv-legend-item\n *ngIf=\"i < fi.dataIndex && item.showLegendItem !== false\"\n [label]=\"item.label\"\n [style]=\"item.pattern || 'solid'\"\n [visibility]=\"item.hidden ? 'hidden' : 'visible'\"\n [clickable]=\"config.allowLegendToggle\"\n [showCheckWhenClickable]=\"item.pattern !== 'dots'\"\n [colorToken]=\"getItemColor(item, i)\"\n (itemClick)=\"toggleLegend(item, i)\"\n ></riv-legend-item>\n </ng-container>\n <ng-container\n *ngFor=\"let item of d.data.supplementaryYs; let i = index\"\n >\n <riv-legend-item\n *ngIf=\"i < fi.suppIndex && item.showLegendItem !== false\"\n [label]=\"item.label\"\n [style]=\"item.pattern || 'solid'\"\n [visibility]=\"item.hidden ? 'hidden' : 'visible'\"\n [clickable]=\"config.allowLegendToggle\"\n [showCheckWhenClickable]=\"item.pattern !== 'dots'\"\n [colorToken]=\"getItemColor(item, i)\"\n (itemClick)=\"toggleLegend(item, i)\"\n ></riv-legend-item>\n </ng-container>\n <div\n #moreTextContainer\n class=\"more-text-container\"\n (mouseover)=\"mouseoverLegend()\"\n (mouseleave)=\"mouseleaveLegend()\"\n (click)=\"moreClick()\"\n *ngIf=\"fi.hiddenCount\"\n >\n <span rivLink class=\"more-text\">\n +\n {{ fi.hiddenCount }} more\n </span>\n </div>\n <ng-container *ngIf=\"showMoreTooltip || lockShowMoreTooltip\">\n <riv-callout\n *riv-overlay\n [anchor]=\"\n $safeNavigationMigration(moreTextContainer?.nativeElement)\n \"\n [isModal]=\"lockShowMoreTooltip\"\n (close)=\"closeHandler()\"\n [preferredPosition]=\"'bottom-right'\"\n [theme]=\"'light'\"\n [showCaret]=\"false\"\n >\n <div class=\"legend-tooltip\">\n <ng-container *ngFor=\"let item of d.data.ys; let i = index\">\n <riv-legend-item\n *ngIf=\"i >= fi.dataIndex && item.showLegendItem !== false\"\n [label]=\"item.label\"\n [style]=\"item.pattern || 'solid'\"\n [visibility]=\"item.hidden ? 'hidden' : 'visible'\"\n [clickable]=\"config.allowLegendToggle\"\n [showCheckWhenClickable]=\"item.pattern !== 'dots'\"\n [colorToken]=\"getItemColor(item, i)\"\n (itemClick)=\"toggleLegend(item, i)\"\n ></riv-legend-item>\n </ng-container>\n <ng-container\n *ngFor=\"let item of d.data.supplementaryYs; let i = index\"\n >\n <riv-legend-item\n *ngIf=\"i >= fi.suppIndex && item.showLegendItem !== false\"\n [label]=\"item.label\"\n [style]=\"item.pattern || 'solid'\"\n [visibility]=\"item.hidden ? 'hidden' : 'visible'\"\n [colorToken]=\"getItemColor(item, i)\"\n [clickable]=\"config.allowLegendToggle\"\n [showCheckWhenClickable]=\"item.pattern !== 'dots'\"\n (itemClick)=\"toggleLegend(item, i)\"\n ></riv-legend-item>\n </ng-container>\n </div>\n </riv-callout>\n </ng-container>\n </ng-container>\n </legend>\n </ng-container>\n</div>\n\n<ng-template #nonDisplayState>\n <ng-container *ngIf=\"checkForNonDisplayState(drawData$ | async); let type\">\n <riv-zero-state\n *ngIf=\"type === 'zeroState'\"\n [message]=\"config.zeroStateMessage\"\n ></riv-zero-state>\n <riv-zero-state\n *ngIf=\"type === 'sizingErrorState'\"\n [message]=\"config.sizingErrorStateMessage\"\n ></riv-zero-state>\n </ng-container>\n</ng-template>\n",
|
|
20673
20777
|
styles: [".container{-webkit-user-select:none;user-select:none;position:relative;display:flex;flex-direction:column;gap:var(--size-xlarge)}.tick-line{stroke:var(--gray-20)}.tick-label{font-size:var(--override-font-size);line-height:var(--type-1-line-height-0);fill:var(--type-light-low-contrast)}.marker{fill:var(--surface-light-0)}.callout-content{pointer-events:none;padding:var(--size-medium) var(--size-xlarge);display:flex;flex-direction:column}.callout-row{white-space:nowrap;display:flex;padding:var(--size-medium) 0;gap:var(--size-medium);align-items:center;font-size:var(--type-1-font-size);line-height:var(--type-1-line-height-0)}.callout-row:not(:last-child){border-bottom:var(--border-width) solid var(--border-light)}.series-label{flex-grow:1;font-weight:var(--font-weight-heavy);display:flex;align-items:center;gap:var(--size-small)}legend{display:flex;flex-wrap:wrap;gap:var(--size-large);justify-content:flex-start;align-items:baseline;width:100%}.more-text-container{width:calc(var(--base-grid-size) * 15);height:var(--size-large)}.more-text{font-size:var(--type-1-font-size);top:calc(var(--base-grid-size) * -1);position:relative}.legend-tooltip{padding:var(--size-medium) var(--size-xlarge);display:flex;flex-direction:column;overflow-y:scroll;max-height:clamp(0px,60vh,600px)}.legend-tooltip>riv-legend-item{white-space:nowrap;display:flex;padding:var(--size-medium) 0;gap:var(--size-medium);align-items:center;line-height:var(--type-1-line-height-0)}.sub-container.clickable{cursor:pointer}.sub-container{display:grid;grid-template-rows:1fr;grid-template-columns:1fr;overflow:auto}.sub-container:not(.donut-container){justify-items:start;align-items:start}.sub-container.donut-container{justify-items:center;align-items:center}svg{grid-row:1 / 1;grid-column:1 / 1}.donut-display{grid-row:1 / 1;grid-column:1 / 1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--size-small)}.donut-label{font-size:var(--type-1-font-size);line-height:var(--type-1-line-height-0);color:var(--type-light-low-contrast)}.donut-value,.donut-label{text-shadow:0 0 var(--size-small) var(--surface-light-0),0 0 var(--size-xsmall) var(--surface-light-0)}.donut-value.xsmall{font:var(--stat-xsmall)}.donut-value.small{font:var(--stat-small)}.donut-value.medium{font:var(--stat-medium)}.donut-value.large{font:var(--stat-large)}.data-label{fill:var(--type-light-high-contrast);font-size:var(--override-font-size)}.flow-data-label{text-decoration:underline;font-size:var(--override-font-size);cursor:pointer;fill:var(--type-light-link-hover)}.waterfall-line{stroke:var(--gray-60)}.flow-subtitle{font-weight:var(--font-weight-heavy)}\n"]
|
|
20674
20778
|
}]
|
|
20675
20779
|
}],
|