@lemonadejs/calendar 3.6.0 → 5.2.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,8 +1,8 @@
1
1
  # JavaScript Calendar
2
2
 
3
- [Official website and documentation is here](https://lemonadejs.net/docs/plugins/calendar)
3
+ [Official JavaScript Calendar Documenation](https://lemonadejs.com/docs/plugins/calendar)
4
4
 
5
- Compatible with Vanilla JavaScript, LemonadeJS, React, Vue or Angular.
5
+ Compatible with Vanilla JavaScript, LemonadeJS, React, VueJS or Angular.
6
6
 
7
7
  # JavaScript Calendar
8
8
 
@@ -80,7 +80,7 @@ You can configure things such as calendar starting date, calendar events, and cu
80
80
 
81
81
  ## License
82
82
 
83
- The LemonadeJS [Reactive JavaScript Calendar](https://lemonadejs.net) is released under the MIT.
83
+ The LemonadeJS [Reactive JavaScript Calendar](https://lemonadejs.com/docs/plugins/calendar) is released under the MIT.
84
84
 
85
85
  ## Other Tools
86
86
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Official Type definitions for LemonadeJS plugins
3
- * https://lemonadejs.net
3
+ * https://lemonadejs.com
4
4
  * Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
5
  */
6
6
 
@@ -8,9 +8,9 @@ declare function Calendar(el: HTMLElement, options?: Calendar.Options): Calendar
8
8
 
9
9
  declare namespace Calendar {
10
10
  interface Options {
11
- /** Calendar type */
12
- type?: 'default' | 'inline';
13
- /** Date format */
11
+ /** Calendar type. Use picker for a responsive modal, auto to automatic detect screen size and open between default or picker. */
12
+ type?: 'default' | 'auto' | 'picker' | 'inline';
13
+ /** Date format. Excel like format dd/mm/yyyy */
14
14
  format?: string;
15
15
  /** Range picker */
16
16
  range?: boolean;
@@ -18,35 +18,85 @@ declare namespace Calendar {
18
18
  value?: number | string;
19
19
  /** Calendar value will be a excel-like number or a ISO string. Default false */
20
20
  numeric?: boolean;
21
- /** Bind the calendar to na HTML input element */
22
- input?: HTMLElement | object | 'auto';
23
- /** Footer. Default: true **/
21
+ /** Show Footer. Default: true **/
24
22
  footer?: boolean;
25
23
  /** Show hour and minute picker **/
26
24
  time?: boolean;
27
25
  /** Show grid mode. Default: false */
28
26
  grid?: boolean;
27
+ /** Placeholder */
28
+ placeholder?: string;
29
+ /** Disabled. Default false **/
30
+ disabled?: boolean;
31
+ /** Starting day. From 0-6 where zero is Sunday and six is Saturday */
32
+ startingDay?: number;
33
+ /** Valid range **/
34
+ validRange?: number[] | string[];
35
+ /** Calendar events data */
36
+ data?: Array<{date: string, [key: string]: any}>;
29
37
  /** Update view on mouse wheel. Default: true */
30
38
  wheel?: boolean;
31
- /** LemonadeJS on change event */
39
+ /** Bind the calendar to na HTML input element */
40
+ input?: HTMLElement | 'auto';
41
+ /** Create events and assing the calendar classes for the input. Default true */
42
+ initInput?: boolean;
43
+ /** Change value event */
32
44
  onchange?: (self: object, value: string) => void;
33
- /** LemonadeJS on update event */
45
+ /** Update view event */
34
46
  onupdate?: (self: object, value: string) => void;
47
+ /** Close event */
48
+ onclose?: (self: object, origin: string) => void;
49
+ /** Open event */
50
+ onopen?: (self: object) => void;
35
51
  /** React dedicated onChange event */
36
52
  onChange?: (e: Event) => void;
37
53
  }
38
54
 
39
55
  interface Instance {
40
56
  /** Calendar type */
41
- type?: 'default' | 'inline';
57
+ type?: 'default' | 'auto' | 'picker' | 'inline';
58
+ /** Date format */
59
+ format: string;
42
60
  /** Range picker */
43
- range?: boolean;
61
+ range: boolean;
44
62
  /** Value */
45
- value?: number | string;
63
+ value: number | string;
46
64
  /** Calendar value will be a excel-like number or a ISO string. Default false */
47
- numeric?: boolean;
65
+ numeric: boolean;
66
+ /** Footer. Default: true **/
67
+ footer: boolean;
68
+ /** Show hour and minute picker **/
69
+ time: boolean;
70
+ /** Show grid mode. Default: false */
71
+ grid: boolean;
72
+ /** Placeholder */
73
+ placeholder: string;
74
+ /** Disabled. Default false **/
75
+ disabled: boolean;
76
+ /** Update view on mouse wheel. Default: true */
77
+ wheel: boolean;
48
78
  /** Bind the calendar to na HTML input element */
49
- input?: HTMLElement;
79
+ input: HTMLElement;
80
+ /** Open the calendar modal */
81
+ open: () => void;
82
+ /** Open the calendar modal */
83
+ close: (options?: object) => void;
84
+ /** Calendar is closed */
85
+ isClosed?: () => boolean;
86
+ /** Change the view */
87
+ setView: (view: 'days' | 'months' | 'years') => void;
88
+ /** Go to the next month or year depending on the view */
89
+ next?: () => void;
90
+ /** Go to the previous month or year depending on the view */
91
+ prev?: () => void;
92
+ /** Reset the calendar value and close the modal when applicable */
93
+ reset?: () => void;
94
+ /** Get the current calendar value */
95
+ getValue?: () => string | number;
96
+ /** Set the current calendar value. Use number for Excel like numbers */
97
+ setValue?: (value: string | number) => void;
98
+ /** Accept the selected value on the calendar */
99
+ update?: () => void;
50
100
  }
51
101
  }
52
102