@helpwave/hightide 0.4.0 → 0.5.1

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.js CHANGED
@@ -6262,12 +6262,16 @@ __export(index_exports, {
6262
6262
  DatePicker: () => DatePicker,
6263
6263
  DatePickerUncontrolled: () => DatePickerUncontrolled,
6264
6264
  DateProperty: () => DateProperty,
6265
+ DateTimeInput: () => DateTimeInput,
6266
+ DateTimeInputUncontrolled: () => DateTimeInputUncontrolled,
6265
6267
  DateTimePicker: () => DateTimePicker,
6268
+ DateUtils: () => DateUtils,
6266
6269
  DayPicker: () => DayPicker,
6267
6270
  DayPickerUncontrolled: () => DayPickerUncontrolled,
6268
6271
  Dialog: () => Dialog,
6269
6272
  DiscardChangesDialog: () => DiscardChangesDialog,
6270
6273
  DividerInserter: () => DividerInserter,
6274
+ Duration: () => Duration,
6271
6275
  EaseFunctions: () => EaseFunctions,
6272
6276
  ErrorComponent: () => ErrorComponent,
6273
6277
  Expandable: () => Expandable,
@@ -6365,6 +6369,7 @@ __export(index_exports, {
6365
6369
  Transition: () => Transition,
6366
6370
  UseValidators: () => UseValidators,
6367
6371
  VerticalDivider: () => VerticalDivider,
6372
+ Visibility: () => Visibility,
6368
6373
  YearMonthPicker: () => YearMonthPicker,
6369
6374
  YearMonthPickerUncontrolled: () => YearMonthPickerUncontrolled,
6370
6375
  addDuration: () => addDuration,
@@ -6374,19 +6379,16 @@ __export(index_exports, {
6374
6379
  closestMatch: () => closestMatch,
6375
6380
  createLoopingList: () => createLoopingList,
6376
6381
  createLoopingListWithIndex: () => createLoopingListWithIndex,
6377
- equalDate: () => equalDate,
6378
6382
  equalSizeGroups: () => equalSizeGroups,
6379
6383
  formatDate: () => formatDate,
6380
6384
  formatDateTime: () => formatDateTime,
6381
6385
  getBetweenDuration: () => getBetweenDuration,
6382
- getDaysInMonth: () => getDaysInMonth,
6383
6386
  getNeighbours: () => getNeighbours,
6384
6387
  getWeeksForCalenderMonth: () => getWeeksForCalenderMonth,
6385
6388
  hightideTranslation: () => hightideTranslation,
6386
6389
  hightideTranslationLocales: () => hightideTranslationLocales,
6387
6390
  isInTimeSpan: () => isInTimeSpan,
6388
6391
  match: () => match,
6389
- monthsList: () => monthsList,
6390
6392
  noop: () => noop,
6391
6393
  range: () => range,
6392
6394
  resolveSetState: () => resolveSetState,
@@ -6416,7 +6418,6 @@ __export(index_exports, {
6416
6418
  useTranslatedValidators: () => useTranslatedValidators,
6417
6419
  useZIndexRegister: () => useZIndexRegister,
6418
6420
  validateEmail: () => validateEmail,
6419
- weekDayList: () => weekDayList,
6420
6421
  writeToClipboard: () => writeToClipboard
6421
6422
  });
6422
6423
  module.exports = __toCommonJS(index_exports);
@@ -6674,10 +6675,6 @@ var formatDateTime = (date) => {
6674
6675
  const minutes = date.getMinutes().toString().padStart(2, "0");
6675
6676
  return `${dateString}T${hours}:${minutes}`;
6676
6677
  };
6677
- var getDaysInMonth = (year, month) => {
6678
- const lastDayOfMonth = new Date(year, month + 1, 0);
6679
- return lastDayOfMonth.getDate();
6680
- };
6681
6678
  var changeDuration = (date, duration, isAdding) => {
6682
6679
  const {
6683
6680
  years = 0,
@@ -6787,6 +6784,51 @@ var getWeeksForCalenderMonth = (date, weekStart, weeks = 6) => {
6787
6784
  }
6788
6785
  return equalSizeGroups(dayList, 7);
6789
6786
  };
6787
+ var formatGerman = (date, showTime) => {
6788
+ const d = new Intl.DateTimeFormat("de-DE", {
6789
+ day: "2-digit",
6790
+ month: "2-digit",
6791
+ year: "numeric"
6792
+ }).format(date);
6793
+ if (!showTime) return d;
6794
+ const t = new Intl.DateTimeFormat("de-DE", {
6795
+ hour: "2-digit",
6796
+ minute: "2-digit"
6797
+ }).format(date);
6798
+ return `${d} um ${t} Uhr`;
6799
+ };
6800
+ var formatAbsolute = (date, locale, showTime) => {
6801
+ if (locale === "de-DE") {
6802
+ return formatGerman(date, showTime);
6803
+ }
6804
+ const options = {
6805
+ year: "numeric",
6806
+ month: "numeric",
6807
+ day: "numeric"
6808
+ };
6809
+ if (showTime) {
6810
+ options.hour = "numeric";
6811
+ options.minute = "numeric";
6812
+ }
6813
+ return new Intl.DateTimeFormat(locale, options).format(date);
6814
+ };
6815
+ var formatRelative = (date, locale, showTime) => {
6816
+ const rtf = new Intl.RelativeTimeFormat(locale, { numeric: "auto" });
6817
+ const now = /* @__PURE__ */ new Date();
6818
+ const diffInSeconds = (date.getTime() - now.getTime()) / 1e3;
6819
+ if (Math.abs(diffInSeconds) < 60) return rtf.format(Math.round(diffInSeconds), "second");
6820
+ if (Math.abs(diffInSeconds) < 3600) return rtf.format(Math.round(diffInSeconds / 60), "minute");
6821
+ if (Math.abs(diffInSeconds) < 86400) return rtf.format(Math.round(diffInSeconds / 3600), "hour");
6822
+ if (Math.abs(diffInSeconds) < 604800) return rtf.format(Math.round(diffInSeconds / 86400), "day");
6823
+ return formatAbsolute(date, locale, showTime);
6824
+ };
6825
+ var DateUtils = {
6826
+ monthsList,
6827
+ weekDayList,
6828
+ equalDate,
6829
+ formatAbsolute,
6830
+ formatRelative
6831
+ };
6790
6832
 
6791
6833
  // src/components/date/DatePicker.tsx
6792
6834
  var import_clsx7 = __toESM(require("clsx"));
@@ -6969,6 +7011,16 @@ var hightideTranslation = {
6969
7011
  "remove": `Entfernen`,
6970
7012
  "required": `Erforderlich`,
6971
7013
  "reset": `Zur\xFCcksetzen`,
7014
+ "rSortingOrderAfter": ({ otherSortings }) => {
7015
+ let _out = "";
7016
+ _out += `Angewendet `;
7017
+ _out += import_internationalization.TranslationGen.resolvePlural(otherSortings, {
7018
+ "=0": `als prim\xE4re Sortierung`,
7019
+ "=1": `nach ${otherSortings} anderen Sortierung`,
7020
+ "other": `nach ${otherSortings} anderen Sortierungen`
7021
+ });
7022
+ return _out;
7023
+ },
6972
7024
  "save": `Speichern`,
6973
7025
  "saved": `Gespeichert`,
6974
7026
  "search": `Suche`,
@@ -7205,6 +7257,16 @@ var hightideTranslation = {
7205
7257
  "remove": `Remove`,
7206
7258
  "required": `Required`,
7207
7259
  "reset": `Reset`,
7260
+ "rSortingOrderAfter": ({ otherSortings }) => {
7261
+ let _out = "";
7262
+ _out += `Applied `;
7263
+ _out += import_internationalization.TranslationGen.resolvePlural(otherSortings, {
7264
+ "=0": `as the first sorting`,
7265
+ "=1": `after ${otherSortings} other sorting`,
7266
+ "other": `after ${otherSortings} other sortings`
7267
+ });
7268
+ return _out;
7269
+ },
7208
7270
  "save": `Save`,
7209
7271
  "saved": `Saved`,
7210
7272
  "search": `Search`,
@@ -7503,6 +7565,7 @@ var Button = (0, import_react4.forwardRef)(function SolidButton({
7503
7565
  startIcon,
7504
7566
  endIcon,
7505
7567
  disabled,
7568
+ allowClickEventPropagation = false,
7506
7569
  className,
7507
7570
  ...restProps
7508
7571
  }, ref) {
@@ -7525,6 +7588,12 @@ var Button = (0, import_react4.forwardRef)(function SolidButton({
7525
7588
  paddingMapping[layout][size],
7526
7589
  className
7527
7590
  ),
7591
+ onClick: (event) => {
7592
+ if (!allowClickEventPropagation) {
7593
+ event.stopPropagation();
7594
+ }
7595
+ restProps?.onClick(event);
7596
+ },
7528
7597
  disabled,
7529
7598
  children: [
7530
7599
  startIcon,
@@ -7553,8 +7622,8 @@ var DayPicker = ({
7553
7622
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_clsx4.default)("flex-col-1 min-w-[220px] select-none", className), children: [
7554
7623
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex-row-2 text-center", children: weeks[0].map((weekDay, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex-1 font-semibold", children: new Intl.DateTimeFormat(locale, { weekday: "long" }).format(weekDay).substring(0, 2) }, index)) }),
7555
7624
  weeks.map((week, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex-row-2 text-center", children: week.map((date) => {
7556
- const isSelected = !!selected && equalDate(selected, date);
7557
- const isToday = equalDate(/* @__PURE__ */ new Date(), date);
7625
+ const isSelected = !!selected && DateUtils.equalDate(selected, date);
7626
+ const isToday = DateUtils.equalDate(/* @__PURE__ */ new Date(), date);
7558
7627
  const isSameMonth = date.getMonth() === month;
7559
7628
  const isDayValid = isInTimeSpan(date, start, end);
7560
7629
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
@@ -7754,8 +7823,9 @@ var YearMonthPicker = ({
7754
7823
  label: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: (0, import_clsx6.default)({ "text-primary font-bold": selectedYear }), children: year }),
7755
7824
  isExpanded: showValueOpen && selectedYear,
7756
7825
  contentClassName: "gap-y-1",
7757
- children: equalSizeGroups([...monthsList], 3).map((monthList, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex-row-1", children: monthList.map((month) => {
7758
- const monthIndex = monthsList.indexOf(month);
7826
+ contentExpandedClassName: "!p-2",
7827
+ children: equalSizeGroups([...DateUtils.monthsList], 3).map((monthList, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex-row-1", children: monthList.map((month) => {
7828
+ const monthIndex = DateUtils.monthsList.indexOf(month);
7759
7829
  const newDate = new Date(year, monthIndex);
7760
7830
  const selectedMonth = selectedYear && monthIndex === displayedYearMonth.getMonth();
7761
7831
  const firstOfMonth = new Date(year, monthIndex, 1);
@@ -8054,7 +8124,7 @@ var TimePicker = ({
8054
8124
  transformer(newDate);
8055
8125
  onChange?.(newDate);
8056
8126
  };
8057
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: (0, import_clsx8.default)("flex-row-2 w-fit min-w-[150px] select-none overflow-hidden", className), children: [
8127
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: (0, import_clsx8.default)("flex-row-2 select-none overflow-hidden", className), children: [
8058
8128
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex-col-1 h-full overflow-y-auto min-w-16", children: hours.map((hour) => {
8059
8129
  const isSelected = hour === time.getHours() - (!is24HourFormat && isPM ? 12 : 0);
8060
8130
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
@@ -10383,7 +10453,9 @@ function CarouselTabs({
10383
10453
  "button",
10384
10454
  {
10385
10455
  id: `${id}-tab-${index}`,
10386
- ref: (el) => tabRefs.current[index] = el,
10456
+ ref: (el) => {
10457
+ tabRefs.current[index] = el;
10458
+ },
10387
10459
  onClick: () => onChange(index),
10388
10460
  onKeyDown: (e) => handleKeyDown(e, index),
10389
10461
  className: (0, import_clsx19.default)(
@@ -11329,7 +11401,9 @@ function TabView({ children, outerDivProps, onTabChanged, initialTabIndex = 0, .
11329
11401
  "aria-controls": `${t.id}-panel`,
11330
11402
  id: `${t.id}-tab`,
11331
11403
  tabIndex: active === t.id ? 0 : -1,
11332
- ref: (el) => buttonRefs.current[t.id] = el,
11404
+ ref: (el) => {
11405
+ buttonRefs.current[t.id] = el;
11406
+ },
11333
11407
  onClick: () => setActive(t.id),
11334
11408
  onKeyDown: (e) => onKeyDown(e, t.id),
11335
11409
  className: (0, import_clsx24.default)(
@@ -11468,6 +11542,14 @@ var VerticalDivider = ({
11468
11542
  ) });
11469
11543
  };
11470
11544
 
11545
+ // src/components/layout/Visibility.tsx
11546
+ function Visibility({ children, isVisible }) {
11547
+ if (isVisible) {
11548
+ return children;
11549
+ }
11550
+ return void 0;
11551
+ }
11552
+
11471
11553
  // src/components/loading-states/ErrorComponent.tsx
11472
11554
  var import_lucide_react8 = require("lucide-react");
11473
11555
  var import_clsx26 = __toESM(require("clsx"));
@@ -11649,7 +11731,7 @@ var NavigationItemWithSubItem = ({
11649
11731
  ...options
11650
11732
  }) => {
11651
11733
  const [isOpen, setOpen] = (0, import_react33.useState)(false);
11652
- const containerRef = (0, import_react33.useRef)();
11734
+ const containerRef = (0, import_react33.useRef)(null);
11653
11735
  const triggerRef = (0, import_react33.useRef)(null);
11654
11736
  const id = (0, import_react33.useId)();
11655
11737
  const style = useFloatingElement({
@@ -12563,8 +12645,8 @@ var TableFilters = {
12563
12645
  };
12564
12646
 
12565
12647
  // src/components/table/Table.tsx
12566
- var import_react42 = require("react");
12567
- var import_clsx47 = __toESM(require("clsx"));
12648
+ var import_react43 = require("react");
12649
+ var import_clsx48 = __toESM(require("clsx"));
12568
12650
  var import_react_table = require("@tanstack/react-table");
12569
12651
 
12570
12652
  // src/components/table/TableCell.tsx
@@ -12590,43 +12672,195 @@ var useResizeCallbackWrapper = (callback) => {
12590
12672
 
12591
12673
  // src/components/table/TableSortButton.tsx
12592
12674
  var import_lucide_react20 = require("lucide-react");
12593
- var import_clsx45 = __toESM(require("clsx"));
12675
+ var import_clsx46 = __toESM(require("clsx"));
12676
+
12677
+ // src/components/user-action/Tooltip.tsx
12678
+ var import_react38 = require("react");
12679
+ var import_clsx45 = require("clsx");
12680
+ var import_react_dom4 = require("react-dom");
12594
12681
  var import_jsx_runtime57 = require("react/jsx-runtime");
12682
+ var Tooltip = ({
12683
+ tooltip,
12684
+ children,
12685
+ appearDelay = 400,
12686
+ disappearDelay = 50,
12687
+ tooltipClassName = "",
12688
+ containerClassName = "",
12689
+ position = "bottom",
12690
+ disabled = false
12691
+ }) => {
12692
+ const [state, setState] = (0, import_react38.useState)({
12693
+ isShown: false,
12694
+ timer: null
12695
+ });
12696
+ const { isShown } = state;
12697
+ const anchorRef = (0, import_react38.useRef)(null);
12698
+ const containerRef = (0, import_react38.useRef)(null);
12699
+ const triangleRef = (0, import_react38.useRef)(null);
12700
+ const triangleSize = 0.375;
12701
+ const triangleClasses = {
12702
+ top: `border-t-tooltip-background border-l-transparent border-r-transparent`,
12703
+ bottom: `border-b-tooltip-background border-l-transparent border-r-transparent`,
12704
+ left: `border-l-tooltip-background border-t-transparent border-b-transparent`,
12705
+ right: `border-r-tooltip-background border-t-transparent border-b-transparent`
12706
+ };
12707
+ const triangleStyle = {
12708
+ top: {
12709
+ borderWidth: `${triangleSize}rem ${triangleSize}rem 0 ${triangleSize}rem`,
12710
+ transform: `translate(0,${triangleSize}rem)`
12711
+ },
12712
+ bottom: {
12713
+ borderWidth: `0 ${triangleSize}rem ${triangleSize}rem ${triangleSize}rem`,
12714
+ transform: `translate(0,-${triangleSize}rem)`
12715
+ },
12716
+ left: {
12717
+ borderWidth: `${triangleSize}rem 0 ${triangleSize}rem ${triangleSize}rem`,
12718
+ transform: `translate(${triangleSize}rem,0)`
12719
+ },
12720
+ right: {
12721
+ borderWidth: `${triangleSize}rem ${triangleSize}rem ${triangleSize}rem 0`,
12722
+ transform: `translate(-${triangleSize}rem,0)`
12723
+ }
12724
+ };
12725
+ const isActive = !disabled && isShown;
12726
+ const css = useFloatingElement({
12727
+ active: isActive,
12728
+ anchorRef,
12729
+ containerRef,
12730
+ horizontalAlignment: position === "left" ? "beforeStart" : position === "right" ? "afterEnd" : "center",
12731
+ verticalAlignment: position === "top" ? "beforeStart" : position === "bottom" ? "afterEnd" : "center"
12732
+ });
12733
+ const cssTriangle = useFloatingElement({
12734
+ active: isActive,
12735
+ anchorRef,
12736
+ containerRef: triangleRef,
12737
+ horizontalAlignment: position === "left" ? "beforeStart" : position === "right" ? "afterEnd" : "center",
12738
+ verticalAlignment: position === "top" ? "beforeStart" : position === "bottom" ? "afterEnd" : "center"
12739
+ });
12740
+ const zIndex = useZIndexRegister(isActive);
12741
+ const zIndexTriangle = useZIndexRegister(isActive);
12742
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
12743
+ "div",
12744
+ {
12745
+ ref: anchorRef,
12746
+ className: (0, import_clsx45.clsx)("relative inline-block", containerClassName),
12747
+ onPointerEnter: () => setState((prevState) => {
12748
+ if (prevState.isShown) {
12749
+ return prevState;
12750
+ }
12751
+ return {
12752
+ ...prevState,
12753
+ timer: setTimeout(() => {
12754
+ setState((prevState2) => {
12755
+ clearTimeout(prevState2.timer);
12756
+ return { isShown: true, timer: null };
12757
+ });
12758
+ }, appearDelay)
12759
+ };
12760
+ }),
12761
+ onPointerLeave: () => setState((prevState) => {
12762
+ clearTimeout(prevState.timer);
12763
+ return {
12764
+ ...prevState,
12765
+ timer: setTimeout(() => {
12766
+ setState((prevState2) => {
12767
+ clearTimeout(prevState2.timer);
12768
+ return { isShown: false, timer: null };
12769
+ });
12770
+ }, disappearDelay)
12771
+ };
12772
+ }),
12773
+ children: [
12774
+ children,
12775
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Visibility, { isVisible: isActive, children: [
12776
+ (0, import_react_dom4.createPortal)(
12777
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
12778
+ "div",
12779
+ {
12780
+ ref: containerRef,
12781
+ className: (0, import_clsx45.clsx)(
12782
+ `opacity-0 absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded
12783
+ animate-tooltip-fade-in shadow-around-md bg-tooltip-background`,
12784
+ tooltipClassName
12785
+ ),
12786
+ style: { ...css, zIndex, animationDelay: appearDelay + "ms" },
12787
+ children: tooltip
12788
+ }
12789
+ ),
12790
+ document.body
12791
+ ),
12792
+ (0, import_react_dom4.createPortal)(
12793
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
12794
+ "div",
12795
+ {
12796
+ ref: triangleRef,
12797
+ className: (0, import_clsx45.clsx)(`absolute w-0 h-0 opacity-0 animate-tooltip-fade-in`, triangleClasses[position]),
12798
+ style: {
12799
+ ...cssTriangle,
12800
+ ...triangleStyle[position],
12801
+ zIndex: zIndexTriangle,
12802
+ animationDelay: appearDelay + "ms"
12803
+ }
12804
+ }
12805
+ ),
12806
+ document.body
12807
+ )
12808
+ ] })
12809
+ ]
12810
+ }
12811
+ );
12812
+ };
12813
+
12814
+ // src/components/table/TableSortButton.tsx
12815
+ var import_jsx_runtime58 = require("react/jsx-runtime");
12595
12816
  var TableSortButton = ({
12596
12817
  sortDirection,
12597
12818
  invert = false,
12598
12819
  color = "neutral",
12599
12820
  size = "tiny",
12600
12821
  className,
12601
- ...buttonProps
12822
+ sortingIndexDisplay,
12823
+ ...props
12602
12824
  }) => {
12603
- let icon = /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react20.ChevronsUpDown, { className: "w-full h-full" });
12825
+ const translation = useHightideTranslation();
12826
+ const { sortingsCount, index } = sortingIndexDisplay;
12827
+ let icon = /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_lucide_react20.ChevronsUpDown, { className: "size-4" });
12604
12828
  if (sortDirection) {
12605
12829
  let usedSortDirection = sortDirection;
12606
12830
  if (invert) {
12607
12831
  usedSortDirection = usedSortDirection === "desc" ? "asc" : "desc";
12608
12832
  }
12609
- icon = usedSortDirection === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react20.ChevronUp, { className: "w-full h-full" }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react20.ChevronDown, { className: "w-full h-full" });
12833
+ icon = usedSortDirection === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_lucide_react20.ChevronUp, { className: "size-4" }) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_lucide_react20.ChevronDown, { className: "size-4" });
12610
12834
  }
12611
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
12835
+ const hasSortingIndex = !!sortingIndexDisplay && sortingsCount > 1 && index > 0;
12836
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Tooltip, { tooltip: translation("rSortingOrderAfter", { otherSortings: index - 1 }), disabled: !hasSortingIndex, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
12612
12837
  Button,
12613
12838
  {
12614
- layout: "icon",
12839
+ layout: hasSortingIndex ? "default" : "icon",
12615
12840
  color,
12616
12841
  size,
12617
- className: (0, import_clsx45.default)(className),
12618
- ...buttonProps,
12619
- children: icon
12842
+ className: (0, import_clsx46.default)("relative", className),
12843
+ ...props,
12844
+ children: [
12845
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Visibility, { isVisible: hasSortingIndex, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
12846
+ "div",
12847
+ {
12848
+ className: (0, import_clsx46.default)("absolute bottom-0 right-1/2 translate-x-1/2 translate-y-2/3 z-1 primary coloring-solid rounded-full h-4 w-5 text-sm"),
12849
+ children: `${index}.`
12850
+ }
12851
+ ) }),
12852
+ icon
12853
+ ]
12620
12854
  }
12621
- );
12855
+ ) });
12622
12856
  };
12623
12857
 
12624
12858
  // src/components/table/TableFilterButton.tsx
12625
12859
  var import_lucide_react21 = require("lucide-react");
12626
12860
 
12627
12861
  // src/components/user-action/Menu.tsx
12628
- var import_react40 = require("react");
12629
- var import_clsx46 = __toESM(require("clsx"));
12862
+ var import_react41 = require("react");
12863
+ var import_clsx47 = __toESM(require("clsx"));
12630
12864
 
12631
12865
  // src/utils/bagFunctions.ts
12632
12866
  var resolve = (children, bag) => {
@@ -12640,7 +12874,7 @@ var BagFunctionUtil = {
12640
12874
  };
12641
12875
 
12642
12876
  // src/components/user-action/Menu.tsx
12643
- var import_react_dom4 = require("react-dom");
12877
+ var import_react_dom5 = require("react-dom");
12644
12878
 
12645
12879
  // src/hooks/usePopoverPosition.ts
12646
12880
  var defaultPopoverPositionOptions = {
@@ -12697,15 +12931,15 @@ var usePopoverPosition = (trigger, options) => {
12697
12931
  };
12698
12932
 
12699
12933
  // src/hooks/useHoverState.ts
12700
- var import_react38 = require("react");
12934
+ var import_react39 = require("react");
12701
12935
  var defaultUseHoverStateProps = {
12702
12936
  closingDelay: 200,
12703
12937
  isDisabled: false
12704
12938
  };
12705
12939
  var useHoverState = (props = void 0) => {
12706
12940
  const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
12707
- const [isHovered, setIsHovered] = (0, import_react38.useState)(false);
12708
- const [timer, setTimer] = (0, import_react38.useState)();
12941
+ const [isHovered, setIsHovered] = (0, import_react39.useState)(false);
12942
+ const [timer, setTimer] = (0, import_react39.useState)();
12709
12943
  const onMouseEnter = () => {
12710
12944
  if (isDisabled) {
12711
12945
  return;
@@ -12721,14 +12955,14 @@ var useHoverState = (props = void 0) => {
12721
12955
  setIsHovered(false);
12722
12956
  }, closingDelay));
12723
12957
  };
12724
- (0, import_react38.useEffect)(() => {
12958
+ (0, import_react39.useEffect)(() => {
12725
12959
  if (timer) {
12726
12960
  return () => {
12727
12961
  clearTimeout(timer);
12728
12962
  };
12729
12963
  }
12730
12964
  });
12731
- (0, import_react38.useEffect)(() => {
12965
+ (0, import_react39.useEffect)(() => {
12732
12966
  if (timer) {
12733
12967
  clearTimeout(timer);
12734
12968
  }
@@ -12741,9 +12975,9 @@ var useHoverState = (props = void 0) => {
12741
12975
  };
12742
12976
 
12743
12977
  // src/hooks/useOutsideClick.ts
12744
- var import_react39 = require("react");
12978
+ var import_react40 = require("react");
12745
12979
  var useOutsideClick = (refs, handler) => {
12746
- (0, import_react39.useEffect)(() => {
12980
+ (0, import_react40.useEffect)(() => {
12747
12981
  const listener = (event) => {
12748
12982
  if (event.target === null) return;
12749
12983
  if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
@@ -12761,17 +12995,17 @@ var useOutsideClick = (refs, handler) => {
12761
12995
  };
12762
12996
 
12763
12997
  // src/components/user-action/Menu.tsx
12764
- var import_jsx_runtime58 = require("react/jsx-runtime");
12998
+ var import_jsx_runtime59 = require("react/jsx-runtime");
12765
12999
  var MenuItem = ({
12766
13000
  children,
12767
13001
  onClick,
12768
13002
  alignment = "left",
12769
13003
  isDisabled = false,
12770
13004
  className
12771
- }) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
13005
+ }) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
12772
13006
  "div",
12773
13007
  {
12774
- className: (0, import_clsx46.default)("block px-3 py-1.5 first:rounded-t-md last:rounded-b-md text-sm font-semibold text-nowrap", {
13008
+ className: (0, import_clsx47.default)("block px-3 py-1.5 first:rounded-t-md last:rounded-b-md text-sm font-semibold text-nowrap", {
12775
13009
  "text-right": alignment === "right",
12776
13010
  "text-left": alignment === "left",
12777
13011
  "text-disabled cursor-not-allowed": isDisabled,
@@ -12801,10 +13035,10 @@ var Menu = ({
12801
13035
  menuClassName = ""
12802
13036
  }) => {
12803
13037
  const { isHovered: isOpen, setIsHovered: setIsOpen } = useHoverState({ isDisabled: !showOnHover || disabled });
12804
- const triggerRef = (0, import_react40.useRef)(null);
12805
- const menuRef = (0, import_react40.useRef)(null);
13038
+ const triggerRef = (0, import_react41.useRef)(null);
13039
+ const menuRef = (0, import_react41.useRef)(null);
12806
13040
  useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
12807
- const [isHidden, setIsHidden] = (0, import_react40.useState)(true);
13041
+ const [isHidden, setIsHidden] = (0, import_react41.useState)(true);
12808
13042
  const bag = {
12809
13043
  isOpen,
12810
13044
  close: () => setIsOpen(false),
@@ -12815,7 +13049,7 @@ var Menu = ({
12815
13049
  triggerRef.current?.getBoundingClientRect(),
12816
13050
  { verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
12817
13051
  );
12818
- (0, import_react40.useEffect)(() => {
13052
+ (0, import_react41.useEffect)(() => {
12819
13053
  if (!isOpen) return;
12820
13054
  const triggerEl = triggerRef.current;
12821
13055
  if (!triggerEl) return;
@@ -12832,20 +13066,20 @@ var Menu = ({
12832
13066
  window.removeEventListener("resize", close);
12833
13067
  };
12834
13068
  }, [isOpen, setIsOpen]);
12835
- (0, import_react40.useEffect)(() => {
13069
+ (0, import_react41.useEffect)(() => {
12836
13070
  if (isOpen) {
12837
13071
  setIsHidden(false);
12838
13072
  }
12839
13073
  }, [isOpen]);
12840
13074
  const zIndex = useZIndexRegister(isOpen);
12841
- return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
13075
+ return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
12842
13076
  trigger(bag, triggerRef),
12843
- (0, import_react_dom4.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
13077
+ (0, import_react_dom5.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
12844
13078
  "div",
12845
13079
  {
12846
13080
  ref: menuRef,
12847
13081
  onClick: (e) => e.stopPropagation(),
12848
- className: (0, import_clsx46.default)(
13082
+ className: (0, import_clsx47.default)(
12849
13083
  "absolute rounded-md bg-menu-background text-menu-text shadow-around-lg shadow-strong z-[300]",
12850
13084
  {
12851
13085
  "animate-pop-in": isOpen,
@@ -12870,34 +13104,34 @@ var Menu = ({
12870
13104
  };
12871
13105
 
12872
13106
  // src/components/table/TableFilterButton.tsx
12873
- var import_react41 = require("react");
12874
- var import_jsx_runtime59 = require("react/jsx-runtime");
13107
+ var import_react42 = require("react");
13108
+ var import_jsx_runtime60 = require("react/jsx-runtime");
12875
13109
  var TableFilterButton = ({
12876
13110
  filterType,
12877
13111
  column
12878
13112
  }) => {
12879
13113
  const translation = useHightideTranslation();
12880
13114
  const columnFilterValue = column.getFilterValue();
12881
- const [filterValue, setFilterValue] = (0, import_react41.useState)(columnFilterValue);
13115
+ const [filterValue, setFilterValue] = (0, import_react42.useState)(columnFilterValue);
12882
13116
  const hasFilter = !!filterValue;
12883
- (0, import_react41.useEffect)(() => {
13117
+ (0, import_react42.useEffect)(() => {
12884
13118
  setFilterValue(columnFilterValue);
12885
13119
  }, [columnFilterValue]);
12886
- return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
13120
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
12887
13121
  Menu,
12888
13122
  {
12889
- trigger: ({ toggleOpen }, ref) => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { ref, className: "relative", children: [
12890
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
13123
+ trigger: ({ toggleOpen }, ref) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { ref, className: "relative", children: [
13124
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
12891
13125
  Button,
12892
13126
  {
12893
13127
  layout: "icon",
12894
13128
  color: "neutral",
12895
13129
  size: "tiny",
12896
13130
  onClick: toggleOpen,
12897
- children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_lucide_react21.FilterIcon, {})
13131
+ children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react21.FilterIcon, { className: "size-4" })
12898
13132
  }
12899
13133
  ),
12900
- hasFilter && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
13134
+ hasFilter && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
12901
13135
  "div",
12902
13136
  {
12903
13137
  className: "absolute top-0.5 right-0.5 w-2 h-2 rounded-full bg-primary pointer-events-none",
@@ -12905,9 +13139,9 @@ var TableFilterButton = ({
12905
13139
  }
12906
13140
  )
12907
13141
  ] }),
12908
- children: ({ close }) => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex-col-1 p-2 items-start font-normal text-menu-text", children: [
12909
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("h4", { className: "typography-label-md-semibold", children: translation("filter") }),
12910
- filterType === "text" && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
13142
+ children: ({ close }) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex-col-1 p-2 items-start font-normal text-menu-text", children: [
13143
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h4", { className: "typography-label-md-semibold", children: translation("filter") }),
13144
+ filterType === "text" && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
12911
13145
  Input,
12912
13146
  {
12913
13147
  value: filterValue ?? "",
@@ -12917,8 +13151,8 @@ var TableFilterButton = ({
12917
13151
  className: "h-10"
12918
13152
  }
12919
13153
  ),
12920
- filterType === "range" && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex-row-2 items-center", children: [
12921
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
13154
+ filterType === "range" && /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex-row-2 items-center", children: [
13155
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
12922
13156
  Input,
12923
13157
  {
12924
13158
  value: filterValue?.[0] ?? "",
@@ -12931,8 +13165,8 @@ var TableFilterButton = ({
12931
13165
  className: "h-10 input-indicator-hidden w-40"
12932
13166
  }
12933
13167
  ),
12934
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "font-bold", children: "-" }),
12935
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
13168
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "font-bold", children: "-" }),
13169
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
12936
13170
  Input,
12937
13171
  {
12938
13172
  value: filterValue?.[1] ?? "",
@@ -12946,8 +13180,8 @@ var TableFilterButton = ({
12946
13180
  }
12947
13181
  )
12948
13182
  ] }),
12949
- filterType === "dateRange" && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
12950
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
13183
+ filterType === "dateRange" && /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
13184
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
12951
13185
  Input,
12952
13186
  {
12953
13187
  value: filterValue?.[0] ? filterValue?.[0].toISOString().slice(0, 16) : "",
@@ -12960,7 +13194,7 @@ var TableFilterButton = ({
12960
13194
  className: "h-10 w-50"
12961
13195
  }
12962
13196
  ),
12963
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
13197
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
12964
13198
  Input,
12965
13199
  {
12966
13200
  value: filterValue?.[1] ? filterValue?.[1].toISOString().slice(0, 16) : "",
@@ -12974,12 +13208,12 @@ var TableFilterButton = ({
12974
13208
  }
12975
13209
  )
12976
13210
  ] }),
12977
- /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex-row-2 justify-end w-full", children: [
12978
- hasFilter && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Button, { color: "negative", size: "small", onClick: () => {
13211
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex-row-2 justify-end w-full", children: [
13212
+ hasFilter && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Button, { color: "negative", size: "small", onClick: () => {
12979
13213
  column.setFilterValue(void 0);
12980
13214
  close();
12981
13215
  }, children: translation("remove") }),
12982
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Button, { size: "small", onClick: () => {
13216
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Button, { size: "small", onClick: () => {
12983
13217
  column.setFilterValue(filterValue);
12984
13218
  close();
12985
13219
  }, children: translation("apply") })
@@ -12990,7 +13224,7 @@ var TableFilterButton = ({
12990
13224
  };
12991
13225
 
12992
13226
  // src/components/table/Table.tsx
12993
- var import_jsx_runtime60 = require("react/jsx-runtime");
13227
+ var import_jsx_runtime61 = require("react/jsx-runtime");
12994
13228
  var Table = ({
12995
13229
  data,
12996
13230
  fillerRow,
@@ -13004,22 +13238,22 @@ var Table = ({
13004
13238
  columns,
13005
13239
  ...tableOptions
13006
13240
  }) => {
13007
- const ref = (0, import_react42.useRef)(null);
13008
- const tableRef = (0, import_react42.useRef)(null);
13009
- const [columnSizing, setColumnSizing] = (0, import_react42.useState)(columns.reduce((previousValue, currentValue) => {
13241
+ const ref = (0, import_react43.useRef)(null);
13242
+ const tableRef = (0, import_react43.useRef)(null);
13243
+ const [columnSizing, setColumnSizing] = (0, import_react43.useState)(columns.reduce((previousValue, currentValue) => {
13010
13244
  return {
13011
13245
  ...previousValue,
13012
13246
  [currentValue.id]: currentValue.minSize ?? defaultColumn.minSize
13013
13247
  };
13014
13248
  }, {}));
13015
- const [columnSizingInfo, setColumnSizingInfo] = (0, import_react42.useState)();
13016
- const [pagination, setPagination] = (0, import_react42.useState)({
13249
+ const [columnSizingInfo, setColumnSizingInfo] = (0, import_react43.useState)();
13250
+ const [pagination, setPagination] = (0, import_react43.useState)({
13017
13251
  pageSize: 10,
13018
13252
  pageIndex: 0,
13019
13253
  ...initialState?.pagination
13020
13254
  });
13021
- const [columnFilters, setColumnFilters] = (0, import_react42.useState)(initialState?.columnFilters);
13022
- const computedColumnMinWidths = (0, import_react42.useMemo)(() => {
13255
+ const [columnFilters, setColumnFilters] = (0, import_react43.useState)(initialState?.columnFilters);
13256
+ const computedColumnMinWidths = (0, import_react43.useMemo)(() => {
13023
13257
  return columns.reduce((previousValue, column) => {
13024
13258
  return {
13025
13259
  ...previousValue,
@@ -13028,7 +13262,7 @@ var Table = ({
13028
13262
  };
13029
13263
  }, {});
13030
13264
  }, [columns, defaultColumn]);
13031
- const computedColumnMaxWidths = (0, import_react42.useMemo)(() => {
13265
+ const computedColumnMaxWidths = (0, import_react43.useMemo)(() => {
13032
13266
  return columns.reduce((previousValue, column) => {
13033
13267
  return {
13034
13268
  ...previousValue,
@@ -13036,12 +13270,12 @@ var Table = ({
13036
13270
  };
13037
13271
  }, {});
13038
13272
  }, [columns, defaultColumn]);
13039
- const tableMinWidth = (0, import_react42.useMemo)(() => {
13273
+ const tableMinWidth = (0, import_react43.useMemo)(() => {
13040
13274
  return columns.reduce((sum, column) => {
13041
13275
  return sum + computedColumnMinWidths[column.id];
13042
13276
  }, 0);
13043
13277
  }, [columns, computedColumnMinWidths]);
13044
- const updateColumnSizes = (0, import_react42.useMemo)(() => {
13278
+ const updateColumnSizes = (0, import_react43.useMemo)(() => {
13045
13279
  return (previous) => {
13046
13280
  const updateSizing = {
13047
13281
  ...columnSizing,
@@ -13110,7 +13344,7 @@ var Table = ({
13110
13344
  minSize: 60,
13111
13345
  maxSize: 700,
13112
13346
  cell: ({ cell }) => {
13113
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TableCell, { children: cell.getValue() });
13347
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(TableCell, { children: cell.getValue() });
13114
13348
  },
13115
13349
  ...defaultColumn
13116
13350
  },
@@ -13158,18 +13392,18 @@ var Table = ({
13158
13392
  columnResizeMode: "onChange",
13159
13393
  ...tableOptions
13160
13394
  });
13161
- const [hasInitializedSizing, setHasInitializedSizing] = (0, import_react42.useState)(false);
13162
- (0, import_react42.useEffect)(() => {
13395
+ const [hasInitializedSizing, setHasInitializedSizing] = (0, import_react43.useState)(false);
13396
+ (0, import_react43.useEffect)(() => {
13163
13397
  if (!hasInitializedSizing && ref.current) {
13164
13398
  setHasInitializedSizing(true);
13165
13399
  table.setColumnSizing(updateColumnSizes(columnSizing));
13166
13400
  }
13167
13401
  }, [columnSizing, hasInitializedSizing]);
13168
- useResizeCallbackWrapper((0, import_react42.useCallback)(() => {
13402
+ useResizeCallbackWrapper((0, import_react43.useCallback)(() => {
13169
13403
  table.setColumnSizing(updateColumnSizes);
13170
13404
  }, [updateColumnSizes]));
13171
13405
  const pageCount = table.getPageCount();
13172
- (0, import_react42.useEffect)(() => {
13406
+ (0, import_react43.useEffect)(() => {
13173
13407
  const totalPages = pageCount;
13174
13408
  if (totalPages === 0) {
13175
13409
  if (pagination.pageIndex !== 0) {
@@ -13185,7 +13419,7 @@ var Table = ({
13185
13419
  }));
13186
13420
  }
13187
13421
  }, [data, pageCount, pagination.pageSize, pagination.pageIndex]);
13188
- const columnSizeVars = (0, import_react42.useMemo)(() => {
13422
+ const columnSizeVars = (0, import_react43.useMemo)(() => {
13189
13423
  const headers = table.getFlatHeaders();
13190
13424
  const colSizes = {};
13191
13425
  for (let i = 0; i < headers.length; i++) {
@@ -13195,18 +13429,18 @@ var Table = ({
13195
13429
  }
13196
13430
  return colSizes;
13197
13431
  }, [table.getState().columnSizingInfo, table.getState().columnSizing]);
13198
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { ref, className: (0, import_clsx47.default)("flex-col-4", className), children: [
13199
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: (0, import_clsx47.default)("flex-col-0 w-full overflow-auto", tableContainerClassName), children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
13432
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { ref, className: (0, import_clsx48.default)("flex-col-4", className), children: [
13433
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: (0, import_clsx48.default)("flex-col-0 w-full overflow-auto", tableContainerClassName), children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
13200
13434
  "table",
13201
13435
  {
13202
13436
  ref: tableRef,
13203
- className: (0, import_clsx47.default)(tableClassName),
13437
+ className: (0, import_clsx48.default)(tableClassName),
13204
13438
  style: {
13205
13439
  ...columnSizeVars,
13206
13440
  width: Math.floor(Math.max(table.getTotalSize() - columns.length, ref.current?.offsetWidth ?? table.getTotalSize()))
13207
13441
  },
13208
13442
  children: [
13209
- table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("colgroup", { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
13443
+ table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("colgroup", { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
13210
13444
  "col",
13211
13445
  {
13212
13446
  style: {
@@ -13217,18 +13451,22 @@ var Table = ({
13217
13451
  },
13218
13452
  header.id
13219
13453
  )) }, headerGroup.id)),
13220
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("tr", { className: table.options.meta?.headerRowClassName, children: headerGroup.headers.map((header) => {
13221
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
13454
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("tr", { className: table.options.meta?.headerRowClassName, children: headerGroup.headers.map((header) => {
13455
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
13222
13456
  "th",
13223
13457
  {
13224
13458
  colSpan: header.colSpan,
13225
- className: (0, import_clsx47.default)("relative group", header.column.columnDef.meta?.className),
13459
+ className: (0, import_clsx48.default)("relative group", header.column.columnDef.meta?.className),
13226
13460
  children: [
13227
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "flex-row-2 w-full", children: header.isPlaceholder ? null : /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex-row-1 items-center", children: [
13228
- header.column.getCanSort() && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
13461
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "flex-row-2 w-full", children: header.isPlaceholder ? null : /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex-row-1 items-center", children: [
13462
+ header.column.getCanSort() && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
13229
13463
  TableSortButton,
13230
13464
  {
13231
13465
  sortDirection: header.column.getIsSorted(),
13466
+ sortingIndexDisplay: {
13467
+ index: header.column.getIsSorted() ? header.column.getSortIndex() + 1 : -1,
13468
+ sortingsCount: table.getState().sorting.length
13469
+ },
13232
13470
  onClick: () => {
13233
13471
  const sorted = header.column.getIsSorted();
13234
13472
  const isMulti = header.column.getCanMultiSort();
@@ -13247,7 +13485,7 @@ var Table = ({
13247
13485
  }
13248
13486
  }
13249
13487
  ),
13250
- header.column.getCanFilter() && header.column.columnDef.meta?.filterType ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
13488
+ header.column.getCanFilter() && header.column.columnDef.meta?.filterType ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
13251
13489
  TableFilterButton,
13252
13490
  {
13253
13491
  column: header.column,
@@ -13259,7 +13497,7 @@ var Table = ({
13259
13497
  header.getContext()
13260
13498
  )
13261
13499
  ] }) }),
13262
- header.column.getCanResize() && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
13500
+ header.column.getCanResize() && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
13263
13501
  "div",
13264
13502
  {
13265
13503
  onMouseDown: header.getResizeHandler(),
@@ -13278,15 +13516,15 @@ var Table = ({
13278
13516
  header.id
13279
13517
  );
13280
13518
  }) }, headerGroup.id)) }),
13281
- /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("tbody", { children: [
13519
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("tbody", { children: [
13282
13520
  table.getRowModel().rows.map((row) => {
13283
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
13521
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
13284
13522
  "tr",
13285
13523
  {
13286
13524
  onClick: () => onRowClick?.(row, table),
13287
13525
  className: table.options.meta?.bodyRowClassName,
13288
13526
  children: row.getVisibleCells().map((cell) => {
13289
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("td", { children: (0, import_react_table.flexRender)(
13527
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("td", { children: (0, import_react_table.flexRender)(
13290
13528
  cell.column.columnDef.cell,
13291
13529
  cell.getContext()
13292
13530
  ) }, cell.id);
@@ -13296,15 +13534,15 @@ var Table = ({
13296
13534
  );
13297
13535
  }),
13298
13536
  range(table.getState().pagination.pageSize - table.getRowModel().rows.length, { allowEmptyRange: true }).map((row, index) => {
13299
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("tr", { children: columns.map((column) => {
13300
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("td", { children: fillerRow ? fillerRow(column.id, table) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FillerRowElement, {}) }, column.id);
13537
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("tr", { children: columns.map((column) => {
13538
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("td", { children: fillerRow ? fillerRow(column.id, table) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(FillerRowElement, {}) }, column.id);
13301
13539
  }) }, "filler-row-" + index);
13302
13540
  })
13303
13541
  ] })
13304
13542
  ]
13305
13543
  }
13306
13544
  ) }),
13307
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "flex-row-2 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
13545
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "flex-row-2 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
13308
13546
  Pagination,
13309
13547
  {
13310
13548
  pageIndex: table.getState().pagination.pageIndex,
@@ -13316,7 +13554,7 @@ var Table = ({
13316
13554
  };
13317
13555
  var TableUncontrolled = ({ data, ...props }) => {
13318
13556
  const [usedDate] = useOverwritableState(data);
13319
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
13557
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
13320
13558
  Table,
13321
13559
  {
13322
13560
  ...props,
@@ -13335,12 +13573,12 @@ var TableWithSelection = ({
13335
13573
  meta,
13336
13574
  ...props
13337
13575
  }) => {
13338
- const columnsWithSelection = (0, import_react42.useMemo)(() => {
13576
+ const columnsWithSelection = (0, import_react43.useMemo)(() => {
13339
13577
  return [
13340
13578
  {
13341
13579
  id: selectionRowId,
13342
13580
  header: ({ table }) => {
13343
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
13581
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
13344
13582
  Checkbox,
13345
13583
  {
13346
13584
  checked: table.getIsAllRowsSelected(),
@@ -13353,7 +13591,7 @@ var TableWithSelection = ({
13353
13591
  );
13354
13592
  },
13355
13593
  cell: ({ row }) => {
13356
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
13594
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
13357
13595
  Checkbox,
13358
13596
  {
13359
13597
  disabled: !row.getCanSelect(),
@@ -13371,15 +13609,15 @@ var TableWithSelection = ({
13371
13609
  ...columns
13372
13610
  ];
13373
13611
  }, [columns, selectionRowId]);
13374
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
13612
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
13375
13613
  Table,
13376
13614
  {
13377
13615
  columns: columnsWithSelection,
13378
13616
  fillerRow: (columnId, table) => {
13379
13617
  if (columnId === selectionRowId) {
13380
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Checkbox, { checked: false, disabled: true, className: "max-w-6" });
13618
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Checkbox, { checked: false, disabled: true, className: "max-w-6" });
13381
13619
  }
13382
- return fillerRow ? fillerRow(columnId, table) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FillerRowElement, {});
13620
+ return fillerRow ? fillerRow(columnId, table) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(FillerRowElement, {});
13383
13621
  },
13384
13622
  state: {
13385
13623
  rowSelection,
@@ -13393,7 +13631,7 @@ var TableWithSelection = ({
13393
13631
  },
13394
13632
  meta: {
13395
13633
  ...meta,
13396
- bodyRowClassName: (0, import_clsx47.default)(
13634
+ bodyRowClassName: (0, import_clsx48.default)(
13397
13635
  { "cursor-pointer": !disableClickRowClickSelection },
13398
13636
  meta?.bodyRowClassName
13399
13637
  )
@@ -13404,8 +13642,8 @@ var TableWithSelection = ({
13404
13642
  };
13405
13643
 
13406
13644
  // src/components/user-action/CopyToClipboardWrapper.tsx
13407
- var import_react43 = require("react");
13408
- var import_clsx48 = require("clsx");
13645
+ var import_react44 = require("react");
13646
+ var import_clsx49 = require("clsx");
13409
13647
 
13410
13648
  // src/utils/writeToClipboard.ts
13411
13649
  var writeToClipboard = (text) => {
@@ -13414,7 +13652,7 @@ var writeToClipboard = (text) => {
13414
13652
 
13415
13653
  // src/components/user-action/CopyToClipboardWrapper.tsx
13416
13654
  var import_lucide_react22 = require("lucide-react");
13417
- var import_jsx_runtime61 = require("react/jsx-runtime");
13655
+ var import_jsx_runtime62 = require("react/jsx-runtime");
13418
13656
  var CopyToClipboardWrapper = ({
13419
13657
  children,
13420
13658
  textToCopy,
@@ -13424,8 +13662,8 @@ var CopyToClipboardWrapper = ({
13424
13662
  zIndex = 10
13425
13663
  }) => {
13426
13664
  const translation = useHightideTranslation();
13427
- const [isShowingIndication, setIsShowingIndication] = (0, import_react43.useState)(false);
13428
- const [isShowingConfirmation, setIsShowingConfirmation] = (0, import_react43.useState)(false);
13665
+ const [isShowingIndication, setIsShowingIndication] = (0, import_react44.useState)(false);
13666
+ const [isShowingConfirmation, setIsShowingConfirmation] = (0, import_react44.useState)(false);
13429
13667
  const positionClasses = {
13430
13668
  top: `bottom-full left-1/2 -translate-x-1/2 mb-[6px]`,
13431
13669
  bottom: `top-full left-1/2 -translate-x-1/2 mt-[6px]`,
@@ -13445,10 +13683,10 @@ var CopyToClipboardWrapper = ({
13445
13683
  left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
13446
13684
  right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
13447
13685
  };
13448
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
13686
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
13449
13687
  "div",
13450
13688
  {
13451
- className: (0, import_clsx48.clsx)("relative inline-block cursor-copy", containerClassName),
13689
+ className: (0, import_clsx49.clsx)("relative inline-block cursor-copy", containerClassName),
13452
13690
  onMouseEnter: () => {
13453
13691
  setIsShowingIndication(true);
13454
13692
  },
@@ -13463,10 +13701,10 @@ var CopyToClipboardWrapper = ({
13463
13701
  },
13464
13702
  children: [
13465
13703
  children,
13466
- /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
13704
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
13467
13705
  "div",
13468
13706
  {
13469
- className: (0, import_clsx48.clsx)(
13707
+ className: (0, import_clsx49.clsx)(
13470
13708
  `absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap
13471
13709
  shadow-around-md bg-tooltip-background cursor-default pointer-events-none`,
13472
13710
  "transition-opacity duration-200",
@@ -13478,18 +13716,18 @@ var CopyToClipboardWrapper = ({
13478
13716
  opacity: isShowingIndication || isShowingConfirmation ? 1 : 0
13479
13717
  },
13480
13718
  children: [
13481
- isShowingConfirmation && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex-row-1", children: [
13482
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react22.CheckIcon, { size: 16, className: "text-positive" }),
13719
+ isShowingConfirmation && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex-row-1", children: [
13720
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react22.CheckIcon, { size: 16, className: "text-positive" }),
13483
13721
  translation("copied")
13484
13722
  ] }),
13485
- isShowingIndication && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex-row-1 text-description", children: [
13486
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react22.Copy, { size: 16 }),
13723
+ isShowingIndication && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex-row-1 text-description", children: [
13724
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react22.Copy, { size: 16 }),
13487
13725
  translation("clickToCopy")
13488
13726
  ] }),
13489
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
13727
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
13490
13728
  "div",
13491
13729
  {
13492
- className: (0, import_clsx48.clsx)(`absolute w-0 h-0`, triangleClasses[position]),
13730
+ className: (0, import_clsx49.clsx)(`absolute w-0 h-0`, triangleClasses[position]),
13493
13731
  style: { ...triangleStyle[position], zIndex: zIndex + 1 }
13494
13732
  }
13495
13733
  )
@@ -13502,30 +13740,27 @@ var CopyToClipboardWrapper = ({
13502
13740
  };
13503
13741
 
13504
13742
  // src/components/user-action/DateAndTimePicker.tsx
13505
- var import_clsx49 = __toESM(require("clsx"));
13506
- var import_jsx_runtime62 = require("react/jsx-runtime");
13743
+ var import_clsx50 = __toESM(require("clsx"));
13744
+ var import_jsx_runtime63 = require("react/jsx-runtime");
13507
13745
  var DateTimePicker = ({
13508
13746
  value = /* @__PURE__ */ new Date(),
13509
13747
  start = subtractDuration(/* @__PURE__ */ new Date(), { years: 50 }),
13510
13748
  end = addDuration(/* @__PURE__ */ new Date(), { years: 50 }),
13511
13749
  mode = "dateTime",
13512
- onFinish,
13513
13750
  onChange,
13514
- onRemove,
13515
13751
  timePickerProps,
13516
13752
  datePickerProps
13517
13753
  }) => {
13518
- const translation = useHightideTranslation();
13519
13754
  const useDate = mode === "dateTime" || mode === "date";
13520
13755
  const useTime = mode === "dateTime" || mode === "time";
13521
13756
  let dateDisplay;
13522
13757
  let timeDisplay;
13523
13758
  if (useDate) {
13524
- dateDisplay = /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
13759
+ dateDisplay = /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
13525
13760
  DatePicker,
13526
13761
  {
13527
13762
  ...datePickerProps,
13528
- className: "min-w-80 min-h-71 max-h-71",
13763
+ className: "min-w-80",
13529
13764
  yearMonthPickerProps: { className: "h-full grow" },
13530
13765
  value,
13531
13766
  start,
@@ -13535,39 +13770,26 @@ var DateTimePicker = ({
13535
13770
  );
13536
13771
  }
13537
13772
  if (useTime) {
13538
- timeDisplay = /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
13773
+ timeDisplay = /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
13539
13774
  TimePicker,
13540
13775
  {
13541
13776
  ...timePickerProps,
13542
- className: (0, import_clsx49.default)("min-h-71 max-h-71", { "justify-between w-full": mode === "time" }),
13777
+ className: (0, import_clsx50.default)({ "justify-between": mode === "time" }),
13543
13778
  time: value,
13544
13779
  onChange
13545
13780
  }
13546
13781
  );
13547
13782
  }
13548
- return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex-col-2 w-fit", children: [
13549
- /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex-row-4", children: [
13550
- dateDisplay,
13551
- timeDisplay
13552
- ] }),
13553
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "flex-row-2 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex-row-2 mt-1", children: [
13554
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Button, { size: "medium", color: "negative", onClick: onRemove, children: translation("clear") }),
13555
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
13556
- Button,
13557
- {
13558
- size: "medium",
13559
- onClick: () => onFinish?.(value),
13560
- children: translation("change")
13561
- }
13562
- )
13563
- ] }) })
13783
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex-row-2 min-h-71 max-h-71", children: [
13784
+ dateDisplay,
13785
+ timeDisplay
13564
13786
  ] });
13565
13787
  };
13566
13788
 
13567
13789
  // src/components/user-action/ScrollPicker.tsx
13568
- var import_react44 = require("react");
13569
- var import_clsx50 = __toESM(require("clsx"));
13570
- var import_jsx_runtime63 = require("react/jsx-runtime");
13790
+ var import_react45 = require("react");
13791
+ var import_clsx51 = __toESM(require("clsx"));
13792
+ var import_jsx_runtime64 = require("react/jsx-runtime");
13571
13793
  var up = 1;
13572
13794
  var down = -1;
13573
13795
  var ScrollPicker = ({
@@ -13586,7 +13808,7 @@ var ScrollPicker = ({
13586
13808
  transition,
13587
13809
  items,
13588
13810
  lastTimeStamp
13589
- }, setAnimation] = (0, import_react44.useState)({
13811
+ }, setAnimation] = (0, import_react45.useState)({
13590
13812
  targetIndex: selectedIndex,
13591
13813
  currentIndex: disabled ? selectedIndex : 0,
13592
13814
  velocity: 0,
@@ -13602,7 +13824,7 @@ var ScrollPicker = ({
13602
13824
  const itemHeight = 40;
13603
13825
  const distance = 8;
13604
13826
  const containerHeight = itemHeight * (itemsShownCount - 2) + distance * (itemsShownCount - 2 + 1);
13605
- const getDirection = (0, import_react44.useCallback)((targetIndex, currentIndex2, transition2, length) => {
13827
+ const getDirection = (0, import_react45.useCallback)((targetIndex, currentIndex2, transition2, length) => {
13606
13828
  if (targetIndex === currentIndex2) {
13607
13829
  return transition2 > 0 ? up : down;
13608
13830
  }
@@ -13612,7 +13834,7 @@ var ScrollPicker = ({
13612
13834
  }
13613
13835
  return distanceForward >= length / 2 ? down : up;
13614
13836
  }, []);
13615
- const animate = (0, import_react44.useCallback)((timestamp, startTime) => {
13837
+ const animate = (0, import_react45.useCallback)((timestamp, startTime) => {
13616
13838
  setAnimation((prevState) => {
13617
13839
  const {
13618
13840
  targetIndex,
@@ -13685,7 +13907,7 @@ var ScrollPicker = ({
13685
13907
  };
13686
13908
  });
13687
13909
  }, [disabled, getDirection, onChange]);
13688
- (0, import_react44.useEffect)(() => {
13910
+ (0, import_react45.useEffect)(() => {
13689
13911
  requestAnimationFrame((timestamp) => animate(timestamp, lastTimeStamp));
13690
13912
  });
13691
13913
  const opacity = (transition2, index, itemsCount) => {
@@ -13706,7 +13928,7 @@ var ScrollPicker = ({
13706
13928
  }
13707
13929
  return clamp(1 - opacityValue / max);
13708
13930
  };
13709
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
13931
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
13710
13932
  "div",
13711
13933
  {
13712
13934
  className: "relative overflow-hidden",
@@ -13717,15 +13939,15 @@ var ScrollPicker = ({
13717
13939
  setAnimation(({ velocity, ...animationData }) => ({ ...animationData, velocity: velocity + deltaY }));
13718
13940
  }
13719
13941
  },
13720
- children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2", children: [
13721
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
13942
+ children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2", children: [
13943
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
13722
13944
  "div",
13723
13945
  {
13724
13946
  className: "absolute z-[1] top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2 w-full min-w-[40px] border border-divider/50 border-y-2 border-x-0 ",
13725
13947
  style: { height: `${itemHeight}px` }
13726
13948
  }
13727
13949
  ),
13728
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
13950
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
13729
13951
  "div",
13730
13952
  {
13731
13953
  className: "flex-col-2 select-none",
@@ -13733,10 +13955,10 @@ var ScrollPicker = ({
13733
13955
  transform: `translateY(${-transition * (distance + itemHeight)}px)`,
13734
13956
  columnGap: `${distance}px`
13735
13957
  },
13736
- children: shownItems.map(({ name, index }, arrayIndex) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
13958
+ children: shownItems.map(({ name, index }, arrayIndex) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
13737
13959
  "div",
13738
13960
  {
13739
- className: (0, import_clsx50.default)(
13961
+ className: (0, import_clsx51.default)(
13740
13962
  `flex-col-2 items-center justify-center rounded-md`,
13741
13963
  {
13742
13964
  "text-primary font-bold": currentIndex === index,
@@ -13762,93 +13984,163 @@ var ScrollPicker = ({
13762
13984
  );
13763
13985
  };
13764
13986
 
13765
- // src/components/user-action/Tooltip.tsx
13766
- var import_clsx51 = require("clsx");
13767
- var import_jsx_runtime64 = require("react/jsx-runtime");
13768
- var Tooltip = ({
13769
- tooltip,
13770
- children,
13771
- animationDelay = 650,
13772
- tooltipClassName = "",
13773
- containerClassName = "",
13774
- position = "bottom"
13987
+ // src/components/user-action/input/DateTimeInput.tsx
13988
+ var import_react46 = require("react");
13989
+ var import_lucide_react23 = require("lucide-react");
13990
+ var import_clsx52 = __toESM(require("clsx"));
13991
+ var import_jsx_runtime65 = require("react/jsx-runtime");
13992
+ var DateTimeInput = ({
13993
+ date,
13994
+ onValueChange,
13995
+ onEditCompleted,
13996
+ onRemove,
13997
+ containerProps,
13998
+ mode = "date",
13999
+ pickerProps,
14000
+ ...props
13775
14001
  }) => {
13776
- const { isHovered, handlers } = useHoverState();
13777
- const positionClasses = {
13778
- top: `bottom-full left-1/2 -translate-x-1/2 mb-[6px]`,
13779
- bottom: `top-full left-1/2 -translate-x-1/2 mt-[6px]`,
13780
- left: `right-full top-1/2 -translate-y-1/2 mr-[6px]`,
13781
- right: `left-full top-1/2 -translate-y-1/2 ml-[6px]`
13782
- };
13783
- const triangleSize = 6;
13784
- const triangleClasses = {
13785
- top: `top-full left-1/2 -translate-x-1/2 border-t-tooltip-background border-l-transparent border-r-transparent`,
13786
- bottom: `bottom-full left-1/2 -translate-x-1/2 border-b-tooltip-background border-l-transparent border-r-transparent`,
13787
- left: `left-full top-1/2 -translate-y-1/2 border-l-tooltip-background border-t-transparent border-b-transparent`,
13788
- right: `right-full top-1/2 -translate-y-1/2 border-r-tooltip-background border-t-transparent border-b-transparent`
13789
- };
13790
- const triangleStyle = {
13791
- top: { borderWidth: `${triangleSize}px ${triangleSize}px 0 ${triangleSize}px` },
13792
- bottom: { borderWidth: `0 ${triangleSize}px ${triangleSize}px ${triangleSize}px` },
13793
- left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
13794
- right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
13795
- };
13796
- const zIndex = useZIndexRegister(isHovered);
13797
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
13798
- "div",
14002
+ const translation = useHightideTranslation();
14003
+ const { locale } = useLocale();
14004
+ const [isOpen, setIsOpen] = (0, import_react46.useState)(false);
14005
+ const containerRef = (0, import_react46.useRef)(null);
14006
+ useOutsideClick([containerRef], () => {
14007
+ setIsOpen(false);
14008
+ });
14009
+ const zIndex = useZIndexRegister(isOpen);
14010
+ const isReadOnly = (0, import_react46.useMemo)(() => props.readOnly || props.disabled, [props.readOnly, props.disabled]);
14011
+ (0, import_react46.useEffect)(() => {
14012
+ if (isReadOnly) {
14013
+ setIsOpen(false);
14014
+ }
14015
+ }, [isReadOnly]);
14016
+ const cleanInputProps = { ...props };
14017
+ delete cleanInputProps["isShowingError"];
14018
+ delete cleanInputProps["setIsShowingError"];
14019
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
14020
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { ...containerProps, className: (0, import_clsx52.default)("relative w-full", containerProps?.className), children: [
14021
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
14022
+ Input,
14023
+ {
14024
+ ...cleanInputProps,
14025
+ placeholder: translation("clickToAdd"),
14026
+ value: date ? DateUtils.formatAbsolute(date, locale, mode === "dateTime") : "",
14027
+ onClick: (event) => {
14028
+ setIsOpen(true);
14029
+ cleanInputProps.onClick?.(event);
14030
+ },
14031
+ readOnly: true,
14032
+ className: (0, import_clsx52.default)(
14033
+ "pr-10 w-full",
14034
+ { "hover:cursor-pointer": !isReadOnly },
14035
+ cleanInputProps.className
14036
+ )
14037
+ }
14038
+ ),
14039
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
14040
+ Button,
14041
+ {
14042
+ coloringStyle: "text",
14043
+ layout: "icon",
14044
+ color: "neutral",
14045
+ size: "small",
14046
+ className: "absolute right-1 top-1/2 -translate-y-1/2",
14047
+ disabled: isReadOnly,
14048
+ onClick: () => setIsOpen((prevState) => !prevState),
14049
+ children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_lucide_react23.CalendarIcon, { className: "size-5" })
14050
+ }
14051
+ )
14052
+ ] }),
14053
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Visibility, { isVisible: isOpen, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
14054
+ "div",
14055
+ {
14056
+ ref: containerRef,
14057
+ className: "absolute left-0 flex-col-3 rounded-lg shadow-xl border bg-surface-variant text-on-surface border-divider p-2",
14058
+ style: { zIndex },
14059
+ children: [
14060
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
14061
+ DateTimePicker,
14062
+ {
14063
+ ...pickerProps,
14064
+ mode,
14065
+ value: date,
14066
+ onChange: (newDate) => {
14067
+ onValueChange(newDate);
14068
+ }
14069
+ }
14070
+ ),
14071
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex-row-2 justify-end", children: [
14072
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Visibility, { isVisible: !!onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
14073
+ Button,
14074
+ {
14075
+ size: "medium",
14076
+ color: "negative",
14077
+ onClick: () => {
14078
+ onRemove?.();
14079
+ setIsOpen(false);
14080
+ },
14081
+ children: translation("clear")
14082
+ }
14083
+ ) }),
14084
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
14085
+ Button,
14086
+ {
14087
+ size: "medium",
14088
+ onClick: () => {
14089
+ onEditCompleted?.(date);
14090
+ setIsOpen(false);
14091
+ },
14092
+ children: translation("change")
14093
+ }
14094
+ )
14095
+ ] })
14096
+ ]
14097
+ }
14098
+ ) })
14099
+ ] });
14100
+ };
14101
+ var DateTimeInputUncontrolled = ({
14102
+ date: initialDate,
14103
+ ...props
14104
+ }) => {
14105
+ const [date, setDate] = useOverwritableState((0, import_react46.useMemo)(() => initialDate ?? /* @__PURE__ */ new Date(), [initialDate]));
14106
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
14107
+ DateTimeInput,
13799
14108
  {
13800
- className: (0, import_clsx51.clsx)("relative inline-block", containerClassName),
13801
- ...handlers,
13802
- children: [
13803
- children,
13804
- isHovered && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
13805
- "div",
13806
- {
13807
- className: (0, import_clsx51.clsx)(
13808
- `opacity-0 absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap
13809
- animate-tooltip-fade-in shadow-around-md bg-tooltip-background`,
13810
- positionClasses[position],
13811
- tooltipClassName
13812
- ),
13813
- style: { zIndex, animationDelay: animationDelay + "ms" },
13814
- children: [
13815
- tooltip,
13816
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
13817
- "div",
13818
- {
13819
- className: (0, import_clsx51.clsx)(`absolute w-0 h-0`, triangleClasses[position]),
13820
- style: { ...triangleStyle[position], zIndex: zIndex + 1 }
13821
- }
13822
- )
13823
- ]
13824
- }
13825
- )
13826
- ]
14109
+ ...props,
14110
+ date,
14111
+ onValueChange: (newDate) => {
14112
+ setDate(newDate);
14113
+ props.onValueChange?.(newDate);
14114
+ },
14115
+ onRemove: () => {
14116
+ setDate(/* @__PURE__ */ new Date());
14117
+ props.onRemove?.();
14118
+ }
13827
14119
  }
13828
14120
  );
13829
14121
  };
13830
14122
 
13831
14123
  // src/components/user-action/input/InsideLabelInput.tsx
13832
- var import_react45 = require("react");
13833
- var import_react46 = require("react");
13834
- var import_clsx52 = __toESM(require("clsx"));
13835
- var import_jsx_runtime65 = require("react/jsx-runtime");
13836
- var InsideLabelInput = (0, import_react46.forwardRef)(function InsideLabelInput2({
14124
+ var import_react47 = require("react");
14125
+ var import_react48 = require("react");
14126
+ var import_clsx53 = __toESM(require("clsx"));
14127
+ var import_jsx_runtime66 = require("react/jsx-runtime");
14128
+ var InsideLabelInput = (0, import_react48.forwardRef)(function InsideLabelInput2({
13837
14129
  id: customId,
13838
14130
  label,
13839
14131
  ...props
13840
14132
  }, forwardedRef) {
13841
14133
  const { value } = props;
13842
- const [isFocused, setIsFocused] = (0, import_react46.useState)(false);
13843
- const generatedId = (0, import_react45.useId)();
14134
+ const [isFocused, setIsFocused] = (0, import_react48.useState)(false);
14135
+ const generatedId = (0, import_react47.useId)();
13844
14136
  const id = customId ?? generatedId;
13845
- return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: (0, import_clsx52.default)("relative"), children: [
13846
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
14137
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: (0, import_clsx53.default)("relative"), children: [
14138
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
13847
14139
  Input,
13848
14140
  {
13849
14141
  ...props,
13850
14142
  id,
13851
- className: (0, import_clsx52.default)("h-14 px-4 pb-2 py-6.5", props.className),
14143
+ className: (0, import_clsx53.default)("h-14 px-4 pb-2 py-6.5", props.className),
13852
14144
  ref: forwardedRef,
13853
14145
  "aria-labelledby": id + "-label",
13854
14146
  onFocus: (event) => {
@@ -13861,13 +14153,13 @@ var InsideLabelInput = (0, import_react46.forwardRef)(function InsideLabelInput2
13861
14153
  }
13862
14154
  }
13863
14155
  ),
13864
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
14156
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
13865
14157
  "label",
13866
14158
  {
13867
14159
  id: id + "-label",
13868
14160
  "aria-hidden": true,
13869
14161
  "data-display": isFocused || !!value ? "small" : "full",
13870
- className: (0, import_clsx52.default)(
14162
+ className: (0, import_clsx53.default)(
13871
14163
  // margin left to account for the border which is ignored for absolute positions
13872
14164
  "absolute left-4 ml-0.5 top-2 transition-all delay-25 pointer-events-none touch-none",
13873
14165
  "data-[display=small]:top-2 data-[display=small]:h-force-4.5 data-[display=small]:typography-caption-sm data-[display=small]:overflow-y-hidden",
@@ -13883,7 +14175,7 @@ var InsideLabelInputUncontrolled = ({
13883
14175
  ...props
13884
14176
  }) => {
13885
14177
  const [value, setValue] = useOverwritableState(initialValue, props.onChangeText);
13886
- return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
14178
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
13887
14179
  InsideLabelInput,
13888
14180
  {
13889
14181
  ...props,
@@ -13894,9 +14186,9 @@ var InsideLabelInputUncontrolled = ({
13894
14186
  };
13895
14187
 
13896
14188
  // src/components/user-action/input/SearchBar.tsx
13897
- var import_lucide_react23 = require("lucide-react");
13898
- var import_clsx53 = require("clsx");
13899
- var import_jsx_runtime66 = require("react/jsx-runtime");
14189
+ var import_lucide_react24 = require("lucide-react");
14190
+ var import_clsx54 = require("clsx");
14191
+ var import_jsx_runtime67 = require("react/jsx-runtime");
13900
14192
  var SearchBar = ({
13901
14193
  onSearch,
13902
14194
  searchButtonProps,
@@ -13904,16 +14196,16 @@ var SearchBar = ({
13904
14196
  ...inputProps
13905
14197
  }) => {
13906
14198
  const translation = useHightideTranslation();
13907
- return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { ...containerProps, className: (0, import_clsx53.clsx)("relative", containerProps?.className), children: [
13908
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
14199
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { ...containerProps, className: (0, import_clsx54.clsx)("relative", containerProps?.className), children: [
14200
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
13909
14201
  InputUncontrolled,
13910
14202
  {
13911
14203
  ...inputProps,
13912
14204
  placeholder: inputProps.placeholder ?? translation("search"),
13913
- className: (0, import_clsx53.clsx)("pr-10 w-full", inputProps.className)
14205
+ className: (0, import_clsx54.clsx)("pr-10 w-full", inputProps.className)
13914
14206
  }
13915
14207
  ),
13916
- onSearch && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
14208
+ onSearch && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
13917
14209
  Button,
13918
14210
  {
13919
14211
  ...searchButtonProps,
@@ -13922,34 +14214,34 @@ var SearchBar = ({
13922
14214
  color: "neutral",
13923
14215
  coloringStyle: "text",
13924
14216
  onClick: (event) => onSearch(event),
13925
- className: (0, import_clsx53.clsx)("absolute right-1 top-1/2 -translate-y-1/2", searchButtonProps?.className),
13926
- children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react23.Search, { className: "w-full h-full" })
14217
+ className: (0, import_clsx54.clsx)("absolute right-1 top-1/2 -translate-y-1/2", searchButtonProps?.className),
14218
+ children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react24.Search, { className: "w-full h-full" })
13927
14219
  }
13928
14220
  )
13929
14221
  ] });
13930
14222
  };
13931
14223
 
13932
14224
  // src/components/user-action/input/ToggleableInput.tsx
13933
- var import_react47 = require("react");
13934
- var import_lucide_react24 = require("lucide-react");
13935
- var import_clsx54 = __toESM(require("clsx"));
13936
- var import_jsx_runtime67 = require("react/jsx-runtime");
13937
- var ToggleableInput = (0, import_react47.forwardRef)(function ToggleableInput2({
14225
+ var import_react49 = require("react");
14226
+ var import_lucide_react25 = require("lucide-react");
14227
+ var import_clsx55 = __toESM(require("clsx"));
14228
+ var import_jsx_runtime68 = require("react/jsx-runtime");
14229
+ var ToggleableInput = (0, import_react49.forwardRef)(function ToggleableInput2({
13938
14230
  value,
13939
14231
  initialState = "display",
13940
14232
  editCompleteOptions,
13941
14233
  ...props
13942
14234
  }, forwardedRef) {
13943
- const [isEditing, setIsEditing] = (0, import_react47.useState)(initialState !== "display");
13944
- const innerRef = (0, import_react47.useRef)(null);
13945
- (0, import_react47.useImperativeHandle)(forwardedRef, () => innerRef.current);
13946
- (0, import_react47.useEffect)(() => {
14235
+ const [isEditing, setIsEditing] = (0, import_react49.useState)(initialState !== "display");
14236
+ const innerRef = (0, import_react49.useRef)(null);
14237
+ (0, import_react49.useImperativeHandle)(forwardedRef, () => innerRef.current);
14238
+ (0, import_react49.useEffect)(() => {
13947
14239
  if (isEditing) {
13948
14240
  innerRef.current?.focus();
13949
14241
  }
13950
14242
  }, [isEditing]);
13951
- return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: (0, import_clsx54.default)("relative flex-row-2", { "flex-1": isEditing }), children: [
13952
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
14243
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: (0, import_clsx55.default)("relative flex-row-2", { "flex-1": isEditing }), children: [
14244
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
13953
14245
  Input,
13954
14246
  {
13955
14247
  ...props,
@@ -13970,14 +14262,14 @@ var ToggleableInput = (0, import_react47.forwardRef)(function ToggleableInput2({
13970
14262
  },
13971
14263
  "data-name": props["data-name"] ?? "togglable-input",
13972
14264
  "data-isEditing": isEditing ? "" : void 0,
13973
- className: (0, import_clsx54.default)(`w-full rounded-md`, {
14265
+ className: (0, import_clsx55.default)(`w-full rounded-md`, {
13974
14266
  "text-transparent": !isEditing
13975
14267
  })
13976
14268
  }
13977
14269
  ),
13978
- !isEditing && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "absolute left-0 flex-row-2 items-center pointer-events-none touch-none w-full overflow-hidden", children: [
13979
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: (0, import_clsx54.default)(" truncate"), children: value }),
13980
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react24.Pencil, { className: (0, import_clsx54.default)(`size-force-4`, { "text-transparent": isEditing }) })
14270
+ !isEditing && /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "absolute left-0 flex-row-2 items-center pointer-events-none touch-none w-full overflow-hidden", children: [
14271
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: (0, import_clsx55.default)(" truncate"), children: value }),
14272
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_lucide_react25.Pencil, { className: (0, import_clsx55.default)(`size-force-4`, { "text-transparent": isEditing }) })
13981
14273
  ] })
13982
14274
  ] });
13983
14275
  });
@@ -13987,7 +14279,7 @@ var ToggleableInputUncontrolled = ({
13987
14279
  ...restProps
13988
14280
  }) => {
13989
14281
  const [value, setValue] = useOverwritableState(initialValue, onChangeText);
13990
- return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
14282
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
13991
14283
  ToggleableInput,
13992
14284
  {
13993
14285
  value,
@@ -13998,33 +14290,33 @@ var ToggleableInputUncontrolled = ({
13998
14290
  };
13999
14291
 
14000
14292
  // src/components/utils/FocusTrap.tsx
14001
- var import_react48 = require("react");
14002
- var import_react49 = require("react");
14003
14293
  var import_react50 = require("react");
14004
- var import_jsx_runtime68 = require("react/jsx-runtime");
14005
- var FocusTrap = (0, import_react50.forwardRef)(function FocusTrap2({
14294
+ var import_react51 = require("react");
14295
+ var import_react52 = require("react");
14296
+ var import_jsx_runtime69 = require("react/jsx-runtime");
14297
+ var FocusTrap = (0, import_react52.forwardRef)(function FocusTrap2({
14006
14298
  active = true,
14007
14299
  initialFocus,
14008
14300
  focusFirst = false,
14009
14301
  ...props
14010
14302
  }, forwardedRef) {
14011
- const innerRef = (0, import_react48.useRef)(null);
14012
- (0, import_react49.useImperativeHandle)(forwardedRef, () => innerRef.current);
14303
+ const innerRef = (0, import_react50.useRef)(null);
14304
+ (0, import_react51.useImperativeHandle)(forwardedRef, () => innerRef.current);
14013
14305
  useFocusTrap({ container: innerRef, active, initialFocus, focusFirst });
14014
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { ref: innerRef, ...props });
14306
+ return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { ref: innerRef, ...props });
14015
14307
  });
14016
14308
 
14017
14309
  // src/components/utils/Transition.tsx
14018
- var import_react51 = require("react");
14310
+ var import_react53 = require("react");
14019
14311
  function Transition({
14020
14312
  children,
14021
14313
  show,
14022
14314
  includeAnimation = true
14023
14315
  }) {
14024
- const [isOpen, setIsOpen] = (0, import_react51.useState)(show);
14025
- const [isTransitioning, setIsTransitioning] = (0, import_react51.useState)(!isOpen);
14316
+ const [isOpen, setIsOpen] = (0, import_react53.useState)(show);
14317
+ const [isTransitioning, setIsTransitioning] = (0, import_react53.useState)(!isOpen);
14026
14318
  const isUsingReducedMotion = typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : true;
14027
- (0, import_react51.useEffect)(() => {
14319
+ (0, import_react53.useEffect)(() => {
14028
14320
  setIsOpen(show);
14029
14321
  setIsTransitioning(true);
14030
14322
  }, [show]);
@@ -14049,7 +14341,7 @@ function Transition({
14049
14341
  }
14050
14342
 
14051
14343
  // src/hooks/focus/useFocusGuards.ts
14052
- var import_react52 = require("react");
14344
+ var import_react54 = require("react");
14053
14345
  var selectorName = "data-hw-focus-guard";
14054
14346
  function FocusGuard() {
14055
14347
  const element = document.createElement("div");
@@ -14087,7 +14379,7 @@ var FocusGuardsService = class _FocusGuardsService {
14087
14379
  }
14088
14380
  };
14089
14381
  var useFocusGuards = () => {
14090
- (0, import_react52.useEffect)(() => {
14382
+ (0, import_react54.useEffect)(() => {
14091
14383
  FocusGuardsService.getInstance().add();
14092
14384
  return () => {
14093
14385
  FocusGuardsService.getInstance().remove();
@@ -14096,10 +14388,10 @@ var useFocusGuards = () => {
14096
14388
  };
14097
14389
 
14098
14390
  // src/hooks/focus/useFocusOnceVisible.ts
14099
- var import_react53 = __toESM(require("react"));
14391
+ var import_react55 = __toESM(require("react"));
14100
14392
  var useFocusOnceVisible = (ref, disable = false) => {
14101
- const [hasUsedFocus, setHasUsedFocus] = import_react53.default.useState(false);
14102
- (0, import_react53.useEffect)(() => {
14393
+ const [hasUsedFocus, setHasUsedFocus] = import_react55.default.useState(false);
14394
+ (0, import_react55.useEffect)(() => {
14103
14395
  if (disable || hasUsedFocus) {
14104
14396
  return;
14105
14397
  }
@@ -14119,13 +14411,13 @@ var useFocusOnceVisible = (ref, disable = false) => {
14119
14411
  };
14120
14412
 
14121
14413
  // src/hooks/useRerender.ts
14122
- var import_react54 = require("react");
14414
+ var import_react56 = require("react");
14123
14415
  var useRerender = () => {
14124
- return (0, import_react54.useReducer)(() => ({}), {})[1];
14416
+ return (0, import_react56.useReducer)(() => ({}), {})[1];
14125
14417
  };
14126
14418
 
14127
14419
  // src/hooks/useSearch.ts
14128
- var import_react55 = require("react");
14420
+ var import_react57 = require("react");
14129
14421
 
14130
14422
  // src/utils/simpleSearch.ts
14131
14423
  var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
@@ -14164,34 +14456,34 @@ var useSearch = ({
14164
14456
  filter,
14165
14457
  disabled = false
14166
14458
  }) => {
14167
- const [search, setSearch] = (0, import_react55.useState)(initialSearch ?? "");
14168
- const [result, setResult] = (0, import_react55.useState)(list);
14169
- const searchTags = (0, import_react55.useMemo)(() => additionalSearchTags ?? [], [additionalSearchTags]);
14170
- const updateSearch = (0, import_react55.useCallback)((newSearch) => {
14459
+ const [search, setSearch] = (0, import_react57.useState)(initialSearch ?? "");
14460
+ const [result, setResult] = (0, import_react57.useState)(list);
14461
+ const searchTags = (0, import_react57.useMemo)(() => additionalSearchTags ?? [], [additionalSearchTags]);
14462
+ const updateSearch = (0, import_react57.useCallback)((newSearch) => {
14171
14463
  const usedSearch = newSearch ?? search;
14172
14464
  if (newSearch) {
14173
14465
  setSearch(search);
14174
14466
  }
14175
14467
  setResult(MultiSubjectSearchWithMapping([usedSearch, ...searchTags], list, searchMapping));
14176
14468
  }, [searchTags, list, search, searchMapping]);
14177
- (0, import_react55.useEffect)(() => {
14469
+ (0, import_react57.useEffect)(() => {
14178
14470
  if (isSearchInstant) {
14179
14471
  setResult(MultiSubjectSearchWithMapping([search, ...searchTags], list, searchMapping));
14180
14472
  }
14181
14473
  }, [searchTags, isSearchInstant, list, search, searchMapping, additionalSearchTags]);
14182
- const filteredResult = (0, import_react55.useMemo)(() => {
14474
+ const filteredResult = (0, import_react57.useMemo)(() => {
14183
14475
  if (!filter) {
14184
14476
  return result;
14185
14477
  }
14186
14478
  return result.filter(filter);
14187
14479
  }, [result, filter]);
14188
- const sortedAndFilteredResult = (0, import_react55.useMemo)(() => {
14480
+ const sortedAndFilteredResult = (0, import_react57.useMemo)(() => {
14189
14481
  if (!sortingFunction) {
14190
14482
  return filteredResult;
14191
14483
  }
14192
14484
  return filteredResult.sort(sortingFunction);
14193
14485
  }, [filteredResult, sortingFunction]);
14194
- const usedResult = (0, import_react55.useMemo)(() => {
14486
+ const usedResult = (0, import_react57.useMemo)(() => {
14195
14487
  if (!disabled) {
14196
14488
  return sortedAndFilteredResult;
14197
14489
  }
@@ -14301,6 +14593,106 @@ var builder = (value, update) => {
14301
14593
  return value;
14302
14594
  };
14303
14595
 
14596
+ // src/utils/duration.ts
14597
+ var Duration = class _Duration {
14598
+ constructor({
14599
+ years = 0,
14600
+ months = 0,
14601
+ days = 0,
14602
+ hours = 0,
14603
+ minutes = 0,
14604
+ seconds = 0,
14605
+ milliseconds = 0
14606
+ } = {}) {
14607
+ this.assertRanges({ years, months, days, hours, minutes, seconds, milliseconds });
14608
+ this.years = years;
14609
+ this.months = months;
14610
+ this.days = days;
14611
+ this.hours = hours;
14612
+ this.minutes = minutes;
14613
+ this.seconds = seconds;
14614
+ this.milliseconds = milliseconds;
14615
+ }
14616
+ /** Date arithmetic */
14617
+ addTo(date) {
14618
+ return this.applyTo(date, 1);
14619
+ }
14620
+ subtractFrom(date) {
14621
+ return this.applyTo(date, -1);
14622
+ }
14623
+ /** Duration arithmetic */
14624
+ add(other) {
14625
+ return new _Duration({
14626
+ years: this.years + other.years,
14627
+ months: this.months + other.months,
14628
+ days: this.days + other.days,
14629
+ hours: this.hours + other.hours,
14630
+ minutes: this.minutes + other.minutes,
14631
+ seconds: this.seconds + other.seconds,
14632
+ milliseconds: this.milliseconds + other.milliseconds
14633
+ });
14634
+ }
14635
+ subtract(other) {
14636
+ return new _Duration({
14637
+ years: this.years - other.years,
14638
+ months: this.months - other.months,
14639
+ days: this.days - other.days,
14640
+ hours: this.hours - other.hours,
14641
+ minutes: this.minutes - other.minutes,
14642
+ seconds: this.seconds - other.seconds,
14643
+ milliseconds: this.milliseconds - other.milliseconds
14644
+ });
14645
+ }
14646
+ equals(other) {
14647
+ return this.years === other.years && this.months === other.months && this.days === other.days && this.hours === other.hours && this.minutes === other.minutes && this.seconds === other.seconds && this.milliseconds === other.milliseconds;
14648
+ }
14649
+ toJSON() {
14650
+ return { ...this };
14651
+ }
14652
+ /** Static difference */
14653
+ static difference(start, end) {
14654
+ const diff = end.getTime() - start.getTime();
14655
+ const ms = 1e3;
14656
+ const min = 60 * ms;
14657
+ const hr = 60 * min;
14658
+ const day = 24 * hr;
14659
+ const month = 30 * day;
14660
+ const year = 365.25 * day;
14661
+ return new _Duration({
14662
+ years: Math.floor(diff / year),
14663
+ months: Math.floor(diff / month),
14664
+ days: Math.floor(diff / day),
14665
+ hours: Math.floor(diff % day / hr),
14666
+ minutes: Math.floor(diff % hr / min),
14667
+ seconds: Math.floor(diff % min / ms),
14668
+ milliseconds: diff % ms
14669
+ });
14670
+ }
14671
+ applyTo(date, multiplier) {
14672
+ const d = new Date(date);
14673
+ d.setFullYear(d.getFullYear() + multiplier * this.years);
14674
+ d.setMonth(d.getMonth() + multiplier * this.months);
14675
+ d.setDate(d.getDate() + multiplier * this.days);
14676
+ d.setHours(d.getHours() + multiplier * this.hours);
14677
+ d.setMinutes(d.getMinutes() + multiplier * this.minutes);
14678
+ d.setSeconds(d.getSeconds() + multiplier * this.seconds);
14679
+ d.setMilliseconds(d.getMilliseconds() + multiplier * this.milliseconds);
14680
+ return d;
14681
+ }
14682
+ assertRanges(d) {
14683
+ if (d.years < 0) throw new RangeError("years >= 0");
14684
+ if (d.months < 0 || d.months > 11) throw new RangeError("months: 0\u201311");
14685
+ if (d.days < 0) throw new RangeError("days >= 0");
14686
+ if (d.hours < 0 || d.hours > 23) throw new RangeError("hours: 0\u201323");
14687
+ if (d.minutes < 0 || d.minutes > 59) throw new RangeError("minutes: 0\u201359");
14688
+ if (d.seconds < 0 || d.seconds > 59) throw new RangeError("seconds: 0\u201359");
14689
+ if (d.milliseconds < 0) throw new RangeError("milliseconds >= 0");
14690
+ }
14691
+ valueOf() {
14692
+ return this.milliseconds + this.seconds * 1e3 + this.minutes * 6e4 + this.hours * 36e5 + this.days * 864e5;
14693
+ }
14694
+ };
14695
+
14304
14696
  // src/utils/easeFunctions.ts
14305
14697
  var EaseFunctions = class _EaseFunctions {
14306
14698
  static cubicBezierGeneric(x1, y1, x2, y2) {
@@ -14439,12 +14831,16 @@ var PromiseUtils = {
14439
14831
  DatePicker,
14440
14832
  DatePickerUncontrolled,
14441
14833
  DateProperty,
14834
+ DateTimeInput,
14835
+ DateTimeInputUncontrolled,
14442
14836
  DateTimePicker,
14837
+ DateUtils,
14443
14838
  DayPicker,
14444
14839
  DayPickerUncontrolled,
14445
14840
  Dialog,
14446
14841
  DiscardChangesDialog,
14447
14842
  DividerInserter,
14843
+ Duration,
14448
14844
  EaseFunctions,
14449
14845
  ErrorComponent,
14450
14846
  Expandable,
@@ -14542,6 +14938,7 @@ var PromiseUtils = {
14542
14938
  Transition,
14543
14939
  UseValidators,
14544
14940
  VerticalDivider,
14941
+ Visibility,
14545
14942
  YearMonthPicker,
14546
14943
  YearMonthPickerUncontrolled,
14547
14944
  addDuration,
@@ -14551,19 +14948,16 @@ var PromiseUtils = {
14551
14948
  closestMatch,
14552
14949
  createLoopingList,
14553
14950
  createLoopingListWithIndex,
14554
- equalDate,
14555
14951
  equalSizeGroups,
14556
14952
  formatDate,
14557
14953
  formatDateTime,
14558
14954
  getBetweenDuration,
14559
- getDaysInMonth,
14560
14955
  getNeighbours,
14561
14956
  getWeeksForCalenderMonth,
14562
14957
  hightideTranslation,
14563
14958
  hightideTranslationLocales,
14564
14959
  isInTimeSpan,
14565
14960
  match,
14566
- monthsList,
14567
14961
  noop,
14568
14962
  range,
14569
14963
  resolveSetState,
@@ -14593,7 +14987,6 @@ var PromiseUtils = {
14593
14987
  useTranslatedValidators,
14594
14988
  useZIndexRegister,
14595
14989
  validateEmail,
14596
- weekDayList,
14597
14990
  writeToClipboard
14598
14991
  });
14599
14992
  //# sourceMappingURL=index.js.map