@equinor/mad-dfw 0.4.0 → 0.5.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 +27 -0
- package/dist/{chunk-7GAHGZHM.js → chunk-75HKHWRT.js} +20 -42
- package/dist/chunk-FKFMMXFT.js +87 -0
- package/dist/{chunk-JFOLVFFO.js → chunk-GNURJIGB.js} +3 -2
- package/dist/chunk-VHEWDAGI.js +70 -0
- package/dist/{chunk-T4WZHG2X.js → chunk-VULSI4WO.js} +2 -2
- package/dist/dfwcomponents/WorkOrderCell/WorkOrderCell.d.ts +1 -1
- package/dist/dfwcomponents/WorkOrderCell/WorkOrderCell.js +4 -4
- package/dist/dfwcomponents/WorkOrderCell/WorkOrderCellNavigation.d.ts +1 -1
- package/dist/dfwcomponents/WorkOrderCell/WorkOrderCellNavigation.js +4 -4
- package/dist/dfwcomponents/WorkOrderCell/WorkOrderPropertyList.d.ts +7 -0
- package/dist/dfwcomponents/WorkOrderCell/{PropertyList.js → WorkOrderPropertyList.js} +4 -4
- package/dist/dfwcomponents/WorkOrderCell/index.js +6 -6
- package/dist/dfwcomponents/WorkOrderCell/types.d.ts +27 -15
- package/dist/dfwcomponents/WorkOrderCell/utils.d.ts +1 -1
- package/dist/dfwcomponents/WorkOrderCell/utils.js +1 -1
- package/dist/index.js +6 -6
- package/package.json +1 -1
- package/dist/chunk-AIIMQRJ6.js +0 -64
- package/dist/chunk-JVF34AIF.js +0 -92
- package/dist/dfwcomponents/WorkOrderCell/PropertyList.d.ts +0 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @equinor/mad-dfw
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- c3cd036: - Introduced `tagPlantId` field on `WorkOrder` type.
|
|
8
|
+
|
|
9
|
+
- Expanded the allowed props on the `WorkOrderCell` to accept all non-child view props in
|
|
10
|
+
addition to its fundamental props.
|
|
11
|
+
|
|
12
|
+
**Breaking changes:**
|
|
13
|
+
|
|
14
|
+
- Moved all work order related data into the `workOrder` prop of the cell
|
|
15
|
+
- Renamed `requiredEnd` to `requiredEndDate`
|
|
16
|
+
- Renamed `workCenter` to `workCenterId`
|
|
17
|
+
- Renamed `functionalLocation` to `tagId`
|
|
18
|
+
- Renamed `basicFinishDate` to `basicEndDate`
|
|
19
|
+
- Renamed `equipment` to `equipmentId`
|
|
20
|
+
- Renamed `activeStatus` to `activeStatusIds`
|
|
21
|
+
- Removed the `overwriteLabel` prop on `WorkOrderCellProps`
|
|
22
|
+
|
|
23
|
+
## 0.4.1
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- 93cd63d: Added new value to the `WorkOrderType`. Prevent excess padding when the
|
|
28
|
+
`maintenanceType` is not being used.
|
|
29
|
+
|
|
3
30
|
## 0.4.0
|
|
4
31
|
|
|
5
32
|
### Minor Changes
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PropertyList
|
|
3
|
-
} from "./chunk-AIIMQRJ6.js";
|
|
4
|
-
import {
|
|
5
|
-
getStatusIconsAndLabels
|
|
6
|
-
} from "./chunk-JFOLVFFO.js";
|
|
7
|
-
import {
|
|
8
|
-
PropertyRow
|
|
9
|
-
} from "./chunk-DQQOZB3E.js";
|
|
10
1
|
import {
|
|
11
2
|
StatusIcon
|
|
12
3
|
} from "./chunk-VDHOYF7Z.js";
|
|
4
|
+
import {
|
|
5
|
+
WorkOrderPropertyList
|
|
6
|
+
} from "./chunk-FKFMMXFT.js";
|
|
7
|
+
import {
|
|
8
|
+
getStatusIconsAndLabels
|
|
9
|
+
} from "./chunk-GNURJIGB.js";
|
|
13
10
|
import {
|
|
14
11
|
__objRest,
|
|
15
12
|
__spreadValues
|
|
@@ -29,52 +26,33 @@ import React, { useMemo } from "react";
|
|
|
29
26
|
import { View } from "react-native";
|
|
30
27
|
var WorkOrderCell = (_a) => {
|
|
31
28
|
var _b = _a, {
|
|
32
|
-
title,
|
|
33
|
-
workOrderId,
|
|
34
|
-
workOrderType,
|
|
35
|
-
maintenanceType,
|
|
36
29
|
showSymbols = true,
|
|
37
|
-
valueColor = "textTertiary",
|
|
38
|
-
isHseCritical,
|
|
39
|
-
isProductionCritical,
|
|
40
|
-
style,
|
|
41
30
|
startJobButton,
|
|
42
31
|
readyForOperationButton,
|
|
43
|
-
tecoButton
|
|
32
|
+
tecoButton,
|
|
33
|
+
workOrder
|
|
44
34
|
} = _b, rest = __objRest(_b, [
|
|
45
|
-
"title",
|
|
46
|
-
"workOrderId",
|
|
47
|
-
"workOrderType",
|
|
48
|
-
"maintenanceType",
|
|
49
35
|
"showSymbols",
|
|
50
|
-
"valueColor",
|
|
51
|
-
"isHseCritical",
|
|
52
|
-
"isProductionCritical",
|
|
53
|
-
"style",
|
|
54
36
|
"startJobButton",
|
|
55
37
|
"readyForOperationButton",
|
|
56
|
-
"tecoButton"
|
|
38
|
+
"tecoButton",
|
|
39
|
+
"workOrder"
|
|
57
40
|
]);
|
|
58
41
|
var _a2, _b2;
|
|
59
42
|
const breakpoint = useBreakpoint();
|
|
60
43
|
const token = useToken();
|
|
61
44
|
const styles = useStyles(themeStyles);
|
|
62
45
|
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;
|
|
63
|
-
const currentDate = useMemo(() => /* @__PURE__ */ new Date(), []);
|
|
64
46
|
const iconsAndLabels = useMemo(
|
|
65
|
-
() =>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
isProductionCritical
|
|
73
|
-
);
|
|
74
|
-
},
|
|
75
|
-
[rest.activeStatus, rest.requiredEnd, currentDate, isHseCritical, isProductionCritical]
|
|
47
|
+
() => getStatusIconsAndLabels(
|
|
48
|
+
workOrder.activeStatusIds,
|
|
49
|
+
workOrder.requiredEndDate,
|
|
50
|
+
workOrder.isHseCritical,
|
|
51
|
+
workOrder.isProductionCritical
|
|
52
|
+
),
|
|
53
|
+
[workOrder]
|
|
76
54
|
);
|
|
77
|
-
return /* @__PURE__ */ React.createElement(Cell, {
|
|
55
|
+
return /* @__PURE__ */ React.createElement(Cell, __spreadValues({}, rest), /* @__PURE__ */ React.createElement(
|
|
78
56
|
Typography,
|
|
79
57
|
{
|
|
80
58
|
numberOfLines: 1,
|
|
@@ -82,8 +60,8 @@ var WorkOrderCell = (_a) => {
|
|
|
82
60
|
bold: true,
|
|
83
61
|
style: !showSymbols && { paddingBottom: token.spacing.container.paddingVertical }
|
|
84
62
|
},
|
|
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(
|
|
63
|
+
workOrder.title
|
|
64
|
+
), 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 }, workOrder.maintenanceType && /* @__PURE__ */ React.createElement(Typography, { group: "paragraph", variant: "body_short", color: "textTertiary" }, workOrder.maintenanceType), /* @__PURE__ */ React.createElement(WorkOrderPropertyList, { workOrder })), anyButtonVisible && /* @__PURE__ */ React.createElement(
|
|
87
65
|
View,
|
|
88
66
|
{
|
|
89
67
|
style: [
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import {
|
|
2
|
+
formatDate
|
|
3
|
+
} from "./chunk-GNURJIGB.js";
|
|
4
|
+
import {
|
|
5
|
+
PropertyRow
|
|
6
|
+
} from "./chunk-DQQOZB3E.js";
|
|
7
|
+
|
|
8
|
+
// src/dfwcomponents/WorkOrderCell/WorkOrderPropertyList.tsx
|
|
9
|
+
import React from "react";
|
|
10
|
+
var propertyRowConfig = [
|
|
11
|
+
{
|
|
12
|
+
label: (wo) => wo.workOrderType,
|
|
13
|
+
value: (wo) => wo.workOrderId,
|
|
14
|
+
condition: () => true
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
label: "Functional Location",
|
|
18
|
+
value: (wo) => `${wo.tagPlantId}-${wo.tagId}`,
|
|
19
|
+
condition: (wo) => !!wo.tagId && !!wo.tagPlantId
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
label: "Tag",
|
|
23
|
+
value: (wo) => wo.tagId,
|
|
24
|
+
condition: (wo) => !!wo.tagId && !wo.tagPlantId
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: "Equipment",
|
|
28
|
+
value: (wo) => wo.equipmentId,
|
|
29
|
+
condition: (wo) => !!wo.equipmentId
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: "Active statuses",
|
|
33
|
+
value: (wo) => wo.activeStatusIds,
|
|
34
|
+
condition: (wo) => !!wo.activeStatusIds
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: "Basic start / finish",
|
|
38
|
+
value: (wo) => `${formatDate(wo.basicStartDate)} - ${formatDate(wo.basicEndDate)}`,
|
|
39
|
+
condition: (wo) => !!wo.basicStartDate && !!wo.basicEndDate
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
label: "Basic start",
|
|
43
|
+
value: (wo) => formatDate(wo.basicStartDate),
|
|
44
|
+
condition: (wo) => !!wo.basicStartDate && !wo.basicEndDate
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: "Basic finish",
|
|
48
|
+
value: (wo) => formatDate(wo.basicEndDate),
|
|
49
|
+
condition: (wo) => !!wo.basicEndDate && !wo.basicStartDate
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
label: "Required end",
|
|
53
|
+
value: (wo) => formatDate(wo.requiredEndDate),
|
|
54
|
+
color: (wo) => /* @__PURE__ */ new Date() > new Date(wo.requiredEndDate) ? "danger" : "textTertiary",
|
|
55
|
+
condition: (wo) => !!wo.requiredEndDate
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: "Work center",
|
|
59
|
+
value: (wo) => {
|
|
60
|
+
var _a;
|
|
61
|
+
return (_a = wo.workCenterId) != null ? _a : "";
|
|
62
|
+
},
|
|
63
|
+
condition: (wo) => !!wo.workCenterId
|
|
64
|
+
}
|
|
65
|
+
];
|
|
66
|
+
var WorkOrderPropertyList = ({ workOrder }) => {
|
|
67
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, propertyRowConfig.map((item) => {
|
|
68
|
+
const label = typeof item.label === "function" ? item.label(workOrder) : item.label;
|
|
69
|
+
const value = typeof item.value === "function" ? item.value(workOrder) : item.value;
|
|
70
|
+
const textColor = typeof item.color === "function" ? item.color(workOrder) : item.color;
|
|
71
|
+
if (!item.condition(workOrder))
|
|
72
|
+
return null;
|
|
73
|
+
return /* @__PURE__ */ React.createElement(
|
|
74
|
+
PropertyRow,
|
|
75
|
+
{
|
|
76
|
+
key: `${label}-${value}`,
|
|
77
|
+
label,
|
|
78
|
+
value,
|
|
79
|
+
textColor
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}));
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export {
|
|
86
|
+
WorkOrderPropertyList
|
|
87
|
+
};
|
|
@@ -18,11 +18,12 @@ var getStatusIconConfig = (status) => {
|
|
|
18
18
|
}
|
|
19
19
|
return void 0;
|
|
20
20
|
};
|
|
21
|
-
var getStatusIconsAndLabels = (activeStatusIds, requiredEndDate,
|
|
21
|
+
var getStatusIconsAndLabels = (activeStatusIds, requiredEndDate, hseCritical, productionCritical) => {
|
|
22
22
|
const requiredEnd = requiredEndDate ? new Date(requiredEndDate) : null;
|
|
23
23
|
const activeStatuses = activeStatusIds == null ? void 0 : activeStatusIds.split(" ");
|
|
24
|
+
const today = /* @__PURE__ */ new Date();
|
|
24
25
|
const iconsAndLabels = [];
|
|
25
|
-
if (requiredEnd &&
|
|
26
|
+
if (requiredEnd && today > requiredEnd) {
|
|
26
27
|
iconsAndLabels.push({
|
|
27
28
|
icon: "alarm",
|
|
28
29
|
label: "Required end overdue",
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import {
|
|
2
|
+
StatusIcon
|
|
3
|
+
} from "./chunk-VDHOYF7Z.js";
|
|
4
|
+
import {
|
|
5
|
+
WorkOrderPropertyList
|
|
6
|
+
} from "./chunk-FKFMMXFT.js";
|
|
7
|
+
import {
|
|
8
|
+
getStatusIconsAndLabels
|
|
9
|
+
} from "./chunk-GNURJIGB.js";
|
|
10
|
+
import {
|
|
11
|
+
__objRest,
|
|
12
|
+
__spreadProps,
|
|
13
|
+
__spreadValues
|
|
14
|
+
} from "./chunk-G2ADBYYC.js";
|
|
15
|
+
|
|
16
|
+
// src/dfwcomponents/WorkOrderCell/WorkOrderCellNavigation.tsx
|
|
17
|
+
import { Cell, EDSStyleSheet, Icon, Typography, useStyles } from "@equinor/mad-components";
|
|
18
|
+
import React, { useMemo } from "react";
|
|
19
|
+
import { View } from "react-native";
|
|
20
|
+
var WorkOrderCellNavigation = (_a) => {
|
|
21
|
+
var _b = _a, {
|
|
22
|
+
showSymbols = true,
|
|
23
|
+
onPress,
|
|
24
|
+
workOrder
|
|
25
|
+
} = _b, rest = __objRest(_b, [
|
|
26
|
+
"showSymbols",
|
|
27
|
+
"onPress",
|
|
28
|
+
"workOrder"
|
|
29
|
+
]);
|
|
30
|
+
const styles = useStyles(themeStyles);
|
|
31
|
+
const iconsAndLabels = useMemo(
|
|
32
|
+
() => getStatusIconsAndLabels(
|
|
33
|
+
workOrder.activeStatusIds,
|
|
34
|
+
workOrder.requiredEndDate,
|
|
35
|
+
workOrder.isHseCritical,
|
|
36
|
+
workOrder.isProductionCritical
|
|
37
|
+
),
|
|
38
|
+
[workOrder]
|
|
39
|
+
);
|
|
40
|
+
return /* @__PURE__ */ React.createElement(Cell, __spreadProps(__spreadValues({}, rest), { onPress }), /* @__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 }, workOrder.title), /* @__PURE__ */ React.createElement(View, { style: styles.dataContainer }, workOrder.maintenanceType && /* @__PURE__ */ React.createElement(Typography, { group: "paragraph", variant: "body_short", color: "textTertiary" }, workOrder.maintenanceType), /* @__PURE__ */ React.createElement(WorkOrderPropertyList, { workOrder }))), 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" })));
|
|
41
|
+
};
|
|
42
|
+
var themeStyles = EDSStyleSheet.create((theme) => ({
|
|
43
|
+
container: {
|
|
44
|
+
flexDirection: "row",
|
|
45
|
+
justifyContent: "space-between",
|
|
46
|
+
alignItems: "center"
|
|
47
|
+
},
|
|
48
|
+
contentContainer: {
|
|
49
|
+
flex: 1,
|
|
50
|
+
flexDirection: "column"
|
|
51
|
+
},
|
|
52
|
+
title: {
|
|
53
|
+
marginBottom: theme.spacing.container.paddingVertical
|
|
54
|
+
},
|
|
55
|
+
dataContainer: {
|
|
56
|
+
gap: theme.spacing.cell.group.titleBottomPadding
|
|
57
|
+
},
|
|
58
|
+
iconListContainer: {
|
|
59
|
+
position: "absolute",
|
|
60
|
+
top: 0,
|
|
61
|
+
right: 0,
|
|
62
|
+
flexDirection: "row",
|
|
63
|
+
alignItems: "center",
|
|
64
|
+
gap: theme.spacing.spacer.small
|
|
65
|
+
}
|
|
66
|
+
}));
|
|
67
|
+
|
|
68
|
+
export {
|
|
69
|
+
WorkOrderCellNavigation
|
|
70
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkOrderCell
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-75HKHWRT.js";
|
|
4
4
|
import {
|
|
5
5
|
WorkOrderCellNavigation
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VHEWDAGI.js";
|
|
7
7
|
|
|
8
8
|
// src/dfwcomponents/WorkOrderCell/index.ts
|
|
9
9
|
var WorkOrderCell2 = WorkOrderCell;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { WorkOrderCellProps } from "./types";
|
|
3
|
-
export declare const WorkOrderCell: ({
|
|
3
|
+
export declare const WorkOrderCell: ({ showSymbols, startJobButton, readyForOperationButton, tecoButton, workOrder, ...rest }: WorkOrderCellProps) => React.JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkOrderCell
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-75HKHWRT.js";
|
|
4
|
+
import "../../chunk-VDHOYF7Z.js";
|
|
5
|
+
import "../../chunk-FKFMMXFT.js";
|
|
6
|
+
import "../../chunk-GNURJIGB.js";
|
|
6
7
|
import "../../chunk-2JQRYR7Z.js";
|
|
7
8
|
import "../../chunk-DQQOZB3E.js";
|
|
8
|
-
import "../../chunk-VDHOYF7Z.js";
|
|
9
9
|
import "../../chunk-G2ADBYYC.js";
|
|
10
10
|
export {
|
|
11
11
|
WorkOrderCell
|
|
@@ -3,5 +3,5 @@ import { WorkOrderCellProps } from "./types";
|
|
|
3
3
|
type WorkOrderCellNavigationProps = WorkOrderCellProps & {
|
|
4
4
|
onPress: () => void;
|
|
5
5
|
};
|
|
6
|
-
export declare const WorkOrderCellNavigation: ({
|
|
6
|
+
export declare const WorkOrderCellNavigation: ({ showSymbols, onPress, workOrder, ...rest }: WorkOrderCellNavigationProps) => React.JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkOrderCellNavigation
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-VHEWDAGI.js";
|
|
4
|
+
import "../../chunk-VDHOYF7Z.js";
|
|
5
|
+
import "../../chunk-FKFMMXFT.js";
|
|
6
|
+
import "../../chunk-GNURJIGB.js";
|
|
6
7
|
import "../../chunk-2JQRYR7Z.js";
|
|
7
8
|
import "../../chunk-DQQOZB3E.js";
|
|
8
|
-
import "../../chunk-VDHOYF7Z.js";
|
|
9
9
|
import "../../chunk-G2ADBYYC.js";
|
|
10
10
|
export {
|
|
11
11
|
WorkOrderCellNavigation
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
2
|
+
WorkOrderPropertyList
|
|
3
|
+
} from "../../chunk-FKFMMXFT.js";
|
|
4
|
+
import "../../chunk-GNURJIGB.js";
|
|
5
5
|
import "../../chunk-2JQRYR7Z.js";
|
|
6
6
|
import "../../chunk-DQQOZB3E.js";
|
|
7
7
|
import "../../chunk-G2ADBYYC.js";
|
|
8
8
|
export {
|
|
9
|
-
|
|
9
|
+
WorkOrderPropertyList
|
|
10
10
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkOrderCell
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-VULSI4WO.js";
|
|
4
|
+
import "../../chunk-75HKHWRT.js";
|
|
5
|
+
import "../../chunk-VHEWDAGI.js";
|
|
6
|
+
import "../../chunk-VDHOYF7Z.js";
|
|
7
|
+
import "../../chunk-FKFMMXFT.js";
|
|
8
|
+
import "../../chunk-GNURJIGB.js";
|
|
8
9
|
import "../../chunk-2JQRYR7Z.js";
|
|
9
10
|
import "../../chunk-DQQOZB3E.js";
|
|
10
|
-
import "../../chunk-VDHOYF7Z.js";
|
|
11
11
|
import "../../chunk-G2ADBYYC.js";
|
|
12
12
|
export {
|
|
13
13
|
WorkOrderCell
|
|
@@ -1,18 +1,21 @@
|
|
|
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
|
+
export type WorkOrderType = "PM01" | "PM02" | "PM03" | "PM04" | "PM05" | "PM06" | "PM10" | "PM15" | "PM20" | "unknown";
|
|
4
4
|
export type WorkOrder = {
|
|
5
5
|
workOrderId: string;
|
|
6
6
|
workOrderType: WorkOrderType;
|
|
7
7
|
title: string;
|
|
8
8
|
maintenanceType?: string;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
tagId?: string;
|
|
10
|
+
tagPlantId?: string;
|
|
11
|
+
equipmentId?: string;
|
|
12
|
+
activeStatusIds?: string;
|
|
11
13
|
basicStartDate?: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
basicEndDate?: string;
|
|
15
|
+
requiredEndDate?: string;
|
|
16
|
+
workCenterId?: string;
|
|
17
|
+
isHseCritical?: boolean;
|
|
18
|
+
isProductionCritical?: boolean;
|
|
16
19
|
};
|
|
17
20
|
type ButtonOptions = {
|
|
18
21
|
disabled?: boolean;
|
|
@@ -21,18 +24,27 @@ type ButtonOptions = {
|
|
|
21
24
|
onPress: () => void;
|
|
22
25
|
};
|
|
23
26
|
export type WorkOrderCellProps = {
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Boolean value indicating whether or not the work order cell should display statuses as icons.
|
|
29
|
+
*/
|
|
26
30
|
showSymbols?: boolean;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
style?: ViewProps["style"];
|
|
31
|
-
overwriteLabel?: Partial<Record<keyof WorkOrder, string>>;
|
|
31
|
+
/**
|
|
32
|
+
* Button configuration for the start job button.
|
|
33
|
+
*/
|
|
32
34
|
startJobButton?: ButtonOptions;
|
|
35
|
+
/**
|
|
36
|
+
* Button configuration for the ready for operation button.
|
|
37
|
+
*/
|
|
33
38
|
readyForOperationButton?: ButtonOptions;
|
|
39
|
+
/**
|
|
40
|
+
* Button configuration for the complete button.
|
|
41
|
+
*/
|
|
34
42
|
tecoButton?: ButtonOptions;
|
|
35
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Work order data to display in the cell.
|
|
45
|
+
*/
|
|
46
|
+
workOrder: WorkOrder;
|
|
47
|
+
} & Omit<ViewProps, "children">;
|
|
36
48
|
export type StatusConfig = {
|
|
37
49
|
icon: IconName;
|
|
38
50
|
label?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { StatusConfig } from "./types";
|
|
2
2
|
export declare const getStatusIconConfig: (status: string) => StatusConfig | undefined;
|
|
3
|
-
export declare const getStatusIconsAndLabels: (activeStatusIds
|
|
3
|
+
export declare const getStatusIconsAndLabels: (activeStatusIds?: string, requiredEndDate?: string, hseCritical?: boolean, productionCritical?: boolean) => StatusConfig[];
|
|
4
4
|
export declare const formatDate: (dateString: string) => string;
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkOrderCell
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-VULSI4WO.js";
|
|
4
|
+
import "./chunk-75HKHWRT.js";
|
|
5
|
+
import "./chunk-VHEWDAGI.js";
|
|
6
|
+
import "./chunk-VDHOYF7Z.js";
|
|
7
|
+
import "./chunk-FKFMMXFT.js";
|
|
8
|
+
import "./chunk-GNURJIGB.js";
|
|
8
9
|
import "./chunk-2JQRYR7Z.js";
|
|
9
10
|
import {
|
|
10
11
|
PropertyRow
|
|
11
12
|
} from "./chunk-DQQOZB3E.js";
|
|
12
|
-
import "./chunk-VDHOYF7Z.js";
|
|
13
13
|
import "./chunk-G2ADBYYC.js";
|
|
14
14
|
export {
|
|
15
15
|
PropertyRow,
|
package/package.json
CHANGED
package/dist/chunk-AIIMQRJ6.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
formatDate
|
|
3
|
-
} from "./chunk-JFOLVFFO.js";
|
|
4
|
-
import {
|
|
5
|
-
PropertyRow
|
|
6
|
-
} from "./chunk-DQQOZB3E.js";
|
|
7
|
-
|
|
8
|
-
// src/dfwcomponents/WorkOrderCell/PropertyList.tsx
|
|
9
|
-
import React from "react";
|
|
10
|
-
var workOrderLabelMap = {
|
|
11
|
-
title: "Title",
|
|
12
|
-
maintenanceType: "Maintenance type",
|
|
13
|
-
functionalLocation: "Functional Location",
|
|
14
|
-
equipment: "Equipment",
|
|
15
|
-
activeStatus: "Active status",
|
|
16
|
-
basicStartDate: "Basic start",
|
|
17
|
-
basicFinishDate: "Basic finish",
|
|
18
|
-
requiredEnd: "Required end",
|
|
19
|
-
workCenter: "Work center"
|
|
20
|
-
};
|
|
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;
|
|
25
|
-
const getLabel = (key) => {
|
|
26
|
-
if (key === "basicStartDate" && combinedDates) {
|
|
27
|
-
return "Basic start / finish";
|
|
28
|
-
}
|
|
29
|
-
return workOrderLabelMap[key];
|
|
30
|
-
};
|
|
31
|
-
const getDisplayValue = (key, value) => {
|
|
32
|
-
if (key === "basicStartDate" && combinedDates) {
|
|
33
|
-
return combinedDates;
|
|
34
|
-
}
|
|
35
|
-
if (["basicStartDate", "basicFinishDate", "requiredEnd"].includes(key)) {
|
|
36
|
-
return value ? formatDate(value) : "";
|
|
37
|
-
}
|
|
38
|
-
return value;
|
|
39
|
-
};
|
|
40
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, Object.entries(data).map(([key, value], index) => {
|
|
41
|
-
const typedKey = key;
|
|
42
|
-
if (combinedDates && typedKey === "basicFinishDate")
|
|
43
|
-
return null;
|
|
44
|
-
if (value || typedKey === "basicStartDate" && combinedDates) {
|
|
45
|
-
const label = getLabel(typedKey);
|
|
46
|
-
const displayValue = getDisplayValue(typedKey, value);
|
|
47
|
-
const textColor = typedKey === "requiredEnd" && requiredEnd && currentDate > requiredEnd ? "danger" : valueColor;
|
|
48
|
-
return label && /* @__PURE__ */ React.createElement(
|
|
49
|
-
PropertyRow,
|
|
50
|
-
{
|
|
51
|
-
key: index,
|
|
52
|
-
label,
|
|
53
|
-
value: displayValue != null ? displayValue : "",
|
|
54
|
-
textColor
|
|
55
|
-
}
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
return null;
|
|
59
|
-
}));
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export {
|
|
63
|
-
PropertyList
|
|
64
|
-
};
|
package/dist/chunk-JVF34AIF.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PropertyList
|
|
3
|
-
} from "./chunk-AIIMQRJ6.js";
|
|
4
|
-
import {
|
|
5
|
-
getStatusIconsAndLabels
|
|
6
|
-
} from "./chunk-JFOLVFFO.js";
|
|
7
|
-
import {
|
|
8
|
-
PropertyRow
|
|
9
|
-
} from "./chunk-DQQOZB3E.js";
|
|
10
|
-
import {
|
|
11
|
-
StatusIcon
|
|
12
|
-
} from "./chunk-VDHOYF7Z.js";
|
|
13
|
-
import {
|
|
14
|
-
__objRest,
|
|
15
|
-
__spreadProps,
|
|
16
|
-
__spreadValues
|
|
17
|
-
} from "./chunk-G2ADBYYC.js";
|
|
18
|
-
|
|
19
|
-
// src/dfwcomponents/WorkOrderCell/WorkOrderCellNavigation.tsx
|
|
20
|
-
import { Cell, EDSStyleSheet, Icon, Typography, useStyles } from "@equinor/mad-components";
|
|
21
|
-
import React, { useMemo } from "react";
|
|
22
|
-
import { View } from "react-native";
|
|
23
|
-
var WorkOrderCellNavigation = (_a) => {
|
|
24
|
-
var _b = _a, {
|
|
25
|
-
title,
|
|
26
|
-
workOrderId,
|
|
27
|
-
workOrderType,
|
|
28
|
-
maintenanceType,
|
|
29
|
-
valueColor = "textTertiary",
|
|
30
|
-
isHseCritical,
|
|
31
|
-
isProductionCritical,
|
|
32
|
-
showSymbols = true,
|
|
33
|
-
onPress,
|
|
34
|
-
style
|
|
35
|
-
} = _b, rest = __objRest(_b, [
|
|
36
|
-
"title",
|
|
37
|
-
"workOrderId",
|
|
38
|
-
"workOrderType",
|
|
39
|
-
"maintenanceType",
|
|
40
|
-
"valueColor",
|
|
41
|
-
"isHseCritical",
|
|
42
|
-
"isProductionCritical",
|
|
43
|
-
"showSymbols",
|
|
44
|
-
"onPress",
|
|
45
|
-
"style"
|
|
46
|
-
]);
|
|
47
|
-
const styles = useStyles(themeStyles);
|
|
48
|
-
const currentDate = useMemo(() => /* @__PURE__ */ new Date(), []);
|
|
49
|
-
const iconsAndLabels = useMemo(
|
|
50
|
-
() => {
|
|
51
|
-
var _a2;
|
|
52
|
-
return getStatusIconsAndLabels(
|
|
53
|
-
rest.activeStatus,
|
|
54
|
-
(_a2 = rest.requiredEnd) != null ? _a2 : null,
|
|
55
|
-
currentDate,
|
|
56
|
-
isHseCritical,
|
|
57
|
-
isProductionCritical
|
|
58
|
-
);
|
|
59
|
-
},
|
|
60
|
-
[rest.activeStatus, rest.requiredEnd, currentDate, isHseCritical, isProductionCritical]
|
|
61
|
-
);
|
|
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" })));
|
|
63
|
-
};
|
|
64
|
-
var themeStyles = EDSStyleSheet.create((theme) => ({
|
|
65
|
-
container: {
|
|
66
|
-
flexDirection: "row",
|
|
67
|
-
justifyContent: "space-between",
|
|
68
|
-
alignItems: "center"
|
|
69
|
-
},
|
|
70
|
-
contentContainer: {
|
|
71
|
-
flex: 1,
|
|
72
|
-
flexDirection: "column"
|
|
73
|
-
},
|
|
74
|
-
title: {
|
|
75
|
-
marginBottom: theme.spacing.container.paddingVertical
|
|
76
|
-
},
|
|
77
|
-
dataContainer: {
|
|
78
|
-
gap: theme.spacing.cell.group.titleBottomPadding
|
|
79
|
-
},
|
|
80
|
-
iconListContainer: {
|
|
81
|
-
position: "absolute",
|
|
82
|
-
top: 0,
|
|
83
|
-
right: 0,
|
|
84
|
-
flexDirection: "row",
|
|
85
|
-
alignItems: "center",
|
|
86
|
-
gap: theme.spacing.spacer.small
|
|
87
|
-
}
|
|
88
|
-
}));
|
|
89
|
-
|
|
90
|
-
export {
|
|
91
|
-
WorkOrderCellNavigation
|
|
92
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Color } from "@equinor/mad-components";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { WorkOrder } from "./types";
|
|
4
|
-
type PropertyListProps = {
|
|
5
|
-
data: Partial<WorkOrder>;
|
|
6
|
-
valueColor: Color;
|
|
7
|
-
};
|
|
8
|
-
export declare const PropertyList: ({ data, valueColor }: PropertyListProps) => React.JSX.Element;
|
|
9
|
-
export {};
|