Merge branch 'ElemeFE:dev' into dev

pull/21445/head
donggua 2021-11-18 17:38:02 +08:00 committed by GitHub
commit 898bae4102
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 3152 additions and 2609 deletions

45
.github/workflows/preview-build.yml vendored Normal file
View File

@ -0,0 +1,45 @@
name: Preview Build
on: pull_request
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
PULL_REQUEST_NUMBER: ${{ github.event.number }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: '10.15.0'
registry-url: https://registry.npmjs.com/
- name: Build
run: npm run bootstrap && npm run deploy:build
# share website dist
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: docs
path: examples/element-ui/
retention-days: 1
# write pr.txt for share
- name: Save pr number
if: ${{ always() }}
run: echo ${PULL_REQUEST_NUMBER} > ./pr.txt
# share pr number
- name: Upload pr number
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: pr
path: ./pr.txt
retention-days: 1

83
.github/workflows/preview-deploy.yml vendored Normal file
View File

@ -0,0 +1,83 @@
name: Preview Deploy
on:
workflow_run:
workflows: ['Preview Build']
types:
- completed
jobs:
success:
runs-on: ubuntu-latest
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
steps:
- name: download pr artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
name: pr
- name: save PR id
id: pr
run: echo "::set-output name=id::$(<pr.txt)"
- name: download docs artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
workflow_conclusion: success
name: docs
- name: upload surge service
id: deploy
run: |
export DEPLOY_DOMAIN=https://preview-pr-${{ steps.pr.outputs.id }}-element-ui.surge.sh
npx surge --project ./ --domain $DEPLOY_DOMAIN --token ${{ secrets.SURGE_TOKEN }}
- name: update status comment
uses: actions-cool/maintain-one-comment@v1.2.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
🎊 PR Preview has been successfully built and deployed to https://preview-pr-${{ steps.pr.outputs.id }}-element-ui.surge.sh
<img width="300" src="https://user-images.githubusercontent.com/507615/90250366-88233900-de6e-11ea-95a5-84f0762ffd39.png">
<!-- Sticky Pull Request Comment -->
body-include: '<!-- Sticky Pull Request Comment -->'
number: ${{ steps.pr.outputs.id }}
- name: The job failed
if: ${{ failure() }}
uses: actions-cool/maintain-one-comment@v1.2.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
😭 Deploy PR Preview failed.
<img width="300" src="https://user-images.githubusercontent.com/507615/90250824-4e066700-de6f-11ea-8230-600ecc3d6a6b.png">
<!-- Sticky Pull Request Comment -->
body-include: '<!-- Sticky Pull Request Comment -->'
number: ${{ steps.pr.outputs.id }}
failed:
runs-on: ubuntu-latest
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'failure'
steps:
- name: download pr artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
name: pr
- name: save PR id
id: pr
run: echo "::set-output name=id::$(<pr.txt)"
- name: The job failed
uses: actions-cool/maintain-one-comment@v1.2.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
😭 Deploy PR Preview failed.
<img width="300" src="https://user-images.githubusercontent.com/507615/90250824-4e066700-de6f-11ea-8230-600ecc3d6a6b.png">
<!-- Sticky Pull Request Comment -->
body-include: '<!-- Sticky Pull Request Comment -->'
number: ${{ steps.pr.outputs.id }}

View File

@ -1,5 +1,31 @@
## Changelog
### 2.15.7
*2021-11-18*
#### Bug fixes
- Select
- fix click icon triggering dropdown (#21314 by @dennyak47)
- fix keydown event when composition (#21336 by @bchen1029)
- Badge
- fix type class when is-dot (#21308 by @adaex)
- Form
- validate method reject error info (#21374 by @cs1707)
- Table
- fix resizeObserver loop limit exceeded (#21255 by @tomieric)
- fix toggleAllSelection bug when table is empty (#21456 by @cs1707)
- optimize performance (#21330 by @cs1707)
- Button
- fix disabled priority (#21375 by @cs1707)
- Descriptions
- fix label slot bug (#21462 by @cs1707)
- SASS
- replace node-sass with dart-sass (#21019 by @linxsbox)
- Docs
- fix skeleton typos (#21408 by @zhhbstudio)
### 2.15.6
*2021-09-02*

View File

@ -1,5 +1,31 @@
## Changelog
### 2.15.7
*2021-11-18*
#### Bug fixes
- Select
- fix click icon triggering dropdown (#21314 by @dennyak47)
- fix keydown event when composition (#21336 by @bchen1029)
- Badge
- fix type class when is-dot (#21308 by @adaex)
- Form
- validate method reject error info (#21374 by @cs1707)
- Table
- fix resizeObserver loop limit exceeded (#21255 by @tomieric)
- fix toggleAllSelection bug when table is empty (#21456 by @cs1707)
- optimize performance (#21330 by @cs1707)
- Button
- fix disabled priority (#21375 by @cs1707)
- Descriptions
- fix label slot bug (#21462 by @cs1707)
- SASS
- replace node-sass with dart-sass (#21019 by @linxsbox)
- Docs
- fix skeleton typos (#21408 by @zhhbstudio)
### 2.15.6
*2021-09-02*

View File

@ -1,5 +1,31 @@
## Changelog
### 2.15.7
*2021-11-18*
#### Bug fixes
- Select
- fix click icon triggering dropdown (#21314 by @dennyak47)
- fix keydown event when composition (#21336 by @bchen1029)
- Badge
- fix type class when is-dot (#21308 by @adaex)
- Form
- validate method reject error info (#21374 by @cs1707)
- Table
- fix resizeObserver loop limit exceeded (#21255 by @tomieric)
- fix toggleAllSelection bug when table is empty (#21456 by @cs1707)
- optimize performance (#21330 by @cs1707)
- Button
- fix disabled priority (#21375 by @cs1707)
- Descriptions
- fix label slot bug (#21462 by @cs1707)
- SASS
- replace node-sass with dart-sass (#21019 by @linxsbox)
- Docs
- fix skeleton typos (#21408 by @zhhbstudio)
### 2.15.6
*2021-09-02*

View File

@ -1,5 +1,31 @@
## 更新日志
### 2.15.7
*2021-11-18*
#### Bug 修复
- Select
- 修复 filter 模式下,点击图标不能触发下拉的 bug (#21314 by @dennyak47)
- 修复 composition 模式下 keydown 事件 (#21336 by @bchen1029)
- Badge
- 修复 is-dot class (#21308 by @adaex)
- Form
- validate 方法返回错误信息 (#21374 by @cs1707)
- Table
- 修复 resizeObserver loop limit exceeded (#21255 by @tomieric)
- 修复 toggleAllSelection (#21456 by @cs1707)
- 优化 table 性能 (#21330 by @cs1707)
- Button
- 修复 disabled 优先级 (#21375 by @cs1707)
- Descriptions
- 修复 label slot bug (#21462 by @cs1707)
- SASS
- node-sass 替换为 dart-sass (#21019 by @linxsbox)
- Docs
- 修复 skeleton 文案 (#21408 by @zhhbstudio)
### 2.15.6
*2021-09-02*

View File

@ -40,7 +40,7 @@ We have provided a switch flag indicating whether showing the loading animation,
:::
### Customized Template
ElementPlus only provides the most common template, sometimes that could be a problem, so you have a slot named `template` to do that work.
Element only provides the most common template, sometimes that could be a problem, so you have a slot named `template` to do that work.
Also we have provided different types skeleton unit that you can choose, for more detailed info, please scroll down to the bottom of this page to see the API description. Also, when building your own customized skeleton structure, you should be structuring them as closer to the real DOM as possible, which avoiding the DOM bouncing caused by the height difference.

View File

@ -40,7 +40,7 @@ We have provided a switch flag indicating whether showing the loading animation,
:::
### Customized Template
ElementPlus only provides the most common template, sometimes that could be a problem, so you have a slot named `template` to do that work.
Element only provides the most common template, sometimes that could be a problem, so you have a slot named `template` to do that work.
Also we have provided different types skeleton unit that you can choose, for more detailed info, please scroll down to the bottom of this page to see the API description. Also, when building your own customized skeleton structure, you should be structuring them as closer to the real DOM as possible, which avoiding the DOM bouncing caused by the height difference.

View File

@ -40,7 +40,7 @@ We have provided a switch flag indicating whether showing the loading animation,
:::
### Customized Template
ElementPlus only provides the most common template, sometimes that could be a problem, so you have a slot named `template` to do that work.
Element only provides the most common template, sometimes that could be a problem, so you have a slot named `template` to do that work.
Also we have provided different types skeleton unit that you can choose, for more detailed info, please scroll down to the bottom of this page to see the API description. Also, when building your own customized skeleton structure, you should be structuring them as closer to the real DOM as possible, which avoiding the DOM bouncing caused by the height difference.

View File

@ -42,7 +42,7 @@
### 自定义样式
ElementPlus 提供的排版模式有时候并不满足要求,当您想要用自己定义的模板时,可以通过一个具名 Slot 来自己设定模板。
Element 提供的排版模式有时候并不满足要求,当您想要用自己定义的模板时,可以通过一个具名 Slot 来自己设定模板。
我们提供了不同的模板单元可供使用,具体可选值请看 API 详细描述。 建议在描述模板的时候,尽量靠近真实的 DOM 结构,这样可以避免 DOM 高度差距引起的抖动。
:::demo

View File

@ -1 +1 @@
{"1.4.13":"1.4","2.0.11":"2.0","2.1.0":"2.1","2.2.2":"2.2","2.3.9":"2.3","2.4.11":"2.4","2.5.4":"2.5","2.6.3":"2.6","2.7.2":"2.7","2.8.2":"2.8","2.9.2":"2.9","2.10.1":"2.10","2.11.1":"2.11","2.12.0":"2.12","2.13.2":"2.13","2.14.1":"2.14","2.15.6":"2.15"}
{"1.4.13":"1.4","2.0.11":"2.0","2.1.0":"2.1","2.2.2":"2.2","2.3.9":"2.3","2.4.11":"2.4","2.5.4":"2.5","2.6.3":"2.6","2.7.2":"2.7","2.8.2":"2.8","2.9.2":"2.9","2.10.1":"2.10","2.11.1":"2.11","2.12.0":"2.12","2.13.2":"2.13","2.14.1":"2.14","2.15.7":"2.15"}

View File

@ -1,6 +1,6 @@
{
"name": "element-ui",
"version": "2.15.6",
"version": "2.15.7",
"description": "A Component Library for Vue.js.",
"main": "lib/element-ui.common.js",
"files": [
@ -102,7 +102,7 @@
"gulp": "^4.0.0",
"gulp-autoprefixer": "^6.0.0",
"gulp-cssmin": "^0.2.0",
"gulp-sass": "^4.0.2",
"gulp-dart-sass": "^1.0.2",
"highlight.js": "^9.3.0",
"html-webpack-plugin": "^3.2.0",
"json-loader": "^0.5.7",
@ -121,12 +121,12 @@
"markdown-it-container": "^2.0.0",
"mini-css-extract-plugin": "^0.4.1",
"mocha": "^6.0.2",
"node-sass": "^4.11.0",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"postcss": "^7.0.14",
"progress-bar-webpack-plugin": "^1.11.0",
"rimraf": "^2.5.4",
"sass-loader": "^7.1.0",
"sass": "^1.34.0",
"sass-loader": "^10.1.1",
"select-version-cli": "^0.0.2",
"sinon": "^7.2.7",
"sinon-chai": "^3.3.0",

View File

@ -65,7 +65,7 @@
return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
},
buttonDisabled() {
return this.disabled || (this.elForm || {}).disabled;
return this.$options.propsData.hasOwnProperty('disabled') ? this.disabled : (this.elForm || {}).disabled;
}
},

View File

@ -100,7 +100,7 @@ export default {
[item.labelClassName]: true
}}
style={item.labelStyle}
>{item.props.label}</span>
>{item.label}</span>
<span
class={['el-descriptions-item__content', item.contentClassName]}
style={item.contentStyle}

View File

@ -32,15 +32,16 @@ export const cellForced = {
return <el-checkbox
disabled={ store.states.data && store.states.data.length === 0 }
indeterminate={ store.states.selection.length > 0 && !this.isAllSelected }
nativeOn-click={ this.toggleAllSelection }
on-input={ this.toggleAllSelection }
value={ this.isAllSelected } />;
},
renderCell: function(h, { row, column, store, $index }) {
renderCell: function(h, { row, column, isSelected, store, $index }) {
return <el-checkbox
nativeOn-click={ (event) => event.stopPropagation() }
value={ store.isSelected(row) }
value={ isSelected }
disabled={ column.selectable ? !column.selectable.call(null, row, $index) : false }
on-input={ () => { store.commit('rowSelectedChanged', row); } } />;
on-input={ () => { store.commit('rowSelectedChanged', row); } }
/>;
},
sortable: false,
resizable: false
@ -67,9 +68,9 @@ export const cellForced = {
renderHeader: function(h, { column }) {
return column.label || '';
},
renderCell: function(h, { row, store }) {
renderCell: function(h, { row, store, isExpanded }) {
const classes = ['el-table__expand-icon'];
if (store.states.expandRows.indexOf(row) > -1) {
if (isExpanded) {
classes.push('el-table__expand-icon--expanded');
}
const callback = function(e) {

View File

@ -98,6 +98,7 @@ Watcher.prototype.mutations = {
}
this.updateTableScrollY();
this.syncFixedTableRowHeight();
},
filterChange(states, options) {
@ -111,6 +112,7 @@ Watcher.prototype.mutations = {
}
this.updateTableScrollY();
this.syncFixedTableRowHeight();
},
toggleAllSelection() {
@ -144,4 +146,8 @@ Watcher.prototype.updateTableScrollY = function() {
Vue.nextTick(this.table.updateScrollY);
};
Watcher.prototype.syncFixedTableRowHeight = function() {
Vue.nextTick(() => this.table.layout.syncFixedTableRowHeight());
};
export default Watcher;

View File

@ -6,6 +6,7 @@ import ElTooltip from 'element-ui/packages/tooltip';
import debounce from 'throttle-debounce/debounce';
import LayoutObserver from './layout-observer';
import { mapStates } from './store/helper';
import TableRow from './table-row.js';
export default {
name: 'ElTableBody',
@ -14,7 +15,8 @@ export default {
components: {
ElCheckbox,
ElTooltip
ElTooltip,
TableRow
},
props: {
@ -39,16 +41,25 @@ export default {
border="0">
<colgroup>
{
this.columns.map(column => <col name={ column.id } key={column.id} />)
this.columns
.filter((column, index) => !(this.columnsHidden[index] && this.fixed))
.map(column => <col name={column.id} key={column.id} />)
}
</colgroup>
<tbody>
{
data.reduce((acc, row) => {
return acc.concat(this.wrappedRowRender(row, acc.length));
const isSelected = this.store.isSelected(row);
const isExpanded = this.store.states.expandRows.indexOf(row) > -1;
return acc.concat(this.wrappedRowRender({
row,
$index: acc.length,
isSelected,
isExpanded
}));
}, [])
}
<el-tooltip effect={ this.table.tooltipEffect } placement="top" ref="tooltip" content={ this.tooltipContent }></el-tooltip>
<el-tooltip effect={this.table.tooltipEffect} placement="top" ref="tooltip" content={this.tooltipContent}></el-tooltip>
</tbody>
</table>
);
@ -71,6 +82,10 @@ export default {
hasExpandColumn: states => states.columns.some(({ type }) => type === 'expand')
}),
columnsHidden() {
return this.columns.map((column, index) => this.isColumnHidden(index));
},
firstDefaultColumnIndex() {
return arrayFindIndex(this.columns, ({ type }) => type === 'default');
}
@ -238,7 +253,7 @@ export default {
if (cell) {
const column = getColumnByCell(table, cell);
const hoverState = table.hoverState = {cell, column, row};
const hoverState = table.hoverState = { cell, column, row };
table.$emit('cell-mouse-enter', hoverState.row, hoverState.column, hoverState.cell, event);
}
@ -314,9 +329,18 @@ export default {
table.$emit(`row-${name}`, row, column, event);
},
rowRender(row, $index, treeRowData) {
getRowHeight(rowKey) {
const { fixed } = this;
if (!fixed) {
return null;
}
const height = (this.tableLayout.fixedColumnsBodyRowsHeight || {})[rowKey];
return typeof height === 'number' ? `${height}px` : height;
},
rowRender({ row, $index, treeRowData, isSelected, isExpanded }) {
const { treeIndent, columns, firstDefaultColumnIndex } = this;
const columnsHidden = columns.map((column, index) => this.isColumnHidden(index));
const rowClasses = this.getRowClass(row, $index);
let display = true;
if (treeRowData) {
@ -328,76 +352,51 @@ export default {
let displayStyle = display ? null : {
display: 'none'
};
return (<tr
style={ [displayStyle, this.getRowStyle(row, $index)] }
class={ rowClasses }
key={ this.getKeyOfRow(row, $index) }
on-dblclick={ ($event) => this.handleDoubleClick($event, row) }
on-click={ ($event) => this.handleClick($event, row) }
on-contextmenu={ ($event) => this.handleContextMenu($event, row) }
on-mouseenter={ _ => this.handleMouseEnter($index) }
on-mouseleave={ this.handleMouseLeave }>
{
columns.map((column, cellIndex) => {
const { rowspan, colspan } = this.getSpan(row, column, $index, cellIndex);
if (!rowspan || !colspan) {
return null;
}
const columnData = { ...column };
columnData.realWidth = this.getColspanRealWidth(columns, colspan, cellIndex);
const data = {
store: this.store,
_self: this.context || this.table.$vnode.context,
column: columnData,
row,
$index
};
if (cellIndex === firstDefaultColumnIndex && treeRowData) {
data.treeNode = {
indent: treeRowData.level * treeIndent,
level: treeRowData.level
};
if (typeof treeRowData.expanded === 'boolean') {
data.treeNode.expanded = treeRowData.expanded;
// 表明是懒加载
if ('loading' in treeRowData) {
data.treeNode.loading = treeRowData.loading;
}
if ('noLazyChildren' in treeRowData) {
data.treeNode.noLazyChildren = treeRowData.noLazyChildren;
}
}
}
return (
<td
style={ this.getCellStyle($index, cellIndex, row, column) }
class={ this.getCellClass($index, cellIndex, row, column) }
rowspan={ rowspan }
colspan={ colspan }
on-mouseenter={ ($event) => this.handleCellMouseEnter($event, row) }
on-mouseleave={ this.handleCellMouseLeave }>
{
column.renderCell.call(
this._renderProxy,
this.$createElement,
data,
columnsHidden[cellIndex]
)
}
</td>
);
})
}
</tr>);
const height = this.getRowHeight($index);
const heightStyle = height ? {
height
} : null;
return (
<TableRow
style={[displayStyle, this.getRowStyle(row, $index), heightStyle]}
class={rowClasses}
key={this.getKeyOfRow(row, $index)}
nativeOn-dblclick={($event) => this.handleDoubleClick($event, row)}
nativeOn-click={($event) => this.handleClick($event, row)}
nativeOn-contextmenu={($event) => this.handleContextMenu($event, row)}
nativeOn-mouseenter={_ => this.handleMouseEnter($index)}
nativeOn-mouseleave={this.handleMouseLeave}
columns={columns}
row={row}
index={$index}
store={this.store}
context={this.context || this.table.$vnode.context}
firstDefaultColumnIndex={firstDefaultColumnIndex}
treeRowData={treeRowData}
treeIndent={treeIndent}
columnsHidden={this.columnsHidden}
getSpan={this.getSpan}
getColspanRealWidth={this.getColspanRealWidth}
getCellStyle={this.getCellStyle}
getCellClass={this.getCellClass}
handleCellMouseEnter={this.handleCellMouseEnter}
handleCellMouseLeave={this.handleCellMouseLeave}
isSelected={isSelected}
isExpanded={isExpanded}
fixed={this.fixed}
>
</TableRow>
);
},
wrappedRowRender(row, $index) {
wrappedRowRender({ row, $index, isSelected, isExpanded }) {
const store = this.store;
const { isRowExpanded, assertRowKey } = store;
const { treeData, lazyTreeNodeMap, childrenColumnName, rowKey } = store.states;
if (this.hasExpandColumn && isRowExpanded(row)) {
const renderExpanded = this.table.renderExpanded;
const tr = this.rowRender(row, $index);
const tr = this.rowRender({ row, $index, isSelected, isExpanded });
if (!renderExpanded) {
console.error('[Element Error]renderExpanded is required.');
return tr;
@ -430,7 +429,7 @@ export default {
treeRowData.loading = cur.loading;
}
}
const tmp = [this.rowRender(row, $index, treeRowData)];
const tmp = [this.rowRender({ row, $index, treeRowData, isSelected, isExpanded })];
// 渲染嵌套数据
if (cur) {
// currentRow 记录的是 index所以还需主动增加 TreeTable 的 index
@ -464,7 +463,7 @@ export default {
}
}
i++;
tmp.push(this.rowRender(node, $index + i, innerTreeRowData));
tmp.push(this.rowRender({ row: node, $index: $index + i, treeRowData: innerTreeRowData, isSelected, isExpanded }));
if (cur) {
const nodes = lazyTreeNodeMap[childKey] || node[childrenColumnName];
traverse(nodes, cur);
@ -478,7 +477,7 @@ export default {
}
return tmp;
} else {
return this.rowRender(row, $index);
return this.rowRender({ row, $index, isSelected, isExpanded });
}
}
}

View File

@ -291,8 +291,7 @@ export default {
return classes.join(' ');
},
toggleAllSelection(event) {
event.stopPropagation();
toggleAllSelection() {
this.store.commit('toggleAllSelection');
},

View File

@ -25,6 +25,7 @@ class TableLayout {
this.bodyHeight = null; // Table Height - Table Header Height
this.fixedBodyHeight = null; // Table Height - Table Header Height - Scroll Bar Height
this.gutterWidth = scrollbarWidth();
this.fixedColumnsBodyRowsHeight = {};
for (let name in options) {
if (options.hasOwnProperty(name)) {
@ -113,11 +114,40 @@ class TableLayout {
const noData = !(this.store.states.data && this.store.states.data.length);
this.viewportHeight = this.scrollX ? tableHeight - (noData ? 0 : this.gutterWidth) : tableHeight;
setTimeout(() => {
this.syncFixedTableRowHeight();
});
this.updateScrollY();
this.notifyObservers('scrollable');
}
syncFixedTableRowHeight() {
const fixedColumns = this.store.states.fixedColumns;
const rightFixedColumns = this.store.states.rightFixedColumns;
if (fixedColumns.length + rightFixedColumns.length === 0) {
return;
}
const { bodyWrapper } = this.table.$refs;
const tableRect = bodyWrapper.getBoundingClientRect();
if (tableRect.height !== undefined && tableRect.height <= 0) {
return;
}
const bodyRows = bodyWrapper.querySelectorAll('.el-table__row') || [];
const fixedColumnsBodyRowsHeight = [].reduce.call(
bodyRows,
(acc, row, index) => {
const height =
row.getBoundingClientRect().height || 'auto';
acc[index] = height;
return acc;
},
{}
);
this.fixedColumnsBodyRowsHeight = fixedColumnsBodyRowsHeight;
};
headerDisplayNone(elm) {
if (!elm) return true;
let headerChild = elm;

View File

@ -0,0 +1,100 @@
export default {
name: 'ElTableRow',
props: [
'columns',
'row',
'index',
'isSelected',
'isExpanded',
'store',
'context',
'firstDefaultColumnIndex',
'treeRowData',
'treeIndent',
'columnsHidden',
'getSpan',
'getColspanRealWidth',
'getCellStyle',
'getCellClass',
'handleCellMouseLeave',
'handleCellMouseEnter',
'fixed'
],
render() {
const {
columns,
row,
index: $index,
store,
context,
firstDefaultColumnIndex,
treeRowData,
treeIndent,
columnsHidden = [],
isSelected,
isExpanded
} = this;
return (
<tr>
{
columns.map((column, cellIndex) => {
if (columnsHidden[cellIndex] && this.fixed) {
return null;
}
const { rowspan, colspan } = this.getSpan(row, column, $index, cellIndex);
if (!rowspan || !colspan) {
return null;
}
const columnData = { ...column };
columnData.realWidth = this.getColspanRealWidth(columns, colspan, cellIndex);
const data = {
store,
isSelected,
isExpanded,
_self: context,
column: columnData,
row,
$index
};
if (cellIndex === firstDefaultColumnIndex && treeRowData) {
data.treeNode = {
indent: treeRowData.level * treeIndent,
level: treeRowData.level
};
if (typeof treeRowData.expanded === 'boolean') {
data.treeNode.expanded = treeRowData.expanded;
// 表明是懒加载
if ('loading' in treeRowData) {
data.treeNode.loading = treeRowData.loading;
}
if ('noLazyChildren' in treeRowData) {
data.treeNode.noLazyChildren = treeRowData.noLazyChildren;
}
}
}
return (
<td
style={this.getCellStyle($index, cellIndex, row, column)}
class={this.getCellClass($index, cellIndex, row, column)}
rowspan={rowspan}
colspan={colspan}
on-mouseenter={($event) => this.handleCellMouseEnter($event, row)}
on-mouseleave={this.handleCellMouseLeave}
>
{
column.renderCell.call(
this._renderProxy,
this.$createElement,
data,
columnsHidden[cellIndex]
)
}
</td>
);
})
}
</tr>
);
}
};

View File

@ -115,7 +115,7 @@
:row-class-name="rowClassName"
:row-style="rowStyle"
:style="{
width: bodyWidth
width: layout.fixedWidth ? layout.fixedWidth + 'px' : ''
}">
</table-body>
<div
@ -176,7 +176,7 @@
:row-style="rowStyle"
:highlight="highlightCurrentRow"
:style="{
width: bodyWidth
width: layout.rightFixedWidth ? layout.rightFixedWidth + 'px' : '',
}">
</table-body>
<div

View File

@ -1,15 +1,15 @@
'use strict';
const { series, src, dest } = require('gulp');
const sass = require('gulp-sass');
const sass = require('gulp-dart-sass');
const autoprefixer = require('gulp-autoprefixer');
const cssmin = require('gulp-cssmin');
function compile() {
return src('./src/*.scss')
.pipe(sass.sync())
.pipe(sass.sync().on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['ie > 9', 'last 2 versions'],
overrideBrowserslist: ['ie > 9', 'last 2 versions'],
cascade: false
}))
.pipe(cssmin())

View File

@ -1,6 +1,6 @@
{
"name": "element-theme-chalk",
"version": "2.15.6",
"version": "2.15.7",
"description": "Element component chalk theme.",
"main": "lib/index.css",
"style": "lib/index.css",
@ -28,7 +28,7 @@
"devDependencies": {
"gulp": "^3.9.1",
"gulp-cssmin": "^0.1.7",
"gulp-sass": "^3.1.0",
"gulp-dart-sass": "^1.0.2",
"gulp-autoprefixer": "^4.0.0"
},
"dependencies": {}

View File

@ -1,3 +1,4 @@
@use "sass:math";
@import "mixins/mixins";
@import "common/var";
@ -22,7 +23,7 @@
@include when(fixed) {
position: absolute;
top: 0;
right: #{1 + $--badge-size / 2};
right: #{1 + math.div($--badge-size, 2)};
transform: translateY(-50%) translateX(100%);
@include when(dot) {

View File

@ -1,3 +1,4 @@
@use "sass:math";
@import "mixins/mixins";
@import "common/var";
@ -122,7 +123,7 @@
padding: $--carousel-indicator-padding-horizontal $--carousel-indicator-padding-vertical;
.el-carousel__button {
width: $--carousel-indicator-height;
height: #{$--carousel-indicator-width / 2};
height: #{math.div($--carousel-indicator-width, 2)};
}
}

View File

@ -1,3 +1,4 @@
@use "sass:math";
@import "./common/var.scss";
@import "./mixins/mixins.scss";
@ -12,21 +13,21 @@
@for $i from 0 through 24 {
.el-col-#{$i} {
width: (1 / 24 * $i * 100) * 1%;
width: (math.div(1 , 24) * $i * 100) * 1%;
}
.el-col-offset-#{$i} {
margin-left: (1 / 24 * $i * 100) * 1%;
margin-left: (math.div(1 , 24) * $i * 100) * 1%;
}
.el-col-pull-#{$i} {
position: relative;
right: (1 / 24 * $i * 100) * 1%;
right: (math.div(1 , 24) * $i * 100) * 1%;
}
.el-col-push-#{$i} {
position: relative;
left: (1 / 24 * $i * 100) * 1%;
left: (math.div(1 , 24) * $i * 100) * 1%;
}
}
@ -36,21 +37,21 @@
}
@for $i from 0 through 24 {
.el-col-xs-#{$i} {
width: (1 / 24 * $i * 100) * 1%;
width: (math.div(1 , 24) * $i * 100) * 1%;
}
.el-col-xs-offset-#{$i} {
margin-left: (1 / 24 * $i * 100) * 1%;
margin-left: (math.div(1 , 24) * $i * 100) * 1%;
}
.el-col-xs-pull-#{$i} {
position: relative;
right: (1 / 24 * $i * 100) * 1%;
right: (math.div(1 , 24) * $i * 100) * 1%;
}
.el-col-xs-push-#{$i} {
position: relative;
left: (1 / 24 * $i * 100) * 1%;
left: (math.div(1 , 24) * $i * 100) * 1%;
}
}
}
@ -61,21 +62,21 @@
}
@for $i from 0 through 24 {
.el-col-sm-#{$i} {
width: (1 / 24 * $i * 100) * 1%;
width: (math.div(1 , 24) * $i * 100) * 1%;
}
.el-col-sm-offset-#{$i} {
margin-left: (1 / 24 * $i * 100) * 1%;
margin-left: (math.div(1 , 24) * $i * 100) * 1%;
}
.el-col-sm-pull-#{$i} {
position: relative;
right: (1 / 24 * $i * 100) * 1%;
right: (math.div(1 , 24) * $i * 100) * 1%;
}
.el-col-sm-push-#{$i} {
position: relative;
left: (1 / 24 * $i * 100) * 1%;
left: (math.div(1 , 24) * $i * 100) * 1%;
}
}
}
@ -86,21 +87,21 @@
}
@for $i from 0 through 24 {
.el-col-md-#{$i} {
width: (1 / 24 * $i * 100) * 1%;
width: (math.div(1 , 24) * $i * 100) * 1%;
}
.el-col-md-offset-#{$i} {
margin-left: (1 / 24 * $i * 100) * 1%;
margin-left: (math.div(1 , 24) * $i * 100) * 1%;
}
.el-col-md-pull-#{$i} {
position: relative;
right: (1 / 24 * $i * 100) * 1%;
right: (math.div(1 , 24) * $i * 100) * 1%;
}
.el-col-md-push-#{$i} {
position: relative;
left: (1 / 24 * $i * 100) * 1%;
left: (math.div(1 , 24) * $i * 100) * 1%;
}
}
}
@ -111,21 +112,21 @@
}
@for $i from 0 through 24 {
.el-col-lg-#{$i} {
width: (1 / 24 * $i * 100) * 1%;
width: (math.div(1 , 24) * $i * 100) * 1%;
}
.el-col-lg-offset-#{$i} {
margin-left: (1 / 24 * $i * 100) * 1%;
margin-left: (math.div(1 , 24) * $i * 100) * 1%;
}
.el-col-lg-pull-#{$i} {
position: relative;
right: (1 / 24 * $i * 100) * 1%;
right: (math.div(1 , 24) * $i * 100) * 1%;
}
.el-col-lg-push-#{$i} {
position: relative;
left: (1 / 24 * $i * 100) * 1%;
left: (math.div(1 , 24) * $i * 100) * 1%;
}
}
}
@ -136,21 +137,21 @@
}
@for $i from 0 through 24 {
.el-col-xl-#{$i} {
width: (1 / 24 * $i * 100) * 1%;
width: (math.div(1 , 24) * $i * 100) * 1%;
}
.el-col-xl-offset-#{$i} {
margin-left: (1 / 24 * $i * 100) * 1%;
margin-left: (math.div(1 , 24) * $i * 100) * 1%;
}
.el-col-xl-pull-#{$i} {
position: relative;
right: (1 / 24 * $i * 100) * 1%;
right: (math.div(1 , 24) * $i * 100) * 1%;
}
.el-col-xl-push-#{$i} {
position: relative;
left: (1 / 24 * $i * 100) * 1%;
left: (math.div(1 , 24) * $i * 100) * 1%;
}
}
}

View File

@ -1,3 +1,4 @@
@use "sass:math";
/* Element Chalk Variables */
// Special comment for theme configurator
@ -486,7 +487,7 @@ $--cascader-tag-background: #f0f2f5;
/* Group
-------------------------- */
$--group-option-flex: 0 0 (1/5) * 100% !default;
$--group-option-flex: 0 0 math.div(1, 5) * 100% !default;
$--group-option-offset-bottom: 12px !default;
$--group-option-fill-hover: rgba($--color-black, 0.06) !default;
$--group-title-color: $--color-black !default;

View File

@ -2,9 +2,19 @@
@import 'common/var';
@include b(descriptions-item) {
vertical-align: top;
@include e(container) {
display: flex;
.el-descriptions-item__label,
.el-descriptions-item__content {
display: inline-flex;
align-items: baseline;
}
.el-descriptions-item__content {
flex: 1;
}
}
@include e(label) {
@ -20,13 +30,13 @@
color: $--color-text-secondary;
background: $--descriptions-item-bordered-label-background;
}
&:not(.is-bordered-label) {
margin-right: 10px;
}
}
@include e(content) {
word-break: break-word;
overflow-wrap: break-word;
}
}

View File

@ -1,3 +1,4 @@
@use "sass:math";
@import "mixins/mixins";
@import "common/var";
@import "input";
@ -137,7 +138,7 @@
@include e((increase, decrease)) {
height: auto;
line-height: #{($--input-height - 2) / 2};
line-height: #{math.div($--input-height - 2, 2)};
[class*=el-icon] {
transform: scale(.8);
@ -161,19 +162,19 @@
&[class*=medium] {
[class*=increase], [class*=decrease] {
line-height: #{($--input-medium-height - 2) / 2};
line-height: #{math.div($--input-medium-height - 2, 2)};
}
}
&[class*=small] {
[class*=increase], [class*=decrease] {
line-height: #{($--input-small-height - 2) / 2};
line-height: #{math.div($--input-small-height - 2, 2)};
}
}
&[class*=mini] {
[class*=increase], [class*=decrease] {
line-height: #{($--input-mini-height - 2) / 2};
line-height: #{math.div($--input-mini-height - 2, 2)};
}
}
}

View File

@ -1,3 +1,4 @@
@use "sass:math";
@import "mixins/mixins";
@import "common/var";
@ -26,7 +27,7 @@
position: fixed;
.el-loading-spinner {
margin-top: #{- $--loading-fullscreen-spinner-size / 2};
margin-top: #{math.div(-$--loading-fullscreen-spinner-size, 2)};
.circular {
height: $--loading-fullscreen-spinner-size;
@ -38,7 +39,7 @@
@include b(loading-spinner) {
top: 50%;
margin-top: #{- $--loading-spinner-size / 2};
margin-top: #{math.div(-$--loading-spinner-size, 2)};
width: 100%;
text-align: center;
position: absolute;

View File

@ -6,8 +6,17 @@
@mixin res($key, $map: $--breakpoints) {
// Map
@if map-has-key($map, $key) {
@media only screen and #{inspect(map-get($map, $key))} {
@content;
@if $key=='sm-only'or $key=='md-only'or $key=='lg-only' {
//
@media only screen and #{unquote(map-get($map, $key))} {
@content;
}
}
@else {
@media only screen and #{inspect(map-get($map, $key))} {
@content;
}
}
} @else {
@warn "Undefeined points: `#{$map}`";

View File

@ -1,3 +1,4 @@
@use "sass:math";
@import "mixins/mixins";
@import "common/var";
@ -29,7 +30,7 @@
&[x-placement^="top"] .popper__arrow {
bottom: -$--popover-arrow-size;
left: 50%;
margin-right: #{$--tooltip-arrow-size / 2};
margin-right: math.div($--tooltip-arrow-size, 2);
border-top-color: $--popover-border-color;
border-bottom-width: 0;
@ -48,7 +49,7 @@
&[x-placement^="bottom"] .popper__arrow {
top: -$--popover-arrow-size;
left: 50%;
margin-right: #{$--tooltip-arrow-size / 2};
margin-right: math.div($--tooltip-arrow-size, 2);
border-top-width: 0;
border-bottom-color: $--popover-border-color;
@ -67,7 +68,7 @@
&[x-placement^="right"] .popper__arrow {
top: 50%;
left: -$--popover-arrow-size;
margin-bottom: #{$--tooltip-arrow-size / 2};
margin-bottom: #{math.div($--tooltip-arrow-size , 2)};
border-right-color: $--popover-border-color;
border-left-width: 0;
@ -86,7 +87,7 @@
&[x-placement^="left"] .popper__arrow {
top: 50%;
right: -$--popover-arrow-size;
margin-bottom: #{$--tooltip-arrow-size / 2};
margin-bottom: #{math.div($--tooltip-arrow-size , 2)};
border-right-width: 0;
border-left-color: $--popover-border-color;

View File

@ -1,3 +1,4 @@
@use "sass:math";
@import "mixins/mixins";
@import "mixins/utils";
@import "common/var";
@ -138,7 +139,7 @@
font-size: 12px;
display: inline-block;
box-sizing: border-box;
border-radius: #{$--transfer-filter-height / 2};
border-radius: #{math.div($--transfer-filter-height, 2)};
padding-right: 10px;
padding-left: 30px;
}

View File

@ -210,7 +210,7 @@ if (typeof window !== 'undefined' && window.Vue) {
}
export default {
version: '2.15.6',
version: '2.15.7',
locale: locale.use,
i18n: locale.i18n,
install,

5081
yarn.lock

File diff suppressed because it is too large Load Diff