@myunisoft/design-system 0.8.2 → 0.8.3

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/dist/index.js CHANGED
@@ -7324,10 +7324,13 @@ var $21ca0ef7fb6000f8$var$edit = function edit(ctx, _ref3) {
7324
7324
  var addIndex = addTab.findIndex(function(e) {
7325
7325
  return e[selectableRowKey] === keyId;
7326
7326
  });
7327
- if (addIndex > -1) addTab[addIndex] = $21ca0ef7fb6000f8$var$_objectSpread($21ca0ef7fb6000f8$var$_objectSpread({
7328
- }, addTab[addIndex]), {
7329
- }, $21ca0ef7fb6000f8$var$_defineProperty2["default"]({
7330
- }, key, data));
7327
+ if (addIndex > -1) {
7328
+ var _objectSpread5;
7329
+ addTab[addIndex] = $21ca0ef7fb6000f8$var$_objectSpread($21ca0ef7fb6000f8$var$_objectSpread({
7330
+ }, addTab[addIndex]), {
7331
+ }, (_objectSpread5 = {
7332
+ }, $21ca0ef7fb6000f8$var$_defineProperty2["default"](_objectSpread5, key, data), $21ca0ef7fb6000f8$var$_defineProperty2["default"](_objectSpread5, "_touched", true), _objectSpread5));
7333
+ }
7331
7334
  return $21ca0ef7fb6000f8$var$_objectSpread($21ca0ef7fb6000f8$var$_objectSpread({
7332
7335
  }, ctx), {
7333
7336
  }, {
@@ -9580,7 +9583,7 @@ var $deb6f3e66712962d$var$useStorage = function useStorage(_tableKeyName) {
9580
9583
  var _storage = (_config$storage = config.storage) !== null && _config$storage !== void 0 ? _config$storage : localStorage;
9581
9584
  function getStorage() {
9582
9585
  var _JSON$parse;
9583
- if (!tableKeyName) throw new Error('The `tableKeyName` key is not defined in VirtualTable config.');
9586
+ if (!tableKeyName) console.error('The `tableKeyName` key is not defined in VirtualTable config.');
9584
9587
  return ((_JSON$parse = JSON.parse(_storage === null || _storage === void 0 ? void 0 : _storage.getItem('virtualTable'))) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse[tableKeyName]) || {
9585
9588
  };
9586
9589
  }
@@ -9871,13 +9874,13 @@ var $6a171a876dde67ea$var$ToolbarButtons = function ToolbarButtons(_ref) {
9871
9874
  return [
9872
9875
  $NOfOf.ROW_TYPE.NEW,
9873
9876
  $NOfOf.ROW_TYPE.EDIT
9874
- ].includes(e.rowType);
9877
+ ].includes(e.rowType) && e._touched;
9875
9878
  }).length === 0,
9876
9879
  onClick: function onClick() {
9877
9880
  switch(state){
9878
9881
  case $NOfOf.TABLE_STATE.ADD:
9879
9882
  handleValidateAdd(allRows.filter(function(e) {
9880
- return e.rowType === $NOfOf.ROW_TYPE.NEW;
9883
+ return e.rowType === $NOfOf.ROW_TYPE.NEW && e._touched;
9881
9884
  }), insertPosition === $NOfOf.INSERT_POSITION.BOTTOM ? displayableRows.length : 0);
9882
9885
  break;
9883
9886
  case $NOfOf.TABLE_STATE.EDIT:
@@ -9890,7 +9893,7 @@ var $6a171a876dde67ea$var$ToolbarButtons = function ToolbarButtons(_ref) {
9890
9893
  return [
9891
9894
  $NOfOf.ROW_TYPE.EDIT,
9892
9895
  $NOfOf.ROW_TYPE.NEW
9893
- ].includes(e.rowType);
9896
+ ].includes(e.rowType) && e._touched;
9894
9897
  }), insertPosition === $NOfOf.INSERT_POSITION.BOTTOM ? displayableRows.length : 0);
9895
9898
  break;
9896
9899
  }