@nocobase/client 2.0.0-alpha.34 → 2.0.0-alpha.35
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/actions/setTargetDataScope.d.ts +2 -1
- package/es/flow/components/filter/FilterGroup.d.ts +2 -3
- package/es/flow/models/blocks/table/JSColumnModel.d.ts +0 -1
- package/es/flow/models/blocks/table/TableActionsColumnModel.d.ts +0 -1
- package/es/index.mjs +94 -47
- package/lib/{index-C3fHjsMw-mfsrxrqM.js → index-C3fHjsMw-KiBbIuVa.js} +19 -9
- package/lib/index.js +19 -9
- package/package.json +6 -6
|
@@ -6,4 +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
|
-
|
|
9
|
+
import { FlowModel } from '@nocobase/flow-engine';
|
|
10
|
+
export declare const setTargetDataScope: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, import("@nocobase/flow-engine").FlowContext>;
|
|
@@ -6,8 +6,7 @@
|
|
|
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
|
-
import React, { FC } from 'react';
|
|
10
|
-
import { AntdIconProps } from '@ant-design/icons/lib/components/AntdIcon';
|
|
9
|
+
import React, { FC, ReactNode } from 'react';
|
|
11
10
|
/**
|
|
12
11
|
* 筛选项组件的属性接口
|
|
13
12
|
*/
|
|
@@ -26,7 +25,7 @@ interface FilterGroupProps {
|
|
|
26
25
|
value: Record<string, any>;
|
|
27
26
|
/** 自定义筛选项组件 */
|
|
28
27
|
FilterItem?: React.FC<FilterItemProps>;
|
|
29
|
-
|
|
28
|
+
closeIcon?: ReactNode;
|
|
30
29
|
/** 是否显示边框 */
|
|
31
30
|
showBorder?: boolean;
|
|
32
31
|
/** 移除当前组的回调 */
|
|
@@ -13,7 +13,6 @@ export declare class JSColumnModel extends TableCustomColumnModel {
|
|
|
13
13
|
renderHiddenInConfig(): React.JSX.Element;
|
|
14
14
|
getInputArgs(): {};
|
|
15
15
|
getColumnProps(): {
|
|
16
|
-
width: number;
|
|
17
16
|
title: React.JSX.Element;
|
|
18
17
|
render: (value: any, record: any, index: any) => React.JSX.Element;
|
|
19
18
|
};
|
|
@@ -11,7 +11,6 @@ import { TableCustomColumnModel } from './TableCustomColumnModel';
|
|
|
11
11
|
export declare class TableActionsColumnModel extends TableCustomColumnModel {
|
|
12
12
|
afterAddAsSubModel(): Promise<void>;
|
|
13
13
|
getColumnProps(): {
|
|
14
|
-
width: number;
|
|
15
14
|
title: React.JSX.Element;
|
|
16
15
|
render: (value: any, record: any, index: any) => React.JSX.Element;
|
|
17
16
|
};
|
package/es/index.mjs
CHANGED
|
@@ -9613,7 +9613,7 @@ function addAppVersion(e, t) {
|
|
|
9613
9613
|
addAppVersion((n = e.properties) == null ? void 0 : n[o], t);
|
|
9614
9614
|
}), e;
|
|
9615
9615
|
}
|
|
9616
|
-
const name = "@nocobase/client", version = "2.0.0-alpha.
|
|
9616
|
+
const name = "@nocobase/client", version = "2.0.0-alpha.35", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
|
|
9617
9617
|
"@ahooksjs/use-url-state": "3.5.1",
|
|
9618
9618
|
"@ant-design/cssinjs": "^1.11.1",
|
|
9619
9619
|
"@ant-design/icons": "^5.6.1",
|
|
@@ -9636,10 +9636,10 @@ const name = "@nocobase/client", version = "2.0.0-alpha.34", license = "AGPL-3.0
|
|
|
9636
9636
|
"@formily/reactive-react": "^2.2.27",
|
|
9637
9637
|
"@formily/shared": "^2.2.27",
|
|
9638
9638
|
"@formily/validator": "^2.2.27",
|
|
9639
|
-
"@nocobase/evaluators": "2.0.0-alpha.
|
|
9640
|
-
"@nocobase/flow-engine": "2.0.0-alpha.
|
|
9641
|
-
"@nocobase/sdk": "2.0.0-alpha.
|
|
9642
|
-
"@nocobase/utils": "2.0.0-alpha.
|
|
9639
|
+
"@nocobase/evaluators": "2.0.0-alpha.35",
|
|
9640
|
+
"@nocobase/flow-engine": "2.0.0-alpha.35",
|
|
9641
|
+
"@nocobase/sdk": "2.0.0-alpha.35",
|
|
9642
|
+
"@nocobase/utils": "2.0.0-alpha.35",
|
|
9643
9643
|
"@tanstack/react-table": "^8.21.3",
|
|
9644
9644
|
"@types/tabulator-tables": "^6.2.6",
|
|
9645
9645
|
"acorn-jsx": "^5.3.2",
|
|
@@ -30043,7 +30043,7 @@ const useStyles$a = genStyleHook("nb-markdown", (e, { isDarkTheme: t }) => {
|
|
|
30043
30043
|
}, t ? i : r)
|
|
30044
30044
|
};
|
|
30045
30045
|
}), parseMarkdown$1 = _.memoize((e) => O(void 0, null, function* () {
|
|
30046
|
-
return e && (yield import("./md-
|
|
30046
|
+
return e && (yield import("./md-BbvRKckr.mjs")).default.render(e);
|
|
30047
30047
|
}));
|
|
30048
30048
|
function useParseMarkdown$1(e) {
|
|
30049
30049
|
const [t, o] = useState(""), [n, r] = useState(!0);
|
|
@@ -31008,21 +31008,21 @@ const useCreateActionProps = () => {
|
|
|
31008
31008
|
onReset: h
|
|
31009
31009
|
};
|
|
31010
31010
|
}, useDetailsPaginationProps = () => {
|
|
31011
|
-
var
|
|
31012
|
-
const e = useDetailsBlockContext(), t = ((
|
|
31011
|
+
var r, i, a, l, c, u, d, p, m, h, g, x, b, y, C, v, S;
|
|
31012
|
+
const e = useDetailsBlockContext(), t = ((a = (i = (r = e.service) == null ? void 0 : r.data) == null ? void 0 : i.meta) == null ? void 0 : a.count) || 0, o = (u = (c = (l = e.service) == null ? void 0 : l.data) == null ? void 0 : c.meta) == null ? void 0 : u.page, { hasNext: n } = ((p = (d = e.service) == null ? void 0 : d.data) == null ? void 0 : p.meta) || {};
|
|
31013
31013
|
if (!t && o) {
|
|
31014
|
-
let
|
|
31014
|
+
let P;
|
|
31015
31015
|
return {
|
|
31016
31016
|
simple: !0,
|
|
31017
|
-
current: ((
|
|
31017
|
+
current: ((g = (h = (m = e.service) == null ? void 0 : m.data) == null ? void 0 : h.meta) == null ? void 0 : g.page) || 1,
|
|
31018
31018
|
pageSize: 1,
|
|
31019
31019
|
showSizeChanger: !1,
|
|
31020
31020
|
align: "center",
|
|
31021
|
-
onChange(
|
|
31021
|
+
onChange(T) {
|
|
31022
31022
|
return O(this, null, function* () {
|
|
31023
|
-
var
|
|
31024
|
-
const
|
|
31025
|
-
e.service.run(I(f({},
|
|
31023
|
+
var D, j;
|
|
31024
|
+
const A = (j = (D = e.service) == null ? void 0 : D.params) == null ? void 0 : j[0];
|
|
31025
|
+
e.service.run(I(f({}, A), { page: T }));
|
|
31026
31026
|
});
|
|
31027
31027
|
},
|
|
31028
31028
|
style: {
|
|
@@ -31031,7 +31031,7 @@ const useCreateActionProps = () => {
|
|
|
31031
31031
|
},
|
|
31032
31032
|
showTotal: !1,
|
|
31033
31033
|
showTitle: !1,
|
|
31034
|
-
total: (
|
|
31034
|
+
total: ((y = (b = (x = e.service) == null ? void 0 : x.data) == null ? void 0 : b.data) == null ? void 0 : y.length) < 1 || !n ? 1 * o : 1 * o + 1,
|
|
31035
31035
|
className: css`
|
|
31036
31036
|
.ant-pagination-simple-pager {
|
|
31037
31037
|
display: none !important;
|
|
@@ -31042,16 +31042,16 @@ const useCreateActionProps = () => {
|
|
|
31042
31042
|
return {
|
|
31043
31043
|
simple: !0,
|
|
31044
31044
|
hidden: t <= 1,
|
|
31045
|
-
current: ((
|
|
31045
|
+
current: ((S = (v = (C = e.service) == null ? void 0 : C.data) == null ? void 0 : v.meta) == null ? void 0 : S.page) || 1,
|
|
31046
31046
|
total: t,
|
|
31047
31047
|
pageSize: 1,
|
|
31048
31048
|
showSizeChanger: !1,
|
|
31049
31049
|
align: "center",
|
|
31050
|
-
onChange(
|
|
31050
|
+
onChange(P) {
|
|
31051
31051
|
return O(this, null, function* () {
|
|
31052
|
-
var
|
|
31053
|
-
const
|
|
31054
|
-
e.service.run(I(f({},
|
|
31052
|
+
var A, D;
|
|
31053
|
+
const T = (D = (A = e.service) == null ? void 0 : A.params) == null ? void 0 : D[0];
|
|
31054
|
+
e.service.run(I(f({}, T), { page: P }));
|
|
31055
31055
|
});
|
|
31056
31056
|
},
|
|
31057
31057
|
style: {
|
|
@@ -65334,7 +65334,7 @@ const BlockConfigsContext = createContext({
|
|
|
65334
65334
|
showBorder: n = !1,
|
|
65335
65335
|
onRemove: r,
|
|
65336
65336
|
onChange: i,
|
|
65337
|
-
|
|
65337
|
+
closeIcon: a = /* @__PURE__ */ jsx(CloseCircleOutlined, {})
|
|
65338
65338
|
} = e, { token: l } = theme.useToken(), { t: c } = useTranslation();
|
|
65339
65339
|
t.logic || (t.logic = "$and"), Array.isArray(t.items) || (t.items = []);
|
|
65340
65340
|
const { logic: u, items: d } = t, p = n ? {
|
|
@@ -65363,18 +65363,22 @@ const BlockConfigsContext = createContext({
|
|
|
65363
65363
|
d.splice(C, 1), i == null || i(t);
|
|
65364
65364
|
}, b = (C) => "path" in C || "operator" in C || "value" in C, y = (C) => "logic" in C && "items" in C;
|
|
65365
65365
|
return /* @__PURE__ */ jsxs("div", { style: p, children: [
|
|
65366
|
-
n && r && /* @__PURE__ */ jsx(
|
|
65367
|
-
|
|
65366
|
+
n && r && /* @__PURE__ */ jsx(
|
|
65367
|
+
"span",
|
|
65368
65368
|
{
|
|
65369
|
+
role: "button",
|
|
65370
|
+
"aria-label": "icon-close",
|
|
65369
65371
|
style: {
|
|
65370
65372
|
position: "absolute",
|
|
65371
65373
|
right: 10,
|
|
65372
65374
|
top: 10,
|
|
65373
|
-
color: l.colorIcon
|
|
65375
|
+
color: l.colorIcon,
|
|
65376
|
+
cursor: "pointer"
|
|
65374
65377
|
},
|
|
65375
|
-
onClick: r
|
|
65378
|
+
onClick: r,
|
|
65379
|
+
children: a
|
|
65376
65380
|
}
|
|
65377
|
-
)
|
|
65381
|
+
),
|
|
65378
65382
|
/* @__PURE__ */ jsx("div", { style: { marginBottom: 8, color: l.colorText }, children: /* @__PURE__ */ jsxs("span", { children: [
|
|
65379
65383
|
c("Meet"),
|
|
65380
65384
|
" ",
|
|
@@ -65412,8 +65416,15 @@ const BlockConfigsContext = createContext({
|
|
|
65412
65416
|
{
|
|
65413
65417
|
role: "button",
|
|
65414
65418
|
"aria-label": "icon-close",
|
|
65415
|
-
style: {
|
|
65416
|
-
|
|
65419
|
+
style: {
|
|
65420
|
+
marginLeft: 8,
|
|
65421
|
+
marginRight: 8,
|
|
65422
|
+
flex: "0 0 auto",
|
|
65423
|
+
color: l.colorIcon,
|
|
65424
|
+
cursor: "pointer"
|
|
65425
|
+
},
|
|
65426
|
+
onClick: () => x(v),
|
|
65427
|
+
children: a
|
|
65417
65428
|
}
|
|
65418
65429
|
)
|
|
65419
65430
|
] }) }, v) : /* @__PURE__ */ jsx("div", { style: { marginBottom: 8, display: "flex", alignItems: "flex-end" }, children: /* @__PURE__ */ jsxs(Space$1, { style: { flex: 1, minWidth: 0 }, children: [
|
|
@@ -65429,8 +65440,15 @@ const BlockConfigsContext = createContext({
|
|
|
65429
65440
|
{
|
|
65430
65441
|
role: "button",
|
|
65431
65442
|
"aria-label": "icon-close",
|
|
65432
|
-
style: {
|
|
65433
|
-
|
|
65443
|
+
style: {
|
|
65444
|
+
marginLeft: 8,
|
|
65445
|
+
marginRight: 8,
|
|
65446
|
+
flex: "0 0 auto",
|
|
65447
|
+
color: l.colorIcon,
|
|
65448
|
+
cursor: "pointer"
|
|
65449
|
+
},
|
|
65450
|
+
onClick: () => x(v),
|
|
65451
|
+
children: a
|
|
65434
65452
|
}
|
|
65435
65453
|
)
|
|
65436
65454
|
] }) }, v) : /* @__PURE__ */ jsx("div", { style: { marginBottom: 8, display: "flex", alignItems: "flex-end" }, children: /* @__PURE__ */ jsxs(Space$1, { style: { flex: 1, minWidth: 0 }, children: [
|
|
@@ -65440,8 +65458,15 @@ const BlockConfigsContext = createContext({
|
|
|
65440
65458
|
{
|
|
65441
65459
|
role: "button",
|
|
65442
65460
|
"aria-label": "icon-close",
|
|
65443
|
-
style: {
|
|
65444
|
-
|
|
65461
|
+
style: {
|
|
65462
|
+
marginLeft: 8,
|
|
65463
|
+
marginRight: 8,
|
|
65464
|
+
flex: "0 0 auto",
|
|
65465
|
+
color: l.colorIcon,
|
|
65466
|
+
cursor: "pointer"
|
|
65467
|
+
},
|
|
65468
|
+
onClick: () => x(v),
|
|
65469
|
+
children: a
|
|
65445
65470
|
}
|
|
65446
65471
|
)
|
|
65447
65472
|
] }) }, v)) }),
|
|
@@ -67549,7 +67574,7 @@ BlockGridModel.registerFlow({
|
|
|
67549
67574
|
}
|
|
67550
67575
|
});
|
|
67551
67576
|
const parseMarkdown = _.memoize((e) => O(void 0, null, function* () {
|
|
67552
|
-
return e && (yield import("./md-
|
|
67577
|
+
return e && (yield import("./md-oH2RssNY.mjs")).default.render(e);
|
|
67553
67578
|
}));
|
|
67554
67579
|
function useParseMarkdown(e) {
|
|
67555
67580
|
const [t, o] = useState(""), [n, r] = useState(!0);
|
|
@@ -75068,7 +75093,7 @@ TableCustomColumnModel.registerFlow({
|
|
|
75068
75093
|
}
|
|
75069
75094
|
},
|
|
75070
75095
|
defaultParams: {
|
|
75071
|
-
width:
|
|
75096
|
+
width: 200
|
|
75072
75097
|
},
|
|
75073
75098
|
handler(e, t) {
|
|
75074
75099
|
e.model.setProps("width", t.width);
|
|
@@ -75175,7 +75200,6 @@ class TableActionsColumnModel extends TableCustomColumnModel {
|
|
|
75175
75200
|
}
|
|
75176
75201
|
) });
|
|
75177
75202
|
return I(f({}, this.props), {
|
|
75178
|
-
width: 100,
|
|
75179
75203
|
title: this.props.tooltip ? /* @__PURE__ */ jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: 4 }, children: [
|
|
75180
75204
|
t,
|
|
75181
75205
|
/* @__PURE__ */ jsx(Tooltip, { title: this.props.tooltip, children: /* @__PURE__ */ jsx(QuestionCircleOutlined, { style: { cursor: "pointer" } }) })
|
|
@@ -75184,7 +75208,26 @@ class TableActionsColumnModel extends TableCustomColumnModel {
|
|
|
75184
75208
|
});
|
|
75185
75209
|
}
|
|
75186
75210
|
render() {
|
|
75187
|
-
return (t, o, n) =>
|
|
75211
|
+
return (t, o, n) => {
|
|
75212
|
+
var r;
|
|
75213
|
+
return /* @__PURE__ */ jsx(
|
|
75214
|
+
"div",
|
|
75215
|
+
{
|
|
75216
|
+
className: css`
|
|
75217
|
+
width: ${this.props.width - 8}px;
|
|
75218
|
+
text-overflow: ellipsis;
|
|
75219
|
+
white-space: nowrap;
|
|
75220
|
+
overflow: hidden;
|
|
75221
|
+
transition: overflow 0.3s ease 0.8s; /* 加入延迟 */
|
|
75222
|
+
|
|
75223
|
+
&:hover {
|
|
75224
|
+
overflow: ${(r = this.flowEngine.flowSettings) != null && r.enabled ? "visible" : "hidden"}; /* 鼠标悬停时,内容可见 */
|
|
75225
|
+
}
|
|
75226
|
+
`,
|
|
75227
|
+
children: /* @__PURE__ */ jsx(Columns, { record: o, model: this, index: n })
|
|
75228
|
+
}
|
|
75229
|
+
);
|
|
75230
|
+
};
|
|
75188
75231
|
}
|
|
75189
75232
|
}
|
|
75190
75233
|
TableActionsColumnModel.define({
|
|
@@ -75893,7 +75936,7 @@ const De = class De extends DisplayItemModel {
|
|
|
75893
75936
|
onCell: (r, i) => ({
|
|
75894
75937
|
record: r,
|
|
75895
75938
|
recordIndex: i,
|
|
75896
|
-
width: this.props.width,
|
|
75939
|
+
width: this.props.width - 16,
|
|
75897
75940
|
editable: this.props.editable,
|
|
75898
75941
|
dataIndex: this.props.dataIndex,
|
|
75899
75942
|
title: this.props.title,
|
|
@@ -76202,7 +76245,6 @@ class JSColumnModel extends TableCustomColumnModel {
|
|
|
76202
76245
|
}
|
|
76203
76246
|
) });
|
|
76204
76247
|
return this.hidden && !this.flowEngine.flowSettings.enabled ? null : I(f({}, this.props), {
|
|
76205
|
-
width: 100,
|
|
76206
76248
|
title: this.props.tooltip ? /* @__PURE__ */ jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: 4 }, children: [
|
|
76207
76249
|
r,
|
|
76208
76250
|
/* @__PURE__ */ jsx(Tooltip, { title: this.props.tooltip, children: /* @__PURE__ */ jsx(QuestionCircleOutlined, { style: { cursor: "pointer" } }) })
|
|
@@ -76236,7 +76278,13 @@ class JSColumnModel extends TableCustomColumnModel {
|
|
|
76236
76278
|
return React.useEffect(() => {
|
|
76237
76279
|
const i = o;
|
|
76238
76280
|
r != null && r.current && (i.__mountedOnce ? o.rerender() : i.__mountedOnce = !0);
|
|
76239
|
-
}, [r == null ? void 0 : r.current]), /* @__PURE__ */ jsx(
|
|
76281
|
+
}, [r == null ? void 0 : r.current]), /* @__PURE__ */ jsx(
|
|
76282
|
+
"div",
|
|
76283
|
+
{
|
|
76284
|
+
style: { width: this.props.width - 8, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
|
|
76285
|
+
children: /* @__PURE__ */ jsx("span", { ref: r, style: { maxWidth: "100%" } })
|
|
76286
|
+
}
|
|
76287
|
+
);
|
|
76240
76288
|
};
|
|
76241
76289
|
n.displayName = "JSColumnModelStableRenderer", this._RenderComponent = n;
|
|
76242
76290
|
}
|
|
@@ -82093,14 +82141,13 @@ const setTargetDataScope = defineAction({
|
|
|
82093
82141
|
const o = t.targetBlockUid;
|
|
82094
82142
|
if (!o)
|
|
82095
82143
|
return;
|
|
82096
|
-
|
|
82097
|
-
|
|
82098
|
-
|
|
82099
|
-
|
|
82100
|
-
|
|
82101
|
-
|
|
82102
|
-
|
|
82103
|
-
isEmptyFilter(i) ? r.removeFilterGroup(`setTargetDataScope_${e.model.uid}`) : r.addFilterGroup(`setTargetDataScope_${e.model.uid}`, i);
|
|
82144
|
+
e.model.scheduleModelOperation(o, (r) => {
|
|
82145
|
+
const i = r.resource;
|
|
82146
|
+
if (!i)
|
|
82147
|
+
return;
|
|
82148
|
+
const a = pruneFilter(transformFilter(t.filter));
|
|
82149
|
+
isEmptyFilter(a) ? i.removeFilterGroup(`setTargetDataScope_${e.model.uid}`) : i.addFilterGroup(`setTargetDataScope_${e.model.uid}`, a);
|
|
82150
|
+
});
|
|
82104
82151
|
});
|
|
82105
82152
|
}
|
|
82106
82153
|
});
|