{"version":3,"file":"index.js","sources":["../../../../src/packages/core/property-editor/constants.ts","../../../../src/packages/core/property-editor/components/ref-property-editor-ui/ref-property-editor-ui.element.ts","../../../../src/packages/core/property-editor/config/property-editor-config-collection.class.ts","../../../../src/packages/core/property-editor/events/property-value-change.event.ts","../../../../src/packages/core/property-editor/ui-picker-modal/property-editor-ui-picker-modal.token.ts"],"sourcesContent":["export const UMB_PROPERTY_EDITOR_SCHEMA_ALIAS_DEFAULT = 'Umbraco.Label';\r\n","import { UMB_PROPERTY_EDITOR_SCHEMA_ALIAS_DEFAULT } from '../../constants.js';\r\nimport { UUIRefNodeElement } from '@umbraco-cms/backoffice/external/uui';\r\nimport { html, customElement, property } from '@umbraco-cms/backoffice/external/lit';\r\n\r\n/**\r\n * @element umb-ref-property-editor-ui\r\n * @description - Component for displaying a reference to a Property Editor UI\r\n * @augments UUIRefNodeElement\r\n */\r\n@customElement('umb-ref-property-editor-ui')\r\nexport class UmbRefPropertyEditorUIElement extends UUIRefNodeElement {\r\n\tprotected override fallbackIcon =\r\n\t\t'';\r\n\r\n\t/**\r\n\t * Alias\r\n\t * @type {string}\r\n\t * @attr\r\n\t * @default ''\r\n\t */\r\n\t@property({ type: String })\r\n\talias = '';\r\n\r\n\t/**\r\n\t * Property Editor Alias\r\n\t * @type {string}\r\n\t * @attr\r\n\t * @default ''\r\n\t */\r\n\t@property({ type: String, attribute: 'property-editor-schema-alias' })\r\n\tpropertyEditorSchemaAlias = '';\r\n\r\n\tprotected override renderDetail() {\r\n\t\tconst details: string[] = [];\r\n\r\n\t\tif (this.alias !== '') {\r\n\t\t\tdetails.push(this.alias);\r\n\t\t}\r\n\r\n\t\tif (this.propertyEditorSchemaAlias !== '') {\r\n\t\t\tdetails.push(this.propertyEditorSchemaAlias);\r\n\t\t} else {\r\n\t\t\tdetails.push(UMB_PROPERTY_EDITOR_SCHEMA_ALIAS_DEFAULT);\r\n\t\t}\r\n\r\n\t\tif (this.detail !== '') {\r\n\t\t\tdetails.push(this.detail);\r\n\t\t}\r\n\t\treturn html`${details.join(' | ')}`;\r\n\t}\r\n\r\n\tstatic override styles = [...UUIRefNodeElement.styles];\r\n}\r\n\r\ndeclare global {\r\n\tinterface HTMLElementTagNameMap {\r\n\t\t'umb-ref-property-editor-ui': UmbRefPropertyEditorUIElement;\r\n\t}\r\n}\r\n","import type { UmbPropertyEditorConfigProperty, UmbPropertyEditorConfig } from '../index.js';\r\nimport type { DataTypePropertyPresentationModel } from '@umbraco-cms/backoffice/external/backend-api';\r\n\r\n/**\r\n * Extends Array to add utility functions for accessing data type properties\r\n * by alias, returning either the value or the complete DataTypePropertyPresentationModel object\r\n */\r\nexport class UmbPropertyEditorConfigCollection extends Array {\r\n\tconstructor(args: UmbPropertyEditorConfig) {\r\n\t\tsuper(...args);\r\n\t}\r\n\tstatic override get [Symbol.species](): ArrayConstructor {\r\n\t\treturn Array;\r\n\t}\r\n\r\n\tgetValueByAlias(alias: string): T | undefined {\r\n\t\tconst property = this.getByAlias(alias);\r\n\r\n\t\tif (property?.value === undefined || property?.value === null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\treturn property.value as T;\r\n\t}\r\n\r\n\tgetByAlias(alias: string): DataTypePropertyPresentationModel | undefined {\r\n\t\treturn this.find((x) => x.alias === alias);\r\n\t}\r\n\r\n\t/**\r\n\t * Convert the underlying array to an object where\r\n\t * the property value is keyed by its alias\r\n\t * eg\r\n\t * `[\r\n\t * { 'alias': 'myProperty', 'value': 27 },\r\n\t * { 'alias': 'anotherProperty', 'value': 'eleven' },\r\n\t * ]`\r\n\t * is returned as\r\n\t * `{\r\n\t * myProperty: 27,\r\n\t * \t anotherProperty: 'eleven',\r\n\t * }`\r\n\t */\r\n\ttoObject(): Record {\r\n\t\treturn Object.fromEntries(this.map((x) => [x.alias, x.value]));\r\n\t}\r\n\r\n\tequal(other: UmbPropertyEditorConfigCollection | undefined): boolean {\r\n\t\tif (this.length !== other?.length) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn this.every((x) => {\r\n\t\t\tconst otherProperty = x.alias ? other.getByAlias(x.alias!) : undefined;\r\n\t\t\treturn otherProperty && x.value === otherProperty.value;\r\n\t\t});\r\n\t}\r\n}\r\n","export class UmbPropertyValueChangeEvent extends Event {\r\n\tpublic constructor() {\r\n\t\t// mimics the native change event\r\n\t\tsuper('change', { bubbles: true, composed: false, cancelable: false });\r\n\t}\r\n}\r\n","import { UmbModalToken } from '@umbraco-cms/backoffice/modal';\r\n\r\nexport interface UmbPropertyEditorUIPickerModalData {\r\n\t/** @deprecated This property will be removed in Umbraco 15. */\r\n\tsubmitLabel?: string;\r\n}\r\n\r\nexport type UmbPropertyEditorUIPickerModalValue = {\r\n\tselection: Array;\r\n};\r\n\r\nexport const UMB_PROPERTY_EDITOR_UI_PICKER_MODAL = new UmbModalToken<\r\n\tUmbPropertyEditorUIPickerModalData,\r\n\tUmbPropertyEditorUIPickerModalValue\r\n>('Umb.Modal.PropertyEditorUiPicker', {\r\n\tmodal: {\r\n\t\ttype: 'sidebar',\r\n\t\tsize: 'small',\r\n\t},\r\n});\r\n"],"names":["UMB_PROPERTY_EDITOR_SCHEMA_ALIAS_DEFAULT","UmbRefPropertyEditorUIElement","UUIRefNodeElement","details","html","__decorateClass","property","customElement","UmbPropertyEditorConfigCollection","args","alias","x","other","otherProperty","UmbPropertyValueChangeEvent","UMB_PROPERTY_EDITOR_UI_PICKER_MODAL","UmbModalToken"],"mappings":";;;AAAO,MAAMA,IAA2C;;;;;;ACU3C,IAAAC,IAAN,cAA4CC,EAAkB;AAAA,EAA9D,cAAA;AAAA,UAAA,GAAA,SAAA,GACN,KAAmB,eAClB,mgBASO,KAAA,QAAA,IASoB,KAAA,4BAAA;AAAA,EAAA;AAAA,EAET,eAAe;AACjC,UAAMC,IAAoB,CAAC;AAEvB,WAAA,KAAK,UAAU,MACVA,EAAA,KAAK,KAAK,KAAK,GAGpB,KAAK,8BAA8B,KAC9BA,EAAA,KAAK,KAAK,yBAAy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