Commit 2a21b455a362facbc13606eca9c6856d6f416a78

Authored by yangdan8
Committed by GitHub
2 parents da5d3d4e 0ad95539

Merge pull request #32 from iview/2.0

update
src/components/input/input.vue
... ... @@ -141,9 +141,7 @@
141 141 default: false
142 142 },
143 143 autocomplete: {
144   - validator (value) {
145   - return oneOf(value, ['on', 'off']);
146   - },
  144 + type: String,
147 145 default: 'off'
148 146 },
149 147 clearable: {
... ...
src/components/modal/modal.vue
... ... @@ -5,7 +5,7 @@
5 5 </transition>
6 6 <div :class="wrapClasses" :style="wrapStyles" @click="handleWrapClick">
7 7 <transition :name="transitionNames[0]" @after-leave="animationFinish">
8   - <div :class="classes" :style="mainStyles" v-show="visible">
  8 + <div :class="classes" :style="mainStyles" v-show="visible" @mousedown="handleMousedown">
9 9 <div :class="contentClasses" ref="content" :style="contentStyles" @click="handleClickModal">
10 10 <a :class="[prefixCls + '-close']" v-if="closable" @click="close">
11 11 <slot name="close">
... ... @@ -140,6 +140,7 @@
140 140 dragging: false
141 141 },
142 142 modalIndex: this.handleGetModalIndex(), // for Esc close the top modal
  143 + isMouseTriggerIn: false, // #5800
143 144 };
144 145 },
145 146 computed: {
... ... @@ -243,10 +244,17 @@
243 244 }
244 245 },
245 246 handleWrapClick (event) {
  247 + if (this.isMouseTriggerIn) {
  248 + this.isMouseTriggerIn = false;
  249 + return;
  250 + }
246 251 // use indexOf,do not use === ,because ivu-modal-wrap can have other custom className
247 252 const className = event.target.getAttribute('class');
248 253 if (className && className.indexOf(`${prefixCls}-wrap`) > -1) this.handleMask();
249 254 },
  255 + handleMousedown () {
  256 + this.isMouseTriggerIn = true;
  257 + },
250 258 cancel () {
251 259 this.close();
252 260 },
... ...
src/components/select/select.vue
... ... @@ -437,6 +437,8 @@
437 437 if (query === null) {
438 438 this.onQueryChange('');
439 439 this.values = [];
  440 + // #5620,修复清空搜索关键词后,重新搜索相同的关键词没有触发远程搜索
  441 + this.lastRemoteQuery = '';
440 442 }
441 443 },
442 444 clearSingleSelect(){ // PUBLIC API
... ...
src/components/table/table-head.vue
... ... @@ -16,7 +16,7 @@
16 16 <span v-if="!column.renderHeader">{{ column.title || '' }}</span>
17 17 <render-header v-else :render="column.renderHeader" :column="column" :index="index"></render-header>
18 18 </template>
19   - <template v-else-if="column.type === 'selection'"><Checkbox :value="isSelectAll" :disabled="!data.length" @on-change="selectAll"></Checkbox></template>
  19 + <template v-else-if="column.type === 'selection'"><Checkbox :value="isSelectAll" :disabled="isSelectDisabled" @on-change="selectAll"></Checkbox></template>
20 20 <template v-else>
21 21 <span v-if="!column.renderHeader" :class="{[prefixCls + '-cell-sort']: column.sortable}" @click="handleSortByHead(getColumn(rowIndex, index)._index)">{{ column.title || '#' }}</span>
22 22 <render-header v-else :render="column.renderHeader" :column="column" :index="index"></render-header>
... ... @@ -61,7 +61,7 @@
61 61 </template>
62 62 </div>
63 63 </th>
64   -
  64 +
65 65 <th v-if="$parent.showVerticalScrollBar && rowIndex===0" :class='scrollBarCellClass()' :rowspan="headRows.length"></th>
66 66 </tr>
67 67 </thead>
... ... @@ -121,6 +121,12 @@
121 121 } else {
122 122 return [this.columns];
123 123 }
  124 + },
  125 + isSelectDisabled () {
  126 + let isSelectDisabled = false;
  127 + if (!this.data.length) isSelectDisabled = true;
  128 + if (!this.data.find(item => !item._disabled)) isSelectDisabled = true;
  129 + return isSelectDisabled;
124 130 }
125 131 },
126 132 methods: {
... ...
src/styles/components/table.less
... ... @@ -161,6 +161,8 @@
161 161  
162 162 &-tooltip{
163 163 width: 100%;
  164 + display: flex;
  165 + align-items: center;
164 166 &-content{
165 167 display: block;
166 168 overflow: hidden;
... ...