@openremote/or-rules 1.11.0-snapshot.20251103144513 → 1.11.0

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.
@@ -0,0 +1,402 @@
1
+
2
+ import type { buttonStyle, RuleViewInfoMap, getAssetTypeFromQuery, getAssetIdsFromQuery, getAssetTypes, getAssetInfos, getAssetsByType, OrRulesRuleChangedEvent, OrRulesRuleUnsupportedEvent, OrRulesRequestSelectionEvent, OrRulesSelectionEvent, OrRulesRequestAddEvent, OrRulesRequestGroupEvent, OrRulesAddEvent, OrRulesRequestDeleteEvent, OrRulesRequestSaveEvent, OrRulesSaveEvent, OrRulesDeleteEvent, OrRulesGroupNameChangeEvent, style, OrRules } from "./lib/index.d.ts";
3
+ import type { OrRuleGroupViewer } from "./lib/or-rule-group-viewer.d.ts";
4
+ import type { OrRuleTextViewer } from "./lib/or-rule-text-viewer.d.ts";
5
+ import type { OrRuleTree } from "./lib/or-rule-tree.d.ts";
6
+ import type { OrRuleValidity } from "./lib/or-rule-validity.d.ts";
7
+ import type { OrRuleViewer } from "./lib/or-rule-viewer.d.ts";
8
+
9
+ /**
10
+ * This type can be used to create scoped tags for your components.
11
+ *
12
+ * Usage:
13
+ *
14
+ * ```ts
15
+ * import type { ScopedElements } from "path/to/library/jsx-integration";
16
+ *
17
+ * declare module "my-library" {
18
+ * namespace JSX {
19
+ * interface IntrinsicElements
20
+ * extends ScopedElements<'test-', ''> {}
21
+ * }
22
+ * }
23
+ * ```
24
+ *
25
+ * @deprecated Runtime scoped elements result in duplicate types and can confusing for developers. It is recommended to use the `prefix` and `suffix` options to generate new types instead.
26
+ */
27
+ export type ScopedElements<
28
+ Prefix extends string = "",
29
+ Suffix extends string = ""
30
+ > = {
31
+ [Key in keyof CustomElements as `${Prefix}${Key}${Suffix}`]: CustomElements[Key];
32
+ };
33
+
34
+ type BaseProps<T extends HTMLElement> = {
35
+
36
+ /** Content added between the opening and closing tags of the element */
37
+ children?: any;
38
+ /** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
39
+ class?: string;
40
+ /** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
41
+ className?: string;
42
+ /** Takes an object where the key is the class name(s) and the value is a boolean expression. When true, the class is applied, and when false, it is removed. */
43
+ classList?: Record<string, boolean | undefined>;
44
+ /** Specifies the text direction of the element. */
45
+ dir?: "ltr" | "rtl";
46
+ /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
47
+ exportparts?: string;
48
+ /** For <label> and <output>, lets you associate the label with some control. */
49
+ htmlFor?: string;
50
+ /** Specifies whether the element should be hidden. */
51
+ hidden?: boolean | string;
52
+ /** A unique identifier for the element. */
53
+ id?: string;
54
+ /** Keys tell React which array item each component corresponds to */
55
+ key?: string | number;
56
+ /** Specifies the language of the element. */
57
+ lang?: string;
58
+ /** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
59
+ part?: string;
60
+ /** Use the ref attribute with a variable to assign a DOM element to the variable once the element is rendered. */
61
+ ref?: T | ((e: T) => void);
62
+ /** Adds a reference for a custom element slot */
63
+ slot?: string;
64
+ /** Prop for setting inline styles */
65
+ style?: Record<string, string | number>;
66
+ /** Overrides the default Tab button behavior. Avoid using values other than -1 and 0. */
67
+ tabIndex?: number;
68
+ /** Specifies the tooltip text for the element. */
69
+ title?: string;
70
+ /** Passing 'no' excludes the element content from being translated. */
71
+ translate?: "yes" | "no";
72
+ /** The popover global attribute is used to designate an element as a popover element. */
73
+ popover?: "auto" | "hint" | "manual";
74
+ /** Turns an element element into a popover control button; takes the ID of the popover element to control as its value. */
75
+ popovertarget?: "top" | "bottom" | "left" | "right" | "auto";
76
+ /** Specifies the action to be performed on a popover element being controlled by a control element. */
77
+ popovertargetaction?: "show" | "hide" | "toggle";
78
+
79
+ } ;
80
+
81
+ type BaseEvents = {
82
+
83
+
84
+ };
85
+
86
+
87
+
88
+ export type OrRulesProps = {
89
+ /** */
90
+ "readonly"?: OrRules['readonly'];
91
+ /** */
92
+ "config"?: OrRules['config'];
93
+ /** */
94
+ "realm"?: OrRules['realm'];
95
+ /** */
96
+ "language"?: OrRules['language'];
97
+
98
+
99
+ }
100
+
101
+
102
+ export type OrRuleGroupViewerProps = {
103
+ /** Name of the group */
104
+ "group"?: OrRuleGroupViewer['group'];
105
+ /** */
106
+ "readonly"?: OrRuleGroupViewer['readonly'];
107
+
108
+ /** */
109
+ "onundefined"?: (e: CustomEvent<OrRulesGroupNameChangeEvent>) => void;
110
+ }
111
+
112
+
113
+ export type OrRuleTextViewerProps = {
114
+ /** */
115
+ "readonly"?: OrRuleTextViewer['readonly'];
116
+ /** */
117
+ "config"?: OrRuleTextViewer['config'];
118
+ /** */
119
+ "ruleset"?: OrRuleTextViewer['ruleset'];
120
+
121
+ /** */
122
+ "onvalid"?: (e: CustomEvent<OrRulesRuleChangedEvent>) => void;
123
+ }
124
+
125
+
126
+ export type OrRuleTreeProps = {
127
+ /** List of rules visible in the tree menu */
128
+ "rules"?: OrRuleTree['rules'];
129
+ /** Rules configuration object, for example to only allow certain ruleset types */
130
+ "config"?: OrRuleTree['config'];
131
+ /** Defines whether only global rulesets should be visible. */
132
+ "global"?: OrRuleTree['global'];
133
+ /** Sets every element in the tree to readonly mode */
134
+ "readonly"?: OrRuleTree['readonly'];
135
+ /** */
136
+ "nodes"?: OrRuleTree['nodes'];
137
+ /** */
138
+ "draggable"?: OrRuleTree['draggable'];
139
+ /** */
140
+ "selection"?: OrRuleTree['selection'];
141
+ /** */
142
+ "sortOptions"?: OrRuleTree['sortOptions'];
143
+ /** */
144
+ "sortBy"?: OrRuleTree['sortBy'];
145
+ /** */
146
+ "groupFirst"?: OrRuleTree['groupFirst'];
147
+ /** */
148
+ "menuTitle"?: OrRuleTree['menuTitle'];
149
+
150
+ /** */
151
+ "onundefined"?: (e: CustomEvent<OrRulesAddEvent>) => void;
152
+ /** */
153
+ "ongroupName"?: (e: CustomEvent<OrRulesRequestGroupEvent>) => void;
154
+ }
155
+
156
+
157
+ export type OrRuleValidityProps = {
158
+ /** */
159
+ "ruleset"?: OrRuleValidity['ruleset'];
160
+ /** */
161
+ "_validity"?: OrRuleValidity['_validity'];
162
+ /** */
163
+ "_rrule"?: OrRuleValidity['_rrule'];
164
+
165
+ /** */
166
+ "onundefined"?: (e: CustomEvent<OrRulesRuleChangedEvent>) => void;
167
+ }
168
+
169
+
170
+ export type OrRuleViewerProps = {
171
+ /** */
172
+ "ruleset"?: OrRuleViewer['ruleset'];
173
+ /** */
174
+ "readonly"?: OrRuleViewer['readonly'];
175
+ /** */
176
+ "disabled"?: OrRuleViewer['disabled'];
177
+ /** */
178
+ "config"?: OrRuleViewer['config'];
179
+ /** */
180
+ "modified"?: OrRuleViewer['modified'];
181
+ /** */
182
+ "view"?: OrRuleViewer['view'];
183
+
184
+ /** */
185
+ "onundefined"?: (e: CustomEvent<OrRulesSaveEvent>) => void;
186
+ }
187
+
188
+ export type CustomElements = {
189
+
190
+
191
+ /**
192
+ *
193
+ *
194
+ * ## Attributes & Properties
195
+ *
196
+ * Component attributes and properties that can be applied to the element or by using JavaScript.
197
+ *
198
+ * - `readonly`: undefined
199
+ * - `config`: undefined
200
+ * - `realm`: undefined
201
+ * - `language`: undefined
202
+ *
203
+ * ## Methods
204
+ *
205
+ * Methods that can be called to access component functionality.
206
+ *
207
+ * - `refresh() => void`: undefined
208
+ */
209
+ "or-rules": Partial<OrRulesProps & BaseProps<OrRules> & BaseEvents>;
210
+
211
+
212
+ /**
213
+ *
214
+ *
215
+ * ## Attributes & Properties
216
+ *
217
+ * Component attributes and properties that can be applied to the element or by using JavaScript.
218
+ *
219
+ * - `group`: Name of the group
220
+ * - `readonly`: undefined
221
+ *
222
+ * ## Events
223
+ *
224
+ * Events that will be emitted by the component.
225
+ *
226
+ * - `undefined`: undefined
227
+ */
228
+ "or-rule-group-viewer": Partial<OrRuleGroupViewerProps & BaseProps<OrRuleGroupViewer> & BaseEvents>;
229
+
230
+
231
+ /**
232
+ *
233
+ *
234
+ * ## Attributes & Properties
235
+ *
236
+ * Component attributes and properties that can be applied to the element or by using JavaScript.
237
+ *
238
+ * - `readonly`: undefined (property only)
239
+ * - `config`: undefined (property only)
240
+ * - `ruleset`: undefined (property only)
241
+ *
242
+ * ## Events
243
+ *
244
+ * Events that will be emitted by the component.
245
+ *
246
+ * - `valid`: undefined
247
+ *
248
+ * ## Methods
249
+ *
250
+ * Methods that can be called to access component functionality.
251
+ *
252
+ * - `beforeSave() => void`: undefined
253
+ * - `validate() => boolean`: undefined
254
+ */
255
+ "or-rule-text-viewer": Partial<OrRuleTextViewerProps & BaseProps<OrRuleTextViewer> & BaseEvents>;
256
+
257
+
258
+ /**
259
+ *
260
+ *
261
+ * ## Attributes & Properties
262
+ *
263
+ * Component attributes and properties that can be applied to the element or by using JavaScript.
264
+ *
265
+ * - `rules`: List of rules visible in the tree menu
266
+ * - `config`: Rules configuration object, for example to only allow certain ruleset types
267
+ * - `global`: Defines whether only global rulesets should be visible.
268
+ * - `readonly`: Sets every element in the tree to readonly mode
269
+ * - `nodes`: undefined (property only)
270
+ * - `draggable`: undefined (property only)
271
+ * - `selection`: undefined (property only)
272
+ * - `sortOptions`: undefined (property only)
273
+ * - `sortBy`: undefined (property only)
274
+ * - `groupFirst`: undefined (property only)
275
+ * - `menuTitle`: undefined (property only)
276
+ *
277
+ * ## Events
278
+ *
279
+ * Events that will be emitted by the component.
280
+ *
281
+ * - `undefined`: undefined
282
+ * - `groupName`: undefined
283
+ *
284
+ * ## Methods
285
+ *
286
+ * Methods that can be called to access component functionality.
287
+ *
288
+ * - `selectRuleset(ruleset: RulesetUnion, silent = false) => void`: Public function that allows consumers to select a ruleset in the tree.
289
+ * It finds the tree node in the UI, and selects it.
290
+ * - `deselectAllNodes() => void`: undefined
291
+ * - `refresh() => void`: Refreshes the tree content, and re-fetches the list of rules.
292
+ */
293
+ "or-rule-tree": Partial<OrRuleTreeProps & BaseProps<OrRuleTree> & BaseEvents>;
294
+
295
+
296
+ /**
297
+ *
298
+ *
299
+ * ## Attributes & Properties
300
+ *
301
+ * Component attributes and properties that can be applied to the element or by using JavaScript.
302
+ *
303
+ * - `ruleset`: undefined
304
+ * - `_validity`: undefined
305
+ * - `_rrule`: undefined
306
+ *
307
+ * ## Events
308
+ *
309
+ * Events that will be emitted by the component.
310
+ *
311
+ * - `undefined`: undefined
312
+ *
313
+ * ## Methods
314
+ *
315
+ * Methods that can be called to access component functionality.
316
+ *
317
+ * - `getWeekDay(weekday: string) => ByWeekday | undefined`: undefined
318
+ * - `isAllDay() => void`: undefined
319
+ * - `timeLabel() => void`: undefined
320
+ * - `setValidityType(value: any) => void`: undefined
321
+ * - `getValidityType() => void`: undefined
322
+ */
323
+ "or-rule-validity": Partial<OrRuleValidityProps & BaseProps<OrRuleValidity> & BaseEvents>;
324
+
325
+
326
+ /**
327
+ *
328
+ *
329
+ * ## Attributes & Properties
330
+ *
331
+ * Component attributes and properties that can be applied to the element or by using JavaScript.
332
+ *
333
+ * - `ruleset`: undefined
334
+ * - `readonly`: undefined
335
+ * - `disabled`: undefined
336
+ * - `config`: undefined
337
+ * - `modified`: undefined (property only)
338
+ * - `view`: undefined (property only)
339
+ * - `valid`: undefined (property only) (readonly)
340
+ *
341
+ * ## Events
342
+ *
343
+ * Events that will be emitted by the component.
344
+ *
345
+ * - `undefined`: undefined
346
+ */
347
+ "or-rule-viewer": Partial<OrRuleViewerProps & BaseProps<OrRuleViewer> & BaseEvents>;
348
+ }
349
+
350
+ export type CustomCssProperties = {
351
+
352
+ }
353
+
354
+
355
+ declare module 'react' {
356
+ namespace JSX {
357
+ interface IntrinsicElements extends CustomElements {}
358
+ }
359
+ export interface CSSProperties extends CustomCssProperties {}
360
+ }
361
+
362
+ declare module 'preact' {
363
+ namespace JSX {
364
+ interface IntrinsicElements extends CustomElements {}
365
+ }
366
+ export interface CSSProperties extends CustomCssProperties {}
367
+ }
368
+
369
+ declare module '@builder.io/qwik' {
370
+ namespace JSX {
371
+ interface IntrinsicElements extends CustomElements {}
372
+ }
373
+ export interface CSSProperties extends CustomCssProperties {}
374
+ }
375
+
376
+ declare module '@stencil/core' {
377
+ namespace JSX {
378
+ interface IntrinsicElements extends CustomElements {}
379
+ }
380
+ export interface CSSProperties extends CustomCssProperties {}
381
+ }
382
+
383
+ declare module 'hono/jsx' {
384
+ namespace JSX {
385
+ interface IntrinsicElements extends CustomElements {}
386
+ }
387
+ export interface CSSProperties extends CustomCssProperties {}
388
+ }
389
+
390
+ declare module 'react-native' {
391
+ namespace JSX {
392
+ interface IntrinsicElements extends CustomElements {}
393
+ }
394
+ export interface CSSProperties extends CustomCssProperties {}
395
+ }
396
+
397
+ declare global {
398
+ namespace JSX {
399
+ interface IntrinsicElements extends CustomElements {}
400
+ }
401
+ export interface CSSProperties extends CustomCssProperties {}
402
+ }
@@ -459,7 +459,10 @@
459
459
  {
460
460
  "kind": "method",
461
461
  "name": "refresh",
462
- "privacy": "public"
462
+ "privacy": "public",
463
+ "type": {
464
+ "text": "refresh() => void"
465
+ }
463
466
  },
