fastapi-rtk 0.2.41 → 0.2.42

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.
Files changed (98) hide show
  1. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/JsonFormsWithCustomizer/JsonFormsWithCustomizer.cjs +16 -2
  2. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/hooks/useDateProps.cjs +1 -1
  3. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Categorization/MantineCategorizationLayoutRenderer.cjs +3 -2
  4. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Categorization/variants/CategorizationCards.cjs +20 -12
  5. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Categorization/variants/CategorizationStepper.cjs +16 -12
  6. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Categorization/variants/CategorizationTabs.cjs +20 -7
  7. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/utils/getAbsoluteValue.cjs +4 -0
  8. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/JsonFormsWithCustomizer/JsonFormsWithCustomizer.mjs +15 -1
  9. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/hooks/useDateProps.mjs +1 -1
  10. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Categorization/MantineCategorizationLayoutRenderer.mjs +4 -3
  11. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Categorization/variants/CategorizationCards.mjs +21 -13
  12. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Categorization/variants/CategorizationStepper.mjs +16 -12
  13. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Categorization/variants/CategorizationTabs.mjs +20 -7
  14. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/utils/getAbsoluteValue.mjs +4 -0
  15. package/dist/.external/cjs/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/mutation.cjs +44 -13
  16. package/dist/.external/cjs/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/mutationCache.cjs +1 -0
  17. package/dist/.external/cjs/{@tanstack_react-query@5.87.4_react@18.3.1 → @tanstack_react-query@5.89.0_react@18.3.1}/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs +1 -1
  18. package/dist/.external/cjs/{@tanstack_react-query@5.87.4_react@18.3.1 → @tanstack_react-query@5.89.0_react@18.3.1}/@tanstack/react-query/build/modern/useBaseQuery.cjs +2 -2
  19. package/dist/.external/cjs/{@tanstack_react-query@5.87.4_react@18.3.1 → @tanstack_react-query@5.89.0_react@18.3.1}/@tanstack/react-query/build/modern/useQuery.cjs +1 -1
  20. package/dist/.external/esm/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/mutation.mjs +44 -13
  21. package/dist/.external/esm/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/mutationCache.mjs +1 -0
  22. package/dist/.external/esm/{@tanstack_react-query@5.87.4_react@18.3.1 → @tanstack_react-query@5.89.0_react@18.3.1}/@tanstack/react-query/build/modern/errorBoundaryUtils.mjs +1 -1
  23. package/dist/.external/esm/{@tanstack_react-query@5.87.4_react@18.3.1 → @tanstack_react-query@5.89.0_react@18.3.1}/@tanstack/react-query/build/modern/useBaseQuery.mjs +2 -2
  24. package/dist/.external/esm/{@tanstack_react-query@5.87.4_react@18.3.1 → @tanstack_react-query@5.89.0_react@18.3.1}/@tanstack/react-query/build/modern/useQuery.mjs +1 -1
  25. package/dist/core/cjs/Modals/CommonModal.cjs +1 -1
  26. package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilterInput/HeaderInputs/HeaderBetweenInput.cjs +7 -2
  27. package/dist/core/cjs/Wrappers/ApiProvider/ApiProvider.cjs +4 -0
  28. package/dist/core/cjs/Wrappers/ApiProvider/hooks/useProvideApi.cjs +11 -4
  29. package/dist/core/cjs/Wrappers/Provider/Provider.cjs +2 -2
  30. package/dist/core/cjs/Wrappers/Provider/hooks/useProvideAuth.cjs +2 -2
  31. package/dist/core/cjs/Wrappers/Provider/hooks/useProvideInfo.cjs +1 -1
  32. package/dist/core/cjs/translations/de.cjs +6 -1
  33. package/dist/core/esm/Modals/CommonModal.mjs +1 -1
  34. package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilterInput/HeaderInputs/HeaderBetweenInput.mjs +7 -2
  35. package/dist/core/esm/Wrappers/ApiProvider/ApiProvider.mjs +4 -0
  36. package/dist/core/esm/Wrappers/ApiProvider/hooks/useProvideApi.mjs +11 -4
  37. package/dist/core/esm/Wrappers/Provider/Provider.mjs +2 -2
  38. package/dist/core/esm/Wrappers/Provider/hooks/useProvideAuth.mjs +2 -2
  39. package/dist/core/esm/Wrappers/Provider/hooks/useProvideInfo.mjs +1 -1
  40. package/dist/core/esm/translations/de.mjs +6 -1
  41. package/dist/core/lib/Wrappers/ApiProvider/ApiProvider.d.ts +11 -1
  42. package/dist/core/lib/Wrappers/ApiProvider/hooks/useProvideApi.d.ts +3 -1
  43. package/dist/core/lib/translations/de.d.ts +4 -0
  44. package/dist/jsonforms/cjs/JsonFormsWithCustomizer/JsonFormsWithCustomizer.cjs +16 -2
  45. package/dist/jsonforms/cjs/hooks/useDateProps.cjs +1 -1
  46. package/dist/jsonforms/cjs/layouts/Categorization/MantineCategorizationLayoutRenderer.cjs +3 -2
  47. package/dist/jsonforms/cjs/layouts/Categorization/variants/CategorizationCards.cjs +23 -15
  48. package/dist/jsonforms/cjs/layouts/Categorization/variants/CategorizationStepper.cjs +16 -12
  49. package/dist/jsonforms/cjs/layouts/Categorization/variants/CategorizationTabs.cjs +20 -7
  50. package/dist/jsonforms/cjs/utils/getAbsoluteValue.cjs +4 -0
  51. package/dist/jsonforms/esm/JsonFormsWithCustomizer/JsonFormsWithCustomizer.mjs +15 -1
  52. package/dist/jsonforms/esm/hooks/useDateProps.mjs +1 -1
  53. package/dist/jsonforms/esm/layouts/Categorization/MantineCategorizationLayoutRenderer.mjs +4 -3
  54. package/dist/jsonforms/esm/layouts/Categorization/variants/CategorizationCards.mjs +21 -13
  55. package/dist/jsonforms/esm/layouts/Categorization/variants/CategorizationStepper.mjs +16 -12
  56. package/dist/jsonforms/esm/layouts/Categorization/variants/CategorizationTabs.mjs +20 -7
  57. package/dist/jsonforms/esm/utils/getAbsoluteValue.mjs +4 -0
  58. package/dist/jsonforms/lib/JsonFormsWithCustomizer/JsonFormsWithCustomizer.d.ts +2 -0
  59. package/dist/jsonforms/lib/utils/getAbsoluteValue.d.ts +4 -0
  60. package/package.json +1 -1
  61. /package/dist/.external/cjs/{@iconify_react@6.0.1_react@18.3.1 → @iconify_react@6.0.2_react@18.3.1}/@iconify/react/dist/iconify.cjs +0 -0
  62. /package/dist/.external/cjs/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/focusManager.cjs +0 -0
  63. /package/dist/.external/cjs/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs +0 -0
  64. /package/dist/.external/cjs/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/notifyManager.cjs +0 -0
  65. /package/dist/.external/cjs/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/onlineManager.cjs +0 -0
  66. /package/dist/.external/cjs/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/query.cjs +0 -0
  67. /package/dist/.external/cjs/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/queryCache.cjs +0 -0
  68. /package/dist/.external/cjs/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/queryClient.cjs +0 -0
  69. /package/dist/.external/cjs/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/queryObserver.cjs +0 -0
  70. /package/dist/.external/cjs/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/removable.cjs +0 -0
  71. /package/dist/.external/cjs/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/retryer.cjs +0 -0
  72. /package/dist/.external/cjs/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/subscribable.cjs +0 -0
  73. /package/dist/.external/cjs/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/thenable.cjs +0 -0
  74. /package/dist/.external/cjs/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/timeoutManager.cjs +0 -0
  75. /package/dist/.external/cjs/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/utils.cjs +0 -0
  76. /package/dist/.external/cjs/{@tanstack_react-query@5.87.4_react@18.3.1 → @tanstack_react-query@5.89.0_react@18.3.1}/@tanstack/react-query/build/modern/IsRestoringProvider.cjs +0 -0
  77. /package/dist/.external/cjs/{@tanstack_react-query@5.87.4_react@18.3.1 → @tanstack_react-query@5.89.0_react@18.3.1}/@tanstack/react-query/build/modern/QueryClientProvider.cjs +0 -0
  78. /package/dist/.external/cjs/{@tanstack_react-query@5.87.4_react@18.3.1 → @tanstack_react-query@5.89.0_react@18.3.1}/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs +0 -0
  79. /package/dist/.external/cjs/{@tanstack_react-query@5.87.4_react@18.3.1 → @tanstack_react-query@5.89.0_react@18.3.1}/@tanstack/react-query/build/modern/suspense.cjs +0 -0
  80. /package/dist/.external/esm/{@iconify_react@6.0.1_react@18.3.1 → @iconify_react@6.0.2_react@18.3.1}/@iconify/react/dist/iconify.mjs +0 -0
  81. /package/dist/.external/esm/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/focusManager.mjs +0 -0
  82. /package/dist/.external/esm/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/infiniteQueryBehavior.mjs +0 -0
  83. /package/dist/.external/esm/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/notifyManager.mjs +0 -0
  84. /package/dist/.external/esm/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/onlineManager.mjs +0 -0
  85. /package/dist/.external/esm/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/query.mjs +0 -0
  86. /package/dist/.external/esm/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/queryCache.mjs +0 -0
  87. /package/dist/.external/esm/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/queryClient.mjs +0 -0
  88. /package/dist/.external/esm/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/queryObserver.mjs +0 -0
  89. /package/dist/.external/esm/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/removable.mjs +0 -0
  90. /package/dist/.external/esm/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/retryer.mjs +0 -0
  91. /package/dist/.external/esm/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/subscribable.mjs +0 -0
  92. /package/dist/.external/esm/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/thenable.mjs +0 -0
  93. /package/dist/.external/esm/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/timeoutManager.mjs +0 -0
  94. /package/dist/.external/esm/{@tanstack_query-core@5.87.4 → @tanstack_query-core@5.89.0}/@tanstack/query-core/build/modern/utils.mjs +0 -0
  95. /package/dist/.external/esm/{@tanstack_react-query@5.87.4_react@18.3.1 → @tanstack_react-query@5.89.0_react@18.3.1}/@tanstack/react-query/build/modern/IsRestoringProvider.mjs +0 -0
  96. /package/dist/.external/esm/{@tanstack_react-query@5.87.4_react@18.3.1 → @tanstack_react-query@5.89.0_react@18.3.1}/@tanstack/react-query/build/modern/QueryClientProvider.mjs +0 -0
  97. /package/dist/.external/esm/{@tanstack_react-query@5.87.4_react@18.3.1 → @tanstack_react-query@5.89.0_react@18.3.1}/@tanstack/react-query/build/modern/QueryErrorResetBoundary.mjs +0 -0
  98. /package/dist/.external/esm/{@tanstack_react-query@5.87.4_react@18.3.1 → @tanstack_react-query@5.89.0_react@18.3.1}/@tanstack/react-query/build/modern/suspense.mjs +0 -0
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
+ const core = require("fastapi-rtk/core");
4
5
  const jsonformsReact_esm = require("../../../../../../../.external/cjs/@jsonforms_react@3.6.0_@jsonforms_core@3.6.0_react@18.3.1/@jsonforms/react/lib/jsonforms-react.esm.cjs");
