@yudaocode/univer-sheets-ui 1.6.204 → 1.6.206

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/lib/cjs/index.js CHANGED
@@ -117,7 +117,11 @@ function resolveSheetsUIFeatures(raw) {
117
117
  versionHistory: raw?.versionHistory ?? true,
118
118
  loopBlocks: raw?.loopBlocks ?? datasetBinding,
119
119
  outlines: raw?.outlines ?? datasetBinding,
120
- queryParamsConfig: raw?.queryParamsConfig ?? datasetBinding
120
+ queryParamsConfig: raw?.queryParamsConfig ?? datasetBinding,
121
+ fieldDrag: raw?.fieldDrag ?? true,
122
+ syntaxSelector: raw?.syntaxSelector ?? true,
123
+ advancedCellBinding: raw?.advancedCellBinding ?? true,
124
+ builtinPreviewModal: raw?.builtinPreviewModal ?? true
121
125
  };
122
126
  }
123
127
  var ISheetsUIFeatureService = (0, import_core.createIdentifier)(
@@ -310,6 +314,7 @@ var enUS = {
310
314
  listExpandBadge: "List Expand",
311
315
  emptyBoundCells: "No dataset bindings found (or data already expanded; press Ctrl+Z to restore template).",
312
316
  kindList: "Vertical List",
317
+ kindCrossTab: "Cross-Tab Horizontal",
313
318
  kindScalar: "Scalar Value"
314
319
  },
315
320
  inspector: {
@@ -405,6 +410,7 @@ var zhCN = {
405
410
  listExpandBadge: "\u5217\u8868\u5C55\u5F00",
406
411
  emptyBoundCells: "\u5F53\u524D\u5DE5\u4F5C\u7C3F\u6682\u65E0\u7ED1\u5B9A\u8868\u8FBE\u5F0F\uFF08\u6216\u5DF2\u5B8C\u6210\u6570\u636E\u586B\u5145\uFF0C\u6309 Ctrl+Z \u53EF\u56DE\u5230\u6A21\u677F\u6001\uFF09\u3002",
407
412
  kindList: "\u5217\u8868\u81EA\u52A8\u4E0B\u63A8",
413
+ kindCrossTab: "\u6A2A\u5411\u4EA4\u53C9\u6269\u5C55",
408
414
  kindScalar: "\u5355\u503C\u586B\u5145"
409
415
  },
410
416
  inspector: {
@@ -613,14 +619,20 @@ var SheetInspectorPanel = () => {
613
619
  }
614
620
  }
615
621
  const metadata = templateService.getTemplateMetadata(unitId);
622
+ const effectiveSyntax = templateService.getPlaceholderSyntax(unitId);
623
+ const effectiveImplicitExpand = templateService.getImplicitExpand(unitId);
616
624
  const allFields = (metadata.datasets ?? []).flatMap((g) => g.fields);
617
- const boundCount = (0, import_univer_sheets2.scanWorkbookBoundCells)(workbook.save(), metadata.sampleData).length;
625
+ const boundCount = (0, import_univer_sheets2.scanWorkbookBoundCells)(workbook.save(), metadata.sampleData, {
626
+ implicitExpand: effectiveImplicitExpand
627
+ }).length;
618
628
  const printCfg = metadata.printConfig ?? {};
619
629
  const protectionCfg = metadata.protection;
620
630
  const charts = metadata.charts ?? [];
621
631
  const activeAlertRule = cellMeta.alertRules?.[0];
622
- const currentExprMatch = typeof activeCell?.v === "string" ? activeCell.v.trim().match(/^(?:\$|#)\{(#?[a-zA-Z0-9_.\[\]]+)\}$/) : null;
632
+ const currentExprMatch = typeof activeCell?.v === "string" ? activeCell.v.trim().match(/^(?:\$|#)\{(#?[\p{L}\p{N}_.\[\]-]+)\}$/u) : null;
623
633
  const currentBoundKey = currentExprMatch?.[1] ?? "";
634
+ const hasExplicitListToken = typeof activeCell?.v === "string" && (activeCell.v.includes("${#") || activeCell.v.includes("#{#") || activeCell.v.includes("[]."));
635
+ const resolvedExpandValue = cellMeta.expand ?? (hasExplicitListToken ? "v" : effectiveImplicitExpand);
624
636
  const patchCellMeta = (patch) => {
625
637
  commandService.syncExecuteCommand(import_univer_sheets2.SetSheetCellMetaCommand.id, {
626
638
  unitId,
@@ -865,12 +877,12 @@ var SheetInspectorPanel = () => {
865
877
  }
866
878
  )
867
879
  ] }),
868
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { className: "yudao-sheet-field-row", children: [
880
+ features.syntaxSelector && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { className: "yudao-sheet-field-row", children: [
869
881
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "\u5360\u4F4D\u7B26\u8BED\u6CD5\u89C4\u8303" }),
870
882
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
871
883
  "select",
872
884
  {
873
- value: metadata.placeholderSyntax ?? "dollar",
885
+ value: effectiveSyntax,
874
886
  onChange: (e) => templateService.setTemplateMetadata(unitId, {
875
887
  ...metadata,
876
888
  placeholderSyntax: e.target.value
@@ -879,12 +891,12 @@ var SheetInspectorPanel = () => {
879
891
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("option", { value: "dollar", children: [
880
892
  "$",
881
893
  "{set.field}",
882
- "\uFF08\u6807\u51C6\u6A21\u677F\u8BED\u6CD5\uFF09"
894
+ "\uFF08\u7F8E\u5143\u82B1\u62EC\u53F7\u8BED\u6CD5\uFF09"
883
895
  ] }),
884
896
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("option", { value: "hash", children: [
885
897
  "#",
886
898
  "{set.field}",
887
- "\uFF08\u517C\u5BB9 AJ-Report / \u4E2D\u56FD\u5F0F\u62A5\u8868\uFF09"
899
+ "\uFF08\u4E95\u53F7\u82B1\u62EC\u53F7\u8BED\u6CD5\uFF09"
888
900
  ] })
889
901
  ]
890
902
  }
@@ -911,6 +923,10 @@ var SheetInspectorPanel = () => {
911
923
  },
912
924
  children: [
913
925
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "", children: "-- \u672A\u7ED1\u5B9A\uFF08\u666E\u901A\u5355\u5143\u683C\uFF09 --" }),
926
+ currentBoundKey && !allFields.some((f) => f.key === currentBoundKey) && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("option", { value: currentBoundKey, children: [
927
+ currentBoundKey,
928
+ "\uFF08\u5F53\u524D\u5DF2\u7ED1\u5B9A\u5B57\u6BB5\uFF09"
929
+ ] }),
914
930
  allFields.map((f) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("option", { value: f.key, children: [
915
931
  f.label,
916
932
  " (",
@@ -926,211 +942,213 @@ var SheetInspectorPanel = () => {
926
942
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
927
943
  "select",
928
944
  {
929
- value: cellMeta.expand ?? "v",
945
+ value: resolvedExpandValue,
930
946
  onChange: (e) => patchCellMeta({ expand: e.target.value }),
931
947
  children: [
932
948
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "v", children: "\u7EB5\u5411\u5411\u4E0B\u6269\u5C55\u884C (List)" }),
933
949
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "h", children: "\u6A2A\u5411\u5411\u53F3\u6269\u5C55\u5217 (Cross-Tab \u4EA4\u53C9\u8868)" }),
934
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "none", children: "\u4E0D\u6269\u5C55\uFF08\u9759\u6001\u5355\u503C\u66FF\u6362\uFF09" })
950
+ (features.advancedCellBinding || resolvedExpandValue === "none") && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "none", children: "\u4E0D\u6269\u5C55\uFF08\u9759\u6001\u5355\u503C\u66FF\u6362\uFF09" })
935
951
  ]
936
952
  }
937
953
  )
938
954
  ] }),
939
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
940
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { className: "yudao-sheet-field-row", children: [
941
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "\u5DE6\u7236\u683C (leftParentCell)" }),
942
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
943
- "input",
944
- {
945
- type: "text",
946
- placeholder: "\u5982 A6 \u6216 none",
947
- value: cellMeta.leftParentCell ?? "",
948
- onChange: (e) => patchCellMeta({ leftParentCell: e.target.value.trim() || void 0 })
949
- }
950
- )
955
+ features.advancedCellBinding && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
956
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
957
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { className: "yudao-sheet-field-row", children: [
958
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "\u5DE6\u7236\u683C (leftParentCell)" }),
959
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
960
+ "input",
961
+ {
962
+ type: "text",
963
+ placeholder: "\u5982 A6 \u6216 none",
964
+ value: cellMeta.leftParentCell ?? "",
965
+ onChange: (e) => patchCellMeta({ leftParentCell: e.target.value.trim() || void 0 })
966
+ }
967
+ )
968
+ ] }),
969
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { className: "yudao-sheet-field-row", children: [
970
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "\u4E0A\u7236\u683C (topParentCell)" }),
971
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
972
+ "input",
973
+ {
974
+ type: "text",
975
+ placeholder: "\u5982 B5 \u6216 none",
976
+ value: cellMeta.topParentCell ?? "",
977
+ onChange: (e) => patchCellMeta({ topParentCell: e.target.value.trim() || void 0 })
978
+ }
979
+ )
980
+ ] })
951
981
  ] }),
