@gpa-gemstone/common-pages 0.0.122 → 0.0.123

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.
@@ -0,0 +1,53 @@
1
+ import * as React from 'react';
2
+ import { Gemstone } from '@gpa-gemstone/application-typings';
3
+ interface IProps<T> {
4
+ /**
5
+ * Attribute used to control what type of files are filtered by default in file explorer
6
+ * @type {string}
7
+ * */
8
+ FileTypeAttribute: string;
9
+ /**
10
+ * Array of available pipelines to use
11
+ * @type {IPipeline[]}
12
+ * */
13
+ Pipelines: Gemstone.TSX.Interfaces.IPipeline<T, any>[];
14
+ /**
15
+ * React Component to be used in the Review Step
16
+ * @type {React.FC<IReviewProps<T>>}
17
+ * */
18
+ ReviewUI: (props: {
19
+ Data: T[];
20
+ }) => JSX.Element;
21
+ /**
22
+ * React Component to be used in the Review Step
23
+ * @type {React.FC<IReviewProps<T>>}
24
+ * */
25
+ CompleteUI?: JSX.Element;
26
+ /**
27
+ * Index of the steps array in the current pipline
28
+ * @type {React.FC<IReviewProps<T>>}
29
+ * */
30
+ CurrentPipelineStep: number;
31
+ /**
32
+ * Setter to pass into the pipeline UI Components
33
+ * @type {React.FC<IReviewProps<T>>}
34
+ * */
35
+ SetCurrentPipelineStep: (step: number) => void;
36
+ /**
37
+ * Step to represent current stage of component
38
+ * @type {'Upload' | 'Process' | 'Review' | 'Complete'}
39
+ * */
40
+ Step: Gemstone.TSX.Types.BulkUploadStep;
41
+ /**
42
+ * Callback function invoked when the Step prop is set to Complete.
43
+ * @param {T[]} records - The processed records.
44
+ */
45
+ OnComplete: (records: T[]) => void;
46
+ /**
47
+ * Callback function to set errors encountered during CSV processing.
48
+ * @param {string[]} errors - Array of error messages.
49
+ */
50
+ SetErrors: (errors: string[]) => void;
51
+ }
52
+ export default function BulkUpload<T>(props: IProps<T>): React.JSX.Element;
53
+ export {};
@@ -0,0 +1,156 @@
1
+ "use strict";
2
+ // ******************************************************************************************************
3
+ // BulkUpload.tsx - Gbtc
4
+ //
5
+ // Copyright © 2024, Grid Protection Alliance. All Rights Reserved.
6
+ //
7
+ // Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
8
+ // the NOTICE file distributed with this work for additional information regarding copyright ownership.
9
+ // The GPA licenses this file to you under the MIT License (MIT), the "License"; you may not use this
10
+ // file except in compliance with the License. You may obtain a copy of the License at:
11
+ //
12
+ // http://opensource.org/licenses/MIT
13
+ //
14
+ // Unless agreed to in writing, the subject software distributed under the License is distributed on an
15
+ // "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
16
+ // License for the specific language governing permissions and limitations.
17
+ //
18
+ // Code Modification History:
19
+ // ----------------------------------------------------------------------------------------------------
20
+ // 07/24/2024 - Preston Crawford
21
+ // Generated original version of source code.
22
+ //
23
+ // ******************************************************************************************************
24
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
25
+ if (k2 === undefined) k2 = k;
26
+ var desc = Object.getOwnPropertyDescriptor(m, k);
27
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
28
+ desc = { enumerable: true, get: function() { return m[k]; } };
29
+ }
30
+ Object.defineProperty(o, k2, desc);
31
+ }) : (function(o, m, k, k2) {
32
+ if (k2 === undefined) k2 = k;
33
+ o[k2] = m[k];
34
+ }));
35
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
36
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
37
+ }) : function(o, v) {
38
+ o["default"] = v;
39
+ });
40
+ var __importStar = (this && this.__importStar) || function (mod) {
41
+ if (mod && mod.__esModule) return mod;
42
+ var result = {};
43
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
44
+ __setModuleDefault(result, mod);
45
+ return result;
46
+ };
47
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
48
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
49
+ if (ar || !(i in from)) {
50
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
51
+ ar[i] = from[i];
52
+ }
53
+ }
54
+ return to.concat(ar || Array.prototype.slice.call(from));
55
+ };
56
+ Object.defineProperty(exports, "__esModule", { value: true });
57
+ exports.default = BulkUpload;
58
+ var React = __importStar(require("react"));
59
+ var react_interactive_1 = require("@gpa-gemstone/react-interactive");
60
+ var steps = [{ short: 'Upload', long: 'Upload', id: 'Upload' }, { short: 'Process', long: 'Process', id: 'Process' }, { short: "Review", id: 'Review', long: 'Review' }, { short: 'Complete', long: 'Complete', id: 'Complete' }];
61
+ var fileExtRegex = /(\.[^.]+)$/;
62
+ function BulkUpload(props) {
63
+ var _a, _b;
64
+ var _c = React.useState([]), data = _c[0], setData = _c[1];
65
+ var _d = React.useState([]), pipelineErrors = _d[0], setPipelineErrors = _d[1];
66
+ var _e = React.useState(null), fileName = _e[0], setFileName = _e[1];
67
+ var _f = React.useState(null), rawFileContent = _f[0], setRawFileContent = _f[1];
68
+ var _g = React.useState(null), currentPipelineIndex = _g[0], setCurrentPipelineIndex = _g[1];
69
+ var _h = React.useState(true), isFileTypeValid = _h[0], setIsFileTypeValid = _h[1];
70
+ var _j = React.useState('Upload'), activeProgressStep = _j[0], setActiveProgressStep = _j[1];
71
+ var pipelineUI = React.useMemo(function () {
72
+ var _a, _b, _c, _d;
73
+ if (props.Step === 'Upload' || props.Step === 'Complete' || 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)
74
+ return React.createElement(React.Fragment, null);
75
+ var pipeline = props.Pipelines[currentPipelineIndex].Steps[props.CurrentPipelineStep];
76
+ return React.createElement(pipeline.UI, { AdditionalProps: (_d = props.Pipelines[currentPipelineIndex].Steps[props.CurrentPipelineStep]) === null || _d === void 0 ? void 0 : _d.AdditionalProps, RawFileData: rawFileContent, SetData: setData, SetPipelineStep: props.SetCurrentPipelineStep, CurrentPipelineStep: props.CurrentPipelineStep, Errors: pipelineErrors, SetErrors: setPipelineErrors });
77
+ }, [props.Step, currentPipelineIndex, rawFileContent, props.CurrentPipelineStep, props.Pipelines]);
78
+ var progressSteps = React.useMemo(function () {
79
+ var _a, _b, _c;
80
+ 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)
81
+ return steps;
82
+ var pipelineSteps = props.Pipelines[currentPipelineIndex].Steps.map(function (step, i) { return ({ short: step.Label, long: step.Label, id: i }); });
83
+ var uploadIndex = steps.findIndex(function (step) { return step.short === 'Upload'; });
84
+ var progressIndex = steps.findIndex(function (step) { return step.short === 'Process'; });
85
+ var remainingSteps = steps.slice(progressIndex + 1);
86
+ return [steps[uploadIndex]].concat(pipelineSteps, remainingSteps);
87
+ }, [currentPipelineIndex, props.Pipelines]);
88
+ React.useEffect(function () {
89
+ var _a, _b, _c;
90
+ if (props.Step !== 'Process') {
91
+ setActiveProgressStep(props.Step);
92
+ return;
93
+ }
94
+ 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)
95
+ return;
96
+ setActiveProgressStep(props.CurrentPipelineStep); //ids for conditional progressSteps are index of the pipeline steps
97
+ }, [props.CurrentPipelineStep, currentPipelineIndex, props.Step]);
98
+ React.useEffect(function () {
99
+ var pipelineErrs = props.Step == 'Process' ? pipelineErrors : [];
100
+ var errors = __spreadArray([], pipelineErrs, true);
101
+ if (fileName == null)
102
+ errors.push('A file must be uploaded to continue');
103
+ if (rawFileContent == null || rawFileContent == '')
104
+ errors.push('File content is empty');
105
+ if (!isFileTypeValid)
106
+ errors.push("File must be of type ".concat(props.FileTypeAttribute));
107
+ props.SetErrors(errors);
108
+ }, [rawFileContent, fileName, isFileTypeValid, pipelineErrors, props.Step]);
109
+ React.useEffect(function () {
110
+ if (props.Step !== 'Complete')
111
+ return;
112
+ props.OnComplete(data);
113
+ }, [props.Step, data, props.OnComplete]);
114
+ var handleFileUpload = function (evt) {
115
+ if (evt.target == null || evt.target.files == null || evt.target.files.length === 0)
116
+ return;
117
+ var file = evt.target.files[0];
118
+ var matchArray = file.name.match(fileExtRegex);
119
+ var fileExtension = matchArray != null ? matchArray[0].substring(1) : '';
120
+ var pipelineIndex = props.Pipelines.findIndex(function (pipe) { return pipe.Select(file.type, fileExtension); });
121
+ if (pipelineIndex == -1) {
122
+ setIsFileTypeValid(false);
123
+ return;
124
+ }
125
+ setCurrentPipelineIndex(pipelineIndex);
126
+ setFileName(file.name);
127
+ var fileReader = new FileReader();
128
+ fileReader.readAsText(file);
129
+ fileReader.onload = function (e) {
130
+ if (e.target == null)
131
+ return;
132
+ setRawFileContent(e.target.result);
133
+ };
134
+ };
135
+ return (React.createElement("div", { className: "container-fluid d-flex flex-column p-0 h-100" },
136
+ React.createElement("div", { className: 'row h-100' },
137
+ React.createElement("div", { className: 'col-12 d-flex flex-column h-100' },
138
+ React.createElement("div", { className: 'row' },
139
+ React.createElement("div", { className: 'col-12' },
140
+ React.createElement(react_interactive_1.ProgressBar, { steps: progressSteps, activeStep: activeProgressStep }))),
141
+ props.Step === 'Upload' ?
142
+ React.createElement(React.Fragment, null,
143
+ React.createElement("div", { className: 'row justify-content-center' },
144
+ React.createElement("div", { className: 'col-6' },
145
+ React.createElement("div", { className: "custom-file" },
146
+ React.createElement("input", { type: "file", className: "custom-file-input", id: "inputGroupFile02", onChange: handleFileUpload, accept: props.FileTypeAttribute, style: { cursor: 'pointer' } }),
147
+ React.createElement("label", { className: "custom-file-label", htmlFor: "inputGroupFile02", "aria-describedby": "inputGroupFileAddon02" }, fileName == null ? 'Upload File' : fileName)))),
148
+ React.createElement("div", { className: 'row' },
149
+ React.createElement("div", { className: 'col-12 h-100' }, currentPipelineIndex != null && ((_a = props.Pipelines[currentPipelineIndex]) === null || _a === void 0 ? void 0 : _a.AdditionalUploadUI) != null ? (_b = props.Pipelines[currentPipelineIndex]) === null || _b === void 0 ? void 0 : _b.AdditionalUploadUI : null)))
150
+ : null,
151
+ React.createElement("div", { className: "".concat(props.Step !== 'Process' ? 'd-none' : 'row flex-grow-1'), style: { overflowY: 'hidden' } },
152
+ React.createElement("div", { className: 'col-12 h-100' }, pipelineUI)),
153
+ props.Step === 'Review' || (props.Step === 'Complete' && props.CompleteUI != null) ?
154
+ React.createElement("div", { className: 'row flex-grow-1', style: { overflowY: 'hidden' } },
155
+ React.createElement("div", { className: 'col-12 h-100' }, props.Step == 'Review' ? React.createElement(props.ReviewUI, { Data: data }) : props.Step === 'Complete' ? props.CompleteUI : null)) : null))));
156
+ }
package/lib/Note.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react';
2
- import { Column } from '@gpa-gemstone/react-table';
3
2
  import { OpenXDA } from '@gpa-gemstone/application-typings';
