From fd7f0c80164c2cd72d4c7ea7b852294ff814b856 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 4 Dec 2019 15:27:07 -0700 Subject: [PATCH 1/2] Added descriptions for all widget properties --- src/calendar/CalendarCell.tsx | 26 +++++++---------- src/calendar/DatePicker.tsx | 30 ++++++++----------- src/checkbox/index.tsx | 20 +++++++++++-- src/chip/index.tsx | 2 +- src/combobox/index.tsx | 3 ++ src/global-event/index.tsx | 2 ++ src/grid/Body.tsx | 10 +++++++ src/grid/Cell.tsx | 4 +++ src/grid/Footer.tsx | 3 ++ src/grid/Header.tsx | 7 +++++ src/grid/Row.tsx | 4 +++ src/helper-text/index.tsx | 2 ++ src/label/index.tsx | 16 +++++----- src/listbox/ListboxOption.tsx | 9 +++++- src/listbox/index.tsx | 3 +- src/menu/ListBoxItem.tsx | 2 +- src/menu/MenuItem.tsx | 2 +- src/popup/index.tsx | 6 ++-- src/radio/index.tsx | 32 ++++++++++---------- src/range-slider/index.tsx | 50 ++++++++++++++++---------------- src/select/index.tsx | 28 +++++++++--------- src/slider/index.tsx | 30 +++++++++---------- src/snackbar/index.tsx | 12 ++++---- src/split-pane/index.tsx | 4 +-- src/tab-controller/TabButton.tsx | 34 +++++++++------------- src/tab/index.tsx | 2 +- src/text-area/index.tsx | 40 ++++++++++++------------- src/text-input/index.tsx | 2 +- src/time-picker/index.tsx | 24 +++++++-------- src/toolbar/index.tsx | 2 +- 30 files changed, 225 insertions(+), 186 deletions(-) diff --git a/src/calendar/CalendarCell.tsx b/src/calendar/CalendarCell.tsx index 507a69bea3..7ac9a4606d 100644 --- a/src/calendar/CalendarCell.tsx +++ b/src/calendar/CalendarCell.tsx @@ -5,32 +5,26 @@ import { v } from '@dojo/framework/core/vdom'; import { DNode } from '@dojo/framework/core/interfaces'; import * as css from '../theme/default/calendar.m.css'; -/** - * @type CalendarCellProperties - * - * Properties that can be set on a Calendar Date Cell - * - * @property callFocus Used to immediately call focus on the cell - * @property date Integer date value - * @property disabled Boolean, whether the date is in the displayed month - * @property focusable Boolean, whether the date can receive tab focus - * @property onClick Callback function for the click event - * @property onFocusCalled Callback function when the cell receives focus - * @property onKeyDown Callback function for the key down event - * @property outOfRange Boolean, true if the date is outside the min/max - * @property selected True if the date is currently selected - * @property today True if the date the same as the current day - */ export interface CalendarCellProperties extends ThemedProperties { + /** Used to immediately call focus on the cell */ callFocus?: boolean; + /** The set date value */ date: number; + /** Whether the date is in the displayed month */ disabled?: boolean; + /** Whether the date can receive tab focus */ focusable?: boolean; + /** Handler for the click event */ onClick?(date: number, disabled: boolean): void; + /** Handler for when the cell receives focus */ onFocusCalled?(): void; + /** Handler for the key down event */ onKeyDown?(key: number, preventDefault: () => void): void; + /** if the date is outside the min/max */ outOfRange?: boolean; + /** if the date is currently selected */ selected?: boolean; + /** if the date the same as the current day */ today?: boolean; } diff --git a/src/calendar/DatePicker.tsx b/src/calendar/DatePicker.tsx index 8167c7edd4..f4f6fe5aae 100644 --- a/src/calendar/DatePicker.tsx +++ b/src/calendar/DatePicker.tsx @@ -28,36 +28,30 @@ export enum Controls { year = 'year' } -/** - * @type DatePickerProperties - * - * Properties that can be set on a Calendar component - * - * @property labelId Set id to reference label containing current month and year - * @property labels Customize or internationalize accessible helper text - * @property maxDate Maximum date to be picked - * @property minDate Minimum date to be picked - * @property month Currently displayed month, zero-based - * @property monthNames Array of full and abbreviated month names - * @property onPopupChange Called when a user action occurs that triggers a change in the month or year popup state - * @property onRequestMonthChange Called when a month should change; receives the zero-based month number - * @property onRequestYearChange Called when a year should change; receives the year as an integer - * @property renderMonthLabel Format the displayed current month and year - * @property year Currently displayed year - * @property yearRange Number of years to display in a single page of the year popup - */ export interface DatePickerProperties extends ThemedProperties { + /** Id to reference label containing current month and year */ labelId?: string; + /** Customize or internationalize accessible helper text */ labels: typeof calendarBundle.messages; + /** Maximum date to be picked */ maxDate?: Date; + /** Minimum date to be picked */ minDate?: Date; + /** Currently displayed month (zero-based) */ month: number; + /** Array of full and abbreviated month names */ monthNames: { short: string; long: string }[]; + /** Handles when a user action occurs that triggers a change in the month or year popup state */ onPopupChange?(open: boolean): void; + /** Handles when a month should change (month is zero-based) */ onRequestMonthChange?(month: number): void; + /** Handles when a year should change */ onRequestYearChange?(year: number): void; + /** Formats the displayed current month and year */ renderMonthLabel?(month: number, year: number): string; + /** Currently displayed year */ year: number; + /** Number of years to display in a single page of the year popup */ yearRange?: number; } diff --git a/src/checkbox/index.tsx b/src/checkbox/index.tsx index 44a85d1b26..010380225f 100644 --- a/src/checkbox/index.tsx +++ b/src/checkbox/index.tsx @@ -12,29 +12,43 @@ import * as css from '../theme/default/checkbox.m.css'; export interface CheckboxProperties extends ThemedProperties, FocusProperties { /** Custom aria attributes */ aria?: { [key: string]: string | null }; - /** Checked/unchecked property of the radio */ + /** Checked/unchecked property of the control */ checked?: boolean; + /** Set the disabled property of the control */ disabled?: boolean; + /** Adds a