@equinor/mad-dfw 0.5.4 → 0.5.6

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,19 @@
1
1
  # @equinor/mad-dfw
2
2
 
3
+ ## 0.5.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 979b5bd: New prop for the `WorkOrderCell.Navigation` called `isBookmarked`. Can be used to
8
+ display the `bookmark` and `bookmark-outline` icons.
9
+
10
+ ## 0.5.5
11
+
12
+ ### Patch Changes
13
+
14
+ - 32f5bc9: New prop, `wrapValues`, that wraps the text values in the `WorkOrderCell` and
15
+ `WorkOrderCell.Navigation`.
16
+
3
17
  ## 0.5.4
4
18
 
5
19
  ### Patch Changes
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  WorkOrderCell
3
- } from "./chunk-TRLDTHNI.js";
3
+ } from "./chunk-CTARCKOR.js";
4
4
  import {
5
5
  WorkOrderCellNavigation
6
- } from "./chunk-2SHXH2H4.js";
6
+ } from "./chunk-YBJFHSLC.js";
7
7
 
8
8
  // src/dfwcomponents/WorkOrderCell/index.ts
9
9
  var WorkOrderCell2 = WorkOrderCell;
@@ -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
1
  import {
2
2
  formatDate
3
- } from "./chunk-ZBIEH5QL.js";
3
+ } from "./chunk-3QCSFFBK.js";
4
4
  import {
5
5
  PropertyRow
6
- } from "./chunk-DQQOZB3E.js";
6
+ } from "./chunk-TBLBQCUH.js";
7
7
 
8
8
  // src/dfwcomponents/WorkOrderCell/WorkOrderPropertyList.tsx
9
9
  import React from "react";
@@ -65,7 +65,8 @@ var propertyRowConfig = [
65
65
  ];
66
66
  var WorkOrderPropertyList = ({
67
67
  workOrder,
68
- additionalPropertyRows = []
68
+ additionalPropertyRows = [],
69
+ wrapValues
69
70
  }) => {
70
71
  return /* @__PURE__ */ React.createElement(React.Fragment, null, propertyRowConfig.map((item) => {
71
72
  const label = typeof item.label === "function" ? item.label(workOrder) : item.label;
@@ -80,6 +81,7 @@ var WorkOrderPropertyList = ({
80
81
  label,
81
82
  value,
82
83
  textColor,
84
+ wrapValues,
83
85
  selectable: true
84
86
  }
85
87
  );
@@ -89,6 +91,7 @@ var WorkOrderPropertyList = ({
89
91
  key: `additional-${index}`,
90
92
  label: item.label,
91
93
  value: item.value,
94
+ wrapValues,
92
95
  selectable: true
93
96
  }
94
97
  )));
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk-VDHOYF7Z.js";
4
4
  import {
5
5
  WorkOrderPropertyList
6
- } from "./chunk-UKPLD6Y2.js";
6
+ } from "./chunk-BXAE3AAV.js";
7
7
  import {
8
8
  getStatusIconsAndLabels
9
- } from "./chunk-ZBIEH5QL.js";
9
+ } from "./chunk-3QCSFFBK.js";
10
10
  import {
11
11
  __objRest,
12
12
  __spreadValues
@@ -31,14 +31,16 @@ var WorkOrderCell = (_a) => {
31
31
  readyForOperationButton,
32
32
  tecoButton,
33
33
  workOrder,
34
- additionalPropertyRows = []
34
+ additionalPropertyRows = [],
35
+ wrapValues = false
35
36
  } = _b, rest = __objRest(_b, [
36
37
  "showSymbols",
37
38
  "startJobButton",
38
39
  "readyForOperationButton",
39
40
  "tecoButton",
40
41
  "workOrder",
41
- "additionalPropertyRows"
42
+ "additionalPropertyRows",
43
+ "wrapValues"
42
44
  ]);
43
45
  var _a2, _b2, _c;
44
46
  const breakpoint = useBreakpoint();
@@ -67,7 +69,8 @@ var WorkOrderCell = (_a) => {
67
69
  WorkOrderPropertyList,
68
70
  {
69
71
  workOrder,
70
- additionalPropertyRows
72
+ additionalPropertyRows,
73
+ wrapValues
71
74
  }
72
75
  )), shouldShowActions && /* @__PURE__ */ React.createElement(
73
76
  View,
@@ -20,13 +20,15 @@ var PropertyRow = (_a) => {
20
20
  value,
21
21
  iconName,
22
22
  textColor = "textTertiary",
23
- selectable
23
+ selectable,
24
+ wrapValues
24
25
  } = _b, rest = __objRest(_b, [
25
26
  "label",
26
27
  "value",
27
28
  "iconName",
28
29
  "textColor",
29
- "selectable"
30
+ "selectable",
31
+ "wrapValues"
30
32
  ]);
31
33
  const breakpoint = useBreakpoint();
32
34
  const styles = useStyles(themeStyles, { breakpoint });
@@ -38,7 +40,7 @@ var PropertyRow = (_a) => {
38
40
  group: "paragraph",
39
41
  variant: "body_short",
40
42
  color: textColor,
41
- numberOfLines: 1,
43
+ numberOfLines: wrapValues ? void 0 : 1,
42
44
  selectable
43
45
  },
44
46
  value
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk-VDHOYF7Z.js";
4
4
  import {
5
5
  WorkOrderPropertyList
6
- } from "./chunk-UKPLD6Y2.js";
6
+ } from "./chunk-BXAE3AAV.js";
7
7
  import {
8
8
  getStatusIconsAndLabels
9
- } from "./chunk-ZBIEH5QL.js";
9
+ } from "./chunk-3QCSFFBK.js";
10
10
  import {
11
11
  __objRest,
12
12
  __spreadProps,
@@ -30,6 +30,8 @@ var WorkOrderCellNavigation = (_a) => {
30
30
  leftSwipeGroup,
31
31
  rightSwipeGroup,
32
32
  additionalPropertyRows = [],
33
+ wrapValues = false,
34
+ isBookmarked,
33
35
  onPress
34
36
  } = _b, rest = __objRest(_b, [
35
37
  "showSymbols",
@@ -37,6 +39,8 @@ var WorkOrderCellNavigation = (_a) => {
37
39
  "leftSwipeGroup",
38
40
  "rightSwipeGroup",
39
41
  "additionalPropertyRows",
42
+ "wrapValues",
43
+ "isBookmarked",
40
44
  "onPress"
41
45
  ]);
42
46
  const styles = useStyles(themeStyles);
@@ -45,9 +49,10 @@ var WorkOrderCellNavigation = (_a) => {
45
49
  workOrder.activeStatusIds,
46
50
  workOrder.requiredEndDate,
47
51
  workOrder.isHseCritical,
48
- workOrder.isProductionCritical
52
+ workOrder.isProductionCritical,
53
+ isBookmarked
49
54
  ),
50
- [workOrder]
55
+ [isBookmarked, workOrder]
51
56
  );
52
57
  return /* @__PURE__ */ React.createElement(
53
58
  Cell,
@@ -60,9 +65,10 @@ var WorkOrderCellNavigation = (_a) => {
60
65
  WorkOrderPropertyList,
61
66
  {
62
67
  workOrder,
63
- additionalPropertyRows
68
+ additionalPropertyRows,
69
+ wrapValues
64
70
  }
65
- ), " ")), 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" }))
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" }))
66
72
  );
