ngx-t-forms 0.0.1
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/README.md +27 -0
- package/fesm2022/ngx-t-forms-api-value-access-rules.component-4ZPgovTx.mjs +436 -0
- package/fesm2022/ngx-t-forms-api-value-access-rules.component-4ZPgovTx.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-tCsyuHd3.mjs +311 -0
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-tCsyuHd3.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-C8jU6DUH.mjs +208 -0
- package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-C8jU6DUH.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-convertPostmanCollectionToTree-DktdVBeQ.mjs +29 -0
- package/fesm2022/ngx-t-forms-convertPostmanCollectionToTree-DktdVBeQ.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-form-input-selector.component-6eGpxdN5.mjs +132 -0
- package/fesm2022/ngx-t-forms-form-input-selector.component-6eGpxdN5.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-form-json-view.component-DwEXL85v.mjs +22 -0
- package/fesm2022/ngx-t-forms-form-json-view.component-DwEXL85v.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-form-section-stepper.component-B5gtKLLC.mjs +220 -0
- package/fesm2022/ngx-t-forms-form-section-stepper.component-B5gtKLLC.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-forms-builder-menu.component-Bo1CKQsC.mjs +347 -0
- package/fesm2022/ngx-t-forms-forms-builder-menu.component-Bo1CKQsC.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-getInputIllustration-GCSKx5e5.mjs +9 -0
- package/fesm2022/ngx-t-forms-getInputIllustration-GCSKx5e5.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-input-editor.component-C1kH_GDD.mjs +126 -0
- package/fesm2022/ngx-t-forms-input-editor.component-C1kH_GDD.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-DY7Tsn5l.mjs +88 -0
- package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-DY7Tsn5l.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-mat-slider-editor.component-Dgd5gyUu.mjs +108 -0
- package/fesm2022/ngx-t-forms-mat-slider-editor.component-Dgd5gyUu.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-ClM2gqVq.mjs +153 -0
- package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-ClM2gqVq.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-missing-form-configs.component-DubPFwTw.mjs +32 -0
- package/fesm2022/ngx-t-forms-missing-form-configs.component-DubPFwTw.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-DtmVJG6v.mjs +230 -0
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-DtmVJG6v.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-ngx-t-forms-B-w5W1gG.mjs +9292 -0
- package/fesm2022/ngx-t-forms-ngx-t-forms-B-w5W1gG.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-pipeline-generator.component-DieETx2I.mjs +776 -0
- package/fesm2022/ngx-t-forms-pipeline-generator.component-DieETx2I.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-required-inputs.component-Bi1wJdw3.mjs +188 -0
- package/fesm2022/ngx-t-forms-required-inputs.component-Bi1wJdw3.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-rest-api-call-setup.component-Cd59pfG7.mjs +292 -0
- package/fesm2022/ngx-t-forms-rest-api-call-setup.component-Cd59pfG7.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-section-report.component-CBXHr1qQ.mjs +156 -0
- package/fesm2022/ngx-t-forms-section-report.component-CBXHr1qQ.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-selection-options-editor.component-DBlBUGkw.mjs +143 -0
- package/fesm2022/ngx-t-forms-selection-options-editor.component-DBlBUGkw.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-validators-config.component-gtr6Ohn3.mjs +216 -0
- package/fesm2022/ngx-t-forms-validators-config.component-gtr6Ohn3.mjs.map +1 -0
- package/fesm2022/ngx-t-forms.mjs +2 -0
- package/fesm2022/ngx-t-forms.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/dialog-template/dialog-template.component.d.ts +10 -0
- package/lib/components/form-builder/elements/default-element/default-element.component.d.ts +12 -0
- package/lib/components/form-builder/elements/form-json-view/form-json-view.component.d.ts +9 -0
- package/lib/components/form-builder/elements/form-section-stepper/form-section-stepper.component.d.ts +146 -0
- package/lib/components/form-builder/elements/form-submissions-config/config.d.ts +18 -0
- package/lib/components/form-builder/elements/form-submissions-config/form-submissions-config.component.d.ts +61 -0
- package/lib/components/form-builder/elements/forms-builder-menu/forms-builder-menu.component.d.ts +35 -0
- package/lib/components/form-builder/elements/input-editor/input-editor.component.d.ts +18 -0
- package/lib/components/form-builder/elements/input-element-editor/input-element-editor.component.d.ts +42 -0
- package/lib/components/form-builder/elements/missing-form-configs/missing-form-configs.component.d.ts +12 -0
- package/lib/components/form-builder/elements/section-report/section-report.component.d.ts +23 -0
- package/lib/components/form-builder/elements/select-form-template/select-form-template.component.d.ts +17 -0
- package/lib/components/form-builder/form-builder.component.d.ts +29 -0
- package/lib/components/forms/forms.component.d.ts +44 -0
- package/lib/components/forms/functions/cloneCopyFormInput.d.ts +3 -0
- package/lib/components/forms/functions/elementBlur.d.ts +2 -0
- package/lib/components/forms/functions/elementConfigurationChanged.d.ts +2 -0
- package/lib/components/forms/functions/findFormInput.d.ts +2 -0
- package/lib/components/forms/functions/formHttpSubmissions.d.ts +6 -0
- package/lib/components/forms/functions/selectInputTemplate.d.ts +3 -0
- package/lib/components/forms/store/Form-actions-formBuilder.d.ts +34 -0
- package/lib/components/forms/store/Form-selectors-FormBuilder.d.ts +42 -0
- package/lib/components/forms/store/Forms-Actions.d.ts +75 -0
- package/lib/components/forms/store/Forms-Effects.d.ts +14 -0
- package/lib/components/forms/store/Forms-selectors.d.ts +24 -0
- package/lib/components/forms/store/forms-store.service.d.ts +246 -0
- package/lib/components/index.d.ts +11 -0
- package/lib/components/t-dynamic-data-edit/elements/api-value-access-rules/api-value-access-rules.component.d.ts +59 -0
- package/lib/components/t-dynamic-data-edit/elements/api-value-access-rules/elements/data-tree/data-tree.component.d.ts +60 -0
- package/lib/components/t-dynamic-data-edit/elements/api-value-access-rules/functions/convertDataToTree.d.ts +57 -0
- package/lib/components/t-dynamic-data-edit/elements/api-value-access-rules/functions/extractNodeFromTree.d.ts +3 -0
- package/lib/components/t-dynamic-data-edit/elements/calculated-field-rules/calculated-field-rules.component.d.ts +92 -0
- package/lib/components/t-dynamic-data-edit/elements/config-mscoa-additional-inputs/config-mscoa-additional-inputs.component.d.ts +73 -0
- package/lib/components/t-dynamic-data-edit/elements/form-input-selector/form-input-selector.component.d.ts +48 -0
- package/lib/components/t-dynamic-data-edit/elements/json-editor/json-editor.component.d.ts +26 -0
- package/lib/components/t-dynamic-data-edit/elements/mat-chip-list-editor/mat-chip-list-editor.component.d.ts +43 -0
- package/lib/components/t-dynamic-data-edit/elements/mat-slider-editor/mat-slider-editor.component.d.ts +44 -0
- package/lib/components/t-dynamic-data-edit/elements/mat-slider-toggle-editor/mat-slider-toggle-editor.component.d.ts +48 -0
- package/lib/components/t-dynamic-data-edit/elements/mscoa-segment-config/mscoa-segment-config.component.d.ts +75 -0
- package/lib/components/t-dynamic-data-edit/elements/pipeline-generator/elements/aggregate-stage-editor/aggregate-stage-editor.component.d.ts +33 -0
- package/lib/components/t-dynamic-data-edit/elements/pipeline-generator/pipeline-generator.component.d.ts +92 -0
- package/lib/components/t-dynamic-data-edit/elements/postman-collections/functions/convertPostmanCollectionToTree.d.ts +4 -0
- package/lib/components/t-dynamic-data-edit/elements/postman-collections/functions/filterCollectionItems.d.ts +3 -0
- package/lib/components/t-dynamic-data-edit/elements/postman-collections/functions/methodColors.d.ts +1 -0
- package/lib/components/t-dynamic-data-edit/elements/postman-collections/postman-collections.component.d.ts +28 -0
- package/lib/components/t-dynamic-data-edit/elements/required-inputs/required-inputs.component.d.ts +57 -0
- package/lib/components/t-dynamic-data-edit/elements/rest-api-call-setup/rest-api-call-setup.component.d.ts +46 -0
- package/lib/components/t-dynamic-data-edit/elements/selection-options-editor/selection-options-editor.component.d.ts +48 -0
- package/lib/components/t-dynamic-data-edit/elements/t-workflow-picker/t-workflow-picker.component.d.ts +19 -0
- package/lib/components/t-dynamic-data-edit/elements/validators-config/validators-config.component.d.ts +60 -0
- package/lib/components/t-dynamic-data-edit/functions/testData.d.ts +2 -0
- package/lib/components/t-dynamic-data-edit/t-dynamic-data-edit.component.d.ts +48 -0
- package/lib/components/t-dynamic-data-view/t-dynamic-data-view.component.d.ts +14 -0
- package/lib/components/t-form-input/elements/Geo-location-form-input/elements/geo-location-form-input/geo-location-form-input.component.d.ts +18 -0
- package/lib/components/t-form-input/elements/Geo-location-form-input/functions/getGeoLocation.d.ts +2 -0
- package/lib/components/t-form-input/elements/Geo-location-form-input/geo-location.component.d.ts +16 -0
- package/lib/components/t-form-input/elements/auto-complete-input-element/auto-complete-input-element.component.d.ts +14 -0
- package/lib/components/t-form-input/elements/basic-input-input-element/basic-input-input-element.component.d.ts +17 -0
- package/lib/components/t-form-input/elements/basic-input-input-element/core/input-custom/input-custom.component.d.ts +17 -0
- package/lib/components/t-form-input/elements/date-picker-input-element/date-picker-input-element.component.d.ts +14 -0
- package/lib/components/t-form-input/elements/date-range-picker-input-element/date-range-picker-input-element.component.d.ts +14 -0
- package/lib/components/t-form-input/elements/editor-input-element/core/editor-js-input/editor-js-input.component.d.ts +18 -0
- package/lib/components/t-form-input/elements/editor-input-element/core/form-input-rich-text-editor/config.d.ts +9 -0
- package/lib/components/t-form-input/elements/editor-input-element/core/form-input-rich-text-editor/form-input-rich-text-editor.component.d.ts +14 -0
- package/lib/components/t-form-input/elements/editor-input-element/core/form-input-rich-text-editor/sync-editor/sync-editor.component.d.ts +10 -0
- package/lib/components/t-form-input/elements/editor-input-element/editor-input-element.component.d.ts +14 -0
- package/lib/components/t-form-input/elements/file-upload-input-element/core/file-uploader/camera-functions.d.ts +3 -0
- package/lib/components/t-form-input/elements/file-upload-input-element/core/file-uploader/file-uploader.component.d.ts +30 -0
- package/lib/components/t-form-input/elements/file-upload-input-element/file-upload-input-element.component.d.ts +14 -0
- package/lib/components/t-form-input/elements/image-capture-input-element/core/camera-capture/camera-capture.component.d.ts +28 -0
- package/lib/components/t-form-input/elements/image-capture-input-element/image-capture-input-element.component.d.ts +13 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/account-value/account-value.component.d.ts +37 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/mscoa-chart.component.d.ts +93 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-computation/mscoa-computation.component.d.ts +62 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-reactive-form-field/mscoa-reactive-form-field.component.d.ts +21 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/scoa-account-table/scoa-account-table.component.d.ts +83 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/scoa-input/scoa-input.component.d.ts +27 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/mscoa-form-input.component.d.ts +16 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/store/accountConstants.d.ts +5 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/store/mscoa-actions.d.ts +19 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/store/mscoa-component-store.service.d.ts +61 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/store/mscoa-effects.d.ts +8 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/store/mscoa-selectors.d.ts +32 -0
- package/lib/components/t-form-input/elements/multiple-input-input-element/core/multiple-input-table/multiple-input-table.component.d.ts +37 -0
- package/lib/components/t-form-input/elements/multiple-input-input-element/core/multiple-input-table-edit/multiple-input-table-edit.component.d.ts +52 -0
- package/lib/components/t-form-input/elements/multiple-input-input-element/core/multiple-input-table-view/multiple-input-table-view.component.d.ts +39 -0
- package/lib/components/t-form-input/elements/multiple-input-input-element/functions/getListCalculated.d.ts +2 -0
- package/lib/components/t-form-input/elements/multiple-input-input-element/multiple-input-input-element.component.d.ts +16 -0
- package/lib/components/t-form-input/elements/section-title/section-title.component.d.ts +7 -0
- package/lib/components/t-form-input/elements/select-input-element/select-input-element.component.d.ts +23 -0
- package/lib/components/t-form-input/elements/select-table-input/elements/input-table/input-table.component.d.ts +29 -0
- package/lib/components/t-form-input/elements/select-table-input/select-table-input.component.d.ts +13 -0
- package/lib/components/t-form-input/elements/signature-input-element/config/signature.d.ts +2 -0
- package/lib/components/t-form-input/elements/signature-input-element/core/signature-pad-input/signature-pad-input.component.d.ts +40 -0
- package/lib/components/t-form-input/elements/signature-input-element/signature-input-element.component.d.ts +13 -0
- package/lib/components/t-form-input/elements/textarea-input-element/textarea-input-element.component.d.ts +13 -0
- package/lib/components/t-form-input/elements/toggle-input-element/core/toggle/toggle.component.d.ts +15 -0
- package/lib/components/t-form-input/elements/toggle-input-element/toggle-input-element.component.d.ts +13 -0
- package/lib/components/t-form-input/t-form-input.component.d.ts +24 -0
- package/lib/components/t-form-input-status/t-form-input-status.component.d.ts +10 -0
- package/lib/components/user-form-stepper/user-form-stepper.component.d.ts +23 -0
- package/lib/injection-tokens/index.d.ts +14 -0
- package/lib/ngx-t-forms.component.d.ts +5 -0
- package/lib/ngx-t-forms.service.d.ts +6 -0
- package/lib/services/core/t-form-builder/functions/addFormInputToForm.d.ts +8 -0
- package/lib/services/core/t-form-builder/functions/addMultipleInputFunction.d.ts +2 -0
- package/lib/services/core/t-form-builder/functions/addNewSection.d.ts +2 -0
- package/lib/services/core/t-form-builder/functions/deleteSection.d.ts +2 -0
- package/lib/services/core/t-form-builder/functions/formCanSave.d.ts +3 -0
- package/lib/services/core/t-form-builder/functions/inputElementEditorConfigs.d.ts +91 -0
- package/lib/services/core/t-form-builder/functions/moveFormInput.d.ts +4 -0
- package/lib/services/core/t-form-builder/functions/moveInputToDiffSection.d.ts +2 -0
- package/lib/services/core/t-form-builder/functions/multipleInputToggleLabel.d.ts +2 -0
- package/lib/services/core/t-form-builder/functions/removeItem.d.ts +7 -0
- package/lib/services/core/t-form-builder/functions/sectionDrop.d.ts +3 -0
- package/lib/services/core/t-form-builder/functions/stepTitleChangeStep.d.ts +14 -0
- package/lib/services/core/t-form-controller/function/calculateInputValue.d.ts +11 -0
- package/lib/services/core/t-form-controller/function/getApiDataFetching.d.ts +4 -0
- package/lib/services/core/t-form-controller/function/postApiDataFetching.d.ts +16 -0
- package/lib/services/core/t-form-controller/function/validateMinInputForPostRequest.d.ts +8 -0
- package/lib/services/core/t-form-environment-injection/functions/provideNgxTforms.d.ts +3 -0
- package/lib/services/core/t-form-section-controller/Functions/commonFormOperations.d.ts +21 -0
- package/lib/services/core/t-form-section-controller/Functions/errorResolver.d.ts +7 -0
- package/lib/services/core/t-form-section-controller/Functions/formGenerator.d.ts +29 -0
- package/lib/services/core/t-form-section-controller/Functions/getValueFromPathMap.d.ts +6 -0
- package/lib/services/core/t-form-tower-controller/form-tower-controller.service.d.ts +99 -0
- package/lib/services/core/t-form-tower-controller/functions/allFormInputs.d.ts +3 -0
- package/lib/services/core/t-form-tower-controller/functions/createEmptyForm.d.ts +2 -0
- package/lib/services/core/t-form-tower-controller/functions/extractInitFunctions.d.ts +8 -0
- package/lib/services/core/t-form-tower-controller/functions/getAllFunctionTypes.d.ts +12 -0
- package/lib/services/core/t-form-tower-controller/functions/getFormValue.d.ts +3 -0
- package/lib/services/core/t-form-tower-controller/functions/getSubmissionStatus.d.ts +7 -0
- package/lib/services/core/t-form-tower-controller/functions/handleStepChange.d.ts +3 -0
- package/lib/services/core/t-form-tower-controller/functions/multipleInputRowIDControllInput.d.ts +2 -0
- package/lib/services/core/t-form-tower-controller/functions/prePoPulateForm.d.ts +85 -0
- package/lib/services/core/t-form-tower-controller/functions/saveMultipleInputForm.d.ts +10 -0
- package/lib/services/core/t-form-tower-controller/functions/selectFormSteps.d.ts +4 -0
- package/lib/services/core/t-form-tower-controller/functions/setControlTempErrors.d.ts +3 -0
- package/lib/services/core/t-form-tower-controller/functions/setInputAsTouchedAndDirty.d.ts +2 -0
- package/lib/services/core/t-form-tower-controller/functions/setInputError.d.ts +5 -0
- package/lib/services/core/t-form-tower-controller/functions/setInputStatus.d.ts +3 -0
- package/lib/services/core/t-form-tower-controller/functions/setSectionAsSeen.d.ts +3 -0
- package/lib/services/core/t-form-tower-controller/functions/startTowerFormChangesEventListener.d.ts +10 -0
- package/lib/services/core/t-form-tower-controller/functions/toggleMultipleInput.d.ts +5 -0
- package/lib/services/core/t-form-tower-controller/functions/updateChangeHistory.d.ts +2 -0
- package/lib/services/core/t-form-tower-controller/functions/updateFormInputConfig.d.ts +6 -0
- package/lib/services/core/t-form-tower-controller/functions/updateValue.d.ts +2 -0
- package/lib/services/core/t-input-controller/functions/baseCustomInput.d.ts +104 -0
- package/lib/services/core/t-input-controller/functions/colorCoding.d.ts +24 -0
- package/lib/services/core/t-input-controller/functions/configureCols.d.ts +5 -0
- package/lib/services/core/t-input-controller/functions/generateInputSecret.d.ts +2 -0
- package/lib/services/core/t-input-controller/functions/inputErrorMessage.d.ts +3 -0
- package/lib/services/hhtpResources/Pipeline/pipeline.service.d.ts +80 -0
- package/lib/services/index.d.ts +5 -0
- package/lib/shared/functions/assignDeepPropertyToObject.d.ts +1 -0
- package/lib/shared/functions/camelize.d.ts +6 -0
- package/lib/shared/functions/daysAgoTransform.d.ts +1 -0
- package/lib/shared/functions/enryption.d.ts +9 -0
- package/lib/shared/functions/evaluateArrayAccessRules.d.ts +14 -0
- package/lib/shared/functions/getAvatar.d.ts +1 -0
- package/lib/shared/functions/getDeepObject.d.ts +138 -0
- package/lib/shared/functions/getInputIllustration.d.ts +2 -0
- package/lib/shared/functions/isEqual.d.ts +12 -0
- package/lib/shared/functions/migrationCheck.d.ts +3 -0
- package/lib/shared/functions/replaceUrlVariables.d.ts +2 -0
- package/lib/shared/functions/searchArray.d.ts +1 -0
- package/lib/shared/functions/textIconsForUserHints.d.ts +20 -0
- package/lib/shared/index.d.ts +6 -0
- package/lib/shared/modules/mat-modules.module.d.ts +50 -0
- package/lib/shared/pipes/date/days-ago.pipe.d.ts +7 -0
- package/package.json +67 -0
- package/public-api.d.ts +6 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import * as i2 from '@angular/common';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { inject, Component, ChangeDetectionStrategy } from '@angular/core';
|
|
5
|
+
import { F as FormsStoreService, M as MatModulesModule, T as TDynamicDataEditComponent, b as TDynamicDataViewComponent } from './ngx-t-forms-ngx-t-forms-B-w5W1gG.mjs';
|
|
6
|
+
import { DefaultInputConfig } from 'ngx-t-forms-types';
|
|
7
|
+
import { take, tap } from 'rxjs';
|
|
8
|
+
import * as i6 from '@angular/material/list';
|
|
9
|
+
import * as i5 from '@angular/material/divider';
|
|
10
|
+
import { toSignal } from '@angular/core/rxjs-interop';
|
|
11
|
+
import * as i3$1 from '@angular/material/card';
|
|
12
|
+
import * as i3 from '@angular/material/expansion';
|
|
13
|
+
import * as i8 from '@angular/material/progress-spinner';
|
|
14
|
+
import * as i4 from '@angular/material/form-field';
|
|
15
|
+
import * as i9 from '@angular/material/toolbar';
|
|
16
|
+
import * as i5$1 from '@angular/material/icon';
|
|
17
|
+
import * as i8$1 from '@angular/material/tooltip';
|
|
18
|
+
import * as i2$1 from '@angular/cdk/drag-drop';
|
|
19
|
+
import * as i3$2 from '@angular/material/button';
|
|
20
|
+
|
|
21
|
+
class DefaultElementComponent {
|
|
22
|
+
constructor() {
|
|
23
|
+
this.inputs = DefaultInputConfig;
|
|
24
|
+
this.store = inject(FormsStoreService);
|
|
25
|
+
}
|
|
26
|
+
getDefaultInputs() {
|
|
27
|
+
const i = JSON.parse(JSON.stringify(DefaultInputConfig));
|
|
28
|
+
return Object.keys(i);
|
|
29
|
+
}
|
|
30
|
+
selectInputTemplate(input) {
|
|
31
|
+
this.store.selectors.selectInputInEditId$.pipe(take(1)).subscribe((id) => {
|
|
32
|
+
if (!id)
|
|
33
|
+
return;
|
|
34
|
+
this.store.actionsFormBuilder.selectInputTemplate(id, input);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DefaultElementComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
38
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: DefaultElementComponent, isStandalone: true, selector: "app-default-element", ngImport: i0, template: "<br>\r\n<mat-nav-list style=\"margin: 5px;\">\r\n\r\n\r\n @defer () {\r\n @for (input of getDefaultInputs(); track input) {\r\n @if (inputs[input].disabled === false) {\r\n <mat-list-item style=\"background: var(--mdc-elevated-card-container-color, var(--mat-app-surface-container-low));\"\r\n (click)=\"selectInputTemplate(input)\">\r\n <img matListItemAvatar [src]=\"inputs[input].illustration\" alt=\"\">\r\n <span matListItemTitle href=\"...\">{{ inputs[input].label}}</span>\r\n </mat-list-item>\r\n <mat-divider></mat-divider>\r\n }\r\n }\r\n \r\n }\r\n\r\n\r\n</mat-nav-list>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatModulesModule }, { kind: "component", type: i6.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }], deferBlockDependencies: [() => [i5.MatDivider, i6.MatListItem, i6.MatListItemAvatar, i6.MatListItemTitle]] }); }
|
|
39
|
+
}
|
|
40
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DefaultElementComponent, decorators: [{
|
|
41
|
+
type: Component,
|
|
42
|
+
args: [{ selector: 'app-default-element', standalone: true, imports: [CommonModule, MatModulesModule], template: "<br>\r\n<mat-nav-list style=\"margin: 5px;\">\r\n\r\n\r\n @defer () {\r\n @for (input of getDefaultInputs(); track input) {\r\n @if (inputs[input].disabled === false) {\r\n <mat-list-item style=\"background: var(--mdc-elevated-card-container-color, var(--mat-app-surface-container-low));\"\r\n (click)=\"selectInputTemplate(input)\">\r\n <img matListItemAvatar [src]=\"inputs[input].illustration\" alt=\"\">\r\n <span matListItemTitle href=\"...\">{{ inputs[input].label}}</span>\r\n </mat-list-item>\r\n <mat-divider></mat-divider>\r\n }\r\n }\r\n \r\n }\r\n\r\n\r\n</mat-nav-list>" }]
|
|
43
|
+
}], ctorParameters: () => [] });
|
|
44
|
+
|
|
45
|
+
class InputElementEditorComponent {
|
|
46
|
+
constructor() {
|
|
47
|
+
this.store = inject(FormsStoreService);
|
|
48
|
+
this.inputElementEditorConfigs$ = this.store.formBuilderSelectors.inputElementEditorConfigs$;
|
|
49
|
+
this.inputElementEditorConfigs = toSignal(this.inputElementEditorConfigs$);
|
|
50
|
+
this.inputInEdit$ = this.store.formBuilderSelectors.inputInEdit$;
|
|
51
|
+
this.inputInEdit = toSignal(this.inputInEdit$);
|
|
52
|
+
this.defaultInputInEdit$ = this.store.formBuilderSelectors.defaultInputInEdit$;
|
|
53
|
+
this.defaultInputInEdit = toSignal(this.defaultInputInEdit$);
|
|
54
|
+
this.formInputs$ = this.store.formBuilderSelectors.getAllFormInputs$;
|
|
55
|
+
this.formInputs = toSignal(this.formInputs$);
|
|
56
|
+
this.elementConfigurationChanged = (value, ele) => {
|
|
57
|
+
this.inputInEdit$.pipe(take(1), tap((input) => {
|
|
58
|
+
if (!input)
|
|
59
|
+
return;
|
|
60
|
+
this.store.actionsFormBuilder.elementConfigurationChanged(input.id, value, ele);
|
|
61
|
+
})).subscribe();
|
|
62
|
+
};
|
|
63
|
+
// Event handlers
|
|
64
|
+
this.clearInputInEdit = () => {
|
|
65
|
+
this.inputInEdit$.pipe(take(1), tap((input) => {
|
|
66
|
+
if (!input)
|
|
67
|
+
return;
|
|
68
|
+
this.store.actionsFormBuilder.clearInputInEdit(input.id);
|
|
69
|
+
})).subscribe();
|
|
70
|
+
};
|
|
71
|
+
this.elementBlur = (event, element) => {
|
|
72
|
+
this.inputInEdit$.pipe(take(1), tap((input) => {
|
|
73
|
+
if (!input)
|
|
74
|
+
return;
|
|
75
|
+
this.store.actionsFormBuilder.elementBlur(input.id, event, element);
|
|
76
|
+
})).subscribe();
|
|
77
|
+
};
|
|
78
|
+
this.inputInEditValidationErrors$ = this.store.formBuilderSelectors.inputInEditValidationErrors$;
|
|
79
|
+
this.inputInEditValidationErrors = toSignal(this.inputInEditValidationErrors$);
|
|
80
|
+
}
|
|
81
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: InputElementEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
82
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: InputElementEditorComponent, isStandalone: true, selector: "app-input-element-editor", ngImport: i0, template: "<mat-toolbar class=\"section-header\">\r\n <span class=\"header\">Element configuration</span>\r\n <span class=\"spacer\"></span>\r\n</mat-toolbar>\r\n<mat-divider></mat-divider>\r\n\r\n@defer (on viewport) {\r\n<mat-accordion togglePosition=\"before\">\r\n @for(section of inputElementEditorConfigs()?.editorSections; track section.id) {\r\n <mat-expansion-panel>\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>\r\n {{section.label}}\r\n <span class=\"spacer\"></span>\r\n @if (section.hasErrors) {\r\n <mat-icon color=\"warn\">error</mat-icon>\r\n }\r\n <span class=\"showItemValue\" *ngIf=\"section.showItemValue && !!(inputInEdit())\">\r\n {{ inputInEdit()?.[section.showItemValue]}}\r\n </span>\r\n <mat-divider style=\"position: absolute; left:0px; width:100%; bottom:0px;\"></mat-divider>\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n\r\n <div style=\"margin-top: 16px;\"></div>\r\n\r\n <!-- Element type selector (only in first section) -->\r\n @if($index === 0) {\r\n <mat-nav-list>\r\n <mat-list-item matTooltip=\"Change input element\" (click)=\"clearInputInEdit()\">\r\n <img matListItemAvatar [src]=\"(defaultInputInEdit())?.illustration\"\r\n [alt]=\"(defaultInputInEdit())?.label\">\r\n <span matListItemTitle>{{ (defaultInputInEdit())?.label}}</span>\r\n <span matListItemMeta>\r\n <mat-icon>arrow_forward_ios</mat-icon>\r\n </span>\r\n </mat-list-item>\r\n <mat-divider></mat-divider>\r\n </mat-nav-list>\r\n }\r\n\r\n <!-- Section elements -->\r\n @for(element of section.elements; track element.id) {\r\n <p style=\"margin-bottom: 16px; margin-top: 8px;\">\r\n @defer (on viewport) {\r\n <lib-t-dynamic-data-edit [editorConfig]=\"element\" [data]=\"(inputInEdit())\"\r\n [validationErrors]=\"element.computedErrors||[]\"\r\n (valueChange)=\"elementConfigurationChanged($event, element)\" [formInputs]=\"(formInputs())||[]\"\r\n (blur)=\"elementBlur($event, element)\">\r\n </lib-t-dynamic-data-edit>\r\n } @placeholder {\r\n <div style=\"padding: 50px; display:flex; justify-content:center; align-items:center; text-align: center;\">\r\n <mat-spinner diameter=\"18\"></mat-spinner>\r\n </div>\r\n }\r\n </p>\r\n }\r\n </mat-expansion-panel>\r\n }\r\n</mat-accordion>\r\n} @placeholder {\r\n<div style=\"padding: 50px; display:flex; justify-content:center; align-items:center; text-align: center;\">\r\n <mat-spinner diameter=\"50\" />\r\n</div>\r\n} @error {\r\n<mat-error>\r\n <h1>Error loading element editor</h1>\r\n <p>An error occurred while loading the element editor. Please try again later.</p>\r\n</mat-error>\r\n}\r\n\r\n<!-- Diagnostic section -->\r\n<mat-toolbar class=\"section-header\">\r\n <span class=\"header\">Diagnostic data</span>\r\n <span class=\"spacer\"></span>\r\n</mat-toolbar>\r\n<mat-divider></mat-divider>\r\n\r\n<mat-accordion togglePosition=\"before\">\r\n <mat-expansion-panel>\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>\r\n Input json data\r\n <span class=\"spacer\"></span>\r\n <mat-divider style=\"position: absolute; left:0px; width:100%; bottom:0px;\"></mat-divider>\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <div style=\"margin-top: 16px;\"></div>\r\n <mat-card style=\"padding: 16px;\">\r\n <lib-t-dynamic-data-view [data]=\"inputInEdit()\"></lib-t-dynamic-data-view>\r\n </mat-card>\r\n </mat-expansion-panel>\r\n\r\n @if(((inputInEditValidationErrors())||[]).length > 0) {\r\n <mat-expansion-panel>\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>\r\n Validation Errors\r\n <span class=\"spacer\"></span>\r\n <mat-error>\r\n {{(inputInEditValidationErrors())?.length||''}}\r\n </mat-error>\r\n <mat-divider style=\"position: absolute; left:0px; width:100%; bottom:0px;\"></mat-divider>\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <div style=\"margin-top: 16px;\"></div>\r\n <mat-error style=\"border: solid 1px; border-radius: 8px; padding: 16px;\">\r\n <h1>All configuration errors:</h1>\r\n <p>\r\n {{(inputInEditValidationErrors())?.length||''}} errors found. When an error is found, the input will not\r\n be saved.\r\n </p>\r\n <ul>\r\n @for(error of (inputInEditValidationErrors()); track error.key) {\r\n <li>\r\n <strong>{{error.key}}</strong> {{error.message}}\r\n </li>\r\n }\r\n </ul>\r\n </mat-error>\r\n </mat-expansion-panel>\r\n }\r\n</mat-accordion>", styles: [".showItemValue{opacity:.6}mat-form-field{width:100%}mat-slider{width:100%}.header{margin-bottom:0;font-size:small;opacity:.6}.section-header{height:38px;margin-top:12px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatModulesModule }, { kind: "component", type: i3$1.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "component", type: i5.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "directive", type: i3.MatAccordion, selector: "mat-accordion", inputs: ["hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i3.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i3.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i3.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "component", type: i8.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: i4.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: i9.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: TDynamicDataViewComponent, selector: "lib-t-dynamic-data-view", inputs: ["data"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, deferBlockDependencies: [() => [i2.NgIf, i5.MatDivider, i3.MatAccordion, i3.MatExpansionPanel, i3.MatExpansionPanelHeader, i3.MatExpansionPanelTitle, i5$1.MatIcon, i6.MatNavList, i6.MatListItem, i6.MatListItemAvatar, i6.MatListItemTitle, i6.MatListItemMeta, i8.MatProgressSpinner, i8$1.MatTooltip], () => [TDynamicDataEditComponent]] }); }
|
|
83
|
+
}
|
|
84
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: InputElementEditorComponent, decorators: [{
|
|
85
|
+
type: Component,
|
|
86
|
+
args: [{ selector: 'app-input-element-editor', standalone: true, imports: [
|
|
87
|
+
CommonModule,
|
|
88
|
+
MatModulesModule,
|
|
89
|
+
TDynamicDataEditComponent,
|
|
90
|
+
TDynamicDataViewComponent
|
|
91
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-toolbar class=\"section-header\">\r\n <span class=\"header\">Element configuration</span>\r\n <span class=\"spacer\"></span>\r\n</mat-toolbar>\r\n<mat-divider></mat-divider>\r\n\r\n@defer (on viewport) {\r\n<mat-accordion togglePosition=\"before\">\r\n @for(section of inputElementEditorConfigs()?.editorSections; track section.id) {\r\n <mat-expansion-panel>\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>\r\n {{section.label}}\r\n <span class=\"spacer\"></span>\r\n @if (section.hasErrors) {\r\n <mat-icon color=\"warn\">error</mat-icon>\r\n }\r\n <span class=\"showItemValue\" *ngIf=\"section.showItemValue && !!(inputInEdit())\">\r\n {{ inputInEdit()?.[section.showItemValue]}}\r\n </span>\r\n <mat-divider style=\"position: absolute; left:0px; width:100%; bottom:0px;\"></mat-divider>\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n\r\n <div style=\"margin-top: 16px;\"></div>\r\n\r\n <!-- Element type selector (only in first section) -->\r\n @if($index === 0) {\r\n <mat-nav-list>\r\n <mat-list-item matTooltip=\"Change input element\" (click)=\"clearInputInEdit()\">\r\n <img matListItemAvatar [src]=\"(defaultInputInEdit())?.illustration\"\r\n [alt]=\"(defaultInputInEdit())?.label\">\r\n <span matListItemTitle>{{ (defaultInputInEdit())?.label}}</span>\r\n <span matListItemMeta>\r\n <mat-icon>arrow_forward_ios</mat-icon>\r\n </span>\r\n </mat-list-item>\r\n <mat-divider></mat-divider>\r\n </mat-nav-list>\r\n }\r\n\r\n <!-- Section elements -->\r\n @for(element of section.elements; track element.id) {\r\n <p style=\"margin-bottom: 16px; margin-top: 8px;\">\r\n @defer (on viewport) {\r\n <lib-t-dynamic-data-edit [editorConfig]=\"element\" [data]=\"(inputInEdit())\"\r\n [validationErrors]=\"element.computedErrors||[]\"\r\n (valueChange)=\"elementConfigurationChanged($event, element)\" [formInputs]=\"(formInputs())||[]\"\r\n (blur)=\"elementBlur($event, element)\">\r\n </lib-t-dynamic-data-edit>\r\n } @placeholder {\r\n <div style=\"padding: 50px; display:flex; justify-content:center; align-items:center; text-align: center;\">\r\n <mat-spinner diameter=\"18\"></mat-spinner>\r\n </div>\r\n }\r\n </p>\r\n }\r\n </mat-expansion-panel>\r\n }\r\n</mat-accordion>\r\n} @placeholder {\r\n<div style=\"padding: 50px; display:flex; justify-content:center; align-items:center; text-align: center;\">\r\n <mat-spinner diameter=\"50\" />\r\n</div>\r\n} @error {\r\n<mat-error>\r\n <h1>Error loading element editor</h1>\r\n <p>An error occurred while loading the element editor. Please try again later.</p>\r\n</mat-error>\r\n}\r\n\r\n<!-- Diagnostic section -->\r\n<mat-toolbar class=\"section-header\">\r\n <span class=\"header\">Diagnostic data</span>\r\n <span class=\"spacer\"></span>\r\n</mat-toolbar>\r\n<mat-divider></mat-divider>\r\n\r\n<mat-accordion togglePosition=\"before\">\r\n <mat-expansion-panel>\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>\r\n Input json data\r\n <span class=\"spacer\"></span>\r\n <mat-divider style=\"position: absolute; left:0px; width:100%; bottom:0px;\"></mat-divider>\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <div style=\"margin-top: 16px;\"></div>\r\n <mat-card style=\"padding: 16px;\">\r\n <lib-t-dynamic-data-view [data]=\"inputInEdit()\"></lib-t-dynamic-data-view>\r\n </mat-card>\r\n </mat-expansion-panel>\r\n\r\n @if(((inputInEditValidationErrors())||[]).length > 0) {\r\n <mat-expansion-panel>\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>\r\n Validation Errors\r\n <span class=\"spacer\"></span>\r\n <mat-error>\r\n {{(inputInEditValidationErrors())?.length||''}}\r\n </mat-error>\r\n <mat-divider style=\"position: absolute; left:0px; width:100%; bottom:0px;\"></mat-divider>\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <div style=\"margin-top: 16px;\"></div>\r\n <mat-error style=\"border: solid 1px; border-radius: 8px; padding: 16px;\">\r\n <h1>All configuration errors:</h1>\r\n <p>\r\n {{(inputInEditValidationErrors())?.length||''}} errors found. When an error is found, the input will not\r\n be saved.\r\n </p>\r\n <ul>\r\n @for(error of (inputInEditValidationErrors()); track error.key) {\r\n <li>\r\n <strong>{{error.key}}</strong> {{error.message}}\r\n </li>\r\n }\r\n </ul>\r\n </mat-error>\r\n </mat-expansion-panel>\r\n }\r\n</mat-accordion>", styles: [".showItemValue{opacity:.6}mat-form-field{width:100%}mat-slider{width:100%}.header{margin-bottom:0;font-size:small;opacity:.6}.section-header{height:38px;margin-top:12px}\n"] }]
|
|
92
|
+
}] });
|
|
93
|
+
|
|
94
|
+
class InputEditorComponent {
|
|
95
|
+
constructor(store) {
|
|
96
|
+
this.store = store;
|
|
97
|
+
this.defaultInputs = DefaultInputConfig;
|
|
98
|
+
this.inputInEdit$ = this.store.formBuilderSelectors.inputInEdit$;
|
|
99
|
+
this.defaultInputInEdit$ = this.store.formBuilderSelectors.defaultInputInEdit$;
|
|
100
|
+
this.saveInput = () => {
|
|
101
|
+
this.inputInEdit$.pipe(take(1), tap((input) => {
|
|
102
|
+
if (!input)
|
|
103
|
+
return;
|
|
104
|
+
this.store.actionsFormBuilder.saveInput(input.id);
|
|
105
|
+
})).subscribe();
|
|
106
|
+
};
|
|
107
|
+
this.closeEditor = () => this.store.actions.setInputInEditId({
|
|
108
|
+
inputInEdit: null
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
get validationErrors$() {
|
|
112
|
+
return this.store.formBuilderSelectors.inputInEditValidationErrors$;
|
|
113
|
+
}
|
|
114
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: InputEditorComponent, deps: [{ token: FormsStoreService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
115
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: InputEditorComponent, isStandalone: true, selector: "app-input-editor", ngImport: i0, template: "<mat-card \r\n\r\nstyle=\"\r\n\r\nbackground: var(--mat-toolbar-container-background-color, var(--mat-app-surface));\r\nmargin:0px;\r\nborder:solid 1px var(--mat-divider-color, var(--mat-app-outline))\">\r\n \r\n <mat-card-header >\r\n <mat-card-title>\r\n {{\r\n !!(inputInEdit$|async)?.element\r\n ? \"Edit \" + (inputInEdit$|async)?.label + \" element\"\r\n : \"Setup Form Element\"\r\n }}\r\n </mat-card-title>\r\n <mat-card-subtitle> {{\r\n !!(inputInEdit$|async)?.element? \"Configure the element below\": \"Form element are components making up a form section. Types of form elements are defined by their behaviour and use case, for example a date range picker is well suited to determine duration.\"\r\n }}</mat-card-subtitle>\r\n <button style=\"position: absolute;right:4px\" mat-icon-button cdkDragHandle >\r\n <mat-icon>drag_indicator</mat-icon>\r\n </button>\r\n </mat-card-header>\r\n \r\n\r\n\r\n @if(!!((inputInEdit$|async))?.element){\r\n <app-input-element-editor \r\n style=\"background: var(--mat-toolbar-container-background-color, var(--mat-app-surface))\">\r\n </app-input-element-editor>\r\n }@else{\r\n <app-default-element style=\"background: var(--mat-toolbar-container-background-color, var(--mat-app-surface))\"></app-default-element>\r\n }\r\n <br>\r\n\r\n <br>\r\n <mat-divider></mat-divider>\r\n \r\n <mat-card-actions >\r\n <button (click)=\"closeEditor()\" class=\"\" mat-flat-button>close</button>\r\n <span class=\"spacer\"></span>\r\n <button *ngIf=\"!((inputInEdit$|async))?.id\" mat-flat-button \r\n (click)=\"saveInput()\"\r\n [disabled]=\"((validationErrors$|async)||[]).length>0\"\r\n color=\"primary\">save new input</button>\r\n \r\n </mat-card-actions>\r\n</mat-card>\r\n", styles: ["mat-card{margin:16px}mat-card-content{overflow-y:auto;max-height:calc(100vh - 190px)}mat-card-actions{position:sticky;bottom:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatModulesModule }, { kind: "directive", type: i2$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: i3$2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3$2.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i3$1.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "component", type: i3$1.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i3$1.MatCardSubtitle, selector: "mat-card-subtitle, [mat-card-subtitle], [matCardSubtitle]" }, { kind: "directive", type: i3$1.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "component", type: i5.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: DefaultElementComponent, selector: "app-default-element" }, { kind: "component", type: InputElementEditorComponent, selector: "app-input-element-editor" }] }); }
|
|
116
|
+
}
|
|
117
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: InputEditorComponent, decorators: [{
|
|
118
|
+
type: Component,
|
|
119
|
+
args: [{ selector: 'app-input-editor', standalone: true, imports: [CommonModule,
|
|
120
|
+
MatModulesModule,
|
|
121
|
+
DefaultElementComponent,
|
|
122
|
+
InputElementEditorComponent], template: "<mat-card \r\n\r\nstyle=\"\r\n\r\nbackground: var(--mat-toolbar-container-background-color, var(--mat-app-surface));\r\nmargin:0px;\r\nborder:solid 1px var(--mat-divider-color, var(--mat-app-outline))\">\r\n \r\n <mat-card-header >\r\n <mat-card-title>\r\n {{\r\n !!(inputInEdit$|async)?.element\r\n ? \"Edit \" + (inputInEdit$|async)?.label + \" element\"\r\n : \"Setup Form Element\"\r\n }}\r\n </mat-card-title>\r\n <mat-card-subtitle> {{\r\n !!(inputInEdit$|async)?.element? \"Configure the element below\": \"Form element are components making up a form section. Types of form elements are defined by their behaviour and use case, for example a date range picker is well suited to determine duration.\"\r\n }}</mat-card-subtitle>\r\n <button style=\"position: absolute;right:4px\" mat-icon-button cdkDragHandle >\r\n <mat-icon>drag_indicator</mat-icon>\r\n </button>\r\n </mat-card-header>\r\n \r\n\r\n\r\n @if(!!((inputInEdit$|async))?.element){\r\n <app-input-element-editor \r\n style=\"background: var(--mat-toolbar-container-background-color, var(--mat-app-surface))\">\r\n </app-input-element-editor>\r\n }@else{\r\n <app-default-element style=\"background: var(--mat-toolbar-container-background-color, var(--mat-app-surface))\"></app-default-element>\r\n }\r\n <br>\r\n\r\n <br>\r\n <mat-divider></mat-divider>\r\n \r\n <mat-card-actions >\r\n <button (click)=\"closeEditor()\" class=\"\" mat-flat-button>close</button>\r\n <span class=\"spacer\"></span>\r\n <button *ngIf=\"!((inputInEdit$|async))?.id\" mat-flat-button \r\n (click)=\"saveInput()\"\r\n [disabled]=\"((validationErrors$|async)||[]).length>0\"\r\n color=\"primary\">save new input</button>\r\n \r\n </mat-card-actions>\r\n</mat-card>\r\n", styles: ["mat-card{margin:16px}mat-card-content{overflow-y:auto;max-height:calc(100vh - 190px)}mat-card-actions{position:sticky;bottom:0}\n"] }]
|
|
123
|
+
}], ctorParameters: () => [{ type: FormsStoreService }] });
|
|
124
|
+
|
|
125
|
+
export { InputEditorComponent };
|
|
126
|
+
//# sourceMappingURL=ngx-t-forms-input-editor.component-C1kH_GDD.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-t-forms-input-editor.component-C1kH_GDD.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/form-builder/elements/default-element/default-element.component.ts","../../../projects/ngx-t-forms/src/lib/components/form-builder/elements/default-element/default-element.component.html","../../../projects/ngx-t-forms/src/lib/components/form-builder/elements/input-element-editor/input-element-editor.component.ts","../../../projects/ngx-t-forms/src/lib/components/form-builder/elements/input-element-editor/input-element-editor.component.html","../../../projects/ngx-t-forms/src/lib/components/form-builder/elements/input-editor/input-editor.component.ts","../../../projects/ngx-t-forms/src/lib/components/form-builder/elements/input-editor/input-editor.component.html"],"sourcesContent":["import { CommonModule } from '@angular/common';\r\nimport { Component, inject } from '@angular/core';\r\nimport { MatModulesModule } from '../../../../shared/modules/mat-modules.module';\r\n\r\nimport { FormsStoreService } from '../../../forms/store/forms-store.service';\r\nimport { DefaultInputConfig, ElementTypes } from 'ngx-t-forms-types';\r\nimport { take } from 'rxjs';\r\n\r\n\r\n\r\n@Component({\r\n selector: 'app-default-element',\r\n standalone: true,\r\n imports: [CommonModule,MatModulesModule],\r\n templateUrl: './default-element.component.html',\r\n styleUrl: './default-element.component.scss',\r\n})\r\nexport class DefaultElementComponent {\r\n\r\n inputs = DefaultInputConfig\r\n store = inject(FormsStoreService)\r\n\r\n constructor(){\r\n\r\n }\r\n \r\n\r\n getDefaultInputs():ElementTypes[]{\r\n const i = JSON.parse(JSON.stringify(DefaultInputConfig))\r\n return Object.keys(i) as any\r\n }\r\n selectInputTemplate (input: ElementTypes) {\r\n this.store.selectors.selectInputInEditId$.pipe(\r\n take(1)\r\n ).subscribe((id)=>{\r\n if(!id) return\r\n this.store.actionsFormBuilder.selectInputTemplate(id,input)\r\n }\r\n )\r\n \r\n }\r\n\r\n}\r\n","<br>\r\n<mat-nav-list style=\"margin: 5px;\">\r\n\r\n\r\n @defer () {\r\n @for (input of getDefaultInputs(); track input) {\r\n @if (inputs[input].disabled === false) {\r\n <mat-list-item style=\"background: var(--mdc-elevated-card-container-color, var(--mat-app-surface-container-low));\"\r\n (click)=\"selectInputTemplate(input)\">\r\n <img matListItemAvatar [src]=\"inputs[input].illustration\" alt=\"\">\r\n <span matListItemTitle href=\"...\">{{ inputs[input].label}}</span>\r\n </mat-list-item>\r\n <mat-divider></mat-divider>\r\n }\r\n }\r\n \r\n }\r\n\r\n\r\n</mat-nav-list>","import { CommonModule } from '@angular/common';\r\nimport { ChangeDetectionStrategy, Component, inject, } from '@angular/core';\r\nimport { MatModulesModule } from '../../../../shared/modules/mat-modules.module';\r\n\r\n\r\nimport { FormsStoreService } from '../../../forms/store/forms-store.service';\r\n\r\n\r\nimport { TDynamicDataEditComponent, TDynamicDataViewComponent } from '../../..';\r\n\r\nimport { toSignal } from '@angular/core/rxjs-interop';\r\nimport { ElementEditorInnerSectionElementInterface } from 'ngx-t-forms-types';\r\nimport { take, tap } from 'rxjs';\r\n\r\n@Component({\r\n selector: 'app-input-element-editor',\r\n standalone: true,\r\n imports: [\r\n CommonModule,\r\n MatModulesModule,\r\n TDynamicDataEditComponent,\r\n TDynamicDataViewComponent \r\n ],\r\n templateUrl: './input-element-editor.component.html',\r\n styleUrl: './input-element-editor.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n \r\n\r\n})\r\n\r\nexport class InputElementEditorComponent {\r\n\r\n private store = inject(FormsStoreService);\r\n inputElementEditorConfigs$ = this.store.formBuilderSelectors.inputElementEditorConfigs$ \r\n inputElementEditorConfigs = toSignal(this.inputElementEditorConfigs$)\r\n inputInEdit$ = this.store.formBuilderSelectors.inputInEdit$\r\n inputInEdit = toSignal(this.inputInEdit$)\r\n defaultInputInEdit$ = this.store.formBuilderSelectors.defaultInputInEdit$\r\n defaultInputInEdit = toSignal(this.defaultInputInEdit$)\r\n formInputs$ = this.store.formBuilderSelectors.getAllFormInputs$\r\n formInputs = toSignal(this.formInputs$)\r\n elementConfigurationChanged = (value: any, ele: ElementEditorInnerSectionElementInterface) => {\r\n this.inputInEdit$.pipe(\r\n take(1),\r\n tap((input) => {\r\n if (!input) return;\r\n this.store.actionsFormBuilder.elementConfigurationChanged(input.id,value, ele);\r\n })\r\n ).subscribe();\r\n\r\n };\r\n // Event handlers\r\n clearInputInEdit = () => {\r\n this.inputInEdit$.pipe(\r\n take(1),\r\n tap((input) => {\r\n if (!input) return;\r\n this.store.actionsFormBuilder.clearInputInEdit(\r\n input.id\r\n );\r\n })\r\n ).subscribe();\r\n }\r\n elementBlur = (event: any, element: ElementEditorInnerSectionElementInterface) => {\r\n this.inputInEdit$.pipe(\r\n take(1),\r\n tap((input) => {\r\n if (!input) return;\r\n this.store.actionsFormBuilder.elementBlur(input.id, event, element);\r\n })\r\n ).subscribe();\r\n }\r\n \r\n inputInEditValidationErrors$ = this.store.formBuilderSelectors.inputInEditValidationErrors$\r\n\r\n inputInEditValidationErrors = toSignal(this.inputInEditValidationErrors$)\r\n\r\n \r\n}","<mat-toolbar class=\"section-header\">\r\n <span class=\"header\">Element configuration</span>\r\n <span class=\"spacer\"></span>\r\n</mat-toolbar>\r\n<mat-divider></mat-divider>\r\n\r\n@defer (on viewport) {\r\n<mat-accordion togglePosition=\"before\">\r\n @for(section of inputElementEditorConfigs()?.editorSections; track section.id) {\r\n <mat-expansion-panel>\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>\r\n {{section.label}}\r\n <span class=\"spacer\"></span>\r\n @if (section.hasErrors) {\r\n <mat-icon color=\"warn\">error</mat-icon>\r\n }\r\n <span class=\"showItemValue\" *ngIf=\"section.showItemValue && !!(inputInEdit())\">\r\n {{ inputInEdit()?.[section.showItemValue]}}\r\n </span>\r\n <mat-divider style=\"position: absolute; left:0px; width:100%; bottom:0px;\"></mat-divider>\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n\r\n <div style=\"margin-top: 16px;\"></div>\r\n\r\n <!-- Element type selector (only in first section) -->\r\n @if($index === 0) {\r\n <mat-nav-list>\r\n <mat-list-item matTooltip=\"Change input element\" (click)=\"clearInputInEdit()\">\r\n <img matListItemAvatar [src]=\"(defaultInputInEdit())?.illustration\"\r\n [alt]=\"(defaultInputInEdit())?.label\">\r\n <span matListItemTitle>{{ (defaultInputInEdit())?.label}}</span>\r\n <span matListItemMeta>\r\n <mat-icon>arrow_forward_ios</mat-icon>\r\n </span>\r\n </mat-list-item>\r\n <mat-divider></mat-divider>\r\n </mat-nav-list>\r\n }\r\n\r\n <!-- Section elements -->\r\n @for(element of section.elements; track element.id) {\r\n <p style=\"margin-bottom: 16px; margin-top: 8px;\">\r\n @defer (on viewport) {\r\n <lib-t-dynamic-data-edit [editorConfig]=\"element\" [data]=\"(inputInEdit())\"\r\n [validationErrors]=\"element.computedErrors||[]\"\r\n (valueChange)=\"elementConfigurationChanged($event, element)\" [formInputs]=\"(formInputs())||[]\"\r\n (blur)=\"elementBlur($event, element)\">\r\n </lib-t-dynamic-data-edit>\r\n } @placeholder {\r\n <div style=\"padding: 50px; display:flex; justify-content:center; align-items:center; text-align: center;\">\r\n <mat-spinner diameter=\"18\"></mat-spinner>\r\n </div>\r\n }\r\n </p>\r\n }\r\n </mat-expansion-panel>\r\n }\r\n</mat-accordion>\r\n} @placeholder {\r\n<div style=\"padding: 50px; display:flex; justify-content:center; align-items:center; text-align: center;\">\r\n <mat-spinner diameter=\"50\" />\r\n</div>\r\n} @error {\r\n<mat-error>\r\n <h1>Error loading element editor</h1>\r\n <p>An error occurred while loading the element editor. Please try again later.</p>\r\n</mat-error>\r\n}\r\n\r\n<!-- Diagnostic section -->\r\n<mat-toolbar class=\"section-header\">\r\n <span class=\"header\">Diagnostic data</span>\r\n <span class=\"spacer\"></span>\r\n</mat-toolbar>\r\n<mat-divider></mat-divider>\r\n\r\n<mat-accordion togglePosition=\"before\">\r\n <mat-expansion-panel>\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>\r\n Input json data\r\n <span class=\"spacer\"></span>\r\n <mat-divider style=\"position: absolute; left:0px; width:100%; bottom:0px;\"></mat-divider>\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <div style=\"margin-top: 16px;\"></div>\r\n <mat-card style=\"padding: 16px;\">\r\n <lib-t-dynamic-data-view [data]=\"inputInEdit()\"></lib-t-dynamic-data-view>\r\n </mat-card>\r\n </mat-expansion-panel>\r\n\r\n @if(((inputInEditValidationErrors())||[]).length > 0) {\r\n <mat-expansion-panel>\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>\r\n Validation Errors\r\n <span class=\"spacer\"></span>\r\n <mat-error>\r\n {{(inputInEditValidationErrors())?.length||''}}\r\n </mat-error>\r\n <mat-divider style=\"position: absolute; left:0px; width:100%; bottom:0px;\"></mat-divider>\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <div style=\"margin-top: 16px;\"></div>\r\n <mat-error style=\"border: solid 1px; border-radius: 8px; padding: 16px;\">\r\n <h1>All configuration errors:</h1>\r\n <p>\r\n {{(inputInEditValidationErrors())?.length||''}} errors found. When an error is found, the input will not\r\n be saved.\r\n </p>\r\n <ul>\r\n @for(error of (inputInEditValidationErrors()); track error.key) {\r\n <li>\r\n <strong>{{error.key}}</strong> {{error.message}}\r\n </li>\r\n }\r\n </ul>\r\n </mat-error>\r\n </mat-expansion-panel>\r\n }\r\n</mat-accordion>","import { CommonModule } from '@angular/common';\r\nimport { Component } from '@angular/core';\r\nimport { MatModulesModule } from '../../../../shared/modules/mat-modules.module';\r\n\r\nimport { DefaultElementComponent } from '../default-element/default-element.component';\r\nimport { InputElementEditorComponent } from '../input-element-editor/input-element-editor.component';\r\nimport { FormsStoreService } from '../../../forms/store/forms-store.service';\r\n\r\nimport { Observable, take, tap} from 'rxjs';\r\nimport { DefaultInputConfig } from 'ngx-t-forms-types';\r\n\r\n@Component({\r\n selector: 'app-input-editor',\r\n standalone: true,\r\n imports: [CommonModule, \r\n MatModulesModule,\r\n DefaultElementComponent, \r\n InputElementEditorComponent],\r\n templateUrl: './input-editor.component.html',\r\n styleUrl: './input-editor.component.scss'\r\n})\r\nexport class InputEditorComponent {\r\n defaultInputs = DefaultInputConfig\r\n\r\n inputInEdit$ = this.store.formBuilderSelectors.inputInEdit$\r\n \r\n defaultInputInEdit$ = this.store.formBuilderSelectors.defaultInputInEdit$\r\n\r\n constructor(private store:FormsStoreService) {\r\n }\r\n\r\n saveInput =()=>{\r\n this.inputInEdit$.pipe(\r\n take(1),\r\n tap((input)=>{\r\n if(!input) return\r\n this.store.actionsFormBuilder.saveInput(input.id)\r\n })\r\n ).subscribe()\r\n }\r\n closeEditor=()=> this.store.actions.setInputInEditId({\r\n inputInEdit:null\r\n })\r\n get validationErrors$(): Observable<{\r\n key: string;\r\n message: string;\r\n }[] | null>{\r\n return this.store.formBuilderSelectors.inputInEditValidationErrors$\r\n }\r\n}\r\n","<mat-card \r\n\r\nstyle=\"\r\n\r\nbackground: var(--mat-toolbar-container-background-color, var(--mat-app-surface));\r\nmargin:0px;\r\nborder:solid 1px var(--mat-divider-color, var(--mat-app-outline))\">\r\n \r\n <mat-card-header >\r\n <mat-card-title>\r\n {{\r\n !!(inputInEdit$|async)?.element\r\n ? \"Edit \" + (inputInEdit$|async)?.label + \" element\"\r\n : \"Setup Form Element\"\r\n }}\r\n </mat-card-title>\r\n <mat-card-subtitle> {{\r\n !!(inputInEdit$|async)?.element? \"Configure the element below\": \"Form element are components making up a form section. Types of form elements are defined by their behaviour and use case, for example a date range picker is well suited to determine duration.\"\r\n }}</mat-card-subtitle>\r\n <button style=\"position: absolute;right:4px\" mat-icon-button cdkDragHandle >\r\n <mat-icon>drag_indicator</mat-icon>\r\n </button>\r\n </mat-card-header>\r\n \r\n\r\n\r\n @if(!!((inputInEdit$|async))?.element){\r\n <app-input-element-editor \r\n style=\"background: var(--mat-toolbar-container-background-color, var(--mat-app-surface))\">\r\n </app-input-element-editor>\r\n }@else{\r\n <app-default-element style=\"background: var(--mat-toolbar-container-background-color, var(--mat-app-surface))\"></app-default-element>\r\n }\r\n <br>\r\n\r\n <br>\r\n <mat-divider></mat-divider>\r\n \r\n <mat-card-actions >\r\n <button (click)=\"closeEditor()\" class=\"\" mat-flat-button>close</button>\r\n <span class=\"spacer\"></span>\r\n <button *ngIf=\"!((inputInEdit$|async))?.id\" mat-flat-button \r\n (click)=\"saveInput()\"\r\n [disabled]=\"((validationErrors$|async)||[]).length>0\"\r\n color=\"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AAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAA,IAAA,CAAA,eAAA,EAAA,QAAA,EAAA,2DAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAA,IAAA,CAAA,YAAA,EAAA,QAAA,EAAA,kDAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAC,EAAA,CAAA,UAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,OAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAC,IAAA,CAAA,OAAA,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,SAAA,EAAA,SAAA,EAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACf,uBAAuB,EAAA,QAAA,EAAA,qBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACvB,2BAA2B,EAAA,QAAA,EAAA,0BAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAInB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAVhC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,EAChB,UAAA,EAAA,IAAI,EACP,OAAA,EAAA,CAAC,YAAY;wBACpB,gBAAgB;wBACf,uBAAuB;AACvB,wBAAA,2BAA2B,CAAC,EAAA,QAAA,EAAA,6/DAAA,EAAA,MAAA,EAAA,CAAA,mIAAA,CAAA,EAAA;;;;;"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, Output, Input, HostBinding, Optional, Self, Component } from '@angular/core';
|
|
3
|
+
import { M as MatModulesModule } from './ngx-t-forms-ngx-t-forms-B-w5W1gG.mjs';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { MatFormFieldControl } from '@angular/material/form-field';
|
|
6
|
+
import { Subject } from 'rxjs';
|
|
7
|
+
import * as i1 from '@angular/forms';
|
|
8
|
+
import * as i4 from '@angular/material/chips';
|
|
9
|
+
|
|
10
|
+
class MatChipListEditorComponent {
|
|
11
|
+
static { this.nextId = 0; }
|
|
12
|
+
constructor(ngControl, _elementRef) {
|
|
13
|
+
this.ngControl = ngControl;
|
|
14
|
+
this._elementRef = _elementRef;
|
|
15
|
+
this.stateChanges = new Subject();
|
|
16
|
+
this.id = `lib-mat-chip-list-editor-${MatChipListEditorComponent.nextId++}`;
|
|
17
|
+
this.placeholder = '';
|
|
18
|
+
this.focused = false;
|
|
19
|
+
this.disabled = false;
|
|
20
|
+
this.touched = false;
|
|
21
|
+
this.onTouched = () => { };
|
|
22
|
+
this.errors = [];
|
|
23
|
+
this.required = false;
|
|
24
|
+
this.options = [];
|
|
25
|
+
this.valueChange = new EventEmitter();
|
|
26
|
+
}
|
|
27
|
+
get empty() {
|
|
28
|
+
return !this.value;
|
|
29
|
+
}
|
|
30
|
+
get shouldLabelFloat() {
|
|
31
|
+
return this.focused || !this.empty;
|
|
32
|
+
}
|
|
33
|
+
get errorState() {
|
|
34
|
+
const hasError = !!this.ngControl?.control?.errors || (this.errors || []).length > 0 && this.touched;
|
|
35
|
+
return !this.value && !!this.required || hasError;
|
|
36
|
+
}
|
|
37
|
+
setDescribedByIds(ids) {
|
|
38
|
+
// Ensure the component view is initialized
|
|
39
|
+
if (this._elementRef && this._elementRef.nativeElement) {
|
|
40
|
+
const controlElement = this._elementRef.nativeElement.querySelector('.lib-mat-chip-list-editor');
|
|
41
|
+
// Check if the controlElement exists before attempting to set its attribute
|
|
42
|
+
if (controlElement) {
|
|
43
|
+
controlElement.setAttribute('aria-describedby', ids.join(' '));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
onContainerClick(event) {
|
|
48
|
+
this.markAsTouched();
|
|
49
|
+
this.stateChanges.next();
|
|
50
|
+
}
|
|
51
|
+
markAsTouched() {
|
|
52
|
+
console.log('markAsTouched');
|
|
53
|
+
if (!this.touched) {
|
|
54
|
+
this.onTouched();
|
|
55
|
+
this.touched = true;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
valueListChanged(value) {
|
|
59
|
+
this.valueChange.emit(value);
|
|
60
|
+
}
|
|
61
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: MatChipListEditorComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
62
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: MatChipListEditorComponent, isStandalone: true, selector: "lib-mat-chip-list-editor", inputs: { errors: "errors", value: "value", required: "required", options: "options" }, outputs: { valueChange: "valueChange" }, host: { properties: { "id": "this.id" } }, providers: [{ provide: MatFormFieldControl,
|
|
63
|
+
useExisting: MatChipListEditorComponent }], ngImport: i0, template: "<mat-chip-listbox [value]=\"value\" (change)=\"valueListChanged($event.value)\" aria-l abel=\"Chip select options\">\r\n @for(option of options;track option.value){\r\n <mat-chip-option [value]=\"option.value\">{{option.label}}</mat-chip-option>\r\n }\r\n\r\n</mat-chip-listbox>", styles: [""], dependencies: [{ kind: "ngmodule", type: MatModulesModule }, { kind: "component", type: i4.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i4.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["selectable", "selected"], outputs: ["selectionChange"] }, { kind: "ngmodule", type: CommonModule }] }); }
|
|
64
|
+
}
|
|
65
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: MatChipListEditorComponent, decorators: [{
|
|
66
|
+
type: Component,
|
|
67
|
+
args: [{ selector: 'lib-mat-chip-list-editor', standalone: true, imports: [MatModulesModule, CommonModule], providers: [{ provide: MatFormFieldControl,
|
|
68
|
+
useExisting: MatChipListEditorComponent }], template: "<mat-chip-listbox [value]=\"value\" (change)=\"valueListChanged($event.value)\" aria-l abel=\"Chip select options\">\r\n @for(option of options;track option.value){\r\n <mat-chip-option [value]=\"option.value\">{{option.label}}</mat-chip-option>\r\n }\r\n\r\n</mat-chip-listbox>" }]
|
|
69
|
+
}], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
|
|
70
|
+
type: Optional
|
|
71
|
+
}, {
|
|
72
|
+
type: Self
|
|
73
|
+
}] }, { type: i0.ElementRef }], propDecorators: { id: [{
|
|
74
|
+
type: HostBinding
|
|
75
|
+
}], errors: [{
|
|
76
|
+
type: Input
|
|
77
|
+
}], value: [{
|
|
78
|
+
type: Input
|
|
79
|
+
}], required: [{
|
|
80
|
+
type: Input
|
|
81
|
+
}], options: [{
|
|
82
|
+
type: Input
|
|
83
|
+
}], valueChange: [{
|
|
84
|
+
type: Output
|
|
85
|
+
}] } });
|
|
86
|
+
|
|
87
|
+
export { MatChipListEditorComponent };
|
|
88
|
+
//# sourceMappingURL=ngx-t-forms-mat-chip-list-editor.component-DY7Tsn5l.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-t-forms-mat-chip-list-editor.component-DY7Tsn5l.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/mat-chip-list-editor/mat-chip-list-editor.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/mat-chip-list-editor/mat-chip-list-editor.component.html"],"sourcesContent":["import { Component, ElementRef, EventEmitter, HostBinding, Input, Optional, Output, Self } from '@angular/core';\r\nimport { MatModulesModule } from '../../../../shared/modules/mat-modules.module';\r\nimport { CommonModule } from '@angular/common';\r\nimport { MatFormFieldControl } from '@angular/material/form-field';\r\nimport { Subject } from 'rxjs';\r\nimport { NgControl } from '@angular/forms';\r\nimport { IConfigElementError } from '../../t-dynamic-data-edit.component';\r\n\r\n@Component({\r\n selector: 'lib-mat-chip-list-editor',\r\n standalone: true,\r\n imports: [MatModulesModule, CommonModule],\r\n templateUrl: './mat-chip-list-editor.component.html',\r\n styleUrl: './mat-chip-list-editor.component.css',\r\n providers: [{ provide: MatFormFieldControl,\r\n useExisting:MatChipListEditorComponent}],\r\n})\r\nexport class MatChipListEditorComponent implements MatFormFieldControl<{\r\n label: string,\r\n value: any\r\n}[]> {\r\n\r\n \r\n static nextId = 0;\r\n stateChanges = new Subject<void>();\r\n \r\n @HostBinding() id = `lib-mat-chip-list-editor-${MatChipListEditorComponent.nextId++}`;\r\n \r\n placeholder: string = ''\r\n constructor(@Optional() @Self() public ngControl: NgControl, private _elementRef: ElementRef<HTMLElement>,) { }\r\n focused: boolean = false;\r\n get empty() {\r\n return !this.value\r\n }\r\n get shouldLabelFloat() {\r\n return this.focused || !this.empty;\r\n }\r\n \r\n disabled: boolean = false;\r\n get errorState(): boolean {\r\n const hasError = !!this.ngControl?.control?.errors || (this.errors||[]).length > 0 && this.touched\r\n return !this.value && !!this.required || hasError\r\n }\r\n \r\n controlType?: string | undefined;\r\n autofilled?: boolean | undefined;\r\n userAriaDescribedBy?: string | undefined;\r\n disableAutomaticLabeling?: boolean | undefined;\r\n setDescribedByIds(ids: string[]) {\r\n // Ensure the component view is initialized\r\n if (this._elementRef && this._elementRef.nativeElement) {\r\n const controlElement = this._elementRef.nativeElement.querySelector('.lib-mat-chip-list-editor');\r\n // Check if the controlElement exists before attempting to set its attribute\r\n if (controlElement) {\r\n controlElement.setAttribute('aria-describedby', ids.join(' '));\r\n }\r\n }\r\n }\r\n onContainerClick(event: MouseEvent): void {\r\n this.markAsTouched();\r\n this.stateChanges.next();\r\n }\r\n \r\n touched: boolean = false;\r\n onTouched = () => { };\r\n markAsTouched() {\r\n console.log('markAsTouched')\r\n if (!this.touched) {\r\n this.onTouched();\r\n this.touched = true;\r\n }\r\n }\r\n \r\n \r\n\r\n\r\n @Input() errors:IConfigElementError[] |undefined = [];\r\n @Input() value: any;\r\n @Input() required: boolean = false;\r\n @Input() options:{\r\n label: string,\r\n value: any\r\n }[] | undefined =[]\r\n @Output() valueChange = new EventEmitter<any>();\r\n\r\n valueListChanged(value: any) {\r\n this.valueChange.emit(value);\r\n }\r\n}\r\n","<mat-chip-listbox [value]=\"value\" (change)=\"valueListChanged($event.value)\" aria-l abel=\"Chip select options\">\r\n @for(option of options;track option.value){\r\n <mat-chip-option [value]=\"option.value\">{{option.label}}</mat-chip-option>\r\n }\r\n\r\n</mat-chip-listbox>"],"names":["i2"],"mappings":";;;;;;;;;MAiBa,0BAA0B,CAAA;aAM5B,IAAM,CAAA,MAAA,GAAG,CAAH,CAAK;IAMlB,WAAuC,CAAA,SAAoB,EAAU,WAAoC,EAAA;QAAlE,IAAS,CAAA,SAAA,GAAT,SAAS;QAAqB,IAAW,CAAA,WAAA,GAAX,WAAW;AALhF,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,OAAO,EAAQ;AAEnB,QAAA,IAAA,CAAA,EAAE,GAAG,CAA4B,yBAAA,EAAA,0BAA0B,CAAC,MAAM,EAAE,EAAE;QAErF,IAAW,CAAA,WAAA,GAAW,EAAE;QAExB,IAAO,CAAA,OAAA,GAAY,KAAK;QAQxB,IAAQ,CAAA,QAAA,GAAY,KAAK;QAyBzB,IAAO,CAAA,OAAA,GAAY,KAAK;AACxB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAK,GAAI;QAYV,IAAM,CAAA,MAAA,GAAoC,EAAE;QAEhD,IAAQ,CAAA,QAAA,GAAY,KAAK;QACzB,IAAO,CAAA,OAAA,GAGC,EAAE;AACT,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,YAAY,EAAO;;AApD7C,IAAA,IAAI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A,EAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA,iBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,YAAY,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAM7B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBATtC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,0BAA0B,EACxB,UAAA,EAAA,IAAI,EACP,OAAA,EAAA,CAAC,gBAAgB,EAAE,YAAY,CAAC,EAG7B,SAAA,EAAA,CAAC,EAAE,OAAO,EAAE,mBAAmB;4BACxC,WAAW,EAAA,0BAA2B,EAAC,CAAC,EAAA,QAAA,EAAA,iSAAA,EAAA;;0BAc5B;;0BAAY;kEAHV,EAAE,EAAA,CAAA;sBAAhB;gBAkDU,MAAM,EAAA,CAAA;sBAAd;gBACI,KAAK,EAAA,CAAA;sBAAb;gBACQ,QAAQ,EAAA,CAAA;sBAAhB;gBACQ,OAAO,EAAA,CAAA;sBAAf;gBAIS,WAAW,EAAA,CAAA;sBAApB;;;;;"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, Output, Input, HostBinding, Optional, Self, Component } from '@angular/core';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import { MatFormFieldControl } from '@angular/material/form-field';
|
|
5
|
+
import { Subject } from 'rxjs';
|
|
6
|
+
import { M as MatModulesModule } from './ngx-t-forms-ngx-t-forms-B-w5W1gG.mjs';
|
|
7
|
+
import * as i1 from '@angular/forms';
|
|
8
|
+
import * as i2 from '@angular/material/slider';
|
|
9
|
+
|
|
10
|
+
class MatSliderEditorComponent {
|
|
11
|
+
static { this.nextId = 0; }
|
|
12
|
+
constructor(ngControl, _elementRef) {
|
|
13
|
+
this.ngControl = ngControl;
|
|
14
|
+
this._elementRef = _elementRef;
|
|
15
|
+
this.stateChanges = new Subject();
|
|
16
|
+
this.id = `lib-mat-slider-editor-${MatSliderEditorComponent.nextId++}`;
|
|
17
|
+
this.placeholder = '';
|
|
18
|
+
this.focused = false;
|
|
19
|
+
this.disabled = false;
|
|
20
|
+
this.touched = false;
|
|
21
|
+
this.onTouched = () => { };
|
|
22
|
+
this._required = false;
|
|
23
|
+
this.errors = [];
|
|
24
|
+
this.label = '';
|
|
25
|
+
this.min = 0;
|
|
26
|
+
this.max = 100;
|
|
27
|
+
this.step = 1;
|
|
28
|
+
this.value = 0;
|
|
29
|
+
this.format = (value) => value;
|
|
30
|
+
this.formatLabel = (value) => value;
|
|
31
|
+
this.valueChange = new EventEmitter();
|
|
32
|
+
}
|
|
33
|
+
get empty() {
|
|
34
|
+
return !this.value;
|
|
35
|
+
}
|
|
36
|
+
get shouldLabelFloat() {
|
|
37
|
+
return this.focused || !this.empty;
|
|
38
|
+
}
|
|
39
|
+
get errorState() {
|
|
40
|
+
const hasError = !!this.ngControl?.control?.errors || (this.errors || []).length > 0 && this.touched;
|
|
41
|
+
return !this.value && !!this.required || hasError;
|
|
42
|
+
}
|
|
43
|
+
setDescribedByIds(ids) {
|
|
44
|
+
// Ensure the component view is initialized
|
|
45
|
+
if (this._elementRef && this._elementRef.nativeElement) {
|
|
46
|
+
const controlElement = this._elementRef.nativeElement.querySelector('.lib-mat-slider-editor');
|
|
47
|
+
// Check if the controlElement exists before attempting to set its attribute
|
|
48
|
+
if (controlElement) {
|
|
49
|
+
controlElement.setAttribute('aria-describedby', ids.join(' '));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
onContainerClick(event) {
|
|
54
|
+
this.markAsTouched();
|
|
55
|
+
this.stateChanges.next();
|
|
56
|
+
}
|
|
57
|
+
markAsTouched() {
|
|
58
|
+
console.log('markAsTouched');
|
|
59
|
+
if (!this.touched) {
|
|
60
|
+
this.onTouched();
|
|
61
|
+
this.touched = true;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
set required(value) {
|
|
65
|
+
this._required = value;
|
|
66
|
+
}
|
|
67
|
+
get required() {
|
|
68
|
+
return this._required;
|
|
69
|
+
}
|
|
70
|
+
valueChangedSlider(event) {
|
|
71
|
+
this.valueChange.emit(event);
|
|
72
|
+
}
|
|
73
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: MatSliderEditorComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
74
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.1", type: MatSliderEditorComponent, isStandalone: true, selector: "lib-mat-slider-editor", inputs: { required: "required", errors: "errors", label: "label", min: "min", max: "max", step: "step", value: "value", format: "format", formatLabel: "formatLabel" }, outputs: { valueChange: "valueChange" }, host: { properties: { "id": "this.id" } }, providers: [{ provide: MatFormFieldControl, useExisting: MatSliderEditorComponent }], ngImport: i0, template: "\r\n<section class=\"range\">\r\n <span> {{min || 0 }}</span>\r\n<mat-slider \r\nstyle=\"width: 100%;\" \r\n showTickMarks discrete [displayWith]=\"format || formatLabel\"\r\n[max]=\"max || 100\" min=\"min || 0\"\r\n[step]=\"step || 1\" tickInterval=\"step || 1\">\r\n<input (input)=\"valueChangedSlider($event)\" [value]=\"value\" matSliderThumb>\r\n</mat-slider>\r\n\r\n<span> {{ max || 100 }}</span>\r\n</section>\r\n", styles: [".range{display:flex;align-items:center}\n"], dependencies: [{ kind: "ngmodule", type: MatModulesModule }, { kind: "component", type: i2.MatSlider, selector: "mat-slider", inputs: ["disabled", "discrete", "showTickMarks", "min", "color", "disableRipple", "max", "step", "displayWith"], exportAs: ["matSlider"] }, { kind: "directive", type: i2.MatSliderThumb, selector: "input[matSliderThumb]", inputs: ["value"], outputs: ["valueChange", "dragStart", "dragEnd"], exportAs: ["matSliderThumb"] }, { kind: "ngmodule", type: CommonModule }] }); }
|
|
75
|
+
}
|
|
76
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: MatSliderEditorComponent, decorators: [{
|
|
77
|
+
type: Component,
|
|
78
|
+
args: [{ selector: 'lib-mat-slider-editor', standalone: true, providers: [{ provide: MatFormFieldControl, useExisting: MatSliderEditorComponent }], imports: [MatModulesModule, CommonModule], template: "\r\n<section class=\"range\">\r\n <span> {{min || 0 }}</span>\r\n<mat-slider \r\nstyle=\"width: 100%;\" \r\n showTickMarks discrete [displayWith]=\"format || formatLabel\"\r\n[max]=\"max || 100\" min=\"min || 0\"\r\n[step]=\"step || 1\" tickInterval=\"step || 1\">\r\n<input (input)=\"valueChangedSlider($event)\" [value]=\"value\" matSliderThumb>\r\n</mat-slider>\r\n\r\n<span> {{ max || 100 }}</span>\r\n</section>\r\n", styles: [".range{display:flex;align-items:center}\n"] }]
|
|
79
|
+
}], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
|
|
80
|
+
type: Optional
|
|
81
|
+
}, {
|
|
82
|
+
type: Self
|
|
83
|
+
}] }, { type: i0.ElementRef }], propDecorators: { id: [{
|
|
84
|
+
type: HostBinding
|
|
85
|
+
}], required: [{
|
|
86
|
+
type: Input
|
|
87
|
+
}], errors: [{
|
|
88
|
+
type: Input
|
|
89
|
+
}], label: [{
|
|
90
|
+
type: Input
|
|
91
|
+
}], min: [{
|
|
92
|
+
type: Input
|
|
93
|
+
}], max: [{
|
|
94
|
+
type: Input
|
|
95
|
+
}], step: [{
|
|
96
|
+
type: Input
|
|
97
|
+
}], value: [{
|
|
98
|
+
type: Input
|
|
99
|
+
}], format: [{
|
|
100
|
+
type: Input
|
|
101
|
+
}], formatLabel: [{
|
|
102
|
+
type: Input
|
|
103
|
+
}], valueChange: [{
|
|
104
|
+
type: Output
|
|
105
|
+
}] } });
|
|
106
|
+
|
|
107
|
+
export { MatSliderEditorComponent };
|
|
108
|
+
//# sourceMappingURL=ngx-t-forms-mat-slider-editor.component-Dgd5gyUu.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-t-forms-mat-slider-editor.component-Dgd5gyUu.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/mat-slider-editor/mat-slider-editor.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/mat-slider-editor/mat-slider-editor.component.html"],"sourcesContent":["import { Component, ElementRef, EventEmitter, HostBinding, Input, Optional, Output, Self } from '@angular/core';\r\n\r\nimport { CommonModule } from '@angular/common';\r\nimport { MatFormFieldControl } from '@angular/material/form-field';\r\nimport { Subject } from 'rxjs';\r\nimport { NgControl } from '@angular/forms';\r\nimport { MatModulesModule } from '../../../../shared/modules/mat-modules.module';\r\nimport { IConfigElementError } from '../../t-dynamic-data-edit.component';\r\n\r\n@Component({\r\n selector: 'lib-mat-slider-editor',\r\n standalone: true,\r\n providers: [{ provide: MatFormFieldControl, useExisting: MatSliderEditorComponent }],\r\n imports: [MatModulesModule, CommonModule],\r\n templateUrl: './mat-slider-editor.component.html',\r\n styleUrl: './mat-slider-editor.component.css'\r\n})\r\nexport class MatSliderEditorComponent implements MatFormFieldControl<number> {\r\n\r\n static nextId = 0;\r\n stateChanges = new Subject<void>();\r\n\r\n @HostBinding() id = `lib-mat-slider-editor-${MatSliderEditorComponent.nextId++}`;\r\n\r\n placeholder: string = ''\r\n constructor(@Optional() @Self() public ngControl: NgControl, private _elementRef: ElementRef<HTMLElement>,) { }\r\n focused: boolean = false;\r\n get empty() {\r\n return !this.value\r\n }\r\n get shouldLabelFloat() {\r\n return this.focused || !this.empty;\r\n }\r\n\r\n disabled: boolean = false;\r\n get errorState(): boolean {\r\n const hasError = !!this.ngControl?.control?.errors || (this.errors||[]).length > 0 && this.touched\r\n \r\n return !this.value && !!this.required || hasError\r\n }\r\n\r\n controlType?: string | undefined;\r\n autofilled?: boolean | undefined;\r\n userAriaDescribedBy?: string | undefined;\r\n disableAutomaticLabeling?: boolean | undefined;\r\n setDescribedByIds(ids: string[]) {\r\n // Ensure the component view is initialized\r\n if (this._elementRef && this._elementRef.nativeElement) {\r\n const controlElement = this._elementRef.nativeElement.querySelector('.lib-mat-slider-editor');\r\n // Check if the controlElement exists before attempting to set its attribute\r\n if (controlElement) {\r\n controlElement.setAttribute('aria-describedby', ids.join(' '));\r\n }\r\n }\r\n }\r\n onContainerClick(event: MouseEvent): void {\r\n this.markAsTouched();\r\n this.stateChanges.next();\r\n }\r\n\r\n touched: boolean = false;\r\n onTouched = () => { };\r\n markAsTouched() {\r\n console.log('markAsTouched')\r\n if (!this.touched) {\r\n this.onTouched();\r\n this.touched = true;\r\n }\r\n }\r\n\r\n\r\n _required: boolean = false;\r\n @Input() set required(value: boolean) {\r\n this._required = value;\r\n }\r\n get required(): boolean {\r\n return this._required;\r\n }\r\n @Input() errors:IConfigElementError[] |undefined = [];\r\n @Input() label: string = '';\r\n @Input() min: number = 0;\r\n @Input() max: number = 100;\r\n @Input() step: number = 1;\r\n @Input() value: number = 0;\r\n @Input() format?: (value: any) => any = (value: any) => value;\r\n @Input() formatLabel: (value: any) => any = (value: any) => value;\r\n @Output() valueChange = new EventEmitter<number>();\r\n valueChangedSlider(event: any) {\r\n this.valueChange.emit(event);\r\n }\r\n\r\n}\r\n","\r\n<section class=\"range\">\r\n <span> {{min || 0 }}</span>\r\n<mat-slider \r\nstyle=\"width: 100%;\" \r\n showTickMarks discrete [displayWith]=\"format || formatLabel\"\r\n[max]=\"max || 100\" min=\"min || 0\"\r\n[step]=\"step || 1\" tickInterval=\"step || 1\">\r\n<input (input)=\"valueChangedSlider($event)\" [value]=\"value\" matSliderThumb>\r\n</mat-slider>\r\n\r\n<span> {{ max || 100 }}</span>\r\n</section>\r\n"],"names":[],"mappings":";;;;;;;;;MAiBa,wBAAwB,CAAA;aAE5B,IAAM,CAAA,MAAA,GAAG,CAAH,CAAK;IAMlB,WAAuC,CAAA,SAAoB,EAAU,WAAoC,EAAA;QAAlE,IAAS,CAAA,SAAA,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|
|
3
|
+
import { M as MatModulesModule } from './ngx-t-forms-ngx-t-forms-B-w5W1gG.mjs';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { MatFormFieldControl } from '@angular/material/form-field';
|
|
6
|
+
import { Subject } from 'rxjs/internal/Subject';
|
|
7
|
+
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
8
|
+
import * as i1 from '@angular/forms';
|
|
9
|
+
import * as i2 from '@angular/material/slide-toggle';
|
|
10
|
+
|
|
11
|
+
class MatSliderToggleEditorComponent {
|
|
12
|
+
static { this.nextId = 0; }
|
|
13
|
+
get required() {
|
|
14
|
+
return this._required;
|
|
15
|
+
}
|
|
16
|
+
set required(value) {
|
|
17
|
+
this._required = coerceBooleanProperty(value);
|
|
18
|
+
this.stateChanges.next();
|
|
19
|
+
}
|
|
20
|
+
get value() {
|
|
21
|
+
return this._value;
|
|
22
|
+
}
|
|
23
|
+
set value(val) {
|
|
24
|
+
this._value = val;
|
|
25
|
+
this.onChange(val);
|
|
26
|
+
this.stateChanges.next();
|
|
27
|
+
}
|
|
28
|
+
get placeholder() {
|
|
29
|
+
return this._placeholder;
|
|
30
|
+
}
|
|
31
|
+
set placeholder(value) {
|
|
32
|
+
this._placeholder = value;
|
|
33
|
+
this.stateChanges.next();
|
|
34
|
+
}
|
|
35
|
+
get shouldLabelFloat() {
|
|
36
|
+
return this.focused || !this.empty;
|
|
37
|
+
}
|
|
38
|
+
get empty() {
|
|
39
|
+
return this.value === false;
|
|
40
|
+
}
|
|
41
|
+
get errorState() {
|
|
42
|
+
return !this.value && this.required && this.touched || !!this.ngControl?.errors || (this.errors || []).length > 0;
|
|
43
|
+
}
|
|
44
|
+
constructor(ngControl, _elementRef) {
|
|
45
|
+
this.ngControl = ngControl;
|
|
46
|
+
this._elementRef = _elementRef;
|
|
47
|
+
this.stateChanges = new Subject();
|
|
48
|
+
this.focused = false;
|
|
49
|
+
this.touched = false;
|
|
50
|
+
this.disabled = false;
|
|
51
|
+
this.controlType = 'lib-mat-slider-toggle-editor';
|
|
52
|
+
this.autofilled = false;
|
|
53
|
+
this.name = undefined;
|
|
54
|
+
this.label = '';
|
|
55
|
+
this.errors = [];
|
|
56
|
+
this.valueChange = new EventEmitter();
|
|
57
|
+
this._required = false;
|
|
58
|
+
this._value = false;
|
|
59
|
+
this._placeholder = '';
|
|
60
|
+
this.id = `lib-mat-slider-toggle-editor-${MatSliderToggleEditorComponent.nextId++}`;
|
|
61
|
+
this.describedBy = '';
|
|
62
|
+
// ControlValueAccessor methods
|
|
63
|
+
this.onChange = (_) => { };
|
|
64
|
+
this.onTouched = () => { };
|
|
65
|
+
if (this.ngControl != null) {
|
|
66
|
+
this.ngControl.valueAccessor = this;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
writeValue(value) {
|
|
70
|
+
this._value = value;
|
|
71
|
+
this.stateChanges.next();
|
|
72
|
+
}
|
|
73
|
+
registerOnChange(fn) {
|
|
74
|
+
this.onChange = fn;
|
|
75
|
+
}
|
|
76
|
+
registerOnTouched(fn) {
|
|
77
|
+
this.onTouched = fn;
|
|
78
|
+
}
|
|
79
|
+
setDisabledState(isDisabled) {
|
|
80
|
+
this.disabled = isDisabled;
|
|
81
|
+
this.stateChanges.next();
|
|
82
|
+
}
|
|
83
|
+
// MatFormFieldControl methods
|
|
84
|
+
setDescribedByIds(ids) {
|
|
85
|
+
const element = this._elementRef?.nativeElement;
|
|
86
|
+
if (element) {
|
|
87
|
+
element.setAttribute('aria-describedby', ids.join(' '));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
onContainerClick(event) {
|
|
91
|
+
if (!this.focused) {
|
|
92
|
+
this.focused = true;
|
|
93
|
+
this.stateChanges.next();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
markAsTouched() {
|
|
97
|
+
if (!this.touched) {
|
|
98
|
+
this.touched = true;
|
|
99
|
+
this.onTouched();
|
|
100
|
+
this.stateChanges.next();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
valueToggleChanged(value) {
|
|
104
|
+
this.value = value;
|
|
105
|
+
this.valueChange.emit(value);
|
|
106
|
+
this.markAsTouched();
|
|
107
|
+
}
|
|
108
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: MatSliderToggleEditorComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
109
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.1", type: MatSliderToggleEditorComponent, isStandalone: true, selector: "lib-mat-slider-toggle-editor", inputs: { name: "name", label: "label", errors: "errors", required: "required", value: "value", placeholder: "placeholder" }, outputs: { valueChange: "valueChange" }, host: { properties: { "id": "this.id", "attr.aria-describedby": "this.describedBy", "class.floating": "this.shouldLabelFloat" } }, providers: [
|
|
110
|
+
{
|
|
111
|
+
provide: MatFormFieldControl,
|
|
112
|
+
useExisting: MatSliderToggleEditorComponent
|
|
113
|
+
}
|
|
114
|
+
], ngImport: i0, template: "<mat-slide-toggle\r\n [disabled]=\"disabled\"\r\n [checked]=\"!!value\"\r\n (change)=\"valueToggleChanged($event.checked)\"\r\n (blur)=\"markAsTouched()\"\r\n>\r\n set <strong>on/off</strong> {{ label }}\r\n</mat-slide-toggle>", styles: [""], dependencies: [{ kind: "ngmodule", type: MatModulesModule }, { kind: "component", type: i2.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "ngmodule", type: CommonModule }] }); }
|
|
115
|
+
}
|
|
116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: MatSliderToggleEditorComponent, decorators: [{
|
|
117
|
+
type: Component,
|
|
118
|
+
args: [{ selector: 'lib-mat-slider-toggle-editor', standalone: true, imports: [MatModulesModule, CommonModule], providers: [
|
|
119
|
+
{
|
|
120
|
+
provide: MatFormFieldControl,
|
|
121
|
+
useExisting: MatSliderToggleEditorComponent
|
|
122
|
+
}
|
|
123
|
+
], template: "<mat-slide-toggle\r\n [disabled]=\"disabled\"\r\n [checked]=\"!!value\"\r\n (change)=\"valueToggleChanged($event.checked)\"\r\n (blur)=\"markAsTouched()\"\r\n>\r\n set <strong>on/off</strong> {{ label }}\r\n</mat-slide-toggle>" }]
|
|
124
|
+
}], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
|
|
125
|
+
type: Optional
|
|
126
|
+
}, {
|
|
127
|
+
type: Self
|
|
128
|
+
}] }, { type: i0.ElementRef }], propDecorators: { name: [{
|
|
129
|
+
type: Input
|
|
130
|
+
}], label: [{
|
|
131
|
+
type: Input
|
|
132
|
+
}], errors: [{
|
|
133
|
+
type: Input
|
|
134
|
+
}], valueChange: [{
|
|
135
|
+
type: Output
|
|
136
|
+
}], required: [{
|
|
137
|
+
type: Input
|
|
138
|
+
}], value: [{
|
|
139
|
+
type: Input
|
|
140
|
+
}], placeholder: [{
|
|
141
|
+
type: Input
|
|
142
|
+
}], id: [{
|
|
143
|
+
type: HostBinding
|
|
144
|
+
}], describedBy: [{
|
|
145
|
+
type: HostBinding,
|
|
146
|
+
args: ['attr.aria-describedby']
|
|
147
|
+
}], shouldLabelFloat: [{
|
|
148
|
+
type: HostBinding,
|
|
149
|
+
args: ['class.floating']
|
|
150
|
+
}] } });
|
|
151
|
+
|
|
152
|
+
export { MatSliderToggleEditorComponent };
|
|
153
|
+
//# sourceMappingURL=ngx-t-forms-mat-slider-toggle-editor.component-ClM2gqVq.mjs.map
|