@healthcatalyst/catalyst-docfx-template 1.0.147 → 1.0.148

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@healthcatalyst/catalyst-docfx-template",
3
- "version": "1.0.147",
3
+ "version": "1.0.148",
4
4
  "license": "MIT",
5
5
  "description": "A DocFX Template patching the Default template.",
6
6
  "publishConfig": {
package/styles/main.css CHANGED
@@ -2041,3 +2041,61 @@ article .tabGroup > ul > li {
2041
2041
  .poster-btn,.poster{position:absolute;top:0;left:0;width:100%;height:100%;border:0;padding:0;margin:0;background:none;cursor:pointer;}
2042
2042
  .poster img{width:100%;height:100%;object-fit:cover;display:block;}
2043
2043
  .play-button{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:64px;height:64px;border-radius:50%;background:rgba(0,0,0,0.6);display:flex;align-items:center;justify-content:center;color:white;font-size:24px;pointer-events:none;}
2044
+
2045
+ /* In-topic table search for FAQs, error tables, and other uses */
2046
+
2047
+ .table-search-bar-container {
2048
+ position: relative;
2049
+ width: 100%;
2050
+ margin-bottom: 12px;
2051
+ }
2052
+
2053
+ .table-search-input {
2054
+ width: 100%;
2055
+ padding: 12px 40px 12px 40px;
2056
+ font-size: 16px;
2057
+ border: 1px solid #ddd;
2058
+ }
2059
+
2060
+ .table-search-input.normal {
2061
+ font-size: 16px;
2062
+ }
2063
+
2064
+ .table-search-input.mobile {
2065
+ font-size: 20px;
2066
+ padding: 14px 45px 14px 45px;
2067
+ }
2068
+
2069
+ .table-search-icon {
2070
+ position: absolute;
2071
+ top: 50%;
2072
+ transform: translateY(-50%);
2073
+ font-size: 18px;
2074
+ cursor: pointer;
2075
+ color: #888;
2076
+ }
2077
+
2078
+ #searchIcon {
2079
+ left: 10px;
2080
+ }
2081
+
2082
+ .clear {
2083
+ right: 10px;
2084
+ display: none;
2085
+ }
2086
+
2087
+ #faqTable {
2088
+ border-collapse: collapse;
2089
+ width: 100%;
2090
+ font-size: 18px;
2091
+ }
2092
+ #faqTable th, #faqTable td {
2093
+ text-align: left;
2094
+ padding: 12px;
2095
+ }
2096
+ #faqTable tr {
2097
+ border-bottom: 1px solid #ddd;
2098
+ }
2099
+ #faqTable tr.header, #faqTable tr:hover {
2100
+ background-color: #f1f1f1;
2101
+ }
@@ -0,0 +1,44 @@
1
+ /*Script that allows for filtering/searching content in an faq table in a topic*/
2
+
3
+ let debounceTimeout;
4
+ const debounceDelay = 100; // milliseconds
5
+ const autoSearch = true;
6
+ const showSearchIcon = true;
7
+ const showClearIcon = true;
8
+ const input = document.getElementById("searchInput");
9
+ const clearIcon = document.getElementById("clearIcon");
10
+ const searchIcon = document.getElementById("searchIcon");
11
+
12
+ // Apply initial visibility
13
+ searchIcon.style.display = showSearchIcon ? "block" : "none";
14
+ clearIcon.style.display = showClearIcon ? "none" : "none";
15
+
16
+ // Called on keyup via debounce
17
+ function debouncedSearch() {
18
+ if (!autoSearch || input.disabled) return;
19
+
20
+ clearIcon.style.display = input.value ? "block" : "none";
21
+
22
+ clearTimeout(debounceTimeout);
23
+ debounceTimeout = setTimeout(myFunction, debounceDelay);
24
+ }
25
+
26
+ function myFunction() {
27
+ const filter = input.value.toUpperCase();
28
+ const table = document.getElementById("faqTable");
29
+ const tr = table.getElementsByTagName("tr");
30
+
31
+ for (let i = 1; i < tr.length; i++) {
32
+ const td = tr[i].getElementsByTagName("td")[0];
33
+ if (td) {
34
+ const txtValue = td.textContent || td.innerText;
35
+ tr[i].style.display = txtValue.toUpperCase().indexOf(filter) > -1 ? "" : "none";
36
+ }
37
+ }
38
+ }
39
+
40
+ function clearSearch() {
41
+ input.value = "";
42
+ clearIcon.style.display = "none";
43
+ myFunction();
44
+ }