UNPKG

smart-webcomponents

Version:

Web Components & Custom Elements for Professional Web Applications

144 lines (139 loc) 5.07 kB
import {BaseElement, Animation} from "./smart.element" export interface RadioButtonProperties { /** * Sets or gets the animation mode. Animation is disabled when the property is set to 'none' * Default value: advanced */ animation?: Animation | string; /** * Sets or gets the check state. * Default value: false */ checked?: boolean; /** * Sets or gets the part that toggles the element. * Default value: both */ checkMode?: CheckMode | string; /** * Sets the click mode of the radio button. * Default value: release */ clickMode?: ClickMode | string; /** * Enables or disables the ratio button. * Default value: false */ disabled?: boolean; /** * Sets or gets the widget's group name. * Default value: """" */ groupName?: string; /** * Sets or gets the widget's innerHTML. * Default value: """" */ innerHTML: string; /** * Sets or gets the unlockKey which unlocks the product. * Default value: "" */ unlockKey?: string; /** * Sets or gets the language. Used in conjunction with the property messages. * Default value: "en" */ locale?: string; /** * Callback, related to localization module. * Default value: null */ localizeFormatFunction?: any; /** * Sets an object with string values, related to the different states of passwords strength. * Default value: * { * "en": { * "propertyUnknownType": "'' property is with undefined 'type' member!", * "propertyInvalidValue": "Invalid '!", * "propertyInvalidValueType": "Invalid '!", * "elementNotInDOM": "Element does not exist in DOM! Please, add the element to the DOM, before invoking a method.", * "moduleUndefined": "Module is undefined.", * "missingReference": ".", * "htmlTemplateNotSuported": ": Browser doesn't support HTMLTemplate elements.", * "invalidTemplate": "' property accepts a string that must match the id of an HTMLTemplate element from the DOM." * } * } */ messages?: any; /** * Sets or gets the widget's name. * Default value: """" */ name?: string; /** * If the custom element is readonly, it cannot be interacted with. * Default value: false */ readonly?: boolean; /** * Sets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts. * Default value: false */ rightToLeft?: boolean; /** * Determines the theme. Theme defines the look of the element * Default value: "" */ theme?: string; /** * If is set to true, the element cannot be focused. * Default value: false */ unfocusable?: boolean; /** * Sets or gets the widget's value. * Default value: """" */ value?: string; } /** The Radio Button component lets you add a radio button and assign it to a radio group. Users can select only one radio button at a time within a radio group */ export interface RadioButton extends BaseElement, RadioButtonProperties { /* Get a member by its name */ [name: string]: any; /** * This event is triggered when the widget is checked/unchecked. * @param event. The custom event. Custom data event was created with: ev.detail(value, oldValue, changeType) * value - A boolean value indicating the new state of the button ( checked or not ). * oldValue - A boolean value indicating the previous state of the button ( checked or not ). * changeType - A string flag indicating whether the change event was triggered via API or an event. */ onChange: ((this: any, ev: Event) => any) | null; /** * This event is triggered when the widget is checked. * @param event. The custom event. Custom data event was created with: ev.detail(changeType) * changeType - A string flag indicating whether the change event was triggered via API or an event. */ onCheckValue?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null; /** * This event is triggered when the widget is unchecked. * @param event. The custom event. Custom data event was created with: ev.detail(changeType) * changeType - A string flag indicating whether the change event was triggered via API or an event. */ onUncheckValue?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null; } declare global { interface Document { createElement(tagName: "smart-radio-button"): RadioButton; querySelector(selectors: "smart-radio-button"): RadioButton | null; querySelectorAll(selectors: "smart-radio-button"): NodeListOf<RadioButton>; getElementsByTagName(qualifiedName: "smart-radio-button"): HTMLCollectionOf<RadioButton>; getElementsByName(elementName: "smart-radio-button"): NodeListOf<RadioButton>; } } /**Sets or gets the part that toggles the element. */ export declare type CheckMode = 'both' | 'input' | 'label'; /**Sets the click mode of the radio button. */ export declare type ClickMode = 'hover' | 'press' | 'release' | 'pressAndRelease';