952
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { className: "yudao-sheet-field-row", children: [
953
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "\u4E0A\u7236\u683C (topParentCell)" }),
954
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
955
- "input",
956
- {
957
- type: "text",
958
- placeholder: "\u5982 B5 \u6216 none",
959
- value: cellMeta.topParentCell ?? "",
960
- onChange: (e) => patchCellMeta({ topParentCell: e.target.value.trim() || void 0 })
961
- }
962
- )
963
- ] })
964
- ] }),
965
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
966
- "div",
967
- {
968
- style: {
969
- background: "#F9FAFB",
970
- border: "1px solid #E3E5EA",
971
- borderRadius: 6,
972
- padding: "6px 8px",
973
- display: "flex",
974
- flexDirection: "column",
975
- gap: 5
976
- },
977
- children: [
978
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
979
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { style: { fontSize: 11, fontWeight: 600, color: "#31363F" }, children: t("yudaoSheets.inspector.cellFilterTitle") }),
980
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
981
- "button",
982
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
983
+ "div",
984
+ {
985
+ style: {
986
+ background: "#F9FAFB",
987
+ border: "1px solid #E3E5EA",
988
+ borderRadius: 6,
989
+ padding: "6px 8px",
990
+ display: "flex",
991
+ flexDirection: "column",
992
+ gap: 5
993
+ },
994
+ children: [
995
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
996
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { style: { fontSize: 11, fontWeight: 600, color: "#31363F" }, children: t("yudaoSheets.inspector.cellFilterTitle") }),
997
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
998
+ "button",
999
+ {
1000
+ type: "button",
1001
+ className: "yudao-sheet-btn",
1002
+ style: { padding: "2px 6px", fontSize: 10.5 },
1003
+ onClick: () => {
1004
+ const nextList = [
1005
+ ...cellMeta.cellFilterConditions ?? [],
1006
+ {
1007
+ id: `cf_${(0, import_core4.generateRandomId)(5)}`,
1008
+ property: "",
1009
+ operator: "==",
1010
+ value: "",
1011
+ join: "and"
1012
+ }
1013
+ ];
1014
+ patchCellMeta({ cellFilterConditions: nextList });
1015
+ },
1016
+ children: t("yudaoSheets.inspector.cellFilterAddBtn")
1017
+ }
1018
+ )
1019
+ ] }),
1020
+ (cellMeta.cellFilterConditions ?? []).length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: { fontSize: 10.5, color: "#7D8698" }, children: t("yudaoSheets.inspector.cellFilterEmptyHint") }) : (cellMeta.cellFilterConditions ?? []).map((cond, idx) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1021
+ "div",
982
1022
  {
983
- type: "button",
984
- className: "yudao-sheet-btn",
985
- style: { padding: "2px 6px", fontSize: 10.5 },
986
- onClick: () => {
987
- const nextList = [
988
- ...cellMeta.cellFilterConditions ?? [],
1023
+ style: { display: "grid", gridTemplateColumns: "44px 1fr 56px 1fr 20px", gap: 4, alignItems: "center" },
1024
+ children: [
1025
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1026
+ "select",
1027
+ {
1028
+ style: { fontSize: 10.5, padding: "2px 2px", height: 24 },
1029
+ value: cond.join ?? "and",
1030
+ disabled: idx === 0,
1031
+ onChange: (e) => {
1032
+ const next = [...cellMeta.cellFilterConditions ?? []];
1033
+ next[idx] = { ...cond, join: e.target.value };
1034
+ patchCellMeta({ cellFilterConditions: next });
1035
+ },
1036
+ children: [
1037
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "and", children: "AND" }),
1038
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "or", children: "OR" })
1039
+ ]
1040
+ }
1041
+ ),
1042
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1043
+ "input",
989
1044
  {
990
- id: `cf_${(0, import_core4.generateRandomId)(5)}`,
991
- property: "",
992
- operator: "==",
993
- value: "",
994
- join: "and"
1045
+ type: "text",
1046
+ placeholder: t("yudaoSheets.inspector.cellFilterFieldPlaceholder"),
1047
+ style: { fontSize: 11, padding: "2px 5px", height: 24 },
1048
+ value: cond.property,
1049
+ onChange: (e) => {
1050
+ const next = [...cellMeta.cellFilterConditions ?? []];
1051
+ next[idx] = { ...cond, property: e.target.value };
1052
+ patchCellMeta({ cellFilterConditions: next });
1053
+ }
995
1054
  }
