diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/property-editors/number/property-editor-number.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/property-editors/number/property-editor-number.element.ts new file mode 100644 index 0000000000..2bff931e5c --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/backoffice/property-editors/number/property-editor-number.element.ts @@ -0,0 +1,35 @@ +import { css, html, LitElement } from 'lit'; +import { UUITextStyles } from '@umbraco-ui/uui-css/lib'; +import { customElement, property } from 'lit/decorators.js'; + +@customElement('umb-property-editor-number') +export class UmbPropertyEditorNumberElement extends LitElement { + static styles = [ + UUITextStyles, + css` + uui-input { + width: 100%; + } + `, + ]; + + @property() + value = ''; + + private onInput(e: InputEvent) { + this.value = (e.target as HTMLInputElement).value; + this.dispatchEvent(new CustomEvent('property-editor-change', { bubbles: true, composed: true })); + } + + render() { + return html``; + } +} + +export default UmbPropertyEditorNumberElement; + +declare global { + interface HTMLElementTagNameMap { + 'umb-property-editor-number': UmbPropertyEditorNumberElement; + } +} diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/property-editors/number/property-editor-number.stories.ts b/src/Umbraco.Web.UI.Client/src/backoffice/property-editors/number/property-editor-number.stories.ts new file mode 100644 index 0000000000..d9d2915599 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/backoffice/property-editors/number/property-editor-number.stories.ts @@ -0,0 +1,15 @@ +import { Meta, Story } from '@storybook/web-components'; +import { html } from 'lit-html'; + +import type { UmbPropertyEditorNumberElement } from './property-editor-number.element'; +import './property-editor-number.element'; + +export default { + title: 'Property Editors/Number', + component: 'umb-property-editor-number', + id: 'umb-property-editor-number', +} as Meta; + +export const AAAOverview: Story = () => + html` `; +AAAOverview.storyName = 'Overview'; diff --git a/src/Umbraco.Web.UI.Client/src/temp-internal-manifests.ts b/src/Umbraco.Web.UI.Client/src/temp-internal-manifests.ts index 70d4f03098..dc891b2c32 100644 --- a/src/Umbraco.Web.UI.Client/src/temp-internal-manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/temp-internal-manifests.ts @@ -164,6 +164,17 @@ export const internalManifests: Array Promise import('./backoffice/property-editors/number/property-editor-number.element'), + meta: { + icon: 'umb:autofill', + group: 'Common', + propertyEditors: ['Umbraco.Integer'], + }, + }, { type: 'editorView', alias: 'Umb.EditorView.Content.Edit',