q2-tecton-elements 1.21.2 → 1.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/installCanvasRenderer-b4d10c92.js +38433 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q2-badge_2.cjs.entry.js +5 -3
- package/dist/cjs/q2-calendar.cjs.entry.js +75 -55
- package/dist/cjs/q2-carousel.cjs.entry.js +3 -3
- package/dist/cjs/q2-chart-bar.cjs.entry.js +4679 -0
- package/dist/cjs/q2-chart-donut.cjs.entry.js +357 -35592
- package/dist/cjs/q2-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
- package/dist/cjs/q2-radio.cjs.entry.js +1 -1
- package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/q2-calendar/index.js +43 -2
- package/dist/collection/components/q2-chart-bar/index.js +466 -0
- package/dist/collection/components/q2-chart-bar/styles.css +85 -0
- package/dist/collection/components/q2-chart-donut/index.js +3 -3
- package/dist/collection/components/q2-checkbox/styles.css +5 -1
- package/dist/collection/components/q2-editable-field/styles.css +1 -1
- package/dist/collection/components/q2-input/formatting/phone.js +2 -2
- package/dist/collection/components/q2-input/index.js +21 -0
- package/dist/collection/components/q2-input/styles.css +2 -2
- package/dist/collection/components/q2-radio/styles.css +1 -1
- package/dist/collection/utils/charting.js +182 -0
- package/dist/components/click-elsewhere.d.ts +11 -0
- package/dist/components/click-elsewhere.js +6 -0
- package/dist/components/index.d.ts +62 -0
- package/dist/components/index.js +42 -0
- package/dist/components/index10.js +84 -0
- package/dist/components/index11.js +383 -0
- package/dist/components/index12.js +125 -0
- package/dist/components/index13.js +602 -0
- package/dist/components/index2.js +100 -0
- package/dist/components/index3.js +90 -0
- package/dist/components/index4.js +62 -0
- package/dist/components/index5.js +146 -0
- package/dist/components/index6.js +145 -0
- package/dist/components/index7.js +2960 -0
- package/dist/components/index8.js +3356 -0
- package/dist/components/index9.js +101 -0
- package/dist/components/installCanvasRenderer.js +38282 -0
- package/dist/components/q2-avatar.d.ts +11 -0
- package/dist/components/q2-avatar.js +6 -0
- package/dist/components/q2-badge.d.ts +11 -0
- package/dist/components/q2-badge.js +6 -0
- package/dist/components/q2-btn.d.ts +11 -0
- package/dist/components/q2-btn.js +6 -0
- package/dist/components/q2-calendar.d.ts +11 -0
- package/dist/components/q2-calendar.js +3755 -0
- package/dist/components/q2-card.d.ts +11 -0
- package/dist/components/q2-card.js +187 -0
- package/dist/components/q2-carousel-pane.d.ts +11 -0
- package/dist/components/q2-carousel-pane.js +97 -0
- package/dist/components/q2-carousel.d.ts +11 -0
- package/dist/components/q2-carousel.js +5379 -0
- package/dist/components/q2-chart-bar.d.ts +11 -0
- package/dist/components/q2-chart-bar.js +4710 -0
- package/dist/components/q2-chart-donut.d.ts +11 -0
- package/dist/components/q2-chart-donut.js +4887 -0
- package/dist/components/q2-checkbox-group.d.ts +11 -0
- package/dist/components/q2-checkbox-group.js +114 -0
- package/dist/components/q2-checkbox.d.ts +11 -0
- package/dist/components/q2-checkbox.js +138 -0
- package/dist/components/q2-dropdown-item.d.ts +11 -0
- package/dist/components/q2-dropdown-item.js +6 -0
- package/dist/components/q2-dropdown.d.ts +11 -0
- package/dist/components/q2-dropdown.js +345 -0
- package/dist/components/q2-editable-field.d.ts +11 -0
- package/dist/components/q2-editable-field.js +220 -0
- package/dist/components/q2-icon.d.ts +11 -0
- package/dist/components/q2-icon.js +6 -0
- package/dist/components/q2-input.d.ts +11 -0
- package/dist/components/q2-input.js +6 -0
- package/dist/components/q2-loading-element.d.ts +11 -0
- package/dist/components/q2-loading-element.js +52 -0
- package/dist/components/q2-loading.d.ts +11 -0
- package/dist/components/q2-loading.js +6 -0
- package/dist/components/q2-loc.d.ts +11 -0
- package/dist/components/q2-loc.js +40 -0
- package/dist/components/q2-message.d.ts +11 -0
- package/dist/components/q2-message.js +6 -0
- package/dist/components/q2-month-picker.d.ts +11 -0
- package/dist/components/q2-month-picker.js +189 -0
- package/dist/components/q2-optgroup.d.ts +11 -0
- package/dist/components/q2-optgroup.js +75 -0
- package/dist/components/q2-option-list.d.ts +11 -0
- package/dist/components/q2-option-list.js +6 -0
- package/dist/components/q2-option.d.ts +11 -0
- package/dist/components/q2-option.js +81 -0
- package/dist/components/q2-pagination.d.ts +11 -0
- package/dist/components/q2-pagination.js +184 -0
- package/dist/components/q2-pill.d.ts +11 -0
- package/dist/components/q2-pill.js +216 -0
- package/dist/components/q2-popover.d.ts +11 -0
- package/dist/components/q2-popover.js +6 -0
- package/dist/components/q2-radio-group.d.ts +11 -0
- package/dist/components/q2-radio-group.js +191 -0
- package/dist/components/q2-radio.d.ts +11 -0
- package/dist/components/q2-radio.js +105 -0
- package/dist/components/q2-section.d.ts +11 -0
- package/dist/components/q2-section.js +218 -0
- package/dist/components/q2-select.d.ts +11 -0
- package/dist/components/q2-select.js +817 -0
- package/dist/components/q2-stepper-pane.d.ts +11 -0
- package/dist/components/q2-stepper-pane.js +92 -0
- package/dist/components/q2-stepper-vertical.d.ts +11 -0
- package/dist/components/q2-stepper-vertical.js +311 -0
- package/dist/components/q2-stepper.d.ts +11 -0
- package/dist/components/q2-stepper.js +252 -0
- package/dist/components/q2-tab-container.d.ts +11 -0
- package/dist/components/q2-tab-container.js +288 -0
- package/dist/components/q2-tab-pane.d.ts +11 -0
- package/dist/components/q2-tab-pane.js +58 -0
- package/dist/components/q2-tag.d.ts +11 -0
- package/dist/components/q2-tag.js +156 -0
- package/dist/components/q2-textarea.d.ts +11 -0
- package/dist/components/q2-textarea.js +265 -0
- package/dist/components/q2-tooltip.d.ts +11 -0
- package/dist/components/q2-tooltip.js +112 -0
- package/dist/components/shapes.js +91 -0
- package/dist/components/tecton-tab-pane.d.ts +11 -0
- package/dist/components/tecton-tab-pane.js +111 -0
- package/dist/esm/installCanvasRenderer-0143b52d.js +38282 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q2-badge_2.entry.js +5 -3
- package/dist/esm/q2-calendar.entry.js +75 -55
- package/dist/esm/q2-carousel.entry.js +3 -3
- package/dist/esm/q2-chart-bar.entry.js +4675 -0
- package/dist/esm/q2-chart-donut.entry.js +171 -35406
- package/dist/esm/q2-checkbox.entry.js +1 -1
- package/dist/esm/q2-editable-field.entry.js +1 -1
- package/dist/esm/q2-radio.entry.js +1 -1
- package/dist/esm/q2-tecton-elements.js +1 -1
- package/dist/q2-tecton-elements/p-1f85cced.js +39 -0
- package/dist/q2-tecton-elements/{p-89608314.entry.js → p-4625184b.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-9772b15f.entry.js → p-520c40f6.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-6b52a262.entry.js +1 -0
- package/dist/q2-tecton-elements/p-c4640b55.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-7e8f43d1.entry.js → p-cf41970f.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-e4dc9ac0.entry.js +1 -0
- package/dist/q2-tecton-elements/p-f35bf6a3.entry.js +1 -0
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/types/components/q2-calendar/index.d.ts +3 -0
- package/dist/types/components/q2-chart-bar/index.d.ts +40 -0
- package/dist/types/components/q2-chart-donut/index.d.ts +7 -10
- package/dist/types/components/q2-input/index.d.ts +1 -0
- package/dist/types/components.d.ts +50 -3
- package/dist/types/utils/charting.d.ts +14 -0
- package/package.json +6 -3
- package/dist/q2-tecton-elements/p-0766a694.entry.js +0 -1
- package/dist/q2-tecton-elements/p-5f064e1e.entry.js +0 -39
- package/dist/q2-tecton-elements/p-8d25ec52.entry.js +0 -1
- /package/dist/types/workspace/workspace/{tecton-production_release_1.21.x → tecton-production_release_1.22.x}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface Q2Card extends Components.Q2Card, HTMLElement {}
|
|
4
|
+
export const Q2Card: {
|
|
5
|
+
prototype: Q2Card;
|
|
6
|
+
new (): Q2Card;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Fragment } from '@stencil/core/internal/client';
|
|
2
|
+
import { a as isTouchDevice, o as overrideFocus, i as isEventFromElement } from './index13.js';
|
|
3
|
+
import { d as defineCustomElement$3 } from './index3.js';
|
|
4
|
+
import { d as defineCustomElement$2 } from './index7.js';
|
|
5
|
+
|
|
6
|
+
const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:block}.container{position:relative;width:100%;text-align:start;height:100%;display:grid;gap:var(--tct-card-gap, var(--t-card-gap, var(--app-scale-3x, 15px)));margin:0;color:var(--tct-card-color, var(--t-card-color, var(--t-text, #4d4d4d)));--comp-avatar-size:var(--tct-card-avatar-size, var(--t-card-avatar-size, 44px));--comp-chevron-size:0;--comp-bar-width:var(--tct-card-bar-width, var(--t-card-bar-width, var(--app-scale-2x, 10px)));--comp-card-padding:var(--tct-card-padding, var(--t-card-padding, var(--app-scale-4x, 20px)))}.container.is-small{--comp-avatar-size:var(--tct-card-avatar-size, var(--t-card-avatar-size, 26px))}.container.has-avatar{grid-template-columns:var(--comp-avatar-size) 1fr;--tct-avatar-width:var(--comp-avatar-size);--tct-avatar-height:var(--comp-avatar-size);--tct-icon-size:var(--comp-avatar-size)}:host([bar][is-static]) .container{padding-left:var(--comp-card-padding)}.container:is(button),.container:is(a){--comp-border-radius:var(--tct-card-border-radius, var(--t-card-border-radius, var(--app-border-radius-1, 3px)));--comp-border-width:var(--tct-card-border-width, var(--t-card-border-width, 0px));cursor:pointer;border:none;background:var(--tct-card-background, var(--t-card-background, var(--t-base, #ffffff)));padding:var(--comp-card-padding);text-decoration:none;border-width:var(--comp-border-width);border-color:var(--tct-card-border-color, var(--t-card-border-color, transparent));border-style:solid;border-radius:var(--comp-border-radius);transition:box-shadow var(--tct-tween-1, var(--app-tween-1, 0.2s ease));box-shadow:var(--tct-card-box-shadow, var(--t-card-box-shadow, var(--app-shadow-2, 0 3px 6px rgba(0, 0, 0, 0.3))))}@media (hover: hover){.container:is(button),.container:is(a){--comp-card-hover-box-shadow:var(--tct-card-hover-box-shadow, var(--t-card-hover-box-shadow, var(--app-shadow-3, 0 4px 12px rgba(0, 0, 0, 0.3))))}.container:is(button):hover,.container:is(button):active,.container:is(button):focus,.container:is(a):hover,.container:is(a):active,.container:is(a):focus{color:var(--tct-card-color, var(--t-card-color, var(--t-text, #4d4d4d)));box-shadow:var(--const-double-focus-ring)}.container:is(button):hover,.container:is(a):hover{box-shadow:var(--comp-card-hover-box-shadow)}.container:is(button):focus:hover,.container:is(a):focus:hover{box-shadow:var(--const-double-focus-ring), var(--comp-card-hover-box-shadow)}.container:is(button):active,.container:is(a):active{box-shadow:var(--tct-card-active-box-shadow, var(--t-card-active-box-shadow, var(--app-shadow-1, 0 2px 4px rgba(0, 0, 0, 0.3))))}}.container:is(button).is-touch,.container:is(a).is-touch{--comp-chevron-size:var(--tct-card-chevron-size, var(--t-card-chevron-size, 26px));grid-template-columns:1fr var(--comp-chevron-size)}.container:is(button).has-avatar.is-touch,.container:is(a).has-avatar.is-touch{grid-template-columns:var(--comp-avatar-size) 1fr var(--comp-chevron-size)}.content{overflow:hidden;display:grid;gap:var(--tct-card-content-gap, var(--t-card-content-gap, var(--app-scale-1x, 5px)));align-content:start}h3,p{margin:0;padding:0;line-height:var(--tct-card-font-height, var(--t-card-font-height, 20px))}h3{font-weight:var(--tct-card-font-weight, var(--t-card-font-weight, 600));font-size:var(--tct-card-font-size, var(--t-card-font-size, 17px));text-overflow:ellipsis;overflow:hidden;white-space:nowrap}p{text-overflow:ellipsis;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.bar{--comp-bar-border-radius:calc(var(--comp-border-radius) - var(--comp-border-width));border-radius:var(--comp-bar-border-radius) 0 0 var(--comp-bar-border-radius);position:absolute;inset:0 auto auto 0;width:var(--comp-bar-width);background:var(--comp-bar-color);height:100%}.touch-indicator{align-self:center;--tct-icon-size:var(--comp-chevron-size)}";
|
|
7
|
+
|
|
8
|
+
const SUPPORTED_THEME_COLORS = [
|
|
9
|
+
'primary',
|
|
10
|
+
'secondary',
|
|
11
|
+
'tertiary',
|
|
12
|
+
'accent-1',
|
|
13
|
+
'accent-2',
|
|
14
|
+
'accent-3',
|
|
15
|
+
'accent-4',
|
|
16
|
+
'accent-5',
|
|
17
|
+
'accent-6',
|
|
18
|
+
'accent-7',
|
|
19
|
+
'accent-8',
|
|
20
|
+
'accent-9',
|
|
21
|
+
'accent-10',
|
|
22
|
+
'accent-11',
|
|
23
|
+
'accent-12',
|
|
24
|
+
];
|
|
25
|
+
const STOPLIGHT_COLORS = ['info', 'success', 'warning', 'alert'];
|
|
26
|
+
const Q2Card$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
27
|
+
constructor() {
|
|
28
|
+
super();
|
|
29
|
+
this.__registerHost();
|
|
30
|
+
this.__attachShadow();
|
|
31
|
+
this.click = createEvent(this, "click", 7);
|
|
32
|
+
this.handleClick = (event) => {
|
|
33
|
+
if (this.url)
|
|
34
|
+
return true;
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
event.stopPropagation();
|
|
37
|
+
this.click.emit();
|
|
38
|
+
};
|
|
39
|
+
this.title = undefined;
|
|
40
|
+
this.description = undefined;
|
|
41
|
+
this.avatarName = undefined;
|
|
42
|
+
this.avatarInitials = undefined;
|
|
43
|
+
this.avatarIcon = undefined;
|
|
44
|
+
this.avatarSrc = undefined;
|
|
45
|
+
this.isSmall = undefined;
|
|
46
|
+
this.bar = undefined;
|
|
47
|
+
this.isStatic = undefined;
|
|
48
|
+
this.isTouch = isTouchDevice();
|
|
49
|
+
this.url = undefined;
|
|
50
|
+
this.target = undefined;
|
|
51
|
+
this.isAutoTouch = false;
|
|
52
|
+
this.isAutoSmall = false;
|
|
53
|
+
}
|
|
54
|
+
componentWillLoad() {
|
|
55
|
+
this.checkBar();
|
|
56
|
+
}
|
|
57
|
+
componentDidLoad() {
|
|
58
|
+
const { hostElement, clickableElement } = this;
|
|
59
|
+
hostElement.click = () => clickableElement.click();
|
|
60
|
+
overrideFocus(this.hostElement);
|
|
61
|
+
this.resizeObserver = new ResizeObserver(() => this.determineAutoSmall());
|
|
62
|
+
this.resizeObserver.observe(this.hostElement);
|
|
63
|
+
}
|
|
64
|
+
willDestroyElement() {
|
|
65
|
+
this.resizeObserver = null;
|
|
66
|
+
}
|
|
67
|
+
onHostElementFocus(event) {
|
|
68
|
+
if (!isEventFromElement(event, this.hostElement))
|
|
69
|
+
return;
|
|
70
|
+
this.clickableElement.focus();
|
|
71
|
+
}
|
|
72
|
+
checkBar() {
|
|
73
|
+
const { bar } = this;
|
|
74
|
+
if (!bar)
|
|
75
|
+
return;
|
|
76
|
+
if (SUPPORTED_THEME_COLORS.includes(bar)) {
|
|
77
|
+
this.barColor = `var(--t-${bar})`;
|
|
78
|
+
}
|
|
79
|
+
else if (STOPLIGHT_COLORS.includes(bar)) {
|
|
80
|
+
this.barColor = `var(--const-stoplight-${bar})`;
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
this.barColor = bar;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
determineAutoTouch() {
|
|
87
|
+
if (this.hostElement.hasAttribute('is-touch'))
|
|
88
|
+
return;
|
|
89
|
+
this.isAutoTouch = isTouchDevice();
|
|
90
|
+
}
|
|
91
|
+
determineAutoSmall() {
|
|
92
|
+
var _a, _b;
|
|
93
|
+
if (this.isStatic)
|
|
94
|
+
return;
|
|
95
|
+
if (this.hostElement.hasAttribute('is-small'))
|
|
96
|
+
return;
|
|
97
|
+
const { containerElement, avatarElement } = this;
|
|
98
|
+
const avatarWidth = (_a = avatarElement === null || avatarElement === void 0 ? void 0 : avatarElement.offsetWidth) !== null && _a !== void 0 ? _a : 0;
|
|
99
|
+
const containerWidth = (_b = containerElement === null || containerElement === void 0 ? void 0 : containerElement.offsetWidth) !== null && _b !== void 0 ? _b : 0;
|
|
100
|
+
const totalWidth = avatarWidth + containerWidth;
|
|
101
|
+
this.isAutoSmall = totalWidth < 350;
|
|
102
|
+
}
|
|
103
|
+
generateAvatar() {
|
|
104
|
+
const { avatarName, avatarInitials, avatarSrc, avatarIcon } = this;
|
|
105
|
+
if (avatarIcon) {
|
|
106
|
+
return (h("q2-icon", { type: avatarIcon, ref: e => (this.avatarElement = e), "test-id": "avatar" }));
|
|
107
|
+
}
|
|
108
|
+
else if (avatarName || avatarInitials || avatarSrc) {
|
|
109
|
+
return (h("q2-avatar", { name: avatarName, initials: avatarInitials, src: avatarSrc, ref: e => (this.avatarElement = e), "test-id": "avatar" }));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
generateContent() {
|
|
113
|
+
return (h(Fragment, null, this.bar && (h("div", { class: "bar", "test-id": "bar", style: { '--comp-bar-color': this.barColor } })), this.generateAvatar(), h("div", { class: "content", "test-id": "contentContainer", ref: e => (this.containerElement = e) }, this.title && h("h3", { "test-id": "title" }, this.title), this.description && h("p", { "test-id": "description" }, this.description), h("slot", null)), this.isTouch && !this.isStatic && (h("q2-icon", { "test-id": "touchIndicator", type: "chevron-right", class: "touch-indicator" }))));
|
|
114
|
+
}
|
|
115
|
+
generateContainerClasses() {
|
|
116
|
+
const { isSmall, isAutoSmall, avatarName, avatarInitials, avatarSrc, avatarIcon, isTouch, isAutoTouch, isStatic, } = this;
|
|
117
|
+
const result = ['container'];
|
|
118
|
+
const showSmall = isSmall || isAutoSmall;
|
|
119
|
+
const showTouch = isTouch || isAutoTouch;
|
|
120
|
+
const hasAvatar = avatarName || avatarInitials || avatarSrc || avatarIcon;
|
|
121
|
+
if (showSmall)
|
|
122
|
+
result.push('is-small');
|
|
123
|
+
if (showTouch && !isStatic)
|
|
124
|
+
result.push('is-touch');
|
|
125
|
+
if (hasAvatar)
|
|
126
|
+
result.push('has-avatar');
|
|
127
|
+
return result.join(' ');
|
|
128
|
+
}
|
|
129
|
+
render() {
|
|
130
|
+
const { url, isStatic } = this;
|
|
131
|
+
if (!!url)
|
|
132
|
+
return (h("a", { ref: e => (this.clickableElement = e), href: this.url, class: this.generateContainerClasses(), target: this.target, rel: "noopener noreferrer", "test-id": "clickableElement", onClick: this.handleClick }, this.generateContent()));
|
|
133
|
+
else if (isStatic)
|
|
134
|
+
return (h("div", { ref: e => (this.clickableElement = e), class: this.generateContainerClasses(), "test-id": "clickableElement" }, this.generateContent()));
|
|
135
|
+
else
|
|
136
|
+
return (h("button", { ref: e => (this.clickableElement = e), class: this.generateContainerClasses(), "test-id": "clickableElement", type: "button", onClick: this.handleClick }, this.generateContent()));
|
|
137
|
+
}
|
|
138
|
+
get hostElement() { return this; }
|
|
139
|
+
static get watchers() { return {
|
|
140
|
+
"bar": ["checkBar"]
|
|
141
|
+
}; }
|
|
142
|
+
static get style() { return stylesCss; }
|
|
143
|
+
}, [1, "q2-card", {
|
|
144
|
+
"title": [513],
|
|
145
|
+
"description": [513],
|
|
146
|
+
"avatarName": [513, "avatar-name"],
|
|
147
|
+
"avatarInitials": [513, "avatar-initials"],
|
|
148
|
+
"avatarIcon": [513, "avatar-icon"],
|
|
149
|
+
"avatarSrc": [513, "avatar-src"],
|
|
150
|
+
"isSmall": [516, "is-small"],
|
|
151
|
+
"bar": [513],
|
|
152
|
+
"isStatic": [516, "is-static"],
|
|
153
|
+
"isTouch": [516, "is-touch"],
|
|
154
|
+
"url": [513],
|
|
155
|
+
"target": [513],
|
|
156
|
+
"isAutoTouch": [32],
|
|
157
|
+
"isAutoSmall": [32]
|
|
158
|
+
}, [[0, "focus", "onHostElementFocus"]]]);
|
|
159
|
+
function defineCustomElement$1() {
|
|
160
|
+
if (typeof customElements === "undefined") {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const components = ["q2-card", "q2-avatar", "q2-icon"];
|
|
164
|
+
components.forEach(tagName => { switch (tagName) {
|
|
165
|
+
case "q2-card":
|
|
166
|
+
if (!customElements.get(tagName)) {
|
|
167
|
+
customElements.define(tagName, Q2Card$1);
|
|
168
|
+
}
|
|
169
|
+
break;
|
|
170
|
+
case "q2-avatar":
|
|
171
|
+
if (!customElements.get(tagName)) {
|
|
172
|
+
defineCustomElement$3();
|
|
173
|
+
}
|
|
174
|
+
break;
|
|
175
|
+
case "q2-icon":
|
|
176
|
+
if (!customElements.get(tagName)) {
|
|
177
|
+
defineCustomElement$2();
|
|
178
|
+
}
|
|
179
|
+
break;
|
|
180
|
+
} });
|
|
181
|
+
}
|
|
182
|
+
defineCustomElement$1();
|
|
183
|
+
|
|
184
|
+
const Q2Card = Q2Card$1;
|
|
185
|
+
const defineCustomElement = defineCustomElement$1;
|
|
186
|
+
|
|
187
|
+
export { Q2Card, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface Q2CarouselPane extends Components.Q2CarouselPane, HTMLElement {}
|
|
4
|
+
export const Q2CarouselPane: {
|
|
5
|
+
prototype: Q2CarouselPane;
|
|
6
|
+
new (): Q2CarouselPane;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { l as loc } from './index13.js';
|
|
3
|
+
|
|
4
|
+
const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}q2-carousel .swiper-slide{flex-shrink:0;width:100%;height:100%;position:relative;transition-property:transform;transition:all 0.2s}q2-carousel-pane.q2-carousel-pane{--comp-carousel-pane-tween:var(--tct-tween-1, var(--app-tween-1, 0.2s ease));--comp-carousel-shadow:var(--app-shadow-2, 0px 2px 8px 0px var(--t-top-a1, rgba(0, 0, 0, 0.25)));cursor:grab}q2-carousel-pane.q2-carousel-pane:not([is-active-pane]) *{cursor:pointer}q2-carousel-pane.q2-carousel-pane:focus{box-shadow:none}q2-carousel-pane.q2-carousel-pane:focus .q2-carousel-pane-main-content{outline:none;box-shadow:var(--const-double-focus-ring)}q2-carousel-pane.q2-carousel-pane button{border:0;background:transparent;transition:all 0.2s;opacity:0.3;cursor:pointer}q2-carousel-pane.q2-carousel-pane button:hover{opacity:0.7}q2-carousel-pane.q2-carousel-pane .q2-carousel-pane-main-content{box-shadow:var(--comp-carousel-shadow);transition:var(--comp-carousel-pane-tween);background-color:var(--tct-carousel-background-color, var(--t-carousel-background-color, var(--tct-white, var(--app-white, #ffffff))));border:var(--tct-carousel-pane-border-width, var(--t-carousel-pane-border-width, 0px)) solid var(--tct-carousel-pane-border-color, var(--t-carousel-pane-border-color, var(--tct-gray-11, var(--t-gray-11, var(--tct-gray-l1, var(--app-gray-l1, #cccccc))))));border-radius:var(--tct-carousel-pane-border-radius, var(--t-carousel-pane-border-radius, 8px));padding:var(--tct-carousel-pane-padding, var(--t-carousel-pane-padding, 0.5rem 0.5rem 0.5rem 0.5rem));height:var(--tct-carousel-pane-height, var(--t-carousel-pane-height, 10em))}q2-carousel-pane.q2-carousel-pane .q2-carousel-pane-main-content:hover{box-shadow:var(--const-double-focus-ring), var(--comp-carousel-shadow)}";
|
|
5
|
+
|
|
6
|
+
const Q2Carousel = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.clickCarouselPane = createEvent(this, "clickCarouselPane", 7);
|
|
11
|
+
this.generatePaneClass = (currentIndex) => {
|
|
12
|
+
return `q2-carousel-pane swiper-slide q2-carousel-pane-${currentIndex}`;
|
|
13
|
+
};
|
|
14
|
+
this.paneClicked = event => {
|
|
15
|
+
if (this.isActivePane)
|
|
16
|
+
return;
|
|
17
|
+
event.preventDefault();
|
|
18
|
+
this.clickCarouselPane.emit({
|
|
19
|
+
paneIndex: this.index,
|
|
20
|
+
pane: this.hostElement,
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
this.index = undefined;
|
|
24
|
+
this.siblingCount = undefined;
|
|
25
|
+
this.isActivePane = undefined;
|
|
26
|
+
this.label = undefined;
|
|
27
|
+
}
|
|
28
|
+
get currentPaneIndex() {
|
|
29
|
+
return Array.prototype.indexOf.call(this.hostElement.parentElement.children, this.hostElement);
|
|
30
|
+
}
|
|
31
|
+
componentDidLoad() {
|
|
32
|
+
this.determineDisabledContent();
|
|
33
|
+
}
|
|
34
|
+
determineDisabledContent() {
|
|
35
|
+
const { isActivePane } = this;
|
|
36
|
+
const focusableElements = this.hostElement.querySelectorAll('q2-btn, a[href], button, [tabindex]:not([tabindex="-1"])');
|
|
37
|
+
focusableElements.forEach(element => {
|
|
38
|
+
const hasValidTabIndex = element.hasAttribute('tabindex') && parseInt(element.getAttribute('tabindex')) >= 0;
|
|
39
|
+
if (hasValidTabIndex) {
|
|
40
|
+
element.dataset.q2Tabindex = `${element.tabIndex}`;
|
|
41
|
+
}
|
|
42
|
+
if (isActivePane) {
|
|
43
|
+
if (element.hasAttribute('data-q2-tabindex')) {
|
|
44
|
+
element.tabIndex = parseInt(element.getAttribute('data-q2-tabindex'));
|
|
45
|
+
element.removeAttribute('data-q2-tabindex');
|
|
46
|
+
}
|
|
47
|
+
else if (element.tagName.startsWith('Q2-')) {
|
|
48
|
+
element.tabIndex = undefined;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
element.removeAttribute('tabindex');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
element.tabIndex = -1;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
render() {
|
|
60
|
+
const { label } = this;
|
|
61
|
+
return (h(Host, { class: this.generatePaneClass(this.currentPaneIndex), tabIndex: this.isActivePane ? 0 : -1, role: "group", "aria-roledescription": "slide", "aria-hidden": this.isActivePane ? undefined : 'true', "aria-label": label
|
|
62
|
+
? loc(label)
|
|
63
|
+
: loc('tecton.element.carousel.itemDescription', [
|
|
64
|
+
(this.currentPaneIndex + 1).toString(),
|
|
65
|
+
(this.siblingCount || 0).toString(),
|
|
66
|
+
]), onClick: this.paneClicked }, h("article", { class: "q2-carousel-pane-main-content" }, h("slot", null))));
|
|
67
|
+
}
|
|
68
|
+
get hostElement() { return this; }
|
|
69
|
+
static get watchers() { return {
|
|
70
|
+
"isActivePane": ["determineDisabledContent"]
|
|
71
|
+
}; }
|
|
72
|
+
static get style() { return stylesCss; }
|
|
73
|
+
}, [4, "q2-carousel-pane", {
|
|
74
|
+
"index": [2],
|
|
75
|
+
"siblingCount": [2, "sibling-count"],
|
|
76
|
+
"isActivePane": [516, "is-active-pane"],
|
|
77
|
+
"label": [513]
|
|
78
|
+
}]);
|
|
79
|
+
function defineCustomElement$1() {
|
|
80
|
+
if (typeof customElements === "undefined") {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const components = ["q2-carousel-pane"];
|
|
84
|
+
components.forEach(tagName => { switch (tagName) {
|
|
85
|
+
case "q2-carousel-pane":
|
|
86
|
+
if (!customElements.get(tagName)) {
|
|
87
|
+
customElements.define(tagName, Q2Carousel);
|
|
88
|
+
}
|
|
89
|
+
break;
|
|
90
|
+
} });
|
|
91
|
+
}
|
|
92
|
+
defineCustomElement$1();
|
|
93
|
+
|
|
94
|
+
const Q2CarouselPane = Q2Carousel;
|
|
95
|
+
const defineCustomElement = defineCustomElement$1;
|
|
96
|
+
|
|
97
|
+
export { Q2CarouselPane, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface Q2Carousel extends Components.Q2Carousel, HTMLElement {}
|
|
4
|
+
export const Q2Carousel: {
|
|
5
|
+
prototype: Q2Carousel;
|
|
6
|
+
new (): Q2Carousel;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|