mis-crystal-design-system 4.0.4 → 4.0.6

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.
@@ -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, 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,0C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C,CAAA;oBACzD,IAAG,KAAK;wBAAE,KAAK,GAAG,EAAC,MAAM,EAAE,OAAO,EAAC,CAAA;oBACnC,MAAM;gBACR;oBACE,MAAM;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;;;;;;"}
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 this.formValid.emit(this.dynamicForm.valid);\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;;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BAAoB,CAAC;aAChC;;;AC1BD;;;;;;"}
@@ -6,6 +6,8 @@ import { ScrollingModule } from '@angular/cdk/scrolling';
6
6
  class TableComponent {
7
7
  constructor(renderer) {
8
8
  this.renderer = renderer;
9
+ // Initialize with -1 to indicate no row is colored at the beginning
10
+ this.activeRowIndex = 0;
9
11
  // Filter related variables
10
12
  this.showFilter = false;
11
13
  this.filterName = "";
@@ -19,6 +21,11 @@ class TableComponent {
19
21
  this.tableData = [];
20
22
  this.subTableData = [];
21
23
  }
24
+ // Function to handle row click
25
+ selectRow(index) {
26
+ this.activeRowIndex = index; // Set the selected index to the clicked row's index
27
+ this.config.rowConfig.action(index);
28
+ }
22
29
  ngOnInit() {
23
30
  this.tableLength = !!this.tableData ? this.tableData.length : 0;
24
31
  this.initializeFilters();
@@ -179,8 +186,8 @@ class TableComponent {
179
186
  TableComponent.decorators = [
180
187
  { type: Component, args: [{
181
188
  selector: "mis-table",
182
- template: "<div\n [ngStyle]=\"{\n height: getContainerHeight(),\n width: getContainerWidth(),\n 'overflow-x': config.canScrollHorizontally ? 'auto' : 'unset'\n }\"\n id=\"main-container\"\n>\n <mis-table-filter\n #filter\n (filtersApplied)=\"updateAppliedFilters($event)\"\n *ngIf=\"showFilter\"\n [containerStyles]=\"filterContainerStyles\"\n [filtersData]=\"filterData\"\n ></mis-table-filter>\n <div\n #table\n id=\"table-container\"\n [ngClass]=\"{ 'no-scrollbar': expandedIndex < 0, scrollbar: !(expandedIndex < 0), 'scroll-horizontally': config.canScrollHorizontally }\"\n >\n <div\n [ngStyle]=\"{\n 'min-height': getColHeadersRowHeight(),\n 'border-top': getColHeadersRowBorderTop(),\n 'border-bottom': getColHeadersRowBorderBottom()\n }\"\n id=\"col-headers-container\"\n >\n <div\n #colHeaderRef\n (click)=\"colHeader?.action ? colHeader?.action(colHeader) : null\"\n *ngFor=\"let colHeader of config?.colHeaderConfig\"\n class=\"col-header\"\n [ngStyle]=\"{\n width: colHeader?.style?.width || '',\n cursor: colHeader.action ? 'pointer' : 'default',\n 'justify-content': colHeader?.style?.justifyContent\n ? colHeader?.style?.justifyContent\n : colHeader.type === 'number'\n ? 'flex-end'\n : 'space-between'\n }\"\n >\n <p *ngIf=\"colHeader?.type !== 'custom'\" class=\"col-header-text\">\n {{ colHeader?.data || \" \" }}\n </p>\n <span\n (click)=\"filterData = colHeader.filters; toggleFilter(colHeader.data); $event.stopPropagation()\"\n *ngIf=\"colHeader?.type !== 'custom' && colHeader?.filters && colHeader?.filters?.length > 0\"\n class=\"filter-icon\"\n >\n <span *ngIf=\"appliedFilters[colHeader.data]?.length > 0\" id=\"filter-active\"></span>\n <svg fill=\"none\" height=\"10\" viewBox=\"0 0 13 10\" width=\"13\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n clip-rule=\"evenodd\"\n d=\"M4.97546 10H7.64213V8H4.97546V10ZM0.308472 0V2H12.3085V0H0.308472ZM2.30847 6H10.3085V4H2.30847V6Z\"\n fill=\"#181F33\"\n fill-rule=\"evenodd\"\n />\n </svg>\n </span>\n <ng-template\n *ngIf=\"colHeader?.type === 'custom'\"\n [customComponent]=\"colHeader?.componentRef\"\n [data]=\"colHeader.data\"\n customTableCell\n ></ng-template>\n </div>\n </div>\n <div id=\"data-container\">\n <div class=\"row-wrapper\" *ngFor=\"let row of tableData; let i = index\">\n <div\n class=\"t-row\"\n [ngClass]=\"{ 't-row-hover': config.cellHover }\"\n [ngStyle]=\"{ 'min-height': config?.rowConfig?.height ? config.rowConfig.height : '44px' }\"\n >\n <div\n (click)=\"config?.colConfig[i]?.action ? config?.colConfig[i]?.action(col) : null\"\n *ngFor=\"let col of row; let i = index\"\n [ngStyle]=\"{\n width: config?.colConfig[i]?.style?.width || config?.colHeaderConfig[i]?.style?.width || ''\n }\"\n class=\"t-col-container\"\n [ngClass]=\"{ 't-col-container-hover': config.cellHover }\"\n >\n <div\n class=\"t-col\"\n [style]=\"config.colConfig[i]?.style\"\n [ngStyle]=\"{\n width: '100%',\n cursor: config.colConfig[i]?.action ? 'pointer' : 'default',\n 'justify-content': config.colConfig[i]?.style?.justifyContent\n ? config.colConfig[i]?.style?.justifyContent\n : config.colConfig[i]?.type === 'number'\n ? 'flex-end'\n : 'space-between'\n }\"\n >\n <p\n *ngIf=\"config.colConfig[i]?.type !== 'custom'\"\n [ngStyle]=\"{\n color: config?.colConfig[i]?.style?.color ? config?.colConfig[i]?.style?.color : ''\n }\"\n class=\"t-col-text\"\n >\n {{ col }}\n </p>\n <ng-template\n *ngIf=\"config.colConfig[i]?.type === 'custom'\"\n [customComponent]=\"config.colConfig[i].componentRef\"\n [data]=\"col\"\n customTableCell\n ></ng-template>\n </div>\n </div>\n </div>\n <div *ngIf=\"config?.canExpand && expandedIndex === i\" class=\"sub-row\">\n <ng-container *ngIf=\"subTableDataLoading\">\n <div style=\"display: flex; justify-content: center; align-items: center; padding: 16px\">Loading...</div>\n </ng-container>\n <ng-container *ngIf=\"!subTableDataLoading && subTableData.length === 0\">\n <div style=\"display: flex; justify-content: center; align-items: center; padding: 16px\">No Data Available...</div>\n </ng-container>\n <ng-container *ngIf=\"!subTableDataLoading && subTableData.length > 0\">\n <sub-table [config]=\"subTableconfig\" [tableData]=\"subTableData\"></sub-table>\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n <div\n *ngIf=\"config?.paginationConfig && (tableLength >= config.paginationConfig.rowsPerPage || config.paginationConfig?.selectedPage !== 1)\"\n id=\"pagination-container\"\n >\n <p id=\"pagination-text\">\n Showing\n {{ (config.paginationConfig?.selectedPage - 1) * config.paginationConfig.rowsPerPage + 1 }}-{{\n (config.paginationConfig?.selectedPage - 1) * config.paginationConfig.rowsPerPage + tableLength\n }}\n of {{ config.paginationConfig.totalNoOfRows }} items\n </p>\n <div id=\"pages-container\">\n <span (click)=\"updateSelectedPage(config.paginationConfig?.selectedPage - 1)\" class=\"page\">\n <svg fill=\"none\" height=\"10\" viewBox=\"0 0 7 10\" width=\"7\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n clip-rule=\"evenodd\"\n d=\"M0.857405 5.56295C0.855794 5.56139 0.854188 5.55982 0.852588 5.55824C0.695955 5.40408 0.617641 5.20203 0.617647 4.99998C0.617641 4.79793 0.695955 4.59588 0.852588 4.44172C0.854188 4.44014 0.855794 4.43858 0.857404 4.43702L5.13066 0.231231C5.44392 -0.0770771 5.9518 -0.0770771 6.26506 0.231231C6.57831 0.53954 6.57831 1.03941 6.26506 1.34772L2.5542 4.99998L6.26506 8.65225C6.57831 8.96055 6.57831 9.46042 6.26506 9.76873C5.9518 10.077 5.44392 10.077 5.13066 9.76873L0.857405 5.56295Z\"\n fill=\"#181F33\"\n fill-rule=\"evenodd\"\n />\n </svg>\n </span>\n <div *ngFor=\"let pageNumber of pages\">\n <span\n (click)=\"updateSelectedPage(pageNumber)\"\n *ngIf=\"pageNumber != 0\"\n [ngClass]=\"{ 'page-active': pageNumber == config.paginationConfig?.selectedPage }\"\n class=\"page\"\n >{{ pageNumber }}</span\n >\n <span *ngIf=\"pageNumber == 0\" class=\"page-seperator\">\n <div style=\"display: flex\">\n <span class=\"dot\" style=\"margin-right: 4px\"></span>\n <span class=\"dot\" style=\"margin-right: 4px\"></span>\n <span class=\"dot\"></span>\n </div>\n </span>\n </div>\n <span (click)=\"updateSelectedPage(config.paginationConfig?.selectedPage + 1)\" class=\"page\">\n <svg fill=\"none\" height=\"10\" viewBox=\"0 0 7 10\" width=\"7\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n clip-rule=\"evenodd\"\n d=\"M6.1426 5.56295C6.14421 5.56139 6.14581 5.55982 6.14741 5.55824C6.30405 5.40408 6.38236 5.20203 6.38236 4.99998C6.38236 4.79793 6.30405 4.59588 6.14741 4.44172C6.14581 4.44014 6.14421 4.43858 6.1426 4.43702L1.86934 0.231231C1.55608 -0.0770771 1.0482 -0.0770771 0.734942 0.231231C0.421688 0.53954 0.421688 1.03941 0.734942 1.34772L4.4458 4.99998L0.734941 8.65225C0.421686 8.96055 0.421686 9.46042 0.734941 9.76873C1.0482 10.077 1.55608 10.077 1.86934 9.76873L6.1426 5.56295Z\"\n fill=\"#181F33\"\n fill-rule=\"evenodd\"\n />\n </svg>\n </span>\n </div>\n </div>\n</div>\n",
183
- styles: ["#main-container{font-family:Lato,sans-serif;position:relative}.no-scrollbar::-webkit-scrollbar{width:0}.scrollbar::-webkit-scrollbar{width:8px;height:8px;border-radius:15px}.scrollbar::-webkit-scrollbar-thumb{background:#9aa7b4;border-radius:15px}#table-container{height:inherit;overflow-y:auto}.scroll-horizontally{height:inherit;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;overflow-y:unset!important;overflow-x:visible}#col-headers-container{display:flex;align-items:center;position:-webkit-sticky;position:sticky;background-color:#fff;width:100%;z-index:1;min-height:44px;border-bottom:1px solid #e0e0e0;top:0;left:0;right:0}.col-header{padding:0 16px;height:100%}.col-header,.col-header-text{display:flex;align-items:center}.col-header-text{font-style:normal;font-weight:700;font-size:14px;line-height:20px;letter-spacing:.2px;margin:0}.filter-icon{margin-left:8px;padding:0 8px;position:relative;cursor:pointer}#filter-active{height:8px;width:8px;background:#16cbbc;border-radius:50%;position:absolute;top:4px;right:4px}.sub-row{height:auto;border-bottom:none}.loader ::ng-deep .mat-progress-spinner circle,.mat-spinner circle{stroke:#0937b2}.t-row{display:flex;min-height:44px;background-color:#fff;width:100%;border-bottom:1px solid #e0e0e0}.t-row:hover{background-color:#f1fdf8}.t-col-container{padding:0 16px}.t-row-hover:hover{background-color:transparent}.t-col-container-hover:hover{background-color:#e6ebf7}.t-col-container-hover:first-child{border-left:1px solid #e0e0e0}.t-col-container-hover{border-right:1px solid #e0e0e0}.t-col{height:100%}.t-col,.t-col-text{display:flex;align-items:center}.t-col-text{font-style:normal;font-weight:400;font-size:14px;line-height:20px;letter-spacing:.2px;margin:0}#pagination-container{display:flex;justify-content:flex-end;align-items:center;height:56px}#pagination-text{font-style:normal;font-weight:400;font-size:12px;line-height:18px;letter-spacing:.4px;color:#6a737d;margin:0 96px 0 0}#pages-container{display:flex;margin-right:32px}.page{border:1px solid #6a737d;box-sizing:border-box;border-radius:4px;font-size:14px;line-height:20px;letter-spacing:.2px;color:#6a737d;cursor:pointer}.page,.page-seperator{display:flex;justify-content:center;align-items:center;width:32px;height:32px;margin-right:8px}.dot{height:3px;width:3px;border-radius:50%;background:#6a737d}.page-active{color:#0937b2;border:1px solid #0937b2}"]
189
+ template: "<div\n [ngStyle]=\"{\n height: getContainerHeight(),\n width: getContainerWidth(),\n 'overflow-x': config.canScrollHorizontally ? 'auto' : 'unset'\n }\"\n id=\"main-container\"\n>\n <mis-table-filter\n #filter\n (filtersApplied)=\"updateAppliedFilters($event)\"\n *ngIf=\"showFilter\"\n [containerStyles]=\"filterContainerStyles\"\n [filtersData]=\"filterData\"\n ></mis-table-filter>\n <div\n #table\n id=\"table-container\"\n [ngClass]=\"{ 'no-scrollbar': expandedIndex < 0, scrollbar: !(expandedIndex < 0), 'scroll-horizontally': config.canScrollHorizontally }\"\n >\n <div\n [ngStyle]=\"{\n 'min-height': getColHeadersRowHeight(),\n 'border-top': getColHeadersRowBorderTop(),\n 'border-bottom': getColHeadersRowBorderBottom()\n }\"\n id=\"col-headers-container\"\n >\n <div\n #colHeaderRef\n (click)=\"colHeader?.action ? colHeader?.action(colHeader) : null\"\n *ngFor=\"let colHeader of config?.colHeaderConfig\"\n class=\"col-header\"\n [ngStyle]=\"{\n width: colHeader?.style?.width || '',\n cursor: colHeader.action ? 'pointer' : 'default',\n 'justify-content': colHeader?.style?.justifyContent\n ? colHeader?.style?.justifyContent\n : colHeader.type === 'number'\n ? 'flex-end'\n : 'space-between'\n }\"\n >\n <p *ngIf=\"colHeader?.type !== 'custom'\" class=\"col-header-text\">\n {{ colHeader?.data || \" \" }}\n </p>\n <span\n (click)=\"filterData = colHeader.filters; toggleFilter(colHeader.data); $event.stopPropagation()\"\n *ngIf=\"colHeader?.type !== 'custom' && colHeader?.filters && colHeader?.filters?.length > 0\"\n class=\"filter-icon\"\n >\n <span *ngIf=\"appliedFilters[colHeader.data]?.length > 0\" id=\"filter-active\"></span>\n <svg fill=\"none\" height=\"10\" viewBox=\"0 0 13 10\" width=\"13\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n clip-rule=\"evenodd\"\n d=\"M4.97546 10H7.64213V8H4.97546V10ZM0.308472 0V2H12.3085V0H0.308472ZM2.30847 6H10.3085V4H2.30847V6Z\"\n fill=\"#181F33\"\n fill-rule=\"evenodd\"\n />\n </svg>\n </span>\n <ng-template\n *ngIf=\"colHeader?.type === 'custom'\"\n [customComponent]=\"colHeader?.componentRef\"\n [data]=\"colHeader.data\"\n customTableCell\n ></ng-template>\n </div>\n </div>\n <div id=\"data-container\">\n <div class=\"row-wrapper\" *ngFor=\"let row of tableData; let i = index\">\n <div\n class=\"t-row\"\n [ngClass]=\"{ 't-row-hover': config.cellHover, 'active-row': i === activeRowIndex }\"\n [ngStyle]=\"{ 'min-height': config?.rowConfig?.height ? config.rowConfig.height : '44px' }\"\n (click)=\"selectRow(i)\"\n >\n <div\n (click)=\"config?.colConfig[i]?.action ? config?.colConfig[i]?.action(col) : null\"\n *ngFor=\"let col of row; let i = index\"\n [ngStyle]=\"{\n width: config?.colConfig[i]?.style?.width || config?.colHeaderConfig[i]?.style?.width || ''\n }\"\n class=\"t-col-container\"\n [ngClass]=\"{ 't-col-container-hover': config.cellHover }\"\n >\n <div\n class=\"t-col\"\n [style]=\"config.colConfig[i]?.style\"\n [ngStyle]=\"{\n width: '100%',\n cursor: config.colConfig[i]?.action ? 'pointer' : 'default',\n 'justify-content': config.colConfig[i]?.style?.justifyContent\n ? config.colConfig[i]?.style?.justifyContent\n : config.colConfig[i]?.type === 'number'\n ? 'flex-end'\n : 'space-between'\n }\"\n >\n <p\n *ngIf=\"config.colConfig[i]?.type !== 'custom'\"\n [ngStyle]=\"{\n color: config?.colConfig[i]?.style?.color ? config?.colConfig[i]?.style?.color : ''\n }\"\n class=\"t-col-text\"\n >\n {{ col }}\n </p>\n <ng-template\n *ngIf=\"config.colConfig[i]?.type === 'custom'\"\n [customComponent]=\"config.colConfig[i].componentRef\"\n [data]=\"col\"\n customTableCell\n ></ng-template>\n </div>\n </div>\n </div>\n <div *ngIf=\"config?.canExpand && expandedIndex === i\" class=\"sub-row\">\n <ng-container *ngIf=\"subTableDataLoading\">\n <div style=\"display: flex; justify-content: center; align-items: center; padding: 16px\">Loading...</div>\n </ng-container>\n <ng-container *ngIf=\"!subTableDataLoading && subTableData.length === 0\">\n <div style=\"display: flex; justify-content: center; align-items: center; padding: 16px\">No Data Available...</div>\n </ng-container>\n <ng-container *ngIf=\"!subTableDataLoading && subTableData.length > 0\">\n <sub-table [config]=\"subTableconfig\" [tableData]=\"subTableData\"></sub-table>\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n <div\n *ngIf=\"config?.paginationConfig && (tableLength >= config.paginationConfig.rowsPerPage || config.paginationConfig?.selectedPage !== 1)\"\n id=\"pagination-container\"\n >\n <p id=\"pagination-text\">\n Showing\n {{ (config.paginationConfig?.selectedPage - 1) * config.paginationConfig.rowsPerPage + 1 }}-{{\n (config.paginationConfig?.selectedPage - 1) * config.paginationConfig.rowsPerPage + tableLength\n }}\n of {{ config.paginationConfig.totalNoOfRows }} items\n </p>\n <div id=\"pages-container\">\n <span (click)=\"updateSelectedPage(config.paginationConfig?.selectedPage - 1)\" class=\"page\">\n <svg fill=\"none\" height=\"10\" viewBox=\"0 0 7 10\" width=\"7\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n clip-rule=\"evenodd\"\n d=\"M0.857405 5.56295C0.855794 5.56139 0.854188 5.55982 0.852588 5.55824C0.695955 5.40408 0.617641 5.20203 0.617647 4.99998C0.617641 4.79793 0.695955 4.59588 0.852588 4.44172C0.854188 4.44014 0.855794 4.43858 0.857404 4.43702L5.13066 0.231231C5.44392 -0.0770771 5.9518 -0.0770771 6.26506 0.231231C6.57831 0.53954 6.57831 1.03941 6.26506 1.34772L2.5542 4.99998L6.26506 8.65225C6.57831 8.96055 6.57831 9.46042 6.26506 9.76873C5.9518 10.077 5.44392 10.077 5.13066 9.76873L0.857405 5.56295Z\"\n fill=\"#181F33\"\n fill-rule=\"evenodd\"\n />\n </svg>\n </span>\n <div *ngFor=\"let pageNumber of pages\">\n <span\n (click)=\"updateSelectedPage(pageNumber)\"\n *ngIf=\"pageNumber != 0\"\n [ngClass]=\"{ 'page-active': pageNumber == config.paginationConfig?.selectedPage }\"\n class=\"page\"\n >{{ pageNumber }}</span\n >\n <span *ngIf=\"pageNumber == 0\" class=\"page-seperator\">\n <div style=\"display: flex\">\n <span class=\"dot\" style=\"margin-right: 4px\"></span>\n <span class=\"dot\" style=\"margin-right: 4px\"></span>\n <span class=\"dot\"></span>\n </div>\n </span>\n </div>\n <span (click)=\"updateSelectedPage(config.paginationConfig?.selectedPage + 1)\" class=\"page\">\n <svg fill=\"none\" height=\"10\" viewBox=\"0 0 7 10\" width=\"7\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n clip-rule=\"evenodd\"\n d=\"M6.1426 5.56295C6.14421 5.56139 6.14581 5.55982 6.14741 5.55824C6.30405 5.40408 6.38236 5.20203 6.38236 4.99998C6.38236 4.79793 6.30405 4.59588 6.14741 4.44172C6.14581 4.44014 6.14421 4.43858 6.1426 4.43702L1.86934 0.231231C1.55608 -0.0770771 1.0482 -0.0770771 0.734942 0.231231C0.421688 0.53954 0.421688 1.03941 0.734942 1.34772L4.4458 4.99998L0.734941 8.65225C0.421686 8.96055 0.421686 9.46042 0.734941 9.76873C1.0482 10.077 1.55608 10.077 1.86934 9.76873L6.1426 5.56295Z\"\n fill=\"#181F33\"\n fill-rule=\"evenodd\"\n />\n </svg>\n </span>\n </div>\n </div>\n</div>\n",
190
+ styles: ["#main-container{font-family:Lato,sans-serif;position:relative}.no-scrollbar::-webkit-scrollbar{width:0}.scrollbar::-webkit-scrollbar{width:8px;height:8px;border-radius:15px}.scrollbar::-webkit-scrollbar-thumb{background:#9aa7b4;border-radius:15px}#table-container{height:inherit;overflow-y:auto}.scroll-horizontally{height:inherit;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;overflow-y:unset!important;overflow-x:visible}#col-headers-container{display:flex;align-items:center;position:-webkit-sticky;position:sticky;background-color:#fff;width:100%;z-index:1;min-height:44px;border-bottom:1px solid #e0e0e0;top:0;left:0;right:0}.col-header{padding:0 16px;height:100%}.col-header,.col-header-text{display:flex;align-items:center}.col-header-text{font-style:normal;font-weight:700;font-size:14px;line-height:20px;letter-spacing:.2px;margin:0}.filter-icon{margin-left:8px;padding:0 8px;position:relative;cursor:pointer}#filter-active{height:8px;width:8px;background:#16cbbc;border-radius:50%;position:absolute;top:4px;right:4px}.sub-row{height:auto;border-bottom:none}.loader ::ng-deep .mat-progress-spinner circle,.mat-spinner circle{stroke:#0937b2}.t-row{display:flex;min-height:44px;background-color:#fff;width:100%;border-bottom:1px solid #e0e0e0}.t-row:hover{background-color:#e7eefd}.active-row{background-color:#e6f6fd}.t-col-container{padding:0 16px}.t-row-hover:hover{background-color:transparent}.t-col-container-hover:hover{background-color:#e6ebf7}.t-col-container-hover:first-child{border-left:1px solid #e0e0e0}.t-col-container-hover{border-right:1px solid #e0e0e0}.t-col{height:100%}.t-col,.t-col-text{display:flex;align-items:center}.t-col-text{font-style:normal;font-weight:400;font-size:14px;line-height:20px;letter-spacing:.2px;margin:0}#pagination-container{display:flex;justify-content:flex-end;align-items:center;height:56px}#pagination-text{font-style:normal;font-weight:400;font-size:12px;line-height:18px;letter-spacing:.4px;color:#6a737d;margin:0 96px 0 0}#pages-container{display:flex;margin-right:32px}.page{border:1px solid #6a737d;box-sizing:border-box;border-radius:4px;font-size:14px;line-height:20px;letter-spacing:.2px;color:#6a737d;cursor:pointer}.page,.page-seperator{display:flex;justify-content:center;align-items:center;width:32px;height:32px;margin-right:8px}.dot{height:3px;width:3px;border-radius:50%;background:#6a737d}.page-active{color:#0937b2;border:1px solid #0937b2}"]
184
191
  },] }
185
192
  ];
186
193
  TableComponent.ctorParameters = () => [
@@ -1 +1 @@
1
- {"version":3,"file":"mis-crystal-design-system-table.js","sources":["../../../projects/mis-components/table/table.component.ts","../../../projects/mis-components/table/custom-table-cell.directive.ts","../../../projects/mis-components/table/sub-table/sub-table.component.ts","../../../projects/mis-components/table/filter/filter.component.ts","../../../projects/mis-components/table/table.module.ts","../../../projects/mis-components/table/mis-crystal-design-system-table.ts"],"sourcesContent":["import {\n AfterViewInit,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n OnInit,\n Output,\n QueryList,\n Renderer2,\n ViewChild,\n ViewChildren\n} from \"@angular/core\";\nimport { Filter, TableFilterComponent } from \"./filter/filter.component\";\n\n@Component({\n selector: \"mis-table\",\n templateUrl: \"table.component.html\",\n styleUrls: [\"table.component.css\"]\n})\nexport class TableComponent implements OnInit, AfterViewInit, OnChanges {\n // Filter related variables\n showFilter: boolean = false;\n filterName: string = \"\";\n filterData: Array<Filter> = [];\n filterContainerStyles: any = {};\n appliedFilters: { [key: string]: Array<{ name: string; value: string }> } = {};\n @Output() filtersUpdated = new EventEmitter<{\n [key: string]: Array<{ name: string; value: string }>;\n }>();\n\n @ViewChild(\"filter\") filter: TableFilterComponent | any;\n @ViewChildren(\"colHeaderRef\") colHeaders: QueryList<ElementRef> | any;\n\n // Pagination related variables\n pages: Array<number> = [];\n tableLength: number;\n @Output() pageSelected = new EventEmitter<number>();\n\n @Input(\"tableConfig\") config: TableConfig | any;\n @Input() subTableconfig: TableConfig | any;\n @Input() tableDataLoading: boolean | any;\n @Input() expandedIndex: number | any;\n @Input() tableData: Array<Array<any>> = [];\n @Input() subTableData: Array<Array<any>> = [];\n @Input() subTableDataLoading: boolean | any;\n @ViewChild(\"table\") table: ElementRef | any;\n\n constructor(private renderer: Renderer2) { }\n\n ngOnInit(): void {\n this.tableLength = !!this.tableData ? this.tableData.length : 0;\n this.initializeFilters();\n if (this.config.paginationConfig) {\n this.initializePagination();\n }\n if (this.config.canScrollHorizontally === undefined) {\n this.config.canScrollHorizontally = false;\n }\n document.addEventListener(\"click\", event => {\n if (this.filter) {\n let isCheckBoxClicked = true;\n let targetElement = event.target as HTMLSpanElement;\n if (targetElement.className === \"checkmark\") {\n isCheckBoxClicked = true;\n this.showFilter = true;\n }\n let isClickInsideElement = this.filter.container.nativeElement.contains(event.target);\n if (!isClickInsideElement && !isCheckBoxClicked) {\n this.toggleFilter(this.filterName);\n }\n }\n });\n }\n ngAfterViewInit() {\n if (this.config.paginationConfig) {\n let height = this.config.height;\n this.renderer.setStyle(this.table.nativeElement, \"height\", height - 56 + \"px\");\n }\n }\n ngOnChanges() {\n this.tableLength = !!this.tableData ? this.tableData.length : 0;\n }\n\n // Filter related functions\n initializeFilters() {\n for (let colHeader of this.config?.colHeaderConfig) {\n if (colHeader.filters) {\n let filters = [];\n for (let filter of colHeader.filters) {\n if (filter.checked) {\n filters.push({\n name: filter.name,\n value: filter.value\n });\n }\n }\n if (filters.length > 0) this.appliedFilters[colHeader.data] = filters;\n }\n }\n }\n toggleFilter(filterName: string) {\n if (!this.showFilter) {\n this.filterName = filterName;\n this.showFilter = true;\n\n let offSet = 0;\n let colHeadersReversed = this.colHeaders.toArray().reverse();\n\n for (let header of colHeadersReversed) {\n if (header.nativeElement.innerText === filterName) break;\n offSet += header.nativeElement.offsetWidth;\n }\n this.filterContainerStyles = {\n top: \"44px\",\n right: offSet > 0 ? offSet - 116 + \"px\" : \"12px\"\n };\n } else {\n this.filterName = \"\";\n this.filterData = [];\n this.showFilter = false;\n }\n }\n updateAppliedFilters(appliedFilters: Array<{ name: string; value: string }>) {\n if (appliedFilters.length == 0) {\n delete this.appliedFilters[this.filterName];\n } else {\n this.appliedFilters[this.filterName] = appliedFilters;\n }\n this.filtersUpdated.emit({ ...this.appliedFilters });\n this.toggleFilter(this.filterName);\n }\n\n // Pagination related functions\n initializePagination() {\n if (this.config.paginationConfig) {\n let len = this.config.paginationConfig.noOfPages;\n if (len <= 7) {\n for (let i = 1; i <= len; i++) {\n this.pages.push(i);\n }\n } else {\n this.pages = [1, 2, 3, 4, 0, len];\n }\n }\n }\n updateSelectedPage(pageNumber: number) {\n if (pageNumber < 1 || pageNumber > this.config.paginationConfig.noOfPages) return;\n this.config.paginationConfig.selectedPage = pageNumber;\n let len = this.config.paginationConfig.noOfPages;\n if (len > 7) {\n if (pageNumber - 2 <= 1) {\n this.pages = [1, 2, 3, 4, 0, len];\n } else if (pageNumber - 2 > 1 && pageNumber + 2 < len) {\n this.pages = [1, 0, pageNumber - 1, pageNumber, pageNumber + 1, 0, len];\n } else if (pageNumber + 2 >= len) {\n this.pages = [1, 0, len - 3, len - 2, len - 1, len];\n }\n }\n this.pageSelected.emit(this.config.paginationConfig?.selectedPage);\n }\n\n // Main container related functions\n getContainerHeight() {\n if (this.config?.height) return this.config.height;\n else return \"\";\n }\n getContainerWidth() {\n if (this.config?.width) return this.config.width;\n else return \"\";\n }\n\n // Column Headers related functions\n getColHeadersRowHeight() {\n if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.height) {\n return this.config.colHeadersRowConfig.height;\n } else return \"44px\";\n }\n getColHeadersRowBorderTop() {\n if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.style?.borderTop) {\n return this.config.colHeadersRowConfig.style?.borderTop;\n } else return \"\";\n }\n getColHeadersRowBorderBottom() {\n if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.style?.borderBottom) {\n return this.config.colHeadersRowConfig.style?.borderBottom;\n } else return \"1px solid #E0E0E0\";\n }\n}\n\nexport interface TableConfig {\n height: string | \"100%\";\n width: string | \"100%\";\n paginationConfig?: PaginationConfig | undefined | null;\n colHeadersRowConfig: RowConfig | undefined | null;\n rowConfig: RowConfig | undefined | null;\n colHeaderConfig: Array<ColHeaderConfig>;\n colConfig: Array<ColConfig>;\n canExpand?: boolean;\n canScrollHorizontally?: boolean;\n cellHover?: boolean;\n}\nexport interface PaginationConfig {\n noOfPages: number;\n rowsPerPage: number;\n totalNoOfRows: number;\n selectedPage?: number;\n}\nexport interface RowConfig {\n height?: string | undefined | null;\n style?: {};\n}\nexport interface ColHeaderConfig {\n type: \"text\" | \"number\" | \"custom\";\n data: any;\n componentRef?: any;\n filters?: Array<Filter> | null;\n style?: {};\n action?: any;\n}\nexport interface ColConfig {\n type: \"text\" | \"number\" | \"custom\";\n componentRef?: any;\n style?: {};\n action?: any;\n}\n","import { ComponentFactoryResolver, Directive, Input, ViewContainerRef } from \"@angular/core\";\n\n@Directive({\n selector: \"[customTableCell]\"\n})\nexport class CustomTableCellDirective {\n private ref: any;\n private component: any;\n private cellData: any;\n\n @Input() set customComponent(value: any) {\n this.component = value;\n this.createComponent();\n }\n @Input() set data(value: any) {\n this.cellData = value;\n if (this.ref) {\n this.ref.instance.data = this.cellData;\n }\n }\n\n constructor(private viewContainerRef: ViewContainerRef, private componentFactoryResolver: ComponentFactoryResolver) {}\n\n createComponent() {\n if (this.component) {\n const cmpFactoryResolver = this.componentFactoryResolver.resolveComponentFactory(this.component);\n this.viewContainerRef.clear();\n this.ref = this.viewContainerRef.createComponent(cmpFactoryResolver);\n this.setData();\n }\n }\n setData() {\n this.ref.instance.data = this.cellData;\n }\n}\n","import { AfterViewInit, Component, ElementRef, Input, OnInit, Renderer2, ViewChild } from \"@angular/core\";\n\n@Component({\n selector: \"sub-table\",\n templateUrl: \"sub-table.component.html\",\n styleUrls: [\"sub-table.component.css\"]\n})\nexport class SubTableComponent implements OnInit, AfterViewInit {\n selectedPage = 1;\n pages: Array<number> = [];\n\n @Input() config: SubTableConfig | any;\n @Input() tableData: Array<Array<any>> = [];\n @ViewChild(\"table\") table: ElementRef | any;\n constructor(private renderer: Renderer2) {}\n\n ngOnInit() {}\n\n ngAfterViewInit() {\n if (this.config.paginationConfig) {\n let height = this.table.nativeElement.offsetHeight;\n this.renderer.setStyle(this.table.nativeElement, \"height\", height - 56 + \"px\");\n }\n }\n\n // Main container related functions\n getContainerHeight() {\n if (this.config.height) return this.config.height;\n else return \"\";\n }\n getContainerWidth() {\n if (this.config.width) return this.config.width;\n else return \"\";\n }\n\n // Column Headers related functions\n getColHeadersRowHeight() {\n if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.height) {\n return this.config.colHeadersRowConfig.height;\n } else return \"44px\";\n }\n getColHeadersRowBorderTop() {\n if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.style?.borderTop) {\n return this.config.colHeadersRowConfig.style?.borderTop;\n } else return \"\";\n }\n getColHeadersRowBorderBottom() {\n if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.style?.borderBottom) {\n return this.config.colHeadersRowConfig.style?.borderBottom;\n } else return \"1px solid #E0E0E0\";\n }\n}\n\nexport interface SubTableConfig {\n height: string | \"100%\";\n width: string | \"100%\";\n dataContainerMaxHeight: string | \"400px\";\n showHeader?: boolean | undefined;\n rowConfig: SubTableRowConfig | undefined | null;\n colHeaderConfig?: Array<SubTableColHeaderConfig>;\n colConfig: Array<SubTableColConfig>;\n}\n\nexport interface SubTableRowConfig {\n height?: string | undefined | null;\n style?: {};\n}\nexport interface SubTableColHeaderConfig {\n type: \"text\" | \"number\" | \"custom\";\n data: any;\n componentRef?: any;\n style?: {};\n action?: any;\n}\nexport interface SubTableColConfig {\n type: \"text\" | \"number\" | \"custom\";\n componentRef?: any;\n style?: {};\n action?: any;\n}\n","import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from \"@angular/core\";\n\n@Component({\n selector: \"mis-table-filter\",\n templateUrl: \"filter.component.html\",\n styleUrls: [\"filter.component.css\"]\n})\nexport class TableFilterComponent implements OnInit {\n @Input() filtersData: Array<Filter> = [];\n @Input() containerStyles: any = {};\n\n @Output() filtersApplied = new EventEmitter<any>();\n\n @ViewChild(\"mainContainer\") container: ElementRef | undefined;\n\n filtersMap: any = {};\n searchValue: string = \"\";\n\n constructor() {}\n\n ngOnInit(): void {\n this.filtersData.forEach(filter => {\n this.filtersMap[filter.value] = filter;\n });\n }\n resetFilters() {\n this.filtersData.forEach(filter => {\n this.filtersMap[filter.value].checked = false;\n });\n this.filtersApplied.emit([]);\n }\n applyFilters() {\n let list = Object.values(this.filtersMap)\n .filter((filter: Filter | any) => filter.checked)\n .map((filter: Filter | any) => {\n return {\n name: filter.name,\n value: filter.value\n };\n });\n this.filtersApplied.emit(list);\n }\n updateSearchValue(event: any) {\n this.searchValue = event.target.value;\n }\n updateFilter(data: any) {\n if (this.filtersMap[data.name]) {\n this.filtersMap[data.name].checked = !this.filtersMap[data.name].checked;\n }\n }\n getFiltersBasedOnSearchValue(): Filter[] | any {\n let list = Object.values(this.filtersMap);\n list = list.filter((filter: Filter | any) => {\n return filter.name.match(new RegExp(this.searchValue, \"i\"));\n });\n return list.sort(this.mySort);\n }\n getCheckedFilters(): Filter[] | any {\n let list = Object.values(this.filtersMap);\n list = list.filter((filter: Filter | any) => filter.checked).sort(this.mySort);\n return list;\n }\n mySort = (a: Filter | any, b: Filter | any) => {\n if (a.name < b.name) return -1;\n else if (b.name < a.name) return 1;\n else return 0;\n };\n}\nexport interface Filter {\n name: string;\n value: string;\n checked: boolean;\n}\n","import { ModuleWithProviders, NgModule } from \"@angular/core\";\nimport { TableComponent } from \"./table.component\";\nimport { CustomTableCellDirective } from \"./custom-table-cell.directive\";\nimport { SubTableComponent } from \"./sub-table/sub-table.component\";\nimport { CommonModule } from \"@angular/common\";\nimport { TableFilterComponent } from \"./filter/filter.component\";\nimport { CheckboxModule } from \"mis-crystal-design-system/checkbox\";\nimport { ScrollingModule } from \"@angular/cdk/scrolling\";\n\n@NgModule({\n declarations: [TableComponent, SubTableComponent, TableFilterComponent, CustomTableCellDirective],\n imports: [CommonModule, CheckboxModule, ScrollingModule],\n exports: [TableComponent, SubTableComponent, TableFilterComponent, CustomTableCellDirective]\n})\nexport class TableModule {\n static forRoot(): ModuleWithProviders<TableModule> {\n return { ngModule: TableModule, providers: [] };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {SubTableComponent as ɵa} from './sub-table/sub-table.component';"],"names":[],"mappings":";;;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8BACL,KAAK;6BAEL,MAAM;wBAEN,SAAS,SAAC,eAAe;;;MCCf,WAAW;IACtB,OAAO,OAAO;QACZ,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;KACjD;;;YARF,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,wBAAwB,CAAC;gBACjG,OAAO,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,eAAe,CAAC;gBACxD,OAAO,EAAE,CAAC,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,wBAAwB,CAAC;aAC7F;;;ACbD;;;;;;"}
1
+ {"version":3,"file":"mis-crystal-design-system-table.js","sources":["../../../projects/mis-components/table/table.component.ts","../../../projects/mis-components/table/custom-table-cell.directive.ts","../../../projects/mis-components/table/sub-table/sub-table.component.ts","../../../projects/mis-components/table/filter/filter.component.ts","../../../projects/mis-components/table/table.module.ts","../../../projects/mis-components/table/mis-crystal-design-system-table.ts"],"sourcesContent":["import {\n AfterViewInit,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n OnInit,\n Output,\n QueryList,\n Renderer2,\n ViewChild,\n ViewChildren\n} from \"@angular/core\";\nimport { Filter, TableFilterComponent } from \"./filter/filter.component\";\n\n@Component({\n selector: \"mis-table\",\n templateUrl: \"table.component.html\",\n styleUrls: [\"table.component.css\"]\n})\nexport class TableComponent implements OnInit, AfterViewInit, OnChanges {\n\n // Initialize with -1 to indicate no row is colored at the beginning\n activeRowIndex: number = 0; \n\n // Filter related variables\n showFilter: boolean = false;\n filterName: string = \"\";\n filterData: Array<Filter> = [];\n filterContainerStyles: any = {};\n appliedFilters: { [key: string]: Array<{ name: string; value: string }> } = {};\n @Output() filtersUpdated = new EventEmitter<{\n [key: string]: Array<{ name: string; value: string }>;\n }>();\n\n @ViewChild(\"filter\") filter: TableFilterComponent | any;\n @ViewChildren(\"colHeaderRef\") colHeaders: QueryList<ElementRef> | any;\n\n // Pagination related variables\n pages: Array<number> = [];\n tableLength: number;\n @Output() pageSelected = new EventEmitter<number>();\n\n @Input(\"tableConfig\") config: TableConfig | any;\n @Input() subTableconfig: TableConfig | any;\n @Input() tableDataLoading: boolean | any;\n @Input() expandedIndex: number | any;\n @Input() tableData: Array<Array<any>> = [];\n @Input() subTableData: Array<Array<any>> = [];\n @Input() subTableDataLoading: boolean | any;\n @ViewChild(\"table\") table: ElementRef | any;\n\n constructor(private renderer: Renderer2) { }\n\n // Function to handle row click\n selectRow(index: number) {\n this.activeRowIndex = index; // Set the selected index to the clicked row's index\n this.config.rowConfig.action(index);\n }\n ngOnInit(): void {\n this.tableLength = !!this.tableData ? this.tableData.length : 0;\n this.initializeFilters();\n if (this.config.paginationConfig) {\n this.initializePagination();\n }\n if (this.config.canScrollHorizontally === undefined) {\n this.config.canScrollHorizontally = false;\n }\n document.addEventListener(\"click\", event => {\n if (this.filter) {\n let isCheckBoxClicked = true;\n let targetElement = event.target as HTMLSpanElement;\n if (targetElement.className === \"checkmark\") {\n isCheckBoxClicked = true;\n this.showFilter = true;\n }\n let isClickInsideElement = this.filter.container.nativeElement.contains(event.target);\n if (!isClickInsideElement && !isCheckBoxClicked) {\n this.toggleFilter(this.filterName);\n }\n }\n });\n }\n ngAfterViewInit() {\n if (this.config.paginationConfig) {\n let height = this.config.height;\n this.renderer.setStyle(this.table.nativeElement, \"height\", height - 56 + \"px\");\n }\n }\n ngOnChanges() {\n this.tableLength = !!this.tableData ? this.tableData.length : 0;\n }\n\n // Filter related functions\n initializeFilters() {\n for (let colHeader of this.config?.colHeaderConfig) {\n if (colHeader.filters) {\n let filters = [];\n for (let filter of colHeader.filters) {\n if (filter.checked) {\n filters.push({\n name: filter.name,\n value: filter.value\n });\n }\n }\n if (filters.length > 0) this.appliedFilters[colHeader.data] = filters;\n }\n }\n }\n toggleFilter(filterName: string) {\n if (!this.showFilter) {\n this.filterName = filterName;\n this.showFilter = true;\n\n let offSet = 0;\n let colHeadersReversed = this.colHeaders.toArray().reverse();\n\n for (let header of colHeadersReversed) {\n if (header.nativeElement.innerText === filterName) break;\n offSet += header.nativeElement.offsetWidth;\n }\n this.filterContainerStyles = {\n top: \"44px\",\n right: offSet > 0 ? offSet - 116 + \"px\" : \"12px\"\n };\n } else {\n this.filterName = \"\";\n this.filterData = [];\n this.showFilter = false;\n }\n }\n updateAppliedFilters(appliedFilters: Array<{ name: string; value: string }>) {\n if (appliedFilters.length == 0) {\n delete this.appliedFilters[this.filterName];\n } else {\n this.appliedFilters[this.filterName] = appliedFilters;\n }\n this.filtersUpdated.emit({ ...this.appliedFilters });\n this.toggleFilter(this.filterName);\n }\n\n // Pagination related functions\n initializePagination() {\n if (this.config.paginationConfig) {\n let len = this.config.paginationConfig.noOfPages;\n if (len <= 7) {\n for (let i = 1; i <= len; i++) {\n this.pages.push(i);\n }\n } else {\n this.pages = [1, 2, 3, 4, 0, len];\n }\n }\n }\n updateSelectedPage(pageNumber: number) {\n if (pageNumber < 1 || pageNumber > this.config.paginationConfig.noOfPages) return;\n this.config.paginationConfig.selectedPage = pageNumber;\n let len = this.config.paginationConfig.noOfPages;\n if (len > 7) {\n if (pageNumber - 2 <= 1) {\n this.pages = [1, 2, 3, 4, 0, len];\n } else if (pageNumber - 2 > 1 && pageNumber + 2 < len) {\n this.pages = [1, 0, pageNumber - 1, pageNumber, pageNumber + 1, 0, len];\n } else if (pageNumber + 2 >= len) {\n this.pages = [1, 0, len - 3, len - 2, len - 1, len];\n }\n }\n this.pageSelected.emit(this.config.paginationConfig?.selectedPage);\n }\n\n // Main container related functions\n getContainerHeight() {\n if (this.config?.height) return this.config.height;\n else return \"\";\n }\n getContainerWidth() {\n if (this.config?.width) return this.config.width;\n else return \"\";\n }\n\n // Column Headers related functions\n getColHeadersRowHeight() {\n if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.height) {\n return this.config.colHeadersRowConfig.height;\n } else return \"44px\";\n }\n getColHeadersRowBorderTop() {\n if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.style?.borderTop) {\n return this.config.colHeadersRowConfig.style?.borderTop;\n } else return \"\";\n }\n getColHeadersRowBorderBottom() {\n if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.style?.borderBottom) {\n return this.config.colHeadersRowConfig.style?.borderBottom;\n } else return \"1px solid #E0E0E0\";\n }\n\n}\n\nexport interface TableConfig {\n height: string | \"100%\";\n width: string | \"100%\";\n paginationConfig?: PaginationConfig | undefined | null;\n colHeadersRowConfig: RowConfig | undefined | null;\n rowConfig: RowConfig | undefined | null;\n colHeaderConfig: Array<ColHeaderConfig>;\n colConfig: Array<ColConfig>;\n canExpand?: boolean;\n canScrollHorizontally?: boolean;\n cellHover?: boolean;\n}\nexport interface PaginationConfig {\n noOfPages: number;\n rowsPerPage: number;\n totalNoOfRows: number;\n selectedPage?: number;\n}\nexport interface RowConfig {\n height?: string | undefined | null;\n style?: {};\n action?: any;\n}\nexport interface ColHeaderConfig {\n type: \"text\" | \"number\" | \"custom\";\n data: any;\n componentRef?: any;\n filters?: Array<Filter> | null;\n style?: {};\n action?: any;\n}\nexport interface ColConfig {\n type: \"text\" | \"number\" | \"custom\";\n componentRef?: any;\n style?: {};\n action?: any;\n}\n","import { ComponentFactoryResolver, Directive, Input, ViewContainerRef } from \"@angular/core\";\n\n@Directive({\n selector: \"[customTableCell]\"\n})\nexport class CustomTableCellDirective {\n private ref: any;\n private component: any;\n private cellData: any;\n\n @Input() set customComponent(value: any) {\n this.component = value;\n this.createComponent();\n }\n @Input() set data(value: any) {\n this.cellData = value;\n if (this.ref) {\n this.ref.instance.data = this.cellData;\n }\n }\n\n constructor(private viewContainerRef: ViewContainerRef, private componentFactoryResolver: ComponentFactoryResolver) {}\n\n createComponent() {\n if (this.component) {\n const cmpFactoryResolver = this.componentFactoryResolver.resolveComponentFactory(this.component);\n this.viewContainerRef.clear();\n this.ref = this.viewContainerRef.createComponent(cmpFactoryResolver);\n this.setData();\n }\n }\n setData() {\n this.ref.instance.data = this.cellData;\n }\n}\n","import { AfterViewInit, Component, ElementRef, Input, OnInit, Renderer2, ViewChild } from \"@angular/core\";\n\n@Component({\n selector: \"sub-table\",\n templateUrl: \"sub-table.component.html\",\n styleUrls: [\"sub-table.component.css\"]\n})\nexport class SubTableComponent implements OnInit, AfterViewInit {\n selectedPage = 1;\n pages: Array<number> = [];\n\n @Input() config: SubTableConfig | any;\n @Input() tableData: Array<Array<any>> = [];\n @ViewChild(\"table\") table: ElementRef | any;\n constructor(private renderer: Renderer2) {}\n\n ngOnInit() {}\n\n ngAfterViewInit() {\n if (this.config.paginationConfig) {\n let height = this.table.nativeElement.offsetHeight;\n this.renderer.setStyle(this.table.nativeElement, \"height\", height - 56 + \"px\");\n }\n }\n\n // Main container related functions\n getContainerHeight() {\n if (this.config.height) return this.config.height;\n else return \"\";\n }\n getContainerWidth() {\n if (this.config.width) return this.config.width;\n else return \"\";\n }\n\n // Column Headers related functions\n getColHeadersRowHeight() {\n if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.height) {\n return this.config.colHeadersRowConfig.height;\n } else return \"44px\";\n }\n getColHeadersRowBorderTop() {\n if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.style?.borderTop) {\n return this.config.colHeadersRowConfig.style?.borderTop;\n } else return \"\";\n }\n getColHeadersRowBorderBottom() {\n if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.style?.borderBottom) {\n return this.config.colHeadersRowConfig.style?.borderBottom;\n } else return \"1px solid #E0E0E0\";\n }\n}\n\nexport interface SubTableConfig {\n height: string | \"100%\";\n width: string | \"100%\";\n dataContainerMaxHeight: string | \"400px\";\n showHeader?: boolean | undefined;\n rowConfig: SubTableRowConfig | undefined | null;\n colHeaderConfig?: Array<SubTableColHeaderConfig>;\n colConfig: Array<SubTableColConfig>;\n}\n\nexport interface SubTableRowConfig {\n height?: string | undefined | null;\n style?: {};\n}\nexport interface SubTableColHeaderConfig {\n type: \"text\" | \"number\" | \"custom\";\n data: any;\n componentRef?: any;\n style?: {};\n action?: any;\n}\nexport interface SubTableColConfig {\n type: \"text\" | \"number\" | \"custom\";\n componentRef?: any;\n style?: {};\n action?: any;\n}\n","import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from \"@angular/core\";\n\n@Component({\n selector: \"mis-table-filter\",\n templateUrl: \"filter.component.html\",\n styleUrls: [\"filter.component.css\"]\n})\nexport class TableFilterComponent implements OnInit {\n @Input() filtersData: Array<Filter> = [];\n @Input() containerStyles: any = {};\n\n @Output() filtersApplied = new EventEmitter<any>();\n\n @ViewChild(\"mainContainer\") container: ElementRef | undefined;\n\n filtersMap: any = {};\n searchValue: string = \"\";\n\n constructor() {}\n\n ngOnInit(): void {\n this.filtersData.forEach(filter => {\n this.filtersMap[filter.value] = filter;\n });\n }\n resetFilters() {\n this.filtersData.forEach(filter => {\n this.filtersMap[filter.value].checked = false;\n });\n this.filtersApplied.emit([]);\n }\n applyFilters() {\n let list = Object.values(this.filtersMap)\n .filter((filter: Filter | any) => filter.checked)\n .map((filter: Filter | any) => {\n return {\n name: filter.name,\n value: filter.value\n };\n });\n this.filtersApplied.emit(list);\n }\n updateSearchValue(event: any) {\n this.searchValue = event.target.value;\n }\n updateFilter(data: any) {\n if (this.filtersMap[data.name]) {\n this.filtersMap[data.name].checked = !this.filtersMap[data.name].checked;\n }\n }\n getFiltersBasedOnSearchValue(): Filter[] | any {\n let list = Object.values(this.filtersMap);\n list = list.filter((filter: Filter | any) => {\n return filter.name.match(new RegExp(this.searchValue, \"i\"));\n });\n return list.sort(this.mySort);\n }\n getCheckedFilters(): Filter[] | any {\n let list = Object.values(this.filtersMap);\n list = list.filter((filter: Filter | any) => filter.checked).sort(this.mySort);\n return list;\n }\n mySort = (a: Filter | any, b: Filter | any) => {\n if (a.name < b.name) return -1;\n else if (b.name < a.name) return 1;\n else return 0;\n };\n}\nexport interface Filter {\n name: string;\n value: string;\n checked: boolean;\n}\n","import { ModuleWithProviders, NgModule } from \"@angular/core\";\nimport { TableComponent } from \"./table.component\";\nimport { CustomTableCellDirective } from \"./custom-table-cell.directive\";\nimport { SubTableComponent } from \"./sub-table/sub-table.component\";\nimport { CommonModule } from \"@angular/common\";\nimport { TableFilterComponent } from \"./filter/filter.component\";\nimport { CheckboxModule } from \"mis-crystal-design-system/checkbox\";\nimport { ScrollingModule } from \"@angular/cdk/scrolling\";\n\n@NgModule({\n declarations: [TableComponent, SubTableComponent, TableFilterComponent, CustomTableCellDirective],\n imports: [CommonModule, CheckboxModule, ScrollingModule],\n exports: [TableComponent, SubTableComponent, TableFilterComponent, CustomTableCellDirective]\n})\nexport class TableModule {\n static forRoot(): ModuleWithProviders<TableModule> {\n return { ngModule: TableModule, providers: [] };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {SubTableComponent as ɵa} from './sub-table/sub-table.component';"],"names":[],"mappings":";;;;;MAqBa,cAAc;IAgCzB,YAAoB,QAAmB;QAAnB,aAAQ,GAAR,QAAQ,CAAW;;QA7BvC,mBAAc,GAAW,CAAC,CAAC;;QAG3B,eAAU,GAAY,KAAK,CAAC;QAC5B,eAAU,GAAW,EAAE,CAAC;QACxB,eAAU,GAAkB,EAAE,CAAC;QAC/B,0BAAqB,GAAQ,EAAE,CAAC;QAChC,mBAAc,GAA8D,EAAE,CAAC;QACrE,mBAAc,GAAG,IAAI,YAAY,EAEvC,CAAC;;QAML,UAAK,GAAkB,EAAE,CAAC;QAEhB,iBAAY,GAAG,IAAI,YAAY,EAAU,CAAC;QAM3C,cAAS,GAAsB,EAAE,CAAC;QAClC,iBAAY,GAAsB,EAAE,CAAC;KAIF;;IAG5C,SAAS,CAAC,KAAa;QACrB,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAC5B,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;KACrC;IACD,QAAQ;QACN,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,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-crystal-design-system",
3
- "version": "4.0.4",
3
+ "version": "4.0.6",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "*",
6
6
  "@angular/core": "*",
@@ -1 +1 @@
1
- {"__symbolic":"module","version":4,"metadata":{"ɵa":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":2,"character":1},"arguments":[{"selector":"sub-table","template":"<div\n id=\"main-container\"\n [ngStyle]=\"{\n height: getContainerHeight(),\n width: getContainerWidth()\n }\"\n>\n <div id=\"table-container\" #table>\n <div\n id=\"col-headers-container\"\n *ngIf=\"!!config.showHeader\"\n [ngStyle]=\"{\n height: getColHeadersRowHeight(),\n 'border-top': getColHeadersRowBorderTop(),\n 'border-bottom': getColHeadersRowBorderBottom()\n }\"\n >\n <div\n class=\"col-header\"\n (click)=\"colHeader?.action ? colHeader?.action(colHeader) : null\"\n *ngFor=\"let colHeader of config?.colHeaderConfig\"\n [style]=\"colHeader?.style\"\n [ngStyle]=\"{\n width: colHeader?.style?.width || '',\n cursor: colHeader.action ? 'pointer' : 'default',\n 'justify-content': colHeader?.style?.justifyContent\n ? colHeader?.style?.justifyContent\n : colHeader.type === 'number'\n ? 'flex-end'\n : 'space-between'\n }\"\n >\n <p *ngIf=\"colHeader?.type !== 'custom'\" class=\"col-header-text\">\n {{ colHeader?.data || \" \" }}\n </p>\n <ng-template\n *ngIf=\"colHeader?.type === 'custom'\"\n customTableCell\n [customComponent]=\"colHeader?.componentRef\"\n [data]=\"colHeader.data\"\n ></ng-template>\n </div>\n </div>\n <div>\n <cdk-virtual-scroll-viewport\n [minBufferPx]=\"config.dataContainerMaxHeight || '400'\"\n [maxBufferPx]=\"config.dataContainerMaxHeight + 200 || '600'\"\n [style.overflow]=\"'overlay'\"\n [style.height]=\"config.dataContainerMaxHeight || '400px'\"\n itemSize=\"50\"\n id=\"data-container\"\n >\n <div\n class=\"row-wrapper\"\n *cdkVirtualFor=\"let row of tableData; let i = index\"\n [ngStyle]=\"{\n backgroundColor: i % 2 === 0 ? '#FAFAFA' : null\n }\"\n >\n <div class=\"t-row\">\n <div\n (click)=\"config?.colConfig[i]?.action ? config?.colConfig[i]?.action(col) : null\"\n *ngFor=\"let col of row; let i = index\"\n [ngStyle]=\"{\n width: config?.colConfig[i]?.style?.width || config?.colHeaderConfig[i]?.style?.width || ''\n }\"\n class=\"t-col-container\"\n >\n <div\n class=\"t-col\"\n [style]=\"config.colConfig[i]?.style\"\n [ngStyle]=\"{\n width: '100%',\n cursor: config.colConfig[i].action ? 'pointer' : 'default',\n 'justify-content': config.colConfig[i]?.style?.justifyContent\n ? config.colConfig[i]?.style?.justifyContent\n : config.colConfig[i].type === 'number'\n ? 'flex-end'\n : 'space-between'\n }\"\n >\n <p\n *ngIf=\"config.colConfig[i].type !== 'custom'\"\n [ngStyle]=\"{\n color: config?.colConfig[i]?.style?.color ? config?.colConfig[i]?.style?.color : ''\n }\"\n class=\"t-col-text\"\n >\n {{ col }}\n </p>\n <ng-template\n *ngIf=\"config.colConfig[i].type === 'custom'\"\n [customComponent]=\"config.colConfig[i].componentRef\"\n [data]=\"col\"\n customTableCell\n ></ng-template>\n </div>\n </div>\n </div>\n </div>\n </cdk-virtual-scroll-viewport>\n </div>\n </div>\n</div>\n","styles":["#main-container{font-family:Lato,sans-serif}#table-container{height:inherit}#col-headers-container{display:flex;background-color:#fff;height:36px;border-bottom:1px solid #e0e0e0}#data-container{overflow:scroll;width:100%}#data-container::-webkit-scrollbar{width:8px}#data-container::-webkit-scrollbar-thumb{background:#9aa7b4}.col-header{height:100%;width:160px;padding:0 16px}.col-header,.col-header-text{display:flex;align-items:center}.col-header-text{font-style:normal;font-weight:700;font-size:14px;line-height:20px;letter-spacing:.25px;margin:0}.t-row{display:flex;align-items:center;height:36px;width:100%;border-bottom:1px solid #e0e0e0}.t-row:hover{background-color:#f1fdf8}.t-col-container{padding:0 16px;height:100%}.t-col{height:100%}.t-col,.t-col-text{display:flex;align-items:center}.t-col-text{font-style:normal;font-weight:400;font-size:14px;line-height:20px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;letter-spacing:.2px;margin:0}"]}]}],"members":{"config":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":11,"character":3}}]}],"tableData":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":12,"character":3}}]}],"table":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":13,"character":3},"arguments":["table"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":14,"character":32}]}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"getContainerHeight":[{"__symbolic":"method"}],"getContainerWidth":[{"__symbolic":"method"}],"getColHeadersRowHeight":[{"__symbolic":"method"}],"getColHeadersRowBorderTop":[{"__symbolic":"method"}],"getColHeadersRowBorderBottom":[{"__symbolic":"method"}]}},"TableComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":16,"character":1},"arguments":[{"selector":"mis-table","template":"<div\n [ngStyle]=\"{\n height: getContainerHeight(),\n width: getContainerWidth(),\n 'overflow-x': config.canScrollHorizontally ? 'auto' : 'unset'\n }\"\n id=\"main-container\"\n>\n <mis-table-filter\n #filter\n (filtersApplied)=\"updateAppliedFilters($event)\"\n *ngIf=\"showFilter\"\n [containerStyles]=\"filterContainerStyles\"\n [filtersData]=\"filterData\"\n ></mis-table-filter>\n <div\n #table\n id=\"table-container\"\n [ngClass]=\"{ 'no-scrollbar': expandedIndex < 0, scrollbar: !(expandedIndex < 0), 'scroll-horizontally': config.canScrollHorizontally }\"\n >\n <div\n [ngStyle]=\"{\n 'min-height': getColHeadersRowHeight(),\n 'border-top': getColHeadersRowBorderTop(),\n 'border-bottom': getColHeadersRowBorderBottom()\n }\"\n id=\"col-headers-container\"\n >\n <div\n #colHeaderRef\n (click)=\"colHeader?.action ? colHeader?.action(colHeader) : null\"\n *ngFor=\"let colHeader of config?.colHeaderConfig\"\n class=\"col-header\"\n [ngStyle]=\"{\n width: colHeader?.style?.width || '',\n cursor: colHeader.action ? 'pointer' : 'default',\n 'justify-content': colHeader?.style?.justifyContent\n ? colHeader?.style?.justifyContent\n : colHeader.type === 'number'\n ? 'flex-end'\n : 'space-between'\n }\"\n >\n <p *ngIf=\"colHeader?.type !== 'custom'\" class=\"col-header-text\">\n {{ colHeader?.data || \" \" }}\n </p>\n <span\n (click)=\"filterData = colHeader.filters; toggleFilter(colHeader.data); $event.stopPropagation()\"\n *ngIf=\"colHeader?.type !== 'custom' && colHeader?.filters && colHeader?.filters?.length > 0\"\n class=\"filter-icon\"\n >\n <span *ngIf=\"appliedFilters[colHeader.data]?.length > 0\" id=\"filter-active\"></span>\n <svg fill=\"none\" height=\"10\" viewBox=\"0 0 13 10\" width=\"13\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n clip-rule=\"evenodd\"\n d=\"M4.97546 10H7.64213V8H4.97546V10ZM0.308472 0V2H12.3085V0H0.308472ZM2.30847 6H10.3085V4H2.30847V6Z\"\n fill=\"#181F33\"\n fill-rule=\"evenodd\"\n />\n </svg>\n </span>\n <ng-template\n *ngIf=\"colHeader?.type === 'custom'\"\n [customComponent]=\"colHeader?.componentRef\"\n [data]=\"colHeader.data\"\n customTableCell\n ></ng-template>\n </div>\n </div>\n <div id=\"data-container\">\n <div class=\"row-wrapper\" *ngFor=\"let row of tableData; let i = index\">\n <div\n class=\"t-row\"\n [ngClass]=\"{ 't-row-hover': config.cellHover }\"\n [ngStyle]=\"{ 'min-height': config?.rowConfig?.height ? config.rowConfig.height : '44px' }\"\n >\n <div\n (click)=\"config?.colConfig[i]?.action ? config?.colConfig[i]?.action(col) : null\"\n *ngFor=\"let col of row; let i = index\"\n [ngStyle]=\"{\n width: config?.colConfig[i]?.style?.width || config?.colHeaderConfig[i]?.style?.width || ''\n }\"\n class=\"t-col-container\"\n [ngClass]=\"{ 't-col-container-hover': config.cellHover }\"\n >\n <div\n class=\"t-col\"\n [style]=\"config.colConfig[i]?.style\"\n [ngStyle]=\"{\n width: '100%',\n cursor: config.colConfig[i]?.action ? 'pointer' : 'default',\n 'justify-content': config.colConfig[i]?.style?.justifyContent\n ? config.colConfig[i]?.style?.justifyContent\n : config.colConfig[i]?.type === 'number'\n ? 'flex-end'\n : 'space-between'\n }\"\n >\n <p\n *ngIf=\"config.colConfig[i]?.type !== 'custom'\"\n [ngStyle]=\"{\n color: config?.colConfig[i]?.style?.color ? config?.colConfig[i]?.style?.color : ''\n }\"\n class=\"t-col-text\"\n >\n {{ col }}\n </p>\n <ng-template\n *ngIf=\"config.colConfig[i]?.type === 'custom'\"\n [customComponent]=\"config.colConfig[i].componentRef\"\n [data]=\"col\"\n customTableCell\n ></ng-template>\n </div>\n </div>\n </div>\n <div *ngIf=\"config?.canExpand && expandedIndex === i\" class=\"sub-row\">\n <ng-container *ngIf=\"subTableDataLoading\">\n <div style=\"display: flex; justify-content: center; align-items: center; padding: 16px\">Loading...</div>\n </ng-container>\n <ng-container *ngIf=\"!subTableDataLoading && subTableData.length === 0\">\n <div style=\"display: flex; justify-content: center; align-items: center; padding: 16px\">No Data Available...</div>\n </ng-container>\n <ng-container *ngIf=\"!subTableDataLoading && subTableData.length > 0\">\n <sub-table [config]=\"subTableconfig\" [tableData]=\"subTableData\"></sub-table>\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n <div\n *ngIf=\"config?.paginationConfig && (tableLength >= config.paginationConfig.rowsPerPage || config.paginationConfig?.selectedPage !== 1)\"\n id=\"pagination-container\"\n >\n <p id=\"pagination-text\">\n Showing\n {{ (config.paginationConfig?.selectedPage - 1) * config.paginationConfig.rowsPerPage + 1 }}-{{\n (config.paginationConfig?.selectedPage - 1) * config.paginationConfig.rowsPerPage + tableLength\n }}\n of {{ config.paginationConfig.totalNoOfRows }} items\n </p>\n <div id=\"pages-container\">\n <span (click)=\"updateSelectedPage(config.paginationConfig?.selectedPage - 1)\" class=\"page\">\n <svg fill=\"none\" height=\"10\" viewBox=\"0 0 7 10\" width=\"7\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n clip-rule=\"evenodd\"\n d=\"M0.857405 5.56295C0.855794 5.56139 0.854188 5.55982 0.852588 5.55824C0.695955 5.40408 0.617641 5.20203 0.617647 4.99998C0.617641 4.79793 0.695955 4.59588 0.852588 4.44172C0.854188 4.44014 0.855794 4.43858 0.857404 4.43702L5.13066 0.231231C5.44392 -0.0770771 5.9518 -0.0770771 6.26506 0.231231C6.57831 0.53954 6.57831 1.03941 6.26506 1.34772L2.5542 4.99998L6.26506 8.65225C6.57831 8.96055 6.57831 9.46042 6.26506 9.76873C5.9518 10.077 5.44392 10.077 5.13066 9.76873L0.857405 5.56295Z\"\n fill=\"#181F33\"\n fill-rule=\"evenodd\"\n />\n </svg>\n </span>\n <div *ngFor=\"let pageNumber of pages\">\n <span\n (click)=\"updateSelectedPage(pageNumber)\"\n *ngIf=\"pageNumber != 0\"\n [ngClass]=\"{ 'page-active': pageNumber == config.paginationConfig?.selectedPage }\"\n class=\"page\"\n >{{ pageNumber }}</span\n >\n <span *ngIf=\"pageNumber == 0\" class=\"page-seperator\">\n <div style=\"display: flex\">\n <span class=\"dot\" style=\"margin-right: 4px\"></span>\n <span class=\"dot\" style=\"margin-right: 4px\"></span>\n <span class=\"dot\"></span>\n </div>\n </span>\n </div>\n <span (click)=\"updateSelectedPage(config.paginationConfig?.selectedPage + 1)\" class=\"page\">\n <svg fill=\"none\" height=\"10\" viewBox=\"0 0 7 10\" width=\"7\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n clip-rule=\"evenodd\"\n d=\"M6.1426 5.56295C6.14421 5.56139 6.14581 5.55982 6.14741 5.55824C6.30405 5.40408 6.38236 5.20203 6.38236 4.99998C6.38236 4.79793 6.30405 4.59588 6.14741 4.44172C6.14581 4.44014 6.14421 4.43858 6.1426 4.43702L1.86934 0.231231C1.55608 -0.0770771 1.0482 -0.0770771 0.734942 0.231231C0.421688 0.53954 0.421688 1.03941 0.734942 1.34772L4.4458 4.99998L0.734941 8.65225C0.421686 8.96055 0.421686 9.46042 0.734941 9.76873C1.0482 10.077 1.55608 10.077 1.86934 9.76873L6.1426 5.56295Z\"\n fill=\"#181F33\"\n fill-rule=\"evenodd\"\n />\n </svg>\n </span>\n </div>\n </div>\n</div>\n","styles":["#main-container{font-family:Lato,sans-serif;position:relative}.no-scrollbar::-webkit-scrollbar{width:0}.scrollbar::-webkit-scrollbar{width:8px;height:8px;border-radius:15px}.scrollbar::-webkit-scrollbar-thumb{background:#9aa7b4;border-radius:15px}#table-container{height:inherit;overflow-y:auto}.scroll-horizontally{height:inherit;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;overflow-y:unset!important;overflow-x:visible}#col-headers-container{display:flex;align-items:center;position:-webkit-sticky;position:sticky;background-color:#fff;width:100%;z-index:1;min-height:44px;border-bottom:1px solid #e0e0e0;top:0;left:0;right:0}.col-header{padding:0 16px;height:100%}.col-header,.col-header-text{display:flex;align-items:center}.col-header-text{font-style:normal;font-weight:700;font-size:14px;line-height:20px;letter-spacing:.2px;margin:0}.filter-icon{margin-left:8px;padding:0 8px;position:relative;cursor:pointer}#filter-active{height:8px;width:8px;background:#16cbbc;border-radius:50%;position:absolute;top:4px;right:4px}.sub-row{height:auto;border-bottom:none}.loader ::ng-deep .mat-progress-spinner circle,.mat-spinner circle{stroke:#0937b2}.t-row{display:flex;min-height:44px;background-color:#fff;width:100%;border-bottom:1px solid #e0e0e0}.t-row:hover{background-color:#f1fdf8}.t-col-container{padding:0 16px}.t-row-hover:hover{background-color:transparent}.t-col-container-hover:hover{background-color:#e6ebf7}.t-col-container-hover:first-child{border-left:1px solid #e0e0e0}.t-col-container-hover{border-right:1px solid #e0e0e0}.t-col{height:100%}.t-col,.t-col-text{display:flex;align-items:center}.t-col-text{font-style:normal;font-weight:400;font-size:14px;line-height:20px;letter-spacing:.2px;margin:0}#pagination-container{display:flex;justify-content:flex-end;align-items:center;height:56px}#pagination-text{font-style:normal;font-weight:400;font-size:12px;line-height:18px;letter-spacing:.4px;color:#6a737d;margin:0 96px 0 0}#pages-container{display:flex;margin-right:32px}.page{border:1px solid #6a737d;box-sizing:border-box;border-radius:4px;font-size:14px;line-height:20px;letter-spacing:.2px;color:#6a737d;cursor:pointer}.page,.page-seperator{display:flex;justify-content:center;align-items:center;width:32px;height:32px;margin-right:8px}.dot{height:3px;width:3px;border-radius:50%;background:#6a737d}.page-active{color:#0937b2;border:1px solid #0937b2}"]}]}],"members":{"filtersUpdated":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":28,"character":3}}]}],"filter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":32,"character":3},"arguments":["filter"]}]}],"colHeaders":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChildren","line":33,"character":3},"arguments":["colHeaderRef"]}]}],"pageSelected":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":38,"character":3}}]}],"config":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":40,"character":3},"arguments":["tableConfig"]}]}],"subTableconfig":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":41,"character":3}}]}],"tableDataLoading":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":42,"character":3}}]}],"expandedIndex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":43,"character":3}}]}],"tableData":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":44,"character":3}}]}],"subTableData":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":45,"character":3}}]}],"subTableDataLoading":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":46,"character":3}}]}],"table":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":47,"character":3},"arguments":["table"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":49,"character":32}]}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"initializeFilters":[{"__symbolic":"method"}],"toggleFilter":[{"__symbolic":"method"}],"updateAppliedFilters":[{"__symbolic":"method"}],"initializePagination":[{"__symbolic":"method"}],"updateSelectedPage":[{"__symbolic":"method"}],"getContainerHeight":[{"__symbolic":"method"}],"getContainerWidth":[{"__symbolic":"method"}],"getColHeadersRowHeight":[{"__symbolic":"method"}],"getColHeadersRowBorderTop":[{"__symbolic":"method"}],"getColHeadersRowBorderBottom":[{"__symbolic":"method"}]}},"CustomTableCellDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":2,"character":1},"arguments":[{"selector":"[customTableCell]"}]}],"members":{"customComponent":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":10,"character":3}}]}],"data":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":14,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":21,"character":40},{"__symbolic":"reference","module":"@angular/core","name":"ComponentFactoryResolver","line":21,"character":92}]}],"createComponent":[{"__symbolic":"method"}],"setData":[{"__symbolic":"method"}]}},"TableModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":9,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"TableComponent"},{"__symbolic":"reference","name":"ɵa"},{"__symbolic":"reference","name":"TableFilterComponent"},{"__symbolic":"reference","name":"CustomTableCellDirective"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":11,"character":12},{"__symbolic":"reference","module":"mis-crystal-design-system/checkbox","name":"CheckboxModule","line":11,"character":26},{"__symbolic":"reference","module":"@angular/cdk/scrolling","name":"ScrollingModule","line":11,"character":42}],"exports":[{"__symbolic":"reference","name":"TableComponent"},{"__symbolic":"reference","name":"ɵa"},{"__symbolic":"reference","name":"TableFilterComponent"},{"__symbolic":"reference","name":"CustomTableCellDirective"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"TableModule"},"providers":[]}}}},"TableConfig":{"__symbolic":"interface"},"PaginationConfig":{"__symbolic":"interface"},"RowConfig":{"__symbolic":"interface"},"ColHeaderConfig":{"__symbolic":"interface"},"ColConfig":{"__symbolic":"interface"},"SubTableConfig":{"__symbolic":"interface"},"SubTableColConfig":{"__symbolic":"interface"},"SubTableColHeaderConfig":{"__symbolic":"interface"},"SubTableRowConfig":{"__symbolic":"interface"},"TableFilterComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":2,"character":1},"arguments":[{"selector":"mis-table-filter","template":"<div id=\"main-container\" #mainContainer [ngStyle]=\"containerStyles\">\n <div id=\"search-bar-container\">\n <input (keyup)=\"updateSearchValue($event)\" type=\"text\" placeholder=\"Search\" />\n <svg id=\"search-icon\" width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M1.21496 8.14563C1.21496 4.3179 4.33709 1.21165 8.19249 1.21165C12.0479 1.21165 15.17 4.3179 15.17 8.14563C15.17 9.69308 14.6598 11.1226 13.797 12.2767L12.3684 13.7013C11.2043 14.5668 9.75891 15.0796 8.19249 15.0796C4.33709 15.0796 1.21496 11.9734 1.21496 8.14563ZM12.9419 14.7835C11.602 15.7329 9.96259 16.2913 8.19249 16.2913C3.66965 16.2913 -0.00012207 12.6461 -0.00012207 8.14563C-0.00012207 3.64512 3.66965 0 8.19249 0C12.7153 0 16.3851 3.64512 16.3851 8.14563C16.3851 9.93713 15.8036 11.5931 14.8183 12.9375L16.836 14.4048C17.6704 14.912 18.7553 15.6543 17.2453 17.215C15.7352 18.7756 15.0098 17.6663 14.499 16.8364L12.9419 14.7835Z\"\n fill=\"#6A737D\"\n />\n </svg>\n </div>\n <div id=\"filters-main-container\">\n <div class=\"filters-sub-container\">\n <div *ngFor=\"let filter of getCheckedFilters()\">\n <div class=\"filter\">\n <mis-checkbox [checked]=\"true\" [name]=\"filter.value\" (valueChange)=\"updateFilter($event)\"></mis-checkbox>\n <span class=\"filter-text\">{{ filter.name }}</span>\n </div>\n </div>\n </div>\n <div class=\"separator\" style=\"margin: 16px 0px\" *ngIf=\"getCheckedFilters().length && getCheckedFilters().length < filtersData.length\"></div>\n <div class=\"filters-sub-container\">\n <div *ngFor=\"let filter of getFiltersBasedOnSearchValue()\">\n <div class=\"filter\" *ngIf=\"!filter.checked\">\n <mis-checkbox [checked]=\"false\" [name]=\"filter.value\" (valueChange)=\"updateFilter($event)\"></mis-checkbox>\n <span class=\"filter-text\">{{ filter.name }}</span>\n </div>\n </div>\n <div id=\"no-results-container\" *ngIf=\"getFiltersBasedOnSearchValue().length < 1\">\n <span class=\"filter-text\">No matches found</span>\n </div>\n </div>\n <div class=\"separator\" style=\"margin: 16px 0px\"></div>\n <div id=\"buttons-container\">\n <button id=\"reset-btn\" style=\"margin-right: 8px\" (click)=\"resetFilters()\">Reset</button>\n <button id=\"apply-btn\" (click)=\"applyFilters()\">Apply</button>\n </div>\n </div>\n</div>\n","styles":["#main-container{position:absolute;background:#fff;z-index:2;right:calc(50% - 128px);width:256px;padding:16px;font-family:Lato,sans-serif;box-shadow:0 12px 24px rgba(0,0,0,.12),0 4px 8px rgba(0,0,0,.12);border-radius:8px}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-thumb{background:#9aa7b4}#search-bar-container{width:100%;position:relative;margin-bottom:8px}input{width:100%;padding:12px 12px 12px 42px;border:1px solid #000;border-radius:4px;height:48px;box-shadow:none;outline:none;font-style:normal;font-weight:400;font-size:15px;line-height:20px;letter-spacing:.1px;color:#181f33}input:focus{border:1px solid #0937b2}#search-icon{position:absolute;top:15px;left:12px}.filters-sub-container{max-height:144px;overflow-y:auto}.filter{height:36px;display:flex;justify-content:flex-start;align-items:center}.filter-text{font-size:14px;line-height:20px;padding-left:8px;letter-spacing:.2px;color:#181f33;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}#no-results-container{height:36px;display:flex;justify-content:center;align-items:center}.separator{border:1px solid #e0e0e0}#buttons-container{display:flex;justify-content:center;align-items:center}button{width:calc(50% - 4px);border:none;box-shadow:none;outline:none;font-size:16px;line-height:24px;text-align:center;letter-spacing:.2px;padding:10px 30px;background:none;border-radius:8px}#apply-btn{background:#0937b2;color:#fff}#reset-btn{background:#fff;color:#0937b2}"]}]}],"members":{"filtersData":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":8,"character":3}}]}],"containerStyles":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":9,"character":3}}]}],"filtersApplied":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":11,"character":3}}]}],"container":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":13,"character":3},"arguments":["mainContainer"]}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"resetFilters":[{"__symbolic":"method"}],"applyFilters":[{"__symbolic":"method"}],"updateSearchValue":[{"__symbolic":"method"}],"updateFilter":[{"__symbolic":"method"}],"getFiltersBasedOnSearchValue":[{"__symbolic":"method"}],"getCheckedFilters":[{"__symbolic":"method"}]}},"Filter":{"__symbolic":"interface"}},"origins":{"ɵa":"./sub-table/sub-table.component","TableComponent":"./table.component","CustomTableCellDirective":"./custom-table-cell.directive","TableModule":"./table.module","TableConfig":"./table.component","PaginationConfig":"./table.component","RowConfig":"./table.component","ColHeaderConfig":"./table.component","ColConfig":"./table.component","SubTableConfig":"./sub-table/sub-table.component","SubTableColConfig":"./sub-table/sub-table.component","SubTableColHeaderConfig":"./sub-table/sub-table.component","SubTableRowConfig":"./sub-table/sub-table.component","TableFilterComponent":"./filter/filter.component","Filter":"./filter/filter.component"},"importAs":"mis-crystal-design-system/table"}
1
+ {"__symbolic":"module","version":4,"metadata":{"ɵa":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":2,"character":1},"arguments":[{"selector":"sub-table","template":"<div\n id=\"main-container\"\n [ngStyle]=\"{\n height: getContainerHeight(),\n width: getContainerWidth()\n }\"\n>\n <div id=\"table-container\" #table>\n <div\n id=\"col-headers-container\"\n *ngIf=\"!!config.showHeader\"\n [ngStyle]=\"{\n height: getColHeadersRowHeight(),\n 'border-top': getColHeadersRowBorderTop(),\n 'border-bottom': getColHeadersRowBorderBottom()\n }\"\n >\n <div\n class=\"col-header\"\n (click)=\"colHeader?.action ? colHeader?.action(colHeader) : null\"\n *ngFor=\"let colHeader of config?.colHeaderConfig\"\n [style]=\"colHeader?.style\"\n [ngStyle]=\"{\n width: colHeader?.style?.width || '',\n cursor: colHeader.action ? 'pointer' : 'default',\n 'justify-content': colHeader?.style?.justifyContent\n ? colHeader?.style?.justifyContent\n : colHeader.type === 'number'\n ? 'flex-end'\n : 'space-between'\n }\"\n >\n <p *ngIf=\"colHeader?.type !== 'custom'\" class=\"col-header-text\">\n {{ colHeader?.data || \" \" }}\n </p>\n <ng-template\n *ngIf=\"colHeader?.type === 'custom'\"\n customTableCell\n [customComponent]=\"colHeader?.componentRef\"\n [data]=\"colHeader.data\"\n ></ng-template>\n </div>\n </div>\n <div>\n <cdk-virtual-scroll-viewport\n [minBufferPx]=\"config.dataContainerMaxHeight || '400'\"\n [maxBufferPx]=\"config.dataContainerMaxHeight + 200 || '600'\"\n [style.overflow]=\"'overlay'\"\n [style.height]=\"config.dataContainerMaxHeight || '400px'\"\n itemSize=\"50\"\n id=\"data-container\"\n >\n <div\n class=\"row-wrapper\"\n *cdkVirtualFor=\"let row of tableData; let i = index\"\n [ngStyle]=\"{\n backgroundColor: i % 2 === 0 ? '#FAFAFA' : null\n }\"\n >\n <div class=\"t-row\">\n <div\n (click)=\"config?.colConfig[i]?.action ? config?.colConfig[i]?.action(col) : null\"\n *ngFor=\"let col of row; let i = index\"\n [ngStyle]=\"{\n width: config?.colConfig[i]?.style?.width || config?.colHeaderConfig[i]?.style?.width || ''\n }\"\n class=\"t-col-container\"\n >\n <div\n class=\"t-col\"\n [style]=\"config.colConfig[i]?.style\"\n [ngStyle]=\"{\n width: '100%',\n cursor: config.colConfig[i].action ? 'pointer' : 'default',\n 'justify-content': config.colConfig[i]?.style?.justifyContent\n ? config.colConfig[i]?.style?.justifyContent\n : config.colConfig[i].type === 'number'\n ? 'flex-end'\n : 'space-between'\n }\"\n >\n <p\n *ngIf=\"config.colConfig[i].type !== 'custom'\"\n [ngStyle]=\"{\n color: config?.colConfig[i]?.style?.color ? config?.colConfig[i]?.style?.color : ''\n }\"\n class=\"t-col-text\"\n >\n {{ col }}\n </p>\n <ng-template\n *ngIf=\"config.colConfig[i].type === 'custom'\"\n [customComponent]=\"config.colConfig[i].componentRef\"\n [data]=\"col\"\n customTableCell\n ></ng-template>\n </div>\n </div>\n </div>\n </div>\n </cdk-virtual-scroll-viewport>\n </div>\n </div>\n</div>\n","styles":["#main-container{font-family:Lato,sans-serif}#table-container{height:inherit}#col-headers-container{display:flex;background-color:#fff;height:36px;border-bottom:1px solid #e0e0e0}#data-container{overflow:scroll;width:100%}#data-container::-webkit-scrollbar{width:8px}#data-container::-webkit-scrollbar-thumb{background:#9aa7b4}.col-header{height:100%;width:160px;padding:0 16px}.col-header,.col-header-text{display:flex;align-items:center}.col-header-text{font-style:normal;font-weight:700;font-size:14px;line-height:20px;letter-spacing:.25px;margin:0}.t-row{display:flex;align-items:center;height:36px;width:100%;border-bottom:1px solid #e0e0e0}.t-row:hover{background-color:#f1fdf8}.t-col-container{padding:0 16px;height:100%}.t-col{height:100%}.t-col,.t-col-text{display:flex;align-items:center}.t-col-text{font-style:normal;font-weight:400;font-size:14px;line-height:20px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;letter-spacing:.2px;margin:0}"]}]}],"members":{"config":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":11,"character":3}}]}],"tableData":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":12,"character":3}}]}],"table":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":13,"character":3},"arguments":["table"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":14,"character":32}]}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"getContainerHeight":[{"__symbolic":"method"}],"getContainerWidth":[{"__symbolic":"method"}],"getColHeadersRowHeight":[{"__symbolic":"method"}],"getColHeadersRowBorderTop":[{"__symbolic":"method"}],"getColHeadersRowBorderBottom":[{"__symbolic":"method"}]}},"TableComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":16,"character":1},"arguments":[{"selector":"mis-table","template":"<div\n [ngStyle]=\"{\n height: getContainerHeight(),\n width: getContainerWidth(),\n 'overflow-x': config.canScrollHorizontally ? 'auto' : 'unset'\n }\"\n id=\"main-container\"\n>\n <mis-table-filter\n #filter\n (filtersApplied)=\"updateAppliedFilters($event)\"\n *ngIf=\"showFilter\"\n [containerStyles]=\"filterContainerStyles\"\n [filtersData]=\"filterData\"\n ></mis-table-filter>\n <div\n #table\n id=\"table-container\"\n [ngClass]=\"{ 'no-scrollbar': expandedIndex < 0, scrollbar: !(expandedIndex < 0), 'scroll-horizontally': config.canScrollHorizontally }\"\n >\n <div\n [ngStyle]=\"{\n 'min-height': getColHeadersRowHeight(),\n 'border-top': getColHeadersRowBorderTop(),\n 'border-bottom': getColHeadersRowBorderBottom()\n }\"\n id=\"col-headers-container\"\n >\n <div\n #colHeaderRef\n (click)=\"colHeader?.action ? colHeader?.action(colHeader) : null\"\n *ngFor=\"let colHeader of config?.colHeaderConfig\"\n class=\"col-header\"\n [ngStyle]=\"{\n width: colHeader?.style?.width || '',\n cursor: colHeader.action ? 'pointer' : 'default',\n 'justify-content': colHeader?.style?.justifyContent\n ? colHeader?.style?.justifyContent\n : colHeader.type === 'number'\n ? 'flex-end'\n : 'space-between'\n }\"\n >\n <p *ngIf=\"colHeader?.type !== 'custom'\" class=\"col-header-text\">\n {{ colHeader?.data || \" \" }}\n </p>\n <span\n (click)=\"filterData = colHeader.filters; toggleFilter(colHeader.data); $event.stopPropagation()\"\n *ngIf=\"colHeader?.type !== 'custom' && colHeader?.filters && colHeader?.filters?.length > 0\"\n class=\"filter-icon\"\n >\n <span *ngIf=\"appliedFilters[colHeader.data]?.length > 0\" id=\"filter-active\"></span>\n <svg fill=\"none\" height=\"10\" viewBox=\"0 0 13 10\" width=\"13\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n clip-rule=\"evenodd\"\n d=\"M4.97546 10H7.64213V8H4.97546V10ZM0.308472 0V2H12.3085V0H0.308472ZM2.30847 6H10.3085V4H2.30847V6Z\"\n fill=\"#181F33\"\n fill-rule=\"evenodd\"\n />\n </svg>\n </span>\n <ng-template\n *ngIf=\"colHeader?.type === 'custom'\"\n [customComponent]=\"colHeader?.componentRef\"\n [data]=\"colHeader.data\"\n customTableCell\n ></ng-template>\n </div>\n </div>\n <div id=\"data-container\">\n <div class=\"row-wrapper\" *ngFor=\"let row of tableData; let i = index\">\n <div\n class=\"t-row\"\n [ngClass]=\"{ 't-row-hover': config.cellHover, 'active-row': i === activeRowIndex }\"\n [ngStyle]=\"{ 'min-height': config?.rowConfig?.height ? config.rowConfig.height : '44px' }\"\n (click)=\"selectRow(i)\"\n >\n <div\n (click)=\"config?.colConfig[i]?.action ? config?.colConfig[i]?.action(col) : null\"\n *ngFor=\"let col of row; let i = index\"\n [ngStyle]=\"{\n width: config?.colConfig[i]?.style?.width || config?.colHeaderConfig[i]?.style?.width || ''\n }\"\n class=\"t-col-container\"\n [ngClass]=\"{ 't-col-container-hover': config.cellHover }\"\n >\n <div\n class=\"t-col\"\n [style]=\"config.colConfig[i]?.style\"\n [ngStyle]=\"{\n width: '100%',\n cursor: config.colConfig[i]?.action ? 'pointer' : 'default',\n 'justify-content': config.colConfig[i]?.style?.justifyContent\n ? config.colConfig[i]?.style?.justifyContent\n : config.colConfig[i]?.type === 'number'\n ? 'flex-end'\n : 'space-between'\n }\"\n >\n <p\n *ngIf=\"config.colConfig[i]?.type !== 'custom'\"\n [ngStyle]=\"{\n color: config?.colConfig[i]?.style?.color ? config?.colConfig[i]?.style?.color : ''\n }\"\n class=\"t-col-text\"\n >\n {{ col }}\n </p>\n <ng-template\n *ngIf=\"config.colConfig[i]?.type === 'custom'\"\n [customComponent]=\"config.colConfig[i].componentRef\"\n [data]=\"col\"\n customTableCell\n ></ng-template>\n </div>\n </div>\n </div>\n <div *ngIf=\"config?.canExpand && expandedIndex === i\" class=\"sub-row\">\n <ng-container *ngIf=\"subTableDataLoading\">\n <div style=\"display: flex; justify-content: center; align-items: center; padding: 16px\">Loading...</div>\n </ng-container>\n <ng-container *ngIf=\"!subTableDataLoading && subTableData.length === 0\">\n <div style=\"display: flex; justify-content: center; align-items: center; padding: 16px\">No Data Available...</div>\n </ng-container>\n <ng-container *ngIf=\"!subTableDataLoading && subTableData.length > 0\">\n <sub-table [config]=\"subTableconfig\" [tableData]=\"subTableData\"></sub-table>\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n <div\n *ngIf=\"config?.paginationConfig && (tableLength >= config.paginationConfig.rowsPerPage || config.paginationConfig?.selectedPage !== 1)\"\n id=\"pagination-container\"\n >\n <p id=\"pagination-text\">\n Showing\n {{ (config.paginationConfig?.selectedPage - 1) * config.paginationConfig.rowsPerPage + 1 }}-{{\n (config.paginationConfig?.selectedPage - 1) * config.paginationConfig.rowsPerPage + tableLength\n }}\n of {{ config.paginationConfig.totalNoOfRows }} items\n </p>\n <div id=\"pages-container\">\n <span (click)=\"updateSelectedPage(config.paginationConfig?.selectedPage - 1)\" class=\"page\">\n <svg fill=\"none\" height=\"10\" viewBox=\"0 0 7 10\" width=\"7\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n clip-rule=\"evenodd\"\n d=\"M0.857405 5.56295C0.855794 5.56139 0.854188 5.55982 0.852588 5.55824C0.695955 5.40408 0.617641 5.20203 0.617647 4.99998C0.617641 4.79793 0.695955 4.59588 0.852588 4.44172C0.854188 4.44014 0.855794 4.43858 0.857404 4.43702L5.13066 0.231231C5.44392 -0.0770771 5.9518 -0.0770771 6.26506 0.231231C6.57831 0.53954 6.57831 1.03941 6.26506 1.34772L2.5542 4.99998L6.26506 8.65225C6.57831 8.96055 6.57831 9.46042 6.26506 9.76873C5.9518 10.077 5.44392 10.077 5.13066 9.76873L0.857405 5.56295Z\"\n fill=\"#181F33\"\n fill-rule=\"evenodd\"\n />\n </svg>\n </span>\n <div *ngFor=\"let pageNumber of pages\">\n <span\n (click)=\"updateSelectedPage(pageNumber)\"\n *ngIf=\"pageNumber != 0\"\n [ngClass]=\"{ 'page-active': pageNumber == config.paginationConfig?.selectedPage }\"\n class=\"page\"\n >{{ pageNumber }}</span\n >\n <span *ngIf=\"pageNumber == 0\" class=\"page-seperator\">\n <div style=\"display: flex\">\n <span class=\"dot\" style=\"margin-right: 4px\"></span>\n <span class=\"dot\" style=\"margin-right: 4px\"></span>\n <span class=\"dot\"></span>\n </div>\n </span>\n </div>\n <span (click)=\"updateSelectedPage(config.paginationConfig?.selectedPage + 1)\" class=\"page\">\n <svg fill=\"none\" height=\"10\" viewBox=\"0 0 7 10\" width=\"7\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n clip-rule=\"evenodd\"\n d=\"M6.1426 5.56295C6.14421 5.56139 6.14581 5.55982 6.14741 5.55824C6.30405 5.40408 6.38236 5.20203 6.38236 4.99998C6.38236 4.79793 6.30405 4.59588 6.14741 4.44172C6.14581 4.44014 6.14421 4.43858 6.1426 4.43702L1.86934 0.231231C1.55608 -0.0770771 1.0482 -0.0770771 0.734942 0.231231C0.421688 0.53954 0.421688 1.03941 0.734942 1.34772L4.4458 4.99998L0.734941 8.65225C0.421686 8.96055 0.421686 9.46042 0.734941 9.76873C1.0482 10.077 1.55608 10.077 1.86934 9.76873L6.1426 5.56295Z\"\n fill=\"#181F33\"\n fill-rule=\"evenodd\"\n />\n </svg>\n </span>\n </div>\n </div>\n</div>\n","styles":["#main-container{font-family:Lato,sans-serif;position:relative}.no-scrollbar::-webkit-scrollbar{width:0}.scrollbar::-webkit-scrollbar{width:8px;height:8px;border-radius:15px}.scrollbar::-webkit-scrollbar-thumb{background:#9aa7b4;border-radius:15px}#table-container{height:inherit;overflow-y:auto}.scroll-horizontally{height:inherit;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;overflow-y:unset!important;overflow-x:visible}#col-headers-container{display:flex;align-items:center;position:-webkit-sticky;position:sticky;background-color:#fff;width:100%;z-index:1;min-height:44px;border-bottom:1px solid #e0e0e0;top:0;left:0;right:0}.col-header{padding:0 16px;height:100%}.col-header,.col-header-text{display:flex;align-items:center}.col-header-text{font-style:normal;font-weight:700;font-size:14px;line-height:20px;letter-spacing:.2px;margin:0}.filter-icon{margin-left:8px;padding:0 8px;position:relative;cursor:pointer}#filter-active{height:8px;width:8px;background:#16cbbc;border-radius:50%;position:absolute;top:4px;right:4px}.sub-row{height:auto;border-bottom:none}.loader ::ng-deep .mat-progress-spinner circle,.mat-spinner circle{stroke:#0937b2}.t-row{display:flex;min-height:44px;background-color:#fff;width:100%;border-bottom:1px solid #e0e0e0}.t-row:hover{background-color:#e7eefd}.active-row{background-color:#e6f6fd}.t-col-container{padding:0 16px}.t-row-hover:hover{background-color:transparent}.t-col-container-hover:hover{background-color:#e6ebf7}.t-col-container-hover:first-child{border-left:1px solid #e0e0e0}.t-col-container-hover{border-right:1px solid #e0e0e0}.t-col{height:100%}.t-col,.t-col-text{display:flex;align-items:center}.t-col-text{font-style:normal;font-weight:400;font-size:14px;line-height:20px;letter-spacing:.2px;margin:0}#pagination-container{display:flex;justify-content:flex-end;align-items:center;height:56px}#pagination-text{font-style:normal;font-weight:400;font-size:12px;line-height:18px;letter-spacing:.4px;color:#6a737d;margin:0 96px 0 0}#pages-container{display:flex;margin-right:32px}.page{border:1px solid #6a737d;box-sizing:border-box;border-radius:4px;font-size:14px;line-height:20px;letter-spacing:.2px;color:#6a737d;cursor:pointer}.page,.page-seperator{display:flex;justify-content:center;align-items:center;width:32px;height:32px;margin-right:8px}.dot{height:3px;width:3px;border-radius:50%;background:#6a737d}.page-active{color:#0937b2;border:1px solid #0937b2}"]}]}],"members":{"filtersUpdated":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":32,"character":3}}]}],"filter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":36,"character":3},"arguments":["filter"]}]}],"colHeaders":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChildren","line":37,"character":3},"arguments":["colHeaderRef"]}]}],"pageSelected":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":42,"character":3}}]}],"config":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":44,"character":3},"arguments":["tableConfig"]}]}],"subTableconfig":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":45,"character":3}}]}],"tableDataLoading":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":46,"character":3}}]}],"expandedIndex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":47,"character":3}}]}],"tableData":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":48,"character":3}}]}],"subTableData":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":49,"character":3}}]}],"subTableDataLoading":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":50,"character":3}}]}],"table":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":51,"character":3},"arguments":["table"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":53,"character":32}]}],"selectRow":[{"__symbolic":"method"}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"initializeFilters":[{"__symbolic":"method"}],"toggleFilter":[{"__symbolic":"method"}],"updateAppliedFilters":[{"__symbolic":"method"}],"initializePagination":[{"__symbolic":"method"}],"updateSelectedPage":[{"__symbolic":"method"}],"getContainerHeight":[{"__symbolic":"method"}],"getContainerWidth":[{"__symbolic":"method"}],"getColHeadersRowHeight":[{"__symbolic":"method"}],"getColHeadersRowBorderTop":[{"__symbolic":"method"}],"getColHeadersRowBorderBottom":[{"__symbolic":"method"}]}},"CustomTableCellDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":2,"character":1},"arguments":[{"selector":"[customTableCell]"}]}],"members":{"customComponent":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":10,"character":3}}]}],"data":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":14,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":21,"character":40},{"__symbolic":"reference","module":"@angular/core","name":"ComponentFactoryResolver","line":21,"character":92}]}],"createComponent":[{"__symbolic":"method"}],"setData":[{"__symbolic":"method"}]}},"TableModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":9,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"TableComponent"},{"__symbolic":"reference","name":"ɵa"},{"__symbolic":"reference","name":"TableFilterComponent"},{"__symbolic":"reference","name":"CustomTableCellDirective"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":11,"character":12},{"__symbolic":"reference","module":"mis-crystal-design-system/checkbox","name":"CheckboxModule","line":11,"character":26},{"__symbolic":"reference","module":"@angular/cdk/scrolling","name":"ScrollingModule","line":11,"character":42}],"exports":[{"__symbolic":"reference","name":"TableComponent"},{"__symbolic":"reference","name":"ɵa"},{"__symbolic":"reference","name":"TableFilterComponent"},{"__symbolic":"reference","name":"CustomTableCellDirective"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"TableModule"},"providers":[]}}}},"TableConfig":{"__symbolic":"interface"},"PaginationConfig":{"__symbolic":"interface"},"RowConfig":{"__symbolic":"interface"},"ColHeaderConfig":{"__symbolic":"interface"},"ColConfig":{"__symbolic":"interface"},"SubTableConfig":{"__symbolic":"interface"},"SubTableColConfig":{"__symbolic":"interface"},"SubTableColHeaderConfig":{"__symbolic":"interface"},"SubTableRowConfig":{"__symbolic":"interface"},"TableFilterComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":2,"character":1},"arguments":[{"selector":"mis-table-filter","template":"<div id=\"main-container\" #mainContainer [ngStyle]=\"containerStyles\">\n <div id=\"search-bar-container\">\n <input (keyup)=\"updateSearchValue($event)\" type=\"text\" placeholder=\"Search\" />\n <svg id=\"search-icon\" width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M1.21496 8.14563C1.21496 4.3179 4.33709 1.21165 8.19249 1.21165C12.0479 1.21165 15.17 4.3179 15.17 8.14563C15.17 9.69308 14.6598 11.1226 13.797 12.2767L12.3684 13.7013C11.2043 14.5668 9.75891 15.0796 8.19249 15.0796C4.33709 15.0796 1.21496 11.9734 1.21496 8.14563ZM12.9419 14.7835C11.602 15.7329 9.96259 16.2913 8.19249 16.2913C3.66965 16.2913 -0.00012207 12.6461 -0.00012207 8.14563C-0.00012207 3.64512 3.66965 0 8.19249 0C12.7153 0 16.3851 3.64512 16.3851 8.14563C16.3851 9.93713 15.8036 11.5931 14.8183 12.9375L16.836 14.4048C17.6704 14.912 18.7553 15.6543 17.2453 17.215C15.7352 18.7756 15.0098 17.6663 14.499 16.8364L12.9419 14.7835Z\"\n fill=\"#6A737D\"\n />\n </svg>\n </div>\n <div id=\"filters-main-container\">\n <div class=\"filters-sub-container\">\n <div *ngFor=\"let filter of getCheckedFilters()\">\n <div class=\"filter\">\n <mis-checkbox [checked]=\"true\" [name]=\"filter.value\" (valueChange)=\"updateFilter($event)\"></mis-checkbox>\n <span class=\"filter-text\">{{ filter.name }}</span>\n </div>\n </div>\n </div>\n <div class=\"separator\" style=\"margin: 16px 0px\" *ngIf=\"getCheckedFilters().length && getCheckedFilters().length < filtersData.length\"></div>\n <div class=\"filters-sub-container\">\n <div *ngFor=\"let filter of getFiltersBasedOnSearchValue()\">\n <div class=\"filter\" *ngIf=\"!filter.checked\">\n <mis-checkbox [checked]=\"false\" [name]=\"filter.value\" (valueChange)=\"updateFilter($event)\"></mis-checkbox>\n <span class=\"filter-text\">{{ filter.name }}</span>\n </div>\n </div>\n <div id=\"no-results-container\" *ngIf=\"getFiltersBasedOnSearchValue().length < 1\">\n <span class=\"filter-text\">No matches found</span>\n </div>\n </div>\n <div class=\"separator\" style=\"margin: 16px 0px\"></div>\n <div id=\"buttons-container\">\n <button id=\"reset-btn\" style=\"margin-right: 8px\" (click)=\"resetFilters()\">Reset</button>\n <button id=\"apply-btn\" (click)=\"applyFilters()\">Apply</button>\n </div>\n </div>\n</div>\n","styles":["#main-container{position:absolute;background:#fff;z-index:2;right:calc(50% - 128px);width:256px;padding:16px;font-family:Lato,sans-serif;box-shadow:0 12px 24px rgba(0,0,0,.12),0 4px 8px rgba(0,0,0,.12);border-radius:8px}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-thumb{background:#9aa7b4}#search-bar-container{width:100%;position:relative;margin-bottom:8px}input{width:100%;padding:12px 12px 12px 42px;border:1px solid #000;border-radius:4px;height:48px;box-shadow:none;outline:none;font-style:normal;font-weight:400;font-size:15px;line-height:20px;letter-spacing:.1px;color:#181f33}input:focus{border:1px solid #0937b2}#search-icon{position:absolute;top:15px;left:12px}.filters-sub-container{max-height:144px;overflow-y:auto}.filter{height:36px;display:flex;justify-content:flex-start;align-items:center}.filter-text{font-size:14px;line-height:20px;padding-left:8px;letter-spacing:.2px;color:#181f33;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}#no-results-container{height:36px;display:flex;justify-content:center;align-items:center}.separator{border:1px solid #e0e0e0}#buttons-container{display:flex;justify-content:center;align-items:center}button{width:calc(50% - 4px);border:none;box-shadow:none;outline:none;font-size:16px;line-height:24px;text-align:center;letter-spacing:.2px;padding:10px 30px;background:none;border-radius:8px}#apply-btn{background:#0937b2;color:#fff}#reset-btn{background:#fff;color:#0937b2}"]}]}],"members":{"filtersData":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":8,"character":3}}]}],"containerStyles":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":9,"character":3}}]}],"filtersApplied":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":11,"character":3}}]}],"container":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":13,"character":3},"arguments":["mainContainer"]}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"resetFilters":[{"__symbolic":"method"}],"applyFilters":[{"__symbolic":"method"}],"updateSearchValue":[{"__symbolic":"method"}],"updateFilter":[{"__symbolic":"method"}],"getFiltersBasedOnSearchValue":[{"__symbolic":"method"}],"getCheckedFilters":[{"__symbolic":"method"}]}},"Filter":{"__symbolic":"interface"}},"origins":{"ɵa":"./sub-table/sub-table.component","TableComponent":"./table.component","CustomTableCellDirective":"./custom-table-cell.directive","TableModule":"./table.module","TableConfig":"./table.component","PaginationConfig":"./table.component","RowConfig":"./table.component","ColHeaderConfig":"./table.component","ColConfig":"./table.component","SubTableConfig":"./sub-table/sub-table.component","SubTableColConfig":"./sub-table/sub-table.component","SubTableColHeaderConfig":"./sub-table/sub-table.component","SubTableRowConfig":"./sub-table/sub-table.component","TableFilterComponent":"./filter/filter.component","Filter":"./filter/filter.component"},"importAs":"mis-crystal-design-system/table"}
@@ -2,6 +2,7 @@ import { AfterViewInit, ElementRef, EventEmitter, OnChanges, OnInit, QueryList,
2
2
  import { Filter, TableFilterComponent } from "./filter/filter.component";
3
3
  export declare class TableComponent implements OnInit, AfterViewInit, OnChanges {
4
4
  private renderer;
5
+ activeRowIndex: number;
5
6
  showFilter: boolean;
6
7
  filterName: string;
7
8
  filterData: Array<Filter>;
@@ -32,6 +33,7 @@ export declare class TableComponent implements OnInit, AfterViewInit, OnChanges
32
33
  subTableDataLoading: boolean | any;
33
34
  table: ElementRef | any;
34
35
  constructor(renderer: Renderer2);
36
+ selectRow(index: number): void;
35
37
  ngOnInit(): void;
36
38
  ngAfterViewInit(): void;
37
39
  ngOnChanges(): void;
@@ -70,6 +72,7 @@ export interface PaginationConfig {
70
72
  export interface RowConfig {
71
73
  height?: string | undefined | null;
72
74
  style?: {};
75
+ action?: any;
73
76
  }
74
77
  export interface ColHeaderConfig {
75
78
  type: "text" | "number" | "custom";