@equinor/mad-dfw 0.5.6 → 0.5.8

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @equinor/mad-dfw
2
2
 
3
+ ## 0.5.8
4
+
5
+ ### Patch Changes
6
+
7
+ - e963324: Add main workcenter to WorkOrderCell
8
+
9
+ ## 0.5.7
10
+
11
+ ### Patch Changes
12
+
13
+ - 91f3bcc: Icons in the `WorkOrderCell.Navigation` now shows on a new line on smaller devices.
14
+
3
15
  ## 0.5.6
4
16
 
5
17
  ### Patch Changes
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-VDHOYF7Z.js";
4
4
  import {
5
5
  WorkOrderPropertyList
6
- } from "./chunk-BXAE3AAV.js";
6
+ } from "./chunk-XFPJJ3TJ.js";
7
7
  import {
8
8
  getStatusIconsAndLabels
9
9
  } from "./chunk-3QCSFFBK.js";
@@ -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";
@@ -44,6 +45,7 @@ var WorkOrderCellNavigation = (_a) => {
44
45
  "onPress"
45
46
  ]);
46
47
  const styles = useStyles(themeStyles);
48
+ const isMobile = useBreakpoint() === "xs";
47
49
  const iconsAndLabels = useMemo(
48
50
  () => getStatusIconsAndLabels(
49
51
  workOrder.activeStatusIds,
@@ -54,6 +56,7 @@ var WorkOrderCellNavigation = (_a) => {
54
56
  ),
55
57
  [isBookmarked, workOrder]
56
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 }))));
57
60
  return /* @__PURE__ */ React.createElement(
58
61
  Cell,
59
62
  __spreadProps(__spreadValues({}, rest), {
@@ -61,14 +64,23 @@ var WorkOrderCellNavigation = (_a) => {
61
64
  leftSwipeGroup,
62
65
  rightSwipeGroup
63
66
  }),
64
- /* @__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(
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(
65
77
  WorkOrderPropertyList,
66
78
  {
67
79
  workOrder,
68
80
  additionalPropertyRows,
69
81
  wrapValues
70
82
  }
71
- ))), 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" }))
83
+ ))), showSymbols && !isMobile && renderIcons(), /* @__PURE__ */ React.createElement(Icon, { name: "chevron-right" }))
72
84
  );
73
85
  };
74
86
  var themeStyles = EDSStyleSheet.create((theme) => ({
@@ -87,13 +99,20 @@ var themeStyles = EDSStyleSheet.create((theme) => ({
87
99
  dataContainer: {
88
100
  gap: theme.spacing.cell.group.titleBottomPadding
89
101
  },
90
- iconListContainer: {
102
+ iconList: {
91
103
  position: "absolute",
92
104
  top: 0,
93
105
  right: 0,
94
106
  flexDirection: "row",
95
107
  alignItems: "center",
96
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
97
116
  }
98
117
  }));
99
118
 
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  WorkOrderCell
3
- } from "./chunk-CTARCKOR.js";
3
+ } from "./chunk-TMIS3KU7.js";
4
4
  import {
5
5
  WorkOrderCellNavigation
6
- } from "./chunk-YBJFHSLC.js";
6
+ } from "./chunk-7OXATEUD.js";
7
7
 
8
8
  // src/dfwcomponents/WorkOrderCell/index.ts
9
9
  var WorkOrderCell2 = WorkOrderCell;
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-VDHOYF7Z.js";
4
4
  import {
5
5
  WorkOrderPropertyList
6
- } from "./chunk-BXAE3AAV.js";
6
+ } from "./chunk-XFPJJ3TJ.js";
7
7
  import {
8
8
  getStatusIconsAndLabels
9
9
  } from "./chunk-3QCSFFBK.js";
@@ -57,6 +57,14 @@ var propertyRowConfig = [
57
57
  },
58
58
  condition: (wo) => !!wo.workCenterId