4
3
  import { IGenericSlice } from './SliceInterfaces';
5
4
  interface IProps {
@@ -16,7 +15,6 @@ interface IProps {
16
15
  ShowCard?: boolean;
17
16
  DefaultApplication?: OpenXDA.Types.NoteApplication;
18
17
  Filter?: (note: OpenXDA.Types.Note) => boolean;
19
- AdditionalCollumns?: Column<OpenXDA.Types.Note>[];
20
18
  }
21
- declare function Note(props: IProps): React.JSX.Element;
19
+ declare function Note(props: React.PropsWithChildren<IProps>): React.JSX.Element;
22
20
  export default Note;
package/lib/Note.js CHANGED
@@ -54,34 +54,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
54
54
  __setModuleDefault(result, mod);
55
55
  return result;
56
56
  };
57
- var __importDefault = (this && this.__importDefault) || function (mod) {
58
- return (mod && mod.__esModule) ? mod : { "default": mod };
59
- };
60
57
  Object.defineProperty(exports, "__esModule", { value: true });
61
58
  var React = __importStar(require("react"));
62
59
  var react_forms_1 = require("@gpa-gemstone/react-forms");
63
- var react_table_1 = __importDefault(require("@gpa-gemstone/react-table"));
60
+ var react_table_1 = require("@gpa-gemstone/react-table");
64
61
  var gpa_symbols_1 = require("@gpa-gemstone/gpa-symbols");
