@teselagen/ui 0.3.61 → 0.3.62

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
@@ -3057,7 +3057,7 @@ function parentIncludesNoChildDataTip(el, count) {
3057
3057
  return false;
3058
3058
  if (!el)
3059
3059
  return false;
3060
- if (el.classList.contains("no-child-data-tip"))
3060
+ if (el.getAttribute("data-no-child-data-tip"))
3061
3061
  return true;
3062
3062
  return parentIncludesNoChildDataTip(el.parentElement, count + 1);
3063
3063
  }
@@ -55691,17 +55691,23 @@ const _DataTable = class _DataTable extends React$1.Component {
55691
55691
  });
55692
55692
  }
55693
55693
  }, "handleSelectAllRows"));
55694
+ __publicField(this, "updateValidationHelper", /* @__PURE__ */ __name(() => {
55695
+ const { entities, reduxFormCellValidation } = computePresets(this.props);
55696
+ this.updateValidation(entities, reduxFormCellValidation);
55697
+ }, "updateValidationHelper"));
55694
55698
  __publicField(this, "updateValidation", /* @__PURE__ */ __name((entities, newCellValidate) => {
55695
55699
  const { change, schema } = computePresets(this.props);
55700
+ const tableWideErr = validateTableWideErrors({
55701
+ entities,
55702
+ schema,
55703
+ newCellValidate,
55704
+ props: this.props
55705
+ });
55696
55706
  change(
55697
55707
  "reduxFormCellValidation",
55698
- validateTableWideErrors({
55699
- entities,
55700
- schema,
55701
- newCellValidate,
55702
- props: this.props
55703
- })
55708
+ tableWideErr
55704
55709
  );
55710
+ this.forceUpdate();
55705
55711
  }, "updateValidation"));
55706
55712
  __publicField(this, "handleDeleteCell", /* @__PURE__ */ __name(() => {
55707
55713
  const {
@@ -56184,7 +56190,7 @@ const _DataTable = class _DataTable extends React$1.Component {
56184
56190
  }
56185
56191
  }, err && {
56186
56192
  "data-tip": (err == null ? void 0 : err.message) || err,
56187
- "no-child-data-tip": true
56193
+ "data-no-child-data-tip": true
56188
56194
  }), {
56189
56195
  onContextMenu: (e2) => {
56190
56196
  if (!isPrimarySelected) {
@@ -57490,6 +57496,7 @@ const _DataTable = class _DataTable extends React$1.Component {
57490
57496
  );
57491
57497
  }, "renderColumnHeader"));
57492
57498
  if (this.props.helperProp) {
57499
+ this.props.helperProp.updateValidationHelper = this.updateValidationHelper;
57493
57500
  this.props.helperProp.addEditableTableEntities = this.addEditableTableEntities;
57494
57501
  this.props.helperProp.getEditableTableInfoAndThrowFormError = this.getEditableTableInfoAndThrowFormError;
57495
57502
  }
package/index.es.js CHANGED
@@ -3039,7 +3039,7 @@ function parentIncludesNoChildDataTip(el, count) {
3039
3039
  return false;
3040
3040
  if (!el)
3041
3041
  return false;
3042
- if (el.classList.contains("no-child-data-tip"))
3042
+ if (el.getAttribute("data-no-child-data-tip"))
3043
3043
  return true;
3044
3044
  return parentIncludesNoChildDataTip(el.parentElement, count + 1);
3045
3045
  }
@@ -55673,17 +55673,23 @@ const _DataTable = class _DataTable extends React__default.Component {
55673
55673
  });
55674
55674
  }
55675
55675
  }, "handleSelectAllRows"));
55676
+ __publicField(this, "updateValidationHelper", /* @__PURE__ */ __name(() => {
55677
+ const { entities, reduxFormCellValidation } = computePresets(this.props);
55678
+ this.updateValidation(entities, reduxFormCellValidation);
55679
+ }, "updateValidationHelper"));
55676
55680
  __publicField(this, "updateValidation", /* @__PURE__ */ __name((entities, newCellValidate) => {
55677
55681
  const { change: change2, schema } = computePresets(this.props);
55682
+ const tableWideErr = validateTableWideErrors({
55683
+ entities,
55684
+ schema,
55685
+ newCellValidate,
55686
+ props: this.props
55687
+ });
55678
55688
  change2(
55679
55689
  "reduxFormCellValidation",
55680
- validateTableWideErrors({
55681
- entities,
55682
- schema,
55683
- newCellValidate,
55684
- props: this.props
55685
- })
55690
+ tableWideErr
55686
55691
  );
55692
+ this.forceUpdate();
55687
55693
  }, "updateValidation"));
