Skip to content

Commit 8a6eaa2

Browse files
committed
update version
1 parent c1a8e51 commit 8a6eaa2

24 files changed

+5247
-6226
lines changed

.eslintrc.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,16 @@ module.exports = {
1010
},
1111
parserOptions: {
1212
parser: "babel-eslint"
13-
}
13+
},
14+
overrides: [
15+
{
16+
files: [
17+
"**/__tests__/*.{j,t}s?(x)",
18+
"**/tests/unit/**/*.spec.{j,t}s?(x)"
19+
],
20+
env: {
21+
jest: true
22+
}
23+
}
24+
]
1425
};

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ $--simple-drawer-close-width: 50px;
124124
@import "~vue-simple-drawer/src/index";
125125
```
126126

127-
- import the scss to override the default theme in main.js (entry file) before you import the Draw component
127+
- import the scss to override the default theme in main.js (entry file) **after** you import the Draw component
128128

129129
```js
130-
import "./demo.scss"
130+
import "./demo.scss";
131131
```
132132

133133
> variables

babel.config.js

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
module.exports = {
2-
presets: [
3-
[
4-
"@vue/app",
5-
{
6-
useBuiltIns: false
7-
}
8-
]
9-
]
2+
presets: ["@vue/cli-plugin-babel/preset"]
103
};

coverage/clover.xml

+3-18
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<coverage generated="1555944344621" clover="3.2.0">
3-
<project timestamp="1555944344621" name="All files">
4-
<metrics statements="11" coveredstatements="11" conditionals="5" coveredconditionals="4" methods="1" coveredmethods="1" elements="17" coveredelements="16" complexity="0" loc="11" ncloc="11" packages="1" files="1" classes="1">
5-
<file name="index.vue" path="/Users/vincent/Documents/Vincent/vue-simple-drawer/src/index.vue">
6-
<metrics statements="11" coveredstatements="11" conditionals="5" coveredconditionals="4" methods="1" coveredmethods="1"/>
7-
<line num="39" count="8" type="stmt"/>
8-
<line num="57" count="7" type="stmt"/>
9-
<line num="62" count="8" type="stmt"/>
10-
<line num="72" count="2" type="stmt"/>
11-
<line num="75" count="2" type="cond" truecount="2" falsecount="0"/>
12-
<line num="76" count="1" type="stmt"/>
13-
<line num="80" count="16" type="stmt"/>
14-
<line num="87" count="8" type="stmt"/>
15-
<line num="90" count="8" type="stmt"/>
16-
<line num="93" count="1" type="stmt"/>
17-
<line num="96" count="8" type="cond" truecount="1" falsecount="1"/>
18-
</file>
19-
</metrics>
2+
<coverage generated="1575610253573" clover="3.2.0">
3+
<project timestamp="1575610253573" name="All files">
4+
<metrics statements="0" coveredstatements="0" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0" elements="0" coveredelements="0" complexity="0" loc="0" ncloc="0" packages="0" files="0" classes="0"/>
205
</project>
216
</coverage>

coverage/coverage-final.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
{"/Users/vincent/Documents/Vincent/vue-simple-drawer/src/index.vue": {"path":"/Users/vincent/Documents/Vincent/vue-simple-drawer/src/index.vue","statementMap":{"0":{"start":{"line":39,"column":0},"end":{"line":null,"column":-1}},"1":{"start":{"line":57,"column":0},"end":{"line":null,"column":-1}},"2":{"start":{"line":62,"column":0},"end":{"line":null,"column":-1}},"3":{"start":{"line":72,"column":0},"end":{"line":null,"column":-1}},"4":{"start":{"line":75,"column":0},"end":{"line":77,"column":0}},"5":{"start":{"line":76,"column":0},"end":{"line":null,"column":-1}},"6":{"start":{"line":80,"column":0},"end":{"line":null,"column":-1}},"7":{"start":{"line":87,"column":0},"end":{"line":null,"column":-1}},"8":{"start":{"line":90,"column":0},"end":{"line":null,"column":-1}},"9":{"start":{"line":93,"column":0},"end":{"line":null,"column":-1}},"10":{"start":{"line":96,"column":0},"end":{"line":null,"column":-1}}},"fnMap":{"0":{"name":"(anonymous_1)","decl":{"start":{"line":37,"column":0},"end":{"line":null,"column":-1}},"loc":{"start":{"line":37,"column":0},"end":{"line":40,"column":0}}}},"branchMap":{"0":{"loc":{"start":{"line":75,"column":0},"end":{"line":77,"column":0}},"type":"if","locations":[{"start":{"line":75,"column":0},"end":{"line":77,"column":0}},{"start":{"line":75,"column":0},"end":{"line":77,"column":0}}]},"1":{"loc":{"start":{"line":79,"column":0},"end":{"line":null,"column":-1}},"type":"default-arg","locations":[{"start":{"line":79,"column":0},"end":{"line":null,"column":-1}}]},"2":{"loc":{"start":{"line":96,"column":0},"end":{"line":null,"column":-1}},"type":"binary-expr","locations":[{"start":{"line":96,"column":0},"end":{"line":null,"column":-1}},{"start":{"line":96,"column":0},"end":{"line":null,"column":-1}}]}},"s":{"0":8,"1":7,"2":8,"3":2,"4":2,"5":1,"6":16,"7":8,"8":8,"9":1,"10":8},"f":{"0":8},"b":{"0":[1,1],"1":[16],"2":[8,0]}}
2-
}
1+
{}

coverage/lcov-report/base.css

+19-7
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,15 @@ table.coverage td span.cline-any {
152152
background-position: 0 -10px;
153153
}
154154
.status-line { height: 10px; }
155+
/* yellow */
156+
.cbranch-no { background: yellow !important; color: #111; }
155157
/* dark red */
156158
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
157159
.low .chart { border:1px solid #C21F39 }
160+
.highlighted,
161+
.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{
162+
background: #C21F39 !important;
163+
}
158164
/* medium red */
159165
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
160166
/* light red */
@@ -166,19 +172,25 @@ table.coverage td span.cline-any {
166172
/* dark green */
167173
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
168174
.high .chart { border:1px solid rgb(77,146,33) }
169-
170-
171-
.medium .chart { border:1px solid #666; }
172-
.medium .cover-fill { background: #666; }
173-
174-
.cbranch-no { background: yellow !important; color: #111; }
175+
/* dark yellow (gold) */
176+
.status-line.medium, .medium .cover-fill { background: #f9cd0b; }
177+
.medium .chart { border:1px solid #f9cd0b; }
178+
/* light yellow */
179+
.medium { background: #fff4c2; }
175180

176181
.cstat-skip { background: #ddd; color: #111; }
177182
.fstat-skip { background: #ddd; color: #111 !important; }
178183
.cbranch-skip { background: #ddd !important; color: #111; }
179184

180185
span.cline-neutral { background: #eaeaea; }
181-
.medium { background: #eaeaea; }
186+
187+
.coverage-summary td.empty {
188+
opacity: .5;
189+
padding-top: 4px;
190+
padding-bottom: 4px;
191+
line-height: 1;
192+
color: #888;
193+
}
182194

183195
.cover-fill, .cover-empty {
184196
display:inline-block;
+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/* eslint-disable */
2+
var jumpToCode = (function init() {
3+
// Classes of code we would like to highlight in the file view
4+
var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no'];
5+
6+
// Elements to highlight in the file listing view
7+
var fileListingElements = ['td.pct.low'];
8+
9+
// We don't want to select elements that are direct descendants of another match
10+
var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
11+
12+
// Selecter that finds elements on the page to which we can jump
13+
var selector =
14+
fileListingElements.join(', ') +
15+
', ' +
16+
notSelector +
17+
missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b`
18+
19+
// The NodeList of matching elements
20+
var missingCoverageElements = document.querySelectorAll(selector);
21+
22+
var currentIndex;
23+
24+
function toggleClass(index) {
25+
missingCoverageElements
26+
.item(currentIndex)
27+
.classList.remove('highlighted');
28+
missingCoverageElements.item(index).classList.add('highlighted');
29+
}
30+
31+
function makeCurrent(index) {
32+
toggleClass(index);
33+
currentIndex = index;
34+
missingCoverageElements.item(index).scrollIntoView({
35+
behavior: 'smooth',
36+
block: 'center',
37+
inline: 'center'
38+
});
39+
}
40+
41+
function goToPrevious() {
42+
var nextIndex = 0;
43+
if (typeof currentIndex !== 'number' || currentIndex === 0) {
44+
nextIndex = missingCoverageElements.length - 1;
45+
} else if (missingCoverageElements.length > 1) {
46+
nextIndex = currentIndex - 1;
47+
}
48+
49+
makeCurrent(nextIndex);
50+
}
51+
52+
function goToNext() {
53+
var nextIndex = 0;
54+
55+
if (
56+
typeof currentIndex === 'number' &&
57+
currentIndex < missingCoverageElements.length - 1
58+
) {
59+
nextIndex = currentIndex + 1;
60+
}
61+
62+
makeCurrent(nextIndex);
63+
}
64+
65+
return function jump(event) {
66+
switch (event.which) {
67+
case 78: // n
68+
case 74: // j
69+
goToNext();
70+
break;
71+
case 66: // b
72+
case 75: // k
73+
case 80: // p
74+
goToPrevious();
75+
break;
76+
}
77+
};
78+
})();
79+
window.addEventListener('keydown', jumpToCode);

