@smallwebco/tinypivot-react 1.0.14 → 1.0.16

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/dist/index.cjs CHANGED
@@ -241,11 +241,17 @@ async function setLicenseKey(key) {
241
241
  }
242
242
  notifyListeners();
243
243
  }
244
- function enableDemoMode() {
244
+ async function enableDemoMode(secret) {
245
+ const demoLicense = await (0, import_tinypivot_core2.getDemoLicenseInfo)(secret);
246
+ if (!demoLicense) {
247
+ console.warn("[TinyPivot] Demo mode activation failed - invalid secret");
248
+ return false;
249
+ }
245
250
  globalDemoMode = true;
246
- globalLicenseInfo = (0, import_tinypivot_core2.getDemoLicenseInfo)();
251
+ globalLicenseInfo = demoLicense;
247
252
  console.info("[TinyPivot] Demo mode enabled - all Pro features unlocked for evaluation");
248
253
  notifyListeners();
254
+ return true;
249
255
  }
250
256
  function configureLicenseSecret(secret) {
251
257
  (0, import_tinypivot_core2.configureLicenseSecret)(secret);
@@ -1344,6 +1350,20 @@ function PivotSkeleton({
1344
1350
  if (!activeFilters || activeFilters.length === 0) return "";
1345
1351
  return activeFilters.map((f) => f.column).join(", ");
1346
1352
  }, [activeFilters]);
1353
+ const [showFilterTooltip, setShowFilterTooltip] = (0, import_react7.useState)(false);
1354
+ const filterTooltipDetails = (0, import_react7.useMemo)(() => {
1355
+ if (!activeFilters || activeFilters.length === 0) return [];
1356
+ return activeFilters.map((f) => {
1357
+ const maxDisplay = 5;
1358
+ const displayValues = f.values.slice(0, maxDisplay);
1359
+ const remaining = f.values.length - maxDisplay;
1360
+ return {
1361
+ column: f.column,
1362
+ values: displayValues,
1363
+ remaining: remaining > 0 ? remaining : 0
1364
+ };
1365
+ });
1366
+ }, [activeFilters]);
1347
1367
  const handleDragOver = (0, import_react7.useCallback)(
1348
1368
  (area, event) => {
1349
1369
  event.preventDefault();
@@ -1468,37 +1488,66 @@ function PivotSkeleton({
1468
1488
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "Pivot Table" })
1469
1489
  ] }),
1470
1490
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "vpg-header-right", children: [
1471
- hasActiveFilters && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "vpg-filter-indicator", children: [
1472
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1473
- "svg",
1474
- {
1475
- className: "vpg-filter-icon",
1476
- fill: "none",
1477
- stroke: "currentColor",
1478
- viewBox: "0 0 24 24",
1479
- children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1480
- "path",
1491
+ hasActiveFilters && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
1492
+ "div",
1493
+ {
1494
+ className: "vpg-filter-indicator",
1495
+ onMouseEnter: () => setShowFilterTooltip(true),
1496
+ onMouseLeave: () => setShowFilterTooltip(false),
1497
+ children: [
1498
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1499
+ "svg",
1481
1500
  {
1482
- strokeLinecap: "round",
1483
- strokeLinejoin: "round",
1484
- strokeWidth: 2,
1485
- d: "M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"
1501
+ className: "vpg-filter-icon",
1502
+ fill: "none",
1503
+ stroke: "currentColor",
1504
+ viewBox: "0 0 24 24",
1505
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1506
+ "path",
1507
+ {
1508
+ strokeLinecap: "round",
1509
+ strokeLinejoin: "round",
1510
+ strokeWidth: 2,
1511
+ d: "M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"
1512
+ }
1513
+ )
1486
1514
  }
1487
- )
1488
- }
1489
- ),
1490
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "vpg-filter-text", children: [
1491
- "Filtered: ",
1492
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: filterSummary }),
1493
- filteredRowCount !== void 0 && totalRowCount !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "vpg-filter-count", children: [
1494
- "(",
1495
- filteredRowCount.toLocaleString(),
1496
- " of ",
1497
- totalRowCount.toLocaleString(),
1498
- " rows)"
1499
- ] })
1500
- ] })
1501
- ] }),
1515
+ ),
1516
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "vpg-filter-text", children: [
1517
+ "Filtered: ",
1518
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: filterSummary }),
1519
+ filteredRowCount !== void 0 && totalRowCount !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "vpg-filter-count", children: [
1520
+ "(",
1521
+ filteredRowCount.toLocaleString(),
1522
+ " of ",
1523
+ totalRowCount.toLocaleString(),
1524
+ " rows)"
1525
+ ] })
1526
+ ] }),
1527
+ showFilterTooltip && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "vpg-filter-tooltip", children: [
1528
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "vpg-tooltip-header", children: "Active Filters" }),
1529
+ filterTooltipDetails.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "vpg-tooltip-filter", children: [
1530
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "vpg-tooltip-column", children: filter.column }),
1531
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "vpg-tooltip-values", children: [
1532
+ filter.values.map((val, idx) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "vpg-tooltip-value", children: val }, idx)),
1533
+ filter.remaining > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "vpg-tooltip-more", children: [
1534
+ "+",
1535
+ filter.remaining,
1536
+ " more"
1537
+ ] })
1538
+ ] })
1539
+ ] }, filter.column)),
1540
+ filteredRowCount !== void 0 && totalRowCount !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "vpg-tooltip-summary", children: [
1541
+ "Showing ",
1542
+ filteredRowCount.toLocaleString(),
1543
+ " of ",
1544
+ totalRowCount.toLocaleString(),
1545
+ " rows"
1546
+ ] })
1547
+ ] })
1548
+ ]
1549
+ }
1550
+ ),
1502
1551
  isConfigured && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "vpg-config-summary", children: [
1503
1552
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "vpg-summary-badge vpg-rows", children: [
1504
1553
  rowFields.length,