Skip to content

Commit

Permalink
update collection prefs api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pan-kot committed Nov 13, 2024
1 parent 18fb83b commit 740c077
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 16 deletions.
23 changes: 15 additions & 8 deletions src/__tests__/snapshot-tests/__snapshots__/documenter.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5217,20 +5217,24 @@ You must set the current value in the \`preferences.contentDensity\` property.",
"type": "CollectionPreferencesProps.ContentDensityPreference",
},
{
"description": "Configures the built-in content display preference for order and visibility of columns in a table.
Once set, the component displays this preference in the modal.
"description": "Configures the built-in content display preference for order and visibility of the table columns.
Recommended for table and not applicable for cards.

Cannot be used together with \`visibleContentPreference\`.

If you set it, the component displays this preference in the modal.

It contains the following:
- \`title\` (string) - Specifies the text displayed at the top of the preference.
- \`description\` (string) - Specifies the description displayed below the title.
- \`options\` - Specifies an array of options for reordering and visible content selection.
- \`enableColumnFiltering\` (boolean) - Adds a columns filter.
- \`liveAnnouncementDndStarted\` ((position: number, total: number) => string) - (Optional) Adds a message to be announced by screen readers when an option is picked.
- \`liveAnnouncementDndDiscarded\` (string) - (Optional) Adds a message to be announced by screen readers when a reordering action is canceled.
- \`liveAnnouncementDndItemReordered\` ((initialPosition: number, currentPosition: number, total: number) => string) - (Optional) Adds a message to be announced by screen readers when an item is being moved.
- \`liveAnnouncementDndItemCommitted\` ((initialPosition: number, finalPosition: number, total: number) => string) - (Optional) Adds a message to be announced by screen readers when a reordering action is committed.
- \`dragHandleAriaDescription\` (string) - (Optional) Adds an ARIA description for the drag handle.
- \`dragHandleAriaLabel\` (string) - (Optional) Adds an ARIA label for the drag handle.
- \`options\` - Specifies an array of options for reordering and visible content selection.

Each option contains the following:
- \`id\` (string) - Corresponds to a table column \`id\`.
Expand Down Expand Up @@ -5451,8 +5455,8 @@ of the most recent getModalRoot call as an argument.",
"type": "(rootElement: HTMLElement) => void",
},
{
"description": "Configures the sticky columns preference.
You can set it for both left and right columns.
"description": "Configures the sticky columns preference that can be set for both left and right columns.
If you set it, the component displays this preference in the modal.

It contains the following:
- \`label\` (string) - Specifies the label for each radio group.
Expand Down Expand Up @@ -5518,17 +5522,20 @@ You must set the current value in the \`preferences.stripedRows\` property.",
"type": "string",
},
{
"description": "Configures the built-in "visible content selection" preference (for example, visible sections in cards).
If you set it, the component displays this preference in the modal.
"description": "Configures the built-in visible sections preference for cards or visible columns for table.
Recommended for cards. For table use \`contentDisplayPreference\` instead.

Cannot be used together with \`contentDisplayPreference\`.

If you set it, the component displays this preference in the modal.

It contains the following:
- \`title\` (string) - Specifies the text displayed at the top of the preference.
- \`options\` - Specifies an array of groups of options for visible content selection.

Each group of options contains the following:
- \`label\` (string) - The text to display as a title for the options group.
- \`options\` - Specifies an aray of options in the group. Each option contains the following:
- \`options\` - Specifies an array of options in the group. Each option contains the following:
- \`id\` (string) - Corresponds to a column \`id\` for tables or to a section \`id\` for cards.
- \`label\` (string) - Specifies a short description of the content.
- \`editable\` (boolean) - (Optional) Determines whether the user is able to toggle its visibility. This is \`true\` by default.
Expand Down
23 changes: 15 additions & 8 deletions src/collection-preferences/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ export interface CollectionPreferencesProps<CustomPreferenceType = any> extends
*/
contentDensityPreference?: CollectionPreferencesProps.ContentDensityPreference;
/**
* Configures the sticky columns preference.
* Configures the sticky columns preference that can be set for both left and right columns.
*
* You can set it for both left and right columns.
* If you set it, the component displays this preference in the modal.
*
* It contains the following:
* - `label` (string) - Specifies the label for each radio group.
Expand All @@ -91,21 +91,25 @@ export interface CollectionPreferencesProps<CustomPreferenceType = any> extends
*/
stickyColumnsPreference?: CollectionPreferencesProps.StickyColumnsPreference;
/**
* Configures the built-in content display preference for order and visibility of columns in a table.
* Configures the built-in content display preference for order and visibility of the table columns.
*
* Recommended for table and not applicable for cards.
*
* Once set, the component displays this preference in the modal.
* Cannot be used together with `visibleContentPreference`.
*
* If you set it, the component displays this preference in the modal.
*
* It contains the following:
* - `title` (string) - Specifies the text displayed at the top of the preference.
* - `description` (string) - Specifies the description displayed below the title.
* - `options` - Specifies an array of options for reordering and visible content selection.
* - `enableColumnFiltering` (boolean) - Adds a columns filter.
* - `liveAnnouncementDndStarted` ((position: number, total: number) => string) - (Optional) Adds a message to be announced by screen readers when an option is picked.
* - `liveAnnouncementDndDiscarded` (string) - (Optional) Adds a message to be announced by screen readers when a reordering action is canceled.
* - `liveAnnouncementDndItemReordered` ((initialPosition: number, currentPosition: number, total: number) => string) - (Optional) Adds a message to be announced by screen readers when an item is being moved.
* - `liveAnnouncementDndItemCommitted` ((initialPosition: number, finalPosition: number, total: number) => string) - (Optional) Adds a message to be announced by screen readers when a reordering action is committed.
* - `dragHandleAriaDescription` (string) - (Optional) Adds an ARIA description for the drag handle.
* - `dragHandleAriaLabel` (string) - (Optional) Adds an ARIA label for the drag handle.
* - `options` - Specifies an array of options for reordering and visible content selection.
*
* Each option contains the following:
* - `id` (string) - Corresponds to a table column `id`.
Expand All @@ -117,18 +121,21 @@ export interface CollectionPreferencesProps<CustomPreferenceType = any> extends
*/
contentDisplayPreference?: CollectionPreferencesProps.ContentDisplayPreference;
/**
* Configures the built-in "visible content selection" preference (for example, visible sections in cards).
* Configures the built-in visible sections preference for cards or visible columns for table.
*
* Recommended for cards. For table use `contentDisplayPreference` instead.
*
* If you set it, the component displays this preference in the modal.
* Cannot be used together with `contentDisplayPreference`.
*
* If you set it, the component displays this preference in the modal.
*
* It contains the following:
* - `title` (string) - Specifies the text displayed at the top of the preference.
* - `options` - Specifies an array of groups of options for visible content selection.
*
* Each group of options contains the following:
* - `label` (string) - The text to display as a title for the options group.
* - `options` - Specifies an aray of options in the group. Each option contains the following:
* - `options` - Specifies an array of options in the group. Each option contains the following:
* - `id` (string) - Corresponds to a column `id` for tables or to a section `id` for cards.
* - `label` (string) - Specifies a short description of the content.
* - `editable` (boolean) - (Optional) Determines whether the user is able to toggle its visibility. This is `true` by default.
Expand Down

0 comments on commit 740c077

Please sign in to comment.