fastapi-rtk 0.2.41 → 0.2.43
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/.bundled/jsonforms/cjs/packages/jsonforms/src/JsonFormsWithCustomizer/JsonFormsWithCustomizer.cjs +25 -2
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineEnumArrayInput.cjs +1 -1
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineEnumInput.cjs +1 -1
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineOneOfEnumInput.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/hooks/useDateProps.cjs +1 -1
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/hooks/useMultiSelectProps.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/hooks/useSelectProps.cjs +1 -6
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Categorization/MantineCategorizationLayoutRenderer.cjs +3 -2
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Categorization/variants/CategorizationCards.cjs +20 -12
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Categorization/variants/CategorizationStepper.cjs +16 -12
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Categorization/variants/CategorizationTabs.cjs +20 -7
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/utils/getAbsoluteValue.cjs +4 -0
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/JsonFormsWithCustomizer/JsonFormsWithCustomizer.mjs +24 -1
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineEnumArrayInput.mjs +1 -1
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineEnumInput.mjs +1 -1
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineOneOfEnumInput.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/hooks/useDateProps.mjs +1 -1
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/hooks/useMultiSelectProps.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/hooks/useSelectProps.mjs +1 -6
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Categorization/MantineCategorizationLayoutRenderer.mjs +4 -3
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Categorization/variants/CategorizationCards.mjs +21 -13
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Categorization/variants/CategorizationStepper.mjs +16 -12
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Categorization/variants/CategorizationTabs.mjs +20 -7
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/utils/getAbsoluteValue.mjs +4 -0
- 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
- 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
- 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
- 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
- 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
- package/dist/.external/cjs/{dompurify@3.2.6 → dompurify@3.2.7}/dompurify/dist/purify.es.cjs +26 -16
- 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
- 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
- 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
- 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
- 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
- package/dist/.external/esm/{dompurify@3.2.6 → dompurify@3.2.7}/dompurify/dist/purify.es.mjs +26 -16
- package/dist/core/cjs/ActionIcons/utils/convertToFormInputs.cjs +4 -5
- package/dist/core/cjs/Dialogs/AddDialog.cjs +17 -2
- package/dist/core/cjs/Dialogs/EditDialog.cjs +17 -2
- package/dist/core/cjs/Modals/CommonModal.cjs +1 -1
- package/dist/core/cjs/Tables/DataGrid/Main/Body/Field/Field.cjs +1 -1
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilterInput/HeaderInputs/HeaderBetweenInput.cjs +7 -2
- package/dist/core/cjs/Wrappers/ApiProvider/ApiProvider.cjs +4 -0
- package/dist/core/cjs/Wrappers/ApiProvider/hooks/useProvideApi.cjs +11 -4
- package/dist/core/cjs/Wrappers/Provider/Provider.cjs +2 -2
- package/dist/core/cjs/Wrappers/Provider/hooks/useProvideAuth.cjs +2 -2
- package/dist/core/cjs/Wrappers/Provider/hooks/useProvideInfo.cjs +1 -1
- package/dist/core/cjs/translations/de.cjs +6 -1
- package/dist/core/esm/ActionIcons/utils/convertToFormInputs.mjs +4 -5
- package/dist/core/esm/Dialogs/AddDialog.mjs +17 -2
- package/dist/core/esm/Dialogs/EditDialog.mjs +17 -2
- package/dist/core/esm/Modals/CommonModal.mjs +1 -1
- package/dist/core/esm/Tables/DataGrid/Main/Body/Field/Field.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilterInput/HeaderInputs/HeaderBetweenInput.mjs +7 -2
- package/dist/core/esm/Wrappers/ApiProvider/ApiProvider.mjs +4 -0
- package/dist/core/esm/Wrappers/ApiProvider/hooks/useProvideApi.mjs +11 -4
- package/dist/core/esm/Wrappers/Provider/Provider.mjs +2 -2
- package/dist/core/esm/Wrappers/Provider/hooks/useProvideAuth.mjs +2 -2
- package/dist/core/esm/Wrappers/Provider/hooks/useProvideInfo.mjs +1 -1
- package/dist/core/esm/translations/de.mjs +6 -1
- package/dist/core/lib/Dialogs/AddDialog.d.ts +16 -1
- package/dist/core/lib/Dialogs/EditDialog.d.ts +16 -1
- package/dist/core/lib/Wrappers/ApiProvider/ApiProvider.d.ts +11 -1
- package/dist/core/lib/Wrappers/ApiProvider/hooks/useProvideApi.d.ts +3 -1
- package/dist/core/lib/hooks/api/useApi.d.ts +8 -0
- package/dist/core/lib/translations/de.d.ts +4 -0
- package/dist/jsonforms/cjs/JsonFormsWithCustomizer/JsonFormsWithCustomizer.cjs +25 -2
- package/dist/jsonforms/cjs/MantineInputs/MantineEnumArrayInput.cjs +1 -1
- package/dist/jsonforms/cjs/MantineInputs/MantineEnumInput.cjs +1 -1
- package/dist/jsonforms/cjs/MantineInputs/MantineOneOfEnumInput.cjs +2 -2
- package/dist/jsonforms/cjs/hooks/useDateProps.cjs +1 -1
- package/dist/jsonforms/cjs/hooks/useMultiSelectProps.cjs +2 -2
- package/dist/jsonforms/cjs/hooks/useSelectProps.cjs +1 -6
- package/dist/jsonforms/cjs/layouts/Categorization/MantineCategorizationLayoutRenderer.cjs +3 -2
- package/dist/jsonforms/cjs/layouts/Categorization/variants/CategorizationCards.cjs +23 -15
- package/dist/jsonforms/cjs/layouts/Categorization/variants/CategorizationStepper.cjs +16 -12
- package/dist/jsonforms/cjs/layouts/Categorization/variants/CategorizationTabs.cjs +20 -7
- package/dist/jsonforms/cjs/utils/getAbsoluteValue.cjs +4 -0
- package/dist/jsonforms/esm/JsonFormsWithCustomizer/JsonFormsWithCustomizer.mjs +24 -1
- package/dist/jsonforms/esm/MantineInputs/MantineEnumArrayInput.mjs +1 -1
- package/dist/jsonforms/esm/MantineInputs/MantineEnumInput.mjs +1 -1
- package/dist/jsonforms/esm/MantineInputs/MantineOneOfEnumInput.mjs +2 -2
- package/dist/jsonforms/esm/hooks/useDateProps.mjs +1 -1
- package/dist/jsonforms/esm/hooks/useMultiSelectProps.mjs +2 -2
- package/dist/jsonforms/esm/hooks/useSelectProps.mjs +1 -6
- package/dist/jsonforms/esm/layouts/Categorization/MantineCategorizationLayoutRenderer.mjs +4 -3
- package/dist/jsonforms/esm/layouts/Categorization/variants/CategorizationCards.mjs +21 -13
- package/dist/jsonforms/esm/layouts/Categorization/variants/CategorizationStepper.mjs +16 -12
- package/dist/jsonforms/esm/layouts/Categorization/variants/CategorizationTabs.mjs +20 -7
- package/dist/jsonforms/esm/utils/getAbsoluteValue.mjs +4 -0
- package/dist/jsonforms/lib/JsonFormsWithCustomizer/JsonFormsWithCustomizer.d.ts +3 -0
- package/dist/jsonforms/lib/hooks/useMultiSelectProps.d.ts +11 -8
- package/dist/jsonforms/lib/hooks/useSelectProps.d.ts +7 -12
- package/dist/jsonforms/lib/utils/getAbsoluteValue.d.ts +4 -0
- package/package.json +1 -1
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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,12 +1,19 @@
|
|
|
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");
|
|
9
10
|
const mantineRenderers = require("../renderers/mantineRenderers.cjs");
|
|
11
|
+
const defaultCreateTranslator = (locale, translations = {}, hideWarning = false) => (key, defaultMessage) => {
|
|
12
|
+
if (!(key in translations) && !hideWarning) {
|
|
13
|
+
core.FastAPIRTKLogger.warn(`${locale}: Missing translation for key: ${key}`);
|
|
14
|
+
}
|
|
15
|
+
return (translations == null ? void 0 : translations[key]) ?? defaultMessage;
|
|
16
|
+
};
|
|
10
17
|
const JsonFormsWithCustomizer = React.memo(function JsonFormsWithCustomizer2({
|
|
11
18
|
schema,
|
|
12
19
|
uischema,
|
|
@@ -14,10 +21,25 @@ const JsonFormsWithCustomizer = React.memo(function JsonFormsWithCustomizer2({
|
|
|
14
21
|
onChange,
|
|
15
22
|
customizer,
|
|
16
23
|
debounce = false,
|
|
24
|
+
translations,
|
|
25
|
+
hideWarnings,
|
|
26
|
+
createTranslator = defaultCreateTranslator,
|
|
17
27
|
...props
|
|
18
28
|
}) {
|
|
19
29
|
const theme = useThemeCustomizer.useThemeCustomizer({ ...customizer, __: { debounce } });
|
|
20
|
-
|
|
30
|
+
const { currentLanguage } = core.useLang({ throwOnError: false });
|
|
31
|
+
const i18n = React.useMemo(
|
|
32
|
+
() => currentLanguage && translations ? {
|
|
33
|
+
locale: currentLanguage,
|
|
34
|
+
translate: createTranslator(
|
|
35
|
+
currentLanguage,
|
|
36
|
+
translations == null ? void 0 : translations[currentLanguage],
|
|
37
|
+
hideWarnings === true || hideWarnings === currentLanguage
|
|
38
|
+
) || typeof hideWarnings === "object" && !Array.isArray(hideWarnings) && (hideWarnings == null ? void 0 : hideWarnings[currentLanguage]) || Array.isArray(hideWarnings) && hideWarnings.includes(currentLanguage)
|
|
39
|
+
} : void 0,
|
|
40
|
+
[createTranslator, currentLanguage, hideWarnings, translations]
|
|
41
|
+
);
|
|
42
|
+
return /* @__PURE__ */ jsxRuntime.jsx(core$1.MantineThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
21
43
|
jsonformsReact_esm.JsonForms,
|
|
22
44
|
{
|
|
23
45
|
schema,
|
|
@@ -26,6 +48,7 @@ const JsonFormsWithCustomizer = React.memo(function JsonFormsWithCustomizer2({
|
|
|
26
48
|
cells: mantineCells.mantineCells,
|
|
27
49
|
data,
|
|
28
50
|
onChange,
|
|
51
|
+
i18n,
|
|
29
52
|
...props
|
|
30
53
|
}
|
|
31
54
|
) });
|
package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineEnumArrayInput.cjs
CHANGED
|
@@ -9,7 +9,7 @@ const useMultiSelectProps = require("../hooks/useMultiSelectProps.cjs");
|
|
|
9
9
|
function MantineEnumArrayInput({ margin, ...props }) {
|
|
10
10
|
const { value, ...commonProps } = useCommonProps.useCommonProps(props);
|
|
11
11
|
const { path } = props;
|
|
12
|
-
const multiSelectProps = useMultiSelectProps.useMultiSelectProps(value, props.
|
|
12
|
+
const multiSelectProps = useMultiSelectProps.useMultiSelectProps(value, props.options, { onChange: commonProps.onChange });
|
|
13
13
|
const componentProps = React.useMemo(() => ({ ...commonProps, ...multiSelectProps }), [commonProps, multiSelectProps]);
|
|
14
14
|
const [Component, _props] = useContextProps.useContextProps("EnumArray", path, componentProps, props);
|
|
15
15
|
if (!props.visible) {
|
package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineEnumInput.cjs
CHANGED
|
@@ -9,7 +9,7 @@ const useSelectProps = require("../hooks/useSelectProps.cjs");
|
|
|
9
9
|
function MantineEnumInput({ margin, ...props }) {
|
|
10
10
|
const { value, ...commonProps } = useCommonProps.useCommonProps(props);
|
|
11
11
|
const { path } = props;
|
|
12
|
-
const selectProps = useSelectProps.useSelectProps(value, props.
|
|
12
|
+
const selectProps = useSelectProps.useSelectProps(value, props.options);
|
|
13
13
|
const componentProps = React.useMemo(() => ({ ...commonProps, ...selectProps }), [commonProps, selectProps]);
|
|
14
14
|
const [Component, _props] = useContextProps.useContextProps("Enum", path, componentProps, props);
|
|
15
15
|
if (!props.visible) {
|
package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineOneOfEnumInput.cjs
CHANGED
|
@@ -8,8 +8,8 @@ const useContextProps = require("../hooks/useContextProps.cjs");
|
|
|
8
8
|
const useSelectProps = require("../hooks/useSelectProps.cjs");
|
|
9
9
|
function MantineOneOfEnumInput({ margin, ...props }) {
|
|
10
10
|
const { value, ...commonProps } = useCommonProps.useCommonProps(props);
|
|
11
|
-
const { path
|
|
12
|
-
const selectProps = useSelectProps.useSelectProps(value,
|
|
11
|
+
const { path } = props;
|
|
12
|
+
const selectProps = useSelectProps.useSelectProps(value, props.options);
|
|
13
13
|
const errorProps = React.useMemo(() => {
|
|
14
14
|
var _a;
|
|
15
15
|
const isNull = value === null;
|
|
@@ -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.
|
|
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 }) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const useSelectProps = require("./useSelectProps.cjs");
|
|
4
|
-
function useMultiSelectProps(value,
|
|
5
|
-
const props = useSelectProps.useSelectProps(value,
|
|
4
|
+
function useMultiSelectProps(value, options, { onChange }) {
|
|
5
|
+
const props = useSelectProps.useSelectProps(value, options);
|
|
6
6
|
return {
|
|
7
7
|
...props,
|
|
8
8
|
value: props.value || [],
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
|
|
4
|
-
function useSelectProps(value, schema) {
|
|
5
|
-
const options = React.useMemo(
|
|
6
|
-
() => schema.oneOf ? schema.oneOf.map((option) => ({ value: option.const, label: option.title })) : schema.enum,
|
|
7
|
-
[schema.enum, schema.oneOf]
|
|
8
|
-
);
|
|
3
|
+
function useSelectProps(value, options) {
|
|
9
4
|
return { data: options, value: value || null, searchable: true };
|
|
10
5
|
}
|
|
11
6
|
exports.useSelectProps = useSelectProps;
|
|
@@ -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) =>
|
|
22
|
-
[categorization.elements
|
|
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
|
|
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) =>
|
|
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]) ?
|
|
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((
|
|
73
|
+
/* @__PURE__ */ jsxRuntime.jsx(CategorizationCardsGroup, { labels, jsonFormsProps, ...groupProps, children: categoryLabels.map((cl) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
69
74
|
CategorizationCardsCard,
|
|
70
75
|
{
|
|
71
|
-
value:
|
|
76
|
+
value: cl.value,
|
|
72
77
|
jsonFormsProps,
|
|
73
78
|
onClick: (e) => {
|
|
74
79
|
e.stopPropagation();
|
|
75
|
-
onChange(
|
|
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
|
-
|
|
89
|
+
cl.value
|
|
82
90
|
)) }),
|
|
83
|
-
categories.filter((category) =>
|
|
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]) ?
|
|
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) =>
|
|
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]) ?
|
|
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.
|
|
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:
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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]) ?
|
|
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) =>
|
|
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]) ?
|
|
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((
|
|
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:
|
|
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
|
-
|
|
102
|
+
getAbsoluteValue.getAbsoluteLabel(category)
|
|
90
103
|
))
|
|
91
104
|
] });
|
|
92
105
|
};
|
|
@@ -1,10 +1,17 @@
|
|
|
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";
|
|
9
|
+
const defaultCreateTranslator = (locale, translations = {}, hideWarning = false) => (key, defaultMessage) => {
|
|
10
|
+
if (!(key in translations) && !hideWarning) {
|
|
11
|
+
FastAPIRTKLogger.warn(`${locale}: Missing translation for key: ${key}`);
|
|
12
|
+
}
|
|
13
|
+
return (translations == null ? void 0 : translations[key]) ?? defaultMessage;
|
|
14
|
+
};
|
|
8
15
|
const JsonFormsWithCustomizer = memo(function JsonFormsWithCustomizer2({
|
|
9
16
|
schema,
|
|
10
17
|
uischema,
|
|
@@ -12,9 +19,24 @@ const JsonFormsWithCustomizer = memo(function JsonFormsWithCustomizer2({
|
|
|
12
19
|
onChange,
|
|
13
20
|
customizer,
|
|
14
21
|
debounce = false,
|
|
22
|
+
translations,
|
|
23
|
+
hideWarnings,
|
|
24
|
+
createTranslator = defaultCreateTranslator,
|
|
15
25
|
...props
|
|
16
26
|
}) {
|
|
17
27
|
const theme = useThemeCustomizer({ ...customizer, __: { debounce } });
|
|
28
|
+
const { currentLanguage } = useLang({ throwOnError: false });
|
|
29
|
+
const i18n = useMemo(
|
|
30
|
+
() => currentLanguage && translations ? {
|
|
31
|
+
locale: currentLanguage,
|
|
32
|
+
translate: createTranslator(
|
|
33
|
+
currentLanguage,
|
|
34
|
+
translations == null ? void 0 : translations[currentLanguage],
|
|
35
|
+
hideWarnings === true || hideWarnings === currentLanguage
|
|
36
|
+
) || typeof hideWarnings === "object" && !Array.isArray(hideWarnings) && (hideWarnings == null ? void 0 : hideWarnings[currentLanguage]) || Array.isArray(hideWarnings) && hideWarnings.includes(currentLanguage)
|
|
37
|
+
} : void 0,
|
|
38
|
+
[createTranslator, currentLanguage, hideWarnings, translations]
|
|
39
|
+
);
|
|
18
40
|
return /* @__PURE__ */ jsx(MantineThemeProvider, { theme, children: /* @__PURE__ */ jsx(
|
|
19
41
|
JsonForms,
|
|
20
42
|
{
|
|
@@ -24,6 +46,7 @@ const JsonFormsWithCustomizer = memo(function JsonFormsWithCustomizer2({
|
|
|
24
46
|
cells: mantineCells,
|
|
25
47
|
data,
|
|
26
48
|
onChange,
|
|
49
|
+
i18n,
|
|
27
50
|
...props
|
|
28
51
|
}
|
|
29
52
|
) });
|
package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineEnumArrayInput.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { useMultiSelectProps } from "../hooks/useMultiSelectProps.mjs";
|
|
|
7
7
|
function MantineEnumArrayInput({ margin, ...props }) {
|
|
8
8
|
const { value, ...commonProps } = useCommonProps(props);
|
|
9
9
|
const { path } = props;
|
|
10
|
-
const multiSelectProps = useMultiSelectProps(value, props.
|
|
10
|
+
const multiSelectProps = useMultiSelectProps(value, props.options, { onChange: commonProps.onChange });
|
|
11
11
|
const componentProps = useMemo(() => ({ ...commonProps, ...multiSelectProps }), [commonProps, multiSelectProps]);
|
|
12
12
|
const [Component, _props] = useContextProps("EnumArray", path, componentProps, props);
|
|
13
13
|
if (!props.visible) {
|
package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineEnumInput.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { useSelectProps } from "../hooks/useSelectProps.mjs";
|
|
|
7
7
|
function MantineEnumInput({ margin, ...props }) {
|
|
8
8
|
const { value, ...commonProps } = useCommonProps(props);
|
|
9
9
|
const { path } = props;
|
|
10
|
-
const selectProps = useSelectProps(value, props.
|
|
10
|
+
const selectProps = useSelectProps(value, props.options);
|
|
11
11
|
const componentProps = useMemo(() => ({ ...commonProps, ...selectProps }), [commonProps, selectProps]);
|
|
12
12
|
const [Component, _props] = useContextProps("Enum", path, componentProps, props);
|
|
13
13
|
if (!props.visible) {
|
package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineOneOfEnumInput.mjs
CHANGED
|
@@ -6,8 +6,8 @@ import { useContextProps } from "../hooks/useContextProps.mjs";
|
|
|
6
6
|
import { useSelectProps } from "../hooks/useSelectProps.mjs";
|
|
7
7
|
function MantineOneOfEnumInput({ margin, ...props }) {
|
|
8
8
|
const { value, ...commonProps } = useCommonProps(props);
|
|
9
|
-
const { path
|
|
10
|
-
const selectProps = useSelectProps(value,
|
|
9
|
+
const { path } = props;
|
|
10
|
+
const selectProps = useSelectProps(value, props.options);
|
|
11
11
|
const errorProps = useMemo(() => {
|
|
12
12
|
var _a;
|
|
13
13
|
const isNull = value === null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Icon } from "../../../../../../../.external/esm/@iconify_react@6.0.
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import { useSelectProps } from "./useSelectProps.mjs";
|
|
2
|
-
function useMultiSelectProps(value,
|
|
3
|
-
const props = useSelectProps(value,
|
|
2
|
+
function useMultiSelectProps(value, options, { onChange }) {
|
|
3
|
+
const props = useSelectProps(value, options);
|
|
4
4
|
return {
|
|
5
5
|
...props,
|
|
6
6
|
value: props.value || [],
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
function useSelectProps(value, schema) {
|
|
3
|
-
const options = useMemo(
|
|
4
|
-
() => schema.oneOf ? schema.oneOf.map((option) => ({ value: option.const, label: option.title })) : schema.enum,
|
|
5
|
-
[schema.enum, schema.oneOf]
|
|
6
|
-
);
|
|
1
|
+
function useSelectProps(value, options) {
|
|
7
2
|
return { data: options, value: value || null, searchable: true };
|
|
8
3
|
}
|
|
9
4
|
export {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { rankWith, uiTypeIs, isVisible
|
|
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) =>
|
|
20
|
-
[categorization.elements
|
|
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
|
|
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) =>
|
|
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]) ?
|
|
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((
|
|
71
|
+
/* @__PURE__ */ jsx(CategorizationCardsGroup, { labels, jsonFormsProps, ...groupProps, children: categoryLabels.map((cl) => /* @__PURE__ */ jsx(
|
|
67
72
|
CategorizationCardsCard,
|
|
68
73
|
{
|
|
69
|
-
value:
|
|
74
|
+
value: cl.value,
|
|
70
75
|
jsonFormsProps,
|
|
71
76
|
onClick: (e) => {
|
|
72
77
|
e.stopPropagation();
|
|
73
|
-
onChange(
|
|
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
|
-
|
|
87
|
+
cl.value
|
|
80
88
|
)) }),
|
|
81
|
-
categories.filter((category) =>
|
|
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 {
|