react-cron-generator 2.0.10 → 2.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,7 +9,9 @@ Package helps to build linux scheduler cron expression.
9
9
  [![npm version](https://badge.fury.io/js/react-cron-generator.svg)](https://badge.fury.io/js/react-cron-generator) ![Downloads](https://img.shields.io/npm/dm/react-cron-generator.svg)
10
10
  <a href="https://github.com/sojinantony01/react-spread-sheet/blob/main/LICENSE">
11
11
  <img src="https://img.shields.io/npm/l/react-cron-generator.svg" alt="license">
12
- </a>
12
+ </a> <span>E2E tests passing.</span>
13
+
14
+
13
15
 
14
16
  ```
15
17
  data = '* * * * * * *'
@@ -27,32 +29,25 @@ npm install react-cron-generator
27
29
 
28
30
 
29
31
  ```
30
- import React, { Component } from 'react'
32
+ import React, { useState } from 'react'
31
33
  import Cron from 'react-cron-generator'
32
34
  import 'react-cron-generator/dist/cron-builder.css'
33
35
 
34
36
 
35
- class App extends Component {
36
-
37
- constructor(props) {
38
- super(props);
39
- this.state = {
40
-
41
- };
42
- }
43
-
44
- render() {
45
- return (<div>
46
- <Cron
47
- onChange={(e)=> {this.setState({value:e});}}
48
- value={this.state.value}
49
- showResultText={true}
50
- showResultCron={true}
51
- />
52
-
53
- </div>)
54
- }
55
- }
37
+ const App = () => {
38
+ const [state, setState] = useState<State>({});
39
+
40
+ return (
41
+ <Cron
42
+ onChange={(e, text) => {
43
+ setState({ value: e });
44
+ }}
45
+ value={state.value}
46
+ showResultText={true}
47
+ showResultCron={true}
48
+ />
49
+ );
50
+ };
56
51
 
57
52
  export default App;
58
53
 
@@ -68,6 +63,7 @@ export default App;
68
63
  | translateFn | translate function callback | method | No
69
64
  | locale | locale for cronstrue | en | No
70
65
  | options | Options for Cron component, *Must pass a valid cron value for available headers | All available headers | No
66
+ | disabled | Disable cron selector | false | No
71
67
 
72
68
 
73
69
  **translateFn**
@@ -3,6 +3,7 @@ interface CustomCronProp {
3
3
  onChange(e: string[]): void;
4
4
  value: string[];
5
5
  translate(e: string): string;
6
+ disabled?: boolean;
6
7
  }
7
8
  declare const CustomCron: React.FunctionComponent<CustomCronProp>;
8
9
  export default CustomCron;
@@ -3,6 +3,7 @@ interface DailyCronProp {
3
3
  onChange(e?: string[]): void;
4
4
  value: string[];
5
5
  translate(e: string): string;
6
+ disabled?: boolean;
6
7
  }
7
8
  declare const DailyCron: FunctionComponent<DailyCronProp>;
8
9
  export default DailyCron;
@@ -3,6 +3,7 @@ interface HourlyCronProp {
3
3
  onChange(e?: string[]): void;
4
4
  value: string[];
5
5
  translate(e: string): string;
6
+ disabled?: boolean;
6
7
  }
7
8
  declare const HourlyCron: FunctionComponent<HourlyCronProp>;
8
9
  export default HourlyCron;
@@ -3,6 +3,7 @@ interface MinutesCronProp {
3
3
  onChange(e: string[]): void;
4
4
  value: string[];
5
5
  translate(e: string): string;
6
+ disabled?: boolean;
6
7
  }
7
8
  declare const MinutesCron: FunctionComponent<MinutesCronProp>;
8
9
  export default MinutesCron;
@@ -3,6 +3,7 @@ interface MonthlyCronProp {
3
3
  onChange(e?: string[]): void;
4
4
  value: string[];
5
5
  translate(e: string): string;
6
+ disabled?: boolean;
6
7
  }
7
8
  declare const MonthlyCron: FunctionComponent<MonthlyCronProp>;
8
9
  export default MonthlyCron;
@@ -3,6 +3,7 @@ interface WeeklyCronProp {
3
3
  onChange(e?: string[]): void;
4
4
  value: string[];
5
5
  translate(e: string): string;
6
+ disabled?: boolean;
6
7
  }
7
8
  declare const WeeklyCron: FunctionComponent<WeeklyCronProp>;
8
9
  export default WeeklyCron;
package/build/cron.d.ts CHANGED
@@ -11,6 +11,7 @@ interface CronProp {
11
11
  options?: {
12
12
  headers: HeaderKeyType[];
13
13
  };
14
+ disabled?: boolean;
14
15
  }
15
16
  declare const Cron: React.FunctionComponent<CronProp>;
16
17
  export default Cron;