-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(components): reduce post-migration TypeScript errors #10356
Changes from all commits
05e947c
9e64d87
5696e22
a73a79d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ export const Heading: FunctionalComponent<HeadingProps> = (props, children): VNo | |
delete props.level; | ||
|
||
return ( | ||
<HeadingTag class={props.class} key={props.key} level={props.level}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
original discussion in #10352 (comment) |
||
<HeadingTag class={props.class} key={props.key}> | ||
{children} | ||
</HeadingTag> | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -774,9 +774,9 @@ export class InputDatePicker | |
|
||
@State() private localeData: DateLocaleData; | ||
|
||
private startInput: HTMLCalciteInputElement; | ||
private startInput: HTMLCalciteInputTextElement; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was causing a type error in Lumina - the ref is assigned to calcite-input-text, but the type here was calcite-input. |
||
|
||
private endInput: HTMLCalciteInputElement; | ||
private endInput: HTMLCalciteInputTextElement; | ||
|
||
private floatingEl: HTMLDivElement; | ||
|
||
|
@@ -884,11 +884,11 @@ export class InputDatePicker | |
syncHiddenFormInput("date", this, input); | ||
} | ||
|
||
setStartInput = (el: HTMLCalciteInputElement): void => { | ||
setStartInput = (el: HTMLCalciteInputTextElement): void => { | ||
this.startInput = el; | ||
}; | ||
|
||
setEndInput = (el: HTMLCalciteInputElement): void => { | ||
setEndInput = (el: HTMLCalciteInputTextElement): void => { | ||
this.endInput = el; | ||
}; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,15 +114,19 @@ export class Link implements InteractiveComponent, LoadableComponent { | |
This works around that issue for now. | ||
*/ | ||
download={ | ||
Tag === "a" ? (download === true || download === "" ? "" : download || null) : null | ||
childElType === "a" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As per line 103 in this file ( See Lumina's docs on JSX -> Dynamic tag names for more details |
||
? download === true || download === "" | ||
? "" | ||
: download || null | ||
: null | ||
} | ||
href={Tag === "a" && this.href} | ||
href={childElType === "a" && this.href} | ||
onClick={this.childElClickHandler} | ||
ref={this.storeTagRef} | ||
rel={Tag === "a" && this.rel} | ||
rel={childElType === "a" && this.rel} | ||
role={role} | ||
tabIndex={tabIndex} | ||
target={Tag === "a" && this.target} | ||
target={childElType === "a" && this.target} | ||
> | ||
{this.iconStart ? iconStartEl : null} | ||
<slot /> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -228,7 +228,7 @@ export class CalciteMenu implements LocalizedComponent, T9nComponent, LoadableCo | |
} | ||
|
||
private getEffectiveRole(): string { | ||
return this.el.getAttribute("role") || "menubar"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. equivalent |
||
return this.el.role || "menubar"; | ||
} | ||
|
||
// -------------------------------------------------------------------------- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,8 +146,6 @@ export class Tooltip implements FloatingUIComponent, OpenCloseComponent { | |
|
||
guid = `calcite-tooltip-${guid()}`; | ||
|
||
hasLoaded = false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. never read |
||
|
||
openTransitionProp = "opacity"; | ||
|
||
transitionEl: HTMLDivElement; | ||
|
@@ -175,7 +173,6 @@ export class Tooltip implements FloatingUIComponent, OpenCloseComponent { | |
if (this.referenceElement && !this.effectiveReferenceElement) { | ||
this.setUpReferenceElement(); | ||
} | ||
this.hasLoaded = true; | ||
} | ||
|
||
disconnectedCallback(): void { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never read, thus removed