{
  "name": "switch",
  "version": "21.1.0",
  "jetVersion": "^21.1.0",
  "type": "composite",
  "pack": "oj-c",
  "dependencyScope": "runtime",
  "license": "https://opensource.org/licenses/UPL",
  "implements": [
    "CSwitchElement"
  ],
  "displayName": "Switch",
  "description": "The Switch component toggles between two mutually exclusive states, such as on and off. It immediately affects content or state for binary choices that must take effect right away, for example, switching between light and dark mode.",
  "help": "oj-c.Switch.html",
  "main": "oj-c/switch",
  "status": [
    {
      "type": "supersedes",
      "since": "21.0.0",
      "value": [
        "oj-switch"
      ]
    }
  ],
  "since": "21.0.0",
  "extension": {
    "catalog": {
      "category": "Forms"
    },
    "vbdt": {
      "module": "oj-c/switch",
      "defaultColumns": 6,
      "minColumns": 2
    },
    "oracle": {
      "icon": "oj-ux-ico-switch-on",
      "uxSpecs": [
        "switch"
      ]
    }
  },
  "propertyLayout": [
    {
      "propertyGroup": "common",
      "items": [
        "disabled",
        "labelHint",
        "readonly"
      ]
    },
    {
      "propertyGroup": "data",
      "items": [
        "value"
      ]
    }
  ],
  "requirements": [
    {
      "type": "anyOf",
      "label": "accessibility",
      "properties": [
        "labelHint"
      ]
    },
    {
      "type": "not",
      "label": "accessibility",
      "properties": [
        "aria-label",
        "aria-labelledby"
      ]
    }
  ],
  "properties": {
    "displayOptions": {
      "type": "object",
      "description": "Display options for auxiliary content that determines whether or not it should be displayed.",
      "displayName": "Display Options",
      "help": "#displayOptions",
      "properties": {
        "messages": {
          "type": "string",
          "enumValues": [
            "none",
            "display"
          ],
          "value": "display"
        }
      }
    },
    "columnSpan": {
      "type": "number",
      "description": "Specifies how many columns this component should span.",
      "displayName": "Column Span",
      "help": "#columnSpan",
      "value": 1
    },
    "containerReadonly": {
      "type": "boolean",
      "description": "Specifies whether an ancestor container, like oj-c-form-layout, is readonly.",
      "displayName": "Container Readonly",
      "help": "#containerReadonly",
      "binding": {
        "consume": {
          "name": "containerReadonly"
        }
      }
    },
    "disabled": {
      "type": "boolean",
      "description": "Specifies whether the component is disabled.",
      "displayName": "Disabled",
      "help": "#disabled",
      "value": false
    },
    "help": {
      "type": "object",
      "description": "Form component help information.",
      "displayName": "Help",
      "help": "#help",
      "properties": {
        "instruction": {
          "type": "string",
          "value": ""
        }
      }
    },
    "helpHints": {
      "type": "object",
      "description": "The helpHints object contains a definition property, sourceText property, and a source property.",
      "displayName": "Help Hints",
      "help": "#helpHints",
      "properties": {
        "definition": {
          "type": "string",
          "value": ""
        },
        "source": {
          "type": "string",
          "value": ""
        },
        "sourceText": {
          "type": "string",
          "value": ""
        }
      }
    },
    "labelEdge": {
      "type": "string",
      "description": "Specifies how the label is positioned for the component",
      "displayName": "Label Edge",
      "help": "#labelEdge",
      "propertyEditorValues": {
        "inside": {
          "description": "The label will be placed on top of the switch, but is smaller than 'top' option.",
          "displayName": "Inside"
        },
        "none": {
          "description": "The switch will not create a label, but instead set the aria-label property on the switch.",
          "displayName": "None"
        },
        "start": {
          "description": "The label will be placed before the start of the switch.",
          "displayName": "Start"
        },
        "top": {
          "description": "The label will be placed on top of the switch.",
          "displayName": "Top"
        }
      },
      "enumValues": [
        "inside",
        "start",
        "top",
        "none"
      ],
      "binding": {
        "consume": {
          "name": "containerLabelEdge"
        }
      }
    },
    "labelHint": {
      "type": "string",
      "description": "Represents a hint for rendering a label on the component.",
      "displayName": "Label Hint",
      "help": "#labelHint",
      "required": true,
      "translatable": true
    },
    "labelStartWidth": {
      "type": "number|string",
      "description": "The width of the label when labelEdge is 'start'.",
      "displayName": "Label Start Width",
      "help": "#labelStartWidth",
      "binding": {
        "consume": {
          "name": "labelWidth"
        }
      }
    },
    "labelWrapping": {
      "type": "string",
      "status": [
        {
          "type": "deprecated",
          "since": "21.0.0",
          "description": "Label truncation for 'start' and 'top' aligned labels is no longer recommended by the Redwood Design System. The default for labelWrapping was 'wrap' and that is now the only suggested pattern by UX design for 'start' and 'top' aligned labels. 'inside' aligned labels are always truncated per UX design and are not affected by this property's value."
        }
      ],
      "description": "Should the labels wrap or truncate when there is not enough available space.",
      "displayName": "Label Wrapping",
      "help": "#labelWrapping",
      "propertyEditorValues": {
        "truncate": {
          "description": "Label will truncate if needed.",
          "displayName": "Truncate"
        },
        "wrap": {
          "description": "Label will wrap if needed.",
          "displayName": "Wrap"
        }
      },
      "enumValues": [
        "truncate",
        "wrap"
      ],
      "binding": {
        "consume": {
          "name": "labelWrapping"
        }
      }
    },
    "messagesCustom": {
      "type": "Array<object>",
      "description": "List of custom component messages",
      "displayName": "Messages Custom",
      "help": "#messagesCustom",
      "extension": {
        "vbdt": {
          "itemProperties": {
            "summary": {
              "type": "string"
            },
            "detail": {
              "type": "string"
            },
            "severity": {
              "type": "string",
              "enumValues": [
                "confirmation",
                "error",
                "info",
                "warning"
              ]
            }
          }
        }
      },
      "writeback": true,
      "value": []
    },
    "readonly": {
      "type": "boolean",
      "description": "Whether the component is readonly",
      "displayName": "Readonly",
      "help": "#readonly",
      "binding": {
        "consume": {
          "name": "containerReadonly"
        }
      }
    },
    "readonlyUserAssistanceShown": {
      "type": "string",
      "description": "Specifies which user assistance types should be shown when the component is readonly.",
      "displayName": "ReadonlyUserAssistanceShown",
      "help": "#readonlyUserAssistanceShown",
      "enumValues": [
        "none",
        "confirmationAndInfoMessages"
      ],
      "value": "none"
    },
    "userAssistanceDensity": {
      "type": "string",
      "description": "Specifies the density of the form component's user assistance presentation.",
      "displayName": "User Assistance Density",
      "help": "#userAssistanceDensity",
      "propertyEditorValues": {
        "reflow": {
          "description": "Messages, help, and hints are all shown inline under the field with no reserved space. Layout will reflow when text is displayed.",
          "displayName": "Reflow"
        },
        "efficient": {
          "description": "Messages, help, and hints are all shown inline under the field with reserved space.",
          "displayName": "Efficient"
        },
        "compact": {
          "description": "Messages, help, and hints are all shown inline under the field with reserved space.",
          "displayName": "Compact"
        }
      },
      "enumValues": [
        "reflow",
        "efficient",
        "compact"
      ],
      "binding": {
        "consume": {
          "name": "containerUserAssistanceDensity"
        }
      }
    },
    "value": {
      "type": "boolean",
      "description": "The boolean state of the switch component.",
      "displayName": "Value",
      "help": "#value",
      "writeback": true,
      "value": false
    },
    "valid": {
      "type": "string",
      "description": "Specifies the valid state of the component.",
      "displayName": "Valid",
      "help": "#valid",
      "propertyEditorValues": {
        "valid": {
          "description": "The component is valid",
          "displayName": "Valid"
        },
        "pending": {
          "description": "The component is waiting for the validation state to be determined. The 'pending' state is set at the start of the validation process.",
          "displayName": "Pending"
        },
        "invalidHidden": {
          "description": "The component has invalid messages hidden and no invalid messages showing. An invalid message is one with severity 'error'.",
          "displayName": "Invalid Hidden"
        },
        "invalidShown": {
          "description": "The component has invalid messages showing. An invalid message is one with severity 'error'.",
          "displayName": "Invalid Shown"
        }
      },
      "enumValues": [
        "valid",
        "pending",
        "invalidHidden",
        "invalidShown"
      ],
      "readOnly": true,
      "writeback": true
    }
  },
  "methods": {
    "blur": {
      "description": "Blurs the field.",
      "return": "void"
    },
    "focus": {
      "description": "Focuses the field.",
      "return": "void"
    },
    "reset": {
      "description": "Resets the component by clearing all messages.",
      "return": "void"
    },
    "setProperty": {
      "description": "Sets a property or a single subproperty for complex properties and notifies the component of the change, triggering a corresponding event.",
      "help": "#setProperty",
      "params": [
        {
          "name": "property",
          "description": "The property name to set. Supports dot notation for subproperty access.",
          "type": "string"
        },
        {
          "name": "value",
          "description": "The new value to set the property to.",
          "type": "any"
        }
      ],
      "return": "void"
    },
    "getProperty": {
      "description": "Retrieves the value of a property or a subproperty.",
      "help": "#getProperty",
      "params": [
        {
          "name": "property",
          "description": "The property name to get. Supports dot notation for subproperty access.",
          "type": "string"
        }
      ],
      "return": "any"
    },
    "setProperties": {
      "description": "Performs a batch set of properties.",
      "help": "#setProperties",
      "params": [
        {
          "name": "properties",
          "description": "An object containing the property and value pairs to set.",
          "type": "object"
        }
      ],
      "return": "void"
    }
  }
}