@record-evolution/widget-switch 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/widget-switch.js +18 -1961
- package/dist/widget-switch.js.map +1 -1
- package/package.json +3 -2
- package/src/default-data.json +2 -2
- package/src/definition-schema.json +1 -0
- package/src/widget-switch.ts +3 -2
package/package.json
CHANGED
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
"name": "@record-evolution/widget-switch",
|
|
3
3
|
"description": "IronFlock Widget widget-switch",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"author": "
|
|
6
|
-
"version": "1.0.
|
|
5
|
+
"author": "Record Evolution GmbH",
|
|
6
|
+
"version": "1.0.2",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": "18.18.2",
|
|
9
9
|
"npm": ">=10.0.2"
|
|
10
10
|
},
|
|
11
11
|
"type": "module",
|
|
12
12
|
"main": "dist/widget-switch.js",
|
|
13
|
+
"module": "dist/widget-switch.js",
|
|
13
14
|
"types": "dist/src/widget-switch.d.ts",
|
|
14
15
|
"files": [
|
|
15
16
|
"dist",
|
package/src/default-data.json
CHANGED
package/src/widget-switch.ts
CHANGED
|
@@ -99,7 +99,9 @@ export class WidgetSwitch extends LitElement {
|
|
|
99
99
|
const prefix = piv ?? ''
|
|
100
100
|
const label = ds.label ?? ''
|
|
101
101
|
const value =
|
|
102
|
-
distincts.length === 1
|
|
102
|
+
distincts.length === 1
|
|
103
|
+
? ds.data?.at(-1)
|
|
104
|
+
: ds.data?.filter((d) => d.pivot === piv)?.at(-1)
|
|
103
105
|
const pds: Dataseries = {
|
|
104
106
|
label: prefix + (!!prefix && !!label ? ' - ' : '') + label,
|
|
105
107
|
actionApp: value?.actionApp,
|
|
@@ -178,7 +180,6 @@ export class WidgetSwitch extends LitElement {
|
|
|
178
180
|
actionTopic: switchEl?.actionTopic,
|
|
179
181
|
label: switchEl?.label
|
|
180
182
|
}
|
|
181
|
-
console.log('Action Submit', payload)
|
|
182
183
|
this.dispatchEvent(
|
|
183
184
|
new CustomEvent('action-submit', {
|
|
184
185
|
detail: payload,
|