@webquark/browser 1.1.0-dev.11 → 1.1.0-dev.13
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/{action.props-DmLaQuU2.js → action.props-B6vl_1p5.js} +1 -1
- package/dist/cjs/{dom-Dk77oFF6.js → dom-BYrqRYna.js} +1 -1
- package/dist/cjs/{field-CEZ9NsWK.js → field-B5nxD8Kc.js} +1 -1
- package/dist/cjs/{index-CMAcJ6t1.js → index-BD6Jjssb.js} +4 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/q-accordion.cjs.entry.js +2 -2
- package/dist/cjs/q-alert.cjs.entry.js +1 -1
- package/dist/cjs/q-avatar.cjs.entry.js +2 -2
- package/dist/cjs/q-banner.cjs.entry.js +1 -1
- package/dist/cjs/q-button_2.cjs.entry.js +5 -5
- package/dist/cjs/q-card.cjs.entry.js +2 -2
- package/dist/cjs/q-carousel.cjs.entry.js +120 -18
- package/dist/cjs/q-chip.cjs.entry.js +2 -2
- package/dist/cjs/q-control-group.cjs.entry.js +64 -0
- package/dist/cjs/q-conversation-bubble.cjs.entry.js +1 -1
- package/dist/cjs/q-data-table.cjs.entry.js +4 -4
- package/dist/cjs/q-dialog.cjs.entry.js +4 -4
- package/dist/cjs/q-divider.cjs.entry.js +2 -2
- package/dist/cjs/q-dropdown.cjs.entry.js +218 -21
- package/dist/cjs/q-form.cjs.entry.js +15 -5
- package/dist/cjs/q-grid.cjs.entry.js +2 -2
- package/dist/cjs/q-icon.cjs.entry.js +1 -1
- package/dist/cjs/q-image-comparison.cjs.entry.js +2 -2
- package/dist/cjs/q-inline.cjs.entry.js +2 -2
- package/dist/cjs/q-input_2.cjs.entry.js +7 -7
- package/dist/cjs/q-link.cjs.entry.js +2 -2
- package/dist/cjs/q-map.cjs.entry.js +2 -2
- package/dist/cjs/q-media.cjs.entry.js +2 -2
- package/dist/cjs/q-navbar.cjs.entry.js +3 -3
- package/dist/cjs/q-pagination.cjs.entry.js +2 -2
- package/dist/cjs/q-panel.cjs.entry.js +6 -6
- package/dist/cjs/q-quantity-selector.cjs.entry.js +6 -6
- package/dist/cjs/q-radio-group.cjs.entry.js +4 -4
- package/dist/cjs/q-reel.cjs.entry.js +4 -4
- package/dist/cjs/q-scrollable.cjs.entry.js +4 -4
- package/dist/cjs/q-section.cjs.entry.js +2 -2
- package/dist/cjs/q-sidepanel.cjs.entry.js +2 -2
- package/dist/cjs/q-slider.cjs.entry.js +122 -0
- package/dist/cjs/q-stack.cjs.entry.js +2 -2
- package/dist/cjs/q-step-diagram-item.cjs.entry.js +2 -2
- package/dist/cjs/q-step-diagram.cjs.entry.js +4 -4
- package/dist/cjs/q-syntax-box.cjs.entry.js +1 -1
- package/dist/cjs/q-tabs.cjs.entry.js +2 -2
- package/dist/cjs/q-textarea.cjs.entry.js +4 -4
- package/dist/cjs/q-thumbnail.cjs.entry.js +3 -3
- package/dist/cjs/q-toast.cjs.entry.js +1 -1
- package/dist/cjs/q-toggle.cjs.entry.js +6 -6
- package/dist/cjs/q-toolbar.cjs.entry.js +3 -3
- package/dist/cjs/webquark.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/actions/button/button.css +22 -0
- package/dist/collection/components/content/carousel/carousel.css +7 -0
- package/dist/collection/components/content/carousel/carousel.js +256 -10
- package/dist/collection/components/content/carousel/internals/autoplay.js +31 -6
- package/dist/collection/components/content/carousel/test/transitions.cmp.test.js +122 -0
- package/dist/collection/components/data-display/accordion/accordion.js +1 -1
- package/dist/collection/components/data-display/data-table/data-table.js +3 -3
- package/dist/collection/components/data-display/map/map.js +1 -1
- package/dist/collection/components/data-display/map/test/map.cmp.test.js +1 -1
- package/dist/collection/components/data-display/pagination/pagination.js +1 -1
- package/dist/collection/components/indicators/step-diagram/step-diagram.js +2 -2
- package/dist/collection/components/indicators/step-diagram-item/step-diagram-item.js +1 -1
- package/dist/collection/components/inputs/dropdown/dropdown.css +115 -0
- package/dist/collection/components/inputs/dropdown/dropdown.js +274 -23
- package/dist/collection/components/inputs/dropdown/test/fit-options.cmp.test.js +120 -0
- package/dist/collection/components/inputs/dropdown/test/multiple.cmp.test.js +124 -0
- package/dist/collection/components/inputs/form/form.js +2 -2
- package/dist/collection/components/inputs/form/internals/controls.js +1 -1
- package/dist/collection/components/inputs/form/internals/field-state.js +6 -1
- package/dist/collection/components/inputs/form/internals/values.js +5 -0
- package/dist/collection/components/inputs/input/input.css +22 -0
- package/dist/collection/components/inputs/input/input.js +3 -3
- package/dist/collection/components/inputs/quantity-selector/quantity-selector.css +22 -0
- package/dist/collection/components/inputs/quantity-selector/quantity-selector.js +4 -4
- package/dist/collection/components/inputs/radio-group/radio-group.js +2 -2
- package/dist/collection/components/inputs/slider/slider.css +44 -0
- package/dist/collection/components/inputs/slider/slider.js +383 -0
- package/dist/collection/components/inputs/slider/test/slider.cmp.test.js +45 -0
- package/dist/collection/components/inputs/textarea/textarea.js +2 -2
- package/dist/collection/components/inputs/toggle/toggle.css +22 -0
- package/dist/collection/components/inputs/toggle/toggle.js +3 -3
- package/dist/collection/components/layout/control-group/control-group.css +108 -0
- package/dist/collection/components/layout/control-group/control-group.js +142 -0
- package/dist/collection/components/layout/control-group/test/control-group.cmp.test.js +163 -0
- package/dist/collection/components/layout/divider/divider.js +1 -1
- package/dist/collection/components/layout/grid/grid.js +1 -1
- package/dist/collection/components/layout/inline/inline.js +1 -1
- package/dist/collection/components/layout/navbar/navbar.js +2 -2
- package/dist/collection/components/layout/panel/panel.js +4 -4
- package/dist/collection/components/layout/scrollable/scrollable.js +3 -3
- package/dist/collection/components/layout/section/section.js +1 -1
- package/dist/collection/components/layout/stack/stack.js +1 -1
- package/dist/collection/components/layout/tabs/tabs.js +1 -1
- package/dist/collection/components/layout/toolbar/toolbar.js +2 -2
- package/dist/collection/components/media/avatar/avatar.js +1 -1
- package/dist/collection/components/media/image-comparison/image-comparison.js +1 -1
- package/dist/collection/components/media/media/media.js +1 -1
- package/dist/collection/components/media/reel/reel.js +2 -2
- package/dist/collection/components/media/thumbnail/thumbnail.js +2 -2
- package/dist/collection/components/overlays/dialog/dialog.js +2 -2
- package/dist/collection/components/overlays/tooltip/tooltip.js +2 -2
- package/dist/collection/utils/dom.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-iXEnb5d5.js → p-BGHNFaaC.js} +1 -1
- package/dist/components/{p--r63tfQH.js → p-BZXIeEKC.js} +1 -1
- package/dist/components/{p-DbI_F3z0.js → p-Bc2_QcLn.js} +1 -1
- package/dist/components/{p-DBbiaYqQ.js → p-Bp6Xr92S.js} +1 -1
- package/dist/components/{p-CSucjZb7.js → p-BwPMm43W.js} +1 -1
- package/dist/components/p-CArIPzJU.js +1 -0
- package/dist/components/p-CpkX9YAW.js +1 -0
- package/dist/components/{p-CLErjC1f.js → p-D2nxHd1b.js} +1 -1
- package/dist/components/{p-DQhiqYeq.js → p-DkanItP3.js} +1 -1
- package/dist/components/p-IwIJb0Mc.js +1 -0
- package/dist/components/{p-0feRVg70.js → p-kfrqZyfJ.js} +1 -1
- package/dist/components/{p-CYG3Oakz.js → p-x3C-wjU9.js} +1 -1
- package/dist/components/q-accordion.js +1 -1
- package/dist/components/q-alert.js +1 -1
- package/dist/components/q-avatar.js +1 -1
- package/dist/components/q-banner.js +1 -1
- package/dist/components/q-button.js +1 -1
- package/dist/components/q-card.js +1 -1
- package/dist/components/q-carousel.js +1 -1
- package/dist/components/q-chip.js +1 -1
- package/dist/components/q-control-group.d.ts +11 -0
- package/dist/components/q-control-group.js +1 -0
- package/dist/components/q-conversation-bubble.js +1 -1
- package/dist/components/q-data-table.js +1 -1
- package/dist/components/q-dialog.js +1 -1
- package/dist/components/q-divider.js +1 -1
- package/dist/components/q-dropdown.js +1 -1
- package/dist/components/q-form.js +1 -1
- package/dist/components/q-grid.js +1 -1
- package/dist/components/q-icon.js +1 -1
- package/dist/components/q-image-comparison.js +1 -1
- package/dist/components/q-inline.js +1 -1
- package/dist/components/q-input.js +1 -1
- package/dist/components/q-link.js +1 -1
- package/dist/components/q-map.js +1 -1
- package/dist/components/q-media.js +1 -1
- package/dist/components/q-navbar.js +1 -1
- package/dist/components/q-pagination.js +1 -1
- package/dist/components/q-panel.js +1 -1
- package/dist/components/q-progress.js +1 -1
- package/dist/components/q-quantity-selector.js +1 -1
- package/dist/components/q-radio-group.js +1 -1
- package/dist/components/q-reel.js +1 -1
- package/dist/components/q-scrollable.js +1 -1
- package/dist/components/q-section.js +1 -1
- package/dist/components/q-sidepanel.js +1 -1
- package/dist/components/q-slider.d.ts +11 -0
- package/dist/components/q-slider.js +1 -0
- package/dist/components/q-stack.js +1 -1
- package/dist/components/q-step-diagram-item.js +1 -1
- package/dist/components/q-step-diagram.js +1 -1
- package/dist/components/q-syntax-box.js +2 -2
- package/dist/components/q-tabs.js +1 -1
- package/dist/components/q-textarea.js +1 -1
- package/dist/components/q-thumbnail.js +1 -1
- package/dist/components/q-toast.js +1 -1
- package/dist/components/q-toggle.js +1 -1
- package/dist/components/q-toolbar.js +1 -1
- package/dist/components/q-tooltip.js +1 -1
- package/dist/esm/{action.props-DhnvhbLl.js → action.props-Di_LpF5H.js} +1 -1
- package/dist/esm/{dom-ByfrUWx1.js → dom-CArIPzJU.js} +1 -1
- package/dist/esm/{field-u-k7C7Rf.js → field-C4Iilew6.js} +1 -1
- package/dist/esm/{index-DaJmsCb7.js → index-DoGM9gsC.js} +4 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/q-accordion.entry.js +2 -2
- package/dist/esm/q-alert.entry.js +1 -1
- package/dist/esm/q-avatar.entry.js +2 -2
- package/dist/esm/q-banner.entry.js +1 -1
- package/dist/esm/q-button_2.entry.js +5 -5
- package/dist/esm/q-card.entry.js +2 -2
- package/dist/esm/q-carousel.entry.js +120 -18
- package/dist/esm/q-chip.entry.js +2 -2
- package/dist/esm/q-control-group.entry.js +62 -0
- package/dist/esm/q-conversation-bubble.entry.js +1 -1
- package/dist/esm/q-data-table.entry.js +4 -4
- package/dist/esm/q-dialog.entry.js +4 -4
- package/dist/esm/q-divider.entry.js +2 -2
- package/dist/esm/q-dropdown.entry.js +218 -21
- package/dist/esm/q-form.entry.js +15 -5
- package/dist/esm/q-grid.entry.js +2 -2
- package/dist/esm/q-icon.entry.js +1 -1
- package/dist/esm/q-image-comparison.entry.js +2 -2
- package/dist/esm/q-inline.entry.js +2 -2
- package/dist/esm/q-input_2.entry.js +7 -7
- package/dist/esm/q-link.entry.js +2 -2
- package/dist/esm/q-map.entry.js +2 -2
- package/dist/esm/q-media.entry.js +2 -2
- package/dist/esm/q-navbar.entry.js +3 -3
- package/dist/esm/q-pagination.entry.js +2 -2
- package/dist/esm/q-panel.entry.js +6 -6
- package/dist/esm/q-quantity-selector.entry.js +6 -6
- package/dist/esm/q-radio-group.entry.js +4 -4
- package/dist/esm/q-reel.entry.js +4 -4
- package/dist/esm/q-scrollable.entry.js +4 -4
- package/dist/esm/q-section.entry.js +2 -2
- package/dist/esm/q-sidepanel.entry.js +2 -2
- package/dist/esm/q-slider.entry.js +120 -0
- package/dist/esm/q-stack.entry.js +2 -2
- package/dist/esm/q-step-diagram-item.entry.js +2 -2
- package/dist/esm/q-step-diagram.entry.js +4 -4
- package/dist/esm/q-syntax-box.entry.js +1 -1
- package/dist/esm/q-tabs.entry.js +2 -2
- package/dist/esm/q-textarea.entry.js +4 -4
- package/dist/esm/q-thumbnail.entry.js +3 -3
- package/dist/esm/q-toast.entry.js +1 -1
- package/dist/esm/q-toggle.entry.js +6 -6
- package/dist/esm/q-toolbar.entry.js +3 -3
- package/dist/esm/webquark.js +3 -3
- package/dist/types/components/content/carousel/carousel.d.ts +23 -2
- package/dist/types/components/content/carousel/carousel.types.d.ts +6 -0
- package/dist/types/components/content/carousel/internals/autoplay.d.ts +5 -0
- package/dist/types/components/inputs/dropdown/dropdown.d.ts +29 -2
- package/dist/types/components/inputs/dropdown/test/fit-options.cmp.test.d.ts +3 -0
- package/dist/types/components/inputs/dropdown/test/multiple.cmp.test.d.ts +1 -0
- package/dist/types/components/inputs/form/internals/field-state.d.ts +1 -1
- package/dist/types/components/inputs/slider/slider.d.ts +45 -0
- package/dist/types/components/inputs/slider/test/slider.cmp.test.d.ts +1 -0
- package/dist/types/components/layout/control-group/control-group.d.ts +20 -0
- package/dist/types/components/layout/control-group/test/control-group.cmp.test.d.ts +7 -0
- package/dist/types/components.d.ts +284 -9
- package/dist/types/index.d.ts +1 -1
- package/dist/types/utils/form-field-adapter.d.ts +3 -3
- package/dist/webquark/{p-b8f4994a.entry.js → p-0182e114.entry.js} +1 -1
- package/dist/webquark/{p-4d611b93.entry.js → p-048103e0.entry.js} +1 -1
- package/dist/webquark/{p-a30d212f.entry.js → p-0a2c52de.entry.js} +1 -1
- package/dist/webquark/p-0baf478a.entry.js +1 -0
- package/dist/webquark/{p-5d6fb0d1.entry.js → p-15bad9ef.entry.js} +1 -1
- package/dist/webquark/p-17b9713f.entry.js +1 -0
- package/dist/webquark/{p-32055acd.entry.js → p-222405b8.entry.js} +1 -1
- package/dist/webquark/{p-7723e966.entry.js → p-2eaa3a9f.entry.js} +1 -1
- package/dist/webquark/{p-e7384b6e.entry.js → p-3daafc56.entry.js} +1 -1
- package/dist/webquark/{p-220ec9cf.entry.js → p-44bbe12f.entry.js} +1 -1
- package/dist/webquark/{p-dee50f0a.entry.js → p-4609c362.entry.js} +1 -1
- package/dist/webquark/{p-0f04ceab.entry.js → p-5b584d3c.entry.js} +1 -1
- package/dist/webquark/p-65fe9cac.entry.js +1 -0
- package/dist/webquark/{p-1e8797d1.entry.js → p-846dc838.entry.js} +1 -1
- package/dist/webquark/{p-d2c4696f.entry.js → p-84b350a3.entry.js} +1 -1
- package/dist/webquark/p-85131314.entry.js +1 -0
- package/dist/webquark/{p-a87f0bde.entry.js → p-852e88ae.entry.js} +1 -1
- package/dist/webquark/{p-596737cc.entry.js → p-86c05afd.entry.js} +1 -1
- package/dist/webquark/p-8c5b2706.entry.js +1 -0
- package/dist/webquark/p-923527f0.entry.js +1 -0
- package/dist/webquark/{p-687be7d4.entry.js → p-9a76cd71.entry.js} +1 -1
- package/dist/webquark/p-CArIPzJU.js +1 -0
- package/dist/webquark/{p-BuctNczf.js → p-DDUED8LT.js} +1 -1
- package/dist/webquark/{p-Bk4FnOfb.js → p-Dnz3WmdX.js} +1 -1
- package/dist/webquark/{p-DaJmsCb7.js → p-DoGM9gsC.js} +1 -1
- package/dist/webquark/p-a0d97367.entry.js +1 -0
- package/dist/webquark/{p-3af50215.entry.js → p-a16bd8d5.entry.js} +2 -2
- package/dist/webquark/{p-6d2d016a.entry.js → p-a2334abe.entry.js} +1 -1
- package/dist/webquark/{p-5cccb6bc.entry.js → p-a2ff1b64.entry.js} +1 -1
- package/dist/webquark/{p-a199de7d.entry.js → p-a314bc21.entry.js} +1 -1
- package/dist/webquark/p-a3e1096d.entry.js +1 -0
- package/dist/webquark/{p-b9c8c081.entry.js → p-a66550da.entry.js} +1 -1
- package/dist/webquark/{p-b75ec829.entry.js → p-aa342e81.entry.js} +1 -1
- package/dist/webquark/{p-c662904e.entry.js → p-b1c771fb.entry.js} +1 -1
- package/dist/webquark/p-b21ad707.entry.js +1 -0
- package/dist/webquark/p-b45ca926.entry.js +1 -0
- package/dist/webquark/{p-e3c18c0e.entry.js → p-b8fdef4f.entry.js} +1 -1
- package/dist/webquark/{p-78c56cd3.entry.js → p-d4788321.entry.js} +1 -1
- package/dist/webquark/{p-191a7063.entry.js → p-d86bd51d.entry.js} +1 -1
- package/dist/webquark/{p-b82aaf4c.entry.js → p-dbcf7592.entry.js} +1 -1
- package/dist/webquark/p-e0943d41.entry.js +1 -0
- package/dist/webquark/{p-41deb44c.entry.js → p-e2721e77.entry.js} +1 -1
- package/dist/webquark/{p-ddeb2d4c.entry.js → p-e723a7ae.entry.js} +1 -1
- package/dist/webquark/p-eb800d1e.entry.js +1 -0
- package/dist/webquark/{p-fbd1cbbe.entry.js → p-f4d23ffe.entry.js} +1 -1
- package/dist/webquark/{p-cab898c2.entry.js → p-f51e1098.entry.js} +1 -1
- package/dist/webquark/{p-44eda084.entry.js → p-fe14f038.entry.js} +1 -1
- package/dist/webquark/webquark.esm.js +1 -1
- package/package.json +2 -2
- package/dist/components/p-ByfrUWx1.js +0 -1
- package/dist/components/p-cSh-5xis.js +0 -1
- package/dist/webquark/p-10dc5cce.entry.js +0 -1
- package/dist/webquark/p-2291095e.entry.js +0 -1
- package/dist/webquark/p-473a1810.entry.js +0 -1
- package/dist/webquark/p-4cf40080.entry.js +0 -1
- package/dist/webquark/p-6a5033da.entry.js +0 -1
- package/dist/webquark/p-70e3a23a.entry.js +0 -1
- package/dist/webquark/p-8a0733a1.entry.js +0 -1
- package/dist/webquark/p-ByfrUWx1.js +0 -1
- package/dist/webquark/p-bf568cda.entry.js +0 -1
- package/dist/webquark/p-f63fd66f.entry.js +0 -1
- package/dist/webquark/p-f95aeb8d.entry.js +0 -1
|
@@ -240,3 +240,25 @@
|
|
|
240
240
|
|
|
241
241
|
.btn { max-width: 100%; }
|
|
242
242
|
.btn-content-wrap, .btn-label { min-width: 0; overflow-wrap: anywhere; }
|
|
243
|
+
|
|
244
|
+
/* Shared opt-in presentation; standalone surfaces retain their existing rules. */
|
|
245
|
+
:host([data-q-control-group]) :is(.input-control, .dropdown-trigger, .quantity-selector, .btn, .toggle-wrapper) {
|
|
246
|
+
border-start-start-radius: var(--_q-group-start-start, 0px);
|
|
247
|
+
border-start-end-radius: var(--_q-group-start-end, 0px);
|
|
248
|
+
border-end-start-radius: var(--_q-group-end-start, 0px);
|
|
249
|
+
border-end-end-radius: var(--_q-group-end-end, 0px);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
:host([data-q-control-group]) .toggle-wrapper {
|
|
253
|
+
box-sizing: border-box;
|
|
254
|
+
min-height: var(--_q-control-height);
|
|
255
|
+
padding-inline: var(--_q-control-padding);
|
|
256
|
+
border: var(--q-border, 1px solid var(--q-border-color, #4b5563));
|
|
257
|
+
background: var(--q-bg-field, var(--q-bg-surface-3, #22304d));
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
:host([data-q-control-group]) :is(.btn, .toggle-wrapper, .quantity-selector) {
|
|
261
|
+
width: 100%;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
|
|
@@ -252,3 +252,10 @@
|
|
|
252
252
|
@media (hover: none), (pointer: coarse) {
|
|
253
253
|
.arrow-btn { opacity: 1; }
|
|
254
254
|
}
|
|
255
|
+
|
|
256
|
+
.rotation-btn.is-overlay {
|
|
257
|
+
position: absolute;
|
|
258
|
+
inset-block-end: var(--q-padding-md, 1rem);
|
|
259
|
+
inset-inline-end: var(--q-padding-md, 1rem);
|
|
260
|
+
z-index: 3;
|
|
261
|
+
}
|
|
@@ -22,6 +22,8 @@ export class QCarousel {
|
|
|
22
22
|
snapAlignment = 'start';
|
|
23
23
|
/** `auto` preserves each slotted item's natural width. */
|
|
24
24
|
itemWidth = 'auto';
|
|
25
|
+
/** Overlay keeps playback separate from the indicators/extra-controls panel. */
|
|
26
|
+
rotationPlacement = 'controls';
|
|
25
27
|
/** Omitted controls are enabled for navigable slideshows and disabled for strips. */
|
|
26
28
|
showArrows;
|
|
27
29
|
/** Shows clickable slide indicator dots when the carousel can scroll. */
|
|
@@ -32,12 +34,18 @@ export class QCarousel {
|
|
|
32
34
|
transition = 'slide';
|
|
33
35
|
/** Crossfade duration in milliseconds; native sliding keeps browser-controlled timing. */
|
|
34
36
|
transitionDuration = 500;
|
|
35
|
-
/** Enables rotation
|
|
37
|
+
/** Enables rotation with the configured interaction behavior. */
|
|
36
38
|
autoplay = false;
|
|
39
|
+
/** Continuous rotation ignores hover and interaction; explicit pause remains available. */
|
|
40
|
+
autoplayBehavior = 'pauseOnInteraction';
|
|
37
41
|
/** Finite positive interval in milliseconds; invalid values use 5000. */
|
|
38
42
|
autoplayInterval = 5000;
|
|
39
43
|
/** Temporarily suspends requested playback without changing the button action. */
|
|
40
44
|
autoplaySuspended = false;
|
|
45
|
+
/** Finish-videos delegates each active visit's timing to setSlidePlayback(). */
|
|
46
|
+
slideTiming = 'fixedInterval';
|
|
47
|
+
/** Holds advancement for loading without pausing the active media. */
|
|
48
|
+
autoplayAdvanceSuspended = false;
|
|
41
49
|
/** Accessible name forwarded to the slide viewport. */
|
|
42
50
|
ariaLabel = 'Carousel content';
|
|
43
51
|
hasExtraControls = false;
|
|
@@ -51,6 +59,8 @@ export class QCarousel {
|
|
|
51
59
|
qSlideChange;
|
|
52
60
|
/** Actual running state, including temporary suspension. */
|
|
53
61
|
qAutoplayChange;
|
|
62
|
+
/** Playback intent and eligibility, independent of an image-readiness advance hold. */
|
|
63
|
+
qPlaybackChange;
|
|
54
64
|
el;
|
|
55
65
|
slideState = new CarouselSlideState();
|
|
56
66
|
touchStart;
|
|
@@ -63,6 +73,10 @@ export class QCarousel {
|
|
|
63
73
|
get navigable() {
|
|
64
74
|
return this.isScrollable && this.maxIndex > 0;
|
|
65
75
|
}
|
|
76
|
+
get rotationVisible() {
|
|
77
|
+
return this.autoplay && (this.navigable ||
|
|
78
|
+
(this.slideTiming === 'finishVideos' && this.slidePlayback?.mode === 'completion'));
|
|
79
|
+
}
|
|
66
80
|
get arrowsVisible() {
|
|
67
81
|
return this.navigable && (this.showArrows ?? this.layout === 'slideshow');
|
|
68
82
|
}
|
|
@@ -91,12 +105,16 @@ export class QCarousel {
|
|
|
91
105
|
programmaticScrollToken = 0;
|
|
92
106
|
connected = false;
|
|
93
107
|
hovered = false;
|
|
108
|
+
selectedElement;
|
|
109
|
+
selectionGeneration = 0;
|
|
110
|
+
slidePlayback;
|
|
111
|
+
playbackState = '';
|
|
94
112
|
reducedMotion = false;
|
|
95
113
|
motionPreference;
|
|
96
114
|
rotationButton;
|
|
97
115
|
rotationPointerAction;
|
|
98
116
|
autoplayController = new CarouselAutoplay(() => {
|
|
99
|
-
if (!this.repeat && this.activeIndex >= this.maxIndex)
|
|
117
|
+
if (!this.navigable || (!this.repeat && this.activeIndex >= this.maxIndex))
|
|
100
118
|
return false;
|
|
101
119
|
this.scrollToIndex(this.activeIndex + 1);
|
|
102
120
|
return true;
|
|
@@ -106,6 +124,11 @@ export class QCarousel {
|
|
|
106
124
|
this.autoplayPlaying = playing;
|
|
107
125
|
if (changed)
|
|
108
126
|
this.qAutoplayChange.emit({ playing });
|
|
127
|
+
const state = `${playing}:${requested}`;
|
|
128
|
+
if (state !== this.playbackState) {
|
|
129
|
+
this.playbackState = state;
|
|
130
|
+
this.qPlaybackChange.emit({ playing, requested });
|
|
131
|
+
}
|
|
109
132
|
});
|
|
110
133
|
// ========================= [3] LIFECYCLE & WATCHERS ==========================
|
|
111
134
|
layoutChanged() {
|
|
@@ -180,12 +203,34 @@ export class QCarousel {
|
|
|
180
203
|
this.calculateLimits();
|
|
181
204
|
if (this.autoplay && this.navigable && !this.repeat && this.activeIndex >= this.maxIndex)
|
|
182
205
|
this.scrollToIndex(0);
|
|
206
|
+
if (this.slideTiming === 'finishVideos' && !this.navigable && this.slidePlayback?.ended) {
|
|
207
|
+
this.slidePlayback = undefined;
|
|
208
|
+
this.selectionGeneration += 1;
|
|
209
|
+
this.syncAutoplay();
|
|
210
|
+
this.qSlideChange.emit({ index: this.activeIndex, element: this.cachedChildren[this.activeIndex] });
|
|
211
|
+
}
|
|
183
212
|
this.autoplayController.play();
|
|
184
213
|
}
|
|
185
214
|
/** Stops rotation until play() or the playback control explicitly restarts it. */
|
|
186
215
|
async pause() {
|
|
187
216
|
this.autoplayController.pause();
|
|
188
217
|
}
|
|
218
|
+
/** Registers timing for the current slide and responsive-media visit only. */
|
|
219
|
+
async setSlidePlayback(element, key, mode) {
|
|
220
|
+
if (this.slideTiming !== 'finishVideos' || element !== this.cachedChildren[this.activeIndex])
|
|
221
|
+
return;
|
|
222
|
+
if (this.slidePlayback?.key === key && this.slidePlayback.mode === mode)
|
|
223
|
+
return;
|
|
224
|
+
this.slidePlayback = { element, key, mode, ended: false };
|
|
225
|
+
this.syncAutoplay();
|
|
226
|
+
}
|
|
227
|
+
/** Completes the registered visit; stale or duplicate media events are ignored. */
|
|
228
|
+
async completeSlide(key) {
|
|
229
|
+
if (this.slideTiming !== 'finishVideos' || this.slidePlayback?.key !== key || this.slidePlayback.ended)
|
|
230
|
+
return;
|
|
231
|
+
this.slidePlayback.ended = true;
|
|
232
|
+
this.autoplayController.complete(key);
|
|
233
|
+
}
|
|
189
234
|
/** Recalculates slide offsets, scroll bounds, and navigation states. */
|
|
190
235
|
async updateLimits() {
|
|
191
236
|
this.calculateLimits();
|
|
@@ -194,8 +239,16 @@ export class QCarousel {
|
|
|
194
239
|
syncAutoplay = () => {
|
|
195
240
|
this.autoplayController.configure({
|
|
196
241
|
enabled: this.autoplay,
|
|
197
|
-
navigable: this.navigable,
|
|
198
|
-
|
|
242
|
+
navigable: this.navigable || this.rotationVisible,
|
|
243
|
+
timing: this.slideTiming === 'finishVideos' ? (this.slidePlayback?.mode ?? 'pending') : 'interval',
|
|
244
|
+
visitKey: this.slideTiming === 'finishVideos'
|
|
245
|
+
? (this.slidePlayback?.key ?? `pending:${this.selectionGeneration}`)
|
|
246
|
+
: undefined,
|
|
247
|
+
advanceSuspended: this.autoplayAdvanceSuspended,
|
|
248
|
+
suspended: !this.connected ||
|
|
249
|
+
(this.autoplayBehavior !== 'continuous' && this.hovered) ||
|
|
250
|
+
document.hidden ||
|
|
251
|
+
this.autoplaySuspended,
|
|
199
252
|
reducedMotion: this.reducedMotion,
|
|
200
253
|
interval: this.autoplayInterval,
|
|
201
254
|
});
|
|
@@ -213,9 +266,13 @@ export class QCarousel {
|
|
|
213
266
|
}
|
|
214
267
|
handleInteraction = (event) => {
|
|
215
268
|
if (!this.isRotationEvent(event))
|
|
269
|
+
this.pauseOnInteraction();
|
|
270
|
+
};
|
|
271
|
+
pauseOnInteraction = () => {
|
|
272
|
+
if (this.autoplayBehavior !== 'continuous')
|
|
216
273
|
this.autoplayController.pause();
|
|
217
274
|
};
|
|
218
|
-
handleFocus = () => this.
|
|
275
|
+
handleFocus = () => this.pauseOnInteraction();
|
|
219
276
|
handleRotationClick = () => {
|
|
220
277
|
const play = this.rotationPointerAction ?? !this.autoplayRequested;
|
|
221
278
|
this.rotationPointerAction = undefined;
|
|
@@ -225,6 +282,13 @@ export class QCarousel {
|
|
|
225
282
|
this.autoplayController.pause();
|
|
226
283
|
};
|
|
227
284
|
updateSlideState() {
|
|
285
|
+
const selected = this.cachedChildren[this.activeIndex];
|
|
286
|
+
if (selected !== this.selectedElement) {
|
|
287
|
+
this.selectedElement = selected;
|
|
288
|
+
this.selectionGeneration += 1;
|
|
289
|
+
this.slidePlayback = undefined;
|
|
290
|
+
this.syncAutoplay();
|
|
291
|
+
}
|
|
228
292
|
if (this.managesSlides)
|
|
229
293
|
this.slideState.update(this.cachedChildren, this.activeIndex, () => this.recoverSlideFocus());
|
|
230
294
|
else
|
|
@@ -452,7 +516,7 @@ export class QCarousel {
|
|
|
452
516
|
handleIndicatorKeyDown = (e) => {
|
|
453
517
|
if (e.key === 'ArrowRight' || e.key === 'ArrowLeft') {
|
|
454
518
|
e.preventDefault();
|
|
455
|
-
this.
|
|
519
|
+
this.pauseOnInteraction();
|
|
456
520
|
const dots = Array.from(this.el.shadowRoot?.querySelectorAll('.indicator-dot') || []);
|
|
457
521
|
if (dots.length === 0)
|
|
458
522
|
return;
|
|
@@ -481,7 +545,7 @@ export class QCarousel {
|
|
|
481
545
|
return;
|
|
482
546
|
event.preventDefault();
|
|
483
547
|
event.stopPropagation();
|
|
484
|
-
this.
|
|
548
|
+
this.pauseOnInteraction();
|
|
485
549
|
this.scrollToIndex(this.activeIndex + (event.key === 'ArrowRight' ? 1 : -1));
|
|
486
550
|
if (!this.viewportFocusable)
|
|
487
551
|
this.recoverSlideFocus();
|
|
@@ -508,15 +572,18 @@ export class QCarousel {
|
|
|
508
572
|
this.hasExtraControls = slot.assignedElements().length > 0;
|
|
509
573
|
};
|
|
510
574
|
// ===================== [6] RENDER (Visual Template Only) =====================
|
|
575
|
+
renderRotationButton() {
|
|
576
|
+
return (h("button", { class: { 'rotation-btn': true, 'is-overlay': this.rotationPlacement === 'overlay' }, "aria-label": this.autoplayRequested ? 'Pause slideshow' : 'Play slideshow', part: "rotation-button", type: "button", onPointerDown: () => { this.rotationPointerAction = !this.autoplayRequested; }, onPointerCancel: () => { this.rotationPointerAction = undefined; }, onClick: this.handleRotationClick, ref: element => { this.rotationButton = element ?? undefined; } }, this.rotationPlacement === 'overlay' ? (this.autoplayRequested ? 'Ⅱ' : '▶') : (this.autoplayRequested ? 'Pause slideshow' : 'Play slideshow')));
|
|
577
|
+
}
|
|
511
578
|
render() {
|
|
512
579
|
const isFirst = this.repeat ? (!this.isScrollable || this.maxIndex <= 0) : (this.isAtStart || !this.isScrollable);
|
|
513
580
|
const isLast = this.repeat ? (!this.isScrollable || this.maxIndex <= 0) : (this.isAtEnd || !this.isScrollable);
|
|
514
|
-
return (h("div", { key: '
|
|
581
|
+
return (h("div", { key: 'ec56b70c1cdd706724c7da0102c812241833d706', class: "carousel-wrapper", onMouseEnter: () => this.handleHover(true), onMouseLeave: () => this.handleHover(false), onFocusin: this.handleFocus, onPointerDown: this.handleInteraction, onClick: this.handleInteraction }, this.rotationVisible && this.rotationPlacement === 'overlay' && this.renderRotationButton(), h("div", { key: 'd65322602f24ac502efc2a041f69f73c96775dc7', class: "carousel-controls", part: "controls", hidden: !this.indicatorsVisible && !(this.rotationVisible && this.rotationPlacement === 'controls') && !this.hasExtraControls }, this.rotationVisible && this.rotationPlacement === 'controls' && this.renderRotationButton(), this.indicatorsVisible && (h("div", { key: '30d2a569f136e337b91f1b107c790e03d684d785', class: "carousel-indicators", role: "group", "aria-label": "Carousel slide controls", onKeyDown: this.handleIndicatorKeyDown }, Array.from({ length: this.maxIndex + 1 }).map((_, idx) => (h("button", { class: { 'indicator-dot': true, 'is-active': idx === this.activeIndex }, part: "indicator", "aria-current": idx === this.activeIndex ? 'true' : undefined, onClick: () => this.scrollToIndex(idx), "aria-label": `Go to slide ${idx + 1}`, type: "button", tabindex: idx === this.activeIndex ? 0 : -1 }))))), h("slot", { key: '4e6d51345f247c3b53feac5b5e039eb5f6cb3008', name: "controls-extra", onSlotchange: this.handleExtraControlsChange })), h("div", { key: '21ad5d75d1e40e890c29d0449ae4b0e88965ff74', class: "carousel-arrow" }, this.arrowsVisible && (h("button", { key: 'a78e06f67637520b1be6e6292403ec9f2056f1a6', class: { 'arrow-btn': true, 'arrow-left': true }, part: "previous-button", "aria-disabled": isFirst ? 'true' : 'false', onClick: isFirst ? undefined : this.slidePrev, "aria-label": "Previous slide", type: "button" }, h("svg", { key: '79e0cb376b578cfb8aa34b8682d447869f8a739e', viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "aria-hidden": "true" }, h("polyline", { key: '52c0c5c6c66c548e9c2e0cfc580116ed37e86002', points: "15 18 9 12 15 6" }))))), h("div", { key: '6f90c4cea424455495bad337134e586c6229d622', class: {
|
|
515
582
|
'carousel-viewport': true,
|
|
516
583
|
'is-stacked': this.stacked,
|
|
517
584
|
'viewport-focusable': this.viewportFocusable,
|
|
518
585
|
[`snap-${this.snapAlignment}`]: this.snapAlignment !== 'none'
|
|
519
|
-
}, role: "group", "aria-roledescription": "carousel", part: "viewport", tabindex: this.viewportFocusable ? 0 : -1, "aria-label": this.ariaLabel, "aria-live": this.managesSlides ? (this.autoplayPlaying ? 'off' : 'polite') : undefined, "aria-atomic": this.managesSlides ? 'false' : undefined, style: { '--q-carousel-transition-duration': `${Number.isFinite(this.transitionDuration) ? Math.max(0, this.transitionDuration) : 500}ms` }, onKeyDown: this.handleKeyDown, onPointerDown: this.handlePointerDown, onPointerUp: this.handlePointerUp, onPointerCancel: this.handlePointerCancel, onScroll: this.handleScroll, ref: this.setScrollContainerRef }, h("slot", { key: '
|
|
586
|
+
}, role: "group", "aria-roledescription": "carousel", part: "viewport", tabindex: this.viewportFocusable ? 0 : -1, "aria-label": this.ariaLabel, "aria-live": this.managesSlides ? (this.autoplayPlaying ? 'off' : 'polite') : undefined, "aria-atomic": this.managesSlides ? 'false' : undefined, style: { '--q-carousel-transition-duration': `${Number.isFinite(this.transitionDuration) ? Math.max(0, this.transitionDuration) : 500}ms` }, onKeyDown: this.handleKeyDown, onPointerDown: this.handlePointerDown, onPointerUp: this.handlePointerUp, onPointerCancel: this.handlePointerCancel, onScroll: this.handleScroll, ref: this.setScrollContainerRef }, h("slot", { key: '9c81f28218a752289de7f20f63e03d932ca24e33', onSlotchange: this.handleSlotChange })), h("div", { key: '9b760f5cf4d3c5e69f3704649458be1648394491', class: "carousel-arrow" }, this.arrowsVisible && (h("button", { key: '9233404c505c711a37f16dfb4032f4edd8949128', class: { 'arrow-btn': true, 'arrow-right': true }, part: "next-button", "aria-disabled": isLast ? 'true' : 'false', onClick: isLast ? undefined : this.slideNext, "aria-label": "Next slide", type: "button" }, h("svg", { key: 'bd5e9b26823d3596a2792d9cbe9a07e50fe08960', viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "aria-hidden": "true" }, h("polyline", { key: 'cee4ae860783927a2c4e493dd3d26dce8e9f1bea', points: "9 18 15 12 9 6" })))))));
|
|
520
587
|
}
|
|
521
588
|
static get is() { return "q-carousel"; }
|
|
522
589
|
static get encapsulation() { return "shadow"; }
|
|
@@ -606,6 +673,26 @@ export class QCarousel {
|
|
|
606
673
|
"attribute": "item-width",
|
|
607
674
|
"defaultValue": "'auto'"
|
|
608
675
|
},
|
|
676
|
+
"rotationPlacement": {
|
|
677
|
+
"type": "string",
|
|
678
|
+
"mutable": false,
|
|
679
|
+
"complexType": {
|
|
680
|
+
"original": "'controls' | 'overlay'",
|
|
681
|
+
"resolved": "\"controls\" | \"overlay\"",
|
|
682
|
+
"references": {}
|
|
683
|
+
},
|
|
684
|
+
"required": false,
|
|
685
|
+
"optional": false,
|
|
686
|
+
"docs": {
|
|
687
|
+
"tags": [],
|
|
688
|
+
"text": "Overlay keeps playback separate from the indicators/extra-controls panel."
|
|
689
|
+
},
|
|
690
|
+
"getter": false,
|
|
691
|
+
"setter": false,
|
|
692
|
+
"reflect": true,
|
|
693
|
+
"attribute": "rotation-placement",
|
|
694
|
+
"defaultValue": "'controls'"
|
|
695
|
+
},
|
|
609
696
|
"showArrows": {
|
|
610
697
|
"type": "boolean",
|
|
611
698
|
"mutable": false,
|
|
@@ -723,7 +810,7 @@ export class QCarousel {
|
|
|
723
810
|
"optional": false,
|
|
724
811
|
"docs": {
|
|
725
812
|
"tags": [],
|
|
726
|
-
"text": "Enables rotation
|
|
813
|
+
"text": "Enables rotation with the configured interaction behavior."
|
|
727
814
|
},
|
|
728
815
|
"getter": false,
|
|
729
816
|
"setter": false,
|
|
@@ -731,6 +818,33 @@ export class QCarousel {
|
|
|
731
818
|
"attribute": "autoplay",
|
|
732
819
|
"defaultValue": "false"
|
|
733
820
|
},
|
|
821
|
+
"autoplayBehavior": {
|
|
822
|
+
"type": "string",
|
|
823
|
+
"mutable": false,
|
|
824
|
+
"complexType": {
|
|
825
|
+
"original": "QCarouselAutoplayBehavior",
|
|
826
|
+
"resolved": "\"continuous\" | \"pauseOnInteraction\"",
|
|
827
|
+
"references": {
|
|
828
|
+
"QCarouselAutoplayBehavior": {
|
|
829
|
+
"location": "import",
|
|
830
|
+
"path": "./carousel.types",
|
|
831
|
+
"id": "../../../src/browser/components/content/carousel/carousel.types.ts::QCarouselAutoplayBehavior",
|
|
832
|
+
"referenceLocation": "QCarouselAutoplayBehavior"
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
},
|
|
836
|
+
"required": false,
|
|
837
|
+
"optional": false,
|
|
838
|
+
"docs": {
|
|
839
|
+
"tags": [],
|
|
840
|
+
"text": "Continuous rotation ignores hover and interaction; explicit pause remains available."
|
|
841
|
+
},
|
|
842
|
+
"getter": false,
|
|
843
|
+
"setter": false,
|
|
844
|
+
"reflect": false,
|
|
845
|
+
"attribute": "autoplay-behavior",
|
|
846
|
+
"defaultValue": "'pauseOnInteraction'"
|
|
847
|
+
},
|
|
734
848
|
"autoplayInterval": {
|
|
735
849
|
"type": "number",
|
|
736
850
|
"mutable": false,
|
|
@@ -771,6 +885,53 @@ export class QCarousel {
|
|
|
771
885
|
"attribute": "autoplay-suspended",
|
|
772
886
|
"defaultValue": "false"
|
|
773
887
|
},
|
|
888
|
+
"slideTiming": {
|
|
889
|
+
"type": "string",
|
|
890
|
+
"mutable": false,
|
|
891
|
+
"complexType": {
|
|
892
|
+
"original": "QCarouselSlideTiming",
|
|
893
|
+
"resolved": "\"finishVideos\" | \"fixedInterval\"",
|
|
894
|
+
"references": {
|
|
895
|
+
"QCarouselSlideTiming": {
|
|
896
|
+
"location": "import",
|
|
897
|
+
"path": "./carousel.types",
|
|
898
|
+
"id": "../../../src/browser/components/content/carousel/carousel.types.ts::QCarouselSlideTiming",
|
|
899
|
+
"referenceLocation": "QCarouselSlideTiming"
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
},
|
|
903
|
+
"required": false,
|
|
904
|
+
"optional": false,
|
|
905
|
+
"docs": {
|
|
906
|
+
"tags": [],
|
|
907
|
+
"text": "Finish-videos delegates each active visit's timing to setSlidePlayback()."
|
|
908
|
+
},
|
|
909
|
+
"getter": false,
|
|
910
|
+
"setter": false,
|
|
911
|
+
"reflect": false,
|
|
912
|
+
"attribute": "slide-timing",
|
|
913
|
+
"defaultValue": "'fixedInterval'"
|
|
914
|
+
},
|
|
915
|
+
"autoplayAdvanceSuspended": {
|
|
916
|
+
"type": "boolean",
|
|
917
|
+
"mutable": false,
|
|
918
|
+
"complexType": {
|
|
919
|
+
"original": "boolean",
|
|
920
|
+
"resolved": "boolean",
|
|
921
|
+
"references": {}
|
|
922
|
+
},
|
|
923
|
+
"required": false,
|
|
924
|
+
"optional": false,
|
|
925
|
+
"docs": {
|
|
926
|
+
"tags": [],
|
|
927
|
+
"text": "Holds advancement for loading without pausing the active media."
|
|
928
|
+
},
|
|
929
|
+
"getter": false,
|
|
930
|
+
"setter": false,
|
|
931
|
+
"reflect": false,
|
|
932
|
+
"attribute": "autoplay-advance-suspended",
|
|
933
|
+
"defaultValue": "false"
|
|
934
|
+
},
|
|
774
935
|
"ariaLabel": {
|
|
775
936
|
"type": "string",
|
|
776
937
|
"mutable": false,
|
|
@@ -850,6 +1011,28 @@ export class QCarousel {
|
|
|
850
1011
|
}
|
|
851
1012
|
}
|
|
852
1013
|
}
|
|
1014
|
+
}, {
|
|
1015
|
+
"method": "qPlaybackChange",
|
|
1016
|
+
"name": "qPlaybackChange",
|
|
1017
|
+
"bubbles": true,
|
|
1018
|
+
"cancelable": true,
|
|
1019
|
+
"composed": true,
|
|
1020
|
+
"docs": {
|
|
1021
|
+
"tags": [],
|
|
1022
|
+
"text": "Playback intent and eligibility, independent of an image-readiness advance hold."
|
|
1023
|
+
},
|
|
1024
|
+
"complexType": {
|
|
1025
|
+
"original": "QCarouselPlaybackChangeDetail",
|
|
1026
|
+
"resolved": "QCarouselPlaybackChangeDetail",
|
|
1027
|
+
"references": {
|
|
1028
|
+
"QCarouselPlaybackChangeDetail": {
|
|
1029
|
+
"location": "import",
|
|
1030
|
+
"path": "./carousel.types",
|
|
1031
|
+
"id": "../../../src/browser/components/content/carousel/carousel.types.ts::QCarouselPlaybackChangeDetail",
|
|
1032
|
+
"referenceLocation": "QCarouselPlaybackChangeDetail"
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
853
1036
|
}];
|
|
854
1037
|
}
|
|
855
1038
|
static get methods() {
|
|
@@ -909,6 +1092,60 @@ export class QCarousel {
|
|
|
909
1092
|
"tags": []
|
|
910
1093
|
}
|
|
911
1094
|
},
|
|
1095
|
+
"setSlidePlayback": {
|
|
1096
|
+
"complexType": {
|
|
1097
|
+
"signature": "(element: HTMLElement, key: string, mode: \"interval\" | \"completion\") => Promise<void>",
|
|
1098
|
+
"parameters": [{
|
|
1099
|
+
"name": "element",
|
|
1100
|
+
"type": "HTMLElement",
|
|
1101
|
+
"docs": ""
|
|
1102
|
+
}, {
|
|
1103
|
+
"name": "key",
|
|
1104
|
+
"type": "string",
|
|
1105
|
+
"docs": ""
|
|
1106
|
+
}, {
|
|
1107
|
+
"name": "mode",
|
|
1108
|
+
"type": "\"interval\" | \"completion\"",
|
|
1109
|
+
"docs": ""
|
|
1110
|
+
}],
|
|
1111
|
+
"references": {
|
|
1112
|
+
"Promise": {
|
|
1113
|
+
"location": "global",
|
|
1114
|
+
"id": "global::Promise"
|
|
1115
|
+
},
|
|
1116
|
+
"HTMLElement": {
|
|
1117
|
+
"location": "global",
|
|
1118
|
+
"id": "global::HTMLElement"
|
|
1119
|
+
}
|
|
1120
|
+
},
|
|
1121
|
+
"return": "Promise<void>"
|
|
1122
|
+
},
|
|
1123
|
+
"docs": {
|
|
1124
|
+
"text": "Registers timing for the current slide and responsive-media visit only.",
|
|
1125
|
+
"tags": []
|
|
1126
|
+
}
|
|
1127
|
+
},
|
|
1128
|
+
"completeSlide": {
|
|
1129
|
+
"complexType": {
|
|
1130
|
+
"signature": "(key: string) => Promise<void>",
|
|
1131
|
+
"parameters": [{
|
|
1132
|
+
"name": "key",
|
|
1133
|
+
"type": "string",
|
|
1134
|
+
"docs": ""
|
|
1135
|
+
}],
|
|
1136
|
+
"references": {
|
|
1137
|
+
"Promise": {
|
|
1138
|
+
"location": "global",
|
|
1139
|
+
"id": "global::Promise"
|
|
1140
|
+
}
|
|
1141
|
+
},
|
|
1142
|
+
"return": "Promise<void>"
|
|
1143
|
+
},
|
|
1144
|
+
"docs": {
|
|
1145
|
+
"text": "Completes the registered visit; stale or duplicate media events are ignored.",
|
|
1146
|
+
"tags": []
|
|
1147
|
+
}
|
|
1148
|
+
},
|
|
912
1149
|
"updateLimits": {
|
|
913
1150
|
"complexType": {
|
|
914
1151
|
"signature": "() => Promise<void>",
|
|
@@ -942,12 +1179,21 @@ export class QCarousel {
|
|
|
942
1179
|
}, {
|
|
943
1180
|
"propName": "autoplay",
|
|
944
1181
|
"methodName": "autoplayChanged"
|
|
1182
|
+
}, {
|
|
1183
|
+
"propName": "autoplayBehavior",
|
|
1184
|
+
"methodName": "autoplayChanged"
|
|
945
1185
|
}, {
|
|
946
1186
|
"propName": "autoplayInterval",
|
|
947
1187
|
"methodName": "autoplayChanged"
|
|
948
1188
|
}, {
|
|
949
1189
|
"propName": "autoplaySuspended",
|
|
950
1190
|
"methodName": "autoplayChanged"
|
|
1191
|
+
}, {
|
|
1192
|
+
"propName": "autoplayAdvanceSuspended",
|
|
1193
|
+
"methodName": "autoplayChanged"
|
|
1194
|
+
}, {
|
|
1195
|
+
"propName": "slideTiming",
|
|
1196
|
+
"methodName": "autoplayChanged"
|
|
951
1197
|
}, {
|
|
952
1198
|
"propName": "transition",
|
|
953
1199
|
"methodName": "transitionChanged"
|
|
@@ -11,13 +11,17 @@ export class CarouselAutoplay {
|
|
|
11
11
|
};
|
|
12
12
|
requested = false;
|
|
13
13
|
timer;
|
|
14
|
+
completed = false;
|
|
14
15
|
constructor(advance, changed) {
|
|
15
16
|
this.advance = advance;
|
|
16
17
|
this.changed = changed;
|
|
17
18
|
}
|
|
18
19
|
configure(config) {
|
|
19
20
|
const interval = Number.isFinite(config.interval) && config.interval > 0 ? config.interval : 5000;
|
|
20
|
-
const
|
|
21
|
+
const visitChanged = config.visitKey !== this.config.visitKey;
|
|
22
|
+
const timingChanged = interval !== this.config.interval || config.timing !== this.config.timing || visitChanged;
|
|
23
|
+
if (visitChanged)
|
|
24
|
+
this.completed = false;
|
|
21
25
|
if (!config.enabled)
|
|
22
26
|
this.requested = false;
|
|
23
27
|
else if (!this.config.enabled)
|
|
@@ -43,22 +47,43 @@ export class CarouselAutoplay {
|
|
|
43
47
|
this.config = { ...this.config, suspended: true };
|
|
44
48
|
this.sync();
|
|
45
49
|
}
|
|
50
|
+
complete(visitKey) {
|
|
51
|
+
if (this.config.timing !== 'completion' || visitKey !== this.config.visitKey)
|
|
52
|
+
return;
|
|
53
|
+
this.completed = true;
|
|
54
|
+
this.sync();
|
|
55
|
+
}
|
|
46
56
|
sync() {
|
|
47
57
|
const playing = this.requested && this.config.enabled && this.config.navigable && !this.config.suspended;
|
|
48
|
-
|
|
58
|
+
const advancing = playing && !this.config.advanceSuspended;
|
|
59
|
+
this.changed(playing, this.requested);
|
|
60
|
+
if (!advancing || this.config.timing === 'pending') {
|
|
61
|
+
this.clearTimer();
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (this.config.timing === 'completion') {
|
|
49
65
|
this.clearTimer();
|
|
50
|
-
|
|
51
|
-
|
|
66
|
+
if (this.completed) {
|
|
67
|
+
this.completed = false;
|
|
68
|
+
if (!this.advance())
|
|
69
|
+
this.pause();
|
|
70
|
+
}
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (this.timer === undefined) {
|
|
74
|
+
this.timer = setTimeout(() => {
|
|
75
|
+
this.timer = undefined;
|
|
52
76
|
if (!this.advance())
|
|
53
77
|
this.pause();
|
|
78
|
+
else
|
|
79
|
+
this.sync();
|
|
54
80
|
}, this.config.interval);
|
|
55
81
|
}
|
|
56
|
-
this.changed(playing, this.requested);
|
|
57
82
|
}
|
|
58
83
|
clearTimer() {
|
|
59
84
|
if (this.timer === undefined)
|
|
60
85
|
return;
|
|
61
|
-
|
|
86
|
+
clearTimeout(this.timer);
|
|
62
87
|
this.timer = undefined;
|
|
63
88
|
}
|
|
64
89
|
}
|