Commit 4ac6bce41828fcbdc3440b9b8aa9f9765c4eafa4

Authored by yangdan8
Committed by GitHub
2 parents 565a42ad 77a67f5d

Merge pull request #29 from iview/2.0

update
Showing 51 changed files with 1008 additions and 105 deletions   Show diff stats
README.md
... ... @@ -40,13 +40,6 @@ iView
40 40 </a>
41 41 </td>
42 42 </tr>
43   - <tr>
44   - <td align="center" valign="middle">
45   - <a href="https://uniapp.dcloud.io/?hmsr=iview&hmpl=&hmcu=&hmkw=&hmci=" target="_blank">
46   - <img width="300" src="https://file.iviewui.com/asd/asd-uniapp.png">
47   - </a>
48   - </td>
49   - </tr>
50 43 </tbody>
51 44 </table>
52 45  
... ...
examples/app.vue
... ... @@ -68,6 +68,7 @@ nav {
68 68 <li><router-link to="/time">Time</router-link></li>
69 69 <li><router-link to="/cell">Cell</router-link></li>
70 70 <li><router-link to="/drawer">Drawer</router-link></li>
  71 + <li><router-link to="/icon">Icon</router-link></li>
71 72 </ul>
72 73 </nav>
73 74 <router-view></router-view>
... ...
examples/main.js
... ... @@ -229,6 +229,10 @@ const router = new VueRouter({
229 229 {
230 230 path: '/drawer',
231 231 component: (resolve) => require(['./routers/drawer.vue'], resolve)
  232 + },
  233 + {
  234 + path: '/icon',
  235 + component: (resolve) => require(['./routers/icon.vue'], resolve)
232 236 }
233 237 ]
234 238 });
... ...
examples/routers/button.vue
... ... @@ -220,7 +220,9 @@
220 220 <Button type="default">Small</Button>
221 221 </Button-group>
222 222  
223   - <br><br><br><br><br>
  223 + <br><br>
  224 + <Button to="/icon">Open New Window</Button>
  225 + <br><br><br>
224 226 </div>
225 227 </template>
226 228 <script>
... ...
examples/routers/cell.vue
... ... @@ -3,7 +3,7 @@
3 3 <Card title="选项" :padding="0" shadow style="width: 300px;">
4 4 <CellGroup @on-click="handleClick">
5 5 <Cell title="标题一" name="a1" label="附属内容" to="/button">
6   - <Badge count="10" slot="extra"></Badge>
  6 + <Badge :count="10" slot="extra"></Badge>
7 7 </Cell>
8 8 <Cell title="标题一" name="a2" label="附属内容" extra="详细信息"></Cell>
9 9 <Cell title="标题一" name="a3" label="附属内容" extra="详细信息" to="/button"></Cell>
... ...
examples/routers/icon.vue 0 → 100644
  1 +<template>
  2 + <div>
  3 + <Icon v-for="item in icons" :key="item" :type="item" />
  4 + </div>
  5 +</template>
  6 +
  7 +<script>
  8 +export default {
  9 + data() {
  10 + return {
  11 + icons: ["ios-add-circle-outline","ios-add-circle","ios-add","ios-alarm-outline","ios-alarm","ios-albums-outline","ios-albums","ios-alert-outline","ios-alert","ios-american-football-outline","ios-american-football","ios-analytics-outline","ios-analytics","ios-aperture-outline","ios-aperture","ios-apps-outline","ios-apps","ios-appstore-outline","ios-appstore","ios-archive-outline","ios-archive","ios-arrow-back","ios-arrow-down","ios-arrow-dropdown-circle","ios-arrow-dropdown","ios-arrow-dropleft-circle","ios-arrow-dropleft","ios-arrow-dropright-circle","ios-arrow-dropright","ios-arrow-dropup-circle","ios-arrow-dropup","ios-arrow-forward","ios-arrow-round-back","ios-arrow-round-down","ios-arrow-round-forward","ios-arrow-round-up","ios-arrow-up","ios-at-outline","ios-at","ios-attach","ios-backspace-outline","ios-backspace","ios-barcode-outline","ios-barcode","ios-baseball-outline","ios-baseball","ios-basket-outline","ios-basket","ios-basketball-outline","ios-basketball","ios-battery-charging","ios-battery-dead","ios-battery-full","ios-beaker-outline","ios-beaker","ios-beer-outline","ios-beer","ios-bicycle","ios-bluetooth","ios-boat-outline","ios-boat","ios-body-outline","ios-body","ios-bonfire-outline","ios-bonfire","ios-book-outline","ios-book","ios-bookmark-outline","ios-bookmark","ios-bookmarks-outline","ios-bookmarks","ios-bowtie-outline","ios-bowtie","ios-briefcase-outline","ios-briefcase","ios-browsers-outline","ios-browsers","ios-brush-outline","ios-brush","ios-bug-outline","ios-bug","ios-build-outline","ios-build","ios-bulb-outline","ios-bulb","ios-bus-outline","ios-bus","ios-cafe-outline","ios-cafe","ios-calculator-outline","ios-calculator","ios-calendar-outline","ios-calendar","ios-call-outline","ios-call","ios-camera-outline","ios-camera","ios-car-outline","ios-car","ios-card-outline","ios-card","ios-cart-outline","ios-cart","ios-cash-outline","ios-cash","ios-chatboxes-outline","ios-chatboxes","ios-chatbubbles-outline","ios-chatbubbles","ios-checkbox-outline","ios-checkbox","ios-checkmark-circle-outline","ios-checkmark-circle","ios-checkmark","ios-clipboard-outline","ios-clipboard","ios-clock-outline","ios-clock","ios-close-circle-outline","ios-close-circle","ios-close","ios-closed-captioning-outline","ios-closed-captioning","ios-cloud-circle-outline","ios-cloud-circle","ios-cloud-done-outline","ios-cloud-done","ios-cloud-download-outline","ios-cloud-download","ios-cloud-outline","ios-cloud-upload-outline","ios-cloud-upload","ios-cloud","ios-cloudy-night-outline","ios-cloudy-night","ios-cloudy-outline","ios-cloudy","ios-code-download","ios-code-working","ios-code","ios-cog-outline","ios-cog","ios-color-fill-outline","ios-color-fill","ios-color-filter-outline","ios-color-filter","ios-color-palette-outline","ios-color-palette","ios-color-wand-outline","ios-color-wand","ios-compass-outline","ios-compass","ios-construct-outline","ios-construct","ios-contact-outline","ios-contact","ios-contacts-outline","ios-contacts","ios-contract","ios-contrast","ios-copy-outline","ios-copy","ios-create-outline","ios-create","ios-crop-outline","ios-crop","ios-cube-outline","ios-cube","ios-cut-outline","ios-cut","ios-desktop-outline","ios-desktop","ios-disc-outline","ios-disc","ios-document-outline","ios-document","ios-done-all","ios-download-outline","ios-download","ios-easel-outline","ios-easel","ios-egg-outline","ios-egg","ios-exit-outline","ios-exit","ios-expand","ios-eye-off-outline","ios-eye-off","ios-eye-outline","ios-eye","ios-fastforward-outline","ios-fastforward","ios-female","ios-filing-outline","ios-filing","ios-film-outline","ios-film","ios-finger-print","ios-flag-outline","ios-flag","ios-flame-outline","ios-flame","ios-flash-outline","ios-flash","ios-flask-outline","ios-flask","ios-flower-outline","ios-flower","ios-folder-open-outline","ios-folder-open","ios-folder-outline","ios-folder","ios-football-outline","ios-football","ios-funnel-outline","ios-funnel","ios-game-controller-a-outline","ios-game-controller-a","ios-game-controller-b-outline","ios-game-controller-b","ios-git-branch","ios-git-commit","ios-git-compare","ios-git-merge","ios-git-network","ios-git-pull-request","ios-glasses-outline","ios-glasses","ios-globe-outline","ios-globe","ios-grid-outline","ios-grid","ios-hammer-outline","ios-hammer","ios-hand-outline","ios-hand","ios-happy-outline","ios-happy","ios-headset-outline","ios-headset","ios-heart-outline","ios-heart","ios-help-buoy-outline","ios-help-buoy","ios-help-circle-outline","ios-help-circle","ios-help","ios-home-outline","ios-home","ios-ice-cream-outline","ios-ice-cream","ios-image-outline","ios-image","ios-images-outline","ios-images","ios-infinite-outline","ios-infinite","ios-information-circle-outline","ios-information-circle","ios-information","ios-ionic-outline","ios-ionic","ios-ionitron-outline","ios-ionitron","ios-jet-outline","ios-jet","ios-key-outline","ios-key","ios-keypad-outline","ios-keypad","ios-laptop","ios-leaf-outline","ios-leaf","ios-link-outline","ios-link","ios-list-box-outline","ios-list-box","ios-list","ios-locate-outline","ios-locate","ios-lock-outline","ios-lock","ios-log-in","ios-log-out","ios-magnet-outline","ios-magnet","ios-mail-open-outline","ios-mail-open","ios-mail-outline","ios-mail","ios-male","ios-man-outline","ios-man","ios-map-outline","ios-map","ios-medal-outline","ios-medal","ios-medical-outline","ios-medical","ios-medkit-outline","ios-medkit","ios-megaphone-outline","ios-megaphone","ios-menu-outline","ios-menu","ios-mic-off-outline","ios-mic-off","ios-mic-outline","ios-mic","ios-microphone-outline","ios-microphone","ios-moon-outline","ios-moon","ios-more-outline","ios-more","ios-move","ios-musical-note-outline","ios-musical-note","ios-musical-notes-outline","ios-musical-notes","ios-navigate-outline","ios-navigate","ios-no-smoking-outline","ios-no-smoking","ios-notifications-off-outline","ios-notifications-off","ios-notifications-outline","ios-notifications","ios-nuclear-outline","ios-nuclear","ios-nutrition-outline","ios-nutrition","ios-open-outline","ios-open","ios-options-outline","ios-options","ios-outlet-outline","ios-outlet","ios-paper-outline","ios-paper-plane-outline","ios-paper-plane","ios-paper","ios-partly-sunny-outline","ios-partly-sunny","ios-pause-outline","ios-pause","ios-paw-outline","ios-paw","ios-people-outline","ios-people","ios-person-add-outline","ios-person-add","ios-person-outline","ios-person","ios-phone-landscape","ios-phone-portrait","ios-photos-outline","ios-photos","ios-pie-outline","ios-pie","ios-pin-outline","ios-pin","ios-pint-outline","ios-pint","ios-pizza-outline","ios-pizza","ios-plane-outline","ios-plane","ios-planet-outline","ios-planet","ios-play-outline","ios-play","ios-podium-outline","ios-podium","ios-power-outline","ios-power","ios-pricetag-outline","ios-pricetag","ios-pricetags-outline","ios-pricetags","ios-print-outline","ios-print","ios-pulse-outline","ios-pulse","ios-qr-scanner","ios-quote-outline","ios-quote","ios-radio-button-off","ios-radio-button-on","ios-radio-outline","ios-radio","ios-rainy-outline","ios-rainy","ios-recording-outline","ios-recording","ios-redo-outline","ios-redo","ios-refresh-circle-outline","ios-refresh-circle","ios-refresh","ios-remove-circle-outline","ios-remove-circle","ios-remove","ios-reorder","ios-repeat","ios-resize","ios-restaurant-outline","ios-restaurant","ios-return-left","ios-return-right","ios-reverse-camera-outline","ios-reverse-camera","ios-rewind-outline","ios-rewind","ios-ribbon-outline","ios-ribbon","ios-rose-outline","ios-rose","ios-sad-outline","ios-sad","ios-school-outline","ios-school","ios-search-outline","ios-search","ios-send-outline","ios-send","ios-settings-outline","ios-settings","ios-share-alt-outline","ios-share-alt","ios-share-outline","ios-share","ios-shirt-outline","ios-shirt","ios-shuffle","ios-skip-backward-outline","ios-skip-backward","ios-skip-forward-outline","ios-skip-forward","ios-snow-outline","ios-snow","ios-speedometer-outline","ios-speedometer","ios-square-outline","ios-square","ios-star-half","ios-star-outline","ios-star","ios-stats-outline","ios-stats","ios-stopwatch-outline","ios-stopwatch","ios-subway-outline","ios-subway","ios-sunny-outline","ios-sunny","ios-swap","ios-switch-outline","ios-switch","ios-sync","ios-tablet-landscape","ios-tablet-portrait","ios-tennisball-outline","ios-tennisball","ios-text-outline","ios-text","ios-thermometer-outline","ios-thermometer","ios-thumbs-down-outline","ios-thumbs-down","ios-thumbs-up-outline","ios-thumbs-up","ios-thunderstorm-outline","ios-thunderstorm","ios-time-outline","ios-time","ios-timer-outline","ios-timer","ios-train-outline","ios-train","ios-transgender","ios-trash-outline","ios-trash","ios-trending-down","ios-trending-up","ios-trophy-outline","ios-trophy","ios-umbrella-outline","ios-umbrella","ios-undo-outline","ios-undo","ios-unlock-outline","ios-unlock","ios-videocam-outline","ios-videocam","ios-volume-down","ios-volume-mute","ios-volume-off","ios-volume-up","ios-walk","ios-warning-outline","ios-warning","ios-watch","ios-water-outline","ios-water","ios-wifi-outline","ios-wifi","ios-wine-outline","ios-wine","ios-woman-outline","ios-woman","logo-android","logo-angular","logo-apple","logo-bitcoin","logo-buffer","logo-chrome","logo-codepen","logo-css3","logo-designernews","logo-dribbble","logo-dropbox","logo-euro","logo-facebook","logo-foursquare","logo-freebsd-devil","logo-github","logo-google","logo-googleplus","logo-hackernews","logo-html5","logo-instagram","logo-javascript","logo-linkedin","logo-markdown","logo-nodejs","logo-octocat","logo-pinterest","logo-playstation","logo-python","logo-reddit","logo-rss","logo-sass","logo-skype","logo-snapchat","logo-steam","logo-tumblr","logo-tux","logo-twitch","logo-twitter","logo-usd","logo-vimeo","logo-whatsapp","logo-windows","logo-wordpress","logo-xbox","logo-yahoo","logo-yen","logo-youtube","md-add-circle","md-add","md-alarm","md-albums","md-alert","md-american-football","md-analytics","md-aperture","md-apps","md-appstore","md-archive","md-arrow-back","md-arrow-down","md-arrow-dropdown-circle","md-arrow-dropdown","md-arrow-dropleft-circle","md-arrow-dropleft","md-arrow-dropright-circle","md-arrow-dropright","md-arrow-dropup-circle","md-arrow-dropup","md-arrow-forward","md-arrow-round-back","md-arrow-round-down","md-arrow-round-forward","md-arrow-round-up","md-arrow-up","md-at","md-attach","md-backspace","md-barcode","md-baseball","md-basket","md-basketball","md-battery-charging","md-battery-dead","md-battery-full","md-beaker","md-beer","md-bicycle","md-bluetooth","md-boat","md-body","md-bonfire","md-book","md-bookmark","md-bookmarks","md-bowtie","md-briefcase","md-browsers","md-brush","md-bug","md-build","md-bulb","md-bus","md-cafe","md-calculator","md-calendar","md-call","md-camera","md-car","md-card","md-cart","md-cash","md-chatboxes","md-chatbubbles","md-checkbox-outline","md-checkbox","md-checkmark-circle-outline","md-checkmark-circle","md-checkmark","md-clipboard","md-clock","md-close-circle","md-close","md-closed-captioning","md-cloud-circle","md-cloud-done","md-cloud-download","md-cloud-outline","md-cloud-upload","md-cloud","md-cloudy-night","md-cloudy","md-code-download","md-code-working","md-code","md-cog","md-color-fill","md-color-filter","md-color-palette","md-color-wand","md-compass","md-construct","md-contact","md-contacts","md-contract","md-contrast","md-copy","md-create","md-crop","md-cube","md-cut","md-desktop","md-disc","md-document","md-done-all","md-download","md-easel","md-egg","md-exit","md-expand","md-eye-off","md-eye","md-fastforward","md-female","md-filing","md-film","md-finger-print","md-flag","md-flame","md-flash","md-flask","md-flower","md-folder-open","md-folder","md-football","md-funnel","md-game-controller-a","md-game-controller-b","md-git-branch","md-git-commit","md-git-compare","md-git-merge","md-git-network","md-git-pull-request","md-glasses","md-globe","md-grid","md-hammer","md-hand","md-happy","md-headset","md-heart-outline","md-heart","md-help-buoy","md-help-circle","md-help","md-home","md-ice-cream","md-image","md-images","md-infinite","md-information-circle","md-information","md-ionic","md-ionitron","md-jet","md-key","md-keypad","md-laptop","md-leaf","md-link","md-list-box","md-list","md-locate","md-lock","md-log-in","md-log-out","md-magnet","md-mail-open","md-mail","md-male","md-man","md-map","md-medal","md-medical","md-medkit","md-megaphone","md-menu","md-mic-off","md-mic","md-microphone","md-moon","md-more","md-move","md-musical-note","md-musical-notes","md-navigate","md-no-smoking","md-notifications-off","md-notifications-outline","md-notifications","md-nuclear","md-nutrition","md-open","md-options","md-outlet","md-paper-plane","md-paper","md-partly-sunny","md-pause","md-paw","md-people","md-person-add","md-person","md-phone-landscape","md-phone-portrait","md-photos","md-pie","md-pin","md-pint","md-pizza","md-plane","md-planet","md-play","md-podium","md-power","md-pricetag","md-pricetags","md-print","md-pulse","md-qr-scanner","md-quote","md-radio-button-off","md-radio-button-on","md-radio","md-rainy","md-recording","md-redo","md-refresh-circle","md-refresh","md-remove-circle","md-remove","md-reorder","md-repeat","md-resize","md-restaurant","md-return-left","md-return-right","md-reverse-camera","md-rewind","md-ribbon","md-rose","md-sad","md-school","md-search","md-send","md-settings","md-share-alt","md-share","md-shirt","md-shuffle","md-skip-backward","md-skip-forward","md-snow","md-speedometer","md-square-outline","md-square","md-star-half","md-star-outline","md-star","md-stats","md-stopwatch","md-subway","md-sunny","md-swap","md-switch","md-sync","md-tablet-landscape","md-tablet-portrait","md-tennisball","md-text","md-thermometer","md-thumbs-down","md-thumbs-up","md-thunderstorm","md-time","md-timer","md-train","md-transgender","md-trash","md-trending-down","md-trending-up","md-trophy","md-umbrella","md-undo","md-unlock","md-videocam","md-volume-down","md-volume-mute","md-volume-off","md-volume-up","md-walk","md-warning","md-watch","md-water","md-wifi","md-wine","md-woman","ios-loading"]
  12 + }
  13 + }
  14 +}
  15 +</script>
