New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move from paper drop down to mwc-select in editors #133
Comments
@zsarnett I started to migrate the |
Frontend version: 20220214.0 - latest This is the latest Frontend Version that has moved to mwc-select MWC select will be used all throughout the UI. It's still not supported (meaning we could move from mwc-select) but that wont be anytime soon or ever. PAper-input will be dropped eventually but not for the next release |
@zsarnett Maybe we must use MWC select after |
Yea. Major release: 2022.2 - Paper MWC may work on previous version but not guaranteed |
@zsarnett do you think we can move to HA Form for the next HA March release ? 😊 |
@zsarnett Thank's for your dev blog article https://developers.home-assistant.io/blog/2022/02/18/paper-elements.
The TextfieldBase file import The registration is done by Home Assistant Front-end and by the custom cards and create an error 😟 Edit : I copied the mwc-textarea and mwc-textfield to remove the mwc-notched-outline import. |
A solution could be https://github.com/lit/lit/tree/main/packages/labs/scoped-registry-mixin It does require a polyfill: https://github.com/webcomponents/polyfills/tree/master/packages/scoped-custom-element-registry You could use it like this: import { LitElement, html } from "lit";
import { ScopedRegistryHost } from "@lit-labs/scoped-registry-mixin";
import { TextFieldBase } from "@material/mwc-textfield/mwc-textfield-base";
import { NotchedOutlineBase } from "@material/mwc-notched-outline/mwc-notched-outline-base";
import { styles as textfieldStyles } from "@material/mwc-textfield/mwc-textfield.css";
import { styles as notchedOutlineStyles } from "@material/mwc-notched-outline/mwc-notched-outline.css";
class CustomCard extends ScopedRegistryHost(LitElement) {
static get elementDefinitions() {
return {
"mwc-textfield": class extends TextFieldBase {
static get styles() {
return textfieldStyles;
}
},
"mwc-notched-outline": class extends NotchedOutlineBase {
static get styles() {
return notchedOutlineStyles;
}
},
};
}
render() {
return html`<mwc-textfield></mwc-textfield>`
}
} Then in your rollup config, you should make sure the file You could do that like this: rollup-ignore-plugin.js export default function (userOptions = {}) {
// Files need to be absolute paths.
// This only works if the file has no exports
// and only is imported for its side effects
const files = userOptions.files || [];
if (files.length === 0) {
return {
name: "ignore",
};
}
return {
name: "ignore",
load(id) {
return files.some((toIgnorePath) => id.startsWith(toIgnorePath))
? {
code: "",
}
: null;
},
};
} rollup.config.js import ignore from "./rollup-ignore-plugin.js";
export default {
...
plugins: [
ignore({
files: [
require.resolve("@material/mwc-notched-outline/mwc-notched-outline.js"),
],
}),
],
...
} |
You could already use the ignore plugin with your current approach, so you don't have to copy |
Thanks @bramkragten. |
Will the The home assistant front-end is moving a lot these last days and hours 😅 It is hard to follow and know which components will be available in the next release. I'm trying to have a functional mushroom version before and after For now, I tested from |
Yes, we plan to create a |
I would recommend moving away from Paper Drop down menus. I know this was not changed in this PR but something to think about.
HA frontend is moving out all paper Drop downs and that means the component will no longer be loaded. We have moved to
mwc-select
Originally posted by @zsarnett in #131 (comment)
The text was updated successfully, but these errors were encountered: