@nocobase/client 2.0.25 → 2.0.27
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/flow/models/fields/DisplayTextFieldModel.d.ts +1 -0
- package/es/index.mjs +28 -17
- package/lib/index.js +6 -6
- package/package.json +6 -6
|
@@ -9,5 +9,6 @@
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import { ClickableFieldModel } from './ClickableFieldModel';
|
|
11
11
|
export declare class DisplayTextFieldModel extends ClickableFieldModel {
|
|
12
|
+
t(value: string | undefined | null): any;
|
|
12
13
|
renderComponent(value: any, wrap: any): React.JSX.Element;
|
|
13
14
|
}
|
package/es/index.mjs
CHANGED
|
@@ -9964,7 +9964,7 @@ function addAppVersion(e, t) {
|
|
|
9964
9964
|
addAppVersion((n = e.properties) == null ? void 0 : n[o], t);
|
|
9965
9965
|
}), e;
|
|
9966
9966
|
}
|
|
9967
|
-
const name = "@nocobase/client", version = "2.0.
|
|
9967
|
+
const name = "@nocobase/client", version = "2.0.27", license = "Apache-2.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
|
|
9968
9968
|
"@ahooksjs/use-url-state": "3.5.1",
|
|
9969
9969
|
"@ant-design/cssinjs": "^1.11.1",
|
|
9970
9970
|
"@ant-design/icons": "^5.6.1",
|
|
@@ -9987,10 +9987,10 @@ const name = "@nocobase/client", version = "2.0.25", license = "Apache-2.0", mai
|
|
|
9987
9987
|
"@formily/reactive-react": "^2.2.27",
|
|
9988
9988
|
"@formily/shared": "^2.2.27",
|
|
9989
9989
|
"@formily/validator": "^2.2.27",
|
|
9990
|
-
"@nocobase/evaluators": "2.0.
|
|
9991
|
-
"@nocobase/flow-engine": "2.0.
|
|
9992
|
-
"@nocobase/sdk": "2.0.
|
|
9993
|
-
"@nocobase/utils": "2.0.
|
|
9990
|
+
"@nocobase/evaluators": "2.0.27",
|
|
9991
|
+
"@nocobase/flow-engine": "2.0.27",
|
|
9992
|
+
"@nocobase/sdk": "2.0.27",
|
|
9993
|
+
"@nocobase/utils": "2.0.27",
|
|
9994
9994
|
"@tanstack/react-table": "^8.21.3",
|
|
9995
9995
|
"@types/tabulator-tables": "^6.2.6",
|
|
9996
9996
|
"acorn-jsx": "^5.3.2",
|
|
@@ -30630,7 +30630,7 @@ const useStyles$a = genStyleHook("nb-markdown", (e, { isDarkTheme: t }) => {
|
|
|
30630
30630
|
}, t ? i : r)
|
|
30631
30631
|
};
|
|
30632
30632
|
}), parseMarkdown$1 = _.memoize((e) => L(void 0, null, function* () {
|
|
30633
|
-
return e && (yield import("./md-
|
|
30633
|
+
return e && (yield import("./md-oH2RssNY.mjs")).default.render(e);
|
|
30634
30634
|
}));
|
|
30635
30635
|
function useParseMarkdown$1(e) {
|
|
30636
30636
|
const [t, o] = useState(""), [n, r] = useState(!0);
|
|
@@ -72043,7 +72043,7 @@ BlockGridModel.registerFlow({
|
|
|
72043
72043
|
}
|
|
72044
72044
|
});
|
|
72045
72045
|
const parseMarkdown = _.memoize((e) => L(void 0, null, function* () {
|
|
72046
|
-
return e && (yield import("./md-
|
|
72046
|
+
return e && (yield import("./md-BbvRKckr.mjs")).default.render(e);
|
|
72047
72047
|
}));
|
|
72048
72048
|
function useParseMarkdown(e) {
|
|
72049
72049
|
const [t, o] = useState(""), [n, r] = useState(!0);
|
|
@@ -76669,11 +76669,12 @@ AddChildActionModel.registerFlow({
|
|
|
76669
76669
|
handler(e, t) {
|
|
76670
76670
|
return L(this, null, function* () {
|
|
76671
76671
|
e.model.onClick = (o) => {
|
|
76672
|
-
e.
|
|
76672
|
+
e.model.dispatchEvent(
|
|
76673
76673
|
"click",
|
|
76674
76674
|
A(x({
|
|
76675
76675
|
event: o
|
|
76676
76676
|
}, e.inputArgs), {
|
|
76677
|
+
sourceId: e.record.id,
|
|
76677
76678
|
filterByTk: null
|
|
76678
76679
|
}),
|
|
76679
76680
|
{
|
|
@@ -79016,6 +79017,9 @@ const getOuterHeight$1 = (e) => {
|
|
|
79016
79017
|
return 0;
|
|
79017
79018
|
const t = e.getBoundingClientRect(), o = window.getComputedStyle(e), n = parseFloat(o.marginTop) || 0, r = parseFloat(o.marginBottom) || 0;
|
|
79018
79019
|
return t.height + n + r;
|
|
79020
|
+
}, normalizeCssSize = (e) => {
|
|
79021
|
+
if (!(e == null || e === ""))
|
|
79022
|
+
return typeof e == "number" ? `${e}px` : /^\d+(\.\d+)?$/.test(e) ? `${e}px` : e;
|
|
79019
79023
|
}, useFormGridHeight = ({
|
|
79020
79024
|
heightMode: e,
|
|
79021
79025
|
containerRef: t,
|
|
@@ -79056,8 +79060,12 @@ const getOuterHeight$1 = (e) => {
|
|
|
79056
79060
|
heightMode: l,
|
|
79057
79061
|
height: c
|
|
79058
79062
|
}) => {
|
|
79059
|
-
var
|
|
79060
|
-
const u = useRef(null), d = useRef(null), p = useRef(null), m = l === "specifyValue" || l === "fullHeight", h =
|
|
79063
|
+
var S, C;
|
|
79064
|
+
const u = useRef(null), d = useRef(null), p = useRef(null), m = l === "specifyValue" || l === "fullHeight", h = {
|
|
79065
|
+
paddingTop: (C = (S = e.context) == null ? void 0 : S.themeToken) == null ? void 0 : C.padding
|
|
79066
|
+
}, g = (o == null ? void 0 : o.layout) === "horizontal" ? normalizeCssSize(o == null ? void 0 : o.labelWidth) : void 0;
|
|
79067
|
+
g && (h.marginInlineStart = g);
|
|
79068
|
+
const f = useFormGridHeight({
|
|
79061
79069
|
heightMode: l,
|
|
79062
79070
|
containerRef: u,
|
|
79063
79071
|
actionsRef: i ? d : void 0,
|
|
@@ -79065,12 +79073,12 @@ const getOuterHeight$1 = (e) => {
|
|
|
79065
79073
|
deps: [c]
|
|
79066
79074
|
});
|
|
79067
79075
|
return useEffect(() => {
|
|
79068
|
-
var
|
|
79076
|
+
var P;
|
|
79069
79077
|
if (!t)
|
|
79070
79078
|
return;
|
|
79071
|
-
const
|
|
79072
|
-
((
|
|
79073
|
-
}, [t,
|
|
79079
|
+
const F = m ? f : void 0;
|
|
79080
|
+
((P = t.props) == null ? void 0 : P.height) !== F && t.setProps({ height: F });
|
|
79081
|
+
}, [t, f, m]), /* @__PURE__ */ jsx(FormComponent, { model: e, layoutProps: o, onFinish: n, style: m ? {
|
|
79074
79082
|
display: "flex",
|
|
79075
79083
|
flexDirection: "column",
|
|
79076
79084
|
minHeight: 0,
|
|
@@ -79082,7 +79090,7 @@ const getOuterHeight$1 = (e) => {
|
|
|
79082
79090
|
flex: 1
|
|
79083
79091
|
} : void 0, children: [
|
|
79084
79092
|
r,
|
|
79085
|
-
i ? /* @__PURE__ */ jsx("div", { style:
|
|
79093
|
+
i ? /* @__PURE__ */ jsx("div", { style: h, ref: d, children: i }) : null,
|
|
79086
79094
|
a ? /* @__PURE__ */ jsx("div", { ref: p, children: a }) : null
|
|
79087
79095
|
] }) });
|
|
79088
79096
|
};
|
|
@@ -81309,7 +81317,7 @@ function toSelectValue(e, t, o = !1, n = "record", r = []) {
|
|
|
81309
81317
|
return a(e) ? l(e) : void 0;
|
|
81310
81318
|
}
|
|
81311
81319
|
function resolveOptions(e, t, o) {
|
|
81312
|
-
return e != null && e.length ? e.map((n) => omit(n, "disabled", "options")) : o ? Array.isArray(t) ? t.filter((n) => typeof n == "object" && n !== null) : [] : t && typeof t == "object" ? [t] : [];
|
|
81320
|
+
return e != null && e.length ? e.map((n) => omit(n, "disabled", "options", "style")) : o ? Array.isArray(t) ? t.filter((n) => typeof n == "object" && n !== null) : [] : t && typeof t == "object" ? [t] : [];
|
|
81313
81321
|
}
|
|
81314
81322
|
const labelClassName = css`
|
|
81315
81323
|
div {
|
|
@@ -95434,11 +95442,14 @@ DisplayItemModel.bindModelToInterface("DisplayPercentFieldModel", ["percent"], {
|
|
|
95434
95442
|
isDefault: !0
|
|
95435
95443
|
});
|
|
95436
95444
|
class DisplayTextFieldModel extends ClickableFieldModel {
|
|
95445
|
+
t(t) {
|
|
95446
|
+
return t != null && t.startsWith("{{") && (t != null && t.endsWith("}}")) ? this.translate(t) : t;
|
|
95447
|
+
}
|
|
95437
95448
|
renderComponent(t, o) {
|
|
95438
95449
|
const { prefix: n, suffix: r, overflowMode: i } = this.props;
|
|
95439
95450
|
return /* @__PURE__ */ jsxs("span", { style: { whiteSpace: i === "wrap" || o ? "pre-line" : "nowrap" }, children: [
|
|
95440
95451
|
n,
|
|
95441
|
-
this.
|
|
95452
|
+
this.t(t),
|
|
95442
95453
|
r
|
|
95443
95454
|
] });
|
|
95444
95455
|
}
|