@abgov/react-components 7.2.0-dev.21 → 7.2.0-dev.23
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/index.d.ts +1 -0
- package/index.js +80 -5
- package/index.js.map +1 -1
- package/index.mjs +80 -5
- package/index.mjs.map +1 -1
- package/lib/dropdown-multiselect/dropdown-multiselect.d.ts +66 -0
- package/lib/scroll-panel/scroll-panel.d.ts +9 -2
- package/package.json +1 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { GoabDropdownMultiselectLabelFormatOptions, GoabDropdownMultiselectOnChangeDetail, GoabDropdownMultiselectSize, GoabIconType, Margins } from '@abgov/ui-components-common';
|
|
2
|
+
import { JSX } from 'react';
|
|
3
|
+
interface WCProps extends Margins {
|
|
4
|
+
ref: React.RefObject<HTMLElement | null>;
|
|
5
|
+
name: string;
|
|
6
|
+
value?: string[];
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
disabled?: string;
|
|
9
|
+
error?: string;
|
|
10
|
+
filterable?: string;
|
|
11
|
+
"leading-icon"?: string;
|
|
12
|
+
testid?: string;
|
|
13
|
+
"aria-label"?: string;
|
|
14
|
+
"aria-labelledby"?: string;
|
|
15
|
+
"max-height"?: string;
|
|
16
|
+
width?: string;
|
|
17
|
+
size?: GoabDropdownMultiselectSize;
|
|
18
|
+
"label-format"?: string;
|
|
19
|
+
"show-select-all"?: string;
|
|
20
|
+
}
|
|
21
|
+
declare module "react" {
|
|
22
|
+
namespace JSX {
|
|
23
|
+
interface IntrinsicElements {
|
|
24
|
+
"goa-dropdown-multiselect": WCProps & React.HTMLAttributes<HTMLElement>;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export interface GoabDropdownMultiselectProps extends Margins {
|
|
29
|
+
/** @required Identifier for the group. Used in change events. */
|
|
30
|
+
name: string;
|
|
31
|
+
/** Array of currently selected checkbox value. */
|
|
32
|
+
value?: string[];
|
|
33
|
+
/** Text shown when nothing is selected. */
|
|
34
|
+
placeholder?: string;
|
|
35
|
+
/** Enables filtering of options by typing in the trigger. */
|
|
36
|
+
filterable?: boolean;
|
|
37
|
+
/** Icon shown to the left of the dropdown input. */
|
|
38
|
+
leadingIcon?: GoabIconType;
|
|
39
|
+
/** Disables the component. @default false */
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
/** Shows an error state. @default false */
|
|
42
|
+
error?: boolean;
|
|
43
|
+
/** Sets a data-testid attribute for automated testing. */
|
|
44
|
+
testId?: string;
|
|
45
|
+
/** Provides an accessible label when no visible label is associated. */
|
|
46
|
+
ariaLabel?: string;
|
|
47
|
+
/** References an external element that labels this component. */
|
|
48
|
+
ariaLabelledBy?: string;
|
|
49
|
+
/** Sets the maximum height of the dropdown content area. @default "276px" */
|
|
50
|
+
maxHeight?: string;
|
|
51
|
+
/** Sets a fixed width for the component and popover panel. */
|
|
52
|
+
width?: string;
|
|
53
|
+
/** Sets the size variant. @default "default" */
|
|
54
|
+
size?: GoabDropdownMultiselectSize;
|
|
55
|
+
/** The display label format of the closed dropdown. When 'count' the display label shows only "n items" in the label, when 'list' it shows a comma separated list of selected item labels. @default "list" */
|
|
56
|
+
labelFormat?: GoabDropdownMultiselectLabelFormatOptions;
|
|
57
|
+
/** Shows a "Select All" checkbox at the top of the options list. @default false */
|
|
58
|
+
showSelectAll?: boolean;
|
|
59
|
+
/** Dropdown items rendered inside the component (GoabDropdownItem elements). */
|
|
60
|
+
children?: React.ReactNode;
|
|
61
|
+
/** Callback fired when the selected value change. */
|
|
62
|
+
onChange?: (detail: GoabDropdownMultiselectOnChangeDetail) => void;
|
|
63
|
+
}
|
|
64
|
+
/** A dropdown that presents a list of checkboxes for multiple selection. */
|
|
65
|
+
export declare function GoabDropdownMultiselect({ name, value, placeholder, disabled, error, filterable, leadingIcon, showSelectAll, testId, ariaLabel, ariaLabelledBy, maxHeight, width, size, labelFormat, children, onChange, mt, mr, mb, ml, }: GoabDropdownMultiselectProps): JSX.Element;
|
|
66
|
+
export default GoabDropdownMultiselect;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { DataAttributes } from '@abgov/ui-components-common';
|
|
1
|
+
import { DataAttributes, GoabScrollPanelDirectionType } from '@abgov/ui-components-common';
|
|
2
2
|
import { default as React, ReactNode, JSX } from 'react';
|
|
3
3
|
interface WCProps {
|
|
4
4
|
height?: string;
|
|
5
5
|
testid?: string;
|
|
6
|
+
direction?: string;
|
|
6
7
|
}
|
|
7
8
|
declare module "react" {
|
|
8
9
|
namespace JSX {
|
|
@@ -27,6 +28,12 @@ export interface GoabScrollPanelProps extends DataAttributes {
|
|
|
27
28
|
height?: string;
|
|
28
29
|
/** Sets a data-testid attribute for automated testing. */
|
|
29
30
|
testId?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The scroll direction(s). When content overflows, enables scrolling and shadow
|
|
33
|
+
* indicators for the specified direction(s). Accepts "vertical", "horizontal", or "both".
|
|
34
|
+
* Defaults to "vertical".
|
|
35
|
+
*/
|
|
36
|
+
direction?: GoabScrollPanelDirectionType;
|
|
30
37
|
}
|
|
31
|
-
export declare function GoabScrollPanel({ header, children, footer, height, testId, ...rest }: GoabScrollPanelProps): JSX.Element;
|
|
38
|
+
export declare function GoabScrollPanel({ header, children, footer, height, testId, direction, ...rest }: GoabScrollPanelProps): JSX.Element;
|
|
32
39
|
export default GoabScrollPanel;
|