@libs-ui/components-list 0.2.247 → 0.2.249
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/defines/list.define.d.ts +1 -1
- package/esm2022/interfaces/config-item.interface.mjs +1 -1
- package/esm2022/templates/radio/radio.component.mjs +6 -5
- package/esm2022/templates/templates.component.abstract.mjs +7 -6
- package/fesm2022/libs-ui-components-list.mjs +10 -8
- package/fesm2022/libs-ui-components-list.mjs.map +1 -1
- package/interfaces/config-item.interface.d.ts +1 -1
- package/package.json +23 -23
- package/templates/radio/radio.component.d.ts +2 -2
|
@@ -9,7 +9,7 @@ import { LibsUiDynamicComponentService } from '@libs-ui/services-dynamic-compone
|
|
|
9
9
|
import { deleteUnicode, isEmpty, convertObjectToSignal, isNil, convertSignalToObject, cloneDeep, get, escapeHtml, uuid, ERROR_MESSAGE_EMPTY_VALID, isEqual } from '@libs-ui/utils';
|
|
10
10
|
import * as i1 from '@ngx-translate/core';
|
|
11
11
|
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
|
12
|
-
import { lastValueFrom, Subject, interval, range, timer, takeUntil as takeUntil$1 } from 'rxjs';
|
|
12
|
+
import { lastValueFrom, Subject, interval, of, range, timer, takeUntil as takeUntil$1 } from 'rxjs';
|
|
13
13
|
import * as i1$1 from '@iharbeck/ngx-virtual-scroller';
|
|
14
14
|
import { VirtualScrollerComponent, VirtualScrollerModule } from '@iharbeck/ngx-virtual-scroller';
|
|
15
15
|
import { LibsUiComponentsCheckboxSingleComponent } from '@libs-ui/components-checkbox-single';
|
|
@@ -471,11 +471,11 @@ class LibsUiComponentsListTemplatesComponentAbstract {
|
|
|
471
471
|
}
|
|
472
472
|
let textSearch = item().fieldLabel || ' ';
|
|
473
473
|
const rows = convertSignalToObject(configTemplate.rows());
|
|
474
|
-
rows.forEach((row, indexRow) => {
|
|
474
|
+
rows.forEach(async (row, indexRow) => {
|
|
475
475
|
const fieldNameRow = `fieldLabelRow${indexRow}`;
|
|
476
476
|
const currentItem = cloneDeep(item());
|
|
477
477
|
const newItem = { ...currentItem };
|
|
478
|
-
newItem[fieldNameRow] = row.getValue && row.getValue(ref, item);
|
|
478
|
+
newItem[fieldNameRow] = row.getValue && row.getValue(ref, item, indexRow) || of('');
|
|
479
479
|
newItem[`fieldRowStylesDynamicCols${indexRow}`] = row.getRowStylesDynamicCols && row.getRowStylesDynamicCols(ref);
|
|
480
480
|
newItem[`fieldRowAvatarConfig${indexRow}`] = row.getAvatarConfig && row.getAvatarConfig(ref);
|
|
481
481
|
if (row.cols && row.cols.length) {
|
|
@@ -489,11 +489,12 @@ class LibsUiComponentsListTemplatesComponentAbstract {
|
|
|
489
489
|
newItem[`fieldColButton${indexRow}${indexCol}`] = col.getButton && col.getButton(ref, indexCol);
|
|
490
490
|
newItem[`fieldColSwitch${indexRow}${indexCol}`] = col.getLabelSwitch && col.getLabelSwitch(ref, indexCol);
|
|
491
491
|
newItem[`fieldColAvatarConfig${indexRow}${indexCol}`] = col.getAvatarConfig && col.getAvatarConfig(ref);
|
|
492
|
-
|
|
492
|
+
const text = col.getValue && col.getValue(ref, item, indexRow, indexCol) || of('');
|
|
493
|
+
textSearch = ` ${textSearch} ${await lastValueFrom(text) || ''} `;
|
|
493
494
|
});
|
|
494
495
|
}
|
|
495
496
|
item.update(() => newItem);
|
|
496
|
-
textSearch = ` ${textSearch} ${item()[fieldNameRow] || ''} `;
|
|
497
|
+
textSearch = ` ${textSearch} ${await lastValueFrom(item()[fieldNameRow]) || ''} `;
|
|
497
498
|
});
|
|
498
499
|
return textSearch || ' ';
|
|
499
500
|
}
|
|
@@ -1864,23 +1865,24 @@ class LibsUiComponentsListRadioComponent extends LibsUiComponentsListTemplatesCo
|
|
|
1864
1865
|
if (this.autoSelectedFirstItemCallOutsideBefore() || this.keySelected() || !this.config()?.autoSelectFirstItem || !items || !items.length) {
|
|
1865
1866
|
return;
|
|
1866
1867
|
}
|
|
1867
|
-
this.handlerChange('radio', items[0], true, false);
|
|
1868
|
+
this.handlerChange('radio', items[0]?.(), true, false);
|
|
1868
1869
|
}
|
|
1869
1870
|
emitKeySelectedDefaultIfExistItem(items) {
|
|
1870
1871
|
const item = items.find(store => store()[this.fieldKey()] === this.keySelected());
|
|
1871
1872
|
if (item) {
|
|
1872
|
-
this.handlerChange('radio', item, true, false);
|
|
1873
|
+
this.handlerChange('radio', item(), true, false);
|
|
1873
1874
|
}
|
|
1874
1875
|
}
|
|
1875
1876
|
getLengthItem() {
|
|
1876
1877
|
return this.items().length;
|
|
1877
1878
|
}
|
|
1878
1879
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListRadioComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1879
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: LibsUiComponentsListRadioComponent, isStandalone: true, selector: "libs_ui-components-list-templates_radio", viewQueries: [{ propertyName: "virtualScrollerComponent", first: true, predicate: VirtualScrollerComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (configTemplateRadio(); as configTemplateRadio) {\n <div class=\"relative h-full w-full\">\n @if (items().length) {\n <div #elementScroll\n LibsUiComponentsScrollOverlayDirective\n class=\"w-full\"\n [class.h-full]=\"!heightViewPort()\"\n [style.height]=\"heightViewPort() ? heightViewPort()+'px':'100%'\"\n (outScrollBottom)=\"handlerScrollBottom()\">\n <virtual-scroller #scroll\n [parentScroll]=\"elementScroll\"\n [items]=\"items()\"\n class=\"h-full\">\n @for (item of scroll.viewPortItems; track item()[fieldKey()]) {\n <div #itemRef\n [class]=\"'libs-ui-list-template-radio-item libs-ui-font-h5r flex ' + (configTemplateRadio.classItemInclude || '')\"\n [class.libs-ui-bg-list-hover]=\"!clickExactly()\"\n [class.libs-ui-bg-list-hover-active]=\"!clickExactly()\"\n [class.!pl-[12px]]=\"paddingLeftItem()\"\n [class.bg-[#ffffff]]=\"clickExactly()\"\n [class.!py-[2px]]=\"clickExactly()\"\n (click)=\"handlerChange($event,item())\">\n <div class=\"flex flex-col w-full\">\n @if (item().fieldLabel) {\n <libs_ui-components-radio-single [label]=\"item().fieldLabel\"\n [avatarConfig]=\"item().avatarConfig\"\n [active]=\"keySelected() === item()[fieldKey()]\"\n [key]=\"item()[fieldKey()]\"\n [imgTypeIcon]=\"configTemplateRadio.hasAvatarGroupSocial\"\n [linkImage]=\"configTemplateRadio.getImage ? (('avatar' | LibsUiPipesCallFunctionInTemplatePipe:(item().specific_loadImgError && configTemplateRadio.getImageError ? configTemplateRadio.getImageError : configTemplateRadio.getImage):item()) | async) : item()[configTemplateRadio.fieldGetImage || '']\"\n [classImageInclude]=\"configTemplateRadio.classIncludeImage || ''\"\n [bullet]=\"item().bullet?.()\"\n [disable]=\"loading() || disable() || (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length)\"\n [classLabelInclude]=\"item().classLabelInclude || ''\"\n [popover]=\"(item().popoverLabel|LibsUiPipesConvertObjectToSignalPipe)?.() | LibsUiPipesConvertSignalToObjectPipe\"\n [clickExactly]=\"clickExactly()\"\n [disableLabel]=\"disableLabel()\"\n [dataComponentOutlet]=\"(undefined | LibsUiPipesCallFunctionInTemplatePipe:configTemplateRadio.getDataComponentOutlet:item():fieldKey():{valueIsEmpty:{item:item()}}) | async\"\n [componentOutlet]=\"(0 | LibsUiPipesCallFunctionInTemplatePipe:configTemplateRadio.getComponentOutlet:item():fieldKey():{valueIs0:0}) | async\"\n [zIndexLabel]=\"configTemplateRadio.zIndexPopover ?? 1200\"\n (outChangStageFlagMousePopover)='handlerChangStageFlagMouse($event)'\n (outChange)=\"handlerChange('radio',item())\"\n (outClickLabel)=\"handlerChange('radio',item())\" />\n }\n @if (configTemplateRadio?.rows?.()) {\n <libs_ui-components-list-templates_rows class=\"w-full {{ configTemplateRadio.classRows ?? '' }}\"\n [item]=\"item()\"\n [fieldKey]=\"fieldKey()\"\n [keySelected]=\"keySelected()\"\n [configTemplate]=\"configTemplateRadio\"\n (outEvent)=\"handlerChange('radio',$event.item)\" />\n }\n </div>\n </div>\n }\n </virtual-scroller>\n </div>\n }\n @if (!items().length) {\n <div [class]=\"'libs-ui-font-h4r text-[#c1c1c1] '+ (config()?.textNoDataClassInclude ?? 'py-[4px] px-[12px]')\">\n @if (!keySearch() && !loading()) {\n <span>{{ (config()?.textNoData ?? 'i18n_have_no_selection') | translate }}</span>\n }\n @if (templateRefSearchNoData() && keySearch() && !loading()) {\n <ng-container *ngTemplateOutlet=\"templateRefSearchNoData() || null;context:{keySearch:keySearch()}\" />\n }\n @if (!templateRefSearchNoData() && keySearch() && !loading()) {\n <span>{{ (config()?.textSearchNoData ?? 'i18n_no_result') | translate }}</span>\n }\n @if (loading()) {\n <span> </span>\n }\n </div>\n }\n\n @if (loading()) {\n <libs_ui-components-spinner [size]=\"'medium'\" />\n }\n </div>\n}\n", styles: [".libs-ui-list-template-radio-item{padding:6px 16px;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: VirtualScrollerModule }, { kind: "component", type: i1$1.VirtualScrollerComponent, selector: "virtual-scroller,[virtualScroller]", inputs: ["executeRefreshOutsideAngularZone", "enableUnequalChildrenSizes", "RTL", "useMarginInsteadOfTranslate", "modifyOverflowStyleOfParentScroll", "stripedTable", "scrollbarWidth", "scrollbarHeight", "childWidth", "childHeight", "ssrChildWidth", "ssrChildHeight", "ssrViewportWidth", "ssrViewportHeight", "bufferAmount", "scrollAnimationTime", "resizeBypassRefreshThreshold", "scrollThrottlingTime", "scrollDebounceTime", "checkResizeInterval", "items", "compareItems", "horizontal", "parentScroll"], outputs: ["vsUpdate", "vsChange", "vsStart", "vsEnd"], exportAs: ["virtualScroller"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "component", type: LibsUiComponentsSpinnerComponent, selector: "libs_ui-components-spinner", inputs: ["type", "size"] }, { kind: "directive", type: LibsUiComponentsScrollOverlayDirective, selector: "[LibsUiComponentsScrollOverlayDirective]", inputs: ["debugMode", "ignoreInit", "classContainer", "options", "elementCheckScrollX", "elementCheckScrollY", "elementScroll"], outputs: ["outScroll", "outScrollX", "outScrollY", "outScrollTop", "outScrollBottom"] }, { kind: "component", type: LibsUiComponentsRadioSingleComponent, selector: "libs_ui-components-radio-single", inputs: ["key", "active", "classInclude", "label", "labelInterpolateParams", "ignorePopoverLabel", "classLabelInclude", "linkImage", "linkImageError", "avatarConfig", "classImageInclude", "imgTypeIcon", "bullet", "popover", "disable", "disableLabel", "clickExactly", "typeRadio", "ignoreRadio", "zIndexLabel", "classIncludeIcon", "dataComponentOutlet", "componentOutlet"], outputs: ["activeChange", "outClickLabel", "outChange", "outChangStageFlagMousePopover"] }, { kind: "pipe", type: LibsUiPipesCallFunctionInTemplatePipe, name: "LibsUiPipesCallFunctionInTemplatePipe" }, { kind: "pipe", type: LibsUiCheckSelectedByKeyPipe, name: "LibsUiCheckSelectedByKeyPipe" }, { kind: "component", type: LibsUiComponentsListRowsComponent, selector: "libs_ui-components-list-templates_rows", inputs: ["configTemplate", "item", "keySelected", "fieldKey", "zIndex"], outputs: ["outChangStageFlagMousePopover", "outEvent"] }, { kind: "pipe", type: LibsUiPipesConvertObjectToSignalPipe, name: "LibsUiPipesConvertObjectToSignalPipe" }, { kind: "pipe", type: LibsUiPipesConvertSignalToObjectPipe, name: "LibsUiPipesConvertSignalToObjectPipe" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1880
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: LibsUiComponentsListRadioComponent, isStandalone: true, selector: "libs_ui-components-list-templates_radio", viewQueries: [{ propertyName: "virtualScrollerComponent", first: true, predicate: VirtualScrollerComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (configTemplateRadio(); as configTemplateRadio) {\n <div class=\"relative h-full w-full\">\n @if (items().length) {\n <div #elementScroll\n LibsUiComponentsScrollOverlayDirective\n class=\"w-full\"\n [class.h-full]=\"!heightViewPort()\"\n [style.height]=\"heightViewPort() ? heightViewPort()+'px':'100%'\"\n (outScrollBottom)=\"handlerScrollBottom()\">\n <virtual-scroller #scroll\n [parentScroll]=\"elementScroll\"\n [items]=\"items()\"\n class=\"h-full\">\n @for (item of scroll.viewPortItems; track item()[fieldKey()]) {\n <div #itemRef\n [class]=\"'libs-ui-list-template-radio-item libs-ui-font-h5r flex ' + (configTemplateRadio.classItemInclude || '')\"\n [class.libs-ui-bg-list-hover]=\"!clickExactly()\"\n [class.libs-ui-bg-list-hover-active]=\"!clickExactly()\"\n [class.!pl-[12px]]=\"paddingLeftItem()\"\n [class.bg-[#ffffff]]=\"clickExactly()\"\n [class.!py-[2px]]=\"clickExactly()\"\n (click)=\"handlerChange($event,item())\">\n <div class=\"flex flex-col w-full\">\n @if (item().fieldLabel) {\n <libs_ui-components-radio-single [label]=\"item().fieldLabel\"\n [avatarConfig]=\"item().avatarConfig\"\n [active]=\"keySelected() === item()[fieldKey()]\"\n [key]=\"item()[fieldKey()]\"\n [imgTypeIcon]=\"configTemplateRadio.hasAvatarGroupSocial\"\n [linkImage]=\"configTemplateRadio.getImage ? (('avatar' | LibsUiPipesCallFunctionInTemplatePipe:(item().specific_loadImgError && configTemplateRadio.getImageError ? configTemplateRadio.getImageError : configTemplateRadio.getImage):item()) | async) : item()[configTemplateRadio.fieldGetImage || '']\"\n [classImageInclude]=\"configTemplateRadio.classIncludeImage || ''\"\n [bullet]=\"item().bullet?.()\"\n [disable]=\"loading() || disable() || (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length)\"\n [classLabelInclude]=\"item().classLabelInclude || ''\"\n [popover]=\"(item().popoverLabel|LibsUiPipesConvertObjectToSignalPipe)?.() | LibsUiPipesConvertSignalToObjectPipe\"\n [clickExactly]=\"clickExactly()\"\n [disableLabel]=\"disableLabel()\"\n [dataComponentOutlet]=\"(undefined | LibsUiPipesCallFunctionInTemplatePipe:configTemplateRadio.getDataComponentOutlet:item():fieldKey():{valueIsEmpty:{item:item()}}) | async\"\n [componentOutlet]=\"(0 | LibsUiPipesCallFunctionInTemplatePipe:configTemplateRadio.getComponentOutlet:item():fieldKey():{valueIs0:0}) | async\"\n [zIndexLabel]=\"configTemplateRadio.zIndexPopover ?? 1200\"\n (outChangStageFlagMousePopover)='handlerChangStageFlagMouse($event)'\n (outChange)=\"handlerChange('radio',item())\"\n (outClickLabel)=\"handlerChange('radio',item())\" />\n }\n @if (configTemplateRadio?.rows?.()) {\n <libs_ui-components-list-templates_rows class=\"w-full {{ configTemplateRadio.classRows ?? '' }}\"\n [item]=\"item()\"\n [fieldKey]=\"fieldKey()\"\n [keySelected]=\"keySelected()\"\n [configTemplate]=\"configTemplateRadio\"\n (outEvent)=\"handlerChange('radio',$event.item)\" />\n }\n </div>\n </div>\n }\n </virtual-scroller>\n </div>\n }\n @if (!items().length) {\n <div [class]=\"'libs-ui-font-h4r text-[#c1c1c1] '+ (config()?.textNoDataClassInclude ?? 'py-[4px] px-[12px]')\">\n @if (!keySearch() && !loading()) {\n <span>{{ (config()?.textNoData ?? 'i18n_have_no_selection') | translate }}</span>\n }\n @if (templateRefSearchNoData() && keySearch() && !loading()) {\n <ng-container *ngTemplateOutlet=\"templateRefSearchNoData() || null;context:{keySearch:keySearch()}\" />\n }\n @if (!templateRefSearchNoData() && keySearch() && !loading()) {\n <span>{{ (config()?.textSearchNoData ?? 'i18n_no_result') | translate }}</span>\n }\n @if (loading()) {\n <span> </span>\n }\n </div>\n }\n\n @if (loading()) {\n <libs_ui-components-spinner [size]=\"'medium'\" />\n }\n </div>\n}\n", styles: [".libs-ui-list-template-radio-item{padding:6px 16px;position:relative}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: VirtualScrollerModule }, { kind: "component", type: i1$1.VirtualScrollerComponent, selector: "virtual-scroller,[virtualScroller]", inputs: ["executeRefreshOutsideAngularZone", "enableUnequalChildrenSizes", "RTL", "useMarginInsteadOfTranslate", "modifyOverflowStyleOfParentScroll", "stripedTable", "scrollbarWidth", "scrollbarHeight", "childWidth", "childHeight", "ssrChildWidth", "ssrChildHeight", "ssrViewportWidth", "ssrViewportHeight", "bufferAmount", "scrollAnimationTime", "resizeBypassRefreshThreshold", "scrollThrottlingTime", "scrollDebounceTime", "checkResizeInterval", "items", "compareItems", "horizontal", "parentScroll"], outputs: ["vsUpdate", "vsChange", "vsStart", "vsEnd"], exportAs: ["virtualScroller"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "component", type: LibsUiComponentsSpinnerComponent, selector: "libs_ui-components-spinner", inputs: ["type", "size"] }, { kind: "directive", type: LibsUiComponentsScrollOverlayDirective, selector: "[LibsUiComponentsScrollOverlayDirective]", inputs: ["debugMode", "ignoreInit", "classContainer", "options", "elementCheckScrollX", "elementCheckScrollY", "elementScroll"], outputs: ["outScroll", "outScrollX", "outScrollY", "outScrollTop", "outScrollBottom"] }, { kind: "component", type: LibsUiComponentsRadioSingleComponent, selector: "libs_ui-components-radio-single", inputs: ["key", "active", "classInclude", "label", "labelInterpolateParams", "ignorePopoverLabel", "classLabelInclude", "linkImage", "linkImageError", "avatarConfig", "classImageInclude", "imgTypeIcon", "bullet", "popover", "disable", "disableLabel", "clickExactly", "typeRadio", "ignoreRadio", "zIndexLabel", "classIncludeIcon", "dataComponentOutlet", "componentOutlet"], outputs: ["activeChange", "outClickLabel", "outChange", "outChangStageFlagMousePopover"] }, { kind: "pipe", type: LibsUiPipesCallFunctionInTemplatePipe, name: "LibsUiPipesCallFunctionInTemplatePipe" }, { kind: "pipe", type: LibsUiCheckSelectedByKeyPipe, name: "LibsUiCheckSelectedByKeyPipe" }, { kind: "component", type: LibsUiComponentsListRowsComponent, selector: "libs_ui-components-list-templates_rows", inputs: ["configTemplate", "item", "keySelected", "fieldKey", "zIndex"], outputs: ["outChangStageFlagMousePopover", "outEvent"] }, { kind: "pipe", type: LibsUiPipesConvertObjectToSignalPipe, name: "LibsUiPipesConvertObjectToSignalPipe" }, { kind: "pipe", type: LibsUiPipesConvertSignalToObjectPipe, name: "LibsUiPipesConvertSignalToObjectPipe" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1880
1881
|
}
|
|
1881
1882
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListRadioComponent, decorators: [{
|
|
1882
1883
|
type: Component,
|
|
1883
1884
|
args: [{ selector: 'libs_ui-components-list-templates_radio', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
1885
|
+
NgTemplateOutlet,
|
|
1884
1886
|
VirtualScrollerModule, AsyncPipe, TranslateModule,
|
|
1885
1887
|
LibsUiComponentsSpinnerComponent,
|
|
1886
1888
|
LibsUiComponentsScrollOverlayDirective,
|