@ostack.tech/ui 0.5.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/locales/en-GB.js +4 -4
- package/dist/locales/en-GB.js.map +1 -1
- package/dist/locales/en-US.js +4 -4
- package/dist/locales/en-US.js.map +1 -1
- package/dist/locales/{fr.js → fr-FR.js} +6 -6
- package/dist/locales/fr-FR.js.map +1 -0
- package/dist/locales/{pt.js → pt-PT.js} +5 -5
- package/dist/locales/pt-PT.js.map +1 -0
- package/dist/ostack-ui.css +64 -40
- package/dist/ostack-ui.css.map +1 -1
- package/dist/ostack-ui.js +325 -273
- package/dist/ostack-ui.js.map +1 -1
- package/dist/types/components/Field/FieldContext.d.ts +2 -0
- package/dist/types/components/Field/index.d.ts +1 -1
- package/dist/types/components/IconButton/IconButton.d.ts +25 -6
- package/dist/types/components/Printer/Printer.d.ts +3 -1
- package/dist/types/components/Printer/PrinterContext.d.ts +4 -1
- package/dist/types/components/Printer/index.d.ts +1 -1
- package/dist/types/components/Table/Table.d.ts +49 -3
- package/dist/types/components/Table/TableContext.d.ts +4 -6
- package/dist/types/locales/en-GB.d.ts +1 -1
- package/dist/types/locales/en-US.d.ts +1 -1
- package/dist/types/locales/{fr.d.ts → fr-FR.d.ts} +2 -2
- package/dist/types/locales/index.d.ts +4 -4
- package/dist/types/locales/{pt.d.ts → pt-PT.d.ts} +2 -2
- package/package.json +1 -1
- package/scss/components/DataTable/_DataTable.scss +34 -38
- package/scss/components/Field/_Field.scss +11 -8
- package/scss/components/Input/_Input.scss +4 -0
- package/scss/components/Table/_Table-variables.scss +10 -0
- package/scss/components/Table/_Table.scss +21 -1
- package/dist/locales/fr.js.map +0 -1
- package/dist/locales/pt.js.map +0 -1
package/dist/ostack-ui.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { forwardRef, createContext, useContext, useCallback, useRef, useEffect, useId, useMemo, useState, memo, isValidElement, cloneElement, Fragment, Children, useImperativeHandle, startTransition, useLayoutEffect as useLayoutEffect$1, createElement, useDeferredValue, useSyncExternalStore } from "react";
|
|
1
|
+
import { forwardRef, createContext, useContext, useCallback, useRef, useEffect, useId, useMemo, useState, memo, isValidElement, cloneElement, Fragment as Fragment$1, Children, useImperativeHandle, startTransition, useLayoutEffect as useLayoutEffect$1, createElement, useDeferredValue, useSyncExternalStore } from "react";
|
|
2
2
|
import { tinykeys } from "tinykeys";
|
|
3
3
|
import fromExponential from "from-exponential";
|
|
4
4
|
import { isValid, isDate, addMonths, isAfter, isBefore, startOfMonth, setMonth, getYear, setYear, startOfYear, format, isSameYear, getMonth, max, min, lastDayOfMonth, parseISO, parse, isWithinInterval, isEqual } from "date-fns";
|
|
5
5
|
import { createStore, useStore, create } from "zustand";
|
|
6
6
|
import { shallow } from "zustand/shallow";
|
|
7
7
|
import { removeNumericFormat, numericFormatter, NumericFormat } from "react-number-format";
|
|
8
|
-
import { jsx, jsxs, Fragment
|
|
8
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
9
9
|
import { faClose, faTriangleExclamation, faCircleExclamation, faCircleCheck, faCircleInfo, faChevronUp, faChevronDown, faRedo, faCircleQuestion, faSortDown, faSortUp, faAsterisk, faMinus, faCheck, faFilter, faArrowLeft, faArrowRight, faSearch, faChevronLeft, faChevronRight, faArrowUpRightFromSquare } from "@fortawesome/free-solid-svg-icons";
|
|
10
10
|
import { ErrorBoundary as ErrorBoundary$1 } from "react-error-boundary";
|
|
11
11
|
import { useErrorBoundary } from "react-error-boundary";
|
|
12
|
-
import { AlertDialog as AlertDialog$1, Dialog as Dialog$1, Slot as Slot$1, Portal as Portal$1, AccessibleIcon, Tooltip as Tooltip$1,
|
|
12
|
+
import { AlertDialog as AlertDialog$1, Dialog as Dialog$1, Slot as Slot$1, Portal as Portal$1, AccessibleIcon, Tooltip as Tooltip$1, VisuallyHidden as VisuallyHidden$1, Toast as Toast$1, Collapsible as Collapsible$1, Popover as Popover$1, Label as Label$1, Checkbox as Checkbox$1, DropdownMenu as DropdownMenu$1, RadioGroup as RadioGroup$1, Separator as Separator$1, Tabs as Tabs$1 } from "radix-ui";
|
|
13
13
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
14
14
|
import { subscribeWithSelector } from "zustand/middleware";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
15
|
+
import { locale } from "./locales/en-GB.js";
|
|
16
|
+
import { locale as locale2 } from "./locales/en-US.js";
|
|
17
|
+
import { locale as locale3, locale as locale4 } from "./locales/fr-FR.js";
|
|
18
|
+
import { locale as locale5, locale as locale6 } from "./locales/pt-PT.js";
|
|
19
19
|
import { useDayPicker, DayPicker } from "react-day-picker";
|
|
20
20
|
import { Command } from "cmdk";
|
|
21
21
|
import { useShallow } from "zustand/react/shallow";
|
|
@@ -282,12 +282,12 @@ function spliceWindow(totalCount, offset, limit, window2, startIndex, deleted =
|
|
|
282
282
|
}
|
|
283
283
|
return { totalCount: newTotalCount, window: newWindow };
|
|
284
284
|
}
|
|
285
|
-
function matchAgainstFilter(value, filter,
|
|
285
|
+
function matchAgainstFilter(value, filter, locale7) {
|
|
286
286
|
if (value === "" || filter === "") {
|
|
287
287
|
return null;
|
|
288
288
|
}
|
|
289
|
-
const normalizedField = value.toLocaleLowerCase(
|
|
290
|
-
const normalizedFilter = filter.toLocaleLowerCase(
|
|
289
|
+
const normalizedField = value.toLocaleLowerCase(locale7);
|
|
290
|
+
const normalizedFilter = filter.toLocaleLowerCase(locale7);
|
|
291
291
|
const index = normalizedField.indexOf(normalizedFilter);
|
|
292
292
|
return index === -1 ? null : {
|
|
293
293
|
before: value.slice(0, index),
|
|
@@ -866,6 +866,9 @@ function useFieldControlFocused() {
|
|
|
866
866
|
function useFieldControlRequired() {
|
|
867
867
|
return useFieldStore((state) => state.controlRequired);
|
|
868
868
|
}
|
|
869
|
+
function useFieldLabel() {
|
|
870
|
+
return useFieldStore((state) => state.label);
|
|
871
|
+
}
|
|
869
872
|
function useFieldLabelId() {
|
|
870
873
|
return useFieldStore((state) => state.labelId);
|
|
871
874
|
}
|
|
@@ -984,11 +987,7 @@ function useCreateTableContext(editable, status, layout, defaultColumnWidth, onT
|
|
|
984
987
|
subscribeWithSelector((_set) => ({
|
|
985
988
|
scrollPosition: void 0,
|
|
986
989
|
numberOfColumns: void 0,
|
|
987
|
-
columnWidths: void 0
|
|
988
|
-
actions: {
|
|
989
|
-
setTableMinWidth: onTableMinWidthChange,
|
|
990
|
-
setTableMaxWidth: onTableMaxWidthChange
|
|
991
|
-
}
|
|
990
|
+
columnWidths: void 0
|
|
992
991
|
}))
|
|
993
992
|
)
|
|
994
993
|
);
|
|
@@ -998,9 +997,19 @@ function useCreateTableContext(editable, status, layout, defaultColumnWidth, onT
|
|
|
998
997
|
status,
|
|
999
998
|
layout,
|
|
1000
999
|
defaultColumnWidth,
|
|
1000
|
+
onTableMinWidthChange,
|
|
1001
|
+
onTableMaxWidthChange,
|
|
1001
1002
|
store
|
|
1002
1003
|
}),
|
|
1003
|
-
[
|
|
1004
|
+
[
|
|
1005
|
+
defaultColumnWidth,
|
|
1006
|
+
editable,
|
|
1007
|
+
layout,
|
|
1008
|
+
onTableMaxWidthChange,
|
|
1009
|
+
onTableMinWidthChange,
|
|
1010
|
+
status,
|
|
1011
|
+
store
|
|
1012
|
+
]
|
|
1004
1013
|
);
|
|
1005
1014
|
}
|
|
1006
1015
|
function useTableContext() {
|
|
@@ -1249,15 +1258,15 @@ function LocalizationProvider({
|
|
|
1249
1258
|
onLocaleChange,
|
|
1250
1259
|
children
|
|
1251
1260
|
}) {
|
|
1252
|
-
const [
|
|
1261
|
+
const [locale7, setLocale] = useControllableState(
|
|
1253
1262
|
defaultLocale,
|
|
1254
1263
|
controlledLocale
|
|
1255
1264
|
);
|
|
1256
|
-
return
|
|
1265
|
+
return locale7 === void 0 ? children : /* @__PURE__ */ jsx(
|
|
1257
1266
|
LocalizationContext.Provider,
|
|
1258
1267
|
{
|
|
1259
1268
|
value: {
|
|
1260
|
-
locale,
|
|
1269
|
+
locale: locale7,
|
|
1261
1270
|
setLocale: combineEventHandlers(setLocale, onLocaleChange)
|
|
1262
1271
|
},
|
|
1263
1272
|
children
|
|
@@ -1397,6 +1406,7 @@ const Tooltip = forwardRef(function Tooltip2({
|
|
|
1397
1406
|
);
|
|
1398
1407
|
});
|
|
1399
1408
|
const TooltipProvider = Tooltip$1.Provider;
|
|
1409
|
+
const VisuallyHidden = VisuallyHidden$1.Root;
|
|
1400
1410
|
const IconButton = forwardRef(
|
|
1401
1411
|
function IconButton2({
|
|
1402
1412
|
asChild,
|
|
@@ -1410,6 +1420,8 @@ const IconButton = forwardRef(
|
|
|
1410
1420
|
disabled,
|
|
1411
1421
|
loading,
|
|
1412
1422
|
enabledWhenLoading,
|
|
1423
|
+
loadingLabel,
|
|
1424
|
+
disableTooltip,
|
|
1413
1425
|
iconProps,
|
|
1414
1426
|
spinnerProps,
|
|
1415
1427
|
tooltipProps,
|
|
@@ -1420,43 +1432,35 @@ const IconButton = forwardRef(
|
|
|
1420
1432
|
...otherProps
|
|
1421
1433
|
}, forwardedRef) {
|
|
1422
1434
|
const prefix = usePrefix();
|
|
1423
|
-
const
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
);
|
|
1433
|
-
const spinnerEl = useMemo(
|
|
1434
|
-
() => /* @__PURE__ */ jsx(
|
|
1435
|
-
Spinner,
|
|
1436
|
-
{
|
|
1437
|
-
...spinnerProps,
|
|
1438
|
-
className: cx(
|
|
1439
|
-
prefix("icon-button__spinner"),
|
|
1440
|
-
spinnerProps?.className
|
|
1441
|
-
)
|
|
1442
|
-
}
|
|
1443
|
-
),
|
|
1444
|
-
[prefix, spinnerProps]
|
|
1435
|
+
const relevantLabel = loading ? loadingLabel ?? label : label;
|
|
1436
|
+
const labelEl = relevantLabel && /* @__PURE__ */ jsx(VisuallyHidden, { children: relevantLabel });
|
|
1437
|
+
const iconEl = icon && !loading && /* @__PURE__ */ jsx(Slot, { className: cx(prefix("icon-button__icon"), iconProps?.className), children: isValidElement(icon) ? icon : /* @__PURE__ */ jsx(Icon, { icon, fixedWidth: true, ...iconProps }) });
|
|
1438
|
+
const spinnerEl = loading && /* @__PURE__ */ jsx(
|
|
1439
|
+
Spinner,
|
|
1440
|
+
{
|
|
1441
|
+
...spinnerProps,
|
|
1442
|
+
className: cx(prefix("icon-button__spinner"), spinnerProps?.className)
|
|
1443
|
+
}
|
|
1445
1444
|
);
|
|
1446
|
-
let content =
|
|
1447
|
-
|
|
1445
|
+
let content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1446
|
+
spinnerEl,
|
|
1447
|
+
iconEl,
|
|
1448
|
+
labelEl
|
|
1449
|
+
] });
|
|
1450
|
+
if (asChild) {
|
|
1448
1451
|
content = cloneElement(children, void 0, content);
|
|
1449
1452
|
}
|
|
1453
|
+
const loadingDisabled = loading && !enabledWhenLoading;
|
|
1454
|
+
const visiblyDisabled = disabled || loadingDisabled;
|
|
1450
1455
|
const handleClick = useCallback(
|
|
1451
1456
|
(evt) => {
|
|
1452
|
-
if (
|
|
1457
|
+
if (visiblyDisabled) {
|
|
1453
1458
|
return evt.preventDefault();
|
|
1454
1459
|
}
|
|
1455
1460
|
return onClick?.(evt);
|
|
1456
1461
|
},
|
|
1457
|
-
[
|
|
1462
|
+
[onClick, visiblyDisabled]
|
|
1458
1463
|
);
|
|
1459
|
-
const shouldDisable = disabled || loading && !enabledWhenLoading;
|
|
1460
1464
|
const As = asChild ? Slot : "button";
|
|
1461
1465
|
const button = /* @__PURE__ */ jsx(
|
|
1462
1466
|
As,
|
|
@@ -1471,23 +1475,23 @@ const IconButton = forwardRef(
|
|
|
1471
1475
|
),
|
|
1472
1476
|
onClick: handleClick,
|
|
1473
1477
|
"data-accent": color,
|
|
1474
|
-
disabled
|
|
1475
|
-
"data-disabled": boolDataAttr(asChild &&
|
|
1476
|
-
"aria-disabled": asChild &&
|
|
1478
|
+
disabled,
|
|
1479
|
+
"data-disabled": boolDataAttr(loadingDisabled || asChild && disabled),
|
|
1480
|
+
"aria-disabled": loadingDisabled || asChild && disabled ? "true" : void 0,
|
|
1477
1481
|
"data-active": boolDataAttr(active),
|
|
1478
|
-
tabIndex: asChild &&
|
|
1482
|
+
tabIndex: asChild && disabled ? -1 : void 0,
|
|
1479
1483
|
ref: forwardedRef,
|
|
1480
1484
|
...otherProps,
|
|
1481
1485
|
children: content
|
|
1482
1486
|
}
|
|
1483
1487
|
);
|
|
1484
|
-
return
|
|
1488
|
+
return relevantLabel && !disableTooltip ? /* @__PURE__ */ jsx(Tooltip, { ...tooltipProps, content: relevantLabel, children: button }) : button;
|
|
1485
1489
|
}
|
|
1486
1490
|
);
|
|
1487
1491
|
const CloseButton = forwardRef(
|
|
1488
1492
|
function CloseIconButton({ icon, label = null, className, ...otherProps }, forwardedRef) {
|
|
1489
1493
|
const prefix = usePrefix();
|
|
1490
|
-
const [
|
|
1494
|
+
const [locale7] = useLocale();
|
|
1491
1495
|
return /* @__PURE__ */ jsx(
|
|
1492
1496
|
IconButton,
|
|
1493
1497
|
{
|
|
@@ -1496,7 +1500,7 @@ const CloseButton = forwardRef(
|
|
|
1496
1500
|
circle: true,
|
|
1497
1501
|
icon: icon ?? faClose,
|
|
1498
1502
|
label,
|
|
1499
|
-
"aria-label":
|
|
1503
|
+
"aria-label": locale7.CloseButton["aria-label"],
|
|
1500
1504
|
...otherProps,
|
|
1501
1505
|
ref: forwardedRef
|
|
1502
1506
|
}
|
|
@@ -1684,33 +1688,27 @@ const Button = forwardRef(
|
|
|
1684
1688
|
...otherProps
|
|
1685
1689
|
}, forwardedRef) {
|
|
1686
1690
|
const prefix = usePrefix();
|
|
1687
|
-
const iconEl =
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
}
|
|
1698
|
-
),
|
|
1699
|
-
[icon, iconPlacement, iconProps, prefix]
|
|
1691
|
+
const iconEl = icon && !loading && /* @__PURE__ */ jsx(
|
|
1692
|
+
Slot,
|
|
1693
|
+
{
|
|
1694
|
+
className: cx(
|
|
1695
|
+
prefix("button__icon"),
|
|
1696
|
+
prefix(`button__icon--${iconPlacement}`),
|
|
1697
|
+
iconProps?.className
|
|
1698
|
+
),
|
|
1699
|
+
children: isValidElement(icon) ? icon : /* @__PURE__ */ jsx(Icon, { icon, ...iconProps })
|
|
1700
|
+
}
|
|
1700
1701
|
);
|
|
1701
|
-
const spinnerEl =
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
}
|
|
1712
|
-
),
|
|
1713
|
-
[iconPlacement, prefix, spinnerProps]
|
|
1702
|
+
const spinnerEl = loading && /* @__PURE__ */ jsx(
|
|
1703
|
+
Spinner,
|
|
1704
|
+
{
|
|
1705
|
+
...spinnerProps,
|
|
1706
|
+
className: cx(
|
|
1707
|
+
prefix("button__spinner"),
|
|
1708
|
+
prefix(`button__spinner--${iconPlacement}`),
|
|
1709
|
+
spinnerProps?.className
|
|
1710
|
+
)
|
|
1711
|
+
}
|
|
1714
1712
|
);
|
|
1715
1713
|
const content = loading && loadingContent ? asChild ? cloneElement(children, void 0, loadingContent) : loadingContent : children;
|
|
1716
1714
|
const loadingDisabled = loading && !enabledWhenLoading;
|
|
@@ -1722,7 +1720,7 @@ const Button = forwardRef(
|
|
|
1722
1720
|
}
|
|
1723
1721
|
return onClick?.(evt);
|
|
1724
1722
|
},
|
|
1725
|
-
[
|
|
1723
|
+
[onClick, visiblyDisabled]
|
|
1726
1724
|
);
|
|
1727
1725
|
const As = asChild ? Slot : "button";
|
|
1728
1726
|
return /* @__PURE__ */ jsxs(
|
|
@@ -1746,11 +1744,11 @@ const Button = forwardRef(
|
|
|
1746
1744
|
ref: forwardedRef,
|
|
1747
1745
|
...otherProps,
|
|
1748
1746
|
children: [
|
|
1749
|
-
|
|
1750
|
-
|
|
1747
|
+
iconPlacement === "start" && spinnerEl,
|
|
1748
|
+
iconPlacement === "start" && iconEl,
|
|
1751
1749
|
/* @__PURE__ */ jsx(Slottable, { children: content }),
|
|
1752
|
-
|
|
1753
|
-
|
|
1750
|
+
iconPlacement === "end" && iconEl,
|
|
1751
|
+
iconPlacement === "end" && spinnerEl
|
|
1754
1752
|
]
|
|
1755
1753
|
}
|
|
1756
1754
|
);
|
|
@@ -1758,7 +1756,7 @@ const Button = forwardRef(
|
|
|
1758
1756
|
);
|
|
1759
1757
|
const AlertDialogProviderContext = createContext(void 0);
|
|
1760
1758
|
function AlertDialogProvider({ children }) {
|
|
1761
|
-
const [
|
|
1759
|
+
const [locale7] = useLocale();
|
|
1762
1760
|
const [open, setOpen] = useState(false);
|
|
1763
1761
|
const [content, setContent] = useState(null);
|
|
1764
1762
|
const resolveRef = useRef(null);
|
|
@@ -1772,7 +1770,7 @@ function AlertDialogProvider({ children }) {
|
|
|
1772
1770
|
setContent(
|
|
1773
1771
|
// XXX: This is a slight hack, but it makes sure that component
|
|
1774
1772
|
// state is not kept between new dialogs
|
|
1775
|
-
/* @__PURE__ */ jsx(Fragment, { children: renderContent(resolve) }, Math.random())
|
|
1773
|
+
/* @__PURE__ */ jsx(Fragment$1, { children: renderContent(resolve) }, Math.random())
|
|
1776
1774
|
);
|
|
1777
1775
|
setOpen(true);
|
|
1778
1776
|
}),
|
|
@@ -1786,7 +1784,7 @@ function AlertDialogProvider({ children }) {
|
|
|
1786
1784
|
size,
|
|
1787
1785
|
title,
|
|
1788
1786
|
extraBodyContent,
|
|
1789
|
-
okText =
|
|
1787
|
+
okText = locale7.AlertDialog.okText,
|
|
1790
1788
|
triggerElement,
|
|
1791
1789
|
contentProps,
|
|
1792
1790
|
headerProps,
|
|
@@ -1826,7 +1824,7 @@ function AlertDialogProvider({ children }) {
|
|
|
1826
1824
|
]
|
|
1827
1825
|
}
|
|
1828
1826
|
)),
|
|
1829
|
-
[
|
|
1827
|
+
[locale7.AlertDialog.okText, prompt]
|
|
1830
1828
|
);
|
|
1831
1829
|
const confirm = useCallback(
|
|
1832
1830
|
(description, {
|
|
@@ -1836,8 +1834,8 @@ function AlertDialogProvider({ children }) {
|
|
|
1836
1834
|
size,
|
|
1837
1835
|
title,
|
|
1838
1836
|
extraBodyContent,
|
|
1839
|
-
okText =
|
|
1840
|
-
cancelText =
|
|
1837
|
+
okText = locale7.ConfirmDialog.okText ?? locale7.AlertDialog.okText,
|
|
1838
|
+
cancelText = locale7.ConfirmDialog.cancelText,
|
|
1841
1839
|
triggerElement,
|
|
1842
1840
|
contentProps,
|
|
1843
1841
|
headerProps,
|
|
@@ -1895,9 +1893,9 @@ function AlertDialogProvider({ children }) {
|
|
|
1895
1893
|
}
|
|
1896
1894
|
)),
|
|
1897
1895
|
[
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1896
|
+
locale7.AlertDialog.okText,
|
|
1897
|
+
locale7.ConfirmDialog.cancelText,
|
|
1898
|
+
locale7.ConfirmDialog.okText,
|
|
1901
1899
|
prompt
|
|
1902
1900
|
]
|
|
1903
1901
|
);
|
|
@@ -2240,8 +2238,8 @@ const Toast = forwardRef(function Toast2({
|
|
|
2240
2238
|
});
|
|
2241
2239
|
const ToastDescription = Toast$1.Description;
|
|
2242
2240
|
function ToastProvider({ label, ...otherProps }) {
|
|
2243
|
-
const [
|
|
2244
|
-
label ??=
|
|
2241
|
+
const [locale7] = useLocale();
|
|
2242
|
+
label ??= locale7.ToastProvider.label;
|
|
2245
2243
|
return /* @__PURE__ */ jsx(Toast$1.Provider, { label, ...otherProps });
|
|
2246
2244
|
}
|
|
2247
2245
|
const ToastTitle = forwardRef(function ToastTitle2({ className, ...otherProps }, forwardedRef) {
|
|
@@ -2257,8 +2255,8 @@ const ToastTitle = forwardRef(function ToastTitle2({ className, ...otherProps },
|
|
|
2257
2255
|
});
|
|
2258
2256
|
const ToastViewport = forwardRef(function ToastViewport2({ label, className, ...otherProps }, forwardedRef) {
|
|
2259
2257
|
const prefix = usePrefix();
|
|
2260
|
-
const [
|
|
2261
|
-
label ??=
|
|
2258
|
+
const [locale7] = useLocale();
|
|
2259
|
+
label ??= locale7.ToastViewport.label;
|
|
2262
2260
|
return /* @__PURE__ */ jsx(
|
|
2263
2261
|
Toast$1.Viewport,
|
|
2264
2262
|
{
|
|
@@ -2571,11 +2569,11 @@ const ErrorBoundary = forwardRef(function ErrorBoundary2({
|
|
|
2571
2569
|
resetButtonProps,
|
|
2572
2570
|
...otherProps
|
|
2573
2571
|
}, forwardedRef) {
|
|
2574
|
-
const [
|
|
2572
|
+
const [locale7] = useLocale();
|
|
2575
2573
|
const reportError = useErrorReporter();
|
|
2576
|
-
fallbackTitle ??=
|
|
2577
|
-
fallbackMessage ??=
|
|
2578
|
-
resetButtonLabel ??=
|
|
2574
|
+
fallbackTitle ??= locale7.ErrorBoundary.fallbackTitle;
|
|
2575
|
+
fallbackMessage ??= locale7.ErrorBoundary.fallbackMessage;
|
|
2576
|
+
resetButtonLabel ??= locale7.ErrorBoundary.resetButtonLabel;
|
|
2579
2577
|
fallback ??= ({ error, resetErrorBoundary }) => /* @__PURE__ */ jsxs(
|
|
2580
2578
|
Alert,
|
|
2581
2579
|
{
|
|
@@ -2597,11 +2595,11 @@ const ErrorBoundary = forwardRef(function ErrorBoundary2({
|
|
|
2597
2595
|
}
|
|
2598
2596
|
),
|
|
2599
2597
|
children: [
|
|
2600
|
-
(!showError || !(error instanceof Error)) && /* @__PURE__ */ jsxs(Fragment
|
|
2598
|
+
(!showError || !(error instanceof Error)) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2601
2599
|
fallbackTitle && /* @__PURE__ */ jsx(AlertTitle, { children: typeof fallbackTitle === "function" ? fallbackTitle(error) : fallbackTitle }),
|
|
2602
2600
|
typeof fallbackMessage === "function" ? fallbackMessage(error) : fallbackMessage
|
|
2603
2601
|
] }),
|
|
2604
|
-
showError && error instanceof Error && /* @__PURE__ */ jsxs(Fragment
|
|
2602
|
+
showError && error instanceof Error && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2605
2603
|
/* @__PURE__ */ jsx(AlertTitle, { children: error.name }),
|
|
2606
2604
|
error.message,
|
|
2607
2605
|
/* @__PURE__ */ jsx("pre", { children: /* @__PURE__ */ jsx(Code, { color: "danger", children: error.stack }) })
|
|
@@ -2630,13 +2628,13 @@ const RootElement = forwardRef(
|
|
|
2630
2628
|
...otherProps
|
|
2631
2629
|
}, forwardedRef) {
|
|
2632
2630
|
const prefix = usePrefix();
|
|
2633
|
-
const [
|
|
2631
|
+
const [locale7] = useLocale();
|
|
2634
2632
|
const errorBoundChildren = (children2) => /* @__PURE__ */ jsx(ErrorBoundary, { ...errorBoundaryProps, children: children2 });
|
|
2635
2633
|
const As = asChild ? Slot : "div";
|
|
2636
2634
|
return /* @__PURE__ */ jsx(
|
|
2637
2635
|
As,
|
|
2638
2636
|
{
|
|
2639
|
-
lang:
|
|
2637
|
+
lang: locale7.languageTag,
|
|
2640
2638
|
className: cx(prefix("root"), className),
|
|
2641
2639
|
...otherProps,
|
|
2642
2640
|
ref: forwardedRef,
|
|
@@ -2982,7 +2980,6 @@ function useResponsiveValues(options) {
|
|
|
2982
2980
|
]
|
|
2983
2981
|
);
|
|
2984
2982
|
}
|
|
2985
|
-
const VisuallyHidden = VisuallyHidden$1.Root;
|
|
2986
2983
|
const ControlCode = forwardRef(
|
|
2987
2984
|
function ControlCode2({
|
|
2988
2985
|
asChild,
|
|
@@ -2994,8 +2991,8 @@ const ControlCode = forwardRef(
|
|
|
2994
2991
|
...otherProps
|
|
2995
2992
|
}, forwardedRef) {
|
|
2996
2993
|
const prefix = usePrefix();
|
|
2997
|
-
const [
|
|
2998
|
-
visuallyHiddenPrefix ??=
|
|
2994
|
+
const [locale7] = useLocale();
|
|
2995
|
+
visuallyHiddenPrefix ??= locale7.ControlCode.visuallyHiddenPrefix;
|
|
2999
2996
|
const controlContext = useControlContext();
|
|
3000
2997
|
const As = asChild ? Slot : "div";
|
|
3001
2998
|
return /* @__PURE__ */ jsx(ControlContext.Provider, { value: null, children: /* @__PURE__ */ jsxs(
|
|
@@ -3025,6 +3022,9 @@ function usePrinterContext() {
|
|
|
3025
3022
|
}
|
|
3026
3023
|
return printerContext;
|
|
3027
3024
|
}
|
|
3025
|
+
function usePrinterDocumentTitle() {
|
|
3026
|
+
return usePrinterContext().documentTitle;
|
|
3027
|
+
}
|
|
3028
3028
|
function usePrintInProgress() {
|
|
3029
3029
|
return useContext(PrinterContext)?.printInProgress ?? false;
|
|
3030
3030
|
}
|
|
@@ -3051,9 +3051,7 @@ function Printer({
|
|
|
3051
3051
|
const triggerRef = useRef(null);
|
|
3052
3052
|
const contentRef = useRef(null);
|
|
3053
3053
|
const [printInProgress, setPrintInProgress] = useState(false);
|
|
3054
|
-
const [printOptions, setPrintOptions] = useState(
|
|
3055
|
-
void 0
|
|
3056
|
-
);
|
|
3054
|
+
const [printOptions, setPrintOptions] = useState(void 0);
|
|
3057
3055
|
const resolvePrintRef = useRef(null);
|
|
3058
3056
|
const rejectPrintRef = useRef(null);
|
|
3059
3057
|
const pendingPromiseRef = useRef(null);
|
|
@@ -3075,7 +3073,7 @@ function Printer({
|
|
|
3075
3073
|
};
|
|
3076
3074
|
const reactToPrintFn = useReactToPrint({
|
|
3077
3075
|
bodyClass: preview || printInForeground ? prefix("root") : void 0,
|
|
3078
|
-
documentTitle: printOptions?.documentTitle ??
|
|
3076
|
+
documentTitle: printOptions?.documentTitle ?? document.title,
|
|
3079
3077
|
pageStyle: printPageStyle({
|
|
3080
3078
|
pageSize: printOptions?.pageSize ?? pageSize,
|
|
3081
3079
|
pageMargin: printOptions?.pageMargin ?? pageMargin,
|
|
@@ -3104,6 +3102,7 @@ function Printer({
|
|
|
3104
3102
|
const latest = useLatestValues({
|
|
3105
3103
|
printInProgress,
|
|
3106
3104
|
reactToPrintFn,
|
|
3105
|
+
documentTitle,
|
|
3107
3106
|
onBeforePrint
|
|
3108
3107
|
});
|
|
3109
3108
|
const handlePrint = useCallback(
|
|
@@ -3111,13 +3110,16 @@ function Printer({
|
|
|
3111
3110
|
if (latest.printInProgress) {
|
|
3112
3111
|
throw new Error("Printing is already in progress.");
|
|
3113
3112
|
}
|
|
3114
|
-
const onBeforePrint2 = latest.onBeforePrint;
|
|
3115
3113
|
flushSync(() => {
|
|
3116
3114
|
setPrintInProgress(true);
|
|
3117
|
-
|
|
3115
|
+
const documentTitleToUse = options?.documentTitle ?? latest.documentTitle;
|
|
3116
|
+
setPrintOptions({
|
|
3117
|
+
...options,
|
|
3118
|
+
documentTitle: typeof documentTitleToUse === "function" ? documentTitleToUse() : documentTitleToUse
|
|
3119
|
+
});
|
|
3118
3120
|
});
|
|
3119
3121
|
await pendingPromiseRef.current;
|
|
3120
|
-
if (
|
|
3122
|
+
if (latest.onBeforePrint) {
|
|
3121
3123
|
const event = new Event("ostack-ui.print");
|
|
3122
3124
|
await latest.onBeforePrint?.(event);
|
|
3123
3125
|
if (event.defaultPrevented) {
|
|
@@ -3154,6 +3156,7 @@ function Printer({
|
|
|
3154
3156
|
value: {
|
|
3155
3157
|
preview,
|
|
3156
3158
|
printInForeground,
|
|
3159
|
+
documentTitle,
|
|
3157
3160
|
printInProgress,
|
|
3158
3161
|
triggerRef,
|
|
3159
3162
|
contentRef,
|
|
@@ -3223,7 +3226,7 @@ const PrinterContent = forwardRef(function PrinterContent2({ asChild, printOnly,
|
|
|
3223
3226
|
children
|
|
3224
3227
|
}
|
|
3225
3228
|
);
|
|
3226
|
-
return preview || printInForeground ? /* @__PURE__ */ jsx(PrinterContentContext.Provider, { value: contentContext, children: content }) : /* @__PURE__ */ jsxs(Fragment
|
|
3229
|
+
return preview || printInForeground ? /* @__PURE__ */ jsx(PrinterContentContext.Provider, { value: contentContext, children: content }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3227
3230
|
!printOnly && /* @__PURE__ */ jsx(PrinterContentContext.Provider, { value: { printing: false }, children }),
|
|
3228
3231
|
printInProgress && /* @__PURE__ */ jsx(PrinterContentContext.Provider, { value: contentContext, children: /* @__PURE__ */ jsx(Portal, { container: portalContainer, asChild: true, children: content }) })
|
|
3229
3232
|
] });
|
|
@@ -3301,6 +3304,9 @@ const Field = forwardRef(function Field2({ asChild, className, ...otherProps },
|
|
|
3301
3304
|
const DEFAULT_TABLE_COLUMN_WIDTH = 150;
|
|
3302
3305
|
const Table = forwardRef(
|
|
3303
3306
|
function Table2({
|
|
3307
|
+
caption,
|
|
3308
|
+
captionSide = "bottom",
|
|
3309
|
+
visuallyHiddenCaption = caption,
|
|
3304
3310
|
editable = false,
|
|
3305
3311
|
variant = editable ? "control" : "default",
|
|
3306
3312
|
status,
|
|
@@ -3309,14 +3315,17 @@ const Table = forwardRef(
|
|
|
3309
3315
|
defaultColumnWidth = DEFAULT_TABLE_COLUMN_WIDTH,
|
|
3310
3316
|
maxHeight,
|
|
3311
3317
|
containerProps,
|
|
3318
|
+
scrollableProps,
|
|
3319
|
+
captionProps,
|
|
3320
|
+
visuallyHiddenCaptionProps,
|
|
3312
3321
|
className,
|
|
3313
3322
|
children,
|
|
3314
|
-
"aria-labelledby": ariaLabelledBy,
|
|
3315
3323
|
"aria-describedby": ariaDescribedBy,
|
|
3316
3324
|
...otherProps
|
|
3317
3325
|
}, forwardedRef) {
|
|
3318
3326
|
const prefix = usePrefix();
|
|
3319
|
-
const
|
|
3327
|
+
const label = useFieldLabel();
|
|
3328
|
+
visuallyHiddenCaption ??= label;
|
|
3320
3329
|
const descriptionIds = useFieldDescriptionIds();
|
|
3321
3330
|
const errorMessageIds = useFieldErrorMessageIds();
|
|
3322
3331
|
const { controlId, codeId } = useSetFieldControl(
|
|
@@ -3327,20 +3336,25 @@ const Table = forwardRef(
|
|
|
3327
3336
|
required
|
|
3328
3337
|
);
|
|
3329
3338
|
const tableRef = useRef(null);
|
|
3330
|
-
const [
|
|
3331
|
-
|
|
3339
|
+
const [scrollableEl, setScrollableEl] = useState(
|
|
3340
|
+
null
|
|
3341
|
+
);
|
|
3342
|
+
const handleMinWidthChange = useCallback((minWidth) => {
|
|
3332
3343
|
if (tableRef.current) {
|
|
3333
3344
|
tableRef.current.style.minWidth = minWidth ?? "";
|
|
3334
3345
|
}
|
|
3335
|
-
};
|
|
3336
|
-
const handleMaxWidthChange = (
|
|
3337
|
-
|
|
3338
|
-
tableRef.current
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3346
|
+
}, []);
|
|
3347
|
+
const handleMaxWidthChange = useCallback(
|
|
3348
|
+
(maxWidth) => {
|
|
3349
|
+
if (tableRef.current) {
|
|
3350
|
+
tableRef.current.style.maxWidth = maxWidth ?? "";
|
|
3351
|
+
}
|
|
3352
|
+
if (scrollableEl) {
|
|
3353
|
+
scrollableEl.style.maxWidth = maxWidth ? `min(100%, ${maxWidth})` : "";
|
|
3354
|
+
}
|
|
3355
|
+
},
|
|
3356
|
+
[scrollableEl]
|
|
3357
|
+
);
|
|
3344
3358
|
const tableContextValue = useCreateTableContext(
|
|
3345
3359
|
editable,
|
|
3346
3360
|
status,
|
|
@@ -3350,63 +3364,89 @@ const Table = forwardRef(
|
|
|
3350
3364
|
handleMaxWidthChange
|
|
3351
3365
|
);
|
|
3352
3366
|
useScrollPosition(
|
|
3353
|
-
|
|
3367
|
+
scrollableEl,
|
|
3354
3368
|
useCallback(
|
|
3355
3369
|
(scrollPosition) => tableContextValue.store.setState({ scrollPosition }),
|
|
3356
3370
|
[tableContextValue.store]
|
|
3357
3371
|
)
|
|
3358
3372
|
);
|
|
3359
|
-
const
|
|
3360
|
-
|
|
3361
|
-
|
|
3373
|
+
const captionEl = caption && /* @__PURE__ */ jsx(
|
|
3374
|
+
"div",
|
|
3375
|
+
{
|
|
3376
|
+
...captionProps,
|
|
3377
|
+
className: cx(
|
|
3378
|
+
prefix("table__caption"),
|
|
3379
|
+
prefix(`table__caption--${captionSide}`),
|
|
3380
|
+
captionProps?.className
|
|
3381
|
+
),
|
|
3382
|
+
children: caption
|
|
3383
|
+
}
|
|
3384
|
+
);
|
|
3385
|
+
const combinedScrollableRef = useCombinedRef(
|
|
3386
|
+
setScrollableEl,
|
|
3387
|
+
scrollableProps?.ref
|
|
3362
3388
|
);
|
|
3363
3389
|
const combinedTableRef = useCombinedRef(tableRef, forwardedRef);
|
|
3364
|
-
return /* @__PURE__ */ jsx(ClearContexts, { children: /* @__PURE__ */ jsx(TableContext.Provider, { value: tableContextValue, children: /* @__PURE__ */
|
|
3390
|
+
return /* @__PURE__ */ jsx(ClearContexts, { children: /* @__PURE__ */ jsx(TableContext.Provider, { value: tableContextValue, children: /* @__PURE__ */ jsxs(
|
|
3365
3391
|
"div",
|
|
3366
3392
|
{
|
|
3367
|
-
"data-status": status,
|
|
3368
|
-
"data-accent": controlStatusToAccent(status),
|
|
3369
|
-
tabIndex: 0,
|
|
3370
3393
|
...containerProps,
|
|
3371
|
-
id: controlId,
|
|
3372
3394
|
className: cx(
|
|
3373
3395
|
prefix("table__container"),
|
|
3374
|
-
prefix(`table__container--${variant}`),
|
|
3375
3396
|
containerProps?.className
|
|
3376
3397
|
),
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3398
|
+
children: [
|
|
3399
|
+
captionSide === "top" && captionEl,
|
|
3400
|
+
/* @__PURE__ */ jsx(
|
|
3401
|
+
"div",
|
|
3402
|
+
{
|
|
3403
|
+
"data-status": status,
|
|
3404
|
+
"data-accent": controlStatusToAccent(status),
|
|
3405
|
+
tabIndex: 0,
|
|
3406
|
+
...scrollableProps,
|
|
3407
|
+
id: controlId,
|
|
3408
|
+
className: cx(
|
|
3409
|
+
prefix("table__scrollable"),
|
|
3410
|
+
prefix(`table__scrollable--${variant}`),
|
|
3411
|
+
scrollableProps?.className
|
|
3412
|
+
),
|
|
3413
|
+
style: {
|
|
3414
|
+
maxHeight,
|
|
3415
|
+
// XXX: Disable Y overflow when a `max-height` isn't specified.
|
|
3416
|
+
// TODO: Investigate why we get a 1px Y overflow sometimes.
|
|
3417
|
+
overflowY: maxHeight != null || scrollableProps?.style?.maxHeight != null ? void 0 : "hidden",
|
|
3418
|
+
...scrollableProps?.style
|
|
3419
|
+
},
|
|
3420
|
+
ref: combinedScrollableRef,
|
|
3421
|
+
children: /* @__PURE__ */ jsxs(
|
|
3422
|
+
"table",
|
|
3423
|
+
{
|
|
3424
|
+
className: cx(
|
|
3425
|
+
prefix("table"),
|
|
3426
|
+
prefix(`table--${variant}`),
|
|
3427
|
+
layout === "fixed" && prefix("table--fixed"),
|
|
3428
|
+
className
|
|
3429
|
+
),
|
|
3430
|
+
"data-status": status,
|
|
3431
|
+
"aria-describedby": mergeAriaIds(
|
|
3432
|
+
codeId,
|
|
3433
|
+
descriptionIds,
|
|
3434
|
+
errorMessageIds,
|
|
3435
|
+
ariaDescribedBy
|
|
3436
|
+
),
|
|
3437
|
+
...otherProps,
|
|
3438
|
+
ref: combinedTableRef,
|
|
3439
|
+
children: [
|
|
3440
|
+
visuallyHiddenCaption && /* @__PURE__ */ jsx(VisuallyHidden, { asChild: true, children: /* @__PURE__ */ jsx("caption", { ...visuallyHiddenCaptionProps, children: visuallyHiddenCaption }) }),
|
|
3441
|
+
/* @__PURE__ */ jsx(ColumnWidths, {}),
|
|
3442
|
+
children
|
|
3443
|
+
]
|
|
3444
|
+
}
|
|
3445
|
+
)
|
|
3446
|
+
}
|
|
3447
|
+
),
|
|
3448
|
+
captionSide === "bottom" && captionEl
|
|
3449
|
+
]
|
|
3410
3450
|
}
|
|
3411
3451
|
) }) });
|
|
3412
3452
|
}
|
|
@@ -3669,12 +3709,14 @@ const TableHead = forwardRef(
|
|
|
3669
3709
|
...otherProps
|
|
3670
3710
|
}, forwardedRef) {
|
|
3671
3711
|
const prefix = usePrefix();
|
|
3672
|
-
const [
|
|
3673
|
-
sortByColumnDescription ??=
|
|
3712
|
+
const [locale7] = useLocale();
|
|
3713
|
+
sortByColumnDescription ??= locale7.TableHead.sortByColumnDescription;
|
|
3674
3714
|
const {
|
|
3675
3715
|
status: tableStatus,
|
|
3676
3716
|
layout,
|
|
3677
3717
|
defaultColumnWidth,
|
|
3718
|
+
onTableMinWidthChange,
|
|
3719
|
+
onTableMaxWidthChange,
|
|
3678
3720
|
store
|
|
3679
3721
|
} = useTableContext();
|
|
3680
3722
|
const columns = useMemo(() => columnsFromChildren(children), [children]);
|
|
@@ -3701,12 +3743,18 @@ const TableHead = forwardRef(
|
|
|
3701
3743
|
store.setState({
|
|
3702
3744
|
columnWidths: columnWidths(leaves, defaultColumnWidth)
|
|
3703
3745
|
});
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
setTableMaxWidth(tableMaxWidth(leaves, defaultColumnWidth));
|
|
3746
|
+
onTableMinWidthChange(tableMinWidth(leaves, defaultColumnWidth));
|
|
3747
|
+
onTableMaxWidthChange(tableMaxWidth(leaves, defaultColumnWidth));
|
|
3707
3748
|
return () => store.setState({ columnWidths: void 0 });
|
|
3708
3749
|
}
|
|
3709
|
-
}, [
|
|
3750
|
+
}, [
|
|
3751
|
+
columns,
|
|
3752
|
+
defaultColumnWidth,
|
|
3753
|
+
layout,
|
|
3754
|
+
onTableMaxWidthChange,
|
|
3755
|
+
onTableMinWidthChange,
|
|
3756
|
+
store
|
|
3757
|
+
]);
|
|
3710
3758
|
const leftMost = useMemo(() => leftMostColumns(columns), [columns]);
|
|
3711
3759
|
const rightMost = useMemo(() => rightMostColumns(columns), [columns]);
|
|
3712
3760
|
const combinedTableHeadRef = useCombinedRef(tableHeadRef, forwardedRef);
|
|
@@ -3727,7 +3775,7 @@ const TableHead = forwardRef(
|
|
|
3727
3775
|
label,
|
|
3728
3776
|
labelText = typeof label === "string" ? label : "",
|
|
3729
3777
|
helperText,
|
|
3730
|
-
helperButtonLabel =
|
|
3778
|
+
helperButtonLabel = locale7.TableColumn.helperButtonLabel,
|
|
3731
3779
|
width,
|
|
3732
3780
|
fixed: _fixed,
|
|
3733
3781
|
header = true,
|
|
@@ -4219,9 +4267,9 @@ const Label = forwardRef(function Label2({
|
|
|
4219
4267
|
...otherProps
|
|
4220
4268
|
}, forwardedRef) {
|
|
4221
4269
|
const prefix = usePrefix();
|
|
4222
|
-
const [
|
|
4223
|
-
requiredIconLabel ??=
|
|
4224
|
-
helperButtonLabel ??=
|
|
4270
|
+
const [locale7] = useLocale();
|
|
4271
|
+
requiredIconLabel ??= locale7.Label.requiredIconLabel;
|
|
4272
|
+
helperButtonLabel ??= locale7.Label.helperButtonLabel;
|
|
4225
4273
|
const { printHidden } = usePrintClassNames();
|
|
4226
4274
|
const labelId = useSetFieldLabel(children, id);
|
|
4227
4275
|
const controlId = useFieldControlId();
|
|
@@ -4693,7 +4741,7 @@ const DataTableRow = memo(
|
|
|
4693
4741
|
columnName,
|
|
4694
4742
|
{
|
|
4695
4743
|
filterable,
|
|
4696
|
-
locale,
|
|
4744
|
+
locale: locale7,
|
|
4697
4745
|
subColumns: _subColumns,
|
|
4698
4746
|
getValue,
|
|
4699
4747
|
format: format2,
|
|
@@ -4725,9 +4773,9 @@ const DataTableRow = memo(
|
|
|
4725
4773
|
const match = !loadingRow && filterable ? matchAgainstFilter(
|
|
4726
4774
|
formattedValue,
|
|
4727
4775
|
filter,
|
|
4728
|
-
|
|
4776
|
+
locale7 ?? "pt-PT"
|
|
4729
4777
|
) : null;
|
|
4730
|
-
const markedValue = match == null ? formattedValue : /* @__PURE__ */ jsxs(Fragment
|
|
4778
|
+
const markedValue = match == null ? formattedValue : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4731
4779
|
match.before,
|
|
4732
4780
|
/* @__PURE__ */ jsx(Mark, { children: match.matched }),
|
|
4733
4781
|
match.after
|
|
@@ -4750,7 +4798,7 @@ const DataTableRow = memo(
|
|
|
4750
4798
|
index
|
|
4751
4799
|
}) : markedValue
|
|
4752
4800
|
};
|
|
4753
|
-
return renderCell ? /* @__PURE__ */ jsx(Fragment, { children: renderCell(props) }, columnName) : /* @__PURE__ */ jsx(DataTableCell, { ...props }, columnName);
|
|
4801
|
+
return renderCell ? /* @__PURE__ */ jsx(Fragment$1, { children: renderCell(props) }, columnName) : /* @__PURE__ */ jsx(DataTableCell, { ...props }, columnName);
|
|
4754
4802
|
}
|
|
4755
4803
|
)
|
|
4756
4804
|
}
|
|
@@ -4782,7 +4830,7 @@ function DataTableEmptyOrLoadingRows({
|
|
|
4782
4830
|
return loading ? Array.from({ length: loadingCount }, (_, i) => {
|
|
4783
4831
|
const props = { row: void 0, index: i };
|
|
4784
4832
|
const key = `loading-${i}`;
|
|
4785
|
-
return renderRow ? /* @__PURE__ */ jsx(Fragment, { children: renderRow(props) }, key) : /* @__PURE__ */ jsx(DataTableRow, { ...props }, key);
|
|
4833
|
+
return renderRow ? /* @__PURE__ */ jsx(Fragment$1, { children: renderRow(props) }, key) : /* @__PURE__ */ jsx(DataTableRow, { ...props }, key);
|
|
4786
4834
|
}) : /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { paddingless: false, colSpan: numberOfColumns2, children: !loading && /* @__PURE__ */ jsx(
|
|
4787
4835
|
"div",
|
|
4788
4836
|
{
|
|
@@ -4845,7 +4893,7 @@ function PagedDataTableRows() {
|
|
|
4845
4893
|
return rowsWindow.map((row, i) => {
|
|
4846
4894
|
const props = { row, index: pageOffset + i };
|
|
4847
4895
|
const key = row ? `row-${getRowKey(row, rowKey)}` : `loading-${i}`;
|
|
4848
|
-
return renderRow ? /* @__PURE__ */ jsx(Fragment, { children: renderRow(props) }, key) : /* @__PURE__ */ jsx(DataTableRow, { ...props }, key);
|
|
4896
|
+
return renderRow ? /* @__PURE__ */ jsx(Fragment$1, { children: renderRow(props) }, key) : /* @__PURE__ */ jsx(DataTableRow, { ...props }, key);
|
|
4849
4897
|
});
|
|
4850
4898
|
}
|
|
4851
4899
|
function ScrolledDataTableRows({
|
|
@@ -4975,7 +5023,7 @@ function ScrolledDataTableRows({
|
|
|
4975
5023
|
});
|
|
4976
5024
|
});
|
|
4977
5025
|
}, [endIndex, startIndex, store]);
|
|
4978
|
-
return /* @__PURE__ */ jsxs(Fragment
|
|
5026
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4979
5027
|
/* @__PURE__ */ jsx("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx(
|
|
4980
5028
|
"td",
|
|
4981
5029
|
{
|
|
@@ -4998,7 +5046,7 @@ function ScrolledDataTableRows({
|
|
|
4998
5046
|
ref: dynamicRowHeight ? virtualizer.measureElement : void 0
|
|
4999
5047
|
};
|
|
5000
5048
|
const key = rowsWindow[i] ? `row-${getRowKey(rowsWindow[i], rowKey)}` : `loading-${i}`;
|
|
5001
|
-
return renderRow ? /* @__PURE__ */ jsx(Fragment, { children: renderRow(props) }, key) : /* @__PURE__ */ jsx(DataTableRow, { ...props }, key);
|
|
5049
|
+
return renderRow ? /* @__PURE__ */ jsx(Fragment$1, { children: renderRow(props) }, key) : /* @__PURE__ */ jsx(DataTableRow, { ...props }, key);
|
|
5002
5050
|
}),
|
|
5003
5051
|
/* @__PURE__ */ jsx("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx(
|
|
5004
5052
|
"td",
|
|
@@ -5160,8 +5208,8 @@ const DataTableContent = forwardRef(function DataTable2({
|
|
|
5160
5208
|
...otherProps
|
|
5161
5209
|
}, forwardedRef) {
|
|
5162
5210
|
const prefix = usePrefix();
|
|
5163
|
-
const [
|
|
5164
|
-
emptyMessage ??=
|
|
5211
|
+
const [locale7] = useLocale();
|
|
5212
|
+
emptyMessage ??= locale7.DataTable.emptyMessage;
|
|
5165
5213
|
const { displayMode, required, estimatedRowHeight, store } = useDataTableContext();
|
|
5166
5214
|
const tableRef = useRef(null);
|
|
5167
5215
|
const containerRef = useRef(null);
|
|
@@ -5239,9 +5287,9 @@ const DataTableFilter = forwardRef(function DataTableFilter2({
|
|
|
5239
5287
|
...otherProps
|
|
5240
5288
|
}, forwardedRef) {
|
|
5241
5289
|
const prefix = usePrefix();
|
|
5242
|
-
const [
|
|
5243
|
-
ariaLabel ??=
|
|
5244
|
-
placeholder ??=
|
|
5290
|
+
const [locale7] = useLocale();
|
|
5291
|
+
ariaLabel ??= locale7.DataTableFilter["aria-label"];
|
|
5292
|
+
placeholder ??= locale7.DataTableFilter.placeholder;
|
|
5245
5293
|
const { store } = useDataTableContext();
|
|
5246
5294
|
const filter = useStore(store, (state) => state.filter);
|
|
5247
5295
|
const handleFilterChange = (value) => {
|
|
@@ -5390,10 +5438,10 @@ const DataTablePagination = forwardRef(function DataTablePagination2({
|
|
|
5390
5438
|
nextPageButtonProps,
|
|
5391
5439
|
...otherProps
|
|
5392
5440
|
}, forwardedRef) {
|
|
5393
|
-
const [
|
|
5394
|
-
rowsRange ??=
|
|
5395
|
-
previousPageButtonLabel ??=
|
|
5396
|
-
nextPageButtonLabel ??=
|
|
5441
|
+
const [locale7] = useLocale();
|
|
5442
|
+
rowsRange ??= locale7.DataTablePagination.rowsRange;
|
|
5443
|
+
previousPageButtonLabel ??= locale7.DataTablePagination.previousPageButtonLabel;
|
|
5444
|
+
nextPageButtonLabel ??= locale7.DataTablePagination.nextPageButtonLabel;
|
|
5397
5445
|
const { displayMode, showAllRowsWhilePrinting } = useDataTableContext();
|
|
5398
5446
|
const printing = usePrinting();
|
|
5399
5447
|
return printing && showAllRowsWhilePrinting ? null : displayMode === "paged" ? /* @__PURE__ */ jsx(
|
|
@@ -5424,8 +5472,8 @@ const DataTableRowsPerPage = forwardRef(function DataTableRowsPerPage2({
|
|
|
5424
5472
|
...otherProps
|
|
5425
5473
|
}, forwardedRef) {
|
|
5426
5474
|
const prefix = usePrefix();
|
|
5427
|
-
const [
|
|
5428
|
-
label ??=
|
|
5475
|
+
const [locale7] = useLocale();
|
|
5476
|
+
label ??= locale7.DataTableRowsPerPage.label;
|
|
5429
5477
|
const { store } = useDataTableContext();
|
|
5430
5478
|
const limit = useStore(store, (state) => state.limit);
|
|
5431
5479
|
const { setLimit } = useStore(store, (state) => state.actions);
|
|
@@ -5529,8 +5577,8 @@ const Input = forwardRef(
|
|
|
5529
5577
|
...otherProps
|
|
5530
5578
|
}, forwardedRef) {
|
|
5531
5579
|
const prefix = usePrefix();
|
|
5532
|
-
const [
|
|
5533
|
-
clearButtonLabel ??=
|
|
5580
|
+
const [locale7] = useLocale();
|
|
5581
|
+
clearButtonLabel ??= locale7.Input.clearButtonLabel;
|
|
5534
5582
|
const { responsiveValuesToCssVarsAndDataAttrs } = useResponsiveValues();
|
|
5535
5583
|
const dataTableColumnLabelId = useDataTableColumnLabelId();
|
|
5536
5584
|
const descriptionIds = useFieldDescriptionIds();
|
|
@@ -6017,12 +6065,12 @@ const CommandMenu = forwardRef(
|
|
|
6017
6065
|
...otherProps
|
|
6018
6066
|
}, forwardedRef) {
|
|
6019
6067
|
const prefix = usePrefix();
|
|
6020
|
-
const [
|
|
6021
|
-
label ??=
|
|
6022
|
-
searchPlaceholder ??=
|
|
6023
|
-
emptyMessage ??=
|
|
6024
|
-
listLabel ??=
|
|
6025
|
-
loadingLabel ??=
|
|
6068
|
+
const [locale7] = useLocale();
|
|
6069
|
+
label ??= locale7.CommandMenu.label;
|
|
6070
|
+
searchPlaceholder ??= locale7.CommandMenu.searchPlaceholder;
|
|
6071
|
+
emptyMessage ??= locale7.CommandMenu.emptyMessage;
|
|
6072
|
+
listLabel ??= locale7.CommandMenu.listLabel;
|
|
6073
|
+
loadingLabel ??= locale7.CommandMenu.loadingLabel;
|
|
6026
6074
|
const searchAdornmentEl = /* @__PURE__ */ jsx(
|
|
6027
6075
|
ControlAddon,
|
|
6028
6076
|
{
|
|
@@ -6152,9 +6200,9 @@ const CommandMenuDialog = forwardRef(function CommandMenuDialog2({
|
|
|
6152
6200
|
...otherProps
|
|
6153
6201
|
}, forwardedRef) {
|
|
6154
6202
|
const prefix = usePrefix();
|
|
6155
|
-
const [
|
|
6156
|
-
title ??=
|
|
6157
|
-
description ??=
|
|
6203
|
+
const [locale7] = useLocale();
|
|
6204
|
+
title ??= locale7.CommandMenuDialog.title;
|
|
6205
|
+
description ??= locale7.CommandMenuDialog.description;
|
|
6158
6206
|
const portalContext = usePortalContext();
|
|
6159
6207
|
return /* @__PURE__ */ jsx(
|
|
6160
6208
|
Dialog$1.Root,
|
|
@@ -6549,7 +6597,7 @@ function SelectMultipleValue() {
|
|
|
6549
6597
|
)
|
|
6550
6598
|
);
|
|
6551
6599
|
const valuesList = useMemo(
|
|
6552
|
-
() => valuesOptionStates.map((optionState, i) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6600
|
+
() => valuesOptionStates.map((optionState, i) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
6553
6601
|
i === 0 ? "" : ", ",
|
|
6554
6602
|
optionState?.content
|
|
6555
6603
|
] }, i)),
|
|
@@ -6612,9 +6660,9 @@ function SelectMultipleValue() {
|
|
|
6612
6660
|
valuesToRender
|
|
6613
6661
|
]
|
|
6614
6662
|
);
|
|
6615
|
-
return /* @__PURE__ */ jsxs(Fragment
|
|
6663
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6616
6664
|
valuesToRender.length > 0 && readOnly && valuesList,
|
|
6617
|
-
valuesToRender.length > 0 && !readOnly && /* @__PURE__ */ jsxs(Fragment
|
|
6665
|
+
valuesToRender.length > 0 && !readOnly && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6618
6666
|
/* @__PURE__ */ jsx(VisuallyHidden, { children: valuesList }),
|
|
6619
6667
|
valuesTags
|
|
6620
6668
|
] })
|
|
@@ -6674,11 +6722,11 @@ const Select = forwardRef(function Select2({
|
|
|
6674
6722
|
...otherProps
|
|
6675
6723
|
}, forwardedRef) {
|
|
6676
6724
|
const prefix = usePrefix();
|
|
6677
|
-
const [
|
|
6678
|
-
searchPlaceholder ??=
|
|
6679
|
-
emptyMessage ??=
|
|
6680
|
-
optionsLabel ??=
|
|
6681
|
-
loadingOptionsLabel ??=
|
|
6725
|
+
const [locale7] = useLocale();
|
|
6726
|
+
searchPlaceholder ??= locale7.Select.searchPlaceholder;
|
|
6727
|
+
emptyMessage ??= locale7.Select.emptyMessage;
|
|
6728
|
+
optionsLabel ??= locale7.Select.optionsLabel;
|
|
6729
|
+
loadingOptionsLabel ??= locale7.Select.loadingOptionsLabel;
|
|
6682
6730
|
const { cssVarStyle } = useCssVars();
|
|
6683
6731
|
const labelId = useFieldLabelId();
|
|
6684
6732
|
const { printHidden } = usePrintClassNames();
|
|
@@ -6828,7 +6876,7 @@ const Select = forwardRef(function Select2({
|
|
|
6828
6876
|
required,
|
|
6829
6877
|
loading: loading || loadingOptions,
|
|
6830
6878
|
startAdornment,
|
|
6831
|
-
endAdornment: /* @__PURE__ */ jsxs(Fragment
|
|
6879
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6832
6880
|
!readOnly && /* @__PURE__ */ jsx(
|
|
6833
6881
|
Icon,
|
|
6834
6882
|
{
|
|
@@ -6971,7 +7019,7 @@ const CalendarMonthCaption = memo(function CalendarMonthCaption2({
|
|
|
6971
7019
|
onNextClick,
|
|
6972
7020
|
disableNavigation,
|
|
6973
7021
|
pagedNavigation,
|
|
6974
|
-
locale
|
|
7022
|
+
locale: locale7
|
|
6975
7023
|
}
|
|
6976
7024
|
} = useDayPicker();
|
|
6977
7025
|
const displayDate = calendarMonth.date;
|
|
@@ -7043,7 +7091,7 @@ const CalendarMonthCaption = memo(function CalendarMonthCaption2({
|
|
|
7043
7091
|
className: prefix("calendar__caption-label"),
|
|
7044
7092
|
role: "status",
|
|
7045
7093
|
"aria-live": "polite",
|
|
7046
|
-
children: format(displayDate, CAPTION_FORMAT, { locale })
|
|
7094
|
+
children: format(displayDate, CAPTION_FORMAT, { locale: locale7 })
|
|
7047
7095
|
}
|
|
7048
7096
|
);
|
|
7049
7097
|
const prevButton = /* @__PURE__ */ jsx(
|
|
@@ -7090,15 +7138,15 @@ const CalendarMonthCaption = memo(function CalendarMonthCaption2({
|
|
|
7090
7138
|
{
|
|
7091
7139
|
value: getMonth(monthDate),
|
|
7092
7140
|
disabled: minAllowedDate && maxAllowedDate && isSameYear(minAllowedDate, maxAllowedDate) && (getMonth(monthDate) < getMonth(minAllowedDate) || getMonth(monthDate) > getMonth(maxAllowedDate)),
|
|
7093
|
-
children: format(monthDate, MONTH_FORMAT, { locale })
|
|
7141
|
+
children: format(monthDate, MONTH_FORMAT, { locale: locale7 })
|
|
7094
7142
|
},
|
|
7095
7143
|
getMonth(monthDate)
|
|
7096
7144
|
)),
|
|
7097
|
-
[
|
|
7145
|
+
[locale7, maxAllowedDate, minAllowedDate, monthDates]
|
|
7098
7146
|
);
|
|
7099
7147
|
const yearOptions = useMemo(
|
|
7100
|
-
() => yearDates.map((yearDate) => /* @__PURE__ */ jsx(Option, { value: getYear(yearDate), children: format(yearDate, YEAR_FORMAT, { locale }) }, getYear(yearDate))),
|
|
7101
|
-
[
|
|
7148
|
+
() => yearDates.map((yearDate) => /* @__PURE__ */ jsx(Option, { value: getYear(yearDate), children: format(yearDate, YEAR_FORMAT, { locale: locale7 }) }, getYear(yearDate))),
|
|
7149
|
+
[locale7, yearDates]
|
|
7102
7150
|
);
|
|
7103
7151
|
return /* @__PURE__ */ jsxs(
|
|
7104
7152
|
"div",
|
|
@@ -7108,7 +7156,7 @@ const CalendarMonthCaption = memo(function CalendarMonthCaption2({
|
|
|
7108
7156
|
className: cx(prefix("calendar__caption"), captionProps?.className),
|
|
7109
7157
|
children: [
|
|
7110
7158
|
disableNavigation ? captionLabel : /* @__PURE__ */ jsx(VisuallyHidden, { children: captionLabel }),
|
|
7111
|
-
!disableNavigation && /* @__PURE__ */ jsxs(Fragment
|
|
7159
|
+
!disableNavigation && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7112
7160
|
months.length > 1 && /* @__PURE__ */ jsx("div", { className: cx(prefix("calendar__navigation")), children: isFirst && prevButton }),
|
|
7113
7161
|
/* @__PURE__ */ jsx("div", { className: prefix("calendar__selects"), children: /* @__PURE__ */ jsxs(ClearContexts, { children: [
|
|
7114
7162
|
/* @__PURE__ */ jsx(
|
|
@@ -7188,10 +7236,10 @@ function Calendar({
|
|
|
7188
7236
|
...otherProps
|
|
7189
7237
|
}) {
|
|
7190
7238
|
const prefix = usePrefix();
|
|
7191
|
-
const [
|
|
7192
|
-
dateFnsLocale ??=
|
|
7193
|
-
previousMonthLabel ??=
|
|
7194
|
-
nextMonthLabel ??=
|
|
7239
|
+
const [locale7] = useLocale();
|
|
7240
|
+
dateFnsLocale ??= locale7.dateFnsLocale;
|
|
7241
|
+
previousMonthLabel ??= locale7.Calendar.previousMonthLabel;
|
|
7242
|
+
nextMonthLabel ??= locale7.Calendar.nextMonthLabel;
|
|
7195
7243
|
const minAllowedDate = useMemo(() => {
|
|
7196
7244
|
const minDates = [
|
|
7197
7245
|
toValidDate(minDate),
|
|
@@ -7593,10 +7641,10 @@ function useDateTransformer({
|
|
|
7593
7641
|
shortFormat,
|
|
7594
7642
|
fullFormat
|
|
7595
7643
|
} = {}) {
|
|
7596
|
-
const [
|
|
7597
|
-
dateFnsLocale ??=
|
|
7598
|
-
shortFormat ??=
|
|
7599
|
-
fullFormat ??=
|
|
7644
|
+
const [locale7] = useLocale();
|
|
7645
|
+
dateFnsLocale ??= locale7.dateFnsLocale;
|
|
7646
|
+
shortFormat ??= locale7.DateInput.shortFormat ?? dateFnsLocale.formatLong?.date({ width: "short" }) ?? DEFAULT_SHORT_DATE_FORMAT;
|
|
7647
|
+
fullFormat ??= locale7.DateInput.fullFormat ?? dateFnsLocale.formatLong?.date({ width: "full" }) ?? DEFAULT_FULL_DATE_FORMAT;
|
|
7600
7648
|
return useMemo(
|
|
7601
7649
|
() => ({
|
|
7602
7650
|
parse: (formattedDate, { width = "short" } = {}) => parseDateStrict(
|
|
@@ -7675,11 +7723,11 @@ const DateInput = forwardRef(
|
|
|
7675
7723
|
...otherProps
|
|
7676
7724
|
}, forwardedRef) {
|
|
7677
7725
|
const prefix = usePrefix();
|
|
7678
|
-
const [
|
|
7679
|
-
dateFnsLocale ??=
|
|
7680
|
-
placeholder ??=
|
|
7681
|
-
formatDescription ??=
|
|
7682
|
-
calendarButtonLabel ??=
|
|
7726
|
+
const [locale7] = useLocale();
|
|
7727
|
+
dateFnsLocale ??= locale7.dateFnsLocale;
|
|
7728
|
+
placeholder ??= locale7.DateInput.placeholder;
|
|
7729
|
+
formatDescription ??= locale7.DateInput.formatDescription;
|
|
7730
|
+
calendarButtonLabel ??= locale7.DateInput.calendarButtonLabel;
|
|
7683
7731
|
const { printHidden } = usePrintClassNames();
|
|
7684
7732
|
const { format: formatDate, parse: parseDate } = useDateTransformer({
|
|
7685
7733
|
locale: dateFnsLocale,
|
|
@@ -7843,7 +7891,7 @@ const DateInput = forwardRef(
|
|
|
7843
7891
|
popoverContentProps?.ref,
|
|
7844
7892
|
popoverRef
|
|
7845
7893
|
);
|
|
7846
|
-
return /* @__PURE__ */ jsxs(Fragment
|
|
7894
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7847
7895
|
/* @__PURE__ */ jsxs(Popover, { open: popoverState.open, modal: popoverState.modal, children: [
|
|
7848
7896
|
/* @__PURE__ */ jsx(PopoverAnchor, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
7849
7897
|
InputWithContainerRef,
|
|
@@ -7857,7 +7905,7 @@ const DateInput = forwardRef(
|
|
|
7857
7905
|
onFocus: combineEventHandlers(onFocus, handleInputFocus),
|
|
7858
7906
|
onBlurToOutside: handleControlBlur,
|
|
7859
7907
|
showClearButton,
|
|
7860
|
-
endAdornment: /* @__PURE__ */ jsxs(Fragment
|
|
7908
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7861
7909
|
endAdornment,
|
|
7862
7910
|
/* @__PURE__ */ jsx(ControlAddon, { asChild: true, children: /* @__PURE__ */ jsx(PopoverTrigger, { children: /* @__PURE__ */ jsx(
|
|
7863
7911
|
"button",
|
|
@@ -8109,14 +8157,14 @@ const DateRangeInput = forwardRef(function DateRangeInput2({
|
|
|
8109
8157
|
...otherProps
|
|
8110
8158
|
}, forwardedRef) {
|
|
8111
8159
|
const prefix = usePrefix();
|
|
8112
|
-
const [
|
|
8113
|
-
clearButtonsLabel ??=
|
|
8114
|
-
dateFnsLocale ??=
|
|
8115
|
-
placeholder ??=
|
|
8116
|
-
formatDescription ??=
|
|
8117
|
-
startInputLabel ??=
|
|
8118
|
-
endInputLabel ??=
|
|
8119
|
-
calendarButtonLabel ??=
|
|
8160
|
+
const [locale7] = useLocale();
|
|
8161
|
+
clearButtonsLabel ??= locale7.Input.clearButtonLabel;
|
|
8162
|
+
dateFnsLocale ??= locale7.dateFnsLocale;
|
|
8163
|
+
placeholder ??= locale7.DateInput.placeholder;
|
|
8164
|
+
formatDescription ??= locale7.DateInput.formatDescription;
|
|
8165
|
+
startInputLabel ??= locale7.DateRangeInput.startInputLabel;
|
|
8166
|
+
endInputLabel ??= locale7.DateRangeInput.endInputLabel;
|
|
8167
|
+
calendarButtonLabel ??= locale7.DateRangeInput.calendarButtonLabel;
|
|
8120
8168
|
const { format: formatDate, parse: parseDate } = useDateTransformer({
|
|
8121
8169
|
locale: dateFnsLocale,
|
|
8122
8170
|
shortFormat,
|
|
@@ -9246,8 +9294,8 @@ const FeedbackPopover = forwardRef(function FeedbackPopover2({
|
|
|
9246
9294
|
...otherProps
|
|
9247
9295
|
}, forwardedRef) {
|
|
9248
9296
|
const prefix = usePrefix();
|
|
9249
|
-
const [
|
|
9250
|
-
label ??=
|
|
9297
|
+
const [locale7] = useLocale();
|
|
9298
|
+
label ??= locale7.FeedbackPopover.label;
|
|
9251
9299
|
const variant = useIsInTableCell() ? "cell" : "default";
|
|
9252
9300
|
const [feedbacksCount, setFeedbacksCount] = useState({
|
|
9253
9301
|
success: 0,
|
|
@@ -9284,7 +9332,7 @@ const FeedbackPopover = forwardRef(function FeedbackPopover2({
|
|
|
9284
9332
|
);
|
|
9285
9333
|
const inField = controlFocused !== void 0;
|
|
9286
9334
|
const accent = dominantFeedbackType === "error" ? "danger" : dominantFeedbackType;
|
|
9287
|
-
return /* @__PURE__ */ jsxs(Fragment
|
|
9335
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9288
9336
|
/* @__PURE__ */ jsx(
|
|
9289
9337
|
FeedbackPopoverContext.Provider,
|
|
9290
9338
|
{
|
|
@@ -9374,8 +9422,8 @@ const Feedback = forwardRef(
|
|
|
9374
9422
|
return () => onRemoveFeedback?.(type);
|
|
9375
9423
|
}, [onAddFeedback, onRemoveFeedback, type]);
|
|
9376
9424
|
const isInFeedbackList = useIsInFeedbackList();
|
|
9377
|
-
const [
|
|
9378
|
-
visuallyHiddenPrefix ??=
|
|
9425
|
+
const [locale7] = useLocale();
|
|
9426
|
+
visuallyHiddenPrefix ??= locale7.Feedback.visuallyHiddenPrefix;
|
|
9379
9427
|
const visuallyHiddenPrefixText = typeof visuallyHiddenPrefix === "function" ? visuallyHiddenPrefix(type) : visuallyHiddenPrefix;
|
|
9380
9428
|
const feedbackId = useSetFieldFeedback(id, type === "error");
|
|
9381
9429
|
const As = asChild ? Slot : isInFeedbackList ? "li" : "div";
|
|
@@ -9456,8 +9504,8 @@ const FieldGroupHeader = forwardRef(function FieldGroupHeader2({
|
|
|
9456
9504
|
...otherProps
|
|
9457
9505
|
}, forwardedRef) {
|
|
9458
9506
|
const prefix = usePrefix();
|
|
9459
|
-
const [
|
|
9460
|
-
visuallyHiddenCodePrefix ??=
|
|
9507
|
+
const [locale7] = useLocale();
|
|
9508
|
+
visuallyHiddenCodePrefix ??= locale7.FieldGroupHeader.visuallyHiddenCodePrefix;
|
|
9461
9509
|
const generatedId = useId();
|
|
9462
9510
|
const codeId = code ? codeProps?.id ?? prefix(`field-group-code-${generatedId}`) : void 0;
|
|
9463
9511
|
const { setCodeId } = useFieldGroupContext();
|
|
@@ -9764,10 +9812,10 @@ function useNumericTransformer({
|
|
|
9764
9812
|
prefix,
|
|
9765
9813
|
suffix
|
|
9766
9814
|
} = {}) {
|
|
9767
|
-
const [
|
|
9768
|
-
decimalSeparator ??=
|
|
9769
|
-
groupingStyle ??=
|
|
9770
|
-
groupSeparator ??=
|
|
9815
|
+
const [locale7] = useLocale();
|
|
9816
|
+
decimalSeparator ??= locale7.NumericInput.decimalSeparator ?? ".";
|
|
9817
|
+
groupingStyle ??= locale7.NumericInput.groupingStyle ?? "thousand";
|
|
9818
|
+
groupSeparator ??= locale7.NumericInput.groupSeparator ?? ",";
|
|
9771
9819
|
const options = useMemo(
|
|
9772
9820
|
() => ({
|
|
9773
9821
|
valueIsInteger,
|
|
@@ -9893,10 +9941,10 @@ const NumericInput = forwardRef(function DateInput3({
|
|
|
9893
9941
|
const maxString = numericToString(max2);
|
|
9894
9942
|
const exclusiveMinString = numericToString(exclusiveMin);
|
|
9895
9943
|
const exclusiveMaxString = numericToString(exclusiveMax);
|
|
9896
|
-
const [
|
|
9897
|
-
decimalSeparator ??=
|
|
9898
|
-
groupingStyle ??=
|
|
9899
|
-
groupSeparator ??=
|
|
9944
|
+
const [locale7] = useLocale();
|
|
9945
|
+
decimalSeparator ??= locale7.NumericInput.decimalSeparator ?? ".";
|
|
9946
|
+
groupingStyle ??= locale7.NumericInput.groupingStyle ?? "thousand";
|
|
9947
|
+
groupSeparator ??= locale7.NumericInput.groupSeparator ?? ",";
|
|
9900
9948
|
if (process.env.NODE_ENV !== "production") {
|
|
9901
9949
|
validateNumericProps({
|
|
9902
9950
|
valueIsInteger,
|
|
@@ -10198,8 +10246,8 @@ const RadioGroup = forwardRef(function RadioGroup2({
|
|
|
10198
10246
|
...otherProps
|
|
10199
10247
|
}, forwardedRef) {
|
|
10200
10248
|
const prefix = usePrefix();
|
|
10201
|
-
const [
|
|
10202
|
-
clearButtonLabel ??=
|
|
10249
|
+
const [locale7] = useLocale();
|
|
10250
|
+
clearButtonLabel ??= locale7.Input.clearButtonLabel;
|
|
10203
10251
|
const labelId = useFieldLabelId();
|
|
10204
10252
|
const dataTableColumnLabelId = useDataTableColumnLabelId();
|
|
10205
10253
|
const descriptionIds = useFieldDescriptionIds();
|
|
@@ -10668,7 +10716,7 @@ const TabContent = forwardRef(function TabContent2({ asChild, value, className,
|
|
|
10668
10716
|
const { showAllTabsWhilePrinting } = useTabsContext();
|
|
10669
10717
|
const tabLabel = useTabLabel(stringValue);
|
|
10670
10718
|
const As = printing && showAllTabsWhilePrinting ? asChild ? Slot : "div" : Tabs$1.TabsContent;
|
|
10671
|
-
return /* @__PURE__ */ jsxs(Fragment
|
|
10719
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10672
10720
|
printing && showAllTabsWhilePrinting && /* @__PURE__ */ jsx(
|
|
10673
10721
|
"span",
|
|
10674
10722
|
{
|
|
@@ -11312,10 +11360,11 @@ export {
|
|
|
11312
11360
|
computed,
|
|
11313
11361
|
controlStatusToAccent,
|
|
11314
11362
|
cx,
|
|
11315
|
-
enGB,
|
|
11316
|
-
enUS,
|
|
11363
|
+
locale as enGB,
|
|
11364
|
+
locale2 as enUS,
|
|
11317
11365
|
formatNumericValue,
|
|
11318
|
-
fr,
|
|
11366
|
+
locale3 as fr,
|
|
11367
|
+
locale4 as frFR,
|
|
11319
11368
|
ignoreFormControlsKeyboardShortcut,
|
|
11320
11369
|
isNumericStringNegative,
|
|
11321
11370
|
matchAgainstFilter,
|
|
@@ -11328,7 +11377,8 @@ export {
|
|
|
11328
11377
|
numericToString,
|
|
11329
11378
|
parseDateStrict,
|
|
11330
11379
|
parseNumericValue,
|
|
11331
|
-
pt,
|
|
11380
|
+
locale5 as pt,
|
|
11381
|
+
locale6 as ptPT,
|
|
11332
11382
|
registerKeyboardShortcut,
|
|
11333
11383
|
setBoolDataAttr,
|
|
11334
11384
|
setDefaultPrefix,
|
|
@@ -11353,6 +11403,7 @@ export {
|
|
|
11353
11403
|
useFieldControlTagName,
|
|
11354
11404
|
useFieldDescriptionIds,
|
|
11355
11405
|
useFieldErrorMessageIds,
|
|
11406
|
+
useFieldLabel,
|
|
11356
11407
|
useFieldLabelId,
|
|
11357
11408
|
useIntersectionObserver,
|
|
11358
11409
|
useIsInFeedbackList,
|
|
@@ -11374,6 +11425,7 @@ export {
|
|
|
11374
11425
|
usePrint,
|
|
11375
11426
|
usePrintClassNames,
|
|
11376
11427
|
usePrintInProgress,
|
|
11428
|
+
usePrinterDocumentTitle,
|
|
11377
11429
|
usePrinting,
|
|
11378
11430
|
useResponsiveValues,
|
|
11379
11431
|
useScrollPosition,
|