openxiangda 1.0.17 → 1.0.18

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.
@@ -60,3 +60,6 @@ Read these references only when editing page code:
60
60
  - For list / detail / CRUD pages, follow `../../references/architecture-patterns.md` (e.g. `DataManagementList`) before writing custom data-fetching loops.
61
61
  - Pick components per `../../references/component-guide.md`: prefer the platform component, fall back to Ant Design, and only build a custom component when neither fits.
62
62
  - When a page misbehaves (lost styles, `options is undefined`, option labels showing raw values, etc.), consult `../../references/troubleshooting.md` before patching symptoms.
63
+ - For custom portal pages and business modals, do not temporarily embed a single `FormProvider` field component from the standard form runtime. If a standard component is required, navigate to a full standard form page or render a complete `StandardFormPage` inside a dedicated carrier route.
64
+ - Keep PC and mobile portal styles separate. Do not share one form UI implementation across both viewports unless the surrounding shell, modal layer, date picker, and bottom-sheet behavior have been tested in both contexts.
65
+ - After introducing Ant Design overlays, date/datetime fields, or mobile bottom-sheet selectors, verify that global button, modal, picker, and sheet styles do not leak into the host business page.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openxiangda",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "OpenXiangda CLI, workspace build tools, runtime SDK, and form components.",
5
5
  "private": false,
6
6
  "bin": {
@@ -31713,26 +31713,35 @@ var secondOptions = Array.from({ length: 60 }, (_, second) => ({
31713
31713
  label: `${second}\u79D2`,
31714
31714
  value: pad2(second)
31715
31715
  }));
31716
- function formatMobileTime(date4) {
31717
- return (0, import_dayjs12.default)(date4).format("HH:mm:ss");
31716
+ function resolveTimePickerPrecision(dateFormat) {
31717
+ return dateFormat && /s/i.test(dateFormat) ? "second" : "minute";
31718
31718
  }
31719
- function getTimePickerValue(date4) {
31720
- return [(0, import_dayjs12.default)(date4).format("HH"), (0, import_dayjs12.default)(date4).format("mm"), (0, import_dayjs12.default)(date4).format("ss")];
31719
+ function formatMobileTime(date4, dateFormat) {
31720
+ return (0, import_dayjs12.default)(date4).format(resolveTimePickerPrecision(dateFormat) === "second" ? "HH:mm:ss" : "HH:mm");
31721
31721
  }
31722
- function applyTimePickerValue(base, value) {
31722
+ function getTimePickerColumns(precision = "second") {
31723
+ return precision === "second" ? [hourOptions, minuteOptions, secondOptions] : [hourOptions, minuteOptions];
31724
+ }
31725
+ function getTimePickerValue(date4, precision = "second") {
31726
+ const base = [(0, import_dayjs12.default)(date4).format("HH"), (0, import_dayjs12.default)(date4).format("mm")];
31727
+ return precision === "second" ? [...base, (0, import_dayjs12.default)(date4).format("ss")] : base;
31728
+ }
31729
+ function applyTimePickerValue(base, value, precision = "second") {
31723
31730
  const [hour, minute, second] = value;
31724
- return (0, import_dayjs12.default)(base).hour(Number(hour ?? 0)).minute(Number(minute ?? 0)).second(Number(second ?? 0)).millisecond(0).toDate();
31731
+ return (0, import_dayjs12.default)(base).hour(Number(hour ?? 0)).minute(Number(minute ?? 0)).second(precision === "second" ? Number(second ?? 0) : 0).millisecond(0).toDate();
31725
31732
  }
31726
31733
  function MobileTimePickerView({
31727
31734
  value,
31735
+ dateFormat,
31728
31736
  onChange
31729
31737
  }) {
31738
+ const precision = resolveTimePickerPrecision(dateFormat);
31730
31739
  return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
31731
31740
  picker_view_default,
31732
31741
  {
31733
- columns: [hourOptions, minuteOptions, secondOptions],
31734
- value: getTimePickerValue(value),
31735
- onChange: (nextValue) => onChange(applyTimePickerValue(value, nextValue)),
31742
+ columns: getTimePickerColumns(precision),
31743
+ value: getTimePickerValue(value, precision),
31744
+ onChange: (nextValue) => onChange(applyTimePickerValue(value, nextValue, precision)),
31736
31745
  className: "sy-mobile-time-picker",
31737
31746
  renderLabel: (item) => item.label
31738
31747
  }
@@ -31769,30 +31778,32 @@ function getDateOptions(center, min2, max2) {
31769
31778
  };
31770
31779
  });
31771
31780
  }
31772
- function getDateTimePickerValue(date4) {
31773
- return [(0, import_dayjs12.default)(date4).format("YYYY-MM-DD"), ...getTimePickerValue(date4)];
31781
+ function getDateTimePickerValue(date4, precision = "second") {
31782
+ return [(0, import_dayjs12.default)(date4).format("YYYY-MM-DD"), ...getTimePickerValue(date4, precision)];
31774
31783
  }
31775
- function applyDateTimePickerValue(base, value) {
31784
+ function applyDateTimePickerValue(base, value, precision = "second") {
31776
31785
  const [dateValue, hour, minute, second] = value;
31777
31786
  const date4 = (0, import_dayjs12.default)(String(dateValue || (0, import_dayjs12.default)(base).format("YYYY-MM-DD")));
31778
- return date4.hour(Number(hour ?? 0)).minute(Number(minute ?? 0)).second(Number(second ?? 0)).millisecond(0).toDate();
31787
+ return date4.hour(Number(hour ?? 0)).minute(Number(minute ?? 0)).second(precision === "second" ? Number(second ?? 0) : 0).millisecond(0).toDate();
31779
31788
  }
31780
31789
  function MobileDateTimePickerView({
31781
31790
  value,
31791
+ dateFormat,
31782
31792
  min: min2,
31783
31793
  max: max2,
31784
31794
  onChange
31785
31795
  }) {
31796
+ const precision = resolveTimePickerPrecision(dateFormat);
31786
31797
  const columns = import_react216.default.useMemo(
31787
- () => [getDateOptions(value, min2, max2), hourOptions, minuteOptions, secondOptions],
31788
- [value, min2, max2]
31798
+ () => [getDateOptions(value, min2, max2), ...getTimePickerColumns(precision)],
31799
+ [value, min2, max2, precision]
31789
31800
  );
31790
31801
  return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
31791
31802
  picker_view_default,
31792
31803
  {
31793
31804
  columns,
31794
- value: getDateTimePickerValue(value),
31795
- onChange: (nextValue) => onChange(applyDateTimePickerValue(value, nextValue)),
31805
+ value: getDateTimePickerValue(value, precision),
31806
+ onChange: (nextValue) => onChange(applyDateTimePickerValue(value, nextValue, precision)),
31796
31807
  className: "sy-mobile-time-picker sy-mobile-date-time-picker",
31797
31808
  renderLabel: (item) => item.label
31798
31809
  }
@@ -31873,10 +31884,10 @@ function DateFieldMobile({
31873
31884
  }
31874
31885
  ),
31875
31886
  mode === "time" ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
31876
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(MobileTimePickerView, { value: tempDate, onChange: setTempDate }),
31887
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(MobileTimePickerView, { value: tempDate, dateFormat: format2, onChange: setTempDate }),
31877
31888
  /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "sy-mobile-date-time-footer", children: [
31878
31889
  /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u9009\u62E9\u65F6\u95F4" }),
31879
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("button", { type: "button", className: "sy-mobile-time-pill is-active", children: formatMobileTime(tempDate) })
31890
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("button", { type: "button", className: "sy-mobile-time-pill is-active", children: formatMobileTime(tempDate, format2) })
31880
31891
  ] })
31881
31892
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
31882
31893
  /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
@@ -31907,7 +31918,7 @@ function DateFieldMobile({
31907
31918
  type: "button",
31908
31919
  className: "sy-mobile-time-pill",
31909
31920
  onClick: () => setMode("time"),
31910
- children: formatMobileTime(tempDate)
31921
+ children: formatMobileTime(tempDate, format2)
31911
31922
  }
31912
31923
  )
31913
31924
  ] }) : null
