@openremote/or-vaadin-components 1.14.0-snapshot.20260112194843

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 (41) hide show
  1. package/README.md +30 -0
  2. package/custom-elements-jsx.d.ts +324 -0
  3. package/custom-elements.json +772 -0
  4. package/lib/or-vaadin-checkbox.d.ts +5 -0
  5. package/lib/or-vaadin-checkbox.d.ts.map +1 -0
  6. package/lib/or-vaadin-checkbox.js +34 -0
  7. package/lib/or-vaadin-checkbox.js.map +1 -0
  8. package/lib/or-vaadin-dialog.d.ts +6 -0
  9. package/lib/or-vaadin-dialog.d.ts.map +1 -0
  10. package/lib/or-vaadin-dialog.js +35 -0
  11. package/lib/or-vaadin-dialog.js.map +1 -0
  12. package/lib/or-vaadin-input.d.ts +103 -0
  13. package/lib/or-vaadin-input.d.ts.map +1 -0
  14. package/lib/or-vaadin-input.js +264 -0
  15. package/lib/or-vaadin-input.js.map +1 -0
  16. package/lib/or-vaadin-numberfield.d.ts +9 -0
  17. package/lib/or-vaadin-numberfield.d.ts.map +1 -0
  18. package/lib/or-vaadin-numberfield.js +38 -0
  19. package/lib/or-vaadin-numberfield.js.map +1 -0
  20. package/lib/or-vaadin-passwordfield.d.ts +9 -0
  21. package/lib/or-vaadin-passwordfield.d.ts.map +1 -0
  22. package/lib/or-vaadin-passwordfield.js +38 -0
  23. package/lib/or-vaadin-passwordfield.js.map +1 -0
  24. package/lib/or-vaadin-select.d.ts +5 -0
  25. package/lib/or-vaadin-select.d.ts.map +1 -0
  26. package/lib/or-vaadin-select.js +34 -0
  27. package/lib/or-vaadin-select.js.map +1 -0
  28. package/lib/or-vaadin-textarea.d.ts +9 -0
  29. package/lib/or-vaadin-textarea.d.ts.map +1 -0
  30. package/lib/or-vaadin-textarea.js +38 -0
  31. package/lib/or-vaadin-textarea.js.map +1 -0
  32. package/lib/or-vaadin-textfield.d.ts +9 -0
  33. package/lib/or-vaadin-textfield.d.ts.map +1 -0
  34. package/lib/or-vaadin-textfield.js +38 -0
  35. package/lib/or-vaadin-textfield.js.map +1 -0
  36. package/lib/util.d.ts +68 -0
  37. package/lib/util.d.ts.map +1 -0
  38. package/lib/util.js +372 -0
  39. package/lib/util.js.map +1 -0
  40. package/package.json +48 -0
  41. package/stories/or-vaadin-textfield.stories.ts +61 -0
