@bootkit/ng0 0.0.0-alpha.51 → 0.0.0-alpha.53

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 +1 @@
1
- {"version":3,"file":"bootkit-ng0-components-select.mjs","sources":["../../../projects/ng0/components/select/select.component.ts","../../../projects/ng0/components/select/select.component.html","../../../projects/ng0/components/select/select.module.ts","../../../projects/ng0/components/select/public-api.ts","../../../projects/ng0/components/select/bootkit-ng0-components-select.ts"],"sourcesContent":["import { Component, ElementRef, Renderer2, input, signal, model, HostListener, inject, forwardRef, ViewChild, TemplateRef, ContentChild, ViewEncapsulation, ChangeDetectionStrategy, booleanAttribute, ChangeDetectorRef, effect, computed, untracked, Output, EventEmitter, EnvironmentInjector } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { dataSourceAttribute, DataSource, DataSourceLike, DataRequest } from '@bootkit/ng0/data';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { FlexibleConnectedPositionStrategy, Overlay, OverlayModule, ScrollStrategy, ViewportRuler } from '@angular/cdk/overlay';\nimport { Subscription } from 'rxjs';\nimport { objectFormatterAttribute, defaultFormatter, LocalizationService } from '@bootkit/ng0/localization';\nimport { ListComponent, ListModule, ListItemSelectEvent } from '@bootkit/ng0/components/list';\nimport {\n CssClassAttribute, equalityComparerAttribute, defaultEqualityComparer, valueWriterAttribute, defaultValueWriter,\n IdGeneratorAttribute, defaultFilter, filterPredicateAttribute\n} from '@bootkit/ng0/common';\n\n/**\n * Select component that allows users to choose an option from a dropdown list.\n */\n@Component({\n selector: 'ng0-select',\n exportAs: 'ng0Select',\n templateUrl: './select.component.html',\n styleUrl: './select.component.scss',\n standalone: true,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [CommonModule, ListModule, OverlayModule],\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SelectComponent),\n multi: true\n }],\n host: {\n '[class.ng0-select-open]': 'open()',\n '[class.ng0-select-filterable]': 'filterable()',\n '[class.ng0-select-loading]': 'source().isLoading()',\n '[attr.disabled]': '_isDisabled() ? \"\" : undefined',\n '[attr.aria-disabled]': '_isDisabled() ? \"\" : undefined',\n '[attr.tabindex]': '_isDisabled() ? undefined : 0',\n }\n})\nexport class SelectComponent implements ControlValueAccessor {\n // private _resizeObserver?: ResizeObserver;\n private _viewpoerRulerSubscription?: Subscription;\n private readonly _injector = inject(EnvironmentInjector);\n @ViewChild('filterInput') private _filterElementRef?: ElementRef;\n @ViewChild(ListComponent) private _listComponent?: ListComponent;\n private _changeCallback!: (value: any) => void;\n private _touchCallback!: () => void;\n protected readonly _sourceItems = signal<any[] | undefined>(undefined);\n protected readonly _selectedItems = new Set<any>();\n protected readonly _isDisabled = signal<boolean>(false);\n protected _positionStrategy!: FlexibleConnectedPositionStrategy;\n protected _scrollStrategy!: ScrollStrategy;\n private readonly _overlay = inject(Overlay);\n private readonly _localizationService = inject(LocalizationService);\n protected readonly _elementRef = inject(ElementRef<HTMLDivElement>);\n protected readonly _filterValue = signal('');\n private readonly _renderer = inject(Renderer2);\n private readonly _viewportRuler = inject(ViewportRuler);\n private readonly _changeDetectorRef = inject(ChangeDetectorRef);\n private readonly _value = signal<any>(undefined);\n\n /**\n * Template for rendering each item in the select component.\n */\n @ContentChild(TemplateRef) public itemTemplate?: TemplateRef<any>;\n\n /**\n * The data source for the select component.\n * This can be an array of data, a function that returns an observable of data,\n * or an instance of DataSource.\n */\n public readonly source = input.required<DataSource<any>, DataSourceLike<any>>({\n transform: v => dataSourceAttribute(v)\n });\n\n /** \n * Indicates whether multi selection is enabled or not.\n */\n public readonly multiple = input(false, {\n transform: booleanAttribute\n });\n\n /**\n * Indicates whether to show selection indicator (checkbox/radio) next to each item.\n * Default is false.\n */\n public readonly showSelectionIndicator = input(false, {\n transform: booleanAttribute\n });\n\n /** \n * Indicates whether the dropdown is open or closed.\n */\n public readonly open = model(false);\n\n /**\n * A comparer to compare items for selection.\n */\n public readonly compareBy = input(defaultEqualityComparer, {\n transform: equalityComparerAttribute\n });\n\n /**\n * A fromatter to convert each item to a string for display.\n */\n public readonly formatBy = input(defaultFormatter, {\n transform: objectFormatterAttribute(this._injector)\n });\n\n /**\n * Custom value writer to extract the value of any object while writing values.\n */\n public readonly writeBy = input(defaultValueWriter, {\n transform: valueWriterAttribute\n });\n\n /**\n * Indicates whether the select component is filterable.\n */\n public readonly filterable = input(false, { transform: booleanAttribute });\n\n /**\n * Custom filter function to filter items based on a filter value.\n * Default checks if the item contains the filter value (case-insensitive).\n */\n public readonly filterBy = input(defaultFilter, {\n transform: filterPredicateAttribute\n });\n\n /**\n * Placeholder text for the filter input field.\n */\n public readonly filterPlaceholder = input<string | undefined>(undefined);\n\n /**\n * CSS class or classes to apply to the items.\n */\n public readonly itemClass = input(undefined, {\n transform: CssClassAttribute\n });\n\n /**\n * A function that generates unique ids for each item in the list.\n * If set to a function, it will be called with the item as an argument to generate the id.\n * If set to undefined, no ids will be generated for the items.\n * @default undefined\n */\n public readonly idGenerator = input(undefined, {\n transform: IdGeneratorAttribute\n });\n\n /**\n * Event emitted when the selected value changes.\n */\n @Output() public readonly itemSelect = new EventEmitter<ItemSelectEvent>();\n\n constructor() {\n ['form-select'].forEach(c => this._renderer.addClass(this._elementRef.nativeElement, c));\n this._scrollStrategy = this._overlay.scrollStrategies.block();\n\n effect(() => {\n let source = this.source();\n source.load(new DataRequest()).subscribe(res => {\n untracked(() => {\n this._sourceItems.set(res.data);\n this._findAndSelectItems();\n this._changeDetectorRef.markForCheck();\n })\n });\n });\n }\n\n /**\n * Indicates whether the given value is selected.\n * @param item \n * @returns \n */\n public isSelected(value: any): boolean {\n return this._selectedItems.has(value);\n }\n\n /**\n * Selects the given value.\n * @param item \n */\n public select(value: any): void {\n if (this.multiple()) {\n if (!this._selectedItems.has(value)) {\n this._selectedItems.add(value);\n this._updateValue();\n this._changeCallback?.(this._value());\n }\n } else {\n this._selectedItems.clear();\n this._selectedItems.add(value);\n this._updateValue();\n this._changeCallback?.(this._value());\n }\n }\n\n /**\n * Deselects the given value.\n * @param item \n */\n public deselect(value: any): void {\n this._selectedItems.delete(value);\n this._updateValue();\n this._changeCallback?.(this._value());\n }\n\n /**\n * Toggles the selection state of the given value.\n * @param item\n */\n public toggle(value: any): void {\n if (this.isSelected(value)) {\n this.deselect(value);\n } else {\n this.select(value);\n }\n }\n\n writeValue(obj: any): void {\n if (this.multiple()) {\n if (obj === null || obj === undefined) {\n obj = [];\n } else if (!Array.isArray(obj)) {\n throw Error('invalid value. Expected an array in multiple selection mode.');\n }\n }\n\n this._value.set(obj);\n this._findAndSelectItems();\n this._changeDetectorRef.markForCheck();\n }\n\n registerOnChange(fn: any): void {\n this._changeCallback = fn;\n }\n\n registerOnTouched(fn: any): void {\n this._touchCallback = fn;\n }\n\n setDisabledState?(isDisabled: boolean): void {\n this._isDisabled.set(isDisabled);\n }\n\n private _findAndSelectItems(): void {\n let value = this._value();\n let compareBy = this.compareBy();\n let sourceItems = this._sourceItems();\n this._selectedItems.clear();\n if (sourceItems == undefined || sourceItems.length == 0) {\n return;\n }\n\n let findAndSelect = (v: any) => {\n let index = sourceItems.findIndex(sourceItem => compareBy(sourceItem, v));\n if (index > -1) {\n let item = sourceItems.at(index)!;\n this._selectedItems.add(item);\n }\n };\n\n if (this.multiple()) {\n if (Array.isArray(value)) {\n (value as any[]).forEach(v => findAndSelect(v));\n }\n } else {\n findAndSelect(value);\n }\n }\n\n private _updateValue(): void {\n let value: any;\n\n if (this.multiple()) {\n let values: any[] = [];\n this._selectedItems.forEach(v => {\n values.push(this.writeBy()(v));\n });\n value = values;\n } else {\n if (this._selectedItems.size > 0) {\n let first = this._selectedItems.values().next().value;\n value = this.writeBy()(first);\n } else {\n value = undefined;\n }\n }\n\n this._value.set(value);\n }\n\n protected _onOverlayAttach() {\n this._listenToResizeEvents();\n\n setTimeout(() => {\n if (this.filterable()) {\n this._filterElementRef?.nativeElement.focus();\n }\n\n this._listComponent!.writeValue(this._value());\n // if (this._activeOptionIndex() > -1) {\n // this._listComponent?.active(this._activeOptionIndex());\n // }\n }, 0);\n }\n\n protected _onOverlayDetach() {\n this._unlistenFromResizeEvents();\n this._elementRef!.nativeElement.focus();\n this._filterValue.set('');\n this.open.set(false);\n }\n\n protected _onListSelectionChange(e: ListItemSelectEvent) {\n let value = e.item.value();\n\n if (this.multiple()) {\n this.toggle(value);\n } else {\n this.select(value);\n }\n\n this.itemSelect.emit({ value: e.value, select: this });\n this._changeDetectorRef.detectChanges();\n if (!this.multiple()) {\n this.open.set(false);\n }\n }\n\n protected _filterPredicate = computed(() => {\n let filterValue = this._filterValue();\n let filterBy = this.filterBy();\n\n return (item: any) => filterBy(item, filterValue);\n })\n\n protected _onFilterKeydown(e: KeyboardEvent) {\n let keys = ['ArrowDown', 'ArrowUp', 'Enter', 'Home', 'End'];\n\n if (e.key === 'Tab') {\n e.preventDefault();\n this.open.set(false);\n }\n\n if (keys.includes(e.key)) {\n e.preventDefault();\n const newEvent = new KeyboardEvent(e.type, e);\n this._listComponent?.elementRef.nativeElement.dispatchEvent(newEvent);\n }\n }\n\n private _listenToResizeEvents() {\n this._viewportRuler.change().subscribe(x => {\n this.open.set(false);\n });\n\n // this._resizeObserver = new ResizeObserver(e => {\n // // update overlay size\n // // const width = (e[0].target as HTMLDivElement).offsetWidth;\n // // this._connectedOverlay.overlayRef.updateSize({ width });\n // });\n\n // this._resizeObserver.observe(this._elementRef.nativeElement);\n }\n\n private _unlistenFromResizeEvents() {\n this._viewpoerRulerSubscription?.unsubscribe();\n this._viewpoerRulerSubscription = undefined;\n\n // this._resizeObserver?.disconnect();\n // this._resizeObserver = undefined;\n }\n\n @HostListener('keydown', ['$event'])\n protected _onHostKeydown(e: KeyboardEvent) {\n let sourceItems = this._sourceItems()\n let itemsCount = sourceItems?.length || 0;\n\n if (this._isDisabled() || !sourceItems || itemsCount === 0) {\n return;\n }\n\n if (this.open()) {\n const newEvent = new KeyboardEvent(e.type, e);\n this._listComponent?.elementRef.nativeElement.dispatchEvent(newEvent);\n return;\n } else {\n if (e.key == 'Enter') {\n this.open.set(true);\n e.preventDefault();\n return;\n }\n }\n\n if (this.multiple()) {\n return;\n }\n\n let selectedItemindex: number;\n if (this._selectedItems.size == 0) {\n selectedItemindex = -1\n } else {\n let firstValue = this._selectedItems.values().next().value;\n selectedItemindex = sourceItems.findIndex(i => i === firstValue);\n }\n\n let newItemIndex = selectedItemindex;\n\n switch (e.key) {\n case 'ArrowDown':\n if (selectedItemindex < itemsCount - 1) {\n newItemIndex = selectedItemindex + 1;\n this.select(sourceItems[newItemIndex]);\n }\n e.preventDefault();\n break;\n case 'ArrowUp':\n if (selectedItemindex > 0) {\n newItemIndex = selectedItemindex - 1;\n this.select(sourceItems[newItemIndex]);\n }\n e.preventDefault();\n break;\n case 'Home':\n if (itemsCount > 0) {\n newItemIndex = 0;\n this.select(sourceItems[0]);\n }\n e.preventDefault();\n break;\n case 'End':\n if (itemsCount > 0) {\n newItemIndex = itemsCount - 1;\n this.select(sourceItems[newItemIndex]);\n }\n e.preventDefault();\n break;\n }\n\n if (selectedItemindex != newItemIndex!) {\n this.itemSelect.emit({ value: sourceItems[newItemIndex], select: this });\n this._changeDetectorRef.markForCheck();\n }\n }\n\n @HostListener('click', ['$event'])\n protected _onHostClick(e: MouseEvent) {\n if (this._isDisabled() || this.source().isLoading()) {\n return;\n }\n\n this.open.update(x => !x);\n this._touchCallback?.();\n }\n}\n\n\n/**\n * Event emitted when the selection state of the select component changes by user interaction.\n */\nexport interface ItemSelectEvent {\n /**\n * The value of the item that was selected or deselected.\n */\n value: any;\n\n /**\n * The select component that emitted the event.\n */\n readonly select: SelectComponent\n}\n","@if(multiple()) {\n\n@for(item of _selectedItems.values(); track $index; let last=$last) {\n{{formatBy()(item)}}@if(!last) {,}\n}\n\n} @else {\n@if(_selectedItems.size > 0) {\n{{formatBy()(_selectedItems.values().next().value)}}\n}\n}\n\n@if(source().isLoading()) {\n<div class=\"spinner-grow text-secondary spinner-grow-sm ng0-select-spinner\" role=\"status\">\n <span class=\"visually-hidden\">Loading...</span>\n</div>\n\n&nbsp; <!-- This space is required to prevent layout shift after loading indicator hides. -->\n}\n\n<ng-template cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"_elementRef.nativeElement\"\n [cdkConnectedOverlayOpen]=\"open()\"\n [cdkConnectedOverlayScrollStrategy]=\"_scrollStrategy\"\n [cdkConnectedOverlayPush]=\"false\"\n [cdkConnectedOverlayFlexibleDimensions]=\"true\"\n [cdkConnectedOverlayPanelClass]=\"['ng0-select-dropdown']\"\n [cdkConnectedOverlayWidth]=\"_elementRef.nativeElement.clientWidth\"\n (overlayOutsideClick)=\"this.open.set(false)\"\n (attach)=\"_onOverlayAttach();\"\n (detach)=\"_onOverlayDetach()\">\n\n @if(filterable()) {\n <div class=\"ng0-select-filter-container\">\n <input #filterInput\n type=\"text\"\n class=\"ng0-select-filter-input\"\n [attr.placeholder]=\"filterPlaceholder()\"\n (input)=\"_filterValue.set($event.target.value)\"\n (keydown)=\"_onFilterKeydown($event)\">\n </div>\n }\n\n <ng0-select-list #list\n [source]=\"_sourceItems()\"\n [multiple]=\"multiple()\"\n [formatBy]=\"formatBy()\"\n [compareBy]=\"compareBy()\"\n [itemClass]=\"itemClass()\"\n [showSelectionIndicator]=\"showSelectionIndicator()\"\n [itemTemplate]=\"itemTemplate\"\n [filterBy]=\"_filterPredicate()\"\n focusMode=\"none\"\n (mousedown)=\"$event.preventDefault(); $event.stopImmediatePropagation()\"\n (itemSelect)=\"_onListSelectionChange($event)\">\n </ng0-select-list>\n</ng-template>\n","import { NgModule } from '@angular/core';\nimport { SelectComponent } from './select.component';\n\nconst Items = [SelectComponent]\n\n/**\n * Select module.\n */\n@NgModule({\n imports: Items,\n exports: Items\n})\nexport class SelectModule { }\n","// export * from './types';\nexport * from './select.component';\nexport * from './select.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport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AA,EAAA,OAAA,EAAA,CAAf,eAAe,CAAA,EAAA,CAAA;AASjB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,YAHZ,KAAK,CAAA,EAAA,CAAA;;4FAGL,YAAY,EAAA,UAAA,EAAA,CAAA;kBAJxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE;AACZ,iBAAA;;;ACXD;;ACAA;;AAEG;;;;"}
1
+ {"version":3,"file":"bootkit-ng0-components-select.mjs","sources":["../../../projects/ng0/components/select/select.component.ts","../../../projects/ng0/components/select/select.component.html","../../../projects/ng0/components/select/select.module.ts","../../../projects/ng0/components/select/public-api.ts","../../../projects/ng0/components/select/bootkit-ng0-components-select.ts"],"sourcesContent":["import { Component, ElementRef, Renderer2, input, signal, model, HostListener, inject, forwardRef, ViewChild, TemplateRef, ContentChild, ViewEncapsulation, ChangeDetectionStrategy, booleanAttribute, ChangeDetectorRef, effect, computed, untracked, Output, EventEmitter, EnvironmentInjector } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { dataSourceAttribute, DataSource, DataSourceLike, DataRequest } from '@bootkit/ng0/data';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ConnectedPosition, FlexibleConnectedPositionStrategy, Overlay, OverlayModule, ScrollStrategy, STANDARD_DROPDOWN_BELOW_POSITIONS, ViewportRuler } from '@angular/cdk/overlay';\nimport { Subscription } from 'rxjs';\nimport { objectFormatterAttribute, defaultFormatter } from '@bootkit/ng0/localization';\nimport { ListComponent, ListModule, ListItemSelectEvent } from '@bootkit/ng0/components/list';\nimport {\n CssClassAttribute, equalityComparerAttribute, defaultEqualityComparer, valueWriterAttribute, defaultValueWriter,\n IdGeneratorAttribute, defaultFilter, filterPredicateAttribute\n} from '@bootkit/ng0/common';\n\n/**\n * Select component that allows users to choose an option from a dropdown list.\n */\n@Component({\n selector: 'ng0-select',\n exportAs: 'ng0Select',\n templateUrl: './select.component.html',\n styleUrl: './select.component.scss',\n standalone: true,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [CommonModule, ListModule, OverlayModule],\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SelectComponent),\n multi: true\n }],\n host: {\n '[class.ng0-select-open]': 'open()',\n '[class.ng0-select-filterable]': 'filterable()',\n '[class.ng0-select-loading]': 'source().isLoading()',\n '[attr.disabled]': '_isDisabled() ? \"\" : undefined',\n '[attr.aria-disabled]': '_isDisabled() ? \"\" : undefined',\n '[attr.tabindex]': '_isDisabled() ? undefined : 0',\n }\n})\nexport class SelectComponent implements ControlValueAccessor {\n // private _resizeObserver?: ResizeObserver;\n private _viewpoerRulerSubscription?: Subscription;\n private readonly _injector = inject(EnvironmentInjector);\n @ViewChild('filterInput') private _filterElementRef?: ElementRef;\n @ViewChild(ListComponent) private _listComponent?: ListComponent;\n private _changeCallback!: (value: any) => void;\n private _touchCallback!: () => void;\n protected readonly _sourceItems = signal<any[] | undefined>(undefined);\n protected readonly _selectedItems = new Set<any>();\n protected readonly _isDisabled = signal<boolean>(false);\n protected _scrollStrategy!: ScrollStrategy;\n protected _positions: ConnectedPosition[];\n private readonly _overlay = inject(Overlay);\n protected readonly _elementRef = inject(ElementRef<HTMLDivElement>);\n protected readonly _filterValue = signal('');\n private readonly _renderer = inject(Renderer2);\n private readonly _viewportRuler = inject(ViewportRuler);\n private readonly _changeDetectorRef = inject(ChangeDetectorRef);\n private readonly _value = signal<any>(undefined);\n\n /**\n * Template for rendering each item in the select component.\n */\n @ContentChild(TemplateRef) public itemTemplate?: TemplateRef<any>;\n\n /**\n * The data source for the select component.\n * This can be an array of data, a function that returns an observable of data,\n * or an instance of DataSource.\n */\n public readonly source = input.required<DataSource<any>, DataSourceLike<any>>({\n transform: v => dataSourceAttribute(v)\n });\n\n /** \n * Indicates whether multi selection is enabled or not.\n */\n public readonly multiple = input(false, {\n transform: booleanAttribute\n });\n\n /**\n * Indicates whether to show selection indicator (checkbox/radio) next to each item.\n * Default is false.\n */\n public readonly showSelectionIndicator = input(false, {\n transform: booleanAttribute\n });\n\n /** \n * Indicates whether the dropdown is open or closed.\n */\n public readonly open = model(false);\n\n /**\n * A comparer to compare items for selection.\n */\n public readonly compareBy = input(defaultEqualityComparer, {\n transform: equalityComparerAttribute\n });\n\n /**\n * A fromatter to convert each item to a string for display.\n */\n public readonly formatBy = input(defaultFormatter, {\n transform: objectFormatterAttribute(this._injector)\n });\n\n /**\n * Custom value writer to extract the value of any object while writing values.\n */\n public readonly writeBy = input(defaultValueWriter, {\n transform: valueWriterAttribute\n });\n\n /**\n * Indicates whether the select component is filterable.\n */\n public readonly filterable = input(false, { transform: booleanAttribute });\n\n /**\n * Custom filter function to filter items based on a filter value.\n * Default checks if the item contains the filter value (case-insensitive).\n */\n public readonly filterBy = input(defaultFilter, {\n transform: filterPredicateAttribute\n });\n\n /**\n * Placeholder text for the filter input field.\n */\n public readonly filterPlaceholder = input<string | undefined>(undefined);\n\n /**\n * CSS class or classes to apply to the items.\n */\n public readonly itemClass = input(undefined, {\n transform: CssClassAttribute\n });\n\n /**\n * A function that generates unique ids for each item in the list.\n * If set to a function, it will be called with the item as an argument to generate the id.\n * If set to undefined, no ids will be generated for the items.\n * @default undefined\n */\n public readonly idGenerator = input(undefined, {\n transform: IdGeneratorAttribute\n });\n\n /**\n * Event emitted when the selected value changes.\n */\n @Output() public readonly itemSelect = new EventEmitter<ItemSelectEvent>();\n\n constructor() {\n ['form-select'].forEach(c => this._renderer.addClass(this._elementRef.nativeElement, c));\n this._scrollStrategy = this._overlay.scrollStrategies.block();\n this._positions = STANDARD_DROPDOWN_BELOW_POSITIONS;\n // this._positions = getConnectedPositions('bottom', 'start', true);\n\n effect(() => {\n let source = this.source();\n source.load(new DataRequest()).subscribe(res => {\n untracked(() => {\n this._sourceItems.set(res.data);\n this._findAndSelectItems();\n this._changeDetectorRef.markForCheck();\n })\n });\n });\n }\n\n /**\n * Indicates whether the given value is selected.\n * @param item \n * @returns \n */\n public isSelected(value: any): boolean {\n return this._selectedItems.has(value);\n }\n\n /**\n * Selects the given value.\n * @param item \n */\n public select(value: any): void {\n if (this.multiple()) {\n if (!this._selectedItems.has(value)) {\n this._selectedItems.add(value);\n this._updateValue();\n this._changeCallback?.(this._value());\n }\n } else {\n this._selectedItems.clear();\n this._selectedItems.add(value);\n this._updateValue();\n this._changeCallback?.(this._value());\n }\n }\n\n /**\n * Deselects the given value.\n * @param item \n */\n public deselect(value: any): void {\n this._selectedItems.delete(value);\n this._updateValue();\n this._changeCallback?.(this._value());\n }\n\n /**\n * Toggles the selection state of the given value.\n * @param item\n */\n public toggle(value: any): void {\n if (this.isSelected(value)) {\n this.deselect(value);\n } else {\n this.select(value);\n }\n }\n\n writeValue(obj: any): void {\n if (this.multiple()) {\n if (obj === null || obj === undefined) {\n obj = [];\n } else if (!Array.isArray(obj)) {\n throw Error('invalid value. Expected an array in multiple selection mode.');\n }\n }\n\n this._value.set(obj);\n this._findAndSelectItems();\n this._changeDetectorRef.markForCheck();\n }\n\n registerOnChange(fn: any): void {\n this._changeCallback = fn;\n }\n\n registerOnTouched(fn: any): void {\n this._touchCallback = fn;\n }\n\n setDisabledState?(isDisabled: boolean): void {\n this._isDisabled.set(isDisabled);\n }\n\n private _findAndSelectItems(): void {\n let value = this._value();\n let compareBy = this.compareBy();\n let sourceItems = this._sourceItems();\n this._selectedItems.clear();\n if (sourceItems == undefined || sourceItems.length == 0) {\n return;\n }\n\n let findAndSelect = (v: any) => {\n let index = sourceItems.findIndex(sourceItem => compareBy(sourceItem, v));\n if (index > -1) {\n let item = sourceItems.at(index)!;\n this._selectedItems.add(item);\n }\n };\n\n if (this.multiple()) {\n if (Array.isArray(value)) {\n (value as any[]).forEach(v => findAndSelect(v));\n }\n } else {\n findAndSelect(value);\n }\n }\n\n private _updateValue(): void {\n let value: any;\n\n if (this.multiple()) {\n let values: any[] = [];\n this._selectedItems.forEach(v => {\n values.push(this.writeBy()(v));\n });\n value = values;\n } else {\n if (this._selectedItems.size > 0) {\n let first = this._selectedItems.values().next().value;\n value = this.writeBy()(first);\n } else {\n value = undefined;\n }\n }\n\n this._value.set(value);\n }\n\n protected _onOverlayAttach() {\n this._listenToResizeEvents();\n\n setTimeout(() => {\n if (this.filterable()) {\n this._filterElementRef?.nativeElement.focus();\n }\n\n this._listComponent!.writeValue(this._value());\n // if (this._activeOptionIndex() > -1) {\n // this._listComponent?.active(this._activeOptionIndex());\n // }\n }, 0);\n }\n\n protected _onOverlayDetach() {\n this._unlistenFromResizeEvents();\n this._elementRef!.nativeElement.focus();\n this._filterValue.set('');\n this.open.set(false);\n }\n\n protected _onListSelectionChange(e: ListItemSelectEvent) {\n let value = e.item.value();\n\n if (this.multiple()) {\n this.toggle(value);\n } else {\n this.select(value);\n }\n\n this.itemSelect.emit({ value: e.value, select: this });\n this._changeDetectorRef.detectChanges();\n if (!this.multiple()) {\n this.open.set(false);\n }\n }\n\n protected _filterPredicate = computed(() => {\n let filterValue = this._filterValue();\n let filterBy = this.filterBy();\n\n return (item: any) => filterBy(item, filterValue);\n })\n\n protected _onFilterKeydown(e: KeyboardEvent) {\n let keys = ['ArrowDown', 'ArrowUp', 'Enter', 'Home', 'End'];\n\n if (e.key === 'Tab') {\n e.preventDefault();\n this.open.set(false);\n }\n\n if (keys.includes(e.key)) {\n e.preventDefault();\n const newEvent = new KeyboardEvent(e.type, e);\n this._listComponent?.elementRef.nativeElement.dispatchEvent(newEvent);\n }\n }\n\n private _listenToResizeEvents() {\n this._viewportRuler.change().subscribe(x => {\n this.open.set(false);\n });\n\n // this._resizeObserver = new ResizeObserver(e => {\n // // update overlay size\n // // const width = (e[0].target as HTMLDivElement).offsetWidth;\n // // this._connectedOverlay.overlayRef.updateSize({ width });\n // });\n\n // this._resizeObserver.observe(this._elementRef.nativeElement);\n }\n\n private _unlistenFromResizeEvents() {\n this._viewpoerRulerSubscription?.unsubscribe();\n this._viewpoerRulerSubscription = undefined;\n\n // this._resizeObserver?.disconnect();\n // this._resizeObserver = undefined;\n }\n\n @HostListener('keydown', ['$event'])\n protected _onHostKeydown(e: KeyboardEvent) {\n let sourceItems = this._sourceItems()\n let itemsCount = sourceItems?.length || 0;\n\n if (this._isDisabled() || !sourceItems || itemsCount === 0) {\n return;\n }\n\n if (this.open()) {\n const newEvent = new KeyboardEvent(e.type, e);\n this._listComponent?.elementRef.nativeElement.dispatchEvent(newEvent);\n return;\n } else {\n if (e.key == 'Enter') {\n this.open.set(true);\n e.preventDefault();\n return;\n }\n }\n\n if (this.multiple()) {\n return;\n }\n\n let selectedItemindex: number;\n if (this._selectedItems.size == 0) {\n selectedItemindex = -1\n } else {\n let firstValue = this._selectedItems.values().next().value;\n selectedItemindex = sourceItems.findIndex(i => i === firstValue);\n }\n\n let newItemIndex = selectedItemindex;\n\n switch (e.key) {\n case 'ArrowDown':\n if (selectedItemindex < itemsCount - 1) {\n newItemIndex = selectedItemindex + 1;\n this.select(sourceItems[newItemIndex]);\n }\n e.preventDefault();\n break;\n case 'ArrowUp':\n if (selectedItemindex > 0) {\n newItemIndex = selectedItemindex - 1;\n this.select(sourceItems[newItemIndex]);\n }\n e.preventDefault();\n break;\n case 'Home':\n if (itemsCount > 0) {\n newItemIndex = 0;\n this.select(sourceItems[0]);\n }\n e.preventDefault();\n break;\n case 'End':\n if (itemsCount > 0) {\n newItemIndex = itemsCount - 1;\n this.select(sourceItems[newItemIndex]);\n }\n e.preventDefault();\n break;\n }\n\n if (selectedItemindex != newItemIndex!) {\n this.itemSelect.emit({ value: sourceItems[newItemIndex], select: this });\n this._changeDetectorRef.markForCheck();\n }\n }\n\n @HostListener('click', ['$event'])\n protected _onHostClick(e: MouseEvent) {\n if (this._isDisabled() || this.source().isLoading()) {\n return;\n }\n\n this.open.update(x => !x);\n this._touchCallback?.();\n }\n}\n\n\n/**\n * Event emitted when the selection state of the select component changes by user interaction.\n */\nexport interface ItemSelectEvent {\n /**\n * The value of the item that was selected or deselected.\n */\n value: any;\n\n /**\n * The select component that emitted the event.\n */\n readonly select: SelectComponent\n}\n","@if (multiple()) {\n\t@for (item of _selectedItems.values(); track $index; let last=$last) {\n\t\t{{formatBy()(item)}}\n\t\t@if (!last) {\n\t\t\t,\n\t\t}\n\t}\n} @else {\n\t@if (_selectedItems.size > 0) {\n\t\t{{formatBy()(_selectedItems.values().next().value)}}\n\t}\n}\n\n@if (source().isLoading()) {\n\t<div class=\"spinner-grow text-secondary spinner-grow-sm ng0-select-spinner\" role=\"status\">\n\t\t<span class=\"visually-hidden\">Loading...</span>\n\t</div>\n\n\t&nbsp;\n\t<!-- This space is required to prevent layout shift after loading indicator hides. -->\n}\n\n<ng-template\n\tcdkConnectedOverlay\n\t[cdkConnectedOverlayOrigin]=\"_elementRef.nativeElement\"\n\t[cdkConnectedOverlayOpen]=\"open()\"\n\t[cdkConnectedOverlayScrollStrategy]=\"_scrollStrategy\"\n\t[cdkConnectedOverlayPositions]=\"_positions\"\n\t[cdkConnectedOverlayPush]=\"false\"\n\t[cdkConnectedOverlayFlexibleDimensions]=\"true\"\n\t[cdkConnectedOverlayPanelClass]=\"['ng0-select-dropdown']\"\n\t[cdkConnectedOverlayWidth]=\"_elementRef.nativeElement.clientWidth\"\n\t(overlayOutsideClick)=\"this.open.set(false)\"\n\t(attach)=\"_onOverlayAttach();\"\n\t(detach)=\"_onOverlayDetach()\">\n\t@if (filterable()) {\n\t\t<div class=\"ng0-select-filter-container\">\n\t\t\t<input\n\t\t\t\t#filterInput\n\t\t\t\ttype=\"text\"\n\t\t\t\tclass=\"ng0-select-filter-input\"\n\t\t\t\t[attr.placeholder]=\"filterPlaceholder()\"\n\t\t\t\t(input)=\"_filterValue.set($event.target.value)\"\n\t\t\t\t(keydown)=\"_onFilterKeydown($event)\" />\n\t\t</div>\n\t}\n\n\t<ng0-select-list\n\t\t#list\n\t\t[source]=\"_sourceItems()\"\n\t\t[multiple]=\"multiple()\"\n\t\t[formatBy]=\"formatBy()\"\n\t\t[compareBy]=\"compareBy()\"\n\t\t[itemClass]=\"itemClass()\"\n\t\t[showSelectionIndicator]=\"showSelectionIndicator()\"\n\t\t[itemTemplate]=\"itemTemplate\"\n\t\t[filterBy]=\"_filterPredicate()\"\n\t\tfocusMode=\"none\"\n\t\t(mousedown)=\"$event.preventDefault(); $event.stopImmediatePropagation()\"\n\t\t(itemSelect)=\"_onListSelectionChange($event)\">\n\t</ng0-select-list>\n</ng-template>\n","import { NgModule } from '@angular/core';\nimport { SelectComponent } from './select.component';\n\nconst Items = [SelectComponent]\n\n/**\n * Select module.\n */\n@NgModule({\n imports: Items,\n exports: Items\n})\nexport class SelectModule { }\n","// export * from './types';\nexport * from './select.component';\nexport * from './select.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;AAaA;;AAEG;MAwBU,eAAe,CAAA;;AAEhB,IAAA,0BAA0B;AACjB,IAAA,SAAS,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACtB,IAAA,iBAAiB;AACjB,IAAA,cAAc;AACxC,IAAA,eAAe;AACf,IAAA,cAAc;AACH,IAAA,YAAY,GAAG,MAAM,CAAoB,SAAS,wDAAC;AACnD,IAAA,cAAc,GAAG,IAAI,GAAG,EAAO;AAC/B,IAAA,WAAW,GAAG,MAAM,CAAU,KAAK,uDAAC;AAC7C,IAAA,eAAe;AACf,IAAA,UAAU;AACH,IAAA,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC;AACxB,IAAA,WAAW,GAAG,MAAM,EAAC,UAA0B,EAAC;AAChD,IAAA,YAAY,GAAG,MAAM,CAAC,EAAE,wDAAC;AAC3B,IAAA,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;AAC7B,IAAA,cAAc,GAAG,MAAM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B,EAAE,gCAAgC;AACnD,wBAAA,sBAAsB,EAAE,gCAAgC;AACxD,wBAAA,iBAAiB,EAAE,+BAA+B;AACrD,qBAAA,EAAA,QAAA,EAAA,igEAAA,EAAA,MAAA,EAAA,CAAA,0rEAAA,CAAA,EAAA;;sBAMA,SAAS;uBAAC,aAAa;;sBACvB,SAAS;uBAAC,aAAa;;sBAmBvB,YAAY;uBAAC,WAAW;;sBA0FxB;;sBAiOA,YAAY;uBAAC,SAAS,EAAE,CAAC,QAAQ,CAAC;;sBAwElC,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;;AE/brC,MAAM,KAAK,GAAG,CAAC,eAAe,CAAC;AAE/B;;AAEG;MAKU,YAAY,CAAA;wGAAZ,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;yGAAZ,YAAY,EAAA,OAAA,EAAA,CATV,eAAe,CAAA,EAAA,OAAA,EAAA,CAAf,eAAe,CAAA,EAAA,CAAA;AASjB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,YAHZ,KAAK,CAAA,EAAA,CAAA;;4FAGL,YAAY,EAAA,UAAA,EAAA,CAAA;kBAJxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE;AACZ,iBAAA;;;ACXD;;ACAA;;AAEG;;;;"}
@@ -1,24 +1,36 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, booleanAttribute, model, signal, TemplateRef, ContentChild, Directive, Input, inject, DestroyRef, numberAttribute, HostBinding, ContentChildren, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
2
+ import { inject, EnvironmentInjector, input, booleanAttribute, model, signal, TemplateRef, ContentChild, Directive, Input, DestroyRef, ChangeDetectorRef, numberAttribute, HostBinding, ContentChildren, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
3
+ import * as i4 from '@bootkit/ng0/localization';
4
+ import { defaultFormatter, objectFormatterAttribute, LocalizationService, LocalizationModule } from '@bootkit/ng0/localization';
3
5
  import * as i1 from '@angular/common';
4
6
  import { CommonModule } from '@angular/common';
5
7
  import * as i2 from '@angular/forms';
6
8
  import { FormsModule } from '@angular/forms';
7
9
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
8
10
  import { formatString } from '@bootkit/ng0/common';
9
- import * as i4 from '@bootkit/ng0/localization';
10
- import { LocalizationService, LocalizationModule } from '@bootkit/ng0/localization';
11
11
  import { dataSourceAttribute, DataRequest } from '@bootkit/ng0/data';
12
12
  import { PaginationComponent } from '@bootkit/ng0/components/pagination';
13
13
  import * as i3 from '@angular/cdk/overlay';
14
14
  import { OverlayModule } from '@angular/cdk/overlay';
15
15
  import { NumberDirective } from '@bootkit/ng0/form';
16
+ import { SelectComponent } from '@bootkit/ng0/components/select';
17
+ import { Filter1Icon } from '@bootkit/ng0/icons';
16
18
 
17
19
  class TableColumnDirective {
20
+ _injector = inject(EnvironmentInjector);
18
21
  /**
19
22
  * The field in the data source to bind to. If not set, the column will not display any data.
23
+ * @deprecated Use formatBy input.
20
24
  */
21
25
  field = input(...(ngDevMode ? [undefined, { debugName: "field" }] : []));
26
+ /**
27
+ * A fromatter to convert each item to a string for display.
28
+ * This can be a function, a string (field name), or an array of formatters.
29
+ * If not set, the default formatter will be used, which simply calls toString() on the value.
30
+ */
31
+ formatBy = input(defaultFormatter, ...(ngDevMode ? [{ debugName: "formatBy", transform: objectFormatterAttribute(this._injector) }] : [{
32
+ transform: objectFormatterAttribute(this._injector)
33
+ }]));
22
34
  /**
23
35
  * The title of the column. This will be displayed in the header row.
24
36
  */
@@ -51,11 +63,6 @@ class TableColumnDirective {
51
63
  * The current filter value of the column.
52
64
  */
53
65
  filterValue = model(...(ngDevMode ? [undefined, { debugName: "filterValue" }] : []));
54
- /**
55
- * The field to use for filtering. If not set, the `field` property will be used.
56
- * @deprecated Use `fieldName` instead.
57
- */
58
- filterField = input(...(ngDevMode ? [undefined, { debugName: "filterField" }] : []));
59
66
  /**
60
67
  * The current filter operator of the column.
61
68
  */
@@ -126,7 +133,7 @@ class TableColumnDirective {
126
133
  }
127
134
  }
128
135
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: TableColumnDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
129
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.11", type: TableColumnDirective, isStandalone: true, selector: "ng0-table-col", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, emptyCellText: { classPropertyName: "emptyCellText", publicName: "emptyCellText", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, cellClass: { classPropertyName: "cellClass", publicName: "cellClass", isSignal: true, isRequired: false, transformFunction: null }, bold: { classPropertyName: "bold", publicName: "bold", isSignal: true, isRequired: false, transformFunction: null }, shrink: { classPropertyName: "shrink", publicName: "shrink", isSignal: true, isRequired: false, transformFunction: null }, filterable: { classPropertyName: "filterable", publicName: "filterable", isSignal: true, isRequired: false, transformFunction: null }, filterValue: { classPropertyName: "filterValue", publicName: "filterValue", isSignal: true, isRequired: false, transformFunction: null }, filterField: { classPropertyName: "filterField", publicName: "filterField", isSignal: true, isRequired: false, transformFunction: null }, filterOperator: { classPropertyName: "filterOperator", publicName: "filterOperator", isSignal: true, isRequired: false, transformFunction: null }, filterOperators: { classPropertyName: "filterOperators", publicName: "filterOperators", isSignal: true, isRequired: false, transformFunction: null }, fieldName: { classPropertyName: "fieldName", publicName: "fieldName", isSignal: true, isRequired: false, transformFunction: null }, sortable: { classPropertyName: "sortable", publicName: "sortable", isSignal: true, isRequired: false, transformFunction: null }, sortDirection: { classPropertyName: "sortDirection", publicName: "sortDirection", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterValue: "filterValueChange", filterOperator: "filterOperatorChange", sortDirection: "sortDirectionChange" }, queries: [{ propertyName: "template", first: true, predicate: TemplateRef, descendants: true }], ngImport: i0 });
136
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.11", type: TableColumnDirective, isStandalone: true, selector: "ng0-table-col", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: false, transformFunction: null }, formatBy: { classPropertyName: "formatBy", publicName: "formatBy", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, emptyCellText: { classPropertyName: "emptyCellText", publicName: "emptyCellText", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, cellClass: { classPropertyName: "cellClass", publicName: "cellClass", isSignal: true, isRequired: false, transformFunction: null }, bold: { classPropertyName: "bold", publicName: "bold", isSignal: true, isRequired: false, transformFunction: null }, shrink: { classPropertyName: "shrink", publicName: "shrink", isSignal: true, isRequired: false, transformFunction: null }, filterable: { classPropertyName: "filterable", publicName: "filterable", isSignal: true, isRequired: false, transformFunction: null }, filterValue: { classPropertyName: "filterValue", publicName: "filterValue", isSignal: true, isRequired: false, transformFunction: null }, filterOperator: { classPropertyName: "filterOperator", publicName: "filterOperator", isSignal: true, isRequired: false, transformFunction: null }, filterOperators: { classPropertyName: "filterOperators", publicName: "filterOperators", isSignal: true, isRequired: false, transformFunction: null }, fieldName: { classPropertyName: "fieldName", publicName: "fieldName", isSignal: true, isRequired: false, transformFunction: null }, sortable: { classPropertyName: "sortable", publicName: "sortable", isSignal: true, isRequired: false, transformFunction: null }, sortDirection: { classPropertyName: "sortDirection", publicName: "sortDirection", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterValue: "filterValueChange", filterOperator: "filterOperatorChange", sortDirection: "sortDirectionChange" }, queries: [{ propertyName: "template", first: true, predicate: TemplateRef, descendants: true }], ngImport: i0 });
130
137
  }
131
138
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: TableColumnDirective, decorators: [{
132
139
  type: Directive,
@@ -134,7 +141,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImpo
134
141
  selector: 'ng0-table-col',
135
142
  standalone: true,
136
143
  }]
137
- }], ctorParameters: () => [], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], emptyCellText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyCellText", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], cellClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "cellClass", required: false }] }], bold: [{ type: i0.Input, args: [{ isSignal: true, alias: "bold", required: false }] }], shrink: [{ type: i0.Input, args: [{ isSignal: true, alias: "shrink", required: false }] }], filterable: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterable", required: false }] }], filterValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterValue", required: false }] }, { type: i0.Output, args: ["filterValueChange"] }], filterField: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterField", required: false }] }], filterOperator: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterOperator", required: false }] }, { type: i0.Output, args: ["filterOperatorChange"] }], filterOperators: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterOperators", required: false }] }], fieldName: [{ type: i0.Input, args: [{ isSignal: true, alias: "fieldName", required: false }] }], sortable: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortable", required: false }] }], sortDirection: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortDirection", required: false }] }, { type: i0.Output, args: ["sortDirectionChange"] }], template: [{
144
+ }], ctorParameters: () => [], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: false }] }], formatBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "formatBy", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], emptyCellText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyCellText", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], cellClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "cellClass", required: false }] }], bold: [{ type: i0.Input, args: [{ isSignal: true, alias: "bold", required: false }] }], shrink: [{ type: i0.Input, args: [{ isSignal: true, alias: "shrink", required: false }] }], filterable: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterable", required: false }] }], filterValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterValue", required: false }] }, { type: i0.Output, args: ["filterValueChange"] }], filterOperator: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterOperator", required: false }] }, { type: i0.Output, args: ["filterOperatorChange"] }], filterOperators: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterOperators", required: false }] }], fieldName: [{ type: i0.Input, args: [{ isSignal: true, alias: "fieldName", required: false }] }], sortable: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortable", required: false }] }], sortDirection: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortDirection", required: false }] }, { type: i0.Output, args: ["sortDirectionChange"] }], template: [{
138
145
  type: ContentChild,
