@xaypay/tui 0.0.82 → 0.0.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.
package/dist/index.es.js CHANGED
@@ -1185,6 +1185,7 @@ const Select = ({
1185
1185
  closeIcon,
1186
1186
  errorZindex,
1187
1187
  errorMessage,
1188
+ showCloseIcon,
1188
1189
  defaultOption,
1189
1190
  multipleCheckbox,
1190
1191
  label,
@@ -1387,7 +1388,7 @@ const Select = ({
1387
1388
  }
1388
1389
  }) : defaultOption ? defaultOption : ''), /*#__PURE__*/React__default.createElement("div", {
1389
1390
  className: `${styles$7['select-content-top-icon']}`
1390
- }, !disabled && multiple && newSelected.length > 1 && /*#__PURE__*/React__default.createElement("span", null, newSelected.length), !disabled && newSelected && newSelected.length > 0 && /*#__PURE__*/React__default.createElement("div", {
1391
+ }, !disabled && multiple && newSelected.length > 1 && /*#__PURE__*/React__default.createElement("span", null, newSelected.length), showCloseIcon && !disabled && newSelected && newSelected.length > 0 && /*#__PURE__*/React__default.createElement("div", {
1391
1392
  className: `${styles$7['close-icon']}`,
1392
1393
  onClick: disabled ? _ => _ : handleClearSelect,
1393
1394
  style: {
@@ -1454,6 +1455,7 @@ Select.propTypes = {
1454
1455
  className: PropTypes.string,
1455
1456
  arrowIcon: PropTypes.element,
1456
1457
  closeIcon: PropTypes.element,
1458
+ showCloseIcon: PropTypes.bool,
1457
1459
  errorZindex: PropTypes.number,
1458
1460
  errorMessage: PropTypes.string,
1459
1461
  defaultOption: PropTypes.string,
@@ -3736,6 +3738,7 @@ const NewAutocomplete = ({
3736
3738
  change,
3737
3739
  options,
3738
3740
  getItem,
3741
+ keyNames,
3739
3742
  required,
3740
3743
  disabled,
3741
3744
  selected,
@@ -3775,6 +3778,7 @@ const NewAutocomplete = ({
3775
3778
  contentTopBoxSizing,
3776
3779
  contentTopLineHeight,
3777
3780
  contentBottomMaxWidth,
3781
+ contentTopBorderHover,
3778
3782
  contentBottomOverflow,
3779
3783
  contentBottomPosition,
3780
3784
  contentBottomRowColor,
@@ -3782,6 +3786,7 @@ const NewAutocomplete = ({
3782
3786
  contentBottomBoxShadow,
3783
3787
  contentBottomRowHeight,
3784
3788
  contentBottomRowCursor,
3789
+ contentTopBorderActive,
3785
3790
  contentBottomRowDisplay,
3786
3791
  contentBottomRowPadding,
3787
3792
  contentBottomRowFontSize,
@@ -3792,8 +3797,6 @@ const NewAutocomplete = ({
3792
3797
  contentBottomRowAlignItems,
3793
3798
  contentBottomRowTransition,
3794
3799
  contentBottomRowHoverColor,
3795
- contentTopBorderHover,
3796
- contentTopBorderActive,
3797
3800
  contentBottomInnerOverflowY,
3798
3801
  contentBottomInnerOverflowX,
3799
3802
  contentBottomInnerMaxHeight,
@@ -3804,6 +3807,7 @@ const NewAutocomplete = ({
3804
3807
  contentBottomRowHoverBackgroundColor,
3805
3808
  ...props
3806
3809
  }) => {
3810
+ const [id, setId] = useState('');
3807
3811
  const [show, setShow] = useState(false);
3808
3812
  const [isHover, setIsHover] = useState(false);
3809
3813
  const [isFocus, setIsFocus] = useState(false);
@@ -3840,18 +3844,23 @@ const NewAutocomplete = ({
3840
3844
  };
3841
3845
  const handleChange = e => {
3842
3846
  const value = e.target.value;
3847
+ const currentId = e.target.id;
3843
3848
  value.length > 0 ? setShow(true) : setShow(false);
3844
3849
  setInnerValue(value);
3845
3850
  if (value.length >= searchCount) {
3846
- change(value);
3851
+ change({
3852
+ name: value,
3853
+ id: currentId
3854
+ });
3847
3855
  } else {
3848
3856
  change('');
3849
3857
  }
3850
3858
  };
3851
3859
  const handleClick = selectedValue => {
3852
3860
  setShow(false);
3853
- getItem(selectedValue);
3861
+ setId(selectedValue.id);
3854
3862
  setInnerValue(selectedValue.name);
3863
+ getItem(selectedValue);
3855
3864
  };
3856
3865
  const optionList = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, show && innerOptions && !disabled ? innerOptions.length > 0 ? /*#__PURE__*/React__default.createElement("div", {
3857
3866
  style: {
@@ -3898,7 +3907,7 @@ const NewAutocomplete = ({
3898
3907
  marginBottom: contentBottomRowMarginBottom ? contentBottomRowMarginBottom : configStyles.NEWAUTOCOMPLETE.contentBottomRowMarginBottom,
3899
3908
  backgroundColor: contentBottomRowBackgroundColor ? contentBottomRowBackgroundColor : configStyles.NEWAUTOCOMPLETE.contentBottomRowBackgroundColor
3900
3909
  }
3901
- }, item.name);
3910
+ }, item[keyNames.name]);
3902
3911
  }))) : innerOptions.length <= 0 ? /*#__PURE__*/React__default.createElement("span", {
3903
3912
  style: {
3904
3913
  position: 'absolute',
@@ -3932,11 +3941,13 @@ const NewAutocomplete = ({
3932
3941
  }, [change]);
3933
3942
  useEffect(() => {
3934
3943
  if (selected) {
3935
- setInnerValue(selected);
3944
+ setId(selected[keyNames.id]);
3945
+ setInnerValue(selected[keyNames.name]);
3936
3946
  } else {
3947
+ setId('');
3937
3948
  setInnerValue('');
3938
3949
  }
3939
- }, [selected, selected?.length]);
3950
+ }, [selected]);
3940
3951
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, label ? /*#__PURE__*/React__default.createElement("label", {
3941
3952
  style: {
3942
3953
  color: labelColor ? labelColor : configStyles.NEWAUTOCOMPLETE.labelColor,
@@ -3960,6 +3971,7 @@ const NewAutocomplete = ({
3960
3971
  maxWidth: contentTopMaxWidth ? contentTopMaxWidth : configStyles.NEWAUTOCOMPLETE.contentTopMaxWidth
3961
3972
  }
3962
3973
  }, /*#__PURE__*/React__default.createElement("input", _extends({
3974
+ id: id,
3963
3975
  type: "text",
3964
3976
  value: innerValue,
3965
3977
  disabled: disabled,
@@ -4003,7 +4015,8 @@ NewAutocomplete.propTypes = {
4003
4015
  label: PropTypes.string,
4004
4016
  required: PropTypes.bool,
4005
4017
  disabled: PropTypes.bool,
4006
- selected: PropTypes.string,
4018
+ keyNames: PropTypes.object,
4019
+ selected: PropTypes.object,
4007
4020
  errorSize: PropTypes.string,
4008
4021
  marginTop: PropTypes.string,
4009
4022
  labelSize: PropTypes.string,
package/dist/index.js CHANGED
@@ -1215,6 +1215,7 @@ const Select = ({
1215
1215
  closeIcon,
1216
1216
  errorZindex,
1217
1217
  errorMessage,
1218
+ showCloseIcon,
1218
1219
  defaultOption,
1219
1220
  multipleCheckbox,
1220
1221
  label,
@@ -1417,7 +1418,7 @@ const Select = ({
1417
1418
  }
1418
1419
  }) : defaultOption ? defaultOption : ''), /*#__PURE__*/React__default["default"].createElement("div", {
1419
1420
  className: `${styles$7['select-content-top-icon']}`
1420
- }, !disabled && multiple && newSelected.length > 1 && /*#__PURE__*/React__default["default"].createElement("span", null, newSelected.length), !disabled && newSelected && newSelected.length > 0 && /*#__PURE__*/React__default["default"].createElement("div", {
1421
+ }, !disabled && multiple && newSelected.length > 1 && /*#__PURE__*/React__default["default"].createElement("span", null, newSelected.length), showCloseIcon && !disabled && newSelected && newSelected.length > 0 && /*#__PURE__*/React__default["default"].createElement("div", {
1421
1422
  className: `${styles$7['close-icon']}`,
1422
1423
  onClick: disabled ? _ => _ : handleClearSelect,
1423
1424
  style: {
@@ -1484,6 +1485,7 @@ Select.propTypes = {
1484
1485
  className: PropTypes__default["default"].string,
1485
1486
  arrowIcon: PropTypes__default["default"].element,
1486
1487
  closeIcon: PropTypes__default["default"].element,
1488
+ showCloseIcon: PropTypes__default["default"].bool,
1487
1489
  errorZindex: PropTypes__default["default"].number,
1488
1490
  errorMessage: PropTypes__default["default"].string,
1489
1491
  defaultOption: PropTypes__default["default"].string,
@@ -3766,6 +3768,7 @@ const NewAutocomplete = ({
3766
3768
  change,
3767
3769
  options,
3768
3770
  getItem,
3771
+ keyNames,
3769
3772
  required,
3770
3773
  disabled,
3771
3774
  selected,
@@ -3805,6 +3808,7 @@ const NewAutocomplete = ({
3805
3808
  contentTopBoxSizing,
3806
3809
  contentTopLineHeight,
3807
3810
  contentBottomMaxWidth,
3811
+ contentTopBorderHover,
3808
3812
  contentBottomOverflow,
3809
3813
  contentBottomPosition,
3810
3814
  contentBottomRowColor,
@@ -3812,6 +3816,7 @@ const NewAutocomplete = ({
3812
3816
  contentBottomBoxShadow,
3813
3817
  contentBottomRowHeight,
3814
3818
  contentBottomRowCursor,
3819
+ contentTopBorderActive,
3815
3820
  contentBottomRowDisplay,
3816
3821
  contentBottomRowPadding,
3817
3822
  contentBottomRowFontSize,
@@ -3822,8 +3827,6 @@ const NewAutocomplete = ({
3822
3827
  contentBottomRowAlignItems,
3823
3828
  contentBottomRowTransition,
3824
3829
  contentBottomRowHoverColor,
3825
- contentTopBorderHover,
3826
- contentTopBorderActive,
3827
3830
  contentBottomInnerOverflowY,
3828
3831
  contentBottomInnerOverflowX,
3829
3832
  contentBottomInnerMaxHeight,
@@ -3834,6 +3837,7 @@ const NewAutocomplete = ({
3834
3837
  contentBottomRowHoverBackgroundColor,
3835
3838
  ...props
3836
3839
  }) => {
3840
+ const [id, setId] = React.useState('');
3837
3841
  const [show, setShow] = React.useState(false);
3838
3842
  const [isHover, setIsHover] = React.useState(false);
3839
3843
  const [isFocus, setIsFocus] = React.useState(false);
@@ -3870,18 +3874,23 @@ const NewAutocomplete = ({
3870
3874
  };
3871
3875
  const handleChange = e => {
3872
3876
  const value = e.target.value;
3877
+ const currentId = e.target.id;
3873
3878
  value.length > 0 ? setShow(true) : setShow(false);
3874
3879
  setInnerValue(value);
3875
3880
  if (value.length >= searchCount) {
3876
- change(value);
3881
+ change({
3882
+ name: value,
3883
+ id: currentId
3884
+ });
3877
3885
  } else {
3878
3886
  change('');
3879
3887
  }
3880
3888
  };
3881
3889
  const handleClick = selectedValue => {
3882
3890
  setShow(false);
3883
- getItem(selectedValue);
3891
+ setId(selectedValue.id);
3884
3892
  setInnerValue(selectedValue.name);
3893
+ getItem(selectedValue);
3885
3894
  };
3886
3895
  const optionList = /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, show && innerOptions && !disabled ? innerOptions.length > 0 ? /*#__PURE__*/React__default["default"].createElement("div", {
3887
3896
  style: {
@@ -3928,7 +3937,7 @@ const NewAutocomplete = ({
3928
3937
  marginBottom: contentBottomRowMarginBottom ? contentBottomRowMarginBottom : configStyles.NEWAUTOCOMPLETE.contentBottomRowMarginBottom,
3929
3938
  backgroundColor: contentBottomRowBackgroundColor ? contentBottomRowBackgroundColor : configStyles.NEWAUTOCOMPLETE.contentBottomRowBackgroundColor
3930
3939
  }
3931
- }, item.name);
3940
+ }, item[keyNames.name]);
3932
3941
  }))) : innerOptions.length <= 0 ? /*#__PURE__*/React__default["default"].createElement("span", {
3933
3942
  style: {
3934
3943
  position: 'absolute',
@@ -3962,11 +3971,13 @@ const NewAutocomplete = ({
3962
3971
  }, [change]);
3963
3972
  React.useEffect(() => {
3964
3973
  if (selected) {
3965
- setInnerValue(selected);
3974
+ setId(selected[keyNames.id]);
3975
+ setInnerValue(selected[keyNames.name]);
3966
3976
  } else {
3977
+ setId('');
3967
3978
  setInnerValue('');
3968
3979
  }
3969
- }, [selected, selected?.length]);
3980
+ }, [selected]);
3970
3981
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, label ? /*#__PURE__*/React__default["default"].createElement("label", {
3971
3982
  style: {
3972
3983
  color: labelColor ? labelColor : configStyles.NEWAUTOCOMPLETE.labelColor,
@@ -3990,6 +4001,7 @@ const NewAutocomplete = ({
3990
4001
  maxWidth: contentTopMaxWidth ? contentTopMaxWidth : configStyles.NEWAUTOCOMPLETE.contentTopMaxWidth
3991
4002
  }
3992
4003
  }, /*#__PURE__*/React__default["default"].createElement("input", _extends({
4004
+ id: id,
3993
4005
  type: "text",
3994
4006
  value: innerValue,
3995
4007
  disabled: disabled,
@@ -4033,7 +4045,8 @@ NewAutocomplete.propTypes = {
4033
4045
  label: PropTypes__default["default"].string,
4034
4046
  required: PropTypes__default["default"].bool,
4035
4047
  disabled: PropTypes__default["default"].bool,
4036
- selected: PropTypes__default["default"].string,
4048
+ keyNames: PropTypes__default["default"].object,
4049
+ selected: PropTypes__default["default"].object,
4037
4050
  errorSize: PropTypes__default["default"].string,
4038
4051
  marginTop: PropTypes__default["default"].string,
4039
4052
  labelSize: PropTypes__default["default"].string,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xaypay/tui",
3
- "version": "0.0.82",
3
+ "version": "0.0.83",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -21,7 +21,7 @@ Default.args = {
21
21
  method: 'GET',
22
22
  headers: {
23
23
  'Content-Type': 'application/json',
24
- 'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIwMjE0NzEyYTllNzQwZWMyMjNhYzE2MGQyNGVkY2UzNyIsImp0aSI6ImY2N2FjNmNiYjI2YWM3NTRhMDhhOTgxOTZkOTZjNjFjNWI3YTA1NzUyN2U4MGE3NzM0ZDJlOGFlZjNkMjY0ZmRiMGZkN2QwZjllZjA1MmE4IiwiaWF0IjoxNjgwNzYzMzU3LjUyMzI5OCwibmJmIjoxNjgwNzYzMzU3LjUyMzMwNSwiZXhwIjoxNjgwNzg4NTU3LjQ5NjQzLCJzdWIiOiJtaW5hc0BtYWlsLnJ1Iiwic2NvcGVzIjpbImVtYWlsIl19.XLp4N1C9XYnX8EITknJs-j684GkppCVrREA5ttTAEyloxCftJUEo6KQGp-2grZDZvWvwvsgD9NF5lecdPOIYuSEgp7NPgbAQ34-hRn0u6TGoC5LQI6Vjc_PijH9YoH2a2V9q58jAJrxSbwNjKsMixiHmAsahIKl_XRL1ZoDxpKDE23avnndCZZ9Fw_oe8ypkEscfgrpK9iT9EhxWXZWC9MJ-iAxHox6b6XWsVHkJg5oN5MApJt1h9h-oZQmrKNn_274z3evPChlrvSjTyqLzGWy3zlVUMgGQWBE5RsKiuUh1O3TsF4PYvANKp0a_urOFtU9Q-umyfFNlWfgoLsTtKIQE0xmlLi8Kr5OutSna-a0Eu2hzgTM47_x-cJb7ImokTxdgoh1DDODmLDKkfTTXhEQ-KNTQ4J5T8UDn6a11E6EzBEfJYOI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fqpCB7wkYfGpqeYH-eW4KYuZeReU1OyIKCTxBJhDfcFqZRb4x7TUIxNoFXknLhhU4mB7t75ZZxpUwtJRXqF_Ps8eiBWcfmt5uZfVQqzFXcBlx6lmDwBn7RIF0jy5oKvs6ss5mBjv0SdKSJrpRMa9GIVT9lUJDqKA15JZIGXdugjBXwlrzFfekePXA_7AAFrxgS0Dn7EZJCh7EmBdGG3slPLRtnkcVru2AOLHZ-aRPtVluzxgip9RU23VMVXvoX-I',
25
25
  },
26
26
  }).then((res)=> {
27
27
  return res.json()
@@ -24,11 +24,11 @@ const Template = (args) => {
24
24
  };
25
25
 
26
26
  const handleChange = (value) => {
27
- fetch(`http://dev2.govazd-api.yerevan.am/api/v1/companies/autocomplete?slug=${value}`, {
27
+ fetch(`http://dev2.govazd-api.yerevan.am/api/v1/companies/autocomplete?slug=${value.name ? value.name : ''}`, {
28
28
  method: 'GET',
29
29
  headers: {
30
30
  'Content-Type': 'application/json',
31
- 'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIwMjE0NzEyYTllNzQwZWMyMjNhYzE2MGQyNGVkY2UzNyIsImp0aSI6IjRlZTI2OGU3NjhkMjA0YTdiMWM1NjU4NzE2Mjg0OTdjNTlmMmZjYjc4YzdiZTRjYTYzZGUyYjZmNjZjMzU3YjI0MzMwZjRhOTc5OGRjZDY4IiwiaWF0IjoxNjgxMzYzNDI2LjE0NDc0NywibmJmIjoxNjgxMzYzNDI2LjE0NDc1NCwiZXhwIjoxNjgxMzg4NjI2LjExODkzNywic3ViIjoibWluYXNAbWFpbC5ydSIsInNjb3BlcyI6WyJlbWFpbCJdfQ.nGU1Jf4XeVEqOHCXfDsjL-q--jTDrjlACMolSISUpviSaEDVLCI6BpY5_YYjOWRBUr4Utl_guFqpnb9jxbWdugL6_uFBANj1v0bi_g-RlzzeqF0FqlUqf1YZ_8S4c-l8nLsqfSDzPJs3nRB6oJVo7Di2O3fS_ka5MCkT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lBBbJv-bMBqj0KIcsLWHBMfHb2lU8UK6_xMgSbsV_E3FzrhbgmBeFifBTn9BVkduz450jWKmib5zKFRv4lqpFrMJo7gOQRj0-uQliCCdtnvOBW3QqBeT0Zl-RFH-Vc22GAxSYWF7PZ1M-tOZ2PlR7pyfJabp6nEtsRii5PhoejUBAynYmZBKxY-TvKGjfpOXcULm2w0zIqrV2KRf4acj189Kok_nE5rpReqc0xk6hxDdhyBPdBDtgm58c25G_fkkSpMJvDyZg0fqpCB7wkYfGpqeYH-eW4KYuZeReU1OyIKCTxBJhDfcFqZRb4x7TUIxNoFXknLhhU4mB7t75ZZxpUwtJRXqF_Ps8eiBWcfmt5uZfVQqzFXcBlx6lmDwBn7RIF0jy5oKvs6ss5mBjv0SdKSJrpRMa9GIVT9lUJDqKA15JZIGXdugjBXwlrzFfekePXA_7AAFrxgS0Dn7EZJCh7EmBdGG3slPLRtnkcVru2AOLHZ-aRPtVluzxgip9RU23VMVXvoX-I',
32
32
  },
33
33
  }).then((res)=> {
34
34
  return res.json()
@@ -47,5 +47,6 @@ const Template = (args) => {
47
47
  export const Default = Template.bind({});
48
48
  Default.args = {
49
49
  searchCount: 3,
50
- selected: 'Jhon'
50
+ keyNames: { name: 'name', id: 'bbb' },
51
+ selected: { "bbb":"0", "name":"gasdfgdsfgdsg" },
51
52
  }
@@ -10,6 +10,7 @@ export const NewAutocomplete = ({
10
10
  change,
11
11
  options,
12
12
  getItem,
13
+ keyNames,
13
14
  required,
14
15
  disabled,
15
16
  selected,
@@ -49,6 +50,7 @@ export const NewAutocomplete = ({
49
50
  contentTopBoxSizing,
50
51
  contentTopLineHeight,
51
52
  contentBottomMaxWidth,
53
+ contentTopBorderHover,
52
54
  contentBottomOverflow,
53
55
  contentBottomPosition,
54
56
  contentBottomRowColor,
@@ -56,6 +58,7 @@ export const NewAutocomplete = ({
56
58
  contentBottomBoxShadow,
57
59
  contentBottomRowHeight,
58
60
  contentBottomRowCursor,
61
+ contentTopBorderActive,
59
62
  contentBottomRowDisplay,
60
63
  contentBottomRowPadding,
61
64
  contentBottomRowFontSize,
@@ -66,8 +69,6 @@ export const NewAutocomplete = ({
66
69
  contentBottomRowAlignItems,
67
70
  contentBottomRowTransition,
68
71
  contentBottomRowHoverColor,
69
- contentTopBorderHover,
70
- contentTopBorderActive,
71
72
  contentBottomInnerOverflowY,
72
73
  contentBottomInnerOverflowX,
73
74
  contentBottomInnerMaxHeight,
@@ -78,6 +79,7 @@ export const NewAutocomplete = ({
78
79
  contentBottomRowHoverBackgroundColor,
79
80
  ...props
80
81
  }) => {
82
+ const [id, setId] = useState('');
81
83
  const [show, setShow] = useState(false);
82
84
  const [isHover, setIsHover] = useState(false);
83
85
  const [isFocus, setIsFocus] = useState(false);
@@ -123,10 +125,11 @@ export const NewAutocomplete = ({
123
125
 
124
126
  const handleChange = (e) => {
125
127
  const value = e.target.value;
128
+ const currentId = e.target.id;
126
129
  value.length > 0 ? setShow(true) : setShow(false);
127
130
  setInnerValue(value);
128
131
  if (value.length >= searchCount) {
129
- change(value);
132
+ change({ name: value, id: currentId });
130
133
  } else {
131
134
  change('');
132
135
  }
@@ -134,8 +137,9 @@ export const NewAutocomplete = ({
134
137
 
135
138
  const handleClick = (selectedValue) => {
136
139
  setShow(false);
137
- getItem(selectedValue);
140
+ setId(selectedValue.id);
138
141
  setInnerValue(selectedValue.name);
142
+ getItem(selectedValue);
139
143
  };
140
144
 
141
145
  const optionList = (
@@ -201,7 +205,7 @@ export const NewAutocomplete = ({
201
205
  backgroundColor: contentBottomRowBackgroundColor ? contentBottomRowBackgroundColor : configStyles.NEWAUTOCOMPLETE.contentBottomRowBackgroundColor
202
206
  }}
203
207
  >
204
- {item.name}
208
+ {item[keyNames.name]}
205
209
  </p>
206
210
  )
207
211
  })
@@ -260,11 +264,13 @@ export const NewAutocomplete = ({
260
264
 
261
265
  useEffect(() => {
262
266
  if (selected) {
263
- setInnerValue(selected);
267
+ setId(selected[keyNames.id]);
268
+ setInnerValue(selected[keyNames.name]);
264
269
  } else {
270
+ setId('');
265
271
  setInnerValue('');
266
272
  }
267
- }, [selected, selected?.length]);
273
+ }, [selected]);
268
274
 
269
275
  return (
270
276
  <>
@@ -302,6 +308,7 @@ export const NewAutocomplete = ({
302
308
  }}
303
309
  >
304
310
  <input
311
+ id={id}
305
312
  type='text'
306
313
  value={innerValue}
307
314
  disabled={disabled}
@@ -366,7 +373,8 @@ NewAutocomplete.propTypes = {
366
373
  label: PropTypes.string,
367
374
  required: PropTypes.bool,
368
375
  disabled: PropTypes.bool,
369
- selected: PropTypes.string,
376
+ keyNames: PropTypes.object,
377
+ selected: PropTypes.object,
370
378
  errorSize: PropTypes.string,
371
379
  marginTop: PropTypes.string,
372
380
  labelSize: PropTypes.string,
@@ -23,6 +23,7 @@ export const Select = ({
23
23
  closeIcon,
24
24
  errorZindex,
25
25
  errorMessage,
26
+ showCloseIcon,
26
27
  defaultOption,
27
28
  multipleCheckbox,
28
29
 
@@ -263,11 +264,11 @@ export const Select = ({
263
264
  !disabled && multiple && newSelected.length > 1 && <span>{newSelected.length}</span>
264
265
  }
265
266
 
266
- {!disabled && newSelected && newSelected.length > 0 &&
267
+ {showCloseIcon && !disabled && newSelected && newSelected.length > 0 &&
267
268
  <div
268
- className={`${styles['close-icon']}`}
269
- onClick={disabled ? _ => _ : handleClearSelect}
270
- style={{marginLeft: multiple && newSelected.length > 1 ? '17px' : '0px'}}
269
+ className={`${styles['close-icon']}`}
270
+ onClick={disabled ? _ => _ : handleClearSelect}
271
+ style={{marginLeft: multiple && newSelected.length > 1 ? '17px' : '0px'}}
271
272
  >
272
273
  { closeIcon ? closeIcon : <ReactCloseIcon /> }
273
274
  </div>
@@ -367,6 +368,7 @@ Select.propTypes = {
367
368
  className: PropTypes.string,
368
369
  arrowIcon: PropTypes.element,
369
370
  closeIcon: PropTypes.element,
371
+ showCloseIcon: PropTypes.bool,
370
372
  errorZindex: PropTypes.number,
371
373
  errorMessage: PropTypes.string,
372
374
  defaultOption: PropTypes.string,
@@ -17,6 +17,7 @@ const Template = (args) => <Select label='' {...args} >Default</Select>;
17
17
 
18
18
  export const Default = Template.bind({});
19
19
  Default.args = {
20
+ showCloseIcon: true,
20
21
  label: 'վարչական շրջան',
21
22
  options: [{"bbb":"0", "value":"Արաբկիր"}, {"bbb":"1", "value":"Կենտրոն"}, {"bbb":"2", "value":"Մալաթիա"}],
22
23
  onChange: (newValue)=> {
@@ -298,16 +298,30 @@ const bodyData = [
298
298
  content: '27.05.2022'
299
299
  },
300
300
  actions: [
301
- {
302
- id: 21031,
303
- type: 'minus',
304
- content: <ReactSVGMinus />
305
- },
306
- {
307
- id: 21031,
308
- type: 'delete',
309
- content: <ReactSVGDelete />
310
- }
301
+ [
302
+ {
303
+ id: 20037,
304
+ type: 'attach',
305
+ content: <ReactSVGAttach />
306
+ },
307
+ {
308
+ id: 20037,
309
+ type: 'plus',
310
+ content: <ReactSVGPlus />
311
+ }
312
+ ],
313
+ [
314
+ {
315
+ id: 21031,
316
+ type: 'minus',
317
+ content: <ReactSVGMinus />
318
+ },
319
+ {
320
+ id: 21031,
321
+ type: 'delete',
322
+ content: <ReactSVGDelete />
323
+ }
324
+ ]
311
325
  ]
312
326
  }
313
327
  ];
@@ -57,6 +57,28 @@ const TD = ({
57
57
  { newItem.content }
58
58
  </span>
59
59
  )
60
+ } else if (newItem && Array.isArray(newItem)) {
61
+ const x = item[newIndex].map((iT, iN) => {
62
+ // console.log(iT, ' - - - ->>>>>>>>>>>>>>>>>>>>>>>');
63
+ // return <span key={`${iT.id}_${iN}`}>
64
+ // {iT}
65
+ // </span>;
66
+ return <span
67
+ style={{
68
+ width: '32px',
69
+ height: '32px',
70
+ marginRight: '10px'
71
+ }}
72
+ id={iT.id}
73
+ type={iT.type}
74
+ className={styles['td-span']}
75
+ key={`${iT.id}_${iN}`}
76
+ onClick={handleBodyActionClick}
77
+ >
78
+ { iT.content }
79
+ </span>
80
+ });
81
+ console.log(x, 'x');
60
82
  } else {
61
83
  return <span
62
84
  key={`${newItem}_${newIndex}`}