Sort imports (#8104)
This commit is contained in:
parent
131a7f3782
commit
a1d07e5a00
|
@ -26,6 +26,9 @@
|
|||
"[typescript]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[javascript]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"files.trimTrailingWhitespace": true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import {
|
||||
customElement,
|
||||
html,
|
||||
property,
|
||||
internalProperty,
|
||||
property,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { mockHistory } from "../../../../demo/src/stubs/history";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import "web-animations-js/web-animations-next-lite.min";
|
||||
import "../../../src/resources/roboto";
|
||||
import "../../../src/resources/ha-style";
|
||||
import "../../../src/resources/roboto";
|
||||
import "./layout/hc-lovelace";
|
||||
|
|
|
@ -3,8 +3,8 @@ import {
|
|||
CSSResult,
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
internalProperty,
|
||||
LitElement,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { CastManager } from "../../../src/cast/cast_manager";
|
||||
|
|
|
@ -3,9 +3,9 @@ import {
|
|||
css,
|
||||
CSSResult,
|
||||
html,
|
||||
internalProperty,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { until } from "lit-html/directives/until";
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import "../../src/resources/safari-14-attachshadow-patch";
|
||||
import "@polymer/polymer/lib/elements/dom-if";
|
||||
import "@polymer/polymer/lib/elements/dom-repeat";
|
||||
import "../../src/resources/ha-style";
|
||||
import "../../src/resources/roboto";
|
||||
import "../../src/resources/safari-14-attachshadow-patch";
|
||||
import "./ha-demo";
|
||||
|
||||
/* polyfill for paper-dropdown */
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// Compat needs to be first import
|
||||
import "../../src/resources/compatibility";
|
||||
import { isNavigationClick } from "../../src/common/dom/is-navigation-click";
|
||||
import { navigate } from "../../src/common/navigate";
|
||||
|
|
|
@ -2,10 +2,10 @@ import "@polymer/app-layout/app-toolbar/app-toolbar";
|
|||
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
||||
/* eslint-plugin-disable lit */
|
||||
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
||||
import "../../../src/components/ha-switch";
|
||||
import "../../../src/components/ha-formfield";
|
||||
import "./demo-card";
|
||||
import { applyThemesOnElement } from "../../../src/common/dom/apply_themes_on_element";
|
||||
import "../../../src/components/ha-formfield";
|
||||
import "../../../src/components/ha-switch";
|
||||
import "./demo-card";
|
||||
|
||||
class DemoCards extends PolymerElement {
|
||||
static get template() {
|
||||
|
|
|
@ -2,8 +2,8 @@ import { html } from "@polymer/polymer/lib/utils/html-tag";
|
|||
/* eslint-plugin-disable lit */
|
||||
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
||||
import "../../../src/components/ha-card";
|
||||
import "../../../src/state-summary/state-card-content";
|
||||
import "../../../src/dialogs/more-info/more-info-content";
|
||||
import "../../../src/state-summary/state-card-content";
|
||||
|
||||
class DemoMoreInfo extends PolymerElement {
|
||||
static get template() {
|
||||
|
|
|
@ -2,10 +2,10 @@ import "@polymer/app-layout/app-toolbar/app-toolbar";
|
|||
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
||||
/* eslint-plugin-disable lit */
|
||||
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
||||
import "../../../src/components/ha-switch";
|
||||
import "../../../src/components/ha-formfield";
|
||||
import "./demo-more-info";
|
||||
import { applyThemesOnElement } from "../../../src/common/dom/apply_themes_on_element";
|
||||
import "../../../src/components/ha-formfield";
|
||||
import "../../../src/components/ha-switch";
|
||||
import "./demo-more-info";
|
||||
|
||||
class DemoMoreInfos extends PolymerElement {
|
||||
static get template() {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
customElement,
|
||||
PropertyValues,
|
||||
query,
|
||||
TemplateResult,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
customElement,
|
||||
PropertyValues,
|
||||
query,
|
||||
TemplateResult,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
customElement,
|
||||
PropertyValues,
|
||||
query,
|
||||
TemplateResult,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
customElement,
|
||||
PropertyValues,
|
||||
query,
|
||||
TemplateResult,
|
||||
|
@ -53,7 +53,7 @@ const CONFIGS = [
|
|||
config: `
|
||||
- type: button
|
||||
entity: light.bed_light
|
||||
tap_action:
|
||||
tap_action:
|
||||
action: toggle
|
||||
`,
|
||||
},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
customElement,
|
||||
PropertyValues,
|
||||
query,
|
||||
TemplateResult,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
customElement,
|
||||
PropertyValues,
|
||||
query,
|
||||
TemplateResult,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
customElement,
|
||||
PropertyValues,
|
||||
query,
|
||||
TemplateResult,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { html, LitElement, customElement, TemplateResult } from "lit-element";
|
||||
import { customElement, html, LitElement, TemplateResult } from "lit-element";
|
||||
import "../components/demo-cards";
|
||||
|
||||
const CONFIGS = [
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
customElement,
|
||||
PropertyValues,
|
||||
query,
|
||||
TemplateResult,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
customElement,
|
||||
PropertyValues,
|
||||
query,
|
||||
TemplateResult,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
customElement,
|
||||
PropertyValues,
|
||||
query,
|
||||
TemplateResult,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
customElement,
|
||||
PropertyValues,
|
||||
query,
|
||||
TemplateResult,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
customElement,
|
||||
PropertyValues,
|
||||
query,
|
||||
TemplateResult,
|
||||
|
@ -31,9 +31,9 @@ const CONFIGS = [
|
|||
- entity: media_player.android_cast
|
||||
name: Screen casting
|
||||
- entity: media_player.image_display
|
||||
name: Digital Picture Frame
|
||||
name: Digital Picture Frame
|
||||
- entity: media_player.sonos_idle
|
||||
name: Sonos Idle
|
||||
name: Sonos Idle
|
||||
- entity: media_player.idle_browse_media
|
||||
name: Idle waiting for Browse Media
|
||||
- entity: media_player.theater_off
|
||||
|
@ -43,7 +43,7 @@ const CONFIGS = [
|
|||
- entity: media_player.theater_off_static
|
||||
name: Player Off (cannot be switched on)
|
||||
- entity: media_player.theater_on_static
|
||||
name: Player On (cannot be switched off)
|
||||
name: Player On (cannot be switched off)
|
||||
- entity: media_player.idle
|
||||
name: Player Idle
|
||||
- entity: media_player.playing
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
customElement,
|
||||
PropertyValues,
|
||||
query,
|
||||
TemplateResult,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
customElement,
|
||||
PropertyValues,
|
||||
query,
|
||||
TemplateResult,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
customElement,
|
||||
PropertyValues,
|
||||
query,
|
||||
TemplateResult,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
customElement,
|
||||
PropertyValues,
|
||||
query,
|
||||
TemplateResult,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
customElement,
|
||||
PropertyValues,
|
||||
query,
|
||||
TemplateResult,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
customElement,
|
||||
PropertyValues,
|
||||
query,
|
||||
TemplateResult,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
customElement,
|
||||
PropertyValues,
|
||||
query,
|
||||
TemplateResult,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
customElement,
|
||||
property,
|
||||
PropertyValues,
|
||||
query,
|
||||
|
@ -10,20 +10,20 @@ import {
|
|||
import "../../../src/components/ha-card";
|
||||
import {
|
||||
SUPPORT_BRIGHTNESS,
|
||||
SUPPORT_COLOR,
|
||||
SUPPORT_COLOR_TEMP,
|
||||
SUPPORT_EFFECT,
|
||||
SUPPORT_FLASH,
|
||||
SUPPORT_COLOR,
|
||||
SUPPORT_TRANSITION,
|
||||
SUPPORT_WHITE_VALUE,
|
||||
} from "../../../src/data/light";
|
||||
import "../../../src/dialogs/more-info/more-info-content";
|
||||
import { getEntity } from "../../../src/fake_data/entity";
|
||||
import {
|
||||
provideHass,
|
||||
MockHomeAssistant,
|
||||
provideHass,
|
||||
} from "../../../src/fake_data/provide_hass";
|
||||
import "../components/demo-more-infos";
|
||||
import "../../../src/dialogs/more-info/more-info-content";
|
||||
|
||||
const ENTITIES = [
|
||||
getEntity("light", "bed_light", "on", {
|
||||
|
|
|
@ -7,13 +7,14 @@ import {
|
|||
CSSResult,
|
||||
customElement,
|
||||
html,
|
||||
internalProperty,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import "web-animations-js/web-animations-next-lite.min";
|
||||
import "../../../../src/components/buttons/ha-progress-button";
|
||||
import "../../../../src/components/ha-card";
|
||||
import {
|
||||
HassioAddonDetails,
|
||||
|
@ -28,7 +29,6 @@ import { haStyle } from "../../../../src/resources/styles";
|
|||
import { HomeAssistant } from "../../../../src/types";
|
||||
import { suggestAddonRestart } from "../../dialogs/suggestAddonRestart";
|
||||
import { hassioStyle } from "../../resources/hassio-style";
|
||||
import "../../../../src/components/buttons/ha-progress-button";
|
||||
|
||||
@customElement("hassio-addon-audio")
|
||||
class HassioAddonAudio extends LitElement {
|
||||
|
|
|
@ -7,11 +7,11 @@ import {
|
|||
property,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import "../../../../src/components/ha-circular-progress";
|
||||
import { HassioAddonDetails } from "../../../../src/data/hassio/addon";
|
||||
import { haStyle } from "../../../../src/resources/styles";
|
||||
import { HomeAssistant } from "../../../../src/types";
|
||||
import { hassioStyle } from "../../resources/hassio-style";
|
||||
import "../../../../src/components/ha-circular-progress";
|
||||
import "./hassio-addon-audio";
|
||||
import "./hassio-addon-config";
|
||||
import "./hassio-addon-network";
|
||||
|
|
|
@ -14,12 +14,12 @@ import {
|
|||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import memoizeOne from "memoize-one";
|
||||
import "../../../src/components/ha-circular-progress";
|
||||
import {
|
||||
fetchHassioAddonInfo,
|
||||
HassioAddonDetails,
|
||||
} from "../../../src/data/hassio/addon";
|
||||
import "../../../src/layouts/hass-tabs-subpage";
|
||||
import "../../../src/components/ha-circular-progress";
|
||||
import type { PageNavigation } from "../../../src/layouts/hass-tabs-subpage";
|
||||
import { haStyle } from "../../../src/resources/styles";
|
||||
import { HomeAssistant, Route } from "../../../src/types";
|
||||
|
|
|
@ -7,8 +7,8 @@ import {
|
|||
property,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { HassioAddonDetails } from "../../../../src/data/hassio/addon";
|
||||
import "../../../../src/components/ha-circular-progress";
|
||||
import { HassioAddonDetails } from "../../../../src/data/hassio/addon";
|
||||
import { haStyle } from "../../../../src/resources/styles";
|
||||
import { HomeAssistant } from "../../../../src/types";
|
||||
import { hassioStyle } from "../../resources/hassio-style";
|
||||
|
|
|
@ -7,8 +7,8 @@ import {
|
|||
property,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { HassioAddonDetails } from "../../../../src/data/hassio/addon";
|
||||
import "../../../../src/components/ha-circular-progress";
|
||||
import { HassioAddonDetails } from "../../../../src/data/hassio/addon";
|
||||
import { haStyle } from "../../../../src/resources/styles";
|
||||
import { HomeAssistant } from "../../../../src/types";
|
||||
import { hassioStyle } from "../../resources/hassio-style";
|
||||
|
|
|
@ -3,9 +3,9 @@ import {
|
|||
CSSResult,
|
||||
customElement,
|
||||
html,
|
||||
internalProperty,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { createCloseHeading } from "../../../../src/components/ha-dialog";
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// Compat needs to be first import
|
||||
import "../../src/resources/compatibility";
|
||||
import "../../src/resources/safari-14-attachshadow-patch";
|
||||
import "../../src/resources/roboto";
|
||||
import "../../src/resources/safari-14-attachshadow-patch";
|
||||
import "./hassio-main";
|
||||
|
||||
const styleEl = document.createElement("style");
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { html, PropertyValues, customElement, property } from "lit-element";
|
||||
import "./hassio-router";
|
||||
import { HomeAssistant, Route } from "../../src/types";
|
||||
import { HassioPanelInfo } from "../../src/data/hassio/supervisor";
|
||||
import { customElement, html, property, PropertyValues } from "lit-element";
|
||||
import { atLeastVersion } from "../../src/common/config/version";
|
||||
import { applyThemesOnElement } from "../../src/common/dom/apply_themes_on_element";
|
||||
import { fireEvent } from "../../src/common/dom/fire_event";
|
||||
import { HassioPanelInfo } from "../../src/data/hassio/supervisor";
|
||||
import { makeDialogManager } from "../../src/dialogs/make-dialog-manager";
|
||||
import { atLeastVersion } from "../../src/common/config/version";
|
||||
import { HomeAssistant, Route } from "../../src/types";
|
||||
import "./hassio-router";
|
||||
import { SupervisorBaseElement } from "./supervisor-base-element";
|
||||
|
||||
@customElement("hassio-main")
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
import { mdiMenu } from "@mdi/js";
|
||||
import {
|
||||
css,
|
||||
CSSResult,
|
||||
customElement,
|
||||
html,
|
||||
internalProperty,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { fireEvent } from "../../../src/common/dom/fire_event";
|
||||
import { navigate } from "../../../src/common/navigate";
|
||||
import {
|
||||
fetchHassioAddonInfo,
|
||||
HassioAddonDetails,
|
||||
|
@ -17,13 +20,10 @@ import {
|
|||
createHassioSession,
|
||||
validateHassioSession,
|
||||
} from "../../../src/data/hassio/ingress";
|
||||
import { showAlertDialog } from "../../../src/dialogs/generic/show-dialog-box";
|
||||
import "../../../src/layouts/hass-loading-screen";
|
||||
import "../../../src/layouts/hass-subpage";
|
||||
import { HomeAssistant, Route } from "../../../src/types";
|
||||
import { showAlertDialog } from "../../../src/dialogs/generic/show-dialog-box";
|
||||
import { navigate } from "../../../src/common/navigate";
|
||||
import { mdiMenu } from "@mdi/js";
|
||||
import { fireEvent } from "../../../src/common/dom/fire_event";
|
||||
|
||||
@customElement("hassio-ingress-view")
|
||||
class HassioIngressView extends LitElement {
|
||||
|
|
|
@ -3,9 +3,9 @@ import {
|
|||
css,
|
||||
CSSResult,
|
||||
html,
|
||||
internalProperty,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
|
|
|
@ -2,15 +2,17 @@ import {
|
|||
css,
|
||||
CSSResult,
|
||||
html,
|
||||
internalProperty,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
} from "lit-element";
|
||||
import punycode from "punycode";
|
||||
import { extractSearchParamsObject } from "../common/url/search-params";
|
||||
import {
|
||||
AuthProvider,
|
||||
fetchAuthProviders,
|
||||
AuthUrlSearchParams,
|
||||
fetchAuthProviders,
|
||||
} from "../data/auth";
|
||||
import {
|
||||
DiscoveryInformation,
|
||||
|
@ -19,8 +21,6 @@ import {
|
|||
import { litLocalizeLiteMixin } from "../mixins/lit-localize-lite-mixin";
|
||||
import { registerServiceWorker } from "../util/register-service-worker";
|
||||
import "./ha-auth-flow";
|
||||
import { extractSearchParamsObject } from "../common/url/search-params";
|
||||
import punycode from "punycode";
|
||||
|
||||
import("./ha-pick-auth-provider");
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { isComponentLoaded } from "./is_component_loaded";
|
||||
import { PageNavigation } from "../../layouts/hass-tabs-subpage";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import { isComponentLoaded } from "./is_component_loaded";
|
||||
|
||||
export const canShowPage = (hass: HomeAssistant, page: PageNavigation) => {
|
||||
return (
|
||||
|
|
|
@ -3,9 +3,9 @@ import { UNAVAILABLE, UNKNOWN } from "../../data/entity";
|
|||
import { formatDate } from "../datetime/format_date";
|
||||
import { formatDateTime } from "../datetime/format_date_time";
|
||||
import { formatTime } from "../datetime/format_time";
|
||||
import { formatNumber } from "../string/format_number";
|
||||
import { LocalizeFunc } from "../translations/localize";
|
||||
import { computeStateDomain } from "./compute_state_domain";
|
||||
import { formatNumber } from "../string/format_number";
|
||||
|
||||
export const computeStateDisplay = (
|
||||
localize: LocalizeFunc,
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { HassEntity } from "home-assistant-js-websocket";
|
||||
import { UNAVAILABLE } from "../../data/entity";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import { DOMAINS_WITH_CARD } from "../const";
|
||||
import { canToggleState } from "./can_toggle_state";
|
||||
import { computeStateDomain } from "./compute_state_domain";
|
||||
import { UNAVAILABLE } from "../../data/entity";
|
||||
|
||||
export const stateCardType = (hass: HomeAssistant, stateObj: HassEntity) => {
|
||||
if (stateObj.state === UNAVAILABLE) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import Vibrant from "node-vibrant/lib/browser";
|
||||
import MMCQ from "@vibrant/quantizer-mmcq";
|
||||
import { BasicPipeline } from "@vibrant/core/lib/pipeline";
|
||||
import { Swatch, Vec3 } from "@vibrant/color";
|
||||
import { BasicPipeline } from "@vibrant/core/lib/pipeline";
|
||||
import MMCQ from "@vibrant/quantizer-mmcq";
|
||||
import Vibrant from "node-vibrant/lib/browser";
|
||||
import { getRGBContrastRatio } from "../color/rgb";
|
||||
|
||||
const CONTRAST_RATIO = 4.5;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import "@material/mwc-icon-button/mwc-icon-button";
|
||||
import { mdiClose, mdiMagnify } from "@mdi/js";
|
||||
import "@polymer/paper-input/paper-input";
|
||||
import {
|
||||
css,
|
||||
|
@ -10,8 +12,6 @@ import { html, TemplateResult } from "lit-html";
|
|||
import { classMap } from "lit-html/directives/class-map";
|
||||
import "../../components/ha-svg-icon";
|
||||
import { fireEvent } from "../dom/fire_event";
|
||||
import { mdiMagnify, mdiClose } from "@mdi/js";
|
||||
import "@material/mwc-icon-button/mwc-icon-button";
|
||||
|
||||
@customElement("search-input")
|
||||
class SearchInput extends LitElement {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import IntlMessageFormat from "intl-messageformat";
|
||||
import { shouldPolyfill } from "@formatjs/intl-pluralrules/should-polyfill";
|
||||
import IntlMessageFormat from "intl-messageformat";
|
||||
import { Resources } from "../../types";
|
||||
|
||||
export type LocalizeFunc = (key: string, ...args: any[]) => string;
|
||||
|
|
|
@ -7,10 +7,9 @@ import {
|
|||
html,
|
||||
LitElement,
|
||||
property,
|
||||
TemplateResult,
|
||||
query,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
|
||||
import "../ha-circular-progress";
|
||||
|
||||
@customElement("ha-progress-button")
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { wrap } from "comlink";
|
||||
|
||||
import type { api } from "./sort_filter_worker";
|
||||
|
||||
type FilterDataType = api["filterData"];
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
// @ts-nocheck
|
||||
import Vue from "vue";
|
||||
import wrap from "@vue/web-component-wrapper";
|
||||
import { customElement } from "lit-element/lib/decorators";
|
||||
import Vue from "vue";
|
||||
import DateRangePicker from "vue2-daterange-picker";
|
||||
import dateRangePickerStyles from "vue2-daterange-picker/dist/vue2-daterange-picker.css";
|
||||
import { fireEvent } from "../common/dom/fire_event";
|
||||
import { Constructor } from "../types";
|
||||
import { customElement } from "lit-element/lib/decorators";
|
||||
|
||||
const Component = Vue.extend({
|
||||
props: {
|
||||
|
@ -210,7 +210,7 @@ class DateRangePickerElement extends WrappedElement {
|
|||
}
|
||||
.calendar-table {
|
||||
padding: 0 !important;
|
||||
}
|
||||
}
|
||||
`;
|
||||
const shadowRoot = this.shadowRoot!;
|
||||
shadowRoot.appendChild(style);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import "@material/mwc-icon-button/mwc-icon-button";
|
||||
import "@material/mwc-button/mwc-button";
|
||||
import "@material/mwc-icon-button/mwc-icon-button";
|
||||
import { mdiClose, mdiMenuDown, mdiMenuUp } from "@mdi/js";
|
||||
import "@polymer/paper-input/paper-input";
|
||||
import "@polymer/paper-item/paper-item";
|
||||
import "@polymer/paper-item/paper-item-body";
|
||||
|
@ -11,9 +12,9 @@ import {
|
|||
CSSResult,
|
||||
customElement,
|
||||
html,
|
||||
internalProperty,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
|
@ -37,9 +38,8 @@ import {
|
|||
import { SubscribeMixin } from "../../mixins/subscribe-mixin";
|
||||
import { PolymerChangedEvent } from "../../polymer-types";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import "./ha-devices-picker";
|
||||
import "../ha-svg-icon";
|
||||
import { mdiClose, mdiMenuDown, mdiMenuUp } from "@mdi/js";
|
||||
import "./ha-devices-picker";
|
||||
|
||||
interface DevicesByArea {
|
||||
[areaId: string]: AreaDevices;
|
||||
|
|
|
@ -6,9 +6,9 @@ import {
|
|||
css,
|
||||
CSSResult,
|
||||
html,
|
||||
internalProperty,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { fireEvent } from "../../common/dom/fire_event";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import "../ha-svg-icon";
|
||||
import "@material/mwc-icon-button/mwc-icon-button";
|
||||
import { mdiClose, mdiMenuDown, mdiMenuUp } from "@mdi/js";
|
||||
import "@polymer/paper-input/paper-input";
|
||||
import "@polymer/paper-item/paper-item";
|
||||
import "@polymer/paper-item/paper-item-body";
|
||||
|
@ -38,7 +38,7 @@ import {
|
|||
import { SubscribeMixin } from "../../mixins/subscribe-mixin";
|
||||
import { PolymerChangedEvent } from "../../polymer-types";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import { mdiClose, mdiMenuUp, mdiMenuDown } from "@mdi/js";
|
||||
import "../ha-svg-icon";
|
||||
|
||||
interface Device {
|
||||
name: string;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { customElement, html, LitElement, property } from "lit-element";
|
||||
import { batteryIcon } from "../../common/entity/battery_icon";
|
||||
import "../ha-icon";
|
||||
import { customElement, html, property, LitElement } from "lit-element";
|
||||
|
||||
@customElement("ha-battery-icon")
|
||||
export class HaBatteryIcon extends LitElement {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import "@material/mwc-icon-button/mwc-icon-button";
|
||||
import { mdiClose, mdiMenuDown, mdiMenuUp } from "@mdi/js";
|
||||
import "@polymer/paper-input/paper-input";
|
||||
import "@polymer/paper-item/paper-item";
|
||||
|
@ -17,10 +18,9 @@ import {
|
|||
import { fireEvent } from "../../common/dom/fire_event";
|
||||
import { PolymerChangedEvent } from "../../polymer-types";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import { formatAttributeName } from "../../util/hass-attributes-util";
|
||||
import "../ha-svg-icon";
|
||||
import "./state-badge";
|
||||
import { formatAttributeName } from "../../util/hass-attributes-util";
|
||||
import "@material/mwc-icon-button/mwc-icon-button";
|
||||
|
||||
export type HaEntityPickerEntityFilterFunc = (entityId: HassEntity) => boolean;
|
||||
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
import "../ha-icon-button";
|
||||
import { HassEntity } from "home-assistant-js-websocket";
|
||||
import {
|
||||
css,
|
||||
CSSResult,
|
||||
html,
|
||||
internalProperty,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { STATES_OFF } from "../../common/const";
|
||||
import { computeStateDomain } from "../../common/entity/compute_state_domain";
|
||||
import { computeStateName } from "../../common/entity/compute_state_name";
|
||||
import { UNAVAILABLE_STATES, UNAVAILABLE } from "../../data/entity";
|
||||
import { UNAVAILABLE, UNAVAILABLE_STATES } from "../../data/entity";
|
||||
import { forwardHaptic } from "../../data/haptics";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import "../ha-icon-button";
|
||||
import "../ha-switch";
|
||||
|
||||
const isOn = (stateObj?: HassEntity) =>
|
||||
|
|
|
@ -4,9 +4,9 @@ import {
|
|||
CSSResult,
|
||||
customElement,
|
||||
html,
|
||||
internalProperty,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
|
@ -18,10 +18,10 @@ import { computeStateName } from "../../common/entity/compute_state_name";
|
|||
import { domainIcon } from "../../common/entity/domain_icon";
|
||||
import { stateIcon } from "../../common/entity/state_icon";
|
||||
import { timerTimeRemaining } from "../../common/entity/timer_time_remaining";
|
||||
import { formatNumber } from "../../common/string/format_number";
|
||||
import { UNAVAILABLE, UNKNOWN } from "../../data/entity";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import "../ha-label-badge";
|
||||
import { UNAVAILABLE, UNKNOWN } from "../../data/entity";
|
||||
import { formatNumber } from "../../common/string/format_number";
|
||||
|
||||
@customElement("ha-state-label-badge")
|
||||
export class HaStateLabelBadge extends LitElement {
|
||||
|
|
|
@ -11,14 +11,11 @@ import {
|
|||
} from "lit-element";
|
||||
import { ifDefined } from "lit-html/directives/if-defined";
|
||||
import { styleMap } from "lit-html/directives/style-map";
|
||||
|
||||
import { computeActiveState } from "../../common/entity/compute_active_state";
|
||||
import { computeStateDomain } from "../../common/entity/compute_state_domain";
|
||||
import { stateIcon } from "../../common/entity/state_icon";
|
||||
import { iconColorCSS } from "../../common/style/icon_color_css";
|
||||
|
||||
import type { HomeAssistant } from "../../types";
|
||||
|
||||
import "../ha-icon";
|
||||
|
||||
export class StateBadge extends LitElement {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import "@polymer/paper-tooltip/paper-tooltip";
|
||||
import type { HassEntity } from "home-assistant-js-websocket";
|
||||
import {
|
||||
css,
|
||||
CSSResult,
|
||||
|
@ -8,12 +9,9 @@ import {
|
|||
property,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import type { HassEntity } from "home-assistant-js-websocket";
|
||||
|
||||
import { computeStateName } from "../../common/entity/compute_state_name";
|
||||
import { computeRTL } from "../../common/util/compute_rtl";
|
||||
import type { HomeAssistant } from "../../types";
|
||||
|
||||
import "../ha-relative-time";
|
||||
import "./state-badge";
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import "./ha-svg-icon";
|
||||
import "@material/mwc-icon-button/mwc-icon-button";
|
||||
import { mdiClose, mdiMenuDown, mdiMenuUp } from "@mdi/js";
|
||||
import "@polymer/paper-input/paper-input";
|
||||
import "@polymer/paper-item/paper-item";
|
||||
import "@polymer/paper-item/paper-item-body";
|
||||
|
@ -11,27 +11,21 @@ import {
|
|||
CSSResult,
|
||||
customElement,
|
||||
html,
|
||||
internalProperty,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
PropertyValues,
|
||||
query,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import memoizeOne from "memoize-one";
|
||||
import { fireEvent } from "../common/dom/fire_event";
|
||||
import { computeDomain } from "../common/entity/compute_domain";
|
||||
import {
|
||||
AreaRegistryEntry,
|
||||
createAreaRegistryEntry,
|
||||
subscribeAreaRegistry,
|
||||
} from "../data/area_registry";
|
||||
import {
|
||||
showAlertDialog,
|
||||
showPromptDialog,
|
||||
} from "../dialogs/generic/show-dialog-box";
|
||||
import { SubscribeMixin } from "../mixins/subscribe-mixin";
|
||||
import { PolymerChangedEvent } from "../polymer-types";
|
||||
import { HomeAssistant } from "../types";
|
||||
import memoizeOne from "memoize-one";
|
||||
import {
|
||||
DeviceEntityLookup,
|
||||
DeviceRegistryEntry,
|
||||
|
@ -41,9 +35,15 @@ import {
|
|||
EntityRegistryEntry,
|
||||
subscribeEntityRegistry,
|
||||
} from "../data/entity_registry";
|
||||
import { computeDomain } from "../common/entity/compute_domain";
|
||||
import {
|
||||
showAlertDialog,
|
||||
showPromptDialog,
|
||||
} from "../dialogs/generic/show-dialog-box";
|
||||
import { SubscribeMixin } from "../mixins/subscribe-mixin";
|
||||
import { PolymerChangedEvent } from "../polymer-types";
|
||||
import { HomeAssistant } from "../types";
|
||||
import type { HaDevicePickerDeviceFilterFunc } from "./device/ha-device-picker";
|
||||
import { mdiClose, mdiMenuDown, mdiMenuUp } from "@mdi/js";
|
||||
import "./ha-svg-icon";
|
||||
|
||||
const rowRenderer = (
|
||||
root: HTMLElement,
|
||||
|
|
|
@ -7,7 +7,6 @@ import {
|
|||
svg,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
|
||||
import {
|
||||
getValueInPercentage,
|
||||
normalize,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import "@material/mwc-button/mwc-button";
|
||||
import "@material/mwc-icon-button/mwc-icon-button";
|
||||
import {
|
||||
css,
|
||||
|
@ -11,7 +12,6 @@ import {
|
|||
import { fireEvent } from "../common/dom/fire_event";
|
||||
import type { ToggleButton } from "../types";
|
||||
import "./ha-svg-icon";
|
||||
import "@material/mwc-button/mwc-button";
|
||||
|
||||
@customElement("ha-button-toggle-group")
|
||||
export class HaButtonToggleGroup extends LitElement {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { customElement, property } from "lit-element";
|
||||
import { CircularProgress } from "@material/mwc-circular-progress";
|
||||
import { customElement, property } from "lit-element";
|
||||
|
||||
@customElement("ha-circular-progress")
|
||||
// @ts-ignore
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import "@polymer/iron-flex-layout/iron-flex-layout-classes";
|
||||
import "./ha-icon-button";
|
||||
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
||||
/* eslint-plugin-disable lit */
|
||||
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
||||
import { EventsMixin } from "../mixins/events-mixin";
|
||||
import "./ha-icon-button";
|
||||
|
||||
/*
|
||||
* @appliesMixin EventsMixin
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { HassEntity } from "home-assistant-js-websocket";
|
||||
import {
|
||||
css,
|
||||
CSSResult,
|
||||
|
@ -7,11 +8,9 @@ import {
|
|||
property,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { HassEntity } from "home-assistant-js-websocket";
|
||||
|
||||
import { formatNumber } from "../common/string/format_number";
|
||||
import { CLIMATE_PRESET_NONE } from "../data/climate";
|
||||
import type { HomeAssistant } from "../types";
|
||||
import { formatNumber } from "../common/string/format_number";
|
||||
|
||||
@customElement("ha-climate-state")
|
||||
class HaClimateState extends LitElement {
|
||||
|
|
|
@ -131,81 +131,81 @@ export class HaCodeEditor extends UpdatingElement {
|
|||
.cm-s-default .CodeMirror-cursor {
|
||||
border-left: 1px solid var(--secondary-text-color);
|
||||
}
|
||||
|
||||
|
||||
.cm-s-default div.CodeMirror-selected, .cm-s-default.CodeMirror-focused div.CodeMirror-selected {
|
||||
background: rgba(var(--rgb-primary-color), 0.2);
|
||||
}
|
||||
|
||||
|
||||
.cm-s-default .CodeMirror-line::selection,
|
||||
.cm-s-default .CodeMirror-line>span::selection,
|
||||
.cm-s-default .CodeMirror-line>span>span::selection {
|
||||
background: rgba(var(--rgb-primary-color), 0.2);
|
||||
}
|
||||
|
||||
|
||||
.cm-s-default .cm-keyword {
|
||||
color: var(--codemirror-keyword, #6262FF);
|
||||
}
|
||||
|
||||
|
||||
.cm-s-default .cm-operator {
|
||||
color: var(--codemirror-operator, #cda869);
|
||||
}
|
||||
|
||||
|
||||
.cm-s-default .cm-variable-2 {
|
||||
color: var(--codemirror-variable-2, #690);
|
||||
}
|
||||
|
||||
|
||||
.cm-s-default .cm-builtin {
|
||||
color: var(--codemirror-builtin, #9B7536);
|
||||
}
|
||||
|
||||
|
||||
.cm-s-default .cm-atom {
|
||||
color: var(--codemirror-atom, #F90);
|
||||
}
|
||||
|
||||
|
||||
.cm-s-default .cm-number {
|
||||
color: var(--codemirror-number, #ca7841);
|
||||
}
|
||||
|
||||
|
||||
.cm-s-default .cm-def {
|
||||
color: var(--codemirror-def, #8DA6CE);
|
||||
}
|
||||
|
||||
|
||||
.cm-s-default .cm-string {
|
||||
color: var(--codemirror-string, #07a);
|
||||
}
|
||||
|
||||
|
||||
.cm-s-default .cm-string-2 {
|
||||
color: var(--codemirror-string-2, #bd6b18);
|
||||
}
|
||||
|
||||
|
||||
.cm-s-default .cm-comment {
|
||||
color: var(--codemirror-comment, #777);
|
||||
}
|
||||
|
||||
|
||||
.cm-s-default .cm-variable {
|
||||
color: var(--codemirror-variable, #07a);
|
||||
}
|
||||
|
||||
|
||||
.cm-s-default .cm-tag {
|
||||
color: var(--codemirror-tag, #997643);
|
||||
}
|
||||
|
||||
|
||||
.cm-s-default .cm-meta {
|
||||
color: var(--codemirror-meta, var(--primary-text-color));
|
||||
}
|
||||
|
||||
|
||||
.cm-s-default .cm-attribute {
|
||||
color: var(--codemirror-attribute, #d6bb6d);
|
||||
}
|
||||
|
||||
|
||||
.cm-s-default .cm-property {
|
||||
color: var(--codemirror-property, #905);
|
||||
}
|
||||
|
||||
|
||||
.cm-s-default .cm-qualifier {
|
||||
color: var(--codemirror-qualifier, #690);
|
||||
}
|
||||
|
||||
|
||||
.cm-s-default .cm-variable-3 {
|
||||
color: var(--codemirror-variable-3, #07a);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import "./ha-icon-button";
|
||||
import "@polymer/paper-input/paper-input";
|
||||
import "@polymer/paper-item/paper-item";
|
||||
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
||||
|
@ -6,6 +5,7 @@ import { html } from "@polymer/polymer/lib/utils/html-tag";
|
|||
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
||||
import "@vaadin/vaadin-combo-box/theme/material/vaadin-combo-box-light";
|
||||
import { EventsMixin } from "../mixins/events-mixin";
|
||||
import "./ha-icon-button";
|
||||
|
||||
class HaComboBox extends EventsMixin(PolymerElement) {
|
||||
static get template() {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import type { HassEntity } from "home-assistant-js-websocket";
|
||||
import {
|
||||
css,
|
||||
CSSResult,
|
||||
|
@ -10,14 +11,11 @@ import {
|
|||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { classMap } from "lit-html/directives/class-map";
|
||||
import type { HassEntity } from "home-assistant-js-websocket";
|
||||
|
||||
import type { HomeAssistant } from "../types";
|
||||
import { UNAVAILABLE } from "../data/entity";
|
||||
import CoverEntity from "../util/cover-model";
|
||||
|
||||
import "./ha-icon-button";
|
||||
import { computeCloseIcon, computeOpenIcon } from "../common/entity/cover_icon";
|
||||
import { UNAVAILABLE } from "../data/entity";
|
||||
import type { HomeAssistant } from "../types";
|
||||
import CoverEntity from "../util/cover-model";
|
||||
import "./ha-icon-button";
|
||||
|
||||
@customElement("ha-cover-controls")
|
||||
class HaCoverControls extends LitElement {
|
||||
|
|
|
@ -1,21 +1,19 @@
|
|||
import { HassEntity } from "home-assistant-js-websocket";
|
||||
import {
|
||||
css,
|
||||
CSSResult,
|
||||
customElement,
|
||||
html,
|
||||
internalProperty,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
CSSResult,
|
||||
css,
|
||||
customElement,
|
||||
TemplateResult,
|
||||
html,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { classMap } from "lit-html/directives/class-map";
|
||||
|
||||
import { UNAVAILABLE } from "../data/entity";
|
||||
import { HomeAssistant } from "../types";
|
||||
import CoverEntity from "../util/cover-model";
|
||||
|
||||
import "./ha-icon-button";
|
||||
|
||||
@customElement("ha-cover-tilt-controls")
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
import "@material/mwc-button/mwc-button";
|
||||
import "@material/mwc-list/mwc-list";
|
||||
import { ActionDetail } from "@material/mwc-list/mwc-list-foundation";
|
||||
import "@material/mwc-list/mwc-list-item";
|
||||
import { mdiCalendar } from "@mdi/js";
|
||||
import "@polymer/paper-input/paper-input";
|
||||
import {
|
||||
css,
|
||||
CSSResult,
|
||||
|
@ -5,20 +11,14 @@ import {
|
|||
html,
|
||||
LitElement,
|
||||
property,
|
||||
TemplateResult,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { HomeAssistant } from "../types";
|
||||
import { mdiCalendar } from "@mdi/js";
|
||||
import { formatDateTime } from "../common/datetime/format_date_time";
|
||||
import "@material/mwc-button/mwc-button";
|
||||
import "@material/mwc-list/mwc-list-item";
|
||||
import "./ha-svg-icon";
|
||||
import "@polymer/paper-input/paper-input";
|
||||
import "@material/mwc-list/mwc-list";
|
||||
import "./date-range-picker";
|
||||
import { computeRTLDirection } from "../common/util/compute_rtl";
|
||||
import { ActionDetail } from "@material/mwc-list/mwc-list-foundation";
|
||||
import { HomeAssistant } from "../types";
|
||||
import "./date-range-picker";
|
||||
import "./ha-svg-icon";
|
||||
|
||||
export interface DateRangePickerRanges {
|
||||
[key: string]: [Date, Date];
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { mdiChevronDown } from "@mdi/js";
|
||||
import {
|
||||
css,
|
||||
CSSResult,
|
||||
|
@ -8,10 +9,9 @@ import {
|
|||
query,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { classMap } from "lit-html/directives/class-map";
|
||||
import { fireEvent } from "../common/dom/fire_event";
|
||||
import "./ha-svg-icon";
|
||||
import { mdiChevronDown } from "@mdi/js";
|
||||
import { classMap } from "lit-html/directives/class-map";
|
||||
|
||||
@customElement("ha-expansion-panel")
|
||||
class HaExpansionPanel extends LitElement {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { Fab } from "@material/mwc-fab";
|
||||
import "@material/mwc-fab";
|
||||
import type { Fab } from "@material/mwc-fab";
|
||||
import { customElement } from "lit-element";
|
||||
import { Constructor } from "../types";
|
||||
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import {
|
||||
css,
|
||||
CSSResult,
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
TemplateResult,
|
||||
CSSResult,
|
||||
css,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { HaFormElement, HaFormConstantSchema } from "./ha-form";
|
||||
import { fireEvent } from "../../common/dom/fire_event";
|
||||
import { HaFormConstantSchema, HaFormElement } from "./ha-form";
|
||||
|
||||
@customElement("ha-form-constant")
|
||||
export class HaFormConstant extends LitElement implements HaFormElement {
|
||||
|
|
|
@ -9,19 +9,19 @@ import {
|
|||
CSSResult,
|
||||
customElement,
|
||||
html,
|
||||
internalProperty,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
query,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { fireEvent } from "../../common/dom/fire_event";
|
||||
import "../ha-icon";
|
||||
import {
|
||||
HaFormElement,
|
||||
HaFormMultiSelectData,
|
||||
HaFormMultiSelectSchema,
|
||||
} from "./ha-form";
|
||||
import "../ha-icon";
|
||||
|
||||
@customElement("ha-form-multi_select")
|
||||
export class HaFormMultiSelect extends LitElement implements HaFormElement {
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import "../ha-icon-button";
|
||||
import "@polymer/paper-input/paper-input";
|
||||
import type { PaperInputElement } from "@polymer/paper-input/paper-input";
|
||||
import {
|
||||
customElement,
|
||||
html,
|
||||
internalProperty,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
query,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { fireEvent } from "../../common/dom/fire_event";
|
||||
import "../ha-icon-button";
|
||||
import type {
|
||||
HaFormElement,
|
||||
HaFormStringData,
|
||||
|
|
|
@ -9,13 +9,13 @@ import {
|
|||
import { dynamicElement } from "../../common/dom/dynamic-element-directive";
|
||||
import { fireEvent } from "../../common/dom/fire_event";
|
||||
import "./ha-form-boolean";
|
||||
import "./ha-form-constant";
|
||||
import "./ha-form-float";
|
||||
import "./ha-form-integer";
|
||||
import "./ha-form-multi_select";
|
||||
import "./ha-form-positive_time_period_dict";
|
||||
import "./ha-form-select";
|
||||
import "./ha-form-string";
|
||||
import "./ha-form-constant";
|
||||
|
||||
export type HaFormSchema =
|
||||
| HaFormConstantSchema
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
import {
|
||||
LitElement,
|
||||
svg,
|
||||
customElement,
|
||||
css,
|
||||
property,
|
||||
customElement,
|
||||
internalProperty,
|
||||
LitElement,
|
||||
property,
|
||||
PropertyValues,
|
||||
svg,
|
||||
} from "lit-element";
|
||||
import { styleMap } from "lit-html/directives/style-map";
|
||||
import { afterNextRender } from "../common/util/render-status";
|
||||
import { ifDefined } from "lit-html/directives/if-defined";
|
||||
|
||||
import { getValueInPercentage, normalize } from "../util/calculate";
|
||||
import { styleMap } from "lit-html/directives/style-map";
|
||||
import { formatNumber } from "../common/string/format_number";
|
||||
import { afterNextRender } from "../common/util/render-status";
|
||||
import { getValueInPercentage, normalize } from "../util/calculate";
|
||||
|
||||
const getAngle = (value: number, min: number, max: number) => {
|
||||
const percentage = getValueInPercentage(normalize(value, min, max), min, max);
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import "@material/mwc-icon-button/mwc-icon-button";
|
||||
import { mdiArrowLeft, mdiArrowRight } from "@mdi/js";
|
||||
import {
|
||||
customElement,
|
||||
html,
|
||||
internalProperty,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
html,
|
||||
customElement,
|
||||
} from "lit-element";
|
||||
import { mdiArrowLeft, mdiArrowRight } from "@mdi/js";
|
||||
import "@material/mwc-icon-button/mwc-icon-button";
|
||||
import "./ha-svg-icon";
|
||||
import { HomeAssistant } from "../types";
|
||||
import "./ha-svg-icon";
|
||||
|
||||
@customElement("ha-icon-button-arrow-next")
|
||||
export class HaIconButtonArrowNext extends LitElement {
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import "@material/mwc-icon-button/mwc-icon-button";
|
||||
import { mdiArrowLeft, mdiArrowRight } from "@mdi/js";
|
||||
import {
|
||||
customElement,
|
||||
html,
|
||||
internalProperty,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
html,
|
||||
customElement,
|
||||
} from "lit-element";
|
||||
import { mdiArrowLeft, mdiArrowRight } from "@mdi/js";
|
||||
import "@material/mwc-icon-button/mwc-icon-button";
|
||||
import "./ha-svg-icon";
|
||||
import { HomeAssistant } from "../types";
|
||||
import "./ha-svg-icon";
|
||||
|
||||
@customElement("ha-icon-button-arrow-prev")
|
||||
export class HaIconButtonArrowPrev extends LitElement {
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import "@material/mwc-icon-button";
|
||||
import { mdiChevronLeft, mdiChevronRight } from "@mdi/js";
|
||||
import {
|
||||
customElement,
|
||||
html,
|
||||
internalProperty,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
html,
|
||||
customElement,
|
||||
} from "lit-element";
|
||||
import { mdiChevronRight, mdiChevronLeft } from "@mdi/js";
|
||||
import "@material/mwc-icon-button";
|
||||
import "./ha-svg-icon";
|
||||
import { HomeAssistant } from "../types";
|
||||
import "./ha-svg-icon";
|
||||
|
||||
@customElement("ha-icon-button-next")
|
||||
export class HaIconButtonNext extends LitElement {
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import "@material/mwc-icon-button/mwc-icon-button";
|
||||
import { mdiChevronLeft, mdiChevronRight } from "@mdi/js";
|
||||
import {
|
||||
customElement,
|
||||
html,
|
||||
internalProperty,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
html,
|
||||
customElement,
|
||||
} from "lit-element";
|
||||
import { mdiChevronRight, mdiChevronLeft } from "@mdi/js";
|
||||
import "@material/mwc-icon-button/mwc-icon-button";
|
||||
import "./ha-svg-icon";
|
||||
import { HomeAssistant } from "../types";
|
||||
import "./ha-svg-icon";
|
||||
|
||||
@customElement("ha-icon-button-prev")
|
||||
export class HaIconButtonPrev extends LitElement {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import "@material/mwc-icon-button";
|
||||
import {
|
||||
css,
|
||||
CSSResult,
|
||||
customElement,
|
||||
html,
|
||||
TemplateResult,
|
||||
property,
|
||||
LitElement,
|
||||
CSSResult,
|
||||
css,
|
||||
property,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import "./ha-icon";
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { mdiChevronLeft, mdiChevronRight } from "@mdi/js";
|
||||
import { HaSvgIcon } from "./ha-svg-icon";
|
||||
import { mdiChevronRight, mdiChevronLeft } from "@mdi/js";
|
||||
|
||||
export class HaIconNext extends HaSvgIcon {
|
||||
public connectedCallback() {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { mdiChevronLeft, mdiChevronRight } from "@mdi/js";
|
||||
import { HaSvgIcon } from "./ha-svg-icon";
|
||||
import { mdiChevronRight, mdiChevronLeft } from "@mdi/js";
|
||||
|
||||
export class HaIconPrev extends HaSvgIcon {
|
||||
public connectedCallback() {
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
import "@polymer/iron-icon/iron-icon";
|
||||
import {
|
||||
customElement,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
html,
|
||||
TemplateResult,
|
||||
css,
|
||||
CSSResult,
|
||||
customElement,
|
||||
html,
|
||||
internalProperty,
|
||||
LitElement,
|
||||
property,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import "./ha-svg-icon";
|
||||
import { customIconsets, CustomIcon } from "../data/custom_iconsets";
|
||||
import { fireEvent } from "../common/dom/fire_event";
|
||||
import { debounce } from "../common/util/debounce";
|
||||
import { CustomIcon, customIconsets } from "../data/custom_iconsets";
|
||||
import {
|
||||
Chunks,
|
||||
MDI_PREFIXES,
|
||||
getIcon,
|
||||
findIconChunk,
|
||||
Icons,
|
||||
checkCacheVersion,
|
||||
Chunks,
|
||||
findIconChunk,
|
||||
getIcon,
|
||||
Icons,
|
||||
MDI_PREFIXES,
|
||||
writeCache,
|
||||
} from "../data/iconsets";
|
||||
import { debounce } from "../common/util/debounce";
|
||||
import { fireEvent } from "../common/dom/fire_event";
|
||||
import "./ha-svg-icon";
|
||||
|
||||
interface DeprecatedIcon {
|
||||
[key: string]: {
|
||||
|
|
|
@ -7,7 +7,6 @@ import {
|
|||
property,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
|
||||
import "./ha-markdown-element";
|
||||
|
||||
@customElement("ha-markdown")
|
||||
|
|
|
@ -2,8 +2,8 @@ import { html } from "@polymer/polymer/lib/utils/html-tag";
|
|||
/* eslint-plugin-disable lit */
|
||||
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
||||
import { getAppKey } from "../data/notify_html5";
|
||||
import { EventsMixin } from "../mixins/events-mixin";
|
||||
import { showPromptDialog } from "../dialogs/generic/show-dialog-box";
|
||||
import { EventsMixin } from "../mixins/events-mixin";
|
||||
import "./ha-switch";
|
||||
|
||||
export const pushSupported =
|
||||
|
|
|
@ -4,9 +4,9 @@ import {
|
|||
CSSResult,
|
||||
customElement,
|
||||
html,
|
||||
internalProperty,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
import {
|
||||
customElement,
|
||||
UpdatingElement,
|
||||
property,
|
||||
PropertyValues,
|
||||
UpdatingElement,
|
||||
} from "lit-element";
|
||||
|
||||
import relativeTime from "../common/datetime/relative_time";
|
||||
|
||||
import type { HomeAssistant } from "../types";
|
||||
|
||||
@customElement("ha-relative-time")
|
||||
|
|
|
@ -6,10 +6,10 @@ import {
|
|||
LitElement,
|
||||
property,
|
||||
} from "lit-element";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import { ActionSelector } from "../../data/selector";
|
||||
import { Action } from "../../data/script";
|
||||
import { ActionSelector } from "../../data/selector";
|
||||
import "../../panels/config/automation/action/ha-automation-action";
|
||||
import { HomeAssistant } from "../../types";
|
||||
|
||||
@customElement("ha-selector-action")
|
||||
export class HaActionSelector extends LitElement {
|
||||
|
|
|
@ -5,12 +5,12 @@ import {
|
|||
LitElement,
|
||||
property,
|
||||
} from "lit-element";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import { AreaSelector } from "../../data/selector";
|
||||
import "../ha-area-picker";
|
||||
import { ConfigEntry, getConfigEntries } from "../../data/config_entries";
|
||||
import { DeviceRegistryEntry } from "../../data/device_registry";
|
||||
import { EntityRegistryEntry } from "../../data/entity_registry";
|
||||
import { AreaSelector } from "../../data/selector";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import "../ha-area-picker";
|
||||
|
||||
@customElement("ha-selector-area")
|
||||
export class HaAreaSelector extends LitElement {
|
||||
|
|
|
@ -5,11 +5,11 @@ import {
|
|||
LitElement,
|
||||
property,
|
||||
} from "lit-element";
|
||||
import { ConfigEntry, getConfigEntries } from "../../data/config_entries";
|
||||
import { DeviceRegistryEntry } from "../../data/device_registry";
|
||||
import { DeviceSelector } from "../../data/selector";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import "../device/ha-device-picker";
|
||||
import { DeviceRegistryEntry } from "../../data/device_registry";
|
||||
import { ConfigEntry, getConfigEntries } from "../../data/config_entries";
|
||||
import { DeviceSelector } from "../../data/selector";
|
||||
|
||||
@customElement("ha-selector-device")
|
||||
export class HaDeviceSelector extends LitElement {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { HassEntity, UnsubscribeFunc } from "home-assistant-js-websocket";
|
||||
import {
|
||||
customElement,
|
||||
html,
|
||||
|
@ -5,13 +6,12 @@ import {
|
|||
LitElement,
|
||||
property,
|
||||
} from "lit-element";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import "../entity/ha-entity-picker";
|
||||
import { HassEntity, UnsubscribeFunc } from "home-assistant-js-websocket";
|
||||
import { computeStateDomain } from "../../common/entity/compute_state_domain";
|
||||
import { subscribeEntityRegistry } from "../../data/entity_registry";
|
||||
import { SubscribeMixin } from "../../mixins/subscribe-mixin";
|
||||
import { EntitySelector } from "../../data/selector";
|
||||
import { SubscribeMixin } from "../../mixins/subscribe-mixin";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import "../entity/ha-entity-picker";
|
||||
|
||||
@customElement("ha-selector-entity")
|
||||
export class HaEntitySelector extends SubscribeMixin(LitElement) {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import "@polymer/paper-input/paper-input";
|
||||
import {
|
||||
css,
|
||||
CSSResult,
|
||||
|
@ -6,12 +7,11 @@ import {
|
|||
LitElement,
|
||||
property,
|
||||
} from "lit-element";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import { NumberSelector } from "../../data/selector";
|
||||
import "@polymer/paper-input/paper-input";
|
||||
import "../ha-slider";
|
||||
import { fireEvent } from "../../common/dom/fire_event";
|
||||
import { classMap } from "lit-html/directives/class-map";
|
||||
import { fireEvent } from "../../common/dom/fire_event";
|
||||
import { NumberSelector } from "../../data/selector";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import "../ha-slider";
|
||||
|
||||
@customElement("ha-selector-number")
|
||||
export class HaNumberSelector extends LitElement {
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
import "@material/mwc-list/mwc-list";
|
||||
import "@material/mwc-list/mwc-list-item";
|
||||
import "@material/mwc-tab-bar/mwc-tab-bar";
|
||||
import "@material/mwc-tab/mwc-tab";
|
||||
import "@polymer/paper-input/paper-input";
|
||||
import { HassEntity, UnsubscribeFunc } from "home-assistant-js-websocket";
|
||||
import {
|
||||
css,
|
||||
CSSResult,
|
||||
|
@ -7,23 +13,17 @@ import {
|
|||
LitElement,
|
||||
property,
|
||||
} from "lit-element";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import { TargetSelector } from "../../data/selector";
|
||||
import { ConfigEntry, getConfigEntries } from "../../data/config_entries";
|
||||
import { DeviceRegistryEntry } from "../../data/device_registry";
|
||||
import "../ha-target-picker";
|
||||
import "@material/mwc-list/mwc-list-item";
|
||||
import "@polymer/paper-input/paper-input";
|
||||
import "@material/mwc-list/mwc-list";
|
||||
import {
|
||||
EntityRegistryEntry,
|
||||
subscribeEntityRegistry,
|
||||
} from "../../data/entity_registry";
|
||||
import { TargetSelector } from "../../data/selector";
|
||||
import { Target } from "../../data/target";
|
||||
import "@material/mwc-tab-bar/mwc-tab-bar";
|
||||
import "@material/mwc-tab/mwc-tab";
|
||||
import { HassEntity, UnsubscribeFunc } from "home-assistant-js-websocket";
|
||||
import { SubscribeMixin } from "../../mixins/subscribe-mixin";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import "../ha-target-picker";
|
||||
|
||||
@customElement("ha-selector-target")
|
||||
export class HaTargetSelector extends SubscribeMixin(LitElement) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { customElement, html, LitElement, property } from "lit-element";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import { TimeSelector } from "../../data/selector";
|
||||
import { fireEvent } from "../../common/dom/fire_event";
|
||||
import { TimeSelector } from "../../data/selector";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import "../paper-time-input";
|
||||
|
||||
const test = new Date().toLocaleString();
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
import { customElement, html, LitElement, property } from "lit-element";
|
||||
import { dynamicElement } from "../../common/dom/dynamic-element-directive";
|
||||
import { HomeAssistant } from "../../types";
|
||||
|
||||
import "./ha-selector-entity";
|
||||
import "./ha-selector-device";
|
||||
import "./ha-selector-area";
|
||||
import "./ha-selector-target";
|
||||
import "./ha-selector-number";
|
||||
import "./ha-selector-boolean";
|
||||
import "./ha-selector-time";
|
||||
import "./ha-selector-action";
|
||||
import { Selector } from "../../data/selector";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import "./ha-selector-action";
|
||||
import "./ha-selector-area";
|
||||
import "./ha-selector-boolean";
|
||||
import "./ha-selector-device";
|
||||
import "./ha-selector-entity";
|
||||
import "./ha-selector-number";
|
||||
import "./ha-selector-target";
|
||||
import "./ha-selector-time";
|
||||
|
||||
@customElement("ha-selector")
|
||||
export class HaSelector extends LitElement {
|
||||
|
|
|
@ -16,7 +16,7 @@ export class HaSvgIcon extends LitElement {
|
|||
|
||||
protected render(): SVGTemplateResult {
|
||||
return svg`
|
||||
<svg
|
||||
<svg
|
||||
viewBox=${this.viewBox || "0 0 24 24"}
|
||||
preserveAspectRatio="xMidYMid meet"
|
||||
focusable="false">
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
import type { Ripple } from "@material/mwc-ripple";
|
||||
import "@material/mwc-ripple/mwc-ripple";
|
||||
import { RippleHandlers } from "@material/mwc-ripple/ripple-handlers";
|
||||
import {
|
||||
css,
|
||||
CSSResult,
|
||||
customElement,
|
||||
eventOptions,
|
||||
html,
|
||||
internalProperty,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
html,
|
||||
queryAsync,
|
||||
eventOptions,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import "@material/mwc-ripple/mwc-ripple";
|
||||
import type { Ripple } from "@material/mwc-ripple";
|
||||
import { RippleHandlers } from "@material/mwc-ripple/ripple-handlers";
|
||||
import { ifDefined } from "lit-html/directives/if-defined";
|
||||
import "./ha-icon";
|
||||
import "./ha-svg-icon";
|
||||
import { ifDefined } from "lit-html/directives/if-defined";
|
||||
|
||||
@customElement("ha-tab")
|
||||
export class HaTab extends LitElement {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue