1.0.9 • Published 4 years ago

@jossydevers/prueba v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

MIT License GitHub Release

Description

Examples

NPM

Install the package from https://www.npmjs.com/cron-expression-input

npm install cron-expression-input@1.2.6

In your code

import "cron-expression-input/cron-expression-input.min.css"; /* CSS */
require("cron-expression-input"); /* JAVASCRIPT */

CDN

Add the CDN to your project

<link rel="stylesheet" href="https://unpkg.com/cron-expression-input@1.2.6/lib/cron-expression-input.min.css">
<script src="https://unpkg.com/cron-expression-input@1.2.6/lib/cron-expression-input.min.js"></script>

Usage

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Sample Page</title>
    <link rel="stylesheet" href="https://unpkg.com/cron-expression-input@1.2.6/lib/cron-expression-input.min.css">
    <script src="https://unpkg.com/cron-expression-input@1.2.6/lib/cron-expression-input.min.js"></script>
</head>
<body>
    <!-- Component -->
    <cron-expression-input color="d58512"></cron-expression-input>
    <!-- Component -->
    <script src="cron-expression-input.js"></script>
</body>
</html>
import "cron-expression-input/cron-expression-input.min.css"; /* CSS */
require("cron-expression-input"); /* JAVASCRIPT */

class App extends React.Component {
  constructor(props) {
    super(props);
    this.state = { cron: "* * * * *" };
  }

  render() {
    return (
      <div>
        <cron-expression-input
          value={this.state.cron}
          onInput={(e) => this.setState({ cron: e.nativeEvent.detail.value })}
          color="d58512" />
      </div>
    );
  }
}

export default App;
<template>
  <div id="app">
    <cron-expression-input
      :value="cron"
      v-on:input="cron = $event.detail.value"
      color="d58512" />
  </div>
</template>

<script>
import "cron-expression-input/cron-expression-input.min.css"; /* CSS */
require("cron-expression-input"); /* JAVASCRIPT */

export default {
  name: 'App',
  data() {
    return {
      cron: "* * * * *"
    }
  }
}
</script>

You can pass various attributes to the component to modify its behavior, Example with color attribute:

NameTypeDefaultDescription
width{String}100%The width of the component input
height{String}34pxThe height of the component input
color{String}#d58512The main color that the component elements will take, (Only in hexadecimal)