@libs-ui/components-table 0.2.342-0 → 0.2.343-0

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.
@@ -509,7 +509,7 @@ class LibsUiComponentsTableComponent {
509
509
  }
510
510
  }
511
511
  checkExistItem(itemNew) {
512
- return this.items().find((item) => `${item()[this.fieldKey()]}` === `${itemNew()[this.fieldKey()]}`) ? true : false;
512
+ return this.items().find((item) => `${get(item, this.fieldKey())}` === `${get(itemNew, this.fieldKey())}`) ? true : false;
513
513
  }
514
514
  async removeItems(keys, ignoreReCallFooter) {
515
515
  this.resetIndexHover();
@@ -520,7 +520,7 @@ class LibsUiComponentsTableComponent {
520
520
  this.items.update((items) => {
521
521
  let isUpdate = false;
522
522
  const newItems = items.filter((item) => {
523
- if (`${item()[this.fieldKey()]}` === `${key}`) {
523
+ if (`${get(item, this.fieldKey())}` === `${key}`) {
524
524
  isUpdate = true;
525
525
  return false;
526
526
  }
@@ -531,7 +531,7 @@ class LibsUiComponentsTableComponent {
531
531
  this.stores.update((items) => {
532
532
  let isUpdate = false;
533
533
  const newItems = items.filter((item) => {
534
- if (`${item()[this.fieldKey()]}` === `${key}`) {
534
+ if (`${get(item, this.fieldKey())}` === `${key}`) {
535
535
  isUpdate = true;
536
536
  return false;
537
537
  }
@@ -570,7 +570,7 @@ class LibsUiComponentsTableComponent {
570
570
  if (event.checked) {
571
571
  this.keysSelected.set(this.items()
572
572
  .filter(async (item) => !(await this.checkCancelConditionCheckedItem(item)))
573
- .map((item) => `${item()[this.fieldKey()]}`));
573
+ .map((item) => `${get(item, this.fieldKey())}`));
574
574
  this.outKeysSelected.emit({ keys: this.keysSelected() });
575
575
  return;
576
576
  }
@@ -588,7 +588,7 @@ class LibsUiComponentsTableComponent {
588
588
  return isCancelCheck;
589
589
  }
590
590
  handlerChangeItemChecked(event, item) {
591
- const key = item[this.fieldKey()];
591
+ const key = get(item, this.fieldKey());
592
592
  const keys = new Set(this.keysSelected());
593
593
  keys.add(key);
594
594
  if (!event.checked) {
@@ -660,7 +660,7 @@ class LibsUiComponentsTableComponent {
660
660
  }
661
661
  this.keysSelected.set(this.items()
662
662
  .slice(0, perPage)
663
- .map((item) => `${item()[this.fieldKey()]}`));
663
+ .map((item) => `${get(item, this.fieldKey())}`));
664
664
  return;
665
665
  }
666
666
  this.callApiByService(true, true);
@@ -671,7 +671,7 @@ class LibsUiComponentsTableComponent {
671
671
  }
672
672
  this.keysSelected.set(this.items()
673
673
  .slice(0, perPage)
674
- .map((item) => `${item()[this.fieldKey()]}`));
674
+ .map((item) => `${get(item, this.fieldKey())}`));
675
675
  });
676
676
  this.outLoadDataError.subscribe(() => {
677
677
  this.setPerPageSelectMoreItem(currentPerPage);
@@ -714,7 +714,7 @@ class LibsUiComponentsTableComponent {
714
714
  handlerBarButtonClick(button) {
715
715
  const items = [];
716
716
  this.keysSelected().forEach((key) => {
717
- const item = this.items().find((item) => `${item()[this.fieldKey()]}` === `${key}`);
717
+ const item = this.items().find((item) => `${get(item, this.fieldKey())}` === `${key}`);
718
718
  if (item) {
719
719
  items.push(item);
720
720
  }