mis-crystal-design-system 4.0.6 → 4.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,8 +24,8 @@ export class SwitchComponent {
24
24
  SwitchComponent.decorators = [
25
25
  { type: Component, args: [{
26
26
  selector: "mis-switch",
27
- template: "<label class=\"toggle-switch\" [ngClass]=\"{ 'toggle-switch-mobile': mobileView }\">\n <input type=\"checkbox\" (change)=\"onChange($event)\" [formControl]=\"control\" />\n <span class=\"slider\"></span>\n</label>\n",
28
- styles: [".toggle-switch{height:28px;width:51px;display:inline-block;position:relative;cursor:pointer}.toggle-switch input{display:none}.toggle-switch input:checked+.slider{background-color:#0937b2}.toggle-switch input:checked+.slider:after{transform:translateX(23px)}.toggle-switch .slider{position:absolute;left:0;top:0;right:0;bottom:0;background-color:#e0e0e0;transition:.25s;border-radius:14px}.toggle-switch .slider:after{position:absolute;content:\"\";height:24px;width:24px;background-color:#fff;border-radius:12px;left:2px;bottom:2px;transition:.25s}.toggle-switch-mobile{height:14px;width:34px;display:inline-block;position:relative}.toggle-switch-mobile input{display:none}.toggle-switch-mobile input:checked+.slider{background-color:#e0e0e0}.toggle-switch-mobile input:disabled+.slider{background-color:#f5f5f5!important}.toggle-switch-mobile input:checked+.slider:after{background-color:#0937b2;transform:translateX(34px)}.toggle-switch-mobile input:checked:disabled+.slider:after{background-color:#929dab}.toggle-switch-mobile .slider{position:absolute;left:0;top:0;right:0;bottom:0;background-color:#e0e0e0;transition:.25s;border-radius:14px}.toggle-switch-mobile .slider:after{position:absolute;content:\"\";height:20px;width:20px;background-color:#fff;box-shadow:0 0 6px -2px #929dab;border-radius:12px;top:-3px;left:-10px;transition:.25s}"]
27
+ template: "<label class=\"toggle-switch\" [ngClass]=\"{ 'toggle-switch-mobile': mobileView }\" [ngStyle]=\"{'cursor': control.disabled ? 'not-allowed' : 'pointer'}\">\n <input type=\"checkbox\" (change)=\"onChange($event)\" [formControl]=\"control\" />\n <span class=\"slider\"></span>\n</label>\n",
28
+ styles: [".toggle-switch{height:28px;width:51px;display:inline-block;position:relative}.toggle-switch input{display:none}.toggle-switch input:checked+.slider{background-color:#0937b2}.toggle-switch input:checked+.slider:after{transform:translateX(23px)}.toggle-switch .slider{position:absolute;left:0;top:0;right:0;bottom:0;background-color:#e0e0e0;transition:.25s;border-radius:14px}.toggle-switch .slider:after{position:absolute;content:\"\";height:24px;width:24px;background-color:#fff;border-radius:12px;left:2px;bottom:2px;transition:.25s}.toggle-switch-mobile{height:14px;width:34px;display:inline-block;position:relative}.toggle-switch-mobile input{display:none}.toggle-switch-mobile input:checked+.slider{background-color:#e0e0e0}.toggle-switch-mobile input:disabled+.slider{background-color:#f5f5f5!important}.toggle-switch-mobile input:checked+.slider:after{background-color:#0937b2;transform:translateX(34px)}.toggle-switch-mobile input:checked:disabled+.slider:after{background-color:#929dab}.toggle-switch-mobile .slider{position:absolute;left:0;top:0;right:0;bottom:0;background-color:#e0e0e0;transition:.25s;border-radius:14px}.toggle-switch-mobile .slider:after{position:absolute;content:\"\";height:20px;width:20px;background-color:#fff;box-shadow:0 0 6px -2px #929dab;border-radius:12px;top:-3px;left:-10px;transition:.25s}"]
29
29
  },] }
30
30
  ];
31
31
  SwitchComponent.ctorParameters = () => [];
@@ -36,4 +36,4 @@ SwitchComponent.propDecorators = {
36
36
  control: [{ type: Input }],
37
37
  valueChanged: [{ type: Output }]
38
38
  };
39
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3dpdGNoLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL21pcy1jb21wb25lbnRzL3N3aXRjaC9zd2l0Y2guY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFVLE1BQU0sRUFBRS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ZWQgKi9cbiAgQE91dHB1dCgpIHZhbHVlQ2hhbmdlZCA9IG5ldyBFdmVudEVtaXR0ZXI8Ym9vbGVhbj4oKTtcblxuICBjb25zdHJ1Y3RvcigpIHt9XG4gIG5nT25Jbml0KCkge31cbiAgb25DaGFuZ2UoZXZlbnQpIHtcbiAgICB0aGlzLnZhbHVlQ2hhbmdlZC5lbWl0KHRoaXMuY29udHJvbC52YWx1ZSk7XG4gIH1cbn1cbiJdfQ==
@@ -180,7 +180,7 @@ class DynamicFormComponent {
180
180
  else if (formField.fieldType === "singleSelect") {
181
181
  const findSelectedValue = () => {
182
182
  let index = formField.itemsList.findIndex(item => item.value === formValue);
183
- return index > 0 ? formField.itemsList[index] : "";
183
+ return index >= 0 ? formField.itemsList[index] : "";
184
184
  };
185
185
  if (formField.fieldInputType === "dropdown") {
186
186
  if (!formValue)
@@ -240,7 +240,7 @@ class DynamicFormComponent {
240
240
  DynamicFormComponent.decorators = [
241
241
  { type: Component, args: [{
242
242
  selector: "mis-dynamic-form",
243
- template: "<form [formGroup]=\"dynamicForm\">\n <ng-container formArrayName=\"dynamicFields\">\n <ng-container [formGroupName]=\"i\" *ngFor=\"let fieldControl of getDynamicFieldsControls().controls; let i = index\">\n <ng-container\n [ngTemplateOutlet]=\"dynamicField\"\n [ngTemplateOutletContext]=\"{\n $implicit: formFields[i],\n formGroup: fieldControl,\n control: fieldControl.controls.value\n }\"\n >\n <div class=\"sub-dynamic-form\" *ngIf=\"fieldControl.value && formFields[i]?.subFields?.length > 0\">\n <ng-container *ngFor=\"let subFieldControl of fieldControl.controls.subFields.controls; let j = index\">\n <ng-container\n [ngTemplateOutlet]=\"dynamicField\"\n [ngTemplateOutletContext]=\"{\n $implicit: formFields[i].subFields[j],\n control: subFieldControl\n }\">\n </ng-container>\n </ng-container>\n </div>\n </ng-container>\n </ng-container>\n </ng-container>\n</form>\n\n\n<ng-template #dynamicField let-field let-control=\"control\" let-formgroup=\"formGroup\">\n\n <!-- fieldType: 'input' fieldInputType: 'text' | 'number' -->\n <div class=\"dynamic-field multi-line-field-container\"\n *ngIf=\"field.fieldType === 'input' && (field.fieldInputType === 'text' || field.fieldInputType === 'number')\">\n <p class=\"h7 field-title-sm\">\n {{ field.title }}\n </p>\n <div style=\"flex-basis: 100%\"></div>\n <input class=\"input-field ip-text\" [type]=\"field.fieldInputType\" [formControl]=\"control\"\n (ngModelChange)=\"updateSubDynamicFields(field, formgroup, $event)\"\n [ngStyle]=\"{'border': control.touched && control.errors ? '1px solid #B00020': ''}\"\n [placeholder]=\"field.placeholderText ? field.placeholderText : 'Input Text'\" />\n <ng-container *ngIf=\"control.touched && control.errors\"\n [ngTemplateOutlet]=\"dynamicFieldErrors\" \n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\"\n >\n </ng-container>\n </div>\n\n <!-- fieldType: 'input' fieldInputType: 'textarea' -->\n <div class=\"dynamic-field multi-line-field-container\"\n *ngIf=\"field.fieldType === 'input' && field.fieldInputType === 'textarea'\">\n <p class=\"h7 field-title-sm\">\n {{ field.title }}\n </p>\n <div style=\"flex-basis: 100%\"></div>\n <textarea class=\"input-field ip-textarea\" type=\"text\"\n [ngStyle]=\"{'border': control.touched && control.errors ? '1px solid #B00020': ''}\"\n [placeholder]=\"field.placeholderText ? field.placeholderText : 'Input Text'\" [formControl]=\"control\" (ngModelChange)=\"updateSubDynamicFields(field, formgroup, $event)\"></textarea>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n\n <!-- fieldType: 'input' fieldInputType: 'date' -->\n <div class=\"dynamic-field single-line-field-container\"\n *ngIf=\"field.fieldType === 'input' && field.fieldInputType === 'date'\">\n <p class=\"h6\">\n {{ field.title }}\n </p>\n <div class=\"date-picker-container\">\n <input class=\"date-picker\" readonly misTzDp [dpConfig]=\"field.fieldConfig\"\n (dateChange)=\"control.setValue($event)\" [selectedDate]=\"control.value\" [offsetY]=\"0\"\n [value]=\"control.value\" #dp />\n <img alt=\"data-picker\" *ngIf=\"calendarIconUrl\" class=\"date-picker-icon\" [src]=\"calendarIconUrl\"\n (click)=\"dp.click()\" />\n </div>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n\n <!-- fieldType: 'boolean' fieldInputType: 'toggle' -->\n <div class=\"dynamic-field single-line-field-container\"\n *ngIf=\"field.fieldType === 'boolean' && field.fieldInputType === 'toggle'\">\n <p class=\"h6\">\n {{ field.title }}\n </p>\n <mis-switch [control]=\"control\" (valueChanged)=\"updateSubDynamicFields(field, formgroup, $event)\"></mis-switch>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n\n <!-- fieldType: 'singleSelect' fieldInputType: 'dropdown' -->\n <div class=\"dynamic-field single-line-field-container\"\n *ngIf=\"field.fieldType === 'singleSelect' && field.fieldInputType === 'dropdown'\">\n <p class=\"h6\">\n {{ field.title }}\n </p>\n <mis-dropdown [searchEnabled]=\"false\" [width]=\"'140px'\" [data]=\"field.itemsList\" [selectedItem]=\"control.value\"\n (onChange)=\"updateSelectedValueForSingleSelect(field, control, formgroup, $event);\">\n </mis-dropdown>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n\n <!-- fieldType: 'singleSelect' fieldInputType: 'radio' -->\n <div class=\"dynamic-field multi-line-field-container\"\n *ngIf=\"field.fieldType === 'singleSelect' && field.fieldInputType === 'radio'\">\n <p class=\"h7 field-title-sm\">\n {{ field.title }}\n </p>\n <div style=\"flex-basis: 100%\"></div>\n <div id=\"checkboxes-container\">\n <div class=\"radio-checkbox-common\" *ngFor=\"let item of field.itemsList\"\n [ngClass]=\"{ 'checkbox-active': item.label === control.value?.label }\"\n (click)=\"updateSelectedValueForSingleSelect(field, control, formgroup, item);\">\n <img *ngIf=\"(item.label === control.value?.label) && activeBtnIconUrl\" [src]=\"activeBtnIconUrl\" alt=\"\" />\n <p class=\"h6\">{{ item.label }}</p>\n </div>\n </div>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n\n <!-- fieldType: 'multiSelect' fieldInputType: 'checkbox' -->\n <div class=\"dynamic-field multi-line-field-container\"\n *ngIf=\"field.fieldType === 'multiSelect' && field.fieldInputType === 'checkbox'\">\n <p class=\"h7 field-title-sm\">\n {{ field.title }}\n </p>\n <div style=\"flex-basis: 100%\"></div>\n <div id=\"checkboxes-container\">\n <div class=\"radio-checkbox-common\" *ngFor=\"let item of field.itemsList\"\n [ngClass]=\"{ 'checkbox-active': isCheckBoxSelected(item.label, control.value) }\"\n (click)=\"updateSelectedValueForMultiSelect(field, control, formgroup, [item])\">\n <img *ngIf=\"isCheckBoxSelected(item.label, control.value) && activeBtnIconUrl\" [src]=\"activeBtnIconUrl\"\n alt=\"\" />\n <p class=\"h6\">{{ item.label }}</p>\n </div>\n </div>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n\n <!-- fieldType: 'multiSelect' fieldInputType: 'dropdown' -->\n <div class=\"dynamic-field single-line-field-container\"\n *ngIf=\"field.fieldType === 'multiSelect' && field.fieldInputType === 'dropdown'\">\n <p class=\"h6\">\n {{ field.title }}\n </p>\n <mis-multi-select-dropdown [width]=\"'140px'\" [showSelectedCount]=\"true\" [dropdownListWidth]=\"'256px'\"\n [searchEnabled]=\"false\" [hideApplyButton]=\"true\" [data]=\"field.itemsList\"\n [selectedItems]=\"control.value\" (onChange)=\"updateSelectedValueForMultiSelect(field, control, formgroup, $event);\"></mis-multi-select-dropdown>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n\n</ng-template>\n\n<ng-template #dynamicFieldErrors let-errors>\n <div id=\"error-messages-container\">\n <ng-container *ngFor=\"let error of errors | keyvalue\">\n <p class=\"h8\">\n {{\" \u2022 &nbsp;\" + error.value}}\n </p>\n <div style=\"flex-basis: 100%; height: 0\"></div>\n </ng-container>\n </div>\n</ng-template>",
243
+ template: "<form [formGroup]=\"dynamicForm\">\n <ng-container formArrayName=\"dynamicFields\">\n <ng-container [formGroupName]=\"i\" *ngFor=\"let fieldControl of getDynamicFieldsControls().controls; let i = index\">\n <ng-container\n [ngTemplateOutlet]=\"dynamicField\"\n [ngTemplateOutletContext]=\"{\n $implicit: formFields[i],\n formGroup: fieldControl,\n control: fieldControl.controls.value\n }\"\n >\n <div class=\"sub-dynamic-form\" *ngIf=\"fieldControl.value && formFields[i]?.subFields?.length > 0\">\n <ng-container *ngFor=\"let subFieldControl of fieldControl.controls.subFields.controls; let j = index\">\n <ng-container\n [ngTemplateOutlet]=\"dynamicField\"\n [ngTemplateOutletContext]=\"{\n $implicit: formFields[i].subFields[j],\n control: subFieldControl\n }\">\n </ng-container>\n </ng-container>\n </div>\n </ng-container>\n </ng-container>\n </ng-container>\n</form>\n\n\n<ng-template #dynamicField let-field let-control=\"control\" let-formgroup=\"formGroup\">\n\n <!-- fieldType: 'input' fieldInputType: 'text' | 'number' -->\n <div class=\"dynamic-field multi-line-field-container\"\n *ngIf=\"field.fieldType === 'input' && (field.fieldInputType === 'text' || field.fieldInputType === 'number')\">\n <p class=\"h7 field-title-sm\">\n {{ field.title }}\n </p>\n <div style=\"flex-basis: 100%\"></div>\n <input class=\"input-field ip-text\" [type]=\"field.fieldInputType\" [formControl]=\"control\"\n (ngModelChange)=\"updateSubDynamicFields(field, formgroup, $event)\" \n [ngStyle]=\"{'border': control.touched && control.errors ? '1px solid #B00020': ''}\"\n [placeholder]=\"field.placeholderText ? field.placeholderText : 'Input Text'\" \n [min]=\"field.fieldInputType === 'number' ? 0 : '' \"/>\n <ng-container *ngIf=\"control.touched && control.errors\"\n [ngTemplateOutlet]=\"dynamicFieldErrors\" \n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\"\n >\n </ng-container>\n </div>\n\n <!-- fieldType: 'input' fieldInputType: 'textarea' -->\n <div class=\"dynamic-field multi-line-field-container\"\n *ngIf=\"field.fieldType === 'input' && field.fieldInputType === 'textarea'\">\n <p class=\"h7 field-title-sm\">\n {{ field.title }}\n </p>\n <div style=\"flex-basis: 100%\"></div>\n <textarea class=\"input-field ip-textarea\" type=\"text\"\n [ngStyle]=\"{'border': control.touched && control.errors ? '1px solid #B00020': ''}\"\n [placeholder]=\"field.placeholderText ? field.placeholderText : 'Input Text'\" [formControl]=\"control\" (ngModelChange)=\"updateSubDynamicFields(field, formgroup, $event)\"></textarea>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n\n <!-- fieldType: 'input' fieldInputType: 'date' -->\n <div class=\"dynamic-field single-line-field-container\"\n *ngIf=\"field.fieldType === 'input' && field.fieldInputType === 'date'\">\n <p class=\"h6\">\n {{ field.title }}\n </p>\n <div class=\"date-picker-container\">\n <input class=\"date-picker\" readonly misTzDp [dpConfig]=\"field.fieldConfig\"\n (dateChange)=\"control.setValue($event)\" [selectedDate]=\"control.value\" [offsetY]=\"0\"\n [value]=\"control.value\" #dp />\n <img alt=\"data-picker\" *ngIf=\"calendarIconUrl\" class=\"date-picker-icon\" [src]=\"calendarIconUrl\"\n (click)=\"dp.click()\" />\n </div>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n\n <!-- fieldType: 'boolean' fieldInputType: 'toggle' -->\n <div class=\"dynamic-field single-line-field-container\"\n *ngIf=\"field.fieldType === 'boolean' && field.fieldInputType === 'toggle'\">\n <p class=\"h6\">\n {{ field.title }}\n </p>\n <mis-switch [control]=\"control\" (valueChanged)=\"updateSubDynamicFields(field, formgroup, $event)\"></mis-switch>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n\n <!-- fieldType: 'singleSelect' fieldInputType: 'dropdown' -->\n <div class=\"dynamic-field single-line-field-container\"\n *ngIf=\"field.fieldType === 'singleSelect' && field.fieldInputType === 'dropdown'\">\n <p class=\"h6\">\n {{ field.title }}\n </p>\n <mis-dropdown [searchEnabled]=\"false\" [width]=\"'140px'\" [data]=\"field.itemsList\" [selectedItem]=\"control.value\"\n (onChange)=\"updateSelectedValueForSingleSelect(field, control, formgroup, $event);\">\n </mis-dropdown>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n\n <!-- fieldType: 'singleSelect' fieldInputType: 'radio' -->\n <div class=\"dynamic-field multi-line-field-container\"\n *ngIf=\"field.fieldType === 'singleSelect' && field.fieldInputType === 'radio'\">\n <p class=\"h7 field-title-sm\">\n {{ field.title }}\n </p>\n <div style=\"flex-basis: 100%\"></div>\n <div id=\"checkboxes-container\">\n <div class=\"radio-checkbox-common\" *ngFor=\"let item of field.itemsList\"\n [ngClass]=\"{ 'checkbox-active': item.label === control.value?.label }\"\n (click)=\"updateSelectedValueForSingleSelect(field, control, formgroup, item);\">\n <img *ngIf=\"(item.label === control.value?.label) && activeBtnIconUrl\" [src]=\"activeBtnIconUrl\" alt=\"\" />\n <p class=\"h6\">{{ item.label }}</p>\n </div>\n </div>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n\n <!-- fieldType: 'multiSelect' fieldInputType: 'checkbox' -->\n <div class=\"dynamic-field multi-line-field-container\"\n *ngIf=\"field.fieldType === 'multiSelect' && field.fieldInputType === 'checkbox'\">\n <p class=\"h7 field-title-sm\">\n {{ field.title }}\n </p>\n <div style=\"flex-basis: 100%\"></div>\n <div id=\"checkboxes-container\">\n <div class=\"radio-checkbox-common\" *ngFor=\"let item of field.itemsList\"\n [ngClass]=\"{ 'checkbox-active': isCheckBoxSelected(item.label, control.value) }\"\n (click)=\"updateSelectedValueForMultiSelect(field, control, formgroup, [item])\">\n <img *ngIf=\"isCheckBoxSelected(item.label, control.value) && activeBtnIconUrl\" [src]=\"activeBtnIconUrl\"\n alt=\"\" />\n <p class=\"h6\">{{ item.label }}</p>\n </div>\n </div>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n\n <!-- fieldType: 'multiSelect' fieldInputType: 'dropdown' -->\n <div class=\"dynamic-field single-line-field-container\"\n *ngIf=\"field.fieldType === 'multiSelect' && field.fieldInputType === 'dropdown'\">\n <p class=\"h6\">\n {{ field.title }}\n </p>\n <mis-multi-select-dropdown [width]=\"'140px'\" [showSelectedCount]=\"true\" [dropdownListWidth]=\"'256px'\"\n [searchEnabled]=\"false\" [hideApplyButton]=\"true\" [data]=\"field.itemsList\"\n [selectedItems]=\"control.value\" (onChange)=\"updateSelectedValueForMultiSelect(field, control, formgroup, $event);\"></mis-multi-select-dropdown>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n\n</ng-template>\n\n<ng-template #dynamicFieldErrors let-errors>\n <div id=\"error-messages-container\">\n <ng-container *ngFor=\"let error of errors | keyvalue\">\n <p class=\"h8\">\n {{\" \u2022 &nbsp;\" + error.value}}\n </p>\n <div style=\"flex-basis: 100%; height: 0\"></div>\n </ng-container>\n </div>\n</ng-template>",
244
244
  styles: ["p{margin:0;cursor:default}::ng-deep .main-container{margin:0;max-width:100%}.sub-dynamic-form{padding-left:24px}.dynamic-field ::ng-deep .container{height:32px!important}.single-line-field-container{justify-content:space-between;align-items:center}.multi-line-field-container,.single-line-field-container{display:flex;padding:28px 16px;border-bottom:1px solid var(--grey-seperators)}.multi-line-field-container{justify-content:flex-start;align-items:flex-start;flex-wrap:wrap}.field-title-sm{margin-bottom:8px;cursor:default}.input-field{width:100%;background-color:var(--grey-bg-1);border:1px solid var(--grey-seperators);border-radius:6px}.ip-text{height:44px;padding:8px 12px}.ip-textarea{max-height:94px;padding:8px}input:focus{outline:none}input::-moz-placeholder{color:var(--grey-seperators)}input:-ms-input-placeholder{color:var(--grey-seperators)}input::placeholder{color:var(--grey-seperators)}textarea:focus{outline:none}.date-picker-container{position:relative;width:140px}.date-picker-container .date-picker{cursor:pointer;height:32px;width:100%;font-size:14px;border-radius:6px;padding:0 12px;border:1px solid var(--grey-seperators);inset:10px auto auto 80px;background-color:var(--text-white)}.date-picker-container .date-picker:hover{background-color:var(--grey-hover)}.date-picker-container .date-picker-icon{position:absolute;top:50%;right:12px;transform:translateY(-50%);cursor:pointer}form .dynamic-field:last-child{border-bottom:none!important}#checkboxes-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.radio-checkbox-common{display:flex;justify-content:center;align-items:center;cursor:pointer;margin-right:8px;margin-bottom:8px;background-color:var(--text-white);padding:12px 16px;border:1px solid var(--text-muted);border-radius:8px}.radio-checkbox-common p{color:var(--text-muted);cursor:pointer}.radio-checkbox-common img{margin-right:8px}.checkbox-active{background-color:var(--pmry-500)}.checkbox-active p{color:var(--text-white)}#error-messages-container{margin-top:4px;width:100%;display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}#error-messages-container p{color:var(--sem-error)}"]
245
245
  },] }
246
246
  ];
@@ -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 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;;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,cA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AK,EAAE,OAAO,EAAC,CAAA;oBAClC,MAAM;gBACR,KAAK,QAAQ;oBACX,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,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;;MCvQY,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,g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E;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;;;;;;"}
@@ -26,8 +26,8 @@ class SwitchComponent {
26
26
  SwitchComponent.decorators = [
27
27
  { type: Component, args: [{
28
28
  selector: "mis-switch",
29
- template: "<label class=\"toggle-switch\" [ngClass]=\"{ 'toggle-switch-mobile': mobileView }\">\n <input type=\"checkbox\" (change)=\"onChange($event)\" [formControl]=\"control\" />\n <span class=\"slider\"></span>\n</label>\n",
30
- styles: [".toggle-switch{height:28px;width:51px;display:inline-block;position:relative;cursor:pointer}.toggle-switch input{display:none}.toggle-switch input:checked+.slider{background-color:#0937b2}.toggle-switch input:checked+.slider:after{transform:translateX(23px)}.toggle-switch .slider{position:absolute;left:0;top:0;right:0;bottom:0;background-color:#e0e0e0;transition:.25s;border-radius:14px}.toggle-switch .slider:after{position:absolute;content:\"\";height:24px;width:24px;background-color:#fff;border-radius:12px;left:2px;bottom:2px;transition:.25s}.toggle-switch-mobile{height:14px;width:34px;display:inline-block;position:relative}.toggle-switch-mobile input{display:none}.toggle-switch-mobile input:checked+.slider{background-color:#e0e0e0}.toggle-switch-mobile input:disabled+.slider{background-color:#f5f5f5!important}.toggle-switch-mobile input:checked+.slider:after{background-color:#0937b2;transform:translateX(34px)}.toggle-switch-mobile input:checked:disabled+.slider:after{background-color:#929dab}.toggle-switch-mobile .slider{position:absolute;left:0;top:0;right:0;bottom:0;background-color:#e0e0e0;transition:.25s;border-radius:14px}.toggle-switch-mobile .slider:after{position:absolute;content:\"\";height:20px;width:20px;background-color:#fff;box-shadow:0 0 6px -2px #929dab;border-radius:12px;top:-3px;left:-10px;transition:.25s}"]
29
+ template: "<label class=\"toggle-switch\" [ngClass]=\"{ 'toggle-switch-mobile': mobileView }\" [ngStyle]=\"{'cursor': control.disabled ? 'not-allowed' : 'pointer'}\">\n <input type=\"checkbox\" (change)=\"onChange($event)\" [formControl]=\"control\" />\n <span class=\"slider\"></span>\n</label>\n",
30
+ styles: [".toggle-switch{height:28px;width:51px;display:inline-block;position:relative}.toggle-switch input{display:none}.toggle-switch input:checked+.slider{background-color:#0937b2}.toggle-switch input:checked+.slider:after{transform:translateX(23px)}.toggle-switch .slider{position:absolute;left:0;top:0;right:0;bottom:0;background-color:#e0e0e0;transition:.25s;border-radius:14px}.toggle-switch .slider:after{position:absolute;content:\"\";height:24px;width:24px;background-color:#fff;border-radius:12px;left:2px;bottom:2px;transition:.25s}.toggle-switch-mobile{height:14px;width:34px;display:inline-block;position:relative}.toggle-switch-mobile input{display:none}.toggle-switch-mobile input:checked+.slider{background-color:#e0e0e0}.toggle-switch-mobile input:disabled+.slider{background-color:#f5f5f5!important}.toggle-switch-mobile input:checked+.slider:after{background-color:#0937b2;transform:translateX(34px)}.toggle-switch-mobile input:checked:disabled+.slider:after{background-color:#929dab}.toggle-switch-mobile .slider{position:absolute;left:0;top:0;right:0;bottom:0;background-color:#e0e0e0;transition:.25s;border-radius:14px}.toggle-switch-mobile .slider:after{position:absolute;content:\"\";height:20px;width:20px;background-color:#fff;box-shadow:0 0 6px -2px #929dab;border-radius:12px;top:-3px;left:-10px;transition:.25s}"]
31
31
  },] }
32
32
  ];
33
33
  SwitchComponent.ctorParameters = () => [];
@@ -1 +1 @@
1
- {"version":3,"file":"mis-crystal-design-system-switch.js","sources":["../../../projects/mis-components/switch/switch.component.ts","../../../projects/mis-components/switch/switch.module.ts","../../../projects/mis-components/switch/mis-crystal-design-system-switch.ts"],"sourcesContent":["import { Component, Input, OnInit, Output, EventEmitter } from \"@angular/core\";\nimport { AbstractControl, FormControl } from \"@angular/forms\";\n\n@Component({\n selector: \"mis-switch\",\n templateUrl: \"./switch.component.html\",\n styleUrls: [\"./switch.component.scss\"]\n})\nexport class SwitchComponent implements OnInit {\n @Input() mobileView: boolean = false;\n @Input() set checked(value: boolean) {\n this.control.setValue(value);\n }\n @Input() set disabled(value: boolean) {\n if (value) this.control.disable();\n else this.control.enable();\n }\n @Input() control: AbstractControl = new FormControl(false);\n\n /** Emits value when toggled */\n @Output() valueChanged = new EventEmitter<boolean>();\n\n constructor() {}\n ngOnInit() {}\n onChange(event) {\n this.valueChanged.emit(this.control.value);\n }\n}\n","import { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\n\nimport { SwitchComponent } from \"./switch.component\";\nimport { ReactiveFormsModule } from \"@angular/forms\";\n\n@NgModule({\n declarations: [SwitchComponent],\n imports: [CommonModule, ReactiveFormsModule],\n exports: [SwitchComponent]\n})\nexport class SwitchModule {\n static forRoot(): ModuleWithProviders<SwitchModule> {\n return { ngModule: SwitchModule, providers: [] };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAQa,eAAe;IAc1B;QAbS,eAAU,GAAY,KAAK,CAAC;QAQ5B,YAAO,GAAoB,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC;;QAGjD,iBAAY,GAAG,IAAI,YAAY,EAAW,CAAC;KAErC;IAZhB,IAAa,OAAO,CAAC,KAAc;QACjC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;KAC9B;IACD,IAAa,QAAQ,CAAC,KAAc;QAClC,IAAI,KAAK;YAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;;YAC7B,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;KAC5B;IAOD,QAAQ,MAAK;IACb,QAAQ,CAAC,KAAK;QACZ,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;KAC5C;;;YAvBF,SAAS,SAAC;gBACT,QAAQ,EAAE,YAAY;gBACtB,qOAAsC;;aAEvC;;;;yBAEE,KAAK;sBACL,KAAK;uBAGL,KAAK;sBAIL,KAAK;2BAGL,MAAM;;;MCTI,YAAY;IACvB,OAAO,OAAO;QACZ,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;KAClD;;;YARF,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,eAAe,CAAC;gBAC/B,OAAO,EAAE,CAAC,YAAY,EAAE,mBAAmB,CAAC;gBAC5C,OAAO,EAAE,CAAC,eAAe,CAAC;aAC3B;;;ACVD;;;;;;"}
1
+ {"version":3,"file":"mis-crystal-design-system-switch.js","sources":["../../../projects/mis-components/switch/switch.component.ts","../../../projects/mis-components/switch/switch.module.ts","../../../projects/mis-components/switch/mis-crystal-design-system-switch.ts"],"sourcesContent":["import { Component, Input, OnInit, Output, EventEmitter } from \"@angular/core\";\nimport { AbstractControl, FormControl } from \"@angular/forms\";\n\n@Component({\n selector: \"mis-switch\",\n templateUrl: \"./switch.component.html\",\n styleUrls: [\"./switch.component.scss\"]\n})\nexport class SwitchComponent implements OnInit {\n @Input() mobileView: boolean = false;\n @Input() set checked(value: boolean) {\n this.control.setValue(value);\n }\n @Input() set disabled(value: boolean) {\n if (value) this.control.disable();\n else this.control.enable();\n }\n @Input() control: AbstractControl = new FormControl(false);\n\n /** Emits value when toggled */\n @Output() valueChanged = new EventEmitter<boolean>();\n\n constructor() {}\n ngOnInit() {}\n onChange(event) {\n this.valueChanged.emit(this.control.value);\n }\n}\n","import { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\n\nimport { SwitchComponent } from \"./switch.component\";\nimport { ReactiveFormsModule } from \"@angular/forms\";\n\n@NgModule({\n declarations: [SwitchComponent],\n imports: [CommonModule, ReactiveFormsModule],\n exports: [SwitchComponent]\n})\nexport class SwitchModule {\n static forRoot(): ModuleWithProviders<SwitchModule> {\n return { ngModule: SwitchModule, providers: [] };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAQa,eAAe;IAc1B;QAbS,eAAU,GAAY,KAAK,CAAC;QAQ5B,YAAO,GAAoB,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC;;QAGjD,iBAAY,GAAG,IAAI,YAAY,EAAW,CAAC;KAErC;IAZhB,IAAa,OAAO,CAAC,KAAc;QACjC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;KAC9B;IACD,IAAa,QAAQ,CAAC,KAAc;QAClC,IAAI,KAAK;YAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;;YAC7B,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;KAC5B;IAOD,QAAQ,MAAK;IACb,QAAQ,CAAC,KAAK;QACZ,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;KAC5C;;;YAvBF,SAAS,SAAC;gBACT,QAAQ,EAAE,YAAY;gBACtB,4SAAsC;;aAEvC;;;;yBAEE,KAAK;sBACL,KAAK;uBAGL,KAAK;sBAIL,KAAK;2BAGL,MAAM;;;MCTI,YAAY;IACvB,OAAO,OAAO;QACZ,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;KAClD;;;YARF,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,eAAe,CAAC;gBAC/B,OAAO,EAAE,CAAC,YAAY,EAAE,mBAAmB,CAAC;gBAC5C,OAAO,EAAE,CAAC,eAAe,CAAC;aAC3B;;;ACVD;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mis-crystal-design-system",
3
- "version": "4.0.6",
3
+ "version": "4.0.8",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "*",
6
6
  "@angular/core": "*",
@@ -1 +1 @@
1
- {"__symbolic":"module","version":4,"metadata":{"SwitchComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":3,"character":1},"arguments":[{"selector":"mis-switch","template":"<label class=\"toggle-switch\" [ngClass]=\"{ 'toggle-switch-mobile': mobileView }\">\n <input type=\"checkbox\" (change)=\"onChange($event)\" [formControl]=\"control\" />\n <span class=\"slider\"></span>\n</label>\n","styles":[".toggle-switch{height:28px;width:51px;display:inline-block;position:relative;cursor:pointer}.toggle-switch input{display:none}.toggle-switch input:checked+.slider{background-color:#0937b2}.toggle-switch input:checked+.slider:after{transform:translateX(23px)}.toggle-switch .slider{position:absolute;left:0;top:0;right:0;bottom:0;background-color:#e0e0e0;transition:.25s;border-radius:14px}.toggle-switch .slider:after{position:absolute;content:\"\";height:24px;width:24px;background-color:#fff;border-radius:12px;left:2px;bottom:2px;transition:.25s}.toggle-switch-mobile{height:14px;width:34px;display:inline-block;position:relative}.toggle-switch-mobile input{display:none}.toggle-switch-mobile input:checked+.slider{background-color:#e0e0e0}.toggle-switch-mobile input:disabled+.slider{background-color:#f5f5f5!important}.toggle-switch-mobile input:checked+.slider:after{background-color:#0937b2;transform:translateX(34px)}.toggle-switch-mobile input:checked:disabled+.slider:after{background-color:#929dab}.toggle-switch-mobile .slider{position:absolute;left:0;top:0;right:0;bottom:0;background-color:#e0e0e0;transition:.25s;border-radius:14px}.toggle-switch-mobile .slider:after{position:absolute;content:\"\";height:20px;width:20px;background-color:#fff;box-shadow:0 0 6px -2px #929dab;border-radius:12px;top:-3px;left:-10px;transition:.25s}"]}]}],"members":{"mobileView":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":9,"character":3}}]}],"checked":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":10,"character":3}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}}]}],"control":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":17,"character":3}}]}],"valueChanged":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":20,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"onChange":[{"__symbolic":"method"}]}},"SwitchModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":6,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"SwitchComponent"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":8,"character":12},{"__symbolic":"reference","module":"@angular/forms","name":"ReactiveFormsModule","line":8,"character":26}],"exports":[{"__symbolic":"reference","name":"SwitchComponent"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"SwitchModule"},"providers":[]}}}}},"origins":{"SwitchComponent":"./switch.component","SwitchModule":"./switch.module"},"importAs":"mis-crystal-design-system/switch"}
1
+ {"__symbolic":"module","version":4,"metadata":{"SwitchComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":3,"character":1},"arguments":[{"selector":"mis-switch","template":"<label class=\"toggle-switch\" [ngClass]=\"{ 'toggle-switch-mobile': mobileView }\" [ngStyle]=\"{'cursor': control.disabled ? 'not-allowed' : 'pointer'}\">\n <input type=\"checkbox\" (change)=\"onChange($event)\" [formControl]=\"control\" />\n <span class=\"slider\"></span>\n</label>\n","styles":[".toggle-switch{height:28px;width:51px;display:inline-block;position:relative}.toggle-switch input{display:none}.toggle-switch input:checked+.slider{background-color:#0937b2}.toggle-switch input:checked+.slider:after{transform:translateX(23px)}.toggle-switch .slider{position:absolute;left:0;top:0;right:0;bottom:0;background-color:#e0e0e0;transition:.25s;border-radius:14px}.toggle-switch .slider:after{position:absolute;content:\"\";height:24px;width:24px;background-color:#fff;border-radius:12px;left:2px;bottom:2px;transition:.25s}.toggle-switch-mobile{height:14px;width:34px;display:inline-block;position:relative}.toggle-switch-mobile input{display:none}.toggle-switch-mobile input:checked+.slider{background-color:#e0e0e0}.toggle-switch-mobile input:disabled+.slider{background-color:#f5f5f5!important}.toggle-switch-mobile input:checked+.slider:after{background-color:#0937b2;transform:translateX(34px)}.toggle-switch-mobile input:checked:disabled+.slider:after{background-color:#929dab}.toggle-switch-mobile .slider{position:absolute;left:0;top:0;right:0;bottom:0;background-color:#e0e0e0;transition:.25s;border-radius:14px}.toggle-switch-mobile .slider:after{position:absolute;content:\"\";height:20px;width:20px;background-color:#fff;box-shadow:0 0 6px -2px #929dab;border-radius:12px;top:-3px;left:-10px;transition:.25s}"]}]}],"members":{"mobileView":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":9,"character":3}}]}],"checked":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":10,"character":3}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}}]}],"control":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":17,"character":3}}]}],"valueChanged":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":20,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"onChange":[{"__symbolic":"method"}]}},"SwitchModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":6,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"SwitchComponent"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":8,"character":12},{"__symbolic":"reference","module":"@angular/forms","name":"ReactiveFormsModule","line":8,"character":26}],"exports":[{"__symbolic":"reference","name":"SwitchComponent"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"SwitchModule"},"providers":[]}}}}},"origins":{"SwitchComponent":"./switch.component","SwitchModule":"./switch.module"},"importAs":"mis-crystal-design-system/switch"}