... ...
examples/routers/select.vue
1 1 <template>
2   - <div style="margin: 200px;">
3   - <Select size="small" v-model="model10" multiple style="width:260px">
  2 + <div style="margin: 100px;">
  3 + <Select v-model="model1" filterable style="width:200px" prefix="ios-albums">
4 4 <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
5 5 </Select>
6   - <Select v-model="model10" multiple style="width:260px">
  6 +
  7 + <Select v-model="model10" filterable :max-tag-count="2" multiple style="width:400px">
7 8 <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
8 9 </Select>
9   - <Select size="large" v-model="model10" multiple style="width:260px">
  10 +
  11 + <Select v-model="model10" filterable :max-tag-count="2" multiple style="width:400px" prefix="ios-albums">
  12 + <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
  13 + </Select>
  14 +
  15 + <br><br>
  16 +
  17 + <Select v-model="model1" style="width:200px">
  18 + <Icon type="ios-alarm" slot="prefix" color="red" />
  19 + <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
  20 + </Select>
  21 +
  22 + <Select v-model="model1" style="width:200px">
  23 + <Avatar src="https://dev-file.iviewui.com/userinfoPDvn9gKWYihR24SpgC319vXY8qniCqj4/avatar" slot="prefix" size="small" />
  24 + <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
  25 + </Select>
  26 +
  27 + <Select v-model="model10" :max-tag-count="3" :max-tag-placeholder="more" multiple style="width:400px" prefix="ios-albums">
  28 + <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
  29 + </Select>
  30 +
  31 + <br><br>
  32 +
  33 + <Select size="small" v-model="model1" style="width:200px" prefix="ios-albums">
  34 + <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
  35 + </Select>
  36 +
  37 + <Select size="small" v-model="model10" multiple style="width:400px" prefix="ios-albums">
  38 + <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
  39 + </Select>
  40 +
  41 + <br><br>
  42 +
  43 + <Select size="large" v-model="model1" style="width:200px" prefix="ios-albums">
  44 + <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
  45 + </Select>
  46 +
  47 + <Select size="large" v-model="model10" multiple style="width:400px" prefix="ios-albums">
10 48 <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
11 49 </Select>
12 50 </div>
... ... @@ -22,7 +60,7 @@
22 60 },
23 61 {
24 62 value: 'London',
25   - label: 'LondonLondonLondonLondonLondonLondonLondonLondonLondonLondonLondonLondonLondonLondonLondonLondonLondonLondon'
  63 + label: 'London'
26 64 },
27 65 {
28 66 value: 'Sydney',
... ... @@ -41,7 +79,13 @@
41 79 label: 'Canberra'
42 80 }
43 81 ],
44   - model10: ['New York', 'London']
  82 + model1: '',
  83 + model10: []
  84 + }
  85 + },
  86 + methods: {
  87 + more (num) {
  88 + return 'more' + num;
45 89 }
46 90 }
47 91 }
... ...
package-lock.json
1 1 {
2 2 "name": "iview",
3   - "version": "3.2.2",
  3 + "version": "3.3.3",
4 4 "lockfileVersion": 1,
5 5 "requires": true,
6 6 "dependencies": {
... ... @@ -1898,6 +1898,12 @@
1898 1898 }
1899 1899 }
1900 1900 },
  1901 + "builtin-modules": {
  1902 + "version": "1.1.1",
  1903 + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
  1904 + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=",
  1905 + "dev": true
  1906 + },
1901 1907 "builtin-status-codes": {
1902 1908 "version": "3.0.0",
1903 1909 "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz",
... ... @@ -13571,6 +13577,70 @@
13571 13577 "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=",
13572 13578 "dev": true
13573 13579 },
  13580 + "tslib": {
  13581 + "version": "1.9.3",
  13582 + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz",
  13583 + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==",
  13584 + "dev": true
  13585 + },
  13586 + "tslint": {
  13587 + "version": "5.14.0",
  13588 + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.14.0.tgz",
  13589 + "integrity": "sha512-IUla/ieHVnB8Le7LdQFRGlVJid2T/gaJe5VkjzRVSRR6pA2ODYrnfR1hmxi+5+au9l50jBwpbBL34txgv4NnTQ==",
  13590 + "dev": true,
  13591 + "requires": {
  13592 + "babel-code-frame": "6.26.0",
  13593 + "builtin-modules": "1.1.1",
  13594 + "chalk": "2.4.2",
  13595 + "commander": "2.19.0",
  13596 + "diff": "3.5.0",
  13597 + "glob": "7.1.3",
  13598 + "js-yaml": "3.7.0",
  13599 + "minimatch": "3.0.4",
  13600 + "mkdirp": "0.5.1",
  13601 + "resolve": "1.10.0",
  13602 + "semver": "5.6.0",
  13603 + "tslib": "1.9.3",
  13604 + "tsutils": "2.29.0"
  13605 + },
  13606 + "dependencies": {
  13607 + "ansi-styles": {
  13608 + "version": "3.2.1",
  13609 + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
  13610 + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
  13611 + "dev": true,
  13612 + "requires": {
  13613 + "color-convert": "1.9.3"
  13614 + }
  13615 + },
  13616 + "chalk": {
  13617 + "version": "2.4.2",
  13618 + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
  13619 + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
  13620 + "dev": true,
  13621 + "requires": {
  13622 + "ansi-styles": "3.2.1",
  13623 + "escape-string-regexp": "1.0.5",
  13624 + "supports-color": "5.5.0"
  13625 + }
  13626 + },
  13627 + "has-flag": {
  13628 + "version": "3.0.0",
  13629 + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
  13630 + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
  13631 + "dev": true
  13632 + },
  13633 + "supports-color": {
  13634 + "version": "5.5.0",
  13635 + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
  13636 + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
  13637 + "dev": true,
  13638 + "requires": {
  13639 + "has-flag": "3.0.0"
  13640 + }
  13641 + }
  13642 + }
  13643 + },
