pollination-react-io 1.76.0 → 1.76.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.
@@ -19,5 +19,7 @@ export interface BaseDropdownProps {
19
19
  onSelect?: (option: Option) => any;
20
20
  disabled?: boolean;
21
21
  action?: 'hover' | 'click';
22
+ activeId?: string;
23
+ selectedStyle?: CSSProperties;
22
24
  }
23
25
  export declare const BaseDropdown: FC<BaseDropdownProps>;
@@ -53193,43 +53193,51 @@ styleInject(css_248z$7);
53193
53193
 
53194
53194
  var BaseDropdown = function (_a) {
53195
53195
  var options = _a.options, children = _a.children, _b = _a.overlayStyle, overlayStyle = _b === void 0 ? {
53196
- border: 'solid 1px #000',
53196
+ border: 'solid 1px #606470',
53197
53197
  backgroundColor: '#fff',
53198
53198
  padding: '5px',
53199
- borderRadius: '5px'
53199
+ borderRadius: '5px',
53200
53200
  } : _b, _c = _a.childOverlayStyle, childOverlayStyle = _c === void 0 ? {
53201
53201
  padding: '10px',
53202
- cursor: 'pointer'
53203
- } : _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;
53202
+ cursor: 'pointer',
53203
+ } : _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, _k = _a.activeId, activeId = _k === void 0 ? undefined : _k, _l = _a.selectedStyle, selectedStyle = _l === void 0 ? {
53204
+ backgroundColor: '#40a9ff',
53205
+ color: '#fff',
53206
+ fontWeight: 'bold'
53207
+ } : _l;
53208
+ var _m = useState(activeId), selection = _m[0], setSelection = _m[1];
53204
53209
  var renderItem = useCallback(function (o) {
53205
53210
  switch (o.type) {
53206
53211
  case 'link':
53207
- return (React__default.createElement("div", { style: childOverlayStyle, className: 'basedropdown-overlay-child', key: o.id, tabIndex: 0, role: 'button', onClick: function (e) {
53208
- e.stopPropagation();
53212
+ return (React__default.createElement("div", { style: o.id == selection
53213
+ ? __assign(__assign({}, childOverlayStyle), selectedStyle) : childOverlayStyle, className: 'basedropdown-overlay-child', key: o.id, tabIndex: 0, role: 'button', onClick: function (e) {
53209
53214
  window.location.href = o.to;
53215
+ setSelection(o.id);
53210
53216
  } },
53211
53217
  o.icon && React__default.createElement("span", { style: { marginRight: '5px' } }, o.icon),
53212
53218
  o.label));
53213
53219
  case 'label':
53214
- return (React__default.createElement("div", { style: childOverlayStyle, key: o.id, tabIndex: 0, role: 'button', onClick: function (e) {
53215
- e.stopPropagation();
53220
+ return (React__default.createElement("div", { style: o.id == selection
53221
+ ? __assign(__assign({}, childOverlayStyle), selectedStyle) : childOverlayStyle, key: o.id, tabIndex: 0, role: 'button', onClick: function (e) {
53216
53222
  onSelect(o);
53223
+ setSelection(o.id);
53217
53224
  } },
53218
53225
  o.icon && React__default.createElement("span", { style: { marginRight: '5px' } }, o.icon),
53219
53226
  o.label));
53220
53227
  default:
53221
- return (React__default.createElement(Button, { style: childOverlayStyle, key: o.id, onClick: function (e) {
53222
- e.stopPropagation();
53228
+ return (React__default.createElement(Button, { style: o.id == selection
53229
+ ? __assign(__assign({}, childOverlayStyle), selectedStyle) : childOverlayStyle, key: o.id, onClick: function (e) {
53223
53230
  onSelect(o);
53231
+ setSelection(o.id);
53224
53232
  } },
53225
53233
  o.icon,
53226
53234
  o.label));
53227
53235
  }
53228
- }, []);
53236
+ }, [selection]);
53229
53237
  return (React__default.createElement("div", null,
53230
53238
  React__default.createElement("div", { style: { display: 'flex' } },
53231
53239
  children,
53232
- React__default.createElement(Dropdown$1, { trigger: [action], overlayStyle: overlayStyle, placement: placement, animation: 'slide-up',
53240
+ React__default.createElement(Dropdown$1, { trigger: [action], overlayStyle: overlayStyle, placement: placement, animation: 'slide-up', onOverlayClick: function (e) { return e.stopPropagation(); },
53233
53241
  // @ts-ignore
53234
53242
  overlay: options && options.map(renderItem) },
53235
53243
  React__default.createElement("button", { disabled: disabled, className: 'poll-button', style: triggerStyle, onClick: function (e) { return e.stopPropagation(); } }, icon)))));
@@ -53329,23 +53337,18 @@ var SendGeometry = function (_a) {
53329
53337
  clear: "Clear geometry from the ".concat(host, " viewport"),
53330
53338
  'subscribe-preview': "Render geometry in the ".concat(host, " viewport"),
53331
53339
  };
53332
- return React__default.createElement(BaseDropdown, { icon: React__default.createElement(Logo, { size: 18 }), childOverlayStyle: {
53340
+ return React__default.createElement(BaseDropdown, { childOverlayStyle: {
53333
53341
  width: 'auto',
53334
53342
  backgroundColor: 'white',
53335
- color: 'black',
53343
+ color: '#393e46',
53336
53344
  fontSize: '14px',
53337
53345
  padding: '10px',
53338
53346
  cursor: 'pointer'
53339
- }, triggerStyle: {
53340
- backgroundColor: 'white',
53341
- color: 'black',
53342
- border: 'solid 1px #000'
53343
- }, disabled: disabled, action: 'hover', onSelect: onSelect, options: values },
53347
+ }, placement: 'bottomRight', activeId: defaultAction, disabled: disabled, action: 'hover', onSelect: onSelect, options: values },
53344
53348
  React__default.createElement(Button, { title: helpTextButton[currOption === null || currOption === void 0 ? void 0 : currOption.id], disabled: disabled, style: {
53345
- backgroundColor: 'white',
53346
- color: 'black',
53349
+ width: '100%',
53347
53350
  fontSize: '14px',
53348
- border: 'solid 1px #000'
53351
+ border: 'solid 1px #fff'
53349
53352
  }, onClick: function (e) {
53350
53353
  e.stopPropagation();
53351
53354
  if (disabled)
@@ -53466,23 +53469,18 @@ var SendModel = function (_a) {
53466
53469
  replace: "Replace the model in the ".concat(host, " viewport"),
53467
53470
  'subscribe-preview': "Render the model in the ".concat(host, " viewport"),
53468
53471
  };
53469
- return React__default.createElement(BaseDropdown, { icon: React__default.createElement(Logo, { size: 18 }), childOverlayStyle: {
53472
+ return React__default.createElement(BaseDropdown, { childOverlayStyle: {
53470
53473
  width: 'auto',
53471
53474
  backgroundColor: 'white',
53472
- color: 'black',
53475
+ color: '#393e46',
53473
53476
  fontSize: '14px',
53474
53477
  padding: '10px',
53475
53478
  cursor: 'pointer'
53476
- }, triggerStyle: {
53477
- backgroundColor: 'white',
53478
- color: 'black',
53479
- border: 'solid 1px #000'
53480
- }, disabled: disabled, onSelect: onSelect, action: 'hover', options: values },
53479
+ }, placement: 'bottomRight', activeId: defaultAction, disabled: disabled, onSelect: onSelect, action: 'hover', options: values },
53481
53480
  React__default.createElement(Button, { title: helpTextButton[currOption === null || currOption === void 0 ? void 0 : currOption.id], disabled: disabled, style: {
53482
- backgroundColor: 'white',
53483
- color: 'black',
53481
+ width: '100%',
53484
53482
  fontSize: '14px',
53485
- border: 'solid 1px #000'
53483
+ border: 'solid 1px #fff'
53486
53484
  }, onClick: function (e) {
53487
53485
  e.stopPropagation();
53488
53486
  if (disabled)
@@ -53601,23 +53599,18 @@ var SendResults = function (_a) {
53601
53599
  clear: "Clear results from the ".concat(host, " viewport"),
53602
53600
  'subscribe-preview': "Render results in the ".concat(host, " viewport"),
53603
53601
  };
53604
- return React__default.createElement(BaseDropdown, { icon: React__default.createElement(Logo, { size: 18 }), childOverlayStyle: {
53602
+ return React__default.createElement(BaseDropdown, { childOverlayStyle: {
53605
53603
  width: 'auto',
53606
53604
  backgroundColor: 'white',
53607
- color: 'black',
53605
+ color: '#393e46',
53608
53606
  fontSize: '14px',
53609
53607
  padding: '10px',
53610
53608
  cursor: 'pointer'
53611
- }, triggerStyle: {
53612
- backgroundColor: 'white',
53613
- color: 'black',
53614
- border: 'solid 1px #000'
53615
- }, action: 'hover', disabled: disabled, onSelect: onSelect, options: values },
53609
+ }, placement: 'bottomRight', activeId: defaultAction, action: 'hover', disabled: disabled, onSelect: onSelect, options: values },
53616
53610
  React__default.createElement(Button, { title: helpTextButton[currOption === null || currOption === void 0 ? void 0 : currOption.id], disabled: disabled, style: {
53617
- backgroundColor: 'white',
53618
- color: 'black',
53611
+ width: '100%',
53619
53612
  fontSize: '14px',
53620
- border: 'solid 1px #000'
53613
+ border: 'solid 1px #fff'
53621
53614
  }, onClick: function (e) {
53622
53615
  e.stopPropagation();
53623
53616
  if (disabled)
@@ -56058,7 +56051,7 @@ var FileCard = function (_a) {
56058
56051
  add: true,
56059
56052
  delete: false,
56060
56053
  'subscribe-preview': false,
56061
- clear: true,
56054
+ clear: false,
56062
56055
  preview: true,
56063
56056
  replace: true,
56064
56057
  }, key: CADdata.id, defaultKey: CADdata.id }),
@@ -56068,7 +56061,7 @@ var FileCard = function (_a) {
56068
56061
  add: true,
56069
56062
  delete: (host === 'revit'),
56070
56063
  'subscribe-preview': false,
56071
- clear: (host !== 'revit'),
56064
+ clear: false,
56072
56065
  preview: (host !== 'revit')
56073
56066
  }, key: CADdata.id, defaultKey: CADdata.id })),
56074
56067
  open && React__default.createElement("div", { className: 'card-description' }, description));