import { ExtractPropTypes } from 'vue'; import { BigIntDecimal } from '@opentiny/utils'; import { ISharedRenderlessFunctionParams, ISharedRenderlessParamUtils } from './shared.type.js'; declare const $constants: { MAX: string; MIN: string; VALUENOW: string; DISABLED: string; KEY: string; VALUE: string; EVENT_NAME: { blur: string; change: string; }; COMPONENT_NAME: string; FILTER_OPTION: string[]; }; declare const numericProps: { _constants: { type: ObjectConstructor; default: () => { MAX: string; MIN: string; VALUENOW: string; DISABLED: string; KEY: string; VALUE: string; EVENT_NAME: { blur: string; change: string; }; COMPONENT_NAME: string; FILTER_OPTION: string[]; }; }; allowEmpty: { type: BooleanConstructor; default: boolean; }; emptyValue: { default: undefined; }; circulate: BooleanConstructor; controls: { type: BooleanConstructor; default: boolean; }; controlsPosition: { type: StringConstructor; default: string; validator: (value: string) => boolean; }; disabled: BooleanConstructor; format: (StringConstructor | ObjectConstructor)[]; hideUnit: { type: BooleanConstructor; default: boolean; }; holdZero: { type: BooleanConstructor; default: boolean; }; label: StringConstructor; max: { type: (StringConstructor | NumberConstructor)[]; default: number; }; min: { type: (StringConstructor | NumberConstructor)[]; default: number; }; modelTruncation: { type: BooleanConstructor; default: boolean; }; modelValue: (StringConstructor | NumberConstructor | undefined)[]; mouseWheel: BooleanConstructor; name: StringConstructor; placeholder: StringConstructor; plugin: FunctionConstructor; precision: { type: NumberConstructor; validator(val: any): boolean; }; size: StringConstructor; step: { type: (StringConstructor | ObjectConstructor | NumberConstructor)[]; default: number; }; stepStrictly: { type: BooleanConstructor; default: boolean; }; strictInput: { type: BooleanConstructor; default: boolean; }; stringMode: BooleanConstructor; tabindex: { type: StringConstructor; default: string; }; theme: { type: StringConstructor; default: string; }; unit: StringConstructor; unitCenter: { type: BooleanConstructor; default: boolean; }; validateEvent: { type: BooleanConstructor; default: boolean; }; displayOnly: { type: BooleanConstructor; default: boolean; }; showLeft: { type: BooleanConstructor; default: boolean; }; showEmptyValue: { type: BooleanConstructor; default: boolean; }; title: { type: StringConstructor; default: string; }; tip: StringConstructor; shape: StringConstructor; clearable: { type: BooleanConstructor; default: boolean; }; filter: { type: BooleanConstructor; default: boolean; }; blank: { type: BooleanConstructor; default: boolean; }; changeCompat: { type: BooleanConstructor; default: boolean; }; tiny_mode: StringConstructor; tiny_mode_root: BooleanConstructor; tiny_template: (FunctionConstructor | ObjectConstructor)[]; tiny_renderless: FunctionConstructor; tiny_theme: StringConstructor; tiny_mcp_config: ObjectConstructor; tiny_chart_theme: ObjectConstructor; }; /** * Copyright (c) 2022 - present TinyVue Authors. * Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd. * * Use of this source code is governed by an MIT-style license. * * THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, * BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR * A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS. * */ declare const initService: (service: INumericRenderlessParamUtils['service']) => { getUnitPrecision: Function; getNumberFormat: Function; }; declare const getDecimal: (props: INumericProps) => (value: number) => any; declare const watchValue: ({ api, props, state }: Pick) => (value: number) => void; declare const toPrecision: (state: INumericState) => ({ num, precision }: { num: number; precision: number; }) => number; declare const getPrecision: () => (value: number) => number; declare const internalIncrease: ({ api, state }: Pick) => ({ val, step }: { val: number | string; step: number | string; }) => string; declare const internalDecrease: ({ api, state }: Pick) => ({ val, step }: { val: number | string; step: number | string; }) => string | number; declare const increase: ({ api, props, state }: Pick) => () => void; declare const decrease: ({ api, props, state }: Pick) => () => void; declare const handleBlur: ({ constants, dispatch, emit, props, state, api }: Pick) => (event: FocusEvent) => void; declare const handleFocus: ({ emit, state, props, api, vm }: Pick) => (event: FocusEvent) => void; declare const focus: (vm: INumericRenderlessParams['vm']) => () => void; declare const setCurrentValue: ({ api, constants, dispatch, emit, props, state }: Pick) => (newVal: number, emitChangeFlag?: boolean) => void; /** 处理输入字符: input / compositionend 事件均进入该函数 */ declare const handleInput: ({ state, api, emit, props }: Pick) => (event: InputEvent) => void; declare const handleInputChange: ({ api, state, props }: Pick) => (event: Event) => void; declare const select: (vm: INumericRenderlessParams['vm']) => () => any; declare const mounted: ({ constants, parent, props, state }: Pick) => () => void; declare const unmounted: ({ parent, state }: Pick) => () => void; declare const updated: ({ constants, parent, state }: Pick) => () => void; declare const displayValue: ({ props, state, api }: Pick) => () => string | number; declare const getNumPecision: ({ api, props }: Pick) => () => number; declare const mouseEvent: ({ api, props, state }: Pick) => (event: MouseEvent) => void | boolean; declare const getDisplayOnlyText: ({ parent, state, props }: Pick) => () => string | number; declare const filterValue: ({ state }: Pick) => () => number | string; declare const handleClear: ({ state, emit }: Pick) => () => void; declare const handleChange: ({ state, emit }: Pick) => () => void; type INumericProps = ExtractPropTypes; type INumericConstants = typeof $constants; interface INumericState { radioVal: string; currentValue: number | string; userInput: number | string; lastInput: number | string; inputStatus: boolean; decimal: BigIntDecimal; strictInput: boolean; inputSize: INumericSize; formSize: string; formDisabled: boolean; inputDisabled: boolean; displayValue: number | string; numPrecision: number; minDisabled: boolean; maxDisabled: boolean; controlsAtRight: boolean; format: INumericUnitPrecision; isDisplayOnly: boolean; } interface INumericApi { focus: ReturnType; select: ReturnType; getPrecision: ReturnType; toPrecision: ReturnType; updated: ReturnType; mounted: ReturnType; unmounted: ReturnType; getDecimal: ReturnType; handleFocus: ReturnType; decrease: ReturnType; increase: ReturnType; handleInput: ReturnType; getNumPecision: ReturnType; displayValue: ReturnType; internalDecrease: ReturnType; internalIncrease: ReturnType; handleInputChange: ReturnType; mouseEvent: ReturnType; handleBlur: ReturnType; watchValue: ReturnType; setCurrentValue: ReturnType; getDisplayOnlyText: ReturnType; filterValue: ReturnType; handleClear: ReturnType; handleChange: ReturnType; } type INumericRenderlessParams = ISharedRenderlessFunctionParams & { api: INumericApi; state: INumericState; props: INumericProps; }; type INumericRenderlessParamUtils = ISharedRenderlessParamUtils; type INumericSize = 'medium' | 'small' | 'mini'; interface INumericUnitPrecision { decimalSeparator: string; groupSeparator: string; fraction?: string; rounding?: string; zeroize: boolean; } interface INumericInitStateParams extends Pick { $service: ReturnType; } interface INumericGetEmitValueParams { newVal: number; emitValue: number | string | undefined; allowEmpty: boolean; defaultVal: number; bigNew: BigIntDecimal; oldVal: number; max: number; min: number; api: INumericApi; props: INumericProps; format: INumericState['format']; plugin: INumericProps['plugin']; stringMode: boolean; } export { INumericApi, INumericConstants, INumericGetEmitValueParams, INumericInitStateParams, INumericProps, INumericRenderlessParamUtils, INumericRenderlessParams, INumericSize, INumericState, INumericUnitPrecision };