@nulogy/components 10.2.4 → 11.0.0-beta.1
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/dist/main.js +1296 -197
- package/dist/main.module.js +1295 -196
- package/dist/src/AsyncSelect/AsyncSelectComponents.d.ts +1 -1
- package/dist/src/Select/MenuList.d.ts +3 -0
- package/dist/src/Select/Select.d.ts +20 -53
- package/dist/src/Select/Select.story.d.ts +0 -1
- package/dist/src/Select/Select.story.fixture.d.ts +19 -0
- package/dist/src/Select/SelectComponents.d.ts +9 -7
- package/dist/src/Select/SelectOption.d.ts +7 -6
- package/dist/src/Select/lib.d.ts +20 -0
- package/package.json +5 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ClearIndicatorProps, ContainerProps, ControlProps, DropdownIndicatorProps, InputProps, MenuProps, MultiValueProps } from "react-select";
|
|
3
3
|
import { GroupBase } from "react-select";
|
|
4
|
-
import { OptionProps } from "react-
|
|
4
|
+
import { OptionProps } from "react-select";
|
|
5
5
|
import { ComponentSize } from "../NDSProvider/ComponentSizeContext";
|
|
6
6
|
export declare const SelectControl: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: ControlProps<Option, IsMulti, Group>) => React.JSX.Element;
|
|
7
7
|
export declare const SelectMultiValue: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: MultiValueProps<Option, IsMulti, Group>) => React.JSX.Element;
|
|
@@ -1,64 +1,31 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import Select from "react-select/base";
|
|
3
|
+
import { PropsValue } from "react-select";
|
|
4
|
+
import type { GroupBase, Props } from "react-select";
|
|
4
5
|
import { ComponentSize } from "../NDSProvider/ComponentSizeContext";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
interface NDSOptionType {
|
|
6
|
+
export type NDSOptionValue = string | number | boolean | null;
|
|
7
|
+
export interface NDSOption {
|
|
9
8
|
label: string;
|
|
10
|
-
value:
|
|
9
|
+
value: NDSOptionValue;
|
|
11
10
|
}
|
|
12
|
-
|
|
13
|
-
autocomplete?:
|
|
11
|
+
type CustomProps<IsMulti extends boolean, Group extends GroupBase<NDSOption>> = {
|
|
12
|
+
autocomplete?: Props<NDSOption, IsMulti, Group>["isSearchable"];
|
|
14
13
|
labelText?: string;
|
|
14
|
+
size?: ComponentSize;
|
|
15
15
|
requirementText?: string;
|
|
16
16
|
helpText?: ReactNode;
|
|
17
|
-
disabled?:
|
|
17
|
+
disabled?: Props<NDSOption, IsMulti, Group>["isDisabled"];
|
|
18
18
|
errorMessage?: string;
|
|
19
19
|
errorList?: string[];
|
|
20
|
-
initialIsOpen?:
|
|
21
|
-
multiselect?:
|
|
20
|
+
initialIsOpen?: Props<NDSOption, IsMulti, Group>["defaultMenuIsOpen"];
|
|
21
|
+
multiselect?: Props<NDSOption, IsMulti, Group>["isMulti"];
|
|
22
22
|
maxHeight?: string;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
options:
|
|
26
|
-
onChange?: (newValue:
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
export type NDSSelectProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = Omit<WindowedSelectProps, "isSearchable" | "isDisabled" | "isMulti" | "defaultMenuIsOpen" | "defaultInputValue" | "options" | "onChange"> & CustomProps<Option, IsMulti, Group>;
|
|
30
|
-
export declare const SelectDefaultProps: {
|
|
31
|
-
autocomplete: boolean;
|
|
32
|
-
disabled: any;
|
|
33
|
-
defaultValue: any;
|
|
34
|
-
error: any;
|
|
35
|
-
errorMessage: any;
|
|
36
|
-
errorList: any;
|
|
37
|
-
labelText: any;
|
|
38
|
-
helpText: any;
|
|
39
|
-
noOptionsMessage: any;
|
|
40
|
-
requirementText: any;
|
|
41
|
-
id: any;
|
|
42
|
-
initialIsOpen: any;
|
|
43
|
-
maxHeight: string;
|
|
44
|
-
menuPosition: MenuPosition;
|
|
45
|
-
menuPlacement: MenuPlacement;
|
|
46
|
-
multiselect: boolean;
|
|
47
|
-
name: any;
|
|
48
|
-
onBlur: any;
|
|
49
|
-
onChange: any;
|
|
50
|
-
placeholder: any;
|
|
51
|
-
required: boolean;
|
|
52
|
-
value: any;
|
|
53
|
-
className: any;
|
|
54
|
-
classNamePrefix: string;
|
|
55
|
-
menuIsOpen: any;
|
|
56
|
-
onMenuOpen: any;
|
|
57
|
-
onMenuClose: any;
|
|
58
|
-
onInputChange: any;
|
|
59
|
-
components: any;
|
|
60
|
-
closeMenuOnSelect: boolean;
|
|
23
|
+
defaultValue?: PropsValue<NDSOptionValue>;
|
|
24
|
+
value?: PropsValue<NDSOptionValue>;
|
|
25
|
+
options: NDSOption[];
|
|
26
|
+
onChange?: (newValue: PropsValue<NDSOptionValue>) => void;
|
|
27
|
+
windowThreshold?: number;
|
|
61
28
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
export default
|
|
29
|
+
export type NDSSelectProps<IsMulti extends boolean = boolean, Group extends GroupBase<NDSOption> = GroupBase<NDSOption>> = Omit<Props<NDSOption, IsMulti, Group>, keyof CustomProps<IsMulti, Group> | "isSearchable" | "isDisabled" | "defaultMenuIsOpen" | "isMulti"> & CustomProps<IsMulti, Group>;
|
|
30
|
+
declare const NDSSelect: React.ForwardRefExoticComponent<Omit<Props<NDSOption, boolean, GroupBase<NDSOption>>, "isDisabled" | "isMulti" | "isSearchable" | "defaultMenuIsOpen" | keyof CustomProps<IsMulti, Group>> & CustomProps<boolean, GroupBase<NDSOption>> & React.RefAttributes<Select<NDSOption, boolean, GroupBase<NDSOption>>>>;
|
|
31
|
+
export default NDSSelect;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SelectOptionProps } from "./SelectOption";
|
|
3
|
+
import { NDSOption } from "./Select";
|
|
4
|
+
export declare const errorList: string[];
|
|
5
|
+
export declare const options: NDSOption[];
|
|
6
|
+
export declare const partnerCompanyName: {
|
|
7
|
+
value: string;
|
|
8
|
+
label: string;
|
|
9
|
+
}[];
|
|
10
|
+
export declare const wrappingOptions: {
|
|
11
|
+
value: string;
|
|
12
|
+
label: string;
|
|
13
|
+
}[];
|
|
14
|
+
export declare const PCNList: {
|
|
15
|
+
value: string;
|
|
16
|
+
label: string;
|
|
17
|
+
}[];
|
|
18
|
+
export declare const getPhotos: () => Promise<any>;
|
|
19
|
+
export declare const CustomOption: ({ children, ...props }: SelectOptionProps) => React.JSX.Element;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare
|
|
5
|
-
export declare
|
|
6
|
-
export declare
|
|
7
|
-
export declare
|
|
8
|
-
export declare
|
|
2
|
+
import { ClearIndicatorProps, ContainerProps, ControlProps, DropdownIndicatorProps, InputProps, MenuProps, MultiValueProps, GroupBase } from "react-select";
|
|
3
|
+
import { NDSOption } from "./Select";
|
|
4
|
+
export declare function SelectControl<Option = NDSOption, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>>(props: ControlProps<Option, IsMulti, Group>): React.JSX.Element;
|
|
5
|
+
export declare function SelectMultiValue<Option = NDSOption, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>>(props: MultiValueProps<Option, IsMulti, Group>): React.JSX.Element;
|
|
6
|
+
export declare function SelectClearIndicator<Option = NDSOption, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>>(props: ClearIndicatorProps<Option, IsMulti, Group>): React.JSX.Element;
|
|
7
|
+
export declare function SelectDropdownIndicator<Option = NDSOption, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>>(props: DropdownIndicatorProps<Option, IsMulti, Group>): React.JSX.Element;
|
|
8
|
+
export declare function SelectMenu<Option = NDSOption, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>>(props: MenuProps<Option, IsMulti, Group>): React.JSX.Element;
|
|
9
|
+
export declare function SelectContainer<Option = NDSOption, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>>(props: ContainerProps<Option, IsMulti, Group>): React.JSX.Element;
|
|
10
|
+
export declare function SelectInput<Option = NDSOption, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>>(props: InputProps<Option, IsMulti, Group>): React.JSX.Element;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { OptionProps } from "react-
|
|
2
|
+
import { GroupBase, OptionProps } from "react-select";
|
|
3
3
|
import { ComponentSize } from "../NDSProvider/ComponentSizeContext";
|
|
4
|
-
|
|
4
|
+
import { NDSOption } from "./Select";
|
|
5
|
+
type StyledOptionProps = {
|
|
5
6
|
isSelected: boolean;
|
|
6
7
|
isFocused: boolean;
|
|
7
8
|
size: ComponentSize;
|
|
8
9
|
};
|
|
9
|
-
export declare const StyledOption: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme,
|
|
10
|
-
|
|
10
|
+
export declare const StyledOption: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledOptionProps, never>;
|
|
11
|
+
export type SelectOptionProps<Option = NDSOption, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> = OptionProps<Option, IsMulti, Group> & {
|
|
11
12
|
size?: ComponentSize;
|
|
12
|
-
}
|
|
13
|
-
export declare function SelectOption(props:
|
|
13
|
+
};
|
|
14
|
+
export declare function SelectOption<Option = NDSOption, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>>(props: SelectOptionProps<Option, IsMulti, Group>): React.JSX.Element;
|
|
14
15
|
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Options, PropsValue } from "react-select";
|
|
2
|
+
import { NDSOption, NDSOptionValue } from "./Select";
|
|
3
|
+
export declare function calcOptionsLength(options: any): any;
|
|
4
|
+
export declare function flattenGroupedChildren(children: any): any;
|
|
5
|
+
export declare function isFocused({ props: { isFocused } }: {
|
|
6
|
+
props: {
|
|
7
|
+
isFocused: any;
|
|
8
|
+
};
|
|
9
|
+
}): boolean;
|
|
10
|
+
export declare function getCurrentIndex(children: any): number;
|
|
11
|
+
export declare function createGetHeight({ groupHeadingStyles, noOptionsMsgStyles, optionStyles, loadingMsgStyles }: {
|
|
12
|
+
groupHeadingStyles: any;
|
|
13
|
+
noOptionsMsgStyles: any;
|
|
14
|
+
optionStyles: any;
|
|
15
|
+
loadingMsgStyles: any;
|
|
16
|
+
}): (child: any) => any;
|
|
17
|
+
export declare function checkOptionsAreValid(options: Options<NDSOption>): void;
|
|
18
|
+
export declare function getOption(options: Options<NDSOption>, value: PropsValue<NDSOptionValue>): any;
|
|
19
|
+
export declare function getReactSelectValue(options: Options<NDSOption>, input: PropsValue<NDSOptionValue>): any;
|
|
20
|
+
export declare function extractValue(options: Options<NDSOption> | NDSOption, isMulti: boolean): NDSOptionValue[] | NDSOptionValue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nulogy/components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0-beta.1",
|
|
4
4
|
"description": "Component library for the Nulogy Design System - http://nulogy.design",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -142,6 +142,8 @@
|
|
|
142
142
|
"@nulogy/tokens": "^5.4.0",
|
|
143
143
|
"@styled-system/prop-types": "^5.1.4",
|
|
144
144
|
"@styled-system/theme-get": "^5.1.2",
|
|
145
|
+
"@types/react-window": "^1.8.8",
|
|
146
|
+
"@types/styled-system": "5.1.22",
|
|
145
147
|
"body-scroll-lock": "^3.1.5",
|
|
146
148
|
"core-js": "3",
|
|
147
149
|
"create-react-context": "^0.3.0",
|
|
@@ -160,11 +162,9 @@
|
|
|
160
162
|
"react-popper": "1.3.11",
|
|
161
163
|
"react-popper-2": "npm:react-popper@2.2.4",
|
|
162
164
|
"react-resize-detector": "^9.1.0",
|
|
163
|
-
"react-windowed-select": "^5.2.0",
|
|
164
|
-
"smoothscroll-polyfill": "^0.4.4",
|
|
165
165
|
"react-select": "^5.8.0",
|
|
166
|
-
"
|
|
167
|
-
"
|
|
166
|
+
"react-window": "^1.8.10",
|
|
167
|
+
"styled-system": "^5.1.4"
|
|
168
168
|
},
|
|
169
169
|
"husky": {
|
|
170
170
|
"hooks": {
|