@vonage/vivid 3.39.0 → 3.41.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/accordion/index.js +2 -2
- package/accordion-item/index.js +2 -2
- package/alert/index.js +7 -5
- package/audio-player/index.js +33 -0
- package/avatar/index.js +2 -2
- package/badge/index.js +2 -2
- package/banner/index.js +9 -5
- package/breadcrumb/index.js +1 -1
- package/breadcrumb-item/index.js +3 -3
- package/button/index.js +5 -4
- package/calendar/index.js +1 -1
- package/calendar-event/index.js +1 -1
- package/card/index.js +4 -3
- package/checkbox/index.js +3 -3
- package/combobox/index.js +9 -7
- package/custom-elements.json +809 -5
- package/data-grid/index.js +3 -2
- package/date-picker/index.js +11 -9
- package/date-range-picker/index.js +11 -9
- package/dialog/index.js +10 -6
- package/divider/index.js +1 -1
- package/elevation/index.js +1 -1
- package/empty-state/index.js +2 -2
- package/fab/index.js +3 -3
- package/file-picker/index.js +6 -5
- package/focus/index.js +1 -1
- package/header/index.js +2 -2
- package/icon/index.js +1 -1
- package/index.js +60 -55
- package/layout/index.js +1 -1
- package/lib/alert/alert.d.ts +3 -1
- package/lib/alert/locale.d.ts +3 -0
- package/lib/audio-player/audio-player.d.ts +17 -0
- package/lib/audio-player/audio-player.template.d.ts +4 -0
- package/lib/audio-player/definition.d.ts +4 -0
- package/lib/audio-player/locale.d.ts +5 -0
- package/lib/banner/banner.d.ts +3 -1
- package/lib/banner/locale.d.ts +3 -0
- package/lib/card/card.d.ts +3 -0
- package/lib/card/card.template.d.ts +1 -1
- package/lib/card/definition.d.ts +1 -0
- package/lib/checkbox/checkbox.d.ts +2 -0
- package/lib/components.d.ts +2 -0
- package/lib/dialog/dialog.d.ts +4 -0
- package/lib/dialog/locale.d.ts +3 -0
- package/lib/enums.d.ts +2 -1
- package/lib/menu/menu.d.ts +1 -0
- package/lib/number-field/locale.d.ts +4 -0
- package/lib/number-field/number-field.d.ts +4 -2
- package/lib/progress/progress.d.ts +1 -0
- package/lib/progress-ring/progress-ring.d.ts +1 -0
- package/lib/radio/radio.d.ts +1 -0
- package/lib/selectable-box/definition.d.ts +3 -0
- package/lib/selectable-box/selectable-box.d.ts +12 -0
- package/lib/selectable-box/selectable-box.template.d.ts +4 -0
- package/lib/slider/definition.d.ts +1 -0
- package/lib/slider/slider.d.ts +5 -0
- package/lib/split-button/locale.d.ts +3 -0
- package/lib/split-button/split-button.d.ts +3 -1
- package/lib/text-area/text-area.d.ts +3 -0
- package/lib/text-field/text-field.d.ts +5 -2
- package/listbox/index.js +5 -4
- package/locales/en-GB.js +21 -0
- package/locales/en-US.js +21 -0
- package/locales/ja-JP.js +21 -0
- package/locales/zh-CN.js +21 -0
- package/menu/index.js +9 -8
- package/menu-item/index.js +3 -3
- package/nav/index.js +1 -1
- package/nav-disclosure/index.js +3 -3
- package/nav-item/index.js +3 -3
- package/note/index.js +2 -2
- package/number-field/index.js +8 -6
- package/option/index.js +3 -3
- package/package.json +1 -1
- package/pagination/index.js +6 -5
- package/popup/index.js +7 -6
- package/progress/index.js +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.js +2 -2
- package/radio-group/index.js +2 -2
- package/select/index.js +10 -8
- package/selectable-box/index.js +23 -0
- package/shared/Reflector.js +65 -0
- package/shared/date-picker/calendar/segment.d.ts +21 -0
- package/shared/date-picker/date-picker-base.d.ts +1 -0
- package/shared/definition.js +3 -3
- package/shared/definition10.js +89 -227
- package/shared/definition11.js +151 -29
- package/shared/definition12.js +37 -766
- package/shared/definition13.js +747 -106
- package/shared/definition14.js +122 -192
- package/shared/definition15.js +156 -664
- package/shared/definition16.js +576 -1123
- package/shared/definition17.js +1278 -143
- package/shared/definition18.js +64 -298
- package/shared/definition19.js +358 -211
- package/shared/definition2.js +2 -2
- package/shared/definition20.js +259 -67
- package/shared/definition21.js +66 -58
- package/shared/definition22.js +43 -84
- package/shared/definition23.js +76 -2352
- package/shared/definition24.js +2362 -45
- package/shared/definition25.js +63 -27
- package/shared/definition26.js +24 -51
- package/shared/definition27.js +36 -813
- package/shared/definition28.js +837 -49
- package/shared/definition29.js +52 -89
- package/shared/definition3.js +1 -1
- package/shared/definition30.js +88 -24
- package/shared/definition31.js +25 -12
- package/shared/definition32.js +12 -52
- package/shared/definition33.js +28 -487
- package/shared/definition34.js +442 -197
- package/shared/definition35.js +260 -185
- package/shared/definition36.js +188 -69
- package/shared/definition37.js +72 -52
- package/shared/definition38.js +65 -421
- package/shared/definition39.js +435 -35
- package/shared/definition4.js +44 -16
- package/shared/definition40.js +32 -680
- package/shared/definition41.js +661 -77
- package/shared/definition42.js +103 -555
- package/shared/definition43.js +76 -103
- package/shared/definition44.js +522 -87
- package/shared/definition45.js +133 -22
- package/shared/definition46.js +131 -58
- package/shared/definition47.js +16 -501
- package/shared/definition48.js +69 -23
- package/shared/definition49.js +477 -108
- package/shared/definition5.js +160 -44
- package/shared/definition50.js +25 -271
- package/shared/definition51.js +103 -122
- package/shared/definition52.js +277 -122
- package/shared/definition53.js +274 -103
- package/shared/definition54.js +126 -71
- package/shared/definition55.js +128 -294
- package/shared/definition56.js +91 -13
- package/shared/definition57.js +298 -39
- package/shared/definition58.js +11 -175
- package/shared/definition59.js +47 -0
- package/shared/definition6.js +43 -33
- package/shared/definition60.js +181 -0
- package/shared/definition7.js +39 -105
- package/shared/definition8.js +122 -38
- package/shared/definition9.js +56 -89
- package/shared/enums.js +72 -0
- package/shared/icon.js +2 -2
- package/shared/index2.js +28 -1
- package/shared/key-codes.js +1 -1
- package/shared/key-codes2.js +9 -0
- package/shared/listbox.js +3 -8
- package/shared/localization/Locale.d.ts +12 -0
- package/shared/patterns/form-elements/form-elements.d.ts +6 -6
- package/shared/presentationDate.js +196 -143
- package/shared/radio.js +7 -0
- package/shared/text-field.js +1 -1
- package/shared/utils/Reflector.d.ts +8 -0
- package/shared/utils/randomId.d.ts +1 -0
- package/side-drawer/index.js +1 -1
- package/slider/index.js +3 -3
- package/split-button/index.js +6 -3
- package/style.css +889 -722
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/switch/index.js +3 -3
- package/tab/index.js +3 -3
- package/tab-panel/index.js +1 -1
- package/tabs/index.js +5 -5
- package/tag/index.js +3 -3
- package/tag-group/index.js +1 -1
- package/text-area/index.js +4 -3
- package/text-field/index.js +4 -3
- package/toggletip/index.js +8 -7
- package/tooltip/index.js +8 -7
- package/tree-item/index.js +3 -3
- package/tree-view/index.js +1 -1
- package/vivid.api.json +392 -0
package/shared/definition14.js
CHANGED
|
@@ -1,104 +1,13 @@
|
|
|
1
|
-
import { F as FoundationElement,
|
|
2
|
-
import { a as iconRegistries } from './
|
|
3
|
-
import {
|
|
4
|
-
import './
|
|
5
|
-
import { e as errorText, f as formElements, F as FormElementSuccessText, a as FormElementHelperText, g as getFeedbackTemplate } from './index2.js';
|
|
6
|
-
import { C as CheckableFormAssociated } from './form-associated.js';
|
|
7
|
-
import { a as keySpace$1 } from './key-codes.js';
|
|
8
|
-
import { a as applyMixins } from './apply-mixins.js';
|
|
9
|
-
import { f as focusTemplateFactory } from './focus2.js';
|
|
1
|
+
import { F as FoundationElement, a as attr, o as observable, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { a as iconRegistries } from './definition26.js';
|
|
3
|
+
import { E as Elevation, e as elevationRegistries } from './definition59.js';
|
|
4
|
+
import { A as Appearance } from './enums.js';
|
|
10
5
|
import { I as Icon } from './icon.js';
|
|
11
6
|
import { w as when } from './when.js';
|
|
12
7
|
import { s as slotted } from './slotted.js';
|
|
13
8
|
import { c as classNames } from './class-names.js';
|
|
14
9
|
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* A form-associated base class for the {@link @microsoft/fast-foundation#(Checkbox:class)} component.
|
|
19
|
-
*
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
class FormAssociatedCheckbox extends CheckableFormAssociated(_Checkbox) {
|
|
23
|
-
constructor() {
|
|
24
|
-
super(...arguments);
|
|
25
|
-
this.proxy = document.createElement("input");
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* A Checkbox Custom HTML Element.
|
|
31
|
-
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#checkbox | ARIA checkbox }.
|
|
32
|
-
*
|
|
33
|
-
* @slot checked-indicator - The checked indicator
|
|
34
|
-
* @slot indeterminate-indicator - The indeterminate indicator
|
|
35
|
-
* @slot - The default slot for the label
|
|
36
|
-
* @csspart control - The element representing the visual checkbox control
|
|
37
|
-
* @csspart label - The label
|
|
38
|
-
* @fires change - Emits a custom change event when the checked state changes
|
|
39
|
-
*
|
|
40
|
-
* @public
|
|
41
|
-
*/
|
|
42
|
-
let Checkbox$1 = class Checkbox extends FormAssociatedCheckbox {
|
|
43
|
-
constructor() {
|
|
44
|
-
super();
|
|
45
|
-
/**
|
|
46
|
-
* The element's value to be included in form submission when checked.
|
|
47
|
-
* Default to "on" to reach parity with input[type="checkbox"]
|
|
48
|
-
*
|
|
49
|
-
* @internal
|
|
50
|
-
*/
|
|
51
|
-
this.initialValue = "on";
|
|
52
|
-
/**
|
|
53
|
-
* The indeterminate state of the control
|
|
54
|
-
*/
|
|
55
|
-
this.indeterminate = false;
|
|
56
|
-
/**
|
|
57
|
-
* @internal
|
|
58
|
-
*/
|
|
59
|
-
this.keypressHandler = (e) => {
|
|
60
|
-
if (this.readOnly) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
switch (e.key) {
|
|
64
|
-
case keySpace$1:
|
|
65
|
-
if (this.indeterminate) {
|
|
66
|
-
this.indeterminate = false;
|
|
67
|
-
}
|
|
68
|
-
this.checked = !this.checked;
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
/**
|
|
73
|
-
* @internal
|
|
74
|
-
*/
|
|
75
|
-
this.clickHandler = (e) => {
|
|
76
|
-
if (!this.disabled && !this.readOnly) {
|
|
77
|
-
if (this.indeterminate) {
|
|
78
|
-
this.indeterminate = false;
|
|
79
|
-
}
|
|
80
|
-
this.checked = !this.checked;
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
this.proxy.setAttribute("type", "checkbox");
|
|
84
|
-
}
|
|
85
|
-
readOnlyChanged() {
|
|
86
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
87
|
-
this.proxy.readOnly = this.readOnly;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
__decorate([
|
|
92
|
-
attr({ attribute: "readonly", mode: "boolean" })
|
|
93
|
-
], Checkbox$1.prototype, "readOnly", void 0);
|
|
94
|
-
__decorate([
|
|
95
|
-
observable
|
|
96
|
-
], Checkbox$1.prototype, "defaultSlottedNodes", void 0);
|
|
97
|
-
__decorate([
|
|
98
|
-
observable
|
|
99
|
-
], Checkbox$1.prototype, "indeterminate", void 0);
|
|
100
|
-
|
|
101
|
-
const styles = "/**\n * Do not edit directly\n * Generated on Tue, 17 Oct 2023 15:27:52 GMT\n */\n:host([disabled]) {\n cursor: not-allowed;\n}\n\n.base {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n vertical-align: middle;\n}\n.base.connotation-cta {\n /* @cssprop [--vvd-checkbox-cta-primary=var(--vvd-color-cta-500)] */\n --_connotation-color-primary: var(--vvd-checkbox-cta-primary, var(--vvd-color-cta-500));\n /* @cssprop [--vvd-checkbox-cta-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-checkbox-cta-primary-text, var(--vvd-color-canvas));\n /* @cssprop [--vvd-checkbox-cta-primary-increment=var(--vvd-color-cta-600)] */\n --_connotation-color-primary-increment: var(--vvd-checkbox-cta-primary-increment, var(--vvd-color-cta-600));\n /* @cssprop [--vvd-checkbox-cta-intermediate=var(--vvd-color-cta-500)] */\n --_connotation-color-intermediate: var(--vvd-checkbox-cta-intermediate, var(--vvd-color-cta-500));\n /* @cssprop [--vvd-checkbox-cta-backdrop=var(--vvd-color-cta-50)] */\n --_connotation-color-backdrop: var(--vvd-checkbox-cta-backdrop, var(--vvd-color-cta-50));\n /* @cssprop [--vvd-checkbox-cta-firm=var(--vvd-color-cta-600)] */\n --_connotation-color-firm: var(--vvd-checkbox-cta-firm, var(--vvd-color-cta-600));\n}\n.base:not(.connotation-cta) {\n /* @cssprop [--vvd-checkbox-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-checkbox-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-checkbox-accent-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-checkbox-accent-primary-text, var(--vvd-color-canvas));\n /* @cssprop [--vvd-checkbox-accent-primary-increment=var(--vvd-color-neutral-800)] */\n --_connotation-color-primary-increment: var(--vvd-checkbox-accent-primary-increment, var(--vvd-color-neutral-800));\n /* @cssprop [--vvd-checkbox-accent-intermediate=var(--vvd-color-neutral-500)] */\n --_connotation-color-intermediate: var(--vvd-checkbox-accent-intermediate, var(--vvd-color-neutral-500));\n /* @cssprop [--vvd-checkbox-accent-backdrop=var(--vvd-color-canvas)] */\n --_connotation-color-backdrop: var(--vvd-checkbox-accent-backdrop, var(--vvd-color-canvas));\n /* @cssprop [--vvd-checkbox-accent-firm=var(--vvd-color-canvas-text)] */\n --_connotation-color-firm: var(--vvd-checkbox-accent-firm, var(--vvd-color-canvas-text));\n}\n.base {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-intermediate);\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.base:where(:checked, .checked):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: var(--_connotation-color-primary);\n}\n.base:where(:checked, .checked):where(:hover, .hover) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary-increment);\n --_appearance-color-outline: var(--_connotation-color-primary);\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-300);\n --_appearance-color-fill: var(--vvd-color-neutral-100);\n --_appearance-color-outline: var(--vvd-color-neutral-300);\n}\n.base:where(.readonly):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--vvd-color-neutral-200);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n@supports selector(:focus-visible) {\n .base:focus-visible {\n outline: none;\n }\n}\n@supports (user-select: none) {\n .base {\n user-select: none;\n }\n}\n.base:not(.disabled) {\n cursor: pointer;\n}\n.base.disabled {\n pointer-events: none;\n}\n\n.control {\n position: relative;\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n background-color: var(--_appearance-color-fill);\n block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 20));\n border-radius: 5px;\n box-shadow: inset 0 0 0 2px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n inline-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 20));\n}\n\n.indicator {\n font-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 20)) - 4px);\n}\n.base:not(.checked) .indicator.checkmark {\n display: none;\n}\n\n.base.checked .indicator.minus, .base:not(.indeterminate) .indicator.minus {\n display: none;\n}\n\nlabel {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n color: var(--vvd-color-canvas-text);\n column-gap: 4px;\n cursor: pointer;\n font: var(--vvd-typography-base);\n}\n.hide-label label {\n display: none;\n}\n\n.focus-indicator {\n --focus-inset: -3px;\n --focus-stroke-gap-color: transparent;\n border-radius: 6px;\n}\n.base:not(:focus-visible) .focus-indicator {\n display: none;\n}\n\n.icon {\n font-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 20)) * 0.6);\n line-height: 1;\n}\n\n.message {\n margin-block-start: 4px;\n --_low-ink-color: var(--vvd-color-neutral-600);\n}";
|
|
10
|
+
const styles = "/**\n * Do not edit directly\n * Generated on Wed, 22 Nov 2023 16:09:43 GMT\n */\n:host {\n display: flex;\n}\n\n.base {\n border-radius: 6px;\n inline-size: 100%;\n text-align: start;\n}\n\n.wrapper {\n display: flex;\n overflow: hidden;\n flex-flow: column;\n block-size: 100%;\n border-radius: inherit;\n color: var(--vvd-color-canvas-text);\n}\n\n.main-content {\n display: flex;\n flex-flow: column;\n padding: 24px;\n}\n\n.header {\n display: flex;\n flex: 1;\n align-items: flex-start;\n gap: 8px;\n}\n.header-content {\n flex: 1;\n}\n.header-wrapper {\n display: flex;\n gap: 8px;\n}\n.header-headline, .header-subtitle {\n /* stylelint-disable value-no-vendor-prefix */\n display: -webkit-box;\n /* stylelint-enable value-no-vendor-prefix */\n overflow: hidden;\n -webkit-box-orient: vertical;\n}\n.header-headline {\n font: var(--vvd-typography-heading-4);\n -webkit-line-clamp: var(--headline-line-clamp);\n}\n.header-subtitle {\n font: var(--vvd-typography-base);\n -webkit-line-clamp: var(--subtitle-line-clamp);\n}\n.hide-header .header {\n display: none;\n}\n\n.header-subtitle,\n.text {\n color: var(--vvd-color-neutral-600);\n font: var(--vvd-typography-base);\n}\n\n.text {\n padding-right: 8px;\n margin-top: 12px;\n}\n\n.footer {\n display: inline-flex;\n flex-direction: column;\n align-items: flex-end;\n padding-bottom: 24px;\n margin-top: auto;\n padding-inline: 24px;\n}\n.hide-footer .footer {\n display: none;\n}\n\n::slotted([slot=graphic i]),\n.icon {\n flex-shrink: 0;\n align-self: baseline;\n margin-block-start: 4px;\n}\n\n.icon {\n font-size: 20px;\n}\n\n::slotted([slot=meta i]) {\n flex-shrink: 0;\n align-self: flex-start;\n margin-block-start: -8px;\n margin-inline-end: -8px;\n margin-inline-start: auto;\n}";
|
|
102
11
|
|
|
103
12
|
var __defProp = Object.defineProperty;
|
|
104
13
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -111,113 +20,134 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
111
20
|
__defProp(target, key, result);
|
|
112
21
|
return result;
|
|
113
22
|
};
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
this.checked = !this.checked;
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
135
|
-
return false;
|
|
136
|
-
};
|
|
137
|
-
/**
|
|
138
|
-
* !remove method as will be implemented by fast-foundation in version after 2.46.9
|
|
139
|
-
*
|
|
140
|
-
* @internal
|
|
141
|
-
*/
|
|
142
|
-
this.clickHandler = (event) => {
|
|
143
|
-
if (event.target instanceof HTMLAnchorElement) {
|
|
144
|
-
return true;
|
|
145
|
-
}
|
|
146
|
-
if (!this.disabled && !this.readOnly) {
|
|
147
|
-
if (this.indeterminate) {
|
|
148
|
-
this.indeterminate = false;
|
|
149
|
-
}
|
|
150
|
-
this.checked = !this.checked;
|
|
151
|
-
}
|
|
152
|
-
return false;
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
};
|
|
23
|
+
class Card extends FoundationElement {
|
|
24
|
+
}
|
|
25
|
+
__decorateClass([
|
|
26
|
+
attr
|
|
27
|
+
], Card.prototype, "appearance", 2);
|
|
28
|
+
__decorateClass([
|
|
29
|
+
attr
|
|
30
|
+
], Card.prototype, "headline", 2);
|
|
31
|
+
__decorateClass([
|
|
32
|
+
attr
|
|
33
|
+
], Card.prototype, "subtitle", 2);
|
|
34
|
+
__decorateClass([
|
|
35
|
+
attr
|
|
36
|
+
], Card.prototype, "text", 2);
|
|
37
|
+
__decorateClass([
|
|
38
|
+
attr
|
|
39
|
+
], Card.prototype, "icon", 2);
|
|
156
40
|
__decorateClass([
|
|
157
41
|
attr
|
|
158
|
-
],
|
|
42
|
+
], Card.prototype, "elevation", 2);
|
|
159
43
|
__decorateClass([
|
|
160
44
|
observable
|
|
161
|
-
],
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
45
|
+
], Card.prototype, "footerSlottedContent", 2);
|
|
46
|
+
__decorateClass([
|
|
47
|
+
observable
|
|
48
|
+
], Card.prototype, "graphicSlottedContent", 2);
|
|
49
|
+
__decorateClass([
|
|
50
|
+
observable
|
|
51
|
+
], Card.prototype, "hasMetaSlottedContent", 2);
|
|
167
52
|
|
|
168
|
-
const getClasses = (
|
|
169
|
-
connotation,
|
|
170
|
-
readOnly,
|
|
171
|
-
checked,
|
|
172
|
-
disabled,
|
|
173
|
-
indeterminate,
|
|
174
|
-
errorValidationMessage,
|
|
175
|
-
successText,
|
|
176
|
-
label,
|
|
177
|
-
slottedContent
|
|
178
|
-
}) => classNames(
|
|
53
|
+
const getClasses = (_) => classNames(
|
|
179
54
|
"base",
|
|
180
|
-
[
|
|
181
|
-
["
|
|
182
|
-
["checked", Boolean(checked) || Boolean(indeterminate)],
|
|
183
|
-
["disabled", Boolean(disabled)],
|
|
184
|
-
["error connotation-alert", Boolean(errorValidationMessage)],
|
|
185
|
-
["success connotation-success", !!successText],
|
|
186
|
-
["hide-label", !label && !slottedContent?.length]
|
|
55
|
+
["hide-footer", !_.footerSlottedContent || !_.footerSlottedContent.length],
|
|
56
|
+
["hide-header", shouldHideHeader(_)]
|
|
187
57
|
);
|
|
188
|
-
|
|
189
|
-
|
|
58
|
+
function renderHeaderIcon(iconTag) {
|
|
59
|
+
return html`
|
|
60
|
+
<${iconTag} class="icon" inline name="${(x) => x.icon}"></${iconTag}>`;
|
|
61
|
+
}
|
|
62
|
+
function Headline() {
|
|
63
|
+
return html`
|
|
64
|
+
<div class="header-headline">${(x) => x.headline}</div>
|
|
65
|
+
`;
|
|
66
|
+
}
|
|
67
|
+
function Subtitle() {
|
|
68
|
+
return html`
|
|
69
|
+
<div class="header-subtitle">${(x) => x.subtitle}</div>
|
|
70
|
+
`;
|
|
71
|
+
}
|
|
72
|
+
function headerContent() {
|
|
73
|
+
return html`
|
|
74
|
+
<div class="header-content">
|
|
75
|
+
${when((x) => x.headline, Headline())}
|
|
76
|
+
${when((x) => x.subtitle, Subtitle())}
|
|
77
|
+
</div>
|
|
78
|
+
`;
|
|
79
|
+
}
|
|
80
|
+
function renderHeader(iconTag) {
|
|
81
|
+
return html`
|
|
82
|
+
<header class="header">
|
|
83
|
+
<slot name="graphic" ${slotted("graphicSlottedContent")}>${when((x) => x.icon, renderHeaderIcon(iconTag))}</slot>
|
|
84
|
+
${when((x) => x.headline || x.subtitle, headerContent())}
|
|
85
|
+
</header>`;
|
|
86
|
+
}
|
|
87
|
+
function shouldHideHeader(card) {
|
|
88
|
+
return !card.headline && !card.subtitle && !card.icon && (!card.graphicSlottedContent || !card.graphicSlottedContent.length);
|
|
89
|
+
}
|
|
90
|
+
function renderMetaSlot() {
|
|
91
|
+
return html`
|
|
92
|
+
<slot name="meta" ${slotted("metaSlottedContent")}></slot>
|
|
93
|
+
`;
|
|
94
|
+
}
|
|
95
|
+
function text() {
|
|
96
|
+
return html`
|
|
97
|
+
<div class="text">${(x) => x.text}</div>
|
|
98
|
+
`;
|
|
99
|
+
}
|
|
100
|
+
function renderCardContent(context) {
|
|
190
101
|
const iconTag = context.tagFor(Icon);
|
|
191
|
-
return html
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
102
|
+
return html`
|
|
103
|
+
<div class="${getClasses}">
|
|
104
|
+
<div class="wrapper">
|
|
105
|
+
<div class="vwc-card-media">
|
|
106
|
+
<slot name="media"></slot>
|
|
107
|
+
</div>
|
|
108
|
+
<slot name="main">
|
|
109
|
+
<div class="main-content">
|
|
110
|
+
<div class="header-wrapper">
|
|
111
|
+
${renderHeader(iconTag)}
|
|
112
|
+
${renderMetaSlot()}
|
|
113
|
+
</div>
|
|
114
|
+
${when((x) => x.text, text())}
|
|
115
|
+
</div>
|
|
116
|
+
</slot>
|
|
117
|
+
<div class="footer">
|
|
118
|
+
<slot name="footer" ${slotted("footerSlottedContent")}></slot>
|
|
119
|
+
</div>
|
|
204
120
|
</div>
|
|
205
|
-
${html`<label>${(x) => x.label}<slot ${slotted("slottedContent")}></slot></label>`}
|
|
206
121
|
</div>
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
122
|
+
`;
|
|
123
|
+
}
|
|
124
|
+
const CardTemplate = (context) => {
|
|
125
|
+
const elevationTag = context.tagFor(Elevation);
|
|
126
|
+
return html`
|
|
127
|
+
${when((x) => x.appearance !== Appearance.Ghost && x.appearance !== Appearance.Outlined, html`
|
|
128
|
+
<${elevationTag} dp=${(x) => x.elevation ?? "4"}>
|
|
129
|
+
${renderCardContent(context)}
|
|
130
|
+
</${elevationTag}>
|
|
131
|
+
`)}
|
|
132
|
+
|
|
133
|
+
${when((x) => x.appearance === Appearance.Outlined, html`
|
|
134
|
+
<${elevationTag} dp='0')}>
|
|
135
|
+
${renderCardContent(context)}
|
|
136
|
+
</${elevationTag}>
|
|
137
|
+
`)}
|
|
138
|
+
|
|
139
|
+
${when((x) => x.appearance === Appearance.Ghost, html`
|
|
140
|
+
${renderCardContent(context)}
|
|
141
|
+
`)}
|
|
142
|
+
`;
|
|
210
143
|
};
|
|
211
144
|
|
|
212
|
-
const
|
|
213
|
-
baseName: "
|
|
214
|
-
template:
|
|
215
|
-
styles
|
|
216
|
-
shadowOptions: {
|
|
217
|
-
delegatesFocus: true
|
|
218
|
-
}
|
|
145
|
+
const cardDefinition = Card.compose({
|
|
146
|
+
baseName: "card",
|
|
147
|
+
template: CardTemplate,
|
|
148
|
+
styles
|
|
219
149
|
});
|
|
220
|
-
const
|
|
221
|
-
const
|
|
150
|
+
const cardRegistries = [cardDefinition(), ...iconRegistries, ...elevationRegistries];
|
|
151
|
+
const registerCard = registerFactory(cardRegistries);
|
|
222
152
|
|
|
223
|
-
export {
|
|
153
|
+
export { cardRegistries as a, cardDefinition as c, registerCard as r };
|