{"version":3,"file":"property-action-menu.element-By2Auq7u.js","sources":["../../../src/packages/core/property-action/components/property-action-menu/property-action-menu.element.ts"],"sourcesContent":["import type { UmbPropertyActionArgs } from '../property-action/types.js';\nimport { css, customElement, html, nothing, property, repeat, state } from '@umbraco-cms/backoffice/external/lit';\nimport { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';\nimport type { ManifestPropertyAction, MetaPropertyAction } from '@umbraco-cms/backoffice/extension-registry';\nimport { UmbExtensionsElementAndApiInitializer } from '@umbraco-cms/backoffice/extension-api';\nimport { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';\nimport { UmbTextStyles } from '@umbraco-cms/backoffice/style';\nimport type { UmbExtensionElementAndApiInitializer } from '@umbraco-cms/backoffice/extension-api';\n\n/**\n *\n * @param manifest\n * @returns\n */\nfunction ExtensionApiArgsMethod(manifest: ManifestPropertyAction): [UmbPropertyActionArgs] {\n\treturn [{ meta: manifest.meta }];\n}\n\n@customElement('umb-property-action-menu')\nexport class UmbPropertyActionMenuElement extends UmbLitElement {\n\t@state()\n\tprivate _actions: Array> = [];\n\n\t@property()\n\tset propertyEditorUiAlias(alias: string) {\n\t\tthis.#propertyEditorUiAlias = alias;\n\n\t\t// TODO: Stop using string for 'propertyAction', we need to start using Const. [NL]\n\t\tnew UmbExtensionsElementAndApiInitializer(\n\t\t\tthis,\n\t\t\tumbExtensionsRegistry,\n\t\t\t'propertyAction',\n\t\t\tExtensionApiArgsMethod,\n\t\t\t(propertyAction) => propertyAction.forPropertyEditorUis.includes(alias),\n\t\t\t(actions) => (this._actions = actions),\n\t\t\t'extensionsInitializer',\n\t\t);\n\t}\n\tget propertyEditorUiAlias() {\n\t\treturn this.#propertyEditorUiAlias;\n\t}\n\t#propertyEditorUiAlias = '';\n\n\toverride render() {\n\t\tif (!this._actions?.length) return nothing;\n\t\treturn html`\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t${repeat(\n\t\t\t\t\t\tthis._actions,\n\t\t\t\t\t\t(action) => action.alias,\n\t\t\t\t\t\t(action) => action.component,\n\t\t\t\t\t)}\n\t\t\t\t\n\t\t\t\n\t\t`;\n\t}\n\n\tstatic override styles = [\n\t\tUmbTextStyles,\n\t\tcss`\n\t\t\t:host {\n\t\t\t\t--uui-menu-item-flat-structure: 1;\n\t\t\t}\n\n\t\t\t#more-symbol {\n\t\t\t\tfont-size: 1rem;\n\t\t\t}\n\n\t\t\t#popover-trigger {\n\t\t\t\t--uui-button-padding-top-factor: 0.5;\n\t\t\t\t--uui-button-padding-bottom-factor: 0.1;\n\t\t\t\t--uui-button-height: 18px;\n\t\t\t\t--uui-button-border-radius: 6px;\n\t\t\t}\n\t\t`,\n\t];\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'umb-property-action-menu': UmbPropertyActionMenuElement;\n\t}\n}\n"],"names":["_propertyEditorUiAlias","ExtensionApiArgsMethod","manifest","UmbPropertyActionMenuElement","UmbLitElement","__privateAdd","alias","__privateSet","UmbExtensionsElementAndApiInitializer","umbExtensionsRegistry","propertyAction","actions","__privateGet","html","repeat","action","nothing","UmbTextStyles","css","__decorateClass","state","property","customElement"],"mappings":";;;;;;;;;;;gVAAAA;AAcA,SAASC,EAAuBC,GAA+E;AAC9G,SAAO,CAAC,EAAE,MAAMA,EAAS,KAAM,CAAA;AAChC;AAGa,IAAAC,IAAN,cAA2CC,EAAc;AAAA,EAAzD,cAAA;AAAA,UAAA,GAAA,SAAA,GAEN,KAAQ,WAAuF,IAoBtEC,EAAA,MAAAL,GAAA,EAAA;AAAA,EAAA;AAAA,EAjBzB,IAAI,sBAAsBM,GAAe;AACxC,IAAAC,EAAA,MAAKP,GAAyBM,CAAA,GAG1B,IAAAE;AAAA,MACH;AAAA,MACAC;AAAA,MACA;AAAA,MACAR;AAAA,MACA,CAACS,MAAmBA,EAAe,qBAAqB,SAASJ,CAAK;AAAA,MACtE,CAACK,MAAa,KAAK,WAAWA;AAAA,M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