vira 28.19.5 → 28.19.6
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/package.json +12 -12
- package/src/elements/define-vira-element.ts +29 -0
- package/src/elements/form/vira-form-fields.ts +140 -0
- package/src/elements/form/vira-form.element.ts +204 -0
- package/src/elements/pop-up/pop-up-helpers.ts +85 -0
- package/{dist/elements/pop-up/pop-up-menu-item.d.ts → src/elements/pop-up/pop-up-menu-item.ts} +4 -3
- package/{dist/elements/pop-up/vira-menu-item.element.js → src/elements/pop-up/vira-menu-item.element.ts} +28 -11
- package/src/elements/pop-up/vira-menu-trigger.element.ts +158 -0
- package/{dist/elements/pop-up/vira-menu.element.js → src/elements/pop-up/vira-menu.element.ts} +76 -49
- package/{dist/elements/pop-up/vira-pop-up-menu.element.js → src/elements/pop-up/vira-pop-up-menu.element.ts} +34 -22
- package/{dist/elements/pop-up/vira-pop-up-trigger.element.js → src/elements/pop-up/vira-pop-up-trigger.element.ts} +199 -104
- package/src/elements/shared-text-input-logic.ts +173 -0
- package/{dist/elements/vira-bold-text.element.js → src/elements/vira-bold-text.element.ts} +8 -7
- package/{dist/elements/vira-button.element.js → src/elements/vira-button.element.ts} +64 -33
- package/{dist/elements/vira-card.element.js → src/elements/vira-card.element.ts} +16 -13
- package/{dist/elements/vira-checkbox.element.js → src/elements/vira-checkbox.element.ts} +71 -28
- package/{dist/elements/vira-collapsible-wrapper.element.js → src/elements/vira-collapsible-wrapper.element.ts} +18 -16
- package/{dist/elements/vira-dropdown.element.js → src/elements/vira-dropdown.element.ts} +94 -48
- package/{dist/elements/vira-error.element.js → src/elements/vira-error.element.ts} +6 -5
- package/{dist/elements/vira-icon.element.js → src/elements/vira-icon.element.ts} +13 -6
- package/{dist/elements/vira-image.element.js → src/elements/vira-image.element.ts} +63 -43
- package/{dist/elements/vira-input.element.js → src/elements/vira-input.element.ts} +151 -85
- package/{dist/elements/vira-link.element.js → src/elements/vira-link.element.ts} +62 -11
- package/{dist/elements/vira-modal.element.js → src/elements/vira-modal.element.ts} +89 -50
- package/src/elements/vira-overflow-switch.element.ts +137 -0
- package/{dist/elements/vira-progress.element.js → src/elements/vira-progress.element.ts} +26 -11
- package/{dist/elements/vira-select.element.js → src/elements/vira-select.element.ts} +96 -41
- package/src/icons/icon-color.test-helper.ts +9 -0
- package/{dist/icons/icon-css-vars.js → src/icons/icon-css-vars.ts} +2 -1
- package/src/icons/icon-svg.ts +71 -0
- package/{dist/icons/icon-svgs/bell-24.icon.js → src/icons/icon-svgs/bell-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/chat-24.icon.js → src/icons/icon-svgs/chat-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/check-24.icon.js → src/icons/icon-svgs/check-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/chevron-down-24.icon.js → src/icons/icon-svgs/chevron-down-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/chevron-up-24.icon.js → src/icons/icon-svgs/chevron-up-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/close-x-24.icon.js → src/icons/icon-svgs/close-x-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/commit-24.icon.js → src/icons/icon-svgs/commit-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/copy-24.icon.js → src/icons/icon-svgs/copy-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/document-24.icon.js → src/icons/icon-svgs/document-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/document-search-24.icon.js → src/icons/icon-svgs/document-search-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/double-chevron-24.icon.js → src/icons/icon-svgs/double-chevron-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/element-16.icon.js → src/icons/icon-svgs/element-16.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/element-24.icon.js → src/icons/icon-svgs/element-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/external-link-24.icon.js → src/icons/icon-svgs/external-link-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/eye-closed-24.icon.js → src/icons/icon-svgs/eye-closed-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/eye-open-24.icon.js → src/icons/icon-svgs/eye-open-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/filter-24.icon.js → src/icons/icon-svgs/filter-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/link-24.icon.js → src/icons/icon-svgs/link-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/loader-24.icon.js → src/icons/icon-svgs/loader-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/loader-animated-24.icon.js → src/icons/icon-svgs/loader-animated-24.icon.ts} +8 -6
- package/{dist/icons/icon-svgs/lock-24.icon.js → src/icons/icon-svgs/lock-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/options-24.icon.js → src/icons/icon-svgs/options-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/pencil-24.icon.js → src/icons/icon-svgs/pencil-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/shield-24.icon.js → src/icons/icon-svgs/shield-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/sort-ascending-24.icon.js → src/icons/icon-svgs/sort-ascending-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/sort-descending-24.icon.js → src/icons/icon-svgs/sort-descending-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/speaker-loud-24.icon.js → src/icons/icon-svgs/speaker-loud-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/speaker-medium-24.icon.js → src/icons/icon-svgs/speaker-medium-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/speaker-muted-24.icon.js → src/icons/icon-svgs/speaker-muted-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/speaker-quiet-24.icon.js → src/icons/icon-svgs/speaker-quiet-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/star-24.icon.js → src/icons/icon-svgs/star-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/status-failure-24.icon.js → src/icons/icon-svgs/status-failure-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/status-in-progress-24.icon.js → src/icons/icon-svgs/status-in-progress-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/status-success-24.icon.js → src/icons/icon-svgs/status-success-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/status-unknown-24.icon.js → src/icons/icon-svgs/status-unknown-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/status-warning-24.icon.js → src/icons/icon-svgs/status-warning-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/upload-24.icon.js → src/icons/icon-svgs/upload-24.icon.ts} +5 -4
- package/{dist/icons/icon-svgs/x-24.icon.js → src/icons/icon-svgs/x-24.icon.ts} +5 -4
- package/{dist/icons/index.js → src/icons/index.ts} +43 -39
- package/{dist/styles/border.js → src/styles/border.ts} +2 -1
- package/{dist/styles/disabled.js → src/styles/disabled.ts} +3 -2
- package/{dist/styles/durations.js → src/styles/durations.ts} +2 -1
- package/{dist/styles/focus.js → src/styles/focus.ts} +32 -8
- package/{dist/styles/font.js → src/styles/font.ts} +2 -1
- package/{dist/styles/form-styles.js → src/styles/form-styles.ts} +6 -1
- package/{dist/styles/index.js → src/styles/index.ts} +1 -0
- package/{dist/styles/native-styles.js → src/styles/native-styles.ts} +5 -3
- package/{dist/styles/scrollbar.js → src/styles/scrollbar.ts} +4 -3
- package/{dist/styles/shadows.js → src/styles/shadows.ts} +8 -6
- package/{dist/styles/user-select.js → src/styles/user-select.ts} +3 -2
- package/{dist/styles/vira-color-palette.js → src/styles/vira-color-palette.ts} +11 -1
- package/src/styles/vira-color-theme.ts +1142 -0
- package/src/util/define-table.ts +279 -0
- package/src/util/dynamic-element.ts +129 -0
- package/src/util/pop-up-manager.ts +380 -0
- package/dist/elements/define-vira-element.d.ts +0 -18
- package/dist/elements/define-vira-element.js +0 -19
- package/dist/elements/form/vira-form-fields.d.ts +0 -100
- package/dist/elements/form/vira-form-fields.js +0 -60
- package/dist/elements/form/vira-form.element.d.ts +0 -35
- package/dist/elements/form/vira-form.element.js +0 -151
- package/dist/elements/index.js +0 -25
- package/dist/elements/pop-up/pop-up-helpers.d.ts +0 -33
- package/dist/elements/pop-up/pop-up-helpers.js +0 -58
- package/dist/elements/pop-up/pop-up-menu-item.js +0 -1
- package/dist/elements/pop-up/vira-menu-item.element.d.ts +0 -19
- package/dist/elements/pop-up/vira-menu-trigger.element.d.ts +0 -41
- package/dist/elements/pop-up/vira-menu-trigger.element.js +0 -121
- package/dist/elements/pop-up/vira-menu.element.d.ts +0 -38
- package/dist/elements/pop-up/vira-pop-up-menu.element.d.ts +0 -35
- package/dist/elements/pop-up/vira-pop-up-trigger.element.d.ts +0 -105
- package/dist/elements/shared-text-input-logic.d.ts +0 -63
- package/dist/elements/shared-text-input-logic.js +0 -101
- package/dist/elements/vira-bold-text.element.d.ts +0 -9
- package/dist/elements/vira-button.element.d.ts +0 -31
- package/dist/elements/vira-card.element.d.ts +0 -18
- package/dist/elements/vira-checkbox.element.d.ts +0 -34
- package/dist/elements/vira-collapsible-wrapper.element.d.ts +0 -14
- package/dist/elements/vira-dropdown.element.d.ts +0 -46
- package/dist/elements/vira-error.element.d.ts +0 -7
- package/dist/elements/vira-icon.element.d.ts +0 -13
- package/dist/elements/vira-image.element.d.ts +0 -45
- package/dist/elements/vira-input.element.d.ts +0 -62
- package/dist/elements/vira-link.element.d.ts +0 -73
- package/dist/elements/vira-modal.element.d.ts +0 -39
- package/dist/elements/vira-overflow-switch.element.d.ts +0 -21
- package/dist/elements/vira-overflow-switch.element.js +0 -110
- package/dist/elements/vira-progress.element.d.ts +0 -18
- package/dist/elements/vira-select.element.d.ts +0 -48
- package/dist/icons/icon-color.test-helper.d.ts +0 -6
- package/dist/icons/icon-color.test-helper.js +0 -9
- package/dist/icons/icon-css-vars.d.ts +0 -14
- package/dist/icons/icon-svg.d.ts +0 -27
- package/dist/icons/icon-svg.js +0 -48
- package/dist/icons/icon-svgs/bell-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/chat-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/check-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/chevron-down-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/chevron-up-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/close-x-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/commit-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/copy-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/document-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/document-search-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/double-chevron-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/element-16.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/element-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/external-link-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/eye-closed-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/eye-open-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/filter-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/link-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/loader-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/loader-animated-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/lock-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/options-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/pencil-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/shield-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/sort-ascending-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/sort-descending-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/speaker-loud-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/speaker-medium-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/speaker-muted-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/speaker-quiet-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/star-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/status-failure-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/status-in-progress-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/status-success-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/status-unknown-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/status-warning-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/upload-24.icon.d.ts +0 -8
- package/dist/icons/icon-svgs/x-24.icon.d.ts +0 -8
- package/dist/icons/index.d.ts +0 -86
- package/dist/index.js +0 -4
- package/dist/styles/border.d.ts +0 -9
- package/dist/styles/disabled.d.ts +0 -6
- package/dist/styles/durations.d.ts +0 -22
- package/dist/styles/focus.d.ts +0 -31
- package/dist/styles/font.d.ts +0 -9
- package/dist/styles/form-styles.d.ts +0 -20
- package/dist/styles/index.d.ts +0 -13
- package/dist/styles/native-styles.d.ts +0 -13
- package/dist/styles/scrollbar.d.ts +0 -6
- package/dist/styles/shadows.d.ts +0 -20
- package/dist/styles/user-select.d.ts +0 -6
- package/dist/styles/vira-color-palette.d.ts +0 -95
- package/dist/styles/vira-color-theme.d.ts +0 -1184
- package/dist/styles/vira-color-theme.js +0 -1137
- package/dist/util/define-table.d.ts +0 -110
- package/dist/util/define-table.js +0 -115
- package/dist/util/dynamic-element.d.ts +0 -63
- package/dist/util/dynamic-element.js +0 -61
- package/dist/util/index.js +0 -3
- package/dist/util/pop-up-manager.d.ts +0 -186
- package/dist/util/pop-up-manager.js +0 -214
- /package/{dist/elements/index.d.ts → src/elements/index.ts} +0 -0
- /package/{dist/index.d.ts → src/index.ts} +0 -0
- /package/{dist/util/index.d.ts → src/util/index.ts} +0 -0
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { getObjectTypedEntries } from '@augment-vir/common';
|
|
2
|
-
import { css, defineElementEvent, html, listen, nothing, testId } from 'element-vir';
|
|
3
|
-
import { defineViraElement } from '../define-vira-element.js';
|
|
4
|
-
import { ViraCheckbox } from '../vira-checkbox.element.js';
|
|
5
|
-
import { ViraInput, ViraInputType } from '../vira-input.element.js';
|
|
6
|
-
import { ViraSelect } from '../vira-select.element.js';
|
|
7
|
-
import { applyRequiredLabel, areFormFieldsValid, ViraFormFieldType, } from './vira-form-fields.js';
|
|
8
|
-
/**
|
|
9
|
-
* A form element.
|
|
10
|
-
*
|
|
11
|
-
* @category Elements
|
|
12
|
-
* @see https://electrovir.github.io/vira/book/elements/vira-form
|
|
13
|
-
*/
|
|
14
|
-
export const ViraForm = defineViraElement()({
|
|
15
|
-
tagName: 'vira-form',
|
|
16
|
-
events: {
|
|
17
|
-
valueChange: defineElementEvent(),
|
|
18
|
-
validChange: defineElementEvent(),
|
|
19
|
-
},
|
|
20
|
-
styles: css `
|
|
21
|
-
:host {
|
|
22
|
-
display: flex;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
form {
|
|
26
|
-
display: flex;
|
|
27
|
-
flex-grow: 1;
|
|
28
|
-
flex-direction: column;
|
|
29
|
-
align-items: stretch;
|
|
30
|
-
gap: 10px;
|
|
31
|
-
|
|
32
|
-
> * {
|
|
33
|
-
width: unset;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
`,
|
|
37
|
-
state() {
|
|
38
|
-
return {
|
|
39
|
-
lastIsValid: false,
|
|
40
|
-
};
|
|
41
|
-
},
|
|
42
|
-
render({ inputs, dispatch, events, state, updateState }) {
|
|
43
|
-
const currentIsValid = areFormFieldsValid(inputs.fields);
|
|
44
|
-
if (currentIsValid !== state.lastIsValid) {
|
|
45
|
-
updateState({
|
|
46
|
-
lastIsValid: currentIsValid,
|
|
47
|
-
});
|
|
48
|
-
dispatch(new events.validChange({ allFieldsAreValid: currentIsValid }));
|
|
49
|
-
}
|
|
50
|
-
const formFieldTemplates = getObjectTypedEntries(inputs.fields).map(([key, field,]) => {
|
|
51
|
-
if (field.isHidden) {
|
|
52
|
-
return nothing;
|
|
53
|
-
}
|
|
54
|
-
else if (field.type === ViraFormFieldType.Checkbox) {
|
|
55
|
-
return html `
|
|
56
|
-
<${ViraCheckbox.assign({
|
|
57
|
-
value: field.value || false,
|
|
58
|
-
disabled: inputs.isDisabled || field.isDisabled,
|
|
59
|
-
hasError: field.hasError,
|
|
60
|
-
label: applyRequiredLabel(field.label, !!field.isRequired && !inputs.hideRequiredMarkers),
|
|
61
|
-
})}
|
|
62
|
-
${field.testId ? testId(field.testId) : nothing}
|
|
63
|
-
${listen(ViraCheckbox.events.valueChange, (event) => {
|
|
64
|
-
dispatch(new events.valueChange({
|
|
65
|
-
key,
|
|
66
|
-
...field,
|
|
67
|
-
value: event.detail,
|
|
68
|
-
}));
|
|
69
|
-
})}
|
|
70
|
-
></${ViraCheckbox}>
|
|
71
|
-
`;
|
|
72
|
-
}
|
|
73
|
-
else if (field.type === ViraFormFieldType.Select) {
|
|
74
|
-
return html `
|
|
75
|
-
<${ViraSelect.assign({
|
|
76
|
-
options: field.options,
|
|
77
|
-
value: field.value,
|
|
78
|
-
placeholder: field.placeholder,
|
|
79
|
-
disabled: inputs.isDisabled || field.isDisabled,
|
|
80
|
-
label: applyRequiredLabel(field.label, !!field.isRequired && !inputs.hideRequiredMarkers),
|
|
81
|
-
hasError: field.hasError,
|
|
82
|
-
icon: field.icon,
|
|
83
|
-
})}
|
|
84
|
-
${field.testId ? testId(field.testId) : nothing}
|
|
85
|
-
${listen(ViraSelect.events.valueChange, (event) => {
|
|
86
|
-
dispatch(new events.valueChange({
|
|
87
|
-
key,
|
|
88
|
-
...field,
|
|
89
|
-
value: event.detail,
|
|
90
|
-
}));
|
|
91
|
-
})}
|
|
92
|
-
></${ViraSelect}>
|
|
93
|
-
`;
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
return html `
|
|
97
|
-
<${ViraInput.assign({
|
|
98
|
-
value: field.value || '',
|
|
99
|
-
disabled: inputs.isDisabled || field.isDisabled,
|
|
100
|
-
hasError: field.hasError,
|
|
101
|
-
icon: field.icon,
|
|
102
|
-
label: applyRequiredLabel(field.label, !!field.isRequired && !inputs.hideRequiredMarkers),
|
|
103
|
-
placeholder: field.placeholder,
|
|
104
|
-
showClearButton: inputs.showClearButtons,
|
|
105
|
-
attributePassthrough: field.isUsername
|
|
106
|
-
? {
|
|
107
|
-
autocomplete: 'username',
|
|
108
|
-
}
|
|
109
|
-
: field.type === ViraFormFieldType.NewPassword
|
|
110
|
-
? {
|
|
111
|
-
autocomplete: 'new-password',
|
|
112
|
-
}
|
|
113
|
-
: field.type === ViraFormFieldType.ExistingPassword
|
|
114
|
-
? {
|
|
115
|
-
autocomplete: 'password',
|
|
116
|
-
}
|
|
117
|
-
: field.type === ViraFormFieldType.Email
|
|
118
|
-
? {
|
|
119
|
-
autocomplete: 'email',
|
|
120
|
-
}
|
|
121
|
-
: {},
|
|
122
|
-
type: [
|
|
123
|
-
ViraFormFieldType.NewPassword,
|
|
124
|
-
ViraFormFieldType.ExistingPassword,
|
|
125
|
-
ViraFormFieldType.PlainPassword,
|
|
126
|
-
].includes(field.type)
|
|
127
|
-
? ViraInputType.Password
|
|
128
|
-
: field.type === ViraFormFieldType.Email
|
|
129
|
-
? ViraInputType.Email
|
|
130
|
-
: ViraInputType.Default,
|
|
131
|
-
})}
|
|
132
|
-
${field.testId ? testId(field.testId) : nothing}
|
|
133
|
-
${listen(ViraInput.events.valueChange, (event) => {
|
|
134
|
-
dispatch(new events.valueChange({
|
|
135
|
-
key,
|
|
136
|
-
...field,
|
|
137
|
-
value: event.detail,
|
|
138
|
-
}));
|
|
139
|
-
})}
|
|
140
|
-
></${ViraInput}>
|
|
141
|
-
`;
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
return html `
|
|
145
|
-
<form ${listen('submit', (event) => event.preventDefault())}>
|
|
146
|
-
${formFieldTemplates}
|
|
147
|
-
<slot></slot>
|
|
148
|
-
</form>
|
|
149
|
-
`;
|
|
150
|
-
},
|
|
151
|
-
});
|
package/dist/elements/index.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export * from './define-vira-element.js';
|
|
2
|
-
export * from './form/vira-form-fields.js';
|
|
3
|
-
export * from './form/vira-form.element.js';
|
|
4
|
-
export * from './pop-up/pop-up-helpers.js';
|
|
5
|
-
export * from './pop-up/pop-up-menu-item.js';
|
|
6
|
-
export * from './pop-up/vira-menu-item.element.js';
|
|
7
|
-
export * from './pop-up/vira-menu-trigger.element.js';
|
|
8
|
-
export * from './pop-up/vira-menu.element.js';
|
|
9
|
-
export * from './pop-up/vira-pop-up-menu.element.js';
|
|
10
|
-
export * from './pop-up/vira-pop-up-trigger.element.js';
|
|
11
|
-
export * from './vira-bold-text.element.js';
|
|
12
|
-
export * from './vira-button.element.js';
|
|
13
|
-
export * from './vira-card.element.js';
|
|
14
|
-
export * from './vira-checkbox.element.js';
|
|
15
|
-
export * from './vira-collapsible-wrapper.element.js';
|
|
16
|
-
export * from './vira-dropdown.element.js';
|
|
17
|
-
export * from './vira-error.element.js';
|
|
18
|
-
export * from './vira-icon.element.js';
|
|
19
|
-
export * from './vira-image.element.js';
|
|
20
|
-
export * from './vira-input.element.js';
|
|
21
|
-
export * from './vira-link.element.js';
|
|
22
|
-
export * from './vira-modal.element.js';
|
|
23
|
-
export * from './vira-overflow-switch.element.js';
|
|
24
|
-
export * from './vira-progress.element.js';
|
|
25
|
-
export * from './vira-select.element.js';
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { type PartialWithUndefined } from '@augment-vir/common';
|
|
2
|
-
import { type PopUpManager, type PopUpManagerOptions, type ShowPopUpResult } from '../../util/pop-up-manager.js';
|
|
3
|
-
import { type MenuItem } from './pop-up-menu-item.js';
|
|
4
|
-
/**
|
|
5
|
-
* Verifies that all items have unique ids.
|
|
6
|
-
*
|
|
7
|
-
* @category Internal
|
|
8
|
-
*/
|
|
9
|
-
export declare function assertUniqueIdProps(items: ReadonlyArray<Readonly<{
|
|
10
|
-
id: PropertyKey;
|
|
11
|
-
}>>): void;
|
|
12
|
-
/**
|
|
13
|
-
* Creates a new array of selections based on the current selection and new selection id. This
|
|
14
|
-
* behaves differently when multi select is enabled, hence this function.
|
|
15
|
-
*
|
|
16
|
-
* @category Internal
|
|
17
|
-
*/
|
|
18
|
-
export declare function updateSelectedItems(
|
|
19
|
-
/** The item that should be newly toggled. */
|
|
20
|
-
newItem: Readonly<MenuItem>, currentSelection?: ReadonlyArray<PropertyKey>, isMultiSelect?: boolean): PropertyKey[];
|
|
21
|
-
/**
|
|
22
|
-
* Handles toggling pop up state for `ViraDropdown`.
|
|
23
|
-
*
|
|
24
|
-
* @category Internal
|
|
25
|
-
*/
|
|
26
|
-
export declare function triggerPopUpState({ open, callback, popUpManager, host, options, }: Readonly<{
|
|
27
|
-
open: boolean;
|
|
28
|
-
popUpManager: PopUpManager;
|
|
29
|
-
host: HTMLElement;
|
|
30
|
-
} & PartialWithUndefined<{
|
|
31
|
-
callback?: ((showPopUpResult: ShowPopUpResult | undefined) => void) | undefined;
|
|
32
|
-
options?: Partial<PopUpManagerOptions> | undefined;
|
|
33
|
-
}>>): void;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { joinWithFinalConjunction } from '@augment-vir/common';
|
|
2
|
-
/**
|
|
3
|
-
* Verifies that all items have unique ids.
|
|
4
|
-
*
|
|
5
|
-
* @category Internal
|
|
6
|
-
*/
|
|
7
|
-
export function assertUniqueIdProps(items) {
|
|
8
|
-
const usedIds = new Set();
|
|
9
|
-
const duplicateIds = [];
|
|
10
|
-
items.forEach((option) => {
|
|
11
|
-
if (usedIds.has(option.id)) {
|
|
12
|
-
duplicateIds.push(option.id);
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
usedIds.add(option.id);
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
if (duplicateIds.length) {
|
|
19
|
-
throw new Error(`Duplicate option ids were given: ${joinWithFinalConjunction(duplicateIds)}`);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Creates a new array of selections based on the current selection and new selection id. This
|
|
24
|
-
* behaves differently when multi select is enabled, hence this function.
|
|
25
|
-
*
|
|
26
|
-
* @category Internal
|
|
27
|
-
*/
|
|
28
|
-
export function updateSelectedItems(
|
|
29
|
-
/** The item that should be newly toggled. */
|
|
30
|
-
newItem, currentSelection = [], isMultiSelect = false) {
|
|
31
|
-
if (isMultiSelect) {
|
|
32
|
-
return currentSelection.includes(newItem.id)
|
|
33
|
-
? currentSelection.filter((entry) => entry !== newItem.id)
|
|
34
|
-
: [
|
|
35
|
-
...currentSelection,
|
|
36
|
-
newItem.id,
|
|
37
|
-
];
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
/** In single select, only the toggled item is allowed. */
|
|
41
|
-
return [newItem.id];
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Handles toggling pop up state for `ViraDropdown`.
|
|
46
|
-
*
|
|
47
|
-
* @category Internal
|
|
48
|
-
*/
|
|
49
|
-
export function triggerPopUpState({ open, callback, popUpManager, host, options, }) {
|
|
50
|
-
if (open) {
|
|
51
|
-
const showPopUpResult = popUpManager.showPopUp(host, options);
|
|
52
|
-
callback?.(showPopUpResult);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
popUpManager.removePopUp();
|
|
56
|
-
callback?.(undefined);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type PartialWithUndefined } from '@augment-vir/common';
|
|
2
|
-
import { type MenuItem } from './pop-up-menu-item.js';
|
|
3
|
-
/**
|
|
4
|
-
* An element for an individual menu item.
|
|
5
|
-
*
|
|
6
|
-
* @category PopUp
|
|
7
|
-
* @category Elements
|
|
8
|
-
*/
|
|
9
|
-
export declare const ViraMenuItem: import("element-vir").DeclarativeElementDefinition<"vira-menu-item", Readonly<{
|
|
10
|
-
selected: boolean;
|
|
11
|
-
} & PartialWithUndefined<{
|
|
12
|
-
/**
|
|
13
|
-
* The text to show in the menu item. If this is not provided, it is expected that you
|
|
14
|
-
* will instead utilize this element's `<slot>`.
|
|
15
|
-
*/
|
|
16
|
-
label: MenuItem["label"];
|
|
17
|
-
/** If `true`, does not render the selected check icon. */
|
|
18
|
-
hideCheckIcon: boolean;
|
|
19
|
-
}>>, {}, {}, "vira-menu-item-selected", "vira-menu-item-", readonly [], readonly []>;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { type PartialWithUndefined } from '@augment-vir/common';
|
|
2
|
-
import { type NavController } from 'device-navigation';
|
|
3
|
-
import { type PopUpManager, type ShowPopUpResult } from '../../util/pop-up-manager.js';
|
|
4
|
-
import { type MenuItem } from './pop-up-menu-item.js';
|
|
5
|
-
import { type PopUpMenuCornerStyle } from './vira-pop-up-menu.element.js';
|
|
6
|
-
import { type PopUpOffset, type PopUpTriggerPosition } from './vira-pop-up-trigger.element.js';
|
|
7
|
-
/**
|
|
8
|
-
* Test ids for {@link ViraMenuTrigger}.
|
|
9
|
-
*
|
|
10
|
-
* @category Internal
|
|
11
|
-
*/
|
|
12
|
-
export declare const viraMenuTriggerTestIds: {
|
|
13
|
-
menu: string;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* A more specific wrapper of `ViraPopUpTrigger` that always opens a menu.
|
|
17
|
-
*
|
|
18
|
-
* @category PopUp
|
|
19
|
-
* @category Elements
|
|
20
|
-
*/
|
|
21
|
-
export declare const ViraMenuTrigger: import("element-vir").DeclarativeElementDefinition<"vira-menu-trigger", {
|
|
22
|
-
items: ReadonlyArray<Readonly<MenuItem>>;
|
|
23
|
-
} & PartialWithUndefined<{
|
|
24
|
-
/** The selected item ids from the given `items` object. */
|
|
25
|
-
selected: ReadonlyArray<PropertyKey>;
|
|
26
|
-
isDisabled: boolean;
|
|
27
|
-
isMultiSelect: boolean;
|
|
28
|
-
z_debug_forceOpenState: boolean;
|
|
29
|
-
popUpOffset: PopUpOffset;
|
|
30
|
-
/** Hide menu item check mark icons. */
|
|
31
|
-
hideCheckIcons: boolean;
|
|
32
|
-
menuCornerStyle: PopUpMenuCornerStyle;
|
|
33
|
-
} & PopUpTriggerPosition>, {
|
|
34
|
-
navController: undefined | NavController;
|
|
35
|
-
popUpManager: undefined | PopUpManager;
|
|
36
|
-
/** `undefined` means the pop up is not currently showing. */
|
|
37
|
-
showPopUpResult: ShowPopUpResult | undefined;
|
|
38
|
-
}, {
|
|
39
|
-
itemActivate: import("element-vir").DefineEvent<PropertyKey[]>;
|
|
40
|
-
openChange: import("element-vir").DefineEvent<ShowPopUpResult | undefined>;
|
|
41
|
-
}, "vira-menu-trigger-", "vira-menu-trigger-", readonly [], readonly []>;
|
|
@@ -1,121 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,38 +0,0 @@
|
|
|
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 []>;
|
|
@@ -1,35 +0,0 @@
|
|
|
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,105 +0,0 @@
|
|
|
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 []>;
|