@jobber/components 4.45.6 → 4.46.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.
|
@@ -4,6 +4,12 @@ import { ComboboxAction } from "./components/ComboboxAction";
|
|
|
4
4
|
import { ComboboxTriggerButton, ComboboxTriggerChip } from "./components/ComboboxTrigger";
|
|
5
5
|
export interface ComboboxProps {
|
|
6
6
|
readonly children: ReactElement | ReactElement[];
|
|
7
|
+
/**
|
|
8
|
+
* When `true`, `Combobox` will allow for multiple selections
|
|
9
|
+
*
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
readonly multiSelect?: boolean;
|
|
7
13
|
}
|
|
8
14
|
export declare const COMBOBOX_TRIGGER_COUNT_ERROR_MESSAGE = "Combobox can only have one Trigger element";
|
|
9
15
|
export declare const COMBOBOX_REQUIRED_CHILDREN_ERROR_MESSAGE = "Combobox must have a Trigger and Combobox.Content element";
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React, { RefObject } from "react";
|
|
2
2
|
export declare const ComboboxContext: React.Context<{
|
|
3
|
+
multiselect: boolean;
|
|
3
4
|
open: boolean;
|
|
4
5
|
setOpen: (open: boolean) => void;
|
|
5
6
|
wrapperRef: RefObject<HTMLDivElement>;
|
|
6
7
|
}>;
|
|
7
8
|
export interface ComboboxProviderProps {
|
|
8
9
|
readonly children: React.ReactNode;
|
|
10
|
+
readonly multiselect?: boolean;
|
|
9
11
|
}
|
|
10
12
|
export declare function ComboboxContextProvider(props: ComboboxProviderProps): JSX.Element;
|
package/dist/Combobox/index.js
CHANGED
|
@@ -95,9 +95,10 @@ styleInject_es.styleInject(css_248z$2);
|
|
|
95
95
|
|
|
96
96
|
const ComboboxContext = React__default["default"].createContext({});
|
|
97
97
|
function ComboboxContextProvider(props) {
|
|
98
|
+
const multiselect = props.multiselect || false;
|
|
98
99
|
const [open, setOpen] = React.useState(false);
|
|
99
100
|
const wrapperRef = React.useRef(null);
|
|
100
|
-
return (React__default["default"].createElement(ComboboxContext.Provider, { value: { open, setOpen, wrapperRef } },
|
|
101
|
+
return (React__default["default"].createElement(ComboboxContext.Provider, { value: { multiselect, open, setOpen, wrapperRef } },
|
|
101
102
|
React__default["default"].createElement("div", { ref: wrapperRef },
|
|
102
103
|
open && (React__default["default"].createElement("div", { className: styles$2.overlay, onClick: () => setOpen(false), "data-testid": "ATL-Combobox-Overlay" })),
|
|
103
104
|
props.children)));
|
|
@@ -252,7 +253,7 @@ const COMBOBOX_TRIGGER_COUNT_ERROR_MESSAGE = "Combobox can only have one Trigger
|
|
|
252
253
|
const COMBOBOX_REQUIRED_CHILDREN_ERROR_MESSAGE = "Combobox must have a Trigger and Combobox.Content element";
|
|
253
254
|
const Combobox = (props) => {
|
|
254
255
|
const { contentElement, triggerElement } = useComboboxValidation(props.children);
|
|
255
|
-
return (React__default["default"].createElement(ComboboxContextProvider,
|
|
256
|
+
return (React__default["default"].createElement(ComboboxContextProvider, { multiselect: props.multiSelect },
|
|
256
257
|
triggerElement,
|
|
257
258
|
contentElement));
|
|
258
259
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.46.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"> 1%",
|
|
85
85
|
"IE 10"
|
|
86
86
|
],
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "d25715456671ca9e844f4ddece6f5d41ab0ad796"
|
|
88
88
|
}
|