schummar-table 0.39.3 → 0.40.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
@@ -600,7 +600,11 @@ function useColumnContext() {
600
600
  var defaultColors = {
601
601
  primary: { main: "#1976d2", light: "#42a5f5", contrastText: "#fff" },
602
602
  secondary: { main: "#9c27b0", light: "#ba68c8", contrastText: "#fff" },
603
- blocked: { main: "#f44336", light: "#f26257", contrastText: "#fff" }
603
+ blocked: { main: "#f44336", light: "#f26257", contrastText: "#fff" },
604
+ background: "#ffffff",
605
+ text: "inherit",
606
+ border: "#777",
607
+ borderLight: "#eee"
604
608
  };
605
609
 
606
610
  // src/components/spinnner.tsx
@@ -707,94 +711,6 @@ var Badge = ({ badgeContent, children }) => {
707
711
  );
708
712
  };
709
713
 
710
- // src/theme/defaultTheme/defaultClasses.ts
711
- var import_react4 = require("@emotion/react");
712
- var white = "#ffffff";
713
- var lightGray = "#eeeeee";
714
- var gray = "#bdbdbd";
715
- var darkGray = "#777";
716
- var cell = (0, import_react4.css)({
717
- display: "flex",
718
- alignItems: "center",
719
- borderBottom: `1px solid #dfe2e9`,
720
- whiteSpace: "nowrap",
721
- overflow: "hidden",
722
- background: "white",
723
- "&:not(:empty)": {
724
- padding: `calc(var(--spacing) * 0.1) calc(2 * var(--spacing))`
725
- }
726
- });
727
- var defaultClasses = {
728
- table: (0, import_react4.css)({
729
- position: "relative",
730
- display: "grid"
731
- }),
732
- cell,
733
- cellFill: (0, import_react4.css)({
734
- borderBottom: `1px solid ${lightGray}`
735
- }),
736
- headerCell: (0, import_react4.css)(cell, {
737
- borderBottom: `1px solid #c9cfda`,
738
- "&:not(:empty)": {
739
- padding: `var(--spacing) 0 var(--spacing) calc(2 * var(--spacing))`
740
- }
741
- }),
742
- footerCell: (0, import_react4.css)(cell, {
743
- padding: `var(--spacing) calc(2 * var(--spacing))`,
744
- borderTop: `1px solid #c9cfda`,
745
- borderBottom: "none"
746
- }),
747
- firstCell: (0, import_react4.css)({
748
- justifyContent: "start"
749
- }),
750
- sticky: (0, import_react4.css)({
751
- position: "sticky",
752
- top: 0,
753
- zIndex: 2
754
- }),
755
- stickyBottom: (0, import_react4.css)({
756
- position: "sticky",
757
- bottom: 0,
758
- zIndex: 2
759
- }),
760
- headerFill: (0, import_react4.css)({
761
- borderBottom: `1px solid #c9cfda`,
762
- background: white
763
- }),
764
- footerFill: (0, import_react4.css)({
765
- borderTop: `1px solid #c9cfda`,
766
- background: white
767
- }),
768
- text: (0, import_react4.css)({
769
- minWidth: 0,
770
- overflow: "hidden",
771
- textOverflow: "ellipsis"
772
- }),
773
- card: (0, import_react4.css)({
774
- borderRadius: 4,
775
- boxShadow: "0px 3px 14px 2px rgb(0 0 0 / 12%)",
776
- background: "white"
777
- }),
778
- clearFiltersButton: (0, import_react4.css)({
779
- padding: `0 calc(2 * var(--spacing))`,
780
- fontWeight: "bold",
781
- position: "sticky",
782
- left: 0,
783
- maxWidth: "fit-content",
784
- gridColumn: "2/-1",
785
- button: {
786
- color: "var(--primaryMain) !important",
787
- border: "solid 1px",
788
- borderColor: "var(--primaryMain) !important",
789
- margin: "var(--spacing)"
790
- }
791
- }),
792
- details: (0, import_react4.css)(cell, {
793
- gridColumn: "1 / -1",
794
- whiteSpace: "normal"
795
- })
796
- };
797
-
798
714
  // src/theme/defaultTheme/button.tsx
