ku4web-components 6.4.80 → 6.4.83
Sign up to get free protection for your applications and to get access to all the features.
- package/angular/index.js +1 -1
- package/angular/index.mjs +1 -1
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/css-shim-6ca600c2.js +6 -0
- package/dist/cjs/dom-8d415461.js +75 -0
- package/dist/cjs/index-652a3cbf.js +14 -0
- package/dist/cjs/{index-1e13241e.js → index-a7b6d98c.js} +1 -1
- package/dist/cjs/index-c904eb3a.js +10 -0
- package/dist/cjs/index-ca4336bd.js +3093 -0
- package/dist/cjs/{index-da3ed39d.js → index-f78c109e.js} +1 -1
- package/dist/cjs/ku4-carousel-controls.cjs.entry.js +10 -4
- package/dist/cjs/ku4-carousel-slide.cjs.entry.js +1 -1
- package/dist/cjs/ku4-carousel.cjs.entry.js +14 -7
- package/dist/cjs/ku4-col.cjs.entry.js +1 -1
- package/dist/cjs/ku4-drawer.cjs.entry.js +1 -1
- package/dist/cjs/ku4-feature.cjs.entry.js +2 -2
- package/dist/cjs/ku4-focus-trap.cjs.entry.js +26 -26
- package/dist/cjs/ku4-form.cjs.entry.js +3 -3
- package/dist/cjs/ku4-grid.cjs.entry.js +1 -1
- package/dist/cjs/ku4-label.cjs.entry.js +2 -2
- package/dist/cjs/ku4-mask.cjs.entry.js +2 -2
- package/dist/cjs/ku4-modal.cjs.entry.js +3 -3
- package/dist/cjs/ku4-panel.cjs.entry.js +1 -1
- package/dist/cjs/ku4-preview.cjs.entry.js +43 -14
- package/dist/cjs/ku4-tab-list.cjs.entry.js +4 -4
- package/dist/cjs/ku4-tab-panel.cjs.entry.js +3 -3
- package/dist/cjs/ku4-tab.cjs.entry.js +3 -3
- package/dist/cjs/ku4-table.cjs.entry.js +1 -1
- package/dist/cjs/ku4-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/ku4-validation.cjs.entry.js +2 -2
- package/dist/cjs/ku4web-components.cjs.js +103 -8
- package/dist/cjs/loader.cjs.js +19 -3
- package/dist/cjs/{shadow-css-8940f82d.js → shadow-css-78860e39.js} +1 -1
- package/dist/cjs/{uid-d6942c42.js → uid-97baaecc.js} +1 -1
- package/dist/cjs/uid-eb3bec28.js +11 -0
- package/dist/collection/capabilities/a11y/aria.js +26 -0
- package/dist/collection/capabilities/angular/index.js +24 -0
- package/dist/collection/capabilities/decorators/deprecated.js +20 -0
- package/dist/collection/capabilities/decorators/index.js +3 -0
- package/dist/collection/capabilities/decorators/memoize.js +7 -0
- package/dist/collection/capabilities/dom/isFocusable.js +7 -0
- package/dist/collection/capabilities/dom/queryFocusable.js +2 -0
- package/dist/collection/capabilities/identity/uid.js +6 -0
- package/dist/collection/capabilities/mask/index.js +5 -0
- package/dist/collection/capabilities/mask/patterns/date.js +40 -0
- package/dist/collection/capabilities/mask/patterns/index.js +7 -0
- package/dist/collection/capabilities/react/index.js +25 -0
- package/dist/collection/capabilities/testing/html.js +14 -0
- package/dist/collection/capabilities/testing/styles.js +14 -0
- package/dist/collection/capabilities/vue/index.js +28 -0
- package/dist/collection/capabilities/vue3/index.js +26 -0
- package/dist/collection/collection-manifest.json +31 -0
- package/dist/collection/components/ku4-carousel/ku4-carousel.css +221 -0
- package/dist/collection/components/ku4-carousel/ku4-carousel.js +369 -0
- package/dist/collection/components/ku4-carousel-controls/ku4-carousel-controls.css +32 -0
- package/dist/collection/components/ku4-carousel-controls/ku4-carousel-controls.js +112 -0
- package/dist/collection/components/ku4-carousel-slide/ku4-carousel-slide.css +3 -0
- package/dist/collection/components/ku4-carousel-slide/ku4-carousel-slide.js +159 -0
- package/dist/collection/components/ku4-col/ku4-col.css +601 -0
- package/dist/collection/components/ku4-col/ku4-col.js +288 -0
- package/dist/collection/components/ku4-drawer/ku4-drawer.css +56 -0
- package/dist/collection/components/ku4-drawer/ku4-drawer.js +163 -0
- package/dist/collection/components/ku4-feature/ku4-feature.js +70 -0
- package/dist/collection/components/ku4-focus-trap/ku4-focus-trap.css +3 -0
- package/dist/collection/components/ku4-focus-trap/ku4-focus-trap.js +441 -0
- package/dist/collection/components/ku4-form/ku4-form.js +225 -0
- package/dist/collection/components/ku4-grid/ku4-grid.css +751 -0
- package/dist/collection/components/ku4-grid/ku4-grid.js +408 -0
- package/dist/collection/components/ku4-label/ku4-label.css +36 -0
- package/dist/collection/components/ku4-label/ku4-label.js +115 -0
- package/dist/collection/components/ku4-mask/ku4-mask.css +3 -0
- package/dist/collection/components/ku4-mask/ku4-mask.js +458 -0
- package/dist/collection/components/ku4-modal/ku4-modal.css +85 -0
- package/dist/collection/components/ku4-modal/ku4-modal.js +208 -0
- package/dist/collection/components/ku4-panel/ku4-panel.css +14 -0
- package/dist/collection/components/ku4-panel/ku4-panel.js +119 -0
- package/dist/collection/components/ku4-preview/ku4-preview.css +23 -0
- package/dist/collection/components/ku4-preview/ku4-preview.js +266 -0
- package/dist/collection/components/ku4-tab/ku4-tab.css +82 -0
- package/dist/collection/components/ku4-tab/ku4-tab.js +191 -0
- package/dist/collection/components/ku4-tab-list/ku4-tab-list.css +6 -0
- package/dist/collection/components/ku4-tab-list/ku4-tab-list.js +118 -0
- package/dist/collection/components/ku4-tab-panel/ku4-tab-panel.css +26 -0
- package/dist/collection/components/ku4-tab-panel/ku4-tab-panel.js +166 -0
- package/dist/collection/components/ku4-table/ku4-table.css +116 -0
- package/dist/collection/components/ku4-table/ku4-table.js +120 -0
- package/dist/collection/components/ku4-tooltip/ku4-tooltip.css +56 -0
- package/dist/collection/components/ku4-tooltip/ku4-tooltip.js +274 -0
- package/dist/collection/components/ku4-validation/ku4-validation.css +19 -0
- package/dist/collection/components/ku4-validation/ku4-validation.js +364 -0
- package/dist/collection/components/ku4-validation/validate.js +14 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/security.js +27 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/css-shim-e6dd2538.js +4 -0
- package/dist/esm/dom-7fc649b0.js +73 -0
- package/dist/esm/index-3e1e5aa3.js +3 -0
- package/dist/esm/index-7fe386de.js +3057 -0
- package/dist/esm/index-7ff6e718.js +3 -0
- package/dist/esm/{index-9e3af5f4.js → index-81a98b72.js} +1 -1
- package/dist/esm/{index-20c3926d.js → index-bdb0771a.js} +1 -1
- package/dist/esm/ku4-carousel-controls.entry.js +10 -4
- package/dist/esm/ku4-carousel-slide.entry.js +1 -1
- package/dist/esm/ku4-carousel.entry.js +14 -7
- package/dist/esm/ku4-col.entry.js +1 -1
- package/dist/esm/ku4-drawer.entry.js +1 -1
- package/dist/esm/ku4-feature.entry.js +2 -2
- package/dist/esm/ku4-focus-trap.entry.js +3 -3
- package/dist/esm/ku4-form.entry.js +3 -3
- package/dist/esm/ku4-grid.entry.js +1 -1
- package/dist/esm/ku4-label.entry.js +2 -2
- package/dist/esm/ku4-mask.entry.js +2 -2
- package/dist/esm/ku4-modal.entry.js +3 -3
- package/dist/esm/ku4-panel.entry.js +1 -1
- package/dist/esm/ku4-preview.entry.js +34 -5
- package/dist/esm/ku4-tab-list.entry.js +4 -4
- package/dist/esm/ku4-tab-panel.entry.js +3 -3
- package/dist/esm/ku4-tab.entry.js +3 -3
- package/dist/esm/ku4-table.entry.js +1 -1
- package/dist/esm/ku4-tooltip.entry.js +2 -2
- package/dist/esm/ku4-validation.entry.js +2 -2
- package/dist/esm/ku4web-components.js +103 -8
- package/dist/esm/loader.js +19 -3
- package/dist/esm/{shadow-css-5d2d01ce.js → shadow-css-4d56fa31.js} +1 -1
- package/dist/esm/{uid-15f8c937.js → uid-1ec3509b.js} +1 -1
- package/dist/esm/uid-9dbd7ad0.js +9 -0
- package/dist/esm-es5/{index-9e3af5f4.js → index-81a98b72.js} +1 -1
- package/dist/esm-es5/{index-20c3926d.js → index-bdb0771a.js} +1 -1
- package/dist/esm-es5/ku4-carousel-controls.entry.js +1 -1
- package/dist/esm-es5/ku4-carousel-slide.entry.js +1 -1
- package/dist/esm-es5/ku4-carousel.entry.js +1 -1
- package/dist/esm-es5/ku4-col.entry.js +1 -1
- package/dist/esm-es5/ku4-drawer.entry.js +1 -1
- package/dist/esm-es5/ku4-feature.entry.js +1 -1
- package/dist/esm-es5/ku4-focus-trap.entry.js +1 -1
- package/dist/esm-es5/ku4-form.entry.js +1 -1
- package/dist/esm-es5/ku4-grid.entry.js +1 -1
- package/dist/esm-es5/ku4-label.entry.js +1 -1
- package/dist/esm-es5/ku4-mask.entry.js +1 -1
- package/dist/esm-es5/ku4-modal.entry.js +1 -1
- package/dist/esm-es5/ku4-panel.entry.js +1 -1
- package/dist/esm-es5/ku4-preview.entry.js +1 -1
- package/dist/esm-es5/ku4-tab-list.entry.js +1 -1
- package/dist/esm-es5/ku4-tab-panel.entry.js +1 -1
- package/dist/esm-es5/ku4-tab.entry.js +1 -1
- package/dist/esm-es5/ku4-table.entry.js +1 -1
- package/dist/esm-es5/ku4-tooltip.entry.js +1 -1
- package/dist/esm-es5/ku4-validation.entry.js +1 -1
- package/dist/esm-es5/ku4web-components.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{shadow-css-5d2d01ce.js → shadow-css-4d56fa31.js} +0 -0
- package/dist/esm-es5/uid-1ec3509b.js +1 -0
- package/dist/index.js +1 -1
- package/dist/ku4web-components/app-globals-0f993ce5.js +3 -0
- package/dist/ku4web-components/app-globals-497eb362.system.js +1 -0
- package/dist/ku4web-components/css-shim-b6eec689.system.js +1 -0
- package/dist/ku4web-components/css-shim-e6dd2538.js +4 -0
- package/dist/ku4web-components/dom-7fc649b0.js +73 -0
- package/dist/ku4web-components/dom-88962da0.system.js +21 -0
- package/dist/ku4web-components/index-380cbe3a.system.js +1 -0
- package/dist/ku4web-components/index-3e1e5aa3.js +3 -0
- package/dist/ku4web-components/index-5029fd1f.system.js +1 -0
- package/dist/ku4web-components/index-7d482e8a.system.js +1 -0
- package/dist/ku4web-components/index-7fe386de.js +3057 -0
- package/dist/ku4web-components/index-7ff6e718.js +3 -0
- package/dist/ku4web-components/index.esm.js +1 -0
- package/dist/ku4web-components/index.system.js +1 -0
- package/dist/ku4web-components/ku4-carousel-controls.entry.js +89 -0
- package/dist/ku4web-components/ku4-carousel-controls.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-carousel-slide.entry.js +47 -0
- package/dist/ku4web-components/ku4-carousel-slide.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-carousel.entry.js +175 -0
- package/dist/ku4web-components/ku4-carousel.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-col.entry.js +75 -0
- package/dist/ku4web-components/ku4-col.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-drawer.entry.js +35 -0
- package/dist/ku4web-components/ku4-drawer.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-feature.entry.js +29 -0
- package/dist/ku4web-components/ku4-feature.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-focus-trap.entry.js +323 -0
- package/dist/ku4web-components/ku4-focus-trap.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-form.entry.js +112 -0
- package/dist/ku4web-components/ku4-form.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-grid.entry.js +108 -0
- package/dist/ku4web-components/ku4-grid.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-label.entry.js +70 -0
- package/dist/ku4web-components/ku4-label.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-mask.entry.js +342 -0
- package/dist/ku4web-components/ku4-mask.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-modal.entry.js +75 -0
- package/dist/ku4web-components/ku4-modal.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-panel.entry.js +49 -0
- package/dist/ku4web-components/ku4-panel.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-preview.entry.js +128 -0
- package/dist/ku4web-components/ku4-preview.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-tab-list.entry.js +76 -0
- package/dist/ku4web-components/ku4-tab-list.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-tab-panel.entry.js +72 -0
- package/dist/ku4web-components/ku4-tab-panel.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-tab.entry.js +63 -0
- package/dist/ku4web-components/ku4-tab.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-table.entry.js +79 -0
- package/dist/ku4web-components/ku4-table.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-tooltip.entry.js +120 -0
- package/dist/ku4web-components/ku4-tooltip.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-validation.entry.js +162 -0
- package/dist/ku4web-components/ku4-validation.system.entry.js +1 -0
- package/dist/ku4web-components/ku4web-components.css +299 -1
- package/dist/ku4web-components/ku4web-components.esm.js +129 -1
- package/dist/ku4web-components/ku4web-components.js +1 -1
- package/dist/ku4web-components/ku4web-components.system.js +1 -0
- package/dist/ku4web-components/{p-15ee8b8e.system.entry.js → p-02328d34.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-01debe28.system.entry.js → p-050f184b.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-8e2fca0b.system.entry.js → p-073cefec.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-22eed87f.entry.js → p-097ba217.entry.js} +1 -1
- package/dist/ku4web-components/{p-f1cc1b2d.entry.js → p-0adeb8e4.entry.js} +1 -1
- package/dist/ku4web-components/{p-840704e4.entry.js → p-0ce97586.entry.js} +1 -1
- package/dist/ku4web-components/p-0f77bef9.system.js +1 -0
- package/dist/ku4web-components/{p-761b2cbc.system.entry.js → p-136e5a03.system.entry.js} +1 -1
- package/dist/ku4web-components/p-17d548db.js +1 -0
- package/dist/ku4web-components/{p-c1068ffa.js → p-189cde73.js} +1 -1
- package/dist/ku4web-components/{p-2f2d74dc.system.entry.js → p-1d5a1caf.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-a5c7f5f7.system.entry.js → p-288482da.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-0e010c10.system.entry.js → p-3a0d1ff7.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-d360c64a.entry.js → p-3f147a02.entry.js} +1 -1
- package/dist/ku4web-components/{p-0f8708f8.entry.js → p-3f2a008c.entry.js} +1 -1
- package/dist/ku4web-components/{p-8faad87d.entry.js → p-3f4082d5.entry.js} +1 -1
- package/dist/ku4web-components/{p-7273db60.entry.js → p-49275772.entry.js} +1 -1
- package/dist/ku4web-components/{p-232787a5.system.entry.js → p-4bfca34b.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-04948520.system.entry.js → p-524cef27.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-67adc5b1.system.entry.js → p-52d815ab.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-2edd35f8.system.entry.js → p-596beaad.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-f06bf0ae.entry.js → p-5f9d0077.entry.js} +1 -1
- package/dist/ku4web-components/{p-660ebd19.entry.js → p-5fcea805.entry.js} +1 -1
- package/dist/ku4web-components/{p-adddaeef.entry.js → p-61214088.entry.js} +1 -1
- package/dist/ku4web-components/{p-d6ec34c3.entry.js → p-66b8247f.entry.js} +1 -1
- package/dist/ku4web-components/{p-9c0d71af.system.entry.js → p-6b9e3523.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-02e342f7.system.entry.js → p-6cfd9011.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-8d9eb18b.system.entry.js → p-7bfc256a.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-77f1853c.entry.js → p-818caf0f.entry.js} +1 -1
- package/dist/ku4web-components/{p-3874127d.entry.js → p-8642aef5.entry.js} +1 -1
- package/dist/ku4web-components/{p-f6455ab3.js → p-881e100a.js} +0 -0
- package/dist/ku4web-components/{p-19a8c0f6.system.entry.js → p-95698618.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-f0b1c07c.system.js → p-96ec7b4f.system.js} +1 -1
- package/dist/ku4web-components/{p-ce6eddc3.system.entry.js → p-a0d0c99e.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-b4488a7d.system.entry.js → p-acb43765.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-c19fd841.entry.js → p-b47bb3d0.entry.js} +1 -1
- package/dist/ku4web-components/{p-0785fc39.system.js → p-c3293202.system.js} +1 -1
- package/dist/ku4web-components/{p-eb6882c8.entry.js → p-c798faf2.entry.js} +1 -1
- package/dist/ku4web-components/{p-3c182b2f.entry.js → p-cd0d0b40.entry.js} +1 -1
- package/dist/ku4web-components/p-cd4cdcbb.entry.js +1 -0
- package/dist/ku4web-components/{p-8f480cb5.system.entry.js → p-d848909c.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-90c37394.entry.js → p-d8868855.entry.js} +1 -1
- package/dist/ku4web-components/p-db3040f3.system.js +1 -0
- package/dist/ku4web-components/{p-2aac6c90.js → p-e6b3a708.js} +1 -1
- package/dist/ku4web-components/{p-c50540ec.system.entry.js → p-ea4b32de.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-e4ff1c36.entry.js → p-f3fbe1e6.entry.js} +1 -1
- package/dist/ku4web-components/p-f64c1f55.entry.js +1 -0
- package/dist/ku4web-components/{p-71d57b8b.system.js → p-fbf3ad1e.system.js} +0 -0
- package/dist/ku4web-components/{p-0eb73a0f.system.entry.js → p-fc0c3bf4.system.entry.js} +1 -1
- package/dist/ku4web-components/shadow-css-4d56fa31.js +388 -0
- package/dist/ku4web-components/shadow-css-d0426811.system.js +13 -0
- package/dist/ku4web-components/uid-9dbd7ad0.js +9 -0
- package/dist/ku4web-components/uid-fb867945.system.js +1 -0
- package/dist/types/components/ku4-carousel/ku4-carousel.d.ts +3 -2
- package/dist/types/components/ku4-carousel-controls/ku4-carousel-controls.d.ts +1 -0
- package/dist/types/components/ku4-carousel-slide/ku4-carousel-slide.d.ts +6 -0
- package/dist/types/components.d.ts +10 -2
- package/package.json +15 -15
- package/react/index.js +1 -1
- package/react/index.mjs +1 -1
- package/vue/index.js +1 -1
- package/vue/index.mjs +1 -1
- package/vue3/index.js +1 -1
- package/vue3/index.mjs +1 -1
- package/dist/esm-es5/uid-15f8c937.js +0 -1
- package/dist/ku4web-components/p-7a47027b.entry.js +0 -1
- package/dist/ku4web-components/p-b590da20.entry.js +0 -1
- package/dist/ku4web-components/p-be7890a1.system.js +0 -1
- package/dist/ku4web-components/p-cbbb4b1b.js +0 -1
- package/dist/ku4web-components/p-eb58b04b.system.js +0 -1
@@ -0,0 +1,112 @@
|
|
1
|
+
import { Component, Prop, Element, h } from '@stencil/core';
|
2
|
+
import { Assert } from 'ku4es-kernel';
|
3
|
+
/**
|
4
|
+
* @description ku4-carousel-controls
|
5
|
+
*/
|
6
|
+
export class Ku4CarouselControls {
|
7
|
+
constructor() {
|
8
|
+
this.carousel = document.getElementById(this.for);
|
9
|
+
this.handleSlide = this.handleSlide.bind(this);
|
10
|
+
this.handleChange = this.handleChange.bind(this);
|
11
|
+
}
|
12
|
+
get slides() {
|
13
|
+
return [].slice.call(this.carousel.children);
|
14
|
+
}
|
15
|
+
get controls() {
|
16
|
+
return [].slice.call(this.host.children);
|
17
|
+
}
|
18
|
+
handleSlide(e) {
|
19
|
+
this.controls.forEach((control) => {
|
20
|
+
control.removeAttribute('current');
|
21
|
+
control.checked = false;
|
22
|
+
});
|
23
|
+
try {
|
24
|
+
const current = this.controls[e.detail - 1];
|
25
|
+
current.setAttribute('current', e.detail);
|
26
|
+
current.checked = true;
|
27
|
+
}
|
28
|
+
catch (e) {
|
29
|
+
/* Fail silently */
|
30
|
+
}
|
31
|
+
}
|
32
|
+
async handleChange(e) {
|
33
|
+
const { carousel, slides, controls } = this;
|
34
|
+
const slideValue = e.target.getAttribute('slide');
|
35
|
+
const n = isNaN(slideValue)
|
36
|
+
? slides.findIndex(slide => slide.getAttribute('name') === slideValue) + 1
|
37
|
+
: parseInt(slideValue);
|
38
|
+
const slide = isNaN(n) ? controls.indexOf(e.target) + 1 : n;
|
39
|
+
await carousel.slideTo(slide);
|
40
|
+
try {
|
41
|
+
e.target.setAttribute('current', slide);
|
42
|
+
}
|
43
|
+
catch (e) {
|
44
|
+
/* Fail silently */
|
45
|
+
}
|
46
|
+
}
|
47
|
+
componentWillLoad() {
|
48
|
+
const { carousel, controls } = this;
|
49
|
+
try {
|
50
|
+
carousel.addEventListener('slide', this.handleSlide, { passive: true });
|
51
|
+
controls.forEach((control, i) => {
|
52
|
+
if (i === 0) {
|
53
|
+
control.setAttribute('current', i + 1);
|
54
|
+
}
|
55
|
+
if (control.nodeName === 'INPUT') {
|
56
|
+
control.addEventListener('change', this.handleChange);
|
57
|
+
}
|
58
|
+
else {
|
59
|
+
control.addEventListener('keyup', this.handleChange);
|
60
|
+
control.addEventListener('mouseup', this.handleChange, { passive: true });
|
61
|
+
control.addEventListener('touchstart', this.handleChange, { passive: true });
|
62
|
+
}
|
63
|
+
});
|
64
|
+
}
|
65
|
+
catch (e) {
|
66
|
+
if (!Assert.exists(carousel)) {
|
67
|
+
throw new ReferenceError('ku4-carousel-controls must connect to a ku4-carousel.');
|
68
|
+
}
|
69
|
+
}
|
70
|
+
}
|
71
|
+
disconnectedCallback() {
|
72
|
+
const { carousel, controls } = this;
|
73
|
+
carousel.removeEventListener('slide', this.handleSlide);
|
74
|
+
controls.forEach((control) => {
|
75
|
+
control.removeEventListener('change', this.handleChange);
|
76
|
+
control.removeEventListener('keyup', this.handleChange);
|
77
|
+
control.removeEventListener('mouseup', this.handleChange);
|
78
|
+
control.removeEventListener('touchstart', this.handleChange);
|
79
|
+
});
|
80
|
+
}
|
81
|
+
render() {
|
82
|
+
return h("slot", null);
|
83
|
+
}
|
84
|
+
static get is() { return "ku4-carousel-controls"; }
|
85
|
+
static get encapsulation() { return "shadow"; }
|
86
|
+
static get originalStyleUrls() { return {
|
87
|
+
"$": ["ku4-carousel-controls.scss"]
|
88
|
+
}; }
|
89
|
+
static get styleUrls() { return {
|
90
|
+
"$": ["ku4-carousel-controls.css"]
|
91
|
+
}; }
|
92
|
+
static get properties() { return {
|
93
|
+
"for": {
|
94
|
+
"type": "string",
|
95
|
+
"mutable": false,
|
96
|
+
"complexType": {
|
97
|
+
"original": "string",
|
98
|
+
"resolved": "string",
|
99
|
+
"references": {}
|
100
|
+
},
|
101
|
+
"required": false,
|
102
|
+
"optional": false,
|
103
|
+
"docs": {
|
104
|
+
"tags": [],
|
105
|
+
"text": "Controls for carousel having id of value"
|
106
|
+
},
|
107
|
+
"attribute": "for",
|
108
|
+
"reflect": false
|
109
|
+
}
|
110
|
+
}; }
|
111
|
+
static get elementRef() { return "host"; }
|
112
|
+
}
|
@@ -0,0 +1,159 @@
|
|
1
|
+
import { Component, Host, State, Method, h, Prop, } from '@stencil/core';
|
2
|
+
/**
|
3
|
+
* @description ku4-carousel-slide
|
4
|
+
*/
|
5
|
+
export class Ku4CarouselSlide {
|
6
|
+
constructor() {
|
7
|
+
this.classList = '';
|
8
|
+
}
|
9
|
+
/**
|
10
|
+
* Move this slide in to view.
|
11
|
+
* @param {string} direction - Direction to move.
|
12
|
+
*/
|
13
|
+
async slideIn(direction) {
|
14
|
+
this.active = true;
|
15
|
+
this.classList = `active ${direction}`;
|
16
|
+
}
|
17
|
+
/**
|
18
|
+
* Move this slide out of view.
|
19
|
+
* @param {string} direction - Direction to move.
|
20
|
+
*/
|
21
|
+
async slideOut(direction) {
|
22
|
+
this.active = false;
|
23
|
+
this.classList = `inactive ${direction}`;
|
24
|
+
}
|
25
|
+
/**
|
26
|
+
* Set this slide to active.
|
27
|
+
*/
|
28
|
+
async activate() {
|
29
|
+
this.active = true;
|
30
|
+
this.classList = 'active';
|
31
|
+
}
|
32
|
+
/**
|
33
|
+
* Set this slide to inactive.
|
34
|
+
*/
|
35
|
+
async deactivate() {
|
36
|
+
this.active = false;
|
37
|
+
this.classList = '';
|
38
|
+
}
|
39
|
+
render() {
|
40
|
+
const { active, classList } = this;
|
41
|
+
return (h(Host, { class: `${classList}`, "aria-hidden": active ? 'false' : 'true', "aria-roledescription": "slide" },
|
42
|
+
h("slot", null)));
|
43
|
+
}
|
44
|
+
static get is() { return "ku4-carousel-slide"; }
|
45
|
+
static get encapsulation() { return "shadow"; }
|
46
|
+
static get originalStyleUrls() { return {
|
47
|
+
"$": ["ku4-carousel-slide.scss"]
|
48
|
+
}; }
|
49
|
+
static get styleUrls() { return {
|
50
|
+
"$": ["ku4-carousel-slide.css"]
|
51
|
+
}; }
|
52
|
+
static get properties() { return {
|
53
|
+
"name": {
|
54
|
+
"type": "any",
|
55
|
+
"mutable": true,
|
56
|
+
"complexType": {
|
57
|
+
"original": "any",
|
58
|
+
"resolved": "any",
|
59
|
+
"references": {}
|
60
|
+
},
|
61
|
+
"required": false,
|
62
|
+
"optional": false,
|
63
|
+
"docs": {
|
64
|
+
"tags": [],
|
65
|
+
"text": "Name of slide. The value of this property can be used as the\nvalue of the \"slide\" attribute of a ku4-carousel-control to\ntarget this slide as the active slide for the target ku4-carousel-control"
|
66
|
+
},
|
67
|
+
"attribute": "name",
|
68
|
+
"reflect": true
|
69
|
+
}
|
70
|
+
}; }
|
71
|
+
static get states() { return {
|
72
|
+
"active": {},
|
73
|
+
"classList": {}
|
74
|
+
}; }
|
75
|
+
static get methods() { return {
|
76
|
+
"slideIn": {
|
77
|
+
"complexType": {
|
78
|
+
"signature": "(direction: 'prev' | 'next') => Promise<void>",
|
79
|
+
"parameters": [{
|
80
|
+
"tags": [{
|
81
|
+
"name": "param",
|
82
|
+
"text": "direction - Direction to move."
|
83
|
+
}],
|
84
|
+
"text": "- Direction to move."
|
85
|
+
}],
|
86
|
+
"references": {
|
87
|
+
"Promise": {
|
88
|
+
"location": "global"
|
89
|
+
}
|
90
|
+
},
|
91
|
+
"return": "Promise<void>"
|
92
|
+
},
|
93
|
+
"docs": {
|
94
|
+
"text": "Move this slide in to view.",
|
95
|
+
"tags": [{
|
96
|
+
"name": "param",
|
97
|
+
"text": "direction - Direction to move."
|
98
|
+
}]
|
99
|
+
}
|
100
|
+
},
|
101
|
+
"slideOut": {
|
102
|
+
"complexType": {
|
103
|
+
"signature": "(direction: 'prev' | 'next') => Promise<void>",
|
104
|
+
"parameters": [{
|
105
|
+
"tags": [{
|
106
|
+
"name": "param",
|
107
|
+
"text": "direction - Direction to move."
|
108
|
+
}],
|
109
|
+
"text": "- Direction to move."
|
110
|
+
}],
|
111
|
+
"references": {
|
112
|
+
"Promise": {
|
113
|
+
"location": "global"
|
114
|
+
}
|
115
|
+
},
|
116
|
+
"return": "Promise<void>"
|
117
|
+
},
|
118
|
+
"docs": {
|
119
|
+
"text": "Move this slide out of view.",
|
120
|
+
"tags": [{
|
121
|
+
"name": "param",
|
122
|
+
"text": "direction - Direction to move."
|
123
|
+
}]
|
124
|
+
}
|
125
|
+
},
|
126
|
+
"activate": {
|
127
|
+
"complexType": {
|
128
|
+
"signature": "() => Promise<void>",
|
129
|
+
"parameters": [],
|
130
|
+
"references": {
|
131
|
+
"Promise": {
|
132
|
+
"location": "global"
|
133
|
+
}
|
134
|
+
},
|
135
|
+
"return": "Promise<void>"
|
136
|
+
},
|
137
|
+
"docs": {
|
138
|
+
"text": "Set this slide to active.",
|
139
|
+
"tags": []
|
140
|
+
}
|
141
|
+
},
|
142
|
+
"deactivate": {
|
143
|
+
"complexType": {
|
144
|
+
"signature": "() => Promise<void>",
|
145
|
+
"parameters": [],
|
146
|
+
"references": {
|
147
|
+
"Promise": {
|
148
|
+
"location": "global"
|
149
|
+
}
|
150
|
+
},
|
151
|
+
"return": "Promise<void>"
|
152
|
+
},
|
153
|
+
"docs": {
|
154
|
+
"text": "Set this slide to inactive.",
|
155
|
+
"tags": []
|
156
|
+
}
|
157
|
+
}
|
158
|
+
}; }
|
159
|
+
}
|