@helpwave/hightide 0.8.9 → 0.8.11
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.d.mts +293 -296
- package/dist/index.d.ts +293 -296
- package/dist/index.js +166 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +206 -67
- package/dist/index.mjs.map +1 -1
- package/dist/style/globals.css +1 -1
- package/dist/style/uncompiled/theme/components/time-picker.css +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -14394,15 +14394,15 @@ var TableSortButton = ({
|
|
|
14394
14394
|
|
|
14395
14395
|
// src/components/layout/table/TableFilterButton.tsx
|
|
14396
14396
|
import { FilterIcon } from "lucide-react";
|
|
14397
|
-
import { useEffect as useEffect39, useId as useId15, useMemo as
|
|
14397
|
+
import { useEffect as useEffect39, useId as useId15, useMemo as useMemo29, useRef as useRef31, useState as useState34 } from "react";
|
|
14398
14398
|
|
|
14399
14399
|
// src/components/user-interaction/input/DateTimeInput.tsx
|
|
14400
|
-
import { forwardRef as forwardRef17, useCallback as useCallback26, useEffect as useEffect38, useId as useId13, useImperativeHandle as useImperativeHandle11, useMemo as
|
|
14400
|
+
import { forwardRef as forwardRef17, useCallback as useCallback26, useEffect as useEffect38, useId as useId13, useImperativeHandle as useImperativeHandle11, useMemo as useMemo27, useRef as useRef30, useState as useState32 } from "react";
|
|
14401
14401
|
import { CalendarIcon } from "lucide-react";
|
|
14402
14402
|
import clsx24 from "clsx";
|
|
14403
14403
|
|
|
14404
14404
|
// src/components/user-interaction/date/TimePicker.tsx
|
|
14405
|
-
import { useEffect as useEffect28, useRef as useRef26 } from "react";
|
|
14405
|
+
import { useEffect as useEffect28, useMemo as useMemo22, useRef as useRef26 } from "react";
|
|
14406
14406
|
import { jsx as jsx60, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
14407
14407
|
var TimePicker = ({
|
|
14408
14408
|
value: controlledValue,
|
|
@@ -14411,6 +14411,9 @@ var TimePicker = ({
|
|
|
14411
14411
|
onEditComplete,
|
|
14412
14412
|
is24HourFormat = true,
|
|
14413
14413
|
minuteIncrement = "5min",
|
|
14414
|
+
secondIncrement = "5s",
|
|
14415
|
+
millisecondIncrement = "100ms",
|
|
14416
|
+
precision = "minute",
|
|
14414
14417
|
className
|
|
14415
14418
|
}) => {
|
|
14416
14419
|
const [value, setValue] = useControlledState({
|
|
@@ -14422,22 +14425,58 @@ var TimePicker = ({
|
|
|
14422
14425
|
const hourRef = useRef26(null);
|
|
14423
14426
|
const isPM = value.getHours() > 11;
|
|
14424
14427
|
const hours = is24HourFormat ? range(24) : range(12);
|
|
14425
|
-
|
|
14426
|
-
|
|
14427
|
-
|
|
14428
|
-
|
|
14429
|
-
|
|
14430
|
-
|
|
14431
|
-
|
|
14432
|
-
|
|
14433
|
-
|
|
14434
|
-
|
|
14435
|
-
|
|
14436
|
-
|
|
14437
|
-
|
|
14438
|
-
|
|
14439
|
-
|
|
14440
|
-
|
|
14428
|
+
const minutes = useMemo22(() => {
|
|
14429
|
+
const full = range(60);
|
|
14430
|
+
switch (minuteIncrement) {
|
|
14431
|
+
case "5min":
|
|
14432
|
+
return full.filter((value2) => value2 % 5 === 0);
|
|
14433
|
+
case "10min":
|
|
14434
|
+
return full.filter((value2) => value2 % 10 === 0);
|
|
14435
|
+
case "15min":
|
|
14436
|
+
return full.filter((value2) => value2 % 15 === 0);
|
|
14437
|
+
case "30min":
|
|
14438
|
+
return full.filter((value2) => value2 % 30 === 0);
|
|
14439
|
+
}
|
|
14440
|
+
}, [minuteIncrement]);
|
|
14441
|
+
const seconds = useMemo22(() => {
|
|
14442
|
+
const full = range(60);
|
|
14443
|
+
switch (secondIncrement) {
|
|
14444
|
+
case "1s":
|
|
14445
|
+
return full.filter((value2) => value2 % 1 === 0);
|
|
14446
|
+
case "5s":
|
|
14447
|
+
return full.filter((value2) => value2 % 5 === 0);
|
|
14448
|
+
case "10s":
|
|
14449
|
+
return full.filter((value2) => value2 % 10 === 0);
|
|
14450
|
+
case "15s":
|
|
14451
|
+
return full.filter((value2) => value2 % 15 === 0);
|
|
14452
|
+
case "30s":
|
|
14453
|
+
return full.filter((value2) => value2 % 30 === 0);
|
|
14454
|
+
}
|
|
14455
|
+
}, [secondIncrement]);
|
|
14456
|
+
const milliseconds = useMemo22(() => {
|
|
14457
|
+
const full = range(1e3);
|
|
14458
|
+
switch (millisecondIncrement) {
|
|
14459
|
+
case "1ms":
|
|
14460
|
+
return full.filter((value2) => value2 % 1 === 0);
|
|
14461
|
+
case "5ms":
|
|
14462
|
+
return full.filter((value2) => value2 % 5 === 0);
|
|
14463
|
+
case "10ms":
|
|
14464
|
+
return full.filter((value2) => value2 % 10 === 0);
|
|
14465
|
+
case "25ms":
|
|
14466
|
+
return full.filter((value2) => value2 % 25 === 0);
|
|
14467
|
+
case "50ms":
|
|
14468
|
+
return full.filter((value2) => value2 % 50 === 0);
|
|
14469
|
+
case "100ms":
|
|
14470
|
+
return full.filter((value2) => value2 % 100 === 0);
|
|
14471
|
+
case "250ms":
|
|
14472
|
+
return full.filter((value2) => value2 % 250 === 0);
|
|
14473
|
+
case "500ms":
|
|
14474
|
+
return full.filter((value2) => value2 % 500 === 0);
|
|
14475
|
+
}
|
|
14476
|
+
}, [millisecondIncrement]);
|
|
14477
|
+
const closestMinute = useMemo22(() => closestMatch(minutes, (item1, item2) => Math.abs(item1 - value.getMinutes()) < Math.abs(item2 - value.getMinutes())), [minutes, value]);
|
|
14478
|
+
const closestSecond = useMemo22(() => closestMatch(seconds, (item1, item2) => Math.abs(item1 - value.getSeconds()) < Math.abs(item2 - value.getSeconds())), [seconds, value]);
|
|
14479
|
+
const closestMillisecond = useMemo22(() => closestMatch(milliseconds, (item1, item2) => Math.abs(item1 - value.getMilliseconds()) < Math.abs(item2 - value.getMilliseconds())), [milliseconds, value]);
|
|
14441
14480
|
const hour = value.getHours();
|
|
14442
14481
|
useEffect28(() => {
|
|
14443
14482
|
minuteRef.current?.scrollIntoView({
|
|
@@ -14488,6 +14527,36 @@ var TimePicker = ({
|
|
|
14488
14527
|
minute + minuteIncrement
|
|
14489
14528
|
);
|
|
14490
14529
|
}) }),
|
|
14530
|
+
/* @__PURE__ */ jsx60(Visibility, { isVisible: precision === "second" || precision === "millisecond", children: /* @__PURE__ */ jsx60("div", { "data-name": "time-picker-value-column", children: seconds.map((second) => {
|
|
14531
|
+
const isSelected = second === closestSecond;
|
|
14532
|
+
return /* @__PURE__ */ jsx60(
|
|
14533
|
+
Button,
|
|
14534
|
+
{
|
|
14535
|
+
size: "sm",
|
|
14536
|
+
color: isSelected ? "primary" : "neutral",
|
|
14537
|
+
ref: isSelected ? minuteRef : void 0,
|
|
14538
|
+
onClick: () => onChangeWrapper((newDate) => newDate.setSeconds(second)),
|
|
14539
|
+
className: "min-w-16",
|
|
14540
|
+
children: second.toString().padStart(2, "0")
|
|
14541
|
+
},
|
|
14542
|
+
second + secondIncrement
|
|
14543
|
+
);
|
|
14544
|
+
}) }) }),
|
|
14545
|
+
/* @__PURE__ */ jsx60(Visibility, { isVisible: precision === "millisecond", children: /* @__PURE__ */ jsx60("div", { "data-name": "time-picker-value-column", children: milliseconds.map((millisecond) => {
|
|
14546
|
+
const isSelected = millisecond === closestMillisecond;
|
|
14547
|
+
return /* @__PURE__ */ jsx60(
|
|
14548
|
+
Button,
|
|
14549
|
+
{
|
|
14550
|
+
size: "sm",
|
|
14551
|
+
color: isSelected ? "primary" : "neutral",
|
|
14552
|
+
ref: isSelected ? minuteRef : void 0,
|
|
14553
|
+
onClick: () => onChangeWrapper((newDate) => newDate.setMilliseconds(millisecond)),
|
|
14554
|
+
className: "min-w-16",
|
|
14555
|
+
children: millisecond.toString().padStart(2, "0")
|
|
14556
|
+
},
|
|
14557
|
+
millisecond + millisecondIncrement
|
|
14558
|
+
);
|
|
14559
|
+
}) }) }),
|
|
14491
14560
|
!is24HourFormat && /* @__PURE__ */ jsxs30("div", { "data-name": "time-picker-value-column", children: [
|
|
14492
14561
|
/* @__PURE__ */ jsx60(
|
|
14493
14562
|
Button,
|
|
@@ -14658,14 +14727,40 @@ var formatRelative = (date, locale) => {
|
|
|
14658
14727
|
if (Math.abs(diffInSeconds) < timesInSeconds.yearImprecise) return rtf.format(Math.round(diffInSeconds / timesInSeconds.monthImprecise), "month");
|
|
14659
14728
|
return rtf.format(Math.round(diffInSeconds / timesInSeconds.yearImprecise), "year");
|
|
14660
14729
|
};
|
|
14661
|
-
var toInputString = (date, format) => {
|
|
14730
|
+
var toInputString = (date, format, precision = "minute", isLocalTime = true) => {
|
|
14731
|
+
const pad = (n, l = 2) => String(n).padStart(l, "0");
|
|
14732
|
+
const parts = isLocalTime ? {
|
|
14733
|
+
y: date.getFullYear(),
|
|
14734
|
+
m: date.getMonth() + 1,
|
|
14735
|
+
d: date.getDate(),
|
|
14736
|
+
h: date.getHours(),
|
|
14737
|
+
min: date.getMinutes(),
|
|
14738
|
+
s: date.getSeconds(),
|
|
14739
|
+
ms: date.getMilliseconds()
|
|
14740
|
+
} : {
|
|
14741
|
+
y: date.getUTCFullYear(),
|
|
14742
|
+
m: date.getUTCMonth() + 1,
|
|
14743
|
+
d: date.getUTCDate(),
|
|
14744
|
+
h: date.getUTCHours(),
|
|
14745
|
+
min: date.getUTCMinutes(),
|
|
14746
|
+
s: date.getUTCSeconds(),
|
|
14747
|
+
ms: date.getUTCMilliseconds()
|
|
14748
|
+
};
|
|
14749
|
+
const dateStr = `${pad(parts.y, 4)}-${pad(parts.m)}-${pad(parts.d)}`;
|
|
14750
|
+
let timeStr = `${pad(parts.h)}:${pad(parts.min)}`;
|
|
14751
|
+
if (precision === "second" || precision === "millisecond") {
|
|
14752
|
+
timeStr += `:${pad(parts.s)}`;
|
|
14753
|
+
}
|
|
14754
|
+
if (precision === "millisecond") {
|
|
14755
|
+
timeStr += `.${pad(parts.ms, 3)}`;
|
|
14756
|
+
}
|
|
14662
14757
|
switch (format) {
|
|
14663
14758
|
case "date":
|
|
14664
|
-
return
|
|
14759
|
+
return dateStr;
|
|
14665
14760
|
case "time":
|
|
14666
|
-
return
|
|
14761
|
+
return timeStr;
|
|
14667
14762
|
case "dateTime":
|
|
14668
|
-
return
|
|
14763
|
+
return `${dateStr}T${timeStr}`;
|
|
14669
14764
|
}
|
|
14670
14765
|
};
|
|
14671
14766
|
var DateUtils = {
|
|
@@ -14686,7 +14781,7 @@ var DateUtils = {
|
|
|
14686
14781
|
import clsx23 from "clsx";
|
|
14687
14782
|
|
|
14688
14783
|
// src/components/user-interaction/date/DayPicker.tsx
|
|
14689
|
-
import { useCallback as useCallback23, useEffect as useEffect29, useMemo as
|
|
14784
|
+
import { useCallback as useCallback23, useEffect as useEffect29, useMemo as useMemo23, useRef as useRef27 } from "react";
|
|
14690
14785
|
import { jsx as jsx61, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
14691
14786
|
var DayPicker = ({
|
|
14692
14787
|
displayedMonth: controlledDisplayedMonth,
|
|
@@ -14716,7 +14811,7 @@ var DayPicker = ({
|
|
|
14716
14811
|
const month = displayedMonth.getMonth();
|
|
14717
14812
|
const weeks = DateUtils.weeksForCalenderMonth(displayedMonth, weekStart);
|
|
14718
14813
|
const selectedButtonRef = useRef27(null);
|
|
14719
|
-
const isValueInDisplayedWeeks =
|
|
14814
|
+
const isValueInDisplayedWeeks = useMemo23(
|
|
14720
14815
|
() => !!value && weeks.some((week) => week.some((d) => DateUtils.equalDate(value, d))),
|
|
14721
14816
|
[value, weeks]
|
|
14722
14817
|
);
|
|
@@ -14728,11 +14823,11 @@ var DayPicker = ({
|
|
|
14728
14823
|
useEffect29(() => {
|
|
14729
14824
|
selectedButtonRef.current?.focus();
|
|
14730
14825
|
}, [focusTargetDate]);
|
|
14731
|
-
const end =
|
|
14826
|
+
const end = useMemo23(() => {
|
|
14732
14827
|
if (!providedEnd) return;
|
|
14733
14828
|
return new Date(providedEnd.getFullYear(), providedEnd.getMonth(), providedEnd.getDate());
|
|
14734
14829
|
}, [providedEnd]);
|
|
14735
|
-
const start =
|
|
14830
|
+
const start = useMemo23(() => {
|
|
14736
14831
|
if (!providedStart) return;
|
|
14737
14832
|
return new Date(providedStart.getFullYear(), providedStart.getMonth(), providedStart.getDate());
|
|
14738
14833
|
}, [providedStart]);
|
|
@@ -14782,7 +14877,8 @@ var DayPicker = ({
|
|
|
14782
14877
|
date.getDate(),
|
|
14783
14878
|
value.getHours(),
|
|
14784
14879
|
value.getMinutes(),
|
|
14785
|
-
value.getSeconds()
|
|
14880
|
+
value.getSeconds(),
|
|
14881
|
+
value.getMilliseconds()
|
|
14786
14882
|
);
|
|
14787
14883
|
setValue(newDate);
|
|
14788
14884
|
onEditComplete?.(newDate);
|
|
@@ -14806,7 +14902,7 @@ var DayPicker = ({
|
|
|
14806
14902
|
};
|
|
14807
14903
|
|
|
14808
14904
|
// src/components/user-interaction/date/YearMonthPicker.tsx
|
|
14809
|
-
import { memo, useCallback as useCallback24, useEffect as useEffect30, useMemo as
|
|
14905
|
+
import { memo, useCallback as useCallback24, useEffect as useEffect30, useMemo as useMemo24, useRef as useRef28, useState as useState26 } from "react";
|
|
14810
14906
|
import clsx22 from "clsx";
|
|
14811
14907
|
import { jsx as jsx62, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
14812
14908
|
var YearRow = memo(function YearRow2({
|
|
@@ -14825,7 +14921,7 @@ var YearRow = memo(function YearRow2({
|
|
|
14825
14921
|
ref.current?.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
14826
14922
|
}
|
|
14827
14923
|
}, [isSelectedYear]);
|
|
14828
|
-
const monthGrid =
|
|
14924
|
+
const monthGrid = useMemo24(() => equalSizeGroups([...DateUtils.monthsList], 3), []);
|
|
14829
14925
|
return /* @__PURE__ */ jsxs32(
|
|
14830
14926
|
ExpandableRoot,
|
|
14831
14927
|
{
|
|
@@ -14880,19 +14976,19 @@ var YearMonthPicker = ({
|
|
|
14880
14976
|
defaultValue: initialValue
|
|
14881
14977
|
});
|
|
14882
14978
|
const onEditCompleteStable = useEventCallbackStabilizer(onEditComplete);
|
|
14883
|
-
const monthNames =
|
|
14979
|
+
const monthNames = useMemo24(() => {
|
|
14884
14980
|
const formatter = new Intl.DateTimeFormat(locale, { month: "short" });
|
|
14885
14981
|
return Array.from({ length: 12 }, (_, i) => formatter.format(new Date(2e3, i, 1)));
|
|
14886
14982
|
}, [locale]);
|
|
14887
|
-
const years =
|
|
14983
|
+
const years = useMemo24(
|
|
14888
14984
|
() => range([start.getFullYear(), end.getFullYear()], { exclusiveEnd: false }),
|
|
14889
14985
|
[start, end]
|
|
14890
14986
|
);
|
|
14891
|
-
const minTimestamp =
|
|
14987
|
+
const minTimestamp = useMemo24(() => {
|
|
14892
14988
|
if (!start) return;
|
|
14893
14989
|
return new Date(start.getFullYear(), start.getMonth(), 1).getTime();
|
|
14894
14990
|
}, [start]);
|
|
14895
|
-
const maxTimestamp =
|
|
14991
|
+
const maxTimestamp = useMemo24(() => {
|
|
14896
14992
|
if (!end) return;
|
|
14897
14993
|
return new Date(end.getFullYear(), end.getMonth() + 1, 0).getTime();
|
|
14898
14994
|
}, [end]);
|
|
@@ -15056,6 +15152,9 @@ var DateTimePicker = ({
|
|
|
15056
15152
|
is24HourFormat,
|
|
15057
15153
|
minuteIncrement,
|
|
15058
15154
|
weekStart,
|
|
15155
|
+
secondIncrement,
|
|
15156
|
+
millisecondIncrement,
|
|
15157
|
+
precision,
|
|
15059
15158
|
onValueChange,
|
|
15060
15159
|
onEditComplete,
|
|
15061
15160
|
timePickerProps,
|
|
@@ -15093,6 +15192,9 @@ var DateTimePicker = ({
|
|
|
15093
15192
|
...timePickerProps,
|
|
15094
15193
|
is24HourFormat,
|
|
15095
15194
|
minuteIncrement,
|
|
15195
|
+
secondIncrement,
|
|
15196
|
+
millisecondIncrement,
|
|
15197
|
+
precision,
|
|
15096
15198
|
value,
|
|
15097
15199
|
onValueChange: setValue,
|
|
15098
15200
|
onEditComplete
|
|
@@ -15115,6 +15217,15 @@ var DateTimePickerDialog = ({
|
|
|
15115
15217
|
onEditComplete,
|
|
15116
15218
|
mode = "date",
|
|
15117
15219
|
pickerProps,
|
|
15220
|
+
start,
|
|
15221
|
+
end,
|
|
15222
|
+
weekStart,
|
|
15223
|
+
markToday,
|
|
15224
|
+
is24HourFormat,
|
|
15225
|
+
minuteIncrement,
|
|
15226
|
+
secondIncrement,
|
|
15227
|
+
millisecondIncrement,
|
|
15228
|
+
precision,
|
|
15118
15229
|
labelId,
|
|
15119
15230
|
label
|
|
15120
15231
|
}) => {
|
|
@@ -15140,7 +15251,16 @@ var DateTimePickerDialog = ({
|
|
|
15140
15251
|
mode,
|
|
15141
15252
|
value: state,
|
|
15142
15253
|
onValueChange: setState,
|
|
15143
|
-
onEditComplete: setState
|
|
15254
|
+
onEditComplete: setState,
|
|
15255
|
+
start,
|
|
15256
|
+
end,
|
|
15257
|
+
weekStart,
|
|
15258
|
+
markToday,
|
|
15259
|
+
is24HourFormat,
|
|
15260
|
+
minuteIncrement,
|
|
15261
|
+
secondIncrement,
|
|
15262
|
+
millisecondIncrement,
|
|
15263
|
+
precision
|
|
15144
15264
|
}
|
|
15145
15265
|
),
|
|
15146
15266
|
/* @__PURE__ */ jsxs35("div", { className: "flex-row-2 justify-end", children: [
|
|
@@ -15333,7 +15453,7 @@ var useRerender = () => {
|
|
|
15333
15453
|
};
|
|
15334
15454
|
|
|
15335
15455
|
// src/hooks/useSearch.ts
|
|
15336
|
-
import { useCallback as useCallback25, useEffect as useEffect36, useMemo as
|
|
15456
|
+
import { useCallback as useCallback25, useEffect as useEffect36, useMemo as useMemo25, useState as useState30 } from "react";
|
|
15337
15457
|
|
|
15338
15458
|
// src/utils/simpleSearch.ts
|
|
15339
15459
|
var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
|
|
@@ -15374,7 +15494,7 @@ var useSearch = ({
|
|
|
15374
15494
|
}) => {
|
|
15375
15495
|
const [search, setSearch] = useState30(initialSearch ?? "");
|
|
15376
15496
|
const [result, setResult] = useState30(list);
|
|
15377
|
-
const searchTags =
|
|
15497
|
+
const searchTags = useMemo25(() => additionalSearchTags ?? [], [additionalSearchTags]);
|
|
15378
15498
|
const updateSearch = useCallback25((newSearch) => {
|
|
15379
15499
|
const usedSearch = newSearch ?? search;
|
|
15380
15500
|
if (newSearch) {
|
|
@@ -15387,19 +15507,19 @@ var useSearch = ({
|
|
|
15387
15507
|
setResult(MultiSubjectSearchWithMapping([search, ...searchTags], list, searchMapping));
|
|
15388
15508
|
}
|
|
15389
15509
|
}, [searchTags, isSearchInstant, list, search, searchMapping, additionalSearchTags]);
|
|
15390
|
-
const filteredResult =
|
|
15510
|
+
const filteredResult = useMemo25(() => {
|
|
15391
15511
|
if (!filter) {
|
|
15392
15512
|
return result;
|
|
15393
15513
|
}
|
|
15394
15514
|
return result.filter(filter);
|
|
15395
15515
|
}, [result, filter]);
|
|
15396
|
-
const sortedAndFilteredResult =
|
|
15516
|
+
const sortedAndFilteredResult = useMemo25(() => {
|
|
15397
15517
|
if (!sortingFunction) {
|
|
15398
15518
|
return filteredResult;
|
|
15399
15519
|
}
|
|
15400
15520
|
return filteredResult.sort(sortingFunction);
|
|
15401
15521
|
}, [filteredResult, sortingFunction]);
|
|
15402
|
-
const usedResult =
|
|
15522
|
+
const usedResult = useMemo25(() => {
|
|
15403
15523
|
if (!disabled) {
|
|
15404
15524
|
return sortedAndFilteredResult;
|
|
15405
15525
|
}
|
|
@@ -15468,7 +15588,7 @@ var validateEmail = (email) => {
|
|
|
15468
15588
|
};
|
|
15469
15589
|
|
|
15470
15590
|
// src/hooks/useValidators.ts
|
|
15471
|
-
import { useMemo as
|
|
15591
|
+
import { useMemo as useMemo26 } from "react";
|
|
15472
15592
|
var notEmpty = (value) => {
|
|
15473
15593
|
if (!value) {
|
|
15474
15594
|
return "notEmpty";
|
|
@@ -15518,7 +15638,7 @@ var UseValidators = {
|
|
|
15518
15638
|
};
|
|
15519
15639
|
var useTranslatedValidators = () => {
|
|
15520
15640
|
const translation = useHightideTranslation();
|
|
15521
|
-
return
|
|
15641
|
+
return useMemo26(() => ({
|
|
15522
15642
|
notEmpty: (value) => {
|
|
15523
15643
|
const result = notEmpty(value);
|
|
15524
15644
|
if (result) {
|
|
@@ -15565,6 +15685,15 @@ var DateTimeInput = forwardRef17(function DateTimeInput2({
|
|
|
15565
15685
|
pickerProps,
|
|
15566
15686
|
outsideClickCloses = true,
|
|
15567
15687
|
onDialogOpeningChange,
|
|
15688
|
+
start,
|
|
15689
|
+
end,
|
|
15690
|
+
weekStart,
|
|
15691
|
+
markToday,
|
|
15692
|
+
is24HourFormat,
|
|
15693
|
+
minuteIncrement,
|
|
15694
|
+
secondIncrement,
|
|
15695
|
+
millisecondIncrement,
|
|
15696
|
+
precision,
|
|
15568
15697
|
disabled = false,
|
|
15569
15698
|
readOnly = false,
|
|
15570
15699
|
invalid = false,
|
|
@@ -15580,7 +15709,7 @@ var DateTimeInput = forwardRef17(function DateTimeInput2({
|
|
|
15580
15709
|
});
|
|
15581
15710
|
const [dialogValue, setDialogValue] = useState32(state ?? /* @__PURE__ */ new Date());
|
|
15582
15711
|
const [stringInputState, setStringInputState] = useState32({
|
|
15583
|
-
state: state ? DateUtils.toInputString(state, mode) : "",
|
|
15712
|
+
state: state ? DateUtils.toInputString(state, mode, precision) : "",
|
|
15584
15713
|
date: void 0
|
|
15585
15714
|
});
|
|
15586
15715
|
useEffect38(() => {
|
|
@@ -15595,7 +15724,7 @@ var DateTimeInput = forwardRef17(function DateTimeInput2({
|
|
|
15595
15724
|
setIsOpen(isOpen2);
|
|
15596
15725
|
}, [onDialogOpeningChange]);
|
|
15597
15726
|
const generatedId = useId13();
|
|
15598
|
-
const ids =
|
|
15727
|
+
const ids = useMemo27(() => ({
|
|
15599
15728
|
input: inputId ?? `date-time-input-${generatedId}`,
|
|
15600
15729
|
popup: `date-time-input-popup-${generatedId}`,
|
|
15601
15730
|
label: `date-time-input-label-${generatedId}`
|
|
@@ -15621,8 +15750,9 @@ var DateTimeInput = forwardRef17(function DateTimeInput2({
|
|
|
15621
15750
|
id: ids.input,
|
|
15622
15751
|
value: stringInputState.state,
|
|
15623
15752
|
onChange: (event) => {
|
|
15624
|
-
const date = event.target.
|
|
15625
|
-
|
|
15753
|
+
const date = new Date(event.target.value ?? "");
|
|
15754
|
+
const isValid = !isNaN(date.getTime());
|
|
15755
|
+
if (isValid) {
|
|
15626
15756
|
restartTimer(() => {
|
|
15627
15757
|
innerRef.current?.blur();
|
|
15628
15758
|
setState(date);
|
|
@@ -15633,7 +15763,7 @@ var DateTimeInput = forwardRef17(function DateTimeInput2({
|
|
|
15633
15763
|
}
|
|
15634
15764
|
setStringInputState({
|
|
15635
15765
|
state: event.target.value,
|
|
15636
|
-
date:
|
|
15766
|
+
date: isValid ? date : void 0
|
|
15637
15767
|
});
|
|
15638
15768
|
},
|
|
15639
15769
|
onBlur: (event) => {
|
|
@@ -15709,7 +15839,16 @@ var DateTimeInput = forwardRef17(function DateTimeInput2({
|
|
|
15709
15839
|
changeOpenWrapper(false);
|
|
15710
15840
|
},
|
|
15711
15841
|
pickerProps,
|
|
15712
|
-
mode
|
|
15842
|
+
mode,
|
|
15843
|
+
start,
|
|
15844
|
+
end,
|
|
15845
|
+
weekStart,
|
|
15846
|
+
markToday,
|
|
15847
|
+
is24HourFormat,
|
|
15848
|
+
minuteIncrement,
|
|
15849
|
+
secondIncrement,
|
|
15850
|
+
millisecondIncrement,
|
|
15851
|
+
precision
|
|
15713
15852
|
}
|
|
15714
15853
|
)
|
|
15715
15854
|
}
|
|
@@ -15718,7 +15857,7 @@ var DateTimeInput = forwardRef17(function DateTimeInput2({
|
|
|
15718
15857
|
});
|
|
15719
15858
|
|
|
15720
15859
|
// src/components/layout/table/TableFilterPopups.tsx
|
|
15721
|
-
import { useId as useId14, useMemo as
|
|
15860
|
+
import { useId as useId14, useMemo as useMemo28, useState as useState33 } from "react";
|
|
15722
15861
|
|
|
15723
15862
|
// src/components/user-interaction/select/MultiSelect.tsx
|
|
15724
15863
|
import { forwardRef as forwardRef18 } from "react";
|
|
@@ -15995,7 +16134,7 @@ var TextFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
15995
16134
|
const operator = filterValue?.operator ?? "textContains";
|
|
15996
16135
|
const parameter = filterValue?.parameter ?? {};
|
|
15997
16136
|
const id = useId14();
|
|
15998
|
-
const availableOperators =
|
|
16137
|
+
const availableOperators = useMemo28(() => [
|
|
15999
16138
|
...TableFilterOperator.text,
|
|
16000
16139
|
...TableFilterOperator.generic
|
|
16001
16140
|
], []);
|
|
@@ -16055,7 +16194,7 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
16055
16194
|
const translation = useHightideTranslation();
|
|
16056
16195
|
const operator = filterValue?.operator ?? "numberBetween";
|
|
16057
16196
|
const parameter = filterValue?.parameter ?? {};
|
|
16058
|
-
const availableOperators =
|
|
16197
|
+
const availableOperators = useMemo28(() => [
|
|
16059
16198
|
...TableFilterOperator.number,
|
|
16060
16199
|
...TableFilterOperator.generic
|
|
16061
16200
|
], []);
|
|
@@ -16148,7 +16287,7 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
16148
16287
|
const parameter = filterValue?.parameter ?? {};
|
|
16149
16288
|
const [temporaryMinDateValue, setTemporaryMinDateValue] = useState33(null);
|
|
16150
16289
|
const [temporaryMaxDateValue, setTemporaryMaxDateValue] = useState33(null);
|
|
16151
|
-
const availableOperators =
|
|
16290
|
+
const availableOperators = useMemo28(() => [
|
|
16152
16291
|
...TableFilterOperator.date,
|
|
16153
16292
|
...TableFilterOperator.generic
|
|
16154
16293
|
], []);
|
|
@@ -16273,7 +16412,7 @@ var DatetimeFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
16273
16412
|
const parameter = filterValue?.parameter ?? {};
|
|
16274
16413
|
const [temporaryMinDateValue, setTemporaryMinDateValue] = useState33(null);
|
|
16275
16414
|
const [temporaryMaxDateValue, setTemporaryMaxDateValue] = useState33(null);
|
|
16276
|
-
const availableOperators =
|
|
16415
|
+
const availableOperators = useMemo28(() => [
|
|
16277
16416
|
...TableFilterOperator.dateTime,
|
|
16278
16417
|
...TableFilterOperator.generic
|
|
16279
16418
|
], []);
|
|
@@ -16390,7 +16529,7 @@ var DatetimeFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
16390
16529
|
};
|
|
16391
16530
|
var BooleanFilter = ({ filterValue, onFilterValueChange }) => {
|
|
16392
16531
|
const operator = filterValue?.operator ?? "booleanIsTrue";
|
|
16393
|
-
const availableOperators =
|
|
16532
|
+
const availableOperators = useMemo28(() => [
|
|
16394
16533
|
...TableFilterOperator.boolean,
|
|
16395
16534
|
...TableFilterOperator.generic
|
|
16396
16535
|
], []);
|
|
@@ -16414,11 +16553,11 @@ var TagsFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
16414
16553
|
const { table } = useTableStateWithoutSizingContext();
|
|
16415
16554
|
const operator = filterValue?.operator ?? "tagsContains";
|
|
16416
16555
|
const parameter = filterValue?.parameter ?? {};
|
|
16417
|
-
const availableOperators =
|
|
16556
|
+
const availableOperators = useMemo28(() => [
|
|
16418
16557
|
...TableFilterOperator.multiTags,
|
|
16419
16558
|
...TableFilterOperator.generic
|
|
16420
16559
|
], []);
|
|
16421
|
-
const availableTags =
|
|
16560
|
+
const availableTags = useMemo28(() => {
|
|
16422
16561
|
const column = table.getColumn(columnId);
|
|
16423
16562
|
if (!column) return [];
|
|
16424
16563
|
return column.columnDef.meta?.filterData?.tags ?? [];
|
|
@@ -16465,11 +16604,11 @@ var TagsSingleFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
16465
16604
|
const { table } = useTableStateWithoutSizingContext();
|
|
16466
16605
|
const operator = filterValue?.operator ?? "tagsSingleContains";
|
|
16467
16606
|
const parameter = filterValue?.parameter ?? {};
|
|
16468
|
-
const availableOperators =
|
|
16607
|
+
const availableOperators = useMemo28(() => [
|
|
16469
16608
|
...TableFilterOperator.singleTag,
|
|
16470
16609
|
...TableFilterOperator.generic
|
|
16471
16610
|
], []);
|
|
16472
|
-
const availableTags =
|
|
16611
|
+
const availableTags = useMemo28(() => {
|
|
16473
16612
|
const column = table.getColumn(columnId);
|
|
16474
16613
|
if (!column) return [];
|
|
16475
16614
|
return column.columnDef.meta?.filterData?.tags ?? [];
|
|
@@ -16528,7 +16667,7 @@ var TagsSingleFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
16528
16667
|
};
|
|
16529
16668
|
var GenericFilter = ({ filterValue, onFilterValueChange }) => {
|
|
16530
16669
|
const operator = filterValue?.operator ?? "notUndefined";
|
|
16531
|
-
const availableOperators =
|
|
16670
|
+
const availableOperators = useMemo28(() => [
|
|
16532
16671
|
...TableFilterOperator.generic
|
|
16533
16672
|
], []);
|
|
16534
16673
|
return /* @__PURE__ */ jsx69("div", { className: "flex-col-2 gap-2", children: /* @__PURE__ */ jsx69(
|
|
@@ -16583,7 +16722,7 @@ var TableFilterButton = ({
|
|
|
16583
16722
|
const containerRef = useRef31(null);
|
|
16584
16723
|
const [isOpen, setIsOpen] = useState34(false);
|
|
16585
16724
|
const id = useId15();
|
|
16586
|
-
const ids =
|
|
16725
|
+
const ids = useMemo29(() => ({
|
|
16587
16726
|
button: `table-filter-button-${id}`,
|
|
16588
16727
|
popup: `table-filter-popup-${id}`,
|
|
16589
16728
|
label: `table-filter-label-${id}`
|
|
@@ -16870,7 +17009,7 @@ var TablePagination = ({ allowChangingPageSize = true, pageSizeOptions, ...props
|
|
|
16870
17009
|
};
|
|
16871
17010
|
|
|
16872
17011
|
// src/components/layout/table/TableWithSelectionProvider.tsx
|
|
16873
|
-
import { useCallback as useCallback29, useMemo as
|
|
17012
|
+
import { useCallback as useCallback29, useMemo as useMemo30 } from "react";
|
|
16874
17013
|
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
16875
17014
|
var TableWithSelectionProvider = ({
|
|
16876
17015
|
children,
|
|
@@ -16883,7 +17022,7 @@ var TableWithSelectionProvider = ({
|
|
|
16883
17022
|
...props
|
|
16884
17023
|
}) => {
|
|
16885
17024
|
const translation = useHightideTranslation();
|
|
16886
|
-
const columnDef =
|
|
17025
|
+
const columnDef = useMemo30(() => [
|
|
16887
17026
|
{
|
|
16888
17027
|
id: selectionRowId,
|
|
16889
17028
|
header: ({ table }) => {
|
|
@@ -16986,7 +17125,7 @@ var TableWithSelection = ({
|
|
|
16986
17125
|
};
|
|
16987
17126
|
|
|
16988
17127
|
// src/components/layout/table/TableColumn.tsx
|
|
16989
|
-
import { memo as memo2, useEffect as useEffect41, useMemo as
|
|
17128
|
+
import { memo as memo2, useEffect as useEffect41, useMemo as useMemo31, useState as useState35 } from "react";
|
|
16990
17129
|
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
16991
17130
|
var TableColumnComponent = ({
|
|
16992
17131
|
filterType,
|
|
@@ -17017,12 +17156,12 @@ var TableColumnFactory = () => memo2(
|
|
|
17017
17156
|
}
|
|
17018
17157
|
);
|
|
17019
17158
|
var TableColumn = (props) => {
|
|
17020
|
-
const TableColumnComponent2 =
|
|
17159
|
+
const TableColumnComponent2 = useMemo31(() => TableColumnFactory(), []);
|
|
17021
17160
|
return /* @__PURE__ */ jsx76(TableColumnComponent2, { ...props });
|
|
17022
17161
|
};
|
|
17023
17162
|
|
|
17024
17163
|
// src/components/layout/table/TableColumnSwitcher.tsx
|
|
17025
|
-
import { useMemo as
|
|
17164
|
+
import { useMemo as useMemo32, useRef as useRef32, useId as useId16 } from "react";
|
|
17026
17165
|
import { ChevronUp as ChevronUp3, ChevronDown as ChevronDown5, ChevronLeft as ChevronLeft5, ChevronRight as ChevronRight5, Eye, EyeOff, Pin, PinOff, ArrowLeftRightIcon } from "lucide-react";
|
|
17027
17166
|
import { Fragment as Fragment10, jsx as jsx77, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
17028
17167
|
var TableColumnSwitcherPopUp = ({ ...props }) => {
|
|
@@ -17030,14 +17169,14 @@ var TableColumnSwitcherPopUp = ({ ...props }) => {
|
|
|
17030
17169
|
const translation = useHightideTranslation();
|
|
17031
17170
|
const containerRef = useRef32(null);
|
|
17032
17171
|
const generatedId = useId16();
|
|
17033
|
-
const ids =
|
|
17172
|
+
const ids = useMemo32(() => ({
|
|
17034
17173
|
popup: props.id ?? `table-column-picker-popup-${generatedId}`,
|
|
17035
17174
|
label: `table-column-picker-label-${generatedId}`
|
|
17036
17175
|
}), [generatedId, props.id]);
|
|
17037
17176
|
const tableState = table.getState();
|
|
17038
17177
|
const columnOrder = tableState.columnOrder;
|
|
17039
17178
|
const columnPinning = tableState.columnPinning;
|
|
17040
|
-
const columns =
|
|
17179
|
+
const columns = useMemo32(() => {
|
|
17041
17180
|
const allColumns = table.getAllColumns();
|
|
17042
17181
|
const leftPinned = [];
|
|
17043
17182
|
const unpinned = [];
|