@synerise/ds-date-picker 0.10.46 → 0.10.48
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 +19 -0
- package/dist/DatePicker.js +4 -3
- package/dist/DatePicker.types.d.ts +13 -11
- package/dist/Elements/PickerInput/PickerInput.d.ts +2 -3
- package/dist/Elements/PickerInput/PickerInput.styles.js +3 -1
- package/dist/Elements/PickerInput/PickerInput.types.d.ts +14 -9
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.10.48](https://github.com/Synerise/synerise-design/compare/@synerise/ds-date-picker@0.10.47...@synerise/ds-date-picker@0.10.48) (2024-05-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **date-picker:** added autoResize handling ([f3a759c](https://github.com/Synerise/synerise-design/commit/f3a759c2b40664cc2d225cb4eaaefcbbf70321fe))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [0.10.47](https://github.com/Synerise/synerise-design/compare/@synerise/ds-date-picker@0.10.46...@synerise/ds-date-picker@0.10.47) (2024-05-08)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @synerise/ds-date-picker
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [0.10.46](https://github.com/Synerise/synerise-design/compare/@synerise/ds-date-picker@0.10.45...@synerise/ds-date-picker@0.10.46) (2024-05-08)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @synerise/ds-date-picker
|
package/dist/DatePicker.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["autoFocus", "disabled", "texts", "format", "valueFormatOptions", "value", "onApply", "showTime", "onValueChange", "onClear", "errorText", "popoverPlacement", "prefixel", "error", "onDropdownVisibleChange", "dropdownProps", "suffixel", "hideNow", "readOnly", "renderTrigger"];
|
|
1
|
+
var _excluded = ["autoFocus", "disabled", "texts", "format", "valueFormatOptions", "value", "onApply", "showTime", "onValueChange", "onClear", "errorText", "popoverPlacement", "prefixel", "error", "onDropdownVisibleChange", "dropdownProps", "suffixel", "hideNow", "readOnly", "renderTrigger", "inputProps"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
@@ -32,6 +32,7 @@ var DatePicker = function DatePicker(_ref) {
|
|
|
32
32
|
hideNow = _ref.hideNow,
|
|
33
33
|
readOnly = _ref.readOnly,
|
|
34
34
|
renderTrigger = _ref.renderTrigger,
|
|
35
|
+
inputProps = _ref.inputProps,
|
|
35
36
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
36
37
|
|
|
37
38
|
var _React$useState = React.useState(autoFocus || false),
|
|
@@ -63,7 +64,7 @@ var DatePicker = function DatePicker(_ref) {
|
|
|
63
64
|
setSelectedDate(undefined);
|
|
64
65
|
onClear && onClear();
|
|
65
66
|
}, [onClear]);
|
|
66
|
-
var trigger = (renderTrigger == null ? void 0 : renderTrigger()) || /*#__PURE__*/React.createElement(PickerInput, {
|
|
67
|
+
var trigger = (renderTrigger == null ? void 0 : renderTrigger()) || /*#__PURE__*/React.createElement(PickerInput, _extends({}, inputProps, {
|
|
67
68
|
disabled: disabled,
|
|
68
69
|
autoFocus: !disabled && autoFocus,
|
|
69
70
|
value: selectedDate,
|
|
@@ -82,7 +83,7 @@ var DatePicker = function DatePicker(_ref) {
|
|
|
82
83
|
error: error,
|
|
83
84
|
errorText: errorText,
|
|
84
85
|
readOnly: readOnly
|
|
85
|
-
});
|
|
86
|
+
}));
|
|
86
87
|
return readOnly ? trigger : /*#__PURE__*/React.createElement(Dropdown, _extends({
|
|
87
88
|
overlay: /*#__PURE__*/React.createElement(S.OverlayContainer, {
|
|
88
89
|
ref: ref
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IntlShape } from 'react-intl';
|
|
3
|
-
import { DropdownProps } from '@synerise/ds-dropdown/dist/Dropdown';
|
|
4
|
-
import { DateToFormatOptions } from '@synerise/ds-data-format';
|
|
1
|
+
import type { ReactNode, ReactElement } from 'react';
|
|
2
|
+
import type { IntlShape } from 'react-intl';
|
|
3
|
+
import type { DropdownProps } from '@synerise/ds-dropdown/dist/Dropdown';
|
|
4
|
+
import type { DateToFormatOptions } from '@synerise/ds-data-format';
|
|
5
|
+
import type { InputProps } from '@synerise/ds-input';
|
|
5
6
|
export type Props = {
|
|
6
7
|
autoFocus?: boolean;
|
|
7
8
|
disabled?: boolean;
|
|
@@ -21,18 +22,19 @@ export type Props = {
|
|
|
21
22
|
onDropdownVisibleChange?: (visible: boolean) => void;
|
|
22
23
|
onValueChange?: (date?: Date) => void;
|
|
23
24
|
error?: boolean;
|
|
24
|
-
errorText?:
|
|
25
|
+
errorText?: ReactNode;
|
|
25
26
|
popoverPlacement?: 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
|
|
26
|
-
prefixel?:
|
|
27
|
-
suffixel?:
|
|
27
|
+
prefixel?: ReactNode;
|
|
28
|
+
suffixel?: ReactNode;
|
|
28
29
|
showTime?: boolean;
|
|
29
30
|
texts: Texts;
|
|
30
|
-
renderTrigger?: () =>
|
|
31
|
+
renderTrigger?: () => ReactElement;
|
|
31
32
|
value?: Date;
|
|
32
33
|
useStartOfDay?: boolean;
|
|
33
34
|
useEndOfDay?: boolean;
|
|
34
35
|
hideNow?: boolean;
|
|
35
36
|
readOnly?: boolean;
|
|
37
|
+
inputProps?: Pick<InputProps, 'autoResize'>;
|
|
36
38
|
};
|
|
37
39
|
export type State = {
|
|
38
40
|
mode: string;
|
|
@@ -52,8 +54,8 @@ export type Modifier = {
|
|
|
52
54
|
disabled: boolean;
|
|
53
55
|
};
|
|
54
56
|
export type Texts = {
|
|
55
|
-
apply:
|
|
56
|
-
now:
|
|
57
|
+
apply: ReactNode;
|
|
58
|
+
now: ReactNode;
|
|
57
59
|
inputPlaceholder?: string;
|
|
58
|
-
clearTooltip?:
|
|
60
|
+
clearTooltip?: ReactNode;
|
|
59
61
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
declare const PickerInput: React.FC<Props>;
|
|
1
|
+
import { PickerInputProps } from './PickerInput.types';
|
|
2
|
+
declare const PickerInput: ({ autoFocus, size, disabled, readOnly, value, format: dateFormat, valueFormatOptions, onChange, showTime, style, placeholder, onClear, onClick, clearTooltip, highlight, error, errorText, prefixel, suffixel, ...rest }: PickerInputProps) => JSX.Element;
|
|
4
3
|
export default PickerInput;
|
|
@@ -20,7 +20,9 @@ var activeStyle = function activeStyle(props) {
|
|
|
20
20
|
export var Input = styled(DSInput).withConfig({
|
|
21
21
|
displayName: "PickerInputstyles__Input",
|
|
22
22
|
componentId: "sc-168pcz5-2"
|
|
23
|
-
})(["&{.ant-input{
|
|
23
|
+
})(["&{.ant-input{", ";", "}}"], function (props) {
|
|
24
|
+
return !props.autoResize && 'min-width: 150px';
|
|
25
|
+
}, function (props) {
|
|
24
26
|
return !!props.active && activeStyle(props);
|
|
25
27
|
});
|
|
26
28
|
export var PickerInputWrapper = styled.div.withConfig({
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import type { ReactNode, CSSProperties } from 'react';
|
|
2
|
+
import { SizeType } from 'antd/lib/config-provider/SizeContext';
|
|
3
|
+
import type { DateToFormatOptions } from '@synerise/ds-data-format';
|
|
4
|
+
import type { Props as DatePickerProps } from '../../DatePicker.types';
|
|
5
|
+
type InputProps = DatePickerProps['inputProps'];
|
|
6
|
+
export type Props = InputProps & {
|
|
4
7
|
autoFocus?: boolean;
|
|
5
|
-
size?:
|
|
8
|
+
size?: SizeType;
|
|
6
9
|
/**
|
|
7
10
|
* @deprecated use `valueFormatOptions` instead
|
|
8
11
|
*/
|
|
@@ -12,16 +15,18 @@ export type Props = {
|
|
|
12
15
|
allowClear?: boolean;
|
|
13
16
|
value?: Date | string;
|
|
14
17
|
onChange?: (dateValue: Date | undefined | null, stringifiedDate: string) => void;
|
|
15
|
-
style?:
|
|
18
|
+
style?: CSSProperties;
|
|
16
19
|
placeholder?: string;
|
|
17
20
|
disabled?: boolean;
|
|
18
21
|
readOnly?: boolean;
|
|
19
22
|
onClick?: () => void;
|
|
20
23
|
onClear?: () => void;
|
|
21
|
-
clearTooltip?:
|
|
24
|
+
clearTooltip?: ReactNode;
|
|
22
25
|
highlight?: boolean;
|
|
23
26
|
error?: boolean;
|
|
24
|
-
errorText?:
|
|
25
|
-
prefixel?:
|
|
26
|
-
suffixel?:
|
|
27
|
+
errorText?: ReactNode;
|
|
28
|
+
prefixel?: ReactNode;
|
|
29
|
+
suffixel?: ReactNode;
|
|
27
30
|
};
|
|
31
|
+
export type PickerInputProps = Props;
|
|
32
|
+
export {};
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-date-picker",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.48",
|
|
4
4
|
"description": "DatePicker UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"types": "dist/index.d.ts",
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@date-fns/upgrade": "^1.0.3",
|
|
37
|
-
"@synerise/ds-button": "^0.19.
|
|
38
|
-
"@synerise/ds-data-format": "^0.4.
|
|
39
|
-
"@synerise/ds-dropdown": "^0.17.
|
|
40
|
-
"@synerise/ds-icon": "^0.60.
|
|
41
|
-
"@synerise/ds-input": "^0.21.
|
|
42
|
-
"@synerise/ds-time-picker": "^0.10.
|
|
43
|
-
"@synerise/ds-tooltip": "^0.14.
|
|
44
|
-
"@synerise/ds-utils": "^0.26.
|
|
37
|
+
"@synerise/ds-button": "^0.19.9",
|
|
38
|
+
"@synerise/ds-data-format": "^0.4.9",
|
|
39
|
+
"@synerise/ds-dropdown": "^0.17.109",
|
|
40
|
+
"@synerise/ds-icon": "^0.60.9",
|
|
41
|
+
"@synerise/ds-input": "^0.21.2",
|
|
42
|
+
"@synerise/ds-time-picker": "^0.10.7",
|
|
43
|
+
"@synerise/ds-tooltip": "^0.14.27",
|
|
44
|
+
"@synerise/ds-utils": "^0.26.5",
|
|
45
45
|
"classnames": "2.3.2",
|
|
46
46
|
"date-fns": "2.16.1",
|
|
47
47
|
"lodash": "^4.17.20",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"react": ">=16.9.0 < 17.0.0",
|
|
56
56
|
"styled-components": "5.0.1"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "dea3898f262a7c333c6fd8ef806036ed4368bde7"
|
|
59
59
|
}
|