@synerise/ds-factors 0.20.8 → 0.20.9

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 CHANGED
@@ -3,6 +3,18 @@
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.20.9](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@0.20.8...@synerise/ds-factors@0.20.9) (2023-10-19)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **factors:** fixes visibility of DatePicker ([a3a3232](https://github.com/Synerise/synerise-design/commit/a3a32323ecdf51e0281fa953455963ac46144dc6))
12
+ * **input:** fixes styles of input group ([4f56031](https://github.com/Synerise/synerise-design/commit/4f56031a456905e84299b572fc9a11336eace9a9))
13
+
14
+
15
+
16
+
17
+
6
18
  ## [0.20.8](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@0.20.7...@synerise/ds-factors@0.20.8) (2023-10-18)
7
19
 
8
20
 
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import { InputProps } from '../../Factors.types';
3
3
  declare const DateInput: React.FC<InputProps>;
4
4
  export default DateInput;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React, { useEffect, useMemo, useState } from 'react';
2
2
  import DatePicker from '@synerise/ds-date-picker/dist/DatePicker';
3
3
 
4
4
  var DateInput = function DateInput(_ref) {
@@ -7,38 +7,54 @@ var DateInput = function DateInput(_ref) {
7
7
  texts = _ref.texts,
8
8
  opened = _ref.opened,
9
9
  onDeactivate = _ref.onDeactivate,
10
+ onActivate = _ref.onActivate,
10
11
  error = _ref.error,
11
12
  _ref$readOnly = _ref.readOnly,
12
13
  readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly;
14
+
15
+ var _useState = useState(value),
16
+ localValue = _useState[0],
17
+ setLocalValue = _useState[1];
18
+
19
+ useEffect(function () {
20
+ setLocalValue(value);
21
+ }, [value]);
13
22
  var changeHandler = React.useCallback(function (date) {
14
23
  onChange(date);
15
24
  }, [onChange]);
25
+ var localValueAsDate = useMemo(function () {
26
+ return localValue ? new Date(String(localValue)) : undefined;
27
+ }, [localValue]);
16
28
  var handleClear = React.useCallback(function () {
17
29
  onChange(undefined);
18
30
  }, [onChange]);
19
31
  var handleVisibleChange = React.useCallback(function (visible) {
20
32
  if (!visible) {
21
33
  onDeactivate && onDeactivate();
34
+ onChange(localValueAsDate);
35
+ } else {
36
+ onActivate && onActivate();
22
37
  }
23
- }, [onDeactivate]);
24
- React.useEffect(function () {
25
- onDeactivate && onDeactivate();
26
- }, [onDeactivate]);
38
+ }, [localValueAsDate, onActivate, onChange, onDeactivate]);
27
39
  return /*#__PURE__*/React.createElement(DatePicker, {
28
40
  onClear: handleClear,
41
+ onValueChange: function onValueChange(date) {
42
+ return setLocalValue(date == null ? void 0 : date.toDateString());
43
+ },
29
44
  onApply: changeHandler,
30
- onValueChange: changeHandler,
31
- value: value ? new Date(String(value)) : undefined,
45
+ value: localValueAsDate,
32
46
  showTime: true,
33
47
  useStartOfDay: true,
34
48
  texts: texts.datePicker,
35
49
  disabledHours: [],
36
50
  disabledMinutes: [],
37
51
  disabledSeconds: [],
38
- autoFocus: opened,
39
- onDropdownVisibleChange: handleVisibleChange,
40
52
  error: error,
41
- readOnly: readOnly
53
+ readOnly: readOnly,
54
+ dropdownProps: {
55
+ visible: opened,
56
+ onVisibleChange: handleVisibleChange
57
+ }
42
58
  });
43
59
  };
44
60
 
@@ -6,6 +6,6 @@ import { FactorInput } from '../FactorValue/FactorValue.style'; // eslint-disabl
6
6
  export var Group = styled(InputGroup).withConfig({
7
7
  displayName: "Factorsstyle__Group",
8
8
  componentId: "sc-1kkuis0-0"
9
- })(["&&.ds-factors{display:flex;", "{margin:0;}", "{width:auto;> *{border-radius:", ";}}}"], OuterWrapper, FactorInput, function (props) {
9
+ })(["&&&{display:flex;", "{margin:0;}", "{width:auto;> *{border-radius:", ";}}}"], OuterWrapper, FactorInput, function (props) {
10
10
  return props.withoutTypeSelector ? '3px' : '0 3px 3px 0';
11
11
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-factors",
3
- "version": "0.20.8",
3
+ "version": "0.20.9",
4
4
  "description": "Factors UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -33,25 +33,25 @@
33
33
  ],
34
34
  "types": "dist/index.d.ts",
35
35
  "dependencies": {
36
- "@synerise/ds-autocomplete": "^0.5.5",
37
- "@synerise/ds-badge": "^0.6.40",
38
- "@synerise/ds-button": "^0.18.5",
39
- "@synerise/ds-date-picker": "^0.10.22",
40
- "@synerise/ds-date-range-picker": "^0.25.1",
41
- "@synerise/ds-dropdown": "^0.17.84",
42
- "@synerise/ds-icon": "^0.58.5",
43
- "@synerise/ds-information-card": "^0.3.43",
44
- "@synerise/ds-inline-edit": "^0.6.84",
45
- "@synerise/ds-input": "^0.19.5",
46
- "@synerise/ds-input-number": "^0.8.27",
47
- "@synerise/ds-loader": "^0.2.47",
48
- "@synerise/ds-menu": "^0.18.2",
49
- "@synerise/ds-modal": "^0.17.8",
50
- "@synerise/ds-result": "^0.6.34",
51
- "@synerise/ds-scrollbar": "^0.6.10",
52
- "@synerise/ds-tabs": "^0.13.82",
53
- "@synerise/ds-tooltip": "^0.14.7",
54
- "@synerise/ds-utils": "^0.24.19",
36
+ "@synerise/ds-autocomplete": "^0.5.6",
37
+ "@synerise/ds-badge": "^0.6.41",
38
+ "@synerise/ds-button": "^0.18.6",
39
+ "@synerise/ds-date-picker": "^0.10.23",
40
+ "@synerise/ds-date-range-picker": "^0.25.2",
41
+ "@synerise/ds-dropdown": "^0.17.85",
42
+ "@synerise/ds-icon": "^0.58.6",
43
+ "@synerise/ds-information-card": "^0.3.44",
44
+ "@synerise/ds-inline-edit": "^0.6.85",
45
+ "@synerise/ds-input": "^0.19.6",
46
+ "@synerise/ds-input-number": "^0.8.28",
47
+ "@synerise/ds-loader": "^0.2.48",
48
+ "@synerise/ds-menu": "^0.18.3",
49
+ "@synerise/ds-modal": "^0.17.9",
50
+ "@synerise/ds-result": "^0.6.35",
51
+ "@synerise/ds-scrollbar": "^0.6.11",
52
+ "@synerise/ds-tabs": "^0.13.83",
53
+ "@synerise/ds-tooltip": "^0.14.8",
54
+ "@synerise/ds-utils": "^0.24.20",
55
55
  "lodash": "^4.17.19",
56
56
  "react-intl": "3.12.0",
57
57
  "react-window": "1.8.5",
@@ -67,5 +67,5 @@
67
67
  "@testing-library/react": "10.0.1",
68
68
  "@testing-library/user-event": "^10.3.1"
69
69
  },
70
- "gitHead": "1b2696001dd88b4c11413977e38b541b0c78733d"
70
+ "gitHead": "0f860580d5e53dd24a5474aaead7c6d89f8674da"
71
71
  }