@nocobase/client 1.5.0-beta.18 → 1.5.0-beta.19

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.
Files changed (3) hide show
  1. package/es/index.mjs +68 -76
  2. package/lib/index.js +73 -73
  3. package/package.json +5 -5
package/es/index.mjs CHANGED
@@ -73,7 +73,7 @@ import * as nocobaseSDK from "@nocobase/sdk";
73
73
  import { APIClient as APIClient$1, getSubAppName } from "@nocobase/sdk";
74
74
  import cloneDeep from "lodash/cloneDeep";
75
75
  import * as nocobaseClientUtils from "@nocobase/utils/client";
76
- import { isPlainObject, tval as tval$1, flatten, getValuesByPath, getDefaultFormat, str2moment, toGmt, toLocal, getPickerFormat, Handlebars, dayjs as dayjs$1, uid as uid$1, error, isPortalInBody, forEach, unflatten as unflatten$1, isURL, parse, nextTick, toFixedByStep, parseHTML } from "@nocobase/utils/client";
76
+ import { isPlainObject, tval as tval$1, flatten, getValuesByPath, getDefaultFormat, str2moment, toGmt, toLocal, getPickerFormat, Handlebars, dayjs as dayjs$1, uid as uid$1, error, isPortalInBody, forEach, getDateTimeFormat, unflatten as unflatten$1, isURL, parse, nextTick, toFixedByStep, parseHTML } from "@nocobase/utils/client";
77
77
  import deepmerge from "deepmerge";
78
78
  import uniq$1 from "lodash/uniq";
79
79
  import * as formilyJsonReactive from "@formily/reactive";
@@ -10112,7 +10112,7 @@ const TableCellRender = ({ record: e, columnSchema: t, uiSchema: n, filterProper
10112
10112
  return spliceArrayState(o, {
10113
10113
  startIndex: R,
10114
10114
  deleteCount: T
10115
- }), o.value.splice(R, T), o.setInitialValue(o.value), o.onInput(o.value);
10115
+ }), o.value.splice(R, T), o.setInitialValue([...o.value]), o.onInput(o.value);
10116
10116
  }),
10117
10117
  children: /* @__PURE__ */ jsx(CloseOutlined, { style: { cursor: "pointer", color: "gray" } })
10118
10118
  }
@@ -19226,35 +19226,35 @@ const DatePickerContext = React.createContext({ utc: !0 }), useDatePickerContext
19226
19226
  };
19227
19227
  DatePicker.ReadPretty = ReadPretty$d.DatePicker;
