@bigbinary/neeto-form-frontend 3.8.1 → 3.8.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/cjs/BuildForm.js
CHANGED
|
@@ -962,6 +962,7 @@ var Form$1 = function Form(_ref) {
|
|
|
962
962
|
setValues = _useFormikContext.setValues,
|
|
963
963
|
setErrors = _useFormikContext.setErrors,
|
|
964
964
|
setTouched = _useFormikContext.setTouched;
|
|
965
|
+
var hideQuestionHelpDoc = buildForm.useBuildFormStore(ramda.path(["formState", "helpDocUrls", "hideQuestion"]));
|
|
965
966
|
var kind = values.kind;
|
|
966
967
|
var questionKinds = isEdit ? allQuestionKinds : availableQuestionKinds;
|
|
967
968
|
var questionKindUniquenessPattern = ramda.mergeLeft(isEdit && additionalQuestionKindPattern ? additionalQuestionKindPattern(values) : {}, {
|
|
@@ -1048,6 +1049,7 @@ var Form$1 = function Form(_ref) {
|
|
|
1048
1049
|
title: t("neetoForm.common.settings"),
|
|
1049
1050
|
children: [!isImmutable && /*#__PURE__*/jsxRuntime.jsx(RequiredSwitch, {}), shouldShowHideSwitch && /*#__PURE__*/jsxRuntime.jsx(Switch__default["default"], {
|
|
1050
1051
|
label: t("neetoForm.common.hideQuestion"),
|
|
1052
|
+
labelProps: hideSwitchLabelProps(hideQuestionHelpDoc),
|
|
1051
1053
|
name: "isHidden"
|
|
1052
1054
|
})]
|
|
1053
1055
|
}), shouldShowFieldCode && /*#__PURE__*/jsxRuntime.jsx(FieldCode, {})]
|
|
@@ -2002,6 +2004,19 @@ var buildDefaultValueForKind = function buildDefaultValueForKind(questionKind) {
|
|
|
2002
2004
|
value: transformValueForOption(questionKind)
|
|
2003
2005
|
} : undefined;
|
|
2004
2006
|
};
|
|
2007
|
+
var hideSwitchLabelProps = function hideSwitchLabelProps(helpUrl) {
|
|
2008
|
+
return helpUrl ? {
|
|
2009
|
+
helpIconProps: {
|
|
2010
|
+
popoverProps: {
|
|
2011
|
+
description: i18next.t("neetoForm.questions.common.questionFields.field.hideQuestionHelpDescription"),
|
|
2012
|
+
helpLinkProps: {
|
|
2013
|
+
href: helpUrl,
|
|
2014
|
+
label: i18next.t("neetoForm.common.viewHelpArticle")
|
|
2015
|
+
}
|
|
2016
|
+
}
|
|
2017
|
+
}
|
|
2018
|
+
} : undefined;
|
|
2019
|
+
};
|
|
2005
2020
|
|
|
2006
2021
|
var _excluded$1 = ["isOpen", "onClose", "action", "question", "availableQuestionKinds"];
|
|
2007
2022
|
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|