@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/es/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  zhCN,
3
3
  zh_CN_default
4
- } from "./chunk-RBFCNX3U.js";
4
+ } from "./chunk-M7TC4GNI.js";
5
5
  import {
6
6
  enUS,
7
7
  en_US_default
8
- } from "./chunk-5BQIIXZS.js";
8
+ } from "./chunk-OVQ7D6LQ.js";
9
9
  import {
10
10
  __decorateClass,
11
11
  __decorateParam
@@ -93,7 +93,11 @@ function resolveSheetsUIFeatures(raw) {
93
93
  versionHistory: raw?.versionHistory ?? true,
94
94
  loopBlocks: raw?.loopBlocks ?? datasetBinding,
95
95
  outlines: raw?.outlines ?? datasetBinding,
96
- queryParamsConfig: raw?.queryParamsConfig ?? datasetBinding
96
+ queryParamsConfig: raw?.queryParamsConfig ?? datasetBinding,
97
+ fieldDrag: raw?.fieldDrag ?? true,
98
+ syntaxSelector: raw?.syntaxSelector ?? true,
99
+ advancedCellBinding: raw?.advancedCellBinding ?? true,
100
+ builtinPreviewModal: raw?.builtinPreviewModal ?? true
97
101
  };
98
102
  }
99
103
  var ISheetsUIFeatureService = createIdentifier(
@@ -449,14 +453,20 @@ var SheetInspectorPanel = () => {
449
453
  }
450
454
  }
451
455
  const metadata = templateService.getTemplateMetadata(unitId);
456
+ const effectiveSyntax = templateService.getPlaceholderSyntax(unitId);
457
+ const effectiveImplicitExpand = templateService.getImplicitExpand(unitId);
452
458
  const allFields = (metadata.datasets ?? []).flatMap((g) => g.fields);
453
- const boundCount = scanWorkbookBoundCells(workbook.save(), metadata.sampleData).length;
459
+ const boundCount = scanWorkbookBoundCells(workbook.save(), metadata.sampleData, {
460
+ implicitExpand: effectiveImplicitExpand
461
+ }).length;
454
462
  const printCfg = metadata.printConfig ?? {};
455
463
  const protectionCfg = metadata.protection;
456
464
  const charts = metadata.charts ?? [];
457
465
  const activeAlertRule = cellMeta.alertRules?.[0];
