Skip to main content
Glama
nrwl

Nx MCP Server

Official
by nrwl
checkbox-field.ts1.65 kB
import { spread } from '@open-wc/lit-helpers'; import { html, LitElement } from 'lit'; import { customElement } from 'lit/decorators.js'; import { intellijFieldColors, intellijFocusRing, } from '@nx-console/shared-ui-components'; import { CheckboxWrapper } from './mixins/checkbox-wrapper-mixin'; import { Field } from './mixins/field-mixin'; @customElement('checkbox-field') export class CheckboxField extends CheckboxWrapper(Field(LitElement)) { renderField() { if (this.editor === 'intellij') { return html`<input type="checkbox" class="form-checkbox ${intellijFieldColors} checked:bg-primary ${intellijFocusRing} h-5 w-5 rounded checked:border-transparent focus:ring-offset-0" @input="${this.handleChange}" ${spread(this.ariaAttributes)} />`; } else { return html`<vscode-checkbox @change="${this.handleChange}" style="${this.shouldRenderError() ? '--border-width: 1; --checkbox-border: var(--vscode-inputValidation-errorBorder); --focus-border: var(--vscode-inputValidation-errorBorder);' : ''}" ${spread(this.ariaAttributes)} ?invalid=${this.shouldRenderError()} ></vscode-checkbox>`; } } setFieldValue(value: string | number | boolean | string[] | undefined): void { const inputElement = this.renderRoot.querySelector( this.editor === 'intellij' ? 'input' : 'vscode-checkbox', ); if (!inputElement) { return; } inputElement.checked = Boolean(value); } handleChange(e: Event) { const value = (e.target as HTMLInputElement).checked; this.dispatchValue(value); } } `=`;

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nrwl/nx-console'

If you have feedback or need assistance with the MCP directory API, please join our Discord server