@gisce/react-ooui 1.1.51 → 1.1.53-rc.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.
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  declare type Props = {
3
- label: string;
3
+ label: any;
4
4
  children: any;
5
5
  };
6
6
  declare const Fieldset: (props: Props) => React.ReactElement;
@@ -1 +1 @@
1
- {"version":3,"file":"Fieldset.d.ts","sourceRoot":"","sources":["Fieldset.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,aAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,GAAG,CAAC;CACf,CAAC;AAEF,QAAA,MAAM,QAAQ,UAAW,KAAK,KAAG,MAAM,YAqBtC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Fieldset.d.ts","sourceRoot":"","sources":["Fieldset.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,aAAK,KAAK,GAAG;IACX,KAAK,EAAE,GAAG,CAAC;IACX,QAAQ,EAAE,GAAG,CAAC;CACf,CAAC;AAEF,QAAA,MAAM,QAAQ,UAAW,KAAK,KAAG,MAAM,YAqBtC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["Group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AAIjD,aAAK,KAAK,GAAG;IACX,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,iBAAS,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC,YAAY,CAoB/C;AAED,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["Group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AAMjD,aAAK,KAAK,GAAG;IACX,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,iBAAS,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC,YAAY,CA2B/C;AAED,eAAe,KAAK,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gisce/react-ooui",
3
- "version": "1.1.51",
3
+ "version": "1.1.53-rc.0",
4
4
  "files": [
5
5
  "dist",
6
6
  "src",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@ant-design/plots": "^1.0.9",
39
- "@gisce/ooui": "^0.19.0",
39
+ "@gisce/ooui": "^0.19.1",
40
40
  "@gisce/react-formiga-table": "^0.5.0",
41
41
  "@monaco-editor/react": "^4.4.5",
42
42
  "@tabler/icons-react": "^2.11.0",
@@ -61,3 +61,15 @@ export const Default = (): React.ReactElement => {
61
61
  </LocaleProvider>
62
62
  );
63
63
  };
64
+
65
+ export const WithIcon = (): React.ReactElement => {
66
+ const ooui = new GroupOoui({
67
+ string: "General",
68
+ icon: "home"
69
+ });
70
+ return (
71
+ <LocaleProvider lang="en_US">
72
+ <Group ooui={ooui} />
73
+ </LocaleProvider>
74
+ );
75
+ };
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
 
3
3
  type Props = {
4
- label: string;
4
+ label: any;
5
5
  children: any;
6
6
  };
7
7
 
@@ -2,6 +2,8 @@ import React from "react";
2
2
  import { Group as GroupOoui } from "@gisce/ooui";
3
3
  import Container from "./Container";
4
4
  import Fieldset from "@/ui/Fieldset";
5
+ import { Space } from "antd";
6
+ import iconMapper from "@/helpers/iconMapper";
5
7
 
6
8
  type Props = {
7
9
  ooui: GroupOoui;
@@ -11,11 +13,18 @@ type Props = {
11
13
 
12
14
  function Group(props: Props): React.ReactElement {
13
15
  const { ooui, showLabel = true, responsiveBehaviour } = props;
16
+ const Icon : React.ElementType | undefined = iconMapper(ooui.icon || "");
17
+ const label = (
18
+ <Space>
19
+ {Icon ? <Icon /> : null}
20
+ {ooui.label}
21
+ </Space>
22
+ )
14
23
 
15
24
  return (
16
25
  <>
17
26
  {ooui.label && showLabel ? (
18
- <Fieldset label={ooui.label}>
27
+ <Fieldset label={label}>
19
28
  <Container
20
29
  container={ooui!.container}
21
30
  responsiveBehaviour={responsiveBehaviour}