@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.
- package/CHANGELOG.md +6 -0
- package/lib/cjs/BulkTextarea.js +35 -38
- 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 +219 -167
- 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 +70 -32
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +4 -5
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/BulkTextarea.js +31 -32
- 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 +219 -165
- 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 +70 -32
- 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 +33 -35
- 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 +181 -136
- package/lib/esm/components/InputField/inputField.shadow.css +70 -32
- 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 +113 -8
- 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 +12 -7
- package/lib/types/components/InputField/InputField.types.d.ts +11 -125
- package/package.json +10 -10
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
SInputField
|
|
1
|
+
SInputField>div {
|
|
2
2
|
box-sizing: content-box;
|
|
3
3
|
outline: none;
|
|
4
4
|
border-radius: var(--intergalactic-control-rounded, 6px);
|
|
5
|
-
border-color: var(--intergalactic-border-primary,
|
|
5
|
+
border-color: var(--intergalactic-border-primary, oklch(0.137 0.026 175.7 / 0.161));
|
|
6
6
|
border-style: solid;
|
|
7
7
|
border-width: 1px;
|
|
8
8
|
overflow: auto;
|
|
9
9
|
position: relative;
|
|
10
10
|
|
|
11
|
-
background-color: var(--intergalactic-bg-primary-neutral,
|
|
12
|
-
color: var(--intergalactic-text-primary,
|
|
11
|
+
background-color: var(--intergalactic-bg-primary-neutral, oklch(1 0 0));
|
|
12
|
+
color: var(--intergalactic-text-primary, oklch(0.1 0.03 137 / 0.899));
|
|
13
13
|
word-wrap: break-word;
|
|
14
14
|
word-break: break-word;
|
|
15
15
|
font-family: inherit;
|
|
16
16
|
|
|
17
17
|
&:empty::before {
|
|
18
18
|
content: '1. ' attr(placeholder);
|
|
19
|
-
color: var(--intergalactic-text-placeholder,
|
|
19
|
+
color: var(--intergalactic-text-placeholder, oklch(0.098 0.023 157.4 / 0.457));
|
|
20
20
|
position: absolute;
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -32,12 +32,12 @@ SInputField > div {
|
|
|
32
32
|
display: inline-block;
|
|
33
33
|
white-space: nowrap;
|
|
34
34
|
text-align: right;
|
|
35
|
-
color: var(--intergalactic-text-secondary,
|
|
35
|
+
color: var(--intergalactic-text-secondary, oklch(0.088 0.026 147.7 / 0.583));
|
|
36
36
|
margin-right: var(--intergalactic-spacing-1x, 4px);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
>
|
|
40
|
+
>p {
|
|
41
41
|
counter-increment: row;
|
|
42
42
|
/*display: inline-block;*/
|
|
43
43
|
margin: 0 0 var(--intergalactic-spacing-1x, 4px) 0;
|
|
@@ -55,7 +55,7 @@ SInputField > div {
|
|
|
55
55
|
display: inline-block;
|
|
56
56
|
white-space: nowrap;
|
|
57
57
|
text-align: right;
|
|
58
|
-
color: var(--intergalactic-text-secondary,
|
|
58
|
+
color: var(--intergalactic-text-secondary, oklch(0.088 0.026 147.7 / 0.583));
|
|
59
59
|
margin-right: var(--intergalactic-spacing-1x, 4px);
|
|
60
60
|
|
|
61
61
|
position: absolute;
|
|
@@ -63,43 +63,65 @@ SInputField > div {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
&[data-over-max-rows='true'] {
|
|
66
|
-
background-color: var(--intergalactic-bg-secondary-critical,
|
|
66
|
+
background-color: var(--intergalactic-bg-secondary-critical, oklch(0.958 0.029 5.7));
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
&:has(p:nth-child(n + 10)) {
|
|
71
|
-
>
|
|
71
|
+
>p {
|
|
72
72
|
padding-left: var(--intergalactic-spacing-6x, 24px);
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
|
|
75
|
+
>p:nth-child(-n + 9)::before {
|
|
75
76
|
padding-left: var(--intergalactic-spacing-2x, 8px);
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
&:has(p:nth-child(n + 100)) {
|
|
80
|
-
>
|
|
81
|
+
>p {
|
|
81
82
|
padding-left: var(--intergalactic-spacing-8x, 32px);
|
|
82
83
|
}
|
|
83
|
-
|
|
84
|
+
|
|
85
|
+
>p:nth-child(-n + 9)::before {
|
|
84
86
|
padding-left: var(--intergalactic-spacing-4x, 16px);
|
|
85
87
|
}
|
|
86
|
-
|
|
88
|
+
|
|
89
|
+
>p:nth-child(n + 10)::before {
|
|
87
90
|
padding-left: var(--intergalactic-spacing-2x, 8px);
|
|
88
91
|
}
|
|
92
|
+
|
|
93
|
+
>p:nth-child(n + 100)::before {
|
|
94
|
+
padding-left: 0;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&:has(p:nth-child(n + 1000)) {
|
|
99
|
+
> p {
|
|
100
|
+
padding-left: calc(var(--intergalactic-spacing-10x, 40px) + var(--intergalactic-spacing-1x, 4px));
|
|
101
|
+
}
|
|
102
|
+
> p:nth-child(-n + 9)::before {
|
|
103
|
+
padding-left: var(--intergalactic-spacing-6x, 24px);
|
|
104
|
+
}
|
|
105
|
+
> p:nth-child(n + 10)::before {
|
|
106
|
+
padding-left: var(--intergalactic-spacing-4x, 16px);
|
|
107
|
+
}
|
|
89
108
|
> p:nth-child(n + 100)::before {
|
|
109
|
+
padding-left: var(--intergalactic-spacing-2x, 8px);
|
|
110
|
+
}
|
|
111
|
+
> p:nth-child(n + 1000)::before {
|
|
90
112
|
padding-left: 0;
|
|
91
113
|
}
|
|
92
114
|
}
|
|
93
115
|
}
|
|
94
116
|
|
|
95
|
-
SInputField[showErrors]
|
|
117
|
+
SInputField[showErrors]>div[aria-invalid]>p[aria-invalid]:after {
|
|
96
118
|
content: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBmaWxsPSIjZDEwMDJmIj48cGF0aCBkPSJNNyA2aDJ2NEg3VjZabTIgN3YtMkg3djJoMloiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYuMTUyIDEuMTcyYy43MTktMS41NjMgMi45NzctMS41NjMgMy42OTYgMGw2LjA0MyAxMy4xNDFjLjM2My43OTEtLjIyNSAxLjY4Ny0xLjEwOSAxLjY4N0gxLjIxOGMtLjg4NCAwLTEuNDcyLS44OTYtMS4xMDktMS42ODdMNi4xNTIgMS4xNzJabTcuMzc0IDEyLjgzN0w4IDEuOTkgMi40NzQgMTQuMDFoMTEuMDUyWiIvPjwvc3ZnPgo= ");
|
|
97
119
|
position: absolute;
|
|
98
120
|
right: 0;
|
|
99
121
|
top: var(--intergalactic-spacing-05x, 2px);
|
|
100
122
|
}
|
|
101
123
|
|
|
102
|
-
SInputField[size='m']
|
|
124
|
+
SInputField[size='m']>div {
|
|
103
125
|
padding: var(--intergalactic-spacing-2x, 8px) var(--intergalactic-spacing-4x, 16px);
|
|
104
126
|
font-size: var(--intergalactic-fs-200, 14px);
|
|
105
127
|
line-height: var(--intergalactic-lh-200, 142%);
|
|
@@ -110,13 +132,14 @@ SInputField[size='m'] > div {
|
|
|
110
132
|
|
|
111
133
|
&:empty {
|
|
112
134
|
padding-left: var(--intergalactic-spacing-8x, 32px);
|
|
135
|
+
|
|
113
136
|
&::before {
|
|
114
137
|
left: var(--intergalactic-spacing-4x, 16px);
|
|
115
138
|
}
|
|
116
139
|
}
|
|
117
140
|
}
|
|
118
141
|
|
|
119
|
-
SInputField[size='l']
|
|
142
|
+
SInputField[size='l']>div {
|
|
120
143
|
padding: var(--intergalactic-spacing-3x, 12px) var(--intergalactic-spacing-4x, 16px);
|
|
121
144
|
font-size: var(--intergalactic-fs-300, 16px);
|
|
122
145
|
line-height: var(--intergalactic-lh-300, 150%);
|
|
@@ -126,6 +149,7 @@ SInputField[size='l'] > div {
|
|
|
126
149
|
|
|
127
150
|
&:empty {
|
|
128
151
|
padding-left: calc(var(--intergalactic-spacing-8x, 32px) + var(--intergalactic-spacing-05x, 2px));
|
|
152
|
+
|
|
129
153
|
&::before {
|
|
130
154
|
left: var(--intergalactic-spacing-4x, 16px);
|
|
131
155
|
}
|
|
@@ -133,39 +157,53 @@ SInputField[size='l'] > div {
|
|
|
133
157
|
}
|
|
134
158
|
|
|
135
159
|
|
|
136
|
-
SInputField[state='normal']:not([disabled])
|
|
160
|
+
SInputField[state='normal']:not([disabled])>div {
|
|
137
161
|
&:focus {
|
|
138
|
-
|
|
139
|
-
|
|
162
|
+
border-color: var(--intergalactic-border-info-active, oklch(0.382 0.248 264.2 / 0.386));
|
|
163
|
+
@mixin focus-outline-mixin {
|
|
164
|
+
outline-offset: 0;
|
|
165
|
+
transition-property: outline-color, outline-width;
|
|
166
|
+
}
|
|
140
167
|
}
|
|
141
168
|
}
|
|
142
169
|
|
|
143
|
-
SInputField[state='valid']
|
|
144
|
-
border-color: var(--intergalactic-border-success-active,
|
|
170
|
+
SInputField[state='valid']>div {
|
|
171
|
+
border-color: var(--intergalactic-border-success-active, oklch(0.75 0.153 167.5));
|
|
145
172
|
|
|
146
173
|
&:focus {
|
|
147
|
-
|
|
174
|
+
border-color: var(--intergalactic-border-success-active, oklch(0.75 0.153 167.5));
|
|
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));
|
|
148
180
|
}
|
|
149
181
|
}
|
|
150
182
|
|
|
151
|
-
SInputField[state='invalid']
|
|
152
|
-
border-color: var(--intergalactic-border-critical-active,
|
|
183
|
+
SInputField[state='invalid']>div {
|
|
184
|
+
border-color: var(--intergalactic-border-critical-active, oklch(0.628 0.258 29 / 0.56));
|
|
153
185
|
|
|
154
186
|
&:focus {
|
|
155
|
-
|
|
187
|
+
border-color: var(--intergalactic-border-critical-active, oklch(0.628 0.258 29 / 0.56));
|
|
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));
|
|
156
193
|
}
|
|
157
194
|
|
|
158
|
-
background-image: var(--intergalactic-border-critical-pattern, repeating-linear-gradient(315deg,
|
|
195
|
+
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%));
|
|
159
196
|
background-size: 6px 6px;
|
|
160
|
-
background-color: var(--intergalactic-bg-primary-neutral,
|
|
197
|
+
background-color: var(--intergalactic-bg-primary-neutral, oklch(1 0 0));
|
|
161
198
|
border-bottom-left-radius: var(--intergalactic-control-rounded, 6px);
|
|
162
199
|
border-top-left-radius: var(--intergalactic-control-rounded, 6px);
|
|
163
200
|
background-repeat: repeat-y;
|
|
164
201
|
}
|
|
165
202
|
|
|
166
|
-
SInputField[readonly]
|
|
167
|
-
background-color: var(--intergalactic-bg-secondary-neutral,
|
|
203
|
+
SInputField[readonly]>div {
|
|
204
|
+
background-color: var(--intergalactic-bg-secondary-neutral, oklch(0.98 0.001 180));
|
|
168
205
|
}
|
|
169
|
-
|
|
170
|
-
|
|
206
|
+
|
|
207
|
+
SInputField[disabled]>div {
|
|
208
|
+
opacity: var(--intergalactic-disabled-opacity, 0.4);
|
|
171
209
|
}
|
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","ignoreList":[]}
|
|
@@ -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';
|
|
9
10
|
import pt from './pt.json';
|
|
11
|
+
import sv from './sv.json';
|
|
10
12
|
import tr from './tr.json';
|
|
11
13
|
import vi from './vi.json';
|
|
12
14
|
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","pl","pt","sv","tr","vi","zh","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 pl from './pl.json';\nimport pt from './pt.json';\nimport sv from './sv.json';\nimport tr from './tr.json';\nimport vi from './vi.json';\nimport zh from './zh.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;EACFE,EAAE,EAAFA,EAAE;EACFE,EAAE,EAAFA,EAAE;EACFC,EAAE,EAAFA,EAAE;EACFC,EAAE,EAAFA,EAAE;EACFL,EAAE,EAAFA,EAAE;EACFE,EAAE,EAAFA;AACF,CAAC","ignoreList":[]}
|
package/lib/esm/BulkTextarea.mjs
CHANGED
|
@@ -1,42 +1,38 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import
|
|
3
|
+
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
4
4
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
5
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
|
-
import
|
|
6
|
+
import { lastInteraction, assignProps, Component, createComponent } from "@semcore/core";
|
|
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";
|
|
8
10
|
import React from "react";
|
|
9
|
-
import { Box } from "@semcore/flex-box";
|
|
10
|
-
import { InputField } from "./components/InputField/InputField.mjs";
|
|
11
|
-
import { Counter } from "./components/Counter.mjs";
|
|
12
11
|
import { ClearAll } from "./components/ClearAll.mjs";
|
|
12
|
+
import { Counter } from "./components/Counter.mjs";
|
|
13
13
|
import { ErrorsNavigation } from "./components/ErrorsNavigation.mjs";
|
|
14
|
+
import { InputField } from "./components/InputField/InputField.mjs";
|
|
14
15
|
import { localizedMessages } from "./translations/__intergalactic-dynamic-locales.mjs";
|
|
15
|
-
|
|
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);
|
|
16
|
+
var BulkTextareaRoot = /* @__PURE__ */ (function(_Component) {
|
|
21
17
|
function BulkTextareaRoot2() {
|
|
22
18
|
var _this;
|
|
23
19
|
_classCallCheck(this, BulkTextareaRoot2);
|
|
24
20
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
25
21
|
args[_key] = arguments[_key];
|
|
26
22
|
}
|
|
27
|
-
_this =
|
|
28
|
-
_defineProperty(
|
|
29
|
-
_defineProperty(
|
|
30
|
-
_defineProperty(
|
|
31
|
-
_defineProperty(
|
|
32
|
-
_defineProperty(
|
|
33
|
-
_defineProperty(
|
|
23
|
+
_this = _callSuper(this, BulkTextareaRoot2, [].concat(args));
|
|
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", {
|
|
34
30
|
linesCount: 0,
|
|
35
31
|
isEmptyText: true,
|
|
36
32
|
errorIndex: -1,
|
|
37
33
|
highlightErrorIndex: false
|
|
38
34
|
});
|
|
39
|
-
_defineProperty(
|
|
35
|
+
_defineProperty(_this, "handleChangeLinesCount", function(linesCount) {
|
|
40
36
|
var isEmpty = !linesCount;
|
|
41
37
|
_this.setState({
|
|
42
38
|
linesCount,
|
|
@@ -48,7 +44,7 @@ var BulkTextareaRoot = /* @__PURE__ */ function(_Component) {
|
|
|
48
44
|
_this.handlers.state("normal");
|
|
49
45
|
}
|
|
50
46
|
});
|
|
51
|
-
_defineProperty(
|
|
47
|
+
_defineProperty(_this, "handleClickClearAll", function(e) {
|
|
52
48
|
var _this$inputFieldRef$c;
|
|
53
49
|
_this.handlers.showErrors(false);
|
|
54
50
|
_this.handlers.errors([]);
|
|
@@ -58,9 +54,11 @@ var BulkTextareaRoot = /* @__PURE__ */ function(_Component) {
|
|
|
58
54
|
_this.handlers.value("", e);
|
|
59
55
|
_this.handlers.state("normal");
|
|
60
56
|
var textarea = (_this$inputFieldRef$c = _this.inputFieldRef.current) === null || _this$inputFieldRef$c === void 0 ? void 0 : _this$inputFieldRef$c.querySelector('[role="textbox"]');
|
|
61
|
-
textarea instanceof HTMLDivElement
|
|
57
|
+
if (textarea instanceof HTMLDivElement) {
|
|
58
|
+
textarea.focus();
|
|
59
|
+
}
|
|
62
60
|
});
|
|
63
|
-
_defineProperty(
|
|
61
|
+
_defineProperty(_this, "handleChangeErrorIndex", function(amount) {
|
|
64
62
|
return function() {
|
|
65
63
|
var _this$asProps$errors = _this.asProps.errors, errors = _this$asProps$errors === void 0 ? [] : _this$asProps$errors;
|
|
66
64
|
var errorIndex = _this.state.errorIndex;
|
|
@@ -90,7 +88,8 @@ var BulkTextareaRoot = /* @__PURE__ */ function(_Component) {
|
|
|
90
88
|
});
|
|
91
89
|
return _this;
|
|
92
90
|
}
|
|
93
|
-
|
|
91
|
+
_inherits(BulkTextareaRoot2, _Component);
|
|
92
|
+
return _createClass(BulkTextareaRoot2, [{
|
|
94
93
|
key: "uncontrolledProps",
|
|
95
94
|
value: function uncontrolledProps() {
|
|
96
95
|
return {
|
|
@@ -109,9 +108,9 @@ var BulkTextareaRoot = /* @__PURE__ */ function(_Component) {
|
|
|
109
108
|
key: "getInputFieldProps",
|
|
110
109
|
value: function getInputFieldProps() {
|
|
111
110
|
var _this2 = this;
|
|
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;
|
|
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, onImmediatelyChange = _this$asProps.onImmediatelyChange;
|
|
113
112
|
var _this$state = this.state, errorIndex = _this$state.errorIndex, prevError = _this$state.prevError, linesCount = _this$state.linesCount, highlightErrorIndex = _this$state.highlightErrorIndex;
|
|
114
|
-
return _defineProperty({
|
|
113
|
+
return _defineProperty(_defineProperty({
|
|
115
114
|
value,
|
|
116
115
|
size,
|
|
117
116
|
state: showErrors && (errors === null || errors === void 0 ? void 0 : errors.length) > 0 ? "invalid" : "normal",
|
|
@@ -133,16 +132,16 @@ var BulkTextareaRoot = /* @__PURE__ */ function(_Component) {
|
|
|
133
132
|
},
|
|
134
133
|
onBlur: function onBlur(value2, event) {
|
|
135
134
|
var _this2$props$onChange, _this2$props;
|
|
136
|
-
if (validateOn !== null && validateOn !== void 0 && validateOn.includes("blur") && (
|
|
135
|
+
if (validateOn !== null && validateOn !== void 0 && validateOn.includes("blur") && (lastInteraction.isKeyboard() || event instanceof FocusEvent && event.relatedTarget !== _this2.clearAllButtonRef.current)) {
|
|
137
136
|
_this2.handlers.showErrors(true);
|
|
138
137
|
}
|
|
139
138
|
if (_this2.asProps.showErrors === false && (validateOn !== null && validateOn !== void 0 && validateOn.includes("blur") || validateOn !== null && validateOn !== void 0 && validateOn.includes("blurLine"))) {
|
|
140
139
|
setTimeout(function() {
|
|
141
140
|
var _this2$nextButtonRef$;
|
|
142
|
-
(_this2$nextButtonRef$ = _this2.nextButtonRef.current) === null || _this2$nextButtonRef$ === void 0
|
|
141
|
+
(_this2$nextButtonRef$ = _this2.nextButtonRef.current) === null || _this2$nextButtonRef$ === void 0 || _this2$nextButtonRef$.focus();
|
|
143
142
|
}, 250);
|
|
144
143
|
}
|
|
145
|
-
(_this2$props$onChange = (_this2$props = _this2.props).onChange) === null || _this2$props$onChange === void 0
|
|
144
|
+
(_this2$props$onChange = (_this2$props = _this2.props).onChange) === null || _this2$props$onChange === void 0 || _this2$props$onChange.call(_this2$props, value2, event);
|
|
146
145
|
},
|
|
147
146
|
showErrors,
|
|
148
147
|
validateOn,
|
|
@@ -182,7 +181,7 @@ var BulkTextareaRoot = /* @__PURE__ */ function(_Component) {
|
|
|
182
181
|
},
|
|
183
182
|
linesDelimiters,
|
|
184
183
|
ref: this.inputFieldRef
|
|
185
|
-
}, "aria-describedby", this.counterId);
|
|
184
|
+
}, "aria-describedby", this.counterId), "onImmediatelyChange", onImmediatelyChange);
|
|
186
185
|
}
|
|
187
186
|
}, {
|
|
188
187
|
key: "getCounterProps",
|
|
@@ -245,8 +244,7 @@ var BulkTextareaRoot = /* @__PURE__ */ function(_Component) {
|
|
|
245
244
|
}, _ref));
|
|
246
245
|
}
|
|
247
246
|
}]);
|
|
248
|
-
|
|
249
|
-
}(Component);
|
|
247
|
+
})(Component);
|
|
250
248
|
_defineProperty(BulkTextareaRoot, "displayName", "BulkTextarea");
|
|
251
249
|
_defineProperty(BulkTextareaRoot, "defaultProps", {
|
|
252
250
|
defaultValue: "",
|
|
@@ -260,15 +258,15 @@ _defineProperty(BulkTextareaRoot, "defaultProps", {
|
|
|
260
258
|
defaultErrors: [],
|
|
261
259
|
defaultShowErrors: false
|
|
262
260
|
});
|
|
263
|
-
_defineProperty(BulkTextareaRoot, "enhance", [i18nEnhance(localizedMessages),
|
|
264
|
-
var BulkTextarea = function() {
|
|
261
|
+
_defineProperty(BulkTextareaRoot, "enhance", [i18nEnhance(localizedMessages), uniqueIDEnhancement()]);
|
|
262
|
+
var BulkTextarea = (function() {
|
|
265
263
|
return createComponent(BulkTextareaRoot, {
|
|
266
264
|
InputField,
|
|
267
265
|
Counter,
|
|
268
266
|
ClearAll,
|
|
269
267
|
ErrorsNavigation
|
|
270
268
|
});
|
|
271
|
-
}();
|
|
269
|
+
})();
|
|
272
270
|
export {
|
|
273
271
|
BulkTextarea as default
|
|
274
272
|
};
|
|
@@ -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";
|
|
4
3
|
import Button from "@semcore/button";
|
|
5
4
|
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
|
|
3
|
-
import { ScreenReaderOnly } from "@semcore/flex-box";
|
|
2
|
+
import { ScreenReaderOnly } from "@semcore/base-components";
|
|
4
3
|
import CounterKit from "@semcore/counter";
|
|
4
|
+
import React from "react";
|
|
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 { Flex } from "@semcore/base-components";
|
|
2
2
|
import Button from "@semcore/button";
|
|
3
|
-
import { Flex } from "@semcore/flex-box";
|
|
4
|
-
import { Text } from "@semcore/typography";
|
|
5
|
-
import ChevronUpM from "@semcore/icon/ChevronUp/m";
|
|
6
3
|
import ChevronDownM from "@semcore/icon/ChevronDown/m";
|
|
4
|
+
import ChevronUpM from "@semcore/icon/ChevronUp/m";
|
|
5
|
+
import { Text } from "@semcore/typography";
|
|
6
|
+
import React from "react";
|
|
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, {
|