@jobber/components 8.13.1 → 8.14.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/FilterPicker.d.ts +1 -0
- package/{Combobox.js → FilterPicker.js} +3 -3
- package/dist/Checkbox/Checkbox.d.ts +1 -1
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.cjs +11 -11
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.mjs +11 -11
- package/dist/DataList/components/DataListFilters/index.cjs +11 -11
- package/dist/DataList/components/DataListFilters/index.mjs +11 -11
- package/dist/DataList/components/DataListHeader/index.cjs +0 -1
- package/dist/DataList/components/DataListHeader/index.mjs +0 -1
- package/dist/DataList/components/DataListSearch/index.cjs +1 -2
- package/dist/DataList/components/DataListSearch/index.mjs +1 -2
- package/dist/DataList/index.cjs +11 -12
- package/dist/DataList/index.mjs +11 -12
- package/dist/DataListHeader-cjs.js +22 -5
- package/dist/DataListHeader-es.js +22 -5
- package/dist/DataListSearch-cjs.js +19 -2
- package/dist/DataListSearch-es.js +19 -2
- package/dist/DataListSort-cjs.js +5 -5
- package/dist/DataListSort-es.js +5 -5
- package/dist/FilterPicker/FilterPicker.d.ts +11 -0
- package/dist/{Combobox/Combobox.types.d.ts → FilterPicker/FilterPicker.types.d.ts} +51 -51
- package/dist/FilterPicker/FilterPickerProvider.d.ts +18 -0
- package/dist/FilterPicker/components/FilterPickerAction/FilterPickerAction.d.ts +3 -0
- package/dist/FilterPicker/components/FilterPickerAction/index.cjs +12 -0
- package/dist/FilterPicker/components/FilterPickerAction/index.d.ts +1 -0
- package/dist/FilterPicker/components/FilterPickerAction/index.mjs +6 -0
- package/dist/FilterPicker/components/FilterPickerActivator/FilterPickerActivator.d.ts +3 -0
- package/dist/{Combobox/components/ComboboxActivator → FilterPicker/components/FilterPickerActivator}/index.cjs +3 -3
- package/dist/FilterPicker/components/FilterPickerActivator/index.d.ts +1 -0
- package/dist/{Combobox/components/ComboboxActivator → FilterPicker/components/FilterPickerActivator}/index.mjs +2 -2
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContent.d.ts +3 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentHeader/FilterPickerContentHeader.d.ts +3 -0
- package/dist/{Combobox/components/ComboboxContent/ComboboxContentHeader → FilterPicker/components/FilterPickerContent/FilterPickerContentHeader}/index.cjs +2 -2
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentHeader/index.d.ts +1 -0
- package/dist/{Combobox/components/ComboboxContent/ComboboxContentHeader → FilterPicker/components/FilterPickerContent/FilterPickerContentHeader}/index.mjs +1 -1
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentList/FilterPickerContentList.d.ts +3 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentList/FilterPickerContentList.module.css.d.ts +13 -0
- package/dist/{Combobox/components/ComboboxContent/ComboboxContentList → FilterPicker/components/FilterPickerContent/FilterPickerContentList}/index.cjs +5 -5
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentList/index.d.ts +1 -0
- package/dist/{Combobox/components/ComboboxContent/ComboboxContentList → FilterPicker/components/FilterPickerContent/FilterPickerContentList}/index.mjs +4 -4
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentSearch/FilterPickerContentSearch.d.ts +3 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentSearch/index.cjs +10 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentSearch/index.d.ts +1 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentSearch/index.mjs +4 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerLoadMore/FilterPickerLoadMore.d.ts +6 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerLoadMore/index.cjs +9 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerLoadMore/index.d.ts +1 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerLoadMore/index.mjs +3 -0
- package/dist/{Combobox/components/ComboboxContent → FilterPicker/components/FilterPickerContent}/index.cjs +8 -8
- package/dist/FilterPicker/components/FilterPickerContent/index.d.ts +1 -0
- package/dist/{Combobox/components/ComboboxContent → FilterPicker/components/FilterPickerContent}/index.mjs +7 -7
- package/dist/FilterPicker/components/FilterPickerOption/FilterPickerOption.d.ts +3 -0
- package/dist/{Combobox/components/ComboboxOption → FilterPicker/components/FilterPickerOption}/index.cjs +3 -3
- package/dist/FilterPicker/components/FilterPickerOption/index.d.ts +1 -0
- package/dist/{Combobox/components/ComboboxOption → FilterPicker/components/FilterPickerOption}/index.mjs +2 -2
- package/dist/FilterPicker/components/FilterPickerTrigger/FilterPickerTrigger.d.ts +3 -0
- package/dist/{Combobox/components/ComboboxTrigger → FilterPicker/components/FilterPickerTrigger}/index.cjs +3 -3
- package/dist/FilterPicker/components/FilterPickerTrigger/index.d.ts +1 -0
- package/dist/{Combobox/components/ComboboxTrigger → FilterPicker/components/FilterPickerTrigger}/index.mjs +2 -2
- package/dist/FilterPicker/constants.d.ts +1 -0
- package/dist/FilterPicker/hooks/useFilterPicker.d.ts +17 -0
- package/dist/FilterPicker/hooks/useFilterPickerAccessibility.d.ts +9 -0
- package/dist/FilterPicker/hooks/useFilterPickerActivatorAccessibility.d.ts +2 -0
- package/dist/FilterPicker/hooks/useFilterPickerContent.d.ts +9 -0
- package/dist/FilterPicker/hooks/useFilterPickerValidation.d.ts +12 -0
- package/dist/FilterPicker/hooks/useMakeFilterPickerHandlers.d.ts +8 -0
- package/dist/{Combobox → FilterPicker}/index.cjs +13 -13
- package/dist/FilterPicker/index.d.ts +3 -0
- package/dist/{Combobox → FilterPicker}/index.mjs +11 -11
- package/dist/{Combobox-cjs.js → FilterPicker-cjs.js} +25 -25
- package/dist/{Combobox-es.js → FilterPicker-es.js} +25 -25
- package/dist/{ComboboxAction-cjs.js → FilterPickerAction-cjs.js} +5 -5
- package/dist/{ComboboxAction-es.js → FilterPickerAction-es.js} +5 -5
- package/dist/{ComboboxActivator-cjs.js → FilterPickerActivator-cjs.js} +8 -8
- package/dist/{ComboboxActivator-es.js → FilterPickerActivator-es.js} +9 -9
- package/dist/{ComboboxContent-cjs.js → FilterPickerContent-cjs.js} +19 -19
- package/dist/{ComboboxContent-es.js → FilterPickerContent-es.js} +20 -20
- package/dist/{ComboboxContentHeader-cjs.js → FilterPickerContentHeader-cjs.js} +4 -4
- package/dist/{ComboboxContentHeader-es.js → FilterPickerContentHeader-es.js} +4 -4
- package/dist/{ComboboxContentList-cjs.js → FilterPickerContentList-cjs.js} +7 -7
- package/dist/{ComboboxContentList-es.js → FilterPickerContentList-es.js} +7 -7
- package/dist/{ComboboxContentSearch-cjs.js → FilterPickerContentSearch-cjs.js} +4 -4
- package/dist/{ComboboxContentSearch-es.js → FilterPickerContentSearch-es.js} +4 -4
- package/dist/FilterPickerLoadMore-cjs.js +16 -0
- package/dist/{ComboboxLoadMore-es.js → FilterPickerLoadMore-es.js} +4 -4
- package/dist/{ComboboxOption-cjs.js → FilterPickerOption-cjs.js} +5 -5
- package/dist/{ComboboxOption-es.js → FilterPickerOption-es.js} +5 -5
- package/dist/FilterPickerProvider-cjs.js +13 -0
- package/dist/FilterPickerProvider-es.js +10 -0
- package/dist/{ComboboxTrigger-cjs.js → FilterPickerTrigger-cjs.js} +4 -4
- package/dist/{ComboboxTrigger-es.js → FilterPickerTrigger-es.js} +4 -4
- package/dist/constants-cjs.js +2 -2
- package/dist/constants-es.js +2 -2
- package/dist/docs/Autocomplete/Autocomplete.md +1 -1
- package/dist/docs/Banner/Banner.md +2 -2
- package/dist/docs/Box/Box.md +2 -2
- package/dist/docs/Card/Card.md +1 -1
- package/dist/docs/Chip/Chip.md +4 -4
- package/dist/docs/DataList/DataList.md +16 -15
- package/dist/docs/{Combobox/Combobox.md → FilterPicker/FilterPicker.md} +91 -85
- package/dist/docs/Icon/Icon.md +1 -1
- package/dist/docs/Menu/Menu.md +2 -2
- package/dist/docs/MultiSelect/MultiSelect.md +1 -1
- package/dist/docs/Tabs/Tabs.md +2 -2
- package/dist/docs/index.md +1 -2
- package/dist/docs/usage-guidelines/usage-guidelines.md +5 -5
- package/dist/index.cjs +14 -16
- package/dist/index.d.mts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.mjs +12 -13
- package/dist/styles.css +53 -53
- package/dist/utils/meta/meta.json +5 -7
- package/package.json +6 -11
- package/rollup.config.mjs +2 -2
- package/AnimatedSwitcher.d.ts +0 -1
- package/AnimatedSwitcher.js +0 -17
- package/Combobox.d.ts +0 -1
- package/dist/AnimatedSwitcher/AnimatedSwitcher.d.ts +0 -32
- package/dist/AnimatedSwitcher/index.cjs +0 -11
- package/dist/AnimatedSwitcher/index.d.ts +0 -1
- package/dist/AnimatedSwitcher/index.mjs +0 -5
- package/dist/AnimatedSwitcher/transitions.d.ts +0 -8
- package/dist/AnimatedSwitcher-cjs.js +0 -95
- package/dist/AnimatedSwitcher-es.js +0 -93
- package/dist/Combobox/Combobox.d.ts +0 -11
- package/dist/Combobox/ComboboxProvider.d.ts +0 -18
- package/dist/Combobox/components/ComboboxAction/ComboboxAction.d.ts +0 -3
- package/dist/Combobox/components/ComboboxAction/index.cjs +0 -12
- package/dist/Combobox/components/ComboboxAction/index.d.ts +0 -1
- package/dist/Combobox/components/ComboboxAction/index.mjs +0 -6
- package/dist/Combobox/components/ComboboxActivator/ComboboxActivator.d.ts +0 -3
- package/dist/Combobox/components/ComboboxActivator/index.d.ts +0 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxContent.d.ts +0 -3
- package/dist/Combobox/components/ComboboxContent/ComboboxContentHeader/ComboboxContentHeader.d.ts +0 -3
- package/dist/Combobox/components/ComboboxContent/ComboboxContentHeader/index.d.ts +0 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxContentList/ComboboxContentList.d.ts +0 -3
- package/dist/Combobox/components/ComboboxContent/ComboboxContentList/index.d.ts +0 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxContentSearch/ComboboxContentSearch.d.ts +0 -3
- package/dist/Combobox/components/ComboboxContent/ComboboxContentSearch/index.cjs +0 -10
- package/dist/Combobox/components/ComboboxContent/ComboboxContentSearch/index.d.ts +0 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxContentSearch/index.mjs +0 -4
- package/dist/Combobox/components/ComboboxContent/ComboboxLoadMore/ComboboxLoadMore.d.ts +0 -6
- package/dist/Combobox/components/ComboboxContent/ComboboxLoadMore/index.cjs +0 -9
- package/dist/Combobox/components/ComboboxContent/ComboboxLoadMore/index.d.ts +0 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxLoadMore/index.mjs +0 -3
- package/dist/Combobox/components/ComboboxContent/index.d.ts +0 -1
- package/dist/Combobox/components/ComboboxOption/ComboboxOption.d.ts +0 -3
- package/dist/Combobox/components/ComboboxOption/index.d.ts +0 -1
- package/dist/Combobox/components/ComboboxTrigger/ComboboxTrigger.d.ts +0 -3
- package/dist/Combobox/components/ComboboxTrigger/index.d.ts +0 -1
- package/dist/Combobox/constants.d.ts +0 -1
- package/dist/Combobox/hooks/useCombobox.d.ts +0 -17
- package/dist/Combobox/hooks/useComboboxAccessibility.d.ts +0 -9
- package/dist/Combobox/hooks/useComboboxActivatorAccessibility.d.ts +0 -2
- package/dist/Combobox/hooks/useComboboxContent.d.ts +0 -9
- package/dist/Combobox/hooks/useComboboxValidation.d.ts +0 -12
- package/dist/Combobox/hooks/useMakeComboboxHandlers.d.ts +0 -8
- package/dist/Combobox/index.d.ts +0 -3
- package/dist/ComboboxLoadMore-cjs.js +0 -16
- package/dist/ComboboxProvider-cjs.js +0 -13
- package/dist/ComboboxProvider-es.js +0 -10
- package/dist/docs/AnimatedSwitcher/AnimatedSwitcher.md +0 -34
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { F as FilterPickerContent } from '../../../FilterPickerContent-es.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import '../../../floating-ui.react-es.js';
|
|
@@ -7,10 +7,10 @@ import '../../../index.esm-es.js';
|
|
|
7
7
|
import 'react/jsx-runtime';
|
|
8
8
|
import 'react-dom';
|
|
9
9
|
import '../../../floating-ui.react-dom-es.js';
|
|
10
|
-
import '../../../
|
|
10
|
+
import '../../../FilterPickerContentSearch-es.js';
|
|
11
11
|
import '../../../Icon-es.js';
|
|
12
12
|
import '@jobber/design';
|
|
13
|
-
import '../../../
|
|
13
|
+
import '../../../FilterPickerContentList-es.js';
|
|
14
14
|
import 'framer-motion';
|
|
15
15
|
import '../../../Text-es.js';
|
|
16
16
|
import '../../../Typography-es.js';
|
|
@@ -28,12 +28,12 @@ import '../../../_baseFor-es.js';
|
|
|
28
28
|
import '../../../keysIn-es.js';
|
|
29
29
|
import '../../../_isIterateeCall-es.js';
|
|
30
30
|
import '../../../_setToString-es.js';
|
|
31
|
-
import '../../../
|
|
31
|
+
import '../../../FilterPickerOption-es.js';
|
|
32
32
|
import '../../../Flex-es.js';
|
|
33
|
-
import '../../../
|
|
34
|
-
import '../../../
|
|
33
|
+
import '../../../FilterPickerProvider-es.js';
|
|
34
|
+
import '../../../FilterPickerLoadMore-es.js';
|
|
35
35
|
import '@jobber/hooks';
|
|
36
|
-
import '../../../
|
|
36
|
+
import '../../../FilterPickerContentHeader-es.js';
|
|
37
37
|
import '../../../Button-es.js';
|
|
38
38
|
import 'react-router-dom';
|
|
39
39
|
import '../../../constants-es.js';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var FilterPickerOption = require('../../../FilterPickerOption-cjs.js');
|
|
4
4
|
require('../../../tslib.es6-cjs.js');
|
|
5
5
|
require('react');
|
|
6
6
|
require('classnames');
|
|
7
7
|
require('../../../Icon-cjs.js');
|
|
8
8
|
require('@jobber/design');
|
|
9
9
|
require('../../../Flex-cjs.js');
|
|
10
|
-
require('../../../
|
|
10
|
+
require('../../../FilterPickerProvider-cjs.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.
|
|
14
|
+
exports.FilterPickerOption = FilterPickerOption.FilterPickerOption;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./FilterPickerOption";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { F as FilterPickerOption } from '../../../FilterPickerOption-es.js';
|
|
2
2
|
import '../../../tslib.es6-es.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'classnames';
|
|
5
5
|
import '../../../Icon-es.js';
|
|
6
6
|
import '@jobber/design';
|
|
7
7
|
import '../../../Flex-es.js';
|
|
8
|
-
import '../../../
|
|
8
|
+
import '../../../FilterPickerProvider-es.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var FilterPickerTrigger = require('../../../FilterPickerTrigger-cjs.js');
|
|
4
4
|
require('react');
|
|
5
5
|
require('../../../Chip-cjs.js');
|
|
6
6
|
require('../../../tslib.es6-cjs.js');
|
|
@@ -20,8 +20,8 @@ require('react/jsx-runtime');
|
|
|
20
20
|
require('react-dom');
|
|
21
21
|
require('../../../floating-ui.react-dom-cjs.js');
|
|
22
22
|
require('framer-motion');
|
|
23
|
-
require('../../../
|
|
23
|
+
require('../../../FilterPickerProvider-cjs.js');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
exports.
|
|
27
|
+
exports.FilterPickerTrigger = FilterPickerTrigger.FilterPickerTrigger;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FilterPickerTrigger } from "./FilterPickerTrigger";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { F as FilterPickerTrigger } from '../../../FilterPickerTrigger-es.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import '../../../Chip-es.js';
|
|
4
4
|
import '../../../tslib.es6-es.js';
|
|
@@ -18,4 +18,4 @@ import 'react/jsx-runtime';
|
|
|
18
18
|
import 'react-dom';
|
|
19
19
|
import '../../../floating-ui.react-dom-es.js';
|
|
20
20
|
import 'framer-motion';
|
|
21
|
-
import '../../../
|
|
21
|
+
import '../../../FilterPickerProvider-es.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FILTER_PICKER_MENU_ID = "ATL-FilterPicker-Content";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Dispatch, MutableRefObject } from "react";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
import type { UseMakeFilterPickerHandlersReturn } from "./useMakeFilterPickerHandlers";
|
|
4
|
+
import { type FilterPickerOption } from "../FilterPicker.types";
|
|
5
|
+
type UseFilterPickerReturn = {
|
|
6
|
+
wrapperRef: React.RefObject<HTMLDivElement | null>;
|
|
7
|
+
searchValue: string;
|
|
8
|
+
setSearchValue: Dispatch<React.SetStateAction<string>>;
|
|
9
|
+
open: boolean;
|
|
10
|
+
selectedOptions: FilterPickerOption[];
|
|
11
|
+
selectedStateSetter: (selection: FilterPickerOption[]) => void;
|
|
12
|
+
shouldScroll: MutableRefObject<boolean>;
|
|
13
|
+
internalFilteredOptions: FilterPickerOption[];
|
|
14
|
+
handleSearchChange: (value: string) => void;
|
|
15
|
+
} & UseMakeFilterPickerHandlersReturn;
|
|
16
|
+
export declare function useFilterPicker(selected: FilterPickerOption[], onSelect: (selection: FilterPickerOption[]) => void, options: FilterPickerOption[], onClose?: () => void, multiSelect?: boolean, onSearch?: (searchValue: string) => void, debounceTime?: number): UseFilterPickerReturn;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { UseInteractionsReturn } from "@floating-ui/react";
|
|
2
|
+
import { type FilterPickerOption } from "../FilterPicker.types";
|
|
3
|
+
export declare function useFilterPickerAccessibility(selectionCallback: (selection: FilterPickerOption) => void, filteredOptions: FilterPickerOption[], optionsListRef: React.RefObject<HTMLUListElement | null>, open: boolean, wrapperRef: React.RefObject<HTMLDivElement | null>): {
|
|
4
|
+
floatingRef: React.RefObject<HTMLDivElement | null>;
|
|
5
|
+
floatingStyles: React.CSSProperties;
|
|
6
|
+
floatingProps: ReturnType<UseInteractionsReturn["getFloatingProps"]>;
|
|
7
|
+
nodeId?: string;
|
|
8
|
+
parentNodeId: string | null;
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
import { type FilterPickerOption } from "../FilterPicker.types";
|
|
3
|
+
interface useFilterPickerContent {
|
|
4
|
+
optionsListRef: RefObject<HTMLUListElement | null>;
|
|
5
|
+
onClear?: () => void;
|
|
6
|
+
onSelectAll?: (selection: FilterPickerOption[]) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function useFilterPickerContent(open: boolean, selected: FilterPickerOption[]): useFilterPickerContent;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import { type FilterPickerActionProps, type FilterPickerActivatorProps, type FilterPickerOptionProps, type FilterPickerProps } from "../FilterPicker.types";
|
|
3
|
+
export declare const FILTER_PICKER_ACTIVATOR_COUNT_ERROR_MESSAGE = "FilterPicker must have exactly one Activator element";
|
|
4
|
+
export declare function useFilterPickerValidation(children?: FilterPickerProps["children"]): {
|
|
5
|
+
triggerElement?: ReactElement<FilterPickerActivatorProps>;
|
|
6
|
+
optionElements?: ReactElement<FilterPickerOptionProps>[];
|
|
7
|
+
actionElements?: ReactElement<FilterPickerActionProps>[];
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Return all instances child component that matches the `type` provided
|
|
11
|
+
*/
|
|
12
|
+
export declare function getCompoundComponents<T>(type: ReactElement<T>["type"], children?: FilterPickerProps["children"]): ReactElement<T>[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import { type FilterPickerOption } from "../FilterPicker.types";
|
|
3
|
+
export interface UseMakeFilterPickerHandlersReturn {
|
|
4
|
+
handleClose: () => void;
|
|
5
|
+
handleSelection: (selection: FilterPickerOption) => void;
|
|
6
|
+
handleOpen: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function useMakeFilterPickerHandlers(setOpen: (open: boolean) => void, open: boolean, setSearchValue: (searchValue: string) => void, selectedOptions: FilterPickerOption[], shouldScroll: React.RefObject<boolean>, selectedStateSetter: (selected: FilterPickerOption[]) => void, multiSelect?: boolean, onClose?: () => void, onSearch?: (searchValue: string) => void): UseMakeFilterPickerHandlersReturn;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var FilterPicker = require('../FilterPicker-cjs.js');
|
|
4
|
+
var FilterPickerProvider = require('../FilterPickerProvider-cjs.js');
|
|
5
5
|
require('react');
|
|
6
|
-
require('../
|
|
6
|
+
require('../FilterPickerContent-cjs.js');
|
|
7
7
|
require('classnames');
|
|
8
8
|
require('../floating-ui.react-cjs.js');
|
|
9
9
|
require('../floating-ui.utils.dom-cjs.js');
|
|
@@ -11,10 +11,10 @@ require('../index.esm-cjs.js');
|
|
|
11
11
|
require('react/jsx-runtime');
|
|
12
12
|
require('react-dom');
|
|
13
13
|
require('../floating-ui.react-dom-cjs.js');
|
|
14
|
-
require('../
|
|
14
|
+
require('../FilterPickerContentSearch-cjs.js');
|
|
15
15
|
require('../Icon-cjs.js');
|
|
16
16
|
require('@jobber/design');
|
|
17
|
-
require('../
|
|
17
|
+
require('../FilterPickerContentList-cjs.js');
|
|
18
18
|
require('framer-motion');
|
|
19
19
|
require('../Text-cjs.js');
|
|
20
20
|
require('../Typography-cjs.js');
|
|
@@ -32,25 +32,25 @@ require('../_baseFor-cjs.js');
|
|
|
32
32
|
require('../keysIn-cjs.js');
|
|
33
33
|
require('../_isIterateeCall-cjs.js');
|
|
34
34
|
require('../_setToString-cjs.js');
|
|
35
|
-
require('../
|
|
35
|
+
require('../FilterPickerOption-cjs.js');
|
|
36
36
|
require('../Flex-cjs.js');
|
|
37
|
-
require('../
|
|
37
|
+
require('../FilterPickerLoadMore-cjs.js');
|
|
38
38
|
require('@jobber/hooks');
|
|
39
|
-
require('../
|
|
39
|
+
require('../FilterPickerContentHeader-cjs.js');
|
|
40
40
|
require('../Button-cjs.js');
|
|
41
41
|
require('react-router-dom');
|
|
42
42
|
require('../constants-cjs.js');
|
|
43
|
-
require('../
|
|
44
|
-
require('../
|
|
43
|
+
require('../FilterPickerAction-cjs.js');
|
|
44
|
+
require('../FilterPickerTrigger-cjs.js');
|
|
45
45
|
require('../Chip-cjs.js');
|
|
46
46
|
require('../Avatar-cjs.js');
|
|
47
47
|
require('color');
|
|
48
48
|
require('../useChildComponent-cjs.js');
|
|
49
49
|
require('../Tooltip-cjs.js');
|
|
50
50
|
require('../noop-cjs.js');
|
|
51
|
-
require('../
|
|
51
|
+
require('../FilterPickerActivator-cjs.js');
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
|
|
55
|
-
exports.
|
|
56
|
-
exports.
|
|
55
|
+
exports.FilterPicker = FilterPicker.FilterPicker;
|
|
56
|
+
exports.FilterPickerContextProvider = FilterPickerProvider.FilterPickerContextProvider;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { F as FilterPicker } from '../FilterPicker-es.js';
|
|
2
|
+
export { F as FilterPickerContextProvider } from '../FilterPickerProvider-es.js';
|
|
3
3
|
import 'react';
|
|
4
|
-
import '../
|
|
4
|
+
import '../FilterPickerContent-es.js';
|
|
5
5
|
import 'classnames';
|
|
6
6
|
import '../floating-ui.react-es.js';
|
|
7
7
|
import '../floating-ui.utils.dom-es.js';
|
|
@@ -9,10 +9,10 @@ import '../index.esm-es.js';
|
|
|
9
9
|
import 'react/jsx-runtime';
|
|
10
10
|
import 'react-dom';
|
|
11
11
|
import '../floating-ui.react-dom-es.js';
|
|
12
|
-
import '../
|
|
12
|
+
import '../FilterPickerContentSearch-es.js';
|
|
13
13
|
import '../Icon-es.js';
|
|
14
14
|
import '@jobber/design';
|
|
15
|
-
import '../
|
|
15
|
+
import '../FilterPickerContentList-es.js';
|
|
16
16
|
import 'framer-motion';
|
|
17
17
|
import '../Text-es.js';
|
|
18
18
|
import '../Typography-es.js';
|
|
@@ -30,20 +30,20 @@ import '../_baseFor-es.js';
|
|
|
30
30
|
import '../keysIn-es.js';
|
|
31
31
|
import '../_isIterateeCall-es.js';
|
|
32
32
|
import '../_setToString-es.js';
|
|
33
|
-
import '../
|
|
33
|
+
import '../FilterPickerOption-es.js';
|
|
34
34
|
import '../Flex-es.js';
|
|
35
|
-
import '../
|
|
35
|
+
import '../FilterPickerLoadMore-es.js';
|
|
36
36
|
import '@jobber/hooks';
|
|
37
|
-
import '../
|
|
37
|
+
import '../FilterPickerContentHeader-es.js';
|
|
38
38
|
import '../Button-es.js';
|
|
39
39
|
import 'react-router-dom';
|
|
40
40
|
import '../constants-es.js';
|
|
41
|
-
import '../
|
|
42
|
-
import '../
|
|
41
|
+
import '../FilterPickerAction-es.js';
|
|
42
|
+
import '../FilterPickerTrigger-es.js';
|
|
43
43
|
import '../Chip-es.js';
|
|
44
44
|
import '../Avatar-es.js';
|
|
45
45
|
import 'color';
|
|
46
46
|
import '../useChildComponent-es.js';
|
|
47
47
|
import '../Tooltip-es.js';
|
|
48
48
|
import '../noop-es.js';
|
|
49
|
-
import '../
|
|
49
|
+
import '../FilterPickerActivator-es.js';
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
4
|
+
var FilterPickerContent = require('./FilterPickerContent-cjs.js');
|
|
5
|
+
var FilterPickerAction = require('./FilterPickerAction-cjs.js');
|
|
6
|
+
var FilterPickerProvider = require('./FilterPickerProvider-cjs.js');
|
|
7
|
+
var FilterPickerTrigger = require('./FilterPickerTrigger-cjs.js');
|
|
8
|
+
var FilterPickerOption = require('./FilterPickerOption-cjs.js');
|
|
9
9
|
var noop = require('./noop-cjs.js');
|
|
10
10
|
var jobberHooks = require('@jobber/hooks');
|
|
11
|
-
var
|
|
11
|
+
var FilterPickerActivator = require('./FilterPickerActivator-cjs.js');
|
|
12
12
|
|
|
13
|
-
var styles = {"overlay":"
|
|
13
|
+
var styles = {"overlay":"pWccl-Pw3hY-","wrapper":"CGh3PQqBZ1c-","spinning":"Cf-fmDM7clM-"};
|
|
14
14
|
|
|
15
|
-
function
|
|
15
|
+
function useMakeFilterPickerHandlers(setOpen, open, setSearchValue, selectedOptions, shouldScroll, selectedStateSetter, multiSelect, onClose, onSearch) {
|
|
16
16
|
const handleClose = React.useCallback(() => {
|
|
17
17
|
setOpen(false);
|
|
18
18
|
setSearchValue("");
|
|
@@ -52,13 +52,13 @@ function handleMultiSelect(selectCallback, selected, selection) {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
function
|
|
55
|
+
function useFilterPicker(selected, onSelect, options, onClose, multiSelect, onSearch, debounceTime = 300) {
|
|
56
56
|
const wrapperRef = React.useRef(null);
|
|
57
57
|
const shouldScroll = React.useRef(false);
|
|
58
58
|
const [open, setOpen] = React.useState(false);
|
|
59
59
|
const [searchValue, setSearchValue] = React.useState("");
|
|
60
60
|
const searchCallback = jobberHooks.useDebounce((value) => onSearch === null || onSearch === void 0 ? void 0 : onSearch(value), debounceTime);
|
|
61
|
-
const { handleClose, handleSelection, handleOpen } =
|
|
61
|
+
const { handleClose, handleSelection, handleOpen } = useMakeFilterPickerHandlers(setOpen, open, setSearchValue, selected, shouldScroll, onSelect, multiSelect, onClose, onSearch);
|
|
62
62
|
const internalFilteredOptions = options.filter(option => option.label.toLowerCase().includes(searchValue.toLowerCase()));
|
|
63
63
|
return {
|
|
64
64
|
wrapperRef,
|
|
@@ -76,10 +76,10 @@ function useCombobox(selected, onSelect, options, onClose, multiSelect, onSearch
|
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
function
|
|
80
|
-
const optionElements = getCompoundComponents(
|
|
81
|
-
const actionElements = getCompoundComponents(
|
|
82
|
-
const activatorElements = getCompoundComponents(
|
|
79
|
+
function useFilterPickerValidation(children) {
|
|
80
|
+
const optionElements = getCompoundComponents(FilterPickerOption.FilterPickerOption, children);
|
|
81
|
+
const actionElements = getCompoundComponents(FilterPickerAction.FilterPickerAction, children);
|
|
82
|
+
const activatorElements = getCompoundComponents(FilterPickerActivator.FilterPickerActivator, children);
|
|
83
83
|
return {
|
|
84
84
|
optionElements,
|
|
85
85
|
triggerElement: activatorElements[0],
|
|
@@ -95,18 +95,18 @@ function getCompoundComponents(type, children) {
|
|
|
95
95
|
return elements;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
function
|
|
99
|
-
const { optionElements, triggerElement, actionElements } =
|
|
98
|
+
function FilterPicker(props) {
|
|
99
|
+
const { optionElements, triggerElement, actionElements } = useFilterPickerValidation(props.children);
|
|
100
100
|
const options = React.useMemo(() => (optionElements === null || optionElements === void 0 ? void 0 : optionElements.map(option => (Object.assign({}, option.props)))) || [], [optionElements]);
|
|
101
|
-
const { selectedOptions, selectedStateSetter, shouldScroll, wrapperRef, searchValue, setSearchValue, open, handleClose, handleSelection, handleOpen, internalFilteredOptions, handleSearchChange, } =
|
|
102
|
-
return (React.createElement(
|
|
101
|
+
const { selectedOptions, selectedStateSetter, shouldScroll, wrapperRef, searchValue, setSearchValue, open, handleClose, handleSelection, handleOpen, internalFilteredOptions, handleSearchChange, } = useFilterPicker(props.selected, props.onSelect, options, props.onClose, props.multiSelect, props.onSearch, props.onSearchDebounce);
|
|
102
|
+
return (React.createElement(FilterPickerProvider.FilterPickerContextProvider, { selected: selectedOptions, selectionHandler: handleSelection, open: open, handleOpen: handleOpen, handleClose: handleClose, shouldScroll: shouldScroll, searchValue: searchValue, label: props.label, onClear: props.onClear, onSelectAll: props.onSelectAll },
|
|
103
103
|
React.createElement("div", { ref: wrapperRef, className: styles.wrapper },
|
|
104
|
-
open && (React.createElement("div", { className: styles.overlay, onClick: handleClose, "data-testid": "ATL-
|
|
105
|
-
triggerElement || (React.createElement(
|
|
106
|
-
React.createElement(
|
|
104
|
+
open && (React.createElement("div", { className: styles.overlay, onClick: handleClose, "data-testid": "ATL-FilterPicker-Overlay" })),
|
|
105
|
+
triggerElement || (React.createElement(FilterPickerTrigger.FilterPickerTrigger, { label: props.label, selected: props.selected, activatorRef: props.defaultActivatorRef })),
|
|
106
|
+
React.createElement(FilterPickerContent.FilterPickerContent, { multiselect: props.multiSelect, subjectNoun: props.subjectNoun, selected: selectedOptions, actionElements: actionElements, selectedStateSetter: selectedStateSetter, handleSelection: handleSelection, searchValue: searchValue, setSearchValue: setSearchValue, wrapperRef: wrapperRef, open: open, options: props.onSearch ? options : internalFilteredOptions, loading: props.loading, handleSearchChange: handleSearchChange, onLoadMore: props.onLoadMore }))));
|
|
107
107
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
FilterPicker.Activator = FilterPickerActivator.FilterPickerActivator;
|
|
109
|
+
FilterPicker.Action = FilterPickerAction.FilterPickerAction;
|
|
110
|
+
FilterPicker.Option = FilterPickerOption.FilterPickerOption;
|
|
111
111
|
|
|
112
|
-
exports.
|
|
112
|
+
exports.FilterPicker = FilterPicker;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React__default, { useCallback, useRef, useState, Children, isValidElement, useMemo } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { F as FilterPickerContent } from './FilterPickerContent-es.js';
|
|
3
|
+
import { F as FilterPickerAction } from './FilterPickerAction-es.js';
|
|
4
|
+
import { F as FilterPickerContextProvider } from './FilterPickerProvider-es.js';
|
|
5
|
+
import { F as FilterPickerTrigger } from './FilterPickerTrigger-es.js';
|
|
6
|
+
import { F as FilterPickerOption } from './FilterPickerOption-es.js';
|
|
7
7
|
import { n as noop } from './noop-es.js';
|
|
8
8
|
import { useDebounce } from '@jobber/hooks';
|
|
9
|
-
import {
|
|
9
|
+
import { F as FilterPickerActivator } from './FilterPickerActivator-es.js';
|
|
10
10
|
|
|
11
|
-
var styles = {"overlay":"
|
|
11
|
+
var styles = {"overlay":"pWccl-Pw3hY-","wrapper":"CGh3PQqBZ1c-","spinning":"Cf-fmDM7clM-"};
|
|
12
12
|
|
|
13
|
-
function
|
|
13
|
+
function useMakeFilterPickerHandlers(setOpen, open, setSearchValue, selectedOptions, shouldScroll, selectedStateSetter, multiSelect, onClose, onSearch) {
|
|
14
14
|
const handleClose = useCallback(() => {
|
|
15
15
|
setOpen(false);
|
|
16
16
|
setSearchValue("");
|
|
@@ -50,13 +50,13 @@ function handleMultiSelect(selectCallback, selected, selection) {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
function
|
|
53
|
+
function useFilterPicker(selected, onSelect, options, onClose, multiSelect, onSearch, debounceTime = 300) {
|
|
54
54
|
const wrapperRef = useRef(null);
|
|
55
55
|
const shouldScroll = useRef(false);
|
|
56
56
|
const [open, setOpen] = useState(false);
|
|
57
57
|
const [searchValue, setSearchValue] = useState("");
|
|
58
58
|
const searchCallback = useDebounce((value) => onSearch === null || onSearch === void 0 ? void 0 : onSearch(value), debounceTime);
|
|
59
|
-
const { handleClose, handleSelection, handleOpen } =
|
|
59
|
+
const { handleClose, handleSelection, handleOpen } = useMakeFilterPickerHandlers(setOpen, open, setSearchValue, selected, shouldScroll, onSelect, multiSelect, onClose, onSearch);
|
|
60
60
|
const internalFilteredOptions = options.filter(option => option.label.toLowerCase().includes(searchValue.toLowerCase()));
|
|
61
61
|
return {
|
|
62
62
|
wrapperRef,
|
|
@@ -74,10 +74,10 @@ function useCombobox(selected, onSelect, options, onClose, multiSelect, onSearch
|
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
function
|
|
78
|
-
const optionElements = getCompoundComponents(
|
|
79
|
-
const actionElements = getCompoundComponents(
|
|
80
|
-
const activatorElements = getCompoundComponents(
|
|
77
|
+
function useFilterPickerValidation(children) {
|
|
78
|
+
const optionElements = getCompoundComponents(FilterPickerOption, children);
|
|
79
|
+
const actionElements = getCompoundComponents(FilterPickerAction, children);
|
|
80
|
+
const activatorElements = getCompoundComponents(FilterPickerActivator, children);
|
|
81
81
|
return {
|
|
82
82
|
optionElements,
|
|
83
83
|
triggerElement: activatorElements[0],
|
|
@@ -93,18 +93,18 @@ function getCompoundComponents(type, children) {
|
|
|
93
93
|
return elements;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
function
|
|
97
|
-
const { optionElements, triggerElement, actionElements } =
|
|
96
|
+
function FilterPicker(props) {
|
|
97
|
+
const { optionElements, triggerElement, actionElements } = useFilterPickerValidation(props.children);
|
|
98
98
|
const options = useMemo(() => (optionElements === null || optionElements === void 0 ? void 0 : optionElements.map(option => (Object.assign({}, option.props)))) || [], [optionElements]);
|
|
99
|
-
const { selectedOptions, selectedStateSetter, shouldScroll, wrapperRef, searchValue, setSearchValue, open, handleClose, handleSelection, handleOpen, internalFilteredOptions, handleSearchChange, } =
|
|
100
|
-
return (React__default.createElement(
|
|
99
|
+
const { selectedOptions, selectedStateSetter, shouldScroll, wrapperRef, searchValue, setSearchValue, open, handleClose, handleSelection, handleOpen, internalFilteredOptions, handleSearchChange, } = useFilterPicker(props.selected, props.onSelect, options, props.onClose, props.multiSelect, props.onSearch, props.onSearchDebounce);
|
|
100
|
+
return (React__default.createElement(FilterPickerContextProvider, { selected: selectedOptions, selectionHandler: handleSelection, open: open, handleOpen: handleOpen, handleClose: handleClose, shouldScroll: shouldScroll, searchValue: searchValue, label: props.label, onClear: props.onClear, onSelectAll: props.onSelectAll },
|
|
101
101
|
React__default.createElement("div", { ref: wrapperRef, className: styles.wrapper },
|
|
102
|
-
open && (React__default.createElement("div", { className: styles.overlay, onClick: handleClose, "data-testid": "ATL-
|
|
103
|
-
triggerElement || (React__default.createElement(
|
|
104
|
-
React__default.createElement(
|
|
102
|
+
open && (React__default.createElement("div", { className: styles.overlay, onClick: handleClose, "data-testid": "ATL-FilterPicker-Overlay" })),
|
|
103
|
+
triggerElement || (React__default.createElement(FilterPickerTrigger, { label: props.label, selected: props.selected, activatorRef: props.defaultActivatorRef })),
|
|
104
|
+
React__default.createElement(FilterPickerContent, { multiselect: props.multiSelect, subjectNoun: props.subjectNoun, selected: selectedOptions, actionElements: actionElements, selectedStateSetter: selectedStateSetter, handleSelection: handleSelection, searchValue: searchValue, setSearchValue: setSearchValue, wrapperRef: wrapperRef, open: open, options: props.onSearch ? options : internalFilteredOptions, loading: props.loading, handleSearchChange: handleSearchChange, onLoadMore: props.onLoadMore }))));
|
|
105
105
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
FilterPicker.Activator = FilterPickerActivator;
|
|
107
|
+
FilterPicker.Action = FilterPickerAction;
|
|
108
|
+
FilterPicker.Option = FilterPickerOption;
|
|
109
109
|
|
|
110
|
-
export {
|
|
110
|
+
export { FilterPicker as F };
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var Typography = require('./Typography-cjs.js');
|
|
5
|
-
var
|
|
5
|
+
var FilterPickerProvider = require('./FilterPickerProvider-cjs.js');
|
|
6
6
|
|
|
7
|
-
var styles = {"actionContainer":"
|
|
7
|
+
var styles = {"actionContainer":"wnyB0d1ZE70-","actionButton":"mljM3ouZmbM-","spinning":"uMfMpnitRs0-"};
|
|
8
8
|
|
|
9
|
-
function
|
|
10
|
-
const { searchValue, handleClose } = React.useContext(
|
|
9
|
+
function FilterPickerAction(props) {
|
|
10
|
+
const { searchValue, handleClose } = React.useContext(FilterPickerProvider.FilterPickerContext);
|
|
11
11
|
if (props.visible !== undefined) {
|
|
12
12
|
const isVisible = typeof props.visible === "function"
|
|
13
13
|
? props.visible({ searchValue })
|
|
@@ -29,4 +29,4 @@ function ComboboxAction(props) {
|
|
|
29
29
|
React.createElement(Typography.Typography, { element: "span", size: "base", textColor: "interactive", fontWeight: "semiBold" }, computedLabel))));
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
exports.
|
|
32
|
+
exports.FilterPickerAction = FilterPickerAction;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React__default, { useContext } from 'react';
|
|
2
2
|
import { T as Typography } from './Typography-es.js';
|
|
3
|
-
import { a as
|
|
3
|
+
import { a as FilterPickerContext } from './FilterPickerProvider-es.js';
|
|
4
4
|
|
|
5
|
-
var styles = {"actionContainer":"
|
|
5
|
+
var styles = {"actionContainer":"wnyB0d1ZE70-","actionButton":"mljM3ouZmbM-","spinning":"uMfMpnitRs0-"};
|
|
6
6
|
|
|
7
|
-
function
|
|
8
|
-
const { searchValue, handleClose } = useContext(
|
|
7
|
+
function FilterPickerAction(props) {
|
|
8
|
+
const { searchValue, handleClose } = useContext(FilterPickerContext);
|
|
9
9
|
if (props.visible !== undefined) {
|
|
10
10
|
const isVisible = typeof props.visible === "function"
|
|
11
11
|
? props.visible({ searchValue })
|
|
@@ -27,4 +27,4 @@ function ComboboxAction(props) {
|
|
|
27
27
|
React__default.createElement(Typography, { element: "span", size: "base", textColor: "interactive", fontWeight: "semiBold" }, computedLabel))));
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
export {
|
|
30
|
+
export { FilterPickerAction as F };
|
|
@@ -6,22 +6,22 @@ require('classnames');
|
|
|
6
6
|
var Chip = require('./Chip-cjs.js');
|
|
7
7
|
require('./tslib.es6-cjs.js');
|
|
8
8
|
require('@jobber/design');
|
|
9
|
-
var
|
|
9
|
+
var FilterPickerProvider = require('./FilterPickerProvider-cjs.js');
|
|
10
10
|
var constants = require('./constants-cjs.js');
|
|
11
11
|
|
|
12
|
-
function
|
|
13
|
-
const { label, open } = React.useContext(
|
|
12
|
+
function useFilterPickerActivatorAccessibility() {
|
|
13
|
+
const { label, open } = React.useContext(FilterPickerProvider.FilterPickerContext);
|
|
14
14
|
return {
|
|
15
15
|
ariaLabel: label,
|
|
16
16
|
ariaExpanded: open,
|
|
17
|
-
ariaControls: constants.
|
|
17
|
+
ariaControls: constants.FILTER_PICKER_MENU_ID,
|
|
18
18
|
role: "combobox",
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
function
|
|
23
|
-
const { handleOpen } = React.useContext(
|
|
24
|
-
const accessibilityAttributes =
|
|
22
|
+
function FilterPickerActivator(props) {
|
|
23
|
+
const { handleOpen } = React.useContext(FilterPickerProvider.FilterPickerContext);
|
|
24
|
+
const accessibilityAttributes = useFilterPickerActivatorAccessibility();
|
|
25
25
|
if (React.isValidElement(props.children) &&
|
|
26
26
|
(props.children.type === Button.Button || props.children.type === Chip.Chip)) {
|
|
27
27
|
return React.cloneElement(props.children, {
|
|
@@ -35,4 +35,4 @@ function ComboboxActivator(props) {
|
|
|
35
35
|
return null;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
exports.
|
|
38
|
+
exports.FilterPickerActivator = FilterPickerActivator;
|
|
@@ -4,22 +4,22 @@ import 'classnames';
|
|
|
4
4
|
import { C as Chip } from './Chip-es.js';
|
|
5
5
|
import './tslib.es6-es.js';
|
|
6
6
|
import '@jobber/design';
|
|
7
|
-
import { a as
|
|
8
|
-
import {
|
|
7
|
+
import { a as FilterPickerContext } from './FilterPickerProvider-es.js';
|
|
8
|
+
import { F as FILTER_PICKER_MENU_ID } from './constants-es.js';
|
|
9
9
|
|
|
10
|
-
function
|
|
11
|
-
const { label, open } = useContext(
|
|
10
|
+
function useFilterPickerActivatorAccessibility() {
|
|
11
|
+
const { label, open } = useContext(FilterPickerContext);
|
|
12
12
|
return {
|
|
13
13
|
ariaLabel: label,
|
|
14
14
|
ariaExpanded: open,
|
|
15
|
-
ariaControls:
|
|
15
|
+
ariaControls: FILTER_PICKER_MENU_ID,
|
|
16
16
|
role: "combobox",
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
function
|
|
21
|
-
const { handleOpen } = React__default.useContext(
|
|
22
|
-
const accessibilityAttributes =
|
|
20
|
+
function FilterPickerActivator(props) {
|
|
21
|
+
const { handleOpen } = React__default.useContext(FilterPickerContext);
|
|
22
|
+
const accessibilityAttributes = useFilterPickerActivatorAccessibility();
|
|
23
23
|
if (React__default.isValidElement(props.children) &&
|
|
24
24
|
(props.children.type === Button || props.children.type === Chip)) {
|
|
25
25
|
return React__default.cloneElement(props.children, {
|
|
@@ -33,4 +33,4 @@ function ComboboxActivator(props) {
|
|
|
33
33
|
return null;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
export {
|
|
36
|
+
export { FilterPickerActivator as F };
|