799
715
  var import_jsx_runtime3 = require("@emotion/react/jsx-runtime");
800
716
  var Button = (_a) => {
@@ -830,9 +746,9 @@ var Button = (_a) => {
830
746
  }
831
747
  },
832
748
  variant === "outlined" && {
833
- border: `1px solid ${darkGray}`,
749
+ border: "1px solid var(--table-button-border, var(--table-border, #777777))",
834
750
  "&:disabled": {
835
- borderColor: lightGray
751
+ borderColor: "var(--table-button-border-disabled, #eeeeee)"
836
752
  }
837
753
  },
838
754
  variant === "contained" && {
@@ -935,6 +851,94 @@ var IconButton = (props) => {
935
851
  // src/theme/defaultTheme/popover.tsx
936
852
  var import_react5 = require("react");
937
853
  var import_react_dom = require("react-dom");
854
+
855
+ // src/theme/defaultTheme/defaultClasses.ts
856
+ var import_react4 = require("@emotion/react");
857
+ var cell = (0, import_react4.css)({
858
+ display: "flex",
859
+ alignItems: "center",
860
+ borderBottom: "1px solid var(--table-border-light-color)",
861
+ whiteSpace: "nowrap",
862
+ overflow: "hidden",
863
+ background: "var(--table-background-color)",
864
+ "&:not(:empty)": {
865
+ padding: `calc(var(--spacing) * 0.1) calc(2 * var(--spacing))`
866
+ }
867
+ });
868
+ var defaultClasses = {
869
+ table: (0, import_react4.css)({
870
+ position: "relative",
871
+ display: "grid",
872
+ color: "var(--table-text-color)"
873
+ }),
874
+ cell,
875
+ cellFill: (0, import_react4.css)({
876
+ borderBottom: "1px solid var(--table-border-light-color)",
877
+ background: "var(--table-background-color)"
878
+ }),
879
+ headerCell: (0, import_react4.css)(cell, {
880
+ borderBottom: "1px solid var(--table-border-color)",
881
+ "&:not(:empty)": {
882
+ padding: `var(--spacing) 0 var(--spacing) calc(2 * var(--spacing))`
883
+ }
884
+ }),
885
+ footerCell: (0, import_react4.css)(cell, {
886
+ padding: `var(--spacing) calc(2 * var(--spacing))`,
887
+ borderTop: "1px solid var(--table-border-color)",
888
+ borderBottom: "none"
889
+ }),
890
+ firstCell: (0, import_react4.css)({
891
+ justifyContent: "start"
892
+ }),
893
+ sticky: (0, import_react4.css)({
894
+ position: "sticky",
895
+ top: 0,
896
+ zIndex: 2
897
+ }),
898
+ stickyBottom: (0, import_react4.css)({
899
+ position: "sticky",
900
+ bottom: 0,
901
+ zIndex: 2
902
+ }),
903
+ headerFill: (0, import_react4.css)({
904
+ borderBottom: "1px solid var(--table-border-color)",
905
+ background: "var(--table-background-color)"
906
+ }),
907
+ footerFill: (0, import_react4.css)({
908
+ borderTop: "1px solid var(--table-border-color)",
909
+ background: "var(--table-background-color)"
910
+ }),
911
+ text: (0, import_react4.css)({
912
+ minWidth: 0,
913
+ overflow: "hidden",
914
+ textOverflow: "ellipsis"
915
+ }),
916
+ card: (0, import_react4.css)({
917
+ borderRadius: 4,
918
+ boxShadow: "0px 3px 14px 2px rgb(0 0 0 / 12%)",
919
+ background: "var(--table-background-color)"
920
+ }),
921
+ clearFiltersButton: (0, import_react4.css)({
922
+ padding: `0 calc(2 * var(--spacing))`,
923
+ fontWeight: "bold",
924
+ position: "sticky",
925
+ left: 0,
926
+ maxWidth: "fit-content",
927
+ gridColumn: "2/-1",
928
+ button: {
929
+ color: "var(--primaryMain) !important",
930
+ border: "solid 1px",
931
+ borderColor: "var(--primaryMain) !important",
932
+ margin: "var(--spacing)"
933
+ }
934
+ }),
935
+ details: (0, import_react4.css)(cell, {
936
+ gridColumn: "1 / -1",
937
+ whiteSpace: "normal"
938
+ })
939
+ };
940
+
941
+ // src/theme/defaultTheme/popover.tsx
938
942
  var import_jsx_runtime6 = require("@emotion/react/jsx-runtime");
939
943
  var MARGIN = 10;
940
944
  var MAX_OFFSET = 20;
@@ -1052,7 +1056,8 @@ var Popover = ({
1052
1056
  maxHeight
1053
1057
  }, position), {
1054
1058
  zIndex: zIndex + 1,
1055
- overflowY: "auto"
1059
+ overflowY: "auto",
1060
+ color: "var(--table-text-color)"
1056
1061
  }),
1057
1062
  hidden && { display: "none" },
1058
1063
  !position && { visibility: "hidden" }
@@ -1094,7 +1099,7 @@ var TextField = (_a) => {
1094
1099
  flex: 1,
1095
1100
  display: "flex",
1096
1101
  alignItems: "center",
1097
- border: `1px solid ${darkGray}`,
1102
+ border: "1px solid var(--table-textfield-border, var(--table-border, #777777))",
1098
1103
  borderRadius: 4
1099
1104
  },
1100
1105
  focus && { border: "2px solid var(--primaryMain)", margin: -1 }
@@ -1367,7 +1372,23 @@ function mergeThemes(...themes) {
1367
1372
  blocked: Object.assign({}, ...themes.map((theme) => {
1368
1373
  var _a;
1369
1374
  return (_a = theme.colors) == null ? void 0 : _a.blocked;
1370
- }))
1375
+ })),
1376
+ background: themes.map((theme) => {
1377
+ var _a;
1378
+ return (_a = theme.colors) == null ? void 0 : _a.background;
1379
+ }).reverse().find((x) => x !== void 0),
1380
+ text: themes.map((theme) => {
1381
+ var _a;
1382
+ return (_a = theme.colors) == null ? void 0 : _a.text;
1383
+ }).reverse().find((x) => x !== void 0),
1384
+ border: themes.map((theme) => {
1385
+ var _a;
1386
+ return (_a = theme.colors) == null ? void 0 : _a.border;
1387
+ }).reverse().find((x) => x !== void 0),
1388
+ borderLight: themes.map((theme) => {
1389
+ var _a;
1390
+ return (_a = theme.colors) == null ? void 0 : _a.borderLight;
1391
+ }).reverse().find((x) => x !== void 0)
1371
1392
  },
