@rxap/material-form-system 18.0.2 → 18.0.3-dev.0
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/CHANGELOG.md +4 -0
- package/README.md +1 -1
- package/compodoc/changelog.html +725 -0
- package/compodoc/classes/ExtractHideShowMixin.html +871 -0
- package/compodoc/classes/RecordViewTuple.html +536 -0
- package/compodoc/components/FormControlsComponent.html +1253 -0
- package/compodoc/dependencies.html +215 -0
- package/compodoc/directives/ChipInputAdapterDirective.html +369 -0
- package/compodoc/directives/ChipListIteratorDirective.html +599 -0
- package/compodoc/directives/CompareWithDirective.html +414 -0
- package/compodoc/directives/ControlErrorDirective.html +673 -0
- package/compodoc/directives/ControlErrorsDirective.html +619 -0
- package/compodoc/directives/FormFieldHideShowDirective.html +1018 -0
- package/compodoc/directives/InputClearButtonDirective.html +761 -0
- package/compodoc/directives/RequiredDirective.html +339 -0
- package/compodoc/fonts/ionicons.eot +0 -0
- package/compodoc/fonts/ionicons.svg +2090 -0
- package/compodoc/fonts/ionicons.ttf +0 -0
- package/compodoc/fonts/ionicons.woff +0 -0
- package/compodoc/fonts/ionicons.woff2 +0 -0
- package/compodoc/fonts/roboto-v15-latin-300.eot +0 -0
- package/compodoc/fonts/roboto-v15-latin-300.svg +314 -0
- package/compodoc/fonts/roboto-v15-latin-300.ttf +0 -0
- package/compodoc/fonts/roboto-v15-latin-300.woff +0 -0
- package/compodoc/fonts/roboto-v15-latin-300.woff2 +0 -0
- package/compodoc/fonts/roboto-v15-latin-700.eot +0 -0
- package/compodoc/fonts/roboto-v15-latin-700.svg +310 -0
- package/compodoc/fonts/roboto-v15-latin-700.ttf +0 -0
- package/compodoc/fonts/roboto-v15-latin-700.woff +0 -0
- package/compodoc/fonts/roboto-v15-latin-700.woff2 +0 -0
- package/compodoc/fonts/roboto-v15-latin-italic.eot +0 -0
- package/compodoc/fonts/roboto-v15-latin-italic.svg +323 -0
- package/compodoc/fonts/roboto-v15-latin-italic.ttf +0 -0
- package/compodoc/fonts/roboto-v15-latin-italic.woff +0 -0
- package/compodoc/fonts/roboto-v15-latin-italic.woff2 +0 -0
- package/compodoc/fonts/roboto-v15-latin-regular.eot +0 -0
- package/compodoc/fonts/roboto-v15-latin-regular.svg +308 -0
- package/compodoc/fonts/roboto-v15-latin-regular.ttf +0 -0
- package/compodoc/fonts/roboto-v15-latin-regular.woff +0 -0
- package/compodoc/fonts/roboto-v15-latin-regular.woff2 +0 -0
- package/compodoc/graph/dependencies.svg +162 -0
- package/compodoc/images/compodoc-vectorise-inverted.png +0 -0
- package/compodoc/images/compodoc-vectorise-inverted.svg +201 -0
- package/compodoc/images/compodoc-vectorise.png +0 -0
- package/compodoc/images/compodoc-vectorise.svg +201 -0
- package/compodoc/images/favicon.ico +0 -0
- package/compodoc/index.html +190 -0
- package/compodoc/interfaces/ChipListTemplateContext.html +477 -0
- package/compodoc/interfaces/ControlErrorDirectiveContext.html +416 -0
- package/compodoc/interfaces/ControlErrorsDirectiveContext.html +404 -0
- package/compodoc/js/compodoc.js +14 -0
- package/compodoc/js/lazy-load-graphs.js +44 -0
- package/compodoc/js/libs/EventDispatcher.js +5 -0
- package/compodoc/js/libs/bootstrap-native.js +2 -0
- package/compodoc/js/libs/clipboard.min.js +7 -0
- package/compodoc/js/libs/custom-elements-es5-adapter.js +15 -0
- package/compodoc/js/libs/custom-elements.min.js +38 -0
- package/compodoc/js/libs/d3.v3.min.js +2 -0
- package/compodoc/js/libs/deep-iterator.js +2 -0
- package/compodoc/js/libs/es6-shim.min.js +12 -0
- package/compodoc/js/libs/htmlparser.js +23 -0
- package/compodoc/js/libs/innersvg.js +9 -0
- package/compodoc/js/libs/lit-html.js +1 -0
- package/compodoc/js/libs/prism.js +46 -0
- package/compodoc/js/libs/promise.min.js +6 -0
- package/compodoc/js/libs/svg-pan-zoom.min.js +3 -0
- package/compodoc/js/libs/tablesort.min.js +6 -0
- package/compodoc/js/libs/tablesort.number.min.js +6 -0
- package/compodoc/js/libs/vis.min.js +47 -0
- package/compodoc/js/libs/zepto.min.js +2 -0
- package/compodoc/js/menu-wc.js +208 -0
- package/compodoc/js/menu-wc_es5.js +40 -0
- package/compodoc/js/menu.js +270 -0
- package/compodoc/js/routes.js +301 -0
- package/compodoc/js/search/lunr.min.js +6 -0
- package/compodoc/js/search/search-lunr.js +67 -0
- package/compodoc/js/search/search.js +283 -0
- package/compodoc/js/search/search_index.js +4 -0
- package/compodoc/js/sourceCode.js +58 -0
- package/compodoc/js/svg-pan-zoom.controls.js +53 -0
- package/compodoc/js/tabs.js +21 -0
- package/compodoc/js/tree.js +147 -0
- package/compodoc/license.html +731 -0
- package/compodoc/miscellaneous/functions.html +261 -0
- package/compodoc/miscellaneous/variables.html +222 -0
- package/compodoc/modules/MaterialFormSystemModule/dependencies.svg +162 -0
- package/compodoc/modules/MaterialFormSystemModule.html +466 -0
- package/compodoc/modules.html +200 -0
- package/compodoc/overview.html +401 -0
- package/compodoc/properties.html +195 -0
- package/compodoc/styles/bootstrap-card.css +219 -0
- package/compodoc/styles/bootstrap.min.css +6 -0
- package/compodoc/styles/compodoc.css +1124 -0
- package/compodoc/styles/dark.css +121 -0
- package/compodoc/styles/ionicons.min.css +11 -0
- package/compodoc/styles/laravel.css +113 -0
- package/compodoc/styles/material.css +131 -0
- package/compodoc/styles/original.css +51 -0
- package/compodoc/styles/postmark.css +238 -0
- package/compodoc/styles/prism.css +301 -0
- package/compodoc/styles/readthedocs.css +117 -0
- package/compodoc/styles/reset.css +129 -0
- package/compodoc/styles/stripe.css +106 -0
- package/compodoc/styles/style.css +7 -0
- package/compodoc/styles/tablesort.css +33 -0
- package/compodoc/styles/vagrant.css +130 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +43 -0
- package/docs/assets/icons.js +15 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +59 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1412 -0
- package/docs/classes/ChipInputAdapterDirective.html +7 -0
- package/docs/classes/ChipListIteratorDirective.html +14 -0
- package/docs/classes/CompareWithDirective.html +6 -0
- package/docs/classes/ControlErrorDirective.html +13 -0
- package/docs/classes/ControlErrorsDirective.html +12 -0
- package/docs/classes/ExtractHideShowMixin.html +8 -0
- package/docs/classes/FormControlsComponent.html +21 -0
- package/docs/classes/FormFieldHideShowDirective.html +24 -0
- package/docs/classes/InputClearButtonDirective.html +8 -0
- package/docs/classes/MaterialFormSystemModule.html +2 -0
- package/docs/classes/RequiredDirective.html +4 -0
- package/docs/documentation.json +6627 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +16 -0
- package/docs/interfaces/ChipListTemplateContext.html +3 -0
- package/docs/interfaces/ControlErrorDirectiveContext.html +3 -0
- package/docs/interfaces/ControlErrorsDirectiveContext.html +3 -0
- package/docs/modules.html +15 -0
- package/package.json +24 -24
|
@@ -0,0 +1,599 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html class="no-js" lang="">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
6
|
+
<title>angular-material-form-system</title>
|
|
7
|
+
<meta name="description" content="">
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
+
|
|
10
|
+
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
|
|
11
|
+
<link rel="stylesheet" href="../styles/style.css">
|
|
12
|
+
<link rel="stylesheet" href="../styles/dark.css">
|
|
13
|
+
</head>
|
|
14
|
+
<body>
|
|
15
|
+
<script>
|
|
16
|
+
// Blocking script to avoid flickering dark mode
|
|
17
|
+
// Dark mode toggle button
|
|
18
|
+
var useDark = window.matchMedia('(prefers-color-scheme: dark)');
|
|
19
|
+
var darkModeState = useDark.matches;
|
|
20
|
+
var $darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
|
|
21
|
+
var $darkModeToggles = document.querySelectorAll('.dark-mode-switch');
|
|
22
|
+
var darkModeStateLocal = localStorage.getItem('compodoc_darkmode-state');
|
|
23
|
+
|
|
24
|
+
function checkToggle(check) {
|
|
25
|
+
for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
|
|
26
|
+
$darkModeToggleSwitchers[i].checked = check;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function toggleDarkMode(state) {
|
|
31
|
+
if (window.localStorage) {
|
|
32
|
+
localStorage.setItem('compodoc_darkmode-state', state);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
checkToggle(state);
|
|
36
|
+
|
|
37
|
+
const hasClass = document.body.classList.contains('dark');
|
|
38
|
+
|
|
39
|
+
if (state) {
|
|
40
|
+
for (var i = 0; i < $darkModeToggles.length; i++) {
|
|
41
|
+
$darkModeToggles[i].classList.add('dark');
|
|
42
|
+
}
|
|
43
|
+
if (!hasClass) {
|
|
44
|
+
document.body.classList.add('dark');
|
|
45
|
+
}
|
|
46
|
+
} else {
|
|
47
|
+
for (var i = 0; i < $darkModeToggles.length; i++) {
|
|
48
|
+
$darkModeToggles[i].classList.remove('dark');
|
|
49
|
+
}
|
|
50
|
+
if (hasClass) {
|
|
51
|
+
document.body.classList.remove('dark');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
useDark.addEventListener('change', function (evt) {
|
|
57
|
+
toggleDarkMode(evt.matches);
|
|
58
|
+
});
|
|
59
|
+
if (darkModeStateLocal) {
|
|
60
|
+
darkModeState = darkModeStateLocal === 'true';
|
|
61
|
+
}
|
|
62
|
+
toggleDarkMode(darkModeState);
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<div class="navbar navbar-default navbar-fixed-top d-md-none p-0">
|
|
66
|
+
<div class="d-flex">
|
|
67
|
+
<a href="../" class="navbar-brand">angular-material-form-system</a>
|
|
68
|
+
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<div class="xs-menu menu" id="mobile-menu">
|
|
73
|
+
<div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div> <compodoc-menu></compodoc-menu>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<div class="container-fluid main">
|
|
77
|
+
<div class="row main">
|
|
78
|
+
<div class="d-none d-md-block menu">
|
|
79
|
+
<compodoc-menu mode="normal"></compodoc-menu>
|
|
80
|
+
</div>
|
|
81
|
+
<!-- START CONTENT -->
|
|
82
|
+
<div class="content directive">
|
|
83
|
+
<div class="content-data">
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
<ol class="breadcrumb">
|
|
92
|
+
<li class="breadcrumb-item">Directives</li>
|
|
93
|
+
<li class="breadcrumb-item" >ChipListIteratorDirective</li>
|
|
94
|
+
</ol>
|
|
95
|
+
|
|
96
|
+
<ul class="nav nav-tabs" role="tablist">
|
|
97
|
+
<li class="nav-item">
|
|
98
|
+
<a href="#info"
|
|
99
|
+
class="nav-link"
|
|
100
|
+
class="nav-link active"
|
|
101
|
+
role="tab" id="info-tab" data-bs-toggle="tab" data-link="info">Info</a>
|
|
102
|
+
</li>
|
|
103
|
+
<li class="nav-item">
|
|
104
|
+
<a href="#source"
|
|
105
|
+
class="nav-link"
|
|
106
|
+
|
|
107
|
+
role="tab" id="source-tab" data-bs-toggle="tab" data-link="source">Source</a>
|
|
108
|
+
</li>
|
|
109
|
+
</ul>
|
|
110
|
+
|
|
111
|
+
<div class="tab-content">
|
|
112
|
+
<div class="tab-pane fade active in" id="info">
|
|
113
|
+
<p class="comment">
|
|
114
|
+
<h3>File</h3>
|
|
115
|
+
</p>
|
|
116
|
+
<p class="comment">
|
|
117
|
+
<code>src/lib/chip-list-iterator.directive.ts</code>
|
|
118
|
+
</p>
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
<p class="comment">
|
|
124
|
+
<h3>Implements</h3>
|
|
125
|
+
</p>
|
|
126
|
+
<p class="comment">
|
|
127
|
+
<code>OnInit</code>
|
|
128
|
+
<code>OnDestroy</code>
|
|
129
|
+
</p>
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
<section data-compodoc="block-metadata">
|
|
133
|
+
<h3>Metadata</h3>
|
|
134
|
+
<table class="table table-sm table-hover metadata">
|
|
135
|
+
<tbody>
|
|
136
|
+
|
|
137
|
+
<tr>
|
|
138
|
+
<td class="col-md-3">Selector</td>
|
|
139
|
+
<td class="col-md-9"><code>[rxapChipListIterator]</code></td>
|
|
140
|
+
</tr>
|
|
141
|
+
|
|
142
|
+
<tr>
|
|
143
|
+
<td class="col-md-3">Standalone</td>
|
|
144
|
+
<td class="col-md-9"><code>true</code></td>
|
|
145
|
+
</tr>
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
</tbody>
|
|
150
|
+
</table>
|
|
151
|
+
</section>
|
|
152
|
+
|
|
153
|
+
<section data-compodoc="block-index">
|
|
154
|
+
<h3 id="index">Index</h3>
|
|
155
|
+
<table class="table table-sm table-bordered index-table">
|
|
156
|
+
<tbody>
|
|
157
|
+
|
|
158
|
+
<tr>
|
|
159
|
+
<td class="col-md-4">
|
|
160
|
+
<h6><b>Methods</b></h6>
|
|
161
|
+
</td>
|
|
162
|
+
</tr>
|
|
163
|
+
<tr>
|
|
164
|
+
<td class="col-md-4">
|
|
165
|
+
<ul class="index-list">
|
|
166
|
+
<li>
|
|
167
|
+
<span class="modifier">Protected</span>
|
|
168
|
+
<a href="#applyChanges" >applyChanges</a>
|
|
169
|
+
</li>
|
|
170
|
+
</ul>
|
|
171
|
+
</td>
|
|
172
|
+
</tr>
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
</tbody>
|
|
179
|
+
</table>
|
|
180
|
+
</section>
|
|
181
|
+
|
|
182
|
+
<section data-compodoc="block-constructor">
|
|
183
|
+
<h3 id="constructor">Constructor</h3>
|
|
184
|
+
<table class="table table-sm table-bordered">
|
|
185
|
+
<tbody>
|
|
186
|
+
<tr>
|
|
187
|
+
<td class="col-md-4">
|
|
188
|
+
<code>constructor(template: <a href="../interfaces/ChipListTemplateContext.html" target="_self">TemplateRef<ChipListTemplateContext></a>, viewContainerRef: ViewContainerRef, ngControl: NgControl, differs: IterableDiffers)</code>
|
|
189
|
+
</td>
|
|
190
|
+
</tr>
|
|
191
|
+
<tr>
|
|
192
|
+
<td class="col-md-4">
|
|
193
|
+
<div class="io-line">Defined in <a href="" data-line="47" class="link-to-prism">src/lib/chip-list-iterator.directive.ts:47</a></div>
|
|
194
|
+
</td>
|
|
195
|
+
</tr>
|
|
196
|
+
|
|
197
|
+
<tr>
|
|
198
|
+
<td class="col-md-4">
|
|
199
|
+
<div>
|
|
200
|
+
<b>Parameters :</b>
|
|
201
|
+
<table class="params">
|
|
202
|
+
<thead>
|
|
203
|
+
<tr>
|
|
204
|
+
<td>Name</td>
|
|
205
|
+
<td>Type</td>
|
|
206
|
+
<td>Optional</td>
|
|
207
|
+
</tr>
|
|
208
|
+
</thead>
|
|
209
|
+
<tbody>
|
|
210
|
+
<tr>
|
|
211
|
+
<td>template</td>
|
|
212
|
+
|
|
213
|
+
<td>
|
|
214
|
+
<code><a href="../interfaces/ChipListTemplateContext.html" target="_self" >TemplateRef<ChipListTemplateContext></a></code>
|
|
215
|
+
</td>
|
|
216
|
+
|
|
217
|
+
<td>
|
|
218
|
+
No
|
|
219
|
+
</td>
|
|
220
|
+
|
|
221
|
+
</tr>
|
|
222
|
+
<tr>
|
|
223
|
+
<td>viewContainerRef</td>
|
|
224
|
+
|
|
225
|
+
<td>
|
|
226
|
+
<code>ViewContainerRef</code>
|
|
227
|
+
</td>
|
|
228
|
+
|
|
229
|
+
<td>
|
|
230
|
+
No
|
|
231
|
+
</td>
|
|
232
|
+
|
|
233
|
+
</tr>
|
|
234
|
+
<tr>
|
|
235
|
+
<td>ngControl</td>
|
|
236
|
+
|
|
237
|
+
<td>
|
|
238
|
+
<code>NgControl</code>
|
|
239
|
+
</td>
|
|
240
|
+
|
|
241
|
+
<td>
|
|
242
|
+
No
|
|
243
|
+
</td>
|
|
244
|
+
|
|
245
|
+
</tr>
|
|
246
|
+
<tr>
|
|
247
|
+
<td>differs</td>
|
|
248
|
+
|
|
249
|
+
<td>
|
|
250
|
+
<code>IterableDiffers</code>
|
|
251
|
+
</td>
|
|
252
|
+
|
|
253
|
+
<td>
|
|
254
|
+
No
|
|
255
|
+
</td>
|
|
256
|
+
|
|
257
|
+
</tr>
|
|
258
|
+
</tbody>
|
|
259
|
+
</table>
|
|
260
|
+
</div>
|
|
261
|
+
</td>
|
|
262
|
+
</tr>
|
|
263
|
+
</tbody>
|
|
264
|
+
</table>
|
|
265
|
+
</section>
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
<section data-compodoc="block-methods">
|
|
272
|
+
|
|
273
|
+
<h3 id="methods">
|
|
274
|
+
Methods
|
|
275
|
+
</h3>
|
|
276
|
+
<table class="table table-sm table-bordered">
|
|
277
|
+
<tbody>
|
|
278
|
+
<tr>
|
|
279
|
+
<td class="col-md-4">
|
|
280
|
+
<a name="applyChanges"></a>
|
|
281
|
+
<span class="name">
|
|
282
|
+
<span class="modifier">Protected</span>
|
|
283
|
+
<span ><b>applyChanges</b></span>
|
|
284
|
+
<a href="#applyChanges"><span class="icon ion-ios-link"></span></a>
|
|
285
|
+
</span>
|
|
286
|
+
</td>
|
|
287
|
+
</tr>
|
|
288
|
+
<tr>
|
|
289
|
+
<td class="col-md-4">
|
|
290
|
+
<span class="modifier-icon icon ion-ios-reset"></span>
|
|
291
|
+
<code>applyChanges(changes: IterableChanges<string>)</code>
|
|
292
|
+
</td>
|
|
293
|
+
</tr>
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
<tr>
|
|
297
|
+
<td class="col-md-4">
|
|
298
|
+
<div class="io-line">Defined in <a href="" data-line="92"
|
|
299
|
+
class="link-to-prism">src/lib/chip-list-iterator.directive.ts:92</a></div>
|
|
300
|
+
</td>
|
|
301
|
+
</tr>
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
<tr>
|
|
305
|
+
<td class="col-md-4">
|
|
306
|
+
|
|
307
|
+
<div class="io-description">
|
|
308
|
+
<b>Parameters :</b>
|
|
309
|
+
|
|
310
|
+
<table class="params">
|
|
311
|
+
<thead>
|
|
312
|
+
<tr>
|
|
313
|
+
<td>Name</td>
|
|
314
|
+
<td>Type</td>
|
|
315
|
+
<td>Optional</td>
|
|
316
|
+
</tr>
|
|
317
|
+
</thead>
|
|
318
|
+
<tbody>
|
|
319
|
+
<tr>
|
|
320
|
+
<td>changes</td>
|
|
321
|
+
<td>
|
|
322
|
+
<code>IterableChanges<string></code>
|
|
323
|
+
</td>
|
|
324
|
+
|
|
325
|
+
<td>
|
|
326
|
+
No
|
|
327
|
+
</td>
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
</tr>
|
|
331
|
+
</tbody>
|
|
332
|
+
</table>
|
|
333
|
+
</div>
|
|
334
|
+
<div class="io-description">
|
|
335
|
+
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
|
336
|
+
|
|
337
|
+
</div>
|
|
338
|
+
<div class="io-description">
|
|
339
|
+
|
|
340
|
+
</div>
|
|
341
|
+
</td>
|
|
342
|
+
</tr>
|
|
343
|
+
</tbody>
|
|
344
|
+
</table>
|
|
345
|
+
</section>
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
</div>
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
<div class="tab-pane fade tab-source-code" id="source">
|
|
352
|
+
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
|
|
353
|
+
Directive,
|
|
354
|
+
EmbeddedViewRef,
|
|
355
|
+
IterableChangeRecord,
|
|
356
|
+
IterableChanges,
|
|
357
|
+
IterableDiffer,
|
|
358
|
+
IterableDiffers,
|
|
359
|
+
OnDestroy,
|
|
360
|
+
OnInit,
|
|
361
|
+
TemplateRef,
|
|
362
|
+
ViewContainerRef,
|
|
363
|
+
} from '@angular/core';
|
|
364
|
+
import { NgControl } from '@angular/forms';
|
|
365
|
+
import { MatChipEvent } from '@angular/material/chips';
|
|
366
|
+
import { Subscription } from 'rxjs';
|
|
367
|
+
import {
|
|
368
|
+
filter,
|
|
369
|
+
startWith,
|
|
370
|
+
tap,
|
|
371
|
+
} from 'rxjs/operators';
|
|
372
|
+
|
|
373
|
+
function getTypeName(type: any): string {
|
|
374
|
+
return type['name'] || typeof type;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
export interface ChipListTemplateContext {
|
|
378
|
+
$implicit: string;
|
|
379
|
+
onRemoved: (event: MatChipEvent) => void;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
class RecordViewTuple {
|
|
383
|
+
constructor(
|
|
384
|
+
public record: any,
|
|
385
|
+
public view: EmbeddedViewRef<ChipListTemplateContext>,
|
|
386
|
+
) {
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
@Directive({
|
|
391
|
+
selector: '[rxapChipListIterator]',
|
|
392
|
+
standalone: true,
|
|
393
|
+
})
|
|
394
|
+
export class ChipListIteratorDirective implements OnInit, OnDestroy {
|
|
395
|
+
private _subscription?: Subscription;
|
|
396
|
+
|
|
397
|
+
private _dirty = true;
|
|
398
|
+
private _differ: IterableDiffer<string> | null = null;
|
|
399
|
+
|
|
400
|
+
constructor(
|
|
401
|
+
private readonly template: TemplateRef<ChipListTemplateContext>,
|
|
402
|
+
private readonly viewContainerRef: ViewContainerRef,
|
|
403
|
+
private readonly ngControl: NgControl,
|
|
404
|
+
private readonly differs: IterableDiffers,
|
|
405
|
+
) {
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
public ngOnInit() {
|
|
409
|
+
this._subscription = this.ngControl.valueChanges
|
|
410
|
+
?.pipe(
|
|
411
|
+
startWith(this.ngControl.value),
|
|
412
|
+
filter((value) => Array.isArray(value)),
|
|
413
|
+
tap((items) => {
|
|
414
|
+
this._dirty = false;
|
|
415
|
+
// React on ngForOf changes only once all inputs have been initialized
|
|
416
|
+
const value = items;
|
|
417
|
+
if (!this._differ && value) {
|
|
418
|
+
try {
|
|
419
|
+
this._differ = this.differs.find(value).create((_, item) => item);
|
|
420
|
+
} catch {
|
|
421
|
+
throw new Error(
|
|
422
|
+
`Cannot find a differ supporting object '${ value }' of type '${ getTypeName(
|
|
423
|
+
value,
|
|
424
|
+
) }'. NgFor only supports binding to Iterables such as Arrays.`,
|
|
425
|
+
);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
if (this._differ) {
|
|
429
|
+
const changes = this._differ.diff(items);
|
|
430
|
+
if (changes) {
|
|
431
|
+
this.applyChanges(changes);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}),
|
|
435
|
+
)
|
|
436
|
+
.subscribe();
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
public ngOnDestroy() {
|
|
440
|
+
this._subscription?.unsubscribe();
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
protected applyChanges(changes: IterableChanges<string>) {
|
|
444
|
+
const insertTuples: RecordViewTuple[] = [];
|
|
445
|
+
changes.forEachOperation(
|
|
446
|
+
(
|
|
447
|
+
item: IterableChangeRecord<any>,
|
|
448
|
+
adjustedPreviousIndex: number | null,
|
|
449
|
+
currentIndex: number | null,
|
|
450
|
+
) => {
|
|
451
|
+
if (item.previousIndex == null) {
|
|
452
|
+
// NgForOf is never "null" or "undefined" here because the differ detected
|
|
453
|
+
// that a new item needs to be inserted from the iterable. This implies that
|
|
454
|
+
// there is an iterable value for "_ngForOf".
|
|
455
|
+
const view = this.viewContainerRef.createEmbeddedView(
|
|
456
|
+
this.template,
|
|
457
|
+
{
|
|
458
|
+
$implicit: item.item,
|
|
459
|
+
onRemoved: this.onRemoved.bind(this),
|
|
460
|
+
},
|
|
461
|
+
currentIndex === null ? undefined : currentIndex,
|
|
462
|
+
);
|
|
463
|
+
const tuple = new RecordViewTuple(item, view);
|
|
464
|
+
insertTuples.push(tuple);
|
|
465
|
+
} else if (currentIndex == null) {
|
|
466
|
+
this.viewContainerRef.remove(
|
|
467
|
+
adjustedPreviousIndex === null ? undefined : adjustedPreviousIndex,
|
|
468
|
+
);
|
|
469
|
+
} else if (adjustedPreviousIndex !== null) {
|
|
470
|
+
const view = this.viewContainerRef.get(adjustedPreviousIndex)!;
|
|
471
|
+
this.viewContainerRef.move(view, currentIndex);
|
|
472
|
+
const tuple = new RecordViewTuple(
|
|
473
|
+
item,
|
|
474
|
+
<EmbeddedViewRef<ChipListTemplateContext>>view,
|
|
475
|
+
);
|
|
476
|
+
insertTuples.push(tuple);
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
);
|
|
480
|
+
|
|
481
|
+
for (let i = 0; i < insertTuples.length; i++) {
|
|
482
|
+
this.perViewChange(insertTuples[i].view, insertTuples[i].record);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
changes.forEachIdentityChange((record: any) => {
|
|
486
|
+
const viewRef = <EmbeddedViewRef<ChipListTemplateContext>>(
|
|
487
|
+
this.viewContainerRef.get(record.currentIndex)
|
|
488
|
+
);
|
|
489
|
+
viewRef.context.$implicit = record.item;
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
private onRemoved($event: MatChipEvent) {
|
|
494
|
+
this.ngControl.control?.setValue(
|
|
495
|
+
(this.ngControl.value ?? []).filter(
|
|
496
|
+
(item: any) => item !== $event.chip.value,
|
|
497
|
+
),
|
|
498
|
+
);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
private perViewChange(
|
|
502
|
+
view: EmbeddedViewRef<ChipListTemplateContext>,
|
|
503
|
+
record: IterableChangeRecord<any>,
|
|
504
|
+
) {
|
|
505
|
+
view.context.$implicit = record.item;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
</code></pre>
|
|
511
|
+
</div>
|
|
512
|
+
|
|
513
|
+
</div>
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
</div><div class="search-results">
|
|
529
|
+
<div class="has-results">
|
|
530
|
+
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
|
|
531
|
+
<ul class="search-results-list"></ul>
|
|
532
|
+
</div>
|
|
533
|
+
<div class="no-results">
|
|
534
|
+
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
|
|
535
|
+
</div>
|
|
536
|
+
</div>
|
|
537
|
+
</div>
|
|
538
|
+
<!-- END CONTENT -->
|
|
539
|
+
</div>
|
|
540
|
+
</div>
|
|
541
|
+
|
|
542
|
+
<label class="dark-mode-switch">
|
|
543
|
+
<input type="checkbox">
|
|
544
|
+
<span class="slider">
|
|
545
|
+
<svg class="slider-icon" viewBox="0 0 24 24" fill="none" height="20" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" width="20" xmlns="http://www.w3.org/2000/svg">
|
|
546
|
+
<path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"></path>
|
|
547
|
+
</svg>
|
|
548
|
+
</span>
|
|
549
|
+
</label>
|
|
550
|
+
|
|
551
|
+
<script>
|
|
552
|
+
var COMPODOC_CURRENT_PAGE_DEPTH = 1;
|
|
553
|
+
var COMPODOC_CURRENT_PAGE_CONTEXT = 'directive';
|
|
554
|
+
var COMPODOC_CURRENT_PAGE_URL = 'ChipListIteratorDirective.html';
|
|
555
|
+
var MAX_SEARCH_RESULTS = 15;
|
|
556
|
+
</script>
|
|
557
|
+
|
|
558
|
+
<script>
|
|
559
|
+
$darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
|
|
560
|
+
checkToggle(darkModeState);
|
|
561
|
+
if ($darkModeToggleSwitchers.length > 0) {
|
|
562
|
+
for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
|
|
563
|
+
$darkModeToggleSwitchers[i].addEventListener('change', function (event) {
|
|
564
|
+
darkModeState = !darkModeState;
|
|
565
|
+
toggleDarkMode(darkModeState);
|
|
566
|
+
});
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
</script>
|
|
570
|
+
|
|
571
|
+
<script src="../js/libs/custom-elements.min.js"></script>
|
|
572
|
+
<script src="../js/libs/lit-html.js"></script>
|
|
573
|
+
|
|
574
|
+
<script src="../js/menu-wc.js" defer></script>
|
|
575
|
+
<script nomodule src="../js/menu-wc_es5.js" defer></script>
|
|
576
|
+
|
|
577
|
+
<script src="../js/libs/bootstrap-native.js"></script>
|
|
578
|
+
|
|
579
|
+
<script src="../js/libs/es6-shim.min.js"></script>
|
|
580
|
+
<script src="../js/libs/EventDispatcher.js"></script>
|
|
581
|
+
<script src="../js/libs/promise.min.js"></script>
|
|
582
|
+
<script src="../js/libs/zepto.min.js"></script>
|
|
583
|
+
|
|
584
|
+
<script src="../js/compodoc.js"></script>
|
|
585
|
+
|
|
586
|
+
<script src="../js/tabs.js"></script>
|
|
587
|
+
<script src="../js/menu.js"></script>
|
|
588
|
+
<script src="../js/libs/clipboard.min.js"></script>
|
|
589
|
+
<script src="../js/libs/prism.js"></script>
|
|
590
|
+
<script src="../js/sourceCode.js"></script>
|
|
591
|
+
<script src="../js/search/search.js"></script>
|
|
592
|
+
<script src="../js/search/lunr.min.js"></script>
|
|
593
|
+
<script src="../js/search/search-lunr.js"></script>
|
|
594
|
+
<script src="../js/search/search_index.js"></script>
|
|
595
|
+
<script src="../js/lazy-load-graphs.js"></script>
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
</body>
|
|
599
|
+
</html>
|