13574 13644 "tsscmp": {
13575 13645 "version": "1.0.6",
13576 13646 "resolved": "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz",
... ... @@ -13578,6 +13648,15 @@
13578 13648 "dev": true,
13579 13649 "optional": true
13580 13650 },
  13651 + "tsutils": {
  13652 + "version": "2.29.0",
  13653 + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz",
  13654 + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==",
  13655 + "dev": true,
  13656 + "requires": {
  13657 + "tslib": "1.9.3"
  13658 + }
  13659 + },
13581 13660 "tty-browserify": {
13582 13661 "version": "0.0.0",
13583 13662 "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz",
... ... @@ -13631,6 +13710,12 @@
13631 13710 "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
13632 13711 "dev": true
13633 13712 },
  13713 + "typescript": {
  13714 + "version": "3.3.4000",
  13715 + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz",
  13716 + "integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==",
  13717 + "dev": true
  13718 + },
13634 13719 "uglify-js": {
13635 13720 "version": "2.8.29",
13636 13721 "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz",
... ... @@ -14276,9 +14361,9 @@
14276 14361 "dev": true
14277 14362 },
14278 14363 "vue": {
14279   - "version": "2.6.6",
14280   - "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.6.tgz",
14281   - "integrity": "sha512-Y2DdOZD8sxApS+iUlwv1v8U1qN41kq6Kw45lM6nVZKhygeWA49q7VCCXkjXqeDBXgurrKWkYQ9cJeEJwAq0b9Q==",
  14364 + "version": "2.6.10",
  14365 + "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.10.tgz",
  14366 + "integrity": "sha512-ImThpeNU9HbdZL3utgMCq0oiMzAkt1mcgy3/E6zWC/G6AaQoeuFdsl9nDhTDU3X1R6FK7nsIUuRACVcjI+A2GQ==",
14282 14367 "dev": true
14283 14368 },
14284 14369 "vue-hot-reload-api": {
... ... @@ -14578,9 +14663,9 @@
14578 14663 }
14579 14664 },
14580 14665 "vue-template-compiler": {
14581   - "version": "2.6.6",
14582   - "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.6.6.tgz",
14583   - "integrity": "sha512-OakxDGyrmMQViCjkakQFbDZlG0NibiOzpLauOfyCUVRQc9yPmTqpiz9nF0VeA+dFkXegetw0E5x65BFhhLXO0A==",
  14666 + "version": "2.6.10",
  14667 + "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.6.10.tgz",
  14668 + "integrity": "sha512-jVZkw4/I/HT5ZMvRnhv78okGusqe0+qH2A0Em0Cp8aq78+NK9TII263CDVz2QXZsIT+yyV/gZc/j/vlwa+Epyg==",
14584 14669 "dev": true,
14585 14670 "requires": {
14586 14671 "de-indent": "1.0.2",
... ...
package.json
1 1 {
2 2 "name": "iview",
3   - "version": "3.3.3",
  3 + "version": "3.4.0-rc.2",
4 4 "title": "iView",
5 5 "description": "A high quality UI components Library with Vue.js",
6 6 "homepage": "http://www.iviewui.com",
... ... @@ -29,8 +29,9 @@
29 29 "dist:locale": "webpack --config build/webpack.dist.locale.config.js",
30 30 "dist": "npm run dist:style && npm run dist:dev && npm run dist:prod && npm run dist:locale",
31 31 "lint": "eslint --fix --ext .js,.vue src",
  32 + "tslint": "tslint --type-check --fix --project .",
32 33 "unit": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run",
33   - "test": "npm run lint && npm run unit",
  34 + "test": "npm run lint && npm run tslint && npm run unit",
34 35 "prepare": "npm run dist"
35 36 },
36 37 "repository": {
... ... @@ -103,15 +104,17 @@
103 104 "sinon": "^4.4.2",
104 105 "sinon-chai": "^3.3.0",
105 106 "style-loader": "^0.20.2",
  107 + "tslint": "^5.14.0",
  108 + "typescript": "^3.3.4000",
106 109 "uglifyjs-webpack-plugin": "^1.3.0",
107 110 "url-loader": "^1.1.2",
108   - "vue": "^2.5.17",
  111 + "vue": "^2.6.10",
109 112 "vue-hot-reload-api": "^2.3.1",
110 113 "vue-html-loader": "^1.2.4",
111 114 "vue-loader": "^14.2.1",
112 115 "vue-router": "^3.0.2",
113 116 "vue-style-loader": "^4.1.2",
114   - "vue-template-compiler": "^2.5.17",
  117 + "vue-template-compiler": "^2.6.10",
115 118 "webpack": "^3.11.0",
116 119 "webpack-dev-server": "^2.11.3",
117 120 "webpack-merge": "^3.0.0"
... ...
src/components/base/collapse-transition.js
... ... @@ -67,9 +67,15 @@ const Transition = {
67 67 export default {
68 68 name: 'CollapseTransition',
69 69 functional: true,
70   - render(h, { children }) {
  70 + props: {
  71 + appear: Boolean
  72 + },
  73 + render(h, { children, props }) {
71 74 const data = {
72   - on: Transition
  75 + on: Transition,
  76 + props: {
  77 + appear: props.appear
  78 + }
73 79 };
74 80  
75 81 return h('transition', data, children);
... ...
src/components/base/notification/notice.vue
1 1 <template>
2   - <transition :name="transitionName" @enter="handleEnter" @leave="handleLeave">
  2 + <transition :name="transitionName" @enter="handleEnter" @leave="handleLeave" appear>
3 3 <div :class="classes" :style="styles">
4 4 <template v-if="type === 'notice'">
5 5 <div :class="contentClasses" ref="content" v-html="content"></div>
... ...
src/components/cascader/cascader.vue
... ... @@ -17,7 +17,7 @@
17 17 v-show="filterable && query === ''"
18 18 @click="handleFocus">{{ displayRender }}</div>
19 19 <Icon type="ios-close-circle" :class="[prefixCls + '-arrow']" v-show="showCloseIcon" @click.native.stop="clearSelect"></Icon>
20   - <Icon type="ios-arrow-down" :class="[prefixCls + '-arrow']"></Icon>
  20 + <Icon :type="arrowType" :custom="customArrowType" :size="arrowSize" :class="[prefixCls + '-arrow']"></Icon>
21 21 </slot>
22 22 </div>
23 23 <transition name="transition-drop">
... ... @@ -47,7 +47,7 @@
47 47 @click="handleSelectItem(index)" v-html="item.display"></li>
48 48 </ul>
49 49 </div>
50   - <ul v-show="filterable && query !== '' && !querySelections.length" :class="[prefixCls + '-not-found-tip']"><li>{{ localeNotFoundText }}</li></ul>
  50 + <ul v-show="(filterable && query !== '' && !querySelections.length) || !data.length" :class="[prefixCls + '-not-found-tip']"><li>{{ localeNotFoundText }}</li></ul>
51 51 </div>
52 52 </Drop>
53 53 </transition>
... ... @@ -232,6 +232,41 @@
232 232 return item;
233 233 });
234 234 return selections;
  235 + },
  236 + // 3.4.0, global setting customArrow 有值时,arrow 赋值空
  237 + arrowType () {
  238 + let type = 'ios-arrow-down';
  239 +
  240 + if (this.$IVIEW) {
  241 + if (this.$IVIEW.cascader.customArrow) {
  242 + type = '';
  243 + } else if (this.$IVIEW.cascader.arrow) {
  244 + type = this.$IVIEW.cascader.arrow;
  245 + }
  246 + }
  247 + return type;
  248 + },
  249 + // 3.4.0, global setting
  250 + customArrowType () {
  251 + let type = '';
  252 +
  253 + if (this.$IVIEW) {
  254 + if (this.$IVIEW.cascader.customArrow) {
  255 + type = this.$IVIEW.cascader.customArrow;
  256 + }
  257 + }
  258 + return type;
  259 + },
  260 + // 3.4.0, global setting
  261 + arrowSize () {
  262 + let size = '';
  263 +
  264 + if (this.$IVIEW) {
  265 + if (this.$IVIEW.cascader.arrowSize) {
  266 + size = this.$IVIEW.cascader.arrowSize;
  267 + }
  268 + }
  269 + return size;
235 270 }
236 271 },
237 272 methods: {
... ...
src/components/cascader/casitem.vue
1 1 <template>
2 2 <li :class="classes">
3 3 {{ data.label }}
4   - <i v-if="showArrow" class="ivu-icon ivu-icon-ios-arrow-forward"></i>
  4 + <Icon :type="arrowType" :custom="customArrowType" :size="arrowSize" v-if="showArrow" />
5 5 <i v-if="showLoading" class="ivu-icon ivu-icon-ios-loading ivu-load-loop"></i>
6 6 </li>
7 7 </template>
8 8 <script>
  9 + import Icon from '../icon/icon.vue';
  10 +
9 11 export default {
10 12 name: 'Casitem',
  13 + components: { Icon },
11 14 props: {
12 15 data: Object,
13 16 prefixCls: String,
... ... @@ -28,6 +31,41 @@
28 31 },
29 32 showLoading () {
30 33 return 'loading' in this.data && this.data.loading;
  34 + },
  35 + // 3.4.0, global setting customArrow 有值时,arrow 赋值空
  36 + arrowType () {
  37 + let type = 'ios-arrow-forward';
  38 +
  39 + if (this.$IVIEW) {
  40 + if (this.$IVIEW.cascader.customItemArrow) {
  41 + type = '';
  42 + } else if (this.$IVIEW.cascader.itemArrow) {
  43 + type = this.$IVIEW.cascader.itemArrow;
  44 + }
  45 + }
  46 + return type;
  47 + },
  48 + // 3.4.0, global setting
  49 + customArrowType () {
  50 + let type = '';
  51 +
  52 + if (this.$IVIEW) {
  53 + if (this.$IVIEW.cascader.customItemArrow) {
  54 + type = this.$IVIEW.cascader.customItemArrow;
  55 + }
  56 + }
  57 + return type;
  58 + },
  59 + // 3.4.0, global setting
  60 + arrowSize () {
  61 + let size = '';
  62 +
  63 + if (this.$IVIEW) {
  64 + if (this.$IVIEW.cascader.itemArrowSize) {
  65 + size = this.$IVIEW.cascader.itemArrowSize;
  66 + }
  67 + }
  68 + return size;
31 69 }
32 70 }
33 71 };
... ...
src/components/cell/cell.vue
... ... @@ -25,7 +25,7 @@
25 25 </div>
26 26 <div class="ivu-cell-arrow" v-if="to">
27 27 <slot name="arrow">
28   - <Icon type="ios-arrow-forward"></Icon>
  28 + <Icon :type="arrowType" :custom="customArrowType" :size="arrowSize" />
29 29 </slot>
30 30 </div>
31 31 </div>
... ... @@ -83,6 +83,41 @@
83 83 }
84 84 ];
85 85 },
  86 + // 3.4.0, global setting customArrow 有值时,arrow 赋值空
  87 + arrowType () {
  88 + let type = 'ios-arrow-forward';
  89 +
  90 + if (this.$IVIEW) {
  91 + if (this.$IVIEW.cell.customArrow) {
  92 + type = '';
  93 + } else if (this.$IVIEW.cell.arrow) {
  94 + type = this.$IVIEW.cell.arrow;
  95 + }
  96 + }
  97 + return type;
  98 + },
  99 + // 3.4.0, global setting
  100 + customArrowType () {
  101 + let type = '';
  102 +
  103 + if (this.$IVIEW) {
  104 + if (this.$IVIEW.cell.customArrow) {
  105 + type = this.$IVIEW.cell.customArrow;
  106 + }
  107 + }
  108 + return type;
  109 + },
  110 + // 3.4.0, global setting
  111 + arrowSize () {
  112 + let size = '';
  113 +
  114 + if (this.$IVIEW) {
  115 + if (this.$IVIEW.cell.arrowSize) {
  116 + size = this.$IVIEW.cell.arrowSize;
  117 + }
  118 + }
  119 + return size;
  120 + }
