gadgetchnnel / lovelace-text-input-row

A custom Lovelace text input row for use in entities cards
38 stars 11 forks source link

Polymerwill be deprecated in 2023.5 #5

Open Mariusthvdb opened 1 year ago

Mariusthvdb commented 1 year ago

would it be possible to update the card to use Lit?

tiny as your card may be, its a very useful and still unique card....

hope you can make it. thanks

rodpayne commented 1 year ago

2023-04-11 14:46:28.897 WARNING (MainThread) [frontend.js.latest.202304061] WARNING: Polymer will be removed from window in Home Assistant 2023.5. More info: https://developers.home-assistant.io/blog/2023/04/04/deprecating_polymer

In Home Assistant 2023.5 Polymer will no longer be provided by Home Assistant. If you use Polymer now, we recommend you switch to Lit. If you want to keep using Polymer, you will have to load Polymer yourself.

camochu commented 1 year ago

I am also affected. One more request here to solve it

gadgetchnnel commented 1 year ago

I have pushed a new version, 0.0.9, which uses Lit instead of Polymer, can you please try updating and see if that works.

Mariusthvdb commented 1 year ago

Hi!

Thx. Would this also modernize to type: module ?

Just today I experimented and made that in my Gists See https://gist.github.com/Mariusthvdb/11bbf8403da01f05ec4913cde76604fc

Still needs some styling to move to mdc I think

Mariusthvdb commented 1 year ago

I have pushed a new version, 0.0.9, which uses Lit instead of Polymer, can you please try updating and see if that works.

tested the new resource but it does not update the value(state) of the input_text after that was updated by any other card:

all empty:

Scherm­afbeelding 2023-05-01 om 10 01 14

then add a message and click enter:

Scherm­afbeelding 2023-05-01 om 10 03 33

change text in any of the other elements:

Scherm­afbeelding 2023-05-01 om 10 04 56

another try:

Scherm­afbeelding 2023-05-01 om 10 05 05

you are looking at:

      - input_select.intercom_message # showing the value as a template option in the select options
      - type: custom:text-input-full-row # my temporary rebuild of your work
        entity: input_text.message
        name: Type een bericht hier en klik enter
      - type: custom:text-input-row # this resource, your card
        entity: input_text.message
        name: Text input row
      - entity: input_text.message # core card, with some card_mods
        name: Bericht
        <<: &no_icon
          card_mod:
            style:
              hui-generic-entity-row $: |
                state-badge {
                  display: none;
                }
              .: |
                hui-generic-entity-row {
                  margin: 0px -8px;
                  /*padding: 8px;*/
                }

btw, in both our custom resources, the input_text field does Not light on hover, and as you can see the font is larger and the divider is darker/heavier. This probably has to do with the styling of the element, and at some point should be optimized according to new HA defaults (using mdc-elements)

PulsarFX commented 1 year ago

short question: why would I use this instead of a text helper?

camochu commented 1 year ago

I think the correct question would be: why would I use this TO SHOW a text helper? My answer: it's a simple way to hide icon and get more room for content. Take a look to the code, without this component you need another mod and a lot of unintuitive lines to get the same

almighty059 commented 12 months ago

@Mariusthvdb did this card recently break again?

Mariusthvdb commented 12 months ago

Why? I don't use it anymore so not aware of any issues