diff --git a/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-form/extensible-form-prop.component.html b/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-form/extensible-form-prop.component.html index 254b481c16..4f77dd0cf7 100644 --- a/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-form/extensible-form-prop.component.html +++ b/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-form/extensible-form-prop.component.html @@ -52,12 +52,13 @@ [abpDisabled]="disabled" class="form-select form-control" > - + @for (option of options$ | async; track option.value) { + + } @@ -161,18 +162,21 @@ - {{ + @if (prop.formText) { + {{ prop.formText | abpLocalization }} + } diff --git a/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-form/extensible-form-prop.component.ts b/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-form/extensible-form-prop.component.ts index de6eaedffd..024a8ce80e 100644 --- a/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-form/extensible-form-prop.component.ts +++ b/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-form/extensible-form-prop.component.ts @@ -1,5 +1,5 @@ import { EXTENSIONS_FORM_PROP, EXTENSIONS_FORM_PROP_DATA } from './../../tokens/extensions.token'; -import { ABP, CoreModule, ShowPasswordDirective, TrackByService } from '@abp/ng.core'; +import { ABP, LocalizationModule, PermissionDirective, ShowPasswordDirective, TrackByService } from '@abp/ng.core'; import { AfterViewInit, ChangeDetectionStrategy, @@ -30,11 +30,7 @@ import { } from '@ng-bootstrap/ng-bootstrap'; import { Observable, of } from 'rxjs'; import { debounceTime, distinctUntilChanged, switchMap } from 'rxjs/operators'; -import { - DateAdapter, - DisabledDirective, - TimeAdapter, -} from '@abp/ng.theme.shared'; +import { DateAdapter, DisabledDirective, TimeAdapter } from '@abp/ng.theme.shared'; import { EXTRA_PROPERTIES_KEY } from '../../constants/extra-properties'; import { FormProp } from '../../models/form-props'; import { PropData } from '../../models/props'; @@ -44,14 +40,14 @@ import { eThemeSharedComponents } from '../../enums/components'; import { ExtensibleDateTimePickerComponent } from '../date-time-picker/extensible-date-time-picker.component'; import { NgxValidateCoreModule } from '@ngx-validate/core'; import { ExtensibleFormPropService } from '../../services/extensible-form-prop.service'; -import {CreateInjectorPipe} from "../../pipes/create-injector.pipe"; +import { CreateInjectorPipe } from '../../pipes/create-injector.pipe'; +import { AsyncPipe, NgClass, NgSwitch, NgSwitchCase, NgTemplateOutlet } from '@angular/common'; @Component({ selector: 'abp-extensible-form-prop', templateUrl: './extensible-form-prop.component.html', standalone: true, imports: [ - CoreModule, ExtensibleDateTimePickerComponent, NgbDatepickerModule, NgbTimepickerModule, @@ -60,7 +56,14 @@ import {CreateInjectorPipe} from "../../pipes/create-injector.pipe"; NgxValidateCoreModule, NgbTypeaheadModule, CreateInjectorPipe, - ShowPasswordDirective + ShowPasswordDirective, + PermissionDirective, + LocalizationModule, + AsyncPipe, + NgSwitch, + NgSwitchCase, + NgClass, + NgTemplateOutlet, ], changeDetection: ChangeDetectionStrategy.OnPush, providers: [ExtensibleFormPropService], diff --git a/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.html b/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.html index 65c958d6aa..0ba4b22d45 100644 --- a/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.html +++ b/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.html @@ -5,8 +5,8 @@ [list]="list" (activate)="tableActivate.emit($event)" > + @if (actionsTemplate || (actionList.length && hasAtLeastOnePermittedAction)) { - - - - - - {{ column.name }} - - - {{ column.name }} - - - - - -
-
- - - + } @for (prop of propList; track prop.name; let i = $index) { + + + @if (prop.tooltip) { + + {{ column.name }} + + }@else{ + {{ column.name }} + } + + + + + @if (!row['_' + prop.name].component) { +
+ }@else{ + + }
-
-
-
+
+ + + } diff --git a/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts b/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts index 62cf358b84..5670ca7343 100644 --- a/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts +++ b/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts @@ -6,9 +6,18 @@ import { getShortDateShortTimeFormat, getShortTimeFormat, ListService, + LocalizationModule, + PermissionDirective, PermissionService, } from '@abp/ng.core'; -import { formatDate } from '@angular/common'; +import { + AsyncPipe, + formatDate, + NgComponentOutlet, + NgFor, + NgIf, + NgTemplateOutlet, +} from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -51,13 +60,17 @@ const DEFAULT_ACTIONS_COLUMN_WIDTH = 150; selector: 'abp-extensible-table', standalone: true, imports: [ - CoreModule, AbpVisibleDirective, NgxDatatableModule, GridActionsComponent, NgbTooltip, NgxDatatableDefaultDirective, NgxDatatableListDirective, + PermissionDirective, + LocalizationModule, + AsyncPipe, + NgTemplateOutlet, + NgComponentOutlet, ], templateUrl: './extensible-table.component.html', changeDetection: ChangeDetectionStrategy.OnPush, diff --git a/npm/ng-packs/packages/components/extensible/src/lib/components/grid-actions/grid-actions.component.html b/npm/ng-packs/packages/components/extensible/src/lib/components/grid-actions/grid-actions.component.html index 9f567271a4..73e01b3440 100644 --- a/npm/ng-packs/packages/components/extensible/src/lib/components/grid-actions/grid-actions.component.html +++ b/npm/ng-packs/packages/components/extensible/src/lib/components/grid-actions/grid-actions.component.html @@ -1,4 +1,5 @@ -
+@if (actionList.length > 1) { +
- - + @for (action of actionList; track action.text) { + + + }
- +} @if (actionList.length === 1) { +} - - - + @if (action.visible(data)) { + + } - {{ action.text | abpLocalization }} - -
{{ action.text | abpLocalization }}
-
+ @if (action.icon) { + {{ action.text | abpLocalization }} + }@else { +
{{ action.text | abpLocalization }}
+ }
- - - + @if (action.visible(data)) { + + } diff --git a/npm/ng-packs/packages/components/extensible/src/lib/components/grid-actions/grid-actions.component.ts b/npm/ng-packs/packages/components/extensible/src/lib/components/grid-actions/grid-actions.component.ts index ebccd6e163..6937b93d8a 100644 --- a/npm/ng-packs/packages/components/extensible/src/lib/components/grid-actions/grid-actions.component.ts +++ b/npm/ng-packs/packages/components/extensible/src/lib/components/grid-actions/grid-actions.component.ts @@ -9,13 +9,21 @@ import { EntityAction, EntityActionList } from '../../models/entity-actions'; import { EXTENSIONS_ACTION_TYPE } from '../../tokens/extensions.token'; import { AbstractActionsComponent } from '../abstract-actions/abstract-actions.component'; import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; -import { CoreModule } from '@abp/ng.core'; -import {EllipsisDirective} from "@abp/ng.theme.shared"; +import { LocalizationModule, PermissionDirective } from '@abp/ng.core'; +import { EllipsisDirective } from '@abp/ng.theme.shared'; +import { NgClass, NgTemplateOutlet } from '@angular/common'; @Component({ exportAs: 'abpGridActions', standalone: true, - imports: [ CoreModule, NgbDropdownModule, EllipsisDirective], + imports: [ + NgbDropdownModule, + EllipsisDirective, + PermissionDirective, + NgClass, + LocalizationModule, + NgTemplateOutlet, + ], selector: 'abp-grid-actions', templateUrl: './grid-actions.component.html', providers: [ diff --git a/npm/ng-packs/packages/components/extensible/src/lib/components/page-toolbar/page-toolbar.component.html b/npm/ng-packs/packages/components/extensible/src/lib/components/page-toolbar/page-toolbar.component.html index 285e0aa94b..c39bf59dd1 100644 --- a/npm/ng-packs/packages/components/extensible/src/lib/components/page-toolbar/page-toolbar.component.html +++ b/npm/ng-packs/packages/components/extensible/src/lib/components/page-toolbar/page-toolbar.component.html @@ -1,31 +1,29 @@
-
- - - - - + @for (action of actionList; track action.component || action.action; let last = $last) { +
+ @if (action.visible(data)) { + + @if (action.component; as component) { + - - - - - - + }@else { + @if (asToolbarAction(action).value; as toolbarAction ) { + + } + } + }
+ }
+ diff --git a/npm/ng-packs/packages/components/extensible/src/lib/components/page-toolbar/page-toolbar.component.ts b/npm/ng-packs/packages/components/extensible/src/lib/components/page-toolbar/page-toolbar.component.ts index 85685cdee6..507064a54c 100644 --- a/npm/ng-packs/packages/components/extensible/src/lib/components/page-toolbar/page-toolbar.component.ts +++ b/npm/ng-packs/packages/components/extensible/src/lib/components/page-toolbar/page-toolbar.component.ts @@ -9,13 +9,20 @@ import { import { EXTENSIONS_ACTION_TYPE } from '../../tokens/extensions.token'; import { AbstractActionsComponent } from '../abstract-actions/abstract-actions.component'; import { CreateInjectorPipe } from '../../pipes/create-injector.pipe'; -import { CoreModule } from '@abp/ng.core'; +import { LocalizationModule, PermissionDirective } from '@abp/ng.core'; +import { NgClass, NgComponentOutlet } from '@angular/common'; @Component({ exportAs: 'abpPageToolbar', selector: 'abp-page-toolbar', standalone: true, - imports: [ CoreModule, CreateInjectorPipe], + imports: [ + CreateInjectorPipe, + PermissionDirective, + LocalizationModule, + NgClass, + NgComponentOutlet, + ], templateUrl: './page-toolbar.component.html', providers: [ { diff --git a/npm/ng-packs/packages/core/src/lib/core.module.ts b/npm/ng-packs/packages/core/src/lib/core.module.ts index c4f7c78fa7..57133ab69e 100644 --- a/npm/ng-packs/packages/core/src/lib/core.module.ts +++ b/npm/ng-packs/packages/core/src/lib/core.module.ts @@ -40,6 +40,16 @@ import { DefaultQueueManager } from './utils/queue'; import { IncludeLocalizationResourcesProvider } from './providers/include-localization-resources.provider'; import { SORT_COMPARE_FUNC, compareFuncFactory } from './tokens/compare-func.token'; +const standaloneDirectives = [ + AutofocusDirective, + InputEventDebounceDirective, + ForDirective, + FormSubmitDirective, + InitDirective, + PermissionDirective, + ReplaceableTemplateDirective, + StopPropagationDirective, +]; /** * BaseCoreModule is the module that holds * all imports, declarations, exports, and entryComponents @@ -55,23 +65,16 @@ import { SORT_COMPARE_FUNC, compareFuncFactory } from './tokens/compare-func.tok RouterModule, LocalizationModule, AbstractNgModelComponent, - AutofocusDirective, DynamicLayoutComponent, - ForDirective, - FormSubmitDirective, - InitDirective, - InputEventDebounceDirective, - PermissionDirective, ReplaceableRouteContainerComponent, - ReplaceableTemplateDirective, RouterOutletComponent, SortPipe, SafeHtmlPipe, - StopPropagationDirective, ToInjectorPipe, ShortDateTimePipe, ShortTimePipe, ShortDatePipe, + ...standaloneDirectives, ], imports: [ CommonModule, @@ -80,22 +83,15 @@ import { SORT_COMPARE_FUNC, compareFuncFactory } from './tokens/compare-func.tok ReactiveFormsModule, RouterModule, LocalizationModule, + ...standaloneDirectives, ], declarations: [ AbstractNgModelComponent, - AutofocusDirective, DynamicLayoutComponent, - ForDirective, - FormSubmitDirective, - InitDirective, - InputEventDebounceDirective, - PermissionDirective, ReplaceableRouteContainerComponent, - ReplaceableTemplateDirective, RouterOutletComponent, SortPipe, SafeHtmlPipe, - StopPropagationDirective, ToInjectorPipe, ShortDateTimePipe, ShortTimePipe, @@ -179,7 +175,7 @@ export class CoreModule { }, { provide: SORT_COMPARE_FUNC, - useFactory: compareFuncFactory + useFactory: compareFuncFactory, }, { provide: QUEUE_MANAGER, diff --git a/npm/ng-packs/packages/core/src/lib/directives/autofocus.directive.ts b/npm/ng-packs/packages/core/src/lib/directives/autofocus.directive.ts index 84703badcf..c092ee8a3a 100644 --- a/npm/ng-packs/packages/core/src/lib/directives/autofocus.directive.ts +++ b/npm/ng-packs/packages/core/src/lib/directives/autofocus.directive.ts @@ -1,7 +1,7 @@ import { AfterViewInit, Directive, ElementRef, Input } from '@angular/core'; @Directive({ - // eslint-disable-next-line @angular-eslint/directive-selector + standalone: true, selector: '[autofocus]', }) export class AutofocusDirective implements AfterViewInit { diff --git a/npm/ng-packs/packages/core/src/lib/directives/debounce.directive.ts b/npm/ng-packs/packages/core/src/lib/directives/debounce.directive.ts index 69a96f95f1..36df11ee88 100644 --- a/npm/ng-packs/packages/core/src/lib/directives/debounce.directive.ts +++ b/npm/ng-packs/packages/core/src/lib/directives/debounce.directive.ts @@ -4,7 +4,7 @@ import { debounceTime } from 'rxjs/operators'; import { SubscriptionService } from '../services/subscription.service'; @Directive({ - // eslint-disable-next-line @angular-eslint/directive-selector + standalone: true, selector: '[input.debounce]', providers: [SubscriptionService], }) diff --git a/npm/ng-packs/packages/core/src/lib/directives/for.directive.ts b/npm/ng-packs/packages/core/src/lib/directives/for.directive.ts index 1e37e1c908..387cfac844 100644 --- a/npm/ng-packs/packages/core/src/lib/directives/for.directive.ts +++ b/npm/ng-packs/packages/core/src/lib/directives/for.directive.ts @@ -33,6 +33,7 @@ class RecordView { } @Directive({ + standalone: true, selector: '[abpFor]', }) export class ForDirective implements OnChanges { diff --git a/npm/ng-packs/packages/core/src/lib/directives/form-submit.directive.ts b/npm/ng-packs/packages/core/src/lib/directives/form-submit.directive.ts index 7562a1b7b7..2eb4fc11f4 100644 --- a/npm/ng-packs/packages/core/src/lib/directives/form-submit.directive.ts +++ b/npm/ng-packs/packages/core/src/lib/directives/form-submit.directive.ts @@ -18,7 +18,7 @@ type Controls = { [key: string]: UntypedFormControl } | UntypedFormGroup[]; * @deprecated FormSubmitDirective will be removed in V7.0.0. Use `ngSubmit` instead. */ @Directive({ - // eslint-disable-next-line @angular-eslint/directive-selector + standalone: true, selector: 'form[ngSubmit][formGroup]', providers: [SubscriptionService], }) diff --git a/npm/ng-packs/packages/core/src/lib/directives/init.directive.ts b/npm/ng-packs/packages/core/src/lib/directives/init.directive.ts index ba55523757..b885cb88cf 100644 --- a/npm/ng-packs/packages/core/src/lib/directives/init.directive.ts +++ b/npm/ng-packs/packages/core/src/lib/directives/init.directive.ts @@ -1,6 +1,9 @@ import { Directive, Output, EventEmitter, ElementRef, AfterViewInit } from '@angular/core'; -@Directive({ selector: '[abpInit]' }) +@Directive({ + standalone: true, + selector: '[abpInit]', +}) export class InitDirective implements AfterViewInit { @Output('abpInit') readonly init = new EventEmitter>(); diff --git a/npm/ng-packs/packages/core/src/lib/directives/permission.directive.ts b/npm/ng-packs/packages/core/src/lib/directives/permission.directive.ts index f277bf50ee..420c5ff737 100644 --- a/npm/ng-packs/packages/core/src/lib/directives/permission.directive.ts +++ b/npm/ng-packs/packages/core/src/lib/directives/permission.directive.ts @@ -17,6 +17,7 @@ import { QUEUE_MANAGER } from '../tokens/queue.token'; import { QueueManager } from '../utils/queue'; @Directive({ + standalone: true, selector: '[abpPermission]', }) export class PermissionDirective implements OnDestroy, OnChanges, AfterViewInit { diff --git a/npm/ng-packs/packages/core/src/lib/directives/replaceable-template.directive.ts b/npm/ng-packs/packages/core/src/lib/directives/replaceable-template.directive.ts index 9a1bedcd71..b7b70e5b82 100644 --- a/npm/ng-packs/packages/core/src/lib/directives/replaceable-template.directive.ts +++ b/npm/ng-packs/packages/core/src/lib/directives/replaceable-template.directive.ts @@ -18,6 +18,7 @@ import { ReplaceableComponentsService } from '../services/replaceable-components import { SubscriptionService } from '../services/subscription.service'; @Directive({ + standalone: true, selector: '[abpReplaceableTemplate]', providers: [SubscriptionService], }) diff --git a/npm/ng-packs/packages/core/src/lib/directives/stop-propagation.directive.ts b/npm/ng-packs/packages/core/src/lib/directives/stop-propagation.directive.ts index 0863d45e88..eab0210c7f 100644 --- a/npm/ng-packs/packages/core/src/lib/directives/stop-propagation.directive.ts +++ b/npm/ng-packs/packages/core/src/lib/directives/stop-propagation.directive.ts @@ -3,7 +3,7 @@ import { fromEvent } from 'rxjs'; import { SubscriptionService } from '../services/subscription.service'; @Directive({ - // eslint-disable-next-line @angular-eslint/directive-selector + standalone: true, selector: '[click.stop]', providers: [SubscriptionService], })