q2-tecton-elements 1.18.0 → 1.19.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/dist/cjs/click-elsewhere.cjs.entry.js +1 -1
- package/dist/cjs/{icons-e2bc9ee9.js → icons-afbdf88a.js} +1 -1
- package/dist/cjs/{index-eccd5617.js → index-3518c78c.js} +1 -1
- package/dist/cjs/{index-0128397d.js → index-734296a7.js} +476 -271
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/q2-avatar.cjs.entry.js +9 -6
- package/dist/cjs/q2-badge_2.cjs.entry.js +46 -7
- package/dist/cjs/q2-btn_2.cjs.entry.js +30 -5
- package/dist/cjs/q2-calendar.cjs.entry.js +89 -62
- package/dist/cjs/q2-card.cjs.entry.js +17 -6
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +7 -3
- package/dist/cjs/q2-carousel.cjs.entry.js +196 -285
- package/dist/cjs/q2-chart-donut.cjs.entry.js +583 -504
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +9 -7
- package/dist/cjs/q2-checkbox.cjs.entry.js +17 -4
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +9 -3
- package/dist/cjs/q2-dropdown.cjs.entry.js +16 -5
- package/dist/cjs/q2-editable-field.cjs.entry.js +16 -6
- package/dist/cjs/q2-icon.cjs.entry.js +6 -4
- package/dist/cjs/q2-loading-element.cjs.entry.js +6 -2
- package/dist/cjs/q2-loc.cjs.entry.js +5 -3
- package/dist/cjs/q2-message.cjs.entry.js +4 -3
- package/dist/cjs/q2-month-picker.cjs.entry.js +9 -7
- package/dist/cjs/q2-optgroup.cjs.entry.js +6 -5
- package/dist/cjs/q2-option-list_2.cjs.entry.js +21 -7
- package/dist/cjs/q2-option.cjs.entry.js +12 -2
- package/dist/cjs/q2-pagination.cjs.entry.js +11 -3
- package/dist/cjs/q2-pill.cjs.entry.js +25 -7
- package/dist/cjs/q2-radio-group.cjs.entry.js +13 -6
- package/dist/cjs/q2-radio.cjs.entry.js +13 -8
- package/dist/cjs/q2-section.cjs.entry.js +9 -4
- package/dist/cjs/q2-select.cjs.entry.js +26 -17
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +8 -3
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js +5 -4
- package/dist/cjs/q2-stepper.cjs.entry.js +9 -7
- package/dist/cjs/q2-tab-container.cjs.entry.js +14 -9
- package/dist/cjs/q2-tab-pane.cjs.entry.js +10 -2
- package/dist/cjs/q2-tag.cjs.entry.js +20 -7
- package/dist/cjs/q2-tecton-elements.cjs.js +3 -3
- package/dist/cjs/q2-textarea.cjs.entry.js +20 -4
- package/dist/cjs/q2-tooltip.cjs.entry.js +9 -3
- package/dist/cjs/{shapes-c1a60d46.js → shapes-aad2b98f.js} +1 -1
- package/dist/cjs/tecton-tab-pane.cjs.entry.js +17 -2
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/click-elsewhere/index.js +18 -17
- package/dist/collection/components/q2-avatar/index.js +100 -92
- package/dist/collection/components/q2-avatar/styles.css +1 -1
- package/dist/collection/components/q2-badge/index.js +119 -111
- package/dist/collection/components/q2-badge/styles.css +1 -1
- package/dist/collection/components/q2-btn/index.js +349 -322
- package/dist/collection/components/q2-btn/styles.css +7 -7
- package/dist/collection/components/q2-calendar/index.js +565 -551
- package/dist/collection/components/q2-calendar/q2-month-picker.css +1 -1
- package/dist/collection/components/q2-calendar/q2-month-picker.js +112 -116
- package/dist/collection/components/q2-calendar/styles.css +1 -1
- package/dist/collection/components/q2-card/index.js +262 -244
- package/dist/collection/components/q2-card/styles.css +9 -2
- package/dist/collection/components/q2-carousel/index.js +249 -253
- package/dist/collection/components/q2-carousel/styles.css +1 -1
- package/dist/collection/components/q2-carousel-pane/index.js +108 -96
- package/dist/collection/components/q2-carousel-pane/styles.css +5 -4
- package/dist/collection/components/q2-chart-donut/index.js +350 -334
- package/dist/collection/components/q2-chart-donut/styles.css +3 -3
- package/dist/collection/components/q2-checkbox/index.js +296 -287
- package/dist/collection/components/q2-checkbox/styles.css +2 -2
- package/dist/collection/components/q2-checkbox-group/index.js +156 -152
- package/dist/collection/components/q2-checkbox-group/styles.css +1 -1
- package/dist/collection/components/q2-dropdown/index.js +255 -240
- package/dist/collection/components/q2-dropdown/styles.css +1 -1
- package/dist/collection/components/q2-dropdown-item/index.js +134 -123
- package/dist/collection/components/q2-dropdown-item/styles.css +12 -10
- package/dist/collection/components/q2-editable-field/index.js +300 -293
- package/dist/collection/components/q2-editable-field/styles.css +1 -1
- package/dist/collection/components/q2-icon/icons.js +358 -2158
- package/dist/collection/components/q2-icon/index.js +59 -49
- package/dist/collection/components/q2-icon/styles.css +1 -1
- package/dist/collection/components/q2-input/index.js +729 -705
- package/dist/collection/components/q2-input/styles.css +2 -2
- package/dist/collection/components/q2-loading/index.js +143 -132
- package/dist/collection/components/q2-loading/skeleton/q2-loading-element/index.js +85 -74
- package/dist/collection/components/q2-loading/skeleton/shapes.js +23 -36
- package/dist/collection/components/q2-loading/styles.css +1 -1
- package/dist/collection/components/q2-loc/index.js +49 -39
- package/dist/collection/components/q2-loc/styles.css +1 -1
- package/dist/collection/components/q2-message/index.js +101 -92
- package/dist/collection/components/q2-message/styles.css +1 -1
- package/dist/collection/components/q2-optgroup/index.js +64 -56
- package/dist/collection/components/q2-optgroup/styles.css +1 -1
- package/dist/collection/components/q2-option/index.js +244 -229
- package/dist/collection/components/q2-option/styles.css +5 -1
- package/dist/collection/components/q2-option-list/index.js +291 -270
- package/dist/collection/components/q2-option-list/styles.css +1 -1
- package/dist/collection/components/q2-pagination/index.js +183 -179
- package/dist/collection/components/q2-pagination/styles.css +1 -1
- package/dist/collection/components/q2-pill/index.js +260 -208
- package/dist/collection/components/q2-pill/styles.css +1 -1
- package/dist/collection/components/q2-popover/index.js +169 -151
- package/dist/collection/components/q2-popover/styles.css +2 -2
- package/dist/collection/components/q2-radio/index.js +233 -224
- package/dist/collection/components/q2-radio/styles.css +3 -3
- package/dist/collection/components/q2-radio-group/index.js +252 -244
- package/dist/collection/components/q2-radio-group/styles.css +1 -1
- package/dist/collection/components/q2-section/index.js +134 -125
- package/dist/collection/components/q2-section/styles.css +12 -1
- package/dist/collection/components/q2-select/index.js +393 -381
- package/dist/collection/components/q2-select/styles.css +1 -1
- package/dist/collection/components/q2-stepper/index.js +124 -126
- package/dist/collection/components/q2-stepper/styles.css +2 -1
- package/dist/collection/components/q2-stepper-pane/index.js +165 -149
- package/dist/collection/components/q2-stepper-pane/styles.css +1 -1
- package/dist/collection/components/q2-stepper-vertical/index.js +86 -85
- package/dist/collection/components/q2-stepper-vertical/styles.css +1 -1
- package/dist/collection/components/q2-tab-container/index.js +189 -184
- package/dist/collection/components/q2-tab-container/styles.css +1 -1
- package/dist/collection/components/q2-tab-pane/index.js +185 -166
- package/dist/collection/components/q2-tab-pane/styles.css +1 -1
- package/dist/collection/components/q2-tag/index.js +168 -116
- package/dist/collection/components/q2-tag/styles.css +1 -1
- package/dist/collection/components/q2-textarea/index.js +344 -327
- package/dist/collection/components/q2-textarea/styles.css +2 -2
- package/dist/collection/components/q2-tooltip/index.js +147 -133
- package/dist/collection/components/q2-tooltip/styles.css +1 -1
- package/dist/collection/components/tecton-tab-pane/index.js +287 -266
- package/dist/collection/components/tecton-tab-pane/styles.css +1 -1
- package/dist/collection/utils/index.js +2 -6
- package/dist/esm/click-elsewhere.entry.js +1 -1
- package/dist/esm/{icons-ed54e307.js → icons-78da5dd2.js} +1 -1
- package/dist/esm/{index-eac6b89e.js → index-9c591682.js} +1 -1
- package/dist/esm/{index-6d5ed7cc.js → index-bb1c8c7f.js} +476 -271
- package/dist/esm/loader.js +3 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/q2-avatar.entry.js +9 -6
- package/dist/esm/q2-badge_2.entry.js +46 -7
- package/dist/esm/q2-btn_2.entry.js +30 -5
- package/dist/esm/q2-calendar.entry.js +89 -62
- package/dist/esm/q2-card.entry.js +17 -6
- package/dist/esm/q2-carousel-pane.entry.js +7 -3
- package/dist/esm/q2-carousel.entry.js +196 -285
- package/dist/esm/q2-chart-donut.entry.js +583 -504
- package/dist/esm/q2-checkbox-group.entry.js +9 -7
- package/dist/esm/q2-checkbox.entry.js +17 -4
- package/dist/esm/q2-dropdown-item.entry.js +9 -3
- package/dist/esm/q2-dropdown.entry.js +16 -5
- package/dist/esm/q2-editable-field.entry.js +16 -6
- package/dist/esm/q2-icon.entry.js +6 -4
- package/dist/esm/q2-loading-element.entry.js +6 -2
- package/dist/esm/q2-loc.entry.js +5 -3
- package/dist/esm/q2-message.entry.js +4 -3
- package/dist/esm/q2-month-picker.entry.js +9 -7
- package/dist/esm/q2-optgroup.entry.js +6 -5
- package/dist/esm/q2-option-list_2.entry.js +21 -7
- package/dist/esm/q2-option.entry.js +12 -2
- package/dist/esm/q2-pagination.entry.js +11 -3
- package/dist/esm/q2-pill.entry.js +25 -7
- package/dist/esm/q2-radio-group.entry.js +13 -6
- package/dist/esm/q2-radio.entry.js +13 -8
- package/dist/esm/q2-section.entry.js +9 -4
- package/dist/esm/q2-select.entry.js +26 -17
- package/dist/esm/q2-stepper-pane.entry.js +8 -3
- package/dist/esm/q2-stepper-vertical.entry.js +5 -4
- package/dist/esm/q2-stepper.entry.js +9 -7
- package/dist/esm/q2-tab-container.entry.js +14 -9
- package/dist/esm/q2-tab-pane.entry.js +10 -2
- package/dist/esm/q2-tag.entry.js +20 -7
- package/dist/esm/q2-tecton-elements.js +3 -3
- package/dist/esm/q2-textarea.entry.js +20 -4
- package/dist/esm/q2-tooltip.entry.js +9 -3
- package/dist/esm/{shapes-c32e3ba2.js → shapes-62b8a431.js} +1 -1
- package/dist/esm/tecton-tab-pane.entry.js +17 -2
- package/dist/loader/package.json +1 -0
- package/dist/q2-tecton-elements/p-0ba564b1.entry.js +1 -0
- package/dist/q2-tecton-elements/p-0fad9c5a.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-73154834.js → p-13a639cf.js} +1 -1
- package/dist/q2-tecton-elements/p-16c11d74.entry.js +1 -0
- package/dist/q2-tecton-elements/p-17e0cbf1.entry.js +1 -0
- package/dist/q2-tecton-elements/p-18e095af.entry.js +1 -0
- package/dist/q2-tecton-elements/p-2c9b1308.entry.js +1 -0
- package/dist/q2-tecton-elements/p-2e832e42.entry.js +1 -0
- package/dist/q2-tecton-elements/p-315fdb74.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-c608e3c9.entry.js → p-444415b5.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-4d700630.entry.js +1 -0
- package/dist/q2-tecton-elements/p-4f0f45e7.entry.js +1 -0
- package/dist/q2-tecton-elements/p-54e792bd.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-80014da0.js → p-5e374fbd.js} +1 -1
- package/dist/q2-tecton-elements/p-5f064e1e.entry.js +39 -0
- package/dist/q2-tecton-elements/p-692f2d09.entry.js +1 -0
- package/dist/q2-tecton-elements/p-6e6b5b80.entry.js +1 -0
- package/dist/q2-tecton-elements/p-7e8f43d1.entry.js +1 -0
- package/dist/q2-tecton-elements/p-8e380edf.entry.js +1 -0
- package/dist/q2-tecton-elements/p-926a3e80.js +2 -0
- package/dist/q2-tecton-elements/{p-93c00587.js → p-92e1faf8.js} +1 -1
- package/dist/q2-tecton-elements/p-9772b15f.entry.js +1 -0
- package/dist/q2-tecton-elements/p-97aa8423.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-17cffd7d.entry.js → p-a987402e.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-aaf42539.entry.js +1 -0
- package/dist/q2-tecton-elements/p-ac674c20.entry.js +1 -0
- package/dist/q2-tecton-elements/p-b8b00394.entry.js +1 -0
- package/dist/q2-tecton-elements/p-c444a60b.entry.js +1 -0
- package/dist/q2-tecton-elements/p-c6c489fe.entry.js +1 -0
- package/dist/q2-tecton-elements/p-ce015552.entry.js +1 -0
- package/dist/q2-tecton-elements/p-d464fccc.entry.js +1 -0
- package/dist/q2-tecton-elements/p-de164483.entry.js +1 -0
- package/dist/q2-tecton-elements/p-df91e954.entry.js +1 -0
- package/dist/q2-tecton-elements/p-e6d26f39.entry.js +1 -0
- package/dist/q2-tecton-elements/p-e8e113c2.entry.js +1 -0
- package/dist/q2-tecton-elements/p-f1d06917.entry.js +1 -0
- package/dist/q2-tecton-elements/p-f800fd1e.entry.js +1 -0
- package/dist/q2-tecton-elements/p-fb37e67e.entry.js +1 -0
- package/dist/q2-tecton-elements/p-fc134a5d.entry.js +1 -0
- package/dist/q2-tecton-elements/p-fe88e979.entry.js +1 -0
- package/dist/q2-tecton-elements/p-ffb48ccc.entry.js +1 -0
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/test/helpers.js +6 -0
- package/dist/types/components/q2-pill/index.d.ts +3 -0
- package/dist/types/components/q2-tag/index.d.ts +3 -0
- package/dist/types/components.d.ts +154 -38
- package/dist/types/stencil-public-runtime.d.ts +20 -4
- package/dist/types/workspace/workspace/Tecton_tecton-production_master/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +2 -0
- package/package.json +6 -6
- package/dist/q2-tecton-elements/p-02c1b7fd.entry.js +0 -1
- package/dist/q2-tecton-elements/p-04c743f2.entry.js +0 -1
- package/dist/q2-tecton-elements/p-07dc509c.entry.js +0 -1
- package/dist/q2-tecton-elements/p-12caa479.entry.js +0 -1
- package/dist/q2-tecton-elements/p-160dd1c2.entry.js +0 -1
- package/dist/q2-tecton-elements/p-1a3de749.entry.js +0 -1
- package/dist/q2-tecton-elements/p-2061c3fd.entry.js +0 -1
- package/dist/q2-tecton-elements/p-2a217895.entry.js +0 -1
- package/dist/q2-tecton-elements/p-2b94ae62.entry.js +0 -1
- package/dist/q2-tecton-elements/p-2e54f9a0.entry.js +0 -1
- package/dist/q2-tecton-elements/p-375569ff.entry.js +0 -1
- package/dist/q2-tecton-elements/p-3766cc6c.entry.js +0 -1
- package/dist/q2-tecton-elements/p-3eda2714.entry.js +0 -1
- package/dist/q2-tecton-elements/p-421af42d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-4c53713d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-4fd405f5.entry.js +0 -1
- package/dist/q2-tecton-elements/p-509c8924.entry.js +0 -1
- package/dist/q2-tecton-elements/p-55dc3dc1.entry.js +0 -1
- package/dist/q2-tecton-elements/p-5fffb28a.entry.js +0 -1
- package/dist/q2-tecton-elements/p-612e9974.entry.js +0 -1
- package/dist/q2-tecton-elements/p-64ca8c59.entry.js +0 -1
- package/dist/q2-tecton-elements/p-796c2bb5.entry.js +0 -1
- package/dist/q2-tecton-elements/p-86887866.entry.js +0 -1
- package/dist/q2-tecton-elements/p-9204c34d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-9725d55f.entry.js +0 -1
- package/dist/q2-tecton-elements/p-a0fa416d.entry.js +0 -39
- package/dist/q2-tecton-elements/p-bd83e8e2.entry.js +0 -1
- package/dist/q2-tecton-elements/p-be0f2539.entry.js +0 -1
- package/dist/q2-tecton-elements/p-c05b0b55.entry.js +0 -1
- package/dist/q2-tecton-elements/p-c5691700.js +0 -1
- package/dist/q2-tecton-elements/p-d826d7ad.entry.js +0 -1
- package/dist/q2-tecton-elements/p-d9e9340c.entry.js +0 -1
- package/dist/q2-tecton-elements/p-e5757895.entry.js +0 -1
- package/dist/q2-tecton-elements/p-e68c9ef0.entry.js +0 -1
- package/dist/q2-tecton-elements/p-eb33bda4.entry.js +0 -1
- package/dist/q2-tecton-elements/p-f319549d.entry.js +0 -1
|
@@ -1,48 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment, Host, h, } from '@stencil/core';
|
|
2
2
|
import Swiper, { Autoplay } from 'swiper';
|
|
3
3
|
import { createGuid, loc, handleAriaLabel, overrideFocus, isEventFromElement } from 'src/utils';
|
|
4
4
|
const carouselBreakpoint = 500; /* width in px of this host element where the layout starts to get unruly */
|
|
5
5
|
export class Q2Carousel {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.swiper = null;
|
|
8
|
-
this.autoPlay = false;
|
|
9
|
-
this.fullWidthPanes = false;
|
|
10
|
-
this.hidePagination = false;
|
|
11
|
-
this.showNavigationArrows = false;
|
|
12
|
-
this.label = 'tecton.element.carousel.ariaLabel';
|
|
13
|
-
this.index = 1;
|
|
14
|
-
this.universalCarouselOptions = {
|
|
15
|
-
centeredSlides: true,
|
|
16
|
-
focusableElements: 'q2-btn, a, input, select, textarea, button, video, label, option',
|
|
17
|
-
autoplay: this.autoPlay,
|
|
18
|
-
modules: [Autoplay],
|
|
19
|
-
on: {
|
|
20
|
-
slideChange: () => {
|
|
21
|
-
var _a, _b;
|
|
22
|
-
this.handleSlideChange((_b = (_a = this.swiper) === null || _a === void 0 ? void 0 : _a.activeIndex) !== null && _b !== void 0 ? _b : 0); // lazy-load causing this.swiper is null only on ios safari
|
|
23
|
-
},
|
|
24
|
-
activeIndexChange: swiper => {
|
|
25
|
-
this.activePaneIndex = swiper.activeIndex;
|
|
26
|
-
this.organizePanes();
|
|
27
|
-
const isPaginationFocused = document.activeElement.closest(`#q2-carousel-${this.guid} .q2-carousel-page-indicator`);
|
|
28
|
-
const isCarouselFocused = document.activeElement.closest(`#q2-carousel-${this.guid} q2-carousel-pane`);
|
|
29
|
-
if (isPaginationFocused) {
|
|
30
|
-
this.paginationBtns[swiper.activeIndex].focus({ preventScroll: true });
|
|
31
|
-
}
|
|
32
|
-
else if (isCarouselFocused)
|
|
33
|
-
swiper.slides[swiper.activeIndex].focus({
|
|
34
|
-
preventScroll: true,
|
|
35
|
-
});
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
this.fullWidthDisplayOptions = Object.assign({ slidesPerView: 1, spaceBetween: 100 }, this.universalCarouselOptions);
|
|
40
|
-
this.activePaneIndex = this.realIndex;
|
|
41
|
-
this.applyFocus = false;
|
|
42
|
-
this.applyPaginationFocus = false;
|
|
43
|
-
this.autoPlayInProgress = false;
|
|
44
|
-
this.compactMode = false;
|
|
45
|
-
this.carouselWrapperWidth = 0;
|
|
46
8
|
// COMPUTED //
|
|
47
9
|
this.guid = createGuid();
|
|
48
10
|
// METHODS //
|
|
@@ -169,20 +131,15 @@ export class Q2Carousel {
|
|
|
169
131
|
this.autoPlayBtn = () => {
|
|
170
132
|
return (h("q2-btn", { type: "button", "hide-label": true, label: loc(this.autoPlayInProgress
|
|
171
133
|
? 'tecton.element.carousel.pausePlayLabel'
|
|
172
|
-
: 'tecton.element.carousel.resumePlayLabel'), class: "q2-carousel-autoplay-control", onClick: this.handleAutoPlayPause },
|
|
173
|
-
h("q2-icon", { type: this.autoPlayInProgress ? 'pause' : 'play' })));
|
|
134
|
+
: 'tecton.element.carousel.resumePlayLabel'), class: "q2-carousel-autoplay-control", onClick: this.handleAutoPlayPause }, h("q2-icon", { type: this.autoPlayInProgress ? 'pause' : 'play' })));
|
|
174
135
|
};
|
|
175
136
|
this.prevNavBtn = () => {
|
|
176
137
|
const prevPaneAvailable = this.activePaneIndex > 0;
|
|
177
|
-
return (h("div", null,
|
|
178
|
-
h("q2-btn", { type: "button", disabled: prevPaneAvailable ? undefined : true, class: "q2-carousel-navigation-button q2-carousel-navigation-button-prev", "hide-label": true, label: loc('tecton.element.carousel.previousItemLabel'), onClick: () => this.handleCarouselNavigationSelection(this.activePaneIndex - 1, true) },
|
|
179
|
-
h("q2-icon", { type: "chevron-left" }))));
|
|
138
|
+
return (h("div", null, h("q2-btn", { type: "button", disabled: prevPaneAvailable ? undefined : true, class: "q2-carousel-navigation-button q2-carousel-navigation-button-prev", "hide-label": true, label: loc('tecton.element.carousel.previousItemLabel'), onClick: () => this.handleCarouselNavigationSelection(this.activePaneIndex - 1, true) }, h("q2-icon", { type: "chevron-left" }))));
|
|
180
139
|
};
|
|
181
140
|
this.nextNavBtn = () => {
|
|
182
141
|
const nextPaneAvailable = this.activePaneIndex < this.paneCount - 1;
|
|
183
|
-
return (h("div", null,
|
|
184
|
-
h("q2-btn", { type: "button", disabled: nextPaneAvailable ? undefined : true, class: "q2-carousel-navigation-button q2-carousel-navigation-button-next", "hide-label": true, label: loc('tecton.element.carousel.nextItemLabel'), onClick: () => this.handleCarouselNavigationSelection(this.activePaneIndex + 1, true) },
|
|
185
|
-
h("q2-icon", { type: "chevron-right" }))));
|
|
142
|
+
return (h("div", null, h("q2-btn", { type: "button", disabled: nextPaneAvailable ? undefined : true, class: "q2-carousel-navigation-button q2-carousel-navigation-button-next", "hide-label": true, label: loc('tecton.element.carousel.nextItemLabel'), onClick: () => this.handleCarouselNavigationSelection(this.activePaneIndex + 1, true) }, h("q2-icon", { type: "chevron-right" }))));
|
|
186
143
|
};
|
|
187
144
|
this.insufficientPanesDisplay = () => {
|
|
188
145
|
let insufficientPanesContainerClasses = [
|
|
@@ -191,13 +148,47 @@ export class Q2Carousel {
|
|
|
191
148
|
];
|
|
192
149
|
if (this.compactMode)
|
|
193
150
|
insufficientPanesContainerClasses = [...insufficientPanesContainerClasses, 'compact'];
|
|
194
|
-
return (h("div", { class: insufficientPanesContainerClasses.join(' ') },
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
151
|
+
return (h("div", { class: insufficientPanesContainerClasses.join(' ') }, h("div", { class: "insufficient-panes-icon-wrapper" }, h("q2-icon", { type: "warning" })), h("p", { class: "insufficient-panes-header" }, h("strong", null, loc('tecton.element.carousel.insufficientPanesMessageHeader'))), h("p", { class: "insufficient-panes-body" }, loc('tecton.element.carousel.insufficientPanesMessageBody'))));
|
|
152
|
+
};
|
|
153
|
+
this.autoPlay = false;
|
|
154
|
+
this.fullWidthPanes = false;
|
|
155
|
+
this.hidePagination = false;
|
|
156
|
+
this.showNavigationArrows = false;
|
|
157
|
+
this.ariaLabel = undefined;
|
|
158
|
+
this.label = 'tecton.element.carousel.ariaLabel';
|
|
159
|
+
this.index = 1;
|
|
160
|
+
this.universalCarouselOptions = {
|
|
161
|
+
centeredSlides: true,
|
|
162
|
+
focusableElements: 'q2-btn, a, input, select, textarea, button, video, label, option',
|
|
163
|
+
autoplay: this.autoPlay,
|
|
164
|
+
modules: [Autoplay],
|
|
165
|
+
on: {
|
|
166
|
+
slideChange: () => {
|
|
167
|
+
var _a, _b;
|
|
168
|
+
this.handleSlideChange((_b = (_a = this.swiper) === null || _a === void 0 ? void 0 : _a.activeIndex) !== null && _b !== void 0 ? _b : 0); // lazy-load causing this.swiper is null only on ios safari
|
|
169
|
+
},
|
|
170
|
+
activeIndexChange: swiper => {
|
|
171
|
+
this.activePaneIndex = swiper.activeIndex;
|
|
172
|
+
this.organizePanes();
|
|
173
|
+
const isPaginationFocused = document.activeElement.closest(`#q2-carousel-${this.guid} .q2-carousel-page-indicator`);
|
|
174
|
+
const isCarouselFocused = document.activeElement.closest(`#q2-carousel-${this.guid} q2-carousel-pane`);
|
|
175
|
+
if (isPaginationFocused) {
|
|
176
|
+
this.paginationBtns[swiper.activeIndex].focus({ preventScroll: true });
|
|
177
|
+
}
|
|
178
|
+
else if (isCarouselFocused)
|
|
179
|
+
swiper.slides[swiper.activeIndex].focus({
|
|
180
|
+
preventScroll: true,
|
|
181
|
+
});
|
|
182
|
+
},
|
|
183
|
+
},
|
|
200
184
|
};
|
|
185
|
+
this.fullWidthDisplayOptions = Object.assign({ slidesPerView: 1, spaceBetween: 100 }, this.universalCarouselOptions);
|
|
186
|
+
this.activePaneIndex = this.realIndex;
|
|
187
|
+
this.applyFocus = false;
|
|
188
|
+
this.applyPaginationFocus = false;
|
|
189
|
+
this.autoPlayInProgress = false;
|
|
190
|
+
this.compactMode = false;
|
|
191
|
+
this.carouselWrapperWidth = 0;
|
|
201
192
|
}
|
|
202
193
|
ariaLabelObserver() {
|
|
203
194
|
handleAriaLabel(this);
|
|
@@ -287,214 +278,219 @@ export class Q2Carousel {
|
|
|
287
278
|
let paginationWrapperClasses = ['q2-carousel-pagination-navigation-wrapper'];
|
|
288
279
|
if (this.showNavigationArrows)
|
|
289
280
|
paginationWrapperClasses = [...paginationWrapperClasses, 'evenly-space'];
|
|
290
|
-
return (h(Host, { id: `q2-carousel-${this.guid}`, class: "q2-carousel-instance" }, this.insufficientPanes ? (this.insufficientPanesDisplay()) : (h(Fragment, null,
|
|
291
|
-
this.paneCount > 1 && (h("div", { class: paginationWrapperClasses.join(' ') },
|
|
292
|
-
this.showNavigationArrows && this.prevNavBtn(),
|
|
293
|
-
h("div", { class: "q2-carousel-control-center-tray" },
|
|
294
|
-
!this.hidePagination && this.paginationArea(),
|
|
295
|
-
this.autoPlay && this.autoPlayBtn()),
|
|
296
|
-
this.showNavigationArrows && this.nextNavBtn())),
|
|
297
|
-
h("section", { class: carouselContainerClasses.join(' '), ref: el => (this.carouselWrapper = el), "aria-roledescription": "carousel", "aria-label": loc(this.label) },
|
|
298
|
-
h("div", { class: "q2-carousel-swiper-wrapper swiper-wrapper", ref: el => (this.carouselPaneWrapperElement = el), "aria-live": this.autoPlayInProgress ? 'off' : 'polite', onKeyDown: this.onWrapperKeyDown },
|
|
299
|
-
h("slot", null)))))));
|
|
281
|
+
return (h(Host, { id: `q2-carousel-${this.guid}`, class: "q2-carousel-instance" }, this.insufficientPanes ? (this.insufficientPanesDisplay()) : (h(Fragment, null, this.paneCount > 1 && (h("div", { class: paginationWrapperClasses.join(' ') }, this.showNavigationArrows && this.prevNavBtn(), h("div", { class: "q2-carousel-control-center-tray" }, !this.hidePagination && this.paginationArea(), this.autoPlay && this.autoPlayBtn()), this.showNavigationArrows && this.nextNavBtn())), h("section", { class: carouselContainerClasses.join(' '), ref: el => (this.carouselWrapper = el), "aria-roledescription": "carousel", "aria-label": loc(this.label) }, h("div", { class: "q2-carousel-swiper-wrapper swiper-wrapper", ref: el => (this.carouselPaneWrapperElement = el), "aria-live": this.autoPlayInProgress ? 'off' : 'polite', onKeyDown: this.onWrapperKeyDown }, h("slot", null)))))));
|
|
300
282
|
}
|
|
301
283
|
static get is() { return "q2-carousel"; }
|
|
302
|
-
static get originalStyleUrls() {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
"
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
"original": "boolean",
|
|
332
|
-
"resolved": "boolean",
|
|
333
|
-
"references": {}
|
|
334
|
-
},
|
|
335
|
-
"required": false,
|
|
336
|
-
"optional": false,
|
|
337
|
-
"docs": {
|
|
338
|
-
"tags": [],
|
|
339
|
-
"text": ""
|
|
340
|
-
},
|
|
341
|
-
"attribute": "full-width-panes",
|
|
342
|
-
"reflect": true,
|
|
343
|
-
"defaultValue": "false"
|
|
344
|
-
},
|
|
345
|
-
"hidePagination": {
|
|
346
|
-
"type": "boolean",
|
|
347
|
-
"mutable": false,
|
|
348
|
-
"complexType": {
|
|
349
|
-
"original": "boolean",
|
|
350
|
-
"resolved": "boolean",
|
|
351
|
-
"references": {}
|
|
352
|
-
},
|
|
353
|
-
"required": false,
|
|
354
|
-
"optional": false,
|
|
355
|
-
"docs": {
|
|
356
|
-
"tags": [],
|
|
357
|
-
"text": ""
|
|
358
|
-
},
|
|
359
|
-
"attribute": "hide-pagination",
|
|
360
|
-
"reflect": true,
|
|
361
|
-
"defaultValue": "false"
|
|
362
|
-
},
|
|
363
|
-
"showNavigationArrows": {
|
|
364
|
-
"type": "boolean",
|
|
365
|
-
"mutable": false,
|
|
366
|
-
"complexType": {
|
|
367
|
-
"original": "boolean",
|
|
368
|
-
"resolved": "boolean",
|
|
369
|
-
"references": {}
|
|
370
|
-
},
|
|
371
|
-
"required": false,
|
|
372
|
-
"optional": false,
|
|
373
|
-
"docs": {
|
|
374
|
-
"tags": [],
|
|
375
|
-
"text": ""
|
|
376
|
-
},
|
|
377
|
-
"attribute": "show-navigation-arrows",
|
|
378
|
-
"reflect": true,
|
|
379
|
-
"defaultValue": "false"
|
|
380
|
-
},
|
|
381
|
-
"ariaLabel": {
|
|
382
|
-
"type": "string",
|
|
383
|
-
"mutable": false,
|
|
384
|
-
"complexType": {
|
|
385
|
-
"original": "string",
|
|
386
|
-
"resolved": "string",
|
|
387
|
-
"references": {}
|
|
388
|
-
},
|
|
389
|
-
"required": false,
|
|
390
|
-
"optional": false,
|
|
391
|
-
"docs": {
|
|
392
|
-
"tags": [],
|
|
393
|
-
"text": ""
|
|
284
|
+
static get originalStyleUrls() {
|
|
285
|
+
return {
|
|
286
|
+
"$": ["styles.scss"]
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
static get styleUrls() {
|
|
290
|
+
return {
|
|
291
|
+
"$": ["styles.css"]
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
static get properties() {
|
|
295
|
+
return {
|
|
296
|
+
"autoPlay": {
|
|
297
|
+
"type": "boolean",
|
|
298
|
+
"mutable": false,
|
|
299
|
+
"complexType": {
|
|
300
|
+
"original": "boolean",
|
|
301
|
+
"resolved": "boolean",
|
|
302
|
+
"references": {}
|
|
303
|
+
},
|
|
304
|
+
"required": false,
|
|
305
|
+
"optional": false,
|
|
306
|
+
"docs": {
|
|
307
|
+
"tags": [],
|
|
308
|
+
"text": ""
|
|
309
|
+
},
|
|
310
|
+
"attribute": "auto-play",
|
|
311
|
+
"reflect": true,
|
|
312
|
+
"defaultValue": "false"
|
|
394
313
|
},
|
|
395
|
-
"
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
"
|
|
404
|
-
"
|
|
314
|
+
"fullWidthPanes": {
|
|
315
|
+
"type": "boolean",
|
|
316
|
+
"mutable": false,
|
|
317
|
+
"complexType": {
|
|
318
|
+
"original": "boolean",
|
|
319
|
+
"resolved": "boolean",
|
|
320
|
+
"references": {}
|
|
321
|
+
},
|
|
322
|
+
"required": false,
|
|
323
|
+
"optional": false,
|
|
324
|
+
"docs": {
|
|
325
|
+
"tags": [],
|
|
326
|
+
"text": ""
|
|
327
|
+
},
|
|
328
|
+
"attribute": "full-width-panes",
|
|
329
|
+
"reflect": true,
|
|
330
|
+
"defaultValue": "false"
|
|
405
331
|
},
|
|
406
|
-
"
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
"
|
|
410
|
-
|
|
332
|
+
"hidePagination": {
|
|
333
|
+
"type": "boolean",
|
|
334
|
+
"mutable": false,
|
|
335
|
+
"complexType": {
|
|
336
|
+
"original": "boolean",
|
|
337
|
+
"resolved": "boolean",
|
|
338
|
+
"references": {}
|
|
339
|
+
},
|
|
340
|
+
"required": false,
|
|
341
|
+
"optional": false,
|
|
342
|
+
"docs": {
|
|
343
|
+
"tags": [],
|
|
344
|
+
"text": ""
|
|
345
|
+
},
|
|
346
|
+
"attribute": "hide-pagination",
|
|
347
|
+
"reflect": true,
|
|
348
|
+
"defaultValue": "false"
|
|
411
349
|
},
|
|
412
|
-
"
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
"
|
|
421
|
-
"
|
|
422
|
-
"
|
|
350
|
+
"showNavigationArrows": {
|
|
351
|
+
"type": "boolean",
|
|
352
|
+
"mutable": false,
|
|
353
|
+
"complexType": {
|
|
354
|
+
"original": "boolean",
|
|
355
|
+
"resolved": "boolean",
|
|
356
|
+
"references": {}
|
|
357
|
+
},
|
|
358
|
+
"required": false,
|
|
359
|
+
"optional": false,
|
|
360
|
+
"docs": {
|
|
361
|
+
"tags": [],
|
|
362
|
+
"text": ""
|
|
363
|
+
},
|
|
364
|
+
"attribute": "show-navigation-arrows",
|
|
365
|
+
"reflect": true,
|
|
366
|
+
"defaultValue": "false"
|
|
423
367
|
},
|
|
424
|
-
"
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
"
|
|
428
|
-
|
|
368
|
+
"ariaLabel": {
|
|
369
|
+
"type": "string",
|
|
370
|
+
"mutable": false,
|
|
371
|
+
"complexType": {
|
|
372
|
+
"original": "string",
|
|
373
|
+
"resolved": "string",
|
|
374
|
+
"references": {}
|
|
375
|
+
},
|
|
376
|
+
"required": false,
|
|
377
|
+
"optional": false,
|
|
378
|
+
"docs": {
|
|
379
|
+
"tags": [],
|
|
380
|
+
"text": ""
|
|
381
|
+
},
|
|
382
|
+
"attribute": "aria-label",
|
|
383
|
+
"reflect": true
|
|
429
384
|
},
|
|
430
|
-
"
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
"name": "change",
|
|
448
|
-
"bubbles": true,
|
|
449
|
-
"cancelable": true,
|
|
450
|
-
"composed": true,
|
|
451
|
-
"docs": {
|
|
452
|
-
"tags": [],
|
|
453
|
-
"text": ""
|
|
385
|
+
"label": {
|
|
386
|
+
"type": "string",
|
|
387
|
+
"mutable": false,
|
|
388
|
+
"complexType": {
|
|
389
|
+
"original": "string",
|
|
390
|
+
"resolved": "string",
|
|
391
|
+
"references": {}
|
|
392
|
+
},
|
|
393
|
+
"required": false,
|
|
394
|
+
"optional": false,
|
|
395
|
+
"docs": {
|
|
396
|
+
"tags": [],
|
|
397
|
+
"text": ""
|
|
398
|
+
},
|
|
399
|
+
"attribute": "label",
|
|
400
|
+
"reflect": true,
|
|
401
|
+
"defaultValue": "'tecton.element.carousel.ariaLabel'"
|
|
454
402
|
},
|
|
455
|
-
"
|
|
456
|
-
"
|
|
457
|
-
"
|
|
458
|
-
"
|
|
403
|
+
"index": {
|
|
404
|
+
"type": "number",
|
|
405
|
+
"mutable": true,
|
|
406
|
+
"complexType": {
|
|
407
|
+
"original": "number",
|
|
408
|
+
"resolved": "number",
|
|
409
|
+
"references": {}
|
|
410
|
+
},
|
|
411
|
+
"required": false,
|
|
412
|
+
"optional": false,
|
|
413
|
+
"docs": {
|
|
414
|
+
"tags": [],
|
|
415
|
+
"text": ""
|
|
416
|
+
},
|
|
417
|
+
"attribute": "index",
|
|
418
|
+
"reflect": true,
|
|
419
|
+
"defaultValue": "1"
|
|
459
420
|
}
|
|
460
|
-
}
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
static get states() {
|
|
424
|
+
return {
|
|
425
|
+
"universalCarouselOptions": {},
|
|
426
|
+
"fullWidthDisplayOptions": {},
|
|
427
|
+
"activePaneIndex": {},
|
|
428
|
+
"applyFocus": {},
|
|
429
|
+
"applyPaginationFocus": {},
|
|
430
|
+
"autoPlayInProgress": {},
|
|
431
|
+
"compactMode": {},
|
|
432
|
+
"carouselWrapperWidth": {}
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
static get events() {
|
|
436
|
+
return [{
|
|
437
|
+
"method": "change",
|
|
438
|
+
"name": "change",
|
|
439
|
+
"bubbles": true,
|
|
440
|
+
"cancelable": true,
|
|
441
|
+
"composed": true,
|
|
442
|
+
"docs": {
|
|
443
|
+
"tags": [],
|
|
444
|
+
"text": ""
|
|
445
|
+
},
|
|
446
|
+
"complexType": {
|
|
447
|
+
"original": "{ index: number }",
|
|
448
|
+
"resolved": "{ index: number; }",
|
|
449
|
+
"references": {}
|
|
450
|
+
}
|
|
451
|
+
}];
|
|
452
|
+
}
|
|
461
453
|
static get elementRef() { return "hostElement"; }
|
|
462
|
-
static get watchers() {
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
454
|
+
static get watchers() {
|
|
455
|
+
return [{
|
|
456
|
+
"propName": "ariaLabel",
|
|
457
|
+
"methodName": "ariaLabelObserver"
|
|
458
|
+
}, {
|
|
459
|
+
"propName": "carouselWrapperWidth",
|
|
460
|
+
"methodName": "carouselWrapperWidthChanged"
|
|
461
|
+
}, {
|
|
462
|
+
"propName": "index",
|
|
463
|
+
"methodName": "indexChanged"
|
|
464
|
+
}, {
|
|
465
|
+
"propName": "fullWidthPanes",
|
|
466
|
+
"methodName": "revampCarousel"
|
|
467
|
+
}, {
|
|
468
|
+
"propName": "compactMode",
|
|
469
|
+
"methodName": "revampCarousel"
|
|
470
|
+
}, {
|
|
471
|
+
"propName": "autoPlay",
|
|
472
|
+
"methodName": "revampCarousel"
|
|
473
|
+
}];
|
|
474
|
+
}
|
|
475
|
+
static get listeners() {
|
|
476
|
+
return [{
|
|
477
|
+
"name": "change",
|
|
478
|
+
"method": "onHostElementChange",
|
|
479
|
+
"target": undefined,
|
|
480
|
+
"capture": false,
|
|
481
|
+
"passive": false
|
|
482
|
+
}, {
|
|
483
|
+
"name": "clickCarouselPane",
|
|
484
|
+
"method": "carouselPaneClicked",
|
|
485
|
+
"target": undefined,
|
|
486
|
+
"capture": false,
|
|
487
|
+
"passive": false
|
|
488
|
+
}, {
|
|
489
|
+
"name": "focus",
|
|
490
|
+
"method": "delegateFocus",
|
|
491
|
+
"target": undefined,
|
|
492
|
+
"capture": false,
|
|
493
|
+
"passive": false
|
|
494
|
+
}];
|
|
495
|
+
}
|
|
500
496
|
}
|