1.5.0 • Published 11 months ago

qilab-widgets v1.5.0

Weekly downloads
-
License
-
Repository
-
Last release
11 months ago

Start in Dev mode

cd qilab-widgets
npm run dev

Use your components on library's index.html to test it!

Start in Dev mode on Angular

Build library to test it on external projects

cd qilab-widgets
npm run build

Create new Angular project

ng new [PROJECT_NAME]
cd [PROJECT_NAME]
npm i lit
npm link qilab-widgets
npm run start

in AppModule (or any other Angular module you want import library)

import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import "node_modules/qilab-widgets/dist/widgets"


@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    FormsModule
  ],
  providers: [],
  bootstrap: [AppComponent],
  schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class AppModule { }

Use components in html files

<div class="container">
     <div class="row my-4">
      <div class="col">
        <widget-input-integer 
            [validationMsg]="validationMsg" #validation 
            [required]="true" label="Integer Input"
            id="integer" name="integer" [value]="formValues.integer"
           (valueChange)=" valueChange($event)">
           </widget-input-integer>
      </div>
    </div>
</div>

Start in Dev mode on React

Build library to test it on external projects

cd qilab-widgets
npm run build

Create new React project

npx create-react-app [PROJECT_NAME] --template typescript
cd [PROJECT_NAME]
npm install --save typescript @types/node @types/react @types/react-dom @types/jest
npm i @lit-labs/react
npm link qilab-widgets
npm run start

in App.tsx

 import { createComponent } from '@lit-labs/react';
 import  * as Compo from '../node_modules/qilab-widgets/dist/widgets'

export const WidgetSwitchReact = createComponent({
 tagName: 'widget-switch',
 elementClass: Compo.WidgetSwitch,
 react: React,
 events: {
     input: 'valueChange',
 },
});

export const WidgetInputTextReact = createComponent({
 tagName: 'widget-input-text',
 elementClass: Compo.WidgetInputText,
 react: React,
 events: {
     input: 'valueChange',
 },
});


function App() {
 return (
   <>
  <WidgetSwitchReact></WidgetSwitchReact>
  <WidgetInputTextReact></WidgetInputTextReact>
  </>
 )
}

Start in Dev mode on Vanilla

Create Vanilla Project using parcel js

mkdir [PROJECT_NAME]
cd [PROJECT_NAME]
npm init
npm install --save-dev parcel
touch index.html
npm link qilab-widgets
parcel index.html

in index.html

<!DOCTYPE html>
<html lang="en">

<head>
   <meta charset="UTF-8">
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>Document</title>
   <!--Import lib module with type=module -->
   <script type="module" src="../node_modules/qilab-widgets/dist/widgets.js"></script>

</head>

<body>
   <widget-switch></widget-switch>

   <widget-input-text label="Test Label"></widget-input-text>


</body>

</html>
1.5.0

11 months ago

1.2.0

1 year ago

1.1.1

1 year ago

1.0.19

1 year ago

1.0.2

1 year ago

1.1.0

1 year ago

1.0.18

1 year ago

1.0.1

1 year ago

1.0.17

1 year ago

1.0.0

1 year ago

1.0.16

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.2.1

1 year ago

1.1.2

1 year ago

1.0.3

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.29

1 year ago

1.0.28

1 year ago

0.0.10

1 year ago

0.1.0

1 year ago

1.0.11

1 year ago

0.0.9

1 year ago

1.0.10

1 year ago

0.0.8

1 year ago

1.0.15

1 year ago

0.0.5

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

0.0.7

1 year ago

1.0.12

1 year ago

0.0.6

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago