@plusscommunities/pluss-core-web 1.4.25 → 1.4.27

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/dist/index.cjs.js CHANGED
@@ -1126,21 +1126,38 @@ var getDateFromTimeDatePickers = function getDateFromTimeDatePickers(dateInput,
1126
1126
  dateObject.setMinutes(time.minutes);
1127
1127
  return dateObject;
1128
1128
  };
1129
- var minutesToString = function minutesToString(minutes) {
1129
+ var formatTime = function formatTime(hours, minutes) {
1130
+ var period = hours >= 12 ? 'pm' : 'am'; // Convert 24-hour format to 12-hour format
1131
+
1132
+ var adjustedHours = hours > 12 ? hours - 12 : hours === 0 ? 12 : hours; // Ensure minutes are two digits
1133
+
1134
+ var adjustedMinutes = String(minutes).padStart(2, '0');
1135
+ return "".concat(adjustedHours, ":").concat(adjustedMinutes).concat(period);
1136
+ };
1137
+ var minutesToString = function minutesToString(minutes, isTimeOfDay) {
1130
1138
  var hours = Math.floor(minutes / 60);
1131
1139
  var remainingMinutes = minutes % 60;
1140
+
1141
+ if (isTimeOfDay) {
1142
+ return formatTime(hours, remainingMinutes);
1143
+ }
1144
+
1132
1145
  var hoursString = hours > 1 ? "".concat(hours, " hours") : "".concat(hours, " hour");
1133
1146
  var minutesString = remainingMinutes > 1 ? "".concat(remainingMinutes, " minutes") : "".concat(remainingMinutes, " minute");
1134
1147
 
1135
1148
  if (hours && remainingMinutes) {
1136
1149
  return "".concat(hoursString, " ").concat(minutesString);
1137
- } else if (hours) {
1150
+ }
1151
+
1152
+ if (hours) {
1138
1153
  return hoursString;
1139
- } else if (remainingMinutes) {
1154
+ }
1155
+
1156
+ if (remainingMinutes) {
1140
1157
  return minutesString;
1141
- } else {
1142
- return '0 minutes';
1143
1158
  }
1159
+
1160
+ return '0 minutes';
1144
1161
  };
1145
1162
  var getUTCFromTimeDatePickers = function getUTCFromTimeDatePickers(dateInput, timeInput) {
1146
1163
  var dateObject = getDateFromTimeDatePickers(dateInput, timeInput);
@@ -1804,6 +1821,7 @@ var index$3 = /*#__PURE__*/Object.freeze({
1804
1821
  hasTimeframeOverlap: hasTimeframeOverlap,
1805
1822
  timepickerToMinutes: timepickerToMinutes,
1806
1823
  getDateFromTimeDatePickers: getDateFromTimeDatePickers,
1824
+ formatTime: formatTime,
1807
1825
  minutesToString: minutesToString,
1808
1826
  getUTCFromTimeDatePickers: getUTCFromTimeDatePickers,
1809
1827
  getPluralS: getPluralS,
@@ -6266,18 +6284,21 @@ var SideNavItem = /*#__PURE__*/function (_Component) {
6266
6284
  if (this.props.isFontAwesome) {
6267
6285
  content = /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
6268
6286
  className: "sideNav-item-icon",
6269
- name: this.props.Icon
6287
+ name: this.props.Icon,
6288
+ style: this.props.iconStyle
6270
6289
  });
6271
6290
  } else if (this.props.isSVG) {
6272
6291
  content = /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
6273
6292
  className: "sideNav-item-icon",
6274
6293
  icon: this.props.Icon,
6275
- colour: COLOUR_DUSK_LIGHTER
6294
+ colour: COLOUR_DUSK_LIGHTER,
6295
+ style: this.props.iconStyle
6276
6296
  });
6277
6297
  } else {
6278
6298
  content = /*#__PURE__*/React__default['default'].createElement(P60Icon, {
6279
6299
  className: "sideNav-item-icon",
6280
- icon: this.props.Icon
6300
+ icon: this.props.Icon,
6301
+ style: this.props.iconStyle
6281
6302
  });
6282
6303
  }
6283
6304
 
package/dist/index.esm.js CHANGED
@@ -1096,21 +1096,38 @@ var getDateFromTimeDatePickers = function getDateFromTimeDatePickers(dateInput,
1096
1096
  dateObject.setMinutes(time.minutes);
1097
1097
  return dateObject;
1098
1098
  };
1099
- var minutesToString = function minutesToString(minutes) {
1099
+ var formatTime = function formatTime(hours, minutes) {
1100
+ var period = hours >= 12 ? 'pm' : 'am'; // Convert 24-hour format to 12-hour format
1101
+
1102
+ var adjustedHours = hours > 12 ? hours - 12 : hours === 0 ? 12 : hours; // Ensure minutes are two digits
1103
+
1104
+ var adjustedMinutes = String(minutes).padStart(2, '0');
1105
+ return "".concat(adjustedHours, ":").concat(adjustedMinutes).concat(period);
1106
+ };
1107
+ var minutesToString = function minutesToString(minutes, isTimeOfDay) {
1100
1108
  var hours = Math.floor(minutes / 60);
1101
1109
  var remainingMinutes = minutes % 60;
1110
+
1111
+ if (isTimeOfDay) {
1112
+ return formatTime(hours, remainingMinutes);
1113
+ }
1114
+
1102
1115
  var hoursString = hours > 1 ? "".concat(hours, " hours") : "".concat(hours, " hour");
1103
1116
  var minutesString = remainingMinutes > 1 ? "".concat(remainingMinutes, " minutes") : "".concat(remainingMinutes, " minute");
1104
1117
 
1105
1118
  if (hours && remainingMinutes) {
1106
1119
  return "".concat(hoursString, " ").concat(minutesString);
1107
- } else if (hours) {
1120
+ }
1121
+
1122
+ if (hours) {
1108
1123
  return hoursString;
1109
- } else if (remainingMinutes) {
1124
+ }
1125
+
1126
+ if (remainingMinutes) {
1110
1127
  return minutesString;
1111
- } else {
1112
- return '0 minutes';
1113
1128
  }
1129
+
1130
+ return '0 minutes';
1114
1131
  };
1115
1132
  var getUTCFromTimeDatePickers = function getUTCFromTimeDatePickers(dateInput, timeInput) {
1116
1133
  var dateObject = getDateFromTimeDatePickers(dateInput, timeInput);
@@ -1774,6 +1791,7 @@ var index$3 = /*#__PURE__*/Object.freeze({
1774
1791
  hasTimeframeOverlap: hasTimeframeOverlap,
1775
1792
  timepickerToMinutes: timepickerToMinutes,
1776
1793
  getDateFromTimeDatePickers: getDateFromTimeDatePickers,
1794
+ formatTime: formatTime,
1777
1795
  minutesToString: minutesToString,
1778
1796
  getUTCFromTimeDatePickers: getUTCFromTimeDatePickers,
1779
1797
  getPluralS: getPluralS,
@@ -6236,18 +6254,21 @@ var SideNavItem = /*#__PURE__*/function (_Component) {
6236
6254
  if (this.props.isFontAwesome) {
6237
6255
  content = /*#__PURE__*/React.createElement(FontAwesome, {
6238
6256
  className: "sideNav-item-icon",
6239
- name: this.props.Icon
6257
+ name: this.props.Icon,
6258
+ style: this.props.iconStyle
6240
6259
  });
6241
6260
  } else if (this.props.isSVG) {
6242
6261
  content = /*#__PURE__*/React.createElement(SVGIcon, {
6243
6262
  className: "sideNav-item-icon",
6244
6263
  icon: this.props.Icon,
6245
- colour: COLOUR_DUSK_LIGHTER
6264
+ colour: COLOUR_DUSK_LIGHTER,
6265
+ style: this.props.iconStyle
6246
6266
  });
6247
6267
  } else {
6248
6268
  content = /*#__PURE__*/React.createElement(P60Icon, {
6249
6269
  className: "sideNav-item-icon",
6250
- icon: this.props.Icon
6270
+ icon: this.props.Icon,
6271
+ style: this.props.iconStyle
6251
6272
  });
6252
6273
  }
6253
6274
 
package/dist/index.umd.js CHANGED
@@ -1094,21 +1094,38 @@
1094
1094
  dateObject.setMinutes(time.minutes);
1095
1095
  return dateObject;
1096
1096
  };
1097
- var minutesToString = function minutesToString(minutes) {
1097
+ var formatTime = function formatTime(hours, minutes) {
1098
+ var period = hours >= 12 ? 'pm' : 'am'; // Convert 24-hour format to 12-hour format
1099
+
1100
+ var adjustedHours = hours > 12 ? hours - 12 : hours === 0 ? 12 : hours; // Ensure minutes are two digits
1101
+
1102
+ var adjustedMinutes = String(minutes).padStart(2, '0');
1103
+ return "".concat(adjustedHours, ":").concat(adjustedMinutes).concat(period);
1104
+ };
1105
+ var minutesToString = function minutesToString(minutes, isTimeOfDay) {
1098
1106
  var hours = Math.floor(minutes / 60);
1099
1107
  var remainingMinutes = minutes % 60;
1108
+
1109
+ if (isTimeOfDay) {
1110
+ return formatTime(hours, remainingMinutes);
1111
+ }
1112
+
1100
1113
  var hoursString = hours > 1 ? "".concat(hours, " hours") : "".concat(hours, " hour");
1101
1114
  var minutesString = remainingMinutes > 1 ? "".concat(remainingMinutes, " minutes") : "".concat(remainingMinutes, " minute");
1102
1115
 
1103
1116
  if (hours && remainingMinutes) {
1104
1117
  return "".concat(hoursString, " ").concat(minutesString);
1105
- } else if (hours) {
1118
+ }
1119
+
1120
+ if (hours) {
1106
1121
  return hoursString;
1107
- } else if (remainingMinutes) {
1122
+ }
1123
+
1124
+ if (remainingMinutes) {
1108
1125
  return minutesString;
1109
- } else {
1110
- return '0 minutes';
1111
1126
  }
1127
+
1128
+ return '0 minutes';
1112
1129
  };
1113
1130
  var getUTCFromTimeDatePickers = function getUTCFromTimeDatePickers(dateInput, timeInput) {
1114
1131
  var dateObject = getDateFromTimeDatePickers(dateInput, timeInput);
@@ -1772,6 +1789,7 @@
1772
1789
  hasTimeframeOverlap: hasTimeframeOverlap,
1773
1790
  timepickerToMinutes: timepickerToMinutes,
1774
1791
  getDateFromTimeDatePickers: getDateFromTimeDatePickers,
1792
+ formatTime: formatTime,
1775
1793
  minutesToString: minutesToString,
1776
1794
  getUTCFromTimeDatePickers: getUTCFromTimeDatePickers,
1777
1795
  getPluralS: getPluralS,
@@ -6234,18 +6252,21 @@
6234
6252
  if (this.props.isFontAwesome) {
6235
6253
  content = /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
6236
6254
  className: "sideNav-item-icon",
6237
- name: this.props.Icon
6255
+ name: this.props.Icon,
6256
+ style: this.props.iconStyle
6238
6257
  });
6239
6258
  } else if (this.props.isSVG) {
6240
6259
  content = /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
6241
6260
  className: "sideNav-item-icon",
6242
6261
  icon: this.props.Icon,
6243
- colour: COLOUR_DUSK_LIGHTER
6262
+ colour: COLOUR_DUSK_LIGHTER,
6263
+ style: this.props.iconStyle
6244
6264
  });
6245
6265
  } else {
6246
6266
  content = /*#__PURE__*/React__default['default'].createElement(P60Icon, {
6247
6267
  className: "sideNav-item-icon",
6248
- icon: this.props.Icon
6268
+ icon: this.props.Icon,
6269
+ style: this.props.iconStyle
6249
6270
  });
6250
6271
  }
6251
6272
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plusscommunities/pluss-core-web",
3
- "version": "1.4.25",
3
+ "version": "1.4.27",
4
4
  "description": "Core extension package for Pluss Communities platform",
5
5
  "main": "dist/index.cjs.js",
6
6
  "scripts": {
@@ -49,11 +49,11 @@ class SideNavItem extends Component {
49
49
  }
50
50
  let content = null;
51
51
  if (this.props.isFontAwesome) {
52
- content = <FontAwesome className="sideNav-item-icon" name={this.props.Icon} />;
52
+ content = <FontAwesome className="sideNav-item-icon" name={this.props.Icon} style={this.props.iconStyle} />;
53
53
  } else if (this.props.isSVG) {
54
- content = <SVGIcon className="sideNav-item-icon" icon={this.props.Icon} colour={COLOUR_DUSK_LIGHTER} />;
54
+ content = <SVGIcon className="sideNav-item-icon" icon={this.props.Icon} colour={COLOUR_DUSK_LIGHTER} style={this.props.iconStyle} />;
55
55
  } else {
56
- content = <P60Icon className="sideNav-item-icon" icon={this.props.Icon} />;
56
+ content = <P60Icon className="sideNav-item-icon" icon={this.props.Icon} style={this.props.iconStyle} />;
57
57
  }
58
58
  return <div style={{ ...styles.section, width: 18, marginRight: 16 }}>{content}</div>;
59
59
  }
@@ -134,22 +134,39 @@ export const getDateFromTimeDatePickers = (dateInput, timeInput) => {
134
134
  return dateObject;
135
135
  };
136
136
 
137
- export const minutesToString = (minutes) => {
138
- let hours = Math.floor(minutes / 60);
139
- let remainingMinutes = minutes % 60;
137
+ export const formatTime = (hours, minutes) => {
138
+ const period = hours >= 12 ? 'pm' : 'am'; // Convert 24-hour format to 12-hour format
140
139
 
141
- let hoursString = hours > 1 ? `${hours} hours` : `${hours} hour`;
142
- let minutesString = remainingMinutes > 1 ? `${remainingMinutes} minutes` : `${remainingMinutes} minute`;
140
+ const adjustedHours = hours > 12 ? hours - 12 : hours === 0 ? 12 : hours; // Ensure minutes are two digits
141
+
142
+ const adjustedMinutes = String(minutes).padStart(2, '0');
143
+ return `${adjustedHours}:${adjustedMinutes}${period}`;
144
+ };
145
+
146
+ export const minutesToString = (minutes, isTimeOfDay) => {
147
+ const hours = Math.floor(minutes / 60);
148
+ const remainingMinutes = minutes % 60;
149
+
150
+ if (isTimeOfDay) {
151
+ return formatTime(hours, remainingMinutes);
152
+ }
153
+
154
+ const hoursString = hours > 1 ? `${hours} hours` : `${hours} hour`;
155
+ const minutesString = remainingMinutes > 1 ? `${remainingMinutes} minutes` : `${remainingMinutes} minute`;
143
156
 
144
157
  if (hours && remainingMinutes) {
145
158
  return `${hoursString} ${minutesString}`;
146
- } else if (hours) {
159
+ }
160
+
161
+ if (hours) {
147
162
  return hoursString;
148
- } else if (remainingMinutes) {
163
+ }
164
+
165
+ if (remainingMinutes) {
149
166
  return minutesString;
150
- } else {
151
- return '0 minutes';
152
167
  }
168
+
169
+ return '0 minutes';
153
170
  };
154
171
 
155
172
  export const getUTCFromTimeDatePickers = (dateInput, timeInput) => {