86 121 },
87 122 methods: {
88 123 handleClickItem (event, new_window) {
... ...
src/components/collapse/panel.vue
... ... @@ -4,7 +4,7 @@
4 4 <Icon type="ios-arrow-forward" v-if="!hideArrow"></Icon>
5 5 <slot></slot>
6 6 </div>
7   - <collapse-transition>
  7 + <collapse-transition v-if="mounted">
8 8 <div :class="contentClasses" v-show="isActive">
9 9 <div :class="boxClasses"><slot name="content"></slot></div>
10 10 </div>
... ... @@ -31,7 +31,8 @@
31 31 data () {
32 32 return {
33 33 index: 0, // use index for default when name is null
34   - isActive: false
  34 + isActive: false,
  35 + mounted: false
35 36 };
36 37 },
37 38 computed: {
... ... @@ -60,6 +61,9 @@
60 61 isActive: this.isActive
61 62 });
62 63 }
  64 + },
  65 + mounted () {
  66 + this.mounted = true;
63 67 }
64 68 };
65 69 </script>
... ...
src/components/color-picker/color-picker.vue
... ... @@ -10,7 +10,7 @@
10 10 :name="name"
11 11 :value="currentValue"
12 12 type="hidden">
13   - <i :class="arrowClasses"></i>
  13 + <Icon :type="arrowType" :custom="customArrowType" :size="arrowSize" :class="arrowClasses"></Icon>
14 14 <div
15 15 ref="input"
16 16 :tabindex="disabled ? undefined : 0"
... ... @@ -125,6 +125,7 @@ import Hue from &#39;./hue.vue&#39;;
125 125 import Alpha from './alpha.vue';
126 126 import iInput from '../input/input.vue';
127 127 import iButton from '../button/button.vue';
  128 +import Icon from '../icon/icon.vue';
128 129 import Locale from '../../mixins/locale';
129 130 import {oneOf} from '../../utils/assist';
130 131 import Emitter from '../../mixins/emitter';
... ... @@ -134,7 +135,7 @@ import {changeColor, toRGBAString} from &#39;./utils&#39;;
134 135 export default {
135 136 name: 'ColorPicker',
136 137  
137   - components: {Drop, RecommendColors, Saturation, Hue, Alpha, iInput, iButton},
  138 + components: {Drop, RecommendColors, Saturation, Hue, Alpha, iInput, iButton, Icon},
138 139  
139 140 directives: {clickOutside, TransferDom},
140 141  
... ... @@ -260,8 +261,6 @@ export default {
260 261 computed: {
261 262 arrowClasses() {
262 263 return [
263   - this.iconPrefixCls,
264   - `${this.iconPrefixCls}-ios-arrow-down`,
265 264 `${this.inputPrefixCls}-icon`,
266 265 `${this.inputPrefixCls}-icon-normal`,
267 266 ];
... ... @@ -352,6 +351,41 @@ export default {
352 351 [`${this.prefixCls}-confirm-color-editable`]: this.editable
353 352 }
354 353 ];
  354 + },
  355 + // 3.4.0, global setting customArrow 有值时,arrow 赋值空
  356 + arrowType () {
  357 + let type = 'ios-arrow-down';
  358 +
  359 + if (this.$IVIEW) {
  360 + if (this.$IVIEW.colorPicker.customArrow) {
  361 + type = '';
  362 + } else if (this.$IVIEW.colorPicker.arrow) {
  363 + type = this.$IVIEW.colorPicker.arrow;
  364 + }
  365 + }
  366 + return type;
  367 + },
  368 + // 3.4.0, global setting
  369 + customArrowType () {
  370 + let type = '';
  371 +
  372 + if (this.$IVIEW) {
  373 + if (this.$IVIEW.colorPicker.customArrow) {
  374 + type = this.$IVIEW.colorPicker.customArrow;
  375 + }
  376 + }
  377 + return type;
  378 + },
  379 + // 3.4.0, global setting
  380 + arrowSize () {
  381 + let size = '';
  382 +
  383 + if (this.$IVIEW) {
  384 + if (this.$IVIEW.colorPicker.arrowSize) {
  385 + size = this.$IVIEW.colorPicker.arrowSize;
  386 + }
  387 + }
  388 + return size;
355 389 }
356 390 },
357 391  
... ...
src/components/date-picker/picker.vue
... ... @@ -2,6 +2,7 @@
2 2 <div
3 3 :class="wrapperClasses"
4 4 v-click-outside:mousedown.capture="handleClose"
  5 + v-click-outside:touchstart.capture="handleClose"
5 6 v-click-outside.capture="handleClose"
6 7 >
7 8 <div ref="reference" :class="[prefixCls + '-rel']">
... ... @@ -21,14 +22,13 @@
21 22 @on-input-change="handleInputChange"
22 23 @on-focus="handleFocus"
23 24 @on-blur="handleBlur"
24   - @on-click="handleIconClick"
25 25 @click.native="handleFocus"
26 26 @keydown.native="handleKeydown"
27 27 @mouseenter.native="handleInputMouseenter"
28 28 @mouseleave.native="handleInputMouseleave"
29   -
30   - :icon="iconType"
31   - ></i-input>
  29 + >
  30 + <Icon @click="handleIconClick" :type="arrowType" :custom="customArrowType" :size="arrowSize" slot="suffix" />
  31 + </i-input>
32 32 </slot>
33 33 </div>
34 34 <transition name="transition-drop">
... ... @@ -79,6 +79,7 @@
79 79  
80 80 import iInput from '../../components/input/input.vue';
81 81 import Drop from '../../components/select/dropdown.vue';
  82 + import Icon from '../../components/icon/icon.vue';
82 83 import {directive as clickOutside} from 'v-click-outside-x';
83 84 import TransferDom from '../../directives/transfer-dom';
84 85 import { oneOf } from '../../utils/assist';
... ... @@ -120,7 +121,7 @@
120 121  
121 122 export default {
122 123 mixins: [ Emitter ],
123   - components: { iInput, Drop },
  124 + components: { iInput, Drop, Icon },
124 125 directives: { clickOutside, TransferDom },
125 126 props: {
126 127 format: {
... ... @@ -267,12 +268,6 @@
267 268 opened () {
268 269 return this.open === null ? this.visible : this.open;
269 270 },
270   - iconType () {
271   - let icon = 'ios-calendar-outline';
272   - if (this.type === 'time' || this.type === 'timerange') icon = 'ios-time-outline';
273   - if (this.showClose) icon = 'ios-close-circle';
274   - return icon;
275   - },
276 271 transition () {
277 272 const bottomPlaced = this.placement.match(/^bottom/);
278 273 return bottomPlaced ? 'slide-up' : 'slide-down';
... ... @@ -282,6 +277,80 @@
282 277 },
283 278 isConfirm(){
284 279 return this.confirm || this.type === 'datetime' || this.type === 'datetimerange' || this.multiple;
  280 + },
  281 + // 3.4.0, global setting customArrow 有值时,arrow 赋值空
  282 + arrowType () {
  283 + let type = '';
  284 +
  285 + if (this.type === 'time' || this.type === 'timerange') {
  286 + type = 'ios-time-outline';
  287 +
  288 + if (this.$IVIEW) {
  289 + if (this.$IVIEW.timePicker.customIcon) {
  290 + type = '';
  291 + } else if (this.$IVIEW.timePicker.icon) {
  292 + type = this.$IVIEW.timePicker.icon;
  293 + }
  294 + }
  295 + } else {
  296 + type = 'ios-calendar-outline';
  297 +
  298 + if (this.$IVIEW) {
  299 + if (this.$IVIEW.datePicker.customIcon) {
  300 + type = '';
  301 + } else if (this.$IVIEW.datePicker.icon) {
  302 + type = this.$IVIEW.datePicker.icon;
  303 + }
  304 + }
  305 + }
  306 +
  307 + if (this.showClose) type = 'ios-close-circle';
  308 +
  309 + return type;
  310 + },
  311 + // 3.4.0, global setting
  312 + customArrowType () {
  313 + let type = '';
  314 +
  315 + if (!this.showClose) {
  316 + if (this.type === 'time' || this.type === 'timerange') {
  317 + if (this.$IVIEW) {
  318 + if (this.$IVIEW.timePicker.customIcon) {
  319 + type = this.$IVIEW.timePicker.customIcon;
  320 + }
  321 + }
  322 + } else {
  323 + if (this.$IVIEW) {
  324 + if (this.$IVIEW.datePicker.customIcon) {
  325 + type = this.$IVIEW.datePicker.customIcon;
  326 + }
  327 + }
  328 + }
  329 + }
  330 +
  331 + return type;
  332 + },
  333 + // 3.4.0, global setting
  334 + arrowSize () {
  335 + let size = '';
  336 +
  337 + if (!this.showClose) {
  338 + if (this.type === 'time' || this.type === 'timerange') {
  339 + if (this.$IVIEW) {
  340 + if (this.$IVIEW.timePicker.iconSize) {
  341 + size = this.$IVIEW.timePicker.iconSize;
  342 + }
  343 + }
  344 + } else {
  345 + if (this.$IVIEW) {
  346 + if (this.$IVIEW.datePicker.iconSize) {
  347 + size = this.$IVIEW.datePicker.iconSize;
  348 + }
  349 + }
  350 + }
  351 + }
  352 +
  353 + return size;
285 354 }
286 355 },
287 356 methods: {
... ... @@ -313,6 +382,7 @@
313 382 this.visible = false;
314 383 e && e.preventDefault();
315 384 e && e.stopPropagation();
  385 + this.$emit('on-clickoutside', e);
316 386 return;
317 387 }
318 388  
... ...
src/components/drawer/drawer.vue
... ... @@ -303,6 +303,9 @@
303 303 if (this.$slots.header === undefined) {
304 304 this.showHead = !!val;
305 305 }
  306 + },
  307 + width (val) {
  308 + this.dragWidth = val;
306 309 }
307 310 }
308 311 };
... ...
src/components/dropdown/dropdown.vue
... ... @@ -57,6 +57,10 @@
57 57 transferClassName: {
58 58 type: String
59 59 },
  60 + stopPropagation: {
  61 + type: Boolean,
  62 + default: false
  63 + },
60 64 },
61 65 computed: {
62 66 transition () {
... ... @@ -164,6 +168,7 @@
164 168 },
165 169 mounted () {
166 170 this.$on('on-click', (key) => {
  171 + if (this.stopPropagation) return;
167 172 const $parent = this.hasParent();
168 173 if ($parent) $parent.$emit('on-click', key);
169 174 });
... ...
src/components/input-number/input-number.vue
... ... @@ -292,6 +292,7 @@
292 292 }
293 293 },
294 294 change (event) {
  295 + if (event.type == 'change') return;
295 296  
296 297 if (event.type == 'input' && !this.activeChange) return;
297 298 let val = event.target.value.trim();
... ...
src/components/input/input.vue
... ... @@ -312,6 +312,7 @@
312 312 this.$emit('input', '');
313 313 this.setCurrentValue('');
314 314 this.$emit('on-change', e);
  315 + this.$emit('on-clear');
315 316 },
316 317 handleSearch () {
317 318 if (this.disabled) return false;
... ...
src/components/loading-bar/index.js
... ... @@ -2,6 +2,7 @@ import LoadingBar from &#39;./loading-bar&#39;;
2 2  
3 3 let loadingBarInstance;
4 4 let color = 'primary';
  5 +let duration = 800;
5 6 let failedColor = 'error';
6 7 let height = 2;
7 8 let timer;
... ... @@ -32,7 +33,7 @@ function hide() {
32 33 percent: 0
33 34 });
34 35 }, 200);
35   - }, 800);
  36 + }, duration);