996
- ];
997
- patchCellMeta({ cellFilterConditions: nextList });
998
- },
999
- children: t("yudaoSheets.inspector.cellFilterAddBtn")
1055
+ ),
1056
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1057
+ "select",
1058
+ {
1059
+ style: { fontSize: 10.5, padding: "2px 2px", height: 24 },
1060
+ value: cond.operator,
1061
+ onChange: (e) => {
1062
+ const next = [...cellMeta.cellFilterConditions ?? []];
1063
+ next[idx] = { ...cond, operator: e.target.value };
1064
+ patchCellMeta({ cellFilterConditions: next });
1065
+ },
1066
+ children: [
1067
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "==", children: "==" }),
1068
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "!=", children: "!=" }),
1069
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: ">", children: ">" }),
1070
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: ">=", children: ">=" }),
1071
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "<", children: "<" }),
1072
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "<=", children: "<=" }),
1073
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "in", children: "in" }),
1074
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "notIn", children: "notIn" }),
1075
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "contains", children: "contains" }),
1076
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "like", children: "like" })
1077
+ ]
1078
+ }
1079
+ ),
1080
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1081
+ "input",
1082
+ {
1083
+ type: "text",
1084
+ placeholder: t("yudaoSheets.inspector.cellFilterValuePlaceholder"),
1085
+ style: { fontSize: 11, padding: "2px 5px", height: 24 },
1086
+ value: cond.value == null ? "" : String(cond.value),
1087
+ onChange: (e) => {
1088
+ const next = [...cellMeta.cellFilterConditions ?? []];
1089
+ next[idx] = { ...cond, value: e.target.value };
1090
+ patchCellMeta({ cellFilterConditions: next });
1091
+ }
1092
+ }
1093
+ ),
1094
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1095
+ "button",
1096
+ {
1097
+ type: "button",
1098
+ className: "yudao-sheet-btn",
1099
+ style: { padding: 0, width: 20, height: 24, fontSize: 11 },
1100
+ onClick: () => {
1101
+ const next = (cellMeta.cellFilterConditions ?? []).filter((_, i) => i !== idx);
1102
+ patchCellMeta({ cellFilterConditions: next.length > 0 ? next : void 0 });
1103
+ },
1104
+ children: "\xD7"
1105
+ }
1106
+ )
1107
+ ]
1108
+ },
1109
+ cond.id ?? idx
1110
+ ))
1111
+ ]
1112
+ }
1113
+ ),
1114
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
1115
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { className: "yudao-sheet-field-row", children: [
1116
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "\u72EC\u7ACB\u6269\u5C55\u5206\u533A (zoneId)" }),
1117
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1118
+ "input",
1119
+ {
1120
+ type: "text",
1121
+ placeholder: "\u5982 left / right\uFF08\u5E76\u6392\u591A\u8868\uFF09",
1122
+ value: cellMeta.zoneId ?? "",
1123
+ onChange: (e) => {
1124
+ const zid = e.target.value.trim();
1125
+ patchCellMeta({
1126
+ zoneId: zid || void 0,
1127
+ independentZone: zid ? true : void 0,
1128
+ zoneMode: zid ? "independent" : void 0
1129
+ });
1000
1130
  }
1001
- )
1002
- ] }),
1003
- (cellMeta.cellFilterConditions ?? []).length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: { fontSize: 10.5, color: "#7D8698" }, children: t("yudaoSheets.inspector.cellFilterEmptyHint") }) : (cellMeta.cellFilterConditions ?? []).map((cond, idx) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1004
- "div",
1131
+ }
1132
+ )
1133
+ ] }),
1134
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { className: "yudao-sheet-field-row", children: [
1135
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "\u6C47\u603B\u8BA1\u7B97\u6392\u9664 (calcExclude)" }),
1136
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1137
+ "select",
1005
1138
  {
1006
- style: { display: "grid", gridTemplateColumns: "44px 1fr 56px 1fr 20px", gap: 4, alignItems: "center" },
1139
+ value: cellMeta.calcExclude ?? "none",
1140
+ onChange: (e) => patchCellMeta({
1141
+ calcExclude: e.target.value === "none" ? void 0 : e.target.value
1142
+ }),
1007
1143
  children: [
1008
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1009
- "select",
1010
- {
1011
- style: { fontSize: 10.5, padding: "2px 2px", height: 24 },
1012
- value: cond.join ?? "and",
1013
- disabled: idx === 0,
1014
- onChange: (e) => {
1015
- const next = [...cellMeta.cellFilterConditions ?? []];
1016
- next[idx] = { ...cond, join: e.target.value };
1017
- patchCellMeta({ cellFilterConditions: next });
1018
- },
1019
- children: [
1020
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "and", children: "AND" }),
1021
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "or", children: "OR" })
1022
- ]
1023
- }
1024
- ),
1025
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1026
- "input",
1027
- {
1028
- type: "text",
1029
- placeholder: t("yudaoSheets.inspector.cellFilterFieldPlaceholder"),
1030
- style: { fontSize: 11, padding: "2px 5px", height: 24 },
1031
- value: cond.property,
1032
- onChange: (e) => {
1033
- const next = [...cellMeta.cellFilterConditions ?? []];
1034
- next[idx] = { ...cond, property: e.target.value };
1035
- patchCellMeta({ cellFilterConditions: next });
1036
- }
1037
- }
1038
- ),
1039
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1040
- "select",
1041
- {
1042
- style: { fontSize: 10.5, padding: "2px 2px", height: 24 },
1043
- value: cond.operator,
1044
- onChange: (e) => {
1045
- const next = [...cellMeta.cellFilterConditions ?? []];
1046
- next[idx] = { ...cond, operator: e.target.value };
1047
- patchCellMeta({ cellFilterConditions: next });
1048
- },
1049
- children: [
1050
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "==", children: "==" }),
1051
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "!=", children: "!=" }),
1052
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: ">", children: ">" }),
1053
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: ">=", children: ">=" }),
1054
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "<", children: "<" }),
1055
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "<=", children: "<=" }),
1056
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "in", children: "in" }),
1057
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "notIn", children: "notIn" }),
1058
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "contains", children: "contains" }),
1059
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "like", children: "like" })
1060
- ]
1061
- }
1062
- ),
1063
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1064
- "input",
1065
- {
1066
- type: "text",
1067
- placeholder: t("yudaoSheets.inspector.cellFilterValuePlaceholder"),
1068
- style: { fontSize: 11, padding: "2px 5px", height: 24 },
1069
- value: cond.value == null ? "" : String(cond.value),
1070
- onChange: (e) => {
1071
- const next = [...cellMeta.cellFilterConditions ?? []];
1072
- next[idx] = { ...cond, value: e.target.value };
1073
- patchCellMeta({ cellFilterConditions: next });
1074
- }
1075
- }
1076
- ),
1077
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1078
- "button",
1079
- {
1080
- type: "button",
1081
- className: "yudao-sheet-btn",
1082
- style: { padding: 0, width: 20, height: 24, fontSize: 11 },
1083
- onClick: () => {
1084
- const next = (cellMeta.cellFilterConditions ?? []).filter((_, i) => i !== idx);
1085
- patchCellMeta({ cellFilterConditions: next.length > 0 ? next : void 0 });
1086
- },
1087
- children: "\xD7"
1088
- }
1089
- )
1144
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "none", children: "\u6B63\u5E38\u53C2\u4E0E\u6C47\u603B" }),
1145
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "negatives", children: "\u6392\u9664\u8D1F\u6570 (negatives)" }),
1146
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "zeros", children: "\u6392\u9664\u96F6\u503C (zeros)" }),
1147
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "all", children: "\u5B8C\u5168\u6392\u9664 (all)" })
1090
1148
  ]
