optimized-react-component-library-xyz123 0.19.1 → 0.19.2
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/dist/index.js +11 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -245,11 +245,12 @@ var InputTextarea = ({
|
|
|
245
245
|
showPreview = false,
|
|
246
246
|
activatedLanguage
|
|
247
247
|
}) => {
|
|
248
|
-
var _a, _b, _c, _d
|
|
248
|
+
var _a, _b, _c, _d;
|
|
249
249
|
const questionId = `question-${question.id}`;
|
|
250
250
|
const inputId = `textarea-${question.id}`;
|
|
251
251
|
const aboutId = `about-${question.id}`;
|
|
252
252
|
const errorId = `error-${question.id}`;
|
|
253
|
+
const counterId = `counter-${question.id}`;
|
|
253
254
|
const defaultMaxLength = 1e3;
|
|
254
255
|
return /* @__PURE__ */ jsxs4(Fragment4, { children: [
|
|
255
256
|
!showPreview && question.visible && /* @__PURE__ */ jsxs4(
|
|
@@ -282,8 +283,11 @@ var InputTextarea = ({
|
|
|
282
283
|
required: question.isQuestionMandatory,
|
|
283
284
|
"aria-required": question.isQuestionMandatory,
|
|
284
285
|
"aria-invalid": question.hasValidationError,
|
|
285
|
-
|
|
286
|
-
|
|
286
|
+
"aria-describedby": [
|
|
287
|
+
question.aboutText ? aboutId : null,
|
|
288
|
+
question.hasValidationError ? errorId : null,
|
|
289
|
+
counterId
|
|
290
|
+
].filter(Boolean).join(" ") || void 0,
|
|
287
291
|
id: inputId
|
|
288
292
|
}
|
|
289
293
|
),
|
|
@@ -292,15 +296,16 @@ var InputTextarea = ({
|
|
|
292
296
|
/* @__PURE__ */ jsx4("span", { "aria-label": "Felmeddelande.", className: "errorDot", children: "!" }),
|
|
293
297
|
/* @__PURE__ */ jsx4("span", { className: "errorText", children: question.validationDefaultMessesege })
|
|
294
298
|
] }),
|
|
295
|
-
!((
|
|
299
|
+
!((_a = question.questionExtraAttribute) == null ? void 0 : _a.hideTextCounter) && /* @__PURE__ */ jsxs4(
|
|
296
300
|
"div",
|
|
297
301
|
{
|
|
298
|
-
|
|
302
|
+
id: counterId,
|
|
303
|
+
className: `pts-character-counter ${question.answer && (((_b = question.questionExtraAttribute) == null ? void 0 : _b.answerMaxLength) || defaultMaxLength) && question.answer.length > (((_c = question.questionExtraAttribute) == null ? void 0 : _c.answerMaxLength) || defaultMaxLength) ? "error" : ""}`,
|
|
299
304
|
children: [
|
|
300
305
|
question.answer ? question.answer.length : 0,
|
|
301
306
|
" av",
|
|
302
307
|
" ",
|
|
303
|
-
((
|
|
308
|
+
((_d = question.questionExtraAttribute) == null ? void 0 : _d.answerMaxLength) || defaultMaxLength,
|
|
304
309
|
" tecken"
|
|
305
310
|
]
|
|
306
311
|
}
|