1372
1393
  spacing: themes.map((theme) => theme.spacing).reverse().find((x) => x !== void 0)
1373
1394
  };
@@ -1650,7 +1671,11 @@ function useCssVariables() {
1650
1671
  "--secondaryContrastText": colors.secondary.contrastText,
1651
1672
  "--blockedMain": colors.blocked.main,
1652
1673
  "--blockedLight": colors.blocked.light,
1653
- "--blockedContrastText": colors.blocked.contrastText
1674
+ "--blockedContrastText": colors.blocked.contrastText,
1675
+ "--table-background-color": colors.background,
1676
+ "--table-text-color": colors.text,
1677
+ "--table-border-color": colors.border,
1678
+ "--table-border-light-color": colors.borderLight
1654
1679
  };
1655
1680
  });
1656
1681
  }
@@ -1766,7 +1791,18 @@ function AutoFocusTextField(props) {
1766
1791
  ref.current.focus();
1767
1792
  }
1768
1793
  }, [isActive]);
1769
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TextField2, __spreadProps(__spreadValues({}, props), { inputRef: ref }));
1794
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1795
+ TextField2,
1796
+ __spreadProps(__spreadValues({}, props), {
1797
+ inputRef: ref,
1798
+ css: {
1799
+ input: {
1800
+ backgroundColor: "inherit",
1801
+ color: "inherit"
1802
+ }
1803
+ }
1804
+ })
1805
+ );
1770
1806
  }
1771
1807
 
1772
1808
  // src/hooks/useFilter.ts