464
467
  {
465
468
  "kind": "method",
@@ -693,7 +696,9 @@
693
696
  "package": "lit"
694
697
  },
695
698
  "tagName": "or-rules",
696
- "customElement": true
699
+ "customElement": true,
700
+ "modulePath": "src/index.ts",
701
+ "definitionPath": "src/index.ts"
697
702
  }
698
703
  ],
699
704
  "exports": [
@@ -998,7 +1003,9 @@
998
1003
  "package": "lit"
999
1004
  },
1000
1005
  "tagName": "or-rule-group-viewer",
1001
- "customElement": true
1006
+ "customElement": true,
1007
+ "modulePath": "src/or-rule-group-viewer.ts",
1008
+ "definitionPath": "src/or-rule-group-viewer.ts"
1002
1009
  }
1003
1010
  ],
1004
1011
  "exports": [
@@ -1110,7 +1117,10 @@
1110
1117
  {
1111
1118
  "kind": "method",
1112
1119
  "name": "beforeSave",
1113
- "privacy": "public"
1120
+ "privacy": "public",
1121
+ "type": {
1122
+ "text": "beforeSave() => void"
1123
+ }
1114
1124
  },
1115
1125
  {
1116
1126
  "kind": "method",
@@ -1120,6 +1130,9 @@
1120
1130
  "type": {
1121
1131
  "text": "boolean"
1122
1132
  }
1133
+ },
1134
+ "type": {
1135
+ "text": "validate() => boolean"
1123
1136
  }
1124
1137
  }
