Skip to content

Commit

Permalink
docs(events): added missing events to docs (carbon-design-system#11479)
Browse files Browse the repository at this point in the history
### Related Ticket(s)
carbon-design-system#11350 

### Description
Our current docs lack some of the events our components dispatch, this includes them in the JSDoc description using `@fires`.

### Changelog

**New**

- added missing events from component docs in CWC

<!-- React and Web Component deploy previews are enabled by default. -->
<!-- To enable additional available deploy previews, apply the following -->
<!-- labels for the corresponding package: -->
<!-- *** "test: e2e": Codesandbox examples and e2e integration tests -->
<!-- *** "package: services": Services -->
<!-- *** "package: utilities": Utilities -->
<!-- *** "RTL": React / Web Components (RTL) -->
<!-- *** "feature flag": React / Web Components (experimental) -->
  • Loading branch information
IgnacioBecerra authored Feb 2, 2024
1 parent 5b04354 commit fa0ab81
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import { carbonElement as customElement } from '../../globals/decorators/carbon-
* Data table header row.
*
* @element cds-table-header-row
* @fires cds-table-change-selection-all
* The name of the custom event fired before this row is selected/unselected upon a user gesture.
* Cancellation of this event stops the user-initiated change in selection.
*/
@customElement(`${prefix}-table-header-row`)
class CDSTableHeaderRow extends CDSTableRow {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ import CDSTableCell from './table-cell';
* @fires cds-table-row-change-selection
* The custom event fired before this row is selected/unselected upon a user gesture.
* Cancellation of this event stops the user-initiated change in selection.
* @fires cds-radio-button-changed
* The name of the custom event fired after this radio button changes its checked state.
* @fires cds-checkbox-changed
* The name of the custom event fired after this checkbox changes its checked state.
* @fires cds-table-row-expando-beingtoggled
* The name of the custom event fired before the expanded state of this row is being toggled upon a user gesture.
* Cancellation of this event stops the user-initiated action of toggling the expanded state.
* @fires cds-table-row-expando-toggled
* The name of the custom event fired after the expanded state of this row is toggled upon a user gesture.
*/
@customElement(`${prefix}-table-row`)
class CDSTableRow extends HostListenerMixin(FocusMixin(LitElement)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,27 @@ export { TABLE_SIZE };
* Data table.
*
* @element cds-table
* @fires cds-table-header-cell-sort
* The name of the custom event fired before a new sort direction is set upon a user gesture.
* Cancellation of this event stops the user-initiated change in sort direction.
* @fires cds-search input
* The name of the custom event fired during search bar input
* @fires cds-table-change-selection-all
* The name of the custom event fired before header row is selected/unselected upon a user gesture.
* @fires cds-table-row-change-selection
* The name of the custom event fired before a row is selected/unselected upon a user gesture.
* @fires cds-table-batch-actions-cancel-clicked
* The name of the custom event fired after the Cancel button is clicked.
* @fires cds-table-row-expando-toggled
* The name of the custom event fired after the expanded state of a row is toggled upon a user gesture.
* @fires cds-table-row-selected
* The name of the custom event fired after a row has been selected.
* @fires cds-table-row-all-selected
* The name of the custom event fired after all rows have been selected.
* @fires cds-table-sorted
* The name of the custom event fired after the table has been sorted.
* @fires cds-table-filtered
* The name of the custom event fired after the table has been filtered containing remaining rows.
*/
@customElement(`${prefix}-table`)
class CDSTable extends HostListenerMixin(LitElement) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ flatpickr!.l10ns!.en!.weekdays.shorthand.forEach((_day, index) => {
*
* @element cds-date-picker
* @fires cds-date-picker-changed - The custom event fired on this element when Flatpickr updates its value.
* @fires cds-date-picker-flatpickr-error
* The name of the custom event when Flatpickr throws an error.
*/
@customElement(`${prefix}-date-picker`)
class CDSDatePicker extends HostListenerMixin(FormMixin(LitElement)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import styles from './layer.scss';
* Basic layer
*
* @element cds-layer
* @fires cds-use-layer
* The name of the custom event fired when the "use layer" action occurs.
* @slot children - The elements contained within the component.
*/
@customElement(`${prefix}-layer`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export { NUMBER_INPUT_VALIDATION_STATUS };
* Number input.
*
* @element cds-number-input
* @fires cds-number-input
* The name of the custom event fired after the value is changed upon a user gesture.
* @slot helper-text - The helper text.
* @slot label-text - The label text.
* @slot validity-message - The validity message. If present and non-empty, this input shows the UI of its invalid state.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export { RADIO_BUTTON_ORIENTATION };
*
* @element cds-radio-button-group
* @fires cds-radio-button-group-changed - The custom event fired after this radio button group changes its selected item.
* @fires cds-radio-button-changed
* The name of the custom event fired after a radio button changes its checked state.
*/
@customElement(`${prefix}-radio-button-group`)
class CDSRadioButtonGroup extends FormMixin(HostListenerMixin(LitElement)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import { carbonElement as customElement } from '../../globals/decorators/carbon-
* Select box.
*
* @element cds-select
* @fires cds-select-selected
* The name of the custom event fired after an item is selected.
* @slot helper-text - The helper text.
* @slot label-text - The label text.
* @slot validity-message - The validity message. If present and non-empty, this input shows the UI of its invalid state.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ const THUMB_DIRECTION = {
* Slider.
*
* @element cds-slider
* @fires cds-slider-input-changed
* The name of the custom event fired after the value is changed in `<cds-slider-input>` by user gesture.
* @slot label-text - The label text.
* @slot max-text - The text for maximum value.
* @slot min-text - The text for minimum value.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { carbonElement as customElement } from '../../globals/decorators/carbon-
* Single-selectable tile.
*
* @element cds-radio-tile
* @fires cds-radio-tile-selected
* The name of the custom event fired after this selectable tile changes its selected state.
*/
@customElement(`${prefix}-radio-tile`)
class CDSRadioTile extends SelectableTile {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ const navigationDirectionForKey = {
* Tile group.
*
* @element cds-tile-group
* @fires cds-current-radio-tile-selection
* The name of the custom event fired after a radio tile changes its selected state.
* @fires cds-current-selectable-tile-selections
* The name of the custom event fired after a selectable tile changes its selected state.
*/
@customElement(`${prefix}-tile-group`)
class CDSTileGroup extends HostListenerMixin(LitElement) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ import { carbonElement as customElement } from '../../globals/decorators/carbon-
* Side nav menu.
*
* @element cds-side-nav-menu
* @fires cds-side-nav-menu-beingtoggled
* The name of the custom event fired before this side nav menu is being toggled upon a user gesture.
* Cancellation of this event stops the user-initiated action of toggling this side nav menu.
* @fires cds-side-nav-menu-toggled
* The name of the custom event fired after this side nav menu is toggled upon a user gesture.
* @slot title-icon - The icon.
* @csspart expando The expando.
* @csspart expando-icon-container The expando icon container.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export { SIDE_NAV_COLLAPSE_MODE, SIDE_NAV_USAGE_MODE };
* Side nav.
*
* @element cds-side-nav
* @fires cds-header-menu-button-toggled
* The name of the custom event fired after the header menu button in the document is toggled upon a user gesture.
*/
@customElement(`${prefix}-side-nav`)
class CDSSideNav extends HostListenerMixin(LitElement) {
Expand Down

0 comments on commit fa0ab81

Please sign in to comment.