remove all deprecated code

pull/10102/head
Mehmet Erim 4 years ago
parent aac65e9ff9
commit 7057da5a67

@ -16,7 +16,6 @@ import { InitDirective } from './directives/init.directive';
import { PermissionDirective } from './directives/permission.directive';
import { ReplaceableTemplateDirective } from './directives/replaceable-template.directive';
import { StopPropagationDirective } from './directives/stop-propagation.directive';
import { VisibilityDirective } from './directives/visibility.directive';
import { OAuthConfigurationHandler } from './handlers/oauth-configuration.handler';
import { RoutesHandler } from './handlers/routes.handler';
import { ApiInterceptor } from './interceptors/api.interceptor';
@ -24,6 +23,7 @@ import { LocalizationModule } from './localization.module';
import { ABP } from './models/common';
import { LocalizationPipe } from './pipes/localization.pipe';
import { SortPipe } from './pipes/sort.pipe';
import { CookieLanguageProvider } from './providers/cookie-language.provider';
import { LocaleProvider } from './providers/locale.provider';
import { LocalizationService } from './services/localization.service';
import { oAuthStorage } from './strategies/auth-flow.strategy';
@ -32,7 +32,6 @@ import { TENANT_KEY } from './tokens/tenant-key.token';
import { noop } from './utils/common-utils';
import './utils/date-extensions';
import { getInitialData, localeInitializer } from './utils/initial-utils';
import { CookieLanguageProvider } from './providers/cookie-language.provider';
export function storageFactory(): OAuthStorage {
return oAuthStorage;
@ -65,7 +64,6 @@ export function storageFactory(): OAuthStorage {
RouterOutletComponent,
SortPipe,
StopPropagationDirective,
VisibilityDirective,
],
imports: [
OAuthModule,
@ -90,7 +88,6 @@ export function storageFactory(): OAuthStorage {
RouterOutletComponent,
SortPipe,
StopPropagationDirective,
VisibilityDirective,
],
providers: [LocalizationPipe],
entryComponents: [

@ -6,4 +6,3 @@ export * from './init.directive';
export * from './permission.directive';
export * from './replaceable-template.directive';
export * from './stop-propagation.directive';
export * from './visibility.directive';

@ -40,28 +40,12 @@ export class PermissionDirective implements OnDestroy, OnChanges {
.getGrantedPolicy$(this.condition)
.pipe(distinctUntilChanged())
.subscribe(isGranted => {
if (this.templateRef) this.initStructural(isGranted);
else this.initAttribute(isGranted);
this.vcRef.clear();
if (isGranted) this.vcRef.createEmbeddedView(this.templateRef);
this.cdRef.detectChanges();
});
}
private initStructural(isGranted: boolean) {
this.vcRef.clear();
if (isGranted) this.vcRef.createEmbeddedView(this.templateRef);
}
/**
* @deprecated Will be deleted in v5.0
*/
private initAttribute(isGranted: boolean) {
if (!isGranted) {
this.renderer.removeChild(this.elRef.nativeElement.parentElement, this.elRef.nativeElement);
}
}
ngOnDestroy(): void {
if (this.subscription) this.subscription.unsubscribe();
}

@ -1,66 +0,0 @@
import { AfterViewInit, Directive, ElementRef, Input, Optional, Renderer2 } from '@angular/core';
import { Subject } from 'rxjs';
/**
*
* @deprecated To be deleted in v5.0
*/
@Directive({
selector: '[abpVisibility]',
})
export class VisibilityDirective implements AfterViewInit {
@Input('abpVisibility')
focusedElement: HTMLElement;
completed$ = new Subject<boolean>();
constructor(@Optional() private elRef: ElementRef, private renderer: Renderer2) {}
ngAfterViewInit() {
if (!this.focusedElement && this.elRef) {
this.focusedElement = this.elRef.nativeElement;
}
const observer = new MutationObserver(mutations => {
mutations.forEach(mutation => {
if (!mutation.target) return;
const htmlNodes =
Array.from(mutation.target.childNodes || []).filter(
node => node instanceof HTMLElement,
) || [];
if (!htmlNodes.length) {
this.removeFromDOM();
}
});
});
observer.observe(this.focusedElement, {
childList: true,
});
setTimeout(() => {
const htmlNodes =
Array.from(this.focusedElement.childNodes || []).filter(
node => node instanceof HTMLElement,
) || [];
if (!htmlNodes.length) this.removeFromDOM();
}, 0);
this.completed$.subscribe(() => observer.disconnect());
}
disconnect() {
this.completed$.next();
this.completed$.complete();
}
removeFromDOM() {
if (!this.elRef.nativeElement) return;
this.renderer.removeChild(this.elRef.nativeElement.parentElement, this.elRef.nativeElement);
this.disconnect();
}
}

@ -1,117 +0,0 @@
import { ABP } from './common';
export namespace ApplicationConfiguration {
/**
* @deprecated Use the ApplicationConfigurationDto interface instead. To be deleted in v5.0.
*/
export interface Response {
localization: Localization;
auth: Auth;
setting: Value;
currentUser: CurrentUser;
currentTenant: CurrentTenant;
features: Value;
}
/**
* @deprecated Use the ApplicationLocalizationConfigurationDto interface instead. To be deleted in v5.0.
*/
export interface Localization {
currentCulture: CurrentCulture;
defaultResourceName: string;
languages: Language[];
values: LocalizationValue;
}
/**
* @deprecated Use the Record<string, Record<string, string>> type instead. To be deleted in v5.0.
*/
export interface LocalizationValue {
[key: string]: { [key: string]: string };
}
/**
* @deprecated Use the LanguageInfo interface instead. To be deleted in v5.0.
*/
export interface Language {
cultureName: string;
uiCultureName: string;
displayName: string;
flagIcon: string;
}
/**
* @deprecated Use the CurrentCultureDto interface instead. To be deleted in v5.0.
*/
export interface CurrentCulture {
cultureName: string;
dateTimeFormat: DateTimeFormat;
displayName: string;
englishName: string;
isRightToLeft: boolean;
name: string;
nativeName: string;
threeLetterIsoLanguageName: string;
twoLetterIsoLanguageName: string;
}
/**
* @deprecated Use the DateTimeFormatDto interface instead. To be deleted in v5.0.
*/
export interface DateTimeFormat {
calendarAlgorithmType: string;
dateSeparator: string;
fullDateTimePattern: string;
longTimePattern: string;
shortDatePattern: string;
shortTimePattern: string;
}
/**
* @deprecated Use the ApplicationAuthConfigurationDto interface instead. To be deleted in v5.0.
*/
export interface Auth {
policies: Policy;
grantedPolicies: Policy;
}
/**
* @deprecated Use the Record<string, boolean> type instead. To be deleted in v5.0.
*/
export interface Policy {
[key: string]: boolean;
}
/**
* @deprecated To be deleted in v5.0.
*/
export interface Value {
values: ABP.Dictionary<string>;
}
/**
* @deprecated Use the CurrentUserDto interface instead. To be deleted in v5.0.
*/
export interface CurrentUser {
email: string;
emailVerified: false;
id: string;
isAuthenticated: boolean;
roles: string[];
tenantId: string;
userName: string;
name: string;
phoneNumber: string;
phoneNumberVerified: boolean;
surName: string;
}
/**
* @deprecated Use the CurrentTenantDto interface instead. To be deleted in v5.0.
*/
export interface CurrentTenant {
id: string;
name: string;
isAvailable?: boolean;
}
}

@ -1,4 +1,3 @@
export * from './application-configuration';
export * from './auth';
export * from './common';
export * from './dtos';

@ -4,20 +4,5 @@ export namespace Session {
export interface State {
language: string;
tenant: CurrentTenantDto;
/**
*
* @deprecated To be deleted in v5.0
*/
sessionDetail: SessionDetail;
}
/**
*
* @deprecated To be deleted in v5.0
*/
export interface SessionDetail {
openedTabCount: number;
lastExitTime: number;
remember: boolean;
}
}

@ -1,24 +0,0 @@
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { Rest } from '../models/rest';
import { ApplicationConfigurationDto } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/models';
import { RestService } from './rest.service';
/**
* @deprecated Use AbpApplicationConfigurationService instead. To be deleted in v5.0.
*/
@Injectable({
providedIn: 'root',
})
export class ApplicationConfigurationService {
constructor(private rest: RestService) {}
getConfiguration(): Observable<ApplicationConfigurationDto> {
const request: Rest.Request<null> = {
method: 'GET',
url: '/api/abp/application-configuration',
};
return this.rest.request<null, ApplicationConfigurationDto>(request, {});
}
}

@ -42,13 +42,6 @@ export class AuthService {
return this.strategy.logout(queryParams);
}
/**
* @deprecated Use navigateToLogin method instead. To be deleted in v5.0
*/
initLogin() {
this.strategy.navigateToLogin();
}
navigateToLogin(queryParams?: Params) {
this.strategy.navigateToLogin(queryParams);
}

@ -1,9 +1,9 @@
import { Injectable } from '@angular/core';
import { Observable, Subject } from 'rxjs';
import { map, take, switchMap } from 'rxjs/operators';
import { map, switchMap, take } from 'rxjs/operators';
import { AbpApplicationConfigurationService } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service';
import { ApplicationConfigurationDto } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/models';
import { InternalStore } from '../utils/internal-store-utils';
import { AbpApplicationConfigurationService } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service';
@Injectable({
providedIn: 'root',
@ -24,15 +24,7 @@ export class ConfigStateService {
private initUpdateStream() {
this.updateSubject
.pipe(switchMap(() => this.abpConfigService.get()))
.subscribe(res => this.setState(res));
}
/**
* @deprecated do not use this method directly, instead call refreshAppState
* This method will be private in v5.0
*/
setState(state: ApplicationConfigurationDto) {
this.store.set(state);
.subscribe(res => this.store.set(res));
}
refreshAppState() {

@ -1,4 +1,3 @@
export * from './application-configuration.service';
export * from './auth.service';
export * from './config-state.service';
export * from './content-projection.service';

@ -1,16 +1,14 @@
import { Injectable, Inject } from '@angular/core';
import { switchMap, map } from 'rxjs/operators';
import { Observable } from 'rxjs';
import { ABP } from '../models/common';
import { Inject, Injectable } from '@angular/core';
import { map, switchMap } from 'rxjs/operators';
import { AbpTenantService } from '../proxy/pages/abp/multi-tenancy';
import {
FindTenantResultDto,
CurrentTenantDto,
FindTenantResultDto,
} from '../proxy/volo/abp/asp-net-core/mvc/multi-tenancy/models';
import { RestService } from './rest.service';
import { AbpTenantService } from '../proxy/pages/abp/multi-tenancy';
import { TENANT_KEY } from '../tokens/tenant-key.token';
import { ConfigStateService } from './config-state.service';
import { RestService } from './rest.service';
import { SessionStateService } from './session-state.service';
import { TENANT_KEY } from '../tokens/tenant-key.token';
@Injectable({ providedIn: 'root' })
export class MultiTenancyService {
@ -33,30 +31,6 @@ export class MultiTenancyService {
@Inject(TENANT_KEY) public tenantKey: string,
) {}
/**
* @deprecated Use AbpTenantService.findTenantByName method instead. To be deleted in v5.0.
*/
findTenantByName(name: string, headers: ABP.Dictionary<string>): Observable<FindTenantResultDto> {
return this.restService.request(
{
url: `/api/abp/multi-tenancy/tenants/by-name/${name}`,
method: 'GET',
headers,
},
{ apiName: this.apiName },
);
}
/**
* @deprecated Use AbpTenantService.findTenantById method instead. To be deleted in v5.0.
*/
findTenantById(id: string, headers: ABP.Dictionary<string>): Observable<FindTenantResultDto> {
return this.restService.request(
{ url: `/api/abp/multi-tenancy/tenants/by-id/${id}`, method: 'GET', headers },
{ apiName: this.apiName },
);
}
setTenantByName(tenantName: string) {
return this.tenantService
.findTenantByName(tenantName, { [this.tenantKey]: '' })

@ -1,31 +1,3 @@
import { Observable, Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
function isFunction(value) {
return typeof value === 'function';
}
/**
* @deprecated no longer working, please use SubscriptionService (https://docs.abp.io/en/abp/latest/UI/Angular/Subscription-Service) instead.
*/
export const takeUntilDestroy =
(componentInstance, destroyMethodName = 'ngOnDestroy') =>
<T>(source: Observable<T>) => {
const originalDestroy = componentInstance[destroyMethodName];
if (isFunction(originalDestroy) === false) {
throw new Error(
`${componentInstance.constructor.name} is using untilDestroyed but doesn't implement ${destroyMethodName}`,
);
}
if (!componentInstance['__takeUntilDestroy']) {
componentInstance['__takeUntilDestroy'] = new Subject();
componentInstance[destroyMethodName] = function () {
// eslint-disable-next-line prefer-rest-params
isFunction(originalDestroy) && originalDestroy.apply(this, arguments);
componentInstance['__takeUntilDestroy'].next(true);
componentInstance['__takeUntilDestroy'].complete();
};
}
return source.pipe(takeUntil<T>(componentInstance['__takeUntilDestroy']));
};

@ -7,8 +7,5 @@ export * from './loading/loading.component';
export * from './modal/modal-close.directive';
export * from './modal/modal-ref.service';
export * from './modal/modal.component';
export * from './sort-order-icon/sort-order-icon.component';
export * from './table-empty-message/table-empty-message.component';
export * from './table/table.component';
export * from './toast-container/toast-container.component';
export * from './toast/toast.component';

@ -1,13 +0,0 @@
import { Component, ViewChild, ViewContainerRef } from '@angular/core';
/**
* @deprecated To be removed in v5.0
*/
@Component({
selector: 'abp-modal-container',
template: '<ng-container #container></ng-container>',
})
export class ModalContainerComponent {
@ViewChild('container', { static: true, read: ViewContainerRef })
container: ViewContainerRef;
}

@ -2,7 +2,6 @@ import { SubscriptionService, uuid } from '@abp/ng.core';
import {
Component,
ContentChild,
ElementRef,
EventEmitter,
Inject,
Input,
@ -32,19 +31,6 @@ export type ModalSize = 'sm' | 'md' | 'lg' | 'xl';
providers: [SubscriptionService],
})
export class ModalComponent implements OnInit, OnDestroy, DismissableModal {
/**
* @deprecated Use centered property of options input instead. To be deleted in v5.0.
*/
@Input() centered = false;
/**
* @deprecated Use windowClass property of options input instead. To be deleted in v5.0.
*/
@Input() modalClass = '';
/**
* @deprecated Use size property of options input instead. To be deleted in v5.0.
*/
@Input() size: ModalSize = 'lg';
@Input()
get visible(): boolean {
return this._visible;
@ -81,12 +67,6 @@ export class ModalComponent implements OnInit, OnDestroy, DismissableModal {
@ContentChild(ButtonComponent, { static: false, read: ButtonComponent })
abpSubmit: ButtonComponent;
/**
* @deprecated will be removed in v5.0
*/
@ContentChild('abpClose', { static: false, read: ElementRef })
abpClose: ElementRef<any>;
@Output() readonly visibleChange = new EventEmitter<boolean>();
@Output() readonly init = new EventEmitter<void>();

@ -1,3 +0,0 @@
<div class="float-right {{ iconClass }}">
<span class="{{ icon }}"></span>
</div>

@ -1,63 +0,0 @@
import { Component, EventEmitter, Input, Output } from '@angular/core';
/**
* @deprecated To be deleted in v5.0. Use ngx-datatale instead.
*/
@Component({
selector: 'abp-sort-order-icon',
templateUrl: './sort-order-icon.component.html',
})
export class SortOrderIconComponent {
private _order: 'asc' | 'desc' | '';
private _selectedSortKey: string;
@Input()
sortKey: string;
@Input()
set selectedSortKey(value: string) {
this._selectedSortKey = value;
this.selectedSortKeyChange.emit(value);
}
get selectedSortKey(): string {
return this._selectedSortKey;
}
@Input()
set order(value: 'asc' | 'desc' | '') {
this._order = value;
this.orderChange.emit(value);
}
get order(): 'asc' | 'desc' | '' {
return this._order;
}
@Output() readonly orderChange = new EventEmitter<string>();
@Output() readonly selectedSortKeyChange = new EventEmitter<string>();
@Input()
iconClass: string;
get icon(): string {
if (this.selectedSortKey === this.sortKey) return `sorting_${this.order}`;
else return 'sorting';
}
sort(key: string) {
this.selectedSortKey = key;
switch (this.order) {
case '':
this.order = 'asc';
this.orderChange.emit('asc');
break;
case 'asc':
this.order = 'desc';
this.orderChange.emit('desc');
break;
case 'desc':
this.order = '';
this.orderChange.emit('');
break;
}
}
}

@ -1,28 +0,0 @@
import { Component, Input } from '@angular/core';
@Component({
// eslint-disable-next-line @angular-eslint/component-selector
selector: '[abp-table-empty-message]',
template: `
<td class="text-center" [attr.colspan]="colspan">
{{ emptyMessage | abpLocalization }}
</td>
`,
})
export class TableEmptyMessageComponent {
@Input()
colspan = 2;
@Input()
message: string;
@Input()
localizationResource = 'AbpAccount';
@Input()
localizationProp = 'NoDataAvailableInDatatable';
get emptyMessage(): string {
return this.message || `${this.localizationResource}::${this.localizationProp}`;
}
}

@ -1,81 +0,0 @@
<div #wrapper class="ui-table ui-widget">
<div class="ui-table-wrapper">
<ng-container
*ngTemplateOutlet="scrollable ? scrollableTemplate : defaultTemplate"
></ng-container>
<div class="pagination-wrapper">
<ngb-pagination
[class.op-0]="!totalPages"
[collectionSize]="totalPages"
[pageSize]="1"
[page]="page"
(pageChange)="pageChange.emit($event)"
[maxSize]="3"
[rotate]="true"
></ngb-pagination>
</div>
</div>
</div>
<ng-template #scrollableTemplate>
<div class="ui-table-scrollable-wrapper">
<div class="ui-table-scrollable-view"></div>
<div class="ui-table-scrollable-header ui-widget-header">
<div #header class="ui-table-scrollable-header-box">
<table class="ui-table-scrollable-header-table">
<ng-container *ngTemplateOutlet="colGroup"></ng-container>
<ng-container *ngTemplateOutlet="head"></ng-container>
<tbody></tbody>
</table>
</div>
</div>
<div
#scrollableBody
(scroll)="header.style.margin = marginCalculator(scrollableBody)"
class="ui-table-scrollable-body"
[style.max-height]="scrollHeight"
>
<table class="ui-table-scrollable-body-table">
<ng-container *ngTemplateOutlet="colGroup"></ng-container>
<ng-container *ngTemplateOutlet="body"></ng-container>
</table>
</div>
</div>
</ng-template>
<ng-template #defaultTemplate>
<table>
<ng-container *ngTemplateOutlet="colGroup"></ng-container>
<ng-container *ngTemplateOutlet="head"></ng-container>
<ng-container *ngTemplateOutlet="body"></ng-container>
</table>
</ng-template>
<ng-template #colGroup>
<ng-container *ngTemplateOutlet="colgroupTemplate"></ng-container>
</ng-template>
<ng-template #head>
<thead class="ui-table-thead">
<ng-container *ngTemplateOutlet="headerTemplate"></ng-container>
</thead>
</ng-template>
<ng-template #body>
<tbody class="ui-table-tbody" *ngIf="value && value.length; else emptyTemplate">
<ng-template
#bodyTemplateWrapper
*ngFor="let val of slicedValue; let index = index; trackBy: trackByFn"
[ngTemplateOutlet]="bodyTemplate"
[ngTemplateOutletContext]="{ $implicit: val, rowIndex: index }"
></ng-template>
</tbody>
</ng-template>
<ng-template #emptyTemplate>
<caption class="ui-table-empty">
{{
emptyMessage | abpLocalization
}}
</caption>
</ng-template>

@ -1,337 +0,0 @@
.ui-table {
position: relative;
.ui-table-tbody > tr:nth-child(even):hover,
.ui-table-tbody > tr:hover {
filter: brightness(90%);
}
.ui-table-empty {
padding: 20px 0;
text-align: center;
border: 1px solid #e0e0e0;
border-top-width: 0;
}
.ui-table-caption,
.ui-table-summary {
background-color: #f4f4f4;
color: #333333;
border: 1px solid #c8c8c8;
padding: 0.571em 1em;
text-align: center;
}
.ui-table-caption {
border-bottom: 0 none;
font-weight: 700;
}
.ui-table-summary {
border-top: 0 none;
font-weight: 700;
}
.ui-table-thead > tr > th {
padding: 0.571em 0.857em;
border: 1px solid #c8c8c8;
font-weight: 700;
color: #333333;
background-color: #f4f4f4;
}
.ui-table-tbody > tr > td {
padding: 0.571em 0.857em;
}
.ui-table-tfoot > tr > td {
padding: 0.571em 0.857em;
border: 1px solid #c8c8c8;
font-weight: 700;
color: #333333;
background-color: #ffffff;
}
.ui-sortable-column {
-moz-transition: box-shadow 0.2s;
-o-transition: box-shadow 0.2s;
-webkit-transition: box-shadow 0.2s;
transition: box-shadow 0.2s;
}
.ui-sortable-column:focus {
outline: 0 none;
outline-offset: 0;
-webkit-box-shadow: inset 0 0 0 0.2em #8dcdff;
-moz-box-shadow: inset 0 0 0 0.2em #8dcdff;
box-shadow: inset 0 0 0 0.2em #8dcdff;
}
.ui-sortable-column .ui-sortable-column-icon {
color: #848484;
}
.ui-sortable-column:not(.ui-state-highlight):hover {
background-color: #e0e0e0;
color: #333333;
}
.ui-sortable-column:not(.ui-state-highlight):hover .ui-sortable-column-icon {
color: #333333;
}
.ui-sortable-column.ui-state-highlight {
background-color: #007ad9;
color: #ffffff;
}
.ui-sortable-column.ui-state-highlight .ui-sortable-column-icon {
color: #ffffff;
}
.ui-editable-column input {
font-size: 14px;
font-family: 'Open Sans', 'Helvetica Neue', sans-serif;
}
.ui-editable-column input:focus {
outline: 1px solid #007ad9;
outline-offset: 2px;
}
.ui-table-tbody > tr {
background-color: #ffffff;
color: #333333;
}
.ui-table-tbody > tr > td {
background-color: inherit;
border: 1px solid #c8c8c8;
}
.ui-table-tbody > tr.ui-state-highlight {
background-color: #007ad9;
color: #ffffff;
}
.ui-table-tbody > tr.ui-state-highlight a {
color: #ffffff;
}
.ui-table-tbody > tr.ui-contextmenu-selected {
background-color: #007ad9;
color: #ffffff;
}
.ui-table-tbody > tr.ui-table-dragpoint-top > td {
-webkit-box-shadow: inset 0 2px 0 0 #007ad9;
-moz-box-shadow: inset 0 2px 0 0 #007ad9;
box-shadow: inset 0 2px 0 0 #007ad9;
}
.ui-table-tbody > tr.ui-table-dragpoint-bottom > td {
-webkit-box-shadow: inset 0 -2px 0 0 #007ad9;
-moz-box-shadow: inset 0 -2px 0 0 #007ad9;
box-shadow: inset 0 -2px 0 0 #007ad9;
}
.ui-table-tbody > tr:nth-child(even) {
background-color: #f9f9f9;
}
.ui-table-tbody > tr:nth-child(even).ui-state-highlight {
background-color: #007ad9;
color: #ffffff;
}
.ui-table-tbody > tr:nth-child(even).ui-state-highlight a {
color: #ffffff;
}
.ui-table-tbody > tr:nth-child(even).ui-contextmenu-selected {
background-color: #007ad9;
color: #ffffff;
}
&.ui-table-hoverable-rows
.ui-table-tbody
> tr.ui-selectable-row:not(.ui-state-highlight):not(.ui-contextmenu-selected):hover {
cursor: pointer;
background-color: #eaeaea;
color: #333333;
}
.ui-column-resizer-helper {
background-color: #007ad9;
}
@media screen and (max-width: 40em) {
&.ui-table-responsive .ui-table-tbody > tr > td {
border: 0 none;
}
}
table {
border-collapse: collapse;
width: 100%;
table-layout: fixed;
}
.ui-table-tbody > tr > td,
.ui-table-tfoot > tr > td,
.ui-table-thead > tr > th {
padding: 0.571em 0.857em;
}
.ui-sortable-column {
cursor: pointer;
}
p-sorticon {
vertical-align: middle;
}
.ui-table-auto-layout > .ui-table-wrapper {
overflow-x: auto;
}
.ui-table-auto-layout > .ui-table-wrapper > table {
table-layout: auto;
}
.ui-table-caption,
.ui-table-summary {
padding: 0.25em 0.5em;
text-align: center;
font-weight: 700;
}
.ui-table-caption {
border-bottom: 0;
}
.ui-table-summary {
border-top: 0;
}
.ui-table-scrollable-wrapper {
position: relative;
}
.ui-table-scrollable-footer,
.ui-table-scrollable-header {
overflow: hidden;
border: 0;
}
.ui-table-scrollable-body {
overflow: auto;
position: relative;
}
.ui-table-virtual-table {
position: absolute;
}
.ui-table-loading-virtual-table {
display: none;
}
.ui-table-frozen-view .ui-table-scrollable-body {
overflow: hidden;
}
.ui-table-frozen-view > .ui-table-scrollable-body > table > .ui-table-tbody > tr > td:last-child {
border-right: 0;
}
.ui-table-unfrozen-view {
position: absolute;
top: 0;
}
.ui-table-resizable > .ui-table-wrapper {
overflow-x: auto;
}
.ui-table-resizable .ui-table-tbody > tr > td,
.ui-table-resizable .ui-table-tfoot > tr > td,
.ui-table-resizable .ui-table-thead > tr > th {
overflow: hidden;
}
.ui-table-resizable .ui-resizable-column {
background-clip: padding-box;
position: relative;
}
.ui-table-resizable-fit .ui-resizable-column:last-child .ui-column-resizer {
display: none;
}
.ui-column-resizer {
display: block;
position: absolute !important;
top: 0;
right: 0;
margin: 0;
width: 0.5em;
height: 100%;
padding: 0;
cursor: col-resize;
border: 1px solid rgba(0, 0, 0, 0);
}
.ui-column-resizer-helper {
width: 1px;
position: absolute;
z-index: 10;
display: none;
}
.ui-table-tbody > tr > td.ui-editing-cell {
padding: 0;
}
.ui-table-tbody > tr > td.ui-editing-cell p-celleditor > * {
width: 100%;
}
.ui-table-reorder-indicator-down,
.ui-table-reorder-indicator-up {
position: absolute;
display: none;
}
.ui-table-responsive .ui-table-tbody > tr > td .ui-column-title {
display: none;
}
@media screen and (max-width: 40em) {
.ui-table-responsive .ui-table-tfoot > tr > td,
.ui-table-responsive .ui-table-thead > tr > th,
.ui-table-responsive colgroup {
display: none !important;
}
.ui-table-responsive .ui-table-tbody > tr > td {
text-align: left;
display: block;
border: 0;
width: 100% !important;
box-sizing: border-box;
float: left;
clear: left;
}
.ui-table-responsive .ui-table-tbody > tr > td .ui-column-title {
padding: 0.4em;
min-width: 30%;
display: inline-block;
margin: -0.4em 1em -0.4em -0.4em;
font-weight: 700;
}
}
.ui-widget {
font-family: 'Open Sans', 'Helvetica Neue', sans-serif;
font-size: 14px;
text-decoration: none;
}
.page-item.disabled .page-link,
.page-link {
background-color: transparent;
border: none;
}
.page-item.disabled .page-link {
box-shadow: none;
}
.pagination {
margin-bottom: 0;
}
.pagination-wrapper {
display: flex;
justify-content: center;
border-top: 0;
padding: 0;
}
.op-0 {
opacity: 0;
}
}

@ -1,110 +0,0 @@
import {
Component,
ElementRef,
EventEmitter,
Input,
OnInit,
Output,
TemplateRef,
TrackByFunction,
ViewChild,
ViewEncapsulation,
} from '@angular/core';
/**
*
* @deprecated To be deleted in v5.0. Use ngx-datatale instead.
*/
@Component({
selector: 'abp-table',
templateUrl: 'table.component.html',
styleUrls: ['table.component.scss'],
encapsulation: ViewEncapsulation.None,
})
export class TableComponent implements OnInit {
private _totalRecords: number;
bodyScrollLeft = 0;
@Input()
value: any[];
@Input()
headerTemplate: TemplateRef<any>;
@Input()
bodyTemplate: TemplateRef<any>;
@Input()
colgroupTemplate: TemplateRef<any>;
@Input()
scrollHeight: string;
@Input()
scrollable: boolean;
@Input()
rows: number;
@Input()
page = 1;
@Input()
trackingProp = 'id';
@Input()
emptyMessage = 'AbpAccount::NoDataAvailableInDatatable';
@Output()
readonly pageChange = new EventEmitter<number>();
@ViewChild('wrapper', { read: ElementRef })
wrapperRef: ElementRef<HTMLDivElement>;
@Input()
get totalRecords(): number {
return this._totalRecords || this.value.length;
}
set totalRecords(newValue: number) {
if (newValue < 0) this._totalRecords = 0;
this._totalRecords = newValue;
}
get totalPages(): number {
if (!this.rows) {
return;
}
return Math.ceil(this.totalRecords / this.rows);
}
get slicedValue(): any[] {
if (!this.rows || this.rows >= this.value.length) {
return this.value;
}
const start = (this.page - 1) * this.rows;
return this.value.slice(start, start + this.rows);
}
marginCalculator: MarginCalculator;
trackByFn: TrackByFunction<any> = (_, value) => {
return typeof value === 'object' ? value[this.trackingProp] || value : value;
};
ngOnInit() {
this.marginCalculator = document.body.dir === 'rtl' ? rtlCalculator : ltrCalculator;
}
}
function ltrCalculator(div: HTMLDivElement): string {
return `0 auto 0 -${div.scrollLeft}px`;
}
function rtlCalculator(div: HTMLDivElement): string {
return `0 ${-(div.scrollWidth - div.clientWidth - div.scrollLeft)}px 0 auto`;
}
type MarginCalculator = (div: HTMLDivElement) => string;

@ -1,5 +1,4 @@
export * from './ellipsis.directive';
export * from './loading.directive';
export * from './ngx-datatable-default.directive';
export * from './ngx-datatable-list.directive';
export * from './table-sort.directive';
export * from './ellipsis.directive';

@ -1,57 +0,0 @@
import { SortOrder, SortPipe } from '@abp/ng.core';
import {
ChangeDetectorRef,
Directive,
Host,
Input,
OnChanges,
Optional,
Self,
SimpleChanges,
} from '@angular/core';
import clone from 'just-clone';
import { TableComponent } from '../components/table/table.component';
export interface TableSortOptions {
key: string;
order: SortOrder;
}
/**
*
* @deprecated To be deleted in v5.0
*/
@Directive({
selector: '[abpTableSort]',
providers: [SortPipe],
})
export class TableSortDirective implements OnChanges {
@Input()
abpTableSort: TableSortOptions;
@Input()
value: any[] = [];
get table(): TableComponent | any {
return (
this.abpTable || this.cdRef['_view'].component || this.cdRef['context'] // 'context' for ivy
);
}
constructor(
@Host() @Optional() @Self() private abpTable: TableComponent,
private sortPipe: SortPipe,
private cdRef: ChangeDetectorRef,
) {}
ngOnChanges({ value, abpTableSort }: SimpleChanges) {
if (this.table && (value || abpTableSort)) {
this.abpTableSort = this.abpTableSort || ({} as TableSortOptions);
this.table.value = this.sortPipe.transform(
clone(this.value),
this.abpTableSort.order,
this.abpTableSort.key,
);
}
}
}

@ -1,5 +1,4 @@
export * from './confirmation.service';
export * from './modal.service';
export * from './toaster.service';
export * from './nav-items.service';
export * from './page-alert.service';
export * from './toaster.service';

@ -1,54 +0,0 @@
import { ContentProjectionService, PROJECTION_STRATEGY } from '@abp/ng.core';
import { ComponentRef, Injectable, TemplateRef, ViewContainerRef, OnDestroy } from '@angular/core';
import { ModalContainerComponent } from '../components/modal/modal-container.component';
/**
* @deprecated Use ng-bootstrap modal. To be deleted in v5.0.
*/
@Injectable({
providedIn: 'root',
})
export class ModalService implements OnDestroy {
private containerComponentRef: ComponentRef<ModalContainerComponent>;
constructor(private contentProjectionService: ContentProjectionService) {
this.setContainer();
}
private setContainer() {
this.containerComponentRef = this.contentProjectionService.projectContent(
PROJECTION_STRATEGY.AppendComponentToBody(ModalContainerComponent),
);
this.containerComponentRef.changeDetectorRef.detectChanges();
}
clearModal() {
this.getContainer().clear();
this.detectChanges();
}
detectChanges() {
this.containerComponentRef.changeDetectorRef.detectChanges();
}
getContainer(): ViewContainerRef {
return this.containerComponentRef.instance.container;
}
renderTemplate<T extends any>(template: TemplateRef<T>, context?: T) {
const containerRef = this.getContainer();
const strategy = PROJECTION_STRATEGY.ProjectTemplateToContainer(
template,
containerRef,
context,
);
this.contentProjectionService.projectContent(strategy);
}
ngOnDestroy() {
this.containerComponentRef.destroy();
}
}

@ -17,11 +17,7 @@ import { HttpErrorWrapperComponent } from './components/http-error-wrapper/http-
import { LoaderBarComponent } from './components/loader-bar/loader-bar.component';
import { LoadingComponent } from './components/loading/loading.component';
import { ModalCloseDirective } from './components/modal/modal-close.directive';
import { ModalContainerComponent } from './components/modal/modal-container.component';
import { ModalComponent } from './components/modal/modal.component';
import { SortOrderIconComponent } from './components/sort-order-icon/sort-order-icon.component';
import { TableEmptyMessageComponent } from './components/table-empty-message/table-empty-message.component';
import { TableComponent } from './components/table/table.component';
import { ToastContainerComponent } from './components/toast-container/toast-container.component';
import { ToastComponent } from './components/toast/toast.component';
import { DEFAULT_VALIDATION_BLUEPRINTS } from './constants/validation';
@ -29,7 +25,6 @@ import { EllipsisModule } from './directives/ellipsis.directive';
import { LoadingDirective } from './directives/loading.directive';
import { NgxDatatableDefaultDirective } from './directives/ngx-datatable-default.directive';
import { NgxDatatableListDirective } from './directives/ngx-datatable-list.directive';
import { TableSortDirective } from './directives/table-sort.directive';
import { ErrorHandler } from './handlers/error.handler';
import { initLazyStyleHandler } from './handlers/lazy-style.handler';
import { RootParams } from './models/common';
@ -46,15 +41,11 @@ const declarationsWithExports = [
LoaderBarComponent,
LoadingComponent,
ModalComponent,
TableComponent,
TableEmptyMessageComponent,
ToastComponent,
ToastContainerComponent,
SortOrderIconComponent,
NgxDatatableDefaultDirective,
NgxDatatableListDirective,
LoadingDirective,
TableSortDirective,
ModalCloseDirective,
];
@ -66,13 +57,12 @@ const declarationsWithExports = [
NgbPaginationModule,
EllipsisModule,
],
declarations: [...declarationsWithExports, HttpErrorWrapperComponent, ModalContainerComponent],
declarations: [...declarationsWithExports, HttpErrorWrapperComponent],
exports: [NgxDatatableModule, EllipsisModule, ...declarationsWithExports],
providers: [DatePipe],
entryComponents: [
HttpErrorWrapperComponent,
LoadingComponent,
ModalContainerComponent,
ToastContainerComponent,
ConfirmationComponent,
],

Loading…
Cancel
Save