/** * Copyright Aquera Inc 2023 * * This source code is licensed under the BSD-3-Clause license found in the * LICENSE file in the root directory of this source tree. */ import { TemplateResult } from 'lit'; import NileElement from '../internal/nile-element'; import { CSSResultGroup } from 'lit'; /** * @summary Allows you to switch between nile elements * * @dependency nile-icon * @dependency nile-input * @dependency nile-checkbox * @dependency nile-dropdown * @dependency nile-textarea * * @event nile-change - Emitted when the control's value changes. * @event nile-switch - Emitted when the nile component is being switched. */ export interface switchconfig { [key: string]: any; toggleSwitch: boolean; disable?: boolean; confirmation?: boolean; align: 'block' | 'inline'; inputs: switchInputType[]; } export interface switchInputType { inputType: INPUT_TYPE_NAMES.DROPDOWN | INPUT_TYPE_NAMES.TEXT | INPUT_TYPE_NAMES.CHECKBOX | INPUT_TYPE_NAMES.TEXTAREA | INPUT_TYPE_NAMES.RADIO | INPUT_TYPE_NAMES.CONTENTEDITOR | INPUT_TYPE_NAMES.OBJECT_MAPPER | INPUT_TYPE_NAMES.CODE_EDITOR; value?: String | boolean; label?: String; readonly?: boolean; type?: string; icon: string; mode?: string; placeholder?: string; disabled?: boolean; required?: boolean; error?: boolean; errorMessage?: string; options?: Array; customAutoCompletions?: any; helperText?: string; multiple?: boolean; noborder?: boolean; multiLine?: boolean; expand?: boolean; updateValue?: false; } export declare enum POSITIONS { INLINE = "inline", BLOCK = "block" } export declare enum INPUT_TYPE { DEFAULT = "defaultInput", SWITCH = "switchInput" } export declare enum INPUT_TYPE_NAMES { DROPDOWN = "dropdown", TEXT = "text", CHECKBOX = "checkbox", TEXTAREA = "text-area", RADIO = "radio", CONTENTEDITOR = "content-editor", OBJECT_MAPPER = "object-mapper", CODE_EDITOR = "code-editor" } export declare enum MODE { CREATE = "create", EDIT = "edit" } export declare class NileSwitcher extends NileElement { /** * The styles for nile switcher * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]` */ static styles: CSSResultGroup; private readonly hasSlotController; nileSwitchConfig: switchconfig; current: Number; currentInput: switchInputType; connectedCallback(): void; handleSwitcherChange(): void; setCurrentInput(): void; disconnectedCallback(): void; renderNileText(Input: switchInputType): TemplateResult<1>; renderDropdown(Input: switchInputType): TemplateResult<1>; renderNileTextArea(Input: switchInputType): TemplateResult<1>; renderNileCheckBox(Input: switchInputType): TemplateResult<1>; renderNileRadio(Input: switchInputType): TemplateResult<1>; renderErrorMessage(errorMessage: string): TemplateResult<1>; renderContentEditor(Input: switchInputType): TemplateResult<1>; renderObjectMapper(Input: switchInputType): TemplateResult<1>; renderCodeEditor(Input: switchInputType): TemplateResult<1>; handleExpand(event: CustomEvent, inputType: string): void; handleChange(event: CustomEvent, inputType: string): void; renderIcon(): TemplateResult<1>; isToggleSwitch: (item: any) => any; toggleField(currentInput: switchInputType, index: Number): void; singleFieldSwitcher(): TemplateResult<1>; render(): TemplateResult; } export default NileSwitcher; declare global { interface HTMLElementTagNameMap { 'nile-switcher': NileSwitcher; } }