5
- const core = require("@mantine/core");
6
+ const core$1 = require("@mantine/core");
6
7
  const React = require("react");
7
8
  const useThemeCustomizer = require("../hooks/useThemeCustomizer.cjs");
8
9
  const mantineCells = require("../renderers/mantineCells.cjs");
@@ -14,10 +15,22 @@ const JsonFormsWithCustomizer = React.memo(function JsonFormsWithCustomizer2({
14
15
  onChange,
15
16
  customizer,
16
17
  debounce = false,
18
+ translations,
19
+ createTranslator = (locale, translations2 = {}) => (key, defaultMessage) => {
20
+ if (!(key in translations2)) {
21
+ core.FastAPIRTKLogger.warn(`${locale}: Missing translation for key: ${key}`);
22
+ }
23
+ return (translations2 == null ? void 0 : translations2[key]) ?? defaultMessage;
24
+ },
17
25
  ...props
18
26
  }) {
19
27
  const theme = useThemeCustomizer.useThemeCustomizer({ ...customizer, __: { debounce } });
20
- return /* @__PURE__ */ jsxRuntime.jsx(core.MantineThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntime.jsx(
28
+ const { currentLanguage } = core.useLang({ throwOnError: false });
29
+ const i18n = React.useMemo(
30
+ () => currentLanguage && translations ? { locale: currentLanguage, translate: createTranslator(currentLanguage, translations == null ? void 0 : translations[currentLanguage]) } : void 0,
31
+ [createTranslator, currentLanguage, translations]
32
+ );
33
+ return /* @__PURE__ */ jsxRuntime.jsx(core$1.MantineThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntime.jsx(
21
34
  jsonformsReact_esm.JsonForms,
22
35
  {
23
36
  schema,
@@ -26,6 +39,7 @@ const JsonFormsWithCustomizer = React.memo(function JsonFormsWithCustomizer2({
26
39
  cells: mantineCells.mantineCells,
27
40
  data,
28
41
  onChange,
42
+ i18n,
29
43
  ...props
30
44
  }
31
45
  ) });
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
- const iconify = require("../../../../../../../.external/cjs/@iconify_react@6.0.1_react@18.3.1/@iconify/react/dist/iconify.cjs");
4
+ const iconify = require("../../../../../../../.external/cjs/@iconify_react@6.0.2_react@18.3.1/@iconify/react/dist/iconify.cjs");
5
5
  const core = require("@mantine/core");
6
6
  const utcConverter = require("../utils/utcConverter.cjs");
7
7
  function useDateProps(type, isUTC, { value, toggle, onChange }) {
@@ -4,6 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const jsonformsCore_esm = require("../../../../../../../../.external/cjs/@jsonforms_core@3.6.0/@jsonforms/core/lib/jsonforms-core.esm.cjs");
5
5
  const jsonformsReact_esm = require("../../../../../../../../.external/cjs/@jsonforms_react@3.6.0_@jsonforms_core@3.6.0_react@18.3.1/@jsonforms/react/lib/jsonforms-react.esm.cjs");
6
6
  const React = require("react");
7
+ const getAbsoluteValue = require("../../utils/getAbsoluteValue.cjs");
7
8
  const withAjvProps = require("../../utils/withAjvProps.cjs");
8
9
  const withDebounce = require("../../utils/withDebounce.cjs");
9
10
  const CategorizationCards = require("./variants/CategorizationCards.cjs");
@@ -18,8 +19,8 @@ const Component = (props) => {
18
19
  [categorization.elements, ajv, data]
19
20
  );
20
21
  const labels = React.useMemo(
21
- () => categorization.elements.map((c) => jsonformsCore_esm.deriveLabelForUISchemaElement(c, t)).join("|"),
22
- [categorization.elements, t]
22
+ () => categorization.elements.map((c) => getAbsoluteValue.getAbsoluteLabel(c)).join("|"),
23
+ [categorization.elements]
23
24
  );
24
25
  const childProps = { schema, path, enabled, visible, direction: "column" };
25
26
  if (((_a = uischema.options) == null ? void 0 : _a.variant) === "card" || ((_b = uischema.options) == null ? void 0 : _b.variant) === "cards") {
@@ -7,6 +7,7 @@ const core = require("@mantine/core");
7
7
  const React = require("react");
8
8
  const LayoutPaddingContext = require("../../../Contexts/LayoutPaddingContext.cjs");
9
9
  const useContextProps = require("../../../hooks/useContextProps.cjs");
10
+ const getAbsoluteValue = require("../../../utils/getAbsoluteValue.cjs");
10
11
  const layout = require("../../../utils/layout.cjs");
11
12
  const CategorizationCardsGroup = ({ labels, jsonFormsProps, children, ...props }) => {
12
13
  const [, _props] = useContextProps.useContextProps(
@@ -28,7 +29,7 @@ const CategorizationCardsCard = ({ value, jsonFormsProps, children, ...props })
28
29
  false
29
30
  );
30
31
  const mergedProps = React.useMemo(() => utils.deepMerge(props, _props), [props, _props]);
31
- return /* @__PURE__ */ jsxRuntime.jsx(core.Card, { withBorder: true, shadow: "md", p: "xs", ...mergedProps, children: mergedProps.children });
32
+ return /* @__PURE__ */ jsxRuntime.jsx(core.Card, { withBorder: true, shadow: "md", p: "xs", radius: "sm", ...mergedProps, children: mergedProps.children });
32
33
  };
33
34
  const CategorizationCards = ({
34
35
  labels,
@@ -40,7 +41,8 @@ const CategorizationCards = ({
40
41
  t,
41
42
  jsonFormsProps
42
43
  }) => {
43
- const [_value, _onChange] = React.useState((_categories == null ? void 0 : _categories[0]) ? jsonformsCore_esm.deriveLabelForUISchemaElement(_categories[0], t) : "");
44
+ const theme = core.useMantineTheme();
45
+ const [_value, _onChange] = React.useState((_categories == null ? void 0 : _categories[0]) ? getAbsoluteValue.getAbsoluteLabel(_categories[0]) : "");
44
46
  const contextPath = `Categorization.Cards.[${labels}]`;
45
47
  const [, componentProps] = useContextProps.useContextProps(
46
48
  `Categorization.Cards`,
@@ -56,31 +58,37 @@ const CategorizationCards = ({
56
58
  );
57
59
  const { categories, value, onChange, groupProps, cardProps } = componentProps;
58
60
  const categoryLabels = React.useMemo(
59
- () => categories.map((category) => jsonformsCore_esm.deriveLabelForUISchemaElement(category, t)),
61
+ () => categories.map((category) => ({
62
+ value: getAbsoluteValue.getAbsoluteLabel(category),
63
+ label: jsonformsCore_esm.deriveLabelForUISchemaElement(category, t)
64
+ })),
60
65
  [categories, t]
61
66
  );
62
67
  React.useEffect(() => {
63
- if (!categoryLabels.includes(value)) {
64
- onChange((categories == null ? void 0 : categories[0]) ? jsonformsCore_esm.deriveLabelForUISchemaElement(categories[0], t) : "");
68
+ if (!categoryLabels.map((c) => c.value).includes(value)) {
69
+ onChange((categories == null ? void 0 : categories[0]) ? categories[0].value : "");
65
70
  }
66
71
  }, [categoryLabels]);
67
72
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
68
- /* @__PURE__ */ jsxRuntime.jsx(CategorizationCardsGroup, { labels, jsonFormsProps, ...groupProps, children: categoryLabels.map((label) => /* @__PURE__ */ jsxRuntime.jsx(
73
+ /* @__PURE__ */ jsxRuntime.jsx(CategorizationCardsGroup, { labels, jsonFormsProps, ...groupProps, children: categoryLabels.map((cl) => /* @__PURE__ */ jsxRuntime.jsx(
69
74
  CategorizationCardsCard,
70
75
  {
71
- value: label,
76
+ value: cl.value,
72
77
  jsonFormsProps,
73
78
  onClick: (e) => {
74
79
  e.stopPropagation();
75
- onChange(label);
80
+ onChange(cl.value);
81
+ },
82
+ style: {
83
+ cursor: "pointer",
84
+ border: cl.value === value ? `2px solid ${theme.colors[theme.primaryColor][6]}` : void 0
76
85
  },
77
- style: { cursor: "pointer" },
78
86
  ...cardProps,
79
- children: label
87
+ children: cl.label
80
88
  },
81
- label
89
+ cl.value
82
90
  )) }),
83
- categories.filter((category) => jsonformsCore_esm.deriveLabelForUISchemaElement(category, t) === value).map((category) => /* @__PURE__ */ jsxRuntime.jsx(LayoutPaddingContext.LayoutPaddingContextProvider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsx(layout.MantineLayoutRenderer, { ...childProps, elements: category.elements, renderers, cells }) }, jsonformsCore_esm.deriveLabelForUISchemaElement(category, t)))
91
+ categories.filter((category) => getAbsoluteValue.getAbsoluteLabel(category) === value).map((category) => /* @__PURE__ */ jsxRuntime.jsx(LayoutPaddingContext.LayoutPaddingContextProvider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsx(layout.MantineLayoutRenderer, { ...childProps, elements: category.elements, renderers, cells }) }, getAbsoluteValue.getAbsoluteLabel(category)))
84
92
  ] });
85
93
  };
86
94
  exports.CategorizationCards = CategorizationCards;
@@ -7,6 +7,7 @@ const core = require("@mantine/core");
7
7
  const React = require("react");
8
8
  const LayoutPaddingContext = require("../../../Contexts/LayoutPaddingContext.cjs");
9
9
  const useContextProps = require("../../../hooks/useContextProps.cjs");
10
+ const getAbsoluteValue = require("../../../utils/getAbsoluteValue.cjs");
10
11
  const layout = require("../../../utils/layout.cjs");
11
12
  const CategorizationStepperStep = ({ label, description, jsonFormsProps, children, ...props }) => {
12
13
  const [, _props] = useContextProps.useContextProps(
@@ -41,7 +42,7 @@ const CategorizationStepper = ({
41
42
  jsonFormsProps,
42
43
  showNavButtons
43
44
  }) => {
44
- const [_value, _onChange] = React.useState((_categories == null ? void 0 : _categories[0]) ? jsonformsCore_esm.deriveLabelForUISchemaElement(_categories[0], t) : "");
45
+ const [_value, _onChange] = React.useState((_categories == null ? void 0 : _categories[0]) ? getAbsoluteValue.getAbsoluteLabel(_categories[0]) : "");
45
46
  const contextPath = `Categorization.Stepper.[${labels}]`;
46
47
  const [, componentProps] = useContextProps.useContextProps(
47
48
  `Categorization.Stepper`,
@@ -57,31 +58,34 @@ const CategorizationStepper = ({
57
58
  );
58
59
  const { categories, value, onChange, stepProps, buttonProps, ...rest } = componentProps;
59
60
  const categoryLabels = React.useMemo(
60
- () => categories.map((category) => jsonformsCore_esm.deriveLabelForUISchemaElement(category, t)),
61
+ () => categories.map((category) => ({
62
+ value: getAbsoluteValue.getAbsoluteLabel(category),
63
+ label: jsonformsCore_esm.deriveLabelForUISchemaElement(category, t)
64
+ })),
61
65
  [categories, t]
62
66
  );
63
67
  React.useEffect(() => {
64
- if (!categoryLabels.includes(value)) {
65
- onChange((categories == null ? void 0 : categories[0]) ? jsonformsCore_esm.deriveLabelForUISchemaElement(categories[0], t) : "");
68
+ if (!categoryLabels.map((c) => c.value).includes(value)) {
69
+ onChange((categories == null ? void 0 : categories[0]) ? categories[0].value : "");
66
70
  }
67
71
  }, [categoryLabels]);
68
72
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
69
73
  /* @__PURE__ */ jsxRuntime.jsx(
70
74
  core.Stepper,
71
75
  {
72
- active: categoryLabels.indexOf(value),
73
- onStepClick: (index) => onChange(categoryLabels[index]),
76
+ active: categoryLabels.findIndex((cl) => cl.value === value),
77
+ onStepClick: (index) => onChange(categoryLabels[index].value),
74
78
  ...rest,
75
79
  children: categories.map((category) => /* @__PURE__ */ jsxRuntime.jsx(
76
80
  CategorizationStepperStep,
77
81
  {
78
- label: jsonformsCore_esm.deriveLabelForUISchemaElement(category, t),
82
+ label: getAbsoluteValue.getAbsoluteLabel(category),
79
83
  description: category.description,
80
84
  jsonFormsProps,
81
85
  ...stepProps,
82
86
  children: /* @__PURE__ */ jsxRuntime.jsx(LayoutPaddingContext.LayoutPaddingContextProvider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsx(layout.MantineLayoutRenderer, { ...childProps, elements: category.elements, renderers, cells }) })
83
87
  },
84
- jsonformsCore_esm.deriveLabelForUISchemaElement(category, t)
88
+ getAbsoluteValue.getAbsoluteLabel(category)
85
89
  ))
86
90
  }
87
91
  ),
@@ -92,9 +96,9 @@ const CategorizationStepper = ({
92
96
  labels,
93
97
  name: "Previous",
94
98
  onClick: () => {
95
- const currentIndex = categoryLabels.indexOf(value);
99
+ const currentIndex = categoryLabels.findIndex((cl) => cl.value === value);
96
100
  if (currentIndex > 0) {
97
- onChange(categoryLabels[currentIndex - 1]);
101
+ onChange(categoryLabels[currentIndex - 1].value);
98
102
  }
99
103
  },
100
104
  jsonFormsProps,
@@ -108,9 +112,9 @@ const CategorizationStepper = ({
108
112
  labels,
109
113
  name: "Next",
110
114
  onClick: () => {
111
- const currentIndex = categoryLabels.indexOf(value);
115
+ const currentIndex = categoryLabels.findIndex((cl) => cl.value === value);
112
116
  if (currentIndex < categoryLabels.length - 1) {
113
- onChange(categoryLabels[currentIndex + 1]);
117
+ onChange(categoryLabels[currentIndex + 1].value);
114
118
  }
115
119
  },
116
120
  jsonFormsProps,
@@ -7,6 +7,7 @@ const core = require("@mantine/core");
7
7
  const React = require("react");
8
8
  const LayoutPaddingContext = require("../../../Contexts/LayoutPaddingContext.cjs");
9
9
  const useContextProps = require("../../../hooks/useContextProps.cjs");
10
+ const getAbsoluteValue = require("../../../utils/getAbsoluteValue.cjs");
10
11
  const layout = require("../../../utils/layout.cjs");
11
12
  const CategorizationTabsList = ({ labels, jsonFormsProps, children, ...props }) => {
12
13
  const [, _props] = useContextProps.useContextProps(
@@ -51,7 +52,7 @@ const CategorizationTabs = ({
51
52
  t,
52
53
  jsonFormsProps
53
54
  }) => {
54
- const [_value, _onChange] = React.useState((_categories == null ? void 0 : _categories[0]) ? jsonformsCore_esm.deriveLabelForUISchemaElement(_categories[0], t) : "");
55
+ const [_value, _onChange] = React.useState((_categories == null ? void 0 : _categories[0]) ? getAbsoluteValue.getAbsoluteLabel(_categories[0]) : "");
55
56
  const contextPath = `Categorization.Tabs.[${labels}]`;
56
57
  const [, componentProps] = useContextProps.useContextProps(
57
58
  `Categorization.Tabs`,
@@ -67,26 +68,38 @@ const CategorizationTabs = ({
67
68
  );
68
69
  const { categories, value, onChange, listProps, tabProps, panelProps, ...rest } = componentProps;
69
70
  const categoryLabels = React.useMemo(
70
- () => categories.map((category) => jsonformsCore_esm.deriveLabelForUISchemaElement(category, t)),
71
+ () => categories.map((category) => ({
72
+ value: getAbsoluteValue.getAbsoluteLabel(category),
73
+ label: jsonformsCore_esm.deriveLabelForUISchemaElement(category, t)
74
+ })),
71
75
  [categories, t]
72
76
  );
73
77
  React.useEffect(() => {
74
- if (!categoryLabels.includes(value)) {
75
- onChange((categories == null ? void 0 : categories[0]) ? jsonformsCore_esm.deriveLabelForUISchemaElement(categories[0], t) : "");
78
+ if (!categoryLabels.map((c) => c.value).includes(value)) {
79
+ onChange((categories == null ? void 0 : categories[0]) ? categories[0].value : "");
76
80
  }
77
81
  }, [categoryLabels]);
78
82
  return /* @__PURE__ */ jsxRuntime.jsxs(core.Tabs, { value, onChange, ...rest, children: [
79
- /* @__PURE__ */ jsxRuntime.jsx(CategorizationTabsList, { labels, jsonFormsProps, ...listProps, children: categoryLabels.map((label) => /* @__PURE__ */ jsxRuntime.jsx(CategorizationTabsTab, { value: label, jsonFormsProps, ...tabProps, children: label }, label)) }),
83
+ /* @__PURE__ */ jsxRuntime.jsx(CategorizationTabsList, { labels, jsonFormsProps, ...listProps, children: categoryLabels.map((category) => /* @__PURE__ */ jsxRuntime.jsx(
84
+ CategorizationTabsTab,
85
+ {
86
+ value: category.value,
87
+ jsonFormsProps,
88
+ ...tabProps,
89
+ children: category.label
90
+ },
91
+ category.value
92
+ )) }),
80
93
  _categories.map((category) => /* @__PURE__ */ jsxRuntime.jsx(
81
94
  CategorizationTabsPanel,
82
95
  {
83
- value: jsonformsCore_esm.deriveLabelForUISchemaElement(category, t),
96
+ value: getAbsoluteValue.getAbsoluteLabel(category),
84
97
  jsonFormsProps,
85
98
  pt: "xs",
86
99
  ...panelProps,
87
100
  children: /* @__PURE__ */ jsxRuntime.jsx(LayoutPaddingContext.LayoutPaddingContextProvider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsx(layout.MantineLayoutRenderer, { ...childProps, elements: category.elements, renderers, cells }) })
88
101
  },
89
- jsonformsCore_esm.deriveLabelForUISchemaElement(category, t)
102
+ getAbsoluteValue.getAbsoluteLabel(category)
90
103
  ))
91
104
  ] });
92
105
  };
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const getAbsoluteLabel = (element) => element.label ?? element.i18n;
4
+ exports.getAbsoluteLabel = getAbsoluteLabel;
@@ -1,7 +1,8 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
+ import { useLang, FastAPIRTKLogger } from "fastapi-rtk/core";
2
3
  import { JsonForms } from "../../../../../../../.external/esm/@jsonforms_react@3.6.0_@jsonforms_core@3.6.0_react@18.3.1/@jsonforms/react/lib/jsonforms-react.esm.mjs";
3
4
  import { MantineThemeProvider } from "@mantine/core";
4
- import { memo } from "react";
5
+ import { memo, useMemo } from "react";
5
6
  import { useThemeCustomizer } from "../hooks/useThemeCustomizer.mjs";
6
7
  import { mantineCells } from "../renderers/mantineCells.mjs";
7
8
  import { mantineRenderers } from "../renderers/mantineRenderers.mjs";
@@ -12,9 +13,21 @@ const JsonFormsWithCustomizer = memo(function JsonFormsWithCustomizer2({
12
13
  onChange,
13
14
  customizer,
14
15
  debounce = false,
16
+ translations,
17
+ createTranslator = (locale, translations2 = {}) => (key, defaultMessage) => {
18
+ if (!(key in translations2)) {
19
+ FastAPIRTKLogger.warn(`${locale}: Missing translation for key: ${key}`);
20
+ }
21
+ return (translations2 == null ? void 0 : translations2[key]) ?? defaultMessage;
22
+ },
15
23
  ...props
16
24
  }) {
17
25
  const theme = useThemeCustomizer({ ...customizer, __: { debounce } });
26
+ const { currentLanguage } = useLang({ throwOnError: false });
27
+ const i18n = useMemo(
28
+ () => currentLanguage && translations ? { locale: currentLanguage, translate: createTranslator(currentLanguage, translations == null ? void 0 : translations[currentLanguage]) } : void 0,
29
+ [createTranslator, currentLanguage, translations]
30
+ );
18
31
  return /* @__PURE__ */ jsx(MantineThemeProvider, { theme, children: /* @__PURE__ */ jsx(
19
32
  JsonForms,
20
33
  {
@@ -24,6 +37,7 @@ const JsonFormsWithCustomizer = memo(function JsonFormsWithCustomizer2({
24
37
  cells: mantineCells,
25
38
  data,
26
39
  onChange,
40
+ i18n,
27
41
  ...props
28
42
  }
29
43
  ) });
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { Icon } from "../../../../../../../.external/esm/@iconify_react@6.0.1_react@18.3.1/@iconify/react/dist/iconify.mjs";
2
+ import { Icon } from "../../../../../../../.external/esm/@iconify_react@6.0.2_react@18.3.1/@iconify/react/dist/iconify.mjs";
3
3
  import { useMantineTheme, Group, CloseButton } from "@mantine/core";
4
4
  import { convertUTCStringToLocalString, convertLocalStringToUTCString } from "../utils/utcConverter.mjs";
5
5
  function useDateProps(type, isUTC, { value, toggle, onChange }) {
@@ -1,7 +1,8 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { rankWith, uiTypeIs, isVisible, deriveLabelForUISchemaElement } from "../../../../../../../../.external/esm/@jsonforms_core@3.6.0/@jsonforms/core/lib/jsonforms-core.esm.mjs";
2
+ import { rankWith, uiTypeIs, isVisible } from "../../../../../../../../.external/esm/@jsonforms_core@3.6.0/@jsonforms/core/lib/jsonforms-core.esm.mjs";
3
3
  import { withTranslateProps, withJsonFormsLayoutProps } from "../../../../../../../../.external/esm/@jsonforms_react@3.6.0_@jsonforms_core@3.6.0_react@18.3.1/@jsonforms/react/lib/jsonforms-react.esm.mjs";
4
4
  import { useMemo } from "react";
5
+ import { getAbsoluteLabel } from "../../utils/getAbsoluteValue.mjs";
5
6
  import { withAjvProps } from "../../utils/withAjvProps.mjs";
6
7
  import { withDebounce } from "../../utils/withDebounce.mjs";
7
8
  import { CategorizationCards } from "./variants/CategorizationCards.mjs";
@@ -16,8 +17,8 @@ const Component = (props) => {
16
17
  [categorization.elements, ajv, data]
17
18
  );
18
19
  const labels = useMemo(
19
- () => categorization.elements.map((c) => deriveLabelForUISchemaElement(c, t)).join("|"),
20
- [categorization.elements, t]
20
+ () => categorization.elements.map((c) => getAbsoluteLabel(c)).join("|"),
21
+ [categorization.elements]
21
22
  );
22
23
  const childProps = { schema, path, enabled, visible, direction: "column" };
23
24
  if (((_a = uischema.options) == null ? void 0 : _a.variant) === "card" || ((_b = uischema.options) == null ? void 0 : _b.variant) === "cards") {
@@ -1,10 +1,11 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import { deepMerge } from "fastapi-rtk/utils";
3
3
  import { deriveLabelForUISchemaElement } from "../../../../../../../../../.external/esm/@jsonforms_core@3.6.0/@jsonforms/core/lib/jsonforms-core.esm.mjs";
4
- import { Group, Card } from "@mantine/core";
4
+ import { useMantineTheme, Group, Card } from "@mantine/core";
5
5
  import { useState, useMemo, useEffect } from "react";
6
6
  import { LayoutPaddingContextProvider } from "../../../Contexts/LayoutPaddingContext.mjs";
7
7
  import { useContextProps } from "../../../hooks/useContextProps.mjs";
8
+ import { getAbsoluteLabel } from "../../../utils/getAbsoluteValue.mjs";
8
9
  import { MantineLayoutRenderer } from "../../../utils/layout.mjs";
9
10
  const CategorizationCardsGroup = ({ labels, jsonFormsProps, children, ...props }) => {
10
11
  const [, _props] = useContextProps(
@@ -26,7 +27,7 @@ const CategorizationCardsCard = ({ value, jsonFormsProps, children, ...props })
26
27
  false
27
28
  );
28
29
  const mergedProps = useMemo(() => deepMerge(props, _props), [props, _props]);
29
- return /* @__PURE__ */ jsx(Card, { withBorder: true, shadow: "md", p: "xs", ...mergedProps, children: mergedProps.children });
30
+ return /* @__PURE__ */ jsx(Card, { withBorder: true, shadow: "md", p: "xs", radius: "sm", ...mergedProps, children: mergedProps.children });
30
31
  };
31
32
  const CategorizationCards = ({
32
33
  labels,
@@ -38,7 +39,8 @@ const CategorizationCards = ({
38
39
  t,
39
40
  jsonFormsProps
40
41
  }) => {
41
- const [_value, _onChange] = useState((_categories == null ? void 0 : _categories[0]) ? deriveLabelForUISchemaElement(_categories[0], t) : "");
42
+ const theme = useMantineTheme();
43
+ const [_value, _onChange] = useState((_categories == null ? void 0 : _categories[0]) ? getAbsoluteLabel(_categories[0]) : "");
42
44
  const contextPath = `Categorization.Cards.[${labels}]`;
43
45
  const [, componentProps] = useContextProps(
44
46
  `Categorization.Cards`,
@@ -54,31 +56,37 @@ const CategorizationCards = ({
54
56
  );
55
57
  const { categories, value, onChange, groupProps, cardProps } = componentProps;
56
58
  const categoryLabels = useMemo(
57
- () => categories.map((category) => deriveLabelForUISchemaElement(category, t)),
59
+ () => categories.map((category) => ({
60
+ value: getAbsoluteLabel(category),
61
+ label: deriveLabelForUISchemaElement(category, t)
62
+ })),
58
63
  [categories, t]
59
64
  );
60
65
  useEffect(() => {
61
- if (!categoryLabels.includes(value)) {
62
- onChange((categories == null ? void 0 : categories[0]) ? deriveLabelForUISchemaElement(categories[0], t) : "");
66
+ if (!categoryLabels.map((c) => c.value).includes(value)) {
67
+ onChange((categories == null ? void 0 : categories[0]) ? categories[0].value : "");
63
68
  }
64
69
  }, [categoryLabels]);
65
70
  return /* @__PURE__ */ jsxs(Fragment, { children: [
66
- /* @__PURE__ */ jsx(CategorizationCardsGroup, { labels, jsonFormsProps, ...groupProps, children: categoryLabels.map((label) => /* @__PURE__ */ jsx(
71
+ /* @__PURE__ */ jsx(CategorizationCardsGroup, { labels, jsonFormsProps, ...groupProps, children: categoryLabels.map((cl) => /* @__PURE__ */ jsx(
67
72
  CategorizationCardsCard,
68
73
  {
69
- value: label,
74
+ value: cl.value,
70
75
  jsonFormsProps,
71
76
  onClick: (e) => {
72
77
  e.stopPropagation();
73
- onChange(label);
78
+ onChange(cl.value);
79
+ },
80
+ style: {
81
+ cursor: "pointer",
82
+ border: cl.value === value ? `2px solid ${theme.colors[theme.primaryColor][6]}` : void 0
74
83
  },
75
- style: { cursor: "pointer" },
76
84
  ...cardProps,
77
- children: label
85
+ children: cl.label
78
86
  },
79
- label
87
+ cl.value
80
88
  )) }),
81
- categories.filter((category) => deriveLabelForUISchemaElement(category, t) === value).map((category) => /* @__PURE__ */ jsx(LayoutPaddingContextProvider, { value: true, children: /* @__PURE__ */ jsx(MantineLayoutRenderer, { ...childProps, elements: category.elements, renderers, cells }) }, deriveLabelForUISchemaElement(category, t)))
89
+ categories.filter((category) => getAbsoluteLabel(category) === value).map((category) => /* @__PURE__ */ jsx(LayoutPaddingContextProvider, { value: true, children: /* @__PURE__ */ jsx(MantineLayoutRenderer, { ...childProps, elements: category.elements, renderers, cells }) }, getAbsoluteLabel(category)))
82
90
  ] });
83
91
  };
84
92
  export {
@@ -5,6 +5,7 @@ import { Stepper, Group, Button } from "@mantine/core";
5
5
  import { useState, useMemo, useEffect } from "react";
6
6
  import { LayoutPaddingContextProvider } from "../../../Contexts/LayoutPaddingContext.mjs";
7
7
  import { useContextProps } from "../../../hooks/useContextProps.mjs";
8
+ import { getAbsoluteLabel } from "../../../utils/getAbsoluteValue.mjs";
8
9
  import { MantineLayoutRenderer } from "../../../utils/layout.mjs";
9
10
  const CategorizationStepperStep = ({ label, description, jsonFormsProps, children, ...props }) => {
10
11
  const [, _props] = useContextProps(
@@ -39,7 +40,7 @@ const CategorizationStepper = ({
39
40
  jsonFormsProps,
40
41
  showNavButtons
41
42
  }) => {
42
- const [_value, _onChange] = useState((_categories == null ? void 0 : _categories[0]) ? deriveLabelForUISchemaElement(_categories[0], t) : "");
43
+ const [_value, _onChange] = useState((_categories == null ? void 0 : _categories[0]) ? getAbsoluteLabel(_categories[0]) : "");
43
44
  const contextPath = `Categorization.Stepper.[${labels}]`;
44
45
  const [, componentProps] = useContextProps(
45
46
  `Categorization.Stepper`,
@@ -55,31 +56,34 @@ const CategorizationStepper = ({
55
56
  );
56
57
  const { categories, value, onChange, stepProps, buttonProps, ...rest } = componentProps;
57
58
  const categoryLabels = useMemo(
58
- () => categories.map((category) => deriveLabelForUISchemaElement(category, t)),
59
+ () => categories.map((category) => ({
60
+ value: getAbsoluteLabel(category),
61
+ label: deriveLabelForUISchemaElement(category, t)
62
+ })),
59
63
  [categories, t]
60
64
  );
61
65
  useEffect(() => {
62
- if (!categoryLabels.includes(value)) {
63
- onChange((categories == null ? void 0 : categories[0]) ? deriveLabelForUISchemaElement(categories[0], t) : "");
66
+ if (!categoryLabels.map((c) => c.value).includes(value)) {
67
+ onChange((categories == null ? void 0 : categories[0]) ? categories[0].value : "");
64
68
  }
65
69
  }, [categoryLabels]);
66
70
  return /* @__PURE__ */ jsxs(Fragment, { children: [
67
71
  /* @__PURE__ */ jsx(
68
72
  Stepper,
69
73
  {
70
- active: categoryLabels.indexOf(value),
71
- onStepClick: (index) => onChange(categoryLabels[index]),
74
+ active: categoryLabels.findIndex((cl) => cl.value === value),
75
+ onStepClick: (index) => onChange(categoryLabels[index].value),
72
76
  ...rest,
73
77
  children: categories.map((category) => /* @__PURE__ */ jsx(
74
78
  CategorizationStepperStep,
75
79
  {
76
- label: deriveLabelForUISchemaElement(category, t),
80
+ label: getAbsoluteLabel(category),
77
81
  description: category.description,
78
82
  jsonFormsProps,
79
83
  ...stepProps,
80
84
  children: /* @__PURE__ */ jsx(LayoutPaddingContextProvider, { value: true, children: /* @__PURE__ */ jsx(MantineLayoutRenderer, { ...childProps, elements: category.elements, renderers, cells }) })
81
85
  },
82
- deriveLabelForUISchemaElement(category, t)
86
+ getAbsoluteLabel(category)
83
87
  ))
84
88
  }
85
89
  ),
@@ -90,9 +94,9 @@ const CategorizationStepper = ({
90
94
  labels,
91
95
  name: "Previous",
92
96
  onClick: () => {
93
- const currentIndex = categoryLabels.indexOf(value);
97
+ const currentIndex = categoryLabels.findIndex((cl) => cl.value === value);
94
98
  if (currentIndex > 0) {
95
- onChange(categoryLabels[currentIndex - 1]);
99
+ onChange(categoryLabels[currentIndex - 1].value);
96
100
  }
97
101
  },
98
102
  jsonFormsProps,
@@ -106,9 +110,9 @@ const CategorizationStepper = ({
106
110
  labels,
107
111
  name: "Next",
108
112
  onClick: () => {
109
- const currentIndex = categoryLabels.indexOf(value);
113
+ const currentIndex = categoryLabels.findIndex((cl) => cl.value === value);
110
114
  if (currentIndex < categoryLabels.length - 1) {
111
- onChange(categoryLabels[currentIndex + 1]);
115
+ onChange(categoryLabels[currentIndex + 1].value);
112
116
  }
113
117
  },
114
118
  jsonFormsProps,
@@ -5,6 +5,7 @@ import { Tabs } from "@mantine/core";
5
5
  import { useState, useMemo, useEffect } from "react";
6
6
  import { LayoutPaddingContextProvider } from "../../../Contexts/LayoutPaddingContext.mjs";
7
7
  import { useContextProps } from "../../../hooks/useContextProps.mjs";
8
+ import { getAbsoluteLabel } from "../../../utils/getAbsoluteValue.mjs";
8
9
  import { MantineLayoutRenderer } from "../../../utils/layout.mjs";
9
10
  const CategorizationTabsList = ({ labels, jsonFormsProps, children, ...props }) => {
10
11
  const [, _props] = useContextProps(
@@ -49,7 +50,7 @@ const CategorizationTabs = ({
49
50
  t,
50
51
  jsonFormsProps
51
52
  }) => {
52
- const [_value, _onChange] = useState((_categories == null ? void 0 : _categories[0]) ? deriveLabelForUISchemaElement(_categories[0], t) : "");
53
+ const [_value, _onChange] = useState((_categories == null ? void 0 : _categories[0]) ? getAbsoluteLabel(_categories[0]) : "");
53
54
  const contextPath = `Categorization.Tabs.[${labels}]`;
54
55
  const [, componentProps] = useContextProps(
55
56
  `Categorization.Tabs`,
@@ -65,26 +66,38 @@ const CategorizationTabs = ({
65
66
  );
66
67
  const { categories, value, onChange, listProps, tabProps, panelProps, ...rest } = componentProps;
67
68
  const categoryLabels = useMemo(
68
- () => categories.map((category) => deriveLabelForUISchemaElement(category, t)),
69
+ () => categories.map((category) => ({
70
+ value: getAbsoluteLabel(category),
71
+ label: deriveLabelForUISchemaElement(category, t)
72
+ })),
69
73
  [categories, t]
70
74
  );
71
75
  useEffect(() => {
72
- if (!categoryLabels.includes(value)) {
73
- onChange((categories == null ? void 0 : categories[0]) ? deriveLabelForUISchemaElement(categories[0], t) : "");
76
+ if (!categoryLabels.map((c) => c.value).includes(value)) {
77
+ onChange((categories == null ? void 0 : categories[0]) ? categories[0].value : "");
74
78
  }
75
79
  }, [categoryLabels]);
76
80
  return /* @__PURE__ */ jsxs(Tabs, { value, onChange, ...rest, children: [
77
- /* @__PURE__ */ jsx(CategorizationTabsList, { labels, jsonFormsProps, ...listProps, children: categoryLabels.map((label) => /* @__PURE__ */ jsx(CategorizationTabsTab, { value: label, jsonFormsProps, ...tabProps, children: label }, label)) }),
81
+ /* @__PURE__ */ jsx(CategorizationTabsList, { labels, jsonFormsProps, ...listProps, children: categoryLabels.map((category) => /* @__PURE__ */ jsx(
82
+ CategorizationTabsTab,
83
+ {
84
+ value: category.value,
85
+ jsonFormsProps,
86
+ ...tabProps,
87
+ children: category.label
88
+ },
89
+ category.value
90
+ )) }),
78
91
  _categories.map((category) => /* @__PURE__ */ jsx(
79
92
  CategorizationTabsPanel,
80
93
  {
81
- value: deriveLabelForUISchemaElement(category, t),
94
+ value: getAbsoluteLabel(category),
82
95
  jsonFormsProps,
83
96
  pt: "xs",
84
97
  ...panelProps,
85
98
  children: /* @__PURE__ */ jsx(LayoutPaddingContextProvider, { value: true, children: /* @__PURE__ */ jsx(MantineLayoutRenderer, { ...childProps, elements: category.elements, renderers, cells }) })
86
99
  },
87
- deriveLabelForUISchemaElement(category, t)
100
+ getAbsoluteLabel(category)
88
101
  ))
89
102
  ] });
90
103
  };
@@ -0,0 +1,4 @@
1
+ const getAbsoluteLabel = (element) => element.label ?? element.i18n;
2
+ export {
3
+ getAbsoluteLabel
4
+ };