mis-crystal-design-system 4.0.2 → 4.0.4

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.
Files changed (26) hide show
  1. package/bundles/mis-crystal-design-system-dropdown.umd.js +3 -1
  2. package/bundles/mis-crystal-design-system-dropdown.umd.js.map +1 -1
  3. package/bundles/mis-crystal-design-system-dropdown.umd.min.js +1 -1
  4. package/bundles/mis-crystal-design-system-dropdown.umd.min.js.map +1 -1
  5. package/bundles/mis-crystal-design-system-dynamic-form.umd.js +1 -1
  6. package/bundles/mis-crystal-design-system-dynamic-form.umd.js.map +1 -1
  7. package/bundles/mis-crystal-design-system-dynamic-form.umd.min.js +1 -1
  8. package/bundles/mis-crystal-design-system-dynamic-form.umd.min.js.map +1 -1
  9. package/bundles/mis-crystal-design-system-phone-input.umd.js +4 -2
  10. package/bundles/mis-crystal-design-system-phone-input.umd.js.map +1 -1
  11. package/bundles/mis-crystal-design-system-phone-input.umd.min.js +1 -1
  12. package/bundles/mis-crystal-design-system-phone-input.umd.min.js.map +1 -1
  13. package/dropdown/dropdown.component.d.ts +1 -0
  14. package/dropdown/mis-crystal-design-system-dropdown.metadata.json +1 -1
  15. package/esm2015/dropdown/dropdown.component.js +4 -2
  16. package/esm2015/dynamic-form/dynamic-form.component.js +2 -2
  17. package/esm2015/phone-input/phone-input.component.js +5 -3
  18. package/fesm2015/mis-crystal-design-system-dropdown.js +3 -1
  19. package/fesm2015/mis-crystal-design-system-dropdown.js.map +1 -1
  20. package/fesm2015/mis-crystal-design-system-dynamic-form.js +1 -1
  21. package/fesm2015/mis-crystal-design-system-dynamic-form.js.map +1 -1
  22. package/fesm2015/mis-crystal-design-system-phone-input.js +4 -2
  23. package/fesm2015/mis-crystal-design-system-phone-input.js.map +1 -1
  24. package/package.json +1 -1
  25. package/phone-input/mis-crystal-design-system-phone-input.metadata.json +1 -1
  26. package/phone-input/phone-input.component.d.ts +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"mis-crystal-design-system-dropdown.js","sources":["../../../projects/mis-components/dropdown/dropdown.component.ts","../../../projects/mis-components/dropdown/dropdown.module.ts","../../../projects/mis-components/dropdown/mis-crystal-design-system-dropdown.ts"],"sourcesContent":["import { ConnectionPositionPair, Overlay, OverlayConfig, OverlayRef } from \"@angular/cdk/overlay\";\nimport { TemplatePortal } from \"@angular/cdk/portal\";\nimport { Component, ElementRef, EventEmitter, Input, OnInit, Output, TemplateRef, ViewChild, ViewContainerRef } from \"@angular/core\";\nimport { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';\n\n@Component({\n selector: \"mis-dropdown\",\n templateUrl: \"./dropdown.component.html\",\n styleUrls: [\"./dropdown.component.scss\"],\n \n})\nexport class DropdownComponent implements OnInit {\n isOpen = false;\n loading: boolean = false;\n isSearchInputFocused: boolean = false;\n searchInput: string = \"\";\n searchData: DropdownItem[] = [];\n @Input() data: DropdownItem[] = [];\n @Input() height: string = \"\";\n @Input() width: string = \"\";\n @Input() label: string = \"Select\";\n @Input() itemSizeForCdk: number;\n @Input() showOnlyIcon: boolean = false;\n @Input() higlightSelectedValue: boolean = false;\n @Input() dropdownListHeight: string = \"\";\n @Input() dropdownListWidth: string = \"\";\n @Input() dropdownListPosition: \"Left\" | \"Right\" = \"Left\";\n @Input() config\n @Input() searchEnabled: boolean = true;\n @Input() selectedItem: DropdownItem = { value: \"\", label: \"\" };\n @Input() noDataMessage: string = \"No Data\";\n @Input() multiLine: boolean = false;\n @Input() additionalInfoMessage : string;\n @Input() scrollIntoView: boolean = false;\n @Output() onChange: EventEmitter<any> = new EventEmitter();\n @ViewChild(\"select\", { static: false }) selectElement: ElementRef;\n @ViewChild(\"popupContainer\", { static: false }) popupContainer: TemplateRef<Element>;\n @ViewChild(CdkVirtualScrollViewport) viewPort: CdkVirtualScrollViewport;\n private overlayRef: OverlayRef;\n constructor(private eRef: ElementRef, private overlay: Overlay, private viewContainerRef: ViewContainerRef) {}\n ngOnInit() {\n \n\n}\nsetUpAsyncDataSearch()\n{\n if(this.config)\n {\n this.loading = true;\n this.config.dataStream().pipe().subscribe(res=> {\n this.data = res\n this.loading = false\n })\n }\n const index = this.data.findIndex((dataItem) => dataItem.value === this.selectedItem.value);\n if (this.scrollIntoView)\n this.viewPort.scrollToIndex(index, 'smooth');\n}\n filterByValue(array, string: string) {\n return array.filter(o => o.label.toLowerCase().includes(string.toLowerCase().trim()));\n }\n\n filterByPrimaryText(array, string: string) {\n return array.filter(o => o.label.primaryText.toLowerCase().includes(string.toLowerCase().trim()));\n }\n searchInputOnChange(newValue) {\n this.searchInput = newValue;\n if (newValue) {\n this.searchData = this.multiLine ? this.filterByPrimaryText(this.data, newValue) : this.filterByValue(this.data, newValue);\n } else {\n this.searchData = [];\n this.searchInput = \"\";\n }\n }\n searchInputFocused(isFocused: boolean) {\n this.isSearchInputFocused = isFocused;\n }\n searchInputCanceled(event) {\n event.stopPropagation();\n this.searchInput = \"\";\n this.isSearchInputFocused = false;\n }\n toggleDropdown() {\n this.isOpen = !this.isOpen;\n if (this.isOpen) this.openDropdown(this.popupContainer, this.selectElement.nativeElement);\n else this.onCancel();\n }\n private openDropdown(template: TemplateRef<Element>, origin: HTMLElement): void {\n const positionsBottom = [\n new ConnectionPositionPair({ originX: \"start\", originY: \"bottom\" }, { overlayX: \"start\", overlayY: \"top\" }, 0, 4),\n new ConnectionPositionPair({ originX: \"end\", originY: \"bottom\" }, { overlayX: \"end\", overlayY: \"top\" }, 0, 4)\n ];\n const positionsTop = [\n new ConnectionPositionPair({ originX: \"start\", originY: \"top\" }, { overlayX: \"start\", overlayY: \"bottom\" }, 0, -4),\n new ConnectionPositionPair({ originX: \"end\", originY: \"top\" }, { overlayX: \"end\", overlayY: \"bottom\" }, 0, -4)\n ];\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(origin)\n .withPositions([\n ...(this.dropdownListPosition === \"Right\" ? positionsBottom.reverse() : positionsBottom),\n ...(this.dropdownListPosition === \"Right\" ? positionsTop.reverse() : positionsTop)\n ])\n .withPush(true);\n const configs = new OverlayConfig({\n hasBackdrop: true,\n backdropClass: \"cdk-overlay-transparent-backdrop\",\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n positionStrategy,\n width: origin.clientWidth\n });\n this.overlayRef = this.overlay.create(configs);\n if (this.dropdownListWidth) this.overlayRef.updateSize({ width: this.dropdownListWidth });\n if (this.dropdownListHeight) this.overlayRef.updateSize({ height: this.dropdownListHeight });\n this.overlayRef.attach(new TemplatePortal(template, this.viewContainerRef));\n this.overlayRef.backdropClick().subscribe(res => {\n this.onCancel();\n });\n }\n selectItem(item) {\n this.onChange.emit(item); \n this.toggleDropdown();\n }\n onCancel() {\n this.isSearchInputFocused = false;\n this.isOpen = false;\n this.overlayRef?.detach();\n this.searchInput = \"\";\n }\n}\nexport interface DropdownItem {\n label: any ;\n value: string;\n icon?: string;\n disabled?: boolean;\n}\nexport interface ActionItemLabel {\n primaryText ?: string;\n secondaryText ?: string;\n}\n","import { CommonModule } from \"@angular/common\";\nimport { FormsModule } from \"@angular/forms\";\nimport { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { DropdownComponent } from \"./dropdown.component\";\nimport { OverlayModule } from \"@angular/cdk/overlay\";\nimport { ScrollingModule } from \"@angular/cdk-experimental/scrolling\";\nimport { LoaderModule } from \"mis-crystal-design-system/loader\";\n\n@NgModule({\n declarations: [DropdownComponent],\n imports: [CommonModule, FormsModule, OverlayModule, ScrollingModule,LoaderModule],\n exports: [DropdownComponent]\n})\nexport class DropdownModule {\n static forRoot(): ModuleWithProviders<DropdownModule> {\n return { ngModule: DropdownModule, providers: [] };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAWa,iBAAiB;IA4B5B,YAAoB,IAAgB,EAAU,OAAgB,EAAU,gBAAkC;QAAtF,SAAI,GAAJ,IAAI,CAAY;QAAU,YAAO,GAAP,OAAO,CAAS;QAAU,qBAAgB,GAAhB,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cAAc;gBACxB,miLAAwC;;aAGzC;;;YARmB,UAAU;YAFG,OAAO;YAEqD,gBAAgB;;;mBAe1G,KAAK;qBACL,KAAK;oBACL,KAAK;oBACL,KAAK;6BACL,KAAK;2BACL,KAAK;oCACL,KAAK;iCACL,KAAK;gCACL,KAAK;mCACL,KAAK;qBACL,KAAK;4BACL,KAAK;2BACL,KAAK;4BACL,KAAK;wBACL,KAAK;oCACL,KAAK;6BACL,KAAK;uBACL,MAAM;4BACN,SAAS,SAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;6BACrC,SAAS,SAAC,gBAAgB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;uBAC7C,SAAS,SAAC,wBAAwB;;;MCxBxB,cAAc;IACzB,OAAO,OAAO;QACZ,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;KACpD;;;YARF,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,iBAAiB,CAAC;gBACjC,OAAO,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAC,YAAY,CAAC;gBACjF,OAAO,EAAE,CAAC,iBAAiB,CAAC;aAC7B;;;ACZD;;;;;;"}
