pollcatch 2.3.2 → 2.3.3

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/pc.js +6 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pollcatch",
3
3
  "private": false,
4
- "version": "2.3.2",
4
+ "version": "2.3.3",
5
5
  "type": "module",
6
6
  "main": "pc.js",
7
7
  "module": "pc.js",
@@ -25,4 +25,4 @@
25
25
  ],
26
26
  "author": "David Lin <david@pollcatch.com>",
27
27
  "homepage": "https://www.pollcatch.com"
28
- }
28
+ }
package/pc.js CHANGED
@@ -1564,10 +1564,15 @@ class Fo {
1564
1564
  }
1565
1565
  /**
1566
1566
  * Determine if stats should be shown
1567
+ * show-stats attribute values:
1568
+ * - undefined: don't show stats (default when attribute is absent)
1569
+ * - 'never': don't show stats
1570
+ * - 'always' or '' (empty/boolean style): always show stats
1571
+ * - 'after-vote': show stats after user interaction
1567
1572
  */
1568
1573
  shouldShowStats() {
1569
1574
  const t = this.host;
1570
- return t.showStats === void 0 || t.showStats === "never" ? !1 : t.showStats === "always" || t.showStats === "" || t.readonly && t.showStats === "after-vote" ? !0 : t.hasEditButton && this.isEditing ? !1 : this.dataController.hasLocalStats() || this.dataController.hasInteracted;
1575
+ return t.showStats === void 0 || t.showStats === "never" ? !1 : t.showStats === "after-vote" ? t.readonly ? !0 : t.hasEditButton && this.isEditing ? !1 : this.dataController.hasLocalStats() || this.dataController.hasInteracted : !0;
1571
1576
  }
1572
1577
  shouldShowFooter() {
1573
1578
  return this.shouldShowSubmitButton() || this.shouldShowStats();