@toptal/picasso 25.3.2 → 25.3.3-alpha-fix-select-ref.5
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/Select/Select.d.ts +4 -21
- package/Select/Select.js +5 -4
- package/Select/Select.js.map +1 -1
- package/package.json +5 -4
- package/utils/forward-ref.d.ts +1 -1
- package/utils/forward-ref.js +1 -1
package/Select/Select.d.ts
CHANGED
|
@@ -1,23 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { SelectProps, ValueType } from '../SelectBase';
|
|
2
|
-
export declare const Select: {
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
disabled: boolean;
|
|
6
|
-
getDisplayValue: (option: import("../SelectBase").Option<string | number> | null) => string;
|
|
7
|
-
iconPosition: string;
|
|
8
|
-
loading: boolean;
|
|
9
|
-
noOptionsText: string;
|
|
10
|
-
onChange: () => void;
|
|
11
|
-
onBlur: () => void;
|
|
12
|
-
renderOption: (option: import("../SelectBase").Option<string | number>) => string;
|
|
13
|
-
size: string;
|
|
14
|
-
width: string;
|
|
15
|
-
searchThreshold: number;
|
|
16
|
-
limit: number;
|
|
17
|
-
enableAutofill: boolean;
|
|
18
|
-
searchPlaceholder: string;
|
|
19
|
-
native: boolean;
|
|
20
|
-
status: string;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
3
|
+
export declare const Select: import("../utils/forward-ref").Component<(<T extends ValueType, M extends boolean = false>(props: SelectProps<T, M, M extends true ? T[] : T> & {
|
|
4
|
+
ref?: React.Ref<HTMLInputElement> | undefined;
|
|
5
|
+
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null), unknown>;
|
|
23
6
|
export default Select;
|
package/Select/Select.js
CHANGED
|
@@ -16,6 +16,7 @@ import disableUnsupportedProps from '../utils/disable-unsupported-props';
|
|
|
16
16
|
import noop from '../utils/noop';
|
|
17
17
|
import { usePropDeprecationWarning } from '../utils/use-deprecation-warnings';
|
|
18
18
|
import { DEFAULT_LIMIT, DEFAULT_SEARCH_THRESHOLD, getOptionText, renderOption } from '../SelectBase';
|
|
19
|
+
import { documentable, forwardRef } from '../utils';
|
|
19
20
|
const purifyProps = (props) => {
|
|
20
21
|
const sizeOptions = {
|
|
21
22
|
featureProps: {
|
|
@@ -28,7 +29,7 @@ const purifyProps = (props) => {
|
|
|
28
29
|
};
|
|
29
30
|
return disableUnsupportedProps('Select', props, sizeOptions);
|
|
30
31
|
};
|
|
31
|
-
export const Select = (_a) => {
|
|
32
|
+
export const Select = documentable(forwardRef((_a, ref) => {
|
|
32
33
|
var { native } = _a, props = __rest(_a, ["native"]);
|
|
33
34
|
usePropDeprecationWarning({
|
|
34
35
|
props,
|
|
@@ -38,10 +39,10 @@ export const Select = (_a) => {
|
|
|
38
39
|
});
|
|
39
40
|
return native ? (
|
|
40
41
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
41
|
-
React.createElement(NativeSelect, Object.assign({}, purifyProps(props)))) : (
|
|
42
|
+
React.createElement(NativeSelect, Object.assign({}, purifyProps(props), { ref: ref }))) : (
|
|
42
43
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
43
|
-
React.createElement(NonNativeSelect, Object.assign({}, purifyProps(props))));
|
|
44
|
-
};
|
|
44
|
+
React.createElement(NonNativeSelect, Object.assign({}, purifyProps(props), { ref: ref })));
|
|
45
|
+
}));
|
|
45
46
|
Select.defaultProps = {
|
|
46
47
|
disabled: false,
|
|
47
48
|
getDisplayValue: getOptionText,
|
package/Select/Select.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../src/Select/Select.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,YAAY,MAAM,iBAAiB,CAAA;AAC1C,OAAO,eAAe,MAAM,oBAAoB,CAAA;AAChD,OAAO,uBAEN,MAAM,oCAAoC,CAAA;AAC3C,OA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,CAAC,CAAC,CAAC;IACd,wDAAwD;IACxD,oBAAC,YAAY,oBAAK,WAAW,CAAC,KAAK,CAAC,IAAE,GAAG,EAAE,GAAG,IAAI,CACnD,CAAC,CAAC,CAAC;IACF,wDAAwD;IACxD,oBAAC,eAAe,oBAAK,WAAW,CAAC,KAAK,CAAC,IAAE,GAAG,EAAE,GAAG,IAAI,CACtD,CAAA;AACH,CAAC,CACF,CACF,CAAA;AAED,MAAM,CAAC,YAAY,GAAG;IACpB,QAAQ,EAAE,KAAK;IACf,eAAe,EAAE,aAAa;IAC9B,YAAY,EAAE,OAAO;IACrB,OAAO,EAAE,KAAK;IACd,aAAa,EAAE,kBAAkB;IACjC,QAAQ,EAAE,IAAI;IACd,MAAM,EAAE,IAAI;IACZ,YAAY,EAAE,YAAY;IAC1B,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,MAAM;IACb,eAAe,EAAE,wBAAwB;IACzC,KAAK,EAAE,aAAa;IACpB,cAAc,EAAE,KAAK;IACrB,iBAAiB,EAAE,QAAQ;IAC3B,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,SAAS;CAClB,CAAA;AAED,eAAe,MAAM,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toptal/picasso",
|
|
3
|
-
"version": "25.3.
|
|
3
|
+
"version": "25.3.3-alpha-fix-select-ref.5+0a3635e1",
|
|
4
4
|
"description": "Toptal UI components library",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"typescript": "4.6.x"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@toptal/picasso-provider": "
|
|
35
|
-
"@toptal/picasso-shared": "
|
|
34
|
+
"@toptal/picasso-provider": "1.1.5-alpha-fix-select-ref.5+0a3635e1",
|
|
35
|
+
"@toptal/picasso-shared": "8.2.3-alpha-fix-select-ref.5+0a3635e1",
|
|
36
36
|
"ap-style-title-case": "^1.1.2",
|
|
37
37
|
"classnames": "^2.3.1",
|
|
38
38
|
"d3": "^6.7.0",
|
|
@@ -80,5 +80,6 @@
|
|
|
80
80
|
"sideEffects": [
|
|
81
81
|
"**/styles.ts",
|
|
82
82
|
"**/styles.js"
|
|
83
|
-
]
|
|
83
|
+
],
|
|
84
|
+
"gitHead": "0a3635e12528f3394941e1f19e2a39a8903b9e3d"
|
|
84
85
|
}
|
package/utils/forward-ref.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare type Component<T, P> = T & {
|
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
7
|
* Wraps the exotic generic functional component type returned by the `forwardRef`.
|
|
8
|
-
* This function adopts the type of the exotic
|
|
8
|
+
* This function adopts the type of the exotic component to take `defaultProps` and
|
|
9
9
|
* `displayName`.
|
|
10
10
|
*
|
|
11
11
|
* @see forwardRef
|
package/utils/forward-ref.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* Wraps the exotic generic functional component type returned by the `forwardRef`.
|
|
4
|
-
* This function adopts the type of the exotic
|
|
4
|
+
* This function adopts the type of the exotic component to take `defaultProps` and
|
|
5
5
|
* `displayName`.
|
|
6
6
|
*
|
|
7
7
|
* @see forwardRef
|