458
- const currentExprMatch = typeof activeCell?.v === "string" ? activeCell.v.trim().match(/^(?:\$|#)\{(#?[a-zA-Z0-9_.\[\]]+)\}$/) : null;
466
+ const currentExprMatch = typeof activeCell?.v === "string" ? activeCell.v.trim().match(/^(?:\$|#)\{(#?[\p{L}\p{N}_.\[\]-]+)\}$/u) : null;
459
467
  const currentBoundKey = currentExprMatch?.[1] ?? "";
468
+ const hasExplicitListToken = typeof activeCell?.v === "string" && (activeCell.v.includes("${#") || activeCell.v.includes("#{#") || activeCell.v.includes("[]."));
469
+ const resolvedExpandValue = cellMeta.expand ?? (hasExplicitListToken ? "v" : effectiveImplicitExpand);
460
470
  const patchCellMeta = (patch) => {
461
471
  commandService.syncExecuteCommand(SetSheetCellMetaCommand.id, {
462
472
  unitId,
@@ -701,12 +711,12 @@ var SheetInspectorPanel = () => {
701
711
  }
702
712
  )
703
713
  ] }),
704
- /* @__PURE__ */ jsxs2("label", { className: "yudao-sheet-field-row", children: [
714
+ features.syntaxSelector && /* @__PURE__ */ jsxs2("label", { className: "yudao-sheet-field-row", children: [
705
715
  /* @__PURE__ */ jsx2("span", { children: "\u5360\u4F4D\u7B26\u8BED\u6CD5\u89C4\u8303" }),
706
716
  /* @__PURE__ */ jsxs2(
707
717
  "select",
708
718
  {
709
- value: metadata.placeholderSyntax ?? "dollar",
719
+ value: effectiveSyntax,
710
720
  onChange: (e) => templateService.setTemplateMetadata(unitId, {
711
721
  ...metadata,
712
722
  placeholderSyntax: e.target.value
@@ -715,12 +725,12 @@ var SheetInspectorPanel = () => {
715
725
  /* @__PURE__ */ jsxs2("option", { value: "dollar", children: [
716
726
  "$",
717
727
  "{set.field}",
718
- "\uFF08\u6807\u51C6\u6A21\u677F\u8BED\u6CD5\uFF09"
728
+ "\uFF08\u7F8E\u5143\u82B1\u62EC\u53F7\u8BED\u6CD5\uFF09"
719
729
  ] }),
720
730
  /* @__PURE__ */ jsxs2("option", { value: "hash", children: [
721
731
  "#",
722
732
  "{set.field}",
723
- "\uFF08\u517C\u5BB9 AJ-Report / \u4E2D\u56FD\u5F0F\u62A5\u8868\uFF09"
733
+ "\uFF08\u4E95\u53F7\u82B1\u62EC\u53F7\u8BED\u6CD5\uFF09"
724
734
  ] })
725
735
  ]
726
736
  }
@@ -747,6 +757,10 @@ var SheetInspectorPanel = () => {
747
757
  },
748
758
  children: [
749
759
  /* @__PURE__ */ jsx2("option", { value: "", children: "-- \u672A\u7ED1\u5B9A\uFF08\u666E\u901A\u5355\u5143\u683C\uFF09 --" }),
760
+ currentBoundKey && !allFields.some((f) => f.key === currentBoundKey) && /* @__PURE__ */ jsxs2("option", { value: currentBoundKey, children: [
761
+ currentBoundKey,
762
+ "\uFF08\u5F53\u524D\u5DF2\u7ED1\u5B9A\u5B57\u6BB5\uFF09"
763
+ ] }),
750
764
  allFields.map((f) => /* @__PURE__ */ jsxs2("option", { value: f.key, children: [
751
765
  f.label,
752
766
  " (",
@@ -762,211 +776,213 @@ var SheetInspectorPanel = () => {
762
776
  /* @__PURE__ */ jsxs2(
763
777
  "select",
764
778
  {
765
- value: cellMeta.expand ?? "v",
779
+ value: resolvedExpandValue,
766
780
  onChange: (e) => patchCellMeta({ expand: e.target.value }),
767
781
  children: [
768
782
  /* @__PURE__ */ jsx2("option", { value: "v", children: "\u7EB5\u5411\u5411\u4E0B\u6269\u5C55\u884C (List)" }),
769
783
  /* @__PURE__ */ jsx2("option", { value: "h", children: "\u6A2A\u5411\u5411\u53F3\u6269\u5C55\u5217 (Cross-Tab \u4EA4\u53C9\u8868)" }),
770
- /* @__PURE__ */ jsx2("option", { value: "none", children: "\u4E0D\u6269\u5C55\uFF08\u9759\u6001\u5355\u503C\u66FF\u6362\uFF09" })
784
+ (features.advancedCellBinding || resolvedExpandValue === "none") && /* @__PURE__ */ jsx2("option", { value: "none", children: "\u4E0D\u6269\u5C55\uFF08\u9759\u6001\u5355\u503C\u66FF\u6362\uFF09" })
771
785
  ]
772
786
  }
773
787
  )
774
788
  ] }),
775
- /* @__PURE__ */ jsxs2("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
776
- /* @__PURE__ */ jsxs2("label", { className: "yudao-sheet-field-row", children: [
777
- /* @__PURE__ */ jsx2("span", { children: "\u5DE6\u7236\u683C (leftParentCell)" }),
778
- /* @__PURE__ */ jsx2(
779
- "input",
780
- {
781
- type: "text",
782
- placeholder: "\u5982 A6 \u6216 none",
783
- value: cellMeta.leftParentCell ?? "",
784
- onChange: (e) => patchCellMeta({ leftParentCell: e.target.value.trim() || void 0 })
785
- }
786
- )
789
+ features.advancedCellBinding && /* @__PURE__ */ jsxs2(Fragment, { children: [
790
+ /* @__PURE__ */ jsxs2("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
791
+ /* @__PURE__ */ jsxs2("label", { className: "yudao-sheet-field-row", children: [
792
+ /* @__PURE__ */ jsx2("span", { children: "\u5DE6\u7236\u683C (leftParentCell)" }),
793
+ /* @__PURE__ */ jsx2(
794
+ "input",
795
+ {
796
+ type: "text",
797
+ placeholder: "\u5982 A6 \u6216 none",
798
+ value: cellMeta.leftParentCell ?? "",
799
+ onChange: (e) => patchCellMeta({ leftParentCell: e.target.value.trim() || void 0 })
800
+ }
801
+ )
802
+ ] }),
803
+ /* @__PURE__ */ jsxs2("label", { className: "yudao-sheet-field-row", children: [
804
+ /* @__PURE__ */ jsx2("span", { children: "\u4E0A\u7236\u683C (topParentCell)" }),
805
+ /* @__PURE__ */ jsx2(
806
+ "input",
807
+ {
808
+ type: "text",
809
+ placeholder: "\u5982 B5 \u6216 none",
810
+ value: cellMeta.topParentCell ?? "",
811
+ onChange: (e) => patchCellMeta({ topParentCell: e.target.value.trim() || void 0 })
812
+ }
813
+ )
814
+ ] })
787
815
  ] }),
788
- /* @__PURE__ */ jsxs2("label", { className: "yudao-sheet-field-row", children: [
789
- /* @__PURE__ */ jsx2("span", { children: "\u4E0A\u7236\u683C (topParentCell)" }),
790
- /* @__PURE__ */ jsx2(
791
- "input",
792
- {
793
- type: "text",
794
- placeholder: "\u5982 B5 \u6216 none",
795
- value: cellMeta.topParentCell ?? "",
796
- onChange: (e) => patchCellMeta({ topParentCell: e.target.value.trim() || void 0 })
797
- }
798
- )
799
- ] })
800
- ] }),
801
- /* @__PURE__ */ jsxs2(
802
- "div",
803
- {
804
- style: {
805
- background: "#F9FAFB",
806
- border: "1px solid #E3E5EA",
807
- borderRadius: 6,
808
- padding: "6px 8px",
809
- display: "flex",
810
- flexDirection: "column",
811
- gap: 5
812
- },
813
- children: [
814
- /* @__PURE__ */ jsxs2("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
815
- /* @__PURE__ */ jsx2("span", { style: { fontSize: 11, fontWeight: 600, color: "#31363F" }, children: t("yudaoSheets.inspector.cellFilterTitle") }),
816
- /* @__PURE__ */ jsx2(
817
- "button",
816
+ /* @__PURE__ */ jsxs2(
817
+ "div",
818
+ {
819
+ style: {
820
+ background: "#F9FAFB",
821
+ border: "1px solid #E3E5EA",
822
+ borderRadius: 6,
823
+ padding: "6px 8px",
824
+ display: "flex",
825
+ flexDirection: "column",
826
+ gap: 5
827
+ },
828
+ children: [
829
+ /* @__PURE__ */ jsxs2("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
830
+ /* @__PURE__ */ jsx2("span", { style: { fontSize: 11, fontWeight: 600, color: "#31363F" }, children: t("yudaoSheets.inspector.cellFilterTitle") }),
831
+ /* @__PURE__ */ jsx2(
832
+ "button",
833
+ {
834
+ type: "button",
835
+ className: "yudao-sheet-btn",
836
+ style: { padding: "2px 6px", fontSize: 10.5 },
837
+ onClick: () => {
838
+ const nextList = [
839
+ ...cellMeta.cellFilterConditions ?? [],
840
+ {
841
+ id: `cf_${generateRandomId(5)}`,
842
+ property: "",
843
+ operator: "==",
844
+ value: "",
845
+ join: "and"
846
+ }
847
+ ];
848
+ patchCellMeta({ cellFilterConditions: nextList });
849
+ },
850
+ children: t("yudaoSheets.inspector.cellFilterAddBtn")
851
+ }
852
+ )
853
+ ] }),
854
+ (cellMeta.cellFilterConditions ?? []).length === 0 ? /* @__PURE__ */ jsx2("div", { style: { fontSize: 10.5, color: "#7D8698" }, children: t("yudaoSheets.inspector.cellFilterEmptyHint") }) : (cellMeta.cellFilterConditions ?? []).map((cond, idx) => /* @__PURE__ */ jsxs2(
855
+ "div",
818
856
  {
819
- type: "button",
820
- className: "yudao-sheet-btn",
821
- style: { padding: "2px 6px", fontSize: 10.5 },
822
- onClick: () => {
823
- const nextList = [
824
- ...cellMeta.cellFilterConditions ?? [],
857
+ style: { display: "grid", gridTemplateColumns: "44px 1fr 56px 1fr 20px", gap: 4, alignItems: "center" },
858
+ children: [
859
+ /* @__PURE__ */ jsxs2(
860
+ "select",
861
+ {
862
+ style: { fontSize: 10.5, padding: "2px 2px", height: 24 },
863
+ value: cond.join ?? "and",
864
+ disabled: idx === 0,
865
+ onChange: (e) => {
866
+ const next = [...cellMeta.cellFilterConditions ?? []];
867
+ next[idx] = { ...cond, join: e.target.value };
868
+ patchCellMeta({ cellFilterConditions: next });
869
+ },
870
+ children: [
871
+ /* @__PURE__ */ jsx2("option", { value: "and", children: "AND" }),
872
+ /* @__PURE__ */ jsx2("option", { value: "or", children: "OR" })
873
+ ]
874
+ }
875
+ ),
876
+ /* @__PURE__ */ jsx2(
877
+ "input",
825
878
  {
826
- id: `cf_${generateRandomId(5)}`,
827
- property: "",
828
- operator: "==",
829
- value: "",
830
- join: "and"
879
+ type: "text",
880
+ placeholder: t("yudaoSheets.inspector.cellFilterFieldPlaceholder"),
881
+ style: { fontSize: 11, padding: "2px 5px", height: 24 },
882
+ value: cond.property,
883
+ onChange: (e) => {
884
+ const next = [...cellMeta.cellFilterConditions ?? []];
885
+ next[idx] = { ...cond, property: e.target.value };
886
+ patchCellMeta({ cellFilterConditions: next });
887
+ }
831
888
  }
832
- ];
833
- patchCellMeta({ cellFilterConditions: nextList });
834
- },
835
- children: t("yudaoSheets.inspector.cellFilterAddBtn")
889
+ ),
890
+ /* @__PURE__ */ jsxs2(
891
+ "select",
892
+ {
893
+ style: { fontSize: 10.5, padding: "2px 2px", height: 24 },
894
+ value: cond.operator,
895
+ onChange: (e) => {
896
+ const next = [...cellMeta.cellFilterConditions ?? []];
897
+ next[idx] = { ...cond, operator: e.target.value };
898
+ patchCellMeta({ cellFilterConditions: next });
899
+ },
900
+ children: [
901
+ /* @__PURE__ */ jsx2("option", { value: "==", children: "==" }),
902
+ /* @__PURE__ */ jsx2("option", { value: "!=", children: "!=" }),
903
+ /* @__PURE__ */ jsx2("option", { value: ">", children: ">" }),
904
+ /* @__PURE__ */ jsx2("option", { value: ">=", children: ">=" }),
905
+ /* @__PURE__ */ jsx2("option", { value: "<", children: "<" }),
906
+ /* @__PURE__ */ jsx2("option", { value: "<=", children: "<=" }),
907
+ /* @__PURE__ */ jsx2("option", { value: "in", children: "in" }),
908
+ /* @__PURE__ */ jsx2("option", { value: "notIn", children: "notIn" }),
909
+ /* @__PURE__ */ jsx2("option", { value: "contains", children: "contains" }),
910
+ /* @__PURE__ */ jsx2("option", { value: "like", children: "like" })
911
+ ]
912
+ }
913
+ ),
914
+ /* @__PURE__ */ jsx2(
915
+ "input",
916
+ {
917
+ type: "text",
918
+ placeholder: t("yudaoSheets.inspector.cellFilterValuePlaceholder"),
919
+ style: { fontSize: 11, padding: "2px 5px", height: 24 },
920
+ value: cond.value == null ? "" : String(cond.value),
921
+ onChange: (e) => {
922
+ const next = [...cellMeta.cellFilterConditions ?? []];
923
+ next[idx] = { ...cond, value: e.target.value };
924
+ patchCellMeta({ cellFilterConditions: next });
925
+ }
926
+ }
927
+ ),
928
+ /* @__PURE__ */ jsx2(
929
+ "button",
930
+ {
931
+ type: "button",
932
+ className: "yudao-sheet-btn",
933
+ style: { padding: 0, width: 20, height: 24, fontSize: 11 },
934
+ onClick: () => {
935
+ const next = (cellMeta.cellFilterConditions ?? []).filter((_, i) => i !== idx);
936
+ patchCellMeta({ cellFilterConditions: next.length > 0 ? next : void 0 });
937
+ },
938
+ children: "\xD7"
939
+ }
940
+ )
941
+ ]
942
+ },
943
+ cond.id ?? idx
944
+ ))
945
+ ]
946
+ }
947
+ ),
948
+ /* @__PURE__ */ jsxs2("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
949
+ /* @__PURE__ */ jsxs2("label", { className: "yudao-sheet-field-row", children: [
950
+ /* @__PURE__ */ jsx2("span", { children: "\u72EC\u7ACB\u6269\u5C55\u5206\u533A (zoneId)" }),
951
+ /* @__PURE__ */ jsx2(
952
+ "input",
953
+ {
954
+ type: "text",
955
+ placeholder: "\u5982 left / right\uFF08\u5E76\u6392\u591A\u8868\uFF09",
956
+ value: cellMeta.zoneId ?? "",
957
+ onChange: (e) => {
958
+ const zid = e.target.value.trim();
959
+ patchCellMeta({
960
+ zoneId: zid || void 0,
961
+ independentZone: zid ? true : void 0,
962
+ zoneMode: zid ? "independent" : void 0
963
+ });
836
964
  }
837
- )
838
- ] }),
839
- (cellMeta.cellFilterConditions ?? []).length === 0 ? /* @__PURE__ */ jsx2("div", { style: { fontSize: 10.5, color: "#7D8698" }, children: t("yudaoSheets.inspector.cellFilterEmptyHint") }) : (cellMeta.cellFilterConditions ?? []).map((cond, idx) => /* @__PURE__ */ jsxs2(
840
- "div",
965
+ }
966
+ )
967
+ ] }),
968
+ /* @__PURE__ */ jsxs2("label", { className: "yudao-sheet-field-row", children: [
969
+ /* @__PURE__ */ jsx2("span", { children: "\u6C47\u603B\u8BA1\u7B97\u6392\u9664 (calcExclude)" }),
970
+ /* @__PURE__ */ jsxs2(
971
+ "select",
841
972
  {
842
- style: { display: "grid", gridTemplateColumns: "44px 1fr 56px 1fr 20px", gap: 4, alignItems: "center" },
973
+ value: cellMeta.calcExclude ?? "none",
974
+ onChange: (e) => patchCellMeta({
975
+ calcExclude: e.target.value === "none" ? void 0 : e.target.value
976
+ }),
843
977
  children: [
844
- /* @__PURE__ */ jsxs2(
845
- "select",
846
- {
847
- style: { fontSize: 10.5, padding: "2px 2px", height: 24 },
848
- value: cond.join ?? "and",
849
- disabled: idx === 0,
850
- onChange: (e) => {
851
- const next = [...cellMeta.cellFilterConditions ?? []];
852
- next[idx] = { ...cond, join: e.target.value };
853
- patchCellMeta({ cellFilterConditions: next });
854
- },
855
- children: [
856
- /* @__PURE__ */ jsx2("option", { value: "and", children: "AND" }),
857
- /* @__PURE__ */ jsx2("option", { value: "or", children: "OR" })
858
- ]
859
- }
860
- ),
861
- /* @__PURE__ */ jsx2(
862
- "input",
863
- {
864
- type: "text",
865
- placeholder: t("yudaoSheets.inspector.cellFilterFieldPlaceholder"),
866
- style: { fontSize: 11, padding: "2px 5px", height: 24 },
867
- value: cond.property,
868
- onChange: (e) => {
869
- const next = [...cellMeta.cellFilterConditions ?? []];
870
- next[idx] = { ...cond, property: e.target.value };
871
- patchCellMeta({ cellFilterConditions: next });
872
- }
873
- }
874
- ),
875
- /* @__PURE__ */ jsxs2(
876
- "select",
877
- {
878
- style: { fontSize: 10.5, padding: "2px 2px", height: 24 },
879
- value: cond.operator,
880
- onChange: (e) => {
881
- const next = [...cellMeta.cellFilterConditions ?? []];
882
- next[idx] = { ...cond, operator: e.target.value };
883
- patchCellMeta({ cellFilterConditions: next });
884
- },
885
- children: [
886
- /* @__PURE__ */ jsx2("option", { value: "==", children: "==" }),
887
- /* @__PURE__ */ jsx2("option", { value: "!=", children: "!=" }),
888
- /* @__PURE__ */ jsx2("option", { value: ">", children: ">" }),
889
- /* @__PURE__ */ jsx2("option", { value: ">=", children: ">=" }),
890
- /* @__PURE__ */ jsx2("option", { value: "<", children: "<" }),
891
- /* @__PURE__ */ jsx2("option", { value: "<=", children: "<=" }),
892
- /* @__PURE__ */ jsx2("option", { value: "in", children: "in" }),
893
- /* @__PURE__ */ jsx2("option", { value: "notIn", children: "notIn" }),
894
- /* @__PURE__ */ jsx2("option", { value: "contains", children: "contains" }),
895
- /* @__PURE__ */ jsx2("option", { value: "like", children: "like" })
896
- ]
897
- }
898
- ),
899
- /* @__PURE__ */ jsx2(
900
- "input",
901
- {
902
- type: "text",
903
- placeholder: t("yudaoSheets.inspector.cellFilterValuePlaceholder"),
904
- style: { fontSize: 11, padding: "2px 5px", height: 24 },
905
- value: cond.value == null ? "" : String(cond.value),
906
- onChange: (e) => {
907
- const next = [...cellMeta.cellFilterConditions ?? []];
908
- next[idx] = { ...cond, value: e.target.value };
909
- patchCellMeta({ cellFilterConditions: next });
910
- }
911
- }
912
- ),
913
- /* @__PURE__ */ jsx2(
914
- "button",
915
- {
916
- type: "button",
917
- className: "yudao-sheet-btn",
918
- style: { padding: 0, width: 20, height: 24, fontSize: 11 },
919
- onClick: () => {
920
- const next = (cellMeta.cellFilterConditions ?? []).filter((_, i) => i !== idx);
921
- patchCellMeta({ cellFilterConditions: next.length > 0 ? next : void 0 });
922
- },
923
- children: "\xD7"
924
- }
925
- )
978
+ /* @__PURE__ */ jsx2("option", { value: "none", children: "\u6B63\u5E38\u53C2\u4E0E\u6C47\u603B" }),
979
+ /* @__PURE__ */ jsx2("option", { value: "negatives", children: "\u6392\u9664\u8D1F\u6570 (negatives)" }),
980
+ /* @__PURE__ */ jsx2("option", { value: "zeros", children: "\u6392\u9664\u96F6\u503C (zeros)" }),
981
+ /* @__PURE__ */ jsx2("option", { value: "all", children: "\u5B8C\u5168\u6392\u9664 (all)" })
926
982
  ]
927
- },
928
- cond.id ?? idx
929
- ))
930
- ]
931
- }
932
- ),
933
- /* @__PURE__ */ jsxs2("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
934
- /* @__PURE__ */ jsxs2("label", { className: "yudao-sheet-field-row", children: [
935
- /* @__PURE__ */ jsx2("span", { children: "\u72EC\u7ACB\u6269\u5C55\u5206\u533A (zoneId)" }),
936
- /* @__PURE__ */ jsx2(
937
- "input",
938
- {
939
- type: "text",
940
- placeholder: "\u5982 left / right\uFF08\u5E76\u6392\u591A\u8868\uFF09",
941
- value: cellMeta.zoneId ?? "",
942
- onChange: (e) => {
943
- const zid = e.target.value.trim();
944
- patchCellMeta({
945
- zoneId: zid || void 0,
946
- independentZone: zid ? true : void 0,
947
- zoneMode: zid ? "independent" : void 0
948
- });
949
983
  }
950
- }
951
- )
952
- ] }),
953
- /* @__PURE__ */ jsxs2("label", { className: "yudao-sheet-field-row", children: [
954
- /* @__PURE__ */ jsx2("span", { children: "\u6C47\u603B\u8BA1\u7B97\u6392\u9664 (calcExclude)" }),
955
- /* @__PURE__ */ jsxs2(
956
- "select",
957
- {
958
- value: cellMeta.calcExclude ?? "none",
959
- onChange: (e) => patchCellMeta({
960
- calcExclude: e.target.value === "none" ? void 0 : e.target.value
961
- }),
962
- children: [
963
- /* @__PURE__ */ jsx2("option", { value: "none", children: "\u6B63\u5E38\u53C2\u4E0E\u6C47\u603B" }),
964
- /* @__PURE__ */ jsx2("option", { value: "negatives", children: "\u6392\u9664\u8D1F\u6570 (negatives)" }),
965
- /* @__PURE__ */ jsx2("option", { value: "zeros", children: "\u6392\u9664\u96F6\u503C (zeros)" }),
966
- /* @__PURE__ */ jsx2("option", { value: "all", children: "\u5B8C\u5168\u6392\u9664 (all)" })
967
- ]
968
- }
969
- )
984
+ )
985
+ ] })
970
986
  ] })
971
987
  ] }),
972
988
  /* @__PURE__ */ jsxs2("div", { style: { display: "flex", flexDirection: "column", gap: 5 }, children: [
@@ -981,7 +997,7 @@ var SheetInspectorPanel = () => {
981
997
  ),
982
998
  /* @__PURE__ */ jsx2("span", { children: "\u76F8\u90BB\u76F8\u540C\u5206\u7EC4\u503C\u81EA\u52A8\u7EB5\u5411\u5408\u5E76\u5355\u5143\u683C (Group)" })
983
999
  ] }),
984
- /* @__PURE__ */ jsxs2("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer" }, children: [
1000
+ features.advancedCellBinding && /* @__PURE__ */ jsxs2("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer" }, children: [
985
1001
  /* @__PURE__ */ jsx2(
986
1002
  "input",
987
1003
  {
@@ -1003,7 +1019,7 @@ var SheetInspectorPanel = () => {
1003
1019
  ),
1004
1020
  /* @__PURE__ */ jsx2("span", { children: "\u4F34\u968F\u540C\u884C\u5217\u8868\u81EA\u52A8\u590D\u5236\u6269\u5C55 (auto)" })
1005
1021
  ] }),
1006
- /* @__PURE__ */ jsxs2("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer" }, children: [
1022
+ features.advancedCellBinding && /* @__PURE__ */ jsxs2("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer" }, children: [
1007
1023
  /* @__PURE__ */ jsx2(
1008
1024
  "input",
1009
1025
  {
@@ -1029,7 +1045,7 @@ var SheetInspectorPanel = () => {
1029
1045
  /* @__PURE__ */ jsx2("span", { children: "\u542F\u7528\u6811\u5F62\u6298\u53E0\u62A5\u8868 (\u5DE6\u7236\u683C/\u6811\u5F62\u6298\u53E0)" })
1030
1046
  ] })
1031
1047
  ] }),
1032
- cellMeta.treeConfig?.enabled && /* @__PURE__ */ jsxs2("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
1048
+ features.advancedCellBinding && cellMeta.treeConfig?.enabled && /* @__PURE__ */ jsxs2("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
1033
1049
  /* @__PURE__ */ jsxs2("label", { className: "yudao-sheet-field-row", children: [
1034
1050
  /* @__PURE__ */ jsx2("span", { children: "\u8282\u70B9\u4E3B\u952E\u5B57\u6BB5 (idField)" }),
1035
1051
  /* @__PURE__ */ jsx2(
@@ -1057,8 +1073,8 @@ var SheetInspectorPanel = () => {
1057
1073
  )
1058
1074
  ] })
1059
1075
  ] }),
1060
- /* @__PURE__ */ jsxs2("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
1061
- /* @__PURE__ */ jsxs2("label", { className: "yudao-sheet-field-row", children: [
1076
+ (features.advancedCellBinding || features.loopBlocks) && /* @__PURE__ */ jsxs2("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
1077
+ features.advancedCellBinding && /* @__PURE__ */ jsxs2("label", { className: "yudao-sheet-field-row", children: [
1062
1078
  /* @__PURE__ */ jsx2("span", { children: "\u5206\u7EC4\u5C0F\u8BA1 (Subtotal)" }),
1063
1079
  /* @__PURE__ */ jsxs2(
1064
1080
  "select",
@@ -1138,38 +1154,48 @@ var SheetInspectorPanel = () => {
1138
1154
  )
1139
1155
  ] })
1140
1156
  ] }),
1141
- /* @__PURE__ */ jsxs2("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
1142
- /* @__PURE__ */ jsxs2("label", { className: "yudao-sheet-field-row", children: [
1143
- /* @__PURE__ */ jsx2("span", { children: "\u6761\u4EF6\u9690\u85CF\u884C (hideIf)" }),
1144
- /* @__PURE__ */ jsx2(
1145
- "input",
1146
- {
1147
- type: "text",
1148
- placeholder: "\u5982 ==0 \u6216 <=0",
1149
- value: cellMeta.hideIf ?? "",
1150
- onChange: (e) => patchCellMeta({ hideIf: e.target.value || void 0 })
1151
- }
1152
- )
1153
- ] }),
1154
- /* @__PURE__ */ jsxs2("label", { className: "yudao-sheet-field-row", children: [
1155
- /* @__PURE__ */ jsx2("span", { children: "\u7968\u636E\u8865\u8DB3 N \u500D\u6570\u7A7A\u884C" }),
1156
- /* @__PURE__ */ jsx2(
1157
- "input",
1158
- {
1159
- type: "number",
1160
- min: 0,
1161
- max: 50,
1162
- placeholder: "0 \u4E0D\u8865",
1163
- value: cellMeta.padBlankRowsToMultipleOf ?? 0,
1164
- onChange: (e) => {
1165
- const n = Number(e.target.value);
1166
- patchCellMeta({ padBlankRowsToMultipleOf: n > 1 ? n : void 0 });
1167
- }
1168
- }
1169
- )
1170
- ] })
1171
- ] }),
1172
- /* @__PURE__ */ jsxs2("div", { style: { display: "flex", gap: 4, flexWrap: "wrap" }, children: [
1157
+ /* @__PURE__ */ jsxs2(
1158
+ "div",
1159
+ {
1160
+ style: {
1161
+ display: "grid",
1162
+ gridTemplateColumns: features.advancedCellBinding ? "1fr 1fr" : "1fr",
1163
+ gap: 6
1164
+ },
1165
+ children: [
1166
+ /* @__PURE__ */ jsxs2("label", { className: "yudao-sheet-field-row", children: [
1167
+ /* @__PURE__ */ jsx2("span", { children: "\u6761\u4EF6\u9690\u85CF\u884C (hideIf)" }),
1168
+ /* @__PURE__ */ jsx2(
1169
+ "input",
1170
+ {
1171
+ type: "text",
1172
+ placeholder: "\u5982 ==0 \u6216 <=0",
1173
+ value: cellMeta.hideIf ?? "",
1174
+ onChange: (e) => patchCellMeta({ hideIf: e.target.value || void 0 })
1175
+ }
1176
+ )
1177
+ ] }),
1178
+ features.advancedCellBinding && /* @__PURE__ */ jsxs2("label", { className: "yudao-sheet-field-row", children: [
1179
+ /* @__PURE__ */ jsx2("span", { children: "\u7968\u636E\u8865\u8DB3 N \u500D\u6570\u7A7A\u884C" }),
1180
+ /* @__PURE__ */ jsx2(
1181
+ "input",
1182
+ {
1183
+ type: "number",
1184
+ min: 0,
1185
+ max: 50,
1186
+ placeholder: "0 \u4E0D\u8865",
1187
+ value: cellMeta.padBlankRowsToMultipleOf ?? 0,
1188
+ onChange: (e) => {
1189
+ const n = Number(e.target.value);
1190
+ patchCellMeta({ padBlankRowsToMultipleOf: n > 1 ? n : void 0 });
1191
+ }
1192
+ }
1193
+ )
1194
+ ] })
1195
+ ]
1196
+ }
1197
+ ),
1198
+ features.advancedCellBinding && /* @__PURE__ */ jsxs2("div", { style: { display: "flex", gap: 4, flexWrap: "wrap" }, children: [
1173
1199
  /* @__PURE__ */ jsx2(
1174
1200
  "button",
1175
1201
  {
@@ -3396,7 +3422,7 @@ var SheetInspectorPanel = () => {
3396
3422
  ] }),
3397
3423
  pkgStatusMsg && /* @__PURE__ */ jsx2("div", { style: { fontSize: 10.5, color: "#4E5565", lineHeight: 1.35 }, children: pkgStatusMsg })
3398
3424
  ] }),
3399
- /* @__PURE__ */ jsx2(
3425
+ features.builtinPreviewModal && /* @__PURE__ */ jsx2(
3400
3426
  "button",
3401
3427
  {
3402
3428
  type: "button",
@@ -3478,20 +3504,25 @@ var SheetLeftSidebar = () => {
3478
3504
  }
3479
3505
  void rev;
3480
3506
  void metaVersion;
3481
- const metadata = templateService.getTemplateMetadata(workbook.getUnitId());
3507
+ const unitId = workbook.getUnitId();
3508
+ const metadata = templateService.getTemplateMetadata(unitId);
3509
+ const effectiveSyntax = templateService.getPlaceholderSyntax(unitId);
3510
+ const effectiveImplicitExpand = templateService.getImplicitExpand(unitId);
3482
3511
  const datasets = metadata.datasets ?? [];
3483
- const boundCells = scanWorkbookBoundCells2(workbook.save(), metadata.sampleData).filter((item) => {
3512
+ const boundCells = scanWorkbookBoundCells2(workbook.save(), metadata.sampleData, {
3513
+ implicitExpand: effectiveImplicitExpand
3514
+ }).filter((item) => {
3484
3515
  const sh = workbook.getSheetBySheetId(item.sheetId);
3485
3516
  return sh ? !sh.isSheetHidden() : true;
3486
3517
  });
3487
3518
  const handleJumpToCell = (item) => {
3488
3519
  try {
3489
- const unitId = workbook.getUnitId();
3520
+ const unitId2 = workbook.getUnitId();
3490
3521
  const targetSheet = workbook.getSheetBySheetId(item.sheetId);
3491
3522
  if (!targetSheet || targetSheet.isSheetHidden()) return;
3492
3523
  if (workbook.getActiveSheet()?.getSheetId() !== item.sheetId) {
3493
3524
  commandService.syncExecuteCommand(SetWorksheetActiveOperation2.id, {
3494
- unitId,
3525
+ unitId: unitId2,
3495
3526
  subUnitId: item.sheetId
3496
3527
  });
3497
3528
  }
@@ -3506,7 +3537,7 @@ var SheetLeftSidebar = () => {
3506
3537
  endColumn: master.col
3507
3538
  };
3508
3539
  const isMerged = Boolean(master.mergeRange);
3509
- selectionService.setSelections(unitId, item.sheetId, [
3540
+ selectionService.setSelections(unitId2, item.sheetId, [
3510
3541
  {
3511
3542
  range: selRange,
3512
3543
  primary: {
@@ -3523,7 +3554,7 @@ var SheetLeftSidebar = () => {
3523
3554
  }
3524
3555
  ]);
3525
3556
  commandService.syncExecuteCommand(ScrollToCellOperation.id, {
3526
- unitId,
3557
+ unitId: unitId2,
3527
3558
  range: selRange
3528
3559
  });
3529
3560
  } catch {
@@ -3617,11 +3648,16 @@ var SheetLeftSidebar = () => {
3617
3648
  "button",
3618
3649
  {
3619
3650
  type: "button",
3620
- draggable: true,
3651
+ draggable: features.fieldDrag,
3652
+ "data-sheet-field": fieldExpr,
3621
3653
  className: "yudao-sheet-field-btn",
3622
3654
  onDragStart: (e) => {
3655
+ if (!features.fieldDrag) return;
3623
3656
  e.dataTransfer.setData("application/x-yudao-sheet-field", fieldExpr);
3624
- e.dataTransfer.setData("text/plain", fieldExpr);
3657
+ e.dataTransfer.setData(
3658
+ "text/plain",
3659
+ fieldExpr.startsWith("${") || fieldExpr.startsWith("#{") ? fieldExpr : effectiveSyntax === "hash" ? `#{${fieldExpr}}` : `\${${fieldExpr}}`
3660
+ );
3625
3661
  e.dataTransfer.effectAllowed = "copy";
3626
3662
  },
3627
3663
  onClick: () => commandService.syncExecuteCommand(BindSheetCellDatasetCommand2.id, {
@@ -3661,10 +3697,10 @@ var SheetLeftSidebar = () => {
3661
3697
  fontWeight: 500,
3662
3698
  padding: "1px 6px",
3663
3699
  borderRadius: 999,
3664
- background: item.kind === "list" ? "#F3F5FF" : "#EEEFF1",
3665
- color: item.kind === "list" ? "#2C53F1" : "#4E5565"
3700
+ background: item.kind === "list" || item.kind === "crossTab" ? "#F3F5FF" : "#EEEFF1",
3701
+ color: item.kind === "list" || item.kind === "crossTab" ? "#2C53F1" : "#4E5565"
3666
3702
  },
3667
- children: item.kind === "list" ? t("yudaoSheets.leftSidebar.kindList") : t("yudaoSheets.leftSidebar.kindScalar")
3703
+ children: item.kind === "crossTab" ? t("yudaoSheets.leftSidebar.kindCrossTab") : item.kind === "list" ? t("yudaoSheets.leftSidebar.kindList") : t("yudaoSheets.leftSidebar.kindScalar")
3668
3704
  }
3669
3705
  )
3670
3706
  ] }),
@@ -3792,6 +3828,7 @@ var SheetPreviewAndIoModal = () => {
3792
3828
  const compiled = effectiveData ? compileWorkbookWithDataset(snap, effectiveData, {
3793
3829
  metadata: tplMeta,
3794
3830
  printConfig: cfg,
3831
+ implicitExpand: unitId ? templateService.getImplicitExpand(unitId) : void 0,
3795
3832
  loopBlocks,
3796
3833
  conditionProperties,
3797
3834
  drillLinks,
@@ -3995,6 +4032,7 @@ var SheetPreviewAndIoModal = () => {
3995
4032
  data: parsedData,
3996
4033
  printConfig: printCfg,
3997
4034
  metadata: templateService.getTemplateMetadata(unitId),
4035
+ implicitExpand: templateService.getImplicitExpand(unitId),
3998
4036
  target: ioTarget
3999
4037
  });
4000
4038
  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";
@@ -7614,7 +7652,18 @@ var SheetsExtUIController = class extends Disposable2 {
7614
7652
  this.disposeWithMe({ dispose: () => printSub.unsubscribe() });
7615
7653
  }
7616
7654
  if (this._config.defaultOpenInspector && (this._config.features?.datasetBinding || this._config.features?.printTemplate)) {
7617
- setTimeout(() => openSheetInspectorSidebar(this._sidebarService), 120);
7655
+ let disposed = false;
7656
+ const timer = setTimeout(() => {
7657
+ if (!disposed) {
7658
+ openSheetInspectorSidebar(this._sidebarService);
7659
+ }
7660
+ }, 120);
7661
+ this.disposeWithMe({
7662
+ dispose: () => {
7663
+ disposed = true;
7664
+ clearTimeout(timer);
7665
+ }
7666
+ });
7618
7667
  }
7619
7668
  }
7620
7669
  _initIcons() {