diff --git a/exports/colorpicker.d.ts b/exports/colorpicker.d.ts new file mode 100644 index 000000000..e3b8f2e4e --- /dev/null +++ b/exports/colorpicker.d.ts @@ -0,0 +1 @@ +export * from './components/colorpicker/ColorPicker'; \ No newline at end of file diff --git a/exports/colorpicker.js b/exports/colorpicker.js new file mode 100644 index 000000000..d08b117d4 --- /dev/null +++ b/exports/colorpicker.js @@ -0,0 +1,3 @@ +'use strict'; +module.exports = require('./components/colorpicker/ColorPicker.vue'); + \ No newline at end of file diff --git a/src/AppMenu.vue b/src/AppMenu.vue index 4f9d2794f..3f195df14 100644 --- a/src/AppMenu.vue +++ b/src/AppMenu.vue @@ -10,6 +10,7 @@ Calendar Checkbox Chips + ColorPicker Dropdown Editor InputGroup diff --git a/src/assets/styles/primevue.css b/src/assets/styles/primevue.css index 783b61217..04c5c6a6e 100644 --- a/src/assets/styles/primevue.css +++ b/src/assets/styles/primevue.css @@ -1,6 +1,7 @@ @import '../../components/common/Common.css'; @import '../../components/button/Button.css'; @import '../../components/checkbox/Checkbox.css'; +@import '../../components/colorpicker/ColorPicker.css'; @import '../../components/inputtext/InputText.css'; @import '../../components/password/Password.css'; @import '../../components/radiobutton/RadioButton.css'; diff --git a/src/components/colorpicker/ColorPicker.css b/src/components/colorpicker/ColorPicker.css new file mode 100644 index 000000000..9732455c1 --- /dev/null +++ b/src/components/colorpicker/ColorPicker.css @@ -0,0 +1,86 @@ +.p-colorpicker { + display: inline-block; +} + +.p-colorpicker-dragging { + cursor: pointer; +} + +.p-colorpicker-overlay { + position: relative; +} + +.p-colorpicker-panel { + position: relative; + width: 193px; + height: 166px; + background-color: #323232; + border-color: #191919; +} + +.p-colorpicker-overlay-panel { + position: absolute; +} + +.p-colorpicker-preview { + width: 2em; + cursor: pointer; +} + +.p-colorpicker-panel .p-colorpicker-content { + position: relative; +} + +.p-colorpicker-panel .p-colorpicker-color-selector { + width: 150px; + height: 150px; + top: 8px; + left: 8px; + position: absolute; +} + +.p-colorpicker-panel .p-colorpicker-color { + width: 150px; + height: 150px; + background: transparent url("./images/color.png") no-repeat left top; +} + +.p-colorpicker-panel .p-colorpicker-color-handle { + position: absolute; + top: 0px; + left: 150px; + border-radius: 100%; + width: 10px; + height: 10px; + border: 1px solid #ffffff; + margin: -5px 0 0 -5px; + cursor: pointer; +} + +.p-colorpicker-panel .p-colorpicker-hue { + background: transparent url("./images/hue.png") no-repeat left top; + width: 17px; + height: 150px; + top: 8px; + left: 167px; + position: absolute; + opacity: .85; +} + +.p-colorpicker-panel .p-colorpicker-hue-handle { + position: absolute; + top: 150px; + left: 0px; + width: 21px; + margin-left: -2px; + margin-top: -5px; + height: 10px; + border: 2px solid #ffffff; + opacity: .85; + cursor: pointer; + } + + .p-colorpicker-panel.p-disabled .p-colorpicker-hue-handle, + .p-colorpicker-panel.p-disabled .p-colorpicker-color-handle { + opacity: .5; + } \ No newline at end of file diff --git a/src/components/colorpicker/ColorPicker.d.ts b/src/components/colorpicker/ColorPicker.d.ts new file mode 100644 index 000000000..f9f6b87d4 --- /dev/null +++ b/src/components/colorpicker/ColorPicker.d.ts @@ -0,0 +1,5 @@ +import Vue, { VNode } from 'vue'; + +export declare class ColorPicker extends Vue { + value: any; +} \ No newline at end of file diff --git a/src/components/colorpicker/ColorPicker.vue b/src/components/colorpicker/ColorPicker.vue new file mode 100644 index 000000000..87bc1c2de --- /dev/null +++ b/src/components/colorpicker/ColorPicker.vue @@ -0,0 +1,419 @@ + + + \ No newline at end of file diff --git a/src/components/colorpicker/images/color.png b/src/components/colorpicker/images/color.png new file mode 100644 index 000000000..561cdd9c5 Binary files /dev/null and b/src/components/colorpicker/images/color.png differ diff --git a/src/components/colorpicker/images/hue.png b/src/components/colorpicker/images/hue.png new file mode 100644 index 000000000..8efa25257 Binary files /dev/null and b/src/components/colorpicker/images/hue.png differ diff --git a/src/main.js b/src/main.js index 32b73d225..9f0f39d00 100644 --- a/src/main.js +++ b/src/main.js @@ -12,6 +12,7 @@ import Carousel from './components/carousel/Carousel'; import Chart from './components/chart/Chart'; import Checkbox from './components/checkbox/Checkbox'; import Chips from './components/chips/Chips'; +import ColorPicker from './components/colorpicker/ColorPicker'; import Column from './components/column/Column'; import ColumnGroup from './components/columngroup/ColumnGroup'; import ContextMenu from './components/contextmenu/ContextMenu'; @@ -98,6 +99,7 @@ Vue.component('Carousel', Carousel); Vue.component('Chart', Chart); Vue.component('Checkbox', Checkbox); Vue.component('Chips', Chips); +Vue.component('ColorPicker', ColorPicker); Vue.component('Column', Column); Vue.component('ColumnGroup', ColumnGroup); Vue.component('ContextMenu', ContextMenu); diff --git a/src/router.js b/src/router.js index b0980481b..1f84daa29 100644 --- a/src/router.js +++ b/src/router.js @@ -116,6 +116,11 @@ export default new Router({ name: 'chips', component: () => import('./views/chips/ChipsDemo.vue') }, + { + path: '/colorpicker', + name: 'colorpicker', + component: () => import('./views/colorpicker/ColorPickerDemo.vue') + }, { path: '/contextmenu', name: 'contextmenu', diff --git a/src/views/colorpicker/ColorPickerDemo.vue b/src/views/colorpicker/ColorPickerDemo.vue new file mode 100644 index 000000000..940adf8d0 --- /dev/null +++ b/src/views/colorpicker/ColorPickerDemo.vue @@ -0,0 +1,36 @@ + + + \ No newline at end of file diff --git a/src/views/colorpicker/ColorPickerDoc.vue b/src/views/colorpicker/ColorPickerDoc.vue new file mode 100644 index 000000000..b853f6691 --- /dev/null +++ b/src/views/colorpicker/ColorPickerDoc.vue @@ -0,0 +1,86 @@ + \ No newline at end of file