@iobroker/gui-components 10.3.16 → 10.4.0

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 (59) hide show
  1. package/README.md +17 -1
  2. package/build/Components/AnimatedIcons/IconCopyToClipboard.d.ts +25 -0
  3. package/build/Components/AnimatedIcons/IconCopyToClipboard.js +84 -0
  4. package/build/Components/AnimatedIcons/IconCopyToClipboard.js.map +1 -0
  5. package/build/Components/AnimatedIcons/IconFilter.d.ts +23 -0
  6. package/build/Components/AnimatedIcons/IconFilter.js +26 -0
  7. package/build/Components/AnimatedIcons/IconFilter.js.map +1 -0
  8. package/build/Components/AnimatedIcons/IconFolder.d.ts +6 -0
  9. package/build/Components/AnimatedIcons/IconFolder.js +2 -1
  10. package/build/Components/AnimatedIcons/IconFolder.js.map +1 -1
  11. package/build/Components/AnimatedIcons/IconThemeMode.d.ts +22 -0
  12. package/build/Components/AnimatedIcons/IconThemeMode.js +32 -0
  13. package/build/Components/AnimatedIcons/IconThemeMode.js.map +1 -0
  14. package/build/Components/AnimatedIcons/IconUpload.d.ts +24 -0
  15. package/build/Components/AnimatedIcons/IconUpload.js +37 -0
  16. package/build/Components/AnimatedIcons/IconUpload.js.map +1 -0
  17. package/build/Components/AnimatedIcons/common.d.ts +2 -0
  18. package/build/Components/AnimatedIcons/common.js +64 -5
  19. package/build/Components/AnimatedIcons/common.js.map +1 -1
  20. package/build/Components/ColorPicker.js +4 -3
  21. package/build/Components/ColorPicker.js.map +1 -1
  22. package/build/Components/FileBrowser.d.ts +6 -0
  23. package/build/Components/FileBrowser.js +54 -12
  24. package/build/Components/FileBrowser.js.map +1 -1
  25. package/build/Components/FileViewer.js +3 -2
  26. package/build/Components/FileViewer.js.map +1 -1
  27. package/build/Components/ObjectBrowser/ObjectBrowserClass.d.ts +6 -0
  28. package/build/Components/ObjectBrowser/ObjectBrowserClass.js +66 -6
  29. package/build/Components/ObjectBrowser/ObjectBrowserClass.js.map +1 -1
  30. package/build/Components/ObjectBrowser/contextMenu.js +3 -2
  31. package/build/Components/ObjectBrowser/contextMenu.js.map +1 -1
  32. package/build/Components/ObjectBrowser/renderLeaf.js +55 -76
  33. package/build/Components/ObjectBrowser/renderLeaf.js.map +1 -1
  34. package/build/Components/ObjectBrowser/rowAnimation.d.ts +25 -1
  35. package/build/Components/ObjectBrowser/rowAnimation.js +46 -19
  36. package/build/Components/ObjectBrowser/rowAnimation.js.map +1 -1
  37. package/build/Components/ObjectBrowser/skeleton.d.ts +15 -0
  38. package/build/Components/ObjectBrowser/skeleton.js +106 -0
  39. package/build/Components/ObjectBrowser/skeleton.js.map +1 -0
  40. package/build/Components/ObjectBrowser/styles.js +16 -11
  41. package/build/Components/ObjectBrowser/styles.js.map +1 -1
  42. package/build/Components/ObjectBrowser/toolbar.js +18 -14
  43. package/build/Components/ObjectBrowser/toolbar.js.map +1 -1
  44. package/build/Components/ObjectBrowser/utils.d.ts +2 -0
  45. package/build/Components/ObjectBrowser/utils.js +2 -0
  46. package/build/Components/ObjectBrowser/utils.js.map +1 -1
  47. package/build/Components/ToggleThemeMenu.js +11 -8
  48. package/build/Components/ToggleThemeMenu.js.map +1 -1
  49. package/build/Components/TreeTable.d.ts +16 -0
  50. package/build/Components/TreeTable.js +106 -18
  51. package/build/Components/TreeTable.js.map +1 -1
  52. package/build/Dialogs/ComplexCron.js +3 -2
  53. package/build/Dialogs/ComplexCron.js.map +1 -1
  54. package/build/Dialogs/Error.js +3 -2
  55. package/build/Dialogs/Error.js.map +1 -1
  56. package/build/index.d.ts +4 -0
  57. package/build/index.js +4 -0
  58. package/build/index.js.map +1 -1
  59. package/package.json +5 -5
@@ -16,7 +16,8 @@
16
16
  import React, { Component } from 'react';
17
17
  import { RgbaColorPicker, RgbColorPicker } from 'react-colorful';
18
18
  import { TextField, Popover, IconButton, Button, Box, Tooltip, MenuItem, Select } from '@mui/material';
19
- import { Delete as IconDelete, Colorize as IconColorize } from '@mui/icons-material';
19
+ import { Colorize as IconColorize } from '@mui/icons-material';
20
+ import { IconTrash } from './AnimatedIcons/IconTrash';
20
21
  import { I18n } from '../i18n';
21
22
  const RECENT_COLORS_KEY = 'iob-color-picker-recent';
22
23
  const MAX_RECENT_COLORS = 12;
@@ -642,7 +643,7 @@ export class ColorPicker extends Component {
642
643
  React.createElement(Tooltip, { title: I18n.t('ra_Clear color') },
643
644
  React.createElement("span", null,
644
645
  React.createElement(IconButton, { size: "small", disabled: !textValue, onClick: this.handleClear },
645
- React.createElement(IconDelete, { fontSize: "small" }))))),
646
+ React.createElement(IconTrash, { fontSize: "small" }))))),
646
647
  this.renderSwatches(this.props.customPalette || [], I18n.t('ra_Palette')),
647
648
  this.renderSwatches(this.props.noRecentColors ? [] : this.state.recentColors, I18n.t('ra_Recently used colors'))));
648
649
  }
@@ -658,7 +659,7 @@ export class ColorPicker extends Component {
658
659
  mr: textValue ? undefined : 1,
659
660
  }, onChange: e => this.handleTextChange(e.target.value) })),
