Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/components/Button/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class Button extends Element<ButtonArgs, any> {
static ctor = ButtonClass;

render() {
// @ts-expect-error
return <button ref={this.attachElement} />;
}
}
Expand Down
1 change: 0 additions & 1 deletion src/components/Canvas/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class Canvas extends Element<CanvasArgs, any> {
static ctor = CanvasClass;

render() {
// @ts-expect-error
return <canvas ref={this.attachElement}/>;
}
}
Expand Down
1 change: 0 additions & 1 deletion src/components/ColorPicker/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class ColorPicker extends Element<ColorPickerArgs, any> {
static ctor = ColorPickerClass;

render() {
// @ts-expect-error
return <div ref={this.attachElement}/>;
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/components/ColorPicker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -763,12 +763,11 @@ class ColorPicker extends Element implements IBindable {
}

/* eslint accessor-pairs: 0 */
set values(values: Array<number>) {
set values(values: Array<any>) {
let different = false;
const value = values[0];
for (let i = 1; i < values.length; i++) {
if (Array.isArray(value)) {
// @ts-expect-error
const other: number[] = values[i];
if (!Array.isArray(other) || value.length !== other.length ||
value.some((v, j) => v !== other[j])) {
Expand All @@ -787,7 +786,6 @@ class ColorPicker extends Element implements IBindable {
this.value = null;
this.class.add(CLASS_MULTIPLE_VALUES);
} else {
// @ts-expect-error
this.value = values[0];
}
}
Expand Down
1 change: 0 additions & 1 deletion src/components/Container/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class Container extends Element<ContainerArgs, any> {
);
}

// @ts-expect-error
return <div ref={this.attachElement}>
{ elements }
</div>;
Expand Down
3 changes: 1 addition & 2 deletions src/components/Element/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Element<P extends ElementArgs, S> extends React.Component<P, S> {
}
}

attachElement = (nodeElement: HTMLElement, containerElement: any) => {
attachElement = (nodeElement: HTMLElement | SVGElement | null, containerElement?: any) => {
if (!nodeElement) return;

this.element = new this.elementClass({
Expand Down Expand Up @@ -124,7 +124,6 @@ class Element<P extends ElementArgs, S> extends React.Component<P, S> {
}

render() {
// @ts-expect-error
return <div ref={this.attachElement} />;
}
}
Expand Down
1 change: 0 additions & 1 deletion src/components/GradientPicker/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class GradientPicker extends Element<GradientPickerArgs, any> {
static ctor = GradientPickerClass;

render() {
// @ts-expect-error
return <div ref={this.attachElement}/>;
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/components/GradientPicker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1376,7 +1376,7 @@ class GradientPicker extends Element {
}

// store the curve type
const comboItems = {
const comboItems: Record<number, string> = {
0: 'Step',
1: 'Linear',
2: 'Spline'
Expand All @@ -1396,7 +1396,6 @@ class GradientPicker extends Element {
if (value[0].type !== CURVE_STEP &&
value[0].type !== CURVE_LINEAR &&
value[0].type !== CURVE_SPLINE) {
// @ts-expect-error
comboItems[3] = 'Legacy';
Comment thread
willeastcott marked this conversation as resolved.
this.STATE.typeMap[3] = value[0].type;
}
Expand Down
1 change: 0 additions & 1 deletion src/components/InfoBox/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class InfoBox extends Element<InfoBoxArgs, any> {
static ctor = InfoBoxClass;

render() {
// @ts-expect-error
return <span ref={this.attachElement} />;
}
}
Expand Down
1 change: 0 additions & 1 deletion src/components/Label/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class Label extends Element<LabelArgs, any> {
static ctor = LabelClass;

render() {
// @ts-expect-error
return <span ref={this.attachElement} />;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/LabelGroup/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface LabelGroupChildProps {
class LabelGroup extends Element<LabelGroupArgs, any> {
static ctor = LabelGroupClass;

attachElement = (nodeElement: HTMLElement, containerElement: any) => {
attachElement = (nodeElement: HTMLElement | SVGElement | null, containerElement?: any) => {
if (!nodeElement) return;
const childrenErrorMessage = 'A LabelGroup must contain a single PCUI react component as a child';
// check that the LabelGroup has a single child
Expand Down
1 change: 0 additions & 1 deletion src/components/Spinner/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class Spinner extends Element<SpinnerArgs, any> {
static ctor = SpinnerClass;

render() {
// @ts-expect-error
return <svg ref={this.attachElement} />;
}
}
Expand Down