19228
19228
  DatePicker.RangePicker = function e(t) {
19229
- const { value: n, picker: o = "date", format: r } = t, { t: i } = useTranslation(), a = useFieldSchema(), l = useField(), { utc: c = !0 } = useDatePickerContext(), u = getDateRanges(), d = useCompile(), p = !a["x-filter-operator"], m = [
19230
- { label: i("Today"), value: u.today },
19231
- { label: i("Last week"), value: u.lastWeek },
19232
- { label: i("This week"), value: u.thisWeek },
19233
- { label: i("Next week"), value: u.nextWeek },
19234
- { label: i("Last month"), value: u.lastMonth },
19235
- { label: i("This month"), value: u.thisMonth },
19236
- { label: i("Next month"), value: u.nextMonth },
19237
- { label: i("Last quarter"), value: u.lastQuarter },
19238
- { label: i("This quarter"), value: u.thisQuarter },
19239
- { label: i("Next quarter"), value: u.nextQuarter },
19240
- { label: i("Last year"), value: u.lastYear },
19241
- { label: i("This year"), value: u.thisYear },
19242
- { label: i("Next year"), value: u.nextYear },
19243
- { label: i("Last 7 days"), value: u.last7Days },
19244
- { label: i("Next 7 days"), value: u.next7Days },
19245
- { label: i("Last 30 days"), value: u.last30Days },
19246
- { label: i("Next 30 days"), value: u.next30Days },
19247
- { label: i("Last 90 days"), value: u.last90Days },
19248
- { label: i("Next 90 days"), value: u.next90Days }
19249
- ], h = n ? inferPickerType(n == null ? void 0 : n[0]) : o, g = getPickerFormat(h) || r, f = P(x({
19250
- utc: c,
19251
- presets: m
19229
+ const { value: n, picker: o = "date", format: r, showTime: i, timeFormat: a } = t, { t: l } = useTranslation(), c = useFieldSchema(), u = useField(), { utc: d = !0 } = useDatePickerContext(), p = getDateRanges(), m = useCompile(), h = !c["x-filter-operator"], g = [
19230
+ { label: l("Today"), value: p.today },
19231
+ { label: l("Last week"), value: p.lastWeek },
19232
+ { label: l("This week"), value: p.thisWeek },
19233
+ { label: l("Next week"), value: p.nextWeek },
19234
+ { label: l("Last month"), value: p.lastMonth },
19235
+ { label: l("This month"), value: p.thisMonth },
19236
+ { label: l("Next month"), value: p.nextMonth },
19237
+ { label: l("Last quarter"), value: p.lastQuarter },
19238
+ { label: l("This quarter"), value: p.thisQuarter },
19239
+ { label: l("Next quarter"), value: p.nextQuarter },
19240
+ { label: l("Last year"), value: p.lastYear },
19241
+ { label: l("This year"), value: p.thisYear },
19242
+ { label: l("Next year"), value: p.nextYear },
19243
+ { label: l("Last 7 days"), value: p.last7Days },
19244
+ { label: l("Next 7 days"), value: p.next7Days },
19245
+ { label: l("Last 30 days"), value: p.last30Days },
19246
+ { label: l("Next 30 days"), value: p.next30Days },
19247
+ { label: l("Last 90 days"), value: p.last90Days },
19248
+ { label: l("Next 90 days"), value: p.next90Days }
19249
+ ], f = n ? inferPickerType(n == null ? void 0 : n[0]) : o, C = getPickerFormat(f) || r, b = P(x({
19250
+ utc: d,
19251
+ presets: g
19252
19252
  }, t), {
19253
- format: g,
19254
- picker: h,
19255
- showTime: t.showTime ? { defaultValue: [dayjs("00:00:00", "HH:mm:ss"), dayjs("00:00:00", "HH:mm:ss")] } : !1
19256
- }), [C, b] = useState(f);
19257
- return p ? /* @__PURE__ */ jsxs(Space$1.Compact, { children: [
19253
+ format: getDateTimeFormat(f, C, i, a),
19254
+ picker: f,
19255
+ showTime: i ? { defaultValue: [dayjs("00:00:00", "HH:mm:ss"), dayjs("00:00:00", "HH:mm:ss")] } : !1
19256
+ }), [y, S] = useState(b);
19257
+ return h ? /* @__PURE__ */ jsxs(Space$1.Compact, { children: [
19258
19258
  /* @__PURE__ */ jsx(
19259
19259
  Select$1,
19260
19260
  {
@@ -19262,8 +19262,8 @@ DatePicker.RangePicker = function e(t) {
19262
19262
  "data-testid": "select-picker",
19263
19263
  style: { width: "100px" },
19264
19264
  popupMatchSelectWidth: !1,
19265
- defaultValue: h,
19266
- options: d([
19265
+ defaultValue: f,
19266
+ options: m([
19267
19267
  {
19268
19268
  label: '{{t("Date")}}',
19269
19269
  value: "date"
@@ -19281,35 +19281,35 @@ DatePicker.RangePicker = function e(t) {
19281
19281
  value: "year"
19282
19282
  }
19283
19283
  ]),
19284
- onChange: (y) => {
19285
- const S = getPickerFormat(y);
19286
- l.setComponentProps({
19287
- picker: y,
19288
- format: S
19289
- }), f.picker = y, f.format = S, b(f), a["x-component-props"] = P(x({}, t), {
19290
- picker: y,
19291
- format: S
19292
- }), l.value = void 0;
19284
+ onChange: (v) => {
19285
+ const F = getPickerFormat(v), I = getDateTimeFormat(v, F, i, a);
19286
+ u.setComponentProps({
19287
+ picker: v,
19288
+ format: F
19289
+ }), b.picker = v, b.format = I, S(b), c["x-component-props"] = P(x({}, t), {
19290
+ picker: v,
19291
+ format: I
19292
+ }), u.value = void 0;
19293
19293
  }
19294
19294
  }
19295
19295
  ),
19296
- /* @__PURE__ */ jsx(InternalRangePicker, P(x({}, C), { value: n }))
19297
- ] }) : /* @__PURE__ */ jsx(InternalRangePicker, x({}, f));
19296
+ /* @__PURE__ */ jsx(InternalRangePicker, P(x({}, y), { value: n }))
19297
+ ] }) : /* @__PURE__ */ jsx(InternalRangePicker, x({}, b));
19298
19298
  };
19299
19299
  DatePicker.FilterWithPicker = function e(t) {
19300
- const { picker: n = "date", format: o } = t, { utc: r = !0 } = useDatePickerContext(), i = Array.isArray(t.value) ? t.value[0] : t.value, a = useCompile(), l = useFieldSchema(), c = i ? inferPickerType(i) : n, u = getPickerFormat(c) || o, d = P(x({
19301
- utc: r
19300
+ const { picker: n = "date", format: o, showTime: r, timeFormat: i } = t, { utc: a = !0 } = useDatePickerContext(), l = Array.isArray(t.value) ? t.value[0] : t.value, c = useCompile(), u = useFieldSchema(), d = l ? inferPickerType(l) : n, p = getPickerFormat(d) || o, m = P(x({
19301
+ utc: a
19302
19302
  }, t), {
19303
19303
  underFilter: !0,
19304
- showTime: t.showTime ? { defaultValue: dayjs("00:00:00", "HH:mm:ss") } : !1,
19305
- format: u,
19306
- picker: c,
19307
- onChange: (g) => {
19304
+ showTime: r ? { defaultValue: dayjs("00:00:00", "HH:mm:ss") } : !1,
19305
+ format: getDateTimeFormat(d, p, r, i),
19306
+ picker: d,
19307
+ onChange: (C) => {
19308
19308
  t.onChange(void 0), setTimeout(() => {
19309
- t.onChange(g);
19309
+ t.onChange(C);
19310
19310
  });
19311
19311
  }
19312
- }), p = useField(), [m, h] = useState(d);
19312
+ }), h = useField(), [g, f] = useState(m);
19313
19313
  return /* @__PURE__ */ jsxs(Space$1.Compact, { children: [
19314
19314
  /* @__PURE__ */ jsx(
19315
19315
  Select$1,
@@ -19318,8 +19318,8 @@ DatePicker.FilterWithPicker = function e(t) {
19318
19318
  "data-testid": "select-picker",
19319
19319
  style: { width: "100px" },
19320
19320
  popupMatchSelectWidth: !1,
19321
- defaultValue: c,
19322
- options: a([
19321
+ defaultValue: d,
19322
+ options: c([
19323
19323
  {
19324
19324
  label: '{{t("Date")}}',
19325
19325
  value: "date"
@@ -19337,19 +19337,19 @@ DatePicker.FilterWithPicker = function e(t) {
19337
19337
  value: "year"
19338
19338
  }
19339
19339
  ]),
19340
- onChange: (g) => {
19341
- const f = getPickerFormat(g);
19342
- p.setComponentProps({
19343
- picker: g,
19344
- format: f
19345
- }), d.picker = g, d.format = f, h(d), l["x-component-props"] = P(x({}, t), {
19346
- picker: g,
19347
- format: f
19348
- }), p.value = null;
19340
+ onChange: (C) => {
19341
+ const b = getPickerFormat(C), y = getDateTimeFormat(C, b, r, i);
19342
+ h.setComponentProps({
19343
+ picker: C,
19344
+ format: b
19345
+ }), m.picker = C, m.format = y, f(m), u["x-component-props"] = P(x({}, t), {
19346
+ picker: C,
19347
+ format: y
19348
+ }), h.value = null;
19349
19349
  }
19350
19350
  }
19351
19351
  ),
19352
- /* @__PURE__ */ jsx(InternalDatePicker, P(x({}, m), { value: i }))
19352
+ /* @__PURE__ */ jsx(InternalDatePicker, P(x({}, g), { value: l }))
19353
19353
  ] });
19354
19354
  };
19355
19355
  const useDateVariable = ({ operator: e, schema: t, noDisabled: n }) => {
@@ -34936,7 +34936,7 @@ function addAppVersion(e, t) {
34936
34936
  addAppVersion((o = e.properties) == null ? void 0 : o[n], t);
34937
34937
  }), e;
34938
34938
  }
34939
- const name = "@nocobase/client", version = "1.5.0-beta.18", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
34939
+ const name = "@nocobase/client", version = "1.5.0-beta.19", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
34940
34940
  "@ahooksjs/use-url-state": "3.5.1",
34941
34941
  "@ant-design/cssinjs": "^1.11.1",
34942
34942
  "@ant-design/icons": "^5.1.4",
@@ -34958,9 +34958,9 @@ const name = "@nocobase/client", version = "1.5.0-beta.18", license = "AGPL-3.0"
34958
34958
  "@formily/reactive-react": "^2.2.27",
34959
34959
  "@formily/shared": "^2.2.27",
34960
34960
  "@formily/validator": "^2.2.27",
34961
- "@nocobase/evaluators": "1.5.0-beta.18",
34962
- "@nocobase/sdk": "1.5.0-beta.18",
34963
- "@nocobase/utils": "1.5.0-beta.18",
34961
+ "@nocobase/evaluators": "1.5.0-beta.19",
34962
+ "@nocobase/sdk": "1.5.0-beta.19",
34963
+ "@nocobase/utils": "1.5.0-beta.19",
34964
34964
  ahooks: "^3.7.2",
34965
34965
  antd: "5.12.8",
34966
34966
  "antd-style": "3.7.1",
@@ -39454,15 +39454,7 @@ const getSourceData = (e, t) => {
39454
39454
  return r === !1 ? b : /* @__PURE__ */ jsx(PopupVisibleProvider, { visible: !1, children: /* @__PURE__ */ jsxs(ActionContextProvider, { value: y, children: [
39455
39455
  b,
39456
39456
  h && // The recordData here is only provided when the popup is opened, not the current row record
39457
- /* @__PURE__ */ jsx(VariablePopupRecordProvider, { children: /* @__PURE__ */ jsx(WithoutTableFieldResource.Provider, { value: !0, children: /* @__PURE__ */ jsx(
39458
- NocoBaseRecursionField,
39459
- {
39460
- schema: o,
39461
- onlyRenderProperties: !0,
39462
- basePath: l.address,
39463
- filterProperties: (v) => v["x-component"] === "AssociationField.Viewer"
39464
- }
39465
- ) }) })
39457
+ /* @__PURE__ */ jsx(VariablePopupRecordProvider, { children: /* @__PURE__ */ jsx(WithoutTableFieldResource.Provider, { value: !0, children: /* @__PURE__ */ jsx(NocoBaseRecursionField, { schema: o, onlyRenderProperties: !0, basePath: l.address }) }) })
39466
39458
  ] }) });
39467
39459
  }, InternalPopoverNesterContentCss = css`
39468
39460
  min-width: 600px;