660
661
  !this.props.noInputField && textValue ? (React.createElement(IconButton, { disabled: this.props.disabled, onClick: this.handleClear, size: "small", style: hasLabel ? styles.delButton : undefined },
661
- React.createElement(IconDelete, null))) : null,
662
+ React.createElement(IconTrash, null))) : null,
662
663
  React.createElement(Box, { component: "div", onClick: e => !this.props.disabled && this.handleClick(e), title: I18n.t('ra_Select color'), sx: {
663
664
  ...styles.swatch,
664
665
  ...(this.props.disabled ? styles.swatchDisabled : undefined),
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPicker.js","sourceRoot":"./src/","sources":["Components/ColorPicker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,EAAE,SAAS,EAAsB,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,cAAc,EAAkB,MAAM,gBAAgB,CAAC;AAEjF,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAA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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, { Component, type CSSProperties } from 'react';\nimport { RgbaColorPicker, RgbColorPicker, type RgbaColor } from 'react-colorful';\n\nimport { TextField, Popover, IconButton, Button, Box, Tooltip, MenuItem, Select } from '@mui/material';\n\nimport { Delete as IconDelete, Colorize as IconColorize } from '@mui/icons-material';\n\nimport { I18n } from '../i18n';\n\nimport type { IobTheme } from '../types';\n\n/** Color in the `{ r, g, b, a }` notation. Kept for backwards compatibility with `react-color`. */\nexport interface RGBColor {\n r: number;\n g: number;\n b: number;\n a?: number;\n}\n\n/** Notation used for the value that is reported via `onChange`. */\nexport type ColorPickerFormat = 'hex' | 'rgb' | 'hsl';\n\nconst RECENT_COLORS_KEY = 'iob-color-picker-recent';\nconst MAX_RECENT_COLORS = 12;\n\n/** Small checkerboard, so a semi-transparent color is recognizable as such */\nconst ALPHA_BACKGROUND =\n 'linear-gradient(45deg, #c0c0c0 25%, transparent 25%), linear-gradient(-45deg, #c0c0c0 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #c0c0c0 75%), linear-gradient(-45deg, transparent 75%, #c0c0c0 75%)';\n\nconst ALPHA_BACKGROUND_SIZE = '8px 8px';\nconst ALPHA_BACKGROUND_POSITION = '0 0, 0 4px, 4px -4px, -4px 0px';\n\nconst styles: Record<string, any> = {\n swatch: {\n mt: '16px',\n p: '4px',\n backgroundColor: 'background.paper',\n borderRadius: '6px',\n boxShadow: '0 0 0 1px rgba(128,128,128,.35)',\n display: 'inline-block',\n cursor: 'pointer',\n verticalAlign: 'middle',\n transition: 'box-shadow 0.15s ease-in-out',\n '&:hover': {\n boxShadow: '0 0 0 2px rgba(128,128,128,.6)',\n },\n },\n swatchDisabled: {\n opacity: 0.5,\n cursor: 'default',\n '&:hover': {\n boxShadow: '0 0 0 1px rgba(128,128,128,.35)',\n },\n },\n color: {\n height: 14,\n borderRadius: '3px',\n backgroundImage: ALPHA_BACKGROUND,\n backgroundSize: ALPHA_BACKGROUND_SIZE,\n backgroundPosition: ALPHA_BACKGROUND_POSITION,\n },\n delButton: {\n marginTop: 16,\n },\n textDense: {\n mt: 0,\n mb: 0,\n },\n popover: {\n '& .MuiPaper-root': {\n borderRadius: '12px',\n },\n },\n // The chrome around the react-colorful area\n pickerWrapper: (theme: IobTheme) => ({\n p: '12px',\n backgroundColor: theme.palette.background.paper,\n borderRadius: '12px',\n display: 'flex',\n flexDirection: 'column',\n gap: '10px',\n // restyle react-colorful, so it fits into the ioBroker themes\n '& .react-colorful': {\n width: '100%',\n height: 'auto',\n gap: '10px',\n },\n '& .react-colorful__saturation': {\n borderRadius: '8px',\n border: 'none',\n height: 150,\n boxShadow: 'none',\n },\n '& .react-colorful__hue, & .react-colorful__alpha': {\n height: 14,\n borderRadius: '7px',\n },\n '& .react-colorful__alpha': {\n backgroundImage: ALPHA_BACKGROUND,\n backgroundSize: ALPHA_BACKGROUND_SIZE,\n backgroundPosition: ALPHA_BACKGROUND_POSITION,\n },\n '& .react-colorful__last-control': {\n borderRadius: '7px',\n },\n '& .react-colorful__pointer': {\n width: 18,\n height: 18,\n borderWidth: 2,\n },\n '& .react-colorful__saturation-pointer': {\n width: 20,\n height: 20,\n },\n }),\n controlRow: {\n display: 'flex',\n alignItems: 'center',\n gap: '6px',\n },\n preview: {\n width: 28,\n height: 28,\n flexShrink: 0,\n borderRadius: '6px',\n boxShadow: '0 0 0 1px rgba(128,128,128,.35) inset',\n backgroundImage: ALPHA_BACKGROUND,\n backgroundSize: ALPHA_BACKGROUND_SIZE,\n backgroundPosition: ALPHA_BACKGROUND_POSITION,\n },\n valueInput: {\n flexGrow: 1,\n minWidth: 60,\n '& .MuiInputBase-input': {\n fontFamily: 'monospace',\n fontSize: '0.75rem',\n textOverflow: 'ellipsis',\n },\n },\n formatSelect: {\n flexShrink: 0,\n fontSize: '0.7rem',\n opacity: 0.75,\n '& .MuiSelect-select': {\n py: '4px',\n pl: '2px',\n pr: '18px !important',\n },\n '& .MuiSelect-icon': {\n right: 0,\n },\n },\n sectionTitle: {\n fontSize: '0.7rem',\n opacity: 0.6,\n textTransform: 'uppercase',\n letterSpacing: '0.06em',\n },\n swatchRow: {\n display: 'flex',\n flexWrap: 'wrap',\n gap: '4px',\n mt: '4px',\n },\n paletteItem: {\n width: 22,\n height: 22,\n p: 0,\n minWidth: 22,\n borderRadius: '5px',\n boxShadow: '0 0 0 1px rgba(128,128,128,.35) inset',\n backgroundImage: ALPHA_BACKGROUND,\n backgroundSize: ALPHA_BACKGROUND_SIZE,\n backgroundPosition: ALPHA_BACKGROUND_POSITION,\n '&:hover': {\n boxShadow: '0 0 0 2px rgba(128,128,128,.7) inset',\n },\n },\n fill: {\n width: '100%',\n height: '100%',\n borderRadius: 'inherit',\n },\n};\n\nconst DEFAULT_COLOR: RgbaColor = { r: 0, g: 0, b: 0, a: 1 };\n\nlet canvasContext: CanvasRenderingContext2D | null | undefined;\n\n/**\n * Normalize any CSS color notation (color names, `color()`, ...) with the help of a canvas.\n *\n * @param color The color string to normalize.\n * @returns the normalized color as `#rrggbb`/`rgba(...)` string or null if the string is no valid color.\n */\nfunction normalizeCssColor(color: string): string | null {\n if (canvasContext === undefined) {\n canvasContext = typeof document === 'undefined' ? null : document.createElement('canvas').getContext('2d');\n }\n if (!canvasContext) {\n return null;\n }\n // `fillStyle` keeps its previous value if the assigned string is no valid color,\n // so it must be probed with two different defaults\n canvasContext.fillStyle = '#000000';\n canvasContext.fillStyle = color;\n const first = canvasContext.fillStyle;\n canvasContext.fillStyle = '#ffffff';\n canvasContext.fillStyle = color;\n\n return first === canvasContext.fillStyle ? first : null;\n}\n\n/**\n * Convert h, s, l (0..1) to r, g, b (0..255).\n *\n * @param h The hue in the range 0..1.\n * @param s The saturation in the range 0..1.\n * @param l The lightness in the range 0..1.\n */\nfunction hsl2rgb(h: number, s: number, l: number): { r: number; g: number; b: number } {\n if (!s) {\n const v = Math.round(l * 255);\n return { r: v, g: v, b: v };\n }\n\n const hue2rgb = (p: number, q: number, t: number): number => {\n let _t = t;\n if (_t < 0) {\n _t += 1;\n }\n if (_t > 1) {\n _t -= 1;\n }\n if (_t < 1 / 6) {\n return p + (q - p) * 6 * _t;\n }\n if (_t < 1 / 2) {\n return q;\n }\n if (_t < 2 / 3) {\n return p + (q - p) * (2 / 3 - _t) * 6;\n }\n return p;\n };\n\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n\n return {\n r: Math.round(hue2rgb(p, q, h + 1 / 3) * 255),\n g: Math.round(hue2rgb(p, q, h) * 255),\n b: Math.round(hue2rgb(p, q, h - 1 / 3) * 255),\n };\n}\n\n/**\n * Convert r, g, b (0..255) to h (0..360), s, l (0..100).\n *\n * @param color The color to convert.\n */\nfunction rgb2hsl(color: RgbaColor): { h: number; s: number; l: number } {\n const r = color.r / 255;\n const g = color.g / 255;\n const b = color.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n\n if (max === min) {\n return { h: 0, s: 0, l: Math.round(l * 100) };\n }\n const d = max - min;\n const s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n let h: number;\n if (max === r) {\n h = (g - b) / d + (g < b ? 6 : 0);\n } else if (max === g) {\n h = (b - r) / d + 2;\n } else {\n h = (r - g) / d + 4;\n }\n\n return { h: Math.round((h / 6) * 360), s: Math.round(s * 100), l: Math.round(l * 100) };\n}\n\n/**\n * Clamp a number into the given range.\n *\n * @param value The value to clamp.\n * @param min The lower limit.\n * @param max The upper limit.\n */\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(max, Math.max(min, value));\n}\n\n/**\n * Read a color channel that may be given as `128` or as `50%`.\n *\n * @param value The channel as string.\n * @param max The maximal value of this channel.\n */\nfunction readChannel(value: string, max: number): number {\n const trimmed = value.trim();\n const parsed = parseFloat(trimmed);\n if (Number.isNaN(parsed)) {\n return 0;\n }\n return clamp(Math.round(trimmed.endsWith('%') ? (parsed / 100) * max : parsed), 0, max);\n}\n\n/**\n * Read the alpha channel that may be given as `0.5` or as `50%`.\n *\n * @param value The alpha channel as string or undefined if it is not given.\n */\nfunction readAlpha(value: string | undefined): number {\n if (value === undefined || value === '') {\n return 1;\n }\n const trimmed = value.trim();\n const parsed = trimmed.endsWith('%') ? parseFloat(trimmed) / 100 : parseFloat(trimmed);\n\n return Number.isNaN(parsed) ? 1 : clamp(parsed, 0, 1);\n}\n\n/**\n * Parse any CSS color notation into `{ r, g, b, a }`.\n *\n * Supported are `#rgb`, `#rgba`, `#rrggbb`, `#rrggbbaa`, `rgb()`, `rgba()`, `hsl()`, `hsla()` (comma or space\n * separated, with or without the `/ alpha` part) and every color name the browser knows.\n *\n * @param color The color string to parse.\n * @returns the parsed color or null if the string could not be interpreted.\n */\nexport function parseColor(color: string): RgbaColor | null {\n if (!color || typeof color !== 'string') {\n return null;\n }\n const str = color.trim().toLowerCase();\n if (!str) {\n return null;\n }\n if (str === 'transparent') {\n return { r: 0, g: 0, b: 0, a: 0 };\n }\n\n const hex = /^#([\\da-f]{3,8})$/.exec(str);\n if (hex) {\n const h = hex[1];\n if (h.length === 3 || h.length === 4) {\n return {\n r: parseInt(h[0] + h[0], 16),\n g: parseInt(h[1] + h[1], 16),\n b: parseInt(h[2] + h[2], 16),\n a: h.length === 4 ? Math.round((parseInt(h[3] + h[3], 16) / 255) * 100) / 100 : 1,\n };\n }\n if (h.length === 6 || h.length === 8) {\n return {\n r: parseInt(h.substring(0, 2), 16),\n g: parseInt(h.substring(2, 4), 16),\n b: parseInt(h.substring(4, 6), 16),\n a: h.length === 8 ? Math.round((parseInt(h.substring(6, 8), 16) / 255) * 100) / 100 : 1,\n };\n }\n return null;\n }\n\n const func = /^(rgba?|hsla?)\\(([^)]*)\\)$/.exec(str);\n if (func) {\n // both `1, 2, 3, 0.5` and `1 2 3 / 50%` are valid\n const parts = func[2]\n .replace('/', ',')\n .split(/[\\s,]+/)\n .filter(part => part !== '');\n\n if (parts.length < 3) {\n return null;\n }\n if (func[1].startsWith('rgb')) {\n return {\n r: readChannel(parts[0], 255),\n g: readChannel(parts[1], 255),\n b: readChannel(parts[2], 255),\n a: readAlpha(parts[3]),\n };\n }\n const hue = ((parseFloat(parts[0]) % 360) + 360) % 360;\n const rgb = hsl2rgb(\n hue / 360,\n clamp(parseFloat(parts[1]) / 100, 0, 1),\n clamp(parseFloat(parts[2]) / 100, 0, 1),\n );\n\n return { ...rgb, a: readAlpha(parts[3]) };\n }\n\n // color names and everything else the browser understands\n const normalized = normalizeCssColor(str);\n\n return normalized && normalized !== str ? parseColor(normalized) : null;\n}\n\n/**\n * Render `{ r, g, b, a }` in the requested notation.\n *\n * @param color The color to render.\n * @param format The desired notation.\n * @param noAlpha If true, the alpha channel is dropped.\n * @returns the color as CSS string.\n */\nexport function formatColor(color: RgbaColor, format: ColorPickerFormat, noAlpha?: boolean): string {\n const alpha = noAlpha ? 1 : (color.a ?? 1);\n const opaque = alpha >= 1;\n const rounded = Math.round(alpha * 100) / 100;\n\n if (format === 'hex') {\n const hex = `#${color.r.toString(16).padStart(2, '0')}${color.g.toString(16).padStart(2, '0')}${color.b.toString(16).padStart(2, '0')}`;\n const hexAlpha = Math.round(alpha * 255)\n .toString(16)\n .padStart(2, '0');\n\n return opaque ? hex : `${hex}${hexAlpha}`;\n }\n if (format === 'hsl') {\n const { h, s, l } = rgb2hsl(color);\n\n return opaque ? `hsl(${h}, ${s}%, ${l}%)` : `hsla(${h}, ${s}%, ${l}%, ${rounded})`;\n }\n\n return opaque ? `rgb(${color.r}, ${color.g}, ${color.b})` : `rgba(${color.r}, ${color.g}, ${color.b}, ${rounded})`;\n}\n\n/**\n * Guess the notation of the given color string.\n *\n * @param color The color string.\n */\nfunction detectFormat(color: string): ColorPickerFormat | null {\n const str = (color || '').trim().toLowerCase();\n if (str.startsWith('#')) {\n return 'hex';\n }\n if (str.startsWith('rgb')) {\n return 'rgb';\n }\n if (str.startsWith('hsl')) {\n return 'hsl';\n }\n return null;\n}\n\ninterface EyeDropperInstance {\n open: (options?: { signal?: AbortSignal }) => Promise<{ sRGBHex: string }>;\n}\n\n/**\n * Read the `EyeDropper` constructor, which is not part of the DOM types yet.\n */\nfunction getEyeDropper(): (new () => EyeDropperInstance) | undefined {\n if (typeof window === 'undefined') {\n return undefined;\n }\n return (window as unknown as Record<string, unknown>).EyeDropper as (new () => EyeDropperInstance) | undefined;\n}\n\ninterface ColorPickerProps {\n /** Set to true to disable the color picker. */\n disabled?: boolean;\n /** The currently selected color. */\n value?: string;\n /** @deprecated The currently selected color use value */\n color?: string;\n /** The color change callback. */\n onChange: (rgba: string) => void;\n /** Label of the color picker. */\n label?: string;\n /** @deprecated TLabel of the color picker use label */\n name?: string;\n /** Additional styling for this component. */\n style?: CSSProperties;\n /** The CSS class name. */\n className?: string;\n /** Predefined colors that are offered below the picker. */\n customPalette?: string[];\n /** Do not show the text field with the color value, only the color bar. */\n noInputField?: boolean;\n /** Width of the color bar. */\n barWidth?: number;\n sx?: Record<string, any>;\n /** @deprecated the theme is taken from the MUI context */\n theme?: IobTheme;\n /** Hide the alpha slider and always report a fully opaque color. */\n noAlpha?: boolean;\n /** Notation of the reported value. If not set, it is taken from the incoming value and defaults to `rgb`. */\n format?: ColorPickerFormat;\n /** Do not offer the recently used colors. */\n noRecentColors?: boolean;\n /** Width of the picker popup in pixels. Default 280. */\n pickerWidth?: number;\n /** ID of the text field. Must be set if more than one color picker is rendered at the same time. */\n id?: string;\n}\n\ninterface ColorPickerState {\n displayColorPicker: boolean;\n /** The working color of the picker. Always valid, even if no color is selected. */\n rgba: RgbaColor;\n /** The text shown in the input field. An empty string means \"no color selected\". */\n textValue: string;\n format: ColorPickerFormat;\n anchorEl: HTMLDivElement | null;\n recentColors: string[];\n}\n\n/**\n * A color picker component with alpha channel, eye dropper and HEX/RGB/HSL notations.\n */\nexport class ColorPicker extends Component<ColorPickerProps, ColorPickerState> {\n /**\n * Constructor for the color picker.\n *\n * @param props The properties.\n */\n constructor(props: ColorPickerProps) {\n super(props);\n const value = props.value || props.color || '';\n\n this.state = {\n displayColorPicker: false,\n rgba: parseColor(value) || { ...DEFAULT_COLOR },\n textValue: value,\n format: props.format || detectFormat(value) || 'rgb',\n anchorEl: null,\n recentColors: [],\n };\n }\n\n /**\n * If the props are updated from outside, they should override the state\n *\n * @param prevProps The previous properties.\n */\n componentDidUpdate(prevProps: ColorPickerProps): void {\n const prevValue = prevProps.value ?? prevProps.color ?? '';\n const value = this.props.value ?? this.props.color ?? '';\n\n // React only on real changes from outside. If the value equals what is shown, it is the own echo.\n if (prevValue !== value && value !== this.state.textValue) {\n this.setState({\n rgba: parseColor(value) || { ...DEFAULT_COLOR },\n textValue: value,\n format: this.props.format || detectFormat(value) || this.state.format,\n });\n } else if (this.props.format && this.props.format !== prevProps.format) {\n this.setState({ format: this.props.format });\n }\n }\n\n /**\n * Convert the given color to hex ('#rrggbb') or rgba ('rgba(r,g,b,a)') format.\n *\n * @param color The color to convert.\n * @param isHex If true, the color will be converted to hex format.\n * @returns the hex or rgba representation of the given color.\n */\n static getColor(color: string | { rgb: RGBColor } | RGBColor, isHex?: boolean): string {\n if (color && typeof color === 'object') {\n const oColor = color as { rgb: RGBColor };\n const rColor: RGBColor = oColor.rgb ? oColor.rgb : (color as RGBColor);\n\n if (isHex) {\n return `#${rColor.r.toString(16).padStart(2, '0')}${rColor.g.toString(16).padStart(2, '0')}${rColor.b.toString(16).padStart(2, '0')}`;\n }\n return `rgba(${rColor.r},${rColor.g},${rColor.b},${rColor.a ?? 1})`;\n }\n if (typeof color === 'string') {\n return isHex ? ColorPicker.rgb2hex(color || '') : color || '';\n }\n return '';\n }\n\n /**\n * Convert rgb() or rgba() format to hex format #rrggbb.\n *\n * @param rgb The color in rgb() or rgba() format. if not in this format, the color will be returned as is.\n */\n static rgb2hex(rgb: string): string {\n const m = /^rgba?[\\s+]?\\([\\s+]?(\\d+)[\\s+]?,[\\s+]?(\\d+)[\\s+]?,[\\s+]?(\\d+)[\\s+]?/i.exec(rgb);\n\n if (m) {\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?.length === 4 ? `#${r}${g}${b}` : rgb;\n }\n return rgb;\n }\n\n /**\n * Read the recently used colors from the local storage.\n */\n static readRecentColors(): string[] {\n try {\n const stored = window.localStorage.getItem(RECENT_COLORS_KEY);\n const parsed: unknown = stored ? JSON.parse(stored) : null;\n\n if (Array.isArray(parsed)) {\n return parsed.filter((item): item is string => typeof item === 'string').slice(0, MAX_RECENT_COLORS);\n }\n } catch {\n // ignore a broken or unavailable local storage\n }\n return [];\n }\n\n /**\n * Remember the given color as recently used.\n *\n * @param color The color to remember.\n */\n storeRecentColor(color: string): void {\n if (this.props.noRecentColors || !color || this.state.recentColors[0] === color) {\n return;\n }\n const recentColors = [color, ...this.state.recentColors.filter(item => item !== color)].slice(\n 0,\n MAX_RECENT_COLORS,\n );\n\n this.setState({ recentColors });\n\n try {\n window.localStorage.setItem(RECENT_COLORS_KEY, JSON.stringify(recentColors));\n } catch {\n // ignore an unavailable local storage\n }\n }\n\n private handleClick = (e: React.MouseEvent<HTMLDivElement>): void => {\n const open = !this.state.displayColorPicker;\n\n this.setState({\n displayColorPicker: open,\n anchorEl: open ? e.currentTarget : null,\n // read the recent colors on every open, so colors picked in another instance show up too\n recentColors: open && !this.props.noRecentColors ? ColorPicker.readRecentColors() : this.state.recentColors,\n });\n };\n\n private handleClose = (): void => {\n this.storeRecentColor(this.state.textValue);\n this.setState({ displayColorPicker: false, anchorEl: null });\n };\n\n /**\n * The user moved a slider, clicked a swatch or used the eye dropper.\n *\n * @param rgba The new color.\n */\n private handleColorChange = (rgba: RgbaColor): void => {\n const textValue = formatColor(rgba, this.state.format, this.props.noAlpha);\n\n this.setState({ rgba, textValue }, () => this.props.onChange?.(textValue));\n };\n\n /**\n * The user typed into the input field. The text is taken as it is and only parsed for the preview.\n *\n * @param textValue The entered text.\n */\n private handleTextChange = (textValue: string): void => {\n const rgba = parseColor(textValue);\n\n this.setState({ textValue, rgba: rgba || this.state.rgba }, () => this.props.onChange?.(textValue));\n };\n\n /**\n * Switch between the #rrggbb, rgba() and hsla() notations.\n *\n * @param format The new notation.\n */\n private handleFormatChange = (format: ColorPickerFormat): void => {\n if (!this.state.textValue) {\n this.setState({ format });\n return;\n }\n const textValue = formatColor(this.state.rgba, format, this.props.noAlpha);\n\n this.setState({ format, textValue }, () => this.props.onChange?.(textValue));\n };\n\n private handleClear = (): void => {\n this.setState({ textValue: '', rgba: { ...DEFAULT_COLOR } }, () => this.props.onChange?.(''));\n };\n\n private handleEyeDropper = (): void => {\n const EyeDropper = getEyeDropper();\n if (!EyeDropper) {\n return;\n }\n\n void new EyeDropper()\n .open()\n .then(result => {\n const rgba = parseColor(result.sRGBHex);\n if (rgba) {\n // the eye dropper always returns an opaque color, so the current alpha is kept\n this.handleColorChange({ ...rgba, a: this.props.noAlpha ? 1 : (this.state.rgba.a ?? 1) });\n }\n })\n .catch(() => {\n // the user aborted the selection with ESC\n });\n };\n\n /**\n * Render a row of predefined colors.\n *\n * @param colors The colors to show.\n * @param title The title above the row.\n */\n renderSwatches(colors: string[], title: string): React.JSX.Element | null {\n if (!colors.length) {\n return null;\n }\n return (\n <Box component=\"div\">\n <Box\n component=\"div\"\n sx={styles.sectionTitle}\n >\n {title}\n </Box>\n <Box\n component=\"div\"\n sx={styles.swatchRow}\n >\n {colors.map((color, i) => (\n <Button\n sx={styles.paletteItem}\n key={`${color}_${i}`}\n title={color}\n onClick={() => {\n const rgba = parseColor(color);\n if (rgba) {\n this.handleColorChange(rgba);\n } else {\n this.handleTextChange(color);\n }\n }}\n >\n <Box\n component=\"div\"\n sx={styles.fill}\n style={{ background: color }}\n />\n </Button>\n ))}\n </Box>\n </Box>\n );\n }\n\n renderPicker(): React.JSX.Element {\n const { rgba, textValue, format } = this.state;\n const Picker = this.props.noAlpha ? RgbColorPicker : RgbaColorPicker;\n\n return (\n <Box\n component=\"div\"\n sx={styles.pickerWrapper}\n style={{ width: this.props.pickerWidth || 280 }}\n >\n <Picker\n color={rgba}\n onChange={(color: RgbaColor | { r: number; g: number; b: number }) =>\n this.handleColorChange({ a: rgba.a ?? 1, ...color })\n }\n />\n <Box\n component=\"div\"\n sx={styles.controlRow}\n >\n {getEyeDropper() ? (\n <Tooltip title={I18n.t('ra_Pick color from screen')}>\n <IconButton\n size=\"small\"\n onClick={this.handleEyeDropper}\n >\n <IconColorize fontSize=\"small\" />\n </IconButton>\n </Tooltip>\n ) : null}\n <Box\n component=\"div\"\n sx={styles.preview}\n >\n <Box\n component=\"div\"\n sx={styles.fill}\n style={{ background: textValue || 'transparent' }}\n />\n </Box>\n <TextField\n variant=\"standard\"\n size=\"small\"\n sx={styles.valueInput}\n value={textValue}\n placeholder={I18n.t('ra_Select color')}\n onChange={e => this.handleTextChange(e.target.value)}\n />\n <Select\n variant=\"standard\"\n disableUnderline\n sx={styles.formatSelect}\n value={format}\n onChange={e => this.handleFormatChange(e.target.value)}\n >\n <MenuItem value=\"hex\">HEX</MenuItem>\n <MenuItem value=\"rgb\">RGB</MenuItem>\n <MenuItem value=\"hsl\">HSL</MenuItem>\n </Select>\n <Tooltip title={I18n.t('ra_Clear color')}>\n <span>\n <IconButton\n size=\"small\"\n disabled={!textValue}\n onClick={this.handleClear}\n >\n <IconDelete fontSize=\"small\" />\n </IconButton>\n </span>\n </Tooltip>\n </Box>\n {this.renderSwatches(this.props.customPalette || [], I18n.t('ra_Palette'))}\n {this.renderSwatches(\n this.props.noRecentColors ? [] : this.state.recentColors,\n I18n.t('ra_Recently used colors'),\n )}\n </Box>\n );\n }\n\n render(): React.JSX.Element {\n const style = { ...(this.props.style || {}) };\n style.position = 'relative';\n const { textValue } = this.state;\n const hasLabel = !!(this.props.label || this.props.name);\n\n return (\n <Box\n component=\"div\"\n style={style}\n sx={this.props.sx || undefined}\n className={this.props.className || ''}\n >\n {this.props.noInputField ? null : (\n <TextField\n disabled={this.props.disabled}\n variant=\"standard\"\n id={this.props.id || 'ar_color_picker_name'}\n label={this.props.label || this.props.name}\n value={textValue}\n margin=\"dense\"\n sx={{\n '&.MuiFormControl-root': styles.textDense,\n width: textValue ? 'calc(100% - 80px)' : 'calc(100% - 56px)',\n mr: textValue ? undefined : 1,\n }}\n onChange={e => this.handleTextChange(e.target.value)}\n />\n )}\n {!this.props.noInputField && textValue ? (\n <IconButton\n disabled={this.props.disabled}\n onClick={this.handleClear}\n size=\"small\"\n style={hasLabel ? styles.delButton : undefined}\n >\n <IconDelete />\n </IconButton>\n ) : null}\n <Box\n component=\"div\"\n onClick={e => !this.props.disabled && this.handleClick(e)}\n title={I18n.t('ra_Select color')}\n sx={{\n ...styles.swatch,\n ...(this.props.disabled ? styles.swatchDisabled : undefined),\n marginTop: this.props.noInputField || !hasLabel ? 0 : undefined,\n }}\n >\n <Box\n component=\"div\"\n sx={{\n ...styles.color,\n border: textValue ? undefined : '1px dashed #888',\n boxSizing: 'border-box',\n }}\n style={{\n width: this.props.noInputField ? this.props.barWidth || 16 : this.props.barWidth || 36,\n }}\n >\n <Box\n component=\"div\"\n sx={styles.fill}\n style={{ background: textValue || 'transparent' }}\n />\n </Box>\n </Box>\n {this.state.displayColorPicker && !this.props.disabled ? (\n <Popover\n sx={styles.popover}\n anchorEl={this.state.anchorEl}\n open={!0}\n onClose={this.handleClose}\n anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }}\n transformOrigin={{ vertical: 'top', horizontal: 'left' }}\n >\n {this.renderPicker()}\n </Popover>\n ) : null}\n </Box>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"ColorPicker.js","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IAAI,CAAC,WAAW,EACzB,YAAY,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,EACxD,eAAe,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,IAEvD,IAAI,CAAC,YAAY,EAAE,CACd,CACb,CAAC,CAAC,CAAC,IAAI,CACN,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["/**\n * Copyright 2018-2026 Denis Haev (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, { Component, type CSSProperties } from 'react';\nimport { RgbaColorPicker, RgbColorPicker, type RgbaColor } from 'react-colorful';\n\nimport { TextField, Popover, IconButton, Button, Box, Tooltip, MenuItem, Select } from '@mui/material';\n\nimport { Colorize as IconColorize } from '@mui/icons-material';\nimport { IconTrash } from './AnimatedIcons/IconTrash';\n\nimport { I18n } from '../i18n';\n\nimport type { IobTheme } from '../types';\n\n/** Color in the `{ r, g, b, a }` notation. Kept for backwards compatibility with `react-color`. */\nexport interface RGBColor {\n r: number;\n g: number;\n b: number;\n a?: number;\n}\n\n/** Notation used for the value that is reported via `onChange`. */\nexport type ColorPickerFormat = 'hex' | 'rgb' | 'hsl';\n\nconst RECENT_COLORS_KEY = 'iob-color-picker-recent';\nconst MAX_RECENT_COLORS = 12;\n\n/** Small checkerboard, so a semi-transparent color is recognizable as such */\nconst ALPHA_BACKGROUND =\n 'linear-gradient(45deg, #c0c0c0 25%, transparent 25%), linear-gradient(-45deg, #c0c0c0 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #c0c0c0 75%), linear-gradient(-45deg, transparent 75%, #c0c0c0 75%)';\n\nconst ALPHA_BACKGROUND_SIZE = '8px 8px';\nconst ALPHA_BACKGROUND_POSITION = '0 0, 0 4px, 4px -4px, -4px 0px';\n\nconst styles: Record<string, any> = {\n swatch: {\n mt: '16px',\n p: '4px',\n backgroundColor: 'background.paper',\n borderRadius: '6px',\n boxShadow: '0 0 0 1px rgba(128,128,128,.35)',\n display: 'inline-block',\n cursor: 'pointer',\n verticalAlign: 'middle',\n transition: 'box-shadow 0.15s ease-in-out',\n '&:hover': {\n boxShadow: '0 0 0 2px rgba(128,128,128,.6)',\n },\n },\n swatchDisabled: {\n opacity: 0.5,\n cursor: 'default',\n '&:hover': {\n boxShadow: '0 0 0 1px rgba(128,128,128,.35)',\n },\n },\n color: {\n height: 14,\n borderRadius: '3px',\n backgroundImage: ALPHA_BACKGROUND,\n backgroundSize: ALPHA_BACKGROUND_SIZE,\n backgroundPosition: ALPHA_BACKGROUND_POSITION,\n },\n delButton: {\n marginTop: 16,\n },\n textDense: {\n mt: 0,\n mb: 0,\n },\n popover: {\n '& .MuiPaper-root': {\n borderRadius: '12px',\n },\n },\n // The chrome around the react-colorful area\n pickerWrapper: (theme: IobTheme) => ({\n p: '12px',\n backgroundColor: theme.palette.background.paper,\n borderRadius: '12px',\n display: 'flex',\n flexDirection: 'column',\n gap: '10px',\n // restyle react-colorful, so it fits into the ioBroker themes\n '& .react-colorful': {\n width: '100%',\n height: 'auto',\n gap: '10px',\n },\n '& .react-colorful__saturation': {\n borderRadius: '8px',\n border: 'none',\n height: 150,\n boxShadow: 'none',\n },\n '& .react-colorful__hue, & .react-colorful__alpha': {\n height: 14,\n borderRadius: '7px',\n },\n '& .react-colorful__alpha': {\n backgroundImage: ALPHA_BACKGROUND,\n backgroundSize: ALPHA_BACKGROUND_SIZE,\n backgroundPosition: ALPHA_BACKGROUND_POSITION,\n },\n '& .react-colorful__last-control': {\n borderRadius: '7px',\n },\n '& .react-colorful__pointer': {\n width: 18,\n height: 18,\n borderWidth: 2,\n },\n '& .react-colorful__saturation-pointer': {\n width: 20,\n height: 20,\n },\n }),\n controlRow: {\n display: 'flex',\n alignItems: 'center',\n gap: '6px',\n },\n preview: {\n width: 28,\n height: 28,\n flexShrink: 0,\n borderRadius: '6px',\n boxShadow: '0 0 0 1px rgba(128,128,128,.35) inset',\n backgroundImage: ALPHA_BACKGROUND,\n backgroundSize: ALPHA_BACKGROUND_SIZE,\n backgroundPosition: ALPHA_BACKGROUND_POSITION,\n },\n valueInput: {\n flexGrow: 1,\n minWidth: 60,\n '& .MuiInputBase-input': {\n fontFamily: 'monospace',\n fontSize: '0.75rem',\n textOverflow: 'ellipsis',\n },\n },\n formatSelect: {\n flexShrink: 0,\n fontSize: '0.7rem',\n opacity: 0.75,\n '& .MuiSelect-select': {\n py: '4px',\n pl: '2px',\n pr: '18px !important',\n },\n '& .MuiSelect-icon': {\n right: 0,\n },\n },\n sectionTitle: {\n fontSize: '0.7rem',\n opacity: 0.6,\n textTransform: 'uppercase',\n letterSpacing: '0.06em',\n },\n swatchRow: {\n display: 'flex',\n flexWrap: 'wrap',\n gap: '4px',\n mt: '4px',\n },\n paletteItem: {\n width: 22,\n height: 22,\n p: 0,\n minWidth: 22,\n borderRadius: '5px',\n boxShadow: '0 0 0 1px rgba(128,128,128,.35) inset',\n backgroundImage: ALPHA_BACKGROUND,\n backgroundSize: ALPHA_BACKGROUND_SIZE,\n backgroundPosition: ALPHA_BACKGROUND_POSITION,\n '&:hover': {\n boxShadow: '0 0 0 2px rgba(128,128,128,.7) inset',\n },\n },\n fill: {\n width: '100%',\n height: '100%',\n borderRadius: 'inherit',\n },\n};\n\nconst DEFAULT_COLOR: RgbaColor = { r: 0, g: 0, b: 0, a: 1 };\n\nlet canvasContext: CanvasRenderingContext2D | null | undefined;\n\n/**\n * Normalize any CSS color notation (color names, `color()`, ...) with the help of a canvas.\n *\n * @param color The color string to normalize.\n * @returns the normalized color as `#rrggbb`/`rgba(...)` string or null if the string is no valid color.\n */\nfunction normalizeCssColor(color: string): string | null {\n if (canvasContext === undefined) {\n canvasContext = typeof document === 'undefined' ? null : document.createElement('canvas').getContext('2d');\n }\n if (!canvasContext) {\n return null;\n }\n // `fillStyle` keeps its previous value if the assigned string is no valid color,\n // so it must be probed with two different defaults\n canvasContext.fillStyle = '#000000';\n canvasContext.fillStyle = color;\n const first = canvasContext.fillStyle;\n canvasContext.fillStyle = '#ffffff';\n canvasContext.fillStyle = color;\n\n return first === canvasContext.fillStyle ? first : null;\n}\n\n/**\n * Convert h, s, l (0..1) to r, g, b (0..255).\n *\n * @param h The hue in the range 0..1.\n * @param s The saturation in the range 0..1.\n * @param l The lightness in the range 0..1.\n */\nfunction hsl2rgb(h: number, s: number, l: number): { r: number; g: number; b: number } {\n if (!s) {\n const v = Math.round(l * 255);\n return { r: v, g: v, b: v };\n }\n\n const hue2rgb = (p: number, q: number, t: number): number => {\n let _t = t;\n if (_t < 0) {\n _t += 1;\n }\n if (_t > 1) {\n _t -= 1;\n }\n if (_t < 1 / 6) {\n return p + (q - p) * 6 * _t;\n }\n if (_t < 1 / 2) {\n return q;\n }\n if (_t < 2 / 3) {\n return p + (q - p) * (2 / 3 - _t) * 6;\n }\n return p;\n };\n\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n\n return {\n r: Math.round(hue2rgb(p, q, h + 1 / 3) * 255),\n g: Math.round(hue2rgb(p, q, h) * 255),\n b: Math.round(hue2rgb(p, q, h - 1 / 3) * 255),\n };\n}\n\n/**\n * Convert r, g, b (0..255) to h (0..360), s, l (0..100).\n *\n * @param color The color to convert.\n */\nfunction rgb2hsl(color: RgbaColor): { h: number; s: number; l: number } {\n const r = color.r / 255;\n const g = color.g / 255;\n const b = color.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n\n if (max === min) {\n return { h: 0, s: 0, l: Math.round(l * 100) };\n }\n const d = max - min;\n const s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n let h: number;\n if (max === r) {\n h = (g - b) / d + (g < b ? 6 : 0);\n } else if (max === g) {\n h = (b - r) / d + 2;\n } else {\n h = (r - g) / d + 4;\n }\n\n return { h: Math.round((h / 6) * 360), s: Math.round(s * 100), l: Math.round(l * 100) };\n}\n\n/**\n * Clamp a number into the given range.\n *\n * @param value The value to clamp.\n * @param min The lower limit.\n * @param max The upper limit.\n */\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(max, Math.max(min, value));\n}\n\n/**\n * Read a color channel that may be given as `128` or as `50%`.\n *\n * @param value The channel as string.\n * @param max The maximal value of this channel.\n */\nfunction readChannel(value: string, max: number): number {\n const trimmed = value.trim();\n const parsed = parseFloat(trimmed);\n if (Number.isNaN(parsed)) {\n return 0;\n }\n return clamp(Math.round(trimmed.endsWith('%') ? (parsed / 100) * max : parsed), 0, max);\n}\n\n/**\n * Read the alpha channel that may be given as `0.5` or as `50%`.\n *\n * @param value The alpha channel as string or undefined if it is not given.\n */\nfunction readAlpha(value: string | undefined): number {\n if (value === undefined || value === '') {\n return 1;\n }\n const trimmed = value.trim();\n const parsed = trimmed.endsWith('%') ? parseFloat(trimmed) / 100 : parseFloat(trimmed);\n\n return Number.isNaN(parsed) ? 1 : clamp(parsed, 0, 1);\n}\n\n/**\n * Parse any CSS color notation into `{ r, g, b, a }`.\n *\n * Supported are `#rgb`, `#rgba`, `#rrggbb`, `#rrggbbaa`, `rgb()`, `rgba()`, `hsl()`, `hsla()` (comma or space\n * separated, with or without the `/ alpha` part) and every color name the browser knows.\n *\n * @param color The color string to parse.\n * @returns the parsed color or null if the string could not be interpreted.\n */\nexport function parseColor(color: string): RgbaColor | null {\n if (!color || typeof color !== 'string') {\n return null;\n }\n const str = color.trim().toLowerCase();\n if (!str) {\n return null;\n }\n if (str === 'transparent') {\n return { r: 0, g: 0, b: 0, a: 0 };\n }\n\n const hex = /^#([\\da-f]{3,8})$/.exec(str);\n if (hex) {\n const h = hex[1];\n if (h.length === 3 || h.length === 4) {\n return {\n r: parseInt(h[0] + h[0], 16),\n g: parseInt(h[1] + h[1], 16),\n b: parseInt(h[2] + h[2], 16),\n a: h.length === 4 ? Math.round((parseInt(h[3] + h[3], 16) / 255) * 100) / 100 : 1,\n };\n }\n if (h.length === 6 || h.length === 8) {\n return {\n r: parseInt(h.substring(0, 2), 16),\n g: parseInt(h.substring(2, 4), 16),\n b: parseInt(h.substring(4, 6), 16),\n a: h.length === 8 ? Math.round((parseInt(h.substring(6, 8), 16) / 255) * 100) / 100 : 1,\n };\n }\n return null;\n }\n\n const func = /^(rgba?|hsla?)\\(([^)]*)\\)$/.exec(str);\n if (func) {\n // both `1, 2, 3, 0.5` and `1 2 3 / 50%` are valid\n const parts = func[2]\n .replace('/', ',')\n .split(/[\\s,]+/)\n .filter(part => part !== '');\n\n if (parts.length < 3) {\n return null;\n }\n if (func[1].startsWith('rgb')) {\n return {\n r: readChannel(parts[0], 255),\n g: readChannel(parts[1], 255),\n b: readChannel(parts[2], 255),\n a: readAlpha(parts[3]),\n };\n }\n const hue = ((parseFloat(parts[0]) % 360) + 360) % 360;\n const rgb = hsl2rgb(\n hue / 360,\n clamp(parseFloat(parts[1]) / 100, 0, 1),\n clamp(parseFloat(parts[2]) / 100, 0, 1),\n );\n\n return { ...rgb, a: readAlpha(parts[3]) };\n }\n\n // color names and everything else the browser understands\n const normalized = normalizeCssColor(str);\n\n return normalized && normalized !== str ? parseColor(normalized) : null;\n}\n\n/**\n * Render `{ r, g, b, a }` in the requested notation.\n *\n * @param color The color to render.\n * @param format The desired notation.\n * @param noAlpha If true, the alpha channel is dropped.\n * @returns the color as CSS string.\n */\nexport function formatColor(color: RgbaColor, format: ColorPickerFormat, noAlpha?: boolean): string {\n const alpha = noAlpha ? 1 : (color.a ?? 1);\n const opaque = alpha >= 1;\n const rounded = Math.round(alpha * 100) / 100;\n\n if (format === 'hex') {\n const hex = `#${color.r.toString(16).padStart(2, '0')}${color.g.toString(16).padStart(2, '0')}${color.b.toString(16).padStart(2, '0')}`;\n const hexAlpha = Math.round(alpha * 255)\n .toString(16)\n .padStart(2, '0');\n\n return opaque ? hex : `${hex}${hexAlpha}`;\n }\n if (format === 'hsl') {\n const { h, s, l } = rgb2hsl(color);\n\n return opaque ? `hsl(${h}, ${s}%, ${l}%)` : `hsla(${h}, ${s}%, ${l}%, ${rounded})`;\n }\n\n return opaque ? `rgb(${color.r}, ${color.g}, ${color.b})` : `rgba(${color.r}, ${color.g}, ${color.b}, ${rounded})`;\n}\n\n/**\n * Guess the notation of the given color string.\n *\n * @param color The color string.\n */\nfunction detectFormat(color: string): ColorPickerFormat | null {\n const str = (color || '').trim().toLowerCase();\n if (str.startsWith('#')) {\n return 'hex';\n }\n if (str.startsWith('rgb')) {\n return 'rgb';\n }\n if (str.startsWith('hsl')) {\n return 'hsl';\n }\n return null;\n}\n\ninterface EyeDropperInstance {\n open: (options?: { signal?: AbortSignal }) => Promise<{ sRGBHex: string }>;\n}\n\n/**\n * Read the `EyeDropper` constructor, which is not part of the DOM types yet.\n */\nfunction getEyeDropper(): (new () => EyeDropperInstance) | undefined {\n if (typeof window === 'undefined') {\n return undefined;\n }\n return (window as unknown as Record<string, unknown>).EyeDropper as (new () => EyeDropperInstance) | undefined;\n}\n\ninterface ColorPickerProps {\n /** Set to true to disable the color picker. */\n disabled?: boolean;\n /** The currently selected color. */\n value?: string;\n /** @deprecated The currently selected color use value */\n color?: string;\n /** The color change callback. */\n onChange: (rgba: string) => void;\n /** Label of the color picker. */\n label?: string;\n /** @deprecated TLabel of the color picker use label */\n name?: string;\n /** Additional styling for this component. */\n style?: CSSProperties;\n /** The CSS class name. */\n className?: string;\n /** Predefined colors that are offered below the picker. */\n customPalette?: string[];\n /** Do not show the text field with the color value, only the color bar. */\n noInputField?: boolean;\n /** Width of the color bar. */\n barWidth?: number;\n sx?: Record<string, any>;\n /** @deprecated the theme is taken from the MUI context */\n theme?: IobTheme;\n /** Hide the alpha slider and always report a fully opaque color. */\n noAlpha?: boolean;\n /** Notation of the reported value. If not set, it is taken from the incoming value and defaults to `rgb`. */\n format?: ColorPickerFormat;\n /** Do not offer the recently used colors. */\n noRecentColors?: boolean;\n /** Width of the picker popup in pixels. Default 280. */\n pickerWidth?: number;\n /** ID of the text field. Must be set if more than one color picker is rendered at the same time. */\n id?: string;\n}\n\ninterface ColorPickerState {\n displayColorPicker: boolean;\n /** The working color of the picker. Always valid, even if no color is selected. */\n rgba: RgbaColor;\n /** The text shown in the input field. An empty string means \"no color selected\". */\n textValue: string;\n format: ColorPickerFormat;\n anchorEl: HTMLDivElement | null;\n recentColors: string[];\n}\n\n/**\n * A color picker component with alpha channel, eye dropper and HEX/RGB/HSL notations.\n */\nexport class ColorPicker extends Component<ColorPickerProps, ColorPickerState> {\n /**\n * Constructor for the color picker.\n *\n * @param props The properties.\n */\n constructor(props: ColorPickerProps) {\n super(props);\n const value = props.value || props.color || '';\n\n this.state = {\n displayColorPicker: false,\n rgba: parseColor(value) || { ...DEFAULT_COLOR },\n textValue: value,\n format: props.format || detectFormat(value) || 'rgb',\n anchorEl: null,\n recentColors: [],\n };\n }\n\n /**\n * If the props are updated from outside, they should override the state\n *\n * @param prevProps The previous properties.\n */\n componentDidUpdate(prevProps: ColorPickerProps): void {\n const prevValue = prevProps.value ?? prevProps.color ?? '';\n const value = this.props.value ?? this.props.color ?? '';\n\n // React only on real changes from outside. If the value equals what is shown, it is the own echo.\n if (prevValue !== value && value !== this.state.textValue) {\n this.setState({\n rgba: parseColor(value) || { ...DEFAULT_COLOR },\n textValue: value,\n format: this.props.format || detectFormat(value) || this.state.format,\n });\n } else if (this.props.format && this.props.format !== prevProps.format) {\n this.setState({ format: this.props.format });\n }\n }\n\n /**\n * Convert the given color to hex ('#rrggbb') or rgba ('rgba(r,g,b,a)') format.\n *\n * @param color The color to convert.\n * @param isHex If true, the color will be converted to hex format.\n * @returns the hex or rgba representation of the given color.\n */\n static getColor(color: string | { rgb: RGBColor } | RGBColor, isHex?: boolean): string {\n if (color && typeof color === 'object') {\n const oColor = color as { rgb: RGBColor };\n const rColor: RGBColor = oColor.rgb ? oColor.rgb : (color as RGBColor);\n\n if (isHex) {\n return `#${rColor.r.toString(16).padStart(2, '0')}${rColor.g.toString(16).padStart(2, '0')}${rColor.b.toString(16).padStart(2, '0')}`;\n }\n return `rgba(${rColor.r},${rColor.g},${rColor.b},${rColor.a ?? 1})`;\n }\n if (typeof color === 'string') {\n return isHex ? ColorPicker.rgb2hex(color || '') : color || '';\n }\n return '';\n }\n\n /**\n * Convert rgb() or rgba() format to hex format #rrggbb.\n *\n * @param rgb The color in rgb() or rgba() format. if not in this format, the color will be returned as is.\n */\n static rgb2hex(rgb: string): string {\n const m = /^rgba?[\\s+]?\\([\\s+]?(\\d+)[\\s+]?,[\\s+]?(\\d+)[\\s+]?,[\\s+]?(\\d+)[\\s+]?/i.exec(rgb);\n\n if (m) {\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?.length === 4 ? `#${r}${g}${b}` : rgb;\n }\n return rgb;\n }\n\n /**\n * Read the recently used colors from the local storage.\n */\n static readRecentColors(): string[] {\n try {\n const stored = window.localStorage.getItem(RECENT_COLORS_KEY);\n const parsed: unknown = stored ? JSON.parse(stored) : null;\n\n if (Array.isArray(parsed)) {\n return parsed.filter((item): item is string => typeof item === 'string').slice(0, MAX_RECENT_COLORS);\n }\n } catch {\n // ignore a broken or unavailable local storage\n }\n return [];\n }\n\n /**\n * Remember the given color as recently used.\n *\n * @param color The color to remember.\n */\n storeRecentColor(color: string): void {\n if (this.props.noRecentColors || !color || this.state.recentColors[0] === color) {\n return;\n }\n const recentColors = [color, ...this.state.recentColors.filter(item => item !== color)].slice(\n 0,\n MAX_RECENT_COLORS,\n );\n\n this.setState({ recentColors });\n\n try {\n window.localStorage.setItem(RECENT_COLORS_KEY, JSON.stringify(recentColors));\n } catch {\n // ignore an unavailable local storage\n }\n }\n\n private handleClick = (e: React.MouseEvent<HTMLDivElement>): void => {\n const open = !this.state.displayColorPicker;\n\n this.setState({\n displayColorPicker: open,\n anchorEl: open ? e.currentTarget : null,\n // read the recent colors on every open, so colors picked in another instance show up too\n recentColors: open && !this.props.noRecentColors ? ColorPicker.readRecentColors() : this.state.recentColors,\n });\n };\n\n private handleClose = (): void => {\n this.storeRecentColor(this.state.textValue);\n this.setState({ displayColorPicker: false, anchorEl: null });\n };\n\n /**\n * The user moved a slider, clicked a swatch or used the eye dropper.\n *\n * @param rgba The new color.\n */\n private handleColorChange = (rgba: RgbaColor): void => {\n const textValue = formatColor(rgba, this.state.format, this.props.noAlpha);\n\n this.setState({ rgba, textValue }, () => this.props.onChange?.(textValue));\n };\n\n /**\n * The user typed into the input field. The text is taken as it is and only parsed for the preview.\n *\n * @param textValue The entered text.\n */\n private handleTextChange = (textValue: string): void => {\n const rgba = parseColor(textValue);\n\n this.setState({ textValue, rgba: rgba || this.state.rgba }, () => this.props.onChange?.(textValue));\n };\n\n /**\n * Switch between the #rrggbb, rgba() and hsla() notations.\n *\n * @param format The new notation.\n */\n private handleFormatChange = (format: ColorPickerFormat): void => {\n if (!this.state.textValue) {\n this.setState({ format });\n return;\n }\n const textValue = formatColor(this.state.rgba, format, this.props.noAlpha);\n\n this.setState({ format, textValue }, () => this.props.onChange?.(textValue));\n };\n\n private handleClear = (): void => {\n this.setState({ textValue: '', rgba: { ...DEFAULT_COLOR } }, () => this.props.onChange?.(''));\n };\n\n private handleEyeDropper = (): void => {\n const EyeDropper = getEyeDropper();\n if (!EyeDropper) {\n return;\n }\n\n void new EyeDropper()\n .open()\n .then(result => {\n const rgba = parseColor(result.sRGBHex);\n if (rgba) {\n // the eye dropper always returns an opaque color, so the current alpha is kept\n this.handleColorChange({ ...rgba, a: this.props.noAlpha ? 1 : (this.state.rgba.a ?? 1) });\n }\n })\n .catch(() => {\n // the user aborted the selection with ESC\n });\n };\n\n /**\n * Render a row of predefined colors.\n *\n * @param colors The colors to show.\n * @param title The title above the row.\n */\n renderSwatches(colors: string[], title: string): React.JSX.Element | null {\n if (!colors.length) {\n return null;\n }\n return (\n <Box component=\"div\">\n <Box\n component=\"div\"\n sx={styles.sectionTitle}\n >\n {title}\n </Box>\n <Box\n component=\"div\"\n sx={styles.swatchRow}\n >\n {colors.map((color, i) => (\n <Button\n sx={styles.paletteItem}\n key={`${color}_${i}`}\n title={color}\n onClick={() => {\n const rgba = parseColor(color);\n if (rgba) {\n this.handleColorChange(rgba);\n } else {\n this.handleTextChange(color);\n }\n }}\n >\n <Box\n component=\"div\"\n sx={styles.fill}\n style={{ background: color }}\n />\n </Button>\n ))}\n </Box>\n </Box>\n );\n }\n\n renderPicker(): React.JSX.Element {\n const { rgba, textValue, format } = this.state;\n const Picker = this.props.noAlpha ? RgbColorPicker : RgbaColorPicker;\n\n return (\n <Box\n component=\"div\"\n sx={styles.pickerWrapper}\n style={{ width: this.props.pickerWidth || 280 }}\n >\n <Picker\n color={rgba}\n onChange={(color: RgbaColor | { r: number; g: number; b: number }) =>\n this.handleColorChange({ a: rgba.a ?? 1, ...color })\n }\n />\n <Box\n component=\"div\"\n sx={styles.controlRow}\n >\n {getEyeDropper() ? (\n <Tooltip title={I18n.t('ra_Pick color from screen')}>\n <IconButton\n size=\"small\"\n onClick={this.handleEyeDropper}\n >\n <IconColorize fontSize=\"small\" />\n </IconButton>\n </Tooltip>\n ) : null}\n <Box\n component=\"div\"\n sx={styles.preview}\n >\n <Box\n component=\"div\"\n sx={styles.fill}\n style={{ background: textValue || 'transparent' }}\n />\n </Box>\n <TextField\n variant=\"standard\"\n size=\"small\"\n sx={styles.valueInput}\n value={textValue}\n placeholder={I18n.t('ra_Select color')}\n onChange={e => this.handleTextChange(e.target.value)}\n />\n <Select\n variant=\"standard\"\n disableUnderline\n sx={styles.formatSelect}\n value={format}\n onChange={e => this.handleFormatChange(e.target.value)}\n >\n <MenuItem value=\"hex\">HEX</MenuItem>\n <MenuItem value=\"rgb\">RGB</MenuItem>\n <MenuItem value=\"hsl\">HSL</MenuItem>\n </Select>\n <Tooltip title={I18n.t('ra_Clear color')}>\n <span>\n <IconButton\n size=\"small\"\n disabled={!textValue}\n onClick={this.handleClear}\n >\n <IconTrash fontSize=\"small\" />\n </IconButton>\n </span>\n </Tooltip>\n </Box>\n {this.renderSwatches(this.props.customPalette || [], I18n.t('ra_Palette'))}\n {this.renderSwatches(\n this.props.noRecentColors ? [] : this.state.recentColors,\n I18n.t('ra_Recently used colors'),\n )}\n </Box>\n );\n }\n\n render(): React.JSX.Element {\n const style = { ...(this.props.style || {}) };\n style.position = 'relative';\n const { textValue } = this.state;\n const hasLabel = !!(this.props.label || this.props.name);\n\n return (\n <Box\n component=\"div\"\n style={style}\n sx={this.props.sx || undefined}\n className={this.props.className || ''}\n >\n {this.props.noInputField ? null : (\n <TextField\n disabled={this.props.disabled}\n variant=\"standard\"\n id={this.props.id || 'ar_color_picker_name'}\n label={this.props.label || this.props.name}\n value={textValue}\n margin=\"dense\"\n sx={{\n '&.MuiFormControl-root': styles.textDense,\n width: textValue ? 'calc(100% - 80px)' : 'calc(100% - 56px)',\n mr: textValue ? undefined : 1,\n }}\n onChange={e => this.handleTextChange(e.target.value)}\n />\n )}\n {!this.props.noInputField && textValue ? (\n <IconButton\n disabled={this.props.disabled}\n onClick={this.handleClear}\n size=\"small\"\n style={hasLabel ? styles.delButton : undefined}\n >\n <IconTrash />\n </IconButton>\n ) : null}\n <Box\n component=\"div\"\n onClick={e => !this.props.disabled && this.handleClick(e)}\n title={I18n.t('ra_Select color')}\n sx={{\n ...styles.swatch,\n ...(this.props.disabled ? styles.swatchDisabled : undefined),\n marginTop: this.props.noInputField || !hasLabel ? 0 : undefined,\n }}\n >\n <Box\n component=\"div\"\n sx={{\n ...styles.color,\n border: textValue ? undefined : '1px dashed #888',\n boxSizing: 'border-box',\n }}\n style={{\n width: this.props.noInputField ? this.props.barWidth || 16 : this.props.barWidth || 36,\n }}\n >\n <Box\n component=\"div\"\n sx={styles.fill}\n style={{ background: textValue || 'transparent' }}\n />\n </Box>\n </Box>\n {this.state.displayColorPicker && !this.props.disabled ? (\n <Popover\n sx={styles.popover}\n anchorEl={this.state.anchorEl}\n open={!0}\n onClose={this.handleClose}\n anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }}\n transformOrigin={{ vertical: 'top', horizontal: 'left' }}\n >\n {this.renderPicker()}\n </Popover>\n ) : null}\n </Box>\n );\n }\n}\n"]}
@@ -138,6 +138,10 @@ interface FileBrowserState {
138
138
  showTypesMenu: HTMLButtonElement | null;
139
139
  restrictToFolder: string;
140
140
  pathFocus: boolean;
141
+ /** The reload button was clicked and the folders are being read again */
142
+ reloading: boolean;
143
+ /** Dropped files are being uploaded */
144
+ uploading: boolean;
141
145
  }
142
146
  export declare class FileBrowserClass extends Component<FileBrowserProps, FileBrowserState> {
143
147
  private readonly imagePrefix;
@@ -166,6 +170,8 @@ export declare class FileBrowserClass extends Component<FileBrowserProps, FileBr
166
170
  constructor(props: FileBrowserProps);
167
171
  static getDerivedStateFromProps(props: FileBrowserProps, state: FileBrowserState): Partial<FileBrowserState> | null;
168
172
  loadFolders(): Promise<void>;
173
+ /** Reads all folders again; the reload button turns meanwhile */
174
+ reload(): void;
169
175
  scrollToSelected(): void;
170
176
  componentDidMount(): Promise<void>;
171
177
  componentWillUnmount(): void;
@@ -7,14 +7,18 @@
7
7
  import React, { Component } from 'react';
8
8
  import Dropzone from 'react-dropzone';
9
9
  import { LinearProgress, ListItemIcon, ListItemText, Menu, MenuItem, Tooltip, Toolbar, IconButton, Fab, Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions, Button, Input, Breadcrumbs, Box, Checkbox, FormControlLabel, } from '@mui/material';
10
+ import { alpha } from '@mui/material/styles';
10
11
  // MUI Icons
11
- import { ArrowBack as IconBack, AudioFile as TypeIconAudio, Bookmark as JsonIcon, BookmarkBorder as CssIcon, Brightness6 as Brightness5Icon, Close as CloseIcon, Code as JSIcon, CreateNewFolder as AddFolderIcon, Delete as DeleteIcon, Description as HtmlIcon, Edit as EditIcon, FolderOpen as EmptyFilterIcon, FolderSpecial as RestrictedIcon, FontDownload as TypeIconTxt, Image as TypeIconImages, InsertDriveFile as FileIcon, KeyboardReturn as EnterIcon, List as IconList, MusicNote as MusicIcon, Publish as UploadIcon, Refresh as RefreshIcon, SaveAlt as DownloadIcon, Videocam as TypeIconVideo, ViewModule as IconTile, } from '@mui/icons-material';
12
+ import { ArrowBack as IconBack, AudioFile as TypeIconAudio, Bookmark as JsonIcon, BookmarkBorder as CssIcon, Brightness6 as Brightness5Icon, Close as CloseIcon, Code as JSIcon, CreateNewFolder as AddFolderIcon, Description as HtmlIcon, Edit as EditIcon, FolderOpen as EmptyFilterIcon, FolderSpecial as RestrictedIcon, FontDownload as TypeIconTxt, Image as TypeIconImages, InsertDriveFile as FileIcon, KeyboardReturn as EnterIcon, List as IconList, MusicNote as MusicIcon, SaveAlt as DownloadIcon, Videocam as TypeIconVideo, ViewModule as IconTile, } from '@mui/icons-material';
12
13
  import { DialogError } from '../Dialogs/Error';
13
14
  import { Utils } from './Utils';
14
15
  import { DialogTextInput } from '../Dialogs/TextInput';
15
16
  // Custom Icons
16
17
  import { IconExpertMode } from './AnimatedIcons/IconExpertMode';
17
18
  import { IconFolder } from './AnimatedIcons/IconFolder';
19
+ import { IconTrash } from './AnimatedIcons/IconTrash';
20
+ import { IconRefresh } from './AnimatedIcons/IconRefresh';
21
+ import { IconUpload } from './AnimatedIcons/IconUpload';
18
22
  import { IconClosed } from '../icons/IconClosed';
19
23
  import { IconNoIcon } from '../icons/IconNoIcon';
20
24
  import { Icon } from './Icon';
@@ -286,6 +290,18 @@ const styles = {
286
290
  alignItems: 'center',
287
291
  justifyContent: 'center',
288
292
  }),
293
+ /** Files are dragged over the drop area: its border pulses */
294
+ uploadCenterDivDragging: (theme) => ({
295
+ borderColor: theme.palette.primary.main,
296
+ animation: 'iob-fb-drop-pulse 1.2s ease-in-out infinite',
297
+ '@keyframes iob-fb-drop-pulse': {
298
+ '0%': { boxShadow: `0 0 0 0 ${alpha(theme.palette.primary.main, 0.4)}` },
299
+ '70%, 100%': { boxShadow: `0 0 0 14px ${alpha(theme.palette.primary.main, 0)}` },
300
+ },
301
+ '@media (prefers-reduced-motion: reduce)': {
302
+ animation: 'none',
303
+ },
304
+ }),
289
305
  uploadCenterIcon: {
290
306
  width: '25%',
291
307
  height: '25%',
@@ -493,6 +509,8 @@ export class FileBrowserClass extends Component {
493
509
  restrictToFolder: props.restrictToFolder || '',
494
510
  pathFocus: false,
495
511
  suppressDeleteConfirm: false,
512
+ reloading: false,
513
+ uploading: false,
496
514
  };
497
515
  this.imagePrefix = this.props.imagePrefix || './files/';
498
516
  this.levelPadding = this.props.levelPadding || 20;
@@ -542,6 +560,12 @@ export class FileBrowserClass extends Component {
542
560
  this.initialReadFinished = true;
543
561
  });
544
562
  }
563
+ /** Reads all folders again; the reload button turns meanwhile */
564
+ reload() {
565
+ this.setState({ folders: {}, reloading: true }, () => this.loadFolders()
566
+ .catch(error => console.error(`Cannot load folders: ${error}`))
567
+ .finally(() => this.mounted && this.setState({ reloading: false })));
568
+ }
545
569
  scrollToSelected() {
546
570
  if (this.mounted) {
547
571
  const el = document.getElementById(this.state.selected);
@@ -1032,7 +1056,7 @@ export class FileBrowserClass extends Component {
1032
1056
  this.setState({ deleteItem: item.id });
1033
1057
  }
1034
1058
  }, sx: styles[`itemDeleteButton${this.state.viewType}`], size: "large" },
1035
- React.createElement(DeleteIcon, { fontSize: "small" }))) : this.state.viewType === TABLE && this.props.allowDelete ? (React.createElement(Box, { component: "div", sx: styles[`itemDeleteButton${this.state.viewType}`] })) : null));
1059
+ React.createElement(IconTrash, { fontSize: "small", open: this.state.deleteItem === item.id }))) : this.state.viewType === TABLE && this.props.allowDelete ? (React.createElement(Box, { component: "div", sx: styles[`itemDeleteButton${this.state.viewType}`] })) : null));
1036
1060
  }
