Skip to content

Commit 5d6ebe9

Browse files
authored
chore: Delete ValidateLabelInput (#1887)
BREAKING CHANGE: ValidateLabelInput is no longer included in the `@deephaven/components` package.
1 parent 4783092 commit 5d6ebe9

96 files changed

Lines changed: 11 additions & 222 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/code-studio/src/styleguide/Inputs.tsx

Lines changed: 10 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
DateTimeInput,
1414
CustomTimeSelect,
1515
UISwitch,
16-
ValidateLabelInput,
1716
Select,
1817
Option,
1918
} from '@deephaven/components';
@@ -44,8 +43,6 @@ const TIMEOUTS = [
4443
{ title: '4 hours', value: 4 * 60 * 60 * 1000 },
4544
];
4645

47-
const VALIDATE_OPTIONS = ['Invalid', 'Valid'];
48-
4946
function Inputs(): React.ReactElement {
5047
const [on, setOn] = useState(false);
5148
const [searchValue, setSearchValue] = useState('');
@@ -59,9 +56,6 @@ function Inputs(): React.ReactElement {
5956
const [autoResizeTextareaValue, setAutoResizeTextareaValue] = useState(
6057
'-DLiveTableMonitor.updateThreads=8 -DLiveTableMonitor.printDependencyInformation=false -Dassertion.heapDump=true -Drequire.heapDump=true -Dassertion.heapDump=true -Drequire.heapDump=true'
6158
);
62-
const [validateValue, setValidateValue] = useState('');
63-
const [validateOption, setValidateOption] = useState(VALIDATE_OPTIONS[0]);
64-
6559
const handleRadioChange = useCallback(
6660
(event: React.ChangeEvent<HTMLInputElement>) => {
6761
setRadioValue(event.target.value);
@@ -80,13 +74,6 @@ function Inputs(): React.ReactElement {
8074
[]
8175
);
8276

83-
const handleValidateInputChange = useCallback(
84-
(event: React.ChangeEvent<HTMLInputElement>) => {
85-
setValidateValue(event.target.value);
86-
},
87-
[]
88-
);
89-
9077
return (
9178
<div {...sampleSectionIdAndClasses('inputs', ['style-guide-inputs'])}>
9279
<h2 className="ui-title">Inputs</h2>
@@ -244,12 +231,12 @@ function Inputs(): React.ReactElement {
244231
defaultValue="0"
245232
className="custom-select"
246233
>
247-
<option disabled value="0">
234+
<Option disabled value="0">
248235
Custom Selection
249-
</option>
250-
<option value="1">One</option>
251-
<option value="2">Two</option>
252-
<option value="3">Three</option>
236+
</Option>
237+
<Option value="1">One</Option>
238+
<Option value="2">Two</Option>
239+
<Option value="3">Three</Option>
253240
</Select>
254241
</div>
255242

@@ -262,12 +249,12 @@ function Inputs(): React.ReactElement {
262249
className="custom-select"
263250
disabled
264251
>
265-
<option disabled value="0">
252+
<Option disabled value="0">
266253
Custom Selection
267-
</option>
268-
<option value="1">One</option>
269-
<option value="2">Two</option>
270-
<option value="3">Three</option>
254+
</Option>
255+
<Option value="1">One</Option>
256+
<Option value="2">Two</Option>
257+
<Option value="3">Three</Option>
271258
</Select>
272259
</div>
273260

@@ -297,52 +284,6 @@ function Inputs(): React.ReactElement {
297284
</div>
298285
</div>
299286

300-
<div className="col">
301-
<div className="form-group">
302-
<h5>Validate Label</h5>
303-
<ValidateLabelInput
304-
validationError={!validateValue ? 'Value not set' : undefined}
305-
isModified={!!validateValue}
306-
id="validateInput1"
307-
labelText={`Input Field${on ? ' (disabled)' : ''}`}
308-
hintText="Hint text"
309-
>
310-
<input
311-
disabled={on}
312-
type="text"
313-
className="form-control"
314-
aria-describedby="emailHelp"
315-
placeholder="Type to modify"
316-
onChange={handleValidateInputChange}
317-
/>
318-
</ValidateLabelInput>
319-
<ValidateLabelInput
320-
validationError={
321-
validateOption === 'Invalid' ? 'Invalid value' : undefined
322-
}
323-
id="validateLabelInput2"
324-
labelText={`Dropdown${on ? ' (disabled)' : ''}`}
325-
>
326-
<Select
327-
disabled={on}
328-
onChange={eventTargetValue =>
329-
setValidateOption(eventTargetValue)
330-
}
331-
value={validateOption}
332-
>
333-
{VALIDATE_OPTIONS.map(option => (
334-
<Option value={option} key={option}>
335-
{option}
336-
</Option>
337-
))}
338-
</Select>
339-
</ValidateLabelInput>
340-
<ValidateLabelInput labelText="Switch" isModified={on}>
341-
<UISwitch on={on} onClick={handleToggleClick} />
342-
</ValidateLabelInput>
343-
</div>
344-
</div>
345-
346287
<div className="col">
347288
<div className="form-group">
348289
<h5>Time Input</h5>

packages/components/src/ValidateLabelInput.scss

Lines changed: 0 additions & 10 deletions
This file was deleted.

packages/components/src/ValidateLabelInput.test.tsx

Lines changed: 0 additions & 52 deletions
This file was deleted.

packages/components/src/ValidateLabelInput.tsx

Lines changed: 0 additions & 89 deletions
This file was deleted.

packages/components/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,3 @@ export { default as TimeInput } from './TimeInput';
5858
export { default as TimeSlider } from './TimeSlider';
5959
export { default as ToastNotification } from './ToastNotification';
6060
export { default as UISwitch } from './UISwitch';
61-
export { default as ValidateLabelInput } from './ValidateLabelInput';

tests/styleguide.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ test('Inputs regression test', async ({ page }) => {
156156

157157
const columns = page.locator('#sample-section-inputs .col');
158158

159-
await expect(columns).toHaveCount(7, { timeout: 45000 });
159+
await expect(columns).toHaveCount(6, { timeout: 45000 });
160160

161161
// Test focus state for each enabled input
162162
const columnsCount = await columns.count();
-11.3 KB
-10.3 KB
187 Bytes
605 Bytes

0 commit comments

Comments
 (0)