@teselagen/ui 0.3.22 → 0.3.23

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 CHANGED
@@ -30501,12 +30501,20 @@ var _cof = function (it) {
30501
30501
  return toString$6.call(it).slice(8, -1);
30502
30502
  };
30503
30503
 
30504
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
30505
- var cof$2 = _cof;
30506
- // eslint-disable-next-line no-prototype-builtins
30507
- var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
30508
- return cof$2(it) == 'String' ? it.split('') : Object(it);
30509
- };
30504
+ var _iobject;
30505
+ var hasRequired_iobject;
30506
+
30507
+ function require_iobject () {
30508
+ if (hasRequired_iobject) return _iobject;
30509
+ hasRequired_iobject = 1;
30510
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
30511
+ var cof = _cof;
30512
+ // eslint-disable-next-line no-prototype-builtins
30513
+ _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
30514
+ return cof(it) == 'String' ? it.split('') : Object(it);
30515
+ };
30516
+ return _iobject;
30517
+ }
30510
30518
 
30511
30519
  // 7.2.1 RequireObjectCoercible(argument)
30512
30520
  var _defined = function (it) {
@@ -30515,7 +30523,7 @@ var _defined = function (it) {
30515
30523
  };
30516
30524
 
30517
30525
  // to indexed object, toObject with fallback for non-array-like ES3 strings
30518
- var IObject = _iobject;
30526
+ var IObject = require_iobject();
30519
30527
  var defined$2 = _defined;
30520
30528
  var _toIobject = function (it) {
30521
30529
  return IObject(defined$2(it));
@@ -30662,7 +30670,7 @@ function require_objectAssign () {
30662
30670
  var gOPS = _objectGops;
30663
30671
  var pIE = require_objectPie();
30664
30672
  var toObject = _toObject;
30665
- var IObject = _iobject;
30673
+ var IObject = require_iobject();
30666
30674
  var $assign = Object.assign;
30667
30675
 
30668
30676
  // should work with symbols and should have deterministic property order (V8 bug)
@@ -87562,7 +87570,7 @@ class DataTable extends React$1.Component {
87562
87570
  tabIndex: -1,
87563
87571
  onKeyDown: (e) => {
87564
87572
  const isArrowKey = e.keyCode >= 37 && e.keyCode <= 40 || e.keyCode === 9;
87565
- if (isArrowKey) {
87573
+ if (isArrowKey && e.target?.tagName !== "INPUT") {
87566
87574
  const { schema: schema2, entities: entities2 } = computePresets(this.props);
87567
87575
  const left = e.keyCode === 37;
87568
87576
  const up = e.keyCode === 38;
@@ -91745,6 +91753,7 @@ async function tryToMatchSchemas({
91745
91753
  incomingData,
91746
91754
  validateAgainstSchema
91747
91755
  }) {
91756
+ await resolveValidateAgainstSchema();
91748
91757
  const userSchema = getSchema(incomingData);
91749
91758
  const { searchResults, csvValidationIssue } = await matchSchemas({
91750
91759
  userSchema,
@@ -91894,6 +91903,8 @@ const addSpecialPropToAsyncErrs = (res) => {
91894
91903
  });
91895
91904
  return res;
91896
91905
  };
91906
+ async function resolveValidateAgainstSchema() {
91907
+ }
91897
91908
 
91898
91909
  const getInitialSteps = (csvValidationIssue) => [
91899
91910
  { text: "Review Headers", active: csvValidationIssue },
@@ -92352,7 +92363,7 @@ const PreviewCsvData = observer(function(props) {
92352
92363
  const SimpleInsertDataDialog = compose(
92353
92364
  wrapDialog({
92354
92365
  canEscapeKeyClose: false,
92355
- title: "Insert Data",
92366
+ title: "Build CSV File",
92356
92367
  style: { width: "fit-content" }
92357
92368
  }),
92358
92369
  reduxForm.reduxForm({ form: "SimpleInsertDataDialog" }),
@@ -100054,7 +100065,6 @@ function UploaderInner({
100054
100065
  onFieldSubmit(responses);
100055
100066
  }
100056
100067
  } else {
100057
- console.log(`cleanedFileList:`, cleanedFileList);
100058
100068
  onChange(
100059
100069
  cleanedFileList.map(function(file) {
100060
100070
  return {
@@ -100445,31 +100455,22 @@ function UploaderInner({
100445
100455
  className: "tg-upload-inner"
100446
100456
  },
100447
100457
  innerIcon || /* @__PURE__ */ React$1.createElement(core$5.Icon, { icon: "upload", iconSize: minimal ? 15 : 30 }),
100448
- innerText || (minimal ? "Upload" : "Click or drag to upload")
100449
- )
100450
- ), validateAgainstSchema && /* @__PURE__ */ React$1.createElement(
100451
- "div",
100452
- {
100453
- style: {
100454
- textAlign: "center",
100455
- fontSize: 18,
100456
- marginTop: 7,
100457
- marginBottom: 5
100458
- },
100459
- onClick: handleManuallyEnterData,
100460
- className: "link-button"
100461
- },
100462
- manualEnterMessage,
100463
- /* @__PURE__ */ React$1.createElement(
100464
- "div",
100465
- {
100466
- style: {
100467
- fontSize: 11,
100468
- color: core$5.Colors.GRAY3,
100469
- fontStyle: "italic"
100470
- }
100471
- },
100472
- manualEnterSubMessage
100458
+ innerText || (minimal ? "Upload" : "Click or drag to upload"),
100459
+ validateAgainstSchema && /* @__PURE__ */ React$1.createElement(
100460
+ "div",
100461
+ {
100462
+ style: {
100463
+ textAlign: "center",
100464
+ // fontSize: 18,
100465
+ marginTop: 7,
100466
+ marginBottom: 5
100467
+ },
100468
+ onClick: handleManuallyEnterData,
100469
+ className: "link-button"
100470
+ },
100471
+ "...or ",
100472
+ manualEnterMessage
100473
+ )
100473
100474
  )
100474
100475
  ), showFilesCount ? /* @__PURE__ */ React$1.createElement("div", { className: "tg-upload-file-list-counter" }, "Files: ", fileList ? fileList.length : 0) : null)
100475
100476
  ),
package/index.es.js CHANGED
@@ -30480,12 +30480,20 @@ var _cof = function (it) {
30480
30480
  return toString$6.call(it).slice(8, -1);
30481
30481
  };
30482
30482
 
30483
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
30484
- var cof$2 = _cof;
30485
- // eslint-disable-next-line no-prototype-builtins
30486
- var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
30487
- return cof$2(it) == 'String' ? it.split('') : Object(it);
30488
- };
30483
+ var _iobject;
30484
+ var hasRequired_iobject;
30485
+
30486
+ function require_iobject () {
30487
+ if (hasRequired_iobject) return _iobject;
30488
+ hasRequired_iobject = 1;
30489
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
30490
+ var cof = _cof;
30491
+ // eslint-disable-next-line no-prototype-builtins
30492
+ _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
30493
+ return cof(it) == 'String' ? it.split('') : Object(it);
30494
+ };
30495
+ return _iobject;
30496
+ }
30489
30497
 
30490
30498
  // 7.2.1 RequireObjectCoercible(argument)
30491
30499
  var _defined = function (it) {
@@ -30494,7 +30502,7 @@ var _defined = function (it) {
30494
30502
  };
30495
30503
 
30496
30504
  // to indexed object, toObject with fallback for non-array-like ES3 strings
30497
- var IObject = _iobject;
30505
+ var IObject = require_iobject();
30498
30506
  var defined$2 = _defined;
30499
30507
  var _toIobject = function (it) {
30500
30508
  return IObject(defined$2(it));
@@ -30641,7 +30649,7 @@ function require_objectAssign () {
30641
30649
  var gOPS = _objectGops;
30642
30650
  var pIE = require_objectPie();
30643
30651
  var toObject = _toObject;
30644
- var IObject = _iobject;
30652
+ var IObject = require_iobject();
30645
30653
  var $assign = Object.assign;
30646
30654
 
30647
30655
  // should work with symbols and should have deterministic property order (V8 bug)
@@ -87541,7 +87549,7 @@ class DataTable extends React__default.Component {
87541
87549
  tabIndex: -1,
87542
87550
  onKeyDown: (e) => {
87543
87551
  const isArrowKey = e.keyCode >= 37 && e.keyCode <= 40 || e.keyCode === 9;
87544
- if (isArrowKey) {
87552
+ if (isArrowKey && e.target?.tagName !== "INPUT") {
87545
87553
  const { schema: schema2, entities: entities2 } = computePresets(this.props);
87546
87554
  const left = e.keyCode === 37;
87547
87555
  const up = e.keyCode === 38;
@@ -91724,6 +91732,7 @@ async function tryToMatchSchemas({
91724
91732
  incomingData,
91725
91733
  validateAgainstSchema
91726
91734
  }) {
91735
+ await resolveValidateAgainstSchema();
91727
91736
  const userSchema = getSchema(incomingData);
91728
91737
  const { searchResults, csvValidationIssue } = await matchSchemas({
91729
91738
  userSchema,
@@ -91873,6 +91882,8 @@ const addSpecialPropToAsyncErrs = (res) => {
91873
91882
  });
91874
91883
  return res;
91875
91884
  };
91885
+ async function resolveValidateAgainstSchema() {
91886
+ }
91876
91887
 
91877
91888
  const getInitialSteps = (csvValidationIssue) => [
91878
91889
  { text: "Review Headers", active: csvValidationIssue },
@@ -92331,7 +92342,7 @@ const PreviewCsvData = observer(function(props) {
92331
92342
  const SimpleInsertDataDialog = compose(
92332
92343
  wrapDialog({
92333
92344
  canEscapeKeyClose: false,
92334
- title: "Insert Data",
92345
+ title: "Build CSV File",
92335
92346
  style: { width: "fit-content" }
92336
92347
  }),
92337
92348
  reduxForm({ form: "SimpleInsertDataDialog" }),
@@ -100033,7 +100044,6 @@ function UploaderInner({
100033
100044
  onFieldSubmit(responses);
100034
100045
  }
100035
100046
  } else {
100036
- console.log(`cleanedFileList:`, cleanedFileList);
100037
100047
  onChange(
100038
100048
  cleanedFileList.map(function(file) {
100039
100049
  return {
@@ -100424,31 +100434,22 @@ function UploaderInner({
100424
100434
  className: "tg-upload-inner"
100425
100435
  },
100426
100436
  innerIcon || /* @__PURE__ */ React__default.createElement(Icon, { icon: "upload", iconSize: minimal ? 15 : 30 }),
100427
- innerText || (minimal ? "Upload" : "Click or drag to upload")
100428
- )
100429
- ), validateAgainstSchema && /* @__PURE__ */ React__default.createElement(
100430
- "div",
100431
- {
100432
- style: {
100433
- textAlign: "center",
100434
- fontSize: 18,
100435
- marginTop: 7,
100436
- marginBottom: 5
100437
- },
100438
- onClick: handleManuallyEnterData,
100439
- className: "link-button"
100440
- },
100441
- manualEnterMessage,
100442
- /* @__PURE__ */ React__default.createElement(
100443
- "div",
100444
- {
100445
- style: {
100446
- fontSize: 11,
100447
- color: Colors.GRAY3,
100448
- fontStyle: "italic"
100449
- }
100450
- },
100451
- manualEnterSubMessage
100437
+ innerText || (minimal ? "Upload" : "Click or drag to upload"),
100438
+ validateAgainstSchema && /* @__PURE__ */ React__default.createElement(
100439
+ "div",
100440
+ {
100441
+ style: {
100442
+ textAlign: "center",
100443
+ // fontSize: 18,
100444
+ marginTop: 7,
100445
+ marginBottom: 5
100446
+ },
100447
+ onClick: handleManuallyEnterData,
100448
+ className: "link-button"
100449
+ },
100450
+ "...or ",
100451
+ manualEnterMessage
100452
+ )
100452
100453
  )
100453
100454
  ), showFilesCount ? /* @__PURE__ */ React__default.createElement("div", { className: "tg-upload-file-list-counter" }, "Files: ", fileList ? fileList.length : 0) : null)
100454
100455
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teselagen/ui",
3
- "version": "0.3.22",
3
+ "version": "0.3.23",
4
4
  "main": "./src/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -1384,7 +1384,7 @@ class DataTable extends React.Component {
1384
1384
  onKeyDown: e => {
1385
1385
  const isArrowKey =
1386
1386
  (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode === 9;
1387
- if (isArrowKey) {
1387
+ if (isArrowKey && e.target?.tagName !== "INPUT") {
1388
1388
  const { schema, entities } = computePresets(this.props);
1389
1389
  const left = e.keyCode === 37;
1390
1390
  const up = e.keyCode === 38;
@@ -450,7 +450,6 @@ function UploaderInner({
450
450
  onFieldSubmit(responses);
451
451
  }
452
452
  } else {
453
- console.log(`cleanedFileList:`, cleanedFileList);
454
453
  onChange(
455
454
  cleanedFileList.map(function (file) {
456
455
  return {
@@ -946,32 +945,33 @@ function UploaderInner({
946
945
  )}
947
946
  {innerText ||
948
947
  (minimal ? "Upload" : "Click or drag to upload")}
948
+ {validateAgainstSchema && (
949
+ <div
950
+ style={{
951
+ textAlign: "center",
952
+ // fontSize: 18,
953
+ marginTop: 7,
954
+ marginBottom: 5
955
+ }}
956
+ onClick={handleManuallyEnterData}
957
+ className="link-button"
958
+ >
959
+ ...or {manualEnterMessage}
960
+ {/* <div
961
+ style={{
962
+ fontSize: 11,
963
+ color: Colors.GRAY3,
964
+ fontStyle: "italic"
965
+ }}
966
+ >
967
+ {manualEnterSubMessage}
968
+ </div> */}
969
+ </div>
970
+ )}
949
971
  </div>
950
972
  )}
951
973
  </div>
952
- {validateAgainstSchema && (
953
- <div
954
- style={{
955
- textAlign: "center",
956
- fontSize: 18,
957
- marginTop: 7,
958
- marginBottom: 5
959
- }}
960
- onClick={handleManuallyEnterData}
961
- className="link-button"
962
- >
963
- {manualEnterMessage}
964
- <div
965
- style={{
966
- fontSize: 11,
967
- color: Colors.GRAY3,
968
- fontStyle: "italic"
969
- }}
970
- >
971
- {manualEnterSubMessage}
972
- </div>
973
- </div>
974
- )}
974
+
975
975
  {showFilesCount ? (
976
976
  <div className="tg-upload-file-list-counter">
977
977
  Files: {fileList ? fileList.length : 0}
@@ -25,6 +25,7 @@ export default async function tryToMatchSchemas({
25
25
  incomingData,
26
26
  validateAgainstSchema
27
27
  }) {
28
+ await resolveValidateAgainstSchema(validateAgainstSchema);
28
29
  const userSchema = getSchema(incomingData);
29
30
 
30
31
  const { searchResults, csvValidationIssue } = await matchSchemas({
@@ -219,3 +220,15 @@ export const addSpecialPropToAsyncErrs = res => {
219
220
  });
220
221
  return res;
221
222
  };
223
+
224
+ async function resolveValidateAgainstSchema() {
225
+ //tnw: wip!
226
+ // mapSeries(validateAgainstSchema.fields, async f => {
227
+ // if (f.type === "dropdown") {
228
+ // console.log(`type:`, f.type)
229
+ // if (f.getValues) {
230
+ // f.values = await f.getValues(props);
231
+ // }
232
+ // }
233
+ // })
234
+ }
@@ -595,7 +595,7 @@ export const PreviewCsvData = observer(function (props) {
595
595
  export const SimpleInsertDataDialog = compose(
596
596
  wrapDialog({
597
597
  canEscapeKeyClose: false,
598
- title: "Insert Data",
598
+ title: "Build CSV File",
599
599
  style: { width: "fit-content" }
600
600
  }),
601
601
  reduxForm({ form: "SimpleInsertDataDialog" }),