@uncinc/uncinc-react-kitchen-sink 2.7.14 → 2.7.15

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,3 +1,4 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
3
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
4
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -33,7 +34,8 @@ function Checkbox(props) {
33
34
  'icon-before': true,
34
35
  'icon-checkmark': true,
35
36
  'icon-variant-0': !checked,
36
- 'icon-variant-1': checked
37
+ 'icon-variant-1': checked,
38
+ 'disabled': disabled
37
39
  });
38
40
  var checkedValues = function checkedValues() {
39
41
  // The value we return here is based on the current state, meaning,
@@ -144,9 +146,11 @@ var Checkboxes = function Checkboxes(props) {
144
146
  touched: isTouched,
145
147
  error: error,
146
148
  displayRequiredIndicator: displayRequiredIndicator
147
- }, Object.keys(options).map(function (value) {
148
- var label = options[value];
149
- var description = descriptions[value] || null;
149
+ }, Object.keys(options).map(function (item) {
150
+ var label = _typeof(options[item]) === 'object' ? options[item].label : options[item];
151
+ var value = _typeof(options[item]) === 'object' ? options[item].value : item;
152
+ var optionDisabled = disabled || _typeof(options[item]) === 'object' && options[item].disabled;
153
+ var description = descriptions[value] || _typeof(options[item]) === 'object' && options[item].description || null;
150
154
  return /*#__PURE__*/React.createElement(Checkbox, {
151
155
  key: value,
152
156
  label: label,
@@ -159,7 +163,7 @@ var Checkboxes = function Checkboxes(props) {
159
163
  value: value,
160
164
  placeholder: placeholder,
161
165
  validate: handleValidation,
162
- disabled: disabled,
166
+ disabled: optionDisabled,
163
167
  otherLabel: otherLabel,
164
168
  otherPlaceholder: otherPlaceholder,
165
169
  onChange: onChange
@@ -1,3 +1,4 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
3
  import React from 'react';
3
4
  import { Field } from 'formik';
@@ -25,10 +26,10 @@ var Radio = function Radio(props) {
25
26
  // represented as numbers.
26
27
  /* eslint-disable */
27
28
  'icon-variant-0': !(field.value && field.value == props.value),
28
- 'icon-variant-1': field.value && field.value == props.value
29
+ 'icon-variant-1': field.value && field.value == props.value,
29
30
  /* eslint-enable */
31
+ 'disabled': disabled
30
32
  });
31
-
32
33
  if (props.value === '__other__') {
33
34
  var inputClasses = c({
34
35
  hidden: field.value !== '__other__'
@@ -117,9 +118,11 @@ var RadioButtons = function RadioButtons(props) {
117
118
  touched: isTouched,
118
119
  error: error,
119
120
  displayRequiredIndicator: displayRequiredIndicator
120
- }, Object.keys(options).map(function (value) {
121
- var label = options[value];
122
- var description = descriptions[value] || null;
121
+ }, Object.keys(options).map(function (item) {
122
+ var label = _typeof(options[item]) === 'object' ? options[item].label : options[item];
123
+ var value = _typeof(options[item]) === 'object' ? options[item].value : item;
124
+ var optionDisabled = disabled || _typeof(options[item]) === 'object' && options[item].disabled;
125
+ var description = descriptions[value] || _typeof(options[item]) === 'object' && options[item].description || null;
123
126
  return /*#__PURE__*/React.createElement(Radio, {
124
127
  key: value,
125
128
  label: label,
@@ -134,7 +137,7 @@ var RadioButtons = function RadioButtons(props) {
134
137
  validate: handleValidation,
135
138
  otherLabel: otherLabel,
136
139
  otherPlaceholder: otherPlaceholder,
137
- disabled: disabled,
140
+ disabled: optionDisabled,
138
141
  onChange: onChange
139
142
  });
140
143
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uncinc/uncinc-react-kitchen-sink",
3
- "version": "2.7.14",
3
+ "version": "2.7.15",
4
4
  "description": "Default React components that are easily extended.",
5
5
  "author": "uncinc",
6
6
  "license": "MIT",