diff --git a/apps/demos/Demos/Pagination/Overview/React/EmployeeCard.tsx b/apps/demos/Demos/Pagination/Overview/React/EmployeeCard.tsx index f089a0dc9ffe..be9d07419c7f 100644 --- a/apps/demos/Demos/Pagination/Overview/React/EmployeeCard.tsx +++ b/apps/demos/Demos/Pagination/Overview/React/EmployeeCard.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Employee } from './data'; +import type { Employee } from './data'; interface EmployeeCardProps { employee: Employee; diff --git a/apps/demos/Demos/Pagination/Overview/React/EmployeesGallery.tsx b/apps/demos/Demos/Pagination/Overview/React/EmployeesGallery.tsx index c8667c9b344f..2c0a94a5dc4d 100644 --- a/apps/demos/Demos/Pagination/Overview/React/EmployeesGallery.tsx +++ b/apps/demos/Demos/Pagination/Overview/React/EmployeesGallery.tsx @@ -1,6 +1,6 @@ import React from 'react'; import EmployeeCard from './EmployeeCard.tsx'; -import { Employee } from './data'; +import type { Employee } from './data'; interface EmployeeGalleryProps { employees: Employee[]; diff --git a/apps/demos/Demos/Scheduler/AllDayPanelMode/React/App.tsx b/apps/demos/Demos/Scheduler/AllDayPanelMode/React/App.tsx index 6b4c4dc26166..73a8bc7ba217 100644 --- a/apps/demos/Demos/Scheduler/AllDayPanelMode/React/App.tsx +++ b/apps/demos/Demos/Scheduler/AllDayPanelMode/React/App.tsx @@ -1,6 +1,8 @@ import React, { useCallback, useState } from 'react'; -import Scheduler, { type SchedulerTypes } from 'devextreme-react/scheduler'; -import RadioGroup, { type RadioGroupTypes } from 'devextreme-react/radio-group'; +import Scheduler from 'devextreme-react/scheduler'; +import RadioGroup from 'devextreme-react/radio-group'; +import type { SchedulerTypes } from 'devextreme-react/scheduler'; +import type { RadioGroupTypes } from 'devextreme-react/radio-group'; import { data } from './data.ts'; const currentDate = new Date(2021, 2, 28); diff --git a/apps/demos/Demos/Scheduler/AppointmentCountPerCell/React/App.tsx b/apps/demos/Demos/Scheduler/AppointmentCountPerCell/React/App.tsx index a125356e7a17..f378a4cd0a9a 100644 --- a/apps/demos/Demos/Scheduler/AppointmentCountPerCell/React/App.tsx +++ b/apps/demos/Demos/Scheduler/AppointmentCountPerCell/React/App.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import Scheduler, { Resource, type SchedulerTypes } from 'devextreme-react/scheduler'; +import Scheduler, { Resource } from 'devextreme-react/scheduler'; +import type { SchedulerTypes } from 'devextreme-react/scheduler'; import { data, resourcesData } from './data.ts'; diff --git a/apps/demos/Demos/Scheduler/BasicViews/React/App.tsx b/apps/demos/Demos/Scheduler/BasicViews/React/App.tsx index 062700c348c9..1f3901e45b8b 100644 --- a/apps/demos/Demos/Scheduler/BasicViews/React/App.tsx +++ b/apps/demos/Demos/Scheduler/BasicViews/React/App.tsx @@ -1,6 +1,7 @@ import React from 'react'; -import Scheduler, { type SchedulerTypes } from 'devextreme-react/scheduler'; +import Scheduler from 'devextreme-react/scheduler'; +import type { SchedulerTypes } from 'devextreme-react/scheduler'; import { data } from './data.ts'; diff --git a/apps/demos/Demos/Scheduler/CellTemplates/React/App.tsx b/apps/demos/Demos/Scheduler/CellTemplates/React/App.tsx index 5cd77776e4a8..8a7c20c8c4c1 100644 --- a/apps/demos/Demos/Scheduler/CellTemplates/React/App.tsx +++ b/apps/demos/Demos/Scheduler/CellTemplates/React/App.tsx @@ -37,7 +37,8 @@ const notifyDisableDate = () => { }; const onContentReady = (e: SchedulerTypes.ContentReadyEvent) => { - setComponentAria(e.component?.$element()); + const element = e.component?.element(); + element && setComponentAria(element); }; const applyDisableDatesToDateEditors = (form: ReturnType) => { @@ -75,11 +76,11 @@ const onAppointmentUpdating = (e: SchedulerTypes.AppointmentUpdatingEvent) => { } }; -const setComponentAria = (element) => { - const prevAria = element?.attr('aria-label') || ''; +const setComponentAria = (element: HTMLElement) => { + const prevAria = element.getAttribute('aria-label') || ''; const description = ariaDescription(); const nextAria = `${prevAria}${description ? ` ${description}` : ''}`; - element?.attr('aria-label', nextAria); + element.setAttribute('aria-label', nextAria); }; const App = () => { diff --git a/apps/demos/Demos/Scheduler/CellTemplates/React/DateCell.tsx b/apps/demos/Demos/Scheduler/CellTemplates/React/DateCell.tsx index 686bd1e69574..4e98d0558221 100644 --- a/apps/demos/Demos/Scheduler/CellTemplates/React/DateCell.tsx +++ b/apps/demos/Demos/Scheduler/CellTemplates/React/DateCell.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { type SchedulerTypes } from 'devextreme-react/scheduler'; +import type { SchedulerTypes } from 'devextreme-react/scheduler'; import Utils from './utils.ts'; interface DateCellProps { diff --git a/apps/demos/Demos/Scheduler/CellTemplates/React/TimeCell.tsx b/apps/demos/Demos/Scheduler/CellTemplates/React/TimeCell.tsx index d36467501b57..1ecdaaaa4820 100644 --- a/apps/demos/Demos/Scheduler/CellTemplates/React/TimeCell.tsx +++ b/apps/demos/Demos/Scheduler/CellTemplates/React/TimeCell.tsx @@ -12,7 +12,7 @@ const TimeCell = (props: TimeCellProps) => { const hasCoffeeCupIcon = Utils.hasCoffeeCupIcon(date); return ( -
+
{text} {hasCoffeeCupIcon &&
}
diff --git a/apps/demos/Demos/Scheduler/CellTemplates/React/utils.ts b/apps/demos/Demos/Scheduler/CellTemplates/React/utils.ts index 97dde1744aaa..a585e5ae05d8 100644 --- a/apps/demos/Demos/Scheduler/CellTemplates/React/utils.ts +++ b/apps/demos/Demos/Scheduler/CellTemplates/React/utils.ts @@ -29,9 +29,9 @@ export default class Utils { } static isValidAppointment(component: SchedulerTypes.AppointmentAddingEvent['component'], appointmentData: SchedulerTypes.AppointmentAddingEvent['appointmentData']) { - const startDate = new Date(appointmentData.startDate); - const endDate = new Date(appointmentData.endDate); - const cellDuration = component.option('cellDuration'); + const startDate = appointmentData.startDate ? new Date(appointmentData.startDate) : new Date(); + const endDate = appointmentData.endDate ? new Date(appointmentData.endDate) : new Date(); + const cellDuration = Number(component.option('cellDuration')); return Utils.isValidAppointmentInterval(startDate, endDate, cellDuration); } diff --git a/apps/demos/Demos/Scheduler/CellTemplates/ReactJs/App.js b/apps/demos/Demos/Scheduler/CellTemplates/ReactJs/App.js index 66e165ea6ddc..5c3a51926885 100644 --- a/apps/demos/Demos/Scheduler/CellTemplates/ReactJs/App.js +++ b/apps/demos/Demos/Scheduler/CellTemplates/ReactJs/App.js @@ -37,7 +37,8 @@ const notifyDisableDate = () => { ); }; const onContentReady = (e) => { - setComponentAria(e.component?.$element()); + const element = e.component?.element(); + element && setComponentAria(element); }; const applyDisableDatesToDateEditors = (form) => { const startDateEditor = form.getEditor('startDate'); @@ -70,10 +71,10 @@ const onAppointmentUpdating = (e) => { } }; const setComponentAria = (element) => { - const prevAria = element?.attr('aria-label') || ''; + const prevAria = element.getAttribute('aria-label') || ''; const description = ariaDescription(); const nextAria = `${prevAria}${description ? ` ${description}` : ''}`; - element?.attr('aria-label', nextAria); + element.setAttribute('aria-label', nextAria); }; const App = () => { const [currentView, setCurrentView] = useState(views[0]); diff --git a/apps/demos/Demos/Scheduler/CellTemplates/ReactJs/TimeCell.js b/apps/demos/Demos/Scheduler/CellTemplates/ReactJs/TimeCell.js index d527447d9eb4..497799ec5498 100644 --- a/apps/demos/Demos/Scheduler/CellTemplates/ReactJs/TimeCell.js +++ b/apps/demos/Demos/Scheduler/CellTemplates/ReactJs/TimeCell.js @@ -6,7 +6,7 @@ const TimeCell = (props) => { const isDinner = Utils.isDinner(date); const hasCoffeeCupIcon = Utils.hasCoffeeCupIcon(date); return ( -
+
{text} {hasCoffeeCupIcon &&
}
diff --git a/apps/demos/Demos/Scheduler/CellTemplates/ReactJs/utils.js b/apps/demos/Demos/Scheduler/CellTemplates/ReactJs/utils.js index c54f886a63a7..74d5884f577a 100644 --- a/apps/demos/Demos/Scheduler/CellTemplates/ReactJs/utils.js +++ b/apps/demos/Demos/Scheduler/CellTemplates/ReactJs/utils.js @@ -27,9 +27,9 @@ export default class Utils { } static isValidAppointment(component, appointmentData) { - const startDate = new Date(appointmentData.startDate); - const endDate = new Date(appointmentData.endDate); - const cellDuration = component.option('cellDuration'); + const startDate = appointmentData.startDate ? new Date(appointmentData.startDate) : new Date(); + const endDate = appointmentData.endDate ? new Date(appointmentData.endDate) : new Date(); + const cellDuration = Number(component.option('cellDuration')); return Utils.isValidAppointmentInterval(startDate, endDate, cellDuration); } diff --git a/apps/demos/Demos/Scheduler/CellTemplates/Vue/utils.ts b/apps/demos/Demos/Scheduler/CellTemplates/Vue/utils.ts index 721f6defa428..5b8e95fea8d0 100644 --- a/apps/demos/Demos/Scheduler/CellTemplates/Vue/utils.ts +++ b/apps/demos/Demos/Scheduler/CellTemplates/Vue/utils.ts @@ -1,4 +1,4 @@ -import { type DxScheduler } from 'devextreme-vue'; +import type { DxScheduler } from 'devextreme-vue'; import { dinnerTime, holidays } from './data.ts'; export default class Utils { diff --git a/apps/demos/Demos/Scheduler/ContextMenu/Angular/app/app.service.ts b/apps/demos/Demos/Scheduler/ContextMenu/Angular/app/app.service.ts index 3f48e91e2aa2..58ab97226925 100644 --- a/apps/demos/Demos/Scheduler/ContextMenu/Angular/app/app.service.ts +++ b/apps/demos/Demos/Scheduler/ContextMenu/Angular/app/app.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { type DxContextMenuTypes } from 'devextreme-angular/ui/context-menu'; +import type { DxContextMenuTypes } from 'devextreme-angular/ui/context-menu'; export interface Appointment { text: string; diff --git a/apps/demos/Demos/Scheduler/ContextMenu/React/App.tsx b/apps/demos/Demos/Scheduler/ContextMenu/React/App.tsx index e9c954b0d0d0..daca502ff623 100644 --- a/apps/demos/Demos/Scheduler/ContextMenu/React/App.tsx +++ b/apps/demos/Demos/Scheduler/ContextMenu/React/App.tsx @@ -15,7 +15,7 @@ const appointmentClassName = '.dx-scheduler-appointment'; const cellClassName = '.dx-scheduler-date-table-cell'; const onContextMenuItemClick = (e: ContextMenuTypes.ItemClickEvent) => { - e.itemData.onItemClick?.(e); + e.itemData?.onItemClick?.(e); }; const App = () => { @@ -35,7 +35,7 @@ const App = () => { ...item, onItemClick: (e: ContextMenuTypes.ItemClickEvent) => scheduler?.updateAppointment(appointmentData, { ...appointmentData, - ...{ roomId: [e.itemData.id] }, + ...{ roomId: [e.itemData?.id] }, }), })); diff --git a/apps/demos/Demos/Scheduler/ContextMenu/React/types.ts b/apps/demos/Demos/Scheduler/ContextMenu/React/types.ts index b24978c31031..854fba22f8c6 100644 --- a/apps/demos/Demos/Scheduler/ContextMenu/React/types.ts +++ b/apps/demos/Demos/Scheduler/ContextMenu/React/types.ts @@ -1,5 +1,5 @@ import type { SchedulerTypes } from 'devextreme-react/scheduler'; -import { type ContextMenuTypes } from 'devextreme-react/context-menu'; +import type { ContextMenuTypes } from 'devextreme-react/context-menu'; export type Appointment = SchedulerTypes.Appointment & { roomId: number[] }; diff --git a/apps/demos/Demos/Scheduler/ContextMenu/ReactJs/App.js b/apps/demos/Demos/Scheduler/ContextMenu/ReactJs/App.js index 2a7dd7ceb3a7..2052f22053ec 100644 --- a/apps/demos/Demos/Scheduler/ContextMenu/ReactJs/App.js +++ b/apps/demos/Demos/Scheduler/ContextMenu/ReactJs/App.js @@ -8,7 +8,7 @@ const views = ['day', 'month']; const appointmentClassName = '.dx-scheduler-appointment'; const cellClassName = '.dx-scheduler-date-table-cell'; const onContextMenuItemClick = (e) => { - e.itemData.onItemClick?.(e); + e.itemData?.onItemClick?.(e); }; const App = () => { const schedulerRef = useRef(null); @@ -26,7 +26,7 @@ const App = () => { onItemClick: (e) => scheduler?.updateAppointment(appointmentData, { ...appointmentData, - ...{ roomId: [e.itemData.id] }, + ...{ roomId: [e.itemData?.id] }, }), })); setTarget(appointmentClassName); diff --git a/apps/demos/Demos/Scheduler/CurrentTimeIndicator/React/App.tsx b/apps/demos/Demos/Scheduler/CurrentTimeIndicator/React/App.tsx index 3a415c2a8e58..2cdbdb986692 100644 --- a/apps/demos/Demos/Scheduler/CurrentTimeIndicator/React/App.tsx +++ b/apps/demos/Demos/Scheduler/CurrentTimeIndicator/React/App.tsx @@ -1,7 +1,10 @@ import React, { useCallback, useState } from 'react'; -import Scheduler, { Resource, type SchedulerTypes } from 'devextreme-react/scheduler'; -import { Switch, type SwitchTypes } from 'devextreme-react/switch'; -import { NumberBox, type NumberBoxTypes } from 'devextreme-react/number-box'; +import Scheduler, { Resource } from 'devextreme-react/scheduler'; +import { Switch } from 'devextreme-react/switch'; +import { NumberBox } from 'devextreme-react/number-box'; +import type { SchedulerTypes } from 'devextreme-react/scheduler'; +import type { SwitchTypes } from 'devextreme-react/switch'; +import type { NumberBoxTypes } from 'devextreme-react/number-box'; import { data, moviesData } from './data.ts'; import AppointmentTemplate from './AppointmentTemplate.tsx'; diff --git a/apps/demos/Demos/Scheduler/CurrentTimeIndicator/Vue/AppointmentTemplate.vue b/apps/demos/Demos/Scheduler/CurrentTimeIndicator/Vue/AppointmentTemplate.vue index 9c2e165e47a1..b2939d9766f1 100644 --- a/apps/demos/Demos/Scheduler/CurrentTimeIndicator/Vue/AppointmentTemplate.vue +++ b/apps/demos/Demos/Scheduler/CurrentTimeIndicator/Vue/AppointmentTemplate.vue @@ -10,7 +10,7 @@