Some styles, paginated get all ids
This commit is contained in:
parent
e7a04dda9e
commit
fb6951a7ba
@ -63,6 +63,8 @@ body {
|
||||
--iqser-app-name-font-family: Inter, sans-serif;
|
||||
--iqser-circle-button-radius: 50%;
|
||||
--iqser-side-nav-item-radius: 20px;
|
||||
--iqser-dot-overlay-background: rgba(var(--iqser-primary-rgb), 0.1);
|
||||
--iqser-chevron-button-bg: transparent;
|
||||
}
|
||||
|
||||
$required-variables: 'iqser-primary';
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
}
|
||||
|
||||
.overlay {
|
||||
background: rgba(var(--iqser-primary-rgb), 0.1);
|
||||
background: var(--iqser-dot-overlay-background);
|
||||
}
|
||||
}
|
||||
|
||||
@ -177,7 +177,6 @@ iqser-circle-button {
|
||||
iqser-chevron-button {
|
||||
@include buttonShape;
|
||||
@include ariaExpanded;
|
||||
@include dotOverlay;
|
||||
@include labelNoWrap;
|
||||
|
||||
display: block;
|
||||
@ -185,10 +184,14 @@ iqser-chevron-button {
|
||||
.mat-mdc-button {
|
||||
@include iconSize14;
|
||||
|
||||
background-color: var(--iqser-chevron-button-bg);
|
||||
|
||||
&:not([disabled]) {
|
||||
--mdc-text-button-label-text-color: var(--iqser-text);
|
||||
}
|
||||
}
|
||||
|
||||
@include dotOverlay;
|
||||
}
|
||||
|
||||
iqser-user-button {
|
||||
|
||||
@ -102,7 +102,7 @@ iqser-dynamic-input {
|
||||
}
|
||||
|
||||
.mat-mdc-form-field {
|
||||
margin-top: 3px;
|
||||
margin-top: 0;
|
||||
|
||||
input {
|
||||
margin-top: 0;
|
||||
@ -220,7 +220,7 @@ iqser-dynamic-input {
|
||||
font-size: 11px;
|
||||
letter-spacing: 0;
|
||||
line-height: 14px;
|
||||
margin-bottom: 2px;
|
||||
margin-bottom: 5px;
|
||||
color: var(--iqser-text);
|
||||
|
||||
&.mat-checkbox-layout {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
button {
|
||||
padding: 0 10px 0 14px;
|
||||
--mat-text-button-with-icon-horizontal-padding: 10px 0 14px;
|
||||
|
||||
mat-icon {
|
||||
width: 14px;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Id, IListable } from '../models';
|
||||
import { EntitiesService } from './entities.service';
|
||||
import { Observable } from 'rxjs';
|
||||
import { firstValueFrom, Observable } from 'rxjs';
|
||||
import { map, tap } from 'rxjs/operators';
|
||||
import { mapEach } from '../../utils';
|
||||
import { PaginationSettings } from '../../pagination';
|
||||
@ -97,4 +97,40 @@ export abstract class PaginatedEntitiesService<
|
||||
tap((entities: Class[]) => this.setEntities(entities)),
|
||||
);
|
||||
}
|
||||
|
||||
async getAllIds(): Promise<PrimaryKey[]> {
|
||||
let page = 0;
|
||||
const options = this._currentConfig.options;
|
||||
const size = 1000;
|
||||
const sOptions = {
|
||||
sortDirection: this._currentConfig.sortDirection,
|
||||
sortProperty: this._currentConfig.sortProperty,
|
||||
};
|
||||
const allItems: PrimaryKey[] = [];
|
||||
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
while (true) {
|
||||
const response = await firstValueFrom(
|
||||
this._post<PaginatedResponse<Interface>>({
|
||||
page,
|
||||
size,
|
||||
options,
|
||||
...sOptions,
|
||||
}),
|
||||
);
|
||||
allItems.push(
|
||||
...response.data
|
||||
.map(entity => (this._entityClass ? new this._entityClass(entity) : (entity as unknown as Class)))
|
||||
.map(entity => entity.id),
|
||||
);
|
||||
|
||||
if ((response.page + 1) * response.pageSize >= response.totalHits) {
|
||||
break;
|
||||
}
|
||||
|
||||
page = response.page + 1;
|
||||
}
|
||||
|
||||
return allItems;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user