@gisce/react-ooui 1.2.0-rc.19 → 1.2.0-rc.21

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 +1 @@
1
- {"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["Label.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAKtC,aAAK,KAAK,GAAG,WAAW,GAAG;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC;AAQF,QAAA,MAAM,KAAK,UAAW,KAAK,gBAmC1B,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["Label.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAMtC,aAAK,KAAK,GAAG,WAAW,GAAG;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC;AAQF,QAAA,MAAM,KAAK,UAAW,KAAK,gBA8B1B,CAAC;AAEF,eAAe,KAAK,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gisce/react-ooui",
3
- "version": "1.2.0-rc.19",
3
+ "version": "1.2.0-rc.21",
4
4
  "files": [
5
5
  "dist",
6
6
  "src",
@@ -45,6 +45,7 @@
45
45
  "buffer": "^6.0.3",
46
46
  "fiber-diagram": "github:gisce/fiber-diagram",
47
47
  "file-type": "^16.5.0",
48
+ "interweave": "^13.0.0",
48
49
  "react": "^17.0.1",
49
50
  "react-dom": "^17.0.1",
50
51
  "react-grid-layout": "^1.3.4",
@@ -12,7 +12,7 @@ export default {
12
12
  export const Default = (): React.ReactElement => {
13
13
  const ooui = new LabelOoui({
14
14
  name: "field",
15
- string: "Lorem ipsum",
15
+ string: "<b>Lorem ipsum</b>",
16
16
  });
17
17
  return (
18
18
  <LocaleProvider lang="en_US">
@@ -25,7 +25,7 @@ export const LabelSecondary = (): React.ReactElement => {
25
25
  const ooui = new LabelOoui({
26
26
  name: "field",
27
27
  string: "Lorem ipsum",
28
- widget_props: "{'label_type': 'secondary'}"
28
+ widget_props: "{'label_type': 'secondary'}",
29
29
  });
30
30
  return (
31
31
  <LocaleProvider lang="en_US">
@@ -38,7 +38,7 @@ export const LabelWaning = (): React.ReactElement => {
38
38
  const ooui = new LabelOoui({
39
39
  name: "field",
40
40
  string: "Lorem ipsum",
41
- widget_props: "{'label_type': 'warning'}"
41
+ widget_props: "{'label_type': 'warning'}",
42
42
  });
43
43
  return (
44
44
  <LocaleProvider lang="en_US">
@@ -51,7 +51,7 @@ export const LabelDanger = (): React.ReactElement => {
51
51
  const ooui = new LabelOoui({
52
52
  name: "field",
53
53
  string: "Lorem ipsum",
54
- widget_props: "{'label_type': 'danger'}"
54
+ widget_props: "{'label_type': 'danger'}",
55
55
  });
56
56
  return (
57
57
  <LocaleProvider lang="en_US">
@@ -64,7 +64,7 @@ export const LabelSuccess = (): React.ReactElement => {
64
64
  const ooui = new LabelOoui({
65
65
  name: "field",
66
66
  string: "Lorem ipsum",
67
- widget_props: "{'label_type': 'success'}"
67
+ widget_props: "{'label_type': 'success'}",
68
68
  });
69
69
  return (
70
70
  <LocaleProvider lang="en_US">
@@ -73,12 +73,11 @@ export const LabelSuccess = (): React.ReactElement => {
73
73
  );
74
74
  };
75
75
 
76
-
77
76
  export const LabelH1 = (): React.ReactElement => {
78
77
  const ooui = new LabelOoui({
79
78
  name: "field",
80
79
  string: "Lorem ipsum",
81
- widget_props: "{'label_size': 'h1'}"
80
+ widget_props: "{'label_size': 'h1'}",
82
81
  });
83
82
  return (
84
83
  <LocaleProvider lang="en_US">
@@ -91,7 +90,7 @@ export const LabelH2Warning = (): React.ReactElement => {
91
90
  const ooui = new LabelOoui({
92
91
  name: "field",
93
92
  string: "Lorem ipsum",
94
- widget_props: "{'label_size': 'h1', 'label_type': 'warning'}"
93
+ widget_props: "{'label_size': 'h1', 'label_type': 'warning'}",
95
94
  });
96
95
  return (
97
96
  <LocaleProvider lang="en_US">
@@ -3,6 +3,7 @@ import { Tooltip, Typography } from "antd";
3
3
  import { WidgetProps } from "@/types";
4
4
  import { QuestionCircleOutlined } from "@ant-design/icons";
5
5
  import { Label as LabelOoui } from "@gisce/ooui";
6
+ import { Interweave } from "interweave";
6
7
  const { Text, Title } = Typography;
7
8
 
8
9
  type Props = WidgetProps & {
@@ -18,13 +19,8 @@ const alignClass = {
18
19
 
19
20
  const Label = (props: Props) => {
20
21
  const { ooui, align, responsiveBehaviour } = props;
21
- const {
22
- label,
23
- tooltip,
24
- fieldForLabel,
25
- labelSize,
26
- labelType,
27
- } = ooui as LabelOoui;
22
+ const { label, tooltip, fieldForLabel, labelSize, labelType } =
23
+ ooui as LabelOoui;
28
24
  const addColon = fieldForLabel !== null ? true : false;
29
25
  const labelText = addColon && label.length > 1 ? label + " :" : label;
30
26
  const responsiveAlign = responsiveBehaviour ? "left" : "right";
@@ -43,10 +39,10 @@ const Label = (props: Props) => {
43
39
  )}
44
40
  <span className="pr-2">
45
41
  <TextType
46
- level={labelSize !== "text" ? ((labelSize as string) as any) : null}
42
+ level={labelSize !== "text" ? (labelSize as string as any) : null}
47
43
  type={labelType as any}
48
44
  >
49
- {labelText}
45
+ <Interweave content={labelText} />
50
46
  </TextType>
51
47
  </span>
52
48
  </div>
@@ -232,7 +232,7 @@ export const Many2oneInput: React.FC<Many2oneInputProps> = (
232
232
  }
233
233
 
234
234
  async function onKeyDown(event: any) {
235
- if (event.code === "Enter") {
235
+ if (event.keyCode === 13) {
236
236
  event.preventDefault();
237
237
  event.stopPropagation();
238
238
  await onElementLostFocus();