@semcore/bulk-textarea 1.4.2-prerelease.0 → 1.5.0-prerelease.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib/cjs/BulkTextarea.js +35 -38
  3. package/lib/cjs/BulkTextarea.js.map +1 -1
  4. package/lib/cjs/BulkTextarea.types.js.map +1 -1
  5. package/lib/cjs/components/ClearAll.js +2 -2
  6. package/lib/cjs/components/ClearAll.js.map +1 -1
  7. package/lib/cjs/components/Counter.js +5 -5
  8. package/lib/cjs/components/Counter.js.map +1 -1
  9. package/lib/cjs/components/ErrorsNavigation.js +14 -14
  10. package/lib/cjs/components/ErrorsNavigation.js.map +1 -1
  11. package/lib/cjs/components/InputField/InputField.js +219 -167
  12. package/lib/cjs/components/InputField/InputField.js.map +1 -1
  13. package/lib/cjs/components/InputField/InputField.types.js.map +1 -1
  14. package/lib/cjs/components/InputField/inputField.shadow.css +70 -32
  15. package/lib/cjs/index.js +1 -1
  16. package/lib/cjs/index.js.map +1 -1
  17. package/lib/cjs/translations/__intergalactic-dynamic-locales.js +4 -5
  18. package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
  19. package/lib/es6/BulkTextarea.js +31 -32
  20. package/lib/es6/BulkTextarea.js.map +1 -1
  21. package/lib/es6/BulkTextarea.types.js.map +1 -1
  22. package/lib/es6/components/ClearAll.js +2 -2
  23. package/lib/es6/components/ClearAll.js.map +1 -1
  24. package/lib/es6/components/Counter.js +2 -2
  25. package/lib/es6/components/Counter.js.map +1 -1
  26. package/lib/es6/components/ErrorsNavigation.js +10 -10
  27. package/lib/es6/components/ErrorsNavigation.js.map +1 -1
  28. package/lib/es6/components/InputField/InputField.js +219 -165
  29. package/lib/es6/components/InputField/InputField.js.map +1 -1
  30. package/lib/es6/components/InputField/InputField.types.js.map +1 -1
  31. package/lib/es6/components/InputField/inputField.shadow.css +70 -32
  32. package/lib/es6/index.js.map +1 -1
  33. package/lib/es6/translations/__intergalactic-dynamic-locales.js +2 -2
  34. package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
  35. package/lib/esm/BulkTextarea.mjs +33 -35
  36. package/lib/esm/components/ClearAll.mjs +1 -1
  37. package/lib/esm/components/Counter.mjs +2 -2
  38. package/lib/esm/components/ErrorsNavigation.mjs +4 -4
  39. package/lib/esm/components/InputField/InputField.mjs +181 -136
  40. package/lib/esm/components/InputField/inputField.shadow.css +70 -32
  41. package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -2
  42. package/lib/types/BulkTextarea.d.ts +1 -1
  43. package/lib/types/BulkTextarea.types.d.ts +113 -8
  44. package/lib/types/components/ClearAll.d.ts +2 -2
  45. package/lib/types/components/Counter.d.ts +4 -4
  46. package/lib/types/components/ErrorsNavigation.d.ts +2 -2
  47. package/lib/types/components/InputField/InputField.d.ts +12 -7
  48. package/lib/types/components/InputField/InputField.types.d.ts +11 -125
  49. package/package.json +10 -10
@@ -1,84 +1,98 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
3
2
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
+ import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
4
4
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
5
5
  import _createClass from "@babel/runtime/helpers/esm/createClass";
6
- import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
6
+ import _callSuper from "@babel/runtime/helpers/esm/callSuper";
7
7
  import _inherits from "@babel/runtime/helpers/esm/inherits";
8
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
9
8
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
10
- import { sstyled } from "@semcore/utils/lib/core/index";
11
- import { sstyled as sstyled$1, assignProps, Component } from "@semcore/core";
12
- import React from "react";
13
- import { Box } from "@semcore/flex-box";
9
+ import { sstyled, assignProps, Component } from "@semcore/core";
10
+ import { Box } from "@semcore/base-components";
11
+ import { extractAriaProps } from "@semcore/core/lib/utils/ariaProps";
12
+ import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
14
13
  import Tooltip from "@semcore/tooltip";
15
- import { extractAriaProps } from "@semcore/utils/lib/ariaProps";
16
- import uniqueIDEnhancement from "@semcore/utils/lib/uniqueID";
17
14
  import DOMPurify from "dompurify";
15
+ import React from "react";
18
16
  /*!__reshadow-styles__:"./inputField.shadow.css"*/
