@record-evolution/widget-switch 1.0.2 → 1.0.3
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/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "IronFlock Widget widget-switch",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Record Evolution GmbH",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.3",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": "18.18.2",
|
|
9
9
|
"npm": ">=10.0.2"
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"scripts": {
|
|
20
20
|
"analyze": "cem analyze --litelement",
|
|
21
21
|
"start": "concurrently -k -r \"npm run watch\" \"wds\"",
|
|
22
|
-
"build": "rollup -c rollup.config.js",
|
|
23
|
-
"watch": "rollup -w -c rollup.config.js",
|
|
22
|
+
"build": "node rename-material-package.js && rollup -c rollup.config.js",
|
|
23
|
+
"watch": "node rename-material-package.js && rollup -w -c rollup.config.js",
|
|
24
24
|
"link": "npm link && cd ../RESWARM/frontend && npm link @record-evolution/widget-switch",
|
|
25
25
|
"unlink": "npm unlink --global && cd ../RESWARM/frontend && npm unlink @record-evolution/widget-switch && npm i @record-evolution/widget-switch",
|
|
26
26
|
"types": "cat src/definition-schema.json | json2ts > src/definition-schema.d.ts",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"release": "npm run build && npm run types && npm version patch --tag-version-prefix='' && git push && git push --tag"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@material/web": "^2.
|
|
32
|
-
"lit": "^3.3.
|
|
31
|
+
"@material/web": "^2.4.0",
|
|
32
|
+
"lit": "^3.3.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@custom-elements-manifest/analyzer": "^0.10.4",
|
|
@@ -20,12 +20,11 @@ export type ONValues = string;
|
|
|
20
20
|
*/
|
|
21
21
|
export type OFFValues = string;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Is not strictly required, but is strongly recommended to be connected to the backend column that represents the switch state. This keeps the switch state consistent with the backend data.
|
|
24
24
|
*/
|
|
25
|
-
export type
|
|
26
|
-
export type Value = string;
|
|
25
|
+
export type SwitchState = string;
|
|
27
26
|
/**
|
|
28
|
-
* The action topic that is called when clicking the switch. The arguments will be True for ON and False for OFF. Refer to
|
|
27
|
+
* The action topic that is called when clicking the switch. The arguments will be True for ON and False for OFF. Refer to your chosen apps documentation for available topics to call.
|
|
29
28
|
*/
|
|
30
29
|
export type ActionTopic = string;
|
|
31
30
|
/**
|
|
@@ -36,8 +35,7 @@ export type SplitDataBy = string;
|
|
|
36
35
|
* The data for the switch state.
|
|
37
36
|
*/
|
|
38
37
|
export type SwitchStateData = {
|
|
39
|
-
|
|
40
|
-
value?: Value;
|
|
38
|
+
value?: SwitchState;
|
|
41
39
|
actionApp?: ActionApp;
|
|
42
40
|
actionDevice?: ActionDeviceTarget;
|
|
43
41
|
actionTopic?: ActionTopic;
|
|
@@ -75,16 +75,11 @@
|
|
|
75
75
|
"items": {
|
|
76
76
|
"type": "object",
|
|
77
77
|
"properties": {
|
|
78
|
-
"tsp": {
|
|
79
|
-
"title": "Timestamp",
|
|
80
|
-
"description": "This should be an ISO String date like 2023-11-04T22:47:52.351152+00:00. Will only be used to detect age of data.",
|
|
81
|
-
"type": "string",
|
|
82
|
-
"order": 1
|
|
83
|
-
},
|
|
84
78
|
"value": {
|
|
85
|
-
"title": "
|
|
79
|
+
"title": "Switch State",
|
|
86
80
|
"type": "string",
|
|
87
|
-
"
|
|
81
|
+
"description": "Is not strictly required, but is strongly recommended to be connected to the backend column that represents the switch state. This keeps the switch state consistent with the backend data.",
|
|
82
|
+
"required": false,
|
|
88
83
|
"order": 2
|
|
89
84
|
},
|
|
90
85
|
"actionApp": {
|
|
@@ -102,7 +97,7 @@
|
|
|
102
97
|
},
|
|
103
98
|
"actionTopic": {
|
|
104
99
|
"title": "Action Topic",
|
|
105
|
-
"description": "The action topic that is called when clicking the switch. The arguments will be True for ON and False for OFF. Refer to
|
|
100
|
+
"description": "The action topic that is called when clicking the switch. The arguments will be True for ON and False for OFF. Refer to your chosen apps documentation for available topics to call.",
|
|
106
101
|
"type": "string",
|
|
107
102
|
"order": 5
|
|
108
103
|
},
|
package/src/widget-switch.ts
CHANGED
|
@@ -277,7 +277,6 @@ export class WidgetSwitch extends LitElement {
|
|
|
277
277
|
</p>
|
|
278
278
|
</header>
|
|
279
279
|
|
|
280
|
-
<div class="paging no-data" ?active=${!this.dataSets.size}>No Data</div>
|
|
281
280
|
<div class="value-container">
|
|
282
281
|
${repeat(
|
|
283
282
|
[...this.dataSets.entries()].sort(),
|
|
@@ -287,7 +286,7 @@ export class WidgetSwitch extends LitElement {
|
|
|
287
286
|
<div class="switch" label="${label}">
|
|
288
287
|
${label}
|
|
289
288
|
<label
|
|
290
|
-
><
|
|
289
|
+
><mdif3-switch
|
|
291
290
|
aria-label="${label}"
|
|
292
291
|
?selected="${!!ds.selected}"
|
|
293
292
|
.actionApp="${ds?.actionApp}"
|
|
@@ -295,7 +294,7 @@ export class WidgetSwitch extends LitElement {
|
|
|
295
294
|
.actionTopic="${ds?.actionTopic}"
|
|
296
295
|
.label="${label}"
|
|
297
296
|
@change="${this.handleActionSubmit}"
|
|
298
|
-
></
|
|
297
|
+
></mdif3-switch
|
|
299
298
|
></label>
|
|
300
299
|
</div>
|
|
301
300
|
`
|