139
146
  args: [TemplateRef]
140
147
  }] } });
@@ -166,23 +173,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImpo
166
173
  class TableComponent {
167
174
  _ls = inject(LocalizationService);
168
175
  _destroyRef = inject(DestroyRef);
176
+ _changeDetectorRef = inject(ChangeDetectorRef);
169
177
  _changeSubscription;
170
178
  _columns;
171
179
  _detailRow;
172
180
  _dataResult = signal(undefined, ...(ngDevMode ? [{ debugName: "_dataResult" }] : []));
173
- _lastRequest; // The last data request made to the data source
174
- _loadingRequest; // The current data request being processed
181
+ _error = signal(undefined, ...(ngDevMode ? [{ debugName: "_error" }] : []));
175
182
  _rowStates = new Map();
176
183
  _formatString = formatString;
177
- _dataSource;
178
184
  _pagingFormatter;
179
- _lastError;
180
185
  /**
181
186
  * The data source for the table.
182
187
  * This can be an array of data, a function that returns an observable of data,
183
188
  * or an instance of DataSource.
184
189
  */
185
- source = input.required(...(ngDevMode ? [{ debugName: "source" }] : []));
190
+ source = input.required(...(ngDevMode ? [{ debugName: "source", transform: dataSourceAttribute }] : [{ transform: dataSourceAttribute }]));
186
191
  /**
187
192
  * If true, the table will automatically load data when initialized.
188
193
  * This is useful for tables that need to display data immediately without user interaction.
@@ -275,40 +280,14 @@ class TableComponent {
275
280
  /**
276
281
  * The indicator to show while the table is loading data for the first time.
277
282
  */
278
- loadingIndicator = input('spinner', ...(ngDevMode ? [{ debugName: "loadingIndicator", transform: v => {
279
- if (typeof v === 'boolean') {
280
- return v ? 'spinner' : 'none';
281
- }
282
- return v;
283
- } }] : [{
284
- transform: v => {
285
- if (typeof v === 'boolean') {
286
- return v ? 'spinner' : 'none';
287
- }
288
- return v;
289
- }
290
- }]));
283
+ loadingIndicator = input('spinner', ...(ngDevMode ? [{ debugName: "loadingIndicator" }] : []));
291
284
  /** If true, the table will show a loading cover while data is being loaded.
292
285
  * This can be used to prevent user interaction with the table while loading.
293
286
  * This cover is not displayed when the table is loading for the first time.
294
287
  * Instead, the table will show a loading based on loadingIndicator settings.
295
288
  */
296
- loadingCover = input('spinner', ...(ngDevMode ? [{ debugName: "loadingCover", transform: v => {
297
- if (typeof v === 'boolean') {
298
- return v ? 'spinner' : 'none';
299
- }
300
- return v;
301
- } }] : [{
302
- transform: v => {
303
- if (typeof v === 'boolean') {
304
- return v ? 'spinner' : 'none';
305
- }
306
- return v;
307
- }
308
- }]));
309
- // @Input() rowColor?: (row: any) => BootstrapColor;
289
+ loadingCover = input('spinner', ...(ngDevMode ? [{ debugName: "loadingCover" }] : []));
310
290
  ngAfterContentInit() {
311
- this._dataSource = dataSourceAttribute(this.source());
312
291
  const locale = this._ls.get();
313
292
  this._pagingFormatter = locale?.definition.components?.table?.pagingInfo ??
314
293
  ((o) => `Showing ${o.firstRecord}-${o.lastRecord} of ${o.totalRecords} records`);
@@ -319,6 +298,13 @@ class TableComponent {
319
298
  this.load();
320
299
  }
321
300
  }
301
+ /**
302
+ * Manually triggers a refresh of the table. This can be used to update the table's display after making changes to the data or state.
303
+ * It will mark the component for check, which will cause Angular to re-render the component and update the displayed data.
304
+ */
305
+ refresh() {
306
+ this._changeDetectorRef.markForCheck();
307
+ }
322
308
  /**
323
309
  * Loads data from the data source based on the current state of the table (pagination, sorting, filtering).
324
310
  * This method can be called manually to refresh the data in the table.
@@ -326,13 +312,13 @@ class TableComponent {
326
312
  * and then call the load method of the data source with that request.
327
313
  */
328
314
  load(pageIndex) {
329
- let page;
330
315
  let filters = [];
316
+ let page;
331
317
  let sort;
332
318
  if (this.filterable()) {
333
319
  this._columns.forEach(col => {
334
320
  if (col.filterable() && col.filterValue() != '' && col.filterValue() != undefined) {
335
- filters.push({ field: col.fieldName() ?? col.filterField() ?? col.field(), value: col.filterValue(), operator: col.filterOperator() });
321
+ filters.push({ field: col.fieldName() ?? col.field(), value: col.filterValue(), operator: col.filterOperator() });
336
322
  }
337
323
  });
338
324
  }
@@ -354,18 +340,14 @@ class TableComponent {
354
340
  };
355
341
  }
356
342
  }
