react-cron-generator 2.0.19 → 2.1.0

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
@@ -1,109 +1,374 @@
1
- # react-cron-generator
1
+ # 🕐 React Cron Generator
2
2
 
3
- Simple react component to generate cron expression
3
+ > A powerful, user-friendly React component for building cron expressions with support for both Unix and Quartz formats
4
4
 
5
- ## Getting Started
5
+ [![npm version](https://badge.fury.io/js/react-cron-generator.svg)](https://badge.fury.io/js/react-cron-generator)
6
+ ![Downloads](https://img.shields.io/npm/dm/react-cron-generator.svg)
7
+ [![license](https://img.shields.io/npm/l/react-cron-generator.svg)](https://github.com/sojinantony01/react-cron-generator/blob/main/LICENSE)
8
+ ![React](https://img.shields.io/badge/React-16.8%2B%20%7C%2017%20%7C%2018%20%7C%2019-blue)
9
+ [![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue)](https://www.typescriptlang.org/)
6
10
 
7
- Package helps to build linux scheduler cron expression.
11
+ ## 🎮 [Try it Live!](https://sojinantony01.github.io/react-cron-generator/)
8
12
 
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
- <a href="https://github.com/sojinantony01/react-spread-sheet/blob/main/LICENSE">
11
- <img src="https://img.shields.io/npm/l/react-cron-generator.svg" alt="license">
12
- </a> <span>E2E tests passing.</span>
13
+ **[Interactive Demo →](https://sojinantony01.github.io/react-cron-generator/)**
13
14
 
15
+ ## ✨ Features
14
16
 
17
+ - 🎯 **Dual Format Support** - Works with both Unix (5 fields) and Quartz (7 fields) cron formats
18
+ - 🔄 **Automatic Conversion** - Seamlessly convert between Unix and Quartz formats
19
+ - ✅ **Built-in Validation** - Comprehensive cron expression validation
20
+ - 🌍 **Internationalization** - Full i18n support with custom translation functions
21
+ - ♿ **Accessible** - WCAG compliant with keyboard navigation and screen reader support
22
+ - 📱 **Responsive** - Mobile-friendly design that works on all devices
23
+ - 🎨 **Customizable** - Easy to style and configure
24
+ - 🔒 **Type Safe** - Full TypeScript support with comprehensive type definitions
25
+ - ⚡ **Performance Optimized** - Memoized computations and efficient re-renders
26
+ - 🛡️ **Error Boundaries** - Graceful error handling built-in
15
27
 
16
- ```
17
- data = '* * * * * * *'
18
- ```
19
- ```
28
+ ## 📦 Installation
29
+
30
+ ```bash
20
31
  npm install react-cron-generator
32
+ ```
21
33
 
34
+ or
35
+
36
+ ```bash
37
+ yarn add react-cron-generator
22
38
  ```
23
- ## demo
24
- [Live demo](https://sojinantony01.github.io/react-cron-generator/)
25
39
 
26
- ![alt text](https://raw.githubusercontent.com/sojinantony01/react-cron-generator/master/public/images/Screenshot%20from%202019-06-08%2000-31-31.png)
40
+ ## 🚀 Quick Start
41
+
42
+ ### Basic Usage (Quartz Format)
27
43
 
28
- ![alt text](https://raw.githubusercontent.com/sojinantony01/react-cron-generator/master/public/images/Screenshot%20from%202019-06-08%2000-31-57.png)
44
+ ```jsx
45
+ import React, { useState } from 'react';
46
+ import Cron from 'react-cron-generator';
47
+ import 'react-cron-generator/dist/cron-builder.css';
29
48
 
49
+ function App() {
50
+ const [value, setValue] = useState('0 0 00 1/1 * ? *');
30
51
 
52
+ return (
53
+ <Cron
54
+ onChange={(cronValue, humanReadable) => {
55
+ setValue(cronValue);
56
+ console.log('Cron:', cronValue);
57
+ console.log('Human:', humanReadable);
58
+ }}
59
+ value={value}
60
+ showResultText={true}
61
+ showResultCron={true}
62
+ />
63
+ );
64
+ }
31
65
  ```
32
- import React, { useState } from 'react'
33
- import Cron from 'react-cron-generator'
34
- import 'react-cron-generator/dist/cron-builder.css'
35
66
 
67
+ ### Unix Format
36
68
 
37
- const App = () => {
38
- const [state, setState] = useState<State>({});
69
+ ```jsx
70
+ import React, { useState } from 'react';
71
+ import Cron from 'react-cron-generator';
72
+ import 'react-cron-generator/dist/cron-builder.css';
73
+
74
+ function App() {
75
+ const [value, setValue] = useState('*/5 * * * *');
39
76
 
40
77
  return (
41
78
  <Cron
42
- onChange={(e, text) => {
43
- setState({ value: e });
79
+ onChange={(cronValue, humanReadable) => {
80
+ setValue(cronValue);
44
81
  }}
45
- value={state.value}
82
+ value={value}
46
83
  showResultText={true}
47
84
  showResultCron={true}
85
+ isUnix={true} // Enable Unix format
48
86
  />
49
87
  );
50
- };
51
-
52
- export default App;
88
+ }
89
+ ```
53
90
 
91
+ ## 📖 Documentation
92
+
93
+ ### Props
94
+
95
+ | Prop | Type | Default | Description |
96
+ |------|------|---------|-------------|
97
+ | `value` | `string` | `undefined` | Initial cron expression (Unix: 5 fields, Quartz: 6 or 7 fields) |
98
+ | `onChange` | `(value: string, text: string) => void` | **Required** | Callback fired when cron value changes. Receives cron expression and human-readable text |
99
+ | `showResultText` | `boolean` | `false` | Display human-readable description below the builder |
100
+ | `showResultCron` | `boolean` | `false` | Display the cron expression below the builder |
101
+ | `isUnix` | `boolean` | `false` | Use Unix format (5 fields) instead of Quartz. **Cannot be used with `use6FieldQuartz`** |
102
+ | `use6FieldQuartz` | `boolean` | `false` | Use 6-field Quartz format instead of 7-field. **Cannot be used with `isUnix`** |
103
+ | `translateFn` | `(key: string) => string` | `undefined` | Custom translation function for i18n support |
104
+ | `locale` | `string` | `'en'` | Locale for cronstrue (human-readable text) |
105
+ | `options` | `{ headers: HeaderType[] }` | All headers | Customize which tabs are available |
106
+ | `disabled` | `boolean` | `false` | Disable the entire component |
107
+
108
+ ### Format Comparison
109
+
110
+ | Feature | Unix (5 fields) | Quartz (6 fields) | Quartz (7 fields) |
111
+ |---------|----------------|-------------------|-------------------|
112
+ | **Format** | `minute hour day month day-of-week` | `second minute hour day month day-of-week` | `second minute hour day month day-of-week year` |
113
+ | **Example** | `*/5 * * * *` | `0 */5 * * * ?` | `0 0/5 * * * ? *` |
114
+ | **Day of Week** | 0-6 (Sunday=0) | 1-7 (Sunday=1) or SUN-SAT | 1-7 (Sunday=1) or SUN-SAT |
115
+ | **Special Chars** | `* , - /` | `* , - / ? L W #` | `* , - / ? L W #` |
116
+ | **Used By** | Linux/Unix cron, most cron implementations | Quartz Scheduler (legacy) | Quartz Scheduler, Spring Framework, Java apps |
117
+
118
+ ### 6-Field Quartz Format Support
119
+
120
+ The component supports both 6-field and 7-field Quartz formats:
121
+
122
+ - **6-field format**: `second minute hour day month day-of-week` (e.g., `0 0 12 * * ?`)
123
+ - **7-field format**: `second minute hour day month day-of-week year` (e.g., `0 0 12 * * ? *`)
124
+
125
+ **Format Behavior:**
126
+
127
+ The `use6FieldQuartz` prop controls the output format:
128
+
129
+ ```jsx
130
+ // Default: 7-field Quartz format
131
+ <Cron
132
+ value="0 0 12 * * ?" // 6-field input
133
+ onChange={(value) => {
134
+ console.log(value); // "0 0 12 * * ? *" - converted to 7-field
135
+ }}
136
+ showResultText={true}
137
+ showResultCron={true}
138
+ />
139
+
140
+ // Explicitly use 6-field Quartz format
141
+ <Cron
142
+ value="0 0 12 * * ? *" // 7-field input
143
+ onChange={(value) => {
144
+ console.log(value); // "0 0 12 * * ?" - converted to 6-field
145
+ }}
146
+ showResultText={true}
147
+ showResultCron={true}
148
+ use6FieldQuartz={true} // Enable 6-field format
149
+ />
54
150
  ```
55
- ## props
56
151
 
57
- | Prop | Description | Default | Mandatory
58
- | --- | --- | -- | -- |
59
- | value | cron expression | | No |
60
- | onChange | have 2 arguments, 1st is cron value and 2nd is cron result text from cronstrue | | Yes
61
- | showResultText | show in readable text format | false | No
62
- | showResultCron | show cron expression | false | No
63
- | translateFn | translate function callback | method | No
64
- | locale | locale for cronstrue | en | No
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
152
+ **Rules:**
153
+ - **`use6FieldQuartz={false}` (default)**: Always outputs 7-field format, even if 6-field input is provided
154
+ - **`use6FieldQuartz={true}`**: Always outputs 6-field format, even if 7-field input is provided
155
+ - Cannot use both `isUnix={true}` and `use6FieldQuartz={true}` together - this will throw an error
156
+ - Internally, the component always works with 7-field format for processing
67
157
 
158
+ ## 🔧 Advanced Usage
68
159
 
69
- **translateFn**
160
+ ### Format Conversion
70
161
 
71
- Expects a method. Use this prop for localization support. `react-cron-generator` will call this method for every key. List of keys are available [here](https://github.com/sojinantony01/react-cron-generator/tree/master/src/lib/localization/translation.json)
162
+ ```jsx
163
+ import {
164
+ unixToQuartz,
165
+ quartzToUnix,
166
+ detectCronFormat
167
+ } from 'react-cron-generator';
72
168
 
73
- `locale` option should be set for correct `ResultText` translation. Please visit [cronstrue](https://github.com/bradymholt/cRonstrue) for supported locales.
169
+ // Convert Unix to Quartz
170
+ const quartzCron = unixToQuartz('*/5 * * * *');
171
+ console.log(quartzCron); // '0 */5 * * * ? *'
74
172
 
75
- ## Options
173
+ // Convert Quartz to Unix
174
+ const unixCron = quartzToUnix('0 0/5 * * * ? *');
175
+ console.log(unixCron); // '*/5 * * * *'
76
176
 
77
- **options.headers**
177
+ // Auto-detect format
178
+ const format = detectCronFormat('*/5 * * * *');
179
+ console.log(format); // 'unix'
180
+ ```
181
+
182
+ ### Validation
183
+
184
+ ```jsx
185
+ import { validateCron } from 'react-cron-generator';
78
186
 
187
+ // Validate any format (auto-detects Unix or Quartz)
188
+ const result = validateCron('*/5 * * * *');
189
+ console.log(result);
190
+ // { isValid: true, format: 'unix' }
191
+
192
+ // Check validation result
193
+ if (result.isValid) {
194
+ console.log('Valid cron expression!');
195
+ } else {
196
+ console.error('Invalid:', result.error);
197
+ }
79
198
  ```
80
- import { HEADER } from 'react-cron-generator';
199
+
200
+ ### Custom Tabs
201
+
202
+ ```jsx
203
+ import Cron, { HEADER } from 'react-cron-generator';
81
204
 
82
205
  const options = {
83
- headers: [HEADER.MONTHLY, HEADER.WEEKLY, HEADER.MINUTES, HEADER.HOURLY, HEADER.DAILY, HEADER.CUSTOM]
206
+ headers: [
207
+ HEADER.MINUTES,
208
+ HEADER.HOURLY,
209
+ HEADER.DAILY,
210
+ HEADER.WEEKLY,
211
+ HEADER.MONTHLY,
212
+ HEADER.CUSTOM
213
+ ]
84
214
  };
85
215
 
216
+ <Cron options={options} {...otherProps} />
217
+ ```
218
+
219
+ ### Internationalization
220
+
221
+ ```jsx
222
+ import Cron from 'react-cron-generator';
223
+
224
+ const translations = {
225
+ 'Every': 'Cada',
226
+ 'minute(s)': 'minuto(s)',
227
+ // ... more translations
228
+ };
229
+
230
+ function translateFn(key) {
231
+ return translations[key] || key;
232
+ }
233
+
234
+ <Cron
235
+ translateFn={translateFn}
236
+ locale="es" // For cronstrue
237
+ {...otherProps}
238
+ />
239
+ ```
240
+
241
+
242
+ ## 🎨 Styling
243
+
244
+ The component comes with default styles. Import the CSS file:
245
+
246
+ ```jsx
247
+ import 'react-cron-generator/dist/cron-builder.css';
86
248
  ```
87
249
 
88
- ## Importables
250
+ You can override styles by targeting the CSS classes:
251
+
252
+ ```css
253
+ .cron_builder {
254
+ /* Your custom styles */
255
+ }
256
+
257
+ .cron_builder .nav-link {
258
+ /* Customize tabs */
259
+ }
260
+
261
+ .cron_builder_bordering {
262
+ /* Customize content area */
263
+ }
264
+ ```
265
+
266
+ ## 📚 API Reference
267
+
268
+ ### Exported Components
269
+
270
+ - `Cron` - Main cron builder component (default export)
271
+
272
+ ### Exported Utilities
273
+
274
+ - `unixToQuartz(cron: string): string` - Convert Unix to Quartz format
275
+ - `quartzToUnix(cron: string): string` - Convert Quartz to Unix format
276
+ - `detectCronFormat(cron: string): 'unix' | 'quartz'` - Detect cron format
277
+ - `validateCron(cron: string): ValidationResult` - Validate any cron format (auto-detects Unix or Quartz)
278
+ - `HEADER` - Constants for tab headers
279
+ - `cronstrue` - Human-readable cron descriptions (from cronstrue/i18n)
280
+
281
+ ### Exported Types
282
+
283
+ - `CronProps` - Props for Cron component
284
+ - `CronFormat` - 'unix' | 'quartz'
285
+ - `CronValidationResult` - Validation result interface
286
+ - `TranslateFn` - Translation function type
287
+ - And many more...
288
+
289
+ ## 🎯 Examples
290
+
291
+ ### Example 1: Every 5 Minutes
292
+
293
+ **Unix:** `*/5 * * * *`
294
+ **Quartz:** `0 0/5 * * * ? *`
295
+ **Human:** "Every 5 minutes"
296
+
297
+ ### Example 2: Every Day at 2:30 PM
298
+
299
+ **Unix:** `30 14 * * *`
300
+ **Quartz:** `0 30 14 * * ? *`
301
+ **Human:** "At 02:30 PM"
302
+
303
+ ### Example 3: Every Monday at 9:00 AM
304
+
305
+ **Unix:** `0 9 * * 1`
306
+ **Quartz:** `0 0 9 ? * MON *`
307
+ **Human:** "At 09:00 AM, only on Monday"
308
+
309
+ ### Example 4: First Day of Every Month
310
+
311
+ **Unix:** `0 0 1 * *`
312
+ **Quartz:** `0 0 0 1 * ? *`
313
+ **Human:** "At 12:00 AM, on day 1 of the month"
314
+
315
+ ## 🔍 Browser Support
316
+
317
+ - Chrome (latest)
318
+ - Firefox (latest)
319
+ - Safari (latest)
320
+ - Edge (latest)
321
+ - Mobile browsers
322
+
323
+ ## 🤝 Contributing
324
+
325
+ Contributions are welcome! Please feel free to submit a Pull Request.
326
+
327
+ 1. Fork the repository
328
+ 2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
329
+ 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
330
+ 4. Push to the branch (`git push origin feature/AmazingFeature`)
331
+ 5. Open a Pull Request
332
+
333
+ ## 📝 License
334
+
335
+ This project is licensed under the ISC License - see the [LICENSE](LICENSE) file for details.
336
+
337
+ ## 🙏 Acknowledgments
338
+
339
+ - [cronstrue](https://github.com/bradymholt/cRonstrue) - For human-readable cron descriptions
340
+ - [Viswanath Lekshmanan](https://viswanathl.in/) - Original inspiration
341
+
342
+ ## 👨‍💻 Author
343
+
344
+ **Sojin Antony**
345
+
346
+ - GitHub: [@sojinantony01](https://github.com/sojinantony01)
347
+ - Buy me a coffee: [!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-1.svg)](https://www.buymeacoffee.com/sojinantony)
348
+
349
+ ## 🌟 Show Your Support
350
+
351
+ Give a ⭐️ if this project helped you!
89
352
 
90
- Cron - The react Cron component. - Default
91
- CronProp - Cron component types.
92
- cronsture - Cronsture/i18 - [cronstrue](https://www.npmjs.com/package/cronstrue)
353
+ ## 📊 Stats
93
354
 
355
+ ![npm](https://img.shields.io/npm/dt/react-cron-generator)
356
+ ![GitHub stars](https://img.shields.io/github/stars/sojinantony01/react-cron-generator)
357
+ ![GitHub issues](https://img.shields.io/github/issues/sojinantony01/react-cron-generator)
94
358
 
95
- ## Release notes 2.x.x
96
- 1. Build Procedure updated
97
- 2. Updated to latest react(18)
98
- 3. Migrated to hooks and typescript
359
+ ## 🔗 Links
99
360
 
100
- [Sojin Antony](https://github.com/sojinantony01)
361
+ - [Live Demo](https://sojinantony01.github.io/react-cron-generator/)
362
+ - [NPM Package](https://www.npmjs.com/package/react-cron-generator)
363
+ - [GitHub Repository](https://github.com/sojinantony01/react-cron-generator)
364
+ - [Issue Tracker](https://github.com/sojinantony01/react-cron-generator/issues)
101
365
 
102
- [!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-1.svg)](https://www.buymeacoffee.com/sojinantony)
366
+ ## 📸 Screenshots
103
367
 
368
+ ![Cron Generator Interface](https://raw.githubusercontent.com/sojinantony01/react-cron-generator/master/public/images/Screenshot%20from%202019-06-08%2000-31-31.png)
104
369
 
105
- ## Acknowledgments
370
+ ![Cron Generator Options](https://raw.githubusercontent.com/sojinantony01/react-cron-generator/master/public/images/Screenshot%20from%202019-06-08%2000-31-57.png)
106
371
 
107
- **cronstrue**
372
+ ---
108
373
 
109
- [Viswanath Lekshmanan](https://viswanathl.in/)
374
+ Made with ❤️ by [Sojin Antony](https://github.com/sojinantony01)
@@ -4,6 +4,8 @@ interface CustomCronProp {
4
4
  value: string[];
5
5
  translate(e: string): string;
6
6
  disabled?: boolean;
7
+ isUnix?: boolean;
7
8
  }
8
9
  declare const CustomCron: React.FunctionComponent<CustomCronProp>;
9
10
  export default CustomCron;
11
+ //# sourceMappingURL=custom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom.d.ts","sourceRoot":"","sources":["../../src/lib/cron-tab/custom.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,UAAU,cAAc;IACtB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC5B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAevD,CAAC;AACF,eAAe,UAAU,CAAC"}
@@ -4,6 +4,8 @@ interface DailyCronProp {
4
4
  value: string[];
5
5
  translate(e: string): string;
6
6
  disabled?: boolean;
7
+ isUnix?: boolean;
7
8
  }
8
9
  declare const DailyCron: FunctionComponent<DailyCronProp>;
9
10
  export default DailyCron;
11
+ //# sourceMappingURL=daily.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"daily.d.ts","sourceRoot":"","sources":["../../src/lib/cron-tab/daily.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,iBAAiB,EAAuB,MAAM,OAAO,CAAC;AAItE,UAAU,aAAa;IACrB,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC7B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAMD,QAAA,MAAM,SAAS,EAAE,iBAAiB,CAAC,aAAa,CAmG/C,CAAC;AACF,eAAe,SAAS,CAAC"}
@@ -4,6 +4,8 @@ interface HourlyCronProp {
4
4
  value: string[];
5
5
  translate(e: string): string;
6
6
  disabled?: boolean;
7
+ isUnix?: boolean;
7
8
  }
8
9
  declare const HourlyCron: FunctionComponent<HourlyCronProp>;
9
10
  export default HourlyCron;
11
+ //# sourceMappingURL=hourly.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hourly.d.ts","sourceRoot":"","sources":["../../src/lib/cron-tab/hourly.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,iBAAiB,EAAuB,MAAM,OAAO,CAAC;AAItE,UAAU,cAAc;IACtB,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC7B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAID,QAAA,MAAM,UAAU,EAAE,iBAAiB,CAAC,cAAc,CA6HjD,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -4,6 +4,8 @@ interface MinutesCronProp {
4
4
  value: string[];
5
5
  translate(e: string): string;
6
6
  disabled?: boolean;
7
+ isUnix?: boolean;
7
8
  }
8
9
  declare const MinutesCron: FunctionComponent<MinutesCronProp>;
9
10
  export default MinutesCron;
11
+ //# sourceMappingURL=minutes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"minutes.d.ts","sourceRoot":"","sources":["../../src/lib/cron-tab/minutes.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEjD,UAAU,eAAe;IACvB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC5B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,QAAA,MAAM,WAAW,EAAE,iBAAiB,CAAC,eAAe,CAkCnD,CAAC;AACF,eAAe,WAAW,CAAC"}
@@ -4,6 +4,8 @@ interface MonthlyCronProp {
4
4
  value: string[];
5
5
  translate(e: string): string;
6
6
  disabled?: boolean;
7
+ isUnix?: boolean;
7
8
  }
8
9
  declare const MonthlyCron: FunctionComponent<MonthlyCronProp>;
9
10
  export default MonthlyCron;
11
+ //# sourceMappingURL=monthly.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"monthly.d.ts","sourceRoot":"","sources":["../../src/lib/cron-tab/monthly.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,iBAAiB,EAAuB,MAAM,OAAO,CAAC;AAKtE,UAAU,eAAe;IACvB,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC7B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAMD,QAAA,MAAM,WAAW,EAAE,iBAAiB,CAAC,eAAe,CA8SnD,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -4,6 +4,8 @@ interface WeeklyCronProp {
4
4
  value: string[];
5
5
  translate(e: string): string;
6
6
  disabled?: boolean;
7
+ isUnix?: boolean;
7
8
  }
8
9
  declare const WeeklyCron: FunctionComponent<WeeklyCronProp>;
9
10
  export default WeeklyCron;
11
+ //# sourceMappingURL=weekly.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weekly.d.ts","sourceRoot":"","sources":["../../src/lib/cron-tab/weekly.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAIjD,UAAU,cAAc;IACtB,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC7B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,QAAA,MAAM,UAAU,EAAE,iBAAiB,CAAC,cAAc,CAuKjD,CAAC;AAEF,eAAe,UAAU,CAAC"}
package/build/cron.d.ts CHANGED
@@ -12,6 +12,9 @@ export interface CronProp {
12
12
  headers: HeaderKeyType[];
13
13
  };
14
14
  disabled?: boolean;
15
+ isUnix?: boolean;
16
+ use6FieldQuartz?: boolean;
15
17
  }
16
18
  declare const Cron: React.FunctionComponent<CronProp>;
17
19
  export default Cron;
20
+ //# sourceMappingURL=cron.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cron.d.ts","sourceRoot":"","sources":["../src/lib/cron.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAEjF,OAAO,EAAyB,aAAa,EAAiB,MAAM,QAAQ,CAAC;AAI7E,OAAO,oBAAoB,CAAC;AAE5B,MAAM,WAAW,QAAQ;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,aAAa,EAAE,CAAA;KAAE,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAeD,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,iBAAiB,CAAC,QAAQ,CAoX3C,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,2 @@
1
+ import '@testing-library/jest-dom';
2
+ //# sourceMappingURL=cron.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cron.test.d.ts","sourceRoot":"","sources":["../src/lib/cron.test.tsx"],"names":[],"mappings":"AAGA,OAAO,2BAA2B,CAAC"}
@@ -4,11 +4,14 @@ type DaySelectProp = {
4
4
  onChange(value: null | string): void;
5
5
  value: string;
6
6
  multi?: false;
7
+ onFocus?: () => void;
7
8
  } | {
8
9
  multi: true;
9
10
  disabled?: boolean;
10
11
  onChange(value: string[]): void;
11
12
  value: string[];
13
+ onFocus?: () => void;
12
14
  };
13
15
  declare const DaySelect: React.FunctionComponent<DaySelectProp>;
14
16
  export default DaySelect;
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/day-select/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,KAAK,aAAa,GACd;IACE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,GACD;IACE,KAAK,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAChC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEN,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,iBAAiB,CAAC,aAAa,CA6ErD,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -6,3 +6,4 @@ interface HourSelectProp {
6
6
  }
7
7
  declare const HourSelect: React.FunctionComponent<HourSelectProp>;
8
8
  export default HourSelect;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/hour-select/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,UAAU,cAAc;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;IACtD,KAAK,EAAE,MAAM,CAAC;CACf;AACD,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAuBvD,CAAC;AAEF,eAAe,UAAU,CAAC"}
package/build/index.d.ts CHANGED
@@ -1,6 +1,10 @@
1
1
  import Cron, { CronProp } from './cron';
2
2
  import { HEADER } from './meta';
3
3
  import cronstrue from 'cronstrue/i18n';
4
- export { HEADER, cronstrue };
4
+ import { unixToQuartz, quartzToUnix, detectCronFormat } from './utils/cron-converter';
5
+ import { validateCron } from './utils/cron-validator';
6
+ export { HEADER, cronstrue, unixToQuartz, quartzToUnix, detectCronFormat, validateCron };
5
7
  export type { CronProp };
8
+ export * from './types';
6
9
  export default Cron;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,CAAC;AAGzF,YAAY,EAAE,QAAQ,EAAE,CAAC;AACzB,cAAc,SAAS,CAAC;AAGxB,eAAe,IAAI,CAAC"}