@iobroker/gui-components 10.2.3 → 10.3.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 (42) hide show
  1. package/README.md +8 -1
  2. package/build/Components/IconLibrary/classicIcons.d.ts +15 -0
  3. package/build/Components/IconLibrary/classicIcons.js +1941 -0
  4. package/build/Components/IconLibrary/classicIcons.js.map +1 -0
  5. package/build/Components/IconLibrary/iconLibrary.d.ts +32 -0
  6. package/build/Components/IconLibrary/iconLibrary.js +49 -0
  7. package/build/Components/IconLibrary/iconLibrary.js.map +1 -0
  8. package/build/Components/IconLibrary/iconLibraryData.d.ts +3 -0
  9. package/build/Components/IconLibrary/iconLibraryData.js +452 -0
  10. package/build/Components/IconLibrary/iconLibraryData.js.map +1 -0
  11. package/build/Components/IconLibrary/types.d.ts +16 -0
  12. package/build/Components/IconLibrary/types.js +2 -0
  13. package/build/Components/IconLibrary/types.js.map +1 -0
  14. package/build/Components/IconSelector.d.ts +30 -4
  15. package/build/Components/IconSelector.js +243 -2056
  16. package/build/Components/IconSelector.js.map +1 -1
  17. package/build/i18n/de.json +1 -0
  18. package/build/i18n/en.json +1 -0
  19. package/build/i18n/es.json +1 -0
  20. package/build/i18n/fr.json +1 -0
  21. package/build/i18n/it.json +1 -0
  22. package/build/i18n/nl.json +1 -0
  23. package/build/i18n/pl.json +1 -0
  24. package/build/i18n/pt.json +1 -0
  25. package/build/i18n/ru.json +1 -0
  26. package/build/i18n/uk.json +1 -0
  27. package/build/i18n/zh-cn.json +1 -0
  28. package/build/index.d.ts +3 -0
  29. package/build/index.js +2 -0
  30. package/build/index.js.map +1 -1
  31. package/i18n/de.json +1 -0
  32. package/i18n/en.json +1 -0
  33. package/i18n/es.json +1 -0
  34. package/i18n/fr.json +1 -0
  35. package/i18n/it.json +1 -0
  36. package/i18n/nl.json +1 -0
  37. package/i18n/pl.json +1 -0
  38. package/i18n/pt.json +1 -0
  39. package/i18n/ru.json +1 -0
  40. package/i18n/uk.json +1 -0
  41. package/i18n/zh-cn.json +1 -0
  42. package/package.json +16 -14
@@ -0,0 +1,16 @@
1
+ export interface IconLibraryCategory {
2
+ id: string;
3
+ name: ioBroker.Translated;
4
+ /** The icons of this category are the classic room and device icons, not icons of the library */
5
+ builtin?: boolean;
6
+ }
7
+ export interface IconLibraryItem {
8
+ /** ID of the category */
9
+ c: string;
10
+ /** Unique ID of the icon */
11
+ id: string;
12
+ /** Name in every language */
13
+ n: ioBroker.Translated;
14
+ /** SVG path of the icon with the view box 0 0 24 24 */
15
+ p: string;
16
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"./src/","sources":["Components/IconLibrary/types.ts"],"names":[],"mappings":"","sourcesContent":["export interface IconLibraryCategory {\n id: string;\n name: ioBroker.Translated;\n /** The icons of this category are the classic room and device icons, not icons of the library */\n builtin?: boolean;\n}\n\nexport interface IconLibraryItem {\n /** ID of the category */\n c: string;\n /** Unique ID of the icon */\n id: string;\n /** Name in every language */\n n: ioBroker.Translated;\n /** SVG path of the icon with the view box 0 0 24 24 */\n p: string;\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import React, { Component } from 'react';
2
+ import type { IconLibraryCategory, IconLibraryItem } from './IconLibrary/types';
2
3
  import type { Translate } from '../types';
3
4
  export interface IconObject {
4
5
  icon?: string;
@@ -9,25 +10,50 @@ export interface IconObject {
9
10
  }
10
11
  export type IconSelectorIcon = IconObject | string;
11
12
  interface IconSelectorProps {
13
+ /** Own icons. If set, only these icons are offered instead of the icon library */
12
14
  icons?: IconSelectorIcon[];
15
+ /** Open the icon library with the rooms (default) */
13
16
  onlyRooms?: boolean;
17
+ /** Open the icon library with the lighting icons */
14
18
  onlyDevices?: boolean;
15
19
  onSelect?: (icon: string) => void;
16
20
  onChange?: (icon: string) => void;
17
21
  t: Translate;
18
22
  lang: ioBroker.Languages;
19
23
  }
24
+ /** An icon as it is shown in the dialog */
25
+ interface ShownIcon {
26
+ key: string;
27
+ name: string;
28
+ /** SVG path of an icon of the library */
29
+ path?: string;
30
+ /** URL or data URL of a classic or own icon */
31
+ src?: string;
32
+ }
20
33
  interface IconSelectorState {
21
34
  opened: boolean;
22
- names: string[];
23
35
  filter: string;
24
- icons: string[] | null;
25
36
  loading: boolean;
26
- isAnyName: boolean;
37
+ category: string;
38
+ categories: IconLibraryCategory[] | null;
39
+ libraryIcons: IconLibraryItem[] | null;
40
+ /** Classic room and device icons by category */
41
+ classicIcons: Record<string, ShownIcon[]> | null;
42
+ /** Icons given in `props.icons` */
43
+ ownIcons: ShownIcon[] | null;
27
44
  }
28
45
  export declare class IconSelector extends Component<IconSelectorProps, IconSelectorState> {
29
46
  constructor(props: IconSelectorProps);
30
- loadAllIcons(): void;
47
+ private getText;
48
+ private getClassicIcons;
49
+ private readOwnIcons;
50
+ private open;
51
+ private select;
52
+ private getShownIcons;
53
+ private getCount;
54
+ private renderIcon;
55
+ private renderCategories;
56
+ private renderDialog;
31
57
  render(): React.JSX.Element;
32
58
  }
33
59
  export {};