coverage/lcov-report/index.html

+15-24
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,31 @@ <h1>
2020
</h1>
2121
<div class='clearfix'>
2222
<div class='fl pad1y space-right2'>
23-
<span class="strong">100% </span>
23+
<span class="strong">Unknown% </span>
2424
<span class="quiet">Statements</span>
25-
<span class='fraction'>11/11</span>
25+
<span class='fraction'>0/0</span>
2626
</div>
2727
<div class='fl pad1y space-right2'>
28-
<span class="strong">80% </span>
28+
<span class="strong">Unknown% </span>
2929
<span class="quiet">Branches</span>
30-
<span class='fraction'>4/5</span>
30+
<span class='fraction'>0/0</span>
3131
</div>
3232
<div class='fl pad1y space-right2'>
33-
<span class="strong">100% </span>
33+
<span class="strong">Unknown% </span>
3434
<span class="quiet">Functions</span>
35-
<span class='fraction'>1/1</span>
35+
<span class='fraction'>0/0</span>
3636
</div>
3737
<div class='fl pad1y space-right2'>
38-
<span class="strong">100% </span>
38+
<span class="strong">Unknown% </span>
3939
<span class="quiet">Lines</span>
40-
<span class='fraction'>11/11</span>
40+
<span class='fraction'>0/0</span>
4141
</div>
4242
</div>
43+
<p class="quiet">
44+
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
45+
</p>
4346
</div>
44-
<div class='status-line high'></div>
47+
<div class='status-line medium'></div>
4548
<div class="pad1">
4649
<table class="coverage-summary">
4750
<thead>
@@ -58,26 +61,13 @@ <h1>
5861
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
5962
</tr>
6063
</thead>
61-
<tbody><tr>
62-
<td class="file high" data-value="index.vue"><a href="index.vue.html">index.vue</a></td>
63-
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
64-
<td data-value="100" class="pct high">100%</td>
65-
<td data-value="11" class="abs high">11/11</td>
66-
<td data-value="80" class="pct high">80%</td>
67-
<td data-value="5" class="abs high">4/5</td>
68-
<td data-value="100" class="pct high">100%</td>
69-
<td data-value="1" class="abs high">1/1</td>
70-
<td data-value="100" class="pct high">100%</td>
71-
<td data-value="11" class="abs high">11/11</td>
72-
</tr>
73-
74-
</tbody>
64+
<tbody></tbody>
7565
</table>
7666
</div><div class='push'></div><!-- for sticky footer -->
7767
</div><!-- /wrapper -->
7868
<div class='footer quiet pad2 space-top1 center small'>
7969
Code coverage
80-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Mon Apr 22 2019 22:45:44 GMT+0800 (China Standard Time)
70+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri Dec 06 2019 13:30:53 GMT+0800 (China Standard Time)
8171
</div>
8272
</div>
8373
<script src="prettify.js"></script>
@@ -89,5 +79,6 @@ <h1>
8979
};
9080
</script>
9181
<script src="sorter.js"></script>
82+
<script src="block-navigation.js"></script>
9283
</body>
9384
</html>

