@gpa-gemstone/common-pages 0.0.128 → 0.0.130

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,7 +19,7 @@ interface IProps<T> {
19
19
  Data: T[];
20
20
  }) => JSX.Element;
21
21
  /**
22
- * React Component to be used in the Review Step
22
+ * React Component to be used in the Complete Step
23
23
  * @type {React.FC<IReviewProps<T>>}
24
24
  * */
25
25
  CompleteUI?: JSX.Element;
@@ -48,6 +48,16 @@ interface IProps<T> {
48
48
  * @param {string[]} errors - Array of error messages.
49
49
  */
50
50
  SetErrors: (errors: string[]) => void;
51
+ /**
52
+ * Optional Progress Bar component to replace internal Progress Bar.
53
+ * @type {JSX.Element}
54
+ */
55
+ ProgressBar?: JSX.Element;
56
+ /**
57
+ * Optional flag to call OnComplete handler when the review step is hit.
58
+ * @type {boolean}
59
+ */
60
+ CompleteOnReview?: boolean;
51
61
  }
52
62
  export default function BulkUpload<T>(props: IProps<T>): React.JSX.Element;
53
63
  export {};
package/lib/BulkUpload.js CHANGED
@@ -78,6 +78,8 @@ function BulkUpload(props) {
78
78
  }, [props.Step, currentPipelineIndex, rawFileContent, props.CurrentPipelineStep, props.Pipelines]);
79
79
  var progressSteps = React.useMemo(function () {
80
80
  var _a, _b, _c;
81
+ if (props.ProgressBar != null)
82
+ return [];
81
83
  if (currentPipelineIndex == null || currentPipelineIndex > props.Pipelines.length - 1 || props.CurrentPipelineStep > ((_c = (_b = (_a = props.Pipelines) === null || _a === void 0 ? void 0 : _a[currentPipelineIndex]) === null || _b === void 0 ? void 0 : _b.Steps) === null || _c === void 0 ? void 0 : _c.length) - 1)
82
84
  return steps;
83
85
  var pipelineSteps = props.Pipelines[currentPipelineIndex].Steps.map(function (step, i) { return ({ short: step.Label, long: step.Label, id: i }); });
@@ -110,7 +112,8 @@ function BulkUpload(props) {
110
112
  props.SetErrors(errors);
111
113
  }, [rawFileContent, fileName, isFileTypeValid, pipelineErrors, props.Step]);
112
114
  React.useEffect(function () {
113
- if (props.Step !== 'Complete')
115
+ var _a;
116
+ if (props.Step !== 'Complete' || ((_a = props.CompleteOnReview) !== null && _a !== void 0 ? _a : false))
114
117
  return;
115
118
  props.OnComplete(data);
116
119
  }, [props.Step, data, props.OnComplete]);
@@ -142,7 +145,7 @@ function BulkUpload(props) {
142
145
  React.createElement("div", { className: 'row h-100' },
143
146
  React.createElement("div", { className: 'col-12 d-flex flex-column h-100' },
144
147
  React.createElement("div", { className: 'row' },
145
- React.createElement("div", { className: 'col-12' },
148
+ React.createElement("div", { className: 'col-12' }, props.ProgressBar != null ? props.ProgressBar :
146
149
  React.createElement(react_interactive_1.ProgressBar, { steps: progressSteps, activeStep: activeProgressStep }))),
147
150
  props.Step === 'Upload' ?
148
151
  React.createElement(React.Fragment, null,
@@ -63,7 +63,7 @@ var react_table_1 = require("@gpa-gemstone/react-table");
63
63
  var gpa_symbols_1 = require("@gpa-gemstone/gpa-symbols");
64
64
  var lodash_1 = require("lodash");
65
65
  var AdditionalUploadUI = function (props) {
66
- return (React.createElement("div", { className: 'row justify-content-center m-0' },
66
+ return (React.createElement("div", { className: 'row justify-content-center' },
67
67
  React.createElement("div", { className: 'col-6 p-0' },
68
68
  React.createElement(react_forms_1.CheckBox, { Record: { HasHeaders: props.HasHeaders }, Field: "HasHeaders", Setter: function (record) { return props.SetHasHeaders(record.HasHeaders); }, Label: 'My Data Has Headers' }))));
69
69
  };
@@ -263,7 +263,7 @@ function CsvPipelineEditStep(props) {
263
263
  if (field == null)
264
264
  return;
265
265
  var value = row[index + 1];
266
- record = field.Process(value, record);
266
+ record = field.Process(value, record, field.Field);
267
267
  });
268
268
  mappedData.push(record);
269
269
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gpa-gemstone/common-pages",
3
- "version": "0.0.128",
3
+ "version": "0.0.130",
4
4
  "description": "Common UI pages for GPA products",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -44,12 +44,12 @@
44
44
  "typescript": "5.5.3"
45
45
  },
46
46
  "dependencies": {
47
- "@gpa-gemstone/application-typings": "0.0.80",
48
- "@gpa-gemstone/gpa-symbols": "0.0.46",
47
+ "@gpa-gemstone/application-typings": "0.0.81",
48
+ "@gpa-gemstone/gpa-symbols": "0.0.47",
49
49
  "@gpa-gemstone/helper-functions": "0.0.37",
50
- "@gpa-gemstone/react-forms": "1.1.80",
51
- "@gpa-gemstone/react-interactive": "1.0.140",
52
- "@gpa-gemstone/react-table": "1.2.62",
50
+ "@gpa-gemstone/react-forms": "1.1.81",
51
+ "@gpa-gemstone/react-interactive": "1.0.142",
52
+ "@gpa-gemstone/react-table": "1.2.64",
53
53
  "@reduxjs/toolkit": "1.8.3",
54
54
  "crypto-js": "^4.2.0",
55
55
  "moment": "^2.29.4",