@iobroker/adapter-react-v5 4.13.6 → 4.13.7

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.
@@ -1,137 +1,42 @@
1
- export default _export;
2
- export type Rgb = {
3
- /**
4
- * The red component of the color (0-255).
5
- */
6
- r: number;
7
- /**
8
- * The green component of the color (0-255).
9
- */
10
- g: number;
11
- /**
12
- * The blue component of the color (0-255).
13
- */
14
- b: number;
15
- /**
16
- * The alpha component of the color (0-255).
17
- */
18
- a: number;
19
- };
20
1
  /**
21
- * Definition of a color.
2
+ * Copyright 2018-2024 Denis Haev (bluefox) <dogafox@gmail.com>
3
+ *
4
+ * Licensed under the Creative Commons Attribution-NonCommercial License, Version 4.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://creativecommons.org/licenses/by-nc/4.0/legalcode.txt
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
22
15
  */
23
- export type Color = string | Rgb | {
24
- rgb: Rgb;
25
- };
26
- export type ColorPickerProps = {
27
- /**
28
- * Set to true to disable the color picker.
29
- */
16
+ import React from 'react';
17
+ interface ColorPickerProps {
18
+ /** Set to true to disable the color picker. */
30
19
  disabled?: boolean;
31
- /**
32
- * The currently selected color.
33
- */
34
- value?: Color;
35
- /**
36
- * The color change callback.
37
- */
38
- onChange?: (rgba: string) => void;
39
- /**
40
- * The name.
41
- */
20
+ /** The currently selected color. */
21
+ value?: string;
22
+ /** @deprecated The currently selected color use value */
23
+ color?: string;
24
+ /** The color change callback. */
25
+ onChange: (rgba: string) => void;
26
+ /** Label of the color picker. */
27
+ label?: string;
28
+ /** @deprecated TLabel of the color picker use label */
42
29
  name?: string;
43
- /**
44
- * Additional styling for this component.
45
- */
30
+ /** Additional styling for this component. */
46
31
  style?: React.CSSProperties;
47
- /**
48
- * The CSS class name.
49
- */
32
+ /** The CSS class name. */
50
33
  className?: string;
51
- /**
52
- * Open the color picker above the field?
53
- */
34
+ /** Open the color picker above the field? */
54
35
  openAbove?: boolean;
55
- };
56
- /** @type {typeof ColorPicker} */
57
- declare const _export: typeof ColorPicker;
58
- import React from 'react';
59
- /**
60
- * @typedef {object} Rgb
61
- * @property {number} r The red component of the color (0-255).
62
- * @property {number} g The green component of the color (0-255).
63
- * @property {number} b The blue component of the color (0-255).
64
- * @property {number} a The alpha component of the color (0-255).
65
- *
66
- * @typedef {string | Rgb | { rgb: Rgb }} Color Definition of a color.
67
- *
68
- * @typedef {object} ColorPickerProps
69
- * @property {boolean} [disabled] Set to true to disable the color picker.
70
- * @property {Color} [value] The currently selected color.
71
- * @property {(rgba: string) => void} [onChange] The color change callback.
72
- * @property {string} [name] The name.
73
- * @property {React.CSSProperties} [style] Additional styling for this component.
74
- * @property {string} [className] The CSS class name.
75
- * @property {boolean} [openAbove] Open the color picker above the field?
76
- *
77
- * @extends {React.Component<ColorPickerProps>}
78
- */
79
- declare class ColorPicker extends React.Component<ColorPickerProps, any, any> {
80
- /**
81
- * Convert the given color to hex ('#rrggbb') or rgba ('rgba(r,g,b,a)') format.
82
- * @param {Color} [color]
83
- * @param {boolean} [isHex] The returning string should be in hex format
84
- * @returns {string} the hex or rgba representation of the given color.
85
- */
86
- static getColor(color?: Color, isHex?: boolean): string;
87
- /**
88
- * Convert rgb() or rgba() format to hex format #rrggbb.
89
- * @param {string} rgb
90
- * @returns {string}
91
- */
92
- static rgb2hex(rgb: string): string;
93
- /**
94
- * @param {Readonly<ColorPickerProps>} props
95
- */
96
- constructor(props: Readonly<ColorPickerProps>);
97
- state: {
98
- displayColorPicker: boolean;
99
- color: any;
100
- anchorEl: any;
101
- };
102
- /**
103
- * @private
104
- */
105
- private handleClick;
106
- /**
107
- * @private
108
- */
109
- private handleClose;
110
- /**
111
- * @private
112
- */
113
- private handleChange;
114
- /**
115
- * IF the props are updated from outside, they should override the state
116
- * @param _prevProps
117
- * @param prevState
118
- */
119
- componentDidUpdate(_prevProps: any, prevState: any): void;
120
- renderCustomPalette(): React.JSX.Element;
121
- render(): React.JSX.Element;
122
- }
123
- declare namespace ColorPicker {
124
- namespace propTypes {
125
- let disabled: PropTypes.Requireable<boolean>;
126
- let value: PropTypes.Requireable<string>;
127
- let onChange: PropTypes.Validator<(...args: any[]) => any>;
128
- let label: PropTypes.Requireable<string>;
129
- let name: PropTypes.Requireable<string>;
130
- let style: PropTypes.Requireable<object>;
131
- let className: PropTypes.Requireable<string>;
132
- let customPalette: PropTypes.Requireable<any[]>;
133
- let noInputField: PropTypes.Requireable<boolean>;
134
- let barWidth: PropTypes.Requireable<number>;
135
- }
36
+ customPalette?: string[];
37
+ noInputField?: boolean;
38
+ barWidth?: number;
39
+ classes: Record<string, string>;
136
40
  }
137
- import PropTypes from 'prop-types';
41
+ declare const _default: React.JSXElementConstructor<Omit<ColorPickerProps, "classes"> & import("@mui/styles").StyledComponentProps<string> & object>;
42
+ export default _default;