@teselagen/ui 0.3.71 → 0.3.73
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/index.cjs.js +65 -37
- package/index.es.js +65 -37
- package/package.json +1 -1
- package/src/DataTable/index.js +50 -28
- package/src/FormComponents/Uploader.js +4 -5
- package/src/UploadCsvWizard.js +0 -4
package/index.cjs.js
CHANGED
|
@@ -17117,16 +17117,25 @@ var toString$6 = {}.toString;
|
|
|
17117
17117
|
var _cof = /* @__PURE__ */ __name(function(it) {
|
|
17118
17118
|
return toString$6.call(it).slice(8, -1);
|
|
17119
17119
|
}, "_cof");
|
|
17120
|
-
var
|
|
17121
|
-
var
|
|
17122
|
-
|
|
17123
|
-
|
|
17120
|
+
var _iobject;
|
|
17121
|
+
var hasRequired_iobject;
|
|
17122
|
+
function require_iobject() {
|
|
17123
|
+
if (hasRequired_iobject)
|
|
17124
|
+
return _iobject;
|
|
17125
|
+
hasRequired_iobject = 1;
|
|
17126
|
+
var cof2 = _cof;
|
|
17127
|
+
_iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
|
|
17128
|
+
return cof2(it) == "String" ? it.split("") : Object(it);
|
|
17129
|
+
};
|
|
17130
|
+
return _iobject;
|
|
17131
|
+
}
|
|
17132
|
+
__name(require_iobject, "require_iobject");
|
|
17124
17133
|
var _defined = /* @__PURE__ */ __name(function(it) {
|
|
17125
17134
|
if (it == void 0)
|
|
17126
17135
|
throw TypeError("Can't call method on " + it);
|
|
17127
17136
|
return it;
|
|
17128
17137
|
}, "_defined");
|
|
17129
|
-
var IObject =
|
|
17138
|
+
var IObject = require_iobject();
|
|
17130
17139
|
var defined$2 = _defined;
|
|
17131
17140
|
var _toIobject = /* @__PURE__ */ __name(function(it) {
|
|
17132
17141
|
return IObject(defined$2(it));
|
|
@@ -17247,7 +17256,7 @@ function require_objectAssign() {
|
|
|
17247
17256
|
var gOPS2 = _objectGops;
|
|
17248
17257
|
var pIE2 = require_objectPie();
|
|
17249
17258
|
var toObject2 = _toObject;
|
|
17250
|
-
var IObject2 =
|
|
17259
|
+
var IObject2 = require_iobject();
|
|
17251
17260
|
var $assign = Object.assign;
|
|
17252
17261
|
_objectAssign = !$assign || _fails(function() {
|
|
17253
17262
|
var A2 = {};
|
|
@@ -55774,7 +55783,7 @@ const _DataTable = class _DataTable extends React$1.Component {
|
|
|
55774
55783
|
onFinishMsg: "Column Copied"
|
|
55775
55784
|
});
|
|
55776
55785
|
}, "handleCopyColumn"));
|
|
55777
|
-
__publicField(this, "handleCopyRows", /* @__PURE__ */ __name((rowElsToCopy, { specificColumn, onFinishMsg } = {}) => {
|
|
55786
|
+
__publicField(this, "handleCopyRows", /* @__PURE__ */ __name((rowElsToCopy, { specificColumn, onFinishMsg, isDownload } = {}) => {
|
|
55778
55787
|
let textToCopy = [];
|
|
55779
55788
|
const jsonToCopy = [];
|
|
55780
55789
|
lodashExports.forEach(rowElsToCopy, (rowEl) => {
|
|
@@ -55785,7 +55794,15 @@ const _DataTable = class _DataTable extends React$1.Component {
|
|
|
55785
55794
|
textToCopy = textToCopy.filter((text2) => text2).join("\n");
|
|
55786
55795
|
if (!textToCopy)
|
|
55787
55796
|
return window.toastr.warning("No text to copy");
|
|
55788
|
-
|
|
55797
|
+
if (isDownload) {
|
|
55798
|
+
downloadjs(textToCopy.replaceAll(" ", ","), "tableData.csv", "text/csv");
|
|
55799
|
+
} else {
|
|
55800
|
+
this.handleCopyHelper(
|
|
55801
|
+
textToCopy,
|
|
55802
|
+
jsonToCopy,
|
|
55803
|
+
onFinishMsg || "Row Copied"
|
|
55804
|
+
);
|
|
55805
|
+
}
|
|
55789
55806
|
}, "handleCopyRows"));
|
|
55790
55807
|
__publicField(this, "updateEntitiesHelper", /* @__PURE__ */ __name((ents, fn4) => {
|
|
55791
55808
|
const { change, reduxFormEntitiesUndoRedoStack = { currentVersion: 0 } } = this.props;
|
|
@@ -55838,14 +55855,14 @@ const _DataTable = class _DataTable extends React$1.Component {
|
|
|
55838
55855
|
window.toastr.success(message);
|
|
55839
55856
|
}
|
|
55840
55857
|
}, "handleCopyHelper"));
|
|
55841
|
-
__publicField(this, "handleCopyTable", /* @__PURE__ */ __name((e2) => {
|
|
55858
|
+
__publicField(this, "handleCopyTable", /* @__PURE__ */ __name((e2, opts) => {
|
|
55842
55859
|
try {
|
|
55843
55860
|
const allRowEls = getAllRows(e2);
|
|
55844
55861
|
if (!allRowEls)
|
|
55845
55862
|
return;
|
|
55846
|
-
this.handleCopyRows(allRowEls, {
|
|
55863
|
+
this.handleCopyRows(allRowEls, __spreadProps(__spreadValues({}, opts), {
|
|
55847
55864
|
onFinishMsg: "Table Copied"
|
|
55848
|
-
});
|
|
55865
|
+
}));
|
|
55849
55866
|
} catch (error) {
|
|
55850
55867
|
console.error(`error:`, error);
|
|
55851
55868
|
window.toastr.error("Error copying rows.");
|
|
@@ -56093,7 +56110,8 @@ const _DataTable = class _DataTable extends React$1.Component {
|
|
|
56093
56110
|
getRowClassName && getRowClassName(rowInfo, state, this.props),
|
|
56094
56111
|
{
|
|
56095
56112
|
disabled: rowDisabled,
|
|
56096
|
-
selected: rowSelected && !withCheckboxes
|
|
56113
|
+
selected: rowSelected && !withCheckboxes,
|
|
56114
|
+
"rt-tr-last-row": rowInfo.index === entities.length - 1
|
|
56097
56115
|
}
|
|
56098
56116
|
),
|
|
56099
56117
|
"data-test-id": dataId === void 0 ? rowInfo.index : dataId,
|
|
@@ -58097,27 +58115,6 @@ const _DataTable = class _DataTable extends React$1.Component {
|
|
|
58097
58115
|
if (n2)
|
|
58098
58116
|
this.table = n2;
|
|
58099
58117
|
},
|
|
58100
|
-
additionalBodyEl: isCellEditable && !onlyShowRowsWErrors && /* @__PURE__ */ React$1.createElement(
|
|
58101
|
-
"div",
|
|
58102
|
-
{
|
|
58103
|
-
style: {
|
|
58104
|
-
width: "100%",
|
|
58105
|
-
display: "flex",
|
|
58106
|
-
justifyContent: "center"
|
|
58107
|
-
}
|
|
58108
|
-
},
|
|
58109
|
-
/* @__PURE__ */ React$1.createElement(
|
|
58110
|
-
core$5.Button,
|
|
58111
|
-
{
|
|
58112
|
-
icon: "add",
|
|
58113
|
-
onClick: () => {
|
|
58114
|
-
this.insertRows({ numRows: 10, appendToBottom: true });
|
|
58115
|
-
},
|
|
58116
|
-
minimal: true
|
|
58117
|
-
},
|
|
58118
|
-
"Add 10 Rows"
|
|
58119
|
-
)
|
|
58120
|
-
),
|
|
58121
58118
|
className: classNames({
|
|
58122
58119
|
isCellEditable,
|
|
58123
58120
|
"tg-table-loading": isLoading,
|
|
@@ -58159,6 +58156,37 @@ const _DataTable = class _DataTable extends React$1.Component {
|
|
|
58159
58156
|
SubComponent: SubComponentToUse
|
|
58160
58157
|
}, ReactTableProps)
|
|
58161
58158
|
),
|
|
58159
|
+
isCellEditable && /* @__PURE__ */ React$1.createElement("div", { style: { display: "flex" } }, /* @__PURE__ */ React$1.createElement(
|
|
58160
|
+
"div",
|
|
58161
|
+
{
|
|
58162
|
+
style: {
|
|
58163
|
+
width: "100%",
|
|
58164
|
+
display: "flex",
|
|
58165
|
+
justifyContent: "center"
|
|
58166
|
+
}
|
|
58167
|
+
},
|
|
58168
|
+
!onlyShowRowsWErrors && /* @__PURE__ */ React$1.createElement(
|
|
58169
|
+
core$5.Button,
|
|
58170
|
+
{
|
|
58171
|
+
icon: "add",
|
|
58172
|
+
onClick: () => {
|
|
58173
|
+
this.insertRows({ numRows: 10, appendToBottom: true });
|
|
58174
|
+
},
|
|
58175
|
+
minimal: true
|
|
58176
|
+
},
|
|
58177
|
+
"Add 10 Rows"
|
|
58178
|
+
)
|
|
58179
|
+
), /* @__PURE__ */ React$1.createElement(
|
|
58180
|
+
core$5.Button,
|
|
58181
|
+
{
|
|
58182
|
+
onClick: (e2) => {
|
|
58183
|
+
this.handleCopyTable(e2, { isDownload: true });
|
|
58184
|
+
},
|
|
58185
|
+
"data-tip": "Download Table as CSV",
|
|
58186
|
+
minimal: true,
|
|
58187
|
+
icon: "download"
|
|
58188
|
+
}
|
|
58189
|
+
)),
|
|
58162
58190
|
!noFooter && /* @__PURE__ */ React$1.createElement(
|
|
58163
58191
|
"div",
|
|
58164
58192
|
{
|
|
@@ -70704,7 +70732,7 @@ function UploaderInner({
|
|
|
70704
70732
|
dropzoneProps = {},
|
|
70705
70733
|
overflowList,
|
|
70706
70734
|
autoUnzip,
|
|
70707
|
-
_disabled,
|
|
70735
|
+
disabled: _disabled,
|
|
70708
70736
|
noBuildCsvOption,
|
|
70709
70737
|
initializeForm,
|
|
70710
70738
|
showFilesCount,
|
|
@@ -70732,9 +70760,9 @@ function UploaderInner({
|
|
|
70732
70760
|
}
|
|
70733
70761
|
if (acceptLoading)
|
|
70734
70762
|
dropzoneDisabled = true;
|
|
70735
|
-
const accept = !_accept ? void 0 :
|
|
70736
|
-
const callout = _callout || ((_b = (_a2 = accept.find) == null ? void 0 : _a2.call(accept, (a2) => a2 == null ? void 0 : a2.callout)) == null ? void 0 : _b.callout);
|
|
70737
|
-
const validateAgainstSchemaToUse = _validateAgainstSchema || ((_d = (_c = accept.find) == null ? void 0 : _c.call(accept, (a2) => a2 == null ? void 0 : a2.validateAgainstSchema)) == null ? void 0 : _d.validateAgainstSchema);
|
|
70763
|
+
const accept = !_accept ? void 0 : isAcceptPromise && !resolvedAccept ? [] : lodashExports.isPlainObject(_accept) ? [_accept] : lodashExports.isArray(_accept) ? _accept : _accept.split(",").map((a2) => ({ type: a2 }));
|
|
70764
|
+
const callout = _callout || ((_b = (_a2 = accept == null ? void 0 : accept.find) == null ? void 0 : _a2.call(accept, (a2) => a2 == null ? void 0 : a2.callout)) == null ? void 0 : _b.callout);
|
|
70765
|
+
const validateAgainstSchemaToUse = _validateAgainstSchema || ((_d = (_c = accept == null ? void 0 : accept.find) == null ? void 0 : _c.call(accept, (a2) => a2 == null ? void 0 : a2.validateAgainstSchema)) == null ? void 0 : _d.validateAgainstSchema);
|
|
70738
70766
|
React$1.useEffect(() => {
|
|
70739
70767
|
validateAgainstSchemaStore.current.setValidateAgainstSchema(
|
|
70740
70768
|
validateAgainstSchemaToUse
|
package/index.es.js
CHANGED
|
@@ -17099,16 +17099,25 @@ var toString$6 = {}.toString;
|
|
|
17099
17099
|
var _cof = /* @__PURE__ */ __name(function(it) {
|
|
17100
17100
|
return toString$6.call(it).slice(8, -1);
|
|
17101
17101
|
}, "_cof");
|
|
17102
|
-
var
|
|
17103
|
-
var
|
|
17104
|
-
|
|
17105
|
-
|
|
17102
|
+
var _iobject;
|
|
17103
|
+
var hasRequired_iobject;
|
|
17104
|
+
function require_iobject() {
|
|
17105
|
+
if (hasRequired_iobject)
|
|
17106
|
+
return _iobject;
|
|
17107
|
+
hasRequired_iobject = 1;
|
|
17108
|
+
var cof2 = _cof;
|
|
17109
|
+
_iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
|
|
17110
|
+
return cof2(it) == "String" ? it.split("") : Object(it);
|
|
17111
|
+
};
|
|
17112
|
+
return _iobject;
|
|
17113
|
+
}
|
|
17114
|
+
__name(require_iobject, "require_iobject");
|
|
17106
17115
|
var _defined = /* @__PURE__ */ __name(function(it) {
|
|
17107
17116
|
if (it == void 0)
|
|
17108
17117
|
throw TypeError("Can't call method on " + it);
|
|
17109
17118
|
return it;
|
|
17110
17119
|
}, "_defined");
|
|
17111
|
-
var IObject =
|
|
17120
|
+
var IObject = require_iobject();
|
|
17112
17121
|
var defined$2 = _defined;
|
|
17113
17122
|
var _toIobject = /* @__PURE__ */ __name(function(it) {
|
|
17114
17123
|
return IObject(defined$2(it));
|
|
@@ -17229,7 +17238,7 @@ function require_objectAssign() {
|
|
|
17229
17238
|
var gOPS2 = _objectGops;
|
|
17230
17239
|
var pIE2 = require_objectPie();
|
|
17231
17240
|
var toObject2 = _toObject;
|
|
17232
|
-
var IObject2 =
|
|
17241
|
+
var IObject2 = require_iobject();
|
|
17233
17242
|
var $assign = Object.assign;
|
|
17234
17243
|
_objectAssign = !$assign || _fails(function() {
|
|
17235
17244
|
var A2 = {};
|
|
@@ -55756,7 +55765,7 @@ const _DataTable = class _DataTable extends React__default.Component {
|
|
|
55756
55765
|
onFinishMsg: "Column Copied"
|
|
55757
55766
|
});
|
|
55758
55767
|
}, "handleCopyColumn"));
|
|
55759
|
-
__publicField(this, "handleCopyRows", /* @__PURE__ */ __name((rowElsToCopy, { specificColumn, onFinishMsg } = {}) => {
|
|
55768
|
+
__publicField(this, "handleCopyRows", /* @__PURE__ */ __name((rowElsToCopy, { specificColumn, onFinishMsg, isDownload } = {}) => {
|
|
55760
55769
|
let textToCopy = [];
|
|
55761
55770
|
const jsonToCopy = [];
|
|
55762
55771
|
lodashExports.forEach(rowElsToCopy, (rowEl) => {
|
|
@@ -55767,7 +55776,15 @@ const _DataTable = class _DataTable extends React__default.Component {
|
|
|
55767
55776
|
textToCopy = textToCopy.filter((text2) => text2).join("\n");
|
|
55768
55777
|
if (!textToCopy)
|
|
55769
55778
|
return window.toastr.warning("No text to copy");
|
|
55770
|
-
|
|
55779
|
+
if (isDownload) {
|
|
55780
|
+
downloadjs(textToCopy.replaceAll(" ", ","), "tableData.csv", "text/csv");
|
|
55781
|
+
} else {
|
|
55782
|
+
this.handleCopyHelper(
|
|
55783
|
+
textToCopy,
|
|
55784
|
+
jsonToCopy,
|
|
55785
|
+
onFinishMsg || "Row Copied"
|
|
55786
|
+
);
|
|
55787
|
+
}
|
|
55771
55788
|
}, "handleCopyRows"));
|
|
55772
55789
|
__publicField(this, "updateEntitiesHelper", /* @__PURE__ */ __name((ents, fn4) => {
|
|
55773
55790
|
const { change: change2, reduxFormEntitiesUndoRedoStack = { currentVersion: 0 } } = this.props;
|
|
@@ -55820,14 +55837,14 @@ const _DataTable = class _DataTable extends React__default.Component {
|
|
|
55820
55837
|
window.toastr.success(message);
|
|
55821
55838
|
}
|
|
55822
55839
|
}, "handleCopyHelper"));
|
|
55823
|
-
__publicField(this, "handleCopyTable", /* @__PURE__ */ __name((e2) => {
|
|
55840
|
+
__publicField(this, "handleCopyTable", /* @__PURE__ */ __name((e2, opts) => {
|
|
55824
55841
|
try {
|
|
55825
55842
|
const allRowEls = getAllRows(e2);
|
|
55826
55843
|
if (!allRowEls)
|
|
55827
55844
|
return;
|
|
55828
|
-
this.handleCopyRows(allRowEls, {
|
|
55845
|
+
this.handleCopyRows(allRowEls, __spreadProps(__spreadValues({}, opts), {
|
|
55829
55846
|
onFinishMsg: "Table Copied"
|
|
55830
|
-
});
|
|
55847
|
+
}));
|
|
55831
55848
|
} catch (error) {
|
|
55832
55849
|
console.error(`error:`, error);
|
|
55833
55850
|
window.toastr.error("Error copying rows.");
|
|
@@ -56075,7 +56092,8 @@ const _DataTable = class _DataTable extends React__default.Component {
|
|
|
56075
56092
|
getRowClassName && getRowClassName(rowInfo, state, this.props),
|
|
56076
56093
|
{
|
|
56077
56094
|
disabled: rowDisabled,
|
|
56078
|
-
selected: rowSelected && !withCheckboxes
|
|
56095
|
+
selected: rowSelected && !withCheckboxes,
|
|
56096
|
+
"rt-tr-last-row": rowInfo.index === entities.length - 1
|
|
56079
56097
|
}
|
|
56080
56098
|
),
|
|
56081
56099
|
"data-test-id": dataId === void 0 ? rowInfo.index : dataId,
|
|
@@ -58079,27 +58097,6 @@ const _DataTable = class _DataTable extends React__default.Component {
|
|
|
58079
58097
|
if (n2)
|
|
58080
58098
|
this.table = n2;
|
|
58081
58099
|
},
|
|
58082
|
-
additionalBodyEl: isCellEditable && !onlyShowRowsWErrors && /* @__PURE__ */ React__default.createElement(
|
|
58083
|
-
"div",
|
|
58084
|
-
{
|
|
58085
|
-
style: {
|
|
58086
|
-
width: "100%",
|
|
58087
|
-
display: "flex",
|
|
58088
|
-
justifyContent: "center"
|
|
58089
|
-
}
|
|
58090
|
-
},
|
|
58091
|
-
/* @__PURE__ */ React__default.createElement(
|
|
58092
|
-
Button,
|
|
58093
|
-
{
|
|
58094
|
-
icon: "add",
|
|
58095
|
-
onClick: () => {
|
|
58096
|
-
this.insertRows({ numRows: 10, appendToBottom: true });
|
|
58097
|
-
},
|
|
58098
|
-
minimal: true
|
|
58099
|
-
},
|
|
58100
|
-
"Add 10 Rows"
|
|
58101
|
-
)
|
|
58102
|
-
),
|
|
58103
58100
|
className: classNames({
|
|
58104
58101
|
isCellEditable,
|
|
58105
58102
|
"tg-table-loading": isLoading,
|
|
@@ -58141,6 +58138,37 @@ const _DataTable = class _DataTable extends React__default.Component {
|
|
|
58141
58138
|
SubComponent: SubComponentToUse
|
|
58142
58139
|
}, ReactTableProps)
|
|
58143
58140
|
),
|
|
58141
|
+
isCellEditable && /* @__PURE__ */ React__default.createElement("div", { style: { display: "flex" } }, /* @__PURE__ */ React__default.createElement(
|
|
58142
|
+
"div",
|
|
58143
|
+
{
|
|
58144
|
+
style: {
|
|
58145
|
+
width: "100%",
|
|
58146
|
+
display: "flex",
|
|
58147
|
+
justifyContent: "center"
|
|
58148
|
+
}
|
|
58149
|
+
},
|
|
58150
|
+
!onlyShowRowsWErrors && /* @__PURE__ */ React__default.createElement(
|
|
58151
|
+
Button,
|
|
58152
|
+
{
|
|
58153
|
+
icon: "add",
|
|
58154
|
+
onClick: () => {
|
|
58155
|
+
this.insertRows({ numRows: 10, appendToBottom: true });
|
|
58156
|
+
},
|
|
58157
|
+
minimal: true
|
|
58158
|
+
},
|
|
58159
|
+
"Add 10 Rows"
|
|
58160
|
+
)
|
|
58161
|
+
), /* @__PURE__ */ React__default.createElement(
|
|
58162
|
+
Button,
|
|
58163
|
+
{
|
|
58164
|
+
onClick: (e2) => {
|
|
58165
|
+
this.handleCopyTable(e2, { isDownload: true });
|
|
58166
|
+
},
|
|
58167
|
+
"data-tip": "Download Table as CSV",
|
|
58168
|
+
minimal: true,
|
|
58169
|
+
icon: "download"
|
|
58170
|
+
}
|
|
58171
|
+
)),
|
|
58144
58172
|
!noFooter && /* @__PURE__ */ React__default.createElement(
|
|
58145
58173
|
"div",
|
|
58146
58174
|
{
|
|
@@ -70686,7 +70714,7 @@ function UploaderInner({
|
|
|
70686
70714
|
dropzoneProps = {},
|
|
70687
70715
|
overflowList,
|
|
70688
70716
|
autoUnzip,
|
|
70689
|
-
_disabled,
|
|
70717
|
+
disabled: _disabled,
|
|
70690
70718
|
noBuildCsvOption,
|
|
70691
70719
|
initializeForm,
|
|
70692
70720
|
showFilesCount,
|
|
@@ -70714,9 +70742,9 @@ function UploaderInner({
|
|
|
70714
70742
|
}
|
|
70715
70743
|
if (acceptLoading)
|
|
70716
70744
|
dropzoneDisabled = true;
|
|
70717
|
-
const accept = !_accept ? void 0 :
|
|
70718
|
-
const callout = _callout || ((_b = (_a2 = accept.find) == null ? void 0 : _a2.call(accept, (a2) => a2 == null ? void 0 : a2.callout)) == null ? void 0 : _b.callout);
|
|
70719
|
-
const validateAgainstSchemaToUse = _validateAgainstSchema || ((_d = (_c = accept.find) == null ? void 0 : _c.call(accept, (a2) => a2 == null ? void 0 : a2.validateAgainstSchema)) == null ? void 0 : _d.validateAgainstSchema);
|
|
70745
|
+
const accept = !_accept ? void 0 : isAcceptPromise && !resolvedAccept ? [] : lodashExports.isPlainObject(_accept) ? [_accept] : lodashExports.isArray(_accept) ? _accept : _accept.split(",").map((a2) => ({ type: a2 }));
|
|
70746
|
+
const callout = _callout || ((_b = (_a2 = accept == null ? void 0 : accept.find) == null ? void 0 : _a2.call(accept, (a2) => a2 == null ? void 0 : a2.callout)) == null ? void 0 : _b.callout);
|
|
70747
|
+
const validateAgainstSchemaToUse = _validateAgainstSchema || ((_d = (_c = accept == null ? void 0 : accept.find) == null ? void 0 : _c.call(accept, (a2) => a2 == null ? void 0 : a2.validateAgainstSchema)) == null ? void 0 : _d.validateAgainstSchema);
|
|
70720
70748
|
useEffect(() => {
|
|
70721
70749
|
validateAgainstSchemaStore.current.setValidateAgainstSchema(
|
|
70722
70750
|
validateAgainstSchemaToUse
|
package/package.json
CHANGED
package/src/DataTable/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import React, { useState } from "react";
|
|
|
3
3
|
import ReactDOM from "react-dom";
|
|
4
4
|
import { arrayMove } from "react-sortable-hoc";
|
|
5
5
|
import copy from "copy-to-clipboard";
|
|
6
|
+
import download from "downloadjs";
|
|
6
7
|
import {
|
|
7
8
|
invert,
|
|
8
9
|
toNumber,
|
|
@@ -880,7 +881,10 @@ class DataTable extends React.Component {
|
|
|
880
881
|
onFinishMsg: "Column Copied"
|
|
881
882
|
});
|
|
882
883
|
};
|
|
883
|
-
handleCopyRows = (
|
|
884
|
+
handleCopyRows = (
|
|
885
|
+
rowElsToCopy,
|
|
886
|
+
{ specificColumn, onFinishMsg, isDownload } = {}
|
|
887
|
+
) => {
|
|
884
888
|
let textToCopy = [];
|
|
885
889
|
const jsonToCopy = [];
|
|
886
890
|
forEach(rowElsToCopy, rowEl => {
|
|
@@ -890,8 +894,15 @@ class DataTable extends React.Component {
|
|
|
890
894
|
});
|
|
891
895
|
textToCopy = textToCopy.filter(text => text).join("\n");
|
|
892
896
|
if (!textToCopy) return window.toastr.warning("No text to copy");
|
|
893
|
-
|
|
894
|
-
|
|
897
|
+
if (isDownload) {
|
|
898
|
+
download(textToCopy.replaceAll("\t", ","), "tableData.csv", "text/csv");
|
|
899
|
+
} else {
|
|
900
|
+
this.handleCopyHelper(
|
|
901
|
+
textToCopy,
|
|
902
|
+
jsonToCopy,
|
|
903
|
+
onFinishMsg || "Row Copied"
|
|
904
|
+
);
|
|
905
|
+
}
|
|
895
906
|
};
|
|
896
907
|
updateEntitiesHelper = (ents, fn) => {
|
|
897
908
|
const { change, reduxFormEntitiesUndoRedoStack = { currentVersion: 0 } } =
|
|
@@ -953,11 +964,12 @@ class DataTable extends React.Component {
|
|
|
953
964
|
}
|
|
954
965
|
};
|
|
955
966
|
|
|
956
|
-
handleCopyTable = e => {
|
|
967
|
+
handleCopyTable = (e, opts) => {
|
|
957
968
|
try {
|
|
958
969
|
const allRowEls = getAllRows(e);
|
|
959
970
|
if (!allRowEls) return;
|
|
960
971
|
this.handleCopyRows(allRowEls, {
|
|
972
|
+
...opts,
|
|
961
973
|
onFinishMsg: "Table Copied"
|
|
962
974
|
});
|
|
963
975
|
} catch (error) {
|
|
@@ -1721,28 +1733,7 @@ class DataTable extends React.Component {
|
|
|
1721
1733
|
ref={n => {
|
|
1722
1734
|
if (n) this.table = n;
|
|
1723
1735
|
}}
|
|
1724
|
-
additionalBodyEl={
|
|
1725
|
-
isCellEditable &&
|
|
1726
|
-
!onlyShowRowsWErrors && (
|
|
1727
|
-
<div
|
|
1728
|
-
style={{
|
|
1729
|
-
width: "100%",
|
|
1730
|
-
display: "flex",
|
|
1731
|
-
justifyContent: "center"
|
|
1732
|
-
}}
|
|
1733
|
-
>
|
|
1734
|
-
<Button
|
|
1735
|
-
icon="add"
|
|
1736
|
-
onClick={() => {
|
|
1737
|
-
this.insertRows({ numRows: 10, appendToBottom: true });
|
|
1738
|
-
}}
|
|
1739
|
-
minimal
|
|
1740
|
-
>
|
|
1741
|
-
Add 10 Rows
|
|
1742
|
-
</Button>
|
|
1743
|
-
</div>
|
|
1744
|
-
)
|
|
1745
|
-
}
|
|
1736
|
+
// additionalBodyEl={}
|
|
1746
1737
|
className={classNames({
|
|
1747
1738
|
isCellEditable,
|
|
1748
1739
|
"tg-table-loading": isLoading,
|
|
@@ -1801,7 +1792,37 @@ class DataTable extends React.Component {
|
|
|
1801
1792
|
SubComponent={SubComponentToUse}
|
|
1802
1793
|
{...ReactTableProps}
|
|
1803
1794
|
/>
|
|
1804
|
-
|
|
1795
|
+
{isCellEditable && (
|
|
1796
|
+
<div style={{ display: "flex" }}>
|
|
1797
|
+
<div
|
|
1798
|
+
style={{
|
|
1799
|
+
width: "100%",
|
|
1800
|
+
display: "flex",
|
|
1801
|
+
justifyContent: "center"
|
|
1802
|
+
}}
|
|
1803
|
+
>
|
|
1804
|
+
{!onlyShowRowsWErrors && (
|
|
1805
|
+
<Button
|
|
1806
|
+
icon="add"
|
|
1807
|
+
onClick={() => {
|
|
1808
|
+
this.insertRows({ numRows: 10, appendToBottom: true });
|
|
1809
|
+
}}
|
|
1810
|
+
minimal
|
|
1811
|
+
>
|
|
1812
|
+
Add 10 Rows
|
|
1813
|
+
</Button>
|
|
1814
|
+
)}
|
|
1815
|
+
</div>
|
|
1816
|
+
<Button
|
|
1817
|
+
onClick={e => {
|
|
1818
|
+
this.handleCopyTable(e, { isDownload: true });
|
|
1819
|
+
}}
|
|
1820
|
+
data-tip="Download Table as CSV"
|
|
1821
|
+
minimal
|
|
1822
|
+
icon="download"
|
|
1823
|
+
></Button>
|
|
1824
|
+
</div>
|
|
1825
|
+
)}
|
|
1805
1826
|
{!noFooter && (
|
|
1806
1827
|
<div
|
|
1807
1828
|
className="data-table-footer"
|
|
@@ -1929,7 +1950,8 @@ class DataTable extends React.Component {
|
|
|
1929
1950
|
getRowClassName && getRowClassName(rowInfo, state, this.props),
|
|
1930
1951
|
{
|
|
1931
1952
|
disabled: rowDisabled,
|
|
1932
|
-
selected: rowSelected && !withCheckboxes
|
|
1953
|
+
selected: rowSelected && !withCheckboxes,
|
|
1954
|
+
"rt-tr-last-row": rowInfo.index === entities.length - 1
|
|
1933
1955
|
}
|
|
1934
1956
|
),
|
|
1935
1957
|
"data-test-id": dataId === undefined ? rowInfo.index : dataId,
|
|
@@ -139,7 +139,7 @@ function UploaderInner({
|
|
|
139
139
|
dropzoneProps = {},
|
|
140
140
|
overflowList,
|
|
141
141
|
autoUnzip,
|
|
142
|
-
_disabled,
|
|
142
|
+
disabled: _disabled,
|
|
143
143
|
noBuildCsvOption,
|
|
144
144
|
initializeForm,
|
|
145
145
|
showFilesCount,
|
|
@@ -169,22 +169,21 @@ function UploaderInner({
|
|
|
169
169
|
);
|
|
170
170
|
_accept = [];
|
|
171
171
|
}
|
|
172
|
-
|
|
173
172
|
if (acceptLoading) dropzoneDisabled = true;
|
|
174
173
|
const accept = !_accept
|
|
175
174
|
? undefined
|
|
176
|
-
:
|
|
175
|
+
: isAcceptPromise && !resolvedAccept
|
|
177
176
|
? []
|
|
178
177
|
: isPlainObject(_accept)
|
|
179
178
|
? [_accept]
|
|
180
179
|
: isArray(_accept)
|
|
181
180
|
? _accept
|
|
182
181
|
: _accept.split(",").map(a => ({ type: a }));
|
|
183
|
-
const callout = _callout || accept
|
|
182
|
+
const callout = _callout || accept?.find?.(a => a?.callout)?.callout;
|
|
184
183
|
|
|
185
184
|
const validateAgainstSchemaToUse =
|
|
186
185
|
_validateAgainstSchema ||
|
|
187
|
-
accept
|
|
186
|
+
accept?.find?.(a => a?.validateAgainstSchema)?.validateAgainstSchema;
|
|
188
187
|
|
|
189
188
|
useEffect(() => {
|
|
190
189
|
// validateAgainstSchema
|
package/src/UploadCsvWizard.js
CHANGED
|
@@ -104,10 +104,6 @@ const UploadCsvWizardDialog = compose(
|
|
|
104
104
|
const tabs = (
|
|
105
105
|
<>
|
|
106
106
|
<Callout style={{ marginBottom: 10, flexGrow: 0 }} intent="warning">
|
|
107
|
-
{/* <div>
|
|
108
|
-
It looks like some of the headers/data in your uploaded files have
|
|
109
|
-
issues.
|
|
110
|
-
</div> */}
|
|
111
107
|
<div>
|
|
112
108
|
Please look over each of the following files and correct any issues.
|
|
113
109
|
</div>
|