@@ -1972,6 +2008,12 @@ function DateInput({
1972
2008
  borderBottom: "2px solid transparent",
1973
2009
  outline: "none",
1974
2010
  fontSize: "inherit",
2011
+ backgroundColor: "inherit",
2012
+ color: "inherit",
2013
+ "::placeholder": {
2014
+ color: "inherit",
2015
+ opacity: 0.5
2016
+ },
1975
2017
  "&:focus": {
1976
2018
  borderBottom: "2px solid var(--primaryMain)"
1977
2019
  }
@@ -2173,10 +2215,11 @@ function DatePicker(props) {
2173
2215
  border: "none",
2174
2216
  background: "transparent",
2175
2217
  cursor: disabled ? void 0 : "pointer",
2176
- font: "inherit"
2218
+ font: "inherit",
2219
+ color: "inherit"
2177
2220
  },
2178
2221
  (prevMonth || nextMonth) && {
2179
- color: gray
2222
+ color: "var(--date-picker-disemphasized, #bdbdbd)"
2180
2223
  },
2181
2224
  today2 && {
2182
2225
  outline: "1px solid var(--secondaryMain)"
@@ -2234,6 +2277,9 @@ function DatePicker(props) {
2234
2277
  {
2235
2278
  variant: "text",
2236
2279
  type: "button",
2280
+ css: {
2281
+ color: "inherit"
2282
+ },
2237
2283
  onClick: () => {
2238
2284
  setDirty(void 0);
2239
2285
  if (value2 instanceof Function) {
@@ -2303,185 +2349,197 @@ function DatePicker(props) {
2303
2349
  const { format } = new Intl.DateTimeFormat(locale, { year: "numeric" });
2304
2350
  return (year) => format(new Date(year, 0, 1));
2305
2351
  }, [locale]);
2306
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { css: cssVariables, children: [
2307
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2308
- "div",
2309
- {
2310
- css: {
2311
- display: "grid",
2312
- gridAutoFlow: "column",
2313
- justifyContent: "center",
2314
- alignItems: "baseline",
2315
- gap: "var(--spacing)"
2316
- },
2317
- children: [
2318
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2319
- DateInput,
2352
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2353
+ "div",
2354
+ {
2355
+ css: [
2356
+ cssVariables,
2357
+ {
2358
+ color: "var(--table-text-color)"
2359
+ }
2360
+ ],
2361
+ children: [
2362
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2363
+ "div",
2364
+ {
2365
+ css: {
2366
+ display: "grid",
2367
+ gridAutoFlow: "column",
2368
+ justifyContent: "center",
2369
+ alignItems: "baseline",
2370
+ gap: "var(--spacing)"
2371
+ },
2372
+ children: [
2373
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2374
+ DateInput,
2375
+ {
2376
+ value: min != null ? min : null,
2377
+ onChange: (date) => set(date != null ? date : void 0, max, "min"),
2378
+ locale
2379
+ }
2380
+ ),
2381
+ rangeSelect && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
2382
+ " - ",
2383
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2384
+ DateInput,
2385
+ {
2386
+ value: max != null ? max : null,
2387
+ onChange: (date) => set(min, date != null ? date : void 0, "max"),
2388
+ locale
2389
+ }
2390
+ )
2391
+ ] })
2392
+ ]
2393
+ }
2394
+ ),
2395
+ calendars.map(({ month, year, weeks }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { css: { display: "grid" }, children: [
2396
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2397
+ "div",
2320
2398
  {
2321
- value: min != null ? min : null,
2322
- onChange: (date) => set(date != null ? date : void 0, max, "min"),
2323
- locale
2399
+ css: {
2400
+ margin: "calc(var(--spacing) * 4) 0",
2401
+ display: "grid",
2402
+ gridAutoFlow: "column",
2403
+ justifyContent: "space-between",
2404
+ alignItems: "center"
2405
+ },
2406
+ children: [
2407
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconButton2, __spreadProps(__spreadValues({ type: "button" }, getBackProps({ calendars })), { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ChevronRight2, { css: { transform: "rotate3d(0, 0, 1, 180deg)" } }) })),
2408
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { css: { display: "flex" }, children: [
2409
+ formatMonth(month),
2410
+ " ",
2411
+ formatYear(year)
2412
+ ] }),
2413
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconButton2, __spreadProps(__spreadValues({ type: "button" }, getForwardProps({ calendars })), { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ChevronRight2, {}) }))
2414
+ ]
2324
2415
  }
2325
2416
  ),
2326
- rangeSelect && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
2327
- " - ",
2328
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2329
- DateInput,
2330
- {
2331
- value: max != null ? max : null,
2332
- onChange: (date) => set(min, date != null ? date : void 0, "max"),
2333
- locale
2334
- }
2335
- )
2336
- ] })
2337
- ]
2338
- }
2339
- ),
2340
- calendars.map(({ month, year, weeks }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { css: { display: "grid" }, children: [
2341
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2342
- "div",
2343
- {
2344
- css: {
2345
- margin: "calc(var(--spacing) * 4) 0",
2346
- display: "grid",
2347
- gridAutoFlow: "column",
2348
- justifyContent: "space-between",
2349
- alignItems: "center"
2350
- },
2351
- children: [
2352
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconButton2, __spreadProps(__spreadValues({ type: "button" }, getBackProps({ calendars })), { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ChevronRight2, { css: { transform: "rotate3d(0, 0, 1, 180deg)" } }) })),
2353
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { css: { display: "flex" }, children: [
2354
- formatMonth(month),
2355
- " ",
2356
- formatYear(year)
2357
- ] }),
2358
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconButton2, __spreadProps(__spreadValues({ type: "button" }, getForwardProps({ calendars })), { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ChevronRight2, {}) }))
2359
- ]
2360
- }
2361
- ),
2362
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2363
- "div",
2364
- {
2365
- css: {
2366
- justifySelf: "center",
2367
- display: "grid",
2368
- gridTemplateColumns: "repeat(8, max-content)"
2369
- },
2370
- children: [
2371
- showCalendarWeek ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2372
- "div",
2373
- {
2374
- css: {
2375
- justifySelf: "center",
2376
- padding: 10,
2377
- borderRight: `1px solid ${gray}`
2378
- },
2379
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { id: "calendarWeek" })
2380
- }
2381
- ) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", {}),
2382
- weekDays.map((_v, weekDay) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2383
- "div",
2384
- {
2385
- css: {
2386
- justifySelf: "center",
2387
- padding: 10
2388
- },
2389
- children: formatWeekday(weekDay)
2417
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2418
+ "div",
2419
+ {
2420
+ css: {
2421
+ justifySelf: "center",
2422
+ display: "grid",
2423
+ gridTemplateColumns: "repeat(8, max-content)"
2390
2424
  },
2391
- weekDay
2392
- )),
2393
- weeks.map((week, index) => {
2394
- const weekStart = week[0];
2395
- const weekEnd = week[6];
2396
- const weekDisabled = !rangeSelect || minDate && weekEnd.date < minDate || maxDate && weekStart.date > maxDate;
2397
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react18.Fragment, { children: [
2425
+ children: [
2398
2426
  showCalendarWeek ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2399
- "button",
2427
+ "div",
2400
2428
  {
2401
- type: "button",
2402
2429
  css: {
2430
+ justifySelf: "center",
2403
2431
  padding: 10,
2404
- border: "none",
2405
- background: "transparent",
2406
- cursor: weekDisabled ? void 0 : "pointer",
2407
- font: "inherit",
2408
- borderRight: `1px solid ${gray}`
2432
+ borderRight: "1px solid var(--date-picker-separator, var(--table-border, #bdbdbd))"
2409
2433
  },
2410
- onClick: () => {
2411
- if (weekDisabled) {
2412
- return;
2413
- }
2414
- const min2 = minDate && weekStart.date < minDate ? minDate : weekStart.date;
2415
- const max2 = maxDate && weekEnd.date > maxDate ? maxDate : weekEnd.date;
2416
- set(min2, max2);
2417
- },
2418
- onPointerOver: () => !weekDisabled && setHovered({ min: weekStart.date, max: weekEnd.date }),
2419
- onPointerOut: () => !weekDisabled && setHovered(void 0),
2420
- children: getCalendarWeek(weekEnd.date)
2434
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { id: "calendarWeek" })
2421
2435
  }
2422
2436
  ) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", {}),
2423
- week.map((dateObject, dayIndex) => {
2424
- if (!dateObject) {
2425
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", {}, dayIndex);
2426
- }
2427
- const { prevMonth, nextMonth, date } = dateObject;
2428
- const today2 = startOfDay(date).getTime() === now.getTime();
2429
- const disabled = minDate && date < minDate || maxDate && date > maxDate;
2430
- const selected = date.getTime() === (min == null ? void 0 : min.getTime()) || min && max && dateIntersect(date, { min, max });
2431
- const preSelected = !selected && !disabled && (dateIntersect(date, hovered) || min && !max && hovered && dateIntersect(
2432
- date,
2433
- min <= hovered.min ? { min, max: hovered.min } : { min: hovered.max, max: min }
2434
- ));
2435
- const blocked = blockedRanges.some((range) => dateIntersect(date, range));
2436
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2437
- "button",
2438
- __spreadProps(__spreadValues({
2439
- type: "button",
2440
- css: getDayCssStyles({
2441
- disabled,
2442
- prevMonth,
2443
- nextMonth,
2444
- today: today2,
2445
- blocked,
2446
- selected,
2447
- preSelected
2448
- })
2449
- }, getDateProps({ dateObj: dateObject })), {
2450
- onClick: () => {
2451
- if (dirty) {
2452
- if (min) set(min, date);
2453
- else set(date, max);
2454
- } else {
2455
- set(date);
2456
- }
2457
- },
2458
- onPointerOver: () => setHovered({ min: date, max: date }),
2459
- onPointerOut: () => setHovered(void 0),
2460
- disabled,
2461
- children: date.getDate()
2462
- }),
2463
- `${index}-${dayIndex}`
2464
- );
2437
+ weekDays.map((_v, weekDay) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2438
+ "div",
2439
+ {
2440
+ css: {
2441
+ justifySelf: "center",
2442
+ padding: 10
2443
+ },
2444
+ children: formatWeekday(weekDay)
2445
+ },
2446
+ weekDay
2447
+ )),
2448
+ weeks.map((week, index) => {
2449
+ const weekStart = week[0];
2450
+ const weekEnd = week[6];
2451
+ const weekDisabled = !rangeSelect || minDate && weekEnd.date < minDate || maxDate && weekStart.date > maxDate;
2452
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react18.Fragment, { children: [
2453
+ showCalendarWeek ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2454
+ "button",
2455
+ {
2456
+ type: "button",
2457
+ css: {
2458
+ padding: 10,
2459
+ border: "none",
2460
+ background: "transparent",
2461
+ cursor: weekDisabled ? void 0 : "pointer",
2462
+ font: "inherit",
2463
+ borderRight: "1px solid var(--date-picker-separator, var(--table-border, #bdbdbd))",
2464
+ color: "inherit"
2465
+ },
2466
+ onClick: () => {
2467
+ if (weekDisabled) {
2468
+ return;
2469
+ }
2470
+ const min2 = minDate && weekStart.date < minDate ? minDate : weekStart.date;
2471
+ const max2 = maxDate && weekEnd.date > maxDate ? maxDate : weekEnd.date;
2472
+ set(min2, max2);
2473
+ },
2474
+ onPointerOver: () => !weekDisabled && setHovered({ min: weekStart.date, max: weekEnd.date }),
2475
+ onPointerOut: () => !weekDisabled && setHovered(void 0),
2476
+ children: getCalendarWeek(weekEnd.date)
2477
+ }
2478
+ ) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", {}),
2479
+ week.map((dateObject, dayIndex) => {
2480
+ if (!dateObject) {
2481
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", {}, dayIndex);
2482
+ }
2483
+ const { prevMonth, nextMonth, date } = dateObject;
2484
+ const today2 = startOfDay(date).getTime() === now.getTime();
2485
+ const disabled = minDate && date < minDate || maxDate && date > maxDate;
2486
+ const selected = date.getTime() === (min == null ? void 0 : min.getTime()) || min && max && dateIntersect(date, { min, max });
2487
+ const preSelected = !selected && !disabled && (dateIntersect(date, hovered) || min && !max && hovered && dateIntersect(
2488
+ date,
2489
+ min <= hovered.min ? { min, max: hovered.min } : { min: hovered.max, max: min }
2490
+ ));
2491
+ const blocked = blockedRanges.some((range) => dateIntersect(date, range));
2492
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2493
+ "button",
2494
+ __spreadProps(__spreadValues({
2495
+ type: "button",
2496
+ css: getDayCssStyles({
2497
+ disabled,
2498
+ prevMonth,
2499
+ nextMonth,
2500
+ today: today2,
2501
+ blocked,
2502
+ selected,
2503
+ preSelected
2504
+ })
2505
+ }, getDateProps({ dateObj: dateObject })), {
2506
+ onClick: () => {
2507
+ if (dirty) {
2508
+ if (min) set(min, date);
2509
+ else set(date, max);
2510
+ } else {
2511
+ set(date);
2512
+ }
2513
+ },
2514
+ onPointerOver: () => setHovered({ min: date, max: date }),
2515
+ onPointerOut: () => setHovered(void 0),
2516
+ disabled,
2517
+ children: date.getDate()
2518
+ }),
2519
+ `${index}-${dayIndex}`
2520
+ );
2521
+ })
2522
+ ] }, index);
2465
2523
  })
2466
- ] }, index);
2467
- })
2468
- ]
2469
- }
2470
- )
2471
- ] }, `${month}${year}`)),
2472
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2473
- "div",
2474
- {
2475
- css: {
2476
- marginTop: "var(--spacing)",
2477
- display: "grid",
2478
- gridAutoFlow: "column",
2479
- justifyContent: "center"
2480
- },
2481
- children: resolvedQuickOptions
2482
- }
2483
- )
2484
- ] });
2524
+ ]
2525
+ }
2526
+ )
2527
+ ] }, `${month}${year}`)),
2528
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2529
+ "div",
2530
+ {
2531
+ css: {
2532
+ marginTop: "var(--spacing)",
2533
+ display: "grid",
2534
+ gridAutoFlow: "column",
2535
+ justifyContent: "center"
2536
+ },
2537
+ children: resolvedQuickOptions
2538
+ }
2539
+ )
2540
+ ]
2541
+ }
2542
+ );
2485
2543
  }
