diff --git a/src/style_manager/model/PropertySelect.ts b/src/style_manager/model/PropertySelect.ts index 33d942f07..c9ab1dcb9 100644 --- a/src/style_manager/model/PropertySelect.ts +++ b/src/style_manager/model/PropertySelect.ts @@ -7,6 +7,8 @@ type SelectOption = { value?: string; label?: string; name?: string; + className?: string; + title?: string; }; /** @private */ diff --git a/src/style_manager/view/PropertyRadioView.js b/src/style_manager/view/PropertyRadioView.ts similarity index 80% rename from src/style_manager/view/PropertyRadioView.js rename to src/style_manager/view/PropertyRadioView.ts index c794544ab..ea536ee03 100644 --- a/src/style_manager/view/PropertyRadioView.js +++ b/src/style_manager/view/PropertyRadioView.ts @@ -1,4 +1,5 @@ import PropertySelectView from './PropertySelectView'; +import PropertyRadio from '../model/PropertyRadio'; export default class PropertyRadioView extends PropertySelectView { templateInput() { @@ -7,7 +8,8 @@ export default class PropertyRadioView extends PropertySelectView { } onRender() { - const { pfx, ppfx, model } = this; + const { pfx, ppfx } = this; + const model = this.model as PropertyRadio; const itemCls = `${ppfx}radio-item-label`; const prop = model.getName(); const options = model.getOptions(); @@ -15,7 +17,7 @@ export default class PropertyRadioView extends PropertySelectView { const { cid } = model; if (!this.input) { - const optionsRes = []; + const optionsRes: string[] = []; options.forEach(opt => { const cls = opt.className ? `${opt.className} ${pfx}icon ${itemCls}` : ''; @@ -32,16 +34,16 @@ export default class PropertyRadioView extends PropertySelectView { `); }); - const inputHld = this.el.querySelector(`.${ppfx}field`); + const inputHld = this.el.querySelector(`.${ppfx}field`)!; inputHld.innerHTML = `