1
+ {"version":3,"file":"mis-crystal-design-system-dropdown.js","sources":["../../../projects/mis-components/dropdown/dropdown.component.ts","../../../projects/mis-components/dropdown/dropdown.module.ts","../../../projects/mis-components/dropdown/mis-crystal-design-system-dropdown.ts"],"sourcesContent":["import { ConnectionPositionPair, Overlay, OverlayConfig, OverlayRef } from \"@angular/cdk/overlay\";\nimport { TemplatePortal } from \"@angular/cdk/portal\";\nimport { Component, ElementRef, EventEmitter, Input, OnInit, Output, TemplateRef, ViewChild, ViewContainerRef } from \"@angular/core\";\nimport { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';\n\n@Component({\n selector: \"mis-dropdown\",\n templateUrl: \"./dropdown.component.html\",\n styleUrls: [\"./dropdown.component.scss\"],\n \n})\nexport class DropdownComponent implements OnInit {\n isOpen = false;\n loading: boolean = false;\n isSearchInputFocused: boolean = false;\n searchInput: string = \"\";\n searchData: DropdownItem[] = [];\n @Input() data: DropdownItem[] = [];\n @Input() height: string = \"\";\n @Input() width: string = \"\";\n @Input() label: string = \"Select\";\n @Input() itemSizeForCdk: number;\n @Input() showOnlyIcon: boolean = false;\n @Input() higlightSelectedValue: boolean = false;\n @Input() dropdownListHeight: string = \"\";\n @Input() dropdownListWidth: string = \"\";\n @Input() dropdownListPosition: \"Left\" | \"Right\" = \"Left\";\n @Input() config\n @Input() searchEnabled: boolean = true;\n @Input() selectedItem: DropdownItem = { value: \"\", label: \"\" };\n @Input() noDataMessage: string = \"No Data\";\n @Input() multiLine: boolean = false;\n @Input() additionalInfoMessage : string;\n @Input() scrollIntoView: boolean = false;\n @Input() searchLabel:string = \"Search Keyword\"\n @Output() onChange: EventEmitter<any> = new EventEmitter();\n @ViewChild(\"select\", { static: false }) selectElement: ElementRef;\n @ViewChild(\"popupContainer\", { static: false }) popupContainer: TemplateRef<Element>;\n @ViewChild(CdkVirtualScrollViewport) viewPort: CdkVirtualScrollViewport;\n private overlayRef: OverlayRef;\n constructor(private eRef: ElementRef, private overlay: Overlay, private viewContainerRef: ViewContainerRef) {}\n ngOnInit() {\n \n\n}\nsetUpAsyncDataSearch()\n{\n if(this.config)\n {\n this.loading = true;\n this.config.dataStream().pipe().subscribe(res=> {\n this.data = res\n this.loading = false\n })\n }\n const index = this.data.findIndex((dataItem) => dataItem.value === this.selectedItem.value);\n if (this.scrollIntoView)\n this.viewPort.scrollToIndex(index, 'smooth');\n}\n filterByValue(array, string: string) {\n return array.filter(o => o.label.toLowerCase().includes(string.toLowerCase().trim()));\n }\n\n filterByPrimaryText(array, string: string) {\n return array.filter(o => o.label.primaryText.toLowerCase().includes(string.toLowerCase().trim()));\n }\n searchInputOnChange(newValue) {\n this.searchInput = newValue;\n if (newValue) {\n this.searchData = this.multiLine ? this.filterByPrimaryText(this.data, newValue) : this.filterByValue(this.data, newValue);\n } else {\n this.searchData = [];\n this.searchInput = \"\";\n }\n }\n searchInputFocused(isFocused: boolean) {\n this.isSearchInputFocused = isFocused;\n }\n searchInputCanceled(event) {\n event.stopPropagation();\n this.searchInput = \"\";\n this.isSearchInputFocused = false;\n }\n toggleDropdown() {\n this.isOpen = !this.isOpen;\n if (this.isOpen) this.openDropdown(this.popupContainer, this.selectElement.nativeElement);\n else this.onCancel();\n }\n private openDropdown(template: TemplateRef<Element>, origin: HTMLElement): void {\n const positionsBottom = [\n new ConnectionPositionPair({ originX: \"start\", originY: \"bottom\" }, { overlayX: \"start\", overlayY: \"top\" }, 0, 4),\n new ConnectionPositionPair({ originX: \"end\", originY: \"bottom\" }, { overlayX: \"end\", overlayY: \"top\" }, 0, 4)\n ];\n const positionsTop = [\n new ConnectionPositionPair({ originX: \"start\", originY: \"top\" }, { overlayX: \"start\", overlayY: \"bottom\" }, 0, -4),\n new ConnectionPositionPair({ originX: \"end\", originY: \"top\" }, { overlayX: \"end\", overlayY: \"bottom\" }, 0, -4)\n ];\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(origin)\n .withPositions([\n ...(this.dropdownListPosition === \"Right\" ? positionsBottom.reverse() : positionsBottom),\n ...(this.dropdownListPosition === \"Right\" ? positionsTop.reverse() : positionsTop)\n ])\n .withPush(true);\n const configs = new OverlayConfig({\n hasBackdrop: true,\n backdropClass: \"cdk-overlay-transparent-backdrop\",\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n positionStrategy,\n width: origin.clientWidth\n });\n this.overlayRef = this.overlay.create(configs);\n if (this.dropdownListWidth) this.overlayRef.updateSize({ width: this.dropdownListWidth });\n if (this.dropdownListHeight) this.overlayRef.updateSize({ height: this.dropdownListHeight });\n this.overlayRef.attach(new TemplatePortal(template, this.viewContainerRef));\n this.overlayRef.backdropClick().subscribe(res => {\n this.onCancel();\n });\n }\n selectItem(item) {\n this.onChange.emit(item); \n this.toggleDropdown();\n }\n onCancel() {\n this.isSearchInputFocused = false;\n this.isOpen = false;\n this.overlayRef?.detach();\n this.searchInput = \"\";\n }\n}\nexport interface DropdownItem {\n label: any ;\n value: string;\n icon?: string;\n disabled?: boolean;\n}\nexport interface ActionItemLabel {\n primaryText ?: string;\n secondaryText ?: string;\n}\n","import { CommonModule } from \"@angular/common\";\nimport { FormsModule } from \"@angular/forms\";\nimport { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { DropdownComponent } from \"./dropdown.component\";\nimport { OverlayModule } from \"@angular/cdk/overlay\";\nimport { ScrollingModule } from \"@angular/cdk-experimental/scrolling\";\nimport { LoaderModule } from \"mis-crystal-design-system/loader\";\n\n@NgModule({\n declarations: [DropdownComponent],\n imports: [CommonModule, FormsModule, OverlayModule, ScrollingModule,LoaderModule],\n exports: [DropdownComponent]\n})\nexport class DropdownModule {\n static forRoot(): ModuleWithProviders<DropdownModule> {\n return { ngModule: DropdownModule, providers: [] };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAWa,iBAAiB;IA6B5B,YAAoB,IAAgB,EAAU,OAAgB,EAAU,gBAAkC;QAAtF,SAAI,GAAJ,IAAI,CAAY;QAAU,YAAO,GAAP,OAAO,CAAS;QAAU,qBAAgB,GAAhB,gBAAgB,CAAkB;QA5B1G,WAAM,GAAG,KAAK,CAAC;QACf,YAAO,GAAY,KAAK,CAAC;QACzB,yBAAoB,GAAY,KAAK,CAAC;QACtC,gBAAW,GAAW,EAAE,CAAC;QACzB,eAAU,GAAmB,EAAE,CAAC;QACvB,SAAI,GAAoB,EAAE,CAAC;QAC3B,WAAM,GAAW,EAAE,CAAC;QACpB,UAAK,GAAW,EAAE,CAAC;QACnB,UAAK,GAAW,QAAQ,CAAC;QAEzB,iBAAY,GAAY,KAAK,CAAC;QAC9B,0BAAqB,GAAY,KAAK,CAAC;QACvC,uBAAkB,GAAW,EAAE,CAAC;QAChC,sBAAiB,GAAW,EAAE,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BAAgB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;uBAC7C,SAAS,SAAC,wBAAwB;;;MCzBxB,cAAc;IACzB,OAAO,OAAO;QACZ,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;KACpD;;;YARF,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,iBAAiB,CAAC;gBACjC,OAAO,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAC,YAAY,CAAC;gBACjF,OAAO,EAAE,CAAC,iBAAiB,CAAC;aAC7B;;;ACZD;;;;;;"}
@@ -89,7 +89,7 @@ class DynamicFormComponent {
89
89
  for (let field of formFields) {
90
90
  let fieldValue = ((_a = formValues[field.configName]) === null || _a === void 0 ? void 0 : _a.value) ? formValues[field.configName].value : formValues[field.configName];
91
91
  let fieldControl = this.mapFormValueToFormField(field, fieldValue);
92
- let subFieldsControls = this.generateSubDynamicFields(formValues, field, fieldValue);
92
+ let subFieldsControls = this.generateSubDynamicFields(formValues, field, fieldControl.value);
93
93
  formArray.push(new FormGroup({
94
94
  value: fieldControl,
95
95
  subFields: subFieldsControls
@@ -1 +1 @@
1
- {"version":3,"file":"mis-crystal-design-system-dynamic-form.js","sources":["../../../projects/mis-components/dynamic-form/dynamic-form.component.ts","../../../projects/mis-components/dynamic-form/dynamic-form.module.ts","../../../projects/mis-components/dynamic-form/mis-crystal-design-system-dynamic-form.ts"],"sourcesContent":["import { Component, EventEmitter, HostListener, Input, OnDestroy, OnInit, Output } from \"@angular/core\";\nimport { NsDynamicForm } from \"./dynamic-form.namespace\";\nimport { AbstractControl, FormArray, FormControl, FormGroup, ValidationErrors, ValidatorFn, Validators } from \"@angular/forms\";\n\nimport * as moment from \"moment\";\nimport \"moment-timezone\";\nimport { Subscription } from \"rxjs\";\n\n@Component({\n selector: \"mis-dynamic-form\",\n templateUrl: \"./dynamic-form.component.html\",\n styleUrls: [\"./dynamic-form.component.scss\"]\n})\nexport class DynamicFormComponent implements OnInit, OnDestroy {\n /**\n * formFields: Dynamic fields recieved from the API metadata to build a dynamic form\n * formValues: Holds the value of the dynamic form with \"key\" being dynamic field \"title\"\n * and value being the user input.\n */\n @Input() formFields: Array<NsDynamicForm.IDynamicField> = [];\n @Input() formValues: { [key: string]: any } = {};\n // Need to deprecate these inputs and use constants.\n @Input() activeBtnIconUrl = \"\";\n @Input() calendarIconUrl = \"\";\n /**\n * dynamicForm: Constructed using formFields and formValues(in case of edit)\n */\n dynamicForm: FormGroup;\n\n /**\n * formUpdated: Emits formValues Object whenever there is a change in the dynamic form.\n */\n @Output() formUpdated = new EventEmitter<{ [key: string]: any }>();\n /**\n * formValid: Emits boolean depending on validity of the form\n */\n @Output() formValid = new EventEmitter<boolean>();\n /**\n * formInitialized: Emits dynamic form API on form initilization\n */\n @Output() formInitialized = new EventEmitter<any>();\n\n dynamicFormAPI: NsDynamicForm.IDynamicFormAPI;\n valueChangesSubscription$: Subscription;\n\n constructor() {}\n\n ngOnInit(): void {\n // Building the form\n this.dynamicForm = this.generateDynamicForm(this.formFields, this.formValues);\n\n // Subscribing to form changes and emiting values.\n this.valueChangesSubscription$ = this.dynamicForm.valueChanges.subscribe(formValue => {\n this.onFormValueChanges();\n });\n\n //api to expose functions\n this.dynamicFormAPI = {\n defaultFormValues: () => {\n return this.generateDynamicFieldsValueObject(this.dynamicForm.value.dynamicFields);\n }\n };\n this.formInitialized.emit(this.dynamicFormAPI);\n }\n ngOnDestroy(): void {\n this.valueChangesSubscription$?.unsubscribe();\n }\n onFormValueChanges(): void {\n let formValues = this.generateDynamicFieldsValueObject(this.dynamicForm.value.dynamicFields);\n this.formValid.emit(this.dynamicForm.valid);\n this.formUpdated.emit(formValues);\n console.log(formValues)\n }\n generateDynamicFieldsValueObject(formValues: Array<any>): { [key: string]: any } {\n let dynamicFieldsValue = {};\n formValues.forEach((fieldValue, index) => {\n let formattedValue = this.mapFormFieldToFormValue(this.formFields[index], fieldValue.value);\n if (fieldValue.subFields?.length > 0) {\n let formattedSubFieldsValues = {}\n fieldValue.subFields.forEach((subFieldValue, subIndex) => {\n let subFormField = this.formFields[index].subFields[subIndex]\n formattedSubFieldsValues[subFormField.configName] = this.mapFormFieldToFormValue(subFormField, subFieldValue)\n })\n dynamicFieldsValue[this.formFields[index].configName] = {\n value: formattedValue,\n subFields: formattedSubFieldsValues\n }\n }\n else {\n dynamicFieldsValue[this.formFields[index].configName] = formattedValue;\n }\n });\n return dynamicFieldsValue;\n }\n generateDynamicForm(\n formFields: Array<NsDynamicForm.IDynamicField>,\n formValues: { [key: string]: any }\n ): FormGroup {\n let formArray = new FormArray([])\n\n for (let field of formFields) {\n let fieldValue = formValues[field.configName]?.value ? formValues[field.configName].value : formValues[field.configName]\n let fieldControl = this.mapFormValueToFormField(field, fieldValue);\n let subFieldsControls = this.generateSubDynamicFields(formValues, field, fieldValue);\n formArray.push(new FormGroup({\n value: fieldControl,\n subFields: subFieldsControls\n }))\n } \n return new FormGroup({\n dynamicFields: formArray\n })\n }\n getDynamicFieldsControls(): FormArray {\n return this.dynamicForm.get(\"dynamicFields\") as FormArray;\n }\n updateSubDynamicFields(\n field: NsDynamicForm.IDynamicField,\n formGroup: FormGroup,\n value: any\n ): void {\n if (field.subFields?.length > 0) {\n let subFieldsControls = this.generateSubDynamicFields(this.formValues, field, value);\n formGroup.removeControl('subFields')\n formGroup.addControl('subFields', subFieldsControls)\n }\n }\n updateSelectedValueForSingleSelect(\n field: NsDynamicForm.IDynamicField,\n control: FormControl,\n formGroup: FormGroup,\n value: any\n ): void {\n if (control.value?.value !== value.value) {\n control.setValue(value);\n }\n else control.setValue('');\n this.updateSubDynamicFields(field, formGroup, value);\n control.markAsTouched();\n }\n updateSelectedValueForMultiSelect(\n field: NsDynamicForm.IDynamicField,\n control: FormControl,\n formGroup: FormGroup,\n values: Array<any>\n ): void {\n let selectedValues: Array<{ label: string; value: any }> = control.value;\n for (let value of values) {\n let itemIndex = selectedValues.findIndex(item => item.label === value.label);\n if (itemIndex > -1) {\n selectedValues.splice(itemIndex, 1);\n } else {\n selectedValues.push({ ...value });\n }\n }\n control.setValue(selectedValues);\n this.updateSubDynamicFields(field, formGroup, values);\n control.markAsTouched();\n }\n isCheckBoxSelected(value: string, selectedValues: Array<{ label: string; value: string }>): boolean {\n return selectedValues.findIndex(item => item.label === value) > -1;\n }\n generateSubDynamicFields(\n formValues: any,\n parentField: NsDynamicForm.IDynamicField,\n parentValue: Array<{ label: string, value: string | number }> | {label: string, value: string } | string | number | boolean\n ): FormArray {\n let controls = new FormArray([])\n let subFields = parentField.subFields\n let subFieldsValues = formValues[parentField.configName]?.subFields ? formValues[parentField.configName].subFields : {}\n if(!subFields) return controls;\n if (parentField.fieldType === 'singleSelect') {\n subFields = subFields.filter((subField) => subField.parentConfigValue === (<{label: string, value: string }>parentValue)?.value);\n }\n else if (parentField.fieldType === 'multiSelect') {\n let parentValues = new Set((<Array<{ label: string, value: string | number }>>parentValue).map((value) => value.value));\n subFields = subFields.filter((subField) => parentValues.has(subField.parentConfigValue));\n }\n\n if (subFields?.length > 0) {\n for (let subField of subFields) {\n controls.push(this.mapFormValueToFormField(subField, subFieldsValues[subField.configName]))\n }\n }\n return controls;\n }\n mapFormValueToFormField(formField: NsDynamicForm.IDynamicField, formValue: any): any {\n let validators = formField.validators ? [dynamicFieldValidator(formField.validators)]: []\n let control = new FormControl(null, validators);\n\n if (formField.fieldType === \"input\") {\n if (formField.fieldInputType === \"text\" || formField.fieldInputType === \"textarea\") control.setValue(formValue ? formValue : \"\");\n else if (formField.fieldInputType === \"number\") control.setValue(formValue ? formValue : 0);\n else if (formField.fieldInputType === \"date\") {\n if (formValue && typeof formValue === \"number\") {\n control.setValue(moment(formValue).tz(formField.fieldConfig.timezone).format(formField.fieldConfig.format));\n } else {\n control.setValue(moment().tz(formField.fieldConfig.timezone).format(formField.fieldConfig.format));\n }\n }\n } else if (formField.fieldType === \"singleSelect\") {\n const findSelectedValue = () => {\n let index = formField.itemsList.findIndex(item => item.value === formValue)\n return index > 0 ? formField.itemsList[index]: \"\";\n }\n if (formField.fieldInputType === \"dropdown\") {\n if (!formValue) control.setValue(formField.itemsList[0]);\n else control.setValue(findSelectedValue())\n }\n else if (formField.fieldInputType === \"radio\") {\n control.setValue(findSelectedValue())\n }\n } else if (formField.fieldType === \"multiSelect\") {\n if (formValue && Array.isArray(formValue)) {\n let selectedValues = [];\n for (let value of formValue) {\n let index = formField.itemsList.findIndex(item => item.value === value);\n if (index > -1) selectedValues.push({ ...formField.itemsList[index] });\n }\n control.setValue(selectedValues);\n } else {\n control.setValue([]);\n }\n } else if (formField.fieldType === \"boolean\") {\n control.setValue(!!formValue);\n } else control.setValue(null);\n return control;\n }\n mapFormFieldToFormValue(formField: NsDynamicForm.IDynamicField, formValue: any): any {\n if (formField.fieldType === \"input\") {\n if (formField.fieldInputType === \"text\" || formField.fieldInputType === \"textarea\") return formValue;\n else if (formField.fieldInputType === \"number\") return +formValue;\n else if (formField.fieldInputType === \"date\") {\n return moment.tz(formValue, formField.fieldConfig.format, formField.fieldConfig.timezone).valueOf();\n }\n } else if (formField.fieldType === \"singleSelect\") {\n return formValue?.value ?? '';\n } else if (formField.fieldType === \"multiSelect\") {\n return formValue?.map(item => item.value);\n } else if (formField.fieldType === \"boolean\") {\n return formValue;\n } else return formValue;\n }\n}\n\nexport const dynamicFieldValidator = (validators: Array<NsDynamicForm.IDynamicFieldValidator>): ValidatorFn => {\n return (control: AbstractControl): ValidationErrors | null => {\n let value = control.value\n if (Array.isArray(value)) {\n return null;\n }\n else if (typeof value === 'object') {\n value = value?.value ? value.value : ''\n }\n let errors = null\n\n validators.forEach((validator) => {\n let error = null\n let message = validator.message\n switch (validator.type) {\n case \"Required\":\n error = Validators.required(control)\n if(error) error = {Required: message}\n break;\n case \"MinLength\":\n error = Validators.minLength(+validator.value)(control)\n message = message.replace('${0}', error?.minlength.requiredLength)\n if(error) error = { MinLength: message }\n break;\n case \"MaxLength\":\n error = Validators.maxLength(+validator.value)(control)\n message = message.replace('${0}', error?.actualLength)\n if(error) error = { MaxLength: message }\n break;\n case \"Email\":\n error = Validators.email(control)\n if(error) error = {Email: message}\n break;\n case \"Custom\":\n error = Validators.pattern(`${validator.value}`)(control)\n if(error) error = {Custom: message}\n break;\n default:\n break;\n }\n if (error) errors = { ...errors, ...error }\n })\n return errors\n }\n}","import { CommonModule } from \"@angular/common\";\nimport { FormsModule } from \"@angular/forms\";\nimport { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { OverlayModule } from \"@angular/cdk/overlay\";\nimport { ScrollingModule } from \"@angular/cdk-experimental/scrolling\";\nimport { DropdownModule } from \"mis-crystal-design-system/dropdown\";\nimport { ReactiveFormsModule } from \"@angular/forms\";\nimport { DynamicFormComponent } from \"./dynamic-form.component\";\nimport { SwitchModule } from \"mis-crystal-design-system/switch\";\nimport { MultiSelectDropdownModule } from \"mis-crystal-design-system/multi-select-dropdown\";\nimport { DatepickerModuleV2 } from \"mis-crystal-design-system/datepicker_v2\";\n\n@NgModule({\n declarations: [DynamicFormComponent],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n FormsModule,\n OverlayModule,\n ScrollingModule,\n DropdownModule,\n SwitchModule,\n MultiSelectDropdownModule,\n DatepickerModuleV2\n ],\n exports: [DynamicFormComponent]\n})\nexport class DynamicFormModule {\n static forRoot(): ModuleWithProviders<DynamicFormModule> {\n return { ngModule: DynamicFormModule, providers: [] };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["moment.tz"],"mappings":";;;;;;;;;;;;;MAaa,oBAAoB;IAgC/B;;;;;;QA1BS,eAAU,GAAuC,EAAE,CAAC;QACpD,eAAU,GAA2B,EAAE,CAAC;;QAExC,qBAAgB,GAAG,EAAE,CAAC;QACtB,oBAAe,GAAG,EAAE,CAAC;;;;QASpB,gBAAW,GAAG,IAAI,YAAY,EAA0B,CAAC;;;;QAIzD,cAAS,GAAG,IAAI,YAAY,EAAW,CAA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D;;;;;;"}
1
+ {"version":3,"file":"mis-crystal-design-system-dynamic-form.js","sources":["../../../projects/mis-components/dynamic-form/dynamic-form.component.ts","../../../projects/mis-components/dynamic-form/dynamic-form.module.ts","../../../projects/mis-components/dynamic-form/mis-crystal-design-system-dynamic-form.ts"],"sourcesContent":["import { Component, EventEmitter, HostListener, Input, OnDestroy, OnInit, Output } from \"@angular/core\";\nimport { NsDynamicForm } from \"./dynamic-form.namespace\";\nimport { AbstractControl, FormArray, FormControl, FormGroup, ValidationErrors, ValidatorFn, Validators } from \"@angular/forms\";\n\nimport * as moment from \"moment\";\nimport \"moment-timezone\";\nimport { Subscription } from \"rxjs\";\n\n@Component({\n selector: \"mis-dynamic-form\",\n templateUrl: \"./dynamic-form.component.html\",\n styleUrls: [\"./dynamic-form.component.scss\"]\n})\nexport class DynamicFormComponent implements OnInit, OnDestroy {\n /**\n * formFields: Dynamic fields recieved from the API metadata to build a dynamic form\n * formValues: Holds the value of the dynamic form with \"key\" being dynamic field \"title\"\n * and value being the user input.\n */\n @Input() formFields: Array<NsDynamicForm.IDynamicField> = [];\n @Input() formValues: { [key: string]: any } = {};\n // Need to deprecate these inputs and use constants.\n @Input() activeBtnIconUrl = \"\";\n @Input() calendarIconUrl = \"\";\n /**\n * dynamicForm: Constructed using formFields and formValues(in case of edit)\n */\n dynamicForm: FormGroup;\n\n /**\n * formUpdated: Emits formValues Object whenever there is a change in the dynamic form.\n */\n @Output() formUpdated = new EventEmitter<{ [key: string]: any }>();\n /**\n * formValid: Emits boolean depending on validity of the form\n */\n @Output() formValid = new EventEmitter<boolean>();\n /**\n * formInitialized: Emits dynamic form API on form initilization\n */\n @Output() formInitialized = new EventEmitter<any>();\n\n dynamicFormAPI: NsDynamicForm.IDynamicFormAPI;\n valueChangesSubscription$: Subscription;\n\n constructor() {}\n\n ngOnInit(): void {\n // Building the form\n this.dynamicForm = this.generateDynamicForm(this.formFields, this.formValues);\n\n // Subscribing to form changes and emiting values.\n this.valueChangesSubscription$ = this.dynamicForm.valueChanges.subscribe(formValue => {\n this.onFormValueChanges();\n });\n\n //api to expose functions\n this.dynamicFormAPI = {\n defaultFormValues: () => {\n return this.generateDynamicFieldsValueObject(this.dynamicForm.value.dynamicFields);\n }\n };\n this.formInitialized.emit(this.dynamicFormAPI);\n }\n ngOnDestroy(): void {\n this.valueChangesSubscription$?.unsubscribe();\n }\n onFormValueChanges(): void {\n let formValues = this.generateDynamicFieldsValueObject(this.dynamicForm.value.dynamicFields);\n this.formValid.emit(this.dynamicForm.valid);\n this.formUpdated.emit(formValues);\n console.log(formValues)\n }\n generateDynamicFieldsValueObject(formValues: Array<any>): { [key: string]: any } {\n let dynamicFieldsValue = {};\n formValues.forEach((fieldValue, index) => {\n let formattedValue = this.mapFormFieldToFormValue(this.formFields[index], fieldValue.value);\n if (fieldValue.subFields?.length > 0) {\n let formattedSubFieldsValues = {}\n fieldValue.subFields.forEach((subFieldValue, subIndex) => {\n let subFormField = this.formFields[index].subFields[subIndex]\n formattedSubFieldsValues[subFormField.configName] = this.mapFormFieldToFormValue(subFormField, subFieldValue)\n })\n dynamicFieldsValue[this.formFields[index].configName] = {\n value: formattedValue,\n subFields: formattedSubFieldsValues\n }\n }\n else {\n dynamicFieldsValue[this.formFields[index].configName] = formattedValue;\n }\n });\n return dynamicFieldsValue;\n }\n generateDynamicForm(\n formFields: Array<NsDynamicForm.IDynamicField>,\n formValues: { [key: string]: any }\n ): FormGroup {\n let formArray = new FormArray([])\n\n for (let field of formFields) {\n let fieldValue = formValues[field.configName]?.value ? formValues[field.configName].value : formValues[field.configName]\n let fieldControl = this.mapFormValueToFormField(field, fieldValue);\n let subFieldsControls = this.generateSubDynamicFields(formValues, field, fieldControl.value);\n formArray.push(new FormGroup({\n value: fieldControl,\n subFields: subFieldsControls\n }))\n } \n return new FormGroup({\n dynamicFields: formArray\n })\n }\n getDynamicFieldsControls(): FormArray {\n return this.dynamicForm.get(\"dynamicFields\") as FormArray;\n }\n updateSubDynamicFields(\n field: NsDynamicForm.IDynamicField,\n formGroup: FormGroup,\n value: any\n ): void {\n if (field.subFields?.length > 0) {\n let subFieldsControls = this.generateSubDynamicFields(this.formValues, field, value);\n formGroup.removeControl('subFields')\n formGroup.addControl('subFields', subFieldsControls)\n }\n }\n updateSelectedValueForSingleSelect(\n field: NsDynamicForm.IDynamicField,\n control: FormControl,\n formGroup: FormGroup,\n value: any\n ): void {\n if (control.value?.value !== value.value) {\n control.setValue(value);\n }\n else control.setValue('');\n this.updateSubDynamicFields(field, formGroup, value);\n control.markAsTouched();\n }\n updateSelectedValueForMultiSelect(\n field: NsDynamicForm.IDynamicField,\n control: FormControl,\n formGroup: FormGroup,\n values: Array<any>\n ): void {\n let selectedValues: Array<{ label: string; value: any }> = control.value;\n for (let value of values) {\n let itemIndex = selectedValues.findIndex(item => item.label === value.label);\n if (itemIndex > -1) {\n selectedValues.splice(itemIndex, 1);\n } else {\n selectedValues.push({ ...value });\n }\n }\n control.setValue(selectedValues);\n this.updateSubDynamicFields(field, formGroup, values);\n control.markAsTouched();\n }\n isCheckBoxSelected(value: string, selectedValues: Array<{ label: string; value: string }>): boolean {\n return selectedValues.findIndex(item => item.label === value) > -1;\n }\n generateSubDynamicFields(\n formValues: any,\n parentField: NsDynamicForm.IDynamicField,\n parentValue: Array<{ label: string, value: string | number }> | {label: string, value: string } | string | number | boolean\n ): FormArray {\n let controls = new FormArray([])\n let subFields = parentField.subFields\n let subFieldsValues = formValues[parentField.configName]?.subFields ? formValues[parentField.configName].subFields : {}\n if(!subFields) return controls;\n if (parentField.fieldType === 'singleSelect') {\n subFields = subFields.filter((subField) => subField.parentConfigValue === (<{label: string, value: string }>parentValue)?.value);\n }\n else if (parentField.fieldType === 'multiSelect') {\n let parentValues = new Set((<Array<{ label: string, value: string | number }>>parentValue).map((value) => value.value));\n subFields = subFields.filter((subField) => parentValues.has(subField.parentConfigValue));\n }\n\n if (subFields?.length > 0) {\n for (let subField of subFields) {\n controls.push(this.mapFormValueToFormField(subField, subFieldsValues[subField.configName]))\n }\n }\n return controls;\n }\n mapFormValueToFormField(formField: NsDynamicForm.IDynamicField, formValue: any): any {\n let validators = formField.validators ? [dynamicFieldValidator(formField.validators)]: []\n let control = new FormControl(null, validators);\n\n if (formField.fieldType === \"input\") {\n if (formField.fieldInputType === \"text\" || formField.fieldInputType === \"textarea\") control.setValue(formValue ? formValue : \"\");\n else if (formField.fieldInputType === \"number\") control.setValue(formValue ? formValue : 0);\n else if (formField.fieldInputType === \"date\") {\n if (formValue && typeof formValue === \"number\") {\n control.setValue(moment(formValue).tz(formField.fieldConfig.timezone).format(formField.fieldConfig.format));\n } else {\n control.setValue(moment().tz(formField.fieldConfig.timezone).format(formField.fieldConfig.format));\n }\n }\n } else if (formField.fieldType === \"singleSelect\") {\n const findSelectedValue = () => {\n let index = formField.itemsList.findIndex(item => item.value === formValue)\n return index > 0 ? formField.itemsList[index]: \"\";\n }\n if (formField.fieldInputType === \"dropdown\") {\n if (!formValue) control.setValue(formField.itemsList[0]);\n else control.setValue(findSelectedValue())\n }\n else if (formField.fieldInputType === \"radio\") {\n control.setValue(findSelectedValue())\n }\n } else if (formField.fieldType === \"multiSelect\") {\n if (formValue && Array.isArray(formValue)) {\n let selectedValues = [];\n for (let value of formValue) {\n let index = formField.itemsList.findIndex(item => item.value === value);\n if (index > -1) selectedValues.push({ ...formField.itemsList[index] });\n }\n control.setValue(selectedValues);\n } else {\n control.setValue([]);\n }\n } else if (formField.fieldType === \"boolean\") {\n control.setValue(!!formValue);\n } else control.setValue(null);\n return control;\n }\n mapFormFieldToFormValue(formField: NsDynamicForm.IDynamicField, formValue: any): any {\n if (formField.fieldType === \"input\") {\n if (formField.fieldInputType === \"text\" || formField.fieldInputType === \"textarea\") return formValue;\n else if (formField.fieldInputType === \"number\") return +formValue;\n else if (formField.fieldInputType === \"date\") {\n return moment.tz(formValue, formField.fieldConfig.format, formField.fieldConfig.timezone).valueOf();\n }\n } else if (formField.fieldType === \"singleSelect\") {\n return formValue?.value ?? '';\n } else if (formField.fieldType === \"multiSelect\") {\n return formValue?.map(item => item.value);\n } else if (formField.fieldType === \"boolean\") {\n return formValue;\n } else return formValue;\n }\n}\n\nexport const dynamicFieldValidator = (validators: Array<NsDynamicForm.IDynamicFieldValidator>): ValidatorFn => {\n return (control: AbstractControl): ValidationErrors | null => {\n let value = control.value\n if (Array.isArray(value)) {\n return null;\n }\n else if (typeof value === 'object') {\n value = value?.value ? value.value : ''\n }\n let errors = null\n\n validators.forEach((validator) => {\n let error = null\n let message = validator.message\n switch (validator.type) {\n case \"Required\":\n error = Validators.required(control)\n if(error) error = {Required: message}\n break;\n case \"MinLength\":\n error = Validators.minLength(+validator.value)(control)\n message = message.replace('${0}', error?.minlength.requiredLength)\n if(error) error = { MinLength: message }\n break;\n case \"MaxLength\":\n error = Validators.maxLength(+validator.value)(control)\n message = message.replace('${0}', error?.actualLength)\n if(error) error = { MaxLength: message }\n break;\n case \"Email\":\n error = Validators.email(control)\n if(error) error = {Email: message}\n break;\n case \"Custom\":\n error = Validators.pattern(`${validator.value}`)(control)\n if(error) error = {Custom: message}\n break;\n default:\n break;\n }\n if (error) errors = { ...errors, ...error }\n })\n return errors\n }\n}","import { CommonModule } from \"@angular/common\";\nimport { FormsModule } from \"@angular/forms\";\nimport { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { OverlayModule } from \"@angular/cdk/overlay\";\nimport { ScrollingModule } from \"@angular/cdk-experimental/scrolling\";\nimport { DropdownModule } from \"mis-crystal-design-system/dropdown\";\nimport { ReactiveFormsModule } from \"@angular/forms\";\nimport { DynamicFormComponent } from \"./dynamic-form.component\";\nimport { SwitchModule } from \"mis-crystal-design-system/switch\";\nimport { MultiSelectDropdownModule } from \"mis-crystal-design-system/multi-select-dropdown\";\nimport { DatepickerModuleV2 } from \"mis-crystal-design-system/datepicker_v2\";\n\n@NgModule({\n declarations: [DynamicFormComponent],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n FormsModule,\n OverlayModule,\n ScrollingModule,\n DropdownModule,\n SwitchModule,\n MultiSelectDropdownModule,\n DatepickerModuleV2\n ],\n exports: [DynamicFormComponent]\n})\nexport class DynamicFormModule {\n static forRoot(): ModuleWithProviders<DynamicFormModule> {\n return { ngModule: DynamicFormModule, providers: [] };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["moment.tz"],"mappings":";;;;;;;;;;;;;MAaa,oBAAoB;IAgC/B;;;;;;QA1BS,eAAU,GAAuC,EAAE,CAAC;QACpD,eAAU,GAA2B,EAAE,CAAC;;QAExC,qBAAgB,GAAG,EAAE,CAAC;QACtB,oBAAe,GAAG,EAAE,CAAC;;;;QASpB,gBAAW,GAAG,IAAI,YAAY,EAA0B,CAAC;;;;QAIzD,cAAS,GAAG,IAAI,YAAY,EAAW,CAAC;;;;QAIxC,oBAAe,GAAG,IAAI,YAAY,EAAO,CAAC;KAKpC;IAEhB,QAAQ;;QAEN,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;;QAG9E,IAAI,CAAC,yBAAyB,GAAG,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,SAAS,CAAC,SAAS;YAChF,IAAI,CAAC,kBAAkB,EAAE,CAAC;SAC3B,CAAC,CAAC;;QAGH,IAAI,CAAC,cAAc,GAAG;YACpB,iBAAiB,EAAE;gBACjB,OAAO,IAAI,CAAC,gCAAgC,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;aACpF;SACF,CAAC;QACF,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;KAChD;IACD,WAAW;;QACT,MAAA,IAAI,CAAC,yBAAyB,0CAAE,WAAW,GAAG;KAC/C;IACD,kBAAkB;QAChB,IAAI,UAAU,GAAG,IAAI,CAAC,gCAAgC,CAAC,IAAI,CAAC,WAAW,CAAC,KA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aACT;YACD,IAAI,KAAK;gBAAE,MAAM,mCAAQ,MAAM,GAAK,KAAK,CAAE,CAAA;SAC5C,CAAC,CAAA;QACF,OAAO,MAAM,CAAA;KACd,CAAA;AACH,CAAC;;MCtQY,iBAAiB;IAC5B,OAAO,OAAO;QACZ,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;KACvD;;;YAlBF,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,oBAAoB,CAAC;gBACpC,OAAO,EAAE;oBACP,YAAY;oBACZ,mBAAmB;oBACnB,WAAW;oBACX,aAAa;oBACb,eAAe;oBACf,cAAc;oBACd,YAAY;oBACZ,yBAAyB;oBACzB,kBAAkB;iBACnB;gBACD,OAAO,EAAE,CAAC,oBAAoB,CAAC;aAChC;;;AC1BD;;;;;;"}
@@ -14,6 +14,7 @@ class PhoneInputComponent {
14
14
  this.onDropdownSelection = new EventEmitter();
15
15
  this.searchEnabled = false;
16
16
  this.inputType = "number";
17
+ this.searchLabel = "Search Keyword";
17
18
  }
18
19
  ngOnInit() {
19
20
  }
@@ -24,7 +25,7 @@ class PhoneInputComponent {
24
25
  PhoneInputComponent.decorators = [
25
26
  { type: Component, args: [{
26
27
  selector: "mis-phone-input",
27
- template: "<div class=\"main-container-phone\">\n <mis-dropdown [height]=\"dropdownHeight\" [dropdownListWidth]=\"dropdownListWidth\"[dropdownListHeight]=\"dropdownListHeight\" [width]=\"dropdownWidth\" [data]=\"dropdownData\" [selectedItem]=\"dropdownSelectedItem\" [label]=\"label\" [searchEnabled]=\"searchEnabled\" [multiLine]=\"false\" (onChange)=\"handleDropdownSelection($event)\"></mis-dropdown>\n <div class=\"details-field\">\n <div class=\"input-box\">\n <input\n [ngStyle]=\"{'height': inputHeight }\"\n class=\"black-text\"\n [placeholder]=\"inputPlaceholder\"\n [formControl]=\"inputFormControl\" \n [type]=\"inputType\"\n />\n </div>\n </div>\n</div>\n",
28
+ template: "<div class=\"main-container-phone\">\n <mis-dropdown [height]=\"dropdownHeight\" [dropdownListWidth]=\"dropdownListWidth\"[dropdownListHeight]=\"dropdownListHeight\" [width]=\"dropdownWidth\" [data]=\"dropdownData\" [selectedItem]=\"dropdownSelectedItem\" [label]=\"label\" [searchEnabled]=\"searchEnabled\" [multiLine]=\"false\" (onChange)=\"handleDropdownSelection($event)\" [searchLabel]=\"searchLabel\"></mis-dropdown>\n <div class=\"details-field\">\n <div class=\"input-box\">\n <input\n [ngStyle]=\"{'height': inputHeight }\"\n class=\"black-text\"\n [placeholder]=\"inputPlaceholder\"\n [formControl]=\"inputFormControl\" \n [type]=\"inputType\"\n />\n </div>\n </div>\n</div>\n",
28
29
  styles: [".main-container-phone{display:flex;border:1px solid #e0e0e0;border-radius:6px}.details-field label{display:inline-block;min-width:224px;margin-right:24px}.details-field .input-box{width:100%}.details-field .input-box input{width:100%;height:32px}input{padding:10px 16px;border:none;outline:none;width:100%;height:auto;border-radius:6px}.black-text,input{color:#181f33;line-height:24px;font-size:16px}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.main-container-phone ::ng-deep .item{padding:8px!important}.main-container-phone ::ng-deep .dropdown{border:unset!important}"]
29
30
  },] }
30
31
  ];
@@ -42,7 +43,8 @@ PhoneInputComponent.propDecorators = {
42
43
  dropdownListWidth: [{ type: Input }],
43
44
  dropdownListHeight: [{ type: Input }],
44
45
  searchEnabled: [{ type: Input }],
45
- inputType: [{ type: Input }]
46
+ inputType: [{ type: Input }],
47
+ searchLabel: [{ type: Input }]
46
48
  };
47
49
 
48
50
  class PhoneInputModule {
@@ -1 +1 @@
1
- {"version":3,"file":"mis-crystal-design-system-phone-input.js","sources":["../../../projects/mis-components/phone-input/phone-input.component.ts","../../../projects/mis-components/phone-input/phone-input.module.ts","../../../projects/mis-components/phone-input/mis-crystal-design-system-phone-input.ts"],"sourcesContent":["import { Component, EventEmitter, Input, OnInit, Output } from \"@angular/core\";\nimport { FormControl } from \"@angular/forms\";\nimport { DropdownItem } from \"mis-crystal-design-system/dropdown\";\n\n@Component({\n selector: \"mis-phone-input\",\n templateUrl: \"./phone-input.component.html\",\n styleUrls: [\"./phone-input.component.scss\"]\n})\nexport class PhoneInputComponent implements OnInit {\n @Input() dropdownHeight?: string;\n @Input() dropdownWidth?: string;\n @Input() inputHeight?: string;\n @Input() dropdownData: DropdownItem[] = [];\n @Input() dropdownSelectedItem:DropdownItem = { value: \"\", label: \"\" } \n @Input() label: string;\n\n @Input() inputPlaceholder: string = 'Enter';\n @Input() inputFormControl: FormControl = new FormControl();\n\n @Output() onDropdownSelection = new EventEmitter<any>();\n @Input() dropdownListWidth;\n @Input() dropdownListHeight;\n @Input() searchEnabled:boolean=false;\n @Input() inputType: string = \"number\";\n \n constructor() {}\n ngOnInit() {\n }\n\n handleDropdownSelection(item: DropdownItem){\n this.onDropdownSelection.emit(item);\n }\n\n}\n","import { CommonModule } from \"@angular/common\";\nimport { FormsModule } from \"@angular/forms\";\nimport { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { PhoneInputComponent } from \"./phone-input.component\";\nimport { OverlayModule } from \"@angular/cdk/overlay\";\nimport { ScrollingModule } from \"@angular/cdk-experimental/scrolling\";\nimport { DropdownModule } from \"mis-crystal-design-system/dropdown\";\nimport { ReactiveFormsModule } from \"@angular/forms\";\n\n\n@NgModule({\n declarations: [PhoneInputComponent],\n imports: [CommonModule,ReactiveFormsModule, FormsModule, OverlayModule, ScrollingModule, DropdownModule],\n exports: [PhoneInputComponent]\n})\nexport class PhoneInputModule {\n static forRoot(): ModuleWithProviders<PhoneInputModule> {\n return { ngModule: PhoneInputModule, providers: [] };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MASa,mBAAmB;IAiB9B;QAbS,iBAAY,GAAmB,EAAE,CAAC;QAClC,yBAAoB,GAAgB,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAA;QAG5D,qBAAgB,GAAW,OAAO,CAAC;QACnC,qBAAgB,GAAgB,IAAI,WAAW,EAAE,CAAC;QAEjD,wBAAmB,GAAG,IAAI,YAAY,EAAO,CAAC;QAG/C,kBAAa,GAAS,KAAK,CAAC;QAC5B,cAAS,GAAW,QAAQ,CAAC;KAEtB;IAChB,QAAQ;KACP;IAED,uBAAuB,CAAC,IAAkB;QACxC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACrC;;;YA5BF,SAAS,SAAC;gBACT,QAAQ,EAAE,iBAAiB;gBAC3B,gtBAA2C;;aAE5C;;;;6BAEE,KAAK;4BACL,KAAK;0BACL,KAAK;2BACL,KAAK;mCACL,KAAK;oBACL,KAAK;+BAEL,KAAK;+BACL,KAAK;kCAEL,MAAM;gCACN,KAAK;iCACL,KAAK;4BACL,KAAK;wBACL,KAAK;;;MCTK,gBAAgB;IAC3B,OAAO,OAAO;QACZ,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;KACtD;;;YARF,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,mBAAmB,CAAC;gBACnC,OAAO,EAAE,CAAC,YAAY,EAAC,mBAAmB,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,CAAC;gBACxG,OAAO,EAAE,CAAC,mBAAmB,CAAC;aAC/B;;;ACdD;;;;;;"}
1
+ {"version":3,"file":"mis-crystal-design-system-phone-input.js","sources":["../../../projects/mis-components/phone-input/phone-input.component.ts","../../../projects/mis-components/phone-input/phone-input.module.ts","../../../projects/mis-components/phone-input/mis-crystal-design-system-phone-input.ts"],"sourcesContent":["import { Component, EventEmitter, Input, OnInit, Output } from \"@angular/core\";\nimport { FormControl } from \"@angular/forms\";\nimport { DropdownItem } from \"mis-crystal-design-system/dropdown\";\n\n@Component({\n selector: \"mis-phone-input\",\n templateUrl: \"./phone-input.component.html\",\n styleUrls: [\"./phone-input.component.scss\"]\n})\nexport class PhoneInputComponent implements OnInit {\n @Input() dropdownHeight?: string;\n @Input() dropdownWidth?: string;\n @Input() inputHeight?: string;\n @Input() dropdownData: DropdownItem[] = [];\n @Input() dropdownSelectedItem:DropdownItem = { value: \"\", label: \"\" } \n @Input() label: string;\n\n @Input() inputPlaceholder: string = 'Enter';\n @Input() inputFormControl: FormControl = new FormControl();\n\n @Output() onDropdownSelection = new EventEmitter<any>();\n @Input() dropdownListWidth;\n @Input() dropdownListHeight;\n @Input() searchEnabled:boolean=false;\n @Input() inputType: string = \"number\";\n @Input() searchLabel:string = \"Search Keyword\"\n \n constructor() {}\n ngOnInit() {\n }\n\n handleDropdownSelection(item: DropdownItem){\n this.onDropdownSelection.emit(item);\n }\n\n}\n","import { CommonModule } from \"@angular/common\";\nimport { FormsModule } from \"@angular/forms\";\nimport { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { PhoneInputComponent } from \"./phone-input.component\";\nimport { OverlayModule } from \"@angular/cdk/overlay\";\nimport { ScrollingModule } from \"@angular/cdk-experimental/scrolling\";\nimport { DropdownModule } from \"mis-crystal-design-system/dropdown\";\nimport { ReactiveFormsModule } from \"@angular/forms\";\n\n\n@NgModule({\n declarations: [PhoneInputComponent],\n imports: [CommonModule,ReactiveFormsModule, FormsModule, OverlayModule, ScrollingModule, DropdownModule],\n exports: [PhoneInputComponent]\n})\nexport class PhoneInputModule {\n static forRoot(): ModuleWithProviders<PhoneInputModule> {\n return { ngModule: PhoneInputModule, providers: [] };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MASa,mBAAmB;IAkB9B;QAdS,iBAAY,GAAmB,EAAE,CAAC;QAClC,yBAAoB,GAAgB,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAA;QAG5D,qBAAgB,GAAW,OAAO,CAAC;QACnC,qBAAgB,GAAgB,IAAI,WAAW,EAAE,CAAC;QAEjD,wBAAmB,GAAG,IAAI,YAAY,EAAO,CAAC;QAG/C,kBAAa,GAAS,KAAK,CAAC;QAC5B,cAAS,GAAW,QAAQ,CAAC;QAC7B,gBAAW,GAAU,gBAAgB,CAAA;KAE9B;IAChB,QAAQ;KACP;IAED,uBAAuB,CAAC,IAAkB;QACxC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACrC;;;YA7BF,SAAS,SAAC;gBACT,QAAQ,EAAE,iBAAiB;gBAC3B,8uBAA2C;;aAE5C;;;;6BAEE,KAAK;4BACL,KAAK;0BACL,KAAK;2BACL,KAAK;mCACL,KAAK;oBACL,KAAK;+BAEL,KAAK;+BACL,KAAK;kCAEL,MAAM;gCACN,KAAK;iCACL,KAAK;4BACL,KAAK;wBACL,KAAK;0BACL,KAAK;;;MCVK,gBAAgB;IAC3B,OAAO,OAAO;QACZ,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;KACtD;;;YARF,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,mBAAmB,CAAC;gBACnC,OAAO,EAAE,CAAC,YAAY,EAAC,mBAAmB,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,CAAC;gBACxG,OAAO,EAAE,CAAC,mBAAmB,CAAC;aAC/B;;;ACdD;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mis-crystal-design-system",
3
- "version": "4.0.2",
3
+ "version": "4.0.4",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "*",
6
6
  "@angular/core": "*",
@@ -1 +1 @@
1
- {"__symbolic":"module","version":4,"metadata":{"PhoneInputComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":4,"character":1},"arguments":[{"selector":"mis-phone-input","template":"<div class=\"main-container-phone\">\n <mis-dropdown [height]=\"dropdownHeight\" [dropdownListWidth]=\"dropdownListWidth\"[dropdownListHeight]=\"dropdownListHeight\" [width]=\"dropdownWidth\" [data]=\"dropdownData\" [selectedItem]=\"dropdownSelectedItem\" [label]=\"label\" [searchEnabled]=\"searchEnabled\" [multiLine]=\"false\" (onChange)=\"handleDropdownSelection($event)\"></mis-dropdown>\n <div class=\"details-field\">\n <div class=\"input-box\">\n <input\n [ngStyle]=\"{'height': inputHeight }\"\n class=\"black-text\"\n [placeholder]=\"inputPlaceholder\"\n [formControl]=\"inputFormControl\" \n [type]=\"inputType\"\n />\n </div>\n </div>\n</div>\n","styles":[".main-container-phone{display:flex;border:1px solid #e0e0e0;border-radius:6px}.details-field label{display:inline-block;min-width:224px;margin-right:24px}.details-field .input-box{width:100%}.details-field .input-box input{width:100%;height:32px}input{padding:10px 16px;border:none;outline:none;width:100%;height:auto;border-radius:6px}.black-text,input{color:#181f33;line-height:24px;font-size:16px}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.main-container-phone ::ng-deep .item{padding:8px!important}.main-container-phone ::ng-deep .dropdown{border:unset!important}"]}]}],"members":{"dropdownHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":10,"character":3}}]}],"dropdownWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":11,"character":3}}]}],"inputHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":12,"character":3}}]}],"dropdownData":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}}]}],"dropdownSelectedItem":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":14,"character":3}}]}],"label":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":15,"character":3}}]}],"inputPlaceholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":17,"character":3}}]}],"inputFormControl":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":18,"character":3}}]}],"onDropdownSelection":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":20,"character":3}}]}],"dropdownListWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":21,"character":3}}]}],"dropdownListHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":22,"character":3}}]}],"searchEnabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":23,"character":3}}]}],"inputType":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":24,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"handleDropdownSelection":[{"__symbolic":"method"}]}},"PhoneInputModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":10,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"PhoneInputComponent"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":12,"character":12},{"__symbolic":"reference","module":"@angular/forms","name":"ReactiveFormsModule","line":12,"character":25},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":12,"character":46},{"__symbolic":"reference","module":"@angular/cdk/overlay","name":"OverlayModule","line":12,"character":59},{"__symbolic":"reference","module":"@angular/cdk-experimental/scrolling","name":"ScrollingModule","line":12,"character":74},{"__symbolic":"reference","module":"mis-crystal-design-system/dropdown","name":"DropdownModule","line":12,"character":91}],"exports":[{"__symbolic":"reference","name":"PhoneInputComponent"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"PhoneInputModule"},"providers":[]}}}}},"origins":{"PhoneInputComponent":"./phone-input.component","PhoneInputModule":"./phone-input.module"},"importAs":"mis-crystal-design-system/phone-input"}
1
+ {"__symbolic":"module","version":4,"metadata":{"PhoneInputComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":4,"character":1},"arguments":[{"selector":"mis-phone-input","template":"<div class=\"main-container-phone\">\n <mis-dropdown [height]=\"dropdownHeight\" [dropdownListWidth]=\"dropdownListWidth\"[dropdownListHeight]=\"dropdownListHeight\" [width]=\"dropdownWidth\" [data]=\"dropdownData\" [selectedItem]=\"dropdownSelectedItem\" [label]=\"label\" [searchEnabled]=\"searchEnabled\" [multiLine]=\"false\" (onChange)=\"handleDropdownSelection($event)\" [searchLabel]=\"searchLabel\"></mis-dropdown>\n <div class=\"details-field\">\n <div class=\"input-box\">\n <input\n [ngStyle]=\"{'height': inputHeight }\"\n class=\"black-text\"\n [placeholder]=\"inputPlaceholder\"\n [formControl]=\"inputFormControl\" \n [type]=\"inputType\"\n />\n </div>\n </div>\n</div>\n","styles":[".main-container-phone{display:flex;border:1px solid #e0e0e0;border-radius:6px}.details-field label{display:inline-block;min-width:224px;margin-right:24px}.details-field .input-box{width:100%}.details-field .input-box input{width:100%;height:32px}input{padding:10px 16px;border:none;outline:none;width:100%;height:auto;border-radius:6px}.black-text,input{color:#181f33;line-height:24px;font-size:16px}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.main-container-phone ::ng-deep .item{padding:8px!important}.main-container-phone ::ng-deep .dropdown{border:unset!important}"]}]}],"members":{"dropdownHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":10,"character":3}}]}],"dropdownWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":11,"character":3}}]}],"inputHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":12,"character":3}}]}],"dropdownData":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}}]}],"dropdownSelectedItem":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":14,"character":3}}]}],"label":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":15,"character":3}}]}],"inputPlaceholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":17,"character":3}}]}],"inputFormControl":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":18,"character":3}}]}],"onDropdownSelection":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":20,"character":3}}]}],"dropdownListWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":21,"character":3}}]}],"dropdownListHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":22,"character":3}}]}],"searchEnabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":23,"character":3}}]}],"inputType":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":24,"character":3}}]}],"searchLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":25,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"handleDropdownSelection":[{"__symbolic":"method"}]}},"PhoneInputModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":10,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"PhoneInputComponent"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":12,"character":12},{"__symbolic":"reference","module":"@angular/forms","name":"ReactiveFormsModule","line":12,"character":25},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":12,"character":46},{"__symbolic":"reference","module":"@angular/cdk/overlay","name":"OverlayModule","line":12,"character":59},{"__symbolic":"reference","module":"@angular/cdk-experimental/scrolling","name":"ScrollingModule","line":12,"character":74},{"__symbolic":"reference","module":"mis-crystal-design-system/dropdown","name":"DropdownModule","line":12,"character":91}],"exports":[{"__symbolic":"reference","name":"PhoneInputComponent"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"PhoneInputModule"},"providers":[]}}}}},"origins":{"PhoneInputComponent":"./phone-input.component","PhoneInputModule":"./phone-input.module"},"importAs":"mis-crystal-design-system/phone-input"}
@@ -15,6 +15,7 @@ export declare class PhoneInputComponent implements OnInit {
15
15
  dropdownListHeight: any;
16
16
  searchEnabled: boolean;
17
17
  inputType: string;
18
+ searchLabel: string;
18
19
  constructor();
19
20
  ngOnInit(): void;
20
21
  handleDropdownSelection(item: DropdownItem): void;