@libs-ui/components-table 0.2.305 → 0.2.306-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.
@@ -1,7 +1,7 @@
1
1
  import { NgStyle, NgClass, AsyncPipe, NgComponentOutlet, NgTemplateOutlet } from '@angular/common';
2
2
  import { HttpParams } from '@angular/common/http';
3
3
  import * as i0 from '@angular/core';
4
- import { Pipe, input, Component, ChangeDetectionStrategy, computed, signal, output, viewChild, inject, DestroyRef, ChangeDetectorRef, effect, untracked } from '@angular/core';
4
+ import { Pipe, input, ChangeDetectionStrategy, Component, computed, signal, output, viewChild, inject, DestroyRef, ChangeDetectorRef, effect, untracked } from '@angular/core';
5
5
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
6
  import * as i2 from '@iharbeck/ngx-virtual-scroller';
7
7
  import { VirtualScrollerModule } from '@iharbeck/ngx-virtual-scroller';
@@ -216,7 +216,7 @@ class LibsUiComponentsTableComponent {
216
216
  keySearch = signal('');
217
217
  totalItemInBackend = signal(0);
218
218
  hasItemHightLight = signal(false);
219
- totalItemDisplay = computed(() => viewDataNumberByLanguage((this.totalItem() ?? this.totalItemInBackend()), false));
219
+ totalItemDisplay = computed(() => viewDataNumberByLanguage(this.totalItem() ?? this.totalItemInBackend(), false));
220
220
  listConfigMoreItem = computed(() => {
221
221
  return {
222
222
  type: 'text',
@@ -225,14 +225,14 @@ class LibsUiComponentsTableComponent {
225
225
  ignoreIconSelected: true,
226
226
  getValue: this.configSelectMoreItem()?.getValue,
227
227
  configLabelPopover: signal({
228
- zIndex: 1200
229
- })
228
+ zIndex: 1200,
229
+ }),
230
230
  }),
231
231
  httpRequestData: signal({
232
232
  serviceOther: returnListObject(this.configSelectMoreItem()?.listOption),
233
233
  functionName: 'list',
234
- argumentsValue: []
235
- })
234
+ argumentsValue: [],
235
+ }),
236
236
  };
237
237
  });
238
238
  hasScroll = signal(false);
