pollination-react-io 1.52.0 → 1.52.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.
- package/build/atoms/SettingsButton/index.d.ts +1 -1
- package/build/index.esm.js +41 -23
- package/build/index.esm.js.map +1 -1
- package/build/index.js +41 -23
- package/build/index.js.map +1 -1
- package/package.json +1 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { CSSProperties, FC, ReactNode } from 'react';
|
2
2
|
import { OptionGroup } from '../Dropdown/Dropdown';
|
3
3
|
export interface SettingsButtonProps {
|
4
|
-
onClick: () => void;
|
4
|
+
onClick: (e?: any) => void;
|
5
5
|
label: string | ReactNode;
|
6
6
|
options?: OptionGroup[];
|
7
7
|
asButtons?: boolean;
|
package/build/index.esm.js
CHANGED
@@ -13385,7 +13385,10 @@ var Dropdown = function (_a) {
|
|
13385
13385
|
var _a;
|
13386
13386
|
switch (o.type) {
|
13387
13387
|
case 'checkbox':
|
13388
|
-
return (React__default.createElement($d08ef79370b62062$export$16ce288f89fa631c, __assign({ key: o.id, className: "poll-select-item", onSelect: function () {
|
13388
|
+
return (React__default.createElement($d08ef79370b62062$export$16ce288f89fa631c, __assign({ key: o.id, className: "poll-select-item", onSelect: function (e) {
|
13389
|
+
e.stopPropagation();
|
13390
|
+
o.onSelect && o.onSelect(o);
|
13391
|
+
}, checked: o.checked, disabled: o.disabled }, itemProps),
|
13389
13392
|
React__default.createElement($d08ef79370b62062$export$c3468e2714d175fa, { style: {
|
13390
13393
|
position: 'absolute',
|
13391
13394
|
display: 'inline-flex',
|
@@ -13400,7 +13403,10 @@ var Dropdown = function (_a) {
|
|
13400
13403
|
} }, o.icon),
|
13401
13404
|
o.label));
|
13402
13405
|
case 'radio':
|
13403
|
-
return (React__default.createElement($d08ef79370b62062$export$371ab307eab489c0, __assign({ key: o.id, className: "poll-select-item", onSelect: function () {
|
13406
|
+
return (React__default.createElement($d08ef79370b62062$export$371ab307eab489c0, __assign({ key: o.id, className: "poll-select-item", onSelect: function (e) {
|
13407
|
+
e.stopPropagation();
|
13408
|
+
o.onSelect && o.onSelect(o);
|
13409
|
+
}, textValue: o.label, value: o.id, disabled: o.disabled }, itemProps),
|
13404
13410
|
React__default.createElement($d08ef79370b62062$export$c3468e2714d175fa, { style: {
|
13405
13411
|
position: 'absolute',
|
13406
13412
|
display: 'inline-flex',
|
@@ -13412,7 +13418,10 @@ var Dropdown = function (_a) {
|
|
13412
13418
|
return (React__default.createElement($d08ef79370b62062$export$b04be29aa201d4f5, { key: o.id }, o.label));
|
13413
13419
|
case 'link':
|
13414
13420
|
return (React__default.createElement("a", { href: (_a = o.to) !== null && _a !== void 0 ? _a : '/', key: o.id, style: { color: 'unset' } },
|
13415
|
-
React__default.createElement($d08ef79370b62062$export$6d08773d2e66f8f2, __assign({ className: "poll-select-item", onSelect: function () {
|
13421
|
+
React__default.createElement($d08ef79370b62062$export$6d08773d2e66f8f2, __assign({ className: "poll-select-item", onSelect: function (e) {
|
13422
|
+
e.stopPropagation();
|
13423
|
+
o.onSelect && o.onSelect(o);
|
13424
|
+
} }, itemProps),
|
13416
13425
|
React__default.createElement("div", { style: {
|
13417
13426
|
position: 'absolute',
|
13418
13427
|
display: 'inline-flex',
|
@@ -13420,7 +13429,10 @@ var Dropdown = function (_a) {
|
|
13420
13429
|
} }, o.icon),
|
13421
13430
|
o.label)));
|
13422
13431
|
default:
|
13423
|
-
return (React__default.createElement($d08ef79370b62062$export$6d08773d2e66f8f2, __assign({ key: o.id, className: "poll-select-item", onSelect: function () {
|
13432
|
+
return (React__default.createElement($d08ef79370b62062$export$6d08773d2e66f8f2, __assign({ key: o.id, className: "poll-select-item", onSelect: function (e) {
|
13433
|
+
e.stopPropagation();
|
13434
|
+
o.onSelect && o.onSelect(o);
|
13435
|
+
}, disabled: o.disabled }, itemProps),
|
13424
13436
|
React__default.createElement("div", { style: {
|
13425
13437
|
position: 'absolute',
|
13426
13438
|
display: 'inline-flex',
|
@@ -15723,10 +15735,13 @@ var SettingsButton = function (_a) {
|
|
15723
15735
|
React__default.createElement(React__default.Fragment, null, options.reduce(function (p, c) { return __spreadArray(__spreadArray([], p, true), c.options, true); }, []).map(function (o) {
|
15724
15736
|
var _a;
|
15725
15737
|
return React__default.createElement("button", { type: 'button', key: o.id, style: __assign(__assign({}, style), { boxShadow: !disabled && o.checked
|
15726
|
-
? style['highlight']
|
15738
|
+
? style && style['highlight']
|
15727
15739
|
? "inset 0px 0px 9px 4px ".concat(style['highlight'])
|
15728
15740
|
: 'inset 0px 0px 9px 4px #096dd9'
|
15729
|
-
: undefined }), onClick: function (e) {
|
15741
|
+
: undefined }), onClick: function (e) {
|
15742
|
+
e.stopPropagation();
|
15743
|
+
o.onSelect && o.onSelect(o);
|
15744
|
+
} }, (_a = o.icon) !== null && _a !== void 0 ? _a : o.label);
|
15730
15745
|
}))
|
15731
15746
|
:
|
15732
15747
|
React__default.createElement(Dropdown, { trigger: (React__default.createElement("button", { type: 'button' }, triggerIcon)), optionGroups: options, contentProps: {
|
@@ -44323,7 +44338,8 @@ var SendResults = function (_a) {
|
|
44323
44338
|
});
|
44324
44339
|
};
|
44325
44340
|
}, [disabled, geometryOptions, key, results, selOpt, sendMessage]);
|
44326
|
-
return (React__default.createElement(SettingsButton, { style: style, disabled: disabled, onClick: function () {
|
44341
|
+
return (React__default.createElement(SettingsButton, { style: style, disabled: disabled, onClick: function (e) {
|
44342
|
+
e.stopPropagation();
|
44327
44343
|
if (disabled)
|
44328
44344
|
return;
|
44329
44345
|
sendMessage(getAction$2(selOpt), {
|
@@ -44341,7 +44357,7 @@ var SendResults = function (_a) {
|
|
44341
44357
|
id: Action$2.preview,
|
44342
44358
|
label: 'Preview',
|
44343
44359
|
checked: selOpt === Action$2.preview,
|
44344
|
-
icon: React__default.createElement(Eyeglasses$1, { size: 16, color: style['color'] }),
|
44360
|
+
icon: React__default.createElement(Eyeglasses$1, { size: 16, color: style && style['color'] }),
|
44345
44361
|
disabled: disabled,
|
44346
44362
|
onSelect: function () {
|
44347
44363
|
setSelOpt(function (state) { return (state === Action$2.preview ? undefined : Action$2.preview); });
|
@@ -44352,7 +44368,7 @@ var SendResults = function (_a) {
|
|
44352
44368
|
id: Action$2.add,
|
44353
44369
|
label: 'Add',
|
44354
44370
|
checked: selOpt === Action$2.add,
|
44355
|
-
icon: React__default.createElement(Building$1, { size: 16, color: style['color'] }),
|
44371
|
+
icon: React__default.createElement(Building$1, { size: 16, color: style && style['color'] }),
|
44356
44372
|
disabled: disabled,
|
44357
44373
|
onSelect: function () {
|
44358
44374
|
setSelOpt(function (state) { return (state === Action$2.add ? undefined : Action$2.add); });
|
@@ -44363,7 +44379,7 @@ var SendResults = function (_a) {
|
|
44363
44379
|
id: Action$2.delete,
|
44364
44380
|
label: 'Delete',
|
44365
44381
|
checked: selOpt === Action$2.delete,
|
44366
|
-
icon: React__default.createElement(Trash$1, { size: 16 }),
|
44382
|
+
icon: React__default.createElement(Trash$1, { size: 16, color: style && style['color'] }),
|
44367
44383
|
disabled: disabled,
|
44368
44384
|
onSelect: function () {
|
44369
44385
|
setSelOpt(function (state) { return (state === Action$2.delete ? undefined : Action$2.delete); });
|
@@ -44374,7 +44390,7 @@ var SendResults = function (_a) {
|
|
44374
44390
|
id: Action$2.clear,
|
44375
44391
|
label: 'Clear',
|
44376
44392
|
checked: selOpt === Action$2.clear,
|
44377
|
-
icon: React__default.createElement(Recycle$1, { size: 16, color: style['color'] }),
|
44393
|
+
icon: React__default.createElement(Recycle$1, { size: 16, color: style && style['color'] }),
|
44378
44394
|
disabled: disabled,
|
44379
44395
|
onSelect: function () {
|
44380
44396
|
setSelOpt(function (state) { return (state === Action$2.clear ? undefined : Action$2.clear); });
|
@@ -44385,7 +44401,7 @@ var SendResults = function (_a) {
|
|
44385
44401
|
id: Action$2.subscribePreview,
|
44386
44402
|
label: 'Subscribe Preview',
|
44387
44403
|
checked: selOpt === Action$2.subscribePreview,
|
44388
|
-
icon: React__default.createElement(ArrowRepeat$1, { size: 16, color: style['color'] }),
|
44404
|
+
icon: React__default.createElement(ArrowRepeat$1, { size: 16, color: style && style['color'] }),
|
44389
44405
|
disabled: disabled,
|
44390
44406
|
onSelect: function () {
|
44391
44407
|
setSelOpt(function (state) { return (state === Action$2.subscribePreview ? undefined : Action$2.subscribePreview); });
|
@@ -46825,7 +46841,8 @@ var SendGeometry = function (_a) {
|
|
46825
46841
|
});
|
46826
46842
|
};
|
46827
46843
|
}, [disabled, geometry, geometryOptions, key, selOpt, sendMessage]);
|
46828
|
-
return (React__default.createElement(SettingsButton, { style: style, disabled: disabled, onClick: function () {
|
46844
|
+
return (React__default.createElement(SettingsButton, { style: style, disabled: disabled, onClick: function (e) {
|
46845
|
+
e.stopPropagation();
|
46829
46846
|
if (disabled)
|
46830
46847
|
return;
|
46831
46848
|
sendMessage(getAction$1(selOpt), {
|
@@ -46843,7 +46860,7 @@ var SendGeometry = function (_a) {
|
|
46843
46860
|
id: Action$1.preview,
|
46844
46861
|
label: 'Preview',
|
46845
46862
|
checked: selOpt === Action$1.preview,
|
46846
|
-
icon: React__default.createElement(Eyeglasses$1, { size: 16, color: style['color'] }),
|
46863
|
+
icon: React__default.createElement(Eyeglasses$1, { size: 16, color: style && style['color'] }),
|
46847
46864
|
disabled: disabled,
|
46848
46865
|
onSelect: function () {
|
46849
46866
|
setSelOpt(function (state) { return (state === Action$1.preview ? undefined : Action$1.preview); });
|
@@ -46854,7 +46871,7 @@ var SendGeometry = function (_a) {
|
|
46854
46871
|
id: Action$1.add,
|
46855
46872
|
label: 'Add',
|
46856
46873
|
checked: selOpt === Action$1.add,
|
46857
|
-
icon: React__default.createElement(Building$1, { size: 16, color: style['color'] }),
|
46874
|
+
icon: React__default.createElement(Building$1, { size: 16, color: style && style['color'] }),
|
46858
46875
|
disabled: disabled,
|
46859
46876
|
onSelect: function () {
|
46860
46877
|
setSelOpt(function (state) { return (state === Action$1.add ? undefined : Action$1.add); });
|
@@ -46865,7 +46882,7 @@ var SendGeometry = function (_a) {
|
|
46865
46882
|
id: Action$1.delete,
|
46866
46883
|
label: 'Delete',
|
46867
46884
|
checked: selOpt === Action$1.delete,
|
46868
|
-
icon: React__default.createElement(Trash$1, { size: 16, color: style['color'] }),
|
46885
|
+
icon: React__default.createElement(Trash$1, { size: 16, color: style && style['color'] }),
|
46869
46886
|
disabled: disabled,
|
46870
46887
|
onSelect: function () {
|
46871
46888
|
setSelOpt(function (state) { return (state === Action$1.delete ? undefined : Action$1.delete); });
|
@@ -46876,7 +46893,7 @@ var SendGeometry = function (_a) {
|
|
46876
46893
|
id: Action$1.clear,
|
46877
46894
|
label: 'Clear',
|
46878
46895
|
checked: selOpt === Action$1.clear,
|
46879
|
-
icon: React__default.createElement(Recycle$1, { size: 16, color: style['color'] }),
|
46896
|
+
icon: React__default.createElement(Recycle$1, { size: 16, color: style && style['color'] }),
|
46880
46897
|
disabled: disabled,
|
46881
46898
|
onSelect: function () {
|
46882
46899
|
setSelOpt(function (state) { return (state === Action$1.clear ? undefined : Action$1.clear); });
|
@@ -46887,7 +46904,7 @@ var SendGeometry = function (_a) {
|
|
46887
46904
|
id: Action$1.subscribePreview,
|
46888
46905
|
label: 'Subscribe Preview',
|
46889
46906
|
checked: selOpt === Action$1.subscribePreview,
|
46890
|
-
icon: React__default.createElement(ArrowRepeat$1, { size: 16, color: style['color'] }),
|
46907
|
+
icon: React__default.createElement(ArrowRepeat$1, { size: 16, color: style && style['color'] }),
|
46891
46908
|
disabled: disabled,
|
46892
46909
|
onSelect: function () {
|
46893
46910
|
setSelOpt(function (state) { return (state === Action$1.subscribePreview ? undefined : Action$1.subscribePreview); });
|
@@ -46958,7 +46975,8 @@ var SendModel = function (_a) {
|
|
46958
46975
|
});
|
46959
46976
|
};
|
46960
46977
|
}, [disabled, hbjson, key, selOpt, sendHbjson]);
|
46961
|
-
return (React__default.createElement(SettingsButton, { style: style, disabled: disabled, onClick: function () {
|
46978
|
+
return (React__default.createElement(SettingsButton, { style: style, disabled: disabled, onClick: function (e) {
|
46979
|
+
e.stopPropagation();
|
46962
46980
|
if (disabled)
|
46963
46981
|
return;
|
46964
46982
|
sendHbjson(getAction(selOpt), {
|
@@ -46979,7 +46997,7 @@ var SendModel = function (_a) {
|
|
46979
46997
|
id: Action.preview,
|
46980
46998
|
label: 'Preview',
|
46981
46999
|
checked: selOpt === Action.preview,
|
46982
|
-
icon: React__default.createElement(Eyeglasses$1, { size: 16, color: style['color'] }),
|
47000
|
+
icon: React__default.createElement(Eyeglasses$1, { size: 16, color: style && style['color'] }),
|
46983
47001
|
disabled: disabled,
|
46984
47002
|
onSelect: function () {
|
46985
47003
|
setSelOpt(function (state) { return (state === Action.preview ? undefined : Action.preview); });
|
@@ -46990,7 +47008,7 @@ var SendModel = function (_a) {
|
|
46990
47008
|
id: Action.add,
|
46991
47009
|
label: 'Add',
|
46992
47010
|
checked: selOpt === Action.add,
|
46993
|
-
icon: React__default.createElement(Building$1, { size: 16, color: style['color'] }),
|
47011
|
+
icon: React__default.createElement(Building$1, { size: 16, color: style && style['color'] }),
|
46994
47012
|
disabled: disabled,
|
46995
47013
|
onSelect: function () {
|
46996
47014
|
setSelOpt(function (state) { return (state === Action.add ? undefined : Action.add); });
|
@@ -47001,7 +47019,7 @@ var SendModel = function (_a) {
|
|
47001
47019
|
id: Action.clear,
|
47002
47020
|
label: 'Clear',
|
47003
47021
|
checked: selOpt === Action.clear,
|
47004
|
-
icon: React__default.createElement(Recycle$1, { size: 16, color: style['color'] }),
|
47022
|
+
icon: React__default.createElement(Recycle$1, { size: 16, color: style && style['color'] }),
|
47005
47023
|
disabled: disabled,
|
47006
47024
|
onSelect: function () {
|
47007
47025
|
setSelOpt(function (state) { return (state === Action.clear ? undefined : Action.clear); });
|
@@ -47012,7 +47030,7 @@ var SendModel = function (_a) {
|
|
47012
47030
|
id: Action.subscribePreview,
|
47013
47031
|
label: 'Subscribe Preview',
|
47014
47032
|
checked: selOpt === Action.subscribePreview,
|
47015
|
-
icon: React__default.createElement(ArrowRepeat$1, { size: 16, color: style['color'] }),
|
47033
|
+
icon: React__default.createElement(ArrowRepeat$1, { size: 16, color: style && style['color'] }),
|
47016
47034
|
disabled: disabled,
|
47017
47035
|
onSelect: function () {
|
47018
47036
|
setSelOpt(function (state) { return (state === Action.subscribePreview ? undefined : Action.subscribePreview); });
|