@gisce/react-ooui 1.1.54-rc.1 → 1.1.55
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/dist/common/DatePicker.d.ts +12 -0
- package/dist/common/DatePicker.d.ts.map +1 -1
- package/dist/react-ooui.es.js +7363 -7346
- package/dist/react-ooui.es.js.map +1 -1
- package/dist/react-ooui.umd.js +16 -16
- package/dist/react-ooui.umd.js.map +1 -1
- package/dist/views/actionViews/GraphActionView.d.ts.map +1 -1
- package/dist/widgets/views/Tree.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/common/DatePicker.tsx +4 -3
- package/src/views/actionViews/GraphActionView.tsx +1 -0
- package/src/widgets/views/Tree.tsx +23 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphActionView.d.ts","sourceRoot":"","sources":["GraphActionView.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAO7C,oBAAY,oBAAoB,GAAG;IACjC,QAAQ,EAAE,GAAG,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,GAAG,CAAC;IACb,MAAM,EAAE,GAAG,CAAC;IACZ,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,eAAe,UAAW,oBAAoB,
|
|
1
|
+
{"version":3,"file":"GraphActionView.d.ts","sourceRoot":"","sources":["GraphActionView.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAO7C,oBAAY,oBAAoB,GAAG;IACjC,QAAQ,EAAE,GAAG,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,GAAG,CAAC;IACb,MAAM,EAAE,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AE,GAAG,KAAK,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACzD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,GAAG,CAAC;CACf,CAAC;AA8GF,iBAAS,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC,YAAY,CA2M9C;AAED,eAAe,IAAI,CAAC"}
|
package/package.json
CHANGED
|
@@ -11,18 +11,19 @@ type DatePickerProps = WidgetProps & {
|
|
|
11
11
|
showTime?: boolean;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
const DatePickerConfig = {
|
|
14
|
+
export const DatePickerConfig = {
|
|
15
15
|
date: {
|
|
16
16
|
placeholder: "__/__/____",
|
|
17
|
-
dateDisplayFormat: "YYYY
|
|
17
|
+
dateDisplayFormat: "DD/MM/YYYY",
|
|
18
18
|
dateInternalFormat: "YYYY-MM-DD",
|
|
19
19
|
},
|
|
20
20
|
time: {
|
|
21
21
|
placeholder: "__/__/____ __:__:__",
|
|
22
|
-
dateDisplayFormat: "YYYY
|
|
22
|
+
dateDisplayFormat: "DD/MM/YYYY HH:mm:ss",
|
|
23
23
|
dateInternalFormat: "YYYY-MM-DD HH:mm:ss",
|
|
24
24
|
},
|
|
25
25
|
};
|
|
26
|
+
|
|
26
27
|
const DatePicker = (props: DatePickerProps) => {
|
|
27
28
|
const { ooui, showTime = false } = props;
|
|
28
29
|
const { required } = ooui;
|
|
@@ -22,6 +22,8 @@ import {
|
|
|
22
22
|
} from "@/context/ActionViewContext";
|
|
23
23
|
import { Many2oneTree } from "../base/many2one/Many2oneTree";
|
|
24
24
|
import { ReferenceTree } from "../base/ReferenceTree";
|
|
25
|
+
import moment from "moment";
|
|
26
|
+
import { DatePickerConfig } from "@/common/DatePicker";
|
|
25
27
|
|
|
26
28
|
type Props = {
|
|
27
29
|
total?: number;
|
|
@@ -66,6 +68,25 @@ const textComponentFn = (value: any): React.ReactElement => {
|
|
|
66
68
|
return <Interweave content={value?.replace(/(?:\r\n|\r|\n)/g, "<br>")} />;
|
|
67
69
|
};
|
|
68
70
|
|
|
71
|
+
const dateComponentFn = (value: any): React.ReactElement => {
|
|
72
|
+
if (!value || (value && value.length === 0)) return <></>;
|
|
73
|
+
|
|
74
|
+
const formattedValue = moment(
|
|
75
|
+
value,
|
|
76
|
+
DatePickerConfig.date.dateInternalFormat
|
|
77
|
+
).format(DatePickerConfig.date.dateDisplayFormat);
|
|
78
|
+
return <>{formattedValue}</>;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const dateTimeComponentFn = (value: any): React.ReactElement => {
|
|
82
|
+
if (!value || (value && value.length === 0)) return <></>;
|
|
83
|
+
const formattedValue = moment(
|
|
84
|
+
value,
|
|
85
|
+
DatePickerConfig.time.dateInternalFormat
|
|
86
|
+
).format(DatePickerConfig.time.dateDisplayFormat);
|
|
87
|
+
return <>{formattedValue}</>;
|
|
88
|
+
};
|
|
89
|
+
|
|
69
90
|
const one2ManyComponentFn = (value: One2manyValue): React.ReactElement => {
|
|
70
91
|
const length = Array.isArray(value?.items) ? value?.items.length : 0;
|
|
71
92
|
return <>{`( ${length} )`}</>;
|
|
@@ -190,6 +211,8 @@ function Tree(props: Props): React.ReactElement {
|
|
|
190
211
|
reference: referenceComponent,
|
|
191
212
|
tag: TagComponent,
|
|
192
213
|
selection: SelectionComponent,
|
|
214
|
+
date: dateComponentFn,
|
|
215
|
+
datetime: dateTimeComponentFn,
|
|
193
216
|
},
|
|
194
217
|
context
|
|
195
218
|
);
|