@pinuts/bsr-uikit-relaunch 0.0.3
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/.eslintrc.js +80 -0
- package/.idea/.name +1 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/CHANGELOG.md +3 -0
- package/README.md +75 -0
- package/bsr-uikit-relaunch.iml +9 -0
- package/config-overrides.js +32 -0
- package/dist/assets/Icon.js +64 -0
- package/dist/assets/IconComponents/getIconAdditionalCostsLarge.js +31 -0
- package/dist/assets/IconComponents/getIconAlertCircle.js +31 -0
- package/dist/assets/IconComponents/getIconAlertTriangle.js +27 -0
- package/dist/assets/IconComponents/getIconArchive.js +31 -0
- package/dist/assets/IconComponents/getIconArrowCornerUpLeft.js +25 -0
- package/dist/assets/IconComponents/getIconArrowDown.js +36 -0
- package/dist/assets/IconComponents/getIconArrowDownNoCircle.js +25 -0
- package/dist/assets/IconComponents/getIconArrowLeftNoCircle.js +25 -0
- package/dist/assets/IconComponents/getIconArrowRightDown.js +28 -0
- package/dist/assets/IconComponents/getIconArrowRightNoCircle.js +19 -0
- package/dist/assets/IconComponents/getIconArrowRightUp.js +28 -0
- package/dist/assets/IconComponents/getIconArrowUpNoCircle.js +25 -0
- package/dist/assets/IconComponents/getIconBarChart.js +40 -0
- package/dist/assets/IconComponents/getIconBell.js +25 -0
- package/dist/assets/IconComponents/getIconBriefCaseLarge.js +29 -0
- package/dist/assets/IconComponents/getIconCalendar.js +40 -0
- package/dist/assets/IconComponents/getIconChairman.js +19 -0
- package/dist/assets/IconComponents/getIconCheck.js +19 -0
- package/dist/assets/IconComponents/getIconCheckCircle.js +23 -0
- package/dist/assets/IconComponents/getIconCheckCircleOpen.js +31 -0
- package/dist/assets/IconComponents/getIconChevronDown.js +19 -0
- package/dist/assets/IconComponents/getIconChevronLeft.js +19 -0
- package/dist/assets/IconComponents/getIconChevronRight.js +19 -0
- package/dist/assets/IconComponents/getIconChevronUp.js +19 -0
- package/dist/assets/IconComponents/getIconCircle.js +21 -0
- package/dist/assets/IconComponents/getIconCircleMinus.js +26 -0
- package/dist/assets/IconComponents/getIconCirclePause.js +19 -0
- package/dist/assets/IconComponents/getIconCirclePlus.js +31 -0
- package/dist/assets/IconComponents/getIconCircleX.js +31 -0
- package/dist/assets/IconComponents/getIconCity.js +23 -0
- package/dist/assets/IconComponents/getIconCross.js +27 -0
- package/dist/assets/IconComponents/getIconDocumentLarge.js +28 -0
- package/dist/assets/IconComponents/getIconDoubleChevronLeft.js +21 -0
- package/dist/assets/IconComponents/getIconDoubleChevronRight.js +21 -0
- package/dist/assets/IconComponents/getIconDownload.js +37 -0
- package/dist/assets/IconComponents/getIconEdit.js +25 -0
- package/dist/assets/IconComponents/getIconEditPen.js +25 -0
- package/dist/assets/IconComponents/getIconEuro.js +21 -0
- package/dist/assets/IconComponents/getIconExclamationMark.js +21 -0
- package/dist/assets/IconComponents/getIconExternalLink.js +26 -0
- package/dist/assets/IconComponents/getIconEye.js +31 -0
- package/dist/assets/IconComponents/getIconEyeOff.js +34 -0
- package/dist/assets/IconComponents/getIconFile.js +25 -0
- package/dist/assets/IconComponents/getIconFileAddLarge.js +29 -0
- package/dist/assets/IconComponents/getIconFileReport.js +37 -0
- package/dist/assets/IconComponents/getIconFileText.js +43 -0
- package/dist/assets/IconComponents/getIconFilter.js +35 -0
- package/dist/assets/IconComponents/getIconFolder.js +37 -0
- package/dist/assets/IconComponents/getIconFolderLarge.js +32 -0
- package/dist/assets/IconComponents/getIconFunnel.js +19 -0
- package/dist/assets/IconComponents/getIconGraduateCapLarge.js +31 -0
- package/dist/assets/IconComponents/getIconInbox.js +25 -0
- package/dist/assets/IconComponents/getIconInfo.js +28 -0
- package/dist/assets/IconComponents/getIconInfoCircle.js +25 -0
- package/dist/assets/IconComponents/getIconInternshipLarge.js +49 -0
- package/dist/assets/IconComponents/getIconLeaf.js +21 -0
- package/dist/assets/IconComponents/getIconLeftChevron.js +21 -0
- package/dist/assets/IconComponents/getIconLineChart.js +24 -0
- package/dist/assets/IconComponents/getIconLineChartWithAxis.js +37 -0
- package/dist/assets/IconComponents/getIconLineDotChart.js +61 -0
- package/dist/assets/IconComponents/getIconLink.js +31 -0
- package/dist/assets/IconComponents/getIconList.js +49 -0
- package/dist/assets/IconComponents/getIconLock.js +25 -0
- package/dist/assets/IconComponents/getIconLogin.js +31 -0
- package/dist/assets/IconComponents/getIconLogout.js +19 -0
- package/dist/assets/IconComponents/getIconMail.js +25 -0
- package/dist/assets/IconComponents/getIconMan.js +36 -0
- package/dist/assets/IconComponents/getIconManagement.js +59 -0
- package/dist/assets/IconComponents/getIconMap.js +29 -0
- package/dist/assets/IconComponents/getIconMapPin.js +19 -0
- package/dist/assets/IconComponents/getIconMenu.js +31 -0
- package/dist/assets/IconComponents/getIconMessageCircle.js +25 -0
- package/dist/assets/IconComponents/getIconMessageSquare.js +39 -0
- package/dist/assets/IconComponents/getIconMinus.js +22 -0
- package/dist/assets/IconComponents/getIconMinusVertical.js +22 -0
- package/dist/assets/IconComponents/getIconMoreHorizontal.js +31 -0
- package/dist/assets/IconComponents/getIconNumbers.js +25 -0
- package/dist/assets/IconComponents/getIconPauseCircle.js +31 -0
- package/dist/assets/IconComponents/getIconPlus.js +31 -0
- package/dist/assets/IconComponents/getIconPresentation.js +36 -0
- package/dist/assets/IconComponents/getIconRect.js +24 -0
- package/dist/assets/IconComponents/getIconRefresh.js +31 -0
- package/dist/assets/IconComponents/getIconRefreshRepeatLarge.js +25 -0
- package/dist/assets/IconComponents/getIconReportAnalytics.js +31 -0
- package/dist/assets/IconComponents/getIconReportMoney.js +29 -0
- package/dist/assets/IconComponents/getIconReportOff.js +23 -0
- package/dist/assets/IconComponents/getIconReqWizAdditionalFundingLarge.js +28 -0
- package/dist/assets/IconComponents/getIconReqWizExtendFundingLarge.js +28 -0
- package/dist/assets/IconComponents/getIconReqWizJobLarge.js +32 -0
- package/dist/assets/IconComponents/getIconReqWizPauseFundingLarge.js +60 -0
- package/dist/assets/IconComponents/getIconReqWizScientificNetworkLarge.js +35 -0
- package/dist/assets/IconComponents/getIconReqWizStayAbroadLarge.js +31 -0
- package/dist/assets/IconComponents/getIconReqWizStudyDataLarge.js +31 -0
- package/dist/assets/IconComponents/getIconReqWizSubsequentFundingLarge.js +26 -0
- package/dist/assets/IconComponents/getIconReqWizWorldGraduateCapLarge copy.js +31 -0
- package/dist/assets/IconComponents/getIconReqWizWorldGraduateCapLarge.js +31 -0
- package/dist/assets/IconComponents/getIconRequestLarge.js +28 -0
- package/dist/assets/IconComponents/getIconRingChart.js +25 -0
- package/dist/assets/IconComponents/getIconRotate.js +17 -0
- package/dist/assets/IconComponents/getIconSearch.js +26 -0
- package/dist/assets/IconComponents/getIconSearchLarger.js +25 -0
- package/dist/assets/IconComponents/getIconSearchReverse.js +25 -0
- package/dist/assets/IconComponents/getIconSetting.js +33 -0
- package/dist/assets/IconComponents/getIconSortAscending.js +39 -0
- package/dist/assets/IconComponents/getIconSortDescending.js +39 -0
- package/dist/assets/IconComponents/getIconStar.js +22 -0
- package/dist/assets/IconComponents/getIconSum.js +19 -0
- package/dist/assets/IconComponents/getIconSupervisory.js +51 -0
- package/dist/assets/IconComponents/getIconThumbDown.js +19 -0
- package/dist/assets/IconComponents/getIconThumbUp.js +19 -0
- package/dist/assets/IconComponents/getIconTrash.js +37 -0
- package/dist/assets/IconComponents/getIconTriangle.js +19 -0
- package/dist/assets/IconComponents/getIconTriangleInverted.js +19 -0
- package/dist/assets/IconComponents/getIconUpload.js +31 -0
- package/dist/assets/IconComponents/getIconUploadCloud.js +37 -0
- package/dist/assets/IconComponents/getIconUploadLarge.js +26 -0
- package/dist/assets/IconComponents/getIconUser.js +19 -0
- package/dist/assets/IconComponents/getIconUserCheck.js +25 -0
- package/dist/assets/IconComponents/getIconUserCircle.js +31 -0
- package/dist/assets/IconComponents/getIconUserLarge.js +26 -0
- package/dist/assets/IconComponents/getIconUserOff.js +26 -0
- package/dist/assets/IconComponents/getIconWoman.js +33 -0
- package/dist/assets/IconComponents/getIconWriteNote.js +31 -0
- package/dist/assets/IconComponents/getIconWriteNoteLarge.js +27 -0
- package/dist/assets/IconComponents/getIconX.js +27 -0
- package/dist/assets/IconComponents/getIconZoomMoney.js +45 -0
- package/dist/assets/IconMapping.js +241 -0
- package/dist/hooks/ValidateComponents.js +31 -0
- package/dist/hooks/index.js +27 -0
- package/dist/hooks/infoPopUp.js +1 -0
- package/dist/hooks/useDebounceFunc.js +25 -0
- package/dist/hooks/useGetOptionList.js +41 -0
- package/dist/hooks/useValidationMessage.js +68 -0
- package/dist/hooks/withFieldGroup.js +206 -0
- package/dist/icons/AlertTriangle.js +42 -0
- package/dist/icons/InfoOutline.js +57 -0
- package/dist/icons/Verify.js +40 -0
- package/dist/index.js +2 -0
- package/dist/index.js.LICENSE.txt +32 -0
- package/dist/items/ArrayFieldset/ArrayFieldset.js +178 -0
- package/dist/items/BSRAddressSelector/BSRAddressContext.js +95 -0
- package/dist/items/BSRAddressSelector/BSRAddressResetButton.js +59 -0
- package/dist/items/BSRAddressSelector/BSRAddressSelector.js +100 -0
- package/dist/items/BSRAddressSelector/BSRAutocompleteField.js +262 -0
- package/dist/items/BSRAddressSelector/BSRStreetPlzSelector.js +127 -0
- package/dist/items/BSRAddressSelector/HouseNumberSelectField.js +105 -0
- package/dist/items/Badge/Badge.js +33 -0
- package/dist/items/BootstrapInputGroupField/BootstrapInputGroupField.js +68 -0
- package/dist/items/Button/Button.js +70 -0
- package/dist/items/Button/SubmitButton.js +39 -0
- package/dist/items/DateInputField/DateInputField.js +105 -0
- package/dist/items/DropDownButton/DropDownButton.js +101 -0
- package/dist/items/DropzoneUploadField/DropzoneUploadField.js +188 -0
- package/dist/items/DropzoneUploadField/acceptedUploadTypeMapping.js +55 -0
- package/dist/items/FieldLabel/FieldLabel.js +75 -0
- package/dist/items/FieldsetWrapper/FieldsetWrapper.js +51 -0
- package/dist/items/FormFieldWrapper/FormFieldChildPropTypes.js +64 -0
- package/dist/items/FormFieldWrapper/FormFieldWrapper.js +101 -0
- package/dist/items/FormFieldWrapper/FormFieldWrapperComponent.js +6 -0
- package/dist/items/Grid/BSRGridColumn.js +34 -0
- package/dist/items/Grid/BSRGridRow.js +28 -0
- package/dist/items/Grid/BSRGridRowCols.js +36 -0
- package/dist/items/GroupInputField/GroupInputField.js +122 -0
- package/dist/items/HTMLParserSanitized/HTMLParserSanitized.js +45 -0
- package/dist/items/Icon/Icon.js +24 -0
- package/dist/items/Modal/FormModal.js +98 -0
- package/dist/items/Modal/Modal.js +109 -0
- package/dist/items/NumberInputField/NumberInputField.js +142 -0
- package/dist/items/PictureUploadRowField/PictureUploadRowField.js +280 -0
- package/dist/items/PictureUploadRowField/acceptedUploadTypeMapping.js +55 -0
- package/dist/items/SectionSpinner/SectionSpinner.js +49 -0
- package/dist/items/SelectField/SelectField.js +67 -0
- package/dist/items/StaticAlert/StaticAlert.js +39 -0
- package/dist/items/TextAreaField/TextAreaField.js +70 -0
- package/dist/items/TextBox/TextBox.js +43 -0
- package/dist/items/TextInputField/TextInputField.js +55 -0
- package/dist/items/Toast/Toast.js +55 -0
- package/dist/items/ToggleSwitchField/ToggleSwitchField.js +84 -0
- package/dist/items/index.js +196 -0
- package/dist/styles/_ariakit_combobox.scss +279 -0
- package/dist/styles/_colors.scss +165 -0
- package/dist/styles/bootstrap-customized.scss +815 -0
- package/dist/styles/fonts/hbs-fonts/hbs-fonts.css +67 -0
- package/dist/styles/fonts/hbs-fonts/simple-bold/SimpleHBSTT-Bold.eot +0 -0
- package/dist/styles/fonts/hbs-fonts/simple-bold/SimpleHBSTT-Bold.svg +264 -0
- package/dist/styles/fonts/hbs-fonts/simple-bold/SimpleHBSTT-Bold.ttf +0 -0
- package/dist/styles/fonts/hbs-fonts/simple-bold/SimpleHBSTT-Bold.woff +0 -0
- package/dist/styles/fonts/hbs-fonts/univers/1449347/1f2c3faa-231e-4e71-aba4-b1adb03e0322.svg +4846 -0
- package/dist/styles/fonts/hbs-fonts/univers/1449347/51a2e8ba-97c4-47a9-af92-e8b379eeddbd.eot +0 -0
- package/dist/styles/fonts/hbs-fonts/univers/1449347/77019bfb-2faa-487f-97aa-b498678dc990.ttf +0 -0
- package/dist/styles/fonts/hbs-fonts/univers/1449347/89420d17-2c68-4bb3-b4d4-373b0d0f016b.woff2 +0 -0
- package/dist/styles/fonts/hbs-fonts/univers/1449347/e79b121c-bda4-4092-a565-1c29b272ef18.woff +0 -0
- package/dist/styles/fonts/hbs-fonts/univers/1449355/6baa7b6e-6971-4b5f-8129-8630113d8cb7.eot +0 -0
- package/dist/styles/fonts/hbs-fonts/univers/1449355/aab88c6b-6b75-42f0-aec5-74a5c4ed199d.woff2 +0 -0
- package/dist/styles/fonts/hbs-fonts/univers/1449355/ac6c8f47-2d16-43de-96c6-4526ab446296.woff +0 -0
- package/dist/styles/fonts/hbs-fonts/univers/1449355/cc2006cf-463d-41db-88b0-24bf58fdf832.ttf +0 -0
- package/dist/styles/fonts/hbs-fonts/univers/1449355/f6946e91-a2c4-4793-bcb2-b617d23b3b80.svg +5216 -0
- package/dist/styles/fonts/hbs-fonts/univers-condensed/1449383/1df6de95-3b72-4134-8e0f-f250931b1cb1.woff +0 -0
- package/dist/styles/fonts/hbs-fonts/univers-condensed/1449383/27bd8c18-1ca0-4a74-a175-108571bab2fc.eot +0 -0
- package/dist/styles/fonts/hbs-fonts/univers-condensed/1449383/5667db2e-a3c3-408f-ad82-3ca721a0e2e7.svg +4807 -0
- package/dist/styles/fonts/hbs-fonts/univers-condensed/1449383/8282dfe6-2f66-4a8e-bc65-669a3066eee8.ttf +0 -0
- package/dist/styles/fonts/hbs-fonts/univers-condensed/1449383/a92a459a-dc32-498f-b2dc-b761713792f4.woff2 +0 -0
- package/dist/styles/fonts/hbs-fonts/univers-condensed/1449391/14cd37b6-7bde-488e-bbba-17c5046ee4c3.svg +4666 -0
- package/dist/styles/fonts/hbs-fonts/univers-condensed/1449391/308dd9a4-aea8-4532-8c6d-a415a35f0015.woff2 +0 -0
- package/dist/styles/fonts/hbs-fonts/univers-condensed/1449391/4414ced7-592d-4fdc-8521-8bf095659b6e.eot +0 -0
- package/dist/styles/fonts/hbs-fonts/univers-condensed/1449391/9e1c34e4-257a-478b-9d35-84e680e8d373.ttf +0 -0
- package/dist/styles/fonts/hbs-fonts/univers-condensed/1449391/9f5abf71-fdd9-408f-b075-7a8a1b7c9a6e.woff +0 -0
- package/dist/styles/form.module.scss +252 -0
- package/dist/styles/main.scss +18 -0
- package/dist/styles/module-variables.scss +13 -0
- package/dist/styles/variables/_borders.scss +26 -0
- package/dist/styles/variables/_buttons.scss +147 -0
- package/dist/styles/variables/_colors.scss +109 -0
- package/dist/styles/variables/_focus.scss +9 -0
- package/dist/styles/variables/_fonts.scss +101 -0
- package/dist/styles/variables/_gaps.scss +26 -0
- package/dist/styles/variables/_images.scss +18 -0
- package/dist/styles/variables/_responsive.scss +23 -0
- package/dist/styles/variables/_shadows.scss +5 -0
- package/dist/styles/variables/_variables.scss +14 -0
- package/dist/styles/variables.scss +75 -0
- package/dist/utils/getUikitClassNames.js +19 -0
- package/dist/utils/index.js +16 -0
- package/dist/utils/isWindowAvailable.js +9 -0
- package/dist/utils/objectHelpers.js +43 -0
- package/notes.txt +5 -0
- package/package.json +111 -0
- package/webpack.config.js +99 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
const convertUMTimeToDeFormat = dateData => {
|
|
9
|
+
const dateString = Object.values(dateData)[0];
|
|
10
|
+
const splitValue = dateString.split('-');
|
|
11
|
+
return {
|
|
12
|
+
[Object.keys(dateData)[0]]: `${splitValue[2]}.${splitValue[1]}.${splitValue[0]}`
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
const enrichDataWithDateFormates = data => Object.entries(data).reduce((lastResult, _ref) => {
|
|
16
|
+
let [nextKey, nextValue] = _ref;
|
|
17
|
+
if (typeof nextKey === 'string' && nextKey.includes('date')) {
|
|
18
|
+
lastResult[nextKey] = convertUMTimeToDeFormat(nextValue);
|
|
19
|
+
}
|
|
20
|
+
return lastResult;
|
|
21
|
+
}, data);
|
|
22
|
+
const getDefaultValidationMessage = (message, errorMessages, errorMessagesBaseKey) => (message === 'mandatory' ? errorMessages.required || errorMessages.requiredHTML || errorMessages[message] : errorMessages[message]) || [errorMessagesBaseKey, message].filter(Boolean).join('.');
|
|
23
|
+
const getValidationStringAndData = (inputMessage, errorMessages, errorMessagesBaseKey) => {
|
|
24
|
+
// Beispiel: dateTimePicker Validation
|
|
25
|
+
if (Array.isArray(inputMessage)) {
|
|
26
|
+
return {
|
|
27
|
+
message: getDefaultValidationMessage(inputMessage[0], errorMessages, errorMessagesBaseKey),
|
|
28
|
+
data: enrichDataWithDateFormates(inputMessage[1])
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// alles andere
|
|
33
|
+
if (typeof inputMessage === 'string') {
|
|
34
|
+
return {
|
|
35
|
+
message: getDefaultValidationMessage(inputMessage, errorMessages, errorMessagesBaseKey),
|
|
36
|
+
data: {}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// default
|
|
41
|
+
return {
|
|
42
|
+
message: '',
|
|
43
|
+
data: {}
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// Achtung: i18next t Funktion als erster Parameter
|
|
48
|
+
const useValidationMessage = function (t, validationMessage) {
|
|
49
|
+
let errorMessages = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
50
|
+
let errorMessagesBaseKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'errorMessages';
|
|
51
|
+
const displayedMessage = (0, _react.useMemo)(() => {
|
|
52
|
+
if (!validationMessage) {
|
|
53
|
+
return '';
|
|
54
|
+
}
|
|
55
|
+
const fixedProps = getValidationStringAndData(validationMessage, errorMessages, errorMessagesBaseKey);
|
|
56
|
+
const errorMsg = t(
|
|
57
|
+
// Fallbacks
|
|
58
|
+
fixedProps.message,
|
|
59
|
+
// Input Data
|
|
60
|
+
fixedProps.data);
|
|
61
|
+
if (errorMsg.startsWith('errorMessages.')) {
|
|
62
|
+
return errorMsg.replace('errorMessages.', '');
|
|
63
|
+
}
|
|
64
|
+
return errorMsg;
|
|
65
|
+
}, [validationMessage, t, errorMessages, errorMessagesBaseKey]);
|
|
66
|
+
return displayedMessage;
|
|
67
|
+
};
|
|
68
|
+
var _default = exports.default = useValidationMessage;
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _formBuilder = require("@pinuts/form-builder");
|
|
9
|
+
var _reactI18next = require("react-i18next");
|
|
10
|
+
var _FieldLabel = _interopRequireDefault(require("../items/FieldLabel/FieldLabel.jsx"));
|
|
11
|
+
var _HTMLParserSanitized = require("../items/HTMLParserSanitized/HTMLParserSanitized.jsx");
|
|
12
|
+
var _formModule = _interopRequireDefault(require("../styles/form.module.scss"));
|
|
13
|
+
var _AlertTriangle = _interopRequireDefault(require("../icons/AlertTriangle.jsx"));
|
|
14
|
+
var _Verify = _interopRequireDefault(require("../icons/Verify.jsx"));
|
|
15
|
+
var _InfoOutline = _interopRequireDefault(require("../icons/InfoOutline.jsx"));
|
|
16
|
+
var _isWindowAvailable = require("../utils/isWindowAvailable.js");
|
|
17
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
19
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } /* eslint-disable react/prop-types */ // import Icon from '../items/Icon/Icon.jsx';
|
|
21
|
+
const {
|
|
22
|
+
useUniqueIds
|
|
23
|
+
} = _formBuilder.hooks;
|
|
24
|
+
const {
|
|
25
|
+
getClassNames,
|
|
26
|
+
getAriaAttributes
|
|
27
|
+
} = _formBuilder.utils;
|
|
28
|
+
const isFieldHiddenByEmptyValues = (value, isInvalid) => [undefined, ''].includes(value) && !isInvalid;
|
|
29
|
+
const isHiddenByEmptyValues = (value, isInvalid, components, values, errors) => {
|
|
30
|
+
const allComponentsHidden = !components?.length || components.every(child => isHiddenByEmptyValues(values?.[child.config?.key], errors?.[child.config?.key], child.components, values, errors));
|
|
31
|
+
return isFieldHiddenByEmptyValues(value, isInvalid) && allComponentsHidden;
|
|
32
|
+
};
|
|
33
|
+
const getOuterComponent = (FieldComponent, viewMode) => {
|
|
34
|
+
if (FieldComponent.formFieldConfig?.isFieldset && !viewMode) {
|
|
35
|
+
return FieldSetComponent;
|
|
36
|
+
}
|
|
37
|
+
return DivComponent;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// eslint-disable-next-line react/display-name
|
|
41
|
+
const withFieldGroup = FieldComponent => props => {
|
|
42
|
+
const [t] = (0, _reactI18next.useTranslation)();
|
|
43
|
+
const {
|
|
44
|
+
value,
|
|
45
|
+
helpText,
|
|
46
|
+
infoText,
|
|
47
|
+
helpTextPositionTop = false,
|
|
48
|
+
classNameHelperText,
|
|
49
|
+
label,
|
|
50
|
+
readOnly,
|
|
51
|
+
disabled,
|
|
52
|
+
viewMode,
|
|
53
|
+
stepId,
|
|
54
|
+
hideEmptyValues,
|
|
55
|
+
isInvalid,
|
|
56
|
+
isRequired,
|
|
57
|
+
validationMessage,
|
|
58
|
+
prefix,
|
|
59
|
+
withRowCols,
|
|
60
|
+
formGroupClassName,
|
|
61
|
+
// colClassName,
|
|
62
|
+
maxCharacters,
|
|
63
|
+
maxCharactersText = 'bsrItems.maxCharacters',
|
|
64
|
+
// maxSize,
|
|
65
|
+
components,
|
|
66
|
+
values,
|
|
67
|
+
errors,
|
|
68
|
+
meta
|
|
69
|
+
} = props;
|
|
70
|
+
const hookedFieldIds = useUniqueIds(prefix);
|
|
71
|
+
const [textLength, setTextLength] = (0, _react.useState)(value?.length || 0);
|
|
72
|
+
const [isFocused, setIsFocused] = (0, _react.useState)(false);
|
|
73
|
+
const handleFocus = () => setIsFocused(true);
|
|
74
|
+
const handleBlur = () => setIsFocused(false);
|
|
75
|
+
const fieldIds = props.fieldIds || hookedFieldIds;
|
|
76
|
+
const ariaAttributes = props.ariaAttributes || getAriaAttributes({
|
|
77
|
+
...props,
|
|
78
|
+
fieldIds
|
|
79
|
+
});
|
|
80
|
+
const OuterComponent = getOuterComponent(FieldComponent, viewMode);
|
|
81
|
+
const usedHelpTextPositionTop = (0, _react.useMemo)(() => helpTextPositionTop || maxCharacters && helpText, [helpTextPositionTop, maxCharacters, helpText]);
|
|
82
|
+
const showHelpText = (0, _react.useMemo)(() => helpText && (!viewMode || FieldComponent.formFieldConfig?.showHelpTextInViewMode), [helpText, viewMode]);
|
|
83
|
+
const showMaxCharacters = maxCharacters && !(readOnly || disabled || viewMode);
|
|
84
|
+
const showIsInvalid = isInvalid && !viewMode && validationMessage;
|
|
85
|
+
const showIsSuccess = meta?.touched && !isInvalid;
|
|
86
|
+
const tooltipRef = (0, _react.useRef)(null);
|
|
87
|
+
(0, _react.useEffect)(() => {
|
|
88
|
+
const adjustTooltipPosition = () => {
|
|
89
|
+
if (tooltipRef.current) {
|
|
90
|
+
const tooltipElement = tooltipRef.current;
|
|
91
|
+
const rect = tooltipElement.getBoundingClientRect();
|
|
92
|
+
|
|
93
|
+
// Adjust vertical position
|
|
94
|
+
if (rect.bottom > 200) {
|
|
95
|
+
tooltipElement.classList.remove(_formModule.default.bottom || '');
|
|
96
|
+
} else {
|
|
97
|
+
tooltipElement.classList.add(_formModule.default.bottom || '');
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Adjust horizontal position
|
|
101
|
+
if (rect.right > window.innerWidth) {
|
|
102
|
+
tooltipElement.classList.add(_formModule.default.adjustRight || '');
|
|
103
|
+
} else {
|
|
104
|
+
tooltipElement.classList.remove(_formModule.default.adjustRight || '');
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
if ((0, _isWindowAvailable.isWindowAvailable)()) {
|
|
109
|
+
window.addEventListener('scroll', adjustTooltipPosition);
|
|
110
|
+
window.addEventListener('resize', adjustTooltipPosition);
|
|
111
|
+
adjustTooltipPosition();
|
|
112
|
+
return () => {
|
|
113
|
+
window.removeEventListener('scroll', adjustTooltipPosition);
|
|
114
|
+
window.removeEventListener('resize', adjustTooltipPosition);
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
}, []);
|
|
118
|
+
const infoRow = (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement("div", {
|
|
119
|
+
className: _formModule.default.infoRow
|
|
120
|
+
}, showIsSuccess && /*#__PURE__*/_react.default.createElement("div", {
|
|
121
|
+
className: _formModule.default.success
|
|
122
|
+
}, /*#__PURE__*/_react.default.createElement(_Verify.default, {
|
|
123
|
+
width: 18,
|
|
124
|
+
height: 18
|
|
125
|
+
})), infoText && /*#__PURE__*/_react.default.createElement("div", {
|
|
126
|
+
className: _formModule.default.info
|
|
127
|
+
}, /*#__PURE__*/_react.default.createElement(_InfoOutline.default, {
|
|
128
|
+
width: 18,
|
|
129
|
+
height: 18,
|
|
130
|
+
stroke: _formModule.default.grey100
|
|
131
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
132
|
+
className: _formModule.default.tooltip,
|
|
133
|
+
ref: tooltipRef
|
|
134
|
+
}, /*#__PURE__*/_react.default.createElement(_HTMLParserSanitized.HTMLParserSanitized, null, t(infoText))))), [showIsSuccess, infoText, tooltipRef, t]);
|
|
135
|
+
const helpTextDiv = (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement("div", {
|
|
136
|
+
id: fieldIds.helpText,
|
|
137
|
+
className: getClassNames([_formModule.default.helperText, 'pb-1', classNameHelperText])
|
|
138
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_HTMLParserSanitized.HTMLParserSanitized, null, t(helpText)))), [fieldIds.helpText, helpText, classNameHelperText, t]);
|
|
139
|
+
const topRow = (0, _react.useMemo)(() => {
|
|
140
|
+
const labelComponent = label ? /*#__PURE__*/_react.default.createElement(_FieldLabel.default, {
|
|
141
|
+
id: fieldIds.label,
|
|
142
|
+
targetId: fieldIds.fieldId,
|
|
143
|
+
isInvalid: isInvalid,
|
|
144
|
+
isRequired: isRequired,
|
|
145
|
+
isFocused: isFocused,
|
|
146
|
+
labelText: label,
|
|
147
|
+
isLegend: FieldComponent.formFieldConfig?.labelIsLegend,
|
|
148
|
+
viewMode: viewMode,
|
|
149
|
+
stepId: stepId
|
|
150
|
+
}) : null;
|
|
151
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
152
|
+
className: _formModule.default.topRow
|
|
153
|
+
}, labelComponent, infoRow);
|
|
154
|
+
}, [infoRow, fieldIds.label, fieldIds.fieldId, isInvalid, isRequired, isFocused, label, viewMode, stepId]);
|
|
155
|
+
if (viewMode && hideEmptyValues && isHiddenByEmptyValues(value, isInvalid, components, values, errors)) {
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
return /*#__PURE__*/_react.default.createElement(OuterComponent, {
|
|
159
|
+
className: getClassNames([withRowCols && 'row', _formModule.default.formInput, isInvalid && _formModule.default.error, formGroupClassName])
|
|
160
|
+
}, topRow, showHelpText && usedHelpTextPositionTop && helpTextDiv, (!isInvalid || !viewMode) && /*#__PURE__*/_react.default.createElement(FieldComponent, _extends({}, props, {
|
|
161
|
+
setTextLength: setTextLength,
|
|
162
|
+
inputProps: {
|
|
163
|
+
onBlur: handleBlur,
|
|
164
|
+
onFocus: handleFocus,
|
|
165
|
+
...props.inputProps,
|
|
166
|
+
id: fieldIds.fieldId,
|
|
167
|
+
readOnly: props.disabled || props.readOnly,
|
|
168
|
+
// TODO: Muss das in den Form-Builder?
|
|
169
|
+
disabled: props.disabled || props.readOnly // TODO: Muss das in den Form-Builder?
|
|
170
|
+
},
|
|
171
|
+
fieldIds: fieldIds,
|
|
172
|
+
ariaAttributes: ariaAttributes
|
|
173
|
+
})), showHelpText && !usedHelpTextPositionTop && helpTextDiv, showMaxCharacters && /*#__PURE__*/_react.default.createElement("span", {
|
|
174
|
+
className: "helper-text align-items-start"
|
|
175
|
+
}, t(maxCharactersText, {
|
|
176
|
+
characters: textLength,
|
|
177
|
+
maxCharacters
|
|
178
|
+
})), showIsInvalid && /*#__PURE__*/_react.default.createElement("div", {
|
|
179
|
+
id: fieldIds.errorMessage,
|
|
180
|
+
className: _formModule.default.errorMessage,
|
|
181
|
+
"aria-live": "polite",
|
|
182
|
+
role: "region",
|
|
183
|
+
"aria-atomic": "true"
|
|
184
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
185
|
+
className: "sr-only"
|
|
186
|
+
}, t('bsrItems.errorMsgPrefix')), /*#__PURE__*/_react.default.createElement(_AlertTriangle.default, {
|
|
187
|
+
width: 18,
|
|
188
|
+
height: 18,
|
|
189
|
+
className: _formModule.default.errorMessageIcon
|
|
190
|
+
}), validationMessage));
|
|
191
|
+
};
|
|
192
|
+
const FieldSetComponent = _ref => {
|
|
193
|
+
let {
|
|
194
|
+
children,
|
|
195
|
+
...otherProps
|
|
196
|
+
} = _ref;
|
|
197
|
+
return /*#__PURE__*/_react.default.createElement("fieldset", otherProps, children);
|
|
198
|
+
};
|
|
199
|
+
const DivComponent = _ref2 => {
|
|
200
|
+
let {
|
|
201
|
+
children,
|
|
202
|
+
...otherProps
|
|
203
|
+
} = _ref2;
|
|
204
|
+
return /*#__PURE__*/_react.default.createElement("div", otherProps, children);
|
|
205
|
+
};
|
|
206
|
+
var _default = exports.default = withFieldGroup;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _defaultIconPropValuesModule = _interopRequireDefault(require("./_defaultIconPropValues.module.scss"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } /* eslint-disable react/prop-types */
|
|
11
|
+
const {
|
|
12
|
+
defaultPropValues
|
|
13
|
+
} = _defaultIconPropValuesModule.default;
|
|
14
|
+
const AlertTriangle = props => {
|
|
15
|
+
const {
|
|
16
|
+
width = defaultPropValues.width,
|
|
17
|
+
height = defaultPropValues.height,
|
|
18
|
+
...restProps
|
|
19
|
+
} = props;
|
|
20
|
+
return /*#__PURE__*/_react.default.createElement("svg", _extends({
|
|
21
|
+
width: width,
|
|
22
|
+
height: height
|
|
23
|
+
}, restProps, {
|
|
24
|
+
viewBox: "0 0 24 24",
|
|
25
|
+
fill: "none",
|
|
26
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
27
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
28
|
+
d: "M2.73 21.5C2.425 21.495 2.14 21.415 1.89 21.27C1.495 21.04 1.215 20.675 1.095 20.235C0.974997 19.795 1.04 19.335 1.265 18.94L10.54 3.32C10.54 3.32 10.54 3.31 10.545 3.31C10.685 3.09 10.875 2.895 11.095 2.76C11.485 2.52 11.94 2.445 12.385 2.55C12.83 2.655 13.205 2.925 13.445 3.31L22.72 18.935C22.87 19.195 22.95 19.48 22.955 19.77C22.96 20.225 22.79 20.66 22.475 20.985C22.16 21.31 21.73 21.495 21.275 21.505H2.73V21.5Z",
|
|
29
|
+
fill: "#E42C1B"
|
|
30
|
+
}), /*#__PURE__*/_react.default.createElement("circle", {
|
|
31
|
+
cx: "12",
|
|
32
|
+
cy: "18.6667",
|
|
33
|
+
r: "1.33333",
|
|
34
|
+
fill: "white"
|
|
35
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
36
|
+
d: "M12 8L12 14.6667",
|
|
37
|
+
stroke: "white",
|
|
38
|
+
strokeWidth: "2",
|
|
39
|
+
strokeLinecap: "round"
|
|
40
|
+
}));
|
|
41
|
+
};
|
|
42
|
+
var _default = exports.default = AlertTriangle;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _defaultIconPropValuesModule = _interopRequireDefault(require("./_defaultIconPropValues.module.scss"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } /* eslint-disable react/prop-types */
|
|
13
|
+
const {
|
|
14
|
+
defaultPropValues
|
|
15
|
+
} = _defaultIconPropValuesModule.default;
|
|
16
|
+
const InfoOutline = props => {
|
|
17
|
+
const {
|
|
18
|
+
width = defaultPropValues.width,
|
|
19
|
+
height = defaultPropValues.height,
|
|
20
|
+
stroke = defaultPropValues.stroke,
|
|
21
|
+
...restProps
|
|
22
|
+
} = props;
|
|
23
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
24
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
25
|
+
viewBox: "0 0 18 18",
|
|
26
|
+
width: width,
|
|
27
|
+
height: height
|
|
28
|
+
}, restProps, {
|
|
29
|
+
fill: "none"
|
|
30
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
31
|
+
cx: "9",
|
|
32
|
+
cy: "9",
|
|
33
|
+
r: "8",
|
|
34
|
+
fill: "white",
|
|
35
|
+
stroke: stroke,
|
|
36
|
+
strokeWidth: "1.4"
|
|
37
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
38
|
+
d: "M9 8L9 13",
|
|
39
|
+
stroke: stroke,
|
|
40
|
+
strokeWidth: "1.4",
|
|
41
|
+
strokeLinecap: "round"
|
|
42
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
43
|
+
cx: "9",
|
|
44
|
+
cy: "5",
|
|
45
|
+
r: "0.5",
|
|
46
|
+
fill: stroke,
|
|
47
|
+
stroke: "#1E1E1E"
|
|
48
|
+
}));
|
|
49
|
+
};
|
|
50
|
+
var _default = exports.default = InfoOutline;
|
|
51
|
+
/*#__PURE__*/React.createElement("svg", {
|
|
52
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
53
|
+
width: "18",
|
|
54
|
+
height: "18",
|
|
55
|
+
viewBox: "0 0 18 18",
|
|
56
|
+
fill: "none"
|
|
57
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _defaultIconPropValuesModule = _interopRequireDefault(require("./_defaultIconPropValues.module.scss"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } /* eslint-disable react/prop-types */
|
|
13
|
+
const {
|
|
14
|
+
defaultPropValues
|
|
15
|
+
} = _defaultIconPropValuesModule.default;
|
|
16
|
+
const Verify = props => {
|
|
17
|
+
const {
|
|
18
|
+
width = defaultPropValues.width,
|
|
19
|
+
height = defaultPropValues.height,
|
|
20
|
+
...restProps
|
|
21
|
+
} = props;
|
|
22
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
23
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
24
|
+
viewBox: "0 0 24 24",
|
|
25
|
+
width: width,
|
|
26
|
+
height: height
|
|
27
|
+
}, restProps, {
|
|
28
|
+
fill: "none"
|
|
29
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
30
|
+
width: "24",
|
|
31
|
+
height: "24",
|
|
32
|
+
rx: "12",
|
|
33
|
+
fill: "#07885B"
|
|
34
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
35
|
+
d: "M10.1982 17C10.0542 17 9.90725 16.949 9.79328 16.8411L6.19404 13.5423C5.95109 13.3174 5.9331 12.9396 6.15805 12.6937C6.383 12.4507 6.76092 12.4328 7.00687 12.6577L10.1652 15.5516L16.9588 8.19239C17.1837 7.94948 17.5616 7.93449 17.8076 8.1594C18.0505 8.38431 18.0655 8.76217 17.8406 9.00807L10.6421 16.8051C10.5251 16.934 10.3632 16.997 10.2012 16.997L10.1982 17Z",
|
|
36
|
+
fill: "white",
|
|
37
|
+
stroke: 'white'
|
|
38
|
+
}));
|
|
39
|
+
};
|
|
40
|
+
var _default = exports.default = Verify;
|