react-magma-dom 4.13.1-next.0 → 4.14.0-next.2
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/components/Checkbox/index.d.ts +1 -1
- package/dist/components/Fieldset/Fieldset.d.ts +38 -0
- package/dist/components/Fieldset/index.d.ts +1 -0
- package/dist/components/IndeterminateCheckbox/index.d.ts +1 -1
- package/dist/components/TreeView/TreeViewConfigContext.d.ts +1 -0
- package/dist/components/TreeView/TreeViewSelectionContext.d.ts +5 -0
- package/dist/components/TreeView/useTreeItem.d.ts +1 -1
- package/dist/components/TreeView/useTreeView.d.ts +7 -1
- package/dist/esm/index.js +555 -315
- package/dist/esm/index.js.map +1 -1
- package/dist/i18n/interface.d.ts +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/properties.json +393 -129
- package/dist/react-magma-dom.cjs.development.js +545 -313
- package/dist/react-magma-dom.cjs.development.js.map +1 -1
- package/dist/react-magma-dom.cjs.production.min.js +1 -1
- package/dist/react-magma-dom.cjs.production.min.js.map +1 -1
- package/package.json +2 -2
|
@@ -95,4 +95,4 @@ export declare const StyledFakeInput: import("@emotion/styled").StyledComponent<
|
|
|
95
95
|
textPosition?: CheckboxTextPosition;
|
|
96
96
|
theme?: ThemeInterface;
|
|
97
97
|
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
98
|
-
export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement
|
|
98
|
+
export declare const Checkbox: React.MemoExoticComponent<React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface FieldsetCommonProps {
|
|
3
|
+
/**
|
|
4
|
+
* Element to render for the fieldset container.
|
|
5
|
+
* @default 'fieldset'
|
|
6
|
+
*/
|
|
7
|
+
as?: 'fieldset' | 'div';
|
|
8
|
+
/**
|
|
9
|
+
* @children required
|
|
10
|
+
*/
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
isInverse?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Visible accessible label for the group.
|
|
15
|
+
*/
|
|
16
|
+
legend: React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* ID for the legend element. If omitted, a stable ID is generated.
|
|
19
|
+
*/
|
|
20
|
+
legendId?: string;
|
|
21
|
+
/**
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
testId?: string;
|
|
25
|
+
/**
|
|
26
|
+
* When true, visually hides the legend but keeps it accessible to screen readers.
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
visuallyHiddenLegend?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface FieldsetAsFieldsetProps extends FieldsetCommonProps, Omit<React.FieldsetHTMLAttributes<HTMLFieldSetElement>, 'children'> {
|
|
32
|
+
as?: 'fieldset';
|
|
33
|
+
}
|
|
34
|
+
export interface FieldsetAsDivProps extends FieldsetCommonProps, Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
35
|
+
as: 'div';
|
|
36
|
+
}
|
|
37
|
+
export declare type FieldsetProps = FieldsetAsFieldsetProps | FieldsetAsDivProps;
|
|
38
|
+
export declare const Fieldset: React.ForwardRefExoticComponent<(FieldsetAsFieldsetProps & React.RefAttributes<HTMLFieldSetElement | HTMLDivElement>) | (FieldsetAsDivProps & React.RefAttributes<HTMLFieldSetElement | HTMLDivElement>)>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Fieldset';
|
|
@@ -21,4 +21,4 @@ export declare enum IndeterminateCheckboxStatus {
|
|
|
21
21
|
indeterminate = "indeterminate",
|
|
22
22
|
unchecked = "unchecked"
|
|
23
23
|
}
|
|
24
|
-
export declare const IndeterminateCheckbox: React.ForwardRefExoticComponent<IndeterminateCheckboxProps & React.RefAttributes<HTMLInputElement
|
|
24
|
+
export declare const IndeterminateCheckbox: React.MemoExoticComponent<React.ForwardRefExoticComponent<IndeterminateCheckboxProps & React.RefAttributes<HTMLInputElement>>>;
|
|
@@ -12,6 +12,7 @@ export interface TreeViewConfigContextInterface {
|
|
|
12
12
|
isTopLevelSelectable?: boolean;
|
|
13
13
|
selectParents?: boolean;
|
|
14
14
|
expandIconStyles?: ExpandIconInterface;
|
|
15
|
+
hasGuideLines?: boolean;
|
|
15
16
|
registerTreeItem: (itemRefArray: React.MutableRefObject<React.MutableRefObject<Element>[]>, itemRef: React.MutableRefObject<Element>) => void;
|
|
16
17
|
treeItemRefArray?: React.MutableRefObject<React.MutableRefObject<Element>[]>;
|
|
17
18
|
}
|
|
@@ -16,6 +16,11 @@ export interface TreeViewItemInterface {
|
|
|
16
16
|
}
|
|
17
17
|
export interface TreeViewSelectionContextInterface {
|
|
18
18
|
items: TreeViewItemInterface[];
|
|
19
|
+
/**
|
|
20
|
+
* O(1) item lookup map keyed by itemId. Built once per items update so
|
|
21
|
+
* TreeItem instances avoid an O(N) `items.find(...)` per render.
|
|
22
|
+
*/
|
|
23
|
+
itemsById: Map<string, TreeViewItemInterface>;
|
|
19
24
|
selectedItems: Array<TreeItemSelectedInterface>;
|
|
20
25
|
selectItem: (data: Pick<TreeViewItemInterface, 'itemId' | 'checkedStatus'>) => void;
|
|
21
26
|
onSelectedItemChange?: (selectedItems: Array<TreeItemSelectedInterface>) => void;
|
|
@@ -83,6 +83,6 @@ export declare function useTreeItem(props: UseTreeItemProps, forwardedRef: any):
|
|
|
83
83
|
treeItemChildren: (string | number | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any>) | (new (props: any) => React.Component<any, any, any>)> | Iterable<React.ReactNode> | React.ReactPortal)[];
|
|
84
84
|
isDisabled: boolean;
|
|
85
85
|
};
|
|
86
|
-
handleClick: (event:
|
|
86
|
+
handleClick: (event: React.SyntheticEvent | React.ChangeEvent, clickedItemId: string) => void;
|
|
87
87
|
handleKeyDown: (event: React.KeyboardEvent) => void;
|
|
88
88
|
};
|
|
@@ -106,6 +106,10 @@ export interface UseTreeViewProps {
|
|
|
106
106
|
* @internal
|
|
107
107
|
*/
|
|
108
108
|
testId?: string;
|
|
109
|
+
/**
|
|
110
|
+
* If true, TreeView will render guide lines for expanded items with children.
|
|
111
|
+
*/
|
|
112
|
+
hasGuideLines?: boolean;
|
|
109
113
|
}
|
|
110
114
|
interface ExpandIconStylesProps {
|
|
111
115
|
/**
|
|
@@ -121,6 +125,7 @@ interface ExpandIconStylesProps {
|
|
|
121
125
|
export declare function useTreeView(props: UseTreeViewProps): {
|
|
122
126
|
selectionContextValue: {
|
|
123
127
|
items: TreeViewItemInterface[];
|
|
128
|
+
itemsById: Map<string, TreeViewItemInterface>;
|
|
124
129
|
selectedItems: TreeViewItemInterface[];
|
|
125
130
|
selectItem: ({ itemId, checkedStatus, }: Pick<TreeViewItemInterface, 'itemId'> & Partial<Pick<TreeViewItemInterface, 'checkedStatus'>>) => void;
|
|
126
131
|
onSelectedItemChange: (selectedItems: TreeItemSelectedInterface[]) => void;
|
|
@@ -134,13 +139,14 @@ export declare function useTreeView(props: UseTreeViewProps): {
|
|
|
134
139
|
initialExpandedItems: any[];
|
|
135
140
|
};
|
|
136
141
|
configContextValue: {
|
|
137
|
-
hasIcons:
|
|
142
|
+
hasIcons: boolean;
|
|
138
143
|
selectable: TreeViewSelectable;
|
|
139
144
|
checkParents: boolean;
|
|
140
145
|
checkChildren: boolean;
|
|
141
146
|
isTopLevelSelectable: boolean;
|
|
142
147
|
selectParents: boolean;
|
|
143
148
|
expandIconStyles: ExpandIconStylesProps;
|
|
149
|
+
hasGuideLines: boolean;
|
|
144
150
|
registerTreeItem: (refArray: React.MutableRefObject<React.MutableRefObject<Element>[]>, ref: React.MutableRefObject<Element>) => void;
|
|
145
151
|
treeItemRefArray: React.MutableRefObject<React.MutableRefObject<Element>[]>;
|
|
146
152
|
};
|