@limetech/lime-elements 38.46.3 → 38.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -556,6 +556,52 @@ const InputField = class {
556
556
  }
557
557
  this.mdcTextField.disabled = this.disabled || this.readonly;
558
558
  }
559
+ /**
560
+ * Returns the start position of the current text selection.
561
+ * Returns `null` if the input element is not available or if
562
+ * the input type does not support selection (e.g., `number`).
563
+ */
564
+ async getSelectionStart() {
565
+ var _a, _b;
566
+ try {
567
+ return (_b = (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.selectionStart) !== null && _b !== void 0 ? _b : null;
568
+ }
569
+ catch (_c) {
570
+ // Some input types (e.g., number) throw InvalidStateError
571
+ return null;
572
+ }
573
+ }
574
+ /**
575
+ * Returns the end position of the current text selection.
576
+ * Returns `null` if the input element is not available or if
577
+ * the input type does not support selection (e.g., `number`).
578
+ */
579
+ async getSelectionEnd() {
580
+ var _a, _b;
581
+ try {
582
+ return (_b = (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.selectionEnd) !== null && _b !== void 0 ? _b : null;
583
+ }
584
+ catch (_c) {
585
+ // Some input types (e.g., number) throw InvalidStateError
586
+ return null;
587
+ }
588
+ }
589
+ /**
590
+ * Returns the direction of the current text selection.
591
+ * Can be `'forward'`, `'backward'`, or `'none'`.
592
+ * Returns `null` if the input element is not available or if
593
+ * the input type does not support selection (e.g., `number`).
594
+ */
595
+ async getSelectionDirection() {
596
+ var _a, _b;
597
+ try {
598
+ return (_b = (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.selectionDirection) !== null && _b !== void 0 ? _b : null;
599
+ }
600
+ catch (_c) {
601
+ // Some input types (e.g., number) throw InvalidStateError
602
+ return null;
603
+ }
604
+ }
559
605
  render() {
560
606
  const properties = this.getAdditionalProps();
561
607
  properties['aria-labelledby'] = this.labelId;