
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@covalent/code-editor
Advanced tools
Teradata Text and Code Editor built on Covalent and Angular Material
Covalent is a reusable UI platform from Teradata for building web applications with common standards and tooling. It is based on Angular 2 and Material Design.
Covalent-Code-Editor is an Angular Component for text and code editing based on Covalent and Monaco Editor. The component can run in both Electron and Web Browsers.
Demo: https://teradata.github.io/covalent/#/components/code-editor
Covalent Github Repo: https://github.com/Teradata/covalent
Covalent Electron Github Repo: https://github.com/Teradata/covalent-electron
Monaco Editor Repo: https://github.com/Microsoft/monaco-editor
npm install @covalent/code-editor
{
"apps": [
{
"assets": [
{
"glob": "**/*",
"input": "node_modules/@covalent/code-editor/assets/monaco",
"output": "/assets/monaco"
}
],
<td-code-editor style="height: 200px" theme="vs" flex language="sql"></td-code-editor>
import { CovalentCodeEditorModule } from '@covalent/code-editor';
...
imports: [
CovalentCodeEditorModule,
...
td-code-editor
element generates a monaco editor for inline code editing
Name | Description |
---|---|
editorInitialized | Emitted when Editor is finished initializing. Event passes a reference to the actual editor instance that can be used to call additional operations outside of the Angular component. See usage example below. |
onEditorConfigurationChanged | Emitted when configuration of the Editor changes |
onEditorLanguageChanged | Emitted when the language of the Editor changes |
Name | Type | Description |
---|---|---|
value? | string | Value of Code in Editor |
language | string | Code Language used in Editor |
registerLanguage | function() | Registers a custom Language within the editor |
editorStyle | string | Additional Styling applied to Editor Container |
theme | string | Theme used to style the Editor |
automaticLayout | boolean | Implemented via setInterval that constantly probes for the container's size. Defaults to false. |
editorOptions | Object | Editor Options Object of valid Configurations listed here: https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.ieditoroptions.html |
layout | function() | Instructs the editor to remeasure its container |
isFullScreen | boolean | Is the editor currently in Full Screen mode |
fullScreenKeyBinding | number | Sets the KeyCode for shortcutting to Fullscreen. Options listed see here: https://microsoft.github.io/monaco-editor/api/enums/monaco.keycode.html |
Example for HTML usage:
<td-code-editor
style="height: 200px"
editorStyle="border:0;"
flex
theme="vs"
language="sql"
automaticLayout
[editorOptions]="{readOnly:true, fontSize:20}"
[(ngModel)]="model"
(change)="callBackFunc()">
</td-code-editor>
Example of exposing editor instance
<td-code-editor
[editorOptions]="editorOptions"
[(ngModel)]="model"
(editorInitialized)="onInit($event)">
</td-code-editor>
export class AppComponent {
editorOptions = {theme: 'vs-dark', language: 'javascript'};
model: string= 'function x() {\nconsole.log("Hello world!");\n}';
column: number = 0;
lineNumber: number = 0;
async onEditorInitialized(editor: any): Promise<void> {
let line: any = await editor.getPosition();
this.column = line.column;
this.lineNumber = line.lineNumber;
}
}
FAQs
Teradata UI Platform Code Editor Module
The npm package @covalent/code-editor receives a total of 662 weekly downloads. As such, @covalent/code-editor popularity was classified as not popular.
We found that @covalent/code-editor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.