Skip to content

Commit

Permalink
fix(language-selector): remove internal decorator (carbon-design-syst…
Browse files Browse the repository at this point in the history
…em#11069)

### Related Ticket(s)

Closes carbon-design-system#10885 

### Description

Removes the `@internal` decorator from `language-selector` which was preventing output to the `.d.ts`. Also removes unneeded code from `bx-input`.

### Changelog

**New**

- {{new thing}}

**Changed**

- {{changed thing}}

**Removed**

- `@internal` decorator
- unused getter/setter from `bx-input`

<!-- React and Web Component deploy previews are enabled by default. -->
<!-- To enable additional available deploy previews, apply the following -->
<!-- labels for the corresponding package: -->
<!-- *** "test: e2e": Codesandbox examples and e2e integration tests -->
<!-- *** "package: services": Services -->
<!-- *** "package: utilities": Utilities -->
<!-- *** "RTL": React / Web Components (RTL) -->
<!-- *** "feature flag": React / Web Components (experimental) -->
  • Loading branch information
kennylam authored Oct 26, 2023
1 parent c8d41cc commit edfaa29
Showing 1 changed file with 6 additions and 26 deletions.
32 changes: 6 additions & 26 deletions packages/carbon-web-components/src/components/input/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ export default class BXInput extends ValidityMixin(FormMixin(LitElement)) {
*/
protected _value = '';

/**
* Set initial value of input
*/
@property({ reflect: true })
value = '';

/**
* Handles `oninput` event on the `<input>`.
*
Expand Down Expand Up @@ -198,32 +204,6 @@ export default class BXInput extends ValidityMixin(FormMixin(LitElement)) {
@property({ attribute: 'validity-message' })
validityMessage = '';

/**
* The value of the input.
*/
@property({ reflect: true })
get value() {
// FIXME: Figure out how to deal with TS2611
// once we have the input we can directly query for the value
if (this._input) {
return this._input.value;
}
// but before then _value will work fine
return this._value;
}

set value(value) {
const oldValue = this._value;
this._value = value;
// make sure that lit-element updates the right properties
this.requestUpdate('value', oldValue);
// we set the value directly on the input (when available)
// so that programatic manipulation updates the UI correctly
if (this._input) {
this._input.value = value;
}
}

createRenderRoot() {
return this.attachShadow({
mode: 'open',
Expand Down

0 comments on commit edfaa29

Please sign in to comment.