UNPKG

@progress/kendo-angular-scheduler

Version:

Kendo UI Scheduler Angular - Outlook or Google-style angular scheduler calendar. Full-featured and customizable embedded scheduling from the creator developers trust for professional UI components.

82 lines (81 loc) 3.76 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { Directive, Input, HostBinding, ElementRef, Renderer2, ChangeDetectorRef } from '@angular/core'; import { RecurrenceService } from './recurrence.service'; import * as i0 from "@angular/core"; import * as i1 from "./recurrence.service"; /** * @hidden */ export class RepeatOnRadioButtonDirective { el; renderer; recurrence; changeDetector; type = 'radio'; radioClass = true; radioSizeClass = true; set repeatOnRule(value) { const parts = value.split('-'); this._repeatOnRule = parts[0]; this._uniqueId = parts[1]; } destroyClick; _repeatOnRule; _uniqueId; constructor(el, renderer, recurrence, changeDetector) { this.el = el; this.renderer = renderer; this.recurrence = recurrence; this.changeDetector = changeDetector; this.destroyClick = this.renderer.listen(this.elem, 'click', this.onClick.bind(this)); } ngOnInit() { this.renderer.setAttribute(this.elem, 'id', `k-repeaton-${this._repeatOnRule}-${this._uniqueId}`); this.renderer.setAttribute(this.elem, 'name', `day-${this._uniqueId}`); } ngAfterContentChecked() { this.setCheckedState(); } ngOnDestroy() { if (this.destroyClick) { this.destroyClick(); } } onClick() { if (this.elem.checked) { this.recurrence.repeatOnRule = this._repeatOnRule; this.changeDetector.markForCheck(); } } setCheckedState() { const isChecked = this._repeatOnRule === this.recurrence.repeatOnRule; this.renderer.setProperty(this.elem, 'checked', isChecked); } get elem() { return this.el.nativeElement; } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RepeatOnRadioButtonDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.RecurrenceService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: RepeatOnRadioButtonDirective, isStandalone: true, selector: "[kendoRecurrenceRepeatOnRadioButton]", inputs: { repeatOnRule: ["kendoRecurrenceRepeatOnRadioButton", "repeatOnRule"] }, host: { properties: { "attr.type": "this.type", "class.k-radio": "this.radioClass", "class.k-radio-md": "this.radioSizeClass" } }, ngImport: i0 }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RepeatOnRadioButtonDirective, decorators: [{ type: Directive, args: [{ selector: '[kendoRecurrenceRepeatOnRadioButton]', standalone: true }] }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1.RecurrenceService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { type: [{ type: HostBinding, args: ['attr.type'] }], radioClass: [{ type: HostBinding, args: ['class.k-radio'] }], radioSizeClass: [{ type: HostBinding, args: ['class.k-radio-md'] }], repeatOnRule: [{ type: Input, args: ["kendoRecurrenceRepeatOnRadioButton"] }] } });