diff --git a/src/AppMenu.vue b/src/AppMenu.vue index 108fa41d9..f9df35126 100644 --- a/src/AppMenu.vue +++ b/src/AppMenu.vue @@ -16,6 +16,7 @@ ● RadioButton ● Rating ● SelectButton + ● Slider ● Spinner ● Textarea ● ToggleButton diff --git a/src/assets/styles/primevue.css b/src/assets/styles/primevue.css index 72c2d1742..73a41b779 100644 --- a/src/assets/styles/primevue.css +++ b/src/assets/styles/primevue.css @@ -11,6 +11,7 @@ @import '../../components/panel/Panel.css'; @import '../../components/radiobutton/RadioButton.css'; @import '../../components/rating/Rating.css'; +@import '../../components/slider/Slider.css'; @import '../../components/spinner/Spinner.css'; @import '../../components/tabview/TabView.css'; @import '../../components/textarea/Textarea.css'; diff --git a/src/components/listbox/ListBox.vue b/src/components/listbox/ListBox.vue index 12d400eeb..31381d8ec 100644 --- a/src/components/listbox/ListBox.vue +++ b/src/components/listbox/ListBox.vue @@ -168,7 +168,7 @@ export default { let item = event.currentTarget; switch (event.which) { - //up arrow + //down case 40: var nextItem = this.findNextItem(item); if(nextItem) { @@ -178,7 +178,7 @@ export default { event.preventDefault(); break; - //down arrow + //up case 38: var prevItem = this.findPrevItem(item); if(prevItem) { diff --git a/src/components/slider/Slider.css b/src/components/slider/Slider.css new file mode 100644 index 000000000..b18e69413 --- /dev/null +++ b/src/components/slider/Slider.css @@ -0,0 +1,45 @@ +.p-slider { + position: relative; + text-align: left; +} +.p-slider .p-slider-handle { + position: absolute; + width: 1.2em; + height: 1.2em; + cursor: default; + -ms-touch-action: none; + touch-action: none; +} +.p-slider .p-slider-range { + position: absolute; + font-size: .7em; + display: block; + border: 0; + background-position: 0 0; +} + +.p-slider-horizontal { + height: .8em; +} +.p-slider-horizontal .p-slider-handle { + top: -.3em; + margin-left: -.6em; +} +.p-slider-horizontal .p-slider-range { + top: 0; + height: 100%; +} +.p-slider-vertical { + width: .8em; + height: 100px; +} +.p-slider-vertical .p-slider-handle { + left: -.3em; + margin-left: 0; + margin-bottom: -.6em; +} +.p-slider-vertical .p-slider-range { + left: 0; + width: 100%; + bottom: 0; +} \ No newline at end of file diff --git a/src/components/slider/Slider.vue b/src/components/slider/Slider.vue new file mode 100644 index 000000000..5818f9687 --- /dev/null +++ b/src/components/slider/Slider.vue @@ -0,0 +1,320 @@ + + + + + + + + + + diff --git a/src/main.js b/src/main.js index fc3feacf9..721425180 100644 --- a/src/main.js +++ b/src/main.js @@ -15,6 +15,7 @@ import Panel from './components/panel/Panel'; import Rating from './components/rating/Rating'; import RadioButton from './components/radiobutton/RadioButton'; import SelectButton from './components/selectbutton/SelectButton'; +import Slider from './components/slider/Slider'; import Spinner from './components/spinner/Spinner'; import Textarea from './components/textarea/Textarea'; import Toolbar from './components/toolbar/Toolbar'; @@ -43,6 +44,7 @@ Vue.component('p-panel', Panel); Vue.component('p-radioButton', RadioButton); Vue.component('p-rating', Rating); Vue.component('p-selectButton', SelectButton); +Vue.component('p-slider', Slider); Vue.component('p-spinner', Spinner); Vue.component('p-tabView', TabView); Vue.component('p-tabPanel', TabPanel); diff --git a/src/router.js b/src/router.js index 1d2679c16..407d706c9 100644 --- a/src/router.js +++ b/src/router.js @@ -81,6 +81,11 @@ export default new Router({ name: 'selectbutton', component: () => import('./views/selectbutton/SelectButtonDemo.vue') }, + { + path: '/slider', + name: 'slider', + component: () => import('./views/slider/SliderDemo.vue') + }, { path: '/spinner', name: 'spinner', diff --git a/src/views/slider/SliderDemo.vue b/src/views/slider/SliderDemo.vue new file mode 100644 index 000000000..c1134b8e6 --- /dev/null +++ b/src/views/slider/SliderDemo.vue @@ -0,0 +1,52 @@ + + + + + Slider + Slider is an input component to provide a numerical input. + + + + + Basic: {{value1}} + + + Input: {{value2}} + + + + Step: {{value3}} + + + Range: {{value4}} + + + Vertical: {{value5}} + + + + + + + +
Slider is an input component to provide a numerical input.