1091
- },
1092
- cond.id ?? idx
1093
- ))
1094
- ]
1095
- }
1096
- ),
1097
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
1098
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { className: "yudao-sheet-field-row", children: [
1099
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "\u72EC\u7ACB\u6269\u5C55\u5206\u533A (zoneId)" }),
1100
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1101
- "input",
1102
- {
1103
- type: "text",
1104
- placeholder: "\u5982 left / right\uFF08\u5E76\u6392\u591A\u8868\uFF09",
1105
- value: cellMeta.zoneId ?? "",
1106
- onChange: (e) => {
1107
- const zid = e.target.value.trim();
1108
- patchCellMeta({
1109
- zoneId: zid || void 0,
1110
- independentZone: zid ? true : void 0,
1111
- zoneMode: zid ? "independent" : void 0
1112
- });
1113
1149
  }
1114
- }
1115
- )
1116
- ] }),
1117
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { className: "yudao-sheet-field-row", children: [
1118
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "\u6C47\u603B\u8BA1\u7B97\u6392\u9664 (calcExclude)" }),
1119
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1120
- "select",
1121
- {
1122
- value: cellMeta.calcExclude ?? "none",
1123
- onChange: (e) => patchCellMeta({
1124
- calcExclude: e.target.value === "none" ? void 0 : e.target.value
1125
- }),
1126
- children: [
1127
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "none", children: "\u6B63\u5E38\u53C2\u4E0E\u6C47\u603B" }),
1128
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "negatives", children: "\u6392\u9664\u8D1F\u6570 (negatives)" }),
1129
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "zeros", children: "\u6392\u9664\u96F6\u503C (zeros)" }),
1130
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "all", children: "\u5B8C\u5168\u6392\u9664 (all)" })
1131
- ]
1132
- }
1133
- )
1150
+ )
1151
+ ] })
1134
1152
  ] })
