@iobroker/adapter-react-v5 4.0.3 → 4.0.4
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/Components/ColorPicker.js +2 -2
- package/Components/ColorPicker.js.map +1 -1
- package/README.md +2 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPicker.js","names":["styles","theme","color","width","height","borderRadius","delButton","marginTop","swatch","padding","background","boxShadow","display","cursor","verticalAlign","swatchDisabled","opacity","popover","backgroundColor","textAlign","popoverList","closeButton","palette","paper","secondary","main","cover","position","top","right","bottom","left","textDense","marginBottom","picker","iconButton","button","minWidth","minHeight","ColorPicker","props","e","setState","displayColorPicker","state","anchorEl","currentTarget","onChange","getColor","value","customPalette","flexWrap","map","classes","handleChange","setTimeout","handleClose","style","className","disabled","marginRight","name","root","target","handleClick","list","_color","renderCustomPalette","pColor","sColor","isHex","rgb","r","toString","padStart","g","b","a","rgb2hex","m","match","parseInt","length","React","Component","propTypes","PropTypes","bool","string","func","isRequired","object","array","_export","withStyles"],"sources":["ColorPicker.js"],"sourcesContent":["/**\n * Copyright 2018-2022 bluefox <dogafox@gmail.com>\n *\n * Licensed under the Creative Commons Attribution-NonCommercial License, Version 4.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://creativecommons.org/licenses/by-nc/4.0/legalcode.txt\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\nimport React from 'react';\nimport { ChromePicker } from 'react-color';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\n\nimport { TextField, Menu, IconButton, Button } from '@mui/material';\nimport { Delete as IconDelete, Close as IconClose } from '@mui/icons-material';\n\nconst styles = theme => ({\n color: {\n width: 36,\n height: 14,\n borderRadius: 2,\n },\n delButton: {\n // width: 32,\n // height: 32,\n marginTop: 16,\n },\n swatch: {\n marginTop: 16,\n padding: 5,\n background: '#fff',\n borderRadius: 1,\n boxShadow: '0 0 0 1px rgba(0,0,0,.1)',\n display: 'inline-block',\n cursor: 'pointer',\n verticalAlign: 'middle',\n },\n swatchDisabled: {\n opacity: 0.5,\n cursor: 'default',\n },\n popover: {\n // position: 'absolute',\n // zIndex: 2,\n backgroundColor: '#00000000',\n textAlign: 'right',\n },\n popoverList: {\n padding: 0,\n },\n closeButton: {\n backgroundColor: `${theme.palette.background.paper} !important`,\n borderRadius: '0 0 25% 25%',\n '&:hover': {\n backgroundColor: `${theme.palette.secondary.main} !important`,\n },\n },\n cover: {\n position: 'fixed',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n },\n textDense: {\n marginTop: 0,\n marginBottom: 0,\n },\n picker: {\n background: `${theme.palette.background.paper} !important`,\n },\n iconButton: {\n width: 24,\n height: 24,\n },\n button: {\n width: 32,\n height: 32,\n minWidth: 32,\n minHeight: 32,\n },\n});\n\n/**\n * @typedef {object} Rgb\n * @property {number} r The red component of the color (0-255).\n * @property {number} g The green component of the color (0-255).\n * @property {number} b The blue component of the color (0-255).\n * @property {number} a The alpha component of the color (0-255).\n *\n * @typedef {string | Rgb | { rgb: Rgb }} Color Definition of a color.\n *\n * @typedef {object} ColorPickerProps\n * @property {boolean} [disabled] Set to true to disable the color picker.\n * @property {Color} [value] The currently selected color.\n * @property {(rgba: string) => void} [onChange] The color change callback.\n * @property {string} [name] The name.\n * @property {React.CSSProperties} [style] Additional styling for this component.\n * @property {string} [className] The CSS class name.\n * @property {boolean} [openAbove] Open the color picker above the field?\n *\n * @extends {React.Component<ColorPickerProps>}\n */\nclass ColorPicker extends React.Component {\n /**\n * @param {Readonly<ColorPickerProps>} props\n */\n constructor(props) {\n super(props);\n this.state = {\n displayColorPicker: false,\n color: this.props.value || this.props.color,\n anchorEl: null,\n };\n }\n\n /**\n * Get the state derived from the given properties and state.\n * @param {{ color: Color; }} props\n * @param {{ color: Color; }} state\n */\n static getDerivedStateFromProps(props, state) {\n const pColor = ColorPicker.getColor(props.value || props.color);\n const sColor = ColorPicker.getColor(state.color);\n if (pColor !== sColor) {\n return { color: props.value || props.color };\n }\n return null;\n }\n\n /**\n * @private\n */\n handleClick = e => {\n this.setState({ displayColorPicker: !this.state.displayColorPicker, anchorEl: this.state.displayColorPicker ? null : e.currentTarget });\n };\n\n /**\n * @private\n */\n handleClose = () => {\n this.setState({ displayColorPicker: false, anchorEl: null });\n };\n\n /**\n * Convert the given color to hex ('#rrggbb') or rgba ('rgba(r,g,b,a)') format.\n * @param {Color} [color]\n * @param {boolean} [isHex] The returning string should be in hex format\n * @returns {string} the hex or rgba representation of the given color.\n */\n static getColor(color, isHex) {\n if (color && typeof color === 'object') {\n if (color.rgb) {\n if (isHex) {\n return `#${color.rgb.r.toString(16).padStart(2, '0')}${color.rgb.g.toString(16).padStart(2, '0')}${color.rgb.b.toString(16).padStart(2, '0')}`;\n }\n return `rgba(${color.rgb.r},${color.rgb.g},${color.rgb.b},${color.rgb.a})`;\n }\n if (isHex) {\n return `#${color.r.toString(16).padStart(2, '0')}${color.g.toString(16).padStart(2, '0')}${color.b.toString(16).padStart(2, '0')}`;\n }\n return `rgba(${color.r},${color.g},${color.b},${color.a})`;\n }\n return isHex ? ColorPicker.rgb2hex(color || '') : color || '';\n }\n\n /**\n * Convert rgb() or rgba() format to hex format #rrggbb.\n * @param {string} rgb\n * @returns {string}\n */\n static rgb2hex(rgb) {\n const m = rgb.match(/^rgba?[\\s+]?\\([\\s+]?(\\d+)[\\s+]?,[\\s+]?(\\d+)[\\s+]?,[\\s+]?(\\d+)[\\s+]?/i);\n\n const r = parseInt(m[1], 10).toString(16).padStart(2, '0');\n const g = parseInt(m[2], 10).toString(16).padStart(2, '0');\n const b = parseInt(m[3], 10).toString(16).padStart(2, '0');\n\n return m && m.length === 4 ? `#${r}${g}${b}` : rgb;\n }\n\n /**\n * @private\n */\n handleChange = color => {\n this.setState({ color }, () =>\n this.props.onChange && this.props.onChange(ColorPicker.getColor(color)));\n };\n\n renderCustomPalette() {\n if (!this.props.customPalette) {\n return null;\n }\n return <div style={{ width: '100%', display: 'flex', flexWrap: 'flex' }}>\n {this.props.customPalette.map(color =>\n <Button\n className={this.props.classes.button}\n key={color}\n onClick={() => {\n this.handleChange(color);\n setTimeout(() => this.handleClose(), 300);\n }}\n >\n <div className={this.props.classes.iconButton} style={{ background: color }} />\n </Button>)}\n </div>;\n }\n\n render() {\n const color = ColorPicker.getColor(this.state.color);\n\n const style = {...(this.props.style || {})};\n style.position = 'relative';\n\n return <div\n style={ style }\n className={this.props.className || ''}\n >\n <TextField\n disabled={this.props.disabled}\n variant=\"standard\"\n id=\"name\"\n style={color ? { width: 'calc(100% - 80px)' } : { width: 'calc(100% - 54px)', marginRight: 8 }}\n label={ this.props.name || 'color' }\n value={color}\n margin=\"dense\"\n classes={{ root: this.props.classes.textDense }}\n onChange={e => this.handleChange(e.target.value)}\n />\n {color ? <IconButton\n disabled={this.props.disabled}\n onClick={() => this.handleChange('')}\n size=\"small\"\n className={this.props.classes.delButton}\n style={color ? {} : { opacity: 0, cursor: 'default' }}\n >\n <IconDelete />\n </IconButton> : null}\n <div className={`${this.props.classes.swatch}${this.props.disabled ? ` ${this.props.classes.swatchDisabled}` : ''}`} onClick={e => !this.props.disabled && this.handleClick(e)}>\n <div className={this.props.classes.color} style={{ background: color }} />\n </div>\n { this.state.displayColorPicker && !this.props.disabled ? <Menu\n classes={{ paper: this.props.classes.popover, list: this.props.classes.popoverList }}\n anchorEl={this.state.anchorEl}\n open={!0}\n onClose={() => this.handleClose()}\n >\n <ChromePicker\n className={this.props.classes.picker}\n color={this.state.color}\n onChangeComplete={_color => this.handleChange(_color)}\n styles={{ picker: { background: '#112233' } }}\n />\n <IconButton className={this.props.classes.closeButton} onClick={() => this.handleClose()}><IconClose /></IconButton>\n {this.renderCustomPalette()}\n </Menu> : null }\n </div>;\n }\n}\n\nColorPicker.propTypes = {\n disabled: PropTypes.bool,\n value: PropTypes.string,\n onChange: PropTypes.func.isRequired,\n name: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n customPalette: PropTypes.array,\n};\n\n/** @type {typeof ColorPicker} */\nconst _export = withStyles(styles)(ColorPicker);\nexport default _export;\n"],"mappings":";;;;;;;;;;;;;;;AAeA;AACA;AACA;AACA;AAEA;AACA;AAA+E;AAAA;AAAA;AAAA;AAE/E,IAAMA,MAAM,GAAG,SAATA,MAAM,CAAGC,KAAK;EAAA,OAAK;IACrBC,KAAK,EAAE;MACHC,KAAK,EAAE,EAAE;MACTC,MAAM,EAAE,EAAE;MACVC,YAAY,EAAE;IAClB,CAAC;IACDC,SAAS,EAAE;MACP;MACA;MACAC,SAAS,EAAE;IACf,CAAC;IACDC,MAAM,EAAE;MACJD,SAAS,EAAE,EAAE;MACbE,OAAO,EAAE,CAAC;MACVC,UAAU,EAAE,MAAM;MAClBL,YAAY,EAAE,CAAC;MACfM,SAAS,EAAE,0BAA0B;MACrCC,OAAO,EAAE,cAAc;MACvBC,MAAM,EAAE,SAAS;MACjBC,aAAa,EAAE;IACnB,CAAC;IACDC,cAAc,EAAE;MACZC,OAAO,EAAE,GAAG;MACZH,MAAM,EAAE;IACZ,CAAC;IACDI,OAAO,EAAE;MACL;MACA;MACAC,eAAe,EAAE,WAAW;MAC5BC,SAAS,EAAE;IACf,CAAC;IACDC,WAAW,EAAE;MACTX,OAAO,EAAE;IACb,CAAC;IACDY,WAAW,EAAE;MACTH,eAAe,YAAKjB,KAAK,CAACqB,OAAO,CAACZ,UAAU,CAACa,KAAK,gBAAa;MAC/DlB,YAAY,EAAE,aAAa;MAC3B,SAAS,EAAE;QACPa,eAAe,YAAKjB,KAAK,CAACqB,OAAO,CAACE,SAAS,CAACC,IAAI;MACpD;IACJ,CAAC;IACDC,KAAK,EAAE;MACHC,QAAQ,EAAE,OAAO;MACjBC,GAAG,EAAE,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GG,CAAC,SAAGC,CAAC,IAAKL,GAAG;IACtD;;IAEA;AACJ;AACA;EAFI;EAAA;AAAA,EA9EsBY,iBAAK,CAACC,SAAS;AA6JzC7C,WAAW,CAAC8C,SAAS,GAAG;EACpB1B,QAAQ,EAAE2B,qBAAS,CAACC,IAAI;EACxBtC,KAAK,EAAEqC,qBAAS,CAACE,MAAM;EACvBzC,QAAQ,EAAEuC,qBAAS,CAACG,IAAI,CAACC,UAAU;EACnC7B,IAAI,EAAEyB,qBAAS,CAACE,MAAM;EACtB/B,KAAK,EAAE6B,qBAAS,CAACK,MAAM;EACvBjC,SAAS,EAAE4B,qBAAS,CAACE,MAAM;EAC3BtC,aAAa,EAAEoC,qBAAS,CAACM;AAC7B,CAAC;;AAED;AACA,IAAMC,OAAO,GAAG,IAAAC,sBAAU,EAAC9F,MAAM,CAAC,CAACuC,WAAW,CAAC;AAAC,eACjCsD,OAAO;AAAA"}
|
|
1
|
+
{"version":3,"file":"ColorPicker.js","names":["styles","theme","color","width","height","borderRadius","delButton","marginTop","swatch","padding","background","boxShadow","display","cursor","verticalAlign","swatchDisabled","opacity","popover","backgroundColor","textAlign","popoverList","closeButton","palette","paper","secondary","main","cover","position","top","right","bottom","left","textDense","marginBottom","picker","iconButton","button","minWidth","minHeight","ColorPicker","props","e","setState","displayColorPicker","state","anchorEl","currentTarget","onChange","getColor","value","customPalette","flexWrap","map","classes","handleChange","setTimeout","handleClose","style","className","disabled","marginRight","name","root","target","handleClick","list","_color","renderCustomPalette","pColor","sColor","isHex","rgb","r","toString","padStart","g","b","a","rgb2hex","m","match","parseInt","length","React","Component","propTypes","PropTypes","bool","string","func","isRequired","object","array","_export","withStyles"],"sources":["ColorPicker.js"],"sourcesContent":["/**\n * Copyright 2018-2022 bluefox <dogafox@gmail.com>\n *\n * Licensed under the Creative Commons Attribution-NonCommercial License, Version 4.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://creativecommons.org/licenses/by-nc/4.0/legalcode.txt\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\nimport React from 'react';\nimport { ChromePicker } from 'react-color';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\n\nimport { TextField, Menu, IconButton, Button } from '@mui/material';\nimport { Delete as IconDelete, Close as IconClose } from '@mui/icons-material';\n\nconst styles = theme => ({\n color: {\n width: 36,\n height: 14,\n borderRadius: 2,\n },\n delButton: {\n // width: 32,\n // height: 32,\n marginTop: 16,\n },\n swatch: {\n marginTop: 16,\n padding: 5,\n background: '#fff',\n borderRadius: 1,\n boxShadow: '0 0 0 1px rgba(0,0,0,.1)',\n display: 'inline-block',\n cursor: 'pointer',\n verticalAlign: 'middle',\n },\n swatchDisabled: {\n opacity: 0.5,\n cursor: 'default',\n },\n popover: {\n // position: 'absolute',\n // zIndex: 2,\n backgroundColor: '#00000000',\n textAlign: 'right',\n },\n popoverList: {\n padding: 0,\n },\n closeButton: {\n backgroundColor: `${theme.palette.background.paper} !important`,\n borderRadius: '0 0 25% 25%',\n '&:hover': {\n backgroundColor: `${theme.palette.secondary.main} !important`,\n },\n },\n cover: {\n position: 'fixed',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n },\n textDense: {\n marginTop: 0,\n marginBottom: 0,\n },\n picker: {\n background: `${theme.palette.background.paper} !important`,\n },\n iconButton: {\n width: 16,\n height: 16,\n },\n button: {\n width: 32,\n height: 32,\n minWidth: 32,\n minHeight: 32,\n },\n});\n\n/**\n * @typedef {object} Rgb\n * @property {number} r The red component of the color (0-255).\n * @property {number} g The green component of the color (0-255).\n * @property {number} b The blue component of the color (0-255).\n * @property {number} a The alpha component of the color (0-255).\n *\n * @typedef {string | Rgb | { rgb: Rgb }} Color Definition of a color.\n *\n * @typedef {object} ColorPickerProps\n * @property {boolean} [disabled] Set to true to disable the color picker.\n * @property {Color} [value] The currently selected color.\n * @property {(rgba: string) => void} [onChange] The color change callback.\n * @property {string} [name] The name.\n * @property {React.CSSProperties} [style] Additional styling for this component.\n * @property {string} [className] The CSS class name.\n * @property {boolean} [openAbove] Open the color picker above the field?\n *\n * @extends {React.Component<ColorPickerProps>}\n */\nclass ColorPicker extends React.Component {\n /**\n * @param {Readonly<ColorPickerProps>} props\n */\n constructor(props) {\n super(props);\n this.state = {\n displayColorPicker: false,\n color: this.props.value || this.props.color,\n anchorEl: null,\n };\n }\n\n /**\n * Get the state derived from the given properties and state.\n * @param {{ color: Color; }} props\n * @param {{ color: Color; }} state\n */\n static getDerivedStateFromProps(props, state) {\n const pColor = ColorPicker.getColor(props.value || props.color);\n const sColor = ColorPicker.getColor(state.color);\n if (pColor !== sColor) {\n return { color: props.value || props.color };\n }\n return null;\n }\n\n /**\n * @private\n */\n handleClick = e => {\n this.setState({ displayColorPicker: !this.state.displayColorPicker, anchorEl: this.state.displayColorPicker ? null : e.currentTarget });\n };\n\n /**\n * @private\n */\n handleClose = () => {\n this.setState({ displayColorPicker: false, anchorEl: null });\n };\n\n /**\n * Convert the given color to hex ('#rrggbb') or rgba ('rgba(r,g,b,a)') format.\n * @param {Color} [color]\n * @param {boolean} [isHex] The returning string should be in hex format\n * @returns {string} the hex or rgba representation of the given color.\n */\n static getColor(color, isHex) {\n if (color && typeof color === 'object') {\n if (color.rgb) {\n if (isHex) {\n return `#${color.rgb.r.toString(16).padStart(2, '0')}${color.rgb.g.toString(16).padStart(2, '0')}${color.rgb.b.toString(16).padStart(2, '0')}`;\n }\n return `rgba(${color.rgb.r},${color.rgb.g},${color.rgb.b},${color.rgb.a})`;\n }\n if (isHex) {\n return `#${color.r.toString(16).padStart(2, '0')}${color.g.toString(16).padStart(2, '0')}${color.b.toString(16).padStart(2, '0')}`;\n }\n return `rgba(${color.r},${color.g},${color.b},${color.a})`;\n }\n return isHex ? ColorPicker.rgb2hex(color || '') : color || '';\n }\n\n /**\n * Convert rgb() or rgba() format to hex format #rrggbb.\n * @param {string} rgb\n * @returns {string}\n */\n static rgb2hex(rgb) {\n const m = rgb.match(/^rgba?[\\s+]?\\([\\s+]?(\\d+)[\\s+]?,[\\s+]?(\\d+)[\\s+]?,[\\s+]?(\\d+)[\\s+]?/i);\n\n const r = parseInt(m[1], 10).toString(16).padStart(2, '0');\n const g = parseInt(m[2], 10).toString(16).padStart(2, '0');\n const b = parseInt(m[3], 10).toString(16).padStart(2, '0');\n\n return m && m.length === 4 ? `#${r}${g}${b}` : rgb;\n }\n\n /**\n * @private\n */\n handleChange = color => {\n this.setState({ color }, () =>\n this.props.onChange && this.props.onChange(ColorPicker.getColor(color)));\n };\n\n renderCustomPalette() {\n if (!this.props.customPalette) {\n return null;\n }\n return <div style={{ width: '100%', display: 'flex', flexWrap: 'flex' }}>\n {this.props.customPalette.map(color =>\n <Button\n className={this.props.classes.button}\n key={color}\n onClick={() => {\n this.handleChange(color);\n setTimeout(() => this.handleClose(), 300);\n }}\n >\n <div className={this.props.classes.iconButton} style={{ background: color }} />\n </Button>)}\n </div>;\n }\n\n render() {\n const color = ColorPicker.getColor(this.state.color);\n\n const style = {...(this.props.style || {})};\n style.position = 'relative';\n\n return <div\n style={ style }\n className={this.props.className || ''}\n >\n <TextField\n disabled={this.props.disabled}\n variant=\"standard\"\n id=\"name\"\n style={color ? { width: 'calc(100% - 80px)' } : { width: 'calc(100% - 54px)', marginRight: 8 }}\n label={ this.props.name || 'color' }\n value={color}\n margin=\"dense\"\n classes={{ root: this.props.classes.textDense }}\n onChange={e => this.handleChange(e.target.value)}\n />\n {color ? <IconButton\n disabled={this.props.disabled}\n onClick={() => this.handleChange('')}\n size=\"small\"\n className={this.props.classes.delButton}\n style={color ? {} : { opacity: 0, cursor: 'default' }}\n >\n <IconDelete />\n </IconButton> : null}\n <div className={`${this.props.classes.swatch}${this.props.disabled ? ` ${this.props.classes.swatchDisabled}` : ''}`} onClick={e => !this.props.disabled && this.handleClick(e)}>\n <div className={this.props.classes.color} style={{ background: color }} />\n </div>\n { this.state.displayColorPicker && !this.props.disabled ? <Menu\n classes={{ paper: this.props.classes.popover, list: this.props.classes.popoverList }}\n anchorEl={this.state.anchorEl}\n open={!0}\n onClose={() => this.handleClose()}\n >\n <ChromePicker\n className={this.props.classes.picker}\n color={this.state.color}\n onChangeComplete={_color => this.handleChange(_color)}\n styles={{ picker: { background: '#112233' } }}\n />\n <IconButton className={this.props.classes.closeButton} onClick={() => this.handleClose()}><IconClose /></IconButton>\n {this.renderCustomPalette()}\n </Menu> : null }\n </div>;\n }\n}\n\nColorPicker.propTypes = {\n disabled: PropTypes.bool,\n value: PropTypes.string,\n onChange: PropTypes.func.isRequired,\n name: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n customPalette: PropTypes.array,\n};\n\n/** @type {typeof ColorPicker} */\nconst _export = withStyles(styles)(ColorPicker);\nexport default _export;\n"],"mappings":";;;;;;;;;;;;;;;AAeA;AACA;AACA;AACA;AAEA;AACA;AAA+E;AAAA;AAAA;AAAA;AAE/E,IAAMA,MAAM,GAAG,SAATA,MAAM,CAAGC,KAAK;EAAA,OAAK;IACrBC,KAAK,EAAE;MACHC,KAAK,EAAE,EAAE;MACTC,MAAM,EAAE,EAAE;MACVC,YAAY,EAAE;IAClB,CAAC;IACDC,SAAS,EAAE;MACP;MACA;MACAC,SAAS,EAAE;IACf,CAAC;IACDC,MAAM,EAAE;MACJD,SAAS,EAAE,EAAE;MACbE,OAAO,EAAE,CAAC;MACVC,UAAU,EAAE,MAAM;MAClBL,YAAY,EAAE,CAAC;MACfM,SAAS,EAAE,0BAA0B;MACrCC,OAAO,EAAE,cAAc;MACvBC,MAAM,EAAE,SAAS;MACjBC,aAAa,EAAE;IACnB,CAAC;IACDC,cAAc,EAAE;MACZC,OAAO,EAAE,GAAG;MACZH,MAAM,EAAE;IACZ,CAAC;IACDI,OAAO,EAAE;MACL;MACA;MACAC,eAAe,EAAE,WAAW;M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AQ,CAACF,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAACN,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;MAC1D,IAAME,CAAC,GAAGK,QAAQ,CAACF,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAACN,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;MAE1D,OAAOK,CAAC,IAAIA,CAAC,CAACG,MAAM,KAAK,CAAC,cAAOV,CAAC,SAAGG,CAAC,SAAGC,CAAC,IAAKL,GAAG;IACtD;;IAEA;AACJ;AACA;EAFI;EAAA;AAAA,EA9EsBY,iBAAK,CAACC,SAAS;AA6JzC7C,WAAW,CAAC8C,SAAS,GAAG;EACpB1B,QAAQ,EAAE2B,qBAAS,CAACC,IAAI;EACxBtC,KAAK,EAAEqC,qBAAS,CAACE,MAAM;EACvBzC,QAAQ,EAAEuC,qBAAS,CAACG,IAAI,CAACC,UAAU;EACnC7B,IAAI,EAAEyB,qBAAS,CAACE,MAAM;EACtB/B,KAAK,EAAE6B,qBAAS,CAACK,MAAM;EACvBjC,SAAS,EAAE4B,qBAAS,CAACE,MAAM;EAC3BtC,aAAa,EAAEoC,qBAAS,CAACM;AAC7B,CAAC;;AAED;AACA,IAAMC,OAAO,GAAG,IAAAC,sBAAU,EAAC9F,MAAM,CAAC,CAACuC,WAAW,CAAC;AAAC,eACjCsD,OAAO;AAAA"}
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ If you want to create the configuration page with react:
|
|
|
10
10
|
- Change `name` from `src` to `ADAPTERNAME-admin` (Of course replace `ADAPTERNAME` with yours)
|
|
11
11
|
- Add to devDependencies:
|
|
12
12
|
```
|
|
13
|
-
"@iobroker/adapter-react": "^4.0.
|
|
13
|
+
"@iobroker/adapter-react": "^4.0.4",
|
|
14
14
|
```
|
|
15
15
|
Versions can be higher.
|
|
16
16
|
So your src/package.json should look like:
|
|
@@ -660,7 +660,7 @@ socket.getObjectViewCustom('custom', 'state', 'startKey', 'endKey')
|
|
|
660
660
|
-->
|
|
661
661
|
|
|
662
662
|
## Changelog
|
|
663
|
-
### 4.0.
|
|
663
|
+
### 4.0.4 (2022-12-14)
|
|
664
664
|
* (bluefox) Added support of custom palette for color picker
|
|
665
665
|
|
|
666
666
|
### 4.0.2 (2022-12-01)
|