@iobroker/gui-components 10.2.0 → 10.2.1

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 +7 -1
  2. package/build/Components/ColorPicker.d.ts +94 -12
  3. package/build/Components/ColorPicker.js +567 -111
  4. package/build/Components/ColorPicker.js.map +1 -1
  5. package/build/Components/ObjectBrowser/dialogs.js +7 -3
  6. package/build/Components/ObjectBrowser/dialogs.js.map +1 -1
  7. package/build/Components/ObjectBrowser/renderLeaf.js +29 -10
  8. package/build/Components/ObjectBrowser/renderLeaf.js.map +1 -1
  9. package/build/Components/Schedule.js +176 -78
  10. package/build/Components/Schedule.js.map +1 -1
  11. package/build/Components/TreeTable.d.ts +6 -2
  12. package/build/Components/TreeTable.js +183 -103
  13. package/build/Components/TreeTable.js.map +1 -1
  14. package/build/Dialogs/Error.js +26 -5
  15. package/build/Dialogs/Error.js.map +1 -1
  16. package/build/i18n/de.json +20 -0
  17. package/build/i18n/en.json +20 -0
  18. package/build/i18n/es.json +20 -0
  19. package/build/i18n/fr.json +20 -0
  20. package/build/i18n/it.json +20 -0
  21. package/build/i18n/nl.json +20 -0
  22. package/build/i18n/pl.json +20 -0
  23. package/build/i18n/pt.json +20 -0
  24. package/build/i18n/ru.json +20 -0
  25. package/build/i18n/uk.json +20 -0
  26. package/build/i18n/zh-cn.json +20 -0
  27. package/build/index.d.ts +2 -1
  28. package/build/index.js +1 -1
  29. package/build/index.js.map +1 -1
  30. package/i18n/de.json +20 -0
  31. package/i18n/en.json +20 -0
  32. package/i18n/es.json +20 -0
  33. package/i18n/fr.json +20 -0
  34. package/i18n/it.json +20 -0
  35. package/i18n/nl.json +20 -0
  36. package/i18n/pl.json +20 -0
  37. package/i18n/pt.json +20 -0
  38. package/i18n/ru.json +20 -0
  39. package/i18n/uk.json +20 -0
  40. package/i18n/zh-cn.json +20 -0
  41. package/package.json +1 -3