1135
1153
  ] }),
1136
1154
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 5 }, children: [
@@ -1145,7 +1163,7 @@ var SheetInspectorPanel = () => {
1145
1163
  ),
1146
1164
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "\u76F8\u90BB\u76F8\u540C\u5206\u7EC4\u503C\u81EA\u52A8\u7EB5\u5411\u5408\u5E76\u5355\u5143\u683C (Group)" })
1147
1165
  ] }),
1148
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer" }, children: [
1166
+ features.advancedCellBinding && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer" }, children: [
1149
1167
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1150
1168
  "input",
1151
1169
  {
@@ -1167,7 +1185,7 @@ var SheetInspectorPanel = () => {
1167
1185
  ),
1168
1186
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "\u4F34\u968F\u540C\u884C\u5217\u8868\u81EA\u52A8\u590D\u5236\u6269\u5C55 (auto)" })
1169
1187
  ] }),
1170
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer" }, children: [
1188
+ features.advancedCellBinding && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer" }, children: [
1171
1189
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1172
1190
  "input",
1173
1191
  {
@@ -1193,7 +1211,7 @@ var SheetInspectorPanel = () => {
1193
1211
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "\u542F\u7528\u6811\u5F62\u6298\u53E0\u62A5\u8868 (\u5DE6\u7236\u683C/\u6811\u5F62\u6298\u53E0)" })
1194
1212
  ] })
