@elliemae/ds-menu 2.2.0-alpha.4 → 3.0.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/cjs/Menu.js +181 -137
- package/cjs/MenuCombobox.js +53 -67
- package/cjs/MenuContext.js +11 -38
- package/cjs/MenuItems/CheckboxGroup.js +42 -49
- package/cjs/MenuItems/MenuItem.js +163 -116
- package/cjs/MenuItems/MenuItemCheckable.js +108 -77
- package/cjs/MenuItems/MenuItemCheckbox.js +41 -47
- package/cjs/MenuItems/MenuItemRadio.js +38 -50
- package/cjs/MenuItems/RadioGroup.js +39 -48
- package/cjs/MenuItems/SearchableGroup.js +92 -88
- package/cjs/MenuItems/SearchableList.js +95 -92
- package/cjs/MenuItems/SelectionGroup.js +90 -85
- package/cjs/MenuItems/Separator.js +40 -55
- package/cjs/MenuItems/SubMenu.js +160 -143
- package/cjs/MenuItems/menuItemFactory.js +68 -38
- package/cjs/VirtualMenuList.js +39 -69
- package/cjs/index.js +36 -63
- package/cjs/utils/useHeightByAmountOfItems.js +14 -43
- package/esm/Menu.js +149 -91
- package/esm/MenuCombobox.js +45 -38
- package/esm/MenuContext.js +5 -9
- package/esm/MenuItems/CheckboxGroup.js +31 -19
- package/esm/MenuItems/MenuItem.js +148 -84
- package/esm/MenuItems/MenuItemCheckable.js +96 -47
- package/esm/MenuItems/MenuItemCheckbox.js +33 -18
- package/esm/MenuItems/MenuItemRadio.js +28 -20
- package/esm/MenuItems/RadioGroup.js +28 -18
- package/esm/MenuItems/SearchableGroup.js +76 -53
- package/esm/MenuItems/SearchableList.js +82 -59
- package/esm/MenuItems/SelectionGroup.js +78 -54
- package/esm/MenuItems/Separator.js +29 -26
- package/esm/MenuItems/SubMenu.js +140 -107
- package/esm/MenuItems/menuItemFactory.js +60 -10
- package/esm/VirtualMenuList.js +32 -39
- package/esm/index.js +13 -34
- package/esm/utils/useHeightByAmountOfItems.js +11 -13
- package/package.json +11 -19
- package/types/Menu.d.ts +2 -3
- package/types/MenuContext.d.ts +2 -3
- package/types/MenuItems/CheckboxGroup.d.ts +5 -5
- package/types/MenuItems/MenuItem.d.ts +5 -5
- package/types/MenuItems/MenuItemCheckable.d.ts +15 -15
- package/types/MenuItems/MenuItemCheckbox.d.ts +2 -3
- package/types/MenuItems/MenuItemRadio.d.ts +5 -5
- package/types/MenuItems/RadioGroup.d.ts +5 -5
- package/types/MenuItems/SearchableGroup.d.ts +3 -3
- package/types/MenuItems/SearchableList.d.ts +16 -16
- package/types/MenuItems/SelectionGroup.d.ts +16 -16
- package/types/MenuItems/Separator.d.ts +1 -2
- package/types/MenuItems/SubMenu.d.ts +18 -18
- package/types/MenuItems/menuItemFactory.d.ts +3 -2
- package/types/VirtualMenuList.d.ts +1 -3
- package/types/index.d.ts +2 -3
- package/types/utils/useHeightByAmountOfItems.d.ts +1 -3
- package/cjs/Menu.js.map +0 -7
- package/cjs/MenuCombobox.js.map +0 -7
- package/cjs/MenuContext.js.map +0 -7
- package/cjs/MenuExports.js +0 -28
- package/cjs/MenuExports.js.map +0 -7
- package/cjs/MenuItems/CheckboxGroup.js.map +0 -7
- package/cjs/MenuItems/MenuItem.js.map +0 -7
- package/cjs/MenuItems/MenuItemCheckable.js.map +0 -7
- package/cjs/MenuItems/MenuItemCheckbox.js.map +0 -7
- package/cjs/MenuItems/MenuItemRadio.js.map +0 -7
- package/cjs/MenuItems/RadioGroup.js.map +0 -7
- package/cjs/MenuItems/SearchableGroup.js.map +0 -7
- package/cjs/MenuItems/SearchableList.js.map +0 -7
- package/cjs/MenuItems/SelectionGroup.js.map +0 -7
- package/cjs/MenuItems/Separator.js.map +0 -7
- package/cjs/MenuItems/SubMenu.js.map +0 -7
- package/cjs/MenuItems/menuItemFactory.js.map +0 -7
- package/cjs/MenuItems/renderMenuItems.js +0 -53
- package/cjs/MenuItems/renderMenuItems.js.map +0 -7
- package/cjs/VirtualMenuList.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/utils/useHeightByAmountOfItems.js.map +0 -7
- package/esm/Menu.js.map +0 -7
- package/esm/MenuCombobox.js.map +0 -7
- package/esm/MenuContext.js.map +0 -7
- package/esm/MenuExports.js +0 -3
- package/esm/MenuExports.js.map +0 -7
- package/esm/MenuItems/CheckboxGroup.js.map +0 -7
- package/esm/MenuItems/MenuItem.js.map +0 -7
- package/esm/MenuItems/MenuItemCheckable.js.map +0 -7
- package/esm/MenuItems/MenuItemCheckbox.js.map +0 -7
- package/esm/MenuItems/MenuItemRadio.js.map +0 -7
- package/esm/MenuItems/RadioGroup.js.map +0 -7
- package/esm/MenuItems/SearchableGroup.js.map +0 -7
- package/esm/MenuItems/SearchableList.js.map +0 -7
- package/esm/MenuItems/SelectionGroup.js.map +0 -7
- package/esm/MenuItems/Separator.js.map +0 -7
- package/esm/MenuItems/SubMenu.js.map +0 -7
- package/esm/MenuItems/menuItemFactory.js.map +0 -7
- package/esm/MenuItems/renderMenuItems.js +0 -24
- package/esm/MenuItems/renderMenuItems.js.map +0 -7
- package/esm/VirtualMenuList.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/utils/useHeightByAmountOfItems.js.map +0 -7
- package/types/MenuExports.d.ts +0 -1
- package/types/MenuItems/renderMenuItems.d.ts +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference path="../../../../../shared/typings/react-desc.d.ts" />
|
|
2
2
|
/// <reference types="react" />
|
|
3
|
-
declare
|
|
4
|
-
|
|
5
|
-
propTypes: {
|
|
3
|
+
declare function MenuItem(props: any): JSX.Element;
|
|
4
|
+
declare namespace MenuItem {
|
|
5
|
+
var propTypes: {
|
|
6
6
|
/** Renders the MenuItem with a specific html element */
|
|
7
7
|
as: {
|
|
8
8
|
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
@@ -69,11 +69,11 @@ declare const MenuItem: {
|
|
|
69
69
|
isRequired: import("react-desc").PropTypesDescValue;
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
|
-
}
|
|
72
|
+
}
|
|
73
73
|
declare const DSMenuItemWithSchema: {
|
|
74
74
|
(props?: any): JSX.Element;
|
|
75
75
|
propTypes: unknown;
|
|
76
76
|
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
77
77
|
};
|
|
78
|
-
export { DSMenuItemWithSchema, MenuItem };
|
|
79
78
|
export default MenuItem;
|
|
79
|
+
export { DSMenuItemWithSchema };
|
|
@@ -12,18 +12,18 @@
|
|
|
12
12
|
* @param root0.leftAddon
|
|
13
13
|
* @param root0.item
|
|
14
14
|
*/
|
|
15
|
-
declare
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
propTypes: {
|
|
15
|
+
declare function MenuItemCheckable({ role, checked, name, checkIcon, children, leftAddon, item, ...otherProps }: {
|
|
16
|
+
[x: string]: any;
|
|
17
|
+
role?: string | undefined;
|
|
18
|
+
checked?: boolean | undefined;
|
|
19
|
+
name?: string | undefined;
|
|
20
|
+
checkIcon?: JSX.Element | undefined;
|
|
21
|
+
children: any;
|
|
22
|
+
leftAddon: any;
|
|
23
|
+
item?: undefined;
|
|
24
|
+
}): JSX.Element;
|
|
25
|
+
declare namespace MenuItemCheckable {
|
|
26
|
+
var propTypes: {
|
|
27
27
|
/** Whether the item is checked or not */
|
|
28
28
|
checked: {
|
|
29
29
|
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
@@ -67,7 +67,7 @@ declare const MenuItemCheckable: {
|
|
|
67
67
|
isRequired: import("react-desc").PropTypesDescValue;
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
|
-
}
|
|
70
|
+
}
|
|
71
71
|
declare const DSMenuItemCheckeableWithSchema: {
|
|
72
72
|
(props?: {
|
|
73
73
|
[x: string]: any;
|
|
@@ -80,7 +80,7 @@ declare const DSMenuItemCheckeableWithSchema: {
|
|
|
80
80
|
item?: undefined;
|
|
81
81
|
} | undefined): JSX.Element;
|
|
82
82
|
propTypes: unknown;
|
|
83
|
-
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
83
|
+
toTypescript: () => import("react-desc").TypescriptSchema; /** left addon component */
|
|
84
84
|
};
|
|
85
|
-
export { DSMenuItemCheckeableWithSchema, MenuItemCheckable };
|
|
86
85
|
export default MenuItemCheckable;
|
|
86
|
+
export { DSMenuItemCheckeableWithSchema };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare
|
|
2
|
+
declare function MenuItemCheckbox({ checked, ...rest }: {
|
|
3
3
|
[x: string]: any;
|
|
4
4
|
checked: any;
|
|
5
|
-
})
|
|
6
|
-
export { MenuItemCheckbox };
|
|
5
|
+
}): JSX.Element;
|
|
7
6
|
export default MenuItemCheckbox;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference path="../../../../../shared/typings/react-desc.d.ts" />
|
|
2
2
|
/// <reference types="react" />
|
|
3
|
-
declare
|
|
4
|
-
|
|
5
|
-
propTypes: {
|
|
3
|
+
declare function MenuItemRadio(props: any): JSX.Element;
|
|
4
|
+
declare namespace MenuItemRadio {
|
|
5
|
+
var propTypes: {
|
|
6
6
|
/** Whether the item is checked or not */
|
|
7
7
|
checked: {
|
|
8
8
|
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
@@ -18,7 +18,7 @@ declare const MenuItemRadio: {
|
|
|
18
18
|
isRequired: import("react-desc").PropTypesDescValue;
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
|
-
}
|
|
21
|
+
}
|
|
22
22
|
declare const DSMenuItemRadioWithSchema: {
|
|
23
23
|
(props?: {
|
|
24
24
|
[x: string]: any;
|
|
@@ -33,5 +33,5 @@ declare const DSMenuItemRadioWithSchema: {
|
|
|
33
33
|
propTypes: unknown;
|
|
34
34
|
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
35
35
|
};
|
|
36
|
-
export { DSMenuItemRadioWithSchema, MenuItemRadio };
|
|
37
36
|
export default MenuItemRadio;
|
|
37
|
+
export { DSMenuItemRadioWithSchema };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference path="../../../../../shared/typings/react-desc.d.ts" />
|
|
2
2
|
/// <reference types="react" />
|
|
3
|
-
declare
|
|
4
|
-
|
|
5
|
-
propTypes: {
|
|
3
|
+
declare function RadioGroup(props: any): JSX.Element;
|
|
4
|
+
declare namespace RadioGroup {
|
|
5
|
+
var propTypes: {
|
|
6
6
|
active: {
|
|
7
7
|
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
8
8
|
deprecated: import("react-desc").PropTypesDescValidator;
|
|
@@ -16,11 +16,11 @@ declare const RadioGroup: {
|
|
|
16
16
|
isRequired: import("react-desc").PropTypesDescValue;
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
-
}
|
|
19
|
+
}
|
|
20
20
|
declare const DSMenuRadioGroupWithSchema: {
|
|
21
21
|
(props?: any): JSX.Element;
|
|
22
22
|
propTypes: unknown;
|
|
23
23
|
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
24
24
|
};
|
|
25
|
-
export { DSMenuRadioGroupWithSchema, RadioGroup };
|
|
26
25
|
export default RadioGroup;
|
|
26
|
+
export { DSMenuRadioGroupWithSchema };
|
|
@@ -13,6 +13,6 @@ declare const DSMenuSearchableGroupWithSchema: {
|
|
|
13
13
|
propTypes: unknown;
|
|
14
14
|
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
15
15
|
};
|
|
16
|
-
declare const
|
|
17
|
-
export
|
|
18
|
-
export
|
|
16
|
+
declare const _default: any;
|
|
17
|
+
export default _default;
|
|
18
|
+
export { DSMenuSearchableGroupWithSchema };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/// <reference path="../../../../../shared/typings/react-desc.d.ts" />
|
|
2
2
|
/// <reference types="react" />
|
|
3
|
-
declare
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
propTypes: {
|
|
3
|
+
declare function SearchableList({ onSelectMenuItem, components, searchTerm: searchTermProp, items, dropdownFilterOptions, returnValue, extraListProps, appendTermInList, maxOptions, loading, }: {
|
|
4
|
+
onSelectMenuItem?: (() => void) | undefined;
|
|
5
|
+
components?: {} | undefined;
|
|
6
|
+
searchTerm?: string | undefined;
|
|
7
|
+
items?: never[] | undefined;
|
|
8
|
+
dropdownFilterOptions?: {} | undefined;
|
|
9
|
+
returnValue: any;
|
|
10
|
+
extraListProps?: {} | undefined;
|
|
11
|
+
appendTermInList?: boolean | undefined;
|
|
12
|
+
maxOptions?: number | undefined;
|
|
13
|
+
loading?: boolean | undefined;
|
|
14
|
+
}): JSX.Element;
|
|
15
|
+
declare namespace SearchableList {
|
|
16
|
+
var propTypes: {
|
|
17
17
|
/** callback after item gets selected */
|
|
18
18
|
onSelectMenuItem: {
|
|
19
19
|
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
@@ -85,7 +85,7 @@ declare const SearchableList: {
|
|
|
85
85
|
isRequired: import("react-desc").PropTypesDescValue;
|
|
86
86
|
};
|
|
87
87
|
};
|
|
88
|
-
}
|
|
88
|
+
}
|
|
89
89
|
declare const DSMenuSearchableListWithSchema: {
|
|
90
90
|
(props?: {
|
|
91
91
|
onSelectMenuItem?: (() => void) | undefined;
|
|
@@ -102,5 +102,5 @@ declare const DSMenuSearchableListWithSchema: {
|
|
|
102
102
|
propTypes: unknown;
|
|
103
103
|
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
104
104
|
};
|
|
105
|
-
export { DSMenuSearchableListWithSchema, SearchableList };
|
|
106
105
|
export default SearchableList;
|
|
106
|
+
export { DSMenuSearchableListWithSchema };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/// <reference path="../../../../../shared/typings/react-desc.d.ts" />
|
|
2
2
|
/// <reference types="react" />
|
|
3
|
-
declare
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
propTypes: {
|
|
3
|
+
declare function SelectionGroup({ multi, searchable, focusOnOpen, onSelect, children, items, active, width, height, maxOptions, }: {
|
|
4
|
+
multi?: boolean | undefined;
|
|
5
|
+
searchable?: boolean | undefined;
|
|
6
|
+
focusOnOpen?: boolean | undefined;
|
|
7
|
+
onSelect?: (() => null) | undefined;
|
|
8
|
+
children: any;
|
|
9
|
+
items?: undefined;
|
|
10
|
+
active?: string | never[] | undefined;
|
|
11
|
+
width: any;
|
|
12
|
+
height: any;
|
|
13
|
+
maxOptions?: number | undefined;
|
|
14
|
+
}): JSX.Element;
|
|
15
|
+
declare namespace SelectionGroup {
|
|
16
|
+
var propTypes: {
|
|
17
17
|
/** toggle on multi select */
|
|
18
18
|
multi: {
|
|
19
19
|
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
@@ -77,7 +77,7 @@ declare const SelectionGroup: {
|
|
|
77
77
|
isRequired: import("react-desc").PropTypesDescValue;
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
|
-
}
|
|
80
|
+
}
|
|
81
81
|
declare const DSMenuSelectionGroupWithSchema: {
|
|
82
82
|
(props?: {
|
|
83
83
|
multi?: boolean | undefined;
|
|
@@ -94,5 +94,5 @@ declare const DSMenuSelectionGroupWithSchema: {
|
|
|
94
94
|
propTypes: unknown;
|
|
95
95
|
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
96
96
|
};
|
|
97
|
-
export { DSMenuSelectionGroupWithSchema, SelectionGroup };
|
|
98
97
|
export default SelectionGroup;
|
|
98
|
+
export { DSMenuSelectionGroupWithSchema };
|
|
@@ -11,7 +11,6 @@ declare const MenuSeparator: {
|
|
|
11
11
|
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
12
12
|
deprecated: import("react-desc").PropTypesDescValidator;
|
|
13
13
|
};
|
|
14
|
-
/** toggle separator on and off */
|
|
15
14
|
isRequired: import("react-desc").PropTypesDescValue;
|
|
16
15
|
};
|
|
17
16
|
/** toggle separator on and off */
|
|
@@ -31,5 +30,5 @@ declare const DSMenuSeparatorWithSchema: {
|
|
|
31
30
|
propTypes: unknown;
|
|
32
31
|
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
33
32
|
};
|
|
34
|
-
export { DSMenuSeparatorWithSchema, MenuSeparator };
|
|
35
33
|
export default MenuSeparator;
|
|
34
|
+
export { DSMenuSeparatorWithSchema };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/// <reference path="../../../../../shared/typings/react-desc.d.ts" />
|
|
2
2
|
/// <reference types="react" />
|
|
3
|
-
declare
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
propTypes: {
|
|
3
|
+
declare function SubMenu({ noAddon, leftAddon, label, interactionType, children: subitems, rightAddonType, disabledAddonInactive, checkableProps, customRenderer, onClick, closeMenu, id, }: {
|
|
4
|
+
noAddon: any;
|
|
5
|
+
leftAddon?: undefined;
|
|
6
|
+
label?: undefined;
|
|
7
|
+
interactionType?: string | undefined;
|
|
8
|
+
children: any;
|
|
9
|
+
rightAddonType: any;
|
|
10
|
+
disabledAddonInactive: any;
|
|
11
|
+
checkableProps?: {} | undefined;
|
|
12
|
+
customRenderer: any;
|
|
13
|
+
onClick: any;
|
|
14
|
+
closeMenu: any;
|
|
15
|
+
id: any;
|
|
16
|
+
}): JSX.Element;
|
|
17
|
+
declare namespace SubMenu {
|
|
18
|
+
var propTypes: {
|
|
19
19
|
/** dont show addon for submenu */
|
|
20
20
|
noAddon: {
|
|
21
21
|
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
@@ -99,7 +99,7 @@ declare const SubMenu: {
|
|
|
99
99
|
isRequired: import("react-desc").PropTypesDescValue;
|
|
100
100
|
};
|
|
101
101
|
};
|
|
102
|
-
}
|
|
102
|
+
}
|
|
103
103
|
declare const DSSubMenuWithSchema: {
|
|
104
104
|
(props?: {
|
|
105
105
|
noAddon: any;
|
|
@@ -118,5 +118,5 @@ declare const DSSubMenuWithSchema: {
|
|
|
118
118
|
propTypes: unknown;
|
|
119
119
|
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
120
120
|
};
|
|
121
|
-
export { DSSubMenuWithSchema, SubMenu };
|
|
122
121
|
export default SubMenu;
|
|
122
|
+
export { DSSubMenuWithSchema };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare
|
|
1
|
+
import MenuItem from './MenuItem';
|
|
2
|
+
export declare function menuItemFactory(type: string | undefined, items: any, defaultItem?: typeof MenuItem): any;
|
|
3
|
+
export declare function renderMenuItems(options: any, factory?: typeof menuItemFactory): any;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
export default function VirtualMenuList({ items, itemHeight, amountItemsInWindow, width, height, }: {
|
|
3
3
|
items: any;
|
|
4
4
|
itemHeight?: number | undefined;
|
|
5
5
|
amountItemsInWindow?: number | undefined;
|
|
6
6
|
width: any;
|
|
7
7
|
height: any;
|
|
8
8
|
}): JSX.Element;
|
|
9
|
-
export { VirtualMenuList };
|
|
10
|
-
export default VirtualMenuList;
|
package/types/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './Menu';
|
|
1
2
|
export { DSMenuItemWithSchema } from './MenuItems/MenuItem';
|
|
2
3
|
export { DSSubMenuWithSchema } from './MenuItems/SubMenu';
|
|
3
4
|
export { DSMenuCheckboxGroupWithSchema } from './MenuItems/CheckboxGroup';
|
|
@@ -9,6 +10,4 @@ export { DSMenuSearchableListWithSchema } from './MenuItems/SearchableList';
|
|
|
9
10
|
export { DSMenuSeparatorWithSchema } from './MenuItems/Separator';
|
|
10
11
|
export { DSMenuSelectionGroupWithSchema } from './MenuItems/SelectionGroup';
|
|
11
12
|
export { default as MenuCombobox } from './MenuCombobox';
|
|
12
|
-
export {
|
|
13
|
-
export { renderMenuItems } from './MenuItems/renderMenuItems';
|
|
14
|
-
export { DSMenuWithSchema, Menu, Menu as default } from './Menu';
|
|
13
|
+
export { default } from './Menu';
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
export default function useHeightByAmountOfItems({ itemHeight, amountItems, items, }: {
|
|
2
2
|
itemHeight: any;
|
|
3
3
|
amountItems: any;
|
|
4
4
|
items: any;
|
|
5
5
|
}): number;
|
|
6
|
-
export { useHeightByAmountOfItems };
|
|
7
|
-
export default useHeightByAmountOfItems;
|
package/cjs/Menu.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/Menu.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react/prop-types */\n/* eslint-disable import/no-cycle */\nimport React, { useContext, useEffect, useMemo, useRef } from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport { omit } from 'lodash';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { animated } from 'react-spring/web';\nimport { useOnClickOutside } from '@elliemae/ds-utilities/hooks';\nimport { mergeRefs } from '@elliemae/ds-utilities/system';\nimport { focusGroupManagerHoc, FocusGroupContext } from '@elliemae/ds-shared/FocusGroup';\nimport { useHiddenTransition } from '@elliemae/ds-hidden';\nimport { MenuItemRadio } from './MenuItems/MenuItemRadio';\nimport { MenuItemCheckbox } from './MenuItems/MenuItemCheckbox';\nimport { CheckboxGroup } from './MenuItems/CheckboxGroup';\nimport { RadioGroup } from './MenuItems/RadioGroup';\nimport { MenuSeparator } from './MenuItems/Separator';\nimport { MenuItem } from './MenuItems/MenuItem';\nimport { SubMenu } from './MenuItems/SubMenu';\nimport { SearchableGroup } from './MenuItems/SearchableGroup';\nimport { SelectionGroup } from './MenuItems/SelectionGroup';\nimport { menuItemFactory } from './MenuItems/menuItemFactory';\nimport { renderMenuItems } from './MenuItems/renderMenuItems';\nimport { MenuContext } from './MenuContext';\n\nconst RESPONSIVE_HEIHGT_MARGIN = 120;\n\nconst blockName = 'menu';\n\nconst noop = () => {};\n\nconst MenuComponent = aggregatedClasses('div')(blockName, '', ({ menuComboBox, type }) => ({\n 'menu-combo-box': menuComboBox,\n [`type-${type}`]: type,\n}));\n\n/**\n * todo: -- IDEA -- each menu could have an overlay based on an overlay stack context so we can\n * capture the context of the clicks on very nested components\n */\n\nconst isChildOfType = (child, type) => child.type.name === type;\n\nconst DSMenu = ({\n containerProps = {},\n innerRef,\n as: MenuTag = animated.ul,\n children = undefined,\n onClickOutside = noop,\n // handlers from hidden\n visible = undefined,\n focusOnOpen = false,\n maxOption = 0,\n style = {},\n minWidth = undefined,\n maxWidth = undefined,\n closeMenu,\n responsiveHeight = false,\n ...otherProps\n}) => {\n const menuRef = useRef(null);\n const { focusFirst } = useContext(FocusGroupContext);\n const { destroyed, ...hiddenProps } = useHiddenTransition({ visible, style });\n\n // force no addon to the children if the menu doesn't have any item with leftAddon like SelectionGroup\n const nextChildren = useMemo(() => {\n const forceLeftAddon = React.Children.toArray(children).some(\n (child) =>\n isChildOfType(child, 'SelectionGroup') ||\n isChildOfType(child, 'MenuItemCheckbox') ||\n isChildOfType(child, 'MenuItemRadio') ||\n child.props.leftAddon,\n );\n\n return React.Children.map(\n children,\n (child) =>\n child &&\n React.cloneElement(child, {\n ...child.props,\n noAddon: !forceLeftAddon ? true : undefined,\n maxOption,\n closeMenu,\n }),\n );\n }, [children]);\n\n useOnClickOutside(menuRef, onClickOutside);\n\n useEffect(() => {\n if (focusOnOpen && visible) {\n setTimeout(() => {\n focusFirst();\n }, 0);\n }\n }, [visible, focusOnOpen]);\n // todo: find out a better approach to this\n return !hiddenProps.destroyed ? (\n <MenuContext.Provider value={{ visible, closeMenu }}>\n <MenuComponent\n data-testid={containerProps?.['data-testid'] ? containerProps['data-testid'] : 'em-ds-menu'}\n {...containerProps}\n as={MenuTag}\n classProps={{ ...(otherProps.classProps || {}), type: otherProps.type }}\n innerRef={mergeRefs(innerRef, menuRef)}\n role=\"menu\"\n {...omit(otherProps, ['scheduleUpdate'])}\n {...hiddenProps}\n >\n {/* eslint-disable indent */}\n <div\n className=\"menu-component-internal-wrapper\"\n style={{\n ...style,\n minWidth,\n maxWidth,\n ...(responsiveHeight\n ? {\n overflowY: 'scroll',\n maxHeight: responsiveHeight ? `${window.innerHeight - RESPONSIVE_HEIHGT_MARGIN}px` : undefined,\n }\n : {}),\n }}\n >\n {/* eslint-enable indent */}\n {nextChildren}\n </div>\n </MenuComponent>\n </MenuContext.Provider>\n ) : null;\n};\n\nconst Menu = focusGroupManagerHoc(DSMenu, { loop: true });\n\nconst props = {\n /** Injected props to wrapper element of component */\n containerProps: PropTypes.object.description('Injected props to wrapper element of component'),\n /** Renders the menu with a specific html element */\n as: PropTypes.element.description('Renders the menu with a specific html element'),\n /** Handler when a user clicks outside the menu */\n onClickOutside: PropTypes.func.description('Handler when a user clicks outside the menu'),\n /** Whether the menu is visible or not */\n visible: PropTypes.bool.description('Whether the menu is visible or not'),\n /** When set to true, it's going to focus the first item */\n focusOnOpen: PropTypes.bool.description(\"When set to true, it's going to focus the first item\"),\n /** Customize menu minWidth. Can be undefined or 'number' */\n minWidth: PropTypes.number.description(\"Customize menu minWidth. Can be undefined or 'number'\"),\n /** Customize menu maxWidth. Can be undefined or 'number' */\n maxWidth: PropTypes.number.description(\"Customize menu maxWidth. Can be undefined or 'number'\"),\n};\n\nDSMenu.propTypes = props;\n\nconst DSMenuWithSchema = describe(DSMenu);\n\nDSMenuWithSchema.propTypes = props;\n// todo: add a handler to get this kind of exports for documentation\nMenu.Item = MenuItem;\nMenu.ItemCheckbox = MenuItemCheckbox;\nMenu.ItemRadio = MenuItemRadio;\nMenu.SubMenu = SubMenu;\nMenu.Separator = MenuSeparator;\nMenu.CheckboxGroup = CheckboxGroup;\nMenu.RadioGroup = RadioGroup;\nMenu.SearchableGroup = SearchableGroup;\nMenu.SelectionGroup = SelectionGroup;\n\nexport { menuItemFactory, renderMenuItems, DSMenuWithSchema, Menu };\nexport default Menu;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAA8D;AAC9D,wBAAoC;AACpC,oBAAqB;AACrB,2BAAkC;AAClC,iBAAyB;AACzB,mBAAkC;AAClC,oBAA0B;AAC1B,wBAAwD;AACxD,uBAAoC;AACpC,2BAA8B;AAC9B,8BAAiC;AACjC,2BAA8B;AAC9B,wBAA2B;AAC3B,uBAA8B;AAC9B,sBAAyB;AACzB,qBAAwB;AACxB,6BAAgC;AAChC,4BAA+B;AAC/B,6BAAgC;AAChC,6BAAgC;AAChC,yBAA4B;AAE5B,MAAM,2BAA2B;AAEjC,MAAM,YAAY;AAElB,MAAM,OAAO,MAAM;AAAA;AAEnB,MAAM,gBAAgB,4CAAkB,OAAO,WAAW,IAAI,CAAC,EAAE,cAAc,WAAY;AAAA,EACzF,kBAAkB;AAAA,GACjB,QAAQ,SAAS;AAAA;AAQpB,MAAM,gBAAgB,CAAC,OAAO,SAAS,MAAM,KAAK,SAAS;AAE3D,MAAM,SAAS,CAAC;AAAA,EACd,iBAAiB;AAAA,EACjB;AAAA,EACA,IAAI,UAAU,oBAAS;AAAA,EACvB,WAAW;AAAA,EACX,iBAAiB;AAAA,EAEjB,UAAU;AAAA,EACV,cAAc;AAAA,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AAA,KAIL,kBAIL;AAAA;AAGN,MAAM,OAAO,4CAAqB,QAAQ,EAAE,MAAM;AAElD,MAAM,QAAQ;AAAA,EAEZ,gBAAgB,4BAAU,OAAO,YAAY;AAAA,EAE7C,IAAI,4BAAU,QAAQ,YAAY;AAAA,EAElC,gBAAgB,4BAAU,KAAK,YAAY;AAAA,EAE3C,SAAS,4BAAU,KAAK,YAAY;AAAA,EAEpC,aAAa,4BAAU,KAAK,YAAY;AAAA,EAExC,UAAU,4BAAU,OAAO,YAAY;AAAA,EAEvC,UAAU,4BAAU,OAAO,YAAY;AAAA;AAGzC,OAAO,YAAY;AAEnB,MAAM,mBAAmB,gCAAS;AAElC,iBAAiB,YAAY;AAE7B,KAAK,OAAO;AACZ,KAAK,eAAe;AACpB,KAAK,YAAY;AACjB,KAAK,UAAU;AACf,KAAK,YAAY;AACjB,KAAK,gBAAgB;AACrB,KAAK,aAAa;AAClB,KAAK,kBAAkB;AACvB,KAAK,iBAAiB;AAGtB,IAAO,eAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/cjs/MenuCombobox.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/MenuCombobox.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { SearchableList } from './MenuItems/SearchableList';\nimport { Menu } from './Menu';\n\nfunction MenuCombobox({\n dropdownFilterOptions = {},\n options = [],\n onSelectMenuItem = () => null,\n innerRef,\n maxOptions = 10,\n loading = false,\n ...rest\n}) {\n return (\n <Menu\n {...rest}\n classProps={{ menuComboBox: true }}\n innerRef={innerRef}\n visible\n >\n <SearchableList\n appendTermInList\n extraListProps={dropdownFilterOptions}\n items={options}\n onSelectMenuItem={onSelectMenuItem}\n maxOptions={maxOptions}\n loading={loading}\n />\n </Menu>\n );\n}\n\nMenuCombobox.propTypes = {\n /** Options */\n dropdownFilterOptions: PropTypes.shape({}),\n /** The option or menu items to render */\n options: PropTypes.arrayOf(PropTypes.object),\n /** Handler when a menu item is selected */\n onSelectMenuItem: PropTypes.func,\n /** Internal ref */\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n /** Max options to display in the list */\n maxOptions: PropTypes.number,\n /** Is loading */\n loading: PropTypes.bool,\n};\n\nexport default MenuCombobox;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,wBAAsB;AACtB,4BAA+B;AAC/B,kBAAqB;AAErB,sBAAsB;AAAA,EACpB,wBAAwB;AAAA,EACxB,UAAU;AAAA,EACV,mBAAmB,MAAM;AAAA,EACzB;AAAA,EACA,aAAa;AAAA,EACb,UAAU;AAAA,KACP;AAAA,GACF;AACD,SACE,mDAAC,kBAAD;AAAA,OACM;AAAA,IACJ,YAAY,EAAE,cAAc;AAAA,IAC5B;AAAA,IACA,SAAO;AAAA,KAEP,mDAAC,sCAAD;AAAA,IACE,kBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAMR,aAAa,YAAY;AAAA,EAEvB,uBAAuB,0BAAU,MAAM;AAAA,EAEvC,SAAS,0BAAU,QAAQ,0BAAU;AAAA,EAErC,kBAAkB,0BAAU;AAAA,EAE5B,UAAU,0BAAU,UAAU,CAAC,0BAAU,MAAM,0BAAU;AAAA,EAEzD,YAAY,0BAAU;AAAA,EAEtB,SAAS,0BAAU;AAAA;AAGrB,IAAO,uBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/cjs/MenuContext.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/MenuContext.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\n\nconst MenuContext = React.createContext();\nexport { MenuContext };\nexport default MenuContext;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAElB,MAAM,cAAc,qBAAM;AAE1B,IAAO,sBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/cjs/MenuExports.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
9
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(module2))
|
|
11
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
12
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return target;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (module2, isNodeMode) => {
|
|
17
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
-
return (module2, temp) => {
|
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
-
};
|
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
24
|
-
var MenuExports_exports = {};
|
|
25
|
-
var React = __toESM(require("react"));
|
|
26
|
-
__reExport(MenuExports_exports, require("./Menu"));
|
|
27
|
-
module.exports = __toCommonJS(MenuExports_exports);
|
|
28
|
-
//# sourceMappingURL=MenuExports.js.map
|
package/cjs/MenuExports.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/MenuExports.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export * from './Menu';", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA,YAAuB;ADAvB,gCAAc;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/MenuItems/CheckboxGroup.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport { CheckableGroup } from '@elliemae/ds-shared/CheckableGroup';\n\nconst CheckboxGroup = (props) => <CheckableGroup {...props} multi />;\n\nconst props = {\n /* The item (if multi false) or items (if multi true) selected */\n active: PropTypes.arrayOf(PropTypes.string).description(\n 'The item (if multi false) or items (if multi true) selected',\n ),\n /* Whether is multi select or not */\n multi: PropTypes.bool.description('Whether is multi select or not'),\n /* Handler when a user checks an item */\n onCheck: PropTypes.func.description('Handler when a user checks an item'),\n};\n\nCheckboxGroup.propTypes = props;\n\nconst DSMenuCheckboxGroupWithSchema = describe(CheckboxGroup);\nDSMenuCheckboxGroupWithSchema.propTypes = props;\n\nexport { DSMenuCheckboxGroupWithSchema, CheckboxGroup };\nexport default CheckboxGroup;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,wBAAoC;AACpC,4BAA+B;AAE/B,MAAM,gBAAgB,CAAC,WAAU,mDAAC,sCAAD;AAAA,KAAoB;AAAA,EAAO,OAAK;AAAA;AAEjE,MAAM,QAAQ;AAAA,EAEZ,QAAQ,4BAAU,QAAQ,4BAAU,QAAQ,YAC1C;AAAA,EAGF,OAAO,4BAAU,KAAK,YAAY;AAAA,EAElC,SAAS,4BAAU,KAAK,YAAY;AAAA;AAGtC,cAAc,YAAY;AAE1B,MAAM,gCAAgC,gCAAS;AAC/C,8BAA8B,YAAY;AAG1C,IAAO,wBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/MenuItems/MenuItem.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable import/no-cycle */\nimport React, { useRef, useMemo, useContext } from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport { omit } from 'lodash';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { mergeRefs, runAll } from '@elliemae/ds-utilities';\nimport { useFocusGroupItem } from '@elliemae/ds-shared/FocusGroup';\nimport { DSTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { MenuContext } from '../MenuContext';\nimport { registerMenuItem } from './menuItemFactory';\nimport { renderMenuItems } from './renderMenuItems';\n\nconst noop = () => null;\n\nconst blockName = 'menu-item';\n\nconst Content = aggregatedClasses('div')(blockName, 'content');\nconst Addon = aggregatedClasses('div')(blockName, 'addon', ({ empty, fixedItem }) => ({ empty, fixedItem }));\n\nconst renderAddon = (addon, fixedItem, addonId) => (\n <Addon key={addonId} classProps={{ fixedItem }}>\n {addon}\n </Addon>\n);\n\nconst renderAddons = (addons, fixedItem) =>\n Array.isArray(addons) ? addons.map(renderAddon) : renderAddon(addons, fixedItem);\n\nconst Wrapper = aggregatedClasses('li')(\n blockName,\n null,\n ({ disabled, disabledAddonInactive, customRenderer, fixedItem, type }) => ({\n disabled,\n disabledAddonInactive,\n customRenderer,\n fixedItem,\n [`menu-type-${type}`]: type,\n }),\n);\nconst calculateSize = (length = 0) => {\n if (length > 45) return 45 * 7;\n return length * 7;\n};\n\nconst MenuItem = (props) => {\n const {\n innerRef,\n as = 'li',\n role = 'menuitem',\n leftAddon = null,\n rightAddon = undefined,\n disabledAddonInactive = undefined,\n label = undefined,\n children,\n tabIndex = -1,\n onKeyDown = noop,\n fixedItem = false,\n noAddon,\n disabled = false,\n customRenderer,\n maxOption,\n closeMenu,\n style,\n ...otherProps\n } = props;\n\n const menuCxt = useContext(MenuContext);\n const ref = useRef(null);\n useFocusGroupItem(ref);\n if (otherProps.subItems) {\n return (\n <SubMenu {...props} closeMenu={menuCxt.closeMenu}>\n {renderMenuItems(otherProps.subItems)}\n </SubMenu>\n );\n }\n\n const wrapperProps = useMemo(() => omit(otherProps, ['icon']), [otherProps]);\n\n const onClick = (...args) => {\n if (wrapperProps.onClick) wrapperProps.onClick(...args);\n if (wrapperProps.closeOnClick && menuCxt.closeMenu) {\n menuCxt.closeMenu(...args);\n }\n };\n\n return (\n <Wrapper\n as={as}\n classProps={{\n disabled,\n disabledAddonInactive,\n customRenderer,\n fixedItem,\n type: otherProps.type,\n }}\n id={otherProps.id}\n innerRef={otherProps.type !== 'disabled' ? mergeRefs(innerRef, ref) : innerRef}\n onKeyDown={\n !fixedItem &&\n runAll((e) => {\n if (e.key === ' ' || e.key === 'Enter') {\n e.preventDefault();\n e.target.dispatchEvent(\n new MouseEvent('click', {\n view: window,\n bubbles: true,\n cancelable: false,\n }),\n );\n }\n }, onKeyDown)\n }\n role={role}\n style={style}\n tabIndex={tabIndex}\n {...wrapperProps}\n onClick={onClick}\n >\n {!noAddon && renderAddons(leftAddon, fixedItem)}\n {label && (\n <Content\n style={\n maxOption > 0\n ? {\n width: `${calculateSize(maxOption)}px`,\n maxWidth: `${calculateSize(maxOption)}px`,\n }\n : undefined\n }\n >\n <DSTruncatedTooltipText value={label} />\n </Content>\n )}\n {customRenderer}\n {rightAddon && renderAddons(rightAddon)}\n {children}\n </Wrapper>\n );\n};\n\nconst props = {\n /** Renders the MenuItem with a specific html element */\n as: PropTypes.element.description('Renders the MenuItem with a specific html element'),\n /**\n * reference to the component\n */\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]).description(\n 'reference to the component',\n ),\n /** Renders the passed element to the left */\n leftAddon: PropTypes.element.description('Renders the passed element to the left'),\n /** Renders the passed element to the right */\n rightAddon: PropTypes.element.description('Renders the passed element to the right'),\n /** Label for the menu item */\n label: PropTypes.string.description('Label for the menu item'),\n /** style object for menu item wrapper */\n style: PropTypes.object.description('style object for menu item wrapper'),\n /** disable menu item */\n disabled: PropTypes.bool.description('disable menu item'),\n /** HTML tabindex to manage focus order */\n tabindex: PropTypes.number.description('HTML tabindex to manage focus order'),\n /** a11y role */\n role: PropTypes.string.description('a11y role'),\n};\n\nMenuItem.propTypes = props;\nregisterMenuItem('menuitem', MenuItem);\n\nconst DSMenuItemWithSchema = describe(MenuItem);\nDSMenuItemWithSchema.propTypes = props;\n\nexport { DSMenuItemWithSchema, MenuItem };\nexport default MenuItem;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAAmD;AACnD,wBAAoC;AACpC,oBAAqB;AACrB,2BAAkC;AAClC,0BAAkC;AAClC,wBAAkC;AAClC,u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pC,UAAU,4BAAU,KAAK,YAAY;AAAA,EAErC,UAAU,4BAAU,OAAO,YAAY;AAAA,EAEvC,MAAM,4BAAU,OAAO,YAAY;AAAA;AAGrC,SAAS,YAAY;AACrB,6CAAiB,YAAY;AAE7B,MAAM,uBAAuB,gCAAS;AACtC,qBAAqB,YAAY;AAGjC,IAAO,mBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/MenuItems/MenuItemCheckable.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable import/no-cycle */\nimport React from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport { Checkmark } from '@elliemae/ds-icons';\nimport { runAll } from '@elliemae/ds-utilities';\nimport { MenuItem } from './MenuItem';\n\n// TODO: where to move this?\nfunction useCheckable({ checked }) {\n return {\n checked,\n 'aria-checked': checked,\n };\n}\n\n/**\n * Reuses the same props as the MenuItem\n *\n * @param root0\n * @param root0.role\n * @param root0.checked\n * @param root0.name\n * @param root0.checkIcon\n * @param root0.children\n * @param root0.leftAddon\n * @param root0.item\n */\nconst MenuItemCheckable = ({\n role = 'menuitemcheckbox',\n checked = false,\n name = '',\n checkIcon = <Checkmark color={['brand-primary', 600]} />,\n // eslint-disable-next-line react/prop-types\n children,\n leftAddon,\n item = undefined,\n ...otherProps\n}) => {\n const checkableProps = useCheckable({ checked, name });\n const handleClick = () =>\n runAll(otherProps.onClick, checkableProps.onClick)({ target: { value: name, checked } }, item);\n\n const checkAddon =\n leftAddon || (checkableProps.checked ? <div className=\"checkable-mark\">{checkIcon}</div> : <div />);\n return (\n <MenuItem\n {...item}\n {...otherProps}\n {...checkableProps}\n customRenderer={item && item.customRenderer ? item.customRenderer : () => {}}\n items={otherProps.subItems}\n leftAddon={checkAddon}\n onClick={handleClick}\n role={role}\n />\n );\n};\n\nconst props = {\n /** Whether the item is checked or not */\n checked: PropTypes.bool.description('Whether the item is checked or not'),\n /** A custom item when the item is checked */\n checkIcon: PropTypes.element.description('A custom item when the item is checked'),\n /** form field name */\n name: PropTypes.string.description('form field name'),\n /** menu item object props */\n item: PropTypes.object.description('menu item object props'),\n /** a11y role */\n role: PropTypes.string.description('a11y role'),\n /** left addon component */\n leftAddon: PropTypes.node.description('left addon component'),\n};\n\nMenuItemCheckable.propTypes = props;\n\nconst DSMenuItemCheckeableWithSchema = describe(MenuItemCheckable);\nDSMenuItemCheckeableWithSchema.propTypes = props;\n\nexport { DSMenuItemCheckeableWithSchema, MenuItemCheckable };\nexport default MenuItemCheckable;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,wBAAoC;AACpC,sBAA0B;AAC1B,0BAAuB;AACvB,sBAAyB;AAGzB,sBAAsB,EAAE,WAAW;AACjC,SAAO;AAAA,IACL;AAAA,IACA,gBAAgB;AAAA;AAAA;AAgBpB,MAAM,oBAAoB,CAAC;AAAA,EACzB,OAAO;AAAA,EACP,UAAU;AAAA,EACV,OAAO;AAAA,EACP,YAAY,mDAAC,2BAAD;AAAA,IAAW,OAAO,CAAC,iBAAiB;AAAA;AAAA,EAEhD;AAAA,EACA;AAAA,EACA,OAAO;AAAA,KACJ;AAAA,MACC;AACJ,QAAM,iBAAiB,aAAa,EAAE,SAAS;AAC/C,QAAM,cAAc,MAClB,gCAAO,WAAW,SAAS,eAAe,SAAS,EAAE,QAAQ,EAAE,OAAO,MAAM,aAAa;AAE3F,QAAM,aACJ,aAAc,gBAAe,UAAU,mDAAC,OAAD;AAAA,IAAK,WAAU;AAAA,KAAkB,aAAmB,mDAAC,OAAD;AAC7F,SACE,mDAAC,0BAAD;AAAA,OACM;AAAA,OACA;AAAA,OACA;AAAA,IACJ,gBAAgB,QAAQ,KAAK,iBAAiB,KAAK,iBAAiB,MAAM;AAAA;AAAA,IAC1E,OAAO,WAAW;AAAA,IAClB,WAAW;AAAA,IACX,SAAS;AAAA,IACT;AAAA;AAAA;AAKN,MAAM,QAAQ;AAAA,EAEZ,SAAS,4BAAU,KAAK,YAAY;AAAA,EAEpC,WAAW,4BAAU,QAAQ,YAAY;AAAA,EAEzC,MAAM,4BAAU,OAAO,YAAY;AAAA,EAEnC,MAAM,4BAAU,OAAO,YAAY;AAAA,EAEnC,MAAM,4BAAU,OAAO,YAAY;AAAA,EAEnC,WAAW,4BAAU,KAAK,YAAY;AAAA;AAGxC,kBAAkB,YAAY;AAE9B,MAAM,iCAAiC,gCAAS;AAChD,+BAA+B,YAAY;AAG3C,IAAO,4BAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/MenuItems/MenuItemCheckbox.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { DSCheckbox } from '@elliemae/ds-form';\nimport { MenuItemCheckable } from './MenuItemCheckable';\nimport { registerMenuItem } from './menuItemFactory';\n\nconst MenuItemCheckbox = ({ checked, ...rest }) => (\n <MenuItemCheckable {...rest} leftAddon={<DSCheckbox checked={checked} />} role=\"menuitemcheckbox\" />\n);\n\nregisterMenuItem('checkbox', MenuItemCheckbox);\nexport { MenuItemCheckbox };\nexport default MenuItemCheckbox;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,qBAA2B;AAC3B,+BAAkC;AAClC,6BAAiC;AAEjC,MAAM,mBAAmB,CAAC,EAAE,YAAY,WACtC,mDAAC,4CAAD;AAAA,KAAuB;AAAA,EAAM,WAAW,mDAAC,2BAAD;AAAA,IAAY;AAAA;AAAA,EAAsB,MAAK;AAAA;AAGjF,6CAAiB,YAAY;AAE7B,IAAO,2BAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/MenuItems/MenuItemRadio.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport { MenuItemCheckable } from './MenuItemCheckable';\nimport { registerMenuItem } from './menuItemFactory';\n\nconst MenuItemRadio = (props) => <MenuItemCheckable {...props} role=\"menuitemradio\" />;\n\nconst props = {\n /** Whether the item is checked or not */\n checked: PropTypes.bool.description('Whether the item is checked or not'),\n /** A custom item when the item is checked */\n checkIcon: PropTypes.element.description('A custom item when the item is checked'),\n};\n\nMenuItemRadio.propTypes = props;\nregisterMenuItem('radio', MenuItemRadio);\n\nconst DSMenuItemRadioWithSchema = describe(MenuItemCheckable);\nDSMenuItemRadioWithSchema.propTypes = props;\n\nexport { DSMenuItemRadioWithSchema, MenuItemRadio };\nexport default MenuItemRadio;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,wBAAoC;AACpC,+BAAkC;AAClC,6BAAiC;AAEjC,MAAM,gBAAgB,CAAC,WAAU,mDAAC,4CAAD;AAAA,KAAuB;AAAA,EAAO,MAAK;AAAA;AAEpE,MAAM,QAAQ;AAAA,EAEZ,SAAS,4BAAU,KAAK,YAAY;AAAA,EAEpC,WAAW,4BAAU,QAAQ,YAAY;AAAA;AAG3C,cAAc,YAAY;AAC1B,6CAAiB,SAAS;AAE1B,MAAM,4BAA4B,gCAAS;AAC3C,0BAA0B,YAAY;AAGtC,IAAO,wBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/MenuItems/RadioGroup.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport { CheckableGroup } from '@elliemae/ds-shared/CheckableGroup';\n\nconst RadioGroup = (props) => <CheckableGroup {...props} multi={false} />;\n\nconst props = {\n /* The item selected */\n active: PropTypes.arrayOf(PropTypes.string).description('the item selected'),\n /* Handler when a user checks an item */\n onCheck: PropTypes.func.description('Handler when a user checks an item'),\n};\n\nRadioGroup.propTypes = props;\n\nconst DSMenuRadioGroupWithSchema = describe(RadioGroup);\n\nDSMenuRadioGroupWithSchema.propTypes = props;\n\nexport { DSMenuRadioGroupWithSchema, RadioGroup };\nexport default RadioGroup;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,wBAAoC;AACpC,4BAA+B;AAE/B,MAAM,aAAa,CAAC,WAAU,mDAAC,sCAAD;AAAA,KAAoB;AAAA,EAAO,OAAO;AAAA;AAEhE,MAAM,QAAQ;AAAA,EAEZ,QAAQ,4BAAU,QAAQ,4BAAU,QAAQ,YAAY;AAAA,EAExD,SAAS,4BAAU,KAAK,YAAY;AAAA;AAGtC,WAAW,YAAY;AAEvB,MAAM,6BAA6B,gCAAS;AAE5C,2BAA2B,YAAY;AAGvC,IAAO,qBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/MenuItems/SearchableGroup.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useEffect, useMemo, useState, useRef, useContext } from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { focusGroupManagerHoc } from '@elliemae/ds-shared/FocusGroup';\nimport { DSSearchBox } from '@elliemae/ds-form';\nimport { PropTypes, describe } from 'react-desc';\nimport { VirtualMenuList } from '../VirtualMenuList';\nimport { MenuContext } from '../MenuContext';\n\nconst SearchBoxWrapper = aggregatedClasses('div')(\n 'menu-search-group',\n 'search-wrapper',\n);\nconst NoOptionsWrapper = aggregatedClasses('div')(\n 'menu-search-group',\n 'no-options',\n);\n\nconst SearchableGroup = ({\n children,\n amountItemsInWindow = 5,\n searchTerm: searchTermProp = '',\n noOptionsText = 'No options',\n height,\n width,\n focusOnOpen = false,\n}) => {\n const searchRef = useRef(null);\n const [searchTerm, setSearchTerm] = useState(searchTermProp);\n\n useEffect(() => {\n if (searchRef.current) searchRef.current.focus();\n }, []);\n\n const { visible } = useContext(MenuContext) || {};\n\n useEffect(() => {\n if (focusOnOpen && visible) {\n setTimeout(() => {\n if (searchRef.current) searchRef.current.focus();\n }, 0);\n }\n }, [focusOnOpen, visible]);\n\n const filteredChildren = useMemo(\n () =>\n children.filter(\n (child) =>\n !searchTerm ||\n child.props.label.toLowerCase().startsWith(searchTerm.toLowerCase()),\n ),\n [children, searchTerm],\n );\n\n return (\n <>\n <SearchBoxWrapper>\n <DSSearchBox\n innerRef={searchRef}\n onSearch={({ value }) => setSearchTerm(value)}\n searchOnEnter={false}\n showIcon={false}\n value={searchTerm}\n />\n </SearchBoxWrapper>\n {!filteredChildren.length && (\n <NoOptionsWrapper>{noOptionsText}</NoOptionsWrapper>\n )}\n <VirtualMenuList\n amountItemsInWindow={amountItemsInWindow}\n height={height}\n items={filteredChildren}\n width={width}\n />\n </>\n );\n};\n\nconst props = {\n /** The amount of items that are going to be rendered in the group */\n amountItemsInWindow: PropTypes.number.description(\n 'The amount of items that are going to be rendered in the group',\n ),\n /** A search term */\n searchTerm: PropTypes.string.description('A search term'),\n /** Text to show when there's no options to show */\n noOptionsText: PropTypes.string.description(\n \"Text to show when there's no options to show\",\n ),\n /** array of children for search list */\n children: PropTypes.array.description('array of children for search list'),\n /** height for virtual list wrapper */\n height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description(\n 'height for virtual list wrapper',\n ),\n /** width for virtual list wrapper */\n width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description(\n 'width for virtual list wrapper',\n ),\n /** weather to focus on searchable group on open */\n focusOnOpen: PropTypes.bool.description(\n 'weather to focus on searchable group on open',\n ),\n};\n\nSearchableGroup.propTypes = props;\n\nconst DSMenuSearchableGroupWithSchema = describe(SearchableGroup);\nDSMenuSearchableGroupWithSchema.propTypes = props;\n\nconst SearchableGroupHOC = focusGroupManagerHoc(SearchableGroup);\n\nexport { DSMenuSearchableGroupWithSchema, SearchableGroupHOC as SearchableGroup };\nexport default SearchableGroupHOC;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwE;AACxE,2BAAkC;AAClC,wBAAqC;AACrC,qBAA4B;AAC5B,wBAAoC;AACpC,6BAAgC;AAChC,yBAA4B;AAE5B,MAAM,mBAAmB,4CAAkB,OACzC,qBACA;AAEF,MAAM,mBAAmB,4CAAkB,OACzC,qBACA;AAGF,MAAM,kBAAkB,CAAC;AAAA,EACvB;AAAA,EACA,sBAAsB;AAAA,EACtB,YAAY,iBAAiB;AAAA,EAC7B,gBAAgB;AAAA,EAChB;AAAA,EACA;AAAA,EACA,cAAc;AAAA,MACV;AACJ,QAAM,YAAY,yBAAO;AACzB,QAAM,CAAC,YAAY,iBAAiB,2BAAS;AAE7C,8BAAU,MAAM;AACd,QAAI,UAAU;AAAS,gBAAU,QAAQ;AAAA,KACxC;AAEH,QAAM,EAAE,YAAY,6BAA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
|
|
4
|
-
"sourcesContent": ["import React, { useCallback, useMemo, useState } from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport { uniqBy } from '@elliemae/ds-utilities';\nimport { DSComboBox2 as DSComboBox } from '@elliemae/ds-form/ComboBox/v2/Combobox';\n\nconst noop = () => {};\n\nconst SearchableList = ({\n onSelectMenuItem = noop,\n components = {},\n searchTerm: searchTermProp = '',\n items = [],\n dropdownFilterOptions = {},\n returnValue,\n extraListProps = {},\n appendTermInList = false,\n maxOptions = 10,\n loading = false,\n}) => {\n const [searchTerm, setInputValue] = useState(searchTermProp);\n\n const handleInputChange = useCallback(\n (value, args) => {\n const action = args ? args.action : null;\n if (action === 'input-blur' || action === 'menu-close') return;\n setInputValue(value);\n },\n [searchTerm],\n );\n\n const handleFilterByText = useCallback(() => {\n if (searchTerm) onSelectMenuItem(searchTerm);\n }, [searchTerm]);\n\n const handleKeyDown = useCallback(\n (e) => {\n if (e.key === 'ArrowRight') {\n handleFilterByText();\n }\n },\n [searchTerm],\n );\n\n const options = useMemo(\n () =>\n searchTerm && appendTermInList\n ? uniqBy(\n [\n {\n id: searchTerm,\n label: searchTerm,\n },\n ].concat(items),\n (item) => item.label,\n )\n : items,\n [searchTerm, appendTermInList],\n );\n\n return (\n <DSComboBox\n autoFocus\n components={{ DropdownIndicator: null, ...components }}\n customMenuItemOptions={{\n useTruncatedText: true,\n }}\n inlineMenu\n inputValue={searchTerm}\n menuIsOpen\n onChange={onSelectMenuItem}\n onFilterByInputText={handleFilterByText}\n onInputChange={handleInputChange}\n onKeyDown={handleKeyDown}\n options={options}\n returnValue={returnValue}\n valueProperty=\"id\"\n maxOptions={maxOptions}\n loading={loading}\n {...extraListProps}\n {...dropdownFilterOptions}\n />\n );\n};\n\nconst props = {\n /** callback after item gets selected */\n onSelectMenuItem: PropTypes.func.description('callback after item gets selected'),\n /** Object with custom components for react-select */\n components: PropTypes.shape({}).description('Object with custom components for react-select'),\n /** search term to filter for */\n searchTerm: PropTypes.string.description('search term to filter for'),\n /** item options */\n items: PropTypes.array.description('item options'),\n /** options */\n dropdownFilterOptions: PropTypes.shape({}).description('options'),\n /** Whether the combo box is has value to return or not */\n returnValue: PropTypes.bool.description('Whether the combo box is has value to return or not'),\n /** extra props to pass down to combo */\n extraListProps: PropTypes.shape({}).description('extra props to pass down to combo'),\n /** append search term as item on the list */\n appendTermInList: PropTypes.bool.description('append search term as item on the list'),\n /** maxoptions for combobox */\n maxOptions: PropTypes.number.description('maxoptions for combobox'),\n /** loading flag */\n loading: PropTypes.bool.description('loading flag'),\n};\n\nSearchableList.propTypes = props;\n\nconst DSMenuSearchableListWithSchema = describe(SearchableList);\n\nDSMenuSearchableListWithSchema.propTypes = props;\n\nexport { DSMenuSearchableListWithSchema, SearchableList };\nexport default SearchableList;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAsD;AACtD,wBAAoC;AACpC,0BAAuB;AACvB,sBAA0C;AAE1C,MAAM,OAAO,MAAM;AAAA;AAEnB,MAAM,iBAAiB,CAAC;AAAA,EACtB,mBAAmB;AAAA,EACnB,aAAa;AAAA,EACb,YAAY,iBAAiB;AAAA,EAC7B,QAAQ;AAAA,EACR,wBAAwB;AAAA,EACxB;AAAA,EACA,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,aAAa;AAAA,EACb,UAAU;AAAA,MACN;AACJ,QAAM,CAAC,YAAY,iBAAiB,2BAAS;AAE7C,QAAM,oBAAoB,8BACxB,CAAC,OAAO,SAAS;AACf,UAAM,SAAS,OAAO,KAAK,SAAS;AACpC,QAAI,WAAW,gBAAgB,WAAW;AAAc;AACxD,kBAAc;AAAA,KAEhB,CAAC;AAGH,QAAM,qBAAqB,8BAAY,MAAM;AAC3C,QAAI;AAAY,uBAAiB;AAAA,KAChC,CAAC;AAEJ,QAAM,gBAAgB,8B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../../../src/MenuItems/SelectionGroup.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useMemo } from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport { useCheckableGroup } from '@elliemae/ds-shared/CheckableGroup';\nimport { SearchableGroup } from './SearchableGroup';\nimport { registerMenuItem, menuItemFactory } from './menuItemFactory';\nimport { VirtualMenuList } from '../VirtualMenuList';\n\nconst noop = () => null;\n\nconst SelectionGroup = ({\n multi = false,\n searchable = false,\n focusOnOpen = false,\n onSelect = noop,\n children,\n items = undefined,\n active = multi ? [] : '',\n width,\n height,\n maxOptions = 5,\n}) => {\n const renderedItems = useMemo(\n () =>\n items &&\n items.map((item) => {\n const Component = menuItemFactory(multi ? 'checkbox' : 'radio');\n return <Component {...item} key={item.name || item.id || item.key} item={item} name={item.id || item.name} />;\n }),\n [items],\n );\n const decoratedGroupChildren = useCheckableGroup({\n children: renderedItems || children,\n multi,\n active,\n onCheck: onSelect,\n });\n\n if (searchable) {\n return (\n <SearchableGroup focusOnOpen={focusOnOpen} height={height} items={items} width={width}>\n {decoratedGroupChildren}\n </SearchableGroup>\n );\n }\n return (\n <VirtualMenuList height={height} items={decoratedGroupChildren} width={width} amountItemsInWindow={maxOptions} />\n );\n};\n\nconst props = {\n /** toggle on multi select */\n multi: PropTypes.bool.description('toggle on multi select'),\n /** toggle on searchable behavior */\n searchable: PropTypes.bool.description('toggle on searchable behavior'),\n /** toggle to focus component on open */\n focusOnOpen: PropTypes.bool.description('toggle to focus component on open'),\n /** callback that triggers when select happens */\n onSelect: PropTypes.func.description('callback that triggers when select happens'),\n children: PropTypes.node.description(''),\n /** selection group items */\n items: PropTypes.array.description('selection group items'),\n /** array of values for multi and string for single selection */\n active: PropTypes.oneOfType([PropTypes.string, PropTypes.array]).description(\n 'array of values for multi and string for single selection',\n ),\n /** selection group width */\n width: PropTypes.number.description('selection group width'),\n /** selection group height */\n height: PropTypes.number.description('selection group height'),\n};\n\nSelectionGroup.propTypes = props;\nregisterMenuItem('selectiongroup', SelectionGroup);\nregisterMenuItem('SelectionGroup', SelectionGroup);\n\nconst DSMenuSelectionGroupWithSchema = describe(SelectionGroup);\nDSMenuSelectionGroupWithSchema.propTypes = props;\n\nexport { DSMenuSelectionGroupWithSchema, SelectionGroup };\nexport default SelectionGroup;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA+B;AAC/B,wBAAoC;AACpC,4BAAkC;AAClC,6BAAgC;AAChC,6BAAkD;AAClD,6BAAgC;AAEhC,MAAM,OAAO,MAAM;AAEnB,MAAM,iBAAiB,CAAC;AAAA,EACtB,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,cAAc;AAAA,EACd,WAAW;AAAA,EACX;AAAA,EACA,QAAQ;AAAA,EACR,SAAS,QAAQ,KAAK;AAAA,EACtB;AAAA,EACA;AAAA,EACA,aAAa;AAAA,MACT;AACJ,QAAM,gBAAgB,0BACpB,MACE,SACA,MAAM,IAAI,CAAC,SAAS;AAClB,UAAM,YAAY,4CAAgB,QAAQ,aAAa;AACvD,WAAO,mDAAC,WAAD;AAAA,SAAe;AAAA,MAAM,KAAK,KAAK,QAAQ,KAAK,MAAM,KAAK;AAAA,MAAK;AAAA,MAAY,MAAM,KAAK,MAAM,KAAK;AAAA;AAAA,MAEzG,CAAC;AAEH,QAAM,yBAAyB,6CAAkB;AAAA,IAC/C,UAAU,iBAAiB;AAAA,IAC3B;AAAA,IACA;AAAA,IACA,SAAS;AAAA;AAGX,MAAI,YAAY;AACd,WACE,mDAAC,wCAAD;AAAA,MAAiB;AAAA,MAA0B;AAAA,MAAgB;AAAA,MAAc;AAAA,OACtE;AAAA;AAIP,SACE,mDAAC,wCAAD;AAAA,IAAiB;AAAA,IAAgB,OAAO;AAAA,IAAwB;AAAA,IAAc,qBAAqB;AAAA;AAAA;AAIvG,MAAM,QAAQ;AAAA,EAEZ,OAAO,4BAAU,KAAK,YAAY;AAAA,EAElC,YAAY,4BAAU,KAAK,YAAY;AAAA,EAEvC,aAAa,4BAAU,KAAK,YAAY;AAAA,EAExC,UAAU,4BAAU,KAAK,YAAY;AAAA,EACrC,UAAU,4BAAU,KAAK,YAAY;AAAA,EAErC,OAAO,4BAAU,MAAM,YAAY;AAAA,EAEnC,QAAQ,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU,QAAQ,YAC/D;AAAA,EAGF,OAAO,4BAAU,OAAO,YAAY;AAAA,EAEpC,QAAQ,4BAAU,OAAO,YAAY;AAAA;AAGvC,eAAe,YAAY;AAC3B,6CAAiB,kBAAkB;AACnC,6CAAiB,kBAAkB;AAEnC,MAAM,iCAAiC,gCAAS;AAChD,+BAA+B,YAAY;AAG3C,IAAO,yBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/MenuItems/Separator.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { DSSeparator } from '@elliemae/ds-separator';\nimport styled from 'styled-components';\nimport { registerMenuItem } from './menuItemFactory';\n\nconst blockName = 'menu-separator';\nconst Li = styled.li`\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n`;\n\nconst Title = aggregatedClasses('h5')(blockName, 'title');\nconst MenuSeparator = ({ title, showSeparator = true }) => (\n <Li>\n {showSeparator && <DSSeparator />}\n {title && <Title>{title}</Title>}\n </Li>\n);\n\nconst props = {\n /** menu separator h5 title */\n title: PropTypes.string.description('menu separator h5 title'),\n /** toggle separator on and off */\n showSeparator: PropTypes.bool.description('toggle separator on and off'),\n};\n\nMenuSeparator.propTypes = props;\nregisterMenuItem('separator', MenuSeparator);\n\nconst DSMenuSeparatorWithSchema = describe(MenuSeparator);\nDSMenuSeparatorWithSchema.propTypes = props;\n\nexport { DSMenuSeparatorWithSchema, MenuSeparator };\nexport default MenuSeparator;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,wBAAoC;AACpC,2BAAkC;AAClC,0BAA4B;AAC5B,+BAAmB;AACnB,6BAAiC;AAEjC,MAAM,YAAY;AAClB,MAAM,KAAK,iCAAO;AAAA;AAAA;AAAA;AAAA;AAMlB,MAAM,QAAQ,4CAAkB,MAAM,WAAW;AACjD,MAAM,gBAAgB,CAAC,EAAE,OAAO,gBAAgB,WAC9C,mDAAC,IAAD,MACG,iBAAiB,mDAAC,iCAAD,OACjB,SAAS,mDAAC,OAAD,MAAQ;AAItB,MAAM,QAAQ;AAAA,EAEZ,OAAO,4BAAU,OAAO,YAAY;AAAA,EAEpC,eAAe,4BAAU,KAAK,YAAY;AAAA;AAG5C,cAAc,YAAY;AAC1B,6CAAiB,aAAa;AAE9B,MAAM,4BAA4B,gCAAS;AAC3C,0BAA0B,YAAY;AAGtC,IAAO,oBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|