@bitrix24/b24ui-nuxt
Version:
Bitrix24 UI-Kit for developing web applications REST API for NUXT & VUE
112 lines (111 loc) • 4.62 kB
text/typescript
import type { NumberFieldRootProps } from 'reka-ui';
import type { AppConfig } from '@nuxt/schema';
import theme from '#build/b24ui/input-number';
import type { ButtonProps, BadgeProps, IconComponent, LinkPropsKeys } from '../types';
import type { InputHTMLAttributes } from '../types/html';
import type { ModelModifiers } from '../types/input';
import type { ComponentConfig } from '../types/tv';
type InputNumber = ComponentConfig<typeof theme, AppConfig, 'inputNumber'>;
type InputNumberValue = number | null;
export interface InputNumberProps<T extends InputNumberValue = InputNumberValue> extends Pick<NumberFieldRootProps, 'modelValue' | 'defaultValue' | 'min' | 'max' | 'step' | 'stepSnapping' | 'disabled' | 'required' | 'id' | 'name' | 'formatOptions' | 'disableWheelChange' | 'invertWheelChange' | 'readonly'>, /** @vue-ignore */ Omit<InputHTMLAttributes, 'disabled' | 'min' | 'max' | 'readonly' | 'required' | 'step' | 'name' | 'placeholder' | 'type' | 'autofocus' | 'maxlength' | 'minlength' | 'pattern' | 'size'> {
/**
* The element or component this component should render as.
* @defaultValue 'div'
*/
as?: any;
/** The placeholder text when the input is empty. */
placeholder?: string;
/**
* @defaultValue 'air-primary'
*/
color?: InputNumber['variants']['color'];
/**
* @defaultValue 'md'
*/
size?: InputNumber['variants']['size'];
/**
* Removes all borders (rings)
* @defaultValue false
*/
noBorder?: boolean;
/**
* Removes all borders (rings) except the bottom one
* @defaultValue false
*/
underline?: boolean;
/**
* Rounds the corners of the input
* @defaultValue false
*/
rounded?: boolean;
tag?: string;
/**
* @defaultValue 'air-primary'
*/
tagColor?: BadgeProps['color'];
/** Highlight the ring color like a focus state. */
highlight?: boolean;
/**
* The orientation of the input menu.
* @defaultValue 'horizontal'
*/
orientation?: 'vertical' | 'horizontal';
/**
* Configure the increment button. The `size` is inherited.
* @defaultValue { color: 'air-tertiary-no-accent' }
*/
increment?: boolean | Omit<ButtonProps, LinkPropsKeys>;
/**
* The icon displayed to increment the value.
* @defaultValue icons.plus
* @IconComponent
*/
incrementIcon?: IconComponent;
/** Disable the increment button. */
incrementDisabled?: boolean;
/**
* Configure the decrement button. The `size` is inherited.
* @defaultValue { color: 'air-tertiary-no-accent' }
*/
decrement?: boolean | Omit<ButtonProps, LinkPropsKeys>;
/**
* The icon displayed to decrement the value.
* @defaultValue icons.minus
* @IconComponent
*/
decrementIcon?: IconComponent;
/** Disable the decrement button. */
decrementDisabled?: boolean;
autofocus?: boolean;
autofocusDelay?: number;
modelModifiers?: Pick<ModelModifiers<T>, 'optional'>;
class?: any;
b24ui?: InputNumber['slots'];
}
export interface InputNumberEmits<T extends InputNumberValue = InputNumberValue> {
'update:modelValue': [value: T];
'blur': [event: FocusEvent];
'change': [event: Event];
}
export interface InputNumberSlots {
increment(props?: {}): any;
decrement(props?: {}): any;
}
declare const __VLS_export: <T extends InputNumberValue = InputNumberValue>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
props: __VLS_PrettifyLocal<InputNumberProps<T> & __VLS_EmitsToProps<__VLS_NormalizeEmits<((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "update:modelValue", value: T) => void)>>> & import("vue").PublicProps & (typeof globalThis extends {
__VLS_PROPS_FALLBACK: infer P;
} ? P : {});
expose: (exposed: import("vue").ShallowUnwrapRef<{
inputRef: Readonly<import("vue").Ref<HTMLInputElement, HTMLInputElement>>;
}>) => void;
attrs: any;
slots: InputNumberSlots;
emit: ((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "update:modelValue", value: T) => void);
}>) => import("vue").VNode & {
__ctx?: Awaited<typeof __VLS_setup>;
};
declare const _default: typeof __VLS_export;
export default _default;
type __VLS_PrettifyLocal<T> = {
[K in keyof T as K]: T[K];
} & {};