@semcore/bulk-textarea 1.5.0-prerelease.0 → 1.5.0-prerelease.4
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.
- package/lib/cjs/BulkTextarea.js +38 -35
- package/lib/cjs/BulkTextarea.js.map +1 -1
- package/lib/cjs/BulkTextarea.types.js.map +1 -1
- package/lib/cjs/components/ClearAll.js +2 -2
- package/lib/cjs/components/ClearAll.js.map +1 -1
- package/lib/cjs/components/Counter.js +5 -5
- package/lib/cjs/components/Counter.js.map +1 -1
- package/lib/cjs/components/ErrorsNavigation.js +14 -14
- package/lib/cjs/components/ErrorsNavigation.js.map +1 -1
- package/lib/cjs/components/InputField/InputField.js +167 -219
- package/lib/cjs/components/InputField/InputField.js.map +1 -1
- package/lib/cjs/components/InputField/InputField.types.js.map +1 -1
- package/lib/cjs/components/InputField/inputField.shadow.css +19 -57
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +5 -4
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/BulkTextarea.js +32 -31
- package/lib/es6/BulkTextarea.js.map +1 -1
- package/lib/es6/BulkTextarea.types.js.map +1 -1
- package/lib/es6/components/ClearAll.js +2 -2
- package/lib/es6/components/ClearAll.js.map +1 -1
- package/lib/es6/components/Counter.js +2 -2
- package/lib/es6/components/Counter.js.map +1 -1
- package/lib/es6/components/ErrorsNavigation.js +10 -10
- package/lib/es6/components/ErrorsNavigation.js.map +1 -1
- package/lib/es6/components/InputField/InputField.js +165 -219
- package/lib/es6/components/InputField/InputField.js.map +1 -1
- package/lib/es6/components/InputField/InputField.types.js.map +1 -1
- package/lib/es6/components/InputField/inputField.shadow.css +19 -57
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +2 -2
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/esm/BulkTextarea.mjs +35 -33
- package/lib/esm/components/ClearAll.mjs +1 -1
- package/lib/esm/components/Counter.mjs +2 -2
- package/lib/esm/components/ErrorsNavigation.mjs +4 -4
- package/lib/esm/components/InputField/InputField.mjs +136 -181
- package/lib/esm/components/InputField/inputField.shadow.css +19 -57
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -2
- package/lib/types/BulkTextarea.d.ts +1 -1
- package/lib/types/BulkTextarea.types.d.ts +8 -113
- package/lib/types/components/ClearAll.d.ts +2 -2
- package/lib/types/components/Counter.d.ts +4 -4
- package/lib/types/components/ErrorsNavigation.d.ts +2 -2
- package/lib/types/components/InputField/InputField.d.ts +7 -12
- package/lib/types/components/InputField/InputField.types.d.ts +125 -11
- package/package.json +10 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
SInputField>div {
|
|
1
|
+
SInputField > div {
|
|
2
2
|
box-sizing: content-box;
|
|
3
3
|
outline: none;
|
|
4
4
|
border-radius: var(--intergalactic-control-rounded, 6px);
|
|
@@ -37,7 +37,7 @@ SInputField>div {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
>p {
|
|
40
|
+
> p {
|
|
41
41
|
counter-increment: row;
|
|
42
42
|
/*display: inline-block;*/
|
|
43
43
|
margin: 0 0 var(--intergalactic-spacing-1x, 4px) 0;
|
|
@@ -68,60 +68,38 @@ SInputField>div {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
&:has(p:nth-child(n + 10)) {
|
|
71
|
-
>p {
|
|
71
|
+
> p {
|
|
72
72
|
padding-left: var(--intergalactic-spacing-6x, 24px);
|
|
73
73
|
}
|
|
74
|
-
|
|
75
|
-
>p:nth-child(-n + 9)::before {
|
|
74
|
+
> p:nth-child(-n + 9)::before {
|
|
76
75
|
padding-left: var(--intergalactic-spacing-2x, 8px);
|
|
77
76
|
}
|
|
78
77
|
}
|
|
79
78
|
|
|
80
79
|
&:has(p:nth-child(n + 100)) {
|
|
81
|
-
>p {
|
|
82
|
-
padding-left: var(--intergalactic-spacing-8x, 32px);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
>p:nth-child(-n + 9)::before {
|
|
86
|
-
padding-left: var(--intergalactic-spacing-4x, 16px);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
>p:nth-child(n + 10)::before {
|
|
90
|
-
padding-left: var(--intergalactic-spacing-2x, 8px);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
>p:nth-child(n + 100)::before {
|
|
94
|
-
padding-left: 0;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
&:has(p:nth-child(n + 1000)) {
|
|
99
80
|
> p {
|
|
100
|
-
padding-left:
|
|
81
|
+
padding-left: var(--intergalactic-spacing-8x, 32px);
|
|
101
82
|
}
|
|
102
83
|
> p:nth-child(-n + 9)::before {
|
|
103
|
-
padding-left: var(--intergalactic-spacing-6x, 24px);
|
|
104
|
-
}
|
|
105
|
-
> p:nth-child(n + 10)::before {
|
|
106
84
|
padding-left: var(--intergalactic-spacing-4x, 16px);
|
|
107
85
|
}
|
|
108
|
-
> p:nth-child(n +
|
|
86
|
+
> p:nth-child(n + 10)::before {
|
|
109
87
|
padding-left: var(--intergalactic-spacing-2x, 8px);
|
|
110
88
|
}
|
|
111
|
-
> p:nth-child(n +
|
|
89
|
+
> p:nth-child(n + 100)::before {
|
|
112
90
|
padding-left: 0;
|
|
113
91
|
}
|
|
114
92
|
}
|
|
115
93
|
}
|
|
116
94
|
|
|
117
|
-
SInputField[showErrors]>div[aria-invalid]>p[aria-invalid]:after {
|
|
95
|
+
SInputField[showErrors] > div[aria-invalid] > p[aria-invalid]:after {
|
|
118
96
|
content: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBmaWxsPSIjZDEwMDJmIj48cGF0aCBkPSJNNyA2aDJ2NEg3VjZabTIgN3YtMkg3djJoMloiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYuMTUyIDEuMTcyYy43MTktMS41NjMgMi45NzctMS41NjMgMy42OTYgMGw2LjA0MyAxMy4xNDFjLjM2My43OTEtLjIyNSAxLjY4Ny0xLjEwOSAxLjY4N0gxLjIxOGMtLjg4NCAwLTEuNDcyLS44OTYtMS4xMDktMS42ODdMNi4xNTIgMS4xNzJabTcuMzc0IDEyLjgzN0w4IDEuOTkgMi40NzQgMTQuMDFoMTEuMDUyWiIvPjwvc3ZnPgo= ");
|
|
119
97
|
position: absolute;
|
|
120
98
|
right: 0;
|
|
121
99
|
top: var(--intergalactic-spacing-05x, 2px);
|
|
122
100
|
}
|
|
123
101
|
|
|
124
|
-
SInputField[size='m']>div {
|
|
102
|
+
SInputField[size='m'] > div {
|
|
125
103
|
padding: var(--intergalactic-spacing-2x, 8px) var(--intergalactic-spacing-4x, 16px);
|
|
126
104
|
font-size: var(--intergalactic-fs-200, 14px);
|
|
127
105
|
line-height: var(--intergalactic-lh-200, 142%);
|
|
@@ -132,14 +110,13 @@ SInputField[size='m']>div {
|
|
|
132
110
|
|
|
133
111
|
&:empty {
|
|
134
112
|
padding-left: var(--intergalactic-spacing-8x, 32px);
|
|
135
|
-
|
|
136
113
|
&::before {
|
|
137
114
|
left: var(--intergalactic-spacing-4x, 16px);
|
|
138
115
|
}
|
|
139
116
|
}
|
|
140
117
|
}
|
|
141
118
|
|
|
142
|
-
SInputField[size='l']>div {
|
|
119
|
+
SInputField[size='l'] > div {
|
|
143
120
|
padding: var(--intergalactic-spacing-3x, 12px) var(--intergalactic-spacing-4x, 16px);
|
|
144
121
|
font-size: var(--intergalactic-fs-300, 16px);
|
|
145
122
|
line-height: var(--intergalactic-lh-300, 150%);
|
|
@@ -149,7 +126,6 @@ SInputField[size='l']>div {
|
|
|
149
126
|
|
|
150
127
|
&:empty {
|
|
151
128
|
padding-left: calc(var(--intergalactic-spacing-8x, 32px) + var(--intergalactic-spacing-05x, 2px));
|
|
152
|
-
|
|
153
129
|
&::before {
|
|
154
130
|
left: var(--intergalactic-spacing-4x, 16px);
|
|
155
131
|
}
|
|
@@ -157,39 +133,26 @@ SInputField[size='l']>div {
|
|
|
157
133
|
}
|
|
158
134
|
|
|
159
135
|
|
|
160
|
-
SInputField[state='normal']:not([disabled])>div {
|
|
136
|
+
SInputField[state='normal']:not([disabled]) > div:focus {
|
|
161
137
|
&:focus {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
outline-offset: 0;
|
|
165
|
-
transition-property: outline-color, outline-width;
|
|
166
|
-
}
|
|
138
|
+
box-shadow: var(--intergalactic-keyboard-focus, 0px 0px 0px 3px oklch(0.424 0.269 264.2 / 0.469));
|
|
139
|
+
border-color: var(--intergalactic-border-info-active, oklch(0.443 0.273 264.2 / 0.419));
|
|
167
140
|
}
|
|
168
141
|
}
|
|
169
142
|
|
|
170
|
-
SInputField[state='valid']>div {
|
|
143
|
+
SInputField[state='valid'] > div {
|
|
171
144
|
border-color: var(--intergalactic-border-success-active, oklch(0.75 0.153 167.5));
|
|
172
145
|
|
|
173
146
|
&:focus {
|
|
174
|
-
|
|
175
|
-
@mixin focus-outline-mixin {
|
|
176
|
-
outline-offset: 0;
|
|
177
|
-
transition-property: outline-color, outline-width;
|
|
178
|
-
}
|
|
179
|
-
outline-color: var(--intergalactic-keyboard-focus-valid-outline, oklch(0.711 0.146 166.9));
|
|
147
|
+
box-shadow: var(--intergalactic-keyboard-focus-valid, 0px 0px 0px 3px oklch(0.711 0.146 166.9));
|
|
180
148
|
}
|
|
181
149
|
}
|
|
182
150
|
|
|
183
|
-
SInputField[state='invalid']>div {
|
|
151
|
+
SInputField[state='invalid'] > div {
|
|
184
152
|
border-color: var(--intergalactic-border-critical-active, oklch(0.628 0.258 29 / 0.56));
|
|
185
153
|
|
|
186
154
|
&:focus {
|
|
187
|
-
|
|
188
|
-
@mixin focus-outline-mixin {
|
|
189
|
-
outline-offset: 0;
|
|
190
|
-
transition-property: outline-color, outline-width;
|
|
191
|
-
}
|
|
192
|
-
outline-color: var(--intergalactic-keyboard-focus-invalid-outline, oklch(0.628 0.257 28.9 / 0.652));
|
|
155
|
+
box-shadow: var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px oklch(0.628 0.257 28.9 / 0.652));
|
|
193
156
|
}
|
|
194
157
|
|
|
195
158
|
background-image: var(--intergalactic-border-critical-pattern, repeating-linear-gradient(315deg, oklch(0.628 0.258 29 / 0.56) 0, oklch(0.628 0.258 29 / 0.56) 1px, transparent 0, transparent 50%));
|
|
@@ -200,10 +163,9 @@ SInputField[state='invalid']>div {
|
|
|
200
163
|
background-repeat: repeat-y;
|
|
201
164
|
}
|
|
202
165
|
|
|
203
|
-
SInputField[readonly]>div {
|
|
166
|
+
SInputField[readonly] > div {
|
|
204
167
|
background-color: var(--intergalactic-bg-secondary-neutral, oklch(0.98 0.001 180));
|
|
205
168
|
}
|
|
206
|
-
|
|
207
|
-
SInputField[disabled]>div {
|
|
169
|
+
SInputField[disabled] > div {
|
|
208
170
|
opacity: var(--intergalactic-disabled-opacity, 0.4);
|
|
209
171
|
}
|
package/lib/es6/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default"],"sources":["../../src/index.ts"],"sourcesContent":["export { default } from './BulkTextarea';\nexport type { BulkTextareaProps } from './BulkTextarea.types';\nexport type { ErrorItem } from './components/InputField/InputField.types';\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,gBAAgB"
|
|
1
|
+
{"version":3,"file":"index.js","names":["default"],"sources":["../../src/index.ts"],"sourcesContent":["export { default } from './BulkTextarea';\nexport type { BulkTextareaProps } from './BulkTextarea.types';\nexport type { ErrorItem } from './components/InputField/InputField.types';\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,gBAAgB"}
|
|
@@ -6,12 +6,12 @@ import it from './it.json';
|
|
|
6
6
|
import ja from './ja.json';
|
|
7
7
|
import ko from './ko.json';
|
|
8
8
|
import nl from './nl.json';
|
|
9
|
-
import pl from './pl.json';
|
|
10
9
|
import pt from './pt.json';
|
|
11
|
-
import sv from './sv.json';
|
|
12
10
|
import tr from './tr.json';
|
|
13
11
|
import vi from './vi.json';
|
|
14
12
|
import zh from './zh.json';
|
|
13
|
+
import pl from './pl.json';
|
|
14
|
+
import sv from './sv.json';
|
|
15
15
|
export var localizedMessages = {
|
|
16
16
|
de: de,
|
|
17
17
|
en: en,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__intergalactic-dynamic-locales.js","names":["de","en","es","fr","it","ja","ko","nl","
|
|
1
|
+
{"version":3,"file":"__intergalactic-dynamic-locales.js","names":["de","en","es","fr","it","ja","ko","nl","pt","tr","vi","zh","pl","sv","localizedMessages"],"sources":["../../../src/translations/__intergalactic-dynamic-locales.ts"],"sourcesContent":["import de from './de.json';\nimport en from './en.json';\nimport es from './es.json';\nimport fr from './fr.json';\nimport it from './it.json';\nimport ja from './ja.json';\nimport ko from './ko.json';\nimport nl from './nl.json';\nimport pt from './pt.json';\nimport tr from './tr.json';\nimport vi from './vi.json';\nimport zh from './zh.json';\nimport pl from './pl.json';\nimport sv from './sv.json';\n\nexport const localizedMessages = {\n de,\n en,\n es,\n fr,\n it,\n ja,\n ko,\n nl,\n pt,\n tr,\n vi,\n zh,\n pl,\n sv,\n};\n"],"mappings":"AAAA,OAAOA,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAE1B,OAAO,IAAMC,iBAAiB,GAAG;EAC/Bd,EAAE,EAAFA,EAAE;EACFC,EAAE,EAAFA,EAAE;EACFC,EAAE,EAAFA,EAAE;EACFC,EAAE,EAAFA,EAAE;EACFC,EAAE,EAAFA,EAAE;EACFC,EAAE,EAAFA,EAAE;EACFC,EAAE,EAAFA,EAAE;EACFC,EAAE,EAAFA,EAAE;EACFC,EAAE,EAAFA,EAAE;EACFC,EAAE,EAAFA,EAAE;EACFC,EAAE,EAAFA,EAAE;EACFC,EAAE,EAAFA,EAAE;EACFC,EAAE,EAAFA,EAAE;EACFC,EAAE,EAAFA;AACF,CAAC"}
|
package/lib/esm/BulkTextarea.mjs
CHANGED
|
@@ -1,38 +1,42 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import
|
|
3
|
+
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
4
4
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
6
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
6
|
-
import {
|
|
7
|
-
import { Box } from "@semcore/base-components";
|
|
8
|
-
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
9
|
-
import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
|
|
7
|
+
import createComponent, { assignProps, Component } from "@semcore/core";
|
|
10
8
|
import React from "react";
|
|
11
|
-
import {
|
|
9
|
+
import { Box } from "@semcore/flex-box";
|
|
10
|
+
import { InputField } from "./components/InputField/InputField.mjs";
|
|
12
11
|
import { Counter } from "./components/Counter.mjs";
|
|
12
|
+
import { ClearAll } from "./components/ClearAll.mjs";
|
|
13
13
|
import { ErrorsNavigation } from "./components/ErrorsNavigation.mjs";
|
|
14
|
-
import { InputField } from "./components/InputField/InputField.mjs";
|
|
15
14
|
import { localizedMessages } from "./translations/__intergalactic-dynamic-locales.mjs";
|
|
16
|
-
|
|
15
|
+
import i18nEnhance from "@semcore/utils/lib/enhances/i18nEnhance";
|
|
16
|
+
import focusSourceEnhance from "@semcore/utils/lib/enhances/focusSourceEnhance";
|
|
17
|
+
import uniqueIDEnhancement from "@semcore/utils/lib/uniqueID";
|
|
18
|
+
var BulkTextareaRoot = /* @__PURE__ */ function(_Component) {
|
|
19
|
+
_inherits(BulkTextareaRoot2, _Component);
|
|
20
|
+
var _super = _createSuper(BulkTextareaRoot2);
|
|
17
21
|
function BulkTextareaRoot2() {
|
|
18
22
|
var _this;
|
|
19
23
|
_classCallCheck(this, BulkTextareaRoot2);
|
|
20
24
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
21
25
|
args[_key] = arguments[_key];
|
|
22
26
|
}
|
|
23
|
-
_this =
|
|
24
|
-
_defineProperty(_this, "inputFieldRef", /* @__PURE__ */ React.createRef());
|
|
25
|
-
_defineProperty(_this, "clearAllButtonRef", /* @__PURE__ */ React.createRef());
|
|
26
|
-
_defineProperty(_this, "nextButtonRef", /* @__PURE__ */ React.createRef());
|
|
27
|
-
_defineProperty(_this, "prevButtonRef", /* @__PURE__ */ React.createRef());
|
|
28
|
-
_defineProperty(_this, "counterRef", /* @__PURE__ */ React.createRef());
|
|
29
|
-
_defineProperty(_this, "state", {
|
|
27
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
28
|
+
_defineProperty(_assertThisInitialized(_this), "inputFieldRef", /* @__PURE__ */ React.createRef());
|
|
29
|
+
_defineProperty(_assertThisInitialized(_this), "clearAllButtonRef", /* @__PURE__ */ React.createRef());
|
|
30
|
+
_defineProperty(_assertThisInitialized(_this), "nextButtonRef", /* @__PURE__ */ React.createRef());
|
|
31
|
+
_defineProperty(_assertThisInitialized(_this), "prevButtonRef", /* @__PURE__ */ React.createRef());
|
|
32
|
+
_defineProperty(_assertThisInitialized(_this), "counterRef", /* @__PURE__ */ React.createRef());
|
|
33
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
30
34
|
linesCount: 0,
|
|
31
35
|
isEmptyText: true,
|
|
32
36
|
errorIndex: -1,
|
|
33
37
|
highlightErrorIndex: false
|
|
34
38
|
});
|
|
35
|
-
_defineProperty(_this, "handleChangeLinesCount", function(linesCount) {
|
|
39
|
+
_defineProperty(_assertThisInitialized(_this), "handleChangeLinesCount", function(linesCount) {
|
|
36
40
|
var isEmpty = !linesCount;
|
|
37
41
|
_this.setState({
|
|
38
42
|
linesCount,
|
|
@@ -44,7 +48,7 @@ var BulkTextareaRoot = /* @__PURE__ */ (function(_Component) {
|
|
|
44
48
|
_this.handlers.state("normal");
|
|
45
49
|
}
|
|
46
50
|
});
|
|
47
|
-
_defineProperty(_this, "handleClickClearAll", function(e) {
|
|
51
|
+
_defineProperty(_assertThisInitialized(_this), "handleClickClearAll", function(e) {
|
|
48
52
|
var _this$inputFieldRef$c;
|
|
49
53
|
_this.handlers.showErrors(false);
|
|
50
54
|
_this.handlers.errors([]);
|
|
@@ -54,11 +58,9 @@ var BulkTextareaRoot = /* @__PURE__ */ (function(_Component) {
|
|
|
54
58
|
_this.handlers.value("", e);
|
|
55
59
|
_this.handlers.state("normal");
|
|
56
60
|
var textarea = (_this$inputFieldRef$c = _this.inputFieldRef.current) === null || _this$inputFieldRef$c === void 0 ? void 0 : _this$inputFieldRef$c.querySelector('[role="textbox"]');
|
|
57
|
-
|
|
58
|
-
textarea.focus();
|
|
59
|
-
}
|
|
61
|
+
textarea instanceof HTMLDivElement && textarea.focus();
|
|
60
62
|
});
|
|
61
|
-
_defineProperty(_this, "handleChangeErrorIndex", function(amount) {
|
|
63
|
+
_defineProperty(_assertThisInitialized(_this), "handleChangeErrorIndex", function(amount) {
|
|
62
64
|
return function() {
|
|
63
65
|
var _this$asProps$errors = _this.asProps.errors, errors = _this$asProps$errors === void 0 ? [] : _this$asProps$errors;
|
|
64
66
|
var errorIndex = _this.state.errorIndex;
|
|
@@ -88,8 +90,7 @@ var BulkTextareaRoot = /* @__PURE__ */ (function(_Component) {
|
|
|
88
90
|
});
|
|
89
91
|
return _this;
|
|
90
92
|
}
|
|
91
|
-
|
|
92
|
-
return _createClass(BulkTextareaRoot2, [{
|
|
93
|
+
_createClass(BulkTextareaRoot2, [{
|
|
93
94
|
key: "uncontrolledProps",
|
|
94
95
|
value: function uncontrolledProps() {
|
|
95
96
|
return {
|
|
@@ -108,9 +109,9 @@ var BulkTextareaRoot = /* @__PURE__ */ (function(_Component) {
|
|
|
108
109
|
key: "getInputFieldProps",
|
|
109
110
|
value: function getInputFieldProps() {
|
|
110
111
|
var _this2 = this;
|
|
111
|
-
var _this$asProps = this.asProps, value = _this$asProps.value, size = _this$asProps.size, minRows = _this$asProps.minRows, maxRows = _this$asProps.maxRows, lineValidation = _this$asProps.lineValidation, placeholder = _this$asProps.placeholder, validateOn = _this$asProps.validateOn, linesDelimiters = _this$asProps.linesDelimiters, maxLines = _this$asProps.maxLines, disabled = _this$asProps.disabled, readonly = _this$asProps.readonly, pasteProps = _this$asProps.pasteProps, lineProcessing = _this$asProps.lineProcessing, _this$asProps$errors2 = _this$asProps.errors, errors = _this$asProps$errors2 === void 0 ? [] : _this$asProps$errors2, showErrors = _this$asProps.showErrors
|
|
112
|
+
var _this$asProps = this.asProps, value = _this$asProps.value, size = _this$asProps.size, minRows = _this$asProps.minRows, maxRows = _this$asProps.maxRows, lineValidation = _this$asProps.lineValidation, placeholder = _this$asProps.placeholder, validateOn = _this$asProps.validateOn, linesDelimiters = _this$asProps.linesDelimiters, maxLines = _this$asProps.maxLines, disabled = _this$asProps.disabled, readonly = _this$asProps.readonly, pasteProps = _this$asProps.pasteProps, lineProcessing = _this$asProps.lineProcessing, _this$asProps$errors2 = _this$asProps.errors, errors = _this$asProps$errors2 === void 0 ? [] : _this$asProps$errors2, showErrors = _this$asProps.showErrors;
|
|
112
113
|
var _this$state = this.state, errorIndex = _this$state.errorIndex, prevError = _this$state.prevError, linesCount = _this$state.linesCount, highlightErrorIndex = _this$state.highlightErrorIndex;
|
|
113
|
-
return _defineProperty(
|
|
114
|
+
return _defineProperty({
|
|
114
115
|
value,
|
|
115
116
|
size,
|
|
116
117
|
state: showErrors && (errors === null || errors === void 0 ? void 0 : errors.length) > 0 ? "invalid" : "normal",
|
|
@@ -132,16 +133,16 @@ var BulkTextareaRoot = /* @__PURE__ */ (function(_Component) {
|
|
|
132
133
|
},
|
|
133
134
|
onBlur: function onBlur(value2, event) {
|
|
134
135
|
var _this2$props$onChange, _this2$props;
|
|
135
|
-
if (validateOn !== null && validateOn !== void 0 && validateOn.includes("blur") && (
|
|
136
|
+
if (validateOn !== null && validateOn !== void 0 && validateOn.includes("blur") && (_this2.asProps.focusSourceRef.current === "keyboard" || event instanceof FocusEvent && event.relatedTarget !== _this2.clearAllButtonRef.current)) {
|
|
136
137
|
_this2.handlers.showErrors(true);
|
|
137
138
|
}
|
|
138
139
|
if (_this2.asProps.showErrors === false && (validateOn !== null && validateOn !== void 0 && validateOn.includes("blur") || validateOn !== null && validateOn !== void 0 && validateOn.includes("blurLine"))) {
|
|
139
140
|
setTimeout(function() {
|
|
140
141
|
var _this2$nextButtonRef$;
|
|
141
|
-
(_this2$nextButtonRef$ = _this2.nextButtonRef.current) === null || _this2$nextButtonRef$ === void 0
|
|
142
|
+
(_this2$nextButtonRef$ = _this2.nextButtonRef.current) === null || _this2$nextButtonRef$ === void 0 ? void 0 : _this2$nextButtonRef$.focus();
|
|
142
143
|
}, 250);
|
|
143
144
|
}
|
|
144
|
-
(_this2$props$onChange = (_this2$props = _this2.props).onChange) === null || _this2$props$onChange === void 0
|
|
145
|
+
(_this2$props$onChange = (_this2$props = _this2.props).onChange) === null || _this2$props$onChange === void 0 ? void 0 : _this2$props$onChange.call(_this2$props, value2, event);
|
|
145
146
|
},
|
|
146
147
|
showErrors,
|
|
147
148
|
validateOn,
|
|
@@ -181,7 +182,7 @@ var BulkTextareaRoot = /* @__PURE__ */ (function(_Component) {
|
|
|
181
182
|
},
|
|
182
183
|
linesDelimiters,
|
|
183
184
|
ref: this.inputFieldRef
|
|
184
|
-
}, "aria-describedby", this.counterId)
|
|
185
|
+
}, "aria-describedby", this.counterId);
|
|
185
186
|
}
|
|
186
187
|
}, {
|
|
187
188
|
key: "getCounterProps",
|
|
@@ -244,7 +245,8 @@ var BulkTextareaRoot = /* @__PURE__ */ (function(_Component) {
|
|
|
244
245
|
}, _ref));
|
|
245
246
|
}
|
|
246
247
|
}]);
|
|
247
|
-
|
|
248
|
+
return BulkTextareaRoot2;
|
|
249
|
+
}(Component);
|
|
248
250
|
_defineProperty(BulkTextareaRoot, "displayName", "BulkTextarea");
|
|
249
251
|
_defineProperty(BulkTextareaRoot, "defaultProps", {
|
|
250
252
|
defaultValue: "",
|
|
@@ -258,15 +260,15 @@ _defineProperty(BulkTextareaRoot, "defaultProps", {
|
|
|
258
260
|
defaultErrors: [],
|
|
259
261
|
defaultShowErrors: false
|
|
260
262
|
});
|
|
261
|
-
_defineProperty(BulkTextareaRoot, "enhance", [i18nEnhance(localizedMessages), uniqueIDEnhancement()]);
|
|
262
|
-
var BulkTextarea =
|
|
263
|
+
_defineProperty(BulkTextareaRoot, "enhance", [i18nEnhance(localizedMessages), focusSourceEnhance(), uniqueIDEnhancement()]);
|
|
264
|
+
var BulkTextarea = function() {
|
|
263
265
|
return createComponent(BulkTextareaRoot, {
|
|
264
266
|
InputField,
|
|
265
267
|
Counter,
|
|
266
268
|
ClearAll,
|
|
267
269
|
ErrorsNavigation
|
|
268
270
|
});
|
|
269
|
-
}
|
|
271
|
+
}();
|
|
270
272
|
export {
|
|
271
273
|
BulkTextarea as default
|
|
272
274
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import { sstyled, assignProps } from "@semcore/core";
|
|
3
|
+
import React from "react";
|
|
3
4
|
import Button from "@semcore/button";
|
|
4
5
|
import CloseM from "@semcore/icon/Close/m";
|
|
5
|
-
import React from "react";
|
|
6
6
|
function ClearAll(props) {
|
|
7
7
|
var _ref = arguments[0], _ref2;
|
|
8
8
|
var SButton = Button;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { assignProps } from "@semcore/core";
|
|
2
|
-
import { ScreenReaderOnly } from "@semcore/base-components";
|
|
3
|
-
import CounterKit from "@semcore/counter";
|
|
4
2
|
import React from "react";
|
|
3
|
+
import { ScreenReaderOnly } from "@semcore/flex-box";
|
|
4
|
+
import CounterKit from "@semcore/counter";
|
|
5
5
|
function Counter(props) {
|
|
6
6
|
var _ref = arguments[0];
|
|
7
7
|
var theme = props.theme, linesCount = props.linesCount, maxLines = props.maxLines, getI18nText = props.getI18nText;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
2
|
import Button from "@semcore/button";
|
|
3
|
-
import
|
|
4
|
-
import ChevronUpM from "@semcore/icon/ChevronUp/m";
|
|
3
|
+
import { Flex } from "@semcore/flex-box";
|
|
5
4
|
import { Text } from "@semcore/typography";
|
|
6
|
-
import
|
|
5
|
+
import ChevronUpM from "@semcore/icon/ChevronUp/m";
|
|
6
|
+
import ChevronDownM from "@semcore/icon/ChevronDown/m";
|
|
7
7
|
function ErrorsNavigation(props) {
|
|
8
8
|
var errorIndex = props.errorIndex, errorsCount = props.errorsCount, onPrevError = props.onPrevError, onNextError = props.onNextError, size = props.size, showErrors = props.showErrors, getI18nText = props.getI18nText, disabled = props.disabled, nextButtonRef = props.nextButtonRef, prevButtonRef = props.prevButtonRef;
|
|
9
9
|
return /* @__PURE__ */ React.createElement(Flex, {
|