@nocobase/client 1.4.22 → 1.4.24
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
|
@@ -113,6 +113,7 @@ import dayjs from "dayjs";
|
|
|
113
113
|
import LRUCache from "lru-cache";
|
|
114
114
|
import { PageHeader } from "@ant-design/pro-layout";
|
|
115
115
|
import { useHotkeys } from "react-hotkeys-hook";
|
|
116
|
+
import { usePrefixCls as usePrefixCls$1, dayjsable, formatDayjsValue } from "@formily/antd-v5/esm/__builtins__";
|
|
116
117
|
import * as dndKitAccessibility from "@dnd-kit/accessibility";
|
|
117
118
|
import * as dndKitModifiers from "@dnd-kit/modifiers";
|
|
118
119
|
import * as dndKitSortable from "@dnd-kit/sortable";
|
|
@@ -124,7 +125,6 @@ import * as formilyValidator from "@formily/validator";
|
|
|
124
125
|
import { registerValidateRules, setValidateLanguage } from "@formily/validator";
|
|
125
126
|
import axios from "axios";
|
|
126
127
|
import * as ReactRouter from "react-router";
|
|
127
|
-
import { usePrefixCls as usePrefixCls$1, dayjsable, formatDayjsValue } from "@formily/antd-v5/esm/__builtins__";
|
|
128
128
|
import JSON5 from "json5";
|
|
129
129
|
import { Helmet } from "react-helmet";
|
|
130
130
|
import relativeTime from "dayjs/plugin/relativeTime";
|
|
@@ -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.
|
|
4298
|
+
const name = "@nocobase/client", version$1 = "1.4.24", 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.22", 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.
|
|
4321
|
-
"@nocobase/sdk": "1.4.
|
|
4322
|
-
"@nocobase/utils": "1.4.
|
|
4320
|
+
"@nocobase/evaluators": "1.4.24",
|
|
4321
|
+
"@nocobase/sdk": "1.4.24",
|
|
4322
|
+
"@nocobase/utils": "1.4.24",
|
|
4323
4323
|
ahooks: "^3.7.2",
|
|
4324
4324
|
antd: "5.12.8",
|
|
4325
4325
|
"antd-style": "3.7.1",
|
|
@@ -10698,7 +10698,8 @@ const DatePickerContext = React.createContext({ utc: !0 }), useDatePickerContext
|
|
|
10698
10698
|
const { utc: t = !0 } = useDatePickerContext(), o = Array.isArray(e.value) ? e.value[0] : e.value, n = v(x({
|
|
10699
10699
|
utc: t
|
|
10700
10700
|
}, e), {
|
|
10701
|
-
showTime: e.showTime ? { defaultValue: dayjs("00:00:00", "HH:mm:ss") } : !1
|
|
10701
|
+
showTime: e.showTime ? { defaultValue: dayjs("00:00:00", "HH:mm:ss") } : !1,
|
|
10702
|
+
inputReadOnly: !0
|
|
10702
10703
|
});
|
|
10703
10704
|
return /* @__PURE__ */ jsx(InternalDatePicker, v(x({}, n), { value: o }));
|
|
10704
10705
|
};
|
|
@@ -10730,7 +10731,8 @@ DatePicker.RangePicker = function(t) {
|
|
|
10730
10731
|
}, t), {
|
|
10731
10732
|
format: getDateTimeFormat(f, C, i, a),
|
|
10732
10733
|
picker: f,
|
|
10733
|
-
showTime: i ? { defaultValue: [dayjs("00:00:00", "HH:mm:ss"), dayjs("23:59:59", "HH:mm:ss")] } : !1
|
|
10734
|
+
showTime: i ? { defaultValue: [dayjs("00:00:00", "HH:mm:ss"), dayjs("23:59:59", "HH:mm:ss")] } : !1,
|
|
10735
|
+
inputReadOnly: !0
|
|
10734
10736
|
}), [b, y] = useState(S);
|
|
10735
10737
|
return h ? /* @__PURE__ */ jsxs(Space$1.Compact, { children: [
|
|
10736
10738
|
/* @__PURE__ */ jsx(
|
|
@@ -10782,6 +10784,7 @@ DatePicker.FilterWithPicker = function(t) {
|
|
|
10782
10784
|
showTime: r ? { defaultValue: dayjs("00:00:00", "HH:mm:ss") } : !1,
|
|
10783
10785
|
format: getDateTimeFormat(d, p, r, i),
|
|
10784
10786
|
picker: d,
|
|
10787
|
+
inputReadOnly: !0,
|
|
10785
10788
|
onChange: (C) => {
|
|
10786
10789
|
t.onChange(void 0), setTimeout(() => {
|
|
10787
10790
|
t.onChange(C);
|
|
@@ -22099,8 +22102,8 @@ const SchemaSettingsWrapper = (e) => {
|
|
|
22099
22102
|
}
|
|
22100
22103
|
`, TableColumnActionBar$1 = observer$1(
|
|
22101
22104
|
(e) => {
|
|
22102
|
-
const t = useDesigner(), { isInSubTable: o } = useFlag() || {};
|
|
22103
|
-
return /* @__PURE__ */ jsxs(
|
|
22105
|
+
const t = useDesigner(), { isInSubTable: o } = useFlag() || {}, { designable: n } = useSchemaComponentContext();
|
|
22106
|
+
return !n || t.isNullComponent ? e.children : /* @__PURE__ */ jsxs(
|
|
22104
22107
|
SortableItem,
|
|
22105
22108
|
{
|
|
22106
22109
|
className: designerCss$4({
|
|
@@ -22146,21 +22149,27 @@ const useColumnSchema$1 = () => {
|
|
|
22146
22149
|
}, [e, t]);
|
|
22147
22150
|
return t ? o : [];
|
|
22148
22151
|
}, TableColumnDecorator$1 = (e) => {
|
|
22149
|
-
const t = useDesigner(), o = useField(), { fieldSchema: n, uiSchema: r, collectionField: i } = useColumnSchema$1(), a = useCompile(), { isInSubTable:
|
|
22152
|
+
const t = useDesigner(), o = useField(), { fieldSchema: n, uiSchema: r, collectionField: i } = useColumnSchema$1(), { designable: a } = useSchemaComponentContext(), l = useCompile(), { isInSubTable: c } = useFlag() || {};
|
|
22150
22153
|
return useLayoutEffect(() => {
|
|
22151
22154
|
o.title || n && r != null && r.title && (o.title = r == null ? void 0 : r.title);
|
|
22152
|
-
}, [r == null ? void 0 : r.title]), /* @__PURE__ */
|
|
22155
|
+
}, [r == null ? void 0 : r.title]), !a || t.isNullComponent ? /* @__PURE__ */ jsxs(CollectionFieldContext.Provider, { value: i, children: [
|
|
22156
|
+
/* @__PURE__ */ jsx(t, { fieldSchema: n, uiSchema: r, collectionField: i }),
|
|
22157
|
+
/* @__PURE__ */ jsxs("span", { role: "button", children: [
|
|
22158
|
+
(n == null ? void 0 : n.required) && /* @__PURE__ */ jsx("span", { className: "ant-formily-item-asterisk", children: "*" }),
|
|
22159
|
+
/* @__PURE__ */ jsx("span", { children: (o == null ? void 0 : o.title) || l(r == null ? void 0 : r.title) })
|
|
22160
|
+
] })
|
|
22161
|
+
] }) : /* @__PURE__ */ jsx(
|
|
22153
22162
|
SortableItem,
|
|
22154
22163
|
{
|
|
22155
22164
|
className: designerCss$4({
|
|
22156
|
-
margin:
|
|
22157
|
-
padding:
|
|
22165
|
+
margin: c ? "-12px -8px" : "-18px -16px",
|
|
22166
|
+
padding: c ? "12px 8px" : "12px 16px"
|
|
22158
22167
|
}),
|
|
22159
22168
|
children: /* @__PURE__ */ jsxs(CollectionFieldContext.Provider, { value: i, children: [
|
|
22160
22169
|
/* @__PURE__ */ jsx(t, { fieldSchema: n, uiSchema: r, collectionField: i }),
|
|
22161
22170
|
/* @__PURE__ */ jsxs("span", { role: "button", children: [
|
|
22162
22171
|
(n == null ? void 0 : n.required) && /* @__PURE__ */ jsx("span", { className: "ant-formily-item-asterisk", children: "*" }),
|
|
22163
|
-
/* @__PURE__ */ jsx("span", { children: (o == null ? void 0 : o.title) ||
|
|
22172
|
+
/* @__PURE__ */ jsx("span", { children: (o == null ? void 0 : o.title) || l(r == null ? void 0 : r.title) })
|
|
22164
22173
|
] })
|
|
22165
22174
|
] })
|
|
22166
22175
|
}
|
|
@@ -25418,7 +25427,8 @@ const getAppends = ({
|
|
|
25418
25427
|
"AssociationField.Selector",
|
|
25419
25428
|
"AssociationField.AddNewer",
|
|
25420
25429
|
"TableField",
|
|
25421
|
-
"Kanban.CardViewer"
|
|
25430
|
+
"Kanban.CardViewer",
|
|
25431
|
+
"Action.Container"
|
|
25422
25432
|
].includes(c["x-component"]) || getAppends({
|
|
25423
25433
|
schema: c,
|
|
25424
25434
|
prefix: t,
|
|
@@ -33456,7 +33466,9 @@ class SchemaSettingsPlugin extends Plugin {
|
|
|
33456
33466
|
});
|
|
33457
33467
|
}
|
|
33458
33468
|
}
|
|
33459
|
-
const DefaultSchemaToolbar = () => null
|
|
33469
|
+
const DefaultSchemaToolbar = () => null;
|
|
33470
|
+
DefaultSchemaToolbar.isNullComponent = !0;
|
|
33471
|
+
const useDesigner = () => {
|
|
33460
33472
|
const { designable: e } = useDesignable(), t = useFieldSchema(), o = useMemo(() => t["x-designer"] || t["x-toolbar"] ? t["x-designer"] || t["x-toolbar"] : t["x-settings"] ? SchemaToolbar : DefaultSchemaToolbar, [t]), n = useComponent(o);
|
|
33461
33473
|
return e && n || DefaultSchemaToolbar;
|
|
33462
33474
|
}, useFieldProps = (e) => {
|
|
@@ -38340,12 +38352,15 @@ const useColumnsDeepMemoized = (e) => {
|
|
|
38340
38352
|
return e ? /* @__PURE__ */ jsx("th", { style: r ? columnOpacityStyle : columnHiddenStyle, children: r ? t.children : null }) : /* @__PURE__ */ jsx("th", v(x({}, t), { className: cls(t.className, headerClass) }));
|
|
38341
38353
|
}, BodyRowComponent = (e) => /* @__PURE__ */ jsx(SortableRow, x({}, e)), InternalBodyCellComponent = (e) => {
|
|
38342
38354
|
var h;
|
|
38343
|
-
const { token: t } = useToken(), o = useContext(InViewContext), n = (h = e.className) == null ? void 0 : h.includes("selection-column"), g = e, { record: r, schema: i, rowIndex: a, isSubTable: l } = g, c = K(g, ["record", "schema", "rowIndex", "isSubTable"]), { valueMap: u } = useSatisfiedActionValues({ formValues: r, category: "style", schema: i }), d =
|
|
38355
|
+
const { token: t } = useToken(), o = useContext(InViewContext), n = (h = e.className) == null ? void 0 : h.includes("selection-column"), g = e, { record: r, schema: i, rowIndex: a, isSubTable: l } = g, c = K(g, ["record", "schema", "rowIndex", "isSubTable"]), { valueMap: u } = useSatisfiedActionValues({ formValues: r, category: "style", schema: i }), d = !!(i != null && i.properties) && Object.values(i.properties).some((f) => f["x-read-pretty"] === !0), p = useMemo(
|
|
38356
|
+
() => Object.assign(x({}, e.style), d ? u : {}),
|
|
38357
|
+
[d, e.style, u]
|
|
38358
|
+
), m = {
|
|
38344
38359
|
height: "1em",
|
|
38345
38360
|
backgroundColor: "rgba(0, 0, 0, 0.06)",
|
|
38346
38361
|
borderRadius: `${t.borderRadiusSM}px`
|
|
38347
38362
|
};
|
|
38348
|
-
return /* @__PURE__ */ jsx("td", v(x({}, c), { className: cls(e.className, cellClass), style: p
|
|
38363
|
+
return /* @__PURE__ */ jsx("td", v(x({}, c), { className: cls(e.className, cellClass), style: p, children: l || o || n ? e.children : /* @__PURE__ */ jsx("div", { style: m }) }));
|
|
38349
38364
|
}, displayNone = { display: "none" }, BodyCellComponent = (o) => {
|
|
38350
38365
|
var n = o, { columnHidden: e } = n, t = K(n, ["columnHidden"]);
|
|
38351
38366
|
const { designable: r } = useDesignable();
|
|
@@ -38416,9 +38431,6 @@ const useColumnsDeepMemoized = (e) => {
|
|
|
38416
38431
|
.ant-table-cell-fix-right {
|
|
38417
38432
|
padding: 8px 16px !important;
|
|
38418
38433
|
}
|
|
38419
|
-
.ant-table-thead .ant-table-cell {
|
|
38420
|
-
padding: 8px 16px;
|
|
38421
|
-
}
|
|
38422
38434
|
}
|
|
38423
38435
|
}
|
|
38424
38436
|
}
|
|
@@ -38772,7 +38784,7 @@ const Table$1 = withDynamicSchemaProps(
|
|
|
38772
38784
|
field: o,
|
|
38773
38785
|
showIndex: !0,
|
|
38774
38786
|
dragSort: !1,
|
|
38775
|
-
showDel: C !== !1 || f !== !1 || S !== !1 ? ($) => o.editable ? S !== !1 ? !0 : $ == null ? void 0 : $.__isNewRecord__ : !1 : !1,
|
|
38787
|
+
showDel: o.editable && (C !== !1 || f !== !1 || S !== !1) ? ($) => o.editable ? S !== !1 ? !0 : $ == null ? void 0 : $.__isNewRecord__ : !1 : !1,
|
|
38776
38788
|
pagination: L,
|
|
38777
38789
|
rowSelection: { type: "none", hideSelectAll: !0 },
|
|
38778
38790
|
footer: () => o.editable && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -40846,10 +40858,13 @@ function toSafeNumber(e) {
|
|
|
40846
40858
|
return e && (e > Number.MAX_SAFE_INTEGER || e < Number.MIN_SAFE_INTEGER ? new BigNumber(e).toString() : Number(e));
|
|
40847
40859
|
}
|
|
40848
40860
|
const InputNumber = connect((e) => {
|
|
40849
|
-
const
|
|
40850
|
-
|
|
40851
|
-
|
|
40852
|
-
|
|
40861
|
+
const i = e, { onChange: t } = i, o = K(i, ["onChange"]);
|
|
40862
|
+
let r = x({
|
|
40863
|
+
onChange: (a) => {
|
|
40864
|
+
Number.isNaN(a) ? t(null) : t(toSafeNumber(a));
|
|
40865
|
+
}
|
|
40866
|
+
}, o);
|
|
40867
|
+
return o.formatStyle && (r = omit$1(r, ["addonAfter", "addonBefore"])), /* @__PURE__ */ jsx(InputNumber$1, x({}, r));
|
|
40853
40868
|
}, mapReadPretty(ReadPretty$2));
|
|
40854
40869
|
InputNumber.ReadPretty = ReadPretty$2;
|
|
40855
40870
|
const ListBlockContext = createContext({});
|
|
@@ -11,4 +11,4 @@ export declare const designerCss: ({ margin, padding }?: {
|
|
|
11
11
|
margin?: string;
|
|
12
12
|
padding?: string;
|
|
13
13
|
}) => string;
|
|
14
|
-
export declare const TableColumnActionBar: React.MemoExoticComponent<import("@formily/react").ReactFC<
|
|
14
|
+
export declare const TableColumnActionBar: React.MemoExoticComponent<import("@formily/react").ReactFC<Omit<any, "ref">>>;
|