UNPKG

@progress/kendo-angular-gantt

Version:
128 lines (127 loc) 9.42 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { Component } from '@angular/core'; import { ReactiveFormsModule } from '@angular/forms'; import { MappingService } from '../common/mapping.service'; import { GanttLocalizationService } from '../localization/gantt-localization.service'; import { EditService } from './edit.service'; import { FormFieldComponent, NumericTextBoxComponent, TextBoxDirective } from '@progress/kendo-angular-inputs'; import { LabelComponent } from '@progress/kendo-angular-label'; import { DateTimePickerComponent } from '@progress/kendo-angular-dateinputs'; import { TreeListSpacerComponent } from '@progress/kendo-angular-treelist'; import * as i0 from "@angular/core"; import * as i1 from "../common/mapping.service"; import * as i2 from "./edit.service"; import * as i3 from "../localization/gantt-localization.service"; import * as i4 from "@angular/forms"; /** * @hidden */ export class TaskFieldsComponent { mapper; editService; localizationService; constructor(mapper, editService, localizationService) { this.mapper = mapper; this.editService = editService; this.localizationService = localizationService; } /** * @hidden */ get formGroup() { return this.editService.taskFormGroup; } getText(token) { return this.localizationService.get(token); } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TaskFieldsComponent, deps: [{ token: i1.MappingService }, { token: i2.EditService }, { token: i3.GanttLocalizationService }], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: TaskFieldsComponent, isStandalone: true, selector: "kendo-gantt-task-fields", ngImport: i0, template: ` <form class="k-form k-form-md" [formGroup]="formGroup"> @if (formGroup.get(mapper.taskFields.title)) { <kendo-formfield> <kendo-label [for]="title" [text]="getText('titleFieldInputLabel')"></kendo-label> <input #title kendoTextBox [formControlName]="mapper.taskFields.title" /> </kendo-formfield> } <div class="k-hstack"> @if (formGroup.get(mapper.taskFields.start)) { <kendo-formfield [style.width.%]="49"> <kendo-label [for]="start" [text]="getText('startFieldInputLabel')"></kendo-label> <kendo-datetimepicker #start [formControlName]="mapper.taskFields.start"></kendo-datetimepicker> </kendo-formfield> } <kendo-treelist-spacer></kendo-treelist-spacer> @if (formGroup.get(mapper.taskFields.end)) { <kendo-formfield [style.width.%]="49"> <kendo-label [for]="end" [text]="getText('endFieldInputLabel')"></kendo-label> <kendo-datetimepicker #end [formControlName]="mapper.taskFields.end"></kendo-datetimepicker> </kendo-formfield> } </div> @if (formGroup.get(mapper.taskFields.completionRatio)) { <kendo-formfield [style.width.%]="49"> <kendo-label [for]="completionRatio" [text]="getText('completionRatioFieldInputLabel')"></kendo-label> <kendo-numerictextbox #completionRatio [formControlName]="mapper.taskFields.completionRatio" [min]="0" [max]="1" [decimals]="2" format="p2" [step]="0.01" ></kendo-numerictextbox> </kendo-formfield> } </form> `, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FormFieldComponent, selector: "kendo-formfield", inputs: ["showHints", "orientation", "showErrors", "colSpan"] }, { kind: "component", type: LabelComponent, selector: "kendo-label", inputs: ["text", "for", "optional", "labelCssStyle", "labelCssClass"], exportAs: ["kendoLabel"] }, { kind: "directive", type: TextBoxDirective, selector: "input[kendoTextBox]", inputs: ["value"] }, { kind: "component", type: DateTimePickerComponent, selector: "kendo-datetimepicker", inputs: ["focusableId", "weekDaysFormat", "showOtherMonthDays", "value", "format", "twoDigitYearMax", "tabindex", "disabledDates", "popupSettings", "adaptiveTitle", "adaptiveSubtitle", "disabled", "readonly", "readOnlyInput", "cancelButton", "formatPlaceholder", "placeholder", "steps", "focusedDate", "calendarType", "animateCalendarNavigation", "weekNumber", "min", "max", "rangeValidation", "disabledDatesValidation", "incompleteDateValidation", "autoCorrectParts", "autoSwitchParts", "autoSwitchKeys", "enableMouseWheel", "allowCaretMode", "clearButton", "autoFill", "adaptiveMode", "inputAttributes", "defaultTab", "size", "rounded", "fillMode", "headerTemplate", "footerTemplate", "footer"], outputs: ["valueChange", "open", "close", "focus", "blur", "escape"], exportAs: ["kendo-datetimepicker"] }, { kind: "component", type: TreeListSpacerComponent, selector: "kendo-treelist-spacer", inputs: ["width"] }, { kind: "component", type: NumericTextBoxComponent, selector: "kendo-numerictextbox", inputs: ["focusableId", "disabled", "readonly", "title", "autoCorrect", "format", "max", "min", "decimals", "placeholder", "step", "spinners", "rangeValidation", "tabindex", "tabIndex", "changeValueOnScroll", "selectOnFocus", "value", "maxlength", "size", "rounded", "fillMode", "inputAttributes"], outputs: ["valueChange", "focus", "blur", "inputFocus", "inputBlur"], exportAs: ["kendoNumericTextBox"] }] }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TaskFieldsComponent, decorators: [{ type: Component, args: [{ selector: 'kendo-gantt-task-fields', template: ` <form class="k-form k-form-md" [formGroup]="formGroup"> @if (formGroup.get(mapper.taskFields.title)) { <kendo-formfield> <kendo-label [for]="title" [text]="getText('titleFieldInputLabel')"></kendo-label> <input #title kendoTextBox [formControlName]="mapper.taskFields.title" /> </kendo-formfield> } <div class="k-hstack"> @if (formGroup.get(mapper.taskFields.start)) { <kendo-formfield [style.width.%]="49"> <kendo-label [for]="start" [text]="getText('startFieldInputLabel')"></kendo-label> <kendo-datetimepicker #start [formControlName]="mapper.taskFields.start"></kendo-datetimepicker> </kendo-formfield> } <kendo-treelist-spacer></kendo-treelist-spacer> @if (formGroup.get(mapper.taskFields.end)) { <kendo-formfield [style.width.%]="49"> <kendo-label [for]="end" [text]="getText('endFieldInputLabel')"></kendo-label> <kendo-datetimepicker #end [formControlName]="mapper.taskFields.end"></kendo-datetimepicker> </kendo-formfield> } </div> @if (formGroup.get(mapper.taskFields.completionRatio)) { <kendo-formfield [style.width.%]="49"> <kendo-label [for]="completionRatio" [text]="getText('completionRatioFieldInputLabel')"></kendo-label> <kendo-numerictextbox #completionRatio [formControlName]="mapper.taskFields.completionRatio" [min]="0" [max]="1" [decimals]="2" format="p2" [step]="0.01" ></kendo-numerictextbox> </kendo-formfield> } </form> `, standalone: true, imports: [ReactiveFormsModule, FormFieldComponent, LabelComponent, TextBoxDirective, DateTimePickerComponent, TreeListSpacerComponent, NumericTextBoxComponent] }] }], ctorParameters: () => [{ type: i1.MappingService }, { type: i2.EditService }, { type: i3.GanttLocalizationService }] });