@pinuts/bsr-uikit-relaunch 0.2.35 → 0.2.37

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.
@@ -1 +1 @@
1
- {"version":3,"file":"GroupInputField.d.ts","sourceRoot":"","sources":["../../../src/items/GroupInputField/GroupInputField.jsx"],"names":[],"mappings":";AAmKA,uEAMC;kBAzKiB,OAAO"}
1
+ {"version":3,"file":"GroupInputField.d.ts","sourceRoot":"","sources":["../../../src/items/GroupInputField/GroupInputField.jsx"],"names":[],"mappings":";AAqKA,uEAMC;kBA3KiB,OAAO"}
@@ -55,8 +55,12 @@ const GroupInputField = _ref => {
55
55
  const handleRadioChange = e => {
56
56
  onChange(inputOptions[e.target.value]?.value);
57
57
  };
58
+ const translateLabel = function () {
59
+ let label = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
60
+ return !label.includes(':') && !label.includes('<') ? t(label) : label;
61
+ };
58
62
  if (viewMode) {
59
- return /*#__PURE__*/_react.default.createElement(_HTMLParserSanitized.HTMLParserSanitized, null, inputOptions.filter(opt => getIsSelected(value, opt)).map(opt => t(opt.label)).join(', '));
63
+ return /*#__PURE__*/_react.default.createElement(_HTMLParserSanitized.HTMLParserSanitized, null, inputOptions.filter(opt => getIsSelected(value, opt)).map(opt => translateLabel(opt.label)).join(', '));
60
64
  }
61
65
  const ariaDescribedBy = [helpText && fieldIds.helpText, isInvalid && fieldIds.errorMessage].filter(Boolean).join(' ');
62
66
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -94,7 +98,7 @@ const GroupInputField = _ref => {
94
98
  })), /*#__PURE__*/_react.default.createElement("label", {
95
99
  className: "label ps-2",
96
100
  htmlFor: usedId
97
- }, /*#__PURE__*/_react.default.createElement(_HTMLParserSanitized.HTMLParserSanitized, null, t(opt.label))));
101
+ }, /*#__PURE__*/_react.default.createElement(_HTMLParserSanitized.HTMLParserSanitized, null, translateLabel(opt.label))));
98
102
  })) : /*#__PURE__*/_react.default.createElement("div", {
99
103
  className: "error-text"
100
104
  }, t('bsrItems.noOptionsGiven')));
@@ -1 +1 @@
1
- {"version":3,"file":"SelectField.d.ts","sourceRoot":"","sources":["../../../src/items/SelectField/SelectField.jsx"],"names":[],"mappings":";AAkHA,mEAMC;kBAxHiD,OAAO"}
1
+ {"version":3,"file":"SelectField.d.ts","sourceRoot":"","sources":["../../../src/items/SelectField/SelectField.jsx"],"names":[],"mappings":";AAmHA,mEAMC;kBAzHiD,OAAO"}
@@ -37,6 +37,10 @@ const SelectField = _ref => {
37
37
  const formControlClassNames = (0, _index.getFormControlClassNames)(isInvalid, readOnly, disabled, className, ['select', field.className].filter(Boolean));
38
38
  const handleChange = e => onChange(e.target.value);
39
39
  const selectOptions = (0, _useGetOptionList.default)(options, emptyOptionLabel, skipOptions);
40
+ const translateLabel = function () {
41
+ let label = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
42
+ return !label.includes(':') && !label.includes('<') ? t(label) : label;
43
+ };
40
44
 
41
45
  // // if no option is selected yet, and no empty option is available, the first option will be preselected
42
46
  const doItJustOnce = (0, _react.useRef)(false);
@@ -48,7 +52,7 @@ const SelectField = _ref => {
48
52
  }
49
53
  }, [field, emptyOption, selectOptions, helpers, doItJustOnce]);
50
54
  if (viewMode) {
51
- return selectOptions.filter(opt => opt.value === field?.value || opt.value !== '' && Array.isArray(field?.value) && field?.value?.includes(opt.value)).map(opt => t(opt.label)).join(', ');
55
+ return selectOptions.filter(opt => opt.value === field?.value || opt.value !== '' && Array.isArray(field?.value) && field?.value?.includes(opt.value)).map(opt => translateLabel(opt.label)).join(', ');
52
56
  }
53
57
  return /*#__PURE__*/_react.default.createElement("select", _extends({}, field, ariaAttributes, inputProps, {
54
58
  className: formControlClassNames,
@@ -56,7 +60,7 @@ const SelectField = _ref => {
56
60
  }), selectOptions.map(opt => /*#__PURE__*/_react.default.createElement("option", {
57
61
  key: opt.value,
58
62
  value: opt.value
59
- }, t(opt.label))));
63
+ }, translateLabel(opt.label))));
60
64
  };
61
65
  SelectField.propTypes = {
62
66
  ..._FormFieldChildPropTypes.default,
@@ -6,14 +6,18 @@
6
6
  display: flex;
7
7
  flex-direction: column;
8
8
 
9
- .row .col:has(input) {
10
- margin-bottom: $base-gap * 3;
9
+ .row .col:has(input):not(:has(fieldset)) {
10
+ margin-bottom: $base-gap * 10;
11
11
  }
12
12
  .row .col.checkAddressBtn,
13
13
  .row .col.plzSelectAddressBtn,
14
14
  .row .col:not(.plzSelectAddressBtn) > .btn-secondary
15
15
  {
16
- margin-top: $base-gap * 3;
16
+ margin-top: $base-gap * 10;
17
+ }
18
+
19
+ .row .col fieldset.formInput:has(ul.groupInputList) {
20
+ margin-bottom: 0;
17
21
  }
18
22
  }
19
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinuts/bsr-uikit-relaunch",
3
- "version": "0.2.35",
3
+ "version": "0.2.37",
4
4
  "private": false,
5
5
  "description": "BSR UI-KIT Relaunch",
6
6
  "main": "dist/index.js",