@semantic-components/ui 0.38.0 → 0.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/semantic-components-ui.mjs +1236 -368
- package/fesm2022/semantic-components-ui.mjs.map +1 -1
- package/index.d.ts +0 -1
- package/lib/components/calendar/calendar-header.d.ts +6 -2
- package/lib/components/calendar/calendar.d.ts +10 -5
- package/lib/components/calendar/calendar.service.d.ts +7 -0
- package/lib/components/calendar/day-selector.d.ts +3 -1
- package/lib/components/calendar/month-selector.d.ts +4 -1
- package/lib/components/calendar/types.d.ts +1 -0
- package/lib/components/calendar/year-selector.d.ts +9 -2
- package/lib/components/range-calendar/range-calendar.d.ts +2 -2
- package/lib/components/scroll-area/flexible-scroll-area.component.d.ts +33 -0
- package/lib/components/scroll-area/horizontal-scroll-area.component.d.ts +34 -0
- package/lib/components/scroll-area/index.d.ts +3 -0
- package/lib/components/scroll-area/scroll-area.component.d.ts +24 -0
- package/package.json +1 -1
- package/styles/all-styles.css +159 -0
- package/lib/components/tab-group/index.d.ts +0 -4
- package/lib/components/tab-group/tab-content.d.ts +0 -7
- package/lib/components/tab-group/tab-group.d.ts +0 -11
- package/lib/components/tab-group/tab-item.d.ts +0 -5
- package/lib/components/tab-group/tab-label.d.ts +0 -7
- package/styles/styles.css +0 -2
|
@@ -6510,6 +6510,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
|
|
|
6510
6510
|
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
6511
6511
|
}] });
|
|
6512
6512
|
|
|
6513
|
+
class CalendarService {
|
|
6514
|
+
firstYear = signal(0);
|
|
6515
|
+
lastYear = signal(0);
|
|
6516
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: CalendarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6517
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: CalendarService });
|
|
6518
|
+
}
|
|
6519
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: CalendarService, decorators: [{
|
|
6520
|
+
type: Injectable
|
|
6521
|
+
}] });
|
|
6522
|
+
|
|
6513
6523
|
function getFirstDayOfWeek(localeId) {
|
|
6514
6524
|
const locale = new Intl.Locale(localeId);
|
|
6515
6525
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -6558,79 +6568,116 @@ function getMonthName(locale, yearMonth) {
|
|
|
6558
6568
|
}
|
|
6559
6569
|
|
|
6560
6570
|
class ScCalendarHeader {
|
|
6571
|
+
calendarService = inject(CalendarService);
|
|
6561
6572
|
classInput = input('', {
|
|
6562
6573
|
alias: 'class',
|
|
6563
6574
|
});
|
|
6564
|
-
class = computed(() => cn('flex justify-between', this.classInput()));
|
|
6575
|
+
class = computed(() => cn('flex', this.view() === 'months' && 'justify-center', this.view() !== 'months' && 'justify-between', this.classInput()));
|
|
6565
6576
|
currentMonth = input.required();
|
|
6566
|
-
|
|
6577
|
+
view = input.required();
|
|
6578
|
+
firstYear = computed(() => this.calendarService.firstYear());
|
|
6579
|
+
lastYear = computed(() => this.calendarService.lastYear());
|
|
6567
6580
|
monthYearChange = output();
|
|
6568
6581
|
viewToggled = output();
|
|
6569
6582
|
localeId = inject(LOCALE_ID);
|
|
6570
6583
|
monthName = computed(() => getMonthName(this.localeId, this.currentMonth()));
|
|
6571
6584
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ScCalendarHeader, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6572
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6585
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: ScCalendarHeader, isStandalone: true, selector: "sc-calendar-header", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, currentMonth: { classPropertyName: "currentMonth", publicName: "currentMonth", isSignal: true, isRequired: true, transformFunction: null }, view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { monthYearChange: "monthYearChange", viewToggled: "viewToggled" }, host: { properties: { "class": "class()" } }, ngImport: i0, template: `
|
|
6586
|
+
@if (view() !== 'months') {
|
|
6587
|
+
<button
|
|
6588
|
+
(click)="monthYearChange.emit(-1)"
|
|
6589
|
+
aria-label="Previous month"
|
|
6590
|
+
sc-button
|
|
6591
|
+
variant="outline"
|
|
6592
|
+
type="button"
|
|
6593
|
+
size="icon"
|
|
6594
|
+
>
|
|
6595
|
+
<svg si-chevron-left-icon></svg>
|
|
6596
|
+
</button>
|
|
6597
|
+
}
|
|
6584
6598
|
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6599
|
+
@if (view() === 'days') {
|
|
6600
|
+
<button (click)="viewToggled.emit()" sc-button variant="ghost" type="button">
|
|
6601
|
+
{{ monthName() }} {{ currentMonth().year }}
|
|
6602
|
+
<svg si-chevron-down-icon></svg>
|
|
6603
|
+
</button>
|
|
6604
|
+
}
|
|
6588
6605
|
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6606
|
+
@if (view() === 'months') {
|
|
6607
|
+
<div>{{ monthName() }} {{ currentMonth().year }}</div>
|
|
6608
|
+
}
|
|
6609
|
+
|
|
6610
|
+
@if (view() === 'years') {
|
|
6611
|
+
<div class="flex items-center">
|
|
6612
|
+
{{ firstYear() }}
|
|
6613
|
+
<svg class="size-4" si-minus-icon></svg>
|
|
6614
|
+
{{ lastYear() }}
|
|
6615
|
+
</div>
|
|
6616
|
+
}
|
|
6617
|
+
|
|
6618
|
+
@if (view() !== 'months') {
|
|
6619
|
+
<button
|
|
6620
|
+
(click)="monthYearChange.emit(1)"
|
|
6621
|
+
aria-label="Next month"
|
|
6622
|
+
sc-button
|
|
6623
|
+
variant="outline"
|
|
6624
|
+
type="button"
|
|
6625
|
+
size="icon"
|
|
6626
|
+
type="button"
|
|
6627
|
+
>
|
|
6628
|
+
<svg si-chevron-right-icon></svg>
|
|
6629
|
+
</button>
|
|
6630
|
+
}
|
|
6631
|
+
`, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SiChevronRightIcon, selector: "svg[si-chevron-right-icon]", inputs: ["width", "height", "viewBox", "fill", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin"] }, { kind: "component", type: SiChevronLeftIcon, selector: "svg[si-chevron-left-icon]", inputs: ["width", "height", "viewBox", "fill", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin"] }, { kind: "component", type: ScButton, selector: "button[sc-button]" }, { kind: "component", type: SiChevronDownIcon, selector: "svg[si-chevron-down-icon]", inputs: ["width", "height", "viewBox", "fill", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin"] }, { kind: "component", type: SiMinusIcon, selector: "svg[si-minus-icon]", inputs: ["width", "height", "viewBox", "fill", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
6602
6632
|
}
|
|
6603
6633
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ScCalendarHeader, decorators: [{
|
|
6604
6634
|
type: Component,
|
|
6605
|
-
args: [{ selector: 'sc-calendar-header', imports: [SiChevronRightIcon, SiChevronLeftIcon, ScButton], template: `
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6635
|
+
args: [{ selector: 'sc-calendar-header', imports: [SiChevronRightIcon, SiChevronLeftIcon, ScButton, SiChevronDownIcon, SiMinusIcon], template: `
|
|
6636
|
+
@if (view() !== 'months') {
|
|
6637
|
+
<button
|
|
6638
|
+
(click)="monthYearChange.emit(-1)"
|
|
6639
|
+
aria-label="Previous month"
|
|
6640
|
+
sc-button
|
|
6641
|
+
variant="outline"
|
|
6642
|
+
type="button"
|
|
6643
|
+
size="icon"
|
|
6644
|
+
>
|
|
6645
|
+
<svg si-chevron-left-icon></svg>
|
|
6646
|
+
</button>
|
|
6647
|
+
}
|
|
6617
6648
|
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
|
|
6649
|
+
@if (view() === 'days') {
|
|
6650
|
+
<button (click)="viewToggled.emit()" sc-button variant="ghost" type="button">
|
|
6651
|
+
{{ monthName() }} {{ currentMonth().year }}
|
|
6652
|
+
<svg si-chevron-down-icon></svg>
|
|
6653
|
+
</button>
|
|
6654
|
+
}
|
|
6621
6655
|
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6656
|
+
@if (view() === 'months') {
|
|
6657
|
+
<div>{{ monthName() }} {{ currentMonth().year }}</div>
|
|
6658
|
+
}
|
|
6659
|
+
|
|
6660
|
+
@if (view() === 'years') {
|
|
6661
|
+
<div class="flex items-center">
|
|
6662
|
+
{{ firstYear() }}
|
|
6663
|
+
<svg class="size-4" si-minus-icon></svg>
|
|
6664
|
+
{{ lastYear() }}
|
|
6665
|
+
</div>
|
|
6666
|
+
}
|
|
6667
|
+
|
|
6668
|
+
@if (view() !== 'months') {
|
|
6669
|
+
<button
|
|
6670
|
+
(click)="monthYearChange.emit(1)"
|
|
6671
|
+
aria-label="Next month"
|
|
6672
|
+
sc-button
|
|
6673
|
+
variant="outline"
|
|
6674
|
+
type="button"
|
|
6675
|
+
size="icon"
|
|
6676
|
+
type="button"
|
|
6677
|
+
>
|
|
6678
|
+
<svg si-chevron-right-icon></svg>
|
|
6679
|
+
</button>
|
|
6680
|
+
}
|
|
6634
6681
|
`, host: {
|
|
6635
6682
|
'[class]': 'class()',
|
|
6636
6683
|
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
@@ -6738,6 +6785,10 @@ class ScDaySelector {
|
|
|
6738
6785
|
dateSelected = output();
|
|
6739
6786
|
selectedDate = input();
|
|
6740
6787
|
focusedDate = input();
|
|
6788
|
+
classInput = input('', {
|
|
6789
|
+
alias: 'class',
|
|
6790
|
+
});
|
|
6791
|
+
class = computed(() => cn('grid grid-cols-7 gap-px', this.classInput()));
|
|
6741
6792
|
getVariant(day) {
|
|
6742
6793
|
if (this.isSelected(day.date)) {
|
|
6743
6794
|
return 'primary';
|
|
@@ -6760,54 +6811,56 @@ class ScDaySelector {
|
|
|
6760
6811
|
return this.focusedDate() ? date.equals(this.focusedDate()) : false;
|
|
6761
6812
|
}
|
|
6762
6813
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ScDaySelector, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6763
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: ScDaySelector, isStandalone: true, selector: "sc-day-selector", inputs: { calendarDays: { classPropertyName: "calendarDays", publicName: "calendarDays", isSignal: true, isRequired: true, transformFunction: null }, weekdays: { classPropertyName: "weekdays", publicName: "weekdays", isSignal: true, isRequired: true, transformFunction: null }, selectedDate: { classPropertyName: "selectedDate", publicName: "selectedDate", isSignal: true, isRequired: false, transformFunction: null }, focusedDate: { classPropertyName: "focusedDate", publicName: "focusedDate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dateSelected: "dateSelected" }, ngImport: i0, template: `
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
}
|
|
6814
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: ScDaySelector, isStandalone: true, selector: "sc-day-selector", inputs: { calendarDays: { classPropertyName: "calendarDays", publicName: "calendarDays", isSignal: true, isRequired: true, transformFunction: null }, weekdays: { classPropertyName: "weekdays", publicName: "weekdays", isSignal: true, isRequired: true, transformFunction: null }, selectedDate: { classPropertyName: "selectedDate", publicName: "selectedDate", isSignal: true, isRequired: false, transformFunction: null }, focusedDate: { classPropertyName: "focusedDate", publicName: "focusedDate", isSignal: true, isRequired: false, transformFunction: null }, classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dateSelected: "dateSelected" }, host: { properties: { "class": "class()" } }, ngImport: i0, template: `
|
|
6815
|
+
@for (weekday of weekdays(); track weekday) {
|
|
6816
|
+
<abbr class="size-10 text-center text-muted-foreground">
|
|
6817
|
+
{{ weekday }}
|
|
6818
|
+
</abbr>
|
|
6819
|
+
}
|
|
6770
6820
|
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
6778
|
-
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
</div>
|
|
6821
|
+
@for (day of calendarDays(); track day.date) {
|
|
6822
|
+
<button
|
|
6823
|
+
[variant]="getVariant(day)"
|
|
6824
|
+
[isFocused]="isFocused(day.date)"
|
|
6825
|
+
(click)="selectDay(day); $event.stopPropagation()"
|
|
6826
|
+
sc-day-button
|
|
6827
|
+
size="icon"
|
|
6828
|
+
>
|
|
6829
|
+
{{ day.dayOfMonth }}
|
|
6830
|
+
</button>
|
|
6831
|
+
}
|
|
6783
6832
|
`, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScDayButton, selector: "button[sc-day-button]", inputs: ["isFocused"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
6784
6833
|
}
|
|
6785
6834
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ScDaySelector, decorators: [{
|
|
6786
6835
|
type: Component,
|
|
6787
6836
|
args: [{ selector: 'sc-day-selector', imports: [ScDayButton], template: `
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
}
|
|
6837
|
+
@for (weekday of weekdays(); track weekday) {
|
|
6838
|
+
<abbr class="size-10 text-center text-muted-foreground">
|
|
6839
|
+
{{ weekday }}
|
|
6840
|
+
</abbr>
|
|
6841
|
+
}
|
|
6794
6842
|
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
|
|
6799
|
-
|
|
6800
|
-
|
|
6801
|
-
|
|
6802
|
-
|
|
6803
|
-
|
|
6804
|
-
|
|
6805
|
-
|
|
6806
|
-
|
|
6807
|
-
|
|
6843
|
+
@for (day of calendarDays(); track day.date) {
|
|
6844
|
+
<button
|
|
6845
|
+
[variant]="getVariant(day)"
|
|
6846
|
+
[isFocused]="isFocused(day.date)"
|
|
6847
|
+
(click)="selectDay(day); $event.stopPropagation()"
|
|
6848
|
+
sc-day-button
|
|
6849
|
+
size="icon"
|
|
6850
|
+
>
|
|
6851
|
+
{{ day.dayOfMonth }}
|
|
6852
|
+
</button>
|
|
6853
|
+
}
|
|
6854
|
+
`, host: {
|
|
6855
|
+
'[class]': 'class()',
|
|
6856
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
6808
6857
|
}] });
|
|
6809
6858
|
|
|
6810
6859
|
class ScMonthSelector {
|
|
6860
|
+
classInput = input('', {
|
|
6861
|
+
alias: 'class',
|
|
6862
|
+
});
|
|
6863
|
+
class = computed(() => cn('grid grid-cols-3 gap-1 w-full', this.classInput()));
|
|
6811
6864
|
currentMonth = input.required();
|
|
6812
6865
|
months = [];
|
|
6813
6866
|
localeId = inject(LOCALE_ID);
|
|
@@ -6818,49 +6871,60 @@ class ScMonthSelector {
|
|
|
6818
6871
|
selectMonth(monthIndex) {
|
|
6819
6872
|
this.monthSelected.emit(Temporal.PlainYearMonth.from({ year: this.currentMonth().year, month: monthIndex + 1 }));
|
|
6820
6873
|
}
|
|
6874
|
+
getVariant(i) {
|
|
6875
|
+
if (i === this.currentMonth().month - 1) {
|
|
6876
|
+
return 'primary';
|
|
6877
|
+
}
|
|
6878
|
+
// if (this.isFocused(day.date)) {
|
|
6879
|
+
// return 'secondary';
|
|
6880
|
+
// }
|
|
6881
|
+
// if (isToday(day.date)) {
|
|
6882
|
+
// return 'outline';
|
|
6883
|
+
// }
|
|
6884
|
+
return 'ghost';
|
|
6885
|
+
}
|
|
6821
6886
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ScMonthSelector, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6822
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: ScMonthSelector, isStandalone: true, selector: "sc-month-selector", inputs: { currentMonth: { classPropertyName: "currentMonth", publicName: "currentMonth", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { monthSelected: "monthSelected" }, ngImport: i0, template: `
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
}
|
|
6834
|
-
</div>
|
|
6835
|
-
`, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
6887
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: ScMonthSelector, isStandalone: true, selector: "sc-month-selector", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, currentMonth: { classPropertyName: "currentMonth", publicName: "currentMonth", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { monthSelected: "monthSelected" }, host: { properties: { "class": "class()" } }, ngImport: i0, template: `
|
|
6888
|
+
@for (month of months; track $index; let i = $index) {
|
|
6889
|
+
<button
|
|
6890
|
+
[variant]="getVariant(i)"
|
|
6891
|
+
(click)="selectMonth(i); $event.stopPropagation()"
|
|
6892
|
+
sc-button
|
|
6893
|
+
>
|
|
6894
|
+
{{ month }}
|
|
6895
|
+
</button>
|
|
6896
|
+
}
|
|
6897
|
+
`, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScButton, selector: "button[sc-button]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
6836
6898
|
}
|
|
6837
6899
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ScMonthSelector, decorators: [{
|
|
6838
6900
|
type: Component,
|
|
6839
|
-
args: [{ selector: 'sc-month-selector', imports: [], template: `
|
|
6840
|
-
|
|
6841
|
-
|
|
6842
|
-
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
|
|
6846
|
-
|
|
6847
|
-
|
|
6848
|
-
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
6901
|
+
args: [{ selector: 'sc-month-selector', imports: [ScButton], template: `
|
|
6902
|
+
@for (month of months; track $index; let i = $index) {
|
|
6903
|
+
<button
|
|
6904
|
+
[variant]="getVariant(i)"
|
|
6905
|
+
(click)="selectMonth(i); $event.stopPropagation()"
|
|
6906
|
+
sc-button
|
|
6907
|
+
>
|
|
6908
|
+
{{ month }}
|
|
6909
|
+
</button>
|
|
6910
|
+
}
|
|
6911
|
+
`, host: {
|
|
6912
|
+
'[class]': 'class()',
|
|
6913
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
6853
6914
|
}], ctorParameters: () => [] });
|
|
6854
6915
|
|
|
6855
6916
|
class ScYearSelector {
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
return this.currentYear();
|
|
6917
|
+
classInput = input('', {
|
|
6918
|
+
alias: 'class',
|
|
6859
6919
|
});
|
|
6920
|
+
class = computed(() => cn('grid grid-cols-4 gap-1 w-full', this.classInput()));
|
|
6921
|
+
currentYear = input.required();
|
|
6922
|
+
previewYear = input.required();
|
|
6923
|
+
firstYear = computed(() => this.calendarService.firstYear());
|
|
6924
|
+
lastYear = computed(() => this.calendarService.lastYear());
|
|
6860
6925
|
years = computed(() => {
|
|
6861
6926
|
const years = [];
|
|
6862
|
-
|
|
6863
|
-
for (let year = this.year() - 9; year <= this.year() + 10; year++) {
|
|
6927
|
+
for (let year = this.firstYear(); year <= this.lastYear(); year++) {
|
|
6864
6928
|
years.push(year);
|
|
6865
6929
|
}
|
|
6866
6930
|
return years;
|
|
@@ -6869,50 +6933,65 @@ class ScYearSelector {
|
|
|
6869
6933
|
selectYear(year) {
|
|
6870
6934
|
this.yearSelected.emit(year);
|
|
6871
6935
|
}
|
|
6936
|
+
calendarService = inject(CalendarService);
|
|
6937
|
+
constructor() {
|
|
6938
|
+
effect(() => {
|
|
6939
|
+
this.calendarService.firstYear.set(this.previewYear() - 9);
|
|
6940
|
+
this.calendarService.lastYear.set(this.previewYear() + 10);
|
|
6941
|
+
});
|
|
6942
|
+
}
|
|
6943
|
+
getVariant(y) {
|
|
6944
|
+
if (y === this.currentYear()) {
|
|
6945
|
+
return 'primary';
|
|
6946
|
+
}
|
|
6947
|
+
// if (this.isFocused(day.date)) {
|
|
6948
|
+
// return 'secondary';
|
|
6949
|
+
// }
|
|
6950
|
+
// if (isToday(day.date)) {
|
|
6951
|
+
// return 'outline';
|
|
6952
|
+
// }
|
|
6953
|
+
return 'ghost';
|
|
6954
|
+
}
|
|
6872
6955
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ScYearSelector, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6873
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: ScYearSelector, isStandalone: true, selector: "sc-year-selector", inputs: { currentYear: { classPropertyName: "currentYear", publicName: "currentYear", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { yearSelected: "yearSelected" }, ngImport: i0, template: `
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
}
|
|
6885
|
-
</div>
|
|
6886
|
-
`, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
6956
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: ScYearSelector, isStandalone: true, selector: "sc-year-selector", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, currentYear: { classPropertyName: "currentYear", publicName: "currentYear", isSignal: true, isRequired: true, transformFunction: null }, previewYear: { classPropertyName: "previewYear", publicName: "previewYear", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { yearSelected: "yearSelected" }, host: { properties: { "class": "class()" } }, ngImport: i0, template: `
|
|
6957
|
+
@for (year of years(); track $index) {
|
|
6958
|
+
<button
|
|
6959
|
+
[variant]="getVariant(year)"
|
|
6960
|
+
(click)="selectYear(year); $event.stopPropagation()"
|
|
6961
|
+
sc-button
|
|
6962
|
+
>
|
|
6963
|
+
{{ year }}
|
|
6964
|
+
</button>
|
|
6965
|
+
}
|
|
6966
|
+
`, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScButton, selector: "button[sc-button]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
6887
6967
|
}
|
|
6888
6968
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ScYearSelector, decorators: [{
|
|
6889
6969
|
type: Component,
|
|
6890
|
-
args: [{ selector: 'sc-year-selector', imports: [], template: `
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
|
|
6899
|
-
|
|
6900
|
-
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
|
|
6904
|
-
}] });
|
|
6970
|
+
args: [{ selector: 'sc-year-selector', imports: [ScButton], template: `
|
|
6971
|
+
@for (year of years(); track $index) {
|
|
6972
|
+
<button
|
|
6973
|
+
[variant]="getVariant(year)"
|
|
6974
|
+
(click)="selectYear(year); $event.stopPropagation()"
|
|
6975
|
+
sc-button
|
|
6976
|
+
>
|
|
6977
|
+
{{ year }}
|
|
6978
|
+
</button>
|
|
6979
|
+
}
|
|
6980
|
+
`, host: {
|
|
6981
|
+
'[class]': 'class()',
|
|
6982
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
6983
|
+
}], ctorParameters: () => [] });
|
|
6905
6984
|
|
|
6906
6985
|
class ScCalendar {
|
|
6907
6986
|
value = model();
|
|
6908
|
-
|
|
6909
|
-
|
|
6987
|
+
min = input();
|
|
6988
|
+
max = input();
|
|
6910
6989
|
classInput = input('', {
|
|
6911
6990
|
alias: 'class',
|
|
6912
6991
|
});
|
|
6913
|
-
class = computed(() => cn('', this.classInput()));
|
|
6992
|
+
class = computed(() => cn('block w-84', this.classInput()));
|
|
6914
6993
|
today = signal(Temporal.Now.plainDateISO());
|
|
6915
|
-
|
|
6994
|
+
date = computed(() => {
|
|
6916
6995
|
if (this.value()) {
|
|
6917
6996
|
return this.value();
|
|
6918
6997
|
}
|
|
@@ -6920,21 +6999,22 @@ class ScCalendar {
|
|
|
6920
6999
|
return this.today();
|
|
6921
7000
|
}
|
|
6922
7001
|
});
|
|
6923
|
-
|
|
6924
|
-
|
|
6925
|
-
|
|
6926
|
-
|
|
6927
|
-
|
|
6928
|
-
return this.today().year;
|
|
7002
|
+
//if date is in the current month else focus first date of the current month
|
|
7003
|
+
focusedDate = linkedSignal(() => {
|
|
7004
|
+
if (this.date()?.year === this.currentMonth().year &&
|
|
7005
|
+
this.date()?.month === this.currentMonth().month) {
|
|
7006
|
+
return this.date();
|
|
6929
7007
|
}
|
|
7008
|
+
return new Temporal.PlainDate(this.currentMonth().year, this.currentMonth().month, 1);
|
|
7009
|
+
});
|
|
7010
|
+
currentYear = linkedSignal(() => {
|
|
7011
|
+
return this.date().year;
|
|
7012
|
+
});
|
|
7013
|
+
previewYear = linkedSignal(() => {
|
|
7014
|
+
return this.currentYear();
|
|
6930
7015
|
});
|
|
6931
7016
|
currentMonth = linkedSignal(() => {
|
|
6932
|
-
|
|
6933
|
-
return this.value().toPlainYearMonth();
|
|
6934
|
-
}
|
|
6935
|
-
else {
|
|
6936
|
-
return this.today().toPlainYearMonth();
|
|
6937
|
-
}
|
|
7017
|
+
return this.date().toPlainYearMonth();
|
|
6938
7018
|
});
|
|
6939
7019
|
firstDayOfMonth = computed(() => this.currentMonth().toPlainDate({
|
|
6940
7020
|
day: 1,
|
|
@@ -6950,10 +7030,10 @@ class ScCalendar {
|
|
|
6950
7030
|
return date.equals(today);
|
|
6951
7031
|
}
|
|
6952
7032
|
isDateDisabled(date) {
|
|
6953
|
-
if (this.
|
|
7033
|
+
if (this.min() && Temporal.PlainDate.compare(date, this.min()) < 0) {
|
|
6954
7034
|
return true;
|
|
6955
7035
|
}
|
|
6956
|
-
if (this.
|
|
7036
|
+
if (this.max() && Temporal.PlainDate.compare(date, this.max()) > 0) {
|
|
6957
7037
|
return true;
|
|
6958
7038
|
}
|
|
6959
7039
|
return false;
|
|
@@ -6986,6 +7066,23 @@ class ScCalendar {
|
|
|
6986
7066
|
this.focusedDate.set(newDate);
|
|
6987
7067
|
}
|
|
6988
7068
|
handleKeydown(event) {
|
|
7069
|
+
if (this.view() === 'days') {
|
|
7070
|
+
this.handleKeydown1(event);
|
|
7071
|
+
}
|
|
7072
|
+
if (this.view() === 'years') {
|
|
7073
|
+
this.handleKeydown2(event);
|
|
7074
|
+
}
|
|
7075
|
+
if (this.view() === 'months') {
|
|
7076
|
+
this.handleKeydown3(event);
|
|
7077
|
+
}
|
|
7078
|
+
}
|
|
7079
|
+
handleKeydown2(event) {
|
|
7080
|
+
console.log(event);
|
|
7081
|
+
}
|
|
7082
|
+
handleKeydown3(event) {
|
|
7083
|
+
console.log(event);
|
|
7084
|
+
}
|
|
7085
|
+
handleKeydown1(event) {
|
|
6989
7086
|
switch (event.key) {
|
|
6990
7087
|
case 'ArrowLeft':
|
|
6991
7088
|
this.moveFocus(-1);
|
|
@@ -7057,10 +7154,9 @@ class ScCalendar {
|
|
|
7057
7154
|
}
|
|
7058
7155
|
}
|
|
7059
7156
|
weekdays = getLocalizedDayNames(this.localeId);
|
|
7060
|
-
scYearSelector = viewChild(ScYearSelector);
|
|
7061
7157
|
setMonthYear(n) {
|
|
7062
7158
|
if (this.view() === 'years') {
|
|
7063
|
-
this.
|
|
7159
|
+
this.previewYear.update((value) => value + n * 20);
|
|
7064
7160
|
}
|
|
7065
7161
|
if (this.view() === 'days') {
|
|
7066
7162
|
if (n === 1) {
|
|
@@ -7074,7 +7170,6 @@ class ScCalendar {
|
|
|
7074
7170
|
selectYear(year) {
|
|
7075
7171
|
this.currentYear.set(year);
|
|
7076
7172
|
this.currentMonth.update((month) => Temporal.PlainYearMonth.from({ year: year, month: month.month }));
|
|
7077
|
-
this.value.set(undefined);
|
|
7078
7173
|
this.toggleView();
|
|
7079
7174
|
}
|
|
7080
7175
|
selectMonth(month) {
|
|
@@ -7104,18 +7199,19 @@ class ScCalendar {
|
|
|
7104
7199
|
this.disabled.set(isDisabled);
|
|
7105
7200
|
}
|
|
7106
7201
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ScCalendar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7107
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: ScCalendar, isStandalone: true, selector: "sc-calendar", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null },
|
|
7202
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: ScCalendar, isStandalone: true, selector: "sc-calendar", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { listeners: { "keydown": "handleKeydown($event)" }, properties: { "class": "class()" } }, providers: [
|
|
7108
7203
|
{
|
|
7109
7204
|
provide: NG_VALUE_ACCESSOR,
|
|
7110
7205
|
useExisting: forwardRef(() => ScCalendar),
|
|
7111
7206
|
multi: true,
|
|
7112
7207
|
},
|
|
7113
|
-
|
|
7208
|
+
CalendarService,
|
|
7209
|
+
], ngImport: i0, template: `
|
|
7114
7210
|
<div sc-card>
|
|
7115
7211
|
<div sc-card-header>
|
|
7116
7212
|
<sc-calendar-header
|
|
7117
7213
|
[currentMonth]="currentMonth()"
|
|
7118
|
-
[
|
|
7214
|
+
[view]="view()"
|
|
7119
7215
|
(monthYearChange)="setMonthYear($event)"
|
|
7120
7216
|
(viewToggled)="toggleView()"
|
|
7121
7217
|
/>
|
|
@@ -7123,7 +7219,11 @@ class ScCalendar {
|
|
|
7123
7219
|
<div sc-card-content>
|
|
7124
7220
|
@switch (view()) {
|
|
7125
7221
|
@case ('years') {
|
|
7126
|
-
<sc-year-selector
|
|
7222
|
+
<sc-year-selector
|
|
7223
|
+
[currentYear]="currentYear()"
|
|
7224
|
+
[previewYear]="previewYear()"
|
|
7225
|
+
(yearSelected)="selectYear($event)"
|
|
7226
|
+
/>
|
|
7127
7227
|
}
|
|
7128
7228
|
@case ('months') {
|
|
7129
7229
|
<sc-month-selector
|
|
@@ -7143,7 +7243,7 @@ class ScCalendar {
|
|
|
7143
7243
|
}
|
|
7144
7244
|
</div>
|
|
7145
7245
|
</div>
|
|
7146
|
-
`, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScYearSelector, selector: "sc-year-selector", inputs: ["currentYear"], outputs: ["yearSelected"] }, { kind: "component", type: ScMonthSelector, selector: "sc-month-selector", inputs: ["currentMonth"], outputs: ["monthSelected"] }, { kind: "component", type: ScDaySelector, selector: "sc-day-selector", inputs: ["calendarDays", "weekdays", "selectedDate", "focusedDate"], outputs: ["dateSelected"] }, { kind: "component", type: ScCard, selector: "div[sc-card]", inputs: ["class"] }, { kind: "component", type: ScCardHeader, selector: "div[sc-card-header]", inputs: ["class"] }, { kind: "component", type: ScCardContent, selector: "div[sc-card-content]", inputs: ["class"] }, { kind: "component", type: ScCalendarHeader, selector: "sc-calendar-header", inputs: ["class", "currentMonth", "
|
|
7246
|
+
`, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScYearSelector, selector: "sc-year-selector", inputs: ["class", "currentYear", "previewYear"], outputs: ["yearSelected"] }, { kind: "component", type: ScMonthSelector, selector: "sc-month-selector", inputs: ["class", "currentMonth"], outputs: ["monthSelected"] }, { kind: "component", type: ScDaySelector, selector: "sc-day-selector", inputs: ["calendarDays", "weekdays", "selectedDate", "focusedDate", "class"], outputs: ["dateSelected"] }, { kind: "component", type: ScCard, selector: "div[sc-card]", inputs: ["class"] }, { kind: "component", type: ScCardHeader, selector: "div[sc-card-header]", inputs: ["class"] }, { kind: "component", type: ScCardContent, selector: "div[sc-card-content]", inputs: ["class"] }, { kind: "component", type: ScCalendarHeader, selector: "sc-calendar-header", inputs: ["class", "currentMonth", "view"], outputs: ["monthYearChange", "viewToggled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
7147
7247
|
}
|
|
7148
7248
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ScCalendar, decorators: [{
|
|
7149
7249
|
type: Component,
|
|
@@ -7160,7 +7260,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
|
|
|
7160
7260
|
<div sc-card-header>
|
|
7161
7261
|
<sc-calendar-header
|
|
7162
7262
|
[currentMonth]="currentMonth()"
|
|
7163
|
-
[
|
|
7263
|
+
[view]="view()"
|
|
7164
7264
|
(monthYearChange)="setMonthYear($event)"
|
|
7165
7265
|
(viewToggled)="toggleView()"
|
|
7166
7266
|
/>
|
|
@@ -7168,7 +7268,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
|
|
|
7168
7268
|
<div sc-card-content>
|
|
7169
7269
|
@switch (view()) {
|
|
7170
7270
|
@case ('years') {
|
|
7171
|
-
<sc-year-selector
|
|
7271
|
+
<sc-year-selector
|
|
7272
|
+
[currentYear]="currentYear()"
|
|
7273
|
+
[previewYear]="previewYear()"
|
|
7274
|
+
(yearSelected)="selectYear($event)"
|
|
7275
|
+
/>
|
|
7172
7276
|
}
|
|
7173
7277
|
@case ('months') {
|
|
7174
7278
|
<sc-month-selector
|
|
@@ -7197,6 +7301,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
|
|
|
7197
7301
|
useExisting: forwardRef(() => ScCalendar),
|
|
7198
7302
|
multi: true,
|
|
7199
7303
|
},
|
|
7304
|
+
CalendarService,
|
|
7200
7305
|
] }]
|
|
7201
7306
|
}] });
|
|
7202
7307
|
|
|
@@ -7323,6 +7428,9 @@ class ScRangeCalendar {
|
|
|
7323
7428
|
return this.today().year;
|
|
7324
7429
|
}
|
|
7325
7430
|
});
|
|
7431
|
+
previewYear = linkedSignal(() => {
|
|
7432
|
+
return this.currentYear();
|
|
7433
|
+
});
|
|
7326
7434
|
currentMonth = linkedSignal(() => {
|
|
7327
7435
|
if (this.value()) {
|
|
7328
7436
|
return this.value().start.toPlainYearMonth();
|
|
@@ -7461,10 +7569,9 @@ class ScRangeCalendar {
|
|
|
7461
7569
|
}
|
|
7462
7570
|
}
|
|
7463
7571
|
weekdays = getLocalizedDayNames(this.localeId);
|
|
7464
|
-
scYearSelector = viewChild(ScYearSelector);
|
|
7465
7572
|
setMonthYear(n) {
|
|
7466
7573
|
if (this.view() === 'years') {
|
|
7467
|
-
this.
|
|
7574
|
+
this.previewYear.update((value) => value + n * 20);
|
|
7468
7575
|
}
|
|
7469
7576
|
if (this.view() === 'days') {
|
|
7470
7577
|
if (n === 1) {
|
|
@@ -7514,12 +7621,12 @@ class ScRangeCalendar {
|
|
|
7514
7621
|
useExisting: forwardRef(() => ScRangeCalendar),
|
|
7515
7622
|
multi: true,
|
|
7516
7623
|
},
|
|
7517
|
-
],
|
|
7624
|
+
], ngImport: i0, template: `
|
|
7518
7625
|
<div sc-card>
|
|
7519
7626
|
<div sc-card-header>
|
|
7520
7627
|
<sc-calendar-header
|
|
7521
7628
|
[currentMonth]="currentMonth()"
|
|
7522
|
-
[
|
|
7629
|
+
[view]="view()"
|
|
7523
7630
|
(monthYearChange)="setMonthYear($event)"
|
|
7524
7631
|
(viewToggled)="toggleView()"
|
|
7525
7632
|
/>
|
|
@@ -7527,7 +7634,11 @@ class ScRangeCalendar {
|
|
|
7527
7634
|
<div sc-card-content>
|
|
7528
7635
|
@switch (view()) {
|
|
7529
7636
|
@case ('years') {
|
|
7530
|
-
<sc-year-selector
|
|
7637
|
+
<sc-year-selector
|
|
7638
|
+
[currentYear]="currentYear()"
|
|
7639
|
+
[previewYear]="previewYear()"
|
|
7640
|
+
(yearSelected)="selectYear($event)"
|
|
7641
|
+
/>
|
|
7531
7642
|
}
|
|
7532
7643
|
@case ('months') {
|
|
7533
7644
|
<sc-month-selector
|
|
@@ -7546,7 +7657,7 @@ class ScRangeCalendar {
|
|
|
7546
7657
|
}
|
|
7547
7658
|
</div>
|
|
7548
7659
|
</div>
|
|
7549
|
-
`, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScYearSelector, selector: "sc-year-selector", inputs: ["currentYear"], outputs: ["yearSelected"] }, { kind: "component", type: ScMonthSelector, selector: "sc-month-selector", inputs: ["currentMonth"], outputs: ["monthSelected"] }, { kind: "component", type: ScDaysSelector, selector: "sc-days-selector", inputs: ["calendarDays", "weekdays", "selectedRange", "focusedDate"], outputs: ["rangeSelected"] }, { kind: "component", type: ScCard, selector: "div[sc-card]", inputs: ["class"] }, { kind: "component", type: ScCardHeader, selector: "div[sc-card-header]", inputs: ["class"] }, { kind: "component", type: ScCardContent, selector: "div[sc-card-content]", inputs: ["class"] }, { kind: "component", type: ScCalendarHeader, selector: "sc-calendar-header", inputs: ["class", "currentMonth", "
|
|
7660
|
+
`, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScYearSelector, selector: "sc-year-selector", inputs: ["class", "currentYear", "previewYear"], outputs: ["yearSelected"] }, { kind: "component", type: ScMonthSelector, selector: "sc-month-selector", inputs: ["class", "currentMonth"], outputs: ["monthSelected"] }, { kind: "component", type: ScDaysSelector, selector: "sc-days-selector", inputs: ["calendarDays", "weekdays", "selectedRange", "focusedDate"], outputs: ["rangeSelected"] }, { kind: "component", type: ScCard, selector: "div[sc-card]", inputs: ["class"] }, { kind: "component", type: ScCardHeader, selector: "div[sc-card-header]", inputs: ["class"] }, { kind: "component", type: ScCardContent, selector: "div[sc-card-content]", inputs: ["class"] }, { kind: "component", type: ScCalendarHeader, selector: "sc-calendar-header", inputs: ["class", "currentMonth", "view"], outputs: ["monthYearChange", "viewToggled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
7550
7661
|
}
|
|
7551
7662
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ScRangeCalendar, decorators: [{
|
|
7552
7663
|
type: Component,
|
|
@@ -7563,7 +7674,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
|
|
|
7563
7674
|
<div sc-card-header>
|
|
7564
7675
|
<sc-calendar-header
|
|
7565
7676
|
[currentMonth]="currentMonth()"
|
|
7566
|
-
[
|
|
7677
|
+
[view]="view()"
|
|
7567
7678
|
(monthYearChange)="setMonthYear($event)"
|
|
7568
7679
|
(viewToggled)="toggleView()"
|
|
7569
7680
|
/>
|
|
@@ -7571,7 +7682,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
|
|
|
7571
7682
|
<div sc-card-content>
|
|
7572
7683
|
@switch (view()) {
|
|
7573
7684
|
@case ('years') {
|
|
7574
|
-
<sc-year-selector
|
|
7685
|
+
<sc-year-selector
|
|
7686
|
+
[currentYear]="currentYear()"
|
|
7687
|
+
[previewYear]="previewYear()"
|
|
7688
|
+
(yearSelected)="selectYear($event)"
|
|
7689
|
+
/>
|
|
7575
7690
|
}
|
|
7576
7691
|
@case ('months') {
|
|
7577
7692
|
<sc-month-selector
|
|
@@ -11837,24 +11952,934 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
|
|
|
11837
11952
|
args: ['contentContainer']
|
|
11838
11953
|
}] } });
|
|
11839
11954
|
|
|
11840
|
-
|
|
11841
|
-
|
|
11842
|
-
|
|
11843
|
-
|
|
11844
|
-
|
|
11845
|
-
|
|
11846
|
-
|
|
11847
|
-
|
|
11848
|
-
|
|
11849
|
-
|
|
11850
|
-
|
|
11851
|
-
|
|
11852
|
-
|
|
11955
|
+
// scroll-area.component.ts
|
|
11956
|
+
class ScrollAreaComponent {
|
|
11957
|
+
viewportRef;
|
|
11958
|
+
thumbRef;
|
|
11959
|
+
isScrolling = false;
|
|
11960
|
+
isHovering = false;
|
|
11961
|
+
isDragging = false;
|
|
11962
|
+
scrollTimeout;
|
|
11963
|
+
thumbHeight = 20;
|
|
11964
|
+
thumbTop = 0;
|
|
11965
|
+
startY = 0;
|
|
11966
|
+
startScrollTop = 0;
|
|
11967
|
+
constructor() {
|
|
11968
|
+
// Add document-level event listeners for drag operations
|
|
11969
|
+
document.addEventListener('mousemove', this.onMouseMove.bind(this));
|
|
11970
|
+
document.addEventListener('mouseup', this.onMouseUp.bind(this));
|
|
11853
11971
|
}
|
|
11854
|
-
|
|
11855
|
-
|
|
11856
|
-
|
|
11857
|
-
|
|
11972
|
+
ngOnDestroy() {
|
|
11973
|
+
// Clean up event listeners
|
|
11974
|
+
document.removeEventListener('mousemove', this.onMouseMove.bind(this));
|
|
11975
|
+
document.removeEventListener('mouseup', this.onMouseUp.bind(this));
|
|
11976
|
+
}
|
|
11977
|
+
ngAfterViewInit() {
|
|
11978
|
+
this.updateThumb();
|
|
11979
|
+
}
|
|
11980
|
+
onScroll() {
|
|
11981
|
+
this.updateThumb();
|
|
11982
|
+
this.isScrolling = true;
|
|
11983
|
+
clearTimeout(this.scrollTimeout);
|
|
11984
|
+
this.scrollTimeout = setTimeout(() => {
|
|
11985
|
+
this.isScrolling = false;
|
|
11986
|
+
}, 300);
|
|
11987
|
+
}
|
|
11988
|
+
updateThumb() {
|
|
11989
|
+
const viewport = this.viewportRef.nativeElement;
|
|
11990
|
+
const scrollHeight = viewport.scrollHeight;
|
|
11991
|
+
const clientHeight = viewport.clientHeight;
|
|
11992
|
+
// Calculate thumb height as percentage of visible area
|
|
11993
|
+
this.thumbHeight = (clientHeight / scrollHeight) * 100;
|
|
11994
|
+
// Calculate thumb position
|
|
11995
|
+
this.thumbTop = (viewport.scrollTop / (scrollHeight - clientHeight)) * (100 - this.thumbHeight);
|
|
11996
|
+
}
|
|
11997
|
+
startDragging(event) {
|
|
11998
|
+
this.isDragging = true;
|
|
11999
|
+
this.startY = event.clientY;
|
|
12000
|
+
this.startScrollTop = this.viewportRef.nativeElement.scrollTop;
|
|
12001
|
+
event.preventDefault();
|
|
12002
|
+
}
|
|
12003
|
+
onMouseMove(event) {
|
|
12004
|
+
if (!this.isDragging)
|
|
12005
|
+
return;
|
|
12006
|
+
const viewport = this.viewportRef.nativeElement;
|
|
12007
|
+
const deltaY = event.clientY - this.startY;
|
|
12008
|
+
const scrollbarHeight = viewport.clientHeight;
|
|
12009
|
+
const scrollContentHeight = viewport.scrollHeight;
|
|
12010
|
+
// Calculate the scroll ratio
|
|
12011
|
+
const scrollRatio = scrollContentHeight / scrollbarHeight;
|
|
12012
|
+
// Update scroll position
|
|
12013
|
+
viewport.scrollTop = this.startScrollTop + deltaY * scrollRatio;
|
|
12014
|
+
event.preventDefault();
|
|
12015
|
+
}
|
|
12016
|
+
onMouseUp() {
|
|
12017
|
+
this.isDragging = false;
|
|
12018
|
+
}
|
|
12019
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ScrollAreaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12020
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.2", type: ScrollAreaComponent, isStandalone: true, selector: "sc-scroll-area3", viewQueries: [{ propertyName: "viewportRef", first: true, predicate: ["viewport"], descendants: true }, { propertyName: "thumbRef", first: true, predicate: ["thumb"], descendants: true }], ngImport: i0, template: `
|
|
12021
|
+
<div class="h-[8.5rem] w-96 max-w-[calc(100vw-8rem)] relative">
|
|
12022
|
+
<div
|
|
12023
|
+
class="h-full overflow-y-scroll overscroll-contain rounded-md outline outline-1 -outline-offset-1 outline-gray-200 focus-visible:outline focus-visible:outline-2 focus-visible:outline-blue-800 scrollbar-hide"
|
|
12024
|
+
#viewport
|
|
12025
|
+
(scroll)="onScroll()"
|
|
12026
|
+
(mouseenter)="isHovering = true"
|
|
12027
|
+
(mouseleave)="isHovering = false"
|
|
12028
|
+
>
|
|
12029
|
+
<div class="flex flex-col gap-4 py-3 pr-6 pl-4 text-sm leading-[1.375rem] text-gray-900">
|
|
12030
|
+
<p>
|
|
12031
|
+
Vernacular architecture is building done outside any academic tradition, and without
|
|
12032
|
+
professional guidance. It is not a particular architectural movement or style, but
|
|
12033
|
+
rather a broad category, encompassing a wide range and variety of building types, with
|
|
12034
|
+
differing methods of construction, from around the world, both historical and extant and
|
|
12035
|
+
classical and modern. Vernacular architecture constitutes 95% of the world's built
|
|
12036
|
+
environment, as estimated in 1995 by Amos Rapoport, as measured against the small
|
|
12037
|
+
percentage of new buildings every year designed by architects and built by engineers.
|
|
12038
|
+
</p>
|
|
12039
|
+
<p>
|
|
12040
|
+
This type of architecture usually serves immediate, local needs, is constrained by the
|
|
12041
|
+
materials available in its particular region and reflects local traditions and cultural
|
|
12042
|
+
practices. The study of vernacular architecture does not examine formally schooled
|
|
12043
|
+
architects, but instead that of the design skills and tradition of local builders, who
|
|
12044
|
+
were rarely given any attribution for the work. More recently, vernacular architecture
|
|
12045
|
+
has been examined by designers and the building industry in an effort to be more energy
|
|
12046
|
+
conscious with contemporary design and construction—part of a broader interest in
|
|
12047
|
+
sustainable design.
|
|
12048
|
+
</p>
|
|
12049
|
+
</div>
|
|
12050
|
+
</div>
|
|
12051
|
+
<div
|
|
12052
|
+
class="absolute top-0 right-1 w-1 h-[calc(100%-0.5rem)] my-1 rounded-full bg-gray-200 opacity-0 transition-opacity delay-300"
|
|
12053
|
+
[ngClass]="{ 'opacity-100 delay-0 duration-75': isScrolling || isHovering }"
|
|
12054
|
+
>
|
|
12055
|
+
<div
|
|
12056
|
+
class="absolute w-full rounded-full bg-gray-500 cursor-pointer"
|
|
12057
|
+
#thumb
|
|
12058
|
+
[style.height.%]="thumbHeight"
|
|
12059
|
+
[style.top.%]="thumbTop"
|
|
12060
|
+
(mousedown)="startDragging($event)"
|
|
12061
|
+
></div>
|
|
12062
|
+
</div>
|
|
12063
|
+
</div>
|
|
12064
|
+
`, isInline: true, styles: [".scrollbar-hide::-webkit-scrollbar{display:none}.scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
12065
|
+
}
|
|
12066
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ScrollAreaComponent, decorators: [{
|
|
12067
|
+
type: Component,
|
|
12068
|
+
args: [{ selector: 'sc-scroll-area3', standalone: true, imports: [CommonModule], template: `
|
|
12069
|
+
<div class="h-[8.5rem] w-96 max-w-[calc(100vw-8rem)] relative">
|
|
12070
|
+
<div
|
|
12071
|
+
class="h-full overflow-y-scroll overscroll-contain rounded-md outline outline-1 -outline-offset-1 outline-gray-200 focus-visible:outline focus-visible:outline-2 focus-visible:outline-blue-800 scrollbar-hide"
|
|
12072
|
+
#viewport
|
|
12073
|
+
(scroll)="onScroll()"
|
|
12074
|
+
(mouseenter)="isHovering = true"
|
|
12075
|
+
(mouseleave)="isHovering = false"
|
|
12076
|
+
>
|
|
12077
|
+
<div class="flex flex-col gap-4 py-3 pr-6 pl-4 text-sm leading-[1.375rem] text-gray-900">
|
|
12078
|
+
<p>
|
|
12079
|
+
Vernacular architecture is building done outside any academic tradition, and without
|
|
12080
|
+
professional guidance. It is not a particular architectural movement or style, but
|
|
12081
|
+
rather a broad category, encompassing a wide range and variety of building types, with
|
|
12082
|
+
differing methods of construction, from around the world, both historical and extant and
|
|
12083
|
+
classical and modern. Vernacular architecture constitutes 95% of the world's built
|
|
12084
|
+
environment, as estimated in 1995 by Amos Rapoport, as measured against the small
|
|
12085
|
+
percentage of new buildings every year designed by architects and built by engineers.
|
|
12086
|
+
</p>
|
|
12087
|
+
<p>
|
|
12088
|
+
This type of architecture usually serves immediate, local needs, is constrained by the
|
|
12089
|
+
materials available in its particular region and reflects local traditions and cultural
|
|
12090
|
+
practices. The study of vernacular architecture does not examine formally schooled
|
|
12091
|
+
architects, but instead that of the design skills and tradition of local builders, who
|
|
12092
|
+
were rarely given any attribution for the work. More recently, vernacular architecture
|
|
12093
|
+
has been examined by designers and the building industry in an effort to be more energy
|
|
12094
|
+
conscious with contemporary design and construction—part of a broader interest in
|
|
12095
|
+
sustainable design.
|
|
12096
|
+
</p>
|
|
12097
|
+
</div>
|
|
12098
|
+
</div>
|
|
12099
|
+
<div
|
|
12100
|
+
class="absolute top-0 right-1 w-1 h-[calc(100%-0.5rem)] my-1 rounded-full bg-gray-200 opacity-0 transition-opacity delay-300"
|
|
12101
|
+
[ngClass]="{ 'opacity-100 delay-0 duration-75': isScrolling || isHovering }"
|
|
12102
|
+
>
|
|
12103
|
+
<div
|
|
12104
|
+
class="absolute w-full rounded-full bg-gray-500 cursor-pointer"
|
|
12105
|
+
#thumb
|
|
12106
|
+
[style.height.%]="thumbHeight"
|
|
12107
|
+
[style.top.%]="thumbTop"
|
|
12108
|
+
(mousedown)="startDragging($event)"
|
|
12109
|
+
></div>
|
|
12110
|
+
</div>
|
|
12111
|
+
</div>
|
|
12112
|
+
`, styles: [".scrollbar-hide::-webkit-scrollbar{display:none}.scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}\n"] }]
|
|
12113
|
+
}], ctorParameters: () => [], propDecorators: { viewportRef: [{
|
|
12114
|
+
type: ViewChild,
|
|
12115
|
+
args: ['viewport']
|
|
12116
|
+
}], thumbRef: [{
|
|
12117
|
+
type: ViewChild,
|
|
12118
|
+
args: ['thumb']
|
|
12119
|
+
}] } });
|
|
12120
|
+
|
|
12121
|
+
// horizontal-scroll-area.component.ts
|
|
12122
|
+
class HorizontalScrollAreaComponent {
|
|
12123
|
+
viewportRef;
|
|
12124
|
+
thumbRef;
|
|
12125
|
+
isScrolling = false;
|
|
12126
|
+
isHovering = false;
|
|
12127
|
+
isDragging = false;
|
|
12128
|
+
scrollTimeout;
|
|
12129
|
+
thumbWidth = 20;
|
|
12130
|
+
thumbLeft = 0;
|
|
12131
|
+
startX = 0;
|
|
12132
|
+
startScrollLeft = 0;
|
|
12133
|
+
canScrollLeft = false;
|
|
12134
|
+
canScrollRight = true;
|
|
12135
|
+
// Sample items for demonstration
|
|
12136
|
+
items = Array(15)
|
|
12137
|
+
.fill(0)
|
|
12138
|
+
.map((_, i) => ({
|
|
12139
|
+
title: `Item ${i + 1}`,
|
|
12140
|
+
description: `This is a description for item ${i + 1}. It contains some sample text to demonstrate the horizontal scrolling functionality.`,
|
|
12141
|
+
category: ['Design', 'Development', 'Marketing', 'Research'][i % 4],
|
|
12142
|
+
}));
|
|
12143
|
+
constructor() {
|
|
12144
|
+
// Add document-level event listeners for drag operations
|
|
12145
|
+
document.addEventListener('mousemove', this.onMouseMove.bind(this));
|
|
12146
|
+
document.addEventListener('mouseup', this.onMouseUp.bind(this));
|
|
12147
|
+
}
|
|
12148
|
+
ngOnDestroy() {
|
|
12149
|
+
// Clean up event listeners
|
|
12150
|
+
document.removeEventListener('mousemove', this.onMouseMove.bind(this));
|
|
12151
|
+
document.removeEventListener('mouseup', this.onMouseUp.bind(this));
|
|
12152
|
+
}
|
|
12153
|
+
ngAfterViewInit() {
|
|
12154
|
+
this.updateThumb();
|
|
12155
|
+
// Initial check for scroll buttons
|
|
12156
|
+
this.updateScrollButtonsState();
|
|
12157
|
+
}
|
|
12158
|
+
onScroll() {
|
|
12159
|
+
this.updateThumb();
|
|
12160
|
+
this.updateScrollButtonsState();
|
|
12161
|
+
this.isScrolling = true;
|
|
12162
|
+
clearTimeout(this.scrollTimeout);
|
|
12163
|
+
this.scrollTimeout = setTimeout(() => {
|
|
12164
|
+
this.isScrolling = false;
|
|
12165
|
+
}, 300);
|
|
12166
|
+
}
|
|
12167
|
+
updateThumb() {
|
|
12168
|
+
const viewport = this.viewportRef.nativeElement;
|
|
12169
|
+
const scrollWidth = viewport.scrollWidth;
|
|
12170
|
+
const clientWidth = viewport.clientWidth;
|
|
12171
|
+
// Calculate thumb width as percentage of visible area
|
|
12172
|
+
this.thumbWidth = (clientWidth / scrollWidth) * 100;
|
|
12173
|
+
// Calculate thumb position
|
|
12174
|
+
this.thumbLeft = (viewport.scrollLeft / (scrollWidth - clientWidth)) * (100 - this.thumbWidth);
|
|
12175
|
+
}
|
|
12176
|
+
updateScrollButtonsState() {
|
|
12177
|
+
const viewport = this.viewportRef.nativeElement;
|
|
12178
|
+
this.canScrollLeft = viewport.scrollLeft > 0;
|
|
12179
|
+
this.canScrollRight = viewport.scrollLeft < viewport.scrollWidth - viewport.clientWidth;
|
|
12180
|
+
}
|
|
12181
|
+
startDragging(event) {
|
|
12182
|
+
this.isDragging = true;
|
|
12183
|
+
this.startX = event.clientX;
|
|
12184
|
+
this.startScrollLeft = this.viewportRef.nativeElement.scrollLeft;
|
|
12185
|
+
event.preventDefault();
|
|
12186
|
+
}
|
|
12187
|
+
onMouseMove(event) {
|
|
12188
|
+
if (!this.isDragging)
|
|
12189
|
+
return;
|
|
12190
|
+
const viewport = this.viewportRef.nativeElement;
|
|
12191
|
+
const deltaX = event.clientX - this.startX;
|
|
12192
|
+
const scrollbarWidth = viewport.clientWidth;
|
|
12193
|
+
const scrollContentWidth = viewport.scrollWidth;
|
|
12194
|
+
// Calculate the scroll ratio
|
|
12195
|
+
const scrollRatio = scrollContentWidth / scrollbarWidth;
|
|
12196
|
+
// Update scroll position
|
|
12197
|
+
viewport.scrollLeft = this.startScrollLeft + deltaX * scrollRatio;
|
|
12198
|
+
event.preventDefault();
|
|
12199
|
+
}
|
|
12200
|
+
onMouseUp() {
|
|
12201
|
+
this.isDragging = false;
|
|
12202
|
+
}
|
|
12203
|
+
scrollLeft() {
|
|
12204
|
+
const viewport = this.viewportRef.nativeElement;
|
|
12205
|
+
viewport.scrollBy({ left: -300, behavior: 'smooth' });
|
|
12206
|
+
}
|
|
12207
|
+
scrollRight() {
|
|
12208
|
+
const viewport = this.viewportRef.nativeElement;
|
|
12209
|
+
viewport.scrollBy({ left: 300, behavior: 'smooth' });
|
|
12210
|
+
}
|
|
12211
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: HorizontalScrollAreaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12212
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.2", type: HorizontalScrollAreaComponent, isStandalone: true, selector: "sc-horizontal-scroll-area", viewQueries: [{ propertyName: "viewportRef", first: true, predicate: ["viewport"], descendants: true }, { propertyName: "thumbRef", first: true, predicate: ["thumb"], descendants: true }], ngImport: i0, template: `
|
|
12213
|
+
<div class="relative w-full max-w-4xl">
|
|
12214
|
+
<!-- Horizontal scroll container -->
|
|
12215
|
+
<div
|
|
12216
|
+
class="overflow-x-scroll overflow-y-hidden overscroll-contain h-64 rounded-md outline outline-1 -outline-offset-1 outline-gray-200 focus-visible:outline focus-visible:outline-2 focus-visible:outline-blue-800 scrollbar-hide"
|
|
12217
|
+
#viewport
|
|
12218
|
+
(scroll)="onScroll()"
|
|
12219
|
+
(mouseenter)="isHovering = true"
|
|
12220
|
+
(mouseleave)="isHovering = false"
|
|
12221
|
+
>
|
|
12222
|
+
<!-- Content container -->
|
|
12223
|
+
<div class="flex flex-row gap-4 p-4 min-w-max">
|
|
12224
|
+
<!-- Cards -->
|
|
12225
|
+
<div
|
|
12226
|
+
class="bg-white rounded-lg shadow-md w-64 h-52 flex-shrink-0 border border-gray-200 hover:border-blue-500 transition-colors duration-200"
|
|
12227
|
+
*ngFor="let item of items"
|
|
12228
|
+
>
|
|
12229
|
+
<div class="p-4 h-full flex flex-col">
|
|
12230
|
+
<h3 class="text-lg font-medium text-gray-900 mb-2">{{ item.title }}</h3>
|
|
12231
|
+
<p class="text-sm text-gray-600 flex-grow">{{ item.description }}</p>
|
|
12232
|
+
<div class="mt-4 text-xs text-gray-500">{{ item.category }}</div>
|
|
12233
|
+
</div>
|
|
12234
|
+
</div>
|
|
12235
|
+
</div>
|
|
12236
|
+
</div>
|
|
12237
|
+
|
|
12238
|
+
<!-- Custom scroll bar -->
|
|
12239
|
+
<div
|
|
12240
|
+
class="absolute bottom-0 left-0 right-4 h-1 mx-2 rounded-full bg-gray-200 opacity-0 transition-opacity delay-300"
|
|
12241
|
+
[ngClass]="{ 'opacity-100 delay-0 duration-75': isScrolling || isHovering }"
|
|
12242
|
+
>
|
|
12243
|
+
<div
|
|
12244
|
+
class="absolute h-full rounded-full bg-gray-500 cursor-pointer"
|
|
12245
|
+
#thumb
|
|
12246
|
+
[style.width.%]="thumbWidth"
|
|
12247
|
+
[style.left.%]="thumbLeft"
|
|
12248
|
+
(mousedown)="startDragging($event)"
|
|
12249
|
+
></div>
|
|
12250
|
+
</div>
|
|
12251
|
+
|
|
12252
|
+
<!-- Arrow navigation -->
|
|
12253
|
+
<button
|
|
12254
|
+
class="absolute top-1/2 left-2 -translate-y-1/2 bg-white/80 hover:bg-white rounded-full shadow-md p-2 opacity-0 transition-opacity duration-200"
|
|
12255
|
+
[ngClass]="{ 'opacity-100': isHovering && canScrollLeft }"
|
|
12256
|
+
[disabled]="!canScrollLeft"
|
|
12257
|
+
(click)="scrollLeft()"
|
|
12258
|
+
aria-label="Scroll left"
|
|
12259
|
+
>
|
|
12260
|
+
<svg
|
|
12261
|
+
class="h-5 w-5 text-gray-700"
|
|
12262
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12263
|
+
fill="none"
|
|
12264
|
+
viewBox="0 0 24 24"
|
|
12265
|
+
stroke="currentColor"
|
|
12266
|
+
>
|
|
12267
|
+
<path
|
|
12268
|
+
stroke-linecap="round"
|
|
12269
|
+
stroke-linejoin="round"
|
|
12270
|
+
stroke-width="2"
|
|
12271
|
+
d="M15 19l-7-7 7-7"
|
|
12272
|
+
/>
|
|
12273
|
+
</svg>
|
|
12274
|
+
</button>
|
|
12275
|
+
|
|
12276
|
+
<button
|
|
12277
|
+
class="absolute top-1/2 right-2 -translate-y-1/2 bg-white/80 hover:bg-white rounded-full shadow-md p-2 opacity-0 transition-opacity duration-200"
|
|
12278
|
+
[ngClass]="{ 'opacity-100': isHovering && canScrollRight }"
|
|
12279
|
+
[disabled]="!canScrollRight"
|
|
12280
|
+
(click)="scrollRight()"
|
|
12281
|
+
aria-label="Scroll right"
|
|
12282
|
+
>
|
|
12283
|
+
<svg
|
|
12284
|
+
class="h-5 w-5 text-gray-700"
|
|
12285
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12286
|
+
fill="none"
|
|
12287
|
+
viewBox="0 0 24 24"
|
|
12288
|
+
stroke="currentColor"
|
|
12289
|
+
>
|
|
12290
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
|
12291
|
+
</svg>
|
|
12292
|
+
</button>
|
|
12293
|
+
</div>
|
|
12294
|
+
`, isInline: true, styles: [".scrollbar-hide::-webkit-scrollbar{display:none}.scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
12295
|
+
}
|
|
12296
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: HorizontalScrollAreaComponent, decorators: [{
|
|
12297
|
+
type: Component,
|
|
12298
|
+
args: [{ selector: 'sc-horizontal-scroll-area', standalone: true, imports: [CommonModule], template: `
|
|
12299
|
+
<div class="relative w-full max-w-4xl">
|
|
12300
|
+
<!-- Horizontal scroll container -->
|
|
12301
|
+
<div
|
|
12302
|
+
class="overflow-x-scroll overflow-y-hidden overscroll-contain h-64 rounded-md outline outline-1 -outline-offset-1 outline-gray-200 focus-visible:outline focus-visible:outline-2 focus-visible:outline-blue-800 scrollbar-hide"
|
|
12303
|
+
#viewport
|
|
12304
|
+
(scroll)="onScroll()"
|
|
12305
|
+
(mouseenter)="isHovering = true"
|
|
12306
|
+
(mouseleave)="isHovering = false"
|
|
12307
|
+
>
|
|
12308
|
+
<!-- Content container -->
|
|
12309
|
+
<div class="flex flex-row gap-4 p-4 min-w-max">
|
|
12310
|
+
<!-- Cards -->
|
|
12311
|
+
<div
|
|
12312
|
+
class="bg-white rounded-lg shadow-md w-64 h-52 flex-shrink-0 border border-gray-200 hover:border-blue-500 transition-colors duration-200"
|
|
12313
|
+
*ngFor="let item of items"
|
|
12314
|
+
>
|
|
12315
|
+
<div class="p-4 h-full flex flex-col">
|
|
12316
|
+
<h3 class="text-lg font-medium text-gray-900 mb-2">{{ item.title }}</h3>
|
|
12317
|
+
<p class="text-sm text-gray-600 flex-grow">{{ item.description }}</p>
|
|
12318
|
+
<div class="mt-4 text-xs text-gray-500">{{ item.category }}</div>
|
|
12319
|
+
</div>
|
|
12320
|
+
</div>
|
|
12321
|
+
</div>
|
|
12322
|
+
</div>
|
|
12323
|
+
|
|
12324
|
+
<!-- Custom scroll bar -->
|
|
12325
|
+
<div
|
|
12326
|
+
class="absolute bottom-0 left-0 right-4 h-1 mx-2 rounded-full bg-gray-200 opacity-0 transition-opacity delay-300"
|
|
12327
|
+
[ngClass]="{ 'opacity-100 delay-0 duration-75': isScrolling || isHovering }"
|
|
12328
|
+
>
|
|
12329
|
+
<div
|
|
12330
|
+
class="absolute h-full rounded-full bg-gray-500 cursor-pointer"
|
|
12331
|
+
#thumb
|
|
12332
|
+
[style.width.%]="thumbWidth"
|
|
12333
|
+
[style.left.%]="thumbLeft"
|
|
12334
|
+
(mousedown)="startDragging($event)"
|
|
12335
|
+
></div>
|
|
12336
|
+
</div>
|
|
12337
|
+
|
|
12338
|
+
<!-- Arrow navigation -->
|
|
12339
|
+
<button
|
|
12340
|
+
class="absolute top-1/2 left-2 -translate-y-1/2 bg-white/80 hover:bg-white rounded-full shadow-md p-2 opacity-0 transition-opacity duration-200"
|
|
12341
|
+
[ngClass]="{ 'opacity-100': isHovering && canScrollLeft }"
|
|
12342
|
+
[disabled]="!canScrollLeft"
|
|
12343
|
+
(click)="scrollLeft()"
|
|
12344
|
+
aria-label="Scroll left"
|
|
12345
|
+
>
|
|
12346
|
+
<svg
|
|
12347
|
+
class="h-5 w-5 text-gray-700"
|
|
12348
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12349
|
+
fill="none"
|
|
12350
|
+
viewBox="0 0 24 24"
|
|
12351
|
+
stroke="currentColor"
|
|
12352
|
+
>
|
|
12353
|
+
<path
|
|
12354
|
+
stroke-linecap="round"
|
|
12355
|
+
stroke-linejoin="round"
|
|
12356
|
+
stroke-width="2"
|
|
12357
|
+
d="M15 19l-7-7 7-7"
|
|
12358
|
+
/>
|
|
12359
|
+
</svg>
|
|
12360
|
+
</button>
|
|
12361
|
+
|
|
12362
|
+
<button
|
|
12363
|
+
class="absolute top-1/2 right-2 -translate-y-1/2 bg-white/80 hover:bg-white rounded-full shadow-md p-2 opacity-0 transition-opacity duration-200"
|
|
12364
|
+
[ngClass]="{ 'opacity-100': isHovering && canScrollRight }"
|
|
12365
|
+
[disabled]="!canScrollRight"
|
|
12366
|
+
(click)="scrollRight()"
|
|
12367
|
+
aria-label="Scroll right"
|
|
12368
|
+
>
|
|
12369
|
+
<svg
|
|
12370
|
+
class="h-5 w-5 text-gray-700"
|
|
12371
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12372
|
+
fill="none"
|
|
12373
|
+
viewBox="0 0 24 24"
|
|
12374
|
+
stroke="currentColor"
|
|
12375
|
+
>
|
|
12376
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
|
12377
|
+
</svg>
|
|
12378
|
+
</button>
|
|
12379
|
+
</div>
|
|
12380
|
+
`, styles: [".scrollbar-hide::-webkit-scrollbar{display:none}.scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}\n"] }]
|
|
12381
|
+
}], ctorParameters: () => [], propDecorators: { viewportRef: [{
|
|
12382
|
+
type: ViewChild,
|
|
12383
|
+
args: ['viewport']
|
|
12384
|
+
}], thumbRef: [{
|
|
12385
|
+
type: ViewChild,
|
|
12386
|
+
args: ['thumb']
|
|
12387
|
+
}] } });
|
|
12388
|
+
|
|
12389
|
+
// flexible-scroll-area.component.ts
|
|
12390
|
+
class FlexibleScrollAreaComponent {
|
|
12391
|
+
orientation = 'vertical';
|
|
12392
|
+
height = '8.5rem';
|
|
12393
|
+
width = '96';
|
|
12394
|
+
showNavButtons = true;
|
|
12395
|
+
viewportRef;
|
|
12396
|
+
isScrolling = false;
|
|
12397
|
+
isHovering = false;
|
|
12398
|
+
isDragging = false;
|
|
12399
|
+
scrollTimeout;
|
|
12400
|
+
thumbSize = 20;
|
|
12401
|
+
thumbPosition = 0;
|
|
12402
|
+
startPoint = 0;
|
|
12403
|
+
startScrollPosition = 0;
|
|
12404
|
+
canScrollStart = false;
|
|
12405
|
+
canScrollEnd = true;
|
|
12406
|
+
constructor() {
|
|
12407
|
+
// Add document-level event listeners for drag operations
|
|
12408
|
+
document.addEventListener('mousemove', this.onMouseMove.bind(this));
|
|
12409
|
+
document.addEventListener('mouseup', this.onMouseUp.bind(this));
|
|
12410
|
+
}
|
|
12411
|
+
ngOnInit() {
|
|
12412
|
+
// Initial check to make sure we have a valid orientation
|
|
12413
|
+
if (this.orientation !== 'vertical' && this.orientation !== 'horizontal') {
|
|
12414
|
+
this.orientation = 'vertical';
|
|
12415
|
+
}
|
|
12416
|
+
}
|
|
12417
|
+
ngOnDestroy() {
|
|
12418
|
+
// Clean up event listeners
|
|
12419
|
+
document.removeEventListener('mousemove', this.onMouseMove.bind(this));
|
|
12420
|
+
document.removeEventListener('mouseup', this.onMouseUp.bind(this));
|
|
12421
|
+
}
|
|
12422
|
+
ngAfterViewInit() {
|
|
12423
|
+
this.updateThumb();
|
|
12424
|
+
this.updateScrollButtonsState();
|
|
12425
|
+
}
|
|
12426
|
+
onScroll() {
|
|
12427
|
+
this.updateThumb();
|
|
12428
|
+
this.updateScrollButtonsState();
|
|
12429
|
+
this.isScrolling = true;
|
|
12430
|
+
clearTimeout(this.scrollTimeout);
|
|
12431
|
+
this.scrollTimeout = setTimeout(() => {
|
|
12432
|
+
this.isScrolling = false;
|
|
12433
|
+
}, 300);
|
|
12434
|
+
}
|
|
12435
|
+
updateThumb() {
|
|
12436
|
+
const viewport = this.viewportRef.nativeElement;
|
|
12437
|
+
if (this.orientation === 'vertical') {
|
|
12438
|
+
const scrollHeight = viewport.scrollHeight;
|
|
12439
|
+
const clientHeight = viewport.clientHeight;
|
|
12440
|
+
// Calculate thumb height as percentage of visible area
|
|
12441
|
+
this.thumbSize = (clientHeight / scrollHeight) * 100;
|
|
12442
|
+
// Calculate thumb position
|
|
12443
|
+
this.thumbPosition =
|
|
12444
|
+
(viewport.scrollTop / (scrollHeight - clientHeight)) * (100 - this.thumbSize);
|
|
12445
|
+
}
|
|
12446
|
+
else {
|
|
12447
|
+
const scrollWidth = viewport.scrollWidth;
|
|
12448
|
+
const clientWidth = viewport.clientWidth;
|
|
12449
|
+
// Calculate thumb width as percentage of visible area
|
|
12450
|
+
this.thumbSize = (clientWidth / scrollWidth) * 100;
|
|
12451
|
+
// Calculate thumb position
|
|
12452
|
+
this.thumbPosition =
|
|
12453
|
+
(viewport.scrollLeft / (scrollWidth - clientWidth)) * (100 - this.thumbSize);
|
|
12454
|
+
}
|
|
12455
|
+
}
|
|
12456
|
+
updateScrollButtonsState() {
|
|
12457
|
+
const viewport = this.viewportRef.nativeElement;
|
|
12458
|
+
if (this.orientation === 'vertical') {
|
|
12459
|
+
this.canScrollStart = viewport.scrollTop > 0;
|
|
12460
|
+
this.canScrollEnd = viewport.scrollTop < viewport.scrollHeight - viewport.clientHeight - 1; // -1 for rounding errors
|
|
12461
|
+
}
|
|
12462
|
+
else {
|
|
12463
|
+
this.canScrollStart = viewport.scrollLeft > 0;
|
|
12464
|
+
this.canScrollEnd = viewport.scrollLeft < viewport.scrollWidth - viewport.clientWidth - 1; // -1 for rounding errors
|
|
12465
|
+
}
|
|
12466
|
+
}
|
|
12467
|
+
startDragging(event) {
|
|
12468
|
+
this.isDragging = true;
|
|
12469
|
+
if (this.orientation === 'vertical') {
|
|
12470
|
+
this.startPoint = event.clientY;
|
|
12471
|
+
this.startScrollPosition = this.viewportRef.nativeElement.scrollTop;
|
|
12472
|
+
}
|
|
12473
|
+
else {
|
|
12474
|
+
this.startPoint = event.clientX;
|
|
12475
|
+
this.startScrollPosition = this.viewportRef.nativeElement.scrollLeft;
|
|
12476
|
+
}
|
|
12477
|
+
event.preventDefault();
|
|
12478
|
+
}
|
|
12479
|
+
onMouseMove(event) {
|
|
12480
|
+
if (!this.isDragging)
|
|
12481
|
+
return;
|
|
12482
|
+
const viewport = this.viewportRef.nativeElement;
|
|
12483
|
+
if (this.orientation === 'vertical') {
|
|
12484
|
+
const deltaY = event.clientY - this.startPoint;
|
|
12485
|
+
const scrollbarHeight = viewport.clientHeight;
|
|
12486
|
+
const scrollContentHeight = viewport.scrollHeight;
|
|
12487
|
+
// Calculate the scroll ratio
|
|
12488
|
+
const scrollRatio = scrollContentHeight / scrollbarHeight;
|
|
12489
|
+
// Update scroll position
|
|
12490
|
+
viewport.scrollTop = this.startScrollPosition + deltaY * scrollRatio;
|
|
12491
|
+
}
|
|
12492
|
+
else {
|
|
12493
|
+
const deltaX = event.clientX - this.startPoint;
|
|
12494
|
+
const scrollbarWidth = viewport.clientWidth;
|
|
12495
|
+
const scrollContentWidth = viewport.scrollWidth;
|
|
12496
|
+
// Calculate the scroll ratio
|
|
12497
|
+
const scrollRatio = scrollContentWidth / scrollbarWidth;
|
|
12498
|
+
// Update scroll position
|
|
12499
|
+
viewport.scrollLeft = this.startScrollPosition + deltaX * scrollRatio;
|
|
12500
|
+
}
|
|
12501
|
+
event.preventDefault();
|
|
12502
|
+
}
|
|
12503
|
+
onMouseUp() {
|
|
12504
|
+
this.isDragging = false;
|
|
12505
|
+
}
|
|
12506
|
+
scrollPrev() {
|
|
12507
|
+
const viewport = this.viewportRef.nativeElement;
|
|
12508
|
+
if (this.orientation === 'vertical') {
|
|
12509
|
+
viewport.scrollBy({ top: -200, behavior: 'smooth' });
|
|
12510
|
+
}
|
|
12511
|
+
else {
|
|
12512
|
+
viewport.scrollBy({ left: -300, behavior: 'smooth' });
|
|
12513
|
+
}
|
|
12514
|
+
}
|
|
12515
|
+
scrollNext() {
|
|
12516
|
+
const viewport = this.viewportRef.nativeElement;
|
|
12517
|
+
if (this.orientation === 'vertical') {
|
|
12518
|
+
viewport.scrollBy({ top: 200, behavior: 'smooth' });
|
|
12519
|
+
}
|
|
12520
|
+
else {
|
|
12521
|
+
viewport.scrollBy({ left: 300, behavior: 'smooth' });
|
|
12522
|
+
}
|
|
12523
|
+
}
|
|
12524
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: FlexibleScrollAreaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12525
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.2", type: FlexibleScrollAreaComponent, isStandalone: true, selector: "sc-flexible-scroll-area", inputs: { orientation: "orientation", height: "height", width: "width", showNavButtons: "showNavButtons" }, viewQueries: [{ propertyName: "viewportRef", first: true, predicate: ["viewport"], descendants: true }], ngImport: i0, template: `
|
|
12526
|
+
<div
|
|
12527
|
+
class="relative"
|
|
12528
|
+
[ngClass]="{
|
|
12529
|
+
'w-full max-w-4xl': orientation === 'horizontal',
|
|
12530
|
+
'h-[8.5rem] w-96 max-w-[calc(100vw-8rem)]': orientation === 'vertical',
|
|
12531
|
+
}"
|
|
12532
|
+
>
|
|
12533
|
+
<!-- Main scroll container -->
|
|
12534
|
+
<div
|
|
12535
|
+
class="overscroll-contain rounded-md outline -outline-offset-1 outline-gray-200 focus-visible:outline focus-visible:outline-blue-800 scrollbar-hide"
|
|
12536
|
+
#viewport
|
|
12537
|
+
[ngClass]="{
|
|
12538
|
+
'overflow-x-scroll overflow-y-hidden h-64': orientation === 'horizontal',
|
|
12539
|
+
'overflow-y-scroll overflow-x-hidden h-full': orientation === 'vertical',
|
|
12540
|
+
}"
|
|
12541
|
+
(scroll)="onScroll()"
|
|
12542
|
+
(mouseenter)="isHovering = true"
|
|
12543
|
+
(mouseleave)="isHovering = false"
|
|
12544
|
+
>
|
|
12545
|
+
<!-- Content container with proper layout based on orientation -->
|
|
12546
|
+
<div
|
|
12547
|
+
[ngClass]="{
|
|
12548
|
+
'flex flex-row gap-4 p-4 min-w-max': orientation === 'horizontal',
|
|
12549
|
+
'flex flex-col gap-4 py-3 pr-6 pl-4 text-sm leading-[1.375rem] text-gray-900':
|
|
12550
|
+
orientation === 'vertical',
|
|
12551
|
+
}"
|
|
12552
|
+
>
|
|
12553
|
+
<!-- Projected content from parent component -->
|
|
12554
|
+
<ng-content></ng-content>
|
|
12555
|
+
</div>
|
|
12556
|
+
</div>
|
|
12557
|
+
|
|
12558
|
+
<!-- Custom scrollbar for vertical orientation -->
|
|
12559
|
+
<div
|
|
12560
|
+
class="absolute top-0 right-1 w-1 h-[calc(100%-0.5rem)] my-1 rounded-full bg-gray-200 opacity-0 transition-opacity delay-300"
|
|
12561
|
+
*ngIf="orientation === 'vertical'"
|
|
12562
|
+
[ngClass]="{ 'opacity-100 delay-0 duration-75': isScrolling || isHovering }"
|
|
12563
|
+
>
|
|
12564
|
+
<div
|
|
12565
|
+
class="absolute w-full rounded-full bg-gray-500 cursor-pointer"
|
|
12566
|
+
#verticalThumb
|
|
12567
|
+
[style.height.%]="thumbSize"
|
|
12568
|
+
[style.top.%]="thumbPosition"
|
|
12569
|
+
(mousedown)="startDragging($event)"
|
|
12570
|
+
></div>
|
|
12571
|
+
</div>
|
|
12572
|
+
|
|
12573
|
+
<!-- Custom scrollbar for horizontal orientation -->
|
|
12574
|
+
<div
|
|
12575
|
+
class="absolute bottom-0 left-0 right-4 h-1 mx-2 rounded-full bg-gray-200 opacity-0 transition-opacity delay-300"
|
|
12576
|
+
*ngIf="orientation === 'horizontal'"
|
|
12577
|
+
[ngClass]="{ 'opacity-100 delay-0 duration-75': isScrolling || isHovering }"
|
|
12578
|
+
>
|
|
12579
|
+
<div
|
|
12580
|
+
class="absolute h-full rounded-full bg-gray-500 cursor-pointer"
|
|
12581
|
+
#horizontalThumb
|
|
12582
|
+
[style.width.%]="thumbSize"
|
|
12583
|
+
[style.left.%]="thumbPosition"
|
|
12584
|
+
(mousedown)="startDragging($event)"
|
|
12585
|
+
></div>
|
|
12586
|
+
</div>
|
|
12587
|
+
|
|
12588
|
+
<!-- Navigation buttons for horizontal scrolling -->
|
|
12589
|
+
<ng-container *ngIf="orientation === 'horizontal' && showNavButtons">
|
|
12590
|
+
<button
|
|
12591
|
+
class="absolute top-1/2 left-2 -translate-y-1/2 bg-white/80 hover:bg-white rounded-full shadow-md p-2 opacity-0 transition-opacity duration-200"
|
|
12592
|
+
[ngClass]="{ 'opacity-100': isHovering && canScrollStart }"
|
|
12593
|
+
[disabled]="!canScrollStart"
|
|
12594
|
+
(click)="scrollPrev()"
|
|
12595
|
+
aria-label="Scroll left"
|
|
12596
|
+
>
|
|
12597
|
+
<svg
|
|
12598
|
+
class="h-5 w-5 text-gray-700"
|
|
12599
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12600
|
+
fill="none"
|
|
12601
|
+
viewBox="0 0 24 24"
|
|
12602
|
+
stroke="currentColor"
|
|
12603
|
+
>
|
|
12604
|
+
<path
|
|
12605
|
+
stroke-linecap="round"
|
|
12606
|
+
stroke-linejoin="round"
|
|
12607
|
+
stroke-width="2"
|
|
12608
|
+
d="M15 19l-7-7 7-7"
|
|
12609
|
+
/>
|
|
12610
|
+
</svg>
|
|
12611
|
+
</button>
|
|
12612
|
+
|
|
12613
|
+
<button
|
|
12614
|
+
class="absolute top-1/2 right-2 -translate-y-1/2 bg-white/80 hover:bg-white rounded-full shadow-md p-2 opacity-0 transition-opacity duration-200"
|
|
12615
|
+
[ngClass]="{ 'opacity-100': isHovering && canScrollEnd }"
|
|
12616
|
+
[disabled]="!canScrollEnd"
|
|
12617
|
+
(click)="scrollNext()"
|
|
12618
|
+
aria-label="Scroll right"
|
|
12619
|
+
>
|
|
12620
|
+
<svg
|
|
12621
|
+
class="h-5 w-5 text-gray-700"
|
|
12622
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12623
|
+
fill="none"
|
|
12624
|
+
viewBox="0 0 24 24"
|
|
12625
|
+
stroke="currentColor"
|
|
12626
|
+
>
|
|
12627
|
+
<path
|
|
12628
|
+
stroke-linecap="round"
|
|
12629
|
+
stroke-linejoin="round"
|
|
12630
|
+
stroke-width="2"
|
|
12631
|
+
d="M9 5l7 7-7 7"
|
|
12632
|
+
/>
|
|
12633
|
+
</svg>
|
|
12634
|
+
</button>
|
|
12635
|
+
</ng-container>
|
|
12636
|
+
|
|
12637
|
+
<!-- Navigation buttons for vertical scrolling -->
|
|
12638
|
+
<ng-container *ngIf="orientation === 'vertical' && showNavButtons">
|
|
12639
|
+
<button
|
|
12640
|
+
class="absolute top-2 left-1/2 -translate-x-1/2 bg-white/80 hover:bg-white rounded-full shadow-md p-2 opacity-0 transition-opacity duration-200"
|
|
12641
|
+
[ngClass]="{ 'opacity-100': isHovering && canScrollStart }"
|
|
12642
|
+
[disabled]="!canScrollStart"
|
|
12643
|
+
(click)="scrollPrev()"
|
|
12644
|
+
aria-label="Scroll up"
|
|
12645
|
+
>
|
|
12646
|
+
<svg
|
|
12647
|
+
class="h-5 w-5 text-gray-700"
|
|
12648
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12649
|
+
fill="none"
|
|
12650
|
+
viewBox="0 0 24 24"
|
|
12651
|
+
stroke="currentColor"
|
|
12652
|
+
>
|
|
12653
|
+
<path
|
|
12654
|
+
stroke-linecap="round"
|
|
12655
|
+
stroke-linejoin="round"
|
|
12656
|
+
stroke-width="2"
|
|
12657
|
+
d="M5 15l7-7 7 7"
|
|
12658
|
+
/>
|
|
12659
|
+
</svg>
|
|
12660
|
+
</button>
|
|
12661
|
+
|
|
12662
|
+
<button
|
|
12663
|
+
class="absolute bottom-2 left-1/2 -translate-x-1/2 bg-white/80 hover:bg-white rounded-full shadow-md p-2 opacity-0 transition-opacity duration-200"
|
|
12664
|
+
[ngClass]="{ 'opacity-100': isHovering && canScrollEnd }"
|
|
12665
|
+
[disabled]="!canScrollEnd"
|
|
12666
|
+
(click)="scrollNext()"
|
|
12667
|
+
aria-label="Scroll down"
|
|
12668
|
+
>
|
|
12669
|
+
<svg
|
|
12670
|
+
class="h-5 w-5 text-gray-700"
|
|
12671
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12672
|
+
fill="none"
|
|
12673
|
+
viewBox="0 0 24 24"
|
|
12674
|
+
stroke="currentColor"
|
|
12675
|
+
>
|
|
12676
|
+
<path
|
|
12677
|
+
stroke-linecap="round"
|
|
12678
|
+
stroke-linejoin="round"
|
|
12679
|
+
stroke-width="2"
|
|
12680
|
+
d="M19 9l-7 7-7-7"
|
|
12681
|
+
/>
|
|
12682
|
+
</svg>
|
|
12683
|
+
</button>
|
|
12684
|
+
</ng-container>
|
|
12685
|
+
</div>
|
|
12686
|
+
`, isInline: true, styles: [".scrollbar-hide::-webkit-scrollbar{display:none}.scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
12687
|
+
}
|
|
12688
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: FlexibleScrollAreaComponent, decorators: [{
|
|
12689
|
+
type: Component,
|
|
12690
|
+
args: [{ selector: 'sc-flexible-scroll-area', standalone: true, imports: [CommonModule], template: `
|
|
12691
|
+
<div
|
|
12692
|
+
class="relative"
|
|
12693
|
+
[ngClass]="{
|
|
12694
|
+
'w-full max-w-4xl': orientation === 'horizontal',
|
|
12695
|
+
'h-[8.5rem] w-96 max-w-[calc(100vw-8rem)]': orientation === 'vertical',
|
|
12696
|
+
}"
|
|
12697
|
+
>
|
|
12698
|
+
<!-- Main scroll container -->
|
|
12699
|
+
<div
|
|
12700
|
+
class="overscroll-contain rounded-md outline -outline-offset-1 outline-gray-200 focus-visible:outline focus-visible:outline-blue-800 scrollbar-hide"
|
|
12701
|
+
#viewport
|
|
12702
|
+
[ngClass]="{
|
|
12703
|
+
'overflow-x-scroll overflow-y-hidden h-64': orientation === 'horizontal',
|
|
12704
|
+
'overflow-y-scroll overflow-x-hidden h-full': orientation === 'vertical',
|
|
12705
|
+
}"
|
|
12706
|
+
(scroll)="onScroll()"
|
|
12707
|
+
(mouseenter)="isHovering = true"
|
|
12708
|
+
(mouseleave)="isHovering = false"
|
|
12709
|
+
>
|
|
12710
|
+
<!-- Content container with proper layout based on orientation -->
|
|
12711
|
+
<div
|
|
12712
|
+
[ngClass]="{
|
|
12713
|
+
'flex flex-row gap-4 p-4 min-w-max': orientation === 'horizontal',
|
|
12714
|
+
'flex flex-col gap-4 py-3 pr-6 pl-4 text-sm leading-[1.375rem] text-gray-900':
|
|
12715
|
+
orientation === 'vertical',
|
|
12716
|
+
}"
|
|
12717
|
+
>
|
|
12718
|
+
<!-- Projected content from parent component -->
|
|
12719
|
+
<ng-content></ng-content>
|
|
12720
|
+
</div>
|
|
12721
|
+
</div>
|
|
12722
|
+
|
|
12723
|
+
<!-- Custom scrollbar for vertical orientation -->
|
|
12724
|
+
<div
|
|
12725
|
+
class="absolute top-0 right-1 w-1 h-[calc(100%-0.5rem)] my-1 rounded-full bg-gray-200 opacity-0 transition-opacity delay-300"
|
|
12726
|
+
*ngIf="orientation === 'vertical'"
|
|
12727
|
+
[ngClass]="{ 'opacity-100 delay-0 duration-75': isScrolling || isHovering }"
|
|
12728
|
+
>
|
|
12729
|
+
<div
|
|
12730
|
+
class="absolute w-full rounded-full bg-gray-500 cursor-pointer"
|
|
12731
|
+
#verticalThumb
|
|
12732
|
+
[style.height.%]="thumbSize"
|
|
12733
|
+
[style.top.%]="thumbPosition"
|
|
12734
|
+
(mousedown)="startDragging($event)"
|
|
12735
|
+
></div>
|
|
12736
|
+
</div>
|
|
12737
|
+
|
|
12738
|
+
<!-- Custom scrollbar for horizontal orientation -->
|
|
12739
|
+
<div
|
|
12740
|
+
class="absolute bottom-0 left-0 right-4 h-1 mx-2 rounded-full bg-gray-200 opacity-0 transition-opacity delay-300"
|
|
12741
|
+
*ngIf="orientation === 'horizontal'"
|
|
12742
|
+
[ngClass]="{ 'opacity-100 delay-0 duration-75': isScrolling || isHovering }"
|
|
12743
|
+
>
|
|
12744
|
+
<div
|
|
12745
|
+
class="absolute h-full rounded-full bg-gray-500 cursor-pointer"
|
|
12746
|
+
#horizontalThumb
|
|
12747
|
+
[style.width.%]="thumbSize"
|
|
12748
|
+
[style.left.%]="thumbPosition"
|
|
12749
|
+
(mousedown)="startDragging($event)"
|
|
12750
|
+
></div>
|
|
12751
|
+
</div>
|
|
12752
|
+
|
|
12753
|
+
<!-- Navigation buttons for horizontal scrolling -->
|
|
12754
|
+
<ng-container *ngIf="orientation === 'horizontal' && showNavButtons">
|
|
12755
|
+
<button
|
|
12756
|
+
class="absolute top-1/2 left-2 -translate-y-1/2 bg-white/80 hover:bg-white rounded-full shadow-md p-2 opacity-0 transition-opacity duration-200"
|
|
12757
|
+
[ngClass]="{ 'opacity-100': isHovering && canScrollStart }"
|
|
12758
|
+
[disabled]="!canScrollStart"
|
|
12759
|
+
(click)="scrollPrev()"
|
|
12760
|
+
aria-label="Scroll left"
|
|
12761
|
+
>
|
|
12762
|
+
<svg
|
|
12763
|
+
class="h-5 w-5 text-gray-700"
|
|
12764
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12765
|
+
fill="none"
|
|
12766
|
+
viewBox="0 0 24 24"
|
|
12767
|
+
stroke="currentColor"
|
|
12768
|
+
>
|
|
12769
|
+
<path
|
|
12770
|
+
stroke-linecap="round"
|
|
12771
|
+
stroke-linejoin="round"
|
|
12772
|
+
stroke-width="2"
|
|
12773
|
+
d="M15 19l-7-7 7-7"
|
|
12774
|
+
/>
|
|
12775
|
+
</svg>
|
|
12776
|
+
</button>
|
|
12777
|
+
|
|
12778
|
+
<button
|
|
12779
|
+
class="absolute top-1/2 right-2 -translate-y-1/2 bg-white/80 hover:bg-white rounded-full shadow-md p-2 opacity-0 transition-opacity duration-200"
|
|
12780
|
+
[ngClass]="{ 'opacity-100': isHovering && canScrollEnd }"
|
|
12781
|
+
[disabled]="!canScrollEnd"
|
|
12782
|
+
(click)="scrollNext()"
|
|
12783
|
+
aria-label="Scroll right"
|
|
12784
|
+
>
|
|
12785
|
+
<svg
|
|
12786
|
+
class="h-5 w-5 text-gray-700"
|
|
12787
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12788
|
+
fill="none"
|
|
12789
|
+
viewBox="0 0 24 24"
|
|
12790
|
+
stroke="currentColor"
|
|
12791
|
+
>
|
|
12792
|
+
<path
|
|
12793
|
+
stroke-linecap="round"
|
|
12794
|
+
stroke-linejoin="round"
|
|
12795
|
+
stroke-width="2"
|
|
12796
|
+
d="M9 5l7 7-7 7"
|
|
12797
|
+
/>
|
|
12798
|
+
</svg>
|
|
12799
|
+
</button>
|
|
12800
|
+
</ng-container>
|
|
12801
|
+
|
|
12802
|
+
<!-- Navigation buttons for vertical scrolling -->
|
|
12803
|
+
<ng-container *ngIf="orientation === 'vertical' && showNavButtons">
|
|
12804
|
+
<button
|
|
12805
|
+
class="absolute top-2 left-1/2 -translate-x-1/2 bg-white/80 hover:bg-white rounded-full shadow-md p-2 opacity-0 transition-opacity duration-200"
|
|
12806
|
+
[ngClass]="{ 'opacity-100': isHovering && canScrollStart }"
|
|
12807
|
+
[disabled]="!canScrollStart"
|
|
12808
|
+
(click)="scrollPrev()"
|
|
12809
|
+
aria-label="Scroll up"
|
|
12810
|
+
>
|
|
12811
|
+
<svg
|
|
12812
|
+
class="h-5 w-5 text-gray-700"
|
|
12813
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12814
|
+
fill="none"
|
|
12815
|
+
viewBox="0 0 24 24"
|
|
12816
|
+
stroke="currentColor"
|
|
12817
|
+
>
|
|
12818
|
+
<path
|
|
12819
|
+
stroke-linecap="round"
|
|
12820
|
+
stroke-linejoin="round"
|
|
12821
|
+
stroke-width="2"
|
|
12822
|
+
d="M5 15l7-7 7 7"
|
|
12823
|
+
/>
|
|
12824
|
+
</svg>
|
|
12825
|
+
</button>
|
|
12826
|
+
|
|
12827
|
+
<button
|
|
12828
|
+
class="absolute bottom-2 left-1/2 -translate-x-1/2 bg-white/80 hover:bg-white rounded-full shadow-md p-2 opacity-0 transition-opacity duration-200"
|
|
12829
|
+
[ngClass]="{ 'opacity-100': isHovering && canScrollEnd }"
|
|
12830
|
+
[disabled]="!canScrollEnd"
|
|
12831
|
+
(click)="scrollNext()"
|
|
12832
|
+
aria-label="Scroll down"
|
|
12833
|
+
>
|
|
12834
|
+
<svg
|
|
12835
|
+
class="h-5 w-5 text-gray-700"
|
|
12836
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12837
|
+
fill="none"
|
|
12838
|
+
viewBox="0 0 24 24"
|
|
12839
|
+
stroke="currentColor"
|
|
12840
|
+
>
|
|
12841
|
+
<path
|
|
12842
|
+
stroke-linecap="round"
|
|
12843
|
+
stroke-linejoin="round"
|
|
12844
|
+
stroke-width="2"
|
|
12845
|
+
d="M19 9l-7 7-7-7"
|
|
12846
|
+
/>
|
|
12847
|
+
</svg>
|
|
12848
|
+
</button>
|
|
12849
|
+
</ng-container>
|
|
12850
|
+
</div>
|
|
12851
|
+
`, styles: [".scrollbar-hide::-webkit-scrollbar{display:none}.scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}\n"] }]
|
|
12852
|
+
}], ctorParameters: () => [], propDecorators: { orientation: [{
|
|
12853
|
+
type: Input
|
|
12854
|
+
}], height: [{
|
|
12855
|
+
type: Input
|
|
12856
|
+
}], width: [{
|
|
12857
|
+
type: Input
|
|
12858
|
+
}], showNavButtons: [{
|
|
12859
|
+
type: Input
|
|
12860
|
+
}], viewportRef: [{
|
|
12861
|
+
type: ViewChild,
|
|
12862
|
+
args: ['viewport']
|
|
12863
|
+
}] } });
|
|
12864
|
+
|
|
12865
|
+
class ScTab {
|
|
12866
|
+
class = input('');
|
|
12867
|
+
classes = computed(() => cn('', this.class()));
|
|
12868
|
+
active = signal(false);
|
|
12869
|
+
label = viewChild.required('label');
|
|
12870
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ScTab, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12871
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: ScTab, isStandalone: true, selector: "sc-tab", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, viewQueries: [{ propertyName: "label", first: true, predicate: ["label"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
12872
|
+
<ng-template #label>
|
|
12873
|
+
<ng-content select="sc-tab-label" />
|
|
12874
|
+
</ng-template>
|
|
12875
|
+
|
|
12876
|
+
@if (active()) {
|
|
12877
|
+
<ng-content select="sc-tab-content" />
|
|
12878
|
+
}
|
|
12879
|
+
`, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
12880
|
+
}
|
|
12881
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ScTab, decorators: [{
|
|
12882
|
+
type: Component,
|
|
11858
12883
|
args: [{ selector: 'sc-tab', imports: [], template: `
|
|
11859
12884
|
<ng-template #label>
|
|
11860
12885
|
<ng-content select="sc-tab-label" />
|
|
@@ -11990,163 +13015,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
|
|
|
11990
13015
|
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
11991
13016
|
}] });
|
|
11992
13017
|
|
|
11993
|
-
class ScTabContent2 {
|
|
11994
|
-
template = viewChild.required('template');
|
|
11995
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ScTabContent2, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
11996
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.2", type: ScTabContent2, isStandalone: true, selector: "sc-tab-content2", viewQueries: [{ propertyName: "template", first: true, predicate: ["template"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
11997
|
-
<ng-template #template>
|
|
11998
|
-
<ng-content />
|
|
11999
|
-
</ng-template>
|
|
12000
|
-
`, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
12001
|
-
}
|
|
12002
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ScTabContent2, decorators: [{
|
|
12003
|
-
type: Component,
|
|
12004
|
-
args: [{ selector: 'sc-tab-content2', imports: [], template: `
|
|
12005
|
-
<ng-template #template>
|
|
12006
|
-
<ng-content />
|
|
12007
|
-
</ng-template>
|
|
12008
|
-
`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
12009
|
-
}] });
|
|
12010
|
-
|
|
12011
|
-
class ScTabLabel2 {
|
|
12012
|
-
template = viewChild.required('template');
|
|
12013
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ScTabLabel2, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12014
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.2", type: ScTabLabel2, isStandalone: true, selector: "sc-tab-label2", viewQueries: [{ propertyName: "template", first: true, predicate: ["template"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
12015
|
-
<ng-template #template>
|
|
12016
|
-
<ng-content />
|
|
12017
|
-
</ng-template>
|
|
12018
|
-
`, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
12019
|
-
}
|
|
12020
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ScTabLabel2, decorators: [{
|
|
12021
|
-
type: Component,
|
|
12022
|
-
args: [{ selector: 'sc-tab-label2', imports: [], template: `
|
|
12023
|
-
<ng-template #template>
|
|
12024
|
-
<ng-content />
|
|
12025
|
-
</ng-template>
|
|
12026
|
-
`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [] }]
|
|
12027
|
-
}] });
|
|
12028
|
-
|
|
12029
|
-
class ScTabGroup {
|
|
12030
|
-
tabLabels = contentChildren(ScTabLabel2, { descendants: true });
|
|
12031
|
-
tabContents = contentChildren(ScTabContent2, { descendants: true });
|
|
12032
|
-
ngAfterViewInit() {
|
|
12033
|
-
console.log(this.tabLabels());
|
|
12034
|
-
}
|
|
12035
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ScTabGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12036
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: ScTabGroup, isStandalone: true, selector: "sc-tab-group", queries: [{ propertyName: "tabLabels", predicate: ScTabLabel2, descendants: true, isSignal: true }, { propertyName: "tabContents", predicate: ScTabContent2, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
12037
|
-
<div class="group relative my-4 flex flex-col space-y-2">
|
|
12038
|
-
<div class="relative mr-auto w-full" dir="ltr" data-orientation="horizontal">
|
|
12039
|
-
<div class="flex items-center justify-between pb-3">
|
|
12040
|
-
<div
|
|
12041
|
-
class="inline-flex h-9 w-full items-center justify-start rounded-none border-b bg-transparent p-0 text-muted-foreground"
|
|
12042
|
-
style="outline: none;"
|
|
12043
|
-
tabindex="0"
|
|
12044
|
-
data-orientation="horizontal"
|
|
12045
|
-
>
|
|
12046
|
-
@for (tab of tabLabels(); track tab) {
|
|
12047
|
-
<ng-container [ngTemplateOutlet]="tab.template()"></ng-container>
|
|
12048
|
-
}
|
|
12049
|
-
</div>
|
|
12050
|
-
</div>
|
|
12051
|
-
<div
|
|
12052
|
-
class="relative mt-2 rounded-md border ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
|
12053
|
-
id="radix-:r17g:-content-preview"
|
|
12054
|
-
style="animation-duration: 0s;"
|
|
12055
|
-
tabindex="0"
|
|
12056
|
-
data-state="active"
|
|
12057
|
-
data-orientation="horizontal"
|
|
12058
|
-
>
|
|
12059
|
-
<div class="theme-zinc w-full" style="--radius: 0.5rem;">
|
|
12060
|
-
<div class="preview flex min-h-[350px] w-full items-center justify-center p-10">
|
|
12061
|
-
<div
|
|
12062
|
-
class="relative h-72 w-48 overflow-hidden rounded-md border"
|
|
12063
|
-
dir="ltr"
|
|
12064
|
-
style="position: relative; --radix-scroll-area-corner-width: 0px; --radix-scroll-area-corner-height: 0px;"
|
|
12065
|
-
>
|
|
12066
|
-
<div
|
|
12067
|
-
class="size-full rounded-[inherit]"
|
|
12068
|
-
style="overflow: hidden scroll;"
|
|
12069
|
-
data-radix-scroll-area-viewport=""
|
|
12070
|
-
>
|
|
12071
|
-
@for (content of tabContents(); track content) {
|
|
12072
|
-
<ng-container [ngTemplateOutlet]="content.template()"></ng-container>
|
|
12073
|
-
}
|
|
12074
|
-
</div>
|
|
12075
|
-
</div>
|
|
12076
|
-
</div>
|
|
12077
|
-
</div>
|
|
12078
|
-
</div>
|
|
12079
|
-
</div>
|
|
12080
|
-
</div>
|
|
12081
|
-
|
|
12082
|
-
<ng-content />
|
|
12083
|
-
`, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
12084
|
-
}
|
|
12085
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ScTabGroup, decorators: [{
|
|
12086
|
-
type: Component,
|
|
12087
|
-
args: [{ selector: 'sc-tab-group', imports: [NgTemplateOutlet], template: `
|
|
12088
|
-
<div class="group relative my-4 flex flex-col space-y-2">
|
|
12089
|
-
<div class="relative mr-auto w-full" dir="ltr" data-orientation="horizontal">
|
|
12090
|
-
<div class="flex items-center justify-between pb-3">
|
|
12091
|
-
<div
|
|
12092
|
-
class="inline-flex h-9 w-full items-center justify-start rounded-none border-b bg-transparent p-0 text-muted-foreground"
|
|
12093
|
-
style="outline: none;"
|
|
12094
|
-
tabindex="0"
|
|
12095
|
-
data-orientation="horizontal"
|
|
12096
|
-
>
|
|
12097
|
-
@for (tab of tabLabels(); track tab) {
|
|
12098
|
-
<ng-container [ngTemplateOutlet]="tab.template()"></ng-container>
|
|
12099
|
-
}
|
|
12100
|
-
</div>
|
|
12101
|
-
</div>
|
|
12102
|
-
<div
|
|
12103
|
-
class="relative mt-2 rounded-md border ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
|
12104
|
-
id="radix-:r17g:-content-preview"
|
|
12105
|
-
style="animation-duration: 0s;"
|
|
12106
|
-
tabindex="0"
|
|
12107
|
-
data-state="active"
|
|
12108
|
-
data-orientation="horizontal"
|
|
12109
|
-
>
|
|
12110
|
-
<div class="theme-zinc w-full" style="--radius: 0.5rem;">
|
|
12111
|
-
<div class="preview flex min-h-[350px] w-full items-center justify-center p-10">
|
|
12112
|
-
<div
|
|
12113
|
-
class="relative h-72 w-48 overflow-hidden rounded-md border"
|
|
12114
|
-
dir="ltr"
|
|
12115
|
-
style="position: relative; --radix-scroll-area-corner-width: 0px; --radix-scroll-area-corner-height: 0px;"
|
|
12116
|
-
>
|
|
12117
|
-
<div
|
|
12118
|
-
class="size-full rounded-[inherit]"
|
|
12119
|
-
style="overflow: hidden scroll;"
|
|
12120
|
-
data-radix-scroll-area-viewport=""
|
|
12121
|
-
>
|
|
12122
|
-
@for (content of tabContents(); track content) {
|
|
12123
|
-
<ng-container [ngTemplateOutlet]="content.template()"></ng-container>
|
|
12124
|
-
}
|
|
12125
|
-
</div>
|
|
12126
|
-
</div>
|
|
12127
|
-
</div>
|
|
12128
|
-
</div>
|
|
12129
|
-
</div>
|
|
12130
|
-
</div>
|
|
12131
|
-
</div>
|
|
12132
|
-
|
|
12133
|
-
<ng-content />
|
|
12134
|
-
`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
12135
|
-
}] });
|
|
12136
|
-
|
|
12137
|
-
class ScTabItem {
|
|
12138
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ScTabItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12139
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.2", type: ScTabItem, isStandalone: true, selector: "sc-tab-item", ngImport: i0, template: `
|
|
12140
|
-
<ng-content />
|
|
12141
|
-
`, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
12142
|
-
}
|
|
12143
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ScTabItem, decorators: [{
|
|
12144
|
-
type: Component,
|
|
12145
|
-
args: [{ selector: 'sc-tab-item', imports: [], template: `
|
|
12146
|
-
<ng-content />
|
|
12147
|
-
`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
12148
|
-
}] });
|
|
12149
|
-
|
|
12150
13018
|
const SC_TOAST_ID = new InjectionToken('SC_TOAST_ID');
|
|
12151
13019
|
|
|
12152
13020
|
class ToastService {
|
|
@@ -18802,5 +19670,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
|
|
|
18802
19670
|
* Generated bundle index. Do not edit.
|
|
18803
19671
|
*/
|
|
18804
19672
|
|
|
18805
|
-
export { HoverScrollbarComponent, ScAccordion, ScAccordionContent, ScAccordionHeader, ScAccordionItem, ScAccordionItemDescription, ScAccordionTrigger, ScAlert, ScAlertDescription, ScAlertDialogTrigger, ScAlertTitle, ScArticle, ScAspectRatio, ScAutoResizeInput, ScAutocomplete, ScAvatar, ScBadge, ScBlockquote, ScBreadcrumb, ScBreadcrumbEllipsis, ScBreadcrumbItem, ScBreadcrumbLink, ScBreadcrumbList, ScBreadcrumbPage, ScBreadcrumbSeparator, ScButton, ScButtonBase, ScCalendar, ScCard, ScCardContent, ScCardDescription, ScCardFooter, ScCardHeader, ScCardTitle, ScCarousel, ScCarouselContainer, ScCarouselItem, ScCarouselItems, ScCarouselNext, ScCarouselPrevious, ScCheckbox, ScCheckbox2, ScCheckboxContainer, ScCheckboxField, ScCheckboxGroup, ScCheckboxItem, ScCircularProgress, ScClockPicker, ScClockPicker2, ScCodeHighlighter, ScCollapsible, ScCollapsibleContent, ScCollapsibleTrigger, ScColorPicker, ScCombobox, ScCommand, ScCommandDialog, ScCommandEmpty, ScCommandError, ScCommandGroup, ScCommandInput, ScCommandItem, ScCommandList, ScCommandLoading, ScCommandSeparator, ScCommandShortcut, ScComments, ScConfirmationDialog, ScContextMenuTriggerFor, ScCookieConsent, ScDataTable, ScDatePicker, ScDatePickerToggle, ScDateRangePicker, ScDescription, ScDialog, ScDialogClose, ScDialogContent, ScDialogDescription, ScDialogFooter, ScDialogHeader, ScDialogTitle, ScDualRangeSlider, ScEditor, ScEditorBlockquote, ScEditorBold, ScEditorBulletList, ScEditorCode, ScEditorGroup, ScEditorHighlight, ScEditorHorizontalRule, ScEditorItalic, ScEditorOrderedList, ScEditorParagraph, ScEditorRedo, ScEditorStrike, ScEditorTextAlignCenter, ScEditorTextAlignLeft, ScEditorTextAlignRight, ScEditorToolbar, ScEditorUnderline, ScEditorUndo, ScEditorUnsetLink, ScErrorMessage, ScExtensionColor, ScExtensionFontFamily, ScExtensionHeading, ScExtensionImage, ScExtensionLink, ScExtensionTable, ScExtensionTextStyle, ScExtensionYoutube, ScField, ScFieldset, ScFileUpload, ScFullCalendar, ScHeading, ScHoverCard, ScHoverCardTriggerFor, ScImagePlaceholder, ScInput, ScInputGroup, ScInputNumber, ScInputNumberDecrementer, ScInputNumberGroup, ScInputNumberIncrementer, ScInputOTPGroup, ScInputOTPSeparator, ScInputOTPSlot, ScInputOtp, ScInputPassword, ScLabel, ScLegend, ScLink, ScMenu, ScMenuBar, ScMenuBarItem, ScMenuCheckboxGroup, ScMenuCheckboxItem, ScMenuGroup, ScMenuItem, ScMenuLabel, ScMenuRadioGroup, ScMenuRadioItem, ScMenuSeparator, ScMenuShortcut, ScMenuTriggerFor, ScMobileCalendar, ScMultiSelect, ScNav, ScNavItem, ScNavItemDropdown, ScNavLink, ScNavList, ScOnThisPage, ScOption, ScPageDescription, ScPageSizeSelect, ScPageSubtitle, ScPageTitle, ScPagination, ScPaginationEllipsis, ScPaginationFirst, ScPaginationLast, ScPaginationLink, ScPaginationList, ScPaginationNext, ScPaginationPrevious, ScPaginator, ScPaginatorContainer, ScPlainInput, ScPopoverTriggerFor, ScProgress, ScRadioGroup, ScRadioItem, ScRangeCalendar, ScRangeSlider, ScRating, ScScrollArea, ScScrollSpy, ScScrollToTop, ScScrollToTopButton, ScSelect, ScSeparator, ScSettings, ScSheet, ScSheetClose, ScSheetConfig, ScSheetTrigger, ScSidebar, ScSidebarContent, ScSidebarGroup, ScSidebarGroupAction, ScSidebarGroupContent, ScSidebarGroupLabel, ScSidebarMenu, ScSidebarMenuButton, ScSidebarMenuItem, ScSidebarMenuLink, ScSidebarProvider, ScSidebarState, ScSidebarToggler, ScSkeleton, ScSlider, ScStep, ScStepper, ScSwitch, ScTab, ScTabContent,
|
|
19673
|
+
export { FlexibleScrollAreaComponent, HorizontalScrollAreaComponent, HoverScrollbarComponent, ScAccordion, ScAccordionContent, ScAccordionHeader, ScAccordionItem, ScAccordionItemDescription, ScAccordionTrigger, ScAlert, ScAlertDescription, ScAlertDialogTrigger, ScAlertTitle, ScArticle, ScAspectRatio, ScAutoResizeInput, ScAutocomplete, ScAvatar, ScBadge, ScBlockquote, ScBreadcrumb, ScBreadcrumbEllipsis, ScBreadcrumbItem, ScBreadcrumbLink, ScBreadcrumbList, ScBreadcrumbPage, ScBreadcrumbSeparator, ScButton, ScButtonBase, ScCalendar, ScCard, ScCardContent, ScCardDescription, ScCardFooter, ScCardHeader, ScCardTitle, ScCarousel, ScCarouselContainer, ScCarouselItem, ScCarouselItems, ScCarouselNext, ScCarouselPrevious, ScCheckbox, ScCheckbox2, ScCheckboxContainer, ScCheckboxField, ScCheckboxGroup, ScCheckboxItem, ScCircularProgress, ScClockPicker, ScClockPicker2, ScCodeHighlighter, ScCollapsible, ScCollapsibleContent, ScCollapsibleTrigger, ScColorPicker, ScCombobox, ScCommand, ScCommandDialog, ScCommandEmpty, ScCommandError, ScCommandGroup, ScCommandInput, ScCommandItem, ScCommandList, ScCommandLoading, ScCommandSeparator, ScCommandShortcut, ScComments, ScConfirmationDialog, ScContextMenuTriggerFor, ScCookieConsent, ScDataTable, ScDatePicker, ScDatePickerToggle, ScDateRangePicker, ScDescription, ScDialog, ScDialogClose, ScDialogContent, ScDialogDescription, ScDialogFooter, ScDialogHeader, ScDialogTitle, ScDualRangeSlider, ScEditor, ScEditorBlockquote, ScEditorBold, ScEditorBulletList, ScEditorCode, ScEditorGroup, ScEditorHighlight, ScEditorHorizontalRule, ScEditorItalic, ScEditorOrderedList, ScEditorParagraph, ScEditorRedo, ScEditorStrike, ScEditorTextAlignCenter, ScEditorTextAlignLeft, ScEditorTextAlignRight, ScEditorToolbar, ScEditorUnderline, ScEditorUndo, ScEditorUnsetLink, ScErrorMessage, ScExtensionColor, ScExtensionFontFamily, ScExtensionHeading, ScExtensionImage, ScExtensionLink, ScExtensionTable, ScExtensionTextStyle, ScExtensionYoutube, ScField, ScFieldset, ScFileUpload, ScFullCalendar, ScHeading, ScHoverCard, ScHoverCardTriggerFor, ScImagePlaceholder, ScInput, ScInputGroup, ScInputNumber, ScInputNumberDecrementer, ScInputNumberGroup, ScInputNumberIncrementer, ScInputOTPGroup, ScInputOTPSeparator, ScInputOTPSlot, ScInputOtp, ScInputPassword, ScLabel, ScLegend, ScLink, ScMenu, ScMenuBar, ScMenuBarItem, ScMenuCheckboxGroup, ScMenuCheckboxItem, ScMenuGroup, ScMenuItem, ScMenuLabel, ScMenuRadioGroup, ScMenuRadioItem, ScMenuSeparator, ScMenuShortcut, ScMenuTriggerFor, ScMobileCalendar, ScMultiSelect, ScNav, ScNavItem, ScNavItemDropdown, ScNavLink, ScNavList, ScOnThisPage, ScOption, ScPageDescription, ScPageSizeSelect, ScPageSubtitle, ScPageTitle, ScPagination, ScPaginationEllipsis, ScPaginationFirst, ScPaginationLast, ScPaginationLink, ScPaginationList, ScPaginationNext, ScPaginationPrevious, ScPaginator, ScPaginatorContainer, ScPlainInput, ScPopoverTriggerFor, ScProgress, ScRadioGroup, ScRadioItem, ScRangeCalendar, ScRangeSlider, ScRating, ScScrollArea, ScScrollSpy, ScScrollToTop, ScScrollToTopButton, ScSelect, ScSeparator, ScSettings, ScSheet, ScSheetClose, ScSheetConfig, ScSheetTrigger, ScSidebar, ScSidebarContent, ScSidebarGroup, ScSidebarGroupAction, ScSidebarGroupContent, ScSidebarGroupLabel, ScSidebarMenu, ScSidebarMenuButton, ScSidebarMenuItem, ScSidebarMenuLink, ScSidebarProvider, ScSidebarState, ScSidebarToggler, ScSkeleton, ScSlider, ScStep, ScStepper, ScSwitch, ScTab, ScTabContent, ScTabLabel, ScTable, ScTableBody, ScTableCaption, ScTableCell, ScTableContainer, ScTableFooter, ScTableHeader, ScTableHeaderGroup, ScTableOfContents, ScTableRow, ScTabs, ScTags, ScTextarea, ScThemeToggler, ScTimePicker, ScTimePicker2, ScToast, ScToastAction, ScToastClose, ScToastContent, ScToastDescription, ScToastTitle, ScToggle, ScToggleGroup, ScToggleGroupItem, ScToggleSwitch, ScTooltip, ScTouchArea, ScWeekView, ScrollAreaComponent, Section, Toaster, buttonVariants, scArticleClasses, scInputStyles, scThemeProvider };
|
|
18806
19674
|
//# sourceMappingURL=semantic-components-ui.mjs.map
|