1125
1138
  ],
@@ -1136,7 +1149,9 @@
1136
1149
  "package": "lit"
1137
1150
  },
1138
1151
  "tagName": "or-rule-text-viewer",
1139
- "customElement": true
1152
+ "customElement": true,
1153
+ "modulePath": "src/or-rule-text-viewer.ts",
1154
+ "definitionPath": "src/or-rule-text-viewer.ts"
1140
1155
  }
1141
1156
  ],
1142
1157
  "exports": [
@@ -1418,7 +1433,10 @@
1418
1433
  "description": "skips the modal of 'discard changes' and does not dispatch an event"
1419
1434
  }
1420
1435
  ],
1421
- "description": "Public function that allows consumers to select a ruleset in the tree.\nIt finds the tree node in the UI, and selects it."
1436
+ "description": "Public function that allows consumers to select a ruleset in the tree.\nIt finds the tree node in the UI, and selects it.",
1437
+ "type": {
1438
+ "text": "selectRuleset(ruleset: RulesetUnion, silent = false) => void"
1439
+ }
1422
1440
  },
1423
1441
  {
1424
1442
  "kind": "method",
@@ -1442,7 +1460,10 @@
1442
1460
  {
1443
1461
  "kind": "method",
1444
1462
  "name": "deselectAllNodes",
1445
- "privacy": "public"
1463
+ "privacy": "public",
1464
+ "type": {
1465
+ "text": "deselectAllNodes() => void"
1466
+ }
1446
1467
  },
1447
1468
  {
1448
1469
  "kind": "method",
@@ -1491,7 +1512,10 @@
1491
1512
  "kind": "method",
1492
1513
  "name": "refresh",
1493
1514
  "privacy": "public",
1494
- "description": "Refreshes the tree content, and re-fetches the list of rules."
1515
+ "description": "Refreshes the tree content, and re-fetches the list of rules.",
1516
+ "type": {
1517
+ "text": "refresh() => void"
1518
+ }
1495
1519
  },
1496
1520
  {
1497
1521
  "kind": "method",
@@ -1690,7 +1714,9 @@
1690
1714
  "package": "@openremote/or-tree-menu"
1691
1715
  },
1692
1716
  "tagName": "or-rule-tree",
1693
- "customElement": true
1717
+ "customElement": true,
1718
+ "modulePath": "src/or-rule-tree.ts",
1719
+ "definitionPath": "src/or-rule-tree.ts"
1694
1720
  }
