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.js
CHANGED
|
@@ -327,11 +327,12 @@ var InputTextarea = ({
|
|
|
327
327
|
showPreview = false,
|
|
328
328
|
activatedLanguage
|
|
329
329
|
}) => {
|
|
330
|
-
var _a, _b, _c, _d
|
|
330
|
+
var _a, _b, _c, _d;
|
|
331
331
|
const questionId = `question-${question.id}`;
|
|
332
332
|
const inputId = `textarea-${question.id}`;
|
|
333
333
|
const aboutId = `about-${question.id}`;
|
|
334
334
|
const errorId = `error-${question.id}`;
|
|
335
|
+
const counterId = `counter-${question.id}`;
|
|
335
336
|
const defaultMaxLength = 1e3;
|
|
336
337
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
337
338
|
!showPreview && question.visible && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
@@ -364,8 +365,11 @@ var InputTextarea = ({
|
|
|
364
365
|
required: question.isQuestionMandatory,
|
|
365
366
|
"aria-required": question.isQuestionMandatory,
|
|
366
367
|
"aria-invalid": question.hasValidationError,
|
|
367
|
-
|
|
368
|
-
|
|
368
|
+
"aria-describedby": [
|
|
369
|
+
question.aboutText ? aboutId : null,
|
|
370
|
+
question.hasValidationError ? errorId : null,
|
|
371
|
+
counterId
|
|
372
|
+
].filter(Boolean).join(" ") || void 0,
|
|
369
373
|
id: inputId
|
|
370
374
|
}
|
|
371
375
|
),
|
|
@@ -374,15 +378,16 @@ var InputTextarea = ({
|
|
|
374
378
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { "aria-label": "Felmeddelande.", className: "errorDot", children: "!" }),
|
|
375
379
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "errorText", children: question.validationDefaultMessesege })
|
|
376
380
|
] }),
|
|
377
|
-
!((
|
|
381
|
+
!((_a = question.questionExtraAttribute) == null ? void 0 : _a.hideTextCounter) && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
378
382
|
"div",
|
|
379
383
|
{
|
|
380
|
-
|
|
384
|
+
id: counterId,
|
|
385
|
+
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" : ""}`,
|
|
381
386
|
children: [
|
|
382
387
|
question.answer ? question.answer.length : 0,
|
|
383
388
|
" av",
|
|
384
389
|
" ",
|
|
385
|
-
((
|
|
390
|
+
((_d = question.questionExtraAttribute) == null ? void 0 : _d.answerMaxLength) || defaultMaxLength,
|
|
386
391
|
" tecken"
|
|
387
392
|
]
|
|
388
393
|
}
|