diff --git a/assets/iview.png b/assets/iview.png
index 8ce27c1b..8bd104f7 100644
Binary files a/assets/iview.png and b/assets/iview.png differ
diff --git a/package.json b/package.json
index bcd654f8..da3d38b4 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "iview",
- "version": "0.9.15",
+ "version": "0.9.16",
"title": "iView",
"description": "A high quality UI components Library with Vue.js",
"homepage": "http://www.iviewui.com",
diff --git a/src/components/carousel/carousel-item.vue b/src/components/carousel/carousel-item.vue
index c0092d9c..7381afc4 100644
--- a/src/components/carousel/carousel-item.vue
+++ b/src/components/carousel/carousel-item.vue
@@ -21,7 +21,7 @@
width: `${this.width}px`,
height: `${this.height}`,
left: `${this.left}px`
- }
+ };
}
},
compiled () {
diff --git a/src/components/carousel/carousel.vue b/src/components/carousel/carousel.vue
index 17d383b0..6902205f 100644
--- a/src/components/carousel/carousel.vue
+++ b/src/components/carousel/carousel.vue
@@ -24,12 +24,13 @@
diff --git a/src/components/rate/index.js b/src/components/rate/index.js
new file mode 100644
index 00000000..24e54060
--- /dev/null
+++ b/src/components/rate/index.js
@@ -0,0 +1,2 @@
+import Rate from './rate.vue';
+export default Rate;
\ No newline at end of file
diff --git a/src/components/rate/rate.vue b/src/components/rate/rate.vue
new file mode 100644
index 00000000..5ae3c78d
--- /dev/null
+++ b/src/components/rate/rate.vue
@@ -0,0 +1,127 @@
+
+
+
+
+
+
+ {{ value }} {{ t('i.rate.star') }}{{ t('i.rate.stars') }}
+
+
+
+
\ No newline at end of file
diff --git a/src/components/select/option.vue b/src/components/select/option.vue
index 535e4871..471f6a59 100644
--- a/src/components/select/option.vue
+++ b/src/components/select/option.vue
@@ -55,7 +55,8 @@
this.isFocus = false;
},
queryChange (val) {
- this.hidden = !new RegExp(val, 'i').test(this.searchLabel);
+ const parsedQuery = val.replace(/(\^|\(|\)|\[|\]|\$|\*|\+|\.|\?|\\|\{|\}|\|)/g, '\\$1');
+ this.hidden = !new RegExp(parsedQuery, 'i').test(this.searchLabel);
}
},
compiled () {
diff --git a/src/index.js b/src/index.js
index 47c52b1b..15e1c9cf 100644
--- a/src/index.js
+++ b/src/index.js
@@ -28,6 +28,7 @@ import Page from './components/page';
import Poptip from './components/poptip';
import Progress from './components/progress';
import Radio from './components/radio';
+import Rate from './components/rate';
import Slider from './components/slider';
import Spin from './components/spin';
import Steps from './components/steps';
@@ -86,6 +87,7 @@ const iview = {
Progress,
Radio,
RadioGroup: Radio.Group,
+ Rate,
Row,
iSelect: Select,
Slider,
diff --git a/src/locale/lang/en-US.js b/src/locale/lang/en-US.js
index 98bfeff1..9b21bafa 100644
--- a/src/locale/lang/en-US.js
+++ b/src/locale/lang/en-US.js
@@ -83,6 +83,10 @@ export default {
page: '/page',
goto: 'Goto',
p: ''
+ },
+ rate: {
+ star: 'Star',
+ stars: 'Stars'
}
}
};
\ No newline at end of file
diff --git a/src/locale/lang/zh-CN.js b/src/locale/lang/zh-CN.js
index f2792476..c44f9177 100644
--- a/src/locale/lang/zh-CN.js
+++ b/src/locale/lang/zh-CN.js
@@ -83,6 +83,10 @@ export default {
page: '条/页',
goto: '跳至',
p: '页'
+ },
+ rate: {
+ star: '星',
+ stars: '星'
}
}
};
\ No newline at end of file
diff --git a/src/locale/lang/zh-TW.js b/src/locale/lang/zh-TW.js
index 998a3708..e7c8d6c8 100644
--- a/src/locale/lang/zh-TW.js
+++ b/src/locale/lang/zh-TW.js
@@ -83,6 +83,10 @@ export default {
page: '條/頁',
goto: '跳至',
p: '頁'
+ },
+ rate: {
+ star: '星',
+ stars: '星'
}
}
};
\ No newline at end of file
diff --git a/src/styles/components/index.less b/src/styles/components/index.less
index d0ba5dfb..0c613c25 100644
--- a/src/styles/components/index.less
+++ b/src/styles/components/index.less
@@ -35,4 +35,5 @@
@import "date-picker";
@import "time-picker";
@import "form";
-@import "carousel";
\ No newline at end of file
+@import "carousel";
+@import "rate";
diff --git a/src/styles/components/rate.less b/src/styles/components/rate.less
new file mode 100644
index 00000000..d1ad1728
--- /dev/null
+++ b/src/styles/components/rate.less
@@ -0,0 +1,72 @@
+@rate-prefix-cls: ~"@{css-prefix}rate";
+
+.@{rate-prefix-cls} {
+ display: inline-block;
+ margin: 0;
+ padding: 0;
+ font-size: 20px;
+ vertical-align: middle;
+ font-weight: normal;
+ font-style: normal;
+
+ &-disabled &-star {
+ &:before,
+ &-content:before {
+ cursor: default;
+ }
+ &:hover {
+ transform: scale(1);
+ }
+ }
+
+ &-star {
+ display: inline-block;
+ margin: 0;
+ padding: 0;
+ margin-right: 8px;
+ position: relative;
+ font-family: 'Ionicons';
+ transition: all 0.3s ease;
+
+ &:hover {
+ transform: scale(1.1);
+ }
+
+ &:before,
+ &-content:before {
+ color: #e9e9e9;
+ cursor: pointer;
+ content: "\F4B3";
+ transition: all @transition-time @ease-in-out;
+ display: block;
+ }
+
+ &-content {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 50%;
+ height: 100%;
+ overflow: hidden;
+ &:before {
+ color: transparent;
+ }
+ }
+
+ &-half &-content:before,
+ &-full:before {
+ color: @rate-star-color;
+ }
+
+ &-half:hover &-content:before,
+ &-full:hover:before {
+ color: tint(@rate-star-color, 20%);
+ }
+ }
+ &-text {
+ margin-left: 8px;
+ vertical-align: middle;
+ display: inline-block;
+ font-size: @font-size-small;
+ }
+}
\ No newline at end of file
diff --git a/src/styles/themes/default/custom.less b/src/styles/themes/default/custom.less
index ba7236e1..fb3367f3 100644
--- a/src/styles/themes/default/custom.less
+++ b/src/styles/themes/default/custom.less
@@ -14,6 +14,7 @@
@selected-color : fade(@primary-color, 90%);
@tooltip-color : #fff;
@subsidiary-color : #9ea7b4;
+@rate-star-color : #f5a623;
// Base
@body-background : #fff;
diff --git a/test/app.vue b/test/app.vue
index 19834737..08592f56 100644
--- a/test/app.vue
+++ b/test/app.vue
@@ -48,6 +48,7 @@ li + li {
Date
Form
Carousel
+ Rate
diff --git a/test/main.js b/test/main.js
index 9f6dd37d..11a8abb2 100644
--- a/test/main.js
+++ b/test/main.js
@@ -6,9 +6,10 @@ import VueRouter from 'vue-router';
import App from './app.vue';
import iView from '../src/index';
// import locale from '../src/locale/lang/en-US';
+import locale from '../src/locale/lang/zh-CN';
Vue.use(VueRouter);
-Vue.use(iView);
+Vue.use(iView, { locale });
// 开启debug模式
Vue.config.debug = true;
@@ -139,6 +140,11 @@ router.map({
require(['./routers/carousel.vue'], resolve);
}
},
+ '/rate': {
+ component: function (resolve) {
+ require(['./routers/rate.vue'], resolve);
+ }
+ },
});
router.beforeEach(function () {
diff --git a/test/routers/form.vue b/test/routers/form.vue
index fa72a35c..85b28f41 100644
--- a/test/routers/form.vue
+++ b/test/routers/form.vue
@@ -5,7 +5,7 @@
-
+
diff --git a/test/routers/input.vue b/test/routers/input.vue
index efbfdd02..1d0bb215 100644
--- a/test/routers/input.vue
+++ b/test/routers/input.vue
@@ -1,4 +1,6 @@
+
+
diff --git a/test/routers/menu.vue b/test/routers/menu.vue
index a7edc33f..3150cb28 100644
--- a/test/routers/menu.vue
+++ b/test/routers/menu.vue
@@ -1,28 +1,51 @@
-
-
- 切换主题
-
-
-
-
-
+
+
+
diff --git a/test/routers/rate.vue b/test/routers/rate.vue
new file mode 100644
index 00000000..40da8434
--- /dev/null
+++ b/test/routers/rate.vue
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+ {{ valueCustomText }}
+
+
+
+
+
\ No newline at end of file
diff --git a/test/routers/select.vue b/test/routers/select.vue
index 72ccf959..90b325dc 100644
--- a/test/routers/select.vue
+++ b/test/routers/select.vue
@@ -1,24 +1,49 @@
-
-
- 北京
- Beiing
-
-
- 上海
- ShangHai
-
-
- 深圳
- ShenZhen
-
-
+
+
+
+ {{ item.label }}
+
+
+
+
+ {{ item.label }}
+
+
+