xxxxxxxxxx
1. Add tsconfig.json file to project
2. Integrate with a build tool
3. Change all .js files to .ts files
4. Check for any errors
xxxxxxxxxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module.exports = ({ env }) => ({
// ...
upload: {
config: {
provider: 'cloudinary',
providerOptions: {
cloud_name: env('CLOUDINARY_NAME'),
api_key: env('CLOUDINARY_KEY'),
api_secret: env('CLOUDINARY_SECRET'),
},
actionOptions: {
upload: {},
uploadStream: {},
delete: {},
},
},
},
// ...
});
xxxxxxxxxx
const Validacao =() => {
const {getFieldProps, handleSubmit, isValid} = useFormik({
initialValues: {
name:'',
contact:{
email:'',
phone:''
}
},
validate: values => {
const err ={}
const message= ' campo obrigatorio'
if(!values.name) err.name = message
if(!values.contact.email) err.email = message
return err
},
onSubmit: (values, bag) => {
console.log(values)
}
})
const [name, metadataName] = getFieldProps('name','text')
const [email, metadataEmail] = getFieldProps('contact.email', 'text')
const [phone, metadataPhone] = getFieldProps('contact.phone', 'text')
xxxxxxxxxx
const swaggerAutogen = require('swagger-autogen')()
const outputFile = './swagger_output.json'
const endpointsFiles = ['./endpoints.js']
swaggerAutogen(outputFile, endpointsFiles)
xxxxxxxxxx
var acc = document.getElementsByClassName("accordion");
var i;
for (i = 0; i < acc.length; i++) {
acc[i].addEventListener("click", function() {
this.classList.toggle("active");
var panel = this.nextElementSibling;
if (panel.style.display === "block") {
panel.style.display = "none";
} else {
panel.style.display = "block";
}
});
}
xxxxxxxxxx
var myModal = document.getElementById('myModal')
var myInput = document.getElementById('myInput')
myModal.addEventListener('shown.bs.modal', function () {
myInput.focus()
})
xxxxxxxxxx
checkLegends()
function checkLegends() {
var allLegends = document.querySelectorAll(".legend input[type='checkbox']")
for(var i = 0; i < allLegends.length; i++) {
if(!allLegends[i].checked) {
chart.toggleSeries(allLegends[i].value)
}
}
}
// toggleSeries accepts a single argument which should match the series name you're trying to toggle
function toggleSeries(checkbox) {
chart.toggleSeries(checkbox.value)
}
xxxxxxxxxx
var options = {
valueNames: [ { data: ['timestamp'] }, { data: ['status'] }, 'jSortNumber', 'jSortName', 'jSortTotal' ],
page: 6,
pagination: {
innerWindow: 1,
left: 0,
right: 0,
paginationClass: "pagination",
}
};