@vitrosoftware/common-ui-ts 1.1.64 → 1.1.66

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/css/common.css CHANGED
@@ -22,7 +22,7 @@
22
22
  font-family: 'InterRegular';
23
23
  line-height: 24px;
24
24
  margin-right: 24px;
25
- margin-bottom: 14px;
25
+ margin-bottom: 0;
26
26
  }
27
27
 
28
28
  :global(.vitro-flex) {
@@ -152,6 +152,7 @@
152
152
  :global(.vitro-button-context) {
153
153
  padding: 0 !important;
154
154
  width: 24px;
155
+ background-color: #fff !important;
155
156
  }
156
157
 
157
158
  :global(.vitro-button-context > div),
@@ -2,7 +2,6 @@
2
2
  display: flex;
3
3
  z-index: 800;
4
4
  padding: 0 !important;
5
- margin-bottom: 12px;
6
5
  min-height: 32px;
7
6
  }
8
7
 
@@ -84,6 +84,12 @@ input#pageNumber {
84
84
  margin: 0;
85
85
  margin-top: 1px;
86
86
  border: 1px solid #C0CAD5;
87
+ font-size: 14px;
88
+ min-width: 40px;
89
+ width: fit-content;
90
+ line-height: 20px;
91
+ text-overflow: ellipsis;
92
+ overflow: hidden;
87
93
  }
88
94
 
89
95
  .horizontalToolbarSeparator {
@@ -47,9 +47,6 @@
47
47
  background-color: #fff;
48
48
  }
49
49
 
50
- .vitro-active .vitro-search-value-list {
51
- width: 262px;
52
- }
53
50
 
54
51
  .vitro-search-value-list {
55
52
  display: flex;
@@ -101,6 +98,10 @@
101
98
  margin-right: 4px;
102
99
  white-space: nowrap;
103
100
  overflow: hidden;
101
+ }
102
+
103
+ .vitro-search-value span {
104
+ overflow: hidden;
104
105
  text-overflow: ellipsis;
105
106
  }
106
107
 
@@ -1,8 +1,12 @@
1
1
  .vitro-search {
2
2
  position: relative;
3
3
  align-self: baseline;
4
- margin-right: 16px;
5
4
  margin-left: auto;
5
+ max-width: 376px;
6
+ }
7
+
8
+ .vitro-search.vitro-active {
9
+ width: 376px;
6
10
  }
7
11
 
8
12
  .vitro-settings-dialog {
@@ -43,4 +43,11 @@
43
43
  :global(.vitro-tableview-progress-message.vitro-table-view-export-message) {
44
44
  background-color: #fff;
45
45
  border: 1px solid #ff5b2d !important;
46
+ }
47
+
48
+ :global(.vitro-group-row) {
49
+ background: #F7F9FC;
50
+ font-family: 'InterMedium';
51
+ border-top: 1px solid #E4E6EC !important;
52
+ color: #4A556C !important;
46
53
  }
@@ -635,6 +635,18 @@
635
635
  left: 0;
636
636
  }
637
637
 
