ku4web-components 6.4.85 → 6.4.87

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. package/dist/cjs/ku4-carousel-controls.cjs.entry.js +2 -2
  2. package/dist/cjs/ku4-carousel-slide.cjs.entry.js +1 -1
  3. package/dist/cjs/ku4-carousel.cjs.entry.js +3 -3
  4. package/dist/cjs/ku4-col.cjs.entry.js +1 -1
  5. package/dist/cjs/ku4-drawer.cjs.entry.js +1 -1
  6. package/dist/cjs/ku4-feature.cjs.entry.js +2 -2
  7. package/dist/cjs/ku4-focus-trap.cjs.entry.js +26 -26
  8. package/dist/cjs/ku4-form.cjs.entry.js +3 -3
  9. package/dist/cjs/ku4-grid.cjs.entry.js +1 -1
  10. package/dist/cjs/ku4-label.cjs.entry.js +2 -2
  11. package/dist/cjs/ku4-mask.cjs.entry.js +3 -3
  12. package/dist/cjs/ku4-modal.cjs.entry.js +9 -4
  13. package/dist/cjs/ku4-panel.cjs.entry.js +1 -1
  14. package/dist/cjs/ku4-preview.cjs.entry.js +14 -43
  15. package/dist/cjs/ku4-tab-list.cjs.entry.js +4 -4
  16. package/dist/cjs/ku4-tab-panel.cjs.entry.js +3 -3
  17. package/dist/cjs/ku4-tab.cjs.entry.js +3 -3
  18. package/dist/cjs/ku4-table.cjs.entry.js +1 -1
  19. package/dist/cjs/ku4-tooltip.cjs.entry.js +2 -2
  20. package/dist/cjs/ku4-validation.cjs.entry.js +2 -2
  21. package/dist/cjs/ku4web-components.cjs.js +7 -102
  22. package/dist/cjs/loader.cjs.js +2 -18
  23. package/dist/esm/ku4-carousel-controls.entry.js +2 -2
  24. package/dist/esm/ku4-carousel-slide.entry.js +1 -1
  25. package/dist/esm/ku4-carousel.entry.js +3 -3
  26. package/dist/esm/ku4-col.entry.js +1 -1
  27. package/dist/esm/ku4-drawer.entry.js +1 -1
  28. package/dist/esm/ku4-feature.entry.js +2 -2
  29. package/dist/esm/ku4-focus-trap.entry.js +3 -3
  30. package/dist/esm/ku4-form.entry.js +3 -3
  31. package/dist/esm/ku4-grid.entry.js +1 -1
  32. package/dist/esm/ku4-label.entry.js +2 -2
  33. package/dist/esm/ku4-mask.entry.js +3 -3
  34. package/dist/esm/ku4-modal.entry.js +9 -4
  35. package/dist/esm/ku4-panel.entry.js +1 -1
  36. package/dist/esm/ku4-preview.entry.js +5 -34
  37. package/dist/esm/ku4-tab-list.entry.js +4 -4
  38. package/dist/esm/ku4-tab-panel.entry.js +3 -3
  39. package/dist/esm/ku4-tab.entry.js +3 -3
  40. package/dist/esm/ku4-table.entry.js +1 -1
  41. package/dist/esm/ku4-tooltip.entry.js +2 -2
  42. package/dist/esm/ku4-validation.entry.js +2 -2
  43. package/dist/esm/ku4web-components.js +7 -102
  44. package/dist/esm/loader.js +2 -18
  45. package/dist/esm-es5/ku4-mask.entry.js +1 -1
  46. package/dist/esm-es5/ku4-modal.entry.js +1 -1
  47. package/dist/esm-es5/ku4web-components.js +1 -1
  48. package/dist/esm-es5/loader.js +1 -1
  49. package/dist/index.js +1 -1
  50. package/dist/ku4web-components/index.esm.js +0 -1
  51. package/dist/ku4web-components/ku4web-components.css +1 -299
  52. package/dist/ku4web-components/ku4web-components.esm.js +1 -129
  53. package/dist/ku4web-components/ku4web-components.js +1 -1
  54. package/dist/ku4web-components/p-479f3ff2.entry.js +1 -0
  55. package/dist/ku4web-components/{p-5a60b1d4.system.entry.js → p-cf860f7a.system.entry.js} +1 -1
  56. package/dist/ku4web-components/p-d66b1c43.system.js +1 -1
  57. package/dist/ku4web-components/p-eace33d2.system.entry.js +1 -0
  58. package/dist/ku4web-components/p-f6b9d36e.entry.js +1 -0
  59. package/dist/types/components/ku4-modal/ku4-modal.d.ts +5 -0
  60. package/dist/types/components.d.ts +10 -2
  61. package/package.json +1 -1
  62. package/dist/cjs/app-globals-3a1e7e63.js +0 -5
  63. package/dist/cjs/css-shim-af499675.js +0 -6
  64. package/dist/cjs/dom-0e8e7262.js +0 -75
  65. package/dist/cjs/index-31267995.js +0 -3093
  66. package/dist/cjs/index-517c4086.js +0 -14
  67. package/dist/cjs/index-d6fca091.js +0 -10
  68. package/dist/cjs/uid-8ec2f63e.js +0 -11
  69. package/dist/collection/capabilities/a11y/aria.js +0 -26
  70. package/dist/collection/capabilities/angular/index.js +0 -24
  71. package/dist/collection/capabilities/decorators/deprecated.js +0 -20
  72. package/dist/collection/capabilities/decorators/index.js +0 -3
  73. package/dist/collection/capabilities/decorators/memoize.js +0 -7
  74. package/dist/collection/capabilities/dom/isFocusable.js +0 -7
  75. package/dist/collection/capabilities/dom/queryFocusable.js +0 -2
  76. package/dist/collection/capabilities/identity/uid.js +0 -6
  77. package/dist/collection/capabilities/mask/index.js +0 -5
  78. package/dist/collection/capabilities/mask/patterns/date.js +0 -40
  79. package/dist/collection/capabilities/mask/patterns/index.js +0 -7
  80. package/dist/collection/capabilities/react/index.js +0 -25
  81. package/dist/collection/capabilities/testing/html.js +0 -14
  82. package/dist/collection/capabilities/testing/styles.js +0 -14
  83. package/dist/collection/capabilities/vue/index.js +0 -28
  84. package/dist/collection/capabilities/vue3/index.js +0 -26
  85. package/dist/collection/collection-manifest.json +0 -31
  86. package/dist/collection/components/ku4-carousel/ku4-carousel.css +0 -221
  87. package/dist/collection/components/ku4-carousel/ku4-carousel.js +0 -369
  88. package/dist/collection/components/ku4-carousel-controls/ku4-carousel-controls.css +0 -32
  89. package/dist/collection/components/ku4-carousel-controls/ku4-carousel-controls.js +0 -112
  90. package/dist/collection/components/ku4-carousel-slide/ku4-carousel-slide.css +0 -3
  91. package/dist/collection/components/ku4-carousel-slide/ku4-carousel-slide.js +0 -159
  92. package/dist/collection/components/ku4-col/ku4-col.css +0 -601
  93. package/dist/collection/components/ku4-col/ku4-col.js +0 -288
  94. package/dist/collection/components/ku4-drawer/ku4-drawer.css +0 -56
  95. package/dist/collection/components/ku4-drawer/ku4-drawer.js +0 -163
  96. package/dist/collection/components/ku4-feature/ku4-feature.js +0 -70
  97. package/dist/collection/components/ku4-focus-trap/ku4-focus-trap.css +0 -3
  98. package/dist/collection/components/ku4-focus-trap/ku4-focus-trap.js +0 -441
  99. package/dist/collection/components/ku4-form/ku4-form.js +0 -225
  100. package/dist/collection/components/ku4-grid/ku4-grid.css +0 -751
  101. package/dist/collection/components/ku4-grid/ku4-grid.js +0 -408
  102. package/dist/collection/components/ku4-label/ku4-label.css +0 -36
  103. package/dist/collection/components/ku4-label/ku4-label.js +0 -115
  104. package/dist/collection/components/ku4-mask/ku4-mask.css +0 -3
  105. package/dist/collection/components/ku4-mask/ku4-mask.js +0 -458
  106. package/dist/collection/components/ku4-modal/ku4-modal.css +0 -85
  107. package/dist/collection/components/ku4-modal/ku4-modal.js +0 -208
  108. package/dist/collection/components/ku4-panel/ku4-panel.css +0 -14
  109. package/dist/collection/components/ku4-panel/ku4-panel.js +0 -119
  110. package/dist/collection/components/ku4-preview/ku4-preview.css +0 -23
  111. package/dist/collection/components/ku4-preview/ku4-preview.js +0 -266
  112. package/dist/collection/components/ku4-tab/ku4-tab.css +0 -82
  113. package/dist/collection/components/ku4-tab/ku4-tab.js +0 -191
  114. package/dist/collection/components/ku4-tab-list/ku4-tab-list.css +0 -6
  115. package/dist/collection/components/ku4-tab-list/ku4-tab-list.js +0 -118
  116. package/dist/collection/components/ku4-tab-panel/ku4-tab-panel.css +0 -26
  117. package/dist/collection/components/ku4-tab-panel/ku4-tab-panel.js +0 -166
  118. package/dist/collection/components/ku4-table/ku4-table.css +0 -116
  119. package/dist/collection/components/ku4-table/ku4-table.js +0 -120
  120. package/dist/collection/components/ku4-tooltip/ku4-tooltip.css +0 -56
  121. package/dist/collection/components/ku4-tooltip/ku4-tooltip.js +0 -274
  122. package/dist/collection/components/ku4-validation/ku4-validation.css +0 -19
  123. package/dist/collection/components/ku4-validation/ku4-validation.js +0 -364
  124. package/dist/collection/components/ku4-validation/validate.js +0 -14
  125. package/dist/collection/index.js +0 -1
  126. package/dist/collection/security.js +0 -27
  127. package/dist/esm/app-globals-0f993ce5.js +0 -3
  128. package/dist/esm/css-shim-5697df59.js +0 -4
  129. package/dist/esm/dom-1d32cb7b.js +0 -73
  130. package/dist/esm/index-135dacad.js +0 -3
  131. package/dist/esm/index-52b04dce.js +0 -3057
  132. package/dist/esm/index-f13d1b41.js +0 -3
  133. package/dist/esm/uid-a7ff854d.js +0 -9
  134. package/dist/ku4web-components/app-globals-0f993ce5.js +0 -3
  135. package/dist/ku4web-components/app-globals-497eb362.system.js +0 -1
  136. package/dist/ku4web-components/css-shim-2eb8ce1f.system.js +0 -1
  137. package/dist/ku4web-components/css-shim-5697df59.js +0 -4
  138. package/dist/ku4web-components/dom-1d32cb7b.js +0 -73
  139. package/dist/ku4web-components/dom-e6a9d306.system.js +0 -21
  140. package/dist/ku4web-components/index-135dacad.js +0 -3
  141. package/dist/ku4web-components/index-4036ffa2.system.js +0 -1
  142. package/dist/ku4web-components/index-52b04dce.js +0 -3057
  143. package/dist/ku4web-components/index-9bb2580f.system.js +0 -1
  144. package/dist/ku4web-components/index-dcd9a8a7.system.js +0 -1
  145. package/dist/ku4web-components/index-f13d1b41.js +0 -3
  146. package/dist/ku4web-components/index.system.js +0 -1
  147. package/dist/ku4web-components/ku4-carousel-controls.entry.js +0 -89
  148. package/dist/ku4web-components/ku4-carousel-controls.system.entry.js +0 -1
  149. package/dist/ku4web-components/ku4-carousel-slide.entry.js +0 -47
  150. package/dist/ku4web-components/ku4-carousel-slide.system.entry.js +0 -1
  151. package/dist/ku4web-components/ku4-carousel.entry.js +0 -175
  152. package/dist/ku4web-components/ku4-carousel.system.entry.js +0 -1
  153. package/dist/ku4web-components/ku4-col.entry.js +0 -75
  154. package/dist/ku4web-components/ku4-col.system.entry.js +0 -1
  155. package/dist/ku4web-components/ku4-drawer.entry.js +0 -35
  156. package/dist/ku4web-components/ku4-drawer.system.entry.js +0 -1
  157. package/dist/ku4web-components/ku4-feature.entry.js +0 -29
  158. package/dist/ku4web-components/ku4-feature.system.entry.js +0 -1
  159. package/dist/ku4web-components/ku4-focus-trap.entry.js +0 -323
  160. package/dist/ku4web-components/ku4-focus-trap.system.entry.js +0 -1
  161. package/dist/ku4web-components/ku4-form.entry.js +0 -112
  162. package/dist/ku4web-components/ku4-form.system.entry.js +0 -1
  163. package/dist/ku4web-components/ku4-grid.entry.js +0 -108
  164. package/dist/ku4web-components/ku4-grid.system.entry.js +0 -1
  165. package/dist/ku4web-components/ku4-label.entry.js +0 -70
  166. package/dist/ku4web-components/ku4-label.system.entry.js +0 -1
  167. package/dist/ku4web-components/ku4-mask.entry.js +0 -342
  168. package/dist/ku4web-components/ku4-mask.system.entry.js +0 -1
  169. package/dist/ku4web-components/ku4-modal.entry.js +0 -75
  170. package/dist/ku4web-components/ku4-modal.system.entry.js +0 -1
  171. package/dist/ku4web-components/ku4-panel.entry.js +0 -49
  172. package/dist/ku4web-components/ku4-panel.system.entry.js +0 -1
  173. package/dist/ku4web-components/ku4-preview.entry.js +0 -128
  174. package/dist/ku4web-components/ku4-preview.system.entry.js +0 -1
  175. package/dist/ku4web-components/ku4-tab-list.entry.js +0 -76
  176. package/dist/ku4web-components/ku4-tab-list.system.entry.js +0 -1
  177. package/dist/ku4web-components/ku4-tab-panel.entry.js +0 -72
  178. package/dist/ku4web-components/ku4-tab-panel.system.entry.js +0 -1
  179. package/dist/ku4web-components/ku4-tab.entry.js +0 -63
  180. package/dist/ku4web-components/ku4-tab.system.entry.js +0 -1
  181. package/dist/ku4web-components/ku4-table.entry.js +0 -79
  182. package/dist/ku4web-components/ku4-table.system.entry.js +0 -1
  183. package/dist/ku4web-components/ku4-tooltip.entry.js +0 -120
  184. package/dist/ku4web-components/ku4-tooltip.system.entry.js +0 -1
  185. package/dist/ku4web-components/ku4-validation.entry.js +0 -162
  186. package/dist/ku4web-components/ku4-validation.system.entry.js +0 -1
  187. package/dist/ku4web-components/ku4web-components.system.js +0 -1
  188. package/dist/ku4web-components/p-138904dc.system.entry.js +0 -1
  189. package/dist/ku4web-components/p-dd0d306b.entry.js +0 -1
  190. package/dist/ku4web-components/p-ef0b529f.entry.js +0 -1
  191. package/dist/ku4web-components/shadow-css-6a0a96e7.system.js +0 -13
  192. package/dist/ku4web-components/shadow-css-dfa0587f.js +0 -388
  193. package/dist/ku4web-components/uid-3373ce49.system.js +0 -1
  194. package/dist/ku4web-components/uid-a7ff854d.js +0 -9