19
17
  var style = (
20
18
  /*__reshadow_css_start__*/
21
19
  (sstyled.insert(
22
20
  /*__inner_css_start__*/
23
- '.___SInputField_1vc4q_gg_>div{box-sizing:content-box;outline:0;border-radius:var(--intergalactic-control-rounded, 6px);border-color:var(--intergalactic-border-primary, #c4c7cf);border-style:solid;border-width:1px;overflow:auto;position:relative;background-color:var(--intergalactic-bg-primary-neutral, #ffffff);color:var(--intergalactic-text-primary, #191b23);word-wrap:break-word;word-break:break-word;font-family:inherit}.___SInputField_1vc4q_gg_>div:empty::before{content:"1. "attr(placeholder);color:var(--intergalactic-text-placeholder, #8a8e9b);position:absolute}.___SInputField_1vc4q_gg_>div:nth-child(even){color:red;counter-increment:row;margin-bottom:var(--intergalactic-spacing-1x, 4px);position:relative;word-break:break-all}.___SInputField_1vc4q_gg_>div:nth-child(even)::before{content:counter(row)".";display:inline-block;white-space:nowrap;text-align:right;color:var(--intergalactic-text-secondary, #6c6e79);margin-right:var(--intergalactic-spacing-1x, 4px)}.___SInputField_1vc4q_gg_>div>p{counter-increment:row;margin:0 0 var(--intergalactic-spacing-1x, 4px)0;position:relative;word-break:break-all;white-space:pre-wrap;padding:0 var(--intergalactic-spacing-5x, 20px)0 var(--intergalactic-spacing-4x, 16px)}.___SInputField_1vc4q_gg_>div>p:last-of-type{margin-bottom:0}.___SInputField_1vc4q_gg_>div>p:not(:empty)::before{content:counter(row)".";display:inline-block;white-space:nowrap;text-align:right;color:var(--intergalactic-text-secondary, #6c6e79);margin-right:var(--intergalactic-spacing-1x, 4px);position:absolute;left:0}.___SInputField_1vc4q_gg_>div>p[data-over-max-rows=true]{background-color:var(--intergalactic-bg-secondary-critical, #fff0f7)}.___SInputField_1vc4q_gg_>div:has(p:nth-child(n+10))>p{padding-left:var(--intergalactic-spacing-6x, 24px)}.___SInputField_1vc4q_gg_>div:has(p:nth-child(n+10))>p:nth-child(-n+9)::before{padding-left:var(--intergalactic-spacing-2x, 8px)}.___SInputField_1vc4q_gg_>div:has(p:nth-child(n+100))>p{padding-left:var(--intergalactic-spacing-8x, 32px)}.___SInputField_1vc4q_gg_>div:has(p:nth-child(n+100))>p:nth-child(-n+9)::before{padding-left:var(--intergalactic-spacing-4x, 16px)}.___SInputField_1vc4q_gg_>div:has(p:nth-child(n+100))>p:nth-child(n+10)::before{padding-left:var(--intergalactic-spacing-2x, 8px)}.___SInputField_1vc4q_gg_>div:has(p:nth-child(n+100))>p:nth-child(n+100)::before{padding-left:0}.___SInputField_1vc4q_gg_.__showErrors_1vc4q_gg_>div[aria-invalid]>p[aria-invalid]:after{content:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBmaWxsPSIjZDEwMDJmIj48cGF0aCBkPSJNNyA2aDJ2NEg3VjZabTIgN3YtMkg3djJoMloiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYuMTUyIDEuMTcyYy43MTktMS41NjMgMi45NzctMS41NjMgMy42OTYgMGw2LjA0MyAxMy4xNDFjLjM2My43OTEtLjIyNSAxLjY4Ny0xLjEwOSAxLjY4N0gxLjIxOGMtLjg4NCAwLTEuNDcyLS44OTYtMS4xMDktMS42ODdMNi4xNTIgMS4xNzJabTcuMzc0IDEyLjgzN0w4IDEuOTkgMi40NzQgMTQuMDFoMTEuMDUyWiIvPjwvc3ZnPgo=\\ );position:absolute;right:0;top:var(--intergalactic-spacing-05x, 2px)}.___SInputField_1vc4q_gg_._size_m_1vc4q_gg_>div{padding:var(--intergalactic-spacing-2x, 8px) var(--intergalactic-spacing-4x, 16px);font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%);min-height:calc(var(--minRows_1vc4q)*20px);max-height:calc((var(--maxRows_1vc4q) - 1)*(20px + var(--intergalactic-spacing-1x, 4px)) + 18px)}.___SInputField_1vc4q_gg_._size_m_1vc4q_gg_>div:empty{padding-left:var(--intergalactic-spacing-8x, 32px)}.___SInputField_1vc4q_gg_._size_l_1vc4q_gg_>div:empty::before,.___SInputField_1vc4q_gg_._size_m_1vc4q_gg_>div:empty::before{left:var(--intergalactic-spacing-4x, 16px)}.___SInputField_1vc4q_gg_._size_l_1vc4q_gg_>div{padding:var(--intergalactic-spacing-3x, 12px) var(--intergalactic-spacing-4x, 16px);font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%);min-height:calc(var(--minRows_1vc4q)*24px);max-height:calc((var(--maxRows_1vc4q) - 1)*(24px + var(--intergalactic-spacing-1x, 4px)) + 20px)}.___SInputField_1vc4q_gg_._size_l_1vc4q_gg_>div:empty{padding-left:calc(var(--intergalactic-spacing-8x, 32px) + var(--intergalactic-spacing-05x, 2px))}.___SInputField_1vc4q_gg_._state_normal_1vc4q_gg_:not(.__disabled_1vc4q_gg_)>div:focus:focus{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));border-color:var(--intergalactic-border-info-active, #006dca)}.___SInputField_1vc4q_gg_._state_valid_1vc4q_gg_>div{border-color:var(--intergalactic-border-success-active, #007c65)}.___SInputField_1vc4q_gg_._state_valid_1vc4q_gg_>div:focus{box-shadow:var(--intergalactic-keyboard-focus-valid, 0px 0px 0px 3px rgba(0, 159, 129, 0.5))}.___SInputField_1vc4q_gg_._state_invalid_1vc4q_gg_>div{border-color:var(--intergalactic-border-critical-active, #d1002f);background-image:var(--intergalactic-border-critical-pattern, repeating-linear-gradient(315deg, rgba(209, 0, 47, 1) 0, rgba(209, 0, 47, 1) 2px, transparent 0, transparent 50%));background-size:6px 6px;background-color:var(--intergalactic-bg-primary-neutral, #ffffff);border-bottom-left-radius:var(--intergalactic-control-rounded, 6px);border-top-left-radius:var(--intergalactic-control-rounded, 6px);background-repeat:repeat-y}.___SInputField_1vc4q_gg_._state_invalid_1vc4q_gg_>div:focus{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SInputField_1vc4q_gg_.__readonly_1vc4q_gg_>div{background-color:var(--intergalactic-bg-secondary-neutral, #f4f5f9)}.___SInputField_1vc4q_gg_.__disabled_1vc4q_gg_>div{opacity:var(--intergalactic-disabled-opacity, 0.3)}',
21
+ '.___SInputField_w0knh_gg_>div{box-sizing:content-box;outline:0;border-radius:var(--intergalactic-control-rounded, 6px);border-color:var(--intergalactic-border-primary, rgba(0, 12, 8, 0.161));border-style:solid;border-width:1px;overflow:auto;position:relative;background-color:var(--intergalactic-bg-primary-neutral, rgb(255, 255, 255));color:var(--intergalactic-text-primary, rgba(1, 5, 0, 0.899));word-wrap:break-word;word-break:break-word;font-family:inherit}@supports (color:color(display-p3 0 0 0%)){.___SInputField_w0knh_gg_>div{border-color:var(--intergalactic-border-primary, rgba(0, 12, 8, 0.161))}@media (color-gamut:p3){.___SInputField_w0knh_gg_>div{border-color:var(--intergalactic-border-primary, color(display-p3 0.00798 0.04498 0.03219 / 0.161))}}}.___SInputField_w0knh_gg_>div:empty::before{content:"1. "attr(placeholder);color:var(--intergalactic-text-placeholder, rgba(0, 5, 2, 0.457));position:absolute}.___SInputField_w0knh_gg_>div:nth-child(even){color:red;counter-increment:row;margin-bottom:var(--intergalactic-spacing-1x, 4px);position:relative;word-break:break-all}.___SInputField_w0knh_gg_>div:nth-child(even)::before{content:counter(row)".";display:inline-block;white-space:nowrap;text-align:right;color:var(--intergalactic-text-secondary, rgba(0, 3, 0, 0.583));margin-right:var(--intergalactic-spacing-1x, 4px)}@supports (color:color(display-p3 0 0 0%)){.___SInputField_w0knh_gg_>div:nth-child(even)::before{color:var(--intergalactic-text-secondary, rgba(0, 3, 0, 0.583))}@media (color-gamut:p3){.___SInputField_w0knh_gg_>div:nth-child(even)::before{color:var(--intergalactic-text-secondary, color(display-p3 0.00228 0.01289 0.00252 / 0.583))}}}.___SInputField_w0knh_gg_>div>p{counter-increment:row;margin:0 0 var(--intergalactic-spacing-1x, 4px)0;position:relative;word-break:break-all;white-space:pre-wrap;padding:0 var(--intergalactic-spacing-5x, 20px)0 var(--intergalactic-spacing-4x, 16px)}.___SInputField_w0knh_gg_>div>p:last-of-type{margin-bottom:0}.___SInputField_w0knh_gg_>div>p:not(:empty)::before{content:counter(row)".";display:inline-block;white-space:nowrap;text-align:right;color:var(--intergalactic-text-secondary, rgba(0, 3, 0, 0.583));margin-right:var(--intergalactic-spacing-1x, 4px);position:absolute;left:0}@supports (color:color(display-p3 0 0 0%)){.___SInputField_w0knh_gg_>div>p:not(:empty)::before{color:var(--intergalactic-text-secondary, rgba(0, 3, 0, 0.583))}@media (color-gamut:p3){.___SInputField_w0knh_gg_>div>p:not(:empty)::before{color:var(--intergalactic-text-secondary, color(display-p3 0.00228 0.01289 0.00252 / 0.583))}}}.___SInputField_w0knh_gg_>div>p[data-over-max-rows=true]{background-color:var(--intergalactic-bg-secondary-critical, rgb(255, 235, 239))}@supports (color:color(display-p3 0 0 0%)){.___SInputField_w0knh_gg_>div>p[data-over-max-rows=true]{background-color:var(--intergalactic-bg-secondary-critical, rgb(255, 235, 239))}@media (color-gamut:p3){.___SInputField_w0knh_gg_>div>p[data-over-max-rows=true]{background-color:var(--intergalactic-bg-secondary-critical, color(display-p3 1 0.92002 0.9342))}}}.___SInputField_w0knh_gg_>div:has(p:nth-child(n+10))>p{padding-left:var(--intergalactic-spacing-6x, 24px)}.___SInputField_w0knh_gg_>div:has(p:nth-child(n+10))>p:nth-child(-n+9)::before{padding-left:var(--intergalactic-spacing-2x, 8px)}.___SInputField_w0knh_gg_>div:has(p:nth-child(n+100))>p{padding-left:var(--intergalactic-spacing-8x, 32px)}.___SInputField_w0knh_gg_>div:has(p:nth-child(n+100))>p:nth-child(-n+9)::before{padding-left:var(--intergalactic-spacing-4x, 16px)}.___SInputField_w0knh_gg_>div:has(p:nth-child(n+100))>p:nth-child(n+10)::before{padding-left:var(--intergalactic-spacing-2x, 8px)}.___SInputField_w0knh_gg_>div:has(p:nth-child(n+100))>p:nth-child(n+100)::before{padding-left:0}.___SInputField_w0knh_gg_>div:has(p:nth-child(n+1000))>p{padding-left:calc(var(--intergalactic-spacing-10x, 40px) + var(--intergalactic-spacing-1x, 4px))}.___SInputField_w0knh_gg_>div:has(p:nth-child(n+1000))>p:nth-child(-n+9)::before{padding-left:var(--intergalactic-spacing-6x, 24px)}.___SInputField_w0knh_gg_>div:has(p:nth-child(n+1000))>p:nth-child(n+10)::before{padding-left:var(--intergalactic-spacing-4x, 16px)}.___SInputField_w0knh_gg_>div:has(p:nth-child(n+1000))>p:nth-child(n+100)::before{padding-left:var(--intergalactic-spacing-2x, 8px)}.___SInputField_w0knh_gg_>div:has(p:nth-child(n+1000))>p:nth-child(n+1000)::before{padding-left:0}.___SInputField_w0knh_gg_.__showErrors_w0knh_gg_>div[aria-invalid]>p[aria-invalid]:after{content:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBmaWxsPSIjZDEwMDJmIj48cGF0aCBkPSJNNyA2aDJ2NEg3VjZabTIgN3YtMkg3djJoMloiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYuMTUyIDEuMTcyYy43MTktMS41NjMgMi45NzctMS41NjMgMy42OTYgMGw2LjA0MyAxMy4xNDFjLjM2My43OTEtLjIyNSAxLjY4Ny0xLjEwOSAxLjY4N0gxLjIxOGMtLjg4NCAwLTEuNDcyLS44OTYtMS4xMDktMS42ODdMNi4xNTIgMS4xNzJabTcuMzc0IDEyLjgzN0w4IDEuOTkgMi40NzQgMTQuMDFoMTEuMDUyWiIvPjwvc3ZnPgo=\\ );position:absolute;right:0;top:var(--intergalactic-spacing-05x, 2px)}.___SInputField_w0knh_gg_._size_m_w0knh_gg_>div{padding:var(--intergalactic-spacing-2x, 8px) var(--intergalactic-spacing-4x, 16px);font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%);min-height:calc(var(--minRows_w0knh)*20px);max-height:calc((var(--maxRows_w0knh) - 1)*(20px + var(--intergalactic-spacing-1x, 4px)) + 18px)}.___SInputField_w0knh_gg_._size_m_w0knh_gg_>div:empty{padding-left:var(--intergalactic-spacing-8x, 32px)}.___SInputField_w0knh_gg_._size_l_w0knh_gg_>div:empty::before,.___SInputField_w0knh_gg_._size_m_w0knh_gg_>div:empty::before{left:var(--intergalactic-spacing-4x, 16px)}.___SInputField_w0knh_gg_._size_l_w0knh_gg_>div{padding:var(--intergalactic-spacing-3x, 12px) var(--intergalactic-spacing-4x, 16px);font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%);min-height:calc(var(--minRows_w0knh)*24px);max-height:calc((var(--maxRows_w0knh) - 1)*(24px + var(--intergalactic-spacing-1x, 4px)) + 20px)}.___SInputField_w0knh_gg_._size_l_w0knh_gg_>div:empty{padding-left:calc(var(--intergalactic-spacing-8x, 32px) + var(--intergalactic-spacing-05x, 2px))}.___SInputField_w0knh_gg_._state_normal_w0knh_gg_:not(.__disabled_w0knh_gg_)>div:focus{border-color:var(--intergalactic-border-info-active, rgba(0, 22, 195, 0.386));outline-color:var(--intergalactic-keyboard-focus-outline, #008ff8);outline-style:solid;outline-width:2px;transition-duration:calc(var(--intergalactic-duration-extra-fast, 100)*1ms);transition-timing-function:ease-in-out;outline-offset:0;transition-property:outline-color,outline-width}@supports (color:color(display-p3 0 0 0%)){.___SInputField_w0knh_gg_._state_normal_w0knh_gg_:not(.__disabled_w0knh_gg_)>div:focus{border-color:var(--intergalactic-border-info-active, rgba(0, 22, 195, 0.386))}@media (color-gamut:p3){.___SInputField_w0knh_gg_._state_normal_w0knh_gg_:not(.__disabled_w0knh_gg_)>div:focus{border-color:var(--intergalactic-border-info-active, color(display-p3 0.01805 0.08334 0.73488 / 0.386))}}}.___SInputField_w0knh_gg_._state_valid_w0knh_gg_>div{border-color:var(--intergalactic-border-success-active, rgb(0, 204, 154))}@supports (color:color(display-p3 0 0 0%)){.___SInputField_w0knh_gg_._state_valid_w0knh_gg_>div{border-color:var(--intergalactic-border-success-active, rgb(0, 204, 154))}@media (color-gamut:p3){.___SInputField_w0knh_gg_._state_valid_w0knh_gg_>div{border-color:var(--intergalactic-border-success-active, color(display-p3 0.36013 0.78771 0.61714))}}}.___SInputField_w0knh_gg_._state_valid_w0knh_gg_>div:focus{border-color:var(--intergalactic-border-success-active, rgb(0, 204, 154));outline-color:var(--intergalactic-keyboard-focus-outline, #008ff8);outline-style:solid;outline-width:2px;transition-duration:calc(var(--intergalactic-duration-extra-fast, 100)*1ms);transition-timing-function:ease-in-out;outline-offset:0;transition-property:outline-color,outline-width}@supports (color:color(display-p3 0 0 0%)){.___SInputField_w0knh_gg_._state_valid_w0knh_gg_>div:focus{border-color:var(--intergalactic-border-success-active, rgb(0, 204, 154))}@media (color-gamut:p3){.___SInputField_w0knh_gg_._state_valid_w0knh_gg_>div:focus{border-color:var(--intergalactic-border-success-active, color(display-p3 0.36013 0.78771 0.61714))}}}@supports (color:oklab(0%0 0%)){.___SInputField_w0knh_gg_._state_valid_w0knh_gg_>div:focus{outline-color:var(--intergalactic-keyboard-focus-valid-outline, rgb(0, 190, 142))}@media (color-gamut:p3){.___SInputField_w0knh_gg_._state_valid_w0knh_gg_>div:focus{outline-color:var(--intergalactic-keyboard-focus-valid-outline, oklch(0.711 0.146 166.9))}}}.___SInputField_w0knh_gg_._state_invalid_w0knh_gg_>div{border-color:var(--intergalactic-border-critical-active, rgba(255, 0, 4, 0.56));background-image:var(--intergalactic-border-critical-pattern, repeating-linear-gradient(315deg, rgba(255, 0, 4, 0.56) 0, rgba(255, 0, 4, 0.56) 1px, transparent 0, transparent 50%));background-size:6px 6px;background-color:var(--intergalactic-bg-primary-neutral, rgb(255, 255, 255));border-bottom-left-radius:var(--intergalactic-control-rounded, 6px);border-top-left-radius:var(--intergalactic-control-rounded, 6px);background-repeat:repeat-y}@supports (color:color(display-p3 0 0 0%)){.___SInputField_w0knh_gg_._state_invalid_w0knh_gg_>div{border-color:var(--intergalactic-border-critical-active, rgba(255, 0, 4, 0.56));background-image:var(--intergalactic-border-critical-pattern, repeating-linear-gradient(315deg, rgba(255, 0, 4, 0.56) 0, rgba(255, 0, 4, 0.56) 1px, transparent 0, transparent 50%))}@media (color-gamut:p3){.___SInputField_w0knh_gg_._state_invalid_w0knh_gg_>div{border-color:var(--intergalactic-border-critical-active, color(display-p3 0.918 0.19866 0.14259 / 0.56));background-image:var(--intergalactic-border-critical-pattern, repeating-linear-gradient(315deg, color(display-p3 0.918 0.19866 0.14259 / 0.56) 0, color(display-p3 0.918 0.19866 0.14259 / 0.56) 1px, transparent 0, transparent 50%))}}}.___SInputField_w0knh_gg_._state_invalid_w0knh_gg_>div:focus{border-color:var(--intergalactic-border-critical-active, rgba(255, 0, 4, 0.56));outline-color:var(--intergalactic-keyboard-focus-outline, #008ff8);outline-style:solid;outline-width:2px;transition-duration:calc(var(--intergalactic-duration-extra-fast, 100)*1ms);transition-timing-function:ease-in-out;outline-offset:0;transition-property:outline-color,outline-width}@supports (color:color(display-p3 0 0 0%)){.___SInputField_w0knh_gg_._state_invalid_w0knh_gg_>div:focus{border-color:var(--intergalactic-border-critical-active, rgba(255, 0, 4, 0.56))}@media (color-gamut:p3){.___SInputField_w0knh_gg_._state_invalid_w0knh_gg_>div:focus{border-color:var(--intergalactic-border-critical-active, color(display-p3 0.918 0.19866 0.14259 / 0.56))}}}@supports (color:oklab(0%0 0%)){.___SInputField_w0knh_gg_._state_invalid_w0knh_gg_>div:focus{outline-color:var(--intergalactic-keyboard-focus-invalid-outline, oklch(0.628 0.257 28.9 / 0.652))}}.___SInputField_w0knh_gg_.__readonly_w0knh_gg_>div{background-color:var(--intergalactic-bg-secondary-neutral, rgb(248, 249, 248))}.___SInputField_w0knh_gg_.__disabled_w0knh_gg_>div{opacity:var(--intergalactic-disabled-opacity, 0.4)}',
24
22
  /*__inner_css_end__*/
25
- "1vc4q_gg_"
23
+ "w0knh_gg_"
26
24
  ), /*__reshadow_css_end__*/
27
25
  {
28
- "__SInputField": "___SInputField_1vc4q_gg_",
29
- "_showErrors": "__showErrors_1vc4q_gg_",
30
- "_readonly": "__readonly_1vc4q_gg_",
31
- "_disabled": "__disabled_1vc4q_gg_",
32
- "_size_m": "_size_m_1vc4q_gg_",
33
- "--minRows": "--minRows_1vc4q",
34
- "--maxRows": "--maxRows_1vc4q",
35
- "_size_l": "_size_l_1vc4q_gg_",
36
- "_state_normal": "_state_normal_1vc4q_gg_",
37
- "_state_valid": "_state_valid_1vc4q_gg_",
38
- "_state_invalid": "_state_invalid_1vc4q_gg_"
26
+ "__SInputField": "___SInputField_w0knh_gg_",
27
+ "_showErrors": "__showErrors_w0knh_gg_",
28
+ "_readonly": "__readonly_w0knh_gg_",
29
+ "_disabled": "__disabled_w0knh_gg_",
30
+ "_size_m": "_size_m_w0knh_gg_",
31
+ "--minRows": "--minRows_w0knh",
32
+ "--maxRows": "--maxRows_w0knh",
33
+ "_size_l": "_size_l_w0knh_gg_",
34
+ "_state_normal": "_state_normal_w0knh_gg_",
35
+ "_state_valid": "_state_valid_w0knh_gg_",
36
+ "_state_invalid": "_state_invalid_w0knh_gg_"
39
37
  })
40
38
  );