638
+ .TWTabHtml1::before {
639
+ content: '';
640
+ display: inline-block;
641
+ height: 16px;
642
+ margin-right: 4px;
643
+ width: 16px;
644
+ margin-left: -6px;
645
+ vertical-align: sub;
646
+ /* check.svg URL-encoder for SVG */
647
+ background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='check-one /Line/Black' clip-path='url(%23clip0_2166_122689)'%3E%3Cpath id='Vector' d='M4 8L7 11L12 6' stroke='%23222D44' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_2166_122689'%3E%3Crect width='16' height='16' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A");
648
+ }
649
+
638
650
  .TWHeaderGroup {
639
651
  padding: 0 4px;
640
652
  background: #fff;
@@ -738,6 +750,7 @@
738
750
  .TWMenuButton:hover,
739
751
  .TWMenuButton:active {
740
752
  background: #3274E0;
753
+ border: none;
741
754
  }
742
755
 
743
756
  .TWDialogButtonCancel {
@@ -1,15 +1,20 @@
1
1
  /// <reference types="react" />
2
2
  import { SearchCriterion } from '../Search/SearchCriterion';
3
3
  interface InputProps {
4
- valueList?: SearchCriterion[];
4
+ valueList: SearchCriterion[];
5
5
  textValue?: string;
6
6
  placeholder?: string;
7
- onSettingsClick?: (active: boolean) => any;
7
+ onSettingsClick?: () => any;
8
8
  onCancel: () => any;
9
- onSubmit: (value?: string) => any;
9
+ onSubmit: (value?: string, searchCriterionList?: SearchCriterion[]) => any;
10
10
  onChange?: (value: any) => any;
11
+ onBlur?: () => any;
12
+ onFocus?: () => any;
13
+ onRemoveValue?: (newItemList: SearchCriterion[]) => any;
11
14
  isShowSettings?: boolean;
12
15
  isSettingsActive?: boolean;
16
+ isActive: boolean;
17
+ isMobileView: boolean;
13
18
  className?: string;
14
19
  }
15
20
  export declare const Input: (props: InputProps) => JSX.Element;
@@ -77,4 +77,5 @@ export interface TableViewContext {
77
77
  getFocusedRows(): any[];
78
78
  getFilter(spec: boolean): any[];
79
79
  selectRange(row1: any, col1: any, row2: any, col2: any, select: boolean): any;
80
+ showColumns(): any;
80
81
  }
@@ -87,4 +87,5 @@ export declare class TreeGridTableViewContextImpl implements TableViewContext {
87
87
  getFocusedRows(): any[];
88
88
  getFilter(spec: boolean): any[];
89
89
  selectRange(row1: any, col1: any, row2: any, col2: any, select: boolean): any;
90
+ showColumns(): any;
90
91
  }
package/dist/index.css CHANGED
@@ -22,7 +22,7 @@
22
22
  font-family: 'InterRegular';
23
23
  line-height: 24px;
24
24
  margin-right: 24px;
25
- margin-bottom: 14px;
25
+ margin-bottom: 0;
26
26
  }
27
27
 
28
28
  .vitro-flex {
@@ -527,6 +527,13 @@
527
527
  .vitro-tableview-progress-message.vitro-table-view-export-message {
528
528
  background-color: #fff;
529
529
  border: 1px solid #ff5b2d !important;
530
+ }
531
+
532
+ .vitro-group-row {
533
+ background: #F7F9FC;
534
+ font-family: 'InterMedium';
535
+ border-top: 1px solid #E4E6EC !important;
536
+ color: #4A556C !important;
530
537
  }
531
538
 
532
539
  ._uploader_vitro-uploader_237vX7T {
@@ -3341,7 +3348,6 @@
3341
3348
  display: flex;
3342
3349
  z-index: 800;
3343
3350
  padding: 0 !important;
3344
- margin-bottom: 12px;
3345
3351
  min-height: 32px;
3346
3352
  }
3347
3353
 
@@ -3602,6 +3608,7 @@ li:first-child ._command-menu-item_vitro-item_2pVhk23:hover {
3602
3608
  .vitro-button-context {
3603
3609
  padding: 0 !important;
3604
3610
  width: 24px;
3611
+ background-color: #fff !important;
3605
3612
  }
3606
3613
 
3607
3614
  .vitro-button-context > div,
@@ -5042,9 +5049,6 @@ ul > li:last-child > ul > li:last-child ._sidebar-item_vitro-active_7p5iOhY {
5042
5049
  background-color: #fff;
5043
5050
  }
5044
5051
 
5045
- ._input_vitro-active_jxhGdE8 ._input_vitro-search-value-list_2I_KVY5 {
5046
- width: 262px;
5047
- }
5048
5052
 
5049
5053
  ._input_vitro-search-value-list_2I_KVY5 {
5050
5054
  display: flex;
@@ -5096,6 +5100,10 @@ ul > li:last-child > ul > li:last-child ._sidebar-item_vitro-active_7p5iOhY {
5096
5100
  margin-right: 4px;
5097
5101
  white-space: nowrap;
5098
5102
  overflow: hidden;
5103
+ }
5104
+
5105
+ ._input_vitro-search-value_1ZbcNTJ span {
5106
+ overflow: hidden;
5099
5107
  text-overflow: ellipsis;
5100
5108
  }
5101
5109
 
@@ -5144,8 +5152,12 @@ ul > li:last-child > ul > li:last-child ._sidebar-item_vitro-active_7p5iOhY {
5144
5152
  ._search_vitro-search_QkJksC_ {
5145
5153
  position: relative;
5146
5154
  align-self: baseline;
5147
- margin-right: 16px;
5148
5155
  margin-left: auto;
5156
+ max-width: 376px;
5157
+ }
5158
+
5159
+ ._search_vitro-search_QkJksC_._search_vitro-active_1HhQOCR {
5160
+ width: 376px;
5149
5161
  }
5150
5162
 
5151
5163
  ._search_vitro-settings-dialog_1_c5bIg {
package/dist/index.js CHANGED
@@ -20804,6 +20804,9 @@ var TreeGridTableViewContextImpl = /*#__PURE__*/function () {
20804
20804
  _proto.selectRange = function selectRange(row1, col1, row2, col2, select) {
20805
20805
  this.grid.SelectRange(row1, col1, row2, col2, select);
20806
20806
  };
20807
+ _proto.showColumns = function showColumns() {
20808
+ this.grid.ShowColumns();
20809
+ };
20807
20810
  _createClass(TreeGridTableViewContextImpl, [{
20808
20811
  key: "columnList",
20809
20812
  get: function get() {
@@ -64882,51 +64885,14 @@ var styles$N = {"vitro-control":"_input_vitro-control__btu7j_","vitro-active":"_
64882
64885
 
64883
64886
  var NEW_LINE$1 = '\n';
64884
64887
  var Input$1 = function Input(props) {
64885
- var _useState = React.useState(false),
64886
- isMobileView = _useState[0],
64887
- setIsMobileView = _useState[1];
64888
- var _useState2 = React.useState(Boolean(props.isSettingsActive)),
64889
- isToggled = _useState2[0],
64890
- setIsToggled = _useState2[1];
64891
- var _useState3 = React.useState(false),
64892
- isActive = _useState3[0],
64893
- setIsActive = _useState3[1];
64894
- var _useState4 = React.useState(CTRL.EMPTY),
64895
- state = _useState4[0],
64896
- setState = _useState4[1];
64888
+ var _useState = React.useState(CTRL.EMPTY),
64889
+ state = _useState[0],
64890
+ setState = _useState[1];
64897
64891
  var localeService = inversifyReact.useInjection(SERVICE.LOCALE);
64898
64892
  var inputRef = React.useRef(null);
64899
- React.useEffect(function () {
64900
- window.addEventListener(exports.EVENT.RESIZE, handleResize);
64901
- handleResize();
64902
- return function () {
64903
- window.removeEventListener(exports.EVENT.RESIZE, handleResize);
64904
- };
64905
- }, []);
64906
- React.useEffect(function () {
64907
- handleResize();
64908
- }, [window.innerWidth]);
64909
- React.useEffect(function () {
64910
- if (isMobileView && props.valueList && props.valueList.length) {
64911
- setIsToggled(true);
64912
- }
64913
- }, [isMobileView, props.valueList]);
64914
- React.useEffect(function () {
64915
- var _props$valueList;
64916
- if (state || props.textValue || (_props$valueList = props.valueList) !== null && _props$valueList !== void 0 && _props$valueList.length) {
64917
- setIsActive(true);
64918
- }
64919
- }, [state, props.textValue, props.valueList]);
64920
- React.useEffect(function () {
64921
- setIsToggled(Boolean(props.isSettingsActive));
64922
- }, [props.isSettingsActive]);
64923
- var handleResize = function handleResize() {
64924
- window.innerWidth < 800 ? setIsMobileView(true) : setIsMobileView(false);
64925
- };
64926
64893
  var onSettingsClick = function onSettingsClick() {
64927
- setIsToggled(!isToggled);
64928
64894
  if (props.onSettingsClick) {
64929
- props.onSettingsClick(!isToggled);
64895
+ props.onSettingsClick();
64930
64896
  }
64931
64897
  };
64932
64898
  var onKeyDown = function onKeyDown(e) {
@@ -64943,7 +64909,6 @@ var Input$1 = function Input(props) {
64943
64909
  }
64944
64910
  };
64945
64911
  var onCancel = function onCancel() {
64946
- setIsActive(false);
64947
64912
  if (inputRef.current) {
64948
64913
  inputRef.current.value = CTRL.EMPTY;
64949
64914
  }
@@ -64955,12 +64920,21 @@ var Input$1 = function Input(props) {
64955
64920
  }
64956
64921
  };
64957
64922
  var onBlur = function onBlur() {
64923
+ if (props.onBlur) {
64924
+ props.onBlur();
64925
+ }
64958
64926
  setState(CTRL.EMPTY);
64959
64927
  onSubmit();
64960
64928
  };
64929
+ var onFocus = function onFocus() {
64930
+ setState(styles$N['vitro-focus']);
64931
+ if (props.onFocus) {
64932
+ props.onFocus();
64933
+ }
64934
+ };
64961
64935
  var getClassName = function getClassName() {
64962
64936
  var classList = [styles$N['vitro-control'], props.className || CTRL.EMPTY, state];
64963
- if (isActive) {
64937
+ if (props.isActive) {
64964
64938
  classList.push(styles$N['vitro-active']);
64965
64939
  }
64966
64940
  return classList.join(CTRL.SPACE);
@@ -64979,34 +64953,53 @@ var Input$1 = function Input(props) {
64979
64953
  var text = [value.name, valueArray.join(CTRL.COMMA + CTRL.SPACE)].join(CTRL.COLON + CTRL.SPACE);
64980
64954
  return text;
64981
64955
  };
64956
+ var onRemoveValue = function onRemoveValue(valueList) {
64957
+ if (props.onRemoveValue) {
64958
+ var newList = props.valueList;
64959
+ var _loop = function _loop() {
64960
+ var value = _step.value;
64961
+ newList = newList.filter(function (x) {
64962
+ return x.internalName !== value.internalName;
64963
+ });
64964
+ };
64965
+ for (var _iterator = _createForOfIteratorHelperLoose(valueList), _step; !(_step = _iterator()).done;) {
64966
+ _loop();
64967
+ }
64968
+ props.onRemoveValue(newList);
64969
+ }
64970
+ };
64982
64971
  var getTextValueList = function getTextValueList(valueList) {
64983
64972
  var list = valueList.map(function (x) {
64984
64973
  return getTextValue(x);
64985
64974
  });
64986
- list.shift();
64987
64975
  return list.join(NEW_LINE$1);
64988
64976
  };
64989
64977
  var getSelectedValueList = function getSelectedValueList(valueList) {
64990
64978
  var firstValue = valueList[0];
64979
+ var list = valueList.slice(1);
64991
64980
  return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
64992
64981
  className: styles$N['vitro-search-value']
64993
- }, getTextValue(firstValue), React__default.createElement("button", {
64994
- onClick: onCancel,
64982
+ }, React__default.createElement("span", null, getTextValue(firstValue)), React__default.createElement("button", {
64983
+ onClick: function onClick() {
64984
+ return onRemoveValue([firstValue]);
64985
+ },
64995
64986
  className: styles$N['vitro-button-cancel']
64996
- })), valueList.length && valueList.length > 1 ? React__default.createElement(Tooltip$1, {
64997
- text: getTextValueList(valueList),
64987
+ })), list.length >= 1 ? React__default.createElement(Tooltip$1, {
64988
+ text: getTextValueList(list),
64998
64989
  placement: PLACEMENT$1.BOTTOM
64999
64990
  }, React__default.createElement("div", {
65000
64991
  className: styles$N['vitro-search-value']
65001
64992
  }, localeService.create(LOCALE$8.INPUT_MORE, {
65002
- count: valueList.length - 1
64993
+ count: list.length
65003
64994
  }), React__default.createElement("button", {
65004
- onClick: onCancel,
64995
+ onClick: function onClick() {
64996
+ return onRemoveValue(list);
64997
+ },
65005
64998
  className: styles$N['vitro-button-cancel']
65006
64999
  }))) : null);
65007
65000
  };
65008
65001
  var onSearchClick = function onSearchClick() {
65009
- if (isMobileView) {
65002
+ if (props.isMobileView) {
65010
65003
  onSettingsClick();
65011
65004
  } else {
65012
65005
  onSubmit();
@@ -65015,23 +65008,21 @@ var Input$1 = function Input(props) {
65015
65008
  return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
65016
65009
  className: getClassName()
65017
65010
  }, React__default.createElement("button", {
65018
- className: styles$N['vitro-button-search'] + (isToggled ? CTRL.SPACE + styles$N['vitro-active'] : CTRL.EMPTY),
65011
+ className: styles$N['vitro-button-search'] + (props.isSettingsActive ? CTRL.SPACE + styles$N['vitro-active'] : CTRL.EMPTY),
65019
65012
  onClick: onSearchClick
65020
- }), !isMobileView && React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
65013
+ }), !props.isMobileView && React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
65021
65014
  className: styles$N['vitro-search-value-list']
65022
- }, props.valueList && props.valueList.length ? getSelectedValueList(props.valueList) : React__default.createElement("input", {
65015
+ }, props.valueList.length ? getSelectedValueList(props.valueList) : React__default.createElement("input", {
65023
65016
  type: 'text',
65024
65017
  ref: inputRef,
65025
65018
  onKeyDown: onKeyDown,
65026
65019
  onChange: onChange,
65027
- onFocus: function onFocus() {
65028
- return setState(styles$N['vitro-focus']);
65029
- },
65020
+ onFocus: onFocus,
65030
65021
  onBlur: onBlur,
65031
- placeholder: !isActive ? props.placeholder : CTRL.EMPTY
65032
- })), isActive && React__default.createElement(React__default.Fragment, null, props.isShowSettings && React__default.createElement("button", {
65022
+ placeholder: !props.isActive ? props.placeholder : CTRL.EMPTY
65023
+ })), props.isActive && React__default.createElement(React__default.Fragment, null, props.isShowSettings && React__default.createElement("button", {
65033
65024
  onClick: onSettingsClick,
65034
- className: styles$N['vitro-button-settings'] + (isToggled ? CTRL.SPACE + styles$N['vitro-active'] : CTRL.EMPTY)
65025
+ className: styles$N['vitro-button-settings'] + (props.isSettingsActive ? CTRL.SPACE + styles$N['vitro-active'] : CTRL.EMPTY)
65035
65026
  }), React__default.createElement("button", {
65036
65027
  onClick: onCancel,
65037
65028
  className: styles$N['vitro-button-cancel']
@@ -65221,7 +65212,7 @@ var FieldIterator = React.forwardRef(function (props, ref) {
65221
65212
  })));
65222
65213
  });
65223
65214
 
65224
- var styles$O = {"vitro-search":"_search_vitro-search_QkJksC_","vitro-settings-dialog":"_search_vitro-settings-dialog_1_c5bIg","vitro-filter":"_search_vitro-filter_2n-Y-mS","vitro-add-field":"_search_vitro-add-field_2hHt1Z2","vitro-add-field-button":"_search_vitro-add-field-button_30hdXYn","vitro-add-field-dialog":"_search_vitro-add-field-dialog_3gC92SF","vitro-footer":"_search_vitro-footer_1-ya4xk","vitro-button-cancel":"_search_vitro-button-cancel_1M8UkMM"};
65215
+ var styles$O = {"vitro-search":"_search_vitro-search_QkJksC_","vitro-active":"_search_vitro-active_1HhQOCR","vitro-settings-dialog":"_search_vitro-settings-dialog_1_c5bIg","vitro-filter":"_search_vitro-filter_2n-Y-mS","vitro-add-field":"_search_vitro-add-field_2hHt1Z2","vitro-add-field-button":"_search_vitro-add-field-button_30hdXYn","vitro-add-field-dialog":"_search_vitro-add-field-dialog_3gC92SF","vitro-footer":"_search_vitro-footer_1-ya4xk","vitro-button-cancel":"_search_vitro-button-cancel_1M8UkMM"};
65225
65216
 
65226
65217
  var Filter = function Filter(props) {
65227
65218
  var _useState = React.useState(null),
@@ -65348,10 +65339,13 @@ var CheckboxList = function CheckboxList(props) {
65348
65339
  return React__default.createElement("div", {
65349
65340
  className: styles$P['vitro-checkbox-list']
65350
65341
  }, React__default.createElement(Input$1, {
65342
+ valueList: [],
65351
65343
  onCancel: onSearchCancel,
65352
65344
  onChange: onInputChange,
65353
65345
  onSubmit: onInputChange,
65354
- className: styles$P['vitro-control']
65346
+ isActive: false,
65347
+ className: styles$P['vitro-control'],
65348
+ isMobileView: false
65355
65349
  }), React__default.createElement(ScrollBar, null, isShowSearchResult ? searchItemList.length ? searchItemList.map(function (item) {
65356
65350
  return getCheckbox(item);
65357
65351
  }) : React__default.createElement("span", null, localeService.create(LOCALE$8.EMPTY_PLACEHOLDER)) : itemList.map(function (item) {
@@ -65363,31 +65357,40 @@ var ESC_KEY_CODE$1 = 27;
65363
65357
  var CONDITION_CONTAINS = 11;
65364
65358
  var Search = function Search(props) {
65365
65359
  var _useState = React.useState(false),
65366
- isShowDialog = _useState[0],
65367
- setIsShowDialog = _useState[1];
65360
+ isMobileView = _useState[0],
65361
+ setIsMobileView = _useState[1];
65368
65362
  var _useState2 = React.useState(false),
65369
- isShowAddFieldDialog = _useState2[0],
65370
- setIsShowAddFieldDialog = _useState2[1];
65371
- var _useState3 = React.useState([]),
65372
- filterFieldList = _useState3[0],
65373
- setFilterFieldList = _useState3[1];
65363
+ isShowDialog = _useState2[0],
65364
+ setIsShowDialog = _useState2[1];
65365
+ var _useState3 = React.useState(false),
65366
+ isShowAddFieldDialog = _useState3[0],
65367
+ setIsShowAddFieldDialog = _useState3[1];
65374
65368
  var _useState4 = React.useState([]),
65375
- searchCriterionList = _useState4[0],
65376
- setSearchCriterionList = _useState4[1];
65369
+ filterFieldList = _useState4[0],
65370
+ setFilterFieldList = _useState4[1];
65377
65371
  var _useState5 = React.useState([]),
65378
- selectedSearchCriterionList = _useState5[0],
65379
- setSelectedSearchCriterionList = _useState5[1];
65372
+ searchCriterionList = _useState5[0],
65373
+ setSearchCriterionList = _useState5[1];
65380
65374
  var _useState6 = React.useState([]),
65381
- checkboxFieldList = _useState6[0],
65382
- setCheckboxFieldList = _useState6[1];
65375
+ selectedSearchCriterionList = _useState6[0],
65376
+ setSelectedSearchCriterionList = _useState6[1];
65377
+ var _useState7 = React.useState([]),
65378
+ checkboxFieldList = _useState7[0],
65379
+ setCheckboxFieldList = _useState7[1];
65380
+ var _useState8 = React.useState(CTRL.EMPTY),
65381
+ state = _useState8[0],
65382
+ setState = _useState8[1];
65383
65383
  var addFieldDialogRef = React.useRef(null);
65384
65384
  var searchRef = React.useRef(null);
65385
65385
  React.useEffect(function () {
65386
65386
  window.addEventListener(exports.EVENT.MOUSEDOWN, onBlurAddFieldDialog);
65387
65387
  window.addEventListener(exports.EVENT.KEYDOWN, onEscClick, false);
65388
+ window.addEventListener(exports.EVENT.RESIZE, handleResize);
65389
+ handleResize();
65388
65390
  return function () {
65389
65391
  window.removeEventListener(exports.EVENT.MOUSEDOWN, onBlurAddFieldDialog);
65390
65392
  window.removeEventListener(exports.EVENT.KEYDOWN, onEscClick, false);
65393
+ window.removeEventListener(exports.EVENT.RESIZE, handleResize);
65391
65394
  };
65392
65395
  });
65393
65396
  React.useEffect(function () {
@@ -65409,34 +65412,50 @@ var Search = function Search(props) {
65409
65412
  }
65410
65413
  setCheckboxFieldList(checkboxList);
65411
65414
  }, [props.visibleFieldList]);
65412
- var onSettingsClick = function onSettingsClick(active) {
65413
- setIsShowDialog(active);
65415
+ React.useEffect(function () {
65416
+ if (filterFieldList.length >= props.maxFieldCount) {
65417
+ setIsShowAddFieldDialog(false);
65418
+ }
65419
+ }, [filterFieldList]);
65420
+ React.useEffect(function () {
65421
+ handleResize();
65422
+ }, [window.innerWidth]);
65423
+ React.useEffect(function () {
65424
+ if (selectedSearchCriterionList.length) {
65425
+ setState(styles$O['vitro-active']);
65426
+ }
65427
+ }, [selectedSearchCriterionList]);
65428
+ var handleResize = function handleResize() {
65429
+ window.innerWidth < 800 ? setIsMobileView(true) : setIsMobileView(false);
65430
+ };
65431
+ var onSettingsClick = function onSettingsClick() {
65432
+ setIsShowDialog(!isShowDialog);
65414
65433
  };
65415
65434
  var onAddField = function onAddField() {
65416
65435
  setIsShowAddFieldDialog(!isShowAddFieldDialog);
65417
65436
  };
65418
65437
  var onFieldListChange = function onFieldListChange(selectedFieldIdList) {
65438
+ var fieldList = [];
65419
65439
  var _loop = function _loop() {
65420
65440
  var id = _step.value;
65421
- var field = filterFieldList.find(function (x) {
65441
+ var field = props.fieldList.find(function (x) {
65422
65442
  return x.id === id;
65423
65443
  });
65424
- if (!field) {
65425
- var newField = props.fieldList.find(function (x) {
65426
- return x.id === id;
65427
- });
65428
- setFilterFieldList(function (prevState) {
65429
- return [].concat(prevState, [newField]);
65430
- });
65444
+ if (field) {
65445
+ fieldList.push(field);
65431
65446
  }
65432
65447
  };
65433
65448
  for (var _iterator = _createForOfIteratorHelperLoose(selectedFieldIdList), _step; !(_step = _iterator()).done;) {
65434
65449
  _loop();
65435
65450
  }
65451
+ setFilterFieldList(fieldList);
65436
65452
  };
65437
65453
  var closeSettings = function closeSettings() {
65438
65454
  setIsShowAddFieldDialog(false);
65439
65455
  setIsShowDialog(false);
65456
+ if (!selectedSearchCriterionList.length) {
65457
+ setState(CTRL.EMPTY);
65458
+ }
65440
65459
  };
65441
65460
  var onDeleteField = function onDeleteField(id) {
65442
65461
  setFilterFieldList(function (prevState) {
@@ -65466,9 +65485,10 @@ var Search = function Search(props) {
65466
65485
  props.onFilterChange(criterionList);
65467
65486
  }
65468
65487
  };
65469
- var onSubmit = function onSubmit() {
65470
- props.onSubmit(searchCriterionList);
65471
- var selectedList = searchCriterionList.map(function (x) {
65488
+ var onSubmit = function onSubmit(value, criterionList) {
65489
+ var list = criterionList ? criterionList : searchCriterionList;
65490
+ props.onSubmit(list);
65491
+ var selectedList = list.map(function (x) {
65472
65492
  var fieldName = props.fieldList.find(function (field) {
65473
65493
  return field.internalName === x.internalName;
65474
65494
  }).name;
@@ -65483,6 +65503,7 @@ var Search = function Search(props) {
65483
65503
  setSearchCriterionList([]);
65484
65504
  setSelectedSearchCriterionList([]);
65485
65505
  closeSettings();
65506
+ setState(CTRL.EMPTY);
65486
65507
  props.onCancel();
65487
65508
  };
65488
65509
  var onInputChange = function onInputChange(value) {
@@ -65504,17 +65525,28 @@ var Search = function Search(props) {
65504
65525
  setIsShowAddFieldDialog(false);
65505
65526
  }
65506
65527
  };
65528
+ var onFocusInput = function onFocusInput() {
65529
+ setState(styles$O['vitro-active']);
65530
+ };
65531
+ var onRemoveValue = function onRemoveValue(valueList) {
65532
+ setSearchCriterionList(valueList);
65533
+ onSubmit(CTRL.EMPTY, valueList);
65534
+ };
65507
65535
  return React__default.createElement("div", {
65508
65536
  ref: searchRef,
65509
- className: styles$O['vitro-search']
65537
+ className: styles$O['vitro-search'] + CTRL.SPACE + state
65510
65538
  }, React__default.createElement(Input$1, {
65511
65539
  valueList: selectedSearchCriterionList,
65512
65540
  onSettingsClick: onSettingsClick,
65513
65541
  onCancel: onCancel,
65514
65542
  onSubmit: onSubmit,
65543
+ onRemoveValue: onRemoveValue,
65515
65544
  onChange: onInputChange,
65516
65545
  placeholder: props.inputPlaceholder,
65517
65546
  isSettingsActive: isShowDialog,
65547
+ onFocus: onFocusInput,
65548
+ isActive: state || isShowDialog ? true : false,
65549
+ isMobileView: isMobileView,
65518
65550
  isShowSettings: true
65519
65551
  }), isShowDialog && React__default.createElement("div", {
65520
65552
  className: styles$O['vitro-settings-dialog']