Skip to content

Commit

Permalink
Add helper-text and update demos
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriy-fix committed May 29, 2020
1 parent 2d195ae commit 0addb1f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
10 changes: 10 additions & 0 deletions demo/time-picker-basic-demos.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ <h3>Value Resolution</h3>
</template>
</vaadin-demo-snippet>

<h3>Helper text</h3>
<p>Use the <code>helper-text</code> attribute or add content to the <code>helper</code> slot to set helper content.</p>
<vaadin-demo-snippet id="time-picker-basic-demos-helper-text">
<template preserve-content>
<vaadin-time-picker label="Alarm clock (hh:mm)">
<span slot="helper">The alarm will be repeated everyday</span>
</vaadin-time-picker>
</template>
</vaadin-demo-snippet>

<h3>Time Range</h3>
<p>
The <code>min</code> and <code>max</code> properties affect the range of times that will be available
Expand Down
8 changes: 8 additions & 0 deletions demo/time-picker-styling-demos.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ <h3>Custom Theme Variant</h3>
</template>
</vaadin-demo-snippet>

<h3>Helper text position</h3>
<vaadin-demo-snippet id="time-picker-styling-demos-helper-text-positions">
<template preserve-content>
<vaadin-time-picker helper-text="helper text below time picker"></vaadin-time-picker>
<vaadin-time-picker helper-text="helper text above time picker" theme="helper-above-field"></vaadin-time-picker>
</template>
</vaadin-demo-snippet>

</template>
<script>
class TimePickerStylingDemos extends DemoReadyEventEmitter(ElementDemo(Polymer.Element)) {
Expand Down
10 changes: 10 additions & 0 deletions src/vaadin-time-picker.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@
aria-label$="[[label]]"
clear-button-visible="[[clearButtonVisible]]"
i18n="[[i18n]]"
helper-text="[[helperText]]"
theme$="[[theme]]">
<slot name="helper" slot="helper">[[helperText]]</slot>
<span slot="suffix" part="toggle-button" class="toggle-button" role="button" aria-label$="[[i18n.selector]]"></span>
</vaadin-time-picker-text-field>
</vaadin-combo-box-light>
Expand Down Expand Up @@ -207,6 +209,14 @@
type: String
},

/**
* String used for the helper text.
*/
helperText: {
type: String,
value: ''
},

/**
* A placeholder string in addition to the label.
* @type {string}
Expand Down

0 comments on commit 0addb1f

Please sign in to comment.