@equinor/fusion-react-context-selector 0.1.7 → 0.2.0
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/README.md +3 -9
- package/dist/ContextProvider.d.ts +4 -0
- package/dist/ContextProvider.d.ts.map +1 -0
- package/dist/ContextProvider.js +9 -0
- package/dist/ContextProvider.js.map +1 -0
- package/dist/ContextSelector.d.ts +1 -9
- package/dist/ContextSelector.d.ts.map +1 -1
- package/dist/ContextSelector.js +2 -3
- package/dist/ContextSelector.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +14 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -5,18 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
[Storybook](https://equinor.github.io/fusion-react-components/?path=/docs/data-contextselector)
|
|
7
7
|
|
|
8
|
-
[
|
|
8
|
+
Extending [fusion-react-searchable-dropdown](https://equinor.github.io/fusion-react-components/?path=/docs/data-searchable-dropdown)
|
|
9
|
+
|
|
10
|
+
Built on Web-Component [Fusion Web Component](https://github.com/equinor/fusion-web-components/tree/main/packages/searchable-dropdown)
|
|
9
11
|
|
|
10
12
|
### Installation
|
|
11
13
|
|
|
12
14
|
```sh
|
|
13
15
|
npm install @equinor/fusion-react-context-selector
|
|
14
16
|
```
|
|
15
|
-
|
|
16
|
-
### Methods
|
|
17
|
-
|
|
18
|
-
| Name | Description
|
|
19
|
-
| -------- | -------------
|
|
20
|
-
| `onSelect() => ContextResult` | Returns `ContextResult` of selected items in event details.
|
|
21
|
-
|
|
22
|
-
<!--prettier-ignore-end-->
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextProvider.d.ts","sourceRoot":"","sources":["../src/ContextProvider.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C,eAAO,MAAM,eAAe,2BAA4B,MAAM,iBAAiB,CAAC,oBAAoB,CAAC,KAAG,WAGvG,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/* eslint-disable react/no-multi-comp */
|
|
3
|
+
import { DropdownProvider, useDropdownProviderRef } from '@equinor/fusion-react-searchable-dropdown';
|
|
4
|
+
export const ContextProvider = ({ children, ...props }) => {
|
|
5
|
+
const providerRef = useDropdownProviderRef(props.resolver);
|
|
6
|
+
return _jsx(DropdownProvider, { ref: providerRef, children: children });
|
|
7
|
+
};
|
|
8
|
+
export default ContextProvider;
|
|
9
|
+
//# sourceMappingURL=ContextProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextProvider.js","sourceRoot":"","sources":["../src/ContextProvider.tsx"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AAIrG,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAiD,EAAe,EAAE;IACpH,MAAM,WAAW,GAAG,sBAAsB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC3D,OAAO,KAAC,gBAAgB,IAAC,GAAG,EAAE,WAAW,YAAG,QAAQ,GAAoB,CAAC;AAC3E,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ElementResolver = {
|
|
3
|
-
resolver?: SearchableDropdownResolver;
|
|
4
|
-
};
|
|
5
|
-
export type ContextResult = SearchableDropdownResult;
|
|
6
|
-
export type ContextResultItem = SearchableDropdownResultItem;
|
|
7
|
-
export type ContextResolver = SearchableDropdownResolver;
|
|
8
|
-
export type ContextSelectEvent = SearchableDropdownSelectEvent;
|
|
9
|
-
export type ContextSelectorProps = DropdownProps & ElementResolver;
|
|
1
|
+
import { ContextSelectorProps } from './types';
|
|
10
2
|
export declare const ContextSelector: ({ children, ...props }: React.PropsWithChildren<ContextSelectorProps>) => JSX.Element;
|
|
11
3
|
export default ContextSelector;
|
|
12
4
|
//# sourceMappingURL=ContextSelector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextSelector.d.ts","sourceRoot":"","sources":["../src/ContextSelector.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContextSelector.d.ts","sourceRoot":"","sources":["../src/ContextSelector.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C,eAAO,MAAM,eAAe,2BAA4B,MAAM,iBAAiB,CAAC,oBAAoB,CAAC,KAAG,WAEvG,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
package/dist/ContextSelector.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
/* eslint-disable react/no-multi-comp */
|
|
3
|
-
import {
|
|
3
|
+
import { Dropdown } from '@equinor/fusion-react-searchable-dropdown';
|
|
4
4
|
export const ContextSelector = ({ children, ...props }) => {
|
|
5
|
-
|
|
6
|
-
return (_jsx(DropdownProvider, { ref: providerRef, children: _jsx(Dropdown, { ...props, children: children }) }));
|
|
5
|
+
return _jsx(Dropdown, { ...props, children: children });
|
|
7
6
|
};
|
|
8
7
|
export default ContextSelector;
|
|
9
8
|
//# sourceMappingURL=ContextSelector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextSelector.js","sourceRoot":"","sources":["../src/ContextSelector.tsx"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,OAAO,
|
|
1
|
+
{"version":3,"file":"ContextSelector.js","sourceRoot":"","sources":["../src/ContextSelector.tsx"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAGrE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAiD,EAAe,EAAE;IACpH,OAAO,KAAC,QAAQ,OAAK,KAAK,YAAG,QAAQ,GAAY,CAAC;AACpD,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AAExB,OAAO,EAAE,eAAe,IAAI,OAAO,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AAExB,OAAO,EAAE,eAAe,IAAI,OAAO,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DropdownProps, SearchableDropdownResultItem, SearchableDropdownSelectEvent } from '@equinor/fusion-react-searchable-dropdown';
|
|
2
|
+
export type ContextResultItem = Pick<SearchableDropdownResultItem, 'children' | 'graphic' | 'id' | 'isDisabled' | 'isError' | 'isSelected' | 'meta' | 'subTitle' | 'title' | 'type'>;
|
|
3
|
+
export type ContextResult = Array<ContextResultItem>;
|
|
4
|
+
export type ContextSelectEvent = SearchableDropdownSelectEvent;
|
|
5
|
+
export type ContextSelectorProps = DropdownProps;
|
|
6
|
+
export interface ContextResolver {
|
|
7
|
+
searchQuery: (queryString: string) => Promise<ContextResult> | ContextResult;
|
|
8
|
+
initialResult?: ContextResult;
|
|
9
|
+
closeHandler?: (e: MouseEvent) => void;
|
|
10
|
+
}
|
|
11
|
+
export type ContextProviderProps = {
|
|
12
|
+
resolver?: ContextResolver;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,4BAA4B,EAC5B,6BAA6B,EAC9B,MAAM,2CAA2C,CAAC;AAEnD,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,4BAA4B,EAC5B,UAAU,GAAG,SAAS,GAAG,IAAI,GAAG,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,CACjH,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,iBAAiB,CAAC,CAAC;AACrD,MAAM,MAAM,kBAAkB,GAAG,6BAA6B,CAAC;AAC/D,MAAM,MAAM,oBAAoB,GAAG,aAAa,CAAC;AAEjD,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,CAAC;IAC7E,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;CACxC;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B,CAAC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-react-context-selector",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "React component for context selector",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contextselector",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"url": "https://github.com/equinor/fusion-react-components/issues"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@equinor/fusion-react-searchable-dropdown": "^0.
|
|
40
|
+
"@equinor/fusion-react-searchable-dropdown": "^0.2.0",
|
|
41
41
|
"@equinor/fusion-react-utils": "^2.0.4"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "a976401d0c5be9bc37c1b8f0fb2248e829de99ab"
|
|
44
44
|
}
|