hrm_ui_lib 2.4.22 → 2.4.24

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.
@@ -563,12 +563,14 @@ var Checkbox = /*#__PURE__*/forwardRef(function (props, ref) {
563
563
  _props$helperText = props.helperText,
564
564
  helperText = _props$helperText === void 0 ? '' : _props$helperText,
565
565
  popoverAddons = props.popoverAddons,
566
- isInvalid = props.isInvalid;
566
+ isInvalid = props.isInvalid,
567
+ _props$stopPropagatio = props.stopPropagation,
568
+ stopPropagation = _props$stopPropagatio === void 0 ? false : _props$stopPropagatio;
567
569
  var localRef = useRef(null);
568
570
  var inputRef = ref && Object.keys(ref).length ? ref : localRef;
569
571
  var isChecked = !!value || selectedValue;
570
572
  var changeHandler = function changeHandler(e) {
571
- e.stopPropagation();
573
+ stopPropagation && e.stopPropagation();
572
574
  if (name && setFieldValue) {
573
575
  setFieldValue(name, !isChecked, {
574
576
  shouldValidate: !isChecked
@@ -622,7 +624,7 @@ var Checkbox = /*#__PURE__*/forwardRef(function (props, ref) {
622
624
  'controller--error': isInvalid
623
625
  }, className, !!className)),
624
626
  onClick: function onClick(e) {
625
- return e.stopPropagation();
627
+ return stopPropagation && e.stopPropagation();
626
628
  }
627
629
  }, /*#__PURE__*/React.createElement("input", {
628
630
  "data-id": dataId,
@@ -7,12 +7,12 @@ import { Text } from '../Text';
7
7
  import IconInfo from '../SVGIcons/IconInfo';
8
8
  import { IconDynamicComponent } from '../../helperComponents';
9
9
  export const Checkbox = forwardRef((props, ref) => {
10
- const { label, disabled, required = false, link, name, setFieldValue, selectedValue, value, className = '', iconProps = { name: 'checkmark' }, dataId = '', onClick, beforeLink, afterLink, helperText = '', popoverAddons, isInvalid } = props;
10
+ const { label, disabled, required = false, link, name, setFieldValue, selectedValue, value, className = '', iconProps = { name: 'checkmark' }, dataId = '', onClick, beforeLink, afterLink, helperText = '', popoverAddons, isInvalid, stopPropagation = false } = props;
11
11
  const localRef = useRef(null);
12
12
  const inputRef = ref && Object.keys(ref).length ? ref : localRef;
13
13
  const isChecked = !!value || selectedValue;
14
14
  const changeHandler = (e) => {
15
- e.stopPropagation();
15
+ stopPropagation && e.stopPropagation();
16
16
  if (name && setFieldValue) {
17
17
  setFieldValue(name, !isChecked, { shouldValidate: !isChecked });
18
18
  }
@@ -38,6 +38,6 @@ export const Checkbox = forwardRef((props, ref) => {
38
38
  'controller--disabled': disabled,
39
39
  'controller--error': isInvalid,
40
40
  [className]: !!className
41
- }), onClick: (e) => e.stopPropagation(), children: [_jsx("input", { "data-id": dataId, type: "checkbox", ref: inputRef, tabIndex: 0, onChange: changeHandler, checked: Boolean(isChecked), disabled: disabled }), _jsx("span", { className: "controller__icon", children: _jsx(IconDynamicComponent, { componentName: iconProps.name, size: "xxsmall", type: disabled ? 'disabled' : 'inverse', className: "controller__mark" }) }), checkboxLabel ? (_jsxs("div", { className: "controller__right", children: [_jsxs("div", { className: "flexbox", children: [checkboxLabel, checkboxLabelPopover] }), helperText ? (_jsx(Text, { size: "small", type: disabled ? 'disabled' : 'secondary', children: helperText })) : null] })) : null] }) }));
41
+ }), onClick: (e) => stopPropagation && e.stopPropagation(), children: [_jsx("input", { "data-id": dataId, type: "checkbox", ref: inputRef, tabIndex: 0, onChange: changeHandler, checked: Boolean(isChecked), disabled: disabled }), _jsx("span", { className: "controller__icon", children: _jsx(IconDynamicComponent, { componentName: iconProps.name, size: "xxsmall", type: disabled ? 'disabled' : 'inverse', className: "controller__mark" }) }), checkboxLabel ? (_jsxs("div", { className: "controller__right", children: [_jsxs("div", { className: "flexbox", children: [checkboxLabel, checkboxLabelPopover] }), helperText ? (_jsx(Text, { size: "small", type: disabled ? 'disabled' : 'secondary', children: helperText })) : null] })) : null] }) }));
42
42
  });
43
43
  Checkbox.displayName = 'Checkbox';
@@ -15,4 +15,5 @@ export interface TCheckboxProps extends IFormCompProps {
15
15
  onClick?: (isChecked: boolean) => void;
16
16
  popoverAddons?: TPopoverProps;
17
17
  isInvalid?: boolean;
18
+ stopPropagation?: boolean;
18
19
  }
@@ -10,6 +10,6 @@ export const IndeterminateCheckbox = forwardRef(({ indeterminate, checked, onCha
10
10
  const handleChange = (v) => {
11
11
  onChange({ target: { checked: v } });
12
12
  };
13
- return _jsx(Checkbox, { disabled: disabled, value: checked, onClick: handleChange, ref: resolvedRef });
13
+ return (_jsx(Checkbox, { disabled: disabled, value: checked, onClick: handleChange, ref: resolvedRef, stopPropagation: true }));
14
14
  });
15
15
  IndeterminateCheckbox.displayName = 'IndeterminateCheckbox';
@@ -26,6 +26,10 @@ export function Row({ row, selectedFlatRows, withSelect, uniqueKey, handleRowCli
26
26
  fixed_column_left: (column === null || column === void 0 ? void 0 : column.fixed) === 'left',
27
27
  fixed_column_right: (column === null || column === void 0 ? void 0 : column.fixed) === 'right',
28
28
  fixed_checkbox: isSelection && ((_a = arr[i + 1].column) === null || _a === void 0 ? void 0 : _a.fixed) === 'left'
29
- }), children: render('Cell') }), `table_cell_${uniqueKey}_${i}`));
29
+ }), onClick: (event) => {
30
+ if (isSelection)
31
+ event.stopPropagation();
32
+ cellProps.onClick(event);
33
+ }, children: render('Cell') }), `table_cell_${uniqueKey}_${i}`));
30
34
  }) })));
31
35
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hrm_ui_lib",
3
- "version": "2.4.22",
3
+ "version": "2.4.24",
4
4
  "description": "UI library for Dino",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",