@homecode/ui 4.18.59 → 4.18.61

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.
@@ -139,9 +139,6 @@ class Select extends Component {
139
139
  // @ts-ignore
140
140
  return { [value]: true };
141
141
  }
142
- isDisabled() {
143
- return this.props.disabled || this.items.length === 0;
144
- }
145
142
  isClickedInside = elem => elem.closest(`.${S.root}`) || elem.closest(`.${S.options}`);
146
143
  onFocusedElemRef = elem => {
147
144
  this.focusedElem = elem;
@@ -207,6 +204,7 @@ class Select extends Component {
207
204
  };
208
205
  onSearchChange = (e, value) => {
209
206
  this.setSearchVal(value);
207
+ this.props.onSeachChange?.(value);
210
208
  };
211
209
  onExpandClick(e, id) {
212
210
  const { expanded } = this.store;
@@ -455,10 +453,10 @@ class Select extends Component {
455
453
  const value = this.getInputVal();
456
454
  const props = {
457
455
  ...this.getTriggerProps(),
458
- ...inputProps,
459
- error: this.isErrorVisible(),
460
456
  // addonLeft: this.renderSelectedItems(),
461
457
  addonRight: this.renderTriggerArrow(),
458
+ ...inputProps,
459
+ error: this.isErrorVisible(),
462
460
  value,
463
461
  onChange: this.onSearchChange,
464
462
  ref: this.triggerInputRef,
@@ -580,10 +578,10 @@ class Select extends Component {
580
578
  return (jsxs("div", { ref: this.contentRef, children: [this.renderPresets(), jsx(Scroll, { y: true, offset: { y: { before: 10, after: 10 } }, className: classes, onInnerRef: this.onScrollInnerRef, children: optionsList }, "items-scroll")] }));
581
579
  }
582
580
  render() {
583
- const { className, popupProps, size, error, blur } = this.props;
581
+ const { className, popupProps, size, error, blur, disabled } = this.props;
584
582
  const { isOpen, isFocused } = this.store;
585
583
  const classes = cn(S.root, className, S[`size-${size}`]);
586
- return (jsxs(Fragment, { children: [jsx(Popup, { className: classes, direction: "bottom", size: size, focusControl: true, hoverControl: isFocused, blur: blur, isOpen: isOpen, ...popupProps, onOpen: this.onPopupOpen, onClose: this.onPopupClose, disabled: this.isDisabled(), trigger: this.renderTrigger(), triggerProps: {
584
+ return (jsxs(Fragment, { children: [jsx(Popup, { className: classes, direction: "bottom", size: size, focusControl: true, hoverControl: isFocused, blur: blur, isOpen: isOpen, disabled: disabled, ...popupProps, onOpen: this.onPopupOpen, onClose: this.onPopupClose, trigger: this.renderTrigger(), triggerProps: {
587
585
  onFocus: this.onFocus,
588
586
  onBlur: this.onBlur,
589
587
  }, content: this.renderOptionsList() }), this.isErrorVisible() && (jsx(AssistiveText, { variant: "danger", size: size, children: error }))] }));
@@ -35,7 +35,6 @@ export declare class Select extends Component<T.Props, T.State> {
35
35
  coerceType(id: any): any;
36
36
  getDefaultExpanded(value: any): {};
37
37
  getDefaultSelected(): any;
38
- isDisabled(): boolean;
39
38
  isClickedInside: (elem: any) => any;
40
39
  onFocusedElemRef: (elem: any) => void;
41
40
  onDocumentClick: (e: any) => void;
@@ -46,6 +46,7 @@ export type Props = FormControl<Value> & InheritedInputProps & {
46
46
  value?: Value;
47
47
  expandSelected?: boolean;
48
48
  onChange: (value: Value) => void;
49
+ onSeachChange?: (value: string) => void;
49
50
  onOpen?: () => void;
50
51
  onClose?: () => void;
51
52
  isSearchable?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homecode/ui",
3
- "version": "4.18.59",
3
+ "version": "4.18.61",
4
4
  "description": "React UI components library",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -0,0 +1,16 @@
1
+ ! Corepack is about to download https://registry.yarnpkg.com/yarn/-/yarn-1.22.22.tgz
2
+ yarn run v1.22.22
3
+ $ jest
4
+ ts-jest[ts-jest-transformer] (WARN) Define `ts-jest` config under `globals` is deprecated. Please do
5
+ transform: {
6
+ <transform_regex>: ['ts-jest', { /* ts-jest config goes here in Jest */ }],
7
+ },
8
+ See more at https://kulshekhar.github.io/ts-jest/docs/getting-started/presets#advanced
9
+ ts-jest[ts-jest-transformer] (WARN) Define `ts-jest` config under `globals` is deprecated. Please do
10
+ transform: {
11
+ <transform_regex>: ['ts-jest', { /* ts-jest config goes here in Jest */ }],
12
+ },
13
+ See more at https://kulshekhar.github.io/ts-jest/docs/getting-started/presets#advanced
14
+ Terminated
15
+ error Command failed with exit code 143.
16
+ info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.