Skip to content

Commit

Permalink
feat: pr fixes
Browse files Browse the repository at this point in the history
Co-authored-by: yadamskaya <48826082+yadamskaya@users.noreply.github.com>
  • Loading branch information
nattallius committed Aug 16, 2023
1 parent 05120e0 commit 3462491
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/plugins/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class UIPHeader extends UIPPlugin {

/** Renders copy icon */
protected renderCopy(): void {
const icon = <button title="copy markup" className="copy-icon">{UIPOptionIcons.copySVG}</button>;
const icon = <button title="copy markup" className="copy-icon">{UIPOptionIcons.copySVG.cloneNode(true) as HTMLElement}</button>;
this.append(icon);
}

Expand Down
13 changes: 3 additions & 10 deletions src/plugins/header/options/option/option.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ export class UIPOption extends ESLBaseElement {

/** Builds option element from {@link OptionConfig} */
static createEl(optionConfig: OptionConfig) {
const option = <uip-option attribute={optionConfig.optionValue}>{optionConfig.svg.cloneNode(true)}</uip-option> as UIPOption;
const option = document.createElement('uip-option') as UIPOption;
option.setAttribute('attribute', optionConfig.optionValue);
option.append(optionConfig.svg.cloneNode(true));
option.config = optionConfig;
return option;
}
Expand Down Expand Up @@ -74,12 +76,3 @@ export class UIPOption extends ESLBaseElement {
this.active = force === undefined ? !this.active : force;
}
}

declare global {
namespace JSX {
interface IntrinsicElements {
/** {@link UIPOption} custom tag */
'uip-option': UIPOption;
}
}
}
8 changes: 5 additions & 3 deletions src/plugins/settings/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ export class UIPSettings extends UIPPlugin {

/** Initializes settings layout */
protected updateInner() {
const content = <div className="settings-list esl-scrollable-content">
{this.childNodes}
const $content = <div className="settings-list esl-scrollable-content">
<esl-scrollbar target="::prev(.settings-list)"></esl-scrollbar>
</div>;
this.$inner.appendChild(content);
[...this.childNodes].forEach((node: HTMLElement) => {
$content.appendChild(node);
});
this.$inner.appendChild($content);
this.appendChild(this.$inner);
}

Expand Down
4 changes: 2 additions & 2 deletions src/settings/bool-setting/bool-setting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ export class UIPBoolSetting extends UIPSetting {
super.connectedCallback();
this.innerHTML = '';

const inner = <label>
const $inner = <label>
{this.label}
{this.$field}
</label>;
this.insertBefore(inner, this.firstChild);
this.insertBefore($inner, this.firstChild);
}

applyTo(model: UIPStateModel): void {
Expand Down
4 changes: 2 additions & 2 deletions src/settings/slider-setting/slider-setting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class UIPSliderSetting extends UIPSetting {
protected connectedCallback() {
super.connectedCallback();

const inner =
const $inner =
<>
<label>
<span>{this.label}</span>
Expand All @@ -31,7 +31,7 @@ export class UIPSliderSetting extends UIPSetting {
{this.$fieldValue}
</>;

this.append(inner);
this.append($inner);
}

protected disconnectedCallback() {
Expand Down
4 changes: 2 additions & 2 deletions src/settings/text-setting/text-setting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ export class UIPTextSetting extends UIPSetting {
super.connectedCallback();
this.innerHTML = '';

const inner = <label>
const $inner = <label>
{this.label}
{this.$field}
</label>;

this.appendChild(inner);
this.appendChild($inner);
}

protected getDisplayedValue(): string {
Expand Down

0 comments on commit 3462491

Please sign in to comment.