59
59
  },
60
+ {
61
+ label: "Main work center",
62
+ value: (wo) => {
63
+ var _a;
64
+ return (_a = wo.mainWorkCenterId) != null ? _a : "";
65
+ },
66
+ condition: (wo) => !!wo.mainWorkCenterId
67
+ },
60
68
  {
61
69
  label: "Functional location",
62
70
  value: (wo) => `${wo.tagPlantId}-${wo.tagId}`,
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  WorkOrderCell
3
- } from "../../chunk-CTARCKOR.js";
3
+ } from "../../chunk-TMIS3KU7.js";
4
4
  import "../../chunk-VDHOYF7Z.js";
5
- import "../../chunk-BXAE3AAV.js";
5
+ import "../../chunk-XFPJJ3TJ.js";
6
6
  import "../../chunk-3QCSFFBK.js";
7
7
  import "../../chunk-2JQRYR7Z.js";
8
8
  import "../../chunk-TBLBQCUH.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  WorkOrderCellNavigation
3
- } from "../../chunk-YBJFHSLC.js";
3
+ } from "../../chunk-7OXATEUD.js";
4
4
  import "../../chunk-VDHOYF7Z.js";
5
- import "../../chunk-BXAE3AAV.js";
5
+ import "../../chunk-XFPJJ3TJ.js";
6
6
  import "../../chunk-3QCSFFBK.js";
7
7
  import "../../chunk-2JQRYR7Z.js";
8
8
  import "../../chunk-TBLBQCUH.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  WorkOrderPropertyList
3
- } from "../../chunk-BXAE3AAV.js";
3
+ } from "../../chunk-XFPJJ3TJ.js";
4
4
  import "../../chunk-3QCSFFBK.js";
5
5
  import "../../chunk-2JQRYR7Z.js";
6
6
  import "../../chunk-TBLBQCUH.js";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  WorkOrderCell
3
- } from "../../chunk-2TLF63UB.js";
4
- import "../../chunk-CTARCKOR.js";
5
- import "../../chunk-YBJFHSLC.js";
3
+ } from "../../chunk-PG5T57JY.js";
4
+ import "../../chunk-TMIS3KU7.js";
5
+ import "../../chunk-7OXATEUD.js";
6
6
  import "../../chunk-VDHOYF7Z.js";
7
- import "../../chunk-BXAE3AAV.js";
7
+ import "../../chunk-XFPJJ3TJ.js";
8
8
  import "../../chunk-3QCSFFBK.js";
9
9
  import "../../chunk-2JQRYR7Z.js";
10
10
  import "../../chunk-TBLBQCUH.js";
@@ -18,6 +18,7 @@ export type WorkOrder = {
18
18
  basicEndDate?: string;
19
19
  requiredEndDate?: string;
20
20
  workCenterId?: string;
21
+ mainWorkCenterId?: string;
21
22
  isHseCritical?: boolean;
22
23
  isProductionCritical?: boolean;
23
24
  };
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  WorkOrderCell
3
- } from "./chunk-2TLF63UB.js";
4
- import "./chunk-CTARCKOR.js";
5
- import "./chunk-YBJFHSLC.js";
3
+ } from "./chunk-PG5T57JY.js";
4
+ import "./chunk-TMIS3KU7.js";
5
+ import "./chunk-7OXATEUD.js";
6
6
  import "./chunk-VDHOYF7Z.js";
7
- import "./chunk-BXAE3AAV.js";
7
+ import "./chunk-XFPJJ3TJ.js";
8
8
  import "./chunk-3QCSFFBK.js";
9
9
  import "./chunk-2JQRYR7Z.js";
10
10
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/mad-dfw",
3
- "version": "0.5.6",
3
+ "version": "0.5.8",
4
4
  "description": "A React Native component library for the Digital Field Worker applications.",
5
5
  "type": "module",
6
6
  "scripts": {