package/README.md CHANGED
@@ -36,7 +36,7 @@ npm create vite@latest src -- --template react-ts
36
36
  "dependencies": {
37
37
  "@emotion/react": "^11.14.0",
38
38
  "@emotion/styled": "^11.14.1",
39
- "@iobroker/gui-components": "^10.2.0",
39
+ "@iobroker/gui-components": "^10.2.1",
40
40
  "@mui/icons-material": "^9.0.1",
41
41
  "@mui/material": "^9.0.1",
42
42
  "react": "^19.2.5",
@@ -877,6 +877,12 @@ You can find the migration instructions:
877
877
  -->
878
878
 
879
879
  ## Changelog
880
+ ### 10.2.1 (2026-08-31)
881
+
882
+ - (@GermanBluefox) Changed layouts for some components
883
+ - (@GermanBluefox) Color picker was updated
884
+ - (@GermanBluefox) Schedule wizard was updated
885
+
880
886
  ### 10.2.0 (2026-08-26)
881
887
 
882
888
  - (@krobipd) Corrected: the object browser stayed empty after closing the object customization dialog if any object was changed while the dialog was open (ioBroker/ioBroker.admin#3391)
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2018-2024 Denis Haev (bluefox) <dogafox@gmail.com>
2
+ * Copyright 2018-2026 Denis Haev (bluefox) <dogafox@gmail.com>
3
3
  *
4
4
  * Licensed under the Creative Commons Attribution-NonCommercial License, Version 4.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -14,8 +14,36 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import React, { Component, type CSSProperties } from 'react';
17
- import { type RGBColor } from 'react-color';
17
+ import { type RgbaColor } from 'react-colorful';
18
18
  import type { IobTheme } from '../types';
19
+ /** Color in the `{ r, g, b, a }` notation. Kept for backwards compatibility with `react-color`. */
20
+ export interface RGBColor {
21
+ r: number;
22
+ g: number;
23
+ b: number;
24
+ a?: number;
25
+ }
26
+ /** Notation used for the value that is reported via `onChange`. */
27
+ export type ColorPickerFormat = 'hex' | 'rgb' | 'hsl';
28
+ /**
29
+ * Parse any CSS color notation into `{ r, g, b, a }`.
30
+ *
31
+ * Supported are `#rgb`, `#rgba`, `#rrggbb`, `#rrggbbaa`, `rgb()`, `rgba()`, `hsl()`, `hsla()` (comma or space
32
+ * separated, with or without the `/ alpha` part) and every color name the browser knows.
33
+ *
34
+ * @param color The color string to parse.
35
+ * @returns the parsed color or null if the string could not be interpreted.
36
+ */
37
+ export declare function parseColor(color: string): RgbaColor | null;
38
+ /**
39
+ * Render `{ r, g, b, a }` in the requested notation.
40
+ *
41
+ * @param color The color to render.
42
+ * @param format The desired notation.
43
+ * @param noAlpha If true, the alpha channel is dropped.
44
+ * @returns the color as CSS string.
45
+ */
46
+ export declare function formatColor(color: RgbaColor, format: ColorPickerFormat, noAlpha?: boolean): string;
19
47
  interface ColorPickerProps {
20
48
  /** Set to true to disable the color picker. */
21
49
  disabled?: boolean;
@@ -33,19 +61,38 @@ interface ColorPickerProps {
33
61
  style?: CSSProperties;
34
62
  /** The CSS class name. */
35
63
  className?: string;
64
+ /** Predefined colors that are offered below the picker. */
36
65
  customPalette?: string[];
66
+ /** Do not show the text field with the color value, only the color bar. */
37
67
  noInputField?: boolean;
68
+ /** Width of the color bar. */
38
69
  barWidth?: number;
39
70
  sx?: Record<string, any>;
71
+ /** @deprecated the theme is taken from the MUI context */
40
72
  theme?: IobTheme;
73
+ /** Hide the alpha slider and always report a fully opaque color. */
74
+ noAlpha?: boolean;
75
+ /** Notation of the reported value. If not set, it is taken from the incoming value and defaults to `rgb`. */
76
+ format?: ColorPickerFormat;
77
+ /** Do not offer the recently used colors. */
78
+ noRecentColors?: boolean;
79
+ /** Width of the picker popup in pixels. Default 280. */
80
+ pickerWidth?: number;
81
+ /** ID of the text field. Must be set if more than one color picker is rendered at the same time. */
82
+ id?: string;
41
83
  }
42
84
  interface ColorPickerState {
43
85
  displayColorPicker: boolean;
44
- color: string | RGBColor;
86
+ /** The working color of the picker. Always valid, even if no color is selected. */
87
+ rgba: RgbaColor;
88
+ /** The text shown in the input field. An empty string means "no color selected". */
89
+ textValue: string;
90
+ format: ColorPickerFormat;
45
91
  anchorEl: HTMLDivElement | null;
92
+ recentColors: string[];
46
93
  }
47
94
  /**
48
- * A color picker component.
95
+ * A color picker component with alpha channel, eye dropper and HEX/RGB/HSL notations.
49
96
  */
50
97
  export declare class ColorPicker extends Component<ColorPickerProps, ColorPickerState> {
51
98
  /**
@@ -54,8 +101,12 @@ export declare class ColorPicker extends Component<ColorPickerProps, ColorPicker
54
101
  * @param props The properties.
55
102
  */
56
103
  constructor(props: ColorPickerProps);
57
- private handleClick;
58
- private handleClose;
104
+ /**
105
+ * If the props are updated from outside, they should override the state
106
+ *
107
+ * @param prevProps The previous properties.
108
+ */
109
+ componentDidUpdate(prevProps: ColorPickerProps): void;
59
110
  /**
60
111
  * Convert the given color to hex ('#rrggbb') or rgba ('rgba(r,g,b,a)') format.
61
112
  *
@@ -72,15 +123,46 @@ export declare class ColorPicker extends Component<ColorPickerProps, ColorPicker
72
123
  * @param rgb The color in rgb() or rgba() format. if not in this format, the color will be returned as is.
73
124
  */
74
125
  static rgb2hex(rgb: string): string;
75
- private handleChange;
76
126
  /**
77
- * If the props are updated from outside, they should override the state
127
+ * Read the recently used colors from the local storage.
128
+ */
129
+ static readRecentColors(): string[];
130
+ /**
131
+ * Remember the given color as recently used.
132
+ *
133
+ * @param color The color to remember.
134
+ */
135
+ storeRecentColor(color: string): void;
136
+ private handleClick;
137
+ private handleClose;
138
+ /**
139
+ * The user moved a slider, clicked a swatch or used the eye dropper.
140
+ *
141
+ * @param rgba The new color.
142
+ */
143
+ private handleColorChange;
144
+ /**
145
+ * The user typed into the input field. The text is taken as it is and only parsed for the preview.
146
+ *
147
+ * @param textValue The entered text.
148
+ */
149
+ private handleTextChange;
150
+ /**
151
+ * Switch between the #rrggbb, rgba() and hsla() notations.
152
+ *
153
+ * @param format The new notation.
154
+ */
155
+ private handleFormatChange;
156
+ private handleClear;
157
+ private handleEyeDropper;
158
+ /**
159
+ * Render a row of predefined colors.
78
160
  *
79
- * @param _prevProps The previous properties.
80
- * @param prevState The previous state.
161
+ * @param colors The colors to show.
162
+ * @param title The title above the row.
81
163
  */
82
- componentDidUpdate(_prevProps: ColorPickerProps, prevState: ColorPickerState): void;
83
- renderCustomPalette(): React.JSX.Element | null;
164
+ renderSwatches(colors: string[], title: string): React.JSX.Element | null;
165
+ renderPicker(): React.JSX.Element;
84
166
  render(): React.JSX.Element;
85
167
  }
86
168
  export {};