@onemrvapublic/design-system-demos 20.7.0-develop.13 → 20.7.0-develop.15

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
- {"demo-text-input.component.html":"<mat-form-field [color]=\"color\" [readonly]=\"readonly\">\n <mat-label>Error demo</mat-label>\n <input matInput [formControl]=\"form\" [disabled]=\"disabled\" />\n\n <!-- You can format an error like a warning - you cannot submit the form like this with errors -->\n @if (form.errors && form.errors['required']) {\n <mat-error>\n This is a long error message displayed on multiple lines. The icon is\n generated automatically by the type of error.\n </mat-error>\n }\n\n <!-- The warn hint is used to show an error styled warning -->\n @if (showWarnHint) {\n <mat-hint [color]=\"'warn'\"> Max duration is 7 days </mat-hint>\n } @else {\n <mat-hint>Hint</mat-hint>\n }\n</mat-form-field>\n","demo-text-input.component.scss":"app-demo-text-input mat-form-field {\n max-width: 200px;\n}\n","demo-text-input.component.ts":"import { Component, effect, Input, ViewEncapsulation } from '@angular/core';\nimport {\n FormsModule,\n ReactiveFormsModule,\n UntypedFormControl,\n Validators,\n} from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInput } from '@angular/material/input';\nimport { DemoComponentBase } from '../../_demo/demo-component-base';\nimport {\n OnemRvaColorDirective,\n OnemRvaReadonlyDirective,\n} from '@onemrvapublic/design-system';\n\n@Component({\n selector: 'app-demo-text-input',\n templateUrl: './demo-text-input.component.html',\n styleUrl: './demo-text-input.component.scss',\n standalone: true,\n imports: [\n FormsModule,\n CommonModule,\n MatInput,\n ReactiveFormsModule,\n MatFormFieldModule,\n OnemRvaReadonlyDirective,\n OnemRvaColorDirective,\n ],\n encapsulation: ViewEncapsulation.None,\n})\nexport class DemoTextInputComponent extends DemoComponentBase {\n form = new UntypedFormControl('text', [Validators.required]);\n\n @Input()\n color: 'primary' | 'warn' = 'primary';\n\n @Input()\n disabled = false;\n\n @Input()\n readonly = false;\n\n @Input()\n showWarnHint = false;\n\n constructor() {\n super();\n effect(() => {\n if (this.disabled) this.form.disable();\n else this.form.enable();\n });\n }\n}\n"}
1
+ {"demo-text-input.component.html":"<mat-form-field\n [color]=\"color()\"\n [readonly]=\"readonly()\"\n [class]=\"showWarnHint() ? 'force-warn' : ''\"\n>\n <mat-label>Error demo</mat-label>\n <input matInput [formControl]=\"form\" />\n\n <!-- You can format an error like a warning - you cannot submit the form like this with errors -->\n @if (form.errors && form.errors['required']) {\n <mat-error>\n This is a long error message displayed on multiple lines. The icon is\n generated automatically by the type of error.\n </mat-error>\n }\n\n <!-- The warn hint is used to show an error styled warning -->\n @if (showWarnHint()) {\n <mat-hint [color]=\"'warn'\"> Max duration is 7 days </mat-hint>\n } @else {\n <mat-hint>Hint</mat-hint>\n }\n</mat-form-field>\n","demo-text-input.component.scss":"app-demo-text-input mat-form-field {\n max-width: 200px;\n}\n","demo-text-input.component.ts":"import { Component, effect, input, ViewEncapsulation } from '@angular/core';\nimport {\n FormsModule,\n ReactiveFormsModule,\n UntypedFormControl,\n Validators,\n} from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInput } from '@angular/material/input';\nimport { DemoComponentBase } from '../../_demo/demo-component-base';\nimport {\n OnemRvaColorDirective,\n OnemRvaReadonlyDirective,\n} from '@onemrvapublic/design-system';\n\n@Component({\n selector: 'app-demo-text-input',\n templateUrl: './demo-text-input.component.html',\n styleUrl: './demo-text-input.component.scss',\n standalone: true,\n imports: [\n FormsModule,\n CommonModule,\n MatInput,\n ReactiveFormsModule,\n MatFormFieldModule,\n OnemRvaReadonlyDirective,\n OnemRvaColorDirective,\n ],\n encapsulation: ViewEncapsulation.None,\n})\nexport class DemoTextInputComponent extends DemoComponentBase {\n form = new UntypedFormControl('text', [Validators.required]);\n\n color = input<'primary' | 'warn'>('primary');\n disabled = input(false);\n readonly = input(false);\n showWarnHint = input(false);\n\n constructor() {\n super();\n effect(() => {\n if (this.disabled()) this.form.disable();\n else this.form.enable();\n });\n }\n}\n"}