vira 28.19.4 → 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 +13 -13
- 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} +200 -91
- 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 -180
- package/dist/util/pop-up-manager.js +0 -203
- /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,22 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import {type PartialWithUndefined} from '@augment-vir/common';
|
|
2
|
+
import {css, html, nothing} from 'element-vir';
|
|
3
|
+
import {type ViraIconSvg} from '../icons/index.js';
|
|
4
|
+
import {viraBorders} from '../styles/border.js';
|
|
5
|
+
import {viraDisabledStyles} from '../styles/disabled.js';
|
|
6
|
+
import {viraAnimationDurations} from '../styles/durations.js';
|
|
7
|
+
import {createFocusStyles, viraFocusCssVars} from '../styles/focus.js';
|
|
8
|
+
import {noUserSelect} from '../styles/index.js';
|
|
9
|
+
import {noNativeFormStyles} from '../styles/native-styles.js';
|
|
10
|
+
import {defineViraElement} from './define-vira-element.js';
|
|
11
|
+
import {ViraIcon} from './vira-icon.element.js';
|
|
12
|
+
|
|
10
13
|
/**
|
|
11
14
|
* Button styles available for {@link ViraButton}.
|
|
12
15
|
*
|
|
13
16
|
* @category Button
|
|
14
17
|
*/
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
export enum ViraButtonStyle {
|
|
19
|
+
Default = 'vira-button-default',
|
|
20
|
+
Outline = 'vira-button-outline',
|
|
21
|
+
}
|
|
22
|
+
|
|
20
23
|
/**
|
|
21
24
|
* A custom button with default styling.
|
|
22
25
|
*
|
|
@@ -24,25 +27,42 @@ export var ViraButtonStyle;
|
|
|
24
27
|
* @category Elements
|
|
25
28
|
* @see https://electrovir.github.io/vira/book/elements/vira-button
|
|
26
29
|
*/
|
|
27
|
-
export const ViraButton = defineViraElement
|
|
30
|
+
export const ViraButton = defineViraElement<
|
|
31
|
+
PartialWithUndefined<{
|
|
32
|
+
text: string;
|
|
33
|
+
icon: Pick<ViraIconSvg, 'svgTemplate'>;
|
|
34
|
+
disabled: boolean;
|
|
35
|
+
buttonStyle: ViraButtonStyle;
|
|
36
|
+
/**
|
|
37
|
+
* When set to `true`, the given icon (if any) will take up its full dimensions, potentially
|
|
38
|
+
* increasing the button's size.
|
|
39
|
+
*
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
expandToFitIcon: boolean;
|
|
43
|
+
}>
|
|
44
|
+
>()({
|
|
28
45
|
tagName: 'vira-button',
|
|
29
46
|
hostClasses: {
|
|
30
|
-
'vira-button-outline-style': ({
|
|
31
|
-
'vira-button-disabled': ({
|
|
32
|
-
'vira-button-expand-to-fit-icon': ({
|
|
47
|
+
'vira-button-outline-style': ({inputs}) => inputs.buttonStyle === ViraButtonStyle.Outline,
|
|
48
|
+
'vira-button-disabled': ({inputs}) => !!inputs.disabled,
|
|
49
|
+
'vira-button-expand-to-fit-icon': ({inputs}) => !!inputs.expandToFitIcon,
|
|
33
50
|
},
|
|
34
51
|
cssVars: {
|
|
35
52
|
/** On the default button style this is the background color. */
|
|
36
53
|
'vira-button-primary-color': '#0a89ff',
|
|
37
54
|
'vira-button-primary-hover-color': '#59b1ff',
|
|
38
55
|
'vira-button-primary-active-color': '#007ff6',
|
|
56
|
+
|
|
39
57
|
/** On the default button style this is the text color. */
|
|
40
58
|
'vira-button-secondary-color': '#ffffff',
|
|
59
|
+
|
|
41
60
|
'vira-button-padding': '5px 10px',
|
|
61
|
+
|
|
42
62
|
'vira-button-internal-foreground-color': '',
|
|
43
63
|
'vira-button-internal-background-color': '',
|
|
44
64
|
},
|
|
45
|
-
styles: ({
|
|
65
|
+
styles: ({hostClasses, cssVars}) => css`
|
|
46
66
|
:host {
|
|
47
67
|
font-weight: bold;
|
|
48
68
|
display: inline-flex;
|
|
@@ -51,19 +71,29 @@ export const ViraButton = defineViraElement()({
|
|
|
51
71
|
align-items: center;
|
|
52
72
|
box-sizing: border-box;
|
|
53
73
|
${noUserSelect};
|
|
54
|
-
${cssVars['vira-button-internal-background-color'].name}: ${cssVars[
|
|
55
|
-
|
|
56
|
-
|
|
74
|
+
${cssVars['vira-button-internal-background-color'].name}: ${cssVars[
|
|
75
|
+
'vira-button-primary-color'
|
|
76
|
+
].value};
|
|
77
|
+
${cssVars['vira-button-internal-foreground-color'].name}: ${cssVars[
|
|
78
|
+
'vira-button-secondary-color'
|
|
79
|
+
].value};
|
|
80
|
+
${viraFocusCssVars['vira-focus-outline-color'].name}: ${cssVars[
|
|
81
|
+
'vira-button-primary-hover-color'
|
|
82
|
+
].value}
|
|
57
83
|
}
|
|
58
84
|
|
|
59
85
|
:host(:hover) button,
|
|
60
86
|
button:hover {
|
|
61
|
-
${cssVars['vira-button-internal-background-color'].name}: ${cssVars[
|
|
87
|
+
${cssVars['vira-button-internal-background-color'].name}: ${cssVars[
|
|
88
|
+
'vira-button-primary-hover-color'
|
|
89
|
+
].value};
|
|
62
90
|
}
|
|
63
91
|
|
|
64
92
|
:host(:active) button,
|
|
65
93
|
button:active {
|
|
66
|
-
${cssVars['vira-button-internal-background-color'].name}: ${cssVars[
|
|
94
|
+
${cssVars['vira-button-internal-background-color'].name}: ${cssVars[
|
|
95
|
+
'vira-button-primary-active-color'
|
|
96
|
+
].value};
|
|
67
97
|
}
|
|
68
98
|
|
|
69
99
|
${hostClasses['vira-button-disabled'].selector} {
|
|
@@ -98,8 +128,8 @@ export const ViraButton = defineViraElement()({
|
|
|
98
128
|
border-color ${viraAnimationDurations['vira-interaction-animation-duration'].value};
|
|
99
129
|
|
|
100
130
|
${createFocusStyles({
|
|
101
|
-
|
|
102
|
-
|
|
131
|
+
elementBorderSize: 2,
|
|
132
|
+
})}
|
|
103
133
|
}
|
|
104
134
|
|
|
105
135
|
.empty-text {
|
|
@@ -118,22 +148,23 @@ export const ViraButton = defineViraElement()({
|
|
|
118
148
|
}
|
|
119
149
|
}
|
|
120
150
|
`,
|
|
121
|
-
render: ({
|
|
151
|
+
render: ({inputs}) => {
|
|
122
152
|
const iconTemplate = inputs.icon
|
|
123
|
-
? html
|
|
153
|
+
? html`
|
|
124
154
|
<${ViraIcon.assign({
|
|
125
|
-
|
|
126
|
-
|
|
155
|
+
icon: inputs.icon,
|
|
156
|
+
})}></${ViraIcon}>
|
|
127
157
|
`
|
|
128
158
|
: nothing;
|
|
129
159
|
const textTemplate = inputs.text
|
|
130
|
-
? html
|
|
160
|
+
? html`
|
|
131
161
|
<span class="text-template">${inputs.text}</span>
|
|
132
162
|
`
|
|
133
|
-
: html
|
|
163
|
+
: html`
|
|
134
164
|
<span class="empty-text"> </span>
|
|
135
165
|
`;
|
|
136
|
-
|
|
166
|
+
|
|
167
|
+
return html`
|
|
137
168
|
<button ?disabled=${inputs.disabled}>${iconTemplate} ${textTemplate}</button>
|
|
138
169
|
`;
|
|
139
170
|
},
|
|
@@ -1,34 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import {css, html} from 'element-vir';
|
|
2
|
+
import {viraFormCssVars} from '../styles/form-styles.js';
|
|
3
|
+
import {defineViraElement} from './define-vira-element.js';
|
|
4
|
+
|
|
4
5
|
/**
|
|
5
6
|
* State options for {@link ViraCard}.
|
|
6
7
|
*
|
|
7
8
|
* @category Internal
|
|
8
9
|
*/
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
export enum ViraCardState {
|
|
11
|
+
Error = 'error',
|
|
12
|
+
Success = 'success',
|
|
13
|
+
}
|
|
14
|
+
|
|
14
15
|
/**
|
|
15
16
|
* A simple wrapper "card" element that is just a `<slot>` with some styles.
|
|
16
17
|
*
|
|
17
18
|
* @category Elements
|
|
18
19
|
* @see https://electrovir.github.io/vira/book/elements/vira-card
|
|
19
20
|
*/
|
|
20
|
-
export const ViraCard = defineViraElement
|
|
21
|
+
export const ViraCard = defineViraElement<{
|
|
22
|
+
cardState?: ViraCardState | undefined;
|
|
23
|
+
}>()({
|
|
21
24
|
tagName: 'vira-card',
|
|
22
25
|
hostClasses: {
|
|
23
|
-
'vira-card-error': ({
|
|
24
|
-
'vira-card-success': ({
|
|
26
|
+
'vira-card-error': ({inputs}) => inputs.cardState === ViraCardState.Error,
|
|
27
|
+
'vira-card-success': ({inputs}) => inputs.cardState === ViraCardState.Success,
|
|
25
28
|
},
|
|
26
29
|
cssVars: {
|
|
27
30
|
'vira-card-border': '1px solid #d3d3d3',
|
|
28
31
|
'vira-card-border-radius': '16px',
|
|
29
32
|
'vira-card-padding': '16px',
|
|
30
33
|
},
|
|
31
|
-
styles: ({
|
|
34
|
+
styles: ({hostClasses, cssVars}) => css`
|
|
32
35
|
:host {
|
|
33
36
|
display: block;
|
|
34
37
|
border: ${cssVars['vira-card-border'].value};
|
|
@@ -44,7 +47,7 @@ export const ViraCard = defineViraElement()({
|
|
|
44
47
|
}
|
|
45
48
|
`,
|
|
46
49
|
render() {
|
|
47
|
-
return html
|
|
50
|
+
return html`
|
|
48
51
|
<slot></slot>
|
|
49
52
|
`;
|
|
50
53
|
},
|
|
@@ -1,11 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import {type PartialWithUndefined} from '@augment-vir/common';
|
|
2
|
+
import {
|
|
3
|
+
attributes,
|
|
4
|
+
classMap,
|
|
5
|
+
css,
|
|
6
|
+
defineElementEvent,
|
|
7
|
+
html,
|
|
8
|
+
ifDefined,
|
|
9
|
+
listen,
|
|
10
|
+
listenToActivate,
|
|
11
|
+
nothing,
|
|
12
|
+
type AttributeValues,
|
|
13
|
+
type CSSResult,
|
|
14
|
+
} from 'element-vir';
|
|
15
|
+
import {Check24Icon, viraIconCssVars} from '../icons/index.js';
|
|
16
|
+
import {viraBorders} from '../styles/border.js';
|
|
17
|
+
import {viraDisabledStyles} from '../styles/disabled.js';
|
|
18
|
+
import {createFocusStyles} from '../styles/focus.js';
|
|
19
|
+
import {viraFormCssVars} from '../styles/form-styles.js';
|
|
20
|
+
import {defineViraElement} from './define-vira-element.js';
|
|
21
|
+
import {ViraIcon} from './vira-icon.element.js';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* All inner elements supported by {@link ViraCheckbox}.
|
|
25
|
+
*
|
|
26
|
+
* @category Internals
|
|
27
|
+
*/
|
|
28
|
+
export type ViraCheckboxInnerElements =
|
|
29
|
+
| 'label'
|
|
30
|
+
| 'custom-checkbox'
|
|
31
|
+
| 'text'
|
|
32
|
+
| typeof ViraIcon.tagName;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Inputs for {@link ViraCheckbox}.
|
|
36
|
+
*
|
|
37
|
+
* @category Internal
|
|
38
|
+
*/
|
|
39
|
+
export type ViraCheckboxInputs = PartialWithUndefined<{
|
|
40
|
+
stylePassthrough: Partial<Record<ViraCheckboxInnerElements, CSSResult>>;
|
|
41
|
+
attributePassthrough: Partial<Record<ViraCheckboxInnerElements, AttributeValues>>;
|
|
42
|
+
disabled: boolean;
|
|
43
|
+
label: string;
|
|
44
|
+
hasError: boolean;
|
|
45
|
+
horizontal: boolean;
|
|
46
|
+
}> & {
|
|
47
|
+
value: boolean;
|
|
48
|
+
};
|
|
49
|
+
|
|
9
50
|
/**
|
|
10
51
|
* A custom checkbox.
|
|
11
52
|
*
|
|
@@ -13,12 +54,12 @@ import { ViraIcon } from './vira-icon.element.js';
|
|
|
13
54
|
* @category Elements
|
|
14
55
|
* @see https://electrovir.github.io/vira/book/elements/vira-checkbox
|
|
15
56
|
*/
|
|
16
|
-
export const ViraCheckbox = defineViraElement()({
|
|
57
|
+
export const ViraCheckbox = defineViraElement<Readonly<ViraCheckboxInputs>>()({
|
|
17
58
|
tagName: 'vira-checkbox',
|
|
18
59
|
hostClasses: {
|
|
19
|
-
'vira-checkbox-horizontal': ({
|
|
60
|
+
'vira-checkbox-horizontal': ({inputs}) => !!inputs.horizontal,
|
|
20
61
|
},
|
|
21
|
-
styles: ({
|
|
62
|
+
styles: ({hostClasses}) => css`
|
|
22
63
|
:host {
|
|
23
64
|
display: inline-flex;
|
|
24
65
|
}
|
|
@@ -52,7 +93,7 @@ export const ViraCheckbox = defineViraElement()({
|
|
|
52
93
|
|
|
53
94
|
&:hover .custom-checkbox {
|
|
54
95
|
background-color: ${viraFormCssVars['vira-form-selection-hover-background-color']
|
|
55
|
-
|
|
96
|
+
.value};
|
|
56
97
|
}
|
|
57
98
|
}
|
|
58
99
|
|
|
@@ -71,7 +112,7 @@ export const ViraCheckbox = defineViraElement()({
|
|
|
71
112
|
position: relative;
|
|
72
113
|
cursor: pointer;
|
|
73
114
|
|
|
74
|
-
${createFocusStyles({
|
|
115
|
+
${createFocusStyles({elementBorderSize: 1})}
|
|
75
116
|
|
|
76
117
|
&.checked {
|
|
77
118
|
& ${ViraIcon} {
|
|
@@ -85,7 +126,7 @@ export const ViraCheckbox = defineViraElement()({
|
|
|
85
126
|
|
|
86
127
|
&:active {
|
|
87
128
|
background-color: ${viraFormCssVars['vira-form-selection-active-background-color']
|
|
88
|
-
|
|
129
|
+
.value};
|
|
89
130
|
}
|
|
90
131
|
|
|
91
132
|
&.disabled {
|
|
@@ -100,16 +141,17 @@ export const ViraCheckbox = defineViraElement()({
|
|
|
100
141
|
}
|
|
101
142
|
`,
|
|
102
143
|
events: {
|
|
103
|
-
valueChange: defineElementEvent(),
|
|
144
|
+
valueChange: defineElementEvent<boolean>(),
|
|
104
145
|
},
|
|
105
|
-
render({
|
|
106
|
-
function updateValue() {
|
|
146
|
+
render({inputs, dispatch, events}) {
|
|
147
|
+
function updateValue(this: void) {
|
|
107
148
|
if (!inputs.disabled) {
|
|
108
149
|
dispatch(new events.valueChange(!inputs.value));
|
|
109
150
|
}
|
|
110
151
|
}
|
|
152
|
+
|
|
111
153
|
const textLabel = inputs.label
|
|
112
|
-
? html
|
|
154
|
+
? html`
|
|
113
155
|
<span
|
|
114
156
|
class="label-text"
|
|
115
157
|
${attributes(inputs.attributePassthrough?.['text'])}
|
|
@@ -119,11 +161,12 @@ export const ViraCheckbox = defineViraElement()({
|
|
|
119
161
|
</span>
|
|
120
162
|
`
|
|
121
163
|
: nothing;
|
|
122
|
-
|
|
164
|
+
|
|
165
|
+
return html`
|
|
123
166
|
<label
|
|
124
167
|
class=${classMap({
|
|
125
|
-
|
|
126
|
-
|
|
168
|
+
disabled: !!inputs.disabled,
|
|
169
|
+
})}
|
|
127
170
|
${attributes(inputs.attributePassthrough?.label)}
|
|
128
171
|
style=${ifDefined(inputs.stylePassthrough?.label)}
|
|
129
172
|
${listen('mousedown', updateValue)}
|
|
@@ -131,10 +174,10 @@ export const ViraCheckbox = defineViraElement()({
|
|
|
131
174
|
${textLabel}
|
|
132
175
|
<span
|
|
133
176
|
class="custom-checkbox ${classMap({
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
177
|
+
checked: inputs.value,
|
|
178
|
+
disabled: !!inputs.disabled,
|
|
179
|
+
error: !!inputs.hasError,
|
|
180
|
+
})}"
|
|
138
181
|
role="checkbox"
|
|
139
182
|
aria-label=${ifDefined(inputs.label || undefined)}
|
|
140
183
|
aria-checked=${inputs.value ? 'true' : 'false'}
|
|
@@ -145,9 +188,9 @@ export const ViraCheckbox = defineViraElement()({
|
|
|
145
188
|
${listenToActivate(updateValue)}
|
|
146
189
|
>
|
|
147
190
|
<${ViraIcon.assign({
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
191
|
+
icon: Check24Icon,
|
|
192
|
+
fitContainer: true,
|
|
193
|
+
})}
|
|
151
194
|
${attributes(inputs.attributePassthrough?.[ViraIcon.tagName])}
|
|
152
195
|
style=${ifDefined(inputs.stylePassthrough?.[ViraIcon.tagName])}
|
|
153
196
|
></${ViraIcon}>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import {css, defineElementEvent, html, listen, onResize} from 'element-vir';
|
|
2
|
+
import {noNativeFormStyles, viraAnimationDurations} from '../styles/index.js';
|
|
3
|
+
import {defineViraElement} from './define-vira-element.js';
|
|
4
|
+
|
|
4
5
|
/**
|
|
5
6
|
* A wrapper element that can collapse and expand to fit its content dynamically and efficiently.
|
|
6
7
|
*
|
|
@@ -8,7 +9,7 @@ import { defineViraElement } from './define-vira-element.js';
|
|
|
8
9
|
* @category Elements
|
|
9
10
|
* @see https://electrovir.github.io/vira/book/elements/vira-collapsible-wrapper
|
|
10
11
|
*/
|
|
11
|
-
export const ViraCollapsibleWrapper = defineViraElement()({
|
|
12
|
+
export const ViraCollapsibleWrapper = defineViraElement<{expanded: boolean}>()({
|
|
12
13
|
tagName: 'vira-collapsible-wrapper',
|
|
13
14
|
state() {
|
|
14
15
|
return {
|
|
@@ -16,10 +17,10 @@ export const ViraCollapsibleWrapper = defineViraElement()({
|
|
|
16
17
|
};
|
|
17
18
|
},
|
|
18
19
|
hostClasses: {
|
|
19
|
-
'vira-collapsible-wrapper-expanded': ({
|
|
20
|
+
'vira-collapsible-wrapper-expanded': ({inputs}) => inputs.expanded,
|
|
20
21
|
},
|
|
21
22
|
slotNames: ['header'],
|
|
22
|
-
styles: ({
|
|
23
|
+
styles: ({hostClasses}) => css`
|
|
23
24
|
:host {
|
|
24
25
|
display: flex;
|
|
25
26
|
flex-direction: column;
|
|
@@ -46,31 +47,32 @@ export const ViraCollapsibleWrapper = defineViraElement()({
|
|
|
46
47
|
}
|
|
47
48
|
`,
|
|
48
49
|
events: {
|
|
49
|
-
expandChange: defineElementEvent(),
|
|
50
|
+
expandChange: defineElementEvent<boolean>(),
|
|
50
51
|
},
|
|
51
|
-
render({
|
|
52
|
+
render({state, slotNames, updateState, dispatch, events, inputs}) {
|
|
52
53
|
const collapsingStyles = inputs.expanded
|
|
53
|
-
? css
|
|
54
|
+
? css`
|
|
54
55
|
height: ${state.contentHeight}px;
|
|
55
56
|
`
|
|
56
|
-
: css
|
|
57
|
+
: css`
|
|
57
58
|
height: 0;
|
|
58
59
|
`;
|
|
59
|
-
|
|
60
|
+
|
|
61
|
+
return html`
|
|
60
62
|
<button
|
|
61
63
|
class="header-wrapper"
|
|
62
64
|
${listen('click', () => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
dispatch(new events.expandChange(!inputs.expanded));
|
|
66
|
+
})}
|
|
65
67
|
>
|
|
66
68
|
<slot name=${slotNames.header}>Header</slot>
|
|
67
69
|
</button>
|
|
68
70
|
|
|
69
71
|
<div class="collapsing-element" style=${collapsingStyles} disabled="disabled">
|
|
70
72
|
<div
|
|
71
|
-
${onResize(({
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
${onResize(({contentRect}) => {
|
|
74
|
+
updateState({contentHeight: contentRect.height});
|
|
75
|
+
})}
|
|
74
76
|
class="content-wrapper"
|
|
75
77
|
>
|
|
76
78
|
<slot></slot>
|
|
@@ -1,14 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import {check} from '@augment-vir/assert';
|
|
2
|
+
import {filterMap, type PartialWithUndefined} from '@augment-vir/common';
|
|
3
|
+
import {
|
|
4
|
+
classMap,
|
|
5
|
+
css,
|
|
6
|
+
defineElementEvent,
|
|
7
|
+
html,
|
|
8
|
+
type HTMLTemplateResult,
|
|
9
|
+
ifDefined,
|
|
10
|
+
listen,
|
|
11
|
+
nothing,
|
|
12
|
+
testId,
|
|
13
|
+
} from 'element-vir';
|
|
14
|
+
import {type ViraIconSvg} from '../icons/icon-svg.js';
|
|
15
|
+
import {ChevronUp24Icon} from '../icons/index.js';
|
|
16
|
+
import {viraBorders} from '../styles/border.js';
|
|
17
|
+
import {viraFormCssVars} from '../styles/form-styles.js';
|
|
18
|
+
import {noUserSelect, viraAnimationDurations} from '../styles/index.js';
|
|
19
|
+
import {type ShowPopUpResult} from '../util/pop-up-manager.js';
|
|
20
|
+
import {defineViraElement} from './define-vira-element.js';
|
|
21
|
+
import {type MenuItem} from './pop-up/pop-up-menu-item.js';
|
|
22
|
+
import {ViraMenuTrigger} from './pop-up/vira-menu-trigger.element.js';
|
|
23
|
+
import {HorizontalAnchor, type PopUpTriggerPosition} from './pop-up/vira-pop-up-trigger.element.js';
|
|
24
|
+
import {ViraIcon} from './vira-icon.element.js';
|
|
25
|
+
|
|
12
26
|
/**
|
|
13
27
|
* Test ids for {@link ViraDropdown}.
|
|
14
28
|
*
|
|
@@ -19,6 +33,7 @@ export const viraDropdownTestIds = {
|
|
|
19
33
|
icon: 'dropdown-icon',
|
|
20
34
|
prefix: 'dropdown-prefix',
|
|
21
35
|
};
|
|
36
|
+
|
|
22
37
|
/**
|
|
23
38
|
* A dropdown element that uses pop-up menus.
|
|
24
39
|
*
|
|
@@ -26,9 +41,30 @@ export const viraDropdownTestIds = {
|
|
|
26
41
|
* @category Elements
|
|
27
42
|
* @see https://electrovir.github.io/vira/book/elements/dropdown/vira-dropdown
|
|
28
43
|
*/
|
|
29
|
-
export const ViraDropdown = defineViraElement
|
|
44
|
+
export const ViraDropdown = defineViraElement<
|
|
45
|
+
{
|
|
46
|
+
options: ReadonlyArray<Readonly<MenuItem>>;
|
|
47
|
+
/** The selected id from the given options. */
|
|
48
|
+
selected: ReadonlyArray<PropertyKey>;
|
|
49
|
+
} & PartialWithUndefined<
|
|
50
|
+
{
|
|
51
|
+
/** Text to show if nothing is selected. */
|
|
52
|
+
placeholder: string;
|
|
53
|
+
/**
|
|
54
|
+
* If false, this will behave like a single select dropdown, otherwise you can select
|
|
55
|
+
* multiple.
|
|
56
|
+
*/
|
|
57
|
+
isMultiSelect: boolean;
|
|
58
|
+
icon: ViraIconSvg;
|
|
59
|
+
selectionPrefix: string;
|
|
60
|
+
isDisabled: boolean;
|
|
61
|
+
/** For debugging purposes only. Very bad for actual production code use. */
|
|
62
|
+
z_debug_forceOpenState: boolean;
|
|
63
|
+
} & PopUpTriggerPosition
|
|
64
|
+
>
|
|
65
|
+
>()({
|
|
30
66
|
tagName: 'vira-dropdown',
|
|
31
|
-
styles: css
|
|
67
|
+
styles: css`
|
|
32
68
|
:host {
|
|
33
69
|
display: inline-flex;
|
|
34
70
|
vertical-align: middle;
|
|
@@ -97,76 +133,86 @@ export const ViraDropdown = defineViraElement()({
|
|
|
97
133
|
}
|
|
98
134
|
`,
|
|
99
135
|
events: {
|
|
100
|
-
selectedChange: defineElementEvent(),
|
|
101
|
-
openChange: defineElementEvent(),
|
|
136
|
+
selectedChange: defineElementEvent<PropertyKey[]>(),
|
|
137
|
+
openChange: defineElementEvent<ShowPopUpResult | undefined>(),
|
|
102
138
|
},
|
|
103
139
|
state() {
|
|
104
140
|
return {
|
|
105
141
|
/** `undefined` means the pop up is not currently showing. */
|
|
106
|
-
showPopUpResult: undefined,
|
|
142
|
+
showPopUpResult: undefined as ShowPopUpResult | undefined,
|
|
107
143
|
};
|
|
108
144
|
},
|
|
109
|
-
render({
|
|
110
|
-
const selectedOptions = filterMap(
|
|
145
|
+
render({state, inputs, dispatch, events, updateState}) {
|
|
146
|
+
const selectedOptions = filterMap(
|
|
147
|
+
inputs.selected,
|
|
148
|
+
(selectedId) => inputs.options.find((option) => option.id === selectedId),
|
|
149
|
+
check.isTruthy,
|
|
150
|
+
);
|
|
151
|
+
|
|
111
152
|
const leadingIconTemplate = inputs.icon
|
|
112
|
-
? html
|
|
153
|
+
? html`
|
|
113
154
|
<${ViraIcon.assign({
|
|
114
|
-
|
|
115
|
-
|
|
155
|
+
icon: inputs.icon,
|
|
156
|
+
})}
|
|
116
157
|
${testId(viraDropdownTestIds.icon)}
|
|
117
158
|
></${ViraIcon}>
|
|
118
159
|
`
|
|
119
160
|
: nothing;
|
|
120
|
-
|
|
121
|
-
const
|
|
122
|
-
|
|
161
|
+
|
|
162
|
+
const shouldUsePlaceholder: boolean = !selectedOptions.length;
|
|
163
|
+
|
|
164
|
+
const prefixTemplate =
|
|
165
|
+
inputs.selectionPrefix && !shouldUsePlaceholder
|
|
166
|
+
? html`
|
|
123
167
|
<span class="selected-label-prefix" ${testId(viraDropdownTestIds.prefix)}>
|
|
124
168
|
${inputs.selectionPrefix}
|
|
125
169
|
</span>
|
|
126
170
|
`
|
|
127
|
-
|
|
128
|
-
|
|
171
|
+
: nothing;
|
|
172
|
+
|
|
173
|
+
const selectionDisplay: string | HTMLTemplateResult = shouldUsePlaceholder
|
|
129
174
|
? inputs.placeholder || ''
|
|
130
175
|
: inputs.isMultiSelect && selectedOptions.length > 1
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
176
|
+
? `${selectedOptions.length} Selected`
|
|
177
|
+
: selectedOptions[0]?.label || '';
|
|
178
|
+
|
|
179
|
+
return html`
|
|
134
180
|
<${ViraMenuTrigger.assign({
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
181
|
+
...inputs,
|
|
182
|
+
items: inputs.options,
|
|
183
|
+
popUpOffset: {
|
|
184
|
+
vertical: -1,
|
|
185
|
+
right: 24,
|
|
186
|
+
},
|
|
187
|
+
horizontalAnchor: inputs.horizontalAnchor || HorizontalAnchor.Both,
|
|
188
|
+
})}
|
|
143
189
|
${listen(ViraMenuTrigger.events.openChange, (event) => {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
190
|
+
updateState({showPopUpResult: event.detail});
|
|
191
|
+
dispatch(new events.openChange(event.detail));
|
|
192
|
+
})}
|
|
147
193
|
${listen(ViraMenuTrigger.events.itemActivate, (event) => {
|
|
148
|
-
|
|
149
|
-
|
|
194
|
+
dispatch(new events.selectedChange(event.detail));
|
|
195
|
+
})}
|
|
150
196
|
>
|
|
151
197
|
<div
|
|
152
198
|
class="dropdown-trigger ${classMap({
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
199
|
+
open: !!state.showPopUpResult,
|
|
200
|
+
'open-upwards': !state.showPopUpResult?.popDown,
|
|
201
|
+
})}"
|
|
156
202
|
${testId(viraDropdownTestIds.trigger)}
|
|
157
203
|
>
|
|
158
204
|
${leadingIconTemplate}
|
|
159
205
|
<span
|
|
160
206
|
class="selection-display ${classMap({
|
|
161
|
-
|
|
162
|
-
|
|
207
|
+
'using-placeholder': shouldUsePlaceholder,
|
|
208
|
+
})}"
|
|
163
209
|
title=${ifDefined(shouldUsePlaceholder ? undefined : selectionDisplay)}
|
|
164
210
|
>
|
|
165
211
|
${prefixTemplate} ${selectionDisplay}
|
|
166
212
|
</span>
|
|
167
213
|
|
|
168
214
|
<span class="trigger-icon-wrapper">
|
|
169
|
-
<${ViraIcon.assign({
|
|
215
|
+
<${ViraIcon.assign({icon: ChevronUp24Icon})}
|
|
170
216
|
class="trigger-icon"
|
|
171
217
|
></${ViraIcon}>
|
|
172
218
|
</span>
|