(type, config, collection)
| 42 | } |
| 43 | return collection; |
| 44 | }, _disallowInline = (element) => window.getComputedStyle(element).display === "inline" && (element.style.display = "inline-block"), _insertNodeBefore = (newChild, parent, existingChild) => parent.insertBefore(typeof newChild === "string" ? document.createTextNode(newChild) : newChild, existingChild), _getWrapper = (type, config, collection) => { |
| 45 | let className = config[type + "sClass"] || "", { tag = "div", aria = "auto", propIndex = false } = config, display = type === "line" ? "block" : "inline-block", incrementClass = className.indexOf("++") > -1, wrapper = (text) => { |
| 46 | let el = document.createElement(tag), i = collection.length + 1; |
| 47 | className && (el.className = className + (incrementClass ? " " + className + i : "")); |
| 48 | propIndex && el.style.setProperty("--" + type, i + ""); |
| 49 | aria !== "none" && el.setAttribute("aria-hidden", "true"); |
| 50 | if (tag !== "span") { |
| 51 | el.style.position = "relative"; |
| 52 | el.style.display = display; |
| 53 | } |
| 54 | el.textContent = text; |
| 55 | collection.push(el); |
| 56 | return el; |
| 57 | }; |
| 58 | incrementClass && (className = className.replace("++", "")); |
| 59 | wrapper.collection = collection; |
| 60 | return wrapper; |
| 61 | }, _getLineWrapper = (element, nodes, config, collection) => { |
| 62 | let lineWrapper = _getWrapper("line", config, collection), textAlign = window.getComputedStyle(element).textAlign || "left"; |
| 63 | return (startIndex, endIndex) => { |
| 64 | let newLine = lineWrapper(""); |
no outgoing calls
no test coverage detected
searching dependent graphs…