UNPKG

@base-framework/organisms

Version:

This will add default organisms to the base framework.

3 lines (2 loc) 844 B
import{Builder as s,Html as n}from"@base-framework/base";var l=class{static first(t){return this.get(t,0)}static last(t){let e=t.childNodes.length-1;return this.get(t,e)}static get(t,e){return t?.childNodes[e]??null}static next(t){return t?.nextSibling??null}static previous(t){return t?.previousSibling??null}static index(t){if(!t||!t.parentNode)return-1;let e=t.parentNode.children;return Array.from(e).indexOf(t)}static getPreviousIndex(t){let e=this.index(t);return e>0?e-1:0}static replace(t,e,r){if(!e)return;n.removeElementData(e);let i=s.build(t,null,r);e.replaceWith(i)}static remove(t){t&&n.removeChild(t)}static removeAll(t){t&&n.removeAll(t)}static append(t,e,r){t&&s.build(t,e,r)}static prepend(t,e,r){if(!t)return;let i=s.build(t,null,r);e.insertBefore(i,e.firstChild)}};export{l as a}; //# sourceMappingURL=chunk-E5OBFMK5.js.map