1import { Controller } from "@hotwired/stimulus" 2import { createPopper } from "@popperjs/core" 3 4/** 5 * @domain ì¤ë²ë ì´ UI 6 * @concern í´í í¨ëì ì´ë¦¼/ë«íê³¼ ìì¹ ê³ì° 7 * @description template ì½í ì¸ ë¥¼ ë³µì í´ bodyì ë¶ì´ê³ Popper.jsë¡ ìì¹ë¥¼ ê³ì°í´ í´íì íìíë©°, ë«ì ë íí¼ ì¸ì¤í´ì¤ì í¨ëì ì 리íë 컨í¸ë¡¤ë¬ 8 */ 9export default class extends Controller { 10 static targets = ["template"] 11 12 show() { 13 if (this.panel || !this.hasTemplateTarget) return 14 15 this.panel = this.templateTarget.content.firstElementChild.cloneNode(true) 16 document.body.appendChild(this.panel) 17 18 this.popper = createPopper(this.element, this.panel, { 19 placement: "bottom", 20 modifiers: [ 21 { name: "offset", options: { offset: [0, 8] } }, 22 { name: "flip", options: { fallbackPlacements: ["top", "left", "right"] } }, 23 { name: "preventOverflow", options: { boundary: document.body } } 24 ] 25 }) 26 } 27 28 hide() { 29 this.popper?.destroy() 30 this.panel?.remove() 31 this.popper = this.panel = null 32 } 33 34 disconnect() { 35 this.hide() 36 } 37}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.