@touchtech/baselayer-ui 8.1.8 → 8.1.9

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.
@@ -3,5 +3,6 @@ import { GroupOptionType, OptionType } from "../../../types";
3
3
  type Props = {
4
4
  options: Array<OptionType | GroupOptionType>;
5
5
  };
6
+ export declare const isOption: (option: OptionType | GroupOptionType) => option is OptionType;
6
7
  declare function OptionList({ options }: Props): JSX.Element;
7
8
  export default OptionList;
@@ -1 +1 @@
1
- export { default as OptionList } from "./OptionList";
1
+ export { default as OptionList, isOption } from "./OptionList";
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { GroupOptionType, OptionType, Size } from "../../types";
3
3
  type SelectProps = {
4
+ defaultValue?: string | string[];
4
5
  placeholder: string;
5
6
  className?: string;
6
7
  multiple?: boolean;
@@ -8,10 +9,9 @@ type SelectProps = {
8
9
  size?: Size;
9
10
  selectAll?: boolean;
10
11
  showSelectedAsTags?: boolean;
11
- groupedOptionCollapsed?: boolean;
12
12
  options: Array<OptionType | GroupOptionType>;
13
13
  width: string;
14
14
  onChange?: (values: Array<string>) => void;
15
15
  };
16
- declare function Select({ className, disabled, groupedOptionCollapsed, multiple, options, placeholder, selectAll, size, showSelectedAsTags, width, onChange }: SelectProps): JSX.Element;
16
+ declare function Select({ className, defaultValue, disabled, multiple, options, placeholder, selectAll, size, showSelectedAsTags, width, onChange }: SelectProps): JSX.Element;
17
17
  export default Select;
@@ -1,17 +1,22 @@
1
1
  import React from "react";
2
- import { OptionType } from "../../types";
2
+ import { GroupOptionType, OptionType } from "../../types";
3
3
  type Props = {
4
4
  children: React.ReactNode;
5
+ defaultValue: string | string[];
5
6
  multiple?: boolean;
7
+ selectAll?: boolean;
8
+ options: Array<OptionType | GroupOptionType>;
6
9
  onChange?: (values: Array<string>) => void;
7
10
  };
8
11
  type SelectContextState = {
9
12
  multiple?: boolean;
13
+ selectAll?: boolean;
10
14
  selectedValues: Array<OptionType>;
11
- updateSelectedValues: (option: OptionType) => void;
15
+ updateSelectedValue: (option: OptionType) => void;
12
16
  searchKeyword: string;
13
17
  setSearchKeyword: (value: string) => void;
18
+ setSelectedValues: (values: OptionType[]) => void;
14
19
  };
15
20
  declare const SelectContext: React.Context<SelectContextState>;
16
- declare const SelectContextProvider: ({ children, multiple, onChange, }: Props) => JSX.Element;
21
+ declare const SelectContextProvider: ({ children, defaultValue, multiple, selectAll, options, onChange, }: Props) => JSX.Element;
17
22
  export { SelectContext, SelectContextProvider };