36 37 }
37 38  
38 39 function clearTimer() {
... ... @@ -96,6 +97,9 @@ export default {
96 97 if (options.color) {
97 98 color = options.color;
98 99 }
  100 + if (options.duration) {
  101 + duration = options.duration;
  102 + }
99 103 if (options.failedColor) {
100 104 failedColor = options.failedColor;
101 105 }
... ...
src/components/menu/menu.vue
... ... @@ -133,9 +133,9 @@
133 133 }
134 134 },
135 135 mounted () {
136   - this.updateActiveName();
137 136 this.openedNames = [...this.openNames];
138 137 this.updateOpened();
  138 + this.$nextTick(() => this.updateActiveName());
139 139 this.$on('on-menu-item-select', (name) => {
140 140 this.currentActiveName = name;
141 141 this.$emit('on-select', name);
... ...
src/components/menu/submenu.vue
... ... @@ -2,7 +2,7 @@
2 2 <li :class="classes" @mouseenter="handleMouseenter" @mouseleave="handleMouseleave">
3 3 <div :class="[prefixCls + '-submenu-title']" ref="reference" @click.stop="handleClick" :style="titleStyle">
4 4 <slot name="title"></slot>
5   - <Icon type="ios-arrow-down" :class="[prefixCls + '-submenu-title-icon']"></Icon>
  5 + <Icon :type="arrowType" :custom="customArrowType" :size="arrowSize" :class="[prefixCls + '-submenu-title-icon']" />
6 6 </div>
7 7 <collapse-transition v-if="mode === 'vertical'">
8 8 <ul :class="[prefixCls]" v-show="opened"><slot></slot></ul>
... ... @@ -75,6 +75,41 @@
75 75 return this.hasParentSubmenu && this.mode !== 'horizontal' ? {
76 76 paddingLeft: 43 + (this.parentSubmenuNum - 1) * 24 + 'px'
77 77 } : {};
  78 + },
  79 + // 3.4.0, global setting customArrow 有值时,arrow 赋值空
  80 + arrowType () {
  81 + let type = 'ios-arrow-down';
  82 +
  83 + if (this.$IVIEW) {
  84 + if (this.$IVIEW.menu.customArrow) {
  85 + type = '';
  86 + } else if (this.$IVIEW.menu.arrow) {
  87 + type = this.$IVIEW.menu.arrow;
  88 + }
  89 + }
  90 + return type;
  91 + },
  92 + // 3.4.0, global setting
  93 + customArrowType () {
  94 + let type = '';
  95 +
  96 + if (this.$IVIEW) {
  97 + if (this.$IVIEW.menu.customArrow) {
  98 + type = this.$IVIEW.menu.customArrow;
  99 + }
  100 + }
  101 + return type;
  102 + },
  103 + // 3.4.0, global setting
  104 + arrowSize () {
  105 + let size = '';
  106 +
  107 + if (this.$IVIEW) {
  108 + if (this.$IVIEW.menu.arrowSize) {
  109 + size = this.$IVIEW.menu.arrowSize;
  110 + }
  111 + }
  112 + return size;
78 113 }
79 114 },
80 115 methods: {
... ...
src/components/modal/confirm.js
... ... @@ -109,7 +109,8 @@ Modal.newInstance = properties =&gt; {
109 109 on: {
110 110 input: (status) => {
111 111 this.visible = status;
112   - }
  112 + },
  113 + 'on-cancel': this.cancel
113 114 }
114 115 }, [
115 116 h('div', {
... ...
src/components/modal/modal.vue
... ... @@ -60,7 +60,9 @@
60 60 },
61 61 maskClosable: {
62 62 type: Boolean,
63   - default: true
  63 + default () {
  64 + return !this.$IVIEW || this.$IVIEW.modal.maskClosable === '' ? true : this.$IVIEW.modal.maskClosable;
  65 + }
64 66 },
65 67 title: {
66 68 type: String
... ...
src/components/poptip/poptip.vue
... ... @@ -111,6 +111,11 @@
111 111 // default by css: 8px 16px
112 112 padding: {
113 113 type: String
  114 + },
  115 + // 3.4.0
  116 + disabled: {
  117 + type: Boolean,
  118 + default: false
114 119 }
115 120 },
116 121 data () {
... ... @@ -181,6 +186,8 @@
181 186 },
182 187 methods: {
183 188 handleClick () {
  189 + if (this.disabled) return;
  190 +
184 191 if (this.confirm) {
185 192 this.visible = !this.visible;
186 193 return true;
... ... @@ -208,6 +215,8 @@
208 215 this.visible = false;
209 216 },
210 217 handleFocus (fromInput = true) {
  218 + if (this.disabled) return;
  219 +
211 220 if (this.trigger !== 'focus' || this.confirm || (this.isInput && !fromInput)) {
212 221 return false;
213 222 }
... ... @@ -220,6 +229,8 @@
220 229 this.visible = false;
221 230 },
222 231 handleMouseenter () {
  232 + if (this.disabled) return;
  233 +
223 234 if (this.trigger !== 'hover' || this.confirm) {
224 235 return false;
225 236 }
... ...
src/components/select/select-head.vue
1 1 <template>
2   - <div @click="onHeaderClick">
3   - <div class="ivu-tag ivu-tag-checked" v-for="item in selectedMultiple">
  2 + <div @click="onHeaderClick" :class="headCls">
  3 + <span :class="[prefixCls + '-prefix']" v-if="$slots.prefix || prefix">
  4 + <slot name="prefix">
  5 + <Icon :type="prefix" v-if="prefix" />
  6 + </slot>
  7 + </span>
  8 + <div
  9 + class="ivu-tag ivu-tag-checked"
  10 + v-for="(item, index) in selectedMultiple"
  11 + v-if="maxTagCount === undefined || index < maxTagCount">
4 12 <span class="ivu-tag-text">{{ item.label }}</span>
5 13 <Icon type="ios-close" @click.native.stop="removeTag(item)"></Icon>
  14 + </div><div class="ivu-tag ivu-tag-checked" v-if="maxTagCount !== undefined && selectedMultiple.length > maxTagCount">
  15 + <span class="ivu-tag-text ivu-select-max-tag">
  16 + <template v-if="maxTagPlaceholder">{{ maxTagPlaceholder(selectedMultiple.length - maxTagCount) }}</template>
  17 + <template v-else>+ {{ selectedMultiple.length - maxTagCount }}...</template>
  18 + </span>
6 19 </div>
7 20 <span
8 21 :class="singleDisplayClasses"
... ... @@ -26,7 +39,7 @@
26 39  
27 40 ref="input">
28 41 <Icon type="ios-close-circle" :class="[prefixCls + '-arrow']" v-if="resetSelect" @click.native.stop="onClear"></Icon>
29   - <Icon type="ios-arrow-down" :class="[prefixCls + '-arrow']" v-if="!resetSelect && !remote && !disabled"></Icon>
  42 + <Icon :type="arrowType" :custom="customArrowType" :size="arrowSize" :class="[prefixCls + '-arrow']" v-if="!resetSelect && !remote"></Icon>
30 43 </div>
31 44 </template>
32 45 <script>
... ... @@ -77,6 +90,17 @@
77 90 queryProp: {
78 91 type: String,
79 92 default: ''
  93 + },
  94 + prefix: {
  95 + type: String
  96 + },
  97 + // 3.4.0
  98 + maxTagCount: {
  99 + type: Number
  100 + },
  101 + // 3.4.0
  102 + maxTagPlaceholder: {
  103 + type: Function
80 104 }
81 105 },
82 106 data () {
... ... @@ -92,6 +116,7 @@
92 116 singleDisplayClasses(){
93 117 const {filterable, multiple, showPlaceholder} = this;
94 118 return [{
  119 + [prefixCls + '-head-with-prefix']: this.$slots.prefix || this.prefix,
95 120 [prefixCls + '-placeholder']: showPlaceholder && !filterable,
96 121 [prefixCls + '-selected-value']: !showPlaceholder && !multiple && !filterable,
97 122 }];
... ... @@ -143,6 +168,47 @@
143 168 },
144 169 selectedMultiple(){
145 170 return this.multiple ? this.values : [];
  171 + },
  172 + // 使用 prefix 时,在 filterable
  173 + headCls () {
  174 + return {
  175 + [`${prefixCls}-head-flex`]: this.filterable && (this.$slots.prefix || this.prefix)
  176 + };
  177 + },
  178 + // 3.4.0, global setting customArrow 有值时,arrow 赋值空
  179 + arrowType () {
  180 + let type = 'ios-arrow-down';
  181 +
  182 + if (this.$IVIEW) {
  183 + if (this.$IVIEW.select.customArrow) {
  184 + type = '';
  185 + } else if (this.$IVIEW.select.arrow) {
  186 + type = this.$IVIEW.select.arrow;
  187 + }
  188 + }
  189 + return type;
  190 + },
  191 + // 3.4.0, global setting
  192 + customArrowType () {
  193 + let type = '';
  194 +
  195 + if (this.$IVIEW) {
  196 + if (this.$IVIEW.select.customArrow) {
  197 + type = this.$IVIEW.select.customArrow;
  198 + }
  199 + }
  200 + return type;
  201 + },
  202 + // 3.4.0, global setting
  203 + arrowSize () {
  204 + let size = '';
  205 +
  206 + if (this.$IVIEW) {
  207 + if (this.$IVIEW.select.arrowSize) {
  208 + size = this.$IVIEW.select.arrowSize;
  209 + }
  210 + }
  211 + return size;
146 212 }
147 213 },
148 214 methods: {
... ...
src/components/select/select.vue
... ... @@ -3,6 +3,7 @@
3 3 :class="classes"
4 4 v-click-outside.capture="onClickOutside"
5 5 v-click-outside:mousedown.capture="onClickOutside"
  6 + v-click-outside:touchstart.capture="onClickOutside"
6 7 >
7 8 <div
8 9 ref="reference"
... ... @@ -33,18 +34,23 @@
33 34 :multiple="multiple"
34 35 :values="values"
35 36 :clearable="canBeCleared"
  37 + :prefix="prefix"
36 38 :disabled="disabled"
37 39 :remote="remote"
38 40 :input-element-id="elementId"
39 41 :initial-label="initialLabel"
40 42 :placeholder="placeholder"
41 43 :query-prop="query"
  44 + :max-tag-count="maxTagCount"
  45 + :max-tag-placeholder="maxTagPlaceholder"
42 46  
43 47 @on-query-change="onQueryChange"
44 48 @on-input-focus="isFocused = true"
45 49 @on-input-blur="isFocused = false"
46 50 @on-clear="clearSingleSelect"
47   - />
  51 + >
  52 + <slot name="prefix" slot="prefix"></slot>
  53 + </select-head>
48 54 </slot>
49 55 </div>
50 56 <transition name="transition-drop">
... ... @@ -235,6 +241,18 @@
235 241 transferClassName: {
236 242 type: String
237 243 },
  244 + // 3.4.0
  245 + prefix: {
  246 + type: String
  247 + },
  248 + // 3.4.0
  249 + maxTagCount: {
  250 + type: Number
  251 + },
  252 + // 3.4.0
  253 + maxTagPlaceholder: {
  254 + type: Function
  255 + }
238 256 },
239 257 mounted(){
240 258 this.$on('on-select-selected', this.onOptionClick);
... ...
src/components/slider/slider.vue
... ... @@ -8,6 +8,7 @@
8 8 :step="step"
9 9 :value="exportValue[0]"
10 10 :disabled="disabled"
  11 + :active-change="activeChange"
11 12 @on-change="handleInputChange"></Input-number>
12 13 <div
13 14 :class="[prefixCls + '-wrap']"
... ... @@ -148,6 +149,11 @@
148 149 },
149 150 name: {
150 151 type: String
  152 + },
  153 + // 3.4.0
  154 + activeChange: {
  155 + type: Boolean,
  156 + default: true
151 157 }
152 158 },
153 159 data () {
... ...
src/components/table/table-body.vue
... ... @@ -8,7 +8,7 @@
8 8 <table-tr
9 9 :draggable="draggable"
10 10 :row="row"
11   - :key="row._rowKey"
  11 + :key="rowKey ? row._rowKey : index"
12 12 :prefix-cls="prefixCls"
13 13 @mouseenter.native.stop="handleMouseIn(row._index)"
14 14 @mouseleave.native.stop="handleMouseOut(row._index)"
... ... @@ -31,7 +31,7 @@
31 31 </table-tr>
32 32 <tr v-if="rowExpanded(row._index)" :class="{[prefixCls + '-expanded-hidden']: fixed}">
33 33 <td :colspan="columns.length" :class="prefixCls + '-expanded-cell'">
34   - <Expand :key="row._rowKey" :row="row" :render="expandRender" :index="row._index"></Expand>
  34 + <Expand :key="rowKey ? row._rowKey : index" :row="row" :render="expandRender" :index="row._index"></Expand>
35 35 </td>
36 36 </tr>
37 37 </template>
... ... @@ -63,6 +63,10 @@
63 63 draggable: {
64 64 type: Boolean,
65 65 default: false
  66 + },
  67 + rowKey: {
  68 + type: Boolean,
  69 + default: false
66 70 }
67 71 },
68 72 computed: {
... ...
src/components/table/table-head.vue
... ... @@ -171,7 +171,8 @@
171 171 this.$parent.selectAll(status);
172 172 },
173 173 handleSort (index, type) {
174   - const column = this.columns[index];
  174 + // 在固定列时,寻找正确的 index #5580
  175 + const column = this.columns.find(item => item._index === index);
175 176 const _index = column._index;
176 177  
177 178 if (column._sortType === type) {
... ... @@ -180,7 +181,8 @@
180 181 this.$parent.handleSort(_index, type);
181 182 },
182 183 handleSortByHead (index) {
183   - const column = this.columns[index];
  184 + // 在固定列时,寻找正确的 index #5580
  185 + const column = this.columns.find(item => item._index === index);
184 186 if (column.sortable) {
185 187 const type = column._sortType;
186 188 if (type === 'normal') {
... ...
src/components/table/table.vue
... ... @@ -21,6 +21,7 @@
21 21 :styleObject="tableStyle"
22 22 :columns="cloneColumns"
23 23 :data="rebuildData"
  24 + :row-key="rowKey"
24 25 :columns-width="columnsWidth"
25 26 :obj-data="objData"></table-body>
26 27 </div>
... ... @@ -59,6 +60,7 @@
59 60 :styleObject="fixedTableStyle"
60 61 :columns="leftFixedColumns"
61 62 :data="rebuildData"
  63 + :row-key="rowKey"
62 64 :columns-width="columnsWidth"
63 65 :obj-data="objData"></table-body>
64 66 </div>
... ... @@ -84,6 +86,7 @@
84 86 :styleObject="fixedRightTableStyle"
85 87 :columns="rightFixedColumns"
86 88 :data="rebuildData"
  89 + :row-key="rowKey"
87 90 :columns-width="columnsWidth"
88 91 :obj-data="objData"></table-body>
89 92 </div>
... ... @@ -149,6 +152,10 @@
149 152 height: {
150 153 type: [Number, String]
151 154 },
  155 + // 3.4.0
  156 + maxHeight: {
  157 + type: [Number, String]
  158 + },
152 159 stripe: {
153 160 type: Boolean,
154 161 default: false
... ... @@ -196,6 +203,11 @@
196 203 return oneOf(value, ['dark', 'light']);
197 204 },
198 205 default: 'dark'
  206 + },
  207 + // #5380 开启后,:key 强制更新,否则使用 index
  208 + rowKey: {
  209 + type: Boolean,
  210 + default: false
199 211 }
200 212 },
201 213 data () {
... ... @@ -275,6 +287,10 @@
275 287 const height = parseInt(this.height);
276 288 style.height = `${height}px`;
277 289 }
  290 + if (this.maxHeight) {
  291 + const maxHeight = parseInt(this.maxHeight);
  292 + style.maxHeight = `${maxHeight}px`;
  293 + }
278 294 if (this.width) style.width = `${this.width}px`;
279 295 return style;
280 296 },
... ... @@ -336,7 +352,11 @@
336 352 let style = {};
337 353 if (this.bodyHeight !== 0) {
338 354 const height = this.bodyHeight;
339   - style.height = `${height}px`;
  355 + if (this.height) {
  356 + style.height = `${height}px`;
  357 + } else if (this.maxHeight) {
  358 + style.maxHeight = `${height}px`;
  359 + }
340 360 }
341 361 return style;
342 362 },
... ... @@ -548,7 +568,7 @@
548 568 this.objData[_index]._isExpanded = status;
549 569 this.$emit('on-expand', JSON.parse(JSON.stringify(this.cloneData[_index])), status);
550 570  
551   - if(this.height){
  571 + if(this.height || this.maxHeight){
552 572 this.$nextTick(()=>this.fixedBody());
553 573 }
554 574 },
... ... @@ -578,12 +598,16 @@
578 598 },
579 599  
580 600 fixedHeader () {
581   - if (this.height) {
  601 + if (this.height || this.maxHeight) {
582 602 this.$nextTick(() => {
583 603 const titleHeight = parseInt(getStyle(this.$refs.title, 'height')) || 0;
584 604 const headerHeight = parseInt(getStyle(this.$refs.header, 'height')) || 0;
585 605 const footerHeight = parseInt(getStyle(this.$refs.footer, 'height')) || 0;
586   - this.bodyHeight = this.height - titleHeight - headerHeight - footerHeight;
  606 + if (this.height) {
  607 + this.bodyHeight = this.height - titleHeight - headerHeight - footerHeight;
  608 + } else if (this.maxHeight) {
  609 + this.bodyHeight = this.maxHeight - titleHeight - headerHeight - footerHeight;
  610 + }
587 611 this.$nextTick(()=>this.fixedBody());
588 612 });
589 613 } else {
... ... @@ -986,6 +1010,9 @@
986 1010 height () {
987 1011 this.handleResize();
988 1012 },
  1013 + maxHeight () {
  1014 + this.handleResize();
  1015 + },
989 1016 showHorizontalScrollBar () {
990 1017 this.handleResize();
991 1018 },
... ...
src/components/tabs/tabs.vue
... ... @@ -13,13 +13,13 @@
13 13 <span :class="[prefixCls + '-nav-prev', scrollable ? '' : prefixCls + '-nav-scroll-disabled']" @click="scrollPrev"><Icon type="ios-arrow-back"></Icon></span>
14 14 <span :class="[prefixCls + '-nav-next', scrollable ? '' : prefixCls + '-nav-scroll-disabled']" @click="scrollNext"><Icon type="ios-arrow-forward"></Icon></span>
15 15 <div ref="navScroll" :class="[prefixCls + '-nav-scroll']">
16   - <div ref="nav" :class="[prefixCls + '-nav']" class="nav-text" :style="navStyle">
  16 + <div ref="nav" :class="[prefixCls + '-nav']" :style="navStyle">
17 17 <div :class="barClasses" :style="barStyle"></div>
18 18 <div :class="tabCls(item)" v-for="(item, index) in navList" @click="handleChange(index)">
19 19 <Icon v-if="item.icon !== ''" :type="item.icon"></Icon>
20 20 <Render v-if="item.labelType === 'function'" :render="item.label"></Render>
21 21 <template v-else>{{ item.label }}</template>
22   - <Icon v-if="showClose(item)" type="ios-close" @click.native.stop="handleRemove(index)"></Icon>
  22 + <Icon :class="[prefixCls + '-close']" v-if="showClose(item)" :type="arrowType" :custom="customArrowType" :size="arrowSize" @click.native.stop="handleRemove(index)"></Icon>
23 23 </div>
24 24 </div>
25 25 </div>
... ... @@ -169,6 +169,41 @@
169 169 }
170 170  
171 171 return style;
  172 + },
  173 + // 3.4.0, global setting customArrow 有值时,arrow 赋值空
  174 + arrowType () {
  175 + let type = 'ios-close';
  176 +
  177 + if (this.$IVIEW) {
  178 + if (this.$IVIEW.tabs.customCloseIcon) {
  179 + type = '';
  180 + } else if (this.$IVIEW.tabs.closeIcon) {
  181 + type = this.$IVIEW.tabs.closeIcon;
  182 + }
  183 + }
  184 + return type;
  185 + },
  186 + // 3.4.0, global setting
  187 + customArrowType () {
  188 + let type = '';
  189 +
  190 + if (this.$IVIEW) {
  191 + if (this.$IVIEW.tabs.customCloseIcon) {
  192 + type = this.$IVIEW.tabs.customCloseIcon;
  193 + }
  194 + }
  195 + return type;
  196 + },
  197 + // 3.4.0, global setting
  198 + arrowSize () {
  199 + let size = '';
  200 +
  201 + if (this.$IVIEW) {
  202 + if (this.$IVIEW.tabs.closeIconSize) {
  203 + size = this.$IVIEW.tabs.closeIconSize;
  204 + }
  205 + }
  206 + return size;
172 207 }
173 208 },
174 209 methods: {
... ...
src/components/tree/node.vue
1 1 <template>
2   - <collapse-transition>
  2 + <collapse-transition :appear="appear">
3 3 <ul :class="classes">
4 4 <li>
5 5 <span :class="arrowClasses" @click="handleExpand">
6   - <Icon v-if="showArrow" type="ios-arrow-forward"></Icon>
7   - <Icon v-if="showLoading" type="ios-loading" class="ivu-load-loop"></Icon>
  6 + <Icon v-if="showArrow" :type="arrowType" :custom="customArrowType" :size="arrowSize" />
  7 + <Icon v-if="showLoading" type="ios-loading" class="ivu-load-loop" />
8 8 </span>
9 9 <Checkbox
10 10 v-if="showCheckbox"
... ... @@ -17,6 +17,7 @@
17 17 <span v-else :class="titleClasses" @click="handleSelect">{{ data.title }}</span>
18 18 <Tree-node
19 19 v-if="data.expand"
  20 + :appear="appearByClickArrow"
20 21 v-for="(item, i) in children"
21 22 :key="i"
22 23 :data="item"
... ... @@ -61,11 +62,16 @@
61 62 showCheckbox: {
62 63 type: Boolean,
63 64 default: false
  65 + },
  66 + appear: {
  67 + type: Boolean,
  68 + default: false
64 69 }
65 70 },
66 71 data () {
67 72 return {
68   - prefixCls: prefixCls
  73 + prefixCls: prefixCls,
  74 + appearByClickArrow: false
69 75 };
70 76 },
71 77 computed: {
... ... @@ -127,6 +133,41 @@
127 133 },
128 134 children () {
129 135 return this.data[this.childrenKey];
  136 + },
  137 + // 3.4.0, global setting customArrow 有值时,arrow 赋值空
  138 + arrowType () {
  139 + let type = 'ios-arrow-forward';
  140 +
  141 + if (this.$IVIEW) {
  142 + if (this.$IVIEW.tree.customArrow) {
  143 + type = '';
  144 + } else if (this.$IVIEW.tree.arrow) {
  145 + type = this.$IVIEW.tree.arrow;
  146 + }
  147 + }
  148 + return type;
  149 + },
  150 + // 3.4.0, global setting
  151 + customArrowType () {
  152 + let type = '';
  153 +
  154 + if (this.$IVIEW) {
  155 + if (this.$IVIEW.tree.customArrow) {
  156 + type = this.$IVIEW.tree.customArrow;
  157 + }
  158 + }
  159 + return type;
  160 + },
  161 + // 3.4.0, global setting
  162 + arrowSize () {
  163 + let size = '';
  164 +
  165 + if (this.$IVIEW) {
  166 + if (this.$IVIEW.tree.arrowSize) {
  167 + size = this.$IVIEW.tree.arrowSize;
  168 + }
  169 + }
  170 + return size;
130 171 }
131 172 },
132 173 methods: {
... ... @@ -134,6 +175,9 @@
134 175 const item = this.data;
135 176 if (item.disabled) return;
136 177  
  178 + // Vue.js 2.6.9 对 transition 的 appear 进行了调整,导致 iView 初始化时无动画,加此方法来判断通过点击箭头展开时,加 appear,否则初始渲染时 appear 为 false
  179 + this.appearByClickArrow = true;
  180 +
137 181 // async loading
138 182 if (item[this.childrenKey].length === 0) {
139 183 const tree = findComponentUpward(this, 'Tree');
... ...
src/index.js
... ... @@ -168,7 +168,58 @@ const install = function(Vue, opts = {}) {
168 168  
169 169 Vue.prototype.$IVIEW = {
170 170 size: opts.size || '',
171   - transfer: 'transfer' in opts ? opts.transfer : ''
  171 + transfer: 'transfer' in opts ? opts.transfer : '',
  172 + select: {
  173 + arrow: opts.select ? opts.select.arrow ? opts.select.arrow : '' : '',
  174 + customArrow: opts.select ? opts.select.customArrow ? opts.select.customArrow : '' : '',
  175 + arrowSize: opts.select ? opts.select.arrowSize ? opts.select.arrowSize : '' : ''
  176 + },
  177 + cell: {
  178 + arrow: opts.cell ? opts.cell.arrow ? opts.cell.arrow : '' : '',
  179 + customArrow: opts.cell ? opts.cell.customArrow ? opts.cell.customArrow : '' : '',
  180 + arrowSize: opts.cell ? opts.cell.arrowSize ? opts.cell.arrowSize : '' : ''
  181 + },
  182 + menu: {
  183 + arrow: opts.menu ? opts.menu.arrow ? opts.menu.arrow : '' : '',
  184 + customArrow: opts.menu ? opts.menu.customArrow ? opts.menu.customArrow : '' : '',
  185 + arrowSize: opts.menu ? opts.menu.arrowSize ? opts.menu.arrowSize : '' : ''
  186 + },
  187 + tree: {
  188 + arrow: opts.tree ? opts.tree.arrow ? opts.tree.arrow : '' : '',
  189 + customArrow: opts.tree ? opts.tree.customArrow ? opts.tree.customArrow : '' : '',
  190 + arrowSize: opts.tree ? opts.tree.arrowSize ? opts.tree.arrowSize : '' : ''
  191 + },
  192 + cascader: {
  193 + arrow: opts.cascader ? opts.cascader.arrow ? opts.cascader.arrow : '' : '',
  194 + customArrow: opts.cascader ? opts.cascader.customArrow ? opts.cascader.customArrow : '' : '',
  195 + arrowSize: opts.cascader ? opts.cascader.arrowSize ? opts.cascader.arrowSize : '' : '',
  196 + itemArrow: opts.cascader ? opts.cascader.itemArrow ? opts.cascader.itemArrow : '' : '',
  197 + customItemArrow: opts.cascader ? opts.cascader.customItemArrow ? opts.cascader.customItemArrow : '' : '',
  198 + itemArrowSize: opts.cascader ? opts.cascader.itemArrowSize ? opts.cascader.itemArrowSize : '' : ''
  199 + },
  200 + colorPicker: {
  201 + arrow: opts.colorPicker ? opts.colorPicker.arrow ? opts.colorPicker.arrow : '' : '',
  202 + customArrow: opts.colorPicker ? opts.colorPicker.customArrow ? opts.colorPicker.customArrow : '' : '',
  203 + arrowSize: opts.colorPicker ? opts.colorPicker.arrowSize ? opts.colorPicker.arrowSize : '' : ''
  204 + },
  205 + datePicker: {
  206 + icon: opts.datePicker ? opts.datePicker.icon ? opts.datePicker.icon : '' : '',
  207 + customIcon: opts.datePicker ? opts.datePicker.customIcon ? opts.datePicker.customIcon : '' : '',
  208 + iconSize: opts.datePicker ? opts.datePicker.iconSize ? opts.datePicker.iconSize : '' : ''
  209 + },
  210 + timePicker: {
  211 + icon: opts.timePicker ? opts.timePicker.icon ? opts.timePicker.icon : '' : '',
  212 + customIcon: opts.timePicker ? opts.timePicker.customIcon ? opts.timePicker.customIcon : '' : '',
  213 + iconSize: opts.timePicker ? opts.timePicker.iconSize ? opts.timePicker.iconSize : '' : ''
  214 + },
  215 + tabs: {
  216 + closeIcon: opts.tabs ? opts.tabs.closeIcon ? opts.tabs.closeIcon : '' : '',
  217 + customCloseIcon: opts.tabs ? opts.tabs.customCloseIcon ? opts.tabs.customCloseIcon : '' : '',
  218 + closeIconSize: opts.tabs ? opts.tabs.closeIconSize ? opts.tabs.closeIconSize : '' : ''
  219 + },
  220 + modal: {
  221 + maskClosable: opts.modal ? 'maskClosable' in opts.modal ? opts.modal.maskClosable : '' : ''
  222 + }
172 223 };
173 224  
174 225 Vue.prototype.$Loading = LoadingBar;
... ...
src/mixins/link.js
... ... @@ -15,21 +15,46 @@ export default {
15 15 return oneOf(value, ['_blank', '_self', '_parent', '_top']);
16 16 },
17 17 default: '_self'
18   - }
  18 + },
  19 + append: {
  20 + type: Boolean,
  21 + required: false,
  22 + default: false,
  23 + },
19 24 },
20 25 computed: {
21 26 linkUrl () {
22 27 const type = typeof this.to;
23   - return type === 'string' ? this.to : null;
  28 + if (type !== 'string') {
  29 + return null;
  30 + }
  31 + if (this.to.includes('//')) {
  32 + /* Absolute URL, we do not need to route this */
  33 + return this.to;
  34 + }
  35 + const router = this.$router;
  36 + if (router) {
  37 + const current = this.$route;
  38 + const route = router.resolve(this.to, current, this.append);
  39 + return route ? route.href : this.to;
  40 + }
  41 + return this.to;
24 42 }
25 43 },
26 44 methods: {
27 45 handleClick (new_window = false) {
28   - if (new_window){
29   - window.open(this.to);
  46 + const router = this.$router;
  47 +
  48 + if (new_window) {
  49 + let to = this.to;
  50 + if (router) {
  51 + const current = this.$route;
  52 + const route = router.resolve(this.to, current, this.append);
  53 + to = route ? route.href : this.to;
  54 + }
  55 + window.open(to);
30 56 } else {
31   - const isRoute = this.$router;
32   - if (isRoute) {
  57 + if (router) {
33 58 this.replace ? this.$router.replace(this.to) : this.$router.push(this.to);
34 59 } else {
35 60 window.location.href = this.to;
... ...
src/styles/common/iconfont/_ionicons-font.less
... ... @@ -2,13 +2,13 @@
2 2 // --------------------------
3 3  
4 4 @font-face {
5   - font-family: @ionicons-font-family;
6   - src:
7   - url("@{ionicons-font-path}/ionicons.ttf?v=@{ionicons-version}") format("truetype"),
8   - url("@{ionicons-font-path}/ionicons.woff?v=@{ionicons-version}") format("woff"),
9   - url("@{ionicons-font-path}/ionicons.svg?v=@{ionicons-version}#Ionicons") format("svg");
10   - font-weight: normal;
11   - font-style: normal;
  5 + font-family: @ionicons-font-family;
  6 + src: url("@{ionicons-font-path}/ionicons.woff2?v=@{ionicons-version}") format("woff2"),
  7 + url("@{ionicons-font-path}/ionicons.woff?v=@{ionicons-version}") format("woff"),
  8 + url("@{ionicons-font-path}/ionicons.ttf?v=@{ionicons-version}") format("truetype"),
  9 + url("@{ionicons-font-path}/ionicons.svg?v=@{ionicons-version}#Ionicons") format("svg");
  10 + font-weight: normal;
  11 + font-style: normal;
12 12 }
13 13  
14 14 .ivu-icon() {
... ...
src/styles/common/iconfont/fonts/ionicons.woff2 0 → 100644
No preview for this file type
src/styles/components/cascader.less
... ... @@ -68,7 +68,7 @@
68 68 .inner-arrow();
69 69 }
70 70 &-visible &-arrow:nth-of-type(2) {
71   - transform: rotate(180deg);
  71 + transform: translateY(-50%) rotate(180deg);
72 72 }
73 73  
74 74 .@{select-dropdown-prefix-cls} {
... ... @@ -126,7 +126,7 @@
126 126  
127 127 & &-item{
128 128 position: relative;
129   - padding-right: 24px;
  129 + padding-right: 36px;
130 130 transition: all @transition-time @ease-in-out;
131 131  
132 132 i{
... ... @@ -134,7 +134,8 @@
134 134 position: absolute;
135 135 right: 15px;
136 136 top: 50%;
137   - margin-top: -6px;
  137 + //margin-top: -6px;
  138 + transform: translateY(-50%);
138 139 }
139 140  
140 141 &-active{
... ...
src/styles/components/input-number.less
... ... @@ -19,6 +19,7 @@
19 19 border: 1px solid @border-color-base;
20 20 border-radius: @btn-border-radius;
21 21 overflow: hidden;
  22 + cursor: default;
22 23  
23 24 &-handler-wrap {
24 25 width: 22px;
... ... @@ -196,4 +197,4 @@
196 197 .active-error;
197 198 }
198 199 }
199   -}
200 200 \ No newline at end of file
  201 +}
... ...
src/styles/components/menu.less
... ... @@ -160,16 +160,24 @@
160 160 }
161 161  
162 162 &-vertical &-submenu-title-icon{
163   - float: right;
164   - position: relative;
165   - top: 4px;
  163 + // #5592 支持自定义图标 size 后,换一种位置
  164 + //float: right;
  165 + //position: relative;
  166 + //top: 4px;
  167 + position: absolute;
  168 + top: 50%;
  169 + right: 24px;
  170 + transform: translateY(-50%);
166 171 }
167 172 &-submenu-title-icon {
168 173 transition: transform @transition-time @ease-in-out;
169 174 }
170   - &-opened > * > &-submenu-title-icon{
  175 + &-horizontal &-opened > * > &-submenu-title-icon{
171 176 transform: rotate(180deg);
172 177 }
  178 + &-vertical &-opened > * > &-submenu-title-icon{
  179 + transform: translateY(-50%) rotate(180deg);
  180 + }
173 181  
174 182 &-vertical &-submenu{
175 183 &-nested{
... ...
src/styles/components/select.less
... ... @@ -43,7 +43,7 @@
43 43 }
44 44  
45 45 .@{select-prefix-cls}-arrow {
46   - transform: rotate(180deg);
  46 + transform: translateY(-50%) rotate(180deg);
47 47 display: inline-block;
48 48 }
49 49 }
... ... @@ -53,7 +53,7 @@
53 53 .disabled();
54 54  
55 55 .@{select-prefix-cls}-arrow {
56   - display: none;
  56 + color: @slider-disabled-color;
57 57 }
58 58  
59 59 &:hover {
... ... @@ -185,7 +185,7 @@
185 185 }
186 186  
187 187 &-multiple &-input{
188   - height: @input-height-base - 3px;
  188 + height: @input-height-base - 2px;
189 189 line-height: @input-height-base;
190 190 padding: 0 0 0 4px;
191 191 }
... ... @@ -208,7 +208,7 @@
208 208 margin: 3px 4px 3px 0;
209 209 max-width: 99%;
210 210 position: relative;
211   - span{
  211 + span:not(.ivu-select-max-tag){
212 212 display: block;
213 213 margin-right: 14px;
214 214 overflow: hidden;
... ... @@ -256,6 +256,33 @@
256 256 & &-dropdown{
257 257 width: auto;
258 258 }
  259 +
  260 + &-prefix{
  261 + display: inline-block;
  262 + vertical-align: middle;
  263 + i{
  264 + vertical-align: top;
  265 + }
  266 + }
  267 + &-head-with-prefix{
  268 + display: inline-block !important;
  269 + vertical-align: middle;
  270 + }
  271 + &-single &-prefix{
  272 + padding-left: 4px;
  273 + }
  274 + &-single &-head-with-prefix, &-multiple &-head-with-prefix{
  275 + padding-left: 0 !important;
  276 + }
  277 +
  278 + &-head-flex{
  279 + display: flex;
  280 + align-items: center;
  281 + }
  282 +
  283 + &-multiple &-head-flex &-prefix{
  284 + margin-right: 4px;
  285 + }
259 286 }
260 287  
261 288 .select-item(@select-prefix-cls, @select-item-prefix-cls);
... ...
src/styles/components/table.less
... ... @@ -7,6 +7,7 @@
7 7 border: 1px solid @border-color-base;
8 8 border-bottom: 0;
9 9 border-right: 0;
  10 + overflow: hidden; // 开启 max-height 时,没有 overflow: hidden,则底部多出 1px,早期没有 overflow 是因为有些控件没有加 transfer
10 11 }
11 12 width: inherit;
12 13 height: 100%;
... ...
src/styles/components/tabs.less
... ... @@ -203,7 +203,7 @@
203 203 &&-card > &-bar &-nav-wrap {
204 204 margin-bottom: 0;
205 205 }
206   - &&-card > &-bar &-tab .@{css-prefix-iconfont}-ios-close {
  206 + &&-card > &-bar &-tab &-close {
207 207 width: 0;
208 208 height: 22px;
209 209 font-size: 22px;
... ... @@ -221,8 +221,8 @@
221 221 }
222 222 }
223 223  
224   - &&-card > &-bar &-tab-active .@{css-prefix-iconfont}-ios-close,
225   - &&-card > &-bar &-tab:hover .@{css-prefix-iconfont}-ios-close {
  224 + &&-card > &-bar &-tab-active &-close,
  225 + &&-card > &-bar &-tab:hover &-close {
226 226 width: 22px;
227 227 transform: translateZ(0);
228 228 margin-right: -6px;
... ...
src/styles/mixins/common.less
... ... @@ -20,7 +20,7 @@
20 20 top: 50%;
21 21 right: 8px;
22 22 line-height: 1;
23   - margin-top: -7px;
  23 + transform: translateY(-50%);
24 24 font-size: @font-size-base;
25 25 color: @subsidiary-color;
26 26 transition: all @transition-time @ease-in-out;
... ...
tsconfig.json 0 → 100644
  1 +{
  2 + "compilerOptions": {
  3 + "target": "esnext",
  4 + "module": "esnext",
  5 + "strict": true,
  6 + "jsx": "preserve",
  7 + "importHelpers": true,
  8 + "moduleResolution": "node",
  9 + "experimentalDecorators": true,
  10 + "esModuleInterop": true,
  11 + "allowSyntheticDefaultImports": true,
  12 + "sourceMap": true,
  13 + "baseUrl": ".",
  14 + "paths": {
  15 + "@/*": ["src/*"]
  16 + },
  17 + "lib": ["esnext", "dom", "dom.iterable", "scripthost"]
  18 + },
  19 + "include": [
  20 + "types/*.ts",
  21 + ],
  22 + "exclude": ["node_modules"]
  23 +}
... ...
tslint.json 0 → 100644
  1 +{
  2 + "defaultSeverity": "warning",
  3 + "extends": ["tslint:recommended"],
  4 + "linterOptions": {
  5 + "exclude": ["node_modules/**"]
  6 + },
  7 + "rules": {
  8 + "jsx-boolean-value": false,
  9 + "jsx-curly-spacing": false,
  10 + "jsx-no-multiline-js": false,
  11 + "jsx-wrap-multiline": false,
  12 + "jsx-alignment": false,
  13 + "jsx-no-lambda": true,
  14 + "jsx-no-string-ref": false,
  15 + "class-name": false,
  16 + "max-line-length": [true, 180],
  17 + "member-ordering": [true, "statics-first"],
  18 + "new-parens": true,
  19 + "no-consecutive-blank-lines": true,
  20 + "no-mergeable-namespace": true,
  21 + "no-switch-case-fall-through": true,
  22 + "no-trailing-whitespace": true,
  23 + "no-unused-variable": [true],
  24 + "no-var-keyword": true,
  25 + "one-variable-per-declaration": [false, "ignore-for-loop"],
  26 + "triple-equals": [false, "allow-null-check"],
  27 + "use-isnan": false,
  28 + //ts专用
  29 + "prefer-const": false, //true, //const偏好
  30 + "adjacent-overload-signatures": true, //Enforces function overloads to be consecutive.
  31 + "ban-comma-operator": true, //禁止逗号运算符。
  32 + "ban-type": [true, ["object", "User {} instead."], ["string"]], //禁止类型
  33 + //"member-access": [true, "no-public" || "check-accessor" || "check-constructor" || "check-parameter-property"], //类成员必须声明 private public ....
  34 + "member-order": [false], //类声明排序
  35 + "no-any": false, //true, //不需使用any类型
  36 + "no-empty-interface": true, //禁止空接口 {}
  37 + "no-import-side-effect": [
  38 + true,
  39 + {
  40 + "ignore-module": "(\\.html|\\.css)$"
  41 + }
  42 + ], //禁止导入带有副作用的语句
  43 + "no-inferrable-types": [true, "ignore-params", "ignore-properties"], //不允许将变量或参数初始化为数字,字符串或布尔值的显式类型声明。
  44 + "no-internal-module": true, //不允许内部模块
  45 + "no-magic-numbers": false, //[true, 1, 2, 3], //不允许在变量赋值之外使用常量数值。当没有指定允许值列表时,默认允许-1,0和1
  46 + "no-namespace": false, //[true, "allpw-declarations"], //不允许使用内部modules和命名空间
  47 + "no-non-null-assertion": true, //不允许使用!后缀操作符的非空断言。
  48 + "no-parameter-reassignment": false, //true, //不允许重新分配参数
  49 + "no-reference": false, //true, // 禁止使用/// <reference path=> 导入 ,使用import代替
  50 + "no-unnecessary-type-assertion": true, //如果类型断言没有改变表达式的类型就发出警告
  51 + "no-var-requires": true, //不允许使用var module = require("module"),用 import foo = require('foo')导入
  52 + "only-arrow-functions": false, //[true, "allow-declarations", "allow-named-functions"], //允许箭头表达式,不需要传统表达式 ; 允许独立的函数声明 ;允许表达,function foo() {}但不是function() {}
  53 + "prefer-for-of": true, //建议使用for(..of)
  54 + "promise-function-async": true, //要求异步函数返回promise
  55 + "typedef": false, //[true, "call-signature", "parameter", "member-variable-declaration"], // 需要定义的类型存在
  56 + "typedef-whitespace": true, //类型声明的冒号之前是否需要空格,在类型定义的时候,是否允许使用空格, 使用false,表示不对此项进行校验,不启用此项的校验
  57 + "unified-signatures": true, //重载可以被统一联合成一个
  58 + //function 专用
  59 + "await-promise": true, //警告不是一个promise的await
  60 + // "ban": [
  61 + // true,
  62 + // "eval",
  63 + // {
  64 + // "name": "$",
  65 + // "message": "please don't"
  66 + // },
  67 + // ["describe", "only"],
  68 + // {
  69 + // "name": ["it", "only"],
  70 + // "message": "don't focus tests"
  71 + // },
  72 + // {
  73 + // "name": ["chai", "assert", "equal"],
  74 + // "message": "Use 'strictEqual' instead."
  75 + // },
  76 + // {
  77 + // "name": ["*", "forEach"],
  78 + // "message": "Use a regular for loop instead."
  79 + // }
  80 + // ],
  81 + "curly": true, //for if do while 要有括号
  82 + "forin": false, //true, //用for in 必须用if进行过滤
  83 + "import-blacklist": true, //允许使用import require导入具体的模块
  84 + "label-postion": true, //允许在do/for/while/swith中使用label
  85 + "no-arg": true, //不允许使用 argument.callee
  86 + "no-bitwise": false, //true, //不允许使用按位运算符
  87 + "no-conditional-assignmen": true, //不允许在do-while/for/if/while判断语句中使用赋值语句
  88 + "no-console": [true, "time", "timeEnd"], //不能使用console
  89 + "no-construct": true, //不允许使用 String/Number/Boolean的构造函数
  90 + "no-debugger": true, //不允许使用debugger
  91 + "no-duplicate-super": true, //构造函数两次用super会发出警告
  92 + "no-empty": false, //true, //不允许空的块
  93 + "no-eval": true, //不允许使用eval
  94 + "no-floating-promises": true, //必须正确处理promise的返回函数
  95 + "no-for-in-array": true, //不允许使用for in 遍历数组
  96 + "no-implicit-dependencies": true, //不允许在项目的package.json中导入未列为依赖项的模块
  97 + "no-inferred-empty-object-type": true, //不允许在函数和构造函数中使用{}的类型推断
  98 + "no-invalid-template-strings": true, //警告在非模板字符中使用${
  99 + "no-invalid-this": false, //true, //不允许在非class中使用 this关键字
  100 + "no-misused-new": true, //禁止定义构造函数或new class
  101 + "no-null-keyword": false, // true, //不允许使用null关键字
  102 + "no-object-literal-type-assertion": false, //true, //禁止objext出现在类型断言表达式中
  103 + "no-return-await": true, //不允许return await
  104 + "arrow-parens": false, //true, //箭头函数定义的参数需要括号
  105 + "quotemark": [true, "single", "jsx-double", "avoid-escape"], //引号的使用规则
  106 + "semicolon": false, //[true, "never", "ignore-interfaces"], //分号的使用规则
  107 + "indent": false, //[true, "tabs", 2], //使用Tab进行缩进,每次强制缩进2个字符
  108 + "whitespace": [
  109 + true,
  110 + "check-branch",
  111 + "check-decl",
  112 + "check-operator",
  113 + "check-type"
  114 + ], //空格的校验
  115 + "member-access": false, //类成员的显示可见性声明,即显示定义一个类的成员是否可见,即对类成员定义public | static 等
  116 + "one-line": false //, //要求指定的标记与它们之前的表达式位于同一行
  117 + // "trailing-comma": [true, { //对尾随逗号的校验
  118 + // "multiline": {
  119 + // "objects": "ignore",
  120 + // "arrays": "never",
  121 + // "functions": "never",
  122 + // "typeLiterals": "ignore"
  123 + // },
  124 + //"esSpecCompliant": true //是否允许尾随逗号出现在剩余变量中
  125 + // }]
  126 + }
  127 +}
... ...
types/drawer.d.ts
... ... @@ -75,7 +75,7 @@ export declare interface Drawer extends Vue {
75 75 /**
76 76 * 返回 Promise 可以阻止关闭
77 77 */
78   - 'before-close'?: () => void | PromiseConstructor;
  78 + 'before-close'?: () => void | Promise<any>;
79 79 /**
80 80 * 关闭抽屉时触发
81 81 */
... ...
types/loading-bar.d.ts
... ... @@ -42,6 +42,11 @@ export declare interface LoadingBarConfig {
42 42 */
43 43 color?: string;
44 44 /**
  45 + * 自动消失的延时, 默认为800ms
  46 + * @default 800
  47 + */
  48 + duration?: number;
  49 + /**
45 50 * 失败时的进度条颜色,默认为 iView 主色
46 51 * @default error
47 52 */
... ...
types/time.d.ts
... ... @@ -2,7 +2,7 @@
2 2 // Project: https://github.com/iview/iview
3 3 // Definitions by: yangdan
4 4 // Definitions: https://github.com/yangdan8/iview.git
5   -import Vue, { VNode } from 'vue';
  5 +import Vue from 'vue';
6 6  
7 7 export declare interface Time extends Vue {
8 8 /**
... ...