From 562b27504db7f732c122c00a0dcb17d5c4af00d2 Mon Sep 17 00:00:00 2001 From: Gluwc Date: Sat, 25 Apr 2020 03:11:25 +0200 Subject: [PATCH] 3.1.0 --- README.md | 1 - images/editor.PNG | Bin 0 -> 38603 bytes package.json | 3 +- src/action-handler-directive.ts | 1 - src/bar-card.ts | 22 +- src/const.ts | 2 +- src/editor.ts | 1509 ++++++++++++++++++------------- src/helpers.ts | 9 +- src/types.ts | 1 - 9 files changed, 894 insertions(+), 654 deletions(-) create mode 100644 images/editor.PNG diff --git a/README.md b/README.md index ae4b392..8655fe4 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,6 @@ | min | number | 0 | Defines minimum value of the bar. | name | string | none | Defines custom entity name. | positions | object | none | Defines the positions of the card elements. See [Positions Options](#positions-options). -| service_options | object | none | A list of service call options. Should include `domain`, `service`, `data` | severity | object | none | A list of severity values. See [Severity Options](#severity-options). | tap_action | string | info | Sets the action when tapping the bar. `info`, `service` | target | number | none | Defines and enables target marker value. diff --git a/images/editor.PNG b/images/editor.PNG new file mode 100644 index 0000000000000000000000000000000000000000..b0c3518d06609a928b0cb7dff7848be3cec1dd90 GIT binary patch literal 38603 zcmdqJdpy(q|39v)y1Gi`ib|#EB$ZGKg;^;%QxY}ImB{&+rHxrvIaHFIb6m-9W5p3mpwd4Jp= z_h*kTSs8EIuxo>ql+-3ulM6OdQmZ*qQopVG<9Fc6+D`Ub;Mc0#HpYfhrER+>fj`!` zpR+tCCG{>&dgX?saD9Nu_1jWXo9iY2RyFv)c9oJ!`OEaeIorF?8R2@u)}Ab0Tsx}F zz06WG?F|R@nSRm$jN*@_HP|1z`5APAH7u)jXctfUGw88^_^1355LwyH;OZrlBF#NRUk=2r`BDC5&yj|i zKaPxVHa%10aez~}Hn!XBO0Kr-kJ1;{O{;G|PKr^;sgc&;6z+`e-e736t+i>3@$OYW z-gu^G^E4wl$ssy-VBqkVFt3;KM{PfDGxgo^qgbj!d2ur7c1+T%XrDtI$OHx@RQ*}f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&7W>`X}-B-J7ZAVC#2;78<_fDUzZ z`&I8O)Ji{i7J3%_j*t+~iZLY?jP|)WmEwQDB_Sakn~-I-DP6VtStyP>{?LFlCSh80 zg3)Wkj|W)`EC_Z1i4%;+c%nP~y`&K1nZfsG#_gf>`1Ed=fF~YQMmCExE`-NMX3fOH zKb6O`U>Ba^Do|ildyhqUnmG6O)&0<08EXX?e!9f1l>o$5h z=XuJD=u`cNwr_q^9_~VU(;AIFf_ziEztl~A1a08=FmCJB`qqxXk-Ocam$a&(U#cl< LUCURx{p5cD>jW{x literal 0 HcmV?d00001 diff --git a/package.json b/package.json index d6cffde..1cf7071 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,8 @@ "custom-card-helpers": "^1.3.9", "home-assistant-js-websocket": "^4.4.0", "lit-element": "^2.2.1", - "lit-html": "^1.1.2" + "lit-html": "^1.1.2", + "yaml": "^1.9.0" }, "devDependencies": { "@babel/core": "^7.6.4", diff --git a/src/action-handler-directive.ts b/src/action-handler-directive.ts index ebad149..3531aa1 100644 --- a/src/action-handler-directive.ts +++ b/src/action-handler-directive.ts @@ -164,7 +164,6 @@ class ActionHandler extends HTMLElement implements ActionHandler { } } -// TODO You need to replace all instances of "action-handler-boilerplate" with "action-handler-" customElements.define('action-handler-bar', ActionHandler); const getActionHandler = (): ActionHandler => { diff --git a/src/bar-card.ts b/src/bar-card.ts index 8afb832..fb4b15e 100644 --- a/src/bar-card.ts +++ b/src/bar-card.ts @@ -38,7 +38,7 @@ export class BarCard extends LitElement { @property() public hass?: HomeAssistant; @property() private _config!: BarCardConfig; - private _configArray: BarCardConfig[] = []; + @property() private _configArray: BarCardConfig[] = []; private _stateArray: any[] = []; private _animationState: any[] = []; @@ -69,7 +69,6 @@ export class BarCard extends LitElement { minmax: 'off', value: 'inside', }, - service_options: false, }, config, ); @@ -91,7 +90,7 @@ export class BarCard extends LitElement { ` : html` - +
${this._createBarArray()}
@@ -371,7 +370,16 @@ export class BarCard extends LitElement { // Add current bar to row array. currentRowArray.push(html` - + ${iconOutside} ${indicatorOutside} ${nameOutside} +
+
+ +
${options.name}
+
+
${options.secondary}
+
+ + `; } - get _entities(): object | boolean { - if (this._config) { - return this._config.entities || false; + private _createEntitiesValues(): TemplateResult[] { + if (!this.hass || !this._config) { + return [html``]; } - return false; - } - - get _tap_action(): ActionConfig { - if (this._config) { - return this._config.tap_action || { action: 'more-info' }; + const options = this._options.entities; + const entities = Object.keys(this.hass.states); + const valueElementArray: TemplateResult[] = []; + for (const config of this._configArray) { + const index = this._configArray.indexOf(config); + valueElementArray.push(html` +
+
+
+ options +
+ +
+
+ + + ${entities.map(entity => { + return html` + ${entity} + `; + })} + + +
+ ${index !== 0 + ? html` + + ` + : html` + + `} + ${index !== this._configArray.length - 1 + ? html` + + ` + : html` + + `} + +
+ ${options.options.entities[index].show + ? html` +
+ ${this._createBarElement(index)} ${this._createValueElement(index)} + ${this._createPositionsElement(index)} ${this._createSeverityElement(index)} + ${this._createAnimationElement(index)} ${this._createActionsElement(index)} +
+ ` + : ''} + `); } - - return { action: 'more-info' }; + return valueElementArray; } - get _hold_action(): ActionConfig { - if (this._config) { - return this._config.hold_action || { action: 'none' }; + private _createEntitiesElement(): TemplateResult { + if (!this.hass || !this._config) { + return html``; } + const options = this._options.entities; - return { action: 'none' }; + return html` +
+
+
+ +
${options.name}
+ +
+
${options.secondary}
+
+ ${options.show + ? html` +
+ ${this._createEntitiesValues()} +
+ +
+
+ ` + : ''} +
+ `; } - get _double_tap_action(): ActionConfig { - if (this._config) { - return this._config.double_tap_action || { action: 'none' }; + private _createAppearanceElement(): TemplateResult { + if (!this.hass) { + return html``; } - - return { action: 'none' }; + const options = this._options.appearance; + return html` +
+
+ +
${options.name}
+ +
+
${options.secondary}
+
+ ${ + options.show + ? html` +
+ ${this._createCardElement()} ${this._createBarElement(null)} ${this._createValueElement(null)} + ${this._createPositionsElement(null)} ${this._createSeverityElement(null)} + ${this._createAnimationElement(null)} +
+ ` + : '' + } + `; } - protected render(): TemplateResult | void { - // const actionsElement = html` - //
- //
- //
- // - //
${options.actions.name}
- // - //
- //
${options.actions.secondary}
- //
- // ${options.actions.show - // ? html` - //
- //
- //
- // - //
${options.actions.options.tap.name}
- //
- //
${options.actions.options.tap.secondary}
- //
- // ${options.actions.options.tap.show - // ? html` - //
- // Action Editors Coming Soon - //
- // ` - // : ''} - //
- //
- // - //
${options.actions.options.hold.name}
- //
- //
${options.actions.options.hold.secondary}
- //
- // ${options.actions.options.hold.show - // ? html` - //
- // Action Editors Coming Soon - //
- // ` - // : ''} - //
- //
- // - //
${options.actions.options.double_tap.name}
- //
- //
${options.actions.options.double_tap.secondary}
- //
- // ${options.actions.options.double_tap.show - // ? html` - //
- // Action Editors Coming Soon - //
- // ` - // : ''} - //
- // ` - // : ''} - //
- // `; - + private _createEditorElement(): TemplateResult { return html` - ${this._computeEntitiesElement()} ${this._computeAppearanceElement()} + `; } - private _computeBarElement(index): TemplateResult { + private _createBarElement(index): TemplateResult { let options; let config; if (index !== null) { @@ -360,7 +371,12 @@ export class BarCardEditor extends LitElement implements LovelaceCardEditor { } return html`
-
+
${options.name}
@@ -371,117 +387,80 @@ export class BarCardEditor extends LitElement implements LovelaceCardEditor { ${options.show ? html`
- ${index == null +
+ + + right + up + + + ${config.direction + ? html` + + ` + : ''} +
+ ${index !== null ? html` - - - - right - up - - - - - - - ` - : html` - - - - right - up - - - - - - - `} + ` + : ''} + + + +
` : ''} @@ -489,16 +468,25 @@ export class BarCardEditor extends LitElement implements LovelaceCardEditor { `; } - private _computeEntitiesElement(): TemplateResult { - if (!this.hass) { - return html``; + private _createAnimationElement(index): TemplateResult { + let options; + let config; + if (index !== null) { + options = this._options.entities.options.entities[index].options.animation; + config = this._configArray[index]; + } else { + options = this._options.appearance.options.animation; + config = this._config; } - const entities = Object.keys(this.hass.states); - const options = this._options.entities; - + config.animation = { ...config.animation }; return html` -
-
+
+
${options.name}
@@ -507,163 +495,232 @@ export class BarCardEditor extends LitElement implements LovelaceCardEditor {
${options.secondary}
${options.show - ? html` -
- ${this._configArray.length > 0 - ? this._configArray.map(config => { - return html` -
- -
- - - ${entities.map(entity => { - return html` - ${entity} - `; - })} - - -
- ${this._configArray.indexOf(config) !== 0 - ? html` - - ` - : html` - - `} - ${this._configArray.indexOf(config) !== this._configArray.length - 1 - ? html` - - ` - : html` - - `} + ? config.animation + ? html` +
+
+ + + on + off + + + ${config.animation.state + ? html` -
-
-
-
- options -
- -
- ${options.options.entities[this._configArray.indexOf(config)].show - ? html` -
- ${this._computeBarElement(this._configArray.indexOf(config))} -
- ` - : ''} -
- `; - }) - : ''} -
- + ` + : ''} +
+
-
- ` + ` + : html` +
+
+ + + on + off + + +
+ +
+ ` : ''}
`; } - private _computeAppearanceElement(): TemplateResult { - if (!this.hass) { - return html``; + private _createSeverityElement(index): TemplateResult { + let options; + let config; + if (index !== null) { + options = this._options.entities.options.entities[index].options.severity; + config = this._configArray[index]; + } else { + options = this._options.appearance.options.severity; + config = this._config; } - const options = this._options.appearance; + const arrayLength = config.severity ? config.severity.length : 0; return html` -
+
+
${options.name}
- +
${options.secondary}
- ${ - options.show - ? html` -
- ${this._computeBarElement(null)} ${this._computeCardElement()} ${this._computeValueElement()} - ${this._computePositionsElement(null)} + ${options.show + ? html` +
+ ${arrayLength > 0 + ? html` + ${this._createSeverityValues(index)} + ` + : ''} +
+
+
+ ` + : ''} +
+ `; + } + + private _createSeverityValues(index): TemplateResult[] { + let config; + if (index === null) { + config = this._config; + } else { + config = this._configArray[index]; + } + const severityValuesArray: TemplateResult[] = []; + for (const severity of config.severity) { + const severityIndex = config.severity.indexOf(severity); + severityValuesArray.push(html` +
+
+
+ + +
+ +
+ ${severityIndex !== 0 + ? html` + ` - : '' - } -
`; + : html` + + `} + ${severityIndex !== config.severity.length - 1 + ? html` + + ` + : html` + + `} + +
+ `); + } + return severityValuesArray; } - private _computeCardElement(): TemplateResult { + private _createCardElement(): TemplateResult { if (!this.hass) { return html``; } + const config: any = this._config; + const index = null; const options = this._options.appearance.options.card; return html`
-
+
${options.name}
@@ -673,27 +730,32 @@ export class BarCardEditor extends LitElement implements LovelaceCardEditor {
${options.show ? html` -
+
- ${this._entity_row + ${config.entity_row ? html` Entity Row @@ -701,8 +763,9 @@ export class BarCardEditor extends LitElement implements LovelaceCardEditor { : html` Entity Row @@ -715,10 +778,7 @@ export class BarCardEditor extends LitElement implements LovelaceCardEditor { `; } - private _computePositionsElement(index): TemplateResult { - if (!this.hass) { - return html``; - } + private _createPositionsValues(index): TemplateResult[] { const defaultPositions = { icon: 'outside', indicator: 'outside', @@ -726,19 +786,90 @@ export class BarCardEditor extends LitElement implements LovelaceCardEditor { minmax: 'off', value: 'inside', }; - let options; let config; - if (index !== null) { - options = this._options.entities.options.entities[index].options.positions; - config = this._configArray[index]; + if (index === null) { + config = this._config; } else { + config = this._configArray[index]; + } + config.positions = { ...config.positions }; + const positionElementsArray: TemplateResult[] = []; + const objectKeys = Object.keys(defaultPositions); + for (const position of objectKeys) { + if (config.positions[position]) { + positionElementsArray.push(html` +
+ + + inside + outside + off + + + +
+ `); + } else { + positionElementsArray.push(html` +
+ + + inside + outside + off + + +
+ `); + } + } + return positionElementsArray; + } + + private _createPositionsElement(index): TemplateResult { + if (!this.hass) { + return html``; + } + + let options; + let config; + if (index === null) { options = this._options.appearance.options.positions; config = this._config; + } else { + options = this._options.entities.options.entities[index].options.positions; + config = this._configArray[index]; } - config.positions = Object.assign(defaultPositions, config.positions); return html` -
-
+
+
${options.name}
@@ -748,43 +879,36 @@ export class BarCardEditor extends LitElement implements LovelaceCardEditor {
${options.show ? html` -
- ${Object.keys(config.positions).map(position => { - return html` -
- - - inside - outside - off - - -
- `; - })} -
+ ${this._createPositionsValues(index)} ` : ``}
`; } - private _computeValueElement(): TemplateResult { + private _createValueElement(index): TemplateResult { if (!this.hass) { return html``; } - const options = this._options.appearance.options.value; + + let options; + let config; + if (index !== null) { + options = this._options.entities.options.entities[index].options.value; + config = this._configArray[index]; + } else { + options = this._options.appearance.options.value; + config = this._config; + } + return html`
-
+
${options.name}
@@ -795,12 +919,13 @@ export class BarCardEditor extends LitElement implements LovelaceCardEditor { ${options.show ? html`
- ${this._limit_value + ${config.limit_value ? html` Limit Value @@ -808,46 +933,67 @@ export class BarCardEditor extends LitElement implements LovelaceCardEditor { : html` Limit Value `} +
@@ -875,7 +1021,36 @@ export class BarCardEditor extends LitElement implements LovelaceCardEditor { this._toggle = !this._toggle; } - private _removeFromArray(ev): void { + private _addEntity(ev): void { + if (!this._config || !this.hass) { + return; + } + const target = ev.target; + let newObject; + if (target.configAddObject) { + newObject = target.configAddObject; + } else { + newObject = { [target.configAddValue]: '' }; + } + const newArray = target.configArray.slice(); + newArray.push(newObject); + this._config.entities = newArray; + fireEvent(this, 'config-changed', { config: this._config }); + } + + private _moveEntity(ev): void { + if (!this._config || !this.hass) { + return; + } + const target = ev.target; + let newArray = target.configArray.slice(); + if (target.configDirection == 'up') newArray = arrayMove(newArray, target.index, target.index - 1); + else if (target.configDirection == 'down') newArray = arrayMove(newArray, target.index, target.index + 1); + this._config.entities = newArray; + fireEvent(this, 'config-changed', { config: this._config }); + } + + private _removeEntity(ev): void { if (!this._config || !this.hass) { return; } @@ -891,46 +1066,134 @@ export class BarCardEditor extends LitElement implements LovelaceCardEditor { const newConfig = { [target.configArray]: entitiesArray }; this._config = Object.assign(this._config, newConfig); fireEvent(this, 'config-changed', { config: this._config }); - this._toggle = !this._toggle; - this._toggle = !this._toggle; } - private _addToArray(ev): void { + private _addSeverity(ev): void { if (!this._config || !this.hass) { return; } const target = ev.target; - const entitiesArray: BarCardConfig[] = []; - let index = 0; - for (const config of this._configArray) { - if (target.configIndex !== index) { - entitiesArray.push(config); - } - index++; + + let severityArray; + if (target.index === null) { + severityArray = this._config.severity; + } else { + severityArray = this._config.entities[target.index].severity; } - const newEntity: any = { entity: '' }; - entitiesArray.push(newEntity); - const newConfig = { [target.configArray]: entitiesArray }; - this._config = Object.assign(this._config, newConfig); + if (!severityArray) { + severityArray = []; + } + + const newObject = { from: '', to: '', color: '' }; + const newArray = severityArray.slice(); + newArray.push(newObject); + + if (target.index === null) { + this._config.severity = newArray; + } else { + this._configArray[target.index].severity = newArray; + } + this._config.entities = this._configArray; + fireEvent(this, 'config-changed', { config: this._config }); + } + + private _moveSeverity(ev): void { + if (!this._config || !this.hass) { + return; + } + const target = ev.target; + + let severityArray; + if (target.index === null) { + severityArray = this._config.severity; + } else { + severityArray = this._config.entities[target.index].severity; + } + + let newArray = severityArray.slice(); + if (target.configDirection == 'up') { + newArray = arrayMove(newArray, target.severityIndex, target.severityIndex - 1); + } else if (target.configDirection == 'down') { + newArray = arrayMove(newArray, target.severityIndex, target.severityIndex + 1); + } + + if (target.index === null) { + this._config.severity = newArray; + } else { + this._configArray[target.index].severity = newArray; + } + this._config.entities = this._configArray; fireEvent(this, 'config-changed', { config: this._config }); - this._toggle = !this._toggle; } - private _arrayMove(ev): void { + private _removeSeverity(ev): void { + if (!this._config || !this.hass) { + return; + } const target = ev.target; - const entitiesArray: BarCardConfig[] = []; - for (const config of this._configArray) { - entitiesArray.push(config); + + let severityArray; + if (target.index === null) { + severityArray = this._config.severity; + } else { + severityArray = this._configArray[target.index].severity; } - if (target.configDirection == 'up') arrayMove(entitiesArray, target.configIndex, target.configIndex - 1); - else if (target.configDirection == 'down') arrayMove(entitiesArray, target.configIndex, target.configIndex + 1); + const clonedArray = severityArray.slice(); + const newArray: any = []; + let arrayIndex = 0; + for (const config of clonedArray) { + if (target.severityIndex !== arrayIndex) { + newArray.push(clonedArray[arrayIndex]); + } + arrayIndex++; + } + if (target.index === null) { + if (newArray.length === 0) { + delete this._config.severity; + } else { + this._config.severity = newArray; + } + } else { + if (newArray.length === 0) { + delete this._configArray[target.index].severity; + } else { + this._configArray[target.index].severity = newArray; + } + } + this._config.entities = this._configArray; + fireEvent(this, 'config-changed', { config: this._config }); + } - const newConfig = { [target.configArray]: entitiesArray }; - this._config = Object.assign(this._config, newConfig); + private _updateSeverity(ev): void { + const target = ev.target; + + let severityArray; + if (target.index === null) { + severityArray = this._config.severity; + } else { + severityArray = this._configArray[target.index].severity; + } + const newSeverityArray: any = []; + for (const index in severityArray) { + if (target.severityIndex == index) { + const clonedObject = { ...severityArray[index] }; + const newObject = { [target.severityAttribute]: target.value }; + const mergedObject = Object.assign(clonedObject, newObject); + newSeverityArray.push(mergedObject); + } else { + newSeverityArray.push(severityArray[index]); + } + } + + if (target.index === null) { + this._config.severity = newSeverityArray; + } else { + this._configArray[target.index].severity = newSeverityArray; + } + this._config.entities = this._configArray; fireEvent(this, 'config-changed', { config: this._config }); - this._toggle = !this._toggle; } private _valueChanged(ev): void { @@ -938,75 +1201,24 @@ export class BarCardEditor extends LitElement implements LovelaceCardEditor { return; } const target = ev.target; - // if (this[`_${target.configValue}`] === target.value) { - // return; - // } - if (target.configValue) { - if (target.configObject) { - switch (typeof target.value) { - case 'string': - if (target.value === '') { - delete this._config[target.configObject][target.configValue]; - } else { - this._config = mergeDeep(this._config, { - [target.configObject]: { - [target.configValue]: target.checked !== undefined ? target.checked : target.value, - }, - }); - } - break; - } - } else if (target.configArray) { - switch (typeof target.value) { - case 'string': - for (const config of this._configArray) { - const index = this._configArray.indexOf(config); - if (target.configIndex == index) { - if (target.value == '') { - delete config[target.configValue]; - } else { - config[target.configValue] = target.checked !== undefined ? target.checked : target.value; - } - } - } - this._config[target.configArray] = this._configArray; - break; - } + if (target.configObject[target.configAttribute] == target.value) { + return; + } + + if (target.configAdd && target.value !== '') { + target.configObject = Object.assign(target.configObject, { + [target.configAdd]: { [target.configAttribute]: target.value }, + }); + } + if (target.configAttribute && target.configObject && !target.configAdd) { + if (target.value == '' || target.value === false) { + if (target.ignoreNull == true) return; + delete target.configObject[target.configAttribute]; } else { - switch (typeof target.value) { - case 'string': - if (target.value === '') { - delete this._config[target.configValue]; - } else { - this._config = { - ...this._config, - [target.configValue]: target.checked !== undefined ? target.checked : target.value, - }; - } - break; - case 'boolean': - if (this._config[target.configValue] === true) { - delete this._config[target.configValue]; - } else { - this._config = { - ...this._config, - [target.configValue]: target.checked !== undefined ? target.checked : target.value, - }; - } - break; - case 'number': - if (target.value === '' || target.value === false) { - delete this._config[target.configValue]; - } else { - this._config = { - ...this._config, - [target.configValue]: Number(target.checked !== undefined ? target.checked : target.value), - }; - } - break; - } + target.configObject[target.configAttribute] = target.value; } } + this._config.entities = this._configArray; fireEvent(this, 'config-changed', { config: this._config }); } @@ -1017,11 +1229,12 @@ export class BarCardEditor extends LitElement implements LovelaceCardEditor { cursor: pointer; } .options { - background: #0002; + background: var(--primary-background-color); + border-radius: var(--ha-card-border-radius); cursor: pointer; + padding: 8px; } .sub-category { - padding: 4px 0px; cursor: pointer; } .row { @@ -1041,7 +1254,20 @@ export class BarCardEditor extends LitElement implements LovelaceCardEditor { pointer-events: none; } .value { - margin-left: 8px; + padding: 0px 8px; + } + .value-container { + padding: 0px 8px; + transition: all 0.5s ease-in-out; + } + .value-container:target { + height: 50px; + } + .value-number { + width: 100px; + } + ha-fab { + margin: 8px; } ha-switch { padding: 16px 0; @@ -1049,12 +1275,13 @@ export class BarCardEditor extends LitElement implements LovelaceCardEditor { .card-background { background: var(--paper-card-background-color); border-radius: var(--ha-card-border-radius); - padding: 16px; + padding: 8px; } .category { background: #0000; } .ha-icon-large { + cursor: pointer; margin: 0px 4px; } `; diff --git a/src/helpers.ts b/src/helpers.ts index 6415251..b30c1bf 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -40,7 +40,6 @@ export function hasConfigOrEntitiesChanged(element: any, changedProps: PropertyV if (changedProps.has('config') || forceUpdate) { return true; } - for (const config of element._configArray) { if (config.entity) { const oldHass = changedProps.get('hass') as HomeAssistant | undefined; @@ -97,8 +96,10 @@ export function createEditorConfigArray(config): BarCardConfig[] { return configArray; } -export function arrayMove(arr, fromIndex, toIndex) { +export function arrayMove(arr, fromIndex, toIndex): any[] { const element = arr[fromIndex]; - arr.splice(fromIndex, 1); - arr.splice(toIndex, 0, element); + const newArray = arr.slice(); + newArray.splice(fromIndex, 1); + newArray.splice(toIndex, 0, element); + return newArray; } diff --git a/src/types.ts b/src/types.ts index 1cbc285..c847af2 100644 --- a/src/types.ts +++ b/src/types.ts @@ -20,7 +20,6 @@ export interface BarCardConfig { min: number; name: string; positions: any; - service_options: { domain: string; service: string; data: any }; severity: any; stack: string; tap_action?: ActionConfig;