ngx-t-forms 3.1.6 → 3.1.8
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-Di79aHfa.mjs → ngx-t-forms-api-endpoint-config.component-B4a-L4Eq.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-api-endpoint-config.component-Di79aHfa.mjs.map → ngx-t-forms-api-endpoint-config.component-B4a-L4Eq.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-DJ84laIO.mjs → ngx-t-forms-auto-complete-input-element.component-DqRunUz4.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-DJ84laIO.mjs.map → ngx-t-forms-auto-complete-input-element.component-DqRunUz4.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-basic-input-input-element.component-1wixvEKK.mjs → ngx-t-forms-basic-input-input-element.component-t8bTUgZ1.mjs} +14 -6
- package/fesm2022/ngx-t-forms-basic-input-input-element.component-t8bTUgZ1.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-PcjMdAKu.mjs +603 -0
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-PcjMdAKu.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-D2LhKaem.mjs → ngx-t-forms-chip-options-creator-editor.component-Ca4rim_J.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-D2LhKaem.mjs.map → ngx-t-forms-chip-options-creator-editor.component-Ca4rim_J.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-conditional-display-config.component-DSyIhkWf.mjs → ngx-t-forms-conditional-display-config.component-Di7p76_n.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-conditional-display-config.component-DSyIhkWf.mjs.map → ngx-t-forms-conditional-display-config.component-Di7p76_n.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-DSUAcg8R.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-CXMmDwKS.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-DSUAcg8R.mjs.map → ngx-t-forms-config-mscoa-additional-inputs.component-CXMmDwKS.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-data-source-picker.component-h_e5wDIJ.mjs → ngx-t-forms-data-source-picker.component-DioXvLi3.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-data-source-picker.component-h_e5wDIJ.mjs.map → ngx-t-forms-data-source-picker.component-DioXvLi3.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-date-picker-input-element.component-BPoqT0as.mjs → ngx-t-forms-date-picker-input-element.component-h0S6qZDT.mjs} +6 -6
- package/fesm2022/ngx-t-forms-date-picker-input-element.component-h0S6qZDT.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-date-range-picker-input-element.component-DLeCZF3n.mjs → ngx-t-forms-date-range-picker-input-element.component-8c1ErbgP.mjs} +6 -6
- package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-8c1ErbgP.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-date-time-picker-input-element.component-D2kj-knT.mjs → ngx-t-forms-date-time-picker-input-element.component-BgjGlXeq.mjs} +7 -6
- package/fesm2022/ngx-t-forms-date-time-picker-input-element.component-BgjGlXeq.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-document-list-label-config-editor.component-BvQoKyeP.mjs → ngx-t-forms-document-list-label-config-editor.component-BhVM8PFR.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-document-list-label-config-editor.component-BvQoKyeP.mjs.map → ngx-t-forms-document-list-label-config-editor.component-BhVM8PFR.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-document-picker.component-D0hW0jUu.mjs → ngx-t-forms-document-picker.component-DYpsBHxT.mjs} +6 -254
- package/fesm2022/ngx-t-forms-document-picker.component-DYpsBHxT.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-editor-input-element.component-DlIfYjsU.mjs → ngx-t-forms-editor-input-element.component-CzNSb79n.mjs} +5 -5
- package/fesm2022/{ngx-t-forms-editor-input-element.component-DlIfYjsU.mjs.map → ngx-t-forms-editor-input-element.component-CzNSb79n.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-file-upload-input-element.component-Dv21OQ8v.mjs → ngx-t-forms-file-upload-input-element.component-FPxHxAwF.mjs} +7 -7
- package/fesm2022/{ngx-t-forms-file-upload-input-element.component-Dv21OQ8v.mjs.map → ngx-t-forms-file-upload-input-element.component-FPxHxAwF.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-input-selector.component-HjtfeAew.mjs → ngx-t-forms-form-input-selector.component-B3ES53R-.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-form-input-selector.component-HjtfeAew.mjs.map → ngx-t-forms-form-input-selector.component-B3ES53R-.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-json-view.component-XsTfLIOP.mjs → ngx-t-forms-form-json-view.component-Cu_ZEw1V.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-form-json-view.component-XsTfLIOP.mjs.map → ngx-t-forms-form-json-view.component-Cu_ZEw1V.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-DF3-s7Ou.mjs → ngx-t-forms-form-section-stepper.component-DmTGnRgi.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-DF3-s7Ou.mjs.map → ngx-t-forms-form-section-stepper.component-DmTGnRgi.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-D_As34Ib.mjs → ngx-t-forms-forms-builder-menu.component-6m2BM9e9.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-D_As34Ib.mjs.map → ngx-t-forms-forms-builder-menu.component-6m2BM9e9.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-forms-native-date-adapter-CCJT5ep1.mjs +187 -0
- package/fesm2022/ngx-t-forms-forms-native-date-adapter-CCJT5ep1.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-geo-location.component-BGg8uGQV.mjs → ngx-t-forms-geo-location.component-DgXSaH0t.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-geo-location.component-BGg8uGQV.mjs.map → ngx-t-forms-geo-location.component-DgXSaH0t.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-header-template-editor.component-D78_YC80.mjs → ngx-t-forms-header-template-editor.component-NJLm6jkA.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-header-template-editor.component-D78_YC80.mjs.map → ngx-t-forms-header-template-editor.component-NJLm6jkA.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-image-capture-input-element.component-B2ldh1-n.mjs → ngx-t-forms-image-capture-input-element.component-iqPS9cPK.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-image-capture-input-element.component-B2ldh1-n.mjs.map → ngx-t-forms-image-capture-input-element.component-iqPS9cPK.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-index-zLon09cE.mjs +2 -0
- package/fesm2022/ngx-t-forms-index-zLon09cE.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-input-custom.component-BrZ59sIz.mjs → ngx-t-forms-input-custom.component-BOy_3JqU.mjs} +78 -23
- package/fesm2022/ngx-t-forms-input-custom.component-BOy_3JqU.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-input-editor.component-B5eMJWrz.mjs → ngx-t-forms-input-editor.component-IUrZNmA5.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-input-editor.component-B5eMJWrz.mjs.map → ngx-t-forms-input-editor.component-IUrZNmA5.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-map-mat-options-keys-BOX1dYlB.mjs → ngx-t-forms-map-mat-options-keys-CtTAw9jk.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-map-mat-options-keys-BOX1dYlB.mjs.map → ngx-t-forms-map-mat-options-keys-CtTAw9jk.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-lv4MlFT8.mjs → ngx-t-forms-mat-chip-list-editor.component-C9bxVpQ1.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-lv4MlFT8.mjs.map → ngx-t-forms-mat-chip-list-editor.component-C9bxVpQ1.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-DV55dGC2.mjs → ngx-t-forms-missing-form-configs.component-BpiCchqY.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-DV55dGC2.mjs.map → ngx-t-forms-missing-form-configs.component-BpiCchqY.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-chart-toolbar.component-C9hD1Cnq.mjs → ngx-t-forms-mscoa-chart-toolbar.component-CjUf0zTA.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mscoa-chart-toolbar.component-C9hD1Cnq.mjs.map → ngx-t-forms-mscoa-chart-toolbar.component-CjUf0zTA.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-config.component-BqgTVHRS.mjs → ngx-t-forms-mscoa-config.component-soUwIbVA.mjs} +15 -10
- package/fesm2022/ngx-t-forms-mscoa-config.component-soUwIbVA.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component--3DvQm1K.mjs +520 -0
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component--3DvQm1K.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-BZxpJRxJ.mjs +2472 -0
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-BZxpJRxJ.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-ngx-t-forms-XLA9yzak.mjs → ngx-t-forms-ngx-t-forms-CaVyRedJ.mjs} +4104 -441
- package/fesm2022/ngx-t-forms-ngx-t-forms-CaVyRedJ.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-paginated-selection-table-DisWM3sL.mjs → ngx-t-forms-paginated-selection-table-DzZE-Zde.mjs} +8 -6
- package/fesm2022/ngx-t-forms-paginated-selection-table-DzZE-Zde.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-payload-template-editor.component-DM4-3jzA.mjs → ngx-t-forms-payload-template-editor.component-CVj-G4MC.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-payload-template-editor.component-DM4-3jzA.mjs.map → ngx-t-forms-payload-template-editor.component-CVj-G4MC.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-Bc8En673.mjs → ngx-t-forms-pipeline-generator.component-BMyZKOXv.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-Bc8En673.mjs.map → ngx-t-forms-pipeline-generator.component-BMyZKOXv.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-quill-input.component-CN3aorpW.mjs → ngx-t-forms-quill-input.component-oUnmMDGi.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-quill-input.component-CN3aorpW.mjs.map → ngx-t-forms-quill-input.component-oUnmMDGi.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-record-list-manager.component-CpyrWNo5.mjs → ngx-t-forms-record-list-manager.component-CdQU6loA.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-record-list-manager.component-CpyrWNo5.mjs.map → ngx-t-forms-record-list-manager.component-CdQU6loA.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-required-inputs.component-CtUXVAvg.mjs → ngx-t-forms-required-inputs.component-BtfEsmva.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-required-inputs.component-CtUXVAvg.mjs.map → ngx-t-forms-required-inputs.component-BtfEsmva.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-a4z2V-a1.mjs → ngx-t-forms-rest-api-call-setup.component-B5w1Lvfo.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-a4z2V-a1.mjs.map → ngx-t-forms-rest-api-call-setup.component-B5w1Lvfo.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-section-report.component-D-FE0aL3.mjs → ngx-t-forms-section-report.component-CocLNrN5.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-section-report.component-D-FE0aL3.mjs.map → ngx-t-forms-section-report.component-CocLNrN5.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-select-input-element.component-Bwlqr26x.mjs → ngx-t-forms-select-input-element.component-B03O4cAK.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-select-input-element.component-Bwlqr26x.mjs.map → ngx-t-forms-select-input-element.component-B03O4cAK.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-BfaTlXQU.mjs → ngx-t-forms-selection-options-editor.component-CBdC0WCz.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-BfaTlXQU.mjs.map → ngx-t-forms-selection-options-editor.component-CBdC0WCz.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-textarea-input-element.component-B35jrn-j.mjs → ngx-t-forms-textarea-input-element.component-GXiLEsTp.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-textarea-input-element.component-B35jrn-j.mjs.map → ngx-t-forms-textarea-input-element.component-GXiLEsTp.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-toggle-input-element.component-Cku3HoDl.mjs → ngx-t-forms-toggle-input-element.component-WErP0SsA.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-toggle-input-element.component-Cku3HoDl.mjs.map → ngx-t-forms-toggle-input-element.component-WErP0SsA.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-token-text-input.component-B1I95sk3.mjs → ngx-t-forms-token-text-input.component-BMzPBtY_.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-token-text-input.component-B1I95sk3.mjs.map → ngx-t-forms-token-text-input.component-BMzPBtY_.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-validators-config.component-yq3EGgU2.mjs → ngx-t-forms-validators-config.component-DWDBsV6a.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-validators-config.component-yq3EGgU2.mjs.map → ngx-t-forms-validators-config.component-DWDBsV6a.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-workflow-adjudication.component-CZZX1hYU.mjs → ngx-t-forms-workflow-adjudication.component-DxObFakZ.mjs} +76 -17
- package/fesm2022/ngx-t-forms-workflow-adjudication.component-DxObFakZ.mjs.map +1 -0
- package/fesm2022/ngx-t-forms.mjs +1 -1
- package/package.json +2 -2
- package/types/ngx-t-forms.d.ts +463 -99
- package/fesm2022/ngx-t-forms-basic-input-input-element.component-1wixvEKK.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-CMOyxJ4K.mjs +0 -603
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-CMOyxJ4K.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-date-picker-input-element.component-BPoqT0as.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-DLeCZF3n.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-date-time-picker-input-element.component-D2kj-knT.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-document-picker.component-D0hW0jUu.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-index-CerXcX5U.mjs +0 -2
- package/fesm2022/ngx-t-forms-index-CerXcX5U.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-input-custom.component-BrZ59sIz.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mscoa-config.component-BqgTVHRS.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-7w9J1RgE.mjs +0 -447
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-7w9J1RgE.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-BbbRpwPw.mjs +0 -2336
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-BbbRpwPw.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-ngx-t-forms-XLA9yzak.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-paginated-selection-table-DisWM3sL.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-workflow-adjudication.component-CZZX1hYU.mjs.map +0 -1
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { untracked, effect, Injectable } from '@angular/core';
|
|
3
|
+
import { MAT_NATIVE_DATE_FORMATS, NativeDateAdapter, DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
|
|
4
|
+
import { a7 as FORMS_LOCALIZATION_DEFAULTS, a8 as injectFormsLocalization, a9 as weekDayIndexFor } from './ngx-t-forms-ngx-t-forms-CaVyRedJ.mjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @file Material's native `Date` adapter, following the consumer's localization:
|
|
8
|
+
* the configured locale (so the calendar input writes dates the way the
|
|
9
|
+
* organisation does), the configured first day of the week, and — when one is
|
|
10
|
+
* configured — a fixed date pattern for the input and a fixed clock for the
|
|
11
|
+
* time picker. With no localization configured it behaves exactly like
|
|
12
|
+
* `provideNativeDateAdapter()`, `MAT_DATE_LOCALE` included.
|
|
13
|
+
*
|
|
14
|
+
* Component-level, like the Material provider it replaces: each date element
|
|
15
|
+
* declares `providers: [provideFormsDateAdapter()]`.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* The formats this adapter is paired with. Each display entry the adapter
|
|
19
|
+
* treats specially is its own object rather than Material's constant, so
|
|
20
|
+
* `format()` can recognise the date input, the time input and the time option
|
|
21
|
+
* label by identity and apply the configured pattern or clock to exactly those.
|
|
22
|
+
*/
|
|
23
|
+
const FORMS_MAT_DATE_FORMATS = {
|
|
24
|
+
parse: { ...MAT_NATIVE_DATE_FORMATS.parse },
|
|
25
|
+
display: {
|
|
26
|
+
...MAT_NATIVE_DATE_FORMATS.display,
|
|
27
|
+
dateInput: { ...MAT_NATIVE_DATE_FORMATS.display.dateInput },
|
|
28
|
+
timeInput: { ...(MAT_NATIVE_DATE_FORMATS.display.timeInput ?? { hour: 'numeric', minute: 'numeric' }) },
|
|
29
|
+
timeOptionLabel: {
|
|
30
|
+
...(MAT_NATIVE_DATE_FORMATS.display.timeOptionLabel ?? { hour: 'numeric', minute: 'numeric' }),
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
/** `d/M/y` with any of the usual separators; the pattern decides which group is which. */
|
|
35
|
+
const NUMERIC_DATE = /^\s*(\d{1,4})\s*[/.\-]\s*(\d{1,2})\s*[/.\-]\s*(\d{1,4})\s*$/;
|
|
36
|
+
/** `19 Oct 2026`, `19 October 2026`, `19 Okt. 2026`. */
|
|
37
|
+
const TEXT_MONTH_DATE = /^\s*(\d{1,2})\s+([^\d\s.]+)\.?\s+(\d{4})\s*$/;
|
|
38
|
+
const shortMonthFormatters = new Map();
|
|
39
|
+
const monthNamesByLocale = new Map();
|
|
40
|
+
function shortMonthName(date, locale) {
|
|
41
|
+
let formatter = shortMonthFormatters.get(locale);
|
|
42
|
+
if (!formatter) {
|
|
43
|
+
formatter = new Intl.DateTimeFormat(locale, { month: 'short' });
|
|
44
|
+
shortMonthFormatters.set(locale, formatter);
|
|
45
|
+
}
|
|
46
|
+
return formatter.format(date);
|
|
47
|
+
}
|
|
48
|
+
/** Lower-cased short and long month names of `locale` (and English, always) → month number. */
|
|
49
|
+
function monthNames(locale) {
|
|
50
|
+
const cached = monthNamesByLocale.get(locale);
|
|
51
|
+
if (cached)
|
|
52
|
+
return cached;
|
|
53
|
+
const names = new Map();
|
|
54
|
+
for (const tag of new Set([locale, 'en'])) {
|
|
55
|
+
for (const month of ['short', 'long']) {
|
|
56
|
+
const formatter = new Intl.DateTimeFormat(tag, { month });
|
|
57
|
+
for (let index = 0; index < 12; index++) {
|
|
58
|
+
const name = formatter.format(new Date(2017, index, 1)).toLowerCase().replace(/\.$/, '');
|
|
59
|
+
if (!names.has(name))
|
|
60
|
+
names.set(name, index + 1);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
monthNamesByLocale.set(locale, names);
|
|
65
|
+
return names;
|
|
66
|
+
}
|
|
67
|
+
function buildDate(yearText, monthText, dayText) {
|
|
68
|
+
const year = Number(yearText);
|
|
69
|
+
const month = Number(monthText);
|
|
70
|
+
const day = Number(dayText);
|
|
71
|
+
if (!(year >= 1000 && year <= 9999) || month < 1 || month > 12 || day < 1 || day > 31)
|
|
72
|
+
return null;
|
|
73
|
+
const date = new Date(year, month - 1, day);
|
|
74
|
+
// Reject overflow (31 February becomes 3 March in the constructor).
|
|
75
|
+
return date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day ? date : null;
|
|
76
|
+
}
|
|
77
|
+
/** `date` written in `pattern`; month names come from `locale`. */
|
|
78
|
+
function formatDatePattern(date, pattern, locale) {
|
|
79
|
+
const day = String(date.getDate()).padStart(2, '0');
|
|
80
|
+
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
81
|
+
const year = String(date.getFullYear()).padStart(4, '0');
|
|
82
|
+
switch (pattern) {
|
|
83
|
+
case 'MM/dd/yyyy':
|
|
84
|
+
return `${month}/${day}/${year}`;
|
|
85
|
+
case 'yyyy-MM-dd':
|
|
86
|
+
return `${year}-${month}-${day}`;
|
|
87
|
+
case 'd MMM yyyy':
|
|
88
|
+
return `${date.getDate()} ${shortMonthName(date, locale)} ${year}`;
|
|
89
|
+
default:
|
|
90
|
+
return `${day}/${month}/${year}`;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* `text` read as `pattern`: a local-midnight `Date`, or `null` when it is not a
|
|
95
|
+
* real calendar day in that pattern (the caller then falls back to the native
|
|
96
|
+
* parser). Four-digit years only; `/`, `.` and `-` all separate.
|
|
97
|
+
*/
|
|
98
|
+
function parseDatePattern(text, pattern, locale) {
|
|
99
|
+
if (pattern === 'd MMM yyyy') {
|
|
100
|
+
const match = TEXT_MONTH_DATE.exec(text);
|
|
101
|
+
if (!match)
|
|
102
|
+
return null;
|
|
103
|
+
const [, day, monthName, year] = match;
|
|
104
|
+
const month = monthNames(locale).get((monthName ?? '').toLowerCase());
|
|
105
|
+
return month === undefined ? null : buildDate(year ?? '', String(month), day ?? '');
|
|
106
|
+
}
|
|
107
|
+
const match = NUMERIC_DATE.exec(text);
|
|
108
|
+
if (!match)
|
|
109
|
+
return null;
|
|
110
|
+
const [, first, second, third] = match;
|
|
111
|
+
switch (pattern) {
|
|
112
|
+
case 'MM/dd/yyyy':
|
|
113
|
+
return buildDate(third ?? '', first ?? '', second ?? '');
|
|
114
|
+
case 'yyyy-MM-dd':
|
|
115
|
+
return buildDate(first ?? '', second ?? '', third ?? '');
|
|
116
|
+
default:
|
|
117
|
+
return buildDate(third ?? '', second ?? '', first ?? '');
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/** True when the consumer configured a localization at all (anything but the library defaults). */
|
|
121
|
+
function isConfigured(localization) {
|
|
122
|
+
return localization !== FORMS_LOCALIZATION_DEFAULTS;
|
|
123
|
+
}
|
|
124
|
+
class FormsNativeDateAdapter extends NativeDateAdapter {
|
|
125
|
+
#localization = injectFormsLocalization();
|
|
126
|
+
constructor() {
|
|
127
|
+
super();
|
|
128
|
+
// With a localization configured, its locale wins over `MAT_DATE_LOCALE`
|
|
129
|
+
// — now and on every change. `setLocale` emits `localeChanges`, which
|
|
130
|
+
// re-renders every open calendar, and that re-read also picks up a changed
|
|
131
|
+
// first day of the week or date pattern. Unconfigured, the locale Material
|
|
132
|
+
// chose in `super()` stands, exactly as with `provideNativeDateAdapter()`.
|
|
133
|
+
this.#followLocale(untracked(this.#localization));
|
|
134
|
+
effect(() => {
|
|
135
|
+
this.#followLocale(this.#localization());
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
getFirstDayOfWeek() {
|
|
139
|
+
const day = untracked(this.#localization).firstDayOfWeek;
|
|
140
|
+
return day ? weekDayIndexFor(day) : super.getFirstDayOfWeek();
|
|
141
|
+
}
|
|
142
|
+
format(date, displayFormat) {
|
|
143
|
+
const localization = untracked(this.#localization);
|
|
144
|
+
const { dateInput, timeInput, timeOptionLabel } = FORMS_MAT_DATE_FORMATS.display;
|
|
145
|
+
if (displayFormat === dateInput && localization.dateFormat !== 'locale') {
|
|
146
|
+
if (!this.isValid(date)) {
|
|
147
|
+
throw Error('FormsNativeDateAdapter: Cannot format invalid date.');
|
|
148
|
+
}
|
|
149
|
+
return formatDatePattern(date, localization.dateFormat, this.locale);
|
|
150
|
+
}
|
|
151
|
+
if ((displayFormat === timeInput || displayFormat === timeOptionLabel) && localization.timeFormat !== 'locale') {
|
|
152
|
+
return super.format(date, { ...displayFormat, hourCycle: localization.timeFormat === '12h' ? 'h12' : 'h23' });
|
|
153
|
+
}
|
|
154
|
+
return super.format(date, displayFormat);
|
|
155
|
+
}
|
|
156
|
+
parse(value, parseFormat) {
|
|
157
|
+
const localization = untracked(this.#localization);
|
|
158
|
+
if (typeof value === 'string' && localization.dateFormat !== 'locale') {
|
|
159
|
+
const parsed = parseDatePattern(value, localization.dateFormat, this.locale);
|
|
160
|
+
if (parsed)
|
|
161
|
+
return parsed;
|
|
162
|
+
}
|
|
163
|
+
return super.parse(value, parseFormat);
|
|
164
|
+
}
|
|
165
|
+
#followLocale(localization) {
|
|
166
|
+
if (isConfigured(localization))
|
|
167
|
+
this.setLocale(localization.locale);
|
|
168
|
+
}
|
|
169
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: FormsNativeDateAdapter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
170
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: FormsNativeDateAdapter }); }
|
|
171
|
+
}
|
|
172
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: FormsNativeDateAdapter, decorators: [{
|
|
173
|
+
type: Injectable
|
|
174
|
+
}], ctorParameters: () => [] });
|
|
175
|
+
/**
|
|
176
|
+
* Component-level providers: {@link FormsNativeDateAdapter} and the formats it is
|
|
177
|
+
* paired with. A drop-in for Material's `provideNativeDateAdapter()`.
|
|
178
|
+
*/
|
|
179
|
+
function provideFormsDateAdapter() {
|
|
180
|
+
return [
|
|
181
|
+
{ provide: DateAdapter, useClass: FormsNativeDateAdapter },
|
|
182
|
+
{ provide: MAT_DATE_FORMATS, useValue: FORMS_MAT_DATE_FORMATS },
|
|
183
|
+
];
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export { provideFormsDateAdapter as p };
|
|
187
|
+
//# sourceMappingURL=ngx-t-forms-forms-native-date-adapter-CCJT5ep1.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-t-forms-forms-native-date-adapter-CCJT5ep1.mjs","sources":["../../../projects/ngx-t-forms/src/lib/services/core/t-form-localization/forms-native-date-adapter.ts"],"sourcesContent":["/**\n * @file Material's native `Date` adapter, following the consumer's localization:\n * the configured locale (so the calendar input writes dates the way the\n * organisation does), the configured first day of the week, and — when one is\n * configured — a fixed date pattern for the input and a fixed clock for the\n * time picker. With no localization configured it behaves exactly like\n * `provideNativeDateAdapter()`, `MAT_DATE_LOCALE` included.\n *\n * Component-level, like the Material provider it replaces: each date element\n * declares `providers: [provideFormsDateAdapter()]`.\n */\nimport { Injectable, type Provider, effect, untracked } from '@angular/core';\nimport {\n DateAdapter,\n MAT_DATE_FORMATS,\n MAT_NATIVE_DATE_FORMATS,\n type MatDateFormats,\n NativeDateAdapter,\n} from '@angular/material/core';\nimport type { FormsDateFormat } from 'ngx-t-forms-types';\n\nimport {\n FORMS_LOCALIZATION_DEFAULTS,\n weekDayIndexFor,\n type ResolvedFormsLocalization,\n} from '../../../shared/functions/formsLocalization';\nimport { injectFormsLocalization } from './inject-forms-localization';\n\n/** A date pattern the adapter writes and reads itself (everything but `locale`). */\nexport type FixedDatePattern = Exclude<FormsDateFormat, 'locale'>;\n\n/**\n * The formats this adapter is paired with. Each display entry the adapter\n * treats specially is its own object rather than Material's constant, so\n * `format()` can recognise the date input, the time input and the time option\n * label by identity and apply the configured pattern or clock to exactly those.\n */\nexport const FORMS_MAT_DATE_FORMATS: MatDateFormats = {\n parse: { ...MAT_NATIVE_DATE_FORMATS.parse },\n display: {\n ...MAT_NATIVE_DATE_FORMATS.display,\n dateInput: { ...MAT_NATIVE_DATE_FORMATS.display.dateInput },\n timeInput: { ...(MAT_NATIVE_DATE_FORMATS.display.timeInput ?? { hour: 'numeric', minute: 'numeric' }) },\n timeOptionLabel: {\n ...(MAT_NATIVE_DATE_FORMATS.display.timeOptionLabel ?? { hour: 'numeric', minute: 'numeric' }),\n },\n },\n};\n\n/** `d/M/y` with any of the usual separators; the pattern decides which group is which. */\nconst NUMERIC_DATE = /^\\s*(\\d{1,4})\\s*[/.\\-]\\s*(\\d{1,2})\\s*[/.\\-]\\s*(\\d{1,4})\\s*$/;\n/** `19 Oct 2026`, `19 October 2026`, `19 Okt. 2026`. */\nconst TEXT_MONTH_DATE = /^\\s*(\\d{1,2})\\s+([^\\d\\s.]+)\\.?\\s+(\\d{4})\\s*$/;\n\nconst shortMonthFormatters = new Map<string, Intl.DateTimeFormat>();\nconst monthNamesByLocale = new Map<string, ReadonlyMap<string, number>>();\n\nfunction shortMonthName(date: Date, locale: string): string {\n let formatter = shortMonthFormatters.get(locale);\n if (!formatter) {\n formatter = new Intl.DateTimeFormat(locale, { month: 'short' });\n shortMonthFormatters.set(locale, formatter);\n }\n return formatter.format(date);\n}\n\n/** Lower-cased short and long month names of `locale` (and English, always) → month number. */\nfunction monthNames(locale: string): ReadonlyMap<string, number> {\n const cached = monthNamesByLocale.get(locale);\n if (cached) return cached;\n const names = new Map<string, number>();\n for (const tag of new Set([locale, 'en'])) {\n for (const month of ['short', 'long'] as const) {\n const formatter = new Intl.DateTimeFormat(tag, { month });\n for (let index = 0; index < 12; index++) {\n const name = formatter.format(new Date(2017, index, 1)).toLowerCase().replace(/\\.$/, '');\n if (!names.has(name)) names.set(name, index + 1);\n }\n }\n }\n monthNamesByLocale.set(locale, names);\n return names;\n}\n\nfunction buildDate(yearText: string, monthText: string, dayText: string): Date | null {\n const year = Number(yearText);\n const month = Number(monthText);\n const day = Number(dayText);\n if (!(year >= 1000 && year <= 9999) || month < 1 || month > 12 || day < 1 || day > 31) return null;\n const date = new Date(year, month - 1, day);\n // Reject overflow (31 February becomes 3 March in the constructor).\n return date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day ? date : null;\n}\n\n/** `date` written in `pattern`; month names come from `locale`. */\nexport function formatDatePattern(date: Date, pattern: FixedDatePattern, locale: string): string {\n const day = String(date.getDate()).padStart(2, '0');\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const year = String(date.getFullYear()).padStart(4, '0');\n switch (pattern) {\n case 'MM/dd/yyyy':\n return `${month}/${day}/${year}`;\n case 'yyyy-MM-dd':\n return `${year}-${month}-${day}`;\n case 'd MMM yyyy':\n return `${date.getDate()} ${shortMonthName(date, locale)} ${year}`;\n default:\n return `${day}/${month}/${year}`;\n }\n}\n\n/**\n * `text` read as `pattern`: a local-midnight `Date`, or `null` when it is not a\n * real calendar day in that pattern (the caller then falls back to the native\n * parser). Four-digit years only; `/`, `.` and `-` all separate.\n */\nexport function parseDatePattern(text: string, pattern: FixedDatePattern, locale: string): Date | null {\n if (pattern === 'd MMM yyyy') {\n const match = TEXT_MONTH_DATE.exec(text);\n if (!match) return null;\n const [, day, monthName, year] = match;\n const month = monthNames(locale).get((monthName ?? '').toLowerCase());\n return month === undefined ? null : buildDate(year ?? '', String(month), day ?? '');\n }\n const match = NUMERIC_DATE.exec(text);\n if (!match) return null;\n const [, first, second, third] = match;\n switch (pattern) {\n case 'MM/dd/yyyy':\n return buildDate(third ?? '', first ?? '', second ?? '');\n case 'yyyy-MM-dd':\n return buildDate(first ?? '', second ?? '', third ?? '');\n default:\n return buildDate(third ?? '', second ?? '', first ?? '');\n }\n}\n\n/** True when the consumer configured a localization at all (anything but the library defaults). */\nfunction isConfigured(localization: ResolvedFormsLocalization): boolean {\n return localization !== FORMS_LOCALIZATION_DEFAULTS;\n}\n\n@Injectable()\nexport class FormsNativeDateAdapter extends NativeDateAdapter {\n readonly #localization = injectFormsLocalization();\n\n constructor() {\n super();\n // With a localization configured, its locale wins over `MAT_DATE_LOCALE`\n // — now and on every change. `setLocale` emits `localeChanges`, which\n // re-renders every open calendar, and that re-read also picks up a changed\n // first day of the week or date pattern. Unconfigured, the locale Material\n // chose in `super()` stands, exactly as with `provideNativeDateAdapter()`.\n this.#followLocale(untracked(this.#localization));\n effect(() => {\n this.#followLocale(this.#localization());\n });\n }\n\n override getFirstDayOfWeek(): number {\n const day = untracked(this.#localization).firstDayOfWeek;\n return day ? weekDayIndexFor(day) : super.getFirstDayOfWeek();\n }\n\n override format(date: Date, displayFormat: Intl.DateTimeFormatOptions): string {\n const localization = untracked(this.#localization);\n const { dateInput, timeInput, timeOptionLabel } = FORMS_MAT_DATE_FORMATS.display;\n if (displayFormat === dateInput && localization.dateFormat !== 'locale') {\n if (!this.isValid(date)) {\n throw Error('FormsNativeDateAdapter: Cannot format invalid date.');\n }\n return formatDatePattern(date, localization.dateFormat, this.locale);\n }\n if ((displayFormat === timeInput || displayFormat === timeOptionLabel) && localization.timeFormat !== 'locale') {\n return super.format(date, { ...displayFormat, hourCycle: localization.timeFormat === '12h' ? 'h12' : 'h23' });\n }\n return super.format(date, displayFormat);\n }\n\n override parse(value: unknown, parseFormat?: unknown): Date | null {\n const localization = untracked(this.#localization);\n if (typeof value === 'string' && localization.dateFormat !== 'locale') {\n const parsed = parseDatePattern(value, localization.dateFormat, this.locale);\n if (parsed) return parsed;\n }\n return super.parse(value, parseFormat);\n }\n\n #followLocale(localization: ResolvedFormsLocalization): void {\n if (isConfigured(localization)) this.setLocale(localization.locale);\n }\n}\n\n/**\n * Component-level providers: {@link FormsNativeDateAdapter} and the formats it is\n * paired with. A drop-in for Material's `provideNativeDateAdapter()`.\n */\nexport function provideFormsDateAdapter(): Provider[] {\n return [\n { provide: DateAdapter, useClass: FormsNativeDateAdapter },\n { provide: MAT_DATE_FORMATS, useValue: FORMS_MAT_DATE_FORMATS },\n ];\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;AAUG;AAqBH;;;;;AAKG;AACI,MAAM,sBAAsB,GAAmB;AACpD,IAAA,KAAK,EAAE,EAAE,GAAG,uBAAuB,CAAC,KAAK,EAAE;AAC3C,IAAA,OAAO,EAAE;QACP,GAAG,uBAAuB,CAAC,OAAO;QAClC,SAAS,EAAE,EAAE,GAAG,uBAAuB,CAAC,OAAO,CAAC,SAAS,EAAE;QAC3D,SAAS,EAAE,EAAE,IAAI,uBAAuB,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,EAAE;AACvG,QAAA,eAAe,EAAE;AACf,YAAA,IAAI,uBAAuB,CAAC,OAAO,CAAC,eAAe,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AAC/F,SAAA;AACF,KAAA;CACF;AAED;AACA,MAAM,YAAY,GAAG,6DAA6D;AAClF;AACA,MAAM,eAAe,GAAG,8CAA8C;AAEtE,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAA+B;AACnE,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAuC;AAEzE,SAAS,cAAc,CAAC,IAAU,EAAE,MAAc,EAAA;IAChD,IAAI,SAAS,GAAG,oBAAoB,CAAC,GAAG,CAAC,MAAM,CAAC;IAChD,IAAI,CAAC,SAAS,EAAE;AACd,QAAA,SAAS,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC/D,QAAA,oBAAoB,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC;IAC7C;AACA,IAAA,OAAO,SAAS,CAAC,MAAM,CAAC,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from '@angular/material/tooltip';
|
|
12
12
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
13
|
-
import { B as BaseCustomInput,
|
|
13
|
+
import { B as BaseCustomInput, a4 as getInputErrorMessage, a5 as TFormInputStatusComponent } from './ngx-t-forms-ngx-t-forms-CaVyRedJ.mjs';
|
|
14
14
|
import * as i3$1 from '@angular/common';
|
|
15
15
|
import { isPlatformBrowser, CommonModule } from '@angular/common';
|
|
16
16
|
|
|
@@ -116,7 +116,7 @@ class GeoLocationComponent {
|
|
|
116
116
|
this.errorMessage = computed(() => getInputErrorMessage(this.inputConfig(), this.formGroup()), ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
117
117
|
}
|
|
118
118
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: GeoLocationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
119
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: GeoLocationComponent, isStandalone: true, selector: "lib-geo-location", inputs: { inputConfig: { classPropertyName: "inputConfig", publicName: "inputConfig", isSignal: true, isRequired: true, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: true, isRequired: true, transformFunction: null }, editorMode: { classPropertyName: "editorMode", publicName: "editorMode", isSignal: true, isRequired: false, transformFunction: null }, formBuilderFunctions: { classPropertyName: "formBuilderFunctions", publicName: "formBuilderFunctions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { reload: "reload" }, ngImport: i0, template: "<form [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as inputConfig) {\r\n <mat-form-field [appearance]=\"inputConfig.appearance || 'fill'\" subscriptSizing=\"dynamic\">\r\n <mat-label>\r\n {{ inputConfig.label }}\r\n <lib-t-form-input-status [inputConfig]=\"inputConfig\"></lib-t-form-input-status>\r\n </mat-label>\r\n\r\n <lib-geo-location-form-input\r\n [inputConfig]=\"inputConfig\"\r\n [formControlName]=\"inputConfig.id\"\r\n [required]=\"inputConfig.required\"\r\n ></lib-geo-location-form-input>\r\n\r\n @if (inputConfig.hintLabel || inputConfig.temporaryHint) {\r\n <mat-hint class=\"inputHint\">\r\n {{ inputConfig.temporaryHint || inputConfig.hintLabel }}\r\n </mat-hint>\r\n }\r\n\r\n @if (!!errorMessage()) {\r\n <mat-error class=\"oneLineTextEllipsis\" matTooltipClass=\"errorToolTip\">{{ errorMessage() }}</mat-error>\r\n }\r\n\r\n @if (inputConfig.canReload?.canReload) {\r\n <button\r\n mat-icon-button\r\n style=\"margin-right: 4px;\"\r\n matTooltip=\"Click to refresh this field.\"\r\n class=\"input-sync-button\"\r\n (click)=\"inputConfig.canReload.emit()\"\r\n matSuffix\r\n >\r\n <mat-icon style=\"color: var(--mat-sys-primary)\">sync</mat-icon>\r\n </button>\r\n }\r\n\r\n @if (inputConfig.prefixIcon) {\r\n <mat-icon matPrefix>{{ inputConfig.prefixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.suffixIcon && inputConfig.id !== 'password') {\r\n <mat-icon matSuffix>{{ inputConfig.suffixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.prefixText) {\r\n <span matPrefix style=\"
|
|
119
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: GeoLocationComponent, isStandalone: true, selector: "lib-geo-location", inputs: { inputConfig: { classPropertyName: "inputConfig", publicName: "inputConfig", isSignal: true, isRequired: true, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: true, isRequired: true, transformFunction: null }, editorMode: { classPropertyName: "editorMode", publicName: "editorMode", isSignal: true, isRequired: false, transformFunction: null }, formBuilderFunctions: { classPropertyName: "formBuilderFunctions", publicName: "formBuilderFunctions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { reload: "reload" }, ngImport: i0, template: "<form [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as inputConfig) {\r\n <mat-form-field [appearance]=\"inputConfig.appearance || 'fill'\" subscriptSizing=\"dynamic\">\r\n <mat-label>\r\n {{ inputConfig.label }}\r\n <lib-t-form-input-status [inputConfig]=\"inputConfig\"></lib-t-form-input-status>\r\n </mat-label>\r\n\r\n <lib-geo-location-form-input\r\n [inputConfig]=\"inputConfig\"\r\n [formControlName]=\"inputConfig.id\"\r\n [required]=\"inputConfig.required\"\r\n ></lib-geo-location-form-input>\r\n\r\n @if (inputConfig.hintLabel || inputConfig.temporaryHint) {\r\n <mat-hint class=\"inputHint\">\r\n {{ inputConfig.temporaryHint || inputConfig.hintLabel }}\r\n </mat-hint>\r\n }\r\n\r\n @if (!!errorMessage()) {\r\n <mat-error class=\"oneLineTextEllipsis\" matTooltipClass=\"errorToolTip\">{{ errorMessage() }}</mat-error>\r\n }\r\n\r\n @if (inputConfig.canReload?.canReload) {\r\n <button\r\n mat-icon-button\r\n style=\"margin-right: 4px;\"\r\n matTooltip=\"Click to refresh this field.\"\r\n class=\"input-sync-button\"\r\n (click)=\"inputConfig.canReload.emit()\"\r\n matSuffix\r\n >\r\n <mat-icon style=\"color: var(--mat-sys-primary)\">sync</mat-icon>\r\n </button>\r\n }\r\n\r\n @if (inputConfig.prefixIcon) {\r\n <mat-icon matPrefix>{{ inputConfig.prefixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.suffixIcon && inputConfig.id !== 'password') {\r\n <mat-icon matSuffix>{{ inputConfig.suffixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.prefixText) {\r\n <span matPrefix style=\"padding: 0 12px;\">{{ inputConfig.prefixText }}</span>\r\n }\r\n @if (inputConfig.suffixText) {\r\n <span matSuffix style=\"padding: 0 12px;\">{{ inputConfig.suffixText }}</span>\r\n }\r\n\r\n @if (inputConfig.maxLength && formGroup()) {\r\n <mat-hint align=\"end\">\r\n {{ (formGroup().controls[inputConfig.id]?.value?.length || 0) + '/' + inputConfig.maxLength }}\r\n </mat-hint>\r\n }\r\n </mat-form-field>\r\n }\r\n</form>\r\n", styles: ["mat-form-field{width:100%}mat-form-field .input-sync-button{display:none}mat-form-field:hover .input-sync-button{display:inline-block}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: TFormInputStatusComponent, selector: "lib-t-form-input-status", inputs: ["inputConfig"] }, { kind: "component", type: GeoLocationFormInputComponent, selector: "lib-geo-location-form-input", inputs: ["formBuilderFunctions", "inputConfig"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
120
120
|
}
|
|
121
121
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: GeoLocationComponent, decorators: [{
|
|
122
122
|
type: Component,
|
|
@@ -128,8 +128,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
128
128
|
MatTooltipModule,
|
|
129
129
|
TFormInputStatusComponent,
|
|
130
130
|
GeoLocationFormInputComponent,
|
|
131
|
-
], template: "<form [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as inputConfig) {\r\n <mat-form-field [appearance]=\"inputConfig.appearance || 'fill'\" subscriptSizing=\"dynamic\">\r\n <mat-label>\r\n {{ inputConfig.label }}\r\n <lib-t-form-input-status [inputConfig]=\"inputConfig\"></lib-t-form-input-status>\r\n </mat-label>\r\n\r\n <lib-geo-location-form-input\r\n [inputConfig]=\"inputConfig\"\r\n [formControlName]=\"inputConfig.id\"\r\n [required]=\"inputConfig.required\"\r\n ></lib-geo-location-form-input>\r\n\r\n @if (inputConfig.hintLabel || inputConfig.temporaryHint) {\r\n <mat-hint class=\"inputHint\">\r\n {{ inputConfig.temporaryHint || inputConfig.hintLabel }}\r\n </mat-hint>\r\n }\r\n\r\n @if (!!errorMessage()) {\r\n <mat-error class=\"oneLineTextEllipsis\" matTooltipClass=\"errorToolTip\">{{ errorMessage() }}</mat-error>\r\n }\r\n\r\n @if (inputConfig.canReload?.canReload) {\r\n <button\r\n mat-icon-button\r\n style=\"margin-right: 4px;\"\r\n matTooltip=\"Click to refresh this field.\"\r\n class=\"input-sync-button\"\r\n (click)=\"inputConfig.canReload.emit()\"\r\n matSuffix\r\n >\r\n <mat-icon style=\"color: var(--mat-sys-primary)\">sync</mat-icon>\r\n </button>\r\n }\r\n\r\n @if (inputConfig.prefixIcon) {\r\n <mat-icon matPrefix>{{ inputConfig.prefixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.suffixIcon && inputConfig.id !== 'password') {\r\n <mat-icon matSuffix>{{ inputConfig.suffixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.prefixText) {\r\n <span matPrefix style=\"
|
|
131
|
+
], template: "<form [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as inputConfig) {\r\n <mat-form-field [appearance]=\"inputConfig.appearance || 'fill'\" subscriptSizing=\"dynamic\">\r\n <mat-label>\r\n {{ inputConfig.label }}\r\n <lib-t-form-input-status [inputConfig]=\"inputConfig\"></lib-t-form-input-status>\r\n </mat-label>\r\n\r\n <lib-geo-location-form-input\r\n [inputConfig]=\"inputConfig\"\r\n [formControlName]=\"inputConfig.id\"\r\n [required]=\"inputConfig.required\"\r\n ></lib-geo-location-form-input>\r\n\r\n @if (inputConfig.hintLabel || inputConfig.temporaryHint) {\r\n <mat-hint class=\"inputHint\">\r\n {{ inputConfig.temporaryHint || inputConfig.hintLabel }}\r\n </mat-hint>\r\n }\r\n\r\n @if (!!errorMessage()) {\r\n <mat-error class=\"oneLineTextEllipsis\" matTooltipClass=\"errorToolTip\">{{ errorMessage() }}</mat-error>\r\n }\r\n\r\n @if (inputConfig.canReload?.canReload) {\r\n <button\r\n mat-icon-button\r\n style=\"margin-right: 4px;\"\r\n matTooltip=\"Click to refresh this field.\"\r\n class=\"input-sync-button\"\r\n (click)=\"inputConfig.canReload.emit()\"\r\n matSuffix\r\n >\r\n <mat-icon style=\"color: var(--mat-sys-primary)\">sync</mat-icon>\r\n </button>\r\n }\r\n\r\n @if (inputConfig.prefixIcon) {\r\n <mat-icon matPrefix>{{ inputConfig.prefixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.suffixIcon && inputConfig.id !== 'password') {\r\n <mat-icon matSuffix>{{ inputConfig.suffixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.prefixText) {\r\n <span matPrefix style=\"padding: 0 12px;\">{{ inputConfig.prefixText }}</span>\r\n }\r\n @if (inputConfig.suffixText) {\r\n <span matSuffix style=\"padding: 0 12px;\">{{ inputConfig.suffixText }}</span>\r\n }\r\n\r\n @if (inputConfig.maxLength && formGroup()) {\r\n <mat-hint align=\"end\">\r\n {{ (formGroup().controls[inputConfig.id]?.value?.length || 0) + '/' + inputConfig.maxLength }}\r\n </mat-hint>\r\n }\r\n </mat-form-field>\r\n }\r\n</form>\r\n", styles: ["mat-form-field{width:100%}mat-form-field .input-sync-button{display:none}mat-form-field:hover .input-sync-button{display:inline-block}\n"] }]
|
|
132
132
|
}], propDecorators: { inputConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputConfig", required: true }] }], formGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "formGroup", required: true }] }], editorMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "editorMode", required: false }] }], formBuilderFunctions: [{ type: i0.Input, args: [{ isSignal: true, alias: "formBuilderFunctions", required: false }] }], reload: [{ type: i0.Output, args: ["reload"] }] } });
|
|
133
133
|
|
|
134
134
|
export { GeoLocationComponent };
|
|
135
|
-
//# sourceMappingURL=ngx-t-forms-geo-location.component-
|
|
135
|
+
//# sourceMappingURL=ngx-t-forms-geo-location.component-DgXSaH0t.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-t-forms-geo-location.component-BGg8uGQV.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/Geo-location-form-input/functions/getGeoLocation.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/Geo-location-form-input/elements/geo-location-form-input/geo-location-form-input.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/Geo-location-form-input/elements/geo-location-form-input/geo-location-form-input.component.html","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/Geo-location-form-input/geo-location.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/Geo-location-form-input/geo-location.component.html"],"sourcesContent":["\r\n\r\nconst DEFAULT_OPTIONS: PositionOptions = {\r\n enableHighAccuracy: true,\r\n timeout: 5000,\r\n maximumAge: 0\r\n};\r\n\r\nconst getGeoLocation = (options: PositionOptions = DEFAULT_OPTIONS): Promise<GeolocationPosition> => {\r\n return new Promise((resolve, reject) => {\r\n if (!navigator.geolocation) {\r\n const error= {\r\n code: 0,\r\n message: 'Geolocation is not supported by this browser',\r\n PERMISSION_DENIED: 1,\r\n POSITION_UNAVAILABLE: 2,\r\n TIMEOUT: 3\r\n };\r\n reject(error);\r\n return;\r\n }\r\n\r\n navigator.geolocation.getCurrentPosition(\r\n (position: GeolocationPosition) => resolve(position),\r\n (error: GeolocationPositionError) => reject(error),\r\n options\r\n );\r\n });\r\n};\r\n\r\nexport default getGeoLocation;","import { ChangeDetectionStrategy, Component, ElementRef, PLATFORM_ID, computed, inject, input, signal } from '@angular/core';\r\nimport { isPlatformBrowser } from '@angular/common';\r\n\r\nimport { MatFormFieldControl } from '@angular/material/form-field';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { CommonModule } from '@angular/common';\r\nimport { NgControl } from '@angular/forms';\r\nimport type { FormBuilderFunctions, ITowerStepColumn } from 'ngx-t-forms-types';\r\nimport getGeoLocation from '../../functions/getGeoLocation';\r\nimport { BaseCustomInput, BaseCustomInputConfig } from '../../../../../../services/core/t-input-controller/functions/baseCustomInput';\r\n\r\nconst customInputConfig: BaseCustomInputConfig = {\r\n controlType: 'lib-geo-location-form-input',\r\n nextId: 0\r\n};\r\n\r\n@Component({\r\n selector: 'lib-geo-location-form-input',\r\n imports: [CommonModule, MatButtonModule, MatIconModule],\r\n templateUrl: './geo-location-form-input.component.html',\r\n styleUrl: './geo-location-form-input.component.css',\r\n providers: [\r\n {\r\n provide: MatFormFieldControl,\r\n useExisting: GeoLocationFormInputComponent\r\n }\r\n ],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class GeoLocationFormInputComponent extends BaseCustomInput<GeolocationPosition | null> {\r\n readonly formBuilderFunctions = input<FormBuilderFunctions | undefined>(undefined);\r\n readonly inputConfig = input.required<ITowerStepColumn>();\r\n\r\n protected readonly isLoading = signal(false);\r\n protected readonly error = signal(false);\r\n\r\n /**\r\n * True when the descriptor marks the field `readonly` or `disabled`. Blocks the\r\n * get/update-location action so geo-location honours the same\r\n * `readonly || disabled` contract as the reference text input.\r\n */\r\n protected readonly isReadOnly = computed<boolean>(() => {\r\n const cfg = this.inputConfig();\r\n return !!cfg?.readonly || !!cfg?.disabled;\r\n });\r\n\r\n readonly #platformId = inject(PLATFORM_ID);\r\n\r\n constructor() {\r\n super(\r\n inject(NgControl, { optional: true, self: true }) as NgControl,\r\n inject<ElementRef<HTMLElement>>(ElementRef),\r\n customInputConfig\r\n );\r\n }\r\n\r\n override get empty(): boolean {\r\n const n = this.value;\r\n // Check for null, undefined, or empty string, but allow 0\r\n return n === null || n === undefined || (n as unknown) === '';\r\n }\r\n\r\n override get shouldLabelFloat(): boolean {\r\n return true;\r\n }\r\n\r\n protected async getLocation(): Promise<void> {\r\n if (this.isReadOnly()) return;\r\n if (!isPlatformBrowser(this.#platformId)) return;\r\n try {\r\n this.error.set(false);\r\n this.isLoading.set(true);\r\n const currentLocation = await getGeoLocation();\r\n this.isLoading.set(false);\r\n this.value = currentLocation;\r\n this.onChange(this.value);\r\n this.stateChanges.next();\r\n } catch {\r\n this.isLoading.set(false);\r\n this.error.set(true);\r\n this.errors = { externalError: true };\r\n }\r\n }\r\n}\r\n","@if (!!empty) {\r\n <p class=\"empty-state\">\r\n Click icon to get your location\r\n </p>\r\n}\r\n<div class=\"coordinates-section\">\r\n @if (!empty) {\r\n <div class=\"coordinate-item\">\r\n <mat-icon color=\"primary\">map</mat-icon>\r\n <span class=\"value\">\r\n <div class=\"inner-value\">\r\n {{ value?.coords?.latitude || 'N/A' }} <span class=\"unit\">°N</span>\r\n </div>\r\n <div class=\"inner-value label\">\r\n latitude\r\n </div>\r\n </span>\r\n </div>\r\n <div class=\"coordinate-item\">\r\n <mat-icon color=\"primary\">map</mat-icon>\r\n <span class=\"value\">\r\n <div class=\"inner-value\">\r\n {{ value?.coords?.longitude || 'N/A' }}\r\n <span class=\"unit\">°E</span>\r\n </div>\r\n <div class=\"inner-value label\">\r\n longitude\r\n </div>\r\n </span>\r\n </div>\r\n <div class=\"coordinate-item\">\r\n <mat-icon color=\"primary\">zoom_in_map</mat-icon>\r\n <span class=\"value\">\r\n <div class=\"inner-value\">\r\n {{ value?.coords?.accuracy | number:'1.0-0' }}\r\n <span class=\"unit\">m</span>\r\n </div>\r\n <div class=\"inner-value label\">\r\n accuracy\r\n </div>\r\n </span>\r\n </div>\r\n }\r\n <button mat-flat-button [disabled]=\"isReadOnly()\" (click)=\"getLocation()\">\r\n {{ empty ? 'Get Location' : 'Update Location' }}\r\n <mat-icon>my_location</mat-icon>\r\n </button>\r\n</div>\r\n","import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';\r\nimport { FormGroup, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport type { FormBuilderFunctions, ITowerStepColumn } from 'ngx-t-forms-types';\r\nimport { TFormInputStatusComponent } from '../../../t-form-input-status/t-form-input-status.component';\r\nimport { GeoLocationFormInputComponent } from './elements/geo-location-form-input/geo-location-form-input.component';\r\nimport { getInputErrorMessage } from '../../../../services/core/t-input-controller/functions/inputErrorMessage';\r\n\r\n/** Wraps the inner geo-location control inside a `mat-form-field`. */\r\n@Component({\r\n selector: 'lib-geo-location',\r\n templateUrl: './geo-location.component.html',\r\n styleUrl: './geo-location.component.css',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [\r\n ReactiveFormsModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatButtonModule,\r\n MatTooltipModule,\r\n TFormInputStatusComponent,\r\n GeoLocationFormInputComponent,\r\n ],\r\n})\r\nexport class GeoLocationComponent {\r\n readonly inputConfig = input.required<ITowerStepColumn>();\r\n readonly formGroup = input.required<FormGroup>();\r\n readonly editorMode = input<boolean>(false);\r\n readonly formBuilderFunctions = input<FormBuilderFunctions | undefined>(undefined);\r\n readonly reload = output<void>();\r\n\r\n protected readonly errorMessage = computed(() =>\r\n getInputErrorMessage(this.inputConfig(), this.formGroup()),\r\n );\r\n}\r\n","<form [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as inputConfig) {\r\n <mat-form-field [appearance]=\"inputConfig.appearance || 'fill'\" subscriptSizing=\"dynamic\">\r\n <mat-label>\r\n {{ inputConfig.label }}\r\n <lib-t-form-input-status [inputConfig]=\"inputConfig\"></lib-t-form-input-status>\r\n </mat-label>\r\n\r\n <lib-geo-location-form-input\r\n [inputConfig]=\"inputConfig\"\r\n [formControlName]=\"inputConfig.id\"\r\n [required]=\"inputConfig.required\"\r\n ></lib-geo-location-form-input>\r\n\r\n @if (inputConfig.hintLabel || inputConfig.temporaryHint) {\r\n <mat-hint class=\"inputHint\">\r\n {{ inputConfig.temporaryHint || inputConfig.hintLabel }}\r\n </mat-hint>\r\n }\r\n\r\n @if (!!errorMessage()) {\r\n <mat-error class=\"oneLineTextEllipsis\" matTooltipClass=\"errorToolTip\">{{ errorMessage() }}</mat-error>\r\n }\r\n\r\n @if (inputConfig.canReload?.canReload) {\r\n <button\r\n mat-icon-button\r\n style=\"margin-right: 4px;\"\r\n matTooltip=\"Click to refresh this field.\"\r\n class=\"input-sync-button\"\r\n (click)=\"inputConfig.canReload.emit()\"\r\n matSuffix\r\n >\r\n <mat-icon style=\"color: var(--mat-sys-primary)\">sync</mat-icon>\r\n </button>\r\n }\r\n\r\n @if (inputConfig.prefixIcon) {\r\n <mat-icon matPrefix>{{ inputConfig.prefixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.suffixIcon && inputConfig.id !== 'password') {\r\n <mat-icon matSuffix>{{ inputConfig.suffixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.prefixText) {\r\n <span matPrefix style=\"top: 0\">{{ inputConfig.prefixText }}</span>\r\n }\r\n @if (inputConfig.suffixText) {\r\n <span matSuffix style=\"padding-left: 5px\">{{ inputConfig.suffixText }}</span>\r\n }\r\n\r\n @if (inputConfig.maxLength && formGroup()) {\r\n <mat-hint align=\"end\">\r\n {{ (formGroup().controls[inputConfig.id]?.value?.length || 0) + '/' + inputConfig.maxLength }}\r\n </mat-hint>\r\n }\r\n </mat-form-field>\r\n }\r\n</form>\r\n"],"names":["i2","i3","i4"],"mappings":";;;;;;;;;;;;;;;;AAEA,MAAM,eAAe,GAAoB;AACrC,IAAA,kBAAkB,EAAE,IAAI;AACxB,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,UAAU,EAAE;CACf;AAED,MAAM,cAAc,GAAG,CAAC,OAAA,GAA2B,eAAe,KAAkC;IAChG,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAI;AACnC,QAAA,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE;AACxB,YAAA,MAAM,KAAK,GAAE;AACT,gBAAA,IAAI,EAAE,CAAC;AACP,gBAAA,OAAO,EAAE,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A,sBAAA,EAAA,aAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAGpB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAfhC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,EAAA,eAAA,EAGX,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC;wBACP,mBAAmB;wBACnB,kBAAkB;wBAClB,aAAa;wBACb,eAAe;wBACf,gBAAgB;wBAChB,yBAAyB;wBACzB,6BAA6B;AAC9B,qBAAA,EAAA,QAAA,EAAA,osEAAA,EAAA,MAAA,EAAA,CAAA,0IAAA,CAAA,EAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-t-forms-geo-location.component-DgXSaH0t.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/Geo-location-form-input/functions/getGeoLocation.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/Geo-location-form-input/elements/geo-location-form-input/geo-location-form-input.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/Geo-location-form-input/elements/geo-location-form-input/geo-location-form-input.component.html","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/Geo-location-form-input/geo-location.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/Geo-location-form-input/geo-location.component.html"],"sourcesContent":["\r\n\r\nconst DEFAULT_OPTIONS: PositionOptions = {\r\n enableHighAccuracy: true,\r\n timeout: 5000,\r\n maximumAge: 0\r\n};\r\n\r\nconst getGeoLocation = (options: PositionOptions = DEFAULT_OPTIONS): Promise<GeolocationPosition> => {\r\n return new Promise((resolve, reject) => {\r\n if (!navigator.geolocation) {\r\n const error= {\r\n code: 0,\r\n message: 'Geolocation is not supported by this browser',\r\n PERMISSION_DENIED: 1,\r\n POSITION_UNAVAILABLE: 2,\r\n TIMEOUT: 3\r\n };\r\n reject(error);\r\n return;\r\n }\r\n\r\n navigator.geolocation.getCurrentPosition(\r\n (position: GeolocationPosition) => resolve(position),\r\n (error: GeolocationPositionError) => reject(error),\r\n options\r\n );\r\n });\r\n};\r\n\r\nexport default getGeoLocation;","import { ChangeDetectionStrategy, Component, ElementRef, PLATFORM_ID, computed, inject, input, signal } from '@angular/core';\r\nimport { isPlatformBrowser } from '@angular/common';\r\n\r\nimport { MatFormFieldControl } from '@angular/material/form-field';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { CommonModule } from '@angular/common';\r\nimport { NgControl } from '@angular/forms';\r\nimport type { FormBuilderFunctions, ITowerStepColumn } from 'ngx-t-forms-types';\r\nimport getGeoLocation from '../../functions/getGeoLocation';\r\nimport { BaseCustomInput, BaseCustomInputConfig } from '../../../../../../services/core/t-input-controller/functions/baseCustomInput';\r\n\r\nconst customInputConfig: BaseCustomInputConfig = {\r\n controlType: 'lib-geo-location-form-input',\r\n nextId: 0\r\n};\r\n\r\n@Component({\r\n selector: 'lib-geo-location-form-input',\r\n imports: [CommonModule, MatButtonModule, MatIconModule],\r\n templateUrl: './geo-location-form-input.component.html',\r\n styleUrl: './geo-location-form-input.component.css',\r\n providers: [\r\n {\r\n provide: MatFormFieldControl,\r\n useExisting: GeoLocationFormInputComponent\r\n }\r\n ],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class GeoLocationFormInputComponent extends BaseCustomInput<GeolocationPosition | null> {\r\n readonly formBuilderFunctions = input<FormBuilderFunctions | undefined>(undefined);\r\n readonly inputConfig = input.required<ITowerStepColumn>();\r\n\r\n protected readonly isLoading = signal(false);\r\n protected readonly error = signal(false);\r\n\r\n /**\r\n * True when the descriptor marks the field `readonly` or `disabled`. Blocks the\r\n * get/update-location action so geo-location honours the same\r\n * `readonly || disabled` contract as the reference text input.\r\n */\r\n protected readonly isReadOnly = computed<boolean>(() => {\r\n const cfg = this.inputConfig();\r\n return !!cfg?.readonly || !!cfg?.disabled;\r\n });\r\n\r\n readonly #platformId = inject(PLATFORM_ID);\r\n\r\n constructor() {\r\n super(\r\n inject(NgControl, { optional: true, self: true }) as NgControl,\r\n inject<ElementRef<HTMLElement>>(ElementRef),\r\n customInputConfig\r\n );\r\n }\r\n\r\n override get empty(): boolean {\r\n const n = this.value;\r\n // Check for null, undefined, or empty string, but allow 0\r\n return n === null || n === undefined || (n as unknown) === '';\r\n }\r\n\r\n override get shouldLabelFloat(): boolean {\r\n return true;\r\n }\r\n\r\n protected async getLocation(): Promise<void> {\r\n if (this.isReadOnly()) return;\r\n if (!isPlatformBrowser(this.#platformId)) return;\r\n try {\r\n this.error.set(false);\r\n this.isLoading.set(true);\r\n const currentLocation = await getGeoLocation();\r\n this.isLoading.set(false);\r\n this.value = currentLocation;\r\n this.onChange(this.value);\r\n this.stateChanges.next();\r\n } catch {\r\n this.isLoading.set(false);\r\n this.error.set(true);\r\n this.errors = { externalError: true };\r\n }\r\n }\r\n}\r\n","@if (!!empty) {\r\n <p class=\"empty-state\">\r\n Click icon to get your location\r\n </p>\r\n}\r\n<div class=\"coordinates-section\">\r\n @if (!empty) {\r\n <div class=\"coordinate-item\">\r\n <mat-icon color=\"primary\">map</mat-icon>\r\n <span class=\"value\">\r\n <div class=\"inner-value\">\r\n {{ value?.coords?.latitude || 'N/A' }} <span class=\"unit\">°N</span>\r\n </div>\r\n <div class=\"inner-value label\">\r\n latitude\r\n </div>\r\n </span>\r\n </div>\r\n <div class=\"coordinate-item\">\r\n <mat-icon color=\"primary\">map</mat-icon>\r\n <span class=\"value\">\r\n <div class=\"inner-value\">\r\n {{ value?.coords?.longitude || 'N/A' }}\r\n <span class=\"unit\">°E</span>\r\n </div>\r\n <div class=\"inner-value label\">\r\n longitude\r\n </div>\r\n </span>\r\n </div>\r\n <div class=\"coordinate-item\">\r\n <mat-icon color=\"primary\">zoom_in_map</mat-icon>\r\n <span class=\"value\">\r\n <div class=\"inner-value\">\r\n {{ value?.coords?.accuracy | number:'1.0-0' }}\r\n <span class=\"unit\">m</span>\r\n </div>\r\n <div class=\"inner-value label\">\r\n accuracy\r\n </div>\r\n </span>\r\n </div>\r\n }\r\n <button mat-flat-button [disabled]=\"isReadOnly()\" (click)=\"getLocation()\">\r\n {{ empty ? 'Get Location' : 'Update Location' }}\r\n <mat-icon>my_location</mat-icon>\r\n </button>\r\n</div>\r\n","import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';\r\nimport { FormGroup, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport type { FormBuilderFunctions, ITowerStepColumn } from 'ngx-t-forms-types';\r\nimport { TFormInputStatusComponent } from '../../../t-form-input-status/t-form-input-status.component';\r\nimport { GeoLocationFormInputComponent } from './elements/geo-location-form-input/geo-location-form-input.component';\r\nimport { getInputErrorMessage } from '../../../../services/core/t-input-controller/functions/inputErrorMessage';\r\n\r\n/** Wraps the inner geo-location control inside a `mat-form-field`. */\r\n@Component({\r\n selector: 'lib-geo-location',\r\n templateUrl: './geo-location.component.html',\r\n styleUrl: './geo-location.component.css',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [\r\n ReactiveFormsModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatButtonModule,\r\n MatTooltipModule,\r\n TFormInputStatusComponent,\r\n GeoLocationFormInputComponent,\r\n ],\r\n})\r\nexport class GeoLocationComponent {\r\n readonly inputConfig = input.required<ITowerStepColumn>();\r\n readonly formGroup = input.required<FormGroup>();\r\n readonly editorMode = input<boolean>(false);\r\n readonly formBuilderFunctions = input<FormBuilderFunctions | undefined>(undefined);\r\n readonly reload = output<void>();\r\n\r\n protected readonly errorMessage = computed(() =>\r\n getInputErrorMessage(this.inputConfig(), this.formGroup()),\r\n );\r\n}\r\n","<form [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as inputConfig) {\r\n <mat-form-field [appearance]=\"inputConfig.appearance || 'fill'\" subscriptSizing=\"dynamic\">\r\n <mat-label>\r\n {{ inputConfig.label }}\r\n <lib-t-form-input-status [inputConfig]=\"inputConfig\"></lib-t-form-input-status>\r\n </mat-label>\r\n\r\n <lib-geo-location-form-input\r\n [inputConfig]=\"inputConfig\"\r\n [formControlName]=\"inputConfig.id\"\r\n [required]=\"inputConfig.required\"\r\n ></lib-geo-location-form-input>\r\n\r\n @if (inputConfig.hintLabel || inputConfig.temporaryHint) {\r\n <mat-hint class=\"inputHint\">\r\n {{ inputConfig.temporaryHint || inputConfig.hintLabel }}\r\n </mat-hint>\r\n }\r\n\r\n @if (!!errorMessage()) {\r\n <mat-error class=\"oneLineTextEllipsis\" matTooltipClass=\"errorToolTip\">{{ errorMessage() }}</mat-error>\r\n }\r\n\r\n @if (inputConfig.canReload?.canReload) {\r\n <button\r\n mat-icon-button\r\n style=\"margin-right: 4px;\"\r\n matTooltip=\"Click to refresh this field.\"\r\n class=\"input-sync-button\"\r\n (click)=\"inputConfig.canReload.emit()\"\r\n matSuffix\r\n >\r\n <mat-icon style=\"color: var(--mat-sys-primary)\">sync</mat-icon>\r\n </button>\r\n }\r\n\r\n @if (inputConfig.prefixIcon) {\r\n <mat-icon matPrefix>{{ inputConfig.prefixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.suffixIcon && inputConfig.id !== 'password') {\r\n <mat-icon matSuffix>{{ inputConfig.suffixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.prefixText) {\r\n <span matPrefix style=\"padding: 0 12px;\">{{ inputConfig.prefixText }}</span>\r\n }\r\n @if (inputConfig.suffixText) {\r\n <span matSuffix style=\"padding: 0 12px;\">{{ inputConfig.suffixText }}</span>\r\n }\r\n\r\n @if (inputConfig.maxLength && formGroup()) {\r\n <mat-hint align=\"end\">\r\n {{ (formGroup().controls[inputConfig.id]?.value?.length || 0) + '/' + inputConfig.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AA,EAAA,WAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACf,gBAAgB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,UAAA,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,oBAAA,EAAA,4BAAA,EAAA,oBAAA,EAAA,qBAAA,EAAA,qBAAA,EAAA,yBAAA,EAAA,YAAA,EAAA,iBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAChB,yBAAyB,6FACzB,6BAA6B,EAAA,QAAA,EAAA,6BAAA,EAAA,MAAA,EAAA,CAAA,sBAAA,EAAA,aAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAGpB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAfhC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,EAAA,eAAA,EAGX,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC;wBACP,mBAAmB;wBACnB,kBAAkB;wBAClB,aAAa;wBACb,eAAe;wBACf,gBAAgB;wBAChB,yBAAyB;wBACzB,6BAA6B;AAC9B,qBAAA,EAAA,QAAA,EAAA,6sEAAA,EAAA,MAAA,EAAA,CAAA,0IAAA,CAAA,EAAA;;;;;"}
|
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { input, output, signal, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import * as i3 from '@angular/material/icon';
|
|
4
4
|
import { MatIconModule } from '@angular/material/icon';
|
|
5
|
-
import { K as buildTokenMaps, L as bindableFields, M as fieldEditorBindings, O as mapTemplateTokens, J as JsonEditorComponent } from './ngx-t-forms-ngx-t-forms-
|
|
5
|
+
import { K as buildTokenMaps, L as bindableFields, M as fieldEditorBindings, O as mapTemplateTokens, J as JsonEditorComponent } from './ngx-t-forms-ngx-t-forms-CaVyRedJ.mjs';
|
|
6
6
|
|
|
7
7
|
/** True for a value a header can actually carry. */
|
|
8
8
|
function isScalar(value) {
|
|
@@ -155,4 +155,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
155
155
|
}], propDecorators: { kind: [{ type: i0.Input, args: [{ isSignal: true, alias: "kind", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], defaultTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultTemplate", required: false }] }], formInputs: [{ type: i0.Input, args: [{ isSignal: true, alias: "formInputs", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], showHint: [{ type: i0.Input, args: [{ isSignal: true, alias: "showHint", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], valueChanged: [{ type: i0.Output, args: ["valueChanged"] }] } });
|
|
156
156
|
|
|
157
157
|
export { HeaderTemplateEditorComponent };
|
|
158
|
-
//# sourceMappingURL=ngx-t-forms-header-template-editor.component-
|
|
158
|
+
//# sourceMappingURL=ngx-t-forms-header-template-editor.component-NJLm6jkA.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-t-forms-header-template-editor.component-D78_YC80.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/header-template-editor/flatten-header-template.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/header-template-editor/header-template-editor.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/header-template-editor/header-template-editor.component.html"],"sourcesContent":["/**\r\n * @file Flattening + validation for the request-header JSON editor.\r\n *\r\n * A {@link HeaderTemplate} is a flat `name → scalar` map, but the editor beneath\r\n * it is a general JSON editor: the author can type anything that parses. This\r\n * module is the narrow gate between the two — it accepts what a header map can\r\n * express and reports, per key, what it had to reject, so the editor can say\r\n * *which* header is wrong instead of silently dropping it.\r\n *\r\n * Kept separate from the component so it stays trivially unit-testable and free\r\n * of Angular.\r\n */\r\nimport type { HeaderTemplate, HeaderTemplateValue } from 'ngx-t-forms-types';\r\n\r\n/** The outcome of narrowing an edited JSON document to a header map. */\r\nexport interface HeaderTemplateNarrowing {\r\n /** The header entries that are expressible; always safe to persist. */\r\n readonly template: HeaderTemplate;\r\n /**\r\n * Human-readable complaints, one per rejected entry (nested object/array value,\r\n * or a blank header name). Empty when the document is a clean header map.\r\n */\r\n readonly problems: readonly string[];\r\n}\r\n\r\n/** True for a value a header can actually carry. */\r\nfunction isScalar(value: unknown): value is HeaderTemplateValue {\r\n return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';\r\n}\r\n\r\n/** The words a complaint uses for the thing being narrowed. */\r\nexport interface NarrowingNouns {\r\n /** e.g. `'header'` / `'query parameter'`. */\r\n readonly singular: string;\r\n /** Sentence-initial plural, e.g. `'Headers'` / `'Query parameters'`. */\r\n readonly plural: string;\r\n}\r\n\r\nconst HEADER_NOUNS: NarrowingNouns = { singular: 'header', plural: 'Headers' };\r\n\r\n/**\r\n * Narrows a parsed JSON document to a {@link HeaderTemplate} (or its structural\r\n * twin, a `QueryTemplate` — pass query nouns so complaints name the right thing).\r\n *\r\n * Rejects — rather than coerces — anything the flat shape cannot carry: an array\r\n * root, a nested object/array value, or a blank name. Coercing would produce an\r\n * entry the endpoint silently misreads (`\"[object Object]\"`), so the entry is\r\n * dropped and named in `problems` instead.\r\n *\r\n * @param value - The parsed editor document.\r\n * @param nouns - The words complaints use (defaults to header phrasing).\r\n * @returns The expressible entries plus a complaint per rejected one.\r\n */\r\nexport function narrowHeaderTemplate(\r\n value: unknown,\r\n nouns: NarrowingNouns = HEADER_NOUNS,\r\n): HeaderTemplateNarrowing {\r\n const template: Record<string, HeaderTemplateValue> = {};\r\n const problems: string[] = [];\r\n\r\n if (Array.isArray(value) || value === null || typeof value !== 'object') {\r\n return { template, problems: [`${nouns.plural} must be a JSON object of \"name\": \"value\" pairs.`] };\r\n }\r\n\r\n for (const [rawName, rawValue] of Object.entries(value as Record<string, unknown>)) {\r\n const name = rawName.trim();\r\n if (name === '') {\r\n problems.push(`A ${nouns.singular} name cannot be blank.`);\r\n continue;\r\n }\r\n if (rawValue === null || rawValue === undefined) {\r\n problems.push(`\"${name}\" has no value.`);\r\n continue;\r\n }\r\n if (!isScalar(rawValue)) {\r\n problems.push(`\"${name}\" must be a single text value — objects and lists cannot be sent as a ${nouns.singular}.`);\r\n continue;\r\n }\r\n template[name] = rawValue;\r\n }\r\n\r\n return { template, problems };\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ViewEncapsulation,\r\n computed,\r\n input,\r\n output,\r\n signal,\r\n} from '@angular/core';\r\nimport { MatIconModule } from '@angular/material/icon';\r\n\r\nimport type { FormColumnInputs, HeaderTemplate } from 'ngx-t-forms-types';\r\n\r\nimport type { IConfigElementError } from '../../t-dynamic-data-edit.component';\r\nimport { bindableFields, fieldEditorBindings } from '../_shared/field-bindings';\r\nimport {\r\n JsonEditorComponent,\r\n type EditorBinding,\r\n type JsonEditorChange,\r\n} from '../json-editor/json-editor.component';\r\nimport { buildTokenMaps, mapTemplateTokens } from '../payload-template-editor/token-transform';\r\nimport { narrowHeaderTemplate } from './flatten-header-template';\r\n\r\n/** Shown when nothing has been authored and the endpoint captured no headers. */\r\nconst EMPTY_SKELETON: HeaderTemplate = { 'Content-Type': 'application/json' };\r\n\r\n/**\r\n * Shown when nothing has been authored and the endpoint's URL captured no query\r\n * params. A blank literal is dropped at resolve time, so the skeleton teaches\r\n * the shape without ever sending anything.\r\n */\r\nconst QUERY_SKELETON: HeaderTemplate = { search: '' };\r\n\r\n/**\r\n * Editor for a value/options fetch's `headerTemplate` — and, via\r\n * `kind=\"query\"`, its `queryTemplate` (the exact structural twin: a flat\r\n * `name → scalar` map with the same `{{inputId}}` token grammar).\r\n *\r\n * Shares the {@link JsonEditorComponent} and the friendly-label token transform\r\n * with the payload-template editor, so binding a header to a live field is the\r\n * same gesture as binding a payload field: type `$`, pick the field, and the\r\n * editor inserts its `{{token}}`. Unlike a payload it enforces a **flat**\r\n * `name → text` shape — a header has no structure to nest into — and names any\r\n * entry it had to reject rather than dropping it silently.\r\n *\r\n * Applies to GET as well as POST; which slot it edits is decided upstream by the\r\n * element-editor descriptor, so this component owns no mode toggle.\r\n *\r\n * @example\r\n * <lib-header-template-editor [value]=\"headers()\" [formInputs]=\"inputs()\"\r\n * (valueChanged)=\"onHeaders($event)\" />\r\n * @example\r\n * <lib-header-template-editor kind=\"query\" [value]=\"query()\"\r\n * [formInputs]=\"inputs()\" (valueChanged)=\"onQuery($event)\" />\r\n */\r\n@Component({\r\n selector: 'lib-header-template-editor',\r\n templateUrl: './header-template-editor.component.html',\r\n styleUrl: './header-template-editor.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.Emulated,\r\n host: { class: 'lib-header-template-editor' },\r\n imports: [MatIconModule, JsonEditorComponent],\r\n})\r\nexport class HeaderTemplateEditorComponent {\r\n /**\r\n * What the flat map configures: request headers (default) or URL query\r\n * parameters. Selects the empty skeleton, the hint copy, and the noun used\r\n * in shape complaints — the editing behaviour is otherwise identical.\r\n */\r\n readonly kind = input<'headers' | 'query'>('headers');\r\n\r\n /** Current header template (`undefined` when nothing has been authored yet). */\r\n readonly value = input<HeaderTemplate | undefined>(undefined);\r\n\r\n /**\r\n * Default shown when nothing has been authored yet — the endpoint's captured\r\n * headers, when the collection carried any. Falls back to a one-line skeleton\r\n * so the editor never opens blank.\r\n */\r\n readonly defaultTemplate = input<HeaderTemplate | undefined>(undefined);\r\n\r\n /** All form inputs, offered as insertable `{{inputId}}` bindings. */\r\n readonly formInputs = input<readonly FormColumnInputs[]>([]);\r\n\r\n /** Disables the editor. */\r\n readonly disabled = input<boolean>(false);\r\n\r\n /**\r\n * Shows the built-in instruction line. A host that provides its own copy for\r\n * this editor (the endpoint dialog's per-tab hint) passes `false` so the\r\n * author reads ONE instruction, not two stacked ones.\r\n */\r\n readonly showHint = input<boolean>(true);\r\n\r\n /** Validation errors surfaced by the parent editor. */\r\n readonly errors = input<IConfigElementError[] | undefined>([]);\r\n\r\n /** Optional id supplied by the parent editor. */\r\n readonly id = input<string | undefined>(undefined);\r\n\r\n /** Emits the narrowed header map on every valid edit. */\r\n readonly valueChanged = output<HeaderTemplate>();\r\n\r\n /** Per-entry complaints from the last edit (nested value, blank name, …). */\r\n protected readonly shapeProblems = signal<readonly string[]>([]);\r\n\r\n /** id⇄label token maps (safe + unique labels only; everything else stays a raw id). */\r\n readonly #tokenMaps = computed(() => buildTokenMaps(bindableFields(this.formInputs())));\r\n\r\n /** Field bindings for the JSON editor's `$`-trigger picker. */\r\n protected readonly editorBindings = computed<readonly EditorBinding[]>(() =>\r\n fieldEditorBindings(this.formInputs(), this.#tokenMaps().idToLabel),\r\n );\r\n\r\n /**\r\n * The value the JSON editor renders — the authored headers, the endpoint's\r\n * captured ones, or the skeleton — with stored `{{id}}` tokens rewritten to the\r\n * friendly `{{Label}}` form for display.\r\n */\r\n protected readonly editorValue = computed<object | undefined>(() => {\r\n const authored = this.value();\r\n const skeleton = this.kind() === 'query' ? QUERY_SKELETON : EMPTY_SKELETON;\r\n const source = authored ?? this.defaultTemplate() ?? skeleton;\r\n return mapTemplateTokens(source, this.#tokenMaps().idToLabel) as object;\r\n });\r\n\r\n /**\r\n * Commit a valid edit: narrow the document to a flat map, then rewrite the\r\n * friendly `{{Label}}` tokens back to the stored `{{id}}` form before\r\n * emitting. Invalid JSON is ignored (the last valid map stays in effect);\r\n * entries the flat shape cannot carry are reported rather than persisted.\r\n */\r\n protected onEditorChange(change: JsonEditorChange): void {\r\n if (!change.valid) return;\r\n const nouns =\r\n this.kind() === 'query'\r\n ? ({ singular: 'query parameter', plural: 'Query parameters' } as const)\r\n : undefined;\r\n const { template, problems } = narrowHeaderTemplate(change.value, nouns);\r\n this.shapeProblems.set(problems);\r\n const stored = mapTemplateTokens(template, this.#tokenMaps().labelToId);\r\n this.valueChanged.emit(stored);\r\n }\r\n}\r\n","<div class=\"header-editor\">\r\n @if (showHint()) {\r\n <p class=\"hint-line\">\r\n <mat-icon class=\"info-icon\">info</mat-icon>\r\n @if (kind() === 'query') {\r\n <span>Author the URL query parameters as JSON — one <code>\"name\": \"value\"</code> pair per\r\n parameter. Type <code>$</code> to bind a value to a field; the request waits until every\r\n bound field has a value.</span>\r\n } @else {\r\n <span>Author the request headers as JSON — one <code>\"name\": \"value\"</code> pair per header.\r\n Type <code>$</code> to bind a value to a field; the request waits until every bound field\r\n has a value.</span>\r\n }\r\n </p>\r\n }\r\n\r\n <lib-json-editor\r\n height=\"260px\"\r\n [value]=\"editorValue()\"\r\n [bindings]=\"editorBindings()\"\r\n [disabled]=\"disabled()\"\r\n (valueChange)=\"onEditorChange($event)\" />\r\n\r\n @for (problem of shapeProblems(); track $index) {\r\n <p class=\"error-line\"><span>{{ problem }}</span></p>\r\n }\r\n\r\n @for (error of errors(); track $index) {\r\n <p class=\"error-line\"><span>{{ error.message }}</span></p>\r\n }\r\n</div>\r\n"],"names":[],"mappings":";;;;;;AAyBA;AACA,SAAS,QAAQ,CAAC,KAAc,EAAA;AAC9B,IAAA,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS;AAC7F;AAUA,MAAM,YAAY,GAAmB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE;AAE9E;;;;;;;;;;;;AAYG;SACa,oBAAoB,CAClC,KAAc,EACd,QAAwB,YAAY,EAAA;IAEpC,MAAM,QAAQ,GAAwC,EAAE;IACxD,MAAM,QAA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A,ioBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,ED+BY,aAAa,oLAAE,mBAAmB,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA,aAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAEjC,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBATzC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,4BAA4B,mBAGrB,uBAAuB,CAAC,MAAM,EAAA,aAAA,EAChC,iBAAiB,CAAC,QAAQ,EAAA,IAAA,EACnC,EAAE,KAAK,EAAE,4BAA4B,EAAE,EAAA,OAAA,EACpC,CAAC,aAAa,EAAE,mBAAmB,CAAC,EAAA,QAAA,EAAA,ipCAAA,EAAA,MAAA,EAAA,CAAA,ioBAAA,CAAA,EAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-t-forms-header-template-editor.component-NJLm6jkA.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/header-template-editor/flatten-header-template.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/header-template-editor/header-template-editor.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/header-template-editor/header-template-editor.component.html"],"sourcesContent":["/**\r\n * @file Flattening + validation for the request-header JSON editor.\r\n *\r\n * A {@link HeaderTemplate} is a flat `name → scalar` map, but the editor beneath\r\n * it is a general JSON editor: the author can type anything that parses. This\r\n * module is the narrow gate between the two — it accepts what a header map can\r\n * express and reports, per key, what it had to reject, so the editor can say\r\n * *which* header is wrong instead of silently dropping it.\r\n *\r\n * Kept separate from the component so it stays trivially unit-testable and free\r\n * of Angular.\r\n */\r\nimport type { HeaderTemplate, HeaderTemplateValue } from 'ngx-t-forms-types';\r\n\r\n/** The outcome of narrowing an edited JSON document to a header map. */\r\nexport interface HeaderTemplateNarrowing {\r\n /** The header entries that are expressible; always safe to persist. */\r\n readonly template: HeaderTemplate;\r\n /**\r\n * Human-readable complaints, one per rejected entry (nested object/array value,\r\n * or a blank header name). Empty when the document is a clean header map.\r\n */\r\n readonly problems: readonly string[];\r\n}\r\n\r\n/** True for a value a header can actually carry. */\r\nfunction isScalar(value: unknown): value is HeaderTemplateValue {\r\n return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';\r\n}\r\n\r\n/** The words a complaint uses for the thing being narrowed. */\r\nexport interface NarrowingNouns {\r\n /** e.g. `'header'` / `'query parameter'`. */\r\n readonly singular: string;\r\n /** Sentence-initial plural, e.g. `'Headers'` / `'Query parameters'`. */\r\n readonly plural: string;\r\n}\r\n\r\nconst HEADER_NOUNS: NarrowingNouns = { singular: 'header', plural: 'Headers' };\r\n\r\n/**\r\n * Narrows a parsed JSON document to a {@link HeaderTemplate} (or its structural\r\n * twin, a `QueryTemplate` — pass query nouns so complaints name the right thing).\r\n *\r\n * Rejects — rather than coerces — anything the flat shape cannot carry: an array\r\n * root, a nested object/array value, or a blank name. Coercing would produce an\r\n * entry the endpoint silently misreads (`\"[object Object]\"`), so the entry is\r\n * dropped and named in `problems` instead.\r\n *\r\n * @param value - The parsed editor document.\r\n * @param nouns - The words complaints use (defaults to header phrasing).\r\n * @returns The expressible entries plus a complaint per rejected one.\r\n */\r\nexport function narrowHeaderTemplate(\r\n value: unknown,\r\n nouns: NarrowingNouns = HEADER_NOUNS,\r\n): HeaderTemplateNarrowing {\r\n const template: Record<string, HeaderTemplateValue> = {};\r\n const problems: string[] = [];\r\n\r\n if (Array.isArray(value) || value === null || typeof value !== 'object') {\r\n return { template, problems: [`${nouns.plural} must be a JSON object of \"name\": \"value\" pairs.`] };\r\n }\r\n\r\n for (const [rawName, rawValue] of Object.entries(value as Record<string, unknown>)) {\r\n const name = rawName.trim();\r\n if (name === '') {\r\n problems.push(`A ${nouns.singular} name cannot be blank.`);\r\n continue;\r\n }\r\n if (rawValue === null || rawValue === undefined) {\r\n problems.push(`\"${name}\" has no value.`);\r\n continue;\r\n }\r\n if (!isScalar(rawValue)) {\r\n problems.push(`\"${name}\" must be a single text value — objects and lists cannot be sent as a ${nouns.singular}.`);\r\n continue;\r\n }\r\n template[name] = rawValue;\r\n }\r\n\r\n return { template, problems };\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ViewEncapsulation,\r\n computed,\r\n input,\r\n output,\r\n signal,\r\n} from '@angular/core';\r\nimport { MatIconModule } from '@angular/material/icon';\r\n\r\nimport type { FormColumnInputs, HeaderTemplate } from 'ngx-t-forms-types';\r\n\r\nimport type { IConfigElementError } from '../../t-dynamic-data-edit.component';\r\nimport { bindableFields, fieldEditorBindings } from '../_shared/field-bindings';\r\nimport {\r\n JsonEditorComponent,\r\n type EditorBinding,\r\n type JsonEditorChange,\r\n} from '../json-editor/json-editor.component';\r\nimport { buildTokenMaps, mapTemplateTokens } from '../payload-template-editor/token-transform';\r\nimport { narrowHeaderTemplate } from './flatten-header-template';\r\n\r\n/** Shown when nothing has been authored and the endpoint captured no headers. */\r\nconst EMPTY_SKELETON: HeaderTemplate = { 'Content-Type': 'application/json' };\r\n\r\n/**\r\n * Shown when nothing has been authored and the endpoint's URL captured no query\r\n * params. A blank literal is dropped at resolve time, so the skeleton teaches\r\n * the shape without ever sending anything.\r\n */\r\nconst QUERY_SKELETON: HeaderTemplate = { search: '' };\r\n\r\n/**\r\n * Editor for a value/options fetch's `headerTemplate` — and, via\r\n * `kind=\"query\"`, its `queryTemplate` (the exact structural twin: a flat\r\n * `name → scalar` map with the same `{{inputId}}` token grammar).\r\n *\r\n * Shares the {@link JsonEditorComponent} and the friendly-label token transform\r\n * with the payload-template editor, so binding a header to a live field is the\r\n * same gesture as binding a payload field: type `$`, pick the field, and the\r\n * editor inserts its `{{token}}`. Unlike a payload it enforces a **flat**\r\n * `name → text` shape — a header has no structure to nest into — and names any\r\n * entry it had to reject rather than dropping it silently.\r\n *\r\n * Applies to GET as well as POST; which slot it edits is decided upstream by the\r\n * element-editor descriptor, so this component owns no mode toggle.\r\n *\r\n * @example\r\n * <lib-header-template-editor [value]=\"headers()\" [formInputs]=\"inputs()\"\r\n * (valueChanged)=\"onHeaders($event)\" />\r\n * @example\r\n * <lib-header-template-editor kind=\"query\" [value]=\"query()\"\r\n * [formInputs]=\"inputs()\" (valueChanged)=\"onQuery($event)\" />\r\n */\r\n@Component({\r\n selector: 'lib-header-template-editor',\r\n templateUrl: './header-template-editor.component.html',\r\n styleUrl: './header-template-editor.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.Emulated,\r\n host: { class: 'lib-header-template-editor' },\r\n imports: [MatIconModule, JsonEditorComponent],\r\n})\r\nexport class HeaderTemplateEditorComponent {\r\n /**\r\n * What the flat map configures: request headers (default) or URL query\r\n * parameters. Selects the empty skeleton, the hint copy, and the noun used\r\n * in shape complaints — the editing behaviour is otherwise identical.\r\n */\r\n readonly kind = input<'headers' | 'query'>('headers');\r\n\r\n /** Current header template (`undefined` when nothing has been authored yet). */\r\n readonly value = input<HeaderTemplate | undefined>(undefined);\r\n\r\n /**\r\n * Default shown when nothing has been authored yet — the endpoint's captured\r\n * headers, when the collection carried any. Falls back to a one-line skeleton\r\n * so the editor never opens blank.\r\n */\r\n readonly defaultTemplate = input<HeaderTemplate | undefined>(undefined);\r\n\r\n /** All form inputs, offered as insertable `{{inputId}}` bindings. */\r\n readonly formInputs = input<readonly FormColumnInputs[]>([]);\r\n\r\n /** Disables the editor. */\r\n readonly disabled = input<boolean>(false);\r\n\r\n /**\r\n * Shows the built-in instruction line. A host that provides its own copy for\r\n * this editor (the endpoint dialog's per-tab hint) passes `false` so the\r\n * author reads ONE instruction, not two stacked ones.\r\n */\r\n readonly showHint = input<boolean>(true);\r\n\r\n /** Validation errors surfaced by the parent editor. */\r\n readonly errors = input<IConfigElementError[] | undefined>([]);\r\n\r\n /** Optional id supplied by the parent editor. */\r\n readonly id = input<string | undefined>(undefined);\r\n\r\n /** Emits the narrowed header map on every valid edit. */\r\n readonly valueChanged = output<HeaderTemplate>();\r\n\r\n /** Per-entry complaints from the last edit (nested value, blank name, …). */\r\n protected readonly shapeProblems = signal<readonly string[]>([]);\r\n\r\n /** id⇄label token maps (safe + unique labels only; everything else stays a raw id). */\r\n readonly #tokenMaps = computed(() => buildTokenMaps(bindableFields(this.formInputs())));\r\n\r\n /** Field bindings for the JSON editor's `$`-trigger picker. */\r\n protected readonly editorBindings = computed<readonly EditorBinding[]>(() =>\r\n fieldEditorBindings(this.formInputs(), this.#tokenMaps().idToLabel),\r\n );\r\n\r\n /**\r\n * The value the JSON editor renders — the authored headers, the endpoint's\r\n * captured ones, or the skeleton — with stored `{{id}}` tokens rewritten to the\r\n * friendly `{{Label}}` form for display.\r\n */\r\n protected readonly editorValue = computed<object | undefined>(() => {\r\n const authored = this.value();\r\n const skeleton = this.kind() === 'query' ? QUERY_SKELETON : EMPTY_SKELETON;\r\n const source = authored ?? this.defaultTemplate() ?? skeleton;\r\n return mapTemplateTokens(source, this.#tokenMaps().idToLabel) as object;\r\n });\r\n\r\n /**\r\n * Commit a valid edit: narrow the document to a flat map, then rewrite the\r\n * friendly `{{Label}}` tokens back to the stored `{{id}}` form before\r\n * emitting. Invalid JSON is ignored (the last valid map stays in effect);\r\n * entries the flat shape cannot carry are reported rather than persisted.\r\n */\r\n protected onEditorChange(change: JsonEditorChange): void {\r\n if (!change.valid) return;\r\n const nouns =\r\n this.kind() === 'query'\r\n ? ({ singular: 'query parameter', plural: 'Query parameters' } as const)\r\n : undefined;\r\n const { template, problems } = narrowHeaderTemplate(change.value, nouns);\r\n this.shapeProblems.set(problems);\r\n const stored = mapTemplateTokens(template, this.#tokenMaps().labelToId);\r\n this.valueChanged.emit(stored);\r\n }\r\n}\r\n","<div class=\"header-editor\">\r\n @if (showHint()) {\r\n <p class=\"hint-line\">\r\n <mat-icon class=\"info-icon\">info</mat-icon>\r\n @if (kind() === 'query') {\r\n <span>Author the URL query parameters as JSON — one <code>\"name\": \"value\"</code> pair per\r\n parameter. Type <code>$</code> to bind a value to a field; the request waits until every\r\n bound field has a value.</span>\r\n } @else {\r\n <span>Author the request headers as JSON — one <code>\"name\": \"value\"</code> pair per header.\r\n Type <code>$</code> to bind a value to a field; the request waits until every bound field\r\n has a value.</span>\r\n }\r\n </p>\r\n }\r\n\r\n <lib-json-editor\r\n height=\"260px\"\r\n [value]=\"editorValue()\"\r\n [bindings]=\"editorBindings()\"\r\n [disabled]=\"disabled()\"\r\n (valueChange)=\"onEditorChange($event)\" />\r\n\r\n @for (problem of shapeProblems(); track $index) {\r\n <p class=\"error-line\"><span>{{ problem }}</span></p>\r\n }\r\n\r\n @for (error of errors(); track $index) {\r\n <p class=\"error-line\"><span>{{ error.message }}</span></p>\r\n }\r\n</div>\r\n"],"names":[],"mappings":";;;;;;AAyBA;AACA,SAAS,QAAQ,CAAC,KAAc,EAAA;AAC9B,IAAA,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS;AAC7F;AAUA,MAAM,YAAY,GAAmB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE;AAE9E;;;;;;;;;;;;AAYG;SACa,oBAAoB,CAClC,KAAc,EACd,QAAwB,YAAY,EAAA;IAEpC,MAAM,QAAQ,GAAwC,EAAE;IACxD,MAAM,QAAQ,GAAa,EAAE;AAE7B,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACvE,QAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAA,EAAG,KAAK,CAAC,MAAM,CAAA,gDAAA,C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CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAEjC,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBATzC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,4BAA4B,mBAGrB,uBAAuB,CAAC,MAAM,EAAA,aAAA,EAChC,iBAAiB,CAAC,QAAQ,EAAA,IAAA,EACnC,EAAE,KAAK,EAAE,4BAA4B,EAAE,EAAA,OAAA,EACpC,CAAC,aAAa,EAAE,mBAAmB,CAAC,EAAA,QAAA,EAAA,ipCAAA,EAAA,MAAA,EAAA,CAAA,ioBAAA,CAAA,EAAA;;;;;"}
|
|
@@ -10,7 +10,7 @@ import * as i2 from '@angular/material/button';
|
|
|
10
10
|
import { MatButtonModule } from '@angular/material/button';
|
|
11
11
|
import * as i5 from '@angular/material/tooltip';
|
|
12
12
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
13
|
-
import { B as BaseCustomInput,
|
|
13
|
+
import { B as BaseCustomInput, a4 as getInputErrorMessage, a5 as TFormInputStatusComponent } from './ngx-t-forms-ngx-t-forms-CaVyRedJ.mjs';
|
|
14
14
|
import { isPlatformBrowser } from '@angular/common';
|
|
15
15
|
import * as i8 from '@angular/material/toolbar';
|
|
16
16
|
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
@@ -174,7 +174,7 @@ class ImageCaptureInputElementComponent {
|
|
|
174
174
|
this.errorMessage = computed(() => getInputErrorMessage(this.inputConfig(), this.formGroup()), ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
175
175
|
}
|
|
176
176
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ImageCaptureInputElementComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
177
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: ImageCaptureInputElementComponent, isStandalone: true, selector: "lib-image-capture-input-element", inputs: { inputConfig: { classPropertyName: "inputConfig", publicName: "inputConfig", isSignal: true, isRequired: true, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { reload: "reload" }, ngImport: i0, template: "<ng-container [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as inputConfig) {\r\n <mat-form-field [appearance]=\"inputConfig.appearance || 'fill'\" subscriptSizing=\"dynamic\">\r\n <mat-label>\r\n {{ inputConfig.label }}\r\n <lib-t-form-input-status [inputConfig]=\"inputConfig\"></lib-t-form-input-status>\r\n </mat-label>\r\n\r\n <lib-camera-capture\r\n [required]=\"inputConfig.required\"\r\n [inputConfig]=\"inputConfig\"\r\n [formControlName]=\"inputConfig.id\"\r\n ></lib-camera-capture>\r\n\r\n @if (inputConfig.hintLabel || inputConfig.temporaryHint) {\r\n <mat-hint class=\"inputHint\">\r\n {{ inputConfig.temporaryHint || inputConfig.hintLabel }}\r\n </mat-hint>\r\n }\r\n\r\n @if (!!errorMessage()) {\r\n <mat-error class=\"oneLineTextEllipsis\" matTooltipClass=\"errorToolTip\">{{ errorMessage() }}</mat-error>\r\n }\r\n\r\n @if (inputConfig.canReload?.canReload) {\r\n <button\r\n mat-icon-button\r\n style=\"margin-right: 4px;\"\r\n matTooltip=\"Click to refresh this field.\"\r\n class=\"input-sync-button\"\r\n (click)=\"inputConfig.canReload.emit()\"\r\n matSuffix\r\n >\r\n <mat-icon style=\"color: var(--mat-sys-primary)\">sync</mat-icon>\r\n </button>\r\n }\r\n\r\n @if (inputConfig.prefixIcon) {\r\n <mat-icon matPrefix>{{ inputConfig.prefixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.suffixIcon && inputConfig.id !== 'password') {\r\n <mat-icon matSuffix>{{ inputConfig.suffixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.prefixText) {\r\n <span matPrefix style=\"
|
|
177
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: ImageCaptureInputElementComponent, isStandalone: true, selector: "lib-image-capture-input-element", inputs: { inputConfig: { classPropertyName: "inputConfig", publicName: "inputConfig", isSignal: true, isRequired: true, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { reload: "reload" }, ngImport: i0, template: "<ng-container [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as inputConfig) {\r\n <mat-form-field [appearance]=\"inputConfig.appearance || 'fill'\" subscriptSizing=\"dynamic\">\r\n <mat-label>\r\n {{ inputConfig.label }}\r\n <lib-t-form-input-status [inputConfig]=\"inputConfig\"></lib-t-form-input-status>\r\n </mat-label>\r\n\r\n <lib-camera-capture\r\n [required]=\"inputConfig.required\"\r\n [inputConfig]=\"inputConfig\"\r\n [formControlName]=\"inputConfig.id\"\r\n ></lib-camera-capture>\r\n\r\n @if (inputConfig.hintLabel || inputConfig.temporaryHint) {\r\n <mat-hint class=\"inputHint\">\r\n {{ inputConfig.temporaryHint || inputConfig.hintLabel }}\r\n </mat-hint>\r\n }\r\n\r\n @if (!!errorMessage()) {\r\n <mat-error class=\"oneLineTextEllipsis\" matTooltipClass=\"errorToolTip\">{{ errorMessage() }}</mat-error>\r\n }\r\n\r\n @if (inputConfig.canReload?.canReload) {\r\n <button\r\n mat-icon-button\r\n style=\"margin-right: 4px;\"\r\n matTooltip=\"Click to refresh this field.\"\r\n class=\"input-sync-button\"\r\n (click)=\"inputConfig.canReload.emit()\"\r\n matSuffix\r\n >\r\n <mat-icon style=\"color: var(--mat-sys-primary)\">sync</mat-icon>\r\n </button>\r\n }\r\n\r\n @if (inputConfig.prefixIcon) {\r\n <mat-icon matPrefix>{{ inputConfig.prefixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.suffixIcon && inputConfig.id !== 'password') {\r\n <mat-icon matSuffix>{{ inputConfig.suffixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.prefixText) {\r\n <span matPrefix style=\"padding: 0 12px;\">{{ inputConfig.prefixText }}</span>\r\n }\r\n @if (inputConfig.suffixText) {\r\n <span matSuffix style=\"padding: 0 12px;\">{{ inputConfig.suffixText }}</span>\r\n }\r\n\r\n @if (inputConfig.maxLength && formGroup()) {\r\n <mat-hint align=\"end\">\r\n {{ (formGroup().controls[inputConfig.id]?.value?.length || 0) + '/' + inputConfig.maxLength }}\r\n </mat-hint>\r\n }\r\n </mat-form-field>\r\n }\r\n</ng-container>\r\n", styles: ["mat-form-field{width:100%!important}mat-form-field .input-sync-button{display:none}mat-form-field:hover .input-sync-button{display:inline-block}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: TFormInputStatusComponent, selector: "lib-t-form-input-status", inputs: ["inputConfig"] }, { kind: "component", type: CameraCaptureComponent, selector: "lib-camera-capture", inputs: ["inputConfig"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
178
178
|
}
|
|
179
179
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ImageCaptureInputElementComponent, decorators: [{
|
|
180
180
|
type: Component,
|
|
@@ -186,8 +186,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
186
186
|
MatTooltipModule,
|
|
187
187
|
TFormInputStatusComponent,
|
|
188
188
|
CameraCaptureComponent,
|
|
189
|
-
], template: "<ng-container [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as inputConfig) {\r\n <mat-form-field [appearance]=\"inputConfig.appearance || 'fill'\" subscriptSizing=\"dynamic\">\r\n <mat-label>\r\n {{ inputConfig.label }}\r\n <lib-t-form-input-status [inputConfig]=\"inputConfig\"></lib-t-form-input-status>\r\n </mat-label>\r\n\r\n <lib-camera-capture\r\n [required]=\"inputConfig.required\"\r\n [inputConfig]=\"inputConfig\"\r\n [formControlName]=\"inputConfig.id\"\r\n ></lib-camera-capture>\r\n\r\n @if (inputConfig.hintLabel || inputConfig.temporaryHint) {\r\n <mat-hint class=\"inputHint\">\r\n {{ inputConfig.temporaryHint || inputConfig.hintLabel }}\r\n </mat-hint>\r\n }\r\n\r\n @if (!!errorMessage()) {\r\n <mat-error class=\"oneLineTextEllipsis\" matTooltipClass=\"errorToolTip\">{{ errorMessage() }}</mat-error>\r\n }\r\n\r\n @if (inputConfig.canReload?.canReload) {\r\n <button\r\n mat-icon-button\r\n style=\"margin-right: 4px;\"\r\n matTooltip=\"Click to refresh this field.\"\r\n class=\"input-sync-button\"\r\n (click)=\"inputConfig.canReload.emit()\"\r\n matSuffix\r\n >\r\n <mat-icon style=\"color: var(--mat-sys-primary)\">sync</mat-icon>\r\n </button>\r\n }\r\n\r\n @if (inputConfig.prefixIcon) {\r\n <mat-icon matPrefix>{{ inputConfig.prefixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.suffixIcon && inputConfig.id !== 'password') {\r\n <mat-icon matSuffix>{{ inputConfig.suffixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.prefixText) {\r\n <span matPrefix style=\"
|
|
189
|
+
], template: "<ng-container [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as inputConfig) {\r\n <mat-form-field [appearance]=\"inputConfig.appearance || 'fill'\" subscriptSizing=\"dynamic\">\r\n <mat-label>\r\n {{ inputConfig.label }}\r\n <lib-t-form-input-status [inputConfig]=\"inputConfig\"></lib-t-form-input-status>\r\n </mat-label>\r\n\r\n <lib-camera-capture\r\n [required]=\"inputConfig.required\"\r\n [inputConfig]=\"inputConfig\"\r\n [formControlName]=\"inputConfig.id\"\r\n ></lib-camera-capture>\r\n\r\n @if (inputConfig.hintLabel || inputConfig.temporaryHint) {\r\n <mat-hint class=\"inputHint\">\r\n {{ inputConfig.temporaryHint || inputConfig.hintLabel }}\r\n </mat-hint>\r\n }\r\n\r\n @if (!!errorMessage()) {\r\n <mat-error class=\"oneLineTextEllipsis\" matTooltipClass=\"errorToolTip\">{{ errorMessage() }}</mat-error>\r\n }\r\n\r\n @if (inputConfig.canReload?.canReload) {\r\n <button\r\n mat-icon-button\r\n style=\"margin-right: 4px;\"\r\n matTooltip=\"Click to refresh this field.\"\r\n class=\"input-sync-button\"\r\n (click)=\"inputConfig.canReload.emit()\"\r\n matSuffix\r\n >\r\n <mat-icon style=\"color: var(--mat-sys-primary)\">sync</mat-icon>\r\n </button>\r\n }\r\n\r\n @if (inputConfig.prefixIcon) {\r\n <mat-icon matPrefix>{{ inputConfig.prefixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.suffixIcon && inputConfig.id !== 'password') {\r\n <mat-icon matSuffix>{{ inputConfig.suffixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.prefixText) {\r\n <span matPrefix style=\"padding: 0 12px;\">{{ inputConfig.prefixText }}</span>\r\n }\r\n @if (inputConfig.suffixText) {\r\n <span matSuffix style=\"padding: 0 12px;\">{{ inputConfig.suffixText }}</span>\r\n }\r\n\r\n @if (inputConfig.maxLength && formGroup()) {\r\n <mat-hint align=\"end\">\r\n {{ (formGroup().controls[inputConfig.id]?.value?.length || 0) + '/' + inputConfig.maxLength }}\r\n </mat-hint>\r\n }\r\n </mat-form-field>\r\n }\r\n</ng-container>\r\n", styles: ["mat-form-field{width:100%!important}mat-form-field .input-sync-button{display:none}mat-form-field:hover .input-sync-button{display:inline-block}\n"] }]
|
|
190
190
|
}], propDecorators: { inputConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputConfig", required: true }] }], formGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "formGroup", required: true }] }], reload: [{ type: i0.Output, args: ["reload"] }] } });
|
|
191
191
|
|
|
192
192
|
export { ImageCaptureInputElementComponent };
|
|
193
|
-
//# sourceMappingURL=ngx-t-forms-image-capture-input-element.component-
|
|
193
|
+
//# sourceMappingURL=ngx-t-forms-image-capture-input-element.component-iqPS9cPK.mjs.map
|