schummar-table 0.39.2 → 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,90 +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
- padding: `calc(var(--spacing) * 0.1) calc(2 * var(--spacing))`,
718
- display: "flex",
719
- alignItems: "center",
720
- borderBottom: `1px solid #dfe2e9`,
721
- whiteSpace: "nowrap",
722
- overflow: "hidden",
723
- background: "white"
724
- });
725
- var defaultClasses = {
726
- table: (0, import_react4.css)({
727
- position: "relative",
728
- display: "grid"
729
- }),
730
- cell,
731
- cellFill: (0, import_react4.css)({
732
- borderBottom: `1px solid ${lightGray}`
733
- }),
734
- headerCell: (0, import_react4.css)(cell, {
735
- padding: `var(--spacing) 0 var(--spacing) calc(2 * var(--spacing))`,
736
- borderBottom: `1px solid #c9cfda`
737
- }),
738
- footerCell: (0, import_react4.css)(cell, {
739
- padding: `var(--spacing) calc(2 * var(--spacing))`,
740
- borderTop: `1px solid #c9cfda`,
741
- borderBottom: "none"
742
- }),
743
- firstCell: (0, import_react4.css)({
744
- justifyContent: "start"
745
- }),
746
- sticky: (0, import_react4.css)({
747
- position: "sticky",
748
- top: 0,
749
- zIndex: 2
750
- }),
751
- stickyBottom: (0, import_react4.css)({
752
- position: "sticky",
753
- bottom: 0,
754
- zIndex: 2
755
- }),
756
- headerFill: (0, import_react4.css)({
757
- borderBottom: `1px solid #c9cfda`,
758
- background: white
759
- }),
760
- footerFill: (0, import_react4.css)({
761
- borderTop: `1px solid #c9cfda`,
762
- background: white
763
- }),
764
- text: (0, import_react4.css)({
765
- minWidth: 0,
766
- overflow: "hidden",
767
- textOverflow: "ellipsis"
768
- }),
769
- card: (0, import_react4.css)({
770
- borderRadius: 4,
771
- boxShadow: "0px 3px 14px 2px rgb(0 0 0 / 12%)",
772
- background: "white"
773
- }),
774
- clearFiltersButton: (0, import_react4.css)({
775
- padding: `0 calc(2 * var(--spacing))`,
776
- fontWeight: "bold",
777
- position: "sticky",
778
- left: 0,
779
- maxWidth: "fit-content",
780
- gridColumn: "2/-1",
781
- button: {
782
- color: "var(--primaryMain) !important",
783
- border: "solid 1px",
784
- borderColor: "var(--primaryMain) !important",
785
- margin: "var(--spacing)"
786
- }
787
- }),
788
- details: (0, import_react4.css)(cell, {
789
- gridColumn: "1 / -1",
790
- whiteSpace: "normal"
791
- })
792
- };
793
-
794
714
  // src/theme/defaultTheme/button.tsx
795
715
  var import_jsx_runtime3 = require("@emotion/react/jsx-runtime");
796
716
  var Button = (_a) => {
@@ -826,9 +746,9 @@ var Button = (_a) => {
826
746
  }
827
747
  },
828
748
  variant === "outlined" && {
829
- border: `1px solid ${darkGray}`,
749
+ border: "1px solid var(--table-button-border, var(--table-border, #777777))",
830
750
  "&:disabled": {
831
- borderColor: lightGray
751
+ borderColor: "var(--table-button-border-disabled, #eeeeee)"
832
752
  }
833
753
  },
