@zajno/common 1.6.3 → 1.6.4
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/coverage/clover.xml +30 -8
- package/coverage/coverage-final.json +3 -1
- package/coverage/lcov-report/__tests__/helpers/expect.ts.html +1 -1
- package/coverage/lcov-report/__tests__/helpers/index.html +1 -1
- package/coverage/lcov-report/__tests__/helpers/main.ts.html +1 -1
- package/coverage/lcov-report/async/arrays.ts.html +1 -1
- package/coverage/lcov-report/async/index.html +1 -1
- package/coverage/lcov-report/async/timeout.ts.html +10 -10
- package/coverage/lcov-report/dates/calc.ts.html +1 -1
- package/coverage/lcov-report/dates/convert.ts.html +1 -1
- package/coverage/lcov-report/dates/datex.ts.html +1 -1
- package/coverage/lcov-report/dates/format.ts.html +1 -1
- package/coverage/lcov-report/dates/index.html +1 -1
- package/coverage/lcov-report/dates/index.ts.html +1 -1
- package/coverage/lcov-report/dates/parse.ts.html +1 -1
- package/coverage/lcov-report/dates/period.ts.html +1 -1
- package/coverage/lcov-report/dates/shift.ts.html +1 -1
- package/coverage/lcov-report/dates/types.ts.html +1 -1
- package/coverage/lcov-report/dates/yearDate.ts.html +1 -1
- package/coverage/lcov-report/fields/index.html +1 -1
- package/coverage/lcov-report/fields/update.ts.html +1 -1
- package/coverage/lcov-report/functions/index.html +17 -17
- package/coverage/lcov-report/functions/safeCall.ts.html +13 -13
- package/coverage/lcov-report/index.html +19 -19
- package/coverage/lcov-report/lazy/index.html +1 -1
- package/coverage/lcov-report/lazy/promise.ts.html +1 -1
- package/coverage/lcov-report/lazy/singleton.ts.html +1 -1
- package/coverage/lcov-report/logger/batch.ts.html +1 -1
- package/coverage/lcov-report/logger/console.ts.html +1 -1
- package/coverage/lcov-report/logger/index.html +5 -5
- package/coverage/lcov-report/logger/index.ts.html +4 -4
- package/coverage/lcov-report/logger/named.ts.html +1 -1
- package/coverage/lcov-report/logger/proxy.ts.html +1 -1
- package/coverage/lcov-report/math/arrays.ts.html +1 -1
- package/coverage/lcov-report/math/calc.ts.html +1 -1
- package/coverage/lcov-report/math/distribution.ts.html +1 -1
- package/coverage/lcov-report/math/index.html +1 -1
- package/coverage/lcov-report/math/index.ts.html +1 -1
- package/coverage/lcov-report/observing/event.ts.html +1 -1
- package/coverage/lcov-report/observing/index.html +1 -1
- package/coverage/lcov-report/src/__tests__/helpers/expect.ts.html +1 -1
- package/coverage/lcov-report/src/__tests__/helpers/index.html +1 -1
- package/coverage/lcov-report/src/__tests__/helpers/main.ts.html +1 -1
- package/coverage/lcov-report/src/async/arrays.ts.html +1 -1
- package/coverage/lcov-report/src/async/index.html +1 -1
- package/coverage/lcov-report/src/async/timeout.ts.html +1 -1
- package/coverage/lcov-report/src/cache.ts.html +1 -1
- package/coverage/lcov-report/src/dates/calc.ts.html +1 -1
- package/coverage/lcov-report/src/dates/convert.ts.html +1 -1
- package/coverage/lcov-report/src/dates/datex.ts.html +1 -1
- package/coverage/lcov-report/src/dates/format.ts.html +1 -1
- package/coverage/lcov-report/src/dates/index.html +1 -1
- package/coverage/lcov-report/src/dates/index.ts.html +1 -1
- package/coverage/lcov-report/src/dates/parse.ts.html +1 -1
- package/coverage/lcov-report/src/dates/period.ts.html +1 -1
- package/coverage/lcov-report/src/dates/shift.ts.html +1 -1
- package/coverage/lcov-report/src/dates/types.ts.html +1 -1
- package/coverage/lcov-report/src/dates/yearDate.ts.html +1 -1
- package/coverage/lcov-report/src/disposer.ts.html +1 -1
- package/coverage/lcov-report/src/enumHelper.ts.html +1 -1
- package/coverage/lcov-report/src/event.ts.html +1 -1
- package/coverage/lcov-report/src/fields/index.html +1 -1
- package/coverage/lcov-report/src/fields/update.ts.html +1 -1
- package/coverage/lcov-report/src/functions.ts.html +1 -1
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/lazy/index.html +1 -1
- package/coverage/lcov-report/src/lazy/light.ts.html +1 -1
- package/coverage/lcov-report/src/lazy/observable.ts.html +1 -1
- package/coverage/lcov-report/src/lazy/promise.ts.html +1 -1
- package/coverage/lcov-report/src/lazy/singleton.ts.html +1 -1
- package/coverage/lcov-report/src/logger/batch.ts.html +1 -1
- package/coverage/lcov-report/src/logger/console.ts.html +1 -1
- package/coverage/lcov-report/src/logger/index.html +1 -1
- package/coverage/lcov-report/src/logger/index.ts.html +1 -1
- package/coverage/lcov-report/src/logger/named.ts.html +1 -1
- package/coverage/lcov-report/src/logger/proxy.ts.html +1 -1
- package/coverage/lcov-report/src/math/arrays.ts.html +1 -1
- package/coverage/lcov-report/src/math/calc.ts.html +1 -1
- package/coverage/lcov-report/src/math/distribution.ts.html +1 -1
- package/coverage/lcov-report/src/math/index.html +1 -1
- package/coverage/lcov-report/src/math/index.ts.html +1 -1
- package/coverage/lcov-report/src/observersMap.ts.html +1 -1
- package/coverage/lcov-report/src/observingCache.ts.html +1 -1
- package/coverage/lcov-report/src/queue/index.html +1 -1
- package/coverage/lcov-report/src/queue/parallel.ts.html +1 -1
- package/coverage/lcov-report/src/queue/tasks.ts.html +1 -1
- package/coverage/lcov-report/src/tempoCache.ts.html +1 -1
- package/coverage/lcov-report/src/transitionObserver.ts.html +1 -1
- package/coverage/lcov-report/src/types.ts.html +5 -5
- package/coverage/lcov-report/src/validation/ValidationErrors.ts.html +1 -1
- package/coverage/lcov-report/src/validation/creditCard.ts.html +1 -1
- package/coverage/lcov-report/src/validation/helpers.ts.html +1 -1
- package/coverage/lcov-report/src/validation/index.html +1 -1
- package/coverage/lcov-report/src/validation/index.ts.html +1 -1
- package/coverage/lcov-report/src/validation/types.ts.html +1 -1
- package/coverage/lcov-report/src/validation/validators.ts.html +1 -1
- package/coverage/lcov-report/src/validation/wrappers.ts.html +1 -1
- package/coverage/lcov-report/src/viewModels/CommonModel.ts.html +1 -1
- package/coverage/lcov-report/src/viewModels/FlagModel.ts.html +1 -1
- package/coverage/lcov-report/src/viewModels/LoadingModel.ts.html +1 -1
- package/coverage/lcov-report/src/viewModels/Model.ts.html +163 -0
- package/coverage/lcov-report/src/viewModels/MultiSelectModel.ts.html +1 -1
- package/coverage/lcov-report/src/viewModels/NumberModel.ts.html +1 -1
- package/coverage/lcov-report/src/viewModels/SelectModel.ts.html +1 -1
- package/coverage/lcov-report/src/viewModels/TextModel.ts.html +1 -1
- package/coverage/lcov-report/src/viewModels/Validatable.ts.html +1 -1
- package/coverage/lcov-report/src/viewModels/ValueModel.ts.html +127 -0
- package/coverage/lcov-report/src/viewModels/index.html +39 -9
- package/coverage/lcov-report/src/viewModels/wrappers.ts.html +1 -1
- package/coverage/lcov-report/structures/helpers/enum.ts.html +1 -1
- package/coverage/lcov-report/structures/helpers/index.html +1 -1
- package/coverage/lcov-report/structures/index.html +1 -1
- package/coverage/lcov-report/structures/queue/index.html +24 -9
- package/coverage/lcov-report/structures/queue/parallel.ts.html +1 -1
- package/coverage/lcov-report/structures/queue/tasks.ts.html +358 -0
- package/coverage/lcov-report/structures/tempoCache.ts.html +1 -1
- package/coverage/lcov-report/types/comparator.ts.html +1 -1
- package/coverage/lcov-report/types/getter.ts.html +1 -1
- package/coverage/lcov-report/types/index.html +1 -1
- package/coverage/lcov-report/types/index.ts.html +26 -2
- package/coverage/lcov-report/validation/ValidationErrors.ts.html +1 -1
- package/coverage/lcov-report/validation/creditCard.ts.html +1 -1
- package/coverage/lcov-report/validation/helpers.ts.html +1 -1
- package/coverage/lcov-report/validation/index.html +10 -100
- package/coverage/lcov-report/validation/index.ts.html +6 -6
- package/coverage/lcov-report/validation/types.ts.html +1 -1
- package/coverage/lcov-report/validation/validators.ts.html +1 -1
- package/coverage/lcov-report/validation/wrappers.ts.html +1 -1
- package/coverage/lcov-report/viewModels/CommonModel.ts.html +10 -5
- package/coverage/lcov-report/viewModels/LoadingModel.ts.html +2 -5
- package/coverage/lcov-report/viewModels/Model.ts.html +163 -0
- package/coverage/lcov-report/viewModels/SelectModel.ts.html +121 -116
- package/coverage/lcov-report/viewModels/TextModel.ts.html +16 -11
- package/coverage/lcov-report/viewModels/ValueModel.ts.html +127 -0
- package/coverage/lcov-report/viewModels/index.html +85 -10
- package/coverage/lcov.info +59 -6
- package/lib/viewModels/Model.d.ts +12 -0
- package/lib/viewModels/Model.d.ts.map +1 -0
- package/lib/viewModels/Model.js +23 -0
- package/lib/viewModels/Model.js.map +1 -0
- package/lib/viewModels/ValueModel.d.ts +2 -8
- package/lib/viewModels/ValueModel.d.ts.map +1 -1
- package/lib/viewModels/ValueModel.js +3 -16
- package/lib/viewModels/ValueModel.js.map +1 -1
- package/package.json +1 -1
- package/src/viewModels/Model.ts +26 -0
- package/src/viewModels/ValueModel.ts +3 -23
- package/src/viewModels/__tests__/common.test.ts +27 -1
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
|
|
2
|
+
<!doctype html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
|
|
5
|
+
<head>
|
|
6
|
+
<title>Code coverage report for viewModels/ValueModel.ts</title>
|
|
7
|
+
<meta charset="utf-8" />
|
|
8
|
+
<link rel="stylesheet" href="../prettify.css" />
|
|
9
|
+
<link rel="stylesheet" href="../base.css" />
|
|
10
|
+
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
|
|
11
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
+
<style type='text/css'>
|
|
13
|
+
.coverage-summary .sorter {
|
|
14
|
+
background-image: url(../sort-arrow-sprite.png);
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<div class='wrapper'>
|
|
21
|
+
<div class='pad1'>
|
|
22
|
+
<h1><a href="../index.html">All files</a> / <a href="index.html">viewModels</a> ValueModel.ts</h1>
|
|
23
|
+
<div class='clearfix'>
|
|
24
|
+
|
|
25
|
+
<div class='fl pad1y space-right2'>
|
|
26
|
+
<span class="strong">100% </span>
|
|
27
|
+
<span class="quiet">Statements</span>
|
|
28
|
+
<span class='fraction'>5/5</span>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
<div class='fl pad1y space-right2'>
|
|
33
|
+
<span class="strong">75% </span>
|
|
34
|
+
<span class="quiet">Branches</span>
|
|
35
|
+
<span class='fraction'>3/4</span>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
<div class='fl pad1y space-right2'>
|
|
40
|
+
<span class="strong">100% </span>
|
|
41
|
+
<span class="quiet">Functions</span>
|
|
42
|
+
<span class='fraction'>1/1</span>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<div class='fl pad1y space-right2'>
|
|
47
|
+
<span class="strong">100% </span>
|
|
48
|
+
<span class="quiet">Lines</span>
|
|
49
|
+
<span class='fraction'>5/5</span>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
<p class="quiet">
|
|
55
|
+
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.
|
|
56
|
+
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
</div>
|
|
64
|
+
<div class='status-line high'></div>
|
|
65
|
+
<pre><table class="coverage">
|
|
66
|
+
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
|
+
<a name='L2'></a><a href='#L2'>2</a>
|
|
68
|
+
<a name='L3'></a><a href='#L3'>3</a>
|
|
69
|
+
<a name='L4'></a><a href='#L4'>4</a>
|
|
70
|
+
<a name='L5'></a><a href='#L5'>5</a>
|
|
71
|
+
<a name='L6'></a><a href='#L6'>6</a>
|
|
72
|
+
<a name='L7'></a><a href='#L7'>7</a>
|
|
73
|
+
<a name='L8'></a><a href='#L8'>8</a>
|
|
74
|
+
<a name='L9'></a><a href='#L9'>9</a>
|
|
75
|
+
<a name='L10'></a><a href='#L10'>10</a>
|
|
76
|
+
<a name='L11'></a><a href='#L11'>11</a>
|
|
77
|
+
<a name='L12'></a><a href='#L12'>12</a>
|
|
78
|
+
<a name='L13'></a><a href='#L13'>13</a>
|
|
79
|
+
<a name='L14'></a><a href='#L14'>14</a>
|
|
80
|
+
<a name='L15'></a><a href='#L15'>15</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
|
81
|
+
<span class="cline-any cline-neutral"> </span>
|
|
82
|
+
<span class="cline-any cline-yes">1x</span>
|
|
83
|
+
<span class="cline-any cline-neutral"> </span>
|
|
84
|
+
<span class="cline-any cline-yes">1x</span>
|
|
85
|
+
<span class="cline-any cline-neutral"> </span>
|
|
86
|
+
<span class="cline-any cline-yes">2x</span>
|
|
87
|
+
<span class="cline-any cline-neutral"> </span>
|
|
88
|
+
<span class="cline-any cline-yes">2x</span>
|
|
89
|
+
<span class="cline-any cline-neutral"> </span>
|
|
90
|
+
<span class="cline-any cline-neutral"> </span>
|
|
91
|
+
<span class="cline-any cline-neutral"> </span>
|
|
92
|
+
<span class="cline-any cline-neutral"> </span>
|
|
93
|
+
<span class="cline-any cline-neutral"> </span>
|
|
94
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { action, makeObservable, observable } from 'mobx';
|
|
95
|
+
import { Getter } from '../types';
|
|
96
|
+
import { Model } from './Model';
|
|
97
|
+
|
|
98
|
+
export class ValueModel<T> extends Model<T> {
|
|
99
|
+
constructor(v: Getter<T> = null, useRefObservable = true) {
|
|
100
|
+
super(v);
|
|
101
|
+
|
|
102
|
+
makeObservable<ValueModel<T>, '_value'>(this, {
|
|
103
|
+
_value: useRefObservable ? observable.ref : <span class="branch-1 cbranch-no" title="branch not covered" >observable,</span>
|
|
104
|
+
setValue: action,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
</pre></td></tr></table></pre>
|
|
109
|
+
|
|
110
|
+
<div class='push'></div><!-- for sticky footer -->
|
|
111
|
+
</div><!-- /wrapper -->
|
|
112
|
+
<div class='footer quiet pad2 space-top1 center small'>
|
|
113
|
+
Code coverage generated by
|
|
114
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
115
|
+
at 2022-11-16T15:21:12.153Z
|
|
116
|
+
</div>
|
|
117
|
+
<script src="../prettify.js"></script>
|
|
118
|
+
<script>
|
|
119
|
+
window.onload = function () {
|
|
120
|
+
prettyPrint();
|
|
121
|
+
};
|
|
122
|
+
</script>
|
|
123
|
+
<script src="../sorter.js"></script>
|
|
124
|
+
<script src="../block-navigation.js"></script>
|
|
125
|
+
</body>
|
|
126
|
+
</html>
|
|
127
|
+
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">58.66% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>105/179</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">42.59% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>23/54</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">37.88% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>25/66</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">60.36% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>102/169</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
</div>
|
|
62
62
|
</template>
|
|
63
63
|
</div>
|
|
64
|
-
<div class='status-line
|
|
64
|
+
<div class='status-line medium'></div>
|
|
65
65
|
<div class="pad1">
|
|
66
66
|
<table class="coverage-summary">
|
|
67
67
|
<thead>
|
|
@@ -79,6 +79,21 @@
|
|
|
79
79
|
</tr>
|
|
80
80
|
</thead>
|
|
81
81
|
<tbody><tr>
|
|
82
|
+
<td class="file high" data-value="CommonModel.ts"><a href="CommonModel.ts.html">CommonModel.ts</a></td>
|
|
83
|
+
<td data-value="100" class="pic high">
|
|
84
|
+
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
|
|
85
|
+
</td>
|
|
86
|
+
<td data-value="100" class="pct high">100%</td>
|
|
87
|
+
<td data-value="19" class="abs high">19/19</td>
|
|
88
|
+
<td data-value="42.86" class="pct low">42.86%</td>
|
|
89
|
+
<td data-value="7" class="abs low">3/7</td>
|
|
90
|
+
<td data-value="100" class="pct high">100%</td>
|
|
91
|
+
<td data-value="6" class="abs high">6/6</td>
|
|
92
|
+
<td data-value="100" class="pct high">100%</td>
|
|
93
|
+
<td data-value="19" class="abs high">19/19</td>
|
|
94
|
+
</tr>
|
|
95
|
+
|
|
96
|
+
<tr>
|
|
82
97
|
<td class="file high" data-value="LoadingModel.ts"><a href="LoadingModel.ts.html">LoadingModel.ts</a></td>
|
|
83
98
|
<td data-value="95.24" class="pic high">
|
|
84
99
|
<div class="chart"><div class="cover-fill" style="width: 95%"></div><div class="cover-empty" style="width: 5%"></div></div>
|
|
@@ -93,6 +108,66 @@
|
|
|
93
108
|
<td data-value="20" class="abs high">20/20</td>
|
|
94
109
|
</tr>
|
|
95
110
|
|
|
111
|
+
<tr>
|
|
112
|
+
<td class="file high" data-value="Model.ts"><a href="Model.ts.html">Model.ts</a></td>
|
|
113
|
+
<td data-value="100" class="pic high">
|
|
114
|
+
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
|
|
115
|
+
</td>
|
|
116
|
+
<td data-value="100" class="pct high">100%</td>
|
|
117
|
+
<td data-value="11" class="abs high">11/11</td>
|
|
118
|
+
<td data-value="66.67" class="pct medium">66.67%</td>
|
|
119
|
+
<td data-value="3" class="abs medium">2/3</td>
|
|
120
|
+
<td data-value="100" class="pct high">100%</td>
|
|
121
|
+
<td data-value="5" class="abs high">5/5</td>
|
|
122
|
+
<td data-value="100" class="pct high">100%</td>
|
|
123
|
+
<td data-value="11" class="abs high">11/11</td>
|
|
124
|
+
</tr>
|
|
125
|
+
|
|
126
|
+
<tr>
|
|
127
|
+
<td class="file low" data-value="SelectModel.ts"><a href="SelectModel.ts.html">SelectModel.ts</a></td>
|
|
128
|
+
<td data-value="33.33" class="pic low">
|
|
129
|
+
<div class="chart"><div class="cover-fill" style="width: 33%"></div><div class="cover-empty" style="width: 67%"></div></div>
|
|
130
|
+
</td>
|
|
131
|
+
<td data-value="33.33" class="pct low">33.33%</td>
|
|
132
|
+
<td data-value="66" class="abs low">22/66</td>
|
|
133
|
+
<td data-value="8.33" class="pct low">8.33%</td>
|
|
134
|
+
<td data-value="12" class="abs low">1/12</td>
|
|
135
|
+
<td data-value="7.69" class="pct low">7.69%</td>
|
|
136
|
+
<td data-value="26" class="abs low">2/26</td>
|
|
137
|
+
<td data-value="36.07" class="pct low">36.07%</td>
|
|
138
|
+
<td data-value="61" class="abs low">22/61</td>
|
|
139
|
+
</tr>
|
|
140
|
+
|
|
141
|
+
<tr>
|
|
142
|
+
<td class="file low" data-value="TextModel.ts"><a href="TextModel.ts.html">TextModel.ts</a></td>
|
|
143
|
+
<td data-value="49.12" class="pic low">
|
|
144
|
+
<div class="chart"><div class="cover-fill" style="width: 49%"></div><div class="cover-empty" style="width: 51%"></div></div>
|
|
145
|
+
</td>
|
|
146
|
+
<td data-value="49.12" class="pct low">49.12%</td>
|
|
147
|
+
<td data-value="57" class="abs low">28/57</td>
|
|
148
|
+
<td data-value="35" class="pct low">35%</td>
|
|
149
|
+
<td data-value="20" class="abs low">7/20</td>
|
|
150
|
+
<td data-value="23.81" class="pct low">23.81%</td>
|
|
151
|
+
<td data-value="21" class="abs low">5/21</td>
|
|
152
|
+
<td data-value="47.17" class="pct low">47.17%</td>
|
|
153
|
+
<td data-value="53" class="abs low">25/53</td>
|
|
154
|
+
</tr>
|
|
155
|
+
|
|
156
|
+
<tr>
|
|
157
|
+
<td class="file high" data-value="ValueModel.ts"><a href="ValueModel.ts.html">ValueModel.ts</a></td>
|
|
158
|
+
<td data-value="100" class="pic high">
|
|
159
|
+
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
|
|
160
|
+
</td>
|
|
161
|
+
<td data-value="100" class="pct high">100%</td>
|
|
162
|
+
<td data-value="5" class="abs high">5/5</td>
|
|
163
|
+
<td data-value="75" class="pct medium">75%</td>
|
|
164
|
+
<td data-value="4" class="abs medium">3/4</td>
|
|
165
|
+
<td data-value="100" class="pct high">100%</td>
|
|
166
|
+
<td data-value="1" class="abs high">1/1</td>
|
|
167
|
+
<td data-value="100" class="pct high">100%</td>
|
|
168
|
+
<td data-value="5" class="abs high">5/5</td>
|
|
169
|
+
</tr>
|
|
170
|
+
|
|
96
171
|
</tbody>
|
|
97
172
|
</table>
|
|
98
173
|
</div>
|
|
@@ -101,7 +176,7 @@
|
|
|
101
176
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
102
177
|
Code coverage generated by
|
|
103
178
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
-
at 2022-
|
|
179
|
+
at 2022-11-16T15:21:12.153Z
|
|
105
180
|
</div>
|
|
106
181
|
<script src="../prettify.js"></script>
|
|
107
182
|
<script>
|
package/coverage/lcov.info
CHANGED
|
@@ -990,21 +990,21 @@ FN:25,(anonymous_3)
|
|
|
990
990
|
FNF:4
|
|
991
991
|
FNH:4
|
|
992
992
|
FNDA:12,(anonymous_0)
|
|
993
|
-
FNDA:
|
|
993
|
+
FNDA:114,getValue
|
|
994
994
|
FNDA:12,(anonymous_2)
|
|
995
995
|
FNDA:7,(anonymous_3)
|
|
996
996
|
DA:9,12
|
|
997
997
|
DA:10,12
|
|
998
|
-
DA:11,
|
|
999
|
-
DA:12,
|
|
1000
|
-
DA:14,
|
|
998
|
+
DA:11,114
|
|
999
|
+
DA:12,11
|
|
1000
|
+
DA:14,103
|
|
1001
1001
|
DA:15,77
|
|
1002
|
-
DA:17,
|
|
1002
|
+
DA:17,26
|
|
1003
1003
|
DA:24,12
|
|
1004
1004
|
DA:25,12
|
|
1005
1005
|
LF:9
|
|
1006
1006
|
LH:9
|
|
1007
|
-
BRDA:11,0,0,
|
|
1007
|
+
BRDA:11,0,0,11
|
|
1008
1008
|
BRDA:14,1,0,77
|
|
1009
1009
|
BRDA:9,2,0,12
|
|
1010
1010
|
BRDA:9,2,1,12
|
|
@@ -3642,6 +3642,39 @@ BRF:8
|
|
|
3642
3642
|
BRH:7
|
|
3643
3643
|
end_of_record
|
|
3644
3644
|
TN:
|
|
3645
|
+
SF:src/viewModels/Model.ts
|
|
3646
|
+
FN:9,(anonymous_0)
|
|
3647
|
+
FN:19,(anonymous_1)
|
|
3648
|
+
FN:23,(anonymous_2)
|
|
3649
|
+
FN:14,(anonymous_3)
|
|
3650
|
+
FN:15,(anonymous_4)
|
|
3651
|
+
FNF:5
|
|
3652
|
+
FNH:5
|
|
3653
|
+
FNDA:2,(anonymous_0)
|
|
3654
|
+
FNDA:2,(anonymous_1)
|
|
3655
|
+
FNDA:1,(anonymous_2)
|
|
3656
|
+
FNDA:3,(anonymous_3)
|
|
3657
|
+
FNDA:1,(anonymous_4)
|
|
3658
|
+
DA:2,1
|
|
3659
|
+
DA:4,1
|
|
3660
|
+
DA:7,2
|
|
3661
|
+
DA:10,2
|
|
3662
|
+
DA:11,2
|
|
3663
|
+
DA:14,3
|
|
3664
|
+
DA:16,1
|
|
3665
|
+
DA:19,2
|
|
3666
|
+
DA:20,2
|
|
3667
|
+
DA:23,2
|
|
3668
|
+
DA:24,1
|
|
3669
|
+
LF:11
|
|
3670
|
+
LH:11
|
|
3671
|
+
BRDA:9,0,0,0
|
|
3672
|
+
BRDA:10,1,0,2
|
|
3673
|
+
BRDA:10,1,1,1
|
|
3674
|
+
BRF:3
|
|
3675
|
+
BRH:2
|
|
3676
|
+
end_of_record
|
|
3677
|
+
TN:
|
|
3645
3678
|
SF:src/viewModels/MultiSelectModel.ts
|
|
3646
3679
|
FN:21,(anonymous_0)
|
|
3647
3680
|
FN:18,(anonymous_1)
|
|
@@ -4234,6 +4267,26 @@ BRF:21
|
|
|
4234
4267
|
BRH:14
|
|
4235
4268
|
end_of_record
|
|
4236
4269
|
TN:
|
|
4270
|
+
SF:src/viewModels/ValueModel.ts
|
|
4271
|
+
FN:6,(anonymous_0)
|
|
4272
|
+
FNF:1
|
|
4273
|
+
FNH:1
|
|
4274
|
+
FNDA:2,(anonymous_0)
|
|
4275
|
+
DA:1,1
|
|
4276
|
+
DA:3,1
|
|
4277
|
+
DA:5,1
|
|
4278
|
+
DA:7,2
|
|
4279
|
+
DA:9,2
|
|
4280
|
+
LF:5
|
|
4281
|
+
LH:5
|
|
4282
|
+
BRDA:6,0,0,1
|
|
4283
|
+
BRDA:6,1,0,2
|
|
4284
|
+
BRDA:10,2,0,2
|
|
4285
|
+
BRDA:10,2,1,0
|
|
4286
|
+
BRF:4
|
|
4287
|
+
BRH:3
|
|
4288
|
+
end_of_record
|
|
4289
|
+
TN:
|
|
4237
4290
|
SF:src/viewModels/wrappers.ts
|
|
4238
4291
|
FN:4,withLabel
|
|
4239
4292
|
FN:9,(anonymous_1)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IValueModel } from './types';
|
|
2
|
+
import { Getter } from '../types';
|
|
3
|
+
export declare class Model<T> implements IValueModel<T> {
|
|
4
|
+
private _value;
|
|
5
|
+
private readonly _defaultValue;
|
|
6
|
+
constructor(v?: Getter<T>);
|
|
7
|
+
get value(): T;
|
|
8
|
+
set value(v: T);
|
|
9
|
+
readonly setValue: (value: T) => void;
|
|
10
|
+
readonly reset: () => void;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=Model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Model.d.ts","sourceRoot":"","sources":["../../src/viewModels/Model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,qBAAa,KAAK,CAAC,CAAC,CAAE,YAAW,WAAW,CAAC,CAAC,CAAC;IAC3C,OAAO,CAAC,MAAM,CAAI;IAElB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAmB;gBAErC,CAAC,GAAE,MAAM,CAAC,CAAC,CAAQ;IAK/B,IAAW,KAAK,IACI,CAAC,CADqB;IAC1C,IAAW,KAAK,CAAC,CAAC,EAAE,CAAC,EAEpB;IAED,SAAgB,QAAQ,UAAW,CAAC,UAElC;IAEF,SAAgB,KAAK,aAEnB;CACL"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Model = void 0;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
class Model {
|
|
6
|
+
constructor(v = null) {
|
|
7
|
+
this._defaultValue = null;
|
|
8
|
+
this.setValue = (value) => {
|
|
9
|
+
this._value = value;
|
|
10
|
+
};
|
|
11
|
+
this.reset = () => {
|
|
12
|
+
this.setValue(types_1.Getter.getValue(this._defaultValue));
|
|
13
|
+
};
|
|
14
|
+
this._value = types_1.Getter.getValue(v) || null;
|
|
15
|
+
this._defaultValue = v;
|
|
16
|
+
}
|
|
17
|
+
get value() { return this._value; }
|
|
18
|
+
set value(v) {
|
|
19
|
+
this.setValue(v);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.Model = Model;
|
|
23
|
+
//# sourceMappingURL=Model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Model.js","sourceRoot":"","sources":["../../src/viewModels/Model.ts"],"names":[],"mappings":";;;AACA,oCAAkC;AAElC,MAAa,KAAK;IAKd,YAAY,IAAe,IAAI;QAFd,kBAAa,GAAc,IAAI,CAAC;QAYjC,aAAQ,GAAG,CAAC,KAAQ,EAAE,EAAE;YACpC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACxB,CAAC,CAAC;QAEc,UAAK,GAAG,GAAG,EAAE;YACzB,IAAI,CAAC,QAAQ,CAAC,cAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;QACvD,CAAC,CAAC;QAfE,IAAI,CAAC,MAAM,GAAG,cAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;QACzC,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;IAC3B,CAAC;IAED,IAAW,KAAK,KAAK,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1C,IAAW,KAAK,CAAC,CAAI;QACjB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC;CASJ;AAtBD,sBAsBC"}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { Getter } from '../types';
|
|
2
|
-
import {
|
|
3
|
-
export declare class ValueModel<T>
|
|
4
|
-
private _value;
|
|
5
|
-
private _defaultValue;
|
|
2
|
+
import { Model } from './Model';
|
|
3
|
+
export declare class ValueModel<T> extends Model<T> {
|
|
6
4
|
constructor(v?: Getter<T>, useRefObservable?: boolean);
|
|
7
|
-
get value(): T;
|
|
8
|
-
set value(v: T);
|
|
9
|
-
readonly setValue: (value: T) => void;
|
|
10
|
-
reset: () => void;
|
|
11
5
|
}
|
|
12
6
|
//# sourceMappingURL=ValueModel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValueModel.d.ts","sourceRoot":"","sources":["../../src/viewModels/ValueModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ValueModel.d.ts","sourceRoot":"","sources":["../../src/viewModels/ValueModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,qBAAa,UAAU,CAAC,CAAC,CAAE,SAAQ,KAAK,CAAC,CAAC,CAAC;gBAC3B,CAAC,GAAE,MAAM,CAAC,CAAC,CAAQ,EAAE,gBAAgB,UAAO;CAQ3D"}
|
|
@@ -2,28 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ValueModel = void 0;
|
|
4
4
|
const mobx_1 = require("mobx");
|
|
5
|
-
const
|
|
6
|
-
class ValueModel {
|
|
5
|
+
const Model_1 = require("./Model");
|
|
6
|
+
class ValueModel extends Model_1.Model {
|
|
7
7
|
constructor(v = null, useRefObservable = true) {
|
|
8
|
-
|
|
9
|
-
// action
|
|
10
|
-
this.setValue = (value) => {
|
|
11
|
-
this._value = value;
|
|
12
|
-
};
|
|
13
|
-
this.reset = () => {
|
|
14
|
-
this._value = types_1.Getter.getValue(this._defaultValue);
|
|
15
|
-
};
|
|
16
|
-
this._value = types_1.Getter.getValue(v) || null;
|
|
17
|
-
this._defaultValue = v;
|
|
8
|
+
super(v);
|
|
18
9
|
(0, mobx_1.makeObservable)(this, {
|
|
19
10
|
_value: useRefObservable ? mobx_1.observable.ref : mobx_1.observable,
|
|
20
11
|
setValue: mobx_1.action,
|
|
21
12
|
});
|
|
22
13
|
}
|
|
23
|
-
get value() { return this._value; }
|
|
24
|
-
set value(v) {
|
|
25
|
-
this.setValue(v);
|
|
26
|
-
}
|
|
27
14
|
}
|
|
28
15
|
exports.ValueModel = ValueModel;
|
|
29
16
|
//# sourceMappingURL=ValueModel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValueModel.js","sourceRoot":"","sources":["../../src/viewModels/ValueModel.ts"],"names":[],"mappings":";;;AAAA,+BAA0D;
|
|
1
|
+
{"version":3,"file":"ValueModel.js","sourceRoot":"","sources":["../../src/viewModels/ValueModel.ts"],"names":[],"mappings":";;;AAAA,+BAA0D;AAE1D,mCAAgC;AAEhC,MAAa,UAAc,SAAQ,aAAQ;IACvC,YAAY,IAAe,IAAI,EAAE,gBAAgB,GAAG,IAAI;QACpD,KAAK,CAAC,CAAC,CAAC,CAAC;QAET,IAAA,qBAAc,EAA0B,IAAI,EAAE;YAC1C,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC,iBAAU,CAAC,GAAG,CAAC,CAAC,CAAC,iBAAU;YACtD,QAAQ,EAAE,aAAM;SACnB,CAAC,CAAC;IACP,CAAC;CACJ;AATD,gCASC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { IValueModel } from './types';
|
|
2
|
+
import { Getter } from '../types';
|
|
3
|
+
|
|
4
|
+
export class Model<T> implements IValueModel<T> {
|
|
5
|
+
private _value: T;
|
|
6
|
+
|
|
7
|
+
private readonly _defaultValue: Getter<T> = null;
|
|
8
|
+
|
|
9
|
+
constructor(v: Getter<T> = null) {
|
|
10
|
+
this._value = Getter.getValue(v) || null;
|
|
11
|
+
this._defaultValue = v;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public get value() { return this._value; }
|
|
15
|
+
public set value(v: T) {
|
|
16
|
+
this.setValue(v);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public readonly setValue = (value: T) => {
|
|
20
|
+
this._value = value;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
public readonly reset = () => {
|
|
24
|
+
this.setValue(Getter.getValue(this._defaultValue));
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -1,34 +1,14 @@
|
|
|
1
1
|
import { action, makeObservable, observable } from 'mobx';
|
|
2
2
|
import { Getter } from '../types';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export class ValueModel<T> implements IValueModel<T> {
|
|
6
|
-
// observable[.ref]
|
|
7
|
-
private _value: T;
|
|
8
|
-
|
|
9
|
-
private _defaultValue: Getter<T> = null;
|
|
3
|
+
import { Model } from './Model';
|
|
10
4
|
|
|
5
|
+
export class ValueModel<T> extends Model<T> {
|
|
11
6
|
constructor(v: Getter<T> = null, useRefObservable = true) {
|
|
12
|
-
|
|
13
|
-
this._defaultValue = v;
|
|
7
|
+
super(v);
|
|
14
8
|
|
|
15
9
|
makeObservable<ValueModel<T>, '_value'>(this, {
|
|
16
10
|
_value: useRefObservable ? observable.ref : observable,
|
|
17
11
|
setValue: action,
|
|
18
12
|
});
|
|
19
13
|
}
|
|
20
|
-
|
|
21
|
-
public get value() { return this._value; }
|
|
22
|
-
public set value(v: T) {
|
|
23
|
-
this.setValue(v);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// action
|
|
27
|
-
public readonly setValue = (value: T) => {
|
|
28
|
-
this._value = value;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
reset = () => {
|
|
32
|
-
this._value = Getter.getValue(this._defaultValue);
|
|
33
|
-
};
|
|
34
14
|
}
|
|
@@ -4,13 +4,15 @@ import { LoadingModel } from '../LoadingModel';
|
|
|
4
4
|
import { setTimeoutAsync } from '../../async/timeout';
|
|
5
5
|
import { SelectString } from '../SelectModel';
|
|
6
6
|
import { TextInputVM } from '../TextModel';
|
|
7
|
+
import { ValueModel } from '../ValueModel';
|
|
8
|
+
import { reaction } from 'mobx';
|
|
7
9
|
|
|
8
10
|
describe('CommonModel', () => {
|
|
9
11
|
const NotEmptyError = 'should be not empty';
|
|
10
12
|
|
|
11
13
|
it('works', async () => {
|
|
12
14
|
|
|
13
|
-
let m: CommonModel<string[]
|
|
15
|
+
let m: CommonModel<string[]> = null;
|
|
14
16
|
|
|
15
17
|
const fn = async () => {
|
|
16
18
|
m = new CommonModel<string[]>(() => [], true)
|
|
@@ -103,5 +105,29 @@ describe('Others', () => {
|
|
|
103
105
|
return new TextInputVM();
|
|
104
106
|
})()).resolves.not.toThrow();
|
|
105
107
|
|
|
108
|
+
await expect((async () => {
|
|
109
|
+
return new ValueModel();
|
|
110
|
+
})()).resolves.not.toThrow();
|
|
111
|
+
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
describe('ValueModel', () => {
|
|
115
|
+
it('observable', () => {
|
|
116
|
+
|
|
117
|
+
const vm = new ValueModel(123);
|
|
118
|
+
|
|
119
|
+
const sub = jest.fn();
|
|
120
|
+
const unsub = reaction(() => vm.value, v => sub(v));
|
|
121
|
+
|
|
122
|
+
vm.value = 321;
|
|
123
|
+
expect(sub).toHaveBeenCalledWith(321);
|
|
124
|
+
|
|
125
|
+
sub.mockClear();
|
|
126
|
+
|
|
127
|
+
vm.reset();
|
|
128
|
+
expect(sub).toHaveBeenCalledWith(123);
|
|
129
|
+
|
|
130
|
+
unsub();
|
|
131
|
+
});
|
|
106
132
|
});
|
|
107
133
|
});
|