From 2d02a51cbb392ada60ed9b426fff676430ffee24 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Mon, 27 Jul 2020 06:24:06 -0700 Subject: [PATCH] docs: remove constants from documented props TODO: parse constant types using the compiler --- README.md | 253 ++++++++++++++++++++++++++---------------------------- 1 file changed, 123 insertions(+), 130 deletions(-) diff --git a/README.md b/README.md index 4c391645..7181fdb7 100644 --- a/README.md +++ b/README.md @@ -537,26 +537,26 @@ import { ComboBox } from "carbon-components-svelte"; **API** -| Prop name | Type | Default | -| :--------------- | :---------------------------------------------------------- | :------------------------------ | -| items | ComboBoxItem[] | [] | -| itemToString | (item: ComboBoxItem) => string; | (item: ComboBoxItem) => string; | -| selectedIndex | number | -1 | -| value | string | "" | -| size | "sm" | "xl" | - | -| disabled | boolean | false | -| titleText | string | "" | -| placeholder | string | "" | -| helperText | string | "" | -| invalidText | string | "" | -| invalid | boolean | false | -| light | boolean | false | -| open | boolean | false | -| shouldFilterItem | (item: ComboBoxItem, value: string) => boolean | () => true | -| translateWithId | (id: any) => string; | - | -| id | string | - | -| name | string | - | -| ref | null | HTMLInputElement | null | +| Prop name | Type | Default | +| :--------------- | :---------------------------------------------------------- | :----------------------------- | +| items | ComboBoxItem[] | [] | +| itemToString | (item: ComboBoxItem) => string | (item: ComboBoxItem) => string | +| selectedIndex | number | -1 | +| value | string | "" | +| size | "sm" | "xl" | - | +| disabled | boolean | false | +| titleText | string | "" | +| placeholder | string | "" | +| helperText | string | "" | +| invalidText | string | "" | +| invalid | boolean | false | +| light | boolean | false | +| open | boolean | false | +| shouldFilterItem | (item: ComboBoxItem, value: string) => boolean | () => true | +| translateWithId | (id: any) => string | - | +| id | string | - | +| name | string | - | +| ref | null | HTMLInputElement | null | @@ -916,11 +916,11 @@ import { TableHeader } from "carbon-components-svelte"; **API** -| Prop name | Type | Default | -| :-------------- | :------------------------- | :-------- | -| scope | string | "col" | -| translateWithId | () => string; | () => ""; | -| id | string | - | +| Prop name | Type | Default | +| :-------------- | :------------------------ | :------- | +| scope | string | "col" | +| translateWithId | () => string | () => "" | +| id | string | - | @@ -1093,26 +1093,26 @@ import { Dropdown } from "carbon-components-svelte"; **API** -| Prop name | Type | Default | -| :-------------- | :------------------------------------------- | :--------------------------------------- | -| items | DropdownItem[] | [] | -| itemToString | (item: DropdownItem) => string; | (item: DropdownItem) => DropdownItemText | DropdownItemId; | -| selectedIndex | number | -1 | -| type | "default" | "inline" | "default" | -| size | "sm" | "lg" | "xl" | - | -| open | boolean | false | -| inline | boolean | false | -| light | boolean | false | -| disabled | boolean | false | -| titleText | string | "" | -| invalid | boolean | false | -| invalidText | string | "" | -| helperText | string | "" | -| label | string | - | -| translateWithId | (id: any) => string; | - | -| id | string | - | -| name | string | - | -| ref | null | HTMLButtonElement | null | +| Prop name | Type | Default | +| :-------------- | :------------------------------------------ | :--------------------------------------- | +| items | DropdownItem[] | [] | +| itemToString | (item: DropdownItem) => string | (item: DropdownItem) => DropdownItemText | DropdownItemId | +| selectedIndex | number | -1 | +| type | "default" | "inline" | "default" | +| size | "sm" | "lg" | "xl" | - | +| open | boolean | false | +| inline | boolean | false | +| light | boolean | false | +| disabled | boolean | false | +| titleText | string | "" | +| invalid | boolean | false | +| invalidText | string | "" | +| helperText | string | "" | +| label | string | - | +| translateWithId | (id: any) => string | - | +| id | string | - | +| name | string | - | +| ref | null | HTMLButtonElement | null | @@ -1158,7 +1158,7 @@ import { FileUploader } from "carbon-components-svelte"; | accept | string[] | [] | | files | string[] | [] | | multiple | boolean | false | -| clearFiles | () => any; | () => void; | +| clearFiles | () => any | () => void | | labelDescription | string | "" | | labelTitle | string | "" | | kind | "primary" | "secondary" | "tertiary" | "ghost" | "danger" | "primary" | @@ -1216,18 +1216,18 @@ import { FileUploaderDropContainer } from "carbon-components-svelte"; **API** -| Prop name | Type | Default | -| :------------ | :---------------------------------------- | :----------------------- | -| accept | string[] | [] | -| multiple | boolean | false | -| validateFiles | (files: Files) => Files | (files: Files) => Files; | -| labelText | string | "Add file" | -| role | string | "button" | -| disabled | boolean | false | -| tabindex | string | "0" | -| id | string | - | -| name | string | "" | -| ref | null | HTMLInputElement | null | +| Prop name | Type | Default | +| :------------ | :---------------------------------------- | :---------------------- | +| accept | string[] | [] | +| multiple | boolean | false | +| validateFiles | (files: Files) => Files | (files: Files) => Files | +| labelText | string | "Add file" | +| role | string | "button" | +| disabled | boolean | false | +| tabindex | string | "0" | +| id | string | - | +| name | string | "" | +| ref | null | HTMLInputElement | null | @@ -1395,7 +1395,6 @@ import { Column } from "carbon-components-svelte"; | lg | ColumnBreakpoint | - | | xlg | ColumnBreakpoint | - | | max | ColumnBreakpoint | - | -| | string[] | - | @@ -1592,15 +1591,14 @@ import { ListBoxField } from "carbon-components-svelte"; **API** -| Prop name | Type | Default | -| :-------------- | :------------------------------------------------------ | :-------------- | -| disabled | boolean | false | -| role | string | "combobox" | -| tabindex | string | "-1" | -| | { close: "close"; open: "open"; } | - | -| translateWithId | (id: ListBoxFieldTranslationId) => string; | (id) => string; | -| id | string | - | -| ref | null | HTMLElement | null | +| Prop name | Type | Default | +| :-------------- | :------------------------------------------------------ | :------------- | +| disabled | boolean | false | +| role | string | "combobox" | +| tabindex | string | "-1" | +| translateWithId | (id: ListBoxFieldTranslationId) => string; | (id) => string | +| id | string | - | +| ref | null | HTMLElement | null | @@ -1642,11 +1640,10 @@ import { ListBoxMenuIcon } from "carbon-components-svelte"; **API** -| Prop name | Type | Default | -| :-------------- | :--------------------------------------------------------- | :-------------- | -| open | boolean | false | -| | { close: "close"; open: "open" } | - | -| translateWithId | (id: ListBoxMenuIconTranslationId) => string; | (id) => string; | +| Prop name | Type | Default | +| :-------------- | :-------------------------------------------------------- | :------------- | +| open | boolean | false | +| translateWithId | (id: ListBoxMenuIconTranslationId) => string | (id) => string | @@ -1689,13 +1686,12 @@ import { ListBoxSelection } from "carbon-components-svelte"; **API** -| Prop name | Type | Default | -| :-------------- | :---------------------------------------------------------------------- | :-------------- | -| selectionCount | \* | - | -| disabled | boolean | false | -| | { clearAll: "clearAll"; clearSelection: "clearSelection" } | - | -| translateWithId | (id: ListBoxSelectionTranslationId) => string; | (id) => string; | -| ref | null | HTMLElement | null | +| Prop name | Type | Default | +| :-------------- | :--------------------------------------------------------- | :------------- | +| selectionCount | \* | - | +| disabled | boolean | false | +| translateWithId | (id: ListBoxSelectionTranslationId) => string | (id) => string | +| ref | null | HTMLElement | null | @@ -1802,7 +1798,7 @@ import { MultiSelect } from "carbon-components-svelte"; | Prop name | Type | Default | | :---------------- | :------------------------------------------------------------------------ | :---------------------------------------------------------- | | items | MultiSelectItem[] | [] | -| itemToString | (item: MultiSelectItem) => string; | (item: MultiSelectItem) => MultiSelectItemText | MultiSelectItemId; | +| itemToString | (item: MultiSelectItem) => string | (item: MultiSelectItem) => MultiSelectItemText | MultiSelectItemId | | selectedIds | MultiSelectItemId[] | [] | | value | string | "" | | size | "sm" | "lg" | "xl" | - | @@ -1816,7 +1812,7 @@ import { MultiSelect } from "carbon-components-svelte"; | locale | string | "en" | | placeholder | string | "" | | sortItem | (a: MultiSelectItem, b: MultiSelectItem) => MultiSelectItem; | (a: MultiSelectItem, b: MultiSelectItem) => MultiSelectItem | -| translateWithId | (id: any) => string; | - | +| translateWithId | (id: any) => string | - | | titleText | string | "" | | useTitleInItem | boolean | false | | invalid | boolean | false | @@ -2019,29 +2015,28 @@ import { NumberInput } from "carbon-components-svelte"; **API** -| Prop name | Type | Default | -| :-------------- | :-------------------------------------------------------------- | :---------------------------------------- | -| size | "sm" | "xl" | - | -| value | string | "" | -| step | number | 1 | -| max | number | - | -| min | number | - | -| light | boolean | false | -| readonly | boolean | false | -| mobile | boolean | false | -| allowEmpty | boolean | false | -| disabled | boolean | false | -| iconDescription | string | "" | -| invalid | boolean | false | -| invalidText | string | "Provide invalidText" | -| helperText | string | "" | -| label | string | "" | -| hideLabel | boolean | false | -| translateWithId | (id: NumberInputTranslationId) => string; | (id: NumberInputTranslationId) => string; | -| | { increment: "increment"; decrement: "decrement" } | - | -| id | string | - | -| name | string | - | -| ref | null | HTMLInputElement | null | +| Prop name | Type | Default | +| :-------------- | :---------------------------------------------------- | :--------------------------------------- | +| size | "sm" | "xl" | - | +| value | string | "" | +| step | number | 1 | +| max | number | - | +| min | number | - | +| light | boolean | false | +| readonly | boolean | false | +| mobile | boolean | false | +| allowEmpty | boolean | false | +| disabled | boolean | false | +| iconDescription | string | "" | +| invalid | boolean | false | +| invalidText | string | "Provide invalidText" | +| helperText | string | "" | +| label | string | "" | +| hideLabel | boolean | false | +| translateWithId | (id: NumberInputTranslationId) => string | (id: NumberInputTranslationId) => string | +| id | string | - | +| name | string | - | +| ref | null | HTMLInputElement | null | @@ -2163,23 +2158,23 @@ import { Pagination } from "carbon-components-svelte"; **API** -| Prop name | Type | Default | -| :---------------- | :---------------------------------------------------------------- | :--------------------------------------------------- | -| page | number | 1 | -| total | number | 0 | -| disabled | boolean | false | -| forwardText | string | "Next page" | -| backwardText | string | "Previous page" | -| itemsPerPageText | string | "Items per page:" | -| itemText | (min: number, max: number) => string; | (min: number, max: number) => string; | -| itemRangeText | (min: number, max: number, total: number) => string; | (min: number, max: number, total: number) => string; | -| pageInputDisabled | boolean | false | -| pageSize | number | 10 | -| pageSizes | number[] | [10] | -| pagesUnknown | boolean | false | -| pageText | (page: number) => string; | (current: number) => string; | -| pageRangeText | (current: number, total: number) => string; | (current: number, total: number) => string; | -| id | string | - | +| Prop name | Type | Default | +| :---------------- | :--------------------------------------------------------------- | :-------------------------------------------------- | +| page | number | 1 | +| total | number | 0 | +| disabled | boolean | false | +| forwardText | string | "Next page" | +| backwardText | string | "Previous page" | +| itemsPerPageText | string | "Items per page:" | +| itemText | (min: number, max: number) => string | (min: number, max: number) => string | +| itemRangeText | (min: number, max: number, total: number) => string | (min: number, max: number, total: number) => string | +| pageInputDisabled | boolean | false | +| pageSize | number | 10 | +| pageSizes | number[] | [10] | +| pagesUnknown | boolean | false | +| pageText | (page: number) => string | (current: number) => string | +| pageRangeText | (current: number, total: number) => string | (current: number, total: number) => string | +| id | string | - | @@ -2230,7 +2225,6 @@ import { PaginationNav } from "carbon-components-svelte"; | loop | boolean | false | | forwardText | string | "Next page" | | backwardText | string | "Next page" | -| | 4 | - | @@ -2595,13 +2589,12 @@ import { SkeletonText } from "carbon-components-svelte"; **API** -| Prop name | Type | Default | -| :-------- | :-------------------- | :------ | -| lines | number | 3 | -| heading | boolean | false | -| paragraph | boolean | false | -| width | string | "100%" | -| | number[] | - | +| Prop name | Type | Default | +| :-------- | :------------------- | :------ | +| lines | number | 3 | +| heading | boolean | false | +| paragraph | boolean | false | +| width | string | "100%" |