Skip to content

Commit

Permalink
tweak actions config UI to not render empty keyboard form grid and ma…
Browse files Browse the repository at this point in the history
…ke key/source field full width
  • Loading branch information
Nerwyn committed Oct 15, 2024
1 parent 664d052 commit acc74fa
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 100 deletions.
2 changes: 1 addition & 1 deletion dist/universal-remote-card.min.js

Large diffs are not rendered by default.

199 changes: 100 additions & 99 deletions src/universal-remote-card-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1202,103 +1202,103 @@ export class UniversalRemoteCardEditor extends LitElement {
: ''}
${action == 'key'
? html`<div class="actions-form">
${['Kodi', 'LG webOS'].includes(platform)
? this.buildSelector(
'Media Player ID',
`${actionType}.media_player_id`,
{
entity: {
filter: {
domain: 'media_player',
${['Kodi', 'LG webOS'].includes(platform)
? this.buildSelector(
'Media Player ID',
`${actionType}.media_player_id`,
{
entity: {
filter: {
domain: 'media_player',
},
},
},
},
autofill
? this.config.media_player_id
: undefined,
)
: this.buildSelector(
'Remote ID',
`${actionType}.remote_id`,
{
entity: {
filter: {
domain: 'remote',
autofill
? this.config.media_player_id
: undefined,
)
: this.buildSelector(
'Remote ID',
`${actionType}.remote_id`,
{
entity: {
filter: {
domain: 'remote',
},
},
},
autofill
? this.config.remote_id
: undefined,
)}
${this.buildSelector(
'Platform',
`${actionType}.platform`,
{
select: {
mode: 'dropdown',
options: Platforms,
reorder: false,
},
autofill
? this.config.remote_id
: undefined,
)}
${this.buildSelector(
'Platform',
`${actionType}.platform`,
{
select: {
mode: 'dropdown',
options: Platforms,
reorder: false,
},
},
autofill
? this.config.platform ?? 'Android TV'
: 'Android TV',
)}
autofill
? this.config.platform ?? 'Android TV'
: 'Android TV',
)}
</div>
${this.buildSelector('Key', `${actionType}.key`, {
text: {},
})}
</div>`
})}`
: ''}
${action == 'source'
? html`<div class="actions-form">
${['Android TV'].includes(platform)
? this.buildSelector(
'Remote ID',
`${actionType}.remote_id`,
{
entity: {
filter: {
domain: 'remote',
${['Android TV'].includes(platform)
? this.buildSelector(
'Remote ID',
`${actionType}.remote_id`,
{
entity: {
filter: {
domain: 'remote',
},
},
},
},
autofill
? this.config.remote_id
: undefined,
)
: this.buildSelector(
'Media Player ID',
`${actionType}.media_player_id`,
{
entity: {
filter: {
domain: 'media_player',
autofill
? this.config.remote_id
: undefined,
)
: this.buildSelector(
'Media Player ID',
`${actionType}.media_player_id`,
{
entity: {
filter: {
domain: 'media_player',
},
},
},
autofill
? this.config.media_player_id
: undefined,
)}
${this.buildSelector(
'Platform',
`${actionType}.platform`,
{
select: {
mode: 'dropdown',
options: Platforms,
reorder: false,
},
autofill
? this.config.media_player_id
: undefined,
)}
${this.buildSelector(
'Platform',
`${actionType}.platform`,
{
select: {
mode: 'dropdown',
options: Platforms,
reorder: false,
},
},
autofill
? this.config.platform ?? 'Android TV'
: 'Android TV',
)}
autofill
? this.config.platform ?? 'Android TV'
: 'Android TV',
)}
</div>
${this.buildSelector('Source', `${actionType}.source`, {
text: {},
})}
</div>`
})}`
: ''}
${['keyboard', 'textbox', 'search'].includes(action)
? html`<div class="actions-form">
Expand Down Expand Up @@ -1334,9 +1334,9 @@ export class UniversalRemoteCardEditor extends LitElement {
: 'Android TV',
)}
</div>
<div class="actions-form">
${['Android TV', 'Roku'].includes(platform)
? this.buildSelector(
${['Android TV', 'Roku'].includes(platform)
? html`<div class="actions-form">
${this.buildSelector(
'Remote ID',
`${actionType}.remote_id`,
{
Expand All @@ -1349,25 +1349,26 @@ export class UniversalRemoteCardEditor extends LitElement {
autofill
? this.config.remote_id
: undefined,
)
: ''}
${'Roku' == platform
? this.buildSelector(
'Media Player ID',
`${actionType}.media_player_id`,
{
entity: {
filter: {
domain: 'media_player',
)}
${'Roku' == platform
? this.buildSelector(
'Media Player ID',
`${actionType}.media_player_id`,
{
entity: {
filter: {
domain: 'media_player',
},
},
},
},
},
autofill
? this.config.media_player_id
: undefined,
)
: ''}
</div>
autofill
? this.config
.media_player_id
: undefined,
)
: ''}
</div>`
: ''}
${this.buildSelector(
'Prompt',
`${actionType}.keyboard_prompt`,
Expand Down

0 comments on commit acc74fa

Please sign in to comment.