@nocobase/client 1.3.28-beta → 1.3.30-beta

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/es/index.mjs CHANGED
@@ -328,6 +328,9 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
328
328
  get AssociationField() {
329
329
  return AssociationField;
330
330
  },
331
+ get AssociationFieldMode() {
332
+ return AssociationFieldMode;
333
+ },
331
334
  get AssociationFieldModeProvider() {
332
335
  return AssociationFieldModeProvider;
333
336
  },
@@ -748,6 +751,9 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
748
751
  get useActionContext() {
749
752
  return useActionContext;
750
753
  },
754
+ get useAssociationFieldModeContext() {
755
+ return useAssociationFieldModeContext;
756
+ },
751
757
  get useBackButton() {
752
758
  return useBackButton;
753
759
  },
@@ -1005,6 +1011,9 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1005
1011
  get AssociationField() {
1006
1012
  return AssociationField;
1007
1013
  },
1014
+ get AssociationFieldMode() {
1015
+ return AssociationFieldMode;
1016
+ },
1008
1017
  get AssociationFieldModeProvider() {
1009
1018
  return AssociationFieldModeProvider;
1010
1019
  },
@@ -2949,6 +2958,9 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2949
2958
  get useAssociationCreateActionProps() {
2950
2959
  return useAssociationCreateActionProps;
2951
2960
  },
2961
+ get useAssociationFieldModeContext() {
2962
+ return useAssociationFieldModeContext;
2963
+ },
2952
2964
  get useAssociationFilterBlockProps() {
2953
2965
  return useAssociationFilterBlockProps;
2954
2966
  },
@@ -4110,7 +4122,7 @@ function addAppVersion(e, t) {
4110
4122
  addAppVersion((n = e.properties) == null ? void 0 : n[o], t);
4111
4123
  }), e;
4112
4124
  }
4113
- const name = "@nocobase/client", version$1 = "1.3.28-beta", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
4125
+ const name = "@nocobase/client", version$1 = "1.3.30-beta", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
4114
4126
  "@ahooksjs/use-url-state": "3.5.1",
4115
4127
  "@ant-design/cssinjs": "^1.11.1",
4116
4128
  "@ant-design/icons": "^5.1.4",
@@ -4131,9 +4143,9 @@ const name = "@nocobase/client", version$1 = "1.3.28-beta", license = "AGPL-3.0"
4131
4143
  "@formily/reactive-react": "^2.2.27",
4132
4144
  "@formily/shared": "^2.2.27",
4133
4145
  "@formily/validator": "^2.2.27",
4134
- "@nocobase/evaluators": "1.3.28-beta",
4135
- "@nocobase/sdk": "1.3.28-beta",
4136
- "@nocobase/utils": "1.3.28-beta",
4146
+ "@nocobase/evaluators": "1.3.30-beta",
4147
+ "@nocobase/sdk": "1.3.30-beta",
4148
+ "@nocobase/utils": "1.3.30-beta",
4137
4149
  ahooks: "^3.7.2",
4138
4150
  antd: "5.12.8",
4139
4151
  "antd-style": "3.4.5",
@@ -9674,7 +9686,7 @@ const DataSourceApplicationProvider = (n) => {
9674
9686
  );
9675
9687
  return /* @__PURE__ */ jsxs(Fragment, { children: [
9676
9688
  /* @__PURE__ */ jsx("div", { onMouseOver: () => o(!0), children: e.children || n }),
9677
- /* @__PURE__ */ jsx(Modal, { open: t, footer: null, onCancel: () => o(!1), width: "60%", children: /* @__PURE__ */ jsx(ErrorFallback, g({}, e)) })
9689
+ /* @__PURE__ */ jsx(Modal, { zIndex: 1e4, open: t, footer: null, onCancel: () => o(!1), width: "60%", children: /* @__PURE__ */ jsx(ErrorFallback, g({}, e)) })
9678
9690
  ] });