65
62
  var react_interactive_1 = require("@gpa-gemstone/react-interactive");
66
63
  var moment = require("moment");
67
64
  var react_redux_1 = require("react-redux");
68
65
  function Note(props) {
69
66
  var dispatch = (0, react_redux_1.useDispatch)();
70
- var standardCollumns = [
71
- {
72
- key: 'Note', field: 'Note', label: 'Note',
73
- headerStyle: { width: '50%' }, rowStyle: { width: '50%' }
74
- },
75
- {
76
- key: 'Timestamp', field: 'Timestamp', label: 'Time',
77
- headerStyle: { width: 'auto' }, rowStyle: { width: 'auto' },
78
- content: function (item) { return moment.utc(item.Timestamp).format("MM/DD/YYYY HH:mm"); }
79
- },
80
- {
81
- key: 'UserAccount', field: 'UserAccount', label: 'User',
82
- headerStyle: { width: 'auto' }, rowStyle: { width: 'auto' }
83
- }
84
- ];
85
67
  var allowEdit = props.AllowEdit === undefined ? true : props.AllowEdit;
86
68
  var allowRemove = props.AllowRemove === undefined ? true : props.AllowRemove;
87
69
  var allowAdd = props.AllowAdd === undefined ? true : props.AllowAdd;
@@ -90,14 +72,13 @@ function Note(props) {
90
72
  var showCard = props.ShowCard === undefined || props.ShowCard;
91
73
  var _a = React.useState(false), showEdit = _a[0], setEdit = _a[1];
92
74
  var _b = React.useState('none'), hover = _b[0], setHover = _b[1];
93
- var _c = React.useState(standardCollumns), collumns = _c[0], setCollumns = _c[1];
94
75
  var data = (0, react_redux_1.useSelector)(props.NoteSlice.Data);
95
76
  var dataStatus = (0, react_redux_1.useSelector)(props.NoteSlice.Status);
96
- var parentID = (0, react_redux_1.useSelector)((props.NoteSlice.ParentID === undefined ? function (state) { return props.ReferenceTableID; } : props.NoteSlice.ParentID));
77
+ var parentID = (0, react_redux_1.useSelector)((props.NoteSlice.ParentID === undefined ? function () { return props.ReferenceTableID; } : props.NoteSlice.ParentID));
97
78
  var sortField = (0, react_redux_1.useSelector)(props.NoteSlice.SortField);
98
79
  var ascending = (0, react_redux_1.useSelector)(props.NoteSlice.Ascending);
99
- var _d = React.useState(CreateNewNote()), note = _d[0], setNote = _d[1];
100
- var _e = React.useState([]), notes = _e[0], setNotes = _e[1];
80
+ var _c = React.useState(CreateNewNote()), note = _c[0], setNote = _c[1];
81
+ var _d = React.useState([]), notes = _d[0], setNotes = _d[1];
101
82
  React.useEffect(function () {
102
83
  if (dataStatus === 'unintiated' || dataStatus === 'changed' || parentID !== props.ReferenceTableID)
103
84
  dispatch(props.NoteSlice.Fetch(props.ReferenceTableID));
@@ -122,34 +103,6 @@ function Note(props) {
122
103
  return;
123
104
  setNote(function (n) { return (__assign(__assign({}, n), { ReferenceTableID: props.ReferenceTableID !== undefined ? props.ReferenceTableID : -1 })); });
124
105
  }, [props.ReferenceTableID]);
125
- React.useEffect(function () {
126
- var c = standardCollumns;
127
- if (props.AdditionalCollumns !== undefined)
128
- c.push.apply(c, props.AdditionalCollumns);
129
- if (props.NoteTags.length > 1)
130
- c.push({ key: 'NoteTagID', field: 'NoteTagID', label: 'Type', headerStyle: { width: 'auto' }, rowStyle: { width: 'auto' },
131
- content: function (n) { var _a; return (_a = props.NoteTags.find(function (t) { return t.ID === n.NoteTagID; })) === null || _a === void 0 ? void 0 : _a.Name; } });
132
- if (props.NoteApplications.length > 1)
133
- c.push({ key: 'NoteApplicationID', field: 'NoteApplicationID', label: 'Application', headerStyle: { width: 'auto' }, rowStyle: { width: 'auto' },
134
- content: function (n) { var _a; return (_a = props.NoteApplications.find(function (t) { return t.ID === n.NoteApplicationID; })) === null || _a === void 0 ? void 0 : _a.Name; } });
135
- c.push({
136
- key: 'buttons',
137
- label: '',
138
- headerStyle: { width: 'auto' }, rowStyle: { width: 'auto' },
139
- content: function (item) { return React.createElement(React.Fragment, null,
140
- allowEdit ? React.createElement("button", { className: "btn btn-sm", onClick: function () { return handleEdit(item); } },
141
- React.createElement("span", null,
142
- " ",
143
- gpa_symbols_1.Pencil,
144
- " ")) : null,
145
- allowRemove ? React.createElement("button", { className: "btn btn-sm", onClick: function () { return dispatch(props.NoteSlice.DBAction({ verb: 'DELETE', record: item })); } },
146
- React.createElement("span", null,
147
- " ",
148
- gpa_symbols_1.TrashCan,
149
- " ")) : null); }
150
- });
151
- setCollumns(c);
152
- }, [props.NoteTags, props.NoteApplications, props.AdditionalCollumns]);
153
106
  React.useEffect(function () {
154
107
  setNotes(data.filter(function (n) { return (props.Filter === undefined ? true : props.Filter(n)); }));
155
108
  }, [props.Filter, data]);
@@ -200,30 +153,51 @@ function Note(props) {
200
153
  handleAdd(note); }, "data-tooltip": "Add", style: { cursor: note.Note === null || note.Note.length === 0 ? 'not-allowed' : 'pointer' }, onMouseOver: function () { return setHover('add'); }, onMouseOut: function () { return setHover('none'); } }, "Add Note"),
201
154
  React.createElement(react_interactive_1.ToolTip, { Show: hover === 'add' && (note.Note === null || note.Note.length === 0), Position: 'top', Target: "Add" },
202
155
  React.createElement("p", null,
203
- gpa_symbols_1.CrossMark,
156
+ React.createElement(gpa_symbols_1.ReactIcons.CrossMark, null),
204
157
  " A note needs to be entered. "))),
