colibri-ui 0.7.104 → 0.7.106

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.
@@ -21,17 +21,23 @@ var TimeSelect = function TimeSelect(_a) {
21
21
  interval = _b === void 0 ? 15 : _b,
22
22
  onChange = _a.onChange,
23
23
  props = tslib.__rest(_a, ["value", "name", "currentDate", "label", "interval", "onChange"]);
24
- var options = React.useMemo(function () {
24
+ var baseOptions = React.useMemo(function () {
25
25
  return helpers.generateSuggest(interval).map(function (item) {
26
26
  return {
27
27
  value: item.time,
28
28
  label: /*#__PURE__*/React__default.default.createElement(index.default, {
29
29
  time: item.time
30
- }),
31
- disabled: !!currentDate && helpers.checkIsBeforeNow(item.time, currentDate)
30
+ })
32
31
  };
33
32
  });
34
33
  }, [interval]);
34
+ var options = React.useMemo(function () {
35
+ return baseOptions.map(function (option) {
36
+ return tslib.__assign(tslib.__assign({}, option), {
37
+ disabled: !!currentDate && helpers.checkIsBeforeNow(option.value, currentDate)
38
+ });
39
+ });
40
+ }, [baseOptions, currentDate]);
35
41
  return /*#__PURE__*/React__default.default.createElement(index$1.default, tslib.__assign({}, props, {
36
42
  name: name,
37
43
  value: value,
@@ -13,17 +13,23 @@ var TimeSelect = function TimeSelect(_a) {
13
13
  interval = _b === void 0 ? 15 : _b,
14
14
  onChange = _a.onChange,
15
15
  props = __rest(_a, ["value", "name", "currentDate", "label", "interval", "onChange"]);
16
- var options = useMemo(function () {
16
+ var baseOptions = useMemo(function () {
17
17
  return generateSuggest(interval).map(function (item) {
18
18
  return {
19
19
  value: item.time,
20
20
  label: /*#__PURE__*/React__default.createElement(OptionLabel, {
21
21
  time: item.time
22
- }),
23
- disabled: !!currentDate && checkIsBeforeNow(item.time, currentDate)
22
+ })
24
23
  };
25
24
  });
26
25
  }, [interval]);
26
+ var options = useMemo(function () {
27
+ return baseOptions.map(function (option) {
28
+ return __assign(__assign({}, option), {
29
+ disabled: !!currentDate && checkIsBeforeNow(option.value, currentDate)
30
+ });
31
+ });
32
+ }, [baseOptions, currentDate]);
27
33
  return /*#__PURE__*/React__default.createElement(Select, __assign({}, props, {
28
34
  name: name,
29
35
  value: value,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "colibri-ui",
3
- "version": "0.7.104",
3
+ "version": "0.7.106",
4
4
  "description": "React UI components library",
5
5
  "main": "index.js",
6
6
  "scripts": {},