@mailstep/design-system 0.5.0-beta.6 → 0.5.0-beta.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mailstep/design-system",
3
- "version": "0.5.0-beta.6",
3
+ "version": "0.5.0-beta.7",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "./ui/index.js",
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { DatetimepickerProps } from './Datetime/DateTime';
3
2
  import { SpaceAround } from '../SpaceAround';
3
+ import { DatetimepickerProps } from './Datetime/types';
4
4
  export type DatePickerType = DatetimepickerProps & {
5
5
  onChange: (value: string | Date) => void;
6
6
  disabled?: boolean;
@@ -1,4 +1,7 @@
1
- export default class Datetime extends React.Component<any, any, any> {
1
+ import moment from 'moment';
2
+ import React from 'react';
3
+ import { DatetimepickerProps } from './types';
4
+ export default class Datetime extends React.Component<DatetimepickerProps> {
2
5
  static defaultProps: {
3
6
  onOpen: () => void;
4
7
  onClose: () => void;
@@ -25,31 +28,24 @@ export default class Datetime extends React.Component<any, any, any> {
25
28
  };
26
29
  static moment: typeof moment;
27
30
  constructor(props: any);
28
- state: {
29
- open: boolean;
30
- currentView: any;
31
- viewDate: any;
32
- selectedDate: any;
33
- inputValue: any;
34
- };
35
31
  render(): import("react/jsx-runtime").JSX.Element;
36
32
  renderInput(): import("react/jsx-runtime").JSX.Element | undefined;
37
- renderView(): any;
33
+ renderView(): JSX.Element;
38
34
  _renderCalendar: () => import("react/jsx-runtime").JSX.Element;
39
35
  getInitialState(): {
40
36
  open: boolean;
41
- currentView: any;
37
+ currentView: string;
42
38
  viewDate: any;
43
39
  selectedDate: any;
44
40
  inputValue: any;
45
41
  };
46
42
  getInitialViewDate(selectedDate: any): any;
47
43
  getInitialDate(): any;
48
- getInitialView(): any;
44
+ getInitialView(): string;
49
45
  parseDate(date: any, dateFormat: any): any;
50
46
  getClassName(): string;
51
47
  isOpen(): any;
52
- getUpdateOn(dateFormat: any): any;
48
+ getUpdateOn(dateFormat: any): string;
53
49
  getLocaleData(): any;
54
50
  getDateFormat(): any;
55
51
  getTimeFormat(): any;
@@ -74,7 +70,6 @@ export default class Datetime extends React.Component<any, any, any> {
74
70
  _handleClickOutside: () => void;
75
71
  localMoment(date: any, format: any, props: any): any;
76
72
  checkTZ(): void;
77
- tzWarning: boolean | undefined;
78
73
  componentDidUpdate(prevProps: any): void;
79
74
  regenerateDates(): void;
80
75
  getSelectedDate(): any;
@@ -86,7 +81,7 @@ export default class Datetime extends React.Component<any, any, any> {
86
81
  * @param dateType date
87
82
  * @public
88
83
  */
89
- public setViewDate(date: any): void;
84
+ setViewDate(date: any): void;
90
85
  /**
91
86
  * Set the view currently shown by the calendar. View modes shipped with react-datetime are 'years', 'months', 'days' and 'time'.
92
87
  * @param TYPES.string mode
@@ -98,5 +93,3 @@ export default class Datetime extends React.Component<any, any, any> {
98
93
  _onInputClick: (e: any) => void;
99
94
  callHandler(method: any, e: any): boolean;
100
95
  }
101
- import React from 'react';
102
- import moment from 'moment';
@@ -25,12 +25,12 @@ var __assign = (this && this.__assign) || function () {
25
25
  return __assign.apply(this, arguments);
26
26
  };
27
27
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
28
- /* eslint-disable */
28
+ // @ts-nocheck
29
29
  import moment from 'moment';
30
30
  import React from 'react';
31
- import DaysView from './views/DaysView.jsx';
32
- import MonthsView from './views/MonthsView.jsx';
33
- import YearsView from './views/YearsView.jsx';
31
+ import DaysView from './views/DaysView';
32
+ import MonthsView from './views/MonthsView';
33
+ import YearsView from './views/YearsView';
34
34
  import onClickOutside from 'react-onclickoutside';
35
35
  var viewModes = {
36
36
  YEARS: 'years',
@@ -0,0 +1,61 @@
1
+ import { FocusEvent, FocusEventHandler } from 'react';
2
+ import { Moment } from 'moment';
3
+ export type ViewMode = 'years' | 'months' | 'days' | 'time';
4
+ export interface TimeConstraint {
5
+ min: number;
6
+ max: number;
7
+ step: number;
8
+ }
9
+ export interface TimeConstraints {
10
+ hours?: TimeConstraint;
11
+ minutes?: TimeConstraint;
12
+ seconds?: TimeConstraint;
13
+ milliseconds?: TimeConstraint;
14
+ }
15
+ type EventOrValueHandler<Event> = (event: Event | Moment | string) => void;
16
+ export interface DatetimepickerProps {
17
+ value?: Date | string | Moment;
18
+ initialValue?: Date | string | Moment;
19
+ initialViewDate?: Date | string | Moment;
20
+ initialViewMode?: ViewMode;
21
+ updateOnView?: string;
22
+ dateFormat?: boolean | string;
23
+ timeFormat?: boolean | string;
24
+ input?: boolean;
25
+ open?: boolean;
26
+ locale?: string;
27
+ utc?: boolean;
28
+ displayTimeZone?: string;
29
+ onChange?: (value: Moment | string) => void;
30
+ onOpen?: FocusEventHandler<any>;
31
+ onClose?: EventOrValueHandler<FocusEvent<any>>;
32
+ onNavigate?: (viewMode: string) => void;
33
+ onBeforeNavigate?: (nextView: string, currentView: string, viewDate: Moment) => string;
34
+ onNavigateBack?: (amount: number, type: string) => void;
35
+ onNavigateForward?: (amount: number, type: string) => void;
36
+ className?: string;
37
+ inputProps?: React.HTMLProps<HTMLInputElement>;
38
+ isValidDate?: (currentDate: any, selectedDate: any) => boolean;
39
+ renderView?: (viewMode: string, renderCalendar: Function) => JSX.Element;
40
+ renderDay?: (props: any, currentDate: any, selectedDate: any) => JSX.Element;
41
+ renderMonth?: (props: any, month: number, year: number, selectedDate: any) => JSX.Element;
42
+ renderYear?: (props: any, year: number, selectedDate: any) => JSX.Element;
43
+ renderInput?: (props: any, openCalendar: Function, closeCalendar: Function) => JSX.Element;
44
+ strictParsing?: boolean;
45
+ closeOnSelect?: boolean;
46
+ timeConstraints?: TimeConstraints;
47
+ closeOnClickOutside?: boolean;
48
+ secondValue?: Date | null;
49
+ label?: string;
50
+ }
51
+ export interface DatetimepickerState {
52
+ updateOn: string;
53
+ inputFormat: string;
54
+ viewDate: Moment;
55
+ selectedDate: Moment;
56
+ inputValue: string;
57
+ open: boolean;
58
+ secondValue?: Date | null;
59
+ label?: string;
60
+ }
61
+ export {};
@@ -0,0 +1,7 @@
1
+ // Type definitions for react-datetime
2
+ // Project: https://github.com/arqex/react-datetime
3
+ // Definitions by: Ivan Verevkin <vereva@x-root.org>
4
+ // Updates by: Aaron Spaulding <aaron@sachimp.com>,
5
+ // Karol Janyst <http://github.com/LKay>,
6
+ // Javier Marquez <javi@arqex.com>
7
+ export {};