@teselagen/ui 0.3.26 → 0.3.27

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
@@ -58679,12 +58679,13 @@ const _DataTable = class _DataTable extends React$1.Component {
58679
58679
  tabIndex: -1,
58680
58680
  onKeyDown: (e2) => {
58681
58681
  var _a2, _b, _c, _d, _e, _f;
58682
- const isArrowKey = e2.keyCode >= 37 && e2.keyCode <= 40 || e2.keyCode === 9;
58683
- if (isArrowKey && ((_a2 = e2.target) == null ? void 0 : _a2.tagName) !== "INPUT") {
58682
+ const isTabKey = e2.keyCode === 9;
58683
+ const isArrowKey = e2.keyCode >= 37 && e2.keyCode <= 40;
58684
+ if (isArrowKey && ((_a2 = e2.target) == null ? void 0 : _a2.tagName) !== "INPUT" || isTabKey) {
58684
58685
  const { schema: schema2, entities: entities2 } = computePresets(this.props);
58685
58686
  const left2 = e2.keyCode === 37;
58686
58687
  const up = e2.keyCode === 38;
58687
- const down = e2.keyCode === 40;
58688
+ const down = e2.keyCode === 40 || e2.keyCode === 13;
58688
58689
  let cellIdToUse = this.getPrimarySelectedCellId();
58689
58690
  const pathToIndex = getFieldPathToIndex(schema2);
58690
58691
  const entityMap = getEntityIdToEntity(entities2);
package/index.es.js CHANGED
@@ -58661,12 +58661,13 @@ const _DataTable = class _DataTable extends React__default.Component {
58661
58661
  tabIndex: -1,
58662
58662
  onKeyDown: (e2) => {
58663
58663
  var _a2, _b, _c, _d, _e, _f;
58664
- const isArrowKey = e2.keyCode >= 37 && e2.keyCode <= 40 || e2.keyCode === 9;
58665
- if (isArrowKey && ((_a2 = e2.target) == null ? void 0 : _a2.tagName) !== "INPUT") {
58664
+ const isTabKey = e2.keyCode === 9;
58665
+ const isArrowKey = e2.keyCode >= 37 && e2.keyCode <= 40;
58666
+ if (isArrowKey && ((_a2 = e2.target) == null ? void 0 : _a2.tagName) !== "INPUT" || isTabKey) {
58666
58667
  const { schema: schema2, entities: entities2 } = computePresets(this.props);
58667
58668
  const left2 = e2.keyCode === 37;
58668
58669
  const up = e2.keyCode === 38;
58669
- const down = e2.keyCode === 40;
58670
+ const down = e2.keyCode === 40 || e2.keyCode === 13;
58670
58671
  let cellIdToUse = this.getPrimarySelectedCellId();
58671
58672
  const pathToIndex = getFieldPathToIndex(schema2);
58672
58673
  const entityMap = getEntityIdToEntity(entities2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teselagen/ui",
3
- "version": "0.3.26",
3
+ "version": "0.3.27",
4
4
  "main": "./src/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -1382,13 +1382,24 @@ class DataTable extends React.Component {
1382
1382
  {...(isCellEditable && {
1383
1383
  tabIndex: -1,
1384
1384
  onKeyDown: e => {
1385
- const isArrowKey =
1386
- (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode === 9;
1387
- if (isArrowKey && e.target?.tagName !== "INPUT") {
1385
+ // const isArrowKey =
1386
+ // (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode === 9;
1387
+ // if (isArrowKey && e.target?.tagName !== "INPUT") {
1388
+ const isTabKey = e.keyCode === 9;
1389
+ // const isEnter = e.keyCode === 13;
1390
+ // console.log(`onKeydown datatable inner`);
1391
+ // console.log(`isEnter:`, isEnter)
1392
+ const isArrowKey = e.keyCode >= 37 && e.keyCode <= 40;
1393
+ // console.log(`e.target?.tagName:`,e.target?.tagName)
1394
+ if (
1395
+ (isArrowKey && e.target?.tagName !== "INPUT") ||
1396
+ isTabKey
1397
+ // || (isEnter && e.target?.tagName === "INPUT")
1398
+ ) {
1388
1399
  const { schema, entities } = computePresets(this.props);
1389
1400
  const left = e.keyCode === 37;
1390
1401
  const up = e.keyCode === 38;
1391
- const down = e.keyCode === 40;
1402
+ const down = e.keyCode === 40 || e.keyCode === 13;
1392
1403
  let cellIdToUse = this.getPrimarySelectedCellId();
1393
1404
  const pathToIndex = getFieldPathToIndex(schema);
1394
1405
  const entityMap = getEntityIdToEntity(entities);