optimized-react-component-library-xyz123 0.4.3 → 0.5.1

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 CHANGED
@@ -1978,10 +1978,12 @@ var QuestionGroup = ({
1978
1978
  showPreview = false,
1979
1979
  markQuestionAsDisplayed
1980
1980
  }) => {
1981
+ var _a;
1981
1982
  if (!questions || questions.length === 0) {
1982
1983
  return null;
1983
1984
  }
1984
1985
  const firstQuestion = questions[0];
1986
+ const groupMandatory = (_a = firstQuestion.validationType) == null ? void 0 : _a.find((e) => e.startsWith("groupCheck-"));
1985
1987
  (0, import_react12.useEffect)(() => {
1986
1988
  questions.forEach((question) => {
1987
1989
  if (question.visible && !question.isDisplayed) {
@@ -2012,7 +2014,10 @@ var QuestionGroup = ({
2012
2014
  "aria-describedby": firstQuestion.hasValidationError ? `${firstQuestion.id}-error` : void 0,
2013
2015
  children: [
2014
2016
  legendLabel && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("legend", { children: [
2015
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "pts-legend", children: legendLabel }),
2017
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "pts-legend", children: [
2018
+ legendLabel,
2019
+ groupMandatory && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" })
2020
+ ] }),
2016
2021
  firstQuestion.hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "sr-only", children: [
2017
2022
  "Valideringsfel. ",
2018
2023
  firstQuestion.validationDefaultMessesege
@@ -2095,15 +2100,7 @@ var CookieBanner = ({
2095
2100
  ]
2096
2101
  }
2097
2102
  ),
2098
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2099
- "a",
2100
- {
2101
- href: "https://pts.se/om-oss/om-pts.se/kakor-pa-webbplatsen/kakor-pa-pts-e-tjanster/",
2102
- target: "_blank",
2103
- rel: "noopener noreferrer",
2104
- children: "Kakor (cookies) p\xE5 pts.se (\xF6ppnas i nytt f\xF6nster)"
2105
- }
2106
- )
2103
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("a", { href: "www.pts.se", target: "_blank", rel: "noopener noreferrer", children: "Kakor (cookies) p\xE5 pts.se (\xF6ppnas i nytt f\xF6nster)" })
2107
2104
  ] }),
2108
2105
  /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "pts-cookieBanner-Buttons", children: [
2109
2106
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { onClick: () => handleCookieChoice(true), children: "Ja, jag samtycker" }),