1037
1061
  renderBackFolder() {
1038
1062
  return (React.createElement(Box, { component: "div", key: this.state.currentDir, id: this.state.currentDir, onClick: e => this.changeFolder(e), title: this.props.t('ra_Back to %s', getParentDir(this.state.currentDir)), className: "browserItem", sx: Utils.getStyle(this.props.theme, styles[`item${this.state.viewType}`], styles[`itemFolder${this.state.viewType}`]) },
@@ -1182,7 +1206,7 @@ export class FileBrowserClass extends Component {
1182
1206
  this.setState({ deleteItem: item.id });
1183
1207
  }
1184
1208
  }, sx: styles[`itemDeleteButton${this.state.viewType}`], size: "large" },
1185
- React.createElement(DeleteIcon, { fontSize: "small" }))) : this.state.viewType === TABLE && this.props.allowDelete ? (React.createElement(Box, { component: "div", sx: styles[`itemDeleteButton${this.state.viewType}`] })) : null));
1209
+ React.createElement(IconTrash, { fontSize: "small", open: this.state.deleteItem === item.id }))) : this.state.viewType === TABLE && this.props.allowDelete ? (React.createElement(Box, { component: "div", sx: styles[`itemDeleteButton${this.state.viewType}`] })) : null));
1186
1210
  }
