add type to element
This commit is contained in:
committed by
Jacob Overgaard
parent
a242939ad3
commit
d6f54a544b
@@ -2,7 +2,7 @@ import { UmbControllerHostInterface } from '@umbraco-cms/controller';
|
||||
import { umbExtensionsRegistry, createExtensionClass } from '@umbraco-cms/extensions-api';
|
||||
import { UmbObserverController } from '@umbraco-cms/observable-api';
|
||||
|
||||
export interface UmbAction<RepositoryType> {
|
||||
export interface UmbAction<RepositoryType = unknown> {
|
||||
host: UmbControllerHostInterface;
|
||||
repository: RepositoryType;
|
||||
execute(): Promise<void>;
|
||||
|
||||
@@ -4,6 +4,7 @@ import { ifDefined } from 'lit-html/directives/if-defined.js';
|
||||
import { UmbExecutedEvent } from '@umbraco-cms/events';
|
||||
import { UmbLitElement } from '@umbraco-cms/element';
|
||||
import { ManifestEntityBulkAction } from '@umbraco-cms/extensions-registry';
|
||||
import { UmbAction } from '@umbraco-cms/entity-action';
|
||||
|
||||
@customElement('umb-entity-bulk-action')
|
||||
class UmbEntityBulkActionElement extends UmbLitElement {
|
||||
@@ -40,9 +41,10 @@ class UmbEntityBulkActionElement extends UmbLitElement {
|
||||
this.#api = new this._manifest.meta.api(this, this._manifest.meta.repositoryAlias, this._selection);
|
||||
}
|
||||
|
||||
#api: any;
|
||||
#api?: UmbAction;
|
||||
|
||||
async #onClick(event: PointerEvent) {
|
||||
if (!this.#api) return;
|
||||
event.stopPropagation();
|
||||
await this.#api.execute();
|
||||
this.dispatchEvent(new UmbExecutedEvent());
|
||||
|
||||
Reference in New Issue
Block a user