Skip to content

Commit ac2a14d

Browse files
committed
Housekeeping / boilerplate
Adding `elementName` constant + linting
1 parent 9f9dc56 commit ac2a14d

File tree

7 files changed

+25
-15
lines changed

7 files changed

+25
-15
lines changed

src/packages/core/picker-input/picker-input.context.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ export class UmbPickerInputContext<
9999
content: 'Are you sure you want to remove this item',
100100
confirmLabel: 'Remove',
101101
});
102+
102103
this.#removeItem(unique);
103104
}
104105

src/packages/core/validation/controllers/form-control-validator.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { UmbFormControlMixinInterface } from '../mixins/form-control.mixin.
44
import { UmbValidationInvalidEvent } from '../events/validation-invalid.event.js';
55
import { UmbValidationValidEvent } from '../events/validation-valid.event.js';
66
import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
7-
import type { UmbControllerAlias, UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
7+
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
88

99
export class UmbFormControlValidator extends UmbControllerBase implements UmbValidator {
1010
// The path to the data that this validator is validating.

src/packages/documents/documents/components/input-document/input-document.element.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@ import { UmbDocumentPickerContext } from './input-document.context.js';
22
import { classMap, css, customElement, html, property, repeat, state } from '@umbraco-cms/backoffice/external/lit';
33
import { splitStringToArray } from '@umbraco-cms/backoffice/utils';
44
import { UmbChangeEvent } from '@umbraco-cms/backoffice/event';
5+
import { UmbFormControlMixin } from '@umbraco-cms/backoffice/validation';
56
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
67
import { UmbSorterController } from '@umbraco-cms/backoffice/sorter';
78
import { UMB_WORKSPACE_MODAL } from '@umbraco-cms/backoffice/modal';
89
import { UmbModalRouteRegistrationController } from '@umbraco-cms/backoffice/router';
910
import type { UmbDocumentItemModel } from '@umbraco-cms/backoffice/document';
1011
import type { UmbTreeStartNode } from '@umbraco-cms/backoffice/tree';
11-
import { UmbFormControlMixin } from '@umbraco-cms/backoffice/validation';
1212

13-
@customElement('umb-input-document')
13+
const elementName = 'umb-input-document';
14+
15+
@customElement(elementName)
1416
export class UmbInputDocumentElement extends UmbFormControlMixin<string | undefined, typeof UmbLitElement>(
1517
UmbLitElement,
1618
) {
@@ -243,8 +245,10 @@ export class UmbInputDocumentElement extends UmbFormControlMixin<string | undefi
243245
];
244246
}
245247

248+
export { UmbInputDocumentElement as element };
249+
246250
declare global {
247251
interface HTMLElementTagNameMap {
248-
'umb-input-document': UmbInputDocumentElement;
252+
[elementName]: UmbInputDocumentElement;
249253
}
250254
}

src/packages/members/member/components/input-member/input-member.element.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ import { UmbModalRouteRegistrationController } from '@umbraco-cms/backoffice/rou
99
import { UmbSorterController } from '@umbraco-cms/backoffice/sorter';
1010
import { UmbFormControlMixin } from '@umbraco-cms/backoffice/validation';
1111

12-
@customElement('umb-input-member')
12+
const elementName = 'umb-input-member';
13+
14+
@customElement(elementName)
1315
export class UmbInputMemberElement extends UmbFormControlMixin<string | undefined, typeof UmbLitElement>(
1416
UmbLitElement,
1517
) {
@@ -220,10 +222,10 @@ export class UmbInputMemberElement extends UmbFormControlMixin<string | undefine
220222
];
221223
}
222224

223-
export default UmbInputMemberElement;
225+
export { UmbInputMemberElement as element };
224226

225227
declare global {
226228
interface HTMLElementTagNameMap {
227-
'umb-input-member': UmbInputMemberElement;
229+
[elementName]: UmbInputMemberElement;
228230
}
229231
}

src/packages/members/member/property-editor/member-picker/property-editor-ui-member-picker.element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class UmbPropertyEditorUIMemberPickerElement extends UmbLitElement implem
2222
}
2323

2424
override render() {
25-
return html` <umb-input-member min="0" max="1" .value=${this.value} @change=${this.#onChange}></umb-input-member> `;
25+
return html`<umb-input-member min="0" max="1" .value=${this.value} @change=${this.#onChange}></umb-input-member>`;
2626
}
2727
}
2828

src/packages/property-editors/content-picker/components/input-content/input-content.element.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { splitStringToArray } from '@umbraco-cms/backoffice/utils';
1111
import { UmbFormControlMixin } from '@umbraco-cms/backoffice/validation';
1212

1313
const elementName = 'umb-input-content';
14+
1415
@customElement(elementName)
1516
export class UmbInputContentElement extends UmbFormControlMixin<string | undefined, typeof UmbLitElement>(
1617
UmbLitElement,
@@ -156,7 +157,7 @@ export class UmbInputContentElement extends UmbFormControlMixin<string | undefin
156157
];
157158
}
158159

159-
export default UmbInputContentElement;
160+
export { UmbInputContentElement as element };
160161

161162
declare global {
162163
interface HTMLElementTagNameMap {

src/packages/property-editors/content-picker/property-editor-ui-content-picker.element.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,23 @@ import type { UmbContentPickerSource, UmbContentPickerSourceType } from './types
44
import { html, customElement, property, state } from '@umbraco-cms/backoffice/external/lit';
55
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
66
import { UmbPropertyValueChangeEvent } from '@umbraco-cms/backoffice/property-editor';
7-
import { UMB_ENTITY_WORKSPACE_CONTEXT } from '@umbraco-cms/backoffice/workspace';
8-
import type { UmbPropertyEditorConfigCollection } from '@umbraco-cms/backoffice/property-editor';
9-
import type { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/extension-registry';
107
import { UMB_DOCUMENT_ENTITY_TYPE } from '@umbraco-cms/backoffice/document';
8+
import { UMB_ENTITY_WORKSPACE_CONTEXT } from '@umbraco-cms/backoffice/workspace';
119
import { UMB_MEDIA_ENTITY_TYPE } from '@umbraco-cms/backoffice/media';
1210
import { UMB_MEMBER_ENTITY_TYPE } from '@umbraco-cms/backoffice/member';
11+
import type { UmbPropertyEditorConfigCollection } from '@umbraco-cms/backoffice/property-editor';
12+
import type { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/extension-registry';
1313
import type { UmbTreeStartNode } from '@umbraco-cms/backoffice/tree';
1414

1515
// import of local component
1616
import './components/input-content/index.js';
1717

18+
const elementName = 'umb-property-editor-ui-content-picker';
19+
1820
/**
1921
* @element umb-property-editor-ui-content-picker
2022
*/
21-
@customElement('umb-property-editor-ui-content-picker')
23+
@customElement(elementName)
2224
export class UmbPropertyEditorUIContentPickerElement extends UmbLitElement implements UmbPropertyEditorUiElement {
2325
@property({ type: Array })
2426
value: UmbInputContentElement['items'] = [];
@@ -118,10 +120,10 @@ export class UmbPropertyEditorUIContentPickerElement extends UmbLitElement imple
118120
}
119121
}
120122

121-
export default UmbPropertyEditorUIContentPickerElement;
123+
export { UmbPropertyEditorUIContentPickerElement as element };
122124

123125
declare global {
124126
interface HTMLElementTagNameMap {
125-
'umb-property-editor-ui-content-picker': UmbPropertyEditorUIContentPickerElement;
127+
[elementName]: UmbPropertyEditorUIContentPickerElement;
126128
}
127129
}

0 commit comments

Comments
 (0)