2486
2544
 
2487
2545
  // src/components/dateFilter.tsx
@@ -2593,7 +2651,7 @@ function NumberField(_a) {
2593
2651
  const [value = printNumber(commitedValue, locale), setValue] = (0, import_react19.useState)();
2594
2652
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2595
2653
  TextField2,
2596
- __spreadValues({
2654
+ __spreadProps(__spreadValues({
2597
2655
  value,
2598
2656
  onChange: (event) => {
2599
2657
  if (Pattern.test(event.target.value)) {
@@ -2604,7 +2662,14 @@ function NumberField(_a) {
2604
2662
  onChange == null ? void 0 : onChange(parseNumber(value));
2605
2663
  setValue(void 0);
2606
2664
  }
2607
- }, textFieldProps)
2665
+ }, textFieldProps), {
2666
+ css: {
2667
+ input: {
2668
+ backgroundColor: "inherit",
2669
+ color: "inherit"
2670
+ }
2671
+ }
2672
+ })
2608
2673
  );
2609
2674
  }
2610
2675
 
@@ -2988,7 +3053,12 @@ function SelectFilter(_a) {
2988
3053
  disabled: value.size === 0,
2989
3054
  onClick: () => onChange(/* @__PURE__ */ new Set()),
2990
3055
  variant: "outlined",
2991
- css: { justifyContent: "center", width: "100%", marginBottom: "var(--spacing)" },
3056
+ css: {
3057
+ justifyContent: "center",
3058
+ width: "100%",
3059
+ marginBottom: "var(--spacing)",
3060
+ color: "inherit"
3061
+ },
2992
3062
  children: deselectAll
2993
3063
  }
2994
3064
  ),