Giter Club home page Giter Club logo

cron-expression-input's Introduction

Cron Expression Input

MIT License GitHub Release

Description

Cron Expression UI: Input component to generate cron expressions easily and intuitively, as in https://crontab.guru/

Examples

cron-expression-input cron-expression-input-modal

Instructions

NPM

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

npm install [email protected]

In your code

import "cron-expression-input/lib/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/[email protected]/lib/cron-expression-input.min.css">
<script src="https://unpkg.com/[email protected]/lib/cron-expression-input.min.js"></script>

Usage

Use in html

<!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/[email protected]/lib/cron-expression-input.min.css">
    <script src="https://unpkg.com/[email protected]/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>

Use in React

import "cron-expression-input/lib/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;

Use in Vue

<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/lib/cron-expression-input.min.css"; /* CSS */
//require("cron-expression-input"); /* JAVASCRIPT */
import "cron-expression-input/lib/cron-expression-input.min.css"; /* CSS */
import "cron-expression-input/lib/cron-expression-input.min.js"; /* JAVASCRIPT */

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

Component Attributes

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

Name Type Default Description
width {String} 100% The width of the component input
height {String} 34px The height of the component input
color {String} #d58512 The main color that the component elements will take, (Only in hexadecimal)

Thanks

cron-expression-input's People

Contributors

b-sudhakar avatar budyaya avatar danekolsen avatar dependabot[bot] avatar jossydevers avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.