@openremote/or-asset-tree 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.
- package/custom-elements-jsx.d.ts +279 -0
- package/custom-elements.json +56 -13
- package/dist/umd/index.orbundle.js +1 -1
- package/dist/umd/index.orbundle.js.map +1 -1
- package/package.json +10 -7
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
|
|
2
|
+
import type { style, OrAssetTreeRequestSelectionEvent, OrAssetTreeSelectionEvent, OrAssetTreeChangeParentEvent, OrAssetTreeToggleExpandEvent, OrAssetTreeRequestAddEvent, OrAssetTreeAddEvent, OrAssetTreeRequestDeleteEvent, OrAssetTreeAssetEvent, OrAssetTreeFilter, OrAssetTree } from "./lib/index.d.ts";
|
|
3
|
+
import type { OrAddChangedEvent, OrAddAssetDialog } from "./lib/or-add-asset-dialog.d.ts";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* This type can be used to create scoped tags for your components.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* import type { ScopedElements } from "path/to/library/jsx-integration";
|
|
12
|
+
*
|
|
13
|
+
* declare module "my-library" {
|
|
14
|
+
* namespace JSX {
|
|
15
|
+
* interface IntrinsicElements
|
|
16
|
+
* extends ScopedElements<'test-', ''> {}
|
|
17
|
+
* }
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @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.
|
|
22
|
+
*/
|
|
23
|
+
export type ScopedElements<
|
|
24
|
+
Prefix extends string = "",
|
|
25
|
+
Suffix extends string = ""
|
|
26
|
+
> = {
|
|
27
|
+
[Key in keyof CustomElements as `${Prefix}${Key}${Suffix}`]: CustomElements[Key];
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
type BaseProps<T extends HTMLElement> = {
|
|
31
|
+
|
|
32
|
+
/** Content added between the opening and closing tags of the element */
|
|
33
|
+
children?: any;
|
|
34
|
+
/** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
|
|
35
|
+
class?: string;
|
|
36
|
+
/** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
|
|
37
|
+
className?: string;
|
|
38
|
+
/** 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. */
|
|
39
|
+
classList?: Record<string, boolean | undefined>;
|
|
40
|
+
/** Specifies the text direction of the element. */
|
|
41
|
+
dir?: "ltr" | "rtl";
|
|
42
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
43
|
+
exportparts?: string;
|
|
44
|
+
/** For <label> and <output>, lets you associate the label with some control. */
|
|
45
|
+
htmlFor?: string;
|
|
46
|
+
/** Specifies whether the element should be hidden. */
|
|
47
|
+
hidden?: boolean | string;
|
|
48
|
+
/** A unique identifier for the element. */
|
|
49
|
+
id?: string;
|
|
50
|
+
/** Keys tell React which array item each component corresponds to */
|
|
51
|
+
key?: string | number;
|
|
52
|
+
/** Specifies the language of the element. */
|
|
53
|
+
lang?: string;
|
|
54
|
+
/** 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. */
|
|
55
|
+
part?: string;
|
|
56
|
+
/** Use the ref attribute with a variable to assign a DOM element to the variable once the element is rendered. */
|
|
57
|
+
ref?: T | ((e: T) => void);
|
|
58
|
+
/** Adds a reference for a custom element slot */
|
|
59
|
+
slot?: string;
|
|
60
|
+
/** Prop for setting inline styles */
|
|
61
|
+
style?: Record<string, string | number>;
|
|
62
|
+
/** Overrides the default Tab button behavior. Avoid using values other than -1 and 0. */
|
|
63
|
+
tabIndex?: number;
|
|
64
|
+
/** Specifies the tooltip text for the element. */
|
|
65
|
+
title?: string;
|
|
66
|
+
/** Passing 'no' excludes the element content from being translated. */
|
|
67
|
+
translate?: "yes" | "no";
|
|
68
|
+
/** The popover global attribute is used to designate an element as a popover element. */
|
|
69
|
+
popover?: "auto" | "hint" | "manual";
|
|
70
|
+
/** Turns an element element into a popover control button; takes the ID of the popover element to control as its value. */
|
|
71
|
+
popovertarget?: "top" | "bottom" | "left" | "right" | "auto";
|
|
72
|
+
/** Specifies the action to be performed on a popover element being controlled by a control element. */
|
|
73
|
+
popovertargetaction?: "show" | "hide" | "toggle";
|
|
74
|
+
|
|
75
|
+
} ;
|
|
76
|
+
|
|
77
|
+
type BaseEvents = {
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
export type OrAssetTreeProps = {
|
|
85
|
+
/** Allows arbitrary assets to be displayed using a tree */
|
|
86
|
+
"assets"?: OrAssetTree['assets'];
|
|
87
|
+
/** */
|
|
88
|
+
"rootAssets"?: OrAssetTree['rootAssets'];
|
|
89
|
+
/** */
|
|
90
|
+
"rootAssetIds"?: OrAssetTree['rootAssetIds'];
|
|
91
|
+
/** */
|
|
92
|
+
"dataProvider"?: OrAssetTree['dataProvider'];
|
|
93
|
+
/** */
|
|
94
|
+
"readonly"?: OrAssetTree['readonly'];
|
|
95
|
+
/** */
|
|
96
|
+
"disabled"?: OrAssetTree['disabled'];
|
|
97
|
+
/** */
|
|
98
|
+
"disableSubscribe"?: OrAssetTree['disableSubscribe'];
|
|
99
|
+
/** */
|
|
100
|
+
"selectedIds"?: OrAssetTree['selectedIds'];
|
|
101
|
+
/** */
|
|
102
|
+
"showDeselectBtn"?: OrAssetTree['showDeselectBtn'];
|
|
103
|
+
/** */
|
|
104
|
+
"showSortBtn"?: OrAssetTree['showSortBtn'];
|
|
105
|
+
/** */
|
|
106
|
+
"showFilter"?: OrAssetTree['showFilter'];
|
|
107
|
+
/** */
|
|
108
|
+
"sortBy"?: OrAssetTree['sortBy'];
|
|
109
|
+
/** */
|
|
110
|
+
"expandAllNodes"?: OrAssetTree['expandAllNodes'];
|
|
111
|
+
/** */
|
|
112
|
+
"checkboxes"?: OrAssetTree['checkboxes'];
|
|
113
|
+
/** */
|
|
114
|
+
"queryLimit"?: OrAssetTree['queryLimit'];
|
|
115
|
+
/** */
|
|
116
|
+
"selectedNodes"?: OrAssetTree['selectedNodes'];
|
|
117
|
+
|
|
118
|
+
/** */
|
|
119
|
+
"onundefined"?: (e: CustomEvent<OrAssetTreeSelectionEvent>) => void;
|
|
120
|
+
/** */
|
|
121
|
+
"onassetEvent"?: (e: CustomEvent<OrAssetTreeAssetEvent>) => void;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
export type OrAddAssetDialogProps = {
|
|
126
|
+
/** */
|
|
127
|
+
"config"?: OrAddAssetDialog['config'];
|
|
128
|
+
/** */
|
|
129
|
+
"agentTypes"?: OrAddAssetDialog['agentTypes'];
|
|
130
|
+
/** */
|
|
131
|
+
"assetTypes"?: OrAddAssetDialog['assetTypes'];
|
|
132
|
+
/** */
|
|
133
|
+
"parent"?: OrAddAssetDialog['parent'];
|
|
134
|
+
/** */
|
|
135
|
+
"selectedType"?: OrAddAssetDialog['selectedType'];
|
|
136
|
+
/** */
|
|
137
|
+
"selectedAttributes"?: OrAddAssetDialog['selectedAttributes'];
|
|
138
|
+
/** */
|
|
139
|
+
"selectedChildAssetType"?: OrAddAssetDialog['selectedChildAssetType'];
|
|
140
|
+
/** */
|
|
141
|
+
"name"?: OrAddAssetDialog['name'];
|
|
142
|
+
|
|
143
|
+
/** */
|
|
144
|
+
"onundefined"?: (e: CustomEvent<OrAddChangedEvent>) => void;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export type CustomElements = {
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
*
|
|
152
|
+
*
|
|
153
|
+
* ## Attributes & Properties
|
|
154
|
+
*
|
|
155
|
+
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
156
|
+
*
|
|
157
|
+
* - `assets`: Allows arbitrary assets to be displayed using a tree
|
|
158
|
+
* - `rootAssets`: undefined
|
|
159
|
+
* - `rootAssetIds`: undefined
|
|
160
|
+
* - `dataProvider`: undefined
|
|
161
|
+
* - `readonly`: undefined
|
|
162
|
+
* - `disabled`: undefined
|
|
163
|
+
* - `disableSubscribe`: undefined
|
|
164
|
+
* - `selectedIds`: undefined
|
|
165
|
+
* - `showDeselectBtn`: undefined
|
|
166
|
+
* - `showSortBtn`: undefined
|
|
167
|
+
* - `showFilter`: undefined
|
|
168
|
+
* - `sortBy`: undefined
|
|
169
|
+
* - `expandAllNodes`: undefined
|
|
170
|
+
* - `checkboxes`: undefined
|
|
171
|
+
* - `queryLimit`: undefined
|
|
172
|
+
* - `selectedNodes`: undefined (property only)
|
|
173
|
+
*
|
|
174
|
+
* ## Events
|
|
175
|
+
*
|
|
176
|
+
* Events that will be emitted by the component.
|
|
177
|
+
*
|
|
178
|
+
* - `undefined`: undefined
|
|
179
|
+
* - `assetEvent`: undefined
|
|
180
|
+
*
|
|
181
|
+
* ## Methods
|
|
182
|
+
*
|
|
183
|
+
* Methods that can be called to access component functionality.
|
|
184
|
+
*
|
|
185
|
+
* - `refresh() => void`: undefined
|
|
186
|
+
* - `isAncestorSelected(node: UiAssetTreeNode) => void`: undefined
|
|
187
|
+
* - `applyFilter(filter?: OrAssetTreeFilter | string, reflect = false) => void`: A setter function for updating the list of nodes (assets) shown in the UI.
|
|
188
|
+
* - `_addEventSubscriptions() => Promise<void>`: undefined
|
|
189
|
+
* - `onEventsConnect() => void`: undefined
|
|
190
|
+
* - `onEventsDisconnect() => void`: undefined
|
|
191
|
+
* - `getNodes() => UiAssetTreeNode[]`: undefined
|
|
192
|
+
* - `_onEvent(event: SharedEvent) => void`: undefined
|
|
193
|
+
* - `_onDragStart(ev: any) => void`: undefined
|
|
194
|
+
* - `_onDragEnd(ev: any) => void`: undefined
|
|
195
|
+
* - `_onDragOver(ev: any) => void`: undefined
|
|
196
|
+
* - `_onDragEnter(ev: any) => void`: undefined
|
|
197
|
+
* - `_onDragLeave(ev: any) => void`: undefined
|
|
198
|
+
*/
|
|
199
|
+
"or-asset-tree": Partial<OrAssetTreeProps & BaseProps<OrAssetTree> & BaseEvents>;
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
*
|
|
204
|
+
*
|
|
205
|
+
* ## Attributes & Properties
|
|
206
|
+
*
|
|
207
|
+
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
208
|
+
*
|
|
209
|
+
* - `config`: undefined (property only)
|
|
210
|
+
* - `agentTypes`: undefined (property only)
|
|
211
|
+
* - `assetTypes`: undefined (property only)
|
|
212
|
+
* - `parent`: undefined (property only)
|
|
213
|
+
* - `selectedType`: undefined (property only)
|
|
214
|
+
* - `selectedAttributes`: undefined (property only)
|
|
215
|
+
* - `selectedChildAssetType`: undefined (property only)
|
|
216
|
+
* - `name`: undefined (property only)
|
|
217
|
+
*
|
|
218
|
+
* ## Events
|
|
219
|
+
*
|
|
220
|
+
* Events that will be emitted by the component.
|
|
221
|
+
*
|
|
222
|
+
* - `undefined`: undefined
|
|
223
|
+
*/
|
|
224
|
+
"or-add-asset-dialog": Partial<OrAddAssetDialogProps & BaseProps<OrAddAssetDialog> & BaseEvents>;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export type CustomCssProperties = {
|
|
228
|
+
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
declare module 'react' {
|
|
233
|
+
namespace JSX {
|
|
234
|
+
interface IntrinsicElements extends CustomElements {}
|
|
235
|
+
}
|
|
236
|
+
export interface CSSProperties extends CustomCssProperties {}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
declare module 'preact' {
|
|
240
|
+
namespace JSX {
|
|
241
|
+
interface IntrinsicElements extends CustomElements {}
|
|
242
|
+
}
|
|
243
|
+
export interface CSSProperties extends CustomCssProperties {}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
declare module '@builder.io/qwik' {
|
|
247
|
+
namespace JSX {
|
|
248
|
+
interface IntrinsicElements extends CustomElements {}
|
|
249
|
+
}
|
|
250
|
+
export interface CSSProperties extends CustomCssProperties {}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
declare module '@stencil/core' {
|
|
254
|
+
namespace JSX {
|
|
255
|
+
interface IntrinsicElements extends CustomElements {}
|
|
256
|
+
}
|
|
257
|
+
export interface CSSProperties extends CustomCssProperties {}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
declare module 'hono/jsx' {
|
|
261
|
+
namespace JSX {
|
|
262
|
+
interface IntrinsicElements extends CustomElements {}
|
|
263
|
+
}
|
|
264
|
+
export interface CSSProperties extends CustomCssProperties {}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
declare module 'react-native' {
|
|
268
|
+
namespace JSX {
|
|
269
|
+
interface IntrinsicElements extends CustomElements {}
|
|
270
|
+
}
|
|
271
|
+
export interface CSSProperties extends CustomCssProperties {}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
declare global {
|
|
275
|
+
namespace JSX {
|
|
276
|
+
interface IntrinsicElements extends CustomElements {}
|
|
277
|
+
}
|
|
278
|
+
export interface CSSProperties extends CustomCssProperties {}
|
|
279
|
+
}
|
package/custom-elements.json
CHANGED
|
@@ -580,7 +580,10 @@
|
|
|
580
580
|
{
|
|
581
581
|
"kind": "method",
|
|
582
582
|
"name": "refresh",
|
|
583
|
-
"privacy": "public"
|
|
583
|
+
"privacy": "public",
|
|
584
|
+
"type": {
|
|
585
|
+
"text": "refresh() => void"
|
|
586
|
+
}
|
|
584
587
|
},
|
|
585
588
|
{
|
|
586
589
|
"kind": "method",
|
|
@@ -593,7 +596,10 @@
|
|
|
593
596
|
"text": "UiAssetTreeNode"
|
|
594
597
|
}
|
|
595
598
|
}
|
|
596
|
-
]
|
|
599
|
+
],
|
|
600
|
+
"type": {
|
|
601
|
+
"text": "isAncestorSelected(node: UiAssetTreeNode) => void"
|
|
602
|
+
}
|
|
597
603
|
},
|
|
598
604
|
{
|
|
599
605
|
"kind": "method",
|
|
@@ -614,7 +620,10 @@
|
|
|
614
620
|
"description": "If the changes should be reflected in the filtering UI. (default: false)"
|
|
615
621
|
}
|
|
616
622
|
],
|
|
617
|
-
"description": "A setter function for updating the list of nodes (assets) shown in the UI."
|
|
623
|
+
"description": "A setter function for updating the list of nodes (assets) shown in the UI.",
|
|
624
|
+
"type": {
|
|
625
|
+
"text": "applyFilter(filter?: OrAssetTreeFilter | string, reflect = false) => void"
|
|
626
|
+
}
|
|
618
627
|
},
|
|
619
628
|
{
|
|
620
629
|
"kind": "method",
|
|
@@ -1170,17 +1179,26 @@
|
|
|
1170
1179
|
"type": {
|
|
1171
1180
|
"text": "Promise<void>"
|
|
1172
1181
|
}
|
|
1182
|
+
},
|
|
1183
|
+
"type": {
|
|
1184
|
+
"text": "_addEventSubscriptions() => Promise<void>"
|
|
1173
1185
|
}
|
|
1174
1186
|
},
|
|
1175
1187
|
{
|
|
1176
1188
|
"kind": "method",
|
|
1177
1189
|
"name": "onEventsConnect",
|
|
1178
|
-
"privacy": "public"
|
|
1190
|
+
"privacy": "public",
|
|
1191
|
+
"type": {
|
|
1192
|
+
"text": "onEventsConnect() => void"
|
|
1193
|
+
}
|
|
1179
1194
|
},
|
|
1180
1195
|
{
|
|
1181
1196
|
"kind": "method",
|
|
1182
1197
|
"name": "onEventsDisconnect",
|
|
1183
|
-
"privacy": "public"
|
|
1198
|
+
"privacy": "public",
|
|
1199
|
+
"type": {
|
|
1200
|
+
"text": "onEventsDisconnect() => void"
|
|
1201
|
+
}
|
|
1184
1202
|
},
|
|
1185
1203
|
{
|
|
1186
1204
|
"kind": "method",
|
|
@@ -1190,6 +1208,9 @@
|
|
|
1190
1208
|
"type": {
|
|
1191
1209
|
"text": "UiAssetTreeNode[]"
|
|
1192
1210
|
}
|
|
1211
|
+
},
|
|
1212
|
+
"type": {
|
|
1213
|
+
"text": "getNodes() => UiAssetTreeNode[]"
|
|
1193
1214
|
}
|
|
1194
1215
|
},
|
|
1195
1216
|
{
|
|
@@ -1203,7 +1224,10 @@
|
|
|
1203
1224
|
"text": "SharedEvent"
|
|
1204
1225
|
}
|
|
1205
1226
|
}
|
|
1206
|
-
]
|
|
1227
|
+
],
|
|
1228
|
+
"type": {
|
|
1229
|
+
"text": "_onEvent(event: SharedEvent) => void"
|
|
1230
|
+
}
|
|
1207
1231
|
},
|
|
1208
1232
|
{
|
|
1209
1233
|
"kind": "method",
|
|
@@ -1266,7 +1290,10 @@
|
|
|
1266
1290
|
"text": "any"
|
|
1267
1291
|
}
|
|
1268
1292
|
}
|
|
1269
|
-
]
|
|
1293
|
+
],
|
|
1294
|
+
"type": {
|
|
1295
|
+
"text": "_onDragStart(ev: any) => void"
|
|
1296
|
+
}
|
|
1270
1297
|
},
|
|
1271
1298
|
{
|
|
1272
1299
|
"kind": "method",
|
|
@@ -1284,7 +1311,10 @@
|
|
|
1284
1311
|
"text": "any"
|
|
1285
1312
|
}
|
|
1286
1313
|
}
|
|
1287
|
-
]
|
|
1314
|
+
],
|
|
1315
|
+
"type": {
|
|
1316
|
+
"text": "_onDragEnd(ev: any) => void"
|
|
1317
|
+
}
|
|
1288
1318
|
},
|
|
1289
1319
|
{
|
|
1290
1320
|
"kind": "method",
|
|
@@ -1320,7 +1350,10 @@
|
|
|
1320
1350
|
"text": "any"
|
|
1321
1351
|
}
|
|
1322
1352
|
}
|
|
1323
|
-
]
|
|
1353
|
+
],
|
|
1354
|
+
"type": {
|
|
1355
|
+
"text": "_onDragOver(ev: any) => void"
|
|
1356
|
+
}
|
|
1324
1357
|
},
|
|
1325
1358
|
{
|
|
1326
1359
|
"kind": "method",
|
|
@@ -1356,7 +1389,10 @@
|
|
|
1356
1389
|
"text": "any"
|
|
1357
1390
|
}
|
|
1358
1391
|
}
|
|
1359
|
-
]
|
|
1392
|
+
],
|
|
1393
|
+
"type": {
|
|
1394
|
+
"text": "_onDragEnter(ev: any) => void"
|
|
1395
|
+
}
|
|
1360
1396
|
},
|
|
1361
1397
|
{
|
|
1362
1398
|
"kind": "method",
|
|
@@ -1374,7 +1410,10 @@
|
|
|
1374
1410
|
"text": "any"
|
|
1375
1411
|
}
|
|
1376
1412
|
}
|
|
1377
|
-
]
|
|
1413
|
+
],
|
|
1414
|
+
"type": {
|
|
1415
|
+
"text": "_onDragLeave(ev: any) => void"
|
|
1416
|
+
}
|
|
1378
1417
|
},
|
|
1379
1418
|
{
|
|
1380
1419
|
"kind": "method",
|
|
@@ -1573,7 +1612,9 @@
|
|
|
1573
1612
|
"package": "lit"
|
|
1574
1613
|
},
|
|
1575
1614
|
"tagName": "or-asset-tree",
|
|
1576
|
-
"customElement": true
|
|
1615
|
+
"customElement": true,
|
|
1616
|
+
"modulePath": "src/index.ts",
|
|
1617
|
+
"definitionPath": "src/index.ts"
|
|
1577
1618
|
}
|
|
1578
1619
|
],
|
|
1579
1620
|
"exports": [
|
|
@@ -1897,7 +1938,9 @@
|
|
|
1897
1938
|
"package": "lit"
|
|
1898
1939
|
},
|
|
1899
1940
|
"tagName": "or-add-asset-dialog",
|
|
1900
|
-
"customElement": true
|
|
1941
|
+
"customElement": true,
|
|
1942
|
+
"modulePath": "src/or-add-asset-dialog.ts",
|
|
1943
|
+
"definitionPath": "src/or-add-asset-dialog.ts"
|
|
1901
1944
|
}
|
|
1902
1945
|
],
|
|
1903
1946
|
"exports": [
|