UNPKG

@gsretail.com/gui-core

Version:

A skeleton to create your own React component library using Rollup, TypeScript, Sass and Storybook

2 lines (1 loc) 865 B
import t from"./html-mask-element.js";import e from"../core/holder.js";import"./mask-element.js";class n extends t{get _unsafeSelectionStart(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),n=e&&e.anchorOffset,s=e&&e.focusOffset;return null==s||null==n||n<s?n:s}get _unsafeSelectionEnd(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),n=e&&e.anchorOffset,s=e&&e.focusOffset;return null==s||null==n||n>s?n:s}_unsafeSelect(t,e){if(!this.rootElement.createRange)return;const n=this.rootElement.createRange();n.setStart(this.input.firstChild||this.input,t),n.setEnd(this.input.lastChild||this.input,e);const s=this.rootElement,o=s.getSelection&&s.getSelection();o&&(o.removeAllRanges(),o.addRange(n))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}e.HTMLContenteditableMaskElement=n;export{n as default};