@helpwave/hightide 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +97 -37
- package/dist/index.d.ts +97 -37
- package/dist/index.js +674 -295
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +637 -259
- package/dist/index.mjs.map +1 -1
- package/dist/style/globals.css +42 -11
- package/dist/style/uncompiled/theme/colors/semantic.css +1 -1
- package/dist/style/uncompiled/theme/components.css +1 -1
- package/package.json +18 -17
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
|
-
|
|
7758
|
-
|
|
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
|
|
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) =>
|
|
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) =>
|
|
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
|
|
12567
|
-
var
|
|
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,181 @@ var useResizeCallbackWrapper = (callback) => {
|
|
|
12590
12672
|
|
|
12591
12673
|
// src/components/table/TableSortButton.tsx
|
|
12592
12674
|
var import_lucide_react20 = require("lucide-react");
|
|
12593
|
-
var
|
|
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: { borderWidth: `${triangleSize}rem ${triangleSize}rem 0 ${triangleSize}rem`, transform: `translate(0,${triangleSize}rem)` },
|
|
12709
|
+
bottom: { borderWidth: `0 ${triangleSize}rem ${triangleSize}rem ${triangleSize}rem`, transform: `translate(0,-${triangleSize}rem)` },
|
|
12710
|
+
left: { borderWidth: `${triangleSize}rem 0 ${triangleSize}rem ${triangleSize}rem`, transform: `translate(${triangleSize}rem,0)` },
|
|
12711
|
+
right: { borderWidth: `${triangleSize}rem ${triangleSize}rem ${triangleSize}rem 0`, transform: `translate(-${triangleSize}rem,0)` }
|
|
12712
|
+
};
|
|
12713
|
+
const isActive = !disabled && isShown;
|
|
12714
|
+
const css = useFloatingElement({
|
|
12715
|
+
active: isActive,
|
|
12716
|
+
anchorRef,
|
|
12717
|
+
containerRef,
|
|
12718
|
+
horizontalAlignment: position === "left" ? "beforeStart" : position === "right" ? "afterEnd" : "center",
|
|
12719
|
+
verticalAlignment: position === "top" ? "beforeStart" : position === "bottom" ? "afterEnd" : "center"
|
|
12720
|
+
});
|
|
12721
|
+
const cssTriangle = useFloatingElement({
|
|
12722
|
+
active: isActive,
|
|
12723
|
+
anchorRef,
|
|
12724
|
+
containerRef: triangleRef,
|
|
12725
|
+
horizontalAlignment: position === "left" ? "beforeStart" : position === "right" ? "afterEnd" : "center",
|
|
12726
|
+
verticalAlignment: position === "top" ? "beforeStart" : position === "bottom" ? "afterEnd" : "center"
|
|
12727
|
+
});
|
|
12728
|
+
const zIndex = useZIndexRegister(isActive);
|
|
12729
|
+
const zIndexTriangle = useZIndexRegister(isActive);
|
|
12730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
12731
|
+
"div",
|
|
12732
|
+
{
|
|
12733
|
+
ref: anchorRef,
|
|
12734
|
+
className: (0, import_clsx45.clsx)("relative inline-block", containerClassName),
|
|
12735
|
+
onMouseEnter: () => setState((prevState) => {
|
|
12736
|
+
clearTimeout(prevState.timer);
|
|
12737
|
+
return {
|
|
12738
|
+
...prevState,
|
|
12739
|
+
timer: setTimeout(() => {
|
|
12740
|
+
setState((prevState2) => {
|
|
12741
|
+
clearTimeout(prevState2.timer);
|
|
12742
|
+
return { isShown: true, timer: null };
|
|
12743
|
+
});
|
|
12744
|
+
}, appearDelay)
|
|
12745
|
+
};
|
|
12746
|
+
}),
|
|
12747
|
+
onMouseLeave: () => setState((prevState) => {
|
|
12748
|
+
clearTimeout(prevState.timer);
|
|
12749
|
+
return {
|
|
12750
|
+
...prevState,
|
|
12751
|
+
timer: setTimeout(() => {
|
|
12752
|
+
setState((prevState2) => {
|
|
12753
|
+
clearTimeout(prevState2.timer);
|
|
12754
|
+
return { isShown: false, timer: null };
|
|
12755
|
+
});
|
|
12756
|
+
}, disappearDelay)
|
|
12757
|
+
};
|
|
12758
|
+
}),
|
|
12759
|
+
children: [
|
|
12760
|
+
children,
|
|
12761
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Visibility, { isVisible: isActive, children: [
|
|
12762
|
+
(0, import_react_dom4.createPortal)(
|
|
12763
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
12764
|
+
"div",
|
|
12765
|
+
{
|
|
12766
|
+
ref: containerRef,
|
|
12767
|
+
className: (0, import_clsx45.clsx)(
|
|
12768
|
+
`opacity-0 absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded
|
|
12769
|
+
animate-tooltip-fade-in shadow-around-md bg-tooltip-background`,
|
|
12770
|
+
tooltipClassName
|
|
12771
|
+
),
|
|
12772
|
+
style: { ...css, zIndex, animationDelay: appearDelay + "ms" },
|
|
12773
|
+
children: tooltip
|
|
12774
|
+
}
|
|
12775
|
+
),
|
|
12776
|
+
document.body
|
|
12777
|
+
),
|
|
12778
|
+
(0, import_react_dom4.createPortal)(
|
|
12779
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
12780
|
+
"div",
|
|
12781
|
+
{
|
|
12782
|
+
ref: triangleRef,
|
|
12783
|
+
className: (0, import_clsx45.clsx)(`absolute w-0 h-0 opacity-0 animate-tooltip-fade-in`, triangleClasses[position]),
|
|
12784
|
+
style: {
|
|
12785
|
+
...cssTriangle,
|
|
12786
|
+
...triangleStyle[position],
|
|
12787
|
+
zIndex: zIndexTriangle,
|
|
12788
|
+
animationDelay: appearDelay + "ms"
|
|
12789
|
+
}
|
|
12790
|
+
}
|
|
12791
|
+
),
|
|
12792
|
+
document.body
|
|
12793
|
+
)
|
|
12794
|
+
] })
|
|
12795
|
+
]
|
|
12796
|
+
}
|
|
12797
|
+
);
|
|
12798
|
+
};
|
|
12799
|
+
|
|
12800
|
+
// src/components/table/TableSortButton.tsx
|
|
12801
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
12595
12802
|
var TableSortButton = ({
|
|
12596
12803
|
sortDirection,
|
|
12597
12804
|
invert = false,
|
|
12598
12805
|
color = "neutral",
|
|
12599
12806
|
size = "tiny",
|
|
12600
12807
|
className,
|
|
12601
|
-
|
|
12808
|
+
sortingIndexDisplay,
|
|
12809
|
+
...props
|
|
12602
12810
|
}) => {
|
|
12603
|
-
|
|
12811
|
+
const translation = useHightideTranslation();
|
|
12812
|
+
const { sortingsCount, index } = sortingIndexDisplay;
|
|
12813
|
+
let icon = /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_lucide_react20.ChevronsUpDown, { className: "size-4" });
|
|
12604
12814
|
if (sortDirection) {
|
|
12605
12815
|
let usedSortDirection = sortDirection;
|
|
12606
12816
|
if (invert) {
|
|
12607
12817
|
usedSortDirection = usedSortDirection === "desc" ? "asc" : "desc";
|
|
12608
12818
|
}
|
|
12609
|
-
icon = usedSortDirection === "asc" ? /* @__PURE__ */ (0,
|
|
12819
|
+
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
12820
|
}
|
|
12611
|
-
|
|
12821
|
+
const hasSortingIndex = !!sortingIndexDisplay && sortingsCount > 1 && index > 0;
|
|
12822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Tooltip, { tooltip: translation("rSortingOrderAfter", { otherSortings: index - 1 }), disabled: !hasSortingIndex, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
12612
12823
|
Button,
|
|
12613
12824
|
{
|
|
12614
|
-
layout: "icon",
|
|
12825
|
+
layout: hasSortingIndex ? "default" : "icon",
|
|
12615
12826
|
color,
|
|
12616
12827
|
size,
|
|
12617
|
-
className: (0,
|
|
12618
|
-
...
|
|
12619
|
-
children:
|
|
12828
|
+
className: (0, import_clsx46.default)("relative", className),
|
|
12829
|
+
...props,
|
|
12830
|
+
children: [
|
|
12831
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Visibility, { isVisible: hasSortingIndex, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
12832
|
+
"div",
|
|
12833
|
+
{
|
|
12834
|
+
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"),
|
|
12835
|
+
children: `${index}.`
|
|
12836
|
+
}
|
|
12837
|
+
) }),
|
|
12838
|
+
icon
|
|
12839
|
+
]
|
|
12620
12840
|
}
|
|
12621
|
-
);
|
|
12841
|
+
) });
|
|
12622
12842
|
};
|
|
12623
12843
|
|
|
12624
12844
|
// src/components/table/TableFilterButton.tsx
|
|
12625
12845
|
var import_lucide_react21 = require("lucide-react");
|
|
12626
12846
|
|
|
12627
12847
|
// src/components/user-action/Menu.tsx
|
|
12628
|
-
var
|
|
12629
|
-
var
|
|
12848
|
+
var import_react41 = require("react");
|
|
12849
|
+
var import_clsx47 = __toESM(require("clsx"));
|
|
12630
12850
|
|
|
12631
12851
|
// src/utils/bagFunctions.ts
|
|
12632
12852
|
var resolve = (children, bag) => {
|
|
@@ -12640,7 +12860,7 @@ var BagFunctionUtil = {
|
|
|
12640
12860
|
};
|
|
12641
12861
|
|
|
12642
12862
|
// src/components/user-action/Menu.tsx
|
|
12643
|
-
var
|
|
12863
|
+
var import_react_dom5 = require("react-dom");
|
|
12644
12864
|
|
|
12645
12865
|
// src/hooks/usePopoverPosition.ts
|
|
12646
12866
|
var defaultPopoverPositionOptions = {
|
|
@@ -12697,15 +12917,15 @@ var usePopoverPosition = (trigger, options) => {
|
|
|
12697
12917
|
};
|
|
12698
12918
|
|
|
12699
12919
|
// src/hooks/useHoverState.ts
|
|
12700
|
-
var
|
|
12920
|
+
var import_react39 = require("react");
|
|
12701
12921
|
var defaultUseHoverStateProps = {
|
|
12702
12922
|
closingDelay: 200,
|
|
12703
12923
|
isDisabled: false
|
|
12704
12924
|
};
|
|
12705
12925
|
var useHoverState = (props = void 0) => {
|
|
12706
12926
|
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
12707
|
-
const [isHovered, setIsHovered] = (0,
|
|
12708
|
-
const [timer, setTimer] = (0,
|
|
12927
|
+
const [isHovered, setIsHovered] = (0, import_react39.useState)(false);
|
|
12928
|
+
const [timer, setTimer] = (0, import_react39.useState)();
|
|
12709
12929
|
const onMouseEnter = () => {
|
|
12710
12930
|
if (isDisabled) {
|
|
12711
12931
|
return;
|
|
@@ -12721,14 +12941,14 @@ var useHoverState = (props = void 0) => {
|
|
|
12721
12941
|
setIsHovered(false);
|
|
12722
12942
|
}, closingDelay));
|
|
12723
12943
|
};
|
|
12724
|
-
(0,
|
|
12944
|
+
(0, import_react39.useEffect)(() => {
|
|
12725
12945
|
if (timer) {
|
|
12726
12946
|
return () => {
|
|
12727
12947
|
clearTimeout(timer);
|
|
12728
12948
|
};
|
|
12729
12949
|
}
|
|
12730
12950
|
});
|
|
12731
|
-
(0,
|
|
12951
|
+
(0, import_react39.useEffect)(() => {
|
|
12732
12952
|
if (timer) {
|
|
12733
12953
|
clearTimeout(timer);
|
|
12734
12954
|
}
|
|
@@ -12741,9 +12961,9 @@ var useHoverState = (props = void 0) => {
|
|
|
12741
12961
|
};
|
|
12742
12962
|
|
|
12743
12963
|
// src/hooks/useOutsideClick.ts
|
|
12744
|
-
var
|
|
12964
|
+
var import_react40 = require("react");
|
|
12745
12965
|
var useOutsideClick = (refs, handler) => {
|
|
12746
|
-
(0,
|
|
12966
|
+
(0, import_react40.useEffect)(() => {
|
|
12747
12967
|
const listener = (event) => {
|
|
12748
12968
|
if (event.target === null) return;
|
|
12749
12969
|
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
@@ -12761,17 +12981,17 @@ var useOutsideClick = (refs, handler) => {
|
|
|
12761
12981
|
};
|
|
12762
12982
|
|
|
12763
12983
|
// src/components/user-action/Menu.tsx
|
|
12764
|
-
var
|
|
12984
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
12765
12985
|
var MenuItem = ({
|
|
12766
12986
|
children,
|
|
12767
12987
|
onClick,
|
|
12768
12988
|
alignment = "left",
|
|
12769
12989
|
isDisabled = false,
|
|
12770
12990
|
className
|
|
12771
|
-
}) => /* @__PURE__ */ (0,
|
|
12991
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
12772
12992
|
"div",
|
|
12773
12993
|
{
|
|
12774
|
-
className: (0,
|
|
12994
|
+
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
12995
|
"text-right": alignment === "right",
|
|
12776
12996
|
"text-left": alignment === "left",
|
|
12777
12997
|
"text-disabled cursor-not-allowed": isDisabled,
|
|
@@ -12801,10 +13021,10 @@ var Menu = ({
|
|
|
12801
13021
|
menuClassName = ""
|
|
12802
13022
|
}) => {
|
|
12803
13023
|
const { isHovered: isOpen, setIsHovered: setIsOpen } = useHoverState({ isDisabled: !showOnHover || disabled });
|
|
12804
|
-
const triggerRef = (0,
|
|
12805
|
-
const menuRef = (0,
|
|
13024
|
+
const triggerRef = (0, import_react41.useRef)(null);
|
|
13025
|
+
const menuRef = (0, import_react41.useRef)(null);
|
|
12806
13026
|
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
12807
|
-
const [isHidden, setIsHidden] = (0,
|
|
13027
|
+
const [isHidden, setIsHidden] = (0, import_react41.useState)(true);
|
|
12808
13028
|
const bag = {
|
|
12809
13029
|
isOpen,
|
|
12810
13030
|
close: () => setIsOpen(false),
|
|
@@ -12815,7 +13035,7 @@ var Menu = ({
|
|
|
12815
13035
|
triggerRef.current?.getBoundingClientRect(),
|
|
12816
13036
|
{ verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
|
|
12817
13037
|
);
|
|
12818
|
-
(0,
|
|
13038
|
+
(0, import_react41.useEffect)(() => {
|
|
12819
13039
|
if (!isOpen) return;
|
|
12820
13040
|
const triggerEl = triggerRef.current;
|
|
12821
13041
|
if (!triggerEl) return;
|
|
@@ -12832,20 +13052,20 @@ var Menu = ({
|
|
|
12832
13052
|
window.removeEventListener("resize", close);
|
|
12833
13053
|
};
|
|
12834
13054
|
}, [isOpen, setIsOpen]);
|
|
12835
|
-
(0,
|
|
13055
|
+
(0, import_react41.useEffect)(() => {
|
|
12836
13056
|
if (isOpen) {
|
|
12837
13057
|
setIsHidden(false);
|
|
12838
13058
|
}
|
|
12839
13059
|
}, [isOpen]);
|
|
12840
13060
|
const zIndex = useZIndexRegister(isOpen);
|
|
12841
|
-
return /* @__PURE__ */ (0,
|
|
13061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
|
|
12842
13062
|
trigger(bag, triggerRef),
|
|
12843
|
-
(0,
|
|
13063
|
+
(0, import_react_dom5.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
12844
13064
|
"div",
|
|
12845
13065
|
{
|
|
12846
13066
|
ref: menuRef,
|
|
12847
13067
|
onClick: (e) => e.stopPropagation(),
|
|
12848
|
-
className: (0,
|
|
13068
|
+
className: (0, import_clsx47.default)(
|
|
12849
13069
|
"absolute rounded-md bg-menu-background text-menu-text shadow-around-lg shadow-strong z-[300]",
|
|
12850
13070
|
{
|
|
12851
13071
|
"animate-pop-in": isOpen,
|
|
@@ -12870,34 +13090,34 @@ var Menu = ({
|
|
|
12870
13090
|
};
|
|
12871
13091
|
|
|
12872
13092
|
// src/components/table/TableFilterButton.tsx
|
|
12873
|
-
var
|
|
12874
|
-
var
|
|
13093
|
+
var import_react42 = require("react");
|
|
13094
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
12875
13095
|
var TableFilterButton = ({
|
|
12876
13096
|
filterType,
|
|
12877
13097
|
column
|
|
12878
13098
|
}) => {
|
|
12879
13099
|
const translation = useHightideTranslation();
|
|
12880
13100
|
const columnFilterValue = column.getFilterValue();
|
|
12881
|
-
const [filterValue, setFilterValue] = (0,
|
|
13101
|
+
const [filterValue, setFilterValue] = (0, import_react42.useState)(columnFilterValue);
|
|
12882
13102
|
const hasFilter = !!filterValue;
|
|
12883
|
-
(0,
|
|
13103
|
+
(0, import_react42.useEffect)(() => {
|
|
12884
13104
|
setFilterValue(columnFilterValue);
|
|
12885
13105
|
}, [columnFilterValue]);
|
|
12886
|
-
return /* @__PURE__ */ (0,
|
|
13106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
12887
13107
|
Menu,
|
|
12888
13108
|
{
|
|
12889
|
-
trigger: ({ toggleOpen }, ref) => /* @__PURE__ */ (0,
|
|
12890
|
-
/* @__PURE__ */ (0,
|
|
13109
|
+
trigger: ({ toggleOpen }, ref) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { ref, className: "relative", children: [
|
|
13110
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
12891
13111
|
Button,
|
|
12892
13112
|
{
|
|
12893
13113
|
layout: "icon",
|
|
12894
13114
|
color: "neutral",
|
|
12895
13115
|
size: "tiny",
|
|
12896
13116
|
onClick: toggleOpen,
|
|
12897
|
-
children: /* @__PURE__ */ (0,
|
|
13117
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react21.FilterIcon, { className: "size-4" })
|
|
12898
13118
|
}
|
|
12899
13119
|
),
|
|
12900
|
-
hasFilter && /* @__PURE__ */ (0,
|
|
13120
|
+
hasFilter && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
12901
13121
|
"div",
|
|
12902
13122
|
{
|
|
12903
13123
|
className: "absolute top-0.5 right-0.5 w-2 h-2 rounded-full bg-primary pointer-events-none",
|
|
@@ -12905,9 +13125,9 @@ var TableFilterButton = ({
|
|
|
12905
13125
|
}
|
|
12906
13126
|
)
|
|
12907
13127
|
] }),
|
|
12908
|
-
children: ({ close }) => /* @__PURE__ */ (0,
|
|
12909
|
-
/* @__PURE__ */ (0,
|
|
12910
|
-
filterType === "text" && /* @__PURE__ */ (0,
|
|
13128
|
+
children: ({ close }) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex-col-1 p-2 items-start font-normal text-menu-text", children: [
|
|
13129
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h4", { className: "typography-label-md-semibold", children: translation("filter") }),
|
|
13130
|
+
filterType === "text" && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
12911
13131
|
Input,
|
|
12912
13132
|
{
|
|
12913
13133
|
value: filterValue ?? "",
|
|
@@ -12917,8 +13137,8 @@ var TableFilterButton = ({
|
|
|
12917
13137
|
className: "h-10"
|
|
12918
13138
|
}
|
|
12919
13139
|
),
|
|
12920
|
-
filterType === "range" && /* @__PURE__ */ (0,
|
|
12921
|
-
/* @__PURE__ */ (0,
|
|
13140
|
+
filterType === "range" && /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex-row-2 items-center", children: [
|
|
13141
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
12922
13142
|
Input,
|
|
12923
13143
|
{
|
|
12924
13144
|
value: filterValue?.[0] ?? "",
|
|
@@ -12931,8 +13151,8 @@ var TableFilterButton = ({
|
|
|
12931
13151
|
className: "h-10 input-indicator-hidden w-40"
|
|
12932
13152
|
}
|
|
12933
13153
|
),
|
|
12934
|
-
/* @__PURE__ */ (0,
|
|
12935
|
-
/* @__PURE__ */ (0,
|
|
13154
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "font-bold", children: "-" }),
|
|
13155
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
12936
13156
|
Input,
|
|
12937
13157
|
{
|
|
12938
13158
|
value: filterValue?.[1] ?? "",
|
|
@@ -12946,8 +13166,8 @@ var TableFilterButton = ({
|
|
|
12946
13166
|
}
|
|
12947
13167
|
)
|
|
12948
13168
|
] }),
|
|
12949
|
-
filterType === "dateRange" && /* @__PURE__ */ (0,
|
|
12950
|
-
/* @__PURE__ */ (0,
|
|
13169
|
+
filterType === "dateRange" && /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
|
|
13170
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
12951
13171
|
Input,
|
|
12952
13172
|
{
|
|
12953
13173
|
value: filterValue?.[0] ? filterValue?.[0].toISOString().slice(0, 16) : "",
|
|
@@ -12960,7 +13180,7 @@ var TableFilterButton = ({
|
|
|
12960
13180
|
className: "h-10 w-50"
|
|
12961
13181
|
}
|
|
12962
13182
|
),
|
|
12963
|
-
/* @__PURE__ */ (0,
|
|
13183
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
12964
13184
|
Input,
|
|
12965
13185
|
{
|
|
12966
13186
|
value: filterValue?.[1] ? filterValue?.[1].toISOString().slice(0, 16) : "",
|
|
@@ -12974,12 +13194,12 @@ var TableFilterButton = ({
|
|
|
12974
13194
|
}
|
|
12975
13195
|
)
|
|
12976
13196
|
] }),
|
|
12977
|
-
/* @__PURE__ */ (0,
|
|
12978
|
-
hasFilter && /* @__PURE__ */ (0,
|
|
13197
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex-row-2 justify-end w-full", children: [
|
|
13198
|
+
hasFilter && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Button, { color: "negative", size: "small", onClick: () => {
|
|
12979
13199
|
column.setFilterValue(void 0);
|
|
12980
13200
|
close();
|
|
12981
13201
|
}, children: translation("remove") }),
|
|
12982
|
-
/* @__PURE__ */ (0,
|
|
13202
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Button, { size: "small", onClick: () => {
|
|
12983
13203
|
column.setFilterValue(filterValue);
|
|
12984
13204
|
close();
|
|
12985
13205
|
}, children: translation("apply") })
|
|
@@ -12990,7 +13210,7 @@ var TableFilterButton = ({
|
|
|
12990
13210
|
};
|
|
12991
13211
|
|
|
12992
13212
|
// src/components/table/Table.tsx
|
|
12993
|
-
var
|
|
13213
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
12994
13214
|
var Table = ({
|
|
12995
13215
|
data,
|
|
12996
13216
|
fillerRow,
|
|
@@ -13004,22 +13224,22 @@ var Table = ({
|
|
|
13004
13224
|
columns,
|
|
13005
13225
|
...tableOptions
|
|
13006
13226
|
}) => {
|
|
13007
|
-
const ref = (0,
|
|
13008
|
-
const tableRef = (0,
|
|
13009
|
-
const [columnSizing, setColumnSizing] = (0,
|
|
13227
|
+
const ref = (0, import_react43.useRef)(null);
|
|
13228
|
+
const tableRef = (0, import_react43.useRef)(null);
|
|
13229
|
+
const [columnSizing, setColumnSizing] = (0, import_react43.useState)(columns.reduce((previousValue, currentValue) => {
|
|
13010
13230
|
return {
|
|
13011
13231
|
...previousValue,
|
|
13012
13232
|
[currentValue.id]: currentValue.minSize ?? defaultColumn.minSize
|
|
13013
13233
|
};
|
|
13014
13234
|
}, {}));
|
|
13015
|
-
const [columnSizingInfo, setColumnSizingInfo] = (0,
|
|
13016
|
-
const [pagination, setPagination] = (0,
|
|
13235
|
+
const [columnSizingInfo, setColumnSizingInfo] = (0, import_react43.useState)();
|
|
13236
|
+
const [pagination, setPagination] = (0, import_react43.useState)({
|
|
13017
13237
|
pageSize: 10,
|
|
13018
13238
|
pageIndex: 0,
|
|
13019
13239
|
...initialState?.pagination
|
|
13020
13240
|
});
|
|
13021
|
-
const [columnFilters, setColumnFilters] = (0,
|
|
13022
|
-
const computedColumnMinWidths = (0,
|
|
13241
|
+
const [columnFilters, setColumnFilters] = (0, import_react43.useState)(initialState?.columnFilters);
|
|
13242
|
+
const computedColumnMinWidths = (0, import_react43.useMemo)(() => {
|
|
13023
13243
|
return columns.reduce((previousValue, column) => {
|
|
13024
13244
|
return {
|
|
13025
13245
|
...previousValue,
|
|
@@ -13028,7 +13248,7 @@ var Table = ({
|
|
|
13028
13248
|
};
|
|
13029
13249
|
}, {});
|
|
13030
13250
|
}, [columns, defaultColumn]);
|
|
13031
|
-
const computedColumnMaxWidths = (0,
|
|
13251
|
+
const computedColumnMaxWidths = (0, import_react43.useMemo)(() => {
|
|
13032
13252
|
return columns.reduce((previousValue, column) => {
|
|
13033
13253
|
return {
|
|
13034
13254
|
...previousValue,
|
|
@@ -13036,12 +13256,12 @@ var Table = ({
|
|
|
13036
13256
|
};
|
|
13037
13257
|
}, {});
|
|
13038
13258
|
}, [columns, defaultColumn]);
|
|
13039
|
-
const tableMinWidth = (0,
|
|
13259
|
+
const tableMinWidth = (0, import_react43.useMemo)(() => {
|
|
13040
13260
|
return columns.reduce((sum, column) => {
|
|
13041
13261
|
return sum + computedColumnMinWidths[column.id];
|
|
13042
13262
|
}, 0);
|
|
13043
13263
|
}, [columns, computedColumnMinWidths]);
|
|
13044
|
-
const updateColumnSizes = (0,
|
|
13264
|
+
const updateColumnSizes = (0, import_react43.useMemo)(() => {
|
|
13045
13265
|
return (previous) => {
|
|
13046
13266
|
const updateSizing = {
|
|
13047
13267
|
...columnSizing,
|
|
@@ -13110,7 +13330,7 @@ var Table = ({
|
|
|
13110
13330
|
minSize: 60,
|
|
13111
13331
|
maxSize: 700,
|
|
13112
13332
|
cell: ({ cell }) => {
|
|
13113
|
-
return /* @__PURE__ */ (0,
|
|
13333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(TableCell, { children: cell.getValue() });
|
|
13114
13334
|
},
|
|
13115
13335
|
...defaultColumn
|
|
13116
13336
|
},
|
|
@@ -13158,18 +13378,18 @@ var Table = ({
|
|
|
13158
13378
|
columnResizeMode: "onChange",
|
|
13159
13379
|
...tableOptions
|
|
13160
13380
|
});
|
|
13161
|
-
const [hasInitializedSizing, setHasInitializedSizing] = (0,
|
|
13162
|
-
(0,
|
|
13381
|
+
const [hasInitializedSizing, setHasInitializedSizing] = (0, import_react43.useState)(false);
|
|
13382
|
+
(0, import_react43.useEffect)(() => {
|
|
13163
13383
|
if (!hasInitializedSizing && ref.current) {
|
|
13164
13384
|
setHasInitializedSizing(true);
|
|
13165
13385
|
table.setColumnSizing(updateColumnSizes(columnSizing));
|
|
13166
13386
|
}
|
|
13167
13387
|
}, [columnSizing, hasInitializedSizing]);
|
|
13168
|
-
useResizeCallbackWrapper((0,
|
|
13388
|
+
useResizeCallbackWrapper((0, import_react43.useCallback)(() => {
|
|
13169
13389
|
table.setColumnSizing(updateColumnSizes);
|
|
13170
13390
|
}, [updateColumnSizes]));
|
|
13171
13391
|
const pageCount = table.getPageCount();
|
|
13172
|
-
(0,
|
|
13392
|
+
(0, import_react43.useEffect)(() => {
|
|
13173
13393
|
const totalPages = pageCount;
|
|
13174
13394
|
if (totalPages === 0) {
|
|
13175
13395
|
if (pagination.pageIndex !== 0) {
|
|
@@ -13185,7 +13405,7 @@ var Table = ({
|
|
|
13185
13405
|
}));
|
|
13186
13406
|
}
|
|
13187
13407
|
}, [data, pageCount, pagination.pageSize, pagination.pageIndex]);
|
|
13188
|
-
const columnSizeVars = (0,
|
|
13408
|
+
const columnSizeVars = (0, import_react43.useMemo)(() => {
|
|
13189
13409
|
const headers = table.getFlatHeaders();
|
|
13190
13410
|
const colSizes = {};
|
|
13191
13411
|
for (let i = 0; i < headers.length; i++) {
|
|
@@ -13195,18 +13415,18 @@ var Table = ({
|
|
|
13195
13415
|
}
|
|
13196
13416
|
return colSizes;
|
|
13197
13417
|
}, [table.getState().columnSizingInfo, table.getState().columnSizing]);
|
|
13198
|
-
return /* @__PURE__ */ (0,
|
|
13199
|
-
/* @__PURE__ */ (0,
|
|
13418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { ref, className: (0, import_clsx48.default)("flex-col-4", className), children: [
|
|
13419
|
+
/* @__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
13420
|
"table",
|
|
13201
13421
|
{
|
|
13202
13422
|
ref: tableRef,
|
|
13203
|
-
className: (0,
|
|
13423
|
+
className: (0, import_clsx48.default)(tableClassName),
|
|
13204
13424
|
style: {
|
|
13205
13425
|
...columnSizeVars,
|
|
13206
13426
|
width: Math.floor(Math.max(table.getTotalSize() - columns.length, ref.current?.offsetWidth ?? table.getTotalSize()))
|
|
13207
13427
|
},
|
|
13208
13428
|
children: [
|
|
13209
|
-
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0,
|
|
13429
|
+
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("colgroup", { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
13210
13430
|
"col",
|
|
13211
13431
|
{
|
|
13212
13432
|
style: {
|
|
@@ -13217,18 +13437,22 @@ var Table = ({
|
|
|
13217
13437
|
},
|
|
13218
13438
|
header.id
|
|
13219
13439
|
)) }, headerGroup.id)),
|
|
13220
|
-
/* @__PURE__ */ (0,
|
|
13221
|
-
return /* @__PURE__ */ (0,
|
|
13440
|
+
/* @__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) => {
|
|
13441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
13222
13442
|
"th",
|
|
13223
13443
|
{
|
|
13224
13444
|
colSpan: header.colSpan,
|
|
13225
|
-
className: (0,
|
|
13445
|
+
className: (0, import_clsx48.default)("relative group", header.column.columnDef.meta?.className),
|
|
13226
13446
|
children: [
|
|
13227
|
-
/* @__PURE__ */ (0,
|
|
13228
|
-
header.column.getCanSort() && /* @__PURE__ */ (0,
|
|
13447
|
+
/* @__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: [
|
|
13448
|
+
header.column.getCanSort() && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
13229
13449
|
TableSortButton,
|
|
13230
13450
|
{
|
|
13231
13451
|
sortDirection: header.column.getIsSorted(),
|
|
13452
|
+
sortingIndexDisplay: {
|
|
13453
|
+
index: header.column.getIsSorted() ? header.column.getSortIndex() + 1 : -1,
|
|
13454
|
+
sortingsCount: table.getState().sorting.length
|
|
13455
|
+
},
|
|
13232
13456
|
onClick: () => {
|
|
13233
13457
|
const sorted = header.column.getIsSorted();
|
|
13234
13458
|
const isMulti = header.column.getCanMultiSort();
|
|
@@ -13247,7 +13471,7 @@ var Table = ({
|
|
|
13247
13471
|
}
|
|
13248
13472
|
}
|
|
13249
13473
|
),
|
|
13250
|
-
header.column.getCanFilter() && header.column.columnDef.meta?.filterType ? /* @__PURE__ */ (0,
|
|
13474
|
+
header.column.getCanFilter() && header.column.columnDef.meta?.filterType ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
13251
13475
|
TableFilterButton,
|
|
13252
13476
|
{
|
|
13253
13477
|
column: header.column,
|
|
@@ -13259,7 +13483,7 @@ var Table = ({
|
|
|
13259
13483
|
header.getContext()
|
|
13260
13484
|
)
|
|
13261
13485
|
] }) }),
|
|
13262
|
-
header.column.getCanResize() && /* @__PURE__ */ (0,
|
|
13486
|
+
header.column.getCanResize() && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
13263
13487
|
"div",
|
|
13264
13488
|
{
|
|
13265
13489
|
onMouseDown: header.getResizeHandler(),
|
|
@@ -13278,15 +13502,15 @@ var Table = ({
|
|
|
13278
13502
|
header.id
|
|
13279
13503
|
);
|
|
13280
13504
|
}) }, headerGroup.id)) }),
|
|
13281
|
-
/* @__PURE__ */ (0,
|
|
13505
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("tbody", { children: [
|
|
13282
13506
|
table.getRowModel().rows.map((row) => {
|
|
13283
|
-
return /* @__PURE__ */ (0,
|
|
13507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
13284
13508
|
"tr",
|
|
13285
13509
|
{
|
|
13286
13510
|
onClick: () => onRowClick?.(row, table),
|
|
13287
13511
|
className: table.options.meta?.bodyRowClassName,
|
|
13288
13512
|
children: row.getVisibleCells().map((cell) => {
|
|
13289
|
-
return /* @__PURE__ */ (0,
|
|
13513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("td", { children: (0, import_react_table.flexRender)(
|
|
13290
13514
|
cell.column.columnDef.cell,
|
|
13291
13515
|
cell.getContext()
|
|
13292
13516
|
) }, cell.id);
|
|
@@ -13296,15 +13520,15 @@ var Table = ({
|
|
|
13296
13520
|
);
|
|
13297
13521
|
}),
|
|
13298
13522
|
range(table.getState().pagination.pageSize - table.getRowModel().rows.length, { allowEmptyRange: true }).map((row, index) => {
|
|
13299
|
-
return /* @__PURE__ */ (0,
|
|
13300
|
-
return /* @__PURE__ */ (0,
|
|
13523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("tr", { children: columns.map((column) => {
|
|
13524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("td", { children: fillerRow ? fillerRow(column.id, table) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(FillerRowElement, {}) }, column.id);
|
|
13301
13525
|
}) }, "filler-row-" + index);
|
|
13302
13526
|
})
|
|
13303
13527
|
] })
|
|
13304
13528
|
]
|
|
13305
13529
|
}
|
|
13306
13530
|
) }),
|
|
13307
|
-
/* @__PURE__ */ (0,
|
|
13531
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "flex-row-2 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
13308
13532
|
Pagination,
|
|
13309
13533
|
{
|
|
13310
13534
|
pageIndex: table.getState().pagination.pageIndex,
|
|
@@ -13316,7 +13540,7 @@ var Table = ({
|
|
|
13316
13540
|
};
|
|
13317
13541
|
var TableUncontrolled = ({ data, ...props }) => {
|
|
13318
13542
|
const [usedDate] = useOverwritableState(data);
|
|
13319
|
-
return /* @__PURE__ */ (0,
|
|
13543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
13320
13544
|
Table,
|
|
13321
13545
|
{
|
|
13322
13546
|
...props,
|
|
@@ -13335,12 +13559,12 @@ var TableWithSelection = ({
|
|
|
13335
13559
|
meta,
|
|
13336
13560
|
...props
|
|
13337
13561
|
}) => {
|
|
13338
|
-
const columnsWithSelection = (0,
|
|
13562
|
+
const columnsWithSelection = (0, import_react43.useMemo)(() => {
|
|
13339
13563
|
return [
|
|
13340
13564
|
{
|
|
13341
13565
|
id: selectionRowId,
|
|
13342
13566
|
header: ({ table }) => {
|
|
13343
|
-
return /* @__PURE__ */ (0,
|
|
13567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
13344
13568
|
Checkbox,
|
|
13345
13569
|
{
|
|
13346
13570
|
checked: table.getIsAllRowsSelected(),
|
|
@@ -13353,7 +13577,7 @@ var TableWithSelection = ({
|
|
|
13353
13577
|
);
|
|
13354
13578
|
},
|
|
13355
13579
|
cell: ({ row }) => {
|
|
13356
|
-
return /* @__PURE__ */ (0,
|
|
13580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
13357
13581
|
Checkbox,
|
|
13358
13582
|
{
|
|
13359
13583
|
disabled: !row.getCanSelect(),
|
|
@@ -13371,15 +13595,15 @@ var TableWithSelection = ({
|
|
|
13371
13595
|
...columns
|
|
13372
13596
|
];
|
|
13373
13597
|
}, [columns, selectionRowId]);
|
|
13374
|
-
return /* @__PURE__ */ (0,
|
|
13598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
13375
13599
|
Table,
|
|
13376
13600
|
{
|
|
13377
13601
|
columns: columnsWithSelection,
|
|
13378
13602
|
fillerRow: (columnId, table) => {
|
|
13379
13603
|
if (columnId === selectionRowId) {
|
|
13380
|
-
return /* @__PURE__ */ (0,
|
|
13604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Checkbox, { checked: false, disabled: true, className: "max-w-6" });
|
|
13381
13605
|
}
|
|
13382
|
-
return fillerRow ? fillerRow(columnId, table) : /* @__PURE__ */ (0,
|
|
13606
|
+
return fillerRow ? fillerRow(columnId, table) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(FillerRowElement, {});
|
|
13383
13607
|
},
|
|
13384
13608
|
state: {
|
|
13385
13609
|
rowSelection,
|
|
@@ -13393,7 +13617,7 @@ var TableWithSelection = ({
|
|
|
13393
13617
|
},
|
|
13394
13618
|
meta: {
|
|
13395
13619
|
...meta,
|
|
13396
|
-
bodyRowClassName: (0,
|
|
13620
|
+
bodyRowClassName: (0, import_clsx48.default)(
|
|
13397
13621
|
{ "cursor-pointer": !disableClickRowClickSelection },
|
|
13398
13622
|
meta?.bodyRowClassName
|
|
13399
13623
|
)
|
|
@@ -13404,8 +13628,8 @@ var TableWithSelection = ({
|
|
|
13404
13628
|
};
|
|
13405
13629
|
|
|
13406
13630
|
// src/components/user-action/CopyToClipboardWrapper.tsx
|
|
13407
|
-
var
|
|
13408
|
-
var
|
|
13631
|
+
var import_react44 = require("react");
|
|
13632
|
+
var import_clsx49 = require("clsx");
|
|
13409
13633
|
|
|
13410
13634
|
// src/utils/writeToClipboard.ts
|
|
13411
13635
|
var writeToClipboard = (text) => {
|
|
@@ -13414,7 +13638,7 @@ var writeToClipboard = (text) => {
|
|
|
13414
13638
|
|
|
13415
13639
|
// src/components/user-action/CopyToClipboardWrapper.tsx
|
|
13416
13640
|
var import_lucide_react22 = require("lucide-react");
|
|
13417
|
-
var
|
|
13641
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
13418
13642
|
var CopyToClipboardWrapper = ({
|
|
13419
13643
|
children,
|
|
13420
13644
|
textToCopy,
|
|
@@ -13424,8 +13648,8 @@ var CopyToClipboardWrapper = ({
|
|
|
13424
13648
|
zIndex = 10
|
|
13425
13649
|
}) => {
|
|
13426
13650
|
const translation = useHightideTranslation();
|
|
13427
|
-
const [isShowingIndication, setIsShowingIndication] = (0,
|
|
13428
|
-
const [isShowingConfirmation, setIsShowingConfirmation] = (0,
|
|
13651
|
+
const [isShowingIndication, setIsShowingIndication] = (0, import_react44.useState)(false);
|
|
13652
|
+
const [isShowingConfirmation, setIsShowingConfirmation] = (0, import_react44.useState)(false);
|
|
13429
13653
|
const positionClasses = {
|
|
13430
13654
|
top: `bottom-full left-1/2 -translate-x-1/2 mb-[6px]`,
|
|
13431
13655
|
bottom: `top-full left-1/2 -translate-x-1/2 mt-[6px]`,
|
|
@@ -13445,10 +13669,10 @@ var CopyToClipboardWrapper = ({
|
|
|
13445
13669
|
left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
|
|
13446
13670
|
right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
|
|
13447
13671
|
};
|
|
13448
|
-
return /* @__PURE__ */ (0,
|
|
13672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
13449
13673
|
"div",
|
|
13450
13674
|
{
|
|
13451
|
-
className: (0,
|
|
13675
|
+
className: (0, import_clsx49.clsx)("relative inline-block cursor-copy", containerClassName),
|
|
13452
13676
|
onMouseEnter: () => {
|
|
13453
13677
|
setIsShowingIndication(true);
|
|
13454
13678
|
},
|
|
@@ -13463,10 +13687,10 @@ var CopyToClipboardWrapper = ({
|
|
|
13463
13687
|
},
|
|
13464
13688
|
children: [
|
|
13465
13689
|
children,
|
|
13466
|
-
/* @__PURE__ */ (0,
|
|
13690
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
13467
13691
|
"div",
|
|
13468
13692
|
{
|
|
13469
|
-
className: (0,
|
|
13693
|
+
className: (0, import_clsx49.clsx)(
|
|
13470
13694
|
`absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap
|
|
13471
13695
|
shadow-around-md bg-tooltip-background cursor-default pointer-events-none`,
|
|
13472
13696
|
"transition-opacity duration-200",
|
|
@@ -13478,18 +13702,18 @@ var CopyToClipboardWrapper = ({
|
|
|
13478
13702
|
opacity: isShowingIndication || isShowingConfirmation ? 1 : 0
|
|
13479
13703
|
},
|
|
13480
13704
|
children: [
|
|
13481
|
-
isShowingConfirmation && /* @__PURE__ */ (0,
|
|
13482
|
-
/* @__PURE__ */ (0,
|
|
13705
|
+
isShowingConfirmation && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex-row-1", children: [
|
|
13706
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react22.CheckIcon, { size: 16, className: "text-positive" }),
|
|
13483
13707
|
translation("copied")
|
|
13484
13708
|
] }),
|
|
13485
|
-
isShowingIndication && /* @__PURE__ */ (0,
|
|
13486
|
-
/* @__PURE__ */ (0,
|
|
13709
|
+
isShowingIndication && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex-row-1 text-description", children: [
|
|
13710
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react22.Copy, { size: 16 }),
|
|
13487
13711
|
translation("clickToCopy")
|
|
13488
13712
|
] }),
|
|
13489
|
-
/* @__PURE__ */ (0,
|
|
13713
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
13490
13714
|
"div",
|
|
13491
13715
|
{
|
|
13492
|
-
className: (0,
|
|
13716
|
+
className: (0, import_clsx49.clsx)(`absolute w-0 h-0`, triangleClasses[position]),
|
|
13493
13717
|
style: { ...triangleStyle[position], zIndex: zIndex + 1 }
|
|
13494
13718
|
}
|
|
13495
13719
|
)
|
|
@@ -13502,30 +13726,27 @@ var CopyToClipboardWrapper = ({
|
|
|
13502
13726
|
};
|
|
13503
13727
|
|
|
13504
13728
|
// src/components/user-action/DateAndTimePicker.tsx
|
|
13505
|
-
var
|
|
13506
|
-
var
|
|
13729
|
+
var import_clsx50 = __toESM(require("clsx"));
|
|
13730
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
13507
13731
|
var DateTimePicker = ({
|
|
13508
13732
|
value = /* @__PURE__ */ new Date(),
|
|
13509
13733
|
start = subtractDuration(/* @__PURE__ */ new Date(), { years: 50 }),
|
|
13510
13734
|
end = addDuration(/* @__PURE__ */ new Date(), { years: 50 }),
|
|
13511
13735
|
mode = "dateTime",
|
|
13512
|
-
onFinish,
|
|
13513
13736
|
onChange,
|
|
13514
|
-
onRemove,
|
|
13515
13737
|
timePickerProps,
|
|
13516
13738
|
datePickerProps
|
|
13517
13739
|
}) => {
|
|
13518
|
-
const translation = useHightideTranslation();
|
|
13519
13740
|
const useDate = mode === "dateTime" || mode === "date";
|
|
13520
13741
|
const useTime = mode === "dateTime" || mode === "time";
|
|
13521
13742
|
let dateDisplay;
|
|
13522
13743
|
let timeDisplay;
|
|
13523
13744
|
if (useDate) {
|
|
13524
|
-
dateDisplay = /* @__PURE__ */ (0,
|
|
13745
|
+
dateDisplay = /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
13525
13746
|
DatePicker,
|
|
13526
13747
|
{
|
|
13527
13748
|
...datePickerProps,
|
|
13528
|
-
className: "min-w-80
|
|
13749
|
+
className: "min-w-80",
|
|
13529
13750
|
yearMonthPickerProps: { className: "h-full grow" },
|
|
13530
13751
|
value,
|
|
13531
13752
|
start,
|
|
@@ -13535,39 +13756,26 @@ var DateTimePicker = ({
|
|
|
13535
13756
|
);
|
|
13536
13757
|
}
|
|
13537
13758
|
if (useTime) {
|
|
13538
|
-
timeDisplay = /* @__PURE__ */ (0,
|
|
13759
|
+
timeDisplay = /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
13539
13760
|
TimePicker,
|
|
13540
13761
|
{
|
|
13541
13762
|
...timePickerProps,
|
|
13542
|
-
className: (0,
|
|
13763
|
+
className: (0, import_clsx50.default)({ "justify-between": mode === "time" }),
|
|
13543
13764
|
time: value,
|
|
13544
13765
|
onChange
|
|
13545
13766
|
}
|
|
13546
13767
|
);
|
|
13547
13768
|
}
|
|
13548
|
-
return /* @__PURE__ */ (0,
|
|
13549
|
-
|
|
13550
|
-
|
|
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
|
-
] }) })
|
|
13769
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex-row-2 min-h-71 max-h-71", children: [
|
|
13770
|
+
dateDisplay,
|
|
13771
|
+
timeDisplay
|
|
13564
13772
|
] });
|
|
13565
13773
|
};
|
|
13566
13774
|
|
|
13567
13775
|
// src/components/user-action/ScrollPicker.tsx
|
|
13568
|
-
var
|
|
13569
|
-
var
|
|
13570
|
-
var
|
|
13776
|
+
var import_react45 = require("react");
|
|
13777
|
+
var import_clsx51 = __toESM(require("clsx"));
|
|
13778
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
13571
13779
|
var up = 1;
|
|
13572
13780
|
var down = -1;
|
|
13573
13781
|
var ScrollPicker = ({
|
|
@@ -13586,7 +13794,7 @@ var ScrollPicker = ({
|
|
|
13586
13794
|
transition,
|
|
13587
13795
|
items,
|
|
13588
13796
|
lastTimeStamp
|
|
13589
|
-
}, setAnimation] = (0,
|
|
13797
|
+
}, setAnimation] = (0, import_react45.useState)({
|
|
13590
13798
|
targetIndex: selectedIndex,
|
|
13591
13799
|
currentIndex: disabled ? selectedIndex : 0,
|
|
13592
13800
|
velocity: 0,
|
|
@@ -13602,7 +13810,7 @@ var ScrollPicker = ({
|
|
|
13602
13810
|
const itemHeight = 40;
|
|
13603
13811
|
const distance = 8;
|
|
13604
13812
|
const containerHeight = itemHeight * (itemsShownCount - 2) + distance * (itemsShownCount - 2 + 1);
|
|
13605
|
-
const getDirection = (0,
|
|
13813
|
+
const getDirection = (0, import_react45.useCallback)((targetIndex, currentIndex2, transition2, length) => {
|
|
13606
13814
|
if (targetIndex === currentIndex2) {
|
|
13607
13815
|
return transition2 > 0 ? up : down;
|
|
13608
13816
|
}
|
|
@@ -13612,7 +13820,7 @@ var ScrollPicker = ({
|
|
|
13612
13820
|
}
|
|
13613
13821
|
return distanceForward >= length / 2 ? down : up;
|
|
13614
13822
|
}, []);
|
|
13615
|
-
const animate = (0,
|
|
13823
|
+
const animate = (0, import_react45.useCallback)((timestamp, startTime) => {
|
|
13616
13824
|
setAnimation((prevState) => {
|
|
13617
13825
|
const {
|
|
13618
13826
|
targetIndex,
|
|
@@ -13685,7 +13893,7 @@ var ScrollPicker = ({
|
|
|
13685
13893
|
};
|
|
13686
13894
|
});
|
|
13687
13895
|
}, [disabled, getDirection, onChange]);
|
|
13688
|
-
(0,
|
|
13896
|
+
(0, import_react45.useEffect)(() => {
|
|
13689
13897
|
requestAnimationFrame((timestamp) => animate(timestamp, lastTimeStamp));
|
|
13690
13898
|
});
|
|
13691
13899
|
const opacity = (transition2, index, itemsCount) => {
|
|
@@ -13706,7 +13914,7 @@ var ScrollPicker = ({
|
|
|
13706
13914
|
}
|
|
13707
13915
|
return clamp(1 - opacityValue / max);
|
|
13708
13916
|
};
|
|
13709
|
-
return /* @__PURE__ */ (0,
|
|
13917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
13710
13918
|
"div",
|
|
13711
13919
|
{
|
|
13712
13920
|
className: "relative overflow-hidden",
|
|
@@ -13717,15 +13925,15 @@ var ScrollPicker = ({
|
|
|
13717
13925
|
setAnimation(({ velocity, ...animationData }) => ({ ...animationData, velocity: velocity + deltaY }));
|
|
13718
13926
|
}
|
|
13719
13927
|
},
|
|
13720
|
-
children: /* @__PURE__ */ (0,
|
|
13721
|
-
/* @__PURE__ */ (0,
|
|
13928
|
+
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: [
|
|
13929
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
13722
13930
|
"div",
|
|
13723
13931
|
{
|
|
13724
13932
|
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
13933
|
style: { height: `${itemHeight}px` }
|
|
13726
13934
|
}
|
|
13727
13935
|
),
|
|
13728
|
-
/* @__PURE__ */ (0,
|
|
13936
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
13729
13937
|
"div",
|
|
13730
13938
|
{
|
|
13731
13939
|
className: "flex-col-2 select-none",
|
|
@@ -13733,10 +13941,10 @@ var ScrollPicker = ({
|
|
|
13733
13941
|
transform: `translateY(${-transition * (distance + itemHeight)}px)`,
|
|
13734
13942
|
columnGap: `${distance}px`
|
|
13735
13943
|
},
|
|
13736
|
-
children: shownItems.map(({ name, index }, arrayIndex) => /* @__PURE__ */ (0,
|
|
13944
|
+
children: shownItems.map(({ name, index }, arrayIndex) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
13737
13945
|
"div",
|
|
13738
13946
|
{
|
|
13739
|
-
className: (0,
|
|
13947
|
+
className: (0, import_clsx51.default)(
|
|
13740
13948
|
`flex-col-2 items-center justify-center rounded-md`,
|
|
13741
13949
|
{
|
|
13742
13950
|
"text-primary font-bold": currentIndex === index,
|
|
@@ -13762,93 +13970,163 @@ var ScrollPicker = ({
|
|
|
13762
13970
|
);
|
|
13763
13971
|
};
|
|
13764
13972
|
|
|
13765
|
-
// src/components/user-action/
|
|
13766
|
-
var
|
|
13767
|
-
var
|
|
13768
|
-
var
|
|
13769
|
-
|
|
13770
|
-
|
|
13771
|
-
|
|
13772
|
-
|
|
13773
|
-
|
|
13774
|
-
|
|
13973
|
+
// src/components/user-action/input/DateTimeInput.tsx
|
|
13974
|
+
var import_react46 = require("react");
|
|
13975
|
+
var import_lucide_react23 = require("lucide-react");
|
|
13976
|
+
var import_clsx52 = __toESM(require("clsx"));
|
|
13977
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
13978
|
+
var DateTimeInput = ({
|
|
13979
|
+
date,
|
|
13980
|
+
onValueChange,
|
|
13981
|
+
onEditCompleted,
|
|
13982
|
+
onRemove,
|
|
13983
|
+
containerProps,
|
|
13984
|
+
mode = "date",
|
|
13985
|
+
pickerProps,
|
|
13986
|
+
...props
|
|
13775
13987
|
}) => {
|
|
13776
|
-
const
|
|
13777
|
-
const
|
|
13778
|
-
|
|
13779
|
-
|
|
13780
|
-
|
|
13781
|
-
|
|
13782
|
-
};
|
|
13783
|
-
const
|
|
13784
|
-
const
|
|
13785
|
-
|
|
13786
|
-
|
|
13787
|
-
|
|
13788
|
-
|
|
13789
|
-
};
|
|
13790
|
-
const
|
|
13791
|
-
|
|
13792
|
-
|
|
13793
|
-
|
|
13794
|
-
|
|
13795
|
-
|
|
13796
|
-
|
|
13797
|
-
|
|
13798
|
-
|
|
13988
|
+
const translation = useHightideTranslation();
|
|
13989
|
+
const { locale } = useLocale();
|
|
13990
|
+
const [isOpen, setIsOpen] = (0, import_react46.useState)(false);
|
|
13991
|
+
const containerRef = (0, import_react46.useRef)(null);
|
|
13992
|
+
useOutsideClick([containerRef], () => {
|
|
13993
|
+
setIsOpen(false);
|
|
13994
|
+
});
|
|
13995
|
+
const zIndex = useZIndexRegister(isOpen);
|
|
13996
|
+
const isReadOnly = (0, import_react46.useMemo)(() => props.readOnly || props.disabled, [props.readOnly, props.disabled]);
|
|
13997
|
+
(0, import_react46.useEffect)(() => {
|
|
13998
|
+
if (isReadOnly) {
|
|
13999
|
+
setIsOpen(false);
|
|
14000
|
+
}
|
|
14001
|
+
}, [isReadOnly]);
|
|
14002
|
+
const cleanInputProps = { ...props };
|
|
14003
|
+
delete cleanInputProps["isShowingError"];
|
|
14004
|
+
delete cleanInputProps["setIsShowingError"];
|
|
14005
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
|
|
14006
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { ...containerProps, className: (0, import_clsx52.default)("relative w-full", containerProps?.className), children: [
|
|
14007
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14008
|
+
Input,
|
|
14009
|
+
{
|
|
14010
|
+
...cleanInputProps,
|
|
14011
|
+
placeholder: translation("clickToAdd"),
|
|
14012
|
+
value: date ? DateUtils.formatAbsolute(date, locale, mode === "dateTime") : "",
|
|
14013
|
+
onClick: (event) => {
|
|
14014
|
+
setIsOpen(true);
|
|
14015
|
+
cleanInputProps.onClick?.(event);
|
|
14016
|
+
},
|
|
14017
|
+
readOnly: true,
|
|
14018
|
+
className: (0, import_clsx52.default)(
|
|
14019
|
+
"pr-10 w-full",
|
|
14020
|
+
{ "hover:cursor-pointer": !isReadOnly },
|
|
14021
|
+
cleanInputProps.className
|
|
14022
|
+
)
|
|
14023
|
+
}
|
|
14024
|
+
),
|
|
14025
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14026
|
+
Button,
|
|
14027
|
+
{
|
|
14028
|
+
coloringStyle: "text",
|
|
14029
|
+
layout: "icon",
|
|
14030
|
+
color: "neutral",
|
|
14031
|
+
size: "small",
|
|
14032
|
+
className: "absolute right-1 top-1/2 -translate-y-1/2",
|
|
14033
|
+
disabled: isReadOnly,
|
|
14034
|
+
onClick: () => setIsOpen((prevState) => !prevState),
|
|
14035
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_lucide_react23.CalendarIcon, { className: "size-5" })
|
|
14036
|
+
}
|
|
14037
|
+
)
|
|
14038
|
+
] }),
|
|
14039
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Visibility, { isVisible: isOpen, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
14040
|
+
"div",
|
|
14041
|
+
{
|
|
14042
|
+
ref: containerRef,
|
|
14043
|
+
className: "absolute left-0 flex-col-3 rounded-lg shadow-xl border bg-surface-variant text-on-surface border-divider p-2",
|
|
14044
|
+
style: { zIndex },
|
|
14045
|
+
children: [
|
|
14046
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14047
|
+
DateTimePicker,
|
|
14048
|
+
{
|
|
14049
|
+
...pickerProps,
|
|
14050
|
+
mode,
|
|
14051
|
+
value: date,
|
|
14052
|
+
onChange: (newDate) => {
|
|
14053
|
+
onValueChange(newDate);
|
|
14054
|
+
}
|
|
14055
|
+
}
|
|
14056
|
+
),
|
|
14057
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex-row-2 justify-end", children: [
|
|
14058
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Visibility, { isVisible: !!onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14059
|
+
Button,
|
|
14060
|
+
{
|
|
14061
|
+
size: "medium",
|
|
14062
|
+
color: "negative",
|
|
14063
|
+
onClick: () => {
|
|
14064
|
+
onRemove?.();
|
|
14065
|
+
setIsOpen(false);
|
|
14066
|
+
},
|
|
14067
|
+
children: translation("clear")
|
|
14068
|
+
}
|
|
14069
|
+
) }),
|
|
14070
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14071
|
+
Button,
|
|
14072
|
+
{
|
|
14073
|
+
size: "medium",
|
|
14074
|
+
onClick: () => {
|
|
14075
|
+
onEditCompleted?.(date);
|
|
14076
|
+
setIsOpen(false);
|
|
14077
|
+
},
|
|
14078
|
+
children: translation("change")
|
|
14079
|
+
}
|
|
14080
|
+
)
|
|
14081
|
+
] })
|
|
14082
|
+
]
|
|
14083
|
+
}
|
|
14084
|
+
) })
|
|
14085
|
+
] });
|
|
14086
|
+
};
|
|
14087
|
+
var DateTimeInputUncontrolled = ({
|
|
14088
|
+
date: initialDate,
|
|
14089
|
+
...props
|
|
14090
|
+
}) => {
|
|
14091
|
+
const [date, setDate] = useOverwritableState((0, import_react46.useMemo)(() => initialDate ?? /* @__PURE__ */ new Date(), [initialDate]));
|
|
14092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14093
|
+
DateTimeInput,
|
|
13799
14094
|
{
|
|
13800
|
-
|
|
13801
|
-
|
|
13802
|
-
|
|
13803
|
-
|
|
13804
|
-
|
|
13805
|
-
|
|
13806
|
-
|
|
13807
|
-
|
|
13808
|
-
|
|
13809
|
-
|
|
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
|
-
]
|
|
14095
|
+
...props,
|
|
14096
|
+
date,
|
|
14097
|
+
onValueChange: (newDate) => {
|
|
14098
|
+
setDate(newDate);
|
|
14099
|
+
props.onValueChange?.(newDate);
|
|
14100
|
+
},
|
|
14101
|
+
onRemove: () => {
|
|
14102
|
+
setDate(/* @__PURE__ */ new Date());
|
|
14103
|
+
props.onRemove?.();
|
|
14104
|
+
}
|
|
13827
14105
|
}
|
|
13828
14106
|
);
|
|
13829
14107
|
};
|
|
13830
14108
|
|
|
13831
14109
|
// src/components/user-action/input/InsideLabelInput.tsx
|
|
13832
|
-
var
|
|
13833
|
-
var
|
|
13834
|
-
var
|
|
13835
|
-
var
|
|
13836
|
-
var InsideLabelInput = (0,
|
|
14110
|
+
var import_react47 = require("react");
|
|
14111
|
+
var import_react48 = require("react");
|
|
14112
|
+
var import_clsx53 = __toESM(require("clsx"));
|
|
14113
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
14114
|
+
var InsideLabelInput = (0, import_react48.forwardRef)(function InsideLabelInput2({
|
|
13837
14115
|
id: customId,
|
|
13838
14116
|
label,
|
|
13839
14117
|
...props
|
|
13840
14118
|
}, forwardedRef) {
|
|
13841
14119
|
const { value } = props;
|
|
13842
|
-
const [isFocused, setIsFocused] = (0,
|
|
13843
|
-
const generatedId = (0,
|
|
14120
|
+
const [isFocused, setIsFocused] = (0, import_react48.useState)(false);
|
|
14121
|
+
const generatedId = (0, import_react47.useId)();
|
|
13844
14122
|
const id = customId ?? generatedId;
|
|
13845
|
-
return /* @__PURE__ */ (0,
|
|
13846
|
-
/* @__PURE__ */ (0,
|
|
14123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: (0, import_clsx53.default)("relative"), children: [
|
|
14124
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
13847
14125
|
Input,
|
|
13848
14126
|
{
|
|
13849
14127
|
...props,
|
|
13850
14128
|
id,
|
|
13851
|
-
className: (0,
|
|
14129
|
+
className: (0, import_clsx53.default)("h-14 px-4 pb-2 py-6.5", props.className),
|
|
13852
14130
|
ref: forwardedRef,
|
|
13853
14131
|
"aria-labelledby": id + "-label",
|
|
13854
14132
|
onFocus: (event) => {
|
|
@@ -13861,13 +14139,13 @@ var InsideLabelInput = (0, import_react46.forwardRef)(function InsideLabelInput2
|
|
|
13861
14139
|
}
|
|
13862
14140
|
}
|
|
13863
14141
|
),
|
|
13864
|
-
/* @__PURE__ */ (0,
|
|
14142
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
13865
14143
|
"label",
|
|
13866
14144
|
{
|
|
13867
14145
|
id: id + "-label",
|
|
13868
14146
|
"aria-hidden": true,
|
|
13869
14147
|
"data-display": isFocused || !!value ? "small" : "full",
|
|
13870
|
-
className: (0,
|
|
14148
|
+
className: (0, import_clsx53.default)(
|
|
13871
14149
|
// margin left to account for the border which is ignored for absolute positions
|
|
13872
14150
|
"absolute left-4 ml-0.5 top-2 transition-all delay-25 pointer-events-none touch-none",
|
|
13873
14151
|
"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 +14161,7 @@ var InsideLabelInputUncontrolled = ({
|
|
|
13883
14161
|
...props
|
|
13884
14162
|
}) => {
|
|
13885
14163
|
const [value, setValue] = useOverwritableState(initialValue, props.onChangeText);
|
|
13886
|
-
return /* @__PURE__ */ (0,
|
|
14164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
13887
14165
|
InsideLabelInput,
|
|
13888
14166
|
{
|
|
13889
14167
|
...props,
|
|
@@ -13894,9 +14172,9 @@ var InsideLabelInputUncontrolled = ({
|
|
|
13894
14172
|
};
|
|
13895
14173
|
|
|
13896
14174
|
// src/components/user-action/input/SearchBar.tsx
|
|
13897
|
-
var
|
|
13898
|
-
var
|
|
13899
|
-
var
|
|
14175
|
+
var import_lucide_react24 = require("lucide-react");
|
|
14176
|
+
var import_clsx54 = require("clsx");
|
|
14177
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
13900
14178
|
var SearchBar = ({
|
|
13901
14179
|
onSearch,
|
|
13902
14180
|
searchButtonProps,
|
|
@@ -13904,16 +14182,16 @@ var SearchBar = ({
|
|
|
13904
14182
|
...inputProps
|
|
13905
14183
|
}) => {
|
|
13906
14184
|
const translation = useHightideTranslation();
|
|
13907
|
-
return /* @__PURE__ */ (0,
|
|
13908
|
-
/* @__PURE__ */ (0,
|
|
14185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { ...containerProps, className: (0, import_clsx54.clsx)("relative", containerProps?.className), children: [
|
|
14186
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
13909
14187
|
InputUncontrolled,
|
|
13910
14188
|
{
|
|
13911
14189
|
...inputProps,
|
|
13912
14190
|
placeholder: inputProps.placeholder ?? translation("search"),
|
|
13913
|
-
className: (0,
|
|
14191
|
+
className: (0, import_clsx54.clsx)("pr-10 w-full", inputProps.className)
|
|
13914
14192
|
}
|
|
13915
14193
|
),
|
|
13916
|
-
onSearch && /* @__PURE__ */ (0,
|
|
14194
|
+
onSearch && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
13917
14195
|
Button,
|
|
13918
14196
|
{
|
|
13919
14197
|
...searchButtonProps,
|
|
@@ -13922,34 +14200,34 @@ var SearchBar = ({
|
|
|
13922
14200
|
color: "neutral",
|
|
13923
14201
|
coloringStyle: "text",
|
|
13924
14202
|
onClick: (event) => onSearch(event),
|
|
13925
|
-
className: (0,
|
|
13926
|
-
children: /* @__PURE__ */ (0,
|
|
14203
|
+
className: (0, import_clsx54.clsx)("absolute right-1 top-1/2 -translate-y-1/2", searchButtonProps?.className),
|
|
14204
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react24.Search, { className: "w-full h-full" })
|
|
13927
14205
|
}
|
|
13928
14206
|
)
|
|
13929
14207
|
] });
|
|
13930
14208
|
};
|
|
13931
14209
|
|
|
13932
14210
|
// src/components/user-action/input/ToggleableInput.tsx
|
|
13933
|
-
var
|
|
13934
|
-
var
|
|
13935
|
-
var
|
|
13936
|
-
var
|
|
13937
|
-
var ToggleableInput = (0,
|
|
14211
|
+
var import_react49 = require("react");
|
|
14212
|
+
var import_lucide_react25 = require("lucide-react");
|
|
14213
|
+
var import_clsx55 = __toESM(require("clsx"));
|
|
14214
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
14215
|
+
var ToggleableInput = (0, import_react49.forwardRef)(function ToggleableInput2({
|
|
13938
14216
|
value,
|
|
13939
14217
|
initialState = "display",
|
|
13940
14218
|
editCompleteOptions,
|
|
13941
14219
|
...props
|
|
13942
14220
|
}, forwardedRef) {
|
|
13943
|
-
const [isEditing, setIsEditing] = (0,
|
|
13944
|
-
const innerRef = (0,
|
|
13945
|
-
(0,
|
|
13946
|
-
(0,
|
|
14221
|
+
const [isEditing, setIsEditing] = (0, import_react49.useState)(initialState !== "display");
|
|
14222
|
+
const innerRef = (0, import_react49.useRef)(null);
|
|
14223
|
+
(0, import_react49.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
14224
|
+
(0, import_react49.useEffect)(() => {
|
|
13947
14225
|
if (isEditing) {
|
|
13948
14226
|
innerRef.current?.focus();
|
|
13949
14227
|
}
|
|
13950
14228
|
}, [isEditing]);
|
|
13951
|
-
return /* @__PURE__ */ (0,
|
|
13952
|
-
/* @__PURE__ */ (0,
|
|
14229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: (0, import_clsx55.default)("relative flex-row-2", { "flex-1": isEditing }), children: [
|
|
14230
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
13953
14231
|
Input,
|
|
13954
14232
|
{
|
|
13955
14233
|
...props,
|
|
@@ -13970,14 +14248,14 @@ var ToggleableInput = (0, import_react47.forwardRef)(function ToggleableInput2({
|
|
|
13970
14248
|
},
|
|
13971
14249
|
"data-name": props["data-name"] ?? "togglable-input",
|
|
13972
14250
|
"data-isEditing": isEditing ? "" : void 0,
|
|
13973
|
-
className: (0,
|
|
14251
|
+
className: (0, import_clsx55.default)(`w-full rounded-md`, {
|
|
13974
14252
|
"text-transparent": !isEditing
|
|
13975
14253
|
})
|
|
13976
14254
|
}
|
|
13977
14255
|
),
|
|
13978
|
-
!isEditing && /* @__PURE__ */ (0,
|
|
13979
|
-
/* @__PURE__ */ (0,
|
|
13980
|
-
/* @__PURE__ */ (0,
|
|
14256
|
+
!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: [
|
|
14257
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: (0, import_clsx55.default)(" truncate"), children: value }),
|
|
14258
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_lucide_react25.Pencil, { className: (0, import_clsx55.default)(`size-force-4`, { "text-transparent": isEditing }) })
|
|
13981
14259
|
] })
|
|
13982
14260
|
] });
|
|
13983
14261
|
});
|
|
@@ -13987,7 +14265,7 @@ var ToggleableInputUncontrolled = ({
|
|
|
13987
14265
|
...restProps
|
|
13988
14266
|
}) => {
|
|
13989
14267
|
const [value, setValue] = useOverwritableState(initialValue, onChangeText);
|
|
13990
|
-
return /* @__PURE__ */ (0,
|
|
14268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
13991
14269
|
ToggleableInput,
|
|
13992
14270
|
{
|
|
13993
14271
|
value,
|
|
@@ -13998,33 +14276,33 @@ var ToggleableInputUncontrolled = ({
|
|
|
13998
14276
|
};
|
|
13999
14277
|
|
|
14000
14278
|
// src/components/utils/FocusTrap.tsx
|
|
14001
|
-
var import_react48 = require("react");
|
|
14002
|
-
var import_react49 = require("react");
|
|
14003
14279
|
var import_react50 = require("react");
|
|
14004
|
-
var
|
|
14005
|
-
var
|
|
14280
|
+
var import_react51 = require("react");
|
|
14281
|
+
var import_react52 = require("react");
|
|
14282
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
14283
|
+
var FocusTrap = (0, import_react52.forwardRef)(function FocusTrap2({
|
|
14006
14284
|
active = true,
|
|
14007
14285
|
initialFocus,
|
|
14008
14286
|
focusFirst = false,
|
|
14009
14287
|
...props
|
|
14010
14288
|
}, forwardedRef) {
|
|
14011
|
-
const innerRef = (0,
|
|
14012
|
-
(0,
|
|
14289
|
+
const innerRef = (0, import_react50.useRef)(null);
|
|
14290
|
+
(0, import_react51.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
14013
14291
|
useFocusTrap({ container: innerRef, active, initialFocus, focusFirst });
|
|
14014
|
-
return /* @__PURE__ */ (0,
|
|
14292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { ref: innerRef, ...props });
|
|
14015
14293
|
});
|
|
14016
14294
|
|
|
14017
14295
|
// src/components/utils/Transition.tsx
|
|
14018
|
-
var
|
|
14296
|
+
var import_react53 = require("react");
|
|
14019
14297
|
function Transition({
|
|
14020
14298
|
children,
|
|
14021
14299
|
show,
|
|
14022
14300
|
includeAnimation = true
|
|
14023
14301
|
}) {
|
|
14024
|
-
const [isOpen, setIsOpen] = (0,
|
|
14025
|
-
const [isTransitioning, setIsTransitioning] = (0,
|
|
14302
|
+
const [isOpen, setIsOpen] = (0, import_react53.useState)(show);
|
|
14303
|
+
const [isTransitioning, setIsTransitioning] = (0, import_react53.useState)(!isOpen);
|
|
14026
14304
|
const isUsingReducedMotion = typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : true;
|
|
14027
|
-
(0,
|
|
14305
|
+
(0, import_react53.useEffect)(() => {
|
|
14028
14306
|
setIsOpen(show);
|
|
14029
14307
|
setIsTransitioning(true);
|
|
14030
14308
|
}, [show]);
|
|
@@ -14049,7 +14327,7 @@ function Transition({
|
|
|
14049
14327
|
}
|
|
14050
14328
|
|
|
14051
14329
|
// src/hooks/focus/useFocusGuards.ts
|
|
14052
|
-
var
|
|
14330
|
+
var import_react54 = require("react");
|
|
14053
14331
|
var selectorName = "data-hw-focus-guard";
|
|
14054
14332
|
function FocusGuard() {
|
|
14055
14333
|
const element = document.createElement("div");
|
|
@@ -14087,7 +14365,7 @@ var FocusGuardsService = class _FocusGuardsService {
|
|
|
14087
14365
|
}
|
|
14088
14366
|
};
|
|
14089
14367
|
var useFocusGuards = () => {
|
|
14090
|
-
(0,
|
|
14368
|
+
(0, import_react54.useEffect)(() => {
|
|
14091
14369
|
FocusGuardsService.getInstance().add();
|
|
14092
14370
|
return () => {
|
|
14093
14371
|
FocusGuardsService.getInstance().remove();
|
|
@@ -14096,10 +14374,10 @@ var useFocusGuards = () => {
|
|
|
14096
14374
|
};
|
|
14097
14375
|
|
|
14098
14376
|
// src/hooks/focus/useFocusOnceVisible.ts
|
|
14099
|
-
var
|
|
14377
|
+
var import_react55 = __toESM(require("react"));
|
|
14100
14378
|
var useFocusOnceVisible = (ref, disable = false) => {
|
|
14101
|
-
const [hasUsedFocus, setHasUsedFocus] =
|
|
14102
|
-
(0,
|
|
14379
|
+
const [hasUsedFocus, setHasUsedFocus] = import_react55.default.useState(false);
|
|
14380
|
+
(0, import_react55.useEffect)(() => {
|
|
14103
14381
|
if (disable || hasUsedFocus) {
|
|
14104
14382
|
return;
|
|
14105
14383
|
}
|
|
@@ -14119,13 +14397,13 @@ var useFocusOnceVisible = (ref, disable = false) => {
|
|
|
14119
14397
|
};
|
|
14120
14398
|
|
|
14121
14399
|
// src/hooks/useRerender.ts
|
|
14122
|
-
var
|
|
14400
|
+
var import_react56 = require("react");
|
|
14123
14401
|
var useRerender = () => {
|
|
14124
|
-
return (0,
|
|
14402
|
+
return (0, import_react56.useReducer)(() => ({}), {})[1];
|
|
14125
14403
|
};
|
|
14126
14404
|
|
|
14127
14405
|
// src/hooks/useSearch.ts
|
|
14128
|
-
var
|
|
14406
|
+
var import_react57 = require("react");
|
|
14129
14407
|
|
|
14130
14408
|
// src/utils/simpleSearch.ts
|
|
14131
14409
|
var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
|
|
@@ -14164,34 +14442,34 @@ var useSearch = ({
|
|
|
14164
14442
|
filter,
|
|
14165
14443
|
disabled = false
|
|
14166
14444
|
}) => {
|
|
14167
|
-
const [search, setSearch] = (0,
|
|
14168
|
-
const [result, setResult] = (0,
|
|
14169
|
-
const searchTags = (0,
|
|
14170
|
-
const updateSearch = (0,
|
|
14445
|
+
const [search, setSearch] = (0, import_react57.useState)(initialSearch ?? "");
|
|
14446
|
+
const [result, setResult] = (0, import_react57.useState)(list);
|
|
14447
|
+
const searchTags = (0, import_react57.useMemo)(() => additionalSearchTags ?? [], [additionalSearchTags]);
|
|
14448
|
+
const updateSearch = (0, import_react57.useCallback)((newSearch) => {
|
|
14171
14449
|
const usedSearch = newSearch ?? search;
|
|
14172
14450
|
if (newSearch) {
|
|
14173
14451
|
setSearch(search);
|
|
14174
14452
|
}
|
|
14175
14453
|
setResult(MultiSubjectSearchWithMapping([usedSearch, ...searchTags], list, searchMapping));
|
|
14176
14454
|
}, [searchTags, list, search, searchMapping]);
|
|
14177
|
-
(0,
|
|
14455
|
+
(0, import_react57.useEffect)(() => {
|
|
14178
14456
|
if (isSearchInstant) {
|
|
14179
14457
|
setResult(MultiSubjectSearchWithMapping([search, ...searchTags], list, searchMapping));
|
|
14180
14458
|
}
|
|
14181
14459
|
}, [searchTags, isSearchInstant, list, search, searchMapping, additionalSearchTags]);
|
|
14182
|
-
const filteredResult = (0,
|
|
14460
|
+
const filteredResult = (0, import_react57.useMemo)(() => {
|
|
14183
14461
|
if (!filter) {
|
|
14184
14462
|
return result;
|
|
14185
14463
|
}
|
|
14186
14464
|
return result.filter(filter);
|
|
14187
14465
|
}, [result, filter]);
|
|
14188
|
-
const sortedAndFilteredResult = (0,
|
|
14466
|
+
const sortedAndFilteredResult = (0, import_react57.useMemo)(() => {
|
|
14189
14467
|
if (!sortingFunction) {
|
|
14190
14468
|
return filteredResult;
|
|
14191
14469
|
}
|
|
14192
14470
|
return filteredResult.sort(sortingFunction);
|
|
14193
14471
|
}, [filteredResult, sortingFunction]);
|
|
14194
|
-
const usedResult = (0,
|
|
14472
|
+
const usedResult = (0, import_react57.useMemo)(() => {
|
|
14195
14473
|
if (!disabled) {
|
|
14196
14474
|
return sortedAndFilteredResult;
|
|
14197
14475
|
}
|
|
@@ -14301,6 +14579,106 @@ var builder = (value, update) => {
|
|
|
14301
14579
|
return value;
|
|
14302
14580
|
};
|
|
14303
14581
|
|
|
14582
|
+
// src/utils/duration.ts
|
|
14583
|
+
var Duration = class _Duration {
|
|
14584
|
+
constructor({
|
|
14585
|
+
years = 0,
|
|
14586
|
+
months = 0,
|
|
14587
|
+
days = 0,
|
|
14588
|
+
hours = 0,
|
|
14589
|
+
minutes = 0,
|
|
14590
|
+
seconds = 0,
|
|
14591
|
+
milliseconds = 0
|
|
14592
|
+
} = {}) {
|
|
14593
|
+
this.assertRanges({ years, months, days, hours, minutes, seconds, milliseconds });
|
|
14594
|
+
this.years = years;
|
|
14595
|
+
this.months = months;
|
|
14596
|
+
this.days = days;
|
|
14597
|
+
this.hours = hours;
|
|
14598
|
+
this.minutes = minutes;
|
|
14599
|
+
this.seconds = seconds;
|
|
14600
|
+
this.milliseconds = milliseconds;
|
|
14601
|
+
}
|
|
14602
|
+
/** Date arithmetic */
|
|
14603
|
+
addTo(date) {
|
|
14604
|
+
return this.applyTo(date, 1);
|
|
14605
|
+
}
|
|
14606
|
+
subtractFrom(date) {
|
|
14607
|
+
return this.applyTo(date, -1);
|
|
14608
|
+
}
|
|
14609
|
+
/** Duration arithmetic */
|
|
14610
|
+
add(other) {
|
|
14611
|
+
return new _Duration({
|
|
14612
|
+
years: this.years + other.years,
|
|
14613
|
+
months: this.months + other.months,
|
|
14614
|
+
days: this.days + other.days,
|
|
14615
|
+
hours: this.hours + other.hours,
|
|
14616
|
+
minutes: this.minutes + other.minutes,
|
|
14617
|
+
seconds: this.seconds + other.seconds,
|
|
14618
|
+
milliseconds: this.milliseconds + other.milliseconds
|
|
14619
|
+
});
|
|
14620
|
+
}
|
|
14621
|
+
subtract(other) {
|
|
14622
|
+
return new _Duration({
|
|
14623
|
+
years: this.years - other.years,
|
|
14624
|
+
months: this.months - other.months,
|
|
14625
|
+
days: this.days - other.days,
|
|
14626
|
+
hours: this.hours - other.hours,
|
|
14627
|
+
minutes: this.minutes - other.minutes,
|
|
14628
|
+
seconds: this.seconds - other.seconds,
|
|
14629
|
+
milliseconds: this.milliseconds - other.milliseconds
|
|
14630
|
+
});
|
|
14631
|
+
}
|
|
14632
|
+
equals(other) {
|
|
14633
|
+
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;
|
|
14634
|
+
}
|
|
14635
|
+
toJSON() {
|
|
14636
|
+
return { ...this };
|
|
14637
|
+
}
|
|
14638
|
+
/** Static difference */
|
|
14639
|
+
static difference(start, end) {
|
|
14640
|
+
const diff = end.getTime() - start.getTime();
|
|
14641
|
+
const ms = 1e3;
|
|
14642
|
+
const min = 60 * ms;
|
|
14643
|
+
const hr = 60 * min;
|
|
14644
|
+
const day = 24 * hr;
|
|
14645
|
+
const month = 30 * day;
|
|
14646
|
+
const year = 365.25 * day;
|
|
14647
|
+
return new _Duration({
|
|
14648
|
+
years: Math.floor(diff / year),
|
|
14649
|
+
months: Math.floor(diff / month),
|
|
14650
|
+
days: Math.floor(diff / day),
|
|
14651
|
+
hours: Math.floor(diff % day / hr),
|
|
14652
|
+
minutes: Math.floor(diff % hr / min),
|
|
14653
|
+
seconds: Math.floor(diff % min / ms),
|
|
14654
|
+
milliseconds: diff % ms
|
|
14655
|
+
});
|
|
14656
|
+
}
|
|
14657
|
+
applyTo(date, multiplier) {
|
|
14658
|
+
const d = new Date(date);
|
|
14659
|
+
d.setFullYear(d.getFullYear() + multiplier * this.years);
|
|
14660
|
+
d.setMonth(d.getMonth() + multiplier * this.months);
|
|
14661
|
+
d.setDate(d.getDate() + multiplier * this.days);
|
|
14662
|
+
d.setHours(d.getHours() + multiplier * this.hours);
|
|
14663
|
+
d.setMinutes(d.getMinutes() + multiplier * this.minutes);
|
|
14664
|
+
d.setSeconds(d.getSeconds() + multiplier * this.seconds);
|
|
14665
|
+
d.setMilliseconds(d.getMilliseconds() + multiplier * this.milliseconds);
|
|
14666
|
+
return d;
|
|
14667
|
+
}
|
|
14668
|
+
assertRanges(d) {
|
|
14669
|
+
if (d.years < 0) throw new RangeError("years >= 0");
|
|
14670
|
+
if (d.months < 0 || d.months > 11) throw new RangeError("months: 0\u201311");
|
|
14671
|
+
if (d.days < 0) throw new RangeError("days >= 0");
|
|
14672
|
+
if (d.hours < 0 || d.hours > 23) throw new RangeError("hours: 0\u201323");
|
|
14673
|
+
if (d.minutes < 0 || d.minutes > 59) throw new RangeError("minutes: 0\u201359");
|
|
14674
|
+
if (d.seconds < 0 || d.seconds > 59) throw new RangeError("seconds: 0\u201359");
|
|
14675
|
+
if (d.milliseconds < 0) throw new RangeError("milliseconds >= 0");
|
|
14676
|
+
}
|
|
14677
|
+
valueOf() {
|
|
14678
|
+
return this.milliseconds + this.seconds * 1e3 + this.minutes * 6e4 + this.hours * 36e5 + this.days * 864e5;
|
|
14679
|
+
}
|
|
14680
|
+
};
|
|
14681
|
+
|
|
14304
14682
|
// src/utils/easeFunctions.ts
|
|
14305
14683
|
var EaseFunctions = class _EaseFunctions {
|
|
14306
14684
|
static cubicBezierGeneric(x1, y1, x2, y2) {
|
|
@@ -14439,12 +14817,16 @@ var PromiseUtils = {
|
|
|
14439
14817
|
DatePicker,
|
|
14440
14818
|
DatePickerUncontrolled,
|
|
14441
14819
|
DateProperty,
|
|
14820
|
+
DateTimeInput,
|
|
14821
|
+
DateTimeInputUncontrolled,
|
|
14442
14822
|
DateTimePicker,
|
|
14823
|
+
DateUtils,
|
|
14443
14824
|
DayPicker,
|
|
14444
14825
|
DayPickerUncontrolled,
|
|
14445
14826
|
Dialog,
|
|
14446
14827
|
DiscardChangesDialog,
|
|
14447
14828
|
DividerInserter,
|
|
14829
|
+
Duration,
|
|
14448
14830
|
EaseFunctions,
|
|
14449
14831
|
ErrorComponent,
|
|
14450
14832
|
Expandable,
|
|
@@ -14542,6 +14924,7 @@ var PromiseUtils = {
|
|
|
14542
14924
|
Transition,
|
|
14543
14925
|
UseValidators,
|
|
14544
14926
|
VerticalDivider,
|
|
14927
|
+
Visibility,
|
|
14545
14928
|
YearMonthPicker,
|
|
14546
14929
|
YearMonthPickerUncontrolled,
|
|
14547
14930
|
addDuration,
|
|
@@ -14551,19 +14934,16 @@ var PromiseUtils = {
|
|
|
14551
14934
|
closestMatch,
|
|
14552
14935
|
createLoopingList,
|
|
14553
14936
|
createLoopingListWithIndex,
|
|
14554
|
-
equalDate,
|
|
14555
14937
|
equalSizeGroups,
|
|
14556
14938
|
formatDate,
|
|
14557
14939
|
formatDateTime,
|
|
14558
14940
|
getBetweenDuration,
|
|
14559
|
-
getDaysInMonth,
|
|
14560
14941
|
getNeighbours,
|
|
14561
14942
|
getWeeksForCalenderMonth,
|
|
14562
14943
|
hightideTranslation,
|
|
14563
14944
|
hightideTranslationLocales,
|
|
14564
14945
|
isInTimeSpan,
|
|
14565
14946
|
match,
|
|
14566
|
-
monthsList,
|
|
14567
14947
|
noop,
|
|
14568
14948
|
range,
|
|
14569
14949
|
resolveSetState,
|
|
@@ -14593,7 +14973,6 @@ var PromiseUtils = {
|
|
|
14593
14973
|
useTranslatedValidators,
|
|
14594
14974
|
useZIndexRegister,
|
|
14595
14975
|
validateEmail,
|
|
14596
|
-
weekDayList,
|
|
14597
14976
|
writeToClipboard
|
|
14598
14977
|
});
|
|
14599
14978
|
//# sourceMappingURL=index.js.map
|