kwant-ui 3.38.1-dev.9 → 3.39.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
1
  import { DateObject } from 'react-multi-date-picker';
2
- import { ICalendar } from './CalendarTypes';
2
+ import { CalendarTimeBarProps, ICalendar } from './CalendarTypes';
3
3
  export type SidebarOptionProps = ICalendar.SidebarOptionProps;
4
4
  export declare const SidebarOption: ({ title, selected, onClick }: SidebarOptionProps) => import("react/jsx-runtime").JSX.Element;
5
5
  export declare const CalendarSidebar: ({ options, selectedOption, onOptionClick, }: {
@@ -7,4 +7,5 @@ export declare const CalendarSidebar: ({ options, selectedOption, onOptionClick,
7
7
  selectedOption: string;
8
8
  onOptionClick?: (value: () => DateObject[], option?: Pick<SidebarOptionProps, 'title' | 'selected' | 'value'>) => void;
9
9
  }) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const CalendarTimeBar: ({ label, timeHour, timeMinute, clockType, disabled, onClockTypeChange, onHourChange, onMinuteChange, }: CalendarTimeBarProps) => import("react/jsx-runtime").JSX.Element;
10
11
  export declare const renderDatepickerNavigationButton: (direction: ICalendar.DatpickerNavigationDirection, handleClick: (event: React.MouseEvent<HTMLButtonElement>) => void) => import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,41 @@
1
+ /// <reference types="react" />
1
2
  export declare const CalendarWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
2
3
  export declare const CalendarSidebarStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
3
4
  export declare const CalendarSidebarOptions: import("styled-components").StyledComponent<"button", any, {
4
5
  selected?: boolean;
5
6
  }, never>;
7
+ export declare const CalendarTimebar: import("styled-components").StyledComponent<"div", any, {}, never>;
8
+ export declare const StyledInput: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("react").InputHTMLAttributes<HTMLInputElement> & {
9
+ onClick?: (event: import("react").MouseEvent<HTMLInputElement, MouseEvent>) => void;
10
+ onChange?: (event: import("react").ChangeEvent<HTMLInputElement>) => void;
11
+ disabled?: boolean;
12
+ value?: string | number;
13
+ name?: string;
14
+ type?: string;
15
+ required?: boolean;
16
+ readOnly?: boolean;
17
+ label?: string;
18
+ errorMessage?: string;
19
+ error?: boolean;
20
+ id?: string;
21
+ helperText?: string;
22
+ onBlur?: (e: import("react").FocusEvent<HTMLInputElement, Element>) => void;
23
+ onFocus?: (e: import("react").FocusEvent<HTMLInputElement, Element>) => void;
24
+ rightSection?: import("react").ReactNode;
25
+ leftSection?: import("react").ReactNode;
26
+ width?: number;
27
+ variant?: import("../Input/types").InputComponent.InputVariant;
28
+ tooltipContent?: string;
29
+ tooltipPosition?: import("../Tooltip/types").TooltipComponent.Position;
30
+ } & import("react").RefAttributes<HTMLInputElement>>, any, {}, never>;
31
+ export declare const Colon: import("styled-components").StyledComponent<"div", any, {}, never>;
32
+ export declare const InputGroup: import("styled-components").StyledComponent<"div", any, {}, never>;
33
+ export declare const SelectorStyled: import("styled-components").StyledComponent<({ content, activeKey, onClick, height, multiple, disabled, }: import("../Selector/types").SelectorComponent.Props) => import("react/jsx-runtime").JSX.Element, any, {}, never>;
34
+ export declare const TimeBarContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
35
+ export declare const TopLabel: import("styled-components").StyledComponent<"label", any, import("../Label/types").LabelComponent.Label, never>;
36
+ export declare const TimeBarStyled: import("styled-components").StyledComponent<"div", any, {
37
+ showTime?: boolean;
38
+ }, never>;
6
39
  declare const DatepickerNavigationButton: import("styled-components").StyledComponent<"button", any, {}, never>;
7
40
  declare const IconWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
8
41
  export { DatepickerNavigationButton, IconWrapper };
@@ -7,14 +7,38 @@ export declare namespace ICalendar {
7
7
  range?: boolean;
8
8
  numberOfMonths?: number;
9
9
  calenderRef?: any;
10
+ labels?: string;
10
11
  showSidebar?: boolean;
12
+ showTime?: boolean;
13
+ disableTime?: boolean;
14
+ time?: {
15
+ from: {
16
+ hour: string;
17
+ minute: string;
18
+ clockType: ClockType;
19
+ };
20
+ to: {
21
+ hour: string;
22
+ minute: string;
23
+ clockType: ClockType;
24
+ };
25
+ };
26
+ onHourChange?: (key: string, value: string) => void;
27
+ onMinuteChange?: (key: string, value: string) => void;
28
+ onClockTypeChange?: (key: string, value: string) => void;
11
29
  sidebarOptions?: Omit<SidebarOptionProps, 'onClick'>[];
12
30
  projectDuration?: ProjectDuration;
13
31
  disableFutureDatesOnCustomRange?: boolean;
14
32
  selectedSidebarOption?: string;
15
33
  rangeDomain?: RangeDomain;
34
+ onSidebarOptionSelect?: (value: string) => void;
16
35
  onChange?: (date: DateObject | DateObject[], selectedOption?: string) => void;
17
36
  };
37
+ type ClockType = 'am' | 'pm';
38
+ type CalendarTimeBarProps = {
39
+ times: string[];
40
+ onTimeChange: (index: number, value: string) => void;
41
+ };
18
42
  enum DatpickerNavigationDirectionEnum {
19
43
  right = "right",
20
44
  left = "left"
@@ -31,4 +55,21 @@ export declare namespace ICalendar {
31
55
  value?: () => DateObject[];
32
56
  onClick?: () => void;
33
57
  };
58
+ type Time = {
59
+ key: string;
60
+ label: string;
61
+ timeHour: string;
62
+ timeMinute: string;
63
+ clockType: string;
64
+ };
34
65
  }
66
+ export type CalendarTimeBarProps = {
67
+ label?: string;
68
+ timeHour?: string;
69
+ timeMinute?: string;
70
+ clockType?: ICalendar.ClockType | string;
71
+ disabled?: boolean;
72
+ onHourChange: (key: string, value: string) => void;
73
+ onMinuteChange: (key: string, value: string) => void;
74
+ onClockTypeChange: (key: string, value: string) => void;
75
+ };
@@ -5,6 +5,10 @@ export declare const isRangeWithNumberOfMonths: (range: boolean, numberOfMonths:
5
5
  declare const regexInputValidate: (event: ICalendar.InputChangeEvent, onChange: (event: ICalendar.InputChangeEvent) => void) => void;
6
6
  declare const weeks: string[];
7
7
  declare const fullMonthsText: any;
8
+ export declare const selectorContent: {
9
+ [key: string]: string;
10
+ clockType: ICalendar.ClockType;
11
+ }[];
8
12
  export declare const getDateObjectForCalendarConstants: (date: string | Date, amount: number, unit: dayjs.ManipulateType, end: 'startOf' | 'endOf') => DateObject;
9
13
  export declare const CALENDAR_CONSTANTS: {
10
14
  TODAY: DateObject[];
@@ -18,6 +22,9 @@ export declare const CALENDAR_CONSTANTS: {
18
22
  THIS_MONTH: DateObject[];
19
23
  PAST_MONTH: DateObject[];
20
24
  CUSTOM_RANGE: DateObject[];
25
+ NOW: DateObject[];
26
+ LAST_HOUR: DateObject[];
27
+ YESTERDAY: DateObject[];
21
28
  };
22
29
  export declare const getSidebarOptions: (projectDuration?: ICalendar.ProjectDuration) => {
23
30
  title: string;
@@ -25,4 +32,9 @@ export declare const getSidebarOptions: (projectDuration?: ICalendar.ProjectDura
25
32
  }[];
26
33
  declare const getDateOffset: (valueArr: Value, domain: RangeDomain) => DateObject[];
27
34
  declare const isNotInCurrentMonth: (date: string | DateObject) => boolean;
28
- export { fullMonthsText, regexInputValidate, weeks, getDateOffset, isNotInCurrentMonth };
35
+ declare const timeSet: {
36
+ key: string;
37
+ label: string;
38
+ }[];
39
+ declare const addPadStart: (value: string) => string;
40
+ export { fullMonthsText, regexInputValidate, weeks, getDateOffset, isNotInCurrentMonth, timeSet, addPadStart, };
@@ -1,3 +1,6 @@
1
+ declare const DatepickerWrapper: import("styled-components").StyledComponent<"div", any, {
2
+ showTime?: boolean;
3
+ }, never>;
1
4
  declare const DatepickerNavigationButton: import("styled-components").StyledComponent<"button", any, {}, never>;
2
5
  declare const IconWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- export { DatepickerNavigationButton, IconWrapper };
6
+ export { DatepickerNavigationButton, IconWrapper, DatepickerWrapper };
@@ -2,6 +2,11 @@
2
2
  import { CalendarProps, DatePickerProps } from 'react-multi-date-picker';
3
3
  import { InputComponent } from '../Input/types';
4
4
  export declare namespace IDatepicker {
5
+ type ClockType = 'am' | 'pm';
6
+ enum ClockTypeEnum {
7
+ am = "am",
8
+ pm = "pm"
9
+ }
5
10
  type Props = CalendarProps & DatePickerProps & {
6
11
  range?: boolean;
7
12
  numberOfMonths?: number;
@@ -12,6 +17,9 @@ export declare namespace IDatepicker {
12
17
  calendarRef?: any;
13
18
  inputProps?: InputComponent.Props;
14
19
  dateFormat?: string;
20
+ showTime?: boolean;
21
+ dateTimeRange?: DateRangeType;
22
+ onChangeDateTime?: (time: DateRangeType) => void;
15
23
  };
16
24
  enum DatpickerNavigationDirectionEnum {
17
25
  right = "right",
@@ -19,4 +27,24 @@ export declare namespace IDatepicker {
19
27
  }
20
28
  type InputChangeEvent = React.ChangeEvent<HTMLInputElement>;
21
29
  type DatpickerNavigationDirection = keyof typeof DatpickerNavigationDirectionEnum;
30
+ type DateRangeType = {
31
+ startDate: string;
32
+ endDate: string;
33
+ };
34
+ type TimeRangeType = {
35
+ from: {
36
+ hour: string;
37
+ minute: string;
38
+ clockType: ClockType;
39
+ };
40
+ to: {
41
+ hour: string;
42
+ minute: string;
43
+ clockType: ClockType;
44
+ };
45
+ };
46
+ type DateTimeRangeType = {
47
+ dateRange: DateRangeType;
48
+ timeRange: TimeRangeType;
49
+ };
22
50
  }
@@ -1,7 +1,35 @@
1
+ import { DateObject } from 'react-multi-date-picker';
1
2
  import { IDatepicker } from '../types';
2
3
  declare const renderDatepickerNavigationButton: (direction: IDatepicker.DatpickerNavigationDirection, handleClick: (event: React.MouseEvent<HTMLButtonElement>) => void) => import("react/jsx-runtime").JSX.Element;
3
4
  declare const regexInputValidate: (event: IDatepicker.InputChangeEvent, onChange: (event: IDatepicker.InputChangeEvent) => void) => void;
4
5
  declare const months: string[];
5
6
  declare const weeks: string[];
6
7
  declare const fullMonthsText: any;
7
- export { renderDatepickerNavigationButton, regexInputValidate, months, weeks, fullMonthsText };
8
+ declare const createDateTimeRangeParams: (dateTimeRange?: IDatepicker.DateTimeRangeType) => {
9
+ startDate: string;
10
+ endDate: string;
11
+ };
12
+ declare const getDateRange: (dates: DateObject[] | DateObject | null) => string;
13
+ declare const extractTimeFromDate: (dateTimeRange: IDatepicker.DateRangeType) => {
14
+ startDateOnly: string;
15
+ endDateOnly: string;
16
+ time: {
17
+ from: {
18
+ hour: string;
19
+ minute: string;
20
+ clockType: IDatepicker.ClockTypeEnum;
21
+ };
22
+ to: {
23
+ hour: string;
24
+ minute: string;
25
+ clockType: IDatepicker.ClockTypeEnum;
26
+ };
27
+ };
28
+ };
29
+ declare const formatDateTime: (date: string | Date, format: string, timeRange: {
30
+ hour: string;
31
+ minute: string;
32
+ clockType: string;
33
+ }) => string;
34
+ declare const getFormattedDateTime: (dateTimeRange?: IDatepicker.DateRangeType, dateFormat?: string) => string;
35
+ export { renderDatepickerNavigationButton, regexInputValidate, months, weeks, fullMonthsText, createDateTimeRangeParams, getDateRange, extractTimeFromDate, formatDateTime, getFormattedDateTime, };
@@ -6,6 +6,8 @@ type HorizontalStepperType = {
6
6
  steps?: any;
7
7
  activeStep?: any;
8
8
  setActiveStep?: any;
9
+ navigateOnStepClick?: boolean;
10
+ onStepChange?: (value: any) => void;
9
11
  };
10
- declare const HorizontalStepper: ({ activeStep, setActiveStep, ...props }: HorizontalStepperType) => import("react/jsx-runtime").JSX.Element;
12
+ declare const HorizontalStepper: ({ activeStep, setActiveStep, navigateOnStepClick, onStepChange, ...props }: HorizontalStepperType) => import("react/jsx-runtime").JSX.Element;
11
13
  export { HorizontalStepper };
@@ -1,3 +1,3 @@
1
1
  import { SelectorComponent } from './types';
2
- declare const Selector: ({ content, activeKey, onClick, height }: SelectorComponent.Props) => import("react/jsx-runtime").JSX.Element;
2
+ declare const Selector: ({ content, activeKey, onClick, height, multiple, disabled, }: SelectorComponent.Props) => import("react/jsx-runtime").JSX.Element;
3
3
  export default Selector;
@@ -1,8 +1,17 @@
1
1
  export declare namespace SelectorComponent {
2
2
  type Props = {
3
3
  content: any;
4
- activeKey?: string;
4
+ activeKey?: string | string[];
5
5
  onClick?: any;
6
6
  height?: string;
7
+ multiple?: boolean;
8
+ disabled?: boolean;
9
+ };
10
+ type ClassOptions = {
11
+ isFirst?: boolean;
12
+ isLast?: boolean;
13
+ isSingle?: boolean;
14
+ isActive?: boolean;
15
+ isDisabled?: boolean;
7
16
  };
8
17
  }
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  export type TGTypes = {
3
- type: 'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'orange' | 'grey';
3
+ type: 'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'orange' | 'grey' | 'insight';
4
4
  size?: 'small' | 'default';
5
5
  avatar?: any;
6
6
  icon?: any;
@@ -2,3 +2,4 @@ export * from './useToast';
2
2
  export * from './useOutsideClick';
3
3
  export * from './useDebouncedValue';
4
4
  export * from './useToggle';
5
+ export * from './useTimeBar';
@@ -0,0 +1,29 @@
1
+ /// <reference types="react" />
2
+ import { IDatepicker } from '../components/Datepicker/types';
3
+ declare const useTimeBar: () => {
4
+ time: {
5
+ from: {
6
+ hour: string;
7
+ minute: string;
8
+ clockType: IDatepicker.ClockType;
9
+ };
10
+ to: {
11
+ hour: string;
12
+ minute: string;
13
+ clockType: IDatepicker.ClockType;
14
+ };
15
+ };
16
+ setTime: import("react").Dispatch<import("react").SetStateAction<{
17
+ from: {
18
+ hour: string;
19
+ minute: string;
20
+ clockType: IDatepicker.ClockType;
21
+ };
22
+ to: {
23
+ hour: string;
24
+ minute: string;
25
+ clockType: IDatepicker.ClockType;
26
+ };
27
+ }>>;
28
+ };
29
+ export { useTimeBar };
package/dist/index.d.ts CHANGED
@@ -65,3 +65,4 @@ export { CALENDAR_CONSTANTS, getDateObjectForCalendarConstants, } from './compon
65
65
  export * from './components/TrendPercentage';
66
66
  export * from './components/Charts/WorkerTimeChart';
67
67
  export { processDataForWorkerTimeChart } from './components/Charts/WorkerTimeChart/WorkerTimeChartData';
68
+ export { extractTimeFromDate, createDateTimeRangeParams, formatDateTime, getFormattedDateTime, } from './components/Datepicker/utils';