@loadsmart/miranda-wc
Version:
Miranda Web Components component library
83 lines (82 loc) • 2.74 kB
TypeScript
import type { PropertyValues } from 'lit';
import { Component } from '../component';
import { fromAttribute } from '../../controllers/selection';
import type { AcceptedType } from '../../controllers/selection';
export type RadioGroupOrientation = 'vertical' | 'horizontal';
export interface RadioGroupProps {
initialValue?: AcceptedType;
disabled?: boolean;
name?: string;
orientation?: RadioGroupOrientation;
value?: AcceptedType;
onchange?: GlobalEventHandlers['onchange'];
}
declare const RadioGroup_base: import("../../utils/types").Constructor<import("../../controllers/selection/selection-control.mixin").WithSelectionControlMixinInterface> & typeof Component;
export declare class RadioGroup extends RadioGroup_base implements RadioGroupProps {
#private;
static styles: import("lit").CSSResult[];
static get properties(): {
disabled: {
type: BooleanConstructor;
};
initialValue: {
type: StringConstructor;
attribute: string;
fromAttribute: typeof fromAttribute;
reflect: boolean;
};
/**
* We use a different property name internally so the react wrapper can still
* keep track of the property while we can use custom getter/setter to
* set and reflect the `value` attribute.
*/
providedValue: {
type: StringConstructor;
attribute: string;
fromAttribute: typeof fromAttribute;
};
name: {
type: StringConstructor;
reflect: boolean;
};
orientation: {
type: StringConstructor;
reflect: boolean;
};
};
/**
* Name that will represent this radio group in the form.
*/
name: RadioGroupProps['name'];
/**
* Should the button be disabled.
*/
disabled: RadioGroupProps['disabled'];
/**
* Buttons display orientation (vertical or horizontal)
*/
orientation: RadioGroupProps['orientation'];
/**
* Value that will be selected by default on initialization and form reset.
*/
initialValue: RadioGroupProps['initialValue'];
/**
* Current selected value.
*/
providedValue: RadioGroupProps['value'];
static define(): void;
constructor();
connectedCallback(): Promise<void>;
disconnectedCallback(): void;
protected update(changedProperties: PropertyValues<this>): void;
render(): import("lit-html").TemplateResult<1>;
get value(): string;
set value(value: string);
protected handleFormReset: () => void;
}
declare global {
interface HTMLElementTagNameMap {
'm-radio-group': RadioGroup;
}
}
export {};