370 lines
15 KiB
TypeScript
370 lines
15 KiB
TypeScript
import { TcHmiControl } from 'Beckhoff.TwinCAT.HMI.Framework/index.esm.js';
|
|
declare class TcHmiCheckbox extends TcHmiControl.Control {
|
|
#private;
|
|
constructor(element: JQuery, pcElement: JQuery, attrs: TcHmi.Controls.ControlAttributeList);
|
|
protected __elementCheckbox: JQuery;
|
|
protected __textDiv: HTMLDivElement | null;
|
|
protected __toggleGroup: string | null | undefined;
|
|
protected __toggleState: TcHmi.ToggleState | undefined;
|
|
protected __stateSymbol: TcHmi.Symbol<boolean> | null | undefined;
|
|
/**
|
|
* Used to determine if this.__stateSymbol has ben initially read at least once before a write is processed to the symbol.
|
|
* Because the state symbol state has a higher priority than internal or configured state.
|
|
*/
|
|
protected __stateSymbolInitialized: boolean;
|
|
protected __toggleStateIconColor: TcHmi.SolidColor | null | undefined;
|
|
protected __text: string | null | undefined;
|
|
/** Internal reference to the attribute "data-tchmi-ignore-escape-sequences" */
|
|
protected __ignoreEscapeSequences: boolean | undefined;
|
|
protected __textPosition: TextPosition | undefined;
|
|
protected __textHorizontalAlignment: TcHmi.HorizontalAlignment | undefined;
|
|
protected __textVerticalAlignment: TcHmi.VerticalAlignment | undefined;
|
|
protected __textFontFamily: TcHmi.FontFamily | null | undefined;
|
|
protected __textFontSize: number | null | undefined;
|
|
protected __textFontSizeUnit: TcHmi.FontSizeUnit | undefined;
|
|
protected __textFontStyle: TcHmi.FontStyle | undefined;
|
|
protected __textFontWeight: TcHmi.FontWeight | undefined;
|
|
protected __textColor: TcHmi.SolidColor | null | undefined;
|
|
protected __textBackgroundColor: TcHmi.Color | null | undefined;
|
|
/**
|
|
* ReadOnly state of the control.
|
|
*/
|
|
protected __isReadOnly: boolean | undefined;
|
|
/** Destroy functions */
|
|
protected __onToggleGroupToggledEventDestroyEvent: TcHmi.DestroyFunction | null;
|
|
protected __destroyStateSymbolWatch: TcHmi.DestroyFunction | null;
|
|
/** Helper */
|
|
protected __state: boolean;
|
|
protected __isActive: boolean;
|
|
/**
|
|
* If raised, the control object exists in control cache and constructor of each inheritation level was called.
|
|
* This function is only to be used by the System. Other function calls are not intended.
|
|
*/
|
|
__previnit(): void;
|
|
/**
|
|
* If raised, all attributes have been set to it's default or dom values.
|
|
* This function is only to be used by the System. Other function calls are not intended.
|
|
*/
|
|
__init(): void;
|
|
/**
|
|
* Is called by the system after the control instance gets part of the current DOM.
|
|
* This function is only to be used by the System. Other function calls are not intended.
|
|
*/
|
|
__attach(): void;
|
|
/**
|
|
* Is called by the system after the control instance is no longer part of the current DOM.
|
|
* This function is only to be used by the System. Other function calls are not intended.
|
|
*/
|
|
__detach(): void;
|
|
/**
|
|
* Destroy the current control instance.
|
|
* Will be called automatically if system destroys control!
|
|
*/
|
|
destroy(): void;
|
|
/**
|
|
* Is raised if a member of 'toggleGroup' has raised the toggled event.
|
|
*/
|
|
protected __onToggleGroupToggled(_event: TcHmi.EventProvider.Event, data: {
|
|
ActiveElementId: string;
|
|
source: string;
|
|
}): void;
|
|
/**
|
|
* Sets the toggleGroup attribute to a new value.
|
|
* @param valueNew The new value for the toggleGroup attribute.
|
|
*/
|
|
setToggleGroup(valueNew: string | null): void;
|
|
/**
|
|
* Returns the current value of the toggleGroup attribute
|
|
*/
|
|
getToggleGroup(): string | null | undefined;
|
|
/**
|
|
* Processes the current value of the toggleGroup attribute.
|
|
*/
|
|
protected __processToggleGroup(): void;
|
|
/**
|
|
* Writes the given state to the state symbol, if it exists. Otherwise just sets the internal state variable.
|
|
* @param state The state to write.
|
|
* @param source What caused the state change. Could be 'userInteraction', the change of an 'attribute' or the state symbol, or the 'toggleGroup'.
|
|
*/
|
|
protected __writeState(state: boolean, source: string): Promise<boolean>;
|
|
/**
|
|
* Sets the internal state variable and raises state change events if state has changed.
|
|
* @param state The new state of the control.
|
|
* @param source What caused the state change. Could be 'userInteraction', the change of an 'attribute' or the state symbol, or the 'toggleGroup'.
|
|
*/
|
|
protected __setInternalState(state: boolean, source: string): void;
|
|
/**
|
|
* Writes the state symbol, or just sets the internal state variable, depending on the value of forwardStateSymbol.
|
|
* @param state The new state.
|
|
* @param forwardStateSymbol Whether to write the state symbol or just set the internal state variable.
|
|
* @param source What caused the state change. Could be 'userInteraction', the change of an 'attribute' or the state symbol, or the 'toggleGroup'.
|
|
*/
|
|
protected __processState(state: boolean, forwardStateSymbol: boolean, source: string): void;
|
|
/**
|
|
* Sets whether the checkbox should be displayed in an active state.
|
|
* @param valueNew The new active state.
|
|
*/
|
|
protected __setIsActive(valueNew: boolean): void;
|
|
/**
|
|
* Returns an event handler function for the onResized event.
|
|
*/
|
|
protected __onResized(): void;
|
|
/**
|
|
* Is raised when the onPressed event is fired from the base control.
|
|
*/
|
|
protected __onPressed(): void;
|
|
/**
|
|
* Sets the toggleState attribute to a new value.
|
|
* @param valueNew The new value for the toggleState attribute.
|
|
* @param forwardStateSymbol Does nothing, only exists for backwards compatibility purposes.
|
|
* @param process Allows to disable underlying calls to processToggleState. Required if a StateSymbol change is reflected to the ToggleState.
|
|
*/
|
|
protected __setToggleState(valueNew: TcHmi.ToggleState | null, forwardStateSymbol: boolean, process: boolean): void;
|
|
/**
|
|
* Sets the toggleState attribute to a new value.
|
|
* @param valueNew The new value for the toggleState attribute.
|
|
*/
|
|
setToggleState(valueNew: TcHmi.ToggleState | null): void;
|
|
/**
|
|
* Returns the current value of the toggleState attribute
|
|
*/
|
|
getToggleState(): TcHmi.ToggleState | undefined;
|
|
/**
|
|
* Processes the current value of the toggleState attribute.
|
|
* @param forwardStateSymbol Does nothing, only exists for backwards compatibility purposes.
|
|
*/
|
|
protected __processToggleState(forwardStateSymbol?: boolean): void;
|
|
/**
|
|
* Sets the text color and calls the associated process function (processToggleStateIconColor).
|
|
* @param valueNew The new value for toggleStateIconColor.
|
|
*/
|
|
setToggleStateIconColor(valueNew: TcHmi.SolidColor | null): void;
|
|
/**
|
|
* The watch callback for the toggleStateIconColor object resolver.
|
|
*/
|
|
protected __onResolverForToggleStateIconColorWatchCallback(data: TcHmi.Symbol.ObjectResolver.IWatchResultObject<TcHmi.SolidColor>): void;
|
|
/**
|
|
* Returns the current value of toggleStateIconColor.
|
|
* @returns The current value of toggleStateIconColor.
|
|
*/
|
|
getToggleStateIconColor(): TcHmi.SolidColor | null | undefined;
|
|
/**
|
|
* Processes the current toggleStateIconColor attribute value.
|
|
*/
|
|
protected __processToggleStateIconColor(): void;
|
|
protected __processStateSymbolResult(data: TcHmi.Symbol.IReadResultObject<boolean>): void;
|
|
/**
|
|
* The watch callback for the StateSymbol.
|
|
* @param data Object containing the new value of the StateSymbol.
|
|
*/
|
|
protected __onStateSymbolWatch(data: TcHmi.Symbol.IReadResultObject<boolean>): void;
|
|
/**
|
|
* @param valueNew
|
|
*/
|
|
setStateSymbol(valueNew: TcHmi.Symbol | null): void;
|
|
/**
|
|
*/
|
|
getStateSymbol(): TcHmi.Symbol<boolean> | null | undefined;
|
|
/**
|
|
* Sets the text attribute to a new value.
|
|
* @param valueNew The new value for the text attribute.
|
|
*/
|
|
setText(valueNew: string | null): void;
|
|
/**
|
|
* Returns the current value of the text attribute
|
|
*/
|
|
getText(): string | null | undefined;
|
|
/**
|
|
* Processes the current value of the text attribute.
|
|
*/
|
|
protected __processText(): void;
|
|
/**
|
|
* Sets the value of the member variable IgnoreEscapeSequences.
|
|
* @param valueNew The new value for IgnoreEscapeSequences
|
|
*/
|
|
setIgnoreEscapeSequences(valueNew: boolean | null | undefined): void;
|
|
/**
|
|
* Returns the current value of IgnoreEscapeSequences.
|
|
* @returns The current value of IgnoreEscapeSequences.
|
|
*/
|
|
getIgnoreEscapeSequences(): boolean | undefined;
|
|
/**
|
|
* Sets the textPosition attribute to a new value.
|
|
* @param valueNew The new value for the textPosition attribute.
|
|
*/
|
|
setTextPosition(valueNew: TextPosition | null): void;
|
|
/**
|
|
* Returns the current value of the textPosition attribute
|
|
*/
|
|
getTextPosition(): TextPosition | undefined;
|
|
/**
|
|
* Processes the current value of the textPosition attribute.
|
|
*/
|
|
protected __processTextPosition(): void;
|
|
/**
|
|
* Sets the textHorizontalAlignment attribute to a new value.
|
|
* @param valueNew The new value for the textHorizontalAlignment attribute.
|
|
*/
|
|
setTextHorizontalAlignment(valueNew: TcHmi.HorizontalAlignment | null): void;
|
|
/**
|
|
* Returns the current value of the textHorizontalAlignment attribute
|
|
*/
|
|
getTextHorizontalAlignment(): TcHmi.HorizontalAlignment | undefined;
|
|
/**
|
|
* Processes the current value of the textHorizontalAlignment attribute.
|
|
*/
|
|
protected __processTextHorizontalAlignment(): void;
|
|
/**
|
|
* Sets the textVerticalAlignment attribute to a new value.
|
|
* @param valueNew The new value for the textVerticalAlignment attribute.
|
|
*/
|
|
setTextVerticalAlignment(valueNew: TcHmi.VerticalAlignment | null): void;
|
|
/**
|
|
* Returns the current value of the textVerticalAlignment attribute
|
|
*/
|
|
getTextVerticalAlignment(): TcHmi.VerticalAlignment | undefined;
|
|
/**
|
|
* Processes the current value of the textVerticalAlignment attribute.
|
|
*/
|
|
protected __processTextVerticalAlignment(): void;
|
|
/**
|
|
* Sets the textFontFamily attribute to a new value.
|
|
* @param valueNew The new value for the textFontFamily attribute.
|
|
*/
|
|
setTextFontFamily(valueNew: TcHmi.FontFamily | null): void;
|
|
/**
|
|
* Returns the current value of the textFontFamily attribute
|
|
*/
|
|
getTextFontFamily(): string | null | undefined;
|
|
/**
|
|
* Processes the current value of the textFontFamily attribute.
|
|
*/
|
|
protected __processTextFontFamily(): void;
|
|
/**
|
|
* Sets the textFontSize attribute to a new value.
|
|
* @param valueNew The new value for the textFontSize attribute.
|
|
*/
|
|
setTextFontSize(valueNew: number | null): void;
|
|
/**
|
|
* Returns the current value of the textFontSize attribute
|
|
*/
|
|
getTextFontSize(): number | null | undefined;
|
|
/**
|
|
* Processes the current value of the textFontSize attribute.
|
|
*/
|
|
protected __processTextFontSize(): void;
|
|
/**
|
|
* Sets the textFontSizeUnit attribute to a new value.
|
|
* @param valueNew The new value for the textFontSizeUnit attribute.
|
|
*/
|
|
setTextFontSizeUnit(valueNew: TcHmi.FontSizeUnit | null): void;
|
|
/**
|
|
* Returns the current value of the textFontSizeUnit attribute
|
|
*/
|
|
getTextFontSizeUnit(): TcHmi.FontSizeUnit | undefined;
|
|
/**
|
|
* Processes the current value of the textFontSizeUnit attribute.
|
|
*/
|
|
protected __processTextFontSizeUnit(): void;
|
|
/**
|
|
* Sets the textFontStyle attribute to a new value.
|
|
* @param valueNew The new value for the textFontStyle attribute.
|
|
*/
|
|
setTextFontStyle(valueNew: TcHmi.FontStyle | null): void;
|
|
/**
|
|
* Returns the current value of the textFontStyle attribute
|
|
*/
|
|
getTextFontStyle(): TcHmi.FontStyle | undefined;
|
|
/**
|
|
* Processes the current value of the textFontStyle attribute.
|
|
*/
|
|
protected __processTextFontStyle(): void;
|
|
/**
|
|
* Sets the textFontWeight attribute to a new value.
|
|
* @param valueNew The new value for the textFontWeight attribute.
|
|
*/
|
|
setTextFontWeight(valueNew: TcHmi.FontWeight | null): void;
|
|
/**
|
|
* Returns the current value of the textFontWeight attribute
|
|
*/
|
|
getTextFontWeight(): TcHmi.FontWeight | undefined;
|
|
/**
|
|
* Processes the current value of the textFontWeight attribute.
|
|
*/
|
|
protected __processTextFontWeight(): void;
|
|
/**
|
|
* Sets the text color and calls the associated process function (processTextColor).
|
|
* @param valueNew The new value for textColor.
|
|
*/
|
|
setTextColor(valueNew: TcHmi.SolidColor | null): void;
|
|
/**
|
|
* The watch callback for the textColor object resolver.
|
|
* @param data Object containing the new value for textColor
|
|
*/
|
|
protected __onResolverForTextColorWatchCallback(data: TcHmi.Symbol.ObjectResolver.IWatchResultObject<TcHmi.SolidColor>): void;
|
|
/**
|
|
* Returns the current value of textColor.
|
|
* @returns The current value of textColor.
|
|
*/
|
|
getTextColor(): TcHmi.SolidColor | null | undefined;
|
|
/**
|
|
* Processes the current textColor attribute value.
|
|
*/
|
|
protected __processTextColor(): void;
|
|
/**
|
|
* Returns the current background value.
|
|
* @preserve (Part of the public API)
|
|
*/
|
|
getTextBackgroundColor(): TcHmi.Color | null | undefined;
|
|
/**
|
|
* Sets the background value and calls the associated process function (processBackground).
|
|
* @param valueNew
|
|
* @preserve (Part of the public API)
|
|
*/
|
|
setTextBackgroundColor(valueNew: TcHmi.Color | null): void;
|
|
/**
|
|
* The watch callback for the TextBackgroundColor object resolver.
|
|
*/
|
|
protected __onResolverForTextBackgroundColorWatchCallback(data: TcHmi.Symbol.ObjectResolver.IWatchResultObject<TcHmi.Color>): void;
|
|
/**
|
|
* Processes the current border-color attribute.
|
|
*/
|
|
protected __processTextBackgroundColor(): void;
|
|
/**
|
|
* Before 1.12 BackgroundColor was the checkbox itself, as we had no label...
|
|
* So we have to move the processed overall background config to the checkbox element
|
|
*/
|
|
protected __processAllBackground(): void;
|
|
/**
|
|
* Processes the current border-radius attribute.
|
|
*/
|
|
protected __processBorderRadius(): void;
|
|
/**
|
|
* Sets the isReadOnly attribute and calls the associated process function (processIsReadOnly).
|
|
* @preserve (Part of the public API)
|
|
*/
|
|
setIsReadOnly(valueNew: boolean | null): void;
|
|
/**
|
|
* Returns the effective value of isReadOnly based on own and parent isReadOnly variable.
|
|
*/
|
|
getIsReadOnly(): boolean | undefined;
|
|
/**
|
|
* Process IsReadOnly.
|
|
*/
|
|
protected __processIsReadOnly(): void;
|
|
}
|
|
export type TextPosition = 'Left' | 'Right';
|
|
export { TcHmiCheckbox as Control };
|
|
declare const _TcHmiCheckbox: typeof TcHmiCheckbox;
|
|
type tTcHmiCheckbox = TcHmiCheckbox;
|
|
type tTextPosition = TextPosition;
|
|
declare global {
|
|
namespace TcHmi.Controls.Beckhoff {
|
|
const TcHmiCheckbox: typeof _TcHmiCheckbox;
|
|
type TcHmiCheckbox = tTcHmiCheckbox;
|
|
namespace TcHmiCheckbox {
|
|
type TextPosition = tTextPosition;
|
|
}
|
|
}
|
|
}
|
|
//# sourceMappingURL=TcHmiCheckbox.esm.d.ts.map
|