Skip to content

Commit cd56538

Browse files
HDS-4254 Add searchFieldPosition to Single and Multiple SuperSelect, add preliminary Showcase examples
1 parent 95a5792 commit cd56538

File tree

5 files changed

+82
-0
lines changed

5 files changed

+82
-0
lines changed

packages/components/src/components/hds/form/super-select/multiple/base.hbs

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
@search={{@search}}
6060
@searchEnabled={{@searchEnabled}}
6161
@searchField={{@searchField}}
62+
@searchFieldPosition={{@searchFieldPosition}}
6263
@searchMessage={{@searchMessage}}
6364
@searchPlaceholder={{this.searchPlaceholder}}
6465
@selected={{@selected}}

packages/components/src/components/hds/form/super-select/multiple/field.hbs

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
@search={{@search}}
5454
@searchEnabled={{@searchEnabled}}
5555
@searchField={{@searchField}}
56+
@searchFieldPosition={{@searchFieldPosition}}
5657
@searchMessage={{@searchMessage}}
5758
@searchPlaceholder={{@searchPlaceholder}}
5859
@selected={{@selected}}

packages/components/src/components/hds/form/super-select/single/base.hbs

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
@search={{@search}}
5252
@searchEnabled={{@searchEnabled}}
5353
@searchField={{@searchField}}
54+
@searchFieldPosition="before-options"
5455
@searchMessage={{@searchMessage}}
5556
@searchPlaceholder={{this.searchPlaceholder}}
5657
@selected={{@selected}}

packages/components/src/components/hds/form/super-select/single/field.hbs

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
@search={{@search}}
5555
@searchEnabled={{@searchEnabled}}
5656
@searchField={{@searchField}}
57+
@searchFieldPosition="before-options"
5758
@searchMessage={{@searchMessage}}
5859
@searchPlaceholder={{@searchPlaceholder}}
5960
@selected={{@selected}}

showcase/app/templates/components/form/super-select.hbs

+78
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,84 @@
77

88
<BasicDropdownWormhole />
99

10+
TODO: Move this section down to a more appropriate spot
11+
12+
<Shw::Text::H2>searchFieldPosition</Shw::Text::H2>
13+
14+
<Shw::Grid @columns={{2}} {{style padding-bottom="15em"}} as |SG|>
15+
<SG.Item @label="Multiple w/ search in “trigger” position">
16+
<Hds::Form::SuperSelect::Multiple::Field
17+
@onChange={{fn (mut @model.SELECTED_OPTION)}}
18+
@options={{@model.OPTIONS}}
19+
@selected={{@model.SELECTED_OPTION}}
20+
@initiallyOpened={{true}}
21+
@verticalPosition="below"
22+
@searchEnabled={{true}}
23+
@searchFieldPosition="trigger"
24+
as |F|
25+
>
26+
<F.Label>This is the label</F.Label>
27+
<F.HelperText>This is the helper text</F.HelperText>
28+
{{F.options}}
29+
</Hds::Form::SuperSelect::Multiple::Field>
30+
</SG.Item>
31+
32+
<SG.Item @label="Multiple w/ search in “before-options” position">
33+
<Hds::Form::SuperSelect::Multiple::Field
34+
@onChange={{fn (mut @model.SELECTED_OPTION)}}
35+
@options={{@model.OPTIONS}}
36+
@selected={{@model.SELECTED_OPTION}}
37+
@initiallyOpened={{true}}
38+
@verticalPosition="below"
39+
@searchEnabled={{true}}
40+
@searchFieldPosition="before-options"
41+
as |F|
42+
>
43+
<F.Label>This is the label</F.Label>
44+
<F.HelperText>This is the helper text</F.HelperText>
45+
{{F.options}}
46+
</Hds::Form::SuperSelect::Multiple::Field>
47+
</SG.Item>
48+
</Shw::Grid>
49+
50+
<Shw::Grid @columns={{2}} {{style padding-bottom="15em"}} as |SG|>
51+
<SG.Item @label="Single w/ search in “before-options” position">
52+
<Hds::Form::SuperSelect::Single::Field
53+
@onChange={{fn (mut @model.SELECTED_OPTION)}}
54+
@options={{@model.OPTIONS}}
55+
@selected={{@model.SELECTED_OPTION}}
56+
@initiallyOpened={{true}}
57+
@verticalPosition="below"
58+
@searchEnabled={{true}}
59+
@searchFieldPosition="before-options"
60+
as |F|
61+
>
62+
<F.Label>This is the label</F.Label>
63+
<F.HelperText>This is the helper text</F.HelperText>
64+
{{F.options}}
65+
</Hds::Form::SuperSelect::Single::Field>
66+
</SG.Item>
67+
68+
<SG.Item @label="Multiple w/ search in “before-options” position">
69+
<Hds::Form::SuperSelect::Multiple::Field
70+
@onChange={{fn (mut @model.SELECTED_OPTION)}}
71+
@options={{@model.OPTIONS}}
72+
@selected={{@model.SELECTED_OPTION}}
73+
@initiallyOpened={{true}}
74+
@verticalPosition="below"
75+
@searchEnabled={{true}}
76+
@searchFieldPosition="before-options"
77+
as |F|
78+
>
79+
<F.Label>This is the label</F.Label>
80+
<F.HelperText>This is the helper text</F.HelperText>
81+
{{F.options}}
82+
</Hds::Form::SuperSelect::Multiple::Field>
83+
</SG.Item>
84+
</Shw::Grid>
85+
86+
<Shw::Divider />
87+
1088
<Shw::Text::H1>Form::SuperSelect</Shw::Text::H1>
1189

1290
<section data-test-percy>

0 commit comments

Comments
 (0)