diff --git a/components/dash-core-components/jest.config.js b/components/dash-core-components/jest.config.js index 3141291f22..960b2f2af7 100644 --- a/components/dash-core-components/jest.config.js +++ b/components/dash-core-components/jest.config.js @@ -33,5 +33,5 @@ module.exports = { // Disable caching to ensure TypeScript type changes are always picked up cache: false, // Limit workers in CI to prevent out-of-memory errors - maxWorkers: process.env.CI ? 2 : undefined, + maxWorkers: 2, }; diff --git a/components/dash-core-components/src/components/Input.tsx b/components/dash-core-components/src/components/Input.tsx index 533a8e1a21..86641c7e57 100644 --- a/components/dash-core-components/src/components/Input.tsx +++ b/components/dash-core-components/src/components/Input.tsx @@ -11,7 +11,12 @@ import React, { import uniqid from 'uniqid'; import fastIsNumeric from 'fast-isnumeric'; import LoadingElement from '../utils/_LoadingElement'; -import {PersistedProps, PersistenceTypes} from '../types'; +import { + HTMLInputTypes, + InputProps, + PersistedProps, + PersistenceTypes, +} from '../types'; import './css/input.css'; const isNumeric = (val: unknown): val is number => fastIsNumeric(val); @@ -20,238 +25,6 @@ const convert = (val: unknown) => (isNumeric(val) ? +val : NaN); const isEquivalent = (v1: number, v2: number) => v1 === v2 || (isNaN(v1) && isNaN(v2)); -export enum HTMLInputTypes { - // Only allowing the input types with wide browser compatibility - 'text' = 'text', - 'number' = 'number', - 'password' = 'password', - 'email' = 'email', - 'range' = 'range', - 'search' = 'search', - 'tel' = 'tel', - 'url' = 'url', - 'hidden' = 'hidden', -} - -type InputProps = { - /** - * The value of the input - */ - value?: string | number; - /** - * If true, changes to input will be sent back to the Dash server only on enter or when losing focus. - * If it's false, it will send the value back on every change. - * If a number, it will not send anything back to the Dash server until the user has stopped - * typing for that number of seconds. - */ - debounce?: boolean | number; - /** - * A hint to the user of what can be entered in the control . The placeholder text must not contain carriage returns or line-feeds. Note: Do not use the placeholder attribute instead of a