357
- this._loadingRequest = new DataRequest({ page, filters, sort, select: [], computeTotal: true });
358
- this._dataSource.load(this._loadingRequest)
343
+ var request = new DataRequest({ page, filters, sort, select: [], computeTotal: true });
344
+ this.source().load(request)
359
345
  .pipe(takeUntilDestroyed(this._destroyRef)).subscribe({
360
346
  next: result => {
361
347
  this._dataResult.set(result);
362
- this._lastRequest = this._loadingRequest;
363
- this._loadingRequest = undefined;
364
- this._lastError = undefined;
348
+ this._error.set(undefined);
365
349
  }, error: err => {
366
- this._lastError = err;
367
- this._lastRequest = this._loadingRequest;
368
- this._loadingRequest = undefined;
350
+ this._error.set(err);
369
351
  }
370
352
  });
371
353
  }
@@ -373,7 +355,7 @@ class TableComponent {
373
355
  * Determines if the table is currently loading data.
374
356
  */
375
357
  get isLoading() {
376
- return this._dataSource.isLoading;
358
+ return this.source().isLoading;
377
359
  }
378
360
  _getCellValue(row, col) {
379
361
  var subFields = col.field().split('.');
@@ -415,11 +397,15 @@ class TableComponent {
415
397
  this._columns.forEach(x => x.showFilterOperators.set(false));
416
398
  this.load(0);
417
399
  }
400
+ _onPageSizeOptionsItemSelect(e) {
401
+ this.pageSize.set(e.value);
402
+ this.load(0);
403
+ }
418
404
  ngOnDestroy() {
419
405
  this._changeSubscription?.unsubscribe();
420
406
  }
421
407
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
422
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.11", type: TableComponent, isStandalone: true, selector: "ng0-table", inputs: { source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: true, transformFunction: null }, autoLoad: { classPropertyName: "autoLoad", publicName: "autoLoad", isSignal: true, isRequired: false, transformFunction: null }, showRowNumbers: { classPropertyName: "showRowNumbers", publicName: "showRowNumbers", isSignal: true, isRequired: false, transformFunction: null }, showHeader: { classPropertyName: "showHeader", publicName: "showHeader", isSignal: true, isRequired: false, transformFunction: null }, pageable: { classPropertyName: "pageable", publicName: "pageable", isSignal: true, isRequired: false, transformFunction: null }, pageIndex: { classPropertyName: "pageIndex", publicName: "pageIndex", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, maxVisiblePages: { classPropertyName: "maxVisiblePages", publicName: "maxVisiblePages", isSignal: true, isRequired: false, transformFunction: null }, showPagingControls: { classPropertyName: "showPagingControls", publicName: "showPagingControls", isSignal: true, isRequired: false, transformFunction: null }, showFirstLastButtons: { classPropertyName: "showFirstLastButtons", publicName: "showFirstLastButtons", isSignal: true, isRequired: false, transformFunction: null }, showNextPreviousButtons: { classPropertyName: "showNextPreviousButtons", publicName: "showNextPreviousButtons", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, showPagingInfo: { classPropertyName: "showPagingInfo", publicName: "showPagingInfo", isSignal: true, isRequired: false, transformFunction: null }, sortable: { classPropertyName: "sortable", publicName: "sortable", isSignal: true, isRequired: false, transformFunction: null }, tableClass: { classPropertyName: "tableClass", publicName: "tableClass", isSignal: true, isRequired: false, transformFunction: null }, headerClass: { classPropertyName: "headerClass", publicName: "headerClass", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, filterable: { classPropertyName: "filterable", publicName: "filterable", isSignal: true, isRequired: false, transformFunction: null }, loadingIndicator: { classPropertyName: "loadingIndicator", publicName: "loadingIndicator", isSignal: true, isRequired: false, transformFunction: null }, loadingCover: { classPropertyName: "loadingCover", publicName: "loadingCover", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageIndex: "pageIndexChange", pageSize: "pageSizeChange" }, host: { properties: { "class.ng0-loading": "this.isLoading" } }, queries: [{ propertyName: "_detailRow", first: true, predicate: TableDetailRowDirective, descendants: true }, { propertyName: "_columns", predicate: TableColumnDirective }], exportAs: ["ng0Table"], ngImport: i0, template: "@let $dataResult = _dataResult();\n@let $pageable = pageable();\n@let $pageIndex = pageIndex();\n@let $pageSize = pageSize();\n@let $data = $dataResult?.data;\n@let $anyRecords = $data && $data.length > 0;\n@let $totalRecordsCount = $dataResult?.total;\n@let $firstRecordIndex = $pageable ? ($pageSize * $pageIndex) : 0;\n@let $lastRecordIndex = $data ? $firstRecordIndex + $data.length - 1 : 1;\n@let $isLoading = _dataSource.isLoading();\n@let $isFirstLoad = $dataResult == undefined;\n@let $columnsCount = _columns.length + (showRowNumbers() ? 1 : 0);\n@let $tableLocale = _ls.get()?.definition?.components?.table;\n\n<div class=\"table-responsive\" [style.height]=\"height()\" [class.table-scrollable]=\"height()! > 0\">\n <table class=\"table\" [ngClass]=\"tableClass()\">\n @if (caption()) {\n <caption>{{caption()}}</caption>\n }\n\n @if (showHeader()) {\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n }\n\n @if (filterable()) {\n <ng-container *ngTemplateOutlet=\"filtersTemplate\"></ng-container>\n }\n\n <tbody>\n @if ($isLoading && $isFirstLoad && loadingIndicator()) {\n <tr class=\"ng0-table-loading-row\">\n <td [attr.colspan]=\"$columnsCount\">\n @switch (loadingIndicator()) {\n @case ('spinner') {\n <div class=\"text-center\">\n <div class=\"spinner-border\" role=\"status\"></div>\n </div>\n }\n }\n </td>\n </tr>\n } @else {\n @if ($data) {\n @if ($data.length > 0) {\n <ng-container *ngTemplateOutlet=\"dataRowsTemplate\"></ng-container>\n } @else {\n <tr class=\"ng0-table-no-records-row\">\n <td [attr.colSpan]=\"$columnsCount\" class=\"text-center p-2\">\n {{ $tableLocale?.noRecords ?? 'No Records.' }}\n </td>\n </tr>\n }\n } @else if (_lastError) {\n <ng-container *ngTemplateOutlet=\"nowDataTemplate\"></ng-container>\n }\n }\n </tbody>\n </table>\n</div>\n\n<div class=\"ng0-table-footer d-flex align-items-baseline\">\n <ng-container *ngTemplateOutlet=\"footerTemplate\"></ng-container>\n</div>\n\n@if ($isLoading && !$isFirstLoad && loadingCover()) {\n<div class=\"ng0-table-loading-cover text-center\">\n @if (loadingCover() == 'spinner') {\n <div class=\"spinner-border\" role=\"status\"></div>\n }\n</div>\n}\n\n<ng-template #filtersTemplate>\n <thead>\n <tr>\n @if (_detailRow) {\n <th></th>\n }\n\n @if (showRowNumbers()) {\n <th></th>\n }\n\n @for (col of _columns; track $index) {\n <th>\n @if(col.filterable() && (col.field() || col.filterValue())) {\n\n <div class=\"input-group\">\n @switch (col.type()) {\n @case ('text') {\n <input [name]=\"'filter-' + col.field\"\n type=\"search\"\n [maxlength]=\"50\"\n class=\"form-control form-control-sm\"\n [(ngModel)]=\"col.filterValue\"\n (keydown.enter)=\"load(0)\">\n }\n @case ('number') {\n <input [name]=\"'datatablecol-' + col.field\"\n type=\"search\"\n ng0Number\n class=\"form-control form-control-sm\"\n [(ngModel)]=\"col.filterValue\"\n (keydown.enter)=\"load(0)\">\n }\n }\n\n <button class=\"btn btn-outline-light\"\n style=\"border-color: var(--bs-border-color);\"\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n (click)=\"_onToggleFilterOperator(col)\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M19 3H5C3.58579 3 2.87868 3 2.43934 3.4122C2 3.8244 2 4.48782 2 5.81466V6.50448C2 7.54232 2 8.06124 2.2596 8.49142C2.5192 8.9216 2.99347 9.18858 3.94202 9.72255L6.85504 11.3624C7.49146 11.7206 7.80967 11.8998 8.03751 12.0976C8.51199 12.5095 8.80408 12.9935 8.93644 13.5872C9 13.8722 9 14.2058 9 14.8729L9 17.5424C9 18.452 9 18.9067 9.25192 19.2613C9.50385 19.6158 9.95128 19.7907 10.8462 20.1406C12.7248 20.875 13.6641 21.2422 14.3321 20.8244C15 20.4066 15 19.4519 15 17.5424V14.8729C15 14.2058 15 13.8722 15.0636 13.5872C15.1959 12.9935 15.488 12.5095 15.9625 12.0976C16.1903 11.8998 16.5085 11.7206 17.145 11.3624L20.058 9.72255C21.0065 9.18858 21.4808 8.9216 21.7404 8.49142C22 8.06124 22 7.54232 22 6.50448V5.81466C22 4.48782 22 3.8244 21.5607 3.4122C21.1213 3 20.4142 3 19 3Z\"\n stroke=\"#1C274C\" stroke-width=\"1.5\" />\n </svg>\n </button>\n </div>\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"col.showFilterOperators()\"\n (overlayOutsideClick)=\"col.showFilterOperators.set(false)\"\n (detach)=\"col.showFilterOperators.set(false)\">\n <ul class=\"dropdown-menu show\" animate.enter=\"fade-in\">\n @for (item of col.getFilterOperators(); track $index) {\n <li>\n <button class=\"dropdown-item\" [class.active]=\"item == col.filterOperator()\"\n (click)=\"_onSelectFilterOperator(col, item)\">\n {{_ls.get()?.definition?.data?.logicalOperators?.[item] ?? item }}\n </button>\n </li>\n }\n </ul>\n </ng-template>\n }\n </th>\n }\n </tr>\n </thead>\n</ng-template>\n\n<ng-template #headerTemplate>\n <thead [ngClass]=\"headerClass()\">\n <tr>\n @if (_detailRow) {\n <th></th>\n }\n\n @if (showRowNumbers()) {\n <th class=\"row-number text-muted\">#</th>\n }\n\n @for (col of _columns; track $index) {\n <th\n (click)=\"col.toggleSortDirection(); load()\"\n [class.sortable]=\"sortable() && col.sortable()\"\n [ngClass]=\"{ \n 'sort-asc': col.sortDirection() == 'asc', \n 'sort-desc': col.sortDirection() == 'desc',\n 'sort-none': col.sortDirection() == 'none'\n }\">\n {{ col.title() }}\n\n @if(sortable() && col.sortable()) {\n <svg class=\"ng0-table-sort-icon\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\" fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L12 16\" stroke=\"currentColor\" stroke-width=\"1\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n <path d=\"M8 13L12 17L16 13\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"\n stroke-linejoin=\"round\" />\n </svg>\n }\n </th>\n }\n </tr>\n </thead>\n</ng-template>\n\n<ng-template #dataRowsTemplate>\n @for (row of $data; track $index) {\n <tr [class.table-active]=\"isRowExpanded(row)\">\n @if (_detailRow) {\n <td class=\"detail-row-expander\">\n @if (_detailRow.showCallback == null || _detailRow.showCallback(row)) {\n <button class=\"btn\" (click)=\"_onToggleRowDetailClick(row)\">\n @if (isRowExpanded(row)) {\n <i class=\"far fa-minus\"></i>\n } @else {\n <i class=\"far fa-plus\"></i>\n }\n </button>\n }\n </td>\n }\n\n @if (showRowNumbers()) {\n <td class=\"ng0-table-row-number\">\n {{ $firstRecordIndex + $index + 1}}\n </td>\n }\n\n @for (col of _columns; track $index) {\n <td\n [ngClass]=\"col.cellClass()\"\n [class.shrinked]=\"col.shrink()\"\n [class.fw-bold]=\"col.bold()\">\n @if (col.template) {\n <ng-container *ngTemplateOutlet=\"col.template; context: { $implicit: row }\">\n </ng-container>\n } @else if (col.field()) {\n @let cellValue = _getCellValue(row, col);\n\n @if ((cellValue === null || cellValue === undefined) && col.emptyCellText()) {\n {{ col.emptyCellText() }}\n } @else {\n @if (col.type()) {\n @let type = $any(col.type());\n\n @if (type == \"date\") {\n {{ cellValue | ng0Date }}\n } @else if (type == \"number\") {\n {{ cellValue | number }}\n } @else if (type == \"currency\") {\n {{ cellValue | currency }}\n } @else if (type.enum) {\n {{ cellValue | ng0TranslateEnum: type.enum.name : type.enum.fallback }}\n } @else if (type.boolean || type == \"boolean\") {\n {{ cellValue | ng0LocalizeBool: type.boolean.false ?? \"false\" : type.boolean.false ?? \"true\" }}\n }@else {\n {{ cellValue }}\n }\n }\n }\n }\n </td>\n }\n </tr>\n\n @if (_detailRow && isRowExpanded(row)) {\n <tr class=\"detail-row\">\n <td\n [attr.colspan]=\"_columns.length + (showRowNumbers() ? 1 : 0) + 1\"\n class=\"ps-2 pb-4\">\n <ng-container\n *ngTemplateOutlet=\"_detailRow.templateRef; context: { $implicit: row }\"></ng-container>\n </td>\n </tr>\n }\n }\n</ng-template>\n\n<ng-template #footerTemplate>\n @if ($pageable && showPagingControls() && $anyRecords && $totalRecordsCount! > 0) {\n <div class=\"ng0-table-pagination me-2\">\n <ng0-pagination\n class=\"mb-0 d-inline-block\"\n [showFirstLastButtons]=\"showFirstLastButtons()\"\n [showNextPreviousButtons]=\"showNextPreviousButtons()\"\n [totalRecords]=\"$totalRecordsCount!\"\n [pageSize]=\"pageSize()\"\n [selectedPage]=\"pageIndex()\"\n (itemClick)=\"_onPageChange($event)\"\n [maxVisiblePages]=\"maxVisiblePages()\">\n <ng-container ngProjectAs=\"first\">\n <ng-content select=\"paging-first\">\n {{ \"first\" | ng0Translate }}\n </ng-content>\n </ng-container>\n\n <ng-container ngProjectAs=\"last\">\n <ng-content select=\"paging-last\">\n {{ \"last\" | ng0Translate }}\n </ng-content>\n </ng-container>\n\n <ng-container ngProjectAs=\"next\">\n <ng-content select=\"paging-next\">\n {{ \"next\" | ng0Translate }}\n </ng-content>\n </ng-container>\n\n <ng-container ngProjectAs=\"previous\">\n <ng-content select=\"paging-previous\">\n {{ \"previous\" | ng0Translate }}\n </ng-content>\n </ng-container>\n </ng0-pagination>\n </div>\n\n @if (pageSizeOptions()) {\n <div class=\"ng0-table-paging-options\">\n <select name=\"pageSizeOptions\" class=\"form-select w-auto d-inline-block\">\n <option [ngValue]=\"10\" selected>10</option>\n </select>\n </div>\n }\n\n @if (showPagingInfo()) {\n <div class=\"ng0-table-paging-info ms-auto\">\n <ng-content select=\"paging-info\">\n {{\n _pagingFormatter({firstRecord: $firstRecordIndex, lastRecord: $lastRecordIndex, totalRecords: $totalRecordsCount!,\n currentPage: $pageIndex!})\n }}\n </ng-content>\n </div>\n }\n }\n</ng-template>\n\n<ng-template #nowDataTemplate>\n <tr class=\"ng0-table-error-row\">\n <td [attr.colSpan]=\"$columnsCount\" class=\"p-2\">\n <div class=\"d-flex align-items-baseline\">\n <span>{{ $tableLocale?.loadError ?? 'Error loading data.' }} </span>\n <button (click)=\"load()\" class=\"btn btn-warning ms-auto\">\n {{ \"retry\" | ng0Translate }}\n </button>\n </div>\n </td>\n </tr>\n</ng-template>", styles: [":host{display:flex;flex-direction:column;position:relative}@starting-style{.ng0-table-loading-cover{background-color:#0000}}table{margin-bottom:0;height:100%}th.sortable{cursor:pointer;-webkit-user-select:none;user-select:none}th.sortable .ng0-table-sort-icon{transition:transform .2s;opacity:0}th.sortable.sort-none:hover .ng0-table-sort-icon{opacity:.4}th.sortable.sort-asc .ng0-table-sort-icon{transform:rotate(0);opacity:1;color:var(--bs-danger)}th.sortable.sort-desc .ng0-table-sort-icon{transform:rotate(180deg);opacity:1;color:var(--bs-primary)}tbody{position:relative}td.row-number{width:0}td.shrinked{width:0;white-space:nowrap}.ng0-table-loading-cover{position:absolute;inset:0;background-color:#0000000d;transition:background-color .2s;z-index:1000;display:flex;align-items:center;justify-content:center}.table-scrollable{overflow-y:auto;direction:ltr;scroll-padding:20px}.table-scrollable::-webkit-scrollbar{width:8px}.table-scrollable::-webkit-scrollbar-track{background-color:#00000008}.table-scrollable::-webkit-scrollbar-thumb{background-color:var(--bs-secondary)}.table-scrollable thead th{position:sticky;top:0}.ng0-table-footer{margin-top:.5rem}.fade-in{animation:fade-in .5s}@keyframes fade-in{0%{opacity:0}to{opacity:1}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: LocalizationModule }, { kind: "component", type: PaginationComponent, selector: "ng0-pagination", inputs: ["totalRecords", "pageSize", "selectedPage", "maxVisiblePages", "showNextPreviousButtons", "showFirstLastButtons"], outputs: ["itemClick"], exportAs: ["ng0Pagination"] }, { kind: "directive", type: NumberDirective, selector: "[ng0Number]", inputs: ["minFractionDigits", "maxFractionDigits", "useGrouping", "numberType"] }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i3.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i3.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }, { kind: "pipe", type: i1.CurrencyPipe, name: "currency" }, { kind: "pipe", type: i4.TranslatePipe, name: "ng0Translate" }, { kind: "pipe", type: i4.TranslateEnumPipe, name: "ng0TranslateEnum" }, { kind: "pipe", type: i4.DatePipe, name: "ng0Date" }, { kind: "pipe", type: i4.LocalizeBooleanPipe, name: "ng0LocalizeBool" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
408
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.11", type: TableComponent, isStandalone: true, selector: "ng0-table", inputs: { source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: true, transformFunction: null }, autoLoad: { classPropertyName: "autoLoad", publicName: "autoLoad", isSignal: true, isRequired: false, transformFunction: null }, showRowNumbers: { classPropertyName: "showRowNumbers", publicName: "showRowNumbers", isSignal: true, isRequired: false, transformFunction: null }, showHeader: { classPropertyName: "showHeader", publicName: "showHeader", isSignal: true, isRequired: false, transformFunction: null }, pageable: { classPropertyName: "pageable", publicName: "pageable", isSignal: true, isRequired: false, transformFunction: null }, pageIndex: { classPropertyName: "pageIndex", publicName: "pageIndex", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, maxVisiblePages: { classPropertyName: "maxVisiblePages", publicName: "maxVisiblePages", isSignal: true, isRequired: false, transformFunction: null }, showPagingControls: { classPropertyName: "showPagingControls", publicName: "showPagingControls", isSignal: true, isRequired: false, transformFunction: null }, showFirstLastButtons: { classPropertyName: "showFirstLastButtons", publicName: "showFirstLastButtons", isSignal: true, isRequired: false, transformFunction: null }, showNextPreviousButtons: { classPropertyName: "showNextPreviousButtons", publicName: "showNextPreviousButtons", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, showPagingInfo: { classPropertyName: "showPagingInfo", publicName: "showPagingInfo", isSignal: true, isRequired: false, transformFunction: null }, sortable: { classPropertyName: "sortable", publicName: "sortable", isSignal: true, isRequired: false, transformFunction: null }, tableClass: { classPropertyName: "tableClass", publicName: "tableClass", isSignal: true, isRequired: false, transformFunction: null }, headerClass: { classPropertyName: "headerClass", publicName: "headerClass", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, filterable: { classPropertyName: "filterable", publicName: "filterable", isSignal: true, isRequired: false, transformFunction: null }, loadingIndicator: { classPropertyName: "loadingIndicator", publicName: "loadingIndicator", isSignal: true, isRequired: false, transformFunction: null }, loadingCover: { classPropertyName: "loadingCover", publicName: "loadingCover", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageIndex: "pageIndexChange", pageSize: "pageSizeChange" }, host: { properties: { "class.ng0-loading": "this.isLoading" } }, queries: [{ propertyName: "_detailRow", first: true, predicate: TableDetailRowDirective, descendants: true }, { propertyName: "_columns", predicate: TableColumnDirective }], exportAs: ["ng0Table"], ngImport: i0, template: "@let $dataResult = _dataResult();\n@let $pageable = pageable();\n@let $pageIndex = pageIndex();\n@let $pageSize = pageSize();\n@let $data = $dataResult?.data;\n@let $anyRecords = $data && $data.length > 0;\n@let $totalRecordsCount = $dataResult?.total;\n@let $firstRecordIndex = $pageable ? ($pageSize * $pageIndex) : 0;\n@let $lastRecordIndex = $data ? $firstRecordIndex + $data.length - 1 : 1;\n@let $isFirstLoad = $dataResult == undefined;\n@let $columnsCount = _columns.length + (showRowNumbers() ? 1 : 0);\n@let $tableLocale = _ls.get()?.definition?.components?.table;\n\n<div class=\"table-responsive\" [style.height]=\"height()\" [class.table-scrollable]=\"height()! > 0\">\n <table class=\"table\" [ngClass]=\"tableClass()\">\n @if (caption()) {\n <caption>\n {{caption()}}\n </caption>\n }\n\n @if (showHeader()) {\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n }\n\n @if (filterable()) {\n <ng-container *ngTemplateOutlet=\"filtersTemplate\"></ng-container>\n }\n\n <tbody>\n @if (isLoading() && $isFirstLoad && loadingIndicator()) {\n <tr class=\"ng0-table-loading-row\">\n <td [attr.colspan]=\"$columnsCount\">\n @switch (loadingIndicator()) {\n @case ('spinner') {\n <div class=\"text-center\">\n <div class=\"spinner-border\" role=\"status\"></div>\n </div>\n }\n }\n </td>\n </tr>\n } @else {\n @if ($data) {\n @if ($data.length > 0) {\n <ng-container *ngTemplateOutlet=\"dataRowsTemplate\" />\n } @else {\n <tr class=\"ng0-table-no-records-row\">\n <td [attr.colSpan]=\"$columnsCount\" class=\"text-center p-2\">\n {{ $tableLocale?.noRecords ?? 'No Records.' }}\n </td>\n </tr>\n }\n } @else if (_error()) {\n <ng-container *ngTemplateOutlet=\"nowDataTemplate\"></ng-container>\n }\n }\n </tbody>\n </table>\n</div>\n\n<div class=\"ng0-table-footer d-flex align-items-baseline\">\n <ng-container *ngTemplateOutlet=\"footerTemplate\"></ng-container>\n</div>\n\n@if (isLoading() && !$isFirstLoad && loadingCover()) {\n <div class=\"ng0-table-loading-cover text-center\">\n @if (loadingCover() == 'spinner') {\n <div class=\"spinner-border\" role=\"status\"></div>\n }\n </div>\n}\n\n<ng-template #filtersTemplate>\n <thead>\n <tr>\n @if (_detailRow) {\n <th></th>\n }\n\n @if (showRowNumbers()) {\n <th></th>\n }\n\n @for (col of _columns; track $index) {\n <th>\n @if (col.filterable() && (col.field() || col.filterValue())) {\n <div class=\"input-group\">\n @switch (col.type()) {\n @case ('text') {\n <input\n [name]=\"'filter-' + col.field\"\n type=\"search\"\n [maxlength]=\"50\"\n class=\"form-control form-control-sm\"\n [(ngModel)]=\"col.filterValue\"\n (keydown.enter)=\"load(0)\" />\n }\n @case ('number') {\n <input\n [name]=\"'datatablecol-' + col.field\"\n type=\"search\"\n ng0Number\n class=\"form-control form-control-sm\"\n [(ngModel)]=\"col.filterValue\"\n (keydown.enter)=\"load(0)\" />\n }\n }\n\n <button\n class=\"btn btn-outline-light\"\n style=\"border-color: var(--bs-border-color);\"\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n (click)=\"_onToggleFilterOperator(col)\">\n <ng0-icon-filter1 />\n </button>\n </div>\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"col.showFilterOperators()\"\n (overlayOutsideClick)=\"col.showFilterOperators.set(false)\"\n (detach)=\"col.showFilterOperators.set(false)\">\n <ul class=\"dropdown-menu show\" animate.enter=\"fade-in\">\n @for (item of col.getFilterOperators(); track $index) {\n <li>\n <button\n class=\"dropdown-item\"\n [class.active]=\"item == col.filterOperator()\"\n (click)=\"_onSelectFilterOperator(col, item)\">\n {{_ls.get()?.definition?.data?.logicalOperators?.[item] ?? item }}\n </button>\n </li>\n }\n </ul>\n </ng-template>\n }\n </th>\n }\n </tr>\n </thead>\n</ng-template>\n\n<ng-template #headerTemplate>\n <thead [ngClass]=\"headerClass()\">\n <tr>\n @if (_detailRow) {\n <th></th>\n }\n\n @if (showRowNumbers()) {\n <th class=\"row-number text-muted\">#</th>\n }\n\n @for (col of _columns; track $index) {\n <th\n (click)=\"col.toggleSortDirection(); load()\"\n [class.sortable]=\"sortable() && col.sortable()\"\n [ngClass]=\"{ \n 'sort-asc': col.sortDirection() == 'asc', \n 'sort-desc': col.sortDirection() == 'desc',\n 'sort-none': col.sortDirection() == 'none'\n }\">\n {{ col.title() }}\n\n @if (sortable() && col.sortable()) {\n <svg\n class=\"ng0-table-sort-icon\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M12 7L12 16\"\n stroke=\"currentColor\"\n stroke-width=\"1\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\" />\n <path\n d=\"M8 13L12 17L16 13\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\" />\n </svg>\n }\n </th>\n }\n </tr>\n </thead>\n</ng-template>\n\n<ng-template #dataRowsTemplate>\n @for (row of $data; track $index) {\n <tr [class.table-active]=\"isRowExpanded(row)\">\n @if (_detailRow) {\n <td class=\"detail-row-expander\">\n @if (_detailRow.showCallback == null || _detailRow.showCallback(row)) {\n <button class=\"btn\" (click)=\"_onToggleRowDetailClick(row)\">\n @if (isRowExpanded(row)) {\n <i class=\"far fa-minus\"></i>\n } @else {\n <i class=\"far fa-plus\"></i>\n }\n </button>\n }\n </td>\n }\n\n @if (showRowNumbers()) {\n <td class=\"ng0-table-row-number\">\n {{ $firstRecordIndex + $index + 1}}\n </td>\n }\n\n @for (col of _columns; track $index) {\n <td\n [ngClass]=\"col.cellClass()\"\n [class.shrinked]=\"col.shrink()\"\n [class.fw-bold]=\"col.bold()\">\n @if (col.template) {\n <ng-container *ngTemplateOutlet=\"col.template; context: { $implicit: row }\">\n </ng-container>\n } @else if (col.field()) {\n @let cellValue = _getCellValue(row, col);\n\n @if (\n (cellValue === null || cellValue === undefined) && col.emptyCellText()\n ) {\n {{ col.emptyCellText() }}\n } @else {\n @if (col.type()) {\n @let type = $any(col.type());\n\n @if (type == \"date\") {\n {{ cellValue | ng0Date }}\n } @else if (type == \"number\") {\n {{ cellValue | number }}\n } @else if (type == \"currency\") {\n {{ cellValue | currency }}\n } @else if (type.enum) {\n {{ cellValue | ng0TranslateEnum: type.enum.name : type.enum.fallback }}\n } @else if (type.boolean || type == \"boolean\") {\n {{ cellValue | ng0LocalizeBool: type.boolean.false ?? \"false\" : type.boolean.false ?? \"true\" }}\n } @else {\n {{ cellValue }}\n }\n }\n }\n } @else if(col.formatBy()) {\n {{col.formatBy()(row)}}\n } \n </td>\n }\n </tr>\n\n @if (_detailRow && isRowExpanded(row)) {\n <tr class=\"detail-row\">\n <td\n [attr.colspan]=\"_columns.length + (showRowNumbers() ? 1 : 0) + 1\"\n class=\"ps-2 pb-4\">\n <ng-container\n *ngTemplateOutlet=\"_detailRow.templateRef; context: { $implicit: row }\"></ng-container>\n </td>\n </tr>\n }\n }\n</ng-template>\n\n<ng-template #footerTemplate>\n @if ($pageable && showPagingControls() && $anyRecords && $totalRecordsCount! > 0) {\n <div class=\"ng0-table-pagination me-2\">\n <ng0-pagination\n class=\"mb-0 d-inline-block\"\n [showFirstLastButtons]=\"showFirstLastButtons()\"\n [showNextPreviousButtons]=\"showNextPreviousButtons()\"\n [totalRecords]=\"$totalRecordsCount!\"\n [pageSize]=\"pageSize()\"\n [selectedPage]=\"pageIndex()\"\n (itemClick)=\"_onPageChange($event)\"\n [maxVisiblePages]=\"maxVisiblePages()\">\n <ng-container ngProjectAs=\"first\">\n <ng-content select=\"paging-first\">\n {{ \"first\" | ng0Translate }}\n </ng-content>\n </ng-container>\n\n <ng-container ngProjectAs=\"last\">\n <ng-content select=\"paging-last\">\n {{ \"last\" | ng0Translate }}\n </ng-content>\n </ng-container>\n\n <ng-container ngProjectAs=\"next\">\n <ng-content select=\"paging-next\">\n {{ \"next\" | ng0Translate }}\n </ng-content>\n </ng-container>\n\n <ng-container ngProjectAs=\"previous\">\n <ng-content select=\"paging-previous\">\n {{ \"previous\" | ng0Translate }}\n </ng-content>\n </ng-container>\n </ng0-pagination>\n </div>\n\n @if (pageSizeOptions()) {\n <div class=\"ng0-table-paging-options\">\n <ng0-select\n name=\"pageSize\"\n [source]=\"pageSizeOptions()\"\n [(ngModel)]=\"pageSize\"\n (itemSelect)=\"_onPageSizeOptionsItemSelect($event)\"></ng0-select>\n <!-- <select name=\"pageSizeOptions\" class=\"form-select w-auto d-inline-block\">\n <option [ngValue]=\"10\" selected>10</option>\n </select> -->\n </div>\n }\n\n @if (showPagingInfo()) {\n <div class=\"ng0-table-paging-info ms-auto\">\n <ng-content select=\"paging-info\">\n {{\n _pagingFormatter({firstRecord: $firstRecordIndex + 1, lastRecord: $lastRecordIndex + 1, totalRecords:\n $totalRecordsCount!,\n currentPage: $pageIndex!})\n }}\n </ng-content>\n </div>\n }\n }\n</ng-template>\n\n<ng-template #nowDataTemplate>\n <tr class=\"ng0-table-error-row\">\n <td [attr.colSpan]=\"$columnsCount\" class=\"p-2\">\n <div class=\"d-flex align-items-baseline\">\n <span>{{ $tableLocale?.loadError ?? 'Error loading data.' }} </span>\n <button (click)=\"load()\" class=\"btn btn-warning ms-auto\">\n {{ \"retry\" | ng0Translate }}\n </button>\n </div>\n </td>\n </tr>\n</ng-template>\n", styles: [":host{display:flex;flex-direction:column;position:relative}@starting-style{.ng0-table-loading-cover{background-color:#0000}}table{margin-bottom:0;height:100%}th.sortable{cursor:pointer;-webkit-user-select:none;user-select:none}th.sortable .ng0-table-sort-icon{transition:transform .2s;opacity:0}th.sortable.sort-none:hover .ng0-table-sort-icon{opacity:.4}th.sortable.sort-asc .ng0-table-sort-icon{transform:rotate(0);opacity:1;color:var(--bs-danger)}th.sortable.sort-desc .ng0-table-sort-icon{transform:rotate(180deg);opacity:1;color:var(--bs-primary)}tbody{position:relative}td.row-number{width:0}td.shrinked{width:0;white-space:nowrap}.ng0-table-loading-cover{position:absolute;inset:0;background-color:#0000000d;transition:background-color .2s;z-index:1000;display:flex;align-items:center;justify-content:center}.table-scrollable{overflow-y:auto;direction:ltr;scroll-padding:20px}.table-scrollable::-webkit-scrollbar{width:8px}.table-scrollable::-webkit-scrollbar-track{background-color:#00000008}.table-scrollable::-webkit-scrollbar-thumb{background-color:var(--bs-secondary)}.table-scrollable thead th{position:sticky;top:0}.ng0-table-footer{margin-top:.5rem}.fade-in{animation:fade-in .5s}@keyframes fade-in{0%{opacity:0}to{opacity:1}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: LocalizationModule }, { kind: "component", type: PaginationComponent, selector: "ng0-pagination", inputs: ["totalRecords", "pageSize", "selectedPage", "maxVisiblePages", "showNextPreviousButtons", "showFirstLastButtons"], outputs: ["itemClick"], exportAs: ["ng0Pagination"] }, { kind: "directive", type: NumberDirective, selector: "[ng0Number]", inputs: ["minFractionDigits", "maxFractionDigits", "useGrouping", "numberType"] }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i3.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i3.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "component", type: SelectComponent, selector: "ng0-select", inputs: ["source", "multiple", "showSelectionIndicator", "open", "compareBy", "formatBy", "writeBy", "filterable", "filterBy", "filterPlaceholder", "itemClass", "idGenerator"], outputs: ["openChange", "itemSelect"], exportAs: ["ng0Select"] }, { kind: "component", type: Filter1Icon, selector: "ng0-icon-filter1" }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }, { kind: "pipe", type: i1.CurrencyPipe, name: "currency" }, { kind: "pipe", type: i4.TranslatePipe, name: "ng0Translate" }, { kind: "pipe", type: i4.TranslateEnumPipe, name: "ng0TranslateEnum" }, { kind: "pipe", type: i4.DatePipe, name: "ng0Date" }, { kind: "pipe", type: i4.LocalizeBooleanPipe, name: "ng0LocalizeBool" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
423
409
  }
424
410
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: TableComponent, decorators: [{
425
411
  type: Component,
@@ -429,8 +415,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImpo
429
415
  LocalizationModule,
430
416
  PaginationComponent,
431
417
  NumberDirective,
432
- OverlayModule
433
- ], template: "@let $dataResult = _dataResult();\n@let $pageable = pageable();\n@let $pageIndex = pageIndex();\n@let $pageSize = pageSize();\n@let $data = $dataResult?.data;\n@let $anyRecords = $data && $data.length > 0;\n@let $totalRecordsCount = $dataResult?.total;\n@let $firstRecordIndex = $pageable ? ($pageSize * $pageIndex) : 0;\n@let $lastRecordIndex = $data ? $firstRecordIndex + $data.length - 1 : 1;\n@let $isLoading = _dataSource.isLoading();\n@let $isFirstLoad = $dataResult == undefined;\n@let $columnsCount = _columns.length + (showRowNumbers() ? 1 : 0);\n@let $tableLocale = _ls.get()?.definition?.components?.table;\n\n<div class=\"table-responsive\" [style.height]=\"height()\" [class.table-scrollable]=\"height()! > 0\">\n <table class=\"table\" [ngClass]=\"tableClass()\">\n @if (caption()) {\n <caption>{{caption()}}</caption>\n }\n\n @if (showHeader()) {\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n }\n\n @if (filterable()) {\n <ng-container *ngTemplateOutlet=\"filtersTemplate\"></ng-container>\n }\n\n <tbody>\n @if ($isLoading && $isFirstLoad && loadingIndicator()) {\n <tr class=\"ng0-table-loading-row\">\n <td [attr.colspan]=\"$columnsCount\">\n @switch (loadingIndicator()) {\n @case ('spinner') {\n <div class=\"text-center\">\n <div class=\"spinner-border\" role=\"status\"></div>\n </div>\n }\n }\n </td>\n </tr>\n } @else {\n @if ($data) {\n @if ($data.length > 0) {\n <ng-container *ngTemplateOutlet=\"dataRowsTemplate\"></ng-container>\n } @else {\n <tr class=\"ng0-table-no-records-row\">\n <td [attr.colSpan]=\"$columnsCount\" class=\"text-center p-2\">\n {{ $tableLocale?.noRecords ?? 'No Records.' }}\n </td>\n </tr>\n }\n } @else if (_lastError) {\n <ng-container *ngTemplateOutlet=\"nowDataTemplate\"></ng-container>\n }\n }\n </tbody>\n </table>\n</div>\n\n<div class=\"ng0-table-footer d-flex align-items-baseline\">\n <ng-container *ngTemplateOutlet=\"footerTemplate\"></ng-container>\n</div>\n\n@if ($isLoading && !$isFirstLoad && loadingCover()) {\n<div class=\"ng0-table-loading-cover text-center\">\n @if (loadingCover() == 'spinner') {\n <div class=\"spinner-border\" role=\"status\"></div>\n }\n</div>\n}\n\n<ng-template #filtersTemplate>\n <thead>\n <tr>\n @if (_detailRow) {\n <th></th>\n }\n\n @if (showRowNumbers()) {\n <th></th>\n }\n\n @for (col of _columns; track $index) {\n <th>\n @if(col.filterable() && (col.field() || col.filterValue())) {\n\n <div class=\"input-group\">\n @switch (col.type()) {\n @case ('text') {\n <input [name]=\"'filter-' + col.field\"\n type=\"search\"\n [maxlength]=\"50\"\n class=\"form-control form-control-sm\"\n [(ngModel)]=\"col.filterValue\"\n (keydown.enter)=\"load(0)\">\n }\n @case ('number') {\n <input [name]=\"'datatablecol-' + col.field\"\n type=\"search\"\n ng0Number\n class=\"form-control form-control-sm\"\n [(ngModel)]=\"col.filterValue\"\n (keydown.enter)=\"load(0)\">\n }\n }\n\n <button class=\"btn btn-outline-light\"\n style=\"border-color: var(--bs-border-color);\"\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n (click)=\"_onToggleFilterOperator(col)\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M19 3H5C3.58579 3 2.87868 3 2.43934 3.4122C2 3.8244 2 4.48782 2 5.81466V6.50448C2 7.54232 2 8.06124 2.2596 8.49142C2.5192 8.9216 2.99347 9.18858 3.94202 9.72255L6.85504 11.3624C7.49146 11.7206 7.80967 11.8998 8.03751 12.0976C8.51199 12.5095 8.80408 12.9935 8.93644 13.5872C9 13.8722 9 14.2058 9 14.8729L9 17.5424C9 18.452 9 18.9067 9.25192 19.2613C9.50385 19.6158 9.95128 19.7907 10.8462 20.1406C12.7248 20.875 13.6641 21.2422 14.3321 20.8244C15 20.4066 15 19.4519 15 17.5424V14.8729C15 14.2058 15 13.8722 15.0636 13.5872C15.1959 12.9935 15.488 12.5095 15.9625 12.0976C16.1903 11.8998 16.5085 11.7206 17.145 11.3624L20.058 9.72255C21.0065 9.18858 21.4808 8.9216 21.7404 8.49142C22 8.06124 22 7.54232 22 6.50448V5.81466C22 4.48782 22 3.8244 21.5607 3.4122C21.1213 3 20.4142 3 19 3Z\"\n stroke=\"#1C274C\" stroke-width=\"1.5\" />\n </svg>\n </button>\n </div>\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"col.showFilterOperators()\"\n (overlayOutsideClick)=\"col.showFilterOperators.set(false)\"\n (detach)=\"col.showFilterOperators.set(false)\">\n <ul class=\"dropdown-menu show\" animate.enter=\"fade-in\">\n @for (item of col.getFilterOperators(); track $index) {\n <li>\n <button class=\"dropdown-item\" [class.active]=\"item == col.filterOperator()\"\n (click)=\"_onSelectFilterOperator(col, item)\">\n {{_ls.get()?.definition?.data?.logicalOperators?.[item] ?? item }}\n </button>\n </li>\n }\n </ul>\n </ng-template>\n }\n </th>\n }\n </tr>\n </thead>\n</ng-template>\n\n<ng-template #headerTemplate>\n <thead [ngClass]=\"headerClass()\">\n <tr>\n @if (_detailRow) {\n <th></th>\n }\n\n @if (showRowNumbers()) {\n <th class=\"row-number text-muted\">#</th>\n }\n\n @for (col of _columns; track $index) {\n <th\n (click)=\"col.toggleSortDirection(); load()\"\n [class.sortable]=\"sortable() && col.sortable()\"\n [ngClass]=\"{ \n 'sort-asc': col.sortDirection() == 'asc', \n 'sort-desc': col.sortDirection() == 'desc',\n 'sort-none': col.sortDirection() == 'none'\n }\">\n {{ col.title() }}\n\n @if(sortable() && col.sortable()) {\n <svg class=\"ng0-table-sort-icon\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\" fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L12 16\" stroke=\"currentColor\" stroke-width=\"1\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n <path d=\"M8 13L12 17L16 13\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"\n stroke-linejoin=\"round\" />\n </svg>\n }\n </th>\n }\n </tr>\n </thead>\n</ng-template>\n\n<ng-template #dataRowsTemplate>\n @for (row of $data; track $index) {\n <tr [class.table-active]=\"isRowExpanded(row)\">\n @if (_detailRow) {\n <td class=\"detail-row-expander\">\n @if (_detailRow.showCallback == null || _detailRow.showCallback(row)) {\n <button class=\"btn\" (click)=\"_onToggleRowDetailClick(row)\">\n @if (isRowExpanded(row)) {\n <i class=\"far fa-minus\"></i>\n } @else {\n <i class=\"far fa-plus\"></i>\n }\n </button>\n }\n </td>\n }\n\n @if (showRowNumbers()) {\n <td class=\"ng0-table-row-number\">\n {{ $firstRecordIndex + $index + 1}}\n </td>\n }\n\n @for (col of _columns; track $index) {\n <td\n [ngClass]=\"col.cellClass()\"\n [class.shrinked]=\"col.shrink()\"\n [class.fw-bold]=\"col.bold()\">\n @if (col.template) {\n <ng-container *ngTemplateOutlet=\"col.template; context: { $implicit: row }\">\n </ng-container>\n } @else if (col.field()) {\n @let cellValue = _getCellValue(row, col);\n\n @if ((cellValue === null || cellValue === undefined) && col.emptyCellText()) {\n {{ col.emptyCellText() }}\n } @else {\n @if (col.type()) {\n @let type = $any(col.type());\n\n @if (type == \"date\") {\n {{ cellValue | ng0Date }}\n } @else if (type == \"number\") {\n {{ cellValue | number }}\n } @else if (type == \"currency\") {\n {{ cellValue | currency }}\n } @else if (type.enum) {\n {{ cellValue | ng0TranslateEnum: type.enum.name : type.enum.fallback }}\n } @else if (type.boolean || type == \"boolean\") {\n {{ cellValue | ng0LocalizeBool: type.boolean.false ?? \"false\" : type.boolean.false ?? \"true\" }}\n }@else {\n {{ cellValue }}\n }\n }\n }\n }\n </td>\n }\n </tr>\n\n @if (_detailRow && isRowExpanded(row)) {\n <tr class=\"detail-row\">\n <td\n [attr.colspan]=\"_columns.length + (showRowNumbers() ? 1 : 0) + 1\"\n class=\"ps-2 pb-4\">\n <ng-container\n *ngTemplateOutlet=\"_detailRow.templateRef; context: { $implicit: row }\"></ng-container>\n </td>\n </tr>\n }\n }\n</ng-template>\n\n<ng-template #footerTemplate>\n @if ($pageable && showPagingControls() && $anyRecords && $totalRecordsCount! > 0) {\n <div class=\"ng0-table-pagination me-2\">\n <ng0-pagination\n class=\"mb-0 d-inline-block\"\n [showFirstLastButtons]=\"showFirstLastButtons()\"\n [showNextPreviousButtons]=\"showNextPreviousButtons()\"\n [totalRecords]=\"$totalRecordsCount!\"\n [pageSize]=\"pageSize()\"\n [selectedPage]=\"pageIndex()\"\n (itemClick)=\"_onPageChange($event)\"\n [maxVisiblePages]=\"maxVisiblePages()\">\n <ng-container ngProjectAs=\"first\">\n <ng-content select=\"paging-first\">\n {{ \"first\" | ng0Translate }}\n </ng-content>\n </ng-container>\n\n <ng-container ngProjectAs=\"last\">\n <ng-content select=\"paging-last\">\n {{ \"last\" | ng0Translate }}\n </ng-content>\n </ng-container>\n\n <ng-container ngProjectAs=\"next\">\n <ng-content select=\"paging-next\">\n {{ \"next\" | ng0Translate }}\n </ng-content>\n </ng-container>\n\n <ng-container ngProjectAs=\"previous\">\n <ng-content select=\"paging-previous\">\n {{ \"previous\" | ng0Translate }}\n </ng-content>\n </ng-container>\n </ng0-pagination>\n </div>\n\n @if (pageSizeOptions()) {\n <div class=\"ng0-table-paging-options\">\n <select name=\"pageSizeOptions\" class=\"form-select w-auto d-inline-block\">\n <option [ngValue]=\"10\" selected>10</option>\n </select>\n </div>\n }\n\n @if (showPagingInfo()) {\n <div class=\"ng0-table-paging-info ms-auto\">\n <ng-content select=\"paging-info\">\n {{\n _pagingFormatter({firstRecord: $firstRecordIndex, lastRecord: $lastRecordIndex, totalRecords: $totalRecordsCount!,\n currentPage: $pageIndex!})\n }}\n </ng-content>\n </div>\n }\n }\n</ng-template>\n\n<ng-template #nowDataTemplate>\n <tr class=\"ng0-table-error-row\">\n <td [attr.colSpan]=\"$columnsCount\" class=\"p-2\">\n <div class=\"d-flex align-items-baseline\">\n <span>{{ $tableLocale?.loadError ?? 'Error loading data.' }} </span>\n <button (click)=\"load()\" class=\"btn btn-warning ms-auto\">\n {{ \"retry\" | ng0Translate }}\n </button>\n </div>\n </td>\n </tr>\n</ng-template>", styles: [":host{display:flex;flex-direction:column;position:relative}@starting-style{.ng0-table-loading-cover{background-color:#0000}}table{margin-bottom:0;height:100%}th.sortable{cursor:pointer;-webkit-user-select:none;user-select:none}th.sortable .ng0-table-sort-icon{transition:transform .2s;opacity:0}th.sortable.sort-none:hover .ng0-table-sort-icon{opacity:.4}th.sortable.sort-asc .ng0-table-sort-icon{transform:rotate(0);opacity:1;color:var(--bs-danger)}th.sortable.sort-desc .ng0-table-sort-icon{transform:rotate(180deg);opacity:1;color:var(--bs-primary)}tbody{position:relative}td.row-number{width:0}td.shrinked{width:0;white-space:nowrap}.ng0-table-loading-cover{position:absolute;inset:0;background-color:#0000000d;transition:background-color .2s;z-index:1000;display:flex;align-items:center;justify-content:center}.table-scrollable{overflow-y:auto;direction:ltr;scroll-padding:20px}.table-scrollable::-webkit-scrollbar{width:8px}.table-scrollable::-webkit-scrollbar-track{background-color:#00000008}.table-scrollable::-webkit-scrollbar-thumb{background-color:var(--bs-secondary)}.table-scrollable thead th{position:sticky;top:0}.ng0-table-footer{margin-top:.5rem}.fade-in{animation:fade-in .5s}@keyframes fade-in{0%{opacity:0}to{opacity:1}}\n"] }]
418
+ OverlayModule,
419
+ SelectComponent,
420
+ Filter1Icon
421
+ ], template: "@let $dataResult = _dataResult();\n@let $pageable = pageable();\n@let $pageIndex = pageIndex();\n@let $pageSize = pageSize();\n@let $data = $dataResult?.data;\n@let $anyRecords = $data && $data.length > 0;\n@let $totalRecordsCount = $dataResult?.total;\n@let $firstRecordIndex = $pageable ? ($pageSize * $pageIndex) : 0;\n@let $lastRecordIndex = $data ? $firstRecordIndex + $data.length - 1 : 1;\n@let $isFirstLoad = $dataResult == undefined;\n@let $columnsCount = _columns.length + (showRowNumbers() ? 1 : 0);\n@let $tableLocale = _ls.get()?.definition?.components?.table;\n\n<div class=\"table-responsive\" [style.height]=\"height()\" [class.table-scrollable]=\"height()! > 0\">\n <table class=\"table\" [ngClass]=\"tableClass()\">\n @if (caption()) {\n <caption>\n {{caption()}}\n </caption>\n }\n\n @if (showHeader()) {\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n }\n\n @if (filterable()) {\n <ng-container *ngTemplateOutlet=\"filtersTemplate\"></ng-container>\n }\n\n <tbody>\n @if (isLoading() && $isFirstLoad && loadingIndicator()) {\n <tr class=\"ng0-table-loading-row\">\n <td [attr.colspan]=\"$columnsCount\">\n @switch (loadingIndicator()) {\n @case ('spinner') {\n <div class=\"text-center\">\n <div class=\"spinner-border\" role=\"status\"></div>\n </div>\n }\n }\n </td>\n </tr>\n } @else {\n @if ($data) {\n @if ($data.length > 0) {\n <ng-container *ngTemplateOutlet=\"dataRowsTemplate\" />\n } @else {\n <tr class=\"ng0-table-no-records-row\">\n <td [attr.colSpan]=\"$columnsCount\" class=\"text-center p-2\">\n {{ $tableLocale?.noRecords ?? 'No Records.' }}\n </td>\n </tr>\n }\n } @else if (_error()) {\n <ng-container *ngTemplateOutlet=\"nowDataTemplate\"></ng-container>\n }\n }\n </tbody>\n </table>\n</div>\n\n<div class=\"ng0-table-footer d-flex align-items-baseline\">\n <ng-container *ngTemplateOutlet=\"footerTemplate\"></ng-container>\n</div>\n\n@if (isLoading() && !$isFirstLoad && loadingCover()) {\n <div class=\"ng0-table-loading-cover text-center\">\n @if (loadingCover() == 'spinner') {\n <div class=\"spinner-border\" role=\"status\"></div>\n }\n </div>\n}\n\n<ng-template #filtersTemplate>\n <thead>\n <tr>\n @if (_detailRow) {\n <th></th>\n }\n\n @if (showRowNumbers()) {\n <th></th>\n }\n\n @for (col of _columns; track $index) {\n <th>\n @if (col.filterable() && (col.field() || col.filterValue())) {\n <div class=\"input-group\">\n @switch (col.type()) {\n @case ('text') {\n <input\n [name]=\"'filter-' + col.field\"\n type=\"search\"\n [maxlength]=\"50\"\n class=\"form-control form-control-sm\"\n [(ngModel)]=\"col.filterValue\"\n (keydown.enter)=\"load(0)\" />\n }\n @case ('number') {\n <input\n [name]=\"'datatablecol-' + col.field\"\n type=\"search\"\n ng0Number\n class=\"form-control form-control-sm\"\n [(ngModel)]=\"col.filterValue\"\n (keydown.enter)=\"load(0)\" />\n }\n }\n\n <button\n class=\"btn btn-outline-light\"\n style=\"border-color: var(--bs-border-color);\"\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n (click)=\"_onToggleFilterOperator(col)\">\n <ng0-icon-filter1 />\n </button>\n </div>\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"col.showFilterOperators()\"\n (overlayOutsideClick)=\"col.showFilterOperators.set(false)\"\n (detach)=\"col.showFilterOperators.set(false)\">\n <ul class=\"dropdown-menu show\" animate.enter=\"fade-in\">\n @for (item of col.getFilterOperators(); track $index) {\n <li>\n <button\n class=\"dropdown-item\"\n [class.active]=\"item == col.filterOperator()\"\n (click)=\"_onSelectFilterOperator(col, item)\">\n {{_ls.get()?.definition?.data?.logicalOperators?.[item] ?? item }}\n </button>\n </li>\n }\n </ul>\n </ng-template>\n }\n </th>\n }\n </tr>\n </thead>\n</ng-template>\n\n<ng-template #headerTemplate>\n <thead [ngClass]=\"headerClass()\">\n <tr>\n @if (_detailRow) {\n <th></th>\n }\n\n @if (showRowNumbers()) {\n <th class=\"row-number text-muted\">#</th>\n }\n\n @for (col of _columns; track $index) {\n <th\n (click)=\"col.toggleSortDirection(); load()\"\n [class.sortable]=\"sortable() && col.sortable()\"\n [ngClass]=\"{ \n 'sort-asc': col.sortDirection() == 'asc', \n 'sort-desc': col.sortDirection() == 'desc',\n 'sort-none': col.sortDirection() == 'none'\n }\">\n {{ col.title() }}\n\n @if (sortable() && col.sortable()) {\n <svg\n class=\"ng0-table-sort-icon\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M12 7L12 16\"\n stroke=\"currentColor\"\n stroke-width=\"1\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\" />\n <path\n d=\"M8 13L12 17L16 13\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\" />\n </svg>\n }\n </th>\n }\n </tr>\n </thead>\n</ng-template>\n\n<ng-template #dataRowsTemplate>\n @for (row of $data; track $index) {\n <tr [class.table-active]=\"isRowExpanded(row)\">\n @if (_detailRow) {\n <td class=\"detail-row-expander\">\n @if (_detailRow.showCallback == null || _detailRow.showCallback(row)) {\n <button class=\"btn\" (click)=\"_onToggleRowDetailClick(row)\">\n @if (isRowExpanded(row)) {\n <i class=\"far fa-minus\"></i>\n } @else {\n <i class=\"far fa-plus\"></i>\n }\n </button>\n }\n </td>\n }\n\n @if (showRowNumbers()) {\n <td class=\"ng0-table-row-number\">\n {{ $firstRecordIndex + $index + 1}}\n </td>\n }\n\n @for (col of _columns; track $index) {\n <td\n [ngClass]=\"col.cellClass()\"\n [class.shrinked]=\"col.shrink()\"\n [class.fw-bold]=\"col.bold()\">\n @if (col.template) {\n <ng-container *ngTemplateOutlet=\"col.template; context: { $implicit: row }\">\n </ng-container>\n } @else if (col.field()) {\n @let cellValue = _getCellValue(row, col);\n\n @if (\n (cellValue === null || cellValue === undefined) && col.emptyCellText()\n ) {\n {{ col.emptyCellText() }}\n } @else {\n @if (col.type()) {\n @let type = $any(col.type());\n\n @if (type == \"date\") {\n {{ cellValue | ng0Date }}\n } @else if (type == \"number\") {\n {{ cellValue | number }}\n } @else if (type == \"currency\") {\n {{ cellValue | currency }}\n } @else if (type.enum) {\n {{ cellValue | ng0TranslateEnum: type.enum.name : type.enum.fallback }}\n } @else if (type.boolean || type == \"boolean\") {\n {{ cellValue | ng0LocalizeBool: type.boolean.false ?? \"false\" : type.boolean.false ?? \"true\" }}\n } @else {\n {{ cellValue }}\n }\n }\n }\n } @else if(col.formatBy()) {\n {{col.formatBy()(row)}}\n } \n </td>\n }\n </tr>\n\n @if (_detailRow && isRowExpanded(row)) {\n <tr class=\"detail-row\">\n <td\n [attr.colspan]=\"_columns.length + (showRowNumbers() ? 1 : 0) + 1\"\n class=\"ps-2 pb-4\">\n <ng-container\n *ngTemplateOutlet=\"_detailRow.templateRef; context: { $implicit: row }\"></ng-container>\n </td>\n </tr>\n }\n }\n</ng-template>\n\n<ng-template #footerTemplate>\n @if ($pageable && showPagingControls() && $anyRecords && $totalRecordsCount! > 0) {\n <div class=\"ng0-table-pagination me-2\">\n <ng0-pagination\n class=\"mb-0 d-inline-block\"\n [showFirstLastButtons]=\"showFirstLastButtons()\"\n [showNextPreviousButtons]=\"showNextPreviousButtons()\"\n [totalRecords]=\"$totalRecordsCount!\"\n [pageSize]=\"pageSize()\"\n [selectedPage]=\"pageIndex()\"\n (itemClick)=\"_onPageChange($event)\"\n [maxVisiblePages]=\"maxVisiblePages()\">\n <ng-container ngProjectAs=\"first\">\n <ng-content select=\"paging-first\">\n {{ \"first\" | ng0Translate }}\n </ng-content>\n </ng-container>\n\n <ng-container ngProjectAs=\"last\">\n <ng-content select=\"paging-last\">\n {{ \"last\" | ng0Translate }}\n </ng-content>\n </ng-container>\n\n <ng-container ngProjectAs=\"next\">\n <ng-content select=\"paging-next\">\n {{ \"next\" | ng0Translate }}\n </ng-content>\n </ng-container>\n\n <ng-container ngProjectAs=\"previous\">\n <ng-content select=\"paging-previous\">\n {{ \"previous\" | ng0Translate }}\n </ng-content>\n </ng-container>\n </ng0-pagination>\n </div>\n\n @if (pageSizeOptions()) {\n <div class=\"ng0-table-paging-options\">\n <ng0-select\n name=\"pageSize\"\n [source]=\"pageSizeOptions()\"\n [(ngModel)]=\"pageSize\"\n (itemSelect)=\"_onPageSizeOptionsItemSelect($event)\"></ng0-select>\n <!-- <select name=\"pageSizeOptions\" class=\"form-select w-auto d-inline-block\">\n <option [ngValue]=\"10\" selected>10</option>\n </select> -->\n </div>\n }\n\n @if (showPagingInfo()) {\n <div class=\"ng0-table-paging-info ms-auto\">\n <ng-content select=\"paging-info\">\n {{\n _pagingFormatter({firstRecord: $firstRecordIndex + 1, lastRecord: $lastRecordIndex + 1, totalRecords:\n $totalRecordsCount!,\n currentPage: $pageIndex!})\n }}\n </ng-content>\n </div>\n }\n }\n</ng-template>\n\n<ng-template #nowDataTemplate>\n <tr class=\"ng0-table-error-row\">\n <td [attr.colSpan]=\"$columnsCount\" class=\"p-2\">\n <div class=\"d-flex align-items-baseline\">\n <span>{{ $tableLocale?.loadError ?? 'Error loading data.' }} </span>\n <button (click)=\"load()\" class=\"btn btn-warning ms-auto\">\n {{ \"retry\" | ng0Translate }}\n </button>\n </div>\n </td>\n </tr>\n</ng-template>\n", styles: [":host{display:flex;flex-direction:column;position:relative}@starting-style{.ng0-table-loading-cover{background-color:#0000}}table{margin-bottom:0;height:100%}th.sortable{cursor:pointer;-webkit-user-select:none;user-select:none}th.sortable .ng0-table-sort-icon{transition:transform .2s;opacity:0}th.sortable.sort-none:hover .ng0-table-sort-icon{opacity:.4}th.sortable.sort-asc .ng0-table-sort-icon{transform:rotate(0);opacity:1;color:var(--bs-danger)}th.sortable.sort-desc .ng0-table-sort-icon{transform:rotate(180deg);opacity:1;color:var(--bs-primary)}tbody{position:relative}td.row-number{width:0}td.shrinked{width:0;white-space:nowrap}.ng0-table-loading-cover{position:absolute;inset:0;background-color:#0000000d;transition:background-color .2s;z-index:1000;display:flex;align-items:center;justify-content:center}.table-scrollable{overflow-y:auto;direction:ltr;scroll-padding:20px}.table-scrollable::-webkit-scrollbar{width:8px}.table-scrollable::-webkit-scrollbar-track{background-color:#00000008}.table-scrollable::-webkit-scrollbar-thumb{background-color:var(--bs-secondary)}.table-scrollable thead th{position:sticky;top:0}.ng0-table-footer{margin-top:.5rem}.fade-in{animation:fade-in .5s}@keyframes fade-in{0%{opacity:0}to{opacity:1}}\n"] }]
434
422
  }], propDecorators: { _columns: [{
435
423
  type: ContentChildren,
436
424
  args: [TableColumnDirective]