@homecode/ui 4.28.2 → 4.28.4

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.
@@ -492,9 +492,9 @@ class Select extends Component {
492
492
  return (jsxs("div", { children: [jsxs(Button, { className: classes, variant: "default", ...props, style: { clipPath: labelClipPath }, title: title?.join?.(', '), children: [jsx("div", { className: cn(S.triggerButtonLabel, hasSelected && S.hasSelected), children: displayLabel }), triggerArrow] }), jsx(Label, { size: size, isOnTop: hasSelected, isError: isError, onClipPathChange: this.onLabelClipPathChange, children: this.getFieldLabel(label) })] }));
493
493
  }
494
494
  renderTriggerArrow() {
495
- const { size, inputProps } = this.props;
495
+ const { size, inputProps, disableTriggerArrow } = this.props;
496
496
  const { isOpen, searchVal } = this.store;
497
- if (inputProps?.hasClear && searchVal)
497
+ if (disableTriggerArrow || (inputProps?.hasClear && searchVal))
498
498
  return null;
499
499
  return (jsx(Icon, { type: "chevronDown", className: cn(S.triggerArrow, isOpen && S.isOpen), size: size }));
500
500
  }
@@ -17,7 +17,7 @@ import useEvent from '../../hooks/useEvent.js';
17
17
  import S from './Select.styl.js';
18
18
 
19
19
  function Select2(props) {
20
- const { className, value, onChange, onSearchChange, inputProps, popupProps, size = 'm', round, optionClassName, additionalOptions = [], options, variant, label, error, blur, disabled, trigger, required, hideRequiredStar, isSearchable, presets = [], selectAllButton, clearButton, showSelectedCount, disableLabel, } = props;
20
+ const { className, value, onChange, onSearchChange, disableTriggerArrow, inputProps, popupProps, size = 'm', round, optionClassName, additionalOptions = [], options, variant, label, error, blur, disabled, trigger, required, hideRequiredStar, isSearchable, presets = [], selectAllButton, clearButton, showSelectedCount, disableLabel, } = props;
21
21
  const isMultiple$1 = isMultiple(value);
22
22
  const closeOnSelect = props.closeOnSelect ?? !isMultiple$1;
23
23
  const contentRef = useRef(null);
@@ -174,7 +174,7 @@ function Select2(props) {
174
174
  }, [isMultiple$1, value, ids]);
175
175
  // console.log('selectedLabel::', selectedLabel);
176
176
  const triggerArrow = useMemo(() => {
177
- if (inputProps?.hasClear && searchVal)
177
+ if (disableTriggerArrow || (inputProps?.hasClear && searchVal))
178
178
  return null;
179
179
  return (jsx(Icon, { type: "chevronDown", className: cn(S.triggerArrow, isOpen && S.isOpen), size: size }));
180
180
  }, [isOpen, searchVal]);
@@ -56,6 +56,7 @@ export type Props = FormControl<Value> & InheritedInputProps & {
56
56
  round?: boolean;
57
57
  trigger?: ReactNode;
58
58
  triggerProps?: any;
59
+ disableTriggerArrow?: boolean;
59
60
  popupProps?: SelectPopupProps;
60
61
  hideRequiredStar?: boolean;
61
62
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homecode/ui",
3
- "version": "4.28.2",
3
+ "version": "4.28.4",
4
4
  "description": "React UI components library",
5
5
  "scripts": {
6
6
  "tests": "jest",