834
754
  variant === "contained" && {
@@ -931,6 +851,94 @@ var IconButton = (props) => {
931
851
  // src/theme/defaultTheme/popover.tsx
932
852
  var import_react5 = require("react");
933
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
934
942
  var import_jsx_runtime6 = require("@emotion/react/jsx-runtime");
935
943
  var MARGIN = 10;
936
944
  var MAX_OFFSET = 20;
@@ -1048,7 +1056,8 @@ var Popover = ({
1048
1056
  maxHeight
1049
1057
  }, position), {
1050
1058
  zIndex: zIndex + 1,
1051
- overflowY: "auto"
1059
+ overflowY: "auto",
1060
+ color: "var(--table-text-color)"
1052
1061
  }),
1053
1062
  hidden && { display: "none" },
1054
1063
  !position && { visibility: "hidden" }
@@ -1090,7 +1099,7 @@ var TextField = (_a) => {
1090
1099
  flex: 1,
1091
1100
  display: "flex",
1092
1101
  alignItems: "center",
1093
- border: `1px solid ${darkGray}`,
1102
+ border: "1px solid var(--table-textfield-border, var(--table-border, #777777))",
1094
1103
  borderRadius: 4
1095
1104
  },
1096
1105
  focus && { border: "2px solid var(--primaryMain)", margin: -1 }
@@ -1363,7 +1372,23 @@ function mergeThemes(...themes) {
1363
1372
  blocked: Object.assign({}, ...themes.map((theme) => {
1364
1373
  var _a;
1365
1374
  return (_a = theme.colors) == null ? void 0 : _a.blocked;
1366
- }))
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)
1367
1392
  },
1368
1393
  spacing: themes.map((theme) => theme.spacing).reverse().find((x) => x !== void 0)
1369
1394
  };
@@ -1646,7 +1671,11 @@ function useCssVariables() {
1646
1671
  "--secondaryContrastText": colors.secondary.contrastText,
1647
1672
  "--blockedMain": colors.blocked.main,
1648
1673
  "--blockedLight": colors.blocked.light,
1649
- "--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
1650
1679
  };
1651
1680
  });
1652
1681
  }
@@ -1762,7 +1791,18 @@ function AutoFocusTextField(props) {
1762
1791
  ref.current.focus();
1763
1792
  }
1764
1793
  }, [isActive]);
1765
- 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
+ );
1766
1806
  }
1767
1807
 
1768
1808
  // src/hooks/useFilter.ts
