Skip to content
This repository has been archived by the owner on Dec 21, 2021. It is now read-only.

Commit

Permalink
Merge pull request #90 from Ultimaker/search-field
Browse files Browse the repository at this point in the history
STAR-303: Search and Code fields
  • Loading branch information
DanielSchiavini authored Nov 7, 2018
2 parents f7f0a7d + e4d7564 commit 208b98e
Show file tree
Hide file tree
Showing 16 changed files with 1,120 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/components/__tests__/__snapshots__/form.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ exports[`The Form component should render with a form item 1`] = `
className="input-container layout layout--gutter-xs"
>
<div
className="layout__item u-fill"
className="input-wrapper-children layout__item u-fill"
>
<input
className="input"
Expand Down
4 changes: 4 additions & 0 deletions src/components/input_field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import FileUploadField from './input_fields/file_upload_field';
import ChildrenField from './input_fields/children_field';
import TagsField from './input_fields/tags_field';
import TextField from './input_fields/text_field';
import CodeField from './input_fields/code_field';
import SearchField from './input_fields/search_field';

import {SelectOption} from './select_list';
import {ImageShape} from './image';
Expand Down Expand Up @@ -81,6 +83,8 @@ export class InputField extends React.Component<OldInputFieldProps, {}> {
password: TextField,
email: TextField,
url: TextField,
code: CodeField,
search: SearchField,
};

render() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`The code input field component should render a wrapper 1`] = `
<div
className="code-field"
id="testInputField"
>
<InputFieldWrapper
focusOnLoad={false}
id="testInputField"
labelLayoutWidth="1/1"
labelWidthBreakpoint="sm"
onChangeHandler={[MockFunction]}
staticField={false}
touched={false}
>
<input
className="input"
id="testInputField__0"
maxLength={1}
name="testInputField"
onChange={[Function]}
onKeyDown={[Function]}
onPaste={[Function]}
placeholder={null}
type="text"
value="2"
/>
<span
className="separator"
>
-
</span>
<input
className="input"
id="testInputField__1"
maxLength={1}
name="testInputField"
onChange={[Function]}
onKeyDown={[Function]}
onPaste={[Function]}
placeholder={null}
type="text"
value="0"
/>
<span
className="separator"
>
-
</span>
<input
className="input"
id="testInputField__2"
maxLength={1}
name="testInputField"
onChange={[Function]}
onKeyDown={[Function]}
onPaste={[Function]}
placeholder={null}
type="text"
value="1"
/>
<span
className="separator"
>
-
</span>
<input
className="input"
id="testInputField__3"
maxLength={1}
name="testInputField"
onChange={[Function]}
onKeyDown={[Function]}
onPaste={[Function]}
placeholder={null}
type="text"
value="8"
/>
<span
className="separator"
>
-
</span>
<input
className="input"
id="testInputField__4"
maxLength={1}
name="testInputField"
onChange={[Function]}
onKeyDown={[Function]}
onPaste={[Function]}
placeholder={null}
type="text"
value=""
/>
<span
className="separator"
>
-
</span>
<input
className="input"
id="testInputField__5"
maxLength={1}
name="testInputField"
onChange={[Function]}
onKeyDown={[Function]}
onPaste={[Function]}
placeholder={null}
type="text"
value=""
/>
</InputFieldWrapper>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ exports[`The input field wrapper component should render a wrapper with all opti
className="input-container layout layout--gutter-xs"
>
<div
className="layout__item u-fill"
className="input-wrapper-children layout__item u-fill"
>
<div>
child
Expand Down Expand Up @@ -94,7 +94,7 @@ exports[`The input field wrapper component should render a wrapper without any o
className="input-container layout layout--gutter-xs"
>
<div
className="layout__item u-fill"
className="input-wrapper-children layout__item u-fill"
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`The search field component should render a wrapper 1`] = `
<div
className="search-field"
>
<DefaultInputField
id="testInputField"
inputRef={
Object {
"current": Object {
"focus": [MockFunction],
},
}
}
labelLayoutWidth="1/1"
labelWidthBreakpoint="sm"
onChangeHandler={[MockFunction]}
placeholder="placeholder text"
staticField={false}
type="text"
value="2018"
>
<Button
className="search-button"
linkToNewTab={false}
onClickHandler={[Function]}
shape="rectangle"
style="quiet"
type="button"
>
<Icon(RejectedIcon)
size="sm"
/>
</Button>
</DefaultInputField>
</div>
`;
Loading

0 comments on commit 208b98e

Please sign in to comment.