@rxap/material-form-system 22.0.0-dev.0 → 22.0.0-dev.2
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 +39 -0
- package/README.md +5 -3
- package/compodoc/architecture.html +222 -0
- package/compodoc/changelog.html +83 -5
- package/compodoc/classes/ExtractHideShowMixin.html +95 -21
- package/compodoc/classes/RecordViewTuple.html +71 -18
- package/compodoc/components/FormControlsComponent.html +269 -165
- package/compodoc/dependencies.html +124 -35
- package/compodoc/directives/ChipInputAdapterDirective.html +83 -13
- package/compodoc/directives/ChipListIteratorDirective.html +98 -23
- package/compodoc/directives/CompareWithDirective.html +142 -57
- package/compodoc/directives/ControlErrorDirective.html +163 -56
- package/compodoc/directives/ControlErrorsDirective.html +120 -26
- package/compodoc/directives/FormFieldHideShowDirective.html +122 -33
- package/compodoc/directives/InputClearButtonDirective.html +125 -47
- package/compodoc/directives/RequiredDirective.html +98 -20
- package/compodoc/index.html +50 -8
- package/compodoc/interfaces/ChipListTemplateContext.html +155 -95
- package/compodoc/interfaces/ControlErrorDirectiveContext.html +149 -94
- package/compodoc/interfaces/ControlErrorsDirectiveContext.html +149 -94
- package/compodoc/js/architecture-graph.js +288 -0
- package/compodoc/js/libs/bootstrap-native.js +4 -2
- package/compodoc/js/libs/jszip.min.js +13 -0
- package/compodoc/js/libs/svg-pan-zoom.min.js +3 -3
- package/compodoc/js/libs/tablesort.min.js +3 -3
- package/compodoc/js/libs/tablesort.number.min.js +3 -3
- package/compodoc/js/libs/vis-network.min.js +78 -0
- package/compodoc/js/menu-wc.js +25 -12
- package/compodoc/js/menu.js +10 -11
- package/compodoc/js/routes/routes_index.js +1 -0
- package/compodoc/js/routes.js +142 -34
- package/compodoc/js/search/search-lunr.js +6 -8
- package/compodoc/js/search/search.js +118 -66
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/js/tabs.js +98 -15
- package/compodoc/js/tree.js +44 -7
- package/compodoc/license.html +48 -6
- package/compodoc/llms.txt +198 -0
- package/compodoc/miscellaneous/functions.html +132 -8
- package/compodoc/miscellaneous/variables.html +148 -5
- package/compodoc/modules.html +44 -3
- package/compodoc/overview.html +54 -3
- package/compodoc/properties.html +45 -4
- package/compodoc/routes.html +227 -0
- package/compodoc/styles/compodoc.css +365 -44
- package/compodoc/styles/dark.css +16 -0
- package/compodoc/template-playground/default-templates.json +192 -0
- package/compodoc/template-playground/hbs-render.service.ts +217 -0
- package/compodoc/template-playground/main.ts +9 -0
- package/compodoc/template-playground/template-editor.service.ts +173 -0
- package/compodoc/template-playground/template-playground.component.ts +614 -0
- package/compodoc/template-playground/template-playground.module.ts +29 -0
- package/compodoc/template-playground/zip-export.service.ts +86 -0
- package/compodoc/template-playground-app/app.js +1389 -0
- package/compodoc/template-playground-app/index.html +462 -0
- package/docs/documentation.json +951 -742
- package/docs/html/assets/hierarchy.js +1 -1
- package/docs/html/assets/highlight.css +1 -1
- package/docs/html/assets/icons.js +1 -1
- package/docs/html/assets/icons.svg +1 -1
- package/docs/html/assets/main.js +5 -5
- package/docs/html/assets/search.js +1 -1
- package/docs/html/assets/style.css +265 -228
- package/docs/html/classes/ChipInputAdapterDirective.html +97 -6
- package/docs/html/classes/ChipListIteratorDirective.html +109 -7
- package/docs/html/classes/CompareWithDirective.html +95 -5
- package/docs/html/classes/ControlErrorDirective.html +160 -12
- package/docs/html/classes/ControlErrorsDirective.html +154 -11
- package/docs/html/classes/ExtractHideShowMixin.html +141 -8
- package/docs/html/classes/FormControlsComponent.html +183 -15
- package/docs/html/classes/FormFieldHideShowDirective.html +210 -15
- package/docs/html/classes/InputClearButtonDirective.html +122 -7
- package/docs/html/classes/RequiredDirective.html +81 -4
- package/docs/html/hierarchy.html +33 -1
- package/docs/html/index.html +44 -7
- package/docs/html/interfaces/ChipListTemplateContext.html +61 -3
- package/docs/html/interfaces/ControlErrorDirectiveContext.html +61 -3
- package/docs/html/interfaces/ControlErrorsDirectiveContext.html +61 -3
- package/docs/html/modules.html +40 -1
- package/docs/markdown/README.md +6 -4
- package/docs/markdown/classes/ChipInputAdapterDirective.md +8 -8
- package/docs/markdown/classes/ChipListIteratorDirective.md +8 -8
- package/docs/markdown/classes/CompareWithDirective.md +7 -7
- package/docs/markdown/classes/ControlErrorDirective.md +18 -16
- package/docs/markdown/classes/ControlErrorsDirective.md +17 -15
- package/docs/markdown/classes/ExtractHideShowMixin.md +23 -23
- package/docs/markdown/classes/FormControlsComponent.md +22 -20
- package/docs/markdown/classes/FormFieldHideShowDirective.md +31 -28
- package/docs/markdown/classes/InputClearButtonDirective.md +10 -10
- package/docs/markdown/classes/RequiredDirective.md +6 -6
- package/docs/markdown/globals.md +2 -2
- package/docs/markdown/interfaces/ChipListTemplateContext.md +5 -5
- package/docs/markdown/interfaces/ControlErrorDirectiveContext.md +4 -4
- package/docs/markdown/interfaces/ControlErrorsDirectiveContext.md +4 -4
- package/docs/wiki/Class.ChipInputAdapterDirective.md +7 -7
- package/docs/wiki/Class.ChipListIteratorDirective.md +7 -7
- package/docs/wiki/Class.CompareWithDirective.md +6 -6
- package/docs/wiki/Class.ControlErrorDirective.md +17 -15
- package/docs/wiki/Class.ControlErrorsDirective.md +16 -14
- package/docs/wiki/Class.ExtractHideShowMixin.md +22 -22
- package/docs/wiki/Class.FormControlsComponent.md +21 -19
- package/docs/wiki/Class.FormFieldHideShowDirective.md +30 -27
- package/docs/wiki/Class.InputClearButtonDirective.md +9 -9
- package/docs/wiki/Class.RequiredDirective.md +5 -5
- package/docs/wiki/Home.md +5 -3
- package/docs/wiki/Interface.ChipListTemplateContext.md +4 -4
- package/docs/wiki/Interface.ControlErrorDirectiveContext.md +3 -3
- package/docs/wiki/Interface.ControlErrorsDirectiveContext.md +3 -3
- package/docs/wiki/globals.md +1 -1
- package/fesm2022/rxap-material-form-system.mjs +793 -754
- package/fesm2022/rxap-material-form-system.mjs.map +1 -1
- package/generators.json +16 -0
- package/package.json +34 -36
- package/src/generators/init/generator.js +120 -0
- package/src/generators/init/index.js +6 -0
- package/src/generators/init/schema.json +8 -0
- package/src/generators/package.json +3 -0
- package/types/rxap-material-form-system.d.ts +1 -0
- package/compodoc/js/libs/vis.min.js +0 -47
- package/compodoc/js/menu-wc_es5.js +0 -40
- package/compodoc/modules/MaterialFormSystemModule/dependencies.svg +0 -162
- package/compodoc/modules/MaterialFormSystemModule.html +0 -466
- package/theme.css +0 -1
|
@@ -61,6 +61,20 @@
|
|
|
61
61
|
}
|
|
62
62
|
toggleDarkMode(darkModeState);
|
|
63
63
|
</script>
|
|
64
|
+
<script>
|
|
65
|
+
// --- Iframe navigation tracking for Template Playground ---
|
|
66
|
+
function sendCurrentUrlToParent() {
|
|
67
|
+
if (window.parent && window.parent !== window) {
|
|
68
|
+
window.parent.postMessage({
|
|
69
|
+
type: 'compodoc-iframe-navigate',
|
|
70
|
+
url: window.location.pathname + window.location.hash
|
|
71
|
+
}, '*');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
window.addEventListener('hashchange', sendCurrentUrlToParent, false);
|
|
75
|
+
window.addEventListener('popstate', sendCurrentUrlToParent, false);
|
|
76
|
+
window.addEventListener('DOMContentLoaded', sendCurrentUrlToParent, false);
|
|
77
|
+
</script>
|
|
64
78
|
|
|
65
79
|
<div class="navbar navbar-default navbar-fixed-top d-md-none p-0">
|
|
66
80
|
<div class="d-flex">
|
|
@@ -70,7 +84,14 @@
|
|
|
70
84
|
</div>
|
|
71
85
|
|
|
72
86
|
<div class="xs-menu menu" id="mobile-menu">
|
|
73
|
-
<div id="book-search-input" role="search"
|
|
87
|
+
<div id="book-search-input" role="search">
|
|
88
|
+
<input type="text" placeholder="Type to search">
|
|
89
|
+
<button type="button"
|
|
90
|
+
class="search-input-clear"
|
|
91
|
+
aria-label="Clear search"
|
|
92
|
+
data-search-input-clear>×</button>
|
|
93
|
+
</div>
|
|
94
|
+
<compodoc-menu></compodoc-menu>
|
|
74
95
|
</div>
|
|
75
96
|
|
|
76
97
|
<div class="container-fluid main">
|
|
@@ -88,11 +109,20 @@
|
|
|
88
109
|
|
|
89
110
|
|
|
90
111
|
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
91
116
|
<ol class="breadcrumb">
|
|
92
117
|
<li class="breadcrumb-item">Directives</li>
|
|
93
118
|
<li class="breadcrumb-item" >InputClearButtonDirective</li>
|
|
94
119
|
</ol>
|
|
95
120
|
|
|
121
|
+
<div class="io-file io-file-path" data-compodoc="entity-file-path">
|
|
122
|
+
<span class="icon ion-ios-document" aria-hidden="true"></span>
|
|
123
|
+
<code>src/lib/input-clear-button.directive.ts</code>
|
|
124
|
+
</div>
|
|
125
|
+
|
|
96
126
|
<ul class="nav nav-tabs" role="tablist">
|
|
97
127
|
<li class="nav-item">
|
|
98
128
|
<a href="#info"
|
|
@@ -100,6 +130,12 @@
|
|
|
100
130
|
class="nav-link active"
|
|
101
131
|
role="tab" id="info-tab" data-bs-toggle="tab" data-link="info">Info</a>
|
|
102
132
|
</li>
|
|
133
|
+
<li class="nav-item">
|
|
134
|
+
<a href="#api"
|
|
135
|
+
class="nav-link"
|
|
136
|
+
|
|
137
|
+
role="tab" id="api-tab" data-bs-toggle="tab" data-link="api">API</a>
|
|
138
|
+
</li>
|
|
103
139
|
<li class="nav-item">
|
|
104
140
|
<a href="#source"
|
|
105
141
|
class="nav-link"
|
|
@@ -110,13 +146,6 @@
|
|
|
110
146
|
|
|
111
147
|
<div class="tab-content">
|
|
112
148
|
<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/input-clear-button.directive.ts</code>
|
|
118
|
-
</p>
|
|
119
|
-
|
|
120
149
|
|
|
121
150
|
|
|
122
151
|
|
|
@@ -143,69 +172,80 @@
|
|
|
143
172
|
</table>
|
|
144
173
|
</section>
|
|
145
174
|
|
|
175
|
+
|
|
176
|
+
</div>
|
|
177
|
+
|
|
178
|
+
<div class="tab-pane fade " id="api">
|
|
146
179
|
<section data-compodoc="block-index">
|
|
147
180
|
<h3 id="index">Index</h3>
|
|
148
|
-
|
|
149
|
-
|
|
181
|
+
<table class="table table-sm table-bordered index-table">
|
|
182
|
+
<tbody>
|
|
150
183
|
<tr>
|
|
151
|
-
<td class="col-md-
|
|
184
|
+
<td class="col-md-3">
|
|
152
185
|
<h6><b>Properties</b></h6>
|
|
153
186
|
</td>
|
|
154
|
-
|
|
155
|
-
<tr>
|
|
156
|
-
<td class="col-md-4">
|
|
187
|
+
<td class="col-md-9">
|
|
157
188
|
<ul class="index-list">
|
|
158
189
|
<li>
|
|
190
|
+
<span class="reference-badge reference-badge--property" aria-hidden="true">P</span>
|
|
159
191
|
<span class="modifier">Public</span>
|
|
160
192
|
<a href="#tabIndex" >tabIndex</a>
|
|
161
193
|
</li>
|
|
162
194
|
<li>
|
|
195
|
+
<span class="reference-badge reference-badge--property" aria-hidden="true">P</span>
|
|
163
196
|
<span class="modifier">Public</span>
|
|
164
197
|
<a href="#type" >type</a>
|
|
165
198
|
</li>
|
|
166
199
|
</ul>
|
|
167
200
|
</td>
|
|
168
201
|
</tr>
|
|
202
|
+
</tbody>
|
|
203
|
+
</table>
|
|
169
204
|
|
|
205
|
+
<table class="table table-sm table-bordered index-table">
|
|
206
|
+
<tbody>
|
|
170
207
|
<tr>
|
|
171
|
-
<td class="col-md-
|
|
208
|
+
<td class="col-md-3">
|
|
172
209
|
<h6><b>Methods</b></h6>
|
|
173
210
|
</td>
|
|
174
|
-
|
|
175
|
-
<tr>
|
|
176
|
-
<td class="col-md-4">
|
|
211
|
+
<td class="col-md-9">
|
|
177
212
|
<ul class="index-list">
|
|
178
213
|
<li>
|
|
214
|
+
<span class="reference-badge reference-badge--method" aria-hidden="true">M</span>
|
|
179
215
|
<span class="modifier">Public</span>
|
|
180
216
|
<a href="#onClick" >onClick</a>
|
|
181
217
|
</li>
|
|
182
218
|
</ul>
|
|
183
219
|
</td>
|
|
184
220
|
</tr>
|
|
221
|
+
</tbody>
|
|
222
|
+
</table>
|
|
185
223
|
|
|
186
224
|
|
|
187
225
|
|
|
188
226
|
|
|
189
227
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
</
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
</
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
228
|
+
<table class="table table-sm table-bordered index-table">
|
|
229
|
+
<tbody>
|
|
230
|
+
<tr>
|
|
231
|
+
<td class="col-md-3">
|
|
232
|
+
<h6><b>Accessors</b></h6>
|
|
233
|
+
</td>
|
|
234
|
+
<td class="col-md-9">
|
|
235
|
+
<ul class="index-list">
|
|
236
|
+
<li>
|
|
237
|
+
<span class="reference-badge reference-badge--accessor" aria-hidden="true">A</span>
|
|
238
|
+
<a href="#control" >control</a>
|
|
239
|
+
</li>
|
|
240
|
+
<li>
|
|
241
|
+
<span class="reference-badge reference-badge--accessor" aria-hidden="true">A</span>
|
|
242
|
+
<a href="#isDisabled" >isDisabled</a>
|
|
243
|
+
</li>
|
|
244
|
+
</ul>
|
|
245
|
+
</td>
|
|
246
|
+
</tr>
|
|
247
|
+
</tbody>
|
|
248
|
+
</table>
|
|
209
249
|
</section>
|
|
210
250
|
|
|
211
251
|
|
|
@@ -240,8 +280,8 @@
|
|
|
240
280
|
|
|
241
281
|
<tr>
|
|
242
282
|
<td class="col-md-4">
|
|
243
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
244
|
-
class="link-to-prism">src/lib/input-clear-button.directive.ts:
|
|
283
|
+
<div class="io-line">Defined in <a href="" data-line="56"
|
|
284
|
+
class="link-to-prism">src/lib/input-clear-button.directive.ts:56</a></div>
|
|
245
285
|
</td>
|
|
246
286
|
</tr>
|
|
247
287
|
|
|
@@ -258,6 +298,7 @@
|
|
|
258
298
|
</tbody>
|
|
259
299
|
</table>
|
|
260
300
|
</section>
|
|
301
|
+
|
|
261
302
|
<section data-compodoc="block-properties">
|
|
262
303
|
|
|
263
304
|
<h3 id="inputs">
|
|
@@ -288,7 +329,7 @@
|
|
|
288
329
|
</tr>
|
|
289
330
|
<tr>
|
|
290
331
|
<td class="col-md-4">
|
|
291
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
332
|
+
<div class="io-line">Defined in <a href="" data-line="46" class="link-to-prism">src/lib/input-clear-button.directive.ts:46</a></div>
|
|
292
333
|
</td>
|
|
293
334
|
</tr>
|
|
294
335
|
|
|
@@ -320,7 +361,7 @@
|
|
|
320
361
|
</tr>
|
|
321
362
|
<tr>
|
|
322
363
|
<td class="col-md-4">
|
|
323
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
364
|
+
<div class="io-line">Defined in <a href="" data-line="44" class="link-to-prism">src/lib/input-clear-button.directive.ts:44</a></div>
|
|
324
365
|
</td>
|
|
325
366
|
</tr>
|
|
326
367
|
|
|
@@ -349,7 +390,7 @@
|
|
|
349
390
|
</tr>
|
|
350
391
|
<tr>
|
|
351
392
|
<td class="col-md-4">
|
|
352
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
393
|
+
<div class="io-line">Defined in <a href="" data-line="48" class="link-to-prism">src/lib/input-clear-button.directive.ts:48</a></div>
|
|
353
394
|
</td>
|
|
354
395
|
</tr>
|
|
355
396
|
|
|
@@ -371,14 +412,13 @@
|
|
|
371
412
|
</tr>
|
|
372
413
|
<tr>
|
|
373
414
|
<td class="col-md-4">
|
|
374
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
415
|
+
<div class="io-line">Defined in <a href="" data-line="52" class="link-to-prism">src/lib/input-clear-button.directive.ts:52</a></div>
|
|
375
416
|
</td>
|
|
376
417
|
</tr>
|
|
377
418
|
|
|
378
419
|
</tbody>
|
|
379
420
|
</table>
|
|
380
421
|
</section>
|
|
381
|
-
|
|
382
422
|
</div>
|
|
383
423
|
|
|
384
424
|
|
|
@@ -389,7 +429,29 @@ import {
|
|
|
389
429
|
MatFormField,
|
|
390
430
|
MatFormFieldControl,
|
|
391
431
|
} from '@angular/material/form-field';
|
|
392
|
-
|
|
432
|
+
import { Showcase } from '@ng-prism/core';
|
|
433
|
+
|
|
434
|
+
const PRISM_FORM_STYLE = 'display: flex; flex-direction: column; gap: 8px; min-width: 280px';
|
|
435
|
+
|
|
436
|
+
@Showcase<InputClearButtonDirective>({
|
|
437
|
+
title: 'Input Clear Button',
|
|
438
|
+
category: 'Material Form System',
|
|
439
|
+
description: 'A button that resets the value of the control of the form field to null.',
|
|
440
|
+
status: 'stable',
|
|
441
|
+
imports: [
|
|
442
|
+
{ name: 'ReactiveFormsModule', from: '@angular/forms' },
|
|
443
|
+
{ name: 'FormDirective', from: '@rxap/forms' },
|
|
444
|
+
{ name: 'MatFormFieldModule', from: '@angular/material/form-field' },
|
|
445
|
+
{ name: 'MatInputModule', from: '@angular/material/input' },
|
|
446
|
+
{ name: 'MatButtonModule', from: '@angular/material/button' },
|
|
447
|
+
],
|
|
448
|
+
host: {
|
|
449
|
+
template: `<form rxapForm style="${ PRISM_FORM_STYLE }"><mat-form-field><mat-label>Name</mat-label><input matInput formControlName="name" /><button matSuffix mat-icon-button rxapInputClearButton aria-label="Clear">&times;</button></mat-form-field></form>`,
|
|
450
|
+
},
|
|
451
|
+
variants: [
|
|
452
|
+
{ name: 'Default' },
|
|
453
|
+
],
|
|
454
|
+
})
|
|
393
455
|
@Directive({
|
|
394
456
|
selector: '[rxapInputClearButton]',
|
|
395
457
|
standalone: true,
|
|
@@ -483,6 +545,24 @@ export class InputClearButtonDirective {
|
|
|
483
545
|
|
|
484
546
|
<script>
|
|
485
547
|
$darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
|
|
548
|
+
var updateDarkModeSwitchOffset = function () {
|
|
549
|
+
var content = document.querySelector('.content');
|
|
550
|
+
var scrollbarWidth = 0;
|
|
551
|
+
|
|
552
|
+
if (content) {
|
|
553
|
+
scrollbarWidth = Math.max(0, content.offsetWidth - content.clientWidth);
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
document.documentElement.style.setProperty(
|
|
557
|
+
'--content-scrollbar-width',
|
|
558
|
+
scrollbarWidth + 'px'
|
|
559
|
+
);
|
|
560
|
+
};
|
|
561
|
+
|
|
562
|
+
updateDarkModeSwitchOffset();
|
|
563
|
+
requestAnimationFrame(updateDarkModeSwitchOffset);
|
|
564
|
+
window.addEventListener('resize', updateDarkModeSwitchOffset);
|
|
565
|
+
|
|
486
566
|
checkToggle(darkModeState);
|
|
487
567
|
if ($darkModeToggleSwitchers.length > 0) {
|
|
488
568
|
for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
|
|
@@ -498,14 +578,12 @@ export class InputClearButtonDirective {
|
|
|
498
578
|
<script src="../js/libs/lit-html.js"></script>
|
|
499
579
|
|
|
500
580
|
<script src="../js/menu-wc.js" defer></script>
|
|
501
|
-
<script nomodule src="../js/menu-wc_es5.js" defer></script>
|
|
502
581
|
|
|
503
582
|
<script src="../js/libs/bootstrap-native.js"></script>
|
|
504
583
|
|
|
505
584
|
<script src="../js/libs/es6-shim.min.js"></script>
|
|
506
585
|
<script src="../js/libs/EventDispatcher.js"></script>
|
|
507
586
|
<script src="../js/libs/promise.min.js"></script>
|
|
508
|
-
<script src="../js/libs/zepto.min.js"></script>
|
|
509
587
|
|
|
510
588
|
<script src="../js/compodoc.js"></script>
|
|
511
589
|
|
|
@@ -61,6 +61,20 @@
|
|
|
61
61
|
}
|
|
62
62
|
toggleDarkMode(darkModeState);
|
|
63
63
|
</script>
|
|
64
|
+
<script>
|
|
65
|
+
// --- Iframe navigation tracking for Template Playground ---
|
|
66
|
+
function sendCurrentUrlToParent() {
|
|
67
|
+
if (window.parent && window.parent !== window) {
|
|
68
|
+
window.parent.postMessage({
|
|
69
|
+
type: 'compodoc-iframe-navigate',
|
|
70
|
+
url: window.location.pathname + window.location.hash
|
|
71
|
+
}, '*');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
window.addEventListener('hashchange', sendCurrentUrlToParent, false);
|
|
75
|
+
window.addEventListener('popstate', sendCurrentUrlToParent, false);
|
|
76
|
+
window.addEventListener('DOMContentLoaded', sendCurrentUrlToParent, false);
|
|
77
|
+
</script>
|
|
64
78
|
|
|
65
79
|
<div class="navbar navbar-default navbar-fixed-top d-md-none p-0">
|
|
66
80
|
<div class="d-flex">
|
|
@@ -70,7 +84,14 @@
|
|
|
70
84
|
</div>
|
|
71
85
|
|
|
72
86
|
<div class="xs-menu menu" id="mobile-menu">
|
|
73
|
-
<div id="book-search-input" role="search"
|
|
87
|
+
<div id="book-search-input" role="search">
|
|
88
|
+
<input type="text" placeholder="Type to search">
|
|
89
|
+
<button type="button"
|
|
90
|
+
class="search-input-clear"
|
|
91
|
+
aria-label="Clear search"
|
|
92
|
+
data-search-input-clear>×</button>
|
|
93
|
+
</div>
|
|
94
|
+
<compodoc-menu></compodoc-menu>
|
|
74
95
|
</div>
|
|
75
96
|
|
|
76
97
|
<div class="container-fluid main">
|
|
@@ -88,11 +109,20 @@
|
|
|
88
109
|
|
|
89
110
|
|
|
90
111
|
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
91
116
|
<ol class="breadcrumb">
|
|
92
117
|
<li class="breadcrumb-item">Directives</li>
|
|
93
118
|
<li class="breadcrumb-item" >RequiredDirective</li>
|
|
94
119
|
</ol>
|
|
95
120
|
|
|
121
|
+
<div class="io-file io-file-path" data-compodoc="entity-file-path">
|
|
122
|
+
<span class="icon ion-ios-document" aria-hidden="true"></span>
|
|
123
|
+
<code>src/lib/required.directive.ts</code>
|
|
124
|
+
</div>
|
|
125
|
+
|
|
96
126
|
<ul class="nav nav-tabs" role="tablist">
|
|
97
127
|
<li class="nav-item">
|
|
98
128
|
<a href="#info"
|
|
@@ -110,13 +140,6 @@
|
|
|
110
140
|
|
|
111
141
|
<div class="tab-content">
|
|
112
142
|
<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/required.directive.ts</code>
|
|
118
|
-
</p>
|
|
119
|
-
|
|
120
143
|
|
|
121
144
|
|
|
122
145
|
|
|
@@ -124,7 +147,7 @@
|
|
|
124
147
|
<h3>Implements</h3>
|
|
125
148
|
</p>
|
|
126
149
|
<p class="comment">
|
|
127
|
-
|
|
150
|
+
<code><a href="https://angular.dev/api/core/AfterContentInit" target="_blank" >AfterContentInit</a></code>
|
|
128
151
|
</p>
|
|
129
152
|
|
|
130
153
|
|
|
@@ -149,25 +172,64 @@
|
|
|
149
172
|
</table>
|
|
150
173
|
</section>
|
|
151
174
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
175
|
+
<section data-compodoc="block-relationships">
|
|
176
|
+
<h3>Relationships</h3>
|
|
177
|
+
|
|
178
|
+
<div class="row pt-3">
|
|
179
|
+
<div class="col-sm-6">
|
|
180
|
+
<h4>Used by</h4>
|
|
181
|
+
<p class="comment"><i>No results matching.</i></p>
|
|
182
|
+
</div>
|
|
183
|
+
|
|
184
|
+
<div class="col-sm-6">
|
|
185
|
+
<h4>Depends on</h4>
|
|
186
|
+
<ul class="list-unstyled relationships-list">
|
|
187
|
+
<li>
|
|
188
|
+
<code><a href="https://angular.dev/api/core/AfterContentInit" target="_blank" >AfterContentInit</a></code>
|
|
189
|
+
</li>
|
|
190
|
+
</ul>
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
</section>
|
|
160
194
|
|
|
161
195
|
</div>
|
|
162
196
|
|
|
163
197
|
|
|
198
|
+
|
|
164
199
|
<div class="tab-pane fade tab-source-code" id="source">
|
|
165
200
|
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { AfterContentInit, Directive, inject } from '@angular/core';
|
|
166
201
|
import {
|
|
167
202
|
MAT_FORM_FIELD,
|
|
168
203
|
MatFormField,
|
|
169
204
|
} from '@angular/material/form-field';
|
|
170
|
-
|
|
205
|
+
import { Showcase } from '@ng-prism/core';
|
|
206
|
+
|
|
207
|
+
const PRISM_FORM_STYLE = 'display: flex; flex-direction: column; gap: 8px; min-width: 280px';
|
|
208
|
+
|
|
209
|
+
@Showcase<RequiredDirective>({
|
|
210
|
+
title: 'Required',
|
|
211
|
+
category: 'Material Form System',
|
|
212
|
+
description: 'Marks the form field as required if the control of the input has a required validator.',
|
|
213
|
+
status: 'stable',
|
|
214
|
+
imports: [
|
|
215
|
+
{ name: 'ReactiveFormsModule', from: '@angular/forms' },
|
|
216
|
+
{ name: 'FormDirective', from: '@rxap/forms' },
|
|
217
|
+
{ name: 'MatFormFieldModule', from: '@angular/material/form-field' },
|
|
218
|
+
{ name: 'MatInputModule', from: '@angular/material/input' },
|
|
219
|
+
],
|
|
220
|
+
variants: [
|
|
221
|
+
{
|
|
222
|
+
name: 'Required control',
|
|
223
|
+
description: 'The control has a required validator, so the form field shows the required marker.',
|
|
224
|
+
host: { template: `<form rxapForm style="${ PRISM_FORM_STYLE }"><mat-form-field><mat-label>Name</mat-label><input matInput formControlName="name" rxapRequired /></mat-form-field></form>` },
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
name: 'With error message',
|
|
228
|
+
description: 'Clear the field and leave it to show the error message rendered by the control error directive.',
|
|
229
|
+
host: { template: `<form rxapForm style="${ PRISM_FORM_STYLE }"><mat-form-field><mat-label>Email</mat-label><input matInput formControlName="email" rxapRequired /><mat-error *rxapControlError="let error; key: 'required'">The email is required</mat-error></mat-form-field></form>` },
|
|
230
|
+
},
|
|
231
|
+
],
|
|
232
|
+
})
|
|
171
233
|
@Directive({
|
|
172
234
|
selector: '[formControlName][rxapRequired],[formControl][rxapRequired]',
|
|
173
235
|
standalone: true,
|
|
@@ -241,6 +303,24 @@ export class RequiredDirective implements AfterContentInit {
|
|
|
241
303
|
|
|
242
304
|
<script>
|
|
243
305
|
$darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
|
|
306
|
+
var updateDarkModeSwitchOffset = function () {
|
|
307
|
+
var content = document.querySelector('.content');
|
|
308
|
+
var scrollbarWidth = 0;
|
|
309
|
+
|
|
310
|
+
if (content) {
|
|
311
|
+
scrollbarWidth = Math.max(0, content.offsetWidth - content.clientWidth);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
document.documentElement.style.setProperty(
|
|
315
|
+
'--content-scrollbar-width',
|
|
316
|
+
scrollbarWidth + 'px'
|
|
317
|
+
);
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
updateDarkModeSwitchOffset();
|
|
321
|
+
requestAnimationFrame(updateDarkModeSwitchOffset);
|
|
322
|
+
window.addEventListener('resize', updateDarkModeSwitchOffset);
|
|
323
|
+
|
|
244
324
|
checkToggle(darkModeState);
|
|
245
325
|
if ($darkModeToggleSwitchers.length > 0) {
|
|
246
326
|
for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
|
|
@@ -256,14 +336,12 @@ export class RequiredDirective implements AfterContentInit {
|
|
|
256
336
|
<script src="../js/libs/lit-html.js"></script>
|
|
257
337
|
|
|
258
338
|
<script src="../js/menu-wc.js" defer></script>
|
|
259
|
-
<script nomodule src="../js/menu-wc_es5.js" defer></script>
|
|
260
339
|
|
|
261
340
|
<script src="../js/libs/bootstrap-native.js"></script>
|
|
262
341
|
|
|
263
342
|
<script src="../js/libs/es6-shim.min.js"></script>
|
|
264
343
|
<script src="../js/libs/EventDispatcher.js"></script>
|
|
265
344
|
<script src="../js/libs/promise.min.js"></script>
|
|
266
|
-
<script src="../js/libs/zepto.min.js"></script>
|
|
267
345
|
|
|
268
346
|
<script src="../js/compodoc.js"></script>
|
|
269
347
|
|
package/compodoc/index.html
CHANGED
|
@@ -61,6 +61,20 @@
|
|
|
61
61
|
}
|
|
62
62
|
toggleDarkMode(darkModeState);
|
|
63
63
|
</script>
|
|
64
|
+
<script>
|
|
65
|
+
// --- Iframe navigation tracking for Template Playground ---
|
|
66
|
+
function sendCurrentUrlToParent() {
|
|
67
|
+
if (window.parent && window.parent !== window) {
|
|
68
|
+
window.parent.postMessage({
|
|
69
|
+
type: 'compodoc-iframe-navigate',
|
|
70
|
+
url: window.location.pathname + window.location.hash
|
|
71
|
+
}, '*');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
window.addEventListener('hashchange', sendCurrentUrlToParent, false);
|
|
75
|
+
window.addEventListener('popstate', sendCurrentUrlToParent, false);
|
|
76
|
+
window.addEventListener('DOMContentLoaded', sendCurrentUrlToParent, false);
|
|
77
|
+
</script>
|
|
64
78
|
|
|
65
79
|
<div class="navbar navbar-default navbar-fixed-top d-md-none p-0">
|
|
66
80
|
<div class="d-flex">
|
|
@@ -70,7 +84,14 @@
|
|
|
70
84
|
</div>
|
|
71
85
|
|
|
72
86
|
<div class="xs-menu menu" id="mobile-menu">
|
|
73
|
-
<div id="book-search-input" role="search"
|
|
87
|
+
<div id="book-search-input" role="search">
|
|
88
|
+
<input type="text" placeholder="Type to search">
|
|
89
|
+
<button type="button"
|
|
90
|
+
class="search-input-clear"
|
|
91
|
+
aria-label="Clear search"
|
|
92
|
+
data-search-input-clear>×</button>
|
|
93
|
+
</div>
|
|
94
|
+
<compodoc-menu></compodoc-menu>
|
|
74
95
|
</div>
|
|
75
96
|
|
|
76
97
|
<div class="container-fluid main">
|
|
@@ -79,9 +100,10 @@
|
|
|
79
100
|
<compodoc-menu mode="normal"></compodoc-menu>
|
|
80
101
|
</div>
|
|
81
102
|
<!-- START CONTENT -->
|
|
82
|
-
<div class="content
|
|
103
|
+
<div class="content readme">
|
|
83
104
|
<div class="content-data">
|
|
84
105
|
|
|
106
|
+
|
|
85
107
|
<p>Provides directives and a module to enhance Angular Material forms. It includes features such as displaying control errors, clearing input fields, handling required fields, and managing form field visibility based on defined conditions. The package also offers a form controls component with built-in reset, cancel, and submit functionalities.</p>
|
|
86
108
|
<p><a href="https://www.npmjs.com/package/@rxap/material-form-system"><img src="https://img.shields.io/npm/v/@rxap/material-form-system?style=flat-square" alt="npm version" class="img-responsive"></a>
|
|
87
109
|
<a href="https://commitizen.github.io/cz-cli/"><img src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square" alt="commitizen friendly" class="img-responsive"></a>
|
|
@@ -98,9 +120,10 @@
|
|
|
98
120
|
</ul>
|
|
99
121
|
<h1>Installation</h1>
|
|
100
122
|
<p><strong>Add the package to your workspace:</strong></p>
|
|
101
|
-
<b>Example :</b><div><pre class="line-numbers"><code class="language-bash">
|
|
102
|
-
<
|
|
103
|
-
<b>Example :</b><div><pre class="line-numbers"><code class="language-bash">
|
|
123
|
+
<b>Example :</b><div><pre class="line-numbers"><code class="language-bash">npm install @rxap/material-form-system</code></pre></div><p>With pnpm or yarn use <code>pnpm add</code> or <code>yarn add</code> instead of <code>npm install</code>.</p>
|
|
124
|
+
<p><strong>Install peer dependencies:</strong></p>
|
|
125
|
+
<b>Example :</b><div><pre class="line-numbers"><code class="language-bash">npm install @angular/cdk @angular/common @angular/core @angular/forms @angular/material @angular/router @rxap/form-system @rxap/forms @rxap/mixin @rxap/reflect-metadata @rxap/utilities rxjs </code></pre></div><p><strong>Execute the init generator:</strong></p>
|
|
126
|
+
<b>Example :</b><div><pre class="line-numbers"><code class="language-bash">nx g @rxap/material-form-system:init</code></pre></div><h1>Generators</h1>
|
|
104
127
|
<h2>init</h2>
|
|
105
128
|
<blockquote>
|
|
106
129
|
<p>Initialize the package in the workspace</p>
|
|
@@ -123,6 +146,9 @@
|
|
|
123
146
|
|
|
124
147
|
|
|
125
148
|
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
126
152
|
|
|
127
153
|
|
|
128
154
|
|
|
@@ -151,13 +177,31 @@
|
|
|
151
177
|
|
|
152
178
|
<script>
|
|
153
179
|
var COMPODOC_CURRENT_PAGE_DEPTH = 0;
|
|
154
|
-
var COMPODOC_CURRENT_PAGE_CONTEXT = '
|
|
180
|
+
var COMPODOC_CURRENT_PAGE_CONTEXT = 'readme';
|
|
155
181
|
var COMPODOC_CURRENT_PAGE_URL = 'index.html';
|
|
156
182
|
var MAX_SEARCH_RESULTS = 15;
|
|
157
183
|
</script>
|
|
158
184
|
|
|
159
185
|
<script>
|
|
160
186
|
$darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
|
|
187
|
+
var updateDarkModeSwitchOffset = function () {
|
|
188
|
+
var content = document.querySelector('.content');
|
|
189
|
+
var scrollbarWidth = 0;
|
|
190
|
+
|
|
191
|
+
if (content) {
|
|
192
|
+
scrollbarWidth = Math.max(0, content.offsetWidth - content.clientWidth);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
document.documentElement.style.setProperty(
|
|
196
|
+
'--content-scrollbar-width',
|
|
197
|
+
scrollbarWidth + 'px'
|
|
198
|
+
);
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
updateDarkModeSwitchOffset();
|
|
202
|
+
requestAnimationFrame(updateDarkModeSwitchOffset);
|
|
203
|
+
window.addEventListener('resize', updateDarkModeSwitchOffset);
|
|
204
|
+
|
|
161
205
|
checkToggle(darkModeState);
|
|
162
206
|
if ($darkModeToggleSwitchers.length > 0) {
|
|
163
207
|
for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
|
|
@@ -173,14 +217,12 @@
|
|
|
173
217
|
<script src="./js/libs/lit-html.js"></script>
|
|
174
218
|
|
|
175
219
|
<script src="./js/menu-wc.js" defer></script>
|
|
176
|
-
<script nomodule src="./js/menu-wc_es5.js" defer></script>
|
|
177
220
|
|
|
178
221
|
<script src="./js/libs/bootstrap-native.js"></script>
|
|
179
222
|
|
|
180
223
|
<script src="./js/libs/es6-shim.min.js"></script>
|
|
181
224
|
<script src="./js/libs/EventDispatcher.js"></script>
|
|
182
225
|
<script src="./js/libs/promise.min.js"></script>
|
|
183
|
-
<script src="./js/libs/zepto.min.js"></script>
|
|
184
226
|
|
|
185
227
|
<script src="./js/compodoc.js"></script>
|
|
186
228
|
|