ku4web-components 6.4.69 → 6.4.74

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 (212) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/css-shim-3bfdba4f.js +6 -0
  3. package/dist/cjs/dom-8ac1ad03.js +75 -0
  4. package/dist/cjs/index-51b7a610.js +14 -0
  5. package/dist/cjs/index-6d979ba1.js +10 -0
  6. package/dist/cjs/index-a015c727.js +3067 -0
  7. package/dist/cjs/{index-e2a47c3c.js → index-c25cf44f.js} +1 -1
  8. package/dist/cjs/ku4-carousel-controls.cjs.entry.js +2 -2
  9. package/dist/cjs/ku4-carousel-slide.cjs.entry.js +1 -1
  10. package/dist/cjs/ku4-carousel.cjs.entry.js +4 -4
  11. package/dist/cjs/ku4-col.cjs.entry.js +1 -1
  12. package/dist/cjs/ku4-drawer.cjs.entry.js +1 -1
  13. package/dist/cjs/ku4-feature.cjs.entry.js +2 -2
  14. package/dist/cjs/ku4-focus-trap.cjs.entry.js +26 -26
  15. package/dist/cjs/ku4-form.cjs.entry.js +3 -3
  16. package/dist/cjs/ku4-grid.cjs.entry.js +1 -1
  17. package/dist/cjs/ku4-label.cjs.entry.js +2 -2
  18. package/dist/cjs/ku4-mask.cjs.entry.js +2 -2
  19. package/dist/cjs/ku4-modal.cjs.entry.js +3 -3
  20. package/dist/cjs/ku4-panel.cjs.entry.js +1 -1
  21. package/dist/cjs/ku4-preview.cjs.entry.js +43 -14
  22. package/dist/cjs/ku4-tab-list.cjs.entry.js +6 -6
  23. package/dist/cjs/ku4-tab-panel.cjs.entry.js +3 -3
  24. package/dist/cjs/ku4-tab.cjs.entry.js +3 -3
  25. package/dist/cjs/ku4-table.cjs.entry.js +1 -1
  26. package/dist/cjs/ku4-tooltip.cjs.entry.js +2 -2
  27. package/dist/cjs/ku4-validation.cjs.entry.js +2 -2
  28. package/dist/cjs/ku4web-components.cjs.js +98 -7
  29. package/dist/cjs/loader.cjs.js +18 -2
  30. package/dist/cjs/uid-3dd31175.js +11 -0
  31. package/dist/collection/capabilities/a11y/aria.js +26 -0
  32. package/dist/collection/capabilities/angular/index.js +24 -0
  33. package/dist/collection/capabilities/decorators/deprecated.js +20 -0
  34. package/dist/collection/capabilities/decorators/index.js +3 -0
  35. package/dist/collection/capabilities/decorators/memoize.js +7 -0
  36. package/dist/collection/capabilities/dom/isFocusable.js +7 -0
  37. package/dist/collection/capabilities/dom/queryFocusable.js +2 -0
  38. package/dist/collection/capabilities/identity/uid.js +6 -0
  39. package/dist/collection/capabilities/mask/index.js +5 -0
  40. package/dist/collection/capabilities/mask/patterns/date.js +40 -0
  41. package/dist/collection/capabilities/mask/patterns/index.js +7 -0
  42. package/dist/collection/capabilities/react/index.js +25 -0
  43. package/dist/collection/capabilities/testing/html.js +14 -0
  44. package/dist/collection/capabilities/testing/styles.js +14 -0
  45. package/dist/collection/capabilities/vue/index.js +28 -0
  46. package/dist/collection/capabilities/vue3/index.js +26 -0
  47. package/dist/collection/collection-manifest.json +31 -0
  48. package/dist/collection/components/ku4-carousel/ku4-carousel.css +221 -0
  49. package/dist/collection/components/ku4-carousel/ku4-carousel.js +360 -0
  50. package/dist/collection/components/ku4-carousel-controls/ku4-carousel-controls.css +32 -0
  51. package/dist/collection/components/ku4-carousel-controls/ku4-carousel-controls.js +106 -0
  52. package/dist/collection/components/ku4-carousel-slide/ku4-carousel-slide.css +3 -0
  53. package/dist/collection/components/ku4-carousel-slide/ku4-carousel-slide.js +140 -0
  54. package/dist/collection/components/ku4-col/ku4-col.css +601 -0
  55. package/dist/collection/components/ku4-col/ku4-col.js +288 -0
  56. package/dist/collection/components/ku4-drawer/ku4-drawer.css +56 -0
  57. package/dist/collection/components/ku4-drawer/ku4-drawer.js +163 -0
  58. package/dist/collection/components/ku4-feature/ku4-feature.js +70 -0
  59. package/dist/collection/components/ku4-focus-trap/ku4-focus-trap.css +3 -0
  60. package/dist/collection/components/ku4-focus-trap/ku4-focus-trap.js +441 -0
  61. package/dist/collection/components/ku4-form/ku4-form.js +202 -0
  62. package/dist/collection/components/ku4-grid/ku4-grid.css +751 -0
  63. package/dist/collection/components/ku4-grid/ku4-grid.js +408 -0
  64. package/dist/collection/components/ku4-label/ku4-label.css +36 -0
  65. package/dist/collection/components/ku4-label/ku4-label.js +115 -0
  66. package/dist/collection/components/ku4-mask/ku4-mask.css +3 -0
  67. package/dist/collection/components/ku4-mask/ku4-mask.js +437 -0
  68. package/dist/collection/components/ku4-modal/ku4-modal.css +85 -0
  69. package/dist/collection/components/ku4-modal/ku4-modal.js +186 -0
  70. package/dist/collection/components/ku4-panel/ku4-panel.css +14 -0
  71. package/dist/collection/components/ku4-panel/ku4-panel.js +119 -0
  72. package/dist/collection/components/ku4-preview/ku4-preview.css +23 -0
  73. package/dist/collection/components/ku4-preview/ku4-preview.js +266 -0
  74. package/dist/collection/components/ku4-tab/ku4-tab.css +82 -0
  75. package/dist/collection/components/ku4-tab/ku4-tab.js +191 -0
  76. package/dist/collection/components/ku4-tab-list/ku4-tab-list.css +6 -0
  77. package/dist/collection/components/ku4-tab-list/ku4-tab-list.js +118 -0
  78. package/dist/collection/components/ku4-tab-panel/ku4-tab-panel.css +26 -0
  79. package/dist/collection/components/ku4-tab-panel/ku4-tab-panel.js +166 -0
  80. package/dist/collection/components/ku4-table/ku4-table.css +116 -0
  81. package/dist/collection/components/ku4-table/ku4-table.js +120 -0
  82. package/dist/collection/components/ku4-tooltip/ku4-tooltip.css +56 -0
  83. package/dist/collection/components/ku4-tooltip/ku4-tooltip.js +274 -0
  84. package/dist/collection/components/ku4-validation/ku4-validation.css +19 -0
  85. package/dist/collection/components/ku4-validation/ku4-validation.js +364 -0
  86. package/dist/collection/components/ku4-validation/validate.js +14 -0
  87. package/dist/collection/index.js +1 -0
  88. package/dist/collection/security.js +27 -0
  89. package/dist/esm/app-globals-0f993ce5.js +3 -0
  90. package/dist/esm/css-shim-20dbffa5.js +4 -0
  91. package/dist/esm/dom-c5ed0ba5.js +73 -0
  92. package/dist/esm/{index-a39e08fb.js → index-12aee218.js} +1 -1
  93. package/dist/esm/index-40000e6d.js +3 -0
  94. package/dist/esm/index-80439f22.js +3031 -0
  95. package/dist/esm/index-89916128.js +3 -0
  96. package/dist/esm/ku4-carousel-controls.entry.js +2 -2
  97. package/dist/esm/ku4-carousel-slide.entry.js +1 -1
  98. package/dist/esm/ku4-carousel.entry.js +4 -4
  99. package/dist/esm/ku4-col.entry.js +1 -1
  100. package/dist/esm/ku4-drawer.entry.js +1 -1
  101. package/dist/esm/ku4-feature.entry.js +2 -2
  102. package/dist/esm/ku4-focus-trap.entry.js +3 -3
  103. package/dist/esm/ku4-form.entry.js +3 -3
  104. package/dist/esm/ku4-grid.entry.js +1 -1
  105. package/dist/esm/ku4-label.entry.js +2 -2
  106. package/dist/esm/ku4-mask.entry.js +2 -2
  107. package/dist/esm/ku4-modal.entry.js +3 -3
  108. package/dist/esm/ku4-panel.entry.js +1 -1
  109. package/dist/esm/ku4-preview.entry.js +35 -6
  110. package/dist/esm/ku4-tab-list.entry.js +6 -6
  111. package/dist/esm/ku4-tab-panel.entry.js +3 -3
  112. package/dist/esm/ku4-tab.entry.js +3 -3
  113. package/dist/esm/ku4-table.entry.js +1 -1
  114. package/dist/esm/ku4-tooltip.entry.js +2 -2
  115. package/dist/esm/ku4-validation.entry.js +2 -2
  116. package/dist/esm/ku4web-components.js +98 -7
  117. package/dist/esm/loader.js +18 -2
  118. package/dist/esm/uid-5355229f.js +9 -0
  119. package/dist/esm-es5/{index-a39e08fb.js → index-12aee218.js} +1 -1
  120. package/dist/esm-es5/ku4-carousel.entry.js +1 -1
  121. package/dist/esm-es5/ku4-focus-trap.entry.js +1 -1
  122. package/dist/esm-es5/ku4-form.entry.js +1 -1
  123. package/dist/esm-es5/ku4-modal.entry.js +1 -1
  124. package/dist/esm-es5/ku4-preview.entry.js +1 -1
  125. package/dist/esm-es5/ku4-tab-list.entry.js +1 -1
  126. package/dist/esm-es5/ku4web-components.js +1 -1
  127. package/dist/esm-es5/loader.js +1 -1
  128. package/dist/index.js +1 -1
  129. package/dist/ku4web-components/app-globals-0f993ce5.js +3 -0
  130. package/dist/ku4web-components/app-globals-497eb362.system.js +1 -0
  131. package/dist/ku4web-components/css-shim-20dbffa5.js +4 -0
  132. package/dist/ku4web-components/css-shim-856c55de.system.js +1 -0
  133. package/dist/ku4web-components/dom-938307ec.system.js +21 -0
  134. package/dist/ku4web-components/dom-c5ed0ba5.js +73 -0
  135. package/dist/ku4web-components/index-3127d7f7.system.js +1 -0
  136. package/dist/ku4web-components/index-40000e6d.js +3 -0
  137. package/dist/ku4web-components/index-79de9846.system.js +1 -0
  138. package/dist/ku4web-components/index-80439f22.js +3031 -0
  139. package/dist/ku4web-components/index-89916128.js +3 -0
  140. package/dist/ku4web-components/index-c39e9986.system.js +1 -0
  141. package/dist/ku4web-components/index.esm.js +1 -0
  142. package/dist/ku4web-components/index.system.js +1 -0
  143. package/dist/ku4web-components/ku4-carousel-controls.entry.js +83 -0
  144. package/dist/ku4web-components/ku4-carousel-controls.system.entry.js +1 -0
  145. package/dist/ku4web-components/ku4-carousel-slide.entry.js +47 -0
  146. package/dist/ku4web-components/ku4-carousel-slide.system.entry.js +1 -0
  147. package/dist/ku4web-components/ku4-carousel.entry.js +166 -0
  148. package/dist/ku4web-components/ku4-carousel.system.entry.js +1 -0
  149. package/dist/ku4web-components/ku4-col.entry.js +75 -0
  150. package/dist/ku4web-components/ku4-col.system.entry.js +1 -0
  151. package/dist/ku4web-components/ku4-drawer.entry.js +35 -0
  152. package/dist/ku4web-components/ku4-drawer.system.entry.js +1 -0
  153. package/dist/ku4web-components/ku4-feature.entry.js +29 -0
  154. package/dist/ku4web-components/ku4-feature.system.entry.js +1 -0
  155. package/dist/ku4web-components/ku4-focus-trap.entry.js +323 -0
  156. package/dist/ku4web-components/ku4-focus-trap.system.entry.js +1 -0
  157. package/dist/ku4web-components/ku4-form.entry.js +105 -0
  158. package/dist/ku4web-components/ku4-form.system.entry.js +1 -0
  159. package/dist/ku4web-components/ku4-grid.entry.js +108 -0
  160. package/dist/ku4web-components/ku4-grid.system.entry.js +1 -0
  161. package/dist/ku4web-components/ku4-label.entry.js +70 -0
  162. package/dist/ku4web-components/ku4-label.system.entry.js +1 -0
  163. package/dist/ku4web-components/ku4-mask.entry.js +321 -0
  164. package/dist/ku4web-components/ku4-mask.system.entry.js +1 -0
  165. package/dist/ku4web-components/ku4-modal.entry.js +71 -0
  166. package/dist/ku4web-components/ku4-modal.system.entry.js +1 -0
  167. package/dist/ku4web-components/ku4-panel.entry.js +49 -0
  168. package/dist/ku4web-components/ku4-panel.system.entry.js +1 -0
  169. package/dist/ku4web-components/ku4-preview.entry.js +128 -0
  170. package/dist/ku4web-components/ku4-preview.system.entry.js +1 -0
  171. package/dist/ku4web-components/ku4-tab-list.entry.js +76 -0
  172. package/dist/ku4web-components/ku4-tab-list.system.entry.js +1 -0
  173. package/dist/ku4web-components/ku4-tab-panel.entry.js +72 -0
  174. package/dist/ku4web-components/ku4-tab-panel.system.entry.js +1 -0
  175. package/dist/ku4web-components/ku4-tab.entry.js +63 -0
  176. package/dist/ku4web-components/ku4-tab.system.entry.js +1 -0
  177. package/dist/ku4web-components/ku4-table.entry.js +79 -0
  178. package/dist/ku4web-components/ku4-table.system.entry.js +1 -0
  179. package/dist/ku4web-components/ku4-tooltip.entry.js +120 -0
  180. package/dist/ku4web-components/ku4-tooltip.system.entry.js +1 -0
  181. package/dist/ku4web-components/ku4-validation.entry.js +162 -0
  182. package/dist/ku4web-components/ku4-validation.system.entry.js +1 -0
  183. package/dist/ku4web-components/ku4web-components.css +299 -1
  184. package/dist/ku4web-components/ku4web-components.esm.js +125 -1
  185. package/dist/ku4web-components/ku4web-components.js +1 -1
  186. package/dist/ku4web-components/ku4web-components.system.js +1 -0
  187. package/dist/ku4web-components/p-0e3f81f0.system.entry.js +1 -0
  188. package/dist/ku4web-components/p-2c017d37.system.js +1 -1
  189. package/dist/ku4web-components/{p-85ce378f.system.entry.js → p-2d668be8.system.entry.js} +1 -1
  190. package/dist/ku4web-components/{p-ebc796ca.entry.js → p-34e1be7b.entry.js} +1 -1
  191. package/dist/ku4web-components/{p-b313124a.entry.js → p-38a24a64.entry.js} +1 -1
  192. package/dist/ku4web-components/{p-08ec498e.js → p-3d59c1fe.js} +1 -1
  193. package/dist/ku4web-components/p-4b272a58.entry.js +1 -0
  194. package/dist/ku4web-components/{p-e1964f6b.system.entry.js → p-5cab8007.system.entry.js} +1 -1
  195. package/dist/ku4web-components/{p-43683726.system.entry.js → p-6f236a8a.system.entry.js} +1 -1
  196. package/dist/ku4web-components/{p-31fd55e7.system.entry.js → p-73d78335.system.entry.js} +1 -1
  197. package/dist/ku4web-components/{p-52147373.system.js → p-86284ed4.system.js} +1 -1
  198. package/dist/ku4web-components/{p-479439e6.entry.js → p-90a37025.entry.js} +1 -1
  199. package/dist/ku4web-components/{p-54c18ac5.system.entry.js → p-9b46e89b.system.entry.js} +1 -1
  200. package/dist/ku4web-components/{p-6e505024.entry.js → p-a2805805.entry.js} +1 -1
  201. package/dist/ku4web-components/p-f311c0be.entry.js +1 -0
  202. package/dist/ku4web-components/shadow-css-8c625855.js +388 -0
  203. package/dist/ku4web-components/shadow-css-d573707f.system.js +13 -0
  204. package/dist/ku4web-components/uid-5355229f.js +9 -0
  205. package/dist/ku4web-components/uid-93975202.system.js +1 -0
  206. package/dist/types/components/ku4-preview/ku4-preview.d.ts +5 -0
  207. package/dist/types/components/ku4-tab-list/ku4-tab-list.d.ts +2 -2
  208. package/dist/types/components.d.ts +8 -0
  209. package/package.json +20 -20
  210. package/dist/ku4web-components/p-05a75a47.entry.js +0 -1
  211. package/dist/ku4web-components/p-b625e0a4.entry.js +0 -1
  212. package/dist/ku4web-components/p-fd02ffa2.system.entry.js +0 -1
