@pinuts/bsr-uikit-relaunch 0.2.82 → 0.2.83

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":"CheckboxField.d.ts","sourceRoot":"","sources":["../../../../../src/items/eventWizardItems/EventPicker/Components/CheckboxField.jsx"],"names":[],"mappings":";AAOA,8DA+FC;;;;;;kBAtGuD,OAAO;2BACpC,YAAY"}
1
+ {"version":3,"file":"CheckboxField.d.ts","sourceRoot":"","sources":["../../../../../src/items/eventWizardItems/EventPicker/Components/CheckboxField.jsx"],"names":[],"mappings":";AAOA,8DAqFC;;;;;;kBA5FkC,OAAO;2BACf,YAAY"}
@@ -29,26 +29,17 @@ const CheckboxField = props => {
29
29
  } = config;
30
30
  const inputProps = {
31
31
  id: value,
32
- name: `${config.name}_${value}`,
32
+ name: config.name,
33
+ //INFO: name - inputs are connected via name
33
34
  value: value
34
35
  };
35
36
  const {
36
37
  values,
37
38
  setFieldValue
38
39
  } = useFormikContext();
39
- const [field, meta] = useField(config.name);
40
- const [initialized, setInitialized] = (0, _react.useState)(false);
40
+ const [field, meta] = useField(inputProps.name);
41
41
  const checked = (meta.value || []).indexOf(value) > -1;
42
- (0, _react.useEffect)(() => {
43
- if (!initialized && isPreselected) {
44
- const updatedComponents = new Set(values.components || []);
45
- updatedComponents.add(value);
46
- setFieldValue(field.name, Array.from(updatedComponents));
47
- setInitialized(true);
48
- }
49
- }, [initialized, isPreselected, setFieldValue, field.name, values.components, value]);
50
- const isCheckboxDisabled = initialized && isPreselected && !isDeselectable;
51
-
42
+ const isCheckboxDisabled = (isPreselected ?? false) && !(isDeselectable ?? true);
52
43
  // the special onChangeHandler is used when singleSelectionCheckbox is true
53
44
  // so that only one checkbox can be selected, like RadioButtons
54
45
  // otherwise, the normal onChangeHandler is used
@@ -1 +1 @@
1
- {"version":3,"file":"EventPicker.d.ts","sourceRoot":"","sources":["../../../../src/items/eventWizardItems/EventPicker/EventPicker.jsx"],"names":[],"mappings":";AAUA;;sBAwFC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAlGiB,OAAO;2BACE,YAAY"}
1
+ {"version":3,"file":"EventPicker.d.ts","sourceRoot":"","sources":["../../../../src/items/eventWizardItems/EventPicker/EventPicker.jsx"],"names":[],"mappings":";AAUA;;sBAyFC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAnGiB,OAAO;2BACE,YAAY"}
@@ -40,10 +40,11 @@ const EventPicker = _ref => {
40
40
  const {
41
41
  errorMsgId
42
42
  } = config;
43
+ const usedErrorMsgId = errorMsgId || id;
43
44
  const {
44
45
  errors
45
46
  } = useFormikContext();
46
- const errorMsg = errors[errorMsgId];
47
+ const errorMsg = errors[usedErrorMsgId];
47
48
  const groupName = name || id;
48
49
  if (sortAlphabetically) {
49
50
  events.sort((a, b) => a.header.localeCompare(b.header));
@@ -96,8 +97,8 @@ const EventPicker = _ref => {
96
97
  subtitle,
97
98
  required,
98
99
  singleSelectionCheckbox,
99
- isPreselected,
100
- isDeselectable
100
+ isPreselected: isPreselected,
101
+ isDeselectable: isDeselectable
101
102
  }
102
103
  });
103
104
  });
@@ -435,8 +435,9 @@ form input[type="checkbox"]:checked + label:before {
435
435
  background-image: url("data:image/svg+xml,%3Csvg width=%2716%27 height=%2712%27 viewBox=%270 0 16 12%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cpath d=%27M5.75 11.6251C5.57 11.6251 5.38625 11.5613 5.24375 11.4263L0.743749 7.3013C0.439999 7.02005 0.417499 6.54755 0.698749 6.24005C0.979999 5.9363 1.4525 5.9138 1.76 6.19505L5.70875 9.8138L14.2025 0.611304C14.4837 0.307554 14.9562 0.288804 15.2637 0.570054C15.5675 0.851304 15.5862 1.3238 15.305 1.6313L6.305 11.3813C6.15875 11.5426 5.95625 11.6213 5.75375 11.6213L5.75 11.6251Z%27 fill=%27%23D74116%27 stroke=%27%23D74116%27 stroke-width=%270.4%27/%3E%3C/svg%3E%0A");
436
436
  }
437
437
 
438
- form input[type="checkbox"] + label:hover:before {
439
- background-image: url("data:image/svg+xml,%3Csvg width=%2716%27 height=%2712%27 viewBox=%270 0 16 12%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cpath d=%27M5.75001 11.6251C5.57001 11.6251 5.38626 11.5613 5.24376 11.4263L0.743764 7.3013C0.440014 7.02005 0.417514 6.54755 0.698764 6.24005C0.980014 5.9363 1.45251 5.9138 1.76001 6.19505L5.70876 9.8138L14.2025 0.611304C14.4838 0.307554 14.9563 0.288804 15.2638 0.570054C15.5675 0.851304 15.5863 1.3238 15.305 1.6313L6.30501 11.3813C6.15876 11.5426 5.95626 11.6213 5.75376 11.6213L5.75001 11.6251Z%27 fill=%27%23808080%27 stroke=%27%23808080%27 stroke-width=%270.4%27/%3E%3C/svg%3E%0A");
438
+ form input[type="checkbox"] + label:hover:before,
439
+ form input[type="checkbox"] + label:focus:before,
440
+ form input[type="checkbox"] + label:focus-within:before {
440
441
  border-width: 2px;
441
442
  }
442
443
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinuts/bsr-uikit-relaunch",
3
- "version": "0.2.82",
3
+ "version": "0.2.83",
4
4
  "private": false,
5
5
  "description": "BSR UI-KIT Relaunch",
6
6
  "main": "dist/index.js",