0.1.25 • Published 1 year ago

@centro-paghe/cp-chatbot-ai-ui v0.1.25

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

cp-chatbot-ui

This library add the possibility to connect to the Centro Paghe ChatBot

installation

npm i @centro-paghe/cp-chatbot-ai-ui

Parameteres (web component attributes)

  • user-cf: fiscal code of the logged user, its not mandatory
  • company-id: company id of the logged user, its not mandatory
  • application-id: the two letter ID that identify the application inside Centro Paghe (e.g. "AU" anagrafica unica)
  • document-id: this is a field for future implementation, ignore it for now

  • z-index: the zindex of the button and the popup in case there are some element in the page with a higher z-index

  • bottom: the distance form the bottom of the page to the button in pixel
  • right: the distance form the right of the page to the button in pixel

usage

import '@centro-paghe/cp-chatbot-ai-ui';

Here some example on how you can use the web component

Vanilla js and angularjs

you can put the web component directly in the html.

<body>
  
  <!--  ...  -->
  
  <cp-chat-bot-ui
      user-cf="RNEDVD"
      company-id="CC"
      application-id="APPID"
      document-id="document-id"
      z-index="999999"
  ></cp-chat-bot-ui>

  <!--  ...  -->

</body>

If you dont have npm you can download this repo of this package and get the dist/index.js file

<head>
  <script src="/path/to/index.js" />
</head>

Angular 2+

import this libraty in the root module

import '@centro-paghe/cp-chatbot-ai-ui';

then create a component and module like the following

import { Component } from '@angular/core';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';

@Component({
  selector: 'app-cp-chat-bot-ui-wrapper',
  standalone: true,
  imports: [],
  template: `<cp-chat-bot-ui
    user-cf="RNEDVD"
    company-id="CC"
    application-id="APPID"
    document-id="document-id"
  />`,
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class CpChatBotUiWrapperComponent {}
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CpChatBotUiWrapperComponent } from './cp-chat-bot-ui-wrapper.component';

@NgModule({
  declarations: [CpChatBotUiWrapperComponent],
  exports: [CpChatBotUiWrapperComponent],
  imports: [CommonModule],
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class CpChatBotUiWrapperModule {}

Vue

<script setup>
import '@CentroPagheSrl/cp-chatbot-ai-ui';
</script>

<template>

  <cp-chat-bot-ui
      user-cf="RNEDVD"
      company-id="CC"
      application-id="APPID"
      document-id="document-id"
      z-index="999999"
      bottom="40"
      right="40"
  ></cp-chat-bot-ui>

</template>

React

import '@CentroPagheSrl/cp-chatbot-ai-ui';

const Compoennt = () => {

  return <>

    {/* ---------- */}

      <cp-chat-bot-ui
          user-cf="RNEDVD"
          company-id="CC"
          application-id="APPID"
          document-id="document-id"
          z-index="999999"
          bottom="40"
          right="40"
      ></cp-chat-bot-ui>


    {/* ---------- */}

  </>

} 
0.1.25

1 year ago

0.1.24

1 year ago

0.1.23

1 year ago

0.1.22

1 year ago

0.1.21

1 year ago

0.1.20

1 year ago

0.1.19

1 year ago

0.1.18

1 year ago

0.1.17

1 year ago

0.1.16

1 year ago

0.1.15

1 year ago

0.1.13

1 year ago

0.1.12

1 year ago

0.1.11

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago