@homebound/beam 3.2.0-alpha.2 → 3.2.0-alpha.3

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 CHANGED
@@ -7922,6 +7922,7 @@ var RowState = class {
7922
7922
  };
7923
7923
 
7924
7924
  // src/components/Table/utils/sortRows.ts
7925
+ var import_temporal_polyfill2 = require("temporal-polyfill");
7925
7926
  function sortRows(columns, rows, sortState, caseSensitive) {
7926
7927
  const fn = sortFn(columns, sortState, caseSensitive);
7927
7928
  const sorted = [...rows].sort(fn);
@@ -7986,7 +7987,7 @@ function sortValue(value, caseSensitive) {
7986
7987
  if (maybeFn instanceof Function) {
7987
7988
  maybeFn = maybeFn();
7988
7989
  }
7989
- return typeof maybeFn === "string" && !caseSensitive ? maybeFn.toLowerCase() : maybeFn;
7990
+ return normalizeSortValue(maybeFn, caseSensitive);
7990
7991
  }
7991
7992
  function ensureClientSideSortValueIsSortable(sortOn, isHeader, column2, idx, maybeContent) {
7992
7993
  if (process.env.NODE_ENV !== "production" && !isHeader && sortOn === "client" && column2.clientSideSort !== false) {
@@ -8001,7 +8002,24 @@ function ensureClientSideSortValueIsSortable(sortOn, isHeader, column2, idx, may
8001
8002
  }
8002
8003
  function canClientSideSort(value) {
8003
8004
  const t = typeof value;
8004
- return value === null || t === "undefined" || t === "number" || t === "string" || t === "boolean" || value instanceof Date;
8005
+ return value === null || t === "undefined" || t === "number" || t === "string" || t === "bigint" || t === "boolean" || value instanceof Date || isPlainDate2(value) || isZonedDateTime(value);
8006
+ }
8007
+ function normalizeSortValue(value, caseSensitive) {
8008
+ if (isPlainDate2(value)) {
8009
+ return value.toString();
8010
+ } else if (isZonedDateTime(value)) {
8011
+ return value.epochNanoseconds;
8012
+ } else if (typeof value === "string" && !caseSensitive) {
8013
+ return value.toLowerCase();
8014
+ } else {
8015
+ return value;
8016
+ }
8017
+ }
8018
+ function isPlainDate2(value) {
8019
+ return value instanceof import_temporal_polyfill2.Temporal.PlainDate;
8020
+ }
8021
+ function isZonedDateTime(value) {
8022
+ return value instanceof import_temporal_polyfill2.Temporal.ZonedDateTime;
8005
8023
  }
8006
8024
 
8007
8025
  // src/components/Table/components/Row.tsx
@@ -12615,7 +12633,7 @@ function CheckboxGroupItem(props) {
12615
12633
  var import_react50 = require("react");
12616
12634
 
12617
12635
  // src/inputs/DateFields/utils.ts
12618
- var import_temporal_polyfill2 = require("temporal-polyfill");
12636
+ var import_temporal_polyfill3 = require("temporal-polyfill");
12619
12637
  var dateFormats = {
12620
12638
  short: "shortDate",
12621
12639
  medium: "shortWeekdayMonthDay",
@@ -12642,7 +12660,7 @@ function parseDateRange(str, format) {
12642
12660
  const [from = "", to = ""] = str.split("-");
12643
12661
  const fromDate = parseDateString(from.trim(), format);
12644
12662
  const toDate = parseDateString(to.trim(), format);
12645
- if (toDate && fromDate && import_temporal_polyfill2.Temporal.PlainDate.compare(toDate, fromDate) < 0) {
12663
+ if (toDate && fromDate && import_temporal_polyfill3.Temporal.PlainDate.compare(toDate, fromDate) < 0) {
12646
12664
  return { from: toDate, to: fromDate };
12647
12665
  }
12648
12666
  if (toDate === void 0 && fromDate === void 0) {
@@ -12669,7 +12687,7 @@ function parseDateString(str, format) {
12669
12687
  return void 0;
12670
12688
  }
12671
12689
  try {
12672
- return import_temporal_polyfill2.Temporal.PlainDate.from({
12690
+ return import_temporal_polyfill3.Temporal.PlainDate.from({
12673
12691
  year: yearLength === 2 ? normalizeTwoDigitYear(year, todayPlainDate().year) : year,
12674
12692
  month,
12675
12693
  day