@xqmsg/ui-core 0.24.9 → 0.24.10

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.24.9",
2
+ "version": "0.24.10",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -16,7 +16,7 @@ export const Workspace: React.FC<WorkspaceProps> = ({
16
16
  filled = false,
17
17
  }) => {
18
18
  if (filled) {
19
- return <WorkspaceIcon boxSize={boxSize} />;
19
+ return <WorkspaceIcon width={boxSize} height={boxSize} />;
20
20
  }
21
21
  return <Image src={path} boxSize={boxSize} />;
22
22
  };
@@ -221,6 +221,7 @@ const Template: Story<InputProps<StoryFormSchema>> = args => {
221
221
  setValue={form.setValue}
222
222
  name="prop4"
223
223
  defaultValue={'value1'}
224
+ searchable={false}
224
225
  tooltipText={
225
226
  <Box>
226
227
  <Text fontSize={13}>Explanation!</Text>
@@ -357,6 +357,7 @@ const StackedMultiSelect = React.forwardRef<
357
357
  loading={loadingOptions}
358
358
  >
359
359
  <Input
360
+ autoFocus
360
361
  value={searchValue}
361
362
  onChange={handleInput}
362
363
  disabled={loadingOptions}
@@ -19,6 +19,7 @@ export interface StackedSelectProps extends StackedInputProps {
19
19
  control: Control<FieldValues, any>;
20
20
  handleOnChange: (value?: string) => void;
21
21
  loadingOptions?: boolean;
22
+ searchable?: boolean;
22
23
  }
23
24
 
24
25
  /**
@@ -36,6 +37,7 @@ const StackedSelect = React.forwardRef<HTMLInputElement, StackedSelectProps>(
36
37
  value,
37
38
  fullOptions,
38
39
  loadingOptions,
40
+ searchable = true,
39
41
  ...props
40
42
  },
41
43
  _ref
@@ -195,13 +197,16 @@ const StackedSelect = React.forwardRef<HTMLInputElement, StackedSelectProps>(
195
197
  }, [options, searchValue]);
196
198
 
197
199
  const handleInput = (e: React.ChangeEvent<HTMLInputElement>) => {
198
- const initialOptionIndex =
199
- filteredOptions.length && filteredOptions[0]?.value === 'section_header'
200
- ? 1
201
- : 0;
202
- setOptionIndex(initialOptionIndex);
203
- const { value } = e.target;
204
- setSearchValue(value);
200
+ if (searchable) {
201
+ const initialOptionIndex =
202
+ filteredOptions.length &&
203
+ filteredOptions[0]?.value === 'section_header'
204
+ ? 1
205
+ : 0;
206
+ setOptionIndex(initialOptionIndex);
207
+ const { value } = e.target;
208
+ setSearchValue(value);
209
+ }
205
210
  };
206
211
 
207
212
  return (
@@ -213,7 +218,6 @@ const StackedSelect = React.forwardRef<HTMLInputElement, StackedSelectProps>(
213
218
  ref={_ref}
214
219
  onClick={() => setIsFocussed(!isFocussed)}
215
220
  cursor={isFocussed ? 'default' : 'pointer'}
216
- color={loadingOptions ? 'transparent' : 'inital'}
217
221
  fontSize="13px"
218
222
  value={isFocussed ? searchValue : selectedOption}
219
223
  autoComplete="off"
@@ -52,6 +52,7 @@ export interface InputProps<T extends FieldValues = FieldValues>
52
52
  separators?: string[];
53
53
  loadingOptions?: boolean;
54
54
  truncatePillLength?: number;
55
+ searchable?: boolean;
55
56
  }
56
57
 
57
58
  /**
@@ -86,6 +87,7 @@ export function Input<T extends FieldValues>({
86
87
  separators,
87
88
  loadingOptions = false,
88
89
  truncatePillLength,
90
+ searchable,
89
91
  }: InputProps<T>) {
90
92
  function selectedInputField<T extends Element = Element>(
91
93
  onChange: ((e: ChangeEvent<T>) => void) | ((v?: string) => void),
@@ -152,6 +154,7 @@ export function Input<T extends FieldValues>({
152
154
  placeholder={placeholder}
153
155
  fullOptions={fullOptions}
154
156
  loadingOptions={loadingOptions}
157
+ searchable={searchable}
155
158
  />
156
159
  );
157
160
  case 'textarea':