Nucleus is a library of web-components stand-alone for all products of MiFiel
![]()
Simply add the follow tags into your html and ready! you can use them
| const timer = ({ interval = 1000, onTime = () => {} }) => { | |
| let time = 0; | |
| let pid = null; | |
| const stop = () => { | |
| clearInterval(pid); | |
| }; | |
| const start = () => { | |
| pid = setInterval(() => { |
| const initialState = { | |
| floor: 0, | |
| isOpen: false, | |
| direction: 'up', | |
| } | |
| function Lift (state = initialState) { | |
| console.table(state) | |
| function request (floor) { |
| import React, { useState } from 'react'; | |
| import { Field, Input, Label, Control, Select, TextArea, Checkbox, Radio, Button, Help, Notification, Delete } from "bloomer"; | |
| import joinString from "classnames"; | |
| import { useForm } from "../Hooks"; | |
| export const FormExample = ({isHidden}) => { | |
| const FIELD_REQUIRED = 'This field is required'; | |
| const SELECT_FIELD = 'Please select this field'; | |
| const NOTIFICATION_MESSAGE_SUCCESS = 'Success message here!'; |
| /* | |
| MAIN FUCTION: HOC NucleusWrapper | |
| @description | |
| it HOC lets add custom events to html tags. | |
| @usage | |
| you only need to import the HOC as follow: | |
| import NucleusWrapper from '../NucleusWrapper' | |
| then make a component with: |
| const Tab = ({ dataTab, tabActive, onClick, children }) => { | |
| const isActive = dataTab === tabActive; | |
| return ( | |
| <li className={`vex_Tab-tab ${isActive ? 'is-active' : ''}`} onClick={onClick}> | |
| {children} | |
| </li> | |
| ); | |
| }; | |
| Tab.propTypes = { |
| const calculateIMC = (height, weight) => { | |
| const imc = this.weight / Math.pow(this.height, 2).toFixed(2); | |
| if(imc < 16){ | |
| return 'delgadez severa imc ' + imc; | |
| } | |
| if(imc < 16.99){ | |
| return 'delgadez moderada imc ' + imc; | |
| } | |
| if(imc < 18.49){ | |
| return 'delgadez aceptable imc ' + imc; |