@@ -0,0 +1,221 @@
1
+ @keyframes ku4-carousel-enter-left {
2
+ 0% {
3
+ top: 0;
4
+ transform: translate3d(-100%, 0, 0);
5
+ opacity: 0;
6
+ }
7
+ 100% {
8
+ top: 0;
9
+ transform: translate3d(0, 0, 0);
10
+ opacity: 1;
11
+ }
12
+ }
13
+ @keyframes ku4-carousel-enter-right {
14
+ 0% {
15
+ top: 0;
16
+ transform: translate3d(100%, 0, 0);
17
+ opacity: 0;
18
+ }
19
+ 100% {
20
+ top: 0;
21
+ transform: translate3d(0, 0, 0);
22
+ opacity: 1;
23
+ }
24
+ }
25
+ @keyframes ku4-carousel-exit-left {
26
+ 0% {
27
+ top: 0;
28
+ transform: translate3d(0, 0, 0);
29
+ opacity: 1;
30
+ }
31
+ 100% {
32
+ top: 0;
33
+ transform: translate3d(-100%, 0, 0);
34
+ opacity: 0;
35
+ }
36
+ }
37
+ @keyframes ku4-carousel-exit-right {
38
+ 0% {
39
+ top: 0;
40
+ transform: translate3d(0, 0, 0);
41
+ opacity: 1;
42
+ }
43
+ 100% {
44
+ top: 0;
45
+ transform: translate3d(100%, 0, 0);
46
+ opacity: 0;
47
+ }
48
+ }
49
+ :host {
50
+ position: relative;
51
+ display: flex;
52
+ flex-direction: column;
53
+ align-items: center;
54
+ overflow: hidden;
55
+ background-color: var(--ku4-carousel-background-color, #fff);
56
+ }
57
+
58
+ .slide-container {
59
+ position: relative;
60
+ width: 100%;
61
+ height: 100%;
62
+ overflow: hidden;
63
+ }
64
+
65
+ .controls .next,
66
+ .controls .prev {
67
+ position: absolute;
68
+ display: var(--ku4-carousel-controls-display, block);
69
+ top: var(--ku4-carousel-controls-top, 0);
70
+ border: var(--ku4-carousel-controls-border, none);
71
+ background-color: var(--ku4-carousel-controls-background-color, #fff);
72
+ font-family: var(--ku4-carousel-controls-font-family, Helvetica, Arial, sans-serif);
73
+ font-weight: var(--ku4-carousel-controls-font-weight, 400);
74
+ font-size: var(--ku4-carousel-controls-font-size, 8px);
75
+ line-height: var(--ku4-carousel-controls-line-height, 12px);
76
+ opacity: var(--ku4-carousel-controls-opacity, 0.2);
77
+ z-index: var(--ku4-carousel-controls-z-index, 2);
78
+ }
79
+ .controls .next:focus,
80
+ .controls .prev:focus {
81
+ background-color: var(--ku4-carousel-controls-focus-background-color, transparent);
82
+ outline: var(--ku4-carousel-controls-focus-outline, none);
83
+ opacity: var(--ku4-carousel-controls-focus-opacity, 0.2);
84
+ }
85
+ .controls .next:hover,
86
+ .controls .prev:hover {
87
+ background-color: var(--ku4-carousel-controls-hover-background-color, transparent);
88
+ opacity: var(--ku4-carousel-controls-hover-opacity, 1);
89
+ }
90
+
91
+ .controls .next {
92
+ right: 0;
93
+ width: var(--ku4-carousel-controls-next-width, 40px);
94
+ height: var(--ku4-carousel-controls-next-height, 100%);
95
+ background-image: var(--ku4-carousel-controls-next-background-image);
96
+ background-repeat: var(--ku4-carousel-controls-next-background-repeat, no-repeat);
97
+ background-position-x: var(--ku4-carousel-controls-next-background-position-x, 0);
98
+ background-position-y: var(--ku4-carousel-controls-next-background-position-y, 50%);
99
+ background-size: var(--ku4-carousel-controls-next-background-size, 100% 100%);
100
+ }
101
+ .controls .next:focus {
102
+ background-image: var(--ku4-carousel-controls-next-focus-background-image);
103
+ background-repeat: var(--ku4-carousel-controls-next-focus-background-repeat, no-repeat);
104
+ background-position-x: var(--ku4-carousel-controls-next-focus-background-position-x, 0);
105
+ background-position-y: var(--ku4-carousel-controls-next-focus-background-position-y, 50%);
106
+ background-size: var(--ku4-carousel-controls-next-focus-background-size, 100% 100%);
107
+ }
108
+ .controls .next:hover {
109
+ background-image: var(--ku4-carousel-controls-next-hover-background-image);
110
+ background-repeat: var(--ku4-carousel-controls-next-hover-background-repeat, no-repeat);
111
+ background-position-x: var(--ku4-carousel-controls-next-hover-background-position-x, 0);
112
+ background-position-y: var(--ku4-carousel-controls-next-hover-background-position-y, 50%);
113
+ background-size: var(--ku4-carousel-controls-next-hover-background-size, 100% 100%);
114
+ }
115
+
116
+ .controls .prev {
117
+ left: 0;
118
+ width: var(--ku4-carousel-controls-next-width, 40px);
119
+ height: var(--ku4-carousel-controls-next-height, 100%);
120
+ background-image: var(--ku4-carousel-controls-previous-background-image);
121
+ background-repeat: var(--ku4-carousel-controls-previous-background-repeat, no-repeat);
122
+ background-position-x: var(--ku4-carousel-controls-previous-background-position-x, 0);
123
+ background-position-y: var(--ku4-carousel-controls-previous-background-position-y, 50%);
124
+ background-size: var(--ku4-carousel-controls-previous-background-size, 100% 100%);
125
+ }
126
+ .controls .prev:focus {
127
+ background-image: var(--ku4-carousel-controls-previous-focus-background-image);
128
+ background-repeat: var(--ku4-carousel-controls-previous-focus-background-repeat, no-repeat);
129
+ background-position-x: var(--ku4-carousel-controls-previous-focus-background-position-x, 0);
130
+ background-position-y: var(--ku4-carousel-controls-previous-focus-background-position-y, 50%);
131
+ background-size: var(--ku4-carousel-controls-previous-focus-background-size, 100% 100%);
132
+ }
133
+ .controls .prev:hover {
134
+ background-image: var(--ku4-carousel-controls-previous-hover-background-image);
135
+ background-repeat: var(--ku4-carousel-controls-previous-hover-background-repeat, no-repeat);
136
+ background-position-x: var(--ku4-carousel-controls-previous-hover-background-position-x, 0);
137
+ background-position-y: var(--ku4-carousel-controls-previous-hover-background-position-y, 50%);
138
+ background-size: var(--ku4-carousel-controls-previous-hover-background-size, 100% 100%);
139
+ }
140
+
141
+ .pages {
142
+ position: absolute;
143
+ display: var(--ku4-carousel-pages-display, block);
144
+ top: var(--ku4-carousel-pages-top, auto);
145
+ bottom: var(--ku4-carousel-pages-bottom, 4px);
146
+ width: var(--ku4-carousel-pages-width, auto);
147
+ height: var(--ku4-carousel-pages-height, 20px);
148
+ background-color: var(--ku4-carousel-pages-background-color, transparent);
149
+ opacity: var(--ku4-carousel-pages-opacity, 0.5);
150
+ text-align: center;
151
+ z-index: 3;
152
+ }
153
+
154
+ .pages-text {
155
+ display: inline-block;
156
+ padding: var(--ku4-carousel-pages-text-padding, 4px);
157
+ font-family: var(--ku4-carousel-pages-text-font-family, Helvetica, Arial, sans-serif);
158
+ font-weight: var(--ku4-carousel-pages-text-font-weight, 600);
159
+ font-size: var(--ku4-carousel-pages-text-font-size, 14px);
160
+ line-height: var(--ku4-carousel-pages-text-line-height, 16px);
161
+ color: var(--ku4-carousel-pages-text-color, #aaa);
162
+ }
163
+
164
+ ::slotted(*) {
165
+ position: absolute;
166
+ display: flex;
167
+ flex-direction: column;
168
+ top: 0;
169
+ left: -100%;
170
+ width: 100%;
171
+ box-sizing: border-box;
172
+ }
173
+
174
+ ::slotted(.inactive) {
175
+ position: absolute;
176
+ height: 100%;
177
+ left: 0;
178
+ }
179
+
180
+ ::slotted(.inactive.prev) {
181
+ animation-name: var(--ku4-carousel-animation-inactive-previous-name, ku4-carousel-exit-right);
182
+ animation-duration: var(--ku4-carousel-animation-duration, 0.4s);
183
+ animation-timing-function: var(--ku4-carousel-animation-timing-function);
184
+ animation-fill-mode: forwards;
185
+ }
186
+
187
+ ::slotted(.inactive.next) {
188
+ animation-name: var(--ku4-carousel-animation-inactive-next-name, ku4-carousel-exit-left);
189
+ animation-duration: var(--ku4-carousel-animation-duration, 0.4s);
190
+ animation-timing-function: var(--ku4-carousel-animation-timing-function);
191
+ animation-fill-mode: forwards;
192
+ }
193
+
194
+ ::slotted(.active) {
195
+ position: relative;
196
+ top: 0;
197
+ left: 0;
198
+ width: auto;
199
+ height: 100%;
200
+ z-index: 1;
201
+ }
202
+
203
+ ::slotted(.active.prev) {
204
+ animation-name: var(--ku4-carousel-animation-active-previous-name, ku4-carousel-enter-left);
205
+ animation-duration: var(--ku4-carousel-animation-duration, 0.4s);
206
+ animation-timing-function: var(--ku4-carousel-animation-timing-function, ease);
207
+ animation-fill-mode: forwards;
208
+ }
209
+
210
+ ::slotted(.active.next) {
211
+ animation-name: var(--ku4-carousel-animation-active-next-name, ku4-carousel-enter-right);
212
+ animation-duration: var(--ku4-carousel-animation-duration, 0.4s);
213
+ animation-timing-function: var(--ku4-carousel-animation-timing-function, ease);
214
+ animation-fill-mode: forwards;
215
+ }
216
+
217
+ @media (hover: hover) {
218
+ .controls:hover {
219
+ background-color: var(--ku4-carousel-controls-focus-background-color, #fff);
220
+ }
221
+ }
@@ -0,0 +1,360 @@
1
+ import { Component, Host, Prop, State, Method, Element, h, Event } from '@stencil/core';
2
+ import { Rolodex, Interval, wait } from 'ku4es-kernel';
3
+ import { Swipe } from 'ku4es-ui-kernel';
4
+ /**
5
+ * @description ku4-carousel
6
+ */
7
+ export class Ku4Carousel {
8
+ constructor() {
9
+ /**
10
+ * Sets the distance, in pixels, a touch must travel
11
+ * before activating a swipe.
12
+ */
13
+ this.swipeTolerance = 44;
14
+ /**
15
+ * Will start this carousel in auto scroll mode
16
+ */
17
+ this.auto = false;
18
+ /**
19
+ * Prevents touch swiping
20
+ */
21
+ this.noSwipe = false;
22
+ /**
23
+ * Delay in millisecond between slide changes
24
+ * when running in auto
25
+ */
26
+ this.delay = 8000;
27
+ this.interval = new Interval(this.delay).onInterval(() => {
28
+ if (this.host.isConnected) {
29
+ this.display('next');
30
+ }
31
+ else {
32
+ this.disconnectedCallback();
33
+ }
34
+ });
35
+ this.handleMouse = this.handleMouse.bind(this);
36
+ }
37
+ /**
38
+ * Display the next ku4-carousel-slide
39
+ */
40
+ async next() {
41
+ if (!this.hasSlides) {
42
+ return this;
43
+ }
44
+ await this.pause();
45
+ return this.display('next');
46
+ }
47
+ /**
48
+ * Display the previous ku4-carousel-slide
49
+ */
50
+ async previous() {
51
+ if (!this.hasSlides) {
52
+ return this;
53
+ }
54
+ await this.pause();
55
+ return this.display('prev');
56
+ }
57
+ /**
58
+ * Slide to the slide number specified.
59
+ * @param {number} number - Slide number to slide to.
60
+ */
61
+ async slideTo(number) {
62
+ await this.pause();
63
+ if (!(number === this.currentSlideNumber || number < 1 || this.rolodex.length < number)) {
64
+ const move = number - this.currentSlideNumber;
65
+ const slide = move < 0 ? 'prev' : 'next';
66
+ let count = Math.abs(move);
67
+ while (0 < --count) {
68
+ await wait(10).then(() => this.rolodex[slide]);
69
+ }
70
+ this.display(slide);
71
+ }
72
+ }
73
+ /**
74
+ * Pause auto slide change
75
+ */
76
+ async pause() {
77
+ this.interval.clear();
78
+ }
79
+ /**
80
+ * Start auto slide change
81
+ */
82
+ async play() {
83
+ const { auto, interval } = this;
84
+ auto && interval.start();
85
+ }
86
+ get hasSlides() {
87
+ return this.rolodex && (this.rolodex.length > 1);
88
+ }
89
+ get currentSlideNumber() {
90
+ const { rolodex } = this;
91
+ return rolodex && (rolodex.isEmpty ? 0 : rolodex.index + 1);
92
+ }
93
+ display(slide) {
94
+ const { previous, current } = this.slideState;
95
+ const next = this.rolodex[slide];
96
+ if (previous) {
97
+ previous.deactivate();
98
+ }
99
+ current.slideOut(slide);
100
+ next.slideIn(slide);
101
+ this.slideState = {
102
+ previous: current,
103
+ current: next,
104
+ };
105
+ this.didSlide.emit(this.currentSlideNumber);
106
+ return this;
107
+ }
108
+ handleMouse(e) {
109
+ if (!this.host.contains(e.relatedTarget)) {
110
+ this.play();
111
+ }
112
+ }
113
+ componentWillLoad() {
114
+ if (!this.noSwipe) {
115
+ this.swipe = new Swipe(this.host, this.swipeTolerance)
116
+ .onLeft(() => this.next())
117
+ .onRight(() => this.previous());
118
+ }
119
+ let slides;
120
+ try {
121
+ slides = this.host.querySelectorAll(':scope > ku4-carousel-slide');
122
+ }
123
+ catch (e) {
124
+ slides = [].slice.call(this.host.querySelectorAll('ku4-carousel-slide'))
125
+ .reduce((acc, item) => {
126
+ if (item.parentNode === this.host) {
127
+ acc.push(item);
128
+ }
129
+ return acc;
130
+ }, []);
131
+ }
132
+ this.rolodex = new Rolodex(slides);
133
+ (this.rolodex.current &&
134
+ this.rolodex.current.activate) &&
135
+ this.rolodex.current.activate();
136
+ this.slideState = { current: this.rolodex.current };
137
+ if (this.auto) {
138
+ this.host.addEventListener('mouseout', this.handleMouse);
139
+ this.play();
140
+ }
141
+ }
142
+ connectedCallback() {
143
+ if (this.swipe) {
144
+ this.swipe.destroy();
145
+ }
146
+ this.host.removeEventListener('mouseout', this.handleMouse);
147
+ this.interval.clear();
148
+ }
149
+ disconnectedCallback() {
150
+ if (this.swipe) {
151
+ this.swipe.destroy();
152
+ }
153
+ this.host.removeEventListener('mouseout', this.handleMouse);
154
+ this.interval.clear();
155
+ }
156
+ render() {
157
+ const { hasSlides, currentSlideNumber = 1 } = this;
158
+ return (h(Host, { "aria-roledescription": "carousel", current: currentSlideNumber },
159
+ hasSlides && (h("section", { class: "controls" },
160
+ h("button", { type: "button", class: "prev", onClick: () => this.previous(), "aria-label": "previous slide" }),
161
+ h("button", { type: "button", class: "next", onClick: () => this.next(), "aria-label": "next slide" }))),
162
+ h("section", { class: "slide-container", "aria-live": "polite" },
163
+ h("slot", null)),
164
+ hasSlides && (h("section", { class: "pages" },
165
+ h("span", { class: "pages-text" }, `${currentSlideNumber} of ${this.rolodex.length}`)))));
166
+ }
167
+ static get is() { return "ku4-carousel"; }
168
+ static get encapsulation() { return "shadow"; }
169
+ static get originalStyleUrls() { return {
170
+ "$": ["ku4-carousel.scss"]
171
+ }; }
172
+ static get styleUrls() { return {
173
+ "$": ["ku4-carousel.css"]
174
+ }; }
175
+ static get properties() { return {
176
+ "swipeTolerance": {
177
+ "type": "number",
178
+ "mutable": false,
179
+ "complexType": {
180
+ "original": "number",
181
+ "resolved": "number",
182
+ "references": {}
183
+ },
184
+ "required": false,
185
+ "optional": false,
186
+ "docs": {
187
+ "tags": [],
188
+ "text": "Sets the distance, in pixels, a touch must travel\nbefore activating a swipe."
189
+ },
190
+ "attribute": "swipe-tolerance",
191
+ "reflect": false,
192
+ "defaultValue": "44"
193
+ },
194
+ "auto": {
195
+ "type": "boolean",
196
+ "mutable": false,
197
+ "complexType": {
198
+ "original": "boolean",
199
+ "resolved": "boolean",
200
+ "references": {}
201
+ },
202
+ "required": false,
203
+ "optional": false,
204
+ "docs": {
205
+ "tags": [],
206
+ "text": "Will start this carousel in auto scroll mode"
207
+ },
208
+ "attribute": "auto",
209
+ "reflect": false,
210
+ "defaultValue": "false"
211
+ },
212
+ "noSwipe": {
213
+ "type": "boolean",
214
+ "mutable": false,
215
+ "complexType": {
216
+ "original": "boolean",
217
+ "resolved": "boolean",
218
+ "references": {}
219
+ },
220
+ "required": false,
221
+ "optional": false,
222
+ "docs": {
223
+ "tags": [],
224
+ "text": "Prevents touch swiping"
225
+ },
226
+ "attribute": "no-swipe",
227
+ "reflect": false,
228
+ "defaultValue": "false"
229
+ },
230
+ "delay": {
231
+ "type": "number",
232
+ "mutable": false,
233
+ "complexType": {
234
+ "original": "number",
235
+ "resolved": "number",
236
+ "references": {}
237
+ },
238
+ "required": false,
239
+ "optional": false,
240
+ "docs": {
241
+ "tags": [],
242
+ "text": "Delay in millisecond between slide changes\nwhen running in auto"
243
+ },
244
+ "attribute": "delay",
245
+ "reflect": false,
246
+ "defaultValue": "8000"
247
+ }
248
+ }; }
249
+ static get states() { return {
250
+ "slideState": {}
251
+ }; }
252
+ static get events() { return [{
253
+ "method": "didSlide",
254
+ "name": "slide",
255
+ "bubbles": true,
256
+ "cancelable": true,
257
+ "composed": true,
258
+ "docs": {
259
+ "tags": [],
260
+ "text": "Event fired when slide changes"
261
+ },
262
+ "complexType": {
263
+ "original": "any",
264
+ "resolved": "any",
265
+ "references": {}
266
+ }
267
+ }]; }
268
+ static get methods() { return {
269
+ "next": {
270
+ "complexType": {
271
+ "signature": "() => Promise<this>",
272
+ "parameters": [],
273
+ "references": {
274
+ "Promise": {
275
+ "location": "global"
276
+ }
277
+ },
278
+ "return": "Promise<this>"
279
+ },
280
+ "docs": {
281
+ "text": "Display the next ku4-carousel-slide",
282
+ "tags": []
283
+ }
284
+ },
285
+ "previous": {
286
+ "complexType": {
287
+ "signature": "() => Promise<this>",
288
+ "parameters": [],
289
+ "references": {
290
+ "Promise": {
291
+ "location": "global"
292
+ }
293
+ },
294
+ "return": "Promise<this>"
295
+ },
296
+ "docs": {
297
+ "text": "Display the previous ku4-carousel-slide",
298
+ "tags": []
299
+ }
300
+ },
301
+ "slideTo": {
302
+ "complexType": {
303
+ "signature": "(number: any) => Promise<void>",
304
+ "parameters": [{
305
+ "tags": [{
306
+ "name": "param",
307
+ "text": "number - Slide number to slide to."
308
+ }],
309
+ "text": "- Slide number to slide to."
310
+ }],
311
+ "references": {
312
+ "Promise": {
313
+ "location": "global"
314
+ }
315
+ },
316
+ "return": "Promise<void>"
317
+ },
318
+ "docs": {
319
+ "text": "Slide to the slide number specified.",
320
+ "tags": [{
321
+ "name": "param",
322
+ "text": "number - Slide number to slide to."
323
+ }]
324
+ }
325
+ },
326
+ "pause": {
327
+ "complexType": {
328
+ "signature": "() => Promise<void>",
329
+ "parameters": [],
330
+ "references": {
331
+ "Promise": {
332
+ "location": "global"
333
+ }
334
+ },
335
+ "return": "Promise<void>"
336
+ },
337
+ "docs": {
338
+ "text": "Pause auto slide change",
339
+ "tags": []
340
+ }
341
+ },
342
+ "play": {
343
+ "complexType": {
344
+ "signature": "() => Promise<void>",
345
+ "parameters": [],
346
+ "references": {
347
+ "Promise": {
348
+ "location": "global"
349
+ }
350
+ },
351
+ "return": "Promise<void>"
352
+ },
353
+ "docs": {
354
+ "text": "Start auto slide change",
355
+ "tags": []
356
+ }
357
+ }
358
+ }; }
359
+ static get elementRef() { return "host"; }
360
+ }
@@ -0,0 +1,32 @@
1
+ :host {
2
+ position: relative;
3
+ display: block;
4
+ }
5
+
6
+ input[type=radio] {
7
+ appearance: none;
8
+ position: relative;
9
+ width: 20px;
10
+ height: 20px;
11
+ margin: 0;
12
+ padding: 0;
13
+ border: solid 1px #888;
14
+ border-radius: 50%;
15
+ box-sizing: border-box;
16
+ vertical-align: middle;
17
+ }
18
+ input[type=radio]:checked:after {
19
+ content: "";
20
+ position: absolute;
21
+ top: 2px;
22
+ left: 2px;
23
+ width: 14px;
24
+ height: 14px;
25
+ margin: 0;
26
+ padding: 0;
27
+ border: solid 1px #888;
28
+ border-radius: 50%;
29
+ box-sizing: border-box;
30
+ text-align: center;
31
+ background-color: #333;
32
+ }