@sneat/extensions-schedulus-shared 0.3.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/esm2022/index.js +2 -0
- package/esm2022/index.js.map +1 -0
- package/esm2022/lib/components/calendar/calendar-base.component.js +83 -0
- package/esm2022/lib/components/calendar/calendar-base.component.js.map +1 -0
- package/esm2022/lib/components/calendar/calendar-brief.component.js +57 -0
- package/esm2022/lib/components/calendar/calendar-brief.component.js.map +1 -0
- package/esm2022/lib/components/calendar/calendar-component-types.js +2 -0
- package/esm2022/lib/components/calendar/calendar-component-types.js.map +1 -0
- package/esm2022/lib/components/calendar/calendar-state.service.js +90 -0
- package/esm2022/lib/components/calendar/calendar-state.service.js.map +1 -0
- package/esm2022/lib/components/calendar/calendar.component.js +284 -0
- package/esm2022/lib/components/calendar/calendar.component.js.map +1 -0
- package/esm2022/lib/components/calendar/components/calendar-add-buttons/calendar-add-buttons.component.js +45 -0
- package/esm2022/lib/components/calendar/components/calendar-add-buttons/calendar-add-buttons.component.js.map +1 -0
- package/esm2022/lib/components/calendar/components/calendar-day/calendar-day-base.component.js +26 -0
- package/esm2022/lib/components/calendar/components/calendar-day/calendar-day-base.component.js.map +1 -0
- package/esm2022/lib/components/calendar/components/calendar-day/calendar-day-card.component.js +67 -0
- package/esm2022/lib/components/calendar/components/calendar-day/calendar-day-card.component.js.map +1 -0
- package/esm2022/lib/components/calendar/components/calendar-day/calendar-day-tab.component.js +74 -0
- package/esm2022/lib/components/calendar/components/calendar-day/calendar-day-tab.component.js.map +1 -0
- package/esm2022/lib/components/calendar/components/calendar-day/calendar-day-title.component.js +27 -0
- package/esm2022/lib/components/calendar/components/calendar-day/calendar-day-title.component.js.map +1 -0
- package/esm2022/lib/components/calendar/components/calendar-day/calendar-day.component.js +129 -0
- package/esm2022/lib/components/calendar/components/calendar-day/calendar-day.component.js.map +1 -0
- package/esm2022/lib/components/calendar/components/calendar-filter/calendar-filter.component.js +162 -0
- package/esm2022/lib/components/calendar/components/calendar-filter/calendar-filter.component.js.map +1 -0
- package/esm2022/lib/components/calendar/components/calendar-filter/calendar-filter.js +17 -0
- package/esm2022/lib/components/calendar/components/calendar-filter/calendar-filter.js.map +1 -0
- package/esm2022/lib/components/calendar/components/calendar-filter/contacts-filter.component.js +95 -0
- package/esm2022/lib/components/calendar/components/calendar-filter/contacts-filter.component.js.map +1 -0
- package/esm2022/lib/components/calendar/components/calendar-week/calendar-week-card.component.js +50 -0
- package/esm2022/lib/components/calendar/components/calendar-week/calendar-week-card.component.js.map +1 -0
- package/esm2022/lib/components/calendar/components/calendar-week/calendar-week-tab.component.js +18 -0
- package/esm2022/lib/components/calendar/components/calendar-week/calendar-week-tab.component.js.map +1 -0
- package/esm2022/lib/components/calendar/components/calendar-week/calendar-week-title.component.js +15 -0
- package/esm2022/lib/components/calendar/components/calendar-week/calendar-week-title.component.js.map +1 -0
- package/esm2022/lib/components/calendar/components/calendar-week/calendar-week.component.js +78 -0
- package/esm2022/lib/components/calendar/components/calendar-week/calendar-week.component.js.map +1 -0
- package/esm2022/lib/components/calendar/components/calendar-weekday/calendar-weekday.component.js +66 -0
- package/esm2022/lib/components/calendar/components/calendar-weekday/calendar-weekday.component.js.map +1 -0
- package/esm2022/lib/components/calendar/components/day-slot-item/day-slot-item.component.js +93 -0
- package/esm2022/lib/components/calendar/components/day-slot-item/day-slot-item.component.js.map +1 -0
- package/esm2022/lib/components/calendar/components/day-slot-item/slot-context-menu.component.js +324 -0
- package/esm2022/lib/components/calendar/components/day-slot-item/slot-context-menu.component.js.map +1 -0
- package/esm2022/lib/components/calendar/components/recurrings-tab/recurrings-tab.component.js +36 -0
- package/esm2022/lib/components/calendar/components/recurrings-tab/recurrings-tab.component.js.map +1 -0
- package/esm2022/lib/components/calendar/components/singles-tab/single-happenings-list.component.js +65 -0
- package/esm2022/lib/components/calendar/components/singles-tab/single-happenings-list.component.js.map +1 -0
- package/esm2022/lib/components/calendar/components/singles-tab/singles-tab.component.js +106 -0
- package/esm2022/lib/components/calendar/components/singles-tab/singles-tab.component.js.map +1 -0
- package/esm2022/lib/components/calendar/components/timing-badge/timing-badge.component.js +25 -0
- package/esm2022/lib/components/calendar/components/timing-badge/timing-badge.component.js.map +1 -0
- package/esm2022/lib/components/calendar/weekday.js +2 -0
- package/esm2022/lib/components/calendar/weekday.js.map +1 -0
- package/esm2022/lib/components/calendar-core.js +64 -0
- package/esm2022/lib/components/calendar-core.js.map +1 -0
- package/esm2022/lib/components/calendar-filter.service.js +28 -0
- package/esm2022/lib/components/calendar-filter.service.js.map +1 -0
- package/esm2022/lib/components/calendar-slots.js +30 -0
- package/esm2022/lib/components/calendar-slots.js.map +1 -0
- package/esm2022/lib/components/happening-base.component.js +188 -0
- package/esm2022/lib/components/happening-base.component.js.map +1 -0
- package/esm2022/lib/components/happening-card/happening-card.component.js +69 -0
- package/esm2022/lib/components/happening-card/happening-card.component.js.map +1 -0
- package/esm2022/lib/components/happening-component-base-params.js +37 -0
- package/esm2022/lib/components/happening-component-base-params.js.map +1 -0
- package/esm2022/lib/components/happening-form/happening-form.component.js +348 -0
- package/esm2022/lib/components/happening-form/happening-form.component.js.map +1 -0
- package/esm2022/lib/components/happening-form/happening-price-form/happening-price-modal.component.js +161 -0
- package/esm2022/lib/components/happening-form/happening-price-form/happening-price-modal.component.js.map +1 -0
- package/esm2022/lib/components/happening-form/happening-prices/happening-prices.component.js +142 -0
- package/esm2022/lib/components/happening-form/happening-prices/happening-prices.component.js.map +1 -0
- package/esm2022/lib/components/happening-participants/happening-participants.component.js +195 -0
- package/esm2022/lib/components/happening-participants/happening-participants.component.js.map +1 -0
- package/esm2022/lib/components/happening-slot-form/happening-slot-form.component.js +505 -0
- package/esm2022/lib/components/happening-slot-form/happening-slot-form.component.js.map +1 -0
- package/esm2022/lib/components/happening-slot-form/happening-slot-modal.component.js +140 -0
- package/esm2022/lib/components/happening-slot-form/happening-slot-modal.component.js.map +1 -0
- package/esm2022/lib/components/happening-slot-form/happening-slot-modal.service.js +47 -0
- package/esm2022/lib/components/happening-slot-form/happening-slot-modal.service.js.map +1 -0
- package/esm2022/lib/components/happening-slot-participants/happening-slot-participants.component.js +74 -0
- package/esm2022/lib/components/happening-slot-participants/happening-slot-participants.component.js.map +1 -0
- package/esm2022/lib/components/happening-slots/happening-slots.component.js +130 -0
- package/esm2022/lib/components/happening-slots/happening-slots.component.js.map +1 -0
- package/esm2022/lib/components/index.js +20 -0
- package/esm2022/lib/components/index.js.map +1 -0
- package/esm2022/lib/components/start-end-dates-range-form/start-end-dates-range-form.component.js +68 -0
- package/esm2022/lib/components/start-end-dates-range-form/start-end-dates-range-form.component.js.map +1 -0
- package/esm2022/lib/components/start-end-datetime-form/start-end-datetime-form.component.js +377 -0
- package/esm2022/lib/components/start-end-datetime-form/start-end-datetime-form.component.js.map +1 -0
- package/esm2022/lib/components/start-end-datetime-form/time-selector.component.js +92 -0
- package/esm2022/lib/components/start-end-datetime-form/time-selector.component.js.map +1 -0
- package/esm2022/lib/components/swipeable-base.component.js +112 -0
- package/esm2022/lib/components/swipeable-base.component.js.map +1 -0
- package/esm2022/lib/components/swipeable-ui.js +64 -0
- package/esm2022/lib/components/swipeable-ui.js.map +1 -0
- package/esm2022/lib/components/week.js +2 -0
- package/esm2022/lib/components/week.js.map +1 -0
- package/esm2022/lib/components/weekday-functions.js +13 -0
- package/esm2022/lib/components/weekday-functions.js.map +1 -0
- package/esm2022/lib/components/weekdays/weekdays-form-base.js +72 -0
- package/esm2022/lib/components/weekdays/weekdays-form-base.js.map +1 -0
- package/esm2022/lib/index.js +3 -0
- package/esm2022/lib/index.js.map +1 -0
- package/esm2022/lib/modals/happening-title-modal/happening-title-modal.component.js +87 -0
- package/esm2022/lib/modals/happening-title-modal/happening-title-modal.component.js.map +1 -0
- package/esm2022/lib/services/calendar-data-provider.js +271 -0
- package/esm2022/lib/services/calendar-data-provider.js.map +1 -0
- package/esm2022/lib/services/calendar-day.js +179 -0
- package/esm2022/lib/services/calendar-day.js.map +1 -0
- package/esm2022/lib/services/calendar-day.service.js +37 -0
- package/esm2022/lib/services/calendar-day.service.js.map +1 -0
- package/esm2022/lib/services/calendar-nav.service.js +36 -0
- package/esm2022/lib/services/calendar-nav.service.js.map +1 -0
- package/esm2022/lib/services/calendar-space.js +152 -0
- package/esm2022/lib/services/calendar-space.js.map +1 -0
- package/esm2022/lib/services/calendar-types.js +52 -0
- package/esm2022/lib/services/calendar-types.js.map +1 -0
- package/esm2022/lib/services/calendarium-services.module.js +16 -0
- package/esm2022/lib/services/calendarium-services.module.js.map +1 -0
- package/esm2022/lib/services/calendarium-space.service.js +16 -0
- package/esm2022/lib/services/calendarium-space.service.js.map +1 -0
- package/esm2022/lib/services/happening.service.js +225 -0
- package/esm2022/lib/services/happening.service.js.map +1 -0
- package/esm2022/lib/services/index.js +6 -0
- package/esm2022/lib/services/index.js.map +1 -0
- package/esm2022/sneat-extensions-schedulus-shared.js +5 -0
- package/esm2022/sneat-extensions-schedulus-shared.js.map +1 -0
- package/index.d.ts +1 -0
- package/lib/components/calendar/calendar-base.component.d.ts +23 -0
- package/lib/components/calendar/calendar-brief.component.d.ts +11 -0
- package/lib/components/calendar/calendar-component-types.d.ts +1 -0
- package/lib/components/calendar/calendar-state.service.d.ts +15 -0
- package/lib/components/calendar/calendar.component.d.ts +32 -0
- package/lib/components/calendar/components/calendar-add-buttons/calendar-add-buttons.component.d.ts +13 -0
- package/lib/components/calendar/components/calendar-day/calendar-day-base.component.d.ts +10 -0
- package/lib/components/calendar/components/calendar-day/calendar-day-card.component.d.ts +17 -0
- package/lib/components/calendar/components/calendar-day/calendar-day-tab.component.d.ts +19 -0
- package/lib/components/calendar/components/calendar-day/calendar-day-title.component.d.ts +10 -0
- package/lib/components/calendar/components/calendar-day/calendar-day.component.d.ts +30 -0
- package/lib/components/calendar/components/calendar-filter/calendar-filter.component.d.ts +39 -0
- package/lib/components/calendar/components/calendar-filter/calendar-filter.d.ts +10 -0
- package/lib/components/calendar/components/calendar-filter/contacts-filter.component.d.ts +20 -0
- package/lib/components/calendar/components/calendar-week/calendar-week-card.component.d.ts +15 -0
- package/lib/components/calendar/components/calendar-week/calendar-week-tab.component.d.ts +9 -0
- package/lib/components/calendar/components/calendar-week/calendar-week-title.component.d.ts +7 -0
- package/lib/components/calendar/components/calendar-week/calendar-week.component.d.ts +20 -0
- package/lib/components/calendar/components/calendar-weekday/calendar-weekday.component.d.ts +23 -0
- package/lib/components/calendar/components/day-slot-item/day-slot-item.component.d.ts +19 -0
- package/lib/components/calendar/components/day-slot-item/slot-context-menu.component.d.ts +40 -0
- package/lib/components/calendar/components/recurrings-tab/recurrings-tab.component.d.ts +15 -0
- package/lib/components/calendar/components/singles-tab/single-happenings-list.component.d.ts +22 -0
- package/lib/components/calendar/components/singles-tab/singles-tab.component.d.ts +29 -0
- package/lib/components/calendar/components/timing-badge/timing-badge.component.d.ts +17 -0
- package/lib/components/calendar/weekday.d.ts +7 -0
- package/lib/components/calendar-core.d.ts +10 -0
- package/lib/components/calendar-filter.service.d.ts +8 -0
- package/lib/components/calendar-slots.d.ts +5 -0
- package/lib/components/happening-base.component.d.ts +46 -0
- package/lib/components/happening-card/happening-card.component.d.ts +11 -0
- package/lib/components/happening-component-base-params.d.ts +16 -0
- package/lib/components/happening-form/happening-form.component.d.ts +52 -0
- package/lib/components/happening-form/happening-price-form/happening-price-modal.component.d.ts +29 -0
- package/lib/components/happening-form/happening-prices/happening-prices.component.d.ts +16 -0
- package/lib/components/happening-participants/happening-participants.component.d.ts +24 -0
- package/lib/components/happening-slot-form/happening-slot-form.component.d.ts +76 -0
- package/lib/components/happening-slot-form/happening-slot-modal.component.d.ts +26 -0
- package/lib/components/happening-slot-form/happening-slot-modal.service.d.ts +18 -0
- package/lib/components/happening-slot-participants/happening-slot-participants.component.d.ts +19 -0
- package/lib/components/happening-slots/happening-slots.component.d.ts +28 -0
- package/lib/components/index.d.ts +5 -0
- package/lib/components/start-end-dates-range-form/start-end-dates-range-form.component.d.ts +16 -0
- package/lib/components/start-end-datetime-form/start-end-datetime-form.component.d.ts +53 -0
- package/lib/components/start-end-datetime-form/time-selector.component.d.ts +15 -0
- package/lib/components/swipeable-base.component.d.ts +25 -0
- package/lib/components/swipeable-ui.d.ts +24 -0
- package/lib/components/week.d.ts +4 -0
- package/lib/components/weekday-functions.d.ts +3 -0
- package/lib/components/weekdays/weekdays-form-base.d.ts +31 -0
- package/lib/index.d.ts +2 -0
- package/lib/modals/happening-title-modal/happening-title-modal.component.d.ts +24 -0
- package/lib/services/calendar-data-provider.d.ts +33 -0
- package/lib/services/calendar-day.d.ts +45 -0
- package/lib/services/calendar-day.service.d.ts +18 -0
- package/lib/services/calendar-nav.service.d.ts +14 -0
- package/lib/services/calendar-space.d.ts +23 -0
- package/lib/services/calendar-types.d.ts +10 -0
- package/lib/services/calendarium-services.module.d.ts +6 -0
- package/lib/services/calendarium-space.service.d.ts +8 -0
- package/lib/services/happening.service.d.ts +99 -0
- package/lib/services/index.d.ts +5 -0
- package/package.json +26 -0
- package/sneat-extensions-schedulus-shared.d.ts +5 -0
- package/tsconfig.lib.prod.tsbuildinfo +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.component.js","sourceRoot":"","sources":["../../../../../../../../../libs/extensions/schedulus/shared/src/lib/components/calendar/calendar.component.ts","../../../../../../../../../libs/extensions/schedulus/shared/src/lib/components/calendar/calendar.component.html"],"names":[],"mappings":"AAAA,OAAO,EAEL,uBAAuB,EACvB,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,KAAK,EAIL,MAAM,EACN,MAAM,EAEN,SAAS,EACT,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,QAAQ,EACR,UAAU,EACV,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,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B;YACrB,oBAAoB;YACpB,uBAAuB;YACvB,qBAAqB;SACtB,0MCpEH,uoEAiEA,0GDdI,mBAAmB,uIACnB,sBAAsB,yIACtB,wBAAwB,2FACxB,uBAAuB,0FACvB,uBAAuB,mHACvB,WAAW,8VACX,wBAAwB,+BACxB,UAAU,uJACV,gBAAgB,qIAChB,QAAQ;;2FAcC,iBAAiB;kBAzB7B,SAAS;8BACC;wBACP,mBAAmB;wBACnB,sBAAsB;wBACtB,wBAAwB;wBACxB,uBAAuB;wBACvB,uBAAuB;wBACvB,WAAW;wBACX,wBAAwB;wBACxB,UAAU;wBACV,gBAAgB;wBAChB,QAAQ;qBACT,aACU;wBACT,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,mBAAmB,EAAE;wBACrD,qBAAqB;wBACrB,oBAAoB;wBACpB,uBAAuB;wBACvB,qBAAqB;qBACtB,mBACgB,uBAAuB,CAAC,MAAM,YACrC,gBAAgB;;sBAezB,SAAS;uBAAC,yBAAyB;;sBAGnC,KAAK;;sBACL,KAAK;;sBAEL,MAAM;;sBACN,MAAM","sourcesContent":["import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n signal,\n SimpleChanges,\n ViewChild,\n inject,\n} from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport {\n IonLabel,\n IonSegment,\n IonSegmentButton,\n} from '@ionic/angular/standalone';\nimport { IMemberContext } from '@sneat/contactus-core';\nimport { ContactusSpaceService } from '@sneat/contactus-services';\nimport { localDateToIso } from '@sneat/core';\nimport {\n IHappeningSlot,\n WeekdayCode2,\n IHappeningWithUiState,\n} from '@sneat/mod-schedulus-core';\nimport { ClassName } from '@sneat/ui';\nimport { takeUntil } from 'rxjs';\nimport { CalendarDayServiceModule } from '../../services/calendar-day.service';\nimport { CalendariumSpaceService } from '../../services/calendarium-space.service';\nimport {\n emptyCalendarFilter,\n CalendarFilterService,\n} from '../calendar-filter.service';\nimport { hasContact } from '../calendar-slots';\nimport { CalendarBaseComponent } from './calendar-base.component';\nimport { CalendarTab } from './calendar-component-types';\nimport { CalendarDayTabComponent } from './components/calendar-day/calendar-day-tab.component';\nimport { ICalendarFilter } from './components/calendar-filter/calendar-filter';\nimport { CalendarFilterComponent } from './components/calendar-filter/calendar-filter.component';\nimport { CalendarStateService } from './calendar-state.service';\nimport { CalendarWeekTabComponent } from './components/calendar-week/calendar-week-tab.component';\nimport { RecurringsTabComponent } from './components/recurrings-tab/recurrings-tab.component';\nimport { SinglesTabComponent } from './components/singles-tab/singles-tab.component';\n\n@Component({\n imports: [\n SinglesTabComponent,\n RecurringsTabComponent,\n CalendarWeekTabComponent,\n CalendarDayTabComponent,\n CalendarFilterComponent,\n FormsModule,\n CalendarDayServiceModule,\n IonSegment,\n IonSegmentButton,\n IonLabel,\n ],\n providers: [\n { provide: ClassName, useValue: 'CalendarComponent' },\n CalendarFilterService,\n CalendarStateService,\n CalendariumSpaceService,\n ContactusSpaceService,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'sneat-calendar',\n templateUrl: './calendar.component.html',\n styleUrls: ['./calendar.component.scss'],\n})\nexport class CalendarComponent\n extends CalendarBaseComponent\n implements OnInit, AfterViewInit, OnChanges, OnDestroy\n{\n private readonly filterService = inject(CalendarFilterService);\n private readonly calendarStateService = inject(CalendarStateService);\n\n private readonly $filter = signal(emptyCalendarFilter);\n\n // prevWeekdays: SlotsGroup[];\n\n @ViewChild('calendarFilterComponent')\n public calendarFilterComponent?: CalendarFilterComponent;\n\n @Input() member?: IMemberContext; // TODO: rename to contact?\n @Input() public tab: CalendarTab = 'day';\n\n @Output() readonly tabChanged = new EventEmitter<CalendarTab>();\n @Output() readonly dateChanged = new EventEmitter<string>();\n\n protected readonly $isWeekTabActivated = signal(false);\n\n protected readonly $recurrings = computed<\n readonly IHappeningWithUiState[] | undefined\n >(() => this.filterRecurrings(this.$filter(), this.$allRecurrings()));\n\n public constructor() {\n super();\n\n // setTimeout(() => {\n // \t// TODO: Fix this dirty workaround for initial animations\n // \tthis.setToday();\n // }, 10);\n }\n\n public ngOnInit(): void {\n this.filterService.filter.pipe(takeUntil(this.destroyed$)).subscribe({\n next: (filter) => {\n this.$filter.set(filter);\n },\n error: this.errorLogger.logErrorHandler('failed to get calendar filter'),\n });\n\n this.calendarStateService.dateChanged.subscribe({\n next: (changed) => {\n const { date } = changed;\n this.$date.set(date);\n },\n });\n setTimeout(() => this.$isWeekTabActivated.set(true), 500);\n }\n\n ngAfterViewInit(): void /* TODO: check and document if it can't be ngOnInit */ {\n this.tabChanged.emit(this.tab);\n }\n\n protected segmentChanged(_event?: Event): void {\n this.$isWeekTabActivated.set(true);\n history.replaceState(\n history.state,\n document.title,\n window.location.href.replace(/tab=\\w+/, `tab=${this.tab}`),\n );\n switch (this.tab) {\n case 'week':\n // if (this.activeDay.date) {\n // \tthis.setDay('segmentChanged', this.activeDay.date);\n // } else {\n // \tthrow new Error('activeDay has no date');\n // }\n break;\n case 'singles':\n // this.slotsProvider.loadTodayAndFutureEvents(undefined)\n // \t.subscribe({\n // \t\terror: this.errorLogger.logError,\n // \t\tnext: events => {\n // \t\t\tconst slotGroupsByDate: { [dateKey: string]: SlotsGroup } = {};\n // \t\t\tevents.forEach(event => {\n // \t\t\t\tconst eventStartDate = new Date(event.dtStarts);\n // \t\t\t\tconst dateKey = localDateToIso(eventStartDate);\n // \t\t\t\tlet slotGroup = slotGroupsByDate[dateKey];\n // \t\t\t\tif (!slotGroup) {\n // \t\t\t\t\tconst wd = 'we'; // TODO: why Wednesday?\n // \t\t\t\t\tslotGroupsByDate[dateKey] = slotGroup = {\n // \t\t\t\t\t\twd,\n // \t\t\t\t\t\tdate: eventStartDate,\n // \t\t\t\t\t\ttitle: wdCodeToWeekdayName(wd),\n // \t\t\t\t\t\tslots: [],\n // \t\t\t\t\t};\n // \t\t\t\t}\n // \t\t\t\tslotGroup.slots.push(eventToSlot(event));\n // \t\t\t});\n // \t\t\tthis.todayAndFutureEvents = Object.values(slotGroupsByDate);\n // \t\t},\n // \t});\n break;\n default:\n break;\n }\n }\n\n // readonly goNewHappening = (params: NewHappeningParams): void => {\n // \tconst { type, wd, date } = params;\n //\n // \tconst state: { type?: HappeningType; date?: string; wd?: WeekdayCode2 } = { type };\n //\n // \tif (date) {\n // \t\t// tslint:disable-next-line:no-non-null-assertion\n // \t\tstate.date = date;\n // \t} else if (wd) {\n // \t\tstate.wd = wd;\n // \t} else if (this.tab === 'day') {\n // \t\tstate.date = dateToIso(this.date);\n // \t}\n // \tif (!this.team) {\n // \t\tthis.errorLogger.logError('!this.team');\n // \t\treturn;\n // \t}\n // \tthis.params.teamNavService\n // \t\t.navigateForwardToSpacePage(this.space, 'new-happening', {\n // \t\t\tqueryParams: params,\n // \t\t})\n // \t\t.catch(this.errorLogger.logErrorHandler('failed to navigate to new happening page'));\n // };\n\n protected readonly onDateSelected = (date: Date): void => {\n this.tab = 'day';\n this.setDay('onDateSelected', date);\n };\n\n // get inactiveDay(): Day {\n // return this.activeDayParity === 'odd' ? this.evenDay : this.oddDay;\n // }\n\n // noinspection JSMethodCanBeStatic\n\n // noinspection JSMethodCanBqw2se3333eStatic\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes['tab'] && this.tab === 'week') {\n this.$isWeekTabActivated.set(true);\n }\n }\n\n // We filter recurring at calendar level, so we can share it across different components?\n private filterRecurrings(\n filter: ICalendarFilter,\n allRecurring?: readonly IHappeningWithUiState[],\n ): readonly IHappeningWithUiState[] | undefined {\n const text = filter.text.toLowerCase();\n\n const filtered = allRecurring?.filter((r) => {\n const title = r.brief?.title || r.dbo?.title;\n let hide = '';\n\n if (!hide && title && !title.trim().toLowerCase().includes(text)) {\n hide = 'title';\n }\n if (\n !hide &&\n (!r.brief ||\n !hasContact(r.space.id, filter.contactIDs, r.brief.related))\n ) {\n hide = 'contactIDs';\n }\n const slots = r.dbo?.slots || r.brief?.slots;\n if (!hide && !this.hasWeekday(slots, filter.weekdays)) {\n hide = 'weekdays';\n }\n if (!hide && !this.hasRepeats(filter.repeats, slots)) {\n hide = 'repeats';\n }\n return !hide;\n });\n return filtered;\n }\n\n // noinspection JSMethodCanBeStatic\n\n private hasRepeats(\n repeats: readonly string[],\n slots?: Readonly<Record<string, IHappeningSlot>>,\n ): boolean {\n return (\n !repeats.length ||\n (!!slots &&\n Object.values(slots).some((slot) => repeats.includes(slot.repeats)))\n );\n }\n\n private hasWeekday(\n slots: Readonly<Record<string, IHappeningSlot>> | undefined,\n weekdays: readonly WeekdayCode2[],\n ): boolean {\n return (\n !weekdays.length ||\n (!!slots &&\n Object.values(slots).some((slot) =>\n slot.weekdays?.some((wd) => weekdays.includes(wd)),\n ))\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected onDayChanged(d: Date): void {\n this.changeBrowserURL();\n // this.setSlidesAnimationState();\n //\n // this.activeDay.changeDate(d);\n //\n // this.activeWeek.activeDate = d;\n // const { tab } = this;\n // const activeWd = jsDayToWeekday(d.getDay() as wdNumber);\n // const datesToPreload: Date[] = [];\n // const datesToLoad: Day[] = [];\n // activeWeek.weekdays.forEach((weekday) => {\n // \tconst weekdayDate = getWdDate(weekday.wd, activeWd, d);\n // \tif (!weekday.date || weekday.date.getTime() !== weekdayDate.getTime() || !weekday.slots) {\n // \t\t// console.log('weekday.date !== weekdayDate', weekday.date, weekdayDate);\n // \t\tweekday = { ...weekday, date: weekdayDate };\n // \t\tif (tab === 'week' || tab === 'day' && weekday.wd === activeWd) {\n // \t\t\tdatesToLoad.push(weekday);\n // \t\t\t// tslint:disable-next-line:no-magic-numbers\n // \t\t\tconst diff = tab === 'day' ? SHIFT_1_DAY : SHIFT_1_WEEK;\n // \t\t\tconst wdDate = weekday.date;\n // \t\t\tif (wdDate) {\n // \t\t\t\tdatesToPreload.push(new Date(wdDate.getFullYear(), wdDate.getMonth(), wdDate.getDate() + diff));\n // \t\t\t\tdatesToPreload.push(new Date(wdDate.getFullYear(), wdDate.getMonth(), wdDate.getDate() - diff));\n // \t\t\t}\n // \t\t\tif (tab === 'day') {\n // \t\t\t\tconst activeWeekDaysToPreload = activeWeek.weekdays\n // \t\t\t\t\t.filter(wd =>\n // \t\t\t\t\t\t!wd.date ||\n // \t\t\t\t\t\t// tslint:disable-next-line:no-non-null-assertion\n // \t\t\t\t\t\t!datesToPreload.some(dtp => dtp.getTime() === wd.date?.getTime()));\n // \t\t\t\tactiveWeekDaysToPreload.forEach(wd => {\n // \t\t\t\t\tif (!wd.date) {\n // \t\t\t\t\t\t// wd.date = weekdayDate;\n // \t\t\t\t\t\t// this.errorLogger.logError('not implemented yet: !wd.date');\n // \t\t\t\t\t\tconsole.error('not implemented yet: !wd.date');\n // \t\t\t\t\t} else {\n // \t\t\t\t\t\tdatesToPreload.push(wd.date);\n // \t\t\t\t\t}\n // \t\t\t\t});\n // \t\t\t}\n // \t\t}\n // \t}\n // \tif (weekday.wd === activeWd) {\n // \t\tthis.activeDay.weekday = weekday;\n // \t}\n // });\n //\n // console.log(`segment=${tab}, datesToPreload:`, datesToPreload);\n // if (this.team) {\n // \tthis.slotsProvider.getDays(...datesToLoad)\n // \t\t.pipe(\n // \t\t\ttakeUntil(this.destroyed),\n // \t\t)\n // \t\t.subscribe({\n // \t\t\terror: this.errorLogger.logErrorHandler('failed to get days'),\n // \t\t});\n // }\n // this.slotsProvider.preloadEvents(tx, ...datesToPreload),\n }\n\n private changeBrowserURL(): void {\n if (this.$isToday()) {\n history.replaceState(\n history.state,\n document.title,\n window.location.href.replace(/&date=\\d{4}-\\d{2}-\\d{2}/, ''),\n );\n } else {\n const isoDate = `&date=${localDateToIso(this.$date())}`;\n if (!window.location.href.includes('&date')) {\n history.replaceState(\n history.state,\n document.title,\n window.location.href + isoDate,\n );\n } else {\n history.replaceState(\n history.state,\n document.title,\n window.location.href.replace(/&date=\\d{4}-\\d{2}-\\d{2}/, isoDate),\n );\n }\n }\n }\n}\n","<ion-segment [(ngModel)]=\"tab\" (ionChange)=\"segmentChanged($event)\">\n <ion-segment-button value=\"day\">\n <ion-label class=\"smaller\">📅 Day</ion-label>\n </ion-segment-button>\n <ion-segment-button value=\"week\">\n <ion-label class=\"smaller\">🗓️ Week</ion-label>\n </ion-segment-button>\n <ion-segment-button value=\"recurrings\">\n <ion-label class=\"smaller\">🔁 Repeats</ion-label>\n </ion-segment-button>\n <ion-segment-button value=\"singles\">\n <ion-label class=\"smaller\">1️⃣-timers</ion-label>\n </ion-segment-button>\n</ion-segment>\n\n<sneat-calendar-filter\n #calendarFilterComponent\n [space]=\"$space()\"\n [showWeekdays]=\"tab === 'recurrings'\"\n [showRepeats]=\"tab === 'recurrings'\"\n/>\n\n<!--\nWe use style.display instead of *ngIf to avoid re-creating of the component on tab re-activation.\nThis is just a small performance optimization.\n-->\n<sneat-day-tab\n [style.display]=\"tab === 'day' ? 'block' : 'none'\"\n [$space]=\"$space()\"\n [$spaceDaysProvider]=\"spaceDaysProvider\"\n/>\n\n<!--\nWe use *ngIf instead of [style.display] to avoid rendering of the tab when it's not visible.\nThis is due to weird bug that affects user service onSnapshot not retuning user data\nwhen we have more than 1 week components (odd/event for slider).\nThis is probably due to the fact that we open 14 listeners (1 for each day of 2 weeks) and Firestore is not able to handle that many listeners?\n\n[style.display]=\"tab === 'week' ? 'block' : 'none'\"\n-->\n@if ($isWeekTabActivated()) {\n <sneat-week-tab\n [style.display]=\"tab === 'week' ? 'block' : 'none'\"\n [$space]=\"$space()\"\n [$spaceDaysProvider]=\"spaceDaysProvider\"\n />\n}\n\n@switch (tab) {\n @case (\"recurrings\") {\n <sneat-recurrings-tab\n [$space]=\"$space()\"\n [$recurrings]=\"$recurrings()\"\n [$allRecurrings]=\"$allRecurrings()\"\n [$contactusSpace]=\"$contactusSpace()\"\n />\n }\n @case (\"singles\") {\n <sneat-singles-tab\n [$space]=\"$space()\"\n [onDateSelected]=\"onDateSelected\"\n [$contactusSpace]=\"$contactusSpace()\"\n />\n }\n}\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, input, inject, } from '@angular/core';
|
|
2
|
+
import { IonButton, IonButtons, IonIcon } from '@ionic/angular/standalone';
|
|
3
|
+
import { ScheduleNavService, } from '@sneat/mod-schedulus-core';
|
|
4
|
+
import { WithSpaceInput } from '@sneat/space-services';
|
|
5
|
+
import { ClassName } from '@sneat/ui';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export class CalendarAddButtonsComponent extends WithSpaceInput {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.scheduleNavService = inject(ScheduleNavService);
|
|
11
|
+
this.dateID = input.required(...(ngDevMode ? [{ debugName: "dateID" }] : []));
|
|
12
|
+
this.weekdayID = input.required(...(ngDevMode ? [{ debugName: "weekdayID" }] : []));
|
|
13
|
+
}
|
|
14
|
+
newHappeningUrl(type) {
|
|
15
|
+
const params = [];
|
|
16
|
+
if (this.weekdayID()) {
|
|
17
|
+
params.push(`wd=${this.weekdayID()}`);
|
|
18
|
+
}
|
|
19
|
+
const dateID = this.dateID();
|
|
20
|
+
if (dateID) {
|
|
21
|
+
params.push(`date=${dateID}`);
|
|
22
|
+
}
|
|
23
|
+
return (`space/${this.$spaceType()}/${this.$spaceID()}/new-happening?type=${type}` +
|
|
24
|
+
(params.length === 0 ? '' : `&${params.join('&')}`));
|
|
25
|
+
}
|
|
26
|
+
goNewHappening(event, type) {
|
|
27
|
+
const space = this.$space();
|
|
28
|
+
event.preventDefault();
|
|
29
|
+
event.stopPropagation();
|
|
30
|
+
const params = {
|
|
31
|
+
type,
|
|
32
|
+
wd: this.weekdayID() ? this.weekdayID() : undefined,
|
|
33
|
+
date: this.dateID() ? this.dateID() : undefined,
|
|
34
|
+
};
|
|
35
|
+
this.scheduleNavService.goNewHappening(space, params);
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CalendarAddButtonsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
39
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: CalendarAddButtonsComponent, isStandalone: true, selector: "sneat-calendar-add-buttons", inputs: { dateID: { classPropertyName: "dateID", publicName: "dateID", isSignal: true, isRequired: true, transformFunction: null }, weekdayID: { classPropertyName: "weekdayID", publicName: "weekdayID", isSignal: true, isRequired: true, transformFunction: null } }, providers: [{ provide: ClassName, useValue: 'CalendarAddButtonsComponent' }], usesInheritance: true, ngImport: i0, template: "<ion-buttons slot=\"end\" class=\"420\">\n <ion-button\n title=\"Add recurring\"\n [href]=\"newHappeningUrl('recurring')\"\n (click)=\"goNewHappening($event, 'recurring')\"\n >\n <ion-icon name=\"duplicate-outline\" />\n </ion-button>\n <ion-button\n title=\"Add one-timer\"\n [href]=\"newHappeningUrl('single')\"\n (click)=\"goNewHappening($event, 'single')\"\n >\n <ion-icon name=\"add-circle-outline\" />\n </ion-button>\n</ion-buttons>\n", dependencies: [{ kind: "component", type: IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
40
|
+
}
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CalendarAddButtonsComponent, decorators: [{
|
|
42
|
+
type: Component,
|
|
43
|
+
args: [{ selector: 'sneat-calendar-add-buttons', imports: [IonButtons, IonButton, IonIcon], providers: [{ provide: ClassName, useValue: 'CalendarAddButtonsComponent' }], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ion-buttons slot=\"end\" class=\"420\">\n <ion-button\n title=\"Add recurring\"\n [href]=\"newHappeningUrl('recurring')\"\n (click)=\"goNewHappening($event, 'recurring')\"\n >\n <ion-icon name=\"duplicate-outline\" />\n </ion-button>\n <ion-button\n title=\"Add one-timer\"\n [href]=\"newHappeningUrl('single')\"\n (click)=\"goNewHappening($event, 'single')\"\n >\n <ion-icon name=\"add-circle-outline\" />\n </ion-button>\n</ion-buttons>\n" }]
|
|
44
|
+
}], ctorParameters: () => [], propDecorators: { dateID: [{ type: i0.Input, args: [{ isSignal: true, alias: "dateID", required: true }] }], weekdayID: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekdayID", required: true }] }] } });
|
|
45
|
+
//# sourceMappingURL=calendar-add-buttons.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-add-buttons.component.js","sourceRoot":"","sources":["../../../../../../../../../../../libs/extensions/schedulus/shared/src/lib/components/calendar/components/calendar-add-buttons/calendar-add-buttons.component.ts","../../../../../../../../../../../libs/extensions/schedulus/shared/src/lib/components/calendar/components/calendar-add-buttons/calendar-add-buttons.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAIL,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;;AAStC,MAAM,OAAO,2BAA4B,SAAQ,cAAc;IAM7D;QACE,KAAK,EAAE,CAAC;QANO,uBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;QAEjD,WAAM,GAAG,KAAK,CAAC,QAAQ,iDAAsB,CAAC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BAA2B;kGAA3B,2BAA2B,kVAH3B,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,6BAA6B,EAAE,CAAC,iDCpB9E,ydAgBA,4CDGY,UAAU,8EAAE,SAAS,oPAAE,OAAO;;2FAI7B,2BAA2B;kBAPvC,SAAS;+BACE,4BAA4B,WAE7B,CAAC,UAAU,EAAE,SAAS,EAAE,OAAO,CAAC,aAC9B,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,6BAA6B,EAAE,CAAC,mBAC3D,uBAAuB,CAAC,MAAM","sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n input,\n inject,\n} from '@angular/core';\nimport { IonButton, IonButtons, IonIcon } from '@ionic/angular/standalone';\nimport {\n HappeningType,\n WeekdayCode2,\n NewHappeningParams,\n ScheduleNavService,\n} from '@sneat/mod-schedulus-core';\nimport { WithSpaceInput } from '@sneat/space-services';\nimport { ClassName } from '@sneat/ui';\n\n@Component({\n selector: 'sneat-calendar-add-buttons',\n templateUrl: './calendar-add-buttons.component.html',\n imports: [IonButtons, IonButton, IonIcon],\n providers: [{ provide: ClassName, useValue: 'CalendarAddButtonsComponent' }],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class CalendarAddButtonsComponent extends WithSpaceInput {\n private readonly scheduleNavService = inject(ScheduleNavService);\n\n public readonly dateID = input.required<string | undefined>();\n public readonly weekdayID = input.required<WeekdayCode2 | undefined>();\n\n public constructor() {\n super();\n }\n\n protected newHappeningUrl(type: HappeningType): string {\n const params: string[] = [];\n if (this.weekdayID()) {\n params.push(`wd=${this.weekdayID()}`);\n }\n const dateID = this.dateID();\n if (dateID) {\n params.push(`date=${dateID}`);\n }\n return (\n `space/${this.$spaceType()}/${this.$spaceID()}/new-happening?type=${type}` +\n (params.length === 0 ? '' : `&${params.join('&')}`)\n );\n }\n\n protected goNewHappening(event: Event, type: HappeningType): boolean {\n const space = this.$space();\n event.preventDefault();\n event.stopPropagation();\n const params: NewHappeningParams = {\n type,\n wd: this.weekdayID() ? this.weekdayID() : undefined,\n date: this.dateID() ? this.dateID() : undefined,\n };\n this.scheduleNavService.goNewHappening(space, params);\n return false;\n }\n}\n","<ion-buttons slot=\"end\" class=\"420\">\n <ion-button\n title=\"Add recurring\"\n [href]=\"newHappeningUrl('recurring')\"\n (click)=\"goNewHappening($event, 'recurring')\"\n >\n <ion-icon name=\"duplicate-outline\" />\n </ion-button>\n <ion-button\n title=\"Add one-timer\"\n [href]=\"newHappeningUrl('single')\"\n (click)=\"goNewHappening($event, 'single')\"\n >\n <ion-icon name=\"add-circle-outline\" />\n </ion-button>\n</ion-buttons>\n"]}
|
package/esm2022/lib/components/calendar/components/calendar-day/calendar-day-base.component.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SwipeableBaseComponent } from '../../../swipeable-base.component';
|
|
2
|
+
export class CalendarDayBaseComponent extends SwipeableBaseComponent {
|
|
3
|
+
get oddDay() {
|
|
4
|
+
return this.oddSlide || undefined;
|
|
5
|
+
}
|
|
6
|
+
get evenDay() {
|
|
7
|
+
return this.evenSlide || undefined;
|
|
8
|
+
}
|
|
9
|
+
get activeDay() {
|
|
10
|
+
return this.activeSlide || undefined;
|
|
11
|
+
}
|
|
12
|
+
constructor(scheduleSateService) {
|
|
13
|
+
super(scheduleSateService, 1);
|
|
14
|
+
}
|
|
15
|
+
onDateChanged(changed) {
|
|
16
|
+
if (this.shiftDays) {
|
|
17
|
+
const d = changed.date;
|
|
18
|
+
changed = {
|
|
19
|
+
...changed,
|
|
20
|
+
date: new Date(d.getFullYear(), d.getMonth(), d.getDate() + this.shiftDays),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
super.onDateChanged(changed);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=calendar-day-base.component.js.map
|
package/esm2022/lib/components/calendar/components/calendar-day/calendar-day-base.component.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-day-base.component.js","sourceRoot":"","sources":["../../../../../../../../../../../libs/extensions/schedulus/shared/src/lib/components/calendar/components/calendar-day/calendar-day-base.component.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAG3E,MAAM,OAAgB,wBAAyB,SAAQ,sBAAsB;IAC3E,IAAI,MAAM;QACR,OAAQ,IAAI,CAAC,QAAyB,IAAI,SAAS,CAAC;IACtD,CAAC;IAED,IAAI,OAAO;QACT,OAAQ,IAAI,CAAC,SAA0B,IAAI,SAAS,CAAC;IACvD,CAAC;IAED,IAAI,SAAS;QACX,OAAQ,IAAI,CAAC,WAA4B,IAAI,SAAS,CAAC;IACzD,CAAC;IAED,YAAsB,mBAAyC;QAC7D,KAAK,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC;IAChC,CAAC;IAEQ,aAAa,CAAC,OAAqB;QAC1C,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;YACvB,OAAO,GAAG;gBACR,GAAG,OAAO;gBACV,IAAI,EAAE,IAAI,IAAI,CACZ,CAAC,CAAC,WAAW,EAAE,EACf,CAAC,CAAC,QAAQ,EAAE,EACZ,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,SAAS,CAC7B;aACF,CAAC;QACJ,CAAC;QACD,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;CACF","sourcesContent":["import {\n IDateChanged,\n CalendarStateService,\n} from '../../calendar-state.service';\nimport { SwipeableBaseComponent } from '../../../swipeable-base.component';\nimport { SwipeableDay } from '../../../swipeable-ui';\n\nexport abstract class CalendarDayBaseComponent extends SwipeableBaseComponent {\n get oddDay(): SwipeableDay | undefined {\n return (this.oddSlide as SwipeableDay) || undefined;\n }\n\n get evenDay(): SwipeableDay | undefined {\n return (this.evenSlide as SwipeableDay) || undefined;\n }\n\n get activeDay(): SwipeableDay | undefined {\n return (this.activeSlide as SwipeableDay) || undefined;\n }\n\n protected constructor(scheduleSateService: CalendarStateService) {\n super(scheduleSateService, 1);\n }\n\n override onDateChanged(changed: IDateChanged): void {\n if (this.shiftDays) {\n const d = changed.date;\n changed = {\n ...changed,\n date: new Date(\n d.getFullYear(),\n d.getMonth(),\n d.getDate() + this.shiftDays,\n ),\n };\n }\n super.onDateChanged(changed);\n }\n}\n"]}
|
package/esm2022/lib/components/calendar/components/calendar-day/calendar-day-card.component.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, EventEmitter, input, Input, Output, inject, } from '@angular/core';
|
|
2
|
+
import { IonButton, IonButtons, IonCard, IonIcon, IonItem, IonLabel, } from '@ionic/angular/standalone';
|
|
3
|
+
import { virtualSliderAnimations } from '@sneat/components';
|
|
4
|
+
import { ClassName } from '@sneat/ui';
|
|
5
|
+
import { CalendarDayComponent } from './calendar-day.component';
|
|
6
|
+
import { CalendarDayTitleComponent } from './calendar-day-title.component';
|
|
7
|
+
import { getToday, CalendarStateService } from '../../calendar-state.service';
|
|
8
|
+
import { swipeableDay } from '../../../swipeable-ui';
|
|
9
|
+
import { CalendarAddButtonsComponent } from '../calendar-add-buttons/calendar-add-buttons.component';
|
|
10
|
+
import { CalendarDayBaseComponent } from './calendar-day-base.component';
|
|
11
|
+
import * as i0 from "@angular/core";
|
|
12
|
+
// This is 1 of the 2 "day cards" used at ScheduleDayTabComponent
|
|
13
|
+
// The 1st is the "active day" (e.g. today), and the 2nd is "next day" (e.g. tomorrow).
|
|
14
|
+
// The 2nd should set the [activeDayPlus]="1"
|
|
15
|
+
export class CalendarDayCardComponent extends CalendarDayBaseComponent {
|
|
16
|
+
set activeDayPlus(value) {
|
|
17
|
+
this.shiftDays = value;
|
|
18
|
+
// console.log('set activeDayPlus()', value, 'shiftDays=', this.shiftDays);
|
|
19
|
+
}
|
|
20
|
+
constructor() {
|
|
21
|
+
const scheduleSateService = inject(CalendarStateService);
|
|
22
|
+
super(scheduleSateService);
|
|
23
|
+
this.$space = input.required(...(ngDevMode ? [{ debugName: "$space" }] : []));
|
|
24
|
+
this.$spaceDaysProvider = input.required(...(ngDevMode ? [{ debugName: "$spaceDaysProvider" }] : []));
|
|
25
|
+
this.goNew = new EventEmitter();
|
|
26
|
+
}
|
|
27
|
+
ngOnInit() {
|
|
28
|
+
if (this.shiftDays < 0) {
|
|
29
|
+
throw new Error('shiftDays < 0');
|
|
30
|
+
}
|
|
31
|
+
this.createSlides();
|
|
32
|
+
}
|
|
33
|
+
createSlides() {
|
|
34
|
+
const spaceDaysProvider = this.$spaceDaysProvider();
|
|
35
|
+
const current = getToday();
|
|
36
|
+
if (this.activeDayPlus) {
|
|
37
|
+
current.setDate(current.getDate() + this.activeDayPlus);
|
|
38
|
+
}
|
|
39
|
+
this.$date.set(current);
|
|
40
|
+
const next = new Date();
|
|
41
|
+
next.setDate(current.getDate() + 1);
|
|
42
|
+
this.oddSlide = swipeableDay('odd', current, spaceDaysProvider, this.destroyed$);
|
|
43
|
+
this.evenSlide = swipeableDay('even', next, spaceDaysProvider, this.destroyed$);
|
|
44
|
+
this.onDateChanged({ date: current, shiftDirection: '' });
|
|
45
|
+
}
|
|
46
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CalendarDayCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
47
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: CalendarDayCardComponent, isStandalone: true, selector: "sneat-calendar-day-card", inputs: { $space: { classPropertyName: "$space", publicName: "$space", isSignal: true, isRequired: true, transformFunction: null }, $spaceDaysProvider: { classPropertyName: "$spaceDaysProvider", publicName: "$spaceDaysProvider", isSignal: true, isRequired: true, transformFunction: null }, activeDayPlus: { classPropertyName: "activeDayPlus", publicName: "activeDayPlus", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { goNew: "goNew" }, providers: [{ provide: ClassName, useValue: 'ScheduleDayCardComponent' }], usesInheritance: true, ngImport: i0, template: "<ion-card>\n <ion-item\n lines=\"full\"\n color=\"light\"\n class=\"sneat-small-end-padding sneat-small-start-padding\"\n >\n <ion-buttons\n slot=\"start\"\n class=\"sneat-hide-if-width-less-638 sneat-tiny-end-margin sneat-no-horizontal-margins\"\n >\n <ion-button\n [disabled]=\"$isDefaultDate()\"\n [color]=\"$isDefaultDate() ? 'medium' : 'primary'\"\n [title]=\"shiftDays === 0 ? 'Jump to today' : 'Jump to tomorrow'\"\n (click)=\"setToday()\"\n >\n <ion-icon name=\"today-outline\" />\n </ion-button>\n <!--\t\t\t<ion-button title=\"Previous day\"-->\n <!--\t\t\t\t\t\t\t\t\t(click)=\"swipePrev()\">-->\n <!--\t\t\t\t<ion-icon name=\"chevron-back-sharp\"></ion-icon>-->\n <!--\t\t\t</ion-button>-->\n <!--\t\t\t<ion-button title=\"Next day\"-->\n <!--\t\t\t\t\t\t\t\t\t(click)=\"swipeNext()\">-->\n <!--\t\t\t\t<ion-icon name=\"chevron-forward-sharp\"></ion-icon>-->\n <!--\t\t\t</ion-button>-->\n </ion-buttons>\n <ion-label>\n <div\n class=\"virtual-slider-outer\"\n (swipeleft)=\"swipeLeft()\"\n (swiperight)=\"swipeRight()\"\n >\n <div class=\"virtual-slider-inner\" [@virtualSlider]=\"animationState\">\n <h1\n class=\"virtual-slide sneat-smaller-if-width-less-638\"\n [@virtualSlide]=\"oddDay?.animationState\"\n >\n <sneat-calendar-day-title [weekday]=\"oddDay?.weekday\" />\n </h1>\n <h1\n class=\"virtual-slide\"\n [@virtualSlide]=\"evenDay?.animationState || 'hide'\"\n >\n <sneat-calendar-day-title [weekday]=\"evenDay?.weekday\" />\n </h1>\n </div>\n </div>\n </ion-label>\n\n <sneat-calendar-add-buttons\n [$space]=\"$space()\"\n [dateID]=\"activeDay?.activeDateID\"\n [weekdayID]=\"activeDay?.weekday?.id\"\n />\n </ion-item>\n\n <div\n class=\"virtual-slider-outer\"\n (swipeleft)=\"swipeLeft()\"\n (swiperight)=\"swipeRight()\"\n >\n <div class=\"virtual-slider-inner\" [@virtualSlider]=\"animationState\">\n <div class=\"virtual-slide\" [@virtualSlide]=\"oddSlide?.animationState\">\n <sneat-calendar-day [$weekday]=\"oddDay?.weekday\" [$space]=\"$space()\" />\n <div class=\"virtual-slide-overflow-fixer\"></div>\n </div>\n <div class=\"virtual-slide\" [@virtualSlide]=\"evenSlide?.animationState\">\n <sneat-calendar-day [$weekday]=\"evenDay?.weekday\" [$space]=\"$space()\" />\n <div class=\"virtual-slide-overflow-fixer\"></div>\n </div>\n </div>\n </div>\n</ion-card>\n", dependencies: [{ kind: "component", type: CalendarDayComponent, selector: "sneat-calendar-day", inputs: ["$weekday", "hideAddButtons", "hideLastBorder"] }, { kind: "component", type: CalendarAddButtonsComponent, selector: "sneat-calendar-add-buttons", inputs: ["dateID", "weekdayID"] }, { kind: "component", type: CalendarDayTitleComponent, selector: "sneat-calendar-day-title", inputs: ["weekday"] }, { kind: "component", type: IonCard, selector: "ion-card", inputs: ["button", "color", "disabled", "download", "href", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }], animations: virtualSliderAnimations, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
48
|
+
}
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CalendarDayCardComponent, decorators: [{
|
|
50
|
+
type: Component,
|
|
51
|
+
args: [{ animations: virtualSliderAnimations, imports: [
|
|
52
|
+
CalendarDayComponent,
|
|
53
|
+
CalendarAddButtonsComponent,
|
|
54
|
+
CalendarDayTitleComponent,
|
|
55
|
+
IonCard,
|
|
56
|
+
IonItem,
|
|
57
|
+
IonButtons,
|
|
58
|
+
IonButton,
|
|
59
|
+
IonIcon,
|
|
60
|
+
IonLabel,
|
|
61
|
+
], providers: [{ provide: ClassName, useValue: 'ScheduleDayCardComponent' }], changeDetection: ChangeDetectionStrategy.OnPush, selector: 'sneat-calendar-day-card', template: "<ion-card>\n <ion-item\n lines=\"full\"\n color=\"light\"\n class=\"sneat-small-end-padding sneat-small-start-padding\"\n >\n <ion-buttons\n slot=\"start\"\n class=\"sneat-hide-if-width-less-638 sneat-tiny-end-margin sneat-no-horizontal-margins\"\n >\n <ion-button\n [disabled]=\"$isDefaultDate()\"\n [color]=\"$isDefaultDate() ? 'medium' : 'primary'\"\n [title]=\"shiftDays === 0 ? 'Jump to today' : 'Jump to tomorrow'\"\n (click)=\"setToday()\"\n >\n <ion-icon name=\"today-outline\" />\n </ion-button>\n <!--\t\t\t<ion-button title=\"Previous day\"-->\n <!--\t\t\t\t\t\t\t\t\t(click)=\"swipePrev()\">-->\n <!--\t\t\t\t<ion-icon name=\"chevron-back-sharp\"></ion-icon>-->\n <!--\t\t\t</ion-button>-->\n <!--\t\t\t<ion-button title=\"Next day\"-->\n <!--\t\t\t\t\t\t\t\t\t(click)=\"swipeNext()\">-->\n <!--\t\t\t\t<ion-icon name=\"chevron-forward-sharp\"></ion-icon>-->\n <!--\t\t\t</ion-button>-->\n </ion-buttons>\n <ion-label>\n <div\n class=\"virtual-slider-outer\"\n (swipeleft)=\"swipeLeft()\"\n (swiperight)=\"swipeRight()\"\n >\n <div class=\"virtual-slider-inner\" [@virtualSlider]=\"animationState\">\n <h1\n class=\"virtual-slide sneat-smaller-if-width-less-638\"\n [@virtualSlide]=\"oddDay?.animationState\"\n >\n <sneat-calendar-day-title [weekday]=\"oddDay?.weekday\" />\n </h1>\n <h1\n class=\"virtual-slide\"\n [@virtualSlide]=\"evenDay?.animationState || 'hide'\"\n >\n <sneat-calendar-day-title [weekday]=\"evenDay?.weekday\" />\n </h1>\n </div>\n </div>\n </ion-label>\n\n <sneat-calendar-add-buttons\n [$space]=\"$space()\"\n [dateID]=\"activeDay?.activeDateID\"\n [weekdayID]=\"activeDay?.weekday?.id\"\n />\n </ion-item>\n\n <div\n class=\"virtual-slider-outer\"\n (swipeleft)=\"swipeLeft()\"\n (swiperight)=\"swipeRight()\"\n >\n <div class=\"virtual-slider-inner\" [@virtualSlider]=\"animationState\">\n <div class=\"virtual-slide\" [@virtualSlide]=\"oddSlide?.animationState\">\n <sneat-calendar-day [$weekday]=\"oddDay?.weekday\" [$space]=\"$space()\" />\n <div class=\"virtual-slide-overflow-fixer\"></div>\n </div>\n <div class=\"virtual-slide\" [@virtualSlide]=\"evenSlide?.animationState\">\n <sneat-calendar-day [$weekday]=\"evenDay?.weekday\" [$space]=\"$space()\" />\n <div class=\"virtual-slide-overflow-fixer\"></div>\n </div>\n </div>\n </div>\n</ion-card>\n" }]
|
|
62
|
+
}], ctorParameters: () => [], propDecorators: { $space: [{ type: i0.Input, args: [{ isSignal: true, alias: "$space", required: true }] }], $spaceDaysProvider: [{ type: i0.Input, args: [{ isSignal: true, alias: "$spaceDaysProvider", required: true }] }], goNew: [{
|
|
63
|
+
type: Output
|
|
64
|
+
}], activeDayPlus: [{
|
|
65
|
+
type: Input
|
|
66
|
+
}] } });
|
|
67
|
+
//# sourceMappingURL=calendar-day-card.component.js.map
|
package/esm2022/lib/components/calendar/components/calendar-day/calendar-day-card.component.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-day-card.component.js","sourceRoot":"","sources":["../../../../../../../../../../../libs/extensions/schedulus/shared/src/lib/components/calendar/components/calendar-day/calendar-day-card.component.ts","../../../../../../../../../../../libs/extensions/schedulus/shared/src/lib/components/calendar/components/calendar-day/calendar-day-card.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,YAAY,EACZ,KAAK,EACL,KAAK,EAEL,MAAM,EACN,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,SAAS,EACT,UAAU,EACV,OAAO,EACP,OAAO,EACP,OAAO,EACP,QAAQ,GACT,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAI3E,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wDAAwD,CAAC;AACrG,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;;AAEzE,iEAAiE;AACjE,uFAAuF;AACvF,6CAA6C;AAmB7C,MAAM,OAAO,wBACX,SAAQ,wBAAwB;IAShC,IAAa,aAAa,CAAC,KAAa;QACtC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,2EAA2E;IAC7E,CAAC;IAED;QACE,MAAM,mBAAmB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;QAEzD,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAdb,WAAM,GAAG,KAAK,CAAC,QAAQ,iDAAiB,CAAC;QAEzC,uBAAkB,GAAG,KAAK,CAAC,QAAQ,6DAAwB,CA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SAAS,oPACT,OAAO,2JACP,QAAQ,+EAVE,uBAAuB;;2FAiBxB,wBAAwB;kBAlBpC,SAAS;iCACI,uBAAuB,WAC1B;wBACP,oBAAoB;wBACpB,2BAA2B;wBAC3B,yBAAyB;wBACzB,OAAO;wBACP,OAAO;wBACP,UAAU;wBACV,SAAS;wBACT,OAAO;wBACP,QAAQ;qBACT,aACU,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,0BAA0B,EAAE,CAAC,mBACxD,uBAAuB,CAAC,MAAM,YACrC,yBAAyB;;sBAWlC,MAAM;;sBAEN,KAAK","sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n input,\n Input,\n OnInit,\n Output,\n inject,\n} from '@angular/core';\nimport {\n IonButton,\n IonButtons,\n IonCard,\n IonIcon,\n IonItem,\n IonLabel,\n} from '@ionic/angular/standalone';\nimport { virtualSliderAnimations } from '@sneat/components';\nimport { ClassName } from '@sneat/ui';\nimport { CalendarDayComponent } from './calendar-day.component';\nimport { CalendarDayTitleComponent } from './calendar-day-title.component';\nimport { ISpaceContext } from '@sneat/space-models';\nimport { CalendarDataProvider } from '../../../../services/calendar-data-provider';\nimport { NewHappeningParams } from '@sneat/mod-schedulus-core';\nimport { getToday, CalendarStateService } from '../../calendar-state.service';\nimport { swipeableDay } from '../../../swipeable-ui';\nimport { CalendarAddButtonsComponent } from '../calendar-add-buttons/calendar-add-buttons.component';\nimport { CalendarDayBaseComponent } from './calendar-day-base.component';\n\n// This is 1 of the 2 \"day cards\" used at ScheduleDayTabComponent\n// The 1st is the \"active day\" (e.g. today), and the 2nd is \"next day\" (e.g. tomorrow).\n// The 2nd should set the [activeDayPlus]=\"1\"\n@Component({\n animations: virtualSliderAnimations,\n imports: [\n CalendarDayComponent,\n CalendarAddButtonsComponent,\n CalendarDayTitleComponent,\n IonCard,\n IonItem,\n IonButtons,\n IonButton,\n IonIcon,\n IonLabel,\n ],\n providers: [{ provide: ClassName, useValue: 'ScheduleDayCardComponent' }],\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'sneat-calendar-day-card',\n templateUrl: 'calendar-day-card.component.html',\n})\nexport class CalendarDayCardComponent\n extends CalendarDayBaseComponent\n implements OnInit\n{\n public readonly $space = input.required<ISpaceContext>();\n\n public readonly $spaceDaysProvider = input.required<CalendarDataProvider>();\n\n @Output() readonly goNew = new EventEmitter<NewHappeningParams>();\n\n @Input() set activeDayPlus(value: number) {\n this.shiftDays = value;\n // console.log('set activeDayPlus()', value, 'shiftDays=', this.shiftDays);\n }\n\n public constructor() {\n const scheduleSateService = inject(CalendarStateService);\n\n super(scheduleSateService);\n }\n\n public ngOnInit(): void {\n if (this.shiftDays < 0) {\n throw new Error('shiftDays < 0');\n }\n this.createSlides();\n }\n\n private createSlides(): void {\n const spaceDaysProvider = this.$spaceDaysProvider();\n const current = getToday();\n if (this.activeDayPlus) {\n current.setDate(current.getDate() + this.activeDayPlus);\n }\n this.$date.set(current);\n const next = new Date();\n next.setDate(current.getDate() + 1);\n this.oddSlide = swipeableDay(\n 'odd',\n current,\n spaceDaysProvider,\n this.destroyed$,\n );\n this.evenSlide = swipeableDay(\n 'even',\n next,\n spaceDaysProvider,\n this.destroyed$,\n );\n this.onDateChanged({ date: current, shiftDirection: '' });\n }\n}\n","<ion-card>\n <ion-item\n lines=\"full\"\n color=\"light\"\n class=\"sneat-small-end-padding sneat-small-start-padding\"\n >\n <ion-buttons\n slot=\"start\"\n class=\"sneat-hide-if-width-less-638 sneat-tiny-end-margin sneat-no-horizontal-margins\"\n >\n <ion-button\n [disabled]=\"$isDefaultDate()\"\n [color]=\"$isDefaultDate() ? 'medium' : 'primary'\"\n [title]=\"shiftDays === 0 ? 'Jump to today' : 'Jump to tomorrow'\"\n (click)=\"setToday()\"\n >\n <ion-icon name=\"today-outline\" />\n </ion-button>\n <!--\t\t\t<ion-button title=\"Previous day\"-->\n <!--\t\t\t\t\t\t\t\t\t(click)=\"swipePrev()\">-->\n <!--\t\t\t\t<ion-icon name=\"chevron-back-sharp\"></ion-icon>-->\n <!--\t\t\t</ion-button>-->\n <!--\t\t\t<ion-button title=\"Next day\"-->\n <!--\t\t\t\t\t\t\t\t\t(click)=\"swipeNext()\">-->\n <!--\t\t\t\t<ion-icon name=\"chevron-forward-sharp\"></ion-icon>-->\n <!--\t\t\t</ion-button>-->\n </ion-buttons>\n <ion-label>\n <div\n class=\"virtual-slider-outer\"\n (swipeleft)=\"swipeLeft()\"\n (swiperight)=\"swipeRight()\"\n >\n <div class=\"virtual-slider-inner\" [@virtualSlider]=\"animationState\">\n <h1\n class=\"virtual-slide sneat-smaller-if-width-less-638\"\n [@virtualSlide]=\"oddDay?.animationState\"\n >\n <sneat-calendar-day-title [weekday]=\"oddDay?.weekday\" />\n </h1>\n <h1\n class=\"virtual-slide\"\n [@virtualSlide]=\"evenDay?.animationState || 'hide'\"\n >\n <sneat-calendar-day-title [weekday]=\"evenDay?.weekday\" />\n </h1>\n </div>\n </div>\n </ion-label>\n\n <sneat-calendar-add-buttons\n [$space]=\"$space()\"\n [dateID]=\"activeDay?.activeDateID\"\n [weekdayID]=\"activeDay?.weekday?.id\"\n />\n </ion-item>\n\n <div\n class=\"virtual-slider-outer\"\n (swipeleft)=\"swipeLeft()\"\n (swiperight)=\"swipeRight()\"\n >\n <div class=\"virtual-slider-inner\" [@virtualSlider]=\"animationState\">\n <div class=\"virtual-slide\" [@virtualSlide]=\"oddSlide?.animationState\">\n <sneat-calendar-day [$weekday]=\"oddDay?.weekday\" [$space]=\"$space()\" />\n <div class=\"virtual-slide-overflow-fixer\"></div>\n </div>\n <div class=\"virtual-slide\" [@virtualSlide]=\"evenSlide?.animationState\">\n <sneat-calendar-day [$weekday]=\"evenDay?.weekday\" [$space]=\"$space()\" />\n <div class=\"virtual-slide-overflow-fixer\"></div>\n </div>\n </div>\n </div>\n</ion-card>\n"]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, computed, input, signal, inject, } from '@angular/core';
|
|
2
|
+
import { IonButton, IonButtons, IonDatetime, IonIcon, IonItem, IonLabel, IonPopover, PopoverController, } from '@ionic/angular/standalone';
|
|
3
|
+
import { dateToIso, isoStringsToDate } from '@sneat/core';
|
|
4
|
+
import { WithSpaceInput } from '@sneat/space-services';
|
|
5
|
+
import { ClassName } from '@sneat/ui';
|
|
6
|
+
import { addDays, CalendarStateService } from '../../calendar-state.service';
|
|
7
|
+
import { CalendarDayCardComponent } from './calendar-day-card.component';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export class CalendarDayTabComponent extends WithSpaceInput {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
this.scheduleSateService = inject(CalendarStateService);
|
|
13
|
+
this.popoverController = inject(PopoverController);
|
|
14
|
+
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
15
|
+
this.$date = signal(undefined, ...(ngDevMode ? [{ debugName: "$date" }] : []));
|
|
16
|
+
this.$dateAsIsoString = computed(() => {
|
|
17
|
+
const date = this.$date();
|
|
18
|
+
return date && dateToIso(date);
|
|
19
|
+
}, ...(ngDevMode ? [{ debugName: "$dateAsIsoString" }] : []));
|
|
20
|
+
this.$spaceDaysProvider = input.required(...(ngDevMode ? [{ debugName: "$spaceDaysProvider" }] : []));
|
|
21
|
+
const scheduleSateService = this.scheduleSateService;
|
|
22
|
+
scheduleSateService.dateChanged.pipe(this.takeUntilDestroyed()).subscribe({
|
|
23
|
+
next: (value) => {
|
|
24
|
+
// console.log('ScheduleDayTabComponent => date changed:', value.date);
|
|
25
|
+
this.$date.set(value.date);
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
onPickerDateChanged(event) {
|
|
30
|
+
const ce = event;
|
|
31
|
+
event.stopPropagation();
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
const value = ce.detail.value;
|
|
34
|
+
// console.log('onPickerDateChanged()', value);
|
|
35
|
+
const date = isoStringsToDate(value);
|
|
36
|
+
this.$date.set(date);
|
|
37
|
+
this.scheduleSateService.setActiveDate(date);
|
|
38
|
+
this.popoverController.dismiss().catch(console.error);
|
|
39
|
+
}
|
|
40
|
+
swipe(days, event) {
|
|
41
|
+
event.stopPropagation();
|
|
42
|
+
this.scheduleSateService.shiftDays(days);
|
|
43
|
+
this.changeDetectorRef.markForCheck();
|
|
44
|
+
}
|
|
45
|
+
goToday() {
|
|
46
|
+
this.goDate(new Date());
|
|
47
|
+
}
|
|
48
|
+
goTomorrow() {
|
|
49
|
+
const tomorrow = addDays(new Date(), 1);
|
|
50
|
+
this.goDate(tomorrow);
|
|
51
|
+
}
|
|
52
|
+
goDate(date) {
|
|
53
|
+
this.scheduleSateService.setActiveDate(date);
|
|
54
|
+
this.popoverController
|
|
55
|
+
.dismiss()
|
|
56
|
+
.catch(this.errorLogger.logErrorHandler('failed to dismiss popover after going to date'));
|
|
57
|
+
}
|
|
58
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CalendarDayTabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
59
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: CalendarDayTabComponent, isStandalone: true, selector: "sneat-day-tab", inputs: { $spaceDaysProvider: { classPropertyName: "$spaceDaysProvider", publicName: "$spaceDaysProvider", isSignal: true, isRequired: true, transformFunction: null } }, providers: [{ provide: ClassName, useValue: 'CalendarDayTabComponent' }], usesInheritance: true, ngImport: i0, template: "<ion-item id=\"pick-date\" lines=\"full\" class=\"ion-margin-start ion-no-padding\">\n <ion-buttons slot=\"start\">\n <ion-button\n title=\"Previous day\"\n color=\"tertiary\"\n (click)=\"swipe(-1, $event)\"\n >\n <ion-icon name=\"chevron-back-sharp\" slot=\"start\" />\n <ion-label\n ><span class=\"sneat-hide-if-width-less-638\">Previous</span></ion-label\n >\n </ion-button>\n </ion-buttons>\n <ion-label style=\"text-align: center; width: 100%\" tappable color=\"tertiary\">\n Pick date\n </ion-label>\n <!--\t<ion-label style=\"text-align: center\" color=\"medium\">Swipe to change day</ion-label>-->\n <ion-buttons slot=\"end\">\n <ion-button title=\"Next day\" color=\"tertiary\" (click)=\"swipe(1, $event)\">\n <ion-icon name=\"chevron-forward-sharp\" slot=\"end\" />\n <ion-label\n ><span class=\"sneat-hide-if-width-less-638\">Next</span></ion-label\n >\n </ion-button>\n </ion-buttons>\n</ion-item>\n\n<ion-popover trigger=\"pick-date\" alignment=\"center\">\n <ng-template>\n <ion-item>\n <ion-button fill=\"clear\" color=\"primary\" (click)=\"goToday()\"\n >Today\n </ion-button>\n <ion-button\n fill=\"clear\"\n color=\"tertiary\"\n (click)=\"goTomorrow()\"\n slot=\"end\"\n >Tomorrow\n </ion-button>\n </ion-item>\n <ion-datetime\n class=\"sneat-date-picker\"\n [value]=\"$dateAsIsoString()\"\n presentation=\"date\"\n (ionChange)=\"onPickerDateChanged($event)\"\n />\n\n <!--\t\t\t<ion-list>-->\n <!--\t\t\t<ion-item-divider>-->\n <!--\t\t\t\t<ion-label>Quick links</ion-label>-->\n <!--\t\t\t</ion-item-divider>-->\n <!--\t\t\t<ion-item tappable (click)=\"goToday()\">-->\n <!--\t\t\t\t<ion-label>Today</ion-label>-->\n <!--\t\t\t</ion-item>-->\n <!--\t\t\t<ion-item tappable (click)=\"goTomorrow()\">-->\n <!--\t\t\t\t<ion-label>Tomorrow</ion-label>-->\n <!--\t\t\t</ion-item>-->\n <!--\t\t\t</ion-list>-->\n </ng-template>\n</ion-popover>\n\n<!--Today -->\n<sneat-calendar-day-card\n [$space]=\"$space()\"\n [$spaceDaysProvider]=\"$spaceDaysProvider()\"\n/>\n\n<!--<div class=\"ion-text-center ion-margin\">-->\n<!--\t<ion-text color=\"medium\">← Swipe to change day →</ion-text>-->\n<!--</div>-->\n\n<!--Tomorrow -->\n<sneat-calendar-day-card\n [activeDayPlus]=\"1\"\n [$space]=\"$space()\"\n [$spaceDaysProvider]=\"$spaceDaysProvider()\"\n/>\n", styles: ["ion-popover{--max-width: 360px}\n"], dependencies: [{ kind: "component", type: CalendarDayCardComponent, selector: "sneat-calendar-day-card", inputs: ["$space", "$spaceDaysProvider", "activeDayPlus"], outputs: ["goNew"] }, { kind: "component", type: IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: IonPopover, selector: "ion-popover" }, { kind: "component", type: IonDatetime, selector: "ion-datetime", inputs: ["cancelText", "clearText", "color", "dayValues", "disabled", "doneText", "firstDayOfWeek", "formatOptions", "highlightedDates", "hourCycle", "hourValues", "isDateEnabled", "locale", "max", "min", "minuteValues", "mode", "monthValues", "multiple", "name", "preferWheel", "presentation", "readonly", "showAdjacentDays", "showClearButton", "showDefaultButtons", "showDefaultTimeLabel", "showDefaultTitle", "size", "titleSelectedDatesFormatter", "value", "yearValues"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
60
|
+
}
|
|
61
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CalendarDayTabComponent, decorators: [{
|
|
62
|
+
type: Component,
|
|
63
|
+
args: [{ imports: [
|
|
64
|
+
CalendarDayCardComponent,
|
|
65
|
+
IonItem,
|
|
66
|
+
IonButtons,
|
|
67
|
+
IonButton,
|
|
68
|
+
IonIcon,
|
|
69
|
+
IonLabel,
|
|
70
|
+
IonPopover,
|
|
71
|
+
IonDatetime,
|
|
72
|
+
], providers: [{ provide: ClassName, useValue: 'CalendarDayTabComponent' }], changeDetection: ChangeDetectionStrategy.OnPush, selector: 'sneat-day-tab', template: "<ion-item id=\"pick-date\" lines=\"full\" class=\"ion-margin-start ion-no-padding\">\n <ion-buttons slot=\"start\">\n <ion-button\n title=\"Previous day\"\n color=\"tertiary\"\n (click)=\"swipe(-1, $event)\"\n >\n <ion-icon name=\"chevron-back-sharp\" slot=\"start\" />\n <ion-label\n ><span class=\"sneat-hide-if-width-less-638\">Previous</span></ion-label\n >\n </ion-button>\n </ion-buttons>\n <ion-label style=\"text-align: center; width: 100%\" tappable color=\"tertiary\">\n Pick date\n </ion-label>\n <!--\t<ion-label style=\"text-align: center\" color=\"medium\">Swipe to change day</ion-label>-->\n <ion-buttons slot=\"end\">\n <ion-button title=\"Next day\" color=\"tertiary\" (click)=\"swipe(1, $event)\">\n <ion-icon name=\"chevron-forward-sharp\" slot=\"end\" />\n <ion-label\n ><span class=\"sneat-hide-if-width-less-638\">Next</span></ion-label\n >\n </ion-button>\n </ion-buttons>\n</ion-item>\n\n<ion-popover trigger=\"pick-date\" alignment=\"center\">\n <ng-template>\n <ion-item>\n <ion-button fill=\"clear\" color=\"primary\" (click)=\"goToday()\"\n >Today\n </ion-button>\n <ion-button\n fill=\"clear\"\n color=\"tertiary\"\n (click)=\"goTomorrow()\"\n slot=\"end\"\n >Tomorrow\n </ion-button>\n </ion-item>\n <ion-datetime\n class=\"sneat-date-picker\"\n [value]=\"$dateAsIsoString()\"\n presentation=\"date\"\n (ionChange)=\"onPickerDateChanged($event)\"\n />\n\n <!--\t\t\t<ion-list>-->\n <!--\t\t\t<ion-item-divider>-->\n <!--\t\t\t\t<ion-label>Quick links</ion-label>-->\n <!--\t\t\t</ion-item-divider>-->\n <!--\t\t\t<ion-item tappable (click)=\"goToday()\">-->\n <!--\t\t\t\t<ion-label>Today</ion-label>-->\n <!--\t\t\t</ion-item>-->\n <!--\t\t\t<ion-item tappable (click)=\"goTomorrow()\">-->\n <!--\t\t\t\t<ion-label>Tomorrow</ion-label>-->\n <!--\t\t\t</ion-item>-->\n <!--\t\t\t</ion-list>-->\n </ng-template>\n</ion-popover>\n\n<!--Today -->\n<sneat-calendar-day-card\n [$space]=\"$space()\"\n [$spaceDaysProvider]=\"$spaceDaysProvider()\"\n/>\n\n<!--<div class=\"ion-text-center ion-margin\">-->\n<!--\t<ion-text color=\"medium\">← Swipe to change day →</ion-text>-->\n<!--</div>-->\n\n<!--Tomorrow -->\n<sneat-calendar-day-card\n [activeDayPlus]=\"1\"\n [$space]=\"$space()\"\n [$spaceDaysProvider]=\"$spaceDaysProvider()\"\n/>\n", styles: ["ion-popover{--max-width: 360px}\n"] }]
|
|
73
|
+
}], ctorParameters: () => [], propDecorators: { $spaceDaysProvider: [{ type: i0.Input, args: [{ isSignal: true, alias: "$spaceDaysProvider", required: true }] }] } });
|
|
74
|
+
//# sourceMappingURL=calendar-day-tab.component.js.map
|
package/esm2022/lib/components/calendar/components/calendar-day/calendar-day-tab.component.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-day-tab.component.js","sourceRoot":"","sources":["../../../../../../../../../../../libs/extensions/schedulus/shared/src/lib/components/calendar/components/calendar-day/calendar-day-tab.component.ts","../../../../../../../../../../../libs/extensions/schedulus/shared/src/lib/components/calendar/components/calendar-day/calendar-day-tab.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,QAAQ,EACR,KAAK,EACL,MAAM,EACN,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,SAAS,EACT,UAAU,EACV,WAAW,EACX,OAAO,EACP,OAAO,EACP,QAAQ,EACR,UAAU,EACV,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,gBAAgB,E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;2FAQF,uBAAuB;kBAjBnC,SAAS;8BACC;wBACP,wBAAwB;wBACxB,OAAO;wBACP,UAAU;wBACV,SAAS;wBACT,OAAO;wBACP,QAAQ;wBACR,UAAU;wBACV,WAAW;qBACZ,aACU,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,yBAAyB,EAAE,CAAC,mBACvD,uBAAuB,CAAC,MAAM,YACrC,eAAe","sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n computed,\n input,\n signal,\n inject,\n} from '@angular/core';\nimport {\n IonButton,\n IonButtons,\n IonDatetime,\n IonIcon,\n IonItem,\n IonLabel,\n IonPopover,\n PopoverController,\n} from '@ionic/angular/standalone';\nimport { dateToIso, isoStringsToDate } from '@sneat/core';\nimport { WithSpaceInput } from '@sneat/space-services';\nimport { ClassName } from '@sneat/ui';\nimport { CalendarDataProvider } from '../../../../services/calendar-data-provider';\nimport { addDays, CalendarStateService } from '../../calendar-state.service';\nimport { CalendarDayCardComponent } from './calendar-day-card.component';\n\n@Component({\n imports: [\n CalendarDayCardComponent,\n IonItem,\n IonButtons,\n IonButton,\n IonIcon,\n IonLabel,\n IonPopover,\n IonDatetime,\n ],\n providers: [{ provide: ClassName, useValue: 'CalendarDayTabComponent' }],\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'sneat-day-tab',\n templateUrl: 'calendar-day-tab.component.html',\n styleUrls: ['calendar-day-tab.component.scss'],\n})\nexport class CalendarDayTabComponent extends WithSpaceInput {\n private readonly scheduleSateService = inject(CalendarStateService);\n private readonly popoverController = inject(PopoverController);\n private readonly changeDetectorRef = inject(ChangeDetectorRef);\n\n private readonly $date = signal<Date | undefined>(undefined);\n\n protected readonly $dateAsIsoString = computed(() => {\n const date = this.$date();\n return date && dateToIso(date);\n });\n\n public readonly $spaceDaysProvider = input.required<CalendarDataProvider>();\n\n public constructor() {\n super();\n const scheduleSateService = this.scheduleSateService;\n\n scheduleSateService.dateChanged.pipe(this.takeUntilDestroyed()).subscribe({\n next: (value) => {\n // console.log('ScheduleDayTabComponent => date changed:', value.date);\n this.$date.set(value.date);\n },\n });\n }\n\n protected onPickerDateChanged(event: Event): void {\n const ce = event as CustomEvent;\n event.stopPropagation();\n event.preventDefault();\n const value: string = ce.detail.value;\n // console.log('onPickerDateChanged()', value);\n const date = isoStringsToDate(value);\n this.$date.set(date);\n this.scheduleSateService.setActiveDate(date);\n this.popoverController.dismiss().catch(console.error);\n }\n\n protected swipe(days: 1 | -1, event: Event): void {\n event.stopPropagation();\n this.scheduleSateService.shiftDays(days);\n this.changeDetectorRef.markForCheck();\n }\n\n protected goToday(): void {\n this.goDate(new Date());\n }\n\n protected goTomorrow(): void {\n const tomorrow = addDays(new Date(), 1);\n this.goDate(tomorrow);\n }\n\n private goDate(date: Date): void {\n this.scheduleSateService.setActiveDate(date);\n this.popoverController\n .dismiss()\n .catch(\n this.errorLogger.logErrorHandler(\n 'failed to dismiss popover after going to date',\n ),\n );\n }\n}\n","<ion-item id=\"pick-date\" lines=\"full\" class=\"ion-margin-start ion-no-padding\">\n <ion-buttons slot=\"start\">\n <ion-button\n title=\"Previous day\"\n color=\"tertiary\"\n (click)=\"swipe(-1, $event)\"\n >\n <ion-icon name=\"chevron-back-sharp\" slot=\"start\" />\n <ion-label\n ><span class=\"sneat-hide-if-width-less-638\">Previous</span></ion-label\n >\n </ion-button>\n </ion-buttons>\n <ion-label style=\"text-align: center; width: 100%\" tappable color=\"tertiary\">\n Pick date\n </ion-label>\n <!--\t<ion-label style=\"text-align: center\" color=\"medium\">Swipe to change day</ion-label>-->\n <ion-buttons slot=\"end\">\n <ion-button title=\"Next day\" color=\"tertiary\" (click)=\"swipe(1, $event)\">\n <ion-icon name=\"chevron-forward-sharp\" slot=\"end\" />\n <ion-label\n ><span class=\"sneat-hide-if-width-less-638\">Next</span></ion-label\n >\n </ion-button>\n </ion-buttons>\n</ion-item>\n\n<ion-popover trigger=\"pick-date\" alignment=\"center\">\n <ng-template>\n <ion-item>\n <ion-button fill=\"clear\" color=\"primary\" (click)=\"goToday()\"\n >Today\n </ion-button>\n <ion-button\n fill=\"clear\"\n color=\"tertiary\"\n (click)=\"goTomorrow()\"\n slot=\"end\"\n >Tomorrow\n </ion-button>\n </ion-item>\n <ion-datetime\n class=\"sneat-date-picker\"\n [value]=\"$dateAsIsoString()\"\n presentation=\"date\"\n (ionChange)=\"onPickerDateChanged($event)\"\n />\n\n <!--\t\t\t<ion-list>-->\n <!--\t\t\t<ion-item-divider>-->\n <!--\t\t\t\t<ion-label>Quick links</ion-label>-->\n <!--\t\t\t</ion-item-divider>-->\n <!--\t\t\t<ion-item tappable (click)=\"goToday()\">-->\n <!--\t\t\t\t<ion-label>Today</ion-label>-->\n <!--\t\t\t</ion-item>-->\n <!--\t\t\t<ion-item tappable (click)=\"goTomorrow()\">-->\n <!--\t\t\t\t<ion-label>Tomorrow</ion-label>-->\n <!--\t\t\t</ion-item>-->\n <!--\t\t\t</ion-list>-->\n </ng-template>\n</ion-popover>\n\n<!--Today -->\n<sneat-calendar-day-card\n [$space]=\"$space()\"\n [$spaceDaysProvider]=\"$spaceDaysProvider()\"\n/>\n\n<!--<div class=\"ion-text-center ion-margin\">-->\n<!--\t<ion-text color=\"medium\">← Swipe to change day →</ion-text>-->\n<!--</div>-->\n\n<!--Tomorrow -->\n<sneat-calendar-day-card\n [activeDayPlus]=\"1\"\n [$space]=\"$space()\"\n [$spaceDaysProvider]=\"$spaceDaysProvider()\"\n/>\n"]}
|
package/esm2022/lib/components/calendar/components/calendar-day/calendar-day-title.component.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
|
2
|
+
import { LongMonthNamePipe } from '@sneat/components';
|
|
3
|
+
import { WdToWeekdayPipe } from '@sneat/mod-schedulus-core';
|
|
4
|
+
import { isToday, isTomorrow } from '../../../calendar-core';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export class CalendarDayTitleComponent {
|
|
7
|
+
get date() {
|
|
8
|
+
return this.weekday?.day?.date;
|
|
9
|
+
}
|
|
10
|
+
isToday() {
|
|
11
|
+
const date = this.date;
|
|
12
|
+
return !date || isToday(date);
|
|
13
|
+
}
|
|
14
|
+
isTomorrow() {
|
|
15
|
+
return isTomorrow(this.date);
|
|
16
|
+
}
|
|
17
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CalendarDayTitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
18
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: CalendarDayTitleComponent, isStandalone: true, selector: "sneat-calendar-day-title", inputs: { weekday: "weekday" }, ngImport: i0, template: "<span class=\"sneat-smaller-if-width-less-638\" style=\"margin-left: 0.5em\">\n @if (isToday()) {\n <span class=\"ion-margin-end\">Today:</span>\n } @else if (isTomorrow()) {\n <span class=\"ion-margin-end\">Tomorrow:</span>\n }\n @if (weekday) {\n <b>{{ weekday.id | wdToWeekday }}</b\n ><span style=\"font-weight: normal\"\n >, {{ weekday.day?.date?.getDate() }}\n {{ weekday.day?.date?.getMonth() | longMonthName }}</span\n >\n }\n</span>\n", dependencies: [{ kind: "pipe", type: WdToWeekdayPipe, name: "wdToWeekday" }, { kind: "pipe", type: LongMonthNamePipe, name: "longMonthName" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
19
|
+
}
|
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CalendarDayTitleComponent, decorators: [{
|
|
21
|
+
type: Component,
|
|
22
|
+
args: [{ selector: 'sneat-calendar-day-title', changeDetection: ChangeDetectionStrategy.OnPush, imports: [WdToWeekdayPipe, LongMonthNamePipe], template: "<span class=\"sneat-smaller-if-width-less-638\" style=\"margin-left: 0.5em\">\n @if (isToday()) {\n <span class=\"ion-margin-end\">Today:</span>\n } @else if (isTomorrow()) {\n <span class=\"ion-margin-end\">Tomorrow:</span>\n }\n @if (weekday) {\n <b>{{ weekday.id | wdToWeekday }}</b\n ><span style=\"font-weight: normal\"\n >, {{ weekday.day?.date?.getDate() }}\n {{ weekday.day?.date?.getMonth() | longMonthName }}</span\n >\n }\n</span>\n" }]
|
|
23
|
+
}], propDecorators: { weekday: [{
|
|
24
|
+
type: Input,
|
|
25
|
+
args: [{ required: true }]
|
|
26
|
+
}] } });
|
|
27
|
+
//# sourceMappingURL=calendar-day-title.component.js.map
|
package/esm2022/lib/components/calendar/components/calendar-day/calendar-day-title.component.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-day-title.component.js","sourceRoot":"","sources":["../../../../../../../../../../../libs/extensions/schedulus/shared/src/lib/components/calendar/components/calendar-day/calendar-day-title.component.ts","../../../../../../../../../../../libs/extensions/schedulus/shared/src/lib/components/calendar/components/calendar-day/calendar-day-title.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;;AAS7D,MAAM,OAAO,yBAAyB;IAGpC,IAAc,IAAI;QAChB,OAAO,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC;IACjC,CAAC;IAES,OAAO;QACf,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACvB,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAES,UAAU;QAClB,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;8GAdU,yBAAyB;kGAAzB,yBAAyB,oHCZtC,2dAcA,uCDJY,eAAe,+CAAE,iBAAiB;;2FAEjC,yBAAyB;kBANrC,SAAS;+BACE,0BAA0B,mBAEnB,uBAAuB,CAAC,MAAM,WACtC,CAAC,eAAe,EAAE,iBAAiB,CAAC;;sBAG5C,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE","sourcesContent":["import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\nimport { LongMonthNamePipe } from '@sneat/components';\nimport { WdToWeekdayPipe } from '@sneat/mod-schedulus-core';\nimport { isToday, isTomorrow } from '../../../calendar-core';\nimport { Weekday } from '../../weekday';\n\n@Component({\n selector: 'sneat-calendar-day-title',\n templateUrl: 'calendar-day-title.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [WdToWeekdayPipe, LongMonthNamePipe],\n})\nexport class CalendarDayTitleComponent {\n @Input({ required: true }) weekday?: Weekday;\n\n protected get date(): Date | undefined {\n return this.weekday?.day?.date;\n }\n\n protected isToday(): boolean {\n const date = this.date;\n return !date || isToday(date);\n }\n\n protected isTomorrow(): boolean {\n return isTomorrow(this.date);\n }\n}\n","<span class=\"sneat-smaller-if-width-less-638\" style=\"margin-left: 0.5em\">\n @if (isToday()) {\n <span class=\"ion-margin-end\">Today:</span>\n } @else if (isTomorrow()) {\n <span class=\"ion-margin-end\">Tomorrow:</span>\n }\n @if (weekday) {\n <b>{{ weekday.id | wdToWeekday }}</b\n ><span style=\"font-weight: normal\"\n >, {{ weekday.day?.date?.getDate() }}\n {{ weekday.day?.date?.getMonth() | longMonthName }}</span\n >\n }\n</span>\n"]}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, input, Input, signal, inject, } from '@angular/core';
|
|
2
|
+
import { IonButton, IonButtons, IonIcon, IonItem, IonItemDivider, IonLabel, IonSpinner, } from '@ionic/angular/standalone';
|
|
3
|
+
import { dateToIso } from '@sneat/core';
|
|
4
|
+
import { jsDayToWeekday, ScheduleNavService, ScheduleNavServiceModule, sortSlotItems, } from '@sneat/mod-schedulus-core';
|
|
5
|
+
import { WithSpaceInput } from '@sneat/space-services';
|
|
6
|
+
import { ClassName } from '@sneat/ui';
|
|
7
|
+
import { emptyCalendarFilter, CalendarFilterService, } from '../../../calendar-filter.service';
|
|
8
|
+
import { isSlotVisible } from '../../../calendar-slots';
|
|
9
|
+
import { isToday, isTomorrow } from '../../../calendar-core';
|
|
10
|
+
import { DaySlotItemComponent } from '../day-slot-item/day-slot-item.component';
|
|
11
|
+
import * as i0 from "@angular/core";
|
|
12
|
+
export class CalendarDayComponent extends WithSpaceInput {
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
this.filterService = inject(CalendarFilterService);
|
|
16
|
+
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
17
|
+
this.scheduleNavService = inject(ScheduleNavService);
|
|
18
|
+
this.filter = emptyCalendarFilter;
|
|
19
|
+
// @Input() filter?: ICalendarFilter;
|
|
20
|
+
// @Input() showRegulars = true;
|
|
21
|
+
// @Input() showEvents = true;
|
|
22
|
+
this.$weekday = input.required(...(ngDevMode ? [{ debugName: "$weekday" }] : []));
|
|
23
|
+
this.hideAddButtons = false;
|
|
24
|
+
this.hideLastBorder = false;
|
|
25
|
+
this.$isToday = signal(false, ...(ngDevMode ? [{ debugName: "$isToday" }] : []));
|
|
26
|
+
this.$isTomorrow = signal(false, ...(ngDevMode ? [{ debugName: "$isTomorrow" }] : []));
|
|
27
|
+
this.resetFilter = (event) => this.filterService.resetScheduleFilter(event);
|
|
28
|
+
this.processSlots = (slots) => {
|
|
29
|
+
this.allSlots = slots;
|
|
30
|
+
this.applyFilter();
|
|
31
|
+
};
|
|
32
|
+
this.logPrefix = () => `CalendarDayComponent{dateID=${this.$weekday()?.day?.dateID}}`;
|
|
33
|
+
const filterService = this.filterService;
|
|
34
|
+
filterService.filter.pipe(this.takeUntilDestroyed()).subscribe({
|
|
35
|
+
next: (filter) => {
|
|
36
|
+
this.filter = filter;
|
|
37
|
+
this.applyFilter();
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
ngOnChanges(changes) {
|
|
42
|
+
const weekdayChange = changes['$weekday'];
|
|
43
|
+
if (weekdayChange) {
|
|
44
|
+
const date = this.$weekday()?.day?.date;
|
|
45
|
+
this.$isToday.set(!date || isToday(date));
|
|
46
|
+
this.$isTomorrow.set(isTomorrow(date));
|
|
47
|
+
// if (weekdayChange.firstChange && !weekdayChange.currentValue) {
|
|
48
|
+
// return; // TODO: comment with explanation why we need this
|
|
49
|
+
// }
|
|
50
|
+
this.subscribeForSlots();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
applyFilter() {
|
|
54
|
+
if (this.allSlots?.length) {
|
|
55
|
+
this.slots = this.allSlots
|
|
56
|
+
.filter((slot) => isSlotVisible(slot, this.filter))
|
|
57
|
+
.toSorted(sortSlotItems);
|
|
58
|
+
this.slotsHiddenByFilter = this.allSlots.length - this.slots.length;
|
|
59
|
+
// console.log(
|
|
60
|
+
// this.logPrefix() + '.applyFilter() =>',
|
|
61
|
+
// 'slotsHiddenByFilter:',
|
|
62
|
+
// this.slotsHiddenByFilter,
|
|
63
|
+
// 'filter:',
|
|
64
|
+
// this.filter,
|
|
65
|
+
// 'slots before filter:',
|
|
66
|
+
// this.allSlots,
|
|
67
|
+
// 'slots after filter:',
|
|
68
|
+
// this.slots,
|
|
69
|
+
// );
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
// console.log(this.logPrefix() + '.applyFilter() for empty slots');
|
|
73
|
+
this.slots = this.allSlots;
|
|
74
|
+
this.slotsHiddenByFilter = 0;
|
|
75
|
+
}
|
|
76
|
+
this.changeDetectorRef.markForCheck();
|
|
77
|
+
}
|
|
78
|
+
subscribeForSlots() {
|
|
79
|
+
this.slotsSubscription?.unsubscribe();
|
|
80
|
+
const weekday = this.$weekday();
|
|
81
|
+
if (weekday?.day) {
|
|
82
|
+
this.slotsSubscription = weekday.day.slots$
|
|
83
|
+
.pipe(this.takeUntilDestroyed())
|
|
84
|
+
.subscribe(this.processSlots);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
this.slots = undefined;
|
|
88
|
+
this.slotsHiddenByFilter = undefined;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
goNewHappening(params) {
|
|
92
|
+
const space = this.$space();
|
|
93
|
+
if (!space) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const date = this.$weekday()?.day?.date;
|
|
97
|
+
if (!date) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
params = {
|
|
101
|
+
...params,
|
|
102
|
+
wd: jsDayToWeekday(date.getDay()),
|
|
103
|
+
date: dateToIso(date),
|
|
104
|
+
};
|
|
105
|
+
this.scheduleNavService.goNewHappening(space, params);
|
|
106
|
+
}
|
|
107
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CalendarDayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
108
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: CalendarDayComponent, isStandalone: true, selector: "sneat-calendar-day", inputs: { $weekday: { classPropertyName: "$weekday", publicName: "$weekday", isSignal: true, isRequired: true, transformFunction: null }, hideAddButtons: { classPropertyName: "hideAddButtons", publicName: "hideAddButtons", isSignal: false, isRequired: false, transformFunction: null }, hideLastBorder: { classPropertyName: "hideLastBorder", publicName: "hideLastBorder", isSignal: false, isRequired: false, transformFunction: null } }, providers: [{ provide: ClassName, useValue: 'CalendarDayComponent' }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "@if ($weekday(); as weekday) {\n @if (!weekday.day?.slots?.length) {\n <ion-item [lines]=\"hideLastBorder ? 'none' : 'full'\">\n @if (!weekday.day || weekday.day.$isLoading()) {\n <ion-spinner name=\"lines-small\" color=\"medium\" slot=\"start\" />\n <ion-label color=\"medium\">Loading...</ion-label>\n } @else {\n <ion-label color=\"medium\">\n @if ($isToday()) {\n Nothing scheduled for today.\n } @else if ($isTomorrow()) {\n Nothing scheduled for tomorrow.\n } @else {\n Nothing scheduled for this day.\n }\n </ion-label>\n }\n </ion-item>\n } @else {\n @if (slotsHiddenByFilter) {\n <ion-item-divider color=\"light\">\n <ion-label>{{ slotsHiddenByFilter }} hidden by filter.</ion-label>\n <ion-buttons slot=\"end\">\n <ion-button (click)=\"resetFilter($event)\">\n <ion-icon color=\"medium\" name=\"close-outline\" slot=\"end\" />\n <ion-label color=\"medium\">Reset filter</ion-label>\n </ion-button>\n </ion-buttons>\n </ion-item-divider>\n }\n @for (slot of slots; track slot.slot.id) {\n <sneat-day-slot-item\n [$space]=\"$space()\"\n [dateID]=\"weekday.day?.dateID\"\n [$slotContext]=\"slot\"\n />\n }\n }\n @if (!hideAddButtons) {\n <ion-item lines=\"none\">\n <ion-button\n slot=\"end\"\n fill=\"clear\"\n (click)=\"goNewHappening({ type: 'recurring' })\"\n >\n <ion-icon name=\"duplicate-outline\" slot=\"start\" />\n <ion-label color=\"medium\" style=\"text-transform: none\"\n >Add recurring\n </ion-label>\n </ion-button>\n <ion-button\n slot=\"end\"\n fill=\"clear\"\n (click)=\"goNewHappening({ type: 'single' })\"\n >\n <ion-icon name=\"add-circle-outline\" color=\"primary\" slot=\"start\" />\n <ion-label color=\"medium\" style=\"text-transform: none\"\n >Add one-timer\n </ion-label>\n </ion-button>\n </ion-item>\n }\n}\n", dependencies: [{ kind: "ngmodule", type: ScheduleNavServiceModule }, { kind: "component", type: DaySlotItemComponent, selector: "sneat-day-slot-item", inputs: ["$slotContext", "dateID", "mode", "color", "contactusSpace"] }, { kind: "component", type: IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonSpinner, selector: "ion-spinner", inputs: ["color", "duration", "name", "paused"] }, { kind: "component", type: IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: IonItemDivider, selector: "ion-item-divider", inputs: ["color", "mode", "sticky"] }, { kind: "component", type: IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
109
|
+
}
|
|
110
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CalendarDayComponent, decorators: [{
|
|
111
|
+
type: Component,
|
|
112
|
+
args: [{ imports: [
|
|
113
|
+
ScheduleNavServiceModule,
|
|
114
|
+
DaySlotItemComponent,
|
|
115
|
+
IonItem,
|
|
116
|
+
IonSpinner,
|
|
117
|
+
IonLabel,
|
|
118
|
+
IonItemDivider,
|
|
119
|
+
IonButtons,
|
|
120
|
+
IonIcon,
|
|
121
|
+
IonButton,
|
|
122
|
+
], providers: [{ provide: ClassName, useValue: 'CalendarDayComponent' }], changeDetection: ChangeDetectionStrategy.OnPush, selector: 'sneat-calendar-day', template: "@if ($weekday(); as weekday) {\n @if (!weekday.day?.slots?.length) {\n <ion-item [lines]=\"hideLastBorder ? 'none' : 'full'\">\n @if (!weekday.day || weekday.day.$isLoading()) {\n <ion-spinner name=\"lines-small\" color=\"medium\" slot=\"start\" />\n <ion-label color=\"medium\">Loading...</ion-label>\n } @else {\n <ion-label color=\"medium\">\n @if ($isToday()) {\n Nothing scheduled for today.\n } @else if ($isTomorrow()) {\n Nothing scheduled for tomorrow.\n } @else {\n Nothing scheduled for this day.\n }\n </ion-label>\n }\n </ion-item>\n } @else {\n @if (slotsHiddenByFilter) {\n <ion-item-divider color=\"light\">\n <ion-label>{{ slotsHiddenByFilter }} hidden by filter.</ion-label>\n <ion-buttons slot=\"end\">\n <ion-button (click)=\"resetFilter($event)\">\n <ion-icon color=\"medium\" name=\"close-outline\" slot=\"end\" />\n <ion-label color=\"medium\">Reset filter</ion-label>\n </ion-button>\n </ion-buttons>\n </ion-item-divider>\n }\n @for (slot of slots; track slot.slot.id) {\n <sneat-day-slot-item\n [$space]=\"$space()\"\n [dateID]=\"weekday.day?.dateID\"\n [$slotContext]=\"slot\"\n />\n }\n }\n @if (!hideAddButtons) {\n <ion-item lines=\"none\">\n <ion-button\n slot=\"end\"\n fill=\"clear\"\n (click)=\"goNewHappening({ type: 'recurring' })\"\n >\n <ion-icon name=\"duplicate-outline\" slot=\"start\" />\n <ion-label color=\"medium\" style=\"text-transform: none\"\n >Add recurring\n </ion-label>\n </ion-button>\n <ion-button\n slot=\"end\"\n fill=\"clear\"\n (click)=\"goNewHappening({ type: 'single' })\"\n >\n <ion-icon name=\"add-circle-outline\" color=\"primary\" slot=\"start\" />\n <ion-label color=\"medium\" style=\"text-transform: none\"\n >Add one-timer\n </ion-label>\n </ion-button>\n </ion-item>\n }\n}\n" }]
|
|
123
|
+
}], ctorParameters: () => [], propDecorators: { $weekday: [{ type: i0.Input, args: [{ isSignal: true, alias: "$weekday", required: true }] }], hideAddButtons: [{
|
|
124
|
+
type: Input,
|
|
125
|
+
args: [{ required: false }]
|
|
126
|
+
}], hideLastBorder: [{
|
|
127
|
+
type: Input
|
|
128
|
+
}] } });
|
|
129
|
+
//# sourceMappingURL=calendar-day.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-day.component.js","sourceRoot":"","sources":["../../../../../../../../../../../libs/extensions/schedulus/shared/src/lib/components/calendar/components/calendar-day/calendar-day.component.ts","../../../../../../../../../../../libs/extensions/schedulus/shared/src/lib/components/calendar/components/calendar-day/calendar-day.component.html"],"names":[],"mappings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ACT,CAAC;QACD,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC;QACxC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO;QACT,CAAC;QACD,MAAM,GAAG;YACP,GAAG,MAAM;YACT,EAAE,EAAE,cAAc,CAAC,IAAI,CAAC,MAAM,EAAmB,CAAC;YAClD,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC;SACtB,CAAC;QACF,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACxD,CAAC;8GAnHU,oBAAoB;kGAApB,oBAAoB,qfALpB,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,sBAAsB,EAAE,CAAC,sECvDvE,0kEA+DA,2CDlBI,wBAAwB,+BACxB,oBAAoB,uIACpB,OAAO,0NACP,UAAU,yGACV,QAAQ,6FACR,cAAc,kGACd,UAAU,8EACV,OAAO,2JACP,SAAS;;2FAOA,oBAAoB;kBAjBhC,SAAS;8BACC;wBACP,wBAAwB;wBACxB,oBAAoB;wBACpB,OAAO;wBACP,UAAU;wBACV,QAAQ;wBACR,cAAc;wBACd,UAAU;wBACV,OAAO;wBACP,SAAS;qBACV,aACU,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,sBAAsB,EAAE,CAAC,mBACpD,uBAAuB,CAAC,MAAM,YACrC,oBAAoB;;sBAmB7B,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;;sBACzB,KAAK","sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n input,\n Input,\n OnChanges,\n OnDestroy,\n signal,\n SimpleChanges,\n inject,\n} from '@angular/core';\nimport {\n IonButton,\n IonButtons,\n IonIcon,\n IonItem,\n IonItemDivider,\n IonLabel,\n IonSpinner,\n} from '@ionic/angular/standalone';\nimport { dateToIso } from '@sneat/core';\nimport {\n ISlotUIContext,\n jsDayToWeekday,\n NewHappeningParams,\n ScheduleNavService,\n ScheduleNavServiceModule,\n sortSlotItems,\n WeekdayNumber,\n} from '@sneat/mod-schedulus-core';\nimport { WithSpaceInput } from '@sneat/space-services';\nimport { ClassName } from '@sneat/ui';\nimport { Subscription } from 'rxjs';\nimport {\n emptyCalendarFilter,\n CalendarFilterService,\n} from '../../../calendar-filter.service';\nimport { isSlotVisible } from '../../../calendar-slots';\nimport { Weekday } from '../../weekday';\nimport { isToday, isTomorrow } from '../../../calendar-core';\nimport { DaySlotItemComponent } from '../day-slot-item/day-slot-item.component';\n\n@Component({\n imports: [\n ScheduleNavServiceModule,\n DaySlotItemComponent,\n IonItem,\n IonSpinner,\n IonLabel,\n IonItemDivider,\n IonButtons,\n IonIcon,\n IonButton,\n ],\n providers: [{ provide: ClassName, useValue: 'CalendarDayComponent' }],\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'sneat-calendar-day',\n templateUrl: './calendar-day.component.html',\n})\nexport class CalendarDayComponent\n extends WithSpaceInput\n implements OnChanges, OnDestroy\n{\n private readonly filterService = inject(CalendarFilterService);\n private readonly changeDetectorRef = inject(ChangeDetectorRef);\n private readonly scheduleNavService = inject(ScheduleNavService);\n\n private slotsSubscription?: Subscription;\n private filter = emptyCalendarFilter;\n // @Input() filter?: ICalendarFilter;\n // @Input() showRegulars = true;\n // @Input() showEvents = true;\n\n public readonly $weekday = input.required<Weekday | undefined>();\n\n @Input({ required: false }) hideAddButtons = false;\n @Input() hideLastBorder = false;\n\n protected readonly $isToday = signal<boolean>(false);\n protected readonly $isTomorrow = signal<boolean>(false);\n\n public allSlots?: ISlotUIContext[];\n public slots?: ISlotUIContext[];\n public slotsHiddenByFilter?: number;\n\n public constructor() {\n super();\n const filterService = this.filterService;\n\n filterService.filter.pipe(this.takeUntilDestroyed()).subscribe({\n next: (filter) => {\n this.filter = filter;\n this.applyFilter();\n },\n });\n }\n\n protected readonly resetFilter = (event: Event) =>\n this.filterService.resetScheduleFilter(event);\n\n ngOnChanges(changes: SimpleChanges): void {\n const weekdayChange = changes['$weekday'];\n if (weekdayChange) {\n const date = this.$weekday()?.day?.date;\n this.$isToday.set(!date || isToday(date));\n this.$isTomorrow.set(isTomorrow(date));\n // if (weekdayChange.firstChange && !weekdayChange.currentValue) {\n // \treturn; // TODO: comment with explanation why we need this\n // }\n this.subscribeForSlots();\n }\n }\n\n private applyFilter(): void {\n if (this.allSlots?.length) {\n this.slots = this.allSlots\n .filter((slot) => isSlotVisible(slot, this.filter))\n .toSorted(sortSlotItems);\n this.slotsHiddenByFilter = this.allSlots.length - this.slots.length;\n // console.log(\n // \tthis.logPrefix() + '.applyFilter() =>',\n // \t'slotsHiddenByFilter:',\n // \tthis.slotsHiddenByFilter,\n // \t'filter:',\n // \tthis.filter,\n // \t'slots before filter:',\n // \tthis.allSlots,\n // \t'slots after filter:',\n // \tthis.slots,\n // );\n } else {\n // console.log(this.logPrefix() + '.applyFilter() for empty slots');\n this.slots = this.allSlots;\n this.slotsHiddenByFilter = 0;\n }\n this.changeDetectorRef.markForCheck();\n }\n\n private subscribeForSlots(): void {\n this.slotsSubscription?.unsubscribe();\n const weekday = this.$weekday();\n if (weekday?.day) {\n this.slotsSubscription = weekday.day.slots$\n .pipe(this.takeUntilDestroyed())\n .subscribe(this.processSlots);\n } else {\n this.slots = undefined;\n this.slotsHiddenByFilter = undefined;\n }\n }\n\n private readonly processSlots = (slots?: ISlotUIContext[]) => {\n this.allSlots = slots;\n this.applyFilter();\n };\n\n private readonly logPrefix = () =>\n `CalendarDayComponent{dateID=${this.$weekday()?.day?.dateID}}`;\n\n protected goNewHappening(params: NewHappeningParams): void {\n const space = this.$space();\n if (!space) {\n return;\n }\n const date = this.$weekday()?.day?.date;\n if (!date) {\n return;\n }\n params = {\n ...params,\n wd: jsDayToWeekday(date.getDay() as WeekdayNumber),\n date: dateToIso(date),\n };\n this.scheduleNavService.goNewHappening(space, params);\n }\n}\n","@if ($weekday(); as weekday) {\n @if (!weekday.day?.slots?.length) {\n <ion-item [lines]=\"hideLastBorder ? 'none' : 'full'\">\n @if (!weekday.day || weekday.day.$isLoading()) {\n <ion-spinner name=\"lines-small\" color=\"medium\" slot=\"start\" />\n <ion-label color=\"medium\">Loading...</ion-label>\n } @else {\n <ion-label color=\"medium\">\n @if ($isToday()) {\n Nothing scheduled for today.\n } @else if ($isTomorrow()) {\n Nothing scheduled for tomorrow.\n } @else {\n Nothing scheduled for this day.\n }\n </ion-label>\n }\n </ion-item>\n } @else {\n @if (slotsHiddenByFilter) {\n <ion-item-divider color=\"light\">\n <ion-label>{{ slotsHiddenByFilter }} hidden by filter.</ion-label>\n <ion-buttons slot=\"end\">\n <ion-button (click)=\"resetFilter($event)\">\n <ion-icon color=\"medium\" name=\"close-outline\" slot=\"end\" />\n <ion-label color=\"medium\">Reset filter</ion-label>\n </ion-button>\n </ion-buttons>\n </ion-item-divider>\n }\n @for (slot of slots; track slot.slot.id) {\n <sneat-day-slot-item\n [$space]=\"$space()\"\n [dateID]=\"weekday.day?.dateID\"\n [$slotContext]=\"slot\"\n />\n }\n }\n @if (!hideAddButtons) {\n <ion-item lines=\"none\">\n <ion-button\n slot=\"end\"\n fill=\"clear\"\n (click)=\"goNewHappening({ type: 'recurring' })\"\n >\n <ion-icon name=\"duplicate-outline\" slot=\"start\" />\n <ion-label color=\"medium\" style=\"text-transform: none\"\n >Add recurring\n </ion-label>\n </ion-button>\n <ion-button\n slot=\"end\"\n fill=\"clear\"\n (click)=\"goNewHappening({ type: 'single' })\"\n >\n <ion-icon name=\"add-circle-outline\" color=\"primary\" slot=\"start\" />\n <ion-label color=\"medium\" style=\"text-transform: none\"\n >Add one-timer\n </ion-label>\n </ion-button>\n </ion-item>\n }\n}\n"]}
|