1195
1213
  ] }),
1196
- cellMeta.treeConfig?.enabled && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
1214
+ features.advancedCellBinding && cellMeta.treeConfig?.enabled && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
1197
1215
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { className: "yudao-sheet-field-row", children: [
1198
1216
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "\u8282\u70B9\u4E3B\u952E\u5B57\u6BB5 (idField)" }),
1199
1217
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
@@ -1221,8 +1239,8 @@ var SheetInspectorPanel = () => {
1221
1239
  )
1222
1240
  ] })
1223
1241
  ] }),
1224
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
1225
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { className: "yudao-sheet-field-row", children: [
1242
+ (features.advancedCellBinding || features.loopBlocks) && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
1243
+ features.advancedCellBinding && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { className: "yudao-sheet-field-row", children: [
1226
1244
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "\u5206\u7EC4\u5C0F\u8BA1 (Subtotal)" }),
1227
1245
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1228
1246
  "select",
@@ -1302,38 +1320,48 @@ var SheetInspectorPanel = () => {
1302
1320
  )
1303
1321
  ] })
1304
1322
  ] }),
1305
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
1306
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { className: "yudao-sheet-field-row", children: [
1307
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "\u6761\u4EF6\u9690\u85CF\u884C (hideIf)" }),
1308
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1309
- "input",
1310
- {
1311
- type: "text",
1312
- placeholder: "\u5982 ==0 \u6216 <=0",
1313
- value: cellMeta.hideIf ?? "",
1314
- onChange: (e) => patchCellMeta({ hideIf: e.target.value || void 0 })
1315
- }
1316
- )
1317
- ] }),
1318
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { className: "yudao-sheet-field-row", children: [
1319
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "\u7968\u636E\u8865\u8DB3 N \u500D\u6570\u7A7A\u884C" }),
1320
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1321
- "input",
1322
- {
1323
- type: "number",
1324
- min: 0,
1325
- max: 50,
1326
- placeholder: "0 \u4E0D\u8865",
1327
- value: cellMeta.padBlankRowsToMultipleOf ?? 0,
1328
- onChange: (e) => {
1329
- const n = Number(e.target.value);
1330
- patchCellMeta({ padBlankRowsToMultipleOf: n > 1 ? n : void 0 });
1331
- }
1332
- }
1333
- )
1334
- ] })
1335
- ] }),
1336
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { display: "flex", gap: 4, flexWrap: "wrap" }, children: [
1323
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1324
+ "div",
1325
+ {
1326
+ style: {
1327
+ display: "grid",
1328
+ gridTemplateColumns: features.advancedCellBinding ? "1fr 1fr" : "1fr",
1329
+ gap: 6
1330
+ },
1331
+ children: [
1332
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { className: "yudao-sheet-field-row", children: [
1333
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "\u6761\u4EF6\u9690\u85CF\u884C (hideIf)" }),
1334
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1335
+ "input",
1336
+ {
1337
+ type: "text",
1338
+ placeholder: "\u5982 ==0 \u6216 <=0",
1339
+ value: cellMeta.hideIf ?? "",
1340
+ onChange: (e) => patchCellMeta({ hideIf: e.target.value || void 0 })
1341
+ }
1342
+ )
1343
+ ] }),
1344
+ features.advancedCellBinding && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { className: "yudao-sheet-field-row", children: [
1345
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "\u7968\u636E\u8865\u8DB3 N \u500D\u6570\u7A7A\u884C" }),
1346
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1347
+ "input",
1348
+ {
1349
+ type: "number",
1350
+ min: 0,
1351
+ max: 50,
1352
+ placeholder: "0 \u4E0D\u8865",
1353
+ value: cellMeta.padBlankRowsToMultipleOf ?? 0,
1354
+ onChange: (e) => {
1355
+ const n = Number(e.target.value);
1356
+ patchCellMeta({ padBlankRowsToMultipleOf: n > 1 ? n : void 0 });
1357
+ }
1358
+ }
1359
+ )
1360
+ ] })
1361
+ ]
1362
+ }
1363
+ ),
1364
+ features.advancedCellBinding && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { display: "flex", gap: 4, flexWrap: "wrap" }, children: [
1337
1365
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1338
1366
  "button",
1339
1367
  {
@@ -3560,7 +3588,7 @@ var SheetInspectorPanel = () => {
3560
3588
  ] }),
