@openremote/or-rules 1.2.0-snapshot.20240512160221

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.
Files changed (191) hide show
  1. package/README.md +31 -0
  2. package/lib/flow-viewer/components/confirmation-dialog.d.ts +18 -0
  3. package/lib/flow-viewer/components/confirmation-dialog.js +24 -0
  4. package/lib/flow-viewer/components/confirmation-dialog.js.map +1 -0
  5. package/lib/flow-viewer/components/connection-container.d.ts +6 -0
  6. package/lib/flow-viewer/components/connection-container.js +1 -0
  7. package/lib/flow-viewer/components/connection-container.js.map +1 -0
  8. package/lib/flow-viewer/components/connection-line.d.ts +22 -0
  9. package/lib/flow-viewer/components/connection-line.js +30 -0
  10. package/lib/flow-viewer/components/connection-line.js.map +1 -0
  11. package/lib/flow-viewer/components/context-menu.d.ts +28 -0
  12. package/lib/flow-viewer/components/context-menu.js +49 -0
  13. package/lib/flow-viewer/components/context-menu.js.map +1 -0
  14. package/lib/flow-viewer/components/editor-workspace.d.ts +66 -0
  15. package/lib/flow-viewer/components/editor-workspace.js +20 -0
  16. package/lib/flow-viewer/components/editor-workspace.js.map +1 -0
  17. package/lib/flow-viewer/components/flow-editor.d.ts +47 -0
  18. package/lib/flow-viewer/components/flow-editor.js +45 -0
  19. package/lib/flow-viewer/components/flow-editor.js.map +1 -0
  20. package/lib/flow-viewer/components/flow-node-socket.d.ts +31 -0
  21. package/lib/flow-viewer/components/flow-node-socket.js +36 -0
  22. package/lib/flow-viewer/components/flow-node-socket.js.map +1 -0
  23. package/lib/flow-viewer/components/flow-node.d.ts +23 -0
  24. package/lib/flow-viewer/components/flow-node.js +7 -0
  25. package/lib/flow-viewer/components/flow-node.js.map +1 -0
  26. package/lib/flow-viewer/components/internal-picker.d.ts +36 -0
  27. package/lib/flow-viewer/components/internal-picker.js +48 -0
  28. package/lib/flow-viewer/components/internal-picker.js.map +1 -0
  29. package/lib/flow-viewer/components/node-menu-item.d.ts +29 -0
  30. package/lib/flow-viewer/components/node-menu-item.js +34 -0
  31. package/lib/flow-viewer/components/node-menu-item.js.map +1 -0
  32. package/lib/flow-viewer/components/node-panel.d.ts +24 -0
  33. package/lib/flow-viewer/components/node-panel.js +60 -0
  34. package/lib/flow-viewer/components/node-panel.js.map +1 -0
  35. package/lib/flow-viewer/components/notification-dialog.d.ts +17 -0
  36. package/lib/flow-viewer/components/notification-dialog.js +23 -0
  37. package/lib/flow-viewer/components/notification-dialog.js.map +1 -0
  38. package/lib/flow-viewer/components/popup-modal.d.ts +23 -0
  39. package/lib/flow-viewer/components/popup-modal.js +55 -0
  40. package/lib/flow-viewer/components/popup-modal.js.map +1 -0
  41. package/lib/flow-viewer/components/rule-browser.d.ts +20 -0
  42. package/lib/flow-viewer/components/rule-browser.js +32 -0
  43. package/lib/flow-viewer/components/rule-browser.js.map +1 -0
  44. package/lib/flow-viewer/components/selectable-element.d.ts +23 -0
  45. package/lib/flow-viewer/components/selectable-element.js +1 -0
  46. package/lib/flow-viewer/components/selectable-element.js.map +1 -0
  47. package/lib/flow-viewer/components/selection-box.d.ts +16 -0
  48. package/lib/flow-viewer/components/selection-box.js +16 -0
  49. package/lib/flow-viewer/components/selection-box.js.map +1 -0
  50. package/lib/flow-viewer/components/top-bar.d.ts +21 -0
  51. package/lib/flow-viewer/components/top-bar.js +51 -0
  52. package/lib/flow-viewer/components/top-bar.js.map +1 -0
  53. package/lib/flow-viewer/components/workspace-contextmenu-options.d.ts +3 -0
  54. package/lib/flow-viewer/components/workspace-contextmenu-options.js +5 -0
  55. package/lib/flow-viewer/components/workspace-contextmenu-options.js.map +1 -0
  56. package/lib/flow-viewer/components/writable-dropdown.d.ts +13 -0
  57. package/lib/flow-viewer/components/writable-dropdown.js +5 -0
  58. package/lib/flow-viewer/components/writable-dropdown.js.map +1 -0
  59. package/lib/flow-viewer/converters/node-converter.d.ts +2 -0
  60. package/lib/flow-viewer/converters/node-converter.js +1 -0
  61. package/lib/flow-viewer/converters/node-converter.js.map +1 -0
  62. package/lib/flow-viewer/flow-viewer.d.ts +18 -0
  63. package/lib/flow-viewer/flow-viewer.js +1 -0
  64. package/lib/flow-viewer/flow-viewer.js.map +1 -0
  65. package/lib/flow-viewer/models/camera.d.ts +5 -0
  66. package/lib/flow-viewer/models/camera.js +1 -0
  67. package/lib/flow-viewer/models/camera.js.map +1 -0
  68. package/lib/flow-viewer/models/context-menu-button.d.ts +13 -0
  69. package/lib/flow-viewer/models/context-menu-button.js +1 -0
  70. package/lib/flow-viewer/models/context-menu-button.js.map +1 -0
  71. package/lib/flow-viewer/models/light-node-collection.d.ts +5 -0
  72. package/lib/flow-viewer/models/light-node-collection.js +1 -0
  73. package/lib/flow-viewer/models/light-node-collection.js.map +1 -0
  74. package/lib/flow-viewer/models/status.d.ts +6 -0
  75. package/lib/flow-viewer/models/status.js +1 -0
  76. package/lib/flow-viewer/models/status.js.map +1 -0
  77. package/lib/flow-viewer/node-structure/copy.machine.d.ts +4 -0
  78. package/lib/flow-viewer/node-structure/copy.machine.js +1 -0
  79. package/lib/flow-viewer/node-structure/copy.machine.js.map +1 -0
  80. package/lib/flow-viewer/node-structure/identity.assigner.d.ts +5 -0
  81. package/lib/flow-viewer/node-structure/identity.assigner.js +1 -0
  82. package/lib/flow-viewer/node-structure/identity.assigner.js.map +1 -0
  83. package/lib/flow-viewer/node-structure/identity.dom.link.d.ts +5 -0
  84. package/lib/flow-viewer/node-structure/identity.dom.link.js +1 -0
  85. package/lib/flow-viewer/node-structure/identity.dom.link.js.map +1 -0
  86. package/lib/flow-viewer/node-structure/index.d.ts +5 -0
  87. package/lib/flow-viewer/node-structure/index.js +1 -0
  88. package/lib/flow-viewer/node-structure/index.js.map +1 -0
  89. package/lib/flow-viewer/node-structure/socket.type.matcher.d.ts +5 -0
  90. package/lib/flow-viewer/node-structure/socket.type.matcher.js +1 -0
  91. package/lib/flow-viewer/node-structure/socket.type.matcher.js.map +1 -0
  92. package/lib/flow-viewer/node-structure/utils.d.ts +13 -0
  93. package/lib/flow-viewer/node-structure/utils.js +1 -0
  94. package/lib/flow-viewer/node-structure/utils.js.map +1 -0
  95. package/lib/flow-viewer/services/copy-paste-manager.d.ts +11 -0
  96. package/lib/flow-viewer/services/copy-paste-manager.js +1 -0
  97. package/lib/flow-viewer/services/copy-paste-manager.js.map +1 -0
  98. package/lib/flow-viewer/services/exporter.d.ts +9 -0
  99. package/lib/flow-viewer/services/exporter.js +1 -0
  100. package/lib/flow-viewer/services/exporter.js.map +1 -0
  101. package/lib/flow-viewer/services/input.d.ts +17 -0
  102. package/lib/flow-viewer/services/input.js +1 -0
  103. package/lib/flow-viewer/services/input.js.map +1 -0
  104. package/lib/flow-viewer/services/integration.d.ts +7 -0
  105. package/lib/flow-viewer/services/integration.js +1 -0
  106. package/lib/flow-viewer/services/integration.js.map +1 -0
  107. package/lib/flow-viewer/services/modal.d.ts +8 -0
  108. package/lib/flow-viewer/services/modal.js +8 -0
  109. package/lib/flow-viewer/services/modal.js.map +1 -0
  110. package/lib/flow-viewer/services/project.d.ts +39 -0
  111. package/lib/flow-viewer/services/project.js +1 -0
  112. package/lib/flow-viewer/services/project.js.map +1 -0
  113. package/lib/flow-viewer/services/shortcuts.d.ts +8 -0
  114. package/lib/flow-viewer/services/shortcuts.js +1 -0
  115. package/lib/flow-viewer/services/shortcuts.js.map +1 -0
  116. package/lib/flow-viewer/styles/editor-workspace-style.d.ts +1 -0
  117. package/lib/flow-viewer/styles/editor-workspace-style.js +53 -0
  118. package/lib/flow-viewer/styles/editor-workspace-style.js.map +1 -0
  119. package/lib/flow-viewer/styles/flow-node-style.d.ts +1 -0
  120. package/lib/flow-viewer/styles/flow-node-style.js +101 -0
  121. package/lib/flow-viewer/styles/flow-node-style.js.map +1 -0
  122. package/lib/flow-viewer/styles/picker-styles.d.ts +1 -0
  123. package/lib/flow-viewer/styles/picker-styles.js +25 -0
  124. package/lib/flow-viewer/styles/picker-styles.js.map +1 -0
  125. package/lib/flow-viewer/utils.d.ts +25 -0
  126. package/lib/flow-viewer/utils.js +1 -0
  127. package/lib/flow-viewer/utils.js.map +1 -0
  128. package/lib/index.d.ts +259 -0
  129. package/lib/index.js +52 -0
  130. package/lib/index.js.map +1 -0
  131. package/lib/json-viewer/forms/or-rule-form-email-message.d.ts +20 -0
  132. package/lib/json-viewer/forms/or-rule-form-email-message.js +12 -0
  133. package/lib/json-viewer/forms/or-rule-form-email-message.js.map +1 -0
  134. package/lib/json-viewer/forms/or-rule-form-push-notification.d.ts +21 -0
  135. package/lib/json-viewer/forms/or-rule-form-push-notification.js +47 -0
  136. package/lib/json-viewer/forms/or-rule-form-push-notification.js.map +1 -0
  137. package/lib/json-viewer/forms/or-rule-form-webhook.d.ts +19 -0
  138. package/lib/json-viewer/forms/or-rule-form-webhook.js +102 -0
  139. package/lib/json-viewer/forms/or-rule-form-webhook.js.map +1 -0
  140. package/lib/json-viewer/modals/or-rule-notification-modal.d.ts +24 -0
  141. package/lib/json-viewer/modals/or-rule-notification-modal.js +5 -0
  142. package/lib/json-viewer/modals/or-rule-notification-modal.js.map +1 -0
  143. package/lib/json-viewer/modals/or-rule-radial-modal.d.ts +25 -0
  144. package/lib/json-viewer/modals/or-rule-radial-modal.js +17 -0
  145. package/lib/json-viewer/modals/or-rule-radial-modal.js.map +1 -0
  146. package/lib/json-viewer/modals/or-rule-webhook-modal.d.ts +12 -0
  147. package/lib/json-viewer/modals/or-rule-webhook-modal.js +8 -0
  148. package/lib/json-viewer/modals/or-rule-webhook-modal.js.map +1 -0
  149. package/lib/json-viewer/or-rule-action-attribute.d.ts +32 -0
  150. package/lib/json-viewer/or-rule-action-attribute.js +33 -0
  151. package/lib/json-viewer/or-rule-action-attribute.js.map +1 -0
  152. package/lib/json-viewer/or-rule-action-notification.d.ts +20 -0
  153. package/lib/json-viewer/or-rule-action-notification.js +44 -0
  154. package/lib/json-viewer/or-rule-action-notification.js.map +1 -0
  155. package/lib/json-viewer/or-rule-action-webhook.d.ts +10 -0
  156. package/lib/json-viewer/or-rule-action-webhook.js +20 -0
  157. package/lib/json-viewer/or-rule-action-webhook.js.map +1 -0
  158. package/lib/json-viewer/or-rule-asset-query.d.ts +50 -0
  159. package/lib/json-viewer/or-rule-asset-query.js +98 -0
  160. package/lib/json-viewer/or-rule-asset-query.js.map +1 -0
  161. package/lib/json-viewer/or-rule-condition.d.ts +10 -0
  162. package/lib/json-viewer/or-rule-condition.js +29 -0
  163. package/lib/json-viewer/or-rule-condition.js.map +1 -0
  164. package/lib/json-viewer/or-rule-json-viewer.d.ts +54 -0
  165. package/lib/json-viewer/or-rule-json-viewer.js +34 -0
  166. package/lib/json-viewer/or-rule-json-viewer.js.map +1 -0
  167. package/lib/json-viewer/or-rule-then-otherwise.d.ts +11 -0
  168. package/lib/json-viewer/or-rule-then-otherwise.js +113 -0
  169. package/lib/json-viewer/or-rule-then-otherwise.js.map +1 -0
  170. package/lib/json-viewer/or-rule-trigger-query.d.ts +26 -0
  171. package/lib/json-viewer/or-rule-trigger-query.js +57 -0
  172. package/lib/json-viewer/or-rule-trigger-query.js.map +1 -0
  173. package/lib/json-viewer/or-rule-when.d.ts +1 -0
  174. package/lib/json-viewer/or-rule-when.js +136 -0
  175. package/lib/json-viewer/or-rule-when.js.map +1 -0
  176. package/lib/or-rule-list.d.ts +56 -0
  177. package/lib/or-rule-list.js +111 -0
  178. package/lib/or-rule-list.js.map +1 -0
  179. package/lib/or-rule-text-viewer.d.ts +27 -0
  180. package/lib/or-rule-text-viewer.js +25 -0
  181. package/lib/or-rule-text-viewer.js.map +1 -0
  182. package/lib/or-rule-validity.d.ts +34 -0
  183. package/lib/or-rule-validity.js +71 -0
  184. package/lib/or-rule-validity.js.map +1 -0
  185. package/lib/or-rule-viewer.d.ts +47 -0
  186. package/lib/or-rule-viewer.js +88 -0
  187. package/lib/or-rule-viewer.js.map +1 -0
  188. package/lib/style.d.ts +2 -0
  189. package/lib/style.js +64 -0
  190. package/lib/style.js.map +1 -0
  191. package/package.json +42 -0
