@smallwebco/tinypivot-react 1.0.14 → 1.0.15
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 +80 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +80 -31
- package/dist/index.js.map +1 -1
- package/dist/style.css +119 -3
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -183,9 +183,10 @@ declare function usePivotTable(data: Record<string, unknown>[]): UsePivotTableRe
|
|
|
183
183
|
*/
|
|
184
184
|
declare function setLicenseKey(key: string): Promise<void>;
|
|
185
185
|
/**
|
|
186
|
-
* Enable demo mode
|
|
186
|
+
* Enable demo mode - requires the correct demo secret
|
|
187
|
+
* Returns true if activation succeeded, false if secret was invalid
|
|
187
188
|
*/
|
|
188
|
-
declare function enableDemoMode():
|
|
189
|
+
declare function enableDemoMode(secret: string): Promise<boolean>;
|
|
189
190
|
/**
|
|
190
191
|
* Configure the license secret
|
|
191
192
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -183,9 +183,10 @@ declare function usePivotTable(data: Record<string, unknown>[]): UsePivotTableRe
|
|
|
183
183
|
*/
|
|
184
184
|
declare function setLicenseKey(key: string): Promise<void>;
|
|
185
185
|
/**
|
|
186
|
-
* Enable demo mode
|
|
186
|
+
* Enable demo mode - requires the correct demo secret
|
|
187
|
+
* Returns true if activation succeeded, false if secret was invalid
|
|
187
188
|
*/
|
|
188
|
-
declare function enableDemoMode():
|
|
189
|
+
declare function enableDemoMode(secret: string): Promise<boolean>;
|
|
189
190
|
/**
|
|
190
191
|
* Configure the license secret
|
|
191
192
|
*/
|
package/dist/index.js
CHANGED
|
@@ -219,11 +219,17 @@ async function setLicenseKey(key) {
|
|
|
219
219
|
}
|
|
220
220
|
notifyListeners();
|
|
221
221
|
}
|
|
222
|
-
function enableDemoMode() {
|
|
222
|
+
async function enableDemoMode(secret) {
|
|
223
|
+
const demoLicense = await getDemoLicenseInfo(secret);
|
|
224
|
+
if (!demoLicense) {
|
|
225
|
+
console.warn("[TinyPivot] Demo mode activation failed - invalid secret");
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
223
228
|
globalDemoMode = true;
|
|
224
|
-
globalLicenseInfo =
|
|
229
|
+
globalLicenseInfo = demoLicense;
|
|
225
230
|
console.info("[TinyPivot] Demo mode enabled - all Pro features unlocked for evaluation");
|
|
226
231
|
notifyListeners();
|
|
232
|
+
return true;
|
|
227
233
|
}
|
|
228
234
|
function configureLicenseSecret(secret) {
|
|
229
235
|
coreConfigureLicenseSecret(secret);
|
|
@@ -1327,6 +1333,20 @@ function PivotSkeleton({
|
|
|
1327
1333
|
if (!activeFilters || activeFilters.length === 0) return "";
|
|
1328
1334
|
return activeFilters.map((f) => f.column).join(", ");
|
|
1329
1335
|
}, [activeFilters]);
|
|
1336
|
+
const [showFilterTooltip, setShowFilterTooltip] = useState7(false);
|
|
1337
|
+
const filterTooltipDetails = useMemo7(() => {
|
|
1338
|
+
if (!activeFilters || activeFilters.length === 0) return [];
|
|
1339
|
+
return activeFilters.map((f) => {
|
|
1340
|
+
const maxDisplay = 5;
|
|
1341
|
+
const displayValues = f.values.slice(0, maxDisplay);
|
|
1342
|
+
const remaining = f.values.length - maxDisplay;
|
|
1343
|
+
return {
|
|
1344
|
+
column: f.column,
|
|
1345
|
+
values: displayValues,
|
|
1346
|
+
remaining: remaining > 0 ? remaining : 0
|
|
1347
|
+
};
|
|
1348
|
+
});
|
|
1349
|
+
}, [activeFilters]);
|
|
1330
1350
|
const handleDragOver = useCallback7(
|
|
1331
1351
|
(area, event) => {
|
|
1332
1352
|
event.preventDefault();
|
|
@@ -1451,37 +1471,66 @@ function PivotSkeleton({
|
|
|
1451
1471
|
/* @__PURE__ */ jsx3("span", { children: "Pivot Table" })
|
|
1452
1472
|
] }),
|
|
1453
1473
|
/* @__PURE__ */ jsxs3("div", { className: "vpg-header-right", children: [
|
|
1454
|
-
hasActiveFilters && /* @__PURE__ */ jsxs3(
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
"path",
|
|
1474
|
+
hasActiveFilters && /* @__PURE__ */ jsxs3(
|
|
1475
|
+
"div",
|
|
1476
|
+
{
|
|
1477
|
+
className: "vpg-filter-indicator",
|
|
1478
|
+
onMouseEnter: () => setShowFilterTooltip(true),
|
|
1479
|
+
onMouseLeave: () => setShowFilterTooltip(false),
|
|
1480
|
+
children: [
|
|
1481
|
+
/* @__PURE__ */ jsx3(
|
|
1482
|
+
"svg",
|
|
1464
1483
|
{
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1484
|
+
className: "vpg-filter-icon",
|
|
1485
|
+
fill: "none",
|
|
1486
|
+
stroke: "currentColor",
|
|
1487
|
+
viewBox: "0 0 24 24",
|
|
1488
|
+
children: /* @__PURE__ */ jsx3(
|
|
1489
|
+
"path",
|
|
1490
|
+
{
|
|
1491
|
+
strokeLinecap: "round",
|
|
1492
|
+
strokeLinejoin: "round",
|
|
1493
|
+
strokeWidth: 2,
|
|
1494
|
+
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"
|
|
1495
|
+
}
|
|
1496
|
+
)
|
|
1469
1497
|
}
|
|
1470
|
-
)
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1498
|
+
),
|
|
1499
|
+
/* @__PURE__ */ jsxs3("span", { className: "vpg-filter-text", children: [
|
|
1500
|
+
"Filtered: ",
|
|
1501
|
+
/* @__PURE__ */ jsx3("strong", { children: filterSummary }),
|
|
1502
|
+
filteredRowCount !== void 0 && totalRowCount !== void 0 && /* @__PURE__ */ jsxs3("span", { className: "vpg-filter-count", children: [
|
|
1503
|
+
"(",
|
|
1504
|
+
filteredRowCount.toLocaleString(),
|
|
1505
|
+
" of ",
|
|
1506
|
+
totalRowCount.toLocaleString(),
|
|
1507
|
+
" rows)"
|
|
1508
|
+
] })
|
|
1509
|
+
] }),
|
|
1510
|
+
showFilterTooltip && /* @__PURE__ */ jsxs3("div", { className: "vpg-filter-tooltip", children: [
|
|
1511
|
+
/* @__PURE__ */ jsx3("div", { className: "vpg-tooltip-header", children: "Active Filters" }),
|
|
1512
|
+
filterTooltipDetails.map((filter) => /* @__PURE__ */ jsxs3("div", { className: "vpg-tooltip-filter", children: [
|
|
1513
|
+
/* @__PURE__ */ jsx3("div", { className: "vpg-tooltip-column", children: filter.column }),
|
|
1514
|
+
/* @__PURE__ */ jsxs3("div", { className: "vpg-tooltip-values", children: [
|
|
1515
|
+
filter.values.map((val, idx) => /* @__PURE__ */ jsx3("span", { className: "vpg-tooltip-value", children: val }, idx)),
|
|
1516
|
+
filter.remaining > 0 && /* @__PURE__ */ jsxs3("span", { className: "vpg-tooltip-more", children: [
|
|
1517
|
+
"+",
|
|
1518
|
+
filter.remaining,
|
|
1519
|
+
" more"
|
|
1520
|
+
] })
|
|
1521
|
+
] })
|
|
1522
|
+
] }, filter.column)),
|
|
1523
|
+
filteredRowCount !== void 0 && totalRowCount !== void 0 && /* @__PURE__ */ jsxs3("div", { className: "vpg-tooltip-summary", children: [
|
|
1524
|
+
"Showing ",
|
|
1525
|
+
filteredRowCount.toLocaleString(),
|
|
1526
|
+
" of ",
|
|
1527
|
+
totalRowCount.toLocaleString(),
|
|
1528
|
+
" rows"
|
|
1529
|
+
] })
|
|
1530
|
+
] })
|
|
1531
|
+
]
|
|
1532
|
+
}
|
|
1533
|
+
),
|
|
1485
1534
|
isConfigured && /* @__PURE__ */ jsxs3("div", { className: "vpg-config-summary", children: [
|
|
1486
1535
|
/* @__PURE__ */ jsxs3("span", { className: "vpg-summary-badge vpg-rows", children: [
|
|
1487
1536
|
rowFields.length,
|