@@ -32167,6 +32178,7 @@ function CascadeDateFieldMobile({
32167
32178
  MobileDateTimePickerView,
32168
32179
  {
32169
32180
  value: timeStep === "start" ? tempStart : tempEnd,
32181
+ dateFormat: format2,
32170
32182
  min: timeStep === "start" ? min2 : endMin,
32171
32183
  max: max2,
32172
32184
  onChange: timeStep === "start" ? updateTempStart : updateTempEnd
@@ -46094,6 +46106,7 @@ var StandardFormPage = ({
46094
46106
  mode,
46095
46107
  initialValues,
46096
46108
  permissions,
46109
+ api: externalApi,
46097
46110
  formUuid,
46098
46111
  appType,
46099
46112
  formInstanceId,
@@ -46107,7 +46120,7 @@ var StandardFormPage = ({
46107
46120
  const formType = normalizeStandardFormType(
46108
46121
  schema.template?.formType || (resolvedMode === "process" ? "process" : "form")
46109
46122
  );
46110
- const api = (0, import_react278.useMemo)(() => {
46123
+ const submitApi = (0, import_react278.useMemo)(() => {
46111
46124
  if (!onSubmit) return void 0;
46112
46125
  return {
46113
46126
  submitFormData: async (payload) => onSubmit(
@@ -46120,6 +46133,13 @@ var StandardFormPage = ({
46120
46133
  }
46121
46134
  };
46122
46135
  }, [formType, onSubmit]);
46136
+ const api = (0, import_react278.useMemo)(() => {
46137
+ if (!externalApi && !submitApi) return void 0;
46138
+ return {
46139
+ ...externalApi ?? {},
46140
+ ...submitApi ?? {}
46141
+ };
46142
+ }, [externalApi, submitApi]);
46123
46143
  if (resolvedMode === "process") {
46124
46144
  return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
46125
46145
  ProcessDetailTemplate,