1187
1211
  renderItems(folderId) {
1188
1212
  if (this.state.folders?.[folderId]) {
@@ -1281,8 +1305,8 @@ export class FileBrowserClass extends Component {
1281
1305
  this.setState({ filterEmpty: !this.state.filterEmpty });
1282
1306
  }, size: "small" },
1283
1307
  React.createElement(EmptyFilterIcon, { fontSize: "small" })),
1284
- React.createElement(IconButton, { edge: "start", title: this.props.t('ra_Reload files'), style: styles.menuButton, color: "inherit", "aria-label": "reload files", onClick: () => this.setState({ folders: {} }, () => this.loadFolders()), size: "small" },
1285
- React.createElement(RefreshIcon, { fontSize: "small" })),
1308
+ React.createElement(IconButton, { edge: "start", title: this.props.t('ra_Reload files'), style: styles.menuButton, color: "inherit", "aria-label": "reload files", disabled: this.state.reloading, onClick: () => this.reload(), size: "small" },
1309
+ React.createElement(IconRefresh, { fontSize: "small", loading: this.state.reloading })),
1286
1310
  this.props.allowCreateFolder ? (React.createElement(IconButton, { edge: "start", disabled: !this.state.selected ||
1287
1311
  !isInFolder ||
1288
1312
  (!!this.limitToPath &&
@@ -1294,7 +1318,7 @@ export class FileBrowserClass extends Component {
1294
1318
  (!!this.limitToPath &&
1295
1319
  !this.state.selected.startsWith(`${this.limitToPath}/`) &&
1296
1320
  this.limitToPath !== this.state.selected), title: this.props.t('ra_Upload file'), style: styles.menuButton, color: "inherit", "aria-label": "upload file", onClick: () => this.setState({ uploadFile: true }), size: "small" },
1297
- React.createElement(UploadIcon, { fontSize: "small" }))) : null,
1321
+ React.createElement(IconUpload, { fontSize: "small", uploading: this.state.uploading }))) : null,
1298
1322
  this.props.showTypeSelector && IconType ? (React.createElement(Tooltip, { title: this.props.t('ra_Filter files'), slotProps: { popper: { sx: styles.tooltip } } },
1299
1323
  React.createElement(IconButton, { size: "small", onClick: e => this.setState({ showTypesMenu: e.target }) },
1300
1324
  React.createElement(IconType, { fontSize: "small" })))) : null,
