vira 28.19.6 → 29.0.0
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/elements/define-vira-element.d.ts +18 -0
- package/dist/elements/define-vira-element.js +19 -0
- package/dist/elements/form/vira-form-fields.d.ts +100 -0
- package/dist/elements/form/vira-form-fields.js +60 -0
- package/dist/elements/form/vira-form.element.d.ts +35 -0
- package/dist/elements/form/vira-form.element.js +151 -0
- package/dist/elements/index.js +25 -0
- package/dist/elements/pop-up/pop-up-helpers.d.ts +33 -0
- package/dist/elements/pop-up/pop-up-helpers.js +58 -0
- package/{src/elements/pop-up/pop-up-menu-item.ts → dist/elements/pop-up/pop-up-menu-item.d.ts} +3 -4
- package/dist/elements/pop-up/pop-up-menu-item.js +1 -0
- package/dist/elements/pop-up/vira-menu-item.element.d.ts +19 -0
- package/{src/elements/pop-up/vira-menu-item.element.ts → dist/elements/pop-up/vira-menu-item.element.js} +11 -28
- package/dist/elements/pop-up/vira-menu-trigger.element.d.ts +41 -0
- package/dist/elements/pop-up/vira-menu-trigger.element.js +121 -0
- package/dist/elements/pop-up/vira-menu.element.d.ts +38 -0
- package/{src/elements/pop-up/vira-menu.element.ts → dist/elements/pop-up/vira-menu.element.js} +49 -78
- package/dist/elements/pop-up/vira-pop-up-menu.element.d.ts +35 -0
- package/{src/elements/pop-up/vira-pop-up-menu.element.ts → dist/elements/pop-up/vira-pop-up-menu.element.js} +24 -37
- package/dist/elements/pop-up/vira-pop-up-trigger.element.d.ts +105 -0
- package/{src/elements/pop-up/vira-pop-up-trigger.element.ts → dist/elements/pop-up/vira-pop-up-trigger.element.js} +104 -199
- package/dist/elements/shared-text-input-logic.d.ts +63 -0
- package/dist/elements/shared-text-input-logic.js +101 -0
- package/dist/elements/vira-bold-text.element.d.ts +9 -0
- package/{src/elements/vira-bold-text.element.ts → dist/elements/vira-bold-text.element.js} +7 -8
- package/dist/elements/vira-button.element.d.ts +34 -0
- package/dist/elements/vira-button.element.js +176 -0
- package/dist/elements/vira-card.element.d.ts +18 -0
- package/dist/elements/vira-card.element.js +60 -0
- package/dist/elements/vira-checkbox.element.d.ts +38 -0
- package/{src/elements/vira-checkbox.element.ts → dist/elements/vira-checkbox.element.js} +70 -83
- package/dist/elements/vira-collapsible-wrapper.element.d.ts +14 -0
- package/{src/elements/vira-collapsible-wrapper.element.ts → dist/elements/vira-collapsible-wrapper.element.js} +16 -18
- package/dist/elements/vira-dropdown.element.d.ts +46 -0
- package/{src/elements/vira-dropdown.element.ts → dist/elements/vira-dropdown.element.js} +48 -95
- package/dist/elements/vira-error.element.d.ts +7 -0
- package/{src/elements/vira-error.element.ts → dist/elements/vira-error.element.js} +6 -7
- package/dist/elements/vira-icon.element.d.ts +13 -0
- package/{src/elements/vira-icon.element.ts → dist/elements/vira-icon.element.js} +6 -13
- package/dist/elements/vira-image.element.d.ts +45 -0
- package/{src/elements/vira-image.element.ts → dist/elements/vira-image.element.js} +43 -63
- package/dist/elements/vira-input.element.d.ts +62 -0
- package/{src/elements/vira-input.element.ts → dist/elements/vira-input.element.js} +93 -166
- package/dist/elements/vira-link.element.d.ts +73 -0
- package/{src/elements/vira-link.element.ts → dist/elements/vira-link.element.js} +17 -67
- package/dist/elements/vira-modal.element.d.ts +39 -0
- package/{src/elements/vira-modal.element.ts → dist/elements/vira-modal.element.js} +56 -97
- package/dist/elements/vira-overflow-switch.element.d.ts +21 -0
- package/dist/elements/vira-overflow-switch.element.js +110 -0
- package/dist/elements/vira-progress.element.d.ts +18 -0
- package/{src/elements/vira-progress.element.ts → dist/elements/vira-progress.element.js} +14 -30
- package/dist/elements/vira-select.element.d.ts +48 -0
- package/{src/elements/vira-select.element.ts → dist/elements/vira-select.element.js} +45 -99
- package/dist/icons/icon-color.test-helper.d.ts +6 -0
- package/dist/icons/icon-color.test-helper.js +9 -0
- package/dist/icons/icon-css-vars.d.ts +14 -0
- package/{src/icons/icon-css-vars.ts → dist/icons/icon-css-vars.js} +1 -2
- package/dist/icons/icon-svg.d.ts +27 -0
- package/dist/icons/icon-svg.js +48 -0
- package/dist/icons/icon-svgs/bell-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/bell-24.icon.ts → dist/icons/icon-svgs/bell-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/chat-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/chat-24.icon.ts → dist/icons/icon-svgs/chat-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/check-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/check-24.icon.ts → dist/icons/icon-svgs/check-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/chevron-down-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/chevron-down-24.icon.ts → dist/icons/icon-svgs/chevron-down-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/chevron-up-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/chevron-up-24.icon.ts → dist/icons/icon-svgs/chevron-up-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/close-x-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/close-x-24.icon.ts → dist/icons/icon-svgs/close-x-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/commit-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/commit-24.icon.ts → dist/icons/icon-svgs/commit-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/copy-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/copy-24.icon.ts → dist/icons/icon-svgs/copy-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/document-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/document-24.icon.ts → dist/icons/icon-svgs/document-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/document-search-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/document-search-24.icon.ts → dist/icons/icon-svgs/document-search-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/double-chevron-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/double-chevron-24.icon.ts → dist/icons/icon-svgs/double-chevron-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/element-16.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/element-16.icon.ts → dist/icons/icon-svgs/element-16.icon.js} +4 -5
- package/dist/icons/icon-svgs/element-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/element-24.icon.ts → dist/icons/icon-svgs/element-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/external-link-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/external-link-24.icon.ts → dist/icons/icon-svgs/external-link-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/eye-closed-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/eye-closed-24.icon.ts → dist/icons/icon-svgs/eye-closed-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/eye-open-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/eye-open-24.icon.ts → dist/icons/icon-svgs/eye-open-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/filter-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/filter-24.icon.ts → dist/icons/icon-svgs/filter-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/link-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/link-24.icon.ts → dist/icons/icon-svgs/link-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/loader-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/loader-24.icon.ts → dist/icons/icon-svgs/loader-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/loader-animated-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/loader-animated-24.icon.ts → dist/icons/icon-svgs/loader-animated-24.icon.js} +6 -8
- package/dist/icons/icon-svgs/lock-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/lock-24.icon.ts → dist/icons/icon-svgs/lock-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/options-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/options-24.icon.ts → dist/icons/icon-svgs/options-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/pencil-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/pencil-24.icon.ts → dist/icons/icon-svgs/pencil-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/shield-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/shield-24.icon.ts → dist/icons/icon-svgs/shield-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/sort-ascending-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/sort-ascending-24.icon.ts → dist/icons/icon-svgs/sort-ascending-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/sort-descending-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/sort-descending-24.icon.ts → dist/icons/icon-svgs/sort-descending-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/speaker-loud-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/speaker-loud-24.icon.ts → dist/icons/icon-svgs/speaker-loud-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/speaker-medium-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/speaker-medium-24.icon.ts → dist/icons/icon-svgs/speaker-medium-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/speaker-muted-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/speaker-muted-24.icon.ts → dist/icons/icon-svgs/speaker-muted-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/speaker-quiet-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/speaker-quiet-24.icon.ts → dist/icons/icon-svgs/speaker-quiet-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/star-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/star-24.icon.ts → dist/icons/icon-svgs/star-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/status-failure-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/status-failure-24.icon.ts → dist/icons/icon-svgs/status-failure-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/status-in-progress-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/status-in-progress-24.icon.ts → dist/icons/icon-svgs/status-in-progress-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/status-success-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/status-success-24.icon.ts → dist/icons/icon-svgs/status-success-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/status-unknown-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/status-unknown-24.icon.ts → dist/icons/icon-svgs/status-unknown-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/status-warning-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/status-warning-24.icon.ts → dist/icons/icon-svgs/status-warning-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/upload-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/upload-24.icon.ts → dist/icons/icon-svgs/upload-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/x-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/x-24.icon.ts → dist/icons/icon-svgs/x-24.icon.js} +4 -5
- package/dist/icons/index.d.ts +86 -0
- package/{src/icons/index.ts → dist/icons/index.js} +39 -43
- package/dist/index.js +4 -0
- package/dist/styles/disabled.d.ts +6 -0
- package/{src/styles/disabled.ts → dist/styles/disabled.js} +2 -3
- package/dist/styles/durations.d.ts +22 -0
- package/{src/styles/durations.ts → dist/styles/durations.js} +1 -2
- package/dist/styles/focus.d.ts +21 -0
- package/dist/styles/focus.js +41 -0
- package/dist/styles/font.d.ts +9 -0
- package/{src/styles/font.ts → dist/styles/font.js} +1 -2
- package/dist/styles/form-styles.d.ts +123 -0
- package/dist/styles/form-styles.js +126 -0
- package/{src/styles/index.ts → dist/styles/index.d.ts} +0 -2
- package/dist/styles/index.js +12 -0
- package/dist/styles/native-styles.d.ts +13 -0
- package/{src/styles/native-styles.ts → dist/styles/native-styles.js} +3 -6
- package/dist/styles/scrollbar.d.ts +6 -0
- package/{src/styles/scrollbar.ts → dist/styles/scrollbar.js} +3 -4
- package/dist/styles/shadows.d.ts +20 -0
- package/{src/styles/shadows.ts → dist/styles/shadows.js} +6 -8
- package/dist/styles/user-select.d.ts +6 -0
- package/{src/styles/user-select.ts → dist/styles/user-select.js} +2 -3
- package/dist/styles/vira-color-palette.d.ts +97 -0
- package/dist/styles/vira-color-palette.js +98 -0
- package/dist/styles/vira-color-theme.d.ts +1580 -0
- package/dist/styles/vira-color-theme.js +1516 -0
- package/dist/util/define-table.d.ts +110 -0
- package/dist/util/define-table.js +115 -0
- package/dist/util/dynamic-element.d.ts +63 -0
- package/dist/util/dynamic-element.js +61 -0
- package/dist/util/index.js +3 -0
- package/dist/util/pop-up-manager.d.ts +186 -0
- package/dist/util/pop-up-manager.js +214 -0
- package/package.json +6 -6
- package/src/elements/define-vira-element.ts +0 -29
- package/src/elements/form/vira-form-fields.ts +0 -140
- package/src/elements/form/vira-form.element.ts +0 -204
- package/src/elements/pop-up/pop-up-helpers.ts +0 -85
- package/src/elements/pop-up/vira-menu-trigger.element.ts +0 -158
- package/src/elements/shared-text-input-logic.ts +0 -173
- package/src/elements/vira-button.element.ts +0 -171
- package/src/elements/vira-card.element.ts +0 -54
- package/src/elements/vira-overflow-switch.element.ts +0 -137
- package/src/icons/icon-color.test-helper.ts +0 -9
- package/src/icons/icon-svg.ts +0 -71
- package/src/styles/border.ts +0 -11
- package/src/styles/focus.ts +0 -76
- package/src/styles/form-styles.ts +0 -26
- package/src/styles/vira-color-palette.ts +0 -106
- package/src/styles/vira-color-theme.ts +0 -1142
- package/src/util/define-table.ts +0 -279
- package/src/util/dynamic-element.ts +0 -129
- package/src/util/pop-up-manager.ts +0 -380
- /package/{src/elements/index.ts → dist/elements/index.d.ts} +0 -0
- /package/{src/index.ts → dist/index.d.ts} +0 -0
- /package/{src/util/index.ts → dist/util/index.d.ts} +0 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { classMap, css, defineElementEvent, html, listen, nothing, testId } from 'element-vir';
|
|
2
|
+
import { defineViraElement } from '../define-vira-element.js';
|
|
3
|
+
import { updateSelectedItems } from './pop-up-helpers.js';
|
|
4
|
+
import { ViraMenu } from './vira-menu.element.js';
|
|
5
|
+
import { PopUpMenuDirection, ViraPopUpMenu, } from './vira-pop-up-menu.element.js';
|
|
6
|
+
import { HorizontalAnchor, ViraPopUpTrigger, } from './vira-pop-up-trigger.element.js';
|
|
7
|
+
/**
|
|
8
|
+
* Test ids for {@link ViraMenuTrigger}.
|
|
9
|
+
*
|
|
10
|
+
* @category Internal
|
|
11
|
+
*/
|
|
12
|
+
export const viraMenuTriggerTestIds = {
|
|
13
|
+
menu: 'menu-trigger-menu',
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* A more specific wrapper of `ViraPopUpTrigger` that always opens a menu.
|
|
17
|
+
*
|
|
18
|
+
* @category PopUp
|
|
19
|
+
* @category Elements
|
|
20
|
+
*/
|
|
21
|
+
export const ViraMenuTrigger = defineViraElement()({
|
|
22
|
+
tagName: 'vira-menu-trigger',
|
|
23
|
+
styles: css `
|
|
24
|
+
:host {
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
vertical-align: middle;
|
|
28
|
+
max-width: 100%;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
${ViraPopUpTrigger} {
|
|
32
|
+
width: 100%;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.full-width-menu {
|
|
36
|
+
width: 100%;
|
|
37
|
+
}
|
|
38
|
+
`,
|
|
39
|
+
events: {
|
|
40
|
+
itemActivate: defineElementEvent(),
|
|
41
|
+
openChange: defineElementEvent(),
|
|
42
|
+
},
|
|
43
|
+
state() {
|
|
44
|
+
return {
|
|
45
|
+
navController: undefined,
|
|
46
|
+
popUpManager: undefined,
|
|
47
|
+
/** `undefined` means the pop up is not currently showing. */
|
|
48
|
+
showPopUpResult: undefined,
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
render({ inputs, state, updateState, dispatch, events }) {
|
|
52
|
+
return html `
|
|
53
|
+
<${ViraPopUpTrigger.assign({
|
|
54
|
+
...inputs,
|
|
55
|
+
keepOpenAfterInteraction: true,
|
|
56
|
+
popUpOffset: inputs.popUpOffset,
|
|
57
|
+
horizontalAnchor: inputs.horizontalAnchor || HorizontalAnchor.Left,
|
|
58
|
+
})}
|
|
59
|
+
class=${classMap({
|
|
60
|
+
open: !!state.showPopUpResult,
|
|
61
|
+
})}
|
|
62
|
+
${listen(ViraPopUpTrigger.events.init, (event) => {
|
|
63
|
+
updateState({
|
|
64
|
+
navController: event.detail.navController,
|
|
65
|
+
popUpManager: event.detail.popUpManager,
|
|
66
|
+
});
|
|
67
|
+
})}
|
|
68
|
+
${listen(ViraPopUpTrigger.events.openChange, (event) => {
|
|
69
|
+
if (!!state.showPopUpResult !== !!event.detail) {
|
|
70
|
+
dispatch(new events.openChange(event.detail));
|
|
71
|
+
}
|
|
72
|
+
updateState({
|
|
73
|
+
showPopUpResult: event.detail,
|
|
74
|
+
});
|
|
75
|
+
})}
|
|
76
|
+
${listen(ViraPopUpTrigger.events.navSelect, (event) => {
|
|
77
|
+
const itemIndex = event.detail.x;
|
|
78
|
+
const item = inputs.items[itemIndex];
|
|
79
|
+
if (!item) {
|
|
80
|
+
throw new Error(`Found no dropdown option at index '${itemIndex}'`);
|
|
81
|
+
}
|
|
82
|
+
dispatch(new events.itemActivate(updateSelectedItems(item, inputs.selected, inputs.isMultiSelect)));
|
|
83
|
+
if (!inputs.isMultiSelect) {
|
|
84
|
+
/**
|
|
85
|
+
* Defer pop up removal to prevent race conditions with element-internal
|
|
86
|
+
* click handlers.
|
|
87
|
+
*/
|
|
88
|
+
globalThis.setTimeout(() => state.popUpManager?.removePopUp());
|
|
89
|
+
}
|
|
90
|
+
})}
|
|
91
|
+
>
|
|
92
|
+
<slot slot=${ViraPopUpTrigger.slotNames.trigger}></slot>
|
|
93
|
+
${state.navController && state.showPopUpResult
|
|
94
|
+
? html `
|
|
95
|
+
<${ViraPopUpMenu.assign({
|
|
96
|
+
direction: state.showPopUpResult.popDown
|
|
97
|
+
? PopUpMenuDirection.Downwards
|
|
98
|
+
: PopUpMenuDirection.Upwards,
|
|
99
|
+
cornerStyle: inputs.menuCornerStyle,
|
|
100
|
+
})}
|
|
101
|
+
slot=${ViraPopUpTrigger.slotNames.popUp}
|
|
102
|
+
class=${classMap({
|
|
103
|
+
'full-width-menu': inputs.horizontalAnchor === HorizontalAnchor.Both,
|
|
104
|
+
})}
|
|
105
|
+
>
|
|
106
|
+
<${ViraMenu.assign({
|
|
107
|
+
items: inputs.items,
|
|
108
|
+
selected: inputs.selected,
|
|
109
|
+
navController: state.navController,
|
|
110
|
+
isMultiSelect: !!inputs.isMultiSelect,
|
|
111
|
+
hideCheckIcons: inputs.hideCheckIcons,
|
|
112
|
+
})}
|
|
113
|
+
${testId(viraMenuTriggerTestIds.menu)}
|
|
114
|
+
></${ViraMenu}>
|
|
115
|
+
</${ViraPopUpMenu}>
|
|
116
|
+
`
|
|
117
|
+
: nothing}
|
|
118
|
+
</${ViraPopUpTrigger}>
|
|
119
|
+
`;
|
|
120
|
+
},
|
|
121
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type PartialWithUndefined } from '@augment-vir/common';
|
|
2
|
+
import { NavController } from 'device-navigation';
|
|
3
|
+
import { type MenuItem } from './pop-up-menu-item.js';
|
|
4
|
+
/**
|
|
5
|
+
* Test ids for {@link ViraMenu}.
|
|
6
|
+
*
|
|
7
|
+
* @category Internal
|
|
8
|
+
*/
|
|
9
|
+
export declare const viraMenuTestIds: {
|
|
10
|
+
item: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* A wrapper for menu items. This can be used for dropdown items or menu bar dropdowns. To detect
|
|
14
|
+
* when items are selected or unselected, pass in a `NavController` instance and hook into its
|
|
15
|
+
* events.
|
|
16
|
+
*
|
|
17
|
+
* @category PopUp
|
|
18
|
+
* @category Elements
|
|
19
|
+
*/
|
|
20
|
+
export declare const ViraMenu: import("element-vir").DeclarativeElementDefinition<"vira-menu", Readonly<{
|
|
21
|
+
/**
|
|
22
|
+
* The parent nav controller for this menu. If none is provided, an internal nav
|
|
23
|
+
* controller is created (which means it can't be hooked into by external elements).
|
|
24
|
+
*
|
|
25
|
+
* It is recommended to not leave this `undefined`.
|
|
26
|
+
*/
|
|
27
|
+
navController: NavController | undefined;
|
|
28
|
+
/** All menu items to show to the user. */
|
|
29
|
+
items: ReadonlyArray<Readonly<MenuItem>>;
|
|
30
|
+
} & PartialWithUndefined<{
|
|
31
|
+
/** The ids of the currently selected menu items. */
|
|
32
|
+
selected: ReadonlyArray<PropertyKey>;
|
|
33
|
+
isMultiSelect: boolean;
|
|
34
|
+
/** Hide menu item check mark icons. */
|
|
35
|
+
hideCheckIcons: boolean;
|
|
36
|
+
}>>, {
|
|
37
|
+
internalNavController: NavController;
|
|
38
|
+
}, {}, "vira-menu-multiselect", "vira-menu-", readonly [], readonly []>;
|
package/{src/elements/pop-up/vira-menu.element.ts → dist/elements/pop-up/vira-menu.element.js}
RENAMED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import {check} from '@augment-vir/assert';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {type MenuItem} from './pop-up-menu-item.js';
|
|
11
|
-
import {ViraMenuItem} from './vira-menu-item.element.js';
|
|
12
|
-
|
|
1
|
+
import { check } from '@augment-vir/assert';
|
|
2
|
+
import { nav, navAttribute, NavController, NavValue } from 'device-navigation';
|
|
3
|
+
import { classMap, css, html, ifDefined, testId } from 'element-vir';
|
|
4
|
+
import { viraFormCssVars } from '../../styles/form-styles.js';
|
|
5
|
+
import { noNativeFormStyles, viraDisabledStyles } from '../../styles/index.js';
|
|
6
|
+
import { defineViraElement } from '../define-vira-element.js';
|
|
7
|
+
import { ViraLink } from '../vira-link.element.js';
|
|
8
|
+
import { assertUniqueIdProps } from './pop-up-helpers.js';
|
|
9
|
+
import { ViraMenuItem } from './vira-menu-item.element.js';
|
|
13
10
|
/**
|
|
14
11
|
* Test ids for {@link ViraMenu}.
|
|
15
12
|
*
|
|
@@ -18,7 +15,6 @@ import {ViraMenuItem} from './vira-menu-item.element.js';
|
|
|
18
15
|
export const viraMenuTestIds = {
|
|
19
16
|
item: 'menu-item',
|
|
20
17
|
};
|
|
21
|
-
|
|
22
18
|
/**
|
|
23
19
|
* A wrapper for menu items. This can be used for dropdown items or menu bar dropdowns. To detect
|
|
24
20
|
* when items are selected or unselected, pass in a `NavController` instance and hook into its
|
|
@@ -27,37 +23,17 @@ export const viraMenuTestIds = {
|
|
|
27
23
|
* @category PopUp
|
|
28
24
|
* @category Elements
|
|
29
25
|
*/
|
|
30
|
-
export const ViraMenu = defineViraElement
|
|
31
|
-
Readonly<
|
|
32
|
-
{
|
|
33
|
-
/**
|
|
34
|
-
* The parent nav controller for this menu. If none is provided, an internal nav
|
|
35
|
-
* controller is created (which means it can't be hooked into by external elements).
|
|
36
|
-
*
|
|
37
|
-
* It is recommended to not leave this `undefined`.
|
|
38
|
-
*/
|
|
39
|
-
navController: NavController | undefined;
|
|
40
|
-
/** All menu items to show to the user. */
|
|
41
|
-
items: ReadonlyArray<Readonly<MenuItem>>;
|
|
42
|
-
} & PartialWithUndefined<{
|
|
43
|
-
/** The ids of the currently selected menu items. */
|
|
44
|
-
selected: ReadonlyArray<PropertyKey>;
|
|
45
|
-
isMultiSelect: boolean;
|
|
46
|
-
/** Hide menu item check mark icons. */
|
|
47
|
-
hideCheckIcons: boolean;
|
|
48
|
-
}>
|
|
49
|
-
>
|
|
50
|
-
>()({
|
|
26
|
+
export const ViraMenu = defineViraElement()({
|
|
51
27
|
tagName: 'vira-menu',
|
|
52
|
-
state({inputs, host}) {
|
|
28
|
+
state({ inputs, host }) {
|
|
53
29
|
return {
|
|
54
30
|
internalNavController: inputs.navController || new NavController(host),
|
|
55
31
|
};
|
|
56
32
|
},
|
|
57
33
|
hostClasses: {
|
|
58
|
-
'vira-menu-multiselect': ({inputs}) => !!inputs.isMultiSelect,
|
|
34
|
+
'vira-menu-multiselect': ({ inputs }) => !!inputs.isMultiSelect,
|
|
59
35
|
},
|
|
60
|
-
styles: ({hostClasses}) => css`
|
|
36
|
+
styles: ({ hostClasses }) => css `
|
|
61
37
|
:host {
|
|
62
38
|
display: flex;
|
|
63
39
|
flex-direction: column;
|
|
@@ -82,30 +58,28 @@ export const ViraMenu = defineViraElement<
|
|
|
82
58
|
}
|
|
83
59
|
|
|
84
60
|
${navAttribute.css({
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
background-color: ${viraFormCssVars['vira-form-selection-hover-
|
|
92
|
-
.value};
|
|
61
|
+
baseSelector: '.menu-item:not(.disabled):not(.selected)',
|
|
62
|
+
navValue: NavValue.Focused,
|
|
63
|
+
})}, ${navAttribute.css({
|
|
64
|
+
baseSelector: '.menu-item:not(.disabled):not(.selected)',
|
|
65
|
+
navValue: NavValue.Active,
|
|
66
|
+
})}, .menu-item:not(.disabled):not(.selected):hover {
|
|
67
|
+
background-color: ${viraFormCssVars['vira-form-selection-hover-color'].value};
|
|
93
68
|
outline: none;
|
|
94
69
|
}
|
|
95
70
|
|
|
96
71
|
${hostClasses['vira-menu-multiselect'].selector} {
|
|
97
72
|
&
|
|
98
73
|
${navAttribute.css({
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
74
|
+
baseSelector: '.menu-item:not(.disabled)',
|
|
75
|
+
navValue: NavValue.Focused,
|
|
76
|
+
})},
|
|
102
77
|
${navAttribute.css({
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
78
|
+
baseSelector: '.menu-item:not(.disabled)',
|
|
79
|
+
navValue: NavValue.Active,
|
|
80
|
+
})},
|
|
106
81
|
.menu-item:not(.disabled):hover {
|
|
107
|
-
background-color: ${viraFormCssVars['vira-form-selection-hover-
|
|
108
|
-
.value};
|
|
82
|
+
background-color: ${viraFormCssVars['vira-form-selection-hover-color'].value};
|
|
109
83
|
outline: none;
|
|
110
84
|
}
|
|
111
85
|
}
|
|
@@ -119,64 +93,61 @@ export const ViraMenu = defineViraElement<
|
|
|
119
93
|
pointer-events: auto;
|
|
120
94
|
}
|
|
121
95
|
`,
|
|
122
|
-
cleanup({inputs, state}) {
|
|
96
|
+
cleanup({ inputs, state }) {
|
|
123
97
|
if (!inputs.navController) {
|
|
124
98
|
state.internalNavController.destroy();
|
|
125
99
|
}
|
|
126
100
|
},
|
|
127
|
-
render({inputs, state}) {
|
|
101
|
+
render({ inputs, state }) {
|
|
128
102
|
assertUniqueIdProps(inputs.items);
|
|
129
|
-
|
|
130
103
|
const itemTemplates = inputs.items.map((item) => {
|
|
131
104
|
const selected = !!inputs.selected?.includes(item.id);
|
|
132
105
|
const innerTemplate = check.isString(item.label)
|
|
133
|
-
? html`
|
|
106
|
+
? html `
|
|
134
107
|
<${ViraMenuItem.assign({
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
108
|
+
label: item.label,
|
|
109
|
+
selected,
|
|
110
|
+
hideCheckIcon: inputs.hideCheckIcons,
|
|
111
|
+
})}></${ViraMenuItem}>
|
|
139
112
|
`
|
|
140
113
|
: item.label;
|
|
141
|
-
|
|
142
114
|
const disabled = item.disabled || (!inputs.isMultiSelect && selected);
|
|
143
|
-
|
|
144
115
|
if (item.route) {
|
|
145
|
-
return html`
|
|
116
|
+
return html `
|
|
146
117
|
<${ViraLink.assign({
|
|
147
|
-
|
|
148
|
-
|
|
118
|
+
route: item.route,
|
|
119
|
+
})}
|
|
149
120
|
class="menu-item ${classMap({
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
121
|
+
disabled: !!item.disabled,
|
|
122
|
+
selected,
|
|
123
|
+
})}"
|
|
153
124
|
${testId(viraMenuTestIds.item)}
|
|
154
125
|
title=${ifDefined(item.titleText || undefined)}
|
|
155
126
|
role="option"
|
|
156
|
-
${nav(state.internalNavController, {disabled})}
|
|
127
|
+
${nav(state.internalNavController, { disabled })}
|
|
157
128
|
>
|
|
158
129
|
${innerTemplate}
|
|
159
130
|
</${ViraLink}>
|
|
160
131
|
`;
|
|
161
|
-
}
|
|
162
|
-
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
return html `
|
|
163
135
|
<button
|
|
164
136
|
class="menu-item ${classMap({
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
137
|
+
disabled: !!item.disabled,
|
|
138
|
+
selected,
|
|
139
|
+
})}"
|
|
168
140
|
${testId(viraMenuTestIds.item)}
|
|
169
141
|
title=${ifDefined(item.titleText || undefined)}
|
|
170
142
|
role="option"
|
|
171
|
-
${nav(state.internalNavController, {disabled})}
|
|
143
|
+
${nav(state.internalNavController, { disabled })}
|
|
172
144
|
>
|
|
173
145
|
${innerTemplate}
|
|
174
146
|
</button>
|
|
175
147
|
`;
|
|
176
148
|
}
|
|
177
149
|
});
|
|
178
|
-
|
|
179
|
-
return html`
|
|
150
|
+
return html `
|
|
180
151
|
${itemTemplates}
|
|
181
152
|
`;
|
|
182
153
|
},
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type PartialWithUndefined } from '@augment-vir/common';
|
|
2
|
+
/**
|
|
3
|
+
* Possible corner styles for {@link ViraPopUpMenu}.
|
|
4
|
+
*
|
|
5
|
+
* @category Internal
|
|
6
|
+
*/
|
|
7
|
+
export declare enum PopUpMenuCornerStyle {
|
|
8
|
+
/** Rounding of corners depends on the open direction of the menu. */
|
|
9
|
+
Directional = "directional",
|
|
10
|
+
/** All of the menus corners should be rounded. */
|
|
11
|
+
AllRounded = "all-rounded",
|
|
12
|
+
/** None of the menus corners should be rounded. */
|
|
13
|
+
AllSquare = "all-square"
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Menu pop-up directions available for {@link ViraPopUpMenu}.
|
|
17
|
+
*
|
|
18
|
+
* @category Internal
|
|
19
|
+
*/
|
|
20
|
+
export declare enum PopUpMenuDirection {
|
|
21
|
+
Downwards = "downwards",
|
|
22
|
+
Upwards = "upwards"
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A simple default style wrapper for pop-up menus.
|
|
26
|
+
*
|
|
27
|
+
* @category PopUp
|
|
28
|
+
* @category Elements
|
|
29
|
+
*/
|
|
30
|
+
export declare const ViraPopUpMenu: import("element-vir").DeclarativeElementDefinition<"vira-pop-up-menu", PartialWithUndefined<{
|
|
31
|
+
/** @default PopUpMenuDirection.Downwards */
|
|
32
|
+
direction: PopUpMenuDirection;
|
|
33
|
+
/** @default PopUpMenuCornerStyle.Directional */
|
|
34
|
+
cornerStyle: PopUpMenuCornerStyle;
|
|
35
|
+
}>, {}, {}, "vira-pop-up-menu-open-upwards" | "vira-pop-up-menu-rounded" | "vira-pop-up-menu-square", "vira-pop-up-menu-", readonly [], readonly []>;
|
|
@@ -1,58 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {viraShadows} from '../../styles/shadows.js';
|
|
6
|
-
import {defineViraElement} from '../define-vira-element.js';
|
|
7
|
-
|
|
1
|
+
import { css, html } from 'element-vir';
|
|
2
|
+
import { viraFormCssVars } from '../../styles/form-styles.js';
|
|
3
|
+
import { viraShadows } from '../../styles/shadows.js';
|
|
4
|
+
import { defineViraElement } from '../define-vira-element.js';
|
|
8
5
|
/**
|
|
9
6
|
* Possible corner styles for {@link ViraPopUpMenu}.
|
|
10
7
|
*
|
|
11
8
|
* @category Internal
|
|
12
9
|
*/
|
|
13
|
-
export
|
|
10
|
+
export var PopUpMenuCornerStyle;
|
|
11
|
+
(function (PopUpMenuCornerStyle) {
|
|
14
12
|
/** Rounding of corners depends on the open direction of the menu. */
|
|
15
|
-
Directional =
|
|
13
|
+
PopUpMenuCornerStyle["Directional"] = "directional";
|
|
16
14
|
/** All of the menus corners should be rounded. */
|
|
17
|
-
AllRounded =
|
|
15
|
+
PopUpMenuCornerStyle["AllRounded"] = "all-rounded";
|
|
18
16
|
/** None of the menus corners should be rounded. */
|
|
19
|
-
AllSquare =
|
|
20
|
-
}
|
|
21
|
-
|
|
17
|
+
PopUpMenuCornerStyle["AllSquare"] = "all-square";
|
|
18
|
+
})(PopUpMenuCornerStyle || (PopUpMenuCornerStyle = {}));
|
|
22
19
|
/**
|
|
23
20
|
* Menu pop-up directions available for {@link ViraPopUpMenu}.
|
|
24
21
|
*
|
|
25
22
|
* @category Internal
|
|
26
23
|
*/
|
|
27
|
-
export
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
export var PopUpMenuDirection;
|
|
25
|
+
(function (PopUpMenuDirection) {
|
|
26
|
+
PopUpMenuDirection["Downwards"] = "downwards";
|
|
27
|
+
PopUpMenuDirection["Upwards"] = "upwards";
|
|
28
|
+
})(PopUpMenuDirection || (PopUpMenuDirection = {}));
|
|
32
29
|
/**
|
|
33
30
|
* A simple default style wrapper for pop-up menus.
|
|
34
31
|
*
|
|
35
32
|
* @category PopUp
|
|
36
33
|
* @category Elements
|
|
37
34
|
*/
|
|
38
|
-
export const ViraPopUpMenu = defineViraElement
|
|
39
|
-
PartialWithUndefined<{
|
|
40
|
-
/** @default PopUpMenuDirection.Downwards */
|
|
41
|
-
direction: PopUpMenuDirection;
|
|
42
|
-
/** @default PopUpMenuCornerStyle.Directional */
|
|
43
|
-
cornerStyle: PopUpMenuCornerStyle;
|
|
44
|
-
}>
|
|
45
|
-
>()({
|
|
35
|
+
export const ViraPopUpMenu = defineViraElement()({
|
|
46
36
|
tagName: 'vira-pop-up-menu',
|
|
47
37
|
hostClasses: {
|
|
48
|
-
'vira-pop-up-menu-open-upwards': ({inputs}) =>
|
|
49
|
-
|
|
50
|
-
'vira-pop-up-menu-
|
|
51
|
-
inputs.cornerStyle === PopUpMenuCornerStyle.AllRounded,
|
|
52
|
-
'vira-pop-up-menu-square': ({inputs}) =>
|
|
53
|
-
inputs.cornerStyle === PopUpMenuCornerStyle.AllSquare,
|
|
38
|
+
'vira-pop-up-menu-open-upwards': ({ inputs }) => inputs.direction === PopUpMenuDirection.Upwards,
|
|
39
|
+
'vira-pop-up-menu-rounded': ({ inputs }) => inputs.cornerStyle === PopUpMenuCornerStyle.AllRounded,
|
|
40
|
+
'vira-pop-up-menu-square': ({ inputs }) => inputs.cornerStyle === PopUpMenuCornerStyle.AllSquare,
|
|
54
41
|
},
|
|
55
|
-
styles: ({hostClasses}) => css`
|
|
42
|
+
styles: ({ hostClasses }) => css `
|
|
56
43
|
:host {
|
|
57
44
|
display: flex;
|
|
58
45
|
max-width: 100%;
|
|
@@ -60,7 +47,7 @@ export const ViraPopUpMenu = defineViraElement<
|
|
|
60
47
|
overflow-y: auto;
|
|
61
48
|
z-index: 99;
|
|
62
49
|
box-sizing: border-box;
|
|
63
|
-
border-radius: ${
|
|
50
|
+
border-radius: ${viraFormCssVars['vira-form-radius'].value};
|
|
64
51
|
border-top-left-radius: 0;
|
|
65
52
|
border-top-right-radius: 0;
|
|
66
53
|
background-color: ${viraFormCssVars['vira-form-background-color'].value};
|
|
@@ -71,7 +58,7 @@ export const ViraPopUpMenu = defineViraElement<
|
|
|
71
58
|
|
|
72
59
|
${hostClasses['vira-pop-up-menu-open-upwards'].selector} {
|
|
73
60
|
${viraShadows.menuShadowReversed}
|
|
74
|
-
border-radius: ${
|
|
61
|
+
border-radius: ${viraFormCssVars['vira-form-radius'].value};
|
|
75
62
|
border-bottom-left-radius: 0;
|
|
76
63
|
border-bottom-right-radius: 0;
|
|
77
64
|
}
|
|
@@ -81,11 +68,11 @@ export const ViraPopUpMenu = defineViraElement<
|
|
|
81
68
|
}
|
|
82
69
|
|
|
83
70
|
${hostClasses['vira-pop-up-menu-rounded'].selector} {
|
|
84
|
-
border-radius: ${
|
|
71
|
+
border-radius: ${viraFormCssVars['vira-form-radius'].value};
|
|
85
72
|
}
|
|
86
73
|
`,
|
|
87
74
|
render() {
|
|
88
|
-
return html`
|
|
75
|
+
return html `
|
|
89
76
|
<slot></slot>
|
|
90
77
|
`;
|
|
91
78
|
},
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { type PartialWithUndefined } from '@augment-vir/common';
|
|
2
|
+
import { NavController, type Coords } from 'device-navigation';
|
|
3
|
+
import { PopUpManager, type ShowPopUpResult } from '../../util/pop-up-manager.js';
|
|
4
|
+
/**
|
|
5
|
+
* Offsets applied to any menu opened by {@link ViraPopUpTrigger}.
|
|
6
|
+
*
|
|
7
|
+
* @category Internal
|
|
8
|
+
*/
|
|
9
|
+
export type PopUpOffset = PartialWithUndefined<{
|
|
10
|
+
vertical: number;
|
|
11
|
+
right: number;
|
|
12
|
+
left: number;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* Anchor options for pop-ups.
|
|
16
|
+
*
|
|
17
|
+
* @category Internal
|
|
18
|
+
*/
|
|
19
|
+
export declare enum HorizontalAnchor {
|
|
20
|
+
/**
|
|
21
|
+
* The left side of the pop-up will be anchored to the left side of the trigger, allowing the
|
|
22
|
+
* pop-up to grow on the right side of the trigger.
|
|
23
|
+
*/
|
|
24
|
+
Left = "left",
|
|
25
|
+
/**
|
|
26
|
+
* The Right side of the pop-up will be anchored to the right side of the trigger, allowing the
|
|
27
|
+
* pop-up to grow on the left side of the trigger.
|
|
28
|
+
*/
|
|
29
|
+
Right = "right",
|
|
30
|
+
/** Restrict the pop-up on both sides. */
|
|
31
|
+
Both = "both",
|
|
32
|
+
/**
|
|
33
|
+
* Automatically choose left or right based on available space, defaulting to anchoring on the
|
|
34
|
+
* left side.
|
|
35
|
+
*
|
|
36
|
+
* This is the default anchor for {@link ViraPopUpTrigger}.
|
|
37
|
+
*/
|
|
38
|
+
Auto = "auto"
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Configs for {@link ViraPopUpTrigger} pop-up positioning and sizing.
|
|
42
|
+
*
|
|
43
|
+
* @category Internal
|
|
44
|
+
*/
|
|
45
|
+
export type PopUpTriggerPosition = {
|
|
46
|
+
/**
|
|
47
|
+
* - `HorizontalAnchor.Left`: pop-up is anchored to the left side of the trigger and the pop-up
|
|
48
|
+
* can grow to the right.
|
|
49
|
+
* - `HorizontalAnchor.Right`: pop-up is anchored to the right side of the trigger and the pop-up
|
|
50
|
+
* can grow to the left.
|
|
51
|
+
* - `HorizontalAnchor.Both`: pop-up is anchored on both sides of the trigger and cannot grow
|
|
52
|
+
* beyond it.
|
|
53
|
+
* - `HorizontalAnchor.Auto`: automatically choose left or right anchor based on available space,
|
|
54
|
+
* defaulting to left anchor. (This is the default experience.)
|
|
55
|
+
*
|
|
56
|
+
* Note that when `HorizontalAnchor.Both` is _not_ used, this anchor will cancel out any
|
|
57
|
+
* `popUpOffset` for the direction _opposite_ of the chosen anchor.
|
|
58
|
+
*/
|
|
59
|
+
horizontalAnchor: HorizontalAnchor;
|
|
60
|
+
/**
|
|
61
|
+
* When `true`, the pop-up will not have its maximum width constrained to fit within the
|
|
62
|
+
* overflow container. The positioning logic (left/right) will still be applied.
|
|
63
|
+
*
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
ignoreMaxWidth: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* When `true`, the pop-up will not have its maximum height constrained to fit within the
|
|
69
|
+
* overflow container. The positioning logic (up/down) will still be applied.
|
|
70
|
+
*
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
73
|
+
ignoreMaxHeight: boolean;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* An element with slots for a pop-up trigger and pop-up contents.
|
|
77
|
+
*
|
|
78
|
+
* @category PopUp
|
|
79
|
+
* @category Elements
|
|
80
|
+
* @see https://electrovir.github.io/vira/book/elements/vira-pop-up-trigger
|
|
81
|
+
*/
|
|
82
|
+
export declare const ViraPopUpTrigger: import("element-vir").DeclarativeElementDefinition<"vira-pop-up-trigger", PartialWithUndefined<PopUpTriggerPosition & {
|
|
83
|
+
isDisabled: boolean;
|
|
84
|
+
/** For debugging purposes only. Very bad for actual production code use. */
|
|
85
|
+
z_debug_forceOpenState: boolean;
|
|
86
|
+
/** Set to `true` to keep the pop-up open if it is interacted with. */
|
|
87
|
+
keepOpenAfterInteraction: boolean;
|
|
88
|
+
/** All values in px. */
|
|
89
|
+
popUpOffset: PopUpOffset;
|
|
90
|
+
}>, {
|
|
91
|
+
/** `undefined` means the pop up is not currently showing. */
|
|
92
|
+
showPopUpResult: ShowPopUpResult | undefined;
|
|
93
|
+
popUpManager: PopUpManager;
|
|
94
|
+
}, {
|
|
95
|
+
navSelect: import("element-vir").DefineEvent<Coords>;
|
|
96
|
+
/**
|
|
97
|
+
* - `undefined` indicates that the pop-up just closed.
|
|
98
|
+
* - {@link ShowPopUpResult} indicates that the pop-up just opened.
|
|
99
|
+
*/
|
|
100
|
+
openChange: import("element-vir").DefineEvent<ShowPopUpResult | undefined>;
|
|
101
|
+
init: import("element-vir").DefineEvent<{
|
|
102
|
+
navController: NavController;
|
|
103
|
+
popUpManager: PopUpManager;
|
|
104
|
+
}>;
|
|
105
|
+
}, "vira-pop-up-trigger-disabled", "vira-pop-up-trigger-", readonly ["trigger", "popUp"], readonly []>;
|