Skip to content

Commit 900c1d1

Browse files
committed
refactor(file-input): remove readOnly property from component
1 parent d29d757 commit 900c1d1

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

src/components/file-input/file-input.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ export default class IgcFileInputComponent extends IgcInputBaseComponent {
114114
@property({ type: Number })
115115
public override tabIndex = 0;
116116

117+
/** @hidden */
118+
@property({ type: Boolean, attribute: false, noAccessor: true })
119+
public override readonly readOnly = false;
120+
117121
constructor() {
118122
super();
119123
this._formValue = createFormValueState(this, { initialValue: '' });
@@ -178,7 +182,6 @@ export default class IgcFileInputComponent extends IgcInputBaseComponent {
178182
name=${ifDefined(this.name)}
179183
type="file"
180184
.value=${live(this.value)}
181-
?readonly=${this.readOnly}
182185
?disabled=${this.disabled}
183186
?required=${this.required}
184187
?autofocus=${this.autofocus}

stories/file-input.stories.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,6 @@ const metadata: Meta<IgcFileInputComponent> = {
8484
control: 'boolean',
8585
table: { defaultValue: { summary: 'false' } },
8686
},
87-
readOnly: {
88-
type: 'boolean',
89-
description: 'Makes the control a readonly field.',
90-
control: 'boolean',
91-
table: { defaultValue: { summary: 'false' } },
92-
},
9387
placeholder: {
9488
type: 'string',
9589
description: 'The placeholder attribute of the control.',
@@ -109,7 +103,6 @@ const metadata: Meta<IgcFileInputComponent> = {
109103
disabled: false,
110104
invalid: false,
111105
outlined: false,
112-
readOnly: false,
113106
},
114107
};
115108

@@ -140,8 +133,6 @@ interface IgcFileInputArgs {
140133
invalid: boolean;
141134
/** Whether the control will have outlined appearance. */
142135
outlined: boolean;
143-
/** Makes the control a readonly field. */
144-
readOnly: boolean;
145136
/** The placeholder attribute of the control. */
146137
placeholder: string;
147138
/** The label for the control. */
@@ -167,7 +158,6 @@ export const Basic: Story = {
167158
?invalid=${args.invalid}
168159
?multiple=${args.multiple}
169160
?outlined=${args.outlined}
170-
?readonly=${args.readOnly}
171161
?required=${args.required}
172162
></igc-file-input>
173163
`,
@@ -189,7 +179,6 @@ export const Slots: Story = {
189179
?invalid=${args.invalid}
190180
?multiple=${args.multiple}
191181
?outlined=${args.outlined}
192-
?readonly=${args.readOnly}
193182
?required=${args.required}
194183
>
195184
<igc-icon name="github" slot="prefix"></igc-icon>
@@ -219,7 +208,6 @@ export const Validation: Story = {
219208
?invalid=${args.invalid}
220209
?multiple=${args.multiple}
221210
?outlined=${args.outlined}
222-
?readonly=${args.readOnly}
223211
?required=${args.required}
224212
>
225213
<p slot="helper-text">Your life's work</p>

0 commit comments

Comments
 (0)