9679
9691
  }, { Paragraph, Text: Text$1, Link } = Typography, useDownloadLogs = (e, t = {}) => {
9680
9692
  const o = useLocationNoUpdate(), [n, r] = React.useState(!1), i = useAPIClient();
@@ -10996,6 +11008,7 @@ const useFormItemInitializerFields = (e) => {
10996
11008
  onClick() {
10997
11009
  },
10998
11010
  componentProps: F(g({}, a), {
11011
+ hideSearch: !1,
10999
11012
  icon: null,
11000
11013
  title: p || h("Other records"),
11001
11014
  name: "otherRecords",
@@ -12315,7 +12328,9 @@ const variablesStore = {}, getFieldPath = (e, t) => {
12315
12328
  I = removeThroughCollectionFields(getValuesByPath(I, j), B);
12316
12329
  B != null && B.target && (D = B.target);
12317
12330
  }
12318
- const O = i(_.isFunction(I) ? I({ fieldOperator: S == null ? void 0 : S.fieldOperator }) : I);
12331
+ const O = i(
12332
+ _.isFunction(I) ? I({ fieldOperator: S == null ? void 0 : S.fieldOperator, isParsingVariable: !0 }) : I
12333
+ );
12319
12334
  return {
12320
12335
  value: O === void 0 ? T.defaultValue : O,
12321
12336
  dataSource: k,
@@ -12610,7 +12625,7 @@ const getStart = (e, t) => dayjs().add(e, t === "isoWeek" ? "week" : t).startOf(
12610
12625
  };
12611
12626
  };
12612
12627
  function withParams(e, t) {
12613
- return t != null && t.fieldOperator && t.fieldOperator !== "$dateBetween" ? e[0] : e;
12628
+ return (t == null ? void 0 : t.fieldOperator) === "$dateBetween" || !(t != null && t.isParsingVariable) ? e : e[0];
12614
12629
  }
12615
12630
  const DatePickerContext = React.createContext({ utc: !0 }), useDatePickerContext = () => React.useContext(DatePickerContext), DatePickerProvider = DatePickerContext.Provider, InternalDatePicker = connect(
12616
12631
  DatePicker$1,
@@ -14856,7 +14871,7 @@ const useUpdateSchemaTemplateActionProps = () => {
14856
14871
  /* @__PURE__ */ jsx(PageHeader, { style: { backgroundColor: "white" }, ghost: !1, title: e("Block templates") }),
14857
14872
  /* @__PURE__ */ jsx("div", { style: { margin: "var(--nb-spacing)" }, children: /* @__PURE__ */ jsx(SchemaComponent, { schema: uiSchemaTemplatesSchema }) })
14858
14873
  ] });
14859
- }, BlockTemplatesPane = () => /* @__PURE__ */ jsx(SchemaComponent, { schema: uiSchemaTemplatesSchema }), MENU_ITEM_HEIGHT = 40, STEP = 15, SearchCollections = ({ value: e, onChange: t }) => {
14874
+ }, BlockTemplatesPane = () => /* @__PURE__ */ jsx(SchemaComponent, { schema: uiSchemaTemplatesSchema }), MENU_ITEM_HEIGHT = 32, STEP = 15, SearchCollections = ({ value: e, onChange: t }) => {
14860
14875
  const { t: o } = useTranslation(), [n, r] = useState(e), i = React.useRef(null);
14861
14876
  return useEffect(() => {
14862
14877
  r(e);
@@ -16809,7 +16824,7 @@ const findOption$1 = (e = [], t) => {
16809
16824
  collectionField: e,
16810
16825
  noDisabled: r,
16811
16826
  targetFieldSchema: i
16812
- }), { apiTokenSettings: d } = useAPITokenVariable({ noDisabled: r }), { datetimeSettings: p } = useDatetimeVariable({ operator: n, schema: o, noDisabled: r, targetFieldSchema: i }), { currentFormSettings: m, shouldDisplayCurrentForm: h } = useCurrentFormVariable({
16827
+ }), { apiTokenSettings: d } = useAPITokenVariable({ noDisabled: r }), { datetimeSettings: p } = useDatetimeVariable({ operator: n, schema: o, noDisabled: !0, targetFieldSchema: i }), { currentFormSettings: m, shouldDisplayCurrentForm: h } = useCurrentFormVariable({
16813
16828
  schema: o,
16814
16829
  collectionField: e,
16815
16830
  noDisabled: r,
@@ -18258,13 +18273,13 @@ const PopupVisibleProvider = ({ children: e, visible: t, setVisible: o }) => {
18258
18273
  z(void 0, null, function* () {
18259
18274
  const m = n.map((C) => {
18260
18275
  var S;
18261
- return ((S = getStoredPopupContext(C.popupuid)) == null ? void 0 : S.schema) || findSchemaByUid(C.popupuid, t.root) || r(C.popupuid);
18276
+ return ((S = getStoredPopupContext(C.popupuid)) == null ? void 0 : S.schema) || findSchemaByUid(C.popupuid, t == null ? void 0 : t.root) || r(C.popupuid);
18262
18277
  }), x = (yield Promise.all(m)).map((C, S) => {
18263
18278
  if (_.isEmpty(C))
18264
18279
  return get404Schema();
18265
18280
  const b = n[S];
18266
18281
  if (b.puid) {
18267
- const y = findSchemaByUid(b.puid, t.root);
18282
+ const y = findSchemaByUid(b.puid, t == null ? void 0 : t.root);
18268
18283
  y && c(_.omit(y, "parent"), C);
18269
18284
  }
18270
18285
  const v = _.cloneDeep(_.omit(C, "parent"));
@@ -35467,7 +35482,9 @@ const ButtonLinkList = (e) => {
35467
35482
  ) }) });
35468
35483
  },
35469
35484
  { displayName: "InternalSubTable" }
35470
- ), defaultModeToComponent = {
35485
+ );
35486
+ var AssociationFieldMode = /* @__PURE__ */ ((e) => (e.Picker = "Picker", e.Nester = "Nester", e.PopoverNester = "PopoverNester", e.Select = "Select", e.SubTable = "SubTable", e.FileManager = "FileManager", e.CascadeSelect = "CascadeSelect", e.Tag = "Tag", e))(AssociationFieldMode || {});
35487
+ const defaultModeToComponent = {
35471
35488
  Picker: InternalPicker,
35472
35489
  Nester: InternalNester,
35473
35490
  PopoverNester: InternalPopoverNester,
@@ -35477,19 +35494,20 @@ const ButtonLinkList = (e) => {
35477
35494
  CascadeSelect: InternalCascadeSelect
35478
35495
  }, AssociationFieldModeContext = createContext({
35479
35496
  modeToComponent: defaultModeToComponent,
35480
- getComponent: (e) => defaultModeToComponent[e]
35497
+ getComponent: (e) => defaultModeToComponent[e],
35498
+ getDefaultComponent: (e) => defaultModeToComponent[e]
35481
35499
  }), AssociationFieldModeProvider = (e) => {
35482
35500
  const t = useAssociationFieldModeContext(), o = useMemo(
35483
35501
  () => g(g({}, t.modeToComponent), e.modeToComponent),
35484
35502
  [t.modeToComponent, e.modeToComponent]
35485
35503
  ), n = useCallback(
35486
- (i) => {
35487
- const a = o[i];
35488
- return _.isFunction(a) ? a(defaultModeToComponent[i]) : a || defaultModeToComponent[i];
35489
- },
35504
+ (a) => o[a] || defaultModeToComponent[a],
35490
35505
  [o]
35491
- ), r = useMemo(() => ({ modeToComponent: o, getComponent: n }), [n, o]);
35492
- return /* @__PURE__ */ jsx(AssociationFieldModeContext.Provider, { value: r, children: e.children });
35506
+ ), r = useCallback((a) => defaultModeToComponent[a], []), i = useMemo(
35507
+ () => ({ modeToComponent: o, getComponent: n, getDefaultComponent: r }),
35508
+ [n, o, r]
35509
+ );
35510
+ return /* @__PURE__ */ jsx(AssociationFieldModeContext.Provider, { value: i, children: e.children });
35493
35511
  }, useAssociationFieldModeContext = () => React.useContext(AssociationFieldModeContext), AssociationFieldProvider = observer$1(
35494
35512
  (e) => {
35495
35513
  var m, h, x;
@@ -59049,6 +59067,7 @@ export {
59049
59067
  AssignedFieldValues,
59050
59068
  AssociatedFields,
59051
59069
  AssociationField,
59070
+ AssociationFieldMode,
59052
59071
  AssociationFieldModeProvider,
59053
59072
  AssociationFilter,
59054
59073
  AssociationFilterDesignerDelete,
@@ -59697,6 +59716,7 @@ export {
59697
59716
  useAssociatedFormItemInitializerFields,
59698
59717
  useAssociatedTableColumnInitializerFields,
59699
59718
  useAssociationCreateActionProps,
59719
+ useAssociationFieldModeContext,
59700
59720
  useAssociationFilterBlockProps,
59701
59721
  useAssociationFilterProps,
59702
59722
  useAssociationName,
@@ -18,11 +18,12 @@ export declare enum AssociationFieldMode {
18
18
  Tag = "Tag"
19
19
  }
20
20
  interface AssociationFieldModeProviderProps {
21
- modeToComponent: Partial<Record<AssociationFieldMode, React.FC | ((originalCom: React.FC) => React.FC)>>;
21
+ modeToComponent: Partial<Record<AssociationFieldMode, React.FC>>;
22
22
  }
23
23
  export declare const AssociationFieldModeProvider: React.FC<AssociationFieldModeProviderProps>;
24
24
  export declare const useAssociationFieldModeContext: () => {
25
25
  modeToComponent: AssociationFieldModeProviderProps['modeToComponent'];
26
26
  getComponent: (mode: AssociationFieldMode) => React.FC;
27
+ getDefaultComponent: (mode: AssociationFieldMode) => React.FC;
27
28
  };
28
29
  export {};
@@ -6,5 +6,5 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- export { AssociationFieldModeProvider } from './AssociationFieldModeProvider';
9
+ export { AssociationFieldMode, AssociationFieldModeProvider, useAssociationFieldModeContext, } from './AssociationFieldModeProvider';
10
10
  export declare const AssociationField: any;