@@ -1331,7 +1355,7 @@ export class FileBrowserClass extends Component {
1331
1355
  this.setState({ deleteItem: this.state.selected });
1332
1356
  }
1333
1357
  }, size: "small" },
1334
- React.createElement(DeleteIcon, { fontSize: "small" }))))) : null));
1358
+ React.createElement(IconTrash, { fontSize: "small", open: !!this.state.deleteItem && this.state.deleteItem === this.state.selected }))))) : null));
1335
1359
  }
1336
1360
  findItem(id, folders) {
1337
1361
  folders = folders || this.state.folders;
@@ -1517,20 +1541,38 @@ export class FileBrowserClass extends Component {
1517
1541
  React.createElement(CloseIcon, null)),
1518
1542
  React.createElement(Dropzone, { key: "dropzone", onDragEnter: () => this.setState({ uploadFile: 'dragging' }), onDragLeave: () => this.setState({ uploadFile: true }), onDrop: acceptedFiles => {
1519
1543
  let count = acceptedFiles.length;
1544
+ if (!count) {
1545
+ this.setState({ uploadFile: true });
1546
+ return;
1547
+ }
1548
+ this.setState({ uploading: true });
1549
+ // a file that cannot be read or written does not keep the upload icon moving
1550
+ const failed = () => {
1551
+ if (!--count) {
1552
+ this.setState({ uploading: false });
1553
+ }
1554
+ };
1520
1555
  acceptedFiles.forEach(file => {
1521
1556
  const reader = new FileReader();
1522
- reader.onabort = () => console.log('file reading was aborted');
1523
- reader.onerror = () => console.log('file reading has failed');
1557
+ reader.onabort = () => {
1558
+ console.log('file reading was aborted');
1559
+ failed();
1560
+ };
1561
+ reader.onerror = () => {
1562
+ console.log('file reading has failed');
1563
+ failed();
1564
+ };
1524
1565
  reader.onload = () => {
1525
1566
  const parentFolder = this.findFirstFolder(this.state.selected);
1526
1567
  if (!parentFolder) {
1527
1568
  window.alert(this.props.t('ra_Invalid parent folder!'));
1569
+ failed();
1528
1570
  }
1529
1571
  else {
1530
1572
  const id = `${parentFolder}/${file.name}`;
1531
1573
  void this.uploadFile(id, reader.result).then(() => {
1532
1574
  if (!--count) {
1533
- this.setState({ uploadFile: false }, () => {
1575
+ this.setState({ uploadFile: false, uploading: false }, () => {
1534
1576
  if (this.supportSubscribes) {
1535
1577
  // open current folder
1536
1578
  const expanded = [...this.state.expanded];
@@ -1565,9 +1607,9 @@ export class FileBrowserClass extends Component {
1565
1607
  ...(this.state.uploadFile === 'dragging' ? styles.uploadDivDragging : undefined),
1566
1608
  }, ...getRootProps() },
1567
1609
  React.createElement("input", { ...getInputProps() }),
1568
- React.createElement(Box, { component: "div", sx: styles.uploadCenterDiv },
1610
+ React.createElement(Box, { component: "div", sx: Utils.getStyle(this.props.theme, styles.uploadCenterDiv, this.state.uploadFile === 'dragging' ? styles.uploadCenterDivDragging : undefined) },
1569
1611
  React.createElement("div", { style: styles.uploadCenterTextAndIcon },
1570
- React.createElement(UploadIcon, { style: styles.uploadCenterIcon }),
1612
+ React.createElement(IconUpload, { style: styles.uploadCenterIcon, ready: this.state.uploadFile === 'dragging', uploading: this.state.uploading }),
1571
1613
  React.createElement("div", { style: styles.uploadCenterText }, this.state.uploadFile === 'dragging'
1572
1614
  ? this.props.t('ra_Drop file here')
1573
1615
  : this.props.t('ra_Place your files here or click here to open the browse dialog'))))))),