205
158
  React.createElement("div", { className: "btn-group mr-2" },
206
159
  React.createElement("button", { className: "btn btn-default" + (note.Note === null || note.Note.length === 0 ? ' disabled' : ''), onClick: function () { return setNote(function (n) { return (__assign(__assign({}, n), { Note: '' })); }); }, style: { cursor: note.Note === null || note.Note.length === 0 ? 'not-allowed' : 'pointer' }, "data-tooltip": "Remove", onMouseOver: function () { return setHover('clear'); }, onMouseOut: function () { return setHover('none'); } }, "Clear"),
207
160
  React.createElement(react_interactive_1.ToolTip, { Show: hover === 'clear' && (note.Note === null || note.Note.length === 0), Position: 'top', Target: "Remove" },
208
161
  React.createElement("p", null,
209
- gpa_symbols_1.CrossMark,
210
- " The note field is already empty. ")))) : null,
162
+ React.createElement(gpa_symbols_1.ReactIcons.CrossMark, null),
163
+ " The note field is already empty. "))))
164
+ : null,
211
165
  React.createElement("div", null,
212
- React.createElement(react_table_1.default, { cols: collumns, tableClass: "table table-hover", data: notes, sortKey: sortField, ascending: ascending, onSort: function (d) {
166
+ React.createElement(react_table_1.Table, { TableClass: "table table-hover", Data: notes, SortKey: sortField, Ascending: ascending, OnSort: function (d) {
213
167
  if (d.colField === undefined)
214
168
  return;
215
169
  if (d.colField === sortField)
216
170
  dispatch(props.NoteSlice.Sort({ SortField: sortField, Ascending: ascending }));
217
171
  else
218
172
  dispatch(props.NoteSlice.Sort({ SortField: d.colField, Ascending: true }));
219
- }, onClick: function () { return; }, theadStyle: { fontSize: 'smaller', display: 'table', tableLayout: 'fixed', width: '100%' }, tbodyStyle: { display: 'block', overflowY: 'scroll', maxHeight: props.MaxHeight - 300, width: '100%' }, rowStyle: { fontSize: 'smaller', display: 'table', tableLayout: 'fixed', width: '100%' }, selected: function () { return false; } })),
173
+ }, OnClick: function () { return; }, TbodyStyle: { maxHeight: props.MaxHeight - 300 }, Selected: function () { return false; }, KeySelector: function (d) { return d.ID; } },
174
+ React.createElement(react_table_1.Column, { Key: "Note", Field: "Note", HeaderStyle: { width: '50%' }, RowStyle: { width: '50%' } }, "Note"),
175
+ React.createElement(react_table_1.Column, { Key: "Timestamp", Field: "Timestamp", HeaderStyle: { width: 'auto' }, RowStyle: { width: 'auto' }, Content: function (row) { return moment.utc(row.item.Timestamp).format("MM/DD/YYYY HH:mm"); } }, "Time"),
176
+ React.createElement(react_table_1.Column, { Key: "UserAccount", Field: "UserAccount", HeaderStyle: { width: 'auto' }, RowStyle: { width: 'auto' } }, "User"),
177
+ props.children,
178
+ props.NoteTags.length > 1 ?
179
+ React.createElement(react_table_1.Column, { Key: "NoteTagID", Field: "NoteTagID", HeaderStyle: { width: 'auto' }, RowStyle: { width: 'auto' }, Content: function (row) { var _a; return (_a = props.NoteTags.find(function (t) { return t.ID === row.item.NoteTagID; })) === null || _a === void 0 ? void 0 : _a.Name; } }, "Type")
180
+ : React.createElement(React.Fragment, null),
181
+ props.NoteApplications.length > 1 ?
182
+ React.createElement(react_table_1.Column, { Key: "NoteApplicationID", Field: "NoteApplicationID", HeaderStyle: { width: 'auto' }, RowStyle: { width: 'auto' }, Content: function (row) { var _a; return (_a = props.NoteApplications.find(function (t) { return t.ID === row.item.NoteApplicationID; })) === null || _a === void 0 ? void 0 : _a.Name; } }, "Application")
183
+ : React.createElement(React.Fragment, null),
184
+ React.createElement(react_table_1.Column, { Key: "buttons", HeaderStyle: { width: 'auto' }, RowStyle: { width: 'auto' }, Content: function (row) {
185
+ return React.createElement(React.Fragment, null,
186
+ allowEdit ?
187
+ React.createElement("button", { className: "btn btn-sm", onClick: function () { return handleEdit(row.item); } },
188
+ React.createElement(gpa_symbols_1.ReactIcons.CrossMark, null))
189
+ : null,
190
+ allowRemove ?
191
+ React.createElement("button", { className: "btn btn-sm", onClick: function () { return dispatch(props.NoteSlice.DBAction({ verb: 'DELETE', record: row.item })); } },
192
+ React.createElement(gpa_symbols_1.ReactIcons.TrashCan, null))
193
+ : null);
194
+ } }, "\u00A0"))),
220
195
  allowAdd && showCard ?