@@ -0,0 +1,20 @@
1
+ import { LitElement } from "lit";
2
+ import "@openremote/or-mwc-components/or-mwc-input";
3
+ import "@openremote/or-mwc-components/or-mwc-input";
4
+ import { RuleActionNotification } from "@openremote/model";
5
+ declare const OrRuleFormEmailMessage_base: (new (...args: any[]) => {
6
+ _i18nextJustInitialized: boolean;
7
+ connectedCallback(): void;
8
+ disconnectedCallback(): void;
9
+ shouldUpdate(changedProps: import("lit").PropertyValueMap<any> | Map<PropertyKey, unknown>): any;
10
+ initCallback: (options: import("i18next").InitOptions) => void;
11
+ langChangedCallback: () => void;
12
+ readonly isConnected: boolean;
13
+ }) & typeof LitElement;
14
+ export declare class OrRuleFormEmailMessage extends OrRuleFormEmailMessage_base {
15
+ action: RuleActionNotification;
16
+ static get styles(): import("lit").CSSResult;
17
+ protected render(): import("lit-html").TemplateResult<1>;
18
+ protected setActionNotificationName(value: string | undefined, key?: string): void;
19
+ }
20
+ export {};
@@ -0,0 +1,12 @@
1
+ var __decorate=this&&this.__decorate||function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s};import{html,LitElement,css}from"lit";import{customElement,property}from"lit/decorators.js";import"@openremote/or-mwc-components/or-mwc-input";import i18next from"i18next";import{translate}from"@openremote/or-translate";import"@openremote/or-mwc-components/or-mwc-input";import{InputType}from"@openremote/or-mwc-components/or-mwc-input";import{OrRulesJsonRuleChangedEvent}from"../or-rule-json-viewer";let OrRuleFormEmailMessage=class extends(translate(i18next)(LitElement)){static get styles(){return css`
2
+ or-mwc-input {
3
+ margin-bottom: 20px;
4
+ min-width: 420px;
5
+ width: 100%;
6
+ }
7
+ `}render(){const e=this.action.notification.message;return html`
8
+ <form style="display:grid">
9
+ <or-mwc-input value="${e&&e.subject?e.subject:""}" @or-mwc-input-changed="${e=>this.setActionNotificationName(e.detail.value,"subject")}" .label="${i18next.t("subject")}" type="${InputType.TEXT}" required placeholder=" "></or-mwc-input>
10
+ <or-mwc-input value="${e&&e.html?e.html:""}" @or-mwc-input-changed="${e=>this.setActionNotificationName(e.detail.value,"html")}" .label="${i18next.t("message")}" type="${InputType.TEXTAREA}" required placeholder=" " ></or-mwc-input>
11
+ </form>
12
+ `}setActionNotificationName(e,t){if(t&&this.action.notification&&this.action.notification.message){const o=this.action.notification.message;o[t]=e,this.action.notification.message=Object.assign({},o)}this.dispatchEvent(new OrRulesJsonRuleChangedEvent),this.requestUpdate()}};__decorate([property({type:Object,attribute:!1})],OrRuleFormEmailMessage.prototype,"action",void 0),OrRuleFormEmailMessage=__decorate([customElement("or-rule-form-email-message")],OrRuleFormEmailMessage);export{OrRuleFormEmailMessage};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"or-rule-form-email-message.js","sourceRoot":"","sources":["../../../src/json-viewer/forms/or-rule-form-email-message.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAC,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC1D,OAAO,4CAA4C,CAAC;AACpD,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAC,SAAS,EAAC,MAAM,0BAA0B,CAAC;AACnD,OAAO,4CAA4C,CAAC;AACpD,OAAO,EAAC,SAAS,EAAsB,MAAM,4CAA4C,CAAC;AAK1F,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAG9D,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,SAAS,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAMtE,MAAM,KAAK,MAAM;QACb,OAAO,GAAG,CAAA;;;;;;SAMT,CAAA;IACL,CAAC;IAES,MAAM;QACZ,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EAAC,CAAC;sDACJ;AAH9B,sBAAsB;IADlC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,sBAAsB,CAqClC"}
@@ -0,0 +1,21 @@
1
+ import { LitElement } from "lit";
2
+ import "@openremote/or-mwc-components/or-mwc-input";
3
+ import "@openremote/or-mwc-components/or-mwc-input";
4
+ import { RuleActionNotification } from "@openremote/model";
5
+ declare const OrRuleFormPushNotification_base: (new (...args: any[]) => {
6
+ _i18nextJustInitialized: boolean;
7
+ connectedCallback(): void;
8
+ disconnectedCallback(): void;
9
+ shouldUpdate(changedProps: import("lit").PropertyValueMap<any> | Map<PropertyKey, unknown>): any;
10
+ initCallback: (options: import("i18next").InitOptions) => void;
11
+ langChangedCallback: () => void;
12
+ readonly isConnected: boolean;
13
+ }) & typeof LitElement;
14
+ export declare class OrRuleFormPushNotification extends OrRuleFormPushNotification_base {
15
+ action: RuleActionNotification;
16
+ static get styles(): import("lit").CSSResult;
17
+ protected updated(_changedProperties: Map<PropertyKey, unknown>): void;
18
+ protected render(): import("lit-html").TemplateResult<1>;
19
+ protected setActionNotificationName(value: string | undefined, key?: string): void;
20
+ }
21
+ export {};
@@ -0,0 +1,47 @@
1
+ var __decorate=this&&this.__decorate||function(t,e,i,o){var n,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(n=t[c])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};import{html,LitElement,css}from"lit";import{customElement,property}from"lit/decorators.js";import"@openremote/or-mwc-components/or-mwc-input";import i18next from"i18next";import{translate}from"@openremote/or-translate";import"@openremote/or-mwc-components/or-mwc-input";import{InputType}from"@openremote/or-mwc-components/or-mwc-input";import{OrRulesJsonRuleChangedEvent}from"../or-rule-json-viewer";import set from"lodash-es/set";let OrRuleFormPushNotification=class extends(translate(i18next)(LitElement)){static get styles(){return css`
2
+ or-mwc-input {
3
+ margin-bottom: 20px;
4
+ min-width: 420px;
5
+ width: 100%;
6
+ }
7
+ `}updated(t){if(t.has("action")){let t=this.action.notification.message;this.action.notification&&t&&!t.action&&(t={type:"push",action:{openInBrowser:!0}},this.action.notification.message=Object.assign(Object.assign({},this.action.notification.message),t))}}render(){const t=this.action.notification.message,e=t&&t.title?t.title:"",i=t&&t.body?t.body:"",o=t&&t.action?t.action:"",n=o&&o.url?o.url:"",r=t&&t.buttons?t.buttons:[];return html`
8
+ <form style="display:grid">
9
+ <or-mwc-input value="${e}"
10
+ @or-mwc-input-changed="${t=>this.setActionNotificationName(t.detail.value,"title")}"
11
+ .label="${i18next.t("subject")}"
12
+ type="${InputType.TEXT}"
13
+ required
14
+ placeholder=" "></or-mwc-input>
15
+
16
+ <or-mwc-input value="${i}"
17
+ @or-mwc-input-changed="${t=>this.setActionNotificationName(t.detail.value,"body")}"
18
+ .label="${i18next.t("message")}"
19
+ type="${InputType.TEXTAREA}"
20
+ required
21
+ placeholder=" " ></or-mwc-input>
22
+ <or-mwc-input value="${n}"
23
+ @or-mwc-input-changed="${t=>this.setActionNotificationName(t.detail.value,"action.url")}"
24
+ .label="${i18next.t("openWebsiteUrl")}"
25
+ type="${InputType.TEXT}"
26
+ required
27
+ placeholder=" "></or-mwc-input>
28
+
29
+ <or-mwc-input .value="${!o||void 0===o.openInBrowser||o&&o.openInBrowser}"
30
+ @or-mwc-input-changed="${t=>this.setActionNotificationName(t.detail.value,"action.openInBrowser")}"
31
+ .label="${i18next.t("openInBrowser")}"
32
+ type="${InputType.SWITCH}"
33
+ placeholder=" "></or-mwc-input>
34
+
35
+ <or-mwc-input value="${r&&r[0]&&r[0].title?r[0].title:""}"
36
+ @or-mwc-input-changed="${t=>this.setActionNotificationName(t.detail.value,"buttons.0.title")}"
37
+ .label="${i18next.t("buttonTextConfirm")}"
38
+ type="${InputType.TEXT}"
39
+ required
40
+ placeholder=" "></or-mwc-input>
41
+ <or-mwc-input value="${r&&r[1]&&r[1].title?r[1].title:""}"
42
+ @or-mwc-input-changed="${t=>this.setActionNotificationName(t.detail.value,"buttons.1.title")}"
43
+ .label="${i18next.t("buttonTextDecline")}"
44
+ type="${InputType.TEXT}"
45
+ placeholder=" "></or-mwc-input>
46
+ </form>
47
+ `}setActionNotificationName(t,e){if(e&&this.action.notification&&this.action.notification.message){let i=this.action.notification.message;set(i,e,t),e.includes("action")&&set(i,"buttons.0."+e,t),this.action.notification.message=Object.assign({},i)}this.dispatchEvent(new OrRulesJsonRuleChangedEvent),this.requestUpdate()}};__decorate([property({type:Object,attribute:!1})],OrRuleFormPushNotification.prototype,"action",void 0),OrRuleFormPushNotification=__decorate([customElement("or-rule-form-push-notification")],OrRuleFormPushNotification);export{OrRuleFormPushNotification};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"or-rule-form-push-notification.js","sourceRoot":"","sources":["../../../src/json-viewer/forms/or-rule-form-push-notification.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAC,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC1D,OAAO,4CAA4C,CAAC;AACpD,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAC,SAAS,EAAC,MAAM,0BAA0B,CAAC;AACnD,OAAO,4CAA4C,CAAC;AACpD,OAAO,EAAC,SAAS,EAAsB,MAAM,4CAA4C,CAAC;AAK1F,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,GAAG,MAAM,eAAe,CAAC;AAGzB,IAAM,0BAA0B,GAAhC,MAAM,0BAA2B,SAAQ,SAAS,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAM1E,MAAM,KAAK,MAAM;QACb,OAAO,GAAG,CAAA;;;;;;SAMT,CAAA;IACL,CAAC;IAES,OAAO,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0,0 +1,19 @@
1
+ import { OAuthGrant, Webhook } from "@openremote/model";
2
+ import { LitElement, TemplateResult } from "lit";
3
+ export declare class OrRuleFormWebhook extends LitElement {
4
+ protected webhook: Webhook;
5
+ protected loading: boolean;
6
+ private httpMethodOptions;
7
+ private authMethodOptions;
8
+ static get styles(): import("lit").CSSResult[];
9
+ shouldUpdate(changedProperties: Map<string, any>): boolean;
10
+ getAuthMethod(webhook: Webhook): string | undefined;
11
+ getOAuthGrant(authMethodKey: string): OAuthGrant | undefined;
12
+ reloadHeaders(): void;
13
+ notifyWebhookUpdate(requestUpdate?: boolean): void;
14
+ render(): TemplateResult<1>;
15
+ getHeadersTemplate(headers: {
16
+ [p: string]: string[];
17
+ }, loading: boolean): TemplateResult<1>[][];
18
+ getAuthSettingsTemplate(webhook: Webhook): TemplateResult | undefined;
19
+ }
@@ -0,0 +1,102 @@
1
+ var __decorate=this&&this.__decorate||function(e,t,o,i){var n,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,o,s):n(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s};import{InputType}from"@openremote/or-mwc-components/or-mwc-input";import{i18next}from"@openremote/or-translate";import{css,html,LitElement}from"lit";import{customElement,property,state}from"lit/decorators.js";import{when}from"lit/directives/when.js";import{OrRulesJsonRuleChangedEvent}from"../or-rule-json-viewer";const styling=css`
2
+ .divider {
3
+ border-bottom: 1px solid rgba(0, 0, 0, 12%);
4
+ }
5
+ `;let OrRuleFormWebhook=class extends LitElement{constructor(){super(...arguments),this.loading=!1,this.httpMethodOptions=["GET","POST","PUT","DELETE"],this.authMethodOptions=new Map([["username_password",i18next.t("username")+" & "+i18next.t("password")],["client_credentials","oauth Client Credentials Grant"],["password","oauth Password Grant"]])}static get styles(){return[styling]}shouldUpdate(e){return e.has("webhook")&&null==this.webhook.headers&&(this.webhook.headers={}),super.shouldUpdate(e)}getAuthMethod(e){return null!=e.oAuthGrant?this.authMethodOptions.get(e.oAuthGrant.grant_type):this.authMethodOptions.get("username_password")}getOAuthGrant(e){return"client_credentials"==e||"password"==e?{grant_type:e}:void 0}reloadHeaders(){this.loading=!0,this.updateComplete.then((()=>this.loading=!1)),this.notifyWebhookUpdate(!1)}notifyWebhookUpdate(e=!0){e&&this.requestUpdate("webhook"),this.dispatchEvent(new OrRulesJsonRuleChangedEvent)}render(){return when(!this.webhook,(()=>html`
6
+ ${i18next.t("errorOccurred")}
7
+ `),(()=>html`
8
+ <form style="display: flex; flex-direction: column; min-width: 520px;">
9
+ <!-- HTTP Method & URL -->
10
+ <div style="display: flex; flex-direction: row; align-items: center; gap: 5px; margin-bottom: 28px;">
11
+ <or-mwc-input style="flex: 0;" type="${InputType.SELECT}" .value="${this.webhook.httpMethod}"
12
+ .options="${this.httpMethodOptions}"
13
+ @or-mwc-input-changed="${e=>{this.webhook.httpMethod=e.detail.value,this.notifyWebhookUpdate()}}"
14
+ ></or-mwc-input>
15
+ <or-mwc-input style="flex: 1;" type="${InputType.URL}" required label="${i18next.t("webUrl")}"
16
+ .value="${this.webhook.url}" helperPersistent
17
+ @or-mwc-input-changed="${e=>{this.webhook.url=e.detail.value,this.notifyWebhookUpdate()}}"></or-mwc-input>
18
+ </div>
19
+ <!-- Headers -->
20
+ <div style="display: flex; flex-direction: column; gap: 5px; margin-bottom: 28px;">
21
+ <span>Headers</span>
22
+ ${when(this.loading,(()=>html`
23
+ ${this.getHeadersTemplate(this.webhook.headers,!0)}
24
+ `),(()=>html`
25
+ ${this.getHeadersTemplate(this.webhook.headers,!1)}
26
+ `))}
27
+ <or-mwc-input type="${InputType.BUTTON}" icon="plus" label="addRequestHeader"
28
+ @or-mwc-input-changed="${e=>{null!=(this.webhook.headers?this.webhook.headers[""]:void 0)?this.webhook.headers[""].push(""):this.webhook.headers[""]=[""],this.reloadHeaders()}}"></or-mwc-input>
29
+ </div>
30
+ <!-- Authorization -->
31
+ <div style="display: flex; flex-direction: column; gap: 10px; margin-bottom: ${this.webhook.oAuthGrant||this.webhook.usernamePassword?"28px":"0"};">
32
+ <or-mwc-input type="${InputType.SWITCH}" fullwidth label="${i18next.t("requiresAuthorization")}"
33
+ .value="${this.webhook.oAuthGrant||this.webhook.usernamePassword}"
34
+ @or-mwc-input-changed="${e=>{this.webhook.usernamePassword=e.detail.value?{username:"admin",password:"secret"}:void 0,this.notifyWebhookUpdate()}}"></or-mwc-input>
35
+ ${when(this.webhook.oAuthGrant||this.webhook.usernamePassword,(()=>{const e=Array.from(this.authMethodOptions.values());return html`
36
+ <or-mwc-input type="${InputType.SELECT}" label="${i18next.t("method")}"
37
+ .value="${this.getAuthMethod(this.webhook)}"
38
+ .options="${e}"
39
+ @or-mwc-input-changed="${e=>{const t=[...this.authMethodOptions.entries()].find((t=>t[1]==e.detail.value));this.webhook.oAuthGrant=this.getOAuthGrant(t[0]),this.notifyWebhookUpdate()}}"></or-mwc-input>
40
+ ${this.getAuthSettingsTemplate(this.webhook)}
41
+ `}))}
42
+ </div>
43
+ <!-- Payload -->
44
+ <div style="display: flex; flex-direction: column; gap: 5px;">
45
+ ${when("GET"!=this.webhook.httpMethod&&"DELETE"!=this.webhook.httpMethod,(()=>html`
46
+ <or-mwc-input type="${InputType.SWITCH}" fullwidth label="${i18next.t("includeBodyInRequest")}"
47
+ .value="${null!=this.webhook.payload}"
48
+ @or-mwc-input-changed="${e=>{this.webhook.payload=e.detail.value?JSON.stringify({rule:"%RULESET_NAME%",assets:"%TRIGGER_ASSETS%"},null,4):void 0,this.notifyWebhookUpdate()}}"
49
+ ></or-mwc-input>
50
+ ${when(null!=this.webhook.payload,(()=>html`
51
+ <or-mwc-input type="${InputType.TEXTAREA}" .value="${this.webhook.payload}"
52
+ @or-mwc-input-changed="${e=>{this.webhook.payload=e.detail.value,this.notifyWebhookUpdate()}}"></or-mwc-input>
53
+ `))}
54
+ `))}
55
+ </div>
56
+ </form>
57
+ `))}getHeadersTemplate(e,t){return Object.keys(this.webhook.headers).sort(((e,t)=>-e.localeCompare(t))).map(((e,o,i)=>{const n=this.webhook.headers[e];return n.map(((o,i)=>html`
58
+ <div style="display: flex; gap: 5px;">
59
+ <or-mwc-input type="${InputType.TEXT}" label="${i18next.t("header")}" value="${e}"
60
+ style="flex: 1;" .disabled="${t}"
61
+ @or-mwc-input-changed="${t=>{n.length>0?n.splice(i,1):delete this.webhook.headers[e];const r=this.webhook.headers[t.detail.value];r&&r.length>0?r.push(o):this.webhook.headers[t.detail.value]=[o],this.reloadHeaders()}}"
62
+ ></or-mwc-input>
63
+ <or-mwc-input type="${InputType.TEXT}" label="${i18next.t("value")}" value="${o}"
64
+ style="flex: 1;" .disabled="${t}"
65
+ @or-mwc-input-changed="${t=>{this.webhook.headers[e][i]=t.detail.value,this.notifyWebhookUpdate()}}"
66
+ ></or-mwc-input>
67
+ <or-mwc-input type="${InputType.BUTTON}" icon="delete" .disabled="${t}"
68
+ @or-mwc-input-changed="${()=>{n.splice(i,1),this.reloadHeaders()}}"></or-mwc-input>
69
+ </div>
70
+ `))}))}getAuthSettingsTemplate(e){var t,o;const i=e.oAuthGrant;return null==i?html`
71
+ <div style="display: flex; flex-direction: column; gap: 10px;">
72
+ <or-mwc-input type="${InputType.TEXT}" label="${i18next.t("username")}"
73
+ .value="${null===(t=e.usernamePassword)||void 0===t?void 0:t.username}"
74
+ @or-mwc-input-changed="${e=>{this.webhook.usernamePassword||(this.webhook.usernamePassword={}),this.webhook.usernamePassword.username=e.detail.value,this.notifyWebhookUpdate()}}"></or-mwc-input>
75
+ <or-mwc-input type="${InputType.TEXT}" label="${i18next.t("password")}"
76
+ .value="${null===(o=this.webhook.usernamePassword)||void 0===o?void 0:o.password}"
77
+ @or-mwc-input-changed="${e=>{this.webhook.usernamePassword||(this.webhook.usernamePassword={}),this.webhook.usernamePassword.password=e.detail.value,this.notifyWebhookUpdate()}}"></or-mwc-input>
78
+ </div>
79
+ `:html`
80
+ <div style="display: flex; flex-direction: column; gap: 10px;">
81
+ <div style="display: flex; flex-direction: row; align-items: center; gap: 5px;">
82
+ <or-mwc-input style="flex: 1;" type="${InputType.URL}" required
83
+ label="${i18next.t("tokenUrl")}" .value="${i.tokenEndpointUri}"
84
+ @or-mwc-input-changed="${e=>{i.tokenEndpointUri=e.detail.value,this.notifyWebhookUpdate()}}"></or-mwc-input>
85
+ </div>
86
+ ${when(null!=i.grant_type,(()=>{switch(i.grant_type){case"client_credentials":{const e=i;return html`
87
+ <or-mwc-input type="${InputType.TEXT}" label="${i18next.t("clientId")}"
88
+ .value="${e.client_id}"
89
+ @or-mwc-input-changed="${t=>{e.client_id=t.detail.value,this.notifyWebhookUpdate()}}"></or-mwc-input>
90
+ <or-mwc-input type="${InputType.PASSWORD}" label="${i18next.t("clientSecret")}"
91
+ .value="${e.client_secret}"
92
+ @or-mwc-input-changed="${t=>{e.client_secret=t.detail.value,this.notifyWebhookUpdate()}}"></or-mwc-input>
93
+ `}case"password":{const e=i;return html`
94
+ <or-mwc-input type="${InputType.TEXT}" label="${i18next.t("username")}"
95
+ .value="${e.username}"
96
+ @or-mwc-input-changed="${t=>{e.username=t.detail.value,this.notifyWebhookUpdate()}}"></or-mwc-input>
97
+ <or-mwc-input type="${InputType.TEXT}" label="${i18next.t("password")}"
98
+ .value="${e.password}"
99
+ @or-mwc-input-changed="${t=>{e.password=t.detail.value,this.notifyWebhookUpdate()}}"></or-mwc-input>
100
+ `}default:return html`${i18next.t("errorOccurred")}`}}))}
101
+ </div>
102
+ `}};__decorate([property({type:Object})],OrRuleFormWebhook.prototype,"webhook",void 0),__decorate([state()],OrRuleFormWebhook.prototype,"loading",void 0),OrRuleFormWebhook=__decorate([customElement("or-rule-form-webhook")],OrRuleFormWebhook);export{OrRuleFormWebhook};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"or-rule-form-webhook.js","sourceRoot":"","sources":["../../../src/json-view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K,CAAC;4BACtC,IAAI,CAAC,mBAAmB,EAAE,CAAC;wBAC/B,CAAC;iCAClB,CAAC;oBACN,CAAC;oBACD,KAAK,UAAU,CAAC,CAAC,CAAC;wBACd,MAAM,KAAK,GAAG,SAA+B,CAAC;wBAC9C,OAAO,IAAI,CAAA;0DACe,SAAS,CAAC,IAAI,YAAY,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC;4DAC7C,KAAK,CAAC,QAAQ;2EACC,CAAC,EAAuB,EAAE,EAAE;4BACjD,KAAK,CAAC,QAAQ,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;4BACjC,IAAI,CAAC,mBAAmB,EAAE,CAAC;wBAC/B,CAAC;0DACO,SAAS,CAAC,IAAI,YAAY,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC;4DAC7C,KAAK,CAAC,QAAQ;2EACC,CAAC,EAAuB,EAAE,EAAE;4BACjD,KAAK,CAAC,QAAQ,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;4BACjC,IAAI,CAAC,mBAAmB,EAAE,CAAC;wBAC/B,CAAC;iCAClB,CAAA;oBACL,CAAC;oBACD;wBACI,OAAO,IAAI,CAAA,GAAG,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE,CAAA;gBAClD,CAAC;YACL,CAAC,CAAC;;aAET,CAAA;QACL,CAAC;IACL,CAAC;CACJ,CAAA;AAnRa;IADT,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;kDACG;AAGlB;IADT,KAAK,EAAE;kDAC2B;AAN1B,iBAAiB;IAD7B,aAAa,CAAC,sBAAsB,CAAC;GACzB,iBAAiB,CAsR7B"}
@@ -0,0 +1,24 @@
1
+ import { LitElement, PropertyValues } from "lit";
2
+ import { RuleActionNotification, AssetQuery } from "@openremote/model";
3
+ import "@openremote/or-mwc-components/or-mwc-input";
4
+ declare const OrRuleNotificationModal_base: (new (...args: any[]) => {
5
+ _i18nextJustInitialized: boolean;
6
+ connectedCallback(): void;
7
+ disconnectedCallback(): void;
8
+ shouldUpdate(changedProps: import("lit").PropertyValueMap<any> | Map<PropertyKey, unknown>): any;
9
+ initCallback: (options: import("i18next").InitOptions) => void;
10
+ langChangedCallback: () => void;
11
+ readonly isConnected: boolean;
12
+ }) & typeof LitElement;
13
+ export declare class OrRuleNotificationModal extends OrRuleNotificationModal_base {
14
+ action: RuleActionNotification;
15
+ title: string;
16
+ query?: AssetQuery;
17
+ constructor();
18
+ initDialog(): void;
19
+ renderDialogHTML(action: RuleActionNotification): void;
20
+ firstUpdated(changedProperties: PropertyValues): void;
21
+ checkForm(): void;
22
+ protected render(): import("lit-html").TemplateResult<1>;
23
+ }
24
+ export {};
@@ -0,0 +1,5 @@
1
+ var __decorate=this&&this.__decorate||function(t,o,e,i){var r,n=arguments.length,c=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,o,e,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(c=(n<3?r(c):n>3?r(o,e,c):r(o,e))||c);return n>3&&c&&Object.defineProperty(o,e,c),c};import{html,LitElement}from"lit";import{customElement,property}from"lit/decorators.js";import"@openremote/or-mwc-components/or-mwc-input";import{InputType}from"@openremote/or-mwc-components/or-mwc-input";import i18next from"i18next";import{translate}from"@openremote/or-translate";import{OrMwcDialogOpenedEvent}from"@openremote/or-mwc-components/or-mwc-dialog";const checkValidity=(t,o)=>{if(t){const e=t.querySelectorAll("or-mwc-input");Array.prototype.slice.call(e).every((t=>{if(t.shadowRoot){const o=t.shadowRoot.querySelector("input, textarea, select");return!(!o||!o.checkValidity())||(t._mdcComponent.valid=!1,t._mdcComponent.helperTextContent="required",!1)}return!1}))&&o.close()}};let OrRuleNotificationModal=class extends(translate(i18next)(LitElement)){constructor(){super(),this.title="message",this.addEventListener(OrMwcDialogOpenedEvent.NAME,this.initDialog)}initDialog(){this.shadowRoot.getElementById("notification-modal")}renderDialogHTML(t){const o=this.shadowRoot.getElementById("notification-modal");if(!this.shadowRoot)return;const e=this.shadowRoot.querySelector(".notification-form-slot");if(o&&e){let t=document.createElement("div");e.assignedNodes({flatten:!0}).forEach((o=>{o instanceof HTMLElement&&t.appendChild(o)})),o.content=html`${t}`,o.dismissAction=null,this.requestUpdate()}}firstUpdated(t){t.has("action")&&this.renderDialogHTML(this.action)}checkForm(){const t=this.shadowRoot.host;if(this.shadowRoot){const o=this.shadowRoot.querySelector("or-rule-form-email-message"),e=this.shadowRoot.querySelector("or-rule-form-push-notification");if(e&&e.shadowRoot){const o=e.shadowRoot.querySelector("form");return checkValidity(o,t)}if(o&&o.shadowRoot){const e=o.shadowRoot.querySelector("form");return checkValidity(e,t)}}}render(){if(!this.action)return html``;const t=[{actionName:"cancel",content:html`<or-mwc-input class="button" .type="${InputType.BUTTON}" label="cancel"></or-mwc-input>`,action:t=>{}},{actionName:"",content:html`<or-mwc-input class="button" .type="${InputType.BUTTON}" label="ok" @or-mwc-input-changed="${this.checkForm}"></or-mwc-input>`}];return html`
2
+ <or-mwc-input .type="${InputType.BUTTON}" label="message" @or-mwc-input-changed="${()=>{const t=this.shadowRoot.getElementById("notification-modal");t&&t.open()}}"></or-mwc-input>
3
+ <or-mwc-dialog id="notification-modal" heading="${this.title}" .actions="${t}"></or-mwc-dialog>
4
+ <slot class="notification-form-slot"></slot>
5
+ `}};__decorate([property({type:Object,attribute:!1})],OrRuleNotificationModal.prototype,"action",void 0),__decorate([property({type:String})],OrRuleNotificationModal.prototype,"title",void 0),__decorate([property({type:Object})],OrRuleNotificationModal.prototype,"query",void 0),OrRuleNotificationModal=__decorate([customElement("or-rule-notification-modal")],OrRuleNotificationModal);export{OrRuleNotificationModal};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"or-rule-notification-modal.js","sourceRoot":"","sources":["../../../src/json-viewer/modals/or-rule-notification-modal.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,IAAI,EAAE,UAAU,E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GAAG,GAAG,EAAE;YACrC,MAAM,MAAM,GAAgB,IAAI,CAAC,UAAW,CAAC,cAAc,CAAC,oBAAoB,CAAgB,CAAC;YACjG,IAAI,MAAM,EAAE,CAAC;gBACT,MAAM,CAAC,IAAI,EAAE,CAAC;YAClB,CAAC;QACL,CAAC,CAAC;QAEF,OAAO,IAAI,CAAA;mCACgB,SAAS,CAAC,MAAM,4CAA4C,2BAA2B;8DAC5D,IAAI,CAAC,KAAK,eAAe,8BAA8B;;SAE5G,CAAA;IACL,CAAC;CACJ,CAAA;AA3FU;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAC,CAAC;uDACJ;AAGhC;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;sDACA;AAGlB;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;sDACC;AATjB,uBAAuB;IADnC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,uBAAuB,CA8FnC"}
@@ -0,0 +1,25 @@
1
+ import { LitElement } from "lit";
2
+ import { AssetDescriptor, AttributePredicate, AssetQuery, RadialGeofencePredicate } from "@openremote/model";
3
+ import "@openremote/or-mwc-components/or-mwc-input";
4
+ import "@openremote/or-map";
5
+ declare const OrRuleRadialModal_base: (new (...args: any[]) => {
6
+ _i18nextJustInitialized: boolean;
7
+ connectedCallback(): void;
8
+ disconnectedCallback(): void;
9
+ shouldUpdate(changedProps: import("lit").PropertyValueMap<any> | Map<PropertyKey, unknown>): any;
10
+ initCallback: (options: import("i18next").InitOptions) => void;
11
+ langChangedCallback: () => void;
12
+ readonly isConnected: boolean;
13
+ }) & typeof LitElement;
14
+ export declare class OrRuleRadialModal extends OrRuleRadialModal_base {
15
+ assetDescriptor?: AssetDescriptor;
16
+ attributePredicate?: AttributePredicate;
17
+ query?: AssetQuery;
18
+ constructor();
19
+ initRadialMap(): void;
20
+ protected getAttributeName(attributePredicate: AttributePredicate): string | undefined;
21
+ protected setValuePredicateProperty(propertyName: string, value: any): void;
22
+ renderDialogHTML(value: RadialGeofencePredicate): void;
23
+ protected render(): import("lit-html").TemplateResult<1>;
24
+ }
25
+ export {};
@@ -0,0 +1,17 @@
1
+ var __decorate=this&&this.__decorate||function(e,t,r,o){var a,i=arguments.length,l=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,o);else for(var n=e.length-1;n>=0;n--)(a=e[n])&&(l=(i<3?a(l):i>3?a(t,r,l):a(t,r))||l);return i>3&&l&&Object.defineProperty(t,r,l),l};import{html,LitElement}from"lit";import{customElement,property}from"lit/decorators.js";import{getAssetTypeFromQuery}from"../../index";import"@openremote/or-mwc-components/or-mwc-input";import{InputType}from"@openremote/or-mwc-components/or-mwc-input";import i18next from"i18next";import{OrRulesJsonRuleChangedEvent}from"../or-rule-json-viewer";import{translate}from"@openremote/or-translate";import{OrMwcDialogOpenedEvent}from"@openremote/or-mwc-components/or-mwc-dialog";import{OrMapClickedEvent}from"@openremote/or-map";import"@openremote/or-map";let OrRuleRadialModal=class extends(translate(i18next)(LitElement)){constructor(){super(),this.addEventListener(OrMwcDialogOpenedEvent.NAME,this.initRadialMap)}initRadialMap(){const e=this.shadowRoot.getElementById("radial-modal");if(!e)return;const t=e.shadowRoot.querySelector(".or-map");if(t){t.addEventListener(OrMapClickedEvent.NAME,(t=>{const r=t.detail.lngLat,o=e.shadowRoot.querySelector(".location-lat"),a=e.shadowRoot.querySelector(".location-lng");o.value=r.lat,a.value=r.lng;const i=new Event("change");o.dispatchEvent(i),a.dispatchEvent(i),this.setValuePredicateProperty("lat",r.lat),this.setValuePredicateProperty("lng",r.lng)}));const r=e.shadowRoot.querySelector(".location-lat"),o=e.shadowRoot.querySelector(".location-lng");if(o.value&&r.value){const e=[parseFloat(o.value),parseFloat(r.value)];t.flyTo(e,15)}else t.flyTo()}}getAttributeName(e){return e&&e.name?e.name.value:void 0}setValuePredicateProperty(e,t){this.attributePredicate&&this.attributePredicate.value&&(this.attributePredicate.value[e]=t,this.attributePredicate=Object.assign({},this.attributePredicate),this.dispatchEvent(new OrRulesJsonRuleChangedEvent),this.requestUpdate())}renderDialogHTML(e){const t=this.shadowRoot.getElementById("radial-modal");t&&(t.content=html`
2
+ <div style="display:grid">
3
+ <or-map class="or-map" type="VECTOR" style="border: 1px solid #d5d5d5; height: 400px; min-width: 300px; margin-bottom: 20px;">
4
+ <or-map-marker active color="#FF0000" icon="information" lat="${e.lat}" lng="${e.lng}" radius="${e.radius}"></or-map-marker>
5
+ </or-map>
6
+
7
+ <div class="layout horizontal">
8
+ <input hidden class="location-lng" required placeholder=" " type="text" .value="${e&&e.lng?e.lng:null}" />
9
+ <input hidden class="location-lat" required placeholder=" " type="text" .value="${e&&e.lat?e.lat:null}" />
10
+ </div>
11
+
12
+ <label>${i18next.t("radiusMin")}</label>
13
+ <input @change="${e=>this.setValuePredicateProperty("radius",parseInt(e.target.value))}" style="max-width: calc(50% - 30px);" required placeholder=" " min="100" type="number" .value="${e&&e.radius?e.radius:100}" />
14
+ </div>`)}render(){if(!this.attributePredicate)return html``;if(!this.query)return html``;const e=this.attributePredicate.value;if(!this.assetDescriptor||!e)return html``;this.getAttributeName(this.attributePredicate),getAssetTypeFromQuery(this.query);const t=e||void 0,r=[{actionName:"cancel",content:html`<or-mwc-input class="button" .type="${InputType.BUTTON}" label="cancel"></or-mwc-input>`,action:()=>{}},{actionName:"ok",default:!0,content:html`<or-mwc-input class="button" .type="${InputType.BUTTON}" label="ok"></or-mwc-input>`,action:()=>{}}];return this.renderDialogHTML(t),html`
15
+ <or-mwc-input .type="${InputType.BUTTON}" label="area" @or-mwc-input-changed="${()=>{const e=this.shadowRoot.getElementById("radial-modal");e&&(e.dismissAction=null,e.open(),this.renderDialogHTML(t))}}"></or-mwc-input>
16
+ <or-mwc-dialog id="radial-modal" heading="area" .actions="${r}"></or-mwc-dialog>
17
+ `}};__decorate([property({type:Object})],OrRuleRadialModal.prototype,"assetDescriptor",void 0),__decorate([property({type:Object})],OrRuleRadialModal.prototype,"attributePredicate",void 0),__decorate([property({type:Object})],OrRuleRadialModal.prototype,"query",void 0),OrRuleRadialModal=__decorate([customElement("or-rule-radial-modal")],OrRuleRadialModal);export{OrRuleRadialModal};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"or-rule-radial-modal.js","sourceRoot":"","sources":["../../../src/json-viewer/modals/or-rule-radial-modal.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAO1D,OAAO,EACH,qBAAqB,GACxB,MAAM,aAAa,CAAC;AACrB,OAAO,4CAA4C,CAAC;AACpD,OAAO,EAAC,SAAS,EAAC,MAAM,4CAA4C,CAAC;AACrE,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAC,2BAA2B,EAAC,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAC,SAAS,EAAC,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAA4B,sBAAsB,EAAC,MAAM,6CAA6C,CAAC;AAC9G,OAAO,EAAQ,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AAC5D,OAAO,oBAAoB,CAAC;AAIrB,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,SAAS,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAYjE;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;IAC1E,CAAC;IAED,aAAa;QACT,MAAM,KAAK,GAAG,IAAI,CAAC,UAAW,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;QAC9D,IAAI,CAAC,KAAK;YAAE,OAAO;QAEnB,MAAM,GAAG,GA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AM,qBAAqB,GAAG,GAAG,EAAE;YAC/B,MAAM,MAAM,GAAgB,IAAI,CAAC,UAAW,CAAC,cAAc,CAAC,cAAc,CAAgB,CAAC;YAC3F,IAAI,MAAM,EAAE,CAAC;gBACT,MAAM,CAAC,aAAa,GAAG,IAAI,CAAC;gBAC5B,MAAM,CAAC,IAAI,EAAE,CAAC;gBACd,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;YAEjC,CAAC;QACL,CAAC,CAAC;QAEF,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAE7B,OAAO,IAAI,CAAA;mCACgB,SAAS,CAAC,MAAM,yCAAyC,qBAAqB;wEACzC,wBAAwB;SACvF,CAAA;IACL,CAAC;CACJ,CAAA;AAnIU;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;0DACgB;AAGlC;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;6DACsB;AAIxC;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;gDACC;AAVjB,iBAAiB;IAD7B,aAAa,CAAC,sBAAsB,CAAC;GACzB,iBAAiB,CAsI7B"}
@@ -0,0 +1,12 @@
1
+ import { RuleActionWebhook } from "@openremote/model";
2
+ import { OrInputChangedEvent } from "@openremote/or-mwc-components/or-mwc-input";
3
+ import { LitElement, PropertyValues } from "lit";
4
+ export declare class OrRuleWebhookModal extends LitElement {
5
+ protected action: RuleActionWebhook;
6
+ title: string;
7
+ constructor();
8
+ firstUpdated(changedProperties: PropertyValues): void;
9
+ renderDialogHTML(action: RuleActionWebhook): void;
10
+ closeForm(event: OrInputChangedEvent): void;
11
+ render(): import("lit-html").TemplateResult<1>;
12
+ }
@@ -0,0 +1,8 @@
1
+ var __decorate=this&&this.__decorate||function(e,t,o,r){var n,l=arguments.length,i=l<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(i=(l<3?n(i):l>3?n(t,o,i):n(t,o))||i);return l>3&&i&&Object.defineProperty(t,o,i),i};import{InputType}from"@openremote/or-mwc-components/or-mwc-input";import{i18next}from"@openremote/or-translate";import{html,LitElement}from"lit";import{customElement,property}from"lit/decorators.js";let OrRuleWebhookModal=class extends LitElement{constructor(){super(),this.title=i18next.t("message")}firstUpdated(e){e.has("action")&&this.renderDialogHTML(this.action)}renderDialogHTML(e){const t=this.shadowRoot.getElementById("webhook-modal");if(!this.shadowRoot)return;const o=this.shadowRoot.querySelector(".webhook-form-slot");if(t&&o){let e=document.createElement("div");o.assignedNodes({flatten:!0}).forEach((t=>{t instanceof HTMLElement&&e.appendChild(t)})),t.content=html`${e}`,t.dismissAction=null,this.requestUpdate()}}closeForm(e){this.shadowRoot.host.close()}render(){if(!this.action)return html`${i18next.t("errorOccurred")}`;const e=[{actionName:"",content:html`
2
+ <or-mwc-input .type="${InputType.BUTTON}" label="ok"
3
+ @or-mwc-input-changed="${this.closeForm}"></or-mwc-input>`}];return html`
4
+ <or-mwc-input type="${InputType.BUTTON}" label="message"
5
+ @or-mwc-input-changed="${()=>{const e=this.shadowRoot.getElementById("webhook-modal");e&&e.open()}}"></or-mwc-input>
6
+ <or-mwc-dialog id="webhook-modal" heading="${this.title}" .actions="${e}"></or-mwc-dialog>
7
+ <slot class="webhook-form-slot"></slot>
8
+ `}};__decorate([property({type:Object})],OrRuleWebhookModal.prototype,"action",void 0),__decorate([property({type:String})],OrRuleWebhookModal.prototype,"title",void 0),OrRuleWebhookModal=__decorate([customElement("or-rule-webhook-modal")],OrRuleWebhookModal);export{OrRuleWebhookModal};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"or-rule-webhook-modal.js","sourceRoot":"","sources":["../../../src/json-viewer/modals/or-rule-webhook-modal.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAC,SAAS,EAAsB,MAA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AI,CAAC;YAC5B,IAAI,CAAC,aAAa,EAAE,CAAC;QACzB,CAAC;IACL,CAAC;IAED,SAAS,CAAC,KAA0B;QAChC,MAAM,MAAM,GAAgB,IAAI,CAAC,UAAW,CAAC,IAAmB,CAAC;QACjE,MAAM,CAAC,KAAK,EAAE,CAAC;IACnB,CAAC;IAED,MAAM;QACF,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACf,OAAO,IAAI,CAAA,GAAG,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE,CAAC;QAC/C,CAAC;QACD,MAAM,mBAAmB,GAAmB;YACxC;gBACI,UAAU,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,CAAA;2CACF,SAAS,CAAC,MAAM;2DACA,IAAI,CAAC,SAAS,mBAAmB;aAC/E;SACJ,CAAC;QACF,MAAM,gBAAgB,GAAG,GAAG,EAAE;YAC1B,MAAM,MAAM,GAAgB,IAAI,CAAC,UAAW,CAAC,cAAc,CAAC,eAAe,CAAgB,CAAC;YAC5F,IAAI,MAAM,EAAE,CAAC;gBACT,MAAM,CAAC,IAAI,EAAE,CAAC;YAClB,CAAC;QACL,CAAC,CAAC;QACF,OAAO,IAAI,CAAA;kCACe,SAAS,CAAC,MAAM;mDACC,gBAAgB;yDACV,IAAI,CAAC,KAAK,eAAe,mBAAmB;;SAE5F,CAAA;IACL,CAAC;CAEJ,CAAA;AAjEa;IADT,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;kDACY;AAG9B;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;iDACmB;AANnC,kBAAkB;IAD9B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,kBAAkB,CAoE9B"}
@@ -0,0 +1,32 @@
1
+ import { LitElement, PropertyValues, TemplateResult } from "lit";
2
+ import { RulesConfig } from "../index";
3
+ import { Asset, AssetTypeInfo, RuleActionUpdateAttribute, RuleActionWriteAttribute } from "@openremote/model";
4
+ import "@openremote/or-attribute-input";
5
+ declare const OrRuleActionAttribute_base: (new (...args: any[]) => {
6
+ _i18nextJustInitialized: boolean;
7
+ connectedCallback(): void;
8
+ disconnectedCallback(): void;
9
+ shouldUpdate(changedProps: import("lit").PropertyValueMap<any> | Map<PropertyKey, unknown>): any;
10
+ initCallback: (options: import("i18next").InitOptions) => void;
11
+ langChangedCallback: () => void;
12
+ readonly isConnected: boolean;
13
+ }) & typeof LitElement;
14
+ export declare class OrRuleActionAttribute extends OrRuleActionAttribute_base {
15
+ static get styles(): import("lit").CSSResult;
16
+ action: RuleActionWriteAttribute | RuleActionUpdateAttribute;
17
+ targetTypeMap?: [string, string?][];
18
+ readonly?: boolean;
19
+ config?: RulesConfig;
20
+ assetInfos?: AssetTypeInfo[];
21
+ assetProvider: (type: string) => Promise<Asset[] | undefined>;
22
+ protected _assets?: Asset[];
23
+ shouldUpdate(_changedProperties: PropertyValues): boolean;
24
+ refresh(): void;
25
+ protected _getAssetType(): string | undefined;
26
+ protected render(): TemplateResult<1>;
27
+ protected set _assetId(assetId: string);
28
+ protected setActionAttributeName(name: string | undefined): void;
29
+ protected setActionAttributeValue(value: any): void;
30
+ protected loadAssets(type: string): void;
31
+ }
32
+ export {};
@@ -0,0 +1,33 @@
1
+ var __decorate=this&&this.__decorate||function(t,e,i,s){var r,o=arguments.length,a=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var n=t.length-1;n>=0;n--)(r=t[n])&&(a=(o<3?r(a):o>3?r(e,i,a):r(e,i))||a);return o>3&&a&&Object.defineProperty(e,i,a),a},__awaiter=this&&this.__awaiter||function(t,e,i,s){return new(i||(i=Promise))((function(r,o){function a(t){try{u(s.next(t))}catch(t){o(t)}}function n(t){try{u(s.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,n)}u((s=s.apply(t,e||[])).next())}))};import{css,html,LitElement}from"lit";import{customElement,property}from"lit/decorators.js";import{getAssetIdsFromQuery,getAssetTypeFromQuery}from"../index";import{AssetModelUtil}from"@openremote/model";import{Util}from"@openremote/core";import"@openremote/or-attribute-input";import{InputType}from"@openremote/or-mwc-components/or-mwc-input";import i18next from"i18next";import{OrRulesJsonRuleChangedEvent}from"./or-rule-json-viewer";import{translate}from"@openremote/or-translate";import{ifDefined}from"lit/directives/if-defined.js";import{when}from"lit/directives/when.js";const style=css`
2
+ :host {
3
+ display: flex;
4
+ align-items: center;
5
+
6
+ flex-wrap: wrap;
7
+ }
8
+
9
+ :host > * {
10
+ margin: 0 3px 6px;
11
+ }
12
+
13
+ .min-width {
14
+ min-width: 200px;
15
+ }
16
+ `;let OrRuleActionAttribute=class extends(translate(i18next)(LitElement)){static get styles(){return style}shouldUpdate(t){return t.has("action")&&(this._assets=void 0),super.shouldUpdate(t)}refresh(){this._assets=void 0}_getAssetType(){if(!this.action.target)return;const t=this.action.target.assets?this.action.target.assets:this.action.target.matchedAssets?this.action.target.matchedAssets:void 0;return t?getAssetTypeFromQuery(t):void 0}render(){if(!this.action.target)return html``;const t=this._getAssetType();if(!t)return html``;const e=this.action.target.assets?this.action.target.assets:this.action.target.matchedAssets?this.action.target.matchedAssets:void 0,i=this.assetInfos?this.assetInfos.find((e=>e.assetDescriptor.name===t)):void 0;if(!i)return html``;this._assets||this.loadAssets(t);const s=getAssetIdsFromQuery(e),r=s&&s.length>0?s[0]:"*",o=[["*",i18next.t("matched")]];let a;return html`
17
+
18
+ <!-- Show SELECT input with 'loading' until the assets are retrieved -->
19
+ ${when(!this._assets,(()=>html`
20
+ <or-mwc-input id="matchSelect" class="min-width" type="${InputType.SELECT}" .readonly="${!0}" .label="${i18next.t("loading")}"></or-mwc-input>
21
+ `),(()=>{var e,s,n;this._assets.length<=25?o.push(...this._assets.map((t=>[t.id,t.name]))):a=t=>__awaiter(this,void 0,void 0,(function*(){var e;if(t)return this._assets.filter((e=>{var i;return null===(i=e.name)||void 0===i?void 0:i.toLowerCase().includes(t.toLowerCase())})).map((t=>[t.id,t.name]));if(this._assets.length<=100)return o.push(...this._assets.map((t=>[t.id,t.name]))),o;{const t=null===(e=this._assets)||void 0===e?void 0:e.find((t=>t.id==r));return t&&null==o.find((([e,i])=>e==t.id))&&o.push([t.id,t.name]),o}}));const u=r&&"*"!==r?this._assets.find((t=>t.id===r)):void 0,l=AssetModelUtil.getAttributeAndValueDescriptors(t,this.action.attributeName,u&&u.attributes&&this.action.attributeName?u.attributes[this.action.attributeName]:void 0);let c,p=[];if(u&&u.attributes)p=Object.values(u.attributes).map((e=>{const i=Util.getAttributeLabel(e,l[0],t,!1);return[e.name,i]}));else if(i){const e=AssetModelUtil.getAssetTypeInfo(i);p=e&&e.attributeDescriptors?e.attributeDescriptors.map((e=>{const i=Util.getAttributeLabel(e,l[0],t,!1);return[e.name,i]})):[]}if(p.sort(Util.sortByString((t=>t[1]))),this.action.attributeName){const i=l[1]&&"boolean"===l[1].name?"":i18next.t("value");let r;(null===(s=null===(e=l[0])||void 0===e?void 0:e.format)||void 0===s?void 0:s.asSlider)&&(r=InputType.NUMBER),c=html`<or-attribute-input ?compact=${l[1]&&"GEO_JSONPoint"===l[1].name} .inputType="${ifDefined(r)}" @or-attribute-input-changed="${t=>this.setActionAttributeValue(t.detail.value)}" .customProvider="${null===(n=this.config)||void 0===n?void 0:n.inputProvider}" .label="${i}" .assetType="${t}" .attributeDescriptor="${l[0]}" .attributeValueDescriptor="${l[1]}" .value="${this.action.value}" .readonly="${this.readonly||!1}"></or-attribute-input>`}return html`
22
+ <or-mwc-input id="matchSelect" class="min-width" .label="${i18next.t("asset")}" .type="${InputType.SELECT}"
23
+ .options="${o}" .searchProvider="${a}" .value="${r}" .readonly="${this.readonly||!1}"
24
+ @or-mwc-input-changed="${t=>{this._assetId=t.detail.value,this.refresh()}}"
25
+ ></or-mwc-input>
26
+ ${p.length>0?html`
27
+ <or-mwc-input id="attributeSelect" class="min-width" .label="${i18next.t("attribute")}" .type="${InputType.SELECT}" @or-mwc-input-changed="${t=>this.setActionAttributeName(t.detail.value)}" .readonly="${this.readonly||!1}" ?searchable="${p.length>=25}" .options="${p}" .value="${this.action.attributeName}"></or-mwc-input>
28
+ ${c}
29
+ `:html`
30
+ <or-translate value="No attributes with write permission"></or-translate>
31
+ `}
32
+ `}))}
33
+ `}set _assetId(t){const e=this._getAssetType();"*"===t?(this.action.target.assets=void 0,this.action.target={matchedAssets:{types:[e||""]}}):(this.action.target.matchedAssets=void 0,this.action.target={assets:{ids:[t],types:[e||""]}}),this.dispatchEvent(new OrRulesJsonRuleChangedEvent),this.requestUpdate()}setActionAttributeName(t){this.action.attributeName=t,this.action.value=void 0,this.dispatchEvent(new OrRulesJsonRuleChangedEvent),this.requestUpdate()}setActionAttributeValue(t){this.action.value=t,this.dispatchEvent(new OrRulesJsonRuleChangedEvent),this.requestUpdate()}loadAssets(t){this.assetProvider(t).then((t=>{this._assets=t}))}};__decorate([property({type:Object,attribute:!1})],OrRuleActionAttribute.prototype,"action",void 0),__decorate([property({type:Object,attribute:!1})],OrRuleActionAttribute.prototype,"targetTypeMap",void 0),__decorate([property({type:Object})],OrRuleActionAttribute.prototype,"config",void 0),__decorate([property({type:Object})],OrRuleActionAttribute.prototype,"assetInfos",void 0),__decorate([property({type:Object})],OrRuleActionAttribute.prototype,"assetProvider",void 0),__decorate([property({type:Array,attribute:!1})],OrRuleActionAttribute.prototype,"_assets",void 0),OrRuleActionAttribute=__decorate([customElement("or-rule-action-attribute")],OrRuleActionAttribute);export{OrRuleActionAttribute};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"or-rule-action-attribute.js","sourceRoot":"","sources":["../../src/json-viewer/or-rule-action-attribute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAC,GAAG,EAAE,IAAI,EAAE,UAAU,EAAiC,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAC,aAAa,EAAE,QAA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CAAC;QACjC,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC;QAC9B,IAAI,CAAC,aAAa,CAAC,IAAI,2BAA2B,EAAE,CAAC,CAAC;QACtD,IAAI,CAAC,aAAa,EAAE,CAAC;IACzB,CAAC;IAES,uBAAuB,CAAC,KAAU;QACxC,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,aAAa,CAAC,IAAI,2BAA2B,EAAE,CAAC,CAAC;QACtD,IAAI,CAAC,aAAa,EAAE,CAAC;IACzB,CAAC;IAES,UAAU,CAAC,IAAY;QAC7B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YACnC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAC1B,CAAC,CAAC,CAAA;IACN,CAAC;CACJ,CAAA;AAvMU;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAC,CAAC;qDAC0B;AAG9D;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAC,CAAC;4DACA;AAKpC;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;qDACG;AAGrB;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;yDACW;AAG7B;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;4DAC4C;AAG3D;IADT,QAAQ,CAAC,EAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAC,CAAC;sDACd;AAxBnB,qBAAqB;IADjC,aAAa,CAAC,0BAA0B,CAAC;GAC7B,qBAAqB,CA8MjC"}
@@ -0,0 +1,20 @@
1
+ import { LitElement, TemplateResult } from "lit";
2
+ import { ActionType, RulesConfig } from "../index";
3
+ import { AssetQuery, AssetTypeInfo, JsonRule, RuleAction, RuleActionNotification, NotificationTargetType } from "@openremote/model";
4
+ import "./modals/or-rule-notification-modal";
5
+ import "./forms/or-rule-form-email-message";
6
+ import "./forms/or-rule-form-push-notification";
7
+ import "./or-rule-action-attribute";
8
+ export declare class OrRuleActionNotification extends LitElement {
9
+ static get styles(): import("lit").CSSResult;
10
+ rule: JsonRule;
11
+ action: RuleActionNotification;
12
+ actionType: ActionType;
13
+ readonly?: boolean;
14
+ assetInfos?: AssetTypeInfo[];
15
+ config?: RulesConfig;
16
+ protected static getActionTargetTemplate(targetTypeMap: [string, string?][], action: RuleAction, actionType: ActionType, readonly: boolean, config: RulesConfig | undefined, baseAssetQuery: AssetQuery | undefined, onTargetTypeChangedCallback: (type: NotificationTargetType) => void, onTargetChangedCallback: (type: NotificationTargetType, value: string | undefined) => void): PromiseLike<TemplateResult> | undefined;
17
+ protected render(): TemplateResult<1> | "";
18
+ protected _onTargetTypeChanged(targetType: NotificationTargetType): void;
19
+ protected _onTargetChanged(targetType: NotificationTargetType, value: string | undefined): void;
20
+ }