coverage/lcov-report/prettify.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coverage/lcov-report/sorter.js

+26-14
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
1-
var addSorting = (function () {
2-
"use strict";
1+
/* eslint-disable */
2+
var addSorting = (function() {
3+
'use strict';
34
var cols,
45
currentSort = {
56
index: 0,
67
desc: false
78
};
89

910
// returns the summary table element
10-
function getTable() { return document.querySelector('.coverage-summary'); }
11+
function getTable() {
12+
return document.querySelector('.coverage-summary');
13+
}
1114
// returns the thead element of the summary table
12-
function getTableHeader() { return getTable().querySelector('thead tr'); }
15+
function getTableHeader() {
16+
return getTable().querySelector('thead tr');
17+
}
1318
// returns the tbody element of the summary table
14-
function getTableBody() { return getTable().querySelector('tbody'); }
19+
function getTableBody() {
20+
return getTable().querySelector('tbody');
21+
}
1522
// returns the th element for nth column
16-
function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; }
23+
function getNthColumn(n) {
24+
return getTableHeader().querySelectorAll('th')[n];
25+
}
1726

1827
// loads all columns
1928
function loadColumns() {
@@ -33,7 +42,8 @@ var addSorting = (function () {
3342
cols.push(col);
3443
if (col.sortable) {
3544
col.defaultDescSort = col.type === 'number';
36-
colNode.innerHTML = colNode.innerHTML + '<span class="sorter"></span>';
45+
colNode.innerHTML =
46+
colNode.innerHTML + '<span class="sorter"></span>';
3747
}
3848
}
3949
return cols;
@@ -70,7 +80,7 @@ var addSorting = (function () {
7080
// sorts the table using the data for the ith column
7181
function sortByIndex(index, desc) {
7282
var key = cols[index].key,
73-
sorter = function (a, b) {
83+
sorter = function(a, b) {
7484
a = a.data[key];
7585
b = b.data[key];
7686
return a < b ? -1 : a > b ? 1 : 0;
@@ -82,7 +92,7 @@ var addSorting = (function () {
8292
i;
8393

8494
if (desc) {
85-
finalSorter = function (a, b) {
95+
finalSorter = function(a, b) {
8696
return -1 * sorter(a, b);
8797
};
8898
}
@@ -108,7 +118,9 @@ var addSorting = (function () {
108118
}
109119
// adds sort indicators for current column being sorted
110120
function addSortIndicators() {
111-
getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted';
121+
getNthColumn(currentSort.index).className += currentSort.desc
122+
? ' sorted-desc'
123+
: ' sorted';
112124
}
113125
// adds event listeners for all sorter widgets
114126
function enableUI() {
@@ -117,7 +129,7 @@ var addSorting = (function () {
117129
ithSorter = function ithSorter(i) {
118130
var col = cols[i];
119131

120-
return function () {
132+
return function() {
121133
var desc = col.defaultDescSort;
122134

123135
if (currentSort.index === i) {
@@ -130,7 +142,7 @@ var addSorting = (function () {
130142
addSortIndicators();
131143
};
132144
};
133-
for (i =0 ; i < cols.length; i += 1) {
145+
for (i = 0; i < cols.length; i += 1) {
134146
if (cols[i].sortable) {
135147
// add the click event handler on the th so users
136148
// dont have to click on those tiny arrows
@@ -144,12 +156,12 @@ var addSorting = (function () {
144156
}
145157
}
146158
// adds sorting functionality to the UI
147-
return function () {
159+
return function() {
148160
if (!getTable()) {
149161
return;
150162
}
151163
cols = loadColumns();
152-
loadData(cols);
164+
loadData();
153165
addSortIndicators();
154166
enableUI();
155167
};

0 commit comments

Comments
 (0)