221
196
  React.createElement(NoteOptions, { Record: note, Setter: function (n) { return setNote(n); }, NoteTags: props.NoteTags, NoteTypes: props.NoteTypes, NoteApplications: props.NoteApplications, ShowApplications: !useFixedApp })
222
197
  : null,
223
198
  React.createElement(react_interactive_1.Modal, { Show: showEdit, Title: 'Edit Note', ShowCancel: true, CallBack: handleSaveEdit, DisableConfirm: note.Note == null || note.Note.length === 0, ShowX: true, ConfirmShowToolTip: note.Note == null || note.Note.length === 0, ConfirmToolTipContent: React.createElement("p", null,
224
- " ",
225
- gpa_symbols_1.CrossMark,
226
- " An empty Note can not be saved. ") },
199
+ React.createElement(gpa_symbols_1.ReactIcons.CrossMark, null),
200
+ " An empty Note can not be saved.") },
227
201
  React.createElement(NoteOptions, { ShowApplications: !useFixedApp, Record: note, Setter: function (n) { return setNote(n); }, NoteTags: props.NoteTags, NoteTypes: props.NoteTypes, NoteApplications: props.NoteApplications }))),
228
202
  allowAdd && showCard ?
229
203
  React.createElement("div", { className: "card-footer" },
@@ -232,16 +206,18 @@ function Note(props) {
232
206
  handleAdd(note); }, "data-tooltip": "Add", style: { cursor: note.Note === null || note.Note.length === 0 ? 'not-allowed' : 'pointer' }, onMouseOver: function () { return setHover('add'); }, onMouseOut: function () { return setHover('none'); } }, "Add Note"),
