= this._isOpen.asObservable();
+
+ open () {
+ this._isOpen.next(true);
+ }
+
+ close () {
+ this._isOpen.next(false);
+ }
+}
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/components/node-property-actions.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/property-actions/property-action-menu/property-action-menu.element.ts
similarity index 75%
rename from src/Umbraco.Web.UI.Client/src/backoffice/components/node-property-actions.element.ts
rename to src/Umbraco.Web.UI.Client/src/backoffice/property-actions/property-action-menu/property-action-menu.element.ts
index 72233ea95a..8a0cdde56e 100644
--- a/src/Umbraco.Web.UI.Client/src/backoffice/components/node-property-actions.element.ts
+++ b/src/Umbraco.Web.UI.Client/src/backoffice/property-actions/property-action-menu/property-action-menu.element.ts
@@ -2,13 +2,14 @@ import { UUITextStyles } from '@umbraco-ui/uui';
import { css, CSSResultGroup, html, LitElement } from 'lit';
import { customElement, property, state } from 'lit/decorators.js';
import { Subscription, map } from 'rxjs';
-import { UmbContextConsumerMixin } from '../../core/context';
-import { UmbExtensionManifestPropertyAction, UmbExtensionRegistry } from '../../core/extension';
+import { UmbContextProviderMixin, UmbContextConsumerMixin } from '../../../core/context';
+import { UmbExtensionManifestPropertyAction, UmbExtensionRegistry } from '../../../core/extension';
+import { UmbPropertyActionMenuContext } from './property-action-menu.context';
-import './node-property-action.element';
+import './property-action.element';
-@customElement('umb-node-property-actions')
-export class UmbNodePropertyActions extends UmbContextConsumerMixin(LitElement) {
+@customElement('umb-property-action-menu')
+export class UmbPropertyActionMenuElement extends UmbContextProviderMixin(UmbContextConsumerMixin(LitElement)) {
static styles: CSSResultGroup = [
UUITextStyles,
css`
@@ -54,14 +55,21 @@ export class UmbNodePropertyActions extends UmbContextConsumerMixin(LitElement)
private _extensionRegistry?: UmbExtensionRegistry;
private _subscription?: Subscription;
+ private _propertyActionMenuContext = new UmbPropertyActionMenuContext();
constructor () {
super();
+
+ this._propertyActionMenuContext.isOpen.subscribe((value: boolean) => {
+ this._open = value;
+ });
this.consumeContext('umbExtensionRegistry', (extensionRegistry: UmbExtensionRegistry) => {
this._extensionRegistry = extensionRegistry;
this._usePropertyActions();
});
+
+ this.provideContext('umbPropertyActionMenu', this._propertyActionMenuContext);
}
private _usePropertyActions () {
@@ -76,7 +84,8 @@ export class UmbNodePropertyActions extends UmbContextConsumerMixin(LitElement)
}
private _toggleMenu () {
- this._open = !this._open;
+ //this._open = !this._open;
+ this._open ? this._propertyActionMenuContext.close() : this._propertyActionMenuContext.open();
}
private _handleClose (event: CustomEvent) {
@@ -110,7 +119,7 @@ export class UmbNodePropertyActions extends UmbContextConsumerMixin(LitElement)
${this._actions.map(
action => html`
-
+
`
)}
diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/components/node-property-action.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/property-actions/property-action-menu/property-action.element.ts
similarity index 85%
rename from src/Umbraco.Web.UI.Client/src/backoffice/components/node-property-action.element.ts
rename to src/Umbraco.Web.UI.Client/src/backoffice/property-actions/property-action-menu/property-action.element.ts
index 45dff85c28..7571139b23 100644
--- a/src/Umbraco.Web.UI.Client/src/backoffice/components/node-property-action.element.ts
+++ b/src/Umbraco.Web.UI.Client/src/backoffice/property-actions/property-action-menu/property-action.element.ts
@@ -1,11 +1,11 @@
import { UUITextStyles } from '@umbraco-ui/uui';
import { CSSResultGroup, html, LitElement } from 'lit';
import { customElement, property, state } from 'lit/decorators.js';
-import { createExtensionElement, UmbExtensionManifestPropertyAction } from '../../core/extension';
-import type { UmbPropertyActionElement } from '../property-actions/property-action-element.model';
+import { createExtensionElement, UmbExtensionManifestPropertyAction } from '../../../core/extension';
+import type { UmbPropertyAction } from '../property-action-element.model';
-@customElement('umb-node-property-action')
-export class UmbNodePropertyAction extends LitElement {
+@customElement('umb-property-action')
+export class UmbPropertyActionElement extends LitElement implements UmbPropertyAction {
static styles: CSSResultGroup = [
UUITextStyles
];