@equinor/mad-dfw 0.3.1 → 0.4.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.
- package/CHANGELOG.md +8 -0
- package/dist/{chunk-TPYVM6NR.js → chunk-7GAHGZHM.js} +40 -49
- package/dist/{chunk-JRXLEWCW.js → chunk-AIIMQRJ6.js} +11 -19
- package/dist/{chunk-MCPLMBQO.js → chunk-JFOLVFFO.js} +15 -10
- package/dist/{chunk-6X2PRIG5.js → chunk-JVF34AIF.js} +15 -19
- package/dist/{chunk-GZT3W2AO.js → chunk-T4WZHG2X.js} +2 -2
- package/dist/dfwcomponents/WorkOrderCell/PropertyList.d.ts +3 -5
- package/dist/dfwcomponents/WorkOrderCell/PropertyList.js +2 -1
- package/dist/dfwcomponents/WorkOrderCell/WorkOrderCell.d.ts +1 -1
- package/dist/dfwcomponents/WorkOrderCell/WorkOrderCell.js +3 -3
- package/dist/dfwcomponents/WorkOrderCell/WorkOrderCellNavigation.d.ts +1 -1
- package/dist/dfwcomponents/WorkOrderCell/WorkOrderCellNavigation.js +3 -3
- package/dist/dfwcomponents/WorkOrderCell/index.d.ts +2 -2
- package/dist/dfwcomponents/WorkOrderCell/index.js +5 -5
- package/dist/dfwcomponents/WorkOrderCell/types.d.ts +5 -2
- package/dist/dfwcomponents/WorkOrderCell/utils.d.ts +2 -2
- package/dist/dfwcomponents/WorkOrderCell/utils.js +3 -1
- package/dist/index.js +5 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @equinor/mad-dfw
|
|
2
2
|
|
|
3
|
+
## 0.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 7d09c9b: WorkOrderCell adjusted. Renamed prop `workOrder` to `workOrderId`. Added new prop,
|
|
8
|
+
`workOrderType`, this relates to the workOrderId. Removed the `symbolDirection` and
|
|
9
|
+
`overwriteLabel` props. The symbol direction is now column by default.
|
|
10
|
+
|
|
3
11
|
## 0.3.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PropertyList
|
|
3
|
+
} from "./chunk-AIIMQRJ6.js";
|
|
1
4
|
import {
|
|
2
5
|
getStatusIconsAndLabels
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JFOLVFFO.js";
|
|
4
7
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
8
|
+
PropertyRow
|
|
9
|
+
} from "./chunk-DQQOZB3E.js";
|
|
7
10
|
import {
|
|
8
11
|
StatusIcon
|
|
9
12
|
} from "./chunk-VDHOYF7Z.js";
|
|
@@ -17,37 +20,36 @@ import {
|
|
|
17
20
|
Button,
|
|
18
21
|
Cell,
|
|
19
22
|
EDSStyleSheet,
|
|
20
|
-
Label,
|
|
21
23
|
Typography,
|
|
22
24
|
useBreakpoint,
|
|
23
|
-
useStyles
|
|
25
|
+
useStyles,
|
|
26
|
+
useToken
|
|
24
27
|
} from "@equinor/mad-components";
|
|
25
|
-
import moment from "moment";
|
|
26
28
|
import React, { useMemo } from "react";
|
|
27
29
|
import { View } from "react-native";
|
|
28
30
|
var WorkOrderCell = (_a) => {
|
|
29
31
|
var _b = _a, {
|
|
30
32
|
title,
|
|
33
|
+
workOrderId,
|
|
34
|
+
workOrderType,
|
|
31
35
|
maintenanceType,
|
|
32
|
-
showSymbols,
|
|
33
|
-
symbolDirection = "column",
|
|
36
|
+
showSymbols = true,
|
|
34
37
|
valueColor = "textTertiary",
|
|
35
38
|
isHseCritical,
|
|
36
39
|
isProductionCritical,
|
|
37
|
-
overwriteLabel,
|
|
38
40
|
style,
|
|
39
41
|
startJobButton,
|
|
40
42
|
readyForOperationButton,
|
|
41
43
|
tecoButton
|
|
42
44
|
} = _b, rest = __objRest(_b, [
|
|
43
45
|
"title",
|
|
46
|
+
"workOrderId",
|
|
47
|
+
"workOrderType",
|
|
44
48
|
"maintenanceType",
|
|
45
49
|
"showSymbols",
|
|
46
|
-
"symbolDirection",
|
|
47
50
|
"valueColor",
|
|
48
51
|
"isHseCritical",
|
|
49
52
|
"isProductionCritical",
|
|
50
|
-
"overwriteLabel",
|
|
51
53
|
"style",
|
|
52
54
|
"startJobButton",
|
|
53
55
|
"readyForOperationButton",
|
|
@@ -55,9 +57,10 @@ var WorkOrderCell = (_a) => {
|
|
|
55
57
|
]);
|
|
56
58
|
var _a2, _b2;
|
|
57
59
|
const breakpoint = useBreakpoint();
|
|
58
|
-
const
|
|
60
|
+
const token = useToken();
|
|
61
|
+
const styles = useStyles(themeStyles);
|
|
59
62
|
const anyButtonVisible = (_b2 = (_a2 = startJobButton == null ? void 0 : startJobButton.visible) != null ? _a2 : readyForOperationButton == null ? void 0 : readyForOperationButton.visible) != null ? _b2 : tecoButton == null ? void 0 : tecoButton.visible;
|
|
60
|
-
const currentDate =
|
|
63
|
+
const currentDate = useMemo(() => /* @__PURE__ */ new Date(), []);
|
|
61
64
|
const iconsAndLabels = useMemo(
|
|
62
65
|
() => {
|
|
63
66
|
var _a3;
|
|
@@ -71,15 +74,16 @@ var WorkOrderCell = (_a) => {
|
|
|
71
74
|
},
|
|
72
75
|
[rest.activeStatus, rest.requiredEnd, currentDate, isHseCritical, isProductionCritical]
|
|
73
76
|
);
|
|
74
|
-
return /* @__PURE__ */ React.createElement(Cell, { style }, /* @__PURE__ */ React.createElement(
|
|
75
|
-
|
|
77
|
+
return /* @__PURE__ */ React.createElement(Cell, { style }, /* @__PURE__ */ React.createElement(
|
|
78
|
+
Typography,
|
|
76
79
|
{
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
|
|
80
|
+
numberOfLines: 1,
|
|
81
|
+
variant: "h5",
|
|
82
|
+
bold: true,
|
|
83
|
+
style: !showSymbols && { paddingBottom: token.spacing.container.paddingVertical }
|
|
84
|
+
},
|
|
85
|
+
title
|
|
86
|
+
), showSymbols && iconsAndLabels.length > 0 && /* @__PURE__ */ React.createElement(View, { style: styles.iconListContainer }, iconsAndLabels.map((item, index) => /* @__PURE__ */ React.createElement(StatusIcon, __spreadValues({ key: index }, item)))), /* @__PURE__ */ React.createElement(View, { style: styles.dataContainer }, /* @__PURE__ */ React.createElement(Typography, { group: "paragraph", variant: "body_short", color: "textTertiary" }, maintenanceType), /* @__PURE__ */ React.createElement(PropertyRow, { label: workOrderType, value: workOrderId }), /* @__PURE__ */ React.createElement(PropertyList, { data: rest, valueColor })), anyButtonVisible && /* @__PURE__ */ React.createElement(
|
|
83
87
|
View,
|
|
84
88
|
{
|
|
85
89
|
style: [
|
|
@@ -119,34 +123,21 @@ var WorkOrderCell = (_a) => {
|
|
|
119
123
|
)
|
|
120
124
|
));
|
|
121
125
|
};
|
|
122
|
-
var themeStyles = EDSStyleSheet.create(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
marginBottom: theme.spacing.container.paddingVertical
|
|
138
|
-
},
|
|
139
|
-
label: {
|
|
140
|
-
marginBottom: theme.spacing.cell.group.titleBottomPadding
|
|
141
|
-
},
|
|
142
|
-
iconListContainer: {
|
|
143
|
-
flexWrap: "wrap",
|
|
144
|
-
flexDirection: symbolDirection,
|
|
145
|
-
paddingBottom: theme.spacing.cell.group.titleBottomPadding,
|
|
146
|
-
gap: symbolDirection === "row" ? theme.spacing.spacer.small : theme.spacing.cell.content.titleDescriptionGap
|
|
147
|
-
}
|
|
148
|
-
})
|
|
149
|
-
);
|
|
126
|
+
var themeStyles = EDSStyleSheet.create((theme) => ({
|
|
127
|
+
actionContainer: {
|
|
128
|
+
gap: theme.spacing.spacer.small,
|
|
129
|
+
marginTop: theme.spacing.container.paddingVertical,
|
|
130
|
+
flexDirection: "row",
|
|
131
|
+
justifyContent: "center"
|
|
132
|
+
},
|
|
133
|
+
dataContainer: {
|
|
134
|
+
gap: theme.spacing.cell.group.titleBottomPadding
|
|
135
|
+
},
|
|
136
|
+
iconListContainer: {
|
|
137
|
+
paddingVertical: theme.spacing.container.paddingVertical,
|
|
138
|
+
gap: theme.spacing.cell.content.titleDescriptionGap
|
|
139
|
+
}
|
|
140
|
+
}));
|
|
150
141
|
|
|
151
142
|
export {
|
|
152
143
|
WorkOrderCell
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
formatDate
|
|
3
|
+
} from "./chunk-JFOLVFFO.js";
|
|
1
4
|
import {
|
|
2
5
|
PropertyRow
|
|
3
6
|
} from "./chunk-DQQOZB3E.js";
|
|
4
7
|
|
|
5
8
|
// src/dfwcomponents/WorkOrderCell/PropertyList.tsx
|
|
6
9
|
import React from "react";
|
|
7
|
-
|
|
8
|
-
import { useToken } from "@equinor/mad-components";
|
|
9
|
-
var defaultWorkOrderLabelMap = {
|
|
10
|
+
var workOrderLabelMap = {
|
|
10
11
|
title: "Title",
|
|
11
|
-
workOrder: "Work order",
|
|
12
12
|
maintenanceType: "Maintenance type",
|
|
13
13
|
functionalLocation: "Functional Location",
|
|
14
14
|
equipment: "Equipment",
|
|
@@ -18,22 +18,15 @@ var defaultWorkOrderLabelMap = {
|
|
|
18
18
|
requiredEnd: "Required end",
|
|
19
19
|
workCenter: "Work center"
|
|
20
20
|
};
|
|
21
|
-
var PropertyList = ({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
overwriteLabel = {}
|
|
26
|
-
}) => {
|
|
27
|
-
const token = useToken();
|
|
28
|
-
const formatDate = (dateString) => moment(dateString).format("DD.MM.YYYY");
|
|
29
|
-
const requiredEnd = workOrder.requiredEnd ? new Date(workOrder.requiredEnd) : null;
|
|
30
|
-
const combinedDates = workOrder.basicStartDate && workOrder.basicFinishDate ? `${formatDate(workOrder.basicStartDate)} - ${formatDate(workOrder.basicFinishDate)}` : null;
|
|
21
|
+
var PropertyList = ({ data, valueColor }) => {
|
|
22
|
+
const currentDate = /* @__PURE__ */ new Date();
|
|
23
|
+
const requiredEnd = data.requiredEnd ? new Date(data.requiredEnd) : null;
|
|
24
|
+
const combinedDates = data.basicStartDate && data.basicFinishDate ? `${formatDate(data.basicStartDate)} - ${formatDate(data.basicFinishDate)}` : null;
|
|
31
25
|
const getLabel = (key) => {
|
|
32
|
-
var _a;
|
|
33
26
|
if (key === "basicStartDate" && combinedDates) {
|
|
34
27
|
return "Basic start / finish";
|
|
35
28
|
}
|
|
36
|
-
return
|
|
29
|
+
return workOrderLabelMap[key];
|
|
37
30
|
};
|
|
38
31
|
const getDisplayValue = (key, value) => {
|
|
39
32
|
if (key === "basicStartDate" && combinedDates) {
|
|
@@ -44,7 +37,7 @@ var PropertyList = ({
|
|
|
44
37
|
}
|
|
45
38
|
return value;
|
|
46
39
|
};
|
|
47
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, Object.entries(
|
|
40
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, Object.entries(data).map(([key, value], index) => {
|
|
48
41
|
const typedKey = key;
|
|
49
42
|
if (combinedDates && typedKey === "basicFinishDate")
|
|
50
43
|
return null;
|
|
@@ -52,13 +45,12 @@ var PropertyList = ({
|
|
|
52
45
|
const label = getLabel(typedKey);
|
|
53
46
|
const displayValue = getDisplayValue(typedKey, value);
|
|
54
47
|
const textColor = typedKey === "requiredEnd" && requiredEnd && currentDate > requiredEnd ? "danger" : valueColor;
|
|
55
|
-
return /* @__PURE__ */ React.createElement(
|
|
48
|
+
return label && /* @__PURE__ */ React.createElement(
|
|
56
49
|
PropertyRow,
|
|
57
50
|
{
|
|
58
51
|
key: index,
|
|
59
52
|
label,
|
|
60
53
|
value: displayValue != null ? displayValue : "",
|
|
61
|
-
style: { marginBottom: token.spacing.cell.group.titleBottomPadding },
|
|
62
54
|
textColor
|
|
63
55
|
}
|
|
64
56
|
);
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
// src/dfwcomponents/WorkOrderCell/utils.ts
|
|
2
|
-
import moment from "moment";
|
|
3
2
|
var getStatusIconConfig = (status) => {
|
|
4
3
|
switch (status) {
|
|
5
|
-
case "RDEX":
|
|
6
|
-
return {
|
|
7
|
-
icon: "circle-outline",
|
|
8
|
-
label: "Ready for execution",
|
|
9
|
-
textColor: "textTertiary",
|
|
10
|
-
iconColor: "textPrimary"
|
|
11
|
-
};
|
|
12
4
|
case "STRT":
|
|
13
5
|
return {
|
|
14
6
|
icon: "circle-half-full",
|
|
@@ -27,7 +19,7 @@ var getStatusIconConfig = (status) => {
|
|
|
27
19
|
return void 0;
|
|
28
20
|
};
|
|
29
21
|
var getStatusIconsAndLabels = (activeStatusIds, requiredEndDate, currentDate, hseCritical, productionCritical) => {
|
|
30
|
-
const requiredEnd = requiredEndDate ?
|
|
22
|
+
const requiredEnd = requiredEndDate ? new Date(requiredEndDate) : null;
|
|
31
23
|
const activeStatuses = activeStatusIds == null ? void 0 : activeStatusIds.split(" ");
|
|
32
24
|
const iconsAndLabels = [];
|
|
33
25
|
if (requiredEnd && currentDate > requiredEnd) {
|
|
@@ -54,6 +46,14 @@ var getStatusIconsAndLabels = (activeStatusIds, requiredEndDate, currentDate, hs
|
|
|
54
46
|
iconColor: "danger"
|
|
55
47
|
});
|
|
56
48
|
}
|
|
49
|
+
if (!(activeStatuses == null ? void 0 : activeStatuses.includes("STRT"))) {
|
|
50
|
+
iconsAndLabels.push({
|
|
51
|
+
icon: "circle-outline",
|
|
52
|
+
label: "Not started",
|
|
53
|
+
textColor: "textTertiary",
|
|
54
|
+
iconColor: "textPrimary"
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
57
|
activeStatuses == null ? void 0 : activeStatuses.forEach((status) => {
|
|
58
58
|
const statusConfig = getStatusIconConfig(status);
|
|
59
59
|
if (statusConfig) {
|
|
@@ -62,8 +62,13 @@ var getStatusIconsAndLabels = (activeStatusIds, requiredEndDate, currentDate, hs
|
|
|
62
62
|
});
|
|
63
63
|
return iconsAndLabels;
|
|
64
64
|
};
|
|
65
|
+
var formatDate = (dateString) => {
|
|
66
|
+
const date = new Date(dateString);
|
|
67
|
+
return date.toLocaleDateString("en-GB").replace(/\//g, ".");
|
|
68
|
+
};
|
|
65
69
|
|
|
66
70
|
export {
|
|
67
71
|
getStatusIconConfig,
|
|
68
|
-
getStatusIconsAndLabels
|
|
72
|
+
getStatusIconsAndLabels,
|
|
73
|
+
formatDate
|
|
69
74
|
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PropertyList
|
|
3
|
+
} from "./chunk-AIIMQRJ6.js";
|
|
1
4
|
import {
|
|
2
5
|
getStatusIconsAndLabels
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JFOLVFFO.js";
|
|
4
7
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
8
|
+
PropertyRow
|
|
9
|
+
} from "./chunk-DQQOZB3E.js";
|
|
7
10
|
import {
|
|
8
11
|
StatusIcon
|
|
9
12
|
} from "./chunk-VDHOYF7Z.js";
|
|
@@ -14,34 +17,35 @@ import {
|
|
|
14
17
|
} from "./chunk-G2ADBYYC.js";
|
|
15
18
|
|
|
16
19
|
// src/dfwcomponents/WorkOrderCell/WorkOrderCellNavigation.tsx
|
|
17
|
-
import { Cell, EDSStyleSheet, Icon,
|
|
18
|
-
import moment from "moment";
|
|
20
|
+
import { Cell, EDSStyleSheet, Icon, Typography, useStyles } from "@equinor/mad-components";
|
|
19
21
|
import React, { useMemo } from "react";
|
|
20
22
|
import { View } from "react-native";
|
|
21
23
|
var WorkOrderCellNavigation = (_a) => {
|
|
22
24
|
var _b = _a, {
|
|
23
25
|
title,
|
|
26
|
+
workOrderId,
|
|
27
|
+
workOrderType,
|
|
24
28
|
maintenanceType,
|
|
25
29
|
valueColor = "textTertiary",
|
|
26
30
|
isHseCritical,
|
|
27
31
|
isProductionCritical,
|
|
28
32
|
showSymbols = true,
|
|
29
|
-
overwriteLabel,
|
|
30
33
|
onPress,
|
|
31
34
|
style
|
|
32
35
|
} = _b, rest = __objRest(_b, [
|
|
33
36
|
"title",
|
|
37
|
+
"workOrderId",
|
|
38
|
+
"workOrderType",
|
|
34
39
|
"maintenanceType",
|
|
35
40
|
"valueColor",
|
|
36
41
|
"isHseCritical",
|
|
37
42
|
"isProductionCritical",
|
|
38
43
|
"showSymbols",
|
|
39
|
-
"overwriteLabel",
|
|
40
44
|
"onPress",
|
|
41
45
|
"style"
|
|
42
46
|
]);
|
|
43
47
|
const styles = useStyles(themeStyles);
|
|
44
|
-
const currentDate =
|
|
48
|
+
const currentDate = useMemo(() => /* @__PURE__ */ new Date(), []);
|
|
45
49
|
const iconsAndLabels = useMemo(
|
|
46
50
|
() => {
|
|
47
51
|
var _a2;
|
|
@@ -55,15 +59,7 @@ var WorkOrderCellNavigation = (_a) => {
|
|
|
55
59
|
},
|
|
56
60
|
[rest.activeStatus, rest.requiredEnd, currentDate, isHseCritical, isProductionCritical]
|
|
57
61
|
);
|
|
58
|
-
return /* @__PURE__ */ React.createElement(Cell, { onPress, style }, /* @__PURE__ */ React.createElement(View, { style: styles.container }, /* @__PURE__ */ React.createElement(View, { style: styles.contentContainer }, /* @__PURE__ */ React.createElement(Typography, { numberOfLines: 1, variant: "h5", bold: true, style: styles.title }, title),
|
|
59
|
-
PropertyList,
|
|
60
|
-
{
|
|
61
|
-
workOrder: rest,
|
|
62
|
-
overwriteLabel,
|
|
63
|
-
valueColor,
|
|
64
|
-
currentDate: currentDate.toDate()
|
|
65
|
-
}
|
|
66
|
-
)), showSymbols && /* @__PURE__ */ React.createElement(View, { style: styles.iconListContainer }, iconsAndLabels.map((item, index) => /* @__PURE__ */ React.createElement(StatusIcon, __spreadProps(__spreadValues({ key: index }, item), { label: void 0 })))), /* @__PURE__ */ React.createElement(Icon, { name: "chevron-right" })));
|
|
62
|
+
return /* @__PURE__ */ React.createElement(Cell, { onPress, style }, /* @__PURE__ */ React.createElement(View, { style: styles.container }, /* @__PURE__ */ React.createElement(View, { style: styles.contentContainer }, /* @__PURE__ */ React.createElement(Typography, { numberOfLines: 1, variant: "h5", bold: true, style: styles.title }, title), /* @__PURE__ */ React.createElement(View, { style: styles.dataContainer }, /* @__PURE__ */ React.createElement(Typography, { group: "paragraph", variant: "body_short", color: "textTertiary" }, maintenanceType), /* @__PURE__ */ React.createElement(PropertyRow, { label: workOrderType, value: workOrderId }), /* @__PURE__ */ React.createElement(PropertyList, { data: rest, valueColor }))), showSymbols && /* @__PURE__ */ React.createElement(View, { style: styles.iconListContainer }, iconsAndLabels.map((item, index) => /* @__PURE__ */ React.createElement(StatusIcon, __spreadProps(__spreadValues({ key: index }, item), { label: void 0 })))), /* @__PURE__ */ React.createElement(Icon, { name: "chevron-right" })));
|
|
67
63
|
};
|
|
68
64
|
var themeStyles = EDSStyleSheet.create((theme) => ({
|
|
69
65
|
container: {
|
|
@@ -78,8 +74,8 @@ var themeStyles = EDSStyleSheet.create((theme) => ({
|
|
|
78
74
|
title: {
|
|
79
75
|
marginBottom: theme.spacing.container.paddingVertical
|
|
80
76
|
},
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
dataContainer: {
|
|
78
|
+
gap: theme.spacing.cell.group.titleBottomPadding
|
|
83
79
|
},
|
|
84
80
|
iconListContainer: {
|
|
85
81
|
position: "absolute",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkOrderCell
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7GAHGZHM.js";
|
|
4
4
|
import {
|
|
5
5
|
WorkOrderCellNavigation
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JVF34AIF.js";
|
|
7
7
|
|
|
8
8
|
// src/dfwcomponents/WorkOrderCell/index.ts
|
|
9
9
|
var WorkOrderCell2 = WorkOrderCell;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
+
import { Color } from "@equinor/mad-components";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { WorkOrder } from "./types";
|
|
3
|
-
import { Color } from "@equinor/mad-components";
|
|
4
4
|
type PropertyListProps = {
|
|
5
|
-
|
|
5
|
+
data: Partial<WorkOrder>;
|
|
6
6
|
valueColor: Color;
|
|
7
|
-
currentDate: Date;
|
|
8
|
-
overwriteLabel?: Partial<Record<keyof WorkOrder, string>>;
|
|
9
7
|
};
|
|
10
|
-
export declare const PropertyList: ({
|
|
8
|
+
export declare const PropertyList: ({ data, valueColor }: PropertyListProps) => React.JSX.Element;
|
|
11
9
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { WorkOrderCellProps } from "./types";
|
|
3
|
-
export declare const WorkOrderCell: ({ title, maintenanceType, showSymbols,
|
|
3
|
+
export declare const WorkOrderCell: ({ title, workOrderId, workOrderType, maintenanceType, showSymbols, valueColor, isHseCritical, isProductionCritical, style, startJobButton, readyForOperationButton, tecoButton, ...rest }: WorkOrderCellProps) => React.JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkOrderCell
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-7GAHGZHM.js";
|
|
4
|
+
import "../../chunk-AIIMQRJ6.js";
|
|
5
|
+
import "../../chunk-JFOLVFFO.js";
|
|
6
6
|
import "../../chunk-2JQRYR7Z.js";
|
|
7
7
|
import "../../chunk-DQQOZB3E.js";
|
|
8
8
|
import "../../chunk-VDHOYF7Z.js";
|
|
@@ -3,5 +3,5 @@ import { WorkOrderCellProps } from "./types";
|
|
|
3
3
|
type WorkOrderCellNavigationProps = WorkOrderCellProps & {
|
|
4
4
|
onPress: () => void;
|
|
5
5
|
};
|
|
6
|
-
export declare const WorkOrderCellNavigation: ({ title, maintenanceType, valueColor, isHseCritical, isProductionCritical, showSymbols,
|
|
6
|
+
export declare const WorkOrderCellNavigation: ({ title, workOrderId, workOrderType, maintenanceType, valueColor, isHseCritical, isProductionCritical, showSymbols, onPress, style, ...rest }: WorkOrderCellNavigationProps) => React.JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkOrderCellNavigation
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-JVF34AIF.js";
|
|
4
|
+
import "../../chunk-AIIMQRJ6.js";
|
|
5
|
+
import "../../chunk-JFOLVFFO.js";
|
|
6
6
|
import "../../chunk-2JQRYR7Z.js";
|
|
7
7
|
import "../../chunk-DQQOZB3E.js";
|
|
8
8
|
import "../../chunk-VDHOYF7Z.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { WorkOrderCell as _WorkOrderCell } from "./WorkOrderCell";
|
|
2
2
|
import { WorkOrderCellNavigation } from "./WorkOrderCellNavigation";
|
|
3
|
-
import { WorkOrder, WorkOrderCellProps, StatusConfig } from "./types";
|
|
3
|
+
import { WorkOrder, WorkOrderType, WorkOrderCellProps, StatusConfig } from "./types";
|
|
4
4
|
type WorkOrderCellFamily = typeof _WorkOrderCell & {
|
|
5
5
|
Navigation: typeof WorkOrderCellNavigation;
|
|
6
6
|
};
|
|
7
7
|
declare const WorkOrderCell: WorkOrderCellFamily;
|
|
8
8
|
export { WorkOrderCell };
|
|
9
|
-
export type { WorkOrder, WorkOrderCellProps, StatusConfig };
|
|
9
|
+
export type { WorkOrder, WorkOrderType, WorkOrderCellProps, StatusConfig };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkOrderCell
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-T4WZHG2X.js";
|
|
4
|
+
import "../../chunk-7GAHGZHM.js";
|
|
5
|
+
import "../../chunk-JVF34AIF.js";
|
|
6
|
+
import "../../chunk-AIIMQRJ6.js";
|
|
7
|
+
import "../../chunk-JFOLVFFO.js";
|
|
8
8
|
import "../../chunk-2JQRYR7Z.js";
|
|
9
9
|
import "../../chunk-DQQOZB3E.js";
|
|
10
10
|
import "../../chunk-VDHOYF7Z.js";
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Color, IconName } from "@equinor/mad-components";
|
|
2
2
|
import { ViewProps } from "react-native";
|
|
3
|
+
export type WorkOrderType = "PM01" | "PM02" | "PM03" | "PM04" | "PM05" | "PM06" | "PM10" | "PM15" | "PM20";
|
|
3
4
|
export type WorkOrder = {
|
|
5
|
+
workOrderId: string;
|
|
6
|
+
workOrderType: WorkOrderType;
|
|
4
7
|
title: string;
|
|
5
|
-
workOrder: string;
|
|
6
8
|
maintenanceType?: string;
|
|
7
9
|
equipment?: string;
|
|
8
10
|
activeStatus?: string;
|
|
@@ -19,8 +21,9 @@ type ButtonOptions = {
|
|
|
19
21
|
onPress: () => void;
|
|
20
22
|
};
|
|
21
23
|
export type WorkOrderCellProps = {
|
|
24
|
+
workOrderId: string;
|
|
25
|
+
workOrderType: WorkOrderType;
|
|
22
26
|
showSymbols?: boolean;
|
|
23
|
-
symbolDirection?: "column" | "row";
|
|
24
27
|
valueColor?: Color;
|
|
25
28
|
isHseCritical?: boolean;
|
|
26
29
|
isProductionCritical?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import moment from "moment";
|
|
2
1
|
import { StatusConfig } from "./types";
|
|
3
2
|
export declare const getStatusIconConfig: (status: string) => StatusConfig | undefined;
|
|
4
|
-
export declare const getStatusIconsAndLabels: (activeStatusIds: string | undefined, requiredEndDate: string | null, currentDate:
|
|
3
|
+
export declare const getStatusIconsAndLabels: (activeStatusIds: string | undefined, requiredEndDate: string | null, currentDate: Date, hseCritical?: boolean, productionCritical?: boolean) => StatusConfig[];
|
|
4
|
+
export declare const formatDate: (dateString: string) => string;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
+
formatDate,
|
|
2
3
|
getStatusIconConfig,
|
|
3
4
|
getStatusIconsAndLabels
|
|
4
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-JFOLVFFO.js";
|
|
5
6
|
import "../../chunk-G2ADBYYC.js";
|
|
6
7
|
export {
|
|
8
|
+
formatDate,
|
|
7
9
|
getStatusIconConfig,
|
|
8
10
|
getStatusIconsAndLabels
|
|
9
11
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkOrderCell
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-T4WZHG2X.js";
|
|
4
|
+
import "./chunk-7GAHGZHM.js";
|
|
5
|
+
import "./chunk-JVF34AIF.js";
|
|
6
|
+
import "./chunk-AIIMQRJ6.js";
|
|
7
|
+
import "./chunk-JFOLVFFO.js";
|
|
8
8
|
import "./chunk-2JQRYR7Z.js";
|
|
9
9
|
import {
|
|
10
10
|
PropertyRow
|