Skip to content

Commit

Permalink
chore(toggle): updated typedoc schema
Browse files Browse the repository at this point in the history
  • Loading branch information
pimenovoleg committed Jan 7, 2025
1 parent 2ca3463 commit 2f24371
Show file tree
Hide file tree
Showing 2 changed files with 183 additions and 42 deletions.
213 changes: 171 additions & 42 deletions apps/radix-docs/src/api-doc/primitives.json
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,10 @@
{
"name": "disabled",
"optional": false,
"readonly": false,
"type": "boolean",
"default": "false",
"defaultValue": "false",
"readonly": true,
"type": "InputSignalWithTransform<boolean, BooleanInput>",
"default": "...",
"defaultValue": "...",
"description": "Determines whether a directive is available for interaction.\nWhen true, prevents the user from interacting with the collapsible."
},
{
Expand Down Expand Up @@ -392,9 +392,15 @@
"mount": {
"components": {}
},
"constants": {
"components": {}
},
"types": {
"components": {}
},
"utils": {
"components": {}
},
"window": {
"components": {}
},
Expand Down Expand Up @@ -542,6 +548,87 @@
"dropdown-menu-item-radio.component": {
"components": {}
},
"hover-card": {
"components": {}
},
"hover-card-anchor.directive": {
"components": {}
},
"hover-card-anchor.token": {
"components": {}
},
"hover-card-arrow.directive": {
"components": {}
},
"hover-card-arrow.token": {
"components": {}
},
"hover-card-close.directive": {
"components": {}
},
"hover-card-close.token": {
"components": {}
},
"hover-card-content-attributes.component": {
"components": {}
},
"hover-card-content-attributes.token": {
"components": {}
},
"hover-card-content.directive": {
"components": {}
},
"hover-card-root.directive": {
"components": {}
},
"hover-card-root.inject": {
"components": {}
},
"hover-card-trigger.directive": {
"components": {}
},
"hover-card.types": {
"components": {}
},
"cdk-event.service": {
"components": {}
},
"hover-card-anchor.component": {
"components": {}
},
"hover-card-animations.component": {
"components": {}
},
"hover-card-default.component": {
"components": {}
},
"hover-card-events.components": {
"components": {}
},
"hover-card-initially-open.component": {
"components": {}
},
"hover-card-multiple.component": {
"components": {}
},
"hover-card-positioning.component": {
"components": {}
},
"hover-card-triggering.component": {
"components": {}
},
"containers.registry": {
"components": {}
},
"option-panel-base.class": {
"components": {}
},
"styles.constants": {
"components": {}
},
"with-option-panel.component": {
"components": {}
},
"jest.config": {
"components": {}
},
Expand Down Expand Up @@ -659,21 +746,9 @@
"popover-trigger.directive": {
"components": {}
},
"popover.constants": {
"components": {}
},
"popover.types": {
"components": {}
},
"popover.utils": {
"components": {}
},
"cdk-event.service": {
"components": {}
},
"constants": {
"components": {}
},
"popover-anchor.component": {
"components": {}
},
Expand All @@ -698,18 +773,6 @@
"popover-triggering.component": {
"components": {}
},
"containers.registry": {
"components": {}
},
"ignore-click-outside-container-base.class": {
"components": {}
},
"styles.constants": {
"components": {}
},
"with-event-base.component": {
"components": {}
},
"presence-test.component": {
"components": {}
},
Expand All @@ -722,9 +785,6 @@
"transition.toast": {
"components": {}
},
"utils": {
"components": {}
},
"presence-story.componen": {
"components": {}
},
Expand Down Expand Up @@ -1027,9 +1087,6 @@
"toggle-group-item.token": {
"components": {}
},
"toggle-group-multiple.directive": {
"components": {}
},
"toggle-group.directive": {
"components": {}
},
Expand All @@ -1043,15 +1100,69 @@
"components": {}
},
"toggle.directive": {
"components": {}
"components": {
"RdxToggleDirective": {
"description": "",
"props": {
"description": "Defines the input properties of the component.",
"values": [
{
"name": "defaultPressed",
"optional": false,
"readonly": true,
"type": "InputSignalWithTransform<boolean, BooleanInput>",
"default": "...",
"defaultValue": "...",
"description": "The pressed state of the toggle when it is initially rendered.\nUse when you do not need to control its pressed state."
},
{
"name": "pressed",
"optional": false,
"readonly": true,
"type": "ModelSignal<boolean>",
"default": "...",
"defaultValue": "...",
"description": "The controlled pressed state of the toggle.\nMust be used in conjunction with `onPressedChange` ."
},
{
"name": "disabled",
"optional": false,
"readonly": true,
"type": "InputSignalWithTransform<boolean, BooleanInput>",
"default": "...",
"defaultValue": "...",
"description": "When true, prevents the user from interacting with the toggle."
}
]
},
"emits": {
"description": "Defines emit that determine the behavior of the component based on a given condition or report the actions that the component takes.",
"values": [
{
"name": "onPressedChange",
"parameters": [
{
"name": "value",
"type": "boolean"
}
],
"description": "Event handler called when the pressed state of the toggle changes."
}
]
}
}
}
},
"toggle-forms.component": {
"components": {}
},
"tooltip": {
"components": {}
},
"get-content-position": {
"tooltip-anchor.directive": {
"components": {}
},
"tooltip-anchor.token": {
"components": {}
},
"tooltip-arrow.directive": {
Expand All @@ -1060,33 +1171,51 @@
"tooltip-arrow.token": {
"components": {}
},
"tooltip-content-attributes.directive": {
"tooltip-close.directive": {
"components": {}
},
"tooltip-content.directive": {
"tooltip-close.token": {
"components": {}
},
"tooltip-content-attributes.component": {
"components": {}
},
"tooltip-content.token": {
"tooltip-content-attributes.token": {
"components": {}
},
"tooltip-content.directive": {
"components": {}
},
"tooltip-root.directive": {
"components": {}
},
"tooltip-root.inject": {
"components": {}
},
"tooltip-trigger.directive": {
"components": {}
},
"tooltip.config": {
"tooltip.types": {
"components": {}
},
"tooltip.constants": {
"tooltip-anchor.component": {
"components": {}
},
"tooltip.types": {
"tooltip-animations.component": {
"components": {}
},
"tooltip-default.component": {
"components": {}
},
"tooltip-events.components": {
"components": {}
},
"tooltip-initially-open.component": {
"components": {}
},
"tooltip-multiple.component": {
"components": {}
},
"tooltip-positioning.component": {
"components": {}
},
Expand Down
12 changes: 12 additions & 0 deletions packages/primitives/toggle/src/toggle.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export const TOGGLE_VALUE_ACCESSOR: any = {
multi: true
};

/**
* @group Components
*/
@Directive({
selector: '[rdxToggle]',
exportAs: 'rdxToggle',
Expand All @@ -63,17 +66,23 @@ export class RdxToggleDirective implements ControlValueAccessor {
/**
* The pressed state of the toggle when it is initially rendered.
* Use when you do not need to control its pressed state.
*
* @group Props
*/
readonly defaultPressed = input<boolean, BooleanInput>(false, { transform: booleanAttribute });

/**
* The controlled pressed state of the toggle.
* Must be used in conjunction with `onPressedChange`.
*
* @group Props
*/
readonly pressed = model<boolean>(this.defaultPressed());

/**
* When true, prevents the user from interacting with the toggle.
*
* @group Props
*/
readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });

Expand All @@ -89,6 +98,8 @@ export class RdxToggleDirective implements ControlValueAccessor {

/**
* Event handler called when the pressed state of the toggle changes.
*
* @group Emits
*/
readonly onPressedChange = output<boolean>();

Expand All @@ -103,6 +114,7 @@ export class RdxToggleDirective implements ControlValueAccessor {
private readonly accessorDisabled = signal(false);

private onChange: (value: any) => void = () => {};

/** @ignore */
onTouched: (() => void) | undefined;

Expand Down

0 comments on commit 2f24371

Please sign in to comment.