pollination-react-io 1.63.1 → 1.64.0
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/index.esm.js +55 -19
- package/build/index.esm.js.map +1 -1
- package/build/index.js +55 -19
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.esm.js
CHANGED
@@ -15093,16 +15093,16 @@ var css_248z$i = ":root {\n --background: #FFFAEE;\n --primary: #1890ff;\n --
|
|
15093
15093
|
styleInject(css_248z$i);
|
15094
15094
|
|
15095
15095
|
var FileInput = function (_a) {
|
15096
|
-
var disabled = _a.disabled, onChange = _a.onChange, _b = _a.accept, accept = _b === void 0 ?
|
15096
|
+
var disabled = _a.disabled, onChange = _a.onChange, _b = _a.accept, accept = _b === void 0 ? undefined : _b, inputProps = _a.inputProps;
|
15097
15097
|
var onDrop = useCallback(function (acceptedFiles) {
|
15098
15098
|
var file = acceptedFiles[0];
|
15099
15099
|
onChange && onChange(file);
|
15100
15100
|
}, [onChange]);
|
15101
15101
|
var _c = useDropzone({
|
15102
15102
|
onDrop: onDrop,
|
15103
|
-
accept: {
|
15104
|
-
'multipart/form-data': accept
|
15105
|
-
},
|
15103
|
+
accept: accept ? {
|
15104
|
+
'multipart/form-data': accept,
|
15105
|
+
} : undefined,
|
15106
15106
|
disabled: disabled,
|
15107
15107
|
}), acceptedFiles = _c.acceptedFiles, getRootProps = _c.getRootProps, getInputProps = _c.getInputProps; _c.isDragActive; _c.inputRef; _c.rootRef;
|
15108
15108
|
var formatDescription = useCallback(function () {
|
@@ -15144,7 +15144,7 @@ var FileInput = function (_a) {
|
|
15144
15144
|
if (i === 0)
|
15145
15145
|
return "".concat(c, " ");
|
15146
15146
|
return i === a.length - 1 ? "".concat(p, " or ").concat(c, " ") : "".concat(p, ", ").concat(c);
|
15147
|
-
}, '') : '
|
15147
|
+
}, '') : '.* ')))),
|
15148
15148
|
React__default.createElement("label", { htmlFor: inputProps && inputProps.name ? inputProps.name : undefined, style: {
|
15149
15149
|
flex: 6,
|
15150
15150
|
justifyContent: 'center',
|
@@ -41250,12 +41250,13 @@ var ComboFileSelector = function (_a) {
|
|
41250
41250
|
return (React__default.createElement(GetModel, { onChange: onChange, inputProps: inputProps, showHelpText: false }));
|
41251
41251
|
case 'get_cloud':
|
41252
41252
|
return (React__default.createElement(SelectCloudArtifacts, { projectOwner: projectOwner, projectName: projectName, value: value, hidden: hidden, fileNameMatch: typeof inputProps.accept === 'string' ?
|
41253
|
-
".*(".concat(inputProps.accept.replace(/\./g, '').split(', ').join('$|'), "$)") :
|
41253
|
+
".*(".concat(inputProps.accept.replace(/\./g, '').split(', ').join('$|'), "$)") : '.*', onChange: onChange, client: client }));
|
41254
41254
|
case 'get_local':
|
41255
41255
|
return (React__default.createElement(SelectLocalArtifactNative, { onChange: handleLocalArtifactSelect, buttonLabel: "Select ".concat(inputProps.accept.split(',').length > 1 ?
|
41256
41256
|
'any of' : 'an', " ").concat(inputProps.accept, " ").concat(inputProps.accept.split(',').length > 1 ? 'file types' : 'file', "."), fileMatchPattern: "File types ".concat(inputProps.accept, "|*").concat(inputProps.accept.split(', ').join(';*')) }));
|
41257
41257
|
default:
|
41258
|
-
return (React__default.createElement(FileInput, { onChange: onChange, inputProps: inputProps, accept: typeof inputProps.accept === 'string' ?
|
41258
|
+
return (React__default.createElement(FileInput, { onChange: onChange, inputProps: inputProps, accept: typeof inputProps.accept === 'string' ?
|
41259
|
+
inputProps.accept.split(', ') : undefined }));
|
41259
41260
|
}
|
41260
41261
|
})()));
|
41261
41262
|
};
|
@@ -44668,6 +44669,8 @@ var RecipeForm = function (_a) {
|
|
44668
44669
|
if (!recipe)
|
44669
44670
|
return;
|
44670
44671
|
var data = recipe.inputs.map(function (i) {
|
44672
|
+
var _a;
|
44673
|
+
var customTab = (_a = i === null || i === void 0 ? void 0 : i.annotations['group_identifier']) !== null && _a !== void 0 ? _a : undefined;
|
44671
44674
|
return {
|
44672
44675
|
type: InputType[i.type],
|
44673
44676
|
required: i.required,
|
@@ -44676,12 +44679,26 @@ var RecipeForm = function (_a) {
|
|
44676
44679
|
spec: i.spec,
|
44677
44680
|
description: i.description,
|
44678
44681
|
extensions: i.hasOwnProperty('extensions') ?
|
44679
|
-
i['extensions'] : []
|
44682
|
+
i['extensions'] : [],
|
44683
|
+
customTab: customTab
|
44680
44684
|
};
|
44681
44685
|
});
|
44682
44686
|
return data;
|
44683
44687
|
}, [recipe]);
|
44684
44688
|
var schema = generateSchema(inputs);
|
44689
|
+
var customTabs = useMemo(function () {
|
44690
|
+
if (!inputs)
|
44691
|
+
return;
|
44692
|
+
return inputs
|
44693
|
+
.filter(function (i) { return i.customTab; })
|
44694
|
+
.map(function (i) { return i.customTab; })
|
44695
|
+
.filter(function (value, index, array) { return array.indexOf(value) === index; });
|
44696
|
+
}, [inputs]);
|
44697
|
+
var hasCustomTabs = useMemo(function () {
|
44698
|
+
if (!customTabs)
|
44699
|
+
return;
|
44700
|
+
return customTabs.length > 0;
|
44701
|
+
}, [customTabs]);
|
44685
44702
|
/**
|
44686
44703
|
* Hooks
|
44687
44704
|
*/
|
@@ -44742,14 +44759,15 @@ var RecipeForm = function (_a) {
|
|
44742
44759
|
: React__default.createElement(TextInput, { key: i.name, inputProps: __assign(__assign({}, register(i.name)), { defaultValue: i.default }), reset: function () { return handleReset(i); } });
|
44743
44760
|
case InputType.DAGFileInput:
|
44744
44761
|
return React__default.createElement(Controller, { name: i.name, control: control, defaultValue: i.default, render: function (_a) {
|
44745
|
-
var _b
|
44762
|
+
var _b, _c, _d;
|
44763
|
+
var _e = _a.field, value = _e.value, onChange = _e.onChange, field = __rest(_e, ["value", "onChange"]);
|
44746
44764
|
return React__default.createElement(ComboFileSelector, { projectOwner: projectOwner, projectName: projectName, defaultOption: i.extensions &&
|
44747
|
-
i.extensions.includes('hbjson') &&
|
44765
|
+
((_b = i.extensions) === null || _b === void 0 ? void 0 : _b.includes('hbjson')) &&
|
44748
44766
|
host !== 'web' ? 'get_model' : 'get_cloud', optionsConfig: {
|
44749
|
-
get_model: i.extensions.includes('hbjson') && host !== 'web',
|
44767
|
+
get_model: ((_c = i.extensions) === null || _c === void 0 ? void 0 : _c.includes('hbjson')) && host !== 'web',
|
44750
44768
|
get_local: host !== 'web',
|
44751
44769
|
get_file: host === 'web'
|
44752
|
-
}, value: value, onChange: onChange, inputProps: __assign(__assign({}, field), { accept: i.extensions.map(function (e) { return ".".concat(e); }).join(', ') }), client: client });
|
44770
|
+
}, value: value, onChange: onChange, inputProps: __assign(__assign({}, field), { accept: i.extensions && ((_d = i.extensions) === null || _d === void 0 ? void 0 : _d.map(function (e) { return ".".concat(e); }).join(', ')) }), client: client });
|
44753
44771
|
} });
|
44754
44772
|
// Others...
|
44755
44773
|
default:
|
@@ -44781,22 +44799,40 @@ var RecipeForm = function (_a) {
|
|
44781
44799
|
flex: 1,
|
44782
44800
|
margin: '10px 0 0 0',
|
44783
44801
|
} },
|
44784
|
-
React__default.createElement(Tab, { key: '
|
44785
|
-
React__default.createElement(Tab, { key:
|
44786
|
-
|
44802
|
+
hasCustomTabs && React__default.createElement(Tab, { key: 'Recipe Inputs' }, 'Recipe Inputs'),
|
44803
|
+
hasCustomTabs && customTabs.map(function (c) { return React__default.createElement(Tab, { key: c }, c); }),
|
44804
|
+
!hasCustomTabs && React__default.createElement(Tab, { key: 'required-tab' }, "Required inputs"),
|
44805
|
+
!hasCustomTabs && React__default.createElement(Tab, { key: 'optional-tab' }, "Optional inputs")),
|
44806
|
+
!hasCustomTabs && React__default.createElement(TabPanel, { key: 'required-tab' },
|
44787
44807
|
React__default.createElement("div", { className: 'cards-container-recipe', style: __assign(__assign({}, style), { padding: '20px' }) },
|
44788
44808
|
React__default.createElement("div", { className: 'cards-recipe' }, inputs && client && inputs.filter(function (i) { return i.required; }).map(function (i) {
|
44789
44809
|
var _a;
|
44790
44810
|
return (React__default.createElement("div", { key: "div-".concat(i.name) },
|
44791
44811
|
React__default.createElement(FormInput, { key: "".concat(i.name, "-").concat(i), name: i.name, description: i.description, errorMessage: errors[i.name] ? (_a = errors[i.name]) === null || _a === void 0 ? void 0 : _a.message : undefined }, formComponents(i))));
|
44792
44812
|
})))),
|
44793
|
-
|
44813
|
+
!hasCustomTabs &&
|
44814
|
+
React__default.createElement(TabPanel, { key: 'optional-tab' },
|
44815
|
+
React__default.createElement("div", { className: 'cards-container-recipe', style: __assign(__assign({}, style), { padding: '20px' }) },
|
44816
|
+
React__default.createElement("div", { className: 'cards-recipe' }, inputs && client && inputs.filter(function (i) { return !i.required; }).map(function (i) {
|
44817
|
+
var _a;
|
44818
|
+
return (React__default.createElement("div", { key: "div-".concat(i.name) },
|
44819
|
+
React__default.createElement(FormInput, { key: "".concat(i.name, "-").concat(i), name: i.name, description: i.description, errorMessage: errors[i.name] ? (_a = errors[i.name]) === null || _a === void 0 ? void 0 : _a.message : undefined }, formComponents(i))));
|
44820
|
+
})))),
|
44821
|
+
hasCustomTabs &&
|
44822
|
+
React__default.createElement(TabPanel, { key: 'Recipe Inputs' },
|
44823
|
+
React__default.createElement("div", { className: 'cards-container-recipe', style: __assign(__assign({}, style), { padding: '20px' }) },
|
44824
|
+
React__default.createElement("div", { className: 'cards-recipe' }, inputs && client && inputs.filter(function (i) { return i.customTab == null; }).map(function (i) {
|
44825
|
+
var _a;
|
44826
|
+
return (React__default.createElement("div", { key: "div-".concat(i.name) },
|
44827
|
+
React__default.createElement(FormInput, { key: "".concat(i.name, "-").concat(i), name: i.name, description: i.description, errorMessage: errors[i.name] ? (_a = errors[i.name]) === null || _a === void 0 ? void 0 : _a.message : undefined }, formComponents(i))));
|
44828
|
+
})))),
|
44829
|
+
hasCustomTabs && customTabs.map(function (c) { return React__default.createElement(TabPanel, { key: c },
|
44794
44830
|
React__default.createElement("div", { className: 'cards-container-recipe', style: __assign(__assign({}, style), { padding: '20px' }) },
|
44795
|
-
React__default.createElement("div", { className: 'cards-recipe' }, inputs && client && inputs.filter(function (i) { return
|
44831
|
+
React__default.createElement("div", { className: 'cards-recipe' }, inputs && client && inputs.filter(function (i) { return i.customTab === c; }).map(function (i) {
|
44796
44832
|
var _a;
|
44797
44833
|
return (React__default.createElement("div", { key: "div-".concat(i.name) },
|
44798
44834
|
React__default.createElement(FormInput, { key: "".concat(i.name, "-").concat(i), name: i.name, description: i.description, errorMessage: errors[i.name] ? (_a = errors[i.name]) === null || _a === void 0 ? void 0 : _a.message : undefined }, formComponents(i))));
|
44799
|
-
}))))),
|
44835
|
+
})))); })),
|
44800
44836
|
React__default.createElement("div", { style: { margin: '10px 0 0 0' } },
|
44801
44837
|
host !== 'web' &&
|
44802
44838
|
React__default.createElement(ConfigureLocalRun, { onChange: function (localConfig) { return setLocalConfig(localConfig); }, defaultVal: localConfig }),
|
@@ -49154,7 +49190,7 @@ var RunCard = function (_a) {
|
|
49154
49190
|
return;
|
49155
49191
|
var count = deleteJob("".concat(projectOwner, "/").concat(projectName), _run.id);
|
49156
49192
|
if (count > 0) {
|
49157
|
-
if (window.location.href
|
49193
|
+
if (window.location.href.includes("?path=".concat(_run.id))) {
|
49158
49194
|
window.history.back();
|
49159
49195
|
}
|
49160
49196
|
else {
|