@teselagen/ui 0.3.36 → 0.3.38
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 +197 -68
- package/index.es.js +197 -68
- package/package.json +2 -1
- package/src/DataTable/index.js +93 -23
- package/src/DataTable/style.css +1 -1
- package/src/FormComponents/Uploader.js +12 -7
- package/src/TgSelect/index.js +19 -9
- package/src/UploadCsvWizard.js +6 -4
- package/src/index.js +3 -0
- package/style.css +2 -2
package/index.es.js
CHANGED
|
@@ -18476,10 +18476,10 @@ var _objectKeysInternal = /* @__PURE__ */ __name(function(object2, names2) {
|
|
|
18476
18476
|
return result;
|
|
18477
18477
|
}, "_objectKeysInternal");
|
|
18478
18478
|
var _enumBugKeys = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");
|
|
18479
|
-
var $keys$
|
|
18479
|
+
var $keys$2 = _objectKeysInternal;
|
|
18480
18480
|
var enumBugKeys = _enumBugKeys;
|
|
18481
18481
|
var _objectKeys = Object.keys || /* @__PURE__ */ __name(function keys(O2) {
|
|
18482
|
-
return $keys$
|
|
18482
|
+
return $keys$2(O2, enumBugKeys);
|
|
18483
18483
|
}, "keys");
|
|
18484
18484
|
var _objectGops = {};
|
|
18485
18485
|
_objectGops.f = Object.getOwnPropertySymbols;
|
|
@@ -19182,13 +19182,21 @@ var _isArray = Array.isArray || /* @__PURE__ */ __name(function isArray(arg) {
|
|
|
19182
19182
|
}, "isArray");
|
|
19183
19183
|
var _objectGopnExt = {};
|
|
19184
19184
|
var _objectGopn = {};
|
|
19185
|
-
var
|
|
19186
|
-
|
|
19187
|
-
|
|
19188
|
-
|
|
19189
|
-
|
|
19185
|
+
var hasRequired_objectGopn;
|
|
19186
|
+
function require_objectGopn() {
|
|
19187
|
+
if (hasRequired_objectGopn)
|
|
19188
|
+
return _objectGopn;
|
|
19189
|
+
hasRequired_objectGopn = 1;
|
|
19190
|
+
var $keys2 = _objectKeysInternal;
|
|
19191
|
+
var hiddenKeys = _enumBugKeys.concat("length", "prototype");
|
|
19192
|
+
_objectGopn.f = Object.getOwnPropertyNames || /* @__PURE__ */ __name(function getOwnPropertyNames4(O2) {
|
|
19193
|
+
return $keys2(O2, hiddenKeys);
|
|
19194
|
+
}, "getOwnPropertyNames");
|
|
19195
|
+
return _objectGopn;
|
|
19196
|
+
}
|
|
19197
|
+
__name(require_objectGopn, "require_objectGopn");
|
|
19190
19198
|
var toIObject$2 = _toIobject;
|
|
19191
|
-
var gOPN$1 =
|
|
19199
|
+
var gOPN$1 = require_objectGopn().f;
|
|
19192
19200
|
var toString$5 = {}.toString;
|
|
19193
19201
|
var windowNames = typeof window == "object" && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
|
|
19194
19202
|
var getWindowNames = /* @__PURE__ */ __name(function(it) {
|
|
@@ -19198,7 +19206,7 @@ var getWindowNames = /* @__PURE__ */ __name(function(it) {
|
|
|
19198
19206
|
return windowNames.slice();
|
|
19199
19207
|
}
|
|
19200
19208
|
}, "getWindowNames");
|
|
19201
|
-
_objectGopnExt.f = /* @__PURE__ */ __name(function
|
|
19209
|
+
_objectGopnExt.f = /* @__PURE__ */ __name(function getOwnPropertyNames(it) {
|
|
19202
19210
|
return windowNames && toString$5.call(it) == "[object Window]" ? getWindowNames(it) : gOPN$1(toIObject$2(it));
|
|
19203
19211
|
}, "getOwnPropertyNames");
|
|
19204
19212
|
var _objectGopd = {};
|
|
@@ -19337,7 +19345,7 @@ var $getOwnPropertyDescriptor = /* @__PURE__ */ __name(function getOwnPropertyDe
|
|
|
19337
19345
|
D2.enumerable = true;
|
|
19338
19346
|
return D2;
|
|
19339
19347
|
}, "getOwnPropertyDescriptor");
|
|
19340
|
-
var $getOwnPropertyNames = /* @__PURE__ */ __name(function
|
|
19348
|
+
var $getOwnPropertyNames = /* @__PURE__ */ __name(function getOwnPropertyNames2(it) {
|
|
19341
19349
|
var names2 = gOPN(toIObject(it));
|
|
19342
19350
|
var result = [];
|
|
19343
19351
|
var i = 0;
|
|
@@ -19381,7 +19389,7 @@ if (!USE_NATIVE) {
|
|
|
19381
19389
|
}, "toString"));
|
|
19382
19390
|
$GOPD.f = $getOwnPropertyDescriptor;
|
|
19383
19391
|
$DP.f = $defineProperty;
|
|
19384
|
-
|
|
19392
|
+
require_objectGopn().f = gOPNExt.f = $getOwnPropertyNames;
|
|
19385
19393
|
require_objectPie().f = $propertyIsEnumerable;
|
|
19386
19394
|
$GOPS.f = $getOwnPropertySymbols;
|
|
19387
19395
|
if (DESCRIPTORS && !_library) {
|
|
@@ -25272,6 +25280,28 @@ var ReactTable = function(_Methods) {
|
|
|
25272
25280
|
_this.resizeColumnStart = _this.resizeColumnStart.bind(_this);
|
|
25273
25281
|
_this.resizeColumnEnd = _this.resizeColumnEnd.bind(_this);
|
|
25274
25282
|
_this.resizeColumnMoving = _this.resizeColumnMoving.bind(_this);
|
|
25283
|
+
setTimeout(function() {
|
|
25284
|
+
try {
|
|
25285
|
+
var newResized = _this.props.defaultResized || [];
|
|
25286
|
+
_this.tableRef.querySelectorAll(".tg-react-table-column-header").forEach(function(th) {
|
|
25287
|
+
var _th$parentNode$parent = th.parentNode.parentNode.getBoundingClientRect(), width = _th$parentNode$parent.width;
|
|
25288
|
+
var id2 = th.getAttribute("data-path");
|
|
25289
|
+
if (!newResized.find(function(x2) {
|
|
25290
|
+
return x2.id === id2;
|
|
25291
|
+
})) {
|
|
25292
|
+
newResized.push({
|
|
25293
|
+
id: id2,
|
|
25294
|
+
value: width
|
|
25295
|
+
});
|
|
25296
|
+
}
|
|
25297
|
+
});
|
|
25298
|
+
_this.setState({
|
|
25299
|
+
resized: newResized
|
|
25300
|
+
});
|
|
25301
|
+
} catch (e2) {
|
|
25302
|
+
console.warn("TNW: Error setting initial table column widths (please contact @tnrich if you see this error. thanks!):", e2);
|
|
25303
|
+
}
|
|
25304
|
+
}, 0);
|
|
25275
25305
|
_this.state = {
|
|
25276
25306
|
page: props.defaultPage,
|
|
25277
25307
|
pageSize: props.defaultPageSize,
|
|
@@ -25806,7 +25836,16 @@ var ReactTable = function(_Methods) {
|
|
|
25806
25836
|
_extends$i({
|
|
25807
25837
|
className: classNames("ReactTable", className, rootProps.className),
|
|
25808
25838
|
style: _extends$i({}, style2, rootProps.style)
|
|
25809
|
-
}, rootProps.rest
|
|
25839
|
+
}, rootProps.rest, {
|
|
25840
|
+
ref: /* @__PURE__ */ __name(function ref(r2) {
|
|
25841
|
+
if (!r2)
|
|
25842
|
+
return;
|
|
25843
|
+
if (rootProps.rest.ref) {
|
|
25844
|
+
rootProps.rest.ref(r2);
|
|
25845
|
+
}
|
|
25846
|
+
_this2.tableRef = r2;
|
|
25847
|
+
}, "ref")
|
|
25848
|
+
}),
|
|
25810
25849
|
showPagination && showPaginationTop ? React__default.createElement(
|
|
25811
25850
|
"div",
|
|
25812
25851
|
{ className: "pagination-top" },
|
|
@@ -39990,6 +40029,13 @@ const popoverOverflowModifiers = {
|
|
|
39990
40029
|
const _TgSelect = class _TgSelect extends React__default.Component {
|
|
39991
40030
|
constructor(props) {
|
|
39992
40031
|
super(props);
|
|
40032
|
+
__publicField(this, "setOpenState", /* @__PURE__ */ __name((isOpen) => {
|
|
40033
|
+
const { handleOpenChange } = this.props;
|
|
40034
|
+
if (handleOpenChange) {
|
|
40035
|
+
handleOpenChange(isOpen);
|
|
40036
|
+
}
|
|
40037
|
+
this.setState({ isOpen });
|
|
40038
|
+
}, "setOpenState"));
|
|
39993
40039
|
__publicField(this, "itemRenderer", /* @__PURE__ */ __name((i, { index: index2, handleClick, modifiers }) => {
|
|
39994
40040
|
const optionRenderer = this.getOptionRenderer();
|
|
39995
40041
|
const onClick = i.onClick || handleClick;
|
|
@@ -40022,7 +40068,7 @@ const _TgSelect = class _TgSelect extends React__default.Component {
|
|
|
40022
40068
|
if (multi) {
|
|
40023
40069
|
let valArray = getValueArray(value);
|
|
40024
40070
|
if (closeOnSelect || item.closeOnSelect) {
|
|
40025
|
-
this.
|
|
40071
|
+
this.setOpenState(false);
|
|
40026
40072
|
this.input && this.input.blur();
|
|
40027
40073
|
}
|
|
40028
40074
|
if (isTagSelect && item.value && item.value.includes && item.value.includes(":")) {
|
|
@@ -40039,7 +40085,7 @@ const _TgSelect = class _TgSelect extends React__default.Component {
|
|
|
40039
40085
|
}
|
|
40040
40086
|
return onChange([...valArray, item]);
|
|
40041
40087
|
} else {
|
|
40042
|
-
this.
|
|
40088
|
+
this.setOpenState(false);
|
|
40043
40089
|
this.input && this.input.blur();
|
|
40044
40090
|
return onChange(item);
|
|
40045
40091
|
}
|
|
@@ -40052,7 +40098,7 @@ const _TgSelect = class _TgSelect extends React__default.Component {
|
|
|
40052
40098
|
);
|
|
40053
40099
|
e2.stopPropagation();
|
|
40054
40100
|
onChange(filteredVals);
|
|
40055
|
-
this.
|
|
40101
|
+
this.setOpenState(false);
|
|
40056
40102
|
this.input.focus();
|
|
40057
40103
|
}, "handleTagRemove"));
|
|
40058
40104
|
__publicField(this, "handleTagInputRemove", /* @__PURE__ */ __name((val, index2) => {
|
|
@@ -40073,7 +40119,7 @@ const _TgSelect = class _TgSelect extends React__default.Component {
|
|
|
40073
40119
|
const { onChange } = this.props;
|
|
40074
40120
|
this.setState({ query: "" });
|
|
40075
40121
|
onChange(newValue);
|
|
40076
|
-
this.
|
|
40122
|
+
this.setOpenState(false);
|
|
40077
40123
|
this.input.focus();
|
|
40078
40124
|
}, "handleClear"));
|
|
40079
40125
|
__publicField(this, "itemListPredicate", /* @__PURE__ */ __name((queryString2, item) => {
|
|
@@ -40096,9 +40142,12 @@ const _TgSelect = class _TgSelect extends React__default.Component {
|
|
|
40096
40142
|
}, "handleActiveItemChange"));
|
|
40097
40143
|
__publicField(this, "onInteraction", /* @__PURE__ */ __name(() => {
|
|
40098
40144
|
if (this.input != null && this.input !== document.activeElement) {
|
|
40099
|
-
this.
|
|
40145
|
+
this.setOpenState(false);
|
|
40146
|
+
this.setState({
|
|
40147
|
+
query: ""
|
|
40148
|
+
});
|
|
40100
40149
|
} else if (!this.props.openOnKeyDown) {
|
|
40101
|
-
this.
|
|
40150
|
+
this.setOpenState(true);
|
|
40102
40151
|
}
|
|
40103
40152
|
}, "onInteraction"));
|
|
40104
40153
|
__publicField(this, "queryHasExactOptionMatch", /* @__PURE__ */ __name(() => {
|
|
@@ -40207,7 +40256,7 @@ const _TgSelect = class _TgSelect extends React__default.Component {
|
|
|
40207
40256
|
onClick: (e2) => {
|
|
40208
40257
|
if (this.state.isOpen) {
|
|
40209
40258
|
e2.stopPropagation();
|
|
40210
|
-
this.
|
|
40259
|
+
this.setOpenState(false);
|
|
40211
40260
|
}
|
|
40212
40261
|
},
|
|
40213
40262
|
disabled,
|
|
@@ -40280,11 +40329,11 @@ const _TgSelect = class _TgSelect extends React__default.Component {
|
|
|
40280
40329
|
if (this.input != null) {
|
|
40281
40330
|
this.input.blur();
|
|
40282
40331
|
}
|
|
40283
|
-
this.
|
|
40332
|
+
this.setOpenState(false);
|
|
40284
40333
|
e2.preventDefault();
|
|
40285
40334
|
e2.stopPropagation();
|
|
40286
40335
|
} else if (!(which === Keys.BACKSPACE || which === Keys.ARROW_LEFT || which === Keys.ARROW_RIGHT)) {
|
|
40287
|
-
this.
|
|
40336
|
+
this.setOpenState(true);
|
|
40288
40337
|
}
|
|
40289
40338
|
},
|
|
40290
40339
|
inputProps: __spreadValues({
|
|
@@ -55318,7 +55367,7 @@ var KNOWN_STATICS = {
|
|
|
55318
55367
|
arity: true
|
|
55319
55368
|
};
|
|
55320
55369
|
var defineProperty5 = Object.defineProperty;
|
|
55321
|
-
var
|
|
55370
|
+
var getOwnPropertyNames3 = Object.getOwnPropertyNames;
|
|
55322
55371
|
var getOwnPropertySymbols3 = Object.getOwnPropertySymbols;
|
|
55323
55372
|
var getOwnPropertyDescriptor3 = Object.getOwnPropertyDescriptor;
|
|
55324
55373
|
var getPrototypeOf = Object.getPrototypeOf;
|
|
@@ -55331,7 +55380,7 @@ function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
|
|
55331
55380
|
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
|
|
55332
55381
|
}
|
|
55333
55382
|
}
|
|
55334
|
-
var keys3 =
|
|
55383
|
+
var keys3 = getOwnPropertyNames3(sourceComponent);
|
|
55335
55384
|
if (getOwnPropertySymbols3) {
|
|
55336
55385
|
keys3 = keys3.concat(getOwnPropertySymbols3(sourceComponent));
|
|
55337
55386
|
}
|
|
@@ -56576,13 +56625,24 @@ const _DataTable = class _DataTable extends React__default.Component {
|
|
|
56576
56625
|
}, 0);
|
|
56577
56626
|
}
|
|
56578
56627
|
}, "updateFromProps"));
|
|
56579
|
-
__publicField(this, "formatAndValidateEntities", /* @__PURE__ */ __name((entities) => {
|
|
56628
|
+
__publicField(this, "formatAndValidateEntities", /* @__PURE__ */ __name((entities, { useDefaultValues, indexToStartAt } = {}) => {
|
|
56580
56629
|
const { schema } = this.props;
|
|
56581
56630
|
const editableFields = schema.fields.filter((f2) => !f2.isNotEditable);
|
|
56582
56631
|
const validationErrors = {};
|
|
56583
56632
|
const newEnts = immer(entities, (entities2) => {
|
|
56584
56633
|
entities2.forEach((e2, index2) => {
|
|
56585
56634
|
editableFields.forEach((columnSchema) => {
|
|
56635
|
+
if (useDefaultValues) {
|
|
56636
|
+
if (e2[columnSchema.path] === void 0) {
|
|
56637
|
+
if (lodashExports.isFunction(columnSchema.defaultValue)) {
|
|
56638
|
+
e2[columnSchema.path] = columnSchema.defaultValue(
|
|
56639
|
+
index2 + indexToStartAt,
|
|
56640
|
+
e2
|
|
56641
|
+
);
|
|
56642
|
+
} else
|
|
56643
|
+
e2[columnSchema.path] = columnSchema.defaultValue;
|
|
56644
|
+
}
|
|
56645
|
+
}
|
|
56586
56646
|
const { error } = editCellHelper({
|
|
56587
56647
|
entity: e2,
|
|
56588
56648
|
columnSchema,
|
|
@@ -56906,8 +56966,9 @@ const _DataTable = class _DataTable extends React__default.Component {
|
|
|
56906
56966
|
}, "handleCut"));
|
|
56907
56967
|
__publicField(this, "getCellCopyText", /* @__PURE__ */ __name((cellWrapper) => {
|
|
56908
56968
|
const text2 = cellWrapper && cellWrapper.getAttribute("data-copy-text");
|
|
56969
|
+
const jsonText = cellWrapper && cellWrapper.getAttribute("data-copy-json");
|
|
56909
56970
|
const toRet = text2 || cellWrapper.textContent || "";
|
|
56910
|
-
return toRet;
|
|
56971
|
+
return [toRet, jsonText];
|
|
56911
56972
|
}, "getCellCopyText"));
|
|
56912
56973
|
__publicField(this, "handleCopyRow", /* @__PURE__ */ __name((rowEl) => {
|
|
56913
56974
|
const text2 = this.getRowCopyText(rowEl);
|
|
@@ -56915,13 +56976,26 @@ const _DataTable = class _DataTable extends React__default.Component {
|
|
|
56915
56976
|
return window.toastr.warning("No text to copy");
|
|
56916
56977
|
this.handleCopyHelper(text2, "Row Copied");
|
|
56917
56978
|
}, "handleCopyRow"));
|
|
56918
|
-
__publicField(this, "handleCopyColumn", /* @__PURE__ */ __name((e2, cellWrapper) => {
|
|
56979
|
+
__publicField(this, "handleCopyColumn", /* @__PURE__ */ __name((e2, cellWrapper, selectedRecords) => {
|
|
56919
56980
|
const cellType = cellWrapper.getAttribute("data-test");
|
|
56920
|
-
|
|
56921
|
-
if (!
|
|
56981
|
+
let rowElsToCopy = getAllRows(e2);
|
|
56982
|
+
if (!rowElsToCopy)
|
|
56983
|
+
return;
|
|
56984
|
+
if (selectedRecords) {
|
|
56985
|
+
const ids = selectedRecords.map((e22) => {
|
|
56986
|
+
var _a2;
|
|
56987
|
+
return (_a2 = getIdOrCodeOrIndex(e22)) == null ? void 0 : _a2.toString();
|
|
56988
|
+
});
|
|
56989
|
+
rowElsToCopy = Array.from(rowElsToCopy).filter((rowEl) => {
|
|
56990
|
+
var _a2;
|
|
56991
|
+
const id2 = (_a2 = rowEl.closest(".rt-tr-group")) == null ? void 0 : _a2.getAttribute("data-test-id");
|
|
56992
|
+
return id2 !== void 0 && ids.includes(id2);
|
|
56993
|
+
});
|
|
56994
|
+
}
|
|
56995
|
+
if (!rowElsToCopy)
|
|
56922
56996
|
return;
|
|
56923
56997
|
const textToCopy = lodashExports.map(
|
|
56924
|
-
|
|
56998
|
+
rowElsToCopy,
|
|
56925
56999
|
(rowEl) => this.getRowCopyText(rowEl, { cellType })
|
|
56926
57000
|
).filter((text2) => text2).join("\n");
|
|
56927
57001
|
if (!textToCopy)
|
|
@@ -56962,9 +57036,10 @@ const _DataTable = class _DataTable extends React__default.Component {
|
|
|
56962
57036
|
return this.getCellCopyText(cellChild);
|
|
56963
57037
|
}).join(" ");
|
|
56964
57038
|
}, "getRowCopyText"));
|
|
56965
|
-
__publicField(this, "handleCopyHelper", /* @__PURE__ */ __name((stringToCopy, message) => {
|
|
57039
|
+
__publicField(this, "handleCopyHelper", /* @__PURE__ */ __name((stringToCopy, objToCopy, message) => {
|
|
56966
57040
|
const copyHandler = /* @__PURE__ */ __name((e2) => {
|
|
56967
57041
|
e2.preventDefault();
|
|
57042
|
+
e2.clipboardData.setData("application/json", JSON.stringify(objToCopy));
|
|
56968
57043
|
e2.clipboardData.setData("text/plain", stringToCopy);
|
|
56969
57044
|
}, "copyHandler");
|
|
56970
57045
|
document.addEventListener("copy", copyHandler);
|
|
@@ -57806,40 +57881,63 @@ const _DataTable = class _DataTable extends React__default.Component {
|
|
|
57806
57881
|
const oldVal = val;
|
|
57807
57882
|
const text2 = this.getCopyTextForCell(val, row, column);
|
|
57808
57883
|
const isBool = column.type === "boolean";
|
|
57884
|
+
const dataTest = {
|
|
57885
|
+
"data-test": "tgCell_" + column.path
|
|
57886
|
+
};
|
|
57809
57887
|
if (isCellEditable && isBool) {
|
|
57810
57888
|
val = /* @__PURE__ */ React__default.createElement(
|
|
57811
57889
|
Checkbox,
|
|
57812
|
-
{
|
|
57890
|
+
__spreadProps(__spreadValues({
|
|
57813
57891
|
disabled: isEntityDisabled(row.original),
|
|
57814
|
-
className: "tg-cell-edit-boolean-checkbox"
|
|
57892
|
+
className: "tg-cell-edit-boolean-checkbox"
|
|
57893
|
+
}, dataTest), {
|
|
57815
57894
|
checked: oldVal === "True",
|
|
57816
57895
|
onChange: (e2) => {
|
|
57817
57896
|
const checked = e2.target.checked;
|
|
57818
57897
|
this.finishCellEdit(cellId, checked);
|
|
57819
57898
|
}
|
|
57820
|
-
}
|
|
57899
|
+
})
|
|
57821
57900
|
);
|
|
57822
57901
|
noEllipsis = true;
|
|
57823
57902
|
} else {
|
|
57824
57903
|
if (reduxFormEditingCell === cellId) {
|
|
57904
|
+
if (column.type === "genericSelect") {
|
|
57905
|
+
const GenericSelectComp = column.GenericSelectComp;
|
|
57906
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
57907
|
+
GenericSelectComp,
|
|
57908
|
+
__spreadProps(__spreadValues({
|
|
57909
|
+
rowId,
|
|
57910
|
+
initialValue: text2
|
|
57911
|
+
}, dataTest), {
|
|
57912
|
+
finishEdit: (newVal, doNotStopEditing) => {
|
|
57913
|
+
this.finishCellEdit(cellId, newVal, doNotStopEditing);
|
|
57914
|
+
},
|
|
57915
|
+
dataTest,
|
|
57916
|
+
cancelEdit: this.cancelCellEdit
|
|
57917
|
+
})
|
|
57918
|
+
);
|
|
57919
|
+
}
|
|
57825
57920
|
if (column.type === "dropdown" || column.type === "dropdownMulti") {
|
|
57826
57921
|
return /* @__PURE__ */ React__default.createElement(
|
|
57827
57922
|
DropdownCell,
|
|
57828
|
-
{
|
|
57923
|
+
__spreadProps(__spreadValues({
|
|
57829
57924
|
isMulti: column.type === "dropdownMulti",
|
|
57830
|
-
initialValue: text2
|
|
57925
|
+
initialValue: text2
|
|
57926
|
+
}, dataTest), {
|
|
57831
57927
|
options: getVals(column.values),
|
|
57832
57928
|
finishEdit: (newVal, doNotStopEditing) => {
|
|
57833
57929
|
this.finishCellEdit(cellId, newVal, doNotStopEditing);
|
|
57834
57930
|
},
|
|
57931
|
+
dataTest,
|
|
57835
57932
|
cancelEdit: this.cancelCellEdit
|
|
57836
|
-
}
|
|
57933
|
+
})
|
|
57837
57934
|
);
|
|
57838
57935
|
} else {
|
|
57839
57936
|
return /* @__PURE__ */ React__default.createElement(
|
|
57840
57937
|
EditableCell,
|
|
57841
57938
|
{
|
|
57842
57939
|
stopSelectAll: () => change2("reduxFormEditingCellSelectAll", false),
|
|
57940
|
+
dataTest,
|
|
57843
57941
|
shouldSelectAll: reduxFormEditingCellSelectAll,
|
|
57844
57942
|
cancelEdit: this.cancelCellEdit,
|
|
57845
57943
|
isNumeric: column.type === "number",
|
|
@@ -57868,18 +57966,18 @@ const _DataTable = class _DataTable extends React__default.Component {
|
|
|
57868
57966
|
} = this.isSelectionARectangle();
|
|
57869
57967
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
|
|
57870
57968
|
"div",
|
|
57871
|
-
{
|
|
57969
|
+
__spreadProps(__spreadValues({
|
|
57872
57970
|
style: __spreadValues({}, !noEllipsis && {
|
|
57873
57971
|
textOverflow: "ellipsis",
|
|
57874
57972
|
overflow: "hidden"
|
|
57875
|
-
})
|
|
57876
|
-
|
|
57973
|
+
})
|
|
57974
|
+
}, dataTest), {
|
|
57877
57975
|
className: "tg-cell-wrapper",
|
|
57878
57976
|
"data-copy-text": text2,
|
|
57879
57977
|
title: title || void 0
|
|
57880
|
-
},
|
|
57978
|
+
}),
|
|
57881
57979
|
val
|
|
57882
|
-
), isCellEditable && (column.type === "dropdown" || column.type === "dropdownMulti") && /* @__PURE__ */ React__default.createElement(
|
|
57980
|
+
), isCellEditable && (column.type === "dropdown" || column.type === "dropdownMulti" || column.type === "genericSelect") && /* @__PURE__ */ React__default.createElement(
|
|
57883
57981
|
Icon,
|
|
57884
57982
|
{
|
|
57885
57983
|
icon: "caret-down",
|
|
@@ -58022,7 +58120,7 @@ const _DataTable = class _DataTable extends React__default.Component {
|
|
|
58022
58120
|
const cellNumStr2 = getNumberStrAtEnd(cellVal);
|
|
58023
58121
|
const cellNum2 = Number(cellNumStr2);
|
|
58024
58122
|
const cellTextNoNum = stripNumberAtEnd(cellVal);
|
|
58025
|
-
if (cellNumStr2.startsWith("0")) {
|
|
58123
|
+
if (cellNumStr2 == null ? void 0 : cellNumStr2.startsWith("0")) {
|
|
58026
58124
|
maybePad = cellNumStr2.length;
|
|
58027
58125
|
}
|
|
58028
58126
|
if (cellTextNoNum && !prefix) {
|
|
@@ -58169,16 +58267,19 @@ const _DataTable = class _DataTable extends React__default.Component {
|
|
|
58169
58267
|
return getIdOrCodeOrIndex(e2, i) === rowId;
|
|
58170
58268
|
});
|
|
58171
58269
|
const insertIndex = above ? indexToInsert : indexToInsert + 1;
|
|
58172
|
-
|
|
58270
|
+
const insertIndexToUse = appendToBottom ? entities2.length : insertIndex;
|
|
58271
|
+
let { newEnts, validationErrors } = this.formatAndValidateEntities(
|
|
58272
|
+
newEntities,
|
|
58273
|
+
{
|
|
58274
|
+
useDefaultValues: true,
|
|
58275
|
+
indexToStartAt: insertIndexToUse
|
|
58276
|
+
}
|
|
58277
|
+
);
|
|
58173
58278
|
newEnts = newEnts.map((e2) => __spreadProps(__spreadValues({}, e2), {
|
|
58174
58279
|
_isClean: true
|
|
58175
58280
|
}));
|
|
58176
58281
|
this.updateValidation(entities2, __spreadValues(__spreadValues({}, reduxFormCellValidation), validationErrors));
|
|
58177
|
-
entities2.splice(
|
|
58178
|
-
appendToBottom ? entities2.length : insertIndex,
|
|
58179
|
-
0,
|
|
58180
|
-
...newEnts
|
|
58181
|
-
);
|
|
58282
|
+
entities2.splice(insertIndexToUse, 0, ...newEnts);
|
|
58182
58283
|
});
|
|
58183
58284
|
this.refocusTable();
|
|
58184
58285
|
}, "insertRows"));
|
|
@@ -58219,8 +58320,8 @@ const _DataTable = class _DataTable extends React__default.Component {
|
|
|
58219
58320
|
{
|
|
58220
58321
|
key: "copyCell",
|
|
58221
58322
|
onClick: () => {
|
|
58222
|
-
const text2 = this.getCellCopyText(cellWrapper);
|
|
58223
|
-
this.handleCopyHelper(text2, "Cell copied");
|
|
58323
|
+
const [text2, jsonText] = this.getCellCopyText(cellWrapper);
|
|
58324
|
+
this.handleCopyHelper(text2, jsonText, "Cell copied");
|
|
58224
58325
|
},
|
|
58225
58326
|
text: "Cell"
|
|
58226
58327
|
}
|
|
@@ -58238,6 +58339,20 @@ const _DataTable = class _DataTable extends React__default.Component {
|
|
|
58238
58339
|
}
|
|
58239
58340
|
)
|
|
58240
58341
|
);
|
|
58342
|
+
if (selectedRecords.length > 1) {
|
|
58343
|
+
copyMenuItems.push(
|
|
58344
|
+
/* @__PURE__ */ React__default.createElement(
|
|
58345
|
+
MenuItem,
|
|
58346
|
+
{
|
|
58347
|
+
key: "copyColumnSelected",
|
|
58348
|
+
onClick: () => {
|
|
58349
|
+
this.handleCopyColumn(e2, cellWrapper, selectedRecords);
|
|
58350
|
+
},
|
|
58351
|
+
text: "Column (Selected)"
|
|
58352
|
+
}
|
|
58353
|
+
)
|
|
58354
|
+
);
|
|
58355
|
+
}
|
|
58241
58356
|
}
|
|
58242
58357
|
if (selectedRecords.length === 0 || selectedRecords.length === 1) {
|
|
58243
58358
|
const cell = e2.target.querySelector(".tg-cell-wrapper") || e2.target.closest(".tg-cell-wrapper") || e2.target.closest(".rt-td");
|
|
@@ -59356,12 +59471,13 @@ function EditableCell({
|
|
|
59356
59471
|
initialValue,
|
|
59357
59472
|
finishEdit,
|
|
59358
59473
|
cancelEdit,
|
|
59359
|
-
isNumeric
|
|
59474
|
+
isNumeric,
|
|
59475
|
+
dataTest
|
|
59360
59476
|
}) {
|
|
59361
59477
|
const [v2, setV] = useState(initialValue);
|
|
59362
59478
|
return /* @__PURE__ */ React__default.createElement(
|
|
59363
59479
|
"input",
|
|
59364
|
-
{
|
|
59480
|
+
__spreadProps(__spreadValues({
|
|
59365
59481
|
style: {
|
|
59366
59482
|
border: 0,
|
|
59367
59483
|
width: "95%",
|
|
@@ -59373,7 +59489,8 @@ function EditableCell({
|
|
|
59373
59489
|
r2 == null ? void 0 : r2.select();
|
|
59374
59490
|
stopSelectAll();
|
|
59375
59491
|
}
|
|
59376
|
-
}
|
|
59492
|
+
}
|
|
59493
|
+
}, dataTest), {
|
|
59377
59494
|
type: isNumeric ? "number" : void 0,
|
|
59378
59495
|
value: v2,
|
|
59379
59496
|
autoFocus: true,
|
|
@@ -59392,7 +59509,7 @@ function EditableCell({
|
|
|
59392
59509
|
onChange: (e2) => {
|
|
59393
59510
|
setV(e2.target.value);
|
|
59394
59511
|
}
|
|
59395
|
-
}
|
|
59512
|
+
})
|
|
59396
59513
|
);
|
|
59397
59514
|
}
|
|
59398
59515
|
__name(EditableCell, "EditableCell");
|
|
@@ -59401,7 +59518,8 @@ function DropdownCell({
|
|
|
59401
59518
|
isMulti,
|
|
59402
59519
|
initialValue,
|
|
59403
59520
|
finishEdit,
|
|
59404
|
-
cancelEdit
|
|
59521
|
+
cancelEdit,
|
|
59522
|
+
dataTest
|
|
59405
59523
|
}) {
|
|
59406
59524
|
const [v2, setV] = useState(
|
|
59407
59525
|
isMulti ? initialValue.split(",").map((v22) => ({ value: v22, label: v22 })) : initialValue
|
|
@@ -59415,7 +59533,7 @@ function DropdownCell({
|
|
|
59415
59533
|
},
|
|
59416
59534
|
/* @__PURE__ */ React__default.createElement(
|
|
59417
59535
|
TgSelect$1,
|
|
59418
|
-
{
|
|
59536
|
+
__spreadProps(__spreadValues({
|
|
59419
59537
|
small: true,
|
|
59420
59538
|
multi: isMulti,
|
|
59421
59539
|
autoOpen: true,
|
|
@@ -59426,7 +59544,8 @@ function DropdownCell({
|
|
|
59426
59544
|
return;
|
|
59427
59545
|
}
|
|
59428
59546
|
finishEdit(val ? val.value : null);
|
|
59429
|
-
}
|
|
59547
|
+
}
|
|
59548
|
+
}, dataTest), {
|
|
59430
59549
|
popoverProps: {
|
|
59431
59550
|
onClose: (e2) => {
|
|
59432
59551
|
if (isMulti) {
|
|
@@ -59443,7 +59562,7 @@ function DropdownCell({
|
|
|
59443
59562
|
}
|
|
59444
59563
|
},
|
|
59445
59564
|
options: options.map((value) => ({ label: value, value }))
|
|
59446
|
-
}
|
|
59565
|
+
})
|
|
59447
59566
|
)
|
|
59448
59567
|
);
|
|
59449
59568
|
}
|
|
@@ -59487,7 +59606,8 @@ function getNumberStrAtEnd(str) {
|
|
|
59487
59606
|
}
|
|
59488
59607
|
__name(getNumberStrAtEnd, "getNumberStrAtEnd");
|
|
59489
59608
|
function stripNumberAtEnd(str) {
|
|
59490
|
-
|
|
59609
|
+
var _a2;
|
|
59610
|
+
return (_a2 = str == null ? void 0 : str.replace) == null ? void 0 : _a2.call(str, getNumberStrAtEnd(str), "");
|
|
59491
59611
|
}
|
|
59492
59612
|
__name(stripNumberAtEnd, "stripNumberAtEnd");
|
|
59493
59613
|
function isEntityClean(e2) {
|
|
@@ -61877,7 +61997,7 @@ const PreviewCsvData = observer(function(props) {
|
|
|
61877
61997
|
} = props;
|
|
61878
61998
|
const rerenderKey = useRef(0);
|
|
61879
61999
|
rerenderKey.current = rerenderKey.current + 1;
|
|
61880
|
-
const data = userSchema.userData && userSchema.userData.length && userSchema.userData.map((row) => {
|
|
62000
|
+
const data = userSchema.userData && userSchema.userData.length && userSchema.userData.map((row, i) => {
|
|
61881
62001
|
const toRet = {
|
|
61882
62002
|
_isClean: row._isClean
|
|
61883
62003
|
};
|
|
@@ -61890,7 +62010,10 @@ const PreviewCsvData = observer(function(props) {
|
|
|
61890
62010
|
}
|
|
61891
62011
|
if (toRet[path2] === void 0 || toRet[path2] === "") {
|
|
61892
62012
|
if (defaultValue) {
|
|
61893
|
-
|
|
62013
|
+
if (lodashExports.isFunction(defaultValue)) {
|
|
62014
|
+
toRet[path2] = defaultValue(i, row);
|
|
62015
|
+
} else
|
|
62016
|
+
toRet[path2] = defaultValue;
|
|
61894
62017
|
} else {
|
|
61895
62018
|
toRet[path2] = "";
|
|
61896
62019
|
}
|
|
@@ -71650,6 +71773,7 @@ function UploaderInner({
|
|
|
71650
71773
|
overflowList,
|
|
71651
71774
|
autoUnzip,
|
|
71652
71775
|
disabled,
|
|
71776
|
+
noBuildCsvOption,
|
|
71653
71777
|
initializeForm,
|
|
71654
71778
|
showFilesCount,
|
|
71655
71779
|
threeDotMenuItems,
|
|
@@ -71828,12 +71952,14 @@ function UploaderInner({
|
|
|
71828
71952
|
subtext: "Includes Upload Instructions and Column Info",
|
|
71829
71953
|
exampleFile: handleDownloadXlsxFile
|
|
71830
71954
|
},
|
|
71831
|
-
|
|
71832
|
-
|
|
71833
|
-
|
|
71834
|
-
|
|
71835
|
-
|
|
71836
|
-
|
|
71955
|
+
...noBuildCsvOption ? [] : [
|
|
71956
|
+
{
|
|
71957
|
+
description: manualEnterMessage,
|
|
71958
|
+
subtext: manualEnterSubMessage,
|
|
71959
|
+
icon: "manually-entered-data",
|
|
71960
|
+
exampleFile: handleManuallyEnterData
|
|
71961
|
+
}
|
|
71962
|
+
]
|
|
71837
71963
|
];
|
|
71838
71964
|
delete a2.exampleFile;
|
|
71839
71965
|
}
|
|
@@ -72282,7 +72408,7 @@ function UploaderInner({
|
|
|
72282
72408
|
},
|
|
72283
72409
|
innerIcon || /* @__PURE__ */ React__default.createElement(Icon, { icon: "upload", iconSize: minimal ? 15 : 30 }),
|
|
72284
72410
|
innerText || (minimal ? "Upload" : "Click or drag to upload"),
|
|
72285
|
-
validateAgainstSchema && /* @__PURE__ */ React__default.createElement(
|
|
72411
|
+
validateAgainstSchema && !noBuildCsvOption && /* @__PURE__ */ React__default.createElement(
|
|
72286
72412
|
"div",
|
|
72287
72413
|
{
|
|
72288
72414
|
style: {
|
|
@@ -78681,6 +78807,7 @@ export {
|
|
|
78681
78807
|
combineReducers as combineReducersWithFullState,
|
|
78682
78808
|
comboToLabel,
|
|
78683
78809
|
commandMenuEnhancer,
|
|
78810
|
+
convertSchema,
|
|
78684
78811
|
createCommandBarMenu,
|
|
78685
78812
|
createCommandMenu,
|
|
78686
78813
|
createDynamicBarMenu,
|
|
@@ -78722,6 +78849,7 @@ export {
|
|
|
78722
78849
|
popoverOverflowModifiers,
|
|
78723
78850
|
proteinIcon,
|
|
78724
78851
|
pure as pureNoFunc,
|
|
78852
|
+
removeCleanRows,
|
|
78725
78853
|
removeDuplicatesIcon,
|
|
78726
78854
|
renderBlueprintCheckbox,
|
|
78727
78855
|
renderBlueprintDateInput,
|
|
@@ -78747,6 +78875,7 @@ export {
|
|
|
78747
78875
|
showDialogOnDocBody,
|
|
78748
78876
|
showProgressToast,
|
|
78749
78877
|
strainIcon,
|
|
78878
|
+
tgFormValueSelector,
|
|
78750
78879
|
tgFormValues,
|
|
78751
78880
|
tg_modalState,
|
|
78752
78881
|
tickMenuEnhancer,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teselagen/ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.38",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"@blueprintjs/datetime": "3.23.19",
|
|
17
17
|
"@blueprintjs/icons": "3.33.0",
|
|
18
18
|
"@blueprintjs/select": "3.18.11",
|
|
19
|
+
"@teselagen/react-table": "6.10.13",
|
|
19
20
|
"axios": "^0.21.1",
|
|
20
21
|
"bluebird": "3.7.2",
|
|
21
22
|
"buffer": "5.7.1",
|