@nocobase/client 1.2.25-alpha → 1.2.27-alpha
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 +91 -91
- package/lib/index.js +7 -7
- package/package.json +5 -5
package/es/index.mjs
CHANGED
|
@@ -61,7 +61,7 @@ import { Outlet, UNSAFE_RouteContext, UNSAFE_LocationContext, useRoutes, HashRou
|
|
|
61
61
|
import * as nocobaseSDK from "@nocobase/sdk";
|
|
62
62
|
import { APIClient as APIClient$1, getSubAppName } from "@nocobase/sdk";
|
|
63
63
|
import * as antd from "antd";
|
|
64
|
-
import { notification, Spin, message, Tag, Result, Button, Select as Select$1, theme, App, ConfigProvider, Popover, Menu as Menu$1, Switch, Divider, Tooltip, Input as Input$3, Empty, Modal, Typography, Image, Slider, Space as Space$1, Card, Collapse, Badge, Tree as Tree$2, Dropdown, Alert, Cascader as Cascader$1, Radio as Radio$1, Drawer as Drawer$1, Flex,
|
|
64
|
+
import { notification, Spin, message, Tag, Result, Button, Select as Select$1, theme, App, ConfigProvider, Popover, Menu as Menu$1, Switch, Divider, Tooltip, Input as Input$3, Empty, Modal, Typography, Image, Slider, Space as Space$1, Card, Collapse, Badge, Tree as Tree$2, Dropdown, Alert, Cascader as Cascader$1, Radio as Radio$1, Drawer as Drawer$1, Flex, DatePicker as DatePicker$1, InputNumber as InputNumber$1, Tabs as Tabs$1, TreeSelect as TreeSelect$2, Upload as Upload$1, Progress, Table as Table$2, Skeleton, AutoComplete as AutoComplete$1, Checkbox as Checkbox$1, ColorPicker as ColorPicker$1, List as List$1, Col, QRCode, Pagination as Pagination$1, TimePicker as TimePicker$1, Row, Popconfirm, Layout } from "antd";
|
|
65
65
|
import * as formilyShared from "@formily/shared";
|
|
66
66
|
import { merge, uid, isArr, isFn, applyMiddleware, isNum as isNum$1, isStr, isBool, toArr as toArr$3, isValid, isReactElement, each } from "@formily/shared";
|
|
67
67
|
import * as ahooks from "ahooks";
|
|
@@ -3965,7 +3965,7 @@ function addAppVersion(e, t) {
|
|
|
3965
3965
|
addAppVersion((n = e.properties) == null ? void 0 : n[o], t);
|
|
3966
3966
|
}), e;
|
|
3967
3967
|
}
|
|
3968
|
-
const name = "@nocobase/client", version$1 = "1.2.
|
|
3968
|
+
const name = "@nocobase/client", version$1 = "1.2.27-alpha", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
|
|
3969
3969
|
"@ahooksjs/use-url-state": "3.5.1",
|
|
3970
3970
|
"@ant-design/cssinjs": "^1.11.1",
|
|
3971
3971
|
"@ant-design/icons": "^5.1.4",
|
|
@@ -3986,9 +3986,9 @@ const name = "@nocobase/client", version$1 = "1.2.25-alpha", license = "AGPL-3.0
|
|
|
3986
3986
|
"@formily/reactive-react": "^2.2.27",
|
|
3987
3987
|
"@formily/shared": "^2.2.27",
|
|
3988
3988
|
"@formily/validator": "^2.2.27",
|
|
3989
|
-
"@nocobase/evaluators": "1.2.
|
|
3990
|
-
"@nocobase/sdk": "1.2.
|
|
3991
|
-
"@nocobase/utils": "1.2.
|
|
3989
|
+
"@nocobase/evaluators": "1.2.27-alpha",
|
|
3990
|
+
"@nocobase/sdk": "1.2.27-alpha",
|
|
3991
|
+
"@nocobase/utils": "1.2.27-alpha",
|
|
3992
3992
|
ahooks: "^3.7.2",
|
|
3993
3993
|
antd: "^5.12.8",
|
|
3994
3994
|
"antd-style": "3.4.5",
|
|
@@ -21823,7 +21823,65 @@ const Action$1 = Action, ActionBarContext = React.createContext({
|
|
|
21823
21823
|
(l) => (l = l ? `-${l}` : "", `popover-${o}${r}${i}${l}`),
|
|
21824
21824
|
[r, o, i]
|
|
21825
21825
|
) };
|
|
21826
|
-
},
|
|
21826
|
+
}, ReadPretty$c = () => null;
|
|
21827
|
+
ReadPretty$c.DatePicker = function e(t) {
|
|
21828
|
+
const o = usePrefixCls$1("description-date-picker", t);
|
|
21829
|
+
if (!t.value)
|
|
21830
|
+
return /* @__PURE__ */ jsx("div", {});
|
|
21831
|
+
const n = () => {
|
|
21832
|
+
const r = getDefaultFormat(t), i = str2moment(t.value, t), a = dayjs.isDayjs(i) ? i.format(r) : "";
|
|
21833
|
+
return isArr(a) ? a.join("~") : a;
|
|
21834
|
+
};
|
|
21835
|
+
return /* @__PURE__ */ jsx("div", { className: cls(o, t.className), children: n() });
|
|
21836
|
+
};
|
|
21837
|
+
ReadPretty$c.DateRangePicker = function e(t) {
|
|
21838
|
+
const o = usePrefixCls$1("description-text", t), n = getDefaultFormat(t), r = () => {
|
|
21839
|
+
const i = str2moment(t.value, t);
|
|
21840
|
+
if (!i)
|
|
21841
|
+
return "";
|
|
21842
|
+
const a = i.map((l) => l.format(n));
|
|
21843
|
+
return isArr(a) ? a.join("~") : a;
|
|
21844
|
+
};
|
|
21845
|
+
return /* @__PURE__ */ jsx("div", { className: cls(o, t.className), style: t.style, children: r() });
|
|
21846
|
+
};
|
|
21847
|
+
const DatePickerContext = React.createContext({ utc: !0 }), useDatePickerContext = () => React.useContext(DatePickerContext), DatePickerProvider = DatePickerContext.Provider, InternalDatePicker = connect(
|
|
21848
|
+
DatePicker$1,
|
|
21849
|
+
mapProps(mapDatePicker()),
|
|
21850
|
+
mapReadPretty(ReadPretty$c.DatePicker)
|
|
21851
|
+
), InternalRangePicker = connect(
|
|
21852
|
+
DatePicker$1.RangePicker,
|
|
21853
|
+
mapProps(mapRangePicker()),
|
|
21854
|
+
mapReadPretty(ReadPretty$c.DateRangePicker)
|
|
21855
|
+
), DatePicker = (e) => {
|
|
21856
|
+
const { utc: t = !0 } = useDatePickerContext(), o = Array.isArray(e.value) ? e.value[0] : e.value, n = g({ utc: t }, e);
|
|
21857
|
+
return /* @__PURE__ */ jsx(InternalDatePicker, F(g({}, n), { value: o }));
|
|
21858
|
+
};
|
|
21859
|
+
DatePicker.ReadPretty = ReadPretty$c.DatePicker;
|
|
21860
|
+
DatePicker.RangePicker = function e(t) {
|
|
21861
|
+
const { t: o } = useTranslation(), { utc: n = !0 } = useDatePickerContext(), r = getDateRanges(), i = [
|
|
21862
|
+
{ label: o("Today"), value: r.today },
|
|
21863
|
+
{ label: o("Last week"), value: r.lastWeek },
|
|
21864
|
+
{ label: o("This week"), value: r.thisWeek },
|
|
21865
|
+
{ label: o("Next week"), value: r.nextWeek },
|
|
21866
|
+
{ label: o("Last month"), value: r.lastMonth },
|
|
21867
|
+
{ label: o("This month"), value: r.thisMonth },
|
|
21868
|
+
{ label: o("Next month"), value: r.nextMonth },
|
|
21869
|
+
{ label: o("Last quarter"), value: r.lastQuarter },
|
|
21870
|
+
{ label: o("This quarter"), value: r.thisQuarter },
|
|
21871
|
+
{ label: o("Next quarter"), value: r.nextQuarter },
|
|
21872
|
+
{ label: o("Last year"), value: r.lastYear },
|
|
21873
|
+
{ label: o("This year"), value: r.thisYear },
|
|
21874
|
+
{ label: o("Next year"), value: r.nextYear },
|
|
21875
|
+
{ label: o("Last 7 days"), value: r.last7Days },
|
|
21876
|
+
{ label: o("Next 7 days"), value: r.next7Days },
|
|
21877
|
+
{ label: o("Last 30 days"), value: r.last30Days },
|
|
21878
|
+
{ label: o("Next 30 days"), value: r.next30Days },
|
|
21879
|
+
{ label: o("Last 90 days"), value: r.last90Days },
|
|
21880
|
+
{ label: o("Next 90 days"), value: r.next90Days }
|
|
21881
|
+
], a = g({ utc: n, presets: i }, t);
|
|
21882
|
+
return /* @__PURE__ */ jsx(InternalRangePicker, g({}, a));
|
|
21883
|
+
};
|
|
21884
|
+
const StablePopover = (e) => {
|
|
21827
21885
|
const t = useRef(null), o = useCallback((r) => {
|
|
21828
21886
|
t.current = r.target;
|
|
21829
21887
|
}, []), n = useCallback(
|
|
@@ -21868,7 +21926,7 @@ const FilterAction = withDynamicSchemaProps(
|
|
|
21868
21926
|
onOpenChange: h,
|
|
21869
21927
|
trigger: "click",
|
|
21870
21928
|
content: /* @__PURE__ */ jsx("form", { children: /* @__PURE__ */ jsxs(FormProvider, { form: c, children: [
|
|
21871
|
-
/* @__PURE__ */ jsx(
|
|
21929
|
+
/* @__PURE__ */ jsx(DatePickerProvider, { value: { utc: !1 }, children: /* @__PURE__ */ jsx(
|
|
21872
21930
|
SchemaComponent,
|
|
21873
21931
|
{
|
|
21874
21932
|
schema: {
|
|
@@ -21884,7 +21942,7 @@ const FilterAction = withDynamicSchemaProps(
|
|
|
21884
21942
|
}
|
|
21885
21943
|
}
|
|
21886
21944
|
}
|
|
21887
|
-
),
|
|
21945
|
+
) }),
|
|
21888
21946
|
/* @__PURE__ */ jsx(
|
|
21889
21947
|
"div",
|
|
21890
21948
|
{
|
|
@@ -30306,7 +30364,7 @@ function getCurrentOptions(e, t, o) {
|
|
|
30306
30364
|
}
|
|
30307
30365
|
return i(n);
|
|
30308
30366
|
}
|
|
30309
|
-
const ReadPretty$
|
|
30367
|
+
const ReadPretty$b = observer$1(
|
|
30310
30368
|
(e) => {
|
|
30311
30369
|
var a;
|
|
30312
30370
|
const t = g(g({}, defaultFieldNames$1), e.fieldNames), o = useField(), n = useCollectionField(), r = o.dataSource || e.options || (n == null ? void 0 : n.uiSchema.enum) || [], i = getCurrentOptions(o.value, r, t);
|
|
@@ -30437,10 +30495,10 @@ const ReadPretty$c = observer$1(
|
|
|
30437
30495
|
suffixIcon: t != null && t.loading || t != null && t.validating ? /* @__PURE__ */ jsx(LoadingOutlined, {}) : e.suffixIcon
|
|
30438
30496
|
})
|
|
30439
30497
|
),
|
|
30440
|
-
mapReadPretty(ReadPretty$
|
|
30498
|
+
mapReadPretty(ReadPretty$b)
|
|
30441
30499
|
), Select = InternalSelect;
|
|
30442
|
-
Select.ReadPretty = ReadPretty$
|
|
30443
|
-
const getValues = (e, t) => castArray(e).filter((o) => o != null).map((o) => typeof o == "object" ? o[t.value] : o), ReadPretty$
|
|
30500
|
+
Select.ReadPretty = ReadPretty$b;
|
|
30501
|
+
const getValues = (e, t) => castArray(e).filter((o) => o != null).map((o) => typeof o == "object" ? o[t.value] : o), ReadPretty$a = observer$1(
|
|
30444
30502
|
(e) => {
|
|
30445
30503
|
const t = g(g({}, defaultFieldNames$1), e.fieldNames), o = useField(), n = useFieldSchema(), r = useRecord(), { snapshot: i } = useActionContext(), { data: a } = useRequest(
|
|
30446
30504
|
i ? () => V(void 0, null, function* () {
|
|
@@ -30624,9 +30682,9 @@ const getValues = (e, t) => castArray(e).filter((o) => o != null).map((o) => typ
|
|
|
30624
30682
|
});
|
|
30625
30683
|
}
|
|
30626
30684
|
),
|
|
30627
|
-
mapReadPretty(ReadPretty$
|
|
30685
|
+
mapReadPretty(ReadPretty$a)
|
|
30628
30686
|
), RemoteSelect = InternalRemoteSelect;
|
|
30629
|
-
RemoteSelect.ReadPretty = ReadPretty$
|
|
30687
|
+
RemoteSelect.ReadPretty = ReadPretty$a;
|
|
30630
30688
|
const useFormDataTemplates = () => {
|
|
30631
30689
|
const e = useFieldSchema(), { t } = useTranslation(), { duplicateData: o } = useFormBlockContext(), { getCollectionJoinField: n } = useCollectionManager_deprecated();
|
|
30632
30690
|
if (o)
|
|
@@ -32575,7 +32633,7 @@ function InternalUpload(e) {
|
|
|
32575
32633
|
);
|
|
32576
32634
|
return /* @__PURE__ */ jsx(Upload$1, F(g({}, useUploadProps(o)), { onChange: n }));
|
|
32577
32635
|
}
|
|
32578
|
-
function ReadPretty$
|
|
32636
|
+
function ReadPretty$9({ value: e, onChange: t, disabled: o, multiple: n, size: r }) {
|
|
32579
32637
|
const { wrapSSR: i, hashId: a, componentCls: l } = useStyles$8();
|
|
32580
32638
|
return (useUploadStyle.default ? useUploadStyle.default : useUploadStyle)(l), i(
|
|
32581
32639
|
/* @__PURE__ */ jsx(
|
|
@@ -32598,9 +32656,9 @@ const Upload = connect(
|
|
|
32598
32656
|
mapProps({
|
|
32599
32657
|
value: "fileList"
|
|
32600
32658
|
}),
|
|
32601
|
-
mapReadPretty(ReadPretty$
|
|
32659
|
+
mapReadPretty(ReadPretty$9)
|
|
32602
32660
|
);
|
|
32603
|
-
Upload.ReadPretty = ReadPretty$
|
|
32661
|
+
Upload.ReadPretty = ReadPretty$9;
|
|
32604
32662
|
function useSizeHint(e) {
|
|
32605
32663
|
const t = e != null ? e : FILE_SIZE_LIMIT_DEFAULT, { t: o, i18n: n } = useTranslation(), r = filesize(t, { base: 2, standard: "jedec", locale: n.language });
|
|
32606
32664
|
return t !== 0 ? o("File size should not exceed {{size}}.", { size: r }) : "";
|
|
@@ -32870,7 +32928,7 @@ function Attachment(e) {
|
|
|
32870
32928
|
] }) })
|
|
32871
32929
|
);
|
|
32872
32930
|
}
|
|
32873
|
-
Attachment.ReadPretty = ReadPretty$
|
|
32931
|
+
Attachment.ReadPretty = ReadPretty$9;
|
|
32874
32932
|
Upload.Attachment = withDynamicSchemaProps(connect(Attachment, mapReadPretty(Attachment.ReadPretty)), {
|
|
32875
32933
|
displayName: "Upload.Attachment"
|
|
32876
32934
|
});
|
|
@@ -34288,7 +34346,7 @@ const CreateRecordAction$1 = forwardRef(InternalCreateRecordAction), initializer
|
|
|
34288
34346
|
] });
|
|
34289
34347
|
},
|
|
34290
34348
|
{ displayName: "ReadPrettyAssociationField" }
|
|
34291
|
-
), ReadPretty$
|
|
34349
|
+
), ReadPretty$8 = observer$1(
|
|
34292
34350
|
(e) => /* @__PURE__ */ jsx(AssociationFieldProvider, { children: /* @__PURE__ */ jsx(ReadPrettyAssociationField, g({}, e)) }),
|
|
34293
34351
|
{ displayName: "ReadPretty" }
|
|
34294
34352
|
), ColumnFieldProvider = observer$1(
|
|
@@ -34882,14 +34940,14 @@ const useTableColumns$1 = (e) => {
|
|
|
34882
34940
|
] });
|
|
34883
34941
|
},
|
|
34884
34942
|
{ displayName: "SubTable" }
|
|
34885
|
-
), AssociationField = connect(Editable$1, mapReadPretty(ReadPretty$
|
|
34943
|
+
), AssociationField = connect(Editable$1, mapReadPretty(ReadPretty$8));
|
|
34886
34944
|
AssociationField.SubTable = SubTable;
|
|
34887
34945
|
AssociationField.Nester = Nester;
|
|
34888
34946
|
AssociationField.AddNewer = Action.Container;
|
|
34889
34947
|
AssociationField.Selector = Action.Container;
|
|
34890
34948
|
AssociationField.Viewer = Action.Container;
|
|
34891
34949
|
AssociationField.InternalSelect = InternalPicker;
|
|
34892
|
-
AssociationField.ReadPretty = ReadPretty$
|
|
34950
|
+
AssociationField.ReadPretty = ReadPretty$8;
|
|
34893
34951
|
function useServiceOptions(e) {
|
|
34894
34952
|
const { action: t = "list", service: o, fieldNames: n } = e, r = (o == null ? void 0 : o.params) || {}, i = useFieldSchema(), { getField: a } = useCollection_deprecated(), { getCollectionFields: l } = useCollectionManager_deprecated(), c = useRecord(), u = useCallback(
|
|
34895
34953
|
(f) => f && typeof f == "object" ? f[n.value] : f,
|
|
@@ -34930,7 +34988,7 @@ function useServiceOptions(e) {
|
|
|
34930
34988
|
params: F(g({}, o == null ? void 0 : o.params), { filter: h })
|
|
34931
34989
|
}), [p == null ? void 0 : p.target, t, h, o]);
|
|
34932
34990
|
}
|
|
34933
|
-
const ReadPretty$
|
|
34991
|
+
const ReadPretty$7 = observer$1(
|
|
34934
34992
|
(e) => {
|
|
34935
34993
|
const t = useServiceOptions(e);
|
|
34936
34994
|
return useFieldTitle(), /* @__PURE__ */ jsx(RemoteSelect.ReadPretty, F(g({}, e), { service: t }));
|
|
@@ -34965,7 +35023,7 @@ const ReadPretty$8 = observer$1(
|
|
|
34965
35023
|
suffixIcon: t != null && t.loading || t != null && t.validating ? /* @__PURE__ */ jsx(LoadingOutlined, {}) : e.suffixIcon
|
|
34966
35024
|
})
|
|
34967
35025
|
),
|
|
34968
|
-
mapReadPretty(ReadPretty$
|
|
35026
|
+
mapReadPretty(ReadPretty$7)
|
|
34969
35027
|
), AssociationSelect = InternalAssociationSelect;
|
|
34970
35028
|
AssociationSelect.Designer = function e() {
|
|
34971
35029
|
var j, B, T, D, $, q, E, G, U, K, Y;
|
|
@@ -35709,7 +35767,7 @@ const blockDeleteSettings = new SchemaSettings({
|
|
|
35709
35767
|
label: "label",
|
|
35710
35768
|
value: "value",
|
|
35711
35769
|
children: "children"
|
|
35712
|
-
}, ReadPretty$
|
|
35770
|
+
}, ReadPretty$6 = (e) => {
|
|
35713
35771
|
const { fieldNames: t = defaultFieldNames } = e, o = toArr$3(e.value), n = o.length;
|
|
35714
35772
|
let i = useField().dataSource;
|
|
35715
35773
|
const a = [];
|
|
@@ -35795,10 +35853,10 @@ const blockDeleteSettings = new SchemaSettings({
|
|
|
35795
35853
|
suffixIcon: t != null && t.loading || t != null && t.validating ? /* @__PURE__ */ jsx(LoadingOutlined, {}) : e.suffixIcon
|
|
35796
35854
|
})
|
|
35797
35855
|
),
|
|
35798
|
-
mapReadPretty(ReadPretty$
|
|
35856
|
+
mapReadPretty(ReadPretty$6)
|
|
35799
35857
|
),
|
|
35800
35858
|
{ displayName: "Cascader" }
|
|
35801
|
-
), ReadPretty$
|
|
35859
|
+
), ReadPretty$5 = (e) => e.value ? /* @__PURE__ */ jsx(CheckOutlined, { style: { color: "#52c41a" } }) : e.showUnchecked ? /* @__PURE__ */ jsx(CloseOutlined, { style: { color: "#ff4d4f" } }) : null, Checkbox = connect(
|
|
35802
35860
|
(e) => {
|
|
35803
35861
|
const t = (o) => {
|
|
35804
35862
|
e == null || e.onChange(o);
|
|
@@ -35809,10 +35867,10 @@ const blockDeleteSettings = new SchemaSettings({
|
|
|
35809
35867
|
value: "checked",
|
|
35810
35868
|
onInput: "onChange"
|
|
35811
35869
|
}),
|
|
35812
|
-
mapReadPretty(ReadPretty$
|
|
35870
|
+
mapReadPretty(ReadPretty$5)
|
|
35813
35871
|
);
|
|
35814
35872
|
Checkbox.displayName = "Checkbox";
|
|
35815
|
-
Checkbox.ReadPretty = ReadPretty$
|
|
35873
|
+
Checkbox.ReadPretty = ReadPretty$5;
|
|
35816
35874
|
Checkbox.ReadPretty.displayName = "Checkbox.ReadPretty";
|
|
35817
35875
|
Checkbox.__ANT_CHECKBOX = !0;
|
|
35818
35876
|
Checkbox.Group = connect(
|
|
@@ -36061,7 +36119,7 @@ const DataSourceSelect = connect((e) => {
|
|
|
36061
36119
|
children: /* @__PURE__ */ jsx(Cron$1, g({ setValue: t, locale: window.cronLocale }, o))
|
|
36062
36120
|
}
|
|
36063
36121
|
);
|
|
36064
|
-
}, ReadPretty$
|
|
36122
|
+
}, ReadPretty$4 = (e) => {
|
|
36065
36123
|
const o = useAPIClient().auth.getLocale(), n = useMemo(() => {
|
|
36066
36124
|
try {
|
|
36067
36125
|
return cronstrue.toString(e.value, {
|
|
@@ -36073,8 +36131,8 @@ const DataSourceSelect = connect((e) => {
|
|
|
36073
36131
|
}
|
|
36074
36132
|
}, [e.value]);
|
|
36075
36133
|
return e.value ? /* @__PURE__ */ jsx("span", { children: n }) : null;
|
|
36076
|
-
}, Cron = connect(Input, mapReadPretty(ReadPretty$
|
|
36077
|
-
Cron.ReadPretty = ReadPretty$
|
|
36134
|
+
}, Cron = connect(Input, mapReadPretty(ReadPretty$4));
|
|
36135
|
+
Cron.ReadPretty = ReadPretty$4;
|
|
36078
36136
|
const CronSetInternal = (e) => {
|
|
36079
36137
|
var m;
|
|
36080
36138
|
const { onChange: t, value: o } = e, { getField: n } = useCollection_deprecated(), r = useFieldSchema(), i = (m = n(r == null ? void 0 : r.name)) == null ? void 0 : m.uiSchema.enum, a = useCompile(), [l, c] = useState({
|
|
@@ -36117,72 +36175,14 @@ const CronSetInternal = (e) => {
|
|
|
36117
36175
|
}
|
|
36118
36176
|
) : null
|
|
36119
36177
|
] });
|
|
36120
|
-
}, ReadPretty$
|
|
36178
|
+
}, ReadPretty$3 = (e) => {
|
|
36121
36179
|
var c;
|
|
36122
36180
|
const { value: t } = e, o = useCompile(), n = useFieldSchema(), { getField: r } = useCollection_deprecated(), i = (c = r(n == null ? void 0 : n.name)) == null ? void 0 : c.uiSchema.enum, a = useMemo(() => (e.options || []).concat(i || []), [e.options]), l = useMemo(() => {
|
|
36123
36181
|
var u;
|
|
36124
36182
|
return t && ((u = a == null ? void 0 : a.find((d) => d.value === t)) == null ? void 0 : u.label);
|
|
36125
36183
|
}, [a, t]);
|
|
36126
36184
|
return /* @__PURE__ */ jsx(EllipsisWithTooltip, { ellipsis: !0, children: t && (l ? o(l) : /* @__PURE__ */ jsx(Cron.ReadPretty, g({}, e))) });
|
|
36127
|
-
}, CronSet = connect(CronSetInternal, mapReadPretty(ReadPretty$
|
|
36128
|
-
ReadPretty$3.DatePicker = function e(t) {
|
|
36129
|
-
const o = usePrefixCls$1("description-date-picker", t);
|
|
36130
|
-
if (!t.value)
|
|
36131
|
-
return /* @__PURE__ */ jsx("div", {});
|
|
36132
|
-
const n = () => {
|
|
36133
|
-
const r = getDefaultFormat(t), i = str2moment(t.value, t), a = dayjs.isDayjs(i) ? i.format(r) : "";
|
|
36134
|
-
return isArr(a) ? a.join("~") : a;
|
|
36135
|
-
};
|
|
36136
|
-
return /* @__PURE__ */ jsx("div", { className: cls(o, t.className), children: n() });
|
|
36137
|
-
};
|
|
36138
|
-
ReadPretty$3.DateRangePicker = function e(t) {
|
|
36139
|
-
const o = usePrefixCls$1("description-text", t), n = getDefaultFormat(t), r = () => {
|
|
36140
|
-
const i = str2moment(t.value, t);
|
|
36141
|
-
if (!i)
|
|
36142
|
-
return "";
|
|
36143
|
-
const a = i.map((l) => l.format(n));
|
|
36144
|
-
return isArr(a) ? a.join("~") : a;
|
|
36145
|
-
};
|
|
36146
|
-
return /* @__PURE__ */ jsx("div", { className: cls(o, t.className), style: t.style, children: r() });
|
|
36147
|
-
};
|
|
36148
|
-
const DatePickerContext = React.createContext({ utc: !0 }), useDatePickerContext = () => React.useContext(DatePickerContext), DatePickerProvider = DatePickerContext.Provider, InternalDatePicker = connect(
|
|
36149
|
-
DatePicker$1,
|
|
36150
|
-
mapProps(mapDatePicker()),
|
|
36151
|
-
mapReadPretty(ReadPretty$3.DatePicker)
|
|
36152
|
-
), InternalRangePicker = connect(
|
|
36153
|
-
DatePicker$1.RangePicker,
|
|
36154
|
-
mapProps(mapRangePicker()),
|
|
36155
|
-
mapReadPretty(ReadPretty$3.DateRangePicker)
|
|
36156
|
-
), DatePicker = (e) => {
|
|
36157
|
-
const { utc: t = !0 } = useDatePickerContext(), o = Array.isArray(e.value) ? e.value[0] : e.value, n = g({ utc: t }, e);
|
|
36158
|
-
return /* @__PURE__ */ jsx(InternalDatePicker, F(g({}, n), { value: o }));
|
|
36159
|
-
};
|
|
36160
|
-
DatePicker.ReadPretty = ReadPretty$3.DatePicker;
|
|
36161
|
-
DatePicker.RangePicker = function e(t) {
|
|
36162
|
-
const { t: o } = useTranslation(), { utc: n = !0 } = useDatePickerContext(), r = getDateRanges(), i = [
|
|
36163
|
-
{ label: o("Today"), value: r.today },
|
|
36164
|
-
{ label: o("Last week"), value: r.lastWeek },
|
|
36165
|
-
{ label: o("This week"), value: r.thisWeek },
|
|
36166
|
-
{ label: o("Next week"), value: r.nextWeek },
|
|
36167
|
-
{ label: o("Last month"), value: r.lastMonth },
|
|
36168
|
-
{ label: o("This month"), value: r.thisMonth },
|
|
36169
|
-
{ label: o("Next month"), value: r.nextMonth },
|
|
36170
|
-
{ label: o("Last quarter"), value: r.lastQuarter },
|
|
36171
|
-
{ label: o("This quarter"), value: r.thisQuarter },
|
|
36172
|
-
{ label: o("Next quarter"), value: r.nextQuarter },
|
|
36173
|
-
{ label: o("Last year"), value: r.lastYear },
|
|
36174
|
-
{ label: o("This year"), value: r.thisYear },
|
|
36175
|
-
{ label: o("Next year"), value: r.nextYear },
|
|
36176
|
-
{ label: o("Last 7 days"), value: r.last7Days },
|
|
36177
|
-
{ label: o("Next 7 days"), value: r.next7Days },
|
|
36178
|
-
{ label: o("Last 30 days"), value: r.last30Days },
|
|
36179
|
-
{ label: o("Next 30 days"), value: r.next30Days },
|
|
36180
|
-
{ label: o("Last 90 days"), value: r.last90Days },
|
|
36181
|
-
{ label: o("Next 90 days"), value: r.next90Days }
|
|
36182
|
-
], a = g({ utc: n, presets: i }, t);
|
|
36183
|
-
return /* @__PURE__ */ jsx(InternalRangePicker, g({}, a));
|
|
36184
|
-
};
|
|
36185
|
-
const Details = withDynamicSchemaProps(
|
|
36185
|
+
}, CronSet = connect(CronSetInternal, mapReadPretty(ReadPretty$3)), Details = withDynamicSchemaProps(
|
|
36186
36186
|
(e) => {
|
|
36187
36187
|
var o;
|
|
36188
36188
|
const t = useDataBlockRequest();
|