schummar-table 0.40.6 → 0.41.0

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
@@ -2187,7 +2187,7 @@ function DatePicker(props) {
2187
2187
  showCalendarWeek,
2188
2188
  blockedRanges = []
2189
2189
  } = defaults(props, context);
2190
- function onChange(value2) {
2190
+ function onChange(value2, source) {
2191
2191
  if (value2 instanceof Date) {
2192
2192
  value2 = dateClamp(value2, minDate, maxDate);
2193
2193
  } else if (value2) {
@@ -2196,7 +2196,7 @@ function DatePicker(props) {
2196
2196
  max: dateClamp(value2.max, minDate, maxDate)
2197
2197
  };
2198
2198
  }
2199
- props.onChange(value2);
2199
+ props.onChange(value2, source);
2200
2200
  }
2201
2201
  const Button2 = useTheme((t2) => t2.components.Button);
2202
2202
  const IconButton2 = useTheme((t2) => t2.components.IconButton);
@@ -2270,7 +2270,7 @@ function DatePicker(props) {
2270
2270
  if (option instanceof Function) {
2271
2271
  return option((value3) => {
2272
2272
  setDirty(void 0);
2273
- onChange(value3);
2273
+ onChange(value3, "quickOption");
2274
2274
  });
2275
2275
  }
2276
2276
  const { label, value: value2 } = typeof option === "string" ? commonQuickOptions[option] : option;
@@ -2285,9 +2285,9 @@ function DatePicker(props) {
2285
2285
  onClick: () => {
2286
2286
  setDirty(void 0);
2287
2287
  if (value2 instanceof Function) {
2288
- onChange(value2(props));
2288
+ onChange(value2(props), "quickOption");
2289
2289
  } else {
2290
- onChange(value2);
2290
+ onChange(value2, "quickOption");
2291
2291
  }
2292
2292
  },
2293
2293
  children: label
@@ -2322,9 +2322,9 @@ function DatePicker(props) {
2322
2322
  setDirty(void 0);
2323
2323
  }
2324
2324
  }, [rangeSelect]);
2325
- function set(min2, max2, edit) {
2325
+ function set(source, min2, max2, edit) {
2326
2326
  if (!rangeSelect) {
2327
- onChange(min2 != null ? min2 : null);
2327
+ onChange(min2 != null ? min2 : null, source);
2328
2328
  return;
2329
2329
  }
2330
2330
  if (min2 && max2 && min2 > max2) {
@@ -2338,7 +2338,7 @@ function DatePicker(props) {
2338
2338
  }
2339
2339
  if (!min2 === !max2) {
2340
2340
  setDirty(void 0);
2341
- onChange(min2 && max2 ? { min: min2, max: endOfDay(max2) } : null);
2341
+ onChange(min2 && max2 ? { min: min2, max: endOfDay(max2) } : null, source);
2342
2342
  } else {
2343
2343
  setDirty({ min: min2, max: max2 });
2344
2344
  }
@@ -2376,7 +2376,7 @@ function DatePicker(props) {
2376
2376
  DateInput,
2377
2377
  {
2378
2378
  value: min != null ? min : null,
2379
- onChange: (date) => set(date != null ? date : void 0, max, "min"),
2379
+ onChange: (date) => set("input", date != null ? date : void 0, max, "min"),
2380
2380
  locale
2381
2381
  }
2382
2382
  ),
@@ -2386,7 +2386,7 @@ function DatePicker(props) {
2386
2386
  DateInput,
2387
2387
  {
2388
2388
  value: max != null ? max : null,
2389
- onChange: (date) => set(min, date != null ? date : void 0, "max"),
2389
+ onChange: (date) => set("input", min, date != null ? date : void 0, "max"),
2390
2390
  locale
2391
2391
  }
2392
2392
  )
@@ -2471,7 +2471,7 @@ function DatePicker(props) {
2471
2471
  }
2472
2472
  const min2 = minDate && weekStart.date < minDate ? minDate : weekStart.date;
2473
2473
  const max2 = maxDate && weekEnd.date > maxDate ? maxDate : weekEnd.date;
2474
- set(min2, max2);
2474
+ set("calendarWeek", min2, max2);
2475
2475
  },
2476
2476
  onPointerOver: () => !weekDisabled && setHovered({ min: weekStart.date, max: weekEnd.date }),
2477
2477
  onPointerOut: () => !weekDisabled && setHovered(void 0),
@@ -2507,10 +2507,10 @@ function DatePicker(props) {
2507
2507
  }, getDateProps({ dateObj: dateObject })), {
2508
2508
  onClick: () => {
2509
2509
  if (dirty) {
2510
- if (min) set(min, date);
2511
- else set(date, max);
2510
+ if (min) set("calendar", min, date);
2511
+ else set("calendar", date, max);
2512
2512
  } else {
2513
- set(date);
2513
+ set("calendar", date);
2514
2514
  }
2515
2515
  },
2516
2516
  onPointerOver: () => setHovered({ min: date, max: date }),