@truedat/core 4.49.10 → 4.50.2
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.50.2",
|
|
4
4
|
"description": "Truedat Web Core",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"react-dom": ">= 16.8.6 < 17",
|
|
113
113
|
"semantic-ui-react": ">= 0.88.2 < 2.1"
|
|
114
114
|
},
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "5785ca8828b3c25947e8d2587c909f729fbee317"
|
|
116
116
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import Moment from "react-moment";
|
|
4
|
+
|
|
5
|
+
export const Date = ({ value, className }) =>
|
|
6
|
+
value ? (
|
|
7
|
+
<Moment className={className} date={value} format="YYYY-MM-DD" />
|
|
8
|
+
) : null;
|
|
9
|
+
|
|
10
|
+
Date.propTypes = {
|
|
11
|
+
value: PropTypes.string,
|
|
12
|
+
className: PropTypes.string,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default Date;
|
|
@@ -25,6 +25,8 @@ export const TemplateSelector = ({
|
|
|
25
25
|
required,
|
|
26
26
|
selectedValue,
|
|
27
27
|
templates,
|
|
28
|
+
placeholder,
|
|
29
|
+
hideLabel = false,
|
|
28
30
|
}) => {
|
|
29
31
|
const { formatMessage } = useIntl();
|
|
30
32
|
const options = makeOptions(formatMessage)(templates);
|
|
@@ -37,23 +39,29 @@ export const TemplateSelector = ({
|
|
|
37
39
|
|
|
38
40
|
return hidden ? null : (
|
|
39
41
|
<Form.Field required={required}>
|
|
40
|
-
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
{hideLabel ? null : (
|
|
43
|
+
<label>
|
|
44
|
+
<FormattedMessage id="template.selector.label" />
|
|
45
|
+
{!selectedValue && required ? (
|
|
46
|
+
<Label pointing="left">
|
|
47
|
+
<FormattedMessage id="template.form.validation.empty_required" />
|
|
48
|
+
</Label>
|
|
49
|
+
) : null}
|
|
50
|
+
</label>
|
|
51
|
+
)}
|
|
48
52
|
<Form.Dropdown
|
|
49
53
|
clearable={clearable}
|
|
50
54
|
loading={loading}
|
|
51
55
|
name={name}
|
|
52
56
|
onChange={handleChange}
|
|
53
57
|
options={options}
|
|
54
|
-
placeholder={
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
placeholder={
|
|
59
|
+
placeholder
|
|
60
|
+
? placeholder
|
|
61
|
+
: formatMessage({
|
|
62
|
+
id: loading ? "loading" : "template.selector.placeholder",
|
|
63
|
+
})
|
|
64
|
+
}
|
|
57
65
|
search
|
|
58
66
|
selection
|
|
59
67
|
value={_.toString(selectedValue)}
|
|
@@ -70,6 +78,8 @@ TemplateSelector.propTypes = {
|
|
|
70
78
|
required: PropTypes.bool,
|
|
71
79
|
selectedValue: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
72
80
|
templates: PropTypes.array,
|
|
81
|
+
placeholder: PropTypes.string,
|
|
82
|
+
hideLabel: PropTypes.bool,
|
|
73
83
|
};
|
|
74
84
|
|
|
75
85
|
const emptyTemplates = [];
|
package/src/components/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import Comments from "./Comments";
|
|
|
10
10
|
import CommentsLoader from "./CommentsLoader";
|
|
11
11
|
import ConfirmModal from "./ConfirmModal";
|
|
12
12
|
import DashboardMenu from "./DashboardMenu";
|
|
13
|
+
import Date from "./Date";
|
|
13
14
|
import DateFilter from "./DateFilter";
|
|
14
15
|
import DateRangeFilter from "./DateRangeFilter";
|
|
15
16
|
import DateTime from "./DateTime";
|
|
@@ -58,6 +59,7 @@ export {
|
|
|
58
59
|
CommentsLoader,
|
|
59
60
|
ConfirmModal,
|
|
60
61
|
DashboardMenu,
|
|
62
|
+
Date,
|
|
61
63
|
DateFilter,
|
|
62
64
|
DateRangeFilter,
|
|
63
65
|
DateTime,
|