3561
3589
  pkgStatusMsg && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: { fontSize: 10.5, color: "#4E5565", lineHeight: 1.35 }, children: pkgStatusMsg })
3562
3590
  ] }),
3563
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
3591
+ features.builtinPreviewModal && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
3564
3592
  "button",
3565
3593
  {
3566
3594
  type: "button",
@@ -3627,20 +3655,25 @@ var SheetLeftSidebar = () => {
3627
3655
  }
3628
3656
  void rev;
3629
3657
  void metaVersion;
3630
- const metadata = templateService.getTemplateMetadata(workbook.getUnitId());
3658
+ const unitId = workbook.getUnitId();
3659
+ const metadata = templateService.getTemplateMetadata(unitId);
3660
+ const effectiveSyntax = templateService.getPlaceholderSyntax(unitId);
3661
+ const effectiveImplicitExpand = templateService.getImplicitExpand(unitId);
3631
3662
  const datasets = metadata.datasets ?? [];
3632
- const boundCells = (0, import_univer_sheets3.scanWorkbookBoundCells)(workbook.save(), metadata.sampleData).filter((item) => {
3663
+ const boundCells = (0, import_univer_sheets3.scanWorkbookBoundCells)(workbook.save(), metadata.sampleData, {
3664
+ implicitExpand: effectiveImplicitExpand
3665
+ }).filter((item) => {
3633
3666
  const sh = workbook.getSheetBySheetId(item.sheetId);
3634
3667
  return sh ? !sh.isSheetHidden() : true;
3635
3668
  });
3636
3669
  const handleJumpToCell = (item) => {
3637
3670
  try {
3638
- const unitId = workbook.getUnitId();
3671
+ const unitId2 = workbook.getUnitId();
3639
3672
  const targetSheet = workbook.getSheetBySheetId(item.sheetId);
3640
3673
  if (!targetSheet || targetSheet.isSheetHidden()) return;
3641
3674
  if (workbook.getActiveSheet()?.getSheetId() !== item.sheetId) {
3642
3675
  commandService.syncExecuteCommand(import_sheets2.SetWorksheetActiveOperation.id, {
3643
- unitId,
3676
+ unitId: unitId2,
3644
3677
  subUnitId: item.sheetId
3645
3678
  });
3646
3679
  }
@@ -3655,7 +3688,7 @@ var SheetLeftSidebar = () => {
3655
3688
  endColumn: master.col
3656
3689
  };
3657
3690
  const isMerged = Boolean(master.mergeRange);
3658
- selectionService.setSelections(unitId, item.sheetId, [
3691
+ selectionService.setSelections(unitId2, item.sheetId, [
3659
3692
  {
3660
3693
  range: selRange,
3661
3694
  primary: {
@@ -3672,7 +3705,7 @@ var SheetLeftSidebar = () => {
3672
3705
  }
3673
3706
  ]);
3674
3707
  commandService.syncExecuteCommand(import_sheets2.ScrollToCellOperation.id, {
3675
- unitId,
3708
+ unitId: unitId2,
3676
3709
  range: selRange
3677
3710
  });
3678
3711
  } catch {
@@ -3766,11 +3799,16 @@ var SheetLeftSidebar = () => {
3766
3799
  "button",
3767
3800
  {
3768
3801
  type: "button",
3769
- draggable: true,
3802
+ draggable: features.fieldDrag,
3803
+ "data-sheet-field": fieldExpr,
3770
3804
  className: "yudao-sheet-field-btn",
3771
3805
  onDragStart: (e) => {
3806
+ if (!features.fieldDrag) return;
3772
3807
  e.dataTransfer.setData("application/x-yudao-sheet-field", fieldExpr);
3773
- e.dataTransfer.setData("text/plain", fieldExpr);
3808
+ e.dataTransfer.setData(
3809
+ "text/plain",
3810
+ fieldExpr.startsWith("${") || fieldExpr.startsWith("#{") ? fieldExpr : effectiveSyntax === "hash" ? `#{${fieldExpr}}` : `\${${fieldExpr}}`
3811
+ );
3774
3812
  e.dataTransfer.effectAllowed = "copy";
3775
3813
  },
3776
3814
  onClick: () => commandService.syncExecuteCommand(import_univer_sheets3.BindSheetCellDatasetCommand.id, {
@@ -3810,10 +3848,10 @@ var SheetLeftSidebar = () => {
3810
3848
  fontWeight: 500,
3811
3849
  padding: "1px 6px",
3812
3850
  borderRadius: 999,
3813
- background: item.kind === "list" ? "#F3F5FF" : "#EEEFF1",
3814
- color: item.kind === "list" ? "#2C53F1" : "#4E5565"
3851
+ background: item.kind === "list" || item.kind === "crossTab" ? "#F3F5FF" : "#EEEFF1",
3852
+ color: item.kind === "list" || item.kind === "crossTab" ? "#2C53F1" : "#4E5565"
3815
3853
  },
3816
- children: item.kind === "list" ? t("yudaoSheets.leftSidebar.kindList") : t("yudaoSheets.leftSidebar.kindScalar")
3854
+ children: item.kind === "crossTab" ? t("yudaoSheets.leftSidebar.kindCrossTab") : item.kind === "list" ? t("yudaoSheets.leftSidebar.kindList") : t("yudaoSheets.leftSidebar.kindScalar")
3817
3855
  }
3818
3856
  )
3819
3857
  ] }),
@@ -3923,6 +3961,7 @@ var SheetPreviewAndIoModal = () => {
3923
3961
  const compiled = effectiveData ? (0, import_univer_sheets4.compileWorkbookWithDataset)(snap, effectiveData, {
3924
3962
  metadata: tplMeta,
3925
3963
  printConfig: cfg,
3964
+ implicitExpand: unitId ? templateService.getImplicitExpand(unitId) : void 0,
3926
3965
  loopBlocks,
3927
3966
  conditionProperties,
3928
3967
  drillLinks,
@@ -4126,6 +4165,7 @@ var SheetPreviewAndIoModal = () => {
4126
4165
  data: parsedData,
4127
4166
  printConfig: printCfg,
4128
4167
  metadata: templateService.getTemplateMetadata(unitId),
4168
+ implicitExpand: templateService.getImplicitExpand(unitId),
4129
4169
  target: ioTarget
4130
4170
  });
4131
4171
  const mime = format === "xlsx" ? "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" : format === "xls" ? "application/vnd.ms-excel" : format === "pdf" ? "application/pdf" : format === "docx" ? "application/vnd.openxmlformats-officedocument.wordprocessingml.document" : format === "xml" ? "application/xml;charset=utf-8" : format === "html" ? "text/html;charset=utf-8" : "text/csv;charset=utf-8";
@@ -7709,7 +7749,18 @@ var SheetsExtUIController = class extends import_core8.Disposable {
7709
7749
  this.disposeWithMe({ dispose: () => printSub.unsubscribe() });
7710
7750
  }
7711
7751
  if (this._config.defaultOpenInspector && (this._config.features?.datasetBinding || this._config.features?.printTemplate)) {
7712
- setTimeout(() => openSheetInspectorSidebar(this._sidebarService), 120);
7752
+ let disposed = false;
7753
+ const timer = setTimeout(() => {
7754
+ if (!disposed) {
7755
+ openSheetInspectorSidebar(this._sidebarService);
7756
+ }
7757
+ }, 120);
7758
+ this.disposeWithMe({
7759
+ dispose: () => {
7760
+ disposed = true;
7761
+ clearTimeout(timer);
7762
+ }
7763
+ });
7713
7764
  }
7714
7765
  }
7715
7766
  _initIcons() {