dce-reactkit 3.2.2-beta.50 → 3.2.2-beta.52

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/esm/index.js CHANGED
@@ -1299,18 +1299,6 @@ const getTimeInfoInET = (dateOrTimestamp) => {
1299
1299
  };
1300
1300
  };
1301
1301
 
1302
- /**
1303
- * Force a number to stay within specific bounds
1304
- * @author Gabe Abrams
1305
- * @param num the number to move into the bounds
1306
- * @param min the minimum number in the bound
1307
- * @param max the maximum number in the bound
1308
- * @returns bounded number
1309
- */
1310
- const forceNumIntoBounds = (num, min, max) => {
1311
- return Math.max(min, Math.min(max, num));
1312
- };
1313
-
1314
1302
  /**
1315
1303
  * A very simple, lightweight date chooser
1316
1304
  * @author Gabe Abrams
@@ -1325,7 +1313,7 @@ const SimpleDateChooser = (props) => {
1325
1313
  var _a;
1326
1314
  /* -------------- Props ------------- */
1327
1315
  const { ariaLabel, name, month, day, year, onChange, chooseFromPast, } = props;
1328
- let numMonthsToShow = forceNumIntoBounds(((_a = props.numMonthsToShow) !== null && _a !== void 0 ? _a : 6), 1, 12);
1316
+ const numMonthsToShow = ((_a = props.numMonthsToShow) !== null && _a !== void 0 ? _a : 6);
1329
1317
  /*------------------------------------------------------------------------*/
1330
1318
  /* Render */
1331
1319
  /*------------------------------------------------------------------------*/
@@ -1389,7 +1377,7 @@ const SimpleDateChooser = (props) => {
1389
1377
  const dayOptions = [];
1390
1378
  choices.forEach((choice) => {
1391
1379
  // Create month option
1392
- monthOptions.push(React.createElement("option", { key: choice.month, value: choice.month, "aria-label": `choose ${choice.choiceName}`, onSelect: () => {
1380
+ monthOptions.push(React.createElement("option", { key: choice.month, value: `${choice.month}-${choice.year}`, "aria-label": `choose ${choice.choiceName}`, onSelect: () => {
1393
1381
  onChange(choice.month, choice.days[0], choice.year);
1394
1382
  } }, choice.choiceName));
1395
1383
  if (month === choice.month) {
@@ -1404,7 +1392,7 @@ const SimpleDateChooser = (props) => {
1404
1392
  }
1405
1393
  });
1406
1394
  return (React.createElement("div", { className: "SimpleDateChooser d-inline-block", "aria-label": `date chooser with selected date: ${month} ${day}, ${year}` },
1407
- React.createElement("select", { "aria-label": `month for ${ariaLabel}`, className: "custom-select d-inline-block mr-1", style: { width: 'auto' }, id: `SimpleDateChooser-${name}-month`, value: month, onChange: (e) => {
1395
+ React.createElement("select", { "aria-label": `month for ${ariaLabel}`, className: "custom-select d-inline-block mr-1", style: { width: 'auto' }, id: `SimpleDateChooser-${name}-month`, value: `${month}-${year}`, onChange: (e) => {
1408
1396
  const choice = choices[e.target.selectedIndex];
1409
1397
  // Change day, month, and year
1410
1398
  onChange(choice.month, choice.days[0], choice.year);
@@ -4163,6 +4151,18 @@ const floorToNumDecimals = (num, numDecimals) => {
4163
4151
  return (Math.floor(num * rounder) / rounder);
4164
4152
  };
4165
4153
 
4154
+ /**
4155
+ * Force a number to stay within specific bounds
4156
+ * @author Gabe Abrams
4157
+ * @param num the number to move into the bounds
4158
+ * @param min the minimum number in the bound
4159
+ * @param max the maximum number in the bound
4160
+ * @returns bounded number
4161
+ */
4162
+ const forceNumIntoBounds = (num, min, max) => {
4163
+ return Math.max(min, Math.min(max, num));
4164
+ };
4165
+
4166
4166
  /**
4167
4167
  * Pad a number's decimal with zeros on the right
4168
4168
  * (e.g. 5.2 becomes 5.20 with 2 digit padding)