@equinor/mad-dfw 0.5.5 → 0.5.7
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 +13 -0
- package/dist/{chunk-ZBIEH5QL.js → chunk-3QCSFFBK.js} +11 -2
- package/dist/{chunk-PZRC7KKH.js → chunk-OD6DLDFB.js} +3 -3
- package/dist/{chunk-TBJQRBT4.js → chunk-OZIGJHVX.js} +29 -7
- package/dist/{chunk-KKQFJ6C4.js → chunk-RRG3OVHG.js} +2 -2
- package/dist/{chunk-3ABNW3E2.js → chunk-SCQBE3RT.js} +2 -2
- package/dist/dfwcomponents/WorkOrderCell/WorkOrderCell.js +3 -3
- package/dist/dfwcomponents/WorkOrderCell/WorkOrderCellNavigation.d.ts +2 -1
- package/dist/dfwcomponents/WorkOrderCell/WorkOrderCellNavigation.js +3 -3
- package/dist/dfwcomponents/WorkOrderCell/WorkOrderPropertyList.js +2 -2
- package/dist/dfwcomponents/WorkOrderCell/index.js +5 -5
- package/dist/dfwcomponents/WorkOrderCell/utils.d.ts +1 -1
- package/dist/dfwcomponents/WorkOrderCell/utils.js +1 -1
- package/dist/index.js +5 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @equinor/mad-dfw
|
|
2
2
|
|
|
3
|
+
## 0.5.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 91f3bcc: Icons in the `WorkOrderCell.Navigation` now shows on a new line on smaller devices.
|
|
8
|
+
|
|
9
|
+
## 0.5.6
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 979b5bd: New prop for the `WorkOrderCell.Navigation` called `isBookmarked`. Can be used to
|
|
14
|
+
display the `bookmark` and `bookmark-outline` icons.
|
|
15
|
+
|
|
3
16
|
## 0.5.5
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
// src/dfwcomponents/WorkOrderCell/utils.ts
|
|
2
|
-
var getStatusIconConfig = (status) => {
|
|
2
|
+
var getStatusIconConfig = (status, isBookmarked) => {
|
|
3
3
|
const statusMap = {
|
|
4
|
+
bookmarked: {
|
|
5
|
+
icon: isBookmarked ? "bookmark" : "bookmark-outline",
|
|
6
|
+
label: "Bookmarked",
|
|
7
|
+
textColor: "textTertiary",
|
|
8
|
+
iconColor: "primary"
|
|
9
|
+
},
|
|
4
10
|
notStarted: {
|
|
5
11
|
icon: "circle-outline",
|
|
6
12
|
label: "Not started",
|
|
@@ -40,7 +46,7 @@ var getStatusIconConfig = (status) => {
|
|
|
40
46
|
};
|
|
41
47
|
return statusMap[status];
|
|
42
48
|
};
|
|
43
|
-
var getStatusIconsAndLabels = (activeStatusIds, requiredEndDate, hseCritical, productionCritical) => {
|
|
49
|
+
var getStatusIconsAndLabels = (activeStatusIds, requiredEndDate, hseCritical, productionCritical, isBookmarked) => {
|
|
44
50
|
var _a;
|
|
45
51
|
const today = /* @__PURE__ */ new Date();
|
|
46
52
|
const iconsAndLabels = [];
|
|
@@ -61,6 +67,9 @@ var getStatusIconsAndLabels = (activeStatusIds, requiredEndDate, hseCritical, pr
|
|
|
61
67
|
} else {
|
|
62
68
|
iconsAndLabels.push(getStatusIconConfig("notStarted"));
|
|
63
69
|
}
|
|
70
|
+
if (isBookmarked !== void 0) {
|
|
71
|
+
iconsAndLabels.push(getStatusIconConfig("bookmarked", isBookmarked));
|
|
72
|
+
}
|
|
64
73
|
return iconsAndLabels;
|
|
65
74
|
};
|
|
66
75
|
var formatDate = (dateString) => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
formatDate
|
|
3
|
-
} from "./chunk-ZBIEH5QL.js";
|
|
4
1
|
import {
|
|
5
2
|
PropertyRow
|
|
6
3
|
} from "./chunk-TBLBQCUH.js";
|
|
4
|
+
import {
|
|
5
|
+
formatDate
|
|
6
|
+
} from "./chunk-3QCSFFBK.js";
|
|
7
7
|
|
|
8
8
|
// src/dfwcomponents/WorkOrderCell/WorkOrderPropertyList.tsx
|
|
9
9
|
import React from "react";
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-VDHOYF7Z.js";
|
|
4
4
|
import {
|
|
5
5
|
WorkOrderPropertyList
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OD6DLDFB.js";
|
|
7
7
|
import {
|
|
8
8
|
getStatusIconsAndLabels
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3QCSFFBK.js";
|
|
10
10
|
import {
|
|
11
11
|
__objRest,
|
|
12
12
|
__spreadProps,
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
EDSStyleSheet,
|
|
20
20
|
Icon,
|
|
21
21
|
Typography,
|
|
22
|
+
useBreakpoint,
|
|
22
23
|
useStyles
|
|
23
24
|
} from "@equinor/mad-components";
|
|
24
25
|
import React, { useMemo } from "react";
|
|
@@ -31,6 +32,7 @@ var WorkOrderCellNavigation = (_a) => {
|
|
|
31
32
|
rightSwipeGroup,
|
|
32
33
|
additionalPropertyRows = [],
|
|
33
34
|
wrapValues = false,
|
|
35
|
+
isBookmarked,
|
|
34
36
|
onPress
|
|
35
37
|
} = _b, rest = __objRest(_b, [
|
|
36
38
|
"showSymbols",
|
|
@@ -39,18 +41,22 @@ var WorkOrderCellNavigation = (_a) => {
|
|
|
39
41
|
"rightSwipeGroup",
|
|
40
42
|
"additionalPropertyRows",
|
|
41
43
|
"wrapValues",
|
|
44
|
+
"isBookmarked",
|
|
42
45
|
"onPress"
|
|
43
46
|
]);
|
|
44
47
|
const styles = useStyles(themeStyles);
|
|
48
|
+
const isMobile = useBreakpoint() === "xs";
|
|
45
49
|
const iconsAndLabels = useMemo(
|
|
46
50
|
() => getStatusIconsAndLabels(
|
|
47
51
|
workOrder.activeStatusIds,
|
|
48
52
|
workOrder.requiredEndDate,
|
|
49
53
|
workOrder.isHseCritical,
|
|
50
|
-
workOrder.isProductionCritical
|
|
54
|
+
workOrder.isProductionCritical,
|
|
55
|
+
isBookmarked
|
|
51
56
|
),
|
|
52
|
-
[workOrder]
|
|
57
|
+
[isBookmarked, workOrder]
|
|
53
58
|
);
|
|
59
|
+
const renderIcons = () => /* @__PURE__ */ React.createElement(View, { style: isMobile ? styles.mobileIconList : styles.iconList }, iconsAndLabels.map((item, index) => /* @__PURE__ */ React.createElement(StatusIcon, __spreadProps(__spreadValues({ key: index }, item), { label: void 0 }))));
|
|
54
60
|
return /* @__PURE__ */ React.createElement(
|
|
55
61
|
Cell,
|
|
56
62
|
__spreadProps(__spreadValues({}, rest), {
|
|
@@ -58,14 +64,23 @@ var WorkOrderCellNavigation = (_a) => {
|
|
|
58
64
|
leftSwipeGroup,
|
|
59
65
|
rightSwipeGroup
|
|
60
66
|
}),
|
|
61
|
-
/* @__PURE__ */ React.createElement(View, { style: styles.container }, /* @__PURE__ */ React.createElement(View, { style: styles.contentContainer }, /* @__PURE__ */ React.createElement(
|
|
67
|
+
/* @__PURE__ */ React.createElement(View, { style: styles.container }, /* @__PURE__ */ React.createElement(View, { style: styles.contentContainer }, /* @__PURE__ */ React.createElement(
|
|
68
|
+
Typography,
|
|
69
|
+
{
|
|
70
|
+
numberOfLines: 1,
|
|
71
|
+
variant: "h5",
|
|
72
|
+
bold: true,
|
|
73
|
+
style: isMobile ? void 0 : styles.title
|
|
74
|
+
},
|
|
75
|
+
workOrder.title
|
|
76
|
+
), showSymbols && isMobile && renderIcons(), /* @__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(
|
|
62
77
|
WorkOrderPropertyList,
|
|
63
78
|
{
|
|
64
79
|
workOrder,
|
|
65
80
|
additionalPropertyRows,
|
|
66
81
|
wrapValues
|
|
67
82
|
}
|
|
68
|
-
))), showSymbols &&
|
|
83
|
+
))), showSymbols && !isMobile && renderIcons(), /* @__PURE__ */ React.createElement(Icon, { name: "chevron-right" }))
|
|
69
84
|
);
|
|
70
85
|
};
|
|
71
86
|
var themeStyles = EDSStyleSheet.create((theme) => ({
|
|
@@ -84,13 +99,20 @@ var themeStyles = EDSStyleSheet.create((theme) => ({
|
|
|
84
99
|
dataContainer: {
|
|
85
100
|
gap: theme.spacing.cell.group.titleBottomPadding
|
|
86
101
|
},
|
|
87
|
-
|
|
102
|
+
iconList: {
|
|
88
103
|
position: "absolute",
|
|
89
104
|
top: 0,
|
|
90
105
|
right: 0,
|
|
91
106
|
flexDirection: "row",
|
|
92
107
|
alignItems: "center",
|
|
93
108
|
gap: theme.spacing.spacer.small
|
|
109
|
+
},
|
|
110
|
+
mobileIconList: {
|
|
111
|
+
flexDirection: "row",
|
|
112
|
+
flexWrap: "wrap",
|
|
113
|
+
alignItems: "center",
|
|
114
|
+
gap: theme.spacing.spacer.small,
|
|
115
|
+
paddingVertical: theme.spacing.container.paddingVertical
|
|
94
116
|
}
|
|
95
117
|
}));
|
|
96
118
|
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-VDHOYF7Z.js";
|
|
4
4
|
import {
|
|
5
5
|
WorkOrderPropertyList
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OD6DLDFB.js";
|
|
7
7
|
import {
|
|
8
8
|
getStatusIconsAndLabels
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3QCSFFBK.js";
|
|
10
10
|
import {
|
|
11
11
|
__objRest,
|
|
12
12
|
__spreadValues
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkOrderCell
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RRG3OVHG.js";
|
|
4
4
|
import {
|
|
5
5
|
WorkOrderCellNavigation
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OZIGJHVX.js";
|
|
7
7
|
|
|
8
8
|
// src/dfwcomponents/WorkOrderCell/index.ts
|
|
9
9
|
var WorkOrderCell2 = WorkOrderCell;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkOrderCell
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-RRG3OVHG.js";
|
|
4
4
|
import "../../chunk-VDHOYF7Z.js";
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-ZBIEH5QL.js";
|
|
5
|
+
import "../../chunk-OD6DLDFB.js";
|
|
7
6
|
import "../../chunk-2JQRYR7Z.js";
|
|
8
7
|
import "../../chunk-TBLBQCUH.js";
|
|
8
|
+
import "../../chunk-3QCSFFBK.js";
|
|
9
9
|
import "../../chunk-G2ADBYYC.js";
|
|
10
10
|
export {
|
|
11
11
|
WorkOrderCell
|
|
@@ -6,6 +6,7 @@ type WorkOrderCellNavigationProps = WorkOrderCellProps & {
|
|
|
6
6
|
onPress: () => void;
|
|
7
7
|
leftSwipeGroup?: SwipeGroup;
|
|
8
8
|
rightSwipeGroup?: SwipeGroup;
|
|
9
|
+
isBookmarked?: boolean;
|
|
9
10
|
};
|
|
10
|
-
export declare const WorkOrderCellNavigation: ({ showSymbols, workOrder, leftSwipeGroup, rightSwipeGroup, additionalPropertyRows, wrapValues, onPress, ...rest }: WorkOrderCellNavigationProps) => React.JSX.Element;
|
|
11
|
+
export declare const WorkOrderCellNavigation: ({ showSymbols, workOrder, leftSwipeGroup, rightSwipeGroup, additionalPropertyRows, wrapValues, isBookmarked, onPress, ...rest }: WorkOrderCellNavigationProps) => React.JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkOrderCellNavigation
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-OZIGJHVX.js";
|
|
4
4
|
import "../../chunk-VDHOYF7Z.js";
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-ZBIEH5QL.js";
|
|
5
|
+
import "../../chunk-OD6DLDFB.js";
|
|
7
6
|
import "../../chunk-2JQRYR7Z.js";
|
|
8
7
|
import "../../chunk-TBLBQCUH.js";
|
|
8
|
+
import "../../chunk-3QCSFFBK.js";
|
|
9
9
|
import "../../chunk-G2ADBYYC.js";
|
|
10
10
|
export {
|
|
11
11
|
WorkOrderCellNavigation
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkOrderPropertyList
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-ZBIEH5QL.js";
|
|
3
|
+
} from "../../chunk-OD6DLDFB.js";
|
|
5
4
|
import "../../chunk-2JQRYR7Z.js";
|
|
6
5
|
import "../../chunk-TBLBQCUH.js";
|
|
6
|
+
import "../../chunk-3QCSFFBK.js";
|
|
7
7
|
import "../../chunk-G2ADBYYC.js";
|
|
8
8
|
export {
|
|
9
9
|
WorkOrderPropertyList
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkOrderCell
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-SCQBE3RT.js";
|
|
4
|
+
import "../../chunk-RRG3OVHG.js";
|
|
5
|
+
import "../../chunk-OZIGJHVX.js";
|
|
6
6
|
import "../../chunk-VDHOYF7Z.js";
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-ZBIEH5QL.js";
|
|
7
|
+
import "../../chunk-OD6DLDFB.js";
|
|
9
8
|
import "../../chunk-2JQRYR7Z.js";
|
|
10
9
|
import "../../chunk-TBLBQCUH.js";
|
|
10
|
+
import "../../chunk-3QCSFFBK.js";
|
|
11
11
|
import "../../chunk-G2ADBYYC.js";
|
|
12
12
|
export {
|
|
13
13
|
WorkOrderCell
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { StatusConfig } from "./types";
|
|
2
|
-
export declare const getStatusIconsAndLabels: (activeStatusIds?: string, requiredEndDate?: string, hseCritical?: boolean, productionCritical?: boolean) => StatusConfig[];
|
|
2
|
+
export declare const getStatusIconsAndLabels: (activeStatusIds?: string, requiredEndDate?: string, hseCritical?: boolean, productionCritical?: boolean, isBookmarked?: boolean) => StatusConfig[];
|
|
3
3
|
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-
|
|
3
|
+
} from "./chunk-SCQBE3RT.js";
|
|
4
|
+
import "./chunk-RRG3OVHG.js";
|
|
5
|
+
import "./chunk-OZIGJHVX.js";
|
|
6
6
|
import "./chunk-VDHOYF7Z.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-ZBIEH5QL.js";
|
|
7
|
+
import "./chunk-OD6DLDFB.js";
|
|
9
8
|
import "./chunk-2JQRYR7Z.js";
|
|
10
9
|
import {
|
|
11
10
|
PropertyRow
|
|
12
11
|
} from "./chunk-TBLBQCUH.js";
|
|
12
|
+
import "./chunk-3QCSFFBK.js";
|
|
13
13
|
import "./chunk-G2ADBYYC.js";
|
|
14
14
|
export {
|
|
15
15
|
PropertyRow,
|