linear-react-components-ui 1.1.21-beta.6 → 1.1.22-beta.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.
@@ -119,7 +119,6 @@ const BaseDialog = props => {
119
119
  const createdModal = /*#__PURE__*/_react.default.createElement("div", {
120
120
  id: id,
121
121
  ref: modalContainerRef,
122
- onBlur: modalContainerWithoutBlur,
123
122
  className: "modalcontainer",
124
123
  onMouseDown: handleClickOutside,
125
124
  style: {
@@ -9,10 +9,10 @@ var _imask = _interopRequireDefault(require("imask"));
9
9
  var helpers = _interopRequireWildcard(require("./helpers"));
10
10
  var _permissionValidations = require("../../permissionValidations");
11
11
  var _format_number = require("../number/format_number");
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
15
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
16
16
  const options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible, _permissionValidations.OPTIONS_ON_DENIED.readOnly, _permissionValidations.OPTIONS_ON_DENIED.hideContent];
17
17
  const IMaskHOC = ComposedComponent => {
18
18
  const MaskedComponent = props => {
@@ -86,12 +86,13 @@ const IMaskHOC = ComposedComponent => {
86
86
  if (onChange && !disableCallbacks && maskRef.current) {
87
87
  const {
88
88
  unmaskedValue,
89
+ value: maskedValue,
89
90
  el
90
91
  } = maskRef.current;
91
92
  const name = el.name || el.input && el.input.name;
92
93
  onChange({
93
94
  target: {
94
- value: unmaskedValue,
95
+ value: isDateField ? maskedValue : unmaskedValue,
95
96
  name
96
97
  }
97
98
  }, props.unmask ? unmaskedValue : maskRef.current.value);
@@ -101,12 +102,13 @@ const IMaskHOC = ComposedComponent => {
101
102
  if (props.onComplete && !disableCallbacks && maskRef.current) {
102
103
  const {
103
104
  unmaskedValue,
105
+ value: maskedValue,
104
106
  el
105
107
  } = maskRef.current;
106
108
  const name = el.name || el.input && el.input.name;
107
109
  props.onComplete({
108
110
  target: {
109
- value: unmaskedValue,
111
+ value: isDateField ? maskedValue : unmaskedValue,
110
112
  name
111
113
  }
112
114
  }, props.unmask ? unmaskedValue : maskRef.current.value);
@@ -197,7 +199,7 @@ const IMaskHOC = ComposedComponent => {
197
199
  }));
198
200
  };
199
201
  const nestedComponentName = ComposedComponent.displayName || ComposedComponent.name || 'Component';
200
- MaskedComponent.displayName = "IMask(".concat(nestedComponentName, ")");
202
+ MaskedComponent.displayName = `IMask(${nestedComponentName})`;
201
203
  return MaskedComponent;
202
204
  };
203
205
  var _default = exports.default = IMaskHOC;
@@ -38,15 +38,24 @@ const PeriodList = _ref => {
38
38
  className: "dropdown-period"
39
39
  }, periodOptions.map(item => {
40
40
  const itemSelected = selected === item.id;
41
- return /*#__PURE__*/_react.default.createElement("button", {
42
- key: String('item-').concat(item.id),
41
+ return /*#__PURE__*/_react.default.createElement("div", {
42
+ role: "button",
43
43
  tabIndex: -1,
44
+ onKeyDown: () => {},
45
+ key: `item-${item.id}`,
44
46
  className: (0, _helper.getDropdownItemCssClass)(itemSelected),
45
47
  onClick: () => {
46
48
  const dates = item.id !== 'custom' ? (0, _helper.CalcDatesByPeriod)(item.id) : null;
47
49
  handleOnSelect(item.id, dates);
48
50
  }
49
- }, item.label);
51
+ }, /*#__PURE__*/_react.default.createElement("span", {
52
+ role: "button",
53
+ className: "menubutton",
54
+ tabIndex: -1,
55
+ onKeyPress: () => {}
56
+ }, /*#__PURE__*/_react.default.createElement("span", {
57
+ className: "label"
58
+ }, item.label)));
50
59
  }));
51
60
  };
52
61
  var _default = exports.default = PeriodList;
@@ -63,7 +63,6 @@ const PeriodPicker = props => {
63
63
  const currentDateButtonRef = (0, _react.useRef)();
64
64
  const buttonSelectPeriodRef = (0, _react.useRef)(null);
65
65
  const dropdownCalendarContainer = (0, _react.useRef)(null);
66
- const dropdownPeriodContainer = (0, _react.useRef)(null);
67
66
  const inputFinalRef = (0, _react.useRef)(null);
68
67
  const calendarContainerRef = (0, _react.useRef)(null);
69
68
  const onScreenResize = () => {
@@ -153,19 +152,6 @@ const PeriodPicker = props => {
153
152
  document.removeEventListener('keydown', onKeyDownPress);
154
153
  };
155
154
  }, [showCalendarValueFinal, showCalendarValueInitial, showPeriodSelection, calendarContainerRef.current]);
156
- (0, _react.useEffect)(() => {
157
- if (valueFinal && valueInitial && (0, _moment.default)(valueFinal).isBefore((0, _moment.default)(valueInitial))) {
158
- setValueInitial(valueFinal);
159
- setValueFinal(valueInitial);
160
- } else if (props.onChange) {
161
- const initial = valueInitial ? valueInitial.format('YYYY-MM-DD') : '';
162
- const final = valueFinal ? valueFinal.format('YYYY-MM-DD') : '';
163
- props.onChange(undefined, '', {
164
- initial,
165
- final
166
- });
167
- }
168
- }, [valueInitial, valueFinal]);
169
155
  (0, _react.useEffect)(() => {
170
156
  if (props.value && !((0, _moment.default)(props.value.initial).isSame(valueInitial) || (0, _moment.default)(props.value.final).isSame(valueFinal))) {
171
157
  const {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linear-react-components-ui",
3
- "version": "1.1.21-beta.6",
3
+ "version": "1.1.22-beta.1",
4
4
  "description": "Linear Sistemas ReactJs Components",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.cjs",