- ${this.value
- ? repeat(
- this.value,
- (layout, index) => '' + layout.name + layout.icon,
- (layout, index) =>
- html`
- ${layout.isSystem
- ? this.renderSystemFieldRow(layout, index)
- : this.renderCustomFieldRow(layout, index)}
-
`,
- )
- : ''}
+ if (!this.value) return nothing;
+ return html`
+
+ ${repeat(
+ this.value,
+ (layout, index) => '' + index + layout.name + layout.icon,
+ (layout, index) => this.#renderLayout(layout, index),
+ )}
-
`;
+
+ `;
}
- #iconReader(iconString: string): { icon: string; color?: string } {
- if (!iconString) return { icon: '' };
+ #renderLayout(layout: UmbCollectionLayoutConfig, index: number) {
+ const icon = this.#parseIcon(layout.icon);
+ const varName = icon.color ? extractUmbColorVariable(icon.color) : undefined;
- const parts = iconString.split(' ');
+ return html`
+
+
- if (parts.length === 2) {
- const [icon, color] = parts;
- const varName = extractUmbColorVariable(color.replace('color-', ''));
- return { icon, color: varName };
- } else {
- const [icon] = parts;
- return { icon };
- }
- }
+
this.#onIconChange(icon, index)}>
+ ${when(
+ icon.color,
+ () => html``,
+ () => html``,
+ )}
+
- renderSystemFieldRow(layout: LayoutConfig, index: number) {
- const icon = this.#iconReader(layout.icon ?? '');
+
this.#onChangeLabel(e, index)}>
- return html`
-
-
- ${index}
-
${ifDefined(layout.name)} (system field)
-
this.#onChangeSelected(e, index)}>
- `;
- }
+
+ ${layout.collectionView}
+
- renderCustomFieldRow(layout: LayoutConfig, index: number) {
- const icon = this.#iconReader(layout.icon ?? '');
-
- return html`
this.#onIconChange(index)}>
- ${icon.color
- ? html``
- : html``}
-
- ${index}
-
this.#onChangeName(e, index)}>
-
this.#onChangePath(e, index)}>
-
this.#onRemove(index)}>`;
+
+ this.#onRemove(index)}>
+
+
+ `;
}
static styles = [
@@ -163,7 +153,7 @@ export class UmbPropertyEditorUICollectionViewLayoutConfigurationElement
display: flex;
flex-direction: column;
gap: 1px;
- margin-bottom: var(--uui-size-3);
+ margin-bottom: var(--uui-size-1);
}
.layout-item {
@@ -174,12 +164,23 @@ export class UmbPropertyEditorUICollectionViewLayoutConfigurationElement
padding: var(--uui-size-3) var(--uui-size-6);
}
- .layout-item > :last-child {
- margin-left: auto;
+ .layout-item > uui-icon {
+ flex: 0 0 var(--uui-size-6);
}
- #add {
- width: 100%;
+ .layout-item > uui-button {
+ flex: 0 0 var(--uui-size-10);
+ }
+
+ .layout-item > uui-input,
+ .layout-item > .alias {
+ flex: 1;
+ }
+
+ .layout-item > .actions {
+ flex: 0 0 auto;
+ display: flex;
+ justify-content: flex-end;
}
`,
];
diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/views/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/views/manifests.ts
index bcdccca167..f65daedc51 100644
--- a/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/views/manifests.ts
+++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/views/manifests.ts
@@ -7,7 +7,7 @@ const tableCollectionView: ManifestCollectionView = {
type: 'collectionView',
alias: UMB_COLLECTION_VIEW_USER_TABLE,
name: 'User Table Collection View',
- js: () => import('./table/user-table-collection-view.element.js'),
+ element: () => import('./table/user-table-collection-view.element.js'),
meta: {
label: 'Table',
icon: 'icon-list',
@@ -26,8 +26,8 @@ export const UMB_COLLECTION_VIEW_USER_GRID = 'Umb.CollectionView.User.Grid';
const gridCollectionView: ManifestCollectionView = {
type: 'collectionView',
alias: UMB_COLLECTION_VIEW_USER_GRID,
- name: 'User Table Collection View',
- js: () => import('./grid/user-grid-collection-view.element.js'),
+ name: 'User Grid Collection View',
+ element: () => import('./grid/user-grid-collection-view.element.js'),
weight: 200,
meta: {
label: 'Grid',