@genesislcap/foundation-ui 15.42.0 → 15.43.0-FUI-2629.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/dist/custom-elements.json +1454 -802
- package/dist/dts/actions-menu/actions-menu.d.ts +3 -0
- package/dist/dts/actions-menu/actions-menu.d.ts.map +1 -1
- package/dist/dts/base-components.d.ts +1 -0
- package/dist/dts/base-components.d.ts.map +1 -1
- package/dist/dts/index.d.ts +1 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/react.d.ts +19 -9
- package/dist/dts/utils/index.d.ts +1 -0
- package/dist/dts/utils/index.d.ts.map +1 -1
- package/dist/dts/utils/popover-position.d.ts +26 -0
- package/dist/dts/utils/popover-position.d.ts.map +1 -0
- package/dist/dts/vertical-dropdown-menu/index.d.ts +4 -0
- package/dist/dts/vertical-dropdown-menu/index.d.ts.map +1 -0
- package/dist/dts/vertical-dropdown-menu/vertical-dropdown-menu.d.ts +67 -0
- package/dist/dts/vertical-dropdown-menu/vertical-dropdown-menu.d.ts.map +1 -0
- package/dist/dts/vertical-dropdown-menu/vertical-dropdown-menu.styles.d.ts +5 -0
- package/dist/dts/vertical-dropdown-menu/vertical-dropdown-menu.styles.d.ts.map +1 -0
- package/dist/dts/vertical-dropdown-menu/vertical-dropdown-menu.template.d.ts +5 -0
- package/dist/dts/vertical-dropdown-menu/vertical-dropdown-menu.template.d.ts.map +1 -0
- package/dist/esm/actions-menu/actions-menu.js +17 -2
- package/dist/esm/base-components.js +2 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/popover-position.js +70 -0
- package/dist/esm/vertical-dropdown-menu/index.js +3 -0
- package/dist/esm/vertical-dropdown-menu/vertical-dropdown-menu.js +155 -0
- package/dist/esm/vertical-dropdown-menu/vertical-dropdown-menu.styles.js +55 -0
- package/dist/esm/vertical-dropdown-menu/vertical-dropdown-menu.template.js +64 -0
- package/dist/foundation-ui.api.json +1281 -78
- package/dist/foundation-ui.d.ts +78 -0
- package/dist/react.cjs +13 -6
- package/dist/react.mjs +11 -5
- package/package.json +18 -18
|
@@ -28,10 +28,13 @@ export declare class ActionsMenu extends FoundationElement {
|
|
|
28
28
|
singleOption: ActionMenuItem;
|
|
29
29
|
actionsMenu: HTMLElement;
|
|
30
30
|
actionsOpener: HTMLElement;
|
|
31
|
+
private positionTracker?;
|
|
31
32
|
disconnectedCallback(): void;
|
|
32
33
|
private updateMenuPosition;
|
|
33
34
|
protected definitionChanged(oldValue: any, newValue: any): void;
|
|
34
35
|
protected openChanged(): void;
|
|
36
|
+
private startTrackingPosition;
|
|
37
|
+
private stopTrackingPosition;
|
|
35
38
|
toggleActionsMenuVisibility(): void;
|
|
36
39
|
onActionMenuItemClick(callback: (rowData: any) => void | any): void;
|
|
37
40
|
get allActions(): ActionMenuItem[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions-menu.d.ts","sourceRoot":"","sources":["../../../src/actions-menu/actions-menu.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"actions-menu.d.ts","sourceRoot":"","sources":["../../../src/actions-menu/actions-menu.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAU/D;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,GAAG,KAAK,MAAM,CAAC,CAAC;IAC1C,QAAQ,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,GAAG,GAAG,CAAC;IACvC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,qBAAa,WAAY,SAAQ,iBAAiB;IACpC,OAAO,EAAE,cAAc,EAAE,CAAC;IACe,UAAU,EAAE,OAAO,CAAS;IACpB,iBAAiB,EAAE,OAAO,CAAQ;IACjC,iBAAiB,EAAE,OAAO,CAAQ;IACpF,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,GAAG,CAAC;IACtB,IAAI,SAAa;IACuB,IAAI,EAAE,OAAO,CAAS;IAC9D,gBAAgB,EAAE,MAAM,CAAC;IACwB,YAAY,EAAE,OAAO,CAAS;IACpB,oBAAoB,EAAE,OAAO,CACtF;IACI,YAAY,EAAE,cAAc,CAAC;IAEzC,WAAW,EAAG,WAAW,CAAC;IAC1B,aAAa,EAAG,WAAW,CAAC;IAE5B,OAAO,CAAC,eAAe,CAAC,CAAiC;IAEzD,oBAAoB,IAAI,IAAI;IAQ5B,OAAO,CAAC,kBAAkB;IAQ1B,SAAS,CAAC,iBAAiB,CAAC,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;IAyBxD,SAAS,CAAC,WAAW;IAerB,OAAO,CAAC,qBAAqB;IAS7B,OAAO,CAAC,oBAAoB;IAK5B,2BAA2B;IAI3B,qBAAqB,CAAC,QAAQ,EAAE,CAAC,OAAO,KAAA,KAAK,IAAI,GAAG,GAAG;IAKvD,IAAI,UAAU,IAAI,cAAc,EAAE,CASjC;IAED,IAAI,OAAO,QAKV;IAED,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,GAAG,KAAK,MAAM,CAAC;IAQlD,WAAW,CAAC,MAAM,EAAE,MAAM;CAsB3B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,2TAIhC,CAAC"}
|
|
@@ -359,6 +359,7 @@ export declare const baseComponents: {
|
|
|
359
359
|
styles: import("@microsoft/fast-element").ElementStyles;
|
|
360
360
|
shadowOptions: ShadowRootInit;
|
|
361
361
|
}, typeof import("./verification-code-input").VerificationCodeInput>;
|
|
362
|
+
foundationVerticalDropdownMenu: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").FoundationElementDefinition>) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").FoundationElementDefinition, typeof import("./vertical-dropdown-menu").VerticalDropdownMenu>;
|
|
362
363
|
foundationSectionNavigator: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<{
|
|
363
364
|
baseName: string;
|
|
364
365
|
template: import("@microsoft/fast-element").ViewTemplate<import("./section-navigator").SectionNavigator, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-components.d.ts","sourceRoot":"","sources":["../../src/base-components.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"base-components.d.ts","sourceRoot":"","sources":["../../src/base-components.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AA0F5D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA0FJ,SAAS,WAAW,GAAG,EAAE;CAe/C,CAAC"}
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -103,4 +103,5 @@ export * from './utils/editable-elements';
|
|
|
103
103
|
export * from './utils/event-types';
|
|
104
104
|
export { getPrefix as getDesignSystemPrefix } from './utils/dom';
|
|
105
105
|
export * from './verification-code-input';
|
|
106
|
+
export * from './vertical-dropdown-menu';
|
|
106
107
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/dts/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEvF,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,CAAC;AAExE,eAAO,MAAM,8BAA8B,yDAAuD,CAAC;AAEnG,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,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';
|
|
|
101
101
|
import type { TreeView as TreeViewWC } from './tree-view/tree-view';
|
|
102
102
|
import type { UrlInput as UrlInputWC } from './url-input/url-input';
|
|
103
103
|
import type { VerificationCodeInput as VerificationCodeInputWC } from './verification-code-input/verification-code-input';
|
|
104
|
+
import type { VerticalDropdownMenu as VerticalDropdownMenuWC } from './vertical-dropdown-menu/vertical-dropdown-menu';
|
|
104
105
|
import type { AddGroupEventDetail, AddRuleEventDetail, DelGroupEventDetail, DelRuleEventDetail, UpdateGroupEventDetail, UpdateRuleEventDetail } from '@genesislcap/expression-builder';
|
|
105
106
|
import type { ClearOptions, DailyConfig, FileReadEventDetail, FileSelectedEventDetail, FilterChangedEventDetail, FilterClearedEventDetail, MonthlyConfig, MultiselectOption, OpenChangeEventDetail, SelectedOption, StepClickEventDetail, ValidationError, ValidationFailureEventDetail, ValueChangeEventDetail, VerificationCodeInputEventDetail, WeeklyConfig, YearlyConfig } from '@genesislcap/foundation-ui';
|
|
106
107
|
|
|
@@ -142,15 +143,6 @@ export declare const AccordionItem: React.ForwardRefExoticComponent<
|
|
|
142
143
|
>;
|
|
143
144
|
export type AccordionItemRef = AccordionItemWC;
|
|
144
145
|
|
|
145
|
-
export declare const Accordion: React.ForwardRefExoticComponent<
|
|
146
|
-
React.PropsWithChildren<
|
|
147
|
-
Omit<PublicOf<AccordionWC>, 'children' | 'style'> &
|
|
148
|
-
HTMLWCProps & {
|
|
149
|
-
}
|
|
150
|
-
> & React.RefAttributes<AccordionWC>
|
|
151
|
-
>;
|
|
152
|
-
export type AccordionRef = AccordionWC;
|
|
153
|
-
|
|
154
146
|
export declare const ActionsMenu: React.ForwardRefExoticComponent<
|
|
155
147
|
React.PropsWithChildren<
|
|
156
148
|
Omit<PublicOf<ActionsMenuWC>, 'children' | 'style'> &
|
|
@@ -171,6 +163,15 @@ export declare const AiCriteriaSearch: React.ForwardRefExoticComponent<
|
|
|
171
163
|
>;
|
|
172
164
|
export type AiCriteriaSearchRef = AiCriteriaSearchWC;
|
|
173
165
|
|
|
166
|
+
export declare const Accordion: React.ForwardRefExoticComponent<
|
|
167
|
+
React.PropsWithChildren<
|
|
168
|
+
Omit<PublicOf<AccordionWC>, 'children' | 'style'> &
|
|
169
|
+
HTMLWCProps & {
|
|
170
|
+
}
|
|
171
|
+
> & React.RefAttributes<AccordionWC>
|
|
172
|
+
>;
|
|
173
|
+
export type AccordionRef = AccordionWC;
|
|
174
|
+
|
|
174
175
|
export declare const AiIndicator: React.ForwardRefExoticComponent<
|
|
175
176
|
React.PropsWithChildren<
|
|
176
177
|
Omit<PublicOf<AiIndicatorWC>, 'children' | 'style'> &
|
|
@@ -1040,6 +1041,15 @@ export declare const VerificationCodeInput: React.ForwardRefExoticComponent<
|
|
|
1040
1041
|
>;
|
|
1041
1042
|
export type VerificationCodeInputRef = VerificationCodeInputWC;
|
|
1042
1043
|
|
|
1044
|
+
export declare const VerticalDropdownMenu: React.ForwardRefExoticComponent<
|
|
1045
|
+
React.PropsWithChildren<
|
|
1046
|
+
Omit<PublicOf<VerticalDropdownMenuWC>, 'children' | 'style'> &
|
|
1047
|
+
HTMLWCProps & {
|
|
1048
|
+
}
|
|
1049
|
+
> & React.RefAttributes<VerticalDropdownMenuWC>
|
|
1050
|
+
>;
|
|
1051
|
+
export type VerticalDropdownMenuRef = VerticalDropdownMenuWC;
|
|
1052
|
+
|
|
1043
1053
|
export declare const DailyRecurrence: React.ForwardRefExoticComponent<
|
|
1044
1054
|
React.PropsWithChildren<
|
|
1045
1055
|
Omit<PublicOf<DailyRecurrenceWC>, 'children' | 'style'> &
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,4BAA4B,CAAC;AAC3C,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Walks up from `element`, crossing shadow-root boundaries via `.host`, collecting every
|
|
3
|
+
* scrollable ancestor (including the anchor's own document).
|
|
4
|
+
* @remarks Native `scroll` events are not `composed`, so they don't cross shadow-DOM boundaries
|
|
5
|
+
* the way `click`/`keydown` do — a listener on `document` never sees a shadow-DOM-nested
|
|
6
|
+
* viewport's own scroll. Callers must listen on each returned ancestor directly.
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export declare function findScrollableAncestors(element: HTMLElement): (HTMLElement | Document)[];
|
|
10
|
+
/**
|
|
11
|
+
* Keeps a Popover-API element anchored to its trigger while any of the trigger's scrollable
|
|
12
|
+
* ancestors scroll, and reports back when the trigger has been removed from the DOM (e.g. AG
|
|
13
|
+
* Grid row virtualization recycling the row that owns it).
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
export declare class AnchoredPopoverPositionTracker {
|
|
17
|
+
private readonly anchor;
|
|
18
|
+
private readonly onReposition;
|
|
19
|
+
private readonly onAnchorDetached;
|
|
20
|
+
private ancestors;
|
|
21
|
+
private readonly handleScroll;
|
|
22
|
+
constructor(anchor: HTMLElement, onReposition: () => void, onAnchorDetached: () => void);
|
|
23
|
+
start(): void;
|
|
24
|
+
stop(): void;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=popover-position.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover-position.d.ts","sourceRoot":"","sources":["../../../src/utils/popover-position.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,WAAW,GAAG,CAAC,WAAW,GAAG,QAAQ,CAAC,EAAE,CA8BxF;AAED;;;;;GAKG;AACH,qBAAa,8BAA8B;IAYvC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IAbnC,OAAO,CAAC,SAAS,CAAkC;IAEnD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAM3B;gBAGiB,MAAM,EAAE,WAAW,EACnB,YAAY,EAAE,MAAM,IAAI,EACxB,gBAAgB,EAAE,MAAM,IAAI;IAG/C,KAAK,IAAI,IAAI;IAQb,IAAI,IAAI,IAAI;CAMb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vertical-dropdown-menu/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { IconStyle } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
+
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
3
|
+
import type { FaSize } from '../icon';
|
|
4
|
+
/**
|
|
5
|
+
* The Vertical Dropdown Menu Item.
|
|
6
|
+
* @remarks Used within the Vertical Dropdown Menu component.
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export type VerticalDropdownMenuItem = {
|
|
10
|
+
label: string | ((rowData: any) => string);
|
|
11
|
+
icon?: {
|
|
12
|
+
variant?: IconStyle;
|
|
13
|
+
name: string;
|
|
14
|
+
size?: FaSize;
|
|
15
|
+
};
|
|
16
|
+
color?: string;
|
|
17
|
+
isDisabled?: (rowData: any) => boolean;
|
|
18
|
+
callback: (rowData: any) => void | any;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The Vertical Dropdown Menu component.
|
|
22
|
+
* @remarks An icon-only opener (a "kebab") that anchors a menu to itself, for a pinned
|
|
23
|
+
* column of per-row actions. Unlike `%%prefix%%-actions-menu`, it renders no button text and
|
|
24
|
+
* hides itself entirely when a row has no items.
|
|
25
|
+
* @tagname %%prefix%%-vertical-dropdown-menu
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
export declare class VerticalDropdownMenu extends FoundationElement {
|
|
29
|
+
items: VerticalDropdownMenuItem[] | ((rowData: any) => VerticalDropdownMenuItem[]);
|
|
30
|
+
definition: any;
|
|
31
|
+
classNames: string;
|
|
32
|
+
open: boolean;
|
|
33
|
+
iconName: string;
|
|
34
|
+
buttonAppearance: string;
|
|
35
|
+
autoCloseOnAction: boolean;
|
|
36
|
+
hideDisabled: boolean;
|
|
37
|
+
menuOpener: HTMLElement;
|
|
38
|
+
dropdownMenu: HTMLElement;
|
|
39
|
+
private positionTracker?;
|
|
40
|
+
disconnectedCallback(): void;
|
|
41
|
+
protected definitionChanged(oldValue: any, newValue: any): void;
|
|
42
|
+
protected openChanged(): void;
|
|
43
|
+
private updateMenuPosition;
|
|
44
|
+
private startTrackingPosition;
|
|
45
|
+
private stopTrackingPosition;
|
|
46
|
+
toggleVisibility(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Syncs `open` when the native `popover="auto"` light-dismiss (outside click / Escape)
|
|
49
|
+
* closes the popover without going through `toggleVisibility()`.
|
|
50
|
+
*/
|
|
51
|
+
onPopoverToggle(event: Event): void;
|
|
52
|
+
onItemClick(callback: (rowData: any) => void | any): void;
|
|
53
|
+
get rowData(): any;
|
|
54
|
+
get resolvedItems(): VerticalDropdownMenuItem[];
|
|
55
|
+
get visibleItems(): VerticalDropdownMenuItem[];
|
|
56
|
+
getLabel(label: string | ((rowData: any) => string)): string;
|
|
57
|
+
getTemplate(prefix: string): import("@microsoft/fast-element").ViewTemplate<VerticalDropdownMenu, any>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The Foundation Vertical Dropdown Menu
|
|
61
|
+
*
|
|
62
|
+
* @public
|
|
63
|
+
* @remarks
|
|
64
|
+
* HTML Element: \<foundation-vertical-dropdown-menu\>
|
|
65
|
+
*/
|
|
66
|
+
export declare const foundationVerticalDropdownMenu: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").FoundationElementDefinition>) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").FoundationElementDefinition, typeof VerticalDropdownMenu>;
|
|
67
|
+
//# sourceMappingURL=vertical-dropdown-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertical-dropdown-menu.d.ts","sourceRoot":"","sources":["../../../src/vertical-dropdown-menu/vertical-dropdown-menu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAEnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAQtC;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,GAAG,KAAK,MAAM,CAAC,CAAC;IAC3C,IAAI,CAAC,EAAE;QACL,OAAO,CAAC,EAAE,SAAS,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC;IACvC,QAAQ,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,GAAG,GAAG,CAAC;CACxC,CAAC;AAEF;;;;;;;GAOG;AACH,qBAAa,oBAAqB,SAAQ,iBAAiB;IAC7C,KAAK,EAAE,wBAAwB,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,GAAG,KAAK,wBAAwB,EAAE,CAAC,CAAC;IACnF,UAAU,EAAE,GAAG,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACe,IAAI,EAAE,OAAO,CAAS;IAClC,QAAQ,EAAE,MAAM,CAAuB;IACnE,gBAAgB,EAAE,MAAM,CAAC;IAC+B,iBAAiB,EAAE,OAAO,CAAQ;IACzC,YAAY,EAAE,OAAO,CAAS;IAErF,UAAU,EAAG,WAAW,CAAC;IACzB,YAAY,EAAG,WAAW,CAAC;IAE3B,OAAO,CAAC,eAAe,CAAC,CAAiC;IAEzD,oBAAoB,IAAI,IAAI;IAQ5B,SAAS,CAAC,iBAAiB,CAAC,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;IAiBxD,SAAS,CAAC,WAAW;IAerB,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,qBAAqB;IAS7B,OAAO,CAAC,oBAAoB;IAK5B,gBAAgB;IAIhB;;;OAGG;IACH,eAAe,CAAC,KAAK,EAAE,KAAK;IAO5B,WAAW,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,GAAG,GAAG;IAKlD,IAAI,OAAO,QAKV;IAED,IAAI,aAAa,IAAI,wBAAwB,EAAE,CAG9C;IAED,IAAI,YAAY,IAAI,wBAAwB,EAAE,CAG7C;IAED,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,GAAG,KAAK,MAAM,CAAC;IAInD,WAAW,CAAC,MAAM,EAAE,MAAM;CAI3B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,oUAIzC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ElementStyles } from '@microsoft/fast-element';
|
|
2
|
+
import type { ElementDefinitionContext, FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
3
|
+
export declare const verticalDropdownMenuBaseStyles: (context: ElementDefinitionContext, definition: FoundationElementDefinition) => ElementStyles;
|
|
4
|
+
export declare const foundationVerticalDropdownMenuStyles: (context: ElementDefinitionContext, definition: FoundationElementDefinition) => ElementStyles;
|
|
5
|
+
//# sourceMappingURL=vertical-dropdown-menu.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertical-dropdown-menu.styles.d.ts","sourceRoot":"","sources":["../../../src/vertical-dropdown-menu/vertical-dropdown-menu.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,KAAK,EACV,wBAAwB,EACxB,2BAA2B,EAC5B,MAAM,4BAA4B,CAAC;AAEpC,eAAO,MAAM,8BAA8B,GACzC,SAAS,wBAAwB,EACjC,YAAY,2BAA2B,KACtC,aAkDF,CAAC;AAEF,eAAO,MAAM,oCAAoC,GAC/C,SAAS,wBAAwB,EACjC,YAAY,2BAA2B,KACtC,aAEF,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ViewTemplate } from '@microsoft/fast-element';
|
|
2
|
+
import type { VerticalDropdownMenu } from './vertical-dropdown-menu';
|
|
3
|
+
export declare const verticalDropdownMenuTemplate: (prefix: string) => ViewTemplate<VerticalDropdownMenu, any>;
|
|
4
|
+
export declare const foundationVerticalDropdownMenuTemplate: ViewTemplate<VerticalDropdownMenu>;
|
|
5
|
+
//# sourceMappingURL=vertical-dropdown-menu.template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertical-dropdown-menu.template.d.ts","sourceRoot":"","sources":["../../../src/vertical-dropdown-menu/vertical-dropdown-menu.template.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAG9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAErE,eAAO,MAAM,4BAA4B,GAAI,QAAQ,MAAM,4CAwE1D,CAAC;AAEF,eAAO,MAAM,sCAAsC,EAAE,YAAY,CAAC,oBAAoB,CAIrF,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { __decorate } from "tslib";
|
|
|
2
2
|
import { attr, observable } from '@microsoft/fast-element';
|
|
3
3
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
4
4
|
import { classNames } from '@microsoft/fast-web-utilities';
|
|
5
|
+
import { AnchoredPopoverPositionTracker } from '../utils';
|
|
5
6
|
import { foundationActionsMenuStyles as styles } from './actions-menu.styles';
|
|
6
7
|
import { singleOptionTemplate, menuTemplate, foundationActionsMenuTemplate as template, } from './actions-menu.template';
|
|
7
8
|
/**
|
|
@@ -20,6 +21,7 @@ export class ActionsMenu extends FoundationElement {
|
|
|
20
21
|
}
|
|
21
22
|
disconnectedCallback() {
|
|
22
23
|
var _a;
|
|
24
|
+
this.stopTrackingPosition();
|
|
23
25
|
if ((_a = this.actionsMenu) === null || _a === void 0 ? void 0 : _a.matches(':popover-open')) {
|
|
24
26
|
this.actionsMenu.hidePopover();
|
|
25
27
|
}
|
|
@@ -59,11 +61,24 @@ export class ActionsMenu extends FoundationElement {
|
|
|
59
61
|
if (this.open) {
|
|
60
62
|
this.updateMenuPosition();
|
|
61
63
|
this.actionsMenu.showPopover();
|
|
64
|
+
this.startTrackingPosition();
|
|
62
65
|
}
|
|
63
|
-
else
|
|
64
|
-
this.
|
|
66
|
+
else {
|
|
67
|
+
this.stopTrackingPosition();
|
|
68
|
+
if ((_a = this.actionsMenu) === null || _a === void 0 ? void 0 : _a.matches(':popover-open')) {
|
|
69
|
+
this.actionsMenu.hidePopover();
|
|
70
|
+
}
|
|
65
71
|
}
|
|
66
72
|
}
|
|
73
|
+
startTrackingPosition() {
|
|
74
|
+
this.positionTracker = new AnchoredPopoverPositionTracker(this.actionsOpener, () => this.updateMenuPosition(), () => (this.open = false));
|
|
75
|
+
this.positionTracker.start();
|
|
76
|
+
}
|
|
77
|
+
stopTrackingPosition() {
|
|
78
|
+
var _a;
|
|
79
|
+
(_a = this.positionTracker) === null || _a === void 0 ? void 0 : _a.stop();
|
|
80
|
+
this.positionTracker = undefined;
|
|
81
|
+
}
|
|
67
82
|
toggleActionsMenuVisibility() {
|
|
68
83
|
this.open = !this.open;
|
|
69
84
|
}
|
|
@@ -86,6 +86,7 @@ import { foundationTreeItem } from './tree-item';
|
|
|
86
86
|
import { foundationTreeView } from './tree-view';
|
|
87
87
|
import { foundationUrlInput } from './url-input';
|
|
88
88
|
import { foundationVerificationCodeInput } from './verification-code-input';
|
|
89
|
+
import { foundationVerticalDropdownMenu } from './vertical-dropdown-menu';
|
|
89
90
|
export const baseComponents = {
|
|
90
91
|
foundationAccordion,
|
|
91
92
|
foundationAiCriteriaSearch,
|
|
@@ -174,6 +175,7 @@ export const baseComponents = {
|
|
|
174
175
|
foundationTreeView,
|
|
175
176
|
foundationUrlInput,
|
|
176
177
|
foundationVerificationCodeInput,
|
|
178
|
+
foundationVerticalDropdownMenu,
|
|
177
179
|
foundationSectionNavigator,
|
|
178
180
|
register(container, ...rest) {
|
|
179
181
|
if (!container) {
|
package/dist/esm/index.js
CHANGED
package/dist/esm/utils/index.js
CHANGED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Walks up from `element`, crossing shadow-root boundaries via `.host`, collecting every
|
|
3
|
+
* scrollable ancestor (including the anchor's own document).
|
|
4
|
+
* @remarks Native `scroll` events are not `composed`, so they don't cross shadow-DOM boundaries
|
|
5
|
+
* the way `click`/`keydown` do — a listener on `document` never sees a shadow-DOM-nested
|
|
6
|
+
* viewport's own scroll. Callers must listen on each returned ancestor directly.
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export function findScrollableAncestors(element) {
|
|
10
|
+
var _a;
|
|
11
|
+
const ancestors = [];
|
|
12
|
+
let node = element.parentNode;
|
|
13
|
+
while (node) {
|
|
14
|
+
if (node instanceof ShadowRoot) {
|
|
15
|
+
node = node.host;
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
if (node instanceof Document) {
|
|
19
|
+
ancestors.push(node);
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
22
|
+
if (node instanceof HTMLElement) {
|
|
23
|
+
const style = (_a = node.ownerDocument.defaultView) === null || _a === void 0 ? void 0 : _a.getComputedStyle(node);
|
|
24
|
+
if (!style) {
|
|
25
|
+
node = node.parentNode;
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (/(auto|scroll|overlay)/.test(style.overflowY) ||
|
|
29
|
+
/(auto|scroll|overlay)/.test(style.overflowX)) {
|
|
30
|
+
ancestors.push(node);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
node = node.parentNode;
|
|
34
|
+
}
|
|
35
|
+
return ancestors;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Keeps a Popover-API element anchored to its trigger while any of the trigger's scrollable
|
|
39
|
+
* ancestors scroll, and reports back when the trigger has been removed from the DOM (e.g. AG
|
|
40
|
+
* Grid row virtualization recycling the row that owns it).
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
43
|
+
export class AnchoredPopoverPositionTracker {
|
|
44
|
+
constructor(anchor, onReposition, onAnchorDetached) {
|
|
45
|
+
this.anchor = anchor;
|
|
46
|
+
this.onReposition = onReposition;
|
|
47
|
+
this.onAnchorDetached = onAnchorDetached;
|
|
48
|
+
this.ancestors = [];
|
|
49
|
+
this.handleScroll = () => {
|
|
50
|
+
if (!this.anchor.isConnected) {
|
|
51
|
+
this.onAnchorDetached();
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
this.onReposition();
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
start() {
|
|
58
|
+
this.stop();
|
|
59
|
+
this.ancestors = findScrollableAncestors(this.anchor);
|
|
60
|
+
for (const ancestor of this.ancestors) {
|
|
61
|
+
ancestor.addEventListener('scroll', this.handleScroll, { passive: true });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
stop() {
|
|
65
|
+
for (const ancestor of this.ancestors) {
|
|
66
|
+
ancestor.removeEventListener('scroll', this.handleScroll);
|
|
67
|
+
}
|
|
68
|
+
this.ancestors = [];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { attr, observable } from '@microsoft/fast-element';
|
|
3
|
+
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
4
|
+
import { classNames } from '@microsoft/fast-web-utilities';
|
|
5
|
+
import { AnchoredPopoverPositionTracker } from '../utils';
|
|
6
|
+
import { foundationVerticalDropdownMenuStyles as styles } from './vertical-dropdown-menu.styles';
|
|
7
|
+
import { foundationVerticalDropdownMenuTemplate as template, verticalDropdownMenuTemplate, } from './vertical-dropdown-menu.template';
|
|
8
|
+
/**
|
|
9
|
+
* The Vertical Dropdown Menu component.
|
|
10
|
+
* @remarks An icon-only opener (a "kebab") that anchors a menu to itself, for a pinned
|
|
11
|
+
* column of per-row actions. Unlike `%%prefix%%-actions-menu`, it renders no button text and
|
|
12
|
+
* hides itself entirely when a row has no items.
|
|
13
|
+
* @tagname %%prefix%%-vertical-dropdown-menu
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
export class VerticalDropdownMenu extends FoundationElement {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.open = false;
|
|
20
|
+
this.iconName = 'ellipsis-vertical';
|
|
21
|
+
this.autoCloseOnAction = true;
|
|
22
|
+
this.hideDisabled = false;
|
|
23
|
+
}
|
|
24
|
+
disconnectedCallback() {
|
|
25
|
+
var _a;
|
|
26
|
+
this.stopTrackingPosition();
|
|
27
|
+
if ((_a = this.dropdownMenu) === null || _a === void 0 ? void 0 : _a.matches(':popover-open')) {
|
|
28
|
+
this.dropdownMenu.hidePopover();
|
|
29
|
+
}
|
|
30
|
+
super.disconnectedCallback();
|
|
31
|
+
}
|
|
32
|
+
definitionChanged(oldValue, newValue) {
|
|
33
|
+
var _a;
|
|
34
|
+
if (!newValue)
|
|
35
|
+
return;
|
|
36
|
+
this.items = (_a = newValue.items) !== null && _a !== void 0 ? _a : [];
|
|
37
|
+
delete this.definition.items;
|
|
38
|
+
if (newValue.iconName) {
|
|
39
|
+
this.iconName = newValue.iconName;
|
|
40
|
+
delete this.definition.iconName;
|
|
41
|
+
}
|
|
42
|
+
if (newValue.buttonAppearance) {
|
|
43
|
+
this.buttonAppearance = newValue.buttonAppearance;
|
|
44
|
+
delete this.definition.buttonAppearance;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
openChanged() {
|
|
48
|
+
var _a;
|
|
49
|
+
this.classNames = classNames(['visible', this.open], ['hidden', !this.open]);
|
|
50
|
+
if (this.open) {
|
|
51
|
+
this.updateMenuPosition();
|
|
52
|
+
this.dropdownMenu.showPopover();
|
|
53
|
+
this.startTrackingPosition();
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
this.stopTrackingPosition();
|
|
57
|
+
if ((_a = this.dropdownMenu) === null || _a === void 0 ? void 0 : _a.matches(':popover-open')) {
|
|
58
|
+
this.dropdownMenu.hidePopover();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
updateMenuPosition() {
|
|
63
|
+
const rect = this.menuOpener.getBoundingClientRect();
|
|
64
|
+
this.dropdownMenu.style.position = 'fixed';
|
|
65
|
+
this.dropdownMenu.style.top = `${rect.bottom}px`;
|
|
66
|
+
this.dropdownMenu.style.left = 'auto';
|
|
67
|
+
this.dropdownMenu.style.right = `${window.innerWidth - rect.right}px`;
|
|
68
|
+
}
|
|
69
|
+
startTrackingPosition() {
|
|
70
|
+
this.positionTracker = new AnchoredPopoverPositionTracker(this.menuOpener, () => this.updateMenuPosition(), () => (this.open = false));
|
|
71
|
+
this.positionTracker.start();
|
|
72
|
+
}
|
|
73
|
+
stopTrackingPosition() {
|
|
74
|
+
var _a;
|
|
75
|
+
(_a = this.positionTracker) === null || _a === void 0 ? void 0 : _a.stop();
|
|
76
|
+
this.positionTracker = undefined;
|
|
77
|
+
}
|
|
78
|
+
toggleVisibility() {
|
|
79
|
+
this.open = !this.open;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Syncs `open` when the native `popover="auto"` light-dismiss (outside click / Escape)
|
|
83
|
+
* closes the popover without going through `toggleVisibility()`.
|
|
84
|
+
*/
|
|
85
|
+
onPopoverToggle(event) {
|
|
86
|
+
const newState = event.newState;
|
|
87
|
+
if (newState) {
|
|
88
|
+
this.open = newState === 'open';
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
onItemClick(callback) {
|
|
92
|
+
if (this.autoCloseOnAction)
|
|
93
|
+
this.open = false;
|
|
94
|
+
callback(this.rowData);
|
|
95
|
+
}
|
|
96
|
+
get rowData() {
|
|
97
|
+
if (!this.definition)
|
|
98
|
+
return;
|
|
99
|
+
const { node, data } = this.definition;
|
|
100
|
+
return (node === null || node === void 0 ? void 0 : node.data) || data;
|
|
101
|
+
}
|
|
102
|
+
get resolvedItems() {
|
|
103
|
+
const items = typeof this.items === 'function' ? this.items(this.rowData) : this.items;
|
|
104
|
+
return items !== null && items !== void 0 ? items : [];
|
|
105
|
+
}
|
|
106
|
+
get visibleItems() {
|
|
107
|
+
if (!this.hideDisabled)
|
|
108
|
+
return this.resolvedItems;
|
|
109
|
+
return this.resolvedItems.filter((item) => { var _a; return !((_a = item.isDisabled) === null || _a === void 0 ? void 0 : _a.call(item, this.rowData)); });
|
|
110
|
+
}
|
|
111
|
+
getLabel(label) {
|
|
112
|
+
return typeof label === 'function' ? label(this.rowData) : label;
|
|
113
|
+
}
|
|
114
|
+
getTemplate(prefix) {
|
|
115
|
+
if (this.visibleItems.length === 0)
|
|
116
|
+
return;
|
|
117
|
+
return verticalDropdownMenuTemplate(prefix);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
__decorate([
|
|
121
|
+
observable
|
|
122
|
+
], VerticalDropdownMenu.prototype, "items", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
observable
|
|
125
|
+
], VerticalDropdownMenu.prototype, "definition", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
observable
|
|
128
|
+
], VerticalDropdownMenu.prototype, "classNames", void 0);
|
|
129
|
+
__decorate([
|
|
130
|
+
attr({ attribute: 'open', mode: 'boolean' })
|
|
131
|
+
], VerticalDropdownMenu.prototype, "open", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
attr({ attribute: 'icon-name' })
|
|
134
|
+
], VerticalDropdownMenu.prototype, "iconName", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
attr
|
|
137
|
+
], VerticalDropdownMenu.prototype, "buttonAppearance", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
attr({ attribute: 'auto-close-on-action', mode: 'boolean' })
|
|
140
|
+
], VerticalDropdownMenu.prototype, "autoCloseOnAction", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
attr({ attribute: 'hide-disabled', mode: 'boolean' })
|
|
143
|
+
], VerticalDropdownMenu.prototype, "hideDisabled", void 0);
|
|
144
|
+
/**
|
|
145
|
+
* The Foundation Vertical Dropdown Menu
|
|
146
|
+
*
|
|
147
|
+
* @public
|
|
148
|
+
* @remarks
|
|
149
|
+
* HTML Element: \<foundation-vertical-dropdown-menu\>
|
|
150
|
+
*/
|
|
151
|
+
export const foundationVerticalDropdownMenu = VerticalDropdownMenu.compose({
|
|
152
|
+
baseName: 'vertical-dropdown-menu',
|
|
153
|
+
styles,
|
|
154
|
+
template,
|
|
155
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { css } from '@microsoft/fast-element';
|
|
2
|
+
export const verticalDropdownMenuBaseStyles = (context, definition) => css `
|
|
3
|
+
:host {
|
|
4
|
+
--menu-opener-size-multiplier: 0.7px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.vertical-dropdown-menu-container {
|
|
8
|
+
align-items: center;
|
|
9
|
+
display: flex;
|
|
10
|
+
height: 100%;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.menu-opener {
|
|
15
|
+
align-items: center;
|
|
16
|
+
align-self: center;
|
|
17
|
+
display: flex;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
padding: 0;
|
|
20
|
+
height: calc(
|
|
21
|
+
(var(--base-height-multiplier) + var(--density)) * var(--design-unit) *
|
|
22
|
+
var(--menu-opener-size-multiplier)
|
|
23
|
+
);
|
|
24
|
+
width: calc(
|
|
25
|
+
(var(--base-height-multiplier) + var(--density)) * var(--design-unit) *
|
|
26
|
+
var(--menu-opener-size-multiplier)
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.dropdown-menu {
|
|
31
|
+
margin: 0;
|
|
32
|
+
max-width: 350px;
|
|
33
|
+
overflow-y: auto;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
foundation-menu-item {
|
|
37
|
+
display: flex;
|
|
38
|
+
user-select: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
foundation-menu-item::part(content) {
|
|
42
|
+
margin-inline: 10px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
foundation-menu-item[disabled] {
|
|
46
|
+
pointer-events: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.menu-item {
|
|
50
|
+
flex: 1;
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
export const foundationVerticalDropdownMenuStyles = (context, definition) => css `
|
|
54
|
+
${verticalDropdownMenuBaseStyles(context, definition)}
|
|
55
|
+
`;
|