Skip to content

Commit 4f7d2ea

Browse files
Copilothuangyiirene
andcommitted
Address PR review feedback: Add JSDoc comments and remove redundant property
- Added JSDoc comments to field name mappings (titleField, startField, etc.) for auto-documentation - Removed redundant 'defaultView' property, keeping only 'view' for clarity - Updated 'view' property label to 'View Mode' with description Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
1 parent 4c56bbb commit 4f7d2ea

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

packages/components/src/renderers/complex/calendar-view.tsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ ComponentRegistry.register('calendar-view',
1010
if (!schema.data || !Array.isArray(schema.data)) return [];
1111

1212
return schema.data.map((record: any, index: number) => {
13-
// Get field values based on field mappings
13+
/** Field name to use for event title display */
1414
const titleField = schema.titleField || 'title';
15+
/** Field name containing the event start date/time */
1516
const startField = schema.startDateField || 'start';
17+
/** Field name containing the event end date/time (optional) */
1618
const endField = schema.endDateField || 'end';
19+
/** Field name to determine event color or color category */
1720
const colorField = schema.colorField || 'color';
21+
/** Field name indicating if event is all-day */
1822
const allDayField = schema.allDayField || 'allDay';
1923

2024
const title = record[titleField] || 'Untitled';
@@ -91,7 +95,7 @@ ComponentRegistry.register('calendar-view',
9195
return (
9296
<CalendarView
9397
events={events}
94-
view={schema.view || schema.defaultView || 'month'}
98+
view={schema.view || 'month'}
9599
currentDate={schema.currentDate ? new Date(schema.currentDate) : undefined}
96100
onEventClick={handleEventClick}
97101
onDateClick={schema.allowCreate || schema.onDateClick ? handleDateClick : undefined}
@@ -157,14 +161,8 @@ ComponentRegistry.register('calendar-view',
157161
type: 'enum',
158162
enum: ['month', 'week', 'day'],
159163
defaultValue: 'month',
160-
label: 'Default View'
161-
},
162-
{
163-
name: 'defaultView',
164-
type: 'enum',
165-
enum: ['month', 'week', 'day'],
166-
defaultValue: 'month',
167-
label: 'Default View (alias)'
164+
label: 'View Mode',
165+
description: 'Calendar view mode (month, week, or day)'
168166
},
169167
{
170168
name: 'currentDate',

0 commit comments

Comments
 (0)