package/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # @openremote/or-vaadin-components
2
+ [![NPM Version][npm-image]][npm-url]
3
+
4
+ Package containing [Vaadin Web Components](https://vaadin.com/docs/latest/components), built with [Lit](https://lit.dev), with a slight adjustment to work within the OpenRemote ecosystem.
5
+ For documentation you can check out their [website](https://vaadin.com/docs/latest/components).
6
+
7
+ ## Install
8
+ ```bash
9
+ npm i @openremote/or-vaadin-components
10
+ yarn add @openremote/or-vaadin-components
11
+ ```
12
+
13
+ ## Usage
14
+ ### JavaScript / TypeScript example using a Text Field
15
+ Note: using the `document.createElement()` API is an example here. Please check the documentation of your JavaScript framework for proper installation of Lit web components.
16
+ ```typescript
17
+ import "@openremote/or-vaadin-components/or-vaadin-textfield";
18
+
19
+ // Load text field into the app
20
+ const textField = document.createElement("or-vaadin-textfield");
21
+ textField.setAttribute("label", "Company name");
22
+ textField.setAttribute("value", "OpenRemote");
23
+ document.body.appendChild(textField);
24
+ ```
25
+
26
+ ## License
27
+ [GNU AGPL](https://www.gnu.org/licenses/agpl-3.0.en.html)
28
+
29
+ [npm-image]: https://img.shields.io/npm/v/@openremote/or-vaadin-components.svg
30
+ [npm-url]: https://npmjs.org/package/@openremote/or-vaadin-components
@@ -0,0 +1,324 @@
1
+
2
+ import type { OrVaadinCheckbox } from "./lib/or-vaadin-checkbox.d.ts";
3
+ import type { dialogFooterRenderer, dialogRenderer, OrVaadinDialog } from "./lib/or-vaadin-dialog.d.ts";
4
+ import type { OrVaadinInput } from "./lib/or-vaadin-input.d.ts";
5
+ import type { OrVaadinNumberfield } from "./lib/or-vaadin-numberfield.d.ts";
6
+ import type { OrVaadinPasswordField } from "./lib/or-vaadin-passwordfield.d.ts";
7
+ import type { OrVaadinSelect } from "./lib/or-vaadin-select.d.ts";
8
+ import type { OrVaadinTextarea } from "./lib/or-vaadin-textarea.d.ts";
9
+ import type { OrVaadinTextfield } from "./lib/or-vaadin-textfield.d.ts";
10
+
11
+ /**
12
+ * This type can be used to create scoped tags for your components.
13
+ *
14
+ * Usage:
15
+ *
16
+ * ```ts
17
+ * import type { ScopedElements } from "path/to/library/jsx-integration";
18
+ *
19
+ * declare module "my-library" {
20
+ * namespace JSX {
21
+ * interface IntrinsicElements
22
+ * extends ScopedElements<'test-', ''> {}
23
+ * }
24
+ * }
25
+ * ```
26
+ *
27
+ * @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.
28
+ */
29
+ export type ScopedElements<
30
+ Prefix extends string = "",
31
+ Suffix extends string = ""
32
+ > = {
33
+ [Key in keyof CustomElements as `${Prefix}${Key}${Suffix}`]: CustomElements[Key];
34
+ };
35
+
36
+ type BaseProps<T extends HTMLElement> = {
37
+
38
+ /** Content added between the opening and closing tags of the element */
39
+ children?: any;
40
+ /** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
41
+ class?: string;
42
+ /** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
43
+ className?: string;
44
+ /** 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. */
45
+ classList?: Record<string, boolean | undefined>;
46
+ /** Specifies the text direction of the element. */
47
+ dir?: "ltr" | "rtl";
48
+ /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
49
+ exportparts?: string;
50
+ /** For <label> and <output>, lets you associate the label with some control. */
51
+ htmlFor?: string;
52
+ /** Specifies whether the element should be hidden. */
53
+ hidden?: boolean | string;
54
+ /** A unique identifier for the element. */
55
+ id?: string;
56
+ /** Keys tell React which array item each component corresponds to */
57
+ key?: string | number;
58
+ /** Specifies the language of the element. */
59
+ lang?: string;
60
+ /** 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. */
61
+ part?: string;
62
+ /** Use the ref attribute with a variable to assign a DOM element to the variable once the element is rendered. */
63
+ ref?: T | ((e: T) => void);
64
+ /** Adds a reference for a custom element slot */
65
+ slot?: string;
66
+ /** Prop for setting inline styles */
67
+ style?: Record<string, string | number>;
68
+ /** Overrides the default Tab button behavior. Avoid using values other than -1 and 0. */
69
+ tabIndex?: number;
70
+ /** Specifies the tooltip text for the element. */
71
+ title?: string;
72
+ /** Passing 'no' excludes the element content from being translated. */
73
+ translate?: "yes" | "no";
74
+ /** The popover global attribute is used to designate an element as a popover element. */
75
+ popover?: "auto" | "hint" | "manual";
76
+ /** Turns an element element into a popover control button; takes the ID of the popover element to control as its value. */
77
+ popovertarget?: "top" | "bottom" | "left" | "right" | "auto";
78
+ /** Specifies the action to be performed on a popover element being controlled by a control element. */
79
+ popovertargetaction?: "show" | "hide" | "toggle";
80
+
81
+ } ;
82
+
83
+ type BaseEvents = {
84
+
85
+
86
+ };
87
+
88
+
89
+
90
+ export type OrVaadinCheckboxProps = {
91
+
92
+
93
+ }
94
+
95
+
96
+ export type OrVaadinDialogProps = {
97
+
98
+
99
+ }
100
+
101
+
102
+ export type OrVaadinInputProps = {
103
+ /** The input type that determines which Vaadin component to render.
104
+ Refer to InputType and OrVaadinInput.TEMPLATES for the supported types. */
105
+ "type"?: OrVaadinInput['type'];
106
+
107
+ /** */
108
+ "onchange"?: (e: CustomEvent<CustomEvent>) => void;
109
+ }
110
+
111
+
112
+ export type OrVaadinNumberfieldProps = {
113
+
114
+ /** */
115
+ "onsubmit"?: (e: CustomEvent<CustomEvent>) => void;
116
+ }
117
+
118
+
119
+ export type OrVaadinPasswordFieldProps = {
120
+
121
+ /** */
122
+ "onsubmit"?: (e: CustomEvent<CustomEvent>) => void;
123
+ }
124
+
125
+
126
+ export type OrVaadinSelectProps = {
127
+
128
+
129
+ }
130
+
131
+
132
+ export type OrVaadinTextareaProps = {
133
+
134
+ /** */
135
+ "onsubmit"?: (e: CustomEvent<CustomEvent>) => void;
136
+ }
137
+
138
+
139
+ export type OrVaadinTextfieldProps = {
140
+
141
+ /** */
142
+ "onsubmit"?: (e: CustomEvent<CustomEvent>) => void;
143
+ }
144
+
145
+ export type CustomElements = {
146
+
147
+
148
+ /**
149
+ *
150
+ */
151
+ "or-vaadin-checkbox": Partial<OrVaadinCheckboxProps & BaseProps<OrVaadinCheckbox> & BaseEvents>;
152
+
153
+
154
+ /**
155
+ *
156
+ */
157
+ "or-vaadin-dialog": Partial<OrVaadinDialogProps & BaseProps<OrVaadinDialog> & BaseEvents>;
158
+
159
+
160
+ /**
161
+ * Custom element that wraps various Vaadin input components based on the specified `type`.
162
+ * Provides a unified interface for interacting with different types of inputs.
163
+ *
164
+ * ## Attributes & Properties
165
+ *
166
+ * Component attributes and properties that can be applied to the element or by using JavaScript.
167
+ *
168
+ * - `type`: The input type that determines which Vaadin component to render.
169
+ * Refer to InputType and OrVaadinInput.TEMPLATES for the supported types.
170
+ * - `native`: Returns the native Vaadin input element. (property only) (readonly)
171
+ * - `nativeValue`: Returns the value of the native Vaadin input element. (property only) (readonly)
172
+ *
173
+ * ## Events
174
+ *
175
+ * Events that will be emitted by the component.
176
+ *
177
+ * - `change`: undefined
178
+ *
179
+ * ## Methods
180
+ *
181
+ * Methods that can be called to access component functionality.
182
+ *
183
+ * - `checkValidity() => boolean`: Function that returns a boolean which indicates if the element meets any constraint validation rules applied to it.
184
+ * - `getCheckboxTemplate(onChange?: (e: Event) => void) => void`: undefined
185
+ * - `getNumberFieldTemplate(onChange?: (e: Event) => void) => void`: undefined
186
+ * - `getTextAreaTemplate(onChange?: (e: Event) => void) => void`: undefined
187
+ * - `getTextFieldTemplate(onChange?: (e: Event) => void) => void`: undefined
188
+ * - `getPasswordFieldTemplate(onChange?: (e: Event) => void) => void`: undefined
189
+ * - `getSelectTemplate(onChange?: (e: Event) => void) => void`: undefined
190
+ */
191
+ "or-vaadin-input": Partial<OrVaadinInputProps & BaseProps<OrVaadinInput> & BaseEvents>;
192
+
193
+
194
+ /**
195
+ *
196
+ *
197
+ * ## Events
198
+ *
199
+ * Events that will be emitted by the component.
200
+ *
201
+ * - `submit`: undefined
202
+ *
203
+ * ## Methods
204
+ *
205
+ * Methods that can be called to access component functionality.
206
+ *
207
+ * - `_onEnter(ev: KeyboardEvent) => void`: undefined
208
+ */
209
+ "or-vaadin-numberfield": Partial<OrVaadinNumberfieldProps & BaseProps<OrVaadinNumberfield> & BaseEvents>;
210
+
211
+
212
+ /**
213
+ *
214
+ *
215
+ * ## Events
216
+ *
217
+ * Events that will be emitted by the component.
218
+ *
219
+ * - `submit`: undefined
220
+ *
221
+ * ## Methods
222
+ *
223
+ * Methods that can be called to access component functionality.
224
+ *
225
+ * - `_onEnter(ev: KeyboardEvent) => void`: undefined
226
+ */
227
+ "or-vaadin-passwordfield": Partial<OrVaadinPasswordFieldProps & BaseProps<OrVaadinPasswordField> & BaseEvents>;
228
+
229
+
230
+ /**
231
+ *
232
+ */
233
+ "or-vaadin-select": Partial<OrVaadinSelectProps & BaseProps<OrVaadinSelect> & BaseEvents>;
234
+
235
+
236
+ /**
237
+ *
238
+ *
239
+ * ## Events
240
+ *
241
+ * Events that will be emitted by the component.
242
+ *
243
+ * - `submit`: undefined
244
+ *
245
+ * ## Methods
246
+ *
247
+ * Methods that can be called to access component functionality.
248
+ *
249
+ * - `_onEnter(ev: KeyboardEvent) => void`: undefined
250
+ */
251
+ "or-vaadin-textarea": Partial<OrVaadinTextareaProps & BaseProps<OrVaadinTextarea> & BaseEvents>;
252
+
253
+
254
+ /**
255
+ *
256
+ *
257
+ * ## Events
258
+ *
259
+ * Events that will be emitted by the component.
260
+ *
261
+ * - `submit`: undefined
262
+ *
263
+ * ## Methods
264
+ *
265
+ * Methods that can be called to access component functionality.
266
+ *
267
+ * - `_onEnter(ev: KeyboardEvent) => void`: undefined
268
+ */
269
+ "or-vaadin-textfield": Partial<OrVaadinTextfieldProps & BaseProps<OrVaadinTextfield> & BaseEvents>;
270
+ }
271
+
272
+ export type CustomCssProperties = {
273
+
274
+ }
275
+
276
+
277
+ declare module 'react' {
278
+ namespace JSX {
279
+ interface IntrinsicElements extends CustomElements {}
280
+ }
281
+ export interface CSSProperties extends CustomCssProperties {}
282
+ }
283
+
284
+ declare module 'preact' {
285
+ namespace JSX {
286
+ interface IntrinsicElements extends CustomElements {}
287
+ }
288
+ export interface CSSProperties extends CustomCssProperties {}
289
+ }
290
+
291
+ declare module '@builder.io/qwik' {
292
+ namespace JSX {
293
+ interface IntrinsicElements extends CustomElements {}
294
+ }
295
+ export interface CSSProperties extends CustomCssProperties {}
296
+ }
297
+
298
+ declare module '@stencil/core' {
299
+ namespace JSX {
300
+ interface IntrinsicElements extends CustomElements {}
301
+ }
302
+ export interface CSSProperties extends CustomCssProperties {}
303
+ }
304
+
305
+ declare module 'hono/jsx' {
306
+ namespace JSX {
307
+ interface IntrinsicElements extends CustomElements {}
308
+ }
309
+ export interface CSSProperties extends CustomCssProperties {}
310
+ }
311
+
312
+ declare module 'react-native' {
313
+ namespace JSX {
314
+ interface IntrinsicElements extends CustomElements {}
315
+ }
316
+ export interface CSSProperties extends CustomCssProperties {}
317
+ }
318
+
319
+ declare global {
320
+ namespace JSX {
321
+ interface IntrinsicElements extends CustomElements {}
322
+ }
323
+ export interface CSSProperties extends CustomCssProperties {}
324
+ }