diff --git a/InteractiveHtmlBom/web/ibom.css b/InteractiveHtmlBom/web/ibom.css index cbd0e38e..9c694569 100644 --- a/InteractiveHtmlBom/web/ibom.css +++ b/InteractiveHtmlBom/web/ibom.css @@ -393,6 +393,7 @@ canvas:active { .searchbox { float: left; + min-width: 80px; height: 40px; margin: 10px 5px; padding: 12px 32px; @@ -422,20 +423,36 @@ canvas:active { color: #666; } +.search-row { + display: flex; + flex-wrap: wrap; + width: 100%; +} + .filter { - width: calc(60% - 64px); + flex: 3 1 0; } .reflookup { - width: calc(40% - 10px); + flex: 2 1 0; +} + +.qty-multiplier { + flex: none; + width: 80px; + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath d='M2 2l8 8M10 2l-8 8' stroke='%23888' stroke-width='2'/%3E%3C/svg%3E"); + background-position: 8px center; + padding: 0 4px 0 24px; } -input[type=text]:focus { +input[type=text]:focus, +input[type=number]:focus { background-color: white; border: 1px solid #333; } -.dark input[type=text]:focus { +.dark input[type=text]:focus, +.dark input[type=number]:focus { background-color: #333; border: 1px solid #ccc; } diff --git a/InteractiveHtmlBom/web/ibom.html b/InteractiveHtmlBom/web/ibom.html index a6e5a6d2..048fa4b9 100644 --- a/InteractiveHtmlBom/web/ibom.html +++ b/InteractiveHtmlBom/web/ibom.html @@ -292,12 +292,15 @@
-
+
-
+ +
diff --git a/InteractiveHtmlBom/web/ibom.js b/InteractiveHtmlBom/web/ibom.js index d88a6f86..3eadd2c8 100644 --- a/InteractiveHtmlBom/web/ibom.js +++ b/InteractiveHtmlBom/web/ibom.js @@ -14,6 +14,7 @@ var markedFootprints = new Set(); var highlightedFootprints = []; var highlightedNet = null; var lastClicked; +var qtyMultiplier = 1; function dbg(html) { dbgdiv.innerHTML = html; @@ -726,7 +727,7 @@ function populateBomBody(placeholderColumn = null, placeHolderElements = null) { } else if (column === "Quantity" && settings.bommode == "grouped") { // Quantity td = document.createElement("TD"); - td.textContent = references.length; + td.textContent = references.length * qtyMultiplier; tr.appendChild(td); } else { // All the other fields @@ -857,6 +858,12 @@ function updateFilter(input) { populateBomTable(); } +function updateQtyMultiplier(input) { + var value = parseInt(input); + qtyMultiplier = value > 0 ? value : 1; + populateBomTable(); +} + function updateRefLookup(input) { reflookup = input.toLowerCase(); populateBomTable(); @@ -1062,6 +1069,8 @@ function changeBomMode(mode) { } } + document.getElementById("qty-multiplier").hidden = mode != "grouped"; + writeStorage("bommode", mode); if (mode != settings.bommode) { settings.bommode = mode;