Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
render() {
const { selected, selectionName, selectionValue, selectionIconTitle } = this;
if (selectionName) {
// "Selected" style with `.bx--structured-list-td` does not work somehow - Need investigation
return html`
<input value="${ifDefined(selectionValue)}" name="${selectionName}" class="${prefix}--structured-list-input" type="radio" id="input">
<div class="${prefix}--structured-list-td ${prefix}--structured-list-cell">
${CheckmarkFilled16({
class: `${prefix}--structured-list-svg`,
title: selectionIconTitle,
})}
</div>
`;
}
return html`
`;
}
private _renderIcon() {
const { status } = this;
if (status === INLINE_LOADING_STATE.ERROR) {
return Error20({
class: `${prefix}--inline-loading--error`,
});
}
if (status === INLINE_LOADING_STATE.FINISHED) {
return CheckmarkFilled16({
class: `${prefix}--inline-loading__checkmark-container ${prefix}--inline-loading__svg`,
});
}
if (status === INLINE_LOADING_STATE.INACTIVE || status === INLINE_LOADING_STATE.ACTIVE) {
const classes = classMap({
[`${prefix}--loading ${prefix}--loading--small`]: true,
[`${prefix}--loading--stop`]: status === INLINE_LOADING_STATE.INACTIVE,
});
return html`
<div class="${classes}">
${getLoadingIcon({ type: LOADING_TYPE.SMALL })}
</div>
`;
}
return undefined;
}
render() {
const { checkmarkLabel, name, selected, value, _inputType: inputType, _handleChange: handleChange } = this;
return html`
<input value="${ifNonNull(value)}" name="${ifNonNull(name)}" tabindex="-1" class="${prefix}--tile-input" id="input" type="${inputType}">
<label tabindex="0" class="${prefix}--tile ${prefix}--tile--selectable" for="input">
<div class="${prefix}--tile__checkmark">
${CheckmarkFilled16({
children: !checkmarkLabel ? undefined : svg`<title>${checkmarkLabel}</title>`,
})}
</div>
<div class="${prefix}--tile-content"></div>
</label>
`;
}