- ${repeat(
- this.value,
- (item) => item.alias,
- (item) => html`
-
-
-
${item.label} (${item.alias})
-
(${item.width} x ${item.height}px)
-
- this.#onEdit(item)}>
- this.#onRemove(item.alias)}>
-
-
- `,
- )}
-
`;
}
+ #onLabelInput() {
+ const value = this._labelInput.value ?? '';
+ const aliasValue = generateAlias(value);
+ const alias = this.shadowRoot?.querySelector('#alias') as HTMLInputElement;
+ if (!alias) return;
+
+ const oldAliasValue = generateAlias(this.#oldInputValue);
+ if (alias.value === oldAliasValue || !alias.value) {
+ alias.value = aliasValue;
+ }
+
+ this.#oldInputValue = value;
+ }
+
+ override render() {
+ return html`
+