@madgex/design-system 1.29.0 → 1.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__tests__/unit/src/components/popover.spec.js +78 -0
- package/__tests__/unit/src/components/switch-state.spec.js +11 -11
- package/coverage/cobertura-coverage.xml +78 -3
- package/coverage/components/accordion/accordion.js.html +1 -1
- package/coverage/components/accordion/index.html +1 -1
- package/coverage/components/popover/index.html +97 -0
- package/coverage/components/popover/popover.js.html +246 -0
- package/coverage/components/switch-state/index.html +1 -1
- package/coverage/components/switch-state/switch-state.js.html +7 -7
- package/coverage/components/tabs/index.html +1 -1
- package/coverage/components/tabs/tabs.js.html +1 -1
- package/coverage/index.html +24 -11
- package/coverage/js/common.js.html +1 -1
- package/coverage/js/fractal-scripts/index.html +1 -1
- package/coverage/js/fractal-scripts/switch-state.js.html +6 -6
- package/coverage/js/index-fractal.js.html +1 -1
- package/coverage/js/index-polyfills.js.html +1 -1
- package/coverage/js/index.html +5 -5
- package/coverage/js/index.js.html +10 -4
- package/coverage/js/polyfills/closest.js.html +1 -1
- package/coverage/js/polyfills/index.html +1 -1
- package/coverage/tokens/_config.js.html +1 -1
- package/coverage/tokens/index.html +1 -1
- package/dist/_tokens/css/_tokens.css +11 -10
- package/dist/_tokens/js/_tokens-module.js +35 -16
- package/dist/_tokens/scss/_tokens.scss +14 -10
- package/dist/css/index.css +1 -1
- package/dist/js/index.js +27 -2
- package/gulpfile.js +1 -1
- package/package.json +2 -1
- package/src/components/popover/README.md +21 -0
- package/src/components/popover/_macro.njk +3 -0
- package/src/components/popover/_template.njk +19 -0
- package/src/components/popover/popover.config.js +30 -0
- package/src/components/popover/popover.js +59 -0
- package/src/components/popover/popover.njk +13 -0
- package/src/components/popover/popover.scss +116 -0
- package/src/components/switch-state/README.md +4 -4
- package/src/components/switch-state/_template.njk +3 -3
- package/src/components/switch-state/switch-state.config.js +4 -4
- package/src/components/switch-state/switch-state.js +6 -6
- package/src/components/switch-state/switch-state.njk +4 -4
- package/src/components/switch-state/switch-state.scss +2 -2
- package/src/js/fractal-scripts/switch-state.js +5 -5
- package/src/js/index.js +2 -0
- package/src/scss/components/__index.scss +2 -1
- package/src/tokens/color.json +11 -6
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import popovers from '../../../../src/components/popover/popover';
|
|
2
|
+
|
|
3
|
+
// Avoid document.createRange not defined error
|
|
4
|
+
if (window.document) {
|
|
5
|
+
window.document.createRange = () => ({
|
|
6
|
+
setStart: () => {},
|
|
7
|
+
setEnd: () => {},
|
|
8
|
+
commonAncestorContainer: {
|
|
9
|
+
nodeName: 'BODY',
|
|
10
|
+
ownerDocument: document,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
document.body.innerHTML = `<button id="test" class="js-mds-popover-trigger">Trigger</button><div id="test-content" class="mds-popover"></div>`;
|
|
16
|
+
const trigger = document.getElementById('test');
|
|
17
|
+
const popover = document.getElementById('test-content');
|
|
18
|
+
const popoverActiveClass = 'mds-popover--active';
|
|
19
|
+
|
|
20
|
+
beforeEach(() => {
|
|
21
|
+
popovers.init();
|
|
22
|
+
popover.classList.remove(popoverActiveClass);
|
|
23
|
+
});
|
|
24
|
+
afterEach(() => {
|
|
25
|
+
document.body.innerHTML = '';
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
describe('setAriaAttr function - Set correct aria attributes on trigger and popover', () => {
|
|
31
|
+
|
|
32
|
+
it('popover is active', async () => {
|
|
33
|
+
popover.classList.add(popoverActiveClass);
|
|
34
|
+
expect.assertions(2);
|
|
35
|
+
popovers.setAriaAttr(trigger, popover, popoverActiveClass);
|
|
36
|
+
expect(trigger.getAttribute('aria-expanded')).toBe('true');
|
|
37
|
+
expect(popover.hasAttribute('aria-hidden')).toBe(false);
|
|
38
|
+
});
|
|
39
|
+
it('popover is not active', async () => {
|
|
40
|
+
expect.assertions(2);
|
|
41
|
+
popovers.setAriaAttr(trigger, popover, popoverActiveClass);
|
|
42
|
+
expect(trigger.getAttribute('aria-expanded')).toBe('false');
|
|
43
|
+
expect(popover.getAttribute('aria-hidden')).toBe('true');
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
describe('hide function', () => {
|
|
48
|
+
const targetElement = document.createElement('p');
|
|
49
|
+
const popoverInstance = {
|
|
50
|
+
popper: popover,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
it('remove active class from popover', async () => {
|
|
54
|
+
popover.classList.add(popoverActiveClass);
|
|
55
|
+
expect.assertions(1);
|
|
56
|
+
popovers.hide(trigger, popover, popoverInstance, popoverActiveClass, targetElement);
|
|
57
|
+
expect(popover.classList.contains(popoverActiveClass)).toBe(false);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
describe('display popover when clicking on trigger', () => {
|
|
62
|
+
|
|
63
|
+
it('adds active class', async () => {
|
|
64
|
+
expect.assertions(1);
|
|
65
|
+
trigger.click();
|
|
66
|
+
expect(popover.classList.contains(popoverActiveClass)).toBe(true);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
describe('hide active popover when clicking anywhere else on the page', () => {
|
|
71
|
+
|
|
72
|
+
it('removes active class', async () => {
|
|
73
|
+
expect.assertions(1);
|
|
74
|
+
trigger.click();
|
|
75
|
+
document.dispatchEvent(new Event('mousedown'));
|
|
76
|
+
expect(popover.classList.contains(popoverActiveClass)).toBe(false);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
@@ -2,20 +2,20 @@ import switchState from '../../../../src/components/switch-state/switch-state';
|
|
|
2
2
|
|
|
3
3
|
describe('Switch State', () => {
|
|
4
4
|
let element = document.createElement('div');
|
|
5
|
-
element.innerHTML = `<button class="mds-switch-state js-mds-switch-state mds-switch-state--
|
|
6
|
-
<span class="mds-switch-state--
|
|
7
|
-
<span class="mds-switch-state--
|
|
5
|
+
element.innerHTML = `<button class="mds-switch-state js-mds-switch-state mds-switch-state--default">
|
|
6
|
+
<span class="mds-switch-state--default">this is default</span>
|
|
7
|
+
<span class="mds-switch-state--inverse">this is inverse</span>
|
|
8
8
|
</button>`;
|
|
9
|
-
it('
|
|
9
|
+
it('setToinverse to be true', async () => {
|
|
10
10
|
expect.assertions(2);
|
|
11
|
-
switchState.
|
|
12
|
-
expect(element.classList.contains('mds-switch-state--
|
|
13
|
-
expect(element.classList.contains('mds-switch-state--
|
|
11
|
+
switchState.switchToinverse(element);
|
|
12
|
+
expect(element.classList.contains('mds-switch-state--inverse')).toBe(true);
|
|
13
|
+
expect(element.classList.contains('mds-switch-state--default')).toBe(false);
|
|
14
14
|
});
|
|
15
|
-
it('
|
|
15
|
+
it('setTodefault to be true', async () => {
|
|
16
16
|
expect.assertions(2);
|
|
17
|
-
switchState.
|
|
18
|
-
expect(element.classList.contains('mds-switch-state--
|
|
19
|
-
expect(element.classList.contains('mds-switch-state--
|
|
17
|
+
switchState.switchTodefault(element);
|
|
18
|
+
expect(element.classList.contains('mds-switch-state--default')).toBe(true);
|
|
19
|
+
expect(element.classList.contains('mds-switch-state--inverse')).toBe(false);
|
|
20
20
|
});
|
|
21
21
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" ?>
|
|
2
2
|
<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
|
|
3
|
-
<coverage lines-valid="
|
|
3
|
+
<coverage lines-valid="227" lines-covered="85" line-rate="0.37439999999999996" branches-valid="58" branches-covered="18" branch-rate="0.3103" timestamp="1575041577289" complexity="0" version="0.1">
|
|
4
4
|
<sources>
|
|
5
5
|
<source>/var/lib/jenkins/jobs/madgex-design-system/branches/master/workspace</source>
|
|
6
6
|
</sources>
|
|
@@ -125,6 +125,80 @@
|
|
|
125
125
|
</class>
|
|
126
126
|
</classes>
|
|
127
127
|
</package>
|
|
128
|
+
<package name="components.popover" line-rate="0.9655" branch-rate="0.8181999999999999">
|
|
129
|
+
<classes>
|
|
130
|
+
<class name="popover.js" filename="src/components/popover/popover.js" line-rate="0.9655" branch-rate="0.8181999999999999">
|
|
131
|
+
<methods>
|
|
132
|
+
<method name="(anonymous_0)" hits="5" signature="()V">
|
|
133
|
+
<lines>
|
|
134
|
+
<line number="8" hits="5"/>
|
|
135
|
+
</lines>
|
|
136
|
+
</method>
|
|
137
|
+
<method name="(anonymous_1)" hits="1" signature="()V">
|
|
138
|
+
<lines>
|
|
139
|
+
<line number="11" hits="1"/>
|
|
140
|
+
</lines>
|
|
141
|
+
</method>
|
|
142
|
+
<method name="(anonymous_2)" hits="2" signature="()V">
|
|
143
|
+
<lines>
|
|
144
|
+
<line number="24" hits="2"/>
|
|
145
|
+
</lines>
|
|
146
|
+
</method>
|
|
147
|
+
<method name="(anonymous_3)" hits="1" signature="()V">
|
|
148
|
+
<lines>
|
|
149
|
+
<line number="30" hits="1"/>
|
|
150
|
+
</lines>
|
|
151
|
+
</method>
|
|
152
|
+
<method name="(anonymous_4)" hits="0" signature="()V">
|
|
153
|
+
<lines>
|
|
154
|
+
<line number="33" hits="0"/>
|
|
155
|
+
</lines>
|
|
156
|
+
</method>
|
|
157
|
+
<method name="(anonymous_5)" hits="2" signature="()V">
|
|
158
|
+
<lines>
|
|
159
|
+
<line number="38" hits="2"/>
|
|
160
|
+
</lines>
|
|
161
|
+
</method>
|
|
162
|
+
<method name="(anonymous_6)" hits="6" signature="()V">
|
|
163
|
+
<lines>
|
|
164
|
+
<line number="48" hits="6"/>
|
|
165
|
+
</lines>
|
|
166
|
+
</method>
|
|
167
|
+
</methods>
|
|
168
|
+
<lines>
|
|
169
|
+
<line number="4" hits="1" branch="false"/>
|
|
170
|
+
<line number="5" hits="1" branch="false"/>
|
|
171
|
+
<line number="7" hits="1" branch="false"/>
|
|
172
|
+
<line number="9" hits="5" branch="false"/>
|
|
173
|
+
<line number="11" hits="5" branch="false"/>
|
|
174
|
+
<line number="12" hits="1" branch="false"/>
|
|
175
|
+
<line number="13" hits="1" branch="false"/>
|
|
176
|
+
<line number="14" hits="1" branch="false"/>
|
|
177
|
+
<line number="16" hits="1" branch="true" condition-coverage="50% (1/2)"/>
|
|
178
|
+
<line number="17" hits="1" branch="false"/>
|
|
179
|
+
<line number="21" hits="1" branch="false"/>
|
|
180
|
+
<line number="22" hits="1" branch="false"/>
|
|
181
|
+
<line number="24" hits="1" branch="false"/>
|
|
182
|
+
<line number="25" hits="2" branch="false"/>
|
|
183
|
+
<line number="26" hits="2" branch="false"/>
|
|
184
|
+
<line number="27" hits="2" branch="false"/>
|
|
185
|
+
<line number="28" hits="2" branch="false"/>
|
|
186
|
+
<line number="30" hits="1" branch="false"/>
|
|
187
|
+
<line number="31" hits="1" branch="false"/>
|
|
188
|
+
<line number="33" hits="1" branch="false"/>
|
|
189
|
+
<line number="34" hits="0" branch="false"/>
|
|
190
|
+
<line number="39" hits="2" branch="true" condition-coverage="50% (1/2)"/>
|
|
191
|
+
<line number="44" hits="2" branch="false"/>
|
|
192
|
+
<line number="45" hits="2" branch="false"/>
|
|
193
|
+
<line number="49" hits="6" branch="true" condition-coverage="100% (2/2)"/>
|
|
194
|
+
<line number="50" hits="3" branch="false"/>
|
|
195
|
+
<line number="51" hits="3" branch="false"/>
|
|
196
|
+
<line number="53" hits="3" branch="false"/>
|
|
197
|
+
<line number="54" hits="3" branch="false"/>
|
|
198
|
+
</lines>
|
|
199
|
+
</class>
|
|
200
|
+
</classes>
|
|
201
|
+
</package>
|
|
128
202
|
<package name="components.switch-state" line-rate="1" branch-rate="1">
|
|
129
203
|
<classes>
|
|
130
204
|
<class name="switch-state.js" filename="src/components/switch-state/switch-state.js" line-rate="1" branch-rate="1">
|
|
@@ -408,14 +482,15 @@
|
|
|
408
482
|
<methods>
|
|
409
483
|
<method name="(anonymous_0)" hits="0" signature="()V">
|
|
410
484
|
<lines>
|
|
411
|
-
<line number="
|
|
485
|
+
<line number="16" hits="0"/>
|
|
412
486
|
</lines>
|
|
413
487
|
</method>
|
|
414
488
|
</methods>
|
|
415
489
|
<lines>
|
|
416
|
-
<line number="15" hits="0" branch="false"/>
|
|
417
490
|
<line number="16" hits="0" branch="false"/>
|
|
418
491
|
<line number="17" hits="0" branch="false"/>
|
|
492
|
+
<line number="18" hits="0" branch="false"/>
|
|
493
|
+
<line number="19" hits="0" branch="false"/>
|
|
419
494
|
</lines>
|
|
420
495
|
</class>
|
|
421
496
|
</classes>
|
|
@@ -385,7 +385,7 @@ export default accordion;
|
|
|
385
385
|
</div><!-- /wrapper -->
|
|
386
386
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
387
387
|
Code coverage
|
|
388
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
388
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri Nov 29 2019 15:32:57 GMT+0000 (GMT)
|
|
389
389
|
</div>
|
|
390
390
|
</div>
|
|
391
391
|
<script src="../../prettify.js"></script>
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
</div><!-- /wrapper -->
|
|
81
81
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
82
82
|
Code coverage
|
|
83
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
83
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri Nov 29 2019 15:32:57 GMT+0000 (GMT)
|
|
84
84
|
</div>
|
|
85
85
|
</div>
|
|
86
86
|
<script src="../../prettify.js"></script>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<title>Code coverage report for components/popover</title>
|
|
5
|
+
<meta charset="utf-8" />
|
|
6
|
+
<link rel="stylesheet" href="../../prettify.css" />
|
|
7
|
+
<link rel="stylesheet" href="../../base.css" />
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
+
<style type='text/css'>
|
|
10
|
+
.coverage-summary .sorter {
|
|
11
|
+
background-image: url(../../sort-arrow-sprite.png);
|
|
12
|
+
}
|
|
13
|
+
</style>
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<div class='wrapper'>
|
|
17
|
+
<div class='pad1'>
|
|
18
|
+
<h1>
|
|
19
|
+
<a href="../../index.html">All files</a> components/popover
|
|
20
|
+
</h1>
|
|
21
|
+
<div class='clearfix'>
|
|
22
|
+
<div class='fl pad1y space-right2'>
|
|
23
|
+
<span class="strong">96.55% </span>
|
|
24
|
+
<span class="quiet">Statements</span>
|
|
25
|
+
<span class='fraction'>28/29</span>
|
|
26
|
+
</div>
|
|
27
|
+
<div class='fl pad1y space-right2'>
|
|
28
|
+
<span class="strong">81.82% </span>
|
|
29
|
+
<span class="quiet">Branches</span>
|
|
30
|
+
<span class='fraction'>9/11</span>
|
|
31
|
+
</div>
|
|
32
|
+
<div class='fl pad1y space-right2'>
|
|
33
|
+
<span class="strong">85.71% </span>
|
|
34
|
+
<span class="quiet">Functions</span>
|
|
35
|
+
<span class='fraction'>6/7</span>
|
|
36
|
+
</div>
|
|
37
|
+
<div class='fl pad1y space-right2'>
|
|
38
|
+
<span class="strong">96.55% </span>
|
|
39
|
+
<span class="quiet">Lines</span>
|
|
40
|
+
<span class='fraction'>28/29</span>
|
|
41
|
+
</div>
|
|
42
|
+
</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>
|
|
46
|
+
</div>
|
|
47
|
+
<div class='status-line high'></div>
|
|
48
|
+
<div class="pad1">
|
|
49
|
+
<table class="coverage-summary">
|
|
50
|
+
<thead>
|
|
51
|
+
<tr>
|
|
52
|
+
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
|
53
|
+
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
|
54
|
+
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
|
55
|
+
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
56
|
+
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
|
57
|
+
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
58
|
+
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
|
59
|
+
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
60
|
+
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
|
61
|
+
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
62
|
+
</tr>
|
|
63
|
+
</thead>
|
|
64
|
+
<tbody><tr>
|
|
65
|
+
<td class="file high" data-value="popover.js"><a href="popover.js.html">popover.js</a></td>
|
|
66
|
+
<td data-value="96.55" class="pic high"><div class="chart"><div class="cover-fill" style="width: 96%;"></div><div class="cover-empty" style="width:4%;"></div></div></td>
|
|
67
|
+
<td data-value="96.55" class="pct high">96.55%</td>
|
|
68
|
+
<td data-value="29" class="abs high">28/29</td>
|
|
69
|
+
<td data-value="81.82" class="pct high">81.82%</td>
|
|
70
|
+
<td data-value="11" class="abs high">9/11</td>
|
|
71
|
+
<td data-value="85.71" class="pct high">85.71%</td>
|
|
72
|
+
<td data-value="7" class="abs high">6/7</td>
|
|
73
|
+
<td data-value="96.55" class="pct high">96.55%</td>
|
|
74
|
+
<td data-value="29" class="abs high">28/29</td>
|
|
75
|
+
</tr>
|
|
76
|
+
|
|
77
|
+
</tbody>
|
|
78
|
+
</table>
|
|
79
|
+
</div><div class='push'></div><!-- for sticky footer -->
|
|
80
|
+
</div><!-- /wrapper -->
|
|
81
|
+
<div class='footer quiet pad2 space-top1 center small'>
|
|
82
|
+
Code coverage
|
|
83
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri Nov 29 2019 15:32:57 GMT+0000 (GMT)
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
<script src="../../prettify.js"></script>
|
|
87
|
+
<script>
|
|
88
|
+
window.onload = function () {
|
|
89
|
+
if (typeof prettyPrint === 'function') {
|
|
90
|
+
prettyPrint();
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
</script>
|
|
94
|
+
<script src="../../sorter.js"></script>
|
|
95
|
+
<script src="../../block-navigation.js"></script>
|
|
96
|
+
</body>
|
|
97
|
+
</html>
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<title>Code coverage report for components/popover/popover.js</title>
|
|
5
|
+
<meta charset="utf-8" />
|
|
6
|
+
<link rel="stylesheet" href="../../prettify.css" />
|
|
7
|
+
<link rel="stylesheet" href="../../base.css" />
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
+
<style type='text/css'>
|
|
10
|
+
.coverage-summary .sorter {
|
|
11
|
+
background-image: url(../../sort-arrow-sprite.png);
|
|
12
|
+
}
|
|
13
|
+
</style>
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<div class='wrapper'>
|
|
17
|
+
<div class='pad1'>
|
|
18
|
+
<h1>
|
|
19
|
+
<a href="../../index.html">All files</a> / <a href="index.html">components/popover</a> popover.js
|
|
20
|
+
</h1>
|
|
21
|
+
<div class='clearfix'>
|
|
22
|
+
<div class='fl pad1y space-right2'>
|
|
23
|
+
<span class="strong">96.55% </span>
|
|
24
|
+
<span class="quiet">Statements</span>
|
|
25
|
+
<span class='fraction'>28/29</span>
|
|
26
|
+
</div>
|
|
27
|
+
<div class='fl pad1y space-right2'>
|
|
28
|
+
<span class="strong">81.82% </span>
|
|
29
|
+
<span class="quiet">Branches</span>
|
|
30
|
+
<span class='fraction'>9/11</span>
|
|
31
|
+
</div>
|
|
32
|
+
<div class='fl pad1y space-right2'>
|
|
33
|
+
<span class="strong">85.71% </span>
|
|
34
|
+
<span class="quiet">Functions</span>
|
|
35
|
+
<span class='fraction'>6/7</span>
|
|
36
|
+
</div>
|
|
37
|
+
<div class='fl pad1y space-right2'>
|
|
38
|
+
<span class="strong">96.55% </span>
|
|
39
|
+
<span class="quiet">Lines</span>
|
|
40
|
+
<span class='fraction'>28/29</span>
|
|
41
|
+
</div>
|
|
42
|
+
</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>
|
|
46
|
+
</div>
|
|
47
|
+
<div class='status-line high'></div>
|
|
48
|
+
<pre><table class="coverage">
|
|
49
|
+
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
50
|
+
<a name='L2'></a><a href='#L2'>2</a>
|
|
51
|
+
<a name='L3'></a><a href='#L3'>3</a>
|
|
52
|
+
<a name='L4'></a><a href='#L4'>4</a>
|
|
53
|
+
<a name='L5'></a><a href='#L5'>5</a>
|
|
54
|
+
<a name='L6'></a><a href='#L6'>6</a>
|
|
55
|
+
<a name='L7'></a><a href='#L7'>7</a>
|
|
56
|
+
<a name='L8'></a><a href='#L8'>8</a>
|
|
57
|
+
<a name='L9'></a><a href='#L9'>9</a>
|
|
58
|
+
<a name='L10'></a><a href='#L10'>10</a>
|
|
59
|
+
<a name='L11'></a><a href='#L11'>11</a>
|
|
60
|
+
<a name='L12'></a><a href='#L12'>12</a>
|
|
61
|
+
<a name='L13'></a><a href='#L13'>13</a>
|
|
62
|
+
<a name='L14'></a><a href='#L14'>14</a>
|
|
63
|
+
<a name='L15'></a><a href='#L15'>15</a>
|
|
64
|
+
<a name='L16'></a><a href='#L16'>16</a>
|
|
65
|
+
<a name='L17'></a><a href='#L17'>17</a>
|
|
66
|
+
<a name='L18'></a><a href='#L18'>18</a>
|
|
67
|
+
<a name='L19'></a><a href='#L19'>19</a>
|
|
68
|
+
<a name='L20'></a><a href='#L20'>20</a>
|
|
69
|
+
<a name='L21'></a><a href='#L21'>21</a>
|
|
70
|
+
<a name='L22'></a><a href='#L22'>22</a>
|
|
71
|
+
<a name='L23'></a><a href='#L23'>23</a>
|
|
72
|
+
<a name='L24'></a><a href='#L24'>24</a>
|
|
73
|
+
<a name='L25'></a><a href='#L25'>25</a>
|
|
74
|
+
<a name='L26'></a><a href='#L26'>26</a>
|
|
75
|
+
<a name='L27'></a><a href='#L27'>27</a>
|
|
76
|
+
<a name='L28'></a><a href='#L28'>28</a>
|
|
77
|
+
<a name='L29'></a><a href='#L29'>29</a>
|
|
78
|
+
<a name='L30'></a><a href='#L30'>30</a>
|
|
79
|
+
<a name='L31'></a><a href='#L31'>31</a>
|
|
80
|
+
<a name='L32'></a><a href='#L32'>32</a>
|
|
81
|
+
<a name='L33'></a><a href='#L33'>33</a>
|
|
82
|
+
<a name='L34'></a><a href='#L34'>34</a>
|
|
83
|
+
<a name='L35'></a><a href='#L35'>35</a>
|
|
84
|
+
<a name='L36'></a><a href='#L36'>36</a>
|
|
85
|
+
<a name='L37'></a><a href='#L37'>37</a>
|
|
86
|
+
<a name='L38'></a><a href='#L38'>38</a>
|
|
87
|
+
<a name='L39'></a><a href='#L39'>39</a>
|
|
88
|
+
<a name='L40'></a><a href='#L40'>40</a>
|
|
89
|
+
<a name='L41'></a><a href='#L41'>41</a>
|
|
90
|
+
<a name='L42'></a><a href='#L42'>42</a>
|
|
91
|
+
<a name='L43'></a><a href='#L43'>43</a>
|
|
92
|
+
<a name='L44'></a><a href='#L44'>44</a>
|
|
93
|
+
<a name='L45'></a><a href='#L45'>45</a>
|
|
94
|
+
<a name='L46'></a><a href='#L46'>46</a>
|
|
95
|
+
<a name='L47'></a><a href='#L47'>47</a>
|
|
96
|
+
<a name='L48'></a><a href='#L48'>48</a>
|
|
97
|
+
<a name='L49'></a><a href='#L49'>49</a>
|
|
98
|
+
<a name='L50'></a><a href='#L50'>50</a>
|
|
99
|
+
<a name='L51'></a><a href='#L51'>51</a>
|
|
100
|
+
<a name='L52'></a><a href='#L52'>52</a>
|
|
101
|
+
<a name='L53'></a><a href='#L53'>53</a>
|
|
102
|
+
<a name='L54'></a><a href='#L54'>54</a>
|
|
103
|
+
<a name='L55'></a><a href='#L55'>55</a>
|
|
104
|
+
<a name='L56'></a><a href='#L56'>56</a>
|
|
105
|
+
<a name='L57'></a><a href='#L57'>57</a>
|
|
106
|
+
<a name='L58'></a><a href='#L58'>58</a>
|
|
107
|
+
<a name='L59'></a><a href='#L59'>59</a>
|
|
108
|
+
<a name='L60'></a><a href='#L60'>60</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
109
|
+
<span class="cline-any cline-neutral"> </span>
|
|
110
|
+
<span class="cline-any cline-neutral"> </span>
|
|
111
|
+
<span class="cline-any cline-yes">1x</span>
|
|
112
|
+
<span class="cline-any cline-yes">1x</span>
|
|
113
|
+
<span class="cline-any cline-neutral"> </span>
|
|
114
|
+
<span class="cline-any cline-yes">1x</span>
|
|
115
|
+
<span class="cline-any cline-neutral"> </span>
|
|
116
|
+
<span class="cline-any cline-yes">5x</span>
|
|
117
|
+
<span class="cline-any cline-neutral"> </span>
|
|
118
|
+
<span class="cline-any cline-yes">5x</span>
|
|
119
|
+
<span class="cline-any cline-yes">1x</span>
|
|
120
|
+
<span class="cline-any cline-yes">1x</span>
|
|
121
|
+
<span class="cline-any cline-yes">1x</span>
|
|
122
|
+
<span class="cline-any cline-neutral"> </span>
|
|
123
|
+
<span class="cline-any cline-yes">1x</span>
|
|
124
|
+
<span class="cline-any cline-yes">1x</span>
|
|
125
|
+
<span class="cline-any cline-neutral"> </span>
|
|
126
|
+
<span class="cline-any cline-neutral"> </span>
|
|
127
|
+
<span class="cline-any cline-neutral"> </span>
|
|
128
|
+
<span class="cline-any cline-yes">1x</span>
|
|
129
|
+
<span class="cline-any cline-yes">1x</span>
|
|
130
|
+
<span class="cline-any cline-neutral"> </span>
|
|
131
|
+
<span class="cline-any cline-yes">1x</span>
|
|
132
|
+
<span class="cline-any cline-yes">2x</span>
|
|
133
|
+
<span class="cline-any cline-yes">2x</span>
|
|
134
|
+
<span class="cline-any cline-yes">2x</span>
|
|
135
|
+
<span class="cline-any cline-yes">2x</span>
|
|
136
|
+
<span class="cline-any cline-neutral"> </span>
|
|
137
|
+
<span class="cline-any cline-yes">1x</span>
|
|
138
|
+
<span class="cline-any cline-yes">1x</span>
|
|
139
|
+
<span class="cline-any cline-neutral"> </span>
|
|
140
|
+
<span class="cline-any cline-yes">1x</span>
|
|
141
|
+
<span class="cline-any cline-no"> </span>
|
|
142
|
+
<span class="cline-any cline-neutral"> </span>
|
|
143
|
+
<span class="cline-any cline-neutral"> </span>
|
|
144
|
+
<span class="cline-any cline-neutral"> </span>
|
|
145
|
+
<span class="cline-any cline-neutral"> </span>
|
|
146
|
+
<span class="cline-any cline-yes">2x</span>
|
|
147
|
+
<span class="cline-any cline-neutral"> </span>
|
|
148
|
+
<span class="cline-any cline-neutral"> </span>
|
|
149
|
+
<span class="cline-any cline-neutral"> </span>
|
|
150
|
+
<span class="cline-any cline-neutral"> </span>
|
|
151
|
+
<span class="cline-any cline-yes">2x</span>
|
|
152
|
+
<span class="cline-any cline-yes">2x</span>
|
|
153
|
+
<span class="cline-any cline-neutral"> </span>
|
|
154
|
+
<span class="cline-any cline-neutral"> </span>
|
|
155
|
+
<span class="cline-any cline-neutral"> </span>
|
|
156
|
+
<span class="cline-any cline-yes">6x</span>
|
|
157
|
+
<span class="cline-any cline-yes">3x</span>
|
|
158
|
+
<span class="cline-any cline-yes">3x</span>
|
|
159
|
+
<span class="cline-any cline-neutral"> </span>
|
|
160
|
+
<span class="cline-any cline-yes">3x</span>
|
|
161
|
+
<span class="cline-any cline-yes">3x</span>
|
|
162
|
+
<span class="cline-any cline-neutral"> </span>
|
|
163
|
+
<span class="cline-any cline-neutral"> </span>
|
|
164
|
+
<span class="cline-any cline-neutral"> </span>
|
|
165
|
+
<span class="cline-any cline-neutral"> </span>
|
|
166
|
+
<span class="cline-any cline-neutral"> </span>
|
|
167
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">// import Tooltip from 'tooltip.js';
|
|
168
|
+
import Popper from 'popper.js';
|
|
169
|
+
|
|
170
|
+
const triggerClassName = 'js-mds-popover-trigger';
|
|
171
|
+
const popoverActiveClass = 'mds-popover--active';
|
|
172
|
+
|
|
173
|
+
const popovers = {
|
|
174
|
+
init: () => {
|
|
175
|
+
const triggersList = Array.from(document.querySelectorAll(`.${triggerClassName}`));
|
|
176
|
+
|
|
177
|
+
triggersList.forEach((trigger) => {
|
|
178
|
+
const triggerId = trigger.getAttribute('id');
|
|
179
|
+
const popoverId = `${triggerId}-content`;
|
|
180
|
+
const popover = document.getElementById(popoverId);
|
|
181
|
+
// checking for existence of dataset eliminate bug in IE 10 as it doesn't support 'dataset'
|
|
182
|
+
const placement = popover.dataset ? popover.dataset.placement : <span class="branch-1 cbranch-no" title="branch not covered" >null;</span>
|
|
183
|
+
const popoverInstance = new Popper(trigger, popover, {
|
|
184
|
+
placement: placement || 'top-end',
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
trigger.setAttribute('aria-expanded', 'false');
|
|
188
|
+
popover.setAttribute('aria-hidden', 'true');
|
|
189
|
+
|
|
190
|
+
trigger.addEventListener('click', (elem) => {
|
|
191
|
+
elem.preventDefault();
|
|
192
|
+
popoverInstance.update();
|
|
193
|
+
popover.classList.toggle(popoverActiveClass);
|
|
194
|
+
popovers.setAriaAttr(trigger, popover, popoverActiveClass);
|
|
195
|
+
});
|
|
196
|
+
document.addEventListener('mousedown', (e) => {
|
|
197
|
+
popovers.hide(trigger, popover, popoverInstance, popoverActiveClass, e);
|
|
198
|
+
});
|
|
199
|
+
document.addEventListener('keydown', <span class="fstat-no" title="function not covered" >(e</span>) => {
|
|
200
|
+
<span class="cstat-no" title="statement not covered" > popovers.hide(trigger, popover, popoverInstance, popoverActiveClass, e);</span>
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
},
|
|
204
|
+
hide: (trigger, popover, popoverInstance, activeClass, element) => {
|
|
205
|
+
<span class="missing-if-branch" title="else path not taken" >E</span>if (
|
|
206
|
+
!trigger.contains(element.target) &&
|
|
207
|
+
!popoverInstance.popper.contains(element.target) &&
|
|
208
|
+
popover.classList.contains(activeClass)
|
|
209
|
+
) {
|
|
210
|
+
popover.classList.remove(activeClass);
|
|
211
|
+
popovers.setAriaAttr(trigger, popover, activeClass);
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
setAriaAttr: (trigger, popover, activeClass) => {
|
|
215
|
+
if (popover.classList.contains(activeClass)) {
|
|
216
|
+
trigger.setAttribute('aria-expanded', 'true');
|
|
217
|
+
popover.removeAttribute('aria-hidden');
|
|
218
|
+
} else {
|
|
219
|
+
trigger.setAttribute('aria-expanded', 'false');
|
|
220
|
+
popover.setAttribute('aria-hidden', 'true');
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
export default popovers;
|
|
226
|
+
</pre></td></tr>
|
|
227
|
+
</table></pre>
|
|
228
|
+
<div class='push'></div><!-- for sticky footer -->
|
|
229
|
+
</div><!-- /wrapper -->
|
|
230
|
+
<div class='footer quiet pad2 space-top1 center small'>
|
|
231
|
+
Code coverage
|
|
232
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri Nov 29 2019 15:32:57 GMT+0000 (GMT)
|
|
233
|
+
</div>
|
|
234
|
+
</div>
|
|
235
|
+
<script src="../../prettify.js"></script>
|
|
236
|
+
<script>
|
|
237
|
+
window.onload = function () {
|
|
238
|
+
if (typeof prettyPrint === 'function') {
|
|
239
|
+
prettyPrint();
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
</script>
|
|
243
|
+
<script src="../../sorter.js"></script>
|
|
244
|
+
<script src="../../block-navigation.js"></script>
|
|
245
|
+
</body>
|
|
246
|
+
</html>
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
</div><!-- /wrapper -->
|
|
81
81
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
82
82
|
Code coverage
|
|
83
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
83
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri Nov 29 2019 15:32:57 GMT+0000 (GMT)
|
|
84
84
|
</div>
|
|
85
85
|
</div>
|
|
86
86
|
<script src="../../prettify.js"></script>
|
|
@@ -71,13 +71,13 @@
|
|
|
71
71
|
<span class="cline-any cline-neutral"> </span>
|
|
72
72
|
<span class="cline-any cline-neutral"> </span>
|
|
73
73
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">const switchState = {
|
|
74
|
-
|
|
75
|
-
element.classList.remove('mds-switch-state--
|
|
76
|
-
element.classList.add('mds-switch-state--
|
|
74
|
+
switchToinverse: (element) => {
|
|
75
|
+
element.classList.remove('mds-switch-state--default');
|
|
76
|
+
element.classList.add('mds-switch-state--inverse');
|
|
77
77
|
},
|
|
78
|
-
|
|
79
|
-
element.classList.remove('mds-switch-state--
|
|
80
|
-
element.classList.add('mds-switch-state--
|
|
78
|
+
switchTodefault: (element) => {
|
|
79
|
+
element.classList.remove('mds-switch-state--inverse');
|
|
80
|
+
element.classList.add('mds-switch-state--default');
|
|
81
81
|
},
|
|
82
82
|
};
|
|
83
83
|
|
|
@@ -88,7 +88,7 @@ export default switchState;
|
|
|
88
88
|
</div><!-- /wrapper -->
|
|
89
89
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
90
90
|
Code coverage
|
|
91
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
91
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri Nov 29 2019 15:32:57 GMT+0000 (GMT)
|
|
92
92
|
</div>
|
|
93
93
|
</div>
|
|
94
94
|
<script src="../../prettify.js"></script>
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
</div><!-- /wrapper -->
|
|
81
81
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
82
82
|
Code coverage
|
|
83
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
83
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri Nov 29 2019 15:32:57 GMT+0000 (GMT)
|
|
84
84
|
</div>
|
|
85
85
|
</div>
|
|
86
86
|
<script src="../../prettify.js"></script>
|
|
@@ -499,7 +499,7 @@ export default tabs;
|
|
|
499
499
|
</div><!-- /wrapper -->
|
|
500
500
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
501
501
|
Code coverage
|
|
502
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
502
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri Nov 29 2019 15:32:57 GMT+0000 (GMT)
|
|
503
503
|
</div>
|
|
504
504
|
</div>
|
|
505
505
|
<script src="../../prettify.js"></script>
|