@@ -245,38 +245,38 @@ class LibsUiComponentsTableComponent {
245
245
  functionControlSelectMoreItem;
246
246
  mouseEnterHeader = signal(false);
247
247
  /** INPUT */
248
- timeHighlighNewItem = input(2000, { transform: val => val ?? 2000 });
249
- headerLeft = input([], { transform: val => val ?? [] });
250
- headerRight = input([], { transform: val => val ?? [] });
248
+ timeHighlighNewItem = input(2000, { transform: (val) => val ?? 2000 });
249
+ headerLeft = input([], { transform: (val) => val ?? [] });
250
+ headerRight = input([], { transform: (val) => val ?? [] });
251
251
  configTemplateItemCollapseExpand = input();
252
252
  showFooter = input();
253
253
  ignoreBorderFooter = input();
254
- customPositionFooter = input('bottom', { transform: val => val ?? 'bottom' });
254
+ customPositionFooter = input('bottom', { transform: (val) => val ?? 'bottom' });
255
255
  footerLeft = input();
256
256
  footerRight = input();
257
- disableCheckbox = input(false, { transform: val => val ?? false });
258
- enableUnequalChildrenSizes = input(false, { transform: val => val ?? false });
259
- bufferAmount = input(5, { transform: val => val ? (val > 25 ? 25 : val) : 5 });
257
+ disableCheckbox = input(false, { transform: (val) => val ?? false });
258
+ enableUnequalChildrenSizes = input(false, { transform: (val) => val ?? false });
259
+ bufferAmount = input(5, { transform: (val) => (val ? (val > 25 ? 25 : val) : 5) });
260
260
  totalItem = input();
261
261
  isDashBorder = input();
262
262
  classHeaderContainerInclude = input();
263
263
  classHeaderLeftInclude = input();
264
- classBodyInclude = input('', { transform: val => val ?? '' });
265
- classFooterInclude = input('', { transform: val => val ?? '' });
266
- classTableContainerInclude = input('', { transform: val => val ?? '' });
264
+ classBodyInclude = input('', { transform: (val) => val ?? '' });
265
+ classFooterInclude = input('', { transform: (val) => val ?? '' });
266
+ classTableContainerInclude = input('', { transform: (val) => val ?? '' });
267
267
  classBarInclude = input('justify-between mb-[16px]');
268
- fieldKey = input('id', { transform: val => val || 'id' }); // tên field định danh item của listDatas
268
+ fieldKey = input('id', { transform: (val) => val || 'id' }); // tên field định danh item của listDatas
269
269
  defaultKeysSelected = input();
270
270
  labelBarNoSelectItem = input(`i18n_total_quantity`); // sử dụng để hiên thị khi tích chọn item
271
- labelBarButtons = input('i18n_number_item_selected', { transform: val => val || 'i18n_number_item_selected' }); // sử dụng để hiên thị khi tích chọn item
272
- classLabelBarButtons = input('', { transform: val => val ?? '' }); // sử dụng để hiên thị khi tích chọn item
271
+ labelBarButtons = input('i18n_number_item_selected', { transform: (val) => val || 'i18n_number_item_selected' }); // sử dụng để hiên thị khi tích chọn item
272
+ classLabelBarButtons = input('', { transform: (val) => val ?? '' }); // sử dụng để hiên thị khi tích chọn item
273
273
  barButtons = input();
274
274
  sortLocal = input(); // trường hợp nếu sortLocal này không đáp ứng được nghiệp vụ thì mới cân nhắc sử dụng filterLocal
275
275
  filterOrSortLocal = input();
276
276
  httpRequestData = input();
277
277
  httpRequestDataFooter = input();
278
278
  newData = input();
279
- filter = input({ filterData: {} }, { transform: val => val ?? { filterData: {} } });
279
+ filter = input({ filterData: {} }, { transform: (val) => val ?? { filterData: {} } });
280
280
  ignoreBar = input();
281
281
  classLabelBarNoSelectItem = input();
282
282
  ignoreClassBgHeader = input();
@@ -284,11 +284,11 @@ class LibsUiComponentsTableComponent {
284
284
  showScrollTablePinnedIfNoData = input();
285
285
  ignoreBorderItemLast = input();
286
286
  isHiddenHeaderWhenNodata = input();
287
- maxItemSelected = input(100, { transform: val => val ?? 100 });
287
+ maxItemSelected = input(100, { transform: (val) => val ?? 100 });
288
288
  configSelectMoreItem = input();
289
289
  onlyShowNoResult = input();
290
290
  ignoreBorderItem = input();
291
- activityLoadData = input('scroll-infinity', { transform: val => val ?? 'scroll-infinity' });
291
+ activityLoadData = input('scroll-infinity', { transform: (val) => val ?? 'scroll-infinity' });
292
292
  paginationSetting = input();
293
293
  templateNoData = input();
294
294
  templateNoResult = input();
@@ -311,7 +311,6 @@ class LibsUiComponentsTableComponent {
311
311
  footerLeftElementRef = viewChild('footerLeftElementRef');
312
312
  bodyElementRef = viewChild('bodyElementRef');
313
313
  bodyComponentRef = viewChild('bodyComponentRef');
314
- ;
315
314
  /**INJECT */
316
315
  httpRequestService = inject(LibsUiHttpRequestService);
317
316
  destroyRef = inject(DestroyRef);
@@ -319,7 +318,7 @@ class LibsUiComponentsTableComponent {
319
318
  constructor() {
320
319
  effect(() => {
321
320
  if (this.defaultKeysSelected()?.length) {
322
- untracked(() => this.keysSelected.update(keys => ([...keys, ...(this.defaultKeysSelected() || [])])));
321
+ untracked(() => this.keysSelected.update((keys) => [...keys, ...(this.defaultKeysSelected() || [])]));
323
322
  }
324
323
  });
325
324
  effect(() => {
@@ -340,7 +339,7 @@ class LibsUiComponentsTableComponent {
340
339
  this.keySearch.set(get(this.filter().filterData, 'keySearch', ''));
341
340
  this.storeParamsCallApi.set(cloneDeep(this.filter().filterData));
342
341
  if (this.filter()?.filterData && !this.filter().filterData['instanceSort'] && this.instanceSort()) {
343
- this.storeParamsCallApi.update(data => ({ ...data, instanceSort: this.instanceSort() }));
342
+ this.storeParamsCallApi.update((data) => ({ ...data, instanceSort: this.instanceSort() }));
344
343
  }
345
344
  if (this.filterOrSortLocal() && this.stores().length) {
346
345
  this.items.set(this.filterOrSortLocal()?.(signal([...this.stores()]), { ...(this.filter().filterData || {}), instanceSort: this.instanceSort() }) || []);
@@ -364,9 +363,11 @@ class LibsUiComponentsTableComponent {
364
363
  return;
365
364
  },
366
365
  resetKeySelected: () => this.keysSelected.set([]),
367
- detectChanges: () => this.cdr.detectChanges()
366
+ detectChanges: () => this.cdr.detectChanges(),
368
367
  });
369
- fromEvent(window, 'resize').pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
368
+ fromEvent(window, 'resize')
369
+ .pipe(takeUntilDestroyed(this.destroyRef))
370
+ .subscribe(() => {
370
371
  this.cdr.detectChanges();
371
372
  });
372
373
  }
@@ -392,14 +393,14 @@ class LibsUiComponentsTableComponent {
392
393
  guideAutoUpdateArgumentsValue.sortOrderBy = {
393
394
  fieldGetValue: 'storeParamsCallApi.instanceSort.fieldSort',
394
395
  fieldUpdate: '[0]',
395
- subFieldUpdate: 'order_by'
396
+ subFieldUpdate: 'order_by',
396
397
  };
397
398
  }
398
399
  if (guideAutoUpdateArgumentsValue && !guideAutoUpdateArgumentsValue.sortOrderType && this.instanceSort()) {
399
400
  guideAutoUpdateArgumentsValue.sortOrderType = {
400
401
  fieldGetValue: 'storeParamsCallApi.instanceSort.mode',
401
402
  fieldUpdate: '[0]',
402
- subFieldUpdate: 'order_type'
403
+ subFieldUpdate: 'order_type',
403
404
  };
404
405
  }
405
406
  if (firstCall) {
@@ -456,28 +457,28 @@ class LibsUiComponentsTableComponent {
456
457
  return;
457
458
  }
458
459
  const itemsAdd = [];
459
- items().forEach(item => {
460
+ items().forEach((item) => {
460
461
  if (!this.checkExistItem(item)) {
461
462
  itemsAdd.push(item);
462
463
  if (!ignoreHightLight) {
463
464
  this.hasItemHightLight.set(true);
464
- item.update(data => ({ ...data, specificHightLight: true }));
465
+ item.update((data) => ({ ...data, specificHightLight: true }));
465
466
  }
466
467
  if (addFirst) {
467
- this.items.update(data => [item, ...data]);
468
- this.stores.update(data => [item, ...data]);
468
+ this.items.update((data) => [item, ...data]);
469
+ this.stores.update((data) => [item, ...data]);
469
470
  return;
470
471
  }
471
- this.items.update(data => [...data, item]);
472
- this.stores.update(data => [...data, item]);
472
+ this.items.update((data) => [...data, item]);
473
+ this.stores.update((data) => [...data, item]);
473
474
  }
474
475
  });
475
476
  if (autoCountNewItem && itemsAdd.length) {
476
- this.totalItemInBackend.update(value => value + itemsAdd.length);
477
+ this.totalItemInBackend.update((value) => value + itemsAdd.length);
477
478
  }
478
479
  if (!ignoreHightLight) {
479
480
  setTimeout(() => {
480
- itemsAdd.forEach(item => item.update(data => ({ ...data, specificHightLight: false })));
481
+ itemsAdd.forEach((item) => item.update((data) => ({ ...data, specificHightLight: false })));
481
482
  this.hasItemHightLight.set(false);
482
483
  }, this.timeHighlighNewItem());
483
484
  }
@@ -487,17 +488,17 @@ class LibsUiComponentsTableComponent {
487
488
  }
488
489
  }
489
490
  checkExistItem(itemNew) {
490
- return this.items().find(item => `${item()[this.fieldKey()]}` === `${itemNew()[this.fieldKey()]}`) ? true : false;
491
+ return this.items().find((item) => `${item()[this.fieldKey()]}` === `${itemNew()[this.fieldKey()]}`) ? true : false;
491
492
  }
492
493
  async removeItems(keys, ignoreReCallFooter) {
493
494
  this.resetIndexHover();
494
495
  if (!this.items().length) {
495
496
  return;
496
497
  }
497
- keys.forEach(key => {
498
- this.items.update(items => {
498
+ keys.forEach((key) => {
499
+ this.items.update((items) => {
499
500
  let isUpdate = false;
500
- const newItems = items.filter(item => {
501
+ const newItems = items.filter((item) => {
501
502
  if (`${item()[this.fieldKey()]}` === `${key}`) {
502
503
  isUpdate = true;
503
504
  return false;
@@ -506,9 +507,9 @@ class LibsUiComponentsTableComponent {
506
507
  });
507
508
  return isUpdate ? newItems : items;
508
509
  });
509
- this.stores.update(items => {
510
+ this.stores.update((items) => {
510
511
  let isUpdate = false;
511
- const newItems = items.filter(item => {
512
+ const newItems = items.filter((item) => {
512
513
  if (`${item()[this.fieldKey()]}` === `${key}`) {
513
514
  isUpdate = true;
514
515
  return false;
@@ -520,9 +521,9 @@ class LibsUiComponentsTableComponent {
520
521
  if (!this.keysSelected() || !this.keysSelected().length) {
521
522
  return;
522
523
  }
523
- this.keysSelected.update(keys => keys.filter(keySelected => keySelected !== key));
524
+ this.keysSelected.update((keys) => keys.filter((keySelected) => keySelected !== key));
524
525
  });
525
- this.totalItemInBackend.update(value => value - keys.length);
526
+ this.totalItemInBackend.update((value) => value - keys.length);
526
527
  await this.checkScroll();
527
528
  if (!ignoreReCallFooter) {
528
529
  await this.callApiByServiceFooter();
@@ -546,7 +547,9 @@ class LibsUiComponentsTableComponent {
546
547
  }
547
548
  handlerChangeCheckedAllItems(event) {
548
549
  if (event.checked) {
549
- this.keysSelected.set(this.items().filter(async (item) => !(await this.checkCancelConditionCheckedItem(item))).map(item => `${item()[this.fieldKey()]}`));
550
+ this.keysSelected.set(this.items()
551
+ .filter(async (item) => !(await this.checkCancelConditionCheckedItem(item)))
552
+ .map((item) => `${item()[this.fieldKey()]}`));
550
553
  this.outKeysSelected.emit({ keys: this.keysSelected() });
551
554
  return;
552
555
  }
@@ -556,10 +559,10 @@ class LibsUiComponentsTableComponent {
556
559
  async checkCancelConditionCheckedItem(item) {
557
560
  let isCancelCheck = false;
558
561
  if (!isCancelCheck && this.headerLeft().length && this.headerLeft()[0].checkConditionCheckBoxHidden) {
559
- isCancelCheck = await lastValueFrom(this.headerLeft()[0].checkConditionCheckBoxHidden({ item: item() })) || false;
562
+ isCancelCheck = (await lastValueFrom(this.headerLeft()[0].checkConditionCheckBoxHidden({ item: item() }))) || false;
560
563
  }
561
564
  if (!isCancelCheck && this.headerRight().length && this.headerRight()[0].checkConditionCheckBoxHidden) {
562
- isCancelCheck = await lastValueFrom(this.headerRight()[0].checkConditionCheckBoxHidden({ item: item() })) || false;
565
+ isCancelCheck = (await lastValueFrom(this.headerRight()[0].checkConditionCheckBoxHidden({ item: item() }))) || false;
563
566
  }
564
567
  return isCancelCheck;
565
568
  }
@@ -583,10 +586,10 @@ class LibsUiComponentsTableComponent {
583
586
  this.handlerSortLocal(sort, scrollLeft);
584
587
  return;
585
588
  }
586
- this.storeParamsCallApi.update(data => ({ ...data, instanceSort: this.instanceSort() }));
589
+ this.storeParamsCallApi.update((data) => ({ ...data, instanceSort: this.instanceSort() }));
587
590
  this.outSort.emit({
588
591
  sort: sort,
589
- onSortSuccess: () => this.onSortSuccess(scrollLeft)
592
+ onSortSuccess: () => this.onSortSuccess(scrollLeft),
590
593
  });
591
594
  try {
592
595
  await this.callApiByService(true);
@@ -602,7 +605,7 @@ class LibsUiComponentsTableComponent {
602
605
  return;
603
606
  }
604
607
  const { fieldSort, mode } = sort;
605
- this.items.update(items => {
608
+ this.items.update((items) => {
606
609
  items.sort((itemA, itemB) => {
607
610
  let value1 = mode === 'asc' ? itemA()[fieldSort] : itemB()[fieldSort];
608
611
  let value2 = mode === 'asc' ? itemB()[fieldSort] : itemA()[fieldSort];
@@ -628,25 +631,29 @@ class LibsUiComponentsTableComponent {
628
631
  }
629
632
  this.functionControlSelectMoreItem?.reset();
630
633
  const perPage = Number(event.key).valueOf();
631
- const currentPage = Number(this.setPerPageSelectMoreItem(perPage)).valueOf();
634
+ const currentPerPage = Number(this.setPerPageSelectMoreItem(perPage)).valueOf();
632
635
  const isPagingNumber = this.configSelectMoreItem()?.pagingNumber;
633
- if (currentPage > perPage || this.items.length >= perPage) {
636
+ if (currentPerPage > perPage || this.items.length >= perPage) {
634
637
  if (!isPagingNumber) {
635
- this.setPerPageSelectMoreItem(currentPage);
638
+ this.setPerPageSelectMoreItem(currentPerPage);
636
639
  }
637
- this.keysSelected.set(this.items().slice(0, perPage).map(item => `${item()[this.fieldKey()]}`));
640
+ this.keysSelected.set(this.items()
641
+ .slice(0, perPage)
642
+ .map((item) => `${item()[this.fieldKey()]}`));
638
643
  return;
639
644
  }
640
645
  this.callApiByService(true, true);
641
646
  const sub = this.outLoadDataComplete.subscribe(() => {
642
647
  sub.unsubscribe();
643
648
  if (!isPagingNumber) {
644
- this.setPerPageSelectMoreItem(currentPage);
649
+ this.setPerPageSelectMoreItem(currentPerPage);
645
650
  }
646
- this.keysSelected.set(this.items().slice(0, perPage).map(item => `${item()[this.fieldKey()]}`));
651
+ this.keysSelected.set(this.items()
652
+ .slice(0, perPage)
653
+ .map((item) => `${item()[this.fieldKey()]}`));
647
654
  });
648
655
  this.outLoadDataError.subscribe(() => {
649
- this.setPerPageSelectMoreItem(currentPage);
656
+ this.setPerPageSelectMoreItem(currentPerPage);
650
657
  });
651
658
  }
652
659
  setPerPageSelectMoreItem(perPage) {
@@ -677,6 +684,7 @@ class LibsUiComponentsTableComponent {
677
684
  this.outLoading.emit(this.loading());
678
685
  }
679
686
  handlerButtonClick(type, buttonDropdownData, button) {
687
+ // buttonOrigin chỉ sử dụng khi dùng buttonActions có button-dropdown
680
688
  if (type === 'button') {
681
689
  return this.outClickButtonAction.emit({ item: this.itemOfIndexHover, button: button });
682
690
  }
@@ -684,8 +692,8 @@ class LibsUiComponentsTableComponent {
684
692
  }
685
693
  handlerBarButtonClick(button) {
686
694
  const items = [];
687
- this.keysSelected().forEach(key => {
688
- const item = this.items().find(item => `${item()[this.fieldKey()]}` === `${key}`);
695
+ this.keysSelected().forEach((key) => {
696
+ const item = this.items().find((item) => `${item()[this.fieldKey()]}` === `${key}`);
689
697
  if (item) {
690
698
  items.push(item);
691
699
  }
@@ -696,7 +704,7 @@ class LibsUiComponentsTableComponent {
696
704
  keys: this.keysSelected(),
697
705
  hiddenBarButtons: () => {
698
706
  return;
699
- }
707
+ },
700
708
  });
701
709
  }
702
710
  handlerButtonDropdownEvent(eventName) {
@@ -795,7 +803,7 @@ class LibsUiComponentsTableComponent {
795
803
  this.callApiByService(false);
796
804
  }
797
805
  handlerChangePage(page) {
798
- this.pagingStore.update(data => ({ ...(data || {}), page }));
806
+ this.pagingStore.update((data) => ({ ...(data || {}), page }));
799
807
  this.callApiByService(true);
800
808
  }
801
809
  resetScroll(scrollPositionLeft, scrollPositionTop) {
@@ -825,8 +833,10 @@ class LibsUiComponentsTableComponent {
825
833
  }
826
834
  async checkScroll() {
827
835
  const hasScroll = this.hasScroll();
828
- return new Promise(resolve => {
829
- timer(500).pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
836
+ return new Promise((resolve) => {
837
+ timer(500)
838
+ .pipe(takeUntilDestroyed(this.destroyRef))
839
+ .subscribe(() => {
830
840
  if (this.BodyElement) {
831
841
  this.hasScroll.set(this.BodyElement.scrollHeight > this.BodyElement.offsetHeight);
832
842
  }
@@ -852,13 +862,27 @@ class LibsUiComponentsTableComponent {
852
862
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsTableComponent, decorators: [{
853
863
  type: Component,
854
864
  args: [{ selector: 'libs_ui-components-table', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
855
- NgClass, NgStyle, AsyncPipe, NgTemplateOutlet, NgComponentOutlet, LibsUiComponentsTableTemplatesComponent,
856
- TranslateModule, VirtualScrollerModule, LibsUiComponentsButtonsButtonComponent, LibsUiPipesConvertObjectToSignalPipe,
857
- LibsUiComponentsDropdownComponent, LibsUiComponentsButtonsSortArrowComponent, LibsUiComponentsPaginationComponent,
858
- LibsUiComponentsCheckboxSingleComponent, LibsUiTableCalculatorColumnPipe,
859
- LibsUiComponentsSpinnerComponent, LibsUiComponentsPopoverComponent,
860
- LibsUiComponentsScrollOverlayDirective, LibsUiIconsGetIconComponentPipe,
861
- LibsUiPipesCallFunctionInTemplatePipe, LibsUiPipesCheckSelectedByKeyPipe
865
+ NgClass,
866
+ NgStyle,
867
+ AsyncPipe,
868
+ NgTemplateOutlet,
869
+ NgComponentOutlet,
870
+ LibsUiComponentsTableTemplatesComponent,
871
+ TranslateModule,
872
+ VirtualScrollerModule,
873
+ LibsUiComponentsButtonsButtonComponent,
874
+ LibsUiPipesConvertObjectToSignalPipe,
875
+ LibsUiComponentsDropdownComponent,
876
+ LibsUiComponentsButtonsSortArrowComponent,
877
+ LibsUiComponentsPaginationComponent,
878
+ LibsUiComponentsCheckboxSingleComponent,
879
+ LibsUiTableCalculatorColumnPipe,
880
+ LibsUiComponentsSpinnerComponent,
881
+ LibsUiComponentsPopoverComponent,
882
+ LibsUiComponentsScrollOverlayDirective,
883
+ LibsUiIconsGetIconComponentPipe,
884
+ LibsUiPipesCallFunctionInTemplatePipe,
885
+ LibsUiPipesCheckSelectedByKeyPipe,
862
886
  ], template: "<div class='flex flex-col w-full h-full'>\n @if (!ignoreBar()) {\n <div\n class=\"flex items-center relative z-[1] bottom-0 left-0 w-full bg-white libs-ui-table-shadow-bottom {{ classBarInclude() }}\"\n [class.px-[16px]]=\"keysSelected().length || labelBarNoSelectItem()\"\n [class.py-[6px]]=\"keysSelected().length || labelBarNoSelectItem()\"\n (mouseenter)=\"resetIndexHover($event)\">\n <ng-content select='div.libs-ui-table-bar-left'></ng-content>\n @if (!keysSelected().length && labelBarNoSelectItem()) {\n <div class=\"{{ classLabelBarNoSelectItem() ?? 'px-[12px] py-[5px]' }}\"\n [innerHtml]='labelBarNoSelectItem() | translate:{value:totalItemDisplay()}'>\n </div>\n }\n @if (keysSelected().length) {\n <div class=\"flex items-center pl-[12px]\">\n <div class=\"flex items-center h-full mt-[-2px]\">\n <libs_ui-components-checkbox-single [checked]=\"true\"\n [disable]=\"loading() || disableCheckbox()\"\n (outChange)=\"handlerChangeAllChecked()\" />\n </div>\n <div class=\"libs-ui-font-h5m text-[#071631] mr-[8px] {{ classLabelBarButtons() }}\">\n {{ labelBarButtons() | translate:{ value:keysSelected().length } }}\n </div>\n @if (configSelectMoreItem()) {\n <libs_ui-components-dropdown [isNgContent]=\"true\"\n [popoverCustomConfig]=\"{\n widthByParent:false,\n ignoreArrow: true,\n maxHeight: 2048,\n classInclude:'!w-[121px]',\n position: {\n mode:'start',\n distance:0\n }\n }\"\n [listConfig]=\"listConfigMoreItem()\"\n [listHiddenInputSearch]=\"true\"\n [listMaxItemShow]=\"5\"\n class=\"!w-[16px] h-[16px] mr-[8px]\"\n (outSelectKey)=\"handlerSelectedMoreItem($event)\"\n (outFunctionsControl)=\"handlerFunctionControlMoreSelectItem($event)\">\n <libs_ui-components-buttons-button [type]=\"'button-link-primary'\"\n [classInclude]=\"'!p-0 m-0'\"\n [classIconLeft]=\"'before:!text-[16px] libs-ui-icon-move-right rotate-90 mr-[6px]'\"\n [popover]=\"{config:{content:'i18n_more_select'}}\"\n [ignoreStopPropagationEvent]=\"true\" />\n </libs_ui-components-dropdown>\n }\n <div class=\"h-[16px] libs-ui-border-left-general ml-[16px]\"></div>\n @if (barButtons()?.length) {\n @for (button of barButtons();track button) {\n <libs_ui-components-buttons-button [type]=\"button.type || 'button-link-primary'\"\n [classIconLeft]=\"button.classIconLeft || ''\"\n [classInclude]=\"button.classInclude || ''\"\n [label]=\"(button.label || ' ') | translate\"\n (outClick)=\"handlerBarButtonClick(button)\" />\n }\n }\n </div>\n }\n <ng-content select='div.libs-ui-table-bar-right'></ng-content>\n </div>\n }\n\n <div #tableContainerElementRef\n class=\"libs-ui-table flex flex-col w-full h-full relative {{ classTableContainerInclude() }}\"\n [class.px-[16px]]='!ignoreBar()'\n (mouseleave)=\"handlerMouseLeaveContainer($event)\">\n <div class=\"relative w-full shrink-0\"\n [style.height.px]=\"headerElementRef.offsetHeight\">\n <div #headerElementRef\n LibsUiComponentsScrollOverlayDirective\n [options]=\"{scrollbarWidth: 0}\"\n [class.libs-ui-border-bottom-dashed-general]=\"!hasItemHightLight() && isDashBorder()\"\n [class.libs-ui-border-bottom-general]=\"!hasItemHightLight() && !isDashBorder()\"\n [class.!hidden]=\"!items().length && isHiddenHeaderWhenNodata()\"\n [class]=\"classHeaderContainer()\"\n (outScroll)=\"handlerScrollHeader($event)\"\n (mouseenter)=\"handlerMouseEnterHeader($event)\"\n (mouseleave)=\"handlerMouseLeaveHeader($event)\">\n @if (headerLeft().length) {\n <div [class]=\"classHeaderLeftContainer()\">\n @for (header of headerLeft();track header) {\n <ng-container *ngTemplateOutlet=\"templateHeaderRef;context:{headerItem:header,isHeaderLeft:true}\" />\n }\n </div>\n }\n @if (headerRight().length) {\n @for (header of headerRight();track header) {\n <ng-container *ngTemplateOutlet=\"templateHeaderRef;context:{headerItem:header,isHeaderLeft:false}\" />\n }\n }\n </div>\n </div>\n @if (showFooter() && itemFooter() && customPositionFooter() === 'top') {\n <ng-container *ngTemplateOutlet='templateFooterRef' />\n }\n <div class=\"relative flex flex-col w-full h-full overflow-x-hidden bg-white {{ classBodyInclude() || '' }}\">\n <div #bodyElementRef\n class=\"flex h-full w-full relative\"\n LibsUiComponentsScrollOverlayDirective\n (outScroll)=\"handlerScrollBody($event)\"\n (outScrollBottom)=\"handlerScrollBottom($event)\">\n @if (items().length) {\n <virtual-scroller #bodyComponentRef\n [items]=\"items()\"\n [enableUnequalChildrenSizes]=\"enableUnequalChildrenSizes()\"\n class=\"h-full\"\n [style.width.px]=\"headerElementRef.scrollWidth > (bodyElementRef ? bodyElementRef.scrollWidth : 0) ? headerElementRef.scrollWidth: undefined\"\n [parentScroll]=\"bodyElementRef\"\n [bufferAmount]=\"bufferAmount()\">\n @for (data of bodyComponentRef.viewPortItems;track data()) {\n <div #elementHover\n class=\"flex\"\n [class.bg-[#f3fcfc]]=\"data().specificHightLight\"\n [class.libs-ui-border-top-1px-36d3d3]=\"data().specificHightLight && $first && !ignoreBorderItem()\"\n [class.libs-ui-border-bottom-1px-36d3d3]=\"data().specificHightLight && !ignoreBorderItem()\"\n [ngClass]=\"(data().specificHightLight || ($last && ignoreBorderItemLast())) ? 'libs-ui-border-radius-bottom-left-4px libs-ui-border-radius-bottom-right-4px' : ignoreBorderItem() ? '' : isDashBorder() ? 'libs-ui-border-bottom-dashed-general' : 'libs-ui-border-bottom-general'\"\n [style.width.px]=\"headerElementRef.scrollWidth\"\n [class.bg-[#f8f9fa]]=\"itemOfIndexHover === data && !data().specificHightLight\"\n (mouseenter)=\"setIndexHover($event,data)\"\n (mouseleave)=\"resetIndexHoverWhenMouseLeave($event)\">\n @if (headerLeft().length || headerRight().length) {\n <div class=\"flex flex-col w-full\">\n <div class=\"flex w-full\">\n @if (headerLeft().length) {\n <div class=\"flex sticky top-0 left-0 z-[1]\"\n [class.bg-white]=\"!data().specificHightLight\"\n [class.bg-[#f3fcfc]]=\"data().specificHightLight\">\n @for (header of headerLeft();track header) {\n <div\n class=\"relative flex px-[12px] py-[8px] {{ header.ignoreBorderRight ? '': 'libs-ui-border-right-general' }}\"\n [class.bg-[#f8f9fa]]=\"itemOfIndexHover === data && !data().specificHightLight\"\n [ngStyle]=\"(header|LibsUiTableCalculatorColumnPipe:headerElementRef.clientWidth:headerLeft():headerRight()) || (header.isShowIndexOnRow ? {width:'50px','flex-shirk':'0',padding:'8px'} : {})\"\n [ngClass]=\"header.ngClass || {}\">\n <ng-container *ngTemplateOutlet=\"templateBodyRef;context:{header:header,data:data}\" />\n </div>\n }\n </div>\n }\n @if (headerRight().length) {\n @for (header of headerRight();track header) {\n <div class=\"relative flex px-[12px] py-[8px]\"\n [ngStyle]=\"(header|LibsUiTableCalculatorColumnPipe:headerElementRef.clientWidth:headerLeft():headerRight()) || (header.isShowIndexOnRow ? {width:'50px','flex-shirk':'0',padding:'8px'} : {})\"\n [ngClass]=\"header.ngClass || {}\">\n <ng-container *ngTemplateOutlet=\"templateBodyRef;context:{header:header,data:data}\" />\n </div>\n }\n }\n </div>\n @if (configTemplateItemCollapseExpand() && data().specificExpand && data()[configTemplateItemCollapseExpand()?.fieldGetDataExpand || 'specificDataExpand']) {\n <div [class]=\"configTemplateItemCollapseExpand()?.cssWrapper || 'flex w-full'\">\n @for (dataExpand of data()[configTemplateItemCollapseExpand()?.fieldGetDataExpand || 'specificDataExpand']();track $index) {\n @if (configTemplateItemCollapseExpand()?.colTemplateConfig) {\n <libs_ui-components-table-templates [item]=\"dataExpand\"\n [templateCssWrapper]=\"configTemplateItemCollapseExpand()?.templateCssWrapper\"\n [configs]=\"configTemplateItemCollapseExpand()?.colTemplateConfig\" />\n }\n } @empty {\n <div class=\"relative h-[100px]\">\n <ng-container *ngTemplateOutlet=\"templateNodataRef\" />\n </div>\n }\n </div>\n }\n </div>\n }\n </div>\n }\n </virtual-scroller>\n } @else if (!loading()) {\n <div class=\"sticky left-0 top-0 z-[1] h-full w-full\">\n <ng-container *ngTemplateOutlet=\"templateNodataRef\" />\n </div>\n @if (showScrollTablePinnedIfNoData()) {\n <div class=\"absolute h-[1px] bg-transparent top-0 left-0 z-[1]\"\n [style.width.px]=\"headerElementRef.scrollWidth\"></div>\n }\n }\n </div>\n\n @if (showFooter() && itemFooter() && customPositionFooter() === 'bottom') {\n <ng-container *ngTemplateOutlet='templateFooterRef' />\n }\n\n @if (loading()) {\n <div class=\"absolute w-full h-full z-[2] flex items-center content-center\">\n <libs_ui-components-spinner />\n </div>\n }\n </div>\n\n @if (activityLoadData() === 'click-pagination') {\n <div class=\"flex w-full mt-[12px]\">\n <libs_ui-components-pagination\n [modeDisplayTotalPageAndGotoPage]=\"paginationSetting()?.modeDisplayTotalPageAndGotoPage || 'bottom'\"\n [classDisplayTotalPageAndGotoPage]=\"paginationSetting()?.classDisplayTotalPageAndGotoPage || ''\"\n [classIncludeItem]=\"paginationSetting()?.classIncludeItem || ''\"\n [classIncludeContainer]=\"paginationSetting()?.classIncludeContainer || '!items-end'\"\n [disable]=\"paginationSetting()?.disable || loading() || !items().length\"\n [numberPageDispaly]=\"paginationSetting()?.numberPageDispaly || 5\"\n [showTotalPage]=\"paginationSetting()?.showTotalPage || false\"\n [showInputGotoPage]=\"paginationSetting()?.showInputGotoPage || false\"\n [totalItems]=\"pagingStore()?.total_items || (pagingStore()?.total_pages || 0)*(pagingStore()?.per_page || 0)\"\n [perPage]=\"pagingStore()?.per_page || 0\"\n [currentPage]=\"pagingStore()?.page || 0\"\n (outPageSelect)=\"handlerChangePage($event)\" />\n </div>\n }\n </div>\n</div>\n\n<ng-template #templateHeaderRef\n let-header='headerItem'\n let-isHeaderLeft='isHeaderLeft'>\n <div\n [class]=\"'relative flex '+ (header.paddingLeftRightHeaderContainer ?? ' px-[12px] ') + (isHeaderLeft && !header.ignoreBorderRight ? ' libs-ui-border-right-general ' : ' ')+ ' libs-ui-table-header-col '\"\n [class.flex-col]=\"header.rowsConfig\"\n [class.py-[8px]]='!header.ignorePyDefault'\n [ngStyle]=\"(header|LibsUiTableCalculatorColumnPipe:headerElementRef.clientWidth:headerLeft():headerRight()) || (header.isShowIndexOnRow ? {width:'50px','flex-shirk':'0',padding:'8px'} : {})\"\n [ngClass]=\"header.ngClass || {}\">\n @if (!header.rowsConfig) {\n <ng-container *ngTemplateOutlet=\"templateHeaderContentRef;context:{headerItem:header,isColRender:false}\" />\n }\n @if (header.rowsConfig;as rowsConfig) {\n @for (row of rowsConfig.rows;track row) {\n <div [class]=\"row.classRow\">\n @for (col of row.cols ; track col) {\n <ng-container *ngTemplateOutlet=\"templateHeaderContentRef;context:{headerItem:col,isColRender:true}\" />\n }\n </div>\n }\n }\n </div>\n</ng-template>\n\n<ng-template #templateHeaderContentRef\n let-header='headerItem'\n let-isColRender='isColRender'>\n <div #itemHeaderRef class=\"flex libs-ui-font-h6m min-h-[18px] text-[#6a7383] max-w-full\"\n [class.items-center]='header.contentHeaderAlignCenter ?? true'\n [class.justify-end]='header.contentHeaderJustifyContentEnd'\n [class.w-full]=\"header.isShowIndexOnRow\"\n [ngStyle]=\"isColRender ? ((header|LibsUiTableCalculatorColumnPipe:headerElementRef.clientWidth:headerLeft():headerRight()) || (header.isShowIndexOnRow ? {width:'50px','flex-shirk':'0',padding:'8px'} : {})) : {}\"\n [ngClass]=\"isColRender ? (header.ngClass || {}) : {}\">\n @if (header.hasCheckbox) {\n @if (header.hasCheckboxAll) {\n <div class=\"flex h-full {{ header.checkboxAllClassInclude || 'mr-[16px]' }}\"\n [class.items-center]=\"header.checkboxAlignCenter\">\n <libs_ui-components-checkbox-single [key]=\"'all'\"\n [stillOtherOptions]=\"!!keysSelected().length && keysSelected().length !== items().length\"\n [checked]=\"!!keysSelected().length && keysSelected().length === items().length\"\n [disable]=\"loading()\"\n [classInclude]=\"header.checkboxClassInclude\"\n (outChange)=\"handlerChangeCheckedAllItems($event)\" />\n </div>\n } @else {\n <div class=\"flex h-full ml-[24px] {{ header.checkboxClassInclude }}\">\n </div>\n }\n }\n @for (tooltip of header.tooltipsLeft; track tooltip) {\n <div class=\"mr-[4px]\">\n <libs_ui-components-popover [type]=\"tooltip?.type || 'other'\"\n [mode]=\"tooltip?.mode || 'hover'\"\n [classInclude]=\"tooltip.classInclude || 'text-[#6a7383]'\"\n [ignoreShowPopover]=\"tooltip.ignoreShowTooltip || false\"\n [config]=\"tooltip.config || {content:(tooltip.dataView || ' ') | translate, position: {\n mode: 'center',\n distance: 0,\n autoUpdatePosition: {\n endDistance: 12,\n startDistance: -12\n }\n }}\"\n [innerHTML]=\"tooltip.dataView\" />\n </div>\n }\n\n @if (header.isShowIndexOnRow) {\n <div class=\"flex w-full h-full items-center justify-center {{ header.classIncludeIndexOnRow || '' }}\">\n {{ header.label ?? '#' }}\n </div>\n } @else {\n @if ((header.label | LibsUiPipesCallFunctionInTemplatePipe:header.parseValue:header) | async | translate; as labelHeaderColumn) {\n <libs_ui-components-popover [type]=\"header?.labelConfig?.type || 'text'\"\n [mode]=\"header?.labelConfig?.mode || 'hover'\"\n [classInclude]=\"(header?.labelConfig?.classInclude || '')\"\n [ignoreShowPopover]=\"header?.labelConfig?.ignoreShowTooltip || false\"\n [config]=\"header.labelConfig?.config || {content:labelHeaderColumn}\"\n [innerHTML]=\"labelHeaderColumn\" />\n }\n }\n\n @for (tooltip of header.tooltipsRight; track tooltip) {\n <div class=\"ml-[4px]\">\n <libs_ui-components-popover [type]=\"tooltip?.type || 'other'\"\n [mode]=\"tooltip?.mode || 'hover'\"\n [classInclude]=\"tooltip.classInclude || 'text-[#6a7383]'\"\n [ignoreShowPopover]=\"tooltip.ignoreShowTooltip || false\"\n [config]=\"tooltip.config || {content:(tooltip.dataView || ' ') | translate, position: {\n mode: 'center',\n distance: 0,\n autoUpdatePosition: {\n endDistance: 12,\n startDistance: -12\n }\n }}\"\n [innerHTML]=\"tooltip.dataView\" />\n </div>\n }\n\n @if (header.hasSort && header.orderby) {\n <div class=\"ml-[4px]\">\n <libs_ui-components-buttons-sort-arrow [disable]=\"loading() || !items().length\"\n [fieldSort]=\"header.orderby\"\n [ignorePopoverContent]=\"header.sortIgnoreTooltipContent ?? true\"\n [popoverContentAsc]=\"header.sortTooltipContentAsc\"\n [popoverContentDesc]=\"header.sortTooltipContentDesc\"\n [defaultMode]=\"header.defaultMode\"\n [zIndex]=\"header.zIndexTooltipSort\"\n (outChange)=\"handlerChangeSort($event)\" />\n </div>\n }\n </div>\n @if (header.labelDescription) {\n <div class=\"flex\">\n <libs_ui-components-popover [type]=\"'text'\"\n [classInclude]=\"header.labelDescription.classInclude || ''\"\n [config]=\"{content: header.labelDescription.content | translate}\"\n [innerHTML]=\"header.labelDescription.content | translate\" />\n </div>\n }\n</ng-template>\n\n<ng-template #templateBodyRef\n let-header='header'\n let-data='data'>\n <div class=\"flex w-full h-full\">\n @if (header.hasCheckbox) {\n <div class=\"flex h-full\"\n [class.invisible]=\"header.checkConditionCheckBoxHidden &&( data() | LibsUiPipesCallFunctionInTemplatePipe:header.checkConditionCheckBoxHidden:data() | async)\"\n [class.items-center]=\"header.checkboxAlignCenter\">\n <libs_ui-components-checkbox-single [key]=\"data()[fieldKey()]\"\n [classInclude]=\"header.checkboxClassInclude\"\n [checked]=\"data()[fieldKey()] | LibsUiPipesCheckSelectedByKeyPipe:keysSelected():keysSelected().length\"\n [disable]=\"loading() || disableCheckbox() || !!(maxItemSelected() && !(data()[fieldKey()] | LibsUiPipesCheckSelectedByKeyPipe:keysSelected():keysSelected().length) && keysSelected().length >= maxItemSelected())\"\n (outChange)=\"handlerChangeItemChecked($event,data())\" />\n </div>\n }\n\n @if (header.isShowIndexOnRow; as config) {\n <div class=\"w-full flex items-center justify-center libs-ui-font-h4r{{ config.classIncludeIndexOnRow || '' }}\">\n <div LibsUiComponentsPopoverDirective\n [type]=\"'text'\"\n [config]=\"{}\"\n [innerHTML]=\"data | LibsUiPipesCallFunctionInTemplatePipe:getIndexRow | async\">\n </div>\n </div>\n }\n\n @if (header.colTemplateConfig) {\n <libs_ui-components-table-templates [isHover]=\"itemOfIndexHover === data && !data.specificHightLight\"\n [class]=\"header.templateCssWrapperHost || ''\"\n [item]=\"data\"\n [templateCssWrapper]=\"header.templateCssWrapper\"\n [configs]=\"header.colTemplateConfig\" />\n }\n </div>\n</ng-template>\n\n<ng-template #templateFooterRef>\n @if (!isHiddenHeaderWhenNodata() || (isHiddenHeaderWhenNodata() && items().length)) {\n <div #footerElementRef\n class=\"flex w-full bg-[#f8f9fa] overflow-x-hidden z-[1] {{ ignoreBorderFooter() ? '': (customPositionFooter() === 'top' ? 'libs-ui-border-bottom-general':'libs-ui-table-shadow-top libs-ui-border-top-general') }} min-h-[35px]\"\n (mouseenter)=\"handlerMouseEnterFooter($event)\"\n (mouseleave)=\"handlerMouseLeaveFooter($event)\">\n @if (footerLeft()) {\n <div #footerLeftElementRef\n class=\"flex sticky top-0 left-0 z-[1] bg-[#f8f9fa]\">\n @for (footer of footerLeft();track footer) {\n <div\n class=\"flex items-center px-[12px] py-[8px] {{ footer.ignoreBorderRight ? '': 'libs-ui-border-right-general' }}\"\n [ngStyle]=\"(footer|LibsUiTableCalculatorColumnPipe:headerElementRef.clientWidth:footerLeft():footerRight()) || {}\"\n [ngClass]=\"footer.ngClass || {}\">\n @if (footer.colTemplateConfig && itemFooter()) {\n <libs_ui-components-table-templates [item]=\"itemFooter|LibsUiPipesConvertObjectToSignalPipe\"\n [templateCssWrapper]=\"footer.templateCssWrapper\"\n [configs]=\"footer.colTemplateConfig\" />\n }\n </div>\n }\n </div>\n }\n @if (footerRight()) {\n @for (footer of footerRight();track footer) {\n <div class=\"flex items-center px-[12px] py-[8px]\"\n [ngStyle]=\"(footer|LibsUiTableCalculatorColumnPipe:headerElementRef.clientWidth:footerLeft():footerRight()) || {}\"\n [ngClass]=\"footer.ngClass || {}\">\n @if (footer.colTemplateConfig && itemFooter()) {\n <libs_ui-components-table-templates [item]=\"itemFooter|LibsUiPipesConvertObjectToSignalPipe\"\n [templateCssWrapper]=\"footer.templateCssWrapper\"\n [configs]=\"footer.colTemplateConfig\" />\n }\n </div>\n }\n }\n\n </div>\n }\n</ng-template>\n\n<ng-template #templateNodataRef>\n @if (!keySearch() && templateNoData(); as templateNoData) {\n <ng-container *ngTemplateOutlet=\"templateNoData\" />\n } @if (keySearch() && templateNoResult(); as templateNoResult) {\n <ng-container *ngTemplateOutlet=\"templateNoResult\" />\n }\n @if (!templateNoData() && !templateNoResult() && noDataConfig(); as config) {\n <div class=\"flex items-center justify-center w-full h-full absolute left-0 top-0 z-[1]\">\n <div class=\"flex flex-col items-center justify-center w-full h-full shrink-0\"\n LibsUiComponentsScrollOverlayDirective>\n @if (!keySearch() && !onlyShowNoResult()) {\n <ng-container *ngComponentOutlet=\" ('no-data' | LibsUiIconsGetIconComponentPipe | async);inputs:{size:64}\" />\n <div class=\"libs-ui-table-no-data-config-text\"\n [ngStyle]=\"config.ngStyle || {}\"\n [ngClass]=\"config.ngClass || {}\"\n [innerHtml]=\"config.textNoData | translate\">\n </div>\n }\n @if (keySearch() || onlyShowNoResult()) {\n <ng-container *ngComponentOutlet=\"('no-result' | LibsUiIconsGetIconComponentPipe | async);inputs:{size:64}\" />\n <div class=\"libs-ui-table-no-data-config-text\"\n [ngStyle]=\"config.ngStyle || {}\"\n [ngClass]=\"config.ngClass || {}\"\n [innerHtml]=\"config.textSearchNoData | translate\">\n </div>\n }\n </div>\n </div>\n }\n</ng-template>\n", styles: [".libs-ui-table-header-container{height:33px;flex-shrink:0}.libs-ui-table-header-col{height:100%;width:100%;align-items:center}.libs-ui-table-no-data-config-text{margin-top:16px;font-size:12px;color:#9ca2ad;font-family:var(--libs-ui-font-family-name, \"Arial\");font-weight:400}.libs-ui-table-no-data-config-icon{margin-bottom:12px}.libs-ui-table-no-data-config-icon:before{font-size:84px;color:#c1c1c1}.libs-ui-table-shadow-bottom{box-shadow:0 1px 1px #00143305,0 4px 8px #0014330a}@media only screen and (min-width: 1921px){.libs-ui-border-bottom-general{border-bottom:solid 2px #e6e8ed!important}}\n"] }]
863
887
  }], ctorParameters: () => [] });
864
888