@@ -1,76 +0,0 @@
1
- import { r as registerInstance, h, f as Host, g as getElement } from './index-52b04dce.js';
2
- import { K as Key } from './index-f13d1b41.js';
3
- import { u as uid } from './uid-a7ff854d.js';
4
- import './index-135dacad.js';
5
-
6
- const ku4TabListCss = ":host{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap}";
7
-
8
- const Ku4TabList = class {
9
- constructor(hostRef) {
10
- registerInstance(this, hostRef);
11
- }
12
- handleTabClick({ target }) {
13
- this.tabs.includes(target) && this.open(target);
14
- }
15
- handleTabKeyUp({ target, detail: e }) {
16
- if (!(this.tabs.includes(target))) {
17
- return;
18
- }
19
- if (Key.left.didFire(e)) {
20
- this.open(this.previous(target));
21
- }
22
- if (Key.right.didFire(e)) {
23
- this.open(this.next(target));
24
- }
25
- }
26
- /**
27
- * Open a ku4-tab in this ku4-tab-list.
28
- * @param {Ku4Tab} tab - ku4-tab target to open.
29
- */
30
- async open(tab) {
31
- return this.reset().select(tab);
32
- }
33
- select(tab) {
34
- tab.select();
35
- return this;
36
- }
37
- deselect(tab) {
38
- tab.deselect();
39
- return this;
40
- }
41
- reset() {
42
- this.tabs.forEach(tab => this.deselect(tab));
43
- return this;
44
- }
45
- previous(tab) {
46
- const { tabs, tabs: { length } } = this;
47
- const index = tabs.indexOf(tab) - 1;
48
- return tabs[index > -1 ? index : length - 1];
49
- }
50
- next(tab) {
51
- const { tabs, tabs: { length } } = this;
52
- const index = tabs.indexOf(tab) + 1;
53
- return tabs[index < length ? index : 0];
54
- }
55
- componentDidRender() {
56
- const tabs = [];
57
- const panels = [];
58
- [].slice.call(this.host.children).forEach((child) => {
59
- if (child.tagName === 'KU4-TAB') {
60
- tabs.push(child);
61
- }
62
- if (child.tagName === 'KU4-TAB-PANEL') {
63
- panels.push(child);
64
- }
65
- });
66
- this.tabs = tabs;
67
- this.tabs.forEach((tab, index) => tab.connect(panels[index]));
68
- }
69
- render() {
70
- return (h(Host, { id: this.host.id || uid(), role: "tablist", "aria-owns": this.host.id || uid() }, h("slot", null)));
71
- }
72
- get host() { return getElement(this); }
73
- };
74
- Ku4TabList.style = ku4TabListCss;
75
-
76
- export { Ku4TabList as ku4_tab_list };
@@ -1 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,n,r){function i(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,o){function s(t){try{u(r.next(t))}catch(e){o(e)}}function a(t){try{u(r["throw"](t))}catch(e){o(e)}}function u(t){t.done?n(t.value):i(t.value).then(s,a)}u((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(e){return u([t,e])}}function u(s){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;i=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(s[0]===6&&n.label<o[1]){n.label=o[1];o=s;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(s);break}if(o[2])n.ops.pop();n.trys.pop();continue}s=e.call(t,n)}catch(a){s=[6,a];i=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./index-4036ffa2.system.js","./index-9bb2580f.system.js","./uid-3373ce49.system.js","./index-dcd9a8a7.system.js"],(function(t){"use strict";var e,n,r,i,o,s;return{setters:[function(t){e=t.r;n=t.h;r=t.f;i=t.g},function(t){o=t.K},function(t){s=t.u},function(){}],execute:function(){var a=":host{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap}";var u=t("ku4_tab_list",function(){function t(t){e(this,t)}t.prototype.handleTabClick=function(t){var e=t.target;this.tabs.includes(e)&&this.open(e)};t.prototype.handleTabKeyUp=function(t){var e=t.target,n=t.detail;if(!this.tabs.includes(e)){return}if(o.left.didFire(n)){this.open(this.previous(e))}if(o.right.didFire(n)){this.open(this.next(e))}};t.prototype.open=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.reset().select(t)]}))}))};t.prototype.select=function(t){t.select();return this};t.prototype.deselect=function(t){t.deselect();return this};t.prototype.reset=function(){var t=this;this.tabs.forEach((function(e){return t.deselect(e)}));return this};t.prototype.previous=function(t){var e=this,n=e.tabs,r=e.tabs.length;var i=n.indexOf(t)-1;return n[i>-1?i:r-1]};t.prototype.next=function(t){var e=this,n=e.tabs,r=e.tabs.length;var i=n.indexOf(t)+1;return n[i<r?i:0]};t.prototype.componentDidRender=function(){var t=[];var e=[];[].slice.call(this.host.children).forEach((function(n){if(n.tagName==="KU4-TAB"){t.push(n)}if(n.tagName==="KU4-TAB-PANEL"){e.push(n)}}));this.tabs=t;this.tabs.forEach((function(t,n){return t.connect(e[n])}))};t.prototype.render=function(){return n(r,{id:this.host.id||s(),role:"tablist","aria-owns":this.host.id||s()},n("slot",null))};Object.defineProperty(t.prototype,"host",{get:function(){return i(this)},enumerable:false,configurable:true});return t}());u.style=a}}}));
@@ -1,72 +0,0 @@
1
- import { r as registerInstance, h, f as Host, g as getElement } from './index-52b04dce.js';
2
- import { u as uid } from './uid-a7ff854d.js';
3
- import './index-135dacad.js';
4
-
5
- const ku4TabPanelCss = ":host{-webkit-backface-visibility:hidden;display:block;width:100%;height:auto;max-height:0;-webkit-transition:max-height 0.4s, padding 0.6s;transition:max-height 0.4s, padding 0.6s;overflow:auto}@media only screen and (min-width: 768px){:host{display:none;border-top:1px solid #ccc;border-bottom:1px solid #ccc;max-height:initial !important;-webkit-transition:none;transition:none;-ms-flex-order:2;order:2}:host([selected]){display:block;max-height:initial !important;-webkit-transition:none;transition:none}}";
6
-
7
- const Ku4TabPanel = class {
8
- constructor(hostRef) {
9
- registerInstance(this, hostRef);
10
- /**
11
- * Set true to display panel
12
- */
13
- this.selected = false;
14
- this.maxHeight = this.selected ? 'none' : '0px';
15
- }
16
- handleTransitionEnd() {
17
- this.maxHeight = this.selected ? 'none' : '0px';
18
- }
19
- /**
20
- * Set this panel as selected.
21
- */
22
- async select() {
23
- if (this.selected) {
24
- return;
25
- }
26
- this.selected = true;
27
- if (this.hasTransition) {
28
- this.maxHeight = `${this.host.scrollHeight}px`;
29
- }
30
- else {
31
- this.handleTransitionEnd();
32
- }
33
- }
34
- /**
35
- * Unset this panel as selected.
36
- */
37
- async deselect() {
38
- if (!this.selected) {
39
- return;
40
- }
41
- this.selected = false;
42
- this.host.style.maxHeight = `${this.host.scrollHeight}px`;
43
- if (this.hasTransition) {
44
- this.maxHeight = '0px';
45
- }
46
- else {
47
- this.handleTransitionEnd();
48
- }
49
- }
50
- /**
51
- * Connect this panel to a tab.
52
- * @param {Ku4Tab} tab - Tab to connect to this panel
53
- */
54
- async connect(tab) {
55
- tab.$assignPanel(this);
56
- this.tab = tab;
57
- }
58
- get hasTransition() {
59
- const transition = window
60
- .getComputedStyle(this.host)
61
- .getPropertyValue('transition');
62
- return !/none/.test(transition);
63
- }
64
- render() {
65
- const { selected, tab, maxHeight } = this;
66
- return (h(Host, { role: "tabpanel", id: this.host.id || uid(), "aria-hidden": selected ? 'false' : 'true', "aria-labelledby": tab && tab.id, tabIndex: selected ? 0 : -1, style: { maxHeight } }, h("slot", null)));
67
- }
68
- get host() { return getElement(this); }
69
- };
70
- Ku4TabPanel.style = ku4TabPanelCss;
71
-
72
- export { Ku4TabPanel as ku4_tab_panel };
@@ -1 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,n,i){function r(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,o){function a(t){try{l(i.next(t))}catch(e){o(e)}}function s(t){try{l(i["throw"](t))}catch(e){o(e)}}function l(t){t.done?n(t.value):r(t.value).then(a,s)}l((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,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 l([t,e])}}function l(a){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=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:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){n.label=a[1];break}if(a[0]===6&&n.label<o[1]){n.label=o[1];o=a;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(a);break}if(o[2])n.ops.pop();n.trys.pop();continue}a=e.call(t,n)}catch(s){a=[6,s];r=0}finally{i=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./index-4036ffa2.system.js","./uid-3373ce49.system.js","./index-dcd9a8a7.system.js"],(function(t){"use strict";var e,n,i,r,o;return{setters:[function(t){e=t.r;n=t.h;i=t.f;r=t.g},function(t){o=t.u},function(){}],execute:function(){var a=":host{-webkit-backface-visibility:hidden;display:block;width:100%;height:auto;max-height:0;-webkit-transition:max-height 0.4s, padding 0.6s;transition:max-height 0.4s, padding 0.6s;overflow:auto}@media only screen and (min-width: 768px){:host{display:none;border-top:1px solid #ccc;border-bottom:1px solid #ccc;max-height:initial !important;-webkit-transition:none;transition:none;-ms-flex-order:2;order:2}:host([selected]){display:block;max-height:initial !important;-webkit-transition:none;transition:none}}";var s=t("ku4_tab_panel",function(){function t(t){e(this,t);this.selected=false;this.maxHeight=this.selected?"none":"0px"}t.prototype.handleTransitionEnd=function(){this.maxHeight=this.selected?"none":"0px"};t.prototype.select=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.selected){return[2]}this.selected=true;if(this.hasTransition){this.maxHeight="".concat(this.host.scrollHeight,"px")}else{this.handleTransitionEnd()}return[2]}))}))};t.prototype.deselect=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(!this.selected){return[2]}this.selected=false;this.host.style.maxHeight="".concat(this.host.scrollHeight,"px");if(this.hasTransition){this.maxHeight="0px"}else{this.handleTransitionEnd()}return[2]}))}))};t.prototype.connect=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){t.$assignPanel(this);this.tab=t;return[2]}))}))};Object.defineProperty(t.prototype,"hasTransition",{get:function(){var t=window.getComputedStyle(this.host).getPropertyValue("transition");return!/none/.test(t)},enumerable:false,configurable:true});t.prototype.render=function(){var t=this,e=t.selected,r=t.tab,a=t.maxHeight;return n(i,{role:"tabpanel",id:this.host.id||o(),"aria-hidden":e?"false":"true","aria-labelledby":r&&r.id,tabIndex:e?0:-1,style:{maxHeight:a}},n("slot",null))};Object.defineProperty(t.prototype,"host",{get:function(){return r(this)},enumerable:false,configurable:true});return t}());s.style=a}}}));
@@ -1,63 +0,0 @@
1
- import { r as registerInstance, e as createEvent, h, f as Host, g as getElement } from './index-52b04dce.js';
2
- import { u as uid } from './uid-a7ff854d.js';
3
- import './index-135dacad.js';
4
-
5
- const ku4TabCss = "button{margin:0;padding:0;border:none;background:transparent;-webkit-appearance:none}:host{position:relative;display:block;width:100%;padding:20px 30px;background-color:#eee;text-align:center;color:#aaa;cursor:pointer}:host(:focus){background-color:#eee;color:#666;z-index:2}:host(:hover){background-color:#eee;color:#666}:host(:active){background-color:#fff;color:#333}:host([selected]){border-top:1px solid #ccc;border-bottom:1px solid #ccc;background-color:#fff;color:#444}button{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;width:100%}@media only screen and (min-width: 768px){:host{width:auto;border-top:1px solid #ccc;border-right:1px solid #ccc;border-top-left-radius:4px;border-top-right-radius:4px;background-color:#eee}:host(:first-of-type){border-left:1px solid #ccc}:host([selected]){padding-bottom:1px;border-top:1px solid #ccc;border-bottom:none}:host([selected]):after{content:\" \";position:absolute;display:block;left:0;bottom:-1px;width:100%;height:1px;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:inherit}}";
6
-
7
- const Ku4Tab = class {
8
- constructor(hostRef) {
9
- registerInstance(this, hostRef);
10
- this.tabClick = createEvent(this, "ku4TabClick", 7);
11
- this.tabKeyUp = createEvent(this, "ku4TabKeyup", 7);
12
- /**
13
- * Active when true
14
- */
15
- this.selected = false;
16
- }
17
- handleClick(e) {
18
- this.tabClick.emit(e);
19
- }
20
- handleKeyUp(e) {
21
- this.tabKeyUp.emit(e);
22
- }
23
- /**
24
- * Set this tab as selected.
25
- */
26
- async select() {
27
- this.selected = true;
28
- this.panel.select();
29
- this.host.focus();
30
- }
31
- /**
32
- * Unset this tab as selected
33
- */
34
- async deselect() {
35
- this.selected = false;
36
- this.panel.deselect();
37
- }
38
- /**
39
- * Connect this tab to a panel
40
- * @param {HTMLElement} panel - The target ku4-tab-panel HTMLElement
41
- */
42
- async connect(panel) {
43
- panel.connect(this);
44
- }
45
- get id() {
46
- return this.host.id || uid();
47
- }
48
- /**
49
- * @param {Ku4TabPanel} panel - panel to assign to this tab
50
- * @internal
51
- */
52
- $assignPanel(panel) {
53
- this.panel = panel;
54
- }
55
- render() {
56
- const { selected, panel } = this;
57
- return (h(Host, { id: this.host.id || uid(), role: "tab", type: "button", tabIndex: selected ? 0 : -1, "aria-controls": panel && panel.id, "aria-selected": selected ? 'true' : 'false' }, h("slot", null)));
58
- }
59
- get host() { return getElement(this); }
60
- };
61
- Ku4Tab.style = ku4TabCss;
62
-
63
- export { Ku4Tab as ku4_tab };
@@ -1 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,o,r){function n(t){return t instanceof o?t:new o((function(e){e(t)}))}return new(o||(o=Promise))((function(o,i){function c(t){try{s(r.next(t))}catch(e){i(e)}}function a(t){try{s(r["throw"](t))}catch(e){i(e)}}function s(t){t.done?o(t.value):n(t.value).then(c,a)}s((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,n,i,c;return c={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function a(t){return function(e){return s([t,e])}}function s(c){if(r)throw new TypeError("Generator is already executing.");while(o)try{if(r=1,n&&(i=c[0]&2?n["return"]:c[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;if(n=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:o.label++;return{value:c[1],done:false};case 5:o.label++;n=c[1];c=[0];continue;case 7:c=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){o=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){o.label=c[1];break}if(c[0]===6&&o.label<i[1]){o.label=i[1];i=c;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(c);break}if(i[2])o.ops.pop();o.trys.pop();continue}c=e.call(t,o)}catch(a){c=[6,a];n=0}finally{r=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};System.register(["./index-4036ffa2.system.js","./uid-3373ce49.system.js","./index-dcd9a8a7.system.js"],(function(t){"use strict";var e,o,r,n,i,c;return{setters:[function(t){e=t.r;o=t.e;r=t.h;n=t.f;i=t.g},function(t){c=t.u},function(){}],execute:function(){var a='button{margin:0;padding:0;border:none;background:transparent;-webkit-appearance:none}:host{position:relative;display:block;width:100%;padding:20px 30px;background-color:#eee;text-align:center;color:#aaa;cursor:pointer}:host(:focus){background-color:#eee;color:#666;z-index:2}:host(:hover){background-color:#eee;color:#666}:host(:active){background-color:#fff;color:#333}:host([selected]){border-top:1px solid #ccc;border-bottom:1px solid #ccc;background-color:#fff;color:#444}button{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;width:100%}@media only screen and (min-width: 768px){:host{width:auto;border-top:1px solid #ccc;border-right:1px solid #ccc;border-top-left-radius:4px;border-top-right-radius:4px;background-color:#eee}:host(:first-of-type){border-left:1px solid #ccc}:host([selected]){padding-bottom:1px;border-top:1px solid #ccc;border-bottom:none}:host([selected]):after{content:" ";position:absolute;display:block;left:0;bottom:-1px;width:100%;height:1px;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:inherit}}';var s=t("ku4_tab",function(){function t(t){e(this,t);this.tabClick=o(this,"ku4TabClick",7);this.tabKeyUp=o(this,"ku4TabKeyup",7);this.selected=false}t.prototype.handleClick=function(t){this.tabClick.emit(t)};t.prototype.handleKeyUp=function(t){this.tabKeyUp.emit(t)};t.prototype.select=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.selected=true;this.panel.select();this.host.focus();return[2]}))}))};t.prototype.deselect=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.selected=false;this.panel.deselect();return[2]}))}))};t.prototype.connect=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){t.connect(this);return[2]}))}))};Object.defineProperty(t.prototype,"id",{get:function(){return this.host.id||c()},enumerable:false,configurable:true});t.prototype.$assignPanel=function(t){this.panel=t};t.prototype.render=function(){var t=this,e=t.selected,o=t.panel;return r(n,{id:this.host.id||c(),role:"tab",type:"button",tabIndex:e?0:-1,"aria-controls":o&&o.id,"aria-selected":e?"true":"false"},r("slot",null))};Object.defineProperty(t.prototype,"host",{get:function(){return i(this)},enumerable:false,configurable:true});return t}());s.style=a}}}));
@@ -1,79 +0,0 @@
1
- import { r as registerInstance, h, g as getElement } from './index-52b04dce.js';
2
-
3
- const ku4TableCss = "ku4-table{position:relative;display:block}@media only screen and (min-width: 1px) and (max-width: 767px){@supports (display: contents){ku4-table[stack-xs=column] table{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}ku4-table[stack-xs=column] thead,ku4-table[stack-xs=column] tbody,ku4-table[stack-xs=column] tfoot,ku4-table[stack-xs=column] tr{display:contents}ku4-table[stack-xs=column] thead .ku4-head-header{display:none}ku4-table[stack-xs=column] tbody th,ku4-table[stack-xs=column] tfoot th{position:absolute;display:block;width:0;height:0;margin:0;padding:0;line-height:0;font-size:0}ku4-table[stack-xs=column] tbody td,ku4-table[stack-xs=column] tfoot td{display:-ms-flexbox;display:flex}ku4-table[stack-xs=column] tbody td:before,ku4-table[stack-xs=column] tfoot td:before{content:attr(data-ku4-row-header)}}ku4-table[stack-xs=row] table{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}ku4-table[stack-xs=row] thead th,ku4-table[stack-xs=row] thead td{display:none}ku4-table[stack-xs=row] thead,ku4-table[stack-xs=row] tbody,ku4-table[stack-xs=row] tfoot,ku4-table[stack-xs=row] tr,ku4-table[stack-xs=row] th,ku4-table[stack-xs=row] td{display:block}ku4-table[stack-xs=row] tbody td:before,ku4-table[stack-xs=row] tfoot td:before{content:attr(data-ku4-column-header)}}@media only screen and (min-width: 768px) and (max-width: 991px){@supports (display: contents){ku4-table[stack-sm=column] table{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}ku4-table[stack-sm=column] thead,ku4-table[stack-sm=column] tbody,ku4-table[stack-sm=column] tfoot,ku4-table[stack-sm=column] tr{display:contents}ku4-table[stack-sm=column] thead .ku4-head-header{display:none}ku4-table[stack-sm=column] tbody th,ku4-table[stack-sm=column] tfoot th{position:absolute;display:block;width:0;height:0;margin:0;padding:0;line-height:0;font-size:0}ku4-table[stack-sm=column] tbody td,ku4-table[stack-sm=column] tfoot td{display:-ms-flexbox;display:flex}ku4-table[stack-sm=column] tbody td:before,ku4-table[stack-sm=column] tfoot td:before{content:attr(data-ku4-row-header)}}ku4-table[stack-sm=row] table{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}ku4-table[stack-sm=row] thead th,ku4-table[stack-sm=row] thead td{display:none}ku4-table[stack-sm=row] thead,ku4-table[stack-sm=row] tbody,ku4-table[stack-sm=row] tfoot,ku4-table[stack-sm=row] tr,ku4-table[stack-sm=row] th,ku4-table[stack-sm=row] td{display:block}ku4-table[stack-sm=row] tbody td:before,ku4-table[stack-sm=row] tfoot td:before{content:attr(data-ku4-column-header)}}";
4
-
5
- const Ku4Table = class {
6
- constructor(hostRef) {
7
- registerInstance(this, hostRef);
8
- /**
9
- * The member to stack on at extra-small views.
10
- */
11
- // eslint-disable-next-line @stencil/strict-mutable
12
- this.stackXs = '';
13
- /**
14
- * The member to stack on at small views.
15
- */
16
- // eslint-disable-next-line @stencil/strict-mutable
17
- this.stackSm = '';
18
- }
19
- stack() {
20
- const theadHeaders = [].slice.call(this.host.querySelectorAll('thead th'));
21
- const tbodyHeaders = [].slice.call(this.host.querySelectorAll('tbody th'));
22
- const tfootHeaders = [].slice.call(this.host.querySelectorAll('tfoot th'));
23
- const hasBodyHeaders = tbodyHeaders.length > 0;
24
- const headerRows = this.host.querySelector('thead tr :first-child');
25
- if (hasBodyHeaders) {
26
- headerRows.classList.add('ku4-head-header');
27
- }
28
- theadHeaders.forEach((th, i) => {
29
- // eslint-disable-next-line no-param-reassign
30
- th.style.order = i + (!hasBodyHeaders);
31
- });
32
- [].slice.call(this.host.querySelectorAll('tbody tr')).forEach((tr, i) => {
33
- [].slice.call(tr.querySelectorAll('td')).forEach((element, j) => {
34
- // eslint-disable-next-line no-param-reassign
35
- element.style.order = j + 1;
36
- try {
37
- const columnHeader = theadHeaders[j + hasBodyHeaders];
38
- const rowHeader = tbodyHeaders[i];
39
- element.setAttribute('data-ku4-column-header', columnHeader.getAttribute('data-ku4-stack-header') || columnHeader.textContent);
40
- element.setAttribute('data-ku4-row-header', rowHeader.getAttribute('data-ku4-stack-header') || rowHeader.textContent);
41
- }
42
- catch (e) { /*Fail silently*/ }
43
- });
44
- });
45
- [].slice.call(this.host.querySelectorAll('tfoot tr')).forEach((tr, i) => {
46
- [].slice.call(tr.querySelectorAll('td')).forEach((element, j) => {
47
- // eslint-disable-next-line no-param-reassign
48
- element.style.order = j + 1;
49
- try {
50
- const columnHeader = theadHeaders[j + hasBodyHeaders];
51
- const rowHeader = tfootHeaders[i];
52
- element.setAttribute('data-ku4-column-header', columnHeader.getAttribute('data-ku4-stack-header') || columnHeader.textContent);
53
- element.setAttribute('data-ku4-row-header', rowHeader.getAttribute('data-ku4-stack-header') || rowHeader.textContent);
54
- }
55
- catch (e) { /*Fail silently*/ }
56
- });
57
- });
58
- }
59
- componentDidLoad() {
60
- this.stack();
61
- this.mutationObserver = new MutationObserver(() => this.stack());
62
- this.mutationObserver.observe(this.host, { childList: true, subtree: true });
63
- }
64
- disconnectedCallback() {
65
- try {
66
- this.mutationObserver.disconnect();
67
- }
68
- catch (e) {
69
- /** Fail silently **/
70
- }
71
- }
72
- render() {
73
- return h("slot", null);
74
- }
75
- get host() { return getElement(this); }
76
- };
77
- Ku4Table.style = ku4TableCss;
78
-
79
- export { Ku4Table as ku4_table };
@@ -1 +0,0 @@
1
- System.register(["./index-4036ffa2.system.js"],(function(t){"use strict";var e,a,o;return{setters:[function(t){e=t.r;a=t.h;o=t.g}],execute:function(){var s="ku4-table{position:relative;display:block}@media only screen and (min-width: 1px) and (max-width: 767px){@supports (display: contents){ku4-table[stack-xs=column] table{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}ku4-table[stack-xs=column] thead,ku4-table[stack-xs=column] tbody,ku4-table[stack-xs=column] tfoot,ku4-table[stack-xs=column] tr{display:contents}ku4-table[stack-xs=column] thead .ku4-head-header{display:none}ku4-table[stack-xs=column] tbody th,ku4-table[stack-xs=column] tfoot th{position:absolute;display:block;width:0;height:0;margin:0;padding:0;line-height:0;font-size:0}ku4-table[stack-xs=column] tbody td,ku4-table[stack-xs=column] tfoot td{display:-ms-flexbox;display:flex}ku4-table[stack-xs=column] tbody td:before,ku4-table[stack-xs=column] tfoot td:before{content:attr(data-ku4-row-header)}}ku4-table[stack-xs=row] table{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}ku4-table[stack-xs=row] thead th,ku4-table[stack-xs=row] thead td{display:none}ku4-table[stack-xs=row] thead,ku4-table[stack-xs=row] tbody,ku4-table[stack-xs=row] tfoot,ku4-table[stack-xs=row] tr,ku4-table[stack-xs=row] th,ku4-table[stack-xs=row] td{display:block}ku4-table[stack-xs=row] tbody td:before,ku4-table[stack-xs=row] tfoot td:before{content:attr(data-ku4-column-header)}}@media only screen and (min-width: 768px) and (max-width: 991px){@supports (display: contents){ku4-table[stack-sm=column] table{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}ku4-table[stack-sm=column] thead,ku4-table[stack-sm=column] tbody,ku4-table[stack-sm=column] tfoot,ku4-table[stack-sm=column] tr{display:contents}ku4-table[stack-sm=column] thead .ku4-head-header{display:none}ku4-table[stack-sm=column] tbody th,ku4-table[stack-sm=column] tfoot th{position:absolute;display:block;width:0;height:0;margin:0;padding:0;line-height:0;font-size:0}ku4-table[stack-sm=column] tbody td,ku4-table[stack-sm=column] tfoot td{display:-ms-flexbox;display:flex}ku4-table[stack-sm=column] tbody td:before,ku4-table[stack-sm=column] tfoot td:before{content:attr(data-ku4-row-header)}}ku4-table[stack-sm=row] table{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}ku4-table[stack-sm=row] thead th,ku4-table[stack-sm=row] thead td{display:none}ku4-table[stack-sm=row] thead,ku4-table[stack-sm=row] tbody,ku4-table[stack-sm=row] tfoot,ku4-table[stack-sm=row] tr,ku4-table[stack-sm=row] th,ku4-table[stack-sm=row] td{display:block}ku4-table[stack-sm=row] tbody td:before,ku4-table[stack-sm=row] tfoot td:before{content:attr(data-ku4-column-header)}}";var l=t("ku4_table",function(){function t(t){e(this,t);this.stackXs="";this.stackSm=""}t.prototype.stack=function(){var t=[].slice.call(this.host.querySelectorAll("thead th"));var e=[].slice.call(this.host.querySelectorAll("tbody th"));var a=[].slice.call(this.host.querySelectorAll("tfoot th"));var o=e.length>0;var s=this.host.querySelector("thead tr :first-child");if(o){s.classList.add("ku4-head-header")}t.forEach((function(t,e){t.style.order=e+!o}));[].slice.call(this.host.querySelectorAll("tbody tr")).forEach((function(a,s){[].slice.call(a.querySelectorAll("td")).forEach((function(a,l){a.style.order=l+1;try{var c=t[l+o];var r=e[s];a.setAttribute("data-ku4-column-header",c.getAttribute("data-ku4-stack-header")||c.textContent);a.setAttribute("data-ku4-row-header",r.getAttribute("data-ku4-stack-header")||r.textContent)}catch(u){}}))}));[].slice.call(this.host.querySelectorAll("tfoot tr")).forEach((function(e,s){[].slice.call(e.querySelectorAll("td")).forEach((function(e,l){e.style.order=l+1;try{var c=t[l+o];var r=a[s];e.setAttribute("data-ku4-column-header",c.getAttribute("data-ku4-stack-header")||c.textContent);e.setAttribute("data-ku4-row-header",r.getAttribute("data-ku4-stack-header")||r.textContent)}catch(u){}}))}))};t.prototype.componentDidLoad=function(){var t=this;this.stack();this.mutationObserver=new MutationObserver((function(){return t.stack()}));this.mutationObserver.observe(this.host,{childList:true,subtree:true})};t.prototype.disconnectedCallback=function(){try{this.mutationObserver.disconnect()}catch(t){}};t.prototype.render=function(){return a("slot",null)};Object.defineProperty(t.prototype,"host",{get:function(){return o(this)},enumerable:false,configurable:true});return t}());l.style=s}}}));
@@ -1,120 +0,0 @@
1
- import { r as registerInstance, h, f as Host, g as getElement } from './index-52b04dce.js';
2
- import { C, j, M } from './index-135dacad.js';
3
-
4
- const ku4TooltipCss = ":host{position:fixed;display:none;opacity:0;z-index:2;background-color:#fff;border:solid 1px #ccc}:host([visible]){display:block;opacity:1;-webkit-transition:opacity 0.4s;transition:opacity 0.4s}:host .arrow{position:absolute;width:var(--ku4-tooltip-arrow-size, 14px);height:var(--ku4-tooltip-arrow-size, 14px);background-color:inherit;-webkit-transform:rotate(45deg);transform:rotate(45deg);border:inherit;-webkit-box-shadow:var(--ku4-tooltip-arrow-box-shadow, none);box-shadow:var(--ku4-tooltip-arrow-box-shadow, none)}:host .content{position:relative}:host([top]) .arrow{top:calc(100% - var(--ku4-tooltip-arrow-offset, 7px));left:calc(50% - var(--ku4-tooltip-arrow-offset, 7px));border-top:none !important;border-left:none !important}:host([left]) .arrow{top:calc(50% - var(--ku4-tooltip-arrow-offset, 7px));left:calc(100% - var(--ku4-tooltip-arrow-offset, 7px));border-left:none !important;border-bottom:none !important}:host([bottom]) .arrow{left:calc(50% - var(--ku4-tooltip-arrow-offset, 7px));bottom:calc(100% - var(--ku4-tooltip-arrow-offset, 7px));border-bottom:none !important;border-right:none !important}:host([right]) .arrow{top:calc(50% - var(--ku4-tooltip-arrow-offset, 7px));right:calc(100% - var(--ku4-tooltip-arrow-offset, 7px));border-top:none !important;border-right:none !important}";
5
-
6
- const Ku4Tooltip = class {
7
- constructor(hostRef) {
8
- registerInstance(this, hostRef);
9
- this.isShowing = false;
10
- this.show = this.show.bind(this);
11
- this.hide = this.hide.bind(this);
12
- this._show = this._show.bind(this);
13
- this._hide = this._hide.bind(this);
14
- this._toggle = this._toggle.bind(this);
15
- this.hideTimeout = new C(200).onTimeout(this._hide);
16
- }
17
- /**
18
- * Show tooltip on target element.
19
- * @param {HTMLElement} element - Element to show tooltip on
20
- */
21
- async show(element) {
22
- this.hideTimeout.clear();
23
- if (this.host.contains(element)) {
24
- return;
25
- }
26
- else {
27
- this.isShowing = true;
28
- this.host.setAttribute('visible', 'true');
29
- this.calcualatePosition(element);
30
- this.scrollListener = j(() => this.calcualatePosition(element));
31
- window.addEventListener('scroll', this.scrollListener, { passive: true });
32
- }
33
- }
34
- /**
35
- * Hide tool tip.
36
- */
37
- async hide() {
38
- this.hideTimeout.clear().start();
39
- }
40
- _show(e) {
41
- this.show(e.target);
42
- }
43
- _hide() {
44
- window.removeEventListener('scroll', this.scrollListener);
45
- this.host.removeAttribute('visible');
46
- this.isShowing = false;
47
- }
48
- _toggle(e) {
49
- this.isShowing ? this._hide() : this._show(e);
50
- }
51
- calcualatePosition(target) {
52
- const { left, top, width, height } = target.getBoundingClientRect();
53
- const { left: hleft, top: htop, width: hwidth, height: hheight } = this.host.getBoundingClientRect();
54
- const targetBox = new M(left, top, width, height);
55
- const hostBox = new M(hleft, htop, hwidth, hheight);
56
- /**
57
- * The measurements aren't quite lining up with center. They are off by a small bit
58
- * Need to figure out why.
59
- * Also the Arrow is not lining up. Looks like some small margin mistakes fix.
60
- * Could also stand to figure out a way to support an arrow that is white with a border.
61
- */
62
- if (this.top) {
63
- this.host.style.left = `${targetBox.origin.x + targetBox.dimensions.x / 2 - hostBox.dimensions.x / 2}px`;
64
- this.host.style.top = `${targetBox.origin.y - hostBox.dimensions.y - 15}px`;
65
- }
66
- else if (this.left) {
67
- this.host.style.left = `${targetBox.origin.x - hostBox.dimensions.x - 15}px`;
68
- this.host.style.top = `${targetBox.origin.y + targetBox.dimensions.y / 2 - hostBox.dimensions.y / 2}px`;
69
- }
70
- else if (this.bottom) {
71
- this.host.style.left = `${targetBox.origin.x + targetBox.dimensions.x / 2 - hostBox.dimensions.x / 2}px`;
72
- this.host.style.top = `${targetBox.origin.y + targetBox.dimensions.y + 15}px`;
73
- }
74
- else if (this.right) {
75
- this.host.style.left = `${targetBox.origin.x + targetBox.dimensions.x + 15}px`;
76
- this.host.style.top = `${targetBox.origin.y + targetBox.dimensions.y / 2 - hostBox.dimensions.y / 2}px`;
77
- }
78
- else {
79
- this.host.style.left = `${targetBox.origin.x + targetBox.dimensions.x / 2 - hostBox.dimensions.x / 2}px`;
80
- this.host.style.top = `${targetBox.origin.y + targetBox.dimensions.y + 15}px`;
81
- }
82
- }
83
- componentWillLoad() {
84
- const { debug, element, host, top, left, bottom, right } = this;
85
- if (!(top || left || bottom || right)) {
86
- this.host.setAttribute('bottom', '');
87
- }
88
- document.querySelectorAll(element).forEach((element) => {
89
- host.addEventListener('mouseover', this._show);
90
- element.addEventListener('mouseover', this._show);
91
- element.addEventListener('touchstart', this._toggle, { passive: true });
92
- if (debug) {
93
- return;
94
- }
95
- host.addEventListener('mouseout', this.hide);
96
- element.addEventListener('mouseout', this.hide);
97
- });
98
- }
99
- disconnectedCallback() {
100
- const { debug, element, hideTimeout, host } = this;
101
- document.querySelectorAll(element).forEach((element) => {
102
- host.removeEventListener('mouseover', this._show);
103
- element.removeEventListener('mouseover', this._show);
104
- element.removeEventListener('touchstart', this._toggle);
105
- if (debug) {
106
- return;
107
- }
108
- host.removeEventListener('mouseout', this.hide);
109
- element.removeEventListener('mouseout', this.hide);
110
- });
111
- hideTimeout.clear();
112
- }
113
- render() {
114
- return (h(Host, { role: "tooltip" }, h("div", { class: "arrow" }), h("div", { class: "content" }, h("slot", null))));
115
- }
116
- get host() { return getElement(this); }
117
- };
118
- Ku4Tooltip.style = ku4TooltipCss;
119
-
120
- export { Ku4Tooltip as ku4_tooltip };
@@ -1 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(t,o,e,i){function n(t){return t instanceof e?t:new e((function(o){o(t)}))}return new(e||(e=Promise))((function(e,r){function s(t){try{h(i.next(t))}catch(o){r(o)}}function a(t){try{h(i["throw"](t))}catch(o){r(o)}}function h(t){t.done?e(t.value):n(t.value).then(s,a)}h((i=i.apply(t,o||[])).next())}))};var __generator=this&&this.__generator||function(t,o){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,n,r,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(o){return h([t,o])}}function h(s){if(i)throw new TypeError("Generator is already executing.");while(e)try{if(i=1,n&&(r=s[0]&2?n["return"]:s[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;if(n=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:e.label++;return{value:s[1],done:false};case 5:e.label++;n=s[1];s=[0];continue;case 7:s=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){e=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){e.label=s[1];break}if(s[0]===6&&e.label<r[1]){e.label=r[1];r=s;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(s);break}if(r[2])e.ops.pop();e.trys.pop();continue}s=o.call(t,e)}catch(a){s=[6,a];n=0}finally{i=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./index-4036ffa2.system.js","./index-dcd9a8a7.system.js"],(function(t){"use strict";var o,e,i,n,r,s,a;return{setters:[function(t){o=t.r;e=t.h;i=t.f;n=t.g},function(t){r=t.C;s=t.j;a=t.M}],execute:function(){var h=":host{position:fixed;display:none;opacity:0;z-index:2;background-color:#fff;border:solid 1px #ccc}:host([visible]){display:block;opacity:1;-webkit-transition:opacity 0.4s;transition:opacity 0.4s}:host .arrow{position:absolute;width:var(--ku4-tooltip-arrow-size, 14px);height:var(--ku4-tooltip-arrow-size, 14px);background-color:inherit;-webkit-transform:rotate(45deg);transform:rotate(45deg);border:inherit;-webkit-box-shadow:var(--ku4-tooltip-arrow-box-shadow, none);box-shadow:var(--ku4-tooltip-arrow-box-shadow, none)}:host .content{position:relative}:host([top]) .arrow{top:calc(100% - var(--ku4-tooltip-arrow-offset, 7px));left:calc(50% - var(--ku4-tooltip-arrow-offset, 7px));border-top:none !important;border-left:none !important}:host([left]) .arrow{top:calc(50% - var(--ku4-tooltip-arrow-offset, 7px));left:calc(100% - var(--ku4-tooltip-arrow-offset, 7px));border-left:none !important;border-bottom:none !important}:host([bottom]) .arrow{left:calc(50% - var(--ku4-tooltip-arrow-offset, 7px));bottom:calc(100% - var(--ku4-tooltip-arrow-offset, 7px));border-bottom:none !important;border-right:none !important}:host([right]) .arrow{top:calc(50% - var(--ku4-tooltip-arrow-offset, 7px));right:calc(100% - var(--ku4-tooltip-arrow-offset, 7px));border-top:none !important;border-right:none !important}";var l=t("ku4_tooltip",function(){function t(t){o(this,t);this.isShowing=false;this.show=this.show.bind(this);this.hide=this.hide.bind(this);this._show=this._show.bind(this);this._hide=this._hide.bind(this);this._toggle=this._toggle.bind(this);this.hideTimeout=new r(200).onTimeout(this._hide)}t.prototype.show=function(t){return __awaiter(this,void 0,void 0,(function(){var o=this;return __generator(this,(function(e){this.hideTimeout.clear();if(this.host.contains(t)){return[2]}else{this.isShowing=true;this.host.setAttribute("visible","true");this.calcualatePosition(t);this.scrollListener=s((function(){return o.calcualatePosition(t)}));window.addEventListener("scroll",this.scrollListener,{passive:true})}return[2]}))}))};t.prototype.hide=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.hideTimeout.clear().start();return[2]}))}))};t.prototype._show=function(t){this.show(t.target)};t.prototype._hide=function(){window.removeEventListener("scroll",this.scrollListener);this.host.removeAttribute("visible");this.isShowing=false};t.prototype._toggle=function(t){this.isShowing?this._hide():this._show(t)};t.prototype.calcualatePosition=function(t){var o=t.getBoundingClientRect(),e=o.left,i=o.top,n=o.width,r=o.height;var s=this.host.getBoundingClientRect(),h=s.left,l=s.top,c=s.width,u=s.height;var p=new a(e,i,n,r);var f=new a(h,l,c,u);if(this.top){this.host.style.left="".concat(p.origin.x+p.dimensions.x/2-f.dimensions.x/2,"px");this.host.style.top="".concat(p.origin.y-f.dimensions.y-15,"px")}else if(this.left){this.host.style.left="".concat(p.origin.x-f.dimensions.x-15,"px");this.host.style.top="".concat(p.origin.y+p.dimensions.y/2-f.dimensions.y/2,"px")}else if(this.bottom){this.host.style.left="".concat(p.origin.x+p.dimensions.x/2-f.dimensions.x/2,"px");this.host.style.top="".concat(p.origin.y+p.dimensions.y+15,"px")}else if(this.right){this.host.style.left="".concat(p.origin.x+p.dimensions.x+15,"px");this.host.style.top="".concat(p.origin.y+p.dimensions.y/2-f.dimensions.y/2,"px")}else{this.host.style.left="".concat(p.origin.x+p.dimensions.x/2-f.dimensions.x/2,"px");this.host.style.top="".concat(p.origin.y+p.dimensions.y+15,"px")}};t.prototype.componentWillLoad=function(){var t=this;var o=this,e=o.debug,i=o.element,n=o.host,r=o.top,s=o.left,a=o.bottom,h=o.right;if(!(r||s||a||h)){this.host.setAttribute("bottom","")}document.querySelectorAll(i).forEach((function(o){n.addEventListener("mouseover",t._show);o.addEventListener("mouseover",t._show);o.addEventListener("touchstart",t._toggle,{passive:true});if(e){return}n.addEventListener("mouseout",t.hide);o.addEventListener("mouseout",t.hide)}))};t.prototype.disconnectedCallback=function(){var t=this;var o=this,e=o.debug,i=o.element,n=o.hideTimeout,r=o.host;document.querySelectorAll(i).forEach((function(o){r.removeEventListener("mouseover",t._show);o.removeEventListener("mouseover",t._show);o.removeEventListener("touchstart",t._toggle);if(e){return}r.removeEventListener("mouseout",t.hide);o.removeEventListener("mouseout",t.hide)}));n.clear()};t.prototype.render=function(){return e(i,{role:"tooltip"},e("div",{class:"arrow"}),e("div",{class:"content"},e("slot",null)))};Object.defineProperty(t.prototype,"host",{get:function(){return n(this)},enumerable:false,configurable:true});return t}());l.style=h}}}));
@@ -1,162 +0,0 @@
1
- import { r as registerInstance, e as createEvent, h, f as Host, g as getElement } from './index-52b04dce.js';
2
- import { t, R, Y } from './index-135dacad.js';
3
-
4
- /**
5
- * Business logic for form validation:
6
- * It tests against a list of regular expressions that all must pass for this
7
- * to return true. And IFF an element is passed it will also have to match this value.
8
- * @param {Array<RegExp>} expressions - List of regular expressions to test against.
9
- * @param {string} value - The value to test
10
- * @param {Array<string>} [options] - A list of valid options that this value must match if not null
11
- * @param {HTMLElement} [element] - An element to test if the value matches its value if not null.
12
- */
13
- const validate = (expressions, value, options, element) => options
14
- ? options.some(v => v === value) && expressions.every(r => r.test(value))
15
- : element
16
- ? element.value === value && expressions.every(r => r.test(value))
17
- : expressions.every(r => r.test(value));
18
-
19
- const ku4ValidationCss = ":host{visibility:hidden !important}:host([invalid]){visibility:visible !important}:host([disabled]){visibility:hidden !important}:host([invalid][disabled]){visibility:hidden !important}:host([invalid][hidden]){visibility:hidden !important}";
20
-
21
- const Ku4Validation = class {
22
- constructor(hostRef) {
23
- registerInstance(this, hostRef);
24
- this.didValidate = createEvent(this, "validate", 7);
25
- /**
26
- * Validation RegExp pattern that the target field must match to
27
- * be considered valid. Multiple patterns can be passed delimited
28
- * by a `space` character. e.g. pattern1 pattern2 pattern3 etc.
29
- * If your target field is optional you can accomplish this with
30
- * your pattern using "(^$)|(YOUR-PATTERN)". This says that the
31
- * field must be empty (^$) OR (YOUR-PATTERN).
32
- */
33
- this.pattern = '.*';
34
- /**
35
- * Any RegExp flags that you want to include in your pattern. Multiple
36
- * patterns can be passed delimited by a `space` character. e.g.
37
- * using the pattern1 pattern2 pattern3 example from the `pattern`
38
- * property, you could pass "gimsuy gim gi". If you wanted to pass
39
- * flags only for patterns 1 and 3 you will just skip flags for pattern2
40
- * by typing nothing and instead typing another "space" e.g. "gimsuy gi".
41
- * If you wanted to skip flags for pattern1 you could start flags with a
42
- * "space" e.g. " gim gi".
43
- */
44
- this.flags = '';
45
- /**
46
- * A reference to a named function or a function body that
47
- * define a validation criteria and return `true` when the
48
- * defined validation criteria are satisfied.
49
- * The function will be called with one argument, `value`,
50
- * that will contain the current value of the target field.
51
- * Example: method="return value === 'valid'", or
52
- * function validate(value) { return value === 'valid'; }
53
- * method="validate(value)"
54
- */
55
- this.method = '';
56
- const patterns = this.pattern.split(' ');
57
- const flags = this.flags.split(' ');
58
- const method = this.method.trim();
59
- this.regex = patterns.map((pattern, i) => new RegExp(pattern, flags[i]));
60
- this.validationMethod = t.isNullOrEmpty(method)
61
- ? () => true
62
- : new Function('value', (/^return/.test(method) ? method : `return ${method}`));
63
- this.handleInput = this.handleInput.bind(this);
64
- this.handleChange = this.handleChange.bind(this);
65
- this.handleBlur = this.handleBlur.bind(this);
66
- this.handleReset = this.handleReset.bind(this);
67
- }
68
- /**
69
- * Call to explicitly validate this validation. This method
70
- * is called internally on change and blur of the input internally.
71
- * There is no default need to call this method.
72
- */
73
- async validate() {
74
- return this.assert();
75
- }
76
- handleInput() {
77
- (this.input.type === 'file' || t.isFalse(this.isValid)) && this.assert();
78
- }
79
- handleChange() {
80
- (this.input.type === 'file' || t.isFalse(this.isValid)) && this.assert();
81
- }
82
- handleBlur() {
83
- this.assert();
84
- }
85
- handleReset() {
86
- this.isValid = true;
87
- this.invalid = !this.isValid;
88
- this.input.setAttribute('aria-invalid', this.invalid);
89
- }
90
- assert() {
91
- const { ele, validOptions, input, regex, checked } = this;
92
- if (input.type === 'file' && t.isNullOrEmpty(input.value)) {
93
- return;
94
- }
95
- const previousIsValid = this.isValid;
96
- this.isValid = this.disabled
97
- ? true
98
- : t.isBool(checked)
99
- ? input.checked === checked
100
- : validate(regex, input.value, validOptions, ele) && this.validationMethod(input.value);
101
- this.invalid = !this.isValid;
102
- input.setAttribute('aria-invalid', this.invalid);
103
- if (t.isFalse(previousIsValid) && this.isValid) {
104
- this.didValidate.emit(this.isValid);
105
- }
106
- return this.isValid;
107
- }
108
- componentWillLoad() {
109
- this.input = document.getElementById(this.for);
110
- if (t.exists(this.input)) {
111
- this.ele = document.getElementById(this.element) || document.querySelector(this.element);
112
- this.validOptions = t.exists(this.values)
113
- ? this.values.split(',')
114
- : (this.ele && this.ele.nodeName === 'DATALIST' &&
115
- [].slice.call(this.ele.querySelectorAll('option'))
116
- .map(option => option.value));
117
- const describedby = this.input.getAttribute('aria-describedby');
118
- const id = this.host.getAttribute('id') || R.uid();
119
- this.host.setAttribute('id', id);
120
- if (t.isNullOrEmpty(describedby)) {
121
- this.input.setAttribute('aria-describedby', id);
122
- }
123
- /**
124
- * We "wait" to put this on the next event loop. This allows
125
- * ku4-mask to be placed anywhere in the dom and not affect
126
- * to workings of ku4-validation.
127
- */
128
- Y(0).then(() => {
129
- this.input.addEventListener('input', this.handleInput);
130
- this.input.addEventListener('change', this.handleChange);
131
- this.input.addEventListener('blur', this.handleBlur);
132
- });
133
- if (t.isFunction(this.host.closest)) {
134
- this.form = this.host.closest('form');
135
- if (this.form && this.form.addEventListener) {
136
- this.form.addEventListener('reset', this.handleReset);
137
- }
138
- }
139
- }
140
- else {
141
- // eslint-disable-next-line no-console
142
- console.error('ku4-validation must have a valid `for` referencing target field `id`.');
143
- }
144
- }
145
- disconnectedCallback() {
146
- if (this.input && this.input.removeEventListener) {
147
- this.input.removeEventListener('input', this.handleInput);
148
- this.input.removeEventListener('change', this.handleChange);
149
- this.input.removeEventListener('blur', this.handleBlur);
150
- }
151
- if (this.form && this.form.removeEventListener) {
152
- this.form.removeEventListener('reset', this.handleReset);
153
- }
154
- }
155
- render() {
156
- return h(Host, { role: "alert", "aria-live": "assertive" }, h("slot", null));
157
- }
158
- get host() { return getElement(this); }
159
- };
160
- Ku4Validation.style = ku4ValidationCss;
161
-
162
- export { Ku4Validation as ku4_validation };
@@ -1 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,i,n){function s(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,r){function a(t){try{o(n.next(t))}catch(e){r(e)}}function l(t){try{o(n["throw"](t))}catch(e){r(e)}}function o(t){t.done?i(t.value):s(t.value).then(a,l)}o((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,s,r,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(t){return function(e){return o([t,e])}}function o(a){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,s&&(r=a[0]&2?s["return"]:a[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,a[1])).done)return r;if(s=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;s=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(a[0]===6&&i.label<r[1]){i.label=r[1];r=a;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(a);break}if(r[2])i.ops.pop();i.trys.pop();continue}a=e.call(t,i)}catch(l){a=[6,l];s=0}finally{n=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./index-4036ffa2.system.js","./index-dcd9a8a7.system.js"],(function(t){"use strict";var e,i,n,s,r,a,l,o;return{setters:[function(t){e=t.r;i=t.e;n=t.h;s=t.f;r=t.g},function(t){a=t.t;l=t.R;o=t.Y}],execute:function(){var h=function(t,e,i,n){return i?i.some((function(t){return t===e}))&&t.every((function(t){return t.test(e)})):n?n.value===e&&t.every((function(t){return t.test(e)})):t.every((function(t){return t.test(e)}))};var u=":host{visibility:hidden !important}:host([invalid]){visibility:visible !important}:host([disabled]){visibility:hidden !important}:host([invalid][disabled]){visibility:hidden !important}:host([invalid][hidden]){visibility:hidden !important}";var d=t("ku4_validation",function(){function t(t){e(this,t);this.didValidate=i(this,"validate",7);this.pattern=".*";this.flags="";this.method="";var n=this.pattern.split(" ");var s=this.flags.split(" ");var r=this.method.trim();this.regex=n.map((function(t,e){return new RegExp(t,s[e])}));this.validationMethod=a.isNullOrEmpty(r)?function(){return true}:new Function("value",/^return/.test(r)?r:"return ".concat(r));this.handleInput=this.handleInput.bind(this);this.handleChange=this.handleChange.bind(this);this.handleBlur=this.handleBlur.bind(this);this.handleReset=this.handleReset.bind(this)}t.prototype.validate=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.assert()]}))}))};t.prototype.handleInput=function(){(this.input.type==="file"||a.isFalse(this.isValid))&&this.assert()};t.prototype.handleChange=function(){(this.input.type==="file"||a.isFalse(this.isValid))&&this.assert()};t.prototype.handleBlur=function(){this.assert()};t.prototype.handleReset=function(){this.isValid=true;this.invalid=!this.isValid;this.input.setAttribute("aria-invalid",this.invalid)};t.prototype.assert=function(){var t=this,e=t.ele,i=t.validOptions,n=t.input,s=t.regex,r=t.checked;if(n.type==="file"&&a.isNullOrEmpty(n.value)){return}var l=this.isValid;this.isValid=this.disabled?true:a.isBool(r)?n.checked===r:h(s,n.value,i,e)&&this.validationMethod(n.value);this.invalid=!this.isValid;n.setAttribute("aria-invalid",this.invalid);if(a.isFalse(l)&&this.isValid){this.didValidate.emit(this.isValid)}return this.isValid};t.prototype.componentWillLoad=function(){var t=this;this.input=document.getElementById(this.for);if(a.exists(this.input)){this.ele=document.getElementById(this.element)||document.querySelector(this.element);this.validOptions=a.exists(this.values)?this.values.split(","):this.ele&&this.ele.nodeName==="DATALIST"&&[].slice.call(this.ele.querySelectorAll("option")).map((function(t){return t.value}));var e=this.input.getAttribute("aria-describedby");var i=this.host.getAttribute("id")||l.uid();this.host.setAttribute("id",i);if(a.isNullOrEmpty(e)){this.input.setAttribute("aria-describedby",i)}o(0).then((function(){t.input.addEventListener("input",t.handleInput);t.input.addEventListener("change",t.handleChange);t.input.addEventListener("blur",t.handleBlur)}));if(a.isFunction(this.host.closest)){this.form=this.host.closest("form");if(this.form&&this.form.addEventListener){this.form.addEventListener("reset",this.handleReset)}}}else{console.error("ku4-validation must have a valid `for` referencing target field `id`.")}};t.prototype.disconnectedCallback=function(){if(this.input&&this.input.removeEventListener){this.input.removeEventListener("input",this.handleInput);this.input.removeEventListener("change",this.handleChange);this.input.removeEventListener("blur",this.handleBlur)}if(this.form&&this.form.removeEventListener){this.form.removeEventListener("reset",this.handleReset)}};t.prototype.render=function(){return n(s,{role:"alert","aria-live":"assertive"},n("slot",null))};Object.defineProperty(t.prototype,"host",{get:function(){return r(this)},enumerable:false,configurable:true});return t}());d.style=u}}}));