@vonage/vivid 3.8.0 → 3.10.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/alert/index.js +28 -0
- package/avatar/index.js +1 -1
- package/badge/index.js +1 -1
- package/banner/index.js +3 -3
- package/breadcrumb/index.js +1 -1
- package/breadcrumb-item/index.js +1 -1
- package/button/index.js +2 -2
- package/calendar/index.js +1 -1
- package/calendar-event/index.js +1 -1
- package/card/index.js +2 -2
- package/checkbox/index.js +1 -1
- package/combobox/index.js +6 -6
- package/custom-elements.json +269 -27
- package/data-grid/index.js +1 -1
- package/dialog/index.js +4 -4
- package/divider/index.js +1 -1
- package/elevation/index.js +1 -1
- package/fab/index.js +1 -1
- package/header/index.js +2 -2
- package/index.js +51 -50
- package/layout/index.js +1 -1
- package/lib/alert/alert.d.ts +24 -0
- package/lib/alert/alert.template.d.ts +4 -0
- package/lib/alert/definition.d.ts +2 -0
- package/lib/alert/index.d.ts +1 -0
- package/lib/components.d.ts +1 -0
- package/lib/text-area/text-area.d.ts +2 -1
- package/lib/text-field/text-field.d.ts +2 -1
- package/lib/tooltip/tooltip.d.ts +1 -0
- package/listbox/index.js +2 -2
- package/menu/index.js +6 -6
- package/menu-item/index.js +1 -1
- package/nav/index.js +1 -1
- package/nav-disclosure/index.js +1 -1
- package/nav-item/index.js +1 -1
- package/note/index.js +1 -1
- package/number-field/index.js +4 -4
- package/option/index.js +1 -1
- package/package.json +1 -1
- package/popup/index.js +4 -4
- package/progress/index.js +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.js +1 -1
- package/select/index.js +6 -6
- package/shared/definition.js +1 -1
- package/shared/definition10.js +46 -63
- package/shared/definition11.js +38 -92
- package/shared/definition12.js +96 -31
- package/shared/definition13.js +84 -757
- package/shared/definition14.js +32 -95
- package/shared/definition15.js +758 -100
- package/shared/definition16.js +103 -24
- package/shared/definition17.js +96 -154
- package/shared/definition18.js +108 -663
- package/shared/definition19.js +667 -1532
- package/shared/definition2.js +1 -1
- package/shared/definition20.js +1544 -223
- package/shared/definition21.js +183 -964
- package/shared/definition22.js +1037 -222
- package/shared/definition23.js +226 -67
- package/shared/definition24.js +68 -77
- package/shared/definition25.js +76 -47
- package/shared/definition26.js +46 -32
- package/shared/definition27.js +35 -49
- package/shared/definition28.js +48 -344
- package/shared/definition29.js +273 -282
- package/shared/definition30.js +356 -14
- package/shared/definition31.js +13 -67
- package/shared/definition32.js +65 -21
- package/shared/definition33.js +21 -39
- package/shared/definition34.js +31 -432
- package/shared/definition35.js +432 -76
- package/shared/definition36.js +82 -33
- package/shared/definition37.js +31 -422
- package/shared/definition38.js +357 -568
- package/shared/definition39.js +628 -75
- package/shared/definition4.js +1 -1
- package/shared/definition40.js +70 -573
- package/shared/definition41.js +538 -81
- package/shared/definition42.js +127 -47
- package/shared/definition43.js +51 -16
- package/shared/definition44.js +17 -425
- package/shared/definition45.js +421 -103
- package/shared/definition46.js +114 -19
- package/shared/definition47.js +19 -269
- package/shared/definition48.js +245 -87
- package/shared/definition49.js +110 -68
- package/shared/definition5.js +1 -1
- package/shared/definition50.js +80 -67
- package/shared/definition51.js +69 -295
- package/shared/definition52.js +305 -0
- package/shared/definition6.js +142 -45
- package/shared/definition7.js +95 -23
- package/shared/definition8.js +22 -103
- package/shared/definition9.js +62 -102
- package/shared/es.object.assign.js +1 -1
- package/shared/form-associated.js +1 -1
- package/shared/form-elements.js +46 -7
- package/shared/index.js +1 -1
- package/shared/listbox.js +2 -2
- package/shared/patterns/form-elements/form-elements.d.ts +16 -2
- package/shared/repeat.js +1 -1
- package/shared/text-field.js +1 -1
- package/shared/text-field2.js +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.js +1 -1
- 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/switch/index.js +1 -1
- package/tab/index.js +1 -1
- package/tab-panel/index.js +1 -1
- package/tabs/index.js +3 -3
- package/tag/index.js +1 -1
- package/tag-group/index.js +1 -1
- package/text-area/index.js +1 -1
- package/text-field/index.js +1 -1
- package/tooltip/index.js +5 -5
- package/tree-item/index.js +1 -1
- package/tree-view/index.js +1 -1
- package/vivid.api.json +91 -0
package/shared/definition16.js
CHANGED
|
@@ -1,32 +1,111 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { G as _export, i as descriptors, g as global$1, k as functionUncurryThis, B as hasOwnProperty_1, m as isCallable$1, f as objectDefineProperty, a6 as copyConstructorProperties$1, j as objectIsPrototypeOf, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { C as CalendarEvent } from './calendar-event.js';
|
|
3
|
+
import './es.object.assign.js';
|
|
4
|
+
import { t as toString$1 } from './to-string.js';
|
|
5
|
+
import { w as when } from './when.js';
|
|
2
6
|
import { c as classNames } from './class-names.js';
|
|
3
7
|
|
|
4
|
-
|
|
5
|
-
__decorate([attr, __metadata("design:type", Number)], Elevation.prototype, "dp", void 0);
|
|
6
|
-
__decorate([attr({
|
|
7
|
-
attribute: 'no-shadow',
|
|
8
|
-
mode: 'boolean'
|
|
9
|
-
}), __metadata("design:type", Boolean)], Elevation.prototype, "noShadow", void 0);
|
|
8
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 27 Apr 2023 09:20:45 GMT\n */\n:host {\n display: contents;\n}\n\n.base {\n /* 4 as the indentation limit */\n /* per cell divider */\n /* per cell divider */\n --vvd-calendar-event--indent: calc(0px + var(--vvd-calendar-event--overlap-count, 0) * 8px);\n position: absolute;\n z-index: var(--vvd-calendar-event--overlap-count);\n top: calc(var(--vvd-calendar-event--start, 0) * (100% - 23px) / 24 + calc(1px * var(--vvd-calendar-event--start, 0)));\n overflow: hidden;\n box-sizing: border-box;\n padding: 4px 8px;\n background-color: var(--_appearance-color-fill);\n block-size: calc(var(--vvd-calendar-event--duration, 1) * calc((100% - 23px) / 24) + calc(1px * (var(--vvd-calendar-event--duration, 1) - 1)) - 4px);\n border-radius: 6px;\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n inline-size: calc(100% - 8px - min(var(--vvd-calendar-event--indent), 32px));\n margin-block-start: 2px;\n margin-inline-end: 8px;\n margin-inline-start: min(var(--vvd-calendar-event--indent), 32px);\n max-block-size: calc(100% - calc(var(--vvd-calendar-event--start, 0) * (100% - 23px) / 24 + calc(1px * var(--vvd-calendar-event--start, 0))) - 4px);\n}\n.base.connotation-accent {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-contrast: var(--vvd-color-neutral-800);\n --_connotation-color-soft: var(--vvd-color-neutral-100);\n}\n.base.connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-contrast: var(--vvd-color-cta-800);\n --_connotation-color-soft: var(--vvd-color-cta-100);\n}\n.base.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-contrast: var(--vvd-color-success-800);\n --_connotation-color-soft: var(--vvd-color-success-100);\n}\n.base.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-contrast: var(--vvd-color-alert-800);\n --_connotation-color-soft: var(--vvd-color-alert-100);\n}\n.base.connotation-warning {\n --_connotation-color-primary: var(--vvd-color-warning-300);\n --_connotation-color-primary-text: var(--vvd-color-canvas-text);\n --_connotation-color-contrast: var(--vvd-color-warning-800);\n --_connotation-color-soft: var(--vvd-color-warning-100);\n}\n.base.connotation-announcement {\n --_connotation-color-primary: var(--vvd-color-announcement-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-contrast: var(--vvd-color-announcement-800);\n --_connotation-color-soft: var(--vvd-color-announcement-100);\n}\n.base:not(.connotation-accent, .connotation-cta, .connotation-success, .connotation-alert, .connotation-warning, .connotation-announcement) {\n --_connotation-color-primary: var(--vvd-color-information-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-contrast: var(--vvd-color-information-800);\n --_connotation-color-soft: var(--vvd-color-information-100);\n}\n.base {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: transparent;\n}\n.base.appearance-subtle {\n --_appearance-color-text: var(--_connotation-color-contrast);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transparent;\n}\n@supports (contain: content) {\n .base {\n contain: strict;\n }\n}\n@supports not (contain: content) {\n .base {\n overflow: hidden;\n }\n}\n.base:focus {\n z-index: 2000;\n filter: var(--vvd-shadow-surface-8dp);\n outline: none;\n}\n\nh2 {\n margin: 0;\n font: var(--vvd-typography-base-condensed-bold);\n}\nh2 > strong {\n font: inherit;\n}\n\np {\n margin: 0;\n font: var(--vvd-typography-base-condensed);\n}";
|
|
10
9
|
|
|
11
|
-
var
|
|
10
|
+
var $ = _export;
|
|
11
|
+
var DESCRIPTORS = descriptors;
|
|
12
|
+
var global = global$1;
|
|
13
|
+
var uncurryThis = functionUncurryThis;
|
|
14
|
+
var hasOwn = hasOwnProperty_1;
|
|
15
|
+
var isCallable = isCallable$1;
|
|
16
|
+
var isPrototypeOf = objectIsPrototypeOf;
|
|
17
|
+
var toString = toString$1;
|
|
18
|
+
var defineProperty = objectDefineProperty.f;
|
|
19
|
+
var copyConstructorProperties = copyConstructorProperties$1;
|
|
20
|
+
|
|
21
|
+
var NativeSymbol = global.Symbol;
|
|
22
|
+
var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
|
|
23
|
+
|
|
24
|
+
if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||
|
|
25
|
+
// Safari 12 bug
|
|
26
|
+
NativeSymbol().description !== undefined
|
|
27
|
+
)) {
|
|
28
|
+
var EmptyStringDescriptionStore = {};
|
|
29
|
+
// wrap Symbol constructor for correct work with undefined description
|
|
30
|
+
var SymbolWrapper = function Symbol() {
|
|
31
|
+
var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]);
|
|
32
|
+
var result = isPrototypeOf(SymbolPrototype, this)
|
|
33
|
+
? new NativeSymbol(description)
|
|
34
|
+
// in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
|
|
35
|
+
: description === undefined ? NativeSymbol() : NativeSymbol(description);
|
|
36
|
+
if (description === '') EmptyStringDescriptionStore[result] = true;
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
copyConstructorProperties(SymbolWrapper, NativeSymbol);
|
|
41
|
+
SymbolWrapper.prototype = SymbolPrototype;
|
|
42
|
+
SymbolPrototype.constructor = SymbolWrapper;
|
|
43
|
+
|
|
44
|
+
var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)';
|
|
45
|
+
var thisSymbolValue = uncurryThis(SymbolPrototype.valueOf);
|
|
46
|
+
var symbolDescriptiveString = uncurryThis(SymbolPrototype.toString);
|
|
47
|
+
var regexp = /^Symbol\((.*)\)[^)]+$/;
|
|
48
|
+
var replace = uncurryThis(''.replace);
|
|
49
|
+
var stringSlice = uncurryThis(''.slice);
|
|
50
|
+
|
|
51
|
+
defineProperty(SymbolPrototype, 'description', {
|
|
52
|
+
configurable: true,
|
|
53
|
+
get: function description() {
|
|
54
|
+
var symbol = thisSymbolValue(this);
|
|
55
|
+
if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';
|
|
56
|
+
var string = symbolDescriptiveString(symbol);
|
|
57
|
+
var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1');
|
|
58
|
+
return desc === '' ? undefined : desc;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
$({ global: true, constructor: true, forced: true }, {
|
|
63
|
+
Symbol: SymbolWrapper
|
|
64
|
+
});
|
|
65
|
+
}
|
|
12
66
|
|
|
13
67
|
let _ = t => t,
|
|
14
|
-
_t
|
|
68
|
+
_t,
|
|
69
|
+
_t2,
|
|
70
|
+
_t3;
|
|
15
71
|
const getClasses = ({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}) => classNames('
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
72
|
+
connotation,
|
|
73
|
+
appearance
|
|
74
|
+
}) => classNames('base', [`connotation-${connotation}`, Boolean(connotation)], [`appearance-${appearance}`, Boolean(appearance)]);
|
|
75
|
+
const getStyles = ({
|
|
76
|
+
start,
|
|
77
|
+
duration,
|
|
78
|
+
overlapCount
|
|
79
|
+
}) => {
|
|
80
|
+
const stylesObj = Object.assign(Object.assign(Object.assign({}, overlapCount && {
|
|
81
|
+
'--vvd-calendar-event--overlap-count': overlapCount
|
|
82
|
+
}), start && {
|
|
83
|
+
'--vvd-calendar-event--start': start
|
|
84
|
+
}), duration && {
|
|
85
|
+
'--vvd-calendar-event--duration': duration
|
|
86
|
+
});
|
|
87
|
+
return Object.entries(stylesObj).map(entry => entry.join(':')).join(';');
|
|
88
|
+
};
|
|
89
|
+
const CalendarEventTemplate = () => html(_t || (_t = _`
|
|
90
|
+
<div
|
|
91
|
+
style="${0}"
|
|
92
|
+
class="${0}"
|
|
93
|
+
role="button"
|
|
94
|
+
tabindex="0"
|
|
95
|
+
>
|
|
96
|
+
${0}
|
|
97
|
+
${0}
|
|
98
|
+
</div>`), getStyles, getClasses, when(x => x.heading, html(_t2 || (_t2 = _`<h2><strong>${0}</strong></h2>`), x => x.heading)), when(x => x.description, html(_t3 || (_t3 = _`<p>${0}</p>`), x => x.description)));
|
|
99
|
+
|
|
100
|
+
const calendarEventDefinition = CalendarEvent.compose({
|
|
101
|
+
baseName: 'calendar-event',
|
|
102
|
+
template: CalendarEventTemplate,
|
|
103
|
+
styles: css_248z,
|
|
104
|
+
shadowOptions: {
|
|
105
|
+
delegatesFocus: true
|
|
106
|
+
}
|
|
28
107
|
});
|
|
29
|
-
const
|
|
30
|
-
const
|
|
108
|
+
const calendarEventRegistries = [calendarEventDefinition()];
|
|
109
|
+
const registerCalendarEvent = registerFactory(calendarEventRegistries);
|
|
31
110
|
|
|
32
|
-
export {
|
|
111
|
+
export { calendarEventRegistries as a, calendarEventDefinition as c, registerCalendarEvent as r };
|
package/shared/definition17.js
CHANGED
|
@@ -1,172 +1,114 @@
|
|
|
1
|
-
import { F as FoundationElement, _ as __decorate, a as attr,
|
|
1
|
+
import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, o as observable, h as html, r as registerFactory } from './index.js';
|
|
2
2
|
import { i as iconRegistries } from './definition3.js';
|
|
3
|
-
import {
|
|
4
|
-
import { C as CheckableFormAssociated } from './form-associated.js';
|
|
5
|
-
import { e as keySpace$1 } from './key-codes.js';
|
|
6
|
-
import { f as focusTemplateFactory } from './focus2.js';
|
|
3
|
+
import { E as Elevation, e as elevationRegistries } from './definition8.js';
|
|
7
4
|
import { I as Icon } from './icon.js';
|
|
5
|
+
import { s as slotted } from './slotted.js';
|
|
8
6
|
import { w as when } from './when.js';
|
|
9
7
|
import { c as classNames } from './class-names.js';
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* A form-associated base class for the {@link @microsoft/fast-foundation#(Checkbox:class)} component.
|
|
15
|
-
*
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
class FormAssociatedCheckbox extends CheckableFormAssociated(_Checkbox) {
|
|
19
|
-
constructor() {
|
|
20
|
-
super(...arguments);
|
|
21
|
-
this.proxy = document.createElement("input");
|
|
22
|
-
}
|
|
23
|
-
}
|
|
9
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 27 Apr 2023 09:20:45 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: inherit;\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}";
|
|
24
10
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
* @fires change - Emits a custom change event when the checked state changes
|
|
35
|
-
*
|
|
36
|
-
* @public
|
|
37
|
-
*/
|
|
38
|
-
class Checkbox$1 extends FormAssociatedCheckbox {
|
|
39
|
-
constructor() {
|
|
40
|
-
super();
|
|
41
|
-
/**
|
|
42
|
-
* The element's value to be included in form submission when checked.
|
|
43
|
-
* Default to "on" to reach parity with input[type="checkbox"]
|
|
44
|
-
*
|
|
45
|
-
* @internal
|
|
46
|
-
*/
|
|
47
|
-
this.initialValue = "on";
|
|
48
|
-
/**
|
|
49
|
-
* The indeterminate state of the control
|
|
50
|
-
*/
|
|
51
|
-
this.indeterminate = false;
|
|
52
|
-
/**
|
|
53
|
-
* @internal
|
|
54
|
-
*/
|
|
55
|
-
this.keypressHandler = (e) => {
|
|
56
|
-
if (this.readOnly) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
switch (e.key) {
|
|
60
|
-
case keySpace$1:
|
|
61
|
-
if (this.indeterminate) {
|
|
62
|
-
this.indeterminate = false;
|
|
63
|
-
}
|
|
64
|
-
this.checked = !this.checked;
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* @internal
|
|
70
|
-
*/
|
|
71
|
-
this.clickHandler = (e) => {
|
|
72
|
-
if (!this.disabled && !this.readOnly) {
|
|
73
|
-
if (this.indeterminate) {
|
|
74
|
-
this.indeterminate = false;
|
|
75
|
-
}
|
|
76
|
-
this.checked = !this.checked;
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
this.proxy.setAttribute("type", "checkbox");
|
|
80
|
-
}
|
|
81
|
-
readOnlyChanged() {
|
|
82
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
83
|
-
this.proxy.readOnly = this.readOnly;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
__decorate([
|
|
88
|
-
attr({ attribute: "readonly", mode: "boolean" })
|
|
89
|
-
], Checkbox$1.prototype, "readOnly", void 0);
|
|
90
|
-
__decorate([
|
|
91
|
-
observable
|
|
92
|
-
], Checkbox$1.prototype, "defaultSlottedNodes", void 0);
|
|
93
|
-
__decorate([
|
|
94
|
-
observable
|
|
95
|
-
], Checkbox$1.prototype, "indeterminate", void 0);
|
|
11
|
+
class Card extends FoundationElement {}
|
|
12
|
+
__decorate([attr, __metadata("design:type", String)], Card.prototype, "headline", void 0);
|
|
13
|
+
__decorate([attr, __metadata("design:type", String)], Card.prototype, "subtitle", void 0);
|
|
14
|
+
__decorate([attr, __metadata("design:type", String)], Card.prototype, "text", void 0);
|
|
15
|
+
__decorate([attr, __metadata("design:type", String)], Card.prototype, "icon", void 0);
|
|
16
|
+
__decorate([attr, __metadata("design:type", Number)], Card.prototype, "elevation", void 0);
|
|
17
|
+
__decorate([observable, __metadata("design:type", Array)], Card.prototype, "footerSlottedContent", void 0);
|
|
18
|
+
__decorate([observable, __metadata("design:type", Array)], Card.prototype, "graphicSlottedContent", void 0);
|
|
19
|
+
__decorate([observable, __metadata("design:type", Array)], Card.prototype, "hasMetaSlottedContent", void 0);
|
|
96
20
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
const keySpace = ' ';
|
|
100
|
-
class Checkbox extends Checkbox$1 {
|
|
101
|
-
constructor() {
|
|
102
|
-
super(...arguments);
|
|
103
|
-
this.keypressHandler = e => {
|
|
104
|
-
switch (e.key) {
|
|
105
|
-
case keySpace:
|
|
106
|
-
if (this.indeterminate) {
|
|
107
|
-
this.indeterminate = false;
|
|
108
|
-
}
|
|
109
|
-
this.checked = !this.checked;
|
|
110
|
-
break;
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
this.clickHandler = () => {
|
|
114
|
-
if (!this.disabled && !this.readOnly) {
|
|
115
|
-
if (this.indeterminate) {
|
|
116
|
-
this.indeterminate = false;
|
|
117
|
-
}
|
|
118
|
-
this.checked = !this.checked;
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
__decorate([attr, __metadata("design:type", String)], Checkbox.prototype, "label", void 0);
|
|
124
|
-
|
|
125
|
-
let _ = t => t,
|
|
21
|
+
let _2 = t => t,
|
|
126
22
|
_t,
|
|
127
23
|
_t2,
|
|
128
24
|
_t3,
|
|
129
|
-
_t4
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
25
|
+
_t4,
|
|
26
|
+
_t5,
|
|
27
|
+
_t6,
|
|
28
|
+
_t7,
|
|
29
|
+
_t8;
|
|
30
|
+
const getClasses = _ => classNames('base', ['hide-footer', !_.footerSlottedContent || !_.footerSlottedContent.length], ['hide-header', shouldHideHeader(_)]);
|
|
31
|
+
function renderHeaderIcon(iconTag) {
|
|
32
|
+
return html(_t || (_t = _2`
|
|
33
|
+
<${0} class="icon" inline name="${0}"></${0}>`), iconTag, x => x.icon, iconTag);
|
|
34
|
+
}
|
|
35
|
+
function Headline() {
|
|
36
|
+
return html(_t2 || (_t2 = _2`
|
|
37
|
+
<div class="header-headline">${0}</div>
|
|
38
|
+
`), x => x.headline);
|
|
39
|
+
}
|
|
40
|
+
function Subtitle() {
|
|
41
|
+
return html(_t3 || (_t3 = _2`
|
|
42
|
+
<div class="header-subtitle">${0}</div>
|
|
43
|
+
`), x => x.subtitle);
|
|
44
|
+
}
|
|
45
|
+
function headerContent() {
|
|
46
|
+
return html(_t4 || (_t4 = _2`
|
|
47
|
+
<div class="header-content">
|
|
48
|
+
${0}
|
|
151
49
|
${0}
|
|
50
|
+
</div>
|
|
51
|
+
`), when(x => x.headline, Headline()), when(x => x.subtitle, Subtitle()));
|
|
52
|
+
}
|
|
53
|
+
function renderHeader(iconTag) {
|
|
54
|
+
return html(_t5 || (_t5 = _2`
|
|
55
|
+
<header class="header">
|
|
56
|
+
<slot name="graphic" ${0}>${0}</slot>
|
|
152
57
|
${0}
|
|
153
|
-
|
|
154
|
-
|
|
58
|
+
</header>`), slotted('graphicSlottedContent'), when(x => x.icon, renderHeaderIcon(iconTag)), when(x => x.headline || x.subtitle, headerContent()));
|
|
59
|
+
}
|
|
60
|
+
function shouldHideHeader(card) {
|
|
61
|
+
return !card.headline && !card.subtitle && !card.icon && (!card.graphicSlottedContent || !card.graphicSlottedContent.length);
|
|
62
|
+
}
|
|
63
|
+
function renderMetaSlot() {
|
|
64
|
+
return html(_t6 || (_t6 = _2`
|
|
65
|
+
<slot name="meta" ${0}></slot>
|
|
66
|
+
`), slotted('metaSlottedContent'));
|
|
67
|
+
}
|
|
68
|
+
function text() {
|
|
69
|
+
return html(_t7 || (_t7 = _2`
|
|
70
|
+
<div class="text">${0}</div>
|
|
71
|
+
`), x => x.text);
|
|
72
|
+
}
|
|
73
|
+
const CardTemplate = context => {
|
|
74
|
+
const elevationTag = context.tagFor(Elevation);
|
|
75
|
+
const iconTag = context.tagFor(Icon);
|
|
76
|
+
return html(_t8 || (_t8 = _2`
|
|
77
|
+
<${0} dp=${0}>
|
|
155
78
|
|
|
156
|
-
|
|
79
|
+
<div class="${0}">
|
|
80
|
+
<div class="wrapper">
|
|
81
|
+
<div class="vwc-card-media">
|
|
82
|
+
<slot name="media"></slot>
|
|
83
|
+
</div>
|
|
84
|
+
<slot name="main">
|
|
85
|
+
<div class="main-content">
|
|
86
|
+
<div class="header-wrapper">
|
|
87
|
+
${0}
|
|
88
|
+
${0}
|
|
89
|
+
</div>
|
|
90
|
+
${0}
|
|
91
|
+
</div>
|
|
92
|
+
</slot>
|
|
93
|
+
<div class="footer">
|
|
94
|
+
<slot name="footer" ${0}></slot>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
157
98
|
|
|
158
|
-
|
|
99
|
+
</${0}>
|
|
100
|
+
`), elevationTag, x => {
|
|
101
|
+
var _a;
|
|
102
|
+
return (_a = x.elevation) !== null && _a !== void 0 ? _a : '4';
|
|
103
|
+
}, getClasses, renderHeader(iconTag), renderMetaSlot(), when(x => x.text, text()), slotted('footerSlottedContent'), elevationTag);
|
|
159
104
|
};
|
|
160
105
|
|
|
161
|
-
const
|
|
162
|
-
baseName: '
|
|
163
|
-
template:
|
|
164
|
-
styles: css_248z
|
|
165
|
-
shadowOptions: {
|
|
166
|
-
delegatesFocus: true
|
|
167
|
-
}
|
|
106
|
+
const cardDefinition = Card.compose({
|
|
107
|
+
baseName: 'card',
|
|
108
|
+
template: CardTemplate,
|
|
109
|
+
styles: css_248z
|
|
168
110
|
});
|
|
169
|
-
const
|
|
170
|
-
const
|
|
111
|
+
const cardRegistries = [cardDefinition(), ...iconRegistries, ...elevationRegistries];
|
|
112
|
+
const registerCard = registerFactory(cardRegistries);
|
|
171
113
|
|
|
172
|
-
export {
|
|
114
|
+
export { cardRegistries as a, cardDefinition as c, registerCard as r };
|