@nocobase/client 1.7.10 → 1.7.12

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.
@@ -73,6 +73,12 @@ export declare class CheckboxFieldInterface extends CollectionFieldInterface {
73
73
  };
74
74
  };
75
75
  selected?: undefined;
76
+ } | {
77
+ label: string;
78
+ value: string;
79
+ noValue: boolean;
80
+ selected?: undefined;
81
+ schema?: undefined;
76
82
  })[];
77
83
  };
78
84
  schemaInitialize(schema: ISchema, { block }: {
@@ -211,6 +211,12 @@ export declare const boolean: ({
211
211
  };
212
212
  };
213
213
  selected?: undefined;
214
+ } | {
215
+ label: string;
216
+ value: string;
217
+ noValue: boolean;
218
+ selected?: undefined;
219
+ schema?: undefined;
214
220
  })[];
215
221
  export declare const tableoid: {
216
222
  label: string;
package/es/index.mjs CHANGED
@@ -5241,7 +5241,9 @@ const date = dayjs(), spaceCSS = css`
5241
5241
  ]
5242
5242
  }
5243
5243
  }
5244
- }
5244
+ },
5245
+ { label: "{{ t('is empty') }}", value: "$empty", noValue: !0 },
5246
+ { label: "{{ t('is not empty') }}", value: "$notEmpty", noValue: !0 }
5245
5247
  ], tableoid = [
5246
5248
  {
5247
5249
  label: '{{t("is any of")}}',
@@ -8709,7 +8711,7 @@ function addAppVersion(e, t) {
8709
8711
  addAppVersion((o = e.properties) == null ? void 0 : o[n], t);
8710
8712
  }), e;
8711
8713
  }
8712
- const name = "@nocobase/client", version = "1.7.10", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
8714
+ const name = "@nocobase/client", version = "1.7.12", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
8713
8715
  "@ahooksjs/use-url-state": "3.5.1",
8714
8716
  "@ant-design/cssinjs": "^1.11.1",
8715
8717
  "@ant-design/icons": "^5.6.1",
@@ -8730,9 +8732,9 @@ const name = "@nocobase/client", version = "1.7.10", license = "AGPL-3.0", main
8730
8732
  "@formily/reactive-react": "^2.2.27",
8731
8733
  "@formily/shared": "^2.2.27",
8732
8734
  "@formily/validator": "^2.2.27",
8733
- "@nocobase/evaluators": "1.7.10",
8734
- "@nocobase/sdk": "1.7.10",
8735
- "@nocobase/utils": "1.7.10",
8735
+ "@nocobase/evaluators": "1.7.12",
8736
+ "@nocobase/sdk": "1.7.12",
8737
+ "@nocobase/utils": "1.7.12",
8736
8738
  ahooks: "^3.7.2",
8737
8739
  antd: "5.24.2",
8738
8740
  "antd-style": "3.7.1",
@@ -10288,7 +10290,7 @@ const Table$2 = withDynamicSchemaProps(
10288
10290
  "loading",
10289
10291
  "onClickRow",
10290
10292
  "value"
10291
- ]), y = useArrayField$1(S), v = useFieldSchema(), { size: F = "small" } = (v == null ? void 0 : v["x-component-props"]) || {}, I = useCollection(), R = ((be = v == null ? void 0 : v.parent) == null ? void 0 : be["x-decorator"]) === "TableSelectorProvider" ? useTableSelectorContext() : useTableBlockContext(), { expandFlag: D, allIncludesChildren: B, enableIndexÏColumn: N } = R, $ = useMemoizedFn(S.onRowDragEnd || (() => {
10293
+ ]), y = useArrayField$1(S), v = useFieldSchema(), { size: F = "small" } = (v == null ? void 0 : v["x-component-props"]) || {}, I = useCollection(), R = ((be = v == null ? void 0 : v.parent) == null ? void 0 : be["x-decorator"]) === "TableSelectorProvider" ? useTableSelectorContext() : useTableBlockContext(), { expandFlag: D, allIncludesChildren: B, enableIndexColumn: N } = R, $ = useMemoizedFn(S.onRowDragEnd || (() => {
10292
10294
  })), L = usePaginationProps$3(n, a, e), w = useTableColumns$2(S, L), [O, j] = useState(() => D ? B : []), [k, M] = useState(((Se = y == null ? void 0 : y.data) == null ? void 0 : Se.selectedRowKeys) || []), [q, E] = useState([]), V = (p == null ? void 0 : p.type) !== "none", G = useRef(/* @__PURE__ */ new Map()), U = useMemo(() => css`
10293
10295
  & > td {
10294
10296
  background-color: ${t.controlItemBgActive} !important;
@@ -10509,7 +10511,7 @@ const InternalTableBlockProvider = (e) => {
10509
10511
  fieldNames: l,
10510
10512
  collection: c,
10511
10513
  association: u,
10512
- enableIndexÏColumn: d
10514
+ enableIndexColumn: d
10513
10515
  } = e, p = useField(), { resource: m, service: h } = useBlockRequestContext(), g = useFieldSchema(), [f, C] = useState(!!(l || i)), { heightProps: b } = useBlockHeightProps(), S = useRef(null);
10514
10516
  useEffect(() => {
10515
10517
  C(l || i);
@@ -10550,7 +10552,7 @@ const InternalTableBlockProvider = (e) => {
10550
10552
  setExpandFlag: v,
10551
10553
  heightProps: b,
10552
10554
  association: u,
10553
- enableIndexÏColumn: d
10555
+ enableIndexColumn: d
10554
10556
  }),
10555
10557
  [
10556
10558
  y,
@@ -22632,13 +22634,18 @@ ReadPretty$c.Input = (e) => {
22632
22634
  "div",
22633
22635
  {
22634
22636
  className: cls(t, e.className),
22635
- style: x({ overflowWrap: "break-word", whiteSpace: "normal" }, e.style),
22637
+ style: x({
22638
+ display: "flex",
22639
+ alignItems: "center",
22640
+ overflowWrap: "break-word",
22641
+ whiteSpace: "normal"
22642
+ }, e.style),
22636
22643
  children: [
22637
- e.addonBefore,
22638
- e.prefix,
22644
+ n(e.addonBefore),
22645
+ n(e.prefix),
22639
22646
  e.ellipsis ? /* @__PURE__ */ jsx(EllipsisWithTooltip, { ellipsis: e.ellipsis, children: o }) : o,
22640
- e.suffix,
22641
- e.addonAfter
22647
+ n(e.suffix),
22648
+ n(e.addonAfter)
22642
22649
  ]
22643
22650
  }
22644
22651
  );
@@ -30251,7 +30258,7 @@ const DragHandler = (e) => {
30251
30258
  Select$1,
30252
30259
  {
30253
30260
  value: t == null ? void 0 : t.unit,
30254
- style: { maxWidth: 140, minWidth: 130 },
30261
+ style: { maxWidth: 140 },
30255
30262
  onChange: (d) => {
30256
30263
  const p = P(x({}, t), {
30257
30264
  unit: d
@@ -30263,7 +30270,8 @@ const DragHandler = (e) => {
30263
30270
  { value: "week", label: r("Calendar week") },
30264
30271
  { value: "month", label: r("Calendar Month") },
30265
30272
  { value: "year", label: r("Calendar Year") }
30266
- ]
30273
+ ],
30274
+ popupMatchSelectWidth: !0
30267
30275
  },
30268
30276
  "unit"
30269
30277
  )
@@ -35346,9 +35354,9 @@ const enabledIndexColumn$1 = {
35346
35354
  const e = useField(), t = useFieldSchema(), { t: n } = useTranslation(), { dn: o } = useDesignable();
35347
35355
  return {
35348
35356
  title: n("Enable index column"),
35349
- checked: e.decoratorProps.enableIndexÏColumn !== !1,
35357
+ checked: e.decoratorProps.enableIndexColumn !== !1,
35350
35358
  onChange: (r) => z(void 0, null, function* () {
35351
- e.decoratorProps = e.decoratorProps || {}, e.decoratorProps.enableIndexÏColumn = r, t["x-decorator-props"].enableIndexÏColumn = r, o.emit("patch", {
35359
+ e.decoratorProps = e.decoratorProps || {}, e.decoratorProps.enableIndexColumn = r, t["x-decorator-props"].enableIndexColumn = r, o.emit("patch", {
35352
35360
  schema: {
35353
35361
  "x-uid": t["x-uid"],
35354
35362
  "x-decorator-props": t["x-decorator-props"]
@@ -37693,9 +37701,9 @@ const dividerSettings = new SchemaSettings({
37693
37701
  const e = useField(), t = useFieldSchema(), { t: n } = useTranslation(), { dn: o } = useDesignable();
37694
37702
  return {
37695
37703
  title: n("Enable index column"),
37696
- checked: e.componentProps.enableIndexÏColumn !== !1,
37704
+ checked: e.componentProps.enableIndexColumn !== !1,
37697
37705
  onChange: (r) => z(void 0, null, function* () {
37698
- e.componentProps = e.componentProps || {}, e.componentProps.enableIndexÏColumn = r, t["x-component-props"].enableIndexÏColumn = r, o.emit("patch", {
37706
+ e.componentProps = e.componentProps || {}, e.componentProps.enableIndexColumn = r, t["x-component-props"].enableIndexColumn = r, o.emit("patch", {
37699
37707
  schema: {
37700
37708
  "x-uid": t["x-uid"],
37701
37709
  "x-component-props": t["x-component-props"]
@@ -43128,8 +43136,8 @@ const Upload = connect(
43128
43136
  );
43129
43137
  Upload.ReadPretty = ReadPretty$9;
43130
43138
  function useSizeHint(e) {
43131
- const t = e != null ? e : FILE_SIZE_LIMIT_DEFAULT, { t: n, i18n: o } = useTranslation();
43132
- return filesize(t, { base: 2, standard: "jedec", locale: o.language }), t !== 0 ? n("File size should not exceed {{size}}.", { size: 1e7 }) : "";
43139
+ const t = e != null ? e : FILE_SIZE_LIMIT_DEFAULT, { t: n, i18n: o } = useTranslation(), r = filesize(t, { base: 2, standard: "jedec", locale: o.language });
43140
+ return t !== 0 ? n("File size should not exceed {{size}}.", { size: r }) : "";
43133
43141
  }
43134
43142
  function DefaultThumbnailPreviewer({ file: e }) {
43135
43143
  var r;
@@ -44034,7 +44042,11 @@ const InternalNesterCardCss = css`
44034
44042
  }, N = () => {
44035
44043
  const k = (f == null ? void 0 : f.targetKey) || "id", M = T.map((E) => E[k]).filter(Boolean);
44036
44044
  return M.length ? { $and: [{ [`${k}.$ne`]: M }] } : {};
44037
- }, $ = () => {
44045
+ };
44046
+ useEffect(() => {
44047
+ t || F([]);
44048
+ }, [t]);
44049
+ const $ = () => {
44038
44050
  const { setVisible: k } = useActionContext(), { multiple: M, selectedRows: q, onChange: E, options: V, collectionField: G } = useContext(RecordPickerContext);
44039
44051
  return {
44040
44052
  onClick() {
@@ -45474,7 +45486,7 @@ const Table$1 = withDynamicSchemaProps(
45474
45486
  onExpand: g,
45475
45487
  loading: f,
45476
45488
  onClickRow: C,
45477
- enableIndexÏColumn: b
45489
+ enableIndexColumn: b
45478
45490
  } = ce, S = W(ce, [
45479
45491
  "dragSort",
45480
45492
  "showIndex",
@@ -45486,7 +45498,7 @@ const Table$1 = withDynamicSchemaProps(
45486
45498
  "onExpand",
45487
45499
  "loading",
45488
45500
  "onClickRow",
45489
- "enableIndexÏColumn"
45501
+ "enableIndexColumn"
45490
45502
  ]), y = useArrayField(S), v = useFieldSchema(), { size: F = "small" } = (v == null ? void 0 : v["x-component-props"]) || {}, I = useCollection(), R = ((Ce = v == null ? void 0 : v.parent) == null ? void 0 : Ce["x-decorator"]) === "TableSelectorProvider" ? useTableSelectorContext() : useTableBlockContext(), { expandFlag: D, allIncludesChildren: B } = R, N = useMemoizedFn(S.onRowDragEnd || (() => {
45491
45503
  })), $ = usePaginationProps$2(n, a), L = useTableColumns$1(S, $), [w, O] = useState(() => D ? B : []), [j, k] = useState(((be = y == null ? void 0 : y.data) == null ? void 0 : be.selectedRowKeys) || []), [M, q] = useState([]), E = (p == null ? void 0 : p.type) !== "none", V = useRef(/* @__PURE__ */ new Map()), G = useMemo(() => css`
45492
45504
  & > td {
@@ -45714,7 +45726,7 @@ const Table$1 = withDynamicSchemaProps(
45714
45726
  `, SubTable = observer$1(
45715
45727
  (e) => {
45716
45728
  var k, M, q;
45717
- const { openSize: t } = e, { field: n, options: o, fieldSchema: r } = useAssociationFieldContext(), { t: a } = useTranslation(), [i, l] = useState(!1), [c, u] = useState([]), d = useFieldNames$1(e), p = useFieldSchema(), m = useCompile(), h = useLabelUiSchema$1(o, (d == null ? void 0 : d.label) || "label"), g = useCollectionRecord(), f = useCollection(), { allowSelectExistingRecord: C, allowAddnew: b, allowDisassociation: S, enableIndexÏColumn: y } = n.componentProps;
45729
+ const { openSize: t } = e, { field: n, options: o, fieldSchema: r } = useAssociationFieldContext(), { t: a } = useTranslation(), [i, l] = useState(!1), [c, u] = useState([]), d = useFieldNames$1(e), p = useFieldSchema(), m = useCompile(), h = useLabelUiSchema$1(o, (d == null ? void 0 : d.label) || "label"), g = useCollectionRecord(), f = useCollection(), { allowSelectExistingRecord: C, allowAddnew: b, allowDisassociation: S, enableIndexColumn: y } = n.componentProps;
45718
45730
  useSubTableSpecialCase({ rootField: n, rootSchema: r });
45719
45731
  const v = (E, V) => {
45720
45732
  if (V !== void 0 && isArr(n.value) && E !== V)
@@ -45810,7 +45822,7 @@ const Table$1 = withDynamicSchemaProps(
45810
45822
  n.editable ? a("Please add or select record") : a("No data")
45811
45823
  ] })
45812
45824
  },
45813
- enableIndexÏColumn: y !== !1,
45825
+ enableIndexColumn: y !== !1,
45814
45826
  footer: () => /* @__PURE__ */ jsx("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: n.editable && /* @__PURE__ */ jsxs(
45815
45827
  Space$1,
45816
45828
  {
@@ -50243,7 +50255,7 @@ const TableActionColumnDesigner = (e) => {
50243
50255
  title: u("Enable index column"),
50244
50256
  checked: ((N = r.decoratorProps) == null ? void 0 : N.enableSelectColumn) !== !1,
50245
50257
  onChange: (k) => z(void 0, null, function* () {
50246
- r.decoratorProps = r.decoratorProps || {}, r.decoratorProps.enableIndexÏColumn = k, a["x-decorator-props"].enableIndexÏColumn = k, d.emit("patch", {
50258
+ r.decoratorProps = r.decoratorProps || {}, r.decoratorProps.enableIndexColumn = k, a["x-decorator-props"].enableIndexColumn = k, d.emit("patch", {
50247
50259
  schema: {
50248
50260
  "x-uid": a["x-uid"],
50249
50261
  "x-decorator-props": a["x-decorator-props"]
@@ -52796,7 +52808,7 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
52796
52808
  });
52797
52809
  S(T == null ? void 0 : T.data);
52798
52810
  const R = l(o.interface), D = cloneDeep(T == null ? void 0 : T.data) || {};
52799
- D != null && D.reverseField || (D.autoCreateReverseField = !1, D.reverseField = (N = R == null ? void 0 : R.default) == null ? void 0 : N.reverseField, set$1(D.reverseField, "name", `f_${uid()}`), set$1(D.reverseField, "uiSchema.title", ($ = o.__parent) == null ? void 0 : $.title));
52811
+ D != null && D.reverseField ? D.autoCreateReverseField = !0 : (D.autoCreateReverseField = !1, D.reverseField = (N = R == null ? void 0 : R.default) == null ? void 0 : N.reverseField, set$1(D.reverseField, "name", `f_${uid()}`), set$1(D.reverseField, "uiSchema.title", ($ = o.__parent) == null ? void 0 : $.title));
52800
52812
  const B = getSchema$7(R, D, o, C);
52801
52813
  h(B), p(!0);
52802
52814
  }),