@homecode/ui 4.18.63 → 4.18.64

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.
@@ -6,12 +6,14 @@ import ICONS from './icons/index.js';
6
6
 
7
7
  const icons = ICONS;
8
8
  function Icon(props) {
9
- const { className, type, size, ...rest } = props;
9
+ const { className, icon: CustomIcon, type, size, ...rest } = props;
10
10
  const iconProps = {
11
11
  className: cn(S.root, S[`size-${size}`], className),
12
12
  role: 'img',
13
13
  ...rest,
14
14
  };
15
+ if (CustomIcon)
16
+ return jsx(CustomIcon, { ...iconProps });
15
17
  const localIcon = ICONS[type];
16
18
  if (!localIcon) {
17
19
  console.warn(`Icon: type="${type}" is unknown`);
@@ -14,12 +14,12 @@ import { generateUID } from '../../tools/uid.js';
14
14
  import S from './Input.styl.js';
15
15
  import '../ButtonGroup/ButtonGroup.styl.js';
16
16
  import '../Calendar/Calendar.styl.js';
17
- import 'compareq';
18
- import 'lodash.pick';
17
+ import '../../tools/dom.js';
19
18
  import 'timen';
20
19
  import '../Portal/Portal.js';
21
20
  import '../Paranja/Paranja.styl.js';
22
- import '../../tools/dom.js';
21
+ import 'compareq';
22
+ import 'lodash.pick';
23
23
  import debounce from '../../tools/debounce.js';
24
24
  import '../Popup/Popup.styl.js';
25
25
  import '../../tools/queryParams.js';
@@ -21,9 +21,9 @@ import 'lodash.omit';
21
21
  import '../RequiredStar/RequiredStar.styl.js';
22
22
  import 'nanoid';
23
23
  import '../Input/Input.styl.js';
24
+ import '../../tools/dom.js';
24
25
  import '../Portal/Portal.js';
25
26
  import '../Paranja/Paranja.styl.js';
26
- import '../../tools/dom.js';
27
27
  import '../Popup/Popup.styl.js';
28
28
  import '../../tools/queryParams.js';
29
29
  import '../Select/Select.styl.js';
@@ -1,24 +1,24 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import * as Select_helpers from './Select.helpers.js';
3
+ import { mapById, buildOptionsTree, isMultiple, renderLabel } from './Select.helpers.js';
2
4
  import { Component, createRef } from 'react';
3
- import cn from 'classnames';
4
- import compare from 'compareq';
5
- import pick from 'lodash.pick';
6
- import omit from 'lodash.omit';
7
- import { createStore } from 'justorm/react';
8
- import Time from 'timen';
9
- import { Icon } from '../Icon/Icon.js';
5
+ import { INTERACTION_MODE, getInteractionMode } from '../../tools/dom.js';
6
+ import { AssistiveText } from '../AssistiveText/AssistiveText.js';
10
7
  import { Button } from '../Button/Button.js';
8
+ import { Icon } from '../Icon/Icon.js';
11
9
  import { Input } from '../Input/Input.js';
12
10
  import { Label } from '../Label/Label.js';
13
11
  import { Popup } from '../Popup/Popup.js';
14
- import { Scroll } from '../Scroll/Scroll.js';
15
12
  import { RequiredStar } from '../RequiredStar/RequiredStar.js';
16
- import { AssistiveText } from '../AssistiveText/AssistiveText.js';
17
- import { INTERACTION_MODE, getInteractionMode } from '../../tools/dom.js';
18
- import throttle from '../../tools/throttle.js';
19
- import * as Select_helpers from './Select.helpers.js';
20
- import { mapById, buildOptionsTree, isMultiple, renderLabel } from './Select.helpers.js';
21
13
  import S from './Select.styl.js';
14
+ import { Scroll } from '../Scroll/Scroll.js';
15
+ import Time from 'timen';
16
+ import cn from 'classnames';
17
+ import compare from 'compareq';
18
+ import { createStore } from 'justorm/react';
19
+ import omit from 'lodash.omit';
20
+ import pick from 'lodash.pick';
21
+ import throttle from '../../tools/throttle.js';
22
22
 
23
23
  const SelectHelpers = Select_helpers;
24
24
  class Select extends Component {
@@ -378,8 +378,8 @@ class Select extends Component {
378
378
  getInputVal() {
379
379
  const { isFocused, selected } = this.store;
380
380
  const searchValue = this.props.searchValue ?? this.store.searchVal;
381
- if (isFocused && searchValue)
382
- return searchValue;
381
+ if (isFocused)
382
+ return searchValue ?? '';
383
383
  const selectedPlain = Object.entries(selected).reduce((acc, entry) => {
384
384
  const parentId = this.coerceType(entry[0]);
385
385
  const val = entry[1];
@@ -3,6 +3,7 @@ import CUSTOM_ICONS from './icons';
3
3
  export type IconSize = 'xs' | Size;
4
4
  export type IconType = keyof typeof CUSTOM_ICONS;
5
5
  export type Props = ComponentType & {
6
- type: IconType;
6
+ icon?: React.ComponentType<React.SVGProps<SVGSVGElement>>;
7
+ type?: IconType;
7
8
  size: IconSize;
8
9
  };
@@ -1,7 +1,7 @@
1
+ import * as H from './Select.helpers';
2
+ import * as T from './Select.types';
1
3
  import { Component, ReactNode } from 'react';
2
4
  import { Input } from 'uilib/components/Input/Input';
3
- import * as T from './Select.types';
4
- import * as H from './Select.helpers';
5
5
  export declare const SelectHelpers: typeof H;
6
6
  export declare class Select extends Component<T.Props, T.State> {
7
7
  store: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homecode/ui",
3
- "version": "4.18.63",
3
+ "version": "4.18.64",
4
4
  "description": "React UI components library",
5
5
  "scripts": {
6
6
  "test": "jest",