File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ export class NumberChange {
7373 [attr.max]="max"
7474 [attr.step]="step"
7575 [disabled]="disabled"
76+ [readonly]="readonly"
7677 [required]="required"
7778 [attr.aria-label]="ariaLabel"
7879 [attr.data-invalid]="invalid ? invalid : null"
@@ -150,6 +151,10 @@ export class NumberComponent implements ControlValueAccessor {
150151
151152 @HostBinding ( "class.cds--form-item" ) containerClass = true ;
152153
154+ /**
155+ * Set to `true` for readonly state.
156+ */
157+ @Input ( ) @HostBinding ( "class.cds--number--readonly" ) readonly = false ;
153158 /**
154159 * @deprecated since v5 - Use `cdsLayer` directive instead
155160 * `light` or `dark` number input theme.
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ const Template = (args) => ({
2828 [warn]="warn"
2929 [warnText]="warnText"
3030 [size]="size"
31+ [readonly]="readonly"
3132 [disabled]="disabled">
3233 </cds-number>
3334 `
@@ -42,6 +43,7 @@ Basic.args = {
4243 max : 100 ,
4344 step : 1 ,
4445 invalid : false ,
46+ readonly : false ,
4547 disabled : false ,
4648 size : "md" ,
4749 theme : "dark"
You can’t perform that action at this time.
0 commit comments