@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/es/index.js CHANGED
@@ -280,6 +280,7 @@ import {
280
280
  evaluateFormulaSteps,
281
281
  ExpandSheetOutlineToLevelCommand,
282
282
  exportSheetReportPackage,
283
+ extractCellPlaceholders,
283
284
  extractSheetFillChangeset,
284
285
  extractSheetFillValues,
285
286
  GenerateSheetPivotCommand,
@@ -456,20 +457,23 @@ var SheetInspectorPanel = () => {
456
457
  const metadata = templateService.getTemplateMetadata(unitId);
457
458
  const effectiveSyntax = templateService.getPlaceholderSyntax(unitId);
458
459
  const effectiveImplicitExpand = templateService.getImplicitExpand(unitId);
460
+ const parseSyntax = features.contextualCellBinding ? effectiveSyntax : "any";
459
461
  const allFields = (metadata.datasets ?? []).flatMap((g) => g.fields);
460
462
  const boundCount = scanWorkbookBoundCells(workbook.save(), metadata.sampleData, {
461
- implicitExpand: effectiveImplicitExpand
463
+ implicitExpand: effectiveImplicitExpand,
464
+ placeholderSyntax: parseSyntax
462
465
  }).length;
463
466
  const printCfg = metadata.printConfig ?? {};
464
467
  const protectionCfg = metadata.protection;
465
468
  const charts = metadata.charts ?? [];
466
469
  const activeAlertRule = cellMeta.alertRules?.[0];
467
- const currentExprMatch = typeof activeCell?.v === "string" ? activeCell.v.trim().match(/^(?:\$|#)\{(#?[\p{L}\p{N}_.\[\]-]+)\}$/u) : null;
468
- const currentBoundKey = currentExprMatch?.[1] ?? "";
469
- const activeCellText = activeCell?.v == null ? "" : String(activeCell.v);
470
+ 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;
471
+ const currentExprMatch = typeof activeCell?.v === "string" ? activeCell.v.trim().match(singleExprRe) : null;
472
+ const currentBoundKey = currentExprMatch?.[1]?.trim() ?? "";
470
473
  const isMergedCell = Boolean(resolvedMaster.mergeRange);
471
474
  const restrictMergedExpand = features.contextualCellBinding && isMergedCell;
472
- const isDynamicBoundCell = features.contextualCellBinding ? effectiveSyntax === "hash" ? activeCellText.includes("#{") : activeCellText.includes("${") || activeCellText.includes("#{") : true;
475
+ const cellPlaceholders = extractCellPlaceholders(activeCell, { syntax: parseSyntax });
476
+ const isDynamicBoundCell = features.contextualCellBinding ? cellPlaceholders.length > 0 : true;
473
477
  const showStaticAutoOption = !features.contextualCellBinding || !isDynamicBoundCell;
474
478
  const hasExplicitListToken = typeof activeCell?.v === "string" && (activeCell.v.includes("${#") || activeCell.v.includes("#{#") || activeCell.v.includes("[]."));
475
479
  const resolvedExpandValue = cellMeta.expand ?? (hasExplicitListToken ? "v" : effectiveImplicitExpand);
@@ -1164,7 +1168,7 @@ var SheetInspectorPanel = () => {
1164
1168
  )
1165
1169
  ] })
1166
1170
  ] }),
1167
- isDynamicBoundCell && (!features.contextualCellBinding || resolvedExpandValue !== "h") && /* @__PURE__ */ jsxs2(
1171
+ (isDynamicBoundCell || Boolean(cellMeta.hideIf)) && /* @__PURE__ */ jsxs2(
1168
1172
  "div",
1169
1173
  {
1170
1174
  style: {
@@ -3520,7 +3524,8 @@ var SheetLeftSidebar = () => {
3520
3524
  const effectiveImplicitExpand = templateService.getImplicitExpand(unitId);
3521
3525
  const datasets = metadata.datasets ?? [];
3522
3526
  const boundCells = scanWorkbookBoundCells2(workbook.save(), metadata.sampleData, {
3523
- implicitExpand: effectiveImplicitExpand
3527
+ implicitExpand: effectiveImplicitExpand,
3528
+ placeholderSyntax: features.contextualCellBinding ? effectiveSyntax : "any"
3524
3529
  });
3525
3530
  const handleJumpToCell = (item) => {
3526
3531
  try {