41
- var InputField = /* @__PURE__ */ function(_Component) {
42
- _inherits(InputField2, _Component);
43
- var _super = _createSuper(InputField2);
39
+ var InputField = /* @__PURE__ */ (function(_Component) {
44
40
  function InputField2(props) {
45
41
  var _this;
46
42
  _classCallCheck(this, InputField2);
47
- _this = _super.call(this, props);
48
- _defineProperty(_assertThisInitialized(_this), "delimiter", "\n");
49
- _defineProperty(_assertThisInitialized(_this), "skipEmptyLines", true);
50
- _defineProperty(_assertThisInitialized(_this), "emptyLineValue", "");
51
- _defineProperty(_assertThisInitialized(_this), "spaceLineValue", " ");
52
- _defineProperty(_assertThisInitialized(_this), "containerRef", /* @__PURE__ */ React.createRef());
53
- _defineProperty(_assertThisInitialized(_this), "textarea", void 0);
54
- _defineProperty(_assertThisInitialized(_this), "popper", null);
55
- _defineProperty(_assertThisInitialized(_this), "setPopperTrigger", null);
56
- _defineProperty(_assertThisInitialized(_this), "errorByInteraction", null);
57
- _defineProperty(_assertThisInitialized(_this), "changeTriggerTimeout", 0);
58
- _defineProperty(_assertThisInitialized(_this), "isScrolling", false);
59
- _defineProperty(_assertThisInitialized(_this), "scrollingTimeout", 0);
60
- _defineProperty(_assertThisInitialized(_this), "toggleErrorsPopperTimeout", 0);
61
- _defineProperty(_assertThisInitialized(_this), "isFocusing", false);
62
- _defineProperty(_assertThisInitialized(_this), "linesCountTimeout", 0);
63
- _defineProperty(_assertThisInitialized(_this), "state", {
43
+ _this = _callSuper(this, InputField2, [props]);
44
+ _defineProperty(_this, "delimiter", "\n");
45
+ _defineProperty(_this, "skipEmptyLines", true);
46
+ _defineProperty(_this, "emptyLineValue", "");
47
+ _defineProperty(_this, "spaceLineValue", " ");
48
+ _defineProperty(_this, "containerRef", /* @__PURE__ */ React.createRef());
49
+ _defineProperty(_this, "textarea", void 0);
50
+ _defineProperty(_this, "popper", null);
51
+ _defineProperty(_this, "setPopperTrigger", null);
52
+ _defineProperty(_this, "errorByInteraction", null);
53
+ _defineProperty(_this, "changeTriggerTimeout", 0);
54
+ _defineProperty(_this, "isScrolling", false);
55
+ _defineProperty(_this, "scrollingTimeout", 0);
56
+ _defineProperty(_this, "toggleErrorsPopperTimeout", 0);
57
+ _defineProperty(_this, "isFocusing", false);
58
+ _defineProperty(_this, "linesCountTimeout", 0);
59
+ _defineProperty(_this, "observer", void 0);
60
+ _defineProperty(_this, "state", {
64
61
  visibleErrorPopper: false,
65
62
  keyboardLineIndex: -1,
66
63
  mouseLineIndex: -1
67
64
  });
68
- _this.handlePaste = _this.handlePaste.bind(_assertThisInitialized(_this));
69
- _this.handleChange = _this.handleChange.bind(_assertThisInitialized(_this));
70
- _this.handleFocus = _this.handleFocus.bind(_assertThisInitialized(_this));
71
- _this.handleBlur = _this.handleBlur.bind(_assertThisInitialized(_this));
72
- _this.handleKeyDown = _this.handleKeyDown.bind(_assertThisInitialized(_this));
73
- _this.handleMouseDown = _this.handleMouseDown.bind(_assertThisInitialized(_this));
74
- _this.handleMouseMove = _this.handleMouseMove.bind(_assertThisInitialized(_this));
75
- _this.handleMouseLeave = _this.handleMouseLeave.bind(_assertThisInitialized(_this));
76
- _this.handleScroll = _this.handleScroll.bind(_assertThisInitialized(_this));
77
- _this.handleSelectAll = _this.handleSelectAll.bind(_assertThisInitialized(_this));
65
+ _this.handlePaste = _this.handlePaste.bind(_this);
66
+ _this.handleChange = _this.handleChange.bind(_this);
67
+ _this.handleFocus = _this.handleFocus.bind(_this);
68
+ _this.handleBlur = _this.handleBlur.bind(_this);
69
+ _this.handleKeyDown = _this.handleKeyDown.bind(_this);
70
+ _this.handleMouseDown = _this.handleMouseDown.bind(_this);
71
+ _this.handleMouseMove = _this.handleMouseMove.bind(_this);
72
+ _this.handleMouseLeave = _this.handleMouseLeave.bind(_this);
73
+ _this.handleScroll = _this.handleScroll.bind(_this);
74
+ _this.handleSelectAll = _this.handleSelectAll.bind(_this);
78
75
  _this.textarea = _this.createContentEditableElement(props);
76
+ _this.observer = new MutationObserver(function(mutationsList, observer) {
77
+ var _iterator = _createForOfIteratorHelper(mutationsList), _step;
78
+ try {
79
+ for (_iterator.s(); !(_step = _iterator.n()).done; ) {
80
+ var mutation = _step.value;
81
+ if (mutation.type === "characterData" || mutation.type === "childList") {
82
+ var _this$props$onImmedia, _this$props, _this$textarea$textCo;
83
+ (_this$props$onImmedia = (_this$props = _this.props).onImmediatelyChange) === null || _this$props$onImmedia === void 0 || _this$props$onImmedia.call(_this$props, _this.getValues(), (_this$textarea$textCo = _this.textarea.textContent) !== null && _this$textarea$textCo !== void 0 ? _this$textarea$textCo : "");
84
+ }
85
+ }
86
+ } catch (err) {
87
+ _iterator.e(err);
88
+ } finally {
89
+ _iterator.f();
90
+ }
91
+ });
79
92
  return _this;
80
93
  }
81
- _createClass(InputField2, [{
94
+ _inherits(InputField2, _Component);
95
+ return _createClass(InputField2, [{
82
96
  key: "uncontrolledProps",
83
97
  value: function uncontrolledProps() {
84
98
  return {
@@ -90,22 +104,54 @@ var InputField = /* @__PURE__ */ function(_Component) {
90
104
  }, {
91
105
  key: "componentDidMount",
92
106
  value: function componentDidMount() {
93
- var _this$containerRef$cu;
94
- (_this$containerRef$cu = this.containerRef.current) === null || _this$containerRef$cu === void 0 ? void 0 : _this$containerRef$cu.append(this.textarea);
107
+ var _this$containerRef$cu, _this2 = this;
108
+ var _this$asProps = this.asProps, autoFocus = _this$asProps.autoFocus, disabled = _this$asProps.disabled, readonly = _this$asProps.readonly;
109
+ (_this$containerRef$cu = this.containerRef.current) === null || _this$containerRef$cu === void 0 || _this$containerRef$cu.append(this.textarea);
95
110
  this.handleValueOutChange();
111
+ var config = {
112
+ childList: true,
113
+ characterData: true,
114
+ subtree: true
115
+ };
116
+ if (this.props.onImmediatelyChange) {
117
+ this.observer.observe(this.textarea, config);
118
+ }
119
+ if (autoFocus && !disabled) {
120
+ setTimeout(function() {
121
+ return _this2.textarea.focus();
122
+ }, 10);
123
+ }
96
124
  }
97
125
  }, {
98
126
  key: "componentDidUpdate",
99
127
  value: function componentDidUpdate(prevProps, prevState) {
100
- var _this2 = this;
101
- var _this$props = this.props, value = _this$props.value, errors = _this$props.errors, errorIndex = _this$props.errorIndex, showErrors = _this$props.showErrors, disabled = _this$props.disabled, readonly = _this$props.readonly, highlightErrorIndex = _this$props.highlightErrorIndex, lineProcessing = _this$props.lineProcessing, _this$props$ariaDesc = _this$props["aria-describedby"], ariaDescribedby = _this$props$ariaDesc === void 0 ? "" : _this$props$ariaDesc;
128
+ var _this3 = this;
129
+ var _this$props2 = this.props, value = _this$props2.value, errors = _this$props2.errors, errorIndex = _this$props2.errorIndex, showErrors = _this$props2.showErrors, disabled = _this$props2.disabled, readonly = _this$props2.readonly, highlightErrorIndex = _this$props2.highlightErrorIndex, lineProcessing = _this$props2.lineProcessing, _this$props2$ariaDes = _this$props2["aria-describedby"], ariaDescribedby = _this$props2$ariaDes === void 0 ? "" : _this$props2$ariaDes;
102
130
  if (prevProps.value !== value) {
103
131
  var currentValue = this.getValues().join(this.delimiter);
104
132
  if (typeof value === "string" ? value !== currentValue : value.join(this.delimiter) !== currentValue) {
105
133
  this.handleValueOutChange();
106
134
  }
107
135
  }
108
- if (prevProps.showErrors !== showErrors || prevProps.errors.length !== errors.length) {
136
+ if (prevProps.showErrors !== showErrors || prevProps.errors !== errors) {
137
+ if (showErrors) {
138
+ var errorsMap = /* @__PURE__ */ new Map();
139
+ errors.forEach(function(error) {
140
+ errorsMap.set(error.lineIndex, error);
141
+ });
142
+ this.textarea.childNodes.forEach(function(node, index) {
143
+ if (node instanceof HTMLParagraphElement) {
144
+ var errorItem = errorsMap.get(index);
145
+ if (errorItem) {
146
+ node.setAttribute("aria-invalid", "true");
147
+ node.dataset.errormessage = errorItem.errorMessage;
148
+ } else {
149
+ node.removeAttribute("aria-invalid");
150
+ node.dataset.errormessage = void 0;
151
+ }
152
+ }
153
+ });
154
+ }
109
155
  this.toggleAriaInvalid(showErrors, errors.length);
110
156
  if (showErrors === false) {
111
157
  this.textarea.setAttribute("aria-describedby", ariaDescribedby);
@@ -145,9 +191,9 @@ var InputField = /* @__PURE__ */ function(_Component) {
145
191
  }
146
192
  this.validateLine(paragraph);
147
193
  setTimeout(function() {
148
- var newNode = _this2.textarea.childNodes.item(keyboardLineIndex);
194
+ var newNode = _this3.textarea.childNodes.item(keyboardLineIndex);
149
195
  if (newNode) {
150
- _this2.setErrorIndex(newNode);
196
+ _this3.setErrorIndex(newNode);
151
197
  }
152
198
  }, 0);
153
199
  }
@@ -162,11 +208,12 @@ var InputField = /* @__PURE__ */ function(_Component) {
162
208
  key: "componentWillUnmount",
163
209
  value: function componentWillUnmount() {
164
210
  this.removeEventListeners(this.textarea);
211
+ this.observer.disconnect();
165
212
  }
166
213
  }, {
167
214
  key: "isDisabled",
168
215
  get: function get() {
169
- var _this$asProps = this.asProps, disabled = _this$asProps.disabled, readonly = _this$asProps.readonly;
216
+ var _this$asProps2 = this.asProps, disabled = _this$asProps2.disabled, readonly = _this$asProps2.readonly;
170
217
  return Boolean(disabled || readonly);
171
218
  }
172
219
  }, {
@@ -179,7 +226,7 @@ var InputField = /* @__PURE__ */ function(_Component) {
179
226
  key: "errorMessage",
180
227
  get: function get() {
181
228
  var _errorItem$errorMessa, _errorItem, _errorItem2;
182
- var _this$asProps2 = this.asProps, errors = _this$asProps2.errors, errorIndex = _this$asProps2.errorIndex, commonErrorMessage = _this$asProps2.commonErrorMessage, prevError = _this$asProps2.prevError;
229
+ var _this$asProps3 = this.asProps, errors = _this$asProps3.errors, errorIndex = _this$asProps3.errorIndex, commonErrorMessage = _this$asProps3.commonErrorMessage, prevError = _this$asProps3.prevError;
183
230
  var _this$state = this.state, mouseLineIndex = _this$state.mouseLineIndex, keyboardLineIndex = _this$state.keyboardLineIndex;
184
231
  var currentLineIndex = this.errorByInteraction === "keyboard" ? keyboardLineIndex : this.errorByInteraction === "mouse" ? mouseLineIndex : -1;
185
232
  var errorItem = errors[errorIndex];
@@ -230,7 +277,7 @@ var InputField = /* @__PURE__ */ function(_Component) {
230
277
  }, {
231
278
  key: "handleValueOutChange",
232
279
  value: function handleValueOutChange() {
233
- var _this$props2 = this.props, value = _this$props2.value, onChangeLinesCount = _this$props2.onChangeLinesCount;
280
+ var _this$props3 = this.props, value = _this$props3.value, onChangeLinesCount = _this$props3.onChangeLinesCount;
234
281
  if (value === "") {
235
282
  this.textarea.textContent = "";
236
283
  onChangeLinesCount(0);
@@ -245,13 +292,13 @@ var InputField = /* @__PURE__ */ function(_Component) {
245
292
  }, {
246
293
  key: "handleScroll",
247
294
  value: function handleScroll() {
248
- var _this3 = this;
295
+ var _this4 = this;
249
296
  if (this.scrollingTimeout) {
250
297
  clearTimeout(this.scrollingTimeout);
251
298
  }
252
299
  this.isScrolling = true;
253
300
  this.scrollingTimeout = window.setTimeout(function() {
254
- _this3.isScrolling = false;
301
+ _this4.isScrolling = false;
255
302
  }, 50);
256
303
  }
257
304
  }, {
@@ -280,7 +327,7 @@ var InputField = /* @__PURE__ */ function(_Component) {
280
327
  }
281
328
  }, {
282
329
  key: "handleMouseLeave",
283
- value: function handleMouseLeave(event) {
330
+ value: function handleMouseLeave() {
284
331
  if (this.changeTriggerTimeout) {
285
332
  clearTimeout(this.changeTriggerTimeout);
286
333
  }
@@ -327,9 +374,9 @@ var InputField = /* @__PURE__ */ function(_Component) {
327
374
  textNode = lastNodeToInsert.childNodes.item(0);
328
375
  position = ((_lastNodeToInsert$tex = lastNodeToInsert.textContent) !== null && _lastNodeToInsert$tex !== void 0 ? _lastNodeToInsert$tex : "").length;
329
376
  } else if (focusNode instanceof HTMLParagraphElement && anchorNode instanceof HTMLParagraphElement) {
330
- var _anchorNode$textConte, _anchorNode$textConte2, _focusNode$textConten, _focusNode$textConten2, _ref3;
331
- var before = (_anchorNode$textConte = anchorNode === null || anchorNode === void 0 ? void 0 : (_anchorNode$textConte2 = anchorNode.textContent) === null || _anchorNode$textConte2 === void 0 ? void 0 : _anchorNode$textConte2.substring(0, fromOffset)) !== null && _anchorNode$textConte !== void 0 ? _anchorNode$textConte : "";
332
- var after = (_focusNode$textConten = focusNode === null || focusNode === void 0 ? void 0 : (_focusNode$textConten2 = focusNode.textContent) === null || _focusNode$textConten2 === void 0 ? void 0 : _focusNode$textConten2.substring(toOffset)) !== null && _focusNode$textConten !== void 0 ? _focusNode$textConten : "";
377
+ var _anchorNode$textConte, _anchorNode$textConte2, _focusNode$textConten, _focusNode$textConten2, _firstNodeToInsert$te;
378
+ var before = (_anchorNode$textConte = anchorNode === null || anchorNode === void 0 || (_anchorNode$textConte2 = anchorNode.textContent) === null || _anchorNode$textConte2 === void 0 ? void 0 : _anchorNode$textConte2.substring(0, fromOffset)) !== null && _anchorNode$textConte !== void 0 ? _anchorNode$textConte : "";
379
+ var after = (_focusNode$textConten = focusNode === null || focusNode === void 0 || (_focusNode$textConten2 = focusNode.textContent) === null || _focusNode$textConten2 === void 0 ? void 0 : _focusNode$textConten2.substring(toOffset)) !== null && _focusNode$textConten !== void 0 ? _focusNode$textConten : "";
333
380
  var noEmptyLineBefore = before.trim() === "" ? "" : before;
334
381
  var noEmptyLineAfter = after.trim() === "" ? "" : after;
335
382
  selection.deleteFromDocument();
@@ -338,7 +385,7 @@ var InputField = /* @__PURE__ */ function(_Component) {
338
385
  }
339
386
  var firstNodeToInsert = listOfNodes.splice(0, 1)[0];
340
387
  var _lastNodeToInsert = listOfNodes[listOfNodes.length - 1];
341
- anchorNode.textContent = (_ref3 = noEmptyLineBefore + (firstNodeToInsert === null || firstNodeToInsert === void 0 ? void 0 : firstNodeToInsert.textContent)) !== null && _ref3 !== void 0 ? _ref3 : "";
388
+ anchorNode.textContent = noEmptyLineBefore + ((_firstNodeToInsert$te = firstNodeToInsert === null || firstNodeToInsert === void 0 ? void 0 : firstNodeToInsert.textContent) !== null && _firstNodeToInsert$te !== void 0 ? _firstNodeToInsert$te : "");
342
389
  anchorNode.after.apply(anchorNode, _toConsumableArray(listOfNodes));
343
390
  if (_lastNodeToInsert) {
344
391
  var _lastNodeToInsert$tex2, _lastNodeToInsert$tex3;
@@ -357,8 +404,7 @@ var InputField = /* @__PURE__ */ function(_Component) {
357
404
  }
358
405
  }
359
406
  if (textNode instanceof Text) {
360
- var _position, _position2;
361
- this.setSelection(textNode, (_position = position) !== null && _position !== void 0 ? _position : 1, (_position2 = position) !== null && _position2 !== void 0 ? _position2 : 1);
407
+ this.setSelection(textNode, position !== null && position !== void 0 ? position : 1, position !== null && position !== void 0 ? position : 1);
362
408
  this.toggleErrorsPopper("keyboardLineIndex", textNode.parentNode);
363
409
  } else {
364
410
  var _textNode;
@@ -387,7 +433,7 @@ var InputField = /* @__PURE__ */ function(_Component) {
387
433
  var text = document.createTextNode(nodeText);
388
434
  firstRow.append(text);
389
435
  firstNode.replaceWith(firstRow);
390
- selection === null || selection === void 0 ? void 0 : selection.setPosition(firstRow, nodeText.length);
436
+ selection === null || selection === void 0 || selection.setPosition(firstRow, nodeText.length);
391
437
  } else if (!firstNode || firstNode instanceof HTMLBRElement && nodes.length === 1) {
392
438
  this.textarea.textContent = "";
393
439
  this.setState({
@@ -439,7 +485,7 @@ var InputField = /* @__PURE__ */ function(_Component) {
439
485
  } else if (childNodes.length === 1 && childNodes[0] instanceof HTMLBRElement) {
440
486
  rowNode.innerHTML = this.emptyLineValue;
441
487
  }
442
- var _this$asProps3 = this.asProps, errors = _this$asProps3.errors, showErrors = _this$asProps3.showErrors;
488
+ var _this$asProps4 = this.asProps, errors = _this$asProps4.errors, showErrors = _this$asProps4.showErrors;
443
489
  var isValid = this.validateLine(rowNode);
444
490
  this.recalculateErrors();
445
491
  this.setErrorIndex(rowNode);
@@ -447,10 +493,10 @@ var InputField = /* @__PURE__ */ function(_Component) {
447
493
  this.toggleErrorsPopper("keyboardLineIndex", rowNode, 0);
448
494
  }
449
495
  var trigger = !isValid || isValid && errors.length === 1 && errors[0].lineNode === rowNode ? rowNode : this.textarea;
450
- if (showErrors && ((_this$popper = this.popper) === null || _this$popper === void 0 ? void 0 : _this$popper.current.state.elements.reference) !== trigger) {
496
+ if (showErrors && ((_this$popper = this.popper) === null || _this$popper === void 0 || (_this$popper = _this$popper.current) === null || _this$popper === void 0 ? void 0 : _this$popper.state.elements.reference) !== trigger) {
451
497
  if (this.shouldChangePopperTrigger(trigger)) {
452
498
  var _this$setPopperTrigge;
453
- (_this$setPopperTrigge = this.setPopperTrigger) === null || _this$setPopperTrigge === void 0 ? void 0 : _this$setPopperTrigge.call(this, trigger);
499
+ (_this$setPopperTrigge = this.setPopperTrigger) === null || _this$setPopperTrigge === void 0 || _this$setPopperTrigge.call(this, trigger);
454
500
  } else {
455
501
  this.setState({
456
502
  visibleErrorPopper: false
@@ -459,7 +505,7 @@ var InputField = /* @__PURE__ */ function(_Component) {
459
505
  }
460
506
  } else if (rowNode === null) {
461
507
  var _this$setPopperTrigge2;
462
- (_this$setPopperTrigge2 = this.setPopperTrigger) === null || _this$setPopperTrigge2 === void 0 ? void 0 : _this$setPopperTrigge2.call(this, this.textarea);
508
+ (_this$setPopperTrigge2 = this.setPopperTrigger) === null || _this$setPopperTrigge2 === void 0 || _this$setPopperTrigge2.call(this, this.textarea);
463
509
  if ((selection === null || selection === void 0 ? void 0 : selection.focusNode) === this.textarea && this.textarea.childNodes.length > 1) {
464
510
  var nodeIndex = selection.focusOffset;
465
511
  var emptyParagraph = this.textarea.childNodes.item(nodeIndex - 1);
@@ -480,7 +526,7 @@ var InputField = /* @__PURE__ */ function(_Component) {
480
526
  }
481
527
  }, {
482
528
  key: "handleFocus",
483
- value: function handleFocus(event) {
529
+ value: function handleFocus() {
484
530
  this.isFocusing = true;
485
531
  this.errorByInteraction = "keyboard";
486
532
  if (this.asProps.showErrors) {
@@ -492,19 +538,19 @@ var InputField = /* @__PURE__ */ function(_Component) {
492
538
  }, {
493
539
  key: "handleBlur",
494
540
  value: function handleBlur(event) {
495
- var _this4 = this;
541
+ var _this5 = this;
496
542
  this.isFocusing = false;
497
543
  this.setState({
498
544
  visibleErrorPopper: false
499
545
  });
500
- var _this$asProps4 = this.asProps, validateOn = _this$asProps4.validateOn, onBlur = _this$asProps4.onBlur, value = _this$asProps4.value;
546
+ var _this$asProps5 = this.asProps, validateOn = _this$asProps5.validateOn, onBlur = _this$asProps5.onBlur, value = _this$asProps5.value;
501
547
  if (validateOn.includes("blur")) {
502
548
  this.recalculateErrors();
503
549
  }
504
550
  var valueToChange = typeof value === "string" ? this.getValues().join(this.delimiter) : this.getValues();
505
551
  onBlur(valueToChange, event);
506
552
  setTimeout(function() {
507
- _this4.setState({
553
+ _this5.setState({
508
554
  keyboardLineIndex: -1
509
555
  });
510
556
  }, 200);
@@ -512,7 +558,7 @@ var InputField = /* @__PURE__ */ function(_Component) {
512
558
  }, {
513
559
  key: "handleKeyDown",
514
560
  value: function handleKeyDown(event) {
515
- var _this5 = this;
561
+ var _this6 = this;
516
562
  this.errorByInteraction = "keyboard";
517
563
  var linesDelimiters = this.asProps.linesDelimiters;
518
564
  var currentNode = this.getNodeFromSelection();
@@ -529,7 +575,7 @@ var InputField = /* @__PURE__ */ function(_Component) {
529
575
  var _selection$focusNode, _selectionNode$textCo, _currentNode$textCont2, _row$textContent;
530
576
  event.preventDefault();
531
577
  var selection = document.getSelection();
532
- var selectionNode = (selection === null || selection === void 0 ? void 0 : selection.focusNode) instanceof Text ? selection.focusNode : selection === null || selection === void 0 ? void 0 : (_selection$focusNode = selection.focusNode) === null || _selection$focusNode === void 0 ? void 0 : _selection$focusNode.childNodes.item(0);
578
+ var selectionNode = (selection === null || selection === void 0 ? void 0 : selection.focusNode) instanceof Text ? selection.focusNode : selection === null || selection === void 0 || (_selection$focusNode = selection.focusNode) === null || _selection$focusNode === void 0 ? void 0 : _selection$focusNode.childNodes.item(0);
533
579
  var selectionOffset = selection === null || selection === void 0 ? void 0 : selection.focusOffset;
534
580
  var newRowValue = "";
535
581
  if (selectionNode instanceof Text && selectionOffset !== void 0 && selectionOffset !== ((_selectionNode$textCo = selectionNode.textContent) === null || _selectionNode$textCo === void 0 ? void 0 : _selectionNode$textCo.length)) {
@@ -560,7 +606,7 @@ var InputField = /* @__PURE__ */ function(_Component) {
560
606
  this.recalculateLinesCount();
561
607
  }
562
608
  setTimeout(function() {
563
- _this5.recalculateErrors();
609
+ _this6.recalculateErrors();
564
610
  }, 0);
565
611
  this.toggleErrorsPopperByKeyboard(0);
566
612
  }
@@ -593,12 +639,12 @@ var InputField = /* @__PURE__ */ function(_Component) {
593
639
  }
594
640
  }
595
641
  setTimeout(function() {
596
- _this5.recalculateErrors();
642
+ _this6.recalculateErrors();
597
643
  }, 0);
598
644
  this.toggleErrorsPopperByKeyboard(0);
599
645
  }
600
646
  } else if (this.isRangeSelection()) {
601
- var _currentNode$textCont4, _focusElement$parentN, _anchorElement$parent, _focusElement$parentN2, _focusElement$parentN3;
647
+ var _currentNode$textCont4, _focusElement$parentN, _anchorElement$parent, _focusElement$parentN2;
602
648
  var _selection = document.getSelection();
603
649
  var direction = this.getSelectionDirection();
604
650
  var anchorElement = direction === "backward" ? _selection === null || _selection === void 0 ? void 0 : _selection.focusNode : _selection === null || _selection === void 0 ? void 0 : _selection.anchorNode;
@@ -620,10 +666,10 @@ var InputField = /* @__PURE__ */ function(_Component) {
620
666
  this.setErrorIndex(currentNode);
621
667
  this.recalculateLinesCount();
622
668
  setTimeout(function() {
623
- _this5.recalculateErrors();
669
+ _this6.recalculateErrors();
624
670
  }, 0);
625
671
  this.toggleErrorsPopperByKeyboard(0);
626
- } else if (focusElement !== anchorElement && focusElement instanceof Text && anchorElement instanceof Text && (focusElement === null || focusElement === void 0 ? void 0 : focusElement.textContent) === (focusElement === null || focusElement === void 0 ? void 0 : (_focusElement$parentN = focusElement.parentNode) === null || _focusElement$parentN === void 0 ? void 0 : _focusElement$parentN.textContent) && (anchorElement === null || anchorElement === void 0 ? void 0 : anchorElement.textContent) === (anchorElement === null || anchorElement === void 0 ? void 0 : (_anchorElement$parent = anchorElement.parentNode) === null || _anchorElement$parent === void 0 ? void 0 : _anchorElement$parent.textContent) && anchorOffset === 0 && focusOffset === (focusElement === null || focusElement === void 0 ? void 0 : (_focusElement$parentN2 = focusElement.parentNode) === null || _focusElement$parentN2 === void 0 ? void 0 : (_focusElement$parentN3 = _focusElement$parentN2.textContent) === null || _focusElement$parentN3 === void 0 ? void 0 : _focusElement$parentN3.length)) {
672
+ } else if (focusElement !== anchorElement && focusElement instanceof Text && anchorElement instanceof Text && (focusElement === null || focusElement === void 0 ? void 0 : focusElement.textContent) === (focusElement === null || focusElement === void 0 || (_focusElement$parentN = focusElement.parentNode) === null || _focusElement$parentN === void 0 ? void 0 : _focusElement$parentN.textContent) && (anchorElement === null || anchorElement === void 0 ? void 0 : anchorElement.textContent) === (anchorElement === null || anchorElement === void 0 || (_anchorElement$parent = anchorElement.parentNode) === null || _anchorElement$parent === void 0 ? void 0 : _anchorElement$parent.textContent) && anchorOffset === 0 && focusOffset === (focusElement === null || focusElement === void 0 || (_focusElement$parentN2 = focusElement.parentNode) === null || _focusElement$parentN2 === void 0 || (_focusElement$parentN2 = _focusElement$parentN2.textContent) === null || _focusElement$parentN2 === void 0 ? void 0 : _focusElement$parentN2.length)) {
627
673
  event.preventDefault();
628
674
  var paragraphs = Array.from(this.textarea.children);
629
675
  var _anchorParagraph = anchorElement.parentElement;
@@ -634,10 +680,10 @@ var InputField = /* @__PURE__ */ function(_Component) {
634
680
  this.setSelection(this.textarea, 0, 0);
635
681
  } else {
636
682
  var isCleaning = false;
637
- var _iterator = _createForOfIteratorHelper(paragraphs), _step;
683
+ var _iterator2 = _createForOfIteratorHelper(paragraphs), _step2;
638
684
  try {
639
- for (_iterator.s(); !(_step = _iterator.n()).done; ) {
640
- var paragraph = _step.value;
685
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
686
+ var paragraph = _step2.value;
641
687
  if (paragraph === _anchorParagraph || isCleaning) {
642
688
  isCleaning = true;
643
689
  if (paragraph === _focusParagraph) {
@@ -650,16 +696,16 @@ var InputField = /* @__PURE__ */ function(_Component) {
650
696
  }
651
697
  }
652
698
  } catch (err) {
653
- _iterator.e(err);
699
+ _iterator2.e(err);
654
700
  } finally {
655
- _iterator.f();
701
+ _iterator2.f();
656
702
  }
657
703
  this.validateLine(currentNode);
658
704
  }
659
705
  this.setErrorIndex(currentNode);
660
706
  this.recalculateLinesCount();
661
707
  setTimeout(function() {
662
- _this5.recalculateErrors();
708
+ _this6.recalculateErrors();
663
709
  }, 0);
664
710
  this.toggleErrorsPopperByKeyboard(0);
665
711
  }
@@ -671,14 +717,14 @@ var InputField = /* @__PURE__ */ function(_Component) {
671
717
  }, {
672
718
  key: "render",
673
719
  value: function render() {
674
- var _ref = this.asProps, _ref2, _this$containerRef$cu2, _this6 = this;
720
+ var _ref = this.asProps, _ref2, _this$containerRef$cu2, _this7 = this;
675
721
  var SInputField = Box;
676
- var _this$asProps5 = this.asProps, styles = _this$asProps5.styles, showErrors = _this$asProps5.showErrors;
722
+ var _this$asProps6 = this.asProps, styles = _this$asProps6.styles, showErrors = _this$asProps6.showErrors;
677
723
  var visibleErrorPopper = this.state.visibleErrorPopper;
678
724
  var _this$errorMessage = this.errorMessage, errorMessage = _this$errorMessage.errorMessage, isCommonError = _this$errorMessage.isCommonError;
679
725
  var visibleErrorTooltip = showErrors && visibleErrorPopper && Boolean(errorMessage) && !this.isDisabled;
680
726
  var _extractAriaProps2 = extractAriaProps(this.asProps), __excludeProps = _extractAriaProps2.__excludeProps;
681
- return _ref2 = sstyled$1(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Tooltip, _ref2.cn("Tooltip", {
727
+ return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Tooltip, _ref2.cn("Tooltip", {
682
728
  "interaction": "none",
683
729
  "placement": isCommonError ? "right-start" : "right",
684
730
  "visible": visibleErrorTooltip,
@@ -688,14 +734,14 @@ var InputField = /* @__PURE__ */ function(_Component) {
688
734
  boundary: (_this$containerRef$cu2 = this.containerRef.current) !== null && _this$containerRef$cu2 !== void 0 ? _this$containerRef$cu2 : void 0,
689
735
  tether: false
690
736
  }
691
- }), function(_ref4) {
692
- var popper = _ref4.popper, setTrigger = _ref4.setTrigger;
693
- if (!_this6.popper) {
694
- _this6.setPopperTrigger = setTrigger;
695
- _this6.popper = popper;
737
+ }), function(_ref3) {
738
+ var popper = _ref3.popper, setTrigger = _ref3.setTrigger;
739
+ if (!_this7.popper) {
740
+ _this7.setPopperTrigger = setTrigger;
741
+ _this7.popper = popper;
696
742
  }
697
743
  return /* @__PURE__ */ React.createElement(Tooltip.Popper, {
698
- id: _this6.popperDescribedId
744
+ id: _this7.popperDescribedId
699
745
  }, errorMessage);
700
746
  }), /* @__PURE__ */ React.createElement(SInputField, _ref2.cn("SInputField", _objectSpread({}, assignProps({
701
747
  "ref": this.containerRef,
@@ -705,7 +751,7 @@ var InputField = /* @__PURE__ */ function(_Component) {
705
751
  }, {
706
752
  key: "prepareNodesForPaste",
707
753
  value: function prepareNodesForPaste(value) {
708
- var _pasteProps$lineProce, _pasteProps$skipEmpty, _pasteProps$delimiter, _this7 = this;
754
+ var _pasteProps$lineProce, _pasteProps$skipEmpty, _pasteProps$delimiter, _this8 = this;
709
755
  var listOfNodes = [];
710
756
  var pasteProps = this.asProps.pasteProps;
711
757
  var lineProcessing = (_pasteProps$lineProce = pasteProps === null || pasteProps === void 0 ? void 0 : pasteProps.lineProcessing) !== null && _pasteProps$lineProce !== void 0 ? _pasteProps$lineProce : function(line) {
@@ -720,15 +766,15 @@ var InputField = /* @__PURE__ */ function(_Component) {
720
766
  if (preparedLine === "" && skipEmptyLines === false || preparedLine !== "") {
721
767
  var node = document.createElement("p");
722
768
  if (preparedLine === "") {
723
- node.innerHTML = _this7.emptyLineValue;
769
+ node.innerHTML = _this8.emptyLineValue;
724
770
  } else if (preparedLine.trim() === "") {
725
771
  var allSpacesRegExp = new RegExp("\\s", "g");
726
- node.innerHTML = DOMPurify.sanitize(preparedLine.replace(allSpacesRegExp, _this7.spaceLineValue));
772
+ node.innerHTML = DOMPurify.sanitize(preparedLine.replace(allSpacesRegExp, _this8.spaceLineValue));
727
773
  } else {
728
774
  node.append(document.createTextNode(preparedLine));
729
775
  }
730
776
  listOfNodes.push(node);
731
- _this7.validateLine(node);
777
+ _this8.validateLine(node);
732
778
  }
733
779
  });
734
780
  return listOfNodes;
@@ -753,17 +799,17 @@ var InputField = /* @__PURE__ */ function(_Component) {
753
799
  }, {
754
800
  key: "recalculateLinesCount",
755
801
  value: function recalculateLinesCount() {
756
- var _this8 = this;
802
+ var _this9 = this;
757
803
  if (this.linesCountTimeout) {
758
804
  clearTimeout(this.linesCountTimeout);
759
805
  }
760
806
  this.linesCountTimeout = window.setTimeout(function() {
761
807
  var lines = 0;
762
- var _this8$asProps = _this8.asProps, maxLines = _this8$asProps.maxLines, linesCount = _this8$asProps.linesCount;
763
- _this8.textarea.childNodes.forEach(function(node, index) {
808
+ var _this9$asProps = _this9.asProps, maxLines = _this9$asProps.maxLines, linesCount = _this9$asProps.linesCount;
809
+ _this9.textarea.childNodes.forEach(function(node) {
764
810
  if (node instanceof HTMLParagraphElement) {
765
811
  node.dataset.overMaxRows = "false";
766
- if (node.textContent !== _this8.getEmptyParagraph().textContent && node.textContent !== "") {
812
+ if (node.textContent !== _this9.getEmptyParagraph().textContent && node.textContent !== "") {
767
813
  lines++;
768
814
  if (lines > maxLines) {
769
815
  node.dataset.overMaxRows = "true";
@@ -772,7 +818,7 @@ var InputField = /* @__PURE__ */ function(_Component) {
772
818
  }
773
819
  });
774
820
  if (linesCount !== lines) {
775
- _this8.asProps.onChangeLinesCount(lines);
821
+ _this9.asProps.onChangeLinesCount(lines);
776
822
  }
777
823
  }, 100);
778
824
  }
@@ -799,57 +845,57 @@ var InputField = /* @__PURE__ */ function(_Component) {
799
845
  }, {
800
846
  key: "toggleErrorsPopperByKeyboard",
801
847
  value: function toggleErrorsPopperByKeyboard(timer) {
802
- var _this9 = this;
848
+ var _this0 = this;
803
849
  if (this.toggleErrorsPopperTimeout) {
804
850
  clearTimeout(this.toggleErrorsPopperTimeout);
805
851
  }
806
852
  if (!this.isScrolling) {
807
853
  setTimeout(function() {
808
- var rowNode = _this9.getNodeFromSelection();
809
- _this9.toggleErrorsPopper("keyboardLineIndex", rowNode, timer);
854
+ var rowNode = _this0.getNodeFromSelection();
855
+ _this0.toggleErrorsPopper("keyboardLineIndex", rowNode, timer);
810
856
  }, 0);
811
857
  } else {
812
858
  this.toggleErrorsPopperTimeout = window.setTimeout(function() {
813
- _this9.toggleErrorsPopperByKeyboard(timer);
859
+ _this0.toggleErrorsPopperByKeyboard(timer);
814
860
  }, 50);
815
861
  }
816
862
  }
817
863
  }, {
818
864
  key: "toggleErrorsPopper",
819
865
  value: function toggleErrorsPopper(key, target, timer) {
820
- var _this10 = this;
866
+ var _this1 = this;
821
867
  if (target instanceof HTMLDivElement || target instanceof HTMLParagraphElement) {
822
868
  if (this.changeTriggerTimeout) {
823
869
  clearTimeout(this.changeTriggerTimeout);
824
870
  }
825
871
  this.changeTriggerTimeout = window.setTimeout(function() {
826
- var targetElement = target === _this10.textarea ? _this10.getNodeFromSelection() : target;
872
+ var targetElement = target === _this1.textarea ? _this1.getNodeFromSelection() : target;
827
873
  var lineIndex = -1;
828
874
  var isInvalidRow = false;
829
875
  if (targetElement instanceof HTMLParagraphElement) {
830
876
  isInvalidRow = targetElement.getAttribute("aria-invalid") === "true";
831
- lineIndex = Array.from(_this10.textarea.childNodes).indexOf(targetElement);
832
- } else if (targetElement === _this10.textarea) {
877
+ lineIndex = Array.from(_this1.textarea.childNodes).indexOf(targetElement);
878
+ } else if (targetElement === _this1.textarea) {
833
879
  lineIndex = 0;
834
880
  }
835
881
  if (targetElement instanceof HTMLElement) {
836
- _this10.setState(function(prevState) {
882
+ _this1.setState(function(prevState) {
837
883
  var newState = {
838
- visibleErrorPopper: _this10.isFocusing && Boolean(_this10.asProps.commonErrorMessage) ? true : isInvalidRow,
884
+ visibleErrorPopper: _this1.isFocusing && Boolean(_this1.asProps.commonErrorMessage) ? true : isInvalidRow,
839
885
  mouseLineIndex: prevState.mouseLineIndex,
840
886
  keyboardLineIndex: prevState.keyboardLineIndex
841
887
  };
842
- if (_this10.isFocusing || key === "mouseLineIndex" && isInvalidRow) {
888
+ if (_this1.isFocusing || key === "mouseLineIndex" && isInvalidRow) {
843
889
  newState[key] = lineIndex;
844
890
  }
845
891
  return newState;
846
892
  }, function() {
847
- _this10.errorByInteraction = key === "mouseLineIndex" ? "mouse" : "keyboard";
848
- var trigger = isInvalidRow ? targetElement : _this10.textarea;
849
- if (_this10.shouldChangePopperTrigger(trigger)) {
850
- var _this10$setPopperTrig;
851
- (_this10$setPopperTrig = _this10.setPopperTrigger) === null || _this10$setPopperTrig === void 0 ? void 0 : _this10$setPopperTrig.call(_this10, trigger);
852
- _this10.forceUpdate();
893
+ _this1.errorByInteraction = key === "mouseLineIndex" ? "mouse" : "keyboard";
894
+ var trigger = isInvalidRow ? targetElement : _this1.textarea;
895
+ if (_this1.shouldChangePopperTrigger(trigger)) {
896
+ var _this1$setPopperTrigg;
897
+ (_this1$setPopperTrigg = _this1.setPopperTrigger) === null || _this1$setPopperTrigg === void 0 || _this1$setPopperTrigg.call(_this1, trigger);
898
+ _this1.forceUpdate();
853
899
  }
854
900
  });
855
901
  }
@@ -874,7 +920,7 @@ var InputField = /* @__PURE__ */ function(_Component) {
874
920
  }, {
875
921
  key: "handleChangeErrorIndex",
876
922
  value: function handleChangeErrorIndex(errorIndex) {
877
- var _error$lineNode, _this11 = this;
923
+ var _error$lineNode, _this10 = this;
878
924
  var error = this.asProps.errors[errorIndex];
879
925
  var childNodes = this.textarea.childNodes;
880
926
  var node = error ? (_error$lineNode = error.lineNode) !== null && _error$lineNode !== void 0 ? _error$lineNode : childNodes.item(error.lineIndex) : null;
@@ -886,9 +932,9 @@ var InputField = /* @__PURE__ */ function(_Component) {
886
932
  setTimeout(function() {
887
933
  var text = node.childNodes.item(0);
888
934
  if (text instanceof Text) {
889
- _this11.setSelection(text, 0, text.length);
935
+ _this10.setSelection(text, 0, text.length);
890
936
  } else {
891
- _this11.setSelection(node, 0, 1);
937
+ _this10.setSelection(node, 0, 1);
892
938
  }
893
939
  }, 150);
894
940
  }
@@ -919,8 +965,8 @@ var InputField = /* @__PURE__ */ function(_Component) {
919
965
  var range = document.createRange();
920
966
  range.setStart(node, start);
921
967
  range.setEnd(node, end);
922
- selection === null || selection === void 0 ? void 0 : selection.removeAllRanges();
923
- selection === null || selection === void 0 ? void 0 : selection.addRange(range);
968
+ selection === null || selection === void 0 || selection.removeAllRanges();
969
+ selection === null || selection === void 0 || selection.addRange(range);
924
970
  var nodeToScroll = node instanceof Text ? node.parentNode : node;
925
971
  if (nodeToScroll instanceof HTMLElement) {
926
972
  nodeToScroll.scrollIntoView({
@@ -1062,8 +1108,7 @@ var InputField = /* @__PURE__ */ function(_Component) {
1062
1108
  return null;
1063
1109
  }
1064
1110
  }]);
1065
- return InputField2;
1066
- }(Component);
1111
+ })(Component);
1067
1112
  _defineProperty(InputField, "displayName", "Textarea");
1068
1113
  _defineProperty(InputField, "style", style);
1069
1114
  _defineProperty(InputField, "enhance", [uniqueIDEnhancement()]);