1695
1721
  ],
1696
1722
  "exports": [
@@ -1779,11 +1805,17 @@
1779
1805
  "text": "string"
1780
1806
  }
1781
1807
  }
1782
- ]
1808
+ ],
1809
+ "type": {
1810
+ "text": "getWeekDay(weekday: string) => ByWeekday | undefined"
1811
+ }
1783
1812
  },
1784
1813
  {
1785
1814
  "kind": "method",
1786
- "name": "isAllDay"
1815
+ "name": "isAllDay",
1816
+ "type": {
1817
+ "text": "isAllDay() => void"
1818
+ }
1787
1819
  },
1788
1820
  {
1789
1821
  "kind": "method",
@@ -1806,7 +1838,10 @@
1806
1838
  },
1807
1839
  {
1808
1840
  "kind": "method",
1809
- "name": "timeLabel"
1841
+ "name": "timeLabel",
1842
+ "type": {
1843
+ "text": "timeLabel() => void"
1844
+ }
1810
1845
  },
1811
1846
  {
1812
1847
  "kind": "method",
@@ -1818,11 +1853,17 @@
1818
1853
  "text": "any"
1819
1854
  }
1820
1855
  }
1821
- ]
1856
+ ],
1857
+ "type": {
1858
+ "text": "setValidityType(value: any) => void"
1859
+ }
1822
1860
  },
1823
1861
  {
1824
1862
  "kind": "method",
1825
- "name": "getValidityType"
1863
+ "name": "getValidityType",
1864
+ "type": {
1865
+ "text": "getValidityType() => void"
1866
+ }
1826
1867
  },
1827
1868
  {
1828
1869
  "kind": "method",
@@ -1881,7 +1922,9 @@
1881
1922
  "package": "lit"
1882
1923
  },
1883
1924
  "tagName": "or-rule-validity",
1884
- "customElement": true
1925
+ "customElement": true,
1926
+ "modulePath": "src/or-rule-validity.ts",
1927
+ "definitionPath": "src/or-rule-validity.ts"
1885
1928
  }
1886
1929
  ],
1887
1930
  "exports": [
@@ -2128,7 +2171,9 @@
2128
2171
  "package": "lit"
2129
2172
  },
2130
2173
  "tagName": "or-rule-viewer",
2131
- "customElement": true
2174
+ "customElement": true,
2175
+ "modulePath": "src/or-rule-viewer.ts",
2176
+ "definitionPath": "src/or-rule-viewer.ts"
2132
2177
  }
2133
2178
  ],
2134
2179
  "exports": [