news-element
v0.1.8
Published
= <bcb-news> elements
Downloads
1
Readme
= elements
An element providing Claude Bernard's latest news about health.
== Documentation
See the full documentation for Lit at https://docs.claudebernard.fr/elements/news[docs.claudebernard.fr].
You can play with a full https://docs.claudebernard.fr/elements/news/demo[demo].
== Installation
npm install --save @claudebernard/news-element
== Usage
=== Script
Import as ES modules:
import '@claudebernard/news-element';
Import as CommonJS modules:
require('@claudebernard/news-element');
With a script tag:
<script type="module" src="node_modules/@claudebernard/news-element/bcb-news.js"></script>
=== HTML
<bcb-news apikey="eyDFGFDG...cv45GB" size=3></bcb-news>
== Attributes
[cols="4*",options="header"]
|===
| Name | Type | Default | Description
| apikey
| string
| undefined
| The API key to access the Claude Bernard API.
| newsCount
| number
| 5
| The number of news to display.
| news
| array
| []
| All the news received by API call.
| viewMode
| string
| static
| The style of the custom element.
| image
| string
| left
| The position of the picture.
| showNewsType
| boolean
| true
| To display or not the type of the news.
| dateFormat
| string
| DD/MM/YYYY
| The date format to use.
| seeMoreLabel
| string
| Lire la suite
| The label to display for the "see more" link.
| showHeader
| boolean
| false
| To display or not a header above the custom element.
| bgColor
| string
| #FFFFFF
| The background color of the custom element.
| navigation
| |
| Coming soon.
|===
== Events
[cols="2*",options="header"]
|===
| Name | Description
| loadstart
| The server fetch has started.
| load
| The network request completed successfully.
| error
| The network request failed.
| loadend
| The network request has completed.
|===
== Browser support
Browsers without native https://caniuse.com/custom-elementsv1[custom element support] require a https://github.com/webcomponents/polyfills/tree/master/packages/custom-elements[polyfill].
- [*] Chrome
- [*] Firefox
- [*] Safari
- [*] Microsoft Edge
== Custom element checklist
- [] Public documentation (docs portal)
- [] Functional on Angular, React, Vue
- [] Unit tested
- [] Code quality
- [] Changelog with semantic release
- [] Available in offline mode
- [] Best practices compliant
- [] Validated by QA
- [] Publicly available
- [] Based on FHIR
- [] Example on storybook
- [] Available demo
- [] i18n
- [] Browser support section
- [] EOL section
== Contributing
Read through our https://docs.claudebernard.fr/contributing[contributing guidelines] to learn about our submission process, coding rules, and more.
== License
Copyright of Cegedim. See LICENSE for details.