pollination-react-io 1.75.0 → 1.75.2

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.
@@ -18,5 +18,6 @@ export interface BaseDropdownProps {
18
18
  icon?: React.ReactNode;
19
19
  onSelect?: (option: Option) => any;
20
20
  disabled?: boolean;
21
+ action?: 'hover' | 'click';
21
22
  }
22
23
  export declare const BaseDropdown: FC<BaseDropdownProps>;
@@ -53199,19 +53199,28 @@ var BaseDropdown = function (_a) {
53199
53199
  } : _b, _c = _a.childOverlayStyle, childOverlayStyle = _c === void 0 ? {
53200
53200
  padding: '10px',
53201
53201
  cursor: 'pointer'
53202
- } : _c, _d = _a.triggerStyle, triggerStyle = _d === void 0 ? {} : _d, _e = _a.placement, placement = _e === void 0 ? 'bottomCenter' : _e, _f = _a.icon, icon = _f === void 0 ? React__default.createElement(CaretDownFill$1, { size: 12 }) : _f, _g = _a.onSelect, onSelect = _g === void 0 ? function (option) { } : _g, _h = _a.disabled, disabled = _h === void 0 ? false : _h;
53202
+ } : _c, _d = _a.triggerStyle, triggerStyle = _d === void 0 ? {} : _d, _e = _a.placement, placement = _e === void 0 ? 'bottomCenter' : _e, _f = _a.icon, icon = _f === void 0 ? React__default.createElement(CaretDownFill$1, { size: 12 }) : _f, _g = _a.onSelect, onSelect = _g === void 0 ? function (option) { } : _g, _h = _a.disabled, disabled = _h === void 0 ? false : _h, _j = _a.action, action = _j === void 0 ? 'click' : _j;
53203
53203
  var renderItem = useCallback(function (o) {
53204
53204
  switch (o.type) {
53205
53205
  case 'link':
53206
- return (React__default.createElement("div", { style: childOverlayStyle, className: 'basedropdown-overlay-child', key: o.id, tabIndex: 0, role: 'button', onClick: function () { return window.location.href = o.to; } },
53206
+ return (React__default.createElement("div", { style: childOverlayStyle, className: 'basedropdown-overlay-child', key: o.id, tabIndex: 0, role: 'button', onClick: function (e) {
53207
+ e.stopPropagation();
53208
+ window.location.href = o.to;
53209
+ } },
53207
53210
  o.icon && React__default.createElement("span", { style: { marginRight: '5px' } }, o.icon),
53208
53211
  o.label));
53209
53212
  case 'label':
53210
- return (React__default.createElement("div", { style: childOverlayStyle, key: o.id, tabIndex: 0, role: 'button', onClick: function () { return onSelect(o); } },
53213
+ return (React__default.createElement("div", { style: childOverlayStyle, key: o.id, tabIndex: 0, role: 'button', onClick: function (e) {
53214
+ e.stopPropagation();
53215
+ onSelect(o);
53216
+ } },
53211
53217
  o.icon && React__default.createElement("span", { style: { marginRight: '5px' } }, o.icon),
53212
53218
  o.label));
53213
53219
  default:
53214
- return (React__default.createElement(Button, { style: childOverlayStyle, key: o.id, onClick: function () { return onSelect(o); } },
53220
+ return (React__default.createElement(Button, { style: childOverlayStyle, key: o.id, onClick: function (e) {
53221
+ e.stopPropagation();
53222
+ onSelect(o);
53223
+ } },
53215
53224
  o.icon,
53216
53225
  o.label));
53217
53226
  }
@@ -53219,10 +53228,10 @@ var BaseDropdown = function (_a) {
53219
53228
  return (React__default.createElement("div", null,
53220
53229
  React__default.createElement("div", { style: { display: 'flex' } },
53221
53230
  children,
53222
- React__default.createElement(Dropdown$1, { trigger: ['click'], overlayStyle: overlayStyle, placement: placement, animation: 'slide-up',
53231
+ React__default.createElement(Dropdown$1, { trigger: [action], overlayStyle: overlayStyle, placement: placement, animation: 'slide-up',
53223
53232
  // @ts-ignore
53224
53233
  overlay: options && options.map(renderItem) },
53225
- React__default.createElement("button", { disabled: disabled, className: 'poll-button', style: triggerStyle }, icon)))));
53234
+ React__default.createElement("button", { disabled: disabled, className: 'poll-button', style: triggerStyle, onClick: function (e) { return e.stopPropagation(); } }, icon)))));
53226
53235
  };
53227
53236
 
53228
53237
  var getAction$2 = function (key) {