@@ -1968,6 +2008,12 @@ function DateInput({
1968
2008
  borderBottom: "2px solid transparent",
1969
2009
  outline: "none",
1970
2010
  fontSize: "inherit",
2011
+ backgroundColor: "inherit",
2012
+ color: "inherit",
2013
+ "::placeholder": {
2014
+ color: "inherit",
2015
+ opacity: 0.5
2016
+ },
1971
2017
  "&:focus": {
1972
2018
  borderBottom: "2px solid var(--primaryMain)"
1973
2019
  }
@@ -2169,10 +2215,11 @@ function DatePicker(props) {
2169
2215
  border: "none",
2170
2216
  background: "transparent",
2171
2217
  cursor: disabled ? void 0 : "pointer",
2172
- font: "inherit"
2218
+ font: "inherit",
2219
+ color: "inherit"
2173
2220
  },
2174
2221
  (prevMonth || nextMonth) && {
2175
- color: gray
2222
+ color: "var(--date-picker-disemphasized, #bdbdbd)"
2176
2223
  },
2177
2224
  today2 && {
2178
2225
  outline: "1px solid var(--secondaryMain)"
@@ -2230,6 +2277,9 @@ function DatePicker(props) {
2230
2277
  {
2231
2278
  variant: "text",
2232
2279
  type: "button",
2280
+ css: {
2281
+ color: "inherit"
2282
+ },
2233
2283
  onClick: () => {
2234
2284
  setDirty(void 0);
2235
2285
  if (value2 instanceof Function) {
@@ -2299,185 +2349,197 @@ function DatePicker(props) {
2299
2349
  const { format } = new Intl.DateTimeFormat(locale, { year: "numeric" });
2300
2350
  return (year) => format(new Date(year, 0, 1));
2301
2351
  }, [locale]);
2302
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { css: cssVariables, children: [
2303
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2304
- "div",
2305
- {
2306
- css: {
2307
- display: "grid",
2308
- gridAutoFlow: "column",
2309
- justifyContent: "center",
2310
- alignItems: "baseline",
2311
- gap: "var(--spacing)"
2312
- },
2313
- children: [
2314
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2315
- 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",
2316
2398
  {
2317
- value: min != null ? min : null,
2318
- onChange: (date) => set(date != null ? date : void 0, max, "min"),
2319
- 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
+ ]
2320
2415
  }
2321
2416
  ),
2322
- rangeSelect && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
2323
- " - ",
2324
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2325
- DateInput,
2326
- {
2327
- value: max != null ? max : null,
2328
- onChange: (date) => set(min, date != null ? date : void 0, "max"),
2329
- locale
2330
- }
2331
- )
2332
- ] })
2333
- ]
2334
- }
2335
- ),
2336
- calendars.map(({ month, year, weeks }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { css: { display: "grid" }, children: [
2337
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2338
- "div",
2339
- {
2340
- css: {
2341
- margin: "calc(var(--spacing) * 4) 0",
2342
- display: "grid",
2343
- gridAutoFlow: "column",
2344
- justifyContent: "space-between",
2345
- alignItems: "center"
2346
- },
2347
- children: [
2348
- /* @__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)" } }) })),
2349
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { css: { display: "flex" }, children: [
2350
- formatMonth(month),
2351
- " ",
2352
- formatYear(year)
2353
- ] }),
2354
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconButton2, __spreadProps(__spreadValues({ type: "button" }, getForwardProps({ calendars })), { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ChevronRight2, {}) }))
2355
- ]
2356
- }
2357
- ),
2358
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2359
- "div",
2360
- {
2361
- css: {
2362
- justifySelf: "center",
2363
- display: "grid",
2364
- gridTemplateColumns: "repeat(8, max-content)"
2365
- },
2366
- children: [
2367
- showCalendarWeek ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2368
- "div",
2369
- {
2370
- css: {
2371
- justifySelf: "center",
2372
- padding: 10,
2373
- borderRight: `1px solid ${gray}`
2374
- },
2375
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { id: "calendarWeek" })
2376
- }
2377
- ) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", {}),
2378
- weekDays.map((_v, weekDay) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2379
- "div",
2380
- {
2381
- css: {
2382
- justifySelf: "center",
2383
- padding: 10
2384
- },
2385
- 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)"
2386
2424
  },
2387
- weekDay
2388
- )),
2389
- weeks.map((week, index) => {
2390
- const weekStart = week[0];
2391
- const weekEnd = week[6];
2392
- const weekDisabled = !rangeSelect || minDate && weekEnd.date < minDate || maxDate && weekStart.date > maxDate;
2393
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react18.Fragment, { children: [
2425
+ children: [
2394
2426
  showCalendarWeek ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2395
- "button",
2427
+ "div",
2396
2428
  {
2397
- type: "button",
2398
2429
  css: {
2430
+ justifySelf: "center",
2399
2431
  padding: 10,
2400
- border: "none",
2401
- background: "transparent",
2402
- cursor: weekDisabled ? void 0 : "pointer",
2403
- font: "inherit",
2404
- borderRight: `1px solid ${gray}`
2405
- },
2406
- onClick: () => {
2407
- if (weekDisabled) {
2408
- return;
2409
- }
2410
- const min2 = minDate && weekStart.date < minDate ? minDate : weekStart.date;
2411
- const max2 = maxDate && weekEnd.date > maxDate ? maxDate : weekEnd.date;
2412
- set(min2, max2);
2432
+ borderRight: "1px solid var(--date-picker-separator, var(--table-border, #bdbdbd))"
2413
2433
  },
2414
- onPointerOver: () => !weekDisabled && setHovered({ min: weekStart.date, max: weekEnd.date }),
2415
- onPointerOut: () => !weekDisabled && setHovered(void 0),
2416
- children: getCalendarWeek(weekEnd.date)
2434
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { id: "calendarWeek" })
2417
2435
  }
2418
2436
  ) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", {}),
2419
- week.map((dateObject, dayIndex) => {
2420
- if (!dateObject) {
2421
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", {}, dayIndex);
2422
- }
2423
- const { prevMonth, nextMonth, date } = dateObject;
2424
- const today2 = startOfDay(date).getTime() === now.getTime();
2425
- const disabled = minDate && date < minDate || maxDate && date > maxDate;
2426
- const selected = date.getTime() === (min == null ? void 0 : min.getTime()) || min && max && dateIntersect(date, { min, max });
2427
- const preSelected = !selected && !disabled && (dateIntersect(date, hovered) || min && !max && hovered && dateIntersect(
2428
- date,
2429
- min <= hovered.min ? { min, max: hovered.min } : { min: hovered.max, max: min }
2430
- ));
2431
- const blocked = blockedRanges.some((range) => dateIntersect(date, range));
2432
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2433
- "button",
2434
- __spreadProps(__spreadValues({
2435
- type: "button",
2436
- css: getDayCssStyles({
2437
- disabled,
2438
- prevMonth,
2439
- nextMonth,
2440
- today: today2,
2441
- blocked,
2442
- selected,
2443
- preSelected
2444
- })
2445
- }, getDateProps({ dateObj: dateObject })), {
2446
- onClick: () => {
2447
- if (dirty) {
2448
- if (min) set(min, date);
2449
- else set(date, max);
2450
- } else {
2451
- set(date);
2452
- }
2453
- },
2454
- onPointerOver: () => setHovered({ min: date, max: date }),
2455
- onPointerOut: () => setHovered(void 0),
2456
- disabled,
2457
- children: date.getDate()
2458
- }),
2459
- `${index}-${dayIndex}`
2460
- );
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);
2461
2523
  })
2462
- ] }, index);
2463
- })
2464
- ]
2465
- }
2466
- )
2467
- ] }, `${month}${year}`)),
2468
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2469
- "div",
2470
- {
2471
- css: {
2472
- marginTop: "var(--spacing)",
2473
- display: "grid",
2474
- gridAutoFlow: "column",
2475
- justifyContent: "center"
2476
- },
2477
- children: resolvedQuickOptions
2478
- }
2479
- )
2480
- ] });
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
+ );
2481
2543
  }
2482
2544
 
2483
2545
  // src/components/dateFilter.tsx
@@ -2589,7 +2651,7 @@ function NumberField(_a) {
2589
2651
  const [value = printNumber(commitedValue, locale), setValue] = (0, import_react19.useState)();
2590
2652
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2591
2653
  TextField2,
2592
- __spreadValues({
2654
+ __spreadProps(__spreadValues({
2593
2655
  value,
2594
2656
  onChange: (event) => {
2595
2657
  if (Pattern.test(event.target.value)) {
@@ -2600,7 +2662,14 @@ function NumberField(_a) {
2600
2662
  onChange == null ? void 0 : onChange(parseNumber(value));
2601
2663
  setValue(void 0);
2602
2664
  }
2603
- }, textFieldProps)
2665
+ }, textFieldProps), {
2666
+ css: {
2667
+ input: {
2668
+ backgroundColor: "inherit",
2669
+ color: "inherit"
2670
+ }
2671
+ }
2672
+ })
2604
2673
  );
2605
2674
  }
2606
2675
 
@@ -2984,7 +3053,12 @@ function SelectFilter(_a) {
2984
3053
  disabled: value.size === 0,
2985
3054
  onClick: () => onChange(/* @__PURE__ */ new Set()),
2986
3055
  variant: "outlined",
2987
- css: { justifyContent: "center", width: "100%", marginBottom: "var(--spacing)" },
3056
+ css: {
3057
+ justifyContent: "center",
3058
+ width: "100%",
3059
+ marginBottom: "var(--spacing)",
3060
+ color: "inherit"
3061
+ },
2988
3062
  children: deselectAll
2989
3063
  }
2990
3064
  ),
@@ -4528,7 +4602,7 @@ var Row = (0, import_react37.memo)(function Row2({
4528
4602
  return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { css: { display: "contents" }, children: [
4529
4603
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: className2, css: [defaultClasses.cellFill, css_], ref: divRef }),
4530
4604
  /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: className2, css: [defaultClasses.cell, defaultClasses.firstCell, css_], children: [
4531
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { css: { width: indent * 20 } }),
4605
+ indent > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { css: { width: indent * 20 } }),
4532
4606
  enableSelection && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SelectComponent, { itemId }),
4533
4607
  (hasChildren || hasDeferredChildren || hasDetails) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ExpandControl, { itemId, hasDeferredChildren }),
4534
4608
  rowAction
@@ -4753,8 +4827,10 @@ var TableInner = (0, import_react39.memo)(function TableInner2({ hidden }) {
4753
4827
  enableSelection && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SelectComponent, {}),
4754
4828
  enableColumnSelection && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ColumnSelection, {}),
4755
4829
  enableExport && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Export2, {}),
4756
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { css: { flex: 1 } }),
4757
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ResizeHandleView, {})
4830
+ (enableSelection || enableColumnSelection || enableExport) && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
4831
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { css: { flex: 1 } }),
4832
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ResizeHandleView, {})
4833
+ ] })
4758
4834
  ]
4759
4835
  }
4760
4836
  ),