@@ -55,14 +55,13 @@ const Template: UI5StoryArgs<Input, StoryArgsSlots> = (args) => html`
55
55
</ ui5-input > `;
56
56
57
57
58
- export const BasicInput = Template . bind ( { } ) ;
59
- BasicInput . args = {
60
- showClearIcon : true ,
58
+ export const Basic = Template . bind ( { } ) ;
59
+ Basic . args = {
61
60
value : "Input"
62
61
} ;
63
62
64
- export const InputSuggestions = Template . bind ( { } ) ;
65
- InputSuggestions . decorators = [
63
+ export const WithSuggestions = Template . bind ( { } ) ;
64
+ WithSuggestions . decorators = [
66
65
( story ) => {
67
66
return html `
68
67
${ story ( ) }
@@ -75,7 +74,7 @@ InputSuggestions.decorators = [
75
74
"Austria" , "Australia" , "Bulgaria" , "Canada" , "Columbia" , "Croatia" , "Denmark" ,
76
75
"England" , "Finland" , "France" , "Germany" , "Hungary" , "Ireland" , "Italy" , "Kuwait" ,
77
76
"Luxembourg" , "Mexico" , "Morocco" , "Norway" , "Paraguay" , "Philippines" , "Portugal" ,
78
- "Spain" , "Sweden" , "Sri Lanka" , "Senegal" , "United Kingdom" , "USA" ] ;
77
+ "Spain" , "Sweden" , "Sri Lanka" , "Senegal" , "Thailand" , "The United Kingdom of Great Britain and Northern Ireland ", "USA" ] ;
79
78
80
79
if ( value ) {
81
80
suggestionItems = ui5_database_entries . filter ( ( item ) => {
@@ -87,26 +86,21 @@ InputSuggestions.decorators = [
87
86
} ) ;
88
87
suggestionItems . forEach ( ( item ) => {
89
88
const li = document . createElement ( "ui5-suggestion-item" ) ;
90
- li . icon = "world" ;
91
- li . additionalText = "explore" ;
92
- li . additionalTextState = "Success" ;
93
- li . description = "travel the world" ;
94
89
li . text = item ;
95
90
input ${ index } . appendChild ( li ) ;
96
91
} ) ;
97
92
} ) ;
98
93
</ script > `;
99
94
}
100
95
]
101
- InputSuggestions . args = {
96
+ WithSuggestions . args = {
102
97
placeholder : "Start typing country name" ,
103
98
showSuggestions : true ,
104
99
showClearIcon : true
105
100
} ;
106
- InputSuggestions . storyName = "Input With Suggestions (note: the usage depends on the framework you are using)" ;
107
101
108
- export const InputSuggestionsValueStateMessage = Template . bind ( { } ) ;
109
- InputSuggestionsValueStateMessage . args = {
102
+ export const WithValueStateMessage = Template . bind ( { } ) ;
103
+ WithValueStateMessage . args = {
110
104
default : `
111
105
<ui5-li>Cozy</ui5-li>
112
106
<ui5-li>Compact</ui5-li>
@@ -116,39 +110,31 @@ InputSuggestionsValueStateMessage.args = {
116
110
valueState : ValueState . Error ,
117
111
valueStateMessage : '<div slot="valueStateMessage">This is an error message. Extra long text used as an error message.</div>'
118
112
} ;
119
- InputSuggestionsValueStateMessage . storyName = "Input with Suggestions and Value State Message" ;
120
113
121
- export const InputLabel = Template . bind ( { } ) ;
122
- InputLabel . decorators = [
114
+ export const WithLabel = Template . bind ( { } ) ;
115
+ WithLabel . decorators = [
123
116
( story ) => {
124
117
return html `
125
118
< ui5-label class ="samples-big-margin-right " for ="input- ${ index + 1 } " required ="" show-colon =""> Secret Code</ ui5-label >
126
119
${ story ( ) }
127
120
` ;
128
121
}
129
122
]
130
- InputLabel . args = {
123
+ WithLabel . args = {
131
124
type : InputType . Password ,
132
- valueState : ValueState . Error ,
133
125
placeholder : "Enter your Secret Code" ,
134
126
required : true
135
127
} ;
136
- InputLabel . storyName = "Input with Label" ;
137
128
138
- export const InputWithVHD : StoryFn = ( ) => html `
129
+ export const WithValueHelpDialog : StoryFn = ( ) => html `
139
130
< ui5-input id ="valueHelpInput " placeholder ="Enter product " show-suggestions ="">
140
131
< ui5-icon id ="valueHelpIcon " slot ="icon " name ="value-help "> </ ui5-icon >
141
132
</ ui5-input >
142
133
< ui5-dialog id ="dialog " accessible-name ="Products Value Help ">
143
134
< div slot ="header " id ="dialogHeader " style ="width: 100%; padding: 0 1rem 0.5rem 1rem; ">
144
- < div id ="titleBar " style ="
145
- display: flex;
146
- justify-content: space-between;
147
- align-items: center; ">
135
+ < div id ="titleBar " style ="display: flex; justify-content: space-between; align-items: center; ">
148
136
< h2 id ="headerTitle " style ="
149
- margin-top: 1em !important;
150
- font-size: 1rem;
151
- font-weight: 500; ">
137
+ margin-top: 1em !important; font-size: 1rem; font-weight: 500; ">
152
138
Products
153
139
</ h2 >
154
140
< ui5-button design ="Transparent " id ="clearButton "> Clear</ ui5-button >
@@ -253,14 +239,12 @@ export const InputWithVHD: StoryFn = () => html`
253
239
itemsList ${ index } . addEventListener ( "item-click" , handleItemClick ) ;
254
240
</ script >
255
241
` ;
256
- InputWithVHD . parameters = {
242
+ WithValueHelpDialog . parameters = {
257
243
docs : {
258
244
story : {
259
245
// Opt-out of inline rendering
260
246
inline : false ,
261
247
iframeHeight : "500px" ,
262
248
} ,
263
249
}
264
- } ;
265
-
266
- InputWithVHD . storyName = "Input With Value Help Dialog" ;
250
+ } ;
0 commit comments