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,731 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, output, computed, ViewEncapsulation, ChangeDetectionStrategy, Component, inject, ElementRef, signal, viewChild, PLATFORM_ID, Input } from '@angular/core';
|
|
3
|
+
import { DOCUMENT, isPlatformBrowser } from '@angular/common';
|
|
4
|
+
import { NgControl } from '@angular/forms';
|
|
5
|
+
import { MatFormFieldControl } from '@angular/material/form-field';
|
|
6
|
+
import { B as BaseCustomInput, _ as _isEqual } 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
|
+
|
|
9
|
+
const svg = (body) => `<svg viewBox="0 0 18 18">${body}</svg>`;
|
|
10
|
+
/**
|
|
11
|
+
* Word-like table toolkit backed by Quill's native table module. Each control degrades to a
|
|
12
|
+
* no-op when the caret is outside a table, so the buttons are always safe to press.
|
|
13
|
+
*/
|
|
14
|
+
const QUILL_TABLE_CONTROLS = [
|
|
15
|
+
{
|
|
16
|
+
format: 'table-insert',
|
|
17
|
+
title: 'Insert table (3×3)',
|
|
18
|
+
icon: svg('<rect class="ql-stroke" fill="none" x="3" y="4" width="12" height="10" rx="1"></rect><line class="ql-stroke" x1="3" y1="7.3" x2="15" y2="7.3"></line><line class="ql-stroke" x1="3" y1="10.6" x2="15" y2="10.6"></line><line class="ql-stroke" x1="7" y1="4" x2="7" y2="14"></line><line class="ql-stroke" x1="11" y1="4" x2="11" y2="14"></line>'),
|
|
19
|
+
run: table => table.insertTable(3, 3),
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
format: 'table-row',
|
|
23
|
+
title: 'Insert row below',
|
|
24
|
+
icon: svg('<rect class="ql-stroke" fill="none" x="3" y="3" width="12" height="6" rx="1"></rect><line class="ql-stroke" x1="9" y1="11" x2="9" y2="15"></line><line class="ql-stroke" x1="7" y1="13" x2="11" y2="13"></line>'),
|
|
25
|
+
run: table => table.insertRowBelow(),
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
format: 'table-column',
|
|
29
|
+
title: 'Insert column right',
|
|
30
|
+
icon: svg('<rect class="ql-stroke" fill="none" x="3" y="3" width="6" height="12" rx="1"></rect><line class="ql-stroke" x1="13" y1="6" x2="13" y2="12"></line><line class="ql-stroke" x1="11" y1="9" x2="15" y2="9"></line>'),
|
|
31
|
+
run: table => table.insertColumnRight(),
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
format: 'table-delete-row',
|
|
35
|
+
title: 'Delete row',
|
|
36
|
+
icon: svg('<rect class="ql-stroke" fill="none" x="3" y="3" width="12" height="6" rx="1"></rect><line class="ql-stroke" x1="7" y1="13" x2="11" y2="13"></line>'),
|
|
37
|
+
run: table => table.deleteRow(),
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
format: 'table-delete-column',
|
|
41
|
+
title: 'Delete column',
|
|
42
|
+
icon: svg('<rect class="ql-stroke" fill="none" x="3" y="3" width="6" height="12" rx="1"></rect><line class="ql-stroke" x1="11" y1="9" x2="15" y2="9"></line>'),
|
|
43
|
+
run: table => table.deleteColumn(),
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
format: 'table-delete',
|
|
47
|
+
title: 'Delete table',
|
|
48
|
+
icon: svg('<rect class="ql-stroke" fill="none" x="3" y="3" width="12" height="12" rx="1"></rect><line class="ql-stroke" x1="5.5" y1="5.5" x2="12.5" y2="12.5"></line><line class="ql-stroke" x1="12.5" y1="5.5" x2="5.5" y2="12.5"></line>'),
|
|
49
|
+
run: table => table.deleteTable(),
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
/**
|
|
53
|
+
* Human-readable tooltips for the built-in controls, keyed by the button's CSS selector.
|
|
54
|
+
* Quill ships no titles of its own, so these make the toolbar self-explanatory.
|
|
55
|
+
*/
|
|
56
|
+
const QUILL_BUILTIN_TITLES = {
|
|
57
|
+
'.ql-bold': 'Bold',
|
|
58
|
+
'.ql-italic': 'Italic',
|
|
59
|
+
'.ql-underline': 'Underline',
|
|
60
|
+
'.ql-strike': 'Strikethrough',
|
|
61
|
+
'.ql-blockquote': 'Quote',
|
|
62
|
+
'.ql-code-block': 'Code block',
|
|
63
|
+
'.ql-link': 'Insert link',
|
|
64
|
+
'.ql-image': 'Insert image',
|
|
65
|
+
'.ql-video': 'Embed video',
|
|
66
|
+
'.ql-clean': 'Clear formatting',
|
|
67
|
+
'.ql-list[value="ordered"]': 'Numbered list',
|
|
68
|
+
'.ql-list[value="bullet"]': 'Bulleted list',
|
|
69
|
+
'.ql-list[value="check"]': 'Checklist',
|
|
70
|
+
'.ql-script[value="sub"]': 'Subscript',
|
|
71
|
+
'.ql-script[value="super"]': 'Superscript',
|
|
72
|
+
'.ql-indent[value="-1"]': 'Decrease indent',
|
|
73
|
+
'.ql-indent[value="+1"]': 'Increase indent',
|
|
74
|
+
'.ql-direction[value="rtl"]': 'Right-to-left',
|
|
75
|
+
'.ql-color': 'Text colour',
|
|
76
|
+
'.ql-background': 'Highlight colour',
|
|
77
|
+
'.ql-align': 'Alignment',
|
|
78
|
+
'.ql-header': 'Heading',
|
|
79
|
+
'.ql-font': 'Font',
|
|
80
|
+
'.ql-size': 'Font size',
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Comprehensive, logically grouped "snow" toolbar — headings/fonts, inline styling, colour,
|
|
84
|
+
* scripts, lists, indentation/alignment, blocks, media and a native table toolkit.
|
|
85
|
+
*/
|
|
86
|
+
const TOOLBAR_CONTAINER = [
|
|
87
|
+
[{ header: [1, 2, 3, 4, 5, 6, false] }, { font: [] }, { size: ['small', false, 'large', 'huge'] }],
|
|
88
|
+
['bold', 'italic', 'underline', 'strike'],
|
|
89
|
+
[{ color: [] }, { background: [] }],
|
|
90
|
+
[{ script: 'sub' }, { script: 'super' }],
|
|
91
|
+
[{ list: 'ordered' }, { list: 'bullet' }, { list: 'check' }],
|
|
92
|
+
[{ indent: '-1' }, { indent: '+1' }, { align: [] }, { direction: 'rtl' }],
|
|
93
|
+
['blockquote', 'code-block'],
|
|
94
|
+
['link', 'image', 'video'],
|
|
95
|
+
QUILL_TABLE_CONTROLS.map(control => control.format),
|
|
96
|
+
['clean']
|
|
97
|
+
];
|
|
98
|
+
/**
|
|
99
|
+
* Builds the toolbar handler map for the custom table buttons.
|
|
100
|
+
*
|
|
101
|
+
* These MUST be supplied in the toolbar config (not added later via `addHandler`): Quill's
|
|
102
|
+
* toolbar skips attaching a click listener to any button whose format is neither a registered
|
|
103
|
+
* blot nor already present in `handlers` at construction time. A late `addHandler` sets the
|
|
104
|
+
* handler but never re-attaches the listener, so the button stays inert.
|
|
105
|
+
*/
|
|
106
|
+
const buildTableHandlers = () => {
|
|
107
|
+
const handlers = {};
|
|
108
|
+
for (const control of QUILL_TABLE_CONTROLS) {
|
|
109
|
+
handlers[control.format] = function tableHandler() {
|
|
110
|
+
const table = this.quill.getModule('table');
|
|
111
|
+
// Native table ops bail when there is no selection; force focus + a range first.
|
|
112
|
+
this.quill.getSelection(true);
|
|
113
|
+
control.run(table);
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
return handlers;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Builds a ready-to-use `QuillOptions` for a "snow" editor with the native table module
|
|
120
|
+
* enabled and the custom table-button handlers wired into the toolbar config.
|
|
121
|
+
*
|
|
122
|
+
* Browser-only by construction: callers MUST instantiate Quill behind an
|
|
123
|
+
* `isPlatformBrowser(...)` guard because Quill touches `document` at construction time.
|
|
124
|
+
*/
|
|
125
|
+
const buildQuillOptions = (payload) => ({
|
|
126
|
+
theme: 'snow',
|
|
127
|
+
readOnly: payload.readOnly,
|
|
128
|
+
placeholder: payload.placeholder ?? "Let's write something amazing...",
|
|
129
|
+
modules: {
|
|
130
|
+
toolbar: {
|
|
131
|
+
container: TOOLBAR_CONTAINER,
|
|
132
|
+
handlers: buildTableHandlers()
|
|
133
|
+
},
|
|
134
|
+
table: true,
|
|
135
|
+
history: { delay: 1000, maxStack: 100, userOnly: true },
|
|
136
|
+
clipboard: { matchVisual: false }
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
/**
|
|
140
|
+
* Quill's empty document is a single trailing newline op. Treat that — and a literally
|
|
141
|
+
* empty op-list — as "no value" so `required` validation behaves intuitively.
|
|
142
|
+
*/
|
|
143
|
+
const isEmptyQuillDocument = (ops) => ops.length === 0 || (ops.length === 1 && ops[0]?.insert === '\n');
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Element-level "pop out to full screen" shared by the rich-text editors in this folder.
|
|
147
|
+
*
|
|
148
|
+
* A plain `position: fixed` overlay is **not** sufficient here, and that is the whole point of
|
|
149
|
+
* this file. The editors render inside a `mat-form-field`, which consumers routinely nest inside
|
|
150
|
+
* a Material stepper, tab body, drawer or dialog. `position: fixed` is viewport-relative only
|
|
151
|
+
* while **no** ancestor establishes a containing block — any ancestor with `transform`, `filter`,
|
|
152
|
+
* `contain`, `will-change`, `backdrop-filter` or `perspective` captures it, and that ancestor's
|
|
153
|
+
* `overflow: hidden` then clips it. Which of those a consumer uses is unknowable from in here, so
|
|
154
|
+
* the pop-out has to stop depending on the host component altogether.
|
|
155
|
+
*
|
|
156
|
+
* The browser's **top layer** is what does that: elements promoted into it are painted outside
|
|
157
|
+
* the ancestor chain and are immune to ancestor `transform`, `overflow`, `z-index` and stacking
|
|
158
|
+
* contexts. Three strategies are tried, best first:
|
|
159
|
+
*
|
|
160
|
+
* 1. `requestFullscreen()` — top layer **and** drops the browser chrome. Needs a user gesture.
|
|
161
|
+
* 2. `showPopover()` — top layer, no gesture required; covers browsers where element full screen
|
|
162
|
+
* is unavailable (Safari on iPhone) or blocked by a `fullscreen` permissions policy in an
|
|
163
|
+
* iframe.
|
|
164
|
+
* 3. `position: fixed` — last resort for browsers with neither API.
|
|
165
|
+
*
|
|
166
|
+
* The element is promoted **in place** — never re-parented to `<body>`. Top-layer promotion
|
|
167
|
+
* changes painting, not inheritance, so the editor keeps inheriting the app's `--mat-sys-*` theme
|
|
168
|
+
* variables from its real ancestors; a portal to `<body>` would lose them.
|
|
169
|
+
*
|
|
170
|
+
* Only the standard, promise-returning `requestFullscreen` is used. The legacy
|
|
171
|
+
* `webkitRequestFullscreen` returns `void` and reports failure through a separate event, so a
|
|
172
|
+
* rejection could not be observed in time to fall through cleanly — those browsers take path 2/3.
|
|
173
|
+
*/
|
|
174
|
+
/**
|
|
175
|
+
* Class carried by the element while it is popped out. Each editor styles it in its own
|
|
176
|
+
* stylesheet, and that rule **must** set a `display` value: it is what keeps the element visible
|
|
177
|
+
* during the popover path (see {@link EditorFullScreenHost.enter}).
|
|
178
|
+
*/
|
|
179
|
+
const EDITOR_FULL_SCREEN_CLASS = 'is-fullscreen';
|
|
180
|
+
/**
|
|
181
|
+
* Owns the pop-out of a single element. One instance per editor; created behind the component's
|
|
182
|
+
* `isPlatformBrowser` guard so nothing here runs during SSR.
|
|
183
|
+
*/
|
|
184
|
+
class EditorFullScreenHost {
|
|
185
|
+
#document;
|
|
186
|
+
#onExternalExit;
|
|
187
|
+
#element;
|
|
188
|
+
#mode;
|
|
189
|
+
/**
|
|
190
|
+
* @param document The owning document, injected via `DOCUMENT` — never the global.
|
|
191
|
+
* @param onExternalExit Called when the browser closed the pop-out without going through
|
|
192
|
+
* {@link exit} (Escape, F11, another element claiming full screen).
|
|
193
|
+
*/
|
|
194
|
+
constructor(document, onExternalExit) {
|
|
195
|
+
this.#document = document;
|
|
196
|
+
this.#onExternalExit = onExternalExit;
|
|
197
|
+
this.#document.addEventListener('fullscreenchange', this.#handleFullScreenChange);
|
|
198
|
+
}
|
|
199
|
+
/** Whether an element is currently popped out. */
|
|
200
|
+
get active() {
|
|
201
|
+
return this.#mode !== undefined;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Pops `element` out using the best mechanism the browser allows, adding
|
|
205
|
+
* {@link EDITOR_FULL_SCREEN_CLASS} for the duration.
|
|
206
|
+
*
|
|
207
|
+
* Must be called synchronously from a user gesture, otherwise the Fullscreen API rejects and
|
|
208
|
+
* the pop-out silently degrades to the popover path.
|
|
209
|
+
*
|
|
210
|
+
* @param element The element to promote — must be the one carrying the editor chrome.
|
|
211
|
+
* @returns The mechanism that ended up being used.
|
|
212
|
+
*/
|
|
213
|
+
async enter(element) {
|
|
214
|
+
if (this.#mode !== undefined)
|
|
215
|
+
return this.#mode;
|
|
216
|
+
// Added first, and deliberately so: the class sets `display`, which — being author origin —
|
|
217
|
+
// beats the UA's `[popover]:not(:popover-open) { display: none }`. Without it the element
|
|
218
|
+
// would be display:none for the window between `setAttribute` and `showPopover()` below, and
|
|
219
|
+
// a style recalculation inside that window blurs whatever the user was typing in.
|
|
220
|
+
this.#element = element;
|
|
221
|
+
element.classList.add(EDITOR_FULL_SCREEN_CLASS);
|
|
222
|
+
// `fullscreenEnabled` is false when a permissions policy blocks it (an iframe without
|
|
223
|
+
// `allow="fullscreen"`) and where element full screen is unsupported (Safari on iPhone).
|
|
224
|
+
if (this.#document.fullscreenEnabled && typeof element.requestFullscreen === 'function') {
|
|
225
|
+
try {
|
|
226
|
+
await element.requestFullscreen();
|
|
227
|
+
this.#mode = 'fullscreen';
|
|
228
|
+
return this.#mode;
|
|
229
|
+
}
|
|
230
|
+
catch {
|
|
231
|
+
// Rejected — no transient activation, or the UA refused. Fall through to the top-layer
|
|
232
|
+
// popover, which needs neither.
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
if (typeof element.showPopover === 'function') {
|
|
236
|
+
element.setAttribute('popover', 'manual');
|
|
237
|
+
try {
|
|
238
|
+
element.showPopover();
|
|
239
|
+
this.#mode = 'popover';
|
|
240
|
+
return this.#mode;
|
|
241
|
+
}
|
|
242
|
+
catch {
|
|
243
|
+
element.removeAttribute('popover');
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
this.#mode = 'fixed';
|
|
247
|
+
return this.#mode;
|
|
248
|
+
}
|
|
249
|
+
/** Closes the pop-out and returns the element to its place in the document flow. */
|
|
250
|
+
async exit() {
|
|
251
|
+
const element = this.#element;
|
|
252
|
+
const mode = this.#mode;
|
|
253
|
+
this.#element = undefined;
|
|
254
|
+
this.#mode = undefined;
|
|
255
|
+
if (!element || mode === undefined)
|
|
256
|
+
return;
|
|
257
|
+
try {
|
|
258
|
+
if (mode === 'fullscreen') {
|
|
259
|
+
// Leave full screen first: `exitFullscreen()` settles only once the browser's own
|
|
260
|
+
// transition has finished, and the class is what styles the surface until then.
|
|
261
|
+
if (this.#document.fullscreenElement === element)
|
|
262
|
+
await this.#document.exitFullscreen();
|
|
263
|
+
}
|
|
264
|
+
else if (mode === 'popover') {
|
|
265
|
+
element.hidePopover();
|
|
266
|
+
element.removeAttribute('popover');
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
finally {
|
|
270
|
+
element.classList.remove(EDITOR_FULL_SCREEN_CLASS);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
/** Detaches the document listener and closes any open pop-out. Call from `ngOnDestroy`. */
|
|
274
|
+
destroy() {
|
|
275
|
+
this.#document.removeEventListener('fullscreenchange', this.#handleFullScreenChange);
|
|
276
|
+
void this.exit();
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* The browser can close a native full screen behind our back — Escape, F11, or another element
|
|
280
|
+
* taking the top layer. Reconcile our own state and tell the owner so its toggle follows.
|
|
281
|
+
*/
|
|
282
|
+
#handleFullScreenChange = () => {
|
|
283
|
+
if (this.#mode !== 'fullscreen')
|
|
284
|
+
return;
|
|
285
|
+
if (this.#document.fullscreenElement === this.#element)
|
|
286
|
+
return;
|
|
287
|
+
this.#element?.classList.remove(EDITOR_FULL_SCREEN_CLASS);
|
|
288
|
+
this.#element = undefined;
|
|
289
|
+
this.#mode = undefined;
|
|
290
|
+
this.#onExternalExit();
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Floating action button that pops a rich-text editor out to full screen and back.
|
|
296
|
+
*
|
|
297
|
+
* Shared by the Quill and Editor.js inputs so both carry the same affordance, icon and
|
|
298
|
+
* accessible naming. It deliberately owns no state: the editor that hosts it drives {@link active}
|
|
299
|
+
* and performs the promotion (see `editor-full-screen.ts`).
|
|
300
|
+
*
|
|
301
|
+
* Positioning belongs to the host — this component styles only the button. Place it by targeting
|
|
302
|
+
* the element selector from the host's stylesheet.
|
|
303
|
+
*
|
|
304
|
+
* @example
|
|
305
|
+
* <lib-editor-full-screen-toggle [active]="fullScreen()" (toggled)="toggleFullScreen()" />
|
|
306
|
+
*/
|
|
307
|
+
class EditorFullScreenToggleComponent {
|
|
308
|
+
constructor() {
|
|
309
|
+
/** Whether the editor this controls is currently popped out. */
|
|
310
|
+
this.active = input.required(...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
|
|
311
|
+
/** Emitted when the user asks to enter or leave full screen. */
|
|
312
|
+
this.toggled = output();
|
|
313
|
+
/** Serves as both tooltip and accessible name, so the two can never drift apart. */
|
|
314
|
+
this.label = computed(() => (this.active() ? 'Exit full screen' : 'Full screen'), ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
315
|
+
}
|
|
316
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: EditorFullScreenToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
317
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: EditorFullScreenToggleComponent, isStandalone: true, selector: "lib-editor-full-screen-toggle", inputs: { active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { toggled: "toggled" }, host: { classAttribute: "lib-editor-full-screen-toggle" }, ngImport: i0, template: "<button\r\n type=\"button\"\r\n class=\"fab\"\r\n [title]=\"label()\"\r\n [attr.aria-label]=\"label()\"\r\n [attr.aria-pressed]=\"active()\"\r\n (click)=\"toggled.emit()\"\r\n>\r\n @if (active()) {\r\n <svg viewBox=\"0 0 18 18\" aria-hidden=\"true\">\r\n <polyline points=\"3 7 7 7 7 3\"></polyline>\r\n <polyline points=\"11 3 11 7 15 7\"></polyline>\r\n <polyline points=\"15 11 11 11 11 15\"></polyline>\r\n <polyline points=\"7 15 7 11 3 11\"></polyline>\r\n </svg>\r\n } @else {\r\n <svg viewBox=\"0 0 18 18\" aria-hidden=\"true\">\r\n <polyline points=\"7 3 3 3 3 7\"></polyline>\r\n <polyline points=\"11 3 15 3 15 7\"></polyline>\r\n <polyline points=\"15 11 15 15 11 15\"></polyline>\r\n <polyline points=\"3 11 3 15 7 15\"></polyline>\r\n </svg>\r\n }\r\n</button>\r\n", styles: [":host{display:block}.fab{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;padding:0;border:none;border-radius:50%;background-color:var(--mat-sys-surface-container-high, var(--mat-app-surface-container-high));color:var(--mat-sys-on-surface-variant, var(--mat-app-on-surface));box-shadow:0 2px 8px #0000002e;cursor:pointer;transition:background-color .3s cubic-bezier(.16,1,.3,1),color .3s cubic-bezier(.16,1,.3,1),box-shadow .3s cubic-bezier(.16,1,.3,1);pointer-events:auto}.fab:hover,.fab:focus-visible{color:var(--mat-sys-primary, var(--mat-app-primary));background-color:var(--mat-sys-surface-container-highest, var(--mat-app-surface-container-high));box-shadow:0 4px 14px #0000003d}.fab:focus-visible{outline:2px solid var(--mat-sys-primary, var(--mat-app-primary));outline-offset:2px}.fab svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
318
|
+
}
|
|
319
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: EditorFullScreenToggleComponent, decorators: [{
|
|
320
|
+
type: Component,
|
|
321
|
+
args: [{ selector: 'lib-editor-full-screen-toggle', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, host: {
|
|
322
|
+
'class': 'lib-editor-full-screen-toggle'
|
|
323
|
+
}, imports: [], template: "<button\r\n type=\"button\"\r\n class=\"fab\"\r\n [title]=\"label()\"\r\n [attr.aria-label]=\"label()\"\r\n [attr.aria-pressed]=\"active()\"\r\n (click)=\"toggled.emit()\"\r\n>\r\n @if (active()) {\r\n <svg viewBox=\"0 0 18 18\" aria-hidden=\"true\">\r\n <polyline points=\"3 7 7 7 7 3\"></polyline>\r\n <polyline points=\"11 3 11 7 15 7\"></polyline>\r\n <polyline points=\"15 11 11 11 11 15\"></polyline>\r\n <polyline points=\"7 15 7 11 3 11\"></polyline>\r\n </svg>\r\n } @else {\r\n <svg viewBox=\"0 0 18 18\" aria-hidden=\"true\">\r\n <polyline points=\"7 3 3 3 3 7\"></polyline>\r\n <polyline points=\"11 3 15 3 15 7\"></polyline>\r\n <polyline points=\"15 11 15 15 11 15\"></polyline>\r\n <polyline points=\"3 11 3 15 7 15\"></polyline>\r\n </svg>\r\n }\r\n</button>\r\n", styles: [":host{display:block}.fab{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;padding:0;border:none;border-radius:50%;background-color:var(--mat-sys-surface-container-high, var(--mat-app-surface-container-high));color:var(--mat-sys-on-surface-variant, var(--mat-app-on-surface));box-shadow:0 2px 8px #0000002e;cursor:pointer;transition:background-color .3s cubic-bezier(.16,1,.3,1),color .3s cubic-bezier(.16,1,.3,1),box-shadow .3s cubic-bezier(.16,1,.3,1);pointer-events:auto}.fab:hover,.fab:focus-visible{color:var(--mat-sys-primary, var(--mat-app-primary));background-color:var(--mat-sys-surface-container-highest, var(--mat-app-surface-container-high));box-shadow:0 4px 14px #0000003d}.fab:focus-visible{outline:2px solid var(--mat-sys-primary, var(--mat-app-primary));outline-offset:2px}.fab svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}\n"] }]
|
|
324
|
+
}], propDecorators: { active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: true }] }], toggled: [{ type: i0.Output, args: ["toggled"] }] } });
|
|
325
|
+
|
|
326
|
+
var _a;
|
|
327
|
+
const customInputConfig = {
|
|
328
|
+
controlType: 'lib-quill-input',
|
|
329
|
+
nextId: 0
|
|
330
|
+
};
|
|
331
|
+
/**
|
|
332
|
+
* Quill ("snow" theme) rich-text editor wired into Angular Material's form-field as a
|
|
333
|
+
* custom `MatFormFieldControl`. The full Quill setup — toolbar, formats, history — lives in
|
|
334
|
+
* `quill.config.ts`; this component owns lifecycle, SSR gating and value round-tripping.
|
|
335
|
+
*/
|
|
336
|
+
class QuillInputComponent extends BaseCustomInput {
|
|
337
|
+
/**
|
|
338
|
+
* Insertable bindings for the `$`-trigger picker. Empty (the default) leaves the
|
|
339
|
+
* gesture inert, so every existing consumer of this editor is unaffected.
|
|
340
|
+
*
|
|
341
|
+
* Same contract, same menu and same inserted spelling as
|
|
342
|
+
* `TokenTextInputComponent` and the JSON template editors — see
|
|
343
|
+
* `_shared/field-bindings.ts`.
|
|
344
|
+
*/
|
|
345
|
+
set bindings(value) {
|
|
346
|
+
this.#bindings.set(value ?? []);
|
|
347
|
+
}
|
|
348
|
+
get bindings() {
|
|
349
|
+
return this.#bindings();
|
|
350
|
+
}
|
|
351
|
+
#bindings;
|
|
352
|
+
/** Text typed after the `$` that opened the menu. */
|
|
353
|
+
#filter;
|
|
354
|
+
/** Document index of the `$` that opened the menu. */
|
|
355
|
+
#triggerIndex;
|
|
356
|
+
/** Matches `TokenTextInputComponent.FILTER_PATTERN` (dots + hyphens included, for `$ns.key` ids) so the gesture feels identical. */
|
|
357
|
+
static { this.FILTER_PATTERN = /^[a-zA-Z0-9_.\s-]*$/; }
|
|
358
|
+
/** Mirrors the CVA's disabled state into the signal graph so the template can react to it. */
|
|
359
|
+
#controlDisabled;
|
|
360
|
+
#platformId;
|
|
361
|
+
#document;
|
|
362
|
+
#changeHandler;
|
|
363
|
+
/** Bound once so `on`/`off` refer to the same function. */
|
|
364
|
+
#menuSyncHandler;
|
|
365
|
+
#fullScreenHost;
|
|
366
|
+
/** Guards against overlapping pop-out transitions (see `#toggleFullScreen`). */
|
|
367
|
+
#toggling;
|
|
368
|
+
constructor() {
|
|
369
|
+
super(inject(NgControl, { optional: true, self: true }), inject(ElementRef), customInputConfig);
|
|
370
|
+
this.inputConfig = input.required(...(ngDevMode ? [{ debugName: "inputConfig" }] : /* istanbul ignore next */ []));
|
|
371
|
+
this.valueChanged = output();
|
|
372
|
+
this.#bindings = signal([], ...(ngDevMode ? [{ debugName: "#bindings" }] : /* istanbul ignore next */ []));
|
|
373
|
+
/** Whether the `$` menu is open. */
|
|
374
|
+
this.menuOpen = signal(false, ...(ngDevMode ? [{ debugName: "menuOpen" }] : /* istanbul ignore next */ []));
|
|
375
|
+
/** Index of the highlighted option. */
|
|
376
|
+
this.activeIndex = signal(0, ...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
377
|
+
/** Viewport position of the menu, derived from Quill's own caret bounds. */
|
|
378
|
+
this.anchor = signal(null, ...(ngDevMode ? [{ debugName: "anchor" }] : /* istanbul ignore next */ []));
|
|
379
|
+
/** Text typed after the `$` that opened the menu. */
|
|
380
|
+
this.#filter = signal('', ...(ngDevMode ? [{ debugName: "#filter" }] : /* istanbul ignore next */ []));
|
|
381
|
+
/** Document index of the `$` that opened the menu. */
|
|
382
|
+
this.#triggerIndex = -1;
|
|
383
|
+
/** Bindings matching the active filter, capped so the list stays usable. */
|
|
384
|
+
this.filtered = computed(() => {
|
|
385
|
+
const term = this.#filter().trim().toLowerCase();
|
|
386
|
+
const all = this.#bindings();
|
|
387
|
+
if (!term) {
|
|
388
|
+
return all.slice(0, 50);
|
|
389
|
+
}
|
|
390
|
+
return all
|
|
391
|
+
.filter(b => (String(b.searchText ?? "") + " " + b.label).toLowerCase().includes(term))
|
|
392
|
+
.slice(0, 50);
|
|
393
|
+
}, ...(ngDevMode ? [{ debugName: "filtered" }] : /* istanbul ignore next */ []));
|
|
394
|
+
/** Whether the editor is currently popped out to fill the screen. */
|
|
395
|
+
this.fullScreen = signal(false, ...(ngDevMode ? [{ debugName: "fullScreen" }] : /* istanbul ignore next */ []));
|
|
396
|
+
/** Mirrors the CVA's disabled state into the signal graph so the template can react to it. */
|
|
397
|
+
this.#controlDisabled = signal(false, ...(ngDevMode ? [{ debugName: "#controlDisabled" }] : /* istanbul ignore next */ []));
|
|
398
|
+
/**
|
|
399
|
+
* Read-only when either the column config or the reactive-form control says so. Drives both
|
|
400
|
+
* Quill's own editable state and hiding the formatting toolbar, which is dead weight when
|
|
401
|
+
* nothing can be edited.
|
|
402
|
+
*/
|
|
403
|
+
this.readOnly = computed(() => {
|
|
404
|
+
const config = this.inputConfig();
|
|
405
|
+
return this.#controlDisabled() || config.readonly || config.disabled || false;
|
|
406
|
+
}, ...(ngDevMode ? [{ debugName: "readOnly" }] : /* istanbul ignore next */ []));
|
|
407
|
+
/**
|
|
408
|
+
* Height the in-flow wrapper holds onto while the editor is popped out. Set from the editor's
|
|
409
|
+
* measured height on the way in, cleared on the way out.
|
|
410
|
+
*/
|
|
411
|
+
this.reservedHeight = signal(null, ...(ngDevMode ? [{ debugName: "reservedHeight" }] : /* istanbul ignore next */ []));
|
|
412
|
+
this.editorHost = viewChild.required('editorHost');
|
|
413
|
+
/**
|
|
414
|
+
* The bordered surface Quill fills — toolbar included. This is what gets promoted to the
|
|
415
|
+
* browser's top layer. (`viewChild` cannot sit on an ES-private field — NG1053.)
|
|
416
|
+
*/
|
|
417
|
+
this.quillHost = viewChild.required('quillHost');
|
|
418
|
+
this.#platformId = inject(PLATFORM_ID);
|
|
419
|
+
this.#document = inject(DOCUMENT);
|
|
420
|
+
/** Bound once so `on`/`off` refer to the same function. */
|
|
421
|
+
this.#menuSyncHandler = () => this.#syncBindingMenu();
|
|
422
|
+
/** Guards against overlapping pop-out transitions (see `#toggleFullScreen`). */
|
|
423
|
+
this.#toggling = false;
|
|
424
|
+
this._value = undefined;
|
|
425
|
+
/**
|
|
426
|
+
* Navigation and acceptance while the menu is open.
|
|
427
|
+
*
|
|
428
|
+
* Bound in the CAPTURE phase so it runs before Quill's own keyboard module,
|
|
429
|
+
* which otherwise swallows Enter as a newline and the arrows as caret moves.
|
|
430
|
+
*/
|
|
431
|
+
this.#onBindingKeydown = (event) => {
|
|
432
|
+
if (!this.menuOpen()) {
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
const options = this.filtered();
|
|
436
|
+
if (event.key === 'Escape') {
|
|
437
|
+
this.menuOpen.set(false);
|
|
438
|
+
event.stopPropagation();
|
|
439
|
+
event.preventDefault();
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
|
|
443
|
+
if (options.length > 0) {
|
|
444
|
+
const step = event.key === 'ArrowDown' ? 1 : -1;
|
|
445
|
+
this.activeIndex.set((this.activeIndex() + step + options.length) % options.length);
|
|
446
|
+
}
|
|
447
|
+
event.stopPropagation();
|
|
448
|
+
event.preventDefault();
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
if (event.key === 'Enter' || event.key === 'Tab') {
|
|
452
|
+
const chosen = options[this.activeIndex()];
|
|
453
|
+
if (chosen) {
|
|
454
|
+
this.insertBinding(chosen);
|
|
455
|
+
event.stopPropagation();
|
|
456
|
+
event.preventDefault();
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
get empty() {
|
|
462
|
+
const n = this.value;
|
|
463
|
+
return n === null || n === undefined;
|
|
464
|
+
}
|
|
465
|
+
get shouldLabelFloat() {
|
|
466
|
+
return true;
|
|
467
|
+
}
|
|
468
|
+
set value(value) {
|
|
469
|
+
if (!_isEqual(this._value, value)) {
|
|
470
|
+
this._value = value;
|
|
471
|
+
this.onChange(value);
|
|
472
|
+
this.stateChanges.next();
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
get value() {
|
|
476
|
+
return this._value;
|
|
477
|
+
}
|
|
478
|
+
async ngAfterViewInit() {
|
|
479
|
+
if (!isPlatformBrowser(this.#platformId))
|
|
480
|
+
return;
|
|
481
|
+
// Browser-only dynamic load — see the Trap 16 comment at the top of this file. The
|
|
482
|
+
// CSS import injects Quill's global theme styles (Quill's runtime DOM is not view-scoped).
|
|
483
|
+
const [{ default: Quill, Delta }] = await Promise.all([
|
|
484
|
+
import('quill'),
|
|
485
|
+
import('quill/dist/quill.snow.css')
|
|
486
|
+
]);
|
|
487
|
+
this.#fullScreenHost = new EditorFullScreenHost(this.#document, () => this.#setFullScreen(false));
|
|
488
|
+
const config = this.inputConfig();
|
|
489
|
+
this.editor = new Quill(this.editorHost().nativeElement, buildQuillOptions({
|
|
490
|
+
readOnly: this.readOnly(),
|
|
491
|
+
placeholder: config.placeholder
|
|
492
|
+
}));
|
|
493
|
+
const initial = this.value;
|
|
494
|
+
if (initial?.ops?.length) {
|
|
495
|
+
this.editor.setContents(new Delta(initial.ops), 'silent');
|
|
496
|
+
}
|
|
497
|
+
// A `setDisabledState` that arrived before the editor existed is applied here.
|
|
498
|
+
this.#applyReadOnly();
|
|
499
|
+
this.#decorateToolbar();
|
|
500
|
+
this.#changeHandler = () => this.contentChangedSaveValue();
|
|
501
|
+
this.editor.on('text-change', this.#changeHandler);
|
|
502
|
+
// MENU SYNC RIDES editor-change, NOT text-change: editor-change fires for
|
|
503
|
+
// selection moves too and always AFTER the selection is updated, so
|
|
504
|
+
// getSelection() inside the handler is never stale — and the menu also
|
|
505
|
+
// closes when the caret merely moves away from the trigger.
|
|
506
|
+
this.editor.on('editor-change', this.#menuSyncHandler);
|
|
507
|
+
this.editorHost().nativeElement.addEventListener('keydown', this.#onBindingKeydown, true);
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* Quill ships no icons for custom buttons and no tooltips for any button. Inject themeable
|
|
511
|
+
* SVG icons (their `ql-stroke` paths inherit the toolbar colour) and `title` tooltips so the
|
|
512
|
+
* toolbar reads clearly in both light and dark mode.
|
|
513
|
+
*/
|
|
514
|
+
#decorateToolbar() {
|
|
515
|
+
const root = this._elementRef.nativeElement;
|
|
516
|
+
for (const control of QUILL_TABLE_CONTROLS) {
|
|
517
|
+
const button = root.querySelector(`.ql-${control.format}`);
|
|
518
|
+
if (!button)
|
|
519
|
+
continue;
|
|
520
|
+
button.innerHTML = control.icon;
|
|
521
|
+
button.setAttribute('title', control.title);
|
|
522
|
+
}
|
|
523
|
+
for (const [selector, title] of Object.entries(QUILL_BUILTIN_TITLES)) {
|
|
524
|
+
root.querySelectorAll(selector).forEach(el => el.setAttribute('title', title));
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Keeps Quill's own read-only state in step with the control's. The pop-out re-enables pointer
|
|
529
|
+
* events on the popped-out surface (Material kills them field-wide when the control is
|
|
530
|
+
* disabled), so this is what actually keeps a disabled field uneditable — the CSS no longer
|
|
531
|
+
* does it.
|
|
532
|
+
*/
|
|
533
|
+
setDisabledState(isDisabled) {
|
|
534
|
+
super.setDisabledState(isDisabled);
|
|
535
|
+
this.#controlDisabled.set(isDisabled);
|
|
536
|
+
this.#applyReadOnly();
|
|
537
|
+
}
|
|
538
|
+
/** Pushes {@link readOnly} onto the Quill instance, which is not reactive. */
|
|
539
|
+
#applyReadOnly() {
|
|
540
|
+
this.editor?.enable(!this.readOnly());
|
|
541
|
+
}
|
|
542
|
+
/** Toggles the pop-out from the floating button. */
|
|
543
|
+
toggleFullScreen() {
|
|
544
|
+
void this.#toggleFullScreen();
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* Pops the editor out to fill the screen, or restores it. Wired to the toolbar button, so it
|
|
548
|
+
* always runs inside the click gesture the Fullscreen API requires — everything up to the
|
|
549
|
+
* promotion is synchronous for that reason.
|
|
550
|
+
*/
|
|
551
|
+
async #toggleFullScreen() {
|
|
552
|
+
const fullScreenHost = this.#fullScreenHost;
|
|
553
|
+
// Both transitions settle asynchronously; ignore clicks that land mid-flight rather than
|
|
554
|
+
// letting a second `requestFullscreen()` race the first.
|
|
555
|
+
if (!fullScreenHost || this.#toggling)
|
|
556
|
+
return;
|
|
557
|
+
this.#toggling = true;
|
|
558
|
+
// Promotion re-lays the editor out, which drops the caret; put it back afterwards.
|
|
559
|
+
// `getSelection()` without an argument reads the range without stealing focus.
|
|
560
|
+
const selection = this.editor?.getSelection() ?? null;
|
|
561
|
+
try {
|
|
562
|
+
if (this.fullScreen()) {
|
|
563
|
+
await fullScreenHost.exit();
|
|
564
|
+
}
|
|
565
|
+
else {
|
|
566
|
+
const element = this.quillHost().nativeElement;
|
|
567
|
+
this.reservedHeight.set(element.offsetHeight);
|
|
568
|
+
await fullScreenHost.enter(element);
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
finally {
|
|
572
|
+
// `enter()` degrades rather than throwing, but `exit()` can reject if the browser refuses
|
|
573
|
+
// to leave full screen. Either way the controller has already settled its own state, so
|
|
574
|
+
// read it back instead of assuming the toggle succeeded.
|
|
575
|
+
this.#setFullScreen(fullScreenHost.active);
|
|
576
|
+
this.#restoreSelection(selection);
|
|
577
|
+
this.#toggling = false;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Escape leaves the pop-out. Native full screen is torn down by the browser itself (picked up
|
|
582
|
+
* through `fullscreenchange`); this covers the popover and fixed fallbacks. The event is
|
|
583
|
+
* stopped so Escape closes the editor rather than an enclosing dialog.
|
|
584
|
+
*/
|
|
585
|
+
onEscape(event) {
|
|
586
|
+
if (!this.fullScreen())
|
|
587
|
+
return;
|
|
588
|
+
event.preventDefault();
|
|
589
|
+
event.stopPropagation();
|
|
590
|
+
void this.#toggleFullScreen();
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* Single funnel for pop-out state, so the signal and the reserved space always agree —
|
|
594
|
+
* including when the browser closed full screen on its own.
|
|
595
|
+
*/
|
|
596
|
+
#setFullScreen(active) {
|
|
597
|
+
this.fullScreen.set(active);
|
|
598
|
+
if (!active)
|
|
599
|
+
this.reservedHeight.set(null);
|
|
600
|
+
}
|
|
601
|
+
/** Returns the caret to where it was before the pop-out re-laid the editor out. */
|
|
602
|
+
#restoreSelection(selection) {
|
|
603
|
+
const editor = this.editor;
|
|
604
|
+
if (!editor)
|
|
605
|
+
return;
|
|
606
|
+
if (selection)
|
|
607
|
+
editor.setSelection(selection, 'silent');
|
|
608
|
+
else
|
|
609
|
+
editor.focus();
|
|
610
|
+
}
|
|
611
|
+
contentChangedSaveValue() {
|
|
612
|
+
if (!this.editor)
|
|
613
|
+
return;
|
|
614
|
+
const ops = this.editor.getContents().ops;
|
|
615
|
+
const value = isEmptyQuillDocument(ops) ? undefined : { ops };
|
|
616
|
+
this.value = value;
|
|
617
|
+
this.onChange(value);
|
|
618
|
+
this.valueChanged.emit(value);
|
|
619
|
+
}
|
|
620
|
+
ngOnDestroy() {
|
|
621
|
+
this.editorHost()?.nativeElement?.removeEventListener('keydown', this.#onBindingKeydown, true);
|
|
622
|
+
this.#fullScreenHost?.destroy();
|
|
623
|
+
this.#fullScreenHost = undefined;
|
|
624
|
+
if (this.editor && this.#changeHandler) {
|
|
625
|
+
this.editor.off('text-change', this.#changeHandler);
|
|
626
|
+
this.editor.off('editor-change', this.#menuSyncHandler);
|
|
627
|
+
}
|
|
628
|
+
this.editor = undefined;
|
|
629
|
+
// Tear the editor down first, then let the base complete `stateChanges` / `destroy$` and
|
|
630
|
+
// clear the temporary-error timer — none of which happened while this override skipped it.
|
|
631
|
+
super.ngOnDestroy();
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* Re-evaluates the `$` menu against the caret. Runs on every editor-change.
|
|
635
|
+
*
|
|
636
|
+
* Quill addresses positions as an index into the document rather than a
|
|
637
|
+
* `selectionStart` on a string, so the caret maths is Quill-specific even
|
|
638
|
+
* though the menu it drives is the shared one.
|
|
639
|
+
*/
|
|
640
|
+
#syncBindingMenu() {
|
|
641
|
+
const editor = this.editor;
|
|
642
|
+
if (!editor || this.readOnly() || this.#bindings().length === 0) {
|
|
643
|
+
this.menuOpen.set(false);
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
646
|
+
const selection = editor.getSelection();
|
|
647
|
+
if (!selection) {
|
|
648
|
+
this.menuOpen.set(false);
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
651
|
+
const caret = selection.index;
|
|
652
|
+
const before = editor.getText(0, caret);
|
|
653
|
+
const dollar = before.lastIndexOf('$');
|
|
654
|
+
if (dollar < 0) {
|
|
655
|
+
this.menuOpen.set(false);
|
|
656
|
+
return;
|
|
657
|
+
}
|
|
658
|
+
const term = before.slice(dollar + 1);
|
|
659
|
+
if (!_a.FILTER_PATTERN.test(term)) {
|
|
660
|
+
this.menuOpen.set(false);
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
// `getBounds` is relative to the editor container; add its viewport offset.
|
|
664
|
+
const bounds = editor.getBounds(caret);
|
|
665
|
+
const host = this.editorHost().nativeElement.getBoundingClientRect();
|
|
666
|
+
this.anchor.set({
|
|
667
|
+
top: host.top + (bounds?.bottom ?? 0) + 6,
|
|
668
|
+
left: host.left + (bounds?.left ?? 0),
|
|
669
|
+
width: 260,
|
|
670
|
+
});
|
|
671
|
+
this.#triggerIndex = dollar;
|
|
672
|
+
this.#filter.set(term);
|
|
673
|
+
this.activeIndex.set(0);
|
|
674
|
+
this.menuOpen.set(true);
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Replaces the `$filter` run with the binding token.
|
|
678
|
+
*
|
|
679
|
+
* Inserted as TEXT, which the email compiler promotes to a real token span
|
|
680
|
+
* (`quillToEmailHtml` 's `promoteTextTokens`). An atomic embed blot — which
|
|
681
|
+
* would stop an author splitting a token by formatting half of it — is the
|
|
682
|
+
* next step and does not change this call site.
|
|
683
|
+
*/
|
|
684
|
+
insertBinding(binding) {
|
|
685
|
+
const editor = this.editor;
|
|
686
|
+
if (!editor || this.#triggerIndex < 0) {
|
|
687
|
+
this.menuOpen.set(false);
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
690
|
+
const selection = editor.getSelection();
|
|
691
|
+
const caret = selection?.index ?? this.#triggerIndex;
|
|
692
|
+
const length = Math.max(0, caret - this.#triggerIndex);
|
|
693
|
+
editor.deleteText(this.#triggerIndex, length, 'user');
|
|
694
|
+
editor.insertText(this.#triggerIndex, binding.insert, 'user');
|
|
695
|
+
editor.setSelection(this.#triggerIndex + binding.insert.length, 0, 'user');
|
|
696
|
+
this.menuOpen.set(false);
|
|
697
|
+
this.#filter.set('');
|
|
698
|
+
this.#triggerIndex = -1;
|
|
699
|
+
this.contentChangedSaveValue();
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* Navigation and acceptance while the menu is open.
|
|
703
|
+
*
|
|
704
|
+
* Bound in the CAPTURE phase so it runs before Quill's own keyboard module,
|
|
705
|
+
* which otherwise swallows Enter as a newline and the arrows as caret moves.
|
|
706
|
+
*/
|
|
707
|
+
#onBindingKeydown;
|
|
708
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: QuillInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
709
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: QuillInputComponent, isStandalone: true, selector: "lib-quill-input", inputs: { inputConfig: { classPropertyName: "inputConfig", publicName: "inputConfig", isSignal: true, isRequired: true, transformFunction: null }, bindings: { classPropertyName: "bindings", publicName: "bindings", isSignal: false, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { valueChanged: "valueChanged" }, host: { listeners: { "keydown.escape": "onEscape($event)" }, properties: { "class.floating": "shouldLabelFloat", "id": "id" } }, providers: [{ provide: MatFormFieldControl, useExisting: QuillInputComponent }], viewQueries: [{ propertyName: "editorHost", first: true, predicate: ["editorHost"], descendants: true, isSignal: true }, { propertyName: "quillHost", first: true, predicate: ["quillHost"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "\r\n<!-- `.quill-shell` stays in the document flow and holds the editor's footprint while\r\n `.quill-host` is promoted to the browser's top layer for full screen. Without it the\r\n surrounding form-field collapses by the editor's height, and the page scroll position\r\n jumps when full screen is left. -->\r\n<div class=\"quill-shell\" [style.height.px]=\"reservedHeight()\">\r\n <div class=\"quill-host\" #quillHost [class.is-readonly]=\"readOnly()\">\r\n <div #editorHost></div>\r\n\r\n <!-- Floats over the editing surface rather than living in the toolbar, so it survives the\r\n toolbar being hidden in read-only mode. -->\r\n <lib-editor-full-screen-toggle\r\n [active]=\"fullScreen()\"\r\n (toggled)=\"toggleFullScreen()\"\r\n ></lib-editor-full-screen-toggle>\r\n </div>\r\n</div>\n\n@if (menuOpen()) {\n <lib-token-binding-menu\n [options]=\"filtered()\"\n [activeIndex]=\"activeIndex()\"\n [anchor]=\"anchor()\"\n (pick)=\"insertBinding($event)\" />\n}\n", styles: [".quill-host{position:relative;border:solid 1px var(--mat-sys-outline-variant, var(--mat-app-outline));border-radius:6px;background:var(--mat-sys-surface-container-low, var(--mat-app-surface-container-low))}.quill-host>lib-editor-full-screen-toggle{position:absolute;right:16px;bottom:16px;z-index:2}.quill-host.is-readonly ::ng-deep .ql-toolbar.ql-snow{display:none}.quill-host.is-readonly ::ng-deep .ql-container.ql-snow{border-radius:6px}.quill-host ::ng-deep .ql-toolbar.ql-snow{border:none;border-bottom:solid 1px var(--mat-sys-outline-variant, var(--mat-app-outline));background:var(--mat-sys-surface-container, var(--mat-app-surface-container));padding:8px 10px;border-radius:6px 6px 0 0}.quill-host ::ng-deep .ql-container.ql-snow{border:none;border-radius:0 0 6px 6px;font-family:var(--mat-sys-body-large-font, inherit)}.quill-host ::ng-deep .ql-toolbar.ql-snow .ql-formats{margin-right:10px;padding-right:10px;border-right:1px solid var(--mat-sys-outline-variant, var(--mat-app-outline))}.quill-host ::ng-deep .ql-toolbar.ql-snow .ql-formats:last-child{border-right:none;padding-right:0}.quill-host ::ng-deep .ql-snow .ql-stroke,.quill-host ::ng-deep .ql-snow .ql-stroke-miter{stroke:var(--mat-sys-on-surface-variant, var(--mat-app-on-surface))}.quill-host ::ng-deep .ql-snow .ql-fill,.quill-host ::ng-deep .ql-snow .ql-stroke.ql-fill{fill:var(--mat-sys-on-surface-variant, var(--mat-app-on-surface))}.quill-host ::ng-deep .ql-snow .ql-picker{color:var(--mat-sys-on-surface-variant, var(--mat-app-on-surface))}.quill-host ::ng-deep .ql-toolbar.ql-snow button,.quill-host ::ng-deep .ql-toolbar.ql-snow .ql-picker-label{border-radius:4px;transition:background-color .3s cubic-bezier(.16,1,.3,1)}.quill-host ::ng-deep .ql-toolbar.ql-snow button:hover,.quill-host ::ng-deep .ql-toolbar.ql-snow button:focus,.quill-host ::ng-deep .ql-toolbar.ql-snow .ql-picker-label:hover{background-color:var(--mat-sys-surface-container-highest, var(--mat-app-surface-container-high))}.quill-host ::ng-deep .ql-snow.ql-toolbar button.ql-active,.quill-host ::ng-deep .ql-snow .ql-picker-label.ql-active,.quill-host ::ng-deep .ql-snow .ql-picker-item.ql-selected,.quill-host ::ng-deep .ql-snow.ql-toolbar button:hover,.quill-host ::ng-deep .ql-snow .ql-picker-item:hover{color:var(--mat-sys-primary, var(--mat-app-primary))}.quill-host ::ng-deep .ql-snow.ql-toolbar button:hover .ql-stroke,.quill-host ::ng-deep .ql-snow.ql-toolbar button:focus .ql-stroke,.quill-host ::ng-deep .ql-snow.ql-toolbar button.ql-active .ql-stroke,.quill-host ::ng-deep .ql-snow .ql-picker-label:hover .ql-stroke,.quill-host ::ng-deep .ql-snow .ql-picker-label.ql-active .ql-stroke,.quill-host ::ng-deep .ql-snow .ql-picker-item:hover .ql-stroke,.quill-host ::ng-deep .ql-snow .ql-picker-item.ql-selected .ql-stroke{stroke:var(--mat-sys-primary, var(--mat-app-primary))}.quill-host ::ng-deep .ql-snow.ql-toolbar button:hover .ql-fill,.quill-host ::ng-deep .ql-snow.ql-toolbar button.ql-active .ql-fill,.quill-host ::ng-deep .ql-snow .ql-picker-label:hover .ql-fill,.quill-host ::ng-deep .ql-snow .ql-picker-label.ql-active .ql-fill{fill:var(--mat-sys-primary, var(--mat-app-primary))}.quill-host ::ng-deep .ql-snow .ql-picker-options{background-color:var(--mat-sys-surface-container-high, var(--mat-app-surface-container-high));border-color:var(--mat-sys-outline-variant, var(--mat-app-outline));border-radius:6px;box-shadow:0 4px 12px #0000002e;color:var(--mat-sys-on-surface, var(--mat-app-on-surface))}.quill-host ::ng-deep .ql-snow .ql-picker.ql-expanded .ql-picker-label{border-color:var(--mat-sys-outline-variant, var(--mat-app-outline));color:var(--mat-sys-primary, var(--mat-app-primary))}.quill-host ::ng-deep .ql-editor{min-height:300px;font-size:.9375rem;line-height:1.7;color:var(--mat-sys-on-surface, var(--mat-app-on-surface))}.quill-host ::ng-deep .ql-editor.ql-blank:before{color:var(--mat-sys-on-surface-variant, var(--mat-app-on-surface));font-style:normal;opacity:.7}.quill-host ::ng-deep .ql-editor a{color:var(--mat-sys-primary, var(--mat-app-primary))}.quill-host ::ng-deep .ql-editor blockquote{border-left-color:var(--mat-sys-outline, var(--mat-app-outline));color:var(--mat-sys-on-surface-variant, var(--mat-app-on-surface))}.quill-host ::ng-deep .ql-editor pre.ql-syntax,.quill-host ::ng-deep .ql-editor code{background-color:var(--mat-sys-surface-container-highest, var(--mat-app-surface-container-high));color:var(--mat-sys-on-surface, var(--mat-app-on-surface));border-radius:4px}.quill-host ::ng-deep .ql-editor table{border-collapse:collapse}.quill-host ::ng-deep .ql-editor td{border:1px solid var(--mat-sys-outline-variant, var(--mat-app-outline));padding:6px 10px}.quill-host ::ng-deep .ql-snow .ql-tooltip{background-color:var(--mat-sys-surface-container-high, var(--mat-app-surface-container-high));border-color:var(--mat-sys-outline-variant, var(--mat-app-outline));border-radius:6px;box-shadow:0 4px 12px #0000002e;color:var(--mat-sys-on-surface, var(--mat-app-on-surface))}.quill-host ::ng-deep .ql-snow .ql-tooltip input[type=text]{background-color:var(--mat-sys-surface-container-low, var(--mat-app-surface-container-low));border-color:var(--mat-sys-outline-variant, var(--mat-app-outline));color:var(--mat-sys-on-surface, var(--mat-app-on-surface));border-radius:4px}.quill-host ::ng-deep .ql-snow .ql-tooltip a.ql-action,.quill-host ::ng-deep .ql-snow .ql-tooltip a.ql-preview{color:var(--mat-sys-primary, var(--mat-app-primary))}.quill-host ::ng-deep .ql-snow .ql-tooltip a.ql-remove{color:var(--mat-sys-error, var(--mat-app-error))}.quill-host.is-fullscreen{position:fixed;inset:0;z-index:1200;display:flex;flex-direction:column;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:none;border-radius:0;background:var(--mat-sys-surface, var(--mat-app-surface));overflow:visible;pointer-events:auto;animation:quill-full-screen-enter .4s cubic-bezier(.16,1,.3,1)}.quill-host.is-fullscreen::backdrop{background-color:var(--mat-sys-surface, var(--mat-app-surface))}.quill-host.is-fullscreen ::ng-deep .ql-toolbar.ql-snow{flex:0 0 auto;border-radius:0;padding:12px 16px}.quill-host.is-fullscreen ::ng-deep .ql-container.ql-snow{flex:1 1 auto;min-height:0;border-radius:0}.quill-host.is-fullscreen ::ng-deep .ql-editor{padding:2.5rem max(2rem,calc((100% - var(--lib-forms-editor-page-width, 210mm)) / 2))}.quill-host.is-fullscreen>lib-editor-full-screen-toggle{right:2rem;bottom:2rem}@keyframes quill-full-screen-enter{0%{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){.quill-host.is-fullscreen{animation:none}}\n"], dependencies: [{ kind: "component", type: EditorFullScreenToggleComponent, selector: "lib-editor-full-screen-toggle", inputs: ["active"], outputs: ["toggled"] }, { kind: "component", type: TokenBindingMenuComponent, selector: "lib-token-binding-menu", inputs: ["options", "activeIndex", "anchor"], outputs: ["pick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
710
|
+
}
|
|
711
|
+
_a = QuillInputComponent;
|
|
712
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: QuillInputComponent, decorators: [{
|
|
713
|
+
type: Component,
|
|
714
|
+
args: [{ selector: 'lib-quill-input', imports: [EditorFullScreenToggleComponent, TokenBindingMenuComponent], host: {
|
|
715
|
+
'[class.floating]': 'shouldLabelFloat',
|
|
716
|
+
'[id]': 'id',
|
|
717
|
+
'(keydown.escape)': 'onEscape($event)'
|
|
718
|
+
}, providers: [{ provide: MatFormFieldControl, useExisting: QuillInputComponent }], changeDetection: ChangeDetectionStrategy.OnPush, template: "\r\n<!-- `.quill-shell` stays in the document flow and holds the editor's footprint while\r\n `.quill-host` is promoted to the browser's top layer for full screen. Without it the\r\n surrounding form-field collapses by the editor's height, and the page scroll position\r\n jumps when full screen is left. -->\r\n<div class=\"quill-shell\" [style.height.px]=\"reservedHeight()\">\r\n <div class=\"quill-host\" #quillHost [class.is-readonly]=\"readOnly()\">\r\n <div #editorHost></div>\r\n\r\n <!-- Floats over the editing surface rather than living in the toolbar, so it survives the\r\n toolbar being hidden in read-only mode. -->\r\n <lib-editor-full-screen-toggle\r\n [active]=\"fullScreen()\"\r\n (toggled)=\"toggleFullScreen()\"\r\n ></lib-editor-full-screen-toggle>\r\n </div>\r\n</div>\n\n@if (menuOpen()) {\n <lib-token-binding-menu\n [options]=\"filtered()\"\n [activeIndex]=\"activeIndex()\"\n [anchor]=\"anchor()\"\n (pick)=\"insertBinding($event)\" />\n}\n", styles: [".quill-host{position:relative;border:solid 1px var(--mat-sys-outline-variant, var(--mat-app-outline));border-radius:6px;background:var(--mat-sys-surface-container-low, var(--mat-app-surface-container-low))}.quill-host>lib-editor-full-screen-toggle{position:absolute;right:16px;bottom:16px;z-index:2}.quill-host.is-readonly ::ng-deep .ql-toolbar.ql-snow{display:none}.quill-host.is-readonly ::ng-deep .ql-container.ql-snow{border-radius:6px}.quill-host ::ng-deep .ql-toolbar.ql-snow{border:none;border-bottom:solid 1px var(--mat-sys-outline-variant, var(--mat-app-outline));background:var(--mat-sys-surface-container, var(--mat-app-surface-container));padding:8px 10px;border-radius:6px 6px 0 0}.quill-host ::ng-deep .ql-container.ql-snow{border:none;border-radius:0 0 6px 6px;font-family:var(--mat-sys-body-large-font, inherit)}.quill-host ::ng-deep .ql-toolbar.ql-snow .ql-formats{margin-right:10px;padding-right:10px;border-right:1px solid var(--mat-sys-outline-variant, var(--mat-app-outline))}.quill-host ::ng-deep .ql-toolbar.ql-snow .ql-formats:last-child{border-right:none;padding-right:0}.quill-host ::ng-deep .ql-snow .ql-stroke,.quill-host ::ng-deep .ql-snow .ql-stroke-miter{stroke:var(--mat-sys-on-surface-variant, var(--mat-app-on-surface))}.quill-host ::ng-deep .ql-snow .ql-fill,.quill-host ::ng-deep .ql-snow .ql-stroke.ql-fill{fill:var(--mat-sys-on-surface-variant, var(--mat-app-on-surface))}.quill-host ::ng-deep .ql-snow .ql-picker{color:var(--mat-sys-on-surface-variant, var(--mat-app-on-surface))}.quill-host ::ng-deep .ql-toolbar.ql-snow button,.quill-host ::ng-deep .ql-toolbar.ql-snow .ql-picker-label{border-radius:4px;transition:background-color .3s cubic-bezier(.16,1,.3,1)}.quill-host ::ng-deep .ql-toolbar.ql-snow button:hover,.quill-host ::ng-deep .ql-toolbar.ql-snow button:focus,.quill-host ::ng-deep .ql-toolbar.ql-snow .ql-picker-label:hover{background-color:var(--mat-sys-surface-container-highest, var(--mat-app-surface-container-high))}.quill-host ::ng-deep .ql-snow.ql-toolbar button.ql-active,.quill-host ::ng-deep .ql-snow .ql-picker-label.ql-active,.quill-host ::ng-deep .ql-snow .ql-picker-item.ql-selected,.quill-host ::ng-deep .ql-snow.ql-toolbar button:hover,.quill-host ::ng-deep .ql-snow .ql-picker-item:hover{color:var(--mat-sys-primary, var(--mat-app-primary))}.quill-host ::ng-deep .ql-snow.ql-toolbar button:hover .ql-stroke,.quill-host ::ng-deep .ql-snow.ql-toolbar button:focus .ql-stroke,.quill-host ::ng-deep .ql-snow.ql-toolbar button.ql-active .ql-stroke,.quill-host ::ng-deep .ql-snow .ql-picker-label:hover .ql-stroke,.quill-host ::ng-deep .ql-snow .ql-picker-label.ql-active .ql-stroke,.quill-host ::ng-deep .ql-snow .ql-picker-item:hover .ql-stroke,.quill-host ::ng-deep .ql-snow .ql-picker-item.ql-selected .ql-stroke{stroke:var(--mat-sys-primary, var(--mat-app-primary))}.quill-host ::ng-deep .ql-snow.ql-toolbar button:hover .ql-fill,.quill-host ::ng-deep .ql-snow.ql-toolbar button.ql-active .ql-fill,.quill-host ::ng-deep .ql-snow .ql-picker-label:hover .ql-fill,.quill-host ::ng-deep .ql-snow .ql-picker-label.ql-active .ql-fill{fill:var(--mat-sys-primary, var(--mat-app-primary))}.quill-host ::ng-deep .ql-snow .ql-picker-options{background-color:var(--mat-sys-surface-container-high, var(--mat-app-surface-container-high));border-color:var(--mat-sys-outline-variant, var(--mat-app-outline));border-radius:6px;box-shadow:0 4px 12px #0000002e;color:var(--mat-sys-on-surface, var(--mat-app-on-surface))}.quill-host ::ng-deep .ql-snow .ql-picker.ql-expanded .ql-picker-label{border-color:var(--mat-sys-outline-variant, var(--mat-app-outline));color:var(--mat-sys-primary, var(--mat-app-primary))}.quill-host ::ng-deep .ql-editor{min-height:300px;font-size:.9375rem;line-height:1.7;color:var(--mat-sys-on-surface, var(--mat-app-on-surface))}.quill-host ::ng-deep .ql-editor.ql-blank:before{color:var(--mat-sys-on-surface-variant, var(--mat-app-on-surface));font-style:normal;opacity:.7}.quill-host ::ng-deep .ql-editor a{color:var(--mat-sys-primary, var(--mat-app-primary))}.quill-host ::ng-deep .ql-editor blockquote{border-left-color:var(--mat-sys-outline, var(--mat-app-outline));color:var(--mat-sys-on-surface-variant, var(--mat-app-on-surface))}.quill-host ::ng-deep .ql-editor pre.ql-syntax,.quill-host ::ng-deep .ql-editor code{background-color:var(--mat-sys-surface-container-highest, var(--mat-app-surface-container-high));color:var(--mat-sys-on-surface, var(--mat-app-on-surface));border-radius:4px}.quill-host ::ng-deep .ql-editor table{border-collapse:collapse}.quill-host ::ng-deep .ql-editor td{border:1px solid var(--mat-sys-outline-variant, var(--mat-app-outline));padding:6px 10px}.quill-host ::ng-deep .ql-snow .ql-tooltip{background-color:var(--mat-sys-surface-container-high, var(--mat-app-surface-container-high));border-color:var(--mat-sys-outline-variant, var(--mat-app-outline));border-radius:6px;box-shadow:0 4px 12px #0000002e;color:var(--mat-sys-on-surface, var(--mat-app-on-surface))}.quill-host ::ng-deep .ql-snow .ql-tooltip input[type=text]{background-color:var(--mat-sys-surface-container-low, var(--mat-app-surface-container-low));border-color:var(--mat-sys-outline-variant, var(--mat-app-outline));color:var(--mat-sys-on-surface, var(--mat-app-on-surface));border-radius:4px}.quill-host ::ng-deep .ql-snow .ql-tooltip a.ql-action,.quill-host ::ng-deep .ql-snow .ql-tooltip a.ql-preview{color:var(--mat-sys-primary, var(--mat-app-primary))}.quill-host ::ng-deep .ql-snow .ql-tooltip a.ql-remove{color:var(--mat-sys-error, var(--mat-app-error))}.quill-host.is-fullscreen{position:fixed;inset:0;z-index:1200;display:flex;flex-direction:column;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:none;border-radius:0;background:var(--mat-sys-surface, var(--mat-app-surface));overflow:visible;pointer-events:auto;animation:quill-full-screen-enter .4s cubic-bezier(.16,1,.3,1)}.quill-host.is-fullscreen::backdrop{background-color:var(--mat-sys-surface, var(--mat-app-surface))}.quill-host.is-fullscreen ::ng-deep .ql-toolbar.ql-snow{flex:0 0 auto;border-radius:0;padding:12px 16px}.quill-host.is-fullscreen ::ng-deep .ql-container.ql-snow{flex:1 1 auto;min-height:0;border-radius:0}.quill-host.is-fullscreen ::ng-deep .ql-editor{padding:2.5rem max(2rem,calc((100% - var(--lib-forms-editor-page-width, 210mm)) / 2))}.quill-host.is-fullscreen>lib-editor-full-screen-toggle{right:2rem;bottom:2rem}@keyframes quill-full-screen-enter{0%{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){.quill-host.is-fullscreen{animation:none}}\n"] }]
|
|
719
|
+
}], ctorParameters: () => [], propDecorators: { inputConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputConfig", required: true }] }], valueChanged: [{ type: i0.Output, args: ["valueChanged"] }], bindings: [{
|
|
720
|
+
type: Input
|
|
721
|
+
}], editorHost: [{ type: i0.ViewChild, args: ['editorHost', { isSignal: true }] }], quillHost: [{ type: i0.ViewChild, args: ['quillHost', { isSignal: true }] }], value: [{
|
|
722
|
+
type: Input
|
|
723
|
+
}] } });
|
|
724
|
+
|
|
725
|
+
var quillInput_component = /*#__PURE__*/Object.freeze({
|
|
726
|
+
__proto__: null,
|
|
727
|
+
QuillInputComponent: QuillInputComponent
|
|
728
|
+
});
|
|
729
|
+
|
|
730
|
+
export { EditorFullScreenHost as E, QuillInputComponent as Q, EditorFullScreenToggleComponent as a, quillInput_component as q };
|
|
731
|
+
//# sourceMappingURL=ngx-t-forms-quill-input.component-BsuOKfZT.mjs.map
|