@nocobase/client 1.4.18 → 1.4.20

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.
@@ -84,6 +84,7 @@ export declare class Application {
84
84
  getPublicPath(): string;
85
85
  getApiUrl(pathname?: string): string;
86
86
  getRouteUrl(pathname: string): string;
87
+ getHref(pathname: string): string;
87
88
  getCollectionManager(dataSource?: string): import("../data-source").CollectionManager;
88
89
  /**
89
90
  * @internal
package/es/index.mjs CHANGED
@@ -68,7 +68,7 @@ import * as ahooks from "ahooks";
68
68
  import { useSetState, useRequest as useRequest$1, useBoolean, useUpdate, useLocalStorageState, useEventListener, useMemoizedFn, useDeepCompareEffect, useCreation, useDebounce, useSessionStorageState } from "ahooks";
69
69
  import cloneDeep from "lodash/cloneDeep";
70
70
  import * as nocobaseClientUtils from "@nocobase/utils/client";
71
- import { isPlainObject, tval as tval$1, flatten, getValuesByPath, getDefaultFormat, str2moment, toGmt, toLocal, getPickerFormat, Handlebars, dayjs as dayjs$1, uid as uid$1, error, forEach, isPortalInBody, unflatten as unflatten$1, isURL, parse, nextTick, toFixedByStep, parseHTML } from "@nocobase/utils/client";
71
+ import { isPlainObject, tval as tval$1, flatten, getValuesByPath, getDefaultFormat, str2moment, toGmt, toLocal, getPickerFormat, Handlebars, dayjs as dayjs$1, uid as uid$1, error, getDateTimeFormat, forEach, isPortalInBody, unflatten as unflatten$1, isURL, parse, nextTick, toFixedByStep, parseHTML } from "@nocobase/utils/client";
72
72
  import deepmerge from "deepmerge";
73
73
  import uniq$1 from "lodash/uniq";
74
74
  import template from "lodash/template";
@@ -3896,7 +3896,7 @@ class APIClient extends APIClient$1 {
3896
3896
  o.headers["X-With-ACL-Meta"] = !0;
3897
3897
  const n = this.getHeaders();
3898
3898
  return Object.keys(n).forEach((r) => {
3899
- o.headers[r] = n[r];
3899
+ o.headers[r] = o.headers[r] || n[r];
3900
3900
  }), o;
3901
3901
  }), super.interceptors(), this.useNotificationMiddleware(), this.axios.interceptors.response.use(
3902
3902
  (o) => o,
@@ -4295,7 +4295,7 @@ function addAppVersion(e, t) {
4295
4295
  addAppVersion((n = e.properties) == null ? void 0 : n[o], t);
4296
4296
  }), e;
4297
4297
  }
4298
- const name = "@nocobase/client", version$1 = "1.4.18", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
4298
+ const name = "@nocobase/client", version$1 = "1.4.20", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
4299
4299
  "@ahooksjs/use-url-state": "3.5.1",
4300
4300
  "@ant-design/cssinjs": "^1.11.1",
4301
4301
  "@ant-design/icons": "^5.1.4",
@@ -4317,9 +4317,9 @@ const name = "@nocobase/client", version$1 = "1.4.18", license = "AGPL-3.0", mai
4317
4317
  "@formily/reactive-react": "^2.2.27",
4318
4318
  "@formily/shared": "^2.2.27",
4319
4319
  "@formily/validator": "^2.2.27",
4320
- "@nocobase/evaluators": "1.4.18",
4321
- "@nocobase/sdk": "1.4.18",
4322
- "@nocobase/utils": "1.4.18",
4320
+ "@nocobase/evaluators": "1.4.20",
4321
+ "@nocobase/sdk": "1.4.20",
4322
+ "@nocobase/utils": "1.4.20",
4323
4323
  ahooks: "^3.7.2",
4324
4324
  antd: "5.12.8",
4325
4325
  "antd-style": "3.7.1",
@@ -10704,35 +10704,35 @@ const DatePickerContext = React.createContext({ utc: !0 }), useDatePickerContext
10704
10704
  };
10705
10705
  DatePicker.ReadPretty = ReadPretty$d.DatePicker;
10706
10706
  DatePicker.RangePicker = function(t) {
10707
- const { value: o, picker: n = "date", format: r } = t, { t: i } = useTranslation(), a = useFieldSchema(), l = useField(), { utc: c = !0 } = useDatePickerContext(), u = getDateRanges(), d = useCompile(), p = !a["x-filter-operator"], m = [
10708
- { label: i("Today"), value: u.today },
10709
- { label: i("Last week"), value: u.lastWeek },
10710
- { label: i("This week"), value: u.thisWeek },
10711
- { label: i("Next week"), value: u.nextWeek },
10712
- { label: i("Last month"), value: u.lastMonth },
10713
- { label: i("This month"), value: u.thisMonth },
10714
- { label: i("Next month"), value: u.nextMonth },
10715
- { label: i("Last quarter"), value: u.lastQuarter },
10716
- { label: i("This quarter"), value: u.thisQuarter },
10717
- { label: i("Next quarter"), value: u.nextQuarter },
10718
- { label: i("Last year"), value: u.lastYear },
10719
- { label: i("This year"), value: u.thisYear },
10720
- { label: i("Next year"), value: u.nextYear },
10721
- { label: i("Last 7 days"), value: u.last7Days },
10722
- { label: i("Next 7 days"), value: u.next7Days },
10723
- { label: i("Last 30 days"), value: u.last30Days },
10724
- { label: i("Next 30 days"), value: u.next30Days },
10725
- { label: i("Last 90 days"), value: u.last90Days },
10726
- { label: i("Next 90 days"), value: u.next90Days }
10727
- ], h = o ? inferPickerType(o == null ? void 0 : o[0]) : n, g = getPickerFormat(h) || r, f = v(x({
10728
- utc: c,
10729
- presets: m
10707
+ const { value: o, picker: n = "date", format: r, showTime: i, timeFormat: a } = t, { t: l } = useTranslation(), c = useFieldSchema(), u = useField(), { utc: d = !0 } = useDatePickerContext(), p = getDateRanges(), m = useCompile(), h = !c["x-filter-operator"], g = [
10708
+ { label: l("Today"), value: p.today },
10709
+ { label: l("Last week"), value: p.lastWeek },
10710
+ { label: l("This week"), value: p.thisWeek },
10711
+ { label: l("Next week"), value: p.nextWeek },
10712
+ { label: l("Last month"), value: p.lastMonth },
10713
+ { label: l("This month"), value: p.thisMonth },
10714
+ { label: l("Next month"), value: p.nextMonth },
10715
+ { label: l("Last quarter"), value: p.lastQuarter },
10716
+ { label: l("This quarter"), value: p.thisQuarter },
10717
+ { label: l("Next quarter"), value: p.nextQuarter },
10718
+ { label: l("Last year"), value: p.lastYear },
10719
+ { label: l("This year"), value: p.thisYear },
10720
+ { label: l("Next year"), value: p.nextYear },
10721
+ { label: l("Last 7 days"), value: p.last7Days },
10722
+ { label: l("Next 7 days"), value: p.next7Days },
10723
+ { label: l("Last 30 days"), value: p.last30Days },
10724
+ { label: l("Next 30 days"), value: p.next30Days },
10725
+ { label: l("Last 90 days"), value: p.last90Days },
10726
+ { label: l("Next 90 days"), value: p.next90Days }
10727
+ ], f = o ? inferPickerType(o == null ? void 0 : o[0]) : n, C = getPickerFormat(f) || r, S = v(x({
10728
+ utc: d,
10729
+ presets: g
10730
10730
  }, t), {
10731
- format: g,
10732
- picker: h,
10733
- showTime: t.showTime ? { defaultValue: [dayjs("00:00:00", "HH:mm:ss"), dayjs("00:00:00", "HH:mm:ss")] } : !1
10734
- }), [C, S] = useState(f);
10735
- return p ? /* @__PURE__ */ jsxs(Space$1.Compact, { children: [
10731
+ format: getDateTimeFormat(f, C, i, a),
10732
+ picker: f,
10733
+ showTime: i ? { defaultValue: [dayjs("00:00:00", "HH:mm:ss"), dayjs("23:59:59", "HH:mm:ss")] } : !1
10734
+ }), [b, y] = useState(S);
10735
+ return h ? /* @__PURE__ */ jsxs(Space$1.Compact, { children: [
10736
10736
  /* @__PURE__ */ jsx(
10737
10737
  Select$1,
10738
10738
  {
@@ -10740,8 +10740,8 @@ DatePicker.RangePicker = function(t) {
10740
10740
  "data-testid": "select-picker",
10741
10741
  style: { width: "100px" },
10742
10742
  popupMatchSelectWidth: !1,
10743
- defaultValue: h,
10744
- options: d([
10743
+ defaultValue: f,
10744
+ options: m([
10745
10745
  {
10746
10746
  label: '{{t("Date")}}',
10747
10747
  value: "date"
@@ -10759,35 +10759,35 @@ DatePicker.RangePicker = function(t) {
10759
10759
  value: "year"
10760
10760
  }
10761
10761
  ]),
10762
- onChange: (b) => {
10763
- const y = getPickerFormat(b);
10764
- l.setComponentProps({
10765
- picker: b,
10766
- format: y
10767
- }), f.picker = b, f.format = y, S(f), a["x-component-props"] = v(x({}, t), {
10768
- picker: b,
10769
- format: y
10770
- }), l.value = void 0;
10762
+ onChange: (F) => {
10763
+ const I = getPickerFormat(F), w = getDateTimeFormat(F, I, i, a);
10764
+ u.setComponentProps({
10765
+ picker: F,
10766
+ format: I
10767
+ }), S.picker = F, S.format = w, y(S), c["x-component-props"] = v(x({}, t), {
10768
+ picker: F,
10769
+ format: w
10770
+ }), u.value = void 0;
10771
10771
  }
10772
10772
  }
10773
10773
  ),
10774
- /* @__PURE__ */ jsx(InternalRangePicker, v(x({}, C), { value: o }))
10775
- ] }) : /* @__PURE__ */ jsx(InternalRangePicker, x({}, f));
10774
+ /* @__PURE__ */ jsx(InternalRangePicker, v(x({}, b), { value: o }))
10775
+ ] }) : /* @__PURE__ */ jsx(InternalRangePicker, x({}, S));
10776
10776
  };
10777
10777
  DatePicker.FilterWithPicker = function(t) {
10778
- const { picker: o = "date", format: n } = t, { utc: r = !0 } = useDatePickerContext(), i = Array.isArray(t.value) ? t.value[0] : t.value, a = useCompile(), l = useFieldSchema(), c = i ? inferPickerType(i) : o, u = getPickerFormat(c) || n, d = v(x({
10779
- utc: r
10778
+ const { picker: o = "date", format: n, showTime: r, timeFormat: i } = t, { utc: a = !0 } = useDatePickerContext(), l = Array.isArray(t.value) ? t.value[0] : t.value, c = useCompile(), u = useFieldSchema(), d = l ? inferPickerType(l) : o, p = getPickerFormat(d) || n, m = v(x({
10779
+ utc: a
10780
10780
  }, t), {
10781
10781
  underFilter: !0,
10782
- showTime: t.showTime ? { defaultValue: dayjs("00:00:00", "HH:mm:ss") } : !1,
10783
- format: u,
10784
- picker: c,
10785
- onChange: (g) => {
10782
+ showTime: r ? { defaultValue: dayjs("00:00:00", "HH:mm:ss") } : !1,
10783
+ format: getDateTimeFormat(d, p, r, i),
10784
+ picker: d,
10785
+ onChange: (C) => {
10786
10786
  t.onChange(void 0), setTimeout(() => {
10787
- t.onChange(g);
10787
+ t.onChange(C);
10788
10788
  });
10789
10789
  }
10790
- }), p = useField(), [m, h] = useState(d);
10790
+ }), h = useField(), [g, f] = useState(m);
10791
10791
  return /* @__PURE__ */ jsxs(Space$1.Compact, { children: [
10792
10792
  /* @__PURE__ */ jsx(
10793
10793
  Select$1,
@@ -10796,8 +10796,8 @@ DatePicker.FilterWithPicker = function(t) {
10796
10796
  "data-testid": "select-picker",
10797
10797
  style: { width: "100px" },
10798
10798
  popupMatchSelectWidth: !1,
10799
- defaultValue: c,
10800
- options: a([
10799
+ defaultValue: d,
10800
+ options: c([
10801
10801
  {
10802
10802
  label: '{{t("Date")}}',
10803
10803
  value: "date"
@@ -10815,19 +10815,19 @@ DatePicker.FilterWithPicker = function(t) {
10815
10815
  value: "year"
10816
10816
  }
10817
10817
  ]),
10818
- onChange: (g) => {
10819
- const f = getPickerFormat(g);
10820
- p.setComponentProps({
10821
- picker: g,
10822
- format: f
10823
- }), d.picker = g, d.format = f, h(d), l["x-component-props"] = v(x({}, t), {
10824
- picker: g,
10825
- format: f
10826
- }), p.value = null;
10818
+ onChange: (C) => {
10819
+ const S = getPickerFormat(C), b = getDateTimeFormat(C, S, r, i);
10820
+ h.setComponentProps({
10821
+ picker: C,
10822
+ format: S
10823
+ }), m.picker = C, m.format = b, f(m), u["x-component-props"] = v(x({}, t), {
10824
+ picker: C,
10825
+ format: b
10826
+ }), h.value = null;
10827
10827
  }
10828
10828
  }
10829
10829
  ),
10830
- /* @__PURE__ */ jsx(InternalDatePicker, v(x({}, m), { value: i }))
10830
+ /* @__PURE__ */ jsx(InternalDatePicker, v(x({}, g), { value: l }))
10831
10831
  ] });
10832
10832
  };
10833
10833
  const useDateVariable = ({ operator: e, schema: t, noDisabled: o }) => {
@@ -16671,6 +16671,17 @@ function WorkflowConfig() {
16671
16671
  items: {
16672
16672
  type: "object",
16673
16673
  properties: {
16674
+ sort: {
16675
+ type: "void",
16676
+ "x-component": "ArrayTable.Column",
16677
+ "x-component-props": { width: 50, title: "", align: "center" },
16678
+ properties: {
16679
+ sort: {
16680
+ type: "void",
16681
+ "x-component": "ArrayTable.SortHandle"
16682
+ }
16683
+ }
16684
+ },
16674
16685
  context: {
16675
16686
  type: "void",
16676
16687
  "x-component": "ArrayTable.Column",
@@ -17062,7 +17073,10 @@ const ActionLink = withDynamicSchemaProps(
17062
17073
  "&:hover": { "> .general-schema-designer": { display: "block" } },
17063
17074
  "&.nb-action-link": {
17064
17075
  margin: "-12px",
17065
- padding: "12px"
17076
+ padding: "12px",
17077
+ ".nb-action-title": {
17078
+ marginInlineStart: "0px"
17079
+ }
17066
17080
  },
17067
17081
  "> .general-schema-designer": {
17068
17082
  position: "absolute",
@@ -17512,7 +17526,7 @@ const RenderButtonInner = observer$1(
17512
17526
  "Designer",
17513
17527
  "designerProps"
17514
17528
  ]);
17515
- return !t && ((I = o == null ? void 0 : o.data) != null && I.hidden || !n) ? /* @__PURE__ */ jsx("div", { style: { visibility: "hidden" }, children: " " }) : /* @__PURE__ */ jsxs(
17529
+ return !t && ((I = o == null ? void 0 : o.data) != null && I.hidden || !n) ? null : /* @__PURE__ */ jsxs(
17516
17530
  SortableItem,
17517
17531
  v(x({
17518
17532
  role: "button",
@@ -18772,6 +18786,10 @@ class Application {
18772
18786
  getRouteUrl(t) {
18773
18787
  return this.getPublicPath() + t.replace(/^\//g, "");
18774
18788
  }
18789
+ getHref(t) {
18790
+ const o = this.name;
18791
+ return o && o !== "main" ? this.getPublicPath() + "apps/" + o + "/" + t.replace(/^\//g, "") : this.getPublicPath() + t.replace(/^\//g, "");
18792
+ }
18775
18793
  getCollectionManager(t) {
18776
18794
  var o;
18777
18795
  return (o = this.dataSourceManager.getDataSource(t)) == null ? void 0 : o.collectionManager;
@@ -22082,7 +22100,7 @@ const SchemaSettingsWrapper = (e) => {
22082
22100
  {
22083
22101
  className: designerCss$4({
22084
22102
  margin: o ? "-12px -8px" : "-18px -16px",
22085
- padding: o ? "12px 8px" : "18px 16px"
22103
+ padding: o ? "12px 8px" : "12px 16px"
22086
22104
  }),
22087
22105
  children: [
22088
22106
  /* @__PURE__ */ jsx(t, {}),
@@ -22131,7 +22149,7 @@ const useColumnSchema$1 = () => {
22131
22149
  {
22132
22150
  className: designerCss$4({
22133
22151
  margin: l ? "-12px -8px" : "-18px -16px",
22134
- padding: l ? "12px 8px" : "18px 16px"
22152
+ padding: l ? "12px 8px" : "12px 16px"
22135
22153
  }),
22136
22154
  children: /* @__PURE__ */ jsxs(CollectionFieldContext.Provider, { value: i, children: [
22137
22155
  /* @__PURE__ */ jsx(t, { fieldSchema: n, uiSchema: r, collectionField: i }),
@@ -26347,9 +26365,9 @@ const FilterFormDesigner = () => /* @__PURE__ */ jsx(GeneralSchemaDesigner, { sc
26347
26365
  l(t.name, c), _.set(t, "x-filter-operator", c);
26348
26366
  const u = i.find((S) => S.value === c);
26349
26367
  let d = x({}, t["x-component-props"]);
26350
- o.value = void 0, (p = u == null ? void 0 : u.schema) != null && p["x-component"] && !(u != null && u.onlyFilterAction) ? (_.set(t, "x-component-props.component", (m = u.schema) == null ? void 0 : m["x-component"]), _.set(o, "componentProps.component", (h = u.schema) == null ? void 0 : h["x-component"]), d = x(v(x({}, t["x-component-props"]), {
26368
+ o.value = void 0, (p = u == null ? void 0 : u.schema) != null && p["x-component"] && !(u != null && u.onlyFilterAction) ? (_.set(t, "x-component-props.component", (m = u.schema) == null ? void 0 : m["x-component"]), _.set(o, "componentProps.component", (h = u.schema) == null ? void 0 : h["x-component"]), d = x(x(v(x({}, t["x-component-props"]), {
26351
26369
  component: u.schema["x-component"]
26352
- }), (g = u.schema) == null ? void 0 : g["x-component-props"])) : (f = t["x-component-props"]) != null && f.component && (_.set(t, "x-component-props.component", null), _.set(o, "componentProps.component", null), d = x(v(x({}, t["x-component-props"]), {
26370
+ }), o.componentProps), (g = u.schema) == null ? void 0 : g["x-component-props"])) : (f = t["x-component-props"]) != null && f.component && (_.set(t, "x-component-props.component", null), _.set(o, "componentProps.component", null), d = x(v(x({}, t["x-component-props"]), {
26353
26371
  component: null
26354
26372
  }), (C = u.schema) == null ? void 0 : C["x-component-props"])), o.componentProps = d, r.emit("patch", {
26355
26373
  schema: {
@@ -28892,6 +28910,9 @@ const getVariableComponentWithScope = (e) => (t) => {
28892
28910
  return v(x({}, t), {
28893
28911
  collectionName: e
28894
28912
  });
28913
+ },
28914
+ useVisible() {
28915
+ return !useFieldSchema().parent["x-initializer"].includes("bulkEditForm");
28895
28916
  }
28896
28917
  },
28897
28918
  {
@@ -28909,11 +28930,17 @@ const getVariableComponentWithScope = (e) => (t) => {
28909
28930
  },
28910
28931
  {
28911
28932
  name: "assignFieldValues",
28912
- Component: AssignedFieldValues
28933
+ Component: AssignedFieldValues,
28934
+ useVisible() {
28935
+ return !useFieldSchema().parent["x-initializer"].includes("bulkEditForm");
28936
+ }
28913
28937
  },
28914
28938
  {
28915
28939
  name: "skipRequiredValidation",
28916
- Component: SkipValidation
28940
+ Component: SkipValidation,
28941
+ useVisible() {
28942
+ return !useFieldSchema().parent["x-initializer"].includes("bulkEditForm");
28943
+ }
28917
28944
  },
28918
28945
  {
28919
28946
  name: "afterSuccessfulSubmission",
@@ -34006,7 +34033,8 @@ const ReadPretty$b = observer$1(
34006
34033
  children: m.label
34007
34034
  })
34008
34035
  )
34009
- )
34036
+ ),
34037
+ maxTagCount: "responsive"
34010
34038
  }, u)
34011
34039
  );
34012
34040
  }, filterOption = (e, t) => {
@@ -34061,7 +34089,8 @@ const ReadPretty$b = observer$1(
34061
34089
  var p;
34062
34090
  (p = e.onChange) == null || p.call(e, d === void 0 ? null : d);
34063
34091
  },
34064
- mode: l
34092
+ mode: l,
34093
+ maxTagCount: "responsive"
34065
34094
  })
34066
34095
  );
34067
34096
  },
@@ -40826,9 +40855,6 @@ const InternalListBlockProvider = (e) => {
40826
40855
  "div",
40827
40856
  {
40828
40857
  className: cx(css`
40829
- .ant-description-input {
40830
- line-height: 34px;
40831
- }
40832
40858
  .ant-formily-item-feedback-layout-loose {
40833
40859
  margin-bottom: 12px;
40834
40860
  }
@@ -43507,7 +43533,9 @@ const useStyles$2 = genStyleHook("nb-rich-text", (e) => {
43507
43533
  modules: i,
43508
43534
  formats: a,
43509
43535
  value: p,
43510
- onChange: u,
43536
+ onChange: (m) => {
43537
+ u(m === "<p><br></p>" ? void 0 : m);
43538
+ },
43511
43539
  readOnly: d
43512
43540
  }
43513
43541
  )
@@ -46227,7 +46255,7 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
46227
46255
  isDialect: (o) => (e == null ? void 0 : e.dialect) === o,
46228
46256
  dialect: e == null ? void 0 : e.dialect
46229
46257
  };
46230
- }, supportTypes = ["string", "bigInt", "integer", "uuid", "uid"], SourceForeignKey = observer$1(
46258
+ }, supportTypes = ["string", "bigInt", "integer", "uuid", "uid", "nanoid"], SourceForeignKey = observer$1(
46231
46259
  () => {
46232
46260
  const e = useRecord(), { getCollection: t } = useCollectionManager_deprecated(), o = e != null && e.collectionName ? t(e.collectionName) : e, n = useField();
46233
46261
  useForm();
@@ -46328,7 +46356,8 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
46328
46356
  options: l,
46329
46357
  defaultValue: t || ((u = l == null ? void 0 : l[0]) == null ? void 0 : u.value),
46330
46358
  onChange: e == null ? void 0 : e.onChange,
46331
- showSearch: !0
46359
+ showSearch: !0,
46360
+ filterOption: (d, p) => p == null ? void 0 : p.label.toLowerCase().includes(d.toLowerCase())
46332
46361
  }
46333
46362
  ) });
46334
46363
  },
@@ -46339,7 +46368,7 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
46339
46368
  return h.required = !0, useEffect(() => {
46340
46369
  var g;
46341
46370
  r && c(
46342
- (g = a(r).fields) == null ? void 0 : g.filter((f) => i !== "hasMany" ? f.primaryKey || f.unique : supportTypes.includes(f.type)).map((f) => {
46371
+ (g = a(r).fields) == null ? void 0 : g.filter((f) => f.primaryKey || f.unique ? !0 : i === "hasMany" && supportTypes.includes(f.type)).map((f) => {
46343
46372
  var C;
46344
46373
  return {
46345
46374
  value: f.name,
@@ -46356,7 +46385,7 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
46356
46385
  var S;
46357
46386
  const { target: f, type: C } = p.values;
46358
46387
  f && g && c(
46359
- (S = a(f).fields) == null ? void 0 : S.filter((b) => C !== "hasMany" ? b.primaryKey || b.unique : supportTypes.includes(b.type)).map((b) => {
46388
+ (S = a(f).fields) == null ? void 0 : S.filter((b) => b.primaryKey || b.unique ? !0 : C === "hasMany" && supportTypes.includes(b.type)).map((b) => {
46360
46389
  var y;
46361
46390
  return {
46362
46391
  value: b.name,
@@ -46370,28 +46399,29 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
46370
46399
  (f = e == null ? void 0 : e.onChange) == null || f.call(e, g), d(g);
46371
46400
  },
46372
46401
  value: u,
46373
- disabled: o
46402
+ disabled: o,
46403
+ filterOption: (g, f) => f == null ? void 0 : f.label.toLowerCase().includes(g.toLowerCase())
46374
46404
  }
46375
46405
  ) });
46376
46406
  },
46377
46407
  { displayName: "TargetKey" }
46378
46408
  ), ForeignKey = observer$1(
46379
46409
  (e) => {
46380
- const { disabled: t } = e, [o, n] = useState([]), { getCollection: r } = useCollectionManager_deprecated(), i = useRecord(), a = useField(), { collectionName: l, target: c, type: u, through: d, name: p, template: m } = i, h = i[a.props.name], g = useCompile(), f = useForm(), [C, S] = useState(h || (m === "view" ? null : a.initialValue));
46410
+ const { disabled: t } = e, [o, n] = useState([]), { getCollection: r } = useCollectionManager_deprecated(), i = useRecord(), a = useField(), { collectionName: l, target: c, type: u, through: d, name: p, template: m } = i, h = i[a.props.name], g = useCompile(), f = useForm(), [C, S] = useState(h || (m === "view" ? null : a.initialValue)), [b, y] = useState([]);
46381
46411
  return useEffect(() => {
46382
- var I;
46383
- const y = ["belongsTo"].includes(u) ? l : ["belongsToMany"].includes(u) ? d : c, F = (I = r(y)) == null ? void 0 : I.fields;
46384
- if (F) {
46385
- const w = F == null ? void 0 : F.filter((k) => supportTypes.includes(k.type)).map((k) => {
46386
- var A;
46412
+ var k;
46413
+ const I = ["belongsTo"].includes(u) ? l : ["belongsToMany"].includes(u) ? d : c, w = (k = r(I)) == null ? void 0 : k.fields;
46414
+ if (w) {
46415
+ const A = w == null ? void 0 : w.filter((D) => supportTypes.includes(D.type)).map((D) => {
46416
+ var B;
46387
46417
  return {
46388
- value: k.name,
46389
- label: g(((A = k.uiSchema) == null ? void 0 : A.title) || k.name)
46418
+ value: D.name,
46419
+ label: g(((B = D.uiSchema) == null ? void 0 : B.title) || D.name)
46390
46420
  };
46391
46421
  });
46392
- if (n(w), h) {
46393
- const k = w.find((A) => A.value === h);
46394
- S((k == null ? void 0 : k.label) || h);
46422
+ if (n(A), y(A), h) {
46423
+ const D = A.find((B) => B.value === h);
46424
+ S((D == null ? void 0 : D.label) || h);
46395
46425
  }
46396
46426
  }
46397
46427
  }, [u]), /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
@@ -46401,25 +46431,32 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
46401
46431
  value: C,
46402
46432
  options: o,
46403
46433
  showSearch: !0,
46404
- onDropdownVisibleChange: (y) => V(void 0, null, function* () {
46405
- var A;
46406
- const { target: F, type: I, through: w } = f.values, k = ["belongsTo"].includes(I) ? l || p : ["belongsToMany"].includes(I) ? w : F;
46407
- if (k && y) {
46408
- const D = ((A = r(k)) == null ? void 0 : A.fields) || [];
46434
+ onDropdownVisibleChange: (I) => V(void 0, null, function* () {
46435
+ var B;
46436
+ const { target: w, type: k, through: A } = f.values, D = ["belongsTo"].includes(k) ? l || p : ["belongsToMany"].includes(k) ? A : w;
46437
+ if (D && I) {
46438
+ const z = ((B = r(D)) == null ? void 0 : B.fields) || [];
46409
46439
  n(
46410
- D == null ? void 0 : D.filter((B) => supportTypes.includes(B.type)).map((B) => {
46411
- var z;
46440
+ z == null ? void 0 : z.filter((O) => supportTypes.includes(O.type)).map((O) => {
46441
+ var j;
46412
46442
  return {
46413
- value: B.name,
46414
- label: g(((z = B.uiSchema) == null ? void 0 : z.title) || B.name)
46443
+ value: O.name,
46444
+ label: g(((j = O.uiSchema) == null ? void 0 : j.title) || O.name)
46415
46445
  };
46416
46446
  })
46417
46447
  );
46418
46448
  }
46419
46449
  }),
46420
- onChange: (y, F) => {
46421
- var I;
46422
- (I = e == null ? void 0 : e.onChange) == null || I.call(e, y), S(F.label || y);
46450
+ onChange: (I, w) => {
46451
+ var k;
46452
+ (k = e == null ? void 0 : e.onChange) == null || k.call(e, I), S(w.label || I);
46453
+ },
46454
+ onSearch: (I) => {
46455
+ if (I) {
46456
+ const w = I.toLocaleLowerCase(), k = o.filter((A) => A.label.toLocaleLowerCase().includes(w));
46457
+ n(k);
46458
+ } else
46459
+ n(b);
46423
46460
  }
46424
46461
  }
46425
46462
  ) });
@@ -55482,7 +55519,8 @@ const AdminSettingsLayout = () => {
55482
55519
  {
55483
55520
  style: { marginLeft: -t.margin },
55484
55521
  onClick: ({ key: C }) => {
55485
- n(replaceRouteParams(o.pluginSettingsManager.getRoutePath(C), i));
55522
+ const S = replaceRouteParams(o.pluginSettingsManager.getRoutePath(C), i);
55523
+ r.pathname !== S && n(S);
55486
55524
  },
55487
55525
  selectedKeys: [d == null ? void 0 : d.name],
55488
55526
  mode: "horizontal",