@bigbinary/neeto-filters-frontend 4.0.0 → 4.0.1

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/dist/index.js CHANGED
@@ -24,7 +24,7 @@ import weekday from 'dayjs/plugin/weekday';
24
24
  import Help from '@bigbinary/neeto-icons/Help';
25
25
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
26
26
  import DatePicker from '@bigbinary/neetoui/DatePicker';
27
- import TimePickerInput from '@bigbinary/neetoui/TimePickerInput';
27
+ import TimePicker from '@bigbinary/neetoui/TimePicker';
28
28
  import Input from '@bigbinary/neetoui/Input';
29
29
  import NeetoUITreeSelect from '@bigbinary/neetoui/TreeSelect';
30
30
  import Plus from '@bigbinary/neeto-icons/Plus';
@@ -321,6 +321,7 @@ var TREE_SELECT_RULES = [{
321
321
  var DEFAULT_HELP_ICON_PROPS = {
322
322
  icon: Help
323
323
  };
324
+ var TIME_FORMAT = "h:mm A";
324
325
 
325
326
  function ownKeys$e(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
326
327
  function _objectSpread$e(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$e(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$e(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -961,9 +962,6 @@ var getColumnsWithStandardizedType = function getColumnsWithStandardizedType(col
961
962
  var isKeywordFilterPresent = function isKeywordFilterPresent(keyworFilter) {
962
963
  return not(isEmpty(keyworFilter.node));
963
964
  };
964
- var isNilOrEmpty = function isNilOrEmpty(param) {
965
- return isNil(param) || isEmpty(param);
966
- };
967
965
 
968
966
  var buildDropdownValue = function buildDropdownValue(_ref) {
969
967
  var defaultType = _ref.defaultType,
@@ -1069,18 +1067,6 @@ var areCustomTimeRangeValuesNotValid = function areCustomTimeRangeValuesNotValid
1069
1067
  return time.isValid();
1070
1068
  });
1071
1069
  };
1072
-
1073
- // eslint-disable-next-line @bigbinary/neeto/use-standard-date-time-formats
1074
- var formatSingleTime = function formatSingleTime(time) {
1075
- return dayjs(time).format("HH:mm:ss");
1076
- };
1077
- var formatTime = function formatTime(value, timePickerType) {
1078
- if (isNilOrEmpty(value)) return null;
1079
- if (timePickerType === "range") {
1080
- return value.map(formatSingleTime);
1081
- }
1082
- return formatSingleTime(value);
1083
- };
1084
1070
  var isRuleEmpty = function isRuleEmpty(rule) {
1085
1071
  return equals(rule, "is_unknown");
1086
1072
  };
@@ -1510,7 +1496,6 @@ var SingleTime = function SingleTime(_ref) {
1510
1496
  });
1511
1497
  handleApplyFilter(updatedFilter);
1512
1498
  };
1513
- var formattedTime = formatTime(value, timePickerType);
1514
1499
  return /*#__PURE__*/jsxs("div", {
1515
1500
  className: "neeto-filters-pane-filter__item-wrapper",
1516
1501
  children: [/*#__PURE__*/jsx(Select, _objectSpread$9(_objectSpread$9({
@@ -1525,12 +1510,13 @@ var SingleTime = function SingleTime(_ref) {
1525
1510
  }
1526
1511
  }), {}, {
1527
1512
  onChange: handleRuleChange
1528
- })), /*#__PURE__*/jsx(TimePickerInput, _objectSpread$9({
1513
+ })), /*#__PURE__*/jsx(TimePicker, _objectSpread$9({
1529
1514
  autoFocus: autoFocus,
1515
+ value: value,
1530
1516
  className: "w-full",
1531
1517
  "data-cy": "neeto-filters-".concat(hyphenate(key), "-filter"),
1518
+ format: TIME_FORMAT,
1532
1519
  type: timePickerType,
1533
- value: formattedTime,
1534
1520
  onChange: handleChange
1535
1521
  }, otherProps))]
1536
1522
  });
@@ -1718,11 +1704,12 @@ var Time = function Time(_ref) {
1718
1704
  }
1719
1705
  }), {}, {
1720
1706
  onChange: handleChange
1721
- })), isCustomTimeRangeShown && /*#__PURE__*/jsx(TimePickerInput, _objectSpread$7({
1707
+ })), isCustomTimeRangeShown && /*#__PURE__*/jsx(TimePicker, _objectSpread$7({
1722
1708
  className: "w-full",
1723
1709
  "data-cy": "neeto-filters-".concat(hyphenate(key), "-date-range"),
1710
+ format: TIME_FORMAT,
1724
1711
  type: "range",
1725
- value: formatTime(filter.value, "range"),
1712
+ value: filter.value,
1726
1713
  onChange: handleTimeRangeChange
1727
1714
  }, otherProps))]
1728
1715
  });