@desynova-digital/components 8.13.3 → 8.13.6

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.
@@ -51,12 +51,12 @@ var PasswordToggleButton = _styledComponents2.default.div(_templateObject3);
51
51
  var CountWrappper = _styledComponents2.default.div(_templateObject4);
52
52
 
53
53
  var InputText = function InputText(_ref) {
54
- var maxlength = _ref.maxlength,
54
+ var maxLength = _ref.maxLength,
55
55
  defaultValue = _ref.defaultValue,
56
56
  type = _ref.type,
57
57
  showLengthCount = _ref.showLengthCount,
58
58
  capitalizeFirstLetter = _ref.capitalizeFirstLetter,
59
- props = _objectWithoutProperties(_ref, ['maxlength', 'defaultValue', 'type', 'showLengthCount', 'capitalizeFirstLetter']);
59
+ props = _objectWithoutProperties(_ref, ['maxLength', 'defaultValue', 'type', 'showLengthCount', 'capitalizeFirstLetter']);
60
60
 
61
61
  var _useState = (0, _react.useState)(true),
62
62
  _useState2 = _slicedToArray(_useState, 2),
@@ -89,7 +89,7 @@ var InputText = function InputText(_ref) {
89
89
  return _react2.default.createElement(
90
90
  InputTextDiv,
91
91
  { theme: props.theme, capitalizeFirstLetter: capitalizeFirstLetter || '' },
92
- _react2.default.createElement(InputText.Element, _extends({ type: hidden ? type : 'text', value: props.value, defaultValue: defaultValue }, props, { maxLength: maxlength || '' })),
92
+ _react2.default.createElement(InputText.Element, _extends({ type: hidden ? type : 'text', value: props.value, defaultValue: defaultValue }, props, { maxLength: maxLength || '' })),
93
93
  props.label ? _react2.default.createElement(
94
94
  'label',
95
95
  {
@@ -103,12 +103,12 @@ var InputText = function InputText(_ref) {
103
103
  { value: props.value, theme: props.theme, error: props.error },
104
104
  errorMesssage
105
105
  ) : '',
106
- maxlength && showLengthCount && _react2.default.createElement(
106
+ maxLength && showLengthCount && _react2.default.createElement(
107
107
  CountWrappper,
108
108
  null,
109
109
  props.value.length,
110
110
  '/',
111
- maxlength
111
+ maxLength
112
112
  ),
113
113
  type == 'password' || passwordButton ? _react2.default.createElement(
114
114
  PasswordToggleButton,
@@ -195,8 +195,8 @@ InputText.propTypes = {
195
195
  /** The (HTML) type for the input. */
196
196
  type: _propTypes2.default.string,
197
197
  value: _propTypes2.default.string,
198
- /** The (HTML) maxlength for the input. */
199
- maxlength: _propTypes2.default.number,
198
+ /** The (HTML) maxLength for the input. */
199
+ maxLength: _propTypes2.default.number,
200
200
  showLengthCount: _propTypes2.default.bool,
201
201
  capitalizeFirstLetter: _propTypes2.default.bool,
202
202
  theme: _propTypes2.default.oneOf(['light', 'dark'])
@@ -211,7 +211,7 @@ InputText.defaultProps = {
211
211
  error: null,
212
212
  onChange: null,
213
213
  type: 'text',
214
- // maxlength: 50,
214
+ // maxLength: 50,
215
215
  theme: 'light',
216
216
  value: '',
217
217
  showLengthCount: false
@@ -165,8 +165,7 @@ var Popup = function (_Component) {
165
165
  iconWidth: 18,
166
166
  iconHeight: 18,
167
167
  icon: 'users',
168
- iconBackground: 'tansparent',
169
- label: 'Shared with'
168
+ iconBackground: 'tansparent'
170
169
  }),
171
170
  _react2.default.createElement(
172
171
  'p',
@@ -99,7 +99,7 @@ var Filter = function (_Component) {
99
99
  {
100
100
  if (groupItem.select_type === 'select') {
101
101
  // single select
102
- var selected = selectedFiltersObj[groupItem.field].value === optionItem.field;
102
+ var selected = selectedFiltersObj[groupItem.field] && selectedFiltersObj[groupItem.field].value === optionItem.field;
103
103
  if (selected && groupItem.min_selection === 0) {
104
104
  filters[groupItem.field].value = '';
105
105
  filters.params[groupItem.field] = '';
@@ -366,6 +366,22 @@ var Filter = function (_Component) {
366
366
  });
367
367
  };
368
368
 
369
+ _this.getMaxDate = function (option, groupItem) {
370
+ var _this$state3 = _this.state,
371
+ selectedFiltersObj = _this$state3.selectedFiltersObj,
372
+ isSelectRangeSelected = _this$state3.isSelectRangeSelected;
373
+
374
+
375
+ var maxDate = _constants.CURRENT_DATE;
376
+ if (option.future_date_available) {
377
+ maxDate = new Date('12/31/2099').getTime() * _constants.CONVERT;
378
+ } else if (!isSelectRangeSelected && selectedFiltersObj[groupItem.field].value.fromDate + option.max_days * _constants.CONVERT < _constants.CURRENT_DATE) {
379
+ maxDate = selectedFiltersObj[groupItem.field].value.fromDate + option.max_days * _constants.CONVERT;
380
+ }
381
+
382
+ return maxDate;
383
+ };
384
+
369
385
  _this.render = function () {
370
386
  var _this$props2 = _this.props,
371
387
  filtersStructure = _this$props2.filtersStructure,
@@ -373,11 +389,11 @@ var Filter = function (_Component) {
373
389
  filterMessage = _this$props2.filterMessage,
374
390
  width = _this$props2.width,
375
391
  userIdsList = _this$props2.userIdsList;
376
- var _this$state3 = _this.state,
377
- isMenuOpen = _this$state3.isMenuOpen,
378
- selectedFiltersObj = _this$state3.selectedFiltersObj,
379
- isSelectRangeSelected = _this$state3.isSelectRangeSelected,
380
- showDropDownOptions = _this$state3.showDropDownOptions;
392
+ var _this$state4 = _this.state,
393
+ isMenuOpen = _this$state4.isMenuOpen,
394
+ selectedFiltersObj = _this$state4.selectedFiltersObj,
395
+ isSelectRangeSelected = _this$state4.isSelectRangeSelected,
396
+ showDropDownOptions = _this$state4.showDropDownOptions;
381
397
 
382
398
  return _react2.default.createElement(
383
399
  _react.Fragment,
@@ -568,7 +584,7 @@ var Filter = function (_Component) {
568
584
  labelAsText: true,
569
585
  rangePicker: true,
570
586
  minDate: isSelectRangeSelected ? null : selectedFiltersObj[groupItem.field].value.fromDate - option.max_days * _constants.CONVERT,
571
- maxDate: isSelectRangeSelected ? _constants.CURRENT_DATE : selectedFiltersObj[groupItem.field].value.fromDate + option.max_days * _constants.CONVERT > _constants.CURRENT_DATE ? _constants.CURRENT_DATE : selectedFiltersObj[groupItem.field].value.fromDate + option.max_days * _constants.CONVERT,
587
+ maxDate: _this.getMaxDate(option, groupItem),
572
588
  datepickerStep: 2,
573
589
  selected:
574
590
  // previousSelectedFilters && previousSelectedFilters[groupItem.field].value.key !='date_range' ? []:(
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@desynova-digital/components",
3
- "version": "8.13.3",
3
+ "version": "8.13.6",
4
4
  "description": "Components for Desynova Digital",
5
5
  "main": "index.js",
6
6
  "author": "desynova-digital",
7
7
  "license": "MIT",
8
8
  "repository": "desynova-digital",
9
9
  "dependencies": {
10
- "@desynova-digital/tokens": "8.13.3",
10
+ "@desynova-digital/tokens": "8.13.6",
11
11
  "prop-types": "^15.7.2",
12
12
  "styled-components": "^4.3.2"
13
13
  },