intelicoreact 1.0.77 → 1.0.78

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.
@@ -364,9 +364,11 @@ var Dropdown = function Dropdown(_ref) {
364
364
  (0, _react.useLayoutEffect)(function () {
365
365
  window.addEventListener('resize', setListContainerStyles);
366
366
  window.addEventListener('mousewheel', closeList);
367
+ window.addEventListener('touchmove', closeList);
367
368
  return function () {
368
369
  window.removeEventListener('resize', setListContainerStyles);
369
370
  window.removeEventListener('mousewheel', closeList);
371
+ window.removeEventListener('touchmove', closeList);
370
372
  };
371
373
  }, [getListContainer]);
372
374
  (0, _react.useEffect)(function () {
@@ -87,7 +87,8 @@ var InputDateRange = function InputDateRange(props) {
87
87
  isCompare = _useState4[0],
88
88
  setIsCompare = _useState4[1];
89
89
 
90
- var ref = !isUseAbs ? (0, _dependencies.useClickOutside)(toggleOff) : (0, _react.useRef)(null);
90
+ var dropdownContainers = document.getElementsByClassName('dropdown__container');
91
+ var ref = !isUseAbs ? (0, _dependencies.useClickOutside)(toggleOff, dropdownContainers) : (0, _react.useRef)(null);
91
92
  var internalContainerRef = (0, _react.useRef)(null);
92
93
 
93
94
  var handleChange = function handleChange(input) {
@@ -31,9 +31,23 @@ var useClickOutside = function useClickOutside(hideComponent, additionalComponen
31
31
  var ref = (0, _react.useRef)(null);
32
32
 
33
33
  var checkCondition = function checkCondition(target) {
34
- var _ref$current, _ref$current2;
34
+ if (additionalComponent) {
35
+ if (additionalComponent !== null && additionalComponent !== void 0 && additionalComponent.length) {
36
+ var _ref$current, _Array$from;
35
37
 
36
- return additionalComponent ? !((_ref$current = ref.current) !== null && _ref$current !== void 0 && _ref$current.contains(target)) && !(additionalComponent !== null && additionalComponent !== void 0 && additionalComponent.contains(target)) : !((_ref$current2 = ref.current) !== null && _ref$current2 !== void 0 && _ref$current2.contains(target));
38
+ return !((_ref$current = ref.current) !== null && _ref$current !== void 0 && _ref$current.contains(target)) && !((_Array$from = Array.from(additionalComponent)) !== null && _Array$from !== void 0 && _Array$from.some(function (item) {
39
+ return item === null || item === void 0 ? void 0 : item.contains(target);
40
+ }));
41
+ } else {
42
+ var _ref$current2;
43
+
44
+ return !((_ref$current2 = ref.current) !== null && _ref$current2 !== void 0 && _ref$current2.contains(target)) && !(additionalComponent !== null && additionalComponent !== void 0 && additionalComponent.contains(target));
45
+ }
46
+ } else {
47
+ var _ref$current3;
48
+
49
+ return !((_ref$current3 = ref.current) !== null && _ref$current3 !== void 0 && _ref$current3.contains(target));
50
+ }
37
51
  };
38
52
 
39
53
  var handleClickOutside = (0, _react.useCallback)(function (_ref) {
@@ -55,6 +55,8 @@ var RangeList = function RangeList(props) {
55
55
  error = props.error,
56
56
  defaultErrorText = props.defaultErrorText,
57
57
  nullValueText = props.nullValueText,
58
+ _props$isOnlyOneRow = props.isOnlyOneRow,
59
+ isOnlyOneRow = _props$isOnlyOneRow === void 0 ? false : _props$isOnlyOneRow,
58
60
  testId = props.testId;
59
61
  var NULL_VALUE_TEXT = nullValueText !== null && nullValueText !== void 0 ? nullValueText : 'No data';
60
62
 
@@ -76,6 +78,7 @@ var RangeList = function RangeList(props) {
76
78
  var inputFromRef = (0, _react.useRef)(null);
77
79
  var inputToRef = (0, _react.useRef)(null);
78
80
  var isValidRange = !!(state !== null && state !== void 0 && state.from && state !== null && state !== void 0 && state.to && +(state === null || state === void 0 ? void 0 : state.from) <= +(state === null || state === void 0 ? void 0 : state.to));
81
+ var isShowRow = isOnlyOneRow && (value === null || value === void 0 ? void 0 : value.length) === 0 || !isOnlyOneRow;
79
82
  var handle = {
80
83
  inputsChange: function inputsChange(val, prop) {
81
84
  return setState(_objectSpread(_objectSpread({}, state), {}, (0, _defineProperty2.default)({}, prop, val)));
@@ -126,6 +129,60 @@ var RangeList = function RangeList(props) {
126
129
  if (code === 13) inputToRef.current.blur();
127
130
  }
128
131
  };
132
+
133
+ var renderInputsAndAddButtonRow = function renderInputsAndAddButtonRow() {
134
+ return /*#__PURE__*/_react.default.createElement("div", {
135
+ className: (0, _classnames.default)("".concat(RC, "__row"), "".concat(RC, "__inputs"))
136
+ }, /*#__PURE__*/_react.default.createElement(_RangeListRow.RangeListCell, {
137
+ className: "".concat(RC, "__cell-input")
138
+ }, /*#__PURE__*/_react.default.createElement(_Input.default, {
139
+ testId: "range-list".concat(testId && "--".concat(testId), "-from"),
140
+ ref: inputFromRef,
141
+ onlyNumbers: isFloatValues ? {
142
+ type: 'float',
143
+ decimalPlaces: decimalPlaces || 0
144
+ } : {
145
+ type: 'int'
146
+ },
147
+ value: state.from,
148
+ onBlur: function onBlur(e) {
149
+ return handle.rangeValidation(e, 'from');
150
+ },
151
+ onChange: function onChange(val) {
152
+ return handle.inputsChange(val, 'from');
153
+ },
154
+ onKeyUp: function onKeyUp(code) {
155
+ return handle.onKeyUpFromInput(code);
156
+ }
157
+ })), /*#__PURE__*/_react.default.createElement(_RangeListRow.RangeListCell, {
158
+ className: "".concat(RC, "__cell-input")
159
+ }, /*#__PURE__*/_react.default.createElement(_Input.default, {
160
+ testId: "range-list".concat(testId && "--".concat(testId), "-to"),
161
+ ref: inputToRef,
162
+ onlyNumbers: isFloatValues ? {
163
+ type: 'float',
164
+ decimalPlaces: decimalPlaces || 0
165
+ } : {
166
+ type: 'int'
167
+ },
168
+ value: state.to,
169
+ onBlur: function onBlur(e) {
170
+ return handle.rangeValidation(e, 'to');
171
+ },
172
+ onChange: function onChange(val) {
173
+ return handle.inputsChange(val, 'to');
174
+ },
175
+ onKeyUp: function onKeyUp(code) {
176
+ return handle.onKeyUpToInput(code);
177
+ }
178
+ })), /*#__PURE__*/_react.default.createElement(_RangeListRow.RangeListCell, {
179
+ className: "".concat(RC, "__cell-button")
180
+ }, /*#__PURE__*/_react.default.createElement(_Button.default, {
181
+ testId: "range-list".concat(testId && "--".concat(testId), "-button"),
182
+ onClick: handle.addRange
183
+ }, "Add")));
184
+ };
185
+
129
186
  return /*#__PURE__*/_react.default.createElement("div", {
130
187
  className: (0, _classnames.default)(RC, className, (0, _defineProperty2.default)({}, "".concat(RC, "_disabled"), disabled))
131
188
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -134,56 +191,7 @@ var RangeList = function RangeList(props) {
134
191
  className: "".concat(RC, "__cell-label")
135
192
  }, "From"), /*#__PURE__*/_react.default.createElement(_RangeListRow.RangeListCell, {
136
193
  className: "".concat(RC, "__cell-label")
137
- }, "To")), /*#__PURE__*/_react.default.createElement("div", {
138
- className: (0, _classnames.default)("".concat(RC, "__row"), "".concat(RC, "__inputs"))
139
- }, /*#__PURE__*/_react.default.createElement(_RangeListRow.RangeListCell, {
140
- className: "".concat(RC, "__cell-input")
141
- }, /*#__PURE__*/_react.default.createElement(_Input.default, {
142
- testId: "range-list".concat(testId && "--".concat(testId), "-from"),
143
- ref: inputFromRef,
144
- onlyNumbers: isFloatValues ? {
145
- type: 'float',
146
- decimalPlaces: decimalPlaces || 0
147
- } : {
148
- type: 'int'
149
- },
150
- value: state.from,
151
- onBlur: function onBlur(e) {
152
- return handle.rangeValidation(e, 'from');
153
- },
154
- onChange: function onChange(val) {
155
- return handle.inputsChange(val, 'from');
156
- },
157
- onKeyUp: function onKeyUp(code) {
158
- return handle.onKeyUpFromInput(code);
159
- }
160
- })), /*#__PURE__*/_react.default.createElement(_RangeListRow.RangeListCell, {
161
- className: "".concat(RC, "__cell-input")
162
- }, /*#__PURE__*/_react.default.createElement(_Input.default, {
163
- testId: "range-list".concat(testId && "--".concat(testId), "-to"),
164
- ref: inputToRef,
165
- onlyNumbers: isFloatValues ? {
166
- type: 'float',
167
- decimalPlaces: decimalPlaces || 0
168
- } : {
169
- type: 'int'
170
- },
171
- value: state.to,
172
- onBlur: function onBlur(e) {
173
- return handle.rangeValidation(e, 'to');
174
- },
175
- onChange: function onChange(val) {
176
- return handle.inputsChange(val, 'to');
177
- },
178
- onKeyUp: function onKeyUp(code) {
179
- return handle.onKeyUpToInput(code);
180
- }
181
- })), /*#__PURE__*/_react.default.createElement(_RangeListRow.RangeListCell, {
182
- className: "".concat(RC, "__cell-button")
183
- }, /*#__PURE__*/_react.default.createElement(_Button.default, {
184
- testId: "range-list".concat(testId && "--".concat(testId), "-button"),
185
- onClick: handle.addRange
186
- }, "Add"))), (innerError || outerError || error) && /*#__PURE__*/_react.default.createElement("span", {
194
+ }, "To")), isShowRow && renderInputsAndAddButtonRow(), (innerError || outerError || error) && /*#__PURE__*/_react.default.createElement("span", {
187
195
  className: "".concat(RC, "__error")
188
196
  }, innerError || error || outerError), !(value !== null && value !== void 0 && value.length) && /*#__PURE__*/_react.default.createElement("div", {
189
197
  className: (0, _classnames.default)("".concat(RC, "__row"), "".concat(RC, "__values"), "".concat(RC, "__null-value"))
@@ -196,7 +196,9 @@ var TieredCheckboxes = function TieredCheckboxes(_ref) {
196
196
  var disabled = _ref4.disabled;
197
197
  return disabled === true;
198
198
  }) || parent.disabled
199
- }), renderInner(parent));
199
+ }), /*#__PURE__*/_react.default.createElement("div", {
200
+ className: (0, _classnames.default)("".concat(RC, "__parent__children"))
201
+ }, renderInner(parent)));
200
202
  }));
201
203
  };
202
204
 
@@ -1,6 +1,10 @@
1
1
  .tiered-checkboxes {
2
2
  &__parents {
3
3
  margin-bottom: 25px;
4
+
5
+ & > label {
6
+ display: inline-flex;
7
+ }
4
8
  }
5
9
 
6
10
  &__children {
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _classnames = _interopRequireDefault(require("classnames"));
13
+
14
+ require("./Box.scss");
15
+
16
+ // global
17
+ // styles
18
+ var directionVariants = {
19
+ column: 'column',
20
+ row: 'row'
21
+ };
22
+ var sizes = {
23
+ none: 'none',
24
+ xs: 'xs',
25
+ s: 's',
26
+ m: 'm',
27
+ l: 'l',
28
+ xl: 'xl'
29
+ };
30
+
31
+ var Box = function Box(_ref) {
32
+ var children = _ref.children,
33
+ _ref$paddingVariant = _ref.paddingVariant,
34
+ paddingVariant = _ref$paddingVariant === void 0 ? sizes.m : _ref$paddingVariant,
35
+ _ref$radiiVariant = _ref.radiiVariant,
36
+ radiiVariant = _ref$radiiVariant === void 0 ? sizes.s : _ref$radiiVariant,
37
+ _ref$direction = _ref.direction,
38
+ direction = _ref$direction === void 0 ? directionVariants.column : _ref$direction,
39
+ className = _ref.className;
40
+ var styles = {
41
+ flexDirection: direction
42
+ };
43
+ return /*#__PURE__*/_react.default.createElement("div", {
44
+ style: styles,
45
+ className: (0, _classnames.default)('box', "box--padding-".concat(paddingVariant), "box--radii-".concat(radiiVariant), className, {
46
+ df: direction === directionVariants.row,
47
+ 'dfc-jc': direction === directionVariants.column
48
+ })
49
+ }, children);
50
+ };
51
+
52
+ var _default = Box;
53
+ exports.default = _default;
@@ -0,0 +1,58 @@
1
+ @import '../../../scss/_vars';
2
+
3
+ .box {
4
+ box-sizing: border-box;
5
+ height: fit-content;
6
+
7
+ border: 1px solid #E1E8F1;
8
+
9
+ &--radii-none {
10
+ border-radius: 0;
11
+ }
12
+
13
+
14
+ &--radii-xs {
15
+ border-radius: $radii-xs;
16
+ }
17
+
18
+ &--radii-s {
19
+ border-radius: $radii-s;
20
+ }
21
+
22
+ &--radii-m {
23
+ border-radius: $radii-m;
24
+ }
25
+
26
+ &--radii-l {
27
+ border-radius: $radii-l;
28
+ }
29
+
30
+ &--radii-xl {
31
+ border-radius: $radii-xl;
32
+ }
33
+
34
+ &--padding-none {
35
+ padding: 0;
36
+ }
37
+
38
+
39
+ &--padding-xs {
40
+ padding: $spacing-xs;
41
+ }
42
+
43
+ &--padding-s {
44
+ padding: $spacing-s;
45
+ }
46
+
47
+ &--padding-m {
48
+ padding: $spacing-m;
49
+ }
50
+
51
+ &--padding-l {
52
+ padding: $spacing-l;
53
+ }
54
+
55
+ &--padding-xl {
56
+ padding: $spacing-xl;
57
+ }
58
+ }
@@ -2,6 +2,19 @@
2
2
  //@import "anme/scss/anme-vars";
3
3
  @import "~anme/scss/anme-vars";
4
4
 
5
+ $radii-xs: 4px;
6
+ $radii-s: 8px;
7
+ $radii-m: 16px;
8
+ $radii-l: 24px;
9
+ $radii-xl: 32px;
10
+
11
+
12
+ $spacing-xs: 4px;
13
+ $spacing-s: 8px;
14
+ $spacing-m: 16px;
15
+ $spacing-l: 24px;
16
+ $spacing-xl: 32px;
17
+
5
18
  /* THEME COLORS */
6
19
 
7
20
  $color--secondary: #F06D8D;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "1.0.77",
3
+ "version": "1.0.78",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [