@vallift/ngl 0.0.3 → 0.0.4
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/components/listview/listview.component.d.ts +21 -0
- package/fesm2022/vallift-ngl.mjs +63 -1
- package/fesm2022/vallift-ngl.mjs.map +1 -1
- package/inputs/_base/base-input/base-input.component.d.ts +1 -1
- package/inputs/text-area-input/text-area-input.component.d.ts +1 -1
- package/inputs/text-input/text-input.component.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AfterViewInit, Type } from '@angular/core';
|
|
2
|
+
import { PaginationState } from '../../base/base-pagination-state';
|
|
3
|
+
import { TableActionEvent, TableStateEvent } from '../data-table/data-table.component';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class ListviewComponent implements AfterViewInit {
|
|
6
|
+
state: import("@angular/core").InputSignal<PaginationState<any>>;
|
|
7
|
+
data: import("@angular/core").InputSignal<any>;
|
|
8
|
+
pageSize: import("@angular/core").InputSignal<number>;
|
|
9
|
+
component: import("@angular/core").InputSignal<Type<any>>;
|
|
10
|
+
enableSearch: import("@angular/core").InputSignal<boolean>;
|
|
11
|
+
enableSearchFullWidth: import("@angular/core").InputSignal<boolean>;
|
|
12
|
+
onStateChanged: import("@angular/core").OutputEmitterRef<TableStateEvent>;
|
|
13
|
+
onActionPerformed: import("@angular/core").OutputEmitterRef<TableActionEvent>;
|
|
14
|
+
private searchText;
|
|
15
|
+
ngAfterViewInit(): void;
|
|
16
|
+
onSearchTextChanged($event: string): void;
|
|
17
|
+
onScroll(): void;
|
|
18
|
+
onRowAction($event: TableActionEvent): void;
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ListviewComponent, never>;
|
|
20
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ListviewComponent, "app-listview", never, { "state": { "alias": "state"; "required": true; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "component": { "alias": "component"; "required": true; "isSignal": true; }; "enableSearch": { "alias": "enableSearch"; "required": false; "isSignal": true; }; "enableSearchFullWidth": { "alias": "enableSearchFullWidth"; "required": false; "isSignal": true; }; }, { "onStateChanged": "onStateChanged"; "onActionPerformed": "onActionPerformed"; }, never, never, true, never>;
|
|
21
|
+
}
|
package/fesm2022/vallift-ngl.mjs
CHANGED
|
@@ -14,6 +14,7 @@ import { NgClass, DOCUMENT, CommonModule, DatePipe, NgStyle } from '@angular/com
|
|
|
14
14
|
import { SvgIconComponent } from 'angular-svg-icon';
|
|
15
15
|
import { CdkPortal } from '@angular/cdk/portal';
|
|
16
16
|
import { NgxMaskDirective } from 'ngx-mask';
|
|
17
|
+
import { InfiniteScrollDirective } from 'ngx-infinite-scroll';
|
|
17
18
|
import * as i2 from '@angular/platform-browser';
|
|
18
19
|
import { isValidDate } from 'rxjs/internal/util/isDate';
|
|
19
20
|
|
|
@@ -2228,6 +2229,67 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
2228
2229
|
args: [{ selector: 'app-env-banner', standalone: true, imports: [], template: "@if(config.enableDevTools) {\n <div\n class=\"banner fixed top-6 left-0 bg-black bg-opacity-80 text-xs text-white transform -rotate-45 translate-y-1/4 -translate-x-1/4 w-36 text-center px-1 py-1\">\n DEV\n </div>\n}\n", styles: [".banner{z-index:10000}\n"] }]
|
|
2229
2230
|
}] });
|
|
2230
2231
|
|
|
2232
|
+
class ListviewComponent {
|
|
2233
|
+
state = input.required();
|
|
2234
|
+
data = input();
|
|
2235
|
+
pageSize = input(20);
|
|
2236
|
+
component = input.required();
|
|
2237
|
+
enableSearch = input(true);
|
|
2238
|
+
enableSearchFullWidth = input(true);
|
|
2239
|
+
onStateChanged = output();
|
|
2240
|
+
onActionPerformed = output();
|
|
2241
|
+
searchText = '';
|
|
2242
|
+
ngAfterViewInit() {
|
|
2243
|
+
let paginationEvent = {
|
|
2244
|
+
pageNumber: 1, pageSize: this.pageSize()
|
|
2245
|
+
};
|
|
2246
|
+
let state = {
|
|
2247
|
+
searchText: '',
|
|
2248
|
+
paginationEvent: paginationEvent,
|
|
2249
|
+
};
|
|
2250
|
+
console.log('update state');
|
|
2251
|
+
this.onStateChanged.emit(state);
|
|
2252
|
+
}
|
|
2253
|
+
onSearchTextChanged($event) {
|
|
2254
|
+
this.state().clearState();
|
|
2255
|
+
this.searchText = $event;
|
|
2256
|
+
let paginationEvent = {
|
|
2257
|
+
pageNumber: 1, pageSize: this.pageSize()
|
|
2258
|
+
};
|
|
2259
|
+
let tableStateEvent = {
|
|
2260
|
+
searchText: this.searchText,
|
|
2261
|
+
paginationEvent: paginationEvent,
|
|
2262
|
+
};
|
|
2263
|
+
this.onStateChanged.emit(tableStateEvent);
|
|
2264
|
+
}
|
|
2265
|
+
onScroll() {
|
|
2266
|
+
let nextPage = this.state().pageNumber() + 1;
|
|
2267
|
+
let paginationEvent = {
|
|
2268
|
+
pageNumber: nextPage, pageSize: this.pageSize()
|
|
2269
|
+
};
|
|
2270
|
+
let tableStateEvent = {
|
|
2271
|
+
searchText: this.searchText,
|
|
2272
|
+
paginationEvent: paginationEvent,
|
|
2273
|
+
};
|
|
2274
|
+
this.onStateChanged.emit(tableStateEvent);
|
|
2275
|
+
}
|
|
2276
|
+
onRowAction($event) {
|
|
2277
|
+
this.onActionPerformed.emit($event);
|
|
2278
|
+
}
|
|
2279
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ListviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2280
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.7", type: ListviewComponent, isStandalone: true, selector: "app-listview", inputs: { state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: true, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, component: { classPropertyName: "component", publicName: "component", isSignal: true, isRequired: true, transformFunction: null }, enableSearch: { classPropertyName: "enableSearch", publicName: "enableSearch", isSignal: true, isRequired: false, transformFunction: null }, enableSearchFullWidth: { classPropertyName: "enableSearchFullWidth", publicName: "enableSearchFullWidth", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onStateChanged: "onStateChanged", onActionPerformed: "onActionPerformed" }, ngImport: i0, template: "<div class=\"h-full flex flex-col gap-4\">\n\n @if (enableSearch()) {\n <app-text-input\n title=\"Search...\"\n [iconSrc]=\"'assets/icons/search.svg'\"\n placeholder=\"Search...\"\n type=\"search\"\n [fullWidth]=\"enableSearchFullWidth()\"\n (changeValue)=\"onSearchTextChanged($event)\">\n </app-text-input>\n }\n\n @if (state().success() && state().items().length <= 0) {\n <div class=\"flex flex-col justify-center items-center gap-8 px-6 py-8\">\n <app-no-data-table></app-no-data-table>\n </div>\n }\n\n @if (state().items().length > 0) {\n <div class=\"flex flex-col overflow-auto\"\n infiniteScroll\n [infiniteScrollDistance]=\"2\"\n [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\">\n @for (item of state().items(); track $index) {\n <app-dynamic-renderer\n [component]=\"component()\"\n [rowData]=\"item\"\n [data]=\"data()\"\n [rowPosition]=\"$index\"\n [isLastRow]=\"$last\"\n (actionPerformed)=\"onRowAction($event)\">\n </app-dynamic-renderer>\n }\n </div>\n }\n\n <!-- Shimmer-->\n @if (state().loading()) {\n <div class=\"flex flex-col gap-6 py-4\">\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n </div>\n }\n\n\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: InfiniteScrollDirective, selector: "[infiniteScroll], [infinite-scroll], [data-infinite-scroll]", inputs: ["infiniteScrollDistance", "infiniteScrollUpDistance", "infiniteScrollThrottle", "infiniteScrollDisabled", "infiniteScrollContainer", "scrollWindow", "immediateCheck", "horizontal", "alwaysCallback", "fromRoot"], outputs: ["scrolled", "scrolledUp"] }, { kind: "component", type: TextInputComponent, selector: "app-text-input", inputs: ["appearance", "type", "viewType", "iconSrc", "actionIcon", "label", "fullWidth", "placeholder", "errorMessages", "showErrorSpace", "mask", "debounceSearchEnabled"], outputs: ["changeValue", "actionIconClicked"] }, { kind: "component", type: DynamicRendererComponent, selector: "app-dynamic-renderer", inputs: ["component", "rowData", "data", "rowPosition", "isLastRow"], outputs: ["actionPerformed"] }, { kind: "component", type: ShimmerComponent, selector: "app-shimmer", inputs: ["type", "count"] }, { kind: "component", type: NoDataTableComponent, selector: "app-no-data-table", inputs: ["message"] }] });
|
|
2281
|
+
}
|
|
2282
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ListviewComponent, decorators: [{
|
|
2283
|
+
type: Component,
|
|
2284
|
+
args: [{ selector: 'app-listview', imports: [
|
|
2285
|
+
InfiniteScrollDirective,
|
|
2286
|
+
TextInputComponent,
|
|
2287
|
+
DynamicRendererComponent,
|
|
2288
|
+
ShimmerComponent,
|
|
2289
|
+
NoDataTableComponent,
|
|
2290
|
+
], standalone: true, template: "<div class=\"h-full flex flex-col gap-4\">\n\n @if (enableSearch()) {\n <app-text-input\n title=\"Search...\"\n [iconSrc]=\"'assets/icons/search.svg'\"\n placeholder=\"Search...\"\n type=\"search\"\n [fullWidth]=\"enableSearchFullWidth()\"\n (changeValue)=\"onSearchTextChanged($event)\">\n </app-text-input>\n }\n\n @if (state().success() && state().items().length <= 0) {\n <div class=\"flex flex-col justify-center items-center gap-8 px-6 py-8\">\n <app-no-data-table></app-no-data-table>\n </div>\n }\n\n @if (state().items().length > 0) {\n <div class=\"flex flex-col overflow-auto\"\n infiniteScroll\n [infiniteScrollDistance]=\"2\"\n [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\">\n @for (item of state().items(); track $index) {\n <app-dynamic-renderer\n [component]=\"component()\"\n [rowData]=\"item\"\n [data]=\"data()\"\n [rowPosition]=\"$index\"\n [isLastRow]=\"$last\"\n (actionPerformed)=\"onRowAction($event)\">\n </app-dynamic-renderer>\n }\n </div>\n }\n\n <!-- Shimmer-->\n @if (state().loading()) {\n <div class=\"flex flex-col gap-6 py-4\">\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n </div>\n }\n\n\n</div>\n" }]
|
|
2291
|
+
}] });
|
|
2292
|
+
|
|
2231
2293
|
class LoaderService {
|
|
2232
2294
|
loadingCount = signal(0);
|
|
2233
2295
|
show() {
|
|
@@ -5499,5 +5561,5 @@ function provideNglConfig(config) {
|
|
|
5499
5561
|
* Generated bundle index. Do not edit.
|
|
5500
5562
|
*/
|
|
5501
5563
|
|
|
5502
|
-
export { AlertDialogComponent, AppErrorComponent, AppSvgIconComponent, BaseApiService, BaseControlValueAccessor, BaseControlValueAccessorV2, BaseControlValueAccessorV3, BaseInputComponent, BaseOverlayComponent, BaseTableComponent, BreadcrumbComponent, ButtonComponent, CheckboxComponent, ClickOutsideDirective, CloseButtonComponent, ContextMenuButtonComponent, ContextMenuIconComponent, DataTableComponent, DateInputComponent, DatePickerComponent, DatePickerOverlayComponent, DateRangePickerComponent, DateUtils, DropdownComponent, DynamicRendererComponent, EnvBannerComponent, FORM_ERRORS, FileUploaderComponent, FormValidationUtils, HumanizeFormMessagesPipe, InputDateFormat, InvalidControlScrollContainerDirective, InvalidControlScrollDirective, InvalidTokenError, LoaderComponent, LoaderService, MultiSelectDropdownAppearance, MultiSelectDropdownComponent, MultiSelectionFieldComponent, NGL_CONFIG, NetworkImageComponent, NglService, NoDataComponent, NoDataTableComponent, NumberInputComponent, OverlayContextMenuComponent, OverlayService, OverlayWizardUtils, PaginationComponent, PaginationState, PhoneNumberInputComponent, RadioButtonComponent, RequestState, ResizableColumnDirective, ResponsiveHelperComponent, SharedConstants, ShimmerComponent, SingleItemPickerInputComponent, SingleSelectionFieldComponent, SortableTableDirective, SpinnerComponent, State, StatusBadgeComponent, SvgUrlIconComponent, SwitchComponent, TableCustomComponent, TableResizableColumnsDirective, TemplateResolverArrayUtil, TemplateResolverFormat, TextAreaInputComponent, TextInputComponent, TimePickerComponent, ToastComponent, ToastService, ToasterComponent, TooltipComponent, UnsavedAwareDirective, arrayToCSV, arrayToSeparator, arrayToSpaceSeparator, deepEqual, defaultErrors, getDynamicTypeStructure, isDynamicType, isValid, jsonEqual, jwtDecode, mmddyyyyDateValidatorAsync, onlyFutureDateValidator, onlyPastDateValidator, openLink, printInvalidFields, provideNglConfig, resolveTemplateWithObject, toSentenceCase };
|
|
5564
|
+
export { AlertDialogComponent, AppErrorComponent, AppSvgIconComponent, BaseApiService, BaseControlValueAccessor, BaseControlValueAccessorV2, BaseControlValueAccessorV3, BaseInputComponent, BaseOverlayComponent, BaseTableComponent, BreadcrumbComponent, ButtonComponent, CheckboxComponent, ClickOutsideDirective, CloseButtonComponent, ContextMenuButtonComponent, ContextMenuIconComponent, DataTableComponent, DateInputComponent, DatePickerComponent, DatePickerOverlayComponent, DateRangePickerComponent, DateUtils, DropdownComponent, DynamicRendererComponent, EnvBannerComponent, FORM_ERRORS, FileUploaderComponent, FormValidationUtils, HumanizeFormMessagesPipe, InputDateFormat, InvalidControlScrollContainerDirective, InvalidControlScrollDirective, InvalidTokenError, ListviewComponent, LoaderComponent, LoaderService, MultiSelectDropdownAppearance, MultiSelectDropdownComponent, MultiSelectionFieldComponent, NGL_CONFIG, NetworkImageComponent, NglService, NoDataComponent, NoDataTableComponent, NumberInputComponent, OverlayContextMenuComponent, OverlayService, OverlayWizardUtils, PaginationComponent, PaginationState, PhoneNumberInputComponent, RadioButtonComponent, RequestState, ResizableColumnDirective, ResponsiveHelperComponent, SharedConstants, ShimmerComponent, SingleItemPickerInputComponent, SingleSelectionFieldComponent, SortableTableDirective, SpinnerComponent, State, StatusBadgeComponent, SvgUrlIconComponent, SwitchComponent, TableCustomComponent, TableResizableColumnsDirective, TemplateResolverArrayUtil, TemplateResolverFormat, TextAreaInputComponent, TextInputComponent, TimePickerComponent, ToastComponent, ToastService, ToasterComponent, TooltipComponent, UnsavedAwareDirective, arrayToCSV, arrayToSeparator, arrayToSpaceSeparator, deepEqual, defaultErrors, getDynamicTypeStructure, isDynamicType, isValid, jsonEqual, jwtDecode, mmddyyyyDateValidatorAsync, onlyFutureDateValidator, onlyPastDateValidator, openLink, printInvalidFields, provideNglConfig, resolveTemplateWithObject, toSentenceCase };
|
|
5503
5565
|
//# sourceMappingURL=vallift-ngl.mjs.map
|