@skedulo/sked-ui 19.10.1 → 19.12.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.
@@ -1,5 +1,5 @@
1
+ import { RangeType } from './elements/RangePicker';
1
2
  export declare type DateDirection = 'forward' | 'backward';
2
- export declare type RangeType = 'day' | '3-days' | '2-weeks' | 'week' | 'month';
3
3
  export declare const moveDate: (selected: Date, days: RangeType, direction: DateDirection) => Date;
4
4
  export declare const endOfPeriod: (selected: Date, selectedRange: RangeType) => Date;
5
5
  export declare const formatLongDate: (date: Date) => string;
@@ -1,55 +1,29 @@
1
1
  import * as React from 'react';
2
- import { RangeType as Range } from './CalendarControls-utils';
3
- export declare type RangeType = Range;
4
- declare type SelectDateHandler = (date: Date) => void;
5
- interface IRangeProps {
6
- selectedRange?: RangeType;
7
- onRangeChange?: (range: RangeType) => void;
8
- rangeOptions?: RangeType[];
9
- selected?: Date;
10
- }
11
- export interface ICalendarControlProps extends React.HTMLAttributes<HTMLDivElement> {
2
+ import { IDateSelectorProps } from './elements/DateSelector';
3
+ import { INavigationButtonProps } from './elements/NavigationButtons';
4
+ import { IRangeProps, RangePicker, RangeType } from './elements/RangePicker';
5
+ export interface IBaseCalendarControlProps {
12
6
  /**
13
- * The current focus date for the Calendar. If a range is provided this is the start of the range to render
14
- */
15
- selected: Date;
16
- /**
17
- * When a new range has been provided, this callback is triggered
7
+ * The current range to display. This will update the current range dropdown and the date range displayed
18
8
  */
19
- onRangeChange?: (range: RangeType) => void;
9
+ selectedRange?: RangeType;
20
10
  /**
21
- * Whenever the date is changed, either through direct select, clicking to or navigating, the new date is provided to this function
11
+ * The current focus date for the Calendar. If a range is provided this is the start of the range to render
22
12
  */
23
- onDateSelect?: SelectDateHandler;
13
+ selected?: Date;
14
+ }
15
+ export interface ICalendarControlProps extends React.HTMLAttributes<HTMLDivElement>, IDateSelectorProps, INavigationButtonProps, IRangeProps {
24
16
  /**
25
17
  * Whenever the user clicks the `Today` button this callback is triggered
26
18
  */
27
19
  onTodayClick?: () => void;
28
- /**
29
- * The callback handler when a Day in the datepicker dropdown is hovered
30
- */
31
- onDayMouseEnter?: SelectDateHandler;
32
- /**
33
- * The callback handler for when the mouse leaves the datepicker dropdown
34
- */
35
- onMonthMouseLeave?: () => void;
36
- /**
37
- * A day of a week to highlight. It will highlight from Sunday to Saturday of the weeks selected based on rangeOptions
38
- */
39
- highlightWeek?: Date;
40
- /**
41
- * Highlight the entire week of the currently selected date, from Sunday to Saturday based on rangeOptions
42
- */
43
- selectWeek?: boolean;
44
- /**
45
- * The current range to display. This will update the current range dropdown and the date range displayed
46
- */
47
- selectedRange?: RangeType;
48
- /**
49
- * The list of options that can be chosen from. Current range options are 'day', '3-days', 'week' and 'month'
50
- */
51
- rangeOptions?: RangeType[];
52
20
  }
53
- export declare const RangePicker: React.FC<IRangeProps>;
54
- export declare const CalendarControls: ({ selected, onDateSelect, onTodayClick, onDayMouseEnter, onMonthMouseLeave, highlightWeek, selectWeek, selectedRange, onRangeChange, rangeOptions, className, ...rest }: ICalendarControlProps) => JSX.Element;
55
- export {};
21
+ export declare function useCalendarControlsContext(): ICalendarControlProps;
22
+ declare function CalendarControls(props: ICalendarControlProps): JSX.Element;
23
+ declare namespace CalendarControls {
24
+ var TodayButton: React.FC<import("./elements/TodayButton").ITodayButtonProps>;
25
+ var NavigationButtons: React.FC<INavigationButtonProps>;
26
+ var DateSelector: React.FC<IDateSelectorProps>;
27
+ var RangePicker: React.FC<IRangeProps>;
28
+ }
29
+ export { CalendarControls, RangePicker };
@@ -0,0 +1,33 @@
1
+ import React, { HTMLAttributes } from 'react';
2
+ import { ButtonTypes } from '../../..';
3
+ import { IBaseCalendarControlProps } from '../CalendarControls';
4
+ export declare type SelectDateHandler = (date: Date) => void;
5
+ export interface IBaseDateSelectorProps extends IBaseCalendarControlProps {
6
+ /**
7
+ * Whenever the date is changed, either through direct select, clicking to or navigating, the new date is provided to this function
8
+ */
9
+ onDateSelect?: SelectDateHandler;
10
+ }
11
+ export interface IDateSelectorProps extends IBaseDateSelectorProps, HTMLAttributes<HTMLDivElement> {
12
+ /**
13
+ * The callback handler when a Day in the datepicker dropdown is hovered
14
+ */
15
+ onDayMouseEnter?: SelectDateHandler;
16
+ /**
17
+ * The callback handler for when the mouse leaves the datepicker dropdown
18
+ */
19
+ onMonthMouseLeave?: () => void;
20
+ /**
21
+ * A day of a week to highlight. It will highlight from Sunday to Saturday of the weeks selected based on rangeOptions
22
+ */
23
+ highlightWeek?: Date;
24
+ /**
25
+ * Highlight the entire week of the currently selected date, from Sunday to Saturday based on rangeOptions
26
+ */
27
+ selectWeek?: boolean;
28
+ /**
29
+ * The type of Datepicker custom input button to be displayed. Primary | Secondary | Transparent
30
+ */
31
+ buttonType?: ButtonTypes;
32
+ }
33
+ export declare const DateSelector: React.FC<IDateSelectorProps>;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { IBaseDateSelectorProps } from './DateSelector';
3
+ export interface INavigationButtonProps extends IBaseDateSelectorProps {
4
+ }
5
+ export declare const NavigationButtons: React.FC<INavigationButtonProps>;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { IBaseCalendarControlProps } from '../CalendarControls';
3
+ export interface IRangeProps extends IBaseCalendarControlProps {
4
+ /**
5
+ * When a new range has been provided, this callback is triggered
6
+ */
7
+ onRangeChange?: (range: RangeType) => void;
8
+ /**
9
+ * The list of options that can be chosen from. Current range options are 'day', '3-days', 'week' and 'month'
10
+ */
11
+ rangeOptions?: RangeType[];
12
+ }
13
+ export declare type RangeType = 'day' | '3-days' | '2-weeks' | 'week' | 'month';
14
+ export declare const dateRangeLabel: {
15
+ day: string;
16
+ '3-days': string;
17
+ week: string;
18
+ '2-weeks': string;
19
+ month: string;
20
+ };
21
+ export declare const RangePicker: React.FC<IRangeProps>;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export interface ITodayButtonProps {
3
+ onClick?: () => void;
4
+ }
5
+ export declare const TodayButton: React.FC<ITodayButtonProps>;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { ReactDatePickerProps } from 'react-datepicker';
3
- import { RangeType } from '../calendar-controls/CalendarControls';
3
+ import { RangeType } from '../calendar-controls/elements/RangePicker';
4
4
  export declare type LocaleType = 'AU' | 'US' | 'UK';
5
5
  export interface CustomInput extends React.PureComponent {
6
6
  value: Date;
@@ -12,6 +12,14 @@ interface ITextArea extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
12
12
  * Maximum rows
13
13
  */
14
14
  maxRows?: number;
15
+ /**
16
+ * Disable Content Length
17
+ */
18
+ disableContentLength?: boolean;
19
+ /**
20
+ * onChange listener
21
+ */
22
+ onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
15
23
  }
16
24
  export declare const TextArea: React.FunctionComponent<ITextArea>;
17
25
  export {};
@@ -1,4 +1,3 @@
1
- /// <reference types="lodash" />
2
1
  import * as React from 'react';
3
2
  import { IAnchorScores, ICursorOptions, ICursorPoints, Position as PositionType } from './info-window-utils';
4
3
  interface InfoWindowState {
@@ -127,9 +126,25 @@ export declare class InfoWindow extends React.PureComponent<IInfoWindowProps, IS
127
126
  detachEventListeners(): void;
128
127
  attachEventListeners(): void;
129
128
  computeStyles(): {
129
+ contentStyles: React.CSSProperties;
130
+ triangleStyles: React.CSSProperties;
130
131
  position: PositionType;
131
- triangleStyles: import("lodash").Dictionary<string>;
132
- contentStyles: import("lodash").Dictionary<string>;
132
+ } | {
133
+ position: PositionType;
134
+ triangleStyles: {
135
+ top: string;
136
+ left: string;
137
+ } | {
138
+ top: string;
139
+ left: string;
140
+ };
141
+ contentStyles: {
142
+ top: string;
143
+ left: string;
144
+ } | {
145
+ top: string;
146
+ left: string;
147
+ };
133
148
  };
134
149
  removeRenderingContainer(): void;
135
150
  createRenderContainer(): HTMLDivElement;
@@ -25,7 +25,7 @@ export declare class Tabs extends React.PureComponent<ITabsProps, ITabsState> {
25
25
  componentDidUpdate(prevProps: ITabsProps): Promise<void>;
26
26
  componentWillUnmount(): void;
27
27
  onFocusIn: (index: number, ref: React.RefObject<HTMLElement>, nesting: number) => () => void;
28
- onFocusOutDebounce: ((nesting: number) => void) & import("lodash").Cancelable;
28
+ onFocusOutDebounce: import("lodash").DebouncedFunc<(nesting: number) => void>;
29
29
  asyncSetState: (state: Partial<ITabsState>) => Promise<unknown>;
30
30
  onFocusOut: (nesting: number) => () => void;
31
31
  onSelect: () => void;