linear-react-components-ui 1.1.22-beta.9 → 1.1.22

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.
@@ -162,10 +162,7 @@ const DefaultButton = _ref => {
162
162
  },
163
163
  tabIndex: isDisabled ? -1 : tabIndex
164
164
  }), /*#__PURE__*/_react.default.createElement("div", {
165
- className: "button-container",
166
- style: {
167
- pointerEvents: 'none'
168
- }
165
+ className: "button-container"
169
166
  }, !dropdown && getIcon(), content || label && /*#__PURE__*/_react.default.createElement("div", {
170
167
  className: "button-content"
171
168
  }, content, label || ''), dropdown && getIcon()), isLoading && /*#__PURE__*/_react.default.createElement("div", {
@@ -71,7 +71,7 @@ const ColorPicker = props => {
71
71
  ref: inputRef,
72
72
  type: "color",
73
73
  defaultValue: color,
74
- name: name,
74
+ name: `${name}-hidden`,
75
75
  onClick: e => onButtonClick ? onButtonClick(e) : undefined,
76
76
  onInput: onInputChangeDefault
77
77
  })],
@@ -43,7 +43,9 @@ const PeriodPicker = props => {
43
43
  hintPosition = 'below',
44
44
  themePopover = 'light',
45
45
  popoverAlign = 'left',
46
- gridLayout
46
+ gridLayout,
47
+ nameDateInitial = 'valueInitial',
48
+ nameDateFinal = 'valueFinal'
47
49
  } = props;
48
50
  const idValueInitial = (0, _react.useId)();
49
51
  const idValueFinal = (0, _react.useId)();
@@ -244,7 +246,7 @@ const PeriodPicker = props => {
244
246
  name: changingAux
245
247
  } = event.target;
246
248
  if (value && value.replace(/\D/g, '').trim().length !== 0) {
247
- if (changingAux === 'valueInitial') {
249
+ if (changingAux === nameDateInitial) {
248
250
  setValueInitial(undefined);
249
251
  } else {
250
252
  setValueFinal(undefined);
@@ -268,21 +270,21 @@ const PeriodPicker = props => {
268
270
  const dateObj = (0, _moment.default)(value, 'DD/MM/YYYY');
269
271
  if (showCalendarValueInitial) inputInitialRef.current?.focus();
270
272
  if (showCalendarValueFinal) inputFinalRef.current?.focus();
271
- if (valueDateName === 'valueFinal' && valueInitial && dateObj.isBefore(valueInitial)) {
273
+ if (valueDateName === nameDateFinal && valueInitial && dateObj.isBefore(valueInitial)) {
272
274
  setValueInitial(dateObj);
273
275
  setValueFinal(valueInitial);
274
276
  onDateChange({
275
277
  initial: dateObj,
276
278
  final: valueInitial
277
279
  });
278
- } else if (valueDateName === 'valueInitial' && valueFinal && dateObj.isAfter(valueFinal)) {
280
+ } else if (valueDateName === nameDateInitial && valueFinal && dateObj.isAfter(valueFinal)) {
279
281
  setValueInitial(valueFinal);
280
282
  setValueFinal(dateObj);
281
283
  onDateChange({
282
284
  initial: valueFinal,
283
285
  final: dateObj
284
286
  });
285
- } else if (valueDateName === 'valueInitial') {
287
+ } else if (valueDateName === nameDateInitial) {
286
288
  setValueInitial(dateObj);
287
289
  onDateChange({
288
290
  initial: dateObj,
@@ -295,7 +297,7 @@ const PeriodPicker = props => {
295
297
  final: dateObj
296
298
  });
297
299
  }
298
- if (valueDateName === 'valueInitial' && !valueFinal && shouldOpenDropdown) {
300
+ if (valueDateName === nameDateInitial && !valueFinal && shouldOpenDropdown) {
299
301
  inputFinalRef.current?.focus();
300
302
  setTimeout(() => setShowCalendarValueFinal(true), 100);
301
303
  }
@@ -405,7 +407,7 @@ const PeriodPicker = props => {
405
407
  handlerClose: () => onCloseDateDialog('valueInitial'),
406
408
  dialogSize: dialogSize,
407
409
  onOpenChange: setShowCalendarValueInitial
408
- }, getCalendar(valueInitial, calendarColorStyle, 'valueInitial'));
410
+ }, getCalendar(valueInitial, calendarColorStyle, nameDateInitial));
409
411
  }
410
412
  return /*#__PURE__*/_react.default.createElement(_Dropdown.default, {
411
413
  containerRef: wrapperBaseInputPeriodRef,
@@ -424,7 +426,7 @@ const PeriodPicker = props => {
424
426
  handlerClose: () => onCloseDateDialog('valueFinal'),
425
427
  dialogSize: dialogSize,
426
428
  onOpenChange: setShowCalendarValueFinal
427
- }, getCalendar(valueFinal, calendarColorStyle, 'valueFinal'));
429
+ }, getCalendar(valueFinal, calendarColorStyle, nameDateFinal));
428
430
  }
429
431
  return /*#__PURE__*/_react.default.createElement(_Dropdown.default, {
430
432
  containerRef: wrapperBaseInputPeriodRef,
@@ -1,5 +1,5 @@
1
1
  import { Moment } from 'moment';
2
- import { ReactNode, RefObject } from 'react';
2
+ import { ReactNode, RefObject, MouseEvent } from 'react';
3
3
  import { ColorStyles } from '../../@types/ColorStyles.js';
4
4
  import { Period } from '../../@types/Period.js';
5
5
  import { PermissionAttr } from '../../@types/PermissionAttr.js';
@@ -55,11 +55,14 @@ interface IPeriodPickerProps {
55
55
  calendarColorStyle?: ColorStyles;
56
56
  required?: boolean;
57
57
  onChange?: (event?: CustomInputEvent, maskValue?: string, date?: Period) => void;
58
+ onClick?: (event?: MouseEvent) => void;
58
59
  disabled?: boolean;
59
60
  permissionAttr?: PermissionAttr;
60
61
  errorMessages?: string[];
61
62
  name?: string;
62
63
  hint?: string;
64
+ nameDateInitial?: string;
65
+ nameDateFinal?: string;
63
66
  hintPosition?: 'below' | 'onLabelRight';
64
67
  onBlur?: (e: CustomInputEvent) => void;
65
68
  onFocus?: (e: CustomInputEvent) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linear-react-components-ui",
3
- "version": "1.1.22-beta.9",
3
+ "version": "1.1.22",
4
4
  "description": "Linear Sistemas ReactJs Components",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.cjs",