@app-studio/web 0.7.7 → 0.7.9

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/web.esm.js CHANGED
@@ -3802,7 +3802,7 @@ var useSelectState = function useSelectState(_ref) {
3802
3802
  var placeholder = _ref.placeholder,
3803
3803
  isMulti = _ref.isMulti,
3804
3804
  options = _ref.options;
3805
- var defaultValue = placeholder ? isMulti ? [] : '' : options[0];
3805
+ var defaultValue = placeholder ? isMulti ? [] : '' : options[0].value;
3806
3806
  var _React$useState = React.useState(true),
3807
3807
  hide = _React$useState[0],
3808
3808
  setHide = _React$useState[1];
@@ -3878,14 +3878,15 @@ var Item = function Item(_ref) {
3878
3878
  onMouseEnter: handleHover,
3879
3879
  onMouseLeave: handleHover,
3880
3880
  onClick: function onClick() {
3881
- return handleOptionClick(option);
3881
+ return handleOptionClick(option.value);
3882
3882
  },
3883
3883
  backgroundColor: isHovered ? 'trueGray.100' : 'transparent'
3884
3884
  }, props), React.createElement(Text, Object.assign({
3885
3885
  fontSize: Typography.fontSizes[size]
3886
- }, style), option));
3886
+ }, style), option.label));
3887
3887
  };
3888
3888
  var SelectBox = function SelectBox(_ref2) {
3889
+ var _option$label;
3889
3890
  var _ref2$size = _ref2.size,
3890
3891
  size = _ref2$size === void 0 ? 'md' : _ref2$size,
3891
3892
  _ref2$styles = _ref2.styles,
@@ -3897,7 +3898,8 @@ var SelectBox = function SelectBox(_ref2) {
3897
3898
  isDisabled = _ref2.isDisabled,
3898
3899
  placeholder = _ref2.placeholder,
3899
3900
  _ref2$removeOption = _ref2.removeOption,
3900
- removeOption = _ref2$removeOption === void 0 ? function () {} : _ref2$removeOption;
3901
+ removeOption = _ref2$removeOption === void 0 ? function () {} : _ref2$removeOption,
3902
+ options = _ref2.options;
3901
3903
  var fieldStyles = _extends({
3902
3904
  margin: 0,
3903
3905
  width: '95%',
@@ -3910,7 +3912,10 @@ var SelectBox = function SelectBox(_ref2) {
3910
3912
  color: isDisabled ? 'color.trueGray.600' : 'color.blueGray.700',
3911
3913
  cursor: isDisabled ? 'not-allowed' : 'auto'
3912
3914
  }, styles['field'], styles['text']);
3913
- return React.createElement(Text, Object.assign({}, fieldStyles), (value === '' || value && value.length === 0) && !!placeholder ? placeholder : React.createElement(React.Fragment, null, typeof value === 'string' ? value : value && value.length > 0 && React.createElement(Horizontal, {
3915
+ var option = options.find(function (option) {
3916
+ return option.value === value;
3917
+ });
3918
+ return React.createElement(Text, Object.assign({}, fieldStyles), (value === '' || value && value.length === 0) && !!placeholder ? placeholder : React.createElement(React.Fragment, null, typeof value === 'string' ? (_option$label = option == null ? void 0 : option.label) != null ? _option$label : value : value && value.length > 0 && React.createElement(Horizontal, {
3914
3919
  gap: 6
3915
3920
  }, value.map(function (option) {
3916
3921
  return React.createElement(MultiSelect, {
@@ -3952,9 +3957,9 @@ var HiddenSelect = function HiddenSelect(_ref3) {
3952
3957
  multiple: isMulti
3953
3958
  }, props), options.map(function (option) {
3954
3959
  return React.createElement("option", {
3955
- key: option,
3956
- value: option
3957
- }, option);
3960
+ key: option.value,
3961
+ value: option.value
3962
+ }, option.label);
3958
3963
  }));
3959
3964
  };
3960
3965
  var DropDown$1 = function DropDown(_ref4) {
@@ -4011,7 +4016,7 @@ var DropDown$1 = function DropDown(_ref4) {
4011
4016
  }
4012
4017
  }, shadow, styles['dropDown']), options.map(function (option, index) {
4013
4018
  return React.createElement(Item, Object.assign({
4014
- key: option,
4019
+ key: option.value,
4015
4020
  size: size,
4016
4021
  style: styles['text'],
4017
4022
  option: option,
@@ -4175,6 +4180,7 @@ var SelectView = function SelectView(_ref6) {
4175
4180
  isMulti: isMulti,
4176
4181
  onFocus: handleFocus
4177
4182
  }, props)), React.createElement(SelectBox, {
4183
+ options: options,
4178
4184
  size: size,
4179
4185
  styles: styles,
4180
4186
  value: value,
@@ -4814,6 +4820,10 @@ var FormikCountryPicker = CountryPickerComponent$1;
4814
4820
  var SelectComponent$1 = function SelectComponent(props) {
4815
4821
  var formProps = useFormikInput(props);
4816
4822
  formProps.selected = formProps.value;
4823
+ console.log({
4824
+ formProps: formProps,
4825
+ test: formProps.value
4826
+ });
4817
4827
  var selectStates = useSelectState(props);
4818
4828
  return React.createElement(SelectView, Object.assign({}, selectStates, formProps));
4819
4829
  };