233
207
  React.createElement(react_interactive_1.ToolTip, { Show: hover === 'add' && (note.Note === null || note.Note.length === 0), Position: 'top', Target: "Add" },
234
208
  React.createElement("p", null,
235
- gpa_symbols_1.CrossMark,
236
- " A note needs to be entered. "))),
209
+ React.createElement(gpa_symbols_1.ReactIcons.CrossMark, null),
210
+ " A note needs to be entered."))),
237
211
  React.createElement("div", { className: "btn-group mr-2" },
238
212
  React.createElement("button", { className: "btn btn-default" + (note.Note === null || note.Note.length === 0 ? ' disabled' : ''), onClick: function () { return setNote(function (n) { return (__assign(__assign({}, n), { Note: '' })); }); }, style: { cursor: note.Note === null || note.Note.length === 0 ? 'not-allowed' : 'pointer' }, "data-tooltip": "Remove", onMouseOver: function () { return setHover('clear'); }, onMouseOut: function () { return setHover('none'); } }, "Clear"),
239
213
  React.createElement(react_interactive_1.ToolTip, { Show: hover === 'clear' && (note.Note === null || note.Note.length === 0), Position: 'top', Target: "Remove" },
240
214
  React.createElement("p", null,
241
- gpa_symbols_1.CrossMark,
215
+ React.createElement(gpa_symbols_1.ReactIcons.CrossMark, null),
242
216
  " The note field is already empty. "))))
243
217
  : null,
244
- !allowAdd && showCard ? React.createElement("div", { className: props.ShowCard === undefined || props.ShowCard ? "card-footer" : "" }, " ") : null));
218
+ !allowAdd && showCard ?
219
+ React.createElement("div", { className: props.ShowCard === undefined || props.ShowCard ? "card-footer" : "" }, " ")
220
+ : null));
245
221
  }
246
222
  function NoteOptions(props) {
247
223
  var showOptions = props.NoteTags.length > 1 || props.NoteTypes.length > 1 || props.NoteApplications.length > 1;
@@ -0,0 +1,7 @@
1
+ import { Gemstone } from '@gpa-gemstone/application-typings';
2
+ interface IAdditionalProps<T> {
3
+ Fields: Gemstone.TSX.Interfaces.ICSVField<T>[];
4
+ DataHasHeaders: boolean;
5
+ }
6
+ export declare function useCSVPipeline<T = unknown>(csvFields: Gemstone.TSX.Interfaces.ICSVField<T>[]): Gemstone.TSX.Interfaces.IPipeline<T, IAdditionalProps<T>>;
7
+ export {};