@openremote/or-rules 1.8.0-snapshot.20250725120000 → 1.8.0-snapshot.20250725123024
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/README.md +30 -30
- package/custom-elements.json +13 -13
- package/dist/umd/index.bundle.js +4744 -4744
- package/dist/umd/index.bundle.js.map +1 -1
- package/lib/flow-viewer/components/confirmation-dialog.js +24 -61
- package/lib/flow-viewer/components/connection-container.js +1 -35
- package/lib/flow-viewer/components/connection-line.js +28 -117
- package/lib/flow-viewer/components/context-menu.js +45 -140
- package/lib/flow-viewer/components/editor-workspace.js +20 -282
- package/lib/flow-viewer/components/flow-editor.js +47 -160
- package/lib/flow-viewer/components/flow-node-socket.js +31 -146
- package/lib/flow-viewer/components/flow-node.js +29 -192
- package/lib/flow-viewer/components/internal-picker.js +54 -271
- package/lib/flow-viewer/components/node-menu-item.js +32 -132
- package/lib/flow-viewer/components/node-panel.js +60 -104
- package/lib/flow-viewer/components/notification-dialog.js +23 -55
- package/lib/flow-viewer/components/popup-modal.js +54 -113
- package/lib/flow-viewer/components/rule-browser.js +30 -119
- package/lib/flow-viewer/components/selectable-element.js +1 -71
- package/lib/flow-viewer/components/selection-box.js +15 -119
- package/lib/flow-viewer/components/top-bar.js +49 -116
- package/lib/flow-viewer/components/workspace-contextmenu-options.js +5 -128
- package/lib/flow-viewer/components/writable-dropdown.js +5 -51
- package/lib/flow-viewer/converters/node-converter.js +1 -10
- package/lib/flow-viewer/flow-viewer.js +1 -19
- package/lib/flow-viewer/models/camera.js +1 -2
- package/lib/flow-viewer/models/context-menu-button.js +1 -2
- package/lib/flow-viewer/models/light-node-collection.js +1 -2
- package/lib/flow-viewer/models/status.js +1 -8
- package/lib/flow-viewer/node-structure/copy.machine.js +1 -34
- package/lib/flow-viewer/node-structure/identity.assigner.js +1 -10
- package/lib/flow-viewer/node-structure/identity.dom.link.js +1 -4
- package/lib/flow-viewer/node-structure/index.js +1 -5
- package/lib/flow-viewer/node-structure/socket.type.matcher.js +1 -50
- package/lib/flow-viewer/node-structure/utils.js +1 -109
- package/lib/flow-viewer/services/copy-paste-manager.js +1 -59
- package/lib/flow-viewer/services/exporter.js +1 -67
- package/lib/flow-viewer/services/input.js +1 -80
- package/lib/flow-viewer/services/integration.js +1 -27
- package/lib/flow-viewer/services/modal.js +8 -29
- package/lib/flow-viewer/services/project.js +1 -222
- package/lib/flow-viewer/services/shortcuts.js +1 -63
- package/lib/flow-viewer/styles/editor-workspace-style.js +53 -55
- package/lib/flow-viewer/styles/flow-node-style.js +93 -95
- package/lib/flow-viewer/styles/picker-styles.js +29 -31
- package/lib/flow-viewer/utils.js +1 -49
- package/lib/index.js +56 -953
- package/lib/json-viewer/forms/or-rule-form-alarm.js +18 -91
- package/lib/json-viewer/forms/or-rule-form-email-message.js +12 -51
- package/lib/json-viewer/forms/or-rule-form-localized.js +43 -269
- package/lib/json-viewer/forms/or-rule-form-push-notification.js +63 -152
- package/lib/json-viewer/forms/or-rule-form-webhook.js +101 -296
- package/lib/json-viewer/modals/or-rule-alarm-modal.js +17 -173
- package/lib/json-viewer/modals/or-rule-notification-modal.js +11 -196
- package/lib/json-viewer/modals/or-rule-radial-modal.js +17 -142
- package/lib/json-viewer/modals/or-rule-webhook-modal.js +8 -78
- package/lib/json-viewer/or-rule-action-alarm.js +5 -97
- package/lib/json-viewer/or-rule-action-attribute.js +33 -235
- package/lib/json-viewer/or-rule-action-notification.js +56 -465
- package/lib/json-viewer/or-rule-action-webhook.js +18 -49
- package/lib/json-viewer/or-rule-asset-query.js +126 -849
- package/lib/json-viewer/or-rule-condition.js +29 -216
- package/lib/json-viewer/or-rule-json-viewer.js +34 -393
- package/lib/json-viewer/or-rule-then-otherwise.js +113 -609
- package/lib/json-viewer/or-rule-trigger-query.js +57 -227
- package/lib/json-viewer/or-rule-when.js +126 -343
- package/lib/or-rule-group-viewer.js +12 -106
- package/lib/or-rule-text-viewer.js +22 -133
- package/lib/or-rule-tree.js +57 -601
- package/lib/or-rule-validity.js +62 -373
- package/lib/or-rule-viewer.js +81 -361
- package/lib/style.js +64 -89
- package/package.json +11 -11
|
@@ -1,152 +1,63 @@
|
|
|
1
|
-
var __decorate = (
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
<or-mwc-input .value="${message.body}"
|
|
66
|
-
@or-mwc-input-changed="${(ev) => onchange(ev, message).then(msg => this._onBodyChange(ev, msg))}"
|
|
67
|
-
.label="${i18next.t("message")}"
|
|
68
|
-
type="${InputType.TEXTAREA}"
|
|
69
|
-
required
|
|
70
|
-
placeholder=" "></or-mwc-input>
|
|
71
|
-
<or-mwc-input .value="${(_a = message.action) === null || _a === void 0 ? void 0 : _a.url}"
|
|
72
|
-
@or-mwc-input-changed="${(ev) => onchange(ev, message).then(msg => this._onActionUrlChange(ev, msg))}"
|
|
73
|
-
.label="${i18next.t("openWebsiteUrl")}"
|
|
74
|
-
type="${InputType.TEXT}"
|
|
75
|
-
placeholder=" "></or-mwc-input>
|
|
76
|
-
|
|
77
|
-
<!-- Open in browser switch -->
|
|
78
|
-
<or-mwc-input .value="${(_b = message.action) === null || _b === void 0 ? void 0 : _b.openInBrowser}"
|
|
79
|
-
@or-mwc-input-changed="${(ev) => onchange(ev, message).then(msg => this._onOpenInBrowserChange(ev, msg))}"
|
|
80
|
-
.label="${i18next.t("openInBrowser")}"
|
|
81
|
-
type="${InputType.SWITCH}"
|
|
82
|
-
fullWidth
|
|
83
|
-
placeholder=" "></or-mwc-input>
|
|
84
|
-
|
|
85
|
-
<!-- Button controls -->
|
|
86
|
-
<div style="display: flex; gap: 20px;">
|
|
87
|
-
<or-mwc-input .value="${(_d = (_c = message.buttons) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.title}"
|
|
88
|
-
@or-mwc-input-changed="${(ev) => onchange(ev, message).then(msg => this._onButtonTitleChange(ev, 0, msg))}"
|
|
89
|
-
.label="${i18next.t("buttonTextConfirm")}"
|
|
90
|
-
type="${InputType.TEXT}"
|
|
91
|
-
class="input-small"
|
|
92
|
-
placeholder=" "></or-mwc-input>
|
|
93
|
-
<or-mwc-input .value="${(_f = (_e = message.buttons) === null || _e === void 0 ? void 0 : _e[1]) === null || _f === void 0 ? void 0 : _f.title}"
|
|
94
|
-
@or-mwc-input-changed="${(ev) => onchange(ev, message).then(msg => this._onButtonTitleChange(ev, 1, msg))}"
|
|
95
|
-
.label="${i18next.t("buttonTextDecline")}"
|
|
96
|
-
type="${InputType.TEXT}"
|
|
97
|
-
class="input-small"
|
|
98
|
-
placeholder=" "></or-mwc-input>
|
|
99
|
-
</div>
|
|
100
|
-
</form>
|
|
101
|
-
`;
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* HTML callback function when the subject of a notification message has changed.
|
|
106
|
-
*/
|
|
107
|
-
_onTitleChange(ev, message) {
|
|
108
|
-
message.title = ev.detail.value;
|
|
109
|
-
this.dispatchEvent(new OrRulesJsonRuleChangedEvent());
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* HTML callback function when the body of a notification message has changed.
|
|
113
|
-
*/
|
|
114
|
-
_onBodyChange(ev, message) {
|
|
115
|
-
message.body = ev.detail.value;
|
|
116
|
-
this.dispatchEvent(new OrRulesJsonRuleChangedEvent());
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* HTML callback function when the "click here to open URL" of a notification has changed.
|
|
120
|
-
*/
|
|
121
|
-
_onActionUrlChange(ev, message) {
|
|
122
|
-
message.action = message.action || {};
|
|
123
|
-
message.action.url = ev.detail.value;
|
|
124
|
-
this.dispatchEvent(new OrRulesJsonRuleChangedEvent());
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* HTML callback function when the "open in browser switch" of a notification has changed.
|
|
128
|
-
*/
|
|
129
|
-
_onOpenInBrowserChange(ev, message) {
|
|
130
|
-
message.action = message.action || {};
|
|
131
|
-
message.action.openInBrowser = ev.detail.value;
|
|
132
|
-
this.dispatchEvent(new OrRulesJsonRuleChangedEvent());
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* HTML callback function when any button text of the notification has changed.
|
|
136
|
-
*/
|
|
137
|
-
_onButtonTitleChange(ev, key, message) {
|
|
138
|
-
message.buttons = message.buttons || [];
|
|
139
|
-
message.buttons[key] = {
|
|
140
|
-
title: ev.detail.value
|
|
141
|
-
};
|
|
142
|
-
this.dispatchEvent(new OrRulesJsonRuleChangedEvent());
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
__decorate([
|
|
146
|
-
property({ type: Object })
|
|
147
|
-
], OrRuleFormPushNotification.prototype, "message", void 0);
|
|
148
|
-
OrRuleFormPushNotification = __decorate([
|
|
149
|
-
customElement("or-rule-form-push-notification")
|
|
150
|
-
], OrRuleFormPushNotification);
|
|
151
|
-
export { OrRuleFormPushNotification };
|
|
152
|
-
//# sourceMappingURL=or-rule-form-push-notification.js.map
|
|
1
|
+
var __decorate=this&&this.__decorate||function(t,e,o,n){var i,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(i=t[l])&&(a=(r<3?i(a):r>3?i(e,o,a):i(e,o))||a);return r>3&&a&&Object.defineProperty(e,o,a),a},__awaiter=this&&this.__awaiter||function(t,e,o,n){return new(o||(o=Promise))(function(i,r){function a(t){try{c(n.next(t))}catch(t){r(t)}}function l(t){try{c(n.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?i(t.value):((e=t.value)instanceof o?e:new o(function(t){t(e)})).then(a,l)}c((n=n.apply(t,e||[])).next())})};import{html as t,LitElement as e,css as o}from"lit";import{customElement as n,property as i}from"lit/decorators.js";import"@openremote/or-mwc-components/or-mwc-input";import r from"i18next";import{translate as a}from"@openremote/or-translate";import{InputType as l}from"@openremote/or-mwc-components/or-mwc-input";import{OrRulesJsonRuleChangedEvent as c}from"../or-rule-json-viewer";import{until as u}from"lit/directives/until.js";import{when as s}from"lit/directives/when.js";let OrRuleFormPushNotification=class extends a(r)(e){static get styles(){return o`
|
|
2
|
+
.input-small {
|
|
3
|
+
min-width: auto;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
or-mwc-input {
|
|
7
|
+
margin-bottom: 20px;
|
|
8
|
+
min-width: 420px;
|
|
9
|
+
width: 100%;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.divider {
|
|
13
|
+
margin-bottom: 20px;
|
|
14
|
+
border-top: 1px solid rgba(0, 0, 0, 12%);
|
|
15
|
+
}
|
|
16
|
+
`}render(){return t`
|
|
17
|
+
${s(this.message,()=>u(this._getPushNotificationForm(this.message),t`Loading...`),()=>t`<or-translate value="errorOccurred"></or-translate>`)}
|
|
18
|
+
`}_getPushNotificationForm(e){return __awaiter(this,arguments,void 0,function*(e,o=(t,e)=>__awaiter(this,void 0,void 0,function*(){return e})){var n,i,a,c,u,s;return t`
|
|
19
|
+
<form style="display:grid">
|
|
20
|
+
<or-mwc-input .value="${e.title}"
|
|
21
|
+
@or-mwc-input-changed="${t=>o(t,e).then(e=>this._onTitleChange(t,e))}"
|
|
22
|
+
.label="${r.t("subject")}"
|
|
23
|
+
type="${l.TEXT}"
|
|
24
|
+
required
|
|
25
|
+
placeholder=" "></or-mwc-input>
|
|
26
|
+
|
|
27
|
+
<or-mwc-input .value="${e.body}"
|
|
28
|
+
@or-mwc-input-changed="${t=>o(t,e).then(e=>this._onBodyChange(t,e))}"
|
|
29
|
+
.label="${r.t("message")}"
|
|
30
|
+
type="${l.TEXTAREA}"
|
|
31
|
+
required
|
|
32
|
+
placeholder=" "></or-mwc-input>
|
|
33
|
+
<or-mwc-input .value="${null==(n=e.action)?void 0:n.url}"
|
|
34
|
+
@or-mwc-input-changed="${t=>o(t,e).then(e=>this._onActionUrlChange(t,e))}"
|
|
35
|
+
.label="${r.t("openWebsiteUrl")}"
|
|
36
|
+
type="${l.TEXT}"
|
|
37
|
+
placeholder=" "></or-mwc-input>
|
|
38
|
+
|
|
39
|
+
<!-- Open in browser switch -->
|
|
40
|
+
<or-mwc-input .value="${null==(i=e.action)?void 0:i.openInBrowser}"
|
|
41
|
+
@or-mwc-input-changed="${t=>o(t,e).then(e=>this._onOpenInBrowserChange(t,e))}"
|
|
42
|
+
.label="${r.t("openInBrowser")}"
|
|
43
|
+
type="${l.SWITCH}"
|
|
44
|
+
fullWidth
|
|
45
|
+
placeholder=" "></or-mwc-input>
|
|
46
|
+
|
|
47
|
+
<!-- Button controls -->
|
|
48
|
+
<div style="display: flex; gap: 20px;">
|
|
49
|
+
<or-mwc-input .value="${null==(c=null==(a=e.buttons)?void 0:a[0])?void 0:c.title}"
|
|
50
|
+
@or-mwc-input-changed="${t=>o(t,e).then(e=>this._onButtonTitleChange(t,0,e))}"
|
|
51
|
+
.label="${r.t("buttonTextConfirm")}"
|
|
52
|
+
type="${l.TEXT}"
|
|
53
|
+
class="input-small"
|
|
54
|
+
placeholder=" "></or-mwc-input>
|
|
55
|
+
<or-mwc-input .value="${null==(s=null==(u=e.buttons)?void 0:u[1])?void 0:s.title}"
|
|
56
|
+
@or-mwc-input-changed="${t=>o(t,e).then(e=>this._onButtonTitleChange(t,1,e))}"
|
|
57
|
+
.label="${r.t("buttonTextDecline")}"
|
|
58
|
+
type="${l.TEXT}"
|
|
59
|
+
class="input-small"
|
|
60
|
+
placeholder=" "></or-mwc-input>
|
|
61
|
+
</div>
|
|
62
|
+
</form>
|
|
63
|
+
`})}_onTitleChange(t,e){e.title=t.detail.value,this.dispatchEvent(new c)}_onBodyChange(t,e){e.body=t.detail.value,this.dispatchEvent(new c)}_onActionUrlChange(t,e){e.action=e.action||{},e.action.url=t.detail.value,this.dispatchEvent(new c)}_onOpenInBrowserChange(t,e){e.action=e.action||{},e.action.openInBrowser=t.detail.value,this.dispatchEvent(new c)}_onButtonTitleChange(t,e,o){o.buttons=o.buttons||[],o.buttons[e]={title:t.detail.value},this.dispatchEvent(new c)}};__decorate([i({type:Object})],OrRuleFormPushNotification.prototype,"message",void 0),OrRuleFormPushNotification=__decorate([n("or-rule-form-push-notification")],OrRuleFormPushNotification);export{OrRuleFormPushNotification};
|