add tree picker scaffold

This commit is contained in:
Mads Rasmussen
2023-01-03 15:10:32 +01:00
parent ef718589da
commit 4686661266
3 changed files with 65 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
import { html, LitElement } from 'lit';
import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
import { customElement, property } from 'lit/decorators.js';
/**
* @element umb-property-editor-ui-tree-picker
*/
@customElement('umb-property-editor-ui-tree-picker')
export class UmbPropertyEditorUITreePickerElement extends LitElement {
static styles = [UUITextStyles];
@property()
value = '';
@property({ type: Array, attribute: false })
public config = [];
render() {
return html`<div>umb-property-editor-ui-tree-picker</div>`;
}
}
export default UmbPropertyEditorUITreePickerElement;
declare global {
interface HTMLElementTagNameMap {
'umb-property-editor-ui-tree-picker': UmbPropertyEditorUITreePickerElement;
}
}

View File

@@ -0,0 +1,15 @@
import { Meta, Story } from '@storybook/web-components';
import { html } from 'lit-html';
import type { UmbPropertyEditorUITreePickerElement } from './property-editor-ui-tree-picker.element';
import './property-editor-ui-tree-picker.element';
export default {
title: 'Property Editor UIs/Tree Picker',
component: 'umb-property-editor-ui-tree-picker',
id: 'umb-property-editor-ui-tree-picker',
} as Meta;
export const AAAOverview: Story<UmbPropertyEditorUITreePickerElement> = () =>
html`<umb-property-editor-ui-tree-picker></umb-property-editor-ui-tree-picker>`;
AAAOverview.storyName = 'Overview';

View File

@@ -0,0 +1,21 @@
import { expect, fixture, html } from '@open-wc/testing';
import { UmbPropertyEditorUITreePickerElement } from './property-editor-ui-tree-picker.element';
import { defaultA11yConfig } from '@umbraco-cms/test-utils';
describe('UmbPropertyEditorUITreePickerElement', () => {
let element: UmbPropertyEditorUITreePickerElement;
beforeEach(async () => {
element = await fixture(
html` <umb-property-editor-ui-tree-picker></umb-property-editor-ui-tree-picker> `
);
});
it('is defined with its own instance', () => {
expect(element).to.be.instanceOf(UmbPropertyEditorUITreePickerElement);
});
it('passes the a11y audit', async () => {
await expect(element).shadowDom.to.be.accessible(defaultA11yConfig);
});
});