55688
55694
  __publicField(this, "handleDeleteCell", /* @__PURE__ */ __name(() => {
55689
55695
  const {
@@ -56166,7 +56172,7 @@ const _DataTable = class _DataTable extends React__default.Component {
56166
56172
  }
56167
56173
  }, err && {
56168
56174
  "data-tip": (err == null ? void 0 : err.message) || err,
56169
- "no-child-data-tip": true
56175
+ "data-no-child-data-tip": true
56170
56176
  }), {
56171
56177
  onContextMenu: (e2) => {
56172
56178
  if (!isPrimarySelected) {
@@ -57472,6 +57478,7 @@ const _DataTable = class _DataTable extends React__default.Component {
57472
57478
  );
57473
57479
  }, "renderColumnHeader"));
57474
57480
  if (this.props.helperProp) {
57481
+ this.props.helperProp.updateValidationHelper = this.updateValidationHelper;
57475
57482
  this.props.helperProp.addEditableTableEntities = this.addEditableTableEntities;
57476
57483
  this.props.helperProp.getEditableTableInfoAndThrowFormError = this.getEditableTableInfoAndThrowFormError;
57477
57484
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teselagen/ui",
3
- "version": "0.3.61",
3
+ "version": "0.3.62",
4
4
  "main": "./src/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -99,6 +99,7 @@ class DataTable extends React.Component {
99
99
  constructor(props) {
100
100
  super(props);
101
101
  if (this.props.helperProp) {
102
+ this.props.helperProp.updateValidationHelper = this.updateValidationHelper;
102
103
  this.props.helperProp.addEditableTableEntities =
103
104
  this.addEditableTableEntities;
104
105
  this.props.helperProp.getEditableTableInfoAndThrowFormError =
@@ -797,18 +798,24 @@ class DataTable extends React.Component {
797
798
  });
798
799
  }
799
800
  };
801
+ updateValidationHelper = () => {
802
+ const { entities, reduxFormCellValidation, } = computePresets(this.props);
803
+ this.updateValidation(entities, reduxFormCellValidation);
804
+ }
800
805
 
801
806
  updateValidation = (entities, newCellValidate) => {
802
807
  const { change, schema } = computePresets(this.props);
808
+ const tableWideErr = validateTableWideErrors({
809
+ entities,
810
+ schema,
811
+ newCellValidate,
812
+ props: this.props
813
+ })
803
814
  change(
804
815
  "reduxFormCellValidation",
805
- validateTableWideErrors({
806
- entities,
807
- schema,
808
- newCellValidate,
809
- props: this.props
810
- })
816
+ tableWideErr
811
817
  );
818
+ this.forceUpdate()
812
819
  };
813
820
  handleDeleteCell = () => {
814
821
  const {
@@ -2030,7 +2037,7 @@ class DataTable extends React.Component {
2030
2037
  },
2031
2038
  ...(err && {
2032
2039
  "data-tip": err?.message || err,
2033
- "no-child-data-tip": true
2040
+ "data-no-child-data-tip": true
2034
2041
  }),
2035
2042
  onContextMenu: e => {
2036
2043
  if (!isPrimarySelected) {
@@ -194,6 +194,7 @@ let clearMe;
194
194
  function parentIncludesNoChildDataTip(el, count) {
195
195
  if (count > 4) return false;
196
196
  if (!el) return false;
197
- if (el.classList.contains("no-child-data-tip")) return true;
197
+ // if attr data-no-child-data-tip is preset on the element, then we don't want to show a tooltip on any of its children
198
+ if (el.getAttribute("data-no-child-data-tip")) return true;
198
199
  return parentIncludesNoChildDataTip(el.parentElement, count + 1);
199
200
  }