ku4web-components 6.5.6 → 6.5.7
Sign up to get free protection for your applications and to get access to all the features.
- package/angular/index.js +3 -1
- package/angular/index.mjs +1 -1
- package/dist/cjs/{index-e69a9e98.js → index-4e2544a7.js} +10 -8
- package/dist/cjs/index-ad5278ca.js +10 -0
- package/dist/cjs/ku4-carousel-controls.cjs.entry.js +2 -2
- package/dist/cjs/ku4-carousel-slide.cjs.entry.js +1 -1
- package/dist/cjs/ku4-carousel.cjs.entry.js +3 -3
- 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 +14 -43
- 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 +7 -102
- package/dist/cjs/loader.cjs.js +2 -18
- package/dist/cjs/{shadow-css-42acdd0e.js → shadow-css-abc19485.js} +2 -3
- package/dist/esm/{index-3a223c58.js → index-e5173978.js} +10 -8
- package/dist/esm/index-f06d1dc2.js +3 -0
- package/dist/esm/ku4-carousel-controls.entry.js +2 -2
- package/dist/esm/ku4-carousel-slide.entry.js +1 -1
- package/dist/esm/ku4-carousel.entry.js +3 -3
- 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 +5 -34
- 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 +7 -102
- package/dist/esm/loader.js +2 -18
- package/dist/{ku4web-components/shadow-css-38a1326b.js → esm/shadow-css-02866686.js} +2 -3
- package/dist/esm-es5/{index-3a223c58.js → index-e5173978.js} +2 -1
- package/dist/esm-es5/index-f06d1dc2.js +1 -0
- 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-02866686.js +12 -0
- package/dist/index.js +1 -1
- package/dist/ku4web-components/index.esm.js +0 -1
- package/dist/ku4web-components/ku4web-components.css +1 -299
- package/dist/ku4web-components/ku4web-components.esm.js +1 -129
- package/dist/ku4web-components/ku4web-components.js +1 -1
- package/dist/ku4web-components/{p-96033515.system.entry.js → p-02eef79e.system.entry.js} +1 -1
- package/dist/ku4web-components/p-06b0b9bc.js +2 -0
- package/dist/ku4web-components/{p-2ee63f57.system.js → p-0b3bdc7f.system.js} +1 -1
- package/dist/ku4web-components/{p-b1680ef4.entry.js → p-155f4481.entry.js} +1 -1
- package/dist/ku4web-components/{p-c5448cc1.system.entry.js → p-2723d2b6.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-e31755cd.system.entry.js → p-2c79be2e.system.entry.js} +1 -1
- package/dist/ku4web-components/p-2df8696a.entry.js +1 -0
- package/dist/ku4web-components/{p-046b3990.entry.js → p-364b562f.entry.js} +1 -1
- package/dist/ku4web-components/{p-bb698020.system.entry.js → p-3ba44adc.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-4ecd9b1d.system.entry.js → p-42d52222.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-0f1646ca.system.entry.js → p-4733f8b6.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-8173d389.system.entry.js → p-48b0bb76.system.entry.js} +1 -1
- package/dist/ku4web-components/p-5109ce9d.system.js +1 -0
- package/dist/ku4web-components/{p-ae7ce1fe.system.entry.js → p-55a4a947.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-d0f3bec4.js → p-5a51f33e.js} +1 -1
- package/dist/ku4web-components/{p-e11fbd79.entry.js → p-5c296352.entry.js} +1 -1
- package/dist/ku4web-components/{p-3deab7f6.system.entry.js → p-5e666fe4.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-bb5410b5.entry.js → p-6028fc6f.entry.js} +1 -1
- package/dist/ku4web-components/{p-72be654e.system.entry.js → p-65643a0b.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-4da33ea7.entry.js → p-67a2204b.entry.js} +1 -1
- package/dist/ku4web-components/{p-7b6ca6a8.entry.js → p-6ab4928a.entry.js} +1 -1
- package/dist/ku4web-components/{p-cfd1b93c.entry.js → p-6e918f89.entry.js} +1 -1
- package/dist/ku4web-components/{p-1e19bc01.system.entry.js → p-71cbf981.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-7b93a362.system.entry.js → p-7260c454.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-5e628256.entry.js → p-731cff07.entry.js} +1 -1
- package/dist/ku4web-components/{p-fd3d3f56.system.js → p-8f2e658a.system.js} +2 -1
- package/dist/ku4web-components/{p-9e2f37cc.entry.js → p-939f438f.entry.js} +1 -1
- package/dist/ku4web-components/{p-6509d3e7.system.entry.js → p-9a6aa058.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-da8a8b83.entry.js → p-9db782b0.entry.js} +1 -1
- package/dist/ku4web-components/{p-0b777b57.entry.js → p-9ebb7181.entry.js} +1 -1
- package/dist/ku4web-components/{p-d42bd64d.entry.js → p-9fcb26bb.entry.js} +1 -1
- package/dist/ku4web-components/{p-27647af0.system.entry.js → p-a3b9acd3.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-de3b2ba1.entry.js → p-a45df4c1.entry.js} +1 -1
- package/dist/ku4web-components/{p-17c2a7ac.system.entry.js → p-b2512286.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-ea1961f5.entry.js → p-b334f07e.entry.js} +1 -1
- package/dist/ku4web-components/{p-a13796dc.system.entry.js → p-bc388bcc.system.entry.js} +1 -1
- package/dist/ku4web-components/p-c00ad706.system.js +13 -0
- package/dist/ku4web-components/{p-6515c623.system.entry.js → p-c0dce18b.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-1abe6f26.entry.js → p-c46a6ff5.entry.js} +1 -1
- package/dist/ku4web-components/p-ccf9d584.js +1 -0
- package/dist/ku4web-components/{p-9778d082.system.entry.js → p-e4693cda.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-d4877fdf.entry.js → p-e5170dc1.entry.js} +1 -1
- package/dist/ku4web-components/{p-0a68e802.entry.js → p-e65f0ac5.entry.js} +1 -1
- package/dist/ku4web-components/{p-1a09ae2c.entry.js → p-ea1b0df6.entry.js} +1 -1
- package/dist/ku4web-components/{p-5e8921ef.system.entry.js → p-f0dbdb77.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-9b01a63a.entry.js → p-f76dfee1.entry.js} +1 -1
- package/dist/ku4web-components/{p-a7ab7c23.system.entry.js → p-faa0713d.system.entry.js} +1 -1
- package/dist/types/components.d.ts +27 -7
- package/package.json +37 -30
- package/react/index.js +3 -1
- package/react/index.mjs +1 -1
- package/vue/index.js +3 -1
- package/vue/index.mjs +1 -1
- package/vue3/index.js +3 -1
- package/vue3/index.mjs +1 -1
- package/dist/cjs/app-globals-3a1e7e63.js +0 -5
- package/dist/cjs/css-shim-f1391d35.js +0 -6
- package/dist/cjs/dom-5345ed9a.js +0 -75
- package/dist/cjs/index-065185f8.js +0 -3093
- package/dist/cjs/index-16f16ed9.js +0 -14
- package/dist/cjs/index-436596bf.js +0 -10
- package/dist/cjs/index-49d3746b.js +0 -10
- package/dist/cjs/uid-a1348ea5.js +0 -11
- package/dist/collection/capabilities/a11y/aria.js +0 -26
- package/dist/collection/capabilities/angular/index.js +0 -24
- package/dist/collection/capabilities/decorators/deprecated.js +0 -20
- package/dist/collection/capabilities/decorators/index.js +0 -3
- package/dist/collection/capabilities/decorators/memoize.js +0 -7
- package/dist/collection/capabilities/dom/isFocusable.js +0 -7
- package/dist/collection/capabilities/dom/queryFocusable.js +0 -2
- package/dist/collection/capabilities/identity/uid.js +0 -6
- package/dist/collection/capabilities/mask/index.js +0 -5
- package/dist/collection/capabilities/mask/patterns/date.js +0 -40
- package/dist/collection/capabilities/mask/patterns/index.js +0 -7
- package/dist/collection/capabilities/react/index.js +0 -25
- package/dist/collection/capabilities/testing/html.js +0 -14
- package/dist/collection/capabilities/testing/styles.js +0 -14
- package/dist/collection/capabilities/vue/index.js +0 -28
- package/dist/collection/capabilities/vue3/index.js +0 -26
- package/dist/collection/collection-manifest.json +0 -31
- package/dist/collection/components/ku4-carousel/ku4-carousel.css +0 -221
- package/dist/collection/components/ku4-carousel/ku4-carousel.js +0 -369
- package/dist/collection/components/ku4-carousel-controls/ku4-carousel-controls.css +0 -32
- package/dist/collection/components/ku4-carousel-controls/ku4-carousel-controls.js +0 -112
- package/dist/collection/components/ku4-carousel-slide/ku4-carousel-slide.css +0 -3
- package/dist/collection/components/ku4-carousel-slide/ku4-carousel-slide.js +0 -159
- package/dist/collection/components/ku4-col/ku4-col.css +0 -601
- package/dist/collection/components/ku4-col/ku4-col.js +0 -288
- package/dist/collection/components/ku4-drawer/ku4-drawer.css +0 -56
- package/dist/collection/components/ku4-drawer/ku4-drawer.js +0 -163
- package/dist/collection/components/ku4-feature/ku4-feature.js +0 -70
- package/dist/collection/components/ku4-focus-trap/ku4-focus-trap.css +0 -3
- package/dist/collection/components/ku4-focus-trap/ku4-focus-trap.js +0 -441
- package/dist/collection/components/ku4-form/ku4-form.js +0 -265
- package/dist/collection/components/ku4-grid/ku4-grid.css +0 -751
- package/dist/collection/components/ku4-grid/ku4-grid.js +0 -408
- package/dist/collection/components/ku4-label/ku4-label.css +0 -36
- package/dist/collection/components/ku4-label/ku4-label.js +0 -115
- package/dist/collection/components/ku4-mask/ku4-mask.css +0 -3
- package/dist/collection/components/ku4-mask/ku4-mask.js +0 -459
- package/dist/collection/components/ku4-modal/ku4-modal.css +0 -85
- package/dist/collection/components/ku4-modal/ku4-modal.js +0 -231
- package/dist/collection/components/ku4-panel/ku4-panel.css +0 -14
- package/dist/collection/components/ku4-panel/ku4-panel.js +0 -119
- package/dist/collection/components/ku4-preview/ku4-preview.css +0 -23
- package/dist/collection/components/ku4-preview/ku4-preview.js +0 -266
- package/dist/collection/components/ku4-tab/ku4-tab.css +0 -82
- package/dist/collection/components/ku4-tab/ku4-tab.js +0 -191
- package/dist/collection/components/ku4-tab-list/ku4-tab-list.css +0 -6
- package/dist/collection/components/ku4-tab-list/ku4-tab-list.js +0 -118
- package/dist/collection/components/ku4-tab-panel/ku4-tab-panel.css +0 -26
- package/dist/collection/components/ku4-tab-panel/ku4-tab-panel.js +0 -166
- package/dist/collection/components/ku4-table/ku4-table.css +0 -116
- package/dist/collection/components/ku4-table/ku4-table.js +0 -120
- package/dist/collection/components/ku4-tooltip/ku4-tooltip.css +0 -56
- package/dist/collection/components/ku4-tooltip/ku4-tooltip.js +0 -274
- package/dist/collection/components/ku4-validation/ku4-validation.css +0 -19
- package/dist/collection/components/ku4-validation/ku4-validation.js +0 -364
- package/dist/collection/components/ku4-validation/validate.js +0 -14
- package/dist/collection/index.js +0 -1
- package/dist/collection/security.js +0 -27
- package/dist/esm/app-globals-0f993ce5.js +0 -3
- package/dist/esm/css-shim-10e6e2ae.js +0 -4
- package/dist/esm/dom-7cd9cf71.js +0 -73
- package/dist/esm/index-5448a818.js +0 -3
- package/dist/esm/index-6cfd87e4.js +0 -3
- package/dist/esm/index-a02dcfc8.js +0 -3057
- package/dist/esm/index-aa119486.js +0 -3
- package/dist/esm/shadow-css-38a1326b.js +0 -388
- package/dist/esm/uid-3716c2c4.js +0 -9
- package/dist/esm-es5/index-5448a818.js +0 -1
- package/dist/esm-es5/shadow-css-38a1326b.js +0 -12
- package/dist/ku4web-components/app-globals-0f993ce5.js +0 -3
- package/dist/ku4web-components/app-globals-497eb362.system.js +0 -1
- package/dist/ku4web-components/css-shim-10e6e2ae.js +0 -4
- package/dist/ku4web-components/css-shim-c8dd4551.system.js +0 -1
- package/dist/ku4web-components/dom-67d1e45e.system.js +0 -21
- package/dist/ku4web-components/dom-7cd9cf71.js +0 -73
- package/dist/ku4web-components/index-1c93827a.system.js +0 -1
- package/dist/ku4web-components/index-29f2b09f.system.js +0 -1
- package/dist/ku4web-components/index-5d0cb00d.system.js +0 -1
- package/dist/ku4web-components/index-6cfd87e4.js +0 -3
- package/dist/ku4web-components/index-a02dcfc8.js +0 -3057
- package/dist/ku4web-components/index-aa119486.js +0 -3
- package/dist/ku4web-components/index.system.js +0 -1
- package/dist/ku4web-components/ku4-carousel-controls.entry.js +0 -89
- package/dist/ku4web-components/ku4-carousel-controls.system.entry.js +0 -1
- package/dist/ku4web-components/ku4-carousel-slide.entry.js +0 -47
- package/dist/ku4web-components/ku4-carousel-slide.system.entry.js +0 -1
- package/dist/ku4web-components/ku4-carousel.entry.js +0 -175
- package/dist/ku4web-components/ku4-carousel.system.entry.js +0 -1
- package/dist/ku4web-components/ku4-col.entry.js +0 -75
- package/dist/ku4web-components/ku4-col.system.entry.js +0 -1
- package/dist/ku4web-components/ku4-drawer.entry.js +0 -35
- package/dist/ku4web-components/ku4-drawer.system.entry.js +0 -1
- package/dist/ku4web-components/ku4-feature.entry.js +0 -29
- package/dist/ku4web-components/ku4-feature.system.entry.js +0 -1
- package/dist/ku4web-components/ku4-focus-trap.entry.js +0 -323
- package/dist/ku4web-components/ku4-focus-trap.system.entry.js +0 -1
- package/dist/ku4web-components/ku4-form.entry.js +0 -120
- package/dist/ku4web-components/ku4-form.system.entry.js +0 -1
- package/dist/ku4web-components/ku4-grid.entry.js +0 -108
- package/dist/ku4web-components/ku4-grid.system.entry.js +0 -1
- package/dist/ku4web-components/ku4-label.entry.js +0 -70
- package/dist/ku4web-components/ku4-label.system.entry.js +0 -1
- package/dist/ku4web-components/ku4-mask.entry.js +0 -343
- package/dist/ku4web-components/ku4-mask.system.entry.js +0 -1
- package/dist/ku4web-components/ku4-modal.entry.js +0 -80
- package/dist/ku4web-components/ku4-modal.system.entry.js +0 -1
- package/dist/ku4web-components/ku4-panel.entry.js +0 -49
- package/dist/ku4web-components/ku4-panel.system.entry.js +0 -1
- package/dist/ku4web-components/ku4-preview.entry.js +0 -128
- package/dist/ku4web-components/ku4-preview.system.entry.js +0 -1
- package/dist/ku4web-components/ku4-tab-list.entry.js +0 -76
- package/dist/ku4web-components/ku4-tab-list.system.entry.js +0 -1
- package/dist/ku4web-components/ku4-tab-panel.entry.js +0 -72
- package/dist/ku4web-components/ku4-tab-panel.system.entry.js +0 -1
- package/dist/ku4web-components/ku4-tab.entry.js +0 -63
- package/dist/ku4web-components/ku4-tab.system.entry.js +0 -1
- package/dist/ku4web-components/ku4-table.entry.js +0 -79
- package/dist/ku4web-components/ku4-table.system.entry.js +0 -1
- package/dist/ku4web-components/ku4-tooltip.entry.js +0 -120
- package/dist/ku4web-components/ku4-tooltip.system.entry.js +0 -1
- package/dist/ku4web-components/ku4-validation.entry.js +0 -162
- package/dist/ku4web-components/ku4-validation.system.entry.js +0 -1
- package/dist/ku4web-components/ku4web-components.system.js +0 -1
- package/dist/ku4web-components/p-016a7b4e.js +0 -1
- package/dist/ku4web-components/p-0de744b1.system.js +0 -1
- package/dist/ku4web-components/p-791e2dfc.js +0 -1
- package/dist/ku4web-components/p-ac7884f3.entry.js +0 -1
- package/dist/ku4web-components/p-e7cd2284.system.js +0 -13
- package/dist/ku4web-components/shadow-css-7fde17ac.system.js +0 -13
- package/dist/ku4web-components/uid-2ed9f227.system.js +0 -1
- package/dist/ku4web-components/uid-3716c2c4.js +0 -9
@@ -1,29 +0,0 @@
|
|
1
|
-
import { r as registerInstance, h, f as Host, g as getElement } from './index-a02dcfc8.js';
|
2
|
-
import { t } from './index-6cfd87e4.js';
|
3
|
-
|
4
|
-
const Ku4Feature = class {
|
5
|
-
constructor(hostRef) {
|
6
|
-
registerInstance(this, hostRef);
|
7
|
-
/**
|
8
|
-
* A function or method that returns a boolean.
|
9
|
-
* A return value of true will turn on the this
|
10
|
-
* feature. (optional)
|
11
|
-
*/
|
12
|
-
this.policy = '';
|
13
|
-
this.enabled = false;
|
14
|
-
const policy = this.policy.trim();
|
15
|
-
this.featurePolicy = t.isNullOrEmpty(policy)
|
16
|
-
? () => false
|
17
|
-
: new Function((/^return/.test(policy) ? policy : `return ${policy}`));
|
18
|
-
}
|
19
|
-
componentWillLoad() {
|
20
|
-
const { on, featurePolicy } = this;
|
21
|
-
on || featurePolicy.call(this.host)
|
22
|
-
? this.render = () => h("slot", null)
|
23
|
-
: this.host.parentNode.removeChild(this.host);
|
24
|
-
}
|
25
|
-
render() { return h(Host, null); }
|
26
|
-
get host() { return getElement(this); }
|
27
|
-
};
|
28
|
-
|
29
|
-
export { Ku4Feature as ku4_feature };
|
@@ -1 +0,0 @@
|
|
1
|
-
System.register(["./index-29f2b09f.system.js","./index-5d0cb00d.system.js"],(function(t){"use strict";var e,n,r,i,o;return{setters:[function(t){e=t.r;n=t.h;r=t.f;i=t.g},function(t){o=t.t}],execute:function(){var s=t("ku4_feature",function(){function t(t){e(this,t);this.policy="";this.enabled=false;var n=this.policy.trim();this.featurePolicy=o.isNullOrEmpty(n)?function(){return false}:new Function(/^return/.test(n)?n:"return ".concat(n))}t.prototype.componentWillLoad=function(){var t=this,e=t.on,r=t.featurePolicy;e||r.call(this.host)?this.render=function(){return n("slot",null)}:this.host.parentNode.removeChild(this.host)};t.prototype.render=function(){return n(r,null)};Object.defineProperty(t.prototype,"host",{get:function(){return i(this)},enumerable:false,configurable:true});return t}())}}}));
|
@@ -1,323 +0,0 @@
|
|
1
|
-
import { r as registerInstance, h, g as getElement } from './index-a02dcfc8.js';
|
2
|
-
import { t, o } from './index-6cfd87e4.js';
|
3
|
-
import { K as Key, E as Event } from './index-aa119486.js';
|
4
|
-
|
5
|
-
/**
|
6
|
-
* Sets aria-hidden attribute for passed elements
|
7
|
-
* @param {Array} elements - List of elements to set aria-hidden on
|
8
|
-
* @param {boolean} [value] - Optional value for aria-hidden.
|
9
|
-
* No value will set to previous value if available.
|
10
|
-
*/
|
11
|
-
const ariaHidden = (elements, value) => {
|
12
|
-
if (!value) {
|
13
|
-
// eslint-disable-next-line @stencil/ban-side-effects
|
14
|
-
elements.forEach((element) => {
|
15
|
-
if (!element.currentAriaHidden) {
|
16
|
-
element.removeAttribute('aria-hidden');
|
17
|
-
}
|
18
|
-
else {
|
19
|
-
element.setAttribute('aria-hidden', element.currentAriaHidden);
|
20
|
-
}
|
21
|
-
});
|
22
|
-
}
|
23
|
-
else {
|
24
|
-
// eslint-disable-next-line @stencil/ban-side-effects
|
25
|
-
elements.forEach((element) => {
|
26
|
-
element.currentAriaHidden = element.getAttribute('aria-hidden');
|
27
|
-
element.setAttribute('aria-hidden', value);
|
28
|
-
});
|
29
|
-
}
|
30
|
-
};
|
31
|
-
|
32
|
-
const focusableTags = ['A', 'BUTTON', 'INPUT', 'SELECT', 'TEXTAREA'];
|
33
|
-
const isFocusable = (element) => {
|
34
|
-
const tabindex = element.getAttribute('tabindex');
|
35
|
-
return (focusableTags.includes(element.tagName.toUpperCase()) ||
|
36
|
-
element.getAttribute('href')) &&
|
37
|
-
(!tabindex || isNaN(tabindex) || parseInt(tabindex) > -1);
|
38
|
-
};
|
39
|
-
|
40
|
-
const queryFocusable = element => [].slice.call(element.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));
|
41
|
-
const queryTabbable = element => [].slice.call(element.querySelectorAll(':not([tabindex="-1"])'));
|
42
|
-
|
43
|
-
const ku4FocusTrapCss = ":host{position:static}";
|
44
|
-
|
45
|
-
const { tab } = Key;
|
46
|
-
const tabShift = Key.tab.shift;
|
47
|
-
const tabAlt = Key.tab.alt;
|
48
|
-
const tabAltShift = Key.tab.alt.shift;
|
49
|
-
const Ku4FocusTrap = class {
|
50
|
-
constructor(hostRef) {
|
51
|
-
registerInstance(this, hostRef);
|
52
|
-
this.iframes = [];
|
53
|
-
/**
|
54
|
-
* Focus trap will be active when true.
|
55
|
-
*/
|
56
|
-
this.active = false;
|
57
|
-
this.handleKeyDown = this.handleKeyDown.bind(this);
|
58
|
-
this.handleKeyUp = this.handleKeyUp.bind(this);
|
59
|
-
this.handleMouse = this.handleMouse.bind(this);
|
60
|
-
}
|
61
|
-
activeHandler(value) {
|
62
|
-
value ? this.handleActivate() : this.handleDeactivate();
|
63
|
-
}
|
64
|
-
/**
|
65
|
-
* Activate focus trap
|
66
|
-
* @param {Element} [element] - Element to return focus to when trap is deactivated.
|
67
|
-
*/
|
68
|
-
async activate(element) {
|
69
|
-
this.lastActiveElement = element || document.querySelector(this.return || null);
|
70
|
-
this.active = true;
|
71
|
-
}
|
72
|
-
/**
|
73
|
-
* Deactivate focus trap.
|
74
|
-
*/
|
75
|
-
async deactivate() {
|
76
|
-
this.active = false;
|
77
|
-
}
|
78
|
-
handleActivate() {
|
79
|
-
this.lastActiveElement = this.lastActiveElement || document.activeElement;
|
80
|
-
if (this.lastActiveElement && this.lastActiveElement.blur) {
|
81
|
-
this.lastActiveElement.blur();
|
82
|
-
}
|
83
|
-
this.addEventListeners(this.elements);
|
84
|
-
ariaHidden(this.outerElements, true);
|
85
|
-
window.requestAnimationFrame(() => {
|
86
|
-
const element = (document.querySelector(this.initial || null) ||
|
87
|
-
this.focusableElements[0] ||
|
88
|
-
this.trapElements[0]);
|
89
|
-
element.blur();
|
90
|
-
element.focus();
|
91
|
-
this.activateTraps();
|
92
|
-
});
|
93
|
-
}
|
94
|
-
handleDeactivate() {
|
95
|
-
this.removeEventListeners(this.elements);
|
96
|
-
this.deactivateTraps();
|
97
|
-
ariaHidden(this.outerElements);
|
98
|
-
if (this.lastActiveElement && this.lastActiveElement.focus) {
|
99
|
-
this.lastActiveElement.focus();
|
100
|
-
}
|
101
|
-
this.lastActiveElement = null;
|
102
|
-
}
|
103
|
-
// Handles keydown and mutes the event if it occurs on a focusable
|
104
|
-
// item that is in the focus trap. This allows this block to force
|
105
|
-
// the decision as to who will get next focus and not let that
|
106
|
-
// decisioning fall out to the browser.
|
107
|
-
handleKeyDown(e) {
|
108
|
-
if ((tabShift.didFire(e) || tabAltShift.didFire(e))) {
|
109
|
-
try {
|
110
|
-
if (this.iframes.length > 0 && (this.trapElements[1] === e.target ||
|
111
|
-
!t.isNull(e.target.getAttribute('ku4-focus-wrap')) ||
|
112
|
-
this.iframes.some(iframe => iframe.contains(e.target)))) {
|
113
|
-
return;
|
114
|
-
}
|
115
|
-
if (this.trapElements[0] === e.target) {
|
116
|
-
this.trapElements[1].focus();
|
117
|
-
return Event.mute(e);
|
118
|
-
}
|
119
|
-
const nextIndex = this.focusableElements.indexOf(e.target) - 1;
|
120
|
-
const next = nextIndex < 0 ? this.focusableElements.length - 1 : nextIndex;
|
121
|
-
this.focusableElements[next].focus();
|
122
|
-
return Event.mute(e);
|
123
|
-
}
|
124
|
-
catch (e) {
|
125
|
-
return Event.mute(e);
|
126
|
-
}
|
127
|
-
}
|
128
|
-
if ((tab.didFire(e) || tabAlt.didFire(e))) {
|
129
|
-
try {
|
130
|
-
if (this.iframes.length > 0 && (this.trapElements[0] === e.target ||
|
131
|
-
!t.isNull(e.target.getAttribute('ku4-focus-wrap')) ||
|
132
|
-
this.iframes.some(iframe => iframe.contains(e.target)))) {
|
133
|
-
return;
|
134
|
-
}
|
135
|
-
if (this.trapElements[1] === e.target) {
|
136
|
-
this.trapElements[0].focus();
|
137
|
-
return Event.mute(e);
|
138
|
-
}
|
139
|
-
const nextIndex = this.focusableElements.indexOf(e.target) + 1;
|
140
|
-
const next = nextIndex >= this.focusableElements.length ? 0 : nextIndex;
|
141
|
-
this.focusableElements[next].focus();
|
142
|
-
return Event.mute(e);
|
143
|
-
}
|
144
|
-
catch (e) {
|
145
|
-
return Event.mute(e);
|
146
|
-
}
|
147
|
-
}
|
148
|
-
}
|
149
|
-
// Handles keyup and mutes the event if it occurs on a focusable
|
150
|
-
// item that is in the focus trap. This allows for us to determine
|
151
|
-
// if we need to move to the next focusable if the key is released
|
152
|
-
// on one of the trapElements (the two dynamically created wrapper
|
153
|
-
// elements that create the trap);
|
154
|
-
handleKeyUp(e) {
|
155
|
-
const index = this.trapElements.indexOf(e.target);
|
156
|
-
if (index === 0 && (tabShift.didFire(e) || tabAltShift.didFire(e))) {
|
157
|
-
const element = this.focusableElements[this.focusableElements.length - 1] || this.trapElements[1];
|
158
|
-
element.focus();
|
159
|
-
return Event.mute(e);
|
160
|
-
}
|
161
|
-
if (index === 1 && (tab.didFire(e) || tabAlt.didFire(e))) {
|
162
|
-
const element = this.focusableElements[0] || this.trapElements[0];
|
163
|
-
element.focus();
|
164
|
-
return Event.mute(e);
|
165
|
-
}
|
166
|
-
}
|
167
|
-
// Prevents all mouse activity on any elements that are not focusable
|
168
|
-
// inside of the active trap.
|
169
|
-
handleMouse(e) {
|
170
|
-
if (!this.elements.some(element => element === e.target)) {
|
171
|
-
Event.mute(e);
|
172
|
-
}
|
173
|
-
}
|
174
|
-
addEventListeners(elements) {
|
175
|
-
elements.forEach(element => element.addEventListener('keydown', this.handleKeyDown, { passive: true }));
|
176
|
-
elements.forEach(element => element.addEventListener('keyup', this.handleKeyUp, { passive: true }));
|
177
|
-
window.addEventListener('click', this.handleMouse, { passive: true });
|
178
|
-
window.addEventListener('mousedown', this.handleMouse, { passive: true });
|
179
|
-
window.addEventListener('mouseup', this.handleMouse, { passive: true });
|
180
|
-
window.addEventListener('touchstart', this.handleMouse, { passive: true });
|
181
|
-
}
|
182
|
-
removeEventListeners(elements) {
|
183
|
-
elements.forEach(element => element.removeEventListener('keydown', this.handleKeyDown, true));
|
184
|
-
elements.forEach(element => element.removeEventListener('keyup', this.handleKeyUp, true));
|
185
|
-
window.removeEventListener('click', this.handleMouse, true);
|
186
|
-
window.removeEventListener('mousedown', this.handleMouse, true);
|
187
|
-
window.removeEventListener('mouseup', this.handleMouse, true);
|
188
|
-
window.addEventListener('touchstart', this.handleMouse, true);
|
189
|
-
}
|
190
|
-
activateTraps() {
|
191
|
-
this.setTraps(0);
|
192
|
-
}
|
193
|
-
deactivateTraps() {
|
194
|
-
this.setTraps(-1);
|
195
|
-
}
|
196
|
-
setTraps(value) {
|
197
|
-
[].slice.call(this.host.querySelectorAll('[ku4-focus-trap], [ku4-focus-wrap]'))
|
198
|
-
.forEach(element => element.setAttribute('tabindex', value));
|
199
|
-
}
|
200
|
-
wrap(element) {
|
201
|
-
const fragment = document.createDocumentFragment();
|
202
|
-
fragment.appendChild(this.createWrapTag());
|
203
|
-
fragment.appendChild(element.cloneNode());
|
204
|
-
fragment.appendChild(this.createWrapTag());
|
205
|
-
element.parentNode.replaceChild(fragment, element);
|
206
|
-
}
|
207
|
-
createTrapTag() {
|
208
|
-
return this.createTag('ku4-focus-trap');
|
209
|
-
}
|
210
|
-
createWrapTag() {
|
211
|
-
return this.createTag('ku4-focus-wrap');
|
212
|
-
}
|
213
|
-
createTag(type) {
|
214
|
-
const trap = document.createElement('button');
|
215
|
-
trap.setAttribute(type, '');
|
216
|
-
trap.setAttribute('tabindex', '0');
|
217
|
-
trap.setAttribute('aria-hidden', 'true');
|
218
|
-
trap.style.position = 'static';
|
219
|
-
trap.style.display = 'block';
|
220
|
-
trap.style.width = '0';
|
221
|
-
trap.style.height = '0';
|
222
|
-
trap.style.margin = '0';
|
223
|
-
trap.style.padding = '0';
|
224
|
-
trap.style.border = 'none';
|
225
|
-
trap.style.outline = 'none';
|
226
|
-
return trap;
|
227
|
-
}
|
228
|
-
initialize() {
|
229
|
-
// All elements in this focus-trap
|
230
|
-
const innerElements = [].slice.call(this.host.querySelectorAll('*'));
|
231
|
-
// May need to break this out as it is really included for the mouse events
|
232
|
-
// e.g. for an overlay on a modal to make that clickable that is make it
|
233
|
-
// so this does not include it for muting the mouse events. This component
|
234
|
-
// is very powerful in shutting everything down and needs to allow for
|
235
|
-
// the ability to let items be clickable.
|
236
|
-
const inclusions = [].slice.call(document.querySelectorAll(this.include || null) || []);
|
237
|
-
// May need to break this out as it is really here to explicitly exclude items from
|
238
|
-
// being read out by screen readers. That is make them hidden so that screen
|
239
|
-
// readers get the same treatment as regular users.
|
240
|
-
const exclusions = [].slice.call(document.querySelectorAll(this.exclude) || []);
|
241
|
-
let shadowExclusions = [];
|
242
|
-
(this.excludeShadow || '').split(',').forEach((selector) => {
|
243
|
-
if (t.isNullOrEmpty(selector)) {
|
244
|
-
return;
|
245
|
-
}
|
246
|
-
try {
|
247
|
-
const parts = selector.trim().replace(/\s/, '|').split('|');
|
248
|
-
const shadowElements = document.querySelector(parts[0]).shadowRoot.querySelectorAll(parts[1]);
|
249
|
-
shadowExclusions = shadowExclusions.concat([].slice.call(shadowElements || []));
|
250
|
-
}
|
251
|
-
catch (e) {
|
252
|
-
// eslint-disable-next-line no-console
|
253
|
-
console.error('Invalid shadow selector', selector);
|
254
|
-
}
|
255
|
-
});
|
256
|
-
// Get all of the iframes as we cannot reach into them to find
|
257
|
-
// their focusable elements. We can only focus on the trap elements
|
258
|
-
// that wrap it
|
259
|
-
this.iframes = [].slice.call(this.host.querySelectorAll('iframe') || []);
|
260
|
-
this.iframes.forEach(iframe => this.wrap(iframe));
|
261
|
-
// Set element in this trap deduplicating any that may have been duplicated
|
262
|
-
// with careless user inclusions.
|
263
|
-
this.elements = o([...queryTabbable(this.host), ...inclusions]);
|
264
|
-
// Get the focusable elements. This may be overkill as we really only need
|
265
|
-
// to know the first and last focusable. If that is the case, we may be
|
266
|
-
// able to just use the first and last `this.element` it is still not clear.
|
267
|
-
this.focusableElements = this.elements
|
268
|
-
.reduce((acc, value) => {
|
269
|
-
if (isFocusable(value) && !this.trapElements.includes(value)) {
|
270
|
-
acc.push(value);
|
271
|
-
}
|
272
|
-
return acc;
|
273
|
-
}, []);
|
274
|
-
/**
|
275
|
-
* We can not currently do this this way because MSEdge
|
276
|
-
* is reordering querySelectorAll items such that they
|
277
|
-
* not selecting in DOM order. If/when we dump support
|
278
|
-
* for MSEdge (non Chromium) or it fixes support we
|
279
|
-
* can move to this more efficient way. Until then, we
|
280
|
-
* need to use the && condition .includes in the
|
281
|
-
* `reduce` above. It will be more efficient to do it
|
282
|
-
* the below way when we can.
|
283
|
-
*/
|
284
|
-
// this.focusableElements.shift();
|
285
|
-
// this.focusableElements.pop();
|
286
|
-
//This may need to be defied more specifically as a11y as it is needed
|
287
|
-
//for the screen reader capabilities and may be interfering with
|
288
|
-
//regular usage.
|
289
|
-
this.outerElements = [...queryFocusable(document.body), ...exclusions, ...shadowExclusions]
|
290
|
-
.filter(element => !(element === this.host ||
|
291
|
-
innerElements.includes(element) ||
|
292
|
-
inclusions.includes(element)));
|
293
|
-
}
|
294
|
-
componentDidLoad() {
|
295
|
-
const trapStart = this.createTrapTag();
|
296
|
-
const trapEnd = this.createTrapTag();
|
297
|
-
this.trapElements = [trapStart, trapEnd];
|
298
|
-
this.host.insertBefore(trapStart, this.host.firstChild);
|
299
|
-
this.host.appendChild(trapEnd);
|
300
|
-
this.initialize();
|
301
|
-
if (this.active) {
|
302
|
-
this.handleActivate();
|
303
|
-
}
|
304
|
-
else {
|
305
|
-
this.handleDeactivate();
|
306
|
-
}
|
307
|
-
}
|
308
|
-
disconnectedCallback() {
|
309
|
-
if (this.active) {
|
310
|
-
this.handleDeactivate();
|
311
|
-
}
|
312
|
-
}
|
313
|
-
render() {
|
314
|
-
return h("slot", null);
|
315
|
-
}
|
316
|
-
get host() { return getElement(this); }
|
317
|
-
static get watchers() { return {
|
318
|
-
"active": ["activeHandler"]
|
319
|
-
}; }
|
320
|
-
};
|
321
|
-
Ku4FocusTrap.style = ku4FocusTrapCss;
|
322
|
-
|
323
|
-
export { Ku4FocusTrap as ku4_focus_trap };
|
@@ -1 +0,0 @@
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,r,n){function i(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,a){function s(t){try{u(n.next(t))}catch(e){a(e)}}function o(t){try{u(n["throw"](t))}catch(e){a(e)}}function u(t){t.done?r(t.value):i(t.value).then(s,o)}u((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(t){return function(e){return u([t,e])}}function u(s){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,i&&(a=s[0]&2?i["return"]:s[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;if(i=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;i=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){r.label=s[1];break}if(s[0]===6&&r.label<a[1]){r.label=a[1];a=s;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(s);break}if(a[2])r.ops.pop();r.trys.pop();continue}s=e.call(t,r)}catch(o){s=[6,o];i=0}finally{n=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++){if(a||!(n in e)){if(!a)a=Array.prototype.slice.call(e,0,n);a[n]=e[n]}}return t.concat(a||Array.prototype.slice.call(e))};System.register(["./index-29f2b09f.system.js","./index-5d0cb00d.system.js","./index-1c93827a.system.js"],(function(t){"use strict";var e,r,n,i,a,s,o;return{setters:[function(t){e=t.r;r=t.h;n=t.g},function(t){i=t.t;a=t.o},function(t){s=t.K;o=t.E}],execute:function(){var u=function(t,e){if(!e){t.forEach((function(t){if(!t.currentAriaHidden){t.removeAttribute("aria-hidden")}else{t.setAttribute("aria-hidden",t.currentAriaHidden)}}))}else{t.forEach((function(t){t.currentAriaHidden=t.getAttribute("aria-hidden");t.setAttribute("aria-hidden",e)}))}};var l=["A","BUTTON","INPUT","SELECT","TEXTAREA"];var c=function(t){var e=t.getAttribute("tabindex");return(l.includes(t.tagName.toUpperCase())||t.getAttribute("href"))&&(!e||isNaN(e)||parseInt(e)>-1)};var h=function(t){return[].slice.call(t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'))};var d=function(t){return[].slice.call(t.querySelectorAll(':not([tabindex="-1"])'))};var f=":host{position:static}";var p=s.tab;var v=s.tab.shift;var m=s.tab.alt;var y=s.tab.alt.shift;var E=t("ku4_focus_trap",function(){function t(t){e(this,t);this.iframes=[];this.active=false;this.handleKeyDown=this.handleKeyDown.bind(this);this.handleKeyUp=this.handleKeyUp.bind(this);this.handleMouse=this.handleMouse.bind(this)}t.prototype.activeHandler=function(t){t?this.handleActivate():this.handleDeactivate()};t.prototype.activate=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.lastActiveElement=t||document.querySelector(this.return||null);this.active=true;return[2]}))}))};t.prototype.deactivate=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.active=false;return[2]}))}))};t.prototype.handleActivate=function(){var t=this;this.lastActiveElement=this.lastActiveElement||document.activeElement;if(this.lastActiveElement&&this.lastActiveElement.blur){this.lastActiveElement.blur()}this.addEventListeners(this.elements);u(this.outerElements,true);window.requestAnimationFrame((function(){var e=document.querySelector(t.initial||null)||t.focusableElements[0]||t.trapElements[0];e.blur();e.focus();t.activateTraps()}))};t.prototype.handleDeactivate=function(){this.removeEventListeners(this.elements);this.deactivateTraps();u(this.outerElements);if(this.lastActiveElement&&this.lastActiveElement.focus){this.lastActiveElement.focus()}this.lastActiveElement=null};t.prototype.handleKeyDown=function(t){if(v.didFire(t)||y.didFire(t)){try{if(this.iframes.length>0&&(this.trapElements[1]===t.target||!i.isNull(t.target.getAttribute("ku4-focus-wrap"))||this.iframes.some((function(e){return e.contains(t.target)})))){return}if(this.trapElements[0]===t.target){this.trapElements[1].focus();return o.mute(t)}var e=this.focusableElements.indexOf(t.target)-1;var r=e<0?this.focusableElements.length-1:e;this.focusableElements[r].focus();return o.mute(t)}catch(t){return o.mute(t)}}if(p.didFire(t)||m.didFire(t)){try{if(this.iframes.length>0&&(this.trapElements[0]===t.target||!i.isNull(t.target.getAttribute("ku4-focus-wrap"))||this.iframes.some((function(e){return e.contains(t.target)})))){return}if(this.trapElements[1]===t.target){this.trapElements[0].focus();return o.mute(t)}var e=this.focusableElements.indexOf(t.target)+1;var r=e>=this.focusableElements.length?0:e;this.focusableElements[r].focus();return o.mute(t)}catch(t){return o.mute(t)}}};t.prototype.handleKeyUp=function(t){var e=this.trapElements.indexOf(t.target);if(e===0&&(v.didFire(t)||y.didFire(t))){var r=this.focusableElements[this.focusableElements.length-1]||this.trapElements[1];r.focus();return o.mute(t)}if(e===1&&(p.didFire(t)||m.didFire(t))){var r=this.focusableElements[0]||this.trapElements[0];r.focus();return o.mute(t)}};t.prototype.handleMouse=function(t){if(!this.elements.some((function(e){return e===t.target}))){o.mute(t)}};t.prototype.addEventListeners=function(t){var e=this;t.forEach((function(t){return t.addEventListener("keydown",e.handleKeyDown,{passive:true})}));t.forEach((function(t){return t.addEventListener("keyup",e.handleKeyUp,{passive:true})}));window.addEventListener("click",this.handleMouse,{passive:true});window.addEventListener("mousedown",this.handleMouse,{passive:true});window.addEventListener("mouseup",this.handleMouse,{passive:true});window.addEventListener("touchstart",this.handleMouse,{passive:true})};t.prototype.removeEventListeners=function(t){var e=this;t.forEach((function(t){return t.removeEventListener("keydown",e.handleKeyDown,true)}));t.forEach((function(t){return t.removeEventListener("keyup",e.handleKeyUp,true)}));window.removeEventListener("click",this.handleMouse,true);window.removeEventListener("mousedown",this.handleMouse,true);window.removeEventListener("mouseup",this.handleMouse,true);window.addEventListener("touchstart",this.handleMouse,true)};t.prototype.activateTraps=function(){this.setTraps(0)};t.prototype.deactivateTraps=function(){this.setTraps(-1)};t.prototype.setTraps=function(t){[].slice.call(this.host.querySelectorAll("[ku4-focus-trap], [ku4-focus-wrap]")).forEach((function(e){return e.setAttribute("tabindex",t)}))};t.prototype.wrap=function(t){var e=document.createDocumentFragment();e.appendChild(this.createWrapTag());e.appendChild(t.cloneNode());e.appendChild(this.createWrapTag());t.parentNode.replaceChild(e,t)};t.prototype.createTrapTag=function(){return this.createTag("ku4-focus-trap")};t.prototype.createWrapTag=function(){return this.createTag("ku4-focus-wrap")};t.prototype.createTag=function(t){var e=document.createElement("button");e.setAttribute(t,"");e.setAttribute("tabindex","0");e.setAttribute("aria-hidden","true");e.style.position="static";e.style.display="block";e.style.width="0";e.style.height="0";e.style.margin="0";e.style.padding="0";e.style.border="none";e.style.outline="none";return e};t.prototype.initialize=function(){var t=this;var e=[].slice.call(this.host.querySelectorAll("*"));var r=[].slice.call(document.querySelectorAll(this.include||null)||[]);var n=[].slice.call(document.querySelectorAll(this.exclude)||[]);var s=[];(this.excludeShadow||"").split(",").forEach((function(t){if(i.isNullOrEmpty(t)){return}try{var e=t.trim().replace(/\s/,"|").split("|");var r=document.querySelector(e[0]).shadowRoot.querySelectorAll(e[1]);s=s.concat([].slice.call(r||[]))}catch(n){console.error("Invalid shadow selector",t)}}));this.iframes=[].slice.call(this.host.querySelectorAll("iframe")||[]);this.iframes.forEach((function(e){return t.wrap(e)}));this.elements=a(__spreadArray(__spreadArray([],d(this.host),true),r,true));this.focusableElements=this.elements.reduce((function(e,r){if(c(r)&&!t.trapElements.includes(r)){e.push(r)}return e}),[]);this.outerElements=__spreadArray(__spreadArray(__spreadArray([],h(document.body),true),n,true),s,true).filter((function(n){return!(n===t.host||e.includes(n)||r.includes(n))}))};t.prototype.componentDidLoad=function(){var t=this.createTrapTag();var e=this.createTrapTag();this.trapElements=[t,e];this.host.insertBefore(t,this.host.firstChild);this.host.appendChild(e);this.initialize();if(this.active){this.handleActivate()}else{this.handleDeactivate()}};t.prototype.disconnectedCallback=function(){if(this.active){this.handleDeactivate()}};t.prototype.render=function(){return r("slot",null)};Object.defineProperty(t.prototype,"host",{get:function(){return n(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{active:["activeHandler"]}},enumerable:false,configurable:true});return t}());E.style=f}}}));
|
@@ -1,120 +0,0 @@
|
|
1
|
-
import { r as registerInstance, e as createEvent, h, g as getElement } from './index-a02dcfc8.js';
|
2
|
-
import { Y, t } from './index-6cfd87e4.js';
|
3
|
-
import { i as index } from './index-aa119486.js';
|
4
|
-
|
5
|
-
const Ku4Form = class {
|
6
|
-
constructor(hostRef) {
|
7
|
-
registerInstance(this, hostRef);
|
8
|
-
this.didValidate = createEvent(this, "validate", 7);
|
9
|
-
this.validate = this.validate.bind(this);
|
10
|
-
this.handleReset = this.handleReset.bind(this);
|
11
|
-
}
|
12
|
-
/**
|
13
|
-
* Returns a list of the names of all of the fields
|
14
|
-
* associated with this form.
|
15
|
-
*/
|
16
|
-
async listFieldNames() {
|
17
|
-
return index.readFieldNames(this.form);
|
18
|
-
}
|
19
|
-
/**
|
20
|
-
* Validates this form. This method is automatically called
|
21
|
-
* internally on submit of the form only allowing a successful
|
22
|
-
* submit if the form is valid.
|
23
|
-
*/
|
24
|
-
async validate() {
|
25
|
-
const { fields } = this;
|
26
|
-
const methods = fields.map(field => field.validate());
|
27
|
-
this.isValid = await Promise.all(methods).then(values => !values.some(v => v === false));
|
28
|
-
this.valid = this.isValid;
|
29
|
-
this.invalid = !this.isValid;
|
30
|
-
await Y(100)
|
31
|
-
.then(() => this.host.querySelectorAll('ku4-validation[invalid]'))
|
32
|
-
.then(invalid => this.didValidate.emit({ invalid }));
|
33
|
-
return this.isValid;
|
34
|
-
}
|
35
|
-
/**
|
36
|
-
* A string of the name of the field to invalidate
|
37
|
-
* @param {string} name
|
38
|
-
*/
|
39
|
-
async invalidate(name) {
|
40
|
-
if (t.isArray(name)) {
|
41
|
-
name.forEach((name) => {
|
42
|
-
const field = this.fields.find(field => field.for === name);
|
43
|
-
if (field) {
|
44
|
-
field.invalid = true;
|
45
|
-
}
|
46
|
-
});
|
47
|
-
}
|
48
|
-
else {
|
49
|
-
const field = this.fields.find(field => field.for === name);
|
50
|
-
if (field) {
|
51
|
-
field.invalid = true;
|
52
|
-
}
|
53
|
-
}
|
54
|
-
this.isValid = false;
|
55
|
-
this.valid = this.isValid;
|
56
|
-
this.invalid = !this.isValid;
|
57
|
-
return this;
|
58
|
-
}
|
59
|
-
/**
|
60
|
-
* Reads data from the associated form
|
61
|
-
*/
|
62
|
-
async read() {
|
63
|
-
return index.read(this.form);
|
64
|
-
}
|
65
|
-
/**
|
66
|
-
* Writes data to the associated form
|
67
|
-
*/
|
68
|
-
async write(data) {
|
69
|
-
index.write(this.form, data);
|
70
|
-
Object.keys(data).forEach((name) => {
|
71
|
-
try {
|
72
|
-
this.form.querySelector(`[name="${name}"]`)
|
73
|
-
.dispatchEvent(new window.Event('change'));
|
74
|
-
}
|
75
|
-
catch (e) {
|
76
|
-
/* Fail silently */
|
77
|
-
}
|
78
|
-
});
|
79
|
-
return this;
|
80
|
-
}
|
81
|
-
get form() {
|
82
|
-
return this.host.querySelector('form');
|
83
|
-
}
|
84
|
-
get fields() {
|
85
|
-
return [].slice.call(this.form.querySelectorAll('ku4-validation'));
|
86
|
-
}
|
87
|
-
handleReset() {
|
88
|
-
this.isValid = true;
|
89
|
-
this.valid = this.isValid;
|
90
|
-
this.invalid = !this.isValid;
|
91
|
-
}
|
92
|
-
componentWillLoad() {
|
93
|
-
const { form } = this;
|
94
|
-
if (t.exists(form)) {
|
95
|
-
const onsubmit = form.onsubmit || (() => { });
|
96
|
-
form.onsubmit = (e) => {
|
97
|
-
e.preventDefault();
|
98
|
-
this.validate()
|
99
|
-
.then(valid => valid && onsubmit.call(form, e))
|
100
|
-
.then(returnValue => !t.isFalse(returnValue) && form.submit());
|
101
|
-
return false;
|
102
|
-
};
|
103
|
-
form.addEventListener('reset', this.handleReset);
|
104
|
-
this.fields.forEach(field => field.addEventListener('validated', this.validate));
|
105
|
-
}
|
106
|
-
}
|
107
|
-
disconnectedCallback() {
|
108
|
-
const { form } = this;
|
109
|
-
if (t.exists(form)) {
|
110
|
-
form.removeEventListener('reset', this.handleReset);
|
111
|
-
this.fields.forEach(field => field.removeEventListener('validated', this.validate));
|
112
|
-
}
|
113
|
-
}
|
114
|
-
render() {
|
115
|
-
return h("slot", null);
|
116
|
-
}
|
117
|
-
get host() { return getElement(this); }
|
118
|
-
};
|
119
|
-
|
120
|
-
export { Ku4Form as ku4_form };
|
@@ -1 +0,0 @@
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,i,n){function r(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(e){o(e)}}function s(t){try{u(n["throw"](t))}catch(e){o(e)}}function u(t){t.done?i(t.value):r(t.value).then(a,s)}u((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,r,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(e){return u([t,e])}}function u(a){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;r=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(a[0]===6&&i.label<o[1]){i.label=o[1];o=a;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(a);break}if(o[2])i.ops.pop();i.trys.pop();continue}a=e.call(t,i)}catch(s){a=[6,s];r=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./index-29f2b09f.system.js","./index-5d0cb00d.system.js","./index-1c93827a.system.js"],(function(t){"use strict";var e,i,n,r,o,a,s;return{setters:[function(t){e=t.r;i=t.e;n=t.h;r=t.g},function(t){o=t.Y;a=t.t},function(t){s=t.i}],execute:function(){var u=t("ku4_form",function(){function t(t){e(this,t);this.didValidate=i(this,"validate",7);this.validate=this.validate.bind(this);this.handleReset=this.handleReset.bind(this)}t.prototype.listFieldNames=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,s.readFieldNames(this.form)]}))}))};t.prototype.validate=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,i;var n=this;return __generator(this,(function(r){switch(r.label){case 0:t=this.fields;e=t.map((function(t){return t.validate()}));i=this;return[4,Promise.all(e).then((function(t){return!t.some((function(t){return t===false}))}))];case 1:i.isValid=r.sent();this.valid=this.isValid;this.invalid=!this.isValid;return[4,o(100).then((function(){return n.host.querySelectorAll("ku4-validation[invalid]")})).then((function(t){return n.didValidate.emit({invalid:t})}))];case 2:r.sent();return[2,this.isValid]}}))}))};t.prototype.invalidate=function(t){return __awaiter(this,void 0,void 0,(function(){var e;var i=this;return __generator(this,(function(n){if(a.isArray(t)){t.forEach((function(t){var e=i.fields.find((function(e){return e.for===t}));if(e){e.invalid=true}}))}else{e=this.fields.find((function(e){return e.for===t}));if(e){e.invalid=true}}this.isValid=false;this.valid=this.isValid;this.invalid=!this.isValid;return[2,this]}))}))};t.prototype.read=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,s.read(this.form)]}))}))};t.prototype.write=function(t){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(i){s.write(this.form,t);Object.keys(t).forEach((function(t){try{e.form.querySelector('[name="'.concat(t,'"]')).dispatchEvent(new window.Event("change"))}catch(i){}}));return[2,this]}))}))};Object.defineProperty(t.prototype,"form",{get:function(){return this.host.querySelector("form")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"fields",{get:function(){return[].slice.call(this.form.querySelectorAll("ku4-validation"))},enumerable:false,configurable:true});t.prototype.handleReset=function(){this.isValid=true;this.valid=this.isValid;this.invalid=!this.isValid};t.prototype.componentWillLoad=function(){var t=this;var e=this.form;if(a.exists(e)){var i=e.onsubmit||function(){};e.onsubmit=function(n){n.preventDefault();t.validate().then((function(t){return t&&i.call(e,n)})).then((function(t){return!a.isFalse(t)&&e.submit()}));return false};e.addEventListener("reset",this.handleReset);this.fields.forEach((function(e){return e.addEventListener("validated",t.validate)}))}};t.prototype.disconnectedCallback=function(){var t=this;var e=this.form;if(a.exists(e)){e.removeEventListener("reset",this.handleReset);this.fields.forEach((function(e){return e.removeEventListener("validated",t.validate)}))}};t.prototype.render=function(){return n("slot",null)};Object.defineProperty(t.prototype,"host",{get:function(){return r(this)},enumerable:false,configurable:true});return t}())}}}));
|
@@ -1,108 +0,0 @@
|
|
1
|
-
import { r as registerInstance, h, f as Host } from './index-a02dcfc8.js';
|
2
|
-
|
3
|
-
const ku4GridCss = ":host{position:relative;display:block;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}@media only screen and (min-width: 1px){:host(.columns-xs-1){display:grid;grid-template-columns:repeat(auto-fill, minmax(100%, auto));margin-bottom:0}:host(.columns-xs-2){display:grid;grid-template-columns:repeat(auto-fill, minmax(50%, auto));margin-bottom:0}:host(.columns-xs-3){display:grid;grid-template-columns:repeat(auto-fill, minmax(33.3333333333%, auto));margin-bottom:0}:host(.columns-xs-4){display:grid;grid-template-columns:repeat(auto-fill, minmax(25%, auto));margin-bottom:0}:host(.columns-xs-5){display:grid;grid-template-columns:repeat(auto-fill, minmax(20%, auto));margin-bottom:0}:host(.columns-xs-6){display:grid;grid-template-columns:repeat(auto-fill, minmax(16.6666666667%, auto));margin-bottom:0}:host(.columns-xs-7){display:grid;grid-template-columns:repeat(auto-fill, minmax(14.2857142857%, auto));margin-bottom:0}:host(.columns-xs-8){display:grid;grid-template-columns:repeat(auto-fill, minmax(12.5%, auto));margin-bottom:0}:host(.columns-xs-9){display:grid;grid-template-columns:repeat(auto-fill, minmax(11.1111111111%, auto));margin-bottom:0}:host(.columns-xs-10){display:grid;grid-template-columns:repeat(auto-fill, minmax(10%, auto));margin-bottom:0}:host(.columns-xs-11){display:grid;grid-template-columns:repeat(auto-fill, minmax(9.0909090909%, auto));margin-bottom:0}:host(.columns-xs-12){display:grid;grid-template-columns:repeat(auto-fill, minmax(8.3333333333%, auto));margin-bottom:0}:host(.columns-xs-13){display:grid;grid-template-columns:repeat(auto-fill, minmax(7.6923076923%, auto));margin-bottom:0}:host(.columns-xs-14){display:grid;grid-template-columns:repeat(auto-fill, minmax(7.1428571429%, auto));margin-bottom:0}:host(.columns-xs-15){display:grid;grid-template-columns:repeat(auto-fill, minmax(6.6666666667%, auto));margin-bottom:0}:host(.columns-xs-16){display:grid;grid-template-columns:repeat(auto-fill, minmax(6.25%, auto));margin-bottom:0}:host(.offset-left-xs-0){padding-left:calc(((100% + 8.33px) / 12) * 0)}:host(.offset-left-xs-1){padding-left:calc(((100% + 8.33px) / 12) * 1)}:host(.offset-left-xs-2){padding-left:calc(((100% + 8.33px) / 12) * 2)}:host(.offset-left-xs-3){padding-left:calc(((100% + 8.33px) / 12) * 3)}:host(.offset-left-xs-4){padding-left:calc(((100% + 8.33px) / 12) * 4)}:host(.offset-left-xs-5){padding-left:calc(((100% + 8.33px) / 12) * 5)}:host(.offset-right-xs-0){padding-right:calc(((100% + 8.33px) / 12) * 0)}:host(.offset-right-xs-1){padding-right:calc(((100% + 8.33px) / 12) * 1)}:host(.offset-right-xs-2){padding-right:calc(((100% + 8.33px) / 12) * 2)}:host(.offset-right-xs-3){padding-right:calc(((100% + 8.33px) / 12) * 3)}:host(.offset-right-xs-4){padding-right:calc(((100% + 8.33px) / 12) * 4)}:host(.offset-right-xs-5){padding-right:calc(((100% + 8.33px) / 12) * 5)}:host(.offset-xs-0){padding-left:calc(((100% + 8.33px) / 12) * 0);padding-right:calc(((100% + 8.33px) / 12) * 0)}:host(.offset-xs-1){padding-left:calc(((100% + 8.33px) / 12) * 1);padding-right:calc(((100% + 8.33px) / 12) * 1)}:host(.offset-xs-2){padding-left:calc(((100% + 8.33px) / 12) * 2);padding-right:calc(((100% + 8.33px) / 12) * 2)}:host(.offset-xs-3){padding-left:calc(((100% + 8.33px) / 12) * 3);padding-right:calc(((100% + 8.33px) / 12) * 3)}:host(.offset-xs-4){padding-left:calc(((100% + 8.33px) / 12) * 4);padding-right:calc(((100% + 8.33px) / 12) * 4)}:host(.offset-xs-5){padding-left:calc(((100% + 8.33px) / 12) * 5);padding-right:calc(((100% + 8.33px) / 12) * 5)}:host{margin-bottom:calc(-1 * var(--ku4-grid-row-gutter-xs, 6px))}:host::slotted(*){margin-bottom:var(--ku4-grid-row-gutter-xs, 6px)}:host ::slotted(*){margin-bottom:var(--ku4-grid-row-gutter-xs, 6px)}}@media only screen and (min-width: 768px){:host(.columns-sm-1){display:grid;grid-template-columns:repeat(auto-fill, minmax(100%, auto));margin-bottom:0}:host(.columns-sm-2){display:grid;grid-template-columns:repeat(auto-fill, minmax(50%, auto));margin-bottom:0}:host(.columns-sm-3){display:grid;grid-template-columns:repeat(auto-fill, minmax(33.3333333333%, auto));margin-bottom:0}:host(.columns-sm-4){display:grid;grid-template-columns:repeat(auto-fill, minmax(25%, auto));margin-bottom:0}:host(.columns-sm-5){display:grid;grid-template-columns:repeat(auto-fill, minmax(20%, auto));margin-bottom:0}:host(.columns-sm-6){display:grid;grid-template-columns:repeat(auto-fill, minmax(16.6666666667%, auto));margin-bottom:0}:host(.columns-sm-7){display:grid;grid-template-columns:repeat(auto-fill, minmax(14.2857142857%, auto));margin-bottom:0}:host(.columns-sm-8){display:grid;grid-template-columns:repeat(auto-fill, minmax(12.5%, auto));margin-bottom:0}:host(.columns-sm-9){display:grid;grid-template-columns:repeat(auto-fill, minmax(11.1111111111%, auto));margin-bottom:0}:host(.columns-sm-10){display:grid;grid-template-columns:repeat(auto-fill, minmax(10%, auto));margin-bottom:0}:host(.columns-sm-11){display:grid;grid-template-columns:repeat(auto-fill, minmax(9.0909090909%, auto));margin-bottom:0}:host(.columns-sm-12){display:grid;grid-template-columns:repeat(auto-fill, minmax(8.3333333333%, auto));margin-bottom:0}:host(.columns-sm-13){display:grid;grid-template-columns:repeat(auto-fill, minmax(7.6923076923%, auto));margin-bottom:0}:host(.columns-sm-14){display:grid;grid-template-columns:repeat(auto-fill, minmax(7.1428571429%, auto));margin-bottom:0}:host(.columns-sm-15){display:grid;grid-template-columns:repeat(auto-fill, minmax(6.6666666667%, auto));margin-bottom:0}:host(.columns-sm-16){display:grid;grid-template-columns:repeat(auto-fill, minmax(6.25%, auto));margin-bottom:0}:host(.offset-left-sm-0){padding-left:calc(((100% + 8.33px) / 12) * 0)}:host(.offset-left-sm-1){padding-left:calc(((100% + 8.33px) / 12) * 1)}:host(.offset-left-sm-2){padding-left:calc(((100% + 8.33px) / 12) * 2)}:host(.offset-left-sm-3){padding-left:calc(((100% + 8.33px) / 12) * 3)}:host(.offset-left-sm-4){padding-left:calc(((100% + 8.33px) / 12) * 4)}:host(.offset-left-sm-5){padding-left:calc(((100% + 8.33px) / 12) * 5)}:host(.offset-right-sm-0){padding-right:calc(((100% + 8.33px) / 12) * 0)}:host(.offset-right-sm-1){padding-right:calc(((100% + 8.33px) / 12) * 1)}:host(.offset-right-sm-2){padding-right:calc(((100% + 8.33px) / 12) * 2)}:host(.offset-right-sm-3){padding-right:calc(((100% + 8.33px) / 12) * 3)}:host(.offset-right-sm-4){padding-right:calc(((100% + 8.33px) / 12) * 4)}:host(.offset-right-sm-5){padding-right:calc(((100% + 8.33px) / 12) * 5)}:host(.offset-sm-0){padding-left:calc(((100% + 8.33px) / 12) * 0);padding-right:calc(((100% + 8.33px) / 12) * 0)}:host(.offset-sm-1){padding-left:calc(((100% + 8.33px) / 12) * 1);padding-right:calc(((100% + 8.33px) / 12) * 1)}:host(.offset-sm-2){padding-left:calc(((100% + 8.33px) / 12) * 2);padding-right:calc(((100% + 8.33px) / 12) * 2)}:host(.offset-sm-3){padding-left:calc(((100% + 8.33px) / 12) * 3);padding-right:calc(((100% + 8.33px) / 12) * 3)}:host(.offset-sm-4){padding-left:calc(((100% + 8.33px) / 12) * 4);padding-right:calc(((100% + 8.33px) / 12) * 4)}:host(.offset-sm-5){padding-left:calc(((100% + 8.33px) / 12) * 5);padding-right:calc(((100% + 8.33px) / 12) * 5)}:host{margin-bottom:calc(-1 * var(--ku4-grid-row-gutter-sm, 10px))}:host::slotted(*){margin-bottom:var(--ku4-grid-row-gutter-sm, 10px)}:host ::slotted(*){margin-bottom:var(--ku4-grid-row-gutter-sm, 10px)}}@media only screen and (min-width: 992px){:host(.columns-md-1){display:grid;grid-template-columns:repeat(auto-fill, minmax(100%, auto));margin-bottom:0}:host(.columns-md-2){display:grid;grid-template-columns:repeat(auto-fill, minmax(50%, auto));margin-bottom:0}:host(.columns-md-3){display:grid;grid-template-columns:repeat(auto-fill, minmax(33.3333333333%, auto));margin-bottom:0}:host(.columns-md-4){display:grid;grid-template-columns:repeat(auto-fill, minmax(25%, auto));margin-bottom:0}:host(.columns-md-5){display:grid;grid-template-columns:repeat(auto-fill, minmax(20%, auto));margin-bottom:0}:host(.columns-md-6){display:grid;grid-template-columns:repeat(auto-fill, minmax(16.6666666667%, auto));margin-bottom:0}:host(.columns-md-7){display:grid;grid-template-columns:repeat(auto-fill, minmax(14.2857142857%, auto));margin-bottom:0}:host(.columns-md-8){display:grid;grid-template-columns:repeat(auto-fill, minmax(12.5%, auto));margin-bottom:0}:host(.columns-md-9){display:grid;grid-template-columns:repeat(auto-fill, minmax(11.1111111111%, auto));margin-bottom:0}:host(.columns-md-10){display:grid;grid-template-columns:repeat(auto-fill, minmax(10%, auto));margin-bottom:0}:host(.columns-md-11){display:grid;grid-template-columns:repeat(auto-fill, minmax(9.0909090909%, auto));margin-bottom:0}:host(.columns-md-12){display:grid;grid-template-columns:repeat(auto-fill, minmax(8.3333333333%, auto));margin-bottom:0}:host(.columns-md-13){display:grid;grid-template-columns:repeat(auto-fill, minmax(7.6923076923%, auto));margin-bottom:0}:host(.columns-md-14){display:grid;grid-template-columns:repeat(auto-fill, minmax(7.1428571429%, auto));margin-bottom:0}:host(.columns-md-15){display:grid;grid-template-columns:repeat(auto-fill, minmax(6.6666666667%, auto));margin-bottom:0}:host(.columns-md-16){display:grid;grid-template-columns:repeat(auto-fill, minmax(6.25%, auto));margin-bottom:0}:host(.offset-left-md-0){padding-left:calc(((100% + 8.33px) / 12) * 0)}:host(.offset-left-md-1){padding-left:calc(((100% + 8.33px) / 12) * 1)}:host(.offset-left-md-2){padding-left:calc(((100% + 8.33px) / 12) * 2)}:host(.offset-left-md-3){padding-left:calc(((100% + 8.33px) / 12) * 3)}:host(.offset-left-md-4){padding-left:calc(((100% + 8.33px) / 12) * 4)}:host(.offset-left-md-5){padding-left:calc(((100% + 8.33px) / 12) * 5)}:host(.offset-right-md-0){padding-right:calc(((100% + 8.33px) / 12) * 0)}:host(.offset-right-md-1){padding-right:calc(((100% + 8.33px) / 12) * 1)}:host(.offset-right-md-2){padding-right:calc(((100% + 8.33px) / 12) * 2)}:host(.offset-right-md-3){padding-right:calc(((100% + 8.33px) / 12) * 3)}:host(.offset-right-md-4){padding-right:calc(((100% + 8.33px) / 12) * 4)}:host(.offset-right-md-5){padding-right:calc(((100% + 8.33px) / 12) * 5)}:host(.offset-md-0){padding-left:calc(((100% + 8.33px) / 12) * 0);padding-right:calc(((100% + 8.33px) / 12) * 0)}:host(.offset-md-1){padding-left:calc(((100% + 8.33px) / 12) * 1);padding-right:calc(((100% + 8.33px) / 12) * 1)}:host(.offset-md-2){padding-left:calc(((100% + 8.33px) / 12) * 2);padding-right:calc(((100% + 8.33px) / 12) * 2)}:host(.offset-md-3){padding-left:calc(((100% + 8.33px) / 12) * 3);padding-right:calc(((100% + 8.33px) / 12) * 3)}:host(.offset-md-4){padding-left:calc(((100% + 8.33px) / 12) * 4);padding-right:calc(((100% + 8.33px) / 12) * 4)}:host(.offset-md-5){padding-left:calc(((100% + 8.33px) / 12) * 5);padding-right:calc(((100% + 8.33px) / 12) * 5)}:host{margin-bottom:calc(-1 * var(--ku4-grid-row-gutter-md, 12px))}:host::slotted(*){margin-bottom:var(--ku4-grid-row-gutter-md, 12px)}:host ::slotted(*){margin-bottom:var(--ku4-grid-row-gutter-md, 12px)}}@media only screen and (min-width: 1200px){:host(.columns-lg-1){display:grid;grid-template-columns:repeat(auto-fill, minmax(100%, auto));margin-bottom:0}:host(.columns-lg-2){display:grid;grid-template-columns:repeat(auto-fill, minmax(50%, auto));margin-bottom:0}:host(.columns-lg-3){display:grid;grid-template-columns:repeat(auto-fill, minmax(33.3333333333%, auto));margin-bottom:0}:host(.columns-lg-4){display:grid;grid-template-columns:repeat(auto-fill, minmax(25%, auto));margin-bottom:0}:host(.columns-lg-5){display:grid;grid-template-columns:repeat(auto-fill, minmax(20%, auto));margin-bottom:0}:host(.columns-lg-6){display:grid;grid-template-columns:repeat(auto-fill, minmax(16.6666666667%, auto));margin-bottom:0}:host(.columns-lg-7){display:grid;grid-template-columns:repeat(auto-fill, minmax(14.2857142857%, auto));margin-bottom:0}:host(.columns-lg-8){display:grid;grid-template-columns:repeat(auto-fill, minmax(12.5%, auto));margin-bottom:0}:host(.columns-lg-9){display:grid;grid-template-columns:repeat(auto-fill, minmax(11.1111111111%, auto));margin-bottom:0}:host(.columns-lg-10){display:grid;grid-template-columns:repeat(auto-fill, minmax(10%, auto));margin-bottom:0}:host(.columns-lg-11){display:grid;grid-template-columns:repeat(auto-fill, minmax(9.0909090909%, auto));margin-bottom:0}:host(.columns-lg-12){display:grid;grid-template-columns:repeat(auto-fill, minmax(8.3333333333%, auto));margin-bottom:0}:host(.columns-lg-13){display:grid;grid-template-columns:repeat(auto-fill, minmax(7.6923076923%, auto));margin-bottom:0}:host(.columns-lg-14){display:grid;grid-template-columns:repeat(auto-fill, minmax(7.1428571429%, auto));margin-bottom:0}:host(.columns-lg-15){display:grid;grid-template-columns:repeat(auto-fill, minmax(6.6666666667%, auto));margin-bottom:0}:host(.columns-lg-16){display:grid;grid-template-columns:repeat(auto-fill, minmax(6.25%, auto));margin-bottom:0}:host(.offset-left-lg-0){padding-left:calc(((100% + 8.33px) / 12) * 0)}:host(.offset-left-lg-1){padding-left:calc(((100% + 8.33px) / 12) * 1)}:host(.offset-left-lg-2){padding-left:calc(((100% + 8.33px) / 12) * 2)}:host(.offset-left-lg-3){padding-left:calc(((100% + 8.33px) / 12) * 3)}:host(.offset-left-lg-4){padding-left:calc(((100% + 8.33px) / 12) * 4)}:host(.offset-left-lg-5){padding-left:calc(((100% + 8.33px) / 12) * 5)}:host(.offset-right-lg-0){padding-right:calc(((100% + 8.33px) / 12) * 0)}:host(.offset-right-lg-1){padding-right:calc(((100% + 8.33px) / 12) * 1)}:host(.offset-right-lg-2){padding-right:calc(((100% + 8.33px) / 12) * 2)}:host(.offset-right-lg-3){padding-right:calc(((100% + 8.33px) / 12) * 3)}:host(.offset-right-lg-4){padding-right:calc(((100% + 8.33px) / 12) * 4)}:host(.offset-right-lg-5){padding-right:calc(((100% + 8.33px) / 12) * 5)}:host(.offset-lg-0){padding-left:calc(((100% + 8.33px) / 12) * 0);padding-right:calc(((100% + 8.33px) / 12) * 0)}:host(.offset-lg-1){padding-left:calc(((100% + 8.33px) / 12) * 1);padding-right:calc(((100% + 8.33px) / 12) * 1)}:host(.offset-lg-2){padding-left:calc(((100% + 8.33px) / 12) * 2);padding-right:calc(((100% + 8.33px) / 12) * 2)}:host(.offset-lg-3){padding-left:calc(((100% + 8.33px) / 12) * 3);padding-right:calc(((100% + 8.33px) / 12) * 3)}:host(.offset-lg-4){padding-left:calc(((100% + 8.33px) / 12) * 4);padding-right:calc(((100% + 8.33px) / 12) * 4)}:host(.offset-lg-5){padding-left:calc(((100% + 8.33px) / 12) * 5);padding-right:calc(((100% + 8.33px) / 12) * 5)}:host{margin-bottom:calc(-1 * var(--ku4-grid-row-gutter-lg, 16px))}:host::slotted(*){margin-bottom:var(--ku4-grid-row-gutter-lg, 16px)}:host ::slotted(*){margin-bottom:var(--ku4-grid-row-gutter-lg, 16px)}}::slotted(*){margin-left:var(--ku4-grid-column-gutter, 15px);margin-right:var(--ku4-grid-column-gutter, 15px)}";
|
4
|
-
|
5
|
-
const Ku4Grid = class {
|
6
|
-
constructor(hostRef) {
|
7
|
-
registerInstance(this, hostRef);
|
8
|
-
//<editor-fold desc="columns">
|
9
|
-
/**
|
10
|
-
* Number of columns to render at extra-small (optional).
|
11
|
-
*/
|
12
|
-
this.columnsXs = 1;
|
13
|
-
//</editor-fold>
|
14
|
-
//<editor-fold desc="offset-left">
|
15
|
-
/**
|
16
|
-
* Number of columns to offset left at extra-small (optional).
|
17
|
-
*/
|
18
|
-
this.offsetLeftXs = 0;
|
19
|
-
//</editor-fold>
|
20
|
-
//<editor-fold desc="offset-right">
|
21
|
-
/**
|
22
|
-
* Number of columns to offset right (optional).
|
23
|
-
*/
|
24
|
-
this.offsetRight = 0;
|
25
|
-
//</editor-fold>
|
26
|
-
//<editor-fold desc="offset">
|
27
|
-
/**
|
28
|
-
* Number of columns to offset left and right at extra-small (optional).
|
29
|
-
*/
|
30
|
-
this.offsetXs = 0;
|
31
|
-
}
|
32
|
-
//</editor-fold>
|
33
|
-
get columnClass() {
|
34
|
-
const { columnsXs, columnsSm, columnsMd, columnsLg } = this;
|
35
|
-
const value = [];
|
36
|
-
if (columnsXs && !Number.isNaN(columnsXs)) {
|
37
|
-
value.push(`columns-xs-${columnsXs}`);
|
38
|
-
}
|
39
|
-
if (columnsSm && !Number.isNaN(columnsSm)) {
|
40
|
-
value.push(`columns-sm-${columnsSm}`);
|
41
|
-
}
|
42
|
-
if (columnsMd && !Number.isNaN(columnsMd)) {
|
43
|
-
value.push(`columns-md-${columnsMd}`);
|
44
|
-
}
|
45
|
-
if (columnsLg && !Number.isNaN(columnsLg)) {
|
46
|
-
value.push(`columns-lg-${columnsLg}`);
|
47
|
-
}
|
48
|
-
return value.join(' ');
|
49
|
-
}
|
50
|
-
get offsetLeftClass() {
|
51
|
-
const { offsetLeftXs, offsetLeftSm, offsetLeftMd, offsetLeftLg } = this;
|
52
|
-
const value = [];
|
53
|
-
if (offsetLeftXs && !Number.isNaN(offsetLeftXs)) {
|
54
|
-
value.push(`offset-left-xs-${offsetLeftXs}`);
|
55
|
-
}
|
56
|
-
if (offsetLeftSm && !Number.isNaN(offsetLeftSm)) {
|
57
|
-
value.push(`offset-left-sm-${offsetLeftSm}`);
|
58
|
-
}
|
59
|
-
if (offsetLeftMd && !Number.isNaN(offsetLeftMd)) {
|
60
|
-
value.push(`offset-left-md-${offsetLeftMd}`);
|
61
|
-
}
|
62
|
-
if (offsetLeftLg && !Number.isNaN(offsetLeftLg)) {
|
63
|
-
value.push(`offset-left-lg-${offsetLeftLg}`);
|
64
|
-
}
|
65
|
-
return value.join(' ');
|
66
|
-
}
|
67
|
-
get offsetRightClass() {
|
68
|
-
const { offsetRightXs, offsetRightSm, offsetRightMd, offsetRightLg } = this;
|
69
|
-
const value = [];
|
70
|
-
if (offsetRightXs && !Number.isNaN(offsetRightXs)) {
|
71
|
-
value.push(`offset-right-xs-${offsetRightXs}`);
|
72
|
-
}
|
73
|
-
if (offsetRightSm && !Number.isNaN(offsetRightSm)) {
|
74
|
-
value.push(`offset-right-sm-${offsetRightSm}`);
|
75
|
-
}
|
76
|
-
if (offsetRightMd && !Number.isNaN(offsetRightMd)) {
|
77
|
-
value.push(`offset-right-md-${offsetRightMd}`);
|
78
|
-
}
|
79
|
-
if (offsetRightLg && !Number.isNaN(offsetRightLg)) {
|
80
|
-
value.push(`offset-right-lg-${offsetRightLg}`);
|
81
|
-
}
|
82
|
-
return value.join(' ');
|
83
|
-
}
|
84
|
-
get offsetClass() {
|
85
|
-
const { offsetXs, offsetSm, offsetMd, offsetLg } = this;
|
86
|
-
const value = [];
|
87
|
-
if (offsetXs && !Number.isNaN(offsetXs)) {
|
88
|
-
value.push(`offset-xs-${offsetXs}`);
|
89
|
-
}
|
90
|
-
if (offsetSm && !Number.isNaN(offsetSm)) {
|
91
|
-
value.push(`offset-sm-${offsetSm}`);
|
92
|
-
}
|
93
|
-
if (offsetMd && !Number.isNaN(offsetMd)) {
|
94
|
-
value.push(`offset-md-${offsetMd}`);
|
95
|
-
}
|
96
|
-
if (offsetLg && !Number.isNaN(offsetLg)) {
|
97
|
-
value.push(`offset-lg-${offsetLg}`);
|
98
|
-
}
|
99
|
-
return value.join(' ');
|
100
|
-
}
|
101
|
-
render() {
|
102
|
-
const { columnClass, offsetClass, offsetLeftClass, offsetRightClass, } = this;
|
103
|
-
return (h(Host, { class: `${columnClass} ${offsetLeftClass} ${offsetRightClass} ${offsetClass}` }, h("slot", null)));
|
104
|
-
}
|
105
|
-
};
|
106
|
-
Ku4Grid.style = ku4GridCss;
|
107
|
-
|
108
|
-
export { Ku4Grid as ku4_grid };
|