jcb-question
v1.0.2
Published
simple modal question
Downloads
2
Readme
Install
npm install jcb-question
Usage example
index.html
<!DOCTYPE html>
<head>
<script type="module" src="./index.js"></script>
</head>
<body>
<jcb-button id="id_open">open question</jcb-button>
<jcb-question id="id_question"></jcb-question>
</body>
<script>
import "@fontsource/roboto/300.css"
import 'jcb-button'
const openButton = document.getElementById('id_open')
const question = document.getElementById('id_question')
openButton.addEventListener('click', async (event) => {
let answer = await question.openDialog({
title: "Erreur",
content: "Ces fichiers ont déjà été associés à un autre patient",
choices: [
{ text: "OK", value: true },
{ text: "annuler", value: null },
]
})
console.log('answer', answer)
})
</script>
<style>
:root {
font-family: "Roboto";
font-weight: 300;
}
html {
background: url(https://mitab.jcbuisson.dev/static/uploads/images/cirrus-beau-temps.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
</style>
npm i jcb-question
npm i @fontsource/roboto
npm i parcel -g
parcel index.html
API references
jcb-question
Properties
None
Events
None
CSS variables
| Name | Description |
| ------------------------------------------ |---------------------------------------|
| --jcb-list-color
| text color of items |
Functions
| Name | Parameters | Description |
| --------------------- |:------------------------:| ---------------------------------------------------|
| openDialog
| | |