@idds/react 1.1.98 → 1.1.100

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.es.js CHANGED
@@ -4709,7 +4709,8 @@ function Table({
4709
4709
  rowClickable = false,
4710
4710
  onRowClick,
4711
4711
  lastColumnSticky = false,
4712
- renderSortIndicator
4712
+ renderSortIndicator,
4713
+ emptyState = "No data found"
4713
4714
  }) {
4714
4715
  const [data, setData] = useState([]);
4715
4716
  const [total, setTotal] = useState(0);
@@ -4960,7 +4961,7 @@ function Table({
4960
4961
  {
4961
4962
  colSpan: selectable ? columns.length + 1 : columns.length,
4962
4963
  className: "ina-table__empty-cell",
4963
- children: "No data found"
4964
+ children: emptyState
4964
4965
  }
4965
4966
  ) }) : data.map((row, index) => {
4966
4967
  const key = String(row[rowKey]);
@@ -9114,6 +9115,7 @@ function DatePicker({
9114
9115
  setTempStartDate(null);
9115
9116
  setIsOpen(false);
9116
9117
  } else {
9118
+ onChange(["", ""]);
9117
9119
  setTempStartDate(date);
9118
9120
  }
9119
9121
  } else if (mode === "multiple") {
@@ -9272,11 +9274,13 @@ function DatePicker({
9272
9274
  if (tempStartDate && isSameDate(date, tempStartDate)) {
9273
9275
  return true;
9274
9276
  }
9275
- if (selectedDates.length === 1) {
9276
- return isSameDate(date, selectedDates[0]);
9277
- } else if (selectedDates.length === 2) {
9278
- const [start, end] = selectedDates;
9279
- return isSameDate(date, start) || isSameDate(date, end);
9277
+ if (!tempStartDate) {
9278
+ if (selectedDates.length === 1) {
9279
+ return isSameDate(date, selectedDates[0]);
9280
+ } else if (selectedDates.length === 2) {
9281
+ const [start, end] = selectedDates;
9282
+ return isSameDate(date, start) || isSameDate(date, end);
9283
+ }
9280
9284
  }
9281
9285
  return false;
9282
9286
  } else {
@@ -9285,9 +9289,14 @@ function DatePicker({
9285
9289
  };
9286
9290
  const isDateInRange = (date) => {
9287
9291
  if (!date) return false;
9288
- if (mode === "range" && selectedDates.length === 2) {
9289
- const [start, end] = selectedDates;
9290
- return date > start && date < end;
9292
+ if (mode === "range") {
9293
+ if (tempStartDate) {
9294
+ return false;
9295
+ }
9296
+ if (selectedDates.length === 2) {
9297
+ const [start, end] = selectedDates;
9298
+ return date > start && date < end;
9299
+ }
9291
9300
  }
9292
9301
  return false;
9293
9302
  };
@@ -9308,14 +9317,19 @@ function DatePicker({
9308
9317
  };
9309
9318
  const getRangePosition = (date) => {
9310
9319
  if (!date) return "none";
9311
- if (mode === "range" && selectedDates.length === 2) {
9312
- const [start, end] = selectedDates;
9313
- if (isSameDate(date, start) && isSameDate(date, end)) {
9314
- return "single";
9315
- }
9316
- if (isSameDate(date, start)) return "start";
9317
- if (isSameDate(date, end)) return "end";
9318
- if (date > start && date < end) return "middle";
9320
+ if (mode === "range") {
9321
+ if (tempStartDate && isSameDate(date, tempStartDate)) {
9322
+ return "start";
9323
+ }
9324
+ if (!tempStartDate && selectedDates.length === 2) {
9325
+ const [start, end] = selectedDates;
9326
+ if (isSameDate(date, start) && isSameDate(date, end)) {
9327
+ return "single";
9328
+ }
9329
+ if (isSameDate(date, start)) return "start";
9330
+ if (isSameDate(date, end)) return "end";
9331
+ if (date > start && date < end) return "middle";
9332
+ }
9319
9333
  }
9320
9334
  return "none";
9321
9335
  };