@jatahworx/alpha-annotations-lib
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

Alpha-annotations-lib

AlphaComponent is a TypeScript decorator for adding metadata to classes. It is designed to simplify the process of attaching version, label, category, and icon information to your Angular components.

Installation

npm install alpha-annotation-lib   or import this library and use it

Import the provided methods and extend them as needed in your TypeScript code

Usage

import { AlphaComponent } from "alpha-annotation-lib";

or;

import { AlphaComponent } from "././path_to_the_library";
//Adding the metadata to the decorator
//class decorator
@AlphaComponent({
  componentName:string,
  componentVersion:string,
  label:string,
  selector:string,
  category:string,
  icon?:string,
})


//Property decorator
@AlphaAttribute({
  category: string,
  uiType: UI_TYPE.COLOR_PICKER,
  defaultValue: string,
  type:ATTRIBUTE_TYPE.PROPERTY,
  label: string,
  fieldMappings: string
})


 ## Examples
  @AlphaComponent({
    componentName: "my_component",
    componentVersion: "0.0.1",
    label: "my_component",
    selector: "alpha-text-field",
    category: "general",
    icon: "fa-input",
  })

  //this should be the selector name
  @customElement('alpha-text-field')
  export class MyComponent {
    @AlphaAttribute({
      category: "dropdown",
      uiType: UI_TYPE.COLOR_PICKER,
      defaultValue: '',
      type: ATTRIBUTE_TYPE.PROPERTY,
      label: "label",
      fieldMappings: "value"
    })
    @property({ type: String })
    value = '';
  }






## License
The Alpha Component is licensed under the MIT License.

Readme

Keywords

none

Package Sidebar

Install

npm i @jatahworx/alpha-annotations-lib

Weekly Downloads

98

Version

1.0.9

License

ISC

Unpacked Size

12 kB

Total Files

20

Last publish

Collaborators

  • jatahworx