@synerise/ds-time-picker 1.1.8 → 1.1.10
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/CHANGELOG.md +626 -2037
- package/dist/TimePicker.d.ts +2 -2
- package/dist/TimePicker.js +10 -8
- package/dist/TimePicker.styles.d.ts +1 -1
- package/dist/TimePicker.styles.js +2 -2
- package/dist/Unit.d.ts +2 -2
- package/dist/Unit.js +1 -1
- package/dist/constants/timePicker.constants.d.ts +2 -2
- package/dist/types/TimePicker.types.d.ts +4 -4
- package/dist/utils/timePicker.utils.d.ts +1 -1
- package/dist/utils/unit.utils.js +3 -1
- package/package.json +10 -10
package/dist/TimePicker.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import dayjs from 'dayjs';
|
|
3
|
-
import
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { type TimePickerProps } from './types/TimePicker.types';
|
|
4
4
|
declare const TimePicker: {
|
|
5
5
|
({ placement, placeholder, trigger, value, units, defaultOpen, onChange, containerStyle, timeFormat, valueFormatOptions, use12HourClock, alwaysOpen, dropdownProps, inputProps, disabled, disabledHours, disabledMinutes, disabledSeconds, overlayClassName, className, clearTooltip, raw, onClockModeChange, errorText, }: TimePickerProps): React.JSX.Element;
|
|
6
6
|
defaultProps: {
|
package/dist/TimePicker.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import React, { Fragment, useCallback, useMemo, useState } from 'react';
|
|
3
|
-
import { FormattedMessage, useIntl } from 'react-intl';
|
|
4
|
-
import { range } from 'lodash';
|
|
5
2
|
import dayjs from 'dayjs';
|
|
6
3
|
import customParseFormatPlugin from 'dayjs/plugin/customParseFormat';
|
|
4
|
+
import { range } from 'lodash';
|
|
5
|
+
import React, { Fragment, useCallback, useMemo, useState } from 'react';
|
|
6
|
+
import { FormattedMessage, useIntl } from 'react-intl';
|
|
7
|
+
import { useDataFormat } from '@synerise/ds-data-format';
|
|
7
8
|
import Icon, { ClockM, Close3S } from '@synerise/ds-icon';
|
|
8
9
|
import Tooltip from '@synerise/ds-tooltip/dist/Tooltip';
|
|
9
|
-
import { useDataFormat } from '@synerise/ds-data-format';
|
|
10
|
-
import Unit from './Unit';
|
|
11
10
|
import * as S from './TimePicker.styles';
|
|
12
|
-
import
|
|
11
|
+
import Unit from './Unit';
|
|
12
|
+
import { AM, CLOCK_MODES, DISABLE_CLOCK_MODE_HOUR, HOUR, HOUR_12, MINUTE, PM, SECOND } from './constants/timePicker.constants';
|
|
13
13
|
import { getClockModeFromDate, getOppositeClockMode } from './utils/clockMode.utils';
|
|
14
|
-
import {
|
|
14
|
+
import { handleTimeChange } from './utils/timePicker.utils';
|
|
15
15
|
dayjs.extend(customParseFormatPlugin);
|
|
16
16
|
var defaultUnits = [HOUR, MINUTE, SECOND];
|
|
17
17
|
var TimePicker = function TimePicker(_ref) {
|
|
@@ -55,7 +55,9 @@ var TimePicker = function TimePicker(_ref) {
|
|
|
55
55
|
var _useIntl = useIntl(),
|
|
56
56
|
formatMessage = _useIntl.formatMessage;
|
|
57
57
|
var is12HourClock = useMemo(function () {
|
|
58
|
-
if (use12HourClock === undefined)
|
|
58
|
+
if (use12HourClock === undefined) {
|
|
59
|
+
return is12HoursClockFromDataFormat;
|
|
60
|
+
}
|
|
59
61
|
return use12HourClock;
|
|
60
62
|
}, [is12HoursClockFromDataFormat, use12HourClock]);
|
|
61
63
|
var timeFormatByClockMode = useMemo(function () {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
export declare const Dropdown: import("styled-components").StyledComponent<import("react").ComponentType<import("@synerise/ds-dropdown").DropdownProps> & {
|
|
3
3
|
Wrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
4
|
SearchInput: ({ value, className, onSearchChange, onClearInput, placeholder, iconLeft, autofocus, clearTooltip, disabled, borderRadius, handleInputRef, autofocusDelay, clearTooltipProps, valuePrefix, ...htmlAttributes }: import("@synerise/ds-search-bar").SearchBarProps) => import("react").JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import
|
|
2
|
+
import DSDropdown from '@synerise/ds-dropdown';
|
|
3
3
|
import Icon from '@synerise/ds-icon';
|
|
4
4
|
import { Input } from '@synerise/ds-input';
|
|
5
|
-
import
|
|
5
|
+
import { Label } from '@synerise/ds-typography';
|
|
6
6
|
export var Dropdown = styled(DSDropdown).withConfig({
|
|
7
7
|
displayName: "TimePickerstyles__Dropdown",
|
|
8
8
|
componentId: "sc-yk19n0-0"
|
package/dist/Unit.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type dayjs from 'dayjs';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import dayjs from 'dayjs';
|
|
3
3
|
export type UnitConfig = {
|
|
4
4
|
unit: dayjs.UnitType;
|
|
5
5
|
options: number[];
|
|
@@ -11,5 +11,5 @@ export type UnitProps = UnitConfig & {
|
|
|
11
11
|
value?: Date;
|
|
12
12
|
onSelect: (value: number) => void;
|
|
13
13
|
};
|
|
14
|
-
declare const Unit: ({ options, disabled, value, unit, onSelect, use12HourClock }: UnitProps) => React.JSX.Element;
|
|
14
|
+
declare const Unit: ({ options, disabled, value, unit, onSelect, use12HourClock, }: UnitProps) => React.JSX.Element;
|
|
15
15
|
export default Unit;
|
package/dist/Unit.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { useRef, useMemo, useState, useEffect } from 'react';
|
|
2
1
|
import { debounce } from 'debounce';
|
|
2
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import Scrollbar from '@synerise/ds-scrollbar';
|
|
4
4
|
import * as S from './TimePicker.styles';
|
|
5
5
|
import { getUnitSelectedNumber } from './utils/unit.utils';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import dayjs from 'dayjs';
|
|
2
|
-
import { ClockModes } from '../types/TimePicker.types';
|
|
1
|
+
import type dayjs from 'dayjs';
|
|
2
|
+
import { type ClockModes } from '../types/TimePicker.types';
|
|
3
3
|
export declare const HOUR: dayjs.UnitType;
|
|
4
4
|
export declare const MINUTE: dayjs.UnitType;
|
|
5
5
|
export declare const SECOND: dayjs.UnitType;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ReactNode, CSSProperties } from 'react';
|
|
2
1
|
import type dayjs from 'dayjs';
|
|
3
|
-
import type {
|
|
4
|
-
import type { DropdownProps } from '@synerise/ds-dropdown';
|
|
2
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
5
3
|
import type { DateToFormatOptions } from '@synerise/ds-data-format';
|
|
4
|
+
import type { DropdownProps } from '@synerise/ds-dropdown';
|
|
5
|
+
import type { InputProps } from '@synerise/ds-input';
|
|
6
6
|
import type { CLOCK_MODES } from '../constants/timePicker.constants';
|
|
7
|
-
export type ClockModes = typeof CLOCK_MODES[number];
|
|
7
|
+
export type ClockModes = (typeof CLOCK_MODES)[number];
|
|
8
8
|
export type TimePickerDisabledUnits = {
|
|
9
9
|
disabledSeconds?: number[];
|
|
10
10
|
disabledMinutes?: number[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import dayjs from 'dayjs';
|
|
2
|
-
import { UnitConfig } from '../Unit';
|
|
2
|
+
import { type UnitConfig } from '../Unit';
|
|
3
3
|
export declare const handleTimeChange: (value: Date | undefined, unit: dayjs.UnitType | undefined, newValue: number | undefined, clockModeChanged: boolean | undefined, use12HourClock: boolean | undefined, clockMode: string, unitConfig: UnitConfig[]) => Date;
|
package/dist/utils/unit.utils.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import dayjs from 'dayjs';
|
|
2
2
|
import { HOUR, HOUR_12, MAP_24_HOUR_TO_12 } from '../constants/timePicker.constants';
|
|
3
3
|
export var getUnitSelectedNumber = function getUnitSelectedNumber(value, unit, use12HourClock) {
|
|
4
|
-
if (value === undefined)
|
|
4
|
+
if (value === undefined) {
|
|
5
|
+
return undefined;
|
|
6
|
+
}
|
|
5
7
|
var result = value && dayjs(value).get(unit);
|
|
6
8
|
if (unit === HOUR && use12HourClock) {
|
|
7
9
|
if (!result) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-time-picker",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.10",
|
|
4
4
|
"description": "TimePicker UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
],
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@synerise/ds-data-format": "^1.0.
|
|
38
|
-
"@synerise/ds-dropdown": "^1.0.
|
|
39
|
-
"@synerise/ds-icon": "^1.5.
|
|
40
|
-
"@synerise/ds-input": "^1.3.
|
|
41
|
-
"@synerise/ds-scrollbar": "^1.1.
|
|
42
|
-
"@synerise/ds-tooltip": "^1.1.
|
|
43
|
-
"@synerise/ds-typography": "^1.0.
|
|
44
|
-
"@synerise/ds-utils": "^1.3.
|
|
37
|
+
"@synerise/ds-data-format": "^1.0.1",
|
|
38
|
+
"@synerise/ds-dropdown": "^1.0.15",
|
|
39
|
+
"@synerise/ds-icon": "^1.5.4",
|
|
40
|
+
"@synerise/ds-input": "^1.3.2",
|
|
41
|
+
"@synerise/ds-scrollbar": "^1.1.2",
|
|
42
|
+
"@synerise/ds-tooltip": "^1.1.12",
|
|
43
|
+
"@synerise/ds-typography": "^1.0.13",
|
|
44
|
+
"@synerise/ds-utils": "^1.3.1",
|
|
45
45
|
"dayjs": "^1.8.19",
|
|
46
46
|
"debounce": "^1.2.0",
|
|
47
47
|
"lodash": "^4.17.21"
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"react-intl": ">=3.12.0 <= 6.8",
|
|
54
54
|
"styled-components": "^5.3.3"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "4512641033ba3581a3df208143c547fcfed45895"
|
|
57
57
|
}
|