File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 "name" : " @record-evolution/widget-switch" ,
33 "description" : " IronFlock Widget widget-switch" ,
44 "license" : " MIT" ,
5- "author" : " widget-switch " ,
5+ "author" : " Record Evolution GmbH " ,
66 "version" : " 1.0.1" ,
77 "engines" : {
88 "node" : " 18.18.2" ,
99 "npm" : " >=10.0.2"
1010 },
1111 "type" : " module" ,
1212 "main" : " dist/widget-switch.js" ,
13+ "module" : " dist/widget-switch.js" ,
1314 "types" : " dist/src/widget-switch.d.ts" ,
1415 "files" : [
1516 " dist" ,
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ export default {
1717 banner : `/* @license Copyright (c) 2023 Record Evolution GmbH. All rights reserved.*/` ,
1818 format : 'esm'
1919 } ,
20+ external : ( id ) => id . startsWith ( '@material/web/' ) ,
21+
2022 plugins : [
2123 replace ( {
2224 versionplaceholder : npmPackage . version ,
Original file line number Diff line number Diff line change 55 {
66 "label" : " Lamp" ,
77 "stateMap" : {
8- "on" : " >1" ,
9- "off" : " <= 1"
8+ "on" : " >= 1" ,
9+ "off" : " <1"
1010 },
1111 "styling" : {
1212 "labelColor" : " #000000" ,
Original file line number Diff line number Diff line change 9090 "actionApp" : {
9191 "title" : " Action App" ,
9292 "description" : " The app that should handle the click on the switch." ,
93+ "dataDrivenDisabled" : true ,
9394 "type" : " actionApp" ,
9495 "order" : 3
9596 },
Original file line number Diff line number Diff line change @@ -99,7 +99,9 @@ export class WidgetSwitch extends LitElement {
9999 const prefix = piv ?? ''
100100 const label = ds . label ?? ''
101101 const value =
102- distincts . length === 1 ? ds . data ?. [ 0 ] : ds . data ?. filter ( ( d ) => d . pivot === piv ) ?. [ 0 ]
102+ distincts . length === 1
103+ ? ds . data ?. at ( - 1 )
104+ : ds . data ?. filter ( ( d ) => d . pivot === piv ) ?. at ( - 1 )
103105 const pds : Dataseries = {
104106 label : prefix + ( ! ! prefix && ! ! label ? ' - ' : '' ) + label ,
105107 actionApp : value ?. actionApp ,
@@ -178,7 +180,6 @@ export class WidgetSwitch extends LitElement {
178180 actionTopic : switchEl ?. actionTopic ,
179181 label : switchEl ?. label
180182 }
181- console . log ( 'Action Submit' , payload )
182183 this . dispatchEvent (
183184 new CustomEvent ( 'action-submit' , {
184185 detail : payload ,
You can’t perform that action at this time.
0 commit comments