ngx-t-forms 3.1.0 → 3.1.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/fesm2022/ngx-t-forms-api-endpoint-config.component-B9tCHtwV.mjs +411 -0
- package/fesm2022/ngx-t-forms-api-endpoint-config.component-B9tCHtwV.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-FhUHTsUF.mjs → ngx-t-forms-auto-complete-input-element.component-D2Vty1Aj.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-FhUHTsUF.mjs.map → ngx-t-forms-auto-complete-input-element.component-D2Vty1Aj.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-basic-input-input-element.component-BJKe9wIA.mjs → ngx-t-forms-basic-input-input-element.component-Dr2bhCnH.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-basic-input-input-element.component-BJKe9wIA.mjs.map → ngx-t-forms-basic-input-input-element.component-Dr2bhCnH.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-calculated-field-rules.component-FQLTI7CX.mjs → ngx-t-forms-calculated-field-rules.component-DLBTjfMj.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-calculated-field-rules.component-FQLTI7CX.mjs.map → ngx-t-forms-calculated-field-rules.component-DLBTjfMj.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-CJtbprXS.mjs → ngx-t-forms-chip-options-creator-editor.component-Bh6jMmtu.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-CJtbprXS.mjs.map → ngx-t-forms-chip-options-creator-editor.component-Bh6jMmtu.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-conditional-display-config.component-ayrWl-c2.mjs +513 -0
- package/fesm2022/ngx-t-forms-conditional-display-config.component-ayrWl-c2.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-CU6R5h-x.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-nOnJfMTo.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-CU6R5h-x.mjs.map → ngx-t-forms-config-mscoa-additional-inputs.component-nOnJfMTo.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-data-source-picker.component-C8MBbnfz.mjs → ngx-t-forms-data-source-picker.component-mmyhOBvA.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-data-source-picker.component-C8MBbnfz.mjs.map → ngx-t-forms-data-source-picker.component-mmyhOBvA.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-date-picker-input-element.component-Dux6uy66.mjs → ngx-t-forms-date-picker-input-element.component-DmiBra1D.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-date-picker-input-element.component-Dux6uy66.mjs.map → ngx-t-forms-date-picker-input-element.component-DmiBra1D.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-date-range-picker-input-element.component-SMWrTm5X.mjs → ngx-t-forms-date-range-picker-input-element.component-Cke5qSzR.mjs} +11 -2
- package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-Cke5qSzR.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-document-list-label-config-editor.component-uGM93dvc.mjs → ngx-t-forms-document-list-label-config-editor.component-C0xx4jrN.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-document-list-label-config-editor.component-uGM93dvc.mjs.map → ngx-t-forms-document-list-label-config-editor.component-C0xx4jrN.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-document-picker.component-DIqaaBSl.mjs → ngx-t-forms-document-picker.component-DI7wtEv6.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-document-picker.component-DIqaaBSl.mjs.map → ngx-t-forms-document-picker.component-DI7wtEv6.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-editor-js-input.component-C1dI_7rU.mjs → ngx-t-forms-editor-input-element.component-DbogKrdk.mjs} +46 -191
- package/fesm2022/ngx-t-forms-editor-input-element.component-DbogKrdk.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-file-upload-input-element.component-CQsKz87N.mjs → ngx-t-forms-file-upload-input-element.component-DbwvZghJ.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-file-upload-input-element.component-CQsKz87N.mjs.map → ngx-t-forms-file-upload-input-element.component-DbwvZghJ.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-input-selector.component-Dj0jvBdm.mjs → ngx-t-forms-form-input-selector.component-CkuzNdjx.mjs} +2 -3
- package/fesm2022/{ngx-t-forms-form-input-selector.component-Dj0jvBdm.mjs.map → ngx-t-forms-form-input-selector.component-CkuzNdjx.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-json-view.component-DzJKFl4c.mjs → ngx-t-forms-form-json-view.component-DBCpa_rZ.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-form-json-view.component-DzJKFl4c.mjs.map → ngx-t-forms-form-json-view.component-DBCpa_rZ.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-DOvVtJGB.mjs → ngx-t-forms-form-section-stepper.component-jLj6vePZ.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-DOvVtJGB.mjs.map → ngx-t-forms-form-section-stepper.component-jLj6vePZ.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-CcqyQLf5.mjs → ngx-t-forms-forms-builder-menu.component-Iyd0grju.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-CcqyQLf5.mjs.map → ngx-t-forms-forms-builder-menu.component-Iyd0grju.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-geo-location.component-Bj_qIEqi.mjs → ngx-t-forms-geo-location.component-BUXRaPy0.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-geo-location.component-Bj_qIEqi.mjs.map → ngx-t-forms-geo-location.component-BUXRaPy0.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-header-template-editor.component-BLmAqiQA.mjs +158 -0
- package/fesm2022/ngx-t-forms-header-template-editor.component-BLmAqiQA.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-image-capture-input-element.component-lwp3IcDt.mjs → ngx-t-forms-image-capture-input-element.component-D6Ffuhbv.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-image-capture-input-element.component-lwp3IcDt.mjs.map → ngx-t-forms-image-capture-input-element.component-D6Ffuhbv.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-index-CKj1Oacc.mjs +2 -0
- package/fesm2022/ngx-t-forms-index-CKj1Oacc.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-input-custom.component-DiciFhSS.mjs → ngx-t-forms-input-custom.component-BMui37o-.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-input-custom.component-DiciFhSS.mjs.map → ngx-t-forms-input-custom.component-BMui37o-.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-input-editor.component-D12hrHOc.mjs → ngx-t-forms-input-editor.component-D60TpWzO.mjs} +3 -4
- package/fesm2022/{ngx-t-forms-input-editor.component-D12hrHOc.mjs.map → ngx-t-forms-input-editor.component-D60TpWzO.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-map-mat-options-keys-C2JpMTEc.mjs → ngx-t-forms-map-mat-options-keys-yfxnNDPs.mjs} +2 -3
- package/fesm2022/ngx-t-forms-map-mat-options-keys-yfxnNDPs.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-C1Qrze7K.mjs → ngx-t-forms-mat-chip-list-editor.component-cfBBan80.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-C1Qrze7K.mjs.map → ngx-t-forms-mat-chip-list-editor.component-cfBBan80.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-BaTR_jzc.mjs → ngx-t-forms-missing-form-configs.component-BcYuduah.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-BaTR_jzc.mjs.map → ngx-t-forms-missing-form-configs.component-BcYuduah.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-chart-toolbar.component-Dni_bv_G.mjs → ngx-t-forms-mscoa-chart-toolbar.component-nLawxM9j.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mscoa-chart-toolbar.component-Dni_bv_G.mjs.map → ngx-t-forms-mscoa-chart-toolbar.component-nLawxM9j.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-mscoa-config.component-B9G_WlEc.mjs +594 -0
- package/fesm2022/ngx-t-forms-mscoa-config.component-B9G_WlEc.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-mscoa-segment-config.component-BPQuzR5k.mjs → ngx-t-forms-mscoa-segment-config.component-DKEEZ8MD.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mscoa-segment-config.component-BPQuzR5k.mjs.map → ngx-t-forms-mscoa-segment-config.component-DKEEZ8MD.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-multiple-input-input-element.component-hXWMRFjl.mjs → ngx-t-forms-multiple-input-input-element.component-B99ANTUL.mjs} +34 -30
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-B99ANTUL.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-ngx-t-forms-tQEbZK_e.mjs → ngx-t-forms-ngx-t-forms-9BfJdjl4.mjs} +2281 -759
- package/fesm2022/ngx-t-forms-ngx-t-forms-9BfJdjl4.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-paginated-selection-table-pYY2sWAb.mjs → ngx-t-forms-paginated-selection-table-Bm5-5VWe.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-paginated-selection-table-pYY2sWAb.mjs.map → ngx-t-forms-paginated-selection-table-Bm5-5VWe.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-payload-template-editor.component-DGCUsTYx.mjs → ngx-t-forms-payload-template-editor.component-2hwGuKAB.mjs} +11 -6
- package/fesm2022/ngx-t-forms-payload-template-editor.component-2hwGuKAB.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-D2stBXXC.mjs → ngx-t-forms-pipeline-generator.component-BvjT2zfL.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-D2stBXXC.mjs.map → ngx-t-forms-pipeline-generator.component-BvjT2zfL.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-quill-input.component-BsuOKfZT.mjs +731 -0
- package/fesm2022/ngx-t-forms-quill-input.component-BsuOKfZT.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-record-list-manager.component-CtCOIpai.mjs → ngx-t-forms-record-list-manager.component-BK5nwwDp.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-record-list-manager.component-CtCOIpai.mjs.map → ngx-t-forms-record-list-manager.component-BK5nwwDp.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-required-inputs.component-D9wIdOhg.mjs → ngx-t-forms-required-inputs.component-DiwMttVf.mjs} +2 -3
- package/fesm2022/{ngx-t-forms-required-inputs.component-D9wIdOhg.mjs.map → ngx-t-forms-required-inputs.component-DiwMttVf.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-Gy7Rtmue.mjs → ngx-t-forms-rest-api-call-setup.component-CBgG_f06.mjs} +249 -25
- package/fesm2022/ngx-t-forms-rest-api-call-setup.component-CBgG_f06.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-section-report.component-U9uQ_Ow9.mjs → ngx-t-forms-section-report.component-CyPpFiWS.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-section-report.component-U9uQ_Ow9.mjs.map → ngx-t-forms-section-report.component-CyPpFiWS.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-select-input-element.component-CxYTmuvV.mjs → ngx-t-forms-select-input-element.component-B2wr5_88.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-select-input-element.component-CxYTmuvV.mjs.map → ngx-t-forms-select-input-element.component-B2wr5_88.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-BLLejOLG.mjs → ngx-t-forms-selection-options-editor.component-BEZLG1Z8.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-BLLejOLG.mjs.map → ngx-t-forms-selection-options-editor.component-BEZLG1Z8.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-textarea-input-element.component-75VdPc6z.mjs → ngx-t-forms-textarea-input-element.component-Cmbd0krg.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-textarea-input-element.component-75VdPc6z.mjs.map → ngx-t-forms-textarea-input-element.component-Cmbd0krg.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-toggle-input-element.component-DQGvEJN-.mjs → ngx-t-forms-toggle-input-element.component-Dd_FcAoD.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-toggle-input-element.component-DQGvEJN-.mjs.map → ngx-t-forms-toggle-input-element.component-Dd_FcAoD.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-token-binding-menu.component-CLpjkUnf.mjs +109 -0
- package/fesm2022/ngx-t-forms-token-binding-menu.component-CLpjkUnf.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-token-text-input.component-DY04Z0fn.mjs +296 -0
- package/fesm2022/ngx-t-forms-token-text-input.component-DY04Z0fn.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-validators-config.component-EM7RSWIz.mjs → ngx-t-forms-validators-config.component-Btmz2cKH.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-validators-config.component-EM7RSWIz.mjs.map → ngx-t-forms-validators-config.component-Btmz2cKH.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-workflow-adjudication.component-CT6sN9E4.mjs +2096 -0
- package/fesm2022/ngx-t-forms-workflow-adjudication.component-CT6sN9E4.mjs.map +1 -0
- package/fesm2022/ngx-t-forms.mjs +1 -1
- package/package.json +2 -2
- package/styles/_tokens.scss +6 -0
- package/types/ngx-t-forms.d.ts +155 -4
- package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-SMWrTm5X.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-editor-input-element.component-CIELjDty.mjs +0 -417
- package/fesm2022/ngx-t-forms-editor-input-element.component-CIELjDty.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-editor-js-input.component-C1dI_7rU.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-getInputIcon-B4ADgevZ.mjs +0 -31
- package/fesm2022/ngx-t-forms-getInputIcon-B4ADgevZ.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-header-template-editor.component-DLldVmcN.mjs +0 -129
- package/fesm2022/ngx-t-forms-header-template-editor.component-DLldVmcN.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-index-C8NtLE16.mjs +0 -2
- package/fesm2022/ngx-t-forms-index-C8NtLE16.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-map-mat-options-keys-C2JpMTEc.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-hXWMRFjl.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-ngx-t-forms-tQEbZK_e.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-payload-template-editor.component-DGCUsTYx.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-rest-api-call-setup.component-Gy7Rtmue.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-token-transform-D_wsFbNc.mjs +0 -173
- package/fesm2022/ngx-t-forms-token-transform-D_wsFbNc.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-workflow-adjudication.component-C1Em-g9e.mjs +0 -1303
- package/fesm2022/ngx-t-forms-workflow-adjudication.component-C1Em-g9e.mjs.map +0 -1
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, output, viewChild, inject, ViewContainerRef, effect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { Overlay } from '@angular/cdk/overlay';
|
|
4
|
+
import { TemplatePortal } from '@angular/cdk/portal';
|
|
5
|
+
import * as i3 from '@angular/material/icon';
|
|
6
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The `$`-trigger option list, shared by every editor that offers the gesture.
|
|
10
|
+
*
|
|
11
|
+
* Purely presentational: it owns no filtering, no caret maths and no insertion.
|
|
12
|
+
* The host decides WHEN to open it, WHAT to show and WHERE to pin it; this
|
|
13
|
+
* renders the rows and reports the pick. That split is what lets a plain text
|
|
14
|
+
* input and a rich-text editor — which agree on nothing about caret handling —
|
|
15
|
+
* present an identical menu.
|
|
16
|
+
*
|
|
17
|
+
* RENDERED THROUGH A CDK OVERLAY, NOT IN PLACE. The first version positioned a
|
|
18
|
+
* `position: fixed` panel at the anchor point, which is only viewport-relative
|
|
19
|
+
* until an ANCESTOR carries a `transform` — at which point that ancestor
|
|
20
|
+
* becomes the containing block and every coordinate is offset by its
|
|
21
|
+
* translation. The workflow canvas pans and zooms via transforms and the step
|
|
22
|
+
* editor drawer animates with them, so the menu opened far from the caret.
|
|
23
|
+
* A CDK overlay attaches to the body-level overlay container, which no app
|
|
24
|
+
* transform can reach — the same mechanism every Material dropdown relies on
|
|
25
|
+
* inside that exact canvas. The anchor stays a plain viewport point, so hosts
|
|
26
|
+
* are unaffected.
|
|
27
|
+
*
|
|
28
|
+
* The template still belongs to THIS component (a `TemplatePortal` renders the
|
|
29
|
+
* component's own view), so the scoped styles and the reactive `options` /
|
|
30
|
+
* `activeIndex` bindings work unchanged inside the overlay.
|
|
31
|
+
*/
|
|
32
|
+
class TokenBindingMenuComponent {
|
|
33
|
+
#overlay;
|
|
34
|
+
#viewContainerRef;
|
|
35
|
+
#overlayRef;
|
|
36
|
+
#positionStrategy;
|
|
37
|
+
constructor() {
|
|
38
|
+
/** Rows to render, already filtered by the host. */
|
|
39
|
+
this.options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
40
|
+
/** Index of the highlighted row. */
|
|
41
|
+
this.activeIndex = input(0, ...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
42
|
+
/** Viewport position. `null` renders nothing. */
|
|
43
|
+
this.anchor = input(null, ...(ngDevMode ? [{ debugName: "anchor" }] : /* istanbul ignore next */ []));
|
|
44
|
+
/**
|
|
45
|
+
* A row was chosen.
|
|
46
|
+
*
|
|
47
|
+
* Raised from `mousedown`, not `click`: the host's input still has focus and a
|
|
48
|
+
* `click` would arrive after the blur that closes the menu.
|
|
49
|
+
*/
|
|
50
|
+
this.pick = output();
|
|
51
|
+
this.menuTpl = viewChild('menuTpl', ...(ngDevMode ? [{ debugName: "menuTpl" }] : /* istanbul ignore next */ []));
|
|
52
|
+
this.#overlay = inject(Overlay);
|
|
53
|
+
this.#viewContainerRef = inject(ViewContainerRef);
|
|
54
|
+
this.#overlayRef = null;
|
|
55
|
+
this.#positionStrategy = null;
|
|
56
|
+
effect(() => {
|
|
57
|
+
const at = this.anchor();
|
|
58
|
+
const template = this.menuTpl();
|
|
59
|
+
if (!at || !template) {
|
|
60
|
+
this.#detach();
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
this.#show(at, template);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
ngOnDestroy() {
|
|
67
|
+
this.#overlayRef?.dispose();
|
|
68
|
+
this.#overlayRef = null;
|
|
69
|
+
}
|
|
70
|
+
/** Creates the overlay on first open; re-pins it on every anchor move. */
|
|
71
|
+
#show(at, template) {
|
|
72
|
+
if (!this.#overlayRef) {
|
|
73
|
+
this.#positionStrategy = this.#overlay
|
|
74
|
+
.position()
|
|
75
|
+
.flexibleConnectedTo({ x: at.left, y: at.top })
|
|
76
|
+
.withPositions([
|
|
77
|
+
// Below the anchor point, then flipped above when the viewport runs out.
|
|
78
|
+
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'top' },
|
|
79
|
+
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' },
|
|
80
|
+
{ originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'top' },
|
|
81
|
+
])
|
|
82
|
+
.withViewportMargin(8);
|
|
83
|
+
this.#overlayRef = this.#overlay.create({
|
|
84
|
+
positionStrategy: this.#positionStrategy,
|
|
85
|
+
scrollStrategy: this.#overlay.scrollStrategies.reposition(),
|
|
86
|
+
width: at.width,
|
|
87
|
+
});
|
|
88
|
+
this.#overlayRef.attach(new TemplatePortal(template, this.#viewContainerRef));
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
this.#overlayRef.updateSize({ width: at.width });
|
|
92
|
+
this.#positionStrategy?.setOrigin({ x: at.left, y: at.top });
|
|
93
|
+
this.#overlayRef.updatePosition();
|
|
94
|
+
}
|
|
95
|
+
#detach() {
|
|
96
|
+
if (this.#overlayRef?.hasAttached()) {
|
|
97
|
+
this.#overlayRef.detach();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: TokenBindingMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
101
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: TokenBindingMenuComponent, isStandalone: true, selector: "lib-token-binding-menu", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, activeIndex: { classPropertyName: "activeIndex", publicName: "activeIndex", isSignal: true, isRequired: false, transformFunction: null }, anchor: { classPropertyName: "anchor", publicName: "anchor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pick: "pick" }, viewQueries: [{ propertyName: "menuTpl", first: true, predicate: ["menuTpl"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #menuTpl>\n <div class=\"token-binding-menu\" role=\"listbox\">\n @for (binding of options(); track binding.insert; let i = $index) {\n <button\n type=\"button\"\n role=\"option\"\n class=\"token-binding-menu__option\"\n [class.is-active]=\"i === activeIndex()\"\n [attr.aria-selected]=\"i === activeIndex()\"\n (mousedown)=\"pick.emit(binding)\">\n @if (binding.icon) {\n <mat-icon class=\"token-binding-menu__icon\">{{ binding.icon }}</mat-icon>\n }\n <span class=\"token-binding-menu__labels\">\n <span class=\"token-binding-menu__label\">{{ binding.label }}</span>\n @if (binding.detail) {\n <span class=\"token-binding-menu__detail\">{{ binding.detail }}</span>\n }\n </span>\n </button>\n } @empty {\n <p class=\"token-binding-menu__empty\">No matching fields</p>\n }\n </div>\n</ng-template>\n", styles: [".token-binding-menu{width:100%;max-height:260px;overflow-y:auto;padding:4px;border-radius:8px;background:var(--mat-sys-surface-container, #fff);border:1px solid var(--mat-sys-outline-variant, rgba(0, 0, 0, .12));box-shadow:0 6px 20px #0000002e}.token-binding-menu__option{display:flex;align-items:center;gap:8px;width:100%;padding:6px 8px;border:0;border-radius:6px;background:transparent;text-align:left;cursor:pointer;color:var(--mat-sys-on-surface, inherit);font:inherit}.token-binding-menu__option:hover,.token-binding-menu__option.is-active{background:var(--mat-sys-secondary-container, rgba(0, 0, 0, .06))}.token-binding-menu__icon{flex:0 0 auto;font-size:18px;width:18px;height:18px;opacity:.7}.token-binding-menu__labels{display:flex;flex-direction:column;min-width:0}.token-binding-menu__label{font-size:13px;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.token-binding-menu__detail{font-size:11px;line-height:1.3;opacity:.6}.token-binding-menu__empty{margin:0;padding:8px;font-size:12px;opacity:.6}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
102
|
+
}
|
|
103
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: TokenBindingMenuComponent, decorators: [{
|
|
104
|
+
type: Component,
|
|
105
|
+
args: [{ selector: 'lib-token-binding-menu', imports: [MatIconModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template #menuTpl>\n <div class=\"token-binding-menu\" role=\"listbox\">\n @for (binding of options(); track binding.insert; let i = $index) {\n <button\n type=\"button\"\n role=\"option\"\n class=\"token-binding-menu__option\"\n [class.is-active]=\"i === activeIndex()\"\n [attr.aria-selected]=\"i === activeIndex()\"\n (mousedown)=\"pick.emit(binding)\">\n @if (binding.icon) {\n <mat-icon class=\"token-binding-menu__icon\">{{ binding.icon }}</mat-icon>\n }\n <span class=\"token-binding-menu__labels\">\n <span class=\"token-binding-menu__label\">{{ binding.label }}</span>\n @if (binding.detail) {\n <span class=\"token-binding-menu__detail\">{{ binding.detail }}</span>\n }\n </span>\n </button>\n } @empty {\n <p class=\"token-binding-menu__empty\">No matching fields</p>\n }\n </div>\n</ng-template>\n", styles: [".token-binding-menu{width:100%;max-height:260px;overflow-y:auto;padding:4px;border-radius:8px;background:var(--mat-sys-surface-container, #fff);border:1px solid var(--mat-sys-outline-variant, rgba(0, 0, 0, .12));box-shadow:0 6px 20px #0000002e}.token-binding-menu__option{display:flex;align-items:center;gap:8px;width:100%;padding:6px 8px;border:0;border-radius:6px;background:transparent;text-align:left;cursor:pointer;color:var(--mat-sys-on-surface, inherit);font:inherit}.token-binding-menu__option:hover,.token-binding-menu__option.is-active{background:var(--mat-sys-secondary-container, rgba(0, 0, 0, .06))}.token-binding-menu__icon{flex:0 0 auto;font-size:18px;width:18px;height:18px;opacity:.7}.token-binding-menu__labels{display:flex;flex-direction:column;min-width:0}.token-binding-menu__label{font-size:13px;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.token-binding-menu__detail{font-size:11px;line-height:1.3;opacity:.6}.token-binding-menu__empty{margin:0;padding:8px;font-size:12px;opacity:.6}\n"] }]
|
|
106
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], activeIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeIndex", required: false }] }], anchor: [{ type: i0.Input, args: [{ isSignal: true, alias: "anchor", required: false }] }], pick: [{ type: i0.Output, args: ["pick"] }], menuTpl: [{ type: i0.ViewChild, args: ['menuTpl', { isSignal: true }] }] } });
|
|
107
|
+
|
|
108
|
+
export { TokenBindingMenuComponent as T };
|
|
109
|
+
//# sourceMappingURL=ngx-t-forms-token-binding-menu.component-CLpjkUnf.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-t-forms-token-binding-menu.component-CLpjkUnf.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/token-binding-menu/token-binding-menu.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/token-binding-menu/token-binding-menu.component.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n OnDestroy,\n TemplateRef,\n ViewContainerRef,\n effect,\n inject,\n input,\n output,\n viewChild,\n} from '@angular/core';\nimport { Overlay, OverlayRef, type FlexibleConnectedPositionStrategy } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport type { EditorBinding } from '../json-editor/json-editor.component';\n\n/** Where the menu is pinned, in viewport coordinates. */\nexport interface TokenMenuAnchor {\n readonly top: number;\n readonly left: number;\n readonly width: number;\n}\n\n/**\n * The `$`-trigger option list, shared by every editor that offers the gesture.\n *\n * Purely presentational: it owns no filtering, no caret maths and no insertion.\n * The host decides WHEN to open it, WHAT to show and WHERE to pin it; this\n * renders the rows and reports the pick. That split is what lets a plain text\n * input and a rich-text editor — which agree on nothing about caret handling —\n * present an identical menu.\n *\n * RENDERED THROUGH A CDK OVERLAY, NOT IN PLACE. The first version positioned a\n * `position: fixed` panel at the anchor point, which is only viewport-relative\n * until an ANCESTOR carries a `transform` — at which point that ancestor\n * becomes the containing block and every coordinate is offset by its\n * translation. The workflow canvas pans and zooms via transforms and the step\n * editor drawer animates with them, so the menu opened far from the caret.\n * A CDK overlay attaches to the body-level overlay container, which no app\n * transform can reach — the same mechanism every Material dropdown relies on\n * inside that exact canvas. The anchor stays a plain viewport point, so hosts\n * are unaffected.\n *\n * The template still belongs to THIS component (a `TemplatePortal` renders the\n * component's own view), so the scoped styles and the reactive `options` /\n * `activeIndex` bindings work unchanged inside the overlay.\n */\n@Component({\n selector: 'lib-token-binding-menu',\n imports: [MatIconModule],\n templateUrl: './token-binding-menu.component.html',\n styleUrl: './token-binding-menu.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TokenBindingMenuComponent implements OnDestroy {\n /** Rows to render, already filtered by the host. */\n readonly options = input<readonly EditorBinding[]>([]);\n /** Index of the highlighted row. */\n readonly activeIndex = input<number>(0);\n /** Viewport position. `null` renders nothing. */\n readonly anchor = input<TokenMenuAnchor | null>(null);\n\n /**\n * A row was chosen.\n *\n * Raised from `mousedown`, not `click`: the host's input still has focus and a\n * `click` would arrive after the blur that closes the menu.\n */\n readonly pick = output<EditorBinding>();\n\n private readonly menuTpl = viewChild<TemplateRef<unknown>>('menuTpl');\n\n readonly #overlay = inject(Overlay);\n readonly #viewContainerRef = inject(ViewContainerRef);\n #overlayRef: OverlayRef | null = null;\n #positionStrategy: FlexibleConnectedPositionStrategy | null = null;\n\n constructor() {\n effect(() => {\n const at = this.anchor();\n const template = this.menuTpl();\n if (!at || !template) {\n this.#detach();\n return;\n }\n this.#show(at, template);\n });\n }\n\n ngOnDestroy(): void {\n this.#overlayRef?.dispose();\n this.#overlayRef = null;\n }\n\n /** Creates the overlay on first open; re-pins it on every anchor move. */\n #show(at: TokenMenuAnchor, template: TemplateRef<unknown>): void {\n if (!this.#overlayRef) {\n this.#positionStrategy = this.#overlay\n .position()\n .flexibleConnectedTo({ x: at.left, y: at.top })\n .withPositions([\n // Below the anchor point, then flipped above when the viewport runs out.\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'top' },\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' },\n { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'top' },\n ])\n .withViewportMargin(8);\n this.#overlayRef = this.#overlay.create({\n positionStrategy: this.#positionStrategy,\n scrollStrategy: this.#overlay.scrollStrategies.reposition(),\n width: at.width,\n });\n this.#overlayRef.attach(new TemplatePortal(template, this.#viewContainerRef));\n return;\n }\n this.#overlayRef.updateSize({ width: at.width });\n this.#positionStrategy?.setOrigin({ x: at.left, y: at.top });\n this.#overlayRef.updatePosition();\n }\n\n #detach(): void {\n if (this.#overlayRef?.hasAttached()) {\n this.#overlayRef.detach();\n }\n }\n}\n","<ng-template #menuTpl>\n <div class=\"token-binding-menu\" role=\"listbox\">\n @for (binding of options(); track binding.insert; let i = $index) {\n <button\n type=\"button\"\n role=\"option\"\n class=\"token-binding-menu__option\"\n [class.is-active]=\"i === activeIndex()\"\n [attr.aria-selected]=\"i === activeIndex()\"\n (mousedown)=\"pick.emit(binding)\">\n @if (binding.icon) {\n <mat-icon class=\"token-binding-menu__icon\">{{ binding.icon }}</mat-icon>\n }\n <span class=\"token-binding-menu__labels\">\n <span class=\"token-binding-menu__label\">{{ binding.label }}</span>\n @if (binding.detail) {\n <span class=\"token-binding-menu__detail\">{{ binding.detail }}</span>\n }\n </span>\n </button>\n } @empty {\n <p class=\"token-binding-menu__empty\">No matching fields</p>\n }\n </div>\n</ng-template>\n"],"names":["i1"],"mappings":";;;;;;;AAyBA;;;;;;;;;;;;;;;;;;;;;;;AAuBG;MAQU,yBAAyB,CAAA;AAkB3B,IAAA,QAAQ;AACR,IAAA,iBAAiB;AAC1B,IAAA,WAAW;AACX,IAAA,iBAAiB;AAEjB,IAAA,WAAA,GAAA;;AArBS,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAA2B,EAAE,8EAAC;;AAE7C,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAS,CAAC,kFAAC;;AAE9B,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAyB,IAAI,6EAAC;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AA,eAAA,EAGP,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,87BAAA,EAAA,MAAA,EAAA,CAAA,ghCAAA,CAAA,EAAA;4aAkBY,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;"}
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { signal, output, viewChild, computed, forwardRef, Input, Optional, Self, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { MatFormFieldControl } from '@angular/material/form-field';
|
|
4
|
+
import * as i2 from '@angular/material/input';
|
|
5
|
+
import { MatInputModule } from '@angular/material/input';
|
|
6
|
+
import { B as BaseCustomInput } from './ngx-t-forms-ngx-t-forms-9BfJdjl4.mjs';
|
|
7
|
+
import { T as TokenBindingMenuComponent } from './ngx-t-forms-token-binding-menu.component-CLpjkUnf.mjs';
|
|
8
|
+
import * as i1 from '@angular/forms';
|
|
9
|
+
|
|
10
|
+
const tokenTextInputConfig = {
|
|
11
|
+
controlType: 'lib-token-text-input',
|
|
12
|
+
nextId: 0,
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Single-line text with the `$`-trigger token picker.
|
|
16
|
+
*
|
|
17
|
+
* WHY THIS EXISTS
|
|
18
|
+
* ---------------
|
|
19
|
+
* The `$` gesture — type `$`, pick a field, get its `{{token}}` inserted — was
|
|
20
|
+
* only ever implemented inside {@link JsonEditorComponent}, welded to a JSON
|
|
21
|
+
* textarea with syntax highlighting and a caret-offset model. Every consumer of
|
|
22
|
+
* it (the payload, header and query template editors) authors JSON.
|
|
23
|
+
*
|
|
24
|
+
* An email subject is plain text, and `ElementEditorTypes.Input` renders a bare
|
|
25
|
+
* `matInput` with no picker at all — so an element carrying the hint "Press $ to
|
|
26
|
+
* insert a document value" silently promised something that could not happen.
|
|
27
|
+
* This is the same gesture over a plain string.
|
|
28
|
+
*
|
|
29
|
+
* WHY IT IS A `MatFormFieldControl`
|
|
30
|
+
* ---------------------------------
|
|
31
|
+
* `t-dynamic-data-edit` renders every editor that IS one inside a shared
|
|
32
|
+
* `<mat-form-field>` (the label, outline, hint and error row all come from
|
|
33
|
+
* there) and everything else outside it. A plain `<input matInput>` sitting in
|
|
34
|
+
* THIS component's view is not *content* of that field, so Material cannot see
|
|
35
|
+
* it and throws `mat-form-field must contain a MatFormFieldControl` — the field
|
|
36
|
+
* then fails to render at all. Registering as the control, exactly as
|
|
37
|
+
* `InputCustomComponent` and `QuillInputComponent` do, is what makes the field
|
|
38
|
+
* appear.
|
|
39
|
+
*
|
|
40
|
+
* WHAT IS SHARED, AND WHAT IS NOT
|
|
41
|
+
* -------------------------------
|
|
42
|
+
* The option list itself is {@link TokenBindingMenuComponent}, shared with
|
|
43
|
+
* `QuillInputComponent` so the gesture looks and behaves identically wherever
|
|
44
|
+
* it appears. The binding data is shared too — {@link EditorBinding} plus the
|
|
45
|
+
* derivation in `_shared/field-bindings.ts` — so every editor offers the same
|
|
46
|
+
* fields under the same labels and inserts the same spelling.
|
|
47
|
+
*
|
|
48
|
+
* The CARET handling is not shared and should not be: a text input addresses
|
|
49
|
+
* `selectionStart` on a string, Quill addresses an index into a Delta, and the
|
|
50
|
+
* JSON editor tracks an offset into a highlighted backdrop. Those three have
|
|
51
|
+
* nothing in common beyond "find the `$` before the cursor", so each host owns
|
|
52
|
+
* its own few lines rather than an abstraction that fits none of them.
|
|
53
|
+
*/
|
|
54
|
+
class TokenTextInputComponent extends BaseCustomInput {
|
|
55
|
+
/**
|
|
56
|
+
* Insertable bindings for the `$` menu. When empty the menu never opens.
|
|
57
|
+
*
|
|
58
|
+
* A classic `@Input` rather than a signal input, mirroring
|
|
59
|
+
* `InputCustomComponent.inputConfig`: the base class exposes
|
|
60
|
+
* `value`/`required`/`disabled`/`placeholder` as setter-backed `@Input`s tied
|
|
61
|
+
* to `stateChanges`, and mixing the two styles on one component is the trap
|
|
62
|
+
* that comment warns about. The setter feeds a signal so `filtered` can stay a
|
|
63
|
+
* `computed`.
|
|
64
|
+
*/
|
|
65
|
+
set bindings(value) {
|
|
66
|
+
this.#bindings.set(value ?? []);
|
|
67
|
+
}
|
|
68
|
+
get bindings() {
|
|
69
|
+
return this.#bindings();
|
|
70
|
+
}
|
|
71
|
+
#bindings;
|
|
72
|
+
/**
|
|
73
|
+
* Current text, tokens included.
|
|
74
|
+
*
|
|
75
|
+
* Re-declared as an `@Input` because `BaseCustomInput.value` is a plain
|
|
76
|
+
* accessor, not an input — a subclass that wants `[value]` bound has to say
|
|
77
|
+
* so. `QuillInputComponent` does exactly this for the same reason.
|
|
78
|
+
*/
|
|
79
|
+
set value(next) {
|
|
80
|
+
super.value = next;
|
|
81
|
+
// The @Input path never calls writeValue, so the DOM is synced here too.
|
|
82
|
+
// Guarded, so the echo of the author's own keystrokes is a no-op.
|
|
83
|
+
this.syncInputFromModel();
|
|
84
|
+
}
|
|
85
|
+
get value() {
|
|
86
|
+
return super.value;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Characters that keep the menu open after a dollar trigger.
|
|
90
|
+
*
|
|
91
|
+
* WIDER than the JSON editor's word-chars-only filter on purpose: this menu
|
|
92
|
+
* also offers server-resolved namespace tokens whose ids contain dots
|
|
93
|
+
* (`$doc.reference`), and form-control ids may carry hyphens — the original
|
|
94
|
+
* pattern CLOSED the menu the moment either was typed. Punctuation outside
|
|
95
|
+
* this set still reads as a literal dollar (a currency amount) and dismisses
|
|
96
|
+
* the menu.
|
|
97
|
+
*/
|
|
98
|
+
static { this.FILTER_PATTERN = /^[a-zA-Z0-9_.\s-]*$/; }
|
|
99
|
+
constructor(ngControl, elementRef) {
|
|
100
|
+
super(ngControl, elementRef, tokenTextInputConfig);
|
|
101
|
+
this.#bindings = signal([], ...(ngDevMode ? [{ debugName: "#bindings" }] : /* istanbul ignore next */ []));
|
|
102
|
+
/** Emitted on every keystroke and on insertion. */
|
|
103
|
+
this.valueChange = output();
|
|
104
|
+
// The native input is left uncontrolled while the user types. Binding the
|
|
105
|
+
// (debounced, therefore lagging) model to `[value]` makes Angular overwrite the
|
|
106
|
+
// DOM mid-keystroke and drop characters — the same reasoning, and the same
|
|
107
|
+
// remedy, as `InputCustomComponent`. TS `private`, not ES `#private`: Angular
|
|
108
|
+
// signal queries cannot sit on an ES-private field.
|
|
109
|
+
this.inputEl = viewChild('inputEl', ...(ngDevMode ? [{ debugName: "inputEl" }] : /* istanbul ignore next */ []));
|
|
110
|
+
/** Whether the `$` menu is open. */
|
|
111
|
+
this.menuOpen = signal(false, ...(ngDevMode ? [{ debugName: "menuOpen" }] : /* istanbul ignore next */ []));
|
|
112
|
+
/** Text typed after the `$` that opened the menu. */
|
|
113
|
+
this.filter = signal('', ...(ngDevMode ? [{ debugName: "filter" }] : /* istanbul ignore next */ []));
|
|
114
|
+
/** Index of the highlighted option. */
|
|
115
|
+
this.activeIndex = signal(0, ...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
116
|
+
/**
|
|
117
|
+
* Viewport position of the menu.
|
|
118
|
+
*
|
|
119
|
+
* Fixed positioning, not absolute: the menu lives inside a `<mat-form-field>`,
|
|
120
|
+
* whose infix and subscript wrappers clip an absolutely-positioned child, so
|
|
121
|
+
* the list would be cut off after a row or two.
|
|
122
|
+
*/
|
|
123
|
+
this.anchor = signal(null, ...(ngDevMode ? [{ debugName: "anchor" }] : /* istanbul ignore next */ []));
|
|
124
|
+
/** Bindings matching the active filter, capped so the list stays usable. */
|
|
125
|
+
this.filtered = computed(() => {
|
|
126
|
+
const term = this.filter().trim().toLowerCase();
|
|
127
|
+
const all = this.#bindings();
|
|
128
|
+
if (!term) {
|
|
129
|
+
return all.slice(0, 50);
|
|
130
|
+
}
|
|
131
|
+
return all
|
|
132
|
+
.filter((binding) => `${binding.searchText ?? ''} ${binding.label}`.toLowerCase().includes(term))
|
|
133
|
+
.slice(0, 50);
|
|
134
|
+
}, ...(ngDevMode ? [{ debugName: "filtered" }] : /* istanbul ignore next */ []));
|
|
135
|
+
}
|
|
136
|
+
get empty() {
|
|
137
|
+
const current = this.value;
|
|
138
|
+
return current === null || current === undefined || current === '';
|
|
139
|
+
}
|
|
140
|
+
get shouldLabelFloat() {
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
ngAfterViewInit() {
|
|
144
|
+
// Reflect any value the form set before the view existed.
|
|
145
|
+
this.syncInputFromModel();
|
|
146
|
+
}
|
|
147
|
+
writeValue(value) {
|
|
148
|
+
super.writeValue(value);
|
|
149
|
+
// External model change (patchValue / reset). Never fires in response to the
|
|
150
|
+
// user's own typing, so it cannot clobber the caret.
|
|
151
|
+
this.syncInputFromModel();
|
|
152
|
+
}
|
|
153
|
+
/** Re-emits on every keystroke and decides whether the `$` menu should be open. */
|
|
154
|
+
onInput() {
|
|
155
|
+
const element = this.inputEl()?.nativeElement;
|
|
156
|
+
if (!element) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
super.value = element.value;
|
|
160
|
+
this.valueChange.emit(element.value);
|
|
161
|
+
this.syncMenu(element);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Keyboard handling while the menu is open: navigate, accept, dismiss.
|
|
165
|
+
*
|
|
166
|
+
* Returns early when the menu is closed so ordinary typing — including Enter
|
|
167
|
+
* inside a form — is untouched.
|
|
168
|
+
*/
|
|
169
|
+
onKeydown(event) {
|
|
170
|
+
if (!this.menuOpen()) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
const options = this.filtered();
|
|
174
|
+
if (event.key === 'Escape') {
|
|
175
|
+
this.menuOpen.set(false);
|
|
176
|
+
event.stopPropagation();
|
|
177
|
+
event.preventDefault();
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
|
|
181
|
+
if (options.length > 0) {
|
|
182
|
+
const step = event.key === 'ArrowDown' ? 1 : -1;
|
|
183
|
+
this.activeIndex.set((this.activeIndex() + step + options.length) % options.length);
|
|
184
|
+
}
|
|
185
|
+
event.preventDefault();
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
if (event.key === 'Enter' || event.key === 'Tab') {
|
|
189
|
+
const chosen = options[this.activeIndex()];
|
|
190
|
+
if (chosen) {
|
|
191
|
+
this.insert(chosen);
|
|
192
|
+
event.preventDefault();
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
/** Closing is deferred so a click on an option still registers before blur. */
|
|
197
|
+
onBlur($event) {
|
|
198
|
+
this.touched = true;
|
|
199
|
+
this.onTouched();
|
|
200
|
+
this.blur.emit($event);
|
|
201
|
+
setTimeout(() => this.menuOpen.set(false), 150);
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Replaces the `$filter` run at the caret with the binding's token.
|
|
205
|
+
*
|
|
206
|
+
* @param binding - The chosen menu entry.
|
|
207
|
+
*/
|
|
208
|
+
insert(binding) {
|
|
209
|
+
const element = this.inputEl()?.nativeElement;
|
|
210
|
+
if (!element) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
const caret = element.selectionStart ?? element.value.length;
|
|
214
|
+
const dollar = element.value.lastIndexOf('$', Math.max(0, caret - 1));
|
|
215
|
+
if (dollar < 0) {
|
|
216
|
+
this.menuOpen.set(false);
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
const next = element.value.slice(0, dollar) + binding.insert + element.value.slice(caret);
|
|
220
|
+
element.value = next;
|
|
221
|
+
const cursor = dollar + binding.insert.length;
|
|
222
|
+
element.setSelectionRange(cursor, cursor);
|
|
223
|
+
this.menuOpen.set(false);
|
|
224
|
+
this.filter.set('');
|
|
225
|
+
super.value = next;
|
|
226
|
+
this.valueChange.emit(next);
|
|
227
|
+
element.focus();
|
|
228
|
+
}
|
|
229
|
+
/** Pushes the model onto the DOM. Only ever runs for EXTERNAL writes. */
|
|
230
|
+
syncInputFromModel() {
|
|
231
|
+
const element = this.inputEl()?.nativeElement;
|
|
232
|
+
if (!element) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
const current = this.value ?? '';
|
|
236
|
+
// Only write on a genuine difference: assigning to input.value resets the
|
|
237
|
+
// caret to the end even when the string is unchanged.
|
|
238
|
+
if (element.value !== String(current)) {
|
|
239
|
+
element.value = String(current);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
/** Opens, filters or closes the menu based on the text between the last `$` and the caret. */
|
|
243
|
+
syncMenu(element) {
|
|
244
|
+
if (this.disabled || this.#bindings().length === 0) {
|
|
245
|
+
this.menuOpen.set(false);
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
const caret = element.selectionStart ?? element.value.length;
|
|
249
|
+
const beforeCaret = element.value.slice(0, caret);
|
|
250
|
+
const dollar = beforeCaret.lastIndexOf('$');
|
|
251
|
+
if (dollar < 0) {
|
|
252
|
+
this.menuOpen.set(false);
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
const term = beforeCaret.slice(dollar + 1);
|
|
256
|
+
if (!TokenTextInputComponent.FILTER_PATTERN.test(term)) {
|
|
257
|
+
this.menuOpen.set(false);
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
const rect = element.getBoundingClientRect();
|
|
261
|
+
this.anchor.set({ top: rect.bottom + 4, left: rect.left, width: Math.max(rect.width, 240) });
|
|
262
|
+
this.filter.set(term);
|
|
263
|
+
this.activeIndex.set(0);
|
|
264
|
+
this.menuOpen.set(true);
|
|
265
|
+
}
|
|
266
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: TokenTextInputComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
267
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: TokenTextInputComponent, isStandalone: true, selector: "lib-token-text-input", inputs: { bindings: "bindings", value: "value" }, outputs: { valueChange: "valueChange" }, host: { properties: { "class.floating": "shouldLabelFloat", "id": "id" } }, providers: [
|
|
268
|
+
{
|
|
269
|
+
provide: MatFormFieldControl,
|
|
270
|
+
useExisting: forwardRef(() => TokenTextInputComponent),
|
|
271
|
+
},
|
|
272
|
+
], viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["inputEl"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<input\n matInput\n #inputEl\n type=\"text\"\n [readonly]=\"disabled\"\n [required]=\"required\"\n [placeholder]=\"placeholder || ''\"\n (input)=\"onInput()\"\n (click)=\"onInput()\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur($event)\" />\n\n@if (menuOpen()) {\n <lib-token-binding-menu\n [options]=\"filtered()\"\n [activeIndex]=\"activeIndex()\"\n [anchor]=\"anchor()\"\n (pick)=\"insert($event)\" />\n}\n", styles: [":host{display:block;width:100%}\n"], dependencies: [{ kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: TokenBindingMenuComponent, selector: "lib-token-binding-menu", inputs: ["options", "activeIndex", "anchor"], outputs: ["pick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
273
|
+
}
|
|
274
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: TokenTextInputComponent, decorators: [{
|
|
275
|
+
type: Component,
|
|
276
|
+
args: [{ selector: 'lib-token-text-input', imports: [MatInputModule, TokenBindingMenuComponent], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, host: {
|
|
277
|
+
'[class.floating]': 'shouldLabelFloat',
|
|
278
|
+
'[id]': 'id',
|
|
279
|
+
}, providers: [
|
|
280
|
+
{
|
|
281
|
+
provide: MatFormFieldControl,
|
|
282
|
+
useExisting: forwardRef(() => TokenTextInputComponent),
|
|
283
|
+
},
|
|
284
|
+
], template: "<input\n matInput\n #inputEl\n type=\"text\"\n [readonly]=\"disabled\"\n [required]=\"required\"\n [placeholder]=\"placeholder || ''\"\n (input)=\"onInput()\"\n (click)=\"onInput()\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur($event)\" />\n\n@if (menuOpen()) {\n <lib-token-binding-menu\n [options]=\"filtered()\"\n [activeIndex]=\"activeIndex()\"\n [anchor]=\"anchor()\"\n (pick)=\"insert($event)\" />\n}\n", styles: [":host{display:block;width:100%}\n"] }]
|
|
285
|
+
}], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
|
|
286
|
+
type: Optional
|
|
287
|
+
}, {
|
|
288
|
+
type: Self
|
|
289
|
+
}] }, { type: i0.ElementRef }], propDecorators: { bindings: [{
|
|
290
|
+
type: Input
|
|
291
|
+
}], valueChange: [{ type: i0.Output, args: ["valueChange"] }], value: [{
|
|
292
|
+
type: Input
|
|
293
|
+
}], inputEl: [{ type: i0.ViewChild, args: ['inputEl', { isSignal: true }] }] } });
|
|
294
|
+
|
|
295
|
+
export { TokenTextInputComponent };
|
|
296
|
+
//# sourceMappingURL=ngx-t-forms-token-text-input.component-DY04Z0fn.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-t-forms-token-text-input.component-DY04Z0fn.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/token-text-input/token-text-input.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/token-text-input/token-text-input.component.html"],"sourcesContent":["import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Input,\n Optional,\n Self,\n ViewEncapsulation,\n computed,\n forwardRef,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { MatFormFieldControl } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\n\nimport {\n BaseCustomInput,\n BaseCustomInputConfig,\n} from '../../../../services/core/t-input-controller/functions/baseCustomInput';\nimport type { EditorBinding } from '../json-editor/json-editor.component';\nimport { TokenBindingMenuComponent, type TokenMenuAnchor } from '../token-binding-menu/token-binding-menu.component';\n\nconst tokenTextInputConfig: BaseCustomInputConfig = {\n controlType: 'lib-token-text-input',\n nextId: 0,\n};\n\n/**\n * Single-line text with the `$`-trigger token picker.\n *\n * WHY THIS EXISTS\n * ---------------\n * The `$` gesture — type `$`, pick a field, get its `{{token}}` inserted — was\n * only ever implemented inside {@link JsonEditorComponent}, welded to a JSON\n * textarea with syntax highlighting and a caret-offset model. Every consumer of\n * it (the payload, header and query template editors) authors JSON.\n *\n * An email subject is plain text, and `ElementEditorTypes.Input` renders a bare\n * `matInput` with no picker at all — so an element carrying the hint \"Press $ to\n * insert a document value\" silently promised something that could not happen.\n * This is the same gesture over a plain string.\n *\n * WHY IT IS A `MatFormFieldControl`\n * ---------------------------------\n * `t-dynamic-data-edit` renders every editor that IS one inside a shared\n * `<mat-form-field>` (the label, outline, hint and error row all come from\n * there) and everything else outside it. A plain `<input matInput>` sitting in\n * THIS component's view is not *content* of that field, so Material cannot see\n * it and throws `mat-form-field must contain a MatFormFieldControl` — the field\n * then fails to render at all. Registering as the control, exactly as\n * `InputCustomComponent` and `QuillInputComponent` do, is what makes the field\n * appear.\n *\n * WHAT IS SHARED, AND WHAT IS NOT\n * -------------------------------\n * The option list itself is {@link TokenBindingMenuComponent}, shared with\n * `QuillInputComponent` so the gesture looks and behaves identically wherever\n * it appears. The binding data is shared too — {@link EditorBinding} plus the\n * derivation in `_shared/field-bindings.ts` — so every editor offers the same\n * fields under the same labels and inserts the same spelling.\n *\n * The CARET handling is not shared and should not be: a text input addresses\n * `selectionStart` on a string, Quill addresses an index into a Delta, and the\n * JSON editor tracks an offset into a highlighted backdrop. Those three have\n * nothing in common beyond \"find the `$` before the cursor\", so each host owns\n * its own few lines rather than an abstraction that fits none of them.\n */\n@Component({\n selector: 'lib-token-text-input',\n imports: [MatInputModule, TokenBindingMenuComponent],\n templateUrl: './token-text-input.component.html',\n styleUrl: './token-text-input.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n '[class.floating]': 'shouldLabelFloat',\n '[id]': 'id',\n },\n providers: [\n {\n provide: MatFormFieldControl,\n useExisting: forwardRef(() => TokenTextInputComponent),\n },\n ],\n})\nexport class TokenTextInputComponent\n extends BaseCustomInput<string>\n implements AfterViewInit\n{\n /**\n * Insertable bindings for the `$` menu. When empty the menu never opens.\n *\n * A classic `@Input` rather than a signal input, mirroring\n * `InputCustomComponent.inputConfig`: the base class exposes\n * `value`/`required`/`disabled`/`placeholder` as setter-backed `@Input`s tied\n * to `stateChanges`, and mixing the two styles on one component is the trap\n * that comment warns about. The setter feeds a signal so `filtered` can stay a\n * `computed`.\n */\n @Input()\n set bindings(value: readonly EditorBinding[] | undefined) {\n this.#bindings.set(value ?? []);\n }\n get bindings(): readonly EditorBinding[] {\n return this.#bindings();\n }\n readonly #bindings = signal<readonly EditorBinding[]>([]);\n\n /** Emitted on every keystroke and on insertion. */\n readonly valueChange = output<string>();\n\n /**\n * Current text, tokens included.\n *\n * Re-declared as an `@Input` because `BaseCustomInput.value` is a plain\n * accessor, not an input — a subclass that wants `[value]` bound has to say\n * so. `QuillInputComponent` does exactly this for the same reason.\n */\n @Input()\n override set value(next: string | null) {\n super.value = next;\n // The @Input path never calls writeValue, so the DOM is synced here too.\n // Guarded, so the echo of the author's own keystrokes is a no-op.\n this.syncInputFromModel();\n }\n override get value(): string | null {\n return super.value;\n }\n\n // The native input is left uncontrolled while the user types. Binding the\n // (debounced, therefore lagging) model to `[value]` makes Angular overwrite the\n // DOM mid-keystroke and drop characters — the same reasoning, and the same\n // remedy, as `InputCustomComponent`. TS `private`, not ES `#private`: Angular\n // signal queries cannot sit on an ES-private field.\n private readonly inputEl = viewChild<ElementRef<HTMLInputElement>>('inputEl');\n\n /** Whether the `$` menu is open. */\n protected readonly menuOpen = signal(false);\n /** Text typed after the `$` that opened the menu. */\n protected readonly filter = signal('');\n /** Index of the highlighted option. */\n protected readonly activeIndex = signal(0);\n /**\n * Viewport position of the menu.\n *\n * Fixed positioning, not absolute: the menu lives inside a `<mat-form-field>`,\n * whose infix and subscript wrappers clip an absolutely-positioned child, so\n * the list would be cut off after a row or two.\n */\n protected readonly anchor = signal<TokenMenuAnchor | null>(null);\n\n /**\n * Characters that keep the menu open after a dollar trigger.\n *\n * WIDER than the JSON editor's word-chars-only filter on purpose: this menu\n * also offers server-resolved namespace tokens whose ids contain dots\n * (`$doc.reference`), and form-control ids may carry hyphens — the original\n * pattern CLOSED the menu the moment either was typed. Punctuation outside\n * this set still reads as a literal dollar (a currency amount) and dismisses\n * the menu.\n */\n static readonly FILTER_PATTERN = /^[a-zA-Z0-9_.\\s-]*$/;\n\n /** Bindings matching the active filter, capped so the list stays usable. */\n protected readonly filtered = computed(() => {\n const term = this.filter().trim().toLowerCase();\n const all = this.#bindings();\n if (!term) {\n return all.slice(0, 50);\n }\n return all\n .filter((binding) =>\n `${binding.searchText ?? ''} ${binding.label}`.toLowerCase().includes(term),\n )\n .slice(0, 50);\n });\n\n constructor(\n @Optional() @Self() ngControl: NgControl,\n elementRef: ElementRef<HTMLElement>,\n ) {\n super(ngControl, elementRef, tokenTextInputConfig);\n }\n\n override get empty(): boolean {\n const current = this.value;\n return current === null || current === undefined || current === '';\n }\n\n override get shouldLabelFloat(): boolean {\n return true;\n }\n\n ngAfterViewInit(): void {\n // Reflect any value the form set before the view existed.\n this.syncInputFromModel();\n }\n\n override writeValue(value: string): void {\n super.writeValue(value);\n // External model change (patchValue / reset). Never fires in response to the\n // user's own typing, so it cannot clobber the caret.\n this.syncInputFromModel();\n }\n\n /** Re-emits on every keystroke and decides whether the `$` menu should be open. */\n protected onInput(): void {\n const element = this.inputEl()?.nativeElement;\n if (!element) {\n return;\n }\n super.value = element.value;\n this.valueChange.emit(element.value);\n this.syncMenu(element);\n }\n\n /**\n * Keyboard handling while the menu is open: navigate, accept, dismiss.\n *\n * Returns early when the menu is closed so ordinary typing — including Enter\n * inside a form — is untouched.\n */\n protected onKeydown(event: KeyboardEvent): void {\n if (!this.menuOpen()) {\n return;\n }\n const options = this.filtered();\n if (event.key === 'Escape') {\n this.menuOpen.set(false);\n event.stopPropagation();\n event.preventDefault();\n return;\n }\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n if (options.length > 0) {\n const step = event.key === 'ArrowDown' ? 1 : -1;\n this.activeIndex.set((this.activeIndex() + step + options.length) % options.length);\n }\n event.preventDefault();\n return;\n }\n if (event.key === 'Enter' || event.key === 'Tab') {\n const chosen = options[this.activeIndex()];\n if (chosen) {\n this.insert(chosen);\n event.preventDefault();\n }\n }\n }\n\n /** Closing is deferred so a click on an option still registers before blur. */\n protected onBlur($event: FocusEvent): void {\n this.touched = true;\n this.onTouched();\n this.blur.emit($event);\n setTimeout(() => this.menuOpen.set(false), 150);\n }\n\n /**\n * Replaces the `$filter` run at the caret with the binding's token.\n *\n * @param binding - The chosen menu entry.\n */\n protected insert(binding: EditorBinding): void {\n const element = this.inputEl()?.nativeElement;\n if (!element) {\n return;\n }\n const caret = element.selectionStart ?? element.value.length;\n const dollar = element.value.lastIndexOf('$', Math.max(0, caret - 1));\n if (dollar < 0) {\n this.menuOpen.set(false);\n return;\n }\n const next = element.value.slice(0, dollar) + binding.insert + element.value.slice(caret);\n element.value = next;\n const cursor = dollar + binding.insert.length;\n element.setSelectionRange(cursor, cursor);\n this.menuOpen.set(false);\n this.filter.set('');\n super.value = next;\n this.valueChange.emit(next);\n element.focus();\n }\n\n /** Pushes the model onto the DOM. Only ever runs for EXTERNAL writes. */\n private syncInputFromModel(): void {\n const element = this.inputEl()?.nativeElement;\n if (!element) {\n return;\n }\n const current = this.value ?? '';\n // Only write on a genuine difference: assigning to input.value resets the\n // caret to the end even when the string is unchanged.\n if (element.value !== String(current)) {\n element.value = String(current);\n }\n }\n\n /** Opens, filters or closes the menu based on the text between the last `$` and the caret. */\n private syncMenu(element: HTMLInputElement): void {\n if (this.disabled || this.#bindings().length === 0) {\n this.menuOpen.set(false);\n return;\n }\n const caret = element.selectionStart ?? element.value.length;\n const beforeCaret = element.value.slice(0, caret);\n const dollar = beforeCaret.lastIndexOf('$');\n if (dollar < 0) {\n this.menuOpen.set(false);\n return;\n }\n const term = beforeCaret.slice(dollar + 1);\n if (!TokenTextInputComponent.FILTER_PATTERN.test(term)) {\n this.menuOpen.set(false);\n return;\n }\n const rect = element.getBoundingClientRect();\n this.anchor.set({ top: rect.bottom + 4, left: rect.left, width: Math.max(rect.width, 240) });\n this.filter.set(term);\n this.activeIndex.set(0);\n this.menuOpen.set(true);\n }\n}\n","<input\n matInput\n #inputEl\n type=\"text\"\n [readonly]=\"disabled\"\n [required]=\"required\"\n [placeholder]=\"placeholder || ''\"\n (input)=\"onInput()\"\n (click)=\"onInput()\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur($event)\" />\n\n@if (menuOpen()) {\n <lib-token-binding-menu\n [options]=\"filtered()\"\n [activeIndex]=\"activeIndex()\"\n [anchor]=\"anchor()\"\n (pick)=\"insert($event)\" />\n}\n"],"names":[],"mappings":";;;;;;;;;AA0BA,MAAM,oBAAoB,GAA0B;AAClD,IAAA,WAAW,EAAE,sBAAsB;AACnC,IAAA,MAAM,EAAE,CAAC;CACV;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCG;AAmBG,MAAO,uBACX,SAAQ,eAAuB,CAAA;AAG/B;;;;;;;;;AASG;IACH,IACI,QAAQ,CAAC,KAA2C,EAAA;QACtD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;IACjC;AACA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-toggle';
|
|
|
23
23
|
import * as i5 from '@angular/material/tooltip';
|
|
24
24
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
25
25
|
import { Subject } from 'rxjs';
|
|
26
|
-
import { P as PREDICATE_OPERATORS, r as referencedTokens, p as parseConditions,
|
|
26
|
+
import { P as PREDICATE_OPERATORS, r as referencedTokens, p as parseConditions, h as evaluatePredicate, i as emptyCondition, s as serializeConditions, j as deriveObservedInputs } from './ngx-t-forms-ngx-t-forms-9BfJdjl4.mjs';
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* Internal editor implementing `MatFormFieldControl<FormControlCustomValidatorsInterface[]>`
|
|
@@ -571,4 +571,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
571
571
|
}], mapToData: [{ type: i0.Input, args: [{ isSignal: true, alias: "mapToData", required: false }] }], formInputs: [{ type: i0.Input, args: [{ isSignal: true, alias: "formInputs", required: false }] }], valueChanged: [{ type: i0.Output, args: ["valueChanged"] }] } });
|
|
572
572
|
|
|
573
573
|
export { ValidatorsConfigComponent };
|
|
574
|
-
//# sourceMappingURL=ngx-t-forms-validators-config.component-
|
|
574
|
+
//# sourceMappingURL=ngx-t-forms-validators-config.component-Btmz2cKH.mjs.map
|