@equinor/fusion-react-context-selector 2.0.3 → 2.0.4
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/ContextProvider.d.ts +4 -1
- package/dist/ContextProvider.d.ts.map +1 -1
- package/dist/ContextProvider.js +1 -0
- package/dist/ContextSearch.d.ts +4 -1
- package/dist/ContextSearch.d.ts.map +1 -1
- package/dist/ContextSearch.js +7 -2
- package/dist/ContextSelector.d.ts +4 -1
- package/dist/ContextSelector.d.ts.map +1 -1
- package/dist/ContextSelector.js +1 -0
- package/package.json +3 -3
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { PropsWithChildren, ReactElement } from 'react';
|
|
2
2
|
import type { ContextProviderProps } from './types';
|
|
3
|
-
export declare const ContextProvider:
|
|
3
|
+
export declare const ContextProvider: {
|
|
4
|
+
({ children, ...props }: PropsWithChildren<ContextProviderProps>): ReactElement;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
4
7
|
export default ContextProvider;
|
|
5
8
|
//# sourceMappingURL=ContextProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextProvider.d.ts","sourceRoot":"","sources":["../src/ContextProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"ContextProvider.d.ts","sourceRoot":"","sources":["../src/ContextProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,eAAO,MAAM,eAAe;6BAGzB,iBAAiB,CAAC,oBAAoB,CAAC,GAAG,YAAY;;CAGxD,CAAC;AAIF,eAAe,eAAe,CAAC"}
|
package/dist/ContextProvider.js
CHANGED
|
@@ -4,4 +4,5 @@ export const ContextProvider = ({ children, ...props }) => {
|
|
|
4
4
|
const contextResolverRef = useDropdownProviderRef(props.resolver);
|
|
5
5
|
return _jsx(DropdownProvider, { ref: contextResolverRef, children: children });
|
|
6
6
|
};
|
|
7
|
+
ContextProvider.displayName = 'ContextProvider';
|
|
7
8
|
export default ContextProvider;
|
package/dist/ContextSearch.d.ts
CHANGED
|
@@ -11,6 +11,9 @@ export type ContextSearchProps = ContextSelectorProps & {
|
|
|
11
11
|
previewItem?: ContextResultItem;
|
|
12
12
|
onClearContext?: (e: Event) => void;
|
|
13
13
|
};
|
|
14
|
-
export declare const ContextSearch:
|
|
14
|
+
export declare const ContextSearch: {
|
|
15
|
+
({ children, onSelect, previewItem, onClearContext, ...props }: PropsWithChildren<ContextSearchProps>): ReactElement;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
15
18
|
export default ContextSearch;
|
|
16
19
|
//# sourceMappingURL=ContextSearch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextSearch.d.ts","sourceRoot":"","sources":["../src/ContextSearch.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAMlB,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAsB,MAAM,SAAS,CAAC;AAQ3F,UAAU,wBAAwB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AACD,qBAAa,iBAAkB,SAAQ,WAAW,CAAC,wBAAwB,CAAC;IAC1E,MAAM,CAAC,QAAQ,CAAC,SAAS,wBAAyB;gBACtC,OAAO,EAAE,wBAAwB;CAO9C;AAED,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,GAAG;IACtD,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;CACrC,CAAC;AAUF,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"ContextSearch.d.ts","sourceRoot":"","sources":["../src/ContextSearch.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAMlB,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAsB,MAAM,SAAS,CAAC;AAQ3F,UAAU,wBAAwB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AACD,qBAAa,iBAAkB,SAAQ,WAAW,CAAC,wBAAwB,CAAC;IAC1E,MAAM,CAAC,QAAQ,CAAC,SAAS,wBAAyB;gBACtC,OAAO,EAAE,wBAAwB;CAO9C;AAED,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,GAAG;IACtD,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;CACrC,CAAC;AAUF,eAAO,MAAM,aAAa;oEAMvB,iBAAiB,CAAC,kBAAkB,CAAC,GAAG,YAAY;;CA8KtD,CAAC;AAIF,eAAe,aAAa,CAAC"}
|
package/dist/ContextSearch.js
CHANGED
|
@@ -38,7 +38,9 @@ export const ContextSearch = ({ children, onSelect, previewItem, onClearContext,
|
|
|
38
38
|
const toggleGettingCtx = useCallback(() => {
|
|
39
39
|
setGettingCtx(!gettingCtx);
|
|
40
40
|
}, [gettingCtx]);
|
|
41
|
-
const keyUpGettingCtx = useCallback(
|
|
41
|
+
const keyUpGettingCtx = useCallback(
|
|
42
|
+
// biome-ignore lint/suspicious/noExplicitAny: fix typing later
|
|
43
|
+
(e) => {
|
|
42
44
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
43
45
|
toggleGettingCtx();
|
|
44
46
|
}
|
|
@@ -54,7 +56,9 @@ export const ContextSearch = ({ children, onSelect, previewItem, onClearContext,
|
|
|
54
56
|
}
|
|
55
57
|
}, [onSelect]);
|
|
56
58
|
/* Clear context button handler */
|
|
57
|
-
const handleClearContext = useCallback(
|
|
59
|
+
const handleClearContext = useCallback(
|
|
60
|
+
// biome-ignore lint/suspicious/noExplicitAny: fix typing later
|
|
61
|
+
(event) => {
|
|
58
62
|
setCtx(defaultInitialItem);
|
|
59
63
|
/* Clean SearchableDropdown */
|
|
60
64
|
if (sdd) {
|
|
@@ -132,4 +136,5 @@ export const ContextSearch = ({ children, onSelect, previewItem, onClearContext,
|
|
|
132
136
|
// biome-ignore lint/a11y/noNoninteractiveTabindex: will fix later
|
|
133
137
|
tabIndex: 0, className: styles.titleBlock, onClick: toggleGettingCtx, onKeyDown: (e) => keyUpGettingCtx(e), children: [_jsx("span", { className: styles.title, children: ctx?.title }), _jsx("span", { className: styles.subTitle, children: ctx?.subTitle })] }), _jsx("div", { className: styles.icon, children: ctx && !ctx.isDisabled && (_jsx("button", { type: "button", className: clsx(styles.closeBtn), onClick: handleClearContext, children: _jsx("fwc-icon", { icon: "close" }) })) })] }) }), _jsx("div", { className: clsx(styles.ctxSelector, !gettingCtx ? styles.hidden : 'active'), children: gettingCtx && (_jsx(ContextSelector, { autofocus: true, ...props, onSelect: handleSelect, children: children })) })] }));
|
|
134
138
|
};
|
|
139
|
+
ContextSearch.displayName = 'ContextSearch';
|
|
135
140
|
export default ContextSearch;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { ContextSelectorProps } from './types';
|
|
2
2
|
import type { ReactElement, PropsWithChildren } from 'react';
|
|
3
|
-
export declare const ContextSelector:
|
|
3
|
+
export declare const ContextSelector: {
|
|
4
|
+
({ children, ...props }: PropsWithChildren<ContextSelectorProps>): ReactElement;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
4
7
|
export default ContextSelector;
|
|
5
8
|
//# sourceMappingURL=ContextSelector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextSelector.d.ts","sourceRoot":"","sources":["../src/ContextSelector.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE7D,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"ContextSelector.d.ts","sourceRoot":"","sources":["../src/ContextSelector.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE7D,eAAO,MAAM,eAAe;6BAGzB,iBAAiB,CAAC,oBAAoB,CAAC,GAAG,YAAY;;CAExD,CAAC;AAIF,eAAe,eAAe,CAAC"}
|
package/dist/ContextSelector.js
CHANGED
|
@@ -3,4 +3,5 @@ import { Dropdown } from '@equinor/fusion-react-searchable-dropdown';
|
|
|
3
3
|
export const ContextSelector = ({ children, ...props }) => {
|
|
4
4
|
return _jsx(Dropdown, { ...props, children: children });
|
|
5
5
|
};
|
|
6
|
+
ContextSelector.displayName = 'ContextSelector';
|
|
6
7
|
export default ContextSelector;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-react-context-selector",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "React component for context selector",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contextselector",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@equinor/fusion-wc-icon": "^2.4.1",
|
|
36
36
|
"@equinor/fusion-wc-searchable-dropdown": "^4.1.1",
|
|
37
|
-
"@equinor/fusion-react-searchable-dropdown": "^2.0.
|
|
38
|
-
"@equinor/fusion-react-styles": "^2.1.
|
|
37
|
+
"@equinor/fusion-react-searchable-dropdown": "^2.0.4",
|
|
38
|
+
"@equinor/fusion-react-styles": "^2.1.4",
|
|
39
39
|
"@equinor/fusion-react-utils": "^3.0.2"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|