@yudaocode/univer-sheets-ui 1.6.207 → 1.6.209

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
@@ -626,20 +626,23 @@ var SheetInspectorPanel = () => {
626
626
  const metadata = templateService.getTemplateMetadata(unitId);
627
627
  const effectiveSyntax = templateService.getPlaceholderSyntax(unitId);
628
628
  const effectiveImplicitExpand = templateService.getImplicitExpand(unitId);
629
+ const parseSyntax = features.contextualCellBinding ? effectiveSyntax : "any";
629
630
  const allFields = (metadata.datasets ?? []).flatMap((g) => g.fields);
630
631
  const boundCount = (0, import_univer_sheets2.scanWorkbookBoundCells)(workbook.save(), metadata.sampleData, {
631
- implicitExpand: effectiveImplicitExpand
632
+ implicitExpand: effectiveImplicitExpand,
633
+ placeholderSyntax: parseSyntax
632
634
  }).length;
633
635
  const printCfg = metadata.printConfig ?? {};
634
636
  const protectionCfg = metadata.protection;
635
637
  const charts = metadata.charts ?? [];
636
638
  const activeAlertRule = cellMeta.alertRules?.[0];
637
- const currentExprMatch = typeof activeCell?.v === "string" ? activeCell.v.trim().match(/^(?:\$|#)\{(#?[\p{L}\p{N}_.\[\]-]+)\}$/u) : null;
638
- const currentBoundKey = currentExprMatch?.[1] ?? "";
639
- const activeCellText = activeCell?.v == null ? "" : String(activeCell.v);
639
+ const singleExprRe = features.contextualCellBinding && effectiveSyntax === "hash" ? /^#\{([#$]?\s*[\p{L}\p{N}_][\p{L}\p{N}_.\[\]-]*)\}$/u : features.contextualCellBinding && effectiveSyntax === "dollar" ? /^\$\{([#$]?\s*[\p{L}\p{N}_][\p{L}\p{N}_.\[\]-]*)\}$/u : /^(?:\$|#)\{([#$]?\s*[\p{L}\p{N}_][\p{L}\p{N}_.\[\]-]*)\}$/u;
640
+ const currentExprMatch = typeof activeCell?.v === "string" ? activeCell.v.trim().match(singleExprRe) : null;
641
+ const currentBoundKey = currentExprMatch?.[1]?.trim() ?? "";
640
642
  const isMergedCell = Boolean(resolvedMaster.mergeRange);
641
643
  const restrictMergedExpand = features.contextualCellBinding && isMergedCell;
642
- const isDynamicBoundCell = features.contextualCellBinding ? effectiveSyntax === "hash" ? activeCellText.includes("#{") : activeCellText.includes("${") || activeCellText.includes("#{") : true;
644
+ const cellPlaceholders = (0, import_univer_sheets2.extractCellPlaceholders)(activeCell, { syntax: parseSyntax });
645
+ const isDynamicBoundCell = features.contextualCellBinding ? cellPlaceholders.length > 0 : true;
643
646
  const showStaticAutoOption = !features.contextualCellBinding || !isDynamicBoundCell;
644
647
  const hasExplicitListToken = typeof activeCell?.v === "string" && (activeCell.v.includes("${#") || activeCell.v.includes("#{#") || activeCell.v.includes("[]."));
645
648
  const resolvedExpandValue = cellMeta.expand ?? (hasExplicitListToken ? "v" : effectiveImplicitExpand);
@@ -1334,7 +1337,7 @@ var SheetInspectorPanel = () => {
1334
1337
  )
1335
1338
  ] })
1336
1339
  ] }),
1337
- isDynamicBoundCell && (!features.contextualCellBinding || resolvedExpandValue !== "h") && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1340
+ (isDynamicBoundCell || Boolean(cellMeta.hideIf)) && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1338
1341
  "div",
1339
1342
  {
1340
1343
  style: {
@@ -3675,7 +3678,8 @@ var SheetLeftSidebar = () => {
3675
3678
  const effectiveImplicitExpand = templateService.getImplicitExpand(unitId);
3676
3679
  const datasets = metadata.datasets ?? [];
3677
3680
  const boundCells = (0, import_univer_sheets3.scanWorkbookBoundCells)(workbook.save(), metadata.sampleData, {
3678
- implicitExpand: effectiveImplicitExpand
3681
+ implicitExpand: effectiveImplicitExpand,
3682
+ placeholderSyntax: features.contextualCellBinding ? effectiveSyntax : "any"
3679
3683
  });
3680
3684
  const handleJumpToCell = (item) => {
3681
3685
  try {