import { PropertyValues } from 'lit'; import { InputBaseElement } from '../input/input-base-element'; /** * `dap-ds-number-input` * @summary A number input component. * @element dap-ds-number-input * @title - Number input * * @property {string} label - The label of the input. * @property {string} placeholder - The placeholder of the input. * @property {string} description - The description of the input. * @property {string} tooltip - The tooltip of the input. * @property {'top' | 'right' | 'bottom' | 'left'} tooltipPlacement - The tooltip placement of the input. * @property {'success' | 'error'} status - The status of the input. Can be `success` or `error`. * @property {'xs' | 'sm' | 'sm'} size - The size of the input. Default is `sm`. Can be `sm` or `lg`. * @property {string} name - The name of the input. * @property {string} value - The value of the input. * @property {string} thousandSeparator - The thousand separator of the input. * @property {string} decimalSeparator - The decimal separator of the input. * @property {number} decimalScale - The decimal scale of the input. * @property {string} allowNegative - The allow negative state of the input. * @property {string} allowDecimal - The allow decimal state of the input. * @property {boolean} disabled - The disabled state of the input. Default is false. * @property {boolean} required - The required state of the input. Default is false. * @property {boolean} readonly - The readonly state of the input. Default is false. * @property {boolean} autofocus - The autofocus state of the input. Default is false. * @property {number} min - The minimum value of the number input. * @property {number} max - The maximum value of the number input. * @property {number} step - The step value of the number input. * @property {string} feedback - The feedback of the input. * @property {'negative' | 'positive' | 'warning'} feedbackType - The feedback type of the input. Can be `negative`, `positive`, or `warning`. * @property {boolean} loading - The loading state of the input. Default is false. * @property {boolean} optional - The optional state of the input. * @property {string} optionalLabel - The optional label of the input. * @property {boolean} subtle - The weight of the label. Default is `false` * @property {boolean} disableEnter - Disables the enter key from being used to submit the form. * @property {boolean} hideControls - Hides the increment and decrement buttons. * @property {number} padStart - The number of leading zeros to add to the input. * * @event {{ value: string }} dds-change - Fired when the input value changes. * @event {{ value: string }} dds-input - Fired when the input value changes. * @event {{ value: string, originalEvent: Event }} dds-keydown - Fired when a key is pressed down. * @event {{ void }} dds-blur - Fired when the input loses focus. * @event {{ void }} dds-focus - Emitted when the input gains focus. * * @slot feedback-icon - The custom icon of the feedback. * * @cssproperty --dds-input-height-xs - The height of the extra small input. (default: var(--dds-spacing-800) ). * @cssproperty --dds-input-height-sm - The height of the small input. (default: var(--dds-spacing-1000)). * @cssproperty --dds-input-height-lg - The height of the large input. (default: var(--dds-spacing-1200)). * @cssproperty --dds-input-padding-xs - The padding of the extra small input. (default: 0 var(--dds-spacing-200)). * @cssproperty --dds-input-padding-sm - The padding of the small input. (default: 0 var(--dds-spacing-300)). * @cssproperty --dds-input-padding-lg - The padding of the large input. (default: 0 var(--dds-spacing-400)). * @cssproperty --dds-input-font-size-xs - The font size of the extra small input. (default: var(--dds-font-sm)). * @cssproperty --dds-input-font-size-sm - The font size of the small input. (default: var(--dds-font-base)). * @cssproperty --dds-input-font-size-lg - The font size of the large input. (default: var(--dds-font-lg)). * @cssproperty --dds-input-border - The border of the input. (default: var(--dds-border-width-base) solid var(--dds-border-neutral-base)). * @cssproperty --dds-input-background - The background color of the input. (default: var(--dds-fields-background-default)). * @cssproperty --dds-input-text-color - The text color of the input. (default: var(--dds-text-neutral-base)). * @cssproperty --dds-input-border-radius - The border radius of the input. (default: var(--dds-radius-base)). * @cssproperty --dds-input-disabled-border - The border of the disabled input. (default: 0 solid var(--dds-border-neutral-disabled)). * @cssproperty --dds-input-disabled-background - The background color of the disabled input. (default: var(--dds-fields-background-disabled)). * @cssproperty --dds-input-disabled-text - The text color of the disabled input. (default: var(--dds-text-neutral-disabled)). * @cssproperty --dds-input-readonly-border - The border of the readonly input. (default: 0 solid var(--dds-border-neutral-subtle)). * @cssproperty --dds-input-readonly-background - The background color of the readonly input. (default: var(--dds-fields-background-read-only)). * @cssproperty --dds-input-readonly-text - The text color of the readonly input. (default: var(--dds-text-neutral-subtle)). * @cssproperty --dds-input-success-border - The border of the success input. (default: var(--dds-border-width-base) solid var(--dds-border-positive-base)). * @cssproperty --dds-input-error-border - The border of the error input. (default: var(--dds-border-width-base) solid var(--dds-border-negative-base)). * @cssproperty --dds-input-addon-background - The background color of the input addon. (default: var(--dds-fields-background-default)). * @cssproperty --dds-input-addon-success-background - The background color of the success input addon. (default: var(--dds-fields-background-default)). * @cssproperty --dds-input-addon-error-background - The background color of the error input addon. (default: var(--dds-fields-background-default)). * @cssproperty --dds-input-addon-border-before - The border of the addon before the input. (default: var(--dds-border-width-base) solid var(--dds-border-neutral-base)). * @cssproperty --dds-input-addon-border-after - The border of the addon after the input. (default: var(--dds-border-width-base) solid var(--dds-border-neutral-base)). * @cssproperty --dds-input-addon-border-width-before - The border width of the addon before the input. (default: var(--dds-border-width-base) 0 var(--dds-border-width-base) var(--dds-border-width-base)). * @cssproperty --dds-input-addon-border-width-after - The border width of the addon after the input. (default: var(--dds-border-width-base) var(--dds-border-width-base) var(--dds-border-width-base) 0). * @cssproperty --dds-input-addon-success-border - The border of the success addon. (default: var(--dds-border-width-base) solid var(--dds-border-positive-base)). * @cssproperty --dds-input-addon-success-border-before - The border of the success addon before the input. (default: var(--dds-border-width-base) solid var(--dds-border-positive-base)). * @cssproperty --dds-input-addon-success-border-after - The border of the success addon after the input. (default: var(--dds-border-width-base) solid var(--dds-border-positive-base)). * @cssproperty --dds-input-addon-success-border-width-before - The border width of the success addon before the input. (default: var(--dds-border-width-base) 0 var(--dds-border-width-base) var(--dds-border-width-base)). * @cssproperty --dds-input-addon-success-border-width-after - The border width of the success addon after the input. (default: var(--dds-border-width-base) var(--dds-border-width-base) var(--dds-border-width-base) 0). * @cssproperty --dds-input-addon-error-border-before - The border of the error addon before the input. (default: var(--dds-border-width-base) solid var(--dds-border-negative-base)). * @cssproperty --dds-input-addon-error-border-after - The border of the error addon after the input. (default: var(--dds-border-width-base) solid var(--dds-border-negative-base)). * @cssproperty --dds-input-addon-error-border-width-before - The border width of the error addon before the input. (default: var(--dds-border-width-base) 0 var(--dds-border-width-base) var(--dds-border-width-base)). * @cssproperty --dds-input-addon-error-border-width-after - The border width of the error addon after the input. (default: var(--dds-border-width-base) var(--dds-border-width-base) var(--dds-border-width-base) 0). * * @csspart base - The main number input container. * @csspart input - The input element. * @csspart label - The label of the input. * @csspart description - The description of the input. * @csspart feedback - The feedback of the input. * @csspart tooltip - The tooltip of the input. * @csspart addon-before - The addon before the input. * @csspart addon-after - The addon after the input. * @csspart prefix - The prefix of the input. * @csspart postfix - The postfix of the input. * @csspart decrement-button - The decrement button of the input. * @csspart increment-button - The increment button of the input. * @csspart decrement-button-base - The base of the decrement button. * @csspart increment-button-base - The base of the increment button. * @csspart decrement-button-content - The content of the decrement button. * @csspart increment-button-content - The content of the increment button. */ export default class DapDSNumberInput extends InputBaseElement { constructor(); private readonly inputElement; thousandSeparator: string; decimalSeparator: string; decimalScale?: number; allowNegative: string; allowDecimal: string; hideControls: boolean; padStart?: number; private formattedValue; get _thousandSeparator(): string; protected firstUpdated(changedProperties: PropertyValues): void; private handleKeydown; private getMaskedValue; private isBackspaceOrDelete; private handleEmptyValue; private createNumericRegex; private enforceDecimalScale; private applyPadStart; private convertToNumericValue; private handleInput; protected updated(changedProperties: PropertyValues): void; formResetCallback(): void; private _decrement; private _increment; render(): import('lit-html').TemplateResult<1>; }