@rxap/form-system 18.2.2-dev.0 → 19.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 +8 -0
- package/README.md +1 -1
- package/compodoc/changelog.html +43 -0
- package/compodoc/classes/ExtractFunctionMixin.html +466 -0
- package/compodoc/classes/ExtractFunctionsMixin.html +434 -0
- package/compodoc/classes/ExtractIsValueFunctionMixin.html +407 -0
- package/compodoc/classes/ExtractToDisplayFunctionMixin.html +407 -0
- package/compodoc/dependencies.html +17 -17
- package/compodoc/directives/AutocompleteOptionsFromMethodDirective.html +162 -181
- package/compodoc/directives/OptionsFromMethodDirective.html +20 -19
- package/compodoc/index.html +1 -1
- package/compodoc/injectables/NoopResolveMethod.html +622 -0
- package/compodoc/interfaces/AutocompleteOptionsFromMethodDirectiveParameters.html +95 -18
- package/compodoc/interfaces/AutocompleteOptionsFromMethodDirectiveSettings.html +95 -18
- package/compodoc/interfaces/AutocompleteOptionsFromRemoteMethodTemplateContext.html +95 -18
- package/compodoc/interfaces/OptionsFromMethodDirectiveSettings.html +2 -1
- package/compodoc/interfaces/OptionsFromMethodTemplateContext.html +2 -1
- package/compodoc/interfaces/UseFunctionConfig.html +360 -0
- package/compodoc/interfaces/UseFunctionDefinition.html +399 -0
- package/compodoc/js/menu-wc.js +21 -0
- package/compodoc/js/menu-wc_es5.js +2 -2
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/miscellaneous/functions.html +738 -30
- package/compodoc/miscellaneous/typealiases.html +59 -0
- package/compodoc/miscellaneous/variables.html +96 -0
- package/compodoc/overview.html +3 -3
- package/compodoc/properties.html +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/AutocompleteOptionsFromMethodDirective.html +44 -0
- package/docs/classes/ControlDataSource.html +12 -12
- package/docs/classes/ControlHideShowDirective.html +2 -2
- package/docs/classes/ExtractControlFromParentMixin.html +2 -2
- package/docs/classes/ExtractControlMixin.html +2 -2
- package/docs/classes/ExtractDataSourcesMixin.html +2 -2
- package/docs/classes/ExtractFormDefinitionMixin.html +2 -2
- package/docs/classes/ExtractFunctionMixin.html +5 -0
- package/docs/classes/ExtractFunctionsMixin.html +3 -0
- package/docs/classes/ExtractIsValueFunctionMixin.html +11 -0
- package/docs/classes/ExtractMethodMixin.html +2 -2
- package/docs/classes/ExtractMethodsMixin.html +2 -2
- package/docs/classes/ExtractOptionsDataSourceMixin.html +2 -2
- package/docs/classes/ExtractOptionsMethodMixin.html +2 -2
- package/docs/classes/ExtractRemoteMethodsMixin.html +2 -2
- package/docs/classes/ExtractResolveMethodMixin.html +2 -2
- package/docs/classes/ExtractToDisplayFunctionMixin.html +11 -0
- package/docs/classes/ForFormArrayItemsDirective.html +2 -2
- package/docs/classes/FormArrayAddItemButtonDirective.html +2 -2
- package/docs/classes/FormArrayItemButton.html +3 -2
- package/docs/classes/FormArrayItemRemoveButtonDirective.html +7 -2
- package/docs/classes/FormArrayItemRestoreButtonDirective.html +3 -2
- package/docs/classes/FormArrayRemovableDirective.html +3 -3
- package/docs/classes/FormSystemControlDirective.html +3 -3
- package/docs/classes/FormSystemDirectivesModule.html +1 -1
- package/docs/classes/InputSelectOptionsDirective.html +3 -3
- package/docs/classes/IsEqualToDirective.html +3 -3
- package/docs/classes/IsSelectableValueDirective.html +2 -2
- package/docs/classes/NoopResolveMethod.html +3 -0
- package/docs/classes/OptionsFromMethodDirective.html +3 -3
- package/docs/classes/OptionsFromRemoteMethodDirective.html +3 -3
- package/docs/classes/RxapFormSystemError.html +5 -15
- package/docs/classes/SubmitContextFormAdapter.html +9 -9
- package/docs/classes/TestNgControl.html +24 -24
- package/docs/documentation.json +17918 -8072
- package/docs/enums/FormSystemMetadataKeys.html +2 -2
- package/docs/functions/ApplyUseFunctionAdapters.html +1 -0
- package/docs/functions/ApplyUseMethodAdapters.html +1 -1
- package/docs/functions/ComposeOptionsTransformers.html +1 -1
- package/docs/functions/FormContextFromActivatedRouteFactory.html +1 -1
- package/docs/functions/ResolveByUuidParameter.html +1 -1
- package/docs/functions/ResolveByUuidResultFactory.html +1 -1
- package/docs/functions/SubmitContextFormAdapterFactory.html +1 -1
- package/docs/functions/UseAutocompleteIsValueFunction.html +1 -0
- package/docs/functions/UseAutocompleteOptionsMethod.html +1 -0
- package/docs/functions/UseAutocompleteResolveMethod.html +1 -0
- package/docs/functions/UseAutocompleteToDisplayFunction.html +1 -0
- package/docs/functions/UseComponent.html +1 -1
- package/docs/functions/UseDataSource.html +1 -1
- package/docs/functions/UseFormComponent.html +1 -1
- package/docs/functions/UseFunction.html +1 -0
- package/docs/functions/UseHideFunction.html +1 -1
- package/docs/functions/UseIsValueFunction.html +1 -0
- package/docs/functions/UseMethod.html +1 -1
- package/docs/functions/UseOptionsDataSource.html +1 -1
- package/docs/functions/UseOptionsMethod.html +1 -1
- package/docs/functions/UseOptionsRemoteMethod.html +1 -1
- package/docs/functions/UseRemoteMethod.html +1 -1
- package/docs/functions/UseResolveMethod.html +1 -1
- package/docs/functions/UseShowFunction.html +1 -1
- package/docs/functions/UseToDisplayFunction.html +1 -0
- package/docs/functions/controlDataSource-1.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +1 -1
- package/docs/interfaces/AutocompleteOptionsFromMethodDirectiveParameters.html +2 -0
- package/docs/interfaces/AutocompleteOptionsFromMethodDirectiveSettings.html +2 -0
- package/docs/interfaces/AutocompleteOptionsFromRemoteMethodTemplateContext.html +2 -0
- package/docs/interfaces/ControlHideShowOptions.html +2 -2
- package/docs/interfaces/ControlWithDataSource.html +2 -2
- package/docs/interfaces/ForFormArrayItemsDirectiveContext.html +2 -2
- package/docs/interfaces/InputSelectOptionsSettings.html +4 -4
- package/docs/interfaces/InputSelectOptionsTemplateContext.html +2 -2
- package/docs/interfaces/OptionsFromMethodDirectiveSettings.html +1 -1
- package/docs/interfaces/OptionsFromMethodTemplateContext.html +2 -2
- package/docs/interfaces/OptionsFromRemoteMethodTemplateContext.html +2 -2
- package/docs/interfaces/UseDataSourceSettings.html +2 -2
- package/docs/interfaces/UseDataSourceValue.html +3 -3
- package/docs/interfaces/UseFunctionConfig.html +2 -0
- package/docs/interfaces/UseFunctionDefinition.html +3 -0
- package/docs/interfaces/UseMethodConfig.html +2 -2
- package/docs/interfaces/UseMethodDefinition.html +2 -2
- package/docs/modules.html +28 -3
- package/docs/types/ControlHideShowFunction.html +1 -1
- package/docs/types/FunctionParameterAdapterFunction.html +1 -0
- package/docs/types/FunctionResultAdapterFunction.html +1 -0
- package/docs/types/MethodParameterAdapterFunction.html +1 -1
- package/docs/types/MethodResultAdapterFunction.html +1 -1
- package/docs/types/UseFunctionType.html +1 -0
- package/docs/types/UseOptionsDataSourceSettings.html +1 -1
- package/docs/variables/DATA_SOURCE_NAME.html +1 -1
- package/docs/variables/IS_VALUE_FUNCTION_NAME.html +1 -0
- package/docs/variables/OPTIONS_METHOD_NAME.html +1 -1
- package/docs/variables/REMOTE_METHOD_NAME.html +1 -1
- package/docs/variables/RESOLVE_METHOD_NAME.html +1 -1
- package/docs/variables/RXAP_FORM_CONTROL_SOURCE.html +1 -1
- package/docs/variables/RXAP_FORM_SYSTEM_HIDE_METADATA.html +1 -1
- package/docs/variables/RXAP_FORM_SYSTEM_HIDE_SHOW_OPTIONS.html +1 -1
- package/docs/variables/RXAP_FORM_SYSTEM_SHOW_METADATA.html +1 -1
- package/docs/variables/RXAP_USE_FUNCTION.html +1 -0
- package/docs/variables/RXAP_USE_METHOD.html +1 -1
- package/docs/variables/RXAP_USE_REMOTE_METHOD.html +1 -1
- package/docs/variables/SUBMIT_CONTEXT_FORM_ADAPTER_METHOD.html +1 -1
- package/docs/variables/TO_DISPLAY_FUNCTION_NAME.html +1 -0
- package/fesm2022/rxap-form-system.mjs +55 -55
- package/fesm2022/rxap-form-system.mjs.map +1 -1
- package/lib/directives/array/form-array-item-button.d.ts +1 -1
- package/package.json +42 -45
- package/theme.css +177 -1
- package/esm2022/index.mjs +0 -54
- package/esm2022/lib/control-data-source.mjs +0 -40
- package/esm2022/lib/control-with-data-source.mjs +0 -2
- package/esm2022/lib/decorators/metadata-keys.mjs +0 -8
- package/esm2022/lib/decorators/use-component.mjs +0 -9
- package/esm2022/lib/decorators/use-data-source.mjs +0 -12
- package/esm2022/lib/decorators/use-form-component.mjs +0 -13
- package/esm2022/lib/directives/array/for-form-array-items.directive.mjs +0 -64
- package/esm2022/lib/directives/array/form-array-add-item-button.directive.mjs +0 -61
- package/esm2022/lib/directives/array/form-array-item-button.mjs +0 -80
- package/esm2022/lib/directives/array/form-array-item-remove-button.directive.mjs +0 -47
- package/esm2022/lib/directives/array/form-array-item-restore-button.directive.mjs +0 -30
- package/esm2022/lib/directives/array/form-array-removable.directive.mjs +0 -68
- package/esm2022/lib/directives/autocomplete-options-from-method.directive.mjs +0 -182
- package/esm2022/lib/directives/control-hide-show.directive.mjs +0 -172
- package/esm2022/lib/directives/form-directives.module.mjs +0 -25
- package/esm2022/lib/directives/input-select-options.directive.mjs +0 -181
- package/esm2022/lib/directives/options-from-method.directive.mjs +0 -95
- package/esm2022/lib/directives/options-from-remote-method.directive.mjs +0 -132
- package/esm2022/lib/directives/test-ng-control.mjs +0 -14
- package/esm2022/lib/error.mjs +0 -7
- package/esm2022/lib/form-context-from-activated-route.factory.mjs +0 -4
- package/esm2022/lib/form-system-control.directive.mjs +0 -147
- package/esm2022/lib/mixins/adapters.mjs +0 -13
- package/esm2022/lib/mixins/apply-use-function.adapters.mjs +0 -32
- package/esm2022/lib/mixins/apply-use-method.adapters.mjs +0 -33
- package/esm2022/lib/mixins/extract-control-from-parent.mixin.mjs +0 -23
- package/esm2022/lib/mixins/extract-control.mixin.mjs +0 -17
- package/esm2022/lib/mixins/extract-data-sources.mixin.mjs +0 -16
- package/esm2022/lib/mixins/extract-form-definition.mixin.mjs +0 -12
- package/esm2022/lib/mixins/extract-function.mixin.mjs +0 -22
- package/esm2022/lib/mixins/extract-functions.mixin.mjs +0 -26
- package/esm2022/lib/mixins/extract-is-value-function.mixin.mjs +0 -22
- package/esm2022/lib/mixins/extract-method.mixin.mjs +0 -20
- package/esm2022/lib/mixins/extract-methods.mixin.mjs +0 -21
- package/esm2022/lib/mixins/extract-options-data-source.mixin.mjs +0 -59
- package/esm2022/lib/mixins/extract-options-method.mixin.mjs +0 -22
- package/esm2022/lib/mixins/extract-resolve-method.mixin.mjs +0 -22
- package/esm2022/lib/mixins/extract-to-display-function.mixin.mjs +0 -22
- package/esm2022/lib/submit-context-form-adapter.factory.mjs +0 -32
- package/esm2022/lib/validators/is-equal-to.mjs +0 -60
- package/esm2022/lib/validators/is-selectable-value.directive.mjs +0 -82
- package/esm2022/rxap-form-system.mjs +0 -5
|
@@ -130,6 +130,8 @@
|
|
|
130
130
|
</p>
|
|
131
131
|
<p class="comment">
|
|
132
132
|
<code><a href="../classes/ExtractResolveMethodMixin.html" target="_self" >ExtractResolveMethodMixin</a></code>
|
|
133
|
+
<code><a href="../classes/ExtractIsValueFunctionMixin.html" target="_self" >ExtractIsValueFunctionMixin</a></code>
|
|
134
|
+
<code><a href="../classes/ExtractToDisplayFunctionMixin.html" target="_self" >ExtractToDisplayFunctionMixin</a></code>
|
|
133
135
|
<code>AfterViewInit</code>
|
|
134
136
|
<code>OnDestroy</code>
|
|
135
137
|
</p>
|
|
@@ -208,10 +210,6 @@
|
|
|
208
210
|
<tr>
|
|
209
211
|
<td class="col-md-4">
|
|
210
212
|
<ul class="index-list">
|
|
211
|
-
<li>
|
|
212
|
-
<span class="modifier">Public</span>
|
|
213
|
-
<a href="#isValue" >isValue</a>
|
|
214
|
-
</li>
|
|
215
213
|
<li>
|
|
216
214
|
<span class="modifier">Protected</span>
|
|
217
215
|
<span class="modifier"></span>
|
|
@@ -232,10 +230,6 @@
|
|
|
232
230
|
<span class="modifier">Async</span>
|
|
233
231
|
<a href="#resolveValue" >resolveValue</a>
|
|
234
232
|
</li>
|
|
235
|
-
<li>
|
|
236
|
-
<span class="modifier">Public</span>
|
|
237
|
-
<a href="#toDisplay" >toDisplay</a>
|
|
238
|
-
</li>
|
|
239
233
|
<li>
|
|
240
234
|
<span class="modifier">Protected</span>
|
|
241
235
|
<a href="#extractResolveMethod" >extractResolveMethod</a>
|
|
@@ -255,6 +249,9 @@
|
|
|
255
249
|
<li>
|
|
256
250
|
<a href="#rxapAutocompleteOptionsFromMethodCall" >rxapAutocompleteOptionsFromMethodCall</a>
|
|
257
251
|
</li>
|
|
252
|
+
<li>
|
|
253
|
+
<a href="#rxapAutocompleteOptionsFromMethodIsValue" >rxapAutocompleteOptionsFromMethodIsValue</a>
|
|
254
|
+
</li>
|
|
258
255
|
<li>
|
|
259
256
|
<a href="#rxapAutocompleteOptionsFromMethodMatAutocomplete" >rxapAutocompleteOptionsFromMethodMatAutocomplete</a>
|
|
260
257
|
</li>
|
|
@@ -267,6 +264,9 @@
|
|
|
267
264
|
<li>
|
|
268
265
|
<a href="#rxapAutocompleteOptionsFromMethodResolve" >rxapAutocompleteOptionsFromMethodResolve</a>
|
|
269
266
|
</li>
|
|
267
|
+
<li>
|
|
268
|
+
<a href="#rxapAutocompleteOptionsFromMethodToDisplay" >rxapAutocompleteOptionsFromMethodToDisplay</a>
|
|
269
|
+
</li>
|
|
270
270
|
</ul>
|
|
271
271
|
</td>
|
|
272
272
|
</tr>
|
|
@@ -297,7 +297,28 @@
|
|
|
297
297
|
</tr>
|
|
298
298
|
<tr>
|
|
299
299
|
<td class="col-md-2" colspan="2">
|
|
300
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
300
|
+
<div class="io-line">Defined in <a href="" data-line="134" class="link-to-prism">src/lib/directives/autocomplete-options-from-method.directive.ts:134</a></div>
|
|
301
|
+
</td>
|
|
302
|
+
</tr>
|
|
303
|
+
</tbody>
|
|
304
|
+
</table>
|
|
305
|
+
<table class="table table-sm table-bordered">
|
|
306
|
+
<tbody>
|
|
307
|
+
<tr>
|
|
308
|
+
<td class="col-md-4">
|
|
309
|
+
<a name="rxapAutocompleteOptionsFromMethodIsValue"></a>
|
|
310
|
+
<b>rxapAutocompleteOptionsFromMethodIsValue</b>
|
|
311
|
+
</td>
|
|
312
|
+
</tr>
|
|
313
|
+
<tr>
|
|
314
|
+
<td class="col-md-4">
|
|
315
|
+
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/function" target="_blank" >function</a></code>
|
|
316
|
+
|
|
317
|
+
</td>
|
|
318
|
+
</tr>
|
|
319
|
+
<tr>
|
|
320
|
+
<td class="col-md-2" colspan="2">
|
|
321
|
+
<div class="io-line">Defined in <a href="" data-line="140" class="link-to-prism">src/lib/directives/autocomplete-options-from-method.directive.ts:140</a></div>
|
|
301
322
|
</td>
|
|
302
323
|
</tr>
|
|
303
324
|
</tbody>
|
|
@@ -318,7 +339,7 @@
|
|
|
318
339
|
</tr>
|
|
319
340
|
<tr>
|
|
320
341
|
<td class="col-md-2" colspan="2">
|
|
321
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
342
|
+
<div class="io-line">Defined in <a href="" data-line="131" class="link-to-prism">src/lib/directives/autocomplete-options-from-method.directive.ts:131</a></div>
|
|
322
343
|
</td>
|
|
323
344
|
</tr>
|
|
324
345
|
</tbody>
|
|
@@ -339,7 +360,7 @@
|
|
|
339
360
|
</tr>
|
|
340
361
|
<tr>
|
|
341
362
|
<td class="col-md-2" colspan="2">
|
|
342
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
363
|
+
<div class="io-line">Defined in <a href="" data-line="127" class="link-to-prism">src/lib/directives/autocomplete-options-from-method.directive.ts:127</a></div>
|
|
343
364
|
</td>
|
|
344
365
|
</tr>
|
|
345
366
|
</tbody>
|
|
@@ -360,7 +381,7 @@
|
|
|
360
381
|
</tr>
|
|
361
382
|
<tr>
|
|
362
383
|
<td class="col-md-2" colspan="2">
|
|
363
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
384
|
+
<div class="io-line">Defined in <a href="" data-line="129" class="link-to-prism">src/lib/directives/autocomplete-options-from-method.directive.ts:129</a></div>
|
|
364
385
|
</td>
|
|
365
386
|
</tr>
|
|
366
387
|
</tbody>
|
|
@@ -381,7 +402,28 @@
|
|
|
381
402
|
</tr>
|
|
382
403
|
<tr>
|
|
383
404
|
<td class="col-md-2" colspan="2">
|
|
384
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
405
|
+
<div class="io-line">Defined in <a href="" data-line="137" class="link-to-prism">src/lib/directives/autocomplete-options-from-method.directive.ts:137</a></div>
|
|
406
|
+
</td>
|
|
407
|
+
</tr>
|
|
408
|
+
</tbody>
|
|
409
|
+
</table>
|
|
410
|
+
<table class="table table-sm table-bordered">
|
|
411
|
+
<tbody>
|
|
412
|
+
<tr>
|
|
413
|
+
<td class="col-md-4">
|
|
414
|
+
<a name="rxapAutocompleteOptionsFromMethodToDisplay"></a>
|
|
415
|
+
<b>rxapAutocompleteOptionsFromMethodToDisplay</b>
|
|
416
|
+
</td>
|
|
417
|
+
</tr>
|
|
418
|
+
<tr>
|
|
419
|
+
<td class="col-md-4">
|
|
420
|
+
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/function" target="_blank" >function</a></code>
|
|
421
|
+
|
|
422
|
+
</td>
|
|
423
|
+
</tr>
|
|
424
|
+
<tr>
|
|
425
|
+
<td class="col-md-2" colspan="2">
|
|
426
|
+
<div class="io-line">Defined in <a href="" data-line="143" class="link-to-prism">src/lib/directives/autocomplete-options-from-method.directive.ts:143</a></div>
|
|
385
427
|
</td>
|
|
386
428
|
</tr>
|
|
387
429
|
</tbody>
|
|
@@ -395,75 +437,6 @@
|
|
|
395
437
|
<h3 id="methods">
|
|
396
438
|
Methods
|
|
397
439
|
</h3>
|
|
398
|
-
<table class="table table-sm table-bordered">
|
|
399
|
-
<tbody>
|
|
400
|
-
<tr>
|
|
401
|
-
<td class="col-md-4">
|
|
402
|
-
<a name="isValue"></a>
|
|
403
|
-
<span class="name">
|
|
404
|
-
<span class="modifier">Public</span>
|
|
405
|
-
<span ><b>isValue</b></span>
|
|
406
|
-
<a href="#isValue"><span class="icon ion-ios-link"></span></a>
|
|
407
|
-
</span>
|
|
408
|
-
</td>
|
|
409
|
-
</tr>
|
|
410
|
-
<tr>
|
|
411
|
-
<td class="col-md-4">
|
|
412
|
-
<span class="modifier-icon icon ion-ios-reset"></span>
|
|
413
|
-
<code>isValue(value: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
|
|
414
|
-
</td>
|
|
415
|
-
</tr>
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
<tr>
|
|
419
|
-
<td class="col-md-4">
|
|
420
|
-
<div class="io-line">Defined in <a href="" data-line="159"
|
|
421
|
-
class="link-to-prism">src/lib/directives/autocomplete-options-from-method.directive.ts:159</a></div>
|
|
422
|
-
</td>
|
|
423
|
-
</tr>
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
<tr>
|
|
427
|
-
<td class="col-md-4">
|
|
428
|
-
|
|
429
|
-
<div class="io-description">
|
|
430
|
-
<b>Parameters :</b>
|
|
431
|
-
|
|
432
|
-
<table class="params">
|
|
433
|
-
<thead>
|
|
434
|
-
<tr>
|
|
435
|
-
<td>Name</td>
|
|
436
|
-
<td>Type</td>
|
|
437
|
-
<td>Optional</td>
|
|
438
|
-
</tr>
|
|
439
|
-
</thead>
|
|
440
|
-
<tbody>
|
|
441
|
-
<tr>
|
|
442
|
-
<td>value</td>
|
|
443
|
-
<td>
|
|
444
|
-
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
|
445
|
-
</td>
|
|
446
|
-
|
|
447
|
-
<td>
|
|
448
|
-
No
|
|
449
|
-
</td>
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
</tr>
|
|
453
|
-
</tbody>
|
|
454
|
-
</table>
|
|
455
|
-
</div>
|
|
456
|
-
<div class="io-description">
|
|
457
|
-
<b>Returns : </b> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code>
|
|
458
|
-
|
|
459
|
-
</div>
|
|
460
|
-
<div class="io-description">
|
|
461
|
-
|
|
462
|
-
</div>
|
|
463
|
-
</td>
|
|
464
|
-
</tr>
|
|
465
|
-
</tbody>
|
|
466
|
-
</table>
|
|
467
440
|
<table class="table table-sm table-bordered">
|
|
468
441
|
<tbody>
|
|
469
442
|
<tr>
|
|
@@ -487,8 +460,8 @@
|
|
|
487
460
|
|
|
488
461
|
<tr>
|
|
489
462
|
<td class="col-md-4">
|
|
490
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
491
|
-
class="link-to-prism">src/lib/directives/autocomplete-options-from-method.directive.ts:
|
|
463
|
+
<div class="io-line">Defined in <a href="" data-line="201"
|
|
464
|
+
class="link-to-prism">src/lib/directives/autocomplete-options-from-method.directive.ts:201</a></div>
|
|
492
465
|
</td>
|
|
493
466
|
</tr>
|
|
494
467
|
|
|
@@ -561,8 +534,8 @@
|
|
|
561
534
|
|
|
562
535
|
<tr>
|
|
563
536
|
<td class="col-md-4">
|
|
564
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
565
|
-
class="link-to-prism">src/lib/directives/autocomplete-options-from-method.directive.ts:
|
|
537
|
+
<div class="io-line">Defined in <a href="" data-line="119"
|
|
538
|
+
class="link-to-prism">src/lib/directives/autocomplete-options-from-method.directive.ts:119</a></div>
|
|
566
539
|
</td>
|
|
567
540
|
</tr>
|
|
568
541
|
|
|
@@ -643,8 +616,8 @@
|
|
|
643
616
|
|
|
644
617
|
<tr>
|
|
645
618
|
<td class="col-md-4">
|
|
646
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
647
|
-
class="link-to-prism">src/lib/directives/autocomplete-options-from-method.directive.ts:
|
|
619
|
+
<div class="io-line">Defined in <a href="" data-line="218"
|
|
620
|
+
class="link-to-prism">src/lib/directives/autocomplete-options-from-method.directive.ts:218</a></div>
|
|
648
621
|
</td>
|
|
649
622
|
</tr>
|
|
650
623
|
|
|
@@ -683,8 +656,8 @@
|
|
|
683
656
|
|
|
684
657
|
<tr>
|
|
685
658
|
<td class="col-md-4">
|
|
686
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
687
|
-
class="link-to-prism">src/lib/directives/autocomplete-options-from-method.directive.ts:
|
|
659
|
+
<div class="io-line">Defined in <a href="" data-line="226"
|
|
660
|
+
class="link-to-prism">src/lib/directives/autocomplete-options-from-method.directive.ts:226</a></div>
|
|
688
661
|
</td>
|
|
689
662
|
</tr>
|
|
690
663
|
|
|
@@ -748,75 +721,6 @@
|
|
|
748
721
|
</tr>
|
|
749
722
|
</tbody>
|
|
750
723
|
</table>
|
|
751
|
-
<table class="table table-sm table-bordered">
|
|
752
|
-
<tbody>
|
|
753
|
-
<tr>
|
|
754
|
-
<td class="col-md-4">
|
|
755
|
-
<a name="toDisplay"></a>
|
|
756
|
-
<span class="name">
|
|
757
|
-
<span class="modifier">Public</span>
|
|
758
|
-
<span ><b>toDisplay</b></span>
|
|
759
|
-
<a href="#toDisplay"><span class="icon ion-ios-link"></span></a>
|
|
760
|
-
</span>
|
|
761
|
-
</td>
|
|
762
|
-
</tr>
|
|
763
|
-
<tr>
|
|
764
|
-
<td class="col-md-4">
|
|
765
|
-
<span class="modifier-icon icon ion-ios-reset"></span>
|
|
766
|
-
<code>toDisplay(value: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
|
|
767
|
-
</td>
|
|
768
|
-
</tr>
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
<tr>
|
|
772
|
-
<td class="col-md-4">
|
|
773
|
-
<div class="io-line">Defined in <a href="" data-line="151"
|
|
774
|
-
class="link-to-prism">src/lib/directives/autocomplete-options-from-method.directive.ts:151</a></div>
|
|
775
|
-
</td>
|
|
776
|
-
</tr>
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
<tr>
|
|
780
|
-
<td class="col-md-4">
|
|
781
|
-
|
|
782
|
-
<div class="io-description">
|
|
783
|
-
<b>Parameters :</b>
|
|
784
|
-
|
|
785
|
-
<table class="params">
|
|
786
|
-
<thead>
|
|
787
|
-
<tr>
|
|
788
|
-
<td>Name</td>
|
|
789
|
-
<td>Type</td>
|
|
790
|
-
<td>Optional</td>
|
|
791
|
-
</tr>
|
|
792
|
-
</thead>
|
|
793
|
-
<tbody>
|
|
794
|
-
<tr>
|
|
795
|
-
<td>value</td>
|
|
796
|
-
<td>
|
|
797
|
-
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
|
798
|
-
</td>
|
|
799
|
-
|
|
800
|
-
<td>
|
|
801
|
-
No
|
|
802
|
-
</td>
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
</tr>
|
|
806
|
-
</tbody>
|
|
807
|
-
</table>
|
|
808
|
-
</div>
|
|
809
|
-
<div class="io-description">
|
|
810
|
-
<b>Returns : </b> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
811
|
-
|
|
812
|
-
</div>
|
|
813
|
-
<div class="io-description">
|
|
814
|
-
|
|
815
|
-
</div>
|
|
816
|
-
</td>
|
|
817
|
-
</tr>
|
|
818
|
-
</tbody>
|
|
819
|
-
</table>
|
|
820
724
|
<table class="table table-sm table-bordered">
|
|
821
725
|
<tbody>
|
|
822
726
|
<tr>
|
|
@@ -942,7 +846,7 @@
|
|
|
942
846
|
</tr>
|
|
943
847
|
<tr>
|
|
944
848
|
<td class="col-md-4">
|
|
945
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
849
|
+
<div class="io-line">Defined in <a href="" data-line="147" class="link-to-prism">src/lib/directives/autocomplete-options-from-method.directive.ts:147</a></div>
|
|
946
850
|
</td>
|
|
947
851
|
</tr>
|
|
948
852
|
|
|
@@ -975,7 +879,7 @@
|
|
|
975
879
|
</tr>
|
|
976
880
|
<tr>
|
|
977
881
|
<td class="col-md-4">
|
|
978
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
882
|
+
<div class="io-line">Defined in <a href="" data-line="146" class="link-to-prism">src/lib/directives/autocomplete-options-from-method.directive.ts:146</a></div>
|
|
979
883
|
</td>
|
|
980
884
|
</tr>
|
|
981
885
|
|
|
@@ -1008,7 +912,7 @@
|
|
|
1008
912
|
</tr>
|
|
1009
913
|
<tr>
|
|
1010
914
|
<td class="col-md-4">
|
|
1011
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
915
|
+
<div class="io-line">Defined in <a href="" data-line="145" class="link-to-prism">src/lib/directives/autocomplete-options-from-method.directive.ts:145</a></div>
|
|
1012
916
|
</td>
|
|
1013
917
|
</tr>
|
|
1014
918
|
|
|
@@ -1041,7 +945,7 @@
|
|
|
1041
945
|
</tr>
|
|
1042
946
|
<tr>
|
|
1043
947
|
<td class="col-md-4">
|
|
1044
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
948
|
+
<div class="io-line">Defined in <a href="" data-line="148" class="link-to-prism">src/lib/directives/autocomplete-options-from-method.directive.ts:148</a></div>
|
|
1045
949
|
</td>
|
|
1046
950
|
</tr>
|
|
1047
951
|
|
|
@@ -1054,7 +958,46 @@
|
|
|
1054
958
|
</div>
|
|
1055
959
|
|
|
1056
960
|
<div class="tab-pane fade " id="readme">
|
|
1057
|
-
<p><h1>
|
|
961
|
+
<p><h1>Autocomplete Table Select</h1>
|
|
962
|
+
<h1>With Rxap form System</h1>
|
|
963
|
+
<b>Example :</b><div><pre class="line-numbers"><code class="language-angular2html">
|
|
964
|
+
<mat-form-field>
|
|
965
|
+
<mat-label>Company</mat-label>
|
|
966
|
+
<input type="text"
|
|
967
|
+
placeholder="Enter Company Name"
|
|
968
|
+
matInput
|
|
969
|
+
formControlName="company"
|
|
970
|
+
[matAutocomplete]="auto">
|
|
971
|
+
<!-- The autocomplete input -->
|
|
972
|
+
<mat-autocomplete #auto="matAutocomplete">
|
|
973
|
+
<mat-option *rxapAutocompleteOptionsFromMethod="let option; matAutocomplete: auto"
|
|
974
|
+
[value]="option.value">{{ option.display }}
|
|
975
|
+
</mat-option>
|
|
976
|
+
</mat-autocomplete>
|
|
977
|
+
<button mat-icon-button rxapInputClearButton matSuffix>
|
|
978
|
+
<mat-icon>clear</mat-icon>
|
|
979
|
+
</button>
|
|
980
|
+
</mat-form-field></code></pre></div><b>Example :</b><div><pre class="line-numbers"><code class="language-typescript">@Injectable()
|
|
981
|
+
@RxapForm('form')
|
|
982
|
+
export class Form {
|
|
983
|
+
|
|
984
|
+
// ensure the table data source is provided - in root or in the form component
|
|
985
|
+
@UseAutocompleteOptionsMethod(SearchCompanyMethod)
|
|
986
|
+
// ensure the table data source is provided - in root or in the form component
|
|
987
|
+
@UseAutocompleteResolveMethod(GetCompanyMethod)
|
|
988
|
+
@UseFormControl()
|
|
989
|
+
company!: RxapFromControl<Company>;
|
|
990
|
+
|
|
991
|
+
}</code></pre></div><p>The DataSource <code>CompanyGuiTableDataSource</code> is used to populate the table in the selection window. Ensure that this DataSource is of the type <code>AbstractTableDataSource</code>.</p>
|
|
992
|
+
<p>The Method <code>SearchCompanyMethod</code> is used by the autocomplete control to search for a list of matching selection options. The Method must accept a string as the first argument and return a list of <code>ControlOption</code> objects.</p>
|
|
993
|
+
<p>The Method <code>GetCompanyMethod</code> is used to resolve the selected value. The Method must accept a the value of the form control as the first argument and return a <code>ControlOption</code> object.</p>
|
|
994
|
+
<b>Example :</b><div><pre class="line-numbers"><code class="language-typescript">export class SearchCompanyMethod implements Method<ControlOptions, { parameters: { search?: string | null } }> { ... }
|
|
995
|
+
export class GetCompanyMethod implements Method<ControlOption, { parameters: { value: string } }> { ... }</code></pre></div><h1>Method Parameter Adopter</h1>
|
|
996
|
+
<p>By default the following adopter function is used by the <code>@UseAutocompleteOptionsMethod</code> and <code>@UseAutocompleteResolveMethod</code> decorators.</p>
|
|
997
|
+
<b>Example :</b><div><pre class="line-numbers"><code class="language-typescript">(parameters) => ({parameters})</code></pre></div><p>To override this default adopter function use the second argument of the decorator.</p>
|
|
998
|
+
<b>Example :</b><div><pre class="line-numbers"><code class="language-typescript">@UseAutocompleteOptionsMethod(SearchCompanyMethod, { adapter: { parameter: (parameters) => ({ search: parameters.search }) } })</code></pre></div><blockquote>
|
|
999
|
+
<p>The adapter function are called in an injection context, so it is possible to use the <code>inject</code> function</p>
|
|
1000
|
+
</blockquote>
|
|
1058
1001
|
</p>
|
|
1059
1002
|
</div>
|
|
1060
1003
|
|
|
@@ -1063,6 +1006,7 @@
|
|
|
1063
1006
|
AfterViewInit,
|
|
1064
1007
|
Directive,
|
|
1065
1008
|
inject,
|
|
1009
|
+
Injectable,
|
|
1066
1010
|
Injector,
|
|
1067
1011
|
INJECTOR,
|
|
1068
1012
|
Input,
|
|
@@ -1079,12 +1023,23 @@ import { Mixin } from '@rxap/mixin';
|
|
|
1079
1023
|
import { NgControl } from '@angular/forms';
|
|
1080
1024
|
import { MatFormField } from '@angular/material/form-field';
|
|
1081
1025
|
import { isDefined } from '@rxap/rxjs';
|
|
1026
|
+
import { ExtractControlMixin } from '../mixins/extract-control.mixin';
|
|
1027
|
+
import { ExtractFormDefinitionMixin } from '../mixins/extract-form-definition.mixin';
|
|
1028
|
+
import {
|
|
1029
|
+
ExtractIsValueFunctionMixin,
|
|
1030
|
+
UseIsValueFunction,
|
|
1031
|
+
} from '../mixins/extract-is-value-function.mixin';
|
|
1032
|
+
import { ExtractMethodMixin } from '../mixins/extract-method.mixin';
|
|
1082
1033
|
import { UseMethodConfig } from '../mixins/extract-methods.mixin';
|
|
1083
1034
|
import { UseOptionsMethod } from '../mixins/extract-options-method.mixin';
|
|
1084
1035
|
import {
|
|
1085
1036
|
ExtractResolveMethodMixin,
|
|
1086
1037
|
UseResolveMethod,
|
|
1087
1038
|
} from '../mixins/extract-resolve-method.mixin';
|
|
1039
|
+
import {
|
|
1040
|
+
ExtractToDisplayFunctionMixin,
|
|
1041
|
+
UseToDisplayFunction,
|
|
1042
|
+
} from '../mixins/extract-to-display-function.mixin';
|
|
1088
1043
|
import { OptionsFromMethodDirective, OptionsFromMethodDirectiveSettings } from './options-from-method.directive';
|
|
1089
1044
|
import { OpenApiRemoteMethodParameter } from '@rxap/open-api/remote-method';
|
|
1090
1045
|
import { controlValueChanges$ } from '@rxap/forms';
|
|
@@ -1117,6 +1072,18 @@ export function UseAutocompleteResolveMethod<Value = unknown>(
|
|
|
1117
1072
|
return UseResolveMethod(method, config);
|
|
1118
1073
|
}
|
|
1119
1074
|
|
|
1075
|
+
export function UseAutocompleteIsValueFunction(
|
|
1076
|
+
isValue: (value: any) => boolean,
|
|
1077
|
+
): any {
|
|
1078
|
+
return UseIsValueFunction(isValue);
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
export function UseAutocompleteToDisplayFunction(
|
|
1082
|
+
toDisplay: (value: any) => string,
|
|
1083
|
+
): any {
|
|
1084
|
+
return UseToDisplayFunction(toDisplay);
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1120
1087
|
export interface AutocompleteOptionsFromRemoteMethodTemplateContext {
|
|
1121
1088
|
$implicit: ControlOption;
|
|
1122
1089
|
}
|
|
@@ -1131,10 +1098,19 @@ export interface AutocompleteOptionsFromMethodDirectiveParameters<Value =
|
|
|
1131
1098
|
|
|
1132
1099
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
1133
1100
|
export interface AutocompleteOptionsFromMethodDirective<Value = any, Parameters extends AutocompleteOptionsFromMethodDirectiveParameters<Value> = AutocompleteOptionsFromMethodDirectiveParameters<Value>>
|
|
1134
|
-
extends ExtractResolveMethodMixin, AfterViewInit, OnDestroy {
|
|
1101
|
+
extends ExtractResolveMethodMixin, ExtractIsValueFunctionMixin, ExtractToDisplayFunctionMixin, AfterViewInit, OnDestroy {
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
@Injectable({ providedIn: 'root' })
|
|
1105
|
+
export class NoopResolveMethod<Value> implements Method<ControlOption, { value: Value }> {
|
|
1106
|
+
|
|
1107
|
+
call({ value } : { value: Value }): Promise<ControlOption> {
|
|
1108
|
+
return Promise.resolve({ value, display: value + '' });
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1135
1111
|
}
|
|
1136
1112
|
|
|
1137
|
-
@Mixin(ExtractResolveMethodMixin)
|
|
1113
|
+
@Mixin(ExtractResolveMethodMixin, ExtractIsValueFunctionMixin, ExtractToDisplayFunctionMixin)
|
|
1138
1114
|
@Directive({
|
|
1139
1115
|
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
1140
1116
|
selector: '[rxapAutocompleteOptionsFromMethod]',
|
|
@@ -1163,6 +1139,13 @@ export class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
1163
1139
|
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
1164
1140
|
@Input('rxapAutocompleteOptionsFromMethodResolve')
|
|
1165
1141
|
public resolveMethod?: MethodWithParameters<ControlOption, { value: Value } & Parameters>;
|
|
1142
|
+
|
|
1143
|
+
@Input('rxapAutocompleteOptionsFromMethodIsValue')
|
|
1144
|
+
public isValue?: (value: any) => boolean;
|
|
1145
|
+
|
|
1146
|
+
@Input('rxapAutocompleteOptionsFromMethodToDisplay')
|
|
1147
|
+
public toDisplay?: (value: any) => string;
|
|
1148
|
+
|
|
1166
1149
|
protected override ngControl: NgControl | null = null;
|
|
1167
1150
|
protected override matFormField: MatFormField | null = null;
|
|
1168
1151
|
protected override injector: Injector = inject(INJECTOR);
|
|
@@ -1184,12 +1167,22 @@ export class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
1184
1167
|
|
|
1185
1168
|
public override async ngAfterViewInit() {
|
|
1186
1169
|
if (this.matAutocomplete) {
|
|
1187
|
-
this.matAutocomplete.displayWith = this.toDisplay.bind(this);
|
|
1188
1170
|
this.settings ??= {};
|
|
1189
1171
|
this.settings.filteredOptions ??= true;
|
|
1190
1172
|
}
|
|
1191
1173
|
await super.ngAfterViewInit();
|
|
1192
1174
|
this.resolveMethod ??= this.extractResolveMethod();
|
|
1175
|
+
this.isValue ??= this.extractIsValueFunction((value: any) => typeof value === 'string' && isUUID(value));
|
|
1176
|
+
this.toDisplay ??= this.extractToDisplayFunction((value: any): string => {
|
|
1177
|
+
if (!value) {
|
|
1178
|
+
return '';
|
|
1179
|
+
}
|
|
1180
|
+
const option = this.findOptionByValue(value);
|
|
1181
|
+
return option?.display ?? (isDevMode() ? 'to display error' : '...');
|
|
1182
|
+
});
|
|
1183
|
+
if (this.matAutocomplete) {
|
|
1184
|
+
this.matAutocomplete.displayWith = this.toDisplay.bind(this);
|
|
1185
|
+
}
|
|
1193
1186
|
if (!this.control) {
|
|
1194
1187
|
throw new Error('The control is not yet defined');
|
|
1195
1188
|
}
|
|
@@ -1202,32 +1195,20 @@ export class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
1202
1195
|
distinctUntilChanged(),
|
|
1203
1196
|
tap(async value => {
|
|
1204
1197
|
this.setOptions(await this.loadOptions(this.parameters));
|
|
1205
|
-
if (this.isValue(value)) {
|
|
1198
|
+
if (this.isValue?.(value)) {
|
|
1206
1199
|
this.triggerAutocompleteToDisplay();
|
|
1207
1200
|
}
|
|
1208
1201
|
}),
|
|
1209
1202
|
).subscribe();
|
|
1210
1203
|
}
|
|
1211
1204
|
|
|
1212
|
-
public toDisplay(value: any): string {
|
|
1213
|
-
if (!value) {
|
|
1214
|
-
return '';
|
|
1215
|
-
}
|
|
1216
|
-
const option = this.findOptionByValue(value);
|
|
1217
|
-
return option?.display ?? (isDevMode() ? 'to display error' : '...');
|
|
1218
|
-
}
|
|
1219
|
-
|
|
1220
|
-
public isValue(value: any): boolean {
|
|
1221
|
-
return typeof value === 'string' && isUUID(value);
|
|
1222
|
-
}
|
|
1223
|
-
|
|
1224
1205
|
protected override loadOptions(parameters: Parameters = {} as Parameters): Promise<ControlOptions | null> {
|
|
1225
1206
|
if (!this.control) {
|
|
1226
1207
|
throw new Error('The control is not yet defined');
|
|
1227
1208
|
}
|
|
1228
1209
|
const value = this.control?.value;
|
|
1229
1210
|
const c_parameters = {...parameters};
|
|
1230
|
-
if (this.isValue(value)) {
|
|
1211
|
+
if (this.isValue?.(value)) {
|
|
1231
1212
|
return this.resolveValue(value, c_parameters);
|
|
1232
1213
|
} else {
|
|
1233
1214
|
c_parameters.search ??= value;
|