@helpwave/hightide 0.2.0 → 0.3.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 +142 -196
- package/dist/index.d.ts +142 -196
- package/dist/index.js +862 -986
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1048 -1166
- package/dist/index.mjs.map +1 -1
- package/dist/style/globals.css +441 -556
- package/dist/style/uncompiled/globals.css +0 -215
- package/dist/style/uncompiled/theme/breakpoints.css +8 -0
- package/dist/style/uncompiled/theme/colors-basic.css +2 -0
- package/dist/style/uncompiled/theme/colors-component.css +1 -77
- package/dist/style/uncompiled/theme/colors-semantic.css +24 -20
- package/dist/style/uncompiled/theme/components.css +211 -0
- package/dist/style/uncompiled/theme/index.css +4 -1
- package/dist/style/uncompiled/utitlity/animation.css +3 -3
- package/dist/style/uncompiled/utitlity/coloring.css +126 -0
- package/dist/style/uncompiled/utitlity/index.css +2 -1
- package/package.json +1 -4
- /package/dist/style/uncompiled/{typography.css → theme/typography.css} +0 -0
package/dist/index.js
CHANGED
|
@@ -6246,7 +6246,7 @@ __export(index_exports, {
|
|
|
6246
6246
|
AvatarUtil: () => AvatarUtil,
|
|
6247
6247
|
BagFunctionUtil: () => BagFunctionUtil,
|
|
6248
6248
|
BreadCrumb: () => BreadCrumb,
|
|
6249
|
-
|
|
6249
|
+
Button: () => Button,
|
|
6250
6250
|
ButtonUtil: () => ButtonUtil,
|
|
6251
6251
|
Carousel: () => Carousel,
|
|
6252
6252
|
CarouselSlide: () => CarouselSlide,
|
|
@@ -6280,8 +6280,6 @@ __export(index_exports, {
|
|
|
6280
6280
|
FormElementWrapper: () => FormElementWrapper,
|
|
6281
6281
|
HelpwaveBadge: () => HelpwaveBadge,
|
|
6282
6282
|
HelpwaveLogo: () => HelpwaveLogo,
|
|
6283
|
-
IconButton: () => IconButton,
|
|
6284
|
-
IconButtonUtil: () => IconButtonUtil,
|
|
6285
6283
|
Input: () => Input,
|
|
6286
6284
|
InputDialog: () => InputDialog,
|
|
6287
6285
|
InputUncontrolled: () => InputUncontrolled,
|
|
@@ -6317,7 +6315,6 @@ __export(index_exports, {
|
|
|
6317
6315
|
Navigation: () => Navigation,
|
|
6318
6316
|
NavigationItemList: () => NavigationItemList,
|
|
6319
6317
|
NumberProperty: () => NumberProperty,
|
|
6320
|
-
OutlineButton: () => OutlineButton,
|
|
6321
6318
|
Pagination: () => Pagination,
|
|
6322
6319
|
ProgressIndicator: () => ProgressIndicator,
|
|
6323
6320
|
PromiseUtils: () => PromiseUtils,
|
|
@@ -6338,7 +6335,6 @@ __export(index_exports, {
|
|
|
6338
6335
|
SimpleSearch: () => SimpleSearch,
|
|
6339
6336
|
SimpleSearchWithMapping: () => SimpleSearchWithMapping,
|
|
6340
6337
|
SingleSelectProperty: () => SingleSelectProperty,
|
|
6341
|
-
SolidButton: () => SolidButton,
|
|
6342
6338
|
StepperBar: () => StepperBar,
|
|
6343
6339
|
StepperBarUncontrolled: () => StepperBarUncontrolled,
|
|
6344
6340
|
Tab: () => Tab,
|
|
@@ -6351,7 +6347,6 @@ __export(index_exports, {
|
|
|
6351
6347
|
TableUncontrolled: () => TableUncontrolled,
|
|
6352
6348
|
TableWithSelection: () => TableWithSelection,
|
|
6353
6349
|
TagIcon: () => TagIcon,
|
|
6354
|
-
TextButton: () => TextButton,
|
|
6355
6350
|
TextImage: () => TextImage,
|
|
6356
6351
|
TextProperty: () => TextProperty,
|
|
6357
6352
|
Textarea: () => Textarea,
|
|
@@ -6383,7 +6378,6 @@ __export(index_exports, {
|
|
|
6383
6378
|
equalSizeGroups: () => equalSizeGroups,
|
|
6384
6379
|
formatDate: () => formatDate,
|
|
6385
6380
|
formatDateTime: () => formatDateTime,
|
|
6386
|
-
generateShadingColors: () => generateShadingColors,
|
|
6387
6381
|
getBetweenDuration: () => getBetweenDuration,
|
|
6388
6382
|
getDaysInMonth: () => getDaysInMonth,
|
|
6389
6383
|
getNeighbours: () => getNeighbours,
|
|
@@ -6396,7 +6390,6 @@ __export(index_exports, {
|
|
|
6396
6390
|
noop: () => noop,
|
|
6397
6391
|
range: () => range,
|
|
6398
6392
|
resolveSetState: () => resolveSetState,
|
|
6399
|
-
shadingColorValues: () => shadingColorValues,
|
|
6400
6393
|
subtractDuration: () => subtractDuration,
|
|
6401
6394
|
useDelay: () => useDelay,
|
|
6402
6395
|
useFloatingElement: () => useFloatingElement,
|
|
@@ -6421,56 +6414,13 @@ __export(index_exports, {
|
|
|
6421
6414
|
useTabContext: () => useTabContext,
|
|
6422
6415
|
useTheme: () => useTheme,
|
|
6423
6416
|
useTranslatedValidators: () => useTranslatedValidators,
|
|
6417
|
+
useZIndexRegister: () => useZIndexRegister,
|
|
6424
6418
|
validateEmail: () => validateEmail,
|
|
6425
6419
|
weekDayList: () => weekDayList,
|
|
6426
6420
|
writeToClipboard: () => writeToClipboard
|
|
6427
6421
|
});
|
|
6428
6422
|
module.exports = __toCommonJS(index_exports);
|
|
6429
6423
|
|
|
6430
|
-
// src/coloring/shading.ts
|
|
6431
|
-
var import_tinycolor2 = __toESM(require("tinycolor2"));
|
|
6432
|
-
|
|
6433
|
-
// src/coloring/types.ts
|
|
6434
|
-
var shadingColorValues = [0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1e3];
|
|
6435
|
-
|
|
6436
|
-
// src/coloring/shading.ts
|
|
6437
|
-
var generateShadingColors = (partialShading) => {
|
|
6438
|
-
const shading = {
|
|
6439
|
-
0: "#FFFFFF",
|
|
6440
|
-
1e3: "#000000"
|
|
6441
|
-
};
|
|
6442
|
-
let index = 1;
|
|
6443
|
-
while (index < shadingColorValues.length - 1) {
|
|
6444
|
-
const previous = shadingColorValues[index - 1];
|
|
6445
|
-
const current = shadingColorValues[index];
|
|
6446
|
-
if (partialShading[current] !== void 0) {
|
|
6447
|
-
shading[current] = partialShading[current];
|
|
6448
|
-
index++;
|
|
6449
|
-
continue;
|
|
6450
|
-
}
|
|
6451
|
-
let j = index + 1;
|
|
6452
|
-
while (j < shadingColorValues.length) {
|
|
6453
|
-
if (partialShading[shadingColorValues[j]] !== void 0) {
|
|
6454
|
-
break;
|
|
6455
|
-
}
|
|
6456
|
-
j++;
|
|
6457
|
-
}
|
|
6458
|
-
if (j === shadingColorValues.length) {
|
|
6459
|
-
j = shadingColorValues.length - 1;
|
|
6460
|
-
}
|
|
6461
|
-
const nextFound = shadingColorValues[j];
|
|
6462
|
-
const interval = nextFound - previous;
|
|
6463
|
-
for (let k = index; k < j; k++) {
|
|
6464
|
-
const current2 = shadingColorValues[k];
|
|
6465
|
-
const previousValue = partialShading[previous] ?? shading[previous];
|
|
6466
|
-
const nextValue = partialShading[nextFound] ?? shading[nextFound];
|
|
6467
|
-
shading[current2] = import_tinycolor2.default.mix((0, import_tinycolor2.default)(previousValue), (0, import_tinycolor2.default)(nextValue), (current2 - previous) / interval * 100).toHexString();
|
|
6468
|
-
}
|
|
6469
|
-
index = j;
|
|
6470
|
-
}
|
|
6471
|
-
return shading;
|
|
6472
|
-
};
|
|
6473
|
-
|
|
6474
6424
|
// src/components/icons-and-geometry/HelpwaveLogo.tsx
|
|
6475
6425
|
var import_clsx = require("clsx");
|
|
6476
6426
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -6864,7 +6814,7 @@ var useOverwritableState = (initialValue, onChange) => {
|
|
|
6864
6814
|
};
|
|
6865
6815
|
|
|
6866
6816
|
// src/components/date/DayPicker.tsx
|
|
6867
|
-
var
|
|
6817
|
+
var import_clsx4 = __toESM(require("clsx"));
|
|
6868
6818
|
|
|
6869
6819
|
// src/i18n/LocaleProvider.tsx
|
|
6870
6820
|
var import_react3 = require("react");
|
|
@@ -7510,8 +7460,83 @@ var useLanguage = () => {
|
|
|
7510
7460
|
};
|
|
7511
7461
|
|
|
7512
7462
|
// src/components/date/DayPicker.tsx
|
|
7463
|
+
var import_react5 = require("react");
|
|
7464
|
+
|
|
7465
|
+
// src/components/user-action/Button.tsx
|
|
7513
7466
|
var import_react4 = require("react");
|
|
7467
|
+
var import_clsx3 = __toESM(require("clsx"));
|
|
7514
7468
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
7469
|
+
var buttonColorsList = ["primary", "secondary", "positive", "warning", "negative", "neutral", "none"];
|
|
7470
|
+
var paddingMapping = {
|
|
7471
|
+
default: {
|
|
7472
|
+
tiny: "btn-xs",
|
|
7473
|
+
small: "btn-sm",
|
|
7474
|
+
medium: "btn-md",
|
|
7475
|
+
large: "btn-lg"
|
|
7476
|
+
},
|
|
7477
|
+
icon: {
|
|
7478
|
+
tiny: "icon-btn-xs",
|
|
7479
|
+
small: "icon-btn-sm",
|
|
7480
|
+
medium: "icon-btn-md",
|
|
7481
|
+
large: "icon-btn-lg"
|
|
7482
|
+
},
|
|
7483
|
+
none: {}
|
|
7484
|
+
};
|
|
7485
|
+
var ButtonUtil = {
|
|
7486
|
+
colors: buttonColorsList,
|
|
7487
|
+
colorClasses: {
|
|
7488
|
+
primary: "primary",
|
|
7489
|
+
secondary: "secondary",
|
|
7490
|
+
positive: "positive",
|
|
7491
|
+
warning: "warning",
|
|
7492
|
+
negative: "negative",
|
|
7493
|
+
neutral: "neutral",
|
|
7494
|
+
none: ""
|
|
7495
|
+
}
|
|
7496
|
+
};
|
|
7497
|
+
var Button = (0, import_react4.forwardRef)(function SolidButton({
|
|
7498
|
+
children,
|
|
7499
|
+
layout = "default",
|
|
7500
|
+
size = "medium",
|
|
7501
|
+
color = "primary",
|
|
7502
|
+
coloringStyle = "solid",
|
|
7503
|
+
startIcon,
|
|
7504
|
+
endIcon,
|
|
7505
|
+
disabled,
|
|
7506
|
+
className,
|
|
7507
|
+
...restProps
|
|
7508
|
+
}, ref) {
|
|
7509
|
+
const colorClasses = ButtonUtil.colorClasses[color];
|
|
7510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
7511
|
+
"button",
|
|
7512
|
+
{
|
|
7513
|
+
...restProps,
|
|
7514
|
+
ref,
|
|
7515
|
+
className: (0, import_clsx3.default)(
|
|
7516
|
+
"group font-semibold",
|
|
7517
|
+
{
|
|
7518
|
+
"disabled": disabled,
|
|
7519
|
+
[colorClasses]: !disabled,
|
|
7520
|
+
"coloring-solid-hover": coloringStyle === "solid",
|
|
7521
|
+
"coloring-text-hover": coloringStyle === "text",
|
|
7522
|
+
"coloring-outline-hover": coloringStyle === "outline",
|
|
7523
|
+
"coloring-tonal-hover": coloringStyle === "tonal"
|
|
7524
|
+
},
|
|
7525
|
+
paddingMapping[layout][size],
|
|
7526
|
+
className
|
|
7527
|
+
),
|
|
7528
|
+
disabled,
|
|
7529
|
+
children: [
|
|
7530
|
+
startIcon,
|
|
7531
|
+
children,
|
|
7532
|
+
endIcon
|
|
7533
|
+
]
|
|
7534
|
+
}
|
|
7535
|
+
);
|
|
7536
|
+
});
|
|
7537
|
+
|
|
7538
|
+
// src/components/date/DayPicker.tsx
|
|
7539
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
7515
7540
|
var DayPicker = ({
|
|
7516
7541
|
displayedMonth,
|
|
7517
7542
|
selected,
|
|
@@ -7525,27 +7550,26 @@ var DayPicker = ({
|
|
|
7525
7550
|
const { locale } = useLocale();
|
|
7526
7551
|
const month = displayedMonth.getMonth();
|
|
7527
7552
|
const weeks = getWeeksForCalenderMonth(displayedMonth, weekStart);
|
|
7528
|
-
return /* @__PURE__ */ (0,
|
|
7529
|
-
/* @__PURE__ */ (0,
|
|
7530
|
-
weeks.map((week, index) => /* @__PURE__ */ (0,
|
|
7553
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_clsx4.default)("flex-col-1 min-w-[220px] select-none", className), children: [
|
|
7554
|
+
/* @__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
|
+
weeks.map((week, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex-row-2 text-center", children: week.map((date) => {
|
|
7531
7556
|
const isSelected = !!selected && equalDate(selected, date);
|
|
7532
7557
|
const isToday = equalDate(/* @__PURE__ */ new Date(), date);
|
|
7533
7558
|
const isSameMonth = date.getMonth() === month;
|
|
7534
7559
|
const isDayValid = isInTimeSpan(date, start, end);
|
|
7535
|
-
return /* @__PURE__ */ (0,
|
|
7536
|
-
|
|
7560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
7561
|
+
Button,
|
|
7537
7562
|
{
|
|
7538
7563
|
disabled: !isDayValid,
|
|
7539
|
-
|
|
7564
|
+
color: isSelected ? "primary" : "neutral",
|
|
7565
|
+
coloringStyle: isSelected ? "solid" : "text",
|
|
7566
|
+
size: "small",
|
|
7567
|
+
className: (0, import_clsx4.default)(
|
|
7540
7568
|
"flex-1 rounded-full border-2",
|
|
7541
7569
|
{
|
|
7542
7570
|
"text-description": !isSameMonth && !isSelected && isDayValid,
|
|
7543
|
-
"
|
|
7544
|
-
"
|
|
7545
|
-
"hover:brightness-90 hover:bg-button-solid-primary-background hover:text-button-solid-primary-text": isDayValid,
|
|
7546
|
-
"text-disabled bg-disabled-background cursor-not-allowed": !isDayValid,
|
|
7547
|
-
"border-secondary": isToday && markToday,
|
|
7548
|
-
"border-transparent": !isToday || !markToday
|
|
7571
|
+
"border-on-background": isToday && markToday,
|
|
7572
|
+
"border-transparent": !(isToday && markToday)
|
|
7549
7573
|
}
|
|
7550
7574
|
),
|
|
7551
7575
|
onClick: () => onChange?.(date),
|
|
@@ -7562,13 +7586,13 @@ var DayPickerUncontrolled = ({
|
|
|
7562
7586
|
onChange,
|
|
7563
7587
|
...restProps
|
|
7564
7588
|
}) => {
|
|
7565
|
-
const [date, setDate] = (0,
|
|
7566
|
-
const [usedDisplayedMonth, setUsedDDisplayedMonth] = (0,
|
|
7567
|
-
(0,
|
|
7589
|
+
const [date, setDate] = (0, import_react5.useState)(selected);
|
|
7590
|
+
const [usedDisplayedMonth, setUsedDDisplayedMonth] = (0, import_react5.useState)(displayedMonth);
|
|
7591
|
+
(0, import_react5.useEffect)(() => {
|
|
7568
7592
|
setDate(selected);
|
|
7569
7593
|
setUsedDDisplayedMonth(selected);
|
|
7570
7594
|
}, [selected]);
|
|
7571
|
-
return /* @__PURE__ */ (0,
|
|
7595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
7572
7596
|
DayPicker,
|
|
7573
7597
|
{
|
|
7574
7598
|
displayedMonth: usedDisplayedMonth,
|
|
@@ -7585,20 +7609,19 @@ var DayPickerUncontrolled = ({
|
|
|
7585
7609
|
|
|
7586
7610
|
// src/components/date/YearMonthPicker.tsx
|
|
7587
7611
|
var import_react7 = require("react");
|
|
7588
|
-
var import_react_custom_scrollbars_2 = require("react-custom-scrollbars-2");
|
|
7589
7612
|
var import_clsx6 = __toESM(require("clsx"));
|
|
7590
7613
|
|
|
7591
7614
|
// src/components/layout/Expandable.tsx
|
|
7592
|
-
var
|
|
7615
|
+
var import_react6 = require("react");
|
|
7593
7616
|
var import_lucide_react = require("lucide-react");
|
|
7594
|
-
var
|
|
7595
|
-
var
|
|
7617
|
+
var import_clsx5 = __toESM(require("clsx"));
|
|
7618
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
7596
7619
|
var ExpansionIcon = ({ isExpanded, className }) => {
|
|
7597
|
-
return /* @__PURE__ */ (0,
|
|
7620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
7598
7621
|
import_lucide_react.ChevronDown,
|
|
7599
7622
|
{
|
|
7600
7623
|
"aria-hidden": true,
|
|
7601
|
-
className: (0,
|
|
7624
|
+
className: (0, import_clsx5.default)(
|
|
7602
7625
|
"min-w-6 w-6 min-h-6 h-6 transition-transform motion-safe:duration-200 motion-reduce:duration-0 ease-in-out",
|
|
7603
7626
|
{ "rotate-180": isExpanded },
|
|
7604
7627
|
className
|
|
@@ -7606,7 +7629,7 @@ var ExpansionIcon = ({ isExpanded, className }) => {
|
|
|
7606
7629
|
}
|
|
7607
7630
|
);
|
|
7608
7631
|
};
|
|
7609
|
-
var Expandable = (0,
|
|
7632
|
+
var Expandable = (0, import_react6.forwardRef)(function Expandable2({
|
|
7610
7633
|
children,
|
|
7611
7634
|
id: providedId,
|
|
7612
7635
|
label,
|
|
@@ -7620,27 +7643,27 @@ var Expandable = (0, import_react5.forwardRef)(function Expandable2({
|
|
|
7620
7643
|
contentClassName,
|
|
7621
7644
|
contentExpandedClassName
|
|
7622
7645
|
}, ref) {
|
|
7623
|
-
const defaultIcon = (0,
|
|
7646
|
+
const defaultIcon = (0, import_react6.useCallback)((expanded) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ExpansionIcon, { isExpanded: expanded }), []);
|
|
7624
7647
|
icon ??= defaultIcon;
|
|
7625
|
-
const generatedId = (0,
|
|
7648
|
+
const generatedId = (0, import_react6.useId)();
|
|
7626
7649
|
const id = providedId ?? generatedId;
|
|
7627
|
-
return /* @__PURE__ */ (0,
|
|
7650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
7628
7651
|
"div",
|
|
7629
7652
|
{
|
|
7630
7653
|
ref,
|
|
7631
7654
|
onClick: () => !clickOnlyOnHeader && !disabled && onChange?.(!isExpanded),
|
|
7632
|
-
className: (0,
|
|
7633
|
-
"flex-col-0
|
|
7655
|
+
className: (0, import_clsx5.default)(
|
|
7656
|
+
"flex-col-0 surface coloring-solid group rounded-lg shadow-sm",
|
|
7634
7657
|
{ "cursor-pointer": !clickOnlyOnHeader && !disabled },
|
|
7635
7658
|
className
|
|
7636
7659
|
),
|
|
7637
7660
|
children: [
|
|
7638
|
-
/* @__PURE__ */ (0,
|
|
7661
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
7639
7662
|
"button",
|
|
7640
7663
|
{
|
|
7641
7664
|
onClick: () => clickOnlyOnHeader && !disabled && onChange?.(!isExpanded),
|
|
7642
|
-
className: (0,
|
|
7643
|
-
"flex-row-2 py-2 px-4 rounded-lg justify-between items-center
|
|
7665
|
+
className: (0, import_clsx5.default)(
|
|
7666
|
+
"flex-row-2 py-2 px-4 rounded-lg justify-between items-center coloring-solid-hover select-none",
|
|
7644
7667
|
{
|
|
7645
7668
|
"group-hover:brightness-97": !isExpanded,
|
|
7646
7669
|
"hover:brightness-97": isExpanded && !disabled,
|
|
@@ -7657,14 +7680,14 @@ var Expandable = (0, import_react5.forwardRef)(function Expandable2({
|
|
|
7657
7680
|
]
|
|
7658
7681
|
}
|
|
7659
7682
|
),
|
|
7660
|
-
/* @__PURE__ */ (0,
|
|
7683
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
7661
7684
|
"div",
|
|
7662
7685
|
{
|
|
7663
7686
|
id: `${id}-content`,
|
|
7664
|
-
className: (0,
|
|
7687
|
+
className: (0, import_clsx5.default)(
|
|
7665
7688
|
"flex-col-2 px-4 transition-all duration-300 ease-in-out",
|
|
7666
7689
|
{
|
|
7667
|
-
[(0,
|
|
7690
|
+
[(0, import_clsx5.default)("max-h-96 opacity-100 pb-2 overflow-y-auto", contentExpandedClassName)]: isExpanded,
|
|
7668
7691
|
"max-h-0 opacity-0 overflow-hidden": !isExpanded
|
|
7669
7692
|
},
|
|
7670
7693
|
contentClassName
|
|
@@ -7677,13 +7700,13 @@ var Expandable = (0, import_react5.forwardRef)(function Expandable2({
|
|
|
7677
7700
|
}
|
|
7678
7701
|
);
|
|
7679
7702
|
});
|
|
7680
|
-
var ExpandableUncontrolled = (0,
|
|
7703
|
+
var ExpandableUncontrolled = (0, import_react6.forwardRef)(function ExpandableUncontrolled2({
|
|
7681
7704
|
isExpanded,
|
|
7682
7705
|
onChange,
|
|
7683
7706
|
...props
|
|
7684
7707
|
}, ref) {
|
|
7685
7708
|
const [usedIsExpanded, setUsedIsExpanded] = useOverwritableState(isExpanded, onChange);
|
|
7686
|
-
return /* @__PURE__ */ (0,
|
|
7709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
7687
7710
|
Expandable,
|
|
7688
7711
|
{
|
|
7689
7712
|
...props,
|
|
@@ -7694,265 +7717,6 @@ var ExpandableUncontrolled = (0, import_react5.forwardRef)(function ExpandableUn
|
|
|
7694
7717
|
);
|
|
7695
7718
|
});
|
|
7696
7719
|
|
|
7697
|
-
// src/components/user-action/Button.tsx
|
|
7698
|
-
var import_react6 = require("react");
|
|
7699
|
-
var import_clsx5 = __toESM(require("clsx"));
|
|
7700
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
7701
|
-
var ButtonColorUtil = {
|
|
7702
|
-
solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
|
|
7703
|
-
text: ["primary", "negative", "neutral"],
|
|
7704
|
-
outline: ["primary"]
|
|
7705
|
-
};
|
|
7706
|
-
var IconButtonUtil = {
|
|
7707
|
-
icon: [...ButtonColorUtil.solid, "transparent"]
|
|
7708
|
-
};
|
|
7709
|
-
var paddingMapping = {
|
|
7710
|
-
none: "",
|
|
7711
|
-
small: "btn-sm",
|
|
7712
|
-
medium: "btn-md",
|
|
7713
|
-
large: "btn-lg"
|
|
7714
|
-
};
|
|
7715
|
-
var iconPaddingMapping = {
|
|
7716
|
-
none: "",
|
|
7717
|
-
tiny: "icon-btn-xs",
|
|
7718
|
-
small: "icon-btn-sm",
|
|
7719
|
-
medium: "icon-btn-md",
|
|
7720
|
-
large: "icon-btn-lg"
|
|
7721
|
-
};
|
|
7722
|
-
var ButtonUtil = {
|
|
7723
|
-
paddingMapping,
|
|
7724
|
-
iconPaddingMapping
|
|
7725
|
-
};
|
|
7726
|
-
var SolidButton = (0, import_react6.forwardRef)(function SolidButton2({
|
|
7727
|
-
children,
|
|
7728
|
-
color = "primary",
|
|
7729
|
-
size = "medium",
|
|
7730
|
-
startIcon,
|
|
7731
|
-
endIcon,
|
|
7732
|
-
onClick,
|
|
7733
|
-
className,
|
|
7734
|
-
...restProps
|
|
7735
|
-
}, ref) {
|
|
7736
|
-
const colorClasses = {
|
|
7737
|
-
primary: "not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text",
|
|
7738
|
-
secondary: "not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text",
|
|
7739
|
-
tertiary: "not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text",
|
|
7740
|
-
positive: "not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text",
|
|
7741
|
-
warning: "not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text",
|
|
7742
|
-
negative: "not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text",
|
|
7743
|
-
neutral: "not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text"
|
|
7744
|
-
}[color];
|
|
7745
|
-
const iconColorClasses = {
|
|
7746
|
-
primary: "not-group-disabled:text-button-solid-primary-icon",
|
|
7747
|
-
secondary: "not-group-disabled:text-button-solid-secondary-icon",
|
|
7748
|
-
tertiary: "not-group-disabled:text-button-solid-tertiary-icon",
|
|
7749
|
-
positive: "not-group-disabled:text-button-solid-positive-icon",
|
|
7750
|
-
warning: "not-group-disabled:text-button-solid-warning-icon",
|
|
7751
|
-
negative: "not-group-disabled:text-button-solid-negative-icon",
|
|
7752
|
-
neutral: "not-group-disabled:text-button-solid-neutral-icon"
|
|
7753
|
-
}[color];
|
|
7754
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
7755
|
-
"button",
|
|
7756
|
-
{
|
|
7757
|
-
ref,
|
|
7758
|
-
onClick,
|
|
7759
|
-
className: (0, import_clsx5.default)(
|
|
7760
|
-
"group font-semibold",
|
|
7761
|
-
colorClasses,
|
|
7762
|
-
"not-disabled:hover:brightness-90",
|
|
7763
|
-
"disabled:text-disabled disabled:bg-disabled-background",
|
|
7764
|
-
ButtonUtil.paddingMapping[size],
|
|
7765
|
-
className
|
|
7766
|
-
),
|
|
7767
|
-
...restProps,
|
|
7768
|
-
children: [
|
|
7769
|
-
startIcon && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
7770
|
-
"span",
|
|
7771
|
-
{
|
|
7772
|
-
className: (0, import_clsx5.default)(
|
|
7773
|
-
iconColorClasses,
|
|
7774
|
-
"group-disabled:text-disabled-icon"
|
|
7775
|
-
),
|
|
7776
|
-
children: startIcon
|
|
7777
|
-
}
|
|
7778
|
-
),
|
|
7779
|
-
children,
|
|
7780
|
-
endIcon && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
7781
|
-
"span",
|
|
7782
|
-
{
|
|
7783
|
-
className: (0, import_clsx5.default)(
|
|
7784
|
-
iconColorClasses,
|
|
7785
|
-
"group-disabled:text-disabled-icon"
|
|
7786
|
-
),
|
|
7787
|
-
children: endIcon
|
|
7788
|
-
}
|
|
7789
|
-
)
|
|
7790
|
-
]
|
|
7791
|
-
}
|
|
7792
|
-
);
|
|
7793
|
-
});
|
|
7794
|
-
var OutlineButton = ({
|
|
7795
|
-
children,
|
|
7796
|
-
color = "primary",
|
|
7797
|
-
size = "medium",
|
|
7798
|
-
startIcon,
|
|
7799
|
-
endIcon,
|
|
7800
|
-
onClick,
|
|
7801
|
-
className,
|
|
7802
|
-
...restProps
|
|
7803
|
-
}) => {
|
|
7804
|
-
const colorClasses = {
|
|
7805
|
-
primary: "not-disabled:border-button-outline-primary-text not-disabled:text-button-outline-primary-text"
|
|
7806
|
-
}[color];
|
|
7807
|
-
const iconColorClasses = {
|
|
7808
|
-
primary: "not-group-disabled:text-button-outline-primary-icon"
|
|
7809
|
-
}[color];
|
|
7810
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
7811
|
-
"button",
|
|
7812
|
-
{
|
|
7813
|
-
onClick,
|
|
7814
|
-
className: (0, import_clsx5.default)(
|
|
7815
|
-
"group font-semibold bg-transparent border-2 ",
|
|
7816
|
-
"not-disabled:hover:brightness-80",
|
|
7817
|
-
colorClasses,
|
|
7818
|
-
"disabled:text-disabled disabled:border-disabled-outline",
|
|
7819
|
-
ButtonUtil.paddingMapping[size],
|
|
7820
|
-
className
|
|
7821
|
-
),
|
|
7822
|
-
...restProps,
|
|
7823
|
-
children: [
|
|
7824
|
-
startIcon && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
7825
|
-
"span",
|
|
7826
|
-
{
|
|
7827
|
-
className: (0, import_clsx5.default)(
|
|
7828
|
-
iconColorClasses,
|
|
7829
|
-
"group-disabled:text-disabled-icon"
|
|
7830
|
-
),
|
|
7831
|
-
children: startIcon
|
|
7832
|
-
}
|
|
7833
|
-
),
|
|
7834
|
-
children,
|
|
7835
|
-
endIcon && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
7836
|
-
"span",
|
|
7837
|
-
{
|
|
7838
|
-
className: (0, import_clsx5.default)(
|
|
7839
|
-
iconColorClasses,
|
|
7840
|
-
"group-disabled:text-disabled-icon"
|
|
7841
|
-
),
|
|
7842
|
-
children: endIcon
|
|
7843
|
-
}
|
|
7844
|
-
)
|
|
7845
|
-
]
|
|
7846
|
-
}
|
|
7847
|
-
);
|
|
7848
|
-
};
|
|
7849
|
-
var TextButton = ({
|
|
7850
|
-
children,
|
|
7851
|
-
color = "neutral",
|
|
7852
|
-
size = "medium",
|
|
7853
|
-
startIcon,
|
|
7854
|
-
endIcon,
|
|
7855
|
-
onClick,
|
|
7856
|
-
coloredHoverBackground = true,
|
|
7857
|
-
className,
|
|
7858
|
-
...restProps
|
|
7859
|
-
}) => {
|
|
7860
|
-
const colorClasses = {
|
|
7861
|
-
primary: "not-disabled:bg-transparent not-disabled:text-button-text-primary-text not-disabled:focus-visible:outline-button-text-primary-text",
|
|
7862
|
-
negative: "not-disabled:bg-transparent not-disabled:text-button-text-negative-text not-disabled:focus-visible:outline-button-text-negative-text",
|
|
7863
|
-
neutral: "not-disabled:bg-transparent not-disabled:text-button-text-neutral-text not-disabled:focus-visible:outline-button-text-neutral-text"
|
|
7864
|
-
}[color];
|
|
7865
|
-
const backgroundColor = {
|
|
7866
|
-
primary: "not-disabled:hover:bg-button-text-primary-text/20 not-disabled:focus-visible:bg-button-text-primary-text/20",
|
|
7867
|
-
negative: "not-disabled:hover:bg-button-text-negative-text/20 not-disabled:focus-visible:bg-button-text-negative-text/20",
|
|
7868
|
-
neutral: "not-disabled:hover:bg-button-text-neutral-text/20 not-disabled:focus-visible:bg-button-text-neutral-text/20"
|
|
7869
|
-
}[color];
|
|
7870
|
-
const iconColorClasses = {
|
|
7871
|
-
primary: "not-group-disabled:text-button-text-primary-icon",
|
|
7872
|
-
negative: "not-group-disabled:text-button-text-negative-icon",
|
|
7873
|
-
neutral: "not-group-disabled:text-button-text-neutral-icon"
|
|
7874
|
-
}[color];
|
|
7875
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
7876
|
-
"button",
|
|
7877
|
-
{
|
|
7878
|
-
onClick,
|
|
7879
|
-
className: (0, import_clsx5.default)(
|
|
7880
|
-
"group font-semibold",
|
|
7881
|
-
"disabled:text-disabled",
|
|
7882
|
-
colorClasses,
|
|
7883
|
-
{
|
|
7884
|
-
[backgroundColor]: coloredHoverBackground,
|
|
7885
|
-
"not-disabled:hover:bg-button-text-hover-background": !coloredHoverBackground
|
|
7886
|
-
},
|
|
7887
|
-
ButtonUtil.paddingMapping[size],
|
|
7888
|
-
className
|
|
7889
|
-
),
|
|
7890
|
-
...restProps,
|
|
7891
|
-
children: [
|
|
7892
|
-
startIcon && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
7893
|
-
"span",
|
|
7894
|
-
{
|
|
7895
|
-
className: (0, import_clsx5.default)(
|
|
7896
|
-
iconColorClasses,
|
|
7897
|
-
"group-disabled:text-disabled-icon"
|
|
7898
|
-
),
|
|
7899
|
-
children: startIcon
|
|
7900
|
-
}
|
|
7901
|
-
),
|
|
7902
|
-
children,
|
|
7903
|
-
endIcon && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
7904
|
-
"span",
|
|
7905
|
-
{
|
|
7906
|
-
className: (0, import_clsx5.default)(
|
|
7907
|
-
iconColorClasses,
|
|
7908
|
-
"group-disabled:text-disabled-icon"
|
|
7909
|
-
),
|
|
7910
|
-
children: endIcon
|
|
7911
|
-
}
|
|
7912
|
-
)
|
|
7913
|
-
]
|
|
7914
|
-
}
|
|
7915
|
-
);
|
|
7916
|
-
};
|
|
7917
|
-
var IconButton = (0, import_react6.forwardRef)(function IconButton2({
|
|
7918
|
-
children,
|
|
7919
|
-
color = "primary",
|
|
7920
|
-
size = "medium",
|
|
7921
|
-
className,
|
|
7922
|
-
...restProps
|
|
7923
|
-
}, ref) {
|
|
7924
|
-
const colorClasses = {
|
|
7925
|
-
primary: "not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text",
|
|
7926
|
-
secondary: "not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text",
|
|
7927
|
-
tertiary: "not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text",
|
|
7928
|
-
positive: "not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text",
|
|
7929
|
-
warning: "not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text",
|
|
7930
|
-
negative: "not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text",
|
|
7931
|
-
neutral: "not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text",
|
|
7932
|
-
transparent: "not-disabled:bg-transparent"
|
|
7933
|
-
}[color];
|
|
7934
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
7935
|
-
"button",
|
|
7936
|
-
{
|
|
7937
|
-
ref,
|
|
7938
|
-
className: (0, import_clsx5.default)(
|
|
7939
|
-
colorClasses,
|
|
7940
|
-
"not-disabled:hover:brightness-90",
|
|
7941
|
-
"disabled:text-disabled",
|
|
7942
|
-
{
|
|
7943
|
-
"disabled:bg-disabled-background": color !== "transparent",
|
|
7944
|
-
"disabled:opacity-70": color === "transparent",
|
|
7945
|
-
"not-disabled:hover:bg-button-text-hover-background": color === "transparent"
|
|
7946
|
-
},
|
|
7947
|
-
ButtonUtil.iconPaddingMapping[size],
|
|
7948
|
-
className
|
|
7949
|
-
),
|
|
7950
|
-
...restProps,
|
|
7951
|
-
children
|
|
7952
|
-
}
|
|
7953
|
-
);
|
|
7954
|
-
});
|
|
7955
|
-
|
|
7956
7720
|
// src/components/date/YearMonthPicker.tsx
|
|
7957
7721
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
7958
7722
|
var YearMonthPicker = ({
|
|
@@ -7961,7 +7725,6 @@ var YearMonthPicker = ({
|
|
|
7961
7725
|
end = addDuration(/* @__PURE__ */ new Date(), { years: 50 }),
|
|
7962
7726
|
onChange,
|
|
7963
7727
|
className = "",
|
|
7964
|
-
maxHeight = 300,
|
|
7965
7728
|
showValueOpen = true
|
|
7966
7729
|
}) => {
|
|
7967
7730
|
const { locale } = useLocale();
|
|
@@ -7982,7 +7745,7 @@ var YearMonthPicker = ({
|
|
|
7982
7745
|
return null;
|
|
7983
7746
|
}
|
|
7984
7747
|
const years = range([start.getFullYear(), end.getFullYear()], { exclusiveEnd: false });
|
|
7985
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: (0, import_clsx6.default)("flex-col-
|
|
7748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: (0, import_clsx6.default)("flex-col-1 select-none overflow-y-auto", className), children: years.map((year) => {
|
|
7986
7749
|
const selectedYear = displayedYearMonth.getFullYear() === year;
|
|
7987
7750
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
7988
7751
|
ExpandableUncontrolled,
|
|
@@ -8001,7 +7764,7 @@ var YearMonthPicker = ({
|
|
|
8001
7764
|
const isBeforeEnd = end === void 0 || firstOfMonth <= end;
|
|
8002
7765
|
const isValid = isAfterStart && isBeforeEnd;
|
|
8003
7766
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
8004
|
-
|
|
7767
|
+
Button,
|
|
8005
7768
|
{
|
|
8006
7769
|
disabled: !isValid,
|
|
8007
7770
|
color: selectedMonth && isValid ? "primary" : "neutral",
|
|
@@ -8018,7 +7781,7 @@ var YearMonthPicker = ({
|
|
|
8018
7781
|
},
|
|
8019
7782
|
year
|
|
8020
7783
|
);
|
|
8021
|
-
}) })
|
|
7784
|
+
}) });
|
|
8022
7785
|
};
|
|
8023
7786
|
var YearMonthPickerUncontrolled = ({
|
|
8024
7787
|
displayedYearMonth,
|
|
@@ -8036,37 +7799,6 @@ var YearMonthPickerUncontrolled = ({
|
|
|
8036
7799
|
);
|
|
8037
7800
|
};
|
|
8038
7801
|
|
|
8039
|
-
// src/i18n/useHightideTranslation.ts
|
|
8040
|
-
var import_internationalization2 = require("@helpwave/internationalization");
|
|
8041
|
-
function useICUTranslation(translations, locale) {
|
|
8042
|
-
translations = Array.isArray(translations) ? translations : [translations];
|
|
8043
|
-
return function translate(key, values) {
|
|
8044
|
-
try {
|
|
8045
|
-
for (let i = 0; i < translations.length; i++) {
|
|
8046
|
-
const localizedTranslation = translations[i][locale];
|
|
8047
|
-
if (!localizedTranslation) continue;
|
|
8048
|
-
const msg = localizedTranslation[key];
|
|
8049
|
-
if (typeof msg === "string") {
|
|
8050
|
-
return import_internationalization2.ICUUtil.interpret(msg, values);
|
|
8051
|
-
}
|
|
8052
|
-
}
|
|
8053
|
-
console.warn(`useTranslation: No translation for key "${key}" found.`);
|
|
8054
|
-
} catch (e) {
|
|
8055
|
-
console.error(`useTranslation: Error translating key "${String(key)}"`, e);
|
|
8056
|
-
}
|
|
8057
|
-
return `{{${String(locale)}:${String(key)}}}`;
|
|
8058
|
-
};
|
|
8059
|
-
}
|
|
8060
|
-
function useHightideTranslation(extensions, overwrites) {
|
|
8061
|
-
const { locale: inferredLocale } = useLocale();
|
|
8062
|
-
const locale = overwrites?.locale ?? inferredLocale;
|
|
8063
|
-
const translationExtensions = ArrayUtil.resolveSingleOrArray(extensions);
|
|
8064
|
-
return (0, import_internationalization2.combineTranslation)([
|
|
8065
|
-
...translationExtensions,
|
|
8066
|
-
hightideTranslation
|
|
8067
|
-
], locale);
|
|
8068
|
-
}
|
|
8069
|
-
|
|
8070
7802
|
// src/components/date/DatePicker.tsx
|
|
8071
7803
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
8072
7804
|
var DatePicker = ({
|
|
@@ -8080,17 +7812,18 @@ var DatePicker = ({
|
|
|
8080
7812
|
className = ""
|
|
8081
7813
|
}) => {
|
|
8082
7814
|
const { locale } = useLocale();
|
|
8083
|
-
const translation = useHightideTranslation();
|
|
8084
7815
|
const [displayedMonth, setDisplayedMonth] = (0, import_react8.useState)(value);
|
|
8085
7816
|
const [displayMode, setDisplayMode] = (0, import_react8.useState)(initialDisplay);
|
|
8086
7817
|
(0, import_react8.useEffect)(() => {
|
|
8087
7818
|
setDisplayedMonth(value);
|
|
8088
7819
|
}, [value]);
|
|
8089
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_clsx7.default)("flex-col-
|
|
8090
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex-row-2 items-center justify-between
|
|
7820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_clsx7.default)("flex-col-3", className), children: [
|
|
7821
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex-row-2 items-center justify-between", children: [
|
|
8091
7822
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
8092
|
-
|
|
7823
|
+
Button,
|
|
8093
7824
|
{
|
|
7825
|
+
size: "small",
|
|
7826
|
+
coloringStyle: "text",
|
|
8094
7827
|
className: (0, import_clsx7.default)("flex-row-1 items-center cursor-pointer select-none", {
|
|
8095
7828
|
"text-disabled": displayMode !== "day"
|
|
8096
7829
|
}),
|
|
@@ -8103,10 +7836,22 @@ var DatePicker = ({
|
|
|
8103
7836
|
),
|
|
8104
7837
|
displayMode === "day" && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex-row-2 justify-end", children: [
|
|
8105
7838
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
8106
|
-
|
|
7839
|
+
Button,
|
|
7840
|
+
{
|
|
7841
|
+
size: "small",
|
|
7842
|
+
coloringStyle: "tonal",
|
|
7843
|
+
onClick: () => {
|
|
7844
|
+
const newDate = /* @__PURE__ */ new Date();
|
|
7845
|
+
newDate.setHours(value.getHours(), value.getMinutes());
|
|
7846
|
+
onChange(newDate);
|
|
7847
|
+
},
|
|
7848
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Calendar, { className: "size-5" })
|
|
7849
|
+
}
|
|
7850
|
+
),
|
|
7851
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
7852
|
+
Button,
|
|
8107
7853
|
{
|
|
8108
7854
|
size: "small",
|
|
8109
|
-
color: "primary",
|
|
8110
7855
|
disabled: !isInTimeSpan(subtractDuration(displayedMonth, { months: 1 }), start, end),
|
|
8111
7856
|
onClick: () => {
|
|
8112
7857
|
setDisplayedMonth(subtractDuration(displayedMonth, { months: 1 }));
|
|
@@ -8115,10 +7860,9 @@ var DatePicker = ({
|
|
|
8115
7860
|
}
|
|
8116
7861
|
),
|
|
8117
7862
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
8118
|
-
|
|
7863
|
+
Button,
|
|
8119
7864
|
{
|
|
8120
7865
|
size: "small",
|
|
8121
|
-
color: "primary",
|
|
8122
7866
|
disabled: !isInTimeSpan(addDuration(displayedMonth, { months: 1 }), start, end),
|
|
8123
7867
|
onClick: () => {
|
|
8124
7868
|
setDisplayedMonth(addDuration(displayedMonth, { months: 1 }));
|
|
@@ -8140,33 +7884,19 @@ var DatePicker = ({
|
|
|
8140
7884
|
setDisplayMode("day");
|
|
8141
7885
|
}
|
|
8142
7886
|
}
|
|
8143
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime8.
|
|
8144
|
-
|
|
8145
|
-
|
|
8146
|
-
|
|
8147
|
-
|
|
8148
|
-
|
|
8149
|
-
|
|
8150
|
-
|
|
8151
|
-
|
|
8152
|
-
onChange
|
|
8153
|
-
onChange?.(date);
|
|
8154
|
-
}
|
|
8155
|
-
}
|
|
8156
|
-
),
|
|
8157
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
8158
|
-
TextButton,
|
|
8159
|
-
{
|
|
8160
|
-
color: "primary",
|
|
8161
|
-
onClick: () => {
|
|
8162
|
-
const newDate = /* @__PURE__ */ new Date();
|
|
8163
|
-
newDate.setHours(value.getHours(), value.getMinutes());
|
|
8164
|
-
onChange(newDate);
|
|
8165
|
-
},
|
|
8166
|
-
children: translation("time.today")
|
|
7887
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
7888
|
+
DayPicker,
|
|
7889
|
+
{
|
|
7890
|
+
...dayPickerProps,
|
|
7891
|
+
displayedMonth,
|
|
7892
|
+
start,
|
|
7893
|
+
end,
|
|
7894
|
+
selected: value,
|
|
7895
|
+
onChange: (date) => {
|
|
7896
|
+
onChange?.(date);
|
|
8167
7897
|
}
|
|
8168
|
-
|
|
8169
|
-
|
|
7898
|
+
}
|
|
7899
|
+
)
|
|
8170
7900
|
] });
|
|
8171
7901
|
};
|
|
8172
7902
|
var DatePickerUncontrolled = ({
|
|
@@ -8185,6 +7915,37 @@ var DatePickerUncontrolled = ({
|
|
|
8185
7915
|
);
|
|
8186
7916
|
};
|
|
8187
7917
|
|
|
7918
|
+
// src/i18n/useHightideTranslation.ts
|
|
7919
|
+
var import_internationalization2 = require("@helpwave/internationalization");
|
|
7920
|
+
function useICUTranslation(translations, locale) {
|
|
7921
|
+
translations = Array.isArray(translations) ? translations : [translations];
|
|
7922
|
+
return function translate(key, values) {
|
|
7923
|
+
try {
|
|
7924
|
+
for (let i = 0; i < translations.length; i++) {
|
|
7925
|
+
const localizedTranslation = translations[i][locale];
|
|
7926
|
+
if (!localizedTranslation) continue;
|
|
7927
|
+
const msg = localizedTranslation[key];
|
|
7928
|
+
if (typeof msg === "string") {
|
|
7929
|
+
return import_internationalization2.ICUUtil.interpret(msg, values);
|
|
7930
|
+
}
|
|
7931
|
+
}
|
|
7932
|
+
console.warn(`useTranslation: No translation for key "${key}" found.`);
|
|
7933
|
+
} catch (e) {
|
|
7934
|
+
console.error(`useTranslation: Error translating key "${String(key)}"`, e);
|
|
7935
|
+
}
|
|
7936
|
+
return `{{${String(locale)}:${String(key)}}}`;
|
|
7937
|
+
};
|
|
7938
|
+
}
|
|
7939
|
+
function useHightideTranslation(extensions, overwrites) {
|
|
7940
|
+
const { locale: inferredLocale } = useLocale();
|
|
7941
|
+
const locale = overwrites?.locale ?? inferredLocale;
|
|
7942
|
+
const translationExtensions = ArrayUtil.resolveSingleOrArray(extensions);
|
|
7943
|
+
return (0, import_internationalization2.combineTranslation)([
|
|
7944
|
+
...translationExtensions,
|
|
7945
|
+
hightideTranslation
|
|
7946
|
+
], locale);
|
|
7947
|
+
}
|
|
7948
|
+
|
|
8188
7949
|
// src/components/date/TimeDisplay.tsx
|
|
8189
7950
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
8190
7951
|
var TimeDisplay = ({
|
|
@@ -8228,7 +7989,6 @@ var TimeDisplay = ({
|
|
|
8228
7989
|
|
|
8229
7990
|
// src/components/date/TimePicker.tsx
|
|
8230
7991
|
var import_react9 = require("react");
|
|
8231
|
-
var import_react_custom_scrollbars_22 = require("react-custom-scrollbars-2");
|
|
8232
7992
|
var import_clsx8 = __toESM(require("clsx"));
|
|
8233
7993
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
8234
7994
|
var TimePicker = ({
|
|
@@ -8236,13 +7996,13 @@ var TimePicker = ({
|
|
|
8236
7996
|
onChange,
|
|
8237
7997
|
is24HourFormat = true,
|
|
8238
7998
|
minuteIncrement = "5min",
|
|
8239
|
-
maxHeight =
|
|
7999
|
+
maxHeight = 280,
|
|
8240
8000
|
className = ""
|
|
8241
8001
|
}) => {
|
|
8242
8002
|
const minuteRef = (0, import_react9.useRef)(null);
|
|
8243
8003
|
const hourRef = (0, import_react9.useRef)(null);
|
|
8244
8004
|
const isPM = time.getHours() >= 11;
|
|
8245
|
-
const hours = is24HourFormat ? range(24) : range(
|
|
8005
|
+
const hours = is24HourFormat ? range(24) : range(12);
|
|
8246
8006
|
let minutes = range(60);
|
|
8247
8007
|
(0, import_react9.useEffect)(() => {
|
|
8248
8008
|
const scrollToItem = () => {
|
|
@@ -8289,55 +8049,55 @@ var TimePicker = ({
|
|
|
8289
8049
|
break;
|
|
8290
8050
|
}
|
|
8291
8051
|
const closestMinute = closestMatch(minutes, (item1, item2) => Math.abs(item1 - time.getMinutes()) < Math.abs(item2 - time.getMinutes()));
|
|
8292
|
-
const style = (selected) => (0, import_clsx8.default)(
|
|
8293
|
-
"chip-full hover:brightness-90 hover:bg-primary hover:text-on-primary rounded-md mr-3",
|
|
8294
|
-
{ "bg-primary text-on-primary": selected, "bg-white text-black": !selected }
|
|
8295
|
-
);
|
|
8296
8052
|
const onChangeWrapper = (transformer) => {
|
|
8297
8053
|
const newDate = new Date(time);
|
|
8298
8054
|
transformer(newDate);
|
|
8299
8055
|
onChange?.(newDate);
|
|
8300
8056
|
};
|
|
8301
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: (0, import_clsx8.default)("flex-row-2 w-fit min-w-[150px] select-none", className), children: [
|
|
8302
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
8303
|
-
const
|
|
8057
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: (0, import_clsx8.default)("flex-row-2 w-fit min-w-[150px] select-none overflow-hidden", className), children: [
|
|
8058
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex-col-1 h-full overflow-y-auto min-w-16", children: hours.map((hour) => {
|
|
8059
|
+
const isSelected = hour === time.getHours() - (!is24HourFormat && isPM ? 12 : 0);
|
|
8304
8060
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
8305
|
-
|
|
8061
|
+
Button,
|
|
8306
8062
|
{
|
|
8307
|
-
|
|
8308
|
-
|
|
8063
|
+
size: "small",
|
|
8064
|
+
color: isSelected ? "primary" : "neutral",
|
|
8065
|
+
ref: isSelected ? hourRef : void 0,
|
|
8309
8066
|
onClick: () => onChangeWrapper((newDate) => newDate.setHours(hour + (!is24HourFormat && isPM ? 12 : 0))),
|
|
8310
8067
|
children: hour.toString().padStart(2, "0")
|
|
8311
8068
|
},
|
|
8312
8069
|
hour
|
|
8313
8070
|
);
|
|
8314
|
-
}) })
|
|
8315
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
8316
|
-
const
|
|
8071
|
+
}) }),
|
|
8072
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex-col-1 h-full overflow-y-auto min-w-16", children: minutes.map((minute) => {
|
|
8073
|
+
const isSelected = minute === closestMinute;
|
|
8317
8074
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
8318
|
-
|
|
8075
|
+
Button,
|
|
8319
8076
|
{
|
|
8320
|
-
|
|
8321
|
-
|
|
8077
|
+
size: "small",
|
|
8078
|
+
color: isSelected ? "primary" : "neutral",
|
|
8079
|
+
ref: isSelected ? minuteRef : void 0,
|
|
8322
8080
|
onClick: () => onChangeWrapper((newDate) => newDate.setMinutes(minute)),
|
|
8323
8081
|
children: minute.toString().padStart(2, "0")
|
|
8324
8082
|
},
|
|
8325
8083
|
minute + minuteIncrement
|
|
8326
8084
|
);
|
|
8327
|
-
}) })
|
|
8328
|
-
!is24HourFormat && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex-col-1", children: [
|
|
8085
|
+
}) }),
|
|
8086
|
+
!is24HourFormat && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex-col-1 min-w-16", children: [
|
|
8329
8087
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
8330
|
-
|
|
8088
|
+
Button,
|
|
8331
8089
|
{
|
|
8332
|
-
|
|
8090
|
+
size: "small",
|
|
8091
|
+
color: !isPM ? "primary" : "neutral",
|
|
8333
8092
|
onClick: () => onChangeWrapper((newDate) => isPM && newDate.setHours(newDate.getHours() - 12)),
|
|
8334
8093
|
children: "AM"
|
|
8335
8094
|
}
|
|
8336
8095
|
),
|
|
8337
8096
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
8338
|
-
|
|
8097
|
+
Button,
|
|
8339
8098
|
{
|
|
8340
|
-
|
|
8099
|
+
size: "small",
|
|
8100
|
+
color: isPM ? "primary" : "neutral",
|
|
8341
8101
|
onClick: () => onChangeWrapper((newDate) => !isPM && newDate.setHours(newDate.getHours() + 12)),
|
|
8342
8102
|
children: "PM"
|
|
8343
8103
|
}
|
|
@@ -8365,8 +8125,8 @@ var TimePickerUncontrolled = ({
|
|
|
8365
8125
|
var import_clsx10 = __toESM(require("clsx"));
|
|
8366
8126
|
|
|
8367
8127
|
// src/components/dialog/Dialog.tsx
|
|
8368
|
-
var import_react13 = require("react");
|
|
8369
8128
|
var import_react14 = require("react");
|
|
8129
|
+
var import_react15 = require("react");
|
|
8370
8130
|
var import_clsx9 = __toESM(require("clsx"));
|
|
8371
8131
|
var import_lucide_react3 = require("lucide-react");
|
|
8372
8132
|
|
|
@@ -8603,6 +8363,57 @@ var useLogOnce = (message, condition, options) => {
|
|
|
8603
8363
|
|
|
8604
8364
|
// src/components/dialog/Dialog.tsx
|
|
8605
8365
|
var import_react_dom = require("react-dom");
|
|
8366
|
+
|
|
8367
|
+
// src/hooks/useZIndexRegister.ts
|
|
8368
|
+
var import_react13 = require("react");
|
|
8369
|
+
var ZIndexRegistry = class _ZIndexRegistry {
|
|
8370
|
+
constructor() {
|
|
8371
|
+
this.listeners = /* @__PURE__ */ new Set();
|
|
8372
|
+
}
|
|
8373
|
+
static {
|
|
8374
|
+
this.instance = null;
|
|
8375
|
+
}
|
|
8376
|
+
static getInstance() {
|
|
8377
|
+
if (!_ZIndexRegistry.instance) {
|
|
8378
|
+
_ZIndexRegistry.instance = new _ZIndexRegistry();
|
|
8379
|
+
}
|
|
8380
|
+
return _ZIndexRegistry.instance;
|
|
8381
|
+
}
|
|
8382
|
+
register(callback) {
|
|
8383
|
+
this.listeners.add(callback);
|
|
8384
|
+
this.notify();
|
|
8385
|
+
}
|
|
8386
|
+
deregister(callback) {
|
|
8387
|
+
this.listeners.delete(callback);
|
|
8388
|
+
this.notify();
|
|
8389
|
+
}
|
|
8390
|
+
notify() {
|
|
8391
|
+
let i = 100;
|
|
8392
|
+
for (const callback of this.listeners) {
|
|
8393
|
+
callback(i++);
|
|
8394
|
+
}
|
|
8395
|
+
}
|
|
8396
|
+
};
|
|
8397
|
+
function useZIndexRegister(isActive) {
|
|
8398
|
+
const [zIndex, setZIndex] = (0, import_react13.useState)(0);
|
|
8399
|
+
const zIndexRegistry = (0, import_react13.useMemo)(() => ZIndexRegistry.getInstance(), []);
|
|
8400
|
+
(0, import_react13.useEffect)(() => {
|
|
8401
|
+
if (!isActive) {
|
|
8402
|
+
return;
|
|
8403
|
+
}
|
|
8404
|
+
function callback(zIndex2) {
|
|
8405
|
+
setZIndex(zIndex2);
|
|
8406
|
+
}
|
|
8407
|
+
zIndexRegistry.register(callback);
|
|
8408
|
+
return () => {
|
|
8409
|
+
zIndexRegistry.deregister(callback);
|
|
8410
|
+
setZIndex(0);
|
|
8411
|
+
};
|
|
8412
|
+
}, [isActive, zIndexRegistry]);
|
|
8413
|
+
return zIndex;
|
|
8414
|
+
}
|
|
8415
|
+
|
|
8416
|
+
// src/components/dialog/Dialog.tsx
|
|
8606
8417
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
8607
8418
|
var Dialog = ({
|
|
8608
8419
|
children,
|
|
@@ -8618,11 +8429,11 @@ var Dialog = ({
|
|
|
8618
8429
|
...props
|
|
8619
8430
|
}) => {
|
|
8620
8431
|
const translation = useHightideTranslation();
|
|
8621
|
-
const [visible, setVisible] = (0,
|
|
8622
|
-
const generatedId = (0,
|
|
8432
|
+
const [visible, setVisible] = (0, import_react15.useState)(isOpen);
|
|
8433
|
+
const generatedId = (0, import_react14.useId)();
|
|
8623
8434
|
const id = props.id ?? generatedId;
|
|
8624
|
-
const ref = (0,
|
|
8625
|
-
(0,
|
|
8435
|
+
const ref = (0, import_react15.useRef)(null);
|
|
8436
|
+
(0, import_react15.useEffect)(() => {
|
|
8626
8437
|
if (isOpen) {
|
|
8627
8438
|
setVisible(true);
|
|
8628
8439
|
} else {
|
|
@@ -8641,6 +8452,7 @@ var Dialog = ({
|
|
|
8641
8452
|
active: visible,
|
|
8642
8453
|
focusFirst: true
|
|
8643
8454
|
});
|
|
8455
|
+
const zIndex = useZIndexRegister(isOpen);
|
|
8644
8456
|
const positionMap = {
|
|
8645
8457
|
top: "fixed top-8 left-1/2 -translate-x-1/2",
|
|
8646
8458
|
center: "fixed left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2",
|
|
@@ -8649,83 +8461,92 @@ var Dialog = ({
|
|
|
8649
8461
|
const positionStyle = positionMap[position];
|
|
8650
8462
|
if (!visible) return;
|
|
8651
8463
|
return (0, import_react_dom.createPortal)(
|
|
8652
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
8653
|
-
|
|
8654
|
-
|
|
8655
|
-
{
|
|
8656
|
-
|
|
8657
|
-
|
|
8658
|
-
|
|
8659
|
-
|
|
8464
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
8465
|
+
"div",
|
|
8466
|
+
{
|
|
8467
|
+
id: `dialog-container-${id}`,
|
|
8468
|
+
className: (0, import_clsx9.default)("fixed inset-0 h-screen w-screen", containerClassName),
|
|
8469
|
+
style: { zIndex },
|
|
8470
|
+
children: [
|
|
8471
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
8472
|
+
"div",
|
|
8660
8473
|
{
|
|
8661
|
-
|
|
8662
|
-
|
|
8663
|
-
|
|
8664
|
-
|
|
8665
|
-
|
|
8666
|
-
|
|
8667
|
-
|
|
8668
|
-
|
|
8669
|
-
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
|
|
8674
|
-
|
|
8675
|
-
|
|
8676
|
-
|
|
8677
|
-
|
|
8678
|
-
...props,
|
|
8679
|
-
id: `dialog-${id}`,
|
|
8680
|
-
ref,
|
|
8681
|
-
hidden: !visible,
|
|
8682
|
-
onKeyDown: (event) => {
|
|
8683
|
-
if (event.key === "Escape") {
|
|
8684
|
-
onCloseWrapper();
|
|
8685
|
-
}
|
|
8686
|
-
},
|
|
8687
|
-
onAnimationEnd: () => {
|
|
8688
|
-
if (!isOpen) {
|
|
8689
|
-
setVisible(false);
|
|
8474
|
+
id: `dialog-background-${id}`,
|
|
8475
|
+
hidden: !visible,
|
|
8476
|
+
className: (0, import_clsx9.default)(
|
|
8477
|
+
"fixed inset-0 h-screen w-screen bg-overlay-shadow",
|
|
8478
|
+
{
|
|
8479
|
+
"motion-safe:animate-fade-in": isOpen,
|
|
8480
|
+
"motion-safe:animate-fade-out": !isOpen
|
|
8481
|
+
},
|
|
8482
|
+
backgroundClassName
|
|
8483
|
+
),
|
|
8484
|
+
onAnimationEnd: () => {
|
|
8485
|
+
if (!isOpen) {
|
|
8486
|
+
setVisible(false);
|
|
8487
|
+
}
|
|
8488
|
+
},
|
|
8489
|
+
onClick: onCloseWrapper,
|
|
8490
|
+
"aria-hidden": true
|
|
8690
8491
|
}
|
|
8691
|
-
},
|
|
8692
|
-
className: (0, import_clsx9.default)(
|
|
8693
|
-
"flex-col-2 p-4 bg-overlay-background text-overlay-text rounded-xl shadow-hw-bottom max-w-[calc(100vw_-_2rem)] max-h-[calc(100vh_-_2rem)]",
|
|
8694
|
-
{
|
|
8695
|
-
"motion-safe:animate-pop-in": isOpen,
|
|
8696
|
-
"motion-safe:animate-pop-out": !isOpen
|
|
8697
|
-
},
|
|
8698
|
-
positionStyle,
|
|
8699
|
-
props.className
|
|
8700
8492
|
),
|
|
8701
|
-
|
|
8702
|
-
|
|
8703
|
-
|
|
8704
|
-
|
|
8705
|
-
|
|
8706
|
-
|
|
8707
|
-
|
|
8708
|
-
|
|
8709
|
-
|
|
8710
|
-
|
|
8493
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
8494
|
+
"div",
|
|
8495
|
+
{
|
|
8496
|
+
...props,
|
|
8497
|
+
id: `dialog-${id}`,
|
|
8498
|
+
ref,
|
|
8499
|
+
hidden: !visible,
|
|
8500
|
+
onKeyDown: (event) => {
|
|
8501
|
+
if (event.key === "Escape") {
|
|
8502
|
+
onCloseWrapper();
|
|
8503
|
+
}
|
|
8504
|
+
},
|
|
8505
|
+
onAnimationEnd: () => {
|
|
8506
|
+
if (!isOpen) {
|
|
8507
|
+
setVisible(false);
|
|
8508
|
+
}
|
|
8509
|
+
},
|
|
8510
|
+
className: (0, import_clsx9.default)(
|
|
8511
|
+
"flex-col-2 p-4 bg-overlay-background text-overlay-text rounded-xl shadow-hw-bottom max-w-[calc(100vw_-_2rem)] max-h-[calc(100vh_-_2rem)]",
|
|
8512
|
+
{
|
|
8513
|
+
"motion-safe:animate-pop-in": isOpen,
|
|
8514
|
+
"motion-safe:animate-pop-out": !isOpen
|
|
8711
8515
|
},
|
|
8712
|
-
|
|
8713
|
-
|
|
8516
|
+
positionStyle,
|
|
8517
|
+
props.className
|
|
8518
|
+
),
|
|
8519
|
+
children: [
|
|
8520
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "typography-title-lg mr-8", children: titleElement }),
|
|
8521
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "text-description", children: description }),
|
|
8522
|
+
isModal && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
8523
|
+
"div",
|
|
8714
8524
|
{
|
|
8715
|
-
|
|
8716
|
-
|
|
8717
|
-
|
|
8718
|
-
|
|
8719
|
-
|
|
8525
|
+
className: "absolute top-0 right-0",
|
|
8526
|
+
style: {
|
|
8527
|
+
paddingTop: "inherit",
|
|
8528
|
+
paddingRight: "inherit"
|
|
8529
|
+
},
|
|
8530
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
8531
|
+
Button,
|
|
8532
|
+
{
|
|
8533
|
+
layout: "icon",
|
|
8534
|
+
color: "neutral",
|
|
8535
|
+
size: "tiny",
|
|
8536
|
+
"aria-label": translation("close"),
|
|
8537
|
+
onClick: onCloseWrapper,
|
|
8538
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react3.X, {})
|
|
8539
|
+
}
|
|
8540
|
+
)
|
|
8720
8541
|
}
|
|
8721
|
-
)
|
|
8722
|
-
|
|
8723
|
-
|
|
8724
|
-
|
|
8725
|
-
|
|
8726
|
-
|
|
8727
|
-
|
|
8728
|
-
|
|
8542
|
+
),
|
|
8543
|
+
children
|
|
8544
|
+
]
|
|
8545
|
+
}
|
|
8546
|
+
)
|
|
8547
|
+
]
|
|
8548
|
+
}
|
|
8549
|
+
),
|
|
8729
8550
|
document.body
|
|
8730
8551
|
);
|
|
8731
8552
|
};
|
|
@@ -8753,7 +8574,7 @@ var ConfirmDialog = ({
|
|
|
8753
8574
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex-col-2 grow", children }),
|
|
8754
8575
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex-row-4 mt-3 justify-end", children: [
|
|
8755
8576
|
onCancel && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
8756
|
-
|
|
8577
|
+
Button,
|
|
8757
8578
|
{
|
|
8758
8579
|
color: buttonOverwrites?.[0].color ?? "neutral",
|
|
8759
8580
|
onClick: onCancel,
|
|
@@ -8762,7 +8583,7 @@ var ConfirmDialog = ({
|
|
|
8762
8583
|
}
|
|
8763
8584
|
),
|
|
8764
8585
|
onDecline && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
8765
|
-
|
|
8586
|
+
Button,
|
|
8766
8587
|
{
|
|
8767
8588
|
color: buttonOverwrites?.[1].color ?? "negative",
|
|
8768
8589
|
onClick: onDecline,
|
|
@@ -8771,7 +8592,7 @@ var ConfirmDialog = ({
|
|
|
8771
8592
|
}
|
|
8772
8593
|
),
|
|
8773
8594
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
8774
|
-
|
|
8595
|
+
Button,
|
|
8775
8596
|
{
|
|
8776
8597
|
color: buttonOverwrites?.[2].color ?? mapping[confirmType],
|
|
8777
8598
|
onClick: onConfirm,
|
|
@@ -8811,17 +8632,17 @@ var DiscardChangesDialog = ({
|
|
|
8811
8632
|
};
|
|
8812
8633
|
|
|
8813
8634
|
// src/components/user-action/input/Input.tsx
|
|
8814
|
-
var
|
|
8635
|
+
var import_react18 = require("react");
|
|
8815
8636
|
var import_clsx11 = __toESM(require("clsx"));
|
|
8816
8637
|
|
|
8817
8638
|
// src/hooks/useDelay.ts
|
|
8818
|
-
var
|
|
8639
|
+
var import_react16 = require("react");
|
|
8819
8640
|
var defaultOptions2 = {
|
|
8820
8641
|
delay: 3e3,
|
|
8821
8642
|
disabled: false
|
|
8822
8643
|
};
|
|
8823
8644
|
function useDelay(options) {
|
|
8824
|
-
const [timer, setTimer] = (0,
|
|
8645
|
+
const [timer, setTimer] = (0, import_react16.useState)(void 0);
|
|
8825
8646
|
const { delay, disabled } = {
|
|
8826
8647
|
...defaultOptions2,
|
|
8827
8648
|
...options
|
|
@@ -8840,12 +8661,12 @@ function useDelay(options) {
|
|
|
8840
8661
|
setTimer(void 0);
|
|
8841
8662
|
}, delay));
|
|
8842
8663
|
};
|
|
8843
|
-
(0,
|
|
8664
|
+
(0, import_react16.useEffect)(() => {
|
|
8844
8665
|
return () => {
|
|
8845
8666
|
clearTimeout(timer);
|
|
8846
8667
|
};
|
|
8847
8668
|
}, [timer]);
|
|
8848
|
-
(0,
|
|
8669
|
+
(0, import_react16.useEffect)(() => {
|
|
8849
8670
|
if (disabled) {
|
|
8850
8671
|
clearTimeout(timer);
|
|
8851
8672
|
setTimer(void 0);
|
|
@@ -8855,9 +8676,9 @@ function useDelay(options) {
|
|
|
8855
8676
|
}
|
|
8856
8677
|
|
|
8857
8678
|
// src/hooks/focus/useFocusManagement.ts
|
|
8858
|
-
var
|
|
8679
|
+
var import_react17 = require("react");
|
|
8859
8680
|
function useFocusManagement() {
|
|
8860
|
-
const getFocusableElements = (0,
|
|
8681
|
+
const getFocusableElements = (0, import_react17.useCallback)(() => {
|
|
8861
8682
|
return Array.from(
|
|
8862
8683
|
document.querySelectorAll(
|
|
8863
8684
|
'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
|
|
@@ -8866,7 +8687,7 @@ function useFocusManagement() {
|
|
|
8866
8687
|
(el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
|
|
8867
8688
|
);
|
|
8868
8689
|
}, []);
|
|
8869
|
-
const getNextFocusElement = (0,
|
|
8690
|
+
const getNextFocusElement = (0, import_react17.useCallback)(() => {
|
|
8870
8691
|
const elements = getFocusableElements();
|
|
8871
8692
|
if (elements.length === 0) {
|
|
8872
8693
|
return void 0;
|
|
@@ -8878,11 +8699,11 @@ function useFocusManagement() {
|
|
|
8878
8699
|
}
|
|
8879
8700
|
return nextElement;
|
|
8880
8701
|
}, [getFocusableElements]);
|
|
8881
|
-
const focusNext = (0,
|
|
8702
|
+
const focusNext = (0, import_react17.useCallback)(() => {
|
|
8882
8703
|
const nextElement = getNextFocusElement();
|
|
8883
8704
|
nextElement?.focus();
|
|
8884
8705
|
}, [getNextFocusElement]);
|
|
8885
|
-
const getPreviousFocusElement = (0,
|
|
8706
|
+
const getPreviousFocusElement = (0, import_react17.useCallback)(() => {
|
|
8886
8707
|
const elements = getFocusableElements();
|
|
8887
8708
|
if (elements.length === 0) {
|
|
8888
8709
|
return void 0;
|
|
@@ -8898,7 +8719,7 @@ function useFocusManagement() {
|
|
|
8898
8719
|
}
|
|
8899
8720
|
return previousElement;
|
|
8900
8721
|
}, [getFocusableElements]);
|
|
8901
|
-
const focusPrevious = (0,
|
|
8722
|
+
const focusPrevious = (0, import_react17.useCallback)(() => {
|
|
8902
8723
|
const previousElement = getPreviousFocusElement();
|
|
8903
8724
|
if (previousElement) previousElement.focus();
|
|
8904
8725
|
}, [getPreviousFocusElement]);
|
|
@@ -8919,7 +8740,7 @@ var defaultEditCompleteOptions = {
|
|
|
8919
8740
|
afterDelay: true,
|
|
8920
8741
|
delay: 2500
|
|
8921
8742
|
};
|
|
8922
|
-
var Input = (0,
|
|
8743
|
+
var Input = (0, import_react18.forwardRef)(function Input2({
|
|
8923
8744
|
value,
|
|
8924
8745
|
onChange,
|
|
8925
8746
|
onChangeText,
|
|
@@ -8941,8 +8762,8 @@ var Input = (0, import_react17.forwardRef)(function Input2({
|
|
|
8941
8762
|
restartTimer,
|
|
8942
8763
|
clearTimer
|
|
8943
8764
|
} = useDelay({ delay, disabled: !afterDelay });
|
|
8944
|
-
const innerRef = (0,
|
|
8945
|
-
(0,
|
|
8765
|
+
const innerRef = (0, import_react18.useRef)(null);
|
|
8766
|
+
(0, import_react18.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
8946
8767
|
const { focusNext } = useFocusManagement();
|
|
8947
8768
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
8948
8769
|
"input",
|
|
@@ -9026,8 +8847,8 @@ var InputDialog = ({
|
|
|
9026
8847
|
);
|
|
9027
8848
|
};
|
|
9028
8849
|
|
|
9029
|
-
// src/components/user-action/
|
|
9030
|
-
var
|
|
8850
|
+
// src/components/user-action/Select.tsx
|
|
8851
|
+
var import_react20 = require("react");
|
|
9031
8852
|
var import_clsx13 = __toESM(require("clsx"));
|
|
9032
8853
|
|
|
9033
8854
|
// src/utils/match.ts
|
|
@@ -9035,61 +8856,37 @@ var match = (key, values) => {
|
|
|
9035
8856
|
return values[key];
|
|
9036
8857
|
};
|
|
9037
8858
|
|
|
9038
|
-
// src/components/user-action/
|
|
8859
|
+
// src/components/user-action/Select.tsx
|
|
9039
8860
|
var import_lucide_react4 = require("lucide-react");
|
|
9040
8861
|
|
|
9041
8862
|
// src/components/layout/Chip.tsx
|
|
9042
8863
|
var import_clsx12 = __toESM(require("clsx"));
|
|
9043
8864
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
9044
|
-
var chipColors =
|
|
8865
|
+
var chipColors = ButtonUtil.colors;
|
|
9045
8866
|
var ChipUtil = {
|
|
9046
8867
|
colors: chipColors
|
|
9047
8868
|
};
|
|
9048
8869
|
var Chip = ({
|
|
9049
8870
|
children,
|
|
9050
8871
|
trailingIcon,
|
|
9051
|
-
color = "
|
|
9052
|
-
size = "
|
|
9053
|
-
icon = false,
|
|
8872
|
+
color = "neutral",
|
|
8873
|
+
size = "medium",
|
|
9054
8874
|
variant = "normal",
|
|
9055
8875
|
className = "",
|
|
9056
8876
|
...restProps
|
|
9057
8877
|
}) => {
|
|
9058
|
-
const colorMapping =
|
|
9059
|
-
default: "text-tag-default-text bg-tag-default-background",
|
|
9060
|
-
dark: "text-tag-dark-text bg-tag-dark-background",
|
|
9061
|
-
red: "text-tag-red-text bg-tag-red-background",
|
|
9062
|
-
yellow: "text-tag-yellow-text bg-tag-yellow-background",
|
|
9063
|
-
green: "text-tag-green-text bg-tag-green-background",
|
|
9064
|
-
blue: "text-tag-blue-text bg-tag-blue-background",
|
|
9065
|
-
pink: "text-tag-pink-text bg-tag-pink-background",
|
|
9066
|
-
orange: "text-tag-orange-text bg-tag-orange-background"
|
|
9067
|
-
}[color];
|
|
9068
|
-
const colorMappingIcon = {
|
|
9069
|
-
default: "text-tag-default-icon",
|
|
9070
|
-
dark: "text-tag-dark-icon",
|
|
9071
|
-
red: "text-tag-red-icon",
|
|
9072
|
-
yellow: "text-tag-yellow-icon",
|
|
9073
|
-
green: "text-tag-green-icon",
|
|
9074
|
-
blue: "text-tag-blue-icon",
|
|
9075
|
-
pink: "text-tag-pink-icon",
|
|
9076
|
-
orange: "text-tag-orange-icon"
|
|
9077
|
-
}[color];
|
|
8878
|
+
const colorMapping = ButtonUtil.colorClasses[color];
|
|
9078
8879
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
9079
8880
|
"div",
|
|
9080
8881
|
{
|
|
9081
8882
|
...restProps,
|
|
9082
8883
|
className: (0, import_clsx12.default)(
|
|
9083
|
-
`flex-row-0 w-fit font-semibold`,
|
|
8884
|
+
`flex-row-0 w-fit font-semibold coloring-solid`,
|
|
9084
8885
|
colorMapping,
|
|
9085
|
-
|
|
9086
|
-
"
|
|
9087
|
-
"
|
|
9088
|
-
"
|
|
9089
|
-
} : {
|
|
9090
|
-
"p-0.5": size === "sm",
|
|
9091
|
-
"p-1": size === "md",
|
|
9092
|
-
"p-2": size === "lg"
|
|
8886
|
+
{
|
|
8887
|
+
"chip-sm": size === "small",
|
|
8888
|
+
"chip-md": size === "medium",
|
|
8889
|
+
"chip-lg": size === "large"
|
|
9093
8890
|
},
|
|
9094
8891
|
{
|
|
9095
8892
|
"rounded-md": variant === "normal",
|
|
@@ -9099,7 +8896,7 @@ var Chip = ({
|
|
|
9099
8896
|
),
|
|
9100
8897
|
children: [
|
|
9101
8898
|
children,
|
|
9102
|
-
trailingIcon
|
|
8899
|
+
trailingIcon
|
|
9103
8900
|
]
|
|
9104
8901
|
}
|
|
9105
8902
|
);
|
|
@@ -9112,8 +8909,8 @@ var ChipList = ({
|
|
|
9112
8909
|
Chip,
|
|
9113
8910
|
{
|
|
9114
8911
|
...value,
|
|
9115
|
-
color: value.color
|
|
9116
|
-
variant: value.variant
|
|
8912
|
+
color: value.color,
|
|
8913
|
+
variant: value.variant,
|
|
9117
8914
|
children: value.children
|
|
9118
8915
|
},
|
|
9119
8916
|
index
|
|
@@ -9121,7 +8918,7 @@ var ChipList = ({
|
|
|
9121
8918
|
};
|
|
9122
8919
|
|
|
9123
8920
|
// src/hooks/useFloatingElement.ts
|
|
9124
|
-
var
|
|
8921
|
+
var import_react19 = require("react");
|
|
9125
8922
|
|
|
9126
8923
|
// src/utils/math.ts
|
|
9127
8924
|
var clamp = (value, range2 = [0, 1]) => {
|
|
@@ -9184,9 +8981,9 @@ function useFloatingElement({
|
|
|
9184
8981
|
screenPadding = 16,
|
|
9185
8982
|
gap = 4
|
|
9186
8983
|
}) {
|
|
9187
|
-
const [style, setStyle] = (0,
|
|
8984
|
+
const [style, setStyle] = (0, import_react19.useState)();
|
|
9188
8985
|
const isMounted = useIsMounted();
|
|
9189
|
-
const calculate = (0,
|
|
8986
|
+
const calculate = (0, import_react19.useCallback)(() => {
|
|
9190
8987
|
const containerRect = containerRef.current.getBoundingClientRect();
|
|
9191
8988
|
const windowRect = windowRef?.current.getBoundingClientRect() ?? {
|
|
9192
8989
|
top: 0,
|
|
@@ -9216,14 +9013,14 @@ function useFloatingElement({
|
|
|
9216
9013
|
}, [anchorRef, containerRef, gap, horizontalAlignment, screenPadding, verticalAlignment, windowRef]);
|
|
9217
9014
|
const height = containerRef.current?.getBoundingClientRect().height;
|
|
9218
9015
|
const width = containerRef.current?.getBoundingClientRect().width;
|
|
9219
|
-
(0,
|
|
9016
|
+
(0, import_react19.useEffect)(() => {
|
|
9220
9017
|
if (active && isMounted) {
|
|
9221
9018
|
calculate();
|
|
9222
9019
|
} else {
|
|
9223
9020
|
setStyle(void 0);
|
|
9224
9021
|
}
|
|
9225
9022
|
}, [calculate, active, isMounted, height, width]);
|
|
9226
|
-
(0,
|
|
9023
|
+
(0, import_react19.useEffect)(() => {
|
|
9227
9024
|
window.addEventListener("resize", calculate);
|
|
9228
9025
|
let timeout;
|
|
9229
9026
|
if (isPolling) {
|
|
@@ -9239,15 +9036,15 @@ function useFloatingElement({
|
|
|
9239
9036
|
return style;
|
|
9240
9037
|
}
|
|
9241
9038
|
|
|
9242
|
-
// src/components/user-action/
|
|
9039
|
+
// src/components/user-action/Select.tsx
|
|
9243
9040
|
var import_react_dom2 = require("react-dom");
|
|
9244
9041
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
9245
9042
|
var defaultToggleOpenOptions = {
|
|
9246
9043
|
highlightStartPositionBehavior: "first"
|
|
9247
9044
|
};
|
|
9248
|
-
var SelectContext = (0,
|
|
9045
|
+
var SelectContext = (0, import_react20.createContext)(null);
|
|
9249
9046
|
function useSelectContext() {
|
|
9250
|
-
const ctx = (0,
|
|
9047
|
+
const ctx = (0, import_react20.useContext)(SelectContext);
|
|
9251
9048
|
if (!ctx) {
|
|
9252
9049
|
throw new Error("SelectContext must be used within a ListBoxPrimitive");
|
|
9253
9050
|
}
|
|
@@ -9266,18 +9063,18 @@ var SelectRoot = ({
|
|
|
9266
9063
|
isMultiSelect = false,
|
|
9267
9064
|
iconAppearance = "left"
|
|
9268
9065
|
}) => {
|
|
9269
|
-
const triggerRef = (0,
|
|
9270
|
-
const generatedId = (0,
|
|
9066
|
+
const triggerRef = (0, import_react20.useRef)(null);
|
|
9067
|
+
const generatedId = (0, import_react20.useId)();
|
|
9271
9068
|
const usedId = id ?? generatedId;
|
|
9272
|
-
const [internalState, setInternalState] = (0,
|
|
9069
|
+
const [internalState, setInternalState] = (0, import_react20.useState)({
|
|
9273
9070
|
isOpen,
|
|
9274
9071
|
options: []
|
|
9275
9072
|
});
|
|
9276
|
-
const selectedValues = (0,
|
|
9073
|
+
const selectedValues = (0, import_react20.useMemo)(
|
|
9277
9074
|
() => isMultiSelect ? values ?? [] : [value].filter(Boolean),
|
|
9278
9075
|
[isMultiSelect, value, values]
|
|
9279
9076
|
);
|
|
9280
|
-
const selectedOptions = (0,
|
|
9077
|
+
const selectedOptions = (0, import_react20.useMemo)(
|
|
9281
9078
|
() => selectedValues.map((value2) => internalState.options.find((option) => value2 === option.value)).filter(Boolean),
|
|
9282
9079
|
[selectedValues, internalState.options]
|
|
9283
9080
|
);
|
|
@@ -9293,7 +9090,7 @@ var SelectRoot = ({
|
|
|
9293
9090
|
isMultiSelect,
|
|
9294
9091
|
iconAppearance
|
|
9295
9092
|
};
|
|
9296
|
-
const registerItem = (0,
|
|
9093
|
+
const registerItem = (0, import_react20.useCallback)((item) => {
|
|
9297
9094
|
setInternalState((prev) => {
|
|
9298
9095
|
const updatedOptions = [...prev.options, item];
|
|
9299
9096
|
updatedOptions.sort((a, b) => {
|
|
@@ -9308,7 +9105,7 @@ var SelectRoot = ({
|
|
|
9308
9105
|
};
|
|
9309
9106
|
});
|
|
9310
9107
|
}, []);
|
|
9311
|
-
const unregisterItem = (0,
|
|
9108
|
+
const unregisterItem = (0, import_react20.useCallback)((value2) => {
|
|
9312
9109
|
setInternalState((prev) => {
|
|
9313
9110
|
const updatedOptions = prev.options.filter((i) => i.value !== value2);
|
|
9314
9111
|
return {
|
|
@@ -9357,10 +9154,10 @@ var SelectRoot = ({
|
|
|
9357
9154
|
highlightedValue: value2
|
|
9358
9155
|
}));
|
|
9359
9156
|
};
|
|
9360
|
-
const registerTrigger = (0,
|
|
9157
|
+
const registerTrigger = (0, import_react20.useCallback)((ref) => {
|
|
9361
9158
|
triggerRef.current = ref.current;
|
|
9362
9159
|
}, []);
|
|
9363
|
-
const unregisterTrigger = (0,
|
|
9160
|
+
const unregisterTrigger = (0, import_react20.useCallback)(() => {
|
|
9364
9161
|
triggerRef.current = null;
|
|
9365
9162
|
}, []);
|
|
9366
9163
|
const toggleOpen = (isOpen2, toggleOpenOptions) => {
|
|
@@ -9406,7 +9203,7 @@ var SelectRoot = ({
|
|
|
9406
9203
|
highlightedValue
|
|
9407
9204
|
}));
|
|
9408
9205
|
};
|
|
9409
|
-
(0,
|
|
9206
|
+
(0, import_react20.useEffect)(() => {
|
|
9410
9207
|
if (!internalState.highlightedValue) return;
|
|
9411
9208
|
const highlighted = internalState.options.find((value2) => value2.value === internalState.highlightedValue);
|
|
9412
9209
|
if (highlighted) {
|
|
@@ -9434,14 +9231,14 @@ var SelectRoot = ({
|
|
|
9434
9231
|
};
|
|
9435
9232
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectContext.Provider, { value: contextValue, children });
|
|
9436
9233
|
};
|
|
9437
|
-
var SelectOption = (0,
|
|
9234
|
+
var SelectOption = (0, import_react20.forwardRef)(
|
|
9438
9235
|
function SelectOption2({ children, value, disabled = false, iconAppearance, className, ...restProps }, ref) {
|
|
9439
9236
|
const { state, config, item, trigger } = useSelectContext();
|
|
9440
9237
|
const { register, unregister, toggleSelection, highlightItem } = item;
|
|
9441
|
-
const itemRef = (0,
|
|
9238
|
+
const itemRef = (0, import_react20.useRef)(null);
|
|
9442
9239
|
iconAppearance ??= config.iconAppearance;
|
|
9443
9240
|
const label = children ?? value;
|
|
9444
|
-
(0,
|
|
9241
|
+
(0, import_react20.useEffect)(() => {
|
|
9445
9242
|
register({
|
|
9446
9243
|
value,
|
|
9447
9244
|
label,
|
|
@@ -9491,7 +9288,7 @@ var SelectOption = (0, import_react19.forwardRef)(
|
|
|
9491
9288
|
}
|
|
9492
9289
|
},
|
|
9493
9290
|
children: [
|
|
9494
|
-
iconAppearance === "left" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
9291
|
+
iconAppearance === "left" && (state.value.length > 0 || config.isMultiSelect) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
9495
9292
|
import_lucide_react4.CheckIcon,
|
|
9496
9293
|
{
|
|
9497
9294
|
className: (0, import_clsx13.default)("w-4 h-4", { "opacity-0": !isSelected || disabled }),
|
|
@@ -9499,7 +9296,7 @@ var SelectOption = (0, import_react19.forwardRef)(
|
|
|
9499
9296
|
}
|
|
9500
9297
|
),
|
|
9501
9298
|
label,
|
|
9502
|
-
iconAppearance === "right" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
9299
|
+
iconAppearance === "right" && (state.value.length > 0 || config.isMultiSelect) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
9503
9300
|
import_lucide_react4.CheckIcon,
|
|
9504
9301
|
{
|
|
9505
9302
|
className: (0, import_clsx13.default)("w-4 h-4", { "opacity-0": !isSelected || disabled }),
|
|
@@ -9511,13 +9308,13 @@ var SelectOption = (0, import_react19.forwardRef)(
|
|
|
9511
9308
|
);
|
|
9512
9309
|
}
|
|
9513
9310
|
);
|
|
9514
|
-
var SelectButton = (0,
|
|
9311
|
+
var SelectButton = (0, import_react20.forwardRef)(function SelectButton2({ placeholder, selectedDisplay, ...props }, ref) {
|
|
9515
9312
|
const translation = useHightideTranslation();
|
|
9516
9313
|
const { state, trigger } = useSelectContext();
|
|
9517
9314
|
const { register, unregister, toggleOpen } = trigger;
|
|
9518
|
-
const innerRef = (0,
|
|
9519
|
-
(0,
|
|
9520
|
-
(0,
|
|
9315
|
+
const innerRef = (0, import_react20.useRef)(null);
|
|
9316
|
+
(0, import_react20.useImperativeHandle)(ref, () => innerRef.current);
|
|
9317
|
+
(0, import_react20.useEffect)(() => {
|
|
9521
9318
|
register(innerRef);
|
|
9522
9319
|
return () => unregister();
|
|
9523
9320
|
}, [register, unregister]);
|
|
@@ -9590,12 +9387,12 @@ var SelectButton = (0, import_react19.forwardRef)(function SelectButton2({ place
|
|
|
9590
9387
|
}
|
|
9591
9388
|
);
|
|
9592
9389
|
});
|
|
9593
|
-
var SelectChipDisplay = (0,
|
|
9390
|
+
var SelectChipDisplay = (0, import_react20.forwardRef)(function SelectChipDisplay2({ ...props }, ref) {
|
|
9594
9391
|
const { state, trigger, item } = useSelectContext();
|
|
9595
9392
|
const { register, unregister, toggleOpen } = trigger;
|
|
9596
|
-
const innerRef = (0,
|
|
9597
|
-
(0,
|
|
9598
|
-
(0,
|
|
9393
|
+
const innerRef = (0, import_react20.useRef)(null);
|
|
9394
|
+
(0, import_react20.useImperativeHandle)(ref, () => innerRef.current);
|
|
9395
|
+
(0, import_react20.useEffect)(() => {
|
|
9599
9396
|
register(innerRef);
|
|
9600
9397
|
return () => unregister();
|
|
9601
9398
|
}, [register, unregister]);
|
|
@@ -9618,20 +9415,21 @@ var SelectChipDisplay = (0, import_react19.forwardRef)(function SelectChipDispla
|
|
|
9618
9415
|
state.selectedOptions.map(({ value, label }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Chip, { className: "gap-x-2", children: [
|
|
9619
9416
|
label,
|
|
9620
9417
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
9621
|
-
|
|
9418
|
+
Button,
|
|
9622
9419
|
{
|
|
9623
9420
|
onClick: () => {
|
|
9624
9421
|
item.toggleSelection(value, false);
|
|
9625
9422
|
},
|
|
9626
9423
|
size: "none",
|
|
9627
9424
|
color: "negative",
|
|
9425
|
+
coloringStyle: "text",
|
|
9628
9426
|
className: "flex-row-0 items-center px-0.5 py-0.5 w-6 h-6 rounded",
|
|
9629
9427
|
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react4.XIcon, { className: "w-5 h-5" })
|
|
9630
9428
|
}
|
|
9631
9429
|
)
|
|
9632
9430
|
] }, value)),
|
|
9633
9431
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
9634
|
-
|
|
9432
|
+
Button,
|
|
9635
9433
|
{
|
|
9636
9434
|
id: state.id,
|
|
9637
9435
|
onClick: () => toggleOpen(),
|
|
@@ -9644,6 +9442,7 @@ var SelectChipDisplay = (0, import_react19.forwardRef)(function SelectChipDispla
|
|
|
9644
9442
|
toggleOpen(true, { highlightStartPositionBehavior: "last" });
|
|
9645
9443
|
}
|
|
9646
9444
|
},
|
|
9445
|
+
layout: "icon",
|
|
9647
9446
|
size: "small",
|
|
9648
9447
|
color: "neutral",
|
|
9649
9448
|
"aria-invalid": invalid,
|
|
@@ -9658,15 +9457,15 @@ var SelectChipDisplay = (0, import_react19.forwardRef)(function SelectChipDispla
|
|
|
9658
9457
|
}
|
|
9659
9458
|
);
|
|
9660
9459
|
});
|
|
9661
|
-
var SelectContent = (0,
|
|
9460
|
+
var SelectContent = (0, import_react20.forwardRef)(
|
|
9662
9461
|
function SelectContent2({
|
|
9663
9462
|
alignment,
|
|
9664
9463
|
orientation = "vertical",
|
|
9665
9464
|
containerClassName,
|
|
9666
9465
|
...props
|
|
9667
9466
|
}, ref) {
|
|
9668
|
-
const innerRef = (0,
|
|
9669
|
-
(0,
|
|
9467
|
+
const innerRef = (0, import_react20.useRef)(null);
|
|
9468
|
+
(0, import_react20.useImperativeHandle)(ref, () => innerRef.current);
|
|
9670
9469
|
const { trigger, state, config, item } = useSelectContext();
|
|
9671
9470
|
const position = useFloatingElement({
|
|
9672
9471
|
active: state.isOpen,
|
|
@@ -9678,12 +9477,14 @@ var SelectContent = (0, import_react19.forwardRef)(
|
|
|
9678
9477
|
container: innerRef,
|
|
9679
9478
|
active: state.isOpen && !!position
|
|
9680
9479
|
});
|
|
9480
|
+
const zIndex = useZIndexRegister(state.isOpen);
|
|
9681
9481
|
return (0, import_react_dom2.createPortal)(
|
|
9682
9482
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
9683
9483
|
"div",
|
|
9684
9484
|
{
|
|
9685
9485
|
id: `select-container-${state.id}`,
|
|
9686
9486
|
className: (0, import_clsx13.default)("fixed inset-0 w-screen h-screen", containerClassName),
|
|
9487
|
+
style: { zIndex },
|
|
9687
9488
|
hidden: !state.isOpen,
|
|
9688
9489
|
children: [
|
|
9689
9490
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
@@ -9760,7 +9561,7 @@ var SelectContent = (0, import_react19.forwardRef)(
|
|
|
9760
9561
|
);
|
|
9761
9562
|
}
|
|
9762
9563
|
);
|
|
9763
|
-
var Select = (0,
|
|
9564
|
+
var Select = (0, import_react20.forwardRef)(function Select2({
|
|
9764
9565
|
children,
|
|
9765
9566
|
contentPanelProps,
|
|
9766
9567
|
buttonProps,
|
|
@@ -9782,7 +9583,7 @@ var Select = (0, import_react19.forwardRef)(function Select2({
|
|
|
9782
9583
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectContent, { ...contentPanelProps, children })
|
|
9783
9584
|
] });
|
|
9784
9585
|
});
|
|
9785
|
-
var SelectUncontrolled = (0,
|
|
9586
|
+
var SelectUncontrolled = (0, import_react20.forwardRef)(function SelectUncontrolled2({
|
|
9786
9587
|
value: initialValue,
|
|
9787
9588
|
onValueChanged,
|
|
9788
9589
|
...props
|
|
@@ -9798,7 +9599,7 @@ var SelectUncontrolled = (0, import_react19.forwardRef)(function SelectUncontrol
|
|
|
9798
9599
|
}
|
|
9799
9600
|
);
|
|
9800
9601
|
});
|
|
9801
|
-
var MultiSelect = (0,
|
|
9602
|
+
var MultiSelect = (0, import_react20.forwardRef)(function MultiSelect2({
|
|
9802
9603
|
children,
|
|
9803
9604
|
contentPanelProps,
|
|
9804
9605
|
buttonProps,
|
|
@@ -9809,7 +9610,7 @@ var MultiSelect = (0, import_react19.forwardRef)(function MultiSelect2({
|
|
|
9809
9610
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectContent, { ...contentPanelProps, children })
|
|
9810
9611
|
] });
|
|
9811
9612
|
});
|
|
9812
|
-
var MultiSelectUncontrolled = (0,
|
|
9613
|
+
var MultiSelectUncontrolled = (0, import_react20.forwardRef)(function MultiSelectUncontrolled2({
|
|
9813
9614
|
values: initialValues,
|
|
9814
9615
|
onValuesChanged,
|
|
9815
9616
|
...props
|
|
@@ -9825,7 +9626,7 @@ var MultiSelectUncontrolled = (0, import_react19.forwardRef)(function MultiSelec
|
|
|
9825
9626
|
}
|
|
9826
9627
|
);
|
|
9827
9628
|
});
|
|
9828
|
-
var MultiSelectChipDisplay = (0,
|
|
9629
|
+
var MultiSelectChipDisplay = (0, import_react20.forwardRef)(function MultiSelectChipDisplay2({
|
|
9829
9630
|
children,
|
|
9830
9631
|
contentPanelProps,
|
|
9831
9632
|
chipDisplayProps,
|
|
@@ -9836,7 +9637,7 @@ var MultiSelectChipDisplay = (0, import_react19.forwardRef)(function MultiSelect
|
|
|
9836
9637
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectContent, { ...contentPanelProps, children })
|
|
9837
9638
|
] });
|
|
9838
9639
|
});
|
|
9839
|
-
var MultiSelectChipDisplayUncontrolled = (0,
|
|
9640
|
+
var MultiSelectChipDisplayUncontrolled = (0, import_react20.forwardRef)(function MultiSelectChipDisplayUncontrolled2({
|
|
9840
9641
|
values: initialValues,
|
|
9841
9642
|
onValuesChanged,
|
|
9842
9643
|
...props
|
|
@@ -9876,14 +9677,13 @@ var LanguageDialog = ({
|
|
|
9876
9677
|
{
|
|
9877
9678
|
value: locale,
|
|
9878
9679
|
onValueChanged: (language) => setLocale(language),
|
|
9879
|
-
contentPanelProps: { containerClassName: "z-200" },
|
|
9880
9680
|
buttonProps: {
|
|
9881
9681
|
selectedDisplay: (locale2) => LocalizationUtil.languagesLocalNames[locale2]
|
|
9882
9682
|
},
|
|
9883
9683
|
children: LocalizationUtil.locals.map((local) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SelectOption, { value: local, children: LocalizationUtil.languagesLocalNames[local] }, local))
|
|
9884
9684
|
}
|
|
9885
9685
|
),
|
|
9886
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex-row-4 mt-3 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
9686
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex-row-4 mt-3 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { color: "positive", onClick: onClose, children: translation("done") }) })
|
|
9887
9687
|
] })
|
|
9888
9688
|
}
|
|
9889
9689
|
);
|
|
@@ -9894,21 +9694,21 @@ var import_lucide_react5 = require("lucide-react");
|
|
|
9894
9694
|
var import_clsx14 = __toESM(require("clsx"));
|
|
9895
9695
|
|
|
9896
9696
|
// src/theming/useTheme.tsx
|
|
9897
|
-
var
|
|
9697
|
+
var import_react21 = require("react");
|
|
9898
9698
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
9899
9699
|
var themes = ["light", "dark", "system"];
|
|
9900
9700
|
var ThemeUtil = {
|
|
9901
9701
|
themes
|
|
9902
9702
|
};
|
|
9903
|
-
var ThemeContext = (0,
|
|
9703
|
+
var ThemeContext = (0, import_react21.createContext)(null);
|
|
9904
9704
|
var ThemeProvider = ({ children, theme }) => {
|
|
9905
9705
|
const {
|
|
9906
9706
|
value: storedTheme,
|
|
9907
9707
|
setValue: setStoredTheme,
|
|
9908
9708
|
deleteValue: deleteStoredTheme
|
|
9909
9709
|
} = useLocalStorage("theme", "system");
|
|
9910
|
-
const [themePreference, setThemePreference] = (0,
|
|
9911
|
-
const resolvedTheme = (0,
|
|
9710
|
+
const [themePreference, setThemePreference] = (0, import_react21.useState)("system");
|
|
9711
|
+
const resolvedTheme = (0, import_react21.useMemo)(() => {
|
|
9912
9712
|
if (theme && theme !== "system") {
|
|
9913
9713
|
return theme;
|
|
9914
9714
|
}
|
|
@@ -9920,7 +9720,7 @@ var ThemeProvider = ({ children, theme }) => {
|
|
|
9920
9720
|
}
|
|
9921
9721
|
return "light";
|
|
9922
9722
|
}, [storedTheme, theme, themePreference]);
|
|
9923
|
-
(0,
|
|
9723
|
+
(0, import_react21.useEffect)(() => {
|
|
9924
9724
|
if (!theme) return;
|
|
9925
9725
|
if (theme === "system") {
|
|
9926
9726
|
deleteStoredTheme();
|
|
@@ -9928,18 +9728,18 @@ var ThemeProvider = ({ children, theme }) => {
|
|
|
9928
9728
|
setStoredTheme(theme);
|
|
9929
9729
|
}
|
|
9930
9730
|
}, [theme]);
|
|
9931
|
-
(0,
|
|
9731
|
+
(0, import_react21.useEffect)(() => {
|
|
9932
9732
|
document.documentElement.setAttribute("data-theme", resolvedTheme);
|
|
9933
9733
|
}, [resolvedTheme]);
|
|
9934
|
-
const getPreference = (0,
|
|
9734
|
+
const getPreference = (0, import_react21.useCallback)(() => {
|
|
9935
9735
|
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
9936
9736
|
const prefersLight = window.matchMedia("(prefers-color-scheme: light)").matches;
|
|
9937
9737
|
setThemePreference(prefersDark ? "dark" : prefersLight ? "light" : "system");
|
|
9938
9738
|
}, []);
|
|
9939
|
-
(0,
|
|
9739
|
+
(0, import_react21.useEffect)(() => {
|
|
9940
9740
|
getPreference();
|
|
9941
9741
|
}, [getPreference]);
|
|
9942
|
-
(0,
|
|
9742
|
+
(0, import_react21.useEffect)(() => {
|
|
9943
9743
|
const darkQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
9944
9744
|
const lightQuery = window.matchMedia("(prefers-color-scheme: light)");
|
|
9945
9745
|
const noPrefQuery = window.matchMedia("(prefers-color-scheme: no-preference)");
|
|
@@ -9970,7 +9770,7 @@ var ThemeProvider = ({ children, theme }) => {
|
|
|
9970
9770
|
);
|
|
9971
9771
|
};
|
|
9972
9772
|
var useTheme = () => {
|
|
9973
|
-
const context = (0,
|
|
9773
|
+
const context = (0, import_react21.useContext)(ThemeContext);
|
|
9974
9774
|
if (!context) {
|
|
9975
9775
|
throw new Error("useTheme must be used within ThemeContext. Try adding a ThemeProvider around your app.");
|
|
9976
9776
|
}
|
|
@@ -10010,9 +9810,6 @@ var ThemeDialog = ({
|
|
|
10010
9810
|
value: theme,
|
|
10011
9811
|
onValueChanged: (theme2) => setTheme(theme2),
|
|
10012
9812
|
iconAppearance: "right",
|
|
10013
|
-
contentPanelProps: {
|
|
10014
|
-
containerClassName: "z-200"
|
|
10015
|
-
},
|
|
10016
9813
|
buttonProps: {
|
|
10017
9814
|
selectedDisplay: (value) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex-row-2 items-center", children: [
|
|
10018
9815
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ThemeIcon, { theme }),
|
|
@@ -10026,14 +9823,14 @@ var ThemeDialog = ({
|
|
|
10026
9823
|
] }) }, theme2))
|
|
10027
9824
|
}
|
|
10028
9825
|
),
|
|
10029
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex-row-4 mt-3 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
9826
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex-row-4 mt-3 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Button, { autoFocus: true, color: "positive", onClick: onClose, children: translation("done") }) })
|
|
10030
9827
|
] })
|
|
10031
9828
|
}
|
|
10032
9829
|
);
|
|
10033
9830
|
};
|
|
10034
9831
|
|
|
10035
9832
|
// src/components/form/FormElementWrapper.tsx
|
|
10036
|
-
var
|
|
9833
|
+
var import_react22 = require("react");
|
|
10037
9834
|
var import_clsx16 = require("clsx");
|
|
10038
9835
|
|
|
10039
9836
|
// src/components/user-action/Label.tsx
|
|
@@ -10071,7 +9868,7 @@ var FormElementWrapper = ({
|
|
|
10071
9868
|
containerClassName
|
|
10072
9869
|
}) => {
|
|
10073
9870
|
const [touched, setTouched] = useOverwritableState(initialIsShowingError, onIsShowingError);
|
|
10074
|
-
const generatedId = (0,
|
|
9871
|
+
const generatedId = (0, import_react22.useId)();
|
|
10075
9872
|
const usedId = id ?? generatedId;
|
|
10076
9873
|
const errorId = `${usedId}-description`;
|
|
10077
9874
|
const labelId = `${usedId}-label`;
|
|
@@ -10142,7 +9939,7 @@ var FormElementWrapper = ({
|
|
|
10142
9939
|
|
|
10143
9940
|
// src/components/icons-and-geometry/Avatar.tsx
|
|
10144
9941
|
var import_clsx17 = __toESM(require("clsx"));
|
|
10145
|
-
var
|
|
9942
|
+
var import_react23 = require("react");
|
|
10146
9943
|
var import_lucide_react6 = require("lucide-react");
|
|
10147
9944
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
10148
9945
|
var avtarSizeList = ["sm", "md", "lg", "xl"];
|
|
@@ -10169,8 +9966,8 @@ var Avatar = ({
|
|
|
10169
9966
|
fullyRounded,
|
|
10170
9967
|
className = ""
|
|
10171
9968
|
}) => {
|
|
10172
|
-
const [hasError, setHasError] = (0,
|
|
10173
|
-
const [isLoaded, setIsLoaded] = (0,
|
|
9969
|
+
const [hasError, setHasError] = (0, import_react23.useState)(false);
|
|
9970
|
+
const [isLoaded, setIsLoaded] = (0, import_react23.useState)(false);
|
|
10174
9971
|
const pixels = avatarSizeMapping[size];
|
|
10175
9972
|
const sizeStyle = {
|
|
10176
9973
|
minWidth: pixels,
|
|
@@ -10179,7 +9976,7 @@ var Avatar = ({
|
|
|
10179
9976
|
maxHeight: pixels
|
|
10180
9977
|
};
|
|
10181
9978
|
const textClassName = textClassNameMapping[size];
|
|
10182
|
-
const displayName = (0,
|
|
9979
|
+
const displayName = (0, import_react23.useMemo)(() => {
|
|
10183
9980
|
const maxLetters = size === "sm" ? 1 : 2;
|
|
10184
9981
|
return (name ?? "").split(" ").filter((_, index) => index < maxLetters).map((value) => value[0]).join("").toUpperCase();
|
|
10185
9982
|
}, [name, size]);
|
|
@@ -10281,7 +10078,7 @@ var Circle = ({
|
|
|
10281
10078
|
};
|
|
10282
10079
|
|
|
10283
10080
|
// src/components/icons-and-geometry/Ring.tsx
|
|
10284
|
-
var
|
|
10081
|
+
var import_react24 = require("react");
|
|
10285
10082
|
var import_clsx19 = __toESM(require("clsx"));
|
|
10286
10083
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
10287
10084
|
var Ring = ({
|
|
@@ -10310,9 +10107,9 @@ var AnimatedRing = ({
|
|
|
10310
10107
|
onAnimationFinished,
|
|
10311
10108
|
style
|
|
10312
10109
|
}) => {
|
|
10313
|
-
const [currentWidth, setCurrentWidth] = (0,
|
|
10110
|
+
const [currentWidth, setCurrentWidth] = (0, import_react24.useState)(0);
|
|
10314
10111
|
const milliseconds = 1e3 * fillAnimationDuration;
|
|
10315
|
-
const animate = (0,
|
|
10112
|
+
const animate = (0, import_react24.useCallback)((timestamp, startTime) => {
|
|
10316
10113
|
const progress = Math.min((timestamp - startTime) / milliseconds, 1);
|
|
10317
10114
|
const newWidth = Math.min(width * progress, width);
|
|
10318
10115
|
setCurrentWidth(newWidth);
|
|
@@ -10326,7 +10123,7 @@ var AnimatedRing = ({
|
|
|
10326
10123
|
}
|
|
10327
10124
|
}
|
|
10328
10125
|
}, [milliseconds, onAnimationFinished, repeating, width]);
|
|
10329
|
-
(0,
|
|
10126
|
+
(0, import_react24.useEffect)(() => {
|
|
10330
10127
|
if (currentWidth < width) {
|
|
10331
10128
|
requestAnimationFrame((timestamp) => animate(timestamp, timestamp));
|
|
10332
10129
|
}
|
|
@@ -10361,10 +10158,10 @@ var RingWave = ({
|
|
|
10361
10158
|
onAnimationFinished,
|
|
10362
10159
|
style
|
|
10363
10160
|
}) => {
|
|
10364
|
-
const [currentInnerSize, setCurrentInnerSize] = (0,
|
|
10161
|
+
const [currentInnerSize, setCurrentInnerSize] = (0, import_react24.useState)(startInnerSize);
|
|
10365
10162
|
const distance = endInnerSize - startInnerSize;
|
|
10366
10163
|
const milliseconds = 1e3 * fillAnimationDuration;
|
|
10367
|
-
const animate = (0,
|
|
10164
|
+
const animate = (0, import_react24.useCallback)((timestamp, startTime) => {
|
|
10368
10165
|
const progress = Math.min((timestamp - startTime) / milliseconds, 1);
|
|
10369
10166
|
const newInnerSize = Math.min(
|
|
10370
10167
|
startInnerSize + distance * progress,
|
|
@@ -10381,7 +10178,7 @@ var RingWave = ({
|
|
|
10381
10178
|
}
|
|
10382
10179
|
}
|
|
10383
10180
|
}, [distance, endInnerSize, milliseconds, onAnimationFinished, repeating, startInnerSize]);
|
|
10384
|
-
(0,
|
|
10181
|
+
(0, import_react24.useEffect)(() => {
|
|
10385
10182
|
if (currentInnerSize < endInnerSize) {
|
|
10386
10183
|
requestAnimationFrame((timestamp) => animate(timestamp, timestamp));
|
|
10387
10184
|
}
|
|
@@ -10416,7 +10213,7 @@ var RadialRings = ({
|
|
|
10416
10213
|
sizeCircle2 = 200,
|
|
10417
10214
|
sizeCircle3 = 300
|
|
10418
10215
|
}) => {
|
|
10419
|
-
const [currentRing, setCurrentRing] = (0,
|
|
10216
|
+
const [currentRing, setCurrentRing] = (0, import_react24.useState)(0);
|
|
10420
10217
|
const size = sizeCircle3;
|
|
10421
10218
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
10422
10219
|
"div",
|
|
@@ -10565,13 +10362,13 @@ var TagIcon = ({
|
|
|
10565
10362
|
};
|
|
10566
10363
|
|
|
10567
10364
|
// src/components/layout/Carousel.tsx
|
|
10568
|
-
var
|
|
10365
|
+
var import_react25 = require("react");
|
|
10569
10366
|
var import_clsx20 = __toESM(require("clsx"));
|
|
10570
10367
|
var import_lucide_react7 = require("lucide-react");
|
|
10571
10368
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
10572
|
-
var CarouselContext = (0,
|
|
10369
|
+
var CarouselContext = (0, import_react25.createContext)(null);
|
|
10573
10370
|
var useCarouselContext = () => {
|
|
10574
|
-
const context = (0,
|
|
10371
|
+
const context = (0, import_react25.useContext)(CarouselContext);
|
|
10575
10372
|
if (!context) {
|
|
10576
10373
|
console.error("useCarouselContext must be used within CarouselContext");
|
|
10577
10374
|
}
|
|
@@ -10582,7 +10379,7 @@ function CarouselTabs({
|
|
|
10582
10379
|
}) {
|
|
10583
10380
|
const translation = useHightideTranslation();
|
|
10584
10381
|
const { id, slideCount, currentIndex, isLooping } = useCarouselContext();
|
|
10585
|
-
const tabRefs = (0,
|
|
10382
|
+
const tabRefs = (0, import_react25.useRef)([]);
|
|
10586
10383
|
const handleKeyDown = (event, index) => {
|
|
10587
10384
|
let newIndex = index;
|
|
10588
10385
|
if (event.key === "ArrowRight") {
|
|
@@ -10632,7 +10429,7 @@ function CarouselTabs({
|
|
|
10632
10429
|
}
|
|
10633
10430
|
);
|
|
10634
10431
|
}
|
|
10635
|
-
var CarouselSlide = (0,
|
|
10432
|
+
var CarouselSlide = (0, import_react25.forwardRef)(
|
|
10636
10433
|
function CarouselSlide2({
|
|
10637
10434
|
index,
|
|
10638
10435
|
isSelected,
|
|
@@ -10677,17 +10474,17 @@ var Carousel = ({
|
|
|
10677
10474
|
...props
|
|
10678
10475
|
}) => {
|
|
10679
10476
|
const translation = useHightideTranslation();
|
|
10680
|
-
const slideRefs = (0,
|
|
10681
|
-
const [currentIndex, setCurrentIndex] = (0,
|
|
10682
|
-
const [hasFocus, setHasFocus] = (0,
|
|
10683
|
-
const [dragState, setDragState] = (0,
|
|
10477
|
+
const slideRefs = (0, import_react25.useRef)([]);
|
|
10478
|
+
const [currentIndex, setCurrentIndex] = (0, import_react25.useState)(0);
|
|
10479
|
+
const [hasFocus, setHasFocus] = (0, import_react25.useState)(false);
|
|
10480
|
+
const [dragState, setDragState] = (0, import_react25.useState)();
|
|
10684
10481
|
const isPaused = hasFocus;
|
|
10685
|
-
const carouselContainerRef = (0,
|
|
10686
|
-
const [disableClick, setDisableClick] = (0,
|
|
10687
|
-
const timeOut = (0,
|
|
10688
|
-
const length = (0,
|
|
10482
|
+
const carouselContainerRef = (0, import_react25.useRef)(null);
|
|
10483
|
+
const [disableClick, setDisableClick] = (0, import_react25.useState)(false);
|
|
10484
|
+
const timeOut = (0, import_react25.useRef)(void 0);
|
|
10485
|
+
const length = (0, import_react25.useMemo)(() => children.length, [children]);
|
|
10689
10486
|
const paddingItemCount = 3;
|
|
10690
|
-
const generatedId = "carousel" + (0,
|
|
10487
|
+
const generatedId = "carousel" + (0, import_react25.useId)();
|
|
10691
10488
|
const id = props.id ?? generatedId;
|
|
10692
10489
|
if (isAutoPlaying && !isLooping) {
|
|
10693
10490
|
console.error("When isAutoLooping is true, isLooping should also be true");
|
|
@@ -10696,7 +10493,7 @@ var Carousel = ({
|
|
|
10696
10493
|
autoLoopingTimeOut = Math.max(0, autoLoopingTimeOut);
|
|
10697
10494
|
animationTime = Math.max(100, animationTime);
|
|
10698
10495
|
autoLoopAnimationTime = Math.max(200, autoLoopAnimationTime);
|
|
10699
|
-
(0,
|
|
10496
|
+
(0, import_react25.useEffect)(() => {
|
|
10700
10497
|
const carousel = carouselContainerRef.current;
|
|
10701
10498
|
if (carousel) {
|
|
10702
10499
|
let onFocus = function() {
|
|
@@ -10719,20 +10516,20 @@ var Carousel = ({
|
|
|
10719
10516
|
const canGoLeft = () => {
|
|
10720
10517
|
return isLooping || currentIndex !== 0;
|
|
10721
10518
|
};
|
|
10722
|
-
const canGoRight = (0,
|
|
10519
|
+
const canGoRight = (0, import_react25.useCallback)(() => {
|
|
10723
10520
|
return isLooping || currentIndex !== length - 1;
|
|
10724
10521
|
}, [currentIndex, isLooping, length]);
|
|
10725
10522
|
const left = () => {
|
|
10726
10523
|
if (canGoLeft()) {
|
|
10727
|
-
setCurrentIndex(currentIndex - 1);
|
|
10524
|
+
setCurrentIndex((currentIndex + length - 1) % length);
|
|
10728
10525
|
}
|
|
10729
10526
|
};
|
|
10730
|
-
const right = (0,
|
|
10527
|
+
const right = (0, import_react25.useCallback)(() => {
|
|
10731
10528
|
if (canGoRight()) {
|
|
10732
10529
|
setCurrentIndex((currentIndex + length + 1) % length);
|
|
10733
10530
|
}
|
|
10734
10531
|
}, [canGoRight, currentIndex, length]);
|
|
10735
|
-
(0,
|
|
10532
|
+
(0, import_react25.useEffect)(() => {
|
|
10736
10533
|
if (!timeOut.current && !isPaused) {
|
|
10737
10534
|
if (autoLoopingTimeOut > 0) {
|
|
10738
10535
|
timeOut.current = setTimeout(() => {
|
|
@@ -10784,10 +10581,10 @@ var Carousel = ({
|
|
|
10784
10581
|
}
|
|
10785
10582
|
setDragState(void 0);
|
|
10786
10583
|
};
|
|
10787
|
-
(0,
|
|
10584
|
+
(0, import_react25.useEffect)(() => {
|
|
10788
10585
|
setDisableClick(!dragState);
|
|
10789
10586
|
}, [dragState]);
|
|
10790
|
-
(0,
|
|
10587
|
+
(0, import_react25.useEffect)(() => {
|
|
10791
10588
|
onSlideChanged?.(currentIndex);
|
|
10792
10589
|
}, [currentIndex]);
|
|
10793
10590
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CarouselContext.Provider, { value: { id, currentIndex, slideCount: length, isLooping }, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
@@ -10871,8 +10668,9 @@ var Carousel = ({
|
|
|
10871
10668
|
),
|
|
10872
10669
|
arrows && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
10873
10670
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
10874
|
-
|
|
10671
|
+
Button,
|
|
10875
10672
|
{
|
|
10673
|
+
layout: "icon",
|
|
10876
10674
|
color: "neutral",
|
|
10877
10675
|
className: (0, import_clsx20.default)("absolute z-10 left-2 top-1/2 -translate-y-1/2 shadow-md", { hidden: !canGoLeft() }),
|
|
10878
10676
|
disabled: !canGoLeft(),
|
|
@@ -10881,8 +10679,9 @@ var Carousel = ({
|
|
|
10881
10679
|
}
|
|
10882
10680
|
),
|
|
10883
10681
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
10884
|
-
|
|
10682
|
+
Button,
|
|
10885
10683
|
{
|
|
10684
|
+
layout: "icon",
|
|
10886
10685
|
color: "neutral",
|
|
10887
10686
|
className: (0, import_clsx20.default)("absolute z-10 right-2 top-1/2 -translate-y-1/2 shadow-md", { hidden: !canGoRight() }),
|
|
10888
10687
|
disabled: !canGoRight(),
|
|
@@ -11177,11 +10976,11 @@ var FAQSection = ({
|
|
|
11177
10976
|
};
|
|
11178
10977
|
|
|
11179
10978
|
// src/components/layout/FloatingContainer.tsx
|
|
11180
|
-
var
|
|
10979
|
+
var import_react26 = require("react");
|
|
11181
10980
|
var import_react_dom3 = require("react-dom");
|
|
11182
10981
|
var import_clsx23 = require("clsx");
|
|
11183
10982
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
11184
|
-
var FloatingContainer = (0,
|
|
10983
|
+
var FloatingContainer = (0, import_react26.forwardRef)(function FloatingContainer2({
|
|
11185
10984
|
children,
|
|
11186
10985
|
backgroundOverlay,
|
|
11187
10986
|
anchor,
|
|
@@ -11193,8 +10992,8 @@ var FloatingContainer = (0, import_react25.forwardRef)(function FloatingContaine
|
|
|
11193
10992
|
gap = 4,
|
|
11194
10993
|
...props
|
|
11195
10994
|
}, forwardRef12) {
|
|
11196
|
-
const innerRef = (0,
|
|
11197
|
-
(0,
|
|
10995
|
+
const innerRef = (0, import_react26.useRef)(null);
|
|
10996
|
+
(0, import_react26.useImperativeHandle)(forwardRef12, () => innerRef.current);
|
|
11198
10997
|
const position = useFloatingElement({
|
|
11199
10998
|
active: !props.hidden,
|
|
11200
10999
|
containerRef: innerRef,
|
|
@@ -11234,18 +11033,18 @@ var FloatingContainer = (0, import_react25.forwardRef)(function FloatingContaine
|
|
|
11234
11033
|
});
|
|
11235
11034
|
|
|
11236
11035
|
// src/components/layout/ListBox.tsx
|
|
11237
|
-
var
|
|
11036
|
+
var import_react27 = __toESM(require("react"));
|
|
11238
11037
|
var import_clsx24 = require("clsx");
|
|
11239
11038
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
11240
|
-
var ListBoxContext = (0,
|
|
11039
|
+
var ListBoxContext = (0, import_react27.createContext)(null);
|
|
11241
11040
|
function useListBoxContext() {
|
|
11242
|
-
const ctx = (0,
|
|
11041
|
+
const ctx = (0, import_react27.useContext)(ListBoxContext);
|
|
11243
11042
|
if (!ctx) {
|
|
11244
11043
|
throw new Error("ListBoxItem must be used within a ListBoxPrimitive");
|
|
11245
11044
|
}
|
|
11246
11045
|
return ctx;
|
|
11247
11046
|
}
|
|
11248
|
-
var ListBoxItem = (0,
|
|
11047
|
+
var ListBoxItem = (0, import_react27.forwardRef)(
|
|
11249
11048
|
function ListBoxItem2({ value, disabled = false, children, className, ...rest }, ref) {
|
|
11250
11049
|
const {
|
|
11251
11050
|
registerItem,
|
|
@@ -11255,9 +11054,9 @@ var ListBoxItem = (0, import_react26.forwardRef)(
|
|
|
11255
11054
|
onItemClick,
|
|
11256
11055
|
isSelected
|
|
11257
11056
|
} = useListBoxContext();
|
|
11258
|
-
const itemRef = (0,
|
|
11259
|
-
const id =
|
|
11260
|
-
(0,
|
|
11057
|
+
const itemRef = (0, import_react27.useRef)(null);
|
|
11058
|
+
const id = import_react27.default.useId();
|
|
11059
|
+
(0, import_react27.useEffect)(() => {
|
|
11261
11060
|
registerItem({ id, value, disabled, ref: itemRef });
|
|
11262
11061
|
return () => unregisterItem(id);
|
|
11263
11062
|
}, [id, value, disabled, registerItem, unregisterItem]);
|
|
@@ -11299,7 +11098,7 @@ var ListBoxItem = (0, import_react26.forwardRef)(
|
|
|
11299
11098
|
);
|
|
11300
11099
|
}
|
|
11301
11100
|
);
|
|
11302
|
-
var ListBoxPrimitive = (0,
|
|
11101
|
+
var ListBoxPrimitive = (0, import_react27.forwardRef)(
|
|
11303
11102
|
function ListBoxPrimitive2({
|
|
11304
11103
|
value,
|
|
11305
11104
|
onSelectionChanged,
|
|
@@ -11309,9 +11108,9 @@ var ListBoxPrimitive = (0, import_react26.forwardRef)(
|
|
|
11309
11108
|
orientation = "vertical",
|
|
11310
11109
|
...props
|
|
11311
11110
|
}, ref) {
|
|
11312
|
-
const itemsRef = (0,
|
|
11313
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
11314
|
-
const registerItem = (0,
|
|
11111
|
+
const itemsRef = (0, import_react27.useRef)([]);
|
|
11112
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react27.useState)(void 0);
|
|
11113
|
+
const registerItem = (0, import_react27.useCallback)((item) => {
|
|
11315
11114
|
itemsRef.current.push(item);
|
|
11316
11115
|
itemsRef.current.sort((a, b) => {
|
|
11317
11116
|
const aEl = a.ref.current;
|
|
@@ -11320,14 +11119,14 @@ var ListBoxPrimitive = (0, import_react26.forwardRef)(
|
|
|
11320
11119
|
return aEl.compareDocumentPosition(bEl) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
|
|
11321
11120
|
});
|
|
11322
11121
|
}, []);
|
|
11323
|
-
const unregisterItem = (0,
|
|
11122
|
+
const unregisterItem = (0, import_react27.useCallback)((id) => {
|
|
11324
11123
|
itemsRef.current = itemsRef.current.filter((i) => i.id !== id);
|
|
11325
11124
|
}, []);
|
|
11326
|
-
const isSelected = (0,
|
|
11125
|
+
const isSelected = (0, import_react27.useCallback)(
|
|
11327
11126
|
(val) => (value ?? []).includes(val),
|
|
11328
11127
|
[value]
|
|
11329
11128
|
);
|
|
11330
|
-
const onItemClickedHandler = (0,
|
|
11129
|
+
const onItemClickedHandler = (0, import_react27.useCallback)(
|
|
11331
11130
|
(id) => {
|
|
11332
11131
|
const index = itemsRef.current.findIndex((i) => i.id === id);
|
|
11333
11132
|
if (index === -1) {
|
|
@@ -11351,13 +11150,13 @@ var ListBoxPrimitive = (0, import_react26.forwardRef)(
|
|
|
11351
11150
|
},
|
|
11352
11151
|
[onItemClicked, isSelection, isMultiple, onSelectionChanged, isSelected, value]
|
|
11353
11152
|
);
|
|
11354
|
-
const setHighlightedId = (0,
|
|
11153
|
+
const setHighlightedId = (0, import_react27.useCallback)((id) => {
|
|
11355
11154
|
const index = itemsRef.current.findIndex((i) => i.id === id);
|
|
11356
11155
|
if (index !== -1) {
|
|
11357
11156
|
setHighlightedIndex(index);
|
|
11358
11157
|
}
|
|
11359
11158
|
}, []);
|
|
11360
|
-
(0,
|
|
11159
|
+
(0, import_react27.useEffect)(() => {
|
|
11361
11160
|
if (highlightedIndex !== void 0) {
|
|
11362
11161
|
itemsRef.current[highlightedIndex]?.ref.current?.scrollIntoView({ block: "nearest", behavior: "auto" });
|
|
11363
11162
|
}
|
|
@@ -11462,7 +11261,7 @@ var ListBoxMultipleUncontrolled = ({
|
|
|
11462
11261
|
}
|
|
11463
11262
|
);
|
|
11464
11263
|
};
|
|
11465
|
-
var ListBox = (0,
|
|
11264
|
+
var ListBox = (0, import_react27.forwardRef)(function ListBox2({
|
|
11466
11265
|
value,
|
|
11467
11266
|
onSelectionChanged,
|
|
11468
11267
|
...props
|
|
@@ -11497,20 +11296,20 @@ var ListBoxUncontrolled = ({
|
|
|
11497
11296
|
};
|
|
11498
11297
|
|
|
11499
11298
|
// src/components/layout/TabView.tsx
|
|
11500
|
-
var import_react27 = require("react");
|
|
11501
11299
|
var import_react28 = require("react");
|
|
11300
|
+
var import_react29 = require("react");
|
|
11502
11301
|
var import_clsx25 = __toESM(require("clsx"));
|
|
11503
11302
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
11504
|
-
var TabContext = (0,
|
|
11303
|
+
var TabContext = (0, import_react29.createContext)(null);
|
|
11505
11304
|
function useTabContext() {
|
|
11506
|
-
const ctx = (0,
|
|
11305
|
+
const ctx = (0, import_react29.useContext)(TabContext);
|
|
11507
11306
|
if (!ctx) throw new Error("useTabContext must be used inside a <TabView>");
|
|
11508
11307
|
return ctx;
|
|
11509
11308
|
}
|
|
11510
11309
|
function TabView({ children, outerDivProps, onTabChanged, initialTabIndex = 0, ...props }) {
|
|
11511
|
-
const [tabs, setTabs] = (0,
|
|
11512
|
-
const [active, setActiveState] = (0,
|
|
11513
|
-
const buttonRefs = (0,
|
|
11310
|
+
const [tabs, setTabs] = (0, import_react29.useState)([]);
|
|
11311
|
+
const [active, setActiveState] = (0, import_react29.useState)(null);
|
|
11312
|
+
const buttonRefs = (0, import_react29.useRef)({});
|
|
11514
11313
|
const setActive = (id) => {
|
|
11515
11314
|
setActiveState(id);
|
|
11516
11315
|
onTabChanged?.(id);
|
|
@@ -11557,7 +11356,7 @@ function TabView({ children, outerDivProps, onTabChanged, initialTabIndex = 0, .
|
|
|
11557
11356
|
onClick: () => setActive(t.id),
|
|
11558
11357
|
onKeyDown: (e) => onKeyDown(e, t.id),
|
|
11559
11358
|
className: (0, import_clsx25.default)(
|
|
11560
|
-
"flex-row-0 grow justify-center px-3 pb-
|
|
11359
|
+
"flex-row-0 grow justify-center px-3 pb-2.25 typography-label-md font-bold border-b-2",
|
|
11561
11360
|
active === t.id ? "border-primary" : "text-description hover:text-on-background"
|
|
11562
11361
|
),
|
|
11563
11362
|
children: t.label
|
|
@@ -11569,9 +11368,9 @@ function TabView({ children, outerDivProps, onTabChanged, initialTabIndex = 0, .
|
|
|
11569
11368
|
}
|
|
11570
11369
|
function Tab({ id: customId, label, children, ...props }) {
|
|
11571
11370
|
const { active, register, unregister } = useTabContext();
|
|
11572
|
-
const generatedId = (0,
|
|
11371
|
+
const generatedId = (0, import_react28.useId)();
|
|
11573
11372
|
const id = customId ?? generatedId;
|
|
11574
|
-
(0,
|
|
11373
|
+
(0, import_react29.useEffect)(() => {
|
|
11575
11374
|
register(id, label);
|
|
11576
11375
|
return () => unregister(id);
|
|
11577
11376
|
}, [id, label]);
|
|
@@ -11708,13 +11507,13 @@ var ErrorComponent = ({
|
|
|
11708
11507
|
};
|
|
11709
11508
|
|
|
11710
11509
|
// src/components/loading-states/LoadingAndErrorComponent.tsx
|
|
11711
|
-
var
|
|
11510
|
+
var import_react30 = require("react");
|
|
11712
11511
|
|
|
11713
11512
|
// src/components/loading-states/LoadingContainer.tsx
|
|
11714
11513
|
var import_clsx28 = require("clsx");
|
|
11715
11514
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
11716
11515
|
var LoadingContainer = ({ className }) => {
|
|
11717
|
-
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: (0, import_clsx28.clsx)("relative overflow-hidden shimmer bg-disabled
|
|
11516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: (0, import_clsx28.clsx)("relative overflow-hidden shimmer bg-disabled/30 rounded-md", className) });
|
|
11718
11517
|
};
|
|
11719
11518
|
|
|
11720
11519
|
// src/components/loading-states/LoadingAndErrorComponent.tsx
|
|
@@ -11729,8 +11528,8 @@ var LoadingAndErrorComponent = ({
|
|
|
11729
11528
|
minimumLoadingDuration = 200,
|
|
11730
11529
|
className
|
|
11731
11530
|
}) => {
|
|
11732
|
-
const [isInMinimumLoading, setIsInMinimumLoading] = (0,
|
|
11733
|
-
const [hasUsedMinimumLoading, setHasUsedMinimumLoading] = (0,
|
|
11531
|
+
const [isInMinimumLoading, setIsInMinimumLoading] = (0, import_react30.useState)(false);
|
|
11532
|
+
const [hasUsedMinimumLoading, setHasUsedMinimumLoading] = (0, import_react30.useState)(false);
|
|
11734
11533
|
if (minimumLoadingDuration && !isInMinimumLoading && !hasUsedMinimumLoading) {
|
|
11735
11534
|
setIsInMinimumLoading(true);
|
|
11736
11535
|
setTimeout(() => {
|
|
@@ -11765,10 +11564,9 @@ var LoadingAnimation = ({
|
|
|
11765
11564
|
var import_clsx31 = __toESM(require("clsx"));
|
|
11766
11565
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
11767
11566
|
var LoadingButton = ({ isLoading = false, size = "medium", onClick, ...rest }) => {
|
|
11768
|
-
const paddingClass = ButtonUtil.paddingMapping[size];
|
|
11769
11567
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "inline-block relative", children: [
|
|
11770
|
-
isLoading && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: (0, import_clsx31.default)("flex-row-2 absolute inset-0 items-center justify-center bg-white/40"
|
|
11771
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
11568
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: (0, import_clsx31.default)("flex-row-2 absolute inset-0 items-center justify-center bg-white/40"), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(HelpwaveLogo, { animate: "loading", className: "text-white" }) }),
|
|
11569
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Button, { ...rest, size, disabled: rest.disabled, onClick })
|
|
11772
11570
|
] });
|
|
11773
11571
|
};
|
|
11774
11572
|
|
|
@@ -11831,30 +11629,36 @@ var ProgressIndicator = ({
|
|
|
11831
11629
|
// src/components/navigation/BreadCrumb.tsx
|
|
11832
11630
|
var import_link = __toESM(require_link2());
|
|
11833
11631
|
var import_clsx32 = __toESM(require("clsx"));
|
|
11834
|
-
var
|
|
11632
|
+
var import_react31 = require("react");
|
|
11835
11633
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
11836
11634
|
var BreadCrumb = ({ crumbs, linkClassName, containerClassName }) => {
|
|
11837
|
-
const color = "text-description";
|
|
11838
11635
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: (0, import_clsx32.default)("flex-row-0.5 items-center", containerClassName), children: crumbs.map((crumb, index) => {
|
|
11839
11636
|
const isLast = index === crumbs.length - 1;
|
|
11840
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
11637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_react31.Fragment, { children: [
|
|
11841
11638
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
11842
11639
|
import_link.default,
|
|
11843
11640
|
{
|
|
11844
11641
|
href: crumb.link,
|
|
11845
|
-
className: (0, import_clsx32.default)(
|
|
11642
|
+
className: (0, import_clsx32.default)(
|
|
11643
|
+
"btn-sm coloring-text-hover",
|
|
11644
|
+
{
|
|
11645
|
+
description: !isLast,
|
|
11646
|
+
neutral: isLast
|
|
11647
|
+
},
|
|
11648
|
+
linkClassName
|
|
11649
|
+
),
|
|
11846
11650
|
children: crumb.display
|
|
11847
11651
|
}
|
|
11848
11652
|
),
|
|
11849
|
-
!isLast && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: (0, import_clsx32.default)(`px-1`,
|
|
11653
|
+
!isLast && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: (0, import_clsx32.default)(`px-1`, "text-description"), children: "/" })
|
|
11850
11654
|
] }, index);
|
|
11851
11655
|
}) });
|
|
11852
11656
|
};
|
|
11853
11657
|
|
|
11854
11658
|
// src/components/navigation/Navigation.tsx
|
|
11855
11659
|
var import_lucide_react9 = require("lucide-react");
|
|
11856
|
-
var import_react31 = require("react");
|
|
11857
11660
|
var import_react32 = require("react");
|
|
11661
|
+
var import_react33 = require("react");
|
|
11858
11662
|
var import_link2 = __toESM(require_link2());
|
|
11859
11663
|
var import_clsx33 = __toESM(require("clsx"));
|
|
11860
11664
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
@@ -11867,10 +11671,10 @@ var NavigationItemWithSubItem = ({
|
|
|
11867
11671
|
horizontalAlignment = "center",
|
|
11868
11672
|
...options
|
|
11869
11673
|
}) => {
|
|
11870
|
-
const [isOpen, setOpen] = (0,
|
|
11871
|
-
const containerRef = (0,
|
|
11872
|
-
const triggerRef = (0,
|
|
11873
|
-
const id = (0,
|
|
11674
|
+
const [isOpen, setOpen] = (0, import_react33.useState)(false);
|
|
11675
|
+
const containerRef = (0, import_react33.useRef)();
|
|
11676
|
+
const triggerRef = (0, import_react33.useRef)(null);
|
|
11677
|
+
const id = (0, import_react33.useId)();
|
|
11874
11678
|
const style = useFloatingElement({
|
|
11875
11679
|
active: isOpen,
|
|
11876
11680
|
containerRef,
|
|
@@ -11878,12 +11682,13 @@ var NavigationItemWithSubItem = ({
|
|
|
11878
11682
|
horizontalAlignment,
|
|
11879
11683
|
...options
|
|
11880
11684
|
});
|
|
11881
|
-
const onBlur = (0,
|
|
11685
|
+
const onBlur = (0, import_react33.useCallback)((event) => {
|
|
11882
11686
|
const nextFocus = event.relatedTarget;
|
|
11883
11687
|
if (!containerRef.current?.contains(nextFocus) && !triggerRef.current?.contains(nextFocus)) {
|
|
11884
11688
|
setOpen(false);
|
|
11885
11689
|
}
|
|
11886
11690
|
}, []);
|
|
11691
|
+
const zIndex = useZIndexRegister(isOpen);
|
|
11887
11692
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
|
|
11888
11693
|
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
11889
11694
|
"button",
|
|
@@ -11919,10 +11724,10 @@ var NavigationItemWithSubItem = ({
|
|
|
11919
11724
|
onBlur,
|
|
11920
11725
|
hidden: !isOpen,
|
|
11921
11726
|
className: (0, import_clsx33.default)(
|
|
11922
|
-
"fixed flex-col-4 p-4 bg-surface text-on-surface shadow-side shadow-hw-bottom rounded-md
|
|
11727
|
+
"fixed flex-col-4 p-4 bg-surface text-on-surface shadow-side shadow-hw-bottom rounded-md",
|
|
11923
11728
|
{ "opacity-0": !style }
|
|
11924
11729
|
),
|
|
11925
|
-
style,
|
|
11730
|
+
style: { ...style, zIndex },
|
|
11926
11731
|
children: items.map(({ link, label: label2, external }, index) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
11927
11732
|
import_link2.default,
|
|
11928
11733
|
{
|
|
@@ -11940,12 +11745,13 @@ var NavigationItemList = ({ items, ...restProps }) => {
|
|
|
11940
11745
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("ul", { ...restProps, className: (0, import_clsx33.default)("flex-row-6 items-center", restProps.className), children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("li", { children: isSubItem(item) ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(NavigationItemWithSubItem, { ...item }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_link2.default, { href: item.link, target: item.external ? "_blank" : void 0, className: "link", children: item.label }) }, index)) });
|
|
11941
11746
|
};
|
|
11942
11747
|
var Navigation = ({ ...props }) => {
|
|
11943
|
-
const [isMobileOpen, setIsMobileOpen] = (0,
|
|
11944
|
-
const id = (0,
|
|
11945
|
-
const menuRef = (0,
|
|
11946
|
-
(0,
|
|
11748
|
+
const [isMobileOpen, setIsMobileOpen] = (0, import_react33.useState)(false);
|
|
11749
|
+
const id = (0, import_react33.useId)();
|
|
11750
|
+
const menuRef = (0, import_react33.useRef)(null);
|
|
11751
|
+
(0, import_react32.useEffect)(() => {
|
|
11947
11752
|
menuRef.current?.focus();
|
|
11948
11753
|
}, [isMobileOpen]);
|
|
11754
|
+
const zIndex = useZIndexRegister(isMobileOpen);
|
|
11949
11755
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("nav", { children: [
|
|
11950
11756
|
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
11951
11757
|
NavigationItemList,
|
|
@@ -11955,9 +11761,11 @@ var Navigation = ({ ...props }) => {
|
|
|
11955
11761
|
}
|
|
11956
11762
|
),
|
|
11957
11763
|
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
11958
|
-
|
|
11764
|
+
Button,
|
|
11959
11765
|
{
|
|
11960
|
-
|
|
11766
|
+
layout: "icon",
|
|
11767
|
+
coloringStyle: "text",
|
|
11768
|
+
color: "neutral",
|
|
11961
11769
|
onClick: () => setIsMobileOpen(true),
|
|
11962
11770
|
className: "desktop:hidden",
|
|
11963
11771
|
"aria-haspopup": "true",
|
|
@@ -11980,14 +11788,24 @@ var Navigation = ({ ...props }) => {
|
|
|
11980
11788
|
}
|
|
11981
11789
|
},
|
|
11982
11790
|
className: (0, import_clsx33.default)(
|
|
11983
|
-
"flex-col-8 items-center justify-center fixed inset-0 p-8 w-screen h-screen
|
|
11791
|
+
"flex-col-8 items-center justify-center fixed inset-0 p-8 w-screen h-screen bg-surface text-on-surface",
|
|
11984
11792
|
{
|
|
11985
11793
|
"desktop:hidden": isMobileOpen
|
|
11986
11794
|
},
|
|
11987
11795
|
props.className
|
|
11988
11796
|
),
|
|
11797
|
+
style: { zIndex },
|
|
11989
11798
|
children: [
|
|
11990
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
11799
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
11800
|
+
Button,
|
|
11801
|
+
{
|
|
11802
|
+
layout: "icon",
|
|
11803
|
+
coloringStyle: "text",
|
|
11804
|
+
color: "neutral",
|
|
11805
|
+
onClick: () => setIsMobileOpen(false),
|
|
11806
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react9.XIcon, {})
|
|
11807
|
+
}
|
|
11808
|
+
),
|
|
11991
11809
|
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(NavigationItemList, { ...props, className: (0, import_clsx33.default)("flex-col-8", props.className) })
|
|
11992
11810
|
]
|
|
11993
11811
|
}
|
|
@@ -11998,7 +11816,7 @@ var Navigation = ({ ...props }) => {
|
|
|
11998
11816
|
// src/components/navigation/Pagination.tsx
|
|
11999
11817
|
var import_lucide_react10 = require("lucide-react");
|
|
12000
11818
|
var import_clsx34 = __toESM(require("clsx"));
|
|
12001
|
-
var
|
|
11819
|
+
var import_react34 = require("react");
|
|
12002
11820
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
12003
11821
|
var Pagination = ({
|
|
12004
11822
|
pageIndex,
|
|
@@ -12008,11 +11826,11 @@ var Pagination = ({
|
|
|
12008
11826
|
style
|
|
12009
11827
|
}) => {
|
|
12010
11828
|
const translation = useHightideTranslation();
|
|
12011
|
-
const [value, setValue] = (0,
|
|
11829
|
+
const [value, setValue] = (0, import_react34.useState)((pageIndex + 1).toString());
|
|
12012
11830
|
const noPages = pageCount === 0;
|
|
12013
11831
|
const onFirstPage = pageIndex === 0 && !noPages;
|
|
12014
11832
|
const onLastPage = pageIndex === pageCount - 1;
|
|
12015
|
-
(0,
|
|
11833
|
+
(0, import_react34.useEffect)(() => {
|
|
12016
11834
|
if (noPages) {
|
|
12017
11835
|
setValue("0");
|
|
12018
11836
|
} else {
|
|
@@ -12023,8 +11841,28 @@ var Pagination = ({
|
|
|
12023
11841
|
onPageChanged(page);
|
|
12024
11842
|
};
|
|
12025
11843
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: (0, import_clsx34.default)("flex-row-1", className), style, children: [
|
|
12026
|
-
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
12027
|
-
|
|
11844
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11845
|
+
Button,
|
|
11846
|
+
{
|
|
11847
|
+
layout: "icon",
|
|
11848
|
+
coloringStyle: "text",
|
|
11849
|
+
color: "neutral",
|
|
11850
|
+
onClick: () => changePage(0),
|
|
11851
|
+
disabled: onFirstPage || noPages,
|
|
11852
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react10.ChevronFirst, {})
|
|
11853
|
+
}
|
|
11854
|
+
),
|
|
11855
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11856
|
+
Button,
|
|
11857
|
+
{
|
|
11858
|
+
layout: "icon",
|
|
11859
|
+
coloringStyle: "text",
|
|
11860
|
+
color: "neutral",
|
|
11861
|
+
onClick: () => changePage(pageIndex - 1),
|
|
11862
|
+
disabled: onFirstPage || noPages,
|
|
11863
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react10.ChevronLeft, {})
|
|
11864
|
+
}
|
|
11865
|
+
),
|
|
12028
11866
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex-row-2 min-w-56 items-center justify-center mx-2 text-center", children: [
|
|
12029
11867
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
12030
11868
|
Input,
|
|
@@ -12059,8 +11897,28 @@ var Pagination = ({
|
|
|
12059
11897
|
}
|
|
12060
11898
|
)
|
|
12061
11899
|
] }),
|
|
12062
|
-
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
12063
|
-
|
|
11900
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11901
|
+
Button,
|
|
11902
|
+
{
|
|
11903
|
+
layout: "icon",
|
|
11904
|
+
coloringStyle: "text",
|
|
11905
|
+
color: "neutral",
|
|
11906
|
+
onClick: () => changePage(pageIndex + 1),
|
|
11907
|
+
disabled: onLastPage || noPages,
|
|
11908
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react10.ChevronRight, {})
|
|
11909
|
+
}
|
|
11910
|
+
),
|
|
11911
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11912
|
+
Button,
|
|
11913
|
+
{
|
|
11914
|
+
layout: "icon",
|
|
11915
|
+
coloringStyle: "text",
|
|
11916
|
+
color: "neutral",
|
|
11917
|
+
onClick: () => changePage(pageCount - 1),
|
|
11918
|
+
disabled: onLastPage || noPages,
|
|
11919
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react10.ChevronLast, {})
|
|
11920
|
+
}
|
|
11921
|
+
)
|
|
12064
11922
|
] });
|
|
12065
11923
|
};
|
|
12066
11924
|
|
|
@@ -12095,7 +11953,7 @@ var StepperBar = ({
|
|
|
12095
11953
|
className: (0, import_clsx35.default)("flex-row-2 justify-between", className),
|
|
12096
11954
|
children: [
|
|
12097
11955
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "flex-row-2 flex-[2] justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
12098
|
-
|
|
11956
|
+
Button,
|
|
12099
11957
|
{
|
|
12100
11958
|
disabled: currentStep === 0 || disabledSteps.has(currentStep),
|
|
12101
11959
|
onClick: () => {
|
|
@@ -12131,7 +11989,7 @@ var StepperBar = ({
|
|
|
12131
11989
|
);
|
|
12132
11990
|
}) }),
|
|
12133
11991
|
currentStep !== numberOfSteps && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "flex-row-2 flex-[2] justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
12134
|
-
|
|
11992
|
+
Button,
|
|
12135
11993
|
{
|
|
12136
11994
|
onClick: () => update(currentStep + 1),
|
|
12137
11995
|
className: "flex-row-1 items-center justify-center",
|
|
@@ -12143,7 +12001,7 @@ var StepperBar = ({
|
|
|
12143
12001
|
}
|
|
12144
12002
|
) }),
|
|
12145
12003
|
currentStep === numberOfSteps && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "flex-row-2 flex-[2] justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
12146
|
-
|
|
12004
|
+
Button,
|
|
12147
12005
|
{
|
|
12148
12006
|
disabled: disabledSteps.has(currentStep),
|
|
12149
12007
|
onClick: onFinish,
|
|
@@ -12304,10 +12162,11 @@ var PropertyBase = ({
|
|
|
12304
12162
|
input({ softRequired, hasValue }),
|
|
12305
12163
|
requiredAndNoValue && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "text-warning", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react13.AlertTriangle, { size: 24 }) }),
|
|
12306
12164
|
onRemove && !readOnly && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12307
|
-
|
|
12165
|
+
Button,
|
|
12308
12166
|
{
|
|
12309
12167
|
onClick: onRemove,
|
|
12310
12168
|
color: "negative",
|
|
12169
|
+
coloringStyle: "text",
|
|
12311
12170
|
className: (0, import_clsx37.default)("items-center"),
|
|
12312
12171
|
disabled: !hasValue,
|
|
12313
12172
|
children: translation("remove")
|
|
@@ -12320,7 +12179,7 @@ var PropertyBase = ({
|
|
|
12320
12179
|
};
|
|
12321
12180
|
|
|
12322
12181
|
// src/components/properties/CheckboxProperty.tsx
|
|
12323
|
-
var
|
|
12182
|
+
var import_react35 = require("react");
|
|
12324
12183
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
12325
12184
|
var CheckboxProperty = ({
|
|
12326
12185
|
value,
|
|
@@ -12329,7 +12188,7 @@ var CheckboxProperty = ({
|
|
|
12329
12188
|
...baseProps
|
|
12330
12189
|
}) => {
|
|
12331
12190
|
const translation = useHightideTranslation();
|
|
12332
|
-
const id = (0,
|
|
12191
|
+
const id = (0, import_react35.useId)();
|
|
12333
12192
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12334
12193
|
PropertyBase,
|
|
12335
12194
|
{
|
|
@@ -12459,40 +12318,52 @@ var NumberProperty = ({
|
|
|
12459
12318
|
onRemove,
|
|
12460
12319
|
hasValue,
|
|
12461
12320
|
icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react17.Binary, { size: 24 }),
|
|
12462
|
-
input: ({ softRequired }) =>
|
|
12463
|
-
|
|
12464
|
-
|
|
12465
|
-
|
|
12466
|
-
|
|
12467
|
-
|
|
12468
|
-
|
|
12469
|
-
|
|
12470
|
-
|
|
12471
|
-
|
|
12472
|
-
|
|
12473
|
-
|
|
12474
|
-
|
|
12475
|
-
|
|
12476
|
-
|
|
12477
|
-
|
|
12478
|
-
|
|
12479
|
-
|
|
12480
|
-
|
|
12481
|
-
|
|
12482
|
-
|
|
12483
|
-
|
|
12484
|
-
|
|
12485
|
-
|
|
12486
|
-
|
|
12487
|
-
|
|
12488
|
-
|
|
12321
|
+
input: ({ softRequired }) => (
|
|
12322
|
+
// TODO this max width might be to low for some numbers
|
|
12323
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
12324
|
+
"div",
|
|
12325
|
+
{
|
|
12326
|
+
className: (0, import_clsx40.default)("relative flex-row-2 max-w-56", { "text-warning": softRequired && !hasValue }),
|
|
12327
|
+
children: [
|
|
12328
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12329
|
+
Input,
|
|
12330
|
+
{
|
|
12331
|
+
className: (0, import_clsx40.default)("!ring-0 !border-0 !outline-0 !py-0 pl-0 pr-8 !m-0 !shadow-none !rounded-none w-full", { "bg-surface-warning placeholder-warning": softRequired && !hasValue }),
|
|
12332
|
+
value: value?.toString() ?? "",
|
|
12333
|
+
type: "number",
|
|
12334
|
+
readOnly,
|
|
12335
|
+
placeholder: `${translation("value")}...`,
|
|
12336
|
+
onChangeText: (value2) => {
|
|
12337
|
+
const numberValue = parseFloat(value2);
|
|
12338
|
+
if (isNaN(numberValue)) {
|
|
12339
|
+
onRemove();
|
|
12340
|
+
} else {
|
|
12341
|
+
onChange?.(numberValue);
|
|
12342
|
+
}
|
|
12343
|
+
},
|
|
12344
|
+
onEditCompleted: (value2) => {
|
|
12345
|
+
const numberValue = parseFloat(value2);
|
|
12346
|
+
if (isNaN(numberValue)) {
|
|
12347
|
+
onRemove();
|
|
12348
|
+
} else {
|
|
12349
|
+
onEditComplete(numberValue);
|
|
12350
|
+
}
|
|
12489
12351
|
}
|
|
12490
12352
|
}
|
|
12491
|
-
|
|
12492
|
-
|
|
12493
|
-
|
|
12494
|
-
|
|
12495
|
-
|
|
12353
|
+
),
|
|
12354
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12355
|
+
"span",
|
|
12356
|
+
{
|
|
12357
|
+
className: (0, import_clsx40.default)(
|
|
12358
|
+
"absolute top-1/2 -translate-y-1/2 right-2",
|
|
12359
|
+
{ "bg-surface-warning": softRequired && !hasValue }
|
|
12360
|
+
),
|
|
12361
|
+
children: suffix
|
|
12362
|
+
}
|
|
12363
|
+
)
|
|
12364
|
+
]
|
|
12365
|
+
}
|
|
12366
|
+
)
|
|
12496
12367
|
)
|
|
12497
12368
|
}
|
|
12498
12369
|
);
|
|
@@ -12543,10 +12414,10 @@ var import_lucide_react19 = require("lucide-react");
|
|
|
12543
12414
|
var import_clsx43 = __toESM(require("clsx"));
|
|
12544
12415
|
|
|
12545
12416
|
// src/components/user-action/Textarea.tsx
|
|
12546
|
-
var
|
|
12417
|
+
var import_react36 = require("react");
|
|
12547
12418
|
var import_clsx42 = __toESM(require("clsx"));
|
|
12548
12419
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
12549
|
-
var Textarea = (0,
|
|
12420
|
+
var Textarea = (0, import_react36.forwardRef)(function Textarea2({
|
|
12550
12421
|
id,
|
|
12551
12422
|
onChange,
|
|
12552
12423
|
onChangeText,
|
|
@@ -12620,7 +12491,7 @@ var TextareaWithHeadline = ({
|
|
|
12620
12491
|
containerClassName,
|
|
12621
12492
|
...props
|
|
12622
12493
|
}) => {
|
|
12623
|
-
const genId = (0,
|
|
12494
|
+
const genId = (0, import_react36.useId)();
|
|
12624
12495
|
const usedId = id ?? genId;
|
|
12625
12496
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
12626
12497
|
"div",
|
|
@@ -12726,10 +12597,9 @@ var TableFilters = {
|
|
|
12726
12597
|
};
|
|
12727
12598
|
|
|
12728
12599
|
// src/components/table/Table.tsx
|
|
12729
|
-
var
|
|
12600
|
+
var import_react42 = require("react");
|
|
12730
12601
|
var import_clsx48 = __toESM(require("clsx"));
|
|
12731
12602
|
var import_react_table = require("@tanstack/react-table");
|
|
12732
|
-
var import_react_custom_scrollbars_23 = require("react-custom-scrollbars-2");
|
|
12733
12603
|
|
|
12734
12604
|
// src/components/table/TableCell.tsx
|
|
12735
12605
|
var import_clsx45 = require("clsx");
|
|
@@ -12742,9 +12612,9 @@ var TableCell = ({
|
|
|
12742
12612
|
};
|
|
12743
12613
|
|
|
12744
12614
|
// src/hooks/useResizeCallbackWrapper.ts
|
|
12745
|
-
var
|
|
12615
|
+
var import_react37 = require("react");
|
|
12746
12616
|
var useResizeCallbackWrapper = (callback) => {
|
|
12747
|
-
(0,
|
|
12617
|
+
(0, import_react37.useEffect)(() => {
|
|
12748
12618
|
window.addEventListener("resize", callback);
|
|
12749
12619
|
return () => {
|
|
12750
12620
|
window.removeEventListener("resize", callback);
|
|
@@ -12760,6 +12630,7 @@ var TableSortButton = ({
|
|
|
12760
12630
|
sortDirection,
|
|
12761
12631
|
invert = false,
|
|
12762
12632
|
color = "neutral",
|
|
12633
|
+
size = "tiny",
|
|
12763
12634
|
className,
|
|
12764
12635
|
...buttonProps
|
|
12765
12636
|
}) => {
|
|
@@ -12772,10 +12643,11 @@ var TableSortButton = ({
|
|
|
12772
12643
|
icon = usedSortDirection === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react20.ChevronUp, { className: "w-full h-full" }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react20.ChevronDown, { className: "w-full h-full" });
|
|
12773
12644
|
}
|
|
12774
12645
|
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
12775
|
-
|
|
12646
|
+
Button,
|
|
12776
12647
|
{
|
|
12777
|
-
|
|
12648
|
+
layout: "icon",
|
|
12778
12649
|
color,
|
|
12650
|
+
size,
|
|
12779
12651
|
className: (0, import_clsx46.default)(className),
|
|
12780
12652
|
...buttonProps,
|
|
12781
12653
|
children: icon
|
|
@@ -12787,7 +12659,7 @@ var TableSortButton = ({
|
|
|
12787
12659
|
var import_lucide_react21 = require("lucide-react");
|
|
12788
12660
|
|
|
12789
12661
|
// src/components/user-action/Menu.tsx
|
|
12790
|
-
var
|
|
12662
|
+
var import_react40 = require("react");
|
|
12791
12663
|
var import_clsx47 = __toESM(require("clsx"));
|
|
12792
12664
|
|
|
12793
12665
|
// src/utils/bagFunctions.ts
|
|
@@ -12859,15 +12731,15 @@ var usePopoverPosition = (trigger, options) => {
|
|
|
12859
12731
|
};
|
|
12860
12732
|
|
|
12861
12733
|
// src/hooks/useHoverState.ts
|
|
12862
|
-
var
|
|
12734
|
+
var import_react38 = require("react");
|
|
12863
12735
|
var defaultUseHoverStateProps = {
|
|
12864
12736
|
closingDelay: 200,
|
|
12865
12737
|
isDisabled: false
|
|
12866
12738
|
};
|
|
12867
12739
|
var useHoverState = (props = void 0) => {
|
|
12868
12740
|
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
12869
|
-
const [isHovered, setIsHovered] = (0,
|
|
12870
|
-
const [timer, setTimer] = (0,
|
|
12741
|
+
const [isHovered, setIsHovered] = (0, import_react38.useState)(false);
|
|
12742
|
+
const [timer, setTimer] = (0, import_react38.useState)();
|
|
12871
12743
|
const onMouseEnter = () => {
|
|
12872
12744
|
if (isDisabled) {
|
|
12873
12745
|
return;
|
|
@@ -12883,14 +12755,14 @@ var useHoverState = (props = void 0) => {
|
|
|
12883
12755
|
setIsHovered(false);
|
|
12884
12756
|
}, closingDelay));
|
|
12885
12757
|
};
|
|
12886
|
-
(0,
|
|
12758
|
+
(0, import_react38.useEffect)(() => {
|
|
12887
12759
|
if (timer) {
|
|
12888
12760
|
return () => {
|
|
12889
12761
|
clearTimeout(timer);
|
|
12890
12762
|
};
|
|
12891
12763
|
}
|
|
12892
12764
|
});
|
|
12893
|
-
(0,
|
|
12765
|
+
(0, import_react38.useEffect)(() => {
|
|
12894
12766
|
if (timer) {
|
|
12895
12767
|
clearTimeout(timer);
|
|
12896
12768
|
}
|
|
@@ -12903,9 +12775,9 @@ var useHoverState = (props = void 0) => {
|
|
|
12903
12775
|
};
|
|
12904
12776
|
|
|
12905
12777
|
// src/hooks/useOutsideClick.ts
|
|
12906
|
-
var
|
|
12778
|
+
var import_react39 = require("react");
|
|
12907
12779
|
var useOutsideClick = (refs, handler) => {
|
|
12908
|
-
(0,
|
|
12780
|
+
(0, import_react39.useEffect)(() => {
|
|
12909
12781
|
const listener = (event) => {
|
|
12910
12782
|
if (event.target === null) return;
|
|
12911
12783
|
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
@@ -12963,10 +12835,10 @@ var Menu = ({
|
|
|
12963
12835
|
menuClassName = ""
|
|
12964
12836
|
}) => {
|
|
12965
12837
|
const { isHovered: isOpen, setIsHovered: setIsOpen } = useHoverState({ isDisabled: !showOnHover || disabled });
|
|
12966
|
-
const triggerRef = (0,
|
|
12967
|
-
const menuRef = (0,
|
|
12838
|
+
const triggerRef = (0, import_react40.useRef)(null);
|
|
12839
|
+
const menuRef = (0, import_react40.useRef)(null);
|
|
12968
12840
|
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
12969
|
-
const [isHidden, setIsHidden] = (0,
|
|
12841
|
+
const [isHidden, setIsHidden] = (0, import_react40.useState)(true);
|
|
12970
12842
|
const bag = {
|
|
12971
12843
|
isOpen,
|
|
12972
12844
|
close: () => setIsOpen(false),
|
|
@@ -12977,7 +12849,7 @@ var Menu = ({
|
|
|
12977
12849
|
triggerRef.current?.getBoundingClientRect(),
|
|
12978
12850
|
{ verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
|
|
12979
12851
|
);
|
|
12980
|
-
(0,
|
|
12852
|
+
(0, import_react40.useEffect)(() => {
|
|
12981
12853
|
if (!isOpen) return;
|
|
12982
12854
|
const triggerEl = triggerRef.current;
|
|
12983
12855
|
if (!triggerEl) return;
|
|
@@ -12994,11 +12866,12 @@ var Menu = ({
|
|
|
12994
12866
|
window.removeEventListener("resize", close);
|
|
12995
12867
|
};
|
|
12996
12868
|
}, [isOpen, setIsOpen]);
|
|
12997
|
-
(0,
|
|
12869
|
+
(0, import_react40.useEffect)(() => {
|
|
12998
12870
|
if (isOpen) {
|
|
12999
12871
|
setIsHidden(false);
|
|
13000
12872
|
}
|
|
13001
12873
|
}, [isOpen]);
|
|
12874
|
+
const zIndex = useZIndexRegister(isOpen);
|
|
13002
12875
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
|
|
13003
12876
|
trigger(bag, triggerRef),
|
|
13004
12877
|
(0, import_react_dom4.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
@@ -13021,7 +12894,8 @@ var Menu = ({
|
|
|
13021
12894
|
}
|
|
13022
12895
|
},
|
|
13023
12896
|
style: {
|
|
13024
|
-
...menuPosition
|
|
12897
|
+
...menuPosition,
|
|
12898
|
+
zIndex
|
|
13025
12899
|
},
|
|
13026
12900
|
children: BagFunctionUtil.resolve(children, bag)
|
|
13027
12901
|
}
|
|
@@ -13030,7 +12904,7 @@ var Menu = ({
|
|
|
13030
12904
|
};
|
|
13031
12905
|
|
|
13032
12906
|
// src/components/table/TableFilterButton.tsx
|
|
13033
|
-
var
|
|
12907
|
+
var import_react41 = require("react");
|
|
13034
12908
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
13035
12909
|
var TableFilterButton = ({
|
|
13036
12910
|
filterType,
|
|
@@ -13038,16 +12912,25 @@ var TableFilterButton = ({
|
|
|
13038
12912
|
}) => {
|
|
13039
12913
|
const translation = useHightideTranslation();
|
|
13040
12914
|
const columnFilterValue = column.getFilterValue();
|
|
13041
|
-
const [filterValue, setFilterValue] = (0,
|
|
12915
|
+
const [filterValue, setFilterValue] = (0, import_react41.useState)(columnFilterValue);
|
|
13042
12916
|
const hasFilter = !!filterValue;
|
|
13043
|
-
(0,
|
|
12917
|
+
(0, import_react41.useEffect)(() => {
|
|
13044
12918
|
setFilterValue(columnFilterValue);
|
|
13045
12919
|
}, [columnFilterValue]);
|
|
13046
12920
|
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13047
12921
|
Menu,
|
|
13048
12922
|
{
|
|
13049
12923
|
trigger: ({ toggleOpen }, ref) => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { ref, className: "relative", children: [
|
|
13050
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
12924
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
12925
|
+
Button,
|
|
12926
|
+
{
|
|
12927
|
+
layout: "icon",
|
|
12928
|
+
color: "neutral",
|
|
12929
|
+
size: "tiny",
|
|
12930
|
+
onClick: toggleOpen,
|
|
12931
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_lucide_react21.FilterIcon, {})
|
|
12932
|
+
}
|
|
12933
|
+
),
|
|
13051
12934
|
hasFilter && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13052
12935
|
"div",
|
|
13053
12936
|
{
|
|
@@ -13126,11 +13009,11 @@ var TableFilterButton = ({
|
|
|
13126
13009
|
)
|
|
13127
13010
|
] }),
|
|
13128
13011
|
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex-row-2 justify-end w-full", children: [
|
|
13129
|
-
hasFilter && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13012
|
+
hasFilter && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Button, { color: "negative", size: "small", onClick: () => {
|
|
13130
13013
|
column.setFilterValue(void 0);
|
|
13131
13014
|
close();
|
|
13132
13015
|
}, children: translation("remove") }),
|
|
13133
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13016
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Button, { size: "small", onClick: () => {
|
|
13134
13017
|
column.setFilterValue(filterValue);
|
|
13135
13018
|
close();
|
|
13136
13019
|
}, children: translation("apply") })
|
|
@@ -13149,27 +13032,28 @@ var Table = ({
|
|
|
13149
13032
|
onRowClick,
|
|
13150
13033
|
className,
|
|
13151
13034
|
tableClassName,
|
|
13035
|
+
tableContainerClassName,
|
|
13152
13036
|
defaultColumn,
|
|
13153
13037
|
state,
|
|
13154
13038
|
columns,
|
|
13155
13039
|
...tableOptions
|
|
13156
13040
|
}) => {
|
|
13157
|
-
const ref = (0,
|
|
13158
|
-
const tableRef = (0,
|
|
13159
|
-
const [columnSizing, setColumnSizing] = (0,
|
|
13041
|
+
const ref = (0, import_react42.useRef)(null);
|
|
13042
|
+
const tableRef = (0, import_react42.useRef)(null);
|
|
13043
|
+
const [columnSizing, setColumnSizing] = (0, import_react42.useState)(columns.reduce((previousValue, currentValue) => {
|
|
13160
13044
|
return {
|
|
13161
13045
|
...previousValue,
|
|
13162
13046
|
[currentValue.id]: currentValue.minSize ?? defaultColumn.minSize
|
|
13163
13047
|
};
|
|
13164
13048
|
}, {}));
|
|
13165
|
-
const [columnSizingInfo, setColumnSizingInfo] = (0,
|
|
13166
|
-
const [pagination, setPagination] = (0,
|
|
13049
|
+
const [columnSizingInfo, setColumnSizingInfo] = (0, import_react42.useState)();
|
|
13050
|
+
const [pagination, setPagination] = (0, import_react42.useState)({
|
|
13167
13051
|
pageSize: 10,
|
|
13168
13052
|
pageIndex: 0,
|
|
13169
13053
|
...initialState?.pagination
|
|
13170
13054
|
});
|
|
13171
|
-
const [columnFilters, setColumnFilters] = (0,
|
|
13172
|
-
const computedColumnMinWidths = (0,
|
|
13055
|
+
const [columnFilters, setColumnFilters] = (0, import_react42.useState)(initialState?.columnFilters);
|
|
13056
|
+
const computedColumnMinWidths = (0, import_react42.useMemo)(() => {
|
|
13173
13057
|
return columns.reduce((previousValue, column) => {
|
|
13174
13058
|
return {
|
|
13175
13059
|
...previousValue,
|
|
@@ -13178,7 +13062,7 @@ var Table = ({
|
|
|
13178
13062
|
};
|
|
13179
13063
|
}, {});
|
|
13180
13064
|
}, [columns, defaultColumn]);
|
|
13181
|
-
const computedColumnMaxWidths = (0,
|
|
13065
|
+
const computedColumnMaxWidths = (0, import_react42.useMemo)(() => {
|
|
13182
13066
|
return columns.reduce((previousValue, column) => {
|
|
13183
13067
|
return {
|
|
13184
13068
|
...previousValue,
|
|
@@ -13186,12 +13070,12 @@ var Table = ({
|
|
|
13186
13070
|
};
|
|
13187
13071
|
}, {});
|
|
13188
13072
|
}, [columns, defaultColumn]);
|
|
13189
|
-
const tableMinWidth = (0,
|
|
13073
|
+
const tableMinWidth = (0, import_react42.useMemo)(() => {
|
|
13190
13074
|
return columns.reduce((sum, column) => {
|
|
13191
13075
|
return sum + computedColumnMinWidths[column.id];
|
|
13192
13076
|
}, 0);
|
|
13193
13077
|
}, [columns, computedColumnMinWidths]);
|
|
13194
|
-
const updateColumnSizes = (0,
|
|
13078
|
+
const updateColumnSizes = (0, import_react42.useMemo)(() => {
|
|
13195
13079
|
return (previous) => {
|
|
13196
13080
|
const updateSizing = {
|
|
13197
13081
|
...columnSizing,
|
|
@@ -13308,18 +13192,18 @@ var Table = ({
|
|
|
13308
13192
|
columnResizeMode: "onChange",
|
|
13309
13193
|
...tableOptions
|
|
13310
13194
|
});
|
|
13311
|
-
const [hasInitializedSizing, setHasInitializedSizing] = (0,
|
|
13312
|
-
(0,
|
|
13195
|
+
const [hasInitializedSizing, setHasInitializedSizing] = (0, import_react42.useState)(false);
|
|
13196
|
+
(0, import_react42.useEffect)(() => {
|
|
13313
13197
|
if (!hasInitializedSizing && ref.current) {
|
|
13314
13198
|
setHasInitializedSizing(true);
|
|
13315
13199
|
table.setColumnSizing(updateColumnSizes(columnSizing));
|
|
13316
13200
|
}
|
|
13317
13201
|
}, [columnSizing, hasInitializedSizing]);
|
|
13318
|
-
useResizeCallbackWrapper((0,
|
|
13202
|
+
useResizeCallbackWrapper((0, import_react42.useCallback)(() => {
|
|
13319
13203
|
table.setColumnSizing(updateColumnSizes);
|
|
13320
13204
|
}, [updateColumnSizes]));
|
|
13321
13205
|
const pageCount = table.getPageCount();
|
|
13322
|
-
(0,
|
|
13206
|
+
(0, import_react42.useEffect)(() => {
|
|
13323
13207
|
const totalPages = pageCount;
|
|
13324
13208
|
if (totalPages === 0) {
|
|
13325
13209
|
if (pagination.pageIndex !== 0) {
|
|
@@ -13335,7 +13219,7 @@ var Table = ({
|
|
|
13335
13219
|
}));
|
|
13336
13220
|
}
|
|
13337
13221
|
}, [data, pageCount, pagination.pageSize, pagination.pageIndex]);
|
|
13338
|
-
const columnSizeVars = (0,
|
|
13222
|
+
const columnSizeVars = (0, import_react42.useMemo)(() => {
|
|
13339
13223
|
const headers = table.getFlatHeaders();
|
|
13340
13224
|
const colSizes = {};
|
|
13341
13225
|
for (let i = 0; i < headers.length; i++) {
|
|
@@ -13345,125 +13229,115 @@ var Table = ({
|
|
|
13345
13229
|
}
|
|
13346
13230
|
return colSizes;
|
|
13347
13231
|
}, [table.getState().columnSizingInfo, table.getState().columnSizing]);
|
|
13348
|
-
console.log(table.getState().sorting);
|
|
13349
13232
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { ref, className: (0, import_clsx48.default)("flex-col-4", className), children: [
|
|
13350
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13351
|
-
|
|
13233
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: (0, import_clsx48.default)("flex-col-0 w-full overflow-auto", tableContainerClassName), children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
13234
|
+
"table",
|
|
13352
13235
|
{
|
|
13353
|
-
|
|
13354
|
-
|
|
13355
|
-
|
|
13356
|
-
|
|
13357
|
-
|
|
13358
|
-
|
|
13359
|
-
|
|
13360
|
-
|
|
13361
|
-
|
|
13362
|
-
|
|
13363
|
-
|
|
13236
|
+
ref: tableRef,
|
|
13237
|
+
className: (0, import_clsx48.default)(tableClassName),
|
|
13238
|
+
style: {
|
|
13239
|
+
...columnSizeVars,
|
|
13240
|
+
width: Math.floor(Math.max(table.getTotalSize() - columns.length, ref.current?.offsetWidth ?? table.getTotalSize()))
|
|
13241
|
+
},
|
|
13242
|
+
children: [
|
|
13243
|
+
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("colgroup", { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13244
|
+
"col",
|
|
13245
|
+
{
|
|
13246
|
+
style: {
|
|
13247
|
+
width: `calc(var(--header-${header?.id}-size) * 1px)`,
|
|
13248
|
+
minWidth: header.column.columnDef.minSize,
|
|
13249
|
+
maxWidth: header.column.columnDef.maxSize
|
|
13250
|
+
}
|
|
13364
13251
|
},
|
|
13365
|
-
|
|
13366
|
-
|
|
13367
|
-
|
|
13368
|
-
|
|
13369
|
-
|
|
13370
|
-
|
|
13371
|
-
|
|
13372
|
-
|
|
13373
|
-
|
|
13374
|
-
|
|
13375
|
-
|
|
13376
|
-
|
|
13377
|
-
|
|
13378
|
-
|
|
13379
|
-
|
|
13380
|
-
|
|
13381
|
-
|
|
13382
|
-
|
|
13383
|
-
|
|
13384
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "flex-row-2 w-full", children: header.isPlaceholder ? null : /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex-row-1 items-center", children: [
|
|
13385
|
-
header.column.getCanSort() && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13386
|
-
TableSortButton,
|
|
13387
|
-
{
|
|
13388
|
-
sortDirection: header.column.getIsSorted(),
|
|
13389
|
-
onClick: () => {
|
|
13390
|
-
const sorted = header.column.getIsSorted();
|
|
13391
|
-
const isMulti = header.column.getCanMultiSort();
|
|
13392
|
-
console.log(isMulti, header.column.id);
|
|
13393
|
-
if (!isMulti) {
|
|
13394
|
-
table.resetSorting();
|
|
13395
|
-
}
|
|
13396
|
-
if (!sorted) {
|
|
13397
|
-
header.column.toggleSorting(true, isMulti);
|
|
13398
|
-
return;
|
|
13399
|
-
} else if (sorted === "desc") {
|
|
13400
|
-
header.column.toggleSorting(false, isMulti);
|
|
13401
|
-
}
|
|
13402
|
-
if (sorted === "asc") {
|
|
13403
|
-
header.column.clearSorting();
|
|
13404
|
-
}
|
|
13405
|
-
}
|
|
13252
|
+
header.id
|
|
13253
|
+
)) }, headerGroup.id)),
|
|
13254
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("tr", { className: table.options.meta?.headerRowClassName, children: headerGroup.headers.map((header) => {
|
|
13255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
13256
|
+
"th",
|
|
13257
|
+
{
|
|
13258
|
+
colSpan: header.colSpan,
|
|
13259
|
+
className: (0, import_clsx48.default)("relative group", header.column.columnDef.meta?.className),
|
|
13260
|
+
children: [
|
|
13261
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "flex-row-2 w-full", children: header.isPlaceholder ? null : /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex-row-1 items-center", children: [
|
|
13262
|
+
header.column.getCanSort() && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13263
|
+
TableSortButton,
|
|
13264
|
+
{
|
|
13265
|
+
sortDirection: header.column.getIsSorted(),
|
|
13266
|
+
onClick: () => {
|
|
13267
|
+
const sorted = header.column.getIsSorted();
|
|
13268
|
+
const isMulti = header.column.getCanMultiSort();
|
|
13269
|
+
if (!isMulti) {
|
|
13270
|
+
table.resetSorting();
|
|
13406
13271
|
}
|
|
13407
|
-
|
|
13408
|
-
|
|
13409
|
-
|
|
13410
|
-
{
|
|
13411
|
-
|
|
13412
|
-
filterType: header.column.columnDef.meta.filterType
|
|
13272
|
+
if (!sorted) {
|
|
13273
|
+
header.column.toggleSorting(true, isMulti);
|
|
13274
|
+
return;
|
|
13275
|
+
} else if (sorted === "desc") {
|
|
13276
|
+
header.column.toggleSorting(false, isMulti);
|
|
13413
13277
|
}
|
|
13414
|
-
|
|
13415
|
-
|
|
13416
|
-
header.column.columnDef.header,
|
|
13417
|
-
header.getContext()
|
|
13418
|
-
)
|
|
13419
|
-
] }) }),
|
|
13420
|
-
header.column.getCanResize() && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13421
|
-
"div",
|
|
13422
|
-
{
|
|
13423
|
-
onMouseDown: header.getResizeHandler(),
|
|
13424
|
-
onTouchStart: header.getResizeHandler(),
|
|
13425
|
-
onDoubleClick: () => {
|
|
13426
|
-
header.column.resetSize();
|
|
13427
|
-
},
|
|
13428
|
-
className: "table-resize-indicator w-2 rounded bg-primary cursor-col-resize select-none touch-none opacity-0 group-hover:opacity-100 transition-opacity",
|
|
13429
|
-
style: {
|
|
13430
|
-
opacity: !columnSizingInfo?.columnSizingStart ? void 0 : columnSizingInfo?.columnSizingStart?.findIndex(([id, _]) => id === header.column.id) !== -1 ? 1 : columnSizingInfo?.columnSizingStart?.length !== 0 ? 0 : void 0
|
|
13278
|
+
if (sorted === "asc") {
|
|
13279
|
+
header.column.clearSorting();
|
|
13431
13280
|
}
|
|
13432
13281
|
}
|
|
13433
|
-
|
|
13434
|
-
|
|
13435
|
-
|
|
13436
|
-
|
|
13437
|
-
|
|
13438
|
-
|
|
13439
|
-
|
|
13440
|
-
|
|
13441
|
-
|
|
13442
|
-
|
|
13282
|
+
}
|
|
13283
|
+
),
|
|
13284
|
+
header.column.getCanFilter() && header.column.columnDef.meta?.filterType ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13285
|
+
TableFilterButton,
|
|
13286
|
+
{
|
|
13287
|
+
column: header.column,
|
|
13288
|
+
filterType: header.column.columnDef.meta.filterType
|
|
13289
|
+
}
|
|
13290
|
+
) : null,
|
|
13291
|
+
(0, import_react_table.flexRender)(
|
|
13292
|
+
header.column.columnDef.header,
|
|
13293
|
+
header.getContext()
|
|
13294
|
+
)
|
|
13295
|
+
] }) }),
|
|
13296
|
+
header.column.getCanResize() && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13297
|
+
"div",
|
|
13443
13298
|
{
|
|
13444
|
-
|
|
13445
|
-
|
|
13446
|
-
|
|
13447
|
-
|
|
13448
|
-
|
|
13449
|
-
|
|
13450
|
-
|
|
13451
|
-
|
|
13452
|
-
|
|
13453
|
-
|
|
13454
|
-
)
|
|
13455
|
-
|
|
13456
|
-
|
|
13457
|
-
|
|
13458
|
-
|
|
13459
|
-
|
|
13460
|
-
|
|
13461
|
-
|
|
13462
|
-
|
|
13463
|
-
|
|
13464
|
-
|
|
13299
|
+
onMouseDown: header.getResizeHandler(),
|
|
13300
|
+
onTouchStart: header.getResizeHandler(),
|
|
13301
|
+
onDoubleClick: () => {
|
|
13302
|
+
header.column.resetSize();
|
|
13303
|
+
},
|
|
13304
|
+
className: "table-resize-indicator w-2 rounded bg-primary cursor-col-resize select-none touch-none opacity-0 group-hover:opacity-100 transition-opacity",
|
|
13305
|
+
style: {
|
|
13306
|
+
opacity: !columnSizingInfo?.columnSizingStart ? void 0 : columnSizingInfo?.columnSizingStart?.findIndex(([id, _]) => id === header.column.id) !== -1 ? 1 : columnSizingInfo?.columnSizingStart?.length !== 0 ? 0 : void 0
|
|
13307
|
+
}
|
|
13308
|
+
}
|
|
13309
|
+
)
|
|
13310
|
+
]
|
|
13311
|
+
},
|
|
13312
|
+
header.id
|
|
13313
|
+
);
|
|
13314
|
+
}) }, headerGroup.id)) }),
|
|
13315
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("tbody", { children: [
|
|
13316
|
+
table.getRowModel().rows.map((row) => {
|
|
13317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13318
|
+
"tr",
|
|
13319
|
+
{
|
|
13320
|
+
onClick: () => onRowClick?.(row, table),
|
|
13321
|
+
className: table.options.meta?.bodyRowClassName,
|
|
13322
|
+
children: row.getVisibleCells().map((cell) => {
|
|
13323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("td", { children: (0, import_react_table.flexRender)(
|
|
13324
|
+
cell.column.columnDef.cell,
|
|
13325
|
+
cell.getContext()
|
|
13326
|
+
) }, cell.id);
|
|
13327
|
+
})
|
|
13328
|
+
},
|
|
13329
|
+
row.id
|
|
13330
|
+
);
|
|
13331
|
+
}),
|
|
13332
|
+
range(table.getState().pagination.pageSize - table.getRowModel().rows.length, { allowEmptyRange: true }).map((row, index) => {
|
|
13333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("tr", { children: columns.map((column) => {
|
|
13334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("td", { children: fillerRow ? fillerRow(column.id, table) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FillerRowElement, {}) }, column.id);
|
|
13335
|
+
}) }, "filler-row-" + index);
|
|
13336
|
+
})
|
|
13337
|
+
] })
|
|
13338
|
+
]
|
|
13465
13339
|
}
|
|
13466
|
-
),
|
|
13340
|
+
) }),
|
|
13467
13341
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "flex-row-2 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13468
13342
|
Pagination,
|
|
13469
13343
|
{
|
|
@@ -13495,7 +13369,7 @@ var TableWithSelection = ({
|
|
|
13495
13369
|
meta,
|
|
13496
13370
|
...props
|
|
13497
13371
|
}) => {
|
|
13498
|
-
const columnsWithSelection = (0,
|
|
13372
|
+
const columnsWithSelection = (0, import_react42.useMemo)(() => {
|
|
13499
13373
|
return [
|
|
13500
13374
|
{
|
|
13501
13375
|
id: selectionRowId,
|
|
@@ -13564,7 +13438,7 @@ var TableWithSelection = ({
|
|
|
13564
13438
|
};
|
|
13565
13439
|
|
|
13566
13440
|
// src/components/user-action/CopyToClipboardWrapper.tsx
|
|
13567
|
-
var
|
|
13441
|
+
var import_react43 = require("react");
|
|
13568
13442
|
var import_clsx49 = require("clsx");
|
|
13569
13443
|
|
|
13570
13444
|
// src/utils/writeToClipboard.ts
|
|
@@ -13584,8 +13458,8 @@ var CopyToClipboardWrapper = ({
|
|
|
13584
13458
|
zIndex = 10
|
|
13585
13459
|
}) => {
|
|
13586
13460
|
const translation = useHightideTranslation();
|
|
13587
|
-
const [isShowingIndication, setIsShowingIndication] = (0,
|
|
13588
|
-
const [isShowingConfirmation, setIsShowingConfirmation] = (0,
|
|
13461
|
+
const [isShowingIndication, setIsShowingIndication] = (0, import_react43.useState)(false);
|
|
13462
|
+
const [isShowingConfirmation, setIsShowingConfirmation] = (0, import_react43.useState)(false);
|
|
13589
13463
|
const positionClasses = {
|
|
13590
13464
|
top: `bottom-full left-1/2 -translate-x-1/2 mb-[6px]`,
|
|
13591
13465
|
bottom: `top-full left-1/2 -translate-x-1/2 mt-[6px]`,
|
|
@@ -13685,8 +13559,8 @@ var DateTimePicker = ({
|
|
|
13685
13559
|
DatePicker,
|
|
13686
13560
|
{
|
|
13687
13561
|
...datePickerProps,
|
|
13688
|
-
className: "min-w-
|
|
13689
|
-
yearMonthPickerProps: {
|
|
13562
|
+
className: "min-w-80 min-h-71 max-h-71",
|
|
13563
|
+
yearMonthPickerProps: { className: "h-full grow" },
|
|
13690
13564
|
value,
|
|
13691
13565
|
start,
|
|
13692
13566
|
end,
|
|
@@ -13699,8 +13573,7 @@ var DateTimePicker = ({
|
|
|
13699
13573
|
TimePicker,
|
|
13700
13574
|
{
|
|
13701
13575
|
...timePickerProps,
|
|
13702
|
-
className: (0, import_clsx50.default)("h-
|
|
13703
|
-
maxHeight: 250,
|
|
13576
|
+
className: (0, import_clsx50.default)("min-h-71 max-h-71", { "justify-between w-full": mode === "time" }),
|
|
13704
13577
|
time: value,
|
|
13705
13578
|
onChange
|
|
13706
13579
|
}
|
|
@@ -13712,9 +13585,9 @@ var DateTimePicker = ({
|
|
|
13712
13585
|
timeDisplay
|
|
13713
13586
|
] }),
|
|
13714
13587
|
/* @__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: [
|
|
13715
|
-
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
13588
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Button, { size: "medium", color: "negative", onClick: onRemove, children: translation("clear") }),
|
|
13716
13589
|
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
13717
|
-
|
|
13590
|
+
Button,
|
|
13718
13591
|
{
|
|
13719
13592
|
size: "medium",
|
|
13720
13593
|
onClick: () => onFinish?.(value),
|
|
@@ -13726,7 +13599,7 @@ var DateTimePicker = ({
|
|
|
13726
13599
|
};
|
|
13727
13600
|
|
|
13728
13601
|
// src/components/user-action/ScrollPicker.tsx
|
|
13729
|
-
var
|
|
13602
|
+
var import_react44 = require("react");
|
|
13730
13603
|
var import_clsx51 = __toESM(require("clsx"));
|
|
13731
13604
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
13732
13605
|
var up = 1;
|
|
@@ -13747,7 +13620,7 @@ var ScrollPicker = ({
|
|
|
13747
13620
|
transition,
|
|
13748
13621
|
items,
|
|
13749
13622
|
lastTimeStamp
|
|
13750
|
-
}, setAnimation] = (0,
|
|
13623
|
+
}, setAnimation] = (0, import_react44.useState)({
|
|
13751
13624
|
targetIndex: selectedIndex,
|
|
13752
13625
|
currentIndex: disabled ? selectedIndex : 0,
|
|
13753
13626
|
velocity: 0,
|
|
@@ -13763,7 +13636,7 @@ var ScrollPicker = ({
|
|
|
13763
13636
|
const itemHeight = 40;
|
|
13764
13637
|
const distance = 8;
|
|
13765
13638
|
const containerHeight = itemHeight * (itemsShownCount - 2) + distance * (itemsShownCount - 2 + 1);
|
|
13766
|
-
const getDirection = (0,
|
|
13639
|
+
const getDirection = (0, import_react44.useCallback)((targetIndex, currentIndex2, transition2, length) => {
|
|
13767
13640
|
if (targetIndex === currentIndex2) {
|
|
13768
13641
|
return transition2 > 0 ? up : down;
|
|
13769
13642
|
}
|
|
@@ -13773,7 +13646,7 @@ var ScrollPicker = ({
|
|
|
13773
13646
|
}
|
|
13774
13647
|
return distanceForward >= length / 2 ? down : up;
|
|
13775
13648
|
}, []);
|
|
13776
|
-
const animate = (0,
|
|
13649
|
+
const animate = (0, import_react44.useCallback)((timestamp, startTime) => {
|
|
13777
13650
|
setAnimation((prevState) => {
|
|
13778
13651
|
const {
|
|
13779
13652
|
targetIndex,
|
|
@@ -13846,7 +13719,7 @@ var ScrollPicker = ({
|
|
|
13846
13719
|
};
|
|
13847
13720
|
});
|
|
13848
13721
|
}, [disabled, getDirection, onChange]);
|
|
13849
|
-
(0,
|
|
13722
|
+
(0, import_react44.useEffect)(() => {
|
|
13850
13723
|
requestAnimationFrame((timestamp) => animate(timestamp, lastTimeStamp));
|
|
13851
13724
|
});
|
|
13852
13725
|
const opacity = (transition2, index, itemsCount) => {
|
|
@@ -13943,7 +13816,16 @@ var SearchBar = ({
|
|
|
13943
13816
|
placeholder: placeholder ?? translation("search")
|
|
13944
13817
|
}
|
|
13945
13818
|
),
|
|
13946
|
-
onSearch && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
13819
|
+
onSearch && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
13820
|
+
Button,
|
|
13821
|
+
{
|
|
13822
|
+
layout: "icon",
|
|
13823
|
+
color: "neutral",
|
|
13824
|
+
disabled: disableOnSearch,
|
|
13825
|
+
onClick: onSearch,
|
|
13826
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_lucide_react23.Search, { className: "w-full h-full" })
|
|
13827
|
+
}
|
|
13828
|
+
)
|
|
13947
13829
|
] });
|
|
13948
13830
|
};
|
|
13949
13831
|
|
|
@@ -13956,8 +13838,7 @@ var Tooltip = ({
|
|
|
13956
13838
|
animationDelay = 650,
|
|
13957
13839
|
tooltipClassName = "",
|
|
13958
13840
|
containerClassName = "",
|
|
13959
|
-
position = "bottom"
|
|
13960
|
-
zIndex = 10
|
|
13841
|
+
position = "bottom"
|
|
13961
13842
|
}) => {
|
|
13962
13843
|
const { isHovered, handlers } = useHoverState();
|
|
13963
13844
|
const positionClasses = {
|
|
@@ -13979,6 +13860,7 @@ var Tooltip = ({
|
|
|
13979
13860
|
left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
|
|
13980
13861
|
right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
|
|
13981
13862
|
};
|
|
13863
|
+
const zIndex = useZIndexRegister(isHovered);
|
|
13982
13864
|
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
13983
13865
|
"div",
|
|
13984
13866
|
{
|
|
@@ -14014,18 +13896,18 @@ var Tooltip = ({
|
|
|
14014
13896
|
};
|
|
14015
13897
|
|
|
14016
13898
|
// src/components/user-action/input/InsideLabelInput.tsx
|
|
14017
|
-
var import_react44 = require("react");
|
|
14018
13899
|
var import_react45 = require("react");
|
|
13900
|
+
var import_react46 = require("react");
|
|
14019
13901
|
var import_clsx54 = __toESM(require("clsx"));
|
|
14020
13902
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
14021
|
-
var InsideLabelInput = (0,
|
|
13903
|
+
var InsideLabelInput = (0, import_react46.forwardRef)(function InsideLabelInput2({
|
|
14022
13904
|
id: customId,
|
|
14023
13905
|
label,
|
|
14024
13906
|
...props
|
|
14025
13907
|
}, forwardedRef) {
|
|
14026
13908
|
const { value } = props;
|
|
14027
|
-
const [isFocused, setIsFocused] = (0,
|
|
14028
|
-
const generatedId = (0,
|
|
13909
|
+
const [isFocused, setIsFocused] = (0, import_react46.useState)(false);
|
|
13910
|
+
const generatedId = (0, import_react45.useId)();
|
|
14029
13911
|
const id = customId ?? generatedId;
|
|
14030
13912
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: (0, import_clsx54.default)("relative"), children: [
|
|
14031
13913
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
@@ -14079,20 +13961,20 @@ var InsideLabelInputUncontrolled = ({
|
|
|
14079
13961
|
};
|
|
14080
13962
|
|
|
14081
13963
|
// src/components/user-action/input/ToggleableInput.tsx
|
|
14082
|
-
var
|
|
13964
|
+
var import_react47 = require("react");
|
|
14083
13965
|
var import_lucide_react24 = require("lucide-react");
|
|
14084
13966
|
var import_clsx55 = __toESM(require("clsx"));
|
|
14085
13967
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
14086
|
-
var ToggleableInput = (0,
|
|
13968
|
+
var ToggleableInput = (0, import_react47.forwardRef)(function ToggleableInput2({
|
|
14087
13969
|
value,
|
|
14088
13970
|
initialState = "display",
|
|
14089
13971
|
editCompleteOptions,
|
|
14090
13972
|
...props
|
|
14091
13973
|
}, forwardedRef) {
|
|
14092
|
-
const [isEditing, setIsEditing] = (0,
|
|
14093
|
-
const innerRef = (0,
|
|
14094
|
-
(0,
|
|
14095
|
-
(0,
|
|
13974
|
+
const [isEditing, setIsEditing] = (0, import_react47.useState)(initialState !== "display");
|
|
13975
|
+
const innerRef = (0, import_react47.useRef)(null);
|
|
13976
|
+
(0, import_react47.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
13977
|
+
(0, import_react47.useEffect)(() => {
|
|
14096
13978
|
if (isEditing) {
|
|
14097
13979
|
innerRef.current?.focus();
|
|
14098
13980
|
}
|
|
@@ -14147,33 +14029,33 @@ var ToggleableInputUncontrolled = ({
|
|
|
14147
14029
|
};
|
|
14148
14030
|
|
|
14149
14031
|
// src/components/utils/FocusTrap.tsx
|
|
14150
|
-
var import_react47 = require("react");
|
|
14151
14032
|
var import_react48 = require("react");
|
|
14152
14033
|
var import_react49 = require("react");
|
|
14034
|
+
var import_react50 = require("react");
|
|
14153
14035
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
14154
|
-
var FocusTrap = (0,
|
|
14036
|
+
var FocusTrap = (0, import_react50.forwardRef)(function FocusTrap2({
|
|
14155
14037
|
active = true,
|
|
14156
14038
|
initialFocus,
|
|
14157
14039
|
focusFirst = false,
|
|
14158
14040
|
...props
|
|
14159
14041
|
}, forwardedRef) {
|
|
14160
|
-
const innerRef = (0,
|
|
14161
|
-
(0,
|
|
14042
|
+
const innerRef = (0, import_react48.useRef)(null);
|
|
14043
|
+
(0, import_react49.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
14162
14044
|
useFocusTrap({ container: innerRef, active, initialFocus, focusFirst });
|
|
14163
14045
|
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { ref: innerRef, ...props });
|
|
14164
14046
|
});
|
|
14165
14047
|
|
|
14166
14048
|
// src/components/utils/Transition.tsx
|
|
14167
|
-
var
|
|
14049
|
+
var import_react51 = require("react");
|
|
14168
14050
|
function Transition({
|
|
14169
14051
|
children,
|
|
14170
14052
|
show,
|
|
14171
14053
|
includeAnimation = true
|
|
14172
14054
|
}) {
|
|
14173
|
-
const [isOpen, setIsOpen] = (0,
|
|
14174
|
-
const [isTransitioning, setIsTransitioning] = (0,
|
|
14055
|
+
const [isOpen, setIsOpen] = (0, import_react51.useState)(show);
|
|
14056
|
+
const [isTransitioning, setIsTransitioning] = (0, import_react51.useState)(!isOpen);
|
|
14175
14057
|
const isUsingReducedMotion = typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : true;
|
|
14176
|
-
(0,
|
|
14058
|
+
(0, import_react51.useEffect)(() => {
|
|
14177
14059
|
setIsOpen(show);
|
|
14178
14060
|
setIsTransitioning(true);
|
|
14179
14061
|
}, [show]);
|
|
@@ -14198,7 +14080,7 @@ function Transition({
|
|
|
14198
14080
|
}
|
|
14199
14081
|
|
|
14200
14082
|
// src/hooks/focus/useFocusGuards.ts
|
|
14201
|
-
var
|
|
14083
|
+
var import_react52 = require("react");
|
|
14202
14084
|
var selectorName = "data-hw-focus-guard";
|
|
14203
14085
|
function FocusGuard() {
|
|
14204
14086
|
const element = document.createElement("div");
|
|
@@ -14236,7 +14118,7 @@ var FocusGuardsService = class _FocusGuardsService {
|
|
|
14236
14118
|
}
|
|
14237
14119
|
};
|
|
14238
14120
|
var useFocusGuards = () => {
|
|
14239
|
-
(0,
|
|
14121
|
+
(0, import_react52.useEffect)(() => {
|
|
14240
14122
|
FocusGuardsService.getInstance().add();
|
|
14241
14123
|
return () => {
|
|
14242
14124
|
FocusGuardsService.getInstance().remove();
|
|
@@ -14245,10 +14127,10 @@ var useFocusGuards = () => {
|
|
|
14245
14127
|
};
|
|
14246
14128
|
|
|
14247
14129
|
// src/hooks/focus/useFocusOnceVisible.ts
|
|
14248
|
-
var
|
|
14130
|
+
var import_react53 = __toESM(require("react"));
|
|
14249
14131
|
var useFocusOnceVisible = (ref, disable = false) => {
|
|
14250
|
-
const [hasUsedFocus, setHasUsedFocus] =
|
|
14251
|
-
(0,
|
|
14132
|
+
const [hasUsedFocus, setHasUsedFocus] = import_react53.default.useState(false);
|
|
14133
|
+
(0, import_react53.useEffect)(() => {
|
|
14252
14134
|
if (disable || hasUsedFocus) {
|
|
14253
14135
|
return;
|
|
14254
14136
|
}
|
|
@@ -14268,13 +14150,13 @@ var useFocusOnceVisible = (ref, disable = false) => {
|
|
|
14268
14150
|
};
|
|
14269
14151
|
|
|
14270
14152
|
// src/hooks/useRerender.ts
|
|
14271
|
-
var
|
|
14153
|
+
var import_react54 = require("react");
|
|
14272
14154
|
var useRerender = () => {
|
|
14273
|
-
return (0,
|
|
14155
|
+
return (0, import_react54.useReducer)(() => ({}), {})[1];
|
|
14274
14156
|
};
|
|
14275
14157
|
|
|
14276
14158
|
// src/hooks/useSearch.ts
|
|
14277
|
-
var
|
|
14159
|
+
var import_react55 = require("react");
|
|
14278
14160
|
|
|
14279
14161
|
// src/utils/simpleSearch.ts
|
|
14280
14162
|
var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
|
|
@@ -14313,34 +14195,34 @@ var useSearch = ({
|
|
|
14313
14195
|
filter,
|
|
14314
14196
|
disabled = false
|
|
14315
14197
|
}) => {
|
|
14316
|
-
const [search, setSearch] = (0,
|
|
14317
|
-
const [result, setResult] = (0,
|
|
14318
|
-
const searchTags = (0,
|
|
14319
|
-
const updateSearch = (0,
|
|
14198
|
+
const [search, setSearch] = (0, import_react55.useState)(initialSearch ?? "");
|
|
14199
|
+
const [result, setResult] = (0, import_react55.useState)(list);
|
|
14200
|
+
const searchTags = (0, import_react55.useMemo)(() => additionalSearchTags ?? [], [additionalSearchTags]);
|
|
14201
|
+
const updateSearch = (0, import_react55.useCallback)((newSearch) => {
|
|
14320
14202
|
const usedSearch = newSearch ?? search;
|
|
14321
14203
|
if (newSearch) {
|
|
14322
14204
|
setSearch(search);
|
|
14323
14205
|
}
|
|
14324
14206
|
setResult(MultiSubjectSearchWithMapping([usedSearch, ...searchTags], list, searchMapping));
|
|
14325
14207
|
}, [searchTags, list, search, searchMapping]);
|
|
14326
|
-
(0,
|
|
14208
|
+
(0, import_react55.useEffect)(() => {
|
|
14327
14209
|
if (isSearchInstant) {
|
|
14328
14210
|
setResult(MultiSubjectSearchWithMapping([search, ...searchTags], list, searchMapping));
|
|
14329
14211
|
}
|
|
14330
14212
|
}, [searchTags, isSearchInstant, list, search, searchMapping, additionalSearchTags]);
|
|
14331
|
-
const filteredResult = (0,
|
|
14213
|
+
const filteredResult = (0, import_react55.useMemo)(() => {
|
|
14332
14214
|
if (!filter) {
|
|
14333
14215
|
return result;
|
|
14334
14216
|
}
|
|
14335
14217
|
return result.filter(filter);
|
|
14336
14218
|
}, [result, filter]);
|
|
14337
|
-
const sortedAndFilteredResult = (0,
|
|
14219
|
+
const sortedAndFilteredResult = (0, import_react55.useMemo)(() => {
|
|
14338
14220
|
if (!sortingFunction) {
|
|
14339
14221
|
return filteredResult;
|
|
14340
14222
|
}
|
|
14341
14223
|
return filteredResult.sort(sortingFunction);
|
|
14342
14224
|
}, [filteredResult, sortingFunction]);
|
|
14343
|
-
const usedResult = (0,
|
|
14225
|
+
const usedResult = (0, import_react55.useMemo)(() => {
|
|
14344
14226
|
if (!disabled) {
|
|
14345
14227
|
return sortedAndFilteredResult;
|
|
14346
14228
|
}
|
|
@@ -14572,7 +14454,7 @@ var PromiseUtils = {
|
|
|
14572
14454
|
AvatarUtil,
|
|
14573
14455
|
BagFunctionUtil,
|
|
14574
14456
|
BreadCrumb,
|
|
14575
|
-
|
|
14457
|
+
Button,
|
|
14576
14458
|
ButtonUtil,
|
|
14577
14459
|
Carousel,
|
|
14578
14460
|
CarouselSlide,
|
|
@@ -14606,8 +14488,6 @@ var PromiseUtils = {
|
|
|
14606
14488
|
FormElementWrapper,
|
|
14607
14489
|
HelpwaveBadge,
|
|
14608
14490
|
HelpwaveLogo,
|
|
14609
|
-
IconButton,
|
|
14610
|
-
IconButtonUtil,
|
|
14611
14491
|
Input,
|
|
14612
14492
|
InputDialog,
|
|
14613
14493
|
InputUncontrolled,
|
|
@@ -14643,7 +14523,6 @@ var PromiseUtils = {
|
|
|
14643
14523
|
Navigation,
|
|
14644
14524
|
NavigationItemList,
|
|
14645
14525
|
NumberProperty,
|
|
14646
|
-
OutlineButton,
|
|
14647
14526
|
Pagination,
|
|
14648
14527
|
ProgressIndicator,
|
|
14649
14528
|
PromiseUtils,
|
|
@@ -14664,7 +14543,6 @@ var PromiseUtils = {
|
|
|
14664
14543
|
SimpleSearch,
|
|
14665
14544
|
SimpleSearchWithMapping,
|
|
14666
14545
|
SingleSelectProperty,
|
|
14667
|
-
SolidButton,
|
|
14668
14546
|
StepperBar,
|
|
14669
14547
|
StepperBarUncontrolled,
|
|
14670
14548
|
Tab,
|
|
@@ -14677,7 +14555,6 @@ var PromiseUtils = {
|
|
|
14677
14555
|
TableUncontrolled,
|
|
14678
14556
|
TableWithSelection,
|
|
14679
14557
|
TagIcon,
|
|
14680
|
-
TextButton,
|
|
14681
14558
|
TextImage,
|
|
14682
14559
|
TextProperty,
|
|
14683
14560
|
Textarea,
|
|
@@ -14709,7 +14586,6 @@ var PromiseUtils = {
|
|
|
14709
14586
|
equalSizeGroups,
|
|
14710
14587
|
formatDate,
|
|
14711
14588
|
formatDateTime,
|
|
14712
|
-
generateShadingColors,
|
|
14713
14589
|
getBetweenDuration,
|
|
14714
14590
|
getDaysInMonth,
|
|
14715
14591
|
getNeighbours,
|
|
@@ -14722,7 +14598,6 @@ var PromiseUtils = {
|
|
|
14722
14598
|
noop,
|
|
14723
14599
|
range,
|
|
14724
14600
|
resolveSetState,
|
|
14725
|
-
shadingColorValues,
|
|
14726
14601
|
subtractDuration,
|
|
14727
14602
|
useDelay,
|
|
14728
14603
|
useFloatingElement,
|
|
@@ -14747,6 +14622,7 @@ var PromiseUtils = {
|
|
|
14747
14622
|
useTabContext,
|
|
14748
14623
|
useTheme,
|
|
14749
14624
|
useTranslatedValidators,
|
|
14625
|
+
useZIndexRegister,
|
|
14750
14626
|
validateEmail,
|
|
14751
14627
|
weekDayList,
|
|
14752
14628
|
writeToClipboard
|