67
73
  };
68
74
  var themeStyles = EDSStyleSheet.create((theme) => ({
@@ -7,5 +7,6 @@ export type PropertyRowProps = {
7
7
  iconName?: IconName;
8
8
  textColor?: Color;
9
9
  selectable?: boolean;
10
+ wrapValues?: boolean;
10
11
  } & ViewProps;
11
- export declare const PropertyRow: ({ label, value, iconName, textColor, selectable, ...rest }: PropertyRowProps) => React.JSX.Element;
12
+ export declare const PropertyRow: ({ label, value, iconName, textColor, selectable, wrapValues, ...rest }: PropertyRowProps) => React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PropertyRow
3
- } from "../../chunk-DQQOZB3E.js";
3
+ } from "../../chunk-TBLBQCUH.js";
4
4
  import "../../chunk-G2ADBYYC.js";
5
5
  export {
6
6
  PropertyRow
@@ -1,7 +1,7 @@
1
1
  import "../../chunk-2JQRYR7Z.js";
2
2
  import {
3
3
  PropertyRow
4
- } from "../../chunk-DQQOZB3E.js";
4
+ } from "../../chunk-TBLBQCUH.js";
5
5
  import "../../chunk-G2ADBYYC.js";
6
6
  export {
7
7
  PropertyRow
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
2
  import { WorkOrderCellProps } from "./types";
3
- export declare const WorkOrderCell: ({ showSymbols, startJobButton, readyForOperationButton, tecoButton, workOrder, additionalPropertyRows, ...rest }: WorkOrderCellProps) => React.JSX.Element;
3
+ export declare const WorkOrderCell: ({ showSymbols, startJobButton, readyForOperationButton, tecoButton, workOrder, additionalPropertyRows, wrapValues, ...rest }: WorkOrderCellProps) => React.JSX.Element;
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  WorkOrderCell
3
- } from "../../chunk-TRLDTHNI.js";
3
+ } from "../../chunk-CTARCKOR.js";
4
4
  import "../../chunk-VDHOYF7Z.js";
5
- import "../../chunk-UKPLD6Y2.js";
6
- import "../../chunk-ZBIEH5QL.js";
5
+ import "../../chunk-BXAE3AAV.js";
6
+ import "../../chunk-3QCSFFBK.js";
7
7
  import "../../chunk-2JQRYR7Z.js";
