@iobroker/adapter-react-v5 3.2.2 → 3.2.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.d.ts +1 -1
- package/Components/ColorPicker.js +77 -53
- package/Components/ColorPicker.js.map +1 -1
- package/Components/FileBrowser.js +2 -2
- package/Components/FileBrowser.js.map +1 -1
- package/Components/ObjectBrowser.d.ts +21 -24
- package/Components/ObjectBrowser.js +624 -655
- package/Components/ObjectBrowser.js.map +1 -1
- package/Components/Router.js.map +1 -1
- package/Components/TableResize.js.map +1 -1
- package/Components/Utils.js +11 -4
- package/Components/Utils.js.map +1 -1
- package/Dialogs/SelectID.js +6 -6
- package/Dialogs/SelectID.js.map +1 -1
- package/GenericApp.js.map +1 -1
- package/README.md +6 -0
- package/package.json +5 -5
|
@@ -108,6 +108,7 @@ declare class ColorPicker extends React.Component<ColorPickerProps, any, any> {
|
|
|
108
108
|
state: {
|
|
109
109
|
displayColorPicker: boolean;
|
|
110
110
|
color: any;
|
|
111
|
+
anchorEl: any;
|
|
111
112
|
};
|
|
112
113
|
/**
|
|
113
114
|
* @private
|
|
@@ -131,7 +132,6 @@ declare namespace ColorPicker {
|
|
|
131
132
|
const name: PropTypes.Requireable<string>;
|
|
132
133
|
const style: PropTypes.Requireable<object>;
|
|
133
134
|
const className: PropTypes.Requireable<string>;
|
|
134
|
-
const openAbove: PropTypes.Requireable<boolean>;
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
import React from "react";
|
|
@@ -17,9 +17,10 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
17
17
|
var _reactColor = require("react-color");
|
|
18
18
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
19
|
var _withStyles = _interopRequireDefault(require("@mui/styles/withStyles"));
|
|
20
|
-
var
|
|
21
|
-
var
|
|
22
|
-
var
|
|
20
|
+
var _material = require("@mui/material");
|
|
21
|
+
var _iconsMaterial = require("@mui/icons-material");
|
|
22
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
23
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
24
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
24
25
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
25
26
|
var styles = function styles(theme) {
|
|
@@ -30,8 +31,8 @@ var styles = function styles(theme) {
|
|
|
30
31
|
borderRadius: 2
|
|
31
32
|
},
|
|
32
33
|
delButton: {
|
|
33
|
-
//width: 32,
|
|
34
|
-
//height: 32,
|
|
34
|
+
// width: 32,
|
|
35
|
+
// height: 32,
|
|
35
36
|
marginTop: 16
|
|
36
37
|
},
|
|
37
38
|
swatch: {
|
|
@@ -49,8 +50,20 @@ var styles = function styles(theme) {
|
|
|
49
50
|
cursor: 'default'
|
|
50
51
|
},
|
|
51
52
|
popover: {
|
|
52
|
-
position: 'absolute',
|
|
53
|
-
zIndex: 2
|
|
53
|
+
// position: 'absolute',
|
|
54
|
+
// zIndex: 2,
|
|
55
|
+
backgroundColor: '#00000000',
|
|
56
|
+
textAlign: 'right'
|
|
57
|
+
},
|
|
58
|
+
popoverList: {
|
|
59
|
+
padding: 0
|
|
60
|
+
},
|
|
61
|
+
closeButton: {
|
|
62
|
+
backgroundColor: "".concat(theme.palette.background.paper, " !important"),
|
|
63
|
+
borderRadius: '0 0 25% 25%',
|
|
64
|
+
'&:hover': {
|
|
65
|
+
backgroundColor: "".concat(theme.palette.secondary.main, " !important")
|
|
66
|
+
}
|
|
54
67
|
},
|
|
55
68
|
cover: {
|
|
56
69
|
position: 'fixed',
|
|
@@ -62,6 +75,9 @@ var styles = function styles(theme) {
|
|
|
62
75
|
textDense: {
|
|
63
76
|
marginTop: 0,
|
|
64
77
|
marginBottom: 0
|
|
78
|
+
},
|
|
79
|
+
picker: {
|
|
80
|
+
background: "".concat(theme.palette.background.paper, " !important")
|
|
65
81
|
}
|
|
66
82
|
};
|
|
67
83
|
};
|
|
@@ -96,25 +112,29 @@ var ColorPicker = /*#__PURE__*/function (_React$Component) {
|
|
|
96
112
|
var _this;
|
|
97
113
|
(0, _classCallCheck2["default"])(this, ColorPicker);
|
|
98
114
|
_this = _super.call(this, props);
|
|
99
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleClick", function () {
|
|
115
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleClick", function (e) {
|
|
100
116
|
_this.setState({
|
|
101
|
-
displayColorPicker: !_this.state.displayColorPicker
|
|
117
|
+
displayColorPicker: !_this.state.displayColorPicker,
|
|
118
|
+
anchorEl: _this.state.displayColorPicker ? null : e.currentTarget
|
|
102
119
|
});
|
|
103
120
|
});
|
|
104
121
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleClose", function () {
|
|
105
122
|
_this.setState({
|
|
106
|
-
displayColorPicker: false
|
|
123
|
+
displayColorPicker: false,
|
|
124
|
+
anchorEl: null
|
|
107
125
|
});
|
|
108
126
|
});
|
|
109
127
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleChange", function (color) {
|
|
110
128
|
_this.setState({
|
|
111
129
|
color: color
|
|
130
|
+
}, function () {
|
|
131
|
+
return _this.props.onChange && _this.props.onChange(ColorPicker.getColor(color));
|
|
112
132
|
});
|
|
113
|
-
_this.props.onChange && _this.props.onChange(ColorPicker.getColor(color));
|
|
114
133
|
});
|
|
115
134
|
_this.state = {
|
|
116
135
|
displayColorPicker: false,
|
|
117
|
-
color: _this.props.value || _this.props.color
|
|
136
|
+
color: _this.props.value || _this.props.color,
|
|
137
|
+
anchorEl: null
|
|
118
138
|
};
|
|
119
139
|
return _this;
|
|
120
140
|
}
|
|
@@ -129,18 +149,12 @@ var ColorPicker = /*#__PURE__*/function (_React$Component) {
|
|
|
129
149
|
value: function render() {
|
|
130
150
|
var _this2 = this;
|
|
131
151
|
var color = ColorPicker.getColor(this.state.color);
|
|
132
|
-
var style = {};
|
|
133
|
-
|
|
134
|
-
style = {
|
|
135
|
-
top: -241
|
|
136
|
-
};
|
|
137
|
-
}
|
|
152
|
+
var style = _objectSpread({}, this.props.style || {});
|
|
153
|
+
style.position = 'relative';
|
|
138
154
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
139
|
-
style:
|
|
140
|
-
position: 'relative'
|
|
141
|
-
}),
|
|
155
|
+
style: style,
|
|
142
156
|
className: this.props.className || ''
|
|
143
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
157
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.TextField, {
|
|
144
158
|
disabled: this.props.disabled,
|
|
145
159
|
variant: "standard",
|
|
146
160
|
id: "name",
|
|
@@ -159,7 +173,7 @@ var ColorPicker = /*#__PURE__*/function (_React$Component) {
|
|
|
159
173
|
onChange: function onChange(e) {
|
|
160
174
|
return _this2.handleChange(e.target.value);
|
|
161
175
|
}
|
|
162
|
-
}), color ? /*#__PURE__*/_react["default"].createElement(
|
|
176
|
+
}), color ? /*#__PURE__*/_react["default"].createElement(_material.IconButton, {
|
|
163
177
|
disabled: this.props.disabled,
|
|
164
178
|
onClick: function onClick() {
|
|
165
179
|
return _this2.handleChange('');
|
|
@@ -170,30 +184,43 @@ var ColorPicker = /*#__PURE__*/function (_React$Component) {
|
|
|
170
184
|
opacity: 0,
|
|
171
185
|
cursor: 'default'
|
|
172
186
|
}
|
|
173
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
174
|
-
className: "".concat(this.props.classes.swatch).concat(this.props.disabled ?
|
|
175
|
-
onClick: function onClick() {
|
|
176
|
-
return !_this2.props.disabled && _this2.handleClick();
|
|
187
|
+
}, /*#__PURE__*/_react["default"].createElement(_iconsMaterial.Delete, null)) : null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
188
|
+
className: "".concat(this.props.classes.swatch).concat(this.props.disabled ? " ".concat(this.props.classes.swatchDisabled) : ''),
|
|
189
|
+
onClick: function onClick(e) {
|
|
190
|
+
return !_this2.props.disabled && _this2.handleClick(e);
|
|
177
191
|
}
|
|
178
192
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
179
193
|
className: this.props.classes.color,
|
|
180
194
|
style: {
|
|
181
195
|
background: color
|
|
182
196
|
}
|
|
183
|
-
})), this.state.displayColorPicker && !this.props.disabled ? /*#__PURE__*/_react["default"].createElement(
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
197
|
+
})), this.state.displayColorPicker && !this.props.disabled ? /*#__PURE__*/_react["default"].createElement(_material.Menu, {
|
|
198
|
+
classes: {
|
|
199
|
+
paper: this.props.classes.popover,
|
|
200
|
+
list: this.props.classes.popoverList
|
|
201
|
+
},
|
|
202
|
+
anchorEl: this.state.anchorEl,
|
|
203
|
+
open: !0,
|
|
204
|
+
onClose: function onClose() {
|
|
189
205
|
return _this2.handleClose();
|
|
190
206
|
}
|
|
191
|
-
}
|
|
207
|
+
}, /*#__PURE__*/_react["default"].createElement(_reactColor.ChromePicker, {
|
|
208
|
+
className: this.props.classes.picker,
|
|
192
209
|
color: this.state.color,
|
|
193
|
-
onChangeComplete: function onChangeComplete(
|
|
194
|
-
return _this2.handleChange(
|
|
210
|
+
onChangeComplete: function onChangeComplete(_color) {
|
|
211
|
+
return _this2.handleChange(_color);
|
|
212
|
+
},
|
|
213
|
+
styles: {
|
|
214
|
+
picker: {
|
|
215
|
+
background: '#112233'
|
|
216
|
+
}
|
|
195
217
|
}
|
|
196
|
-
})
|
|
218
|
+
}), /*#__PURE__*/_react["default"].createElement(_material.IconButton, {
|
|
219
|
+
className: this.props.classes.closeButton,
|
|
220
|
+
onClick: function onClick() {
|
|
221
|
+
return _this2.handleClose();
|
|
222
|
+
}
|
|
223
|
+
}, /*#__PURE__*/_react["default"].createElement(_iconsMaterial.Close, null))) : null);
|
|
197
224
|
}
|
|
198
225
|
}], [{
|
|
199
226
|
key: "getDerivedStateFromProps",
|
|
@@ -204,9 +231,8 @@ var ColorPicker = /*#__PURE__*/function (_React$Component) {
|
|
|
204
231
|
return {
|
|
205
232
|
color: props.value || props.color
|
|
206
233
|
};
|
|
207
|
-
} else {
|
|
208
|
-
return null;
|
|
209
234
|
}
|
|
235
|
+
return null;
|
|
210
236
|
}
|
|
211
237
|
|
|
212
238
|
/**
|
|
@@ -225,20 +251,16 @@ var ColorPicker = /*#__PURE__*/function (_React$Component) {
|
|
|
225
251
|
if (color && (0, _typeof2["default"])(color) === 'object') {
|
|
226
252
|
if (color.rgb) {
|
|
227
253
|
if (isHex) {
|
|
228
|
-
return
|
|
229
|
-
} else {
|
|
230
|
-
return 'rgba(' + color.rgb.r + ',' + color.rgb.g + ',' + color.rgb.b + ',' + color.rgb.a + ')';
|
|
231
|
-
}
|
|
232
|
-
} else {
|
|
233
|
-
if (isHex) {
|
|
234
|
-
return '#' + color.r.toString(16).padStart(2, '0') + color.g.toString(16).padStart(2, '0') + color.b.toString(16).padStart(2, '0');
|
|
235
|
-
} else {
|
|
236
|
-
return 'rgba(' + color.r + ',' + color.g + ',' + color.b + ',' + color.a + ')';
|
|
254
|
+
return "#".concat(color.rgb.r.toString(16).padStart(2, '0')).concat(color.rgb.g.toString(16).padStart(2, '0')).concat(color.rgb.b.toString(16).padStart(2, '0'));
|
|
237
255
|
}
|
|
256
|
+
return "rgba(".concat(color.rgb.r, ",").concat(color.rgb.g, ",").concat(color.rgb.b, ",").concat(color.rgb.a, ")");
|
|
257
|
+
}
|
|
258
|
+
if (isHex) {
|
|
259
|
+
return "#".concat(color.r.toString(16).padStart(2, '0')).concat(color.g.toString(16).padStart(2, '0')).concat(color.b.toString(16).padStart(2, '0'));
|
|
238
260
|
}
|
|
239
|
-
|
|
240
|
-
return isHex ? ColorPicker.rgb2hex(color || '') : color || '';
|
|
261
|
+
return "rgba(".concat(color.r, ",").concat(color.g, ",").concat(color.b, ",").concat(color.a, ")");
|
|
241
262
|
}
|
|
263
|
+
return isHex ? ColorPicker.rgb2hex(color || '') : color || '';
|
|
242
264
|
}
|
|
243
265
|
|
|
244
266
|
/**
|
|
@@ -250,7 +272,10 @@ var ColorPicker = /*#__PURE__*/function (_React$Component) {
|
|
|
250
272
|
key: "rgb2hex",
|
|
251
273
|
value: function rgb2hex(rgb) {
|
|
252
274
|
var m = rgb.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
|
|
253
|
-
|
|
275
|
+
var r = parseInt(m[1], 10).toString(16).padStart(2, '0');
|
|
276
|
+
var g = parseInt(m[2], 10).toString(16).padStart(2, '0');
|
|
277
|
+
var b = parseInt(m[3], 10).toString(16).padStart(2, '0');
|
|
278
|
+
return m && m.length === 4 ? "#".concat(r).concat(g).concat(b) : rgb;
|
|
254
279
|
}
|
|
255
280
|
|
|
256
281
|
/**
|
|
@@ -265,8 +290,7 @@ ColorPicker.propTypes = {
|
|
|
265
290
|
onChange: _propTypes["default"].func.isRequired,
|
|
266
291
|
name: _propTypes["default"].string,
|
|
267
292
|
style: _propTypes["default"].object,
|
|
268
|
-
className: _propTypes["default"].string
|
|
269
|
-
openAbove: _propTypes["default"].bool
|
|
293
|
+
className: _propTypes["default"].string
|
|
270
294
|
};
|
|
271
295
|
|
|
272
296
|
/** @type {typeof ColorPicker} */
|
|
@@ -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","position","zIndex","cover","top","right","bottom","left","textDense","marginBottom","ColorPicker","props","setState","displayColorPicker","state","onChange","getColor","value","style","openAbove","Object","assign","className","disabled","marginRight","name","root","classes","e","handleChange","target","handleClick","handleClose","pColor","sColor","isHex","rgb","r","toString","padStart","g","b","a","rgb2hex","m","match","length","parseInt","React","Component","propTypes","PropTypes","bool","string","func","isRequired","object","_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 from '@mui/material/TextField';\nimport IconButton from '@mui/material/IconButton';\nimport IconDelete from '@mui/icons-material/Delete';\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 },\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});\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 };\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 } else {\n return null;\n }\n }\n\n /**\n * @private\n */\n handleClick = () => {\n this.setState({displayColorPicker: !this.state.displayColorPicker});\n };\n\n /**\n * @private\n */\n handleClose = () => {\n this.setState({displayColorPicker: false});\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 } else {\n return 'rgba(' + color.rgb.r + ',' + color.rgb.g + ',' + color.rgb.b + ',' + color.rgb.a + ')';\n }\n } else {\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 } else {\n return 'rgba(' + color.r + ',' + color.g + ',' + color.b + ',' + color.a + ')';\n }\n }\n } else {\n return isHex ? ColorPicker.rgb2hex(color || '') : color || '';\n }\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 return m && m.length === 4 ? '#' +\n parseInt(m[1],10).toString(16).padStart(2, '0') +\n parseInt(m[2],10).toString(16).padStart(2, '0') +\n parseInt(m[3],10).toString(16).padStart(2, '0') : 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 render() {\n const color = ColorPicker.getColor(this.state.color);\n let style = {};\n\n if (this.state.displayColorPicker && this.props.openAbove) {\n style = {\n top: -241,\n };\n }\n\n return <div\n style={Object.assign({}, this.props.style || {}, {position: 'relative'})}\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 ><IconDelete/></IconButton> : null}\n <div className={`${this.props.classes.swatch}${this.props.disabled ? ' ' + this.props.classes.swatchDisabled : ''}`} onClick={() => !this.props.disabled && this.handleClick()}>\n <div className={this.props.classes.color} style={{background: color}} />\n </div>\n { this.state.displayColorPicker && !this.props.disabled ? <div className={this.props.classes.popover} style={style}>\n <div className={this.props.classes.cover} onClick={() => this.handleClose()}/>\n <ChromePicker color={ this.state.color } onChangeComplete={color => this.handleChange(color)} />\n </div> : 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 openAbove: PropTypes.bool,\n};\n\n/** @type {typeof ColorPicker} */\nconst _export = withStyles(styles)(ColorPicker);\nexport default _export;"],"mappings":";;;;;;;;;;;;;;;AAeA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAoD;AAAA;AAEpD,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;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AAC,EAAE,GAAG,CAAC,GAC/CQ,QAAQ,CAACH,CAAC,CAAC,CAAC,CAAC,EAAC,EAAE,CAAC,CAACN,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,GAAGH,GAAG;IAC7D;;IAEA;AACJ;AACA;EAFI;EAAA;AAAA,EAjFsBY,iBAAK,CAACC,SAAS;AAoIzCvC,WAAW,CAACwC,SAAS,GAAG;EACpB3B,QAAQ,EAAE4B,qBAAS,CAACC,IAAI;EACxBnC,KAAK,EAAEkC,qBAAS,CAACE,MAAM;EACvBtC,QAAQ,EAAEoC,qBAAS,CAACG,IAAI,CAACC,UAAU;EACnC9B,IAAI,EAAE0B,qBAAS,CAACE,MAAM;EACtBnC,KAAK,EAAEiC,qBAAS,CAACK,MAAM;EACvBlC,SAAS,EAAE6B,qBAAS,CAACE,MAAM;EAC3BlC,SAAS,EAAEgC,qBAAS,CAACC;AACzB,CAAC;;AAED;AACA,IAAMK,OAAO,GAAG,IAAAC,sBAAU,EAAC3E,MAAM,CAAC,CAAC2B,WAAW,CAAC;AAAC,eACjC+C,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","ColorPicker","props","e","setState","displayColorPicker","state","anchorEl","currentTarget","onChange","getColor","value","style","className","disabled","marginRight","name","root","classes","handleChange","target","handleClick","list","handleClose","_color","pColor","sColor","isHex","rgb","r","toString","padStart","g","b","a","rgb2hex","m","match","parseInt","length","React","Component","propTypes","PropTypes","bool","string","func","isRequired","object","_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 } 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});\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 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 </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};\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;IAC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F,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;AAyIzCxC,WAAW,CAACyC,SAAS,GAAG;EACpB5B,QAAQ,EAAE6B,qBAAS,CAACC,IAAI;EACxBjC,KAAK,EAAEgC,qBAAS,CAACE,MAAM;EACvBpC,QAAQ,EAAEkC,qBAAS,CAACG,IAAI,CAACC,UAAU;EACnC/B,IAAI,EAAE2B,qBAAS,CAACE,MAAM;EACtBjC,KAAK,EAAE+B,qBAAS,CAACK,MAAM;EACvBnC,SAAS,EAAE8B,qBAAS,CAACE;AACzB,CAAC;;AAED;AACA,IAAMI,OAAO,GAAG,IAAAC,sBAAU,EAACpF,MAAM,CAAC,CAACmC,WAAW,CAAC;AAAC,eACjCgD,OAAO;AAAA"}
|
|
@@ -1469,8 +1469,8 @@ var FileBrowser = /*#__PURE__*/function (_Component) {
|
|
|
1469
1469
|
}
|
|
1470
1470
|
}, {
|
|
1471
1471
|
key: "componentDidUpdate",
|
|
1472
|
-
value: function /* prevProps , prevState, snapshot */
|
|
1473
|
-
|
|
1472
|
+
value: function componentDidUpdate( /* prevProps , prevState, snapshot */
|
|
1473
|
+
) {
|
|
1474
1474
|
var _this18 = this;
|
|
1475
1475
|
this.setOpacityTimer && clearTimeout(this.setOpacityTimer);
|
|
1476
1476
|
this.setOpacityTimer = setTimeout(function () {
|