import { Event } from '../../stencil-public-runtime'; import type { ComponentInterface, EventEmitter } from '../../stencil-public-runtime'; import type { AutocompleteTypes } from "../../common/interface"; import { StyleEventDetail } from './input.utils'; import type { TextFieldTypes } from './input.utils'; export interface Rule { required?: boolean; message?: string; validator?: (value: string | number) => boolean; } export interface CustomEvent { change: (e: { detail: { value: string; }; }) => void; focus?: () => void; blur?: () => void; } export declare class JackeryField implements ComponentInterface { private nativeInput?; private inputId; private inheritedAttributes; private isComposing; private slotMutationController?; private notchController?; private notchSpacerEl; private originalJackeryInput?; /** * `true` if the input was cleared as a result of the user typing * with `clearOnEdit` enabled. * * Resets when the input loses focus. */ private didInputClearOnEdit; /** * input focused时候的value */ private focusedValue?; hasFocus: boolean; element: HTMLJackeryFieldElement; /** * The color to use from your application's color palette. * Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. * For more information on colors, see [theming](/docs/theming/basics). */ color?: string; /** * 指示文本值在输入/编辑时是否以及如何自动大写。 * 可用选项: `"off"`, `"none"`, `"on"`, `"sentences"`, `"words"`, `"characters"`. */ autocapitalize: string; /** * 是否启用自动纠错 */ autocorrect: 'on' | 'off'; /** * 控件的值是否可以由浏览器自动补全。 */ autocomplete: AutocompleteTypes; /** * 自动聚焦 */ autofocus: boolean; /** * 设置为true,出现一键清除内容按钮 */ clearInput: boolean; /** * 如果`true`,该值将在编辑后被清除。当`type`为`password`时默认为`true`,其他类型为`false`。 */ clearOnEdit?: boolean; /** * 如果为`true`,字符计数器将显示字符数和总字符限制。还必须设置`maxlength`属性,以便正确计算计数器。 */ counter: boolean; /** * 处理计算器文本的回调函数. * 默认计数器格式为 `itemLength / maxLength`. */ counterFormatter?: (inputLength: number, maxLength: number) => string; /** * 每次触发' jackeryInput '事件所需的等待时间(以毫秒为单位)。 */ debounce?: number; protected debounceChanged(): void; /** * 禁用控件 */ disabled: boolean; protected disabledChanged(): void; /** * html属性:可以修改键盘enter键显示. * 可选值: `"enter"`, `"done"`, `"go"`, `"next"`, * `"previous"`, `"search"`, and `"send"`. */ enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send'; /** * 错误显示信息 */ errorText?: string; /** * 帮助提示,没有检测到错误文本时候显示 */ helperText?: string; /** * 填充. 如果为 `"solid"` 设置背景. 如果为 * `"outline"` 透明并带边框. */ fill?: 'outline' | 'solid'; /** * 控件键盘显示类型. * 可选值: `"none"`, `"text"`, `"tel"`, `"url"`, * `"email"`, `"numeric"`, `"decimal"`, and `"search"`. */ inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'; /** * 控件标签 * 如果同时使用`label`属性,`label`属性将优先于`label`插槽。 */ label?: string; /** * 标签label相对于控件的位置. * `"start"`: label在控件的左边. * `"end"`: 位于控件右边 * `"floating"`: 聚焦时候标签缩小到控件上方 * `"stacked"`: 一直缩小在控件上方显示 * `"fixed"`: 与start相同,但有固定宽度,长文本会省略显示 */ labelPlacement: 'start' | 'end' | 'floating' | 'stacked' | 'fixed'; /** * 最大值 - 不能小于min */ max?: string | number; /** *最大字符限制数:当type属性为 `text`, `email`, `search`, `password`, `tel`, 或 `url`, 可以指定用户最大输入字符数. */ maxlength?: number; /** * 最小值 - 不能大于max. */ min?: string | number; /** * 最小字符限制数:当type属性为 `text`, `email`, `search`, `password`, `tel`, 或 `url`, 可以指定用户最小输入字符数. */ minlength?: number; /** * 为true时可以输入多个值。当type属性为`email`时,此属性生效,否则将被忽略。 */ multiple?: boolean; /** * The name of the control, which is submitted with the form data. */ name: string; pattern?: string; defaultvalue?: string; /** * 指示性文本-placeholder * 此属性只适用于 当属性 `type` 为 `"email"`, * `"number"`, `"password"`, `"search"`, `"tel"`, `"text"`, or `"url"`时, 否则会被忽略. */ placeholder?: string; /** * 只读属性 */ readonly: boolean; /** * 是否必填. */ required: boolean; /** * input的形状,round圆角大 */ shape?: 'round'; /** * 是否检查拼写语法 */ spellcheck: boolean; /** * 步进增量 */ step?: string; size?: number; /** * 控件显示类型,默认text. */ type: TextFieldTypes; errormsg?: string; /** * value */ value?: string | number | null; rules: Rule[]; showError: boolean; inputRef: any; errorRef: any; /** * 每次修改输入值触发`jackeryInput`事件. * 与`jackeryChange`不同, `jackeryInput`在每次更改时候触发 */ jackeryInput: EventEmitter; /** * `jackeryChange` event */ jackeryChange: EventEmitter; /** * 失去焦点触发 */ jackeryBlur: EventEmitter; /** * 聚焦触发 */ jackeryFocus: EventEmitter; /** * Emitted when the styles change. * @internal */ ionStyle: EventEmitter; /** * Update the item classes when the placeholder changes */ protected placeholderChanged(): void; /** * Emits an `jackeryChange` event. * * This API should be called for user committed changes. * This API should not be used for external value changes. */ private emitValueChange; /** * Emits an `ionInput` event. */ private emitInputChange; /** * 渲染helperText 和 errorText */ private renderHintText; private renderCounter; private onInput; private onChange; private onBlur; private onFocus; private shouldClearOnEdit; private emitStyle; private getValue; private onCompositionStart; private onCompositionEnd; private clearTextInput; private onKeydown; private checkClearOnEdit; private hasValue; /** * Responsible for rendering helper text, * error text, and counter. This element should only * be rendered if hint text is set or counter is enabled. */ private renderBottomContent; private renderLabel; /** * Returns `true` if label content is provided * either by a prop or a content. If you want * to get the plaintext value of the label use * the `labelText` getter instead. */ private get hasLabel(); /** * Gets any content passed into the `label` slot, * not the definition. */ private get labelSlot(); /** * Renders the border container * when fill="outline". */ private renderLabelContainer; /** * value改变时 - 更新input */ protected valueChanged(): void; fieldEvent: EventEmitter; evenFn: (type: string) => (e: Event) => void; validRules: () => void; setRules(rules: Rule[]): void; componentDidLoad(): void; componentDidRender(): void; componentWillLoad(): void; connectedCallback(): void; disconnectedCallback(): void; setFocus(): Promise; /** * Returns the native `` element used under the hood. */ getInputElement(): Promise; private renderInput; render(): any; }