8
- import "../../chunk-DQQOZB3E.js";
8
+ import "../../chunk-TBLBQCUH.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, 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-2SHXH2H4.js";
3
+ } from "../../chunk-YBJFHSLC.js";
4
4
  import "../../chunk-VDHOYF7Z.js";
5
- import "../../chunk-UKPLD6Y2.js";
6
- import "../../chunk-ZBIEH5QL.js";
5
+ import "../../chunk-BXAE3AAV.js";
6
+ import "../../chunk-3QCSFFBK.js";
7
7
  import "../../chunk-2JQRYR7Z.js";
8
- import "../../chunk-DQQOZB3E.js";
8
+ import "../../chunk-TBLBQCUH.js";
9
9
  import "../../chunk-G2ADBYYC.js";
10
10
  export {
11
11
  WorkOrderCellNavigation
@@ -3,6 +3,7 @@ import { AdditionalPropertyRow, WorkOrder } from "./types";
3
3
  type WorkOrderPropertyListProps = {
4
4
  workOrder: WorkOrder;
5
5
  additionalPropertyRows?: AdditionalPropertyRow[];
6
+ wrapValues?: boolean;
6
7
  };
7
- export declare const WorkOrderPropertyList: ({ workOrder, additionalPropertyRows, }: WorkOrderPropertyListProps) => React.JSX.Element;
8
+ export declare const WorkOrderPropertyList: ({ workOrder, additionalPropertyRows, wrapValues, }: WorkOrderPropertyListProps) => React.JSX.Element;
8
9
  export {};
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  WorkOrderPropertyList
3
- } from "../../chunk-UKPLD6Y2.js";
4
- import "../../chunk-ZBIEH5QL.js";
3
+ } from "../../chunk-BXAE3AAV.js";
4
+ import "../../chunk-3QCSFFBK.js";
5
5
  import "../../chunk-2JQRYR7Z.js";
6
- import "../../chunk-DQQOZB3E.js";
6
+ import "../../chunk-TBLBQCUH.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-OS3ECITX.js";
4
- import "../../chunk-TRLDTHNI.js";
5
- import "../../chunk-2SHXH2H4.js";
3
+ } from "../../chunk-2TLF63UB.js";
4
+ import "../../chunk-CTARCKOR.js";
5
+ import "../../chunk-YBJFHSLC.js";
6
6
  import "../../chunk-VDHOYF7Z.js";
7
- import "../../chunk-UKPLD6Y2.js";
8
- import "../../chunk-ZBIEH5QL.js";
7
+ import "../../chunk-BXAE3AAV.js";
8
+ import "../../chunk-3QCSFFBK.js";
9
9
  import "../../chunk-2JQRYR7Z.js";
10
- import "../../chunk-DQQOZB3E.js";
10
+ import "../../chunk-TBLBQCUH.js";
11
11
  import "../../chunk-G2ADBYYC.js";
12
12
  export {
13
13
  WorkOrderCell
@@ -49,6 +49,10 @@ export type WorkOrderCellProps = {
49
49
  */
50
50
  workOrder: WorkOrder;
51
51
  additionalPropertyRows?: AdditionalPropertyRow[];
52
+ /**
53
+ * Boolean value indicating whether or not the values of the work order properties should wrap.
54
+ */
55
+ wrapValues?: boolean;
52
56
  } & Omit<ViewProps, "children">;
53
57
  export type StatusConfig = {
54
58
  icon: IconName;
@@ -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;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  formatDate,
3
3
  getStatusIconsAndLabels
4
- } from "../../chunk-ZBIEH5QL.js";
4
+ } from "../../chunk-3QCSFFBK.js";
5
5
  import "../../chunk-G2ADBYYC.js";
6
6
  export {
7
7
  formatDate,
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  WorkOrderCell
3
- } from "./chunk-OS3ECITX.js";
4
- import "./chunk-TRLDTHNI.js";
5
- import "./chunk-2SHXH2H4.js";
3
+ } from "./chunk-2TLF63UB.js";
4
+ import "./chunk-CTARCKOR.js";
5
+ import "./chunk-YBJFHSLC.js";
6
6
  import "./chunk-VDHOYF7Z.js";
7
- import "./chunk-UKPLD6Y2.js";
8
- import "./chunk-ZBIEH5QL.js";
7
+ import "./chunk-BXAE3AAV.js";
8
+ import "./chunk-3QCSFFBK.js";
9
9
  import "./chunk-2JQRYR7Z.js";
10
10
  import {
11
11
  PropertyRow
12
- } from "./chunk-DQQOZB3E.js";
12
+ } from "./chunk-TBLBQCUH.js";
13
13
  import "./chunk-G2ADBYYC.js";
14
14
  export {
15
15
  PropertyRow,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/mad-dfw",
3
- "version": "0.5.4",
3
+ "version": "0.5.6",
4
4
  "description": "A React Native component library for the Digital Field Worker applications.",
5
5
  "type": "module",
6
6
  "scripts": {