@nocobase/client 1.4.23 → 1.4.25
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";
|
|
@@ -754,6 +754,9 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
754
754
|
get isFileCollection() {
|
|
755
755
|
return isFileCollection;
|
|
756
756
|
},
|
|
757
|
+
get isMobile() {
|
|
758
|
+
return isMobile;
|
|
759
|
+
},
|
|
757
760
|
get isShowFilePicker() {
|
|
758
761
|
return isShowFilePicker;
|
|
759
762
|
},
|
|
@@ -2817,6 +2820,9 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2817
2820
|
get isInitializersSame() {
|
|
2818
2821
|
return isInitializersSame;
|
|
2819
2822
|
},
|
|
2823
|
+
get isMobile() {
|
|
2824
|
+
return isMobile;
|
|
2825
|
+
},
|
|
2820
2826
|
get isPatternDisabled() {
|
|
2821
2827
|
return isPatternDisabled;
|
|
2822
2828
|
},
|
|
@@ -4295,7 +4301,7 @@ function addAppVersion(e, t) {
|
|
|
4295
4301
|
addAppVersion((n = e.properties) == null ? void 0 : n[o], t);
|
|
4296
4302
|
}), e;
|
|
4297
4303
|
}
|
|
4298
|
-
const name = "@nocobase/client", version$1 = "1.4.
|
|
4304
|
+
const name = "@nocobase/client", version$1 = "1.4.25", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
|
|
4299
4305
|
"@ahooksjs/use-url-state": "3.5.1",
|
|
4300
4306
|
"@ant-design/cssinjs": "^1.11.1",
|
|
4301
4307
|
"@ant-design/icons": "^5.1.4",
|
|
@@ -4317,9 +4323,9 @@ const name = "@nocobase/client", version$1 = "1.4.23", license = "AGPL-3.0", mai
|
|
|
4317
4323
|
"@formily/reactive-react": "^2.2.27",
|
|
4318
4324
|
"@formily/shared": "^2.2.27",
|
|
4319
4325
|
"@formily/validator": "^2.2.27",
|
|
4320
|
-
"@nocobase/evaluators": "1.4.
|
|
4321
|
-
"@nocobase/sdk": "1.4.
|
|
4322
|
-
"@nocobase/utils": "1.4.
|
|
4326
|
+
"@nocobase/evaluators": "1.4.25",
|
|
4327
|
+
"@nocobase/sdk": "1.4.25",
|
|
4328
|
+
"@nocobase/utils": "1.4.25",
|
|
4323
4329
|
ahooks: "^3.7.2",
|
|
4324
4330
|
antd: "5.12.8",
|
|
4325
4331
|
"antd-style": "3.7.1",
|
|
@@ -7065,25 +7071,33 @@ const REGEX_OF_VARIABLE = /^\s*\{\{\s*([a-zA-Z0-9_$-.]+?)\s*\}\}\s*$/g, REGEX_OF
|
|
|
7065
7071
|
}
|
|
7066
7072
|
return r ? dayjs(e).format(a) : dayjs(e).startOf(n).format(a);
|
|
7067
7073
|
}, mapDatePicker = function() {
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7074
|
+
const e = isMobile();
|
|
7075
|
+
return (t) => {
|
|
7076
|
+
const { dateOnly: o, showTime: n, picker: r = "date", utc: i, gmt: a, underFilter: l } = t, c = getDefaultFormat(t), u = t.onChange;
|
|
7077
|
+
return v(x({}, t), {
|
|
7078
|
+
inputReadOnly: e,
|
|
7079
|
+
format: c,
|
|
7080
|
+
value: str2moment(t.value, t),
|
|
7081
|
+
onChange: (d, p) => {
|
|
7082
|
+
u && u(l ? handleChangeOnFilter(d, r, n) : handleDateChangeOnForm(d, o, i, r, n, a));
|
|
7075
7083
|
}
|
|
7076
7084
|
});
|
|
7077
7085
|
};
|
|
7078
|
-
}
|
|
7079
|
-
|
|
7080
|
-
|
|
7081
|
-
|
|
7082
|
-
|
|
7083
|
-
|
|
7084
|
-
|
|
7085
|
-
|
|
7086
|
-
|
|
7086
|
+
};
|
|
7087
|
+
function isMobile() {
|
|
7088
|
+
return window.matchMedia("(max-width: 768px)").matches;
|
|
7089
|
+
}
|
|
7090
|
+
const mapRangePicker = function() {
|
|
7091
|
+
const e = isMobile();
|
|
7092
|
+
return (t) => {
|
|
7093
|
+
const o = getDefaultFormat(t), n = t.onChange, { dateOnly: r, showTime: i, picker: a = "date", utc: l, gmt: c, underFilter: u } = t;
|
|
7094
|
+
return v(x({}, t), {
|
|
7095
|
+
format: o,
|
|
7096
|
+
value: str2moment(t.value, t),
|
|
7097
|
+
inputReadOnly: e,
|
|
7098
|
+
onChange: (d) => {
|
|
7099
|
+
n && n(
|
|
7100
|
+
u ? d ? [handleChangeOnFilter(d[0], a, i), handleChangeOnFilter(d[1], a, i)] : [] : d ? [moment2str(getRangeStart(d[0], t), t), moment2str(getRangeEnd(d[1], t), t)] : []
|
|
7087
7101
|
);
|
|
7088
7102
|
}
|
|
7089
7103
|
});
|
|
@@ -10775,19 +10789,20 @@ DatePicker.RangePicker = function(t) {
|
|
|
10775
10789
|
] }) : /* @__PURE__ */ jsx(InternalRangePicker, x({}, S));
|
|
10776
10790
|
};
|
|
10777
10791
|
DatePicker.FilterWithPicker = function(t) {
|
|
10778
|
-
const { picker: o = "date", format: n, showTime: r, timeFormat: i } = t, { utc:
|
|
10779
|
-
utc:
|
|
10792
|
+
const { picker: o = "date", format: n, showTime: r, timeFormat: i } = t, a = isMobile(), { utc: l = !0 } = useDatePickerContext(), c = Array.isArray(t.value) ? t.value[0] : t.value, u = useCompile(), d = useFieldSchema(), p = c ? inferPickerType(c) : o, m = getPickerFormat(p) || n, h = v(x({
|
|
10793
|
+
utc: l,
|
|
10794
|
+
inputReadOnly: a
|
|
10780
10795
|
}, t), {
|
|
10781
10796
|
underFilter: !0,
|
|
10782
10797
|
showTime: r ? { defaultValue: dayjs("00:00:00", "HH:mm:ss") } : !1,
|
|
10783
|
-
format: getDateTimeFormat(
|
|
10784
|
-
picker:
|
|
10785
|
-
onChange: (
|
|
10798
|
+
format: getDateTimeFormat(p, m, r, i),
|
|
10799
|
+
picker: p,
|
|
10800
|
+
onChange: (S) => {
|
|
10786
10801
|
t.onChange(void 0), setTimeout(() => {
|
|
10787
|
-
t.onChange(
|
|
10802
|
+
t.onChange(S);
|
|
10788
10803
|
});
|
|
10789
10804
|
}
|
|
10790
|
-
}),
|
|
10805
|
+
}), g = useField(), [f, C] = useState(h);
|
|
10791
10806
|
return /* @__PURE__ */ jsxs(Space$1.Compact, { children: [
|
|
10792
10807
|
/* @__PURE__ */ jsx(
|
|
10793
10808
|
Select$1,
|
|
@@ -10796,8 +10811,8 @@ DatePicker.FilterWithPicker = function(t) {
|
|
|
10796
10811
|
"data-testid": "select-picker",
|
|
10797
10812
|
style: { width: "100px" },
|
|
10798
10813
|
popupMatchSelectWidth: !1,
|
|
10799
|
-
defaultValue:
|
|
10800
|
-
options:
|
|
10814
|
+
defaultValue: p,
|
|
10815
|
+
options: u([
|
|
10801
10816
|
{
|
|
10802
10817
|
label: '{{t("Date")}}',
|
|
10803
10818
|
value: "date"
|
|
@@ -10815,19 +10830,19 @@ DatePicker.FilterWithPicker = function(t) {
|
|
|
10815
10830
|
value: "year"
|
|
10816
10831
|
}
|
|
10817
10832
|
]),
|
|
10818
|
-
onChange: (
|
|
10819
|
-
const
|
|
10820
|
-
|
|
10821
|
-
picker:
|
|
10822
|
-
format: S
|
|
10823
|
-
}), m.picker = C, m.format = b, f(m), u["x-component-props"] = v(x({}, t), {
|
|
10824
|
-
picker: C,
|
|
10833
|
+
onChange: (S) => {
|
|
10834
|
+
const b = getPickerFormat(S), y = getDateTimeFormat(S, b, r, i);
|
|
10835
|
+
g.setComponentProps({
|
|
10836
|
+
picker: S,
|
|
10825
10837
|
format: b
|
|
10826
|
-
}), h.
|
|
10838
|
+
}), h.picker = S, h.format = y, C(h), d["x-component-props"] = v(x({}, t), {
|
|
10839
|
+
picker: S,
|
|
10840
|
+
format: y
|
|
10841
|
+
}), g.value = null;
|
|
10827
10842
|
}
|
|
10828
10843
|
}
|
|
10829
10844
|
),
|
|
10830
|
-
/* @__PURE__ */ jsx(InternalDatePicker, v(x({},
|
|
10845
|
+
/* @__PURE__ */ jsx(InternalDatePicker, v(x({}, f), { value: c }))
|
|
10831
10846
|
] });
|
|
10832
10847
|
};
|
|
10833
10848
|
const useDateVariable = ({ operator: e, schema: t, noDisabled: o }) => {
|
|
@@ -22099,8 +22114,8 @@ const SchemaSettingsWrapper = (e) => {
|
|
|
22099
22114
|
}
|
|
22100
22115
|
`, TableColumnActionBar$1 = observer$1(
|
|
22101
22116
|
(e) => {
|
|
22102
|
-
const t = useDesigner(), { isInSubTable: o } = useFlag() || {};
|
|
22103
|
-
return /* @__PURE__ */ jsxs(
|
|
22117
|
+
const t = useDesigner(), { isInSubTable: o } = useFlag() || {}, { designable: n } = useSchemaComponentContext();
|
|
22118
|
+
return !n || t.isNullComponent ? e.children : /* @__PURE__ */ jsxs(
|
|
22104
22119
|
SortableItem,
|
|
22105
22120
|
{
|
|
22106
22121
|
className: designerCss$4({
|
|
@@ -22146,21 +22161,27 @@ const useColumnSchema$1 = () => {
|
|
|
22146
22161
|
}, [e, t]);
|
|
22147
22162
|
return t ? o : [];
|
|
22148
22163
|
}, TableColumnDecorator$1 = (e) => {
|
|
22149
|
-
const t = useDesigner(), o = useField(), { fieldSchema: n, uiSchema: r, collectionField: i } = useColumnSchema$1(), a = useCompile(), { isInSubTable:
|
|
22164
|
+
const t = useDesigner(), o = useField(), { fieldSchema: n, uiSchema: r, collectionField: i } = useColumnSchema$1(), { designable: a } = useSchemaComponentContext(), l = useCompile(), { isInSubTable: c } = useFlag() || {};
|
|
22150
22165
|
return useLayoutEffect(() => {
|
|
22151
22166
|
o.title || n && r != null && r.title && (o.title = r == null ? void 0 : r.title);
|
|
22152
|
-
}, [r == null ? void 0 : r.title]), /* @__PURE__ */
|
|
22167
|
+
}, [r == null ? void 0 : r.title]), !a || t.isNullComponent ? /* @__PURE__ */ jsxs(CollectionFieldContext.Provider, { value: i, children: [
|
|
22168
|
+
/* @__PURE__ */ jsx(t, { fieldSchema: n, uiSchema: r, collectionField: i }),
|
|
22169
|
+
/* @__PURE__ */ jsxs("span", { role: "button", children: [
|
|
22170
|
+
(n == null ? void 0 : n.required) && /* @__PURE__ */ jsx("span", { className: "ant-formily-item-asterisk", children: "*" }),
|
|
22171
|
+
/* @__PURE__ */ jsx("span", { children: (o == null ? void 0 : o.title) || l(r == null ? void 0 : r.title) })
|
|
22172
|
+
] })
|
|
22173
|
+
] }) : /* @__PURE__ */ jsx(
|
|
22153
22174
|
SortableItem,
|
|
22154
22175
|
{
|
|
22155
22176
|
className: designerCss$4({
|
|
22156
|
-
margin:
|
|
22157
|
-
padding:
|
|
22177
|
+
margin: c ? "-12px -8px" : "-18px -16px",
|
|
22178
|
+
padding: c ? "12px 8px" : "12px 16px"
|
|
22158
22179
|
}),
|
|
22159
22180
|
children: /* @__PURE__ */ jsxs(CollectionFieldContext.Provider, { value: i, children: [
|
|
22160
22181
|
/* @__PURE__ */ jsx(t, { fieldSchema: n, uiSchema: r, collectionField: i }),
|
|
22161
22182
|
/* @__PURE__ */ jsxs("span", { role: "button", children: [
|
|
22162
22183
|
(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) ||
|
|
22184
|
+
/* @__PURE__ */ jsx("span", { children: (o == null ? void 0 : o.title) || l(r == null ? void 0 : r.title) })
|
|
22164
22185
|
] })
|
|
22165
22186
|
] })
|
|
22166
22187
|
}
|
|
@@ -25418,7 +25439,8 @@ const getAppends = ({
|
|
|
25418
25439
|
"AssociationField.Selector",
|
|
25419
25440
|
"AssociationField.AddNewer",
|
|
25420
25441
|
"TableField",
|
|
25421
|
-
"Kanban.CardViewer"
|
|
25442
|
+
"Kanban.CardViewer",
|
|
25443
|
+
"Action.Container"
|
|
25422
25444
|
].includes(c["x-component"]) || getAppends({
|
|
25423
25445
|
schema: c,
|
|
25424
25446
|
prefix: t,
|
|
@@ -33456,7 +33478,9 @@ class SchemaSettingsPlugin extends Plugin {
|
|
|
33456
33478
|
});
|
|
33457
33479
|
}
|
|
33458
33480
|
}
|
|
33459
|
-
const DefaultSchemaToolbar = () => null
|
|
33481
|
+
const DefaultSchemaToolbar = () => null;
|
|
33482
|
+
DefaultSchemaToolbar.isNullComponent = !0;
|
|
33483
|
+
const useDesigner = () => {
|
|
33460
33484
|
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
33485
|
return e && n || DefaultSchemaToolbar;
|
|
33462
33486
|
}, useFieldProps = (e) => {
|
|
@@ -38419,9 +38443,6 @@ const useColumnsDeepMemoized = (e) => {
|
|
|
38419
38443
|
.ant-table-cell-fix-right {
|
|
38420
38444
|
padding: 8px 16px !important;
|
|
38421
38445
|
}
|
|
38422
|
-
.ant-table-thead .ant-table-cell {
|
|
38423
|
-
padding: 8px 16px;
|
|
38424
|
-
}
|
|
38425
38446
|
}
|
|
38426
38447
|
}
|
|
38427
38448
|
}
|
|
@@ -38775,7 +38796,7 @@ const Table$1 = withDynamicSchemaProps(
|
|
|
38775
38796
|
field: o,
|
|
38776
38797
|
showIndex: !0,
|
|
38777
38798
|
dragSort: !1,
|
|
38778
|
-
showDel: C !== !1 || f !== !1 || S !== !1 ? ($) => o.editable ? S !== !1 ? !0 : $ == null ? void 0 : $.__isNewRecord__ : !1 : !1,
|
|
38799
|
+
showDel: o.editable && (C !== !1 || f !== !1 || S !== !1) ? ($) => o.editable ? S !== !1 ? !0 : $ == null ? void 0 : $.__isNewRecord__ : !1 : !1,
|
|
38779
38800
|
pagination: L,
|
|
38780
38801
|
rowSelection: { type: "none", hideSelectAll: !0 },
|
|
38781
38802
|
footer: () => o.editable && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -40849,10 +40870,13 @@ function toSafeNumber(e) {
|
|
|
40849
40870
|
return e && (e > Number.MAX_SAFE_INTEGER || e < Number.MIN_SAFE_INTEGER ? new BigNumber(e).toString() : Number(e));
|
|
40850
40871
|
}
|
|
40851
40872
|
const InputNumber = connect((e) => {
|
|
40852
|
-
const
|
|
40853
|
-
|
|
40854
|
-
|
|
40855
|
-
|
|
40873
|
+
const i = e, { onChange: t } = i, o = K(i, ["onChange"]);
|
|
40874
|
+
let r = x({
|
|
40875
|
+
onChange: (a) => {
|
|
40876
|
+
Number.isNaN(a) ? t(null) : t(toSafeNumber(a));
|
|
40877
|
+
}
|
|
40878
|
+
}, o);
|
|
40879
|
+
return o.formatStyle && (r = omit$1(r, ["addonAfter", "addonBefore"])), /* @__PURE__ */ jsx(InputNumber$1, x({}, r));
|
|
40856
40880
|
}, mapReadPretty(ReadPretty$2));
|
|
40857
40881
|
InputNumber.ReadPretty = ReadPretty$2;
|
|
40858
40882
|
const ListBlockContext = createContext({});
|
|
@@ -54944,7 +54968,7 @@ function PluginInfo(e) {
|
|
|
54944
54968
|
`,
|
|
54945
54969
|
actions: [
|
|
54946
54970
|
/* @__PURE__ */ jsxs(Space$1, { split: /* @__PURE__ */ jsx(Divider$1, { type: "vertical" }), children: [
|
|
54947
|
-
/* @__PURE__ */ jsxs(
|
|
54971
|
+
g && /* @__PURE__ */ jsxs(
|
|
54948
54972
|
"a",
|
|
54949
54973
|
{
|
|
54950
54974
|
href: g,
|
|
@@ -62247,6 +62271,7 @@ export {
|
|
|
62247
62271
|
isFileCollection,
|
|
62248
62272
|
isInFilterFormBlock,
|
|
62249
62273
|
isInitializersSame,
|
|
62274
|
+
isMobile,
|
|
62250
62275
|
isPatternDisabled,
|
|
62251
62276
|
isSameCollection,
|
|
62252
62277
|
isShowFilePicker,
|
|
@@ -16,6 +16,7 @@ export interface Moment2strOptions {
|
|
|
16
16
|
export declare const moment2str: (value?: Dayjs | null, options?: Moment2strOptions) => any;
|
|
17
17
|
export declare const handleDateChangeOnForm: (value: any, dateOnly: any, utc: any, picker: any, showTime: any, gmt: any) => any;
|
|
18
18
|
export declare const mapDatePicker: () => (props: any) => any;
|
|
19
|
+
export declare function isMobile(): boolean;
|
|
19
20
|
export declare const mapRangePicker: () => (props: any) => any;
|
|
20
21
|
export declare const getDateRanges: (props?: {
|
|
21
22
|
/** 日期是否是 UTC 格式 */
|
|
@@ -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">>>;
|