schummar-table 0.41.0 → 0.42.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 +31 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +31 -29
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -40,6 +40,7 @@ type DatePickerProps = {
|
|
|
40
40
|
defaultDateInView?: Date;
|
|
41
41
|
/** Show buttons to quickly select suggested dates or date ranges */
|
|
42
42
|
quickOptions?: DatePickerQuickOption[];
|
|
43
|
+
noReset?: boolean;
|
|
43
44
|
/** Minimum selectable date */
|
|
44
45
|
/** Date ranges that are visually marked as blocked */
|
|
45
46
|
blockedRanges?: DateRange[];
|
package/dist/index.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ type DatePickerProps = {
|
|
|
40
40
|
defaultDateInView?: Date;
|
|
41
41
|
/** Show buttons to quickly select suggested dates or date ranges */
|
|
42
42
|
quickOptions?: DatePickerQuickOption[];
|
|
43
|
+
noReset?: boolean;
|
|
43
44
|
/** Minimum selectable date */
|
|
44
45
|
/** Date ranges that are visually marked as blocked */
|
|
45
46
|
blockedRanges?: DateRange[];
|
package/dist/index.js
CHANGED
|
@@ -1290,6 +1290,7 @@ function DatePicker(props) {
|
|
|
1290
1290
|
firstDayOfWeek = 1,
|
|
1291
1291
|
defaultDateInView,
|
|
1292
1292
|
quickOptions = ["today", "thisWeek"],
|
|
1293
|
+
noReset,
|
|
1293
1294
|
minDate,
|
|
1294
1295
|
maxDate,
|
|
1295
1296
|
showCalendarWeek,
|
|
@@ -1373,37 +1374,38 @@ function DatePicker(props) {
|
|
|
1373
1374
|
}
|
|
1374
1375
|
const min = dirty ? dirty.min : value instanceof Date ? value : value == null ? void 0 : value.min;
|
|
1375
1376
|
const max = dirty ? dirty.max : value instanceof Date ? value : value == null ? void 0 : value.max;
|
|
1376
|
-
const resolvedQuickOptions = [
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1377
|
+
const resolvedQuickOptions = [
|
|
1378
|
+
...quickOptions,
|
|
1379
|
+
...noReset ? [] : [{ label: /* @__PURE__ */ jsx13(Text, { id: "reset" }), value: null }]
|
|
1380
|
+
].map((option, index) => {
|
|
1381
|
+
if (option instanceof Function) {
|
|
1382
|
+
return option((value3) => {
|
|
1383
|
+
setDirty(void 0);
|
|
1384
|
+
onChange(value3, "quickOption");
|
|
1385
|
+
});
|
|
1386
|
+
}
|
|
1387
|
+
const { label, value: value2 } = typeof option === "string" ? commonQuickOptions[option] : option;
|
|
1388
|
+
return /* @__PURE__ */ jsx13(
|
|
1389
|
+
Button2,
|
|
1390
|
+
{
|
|
1391
|
+
variant: "text",
|
|
1392
|
+
type: "button",
|
|
1393
|
+
css: {
|
|
1394
|
+
color: "inherit"
|
|
1395
|
+
},
|
|
1396
|
+
onClick: () => {
|
|
1380
1397
|
setDirty(void 0);
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
Button2,
|
|
1387
|
-
{
|
|
1388
|
-
variant: "text",
|
|
1389
|
-
type: "button",
|
|
1390
|
-
css: {
|
|
1391
|
-
color: "inherit"
|
|
1392
|
-
},
|
|
1393
|
-
onClick: () => {
|
|
1394
|
-
setDirty(void 0);
|
|
1395
|
-
if (value2 instanceof Function) {
|
|
1396
|
-
onChange(value2(props), "quickOption");
|
|
1397
|
-
} else {
|
|
1398
|
-
onChange(value2, "quickOption");
|
|
1399
|
-
}
|
|
1400
|
-
},
|
|
1401
|
-
children: label
|
|
1398
|
+
if (value2 instanceof Function) {
|
|
1399
|
+
onChange(value2(props), "quickOption");
|
|
1400
|
+
} else {
|
|
1401
|
+
onChange(value2, "quickOption");
|
|
1402
|
+
}
|
|
1402
1403
|
},
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1404
|
+
children: label
|
|
1405
|
+
},
|
|
1406
|
+
index
|
|
1407
|
+
);
|
|
1408
|
+
});
|
|
1407
1409
|
const { calendars, getBackProps, getForwardProps, getDateProps } = useDayzed({
|
|
1408
1410
|
onDateSelected: () => void 0,
|
|
1409
1411
|
firstDayOfWeek,
|