@carlonicora/nextjs-jsonapi 1.55.2 → 1.56.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8344,7 +8344,7 @@ __name(FormCheckbox, "FormCheckbox");
8344
8344
  import dynamic from "next/dynamic";
8345
8345
  import React14 from "react";
8346
8346
  import { jsx as jsx67 } from "react/jsx-runtime";
8347
- var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-LRXOWMLQ.mjs"), {
8347
+ var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-35AYRFUO.mjs"), {
8348
8348
  ssr: false
8349
8349
  });
8350
8350
  var BlockNoteEditorContainer = React14.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
@@ -9034,16 +9034,18 @@ __name(FormPlaceAutocomplete, "FormPlaceAutocomplete");
9034
9034
 
9035
9035
  // src/components/forms/FormSelect.tsx
9036
9036
  import { jsx as jsx75, jsxs as jsxs42 } from "react/jsx-runtime";
9037
+ var EMPTY_VALUE = "__empty__";
9037
9038
  function FormSelect({
9038
9039
  form,
9039
9040
  id,
9040
9041
  name,
9041
- placeholder: _placeholder,
9042
+ placeholder,
9042
9043
  disabled,
9043
9044
  values,
9044
9045
  onChange,
9045
9046
  useRows,
9046
- testId
9047
+ testId,
9048
+ allowEmpty
9047
9049
  }) {
9048
9050
  return /* @__PURE__ */ jsx75("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsx75(
9049
9051
  FormFieldWrapper,
@@ -9057,15 +9059,19 @@ function FormSelect({
9057
9059
  Select,
9058
9060
  {
9059
9061
  onValueChange: (e) => {
9060
- field.onChange(e);
9061
- if (onChange) onChange(e);
9062
+ const actual = e === EMPTY_VALUE ? "" : e;
9063
+ field.onChange(actual);
9064
+ if (onChange) onChange(actual);
9062
9065
  },
9063
- value: field.value,
9066
+ value: field.value || (allowEmpty ? EMPTY_VALUE : field.value),
9064
9067
  disabled,
9065
9068
  "data-testid": testId,
9066
9069
  children: [
9067
- /* @__PURE__ */ jsx75(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ jsx75(SelectValue, { children: values.find((v) => v.id === field.value)?.text }) }),
9068
- /* @__PURE__ */ jsx75(SelectContent, { children: values.map((type) => /* @__PURE__ */ jsx75(SelectItem, { value: type.id, children: type.text }, type.id)) })
9070
+ /* @__PURE__ */ jsx75(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ jsx75(SelectValue, { children: field.value ? values.find((v) => v.id === field.value)?.text : placeholder ?? "" }) }),
9071
+ /* @__PURE__ */ jsxs42(SelectContent, { children: [
9072
+ allowEmpty && /* @__PURE__ */ jsx75(SelectItem, { value: EMPTY_VALUE, className: "text-muted-foreground", children: placeholder ?? "" }),
9073
+ values.map((type) => /* @__PURE__ */ jsx75(SelectItem, { value: type.id, children: type.text }, type.id))
9074
+ ] })
9069
9075
  ]
9070
9076
  }
9071
9077
  )
@@ -11824,7 +11830,8 @@ function RoundPageContainer({ module, id, details, tabs, children, fullWidth })
11824
11830
  const searchParams = useSearchParams();
11825
11831
  const section = searchParams.get("section");
11826
11832
  const rewriteUrl = useUrlRewriter();
11827
- const defaultValue = tabs ? section && tabs.find((i) => i.key?.name === section)?.key || tabs[0].key : void 0;
11833
+ const initialValue = tabs ? (section && tabs.find((i) => (i.key?.name ?? i.label) === section) ? section : null) || (tabs[0].key?.name ?? tabs[0].label) : void 0;
11834
+ const [activeTab, setActiveTab] = useState39(initialValue);
11828
11835
  return /* @__PURE__ */ jsxs75(Fragment16, { children: [
11829
11836
  /* @__PURE__ */ jsx129(Header, { className: "bg-sidebar border-0", children: headerChildren }),
11830
11837
  /* @__PURE__ */ jsx129("div", { className: "flex h-[calc(100vh-3rem)] w-full flex-col p-2 pt-0 pl-0", children: /* @__PURE__ */ jsx129("div", { className: "bg-background flex h-full w-full rounded-lg border p-0", children: /* @__PURE__ */ jsxs75("div", { className: "flex w-full flex-col", children: [
@@ -11841,12 +11848,15 @@ function RoundPageContainer({ module, id, details, tabs, children, fullWidth })
11841
11848
  /* @__PURE__ */ jsx129("div", { className: cn(`grow overflow-y-auto p-4`, fullWidth && `p-0`), children: /* @__PURE__ */ jsx129("div", { className: cn(`mx-auto max-w-6xl space-y-12 p-8`, fullWidth && `max-w-full w-full p-0`), children: tabs ? /* @__PURE__ */ jsxs75(
11842
11849
  Tabs,
11843
11850
  {
11844
- defaultValue,
11851
+ value: activeTab,
11845
11852
  className: "w-full",
11846
- onValueChange: (key) => module && id && rewriteUrl({ page: module, id, additionalParameters: { section: key } }),
11853
+ onValueChange: (key) => {
11854
+ setActiveTab(key);
11855
+ if (module && id) rewriteUrl({ page: module, id, additionalParameters: { section: key } });
11856
+ },
11847
11857
  children: [
11848
- /* @__PURE__ */ jsx129("div", { className: "p-4", children: /* @__PURE__ */ jsx129(TabsList, { className: ``, children: tabs.map((tab) => /* @__PURE__ */ jsx129(TabsTrigger, { value: tab.label, className: `px-4`, children: tab.contentLabel ?? tab.label }, tab.label)) }) }),
11849
- /* @__PURE__ */ jsx129("div", { className: "flex w-full overflow-y-auto px-4", children: tabs.map((tab) => /* @__PURE__ */ jsx129(TabsContent, { value: tab.label, className: `pb-20`, children: tab.content }, tab.label)) })
11858
+ /* @__PURE__ */ jsx129("div", { className: "p-4", children: /* @__PURE__ */ jsx129(TabsList, { className: ``, children: tabs.map((tab) => /* @__PURE__ */ jsx129(TabsTrigger, { value: tab.key?.name ?? tab.label, className: `px-4`, children: tab.contentLabel ?? tab.label }, tab.label)) }) }),
11859
+ /* @__PURE__ */ jsx129("div", { className: "flex w-full overflow-y-auto px-4", children: tabs.map((tab) => /* @__PURE__ */ jsx129(TabsContent, { value: tab.key?.name ?? tab.label, className: `pb-20`, children: tab.content }, tab.label)) })
11850
11860
  ]
11851
11861
  }
11852
11862
  ) : children }) }),
@@ -18748,4 +18758,4 @@ export {
18748
18758
  useOAuthClients,
18749
18759
  useOAuthClient
18750
18760
  };
18751
- //# sourceMappingURL=chunk-MT26TP7U.mjs.map
18761
+ //# sourceMappingURL=chunk-DIM7E4WN.mjs.map